packer-tutorial icon indicating copy to clipboard operation
packer-tutorial copied to clipboard

[fix] should use IMAGE_ORDINAL32

Open ImFlo opened this issue 4 years ago • 0 comments

https://github.com/jeremybeaume/packer-tutorial/blob/b2e90acac3f6376c37f872321ac1ae897af2069a/part2/main.c#L131

According to the msdn : "If this parameter is an ordinal value, it must be in the low-order word; the high-order word must be zero.", cf. https://docs.microsoft.com/fr-fr/windows/win32/api/libloaderapi/nf-libloaderapi-getprocaddress

This line should be : function_handle = (LPVOID)GetProcAddress(import_module, (LPSTR)IMAGE_ORDINAL32(lookup_addr));

ImFlo avatar Jun 27 '21 08:06 ImFlo