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 


Address keeps changing during runtime

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

Joined: 23 Feb 2014
Posts: 39

PostPosted: Wed Oct 01, 2014 1:48 pm    Post subject: Address keeps changing during runtime Reply with quote

Hey everyone,

I'm trying to get an Array of Bots/Computer Player that are currently on the Map.
I can find Bot1, and can modify all his stuff (xyz...), but once he dies and respawns, all memory adresses are invalid again.

What can I do to always get the right adress ?

Somewhere in memory there gotta maybe be an List of Pointer that points to the beginning of an player array, how can I find that ?

How do I read dynamic arrays from memory at all ?


Game is UT2004.

Any help is appreciated Smile

~penpenpen
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 458

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

PostPosted: Wed Oct 01, 2014 6:22 pm    Post subject: Reply with quote

You might be better off doing a code injection at a routine that accesses the character class object and store that in your own allocated array

e.g in ut2004 you want to get a list of all the Pawn objects
And if you wish all currently visible pawn objects hook RenderPawn

_________________
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
penpenpen
Cheater
Reputation: 0

Joined: 23 Feb 2014
Posts: 39

PostPosted: Wed Oct 01, 2014 7:03 pm    Post subject: Reply with quote

Thanks for the reply.
I'm pretty new to this, so It'd be great if you could clarify / point me in the right direction.

Can cheat engine help me here ?
How do I locate "RenderPawn" (Ollydbg?) ?
Will I need to write a DLL that uses some ingame functionality ?
If I find Renderpawn, how do I hook onto it to receive a List of all available objects ?
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 458

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

PostPosted: Thu Oct 02, 2014 6:29 am    Post subject: Reply with quote

check the symbollist in cheat engine and search for Pawn and Render together (could also be APawn::Render, I kinda forgot the exact name)


once you've found renderpawn at the entry of the function ECX contains a pointer to the Pawn object. Save those pointers
Then when you have a few dissect those structures with data dissect and find the offset that describes their coordinates

you could write a dll for this if you like (it's easier if you like to do math and memory management, but also for calling ingame functions. E.g asking where the headbone is of a pawn is a popular thing, or asking if it's in line of sight and not blocked by anything else)

_________________
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
penpenpen
Cheater
Reputation: 0

Joined: 23 Feb 2014
Posts: 39

PostPosted: Thu Oct 02, 2014 9:37 am    Post subject: Reply with quote

Thanks Smile

There is no RenderPawn function(at least I couldnt find one).

But I found a Function called:
Code:
Engine.APawn::GetAPawn - 8B C1                 - mov eax,ecx


I added a Breakpoint there and managed to get all Pawn adresses by copying the value of ecx as you said.

Made some notes like this:
Quote:
Pointers:
1ACE3000 // Player
08F80000 // Bot (1)
offsets:
0148 - x
014C - y
0150 - z


How did you know that they were in ecx ?

How Can I do the same thing programmaticly, so that I can get a List of Pawns ? In Other words, How can I hook the function and get ecx ? ( I'm mostly using delphi. )

I appreciate your help Smile
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 458

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

PostPosted: Thu Oct 02, 2014 9:55 am    Post subject: Reply with quote

check the autoassembler template scripts
do a code injection there and save ecx into a list you allocated (after checking it isn't already in)
I recommend writing a dll i delphi, inject it (e. g. injectdll(pathtodll)) and in your injected routine call a function in the dll to store it
e. g.
exported delphi function:
Code:
 
procedure addAddress(address:dword) ; stdcall;
begin
  //check if address is in the list,  else add it
end


assembler:
Code:
 
...
newmem:
push ecx
call yourdll. addAddress
...

_________________
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
penpenpen
Cheater
Reputation: 0

Joined: 23 Feb 2014
Posts: 39

PostPosted: Fri Oct 03, 2014 12:25 pm    Post subject: Reply with quote

It took me a while to get this all working Smile. I'm not that experienced with memory processing and assembler.

Now I have a new problem.

First of all. The DLL injecting and getting the adresses works great (You're just a genius Smile). But I cant seem to read a valid float Value from Memory.

I had no better Idea so I tried all Kinds of datatypes, to maybe get something usefull.

It seems like the Float the game generates is 3 Bytes Long. How Can I get a Valid Float out of that.

Code:
procedure addAddress(address:dword) ; stdcall;
var
  a: ^Float;
  b: ^Integer;
  c: ^Double;
  d: ^byte;
  e: ^Single;
  f: ^Real;
  g: ^Extended;
begin
  a := Pointer(Address+336);
  b := Pointer(Address+336);
  c := Pointer(Address+336);
  d := Pointer(Address+336);
  f := Pointer(Address+336);
  g := Pointer(Address+336);
  // Get Float
  ZCoord := a^; // Is always 10 or -10
  // Get Integer
  ZCoordInt := b^;
  // Get Double
  ZCoordDouble := c^;
  // Get Byte
  ZCoordByte := d^;
  // Get Byte
  ZCoordSingle := e^;
  // Get Real
  ZCoordReal := F^;
  // Get Extended
  ZCoordExtended := G^;
end; 


I'm using the window title for debugging. Gotta also think about a better way to do that.
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 458

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

PostPosted: Fri Oct 03, 2014 2:02 pm    Post subject: Reply with quote

you're not setting e which is what you need (it's a single)
_________________
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
penpenpen
Cheater
Reputation: 0

Joined: 23 Feb 2014
Posts: 39

PostPosted: Fri Oct 03, 2014 2:30 pm    Post subject: Reply with quote

Dark Byte wrote:
you're not setting e which is what you need (it's a single)


Hey you are right. But that didnt work either. I found the Problem.

The Single was stored backwards in memory. I Had to read the last byte of it first, than I could convert it properly.

Thanks for all the help Smile
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 458

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

PostPosted: Fri Oct 03, 2014 2:37 pm    Post subject: Reply with quote

i'm not really sure what you mean with that. Are you trying to manually read an array of hexadecimal bytes and convert them to an float ?

it is a single (ce float) as you saw with the structure dissecting. it's not something special.

in case you're wondering, horizontal rotation is a 2 byte value (implemented as 4 but just handle it as 2) that ranges from 0 to 65535. where 65536 (0 in 2 byte) is a full 360

Also, here's a link you might find interesting, especially since you're also using delphi: http://forum.cheatengine.org/download.php?id=37465 (it's pretty old code but should contain some useful info)

_________________
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
penpenpen
Cheater
Reputation: 0

Joined: 23 Feb 2014
Posts: 39

PostPosted: Fri Oct 03, 2014 3:44 pm    Post subject: Reply with quote

Dark Byte wrote:
i'm not really sure what you mean with that. Are you trying to manually read an array of hexadecimal bytes and convert them to an float ?

Yes, I ended up doing that because I made a mistake when trying to read the single.
At least I learned that Single is a Float backwards.

Thanks so much for the SourceFiles. Gotta be helpful Smile.

Quote:

in case you're wondering, horizontal rotation is a 2 byte value (implemented as 4 but just handle it as 2) that ranges from 0 to 65535. where 65536 (0 in 2 byte) is a full 360

I Found that near the Player Coordinates. I actually thought it had to do with mouse positioning Very Happy Thanks for clearing that up.

I've learned so much during the last days. And alot of it because of your help. You should put a donate button in your profile or so Very Happy. I think your posts are very valuable.
Back to top
View user's profile Send private message
darkangel88_de
How do I cheat?
Reputation: 0

Joined: 10 Jan 2021
Posts: 1
Location: Germany, Saxony-Anhalt

PostPosted: Wed Sep 08, 2021 8:12 am    Post subject: always changing addresses Reply with quote


always changing addresses

hello guys.

i don't know if this is the right thread or if my problem
has already been discussed in a different place.

i have a problem with the pointer scanner.
...here is a instruction from another user:

"Try your luck with the default pointer scan.

Right-click the address and click Pointer scan for this address.
Click OK to accept the default settings, or you may want to boost the Max level to 5.
Once it's done searching, reload the game and reattach Cheat Engine.
In the Pointer scan window, select Pointer scanner > Rescan memory.
Enter the new Address to find.
Hopefully there are still some results. Add one of those to your table.

If you ever load a game and the pointer you grabbed doesn't work, reload the saved scan and pick a different value.
Unless, of course, the game updated and made every pointer invalid."



i' m trying this right now - with the pointer scanner - but i have no success.
can someone possibly re-word this - or attach pictures - or make a video?

the address i' m looking for is always a different one....
what can i do?
4-bytes did not work.
only double had brought something
but i would have to re-search every Time again...

for a bit more info's, look at:
    fearlessrevolution . com/viewtopic.php?f=4&t=661&start=120

page 9, comments by "DarkAngel88_ger"


THX

_________________
Germany||Saxony-Anhalt
Gamer||PC||PS(4)Network||MasterPuls||NFS||Assassin's Creed
ModDB||Steam||Youtube||WhatsApp||Skype
Discord||Darkangel88_de#0077
contact: little-pulsi . de . tl


Last edited by darkangel88_de on Fri Sep 10, 2021 4:48 am; edited 1 time in total
Back to top
View user's profile Send private message
LeFiXER
Grandmaster Cheater Supreme
Reputation: 20

Joined: 02 Sep 2011
Posts: 1055
Location: 0x90

PostPosted: Wed Sep 08, 2021 9:45 am    Post subject: Reply with quote

Quote:
Right-click the address and click Pointer scan for this address.
Click OK to accept the default settings, or you may want to boost the Max level to 5.
Once it's done searching, reload the game and reattach Cheat Engine.
In the Pointer scan window, select Pointer scanner > Rescan memory.
Enter the new Address to find.
Hopefully there are still some results. Add one of those to your table.

If you ever load a game and the pointer you grabbed doesn't work, reload the saved scan and pick a different value.
Unless, of course, the game updated and made every pointer invalid."


So you have the address of the value you want to find a pointer for in the cheat table. Right-click this entry and click Pointer scan for this address. Click ok to accept the default settings or increase the max level (how many levels in the pointer chain). Once the Pointer Scan has finished. Close the game, open the game again and find the value you want the pointer for. In the Pointer Scanner window, select pointer scanner > Rescan memory and enter the address of the value you found in the Cheat Table.

You may need to do this several times to yield a good pointer. Although, I feel this would be better suited in a thread of its own as it bears no relevance to the OP's issue.
Back to top
View user's profile Send private message
darkangel88_de
How do I cheat?
Reputation: 0

Joined: 10 Jan 2021
Posts: 1
Location: Germany, Saxony-Anhalt

PostPosted: Fri Sep 10, 2021 4:39 am    Post subject: Reply with quote

Quote:
So you have the address of the value you want to find a pointer for in the cheat table. Right-click this entry and click Pointer scan for this address. Click ok to accept the default settings or increase the max level (how many levels in the pointer chain). Once the Pointer Scan has finished. Close the game, open the game again and find the value you want the pointer for. In the Pointer Scanner window, select pointer scanner > Rescan memory and enter the address of the value you found in the Cheat Table.

You may need to do this several times to yield a good pointer. Although, I feel this would be better suited in a thread of its own as it bears no relevance to the OP's issue.


ok, thanks.
I will try your instructions...
but also create a new theread for this...

_________________
Germany||Saxony-Anhalt
Gamer||PC||PS(4)Network||MasterPuls||NFS||Assassin's Creed
ModDB||Steam||Youtube||WhatsApp||Skype
Discord||Darkangel88_de#0077
contact: little-pulsi . de . tl
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