Add type parameter for WinProcess.virtual_alloc

This commit is contained in:
hakril
2025-05-15 09:27:45 +02:00
parent 1481e9cd46
commit 7446517863
+2 -2
View File
@@ -1106,13 +1106,13 @@ class WinProcess(Process):
pass
return urepr_encode(u'<{0} "{1}" pid {2} at {3}>'.format(self.__class__.__name__, exe_name, self.pid, hex(id(self))))
def virtual_alloc(self, size, prot=PAGE_EXECUTE_READWRITE, addr=None):
def virtual_alloc(self, size, prot=PAGE_EXECUTE_READWRITE, addr=None, type=gdef.MEM_COMMIT):
"""Allocate memory in the process
:return: The address of the allocated memory
:rtype: :class:`int`
"""
return winproxy.VirtualAllocEx(self.handle, lpAddress=addr, dwSize=size, flProtect=prot)
return winproxy.VirtualAllocEx(self.handle, lpAddress=addr, dwSize=size, flAllocationType=type, flProtect=prot)
def virtual_free(self, addr):
"""Free memory in the process by virtual_alloc"""