Skip to content

Commit

Permalink
hilda_client: add module_name to file_symbol
Browse files Browse the repository at this point in the history
  • Loading branch information
doronz88 committed Jan 29, 2024
1 parent 151c963 commit d822b2b
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions hilda/hilda_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -323,12 +323,18 @@ def disass(self, address, buf, flavor='intel', should_print=True) -> lldb.SBInst
print(inst)
return inst

def file_symbol(self, address) -> Symbol:
def file_symbol(self, address: int, module_name: Optional[str] = None) -> Symbol:
"""
Calculate symbol address without ASLR
:param address: address as can be seen originally in Mach-O
:param module_name: Module name to resolve the symbol from
"""
return self.symbol(self.target.ResolveFileAddress(address).GetLoadAddress(self.target))
if module_name is None:
module = self.target
else:
module = self.target.FindModule(lldb.SBFileSpec(module_name))

return self.symbol(module.ResolveFileAddress(address).GetLoadAddress(self.target))

def get_register(self, name) -> Symbol:
"""
Expand Down

0 comments on commit d822b2b

Please sign in to comment.