 |
Cheat Engine The Official Site of Cheat Engine
|
| View previous topic :: View next topic |
| Author |
Message |
NexuIV Cheater
Reputation: 0
Joined: 24 Jul 2016 Posts: 26
|
Posted: Fri Aug 26, 2016 3:55 am Post subject: Store Address |
|
|
Hello,
via a script can locate the address of the player structure [Player.jpg]. But when, along my route, I find opponents, the address of this structure changes [Enemies.jpg]. The address of the player, of course remains unchanged, but in my table are uploaded to the addresses of the enemy's structure. Once you 've defeated the enemy or there are no enemies nearby, the table puts the player's address.
The script I used is as follows:
| Code: | [ENABLE]
{$lua}
LaunchMonoDataCollector()
{$asm}
registersymbol(pCharacter)
alloc(newmem,2048)
alloc(pCharacter,4)
label(returnhere)
label(originalcode)
label(exit)
Character:Update:
jmp newmem
nop
nop
returnhere:
newmem:
push [esp+4]
pop [pCharacter]
originalcode:
push ebp
mov ebp,esp
push edi
sub esp,04
exit:
jmp returnhere
[DISABLE]
unregistersymbol(pCharacter)
dealloc(newmem)
dealloc(pCharacter)
Character:Update:
push ebp
mov ebp,esp
push edi
sub esp,04 |
Is there a way, by modifying or changing the script, so the script will give me as the exclusive result address of the player and let me just see this in my table ?
Thanks.
| Description: |
|
| Filesize: |
98.2 KB |
| Viewed: |
3997 Time(s) |

|
| Description: |
|
| Filesize: |
78.84 KB |
| Viewed: |
3997 Time(s) |

|
|
|
| Back to top |
|
 |
hhhuut Grandmaster Cheater
Reputation: 6
Joined: 08 Feb 2015 Posts: 607
|
Posted: Fri Aug 26, 2016 4:08 am Post subject: |
|
|
Which offset has the "PlayerId" resp. the "IsEnemy" field?
Because both these seem suitable for the kind of compare you want.
|
|
| Back to top |
|
 |
NexuIV Cheater
Reputation: 0
Joined: 24 Jul 2016 Posts: 26
|
Posted: Fri Aug 26, 2016 4:19 am Post subject: |
|
|
| hhhuut wrote: | Which offset has the "PlayerId" resp. the "IsEnemy" field?
Because both these seem suitable for the kind of compare you want. |
Hi, Thanks for your help. Then...
PlayerId = [pCharacter]+248
IsEnemy = [pCharacter]+24C
BossId = [pCharacter]+250
I tried comparing the bytes but I have probably done something wrong. If you can give me an example of changing the script for a correct comparison I would be really grateful.
Thank You
|
|
| Back to top |
|
 |
hhhuut Grandmaster Cheater
Reputation: 6
Joined: 08 Feb 2015 Posts: 607
|
Posted: Fri Aug 26, 2016 7:03 am Post subject: |
|
|
| Code: | [ENABLE]
{$lua}
LaunchMonoDataCollector()
{$asm}
registersymbol(pCharacter)
alloc(newmem,2048)
alloc(pCharacter,4)
label(returnhere)
label(originalcode)
label(exit)
Character:Update:
jmp newmem
nop
nop
returnhere:
newmem:
push eax
mov eax,[esp+04]
test eax,eax
je originalcode //check if the given address is zero
cmp dword ptr [eax+248],00 //check if playerId=0 (zero)
jne originalcode
cmp byte ptr [eax+24c],00 //check if IsEnemy=0 (zero)
jne originalcode
mov [pCharacter],eax //still here so it seems to be the wanted character address
originalcode:
pop eax
push ebp
mov ebp,esp
push edi
sub esp,04
exit:
jmp returnhere
[DISABLE]
unregistersymbol(pCharacter)
dealloc(newmem)
dealloc(pCharacter)
Character:Update:
push ebp
mov ebp,esp
push edi
sub esp,04 |
A common compare would look like that, but note the following:
Depending on how exactly the game handles/treats those flags, you may not always be the player with ID=0 and maybe the IsEnemy flag is also zero for allied AI.
|
|
| Back to top |
|
 |
NexuIV Cheater
Reputation: 0
Joined: 24 Jul 2016 Posts: 26
|
Posted: Fri Aug 26, 2016 7:46 am Post subject: |
|
|
Thank you very much.
I modified the script as follows...
| Code: | [ENABLE]
{$lua}
LaunchMonoDataCollector()
{$asm}
registersymbol(pCharacter)
alloc(newmem,2048)
alloc(pCharacter,4)
label(returnhere)
label(originalcode)
label(exit)
Character:Update:
jmp newmem
nop
nop
returnhere:
newmem:
push ecx //ecx is empty
mov ecx,[esp+08]
test ecx,ecx
je originalcode //check if the given address is zero
cmp dword ptr [ecx+248],00 //check if playerId=0 (zero)
jne originalcode
//cmp byte ptr [eax+24c],00 //check if IsEnemy=0 (zero)
//jne originalcode
mov [pCharacter],ecx
originalcode:
pop ecx
push ebp
mov ebp,esp
push edi
sub esp,04
exit:
jmp returnhere
[DISABLE]
unregistersymbol(pCharacter)
dealloc(newmem)
dealloc(pCharacter)
Character:Update:
//db 55 8B EC 57 83 EC 04
push ebp
mov ebp,esp
push edi
sub esp,04 |
and it works perfectly !!! Thank You.
|
|
| Back to top |
|
 |
|
|
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
|
|