dewolf
dewolf copied to clipboard
[Types] Create function pointer type
Proposal
Add support to function pointers.
If a variable is called at some point, the type of it could be set to a function pointer.
Consider the following example:
$ python decompile.py extractme main
...
int var_0;
...
memcpy(var_0, 0x804c020, 71);
var_0();
var_0 = 0;
...
here, since the var_0
is being called after initialization, we can set its type to function pointer instead of integer.
extractme.zip
Approach
- add new type
FunctionPointer
with the following fields- name
- return type
- parameter / argument types
- update
TypePropagation
to consider variables that are being called. - update
CodeGenerator
to generate declarations for the corresponding function pointers if needed.
/cib
Branch issue-45-_Types_Create_function_pointer_type created!