Almost ADSL
Posted on 2 Jul 2002 at 17:04
Dave Jewell awaits his ADSL installation with both fear and excitement, and shows how to access the Shell32 COM objects from C#
The .Net SDK already includes a utility called ILDASM, which can be used to disassemble a .Net executable or assembly, dumping out its code as a series of IL instructions, but what sets Exemplar apart is the fact that it gives you the output back in the form of C# source code. Listing One shows a small part of the DataGridCaption class contained inside the System.WinForms assembly. I'm hoping that Microsoft doesn't mind me showing a chunk of reverse-engineered code here, but bearing in mind that the company has given us ILDASM I can't see much basis for any objection. The only changes I made to this code were to adjust the formatting so things would fit better on the printed page. Other than that, this is the unretouched output of Exemplar, and I think that's impressive for a version 0.1 decompiler.
You'll notice that the decompiler has listed all the private field names, making it easier to understand the resulting code. Admittedly, the frequent references to this are superfluous, but this is a minor point. Note also that the decompiler has correctly identified and listed the 'getter' and 'setter' routines associated with the two properties shown. Naturally, a lot more code than this was produced; this snippet is intended to give you a flavour. It also handles all the common language control structures including while loops, for loops, and so forth. It's all very impressive, although I should warn you that the Exemplar source code isn't for the faint-hearted.
If you're familiar with MSIL, the Microsoft IL Assembler, you'll know that it has a special command-line switch, /owner, which is designed to prevent ILDASM from disassembling the instruction stream. Thus, you might use the switch like this:
ILASM mysource.il /owner=SecretSquirrel
Once you've done this, ILDASM can't disassemble the resulting code unless you supply 'SecretSquirrel' as the owner name. Needless to say, this simple-minded protection mechanism is ignored by Exemplar, which decompiles it regardless. What's the point of all this? Simply that if you're planning to release anything that runs under .Net you may as well give your source code away. Fortunately, there's a simple solution. If you're prepared to pre-JIT your code before distribution - in other words, release binaries that are already precompiled for the x86 processor family - your code will be no easier to reverse-engineer than that created with any traditional development system. Sure, you'll lose some portability, but you'll gain a lot in terms of peace of mind.
From around the web
advertisement
- Chrome's shine getting lost in translation
- BytePac: the cardboard hard disk enclosure
- How tech loosens our grip on reality
- Hokum watch: Safer Internet Day
- Why I'm deleting Adobe from my PC
- Prepare to be patronised: it's Safer Internet Day
- Dear Sony, Samsung and every other tech company in the world: stop trying to be Apple
- Will Apple's Final Cut Pro X update placate the pros?
- Smartr Contacts for iPhone review
- Switching to Office 365's Outlook Web App
- Ofcom dithers over plans to tackle broadband slamming
- Speed-hungry customers push Virgin into profit
- Ofcom to impose price cuts on BT line rental
- Virgin hikes prices after "free" upgrade
- BT to offer 300Mbits/sec fibre "on demand"
- Ofcom outlines plans for wider 4G coverage
- Virgin upgrade to double broadband speeds
- Satellite broadband "being ignored"
- Sky blocks Newzbin over copyright claim
- Push to get more people online stalls
advertisement
