Open ghost opened 6 years ago
Actually, RetDec already implements a lot of nifty tricks to produce variables with meaningful names. Some of them are:
i
, j
, k
, ...result
.int c = getchar();
or int pid = getpid()
).fopen(file_path, mode)
).socket(2, 3, 255)
we get
socket(PF_INET, SOCK_RAW, IPPROTO_RAW)
or instead of
flock(fd, 7);
we get
flock(fd, LOCK_SH | LOCK_EX | LOCK_NB);
Of course, there is always room for improvement :-).
See http://www.contrib.andrew.cmu.edu/~apjaffe/smt/decompilation-renaming-2.pdf
Quote from @apjaffe's abstract:
In @apjaffe's paper, they use Hex-Rays Decompiler to generate training dataset and raw decompiled C code, with some effort the solution could be ported to RetDec as well.