View previous topic :: View next topic |
Author |
Message |
Bit Byte Advanced Cheater
Reputation: 0
Joined: 28 Nov 2022 Posts: 62
|
Posted: Sat Jul 29, 2023 4:40 am Post subject: Correct way for address pointers and offsets |
|
|
I have this c#:
Code: | Entity= Memory.GetPointerAddress64Bit(ModuleBase + 0x1CBBA78, new int[] { 0x308, 0x8, 0 }, 3); |
In CE script I can write same thing:
Code: | local Entity = readInteger('[[[game.exe+1CBBA78]+308]+8]+0')
|
Now using from above I have c#:
Code: | EnemyHp = Memory.GetPointerAddress64Bit(Entity+ 0x1a8, new int[] { 0x28 }, 1); |
My question which one or any other correct way to write in CE Script:
Code: | local EnemyHp = readInteger('[[[[[game.exe+1CBBA78]+308]+8]+0]+1A8]+28') |
or
Code: | local EnemyHp = readInteger('[[Entity]+1A8]+28') |
or
Code: | local EnemyHp = readInteger('[Entity+1A8]+28') |
|
|
Back to top |
|
 |
LeFiXER Grandmaster Cheater Supreme
Reputation: 20
Joined: 02 Sep 2011 Posts: 1069 Location: 0x90
|
Posted: Sat Jul 29, 2023 6:54 am Post subject: |
|
|
I would use getAddress():
Code: |
local Entity = getAddress('[[[game.exe+1CBBA78]+308]+8]+0')
local EnemyHP = getAddress('[[' .. Entity .. ']+1A8]+28')
|
Perhaps there are other ways. But I like this method; I find it makes for easier reading.
|
|
Back to top |
|
 |
Bit Byte Advanced Cheater
Reputation: 0
Joined: 28 Nov 2022 Posts: 62
|
Posted: Sat Jul 29, 2023 7:38 am Post subject: |
|
|
Would both these return the same value?:
Code: | local EnemyHP = getAddress('[[Entity]+1A8]+28') |
Code: | local EnemyHp = getAddress('[[[[[game.exe+1CBBA78]+308]+8]+0]+1A8]+28') |
How might I see in console?
Also would creating a pointer like this work?
Description: |
|
Filesize: |
26.22 KB |
Viewed: |
3462 Time(s) |

|
|
|
Back to top |
|
 |
LeFiXER Grandmaster Cheater Supreme
Reputation: 20
Joined: 02 Sep 2011 Posts: 1069 Location: 0x90
|
Posted: Sat Jul 29, 2023 9:10 am Post subject: |
|
|
If 'Entity' was a registered symbol to a valid address then yes, otherwise no.
Use print:
Code: |
local EnemyHp = getAddress('[[[[[game.exe+1CBBA78]+308]+8]+0]+1A8]+28')
print(string.format('%X', EnemyHp))
|
|
|
Back to top |
|
 |
ParkourPenguin I post too much
Reputation: 152
Joined: 06 Jul 2014 Posts: 4700
|
|
Back to top |
|
 |
LeFiXER Grandmaster Cheater Supreme
Reputation: 20
Joined: 02 Sep 2011 Posts: 1069 Location: 0x90
|
Posted: Sat Jul 29, 2023 3:01 pm Post subject: |
|
|
ParkourPenguin wrote: |
LeFiXER wrote: | Code: | local EnemyHP = getAddress('[[' .. Entity .. ']+1A8]+28') |
| `Entity` is an integer. The string concatenation operation `..` converts integers to their decimal string representation. CE assumes it should be hexadecimal.
|
Makes sense since I format the address as a hex string anyway. Either way, it's good to know. Thanks for the tip! It's highly appreciated.
|
|
Back to top |
|
 |
Bit Byte Advanced Cheater
Reputation: 0
Joined: 28 Nov 2022 Posts: 62
|
Posted: Sun Jul 30, 2023 5:41 am Post subject: |
|
|
Thank you guys for the help.
Why is EnemyHp1 & EnemyHp2 having 2 different outputs:
Description: |
|
Filesize: |
44.53 KB |
Viewed: |
3340 Time(s) |

|
|
|
Back to top |
|
 |
LeFiXER Grandmaster Cheater Supreme
Reputation: 20
Joined: 02 Sep 2011 Posts: 1069 Location: 0x90
|
Posted: Sun Jul 30, 2023 1:04 pm Post subject: |
|
|
Because EnemyHp2 is adding offsets to the address rather than adding to the address value held at the address.
|
|
Back to top |
|
 |
Bit Byte Advanced Cheater
Reputation: 0
Joined: 28 Nov 2022 Posts: 62
|
Posted: Mon Jul 31, 2023 5:14 am Post subject: |
|
|
LeFiXER wrote: | Because EnemyHp2 is adding offsets to the address rather than adding to the address value held at the address. |
Ok, what is being done here:
Code: | Entity = Memory.GetPointerAddress64Bit(ModuleBase + 0x1CBBA78, new int[] { 0x308, 0x8, 0 }, 3); |
Code: | IntPtr EnemyHp = Memory.GetPointerAddress64Bit(Entity + 0x1a8, new int[] { 0x28 }, 1); |
Is EnemyHp adding offsets to the address or address value held at the address?
|
|
Back to top |
|
 |
LeFiXER Grandmaster Cheater Supreme
Reputation: 20
Joined: 02 Sep 2011 Posts: 1069 Location: 0x90
|
Posted: Mon Jul 31, 2023 9:10 am Post subject: |
|
|
I'm unfamiliar with C# and the functions used by the Memory module so cannot explain exactly what's happening. Although from a glance it appears to take several arguments as described here:
Code: |
Memory.GetPointerAddress64Bit(address, array_of_offsets, offset_count)
|
Which then would loop through the array adding the offset to each value returned by the function.
|
|
Back to top |
|
 |
|