splat
splat copied to clipboard
Improve C defined function detection / add C declared variable detection
We try to do this, but it clearly has some issues as #11 mentions
Conversely, functions defined in C code but non-matching should be disassembled
- Run cpp on c files to figure out which functions are defined
- Improve detection of defined functions
- Add support for detection of declared (non-externed) variables.
- Mark these symbols as defined so they don't get written to undefined_syms_auto
I don't think detecting defined variables in C code is viable without using pycparser, which is insanely slow. If anyone has other ideas, I'm all ears, but this seems really difficult..
Notes around c function detection:
- This function will not be detected due to
unsigned intbeing 2 tokens, it is fine if the return type is 1 token, e.g.u32.
unsigned long my_function(int foo) {
return 0;
}
- This function will not be detected due to the whitespace between
my_functionand(int foo).
long my_function (int foo) {
return 0;
}
I discovered both of these due to me copying the LIBSPU.H definition for a PSX library function, e.g.
extern unsigned long SpuSetNoiseVoice (long on_off, unsigned long voice_bit);