View previous topic :: View next topic |
Author |
Message |
Astaroth4256 Advanced Cheater Reputation: 0
Joined: 25 May 2014 Posts: 59
|
Posted: Sun Apr 23, 2017 6:51 am Post subject: String sometimes changes to pointer to string |
|
|
Offset 238 is the entity name (displayed in game), the first address (1B2C6410) has a long name so 1B2C6410+238 is a pointer to string, but the second address (1B706670) has a short name so 1B706670+238 is a string - not a pointer. The problem here is how to determine when the address is a pointer or a string, so it can be read from C code.
I tried looking around for an address with a value that determines if the string is a pointer to string or an actual string but I could not find anything, I also tried using a code that would "guess" if the address is a pointer or a string and it worked in 95% cases but the remaining 5% would often cause the bot to get stuck or ignore something important.
These two addresses are just an example how the game "saves it's strings" and I don't know how to read these strings properly, so I believe someone else has encountered a similiar issue before and has a solution for this.
Another example:
Offset 784, this is a different string, same problem
|
|
Back to top |
|
|
ParkourPenguin I post too much Reputation: 140
Joined: 06 Jul 2014 Posts: 4300
|
Posted: Sun Apr 23, 2017 9:05 am Post subject: |
|
|
http://forum.cheatengine.org/viewtopic.php?t=593851
The bounds of the string appear to be stored just after the string itself. For example, in your second image, addresses at the offset 0x76C is the start of a string, the next 16 bytes could be characters in the string (last char is null terminator) or a pointer to the string, the next dword is the current length of the string, and the next dword is the maximum length of the string before memory is allocated and used to store the string.
_________________
I don't know where I'm going, but I'll figure it out when I get there. |
|
Back to top |
|
|
FreeER Grandmaster Cheater Supreme Reputation: 53
Joined: 09 Aug 2013 Posts: 1091
|
Posted: Sun Apr 23, 2017 9:05 am Post subject: |
|
|
My first thought would be to try and find if it stores the length of the string, my second is to look at the code that uses it to see how it determines whether it's a string or a pointer and my third is that if it's a pointer it always (based on the 2 given examples) points to address+C7*** while if its a string it points to something very different from the address.
|
|
Back to top |
|
|
Astaroth4256 Advanced Cheater Reputation: 0
Joined: 25 May 2014 Posts: 59
|
Posted: Sun Apr 23, 2017 9:25 am Post subject: |
|
|
ParkourPenguin wrote: | http://forum.cheatengine.org/viewtopic.php?t=593851
The bounds of the string appear to be stored just after the string itself. For example, in your second image, addresses at the offset 0x76C is the start of a string, the next 16 bytes could be characters in the string (last char is null terminator) or a pointer to the string, the next dword is the current length of the string, and the next dword is the maximum length of the string before memory is allocated and used to store the string. |
I sometimes get stuck at trivial obstacles which have an obvious solution but this is a new record so far, I couldn't solve this for 2 years. I must apologize for bringing said problem again and thanks for showing me the solution.
That was only 14 bytes away, I'm so blind
|
|
Back to top |
|
|
|