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 


Saving X on spawn

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General Gamehacking
View previous topic :: View next topic  
Author Message
nero1232
Advanced Cheater
Reputation: 0

Joined: 08 Mar 2017
Posts: 59

PostPosted: Thu Mar 16, 2017 5:26 pm    Post subject: Saving X on spawn Reply with quote

Hi,

I want to save the value of X when the player spawns.

I have the pointer to the player base and X location and this changes every time you spawn. However I did a "find what writes to this pointer" and "...this address" and when I die nothing gets written so I am a bit confused. How is it updating the pointer address if nothing is being written?

Anyway my main problem is I want to save X when the player spawns so how do you think I should go about this? I am thinking whatever writes the new values of the X coordinate on spawn is a great place to hook into and save the value but not sure why nothing is showing up, probably something I am doing wrong Very Happy

X pointer is a multi 5 level pointer.

Thanks
Back to top
View user's profile Send private message
++METHOS
I post too much
Reputation: 75

Joined: 29 Oct 2010
Posts: 3671

PostPosted: Thu Mar 16, 2017 5:49 pm    Post subject: Reply with quote

Use injection. Hook the function that accesses player coordinates, exclusively (or segregate code as needed), then store X using a custom symbol.
Back to top
View user's profile Send private message
nero1232
Advanced Cheater
Reputation: 0

Joined: 08 Mar 2017
Posts: 59

PostPosted: Thu Mar 16, 2017 6:16 pm    Post subject: Reply with quote

++METHOS wrote:
Use injection. Hook the function that accesses player coordinates, exclusively (or segregate code as needed), then store X using a custom symbol.


Yes I get this, but the code that writes the player coordinates is executed and written constantly, this is no go to me. I only care about the X coordinate when you first spawn.

Even if I hooked this function I would still need a way to know when the player spawned, I don't just need X, I specifically want the X value on player spawn only, so I don't think hooking the movement function is the best way to do this.

I want to find what writes the new address to the pointer or something similar so I can save the value once the player spawns and not save it when the player is just moving around for example.

Do you see what I mean?
Back to top
View user's profile Send private message
++METHOS
I post too much
Reputation: 75

Joined: 29 Oct 2010
Posts: 3671

PostPosted: Thu Mar 16, 2017 6:46 pm    Post subject: Reply with quote

Yes, but you did not specify that in your OP.

Hook the instruction that handles coordinates. Store X coordinate value and X coordinate address:

If [address_1] is == 0 then store current address in [address_1], else jmp to code segment for compare.
-->cmp current address to [address_1]. If not equal, store current address in [address_1] and store value in [value_1], else jmp to originalcode.

This should store value of X, only when address of X changes (i.e. when you re-spawn).
Back to top
View user's profile Send private message
Zanzer
I post too much
Reputation: 120

Joined: 09 Jun 2013
Posts: 3242

PostPosted: Thu Mar 16, 2017 6:51 pm    Post subject: Reply with quote

Don't need to first check for 0, because 0 won't match the current address either. Smile
Back to top
View user's profile Send private message
++METHOS
I post too much
Reputation: 75

Joined: 29 Oct 2010
Posts: 3671

PostPosted: Thu Mar 16, 2017 6:54 pm    Post subject: Reply with quote

Fair point. Very Happy
Back to top
View user's profile Send private message
nero1232
Advanced Cheater
Reputation: 0

Joined: 08 Mar 2017
Posts: 59

PostPosted: Thu Mar 16, 2017 6:55 pm    Post subject: Reply with quote

++METHOS wrote:
Yes, but you did not specify that in your OP.

Hook the instruction that handles coordinates. Store X coordinate value and X coordinate address:

If [address_1] is == 0 then store current address in [address_1], else jmp to code segment for compare.
-->cmp current address to [address_1]. If not equal, store current address in [address_1] and store value in [value_1], else jmp to originalcode.

This should store value of X, only when address of X changes (i.e. when you re-spawn).


What if the code handles multiple addresses as I'm pretty sure it changes 10 or so addresses, this would mean the compare would fail even if the player was still on the same life?
Back to top
View user's profile Send private message
++METHOS
I post too much
Reputation: 75

Joined: 29 Oct 2010
Posts: 3671

PostPosted: Thu Mar 16, 2017 6:57 pm    Post subject: Reply with quote

++METHOS wrote:
Hook the function that accesses player coordinates, exclusively (or segregate code as needed)


++METHOS wrote:
You will need to segregate any code that you intend to manipulate.

++METHOS wrote:
  • You can use a pointer address for your filter, inside of your script, for the value that you are trying to manipulate.
  • You can use pointer trees inside of the data structure to find something viable.
  • You can shift the data structure (+ or -) and/or expand its size to find something useful.
  • You can use the structure spider to find workable strings and/or for comparative analysis.
  • You can check the register values by attaching the debugger or setting a breakpoint to see if something can be used for your filter.
  • You can check to see if there are any instructions that are exclusive to the address/value that you are trying to manipulate and store the address for your filter by creating a second injection point.
  • You can check to see if there are any instructions that are exclusive to any other address/value inside of the data structure for the address/value that you are trying to manipulate and store the address for your filter by creating a second injection point.
  • You can analyze assembly code to see if an identifier is being checked or assigned somewhere.
  • Et al.
Back to top
View user's profile Send private message
nero1232
Advanced Cheater
Reputation: 0

Joined: 08 Mar 2017
Posts: 59

PostPosted: Thu Mar 16, 2017 7:07 pm    Post subject: Reply with quote

++METHOS wrote:
++METHOS wrote:
Hook the function that accesses player coordinates, exclusively (or segregate code as needed)


++METHOS wrote:
You will need to segregate any code that you intend to manipulate.

++METHOS wrote:
  • You can use a pointer address for your filter, inside of your script, for the value that you are trying to manipulate.
  • You can use pointer trees inside of the data structure to find something viable.
  • You can shift the data structure (+ or -) and/or expand its size to find something useful.
  • You can use the structure spider to find workable strings and/or for comparative analysis.
  • You can check the register values by attaching the debugger or setting a breakpoint to see if something can be used for your filter.
  • You can check to see if there are any instructions that are exclusive to the address/value that you are trying to manipulate and store the address for your filter by creating a second injection point.
  • You can check to see if there are any instructions that are exclusive to any other address/value inside of the data structure for the address/value that you are trying to manipulate and store the address for your filter by creating a second injection point.
  • You can analyze assembly code to see if an identifier is being checked or assigned somewhere.
  • Et al.


What do you think is the easiest way? I'm not sure how to even set up a filter?
Back to top
View user's profile Send private message
++METHOS
I post too much
Reputation: 75

Joined: 29 Oct 2010
Posts: 3671

PostPosted: Thu Mar 16, 2017 7:17 pm    Post subject: Reply with quote

++METHOS wrote:
  • You can check the register values by attaching the debugger or setting a breakpoint to see if something can be used for your filter.
  • You can check to see if there are any instructions that are exclusive to the address/value that you are trying to manipulate and store the address for your filter by creating a second injection point.
  • You can check to see if there are any instructions that are exclusive to any other address/value inside of the data structure for the address/value that you are trying to manipulate and store the address for your filter by creating a second injection point.


These methods will get you what you need for most targets, and are generally the most reliable, but they are not necessarily the easiest.

I would first check to see if there are any instructions that are exclusive to your player coordinates. You can do this by right-clicking on the X coordinate address in your cheat table and checking to see what is 'accessing' it. From there, the debugger window should pop up and instructions should populate the list. You can right-click on an open, white space inside of the debugger window and click on 'check if found opcodes...'. This should show you if the instructions that populate the debugger window are exclusive to your X address, or if they access other address (a number will appear in the count column, 1 through 8 ). If an instruction shows a (1), even after returning to the game for a bit, then you should be able to use that for your hook.
Back to top
View user's profile Send private message
++METHOS
I post too much
Reputation: 75

Joined: 29 Oct 2010
Posts: 3671

PostPosted: Fri Mar 17, 2017 3:34 pm    Post subject: Reply with quote

Any 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 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