|
Cheat Engine The Official Site of Cheat Engine
|
View previous topic :: View next topic |
Author |
Message |
sandsmaster Newbie cheater Reputation: 1
Joined: 21 Jan 2021 Posts: 24
|
Posted: Mon May 31, 2021 4:17 pm Post subject: Double value to memory in 32-bit games |
|
|
Hi everyone!
I want to know, how can I save a double value from a pointer to some allocated memory. I want to register symbol. The game I'm trying to hack today is "Cat Goes Fishing" and it's a very complex game to write scripts in.
The most interesting thing about it is, that it's a 32-bit game, but uses only double somehow.
What's more, all the values in the game go through 2-3 instructions and even when I break and trace them with start condition, I still don't get to anything useful. ( Best result of noping a call was to freeze the game ). The last branch leads to a ton of
But it's not a really big game and probably won't recieve much updates soon, so I decided to use pointers. Luckily pointers work like a charm for a table, but I want to make them into a script.
So I searched about how to use pointers in Assembler and wrote this code:
Code: |
[ENABLE]
alloc(newmem,$100)
label(cash)
registersymbol(cash)
newmem:
push eax
mov eax,["Cat Goes Fishing.exe"+0043F104]
mov eax,[eax+39C]
mov eax,[eax+3C]
mov eax,[eax+28]
//mov eax,[eax+210]
add eax,210
mov [cash],eax
pop eax
cash:
dq 0
[DISABLE]
unregistersymbol(cash)
dealloc(newmem)
|
So essentially, I'm trying to write to the symbol a double, with the 32-bit register. I tried direct , but it didn't work either, so I'm pretty much clueless, overall.
If you can help out again, I'd really appreciate it.
Description: |
|
Filesize: |
21.88 KB |
Viewed: |
1474 Time(s) |
|
_________________
I don't post too much. yet. |
|
Back to top |
|
|
TheyCallMeTim13 Wiki Contributor Reputation: 50
Joined: 24 Feb 2017 Posts: 976 Location: Pluto
|
Posted: Mon May 31, 2021 5:04 pm Post subject: |
|
|
To move a qword (8 bytes) in 32 bit you have a few options.
The easiest would be to just do it in chunks.
Code: | push eax
mov eax,[addr]
mov [symbol],eax
mov eax,[addr+4]
mov [symbol+4],eax
pop eax |
But you could also use the FPU registry.
Code: |
fld qword ptr [addr]
fstp qword ptr [symbol]
|
Or you can use the XMM registries. But you might have to save and restore the registry if it gets used latter.
Code: |
movq xmm0,[addr]
movq [symbol],xmm0
|
_________________
|
|
Back to top |
|
|
sandsmaster Newbie cheater Reputation: 1
Joined: 21 Jan 2021 Posts: 24
|
Posted: Tue Jun 01, 2021 5:01 am Post subject: |
|
|
Thanks a lot man.
I went for using the FPU registry and it works great.
Weird thing is, when I debug the cheat, I don't see the value in the FPU stack,
but it works. I'd be happy to know, if you know how to set it precisely.
Btw here is the new code:
Code: | [ENABLE]
aobscanmodule(INJECTCash,Cat Goes Fishing.exe,83 C4 10 8B C8 89 4D E4) // should be unique
alloc(newmem,$100)
label(cash)
label(return)
label(code)
label(cash_flag)
registersymbol(cash)
registersymbol(cash_flag)
newmem:
code:
add esp,10
mov ecx,eax
cmp [cash_flag],#1
jne return
push eax
mov eax,["Cat Goes Fishing.exe"+0043F104]
mov eax,[eax+39C]
mov eax,[eax+3C]
mov eax,[eax+28]
fld qword ptr [eax+210]
fadd qword ptr [cash]
fstp qword ptr [eax+210]
mov [cash_flag],#0
pop eax
jmp return
cash:
dq (double)100000
cash_flag:
dd 0
INJECTCash:
jmp newmem
return:
registersymbol(INJECTCash)
[DISABLE]
INJECTCash:
db 83 C4 10 8B C8 89
unregistersymbol(cash)
unregistersymbol(cash_flag)
unregistersymbol(INJECTCash)
dealloc(newmem) |
_________________
I don't post too much. yet. |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum
|
|