How does one disassemble Pro*C/C++ programs? [closed] - c++

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 7 years ago.
Improve this question
Is there a way to disassemble Pro*C/C++ executable files?

In general there should be disassemblers available for executables, regardless how they have been created (gcc, proC, handwritten, etc.) but decompiling an optimized binary most probably leads to unreadable or source.
Also, Pro C/C++ is not directly a compiler but outputs C/C++ code which then in turn is compiled by a platform native compiler (gcc, xlc, vc++, etc.).
Furthermore the generated code is often not directly compilable again without lots of manual corrections.
If you still want to try your luck, have a look at this list of x86 disassemblers for a start.

Try PE Explorer Disassembler, a very decent disassembler for 32-bit executable files.

You should try disassembling with disassembler tool of your choice. At the end of the day, executables compiled with PRO C/C++ preprocessor are just plain C/C++ executables.
If what you're looking for is SQL sentences within your code, you might want to take a look at:
$ strings your_executable_file
It will give you a list of all constants strings present in your executable, and chances are that you are going to get SQL sentences with that.
Good luck.

Related

tools for symbolic execution on binaries [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 4 years ago.
Improve this question
are there any tools for symbolic execution on binaries. i mean using which, we do not require to modify the source code - like klee_make_symbolic
or we can do such changes in IR (llvm ir etc.)
thanks in advance
Maybe miasm can fit your requirements. It is a reverse engineer framework that supports static symbolic execution. As far as I know, it is more simple than KLEE and S2E.
Canonical list is in Awesome Symbolic Execution.
Symbolically executing binary code is much much harder, so i doubt there are such tools exist.
However note that you don't necessarily need to modify your code when using KLEE because it can model POSIX environment and C library (when compiled with support for this, of course). Using these features you can automatically symbolize argv arguments and keyboard interaction.

Parser for 32-bit and 64-bit Mach-O binary/executable formats in C++ [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 7 years ago.
Improve this question
I'm looking for a C++ library that can parse 32-bit and 64-bit Mach-O binary format. I don't need anything fancy, just a disassembly and splitting the file into its sections, so no decompilation, name demangling and so on.
I know I can either rip open any existing disassembler or craft my own binary parsers using the format specification from Apple, but I was kind of hoping not having to go that far, especially if someone else has done the work for me.
Many thanks!
You can start with the open-source class-dump tool (http://www.codethecode.com/projects/class-dump/). It can read both 32 and 64 bits Mach-o binaries, and is known to have a decent parser.
Try playing around with the command-line tool otool; it sounds like it does what you want. You could call it from C code with system(), etc.
Try this: MachOView
It is still in developing stage, but hopefully becomes a powerful tool soon.
Get the Darwin (Mac OS X kernel) source code, I guarantee somewhere in there they've got a parser for Mach-O binaries.

What tool can decompile a DLL into C++ source code? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 3 years ago.
Improve this question
I have an old DLL that stopped working (log2vis.dll) and I want to look inside it to see what objects it uses.
The DLL was written in C++ (not .NET). Is there a tool that will decompile/disassemble C++ files?
This might be impossible or at least very hard. The DLL's contents don't depend (a lot) on it being written in C++; it's all machine code. That code might have been optimized so a lot of information that was present in the original source code is simply gone.
That said, here is one article that goes through a lot of material about doing this.
Hex-Rays decompiler is probably the best in this field !!!
I think a C++ DLL is a machine code file. Therefore decompiling will only result in assembler code. If you can read that and create C++ from that you're good to go.
There are no decompilers which I know about.
W32dasm is good Win32 disassembler.
There really isn't any way of doing this as most of the useful information is discarded in the compilation process. However, you may want to take a look at this
site to see if you can find some way of extracting something from the DLL.
The closest you will ever get to doing such thing is a dissasembler, or debug info (Log2Vis.pdb).

C/C++ call-graph utility for Windows platform [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 7 years ago.
Improve this question
I have a large 95% C, 5% C++ Win32 code base that I am trying to grok.
What modern tools are available for generating call-graph diagrams for C or C++ projects?
Have you tried doxygen and codeviz ?
Doxygen is normally used as a documentation tool, but it can generate call graphs for you with the CALL_GRAPH/CALLER_GRAPH options turned on.
Wikipedia lists a bunch of other options that you can try.
Have you tried SourceInsight's call graph feature?
http://www.sourceinsight.com/docs35/ae1144092.htm
Good old cflow works fine for C. See here for an implementation.
Any decent static analysis tool should have this functionality (as well as all the other stuff that such tools do). Wikipedia has a good list of such tools.
Another group of tools that may be worth checking out are coverage tools. The call graph generated by the coverage tool will contain only the calls that actually take place during a run of the program. Initially this may be more helpful to you than a full call graph. I'm unable to make any suggestions on this for Windows, but for linux projects I highly recommend gcov and lcov.

Is there a C++ decompiler? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 6 years ago.
Improve this question
I have a program in which I've lost the C++ source code. Are there any good C++ decompilers out there?
I've already ran across Boomerang.
You can use IDA Pro by Hex-Rays. You will usually not get good C++ out of a binary unless you compiled in debugging information. Prepare to spend a lot of manual labor reversing the code.
If you didn't strip the binaries there is some hope as IDA Pro can produce C-alike code for you to work with. Usually it is very rough though, at least when I used it a couple of years ago.
information is discarded in the compiling process. Even if a decompiler could produce the logical equivalent code with classes and everything (it probably can't), the self-documenting part is gone in optimized release code. No variable names, no routine names, no class names - just addresses.
Yes, but none of them will manage to produce readable enough code to worth the effort. You will spend more time trying to read the decompiled source with assembler blocks inside, than rewriting your old app from scratch.
I haven't seen any decompilers that generate C++ code. I've seen a few experimental ones that make a reasonable attempt at generating C code, but they tended to be dependent on matching the code-generation patterns of a particular compiler (that may have changed, it's been awhile since I last looked into this). Of course any symbolic information will be gone. Google for "decompiler".
Depending on how large and how well-written the original code was, it might be worth starting again in your favourite language (which might still be C++) and learning from any mistakes made in the last version. Didn't someone once say about writing one to throw away?
n.b. Clearly if this is a huge product, then it may not be worth the time.