Skip to content

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

Description

@pdreiter

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 git@github.com: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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions