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 


Crashing on CMP

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

Joined: 16 Sep 2016
Posts: 3

PostPosted: Sun Sep 22, 2019 6:30 am    Post subject: Crashing on CMP Reply with quote

Racking my brain trying to figure out why the game keeps crashing, essentially the code works fine until it gets to the cmp, even if the cmp leads to nothing the cmp itself causes the crash and I can't for the life of me understand why. The cmp that is crashing is comparing a pointer just to specify. Hopefully someone with more experience can shed some light as to why the cmp is causing the crash. Best regards.

Code:
aobscanmodule(god_mode,bcr.exe,89 0E 8B 50 04 89 56 04 83 78)
alloc(newmem,$1000)

label(code)
label(return)

newmem:
  push ebx
  mov ebx,[esi+58]
  cmp [ebx+10],'_god
  pop ebx
  jne code
  mov [esi+50],1
  mov [esi],ecx
  mov edx,[eax+04]
  jmp return


code:
  mov [esi],ecx
  mov edx,[eax+04]
  jmp return

god_mode:
  jmp newmem
return:
registersymbol(god_mode)

[DISABLE]

god_mode:
  db 89 0E 8B 50 04

unregistersymbol(god_mode)
dealloc(newmem)
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 457

Joined: 09 May 2003
Posts: 25262
Location: The netherlands

PostPosted: Sun Sep 22, 2019 9:24 am    Post subject: Reply with quote

So no matter what is at the jmp location it crashes?
so this code also crashes?
Code:

newmem:
  pushfd
  push ebx
  mov ebx,[esi+58]
  cmp [ebx+10],'_god'
  pop ebx
  popfd


code:
  mov [esi],ecx
  mov edx,[eax+04]
  jmp return


If so, it's possible that the value stored at esi+58 sometimes doesn't point to a valid address or is null

try
Code:

newmem:
  pushfd
  push ebx
  mov ebx,[esi+58]
  cmp ebx,0
  je itszero
  cmp [ebx+10],'_god'

  itszero:
  pop ebx
  popfd


code:
  mov [esi],ecx
  mov edx,[eax+04]
  jmp return



Does this solve the crash? If so, work with this

If not there is always the 'last-resort' by brute forcing it to work
Code:

aobscanmodule(god_mode,bcr.exe,89 0E 8B 50 04 89 56 04 83 78)
alloc(newmem,$1000)
alloc(crashcounter,4)
registersymbol(godmodecrashcounter)

label(code)
label(return)

newmem:
  push ebx
{$try}
  mov ebx,[esi+58]
  cmp [ebx+10],'_god
  jmp itranok
{$except}
  //it crashed
  inc [godmodecrashcounter] //add to your table, it's fun to see how often you would have crashed without this
  pop ebx
  jmp code

itranok:
  pop ebx
  jne code
  mov [esi+50],1
  mov [esi],ecx
  mov edx,[eax+04]
  jmp return


code:
  mov [esi],ecx
  mov edx,[eax+04]
  jmp return

god_mode:
  jmp newmem
return:
registersymbol(god_mode)

[DISABLE]

god_mode:
  db 89 0E 8B 50 04

unregistersymbol(god_mode)
dealloc(newmem)

_________________
Do not ask me about online cheats. I don't know any and wont help finding them.

Like my help? Join me on Patreon so i can keep helping
Back to top
View user's profile Send private message MSN Messenger
Detrimantix
How do I cheat?
Reputation: 0

Joined: 16 Sep 2016
Posts: 3

PostPosted: Sun Sep 22, 2019 2:00 pm    Post subject: Reply with quote

Thanks for replying Dark, unfortunately both suggestions still resulted in a crash. And when I set up the counter it looks like it racked up like 30000 crashes within a minute. Shocked I'm not entirely sure how to use the "brute force" method. The pointer thing is what is causing the crash, as I can do a normal compare, but as soon as I try to compare the pointer offset within it crashes.

Not sure what to do, never ran into this before. I have tried injection copies as well and it doesn't crash but I'm not really sure how to change to the pointer offset within the injection copy.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General Gamehacking 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