Why do some local variables have second numbers? #3003
-
I'm learning malware reverse engineering and currently working with this sample BB1730B09C6C47304CF71A902D006B80DCF6CA8FBC179856393073FAAFD68D55 at Ghidra shows the variable and call correctly. Is this a bug in Binary Ninja? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hey Sean! I got your email about this as well. Sorry for the long wait for a response. This isn't a "bug" - it's just a difference in how Binary Ninja did its analysis. (Although, we do currently lack the ability for you to manually merge them if this happens in HLIL instead of disassembly, which is a bug/missing feature: #1887.) If you click on each version of You can see this a bit better with Ghidra says "these are the same thing" because they're at the same memory location and, quite possibly, have the same type. Binary Ninja says, "these are probably different things" because they're not being used the same way and have different types. Which one is "correct" will depend on the code in question and automatically determining this in all scenarios is a Hard Problem ™️. In reality, it's probable that some/all of these aren't "variables" in the way you might understand them as a developer. This is why, for example, Hopefully that made sense! (And, thanks for the discussion item. I'm pretty sure we do have a bug that this sample uncovered, but it's not the one you reported!) |
Beta Was this translation helpful? Give feedback.
Hey Sean! I got your email about this as well. Sorry for the long wait for a response.
This isn't a "bug" - it's just a difference in how Binary Ninja did its analysis. (Although, we do currently lack the ability for you to manually merge them if this happens in HLIL instead of disassembly, which is a bug/missing feature: #1887.)
If you click on each version of
var_28
and hit "y", you'll see they're typed differently:var_28
is anint32_t
,var_28_1
is avoid*
, andvar_28_2
is anHMODULE
. (I'm not sure whyvar_28
is used aftervar_28_1
, but it's probably related to the order in which types were applied while the function was being analyzed.) Because the type differs in each usage, Binary N…