Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[type reconstruction] some type re-ordering issues #6

Open
pdreiter opened this issue Mar 26, 2022 · 0 comments
Open

[type reconstruction] some type re-ordering issues #6

pdreiter opened this issue Mar 26, 2022 · 0 comments
Assignees

Comments

@pdreiter
Copy link
Collaborator

pdreiter commented Mar 26, 2022

Seeing some incomplete type on recompilation, e.g.:

mjs_recomp.c:202:99: error: field ‘sig’ has incomplete type
 typedef struct mjs_ffi_cb_args{  struct mjs_ffi_cb_args *next;  struct mjs *mjs;  struct mjs_ffi_sig sig;  ulong_t func;  ulong_t userdata;} mjs_ffi_cb_args;
                                                                                                   ^~~
mjs_recomp.c:214:133: error: field ‘u’ has incomplete type
 typedef struct json_out{  int (*printer)(struct json_out *, const char *, size_t);  union json_out___A1907A2A5AD0AD422285F2D4DADB62AC u;} json_out;

Binary Duplication steps:

  1. git clone [email protected]:pdreiter/mjs.git
  2. cd mjs; make; cd ..
  3. echo "mjs,mjs/build/mjs,mjs_get_cstring" >> target_list.0
  4. python3 <PATH>/prd_multidecomp_ida.py --target_list target_list.0 --ouput_directory mjs_decomp --scriptpath <PATH>/get_ida_details.py

Recompile by :

  1. cd mjs_decomp/mjs
  2. wget -O Makefile.prd https://raw.githubusercontent.com/pdreiter/FuncRepair/master/tools/templates/Makefile.prd?token=GHSAT0AAAAAABNYWLLCU3LPWTC372UKWU4QYSIT27A
  3. make -f Makefile.prd hook

I think reconstruction may be complicated due to function pointer types.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant