ntmemoryapi 2.3.0__tar.gz → 2.4.0__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.
- {ntmemoryapi-2.3.0 → ntmemoryapi-2.4.0}/PKG-INFO +1 -1
- {ntmemoryapi-2.3.0 → ntmemoryapi-2.4.0}/pyproject.toml +1 -1
- {ntmemoryapi-2.3.0 → ntmemoryapi-2.4.0}/src/ntmemoryapi/__init__.py +7 -3
- {ntmemoryapi-2.3.0 → ntmemoryapi-2.4.0}/README.md +0 -0
- {ntmemoryapi-2.3.0 → ntmemoryapi-2.4.0}/src/ntmemoryapi/embed.py +0 -0
- {ntmemoryapi-2.3.0 → ntmemoryapi-2.4.0}/src/ntmemoryapi/errors.py +0 -0
- {ntmemoryapi-2.3.0 → ntmemoryapi-2.4.0}/src/ntmemoryapi/misc.py +0 -0
- {ntmemoryapi-2.3.0 → ntmemoryapi-2.4.0}/src/ntmemoryapi/structs.py +0 -0
|
@@ -215,7 +215,7 @@ class Process:
|
|
|
215
215
|
if not self.is_64bit():
|
|
216
216
|
raise RuntimeError("Unable to list modules for not 64 bit process using `%s` method, use another one method instead")
|
|
217
217
|
|
|
218
|
-
# If
|
|
218
|
+
# If process PEB retrieve failed
|
|
219
219
|
if not (process_peb := self.get_information().peb):
|
|
220
220
|
raise RuntimeError("Process `%s` PEB address is null-value" % self.name)
|
|
221
221
|
|
|
@@ -380,11 +380,15 @@ class Process:
|
|
|
380
380
|
|
|
381
381
|
return process_basic_information
|
|
382
382
|
|
|
383
|
-
def get_module(self, name: str) -> structs.MODULEENTRY32:
|
|
383
|
+
def get_module(self, name: str, method: typing.Literal["pebwalk", "snapshot"] = "pebwalk") -> structs.MODULEENTRY32:
|
|
384
384
|
"""Get process module information."""
|
|
385
385
|
|
|
386
|
+
# If method is not allowed
|
|
387
|
+
if method.lower() not in [item.lower() for item in allowed_methods] if (allowed_methods := typing.get_args(self.list_modules.__annotations__["method"])) else True:
|
|
388
|
+
raise ValueError("Method literal is invalid, expected one of: `%s`" % ", ".join(allowed_methods))
|
|
389
|
+
|
|
386
390
|
# Process modules enumeration
|
|
387
|
-
for module in self.list_modules():
|
|
391
|
+
for module in self.list_modules(method):
|
|
388
392
|
|
|
389
393
|
# If module have a required name
|
|
390
394
|
if module.name.lower() == name.strip().lower():
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|