Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions libbs/artifacts/decompilation.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ class Decompilation(Artifact):
"text",
"line_map",
"decompiler",
"bs_func",
)

def __init__(
Expand All @@ -17,13 +18,15 @@ def __init__(
text: str = None,
line_map: dict = None,
decompiler: str = None,
bs_func = None,
**kwargs
):
super().__init__(**kwargs)
self.addr = addr
self.text = text
self.line_map = line_map or {}
self.decompiler = decompiler
self.bs_func = bs_func

def __str__(self):
return f"//ADDR: {hex(self.addr)}\n// SOURCE: {self.decompiler}\n{self.text}"
Expand Down
3 changes: 2 additions & 1 deletion libbs/decompilers/ida/hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -552,7 +552,8 @@ def _send_decompilation_event(self, cfunc):
dec = Decompilation(
addr=cfunc.entry_ea,
text=str(cfunc),
decompiler="ida"
decompiler="ida",
bs_func=function
)
self.interface.decompilation_changed(dec, function=function, func_addr=lifted_addr)

Expand Down
Loading