krf icon indicating copy to clipboard operation
krf copied to clipboard

Investigate cparser for improving codegen

Open woodruffw opened this issue 6 years ago • 3 comments

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.

woodruffw avatar Apr 02 '19 02:04 woodruffw

Are we missing sth from the list?

idk if that is helpful, but pwndbg can show args for syscalls, e.g.: image image 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

disconnect3d avatar Apr 04 '19 00:04 disconnect3d

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

disconnect3d avatar Apr 04 '19 00:04 disconnect3d

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.

woodruffw avatar Apr 04 '19 01:04 woodruffw