[ASM / C++] Converting ASM to C++

Experienced Elementalist
Joined
Mar 9, 2007
Messages
210
Reaction score
2
I know this seems retarded, but I've been surfing the web, please move this as you feel appropriate or delete it if it's just bad but I gotta know

1. I'm curious to know if theres such a program that will allow you to translate the ASM into C++, or if it has to be done manually because of the fact that it's two different languages. I saw a program that had translated ASM into C, so I was wondering if C++ would possibly work the same way.


2. I also need to know what program I may be able to get to help me with my ASM to C++ troubles such as a decompiler ect.. if anyone has come across it when surfing the web

thank you
 
Re: please answer my question

Decompilers from binary are experimental at best. I've heard some do pretty well in decompiling certain programs, but most executables can only be interpreted in small bits so far. It's even been said there might exist algorithms that are impossible to ever be decompiled by machine alone.

I tried looking for decompilers aswell at some point to aid in debugging, but didn't find anything useful enough so I just kept going in ASM. If you happen to find something even remotely handy, though, let us know.
 
Re: please answer my question

Generally people want to decompile something back to its code so they can change a few things and make it look like their own.
If you want the code ask the person who made it if they can send you it, most likely they will remove a few bits of it so you can't just copy it and put your name on it, but you will be able to study it.

Decompilers suck, I used one on a program I had made about a year ago, the code that it came back with was total crap.
 
99% accurate C++ decompilers do exist (for certain compilers). No, I'm not going to tell you where to find one, or else all the software "protection" groups are going to screw them over.

It's perfectly possible to decompile a compiled program. Compilers are deterministic, and a given source code compiled on one compiler with the same options is going to always give the same output. The basic process is via pattern-matching.
 
99% accurate C++ decompilers do exist (for certain compilers). No, I'm not going to tell you where to find one, or else all the software "protection" groups are going to screw them over.

It's perfectly possible to decompile a compiled program. Compilers are deterministic, and a given source code compiled on one compiler with the same options is going to always give the same output. The basic process is via pattern-matching.


Yea that is all true.
But if you want to get the exact code a programmer used is pretty much impossible. Some programmers do things different ways than what the Decompiler interprets it as.
Googling will not get a good decompiler... Ask around and see if you can get one from someone who knows what their doing, but is willing to share. Which I'm not and obviously username1 isn't
 
thanks, also another quesiton came up while I was dealing with this, I was wondering if it's possible to get a non-working ASM file into a working converted C++ file..It would probably make more sense if you saw it, if you want please add me if your interested [email protected] and tell me your thoughts, I'm told it's garbage unless there's a way to actually program into it

This is not a request so please read it carefully thanks
 
99% accurate C++ decompilers do exist (for certain compilers). No, I'm not going to tell you where to find one, or else all the software "protection" groups are going to screw them over.

It's perfectly possible to decompile a compiled program. Compilers are deterministic, and a given source code compiled on one compiler with the same options is going to always give the same output. The basic process is via pattern-matching.
Hum.. if you say so, I must admit I have seriously outdated information. On the other hand, if they're nowhere to be found they don't really help here anyway, do they..

cloaked are you exactly talking about an ASM 'source' file, or an exexutable? Not like it makes much difference, just wondering.
 
decompiler are not a reliable source to work on, ye they exist has username1 said, but the output u get is a hard to read code, so it's not eficient so use them.

only thing they do is looking for patterns in asm code that match certain aspects of the language, and that is easy to do. since compilers use that to "twink" the compiling process more efeciently.

as u might know theres thousands of ways of doing the same thing, specially in c xD, so if u do something like a while loop the same compiler will compile it with the same pattern wich will look similar in the asm, but u can do the same thing without a while loop, then your fked :P
 
But the decompiler will output equivalent source code that compiles to the same binary.

Yes it will.
I just think its more interesting to look at how the programmer did it, but then you get to see how the person that made the decompiler felt someone would do it.
 
Typically, decompilers output asm or in some cases, p-code. There are very accurate ones avalible, but for now, I;d recommend you take a look at the patterns of output for 'Hello world' programs which can help you.
 
Hum.. if you say so, I must admit I have seriously outdated information. On the other hand, if they're nowhere to be found they don't really help here anyway, do they..

cloaked are you exactly talking about an ASM 'source' file, or an exexutable? Not like it makes much difference, just wondering.


an executable
 
do note equivalent source code is a rather tricky sentence what you want is usable code, it won't do u no good, if u have a program that does something in 1sec and the equivalent source code that the decompiled output does it in 3 days
You seem to have missed this:
username1 said:
that compiles to the same binary
jetgod said:
Typically, decompilers output asm or in some cases, p-code. There are very accurate ones avalible, but for now, I;d recommend you take a look at the patterns of output for 'Hello world' programs which can help you.
You seem to have completely missed the fact that we're talking about decompilers and not disassemblers.

More info:
http://www.program-transformation.org/Transform/DecompilationPossible
 
and you seem to completely fail to read the links you post,

it is more then obvious, at least for some one that knows the difference betewen asm and high lvl code, that decompilation is more then possible, theorical, and in some cases it is "possible" physically.


possible refers to various aspects of what you are looking for in your code...

if u want replace possible with profitable

this paragraph should make it clear unless you want as allways be on the upper end,

It is interesting to note that the authors of IDA Pro do not guarantee reassembly of the output from IDA Pro, or even believe that this is a good goal for their tool. (Source: mainly J. C. Roberts' comments in this General IDA Pro Forum titled "How do I translate EXE->ASM->EXE with IDA Pro?"). There are some technical issues like "what do you do with Delphi forms" and other resources; I simply dismiss these other objects as not being part of the source code. (You still need them to generate an equivalent program, but there are resource rippers and other programs to perform that task.) However, they seem to have resigned themselves to the fact that reassembling programs disassembled with IDA Pro is just too difficult for most people, and it would be too much work to support this activity, so they officially discourage it.

not going into further replys unless you demonstrate will to listen at least
 
I've used that before if that question was directed to me, it went further than I liked, me and my friends are trying some new methods I think we'll be ok, but just for kicks you can see the file that was translated in the ms server extra help (ms suggestions.) its the asm notepad, yes I read all of yours, it's been a great help to me.

P.s. I've always listened ^^
 
I've used that before if that question was directed to me, it went further than I liked, me and my friends are trying some new methods I think we'll be ok, but just for kicks you can see the file that was translated in the ms server extra help (ms suggestions.) its the asm notepad, yes I read all of yours, it's been a great help to me.

P.s. I've always listened ^^

na, wasn't directed to you, only thing i'm directing at you, is if decompilation what you really need? is it the most effecient way to solve your problem, i'm sure for 90% of the cases figuring the solution for your problem will lead you way faster to a conclusion then decompiling.

and effecient isn't only time, effecient refers to an amount be it time, money, headaches etc...
 
sage

and you seem to completely fail to read the links you post,

it is more then obvious, at least for some one that knows the difference betewen asm and high lvl code, that decompilation is more then possible, theorical, and in some cases it is "possible" physically.

possible refers to various aspects of what you are looking for in your code...

if u want replace possible with profitable

this paragraph should make it clear unless you want as allways be on the upper end,

not going into further replys unless you demonstrate will to listen at least
What are you talking about? Collect and cohere your thoughts.
 
Back