View previous topic :: View next topic |
Author |
Message |
thethiny Cheater
Reputation: 0
Joined: 01 Apr 2012 Posts: 38 Location: earth
|
Posted: Sun Jul 17, 2016 1:40 pm Post subject: Why does this crash the game? |
|
|
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 |
|
 |
mgr.inz.Player I post too much
Reputation: 222
Joined: 07 Nov 2008 Posts: 4438 Location: W kraju nad Wisla. UTC+01:00
|
Posted: Sun Jul 17, 2016 1:46 pm Post subject: |
|
|
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 |
|
 |
thethiny Cheater
Reputation: 0
Joined: 01 Apr 2012 Posts: 38 Location: earth
|
Posted: Sun Jul 17, 2016 2:05 pm Post subject: |
|
|
Thanks, it solved the crash issue, still the code is functioning, but at least the crash has been solved
|
|
Back to top |
|
 |
akumakuja28 Master Cheater
Reputation: 16
Joined: 28 Jun 2015 Posts: 432
|
Posted: Sun Jul 17, 2016 4:08 pm Post subject: |
|
|
thethiny wrote: | Thanks, it solved the crash issue, still the code is functioning, but at least the crash has been solved  |
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 |
|
 |
|