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 


issues with finding function in memory

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General Gamehacking
View previous topic :: View next topic  
Author Message
fraxe
How do I cheat?
Reputation: 0

Joined: 06 May 2020
Posts: 2

PostPosted: Wed May 06, 2020 5:14 am    Post subject: issues with finding function in memory Reply with quote

Hi there, i am not very experienced in reverse engineering and unfortunately i encountered blocking problem with finding function in memory.

For now i can't post links, so i mentioned attachment name where it should be placed.

Maybe i will reproduce my steps below, i will appreciate some kind of code review if the steps are correct.

The goal is find a function that performs attacking player.

1. i found address with currently attacked player id
2. next using "find out what writes to this address" i found one instruction (attachment 2)
3. after that, using "select current function" in disassembler i got function starting like that (attachment 3)

Now, i assume that 00564390 is address of my function, am i correct?

Next, basing on Dark Byte answer below i tried to set breakpoint on function start and find out what are the arguments of this functions, but in RSP i have kinda unclear values, i don't know where is the limit where arguments stop. (attachment arguments)

Dark Byte wrote:
at the entrypoint [ESP+4] contains the parameter
If you're inside the function body (after the header) then the parameter will be in [EBP+8]

Easiest method is just checking the stackview and optional stackview->stacktrace to see the parameters, and the functions that called that function and their parameters


Stacktrace shows value only in "full stack" mode, otherwise is empty, here is RSP on breakpoint in predicted function start. (attachment rsp)

Could anyone check if my steps are correct? I will appreciate any advice.

Best regards!



2.png
 Description:
 Filesize:  1.05 KB
 Viewed:  1152 Time(s)

2.png



3.png
 Description:
 Filesize:  7.82 KB
 Viewed:  1152 Time(s)

3.png



arguments.png
 Description:
 Filesize:  17.32 KB
 Viewed:  1152 Time(s)

arguments.png



rsp.png
 Description:
 Filesize:  6.51 KB
 Viewed:  1152 Time(s)

rsp.png


Back to top
View user's profile Send private message
ParkourPenguin
I post too much
Reputation: 152

Joined: 06 Jul 2014
Posts: 4722

PostPosted: Wed May 06, 2020 10:56 am    Post subject: Reply with quote

In 32-bit code, arguments are passed through the stack.
In 64-bit code, the first 4 arguments are passed through rcx, rdx, r8, and r9 respectively, and then any extras are passed through the stack.
But all that seems pointless since that function isn't conforming to standard calling conventions (or that's not actually the start of the function).

I'd go to the current return address of the stack (7F1E5C) and see what's going on there. i.e. check if it even is code (if not -> probably not actual start of the function), and if so, see what it's doing around the call.

_________________
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
fraxe
How do I cheat?
Reputation: 0

Joined: 06 May 2020
Posts: 2

PostPosted: Sat May 09, 2020 8:36 am    Post subject: Reply with quote

@ParkourPenguin, thank you very much for reply, I'll try to investigate correct address to this function.
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
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