PyMemoryEditor 1.1.0__tar.gz → 1.1.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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: PyMemoryEditor
3
- Version: 1.1.0
3
+ Version: 1.1.1
4
4
  Summary: Process memory reader and writer.
5
5
  Home-page: https://github.com/JeanExtreme002/PyMemoryEditor
6
6
  Author: Jean Loui Bernard Silva de Jesus
@@ -6,7 +6,7 @@ reading and writing values in the process memory.
6
6
  """
7
7
 
8
8
  __author__ = "Jean Loui Bernard Silva de Jesus"
9
- __version__ = "1.1.0"
9
+ __version__ = "1.1.1"
10
10
 
11
11
  from .process import Process
12
12
  from .win32.enum import ProcessOperations
@@ -63,7 +63,7 @@ class OpenProcess(object):
63
63
  raise TypeError("You must pass an argument to one of these parameters (window_title, process_name, pid).")
64
64
 
65
65
  # Get the process handle.
66
- self.__process_handle = GetProcessHandle(permission, False, self.__process.pid)
66
+ self.__process_handle = GetProcessHandle(self.__permission.value, False, self.__process.pid)
67
67
 
68
68
  def close(self):
69
69
  """
@@ -84,7 +84,11 @@ class OpenProcess(object):
84
84
  :param pytype: type of the value to be received (str, int or float).
85
85
  :param bufflength: value size in bytes (1, 2, 4, 8).
86
86
  """
87
- if self.__permission not in [PROCESS_ALL_ACCESS, PROCESS_VM_READ]:
87
+ valid_permissions = [
88
+ ProcessOperations.PROCESS_ALL_ACCESS.value,
89
+ ProcessOperations.PROCESS_VM_READ.value
90
+ ]
91
+ if self.__permission.value not in valid_permissions:
88
92
  raise PermissionError("The handle does not have permission to read the process memory.")
89
93
 
90
94
  return win32.functions.ReadProcessMemory(self.__process_handle, address, pytype, bufflength)
@@ -104,7 +108,11 @@ class OpenProcess(object):
104
108
  :param bufflength: value size in bytes (1, 2, 4, 8).
105
109
  :param value: value to be written (str, int or float).
106
110
  """
107
- if self.__permission not in [PROCESS_ALL_ACCESS, PROCESS_VM_OPERATION | PROCESS_VM_WRITE]:
111
+ valid_permissions = [
112
+ ProcessOperations.PROCESS_ALL_ACCESS.value,
113
+ ProcessOperations.PROCESS_VM_OPERATION.value | ProcessOperations.PROCESS_VM_WRITE.value
114
+ ]
115
+ if self.__permission.value not in valid_permissions:
108
116
  raise PermissionError("The handle does not have permission to write to the process memory.")
109
117
 
110
118
  return WriteProcessMemory(self.__process_handle, address, pytype, bufflength, value)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: PyMemoryEditor
3
- Version: 1.1.0
3
+ Version: 1.1.1
4
4
  Summary: Process memory reader and writer.
5
5
  Home-page: https://github.com/JeanExtreme002/PyMemoryEditor
6
6
  Author: Jean Loui Bernard Silva de Jesus
File without changes
File without changes
File without changes
File without changes