Click here to Skip to main content
15,885,985 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I wonder is there any way to convert a BIN file into a code? I really need to see the source code of the example program of my college work, and it is made inside a BIN file.

What I have tried:

Searching over Google and Youtube to find the way of converting BIN file into C code.
Posted
Updated 15-Jun-22 7:52am
Comments
Richard MacCutchan 15-Jun-22 12:18pm    
Simple answer: no.
However there are tools that can sometimes recreate source from object code, but it depends what programming language was used in the first place.

See convert object code to C source - Google Search[^] for some possibilities.
 
Share this answer
 
Probably the best you can do is to disassemble the object code. Not that that's going to help you much as this will return Assembler codes, and not C language (or any other High Level Language). Depending on the optimization level, there may be very little resemblance between the assembler code and the original C code. That's because during optimization the compiler might eliminate unneeded variables, unroll loops, re-order code, and whole host of other things to make the code more efficient. If the object code has been also stripped of debug symbols, then there's very little to go on to help work out what an area (e.g. a struct) might be used for.
 
Share this answer
 
You better invest your time in some Learn C tutorial instead of try to cheat.
This "reverse engineering" isnt so easy because it may not work or the resulting code is bizarre. Functions may have names like "func1" and so on.
So you may end in a mess after a bunch of hours. In this time may have solved your task after learning some basics.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900