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 


Force function return value.
Goto page 1, 2  Next
 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General Gamehacking
View previous topic :: View next topic  
Author Message
kriso02
Newbie cheater
Reputation: 0

Joined: 21 Nov 2016
Posts: 11

PostPosted: Sun Mar 12, 2017 9:11 am    Post subject: Force function return value. Reply with quote

So I have located the verification function of a game and need it to always return 4. How do I do that?
Back to top
View user's profile Send private message
Zanzer
I post too much
Reputation: 116

Joined: 09 Jun 2013
Posts: 3180

PostPosted: Sun Mar 12, 2017 9:34 am    Post subject: Reply with quote

Code:
mov eax,4
ret
Back to top
View user's profile Send private message
kriso02
Newbie cheater
Reputation: 0

Joined: 21 Nov 2016
Posts: 11

PostPosted: Sun Mar 12, 2017 11:35 am    Post subject: Reply with quote

does not work. the app is written in .net btw
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 326

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

PostPosted: Sun Mar 12, 2017 3:40 pm    Post subject: Reply with quote

find out which ret the function uses and use that
_________________
Do not ask me about online cheats. I don't know any and wont help finding them.
Back to top
View user's profile Send private message MSN Messenger
kriso02
Newbie cheater
Reputation: 0

Joined: 21 Nov 2016
Posts: 11

PostPosted: Mon Mar 13, 2017 4:55 am    Post subject: Reply with quote

How do I do that. Cheat engine disassembles wrong or something. Do I post the code here?
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 326

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

PostPosted: Mon Mar 13, 2017 5:10 am    Post subject: Reply with quote

if it's using the stdcall calling convention, ret needs to know the number of parameters given so it can pop those of as well

e.g if one parameter is given, then ret 4. If 2 parameters, ret 8

just look at the original function to see which ret is uses

_________________
Do not ask me about online cheats. I don't know any and wont help finding them.
Back to top
View user's profile Send private message MSN Messenger
kriso02
Newbie cheater
Reputation: 0

Joined: 21 Nov 2016
Posts: 11

PostPosted: Mon Mar 13, 2017 9:10 am    Post subject: Reply with quote

Well. Minor problem. There is no ret opcode
Back to top
View user's profile Send private message
++METHOS
I post too much
Reputation: 72

Joined: 29 Oct 2010
Posts: 3537

PostPosted: Mon Mar 13, 2017 9:36 am    Post subject: Reply with quote

A jump or call, then?
Back to top
View user's profile Send private message
kriso02
Newbie cheater
Reputation: 0

Joined: 21 Nov 2016
Posts: 11

PostPosted: Mon Mar 13, 2017 10:06 am    Post subject: Reply with quote

i found 3 jumps. 2 leading to a function 3rd is unidentified.
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 326

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

PostPosted: Mon Mar 13, 2017 10:16 am    Post subject: Reply with quote

i really recommend finding the ret instruction. just scroll down
_________________
Do not ask me about online cheats. I don't know any and wont help finding them.
Back to top
View user's profile Send private message MSN Messenger
Zanzer
I post too much
Reputation: 116

Joined: 09 Jun 2013
Posts: 3180

PostPosted: Mon Mar 13, 2017 10:52 am    Post subject: Reply with quote

Use break and trace. CE will make it easy to find the return instruction.
Back to top
View user's profile Send private message
++METHOS
I post too much
Reputation: 72

Joined: 29 Oct 2010
Posts: 3537

PostPosted: Mon Mar 13, 2017 11:20 am    Post subject: Reply with quote

Ollydbg has execute til return. Last I remember, CE would step past the return...but it should not be difficult, regardless.
Back to top
View user's profile Send private message
kriso02
Newbie cheater
Reputation: 0

Joined: 21 Nov 2016
Posts: 11

PostPosted: Mon Mar 13, 2017 12:25 pm    Post subject: Reply with quote

There is no ret. thats the problem. i would post code but it doesn't allow me.
another problem is it is executed at program start most of the time
Back to top
View user's profile Send private message
++METHOS
I post too much
Reputation: 72

Joined: 29 Oct 2010
Posts: 3537

PostPosted: Mon Mar 13, 2017 12:34 pm    Post subject: Reply with quote

You can write a script to pause the target or set a breakpoint on startup. You can also use Ollydbg or similar, and it can automatically break on entry point or whatever you set that up for.

Can you disclose the target?

Are you sure it is not packed or obfuscated in some way?
Back to top
View user's profile Send private message
kriso02
Newbie cheater
Reputation: 0

Joined: 21 Nov 2016
Posts: 11

PostPosted: Mon Mar 13, 2017 1:01 pm    Post subject: Reply with quote

im not sure. but i got the decompiled code
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 Gamehacking All times are GMT - 6 Hours
Goto page 1, 2  Next
Page 1 of 2

 
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