diff --git a/src/core/CutterCommon.h b/src/core/CutterCommon.h index cbae8e79..a0a07233 100644 --- a/src/core/CutterCommon.h +++ b/src/core/CutterCommon.h @@ -47,7 +47,7 @@ inline QString RAddressString(RVA addr) inline QString RSizeString(RVA size) { - return QString::asprintf("%lld", size); + return QString::asprintf("%#llx", size); } inline QString RHexString(RVA size) diff --git a/src/widgets/SectionsWidget.cpp b/src/widgets/SectionsWidget.cpp index ae81d7e6..a15b7266 100644 --- a/src/widgets/SectionsWidget.cpp +++ b/src/widgets/SectionsWidget.cpp @@ -57,7 +57,7 @@ QVariant SectionsModel::data(const QModelIndex &index, int role) const case SectionsModel::NameColumn: return section.name; case SectionsModel::SizeColumn: - return section.vsize; + return RSizeString(section.vsize); case SectionsModel::AddressColumn: return RAddressString(section.vaddr); case SectionsModel::EndAddressColumn: @@ -367,24 +367,24 @@ void AbstractAddrDock::updateDock() addrDockScene->seekAddrSizeMap[name] = desc.vsize; RVA addr = getAddressOfSection(desc); - int size = getSizeOfSection(desc); + RVA size = getSizeOfSection(desc); addrDockScene->nameAddrMap[name] = addr; addrDockScene->nameAddrSizeMap[name] = size; - size = getAdjustedSize(size, validMinSize); + int drawSize = getAdjustedSize(size, validMinSize); - QGraphicsRectItem *rect = new QGraphicsRectItem(rectOffset, y, rectWidth, size); + QGraphicsRectItem *rect = new QGraphicsRectItem(rectOffset, y, rectWidth, drawSize); rect->setBrush(QBrush(idx.data(Qt::DecorationRole).value())); addrDockScene->addItem(rect); - addTextItem(textColor, QPoint(0, y), QString("0x%1").arg(addr, 0, 16)); - addTextItem(textColor, QPoint(rectOffset, y), QString::number(size)); + addTextItem(textColor, QPoint(0, y), RAddressString(addr)); + addTextItem(textColor, QPoint(rectOffset, y), RSizeString(size)); addTextItem(textColor, QPoint(rectOffset + rectWidth, y), name); addrDockScene->namePosYMap[name] = y; - addrDockScene->nameHeightMap[name] = size; + addrDockScene->nameHeightMap[name] = drawSize; - y += size; + y += drawSize; } graphicsView->setSceneRect(addrDockScene->itemsBoundingRect()); @@ -488,7 +488,7 @@ RVA AddrDockScene::getAddrFromPos(int posY, bool seek) { QHash::const_iterator it; QHash addrMap = seek ? seekAddrMap : nameAddrMap; - QHash addrSizeMap = seek ? seekAddrSizeMap : nameAddrSizeMap; + QHash addrSizeMap = seek ? seekAddrSizeMap : nameAddrSizeMap; for (it = namePosYMap.constBegin(); it != namePosYMap.constEnd(); ++it) { QString name = it.key(); int y = it.value(); diff --git a/src/widgets/SectionsWidget.h b/src/widgets/SectionsWidget.h index 15429c6c..4ced8a00 100644 --- a/src/widgets/SectionsWidget.h +++ b/src/widgets/SectionsWidget.h @@ -159,9 +159,9 @@ public: bool disableCenterOn; QHash nameAddrMap; - QHash nameAddrSizeMap; + QHash nameAddrSizeMap; QHash seekAddrMap; - QHash seekAddrSizeMap; + QHash seekAddrSizeMap; QHash namePosYMap; QHash nameHeightMap;