Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


[help] Game crash after a while

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine
View previous topic :: View next topic  
Author Message
Endog4
How do I cheat?
Reputation: 0

Joined: 21 Apr 2020
Posts: 3

PostPosted: Wed Feb 01, 2023 4:50 am    Post subject: [help] Game crash after a while Reply with quote

So I play Nobody saves the world and try to cheat mana gain
what the code do is doubling the mana gain
it work for a while, but it will crash the game after a while (indefinitely)

my question is, is the problem lies within my code?

Code:

[ENABLE]

aobscanmodule(MANA,NStW_x64.exe,F3 42 0F 11 84 9B D4 00 00 00 48 8B 1C 24) // should be unique
alloc(newmem,$1000,MANA)

label(code)
label(return)
label(angka)
label(nol)

newmem:
  comiss xmm0,[nol]
  je code
  comiss xmm0,[rbx+r11*4+000000D4]
  jbe code
  subss xmm0,[rbx+r11*4+000000D4]
  mulss xmm0,[angka]
  addss xmm0,[rbx+r11*4+000000D4]

angka:
  dd (float)2.0

nol:
  dd (float)0


code:
  movss [rbx+r11*4+000000D4],xmm0
  mov rbx,[rsp]
  jmp return

MANA:
  jmp far newmem
return:
registersymbol(MANA)

[DISABLE]

MANA:
  db F3 42 0F 11 84 9B D4 00 00 00 48 8B 1C 24

unregistersymbol(MANA)
dealloc(newmem)

{
// ORIGINAL CODE - INJECTION POINT: INJECT

NStW_x64.exe+4EFB3C: C1 FA 1F                       - sar edx,1F
NStW_x64.exe+4EFB3F: 41 C1 F9 1F                    - sar r9d,1F
NStW_x64.exe+4EFB43: 41 23 D1                       - and edx,r9d
NStW_x64.exe+4EFB46: 8B C2                          - mov eax,edx
NStW_x64.exe+4EFB48: 44 23 D2                       - and r10d,edx
NStW_x64.exe+4EFB4B: F7 D0                          - not eax
NStW_x64.exe+4EFB4D: 41 23 C0                       - and eax,r8d
NStW_x64.exe+4EFB50: 41 0B C2                       - or eax,r10d
NStW_x64.exe+4EFB53: 89 44 24 10                    - mov [rsp+10],eax
NStW_x64.exe+4EFB57: F3 0F 10 44 24 10              - movss xmm0,[rsp+10]
// ---------- INJECTING HERE ----------
INJECT: F3 42 0F 11 84 9B D4 00 00 00  - movss [rbx+r11*4+000000D4],xmm0
// ---------- DONE INJECTING  ----------
NStW_x64.exe+4EFB67: 48 8B 1C 24                    - mov rbx,[rsp]
NStW_x64.exe+4EFB6B: 48 83 C4 08                    - add rsp,08
NStW_x64.exe+4EFB6F: C3                             - ret
NStW_x64.exe+4EFB70: 44 8B 91 B8 00 00 00           - mov r10d,[rcx+000000B8]
NStW_x64.exe+4EFB77: 45 33 C9                       - xor r9d,r9d
NStW_x64.exe+4EFB7A: 45 85 D2                       - test r10d,r10d
NStW_x64.exe+4EFB7D: 74 2A                          - je NStW_x64.exe+4EFBA9
NStW_x64.exe+4EFB7F: 4C 8B 99 B0 00 00 00           - mov r11,[rcx+000000B0]
NStW_x64.exe+4EFB86: 4B 8B 0C CB                    - mov rcx,[r11+r9*8]
NStW_x64.exe+4EFB8A: 39 51 2C                       - cmp [rcx+2C],edx
}
Back to top
View user's profile Send private message
++METHOS
I post too much
Reputation: 92

Joined: 29 Oct 2010
Posts: 4197

PostPosted: Wed Feb 01, 2023 5:42 am    Post subject: Reply with quote

Instead of doubling, have you tried setting a fixed value that is not unreasonable?

On rare occasions, increasing values beyond their in-game maximums can cause targets to crash.
Back to top
View user's profile Send private message
ParkourPenguin
I post too much
Reputation: 140

Joined: 06 Jul 2014
Posts: 4300

PostPosted: Wed Feb 01, 2023 12:51 pm    Post subject: Reply with quote

Quote:
Code:
mulss xmm0,[angka]
  addss xmm0,[rbx+r11*4+000000D4]

angka:
  dd (float)2.0

nol:
  dd (float)0


code:
  movss [rbx+r11*4+000000D4],xmm0
  mov rbx,[rsp]
  jmp return
You have data in the middle of your code. After `addss`, the thread executes junk instructions. I'm surprised it doesn't crash immediately.

Move `angka` and `nol` after `jmp return`

_________________
I don't know where I'm going, but I'll figure it out when I get there.
Back to top
View user's profile Send private message
++METHOS
I post too much
Reputation: 92

Joined: 29 Oct 2010
Posts: 4197

PostPosted: Wed Feb 01, 2023 1:11 pm    Post subject: Reply with quote

I didn't notice that. That is probably the problem. Mr. Green
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites