anon said:
This is where I saw it. So I looked and I saw they started to change the
names at the system level and then I said, how did they manage to do this.
http://www.semdesigns.com/Products/Obfuscators/CSharpObfuscationExample.html
it's hard to know what they're doing in the example, but there are a
couple of comments that I think I can make:
1) using statements (of the namespace sort) do not get compiled down to
IL - they're used by the C# compiler to make dealing with nested
namespace names more convenient. However, the emited IL always deals
with the full typenames, so I'm not sure how a decompiler would generate
using statements, except by noting which nested namespaces are used in
the entire assembly and emitting a using statement for some or all of
those. In this case, the using statements would not magically appear in
the same order in the decompiled source as they were in the original
source as they seem to do in the example.
2) More importantly, there are no types from the System.Globalization
namespace being used in the example. If no types from that namespace
are used, then the decompiler would be free to put pretty much any
namespace it wanted in place of "using System.Globalization;". However,
I'm at a loss as to why it would decide to do anything with
System.Globalization if no types from that namespace are used.
Looking at the example some more, I notice that the following namespaces
get renamed:
antlr
antlr.collections
System.Globalization
System.IO
These seem to correspond to the namespaces that don't actually get used.
That would explain why they can rename those namespaces, but it
doesn't explain why they'd have anything at all for those namespaces in
the decompiled code. Maybe I'm mistaken in my point #1, but I don't
think so.