Forum Moderators: open

Message Too Old, No Replies

How do you Decompile?

Source Code and Most Recent Backups Stolen from Office

         

woop01

11:26 pm on Apr 30, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



We were recently robbed and the computer we use to do all of our programming was stolen. It included the source code to the programs we run on our servers to manage our online games. The scum bags also stole a box that contained the most recent backups of the source code, the CD copies of VisualStudio.NET (thank God for insurance), and other assorted software. We have remotely stored source code back ups but they are two months old and we have made significant updates to the programs since then.

How easy is it to decompile from our current compiled programs? How does a person do it? What kinds of software do you need?

These were all written in VisualStudio.Net by me (most of them as a way to learn how to program) and there’s nothing fancy about them. They’re just console applications written in Visual Basic. All of the compiled programs (.exe) are currently up and running on our servers which are remotely hosted.

Side note…

The only person I’ve asked about this said decompilers are more of a criminal thing than legit. The programs have not been distributed anywhere outside our organization, they are all extremely specific to the databases associated with our websites. In other words, there aren’t any copyright issues and even if there were, we would own the copyrights.

Lord Majestic

11:35 pm on Apr 30, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The only person I’ve asked about this said decompilers are more of a criminal thing than legit.

In many countries it is perfectly legal to decompile and reverse engineer, and if you own copyright to your own program then you have nothing to be afraid of as you own it!

Decompilation will be hard if you used obfuscation, and it would also be hard if you do not have debugging symbols (compiled as relase rather than debug).

If you have people who have written it in the first place then it should not be THAT big of a deal to modify decompiled sources to look pretty much as they were: can't say however whether decompilers support for VB.NET is good.

incrediBILL

11:48 pm on Apr 30, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Decompiling isn't a criminal thing unless you're using it on software that you didn't write where the license forbids reverse engineering. Google shows a couple of Visual Basic decompilers but you'll most likely be very disappointed with the results. Compiling process tends to further optimize the code and loses some of the original structure.

BTW, why didn't you keep a set of backups offsite?

The lock boxes at the local bank are a perfect place to drop off a couple of backup CD's at least once a month. Not only should you keep copies of your software but copies of your tools as well, like Visual Studio, basically anything you rely on to maintian your business should be burned onto backup CDs and stored offsite.

woop01

12:19 am on May 1, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



We do have off site back ups in a bank safe like you say because of another thread I read on this site about a year ago. They're just two months old and we would prefer not to lose the updates made since then. Our weekly backups are kept in a locked cabinet which was forcefully opened.

Regarding obsfucation I wouldn't know how to do that if I wanted to and we didn't have a reason to since the programs were all in house.

I've seen the results on Google but most of the stuff I've seen is in the four figure range. I don't want to drop that much money on something we find out won't work. Is there a 'gold standard' type program for decompiling?

Most of the programs we're trying to find the code for were compiled in release mode. How big of a problem does that cause? As long as I can get 90% of the source code back, I think I'm good to go since I'm the one who wrote everything. None of the programs are over 10,000 lines of code.

Thanks for the great answers, I just don't want to start digging into this and find out I started out wrong.

BTW, I'm not offended at all but for future reference, there's no need to inform people who are up a creek because of a lack of backups that they really should do backups.

incrediBILL

12:30 am on May 1, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



there's no need to inform people who are up a creek because of a lack of backups that they really should do backups.

Actually I thought it was worth mentioning for the benefit of others reading this, not just you!

A friend of mine had your exact situation happen and he had lots of backups but the crooks took EVERYTHING, every floppy, CD, anything computer looking, and he didn't have offsite storage whatsoever so he suffered a 100% complete loss so he had to repurchase all his tools, MS Office, on and on.

Another suggestion would be to put a version control system like CVS or RCS on a remote server to manage your version control then you would have a copy in the bank, on the server, and on your local PC.

BTW, I saw a few decompilers that were more or less of the shareware variety online [quality unknown} that were being offered under $100. You could try those just to extract your changes.

Lord Majestic

1:38 am on May 1, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Decompiling isn't a criminal thing unless you're using it on software that you didn't write where the license forbids reverse engineering.

In many countries reverse engineering is perfectly legal for purposes of interoperability. Clean room reverse engineering for purposes of cloning is acceptable practice in most developer countries -- how do you think we got cheap PCs? IBM's BIOS had to be reverse engineered.

incrediBILL

2:55 am on May 1, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



IBM's BIOS had to be reverse engineered

The BIOS reverse engineering was more trivial, that was most likely disassembling, not decompiling. :)

In the early 80s I wrote both a Z-80 disassembler (published) and half-hearted C language decompiler and there's a huge difference in what they do and the level of expertise required to interpret the results.

lovethecoast

5:33 am on May 1, 2005 (gmt 0)

10+ Year Member



I think you're SOL. The last decompiler I saw for MS technologies was for VB3. I don't see how it would be possible, from a technical standpoint, to decompile a .Net app if it was compiled.

incrediBILL

6:04 am on May 1, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I don't see how it would be possible, from a technical standpoint, to decompile a .Net app if it was compiled.

You should discuss this with RemoteSoft that claims to have a VB.NET decompiler for $1K called Salamander. :)

Then there's Reflector for .NET, Anakrino and a few others that I'm too lazy to list.

woop01

2:14 pm on May 1, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Reflector works just as well as the demo version of the Salamander software. We haven't been able to get Anakrino to run yet.

I can tell what it's putting out because I'm the one who programmed to original versions of it. However, if that's what my source code was 'supposed' to look like when I did it, I have a LOT to learn.

The output from Reflector is going to allow us to reference the changes we have made in the past two months rather than reinventing the wheel. It will just take a while to convert that output into what we had originally intended.

Lord Majestic

2:30 pm on May 1, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The BIOS reverse engineering was more trivial, that was most likely disassembling, not decompiling. happy!

I did my share of assembly and decompilation and I am pretty convinced that while in the past decompilation was not a good option because generated code was too close to assembly, where as now .NET and Java contains so much meta-data that decompilation is very very successful: knowledge of just functin names gives very good good idea what they are doing :)

Easy_Coder

7:27 pm on May 2, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



These were all written in VisualStudio.Net

How easy is it to decompile from our current compiled programs

being .net ildasm gives you a really good look at your interfaces. but unless it's a programmer looking at this they won't have a clue. On the other hand your box included all source code so if that falls into a programmers lap then no decompilation necessary right.

ildasm comes with your .net installation. Search your box for ildasm.exe and open up one of your .net binaries that you compiled.

woop01

8:43 pm on May 2, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Wow, I think you just saved me about two days of work. The decompilers listed before work but they would take a LOT of interpretation to get the results back to normal. It's going to be a day before we get .net back (nobody caries it in stock here) but hopefully that will work.

Not knowing little things like that is what people like me miss by only learning things on a 'need to know basis'.

Iguana

9:36 pm on May 2, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



From my recent experience (rebuilding an ASP.NET website where the company had lost the sourcecode) you will have a fair amount of work to do. I found Reflector to be the best tool (and it's free). But, obviously all the variable names were lost and the For Each structures became IEnumerators and some other calls had to be re-interpreted.

I found the tool quite scary because it nearly produced a runnable version of the dlls. It took me about 3 days to rebuild the source code and make it presentable. Considering I'd never seen the source and it was my first serious .NET project, I realised that 'obfuscation' is necessary when you deploy to customers and want to protect intellectual rights.

lovethecoast

9:44 pm on May 2, 2005 (gmt 0)

10+ Year Member



Hot damn! I'm so glad to know there's a .net decompiler. I know this will end up saving the day at some point!

Easy_Coder

1:58 am on May 3, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



And if you want to protect your .net code then research obsfucation a bit.