views:

251

answers:

10

Is there any .obj to .cpp converter?
Is it possible to do it?
MICROSOFT VISUAL STUDIO auto-magically deleted my code files when pressed the F5 key.
Please help me.
i have the .obj files(VS forgot to delete them.ha ha ha).

A: 

You are out of luck. There is no safe way to reverse an obj file back to its cpp source.

Otávio Décio
what is the unsafe way?
Behrooz
A: 

I do not think that is actually possible. You'd be reversing the compilation process, which from my knowledge is not possible.

Tony
+3  A: 

Unfortunately it is impossible to decompile an .obj file back to source. More info here.

Darin Dimitrov
Impossible? You've obviously never used IDA.
Frank Krueger
@Frank Krueger:IDA works good but i cannot pay for that. While(Countries::C_Iran::LastMessage::Nuclear>0.05)IAEA::GetCountryA(Countries::C_Iran)->Boycott++;
Behrooz
ida has a free version. not sure if it will help though... you will be rewriting the .cpp files no matter what; there is no magic bullet for this.
tenfour
another error in the link:I HATE VB.
Behrooz
@tenfour:It is really good.I tried it.
Behrooz
A: 

NO, it's not possible. obj files contain object code, not source code. The compilation process is typically not reversible.

PS: Visual Studio did surely not delete your code files when you pressed F5. They are somewhere, or you've deleted them accidentially.

Alexander Gessler
when i pressed the f5 key.vs started compiling.in the middle of process.messagebox(0,"Access denied","microsoft visual studio", 48);
Behrooz
@Behrooz: I think that would be a symptom that some other process deleted the files and VS failed to read them and threw out an access denied message.
Martinho Fernandes
A: 

It is impossible to do that...as all the code's comments and variables are translated into a machine code, you cannot deterministically reproduce a variable name by gleaning in on assembler byte code, Consider this as an example of a mock dump of a binary image:

0x55 0x90 0x33 0xf0 ....

Now, how can you tell that's variable foobar that is of type int....

Hope this helps, Best regards, Tom.

tommieb75
ooo really.most of the code was inline-assembly.how can i reverse the engine?
Behrooz
+2  A: 

As everyone has pointed out, this is impossible.

I would suggest that before you rebuild all those files, you take the time to look into SVN or another version control system.

Version Control allows you to save copies of your files to a safe place. If the compiler eats your homework, you can update with the last copy you saved to the repository.

Robert
+2  A: 

You should try Recuva

Alex LE
installing... please wait.
Behrooz
nothing found.thanks.
Behrooz
Worth the try anyway
Alex LE
+2  A: 

shut down your computer, boot from removable media, some sort of the UNIX, and run strings utility on your hard drive. It may be able to recover text off your source code.

aaa
A: 

.obj files are text files for a 3d modle i was actuly looking for something to bring them into cpp to display using openGL. there are programs out there to load them into cpp i was looking for one to download when i came arcoss this.

en.wikipedia.org/wiki/Obj

me
I am not doing graphics.I am writing in C++.I have wrote them all again.
Behrooz
A: 

As said earlier, it is impossible to get the C source code from on obj. As an alternative, you can try a file recovery utility and scan your disk for lost files. I have previously used testdisk with partial success.

Also, you really need to use some form of SCM!

xslr