sniparinject 0.0.0.dev7__py3-none-any.whl → 0.0.0.dev8__py3-none-any.whl
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.
- sniparinject/core/game.py +3 -4
- sniparinject/core/settings.py +2 -2
- sniparinject/network_sniffer.py +2 -2
- {sniparinject-0.0.0.dev7.dist-info → sniparinject-0.0.0.dev8.dist-info}/METADATA +8 -10
- sniparinject-0.0.0.dev8.dist-info/RECORD +11 -0
- {sniparinject-0.0.0.dev7.dist-info → sniparinject-0.0.0.dev8.dist-info}/WHEEL +1 -1
- sniparinject-0.0.0.dev7.dist-info/RECORD +0 -11
- {sniparinject-0.0.0.dev7.dist-info → sniparinject-0.0.0.dev8.dist-info}/top_level.txt +0 -0
sniparinject/core/game.py
CHANGED
|
@@ -57,7 +57,6 @@ class Game:
|
|
|
57
57
|
error_message, error_location = self._extract_exception(error)
|
|
58
58
|
error_location = f'Class Game{error_location}'
|
|
59
59
|
self._print_error(error_message, error_location)
|
|
60
|
-
return
|
|
61
60
|
|
|
62
61
|
@staticmethod
|
|
63
62
|
def _extract_exception(error: Exception) -> tuple[str, str]:
|
|
@@ -95,7 +94,7 @@ class Game:
|
|
|
95
94
|
"""
|
|
96
95
|
message, extracted_location = self._extract_exception(error)
|
|
97
96
|
full_location = f'{location}{extracted_location}'
|
|
98
|
-
raise
|
|
97
|
+
raise RuntimeError(message, full_location)
|
|
99
98
|
|
|
100
99
|
def _print_error(self, error: str, location: str) -> None:
|
|
101
100
|
"""
|
|
@@ -164,8 +163,8 @@ class Game:
|
|
|
164
163
|
:rtype: dict
|
|
165
164
|
:return: The actions with the settings.
|
|
166
165
|
"""
|
|
167
|
-
settings_exception =
|
|
168
|
-
|
|
166
|
+
settings_exception = RuntimeError('The Game settings are missing.',
|
|
167
|
+
' -> Settings(...).get(\'Game\')')
|
|
169
168
|
|
|
170
169
|
general_settings = {}
|
|
171
170
|
try:
|
sniparinject/core/settings.py
CHANGED
|
@@ -31,10 +31,10 @@ class Settings:
|
|
|
31
31
|
:rtype: dict
|
|
32
32
|
:return: The settings for Python usage.
|
|
33
33
|
"""
|
|
34
|
-
with open(self.config_file) as file:
|
|
34
|
+
with open(self.config_file, encoding='utf-8') as file:
|
|
35
35
|
settings = load(file, Loader=FullLoader)
|
|
36
36
|
|
|
37
37
|
if not settings:
|
|
38
|
-
raise
|
|
38
|
+
raise ValueError(f'Error: Not found settings in the file `{self.config_file}`.')
|
|
39
39
|
|
|
40
40
|
return settings
|
sniparinject/network_sniffer.py
CHANGED
|
@@ -80,10 +80,10 @@ class NetworkSniffer:
|
|
|
80
80
|
"""
|
|
81
81
|
ip_layer = packet.getlayer(IP)
|
|
82
82
|
if not ip_layer:
|
|
83
|
-
raise
|
|
83
|
+
raise RuntimeError('Error: The IP layer not exists in this package.')
|
|
84
84
|
|
|
85
85
|
if not (packet.haslayer(TCP) or packet.haslayer(UDP)):
|
|
86
|
-
raise
|
|
86
|
+
raise RuntimeError('Error: The protocol layer (TCP or UDP) not exists in this package.')
|
|
87
87
|
|
|
88
88
|
layer_type = packet.getlayer(UDP) if self.protocol == 'udp' else packet.getlayer(TCP)
|
|
89
89
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: sniparinject
|
|
3
|
-
Version: 0.0.0.
|
|
3
|
+
Version: 0.0.0.dev8
|
|
4
4
|
Summary: Intercept and read the network packets to find useful information. Also, inject some data.
|
|
5
5
|
Home-page: https://github.com/airvzxf/sniparinject
|
|
6
6
|
Author: Israel Roldan
|
|
@@ -21,17 +21,17 @@ Classifier: Natural Language :: English
|
|
|
21
21
|
Classifier: Operating System :: POSIX :: Linux
|
|
22
22
|
Classifier: Operating System :: Unix
|
|
23
23
|
Classifier: Programming Language :: Python :: 3
|
|
24
|
-
Classifier: Programming Language :: Python :: 3.
|
|
25
|
-
Classifier: Programming Language :: Python :: 3.10
|
|
24
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
26
25
|
Classifier: Programming Language :: Python :: Implementation :: PyPy
|
|
27
26
|
Classifier: Topic :: Games/Entertainment
|
|
28
27
|
Classifier: Topic :: Security
|
|
29
28
|
Classifier: Topic :: System :: Networking
|
|
30
29
|
Classifier: Topic :: System :: Networking :: Monitoring
|
|
31
|
-
Requires-Python: >=3.
|
|
30
|
+
Requires-Python: >=3.11
|
|
32
31
|
Description-Content-Type: text/markdown
|
|
33
|
-
Requires-Dist: PyYAML
|
|
34
|
-
Requires-Dist: scapy
|
|
32
|
+
Requires-Dist: PyYAML>=6.0.3
|
|
33
|
+
Requires-Dist: scapy>=2.7.0
|
|
34
|
+
Dynamic: description
|
|
35
35
|
|
|
36
36
|
# SniParInject
|
|
37
37
|
|
|
@@ -58,7 +58,7 @@ python3 -m pip install sniparinject
|
|
|
58
58
|
### As a developer
|
|
59
59
|
|
|
60
60
|
The only two special Python's packages that you need are `scapy` and
|
|
61
|
-
`PyYAML`, the suggested version of `Python` is `>= 3.
|
|
61
|
+
`PyYAML`, the suggested version of `Python` is `>= 3.11`. Follow the commands to
|
|
62
62
|
set up and install this package.
|
|
63
63
|
|
|
64
64
|
```bash
|
|
@@ -492,5 +492,3 @@ Enjoy!
|
|
|
492
492
|
[ascii-mana-link]: https://asciinema.org/a/R0mxcmrpWHzX96NDJyc7kyTDB
|
|
493
493
|
|
|
494
494
|
[structs]: https://docs.python.org/3/library/struct.html#format-characters
|
|
495
|
-
|
|
496
|
-
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
sniparinject/__init__.py,sha256=e6SXifSM2k8jxos7320W_19mIId1HR8VlK8Y3VL_U0w,69
|
|
2
|
+
sniparinject/network_sniffer.py,sha256=xbGaM_AVititp_7y0NWAuCuvIxLtjp_zd3Q8zvqLpmg,2962
|
|
3
|
+
sniparinject/core/__init__.py,sha256=e6SXifSM2k8jxos7320W_19mIId1HR8VlK8Y3VL_U0w,69
|
|
4
|
+
sniparinject/core/game.py,sha256=3lCQG0rFJFllGYrPSZOKXEdSx0NigRjk17iJXd7Kjxo,17664
|
|
5
|
+
sniparinject/core/settings.py,sha256=PKOjEwUtOU0Cl18NtzFvCBWLR9bjyvk22bZ5TwDDR3k,1073
|
|
6
|
+
sniparinject/core/text_style.py,sha256=aK5aB_HT_qHIsTRGms1EcjRj8wJLofoloP20mzenMao,273
|
|
7
|
+
sniparinject/core/utility.py,sha256=hM7xO77KBqFHvM_wC4p57b_cLr-vxdGfcJzH6ymy_8Q,1607
|
|
8
|
+
sniparinject-0.0.0.dev8.dist-info/METADATA,sha256=omT4aDufeJ7I0jilXMII3z93Ha9fJsteObLCgSYAjLw,12935
|
|
9
|
+
sniparinject-0.0.0.dev8.dist-info/WHEEL,sha256=mOdXR9C3wMVov7cSY8PY-XCzo3SmmWCHvGQr5csJoao,91
|
|
10
|
+
sniparinject-0.0.0.dev8.dist-info/top_level.txt,sha256=txiwH5zWpKjjp0CCQWnWpRBOnMO33DEzuuXd7DpFAlE,13
|
|
11
|
+
sniparinject-0.0.0.dev8.dist-info/RECORD,,
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
sniparinject/__init__.py,sha256=e6SXifSM2k8jxos7320W_19mIId1HR8VlK8Y3VL_U0w,69
|
|
2
|
-
sniparinject/network_sniffer.py,sha256=0qfybdNspvQ4pPIekL_Q2gQZ1lQeC2cQaNZNnynNSLw,2956
|
|
3
|
-
sniparinject/core/__init__.py,sha256=e6SXifSM2k8jxos7320W_19mIId1HR8VlK8Y3VL_U0w,69
|
|
4
|
-
sniparinject/core/game.py,sha256=V-KiwQ_AMJ0ms44VnuedieDLl9ZqtWfPCJqEOx9r9w0,17674
|
|
5
|
-
sniparinject/core/settings.py,sha256=Fl8xgULJaAC8qkhsaZMtqbMcnJKaAE4V-U0WBXHDRGc,1054
|
|
6
|
-
sniparinject/core/text_style.py,sha256=aK5aB_HT_qHIsTRGms1EcjRj8wJLofoloP20mzenMao,273
|
|
7
|
-
sniparinject/core/utility.py,sha256=hM7xO77KBqFHvM_wC4p57b_cLr-vxdGfcJzH6ymy_8Q,1607
|
|
8
|
-
sniparinject-0.0.0.dev7.dist-info/METADATA,sha256=miVUuObAUMUHo86mlcS3EwyGQVxLl32iaD2aLnKbQ-A,12970
|
|
9
|
-
sniparinject-0.0.0.dev7.dist-info/WHEEL,sha256=OqRkF0eY5GHssMorFjlbTIq072vpHpF60fIQA6lS9xA,92
|
|
10
|
-
sniparinject-0.0.0.dev7.dist-info/top_level.txt,sha256=txiwH5zWpKjjp0CCQWnWpRBOnMO33DEzuuXd7DpFAlE,13
|
|
11
|
-
sniparinject-0.0.0.dev7.dist-info/RECORD,,
|
|
File without changes
|