|
Cheat Engine The Official Site of Cheat Engine
|
View previous topic :: View next topic |
Author |
Message |
rovnix Newbie cheater Reputation: 0
Joined: 09 Feb 2014 Posts: 18
|
Posted: Sat Jul 06, 2019 4:11 pm Post subject: Opcode Length issue, I need clarification |
|
|
No one to give me a guide to what i want to learn hence i have to learn here on Forums and from little resources i have left.
Now i have been trying my best to understand hooking (game hacking only, No malware) I want to have to Hook some Functions now i see what these fellow writes here
http://www.rohitab.com/discuss/topic/41671-firefox-hooking/?p=10100199 If it is not a windows WINAPI Function, it takes 8 bytes instruction, if its a Windows WinAPI function , what then should it take , 5 bytes?
Pls i am kind of new to Reverse Engineering |
|
Back to top |
|
|
Csimbi I post too much Reputation: 94
Joined: 14 Jul 2007 Posts: 3110
|
Posted: Sun Jul 07, 2019 1:42 pm Post subject: |
|
|
You create a hook by replacing instructions with a jump.
A jump in a 32bit executable is typically 5 bytes - the first byte is the instruction to jump followed by the destination address.
If the instructions you replace amount to exactly 5 bytes, great.
Otherwise, you will need to replace more than 5, "rounding it up" until the end of the next instruction's bytecode.
Remember to save the code you replace because:
- a) you might need to execute it
- b) you will need to restore it in case you want to remove the hook
Also, make sure there's no jump instruction pointing into the instructions you replace (in case you replace more than one instruction, it is possible something points to the second instruction -> crash).
Good luck! |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum
|
|