Added MMU.get_bin_containing

This commit is contained in:
Anton Lydike 2021-04-24 18:23:12 +02:00
parent ff5ba9a7ef
commit f45a37e705

View File

@ -127,6 +127,12 @@ class MMU:
return sec
return None
def get_bin_containing(self, addr: int) -> Optional[LoadedExecutable]:
for exe in self.binaries:
if exe.base_addr <= addr < exe.base_addr + exe.size:
return exe
return None
def read_ins(self, addr: int) -> LoadedInstruction:
"""
Read a single instruction located at addr