assembly conversion |
Author: |
Message: |
MX-G
Full Member
Posts: 303 Reputation: 22
35 / /
Joined: Jun 2006
|
O.P. assembly conversion
Does anyone knows how to convert an assembly code to C or C++ or any other language??
I used HxD to get assembly code, but I cannot find any app to convert it to C code :/
thanks
|
|
01-13-2010 09:43 PM |
|
|
andrey
elite shoutboxer
Posts: 795 Reputation: 48
– / /
Joined: Aug 2004
|
RE: assembly conversion
Hex-Rays Decompiler would be the only program that comes to my mind atm.. Although I doubt you know what you're doing, since hex code isn't assembly code.
Anyway, decompiler is what you would look for. Notice the 'legality' section..
|
|
01-13-2010 10:46 PM |
|
|
MX-G
Full Member
Posts: 303 Reputation: 22
35 / /
Joined: Jun 2006
|
O.P. RE: assembly conversion
thanks
|
|
01-13-2010 11:33 PM |
|
|
Adeptus
Senior Member
Posts: 732 Reputation: 40
Joined: Oct 2005
|
RE: assembly conversion
You are best off getting somebody who knows assembly for the respective kind of platform interpret it for you -- if it is a small piece of code.
Automated conversion from assembly to higher level languages isn't likely to result in anything good.
|
|
01-15-2010 04:35 AM |
|
|
tony
Senior Member
Posts: 976 Reputation: 54
36 / /
Joined: Jul 2004
|
RE: assembly conversion
Do your own homework you lazy bum
Oh, and why don't you just post the code ?
This post was edited on 01-15-2010 at 04:51 AM by tony.
|
|
01-15-2010 04:50 AM |
|
|
MX-G
Full Member
Posts: 303 Reputation: 22
35 / /
Joined: Jun 2006
|
O.P. RE: assembly conversion
it's assembly code xD, it's to long!
I'm attempting to understand how to get high level code from an .exe or any other kind of application.
|
|
01-15-2010 04:18 PM |
|
|
andrey
elite shoutboxer
Posts: 795 Reputation: 48
– / /
Joined: Aug 2004
|
RE: assembly conversion
once C code (or code in any other higher level language) is compiled, information about the original code is lost and you can't easily reconstruct the original code. at least that's for languages like C, chances of getting useful output are higher when decompiling java class files or similar. so the nearest you'll probably get when decompiling an exe file is a higher level pseudo code which you'll have to figure out yourself. plus, if you're trying to decompile a regular (proprietary) binary, you'd probably have to get around obfuscation and encryption first.
This post was edited on 01-15-2010 at 04:40 PM by andrey.
|
|
01-15-2010 04:36 PM |
|
|
MX-G
Full Member
Posts: 303 Reputation: 22
35 / /
Joined: Jun 2006
|
O.P. RE: assembly conversion
thanks for the information , I know that after I compile an app the original high level code is gone, but it's possible to make something similar to a high level code, that couldn't be impossible I think
This post was edited on 01-15-2010 at 08:37 PM by MX-G.
|
|
01-15-2010 08:36 PM |
|
|
Adeptus
Senior Member
Posts: 732 Reputation: 40
Joined: Oct 2005
|
RE: assembly conversion
It is relatively easy for someone who understands assembly to look at the disassembler output and figure out what a code portion of special interest does, such as an encryption algorithm or controlling a proprietary piece of hardware. They can then rewrite it in C or whatever. The hardest part usually is finding the code you are looking for.
I stress "code of special interest." Doing this for an entire application isn't practical. 90% or more of any application is code that performs tedious simple tasks, like display windows and menus. That is much faster to code from scratch than it is to reverse engineer.
I have seen and experimented with various "decompilers". The problem is compiling to native code, especially with a good optimizing compiler, is a one way process. When reduced to optimized machine code, there is no difference between, say, switch and case vs. many nested if statements, or between different kinds of loops. They are interchangeable and exist to make code more readable. The decompiler can't tell what it originally was.
It is even difficult to distinguish what once was object oriented code using classes, from procedural code passing around pointers to structs (which is basically how classes work behind the scenes). For statically linked code, it can be tough to tell where the program's code ends and standard library/framework code begins. The decompiler may just decompile it all equally. Of course, there are no comments or any of the original variable and function names.
The result is basically garbage and you would be better off just looking at the disassembler output. Humans (at least those who should be doing this kind of thing) are a lot more intelligent than any decompiler.
On the contrary, .NET code can be decompiled to pretty much what it started out as, thanks to its use of the intermediate byte-code and its self-documenting features. I'd expect the same to be true for Java and anything else using intermediate code.
People might be able to help you better if you tell us what exactly is behind your questions and what you want to accomplish.
|
|
01-16-2010 03:10 AM |
|
|
MX-G
Full Member
Posts: 303 Reputation: 22
35 / /
Joined: Jun 2006
|
O.P. RE: assembly conversion
Ok, you solve me many questions and gave me others hehehe, I know we can't talk about modifying apps in this forum, so I'll search more information about this topic in other forums
thanks for all the replies
PG: for those that are thinking that what I'm trying to do is stupid and I'm just a kiddie, don't think that, I'm studying computer systems so I need to know this in a closer future to graduate, everyday you can learn one more thing than yesterday
This post was edited on 01-16-2010 at 05:06 PM by MX-G.
|
|
01-16-2010 04:54 PM |
|
|
|