1

Last night I was extending functionality of HexRaysCodeXplorer - implemented feature to automatically rename duplicating variables. It needs some fixes to work well, but the problem I cannot cope with is - how to preserve lvar names?

This is how it works:

  1. Before:

    Before

  2. After:

    After

These names do exist only till end of current Ida session.

I have read about Ida's netnodes, but I don't think it's rational to store lvar names in this container and do renaming at the start of every session. I suspect there is some native way to preserve essential information (like in this case), but I cannot find it.

Because I had to analyse c-tree, I used HexRays classes like: ctree_visitor_t, cfuncptr_t and lvar_t.

1 Answer 1

1

There's no need to store them. As I'm guessing your lvar name generation algorithm is not very computationally expensive, you can just regenerate them every time a function is decompiled.

(This is the approach used by my CrowdDetox Hex-Rays plugin.)

1
  • 1
    but what if i want to store them ?
    – LighFusion
    Apr 22, 2018 at 12:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.