View previous topic :: View next topic |
Author |
Message |
sbryzl Master Cheater
Reputation: 6
Joined: 25 Jul 2016 Posts: 252
|
Posted: Thu Jan 25, 2018 2:22 pm Post subject: Relative pointer with index multiplier issue |
|
|
Auto assembler seems to require an operand with multiplier at the end of the instruction except it will disassemble it with the multiplier at the beginning. No big deal if it's only one instruction to fix but if there is a large disassembly with a lot of these types of instructions it would be a lot of fixing.
The commented lines are the disassembly output. AA will give an error if you try to assign them to a table as they are.
Code: | [ENABLE]
alloc(CEmem,$1000)
registersymbol(CEmem)
define(game,cheatengine-x86_64.exe)
CEmem:
fld [game+rax*2]
cmp [game+rax*8],1
// fld dword ptr [rax*2+cheatengine-x86_64.exe]
// cmp dword ptr [rax*8+cheatengine-x86_64.exe],01
[DISABLE]
dealloc(CEmem)
unregistersymbol(CEmem) |
|
|
Back to top |
|
 |
OldCheatEngineUser Whateven rank
Reputation: 20
Joined: 01 Feb 2016 Posts: 1586
|
Posted: Thu Jan 25, 2018 2:35 pm Post subject: |
|
|
are you sure you know what you are writing in that script?
especially the fld and the cmp that comes right after it!
_________________
About Me;
I Use CE Since Version 1.X, And Still Learning How To Use It Well!
Jul 26, 2020
STN wrote: | i am a sweetheart. |
|
|
Back to top |
|
 |
FreeER Grandmaster Cheater Supreme
Reputation: 53
Joined: 09 Aug 2013 Posts: 1091
|
Posted: Thu Jan 25, 2018 2:51 pm Post subject: |
|
|
I'd noticed it wants the *immediate at the end but hadn't noticed it had immediate*register in the disassembly... yeah that could be annoying if you had a lot lol
simple solution in lua:
Code: | script = [=[
[ENABLE]
alloc(CEmem,$1000)
registersymbol(CEmem)
define(game,cheatengine-x86_64.exe)
CEmem:
fld [game+rax*2]
cmp [game+rax*8],1
// fld dword ptr [rax*2+cheatengine-x86_64.exe]
// cmp dword ptr [rax*8+cheatengine-x86_64.exe],01
[DISABLE]
dealloc(CEmem)
unregistersymbol(CEmem)
]=]
newscript = {}
for line in script:gmatch('[^\r\n]+') do
local line = line:gsub('%[(%a+)%*(%d+)%+(.*)%]', '[%3+%1*%2]')
-- print(line)
newscript[#newscript+1] = line
end
newscript = table.concat(newscript, '\r\n')
print(newscript) |
though I feel like it might also be possible to hook the disassembler and change the way it actually shows the instructions I don't feel like that'd work for templates etc. so....
|
|
Back to top |
|
 |
sbryzl Master Cheater
Reputation: 6
Joined: 25 Jul 2016 Posts: 252
|
Posted: Thu Jan 25, 2018 3:39 pm Post subject: |
|
|
Thanks. I don't know Lua too well. So I can just put any script in there and it will put all the multiplier operands at the end?
|
|
Back to top |
|
 |
FreeER Grandmaster Cheater Supreme
Reputation: 53
Joined: 09 Aug 2013 Posts: 1091
|
Posted: Thu Jan 25, 2018 4:11 pm Post subject: |
|
|
It should yes, though I didn't do much testing with it so there may be cases where it fails
|
|
Back to top |
|
 |
|