[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: 95
Joined: Thu Apr 12, 2018 4:53 am
Reputation: 148

[SOLVED] How to write correct opcode pointer in script

Post by aanpsx » Tue Jan 29, 2019 12:11 am

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.

User avatar
TheyCallMeTim13
Administration
Administration
Posts: 1616
Joined: Fri Mar 03, 2017 12:31 am
Reputation: 582

Re: How to write correct opcode pointer in script

Post by TheyCallMeTim13 » Tue Jan 29, 2019 2:13 am

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
CE wiki - Tutorials CE wiki - Auto Assembler Basics - CE wiki - Lua Basics If it's not a Personal Message don't PM me, use the forum. I ignore PMs that should be asked on the forum.

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

Re: How to write correct opcode pointer in script

Post by aanpsx » Tue Jan 29, 2019 10:51 am

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

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

Re: How to write correct opcode pointer in script

Post by SunBeam » Wed Jan 30, 2019 11:33 am

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