krf
krf copied to clipboard
Investigate cparser for improving codegen
Right now, the codegen specs (e.g. read.yml) include hardcoded proto and parm fields that correspond to the prototype and parameter list for each syscall. This is confusing, hard to read, and error prone. We should really use something like pag's cparser to parse syscall.h and generate these fields for us.
Are we missing sth from the list?
idk if that is helpful, but pwndbg can show args for syscalls, e.g.:
I didn't dig down deep, but I think those argnames might come from functions.py file in the repo which is generated via https://github.com/zachriggle/functions
Also note that gef can also do that as long as you install the extra module. The syscall tables from it can be found in https://github.com/hugsy/gef-extras/tree/master/syscall-tables
Didn't know about functions.py or gef's extras! Looks like the latter is what we want, since it includes the slot numbers and all of the additional parameter attributes.