I'm trying to RE a Windows executable compiled with VS 2008. After the initial autoanalysis most functions are detected correctly; however, some have wrong end address — for some reason IDA places the end of the function earlier, leaving a chunk of code not associated with any function. The undetected function gets noreturn
attribute and often has sp-based autoanalysis failed
message. I have fixed most of these problems by hand. The problem is that Hex-Rays seems to use autodetected function boundaries and therefore the decompilation fails after a jump inside the function, which looks like a jump outside to Hex-Rays.
Example hex-rays output:
void __thiscall sub_403CE0(void *this, unsigned int a2, int a3)
{
sub_407F30(this, a2, a3);
JUMPOUT(locret_403CFD);
}
As you can see, there is a JUMPOUT
statement at the end of the function. This was correct before the function boundaries were adjusted, but now locret_403CFD
belongs to the function itself and is not a jump “out”. Is there a way to tell hex-rays the function doesn't end here and pass a correct function start/end addresses to it?