CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 10 of 10
  1. #1
    Join Date
    Oct 2002
    Location
    Moscow, Russia
    Posts
    97

    C# And reverse engineering.

    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.

  2. #2
    Join Date
    Nov 2002
    Location
    Singapore
    Posts
    1,890
    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
    - Software Architect

  3. #3
    Join Date
    Dec 2000
    Location
    Slovakia
    Posts
    1,043
    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

  4. #4
    Join Date
    Oct 2002
    Location
    Moscow, Russia
    Posts
    97

    Just thanks

    Thank you, friends. Your suggestions have really helped me!

    Sincerelly yours,
    LeaetherStrip!
    ...Drinkin' buttermilk all the week
    And it's whiskey on a Sunday ;-)

  5. #5
    Join Date
    Nov 2002
    Location
    Singapore
    Posts
    1,890
    hello Martin,
    (seeing you after long time )

    <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
    - Software Architect

  6. #6
    Join Date
    Dec 2000
    Location
    Slovakia
    Posts
    1,043
    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 ) 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

  7. #7
    Join Date
    Nov 2002
    Location
    Singapore
    Posts
    1,890
    hmm
    cool



    thanks ...
    - Software Architect

  8. #8
    Join Date
    Jan 2006
    Posts
    2

    Re: C# And reverse engineering.

    I'm trying to do this but ILSM doesn't have the option /owner. Can somebody help me?

    Thanks!

    Quote Originally Posted by pareshgh
    ILDASM class.exe /out=class.il
    ILASM /owner=someowner class.il

  9. #9
    Join Date
    Jan 2002
    Location
    Scaro, UK
    Posts
    5,940

    Re: C# And reverse engineering.

    I found that too... not in the .NET 2.0 version either.

    Darwen.
    www.pinvoker.com - PInvoker - the .NET PInvoke Interface Exporter for C++ Dlls.

  10. #10
    Join Date
    Jan 2006
    Posts
    2

    Unhappy Re: C# And reverse engineering.

    Hello, I found this link http://groups.google.com/group/micro...8bccfc91f82fde. It explain that option '/owner' it's only present in BETA 1 and BETA 2 of .NET framework version 1

    Regards

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured