binsync / libbs

A library for writing plugins in any decompiler: includes API lifting, common data formatting, and GUI abstraction!
BSD 2-Clause "Simplified" License
63 stars 4 forks source link

Add a CI for Binja #83

Closed mahaloz closed 3 months ago

mahaloz commented 3 months ago

Add a CI for Binja!

mahaloz commented 3 months ago

Wacky bug discovered while getting Binja headless to work: Given a bn_func, which is just a Binary Ninja function:

print(bn_func) # <func: x86_64@0x820>
params = list(bn_func.parameter_vars)
bad_param = params[2]
print(bad_param) # <var void (* arg3)()>
type_str = bad_param.type.get_string_before_name()
print(type_str) # 'void (*'

Basically, get_string_before_name() is returning the wrong value. On <var void (* arg3)()> it should return void * or void (*), instead it returns a broken void (*, or maybe this is just a misuse on my part.

psifertex commented 3 months ago

FYI, this is expected for that API and type. Alternatives include:

str(bv.entry_function.parameter_vars[2].type)
# or 
bv.entry_function.parameter_vars[2].type.get_string_before_name() + bv.entry_function.parameter_vars[2].type.get_string_after_name()