How can we help you today? How can we help you today?

Are decompiled local variables renamed??

I've decompiled two sets of assemblies; the first set we could not find the source code for, the second set I compiled directly from the most "current" source. Both sets *should* be the same for the most part.

The method names, params all decompiled to the same names, but there was a HUGE variation in the method's local variable names. The compiled assemblies for which we did not have source code had much different local variable names than the code compiled from known source code.

I did not think that Reflector renamed things during a recompile. Does it? Will it randomly change things like strCustomer to str3 and so forth? No one else here has owned up to changing only variable names in the new source, so unless someone isn't being truthful, it looks like for some reason things got renamed either during decompile of during compile to MSIL? But why one set assemblies and not the other would be affected?

Anyone else experience anything like this?

Thanks!

Leigh
leigh.kendall
0

Comments

2 comments

  • Bart Read
    Hi Leigh,


    Symbol names for local variables are not stored in the compiled assemblies, but rather in the associated PDB files. If there are no PDB files, which is likely the case for the assemblies with no source, especially if they were compiled in release mode, .NET Reflector will generate names for local variables so that it can display something meaningful in the disassembler view.

    Hope that's helpful.


    Thanks,
    Bart Read
    0
  • leigh.kendall
    Ahhh... of course. Now it's plain as day. Thanks for clearing that up it was driving me mad!

    However, I'm pretty sure the compiled version I used was built in "Debug" mode, but yes no .pdb present. The code I built/compiled had .pdb's for both Debug & Release. I assume this is controlled through the Build|Advanced Build Settings option of Output Debug Info? How does that setting specifically effect what Reflector sees?
    leigh.kendall
    0

Add comment

Please sign in to leave a comment.