PDA

View Full Version : Overlapped variables with Ida Pro decompiler (Hex Rays)


fil
January 18th, 2011, 15:55
Here's some generated pseudo-code:

Code:
void __thiscall sub_406A09(void *this)
{
...
char v10[100]; // [sp+18h] [bp-638h]@1
int v13; // [sp+20h] [bp-630h]@3
char v14; // [sp+24h] [bp-62Ch]@2
int v16; // [sp+320h] [bp-330h]@8
...

if ( v13 )
...
}


How can I get rid of variables v13, v14? I have deleted them in the assembler, but the decompiler still insists on creating a C variable for the offsets, rather than simply referring to the prior (overlapping at this point) variable v10.

Any thoughts on this?

disavowed
January 19th, 2011, 11:22
Click on v10, press the Y key, then specify a longer array size.

fil
January 19th, 2011, 18:18
Quote:
[Originally Posted by disavowed;89169]Click on v10, press the Y key, then specify a longer array size.


Um.. this was kind of the point of the question: I have already extended v10's array size to take in the following variables (look at the stack offsets), but it still insists on referring to them seperately.

I expected the action you indicated to resolve the problem, but it does not...

disavowed
January 20th, 2011, 16:30
Ah, I didn't look at the offsets prior to making my previous response.
Well it's odd that IDA thinks there's an int in the middle of your char array.

Anyway, would probably be best to post about this on http://www.hex-rays.com/forum/index.php