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 


Code Injection and return. Need helps, thanks.

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine
View previous topic :: View next topic  
Author Message
Dr.Disrespect
Grandmaster Cheater
Reputation: 3

Joined: 17 Feb 2016
Posts: 526

PostPosted: Tue Mar 01, 2016 10:57 am    Post subject: Code Injection and return. Need helps, thanks. Reply with quote

How do I return to other lines in the code other than "returnhere" in the code injection template? For example:
1. I inject my code at line 100
2. I want to return to line 110 after the execution of my injected code.

How to do that? Thanks.
Back to top
View user's profile Send private message
hhhuut
Grandmaster Cheater
Reputation: 6

Joined: 08 Feb 2015
Posts: 607

PostPosted: Tue Mar 01, 2016 10:59 am    Post subject: Reply with quote

You can also do something like:
Code:
jmp returnhere+20

which will jump to the next instruction after the code injection plus 20 (hex!) bytes.
Back to top
View user's profile Send private message
ParkourPenguin
I post too much
Reputation: 152

Joined: 06 Jul 2014
Posts: 4718

PostPosted: Tue Mar 01, 2016 11:01 am    Post subject: Reply with quote

"returnhere" is just a label- a representation of an address. If you write your jump at derp.dll+100 and you want to return to derp.dll+110, then just write jmp derp.dll+110.
_________________
I don't know where I'm going, but I'll figure it out when I get there.
Back to top
View user's profile Send private message
Dr.Disrespect
Grandmaster Cheater
Reputation: 3

Joined: 17 Feb 2016
Posts: 526

PostPosted: Tue Mar 01, 2016 11:03 am    Post subject: Reply with quote

hhhuut wrote:
You can also do something like:
Code:
jmp returnhere+20

which will jump to the next instruction after the code injection plus 20 (hex!) bytes.


Thanks for the reply. A follow up question:
00 1F FA 88

In the code above, "1F" is one byte as well as "88", right?

@ParkourPenguin:
So I can jump to any module addresses, right? Thanks.
Back to top
View user's profile Send private message
ParkourPenguin
I post too much
Reputation: 152

Joined: 06 Jul 2014
Posts: 4718

PostPosted: Tue Mar 01, 2016 11:20 am    Post subject: Reply with quote

Yes. Or, you can jump to any other address you want to. CE will automatically translate the location of the module+offset into bytes, then use that in the machinecode. So you can jump to any address you want to, even if it's not a part of a module. For example, if you are using an AoB scan and you store the result into the symbol "aobaddy", then you could also write jmp aobaddy+10 and it'll work.

Also, yes, each sequence of 2 hexadecimal digits is 1 byte.

_________________
I don't know where I'm going, but I'll figure it out when I get there.
Back to top
View user's profile Send private message
Dr.Disrespect
Grandmaster Cheater
Reputation: 3

Joined: 17 Feb 2016
Posts: 526

PostPosted: Tue Mar 01, 2016 11:23 am    Post subject: Reply with quote

ParkourPenguin wrote:
Yes. Or, you can jump to any other address you want to. CE will automatically translate the location of the module+offset into bytes, then use that in the machinecode. So you can jump to any address you want to, even if it's not a part of a module. For example, if you are using an AoB scan and you store the result into the symbol "aobaddy", then you could also write jmp aobaddy+10 and it'll work.

Also, yes, each sequence of 2 hexadecimal digits is 1 byte.

Got it, thanks a lot! Smile
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine 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