MCPcopy Create free account
hub / github.com/ELMERIKH/PyinMemoryPE / virtual_alloc

Method virtual_alloc

windows/winobject/process.py:1046–1052  ·  view source on GitHub ↗

Allocate memory in the process :return: The address of the allocated memory :rtype: :class:`int`

(self, size, prot=PAGE_EXECUTE_READWRITE, addr=None)

Source from the content-addressed store, hash-verified

1044 return '<{0} "{1}" pid {2} at {3}>'.format(self.__class__.__name__, exe_name, self.pid, hex(id(self)))
1045
1046 def virtual_alloc(self, size, prot=PAGE_EXECUTE_READWRITE, addr=None):
1047 """Allocate memory in the process
1048
1049 :return: The address of the allocated memory
1050 :rtype: :class:`int`
1051 """
1052 return winproxy.VirtualAllocEx(self.handle, lpAddress=addr, dwSize=size, flProtect=prot)
1053
1054 def virtual_free(self, addr):
1055 """Free memory in the process by virtual_alloc"""

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected