From 758154d8881f2653cf4a5f7d4c7dee64f08ffe2e Mon Sep 17 00:00:00 2001 From: NishTheFish <57572411+NishTheFish-dev@users.noreply.github.com> Date: Tue, 17 Mar 2026 17:51:03 -0700 Subject: [PATCH] Added bs_func to Decompilation class --- libbs/artifacts/decompilation.py | 3 +++ libbs/decompilers/ida/hooks.py | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/libbs/artifacts/decompilation.py b/libbs/artifacts/decompilation.py index fef3f817..88d1e1ca 100644 --- a/libbs/artifacts/decompilation.py +++ b/libbs/artifacts/decompilation.py @@ -9,6 +9,7 @@ class Decompilation(Artifact): "text", "line_map", "decompiler", + "bs_func", ) def __init__( @@ -17,6 +18,7 @@ def __init__( text: str = None, line_map: dict = None, decompiler: str = None, + bs_func = None, **kwargs ): super().__init__(**kwargs) @@ -24,6 +26,7 @@ def __init__( 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}" diff --git a/libbs/decompilers/ida/hooks.py b/libbs/decompilers/ida/hooks.py index cca96b07..af409643 100644 --- a/libbs/decompilers/ida/hooks.py +++ b/libbs/decompilers/ida/hooks.py @@ -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)