Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Relative pointer with index multiplier issue

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine
View previous topic :: View next topic  
Author Message
sbryzl
Master Cheater
Reputation: 6

Joined: 25 Jul 2016
Posts: 252

PostPosted: Thu Jan 25, 2018 2:22 pm    Post subject: Relative pointer with index multiplier issue Reply with quote

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
View user's profile Send private message
OldCheatEngineUser
Whateven rank
Reputation: 20

Joined: 01 Feb 2016
Posts: 1587

PostPosted: Thu Jan 25, 2018 2:35 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
FreeER
Grandmaster Cheater Supreme
Reputation: 53

Joined: 09 Aug 2013
Posts: 1091

PostPosted: Thu Jan 25, 2018 2:51 pm    Post subject: This post has 1 review(s) Reply with quote

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
View user's profile Send private message
sbryzl
Master Cheater
Reputation: 6

Joined: 25 Jul 2016
Posts: 252

PostPosted: Thu Jan 25, 2018 3:39 pm    Post subject: Reply with quote

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
View user's profile Send private message
FreeER
Grandmaster Cheater Supreme
Reputation: 53

Joined: 09 Aug 2013
Posts: 1091

PostPosted: Thu Jan 25, 2018 4:11 pm    Post subject: Reply with quote

It should yes, though I didn't do much testing with it so there may be cases where it fails Very Happy
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites