View previous topic :: View next topic |
Author |
Message |
greatveemon Cheater Reputation: 0
Joined: 26 Feb 2010 Posts: 48
|
Posted: Thu Jan 20, 2022 6:36 am Post subject: Changing back the value after disabled |
|
|
I don't how how explain this well but I'm playing RTS game and want the offset of an base addresses. I want every of my units to restore the original value after I disable the script.
Here is the code, I put a description of what I want to happen.
Code: | [ENABLE]
aobscanmodule(somescan,SomeGame.exe,8B 8E E8 06 00 00 8B) // should be unique
alloc(newmem,$100)
label(code)
label(return)
newmem:
cmp [esi+0000013C],1
jne code
cmp [esi+648],1
jne code
push ecx
mov ecx,["SomeGame"+1DAEC48]
mov [esi+000006E8],ecx
pop ecx
mov [esi+0000013C],1 //<------------ marker that this line of code is executed once
jmp return
code:
mov ecx,[esi+000006E8]
jmp return
somescan:
jmp newmem
nop
return:
registersymbol(somescan)
[DISABLE]
// I need to change back it to [esi+0000013C] to 0 here but I have no idea how
// so if I re-enable it will execute again
somescan:
db 8B 8E E8 06 00 00
unregistersymbol(somescan)
dealloc(newmem) |
|
|
Back to top |
|
|
LeFiXER Grandmaster Cheater Supreme Reputation: 20
Joined: 02 Sep 2011 Posts: 1055 Location: 0x90
|
Posted: Thu Jan 20, 2022 9:45 am Post subject: |
|
|
Which game?
|
|
Back to top |
|
|
greatveemon Cheater Reputation: 0
Joined: 26 Feb 2010 Posts: 48
|
Posted: Thu Jan 20, 2022 12:50 pm Post subject: |
|
|
LeFiXER wrote: | Which game? |
some game from 2000,
sorry, but does the name of the game matter?
i just want that address offset to change back after disabling it.
|
|
Back to top |
|
|
ParkourPenguin I post too much Reputation: 140
Joined: 06 Jul 2014 Posts: 4289
|
Posted: Thu Jan 20, 2022 1:39 pm Post subject: |
|
|
You'll need to keep track of every single address you modify and use that in the disable section. e.g. allocate a large buffer, presume it's an array of pointers (length-prefixed or null-terminated), and append new addresses to the end. When the script is disabled, use Lua to go through that list and write 0 to those addresses if they're still valid. That last part is important since if the game decides to free that memory or repurpose it, writing 0 could crash the game or have other side effects.
If you can write any integer you want to esi+13C, then let it be a generation counter. Start the value at 0, and increment it every time you enable the script. If it's not the same as the current generation, then you didn't execute the code yet.
PS: You don't need to push/pop ecx. The original code, `mov ecx,[esi+000006E8]`, overwrites ecx. i.e. the game isn't using whatever value is in ecx just prior to this, so there's no need to back it up.
_________________
I don't know where I'm going, but I'll figure it out when I get there. |
|
Back to top |
|
|
greatveemon Cheater Reputation: 0
Joined: 26 Feb 2010 Posts: 48
|
Posted: Thu Jan 20, 2022 2:13 pm Post subject: |
|
|
ParkourPenguin wrote: |
If you can write any integer you want to esi+13C, then let it be a generation counter. Start the value at 0, and increment it every time you enable the script. If it's not the same as the current generation, then you didn't execute the code yet.. |
Sorry, kinda still noob in this stuff. But how do I'll perform this? if the the esi+13C compare value is fixed.
|
|
Back to top |
|
|
ParkourPenguin I post too much Reputation: 140
Joined: 06 Jul 2014 Posts: 4289
|
Posted: Thu Jan 20, 2022 3:36 pm Post subject: |
|
|
Something like this:
Code: | [ENABLE]
{$lua}
if syntaxcheck then return 'define(generation,0)' end
if _my_AA_script_gen then
_my_AA_script_gen = (_my_AA_script_gen + 1) & 0xFFFFFFFF
else
_my_AA_script_gen = 0
end
return ('define(generation,%X)'):format(_my_AA_script_gen)
{$asm}
...
newmem:
cmp [esi+0000013C],generation
...
mov [esi+0000013C],generation
...
|
_________________
I don't know where I'm going, but I'll figure it out when I get there.
Last edited by ParkourPenguin on Thu Jan 20, 2022 4:53 pm; edited 1 time in total |
|
Back to top |
|
|
greatveemon Cheater Reputation: 0
Joined: 26 Feb 2010 Posts: 48
|
Posted: Thu Jan 20, 2022 4:42 pm Post subject: |
|
|
Sorry, I'm still confuse, Is that a supposed to be pseudocode? And I thought it will keep incrementing but there it seems it will keep resetting it to zero
|
|
Back to top |
|
|
ParkourPenguin I post too much Reputation: 140
Joined: 06 Jul 2014 Posts: 4289
|
Posted: Thu Jan 20, 2022 4:52 pm Post subject: |
|
|
That's CE AutoAssembler code. The stuff in the {$lua} block gets executed before the script gets assembled, and the string it returns (if any) is substituted into the script. The ellipses (...) is just your other code I omitted for brevity.
I don't know why you think it keeps resetting the variable to 0. It works fine for me.
I did forget one line at the beginning of the {$lua} block:
Code: | {$lua}
if syntaxcheck then return 'define(generation,0)' end
... |
_________________
I don't know where I'm going, but I'll figure it out when I get there. |
|
Back to top |
|
|
greatveemon Cheater Reputation: 0
Joined: 26 Feb 2010 Posts: 48
|
Posted: Thu Jan 20, 2022 5:14 pm Post subject: |
|
|
ParkourPenguin wrote: | That's CE AutoAssembler code. The stuff in the {$lua} block gets executed before the script gets assembled, and the string it returns (if any) is substituted into the script. The ellipses (...) is just your other code I omitted for brevity.
I don't know why you think it keeps resetting the variable to 0. It works fine for me.
I did forget one line at the beginning of the {$lua} block:
Code: | {$lua}
if syntaxcheck then return 'define(generation,0)' end
... |
|
just got confused on lua syntax. Didn't know you could do this without declaring a variable.
so like this?
Code: | [ENABLE]
{$lua}
if syntaxcheck then return 'define(generation,0)' end
if _my_AA_script_gen then
_my_AA_script_gen = (_my_AA_script_gen + 1) & 0xFFFFFFFF
else
_my_AA_script_gen = 0
end
return ('define(generation,%X)'):format(_my_AA_script_gen)
{$asm}
aobscanmodule(somecode,SomeGame.exe,8B 8E E8 06 00 00 8B)
alloc(newmem,$100)
label(code)
label(return)
newmem:
cmp [esi+13C],generation
je code
cmp [esi+648],1
jne code
push ecx
mov ecx,["SomeGame.exe"+1DAEC48]
mov [esi+000006E8],ecx
pop ecx
mov [esi+13C],generation
jmp return
code:
mov ecx,[esi+000006E8]
jmp return
somecode:
jmp newmem
nop
return:
registersymbol(somecode)
[DISABLE]
somecode:
db 8B 8E E8 06 00 00
unregistersymbol(somecode)
dealloc(newmem)
|
|
|
Back to top |
|
|
Akina How do I cheat? Reputation: 0
Joined: 06 Sep 2016 Posts: 4
|
Posted: Sat Apr 02, 2022 9:50 pm Post subject: |
|
|
Without using lua
Code: |
[ENABLE]
aobscanmodule(somescan,SomeGame.exe,8B 8E E8 06 00 00 8B)
alloc(newmem,$100)
label(code)
label(return)
alloc(restore,4) //<------------
registersymbol(restore) //<------------
newmem:
cmp [esi+0000013C],1
jne code
cmp [esi+648],1
jne code
push ecx
mov ecx,["SomeGame"+1DAEC48]
mov [esi+000006E8],ecx
pop ecx
mov [restore],esi //<------------
mov [esi+0000013C],1
jmp return
code:
mov ecx,[esi+000006E8]
jmp return
somescan:
jmp newmem
nop
return:
registersymbol(somescan)
[DISABLE]
["restore"]+13C: //<------------ esi+13c
db 00 //<------------Write 0
somescan:
db 8B 8E E8 06 00 00
dealloc(restore) //<------------
unregistersymbol(somescan)
dealloc(newmem)
| [/code]
|
|
Back to top |
|
|
LeFiXER Grandmaster Cheater Supreme Reputation: 20
Joined: 02 Sep 2011 Posts: 1055 Location: 0x90
|
Posted: Sun Apr 03, 2022 5:05 am Post subject: |
|
|
greatveemon wrote: |
sorry, but does the name of the game matter?
|
I would say yes given that the rules surrounding online games are that it is not permitted to talk about hacking online games here.
|
|
Back to top |
|
|
Dark Byte Site Admin Reputation: 458
Joined: 09 May 2003 Posts: 25288 Location: The netherlands
|
Posted: Sun Apr 03, 2022 1:09 pm Post subject: |
|
|
LeFiXER wrote: | greatveemon wrote: |
sorry, but does the name of the game matter?
|
I would say yes given that the rules surrounding online games are that it is not permitted to talk about hacking online games here. |
as long as the name is not mentioned and the disassembly of the game (originalcode) isn't too largs it's ok
_________________
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 |
|
|
|