4

It appears to me that in my function the compiler has reused a stack slot for two variables of types. However, Hex-Rays has not recognized it as such. How can I split the local variable into two?

4
  • I think it depends on the exact situation, can you post an example? Commented May 26, 2018 at 10:30
  • @WillemHengeveld it's a pretty long function, but here: gist.github.com/Zhentar/d65a0bbdcd489719cbec7b0b00761f85 a3a, a4a, time, and time_1 are ones that I've noticed that seem to be aliased
    – Zhentar
    Commented May 26, 2018 at 21:28
  • I usually add structs with unions to make the output slightly more readable when the compiler has reused a stack slot for different variables.
    – Léo Lam
    Commented May 27, 2018 at 8:55
  • @LéoLam you should post that as an answer so I can accept it :)
    – Zhentar
    Commented May 28, 2018 at 3:06

1 Answer 1

2

I usually add structs with unions to make the output slightly more readable when the compiler has reused a stack slot for different variables.

In 7.2, it seems that you can force the decompiler to "create a new variable", which makes this easier and less ugly. Yay!

1
  • is that supposed to work in IDA Free 8.2?
    – Benni
    Commented Jun 5, 2023 at 15:39

Your Answer

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

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