Spoiler
For now all I was trying to do was store the base address in label to access later
and then add the health and stamina offsets to get the addresses. I really don't know how to explain it properly.
Anyways the problem I am having is this.
I tried adding what I think to be the base address to a label, when I enable the script it acts like its going to add the address, and when a value such as the health changes. The game just crashes. No warning or error or anything. I was wondering if there is something I am missing. I was able to debug just fine with no crash, but as soon as I enable the script and a value changes. It crashes.
Here is the script:
Spoiler
//code from here to '[DISABLE]' will be used to enable the cheat
aobscanmodule(hpread,crea.exe,89 81 84 00 00 00 C6) // should be unique
alloc(newmem,$1000)
label(code)
label(return)
globalalloc(_playerbase,4)
newmem:
code:
mov [_playerbase],rcx
mov [rcx+00000084],eax
jmp return
hpread:
jmp newmem
nop
return:
registersymbol(hpread)
[DISABLE]
//code from here till the end of the code will be used to disable the cheat
hpread:
db 89 81 84 00 00 00
unregistersymbol(hpread)
dealloc(newmem)
{
// ORIGINAL CODE - INJECTION POINT: "crea.exe"+75C27A
"crea.exe"+75C252: C7 40 18 00 00 00 00 - mov [rax+18],00000000
"crea.exe"+75C259: 48 8D 50 08 - lea rdx,[rax+08]
"crea.exe"+75C25D: 48 8D 40 10 - lea rax,[rax+10]
"crea.exe"+75C261: 0F 2F D8 - comiss xmm3,xmm0
"crea.exe"+75C264: 48 0F 46 D0 - cmovbe rdx,rax
"crea.exe"+75C268: 48 8D 44 24 70 - lea rax,[rsp+70]
"crea.exe"+75C26D: F3 0F 10 02 - movss xmm0,[rdx]
"crea.exe"+75C271: 0F 2F C2 - comiss xmm0,xmm2
"crea.exe"+75C274: 48 0F 47 C2 - cmova rax,rdx
"crea.exe"+75C278: 8B 00 - mov eax,[rax]
// ---------- INJECTING HERE ----------
"crea.exe"+75C27A: 89 81 84 00 00 00 - mov [rcx+00000084],eax
// ---------- DONE INJECTING ----------
"crea.exe"+75C280: C6 81 C0 00 00 00 01 - mov byte ptr [rcx+000000C0],01
"crea.exe"+75C287: 48 81 C1 98 00 00 00 - add rcx,00000098
"crea.exe"+75C28E: E8 9D AD FF FF - call crea.exe+757030
"crea.exe"+75C293: EB 3E - jmp crea.exe+75C2D3
"crea.exe"+75C295: 0F 57 C9 - xorps xmm1,xmm1
"crea.exe"+75C298: C7 44 24 78 00 00 00 00 - mov [rsp+78],00000000
"crea.exe"+75C2A0: 48 8D 81 8C 00 00 00 - lea rax,[rcx+0000008C]
"crea.exe"+75C2A7: 48 8D 4C 24 68 - lea rcx,[rsp+68]
"crea.exe"+75C2AC: 0F 2F 18 - comiss xmm3,[rax]
"crea.exe"+75C2AF: 48 0F 47 C8 - cmova rcx,rax
}