ntmemoryapi 2.1.1__tar.gz → 2.1.3__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.3
2
2
  Name: ntmemoryapi
3
- Version: 2.1.1
3
+ Version: 2.1.3
4
4
  Summary: Simple library for Windows to manipulate process virtual memory with stelthy syscall wraps
5
5
  Author: Xenely
6
6
  Requires-Dist: psutil>=7.1.3
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "ntmemoryapi"
3
- version = "2.1.1"
3
+ version = "2.1.3"
4
4
  description = "Simple library for Windows to manipulate process virtual memory with stelthy syscall wraps"
5
5
  authors = [
6
6
  {name = "Xenely"}
@@ -120,7 +120,7 @@ class MODULEENTRY32(ctypes.Structure):
120
120
  def base(self) -> int:
121
121
  """Process module base address."""
122
122
 
123
- return self.mod_base_addr or 0
123
+ return self.mod_base_addr
124
124
 
125
125
  @property
126
126
  def size(self) -> int:
@@ -140,20 +140,20 @@ class MEMORY_BASIC_INFORMATION(ctypes.Structure):
140
140
  ("m_region_size", ctypes.c_size_t),
141
141
  ("m_state", ctypes.c_ulong),
142
142
  ("m_protect", ctypes.c_ulong),
143
- ("m_type", ctypes.c_ulong)
143
+ ("m_type", ctypes.c_ulong),
144
144
  ]
145
145
 
146
146
  @property
147
147
  def base_address(self) -> int:
148
148
  """Memory region base address."""
149
149
 
150
- return self.m_base_address or 0
150
+ return self.m_base_address
151
151
 
152
152
  @property
153
153
  def allocation_base(self) -> int:
154
154
  """Memory region allocation base."""
155
155
 
156
- return self.m_allocation_base or 0
156
+ return self.m_allocation_base
157
157
 
158
158
  @property
159
159
  def allocation_protect(self) -> int:
@@ -200,7 +200,7 @@ class PatternScanBuffer(ctypes.Structure):
200
200
  ("size", ctypes.c_size_t),
201
201
  ]
202
202
 
203
- def read(self) -> list:
203
+ def read(self) -> list[int]:
204
204
  """Read all of the values located at buffer array."""
205
205
 
206
206
  return list((ctypes.c_size_t * self.size).from_address(self.pointer))
@@ -276,7 +276,7 @@ def _get_be_buffer(soure_c_type: typing.Any) -> ctypes.BigEndianStructure:
276
276
 
277
277
  _pack_ = 1
278
278
  _fields_ = [
279
- ("value", soure_c_type)
279
+ ("value", soure_c_type),
280
280
  ]
281
281
 
282
282
  return BigEndianValue
@@ -110,7 +110,7 @@ class DirectSyscallWrapper:
110
110
  B8 %s %s 00 00
111
111
  0F 05
112
112
  C3
113
- """ % tuple([*syscall_id_bytes]))
113
+ """ % tuple(syscall_id_bytes))
114
114
 
115
115
  # Allocate buffer for function machine code
116
116
  if not (shellcode_buffer := _VirtualAlloc(0, len(shellcode), 0x1000 | 0x2000, 0x04)):
File without changes