ShadowB 0.1__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 (42) hide show
  1. shadowb-0.1/LICENSE +21 -0
  2. shadowb-0.1/PKG-INFO +200 -0
  3. shadowb-0.1/README.md +191 -0
  4. shadowb-0.1/ShadowB/Core/fileorg.py +38 -0
  5. shadowb-0.1/ShadowB/Core/randwords.py +76 -0
  6. shadowb-0.1/ShadowB/GetD/make_cookies.py +27 -0
  7. shadowb-0.1/ShadowB/GetD/my_data.py +86 -0
  8. shadowb-0.1/ShadowB/GetD/my_ip.py +12 -0
  9. shadowb-0.1/ShadowB/GetD/scan.py +72 -0
  10. shadowb-0.1/ShadowB/Image/check_image.py +39 -0
  11. shadowb-0.1/ShadowB/Image/export_metadata.py +96 -0
  12. shadowb-0.1/ShadowB/Image/extr_hidden_files.py +44 -0
  13. shadowb-0.1/ShadowB/Image/extr_hidden_text.py +39 -0
  14. shadowb-0.1/ShadowB/Image/makeFile.py +48 -0
  15. shadowb-0.1/ShadowB/Image/makeText.py +41 -0
  16. shadowb-0.1/ShadowB/Image/remove_metadata.py +48 -0
  17. shadowb-0.1/ShadowB/Mail/make_mail.py +36 -0
  18. shadowb-0.1/ShadowB/Mail/res_msj.py +44 -0
  19. shadowb-0.1/ShadowB/Mail/send_msj.py +13 -0
  20. shadowb-0.1/ShadowB/Qrcode/generate.py +35 -0
  21. shadowb-0.1/ShadowB/Qrcode/scan.py +26 -0
  22. shadowb-0.1/ShadowB/Safe/clean.py +127 -0
  23. shadowb-0.1/ShadowB/Safe/cleanText.py +37 -0
  24. shadowb-0.1/ShadowB/Safe/ext.py +5 -0
  25. shadowb-0.1/ShadowB/Safe/filename.py +6 -0
  26. shadowb-0.1/ShadowB/Safe/safeFile.py +171 -0
  27. shadowb-0.1/ShadowB/__init__.py +44 -0
  28. shadowb-0.1/ShadowB/captcha.py +73 -0
  29. shadowb-0.1/ShadowB/core.py +106 -0
  30. shadowb-0.1/ShadowB/getD.py +28 -0
  31. shadowb-0.1/ShadowB/image.py +31 -0
  32. shadowb-0.1/ShadowB/mail.py +21 -0
  33. shadowb-0.1/ShadowB/passwords.py +47 -0
  34. shadowb-0.1/ShadowB/qrcode.py +10 -0
  35. shadowb-0.1/ShadowB/safe.py +80 -0
  36. shadowb-0.1/ShadowB/search.py +50 -0
  37. shadowb-0.1/ShadowB.egg-info/PKG-INFO +200 -0
  38. shadowb-0.1/ShadowB.egg-info/SOURCES.txt +40 -0
  39. shadowb-0.1/ShadowB.egg-info/dependency_links.txt +1 -0
  40. shadowb-0.1/ShadowB.egg-info/top_level.txt +1 -0
  41. shadowb-0.1/pyproject.toml +13 -0
  42. shadowb-0.1/setup.cfg +4 -0
shadowb-0.1/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Adem mzoughi
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
shadowb-0.1/PKG-INFO ADDED
@@ -0,0 +1,200 @@
1
+ Metadata-Version: 2.1
2
+ Name: ShadowB
3
+ Version: 0.1
4
+ Summary: ShadowB is an all-in-one Python toolkit that bundles a wide range of everyday utilities — system info, image steganography, temporary email, QR codes, CAPTCHA generation, password tools, file safety checks, and more — into a single, easy-to-import package.
5
+ Author-email: Adem mzoughi <ademzoughi1312@gmail.com>
6
+ Requires-Python: >=3.8
7
+ Description-Content-Type: text/markdown
8
+ License-File: LICENSE
9
+
10
+ # ShadowB
11
+
12
+ **ShadowB** is an all-in-one Python toolkit that bundles a wide range of everyday utilities — system info, image steganography, temporary email, QR codes, CAPTCHA generation, password tools, file safety checks, and more — into a single, easy-to-import package.
13
+
14
+ Instead of installing and learning a dozen different libraries for a dozen small tasks, `ShadowB` collects the most commonly needed helper functions in one place.
15
+
16
+ > 100% open source. No telemetry, no analytics, no external server. Every function runs **locally** on the user's own machine — nothing is collected or transmitted by the library's maintainers.
17
+
18
+ ---
19
+
20
+ ## Installation
21
+
22
+ ```bash
23
+ pip install ShadowB
24
+ ```
25
+
26
+ ---
27
+
28
+ ## Table of Contents
29
+
30
+ - [core](#core)
31
+ - [getD](#getd)
32
+ - [search](#search)
33
+ - [captcha](#captcha)
34
+ - [qrcode](#qrcode)
35
+ - [mail](#mail)
36
+ - [safe](#safe)
37
+ - [image](#image)
38
+ - [passwords](#passwords)
39
+ - [Responsible Use](#-responsible-use)
40
+ - [License](#-license)
41
+
42
+ ---
43
+
44
+ ## `core`
45
+
46
+ Basic package metadata and bootstrapping.
47
+
48
+ ```python
49
+ from ShadowB import core
50
+
51
+ core.start() # run core app fro : create passwords or usernames / organize the working files
52
+ core.owner() # -> "Adem mzoughi"
53
+ core.team() # -> "Adem mzoughi, Berlin, Shadow"
54
+ core.hp() # print help / usage info
55
+ core.vr() # print current version
56
+ ```
57
+
58
+ ---
59
+
60
+ ## `getD`
61
+
62
+ Local system & network diagnostics — useful for things like monitoring your own machine's load, debugging your own network setup, or quick scripting.
63
+
64
+ ```python
65
+ from ShadowB import getD
66
+
67
+ getD.my_ip() # your public IP address
68
+ getD.my_data() # IP, country, and basic PC specs (CPU/RAM, etc.)
69
+ getD.get_cookies(filename) # export your own browser's cookies to a local .txt file
70
+ getD.scan_open_ports() # check which ports are open on a given website
71
+ getD.whm() # print the current working directory (e.g. C:/Users/Pc/Desktop)
72
+ ```
73
+
74
+ > ⚠️ `get_cookies()` reads cookies from **your own** browser profile and `scan_open_ports()` should only be run against hosts you own or are authorized to test. See [Responsible Use](#-responsible-use).
75
+
76
+ ---
77
+
78
+ ## `search`
79
+
80
+ Look up whether a username exists on a given platform.
81
+
82
+ ```python
83
+ from ShadowB import search
84
+
85
+ search.forgot.search_by_username(app, username)
86
+ # returns True (and prints the profile link) or False
87
+ # app: ".insta" | ".fc" | ".yt"
88
+ ```
89
+
90
+ ---
91
+
92
+ ## `captcha`
93
+
94
+ Generate CAPTCHA images.
95
+
96
+ ```python
97
+ from ShadowB import captcha
98
+
99
+ captcha.generate_captcha("captcha") # image name
100
+ ```
101
+
102
+ ---
103
+
104
+ ## `qrcode`
105
+
106
+ Generate and read QR codes.
107
+
108
+ ```python
109
+ from ShadowB import qrcode
110
+
111
+ qrcode.generate_qrcode(text, "qr") # create a QR code image
112
+ qrcode.scan_qrcode("qr.png") # -> decoded text (str)
113
+ ```
114
+
115
+ ---
116
+
117
+ ## `mail`
118
+
119
+ Disposable email creation and sending (Gmail SMTP).
120
+
121
+ ```python
122
+ from ShadowB import mail
123
+
124
+ mail.create_email() # -> email, password, token
125
+ mail.get_msj(token) # -> list of received messages (id, subject, body, ...)
126
+ mail.send_msj(sender, app_password, to, subject, body) # send via Gmail SMTP
127
+ ```
128
+
129
+ ---
130
+
131
+ ## `safe`
132
+
133
+ File inspection and sanitation helpers.
134
+
135
+ ```python
136
+ from ShadowB import safe
137
+
138
+ safe.safeFile(file) # -> True / False
139
+ safe.size(file) # -> file size
140
+ safe.name(file) # -> file name
141
+ safe.ext(file) # -> file extension
142
+ safe.clean(file, check_list) # -> True / False
143
+ safe.cleanText(text, check_list) # -> True / False
144
+ ```
145
+
146
+ ---
147
+
148
+ ## `image`
149
+
150
+ Metadata and steganography utilities.
151
+
152
+ ```python
153
+ from ShadowB import image
154
+
155
+ image.expMetadata(img) # read EXIF / metadata
156
+ image.check_img(img) # -> True / False (contains hidden text/file)
157
+ image.extr_file(img) # extract a hidden file from the image
158
+ image.extr_text(img) # extract hidden text from the image
159
+ image.removeMetadata(img) # strip metadata (useful before sharing photos)
160
+ image.hide_text(img, text) # embed hidden text into the image
161
+ image.hide_file(img, file) # embed a hidden file into the image
162
+ ```
163
+
164
+ ---
165
+
166
+ ## `passwords`
167
+
168
+ ```python
169
+ from ShadowB import passwords
170
+
171
+ passwords.check_strenght(password) # rate password strength
172
+ passwords.create_password() # generate a strong password
173
+ ```
174
+
175
+ ---
176
+
177
+ ## ⚖️ Responsible Use
178
+
179
+ `ShadowB` is a general-purpose utility library, similar in spirit to combining tools like `requests`, `browser_cookie3`, `psutil`, `python-nmap`, and `Pillow`-based steganography helpers into one package. It performs no network exfiltration on its own and contacts no third-party server.
180
+
181
+ That said, several functions are powerful and should be used responsibly:
182
+
183
+ - Only run `get_cookies()` against your **own** browser profile.
184
+ - Only use `scan_open_ports()` on systems/websites you **own** or are explicitly authorized to test.
185
+ - Respect each platform's Terms of Service and applicable privacy laws when using `search.forgot.search_by_username`.
186
+ - Don't use the steganography functions (`hide_text`, `hide_file`) to conceal malicious payloads or to deceive other people.
187
+
188
+ You are responsible for complying with local laws and the terms of any service you interact with through this library.
189
+
190
+ ---
191
+
192
+ ## 📄 License
193
+
194
+ This project is licensed under the [MIT License](./LICENSE).
195
+
196
+ ---
197
+
198
+ ## 👤 Author
199
+
200
+ **Adem mzoughi** — 2026/23/06
shadowb-0.1/README.md ADDED
@@ -0,0 +1,191 @@
1
+ # ShadowB
2
+
3
+ **ShadowB** is an all-in-one Python toolkit that bundles a wide range of everyday utilities — system info, image steganography, temporary email, QR codes, CAPTCHA generation, password tools, file safety checks, and more — into a single, easy-to-import package.
4
+
5
+ Instead of installing and learning a dozen different libraries for a dozen small tasks, `ShadowB` collects the most commonly needed helper functions in one place.
6
+
7
+ > 100% open source. No telemetry, no analytics, no external server. Every function runs **locally** on the user's own machine — nothing is collected or transmitted by the library's maintainers.
8
+
9
+ ---
10
+
11
+ ## Installation
12
+
13
+ ```bash
14
+ pip install ShadowB
15
+ ```
16
+
17
+ ---
18
+
19
+ ## Table of Contents
20
+
21
+ - [core](#core)
22
+ - [getD](#getd)
23
+ - [search](#search)
24
+ - [captcha](#captcha)
25
+ - [qrcode](#qrcode)
26
+ - [mail](#mail)
27
+ - [safe](#safe)
28
+ - [image](#image)
29
+ - [passwords](#passwords)
30
+ - [Responsible Use](#-responsible-use)
31
+ - [License](#-license)
32
+
33
+ ---
34
+
35
+ ## `core`
36
+
37
+ Basic package metadata and bootstrapping.
38
+
39
+ ```python
40
+ from ShadowB import core
41
+
42
+ core.start() # run core app fro : create passwords or usernames / organize the working files
43
+ core.owner() # -> "Adem mzoughi"
44
+ core.team() # -> "Adem mzoughi, Berlin, Shadow"
45
+ core.hp() # print help / usage info
46
+ core.vr() # print current version
47
+ ```
48
+
49
+ ---
50
+
51
+ ## `getD`
52
+
53
+ Local system & network diagnostics — useful for things like monitoring your own machine's load, debugging your own network setup, or quick scripting.
54
+
55
+ ```python
56
+ from ShadowB import getD
57
+
58
+ getD.my_ip() # your public IP address
59
+ getD.my_data() # IP, country, and basic PC specs (CPU/RAM, etc.)
60
+ getD.get_cookies(filename) # export your own browser's cookies to a local .txt file
61
+ getD.scan_open_ports() # check which ports are open on a given website
62
+ getD.whm() # print the current working directory (e.g. C:/Users/Pc/Desktop)
63
+ ```
64
+
65
+ > ⚠️ `get_cookies()` reads cookies from **your own** browser profile and `scan_open_ports()` should only be run against hosts you own or are authorized to test. See [Responsible Use](#-responsible-use).
66
+
67
+ ---
68
+
69
+ ## `search`
70
+
71
+ Look up whether a username exists on a given platform.
72
+
73
+ ```python
74
+ from ShadowB import search
75
+
76
+ search.forgot.search_by_username(app, username)
77
+ # returns True (and prints the profile link) or False
78
+ # app: ".insta" | ".fc" | ".yt"
79
+ ```
80
+
81
+ ---
82
+
83
+ ## `captcha`
84
+
85
+ Generate CAPTCHA images.
86
+
87
+ ```python
88
+ from ShadowB import captcha
89
+
90
+ captcha.generate_captcha("captcha") # image name
91
+ ```
92
+
93
+ ---
94
+
95
+ ## `qrcode`
96
+
97
+ Generate and read QR codes.
98
+
99
+ ```python
100
+ from ShadowB import qrcode
101
+
102
+ qrcode.generate_qrcode(text, "qr") # create a QR code image
103
+ qrcode.scan_qrcode("qr.png") # -> decoded text (str)
104
+ ```
105
+
106
+ ---
107
+
108
+ ## `mail`
109
+
110
+ Disposable email creation and sending (Gmail SMTP).
111
+
112
+ ```python
113
+ from ShadowB import mail
114
+
115
+ mail.create_email() # -> email, password, token
116
+ mail.get_msj(token) # -> list of received messages (id, subject, body, ...)
117
+ mail.send_msj(sender, app_password, to, subject, body) # send via Gmail SMTP
118
+ ```
119
+
120
+ ---
121
+
122
+ ## `safe`
123
+
124
+ File inspection and sanitation helpers.
125
+
126
+ ```python
127
+ from ShadowB import safe
128
+
129
+ safe.safeFile(file) # -> True / False
130
+ safe.size(file) # -> file size
131
+ safe.name(file) # -> file name
132
+ safe.ext(file) # -> file extension
133
+ safe.clean(file, check_list) # -> True / False
134
+ safe.cleanText(text, check_list) # -> True / False
135
+ ```
136
+
137
+ ---
138
+
139
+ ## `image`
140
+
141
+ Metadata and steganography utilities.
142
+
143
+ ```python
144
+ from ShadowB import image
145
+
146
+ image.expMetadata(img) # read EXIF / metadata
147
+ image.check_img(img) # -> True / False (contains hidden text/file)
148
+ image.extr_file(img) # extract a hidden file from the image
149
+ image.extr_text(img) # extract hidden text from the image
150
+ image.removeMetadata(img) # strip metadata (useful before sharing photos)
151
+ image.hide_text(img, text) # embed hidden text into the image
152
+ image.hide_file(img, file) # embed a hidden file into the image
153
+ ```
154
+
155
+ ---
156
+
157
+ ## `passwords`
158
+
159
+ ```python
160
+ from ShadowB import passwords
161
+
162
+ passwords.check_strenght(password) # rate password strength
163
+ passwords.create_password() # generate a strong password
164
+ ```
165
+
166
+ ---
167
+
168
+ ## ⚖️ Responsible Use
169
+
170
+ `ShadowB` is a general-purpose utility library, similar in spirit to combining tools like `requests`, `browser_cookie3`, `psutil`, `python-nmap`, and `Pillow`-based steganography helpers into one package. It performs no network exfiltration on its own and contacts no third-party server.
171
+
172
+ That said, several functions are powerful and should be used responsibly:
173
+
174
+ - Only run `get_cookies()` against your **own** browser profile.
175
+ - Only use `scan_open_ports()` on systems/websites you **own** or are explicitly authorized to test.
176
+ - Respect each platform's Terms of Service and applicable privacy laws when using `search.forgot.search_by_username`.
177
+ - Don't use the steganography functions (`hide_text`, `hide_file`) to conceal malicious payloads or to deceive other people.
178
+
179
+ You are responsible for complying with local laws and the terms of any service you interact with through this library.
180
+
181
+ ---
182
+
183
+ ## 📄 License
184
+
185
+ This project is licensed under the [MIT License](./LICENSE).
186
+
187
+ ---
188
+
189
+ ## 👤 Author
190
+
191
+ **Adem mzoughi** — 2026/23/06
@@ -0,0 +1,38 @@
1
+ import os
2
+ import shutil
3
+
4
+ def florg(folder=None):
5
+ if folder is None:
6
+ return "The folder path is required!"
7
+ types = {
8
+ ".jpg": "Images", ".png": "Images", ".jpeg": "Images",
9
+ ".zip": "Archives", ".rar": "Archives",
10
+ ".pdf": "Documents", ".docx": "Documents", ".txt": "Documents",
11
+ ".mp3": "Music", ".wav": "Music",
12
+ ".py": "Code", ".js": "Code", ".html": "Code",
13
+ ".exe": "Code", ".cpp": "Code", ".css": "Code"
14
+ }
15
+
16
+
17
+ skip_folders = set(types.values())
18
+
19
+ for root, dirs, files in os.walk(folder):
20
+
21
+ dirs[:] = [d for d in dirs if d not in skip_folders]
22
+
23
+ moved = 0
24
+ for file in files:
25
+ path = os.path.join(root, file)
26
+ ext = os.path.splitext(file)[1].lower()
27
+ if ext in types:
28
+ target_folder = os.path.join(root, types[ext])
29
+ os.makedirs(target_folder, exist_ok=True)
30
+ shutil.move(path, os.path.join(target_folder, file))
31
+ print(f"{file} → {root}/{types[ext]}/")
32
+ moved += 1
33
+ else:
34
+ print(f"Unknown extension: {file}")
35
+
36
+ if moved > 0:
37
+ print(f"\n Your files have been organized successfully: {root}\n")
38
+
@@ -0,0 +1,76 @@
1
+ import string
2
+ from random import choice
3
+ import itertools as ito
4
+ from pathlib import Path
5
+
6
+
7
+ def randw(filename,rep,others_chars,numbers,symbols,letters,form):
8
+ if numbers and symbols and letters:
9
+ if form == "maj":
10
+ final_combo = string.ascii_uppercase + string.digits + string.punctuation + others_chars
11
+ elif form == "min":
12
+ final_combo = string.ascii_lowercase + string.digits + string.punctuation + others_chars
13
+ else:
14
+ final_combo = string.ascii_letters + string.digits + string.punctuation + others_chars
15
+
16
+
17
+ # numbers
18
+ elif numbers and symbols and not letters:
19
+ final_combo = string.digits + string.punctuation + others_chars
20
+
21
+ elif numbers and not symbols and letters:
22
+ if form == "maj":
23
+ final_combo = string.ascii_uppercase + string.digits + others_chars
24
+ elif form == "min":
25
+ final_combo = string.ascii_lowercase + string.digits + others_chars
26
+ else:
27
+ final_combo = string.ascii_letters + string.digits + others_chars
28
+
29
+ elif numbers and not symbols and not letters:
30
+ final_combo = string.digits
31
+
32
+
33
+ # letters
34
+ elif letters and symbols and not numbers:
35
+ if form == "maj":
36
+ final_combo = string.ascii_uppercase + string.punctuation + others_chars
37
+ elif form == "min":
38
+ final_combo = string.ascii_lowercase + string.punctuation + others_chars
39
+ else:
40
+ final_combo = string.ascii_letters + string.punctuation + others_chars
41
+
42
+
43
+ elif letters and not symbols and not numbers:
44
+ if form == "maj":
45
+ final_combo = string.ascii_uppercase
46
+ elif form == "min":
47
+ final_combo = string.ascii_lowercase
48
+ else:
49
+ final_combo = string.ascii_letters
50
+
51
+
52
+ #symbols
53
+ elif symbols and not letters and not numbers:
54
+ if form == "maj":
55
+ final_combo = string.punctuation + others_chars
56
+ elif form == "min":
57
+ final_combo = string.punctuation + others_chars
58
+ else:
59
+ final_combo = string.punctuation + others_chars
60
+
61
+ else:
62
+ final_combo = string.ascii_letters + string.digits + string.punctuation + others_chars
63
+
64
+
65
+ final_combo = string.ascii_letters + string.digits + someCaracters + others_chars
66
+ if rep > 5:
67
+ print("The maximum number of slots you can reach is 5")
68
+ if rep < 2:
69
+ print("The smallest number of digits possible is 2")
70
+ desktop = Path.home() / "Desktop"
71
+ words = [''.join(combo) for combo in ito.product(final_combo, repeat=rep)]
72
+ with open(desktop / f"{filename}.txt","w") as w:
73
+ for wr in words:
74
+ w.write(wr + "\n")
75
+ print(f"Alright, it has been saved in : {desktop / (filename + '.txt')}")
76
+
@@ -0,0 +1,27 @@
1
+ import os
2
+ try:
3
+ import browser_cookie3
4
+ except ImportError:
5
+ import os
6
+ os.system("pip install browser_cookie3")
7
+ import browser_cookie3
8
+
9
+
10
+ def cookies(filename):
11
+ cookies = browser_cookie3.chrome()
12
+
13
+
14
+ with open(f"{filename}.txt", "w", encoding="utf-8") as f:
15
+ f.write("# Netscape HTTP Cookie File\n")
16
+ f.write("# This is a generated file! Do not edit.\n\n")
17
+
18
+ for cookie in cookies:
19
+
20
+ is_secure = "TRUE" if cookie.secure else "FALSE"
21
+ expiration = str(int(cookie.expires)) if cookie.expires else "0"
22
+
23
+ line = f"{cookie.domain}\t{is_secure}\t{cookie.path}\t{is_secure}\t{expiration}\t{cookie.name}\t{cookie.value}\n"
24
+ f.write(line)
25
+
26
+ print(f"Saved at : {filename}.txt and cookies")
27
+ return cookies
@@ -0,0 +1,86 @@
1
+ import platform
2
+ import socket
3
+ import os
4
+ import shutil
5
+ import ctypes
6
+ import getpass
7
+
8
+
9
+ def make_file():
10
+
11
+ data = []
12
+
13
+ data.append("=== Device Information ===\n")
14
+
15
+ username = getpass.getuser()
16
+
17
+
18
+
19
+
20
+ data.append(username)
21
+
22
+ hostname = socket.gethostname()
23
+ data.append(f"Hostname: {hostname}\n")
24
+
25
+
26
+ try:
27
+ s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
28
+ s.connect(("8.8.8.8", 80))
29
+ local_ip = s.getsockname()[0]
30
+ s.close()
31
+ except:
32
+ local_ip = "Not available"
33
+ data.append(f"Local IP: {local_ip}\n")
34
+
35
+
36
+ os_name = platform.system()
37
+ os_release = platform.release()
38
+ arch = platform.architecture()[0]
39
+ data.append(f"Operating System: {os_name} {os_release}\n")
40
+ data.append(f"Architecture: {arch}\n")
41
+
42
+
43
+ class MEMORYSTATUSEX(ctypes.Structure):
44
+ _fields_ = [
45
+ ("dwLength", ctypes.c_ulong),
46
+ ("dwMemoryLoad", ctypes.c_ulong),
47
+ ("ullTotalPhys", ctypes.c_ulonglong),
48
+ ("ullAvailPhys", ctypes.c_ulonglong),
49
+ ("ullTotalPageFile", ctypes.c_ulonglong),
50
+ ("ullAvailPageFile", ctypes.c_ulonglong),
51
+ ("ullTotalVirtual", ctypes.c_ulonglong),
52
+ ("ullAvailVirtual", ctypes.c_ulonglong),
53
+ ("sullAvailExtendedVirtual", ctypes.c_ulonglong),
54
+ ]
55
+
56
+ def __init__(self):
57
+ super(MEMORYSTATUSEX, self).__init__()
58
+ self.dwLength = ctypes.sizeof(self)
59
+
60
+ kernel32 = ctypes.windll.kernel32
61
+ stat = MEMORYSTATUSEX()
62
+ kernel32.GlobalMemoryStatusEx(ctypes.byref(stat))
63
+
64
+ ram_bytes = stat.ullTotalPhys
65
+ ram_mb = ram_bytes // (1024 * 1024)
66
+ ram_gb = round(ram_mb / 1024, 1)
67
+ data.append(f"Total RAM: {ram_gb} GB ({ram_mb} MB)\n")
68
+
69
+
70
+ try:
71
+ total, used, free = shutil.disk_usage('C:\\')
72
+ total_gb = round(total / (1024**3), 1)
73
+ used_gb = round(used / (1024**3), 1)
74
+ free_gb = round(free / (1024**3), 1)
75
+ data.append(f"Disk C: Total {total_gb} GB\n")
76
+ data.append(f"Disk C: Used {used_gb} GB\n")
77
+ data.append(f"Disk C: Free {free_gb} GB\n")
78
+ except Exception as e:
79
+ data.append(f"Disk C: Error reading usage - {str(e)}\n")
80
+ d = [data]
81
+ data.append("\n=== End of Information ===\n")
82
+
83
+ with open("PcData.txt", "w", encoding="utf-8") as f:
84
+ f.writelines(data)
85
+ print("Saved at : PcData.txt")
86
+ return d
@@ -0,0 +1,12 @@
1
+ import socket
2
+
3
+ def ip():
4
+ try:
5
+ s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
6
+ s.connect(("8.8.8.8", 80))
7
+ local_ip = s.getsockname()[0]
8
+ s.close()
9
+ except:
10
+ local_ip = "Not available"
11
+ print(local_ip)
12
+ return local_ip