I'm reversing a 32bit binary for a challenge I got at a college lab and I'm having a hard time trying to understand the intent of the asm code.
The binary is a 10 level reversing game where you get no info at the start and have to figure out everything on your way on building a flag at the end.
Basically it uses a lot of encryption techniques to derive strings from integer values (as far as I got). I figured out some of the imports it uses like LoadLibraryA
, GetProcAddress
(I guess it uses them later on somehow).
Where I'm currently stuck is the asm code calls GetProcAddress
with kernel32.dll
handle as the first argument and 0
( or NULL
I guess ) as the second argument. The return I get is then used to make some integer division. My problem is that I get NULL
from the GetProcAddress
call and then when hitting the idiv
, I get a Division By 0 Exception thrown.
On 0x00401A85
eax
is 0
(NULL
). Any ideas on how to solve this? What's the idea behind passing 0
(NULL
) as the second parameter?
Thanks!