Jump to content
xisto Community
Sign in to follow this  
franz see

Decompiler For C++ Any suggestion?

Recommended Posts

Hmm... kind of hard to answer actually. You could try Boomerang.

 

Although if you're on the holy grail to decompiling,

it'd be easier to write something yourself.

 

The real problem with decompiling anything into C++ though is that

1)you're assuming that the code is C++ compatible

 

- suppose it was a microkernel that used an x86 assembly/Perl mix.

(hypothetical case, don't flame me saying "who'd do that?")

So 'LOADALL .... CMOV ....' and (on the top of my head guys) "/help+.?/"

could be in there. Suppose we tried to decompile that to C++.

 

That asm code could be something like

inline(db 0x0F 0x07 0x4A 1A) in C++ - ok, that's not real inline style, but go with it.

sure it's in C++, but does that make any sense to a C++ programmer?

And I'm not even going to try the Perl expression.

Just realize there's a bunch of <cstring> functions involved.

 

2)you're ok with reading code in only one style.

 

- Seriously, if you plan on using a decompiler for a high level language

is that all variables will be named systematically. Like maybe a,b,c...

for example. So std::cout << (char) currency << dollars could be

reduced to std::cout << a << b. So you'd have to go back and try

and figure out what every little variable means. That's rather

pain consuming for a large project. It'd probably be easier just learning

assembly to decompile the program because C++ is a language of abstraction.

And abstraction does not go well with arbitrary, hard to remember variables.

Share this post


Link to post
Share on other sites

Hmm... kind of hard to answer actually. You could try Boomerang.

 

 


Wow ! Great ! An open source project ! Thanks for the tip :) I'd try to check it out this weekend and take a look at it :P

 

 

 

Although if you're on the holy grail to decompiling,

it'd be easier to write something yourself.

 

The real problem with decompiling anything into C++ though is that

1)you're assuming that the code is C++ compatible

 

- suppose it was a microkernel that used an x86 assembly/Perl mix.

(hypothetical case, don't flame me saying "who'd do that?")

So 'LOADALL .... CMOV ....' and (on the top of my head guys) "/help+.?/"

could be in there. Suppose we tried to decompile that to C++.

 

That asm code could be something like

inline(db 0x0F 0x07 0x4A 1A) in C++ - ok, that's not real inline style, but go with it.

sure it's in C++, but does that make any sense to a C++ programmer?

And I'm not even going to try the Perl expression.

Just realize there's a bunch of <cstring> functions involved.

 

 


Don't worry :P I don't expect the decompiler to work on non-C++ compatible :P Besides, I'd probably not encounter that anyway in my basic use of it B)

 

 

2)you're ok with reading code in only one style.

 

- Seriously, if you plan on using a decompiler for a high level language

is that all variables will be named systematically. Like maybe a,b,c...

for example. So std::cout << (char) currency << dollars could be

reduced to std::cout << a << b. So you'd have to go back and try

and figure out what every little variable means. That's rather

pain consuming for a large project. It'd probably be easier just learning

assembly to decompile the program because C++ is a language of abstraction.

And abstraction does not go well with arbitrary, hard to remember variables.

 


Yes, I figure that much :P But i think im up to the task of refactoring the output of the decompiler :P hehe :P

 

Thanks again :P

Share this post


Link to post
Share on other sites

Lol, best of luck then. Sounds like you're decompiling a program you wrote and then deleted the source too.Do tell if you have any problems with Boomerang.

Share this post


Link to post
Share on other sites

I suggest you use an assembly decompiler. :)It's obfuscated, so it's already loopy, if anything itshould make more sense in asm. :)But seriously, what do you mean you can't decompile it?Do you mean that it just won't decompile or that the output makes no sense?

Share this post


Link to post
Share on other sites

Hi guys. I am a member of staff for an online game called Chain of Command. We are a growing community of players returning to a game lost long ago when 2am games company went bankrupt.At present the game is full of glitches. But we only have a compiled version of the game. We can't fix anything. For 3 years we've been searching for a way to get the source code so we can fix the game, from hiring Private Investigators to help track down the original programmers, to talking to professionals who would charge us $40k to $60k. We are a free game and run on donations, we clearly don't have that kind of cash.Now, with my sob story over, anyone have any suggestions? I am a programmer and I'm getting to grips with C++. Another guy on our team is an excellent C++ coder. So once we get the source code I'm sure we can make improvements. I'd appreciate any help with this. I downloaded and ran boomerang, but it commits an illegal operation during the Decompile stage. I've tried a few times with different downloads of the software. This may be caused by one of the many glitches in the coding :)We can have considered rewriting the game from scratch, but apart from the workload being far too heavy for our small staff, there are equations within the code that we could never recreate accurately. We aren't looking for the easy way out. This is our last resort, as we would obviously like an original copy of the commented source code with all the variables intact.Sorry for the length of this post :) And thanks in advance for any help.-SlickRed

Share this post


Link to post
Share on other sites

SlickRed , learn ASM , you can extract all your formulas and equations if you understand how the processor is operating this assembly language, use a debugger to step through the code.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.