MCPcopy Create free account
hub / github.com/fabioz/PyDev.Debugger / malloc

Method malloc

pydevd_attach_to_process/winappdbg/process.py:2422–2443  ·  view source on GitHub ↗

Allocates memory into the address space of the process. @see: L{free} @type dwSize: int @param dwSize: Number of bytes to allocate. @type lpAddress: int @param lpAddress: (Optional) Desired address for the newly allocated memory.

(self, dwSize, lpAddress=None)

Source from the content-addressed store, hash-verified

2420 # ------------------------------------------------------------------------------
2421
2422 def malloc(self, dwSize, lpAddress=None):
2423 """
2424 Allocates memory into the address space of the process.
2425
2426 @see: L{free}
2427
2428 @type dwSize: int
2429 @param dwSize: Number of bytes to allocate.
2430
2431 @type lpAddress: int
2432 @param lpAddress: (Optional)
2433 Desired address for the newly allocated memory.
2434 This is only a hint, the memory could still be allocated somewhere
2435 else.
2436
2437 @rtype: int
2438 @return: Address of the newly allocated memory.
2439
2440 @raise WindowsError: On error an exception is raised.
2441 """
2442 hProcess = self.get_handle(win32.PROCESS_VM_OPERATION)
2443 return win32.VirtualAllocEx(hProcess, lpAddress, dwSize)
2444
2445 def mprotect(self, lpAddress, dwSize, flNewProtect):
2446 """

Callers 2

inject_codeMethod · 0.95
inject_dllMethod · 0.95

Calls 1

get_handleMethod · 0.95

Tested by

no test coverage detected