Seconding Hex-rays, but if you can't justify that cost, Boomerang might work.

Answer from Serafina Brocious on Stack Overflow
๐ŸŒ
Dogbolt
dogbolt.org
Decompiler Explorer
Decompiler Explorer is an interactive online decompiler which shows equivalent C-like output of decompiled programs from many popular decompilers.
๐ŸŒ
Binary Ninja
binary.ninja
Binary Ninja
Disassemble and decompile code to C or BNIL for any supported architectureโ€”including your own.
๐ŸŒ
Dogbolt
dogbolt.org โ€บ faq
Decompiler Explorer - Frequently Asked Questions
Decompiler Explorer is an interactive online decompiler which shows equivalent C-like output of decompiled programs from many popular decompilers.
๐ŸŒ
C Language
c-language.org โ€บ tools
C language: Tools
An interactive online decompiler that shows equivalent C-like output of decompiled programs from many popular decompilers.
๐ŸŒ
Uxwing
bushart.org โ€บ jonas bushart's blog โ€บ resources โ€บ dogbolt decompiler explorer
Dogbolt Decompiler Explorer | Jonas Bushart
Dogbolt is an online interactive decompiler explorer. A binary can be uploaded and the decompiled C-like output of multiple decompilers compared. The website collects all uploaded binaries, so be wary of which files to upload. The big advantage of the website is having so many available decompilers ...
๐ŸŒ
CodeConvert AI
codeconvert.ai โ€บ assembly-to-c-converter
Online Assembly to C Converter
Instantly convert Assembly to C code with AI. Free, fast, and accurate code translation.
๐ŸŒ
Compiler Explorer
godbolt.org
Compiler Explorer
Compiler Explorer is an interactive online compiler which shows the assembly output of compiled C++, Rust, Go (and many more) code.
Find elsewhere
๐ŸŒ
GitHub
github.com โ€บ avast โ€บ retdec
GitHub - avast/retdec: RetDec is a retargetable machine-code decompiler based on LLVM.
After installing RetDec, install Microsoft Visual C++ Redistributable for Visual Studio 2017. ... For more information, run retdec-decompiler.exe with --help.
Starred by 8.4K users
Forked by 981 users
Languages ย  C++ 74.0% | YARA 23.5% | Python 1.5% | CMake 0.7% | C 0.2% | Shell 0.1%
๐ŸŒ
SourceForge
sourceforge.net โ€บ projects โ€บ universal-c-decompiler
Universal-C-Decompiler download | SourceForge.net
IDC is an interactive decompiler, where the user starts with an almost literal translation of Assembly code in C language, which he progressively decompiles by the successive application of low-level refactorings, ultimately leading to high-level C code.
๐ŸŒ
PureBasic
purebasic.fr โ€บ home โ€บ board index โ€บ miscellaneous โ€บ off topic
Universal C Decompiler (Open Source) - PureBasic Forums - English
Just found this from a Reddit post -> https://mohamadhanijanaty85.itch.io/cdecompiler I thought it might work on PureBasic exe made with the C compiler, but that's not supported. ... It seems like this decompiler is only useful for 32 bit executables which are quite rare nowadays.
๐ŸŒ
Redgate Software
red-gate.com โ€บ products โ€บ reflector
Red-gate
Decompile, browse, and analyze any .NET assembly to C#, VB.NET, or IL.
๐ŸŒ
Dll-decompiler
dll-decompiler.com โ€บ dll2c.html
DLL to C, dll2c
Key features Convert DLL or EXE ... Disassemble with Complete Mode Disassemble with Complete Structure Mode Disassemble with Comment Mode Disassemble with Precise Mode Decompile assembly code to C/C++ code with fast speed Initialize Import Address Table with dynamic mode ...
๐ŸŒ
Quora
quora.com โ€บ Are-there-any-good-tool-to-decompile-an-executable-file-back-into-C-source-code
Are there any good tool to decompile an executable file back into C source code? - Quora
Answer (1 of 4): This is kind of tricky, because technically the answer is โ€œnoโ€, butโ€ฆ You will not get your exact C source back (or the source from any other compiled language), but you can get pseudo C source code that is functionally similar to the original.
๐ŸŒ
Cplusplus
cplusplus.com โ€บ forum โ€บ windows โ€บ 273531
DLL and EXE files decompiled - C++ Forum
Hi everybody, It is quite easy to decompile .DLL and .EXE files written with C# (dotPeek, ILSpy, or even online: http://www.decompiler.com/ ).
๐ŸŒ
Reddit
reddit.com โ€บ r/reverseengineering โ€บ introducing decompiler explorer
r/ReverseEngineering on Reddit: Introducing Decompiler Explorer
July 13, 2022 - Ilfak was super supportive, it was his tweet that made me consider working with Matt to release something based on his work and our internal version in the first place. Continue this thread ... It's basically the opposite of https://godbolt.org/ -- put in binary, get out decompilation amongst many decompilers.
๐ŸŒ
GitHub
github.com โ€บ wwwg โ€บ wasmdec
GitHub - wwwg/wasmdec: WebAssembly to C decompiler
wasmdec is a program that converts WebAssembly binaries to C. An online real-time WebAssembly decompiler utilizing wasmdec is avalible here
Starred by 422 users
Forked by 31 users
Languages ย  C++ 59.6% | C 19.7% | WebAssembly 14.3% | Makefile 3.0% | Shell 1.8% | JavaScript 1.6%
๐ŸŒ
Backerstreet
backerstreet.com โ€บ decompiler โ€บ decompilers.htm
Reverse Engineering Resources
Boomerang: open source C decompiler. Very advanced set of analyses that attempt to solve the most difficult problems facing decompilers. The generated code quality varies greatly: some functions are almost perfect in their representation of code structure, local variables and types.
Top answer
1 of 3
47

So you had a cow, but you inadvertently converted it to hamburger, and now you want your cow back.

Sorry, it just doesn't work that way.

Simply restore the source file from your backups.

Ah, you didn't have backups. Unfortunately, the universe doens't give you a break for that.

You can decompile the binary. That won't give you your source code, but it'll give you some source code with the same behavior. You won't get the variable names unless it was a debug binary. You won't get the exact same logic unless you compiled without optimizations. Obviously, you won't get comments.

I've used Boomerang to decompile some programs, and the result was more readable than the machine code. I don't know if it's the best tool out there. Anyway, don't expect miracles.

2 of 3
8

Several tools are common in reverse engineering an executable.

  1. The command "file" which takes the file path as the first parameter so you can determine (in most cases) what type of executable you have.
  2. Disassemblers which show EXACTLY what the executable does but is difficult to read for those that don't write assembly code on that specific architecture or have experience with disassembly.
  3. Decompilers like Boomerang, Hex-rays, and Snowman can provide some greater readability but they do not recover the actual variable names or syntax of the original program and they are not 100% reliable, especially in cases where the engineers that created the executable tested with these packages and tried to obfuscate the security further.
  4. Data flow diagrams or tables. I know of no free tool to do this automatically, but a Python or Bash script over the top of a text parser of the assembly output (which can be written in sed or Perl) can be helpful.
  5. Pencil and paper, believe it or not, for jotting flows and ideas.

In most cases I've seen, the code needed to be rewritten from scratch, maintained as an assembly language program, or reconstituted by re-applying change requests to an older version.

๐ŸŒ
JetBrains
jetbrains.com โ€บ decompiler
dotPeek: Free .NET Decompiler & Assembly Browser by JetBrains
May 26, 2021 - dotPeek is a free tool based on ReSharper. It can reliably decompile any .NET assembly into C# or IL code.