0

I want to move either a memory address's value or the value itself into the R9 register, to do this I have been using an AOB Injection in Cheat Engine to try and help me with testing. Each attempt has resulted in a crash.

I have tried sending the value directly into the R9 register (mov r9, DECIMALVALUE) or sending it via hex, or sending the memory address both decimal or hex (mov r9, [DECIMALMEMORYADDRESS])

my newest attempt:

  mov rax, 2981737325408
  mov r9, rax

original code:

  mov r9, [r8]

The expected result is to not have a crash and to send either the memory address's value into the r9 register or the memory address itself into the register successfully, each time I load. This instruction is only called when I spawn in the game.

James
  • 83
  • 6
  • x86 instructions are variable length. `mov r9, VAL` is 10 bytes while `mov r9, [r8]` is 3 bytes. So you are probably overwriting subsequent instructions. (Since I don't know what an AOB injection is, I could be completely wrong.) – prl Jun 25 '19 at 02:43
  • What do you expect the software to do with the value in r9 after you load it? – prl Jun 25 '19 at 02:47
  • Why would you want to destroy RAX, instead of just doing `mov r9, 2981737325408` to put a 64-bit immediate constant into R9 directly? – Peter Cordes Jun 27 '19 at 06:30

1 Answers1

0

If you're just overwriting the assembly instructions using the Cheat Engine disassembler's "Assemble code" option then you should just move in the hard coded address directly into r9. RAX, r9 are both general purpose registers so it doesn't matter.

mov r9, 2981737325408

The problem with your instructions, if you're just overwriting the code is that you are destroying the value in RAX. Alternatively you could do this

push rax mov rax, 2981737325408 mov r9, rax pop rax

If you're using the Cheat Engine AOB Injection template, this template is actually a hook but that is kind of abstracted away from you. But even in this scenario, you only need to execute the 1 instruction where you mov your value into r9

GuidedHacking
  • 3,628
  • 1
  • 9
  • 59