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 


Why does this crash the game?

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
thethiny
Cheater
Reputation: 0

Joined: 01 Apr 2012
Posts: 38
Location: earth

PostPosted: Sun Jul 17, 2016 1:40 pm    Post subject: Why does this crash the game? Reply with quote

Hi,
I'm new to using Windows DLL Calls, so I might not know how they work exactly.
I have this segment of the code
Code:

CheckFile:
push rcx
push rax
push rdx
sub rsp,20
lea rcx, [data]
call SHLWAPI.PathFileExistsA
mov [bool],eax
add rsp,20
pop rdx
pop rax
pop rcx

That crashes whenever it reaches "call SHLWAPI.PathFileExistsA"
I try commenting it out and the game works fine. Why does this line not work? What would cause the game to crash?
Thanks
Back to top
View user's profile Send private message
mgr.inz.Player
I post too much
Reputation: 222

Joined: 07 Nov 2008
Posts: 4438
Location: W kraju nad Wisla. UTC+01:00

PostPosted: Sun Jul 17, 2016 1:46 pm    Post subject: Reply with quote

Try this one:
Code:
CheckFile:
push rax
push rcx
push rdx
push r8
push r9

lea rsp,[rsp-28]

mov rcx,data
call SHLWAPI.PathFileExistsA
mov [bool],eax

lea rsp,[rsp+28]

pop r9
pop r8
pop rdx
pop rcx
pop rax

_________________
Back to top
View user's profile Send private message MSN Messenger
thethiny
Cheater
Reputation: 0

Joined: 01 Apr 2012
Posts: 38
Location: earth

PostPosted: Sun Jul 17, 2016 2:05 pm    Post subject: Reply with quote

Thanks, it solved the crash issue, still the code is functioning, but at least the crash has been solved Very Happy
Back to top
View user's profile Send private message
akumakuja28
Master Cheater
Reputation: 16

Joined: 28 Jun 2015
Posts: 432

PostPosted: Sun Jul 17, 2016 4:08 pm    Post subject: Reply with quote

thethiny wrote:
Thanks, it solved the crash issue, still the code is functioning, but at least the crash has been solved Very Happy




Did you set up a compare on the [bool].


Something like

Code:


cmp [bool],1
je Load_String
jne originalcode


Load_String:
However you wrote your code to replace the string.



_________________
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 Lua Scripting 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