PyMemoryEditor 1.5.23__tar.gz → 1.6.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.
Files changed (44) hide show
  1. pymemoryeditor-1.6.0/.tool-versions +1 -0
  2. {pymemoryeditor-1.5.23 → pymemoryeditor-1.6.0}/PKG-INFO +1 -3
  3. {pymemoryeditor-1.5.23 → pymemoryeditor-1.6.0}/PyMemoryEditor/__init__.py +1 -1
  4. {pymemoryeditor-1.5.23 → pymemoryeditor-1.6.0}/PyMemoryEditor/util/scan.py +8 -7
  5. {pymemoryeditor-1.5.23 → pymemoryeditor-1.6.0}/PyMemoryEditor/win32/enums/memory_protections.py +1 -1
  6. {pymemoryeditor-1.5.23 → pymemoryeditor-1.6.0}/PyMemoryEditor/win32/functions.py +2 -1
  7. {pymemoryeditor-1.5.23 → pymemoryeditor-1.6.0}/README.md +0 -2
  8. {pymemoryeditor-1.5.23 → pymemoryeditor-1.6.0}/.flake8 +0 -0
  9. {pymemoryeditor-1.5.23 → pymemoryeditor-1.6.0}/.github/workflows/python-package.yml +0 -0
  10. {pymemoryeditor-1.5.23 → pymemoryeditor-1.6.0}/.gitignore +0 -0
  11. {pymemoryeditor-1.5.23 → pymemoryeditor-1.6.0}/LICENSE +0 -0
  12. {pymemoryeditor-1.5.23 → pymemoryeditor-1.6.0}/Makefile +0 -0
  13. {pymemoryeditor-1.5.23 → pymemoryeditor-1.6.0}/PyMemoryEditor/__main__.py +0 -0
  14. {pymemoryeditor-1.5.23 → pymemoryeditor-1.6.0}/PyMemoryEditor/enums.py +0 -0
  15. {pymemoryeditor-1.5.23 → pymemoryeditor-1.6.0}/PyMemoryEditor/linux/functions.py +0 -0
  16. {pymemoryeditor-1.5.23 → pymemoryeditor-1.6.0}/PyMemoryEditor/linux/process.py +0 -0
  17. {pymemoryeditor-1.5.23 → pymemoryeditor-1.6.0}/PyMemoryEditor/linux/ptrace/__init__.py +0 -0
  18. {pymemoryeditor-1.5.23 → pymemoryeditor-1.6.0}/PyMemoryEditor/linux/ptrace/enums.py +0 -0
  19. {pymemoryeditor-1.5.23 → pymemoryeditor-1.6.0}/PyMemoryEditor/linux/ptrace/ptrace.py +0 -0
  20. {pymemoryeditor-1.5.23 → pymemoryeditor-1.6.0}/PyMemoryEditor/linux/types.py +0 -0
  21. {pymemoryeditor-1.5.23 → pymemoryeditor-1.6.0}/PyMemoryEditor/process/__init__.py +0 -0
  22. {pymemoryeditor-1.5.23 → pymemoryeditor-1.6.0}/PyMemoryEditor/process/abstract.py +0 -0
  23. {pymemoryeditor-1.5.23 → pymemoryeditor-1.6.0}/PyMemoryEditor/process/errors.py +0 -0
  24. {pymemoryeditor-1.5.23 → pymemoryeditor-1.6.0}/PyMemoryEditor/process/info.py +0 -0
  25. {pymemoryeditor-1.5.23 → pymemoryeditor-1.6.0}/PyMemoryEditor/process/util.py +0 -0
  26. {pymemoryeditor-1.5.23 → pymemoryeditor-1.6.0}/PyMemoryEditor/sample/application.py +0 -0
  27. {pymemoryeditor-1.5.23 → pymemoryeditor-1.6.0}/PyMemoryEditor/sample/main_application_window.py +0 -0
  28. {pymemoryeditor-1.5.23 → pymemoryeditor-1.6.0}/PyMemoryEditor/sample/open_process_window.py +0 -0
  29. {pymemoryeditor-1.5.23 → pymemoryeditor-1.6.0}/PyMemoryEditor/util/__init__.py +0 -0
  30. {pymemoryeditor-1.5.23 → pymemoryeditor-1.6.0}/PyMemoryEditor/util/convert.py +0 -0
  31. {pymemoryeditor-1.5.23 → pymemoryeditor-1.6.0}/PyMemoryEditor/util/search/abstract.py +0 -0
  32. {pymemoryeditor-1.5.23 → pymemoryeditor-1.6.0}/PyMemoryEditor/util/search/bmh.py +0 -0
  33. {pymemoryeditor-1.5.23 → pymemoryeditor-1.6.0}/PyMemoryEditor/util/search/kmp.py +0 -0
  34. {pymemoryeditor-1.5.23 → pymemoryeditor-1.6.0}/PyMemoryEditor/win32/enums/__init__.py +0 -0
  35. {pymemoryeditor-1.5.23 → pymemoryeditor-1.6.0}/PyMemoryEditor/win32/enums/memory_allocation_states.py +0 -0
  36. {pymemoryeditor-1.5.23 → pymemoryeditor-1.6.0}/PyMemoryEditor/win32/enums/memory_types.py +0 -0
  37. {pymemoryeditor-1.5.23 → pymemoryeditor-1.6.0}/PyMemoryEditor/win32/enums/process_operations.py +0 -0
  38. {pymemoryeditor-1.5.23 → pymemoryeditor-1.6.0}/PyMemoryEditor/win32/enums/standard_access_rights.py +0 -0
  39. {pymemoryeditor-1.5.23 → pymemoryeditor-1.6.0}/PyMemoryEditor/win32/process.py +0 -0
  40. {pymemoryeditor-1.5.23 → pymemoryeditor-1.6.0}/PyMemoryEditor/win32/types.py +0 -0
  41. {pymemoryeditor-1.5.23 → pymemoryeditor-1.6.0}/pyproject.toml +0 -0
  42. {pymemoryeditor-1.5.23 → pymemoryeditor-1.6.0}/requirements.txt +0 -0
  43. {pymemoryeditor-1.5.23 → pymemoryeditor-1.6.0}/tests/conftest.py +0 -0
  44. {pymemoryeditor-1.5.23 → pymemoryeditor-1.6.0}/tests/test_editor.py +0 -0
@@ -0,0 +1 @@
1
+ python 3.11.0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: PyMemoryEditor
3
- Version: 1.5.23
3
+ Version: 1.6.0
4
4
  Summary: Multi-platform library developed with ctypes for reading, writing and searching at process memory, in a simple and friendly way with Python 3.
5
5
  Project-URL: Homepage, https://github.com/JeanExtreme002/PyMemoryEditor
6
6
  Author-email: Jean Loui Bernard Silva de Jesus <jeanextreme002@gmail.com>
@@ -92,8 +92,6 @@ for address in process.search_by_value(int, 4, target_value, scan_type = ScanTyp
92
92
  print("Found address:", address)
93
93
  ```
94
94
 
95
- **Note:** The scan types `EXACT_VALUE` and `NOT_EXACT_VALUE` uses [KMP (Knuth–Morris–Pratt) Algorithm](https://en.wikipedia.org/wiki/Knuth%E2%80%93Morris%E2%80%93Pratt_algorithm), that has completixy O(n + m) — `n` is the size of the memory page and `m` is the value length — to speed up the search process. The other scan types use the [brute force algorithm](https://en.wikipedia.org/wiki/Brute-force_search), which is O(n * m), so the search may be slower depending on the length of the target value.
96
-
97
95
  You can also search for a value within a range:
98
96
  ```py
99
97
  for address in process.search_by_value_between(int, 4, min_value, max_value, ...):
@@ -8,7 +8,7 @@ The package supports Windows and Linux (32-bit and 64-bit).
8
8
  """
9
9
 
10
10
  __author__ = "Jean Loui Bernard Silva de Jesus"
11
- __version__ = "1.5.23"
11
+ __version__ = "1.6.0"
12
12
 
13
13
  from .enums import ScanTypesEnum
14
14
  from .process.errors import ClosedProcess, ProcessIDNotExistsError, ProcessNotFoundError
@@ -21,20 +21,21 @@ def scan_memory_for_exact_value(
21
21
 
22
22
  This method uses an efficient searching algorithm.
23
23
  """
24
- searcher = KMPSearch(target_value, target_value_size)
24
+ data = bytes(memory_region_data)
25
25
  last_index = 0
26
+ found_index = data.find(target_value, 0)
26
27
 
27
- for found_index in searcher.search(memory_region_data, memory_region_data_size):
28
-
28
+ while found_index != -1:
29
29
  # Return the found index if user is searching for an exact value.
30
30
  if comparison is ScanTypesEnum.EXACT_VALUE:
31
31
  yield found_index
32
- continue
33
32
 
34
33
  # Return the interval between last_index and found_address, if user is searching for a different value.
35
- for different_index in range(last_index, found_index):
36
- yield different_index
37
- last_index = found_index + 1
34
+ elif comparison is ScanTypesEnum.NOT_EXACT_VALUE:
35
+ for different_index in range(last_index, found_index):
36
+ yield different_index
37
+ last_index = found_index + 1
38
+ found_index = data.find(target_value, found_index+1)
38
39
 
39
40
  # If user is searching for a different value, return the rest of the addresses that were not found.
40
41
  if comparison is ScanTypesEnum.NOT_EXACT_VALUE:
@@ -57,7 +57,7 @@ class MemoryProtectionsEnum(Enum):
57
57
  PAGE_READWRITE = 0x04
58
58
 
59
59
  # Indicates memory page is readable. (Custom constant)
60
- PAGE_READABLE = PAGE_EXECUTE_READ | PAGE_EXECUTE_READWRITE | PAGE_READWRITE
60
+ PAGE_READABLE = PAGE_EXECUTE_READ | PAGE_EXECUTE_READWRITE | PAGE_READWRITE | PAGE_READONLY
61
61
 
62
62
  # Indicates memory page is readable and writeable. (Custom constant)
63
63
  PAGE_READWRITEABLE = PAGE_EXECUTE_READWRITE | PAGE_READWRITE
@@ -174,7 +174,8 @@ def SearchAddressesByValue(
174
174
 
175
175
  # Only committed, non-shared and readable memory pages.
176
176
  if region["struct"].State != MemoryAllocationStatesEnum.MEM_COMMIT.value: continue
177
- if region["struct"].Type != MemoryTypesEnum.MEM_PRIVATE.value: continue
177
+ if (region["struct"].Type != MemoryTypesEnum.MEM_PRIVATE.value and
178
+ region["struct"].Type != MemoryTypesEnum.MEM_IMAGE.value): continue
178
179
  if region["struct"].Protect & MemoryProtectionsEnum.PAGE_READABLE.value == 0: continue
179
180
 
180
181
  # If writeable_only is True, checks if the memory page is writeable.
@@ -60,8 +60,6 @@ for address in process.search_by_value(int, 4, target_value, scan_type = ScanTyp
60
60
  print("Found address:", address)
61
61
  ```
62
62
 
63
- **Note:** The scan types `EXACT_VALUE` and `NOT_EXACT_VALUE` uses [KMP (Knuth–Morris–Pratt) Algorithm](https://en.wikipedia.org/wiki/Knuth%E2%80%93Morris%E2%80%93Pratt_algorithm), that has completixy O(n + m) — `n` is the size of the memory page and `m` is the value length — to speed up the search process. The other scan types use the [brute force algorithm](https://en.wikipedia.org/wiki/Brute-force_search), which is O(n * m), so the search may be slower depending on the length of the target value.
64
-
65
63
  You can also search for a value within a range:
66
64
  ```py
67
65
  for address in process.search_by_value_between(int, 4, min_value, max_value, ...):
File without changes
File without changes
File without changes