[help] Compare 2 addresses in AA

Memory scanning, code injection, debugger internals and other gamemodding related discussion
Post Reply
MaW
Novice Cheater
Novice Cheater
Posts: 17
Joined: Sun Jun 17, 2018 4:17 pm
Reputation: 13

[help] Compare 2 addresses in AA

Post by MaW »

Hey guys
I want to make an One Hit Kill script for a game, and i want to use my health address to differentiate myself from the others
But when i try to compare My Health Address with Target Health Address, game crash.

This is my script:

Code: Select all

[ENABLE]

aobscanmodule(OHK,GameAssembly.dll,C4 08 89 48 18 5D C3) // should be unique
alloc(newmem,$1000)

label(origin)
label(return)
label(_ohk)
label(_p_Heal)
label(target)



newmem:
// Get my Health Address
  push edx
  lea edx,[[_pHealth]+18]  // "_pHealth" its Player Base Address and 0x18 its the Health offset
  mov [_p_Heal],edx
  pop edx

// Get others Health Address
  push edx
  mov edx,eax
  lea edx,[edx+18] // "edx+18" its others health address
  mov [target],edx
  pop edx

  cmp target,_p_Heal // Here its the problem, when i compare these 2, game crashes
  jne _ohk
  mov [eax+18],ecx
  pop ebp
  ret
  jmp return

_ohk:
  mov [eax+18],00
  pop ebp
  ret
  jmp return

origin:
  mov [eax+18],ecx
  pop ebp
  ret
  jmp return

_p_Heal:
dq 0

target:
dq 0

OHK+02:
  jmp newmem
return:
registersymbol(OHK _p_Heal target)

[DISABLE]

OHK+02:
  db 89 48 18 5D C3

unregistersymbol(OHK _p_Heal target)
dealloc(newmem)

User avatar
LeFiXER
LeFixer
LeFixer
Posts: 478
Joined: Wed Mar 24, 2021 9:35 am
Reputation: 242

Re: [help] Compare 2 addresses in AA

Post by LeFiXER »

I presume that the health address is a shared address and with that you have to add the address of your player health to group one, the other players' health address to group two. Then scan for commonalities. Look for an offset which holds a value where both values are different. Then use AA to compare the value held at the address+offset against the other players' health value.

For example: (not actual code, just to give you an idea how it is setup)

Code: Select all

label(otherPlayer)

newmem:
  cmp [_pHealth+18], value here
  jne otherPlayer 
  mov [p_Heal],edx
 
otherPlayer:
  mov xyz, edx

Post Reply

Who is online

Users browsing this forum: No registered users