Click to See Complete Forum and Search --> : C# And reverse engineering.


LeaetherStrip
May 8th, 2003, 05:02 AM
Hi, all!

I'm a really newbie in both C# and this forum. So don't kick me, if my question can be answered by just a reference to manual.. ;))

As I understood, any code that written on C#, compiles into MSIL, and runs only under CLR. So, any distributed C# program could be easily decompiled into exact C#-code. Am I right? If so, is there any way to protect C# programs?

Thanks,
LeaetherStrip.

pareshgh
May 8th, 2003, 01:26 PM
hello,

Strong name signature doesn't encode, encrypt or obfuscate your assembly.
It just makes sure nobody can juggle bits in your assembly or substitute it with a fake one.

I recommend you contact Brent Rector (http://www.wiseowl.com) regarding the obfuscation -- he has developed one of the best obfuscators currently on the market.

Also, you can check out DotFuscator (http://www.preemptive.com), public version of which is shipped with Visual Studio.


also check
http://www.preemptive.com/dotfuscator/index.html
http://www.wiseowl.com/products/Products.aspx


Paresh

MartinL
May 12th, 2003, 12:58 PM
Yes, what Paresh wrote is true. However, there is another possibility how to prevent an assembly to be disassembled...

Compile your assembly into the PE file (.exe). Assume, we have class.exe file...

go to de Visual Studio .NET Command Prompt

type:

ILDASM class.exe /out=class.il
ILASM /owner=someowner class.il

Now, you there is no possibility to disassembly the code if you do not know the owner name...

martin

LeaetherStrip
May 12th, 2003, 01:08 PM
Thank you, friends. Your suggestions have really helped me! :D

Sincerelly yours,
LeaetherStrip!

pareshgh
May 12th, 2003, 01:10 PM
hello Martin,
(seeing you after long time ;) :D )

<quote>
Compile your assembly into the PE file (.exe). Assume, we have class.exe file...

go to de Visual Studio .NET Command Prompt

type:

ILDASM class.exe /out=class.il
ILASM /owner=someowner class.il

Now, you there is no possibility to disassembly the code if you do not know the owner name...
</quote>

can it be possible thru VS.NET ? I haven't tried though. for example, If I change the main Program/Project's global assembly Info file then ??
:)

-Paresh

MartinL
May 12th, 2003, 01:17 PM
Hi paresh...

Didn't have a time to come here... :(

As far as I know it is not possible through VS.NET...

CLR has a mechanism to set owner for each assembly. You can set this during compiling from IL asm... ILASM has option (I think it is not documented :D ) named /owner. If you set this option during the compiling from the IL assembler to the PE file, you prevent all disasembling tools to disassemble the PE. That is all.

I really don't know why they don't put it into the VS.NET...

However, if you make a batch file and you start it in post-build step, you can do it from the VS.NET

pareshgh
May 12th, 2003, 01:19 PM
hmm
cool

:cool:

thanks ...

jvela
January 4th, 2006, 05:18 AM
I'm trying to do this but ILSM doesn't have the option /owner. Can somebody help me?

Thanks!


ILDASM class.exe /out=class.il
ILASM /owner=someowner class.il

darwen
January 4th, 2006, 04:15 PM
I found that too... not in the .NET 2.0 version either.

Darwen.

jvela
January 5th, 2006, 03:32 AM
Hello, I found this link http://groups.google.com/group/microsoft.public.dotnet.languages.csharp/browse_frm/thread/c1ef4e7ca010066f/578bccfc91f82fde?lnk=st&q=ilasm+%2Fowner&rnum=3#578bccfc91f82fde. It explain that option '/owner' it's only present in BETA 1 and BETA 2 of .NET framework version 1 :(

Regards