Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Opcode Length issue, I need clarification

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General Discussions
View previous topic :: View next topic  
Author Message
rovnix
Newbie cheater
Reputation: 0

Joined: 09 Feb 2014
Posts: 18

PostPosted: Sat Jul 06, 2019 4:11 pm    Post subject: Opcode Length issue, I need clarification Reply with quote

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
View user's profile Send private message Yahoo Messenger
Csimbi
I post too much
Reputation: 94

Joined: 14 Jul 2007
Posts: 3110

PostPosted: Sun Jul 07, 2019 1:42 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General Discussions All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites