简体   繁体   中英

Decompile Dll - Code has CS$4$0001 for vars

I want to edit a dll file if possible or extract the contents and modify them.

I have used .Net Reflector to decompile and generate files.

That worked great except some files have things like CS$4$0001 instead of variables.

also <>g__initLocal31

Is there a way to find what those are? Or Should I just replace all instances, and test?

ADDED:

    [OutputCache(NoStore=true, Location=OutputCacheLocation.Client, Duration=1)]
    public ActionResult _StateTile(string AssetName, string StateName)
    {
        aaReportsEntities dataContext;
        string CS$4$0001 = StateName;
        if (CS$4$0001 != null)
        {
            if (!(CS$4$0001 == "IDLE-UPSTREAM"))

Those can be:

  • local variables (don't have names in IL)
  • backing fields for automatically implemented properties / field-like events
  • fields for anything compiler-generated (capture-context related scopes, etc)
  • expression-tree / delegate caches
  • "dynamic" caches
  • state variables in iterator-blocks / "await" code
  • etc (again, mainly anything compiler-generated)

They are important. But frankly, you probably shouldn't be extracting code via reflector: usually, if you have justification in doing that, you already own the source code (or are licensed to access it)

You cant get variable names back. TReverse engineering is very difficult to do, recommend this book - http://www.amazon.co.uk/Reversing-Secrets-Engineering-Eldad-Eilam/dp/0764574817/ref=sr_1_1?ie=UTF8&qid=1353436851&sr=8-1

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM