From 744651786349ffe0789090f28e843981f5228874 Mon Sep 17 00:00:00 2001 From: hakril Date: Thu, 15 May 2025 09:27:45 +0200 Subject: [PATCH] Add type parameter for WinProcess.virtual_alloc --- windows/winobject/process.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/windows/winobject/process.py b/windows/winobject/process.py index c74f0b2..cc7e67d 100644 --- a/windows/winobject/process.py +++ b/windows/winobject/process.py @@ -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"""