Fix import thunk resolving.

This commit is contained in:
Skyth
2024-09-22 13:32:38 +03:00
parent 918e09d380
commit 510cff56f2
5 changed files with 11 additions and 5 deletions

View File

@@ -101,12 +101,13 @@ Image Xex2LoadImage(const uint8_t* data)
auto originalThunk = (XEX_THUNK_DATA*)image.Find(descriptors[im].FirstThunk);
auto thunkType = originalThunk->Function >> 24;
if (thunkType == 1)
if (thunkType != 0)
{
uint32_t thunk[4] = { 0x00000060, 0x00000060, 0x00000060, 0x2000804E };
memcpy(originalThunk, thunk, sizeof(thunk));
}
}
library = (XEX_IMPORT_LIBRARY*)((char*)(library + 1) + library->NumberOfImports * sizeof(XEX_IMPORT_DESCRIPTOR));
}
}