mirror of
https://github.com/monoxgas/Koppeling
synced 2026-06-06 16:14:35 +00:00
Remove .dll extension from forwards (lookup failure causes crashes on some 2k8/w7 hosts)
This commit is contained in:
+1
-1
@@ -17,7 +17,7 @@ int main() {
|
||||
HMODULE module = LoadLibrary(L"Theif.dll");
|
||||
if (!module) return 1;
|
||||
|
||||
DynExport Dynamic = (DynExport)GetProcAddress(module, "Mucklow");
|
||||
DynExport Dynamic = (DynExport)GetProcAddress(module, "Dynamic");
|
||||
if (!Dynamic) return 1;
|
||||
|
||||
if (Dynamic()) {
|
||||
|
||||
@@ -83,6 +83,9 @@ namespace NetClone
|
||||
}
|
||||
static void CloneExports(ref PeFile target, PeFile reference, string referencePath, string sectionName)
|
||||
{
|
||||
// Forwards don't typically supply an extension
|
||||
referencePath = referencePath.Replace(".dll", "");
|
||||
|
||||
IMAGE_DATA_DIRECTORY tgtExportDirectory = target.ImageNtHeaders.OptionalHeader.DataDirectory[0];
|
||||
IMAGE_DATA_DIRECTORY refExportDirectory = reference.ImageNtHeaders.OptionalHeader.DataDirectory[0];
|
||||
|
||||
|
||||
@@ -67,6 +67,9 @@ def add_section(pe, name, size, characteristics = DEFAULT_CHARACTERISTICS):
|
||||
|
||||
def _clone_exports(tgt, ref, ref_path, new_section_name = '.rdata2'):
|
||||
|
||||
# Forwards don't typically supply the extension
|
||||
ref_path = ref_path.replace('.dll', '')
|
||||
|
||||
ref = copy.deepcopy(ref)
|
||||
tgt = copy.deepcopy(tgt)
|
||||
|
||||
|
||||
+2
-2
@@ -9,8 +9,8 @@ BOOL RebuildExportTable(PBYTE ourBase, PBYTE targetBase);
|
||||
|
||||
#ifdef _FORWARD
|
||||
|
||||
#pragma comment(linker,"/export:Static=Functions.dll.Static")
|
||||
#pragma comment(linker,"/export:Dynamic=Functions.dll.Dynamic")
|
||||
#pragma comment(linker,"/export:Static=Functions.Static")
|
||||
#pragma comment(linker,"/export:Dynamic=Functions.Dynamic")
|
||||
|
||||
#else
|
||||
|
||||
|
||||
Reference in New Issue
Block a user