PE: Make imports in decompressor stub optional
This commit is contained in:
committed by
Markus F.X.J. Oberhumer
parent
76ddf6b8da
commit
1d9c211eed
+14
-11
@@ -167,7 +167,7 @@ void PackW64Pep::buildLoader(const Filter *ft)
|
||||
|
||||
if (ih.entry && isdll)
|
||||
addLoader("PEISDLL9");
|
||||
addLoader(ih.entry ? "PEDOJUMP" : "PERETURN", nullptr);
|
||||
addLoader(ih.entry || !ilinker ? "PEDOJUMP" : "PERETURN", nullptr);
|
||||
|
||||
//NEW: TLS callback support PART 2, the callback handler - Stefan Widmann
|
||||
if(use_tls_callbacks)
|
||||
@@ -227,16 +227,19 @@ void PackW64Pep::defineSymbols(unsigned ncsection, unsigned upxsection,
|
||||
ilinkerGetAddress("kernel32.dll", "VirtualProtect"));
|
||||
}
|
||||
linker->defineSymbol("start_of_relocs", crelocs);
|
||||
if (!isdll)
|
||||
linker->defineSymbol("ExitProcess",
|
||||
ilinkerGetAddress("kernel32.dll", "ExitProcess"));
|
||||
linker->defineSymbol("GetProcAddress",
|
||||
ilinkerGetAddress("kernel32.dll", "GetProcAddress"));
|
||||
linker->defineSymbol("kernel32_ordinals", myimport);
|
||||
linker->defineSymbol("LoadLibraryA",
|
||||
ilinkerGetAddress("kernel32.dll", "LoadLibraryA"));
|
||||
linker->defineSymbol("start_of_imports", myimport);
|
||||
linker->defineSymbol("compressed_imports", cimports);
|
||||
|
||||
if (ilinker) {
|
||||
if (!isdll)
|
||||
linker->defineSymbol("ExitProcess",
|
||||
ilinkerGetAddress("kernel32.dll", "ExitProcess"));
|
||||
linker->defineSymbol("GetProcAddress",
|
||||
ilinkerGetAddress("kernel32.dll", "GetProcAddress"));
|
||||
linker->defineSymbol("kernel32_ordinals", myimport);
|
||||
linker->defineSymbol("LoadLibraryA",
|
||||
ilinkerGetAddress("kernel32.dll", "LoadLibraryA"));
|
||||
linker->defineSymbol("start_of_imports", myimport);
|
||||
linker->defineSymbol("compressed_imports", cimports);
|
||||
}
|
||||
|
||||
if (M_IS_LZMA(ph.method))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user