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

Method get_memory_breakpoint_at

windows/debug/debugger.py:960–979  ·  view source on GitHub ↗

Get the memory breakpoint that handle ``addr`` Return values are: * ``False`` if the page has no memory breakpoint (real fault) * ``None`` if the page as memBP but None handle ``addr`` * ``bp`` the MemBP that handle ``addr``

(self, addr, process=None)

Source from the content-addressed store, hash-verified

958
959 ## Memory Breakpoint helper
960 def get_memory_breakpoint_at(self, addr, process=None):
961 """Get the memory breakpoint that handle ``addr``
962
963 Return values are:
964
965 * ``False`` if the page has no memory breakpoint (real fault)
966 * ``None`` if the page as memBP but None handle ``addr``
967 * ``bp`` the MemBP that handle ``addr``
968 """
969 if process is None:
970 process = self.current_process
971
972 fault_page = (addr >> 12) << 12
973 if fault_page not in self._watched_pages[process.pid]:
974 return False
975
976 for bp in self._watched_pages[process.pid][fault_page].bps:
977 if bp._addr <= addr < bp._addr + bp.size:
978 return bp
979 return None
980
981 def disable_all_memory_breakpoints(self, target=None):
982 """Restore all pages to their original access rights.

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected