Given the example source code below, is it possible for someone to see the value of _secret using a disassembler? I didn’t see a way to get at the value via Reflector, but I haven’t used it very much. Assume the code is not obfuscated in any way.
class Foo
{
private string _secret = @"all your base are belong to us";
public void Foo()
{
...
}
}
Thanks!
It’s visible in the constructor in Reflector.
translates to having constructor
which is visible in Reflector under
Fooin method.ctor.You can also see this information in
ildasm(ships with Microsoft Visual Studio) inFoo::.ctor : void:Finally, if someone knows the name of your type and the name of your private field, you can obtain the value as such:
Of course, I can always see all of your private fields with