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

Method read

pydevd_attach_to_process/winappdbg/process.py:1543–1566  ·  view source on GitHub ↗

Reads from the memory of the process. @see: L{peek} @type lpBaseAddress: int @param lpBaseAddress: Memory address to begin reading. @type nSize: int @param nSize: Number of bytes to read. @rtype: str @return: Bytes read from the

(self, lpBaseAddress, nSize)

Source from the content-addressed store, hash-verified

1541 # XXX TODO
1542 # + Maybe change page permissions before trying to read?
1543 def read(self, lpBaseAddress, nSize):
1544 """
1545 Reads from the memory of the process.
1546
1547 @see: L{peek}
1548
1549 @type lpBaseAddress: int
1550 @param lpBaseAddress: Memory address to begin reading.
1551
1552 @type nSize: int
1553 @param nSize: Number of bytes to read.
1554
1555 @rtype: str
1556 @return: Bytes read from the process memory.
1557
1558 @raise WindowsError: On error an exception is raised.
1559 """
1560 hProcess = self.get_handle(win32.PROCESS_VM_READ | win32.PROCESS_QUERY_INFORMATION)
1561 if not self.is_buffer(lpBaseAddress, nSize):
1562 raise ctypes.WinError(win32.ERROR_INVALID_ADDRESS)
1563 data = win32.ReadProcessMemory(hProcess, lpBaseAddress, nSize)
1564 if len(data) != nSize:
1565 raise ctypes.WinError()
1566 return data
1567
1568 def write(self, lpBaseAddress, lpBuffer):
1569 """

Callers 7

disassembleMethod · 0.95
disassemble_aroundMethod · 0.95
__read_c_typeMethod · 0.95
read_charMethod · 0.95
read_structureMethod · 0.95
read_stringMethod · 0.95
iter_memory_snapshotMethod · 0.95

Calls 2

get_handleMethod · 0.95
is_bufferMethod · 0.95

Tested by

no test coverage detected