Reverse Engineering Asked by SplitHorizon on June 11, 2021
This is my first time asking something on SE and I’ll do the best I can to provide all of the required information, but I apologize in advance if I’m not clear enough.
I’m trying to reverse engineer a certain fighting game to be able to run the moves “manually”. What I mean by this is, say a certain power move is run by pressing S A J quickly on the keyboard, I want to be able to just jump to the method to use that move in the code without having to press the keys.
so far I’ve tried using CheatEngine and OllyDbg to search for strings that match the move names, and also looked at what values changed before, during, and after executing the move, but neither seems to have done anything.
I’m relatively new to the assembly language, but have quite a bit of experience in c++, c# and other languages.
I looked for questions similar to this one before posting it, but couldn’t seem to find anything that would help. If this has been posted before and I just missed it, sorry about that.
Thanks in advance for any answers.
Considering that this is the RE forum, this is how I would find the function.
call
statements that are hit, one of them is likely to be the function you care about.Answered by josh poley on June 11, 2021
Assuming this game is a bit more complex than a 8bit console game I'm afraid hooking getchar()
and the likes won't do you much good.
With Windows windowed/full screen games, input is received by handling window messages, usually in a message loop.
In such cases, each window has its own message processing loop, in witch it constantly calls GetMessage()
to receive events it should react to, such as key presses. GetMessage()
s first parameter is a pointer to MSG
structure which it populates with the next message after removing it from the queue.
Go here for a message loop example, here for GetMessage()
documentation, and finally here for the MSG
structure documentation.
In that case you should place breakpoints on:
GetMessage
PeekMessage
After you've got to the message loop, you'll probably encounter a medium sized switch-case handling the different message types. That switch-case should read the MSG
structure's message
member for message types that belong to the keyboard. most commonly those are:
Once you've found the case handling those types, you should be pretty close to the function you're looking for. That case will most-likely do a few lines for code worth of parameter preparations and then call the function you're looking for.
Answered by NirIzr on June 11, 2021
Get help from others!
Recent Answers
Recent Questions
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP