assembly - how to convert this string into something that can be cmp'ed.

Anything Cheat Engine related, bugs, suggestions, helping others, etc..
Post Reply
manaphoenix
What is cheating?
What is cheating?
Posts: 2
Joined: Sat Dec 01, 2018 6:17 am
Reputation: 0

assembly - how to convert this string into something that can be cmp'ed.

Post by manaphoenix » Sat Dec 01, 2018 6:26 am

Ok ... so i'm trying to make an aob injection copy for the game; I have already done it once with the 1 of the 2 main characters. The second however has a name longer than 16 bits, hence this code won't compile. I have looked for hours and can't figure it out, how do you convert 'FemaleHero' into something that can be compared?

The extra push and such just because someone might wonder why I'm doing it is that the name is stored through a pointer (IE. address points to an address that then points to the value)

Code: Select all

[ENABLE]

aobscanmodule(Characters,EoCApp.exe,41 8B 87 24 01 00 00 41) // should be unique
alloc(newmem,$1000,"EoCApp.exe"+D5797D)

label(code)
label(return)
label(hero_base)
registersymbol(hero_base)

newmem:
push ebx
mov ebx,[r15+28]
mov [hero_base],ebx
cmp [ebx+0],'FemaleHero'
pop ebx
jne code
mov [hero_base],r15

code:
  mov eax,[r15+00000124]
  jmp return

hero_base:
dd 0

Characters:
  jmp newmem
  nop
  nop
return:
registersymbol(Characters)

[DISABLE]

Characters:
  db 41 8B 87 24 01 00 00

unregistersymbol(Characters)
unregistersymbol(hero_base)
dealloc(newmem)

JohnFK
Cheater
Cheater
Posts: 37
Joined: Tue Aug 29, 2017 10:50 am
Reputation: 9

Re: assembly - how to convert this string into something that can be cmp'ed.

Post by JohnFK » Sat Dec 01, 2018 4:18 pm

Assuming FemaleHero is not unicode you have many options:

Code: Select all

//note, each char = 1 byte

mov rsi,'FemaleHe' //just an example, take care about using a free register yourself, string can be 8 chars long only.
cmp [rbx],rsi

//or

cmp dword ptr [ebx],'Fema' // can only be 4 bytes. Thus you need to split compare
jne code
cmp dword ptr [ebx+4],'leHe'


manaphoenix
What is cheating?
What is cheating?
Posts: 2
Joined: Sat Dec 01, 2018 6:17 am
Reputation: 0

Re: assembly - how to convert this string into something that can be cmp'ed.

Post by manaphoenix » Mon Dec 03, 2018 12:39 am

Thanks for the replies! I needed to update the game so I may not even need this info now; but helpful for the future never the less.

User avatar
SunBeam
Administration
Administration
Posts: 2248
Joined: Sun Feb 04, 2018 7:16 pm
Reputation: 817

Re: assembly - how to convert this string into something that can be cmp'ed.

Post by SunBeam » Fri Dec 21, 2018 2:19 pm

You can easily use Lua to read-up strings; Lua and ASM can also be inter-connected. Yes, in your ASM cave :P Head to CEF for a demo ;) Adjust things properly, then you can write your stuff in Lua and have the ASM wrapper in your script execute it ;) See my Assassin's Creed: Origins table. The item swapper scripts.

Post Reply

Who is online

Users browsing this forum: No registered users