Shoutbox

assembly conversion - Printable Version

-Shoutbox (https://shoutbox.menthix.net)
+-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58)
+--- Forum: Skype & Technology (/forumdisplay.php?fid=9)
+---- Forum: Tech Talk (/forumdisplay.php?fid=17)
+----- Thread: assembly conversion (/showthread.php?tid=93527)

assembly conversion by MX-G on 01-13-2010 at 09:43 PM

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


RE: assembly conversion by andrey on 01-13-2010 at 10:46 PM

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..


RE: assembly conversion by MX-G on 01-13-2010 at 11:33 PM

thanks ;)


RE: assembly conversion by Adeptus on 01-15-2010 at 04:35 AM

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.


RE: assembly conversion by tony on 01-15-2010 at 04:50 AM

Do your own homework you lazy bum ;)

Oh, and why don't you just post the code :P?


RE: assembly conversion by MX-G on 01-15-2010 at 04:18 PM

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.


RE: assembly conversion by andrey on 01-15-2010 at 04:36 PM

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.


RE: assembly conversion by MX-G on 01-15-2010 at 08:36 PM

thanks for the information :P, 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


RE: assembly conversion by Adeptus on 01-16-2010 at 03:10 AM

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. 


RE: assembly conversion by MX-G on 01-16-2010 at 04:54 PM

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(Y)

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 ;)