A friend of me challenged me to hack a small program he coded. Basically, it is an exe file that displays an image but in order to do so you need a key file with a password.
I started to reverse engineer it with ollydgb and I was able to figure out that a file with name key.txt needs to be present and contain the password. Another thing I realized is that my friend uses the password to calculate a memory adress and call it. So, if you have the wrong password, the application will crash since it will jump to a random address, probably causing a violation.
He basically stores de password in EBX. He puts a fixed value EAX. Then he does ADD EAX, EBX and finally CALL EAX.
So, knowing all this, if I know which address be executed next, I could just substract the address from the fixed value stored in EAX and I will get the HEX value corresponding to the password.
My problem is, how in the world can I know which should be the next address to be executed? I am fairly new to cracking...
I try to point to the next address after the CALL but it does not work. I also checked the libraries it is using and I certainly see opengl32 but I am not sure if I have to jump somehow to that library.
My question is, how can I figure out which is the next address to be executed?