diff options
author | segfault <toni@impl.cc> | 2020-12-15 18:49:34 +0100 |
---|---|---|
committer | segfault <toni@impl.cc> | 2020-12-15 18:49:34 +0100 |
commit | 0d68295e7697cad2ec0d39251213f143b199673d (patch) | |
tree | fb1d980b8eb6bb7104589d7ccd0dc1979dd05e1d /MemDriverLib | |
parent | d9fa838219ba5e3bb0b0612e78afc2eb21154621 (diff) |
CheattEngineServer: CMD_OPENPROCESS, CMD_PROCESS32FIRST, CMD_PROCESS32NEXT, CMD_CLOSEHANDLE
* KMemDriver integration
* generic MT-Support achieved by synchronized wrapper functions
* ability to spawn a Ping-Only Thread
Diffstat (limited to 'MemDriverLib')
-rw-r--r-- | MemDriverLib/MemDriverLib.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/MemDriverLib/MemDriverLib.cpp b/MemDriverLib/MemDriverLib.cpp index c79a01a..8123d34 100644 --- a/MemDriverLib/MemDriverLib.cpp +++ b/MemDriverLib/MemDriverLib.cpp @@ -154,6 +154,10 @@ bool KInterface::Modules(HANDLE targetPID, bool KInterface::Exit() { + if (m_pingThreadStarted == true) { + m_pingThreadStarted = false; + m_pingThread.join(); + } m_last_ntstatus = INVALID_NTSTATUS; return SendRecvWait(MEM_EXIT, INFINITE) == SRR_SIGNALED; } @@ -353,4 +357,18 @@ SendRecvReturn KInterface::RecvWait(DWORD timeout) return SRR_ERR_UEVENT; } +void KInterface::PingThread(void) +{ + while (m_pingThreadStarted == true) { + std::this_thread::sleep_for(std::chrono::milliseconds(DEFAULT_TIMEOUT_MS)); + MtPing(); + } +} + +void KInterface::StartPingThread(void) +{ + m_pingThreadStarted = true; + m_pingThread = std::move(std::thread(&KInterface::PingThread, this)); +} + #pragma warning(pop)
\ No newline at end of file |