Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

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

  • 02-04-2010 04: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