[SOLVED] How to write correct opcode pointer in script

Anything Cheat Engine related, bugs, suggestions, helping others, etc..
Post Reply
User avatar
aanpsx
Table Makers
Table Makers
Posts: 207
Joined: Thu Apr 12, 2018 4:53 am
Reputation: 859

[SOLVED] How to write correct opcode pointer in script

Post by aanpsx »

how to write in cheat engine script to make that pointer??
Image
=====================================================================

Code: Select all

[ENABLE]

aobscanmodule(INJECT,Valkyria4_x64.exe,48 8B 40 08 8B 40 3C) //Valkyria4_x64.exe+6EA9AB4
alloc(newmem,$1000,INJECT)

label(code)
label(return)
label(_Player)
registersymbol(_Player)

newmem:
  mov [_Player],rax //<=================  here
  
code:
  mov rax,[rax+08]
  mov eax,[rax+3C]
  jmp return
  
_Player:

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

[DISABLE]

INJECT:
  db 48 8B 40 08 8B 40 3C
unregistersymbol(_Player)
unregistersymbol(INJECT)
dealloc(newmem)

{
// ORIGINAL CODE - INJECTION POINT: "Valkyria4_x64.exe"+6EA9AB4

"Valkyria4_x64.exe"+6EA9A8C: 68 0F 1F 00 48           -  push 48001F0F
"Valkyria4_x64.exe"+6EA9A91: 8B 05 B1 03 50 FA        -  mov eax,[Valkyria4_x64.exe+13A9E48]
"Valkyria4_x64.exe"+6EA9A97: 48 85 C0                 -  test rax,rax
"Valkyria4_x64.exe"+6EA9A9A: 74 20                    -  je Valkyria4_x64.exe+6EA9ABC
"Valkyria4_x64.exe"+6EA9A9C: 48 8B 88 00 04 00 00     -  mov rcx,[rax+00000400]
"Valkyria4_x64.exe"+6EA9AA3: 48 85 C9                 -  test rcx,rcx
"Valkyria4_x64.exe"+6EA9AA6: 74 14                    -  je Valkyria4_x64.exe+6EA9ABC
"Valkyria4_x64.exe"+6EA9AA8: 48 8B 81 88 03 00 00     -  mov rax,[rcx+00000388]
"Valkyria4_x64.exe"+6EA9AAF: 48 85 C0                 -  test rax,rax
"Valkyria4_x64.exe"+6EA9AB2: 74 08                    -  je Valkyria4_x64.exe+6EA9ABC
// ---------- INJECTING HERE ----------
"Valkyria4_x64.exe"+6EA9AB4: 48 8B 40 08              -  mov rax,[rax+08]
"Valkyria4_x64.exe"+6EA9AB8: 8B 40 3C                 -  mov eax,[rax+3C]
// ---------- DONE INJECTING  ----------
"Valkyria4_x64.exe"+6EA9ABB: C3                       -  ret 
"Valkyria4_x64.exe"+6EA9ABC: 83 C8 FF                 -  or eax,-01
"Valkyria4_x64.exe"+6EA9ABF: C3                       -  ret 
"Valkyria4_x64.exe"+6EA9AC0: 89 C8                    -  mov eax,ecx
"Valkyria4_x64.exe"+6EA9AC2: F7 D0                    -  not eax
"Valkyria4_x64.exe"+6EA9AC4: 41 23 45 00              -  and eax,[r13+00]
"Valkyria4_x64.exe"+6EA9AC8: 41 33 4D 00              -  xor ecx,[r13+00]
"Valkyria4_x64.exe"+6EA9ACC: D1 E0                    -  shl eax,1
"Valkyria4_x64.exe"+6EA9ACE: 48 8D A4 24 F8 FF FF FF  -  lea rsp,[rsp-00000008]
"Valkyria4_x64.exe"+6EA9AD6: 29 C1                    -  sub ecx,eax
}
=====================================================================

Code: Select all

  mov [_Player],rax //<=================  here
Now, if i want to make "( [ _Player ] + 8 + 0C )" (like image no 2) --- which is i want to make change in there
how the opcode should i write if i want:

Code: Select all

newmem:
  mov [_Player],rax
  mov [rax+08], #1 //<=================  no problem here
  mov [rax]+8+0C, #99 //<=================  i want to change here
code:
  mov rax,[rax+08]
  mov eax,[rax+3C]
  jmp return
write long english text like this killing me, so bear with me
Last edited by aanpsx on Tue Jan 29, 2019 10:52 am, edited 1 time in total.

TimFun13
Expert Cheater
Expert Cheater
Posts: 1353
Joined: Fri Mar 03, 2017 12:31 am
Reputation: 7

Re: How to write correct opcode pointer in script

Post by TimFun13 »

Try this:

Code: Select all

newmem:
  mov [_Player],rax
  mov rax,[rax+08]
  mov [rax+0C], #99 //<=================  i want to change here
code:
  //mov rax,[rax+08]
  mov eax,[rax+3C]
  jmp return

Or this:

Code: Select all

newmem:
  mov [_Player],rax
  push rax
  mov rax,[rax+08]
  mov [rax+0C], #99 //<=================  i want to change here
  pop rax
code:
  mov rax,[rax+08]
  mov eax,[rax+3C]
  jmp return

User avatar
aanpsx
Table Makers
Table Makers
Posts: 207
Joined: Thu Apr 12, 2018 4:53 am
Reputation: 859

Re: How to write correct opcode pointer in script

Post by aanpsx »

:D Wooooaaaow...
work like charm, thank you for answering and make me Level Up a lot..

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

Re: How to write correct opcode pointer in script

Post by SunBeam »

aanpsx wrote:
Tue Jan 29, 2019 10:51 am
and make me Level Up a lot..
..in your game, you mean? :D Jokin' :P

Post Reply

Who is online

Users browsing this forum: No registered users