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 


Problem using Call/ret operators

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
Xblade Of Heaven
Master Cheater
Reputation: 0

Joined: 16 Oct 2005
Posts: 395
Location: DEAD

PostPosted: Fri Nov 20, 2015 8:06 pm    Post subject: Problem using Call/ret operators Reply with quote

Hi all, i leave my problem explained in an image



how can fix the ret return to returnhere address 0AE1D59F no in 0AE1D59E

me understand ret rerutn to next call address, ok, somebody can help me for return to correct adress?

regards

_________________
Welcome to the Hell.
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
Zanzer
I post too much
Reputation: 126

Joined: 09 Jun 2013
Posts: 3278

PostPosted: Fri Nov 20, 2015 9:05 pm    Post subject: Reply with quote

That is how CALL and RET work.
Sounds like you want to use this instead.
Code:
jmp MyCode
jmp returnhere
Back to top
View user's profile Send private message
Xblade Of Heaven
Master Cheater
Reputation: 0

Joined: 16 Oct 2005
Posts: 395
Location: DEAD

PostPosted: Fri Nov 20, 2015 9:24 pm    Post subject: Reply with quote

Zanzer wrote:
That is how CALL and RET work.
Sounds like you want to use this instead.
Code:
jmp MyCode
jmp returnhere


yes but i try use call and ret no jmp instruction.

regards

_________________
Welcome to the Hell.
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
ParkourPenguin
I post too much
Reputation: 152

Joined: 06 Jul 2014
Posts: 4709

PostPosted: Fri Nov 20, 2015 9:37 pm    Post subject: Reply with quote

Considering you replaced the byte at 0AE1D59E with NOP, it should work anyways.

But if you absolutely must change the return address, then just modify the address on the top of the stack. From an x86 reference:
Quote:
RET: Transfers program control to a return address located on the top of the stack.

So just add however many bytes you want to [esp] right before you execute ret.

_________________
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
Dark Byte
Site Admin
Reputation: 471

Joined: 09 May 2003
Posts: 25813
Location: The netherlands

PostPosted: Sat Nov 21, 2015 2:33 am    Post subject: Reply with quote

also a heads up just in case you get other errors, you're comparing [esp+58] with a value.
the call, pushfd and pushad will change esp

_________________
Do not ask me about online cheats. I don't know any and wont help finding them.

Like my help? Join me on Patreon so i can keep helping
Back to top
View user's profile Send private message MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming 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