Closed mari-mari closed 10 months ago
FYI @martinclauss
Type is correct, the problem is how the code generator handles string generation.
In your case you would have a variable with a type Pointer(FunctionTypeDef)
which is used for function pointers with a string representation of void() *
.
The code generator will use the type and the name to generate a string, like this: f"{var.type} {var.name}
which will result in void() * name
.
Because the type does not know the name of the variable in which it's used in, the f string does not work.
After looking a bit more into the code:
__str__
representation of Variable
for the code generator, like it's done for types, but that is not possible anymoreWasn't there a suggestion to rewrite the backend?
/cib
Branch issue-322-Adjust_code_generation_for_the_function_pointer_type created!
Proposal
Binary Ninja knows that
arg3
is a function pointer, and correctly types it in the signature of_start
:I think we get this information but produce incorrect signature (
void()
):Approach
Correct typing of the function pointers in the function arguments. Without digging into the code, I assume it is just the issue with the way we generate code for the function pointer types.
If this is not the case, we should examine how we lift the function pointer type (and change the title of the issue).