1) wrong size=8 integer type fix, not all "int/long" combinations covered
if(pHandleOptions->bFixTypes)
{
if((result.nBaseType==7) &&(result.nSize!=4)) // "unsigned int"
{
switch(result.nSize)
{
case 1: result.sTypeName="unsigned char"; break;
case 2: result.sTypeName="unsigned short"; break;
case 4: result.sTypeName="unsigned int"; break;
case 8: result.sTypeName="unsigned long"; break;
}
}
supposed to be :
if(pHandleOptions->bFixTypes)
{
if((result.nBaseType==7 || result.nBaseType==14) &&(result.nSize!=4)) // "unsigned int"
{
switch(result.nSize)
{
case 1: result.sTypeName="unsigned char"; break;
case 2: result.sTypeName="unsigned short"; break;
case 4: result.sTypeName="unsigned int"; break;
case 8: result.sTypeName="unsigned long long"; break; // or __int64
}
}
if((result.nBaseType==6 || result.nBaseType==13) &&(result.nSize!=4)) // "int"
{
switch(result.nSize)
{
case 1: result.sTypeName="char"; break;
case 2: result.sTypeName="short"; break;
case 4: result.sTypeName="int"; break;
case 8: result.sTypeName="long long"; break;
}
}
}
2) in void QWinPDB::_appendElem()
_dwSize+= pListChildren->at(j).dwSize;
to:
if (pListChildren->at(j).dwBitOffset) {
_dwSize+= 0;
} else {
_dwSize+= pListChildren->at(j).dwSize;
}
this need for unions with child bitsized fields to avoid increment total size
example:
struct _EX_PUSH_LOCK// Size=0x4
{
union // Size=0xc
{
struct // Size=[b]0xc[/b] - wrong, next fields after this internal struct will be assume at offset 0xc
{
unsigned long Waiting:1;// Offset=0x0 Size=0x4 BitOffset=0x0 BitSize=0x1
unsigned long Exclusive:1;// Offset=0x0 Size=0x4 BitOffset=0x1 BitSize=0x1
unsigned long Shared:30;// Offset=0x0 Size=0x4 BitOffset=0x2 BitSize=0x1e
};
unsigned long Value;// Offset=0x0 Size=0x4
void *Ptr;// Offset=0x0 Size=0x4
};
};
3) union/fields "fix engine" still has bugs:
unsigned long GrantedAccess;// Offset=0x23c Size=0x4
union // Size=0x4
{
unsigned long CrossThreadFlags;// Offset=0x240 Size=0x4
unsigned long Terminated:1;// Offset=0x240 Size=0x4 BitOffset=0x0 BitSize=0x1
};
unsigned long DeadThread:1;// Offset=0x240 Size=0x4 BitOffset=0x1 BitSize=0x1 - outside of union
unsigned long HideFromDebugger:1;// Offset=0x240 Size=0x4 BitOffset=0x2 BitSize=0x1
unsigned long ActiveImpersonationInfo:1;// Offset=0x240 Size=0x4 BitOffset=0x3 BitSize=0x1
unsigned long SystemThread:1;// Offset=0x240 Size=0x4 BitOffset=0x4 BitSize=0x1
unsigned long HardErrorsAreDisabled:1;// Offset=0x240 Size=0x4 BitOffset=0x5 BitSize=0x1
unsigned long BreakOnTermination:1;// Offset=0x240 Size=0x4 BitOffset=0x6 BitSize=0x1
unsigned long SkipCreationMsg:1;// Offset=0x240 Size=0x4 BitOffset=0x7 BitSize=0x1
unsigned long SkipTerminationMsg:1;// Offset=0x240 Size=0x4 BitOffset=0x8 BitSize=0x1
Hi horsicq !
1) wrong size=8 integer type fix, not all "int/long" combinations covered if(pHandleOptions->bFixTypes) { if((result.nBaseType==7) &&(result.nSize!=4)) // "unsigned int" { switch(result.nSize) { case 1: result.sTypeName="unsigned char"; break; case 2: result.sTypeName="unsigned short"; break; case 4: result.sTypeName="unsigned int"; break; case 8: result.sTypeName="unsigned long"; break; } }
supposed to be : if(pHandleOptions->bFixTypes) { if((result.nBaseType==7 || result.nBaseType==14) &&(result.nSize!=4)) // "unsigned int" { switch(result.nSize) { case 1: result.sTypeName="unsigned char"; break; case 2: result.sTypeName="unsigned short"; break; case 4: result.sTypeName="unsigned int"; break; case 8: result.sTypeName="unsigned long long"; break; // or __int64 } } if((result.nBaseType==6 || result.nBaseType==13) &&(result.nSize!=4)) // "int" { switch(result.nSize) { case 1: result.sTypeName="char"; break; case 2: result.sTypeName="short"; break; case 4: result.sTypeName="int"; break; case 8: result.sTypeName="long long"; break; } } }
2) in void QWinPDB::_appendElem() _dwSize+= pListChildren->at(j).dwSize; to: if (pListChildren->at(j).dwBitOffset) { _dwSize+= 0; } else { _dwSize+= pListChildren->at(j).dwSize; }
this need for unions with child bitsized fields to avoid increment total size example: struct _EX_PUSH_LOCK// Size=0x4 { union // Size=0xc { struct // Size=[b]0xc[/b] - wrong, next fields after this internal struct will be assume at offset 0xc { unsigned long Waiting:1;// Offset=0x0 Size=0x4 BitOffset=0x0 BitSize=0x1 unsigned long Exclusive:1;// Offset=0x0 Size=0x4 BitOffset=0x1 BitSize=0x1 unsigned long Shared:30;// Offset=0x0 Size=0x4 BitOffset=0x2 BitSize=0x1e }; unsigned long Value;// Offset=0x0 Size=0x4 void *Ptr;// Offset=0x0 Size=0x4 }; };
3) union/fields "fix engine" still has bugs: unsigned long GrantedAccess;// Offset=0x23c Size=0x4 union // Size=0x4 { unsigned long CrossThreadFlags;// Offset=0x240 Size=0x4 unsigned long Terminated:1;// Offset=0x240 Size=0x4 BitOffset=0x0 BitSize=0x1 }; unsigned long DeadThread:1;// Offset=0x240 Size=0x4 BitOffset=0x1 BitSize=0x1 - outside of union unsigned long HideFromDebugger:1;// Offset=0x240 Size=0x4 BitOffset=0x2 BitSize=0x1 unsigned long ActiveImpersonationInfo:1;// Offset=0x240 Size=0x4 BitOffset=0x3 BitSize=0x1 unsigned long SystemThread:1;// Offset=0x240 Size=0x4 BitOffset=0x4 BitSize=0x1 unsigned long HardErrorsAreDisabled:1;// Offset=0x240 Size=0x4 BitOffset=0x5 BitSize=0x1 unsigned long BreakOnTermination:1;// Offset=0x240 Size=0x4 BitOffset=0x6 BitSize=0x1 unsigned long SkipCreationMsg:1;// Offset=0x240 Size=0x4 BitOffset=0x7 BitSize=0x1 unsigned long SkipTerminationMsg:1;// Offset=0x240 Size=0x4 BitOffset=0x8 BitSize=0x1