View previous topic :: View next topic |
Author |
Message |
Hatschi Master Cheater Reputation: 2
Joined: 28 Jan 2010 Posts: 327
|
Posted: Tue Dec 12, 2017 9:52 am Post subject: Using struct AA command |
|
|
Referencing to Dark bytes post I'm trying to use the struct AA command but it doesn't work as it should:
Code: | STRUCT player
gold: db A0
ENDSTRUCT
[ENABLE]
//code from here to '[DISABLE]' will be used to enable the cheat
alloc(newmem,2048,1BD1517000A)
label(returnhere)
label(originalcode)
label(exit)
newmem: //this is allocated memory, you have read,write,execute access
//place your code here
mov dword ptr[rax+player.gold],(int)100
originalcode:
exit:
jmp returnhere
1BD1517000A:
jmp newmem
nop
returnhere:
[DISABLE]
//code from here till the end of the code will be used to disable the cheat
dealloc(newmem)
1BD1517000A:
add [rax],al
add [rax],al
add [rax],al
//Alt: db 00 00 00 00 00 00 |
this actually gives me:
Code: | 1BD15310000 - C7 00 64000000 - mov [rax],00000064 { 100 }
|
but shouldn't it be?!:
Code: | mov dword ptr[rax+A0],64
|
What am I doing wrong?
|
|
Back to top |
|
|
Dark Byte Site Admin Reputation: 457
Joined: 09 May 2003 Posts: 25262 Location: The netherlands
|
Posted: Tue Dec 12, 2017 12:27 pm Post subject: |
|
|
Code: |
STRUCT player
everythingbeforeit: resb 160 //or 0xa0
gold: resb 4
ENDSTRUCT
00400500:
mov [rax+player.gold],#100
|
_________________
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 |
|
|
Hatschi Master Cheater Reputation: 2
Joined: 28 Jan 2010 Posts: 327
|
Posted: Wed Dec 13, 2017 6:38 am Post subject: |
|
|
Ok so basically I have to write hex decimal values with 0x in front of it and also to "fill" the structure first. And then I write my offset name and the size of it?
For example my gold is at 0x50 4 bytes and health is at 0x60 double the structure would be like:
Code: | STRUCT player
everythingbeforeit: resb 0x50
gold: dd ? // what is the difference between this and resb 4 ?
everythingbeforeit: resb 0x10
health: dq ?
ENDSTRUCT |
|
|
Back to top |
|
|
Dark Byte Site Admin Reputation: 457
Joined: 09 May 2003 Posts: 25262 Location: The netherlands
|
Posted: Wed Dec 13, 2017 6:51 am Post subject: |
|
|
don't forget that dd allocates 4 bytes, so instead of 0x10 do 0xc
_________________
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 |
|
|
panraven Grandmaster Cheater Reputation: 54
Joined: 01 Oct 2008 Posts: 941
|
Posted: Wed Dec 13, 2017 7:30 am Post subject: |
|
|
A limitation of the AA Struct is it can't use cpu instruction name.
Won't work if comment removed.
Code: |
struct ST
gold: dd ?
health: dd ?
//enter: dd ?
//leave: dd ?
ends
|
May try a Lua work around
Code: |
function gDefine(t)
local r,prefix = {},''
if t[1] then t[1],prefix = nil,t[1]..'.'end
for k,v in pairs(t)do r[1+#r] = string.format("define(%s,%X)",prefix..k,v)end
return table.concat(r,'\r\n')
end
|
In AA :
Code: |
{$lua}
return gDefine{
gold = 0x108, -- no padding need
health = 0x200,
enter = 0x14,
leave = 0x18
}
{$asm}
|
but offset has to calculated yourself.
_________________
- Retarded. |
|
Back to top |
|
|
Dark Byte Site Admin Reputation: 457
Joined: 09 May 2003 Posts: 25262 Location: The netherlands
|
Posted: Wed Dec 13, 2017 9:34 am Post subject: |
|
|
you can also just define a structure in the cheat table and use that
_________________
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 |
|
|
|