473,404 Members | 2,213 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,404 software developers and data experts.

Please help me to make source code from exe

Hello,
Can I exe file made in Microsoft Visual C++ decompile into source code.
If it is possibly please tell me how.
Thanks
Jul 22 '05 #1
9 3859


Michael Dekson wrote:
Hello,
Can I exe file made in Microsoft Visual C++ decompile into source code.
If it is possibly please tell me how.


What did MS technical support say?
Jul 22 '05 #2
On Wed, 11 Feb 2004 13:13:19 +0100, Michael Dekson wrote:
Can I exe file made in Microsoft Visual C++ decompile into source code.
If it is possibly please tell me how.


Offtopic here but:

For almost any compiler the answer is no. There could theoretically be a
compiler out there that leaves enough unnessesary data in the executable
to be able to reconstruct the source, but I don't know of any.

What you probably could get out is the assembly. And then maybe that could
be converted to C code that does the same job as the original code, but
I've seen such assembly -> C and it's not pretty, and it doesn't resemble
the original code much.

If it had been possible don't you think a google search would have given
you a ton of utilities to do it. If it had been possible do you think
anyone would even have bothered with copy protection?

--
NPV

"the large print giveth, and the small print taketh away"
Tom Waits - Step right up

Jul 22 '05 #3
Michael Dekson wrote:
Hello,
Can I exe file made in Microsoft Visual C++ decompile into source code.
If it is possibly please tell me how.
Thanks


Here is how to do it:
1. Find the format of the executable file.
Try http://www.wotsit.org
2. Parse the header section of the executable file. Extract
and retain important information.
3. Point to the first instruction data.
4. Read in the instruction data and convert into an assembly
language statement. Display all numeric quantities in hex.
Also, keep track of the addresses. You will need this
information for creating labels for all the loops, function
calls.
5. Output the instruction into a text file.
6. Repeat steps 4 & 5 for all executable bytes in the file.
7. Once the assembly language file is created, parse it looking
for patterns, such as for-loops, while and do-while loops.
Also scan for function prologue (i.e. parameter passing,
local variable allocation) and function epilog.
Once a pattern is found, output it to another text file,
which will be your C source file.

Some notes:
1. Devise some scheme for nameing variables and functions.
2. Recognize the difference between char, int, float and
double representations in memory.
3. Research the operating system. Create a table of
operating system call sequences and their function
names. This will come in handy as you improve your
program to list operating system calls.
4. Along the same lines, research the call sequences for
the C and C++ library routines. You'll need this to
translate the calls to offsets into more readable
function names.
5. The resultant code has a high probability of looking
nothing like your original source code; or an readable
source code.
6. Always test your utility by running your assembly language
output through an assembler and compiling your source
program.
7. Some operating systems have dynamic libraries. Learn how
to recognize the activation of dynamic library functions.
8. Let nobody fool you about turning hamburger back into a
cow. That analogy doesn't apply; as one _can_ convert an
executable into a source file.

This is an excellent project. I personally have other projects
to work on, which is why I'm not doing this.

--
Thomas Matthews

C++ newsgroup welcome message:
http://www.slack.net/~shiva/welcome.txt
C++ Faq: http://www.parashift.com/c++-faq-lite
C Faq: http://www.eskimo.com/~scs/c-faq/top.html
alt.comp.lang.learn.c-c++ faq:
http://www.raos.demon.uk/acllc-c++/faq.html
Other sites:
http://www.josuttis.com -- C++ STL Library book

Jul 22 '05 #4

"Thomas Matthews" <Th****************************@sbcglobal.net> wrote in
message > 8. Let nobody fool you about turning hamburger back into a
cow. That analogy doesn't apply; as one _can_ convert an
executable into a source file.

This is an excellent project. I personally have other projects
to work on, which is why I'm not doing this.


Excellent project? It's a fool's project!

The "source code" you produce will in no way resemble the original source
code. You have no way to know how the original objects were distributed
amonst the various compilation units, what any of the objects were named,
what namespaces were defined, what was statically linked against, etc. Any
number of variations of code might produce a given snippet of assembler.
Especially after optimizations have taken place!

It would probably be easier and quicker to write your own program that
imitated the actions and appearance of the one you're trying to hack. Just
look at all the work involved in what you've described.

What possible use would it be to do all that? To get around
copy-protection? Good luck...some of what you'll try to disassemble will be
encoded and you won't even notice it until you analyze every last bit of the
"source" you've supposedly generated, only to realize that, once run, some
of that source itself would have been decoded into something entirely
different!

Do you want to change the behavior of some program to fit your desires?
Write your own program to do what you want. If you're capable of all the
analysis and work needed to make the "source code" as described in this
post, you're quite capable of writing the whole app yourself.

But of course, it's your time. Try doing what was described on a simple
"Hello world" console app. Or better yet, go a step beyond that and try the
same thing on a "Hello world" Windows app using VC++ and MFC objects and a
dialog resource. Then come back and let us know what your re-created source
looks like. See you in six months...

-Howard

Jul 22 '05 #5
Howard wrote:
"Thomas Matthews" <Th****************************@sbcglobal.net> wrote in
message > 8. Let nobody fool you about turning hamburger back into a
cow. That analogy doesn't apply; as one _can_ convert an
executable into a source file.

This is an excellent project. I personally have other projects
to work on, which is why I'm not doing this.

Excellent project? It's a fool's project!

The "source code" you produce will in no way resemble the original source
code. You have no way to know how the original objects were distributed
amonst the various compilation units, what any of the objects were named,
what namespaces were defined, what was statically linked against, etc. Any
number of variations of code might produce a given snippet of assembler.
Especially after optimizations have taken place!

It would probably be easier and quicker to write your own program that
imitated the actions and appearance of the one you're trying to hack. Just
look at all the work involved in what you've described.

What possible use would it be to do all that? To get around
copy-protection? Good luck...some of what you'll try to disassemble will be
encoded and you won't even notice it until you analyze every last bit of the
"source" you've supposedly generated, only to realize that, once run, some
of that source itself would have been decoded into something entirely
different!

Do you want to change the behavior of some program to fit your desires?
Write your own program to do what you want. If you're capable of all the
analysis and work needed to make the "source code" as described in this
post, you're quite capable of writing the whole app yourself.

But of course, it's your time. Try doing what was described on a simple
"Hello world" console app. Or better yet, go a step beyond that and try the
same thing on a "Hello world" Windows app using VC++ and MFC objects and a
dialog resource. Then come back and let us know what your re-created source
looks like. See you in six months...

-Howard


I agree that this is a huge task, far beyond what the
OP has imagined. I was just answering his/her question.
Perhaps the OP will consider other alternatives, rather
than keep posting the same question.

--
Thomas Matthews

C++ newsgroup welcome message:
http://www.slack.net/~shiva/welcome.txt
C++ Faq: http://www.parashift.com/c++-faq-lite
C Faq: http://www.eskimo.com/~scs/c-faq/top.html
alt.comp.lang.learn.c-c++ faq:
http://www.raos.demon.uk/acllc-c++/faq.html
Other sites:
http://www.josuttis.com -- C++ STL Library book

Jul 22 '05 #6
On Wed, 11 Feb 2004 13:13:19 +0100, "Michael Dekson"
<no****@nospam.com> wrote:
Hello,
Can I exe file made in Microsoft Visual C++ decompile into source code.
If it is possibly please tell me how.
Thanks

See the FAQ:
http://www.fmi.uni-konstanz.de/~kueh....html#faq-37.4

(Look out for line-wrap.)

rossum

--

The Ultimate Truth is that there is no Ultimate Truth
Jul 22 '05 #7
"Howard" <al*****@hotmail.com> wrote in message
news:c0********@dispatch.concentric.net...

"Thomas Matthews" <Th****************************@sbcglobal.net> wrote in
message > 8. Let nobody fool you about turning hamburger back into a
cow. That analogy doesn't apply; as one _can_ convert an
executable into a source file.

This is an excellent project. I personally have other projects
to work on, which is why I'm not doing this.


Excellent project? It's a fool's project!


If attempted by a novice with the objective of reverse engineering,
I agree. But I think it *is* a good intellectual exercise.

-Mike
Jul 22 '05 #8

"Howard" <al*****@hotmail.com> wrote in message
news:c0********@dispatch.concentric.net...

"Thomas Matthews" <Th****************************@sbcglobal.net> wrote in
message > 8. Let nobody fool you about turning hamburger back into a
cow. That analogy doesn't apply; as one _can_ convert an
executable into a source file.

This is an excellent project. I personally have other projects
to work on, which is why I'm not doing this.

Excellent project? It's a fool's project!

The "source code" you produce will in no way resemble the original source
code.


Dude, relax. He said the same thing himself. Nonetheless, he's obviously
put a lot of thought into it and it sounds like a very interesting project
to me to.
What possible use would it be to do all that? To get around
copy-protection?


Who said it has anything to do with getting around copy protection? Some
people just have more active minds than others.
Jul 22 '05 #9
In article <c0**********@ariane.blic.net>,
Michael Dekson <no****@nospam.com> wrote:
Hello,
Can I exe file made in Microsoft Visual C++ decompile into source code.
It is easy to see that you never can have the original source back.
The most important parts, the comment and the informative names
the programmer gave to local variables, are lost. With inlining,
also the division of the work over modules is lost.

If all you want to do is get rid of the wormholes in Internet Explorer:
1. disassemble to machine code
2. fix wormholes
3. reassemble

The 80i86 assembler is much easier to understand than any extremely
contorted C++ code that results from going one step further.

Aka IE, it is much easier to install an alternative program
without the wormholes.
If it is possibly please tell me how.
It would help if you tell us your perspective on this.
Is it one of climbing the Mount Everest, having a good time,
doing home work or ripping off software vendors?
Thanks


Groetjes Albert
--
Albert van der Horst,Oranjestr 8,3511 RA UTRECHT,THE NETHERLANDS
One man-hour to invent,
One man-week to implement,
One lawyer-year to patent.
Jul 22 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

35
by: wired | last post by:
Hi, I've just taught myself C++, so I haven't learnt much about style or the like from any single source, and I'm quite styleless as a result. But at the same time, I really want nice code and I...
3
by: Irfan Akram | last post by:
I keep getting this irritating exception on and on. Please Help. There is already an open DataReader associated with this Connection which must be closed first. Description: An unhandled...
13
by: Nick Coe \(UK\) | last post by:
I'm seriously considering setting up the future development of AccHelp as an open source project on sourceforge. Why? I just don't have the time (for various personal and professional reasons)...
25
by: n3crius | last post by:
hi, i just got a web host with asp.net , seemed really cool. aspx with the c# or vb IN the actual main page run fine, but when i use codebehind and make another source file ( a .cs) to go with...
1
by: Robert | last post by:
Vb.Net Make dll that contain one function. Help Please. I would like to call a function from different applications. I think i have to make a dll. I have Visual Basic.net 2003 Standard...
1
by: David Van D | last post by:
Hi there, A few weeks until I begin my journey towards a degree in Computer Science at Canterbury University in New Zealand, Anyway the course tutors are going to be teaching us JAVA wth bluej...
34
by: Ann | last post by:
I am opening a file which looks like 0xABCDEF01 on another machine but 0x01EFCDAB on my machine. Is this a byte swapping? Could anyone give a good way to check if bytes are being swapped?...
9
by: OWeb | last post by:
Javascript and recursing subfolders assistance ------------------------- I have this script that is a free extra download from SlideShowPro. It's a great script but I feel it needs to be...
2
by: ValValVal | last post by:
Hi. I have an application consisting of some JFrames and threads ,and other classes as well. I developed it as ordinary application, having in mind to re-make it to be applet. I have launching...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.