Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

.NET: Why are names preserved in IL?...easy recfactoring tools?

Options
  • 02-04-2010 5:20pm
    #1
    Closed Accounts Posts: 5,284 ✭✭✭


    If I open compiled .net assemblies I made in reflector, I can see all the original names of classes, members etc.
    I don't understand why these aren't altered when the assembly is built, with optimize code selected in the configuration.

    I see two obvious effects:

    It makes reverse engineering easier.
    It increases the filesize, which is a consideration in this case (clientside app on webpage)

    Both of these effects are negative. So why does it happen like this?


Comments

  • Registered Users Posts: 981 ✭✭✭fasty


    By design. C# is compiled to intermediate bytecode, not machine code. Use an obfuscation tool if you want to make reverse engineering more difficult.


  • Closed Accounts Posts: 5,284 ✭✭✭pwd


    Yeah I know it is compiled into IL. I would have assumed that selecting the "optimize code" option would replace member names with shorter equivalents though. I was surprised to see it didn't.
    Then again, I suppose in most contexts minimising filesize isn't particularly important.


  • Registered Users Posts: 981 ✭✭✭fasty


    I never really looked into what code optimisations are done, but I'd imagine it's things like unrolling loops and inlining as opposed to stripping out strings.

    But yeah, it's not ideal...


Advertisement