Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
horsicq committed Jan 18, 2021
1 parent 9f7a5d8 commit 75a994e
Show file tree
Hide file tree
Showing 19 changed files with 122 additions and 131 deletions.
2 changes: 1 addition & 1 deletion console_source/consoleoutput.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2020 hors<horsicq@gmail.com>
// Copyright (c) 2020-2021 hors<horsicq@gmail.com>
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion console_source/consoleoutput.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2020 hors<horsicq@gmail.com>
// Copyright (c) 2020-2021 hors<horsicq@gmail.com>
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
Expand Down
4 changes: 2 additions & 2 deletions console_source/main_console.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2020 hors<horsicq@gmail.com>
// Copyright (c) 2020-2021 hors<horsicq@gmail.com>
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
Expand Down Expand Up @@ -38,7 +38,7 @@ int main(int argc, char *argv[])
QCommandLineParser parser;
QString sDescription;
sDescription.append(QString("%1 v%2\n").arg(X_APPLICATIONNAME).arg(X_APPLICATIONVERSION));
sDescription.append(QString("%1\n").arg("Copyright(C) 2012-2020 hors<horsicq@gmail.com> Web: http://ntinfo.biz"));
sDescription.append(QString("%1\n").arg("Copyright(C) 2012-2021 hors<horsicq@gmail.com> Web: http://ntinfo.biz"));
parser.setApplicationDescription(sDescription);
parser.addHelpOption();
parser.addVersionOption();
Expand Down
4 changes: 2 additions & 2 deletions global.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2020 hors<horsicq@gmail.com>
// Copyright (c) 2020-2021 hors<horsicq@gmail.com>
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
Expand All @@ -24,7 +24,7 @@
#include <QString>

#define X_APPLICATIONNAME "PDBRipper"
#define X_APPLICATIONVERSION "2.00"
#define X_APPLICATIONVERSION "2.01"
#define X_ORGANIZATIONNAME "NTInfo"
#define X_ORGANIZATIONDOMAIN "ntinfo.biz"

Expand Down
4 changes: 2 additions & 2 deletions gui_source/dialogabout.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2020 hors<horsicq@gmail.com>
// Copyright (c) 2020-2021 hors<horsicq@gmail.com>
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
Expand Down Expand Up @@ -28,7 +28,7 @@ DialogAbout::DialogAbout(QWidget *pParent) :
ui->setupUi(this);

ui->labelInfo->setText(QString("<html><head/><body><p align=\"center\">"
"<span style=\" font-weight:600;\">Copyright(C) 2012-2020 hors</span></p>"
"<span style=\" font-weight:600;\">Copyright(C) 2012-2021 hors</span></p>"
"<p align=\"center\"><span style=\" font-weight:600;\">"
"Version: </span>%1 (%2)</p><p align=\"center\">"
"<span style=\" font-weight:600;\">Website: </span><a href=\"http://ntinfo.biz\">"
Expand Down
2 changes: 1 addition & 1 deletion gui_source/dialogabout.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2020 hors<horsicq@gmail.com>
// Copyright (c) 2020-2021 hors<horsicq@gmail.com>
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion gui_source/dialogexport.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2020 hors<horsicq@gmail.com>
// Copyright (c) 2020-2021 hors<horsicq@gmail.com>
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion gui_source/dialogexport.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2020 hors<horsicq@gmail.com>
// Copyright (c) 2020-2021 hors<horsicq@gmail.com>
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion gui_source/dialogoptions.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2020 hors<horsicq@gmail.com>
// Copyright (c) 2020-2021 hors<horsicq@gmail.com>
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion gui_source/dialogoptions.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2020 hors<horsicq@gmail.com>
// Copyright (c) 2020-2021 hors<horsicq@gmail.com>
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion gui_source/dialogprocess.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// copyright (c) 2020 hors<horsicq@gmail.com>
// copyright (c) 2020-2021 hors<horsicq@gmail.com>
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion gui_source/guimainwindow.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// copyright (c) 2020 hors<horsicq@gmail.com>
// copyright (c) 2020-2021 hors<horsicq@gmail.com>
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion gui_source/guimainwindow.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// copyright (c) 2020 hors<horsicq@gmail.com>
// copyright (c) 2020-2021 hors<horsicq@gmail.com>
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
Expand Down
87 changes: 1 addition & 86 deletions gui_source/main_gui.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// copyright (c) 2020 hors<horsicq@gmail.com>
// copyright (c) 2020-2021 hors<horsicq@gmail.com>
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
Expand All @@ -22,93 +22,8 @@
#include <QApplication>
#include <QStyleFactory>


union __TST3
{
union
{
int n1;
struct
{
char tq;
char tt;
};
};
int t1;
int t2;
};

struct __TST2
{
int t1;
int t2;
__TST3 tst3;
};

struct __TEST
{
int nBit0_0:2;
int nBit0_1:2;
int nBit0_2:1;
char nBit1:1;
char t1;
union
{
struct
{
int t2;
int t3;
};
int t4;
char t5;
struct
{
char t6;
char t7;
char t8;
char t9;
char t10;
int t11;
};

__TST2 tst2;

struct
{
char t12;
union
{
char t13;
int t14;
};
int t15;
};
int t16;
struct
{
int t17;
int t18;
int t19;
int t20;
};
};
int t1000;
char **********t1500;
int t2000;
char t2500[10][20][30];
int t3000;
void *Callback(void *);
void ( *Callback2)(void *);
int nTest;
int nBit:2;
};

int main(int argc, char *argv[])
{
__TEST test;
test.t1=1;
test.t1++;

QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);

QCoreApplication::setOrganizationName(X_ORGANIZATIONNAME);
Expand Down
2 changes: 1 addition & 1 deletion pdbprocess.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// copyright (c) 2020 hors<horsicq@gmail.com>
// copyright (c) 2020-2021 hors<horsicq@gmail.com>
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion pdbprocess.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// copyright (c) 2020 hors<horsicq@gmail.com>
// copyright (c) 2020-2021 hors<horsicq@gmail.com>
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
Expand Down
125 changes: 100 additions & 25 deletions qwinpdb.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// copyright (c) 2020 hors<horsicq@gmail.com>
// copyright (c) 2020-2021 hors<horsicq@gmail.com>
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
Expand Down Expand Up @@ -1020,14 +1020,25 @@ QWinPDB::RTYPE QWinPDB::_getType(IDiaSymbol *pType,QWinPDB::HANDLE_OPTIONS *pHan

if(pHandleOptions->bFixTypes)
{
if((result.nBaseType==7)&&(result.nSize!=4)) // "unsigned int"
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"; break;
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;
}
}

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;
}
}
}
Expand Down Expand Up @@ -1848,9 +1859,13 @@ void QWinPDB::fixOffsets(QWinPDB::ELEM *pElem) // TODO Options

elem.listChildren.clear();

int nCount=pElem->listChildren.count();
QList<ELEM> listChildren=pElem->listChildren;

_appendElem(&elem,&(pElem->listChildren),0,nCount);
listChildren=_fixBitFields(&listChildren);

int nCount=listChildren.count();

_appendElem(&elem,&listChildren,0,nCount);

*pElem=elem;
}
Expand Down Expand Up @@ -1888,7 +1903,7 @@ void QWinPDB::_appendElem(QWinPDB::ELEM *pElem, QList<QWinPDB::ELEM> *pListChild
_nPosition=j;
}

_dwSize+=pListChildren->at(j).dwSize;
_dwSize=qMax((DWORD)_dwSize,pListChildren->at(j).dwOffset+pListChildren->at(j).dwSize);
_nCount++;
}

Expand All @@ -1914,7 +1929,7 @@ void QWinPDB::_appendElem(QWinPDB::ELEM *pElem, QList<QWinPDB::ELEM> *pListChild
break;
}

_dwSize+=pListChildren->at(j).dwSize;
_dwSize=qMax((DWORD)_dwSize,pListChildren->at(j).dwOffset+pListChildren->at(j).dwSize);
_nCount++;
}

Expand Down Expand Up @@ -1946,26 +1961,29 @@ void QWinPDB::_appendElem(QWinPDB::ELEM *pElem, QList<QWinPDB::ELEM> *pListChild
pElemUnion=pElem;
}

// TODO Check
for(int j=0;j<nCount;j++)
{
if(listCounts.at(j)>1)
{
QWinPDB::ELEM *pElemStruct=new QWinPDB::ELEM();
*pElemStruct={};
pElemStruct->elemType=ELEM_TYPE_FAKESTRUCT;
pElemStruct->dwSize=listSizes.at(j);
pElemStruct->_udt.sType="struct";
// if(listCounts.at(j)>1)
// {
// QWinPDB::ELEM *pElemStruct=new QWinPDB::ELEM();
// *pElemStruct={};
// pElemStruct->elemType=ELEM_TYPE_FAKESTRUCT;
// pElemStruct->dwSize=listSizes.at(j);
// pElemStruct->_udt.sType="struct";

_appendElem(pElemStruct,pListChildren,listPositions.at(j),listPositions.at(j)+listCounts.at(j));
// _appendElem(pElemStruct,pListChildren,listPositions.at(j),listPositions.at(j)+listCounts.at(j));

pElemUnion->listChildren.append(*pElemStruct);
// pElemUnion->listChildren.append(*pElemStruct);

delete pElemStruct;
}
else
{
_appendElem(pElemUnion,pListChildren,listPositions.at(j),listPositions.at(j)+listCounts.at(j));
}
// delete pElemStruct;
// }
// else
// {
// _appendElem(pElemUnion,pListChildren,listPositions.at(j),listPositions.at(j)+listCounts.at(j));
// }

_appendElem(pElemUnion,pListChildren,listPositions.at(j),listPositions.at(j)+listCounts.at(j));

i+=listCounts.at(j);
}
Expand All @@ -1990,6 +2008,63 @@ void QWinPDB::_appendElem(QWinPDB::ELEM *pElem, QList<QWinPDB::ELEM> *pListChild
}
}

QList<QWinPDB::ELEM> QWinPDB::_fixBitFields(QList<QWinPDB::ELEM> *pListChildren)
{
QList<QWinPDB::ELEM> listResult;

int nCount=pListChildren->count();

for(int i=0;i<nCount;i++)
{
if(pListChildren->at(i).dwBitSize)
{
quint32 nSize=pListChildren->at(i).dwSize;
quint32 nOffset=pListChildren->at(i).dwOffset;

QList<QWinPDB::ELEM> listBitFields;

for(;i<nCount;i++)
{
if(pListChildren->at(i).dwBitSize==0)
{
i--;
break;
}

nSize=(pListChildren->at(i).dwOffset+pListChildren->at(i).dwSize)-nOffset;

listBitFields.append(pListChildren->at(i));
}

if(nSize==3) // TODO !!!
{
if((pListChildren->at(i+1).dwSize==1)&&(pListChildren->at(i+1).dwOffset==(nOffset+nSize)))
{
i++;
listBitFields.append(pListChildren->at(i));
nSize=4;
}
}

QWinPDB::ELEM elemStruct={};
elemStruct.elemType=ELEM_TYPE_FAKESTRUCT;
elemStruct.dwSize=nSize;
elemStruct.dwOffset=nOffset;
elemStruct._udt.sType="struct";

_appendElem(&elemStruct,&listBitFields,0,listBitFields.count());

listResult.append(elemStruct);
}
else
{
listResult.append(pListChildren->at(i));
}
}

return listResult;
}

QWinPDB::ELEM_INFO QWinPDB::getElemInfo(const ELEM *pElem, HANDLE_OPTIONS *pHandleOptions, int nLevel, bool bIsClass)
{
ELEM_INFO result;
Expand Down
Loading

0 comments on commit 75a994e

Please sign in to comment.