View previous topic :: View next topic |
Author |
Message |
Antoshick Advanced Cheater
Reputation: 0
Joined: 02 Nov 2018 Posts: 56
|
Posted: Wed Nov 25, 2020 2:00 am Post subject: Pause process from AA |
|
|
Hi, in celua file there is
Code: |
pause() : pauses the current opened process
unpause(): resumes the current opened process |
Can i pause process, but from AA script? And then unpause process from lua.
My deal is that, some AA instruction "X" starts execution, sets flag 1 for me and pauses the process, then the Lua timer checks this flag 1 and starts copying data from the hard disk to memory, after that lua resets the flag to 0 and unpause the process, and finally the instruction continues execution and already uses the data that was copied.
|
|
Back to top |
|
 |
Dark Byte Site Admin
Reputation: 470
Joined: 09 May 2003 Posts: 25778 Location: The netherlands
|
Posted: Wed Nov 25, 2020 2:28 am Post subject: |
|
|
you can also just set that flag in AA and then actively wait in a loop until it is set back to 0 by the lua timer
but yes, you can call ntsuspendprocess and then let lua call unpause()
or call a lua function that calls pause() using luaserver but that may be too big of a workaround
or if performance is important look up events and duplicateHandle
_________________
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 |
|
 |
Antoshick Advanced Cheater
Reputation: 0
Joined: 02 Nov 2018 Posts: 56
|
Posted: Wed Nov 25, 2020 3:46 am Post subject: |
|
|
Quote: |
but yes, you can call ntsuspendprocess and then let lua call unpause()
|
I can only use this method. But for some reason, it didn't pause the game.
I get handle of game process by
Code: | print(getOpenedProcessHandle()) | - printed 1432
then use AA call
Code: | pushfq
push rax
push rbx
push rcx
push rdx
push rsi
push rdi
push rbp
push rsp
push r8
push r9
push r10
push r11
push r12
push r13
push r14
push r15
mov rcx,00000598 //1432
call ntsuspendprocess
pop r15
pop r14
pop r13
pop r12
pop r11
pop r10
pop r9
pop r8
pop rsp
pop rbp
pop rdi
pop rsi
pop rdx
pop rcx
pop rbx
pop rax
popfq |
The game doesn't pause
|
|
Back to top |
|
 |
Dark Byte Site Admin
Reputation: 470
Joined: 09 May 2003 Posts: 25778 Location: The netherlands
|
Posted: Wed Nov 25, 2020 4:47 am Post subject: |
|
|
this should work and is stack alignment safe
Code: |
pushfq
push rax
push rbx
push rcx
push rdx
push rsi
push rdi
push r8
push r9
push r10
push r11
push r12
push r13
push r14
push r15
push rbp
mov rbp,rsp
sub rsp,20
and rsp,fffffffffffffff0 //align
mov rcx,ffffffffffffffff //-1 = currentprocesshandle
call NtSuspendProcess
mov rsp,rbp
pop rbp
pop r15
pop r14
pop r13
pop r12
pop r11
pop r10
pop r9
pop r8
pop rdi
pop rsi
pop rdx
pop rcx
pop rbx
pop rax
popfq
|
and to resume you can call (unpause doesn't work as it only work when it does it itself)
Code: |
executeCodeLocalEx('NtResumeProcess', getOpenedProcessHandle())
|
_________________
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 |
|
 |
Antoshick Advanced Cheater
Reputation: 0
Joined: 02 Nov 2018 Posts: 56
|
Posted: Wed Nov 25, 2020 5:09 am Post subject: |
|
|
Dark Byte wrote: | this should work and is stack alignment safe
Code: |
pushfq
push rax
push rbx
push rcx
push rdx
push rsi
push rdi
push r8
push r9
push r10
push r11
push r12
push r13
push r14
push r15
push rbp
mov rbp,rsp
sub rsp,20
and rsp,fffffffffffffff0 //align
mov rcx,ffffffffffffffff //-1 = currentprocesshandle
call NtSuspendProcess
mov rsp,rbp
pop rbp
pop r15
pop r14
pop r13
pop r12
pop r11
pop r10
pop r9
pop r8
pop rdi
pop rsi
pop rdx
pop rcx
pop rbx
pop rax
popfq
|
and to resume you can call (unpause doesn't work as it only work when it does it itself)
Code: |
executeCodeLocalEx('NtResumeProcess', getOpenedProcessHandle())
|
|
Yes, this work fine.
Thank you.
|
|
Back to top |
|
 |
|