I am thinking on a decompilation method which uses the runtime behavior of the binary executable to extract usable compilation data. Analysing the runtime behavior (i.e. trapping after every cpu instruction and check what it does), we could get a lot of additional infos, like:
- we could differentiate between the static constant data ("
.text
") and the binary asm - additional information, what type of data is in which register or global / local variable (pointers, floats and integers)
- where the cpu instructions are starting
- from the stack behavior we could get highly useful heuristics, where are the functions / internal functions and how long / what type of parameters they have.
On my opinion, maybe even the holy grail, the recompilable source code wouldn't be so far away.
Is it possible? Does any tool / software already exist which is capable to do this?