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
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

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

  • 02-04-2010 4: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, Registered Users 2 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, Registered Users 2 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