0

I'd like to know if there's any way to generate the C code of a x86 PE binary. I don't really need this, I just want to learn how some closed-source software are working.

From my common sense, I think the process is:

  • Converting the x86 binary to Assembly, which can be done with a disassembler like OllyDbg.
  • Converting this Assembly to C. I don't know any tools for that, any that's my question actually.
General Grievance
  • 4,555
  • 31
  • 31
  • 45
Alon Gubkin
  • 56,458
  • 54
  • 195
  • 288
  • The legality of this depends a lot on what exactly you want to do, where you live and what license/contract you signed when you got the exe. In some places reverse-engineering for interoperability is legal, in others reverse-engineering is never legal (no, I'm not a Lawyer). – Joachim Sauer Jan 25 '10 at 13:33
  • It's hard to reverse assembly to HLL, especially after compiler optimisations. http://stackoverflow.com/questions/193896/whats-a-good-c-decompiler – Cat Plus Plus Jan 25 '10 at 13:35

1 Answers1

2

If you use IDA Pro with the HexRay decompiler you can get a somewhat readable C source code. (But prepare for a bunch of goto-s and unnecessary variables).

kennytm
  • 510,854
  • 105
  • 1,084
  • 1,005