Fix Cutter/Rizin API naming (#2755)

This commit is contained in:
Anton Kochkov 2021-09-14 21:32:04 +08:00 committed by GitHub
parent 417a0a2221
commit 80e4269ca3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
50 changed files with 173 additions and 173 deletions

View File

@ -686,13 +686,13 @@ bool CutterCore::mapFile(QString path, RVA mapaddr)
void CutterCore::renameFunction(const RVA offset, const QString &newName)
{
cmdRaw("afn " + newName + " " + RAddressString(offset));
cmdRaw("afn " + newName + " " + RzAddressString(offset));
emit functionRenamed(offset, newName);
}
void CutterCore::delFunction(RVA addr)
{
cmdRaw("af- " + RAddressString(addr));
cmdRaw("af- " + RzAddressString(addr));
emit functionsChanged();
}
@ -728,7 +728,7 @@ void CutterCore::delFlag(const QString &name)
QString CutterCore::getInstructionBytes(RVA addr)
{
return cmdj("aoj @ " + RAddressString(addr))
return cmdj("aoj @ " + RzAddressString(addr))
.array()
.first()
.toObject()[RJsonKey::bytes]
@ -737,7 +737,7 @@ QString CutterCore::getInstructionBytes(RVA addr)
QString CutterCore::getInstructionOpcode(RVA addr)
{
return cmdj("aoj @ " + RAddressString(addr))
return cmdj("aoj @ " + RzAddressString(addr))
.array()
.first()
.toObject()[RJsonKey::opcode]
@ -1364,7 +1364,7 @@ RefDescription CutterCore::formatRefDesc(QJsonObject refItem)
break;
}
if (!refItem["value"].isNull()) {
appendVar(desc.ref, RAddressString(refItem["value"].toVariant().toULongLong()), " ",
appendVar(desc.ref, RzAddressString(refItem["value"].toVariant().toULongLong()), " ",
"");
}
refItem = refItem["ref"].toObject();
@ -1579,7 +1579,7 @@ QVector<Chunk> CutterCore::getHeapChunks(RVA arena_addr)
RzList *chunks = rz_heap_chunks_list(core, m_arena);
RzListIter *iter;
RzHeapChunkListItem *data;
CutterRListForeach(chunks, iter, RzHeapChunkListItem, data)
CutterRzListForeach(chunks, iter, RzHeapChunkListItem, data)
{
Chunk chunk;
chunk.offset = data->addr;
@ -1607,7 +1607,7 @@ QVector<Arena> CutterCore::getArenas()
RzList *arenas = rz_heap_arenas_list(core);
RzListIter *iter;
RzArenaListItem *data;
CutterRListForeach(arenas, iter, RzArenaListItem, data)
CutterRzListForeach(arenas, iter, RzArenaListItem, data)
{
Arena arena;
arena.offset = data->addr;
@ -1669,7 +1669,7 @@ QVector<RzHeapBin *> CutterCore::getHeapBins(ut64 arena_addr)
RzList *tcache_bins = rz_heap_tcache_content(core, arena_addr);
RzListIter *iter;
RzHeapBin *bin;
CutterRListForeach(tcache_bins, iter, RzHeapBin, bin)
CutterRzListForeach(tcache_bins, iter, RzHeapBin, bin)
{
if (!bin) {
continue;
@ -2458,7 +2458,7 @@ void CutterCore::updateBreakpoint(int index, const BreakpointDescription &config
void CutterCore::delBreakpoint(RVA addr)
{
cmdRaw("db- " + RAddressString(addr));
cmdRaw("db- " + RzAddressString(addr));
emit breakpointsChanged(addr);
}
@ -2470,13 +2470,13 @@ void CutterCore::delAllBreakpoints()
void CutterCore::enableBreakpoint(RVA addr)
{
cmdRaw("dbe " + RAddressString(addr));
cmdRaw("dbe " + RzAddressString(addr));
emit breakpointsChanged(addr);
}
void CutterCore::disableBreakpoint(RVA addr)
{
cmdRaw("dbd " + RAddressString(addr));
cmdRaw("dbd " + RzAddressString(addr));
emit breakpointsChanged(addr);
}
@ -2685,7 +2685,7 @@ QList<RVA> CutterCore::getSeekHistory()
RzListIter *it;
RzCoreSeekItem *undo;
RzList *list = rz_core_seek_list(core);
CutterRListForeach(list, it, RzCoreSeekItem, undo) { ret << undo->offset; }
CutterRzListForeach(list, it, RzCoreSeekItem, undo) { ret << undo->offset; }
return ret;
}
@ -2697,7 +2697,7 @@ QStringList CutterCore::getAsmPluginNames()
QStringList ret;
RzAsmPlugin *ap;
CutterRListForeach(core->rasm->plugins, it, RzAsmPlugin, ap) { ret << ap->name; }
CutterRzListForeach(core->rasm->plugins, it, RzAsmPlugin, ap) { ret << ap->name; }
return ret;
}
@ -2709,7 +2709,7 @@ QStringList CutterCore::getAnalPluginNames()
QStringList ret;
RzAnalysisPlugin *ap;
CutterRListForeach(core->analysis->plugins, it, RzAnalysisPlugin, ap) { ret << ap->name; }
CutterRzListForeach(core->analysis->plugins, it, RzAnalysisPlugin, ap) { ret << ap->name; }
return ret;
}
@ -2792,7 +2792,7 @@ QList<RzAsmPluginDescription> CutterCore::getRAsmPluginDescriptions()
QList<RzAsmPluginDescription> ret;
RzAsmPlugin *ap;
CutterRListForeach(core->rasm->plugins, it, RzAsmPlugin, ap)
CutterRzListForeach(core->rasm->plugins, it, RzAsmPlugin, ap)
{
RzAsmPluginDescription plugin;
@ -2819,7 +2819,7 @@ QList<FunctionDescription> CutterCore::getAllFunctions()
RzListIter *iter;
RzAnalysisFunction *fcn;
CutterRListForeach(core->analysis->fcns, iter, RzAnalysisFunction, fcn)
CutterRzListForeach(core->analysis->fcns, iter, RzAnalysisFunction, fcn)
{
FunctionDescription function;
function.offset = fcn->addr;
@ -2900,7 +2900,7 @@ QList<SymbolDescription> CutterCore::getAllSymbols()
RzBinSymbol *bs;
if (core && core->bin && core->bin->cur && core->bin->cur->o) {
CutterRListForeach(core->bin->cur->o->symbols, it, RzBinSymbol, bs)
CutterRzListForeach(core->bin->cur->o->symbols, it, RzBinSymbol, bs)
{
QString type = QString(bs->bind) + " " + QString(bs->type);
SymbolDescription symbol;
@ -2914,7 +2914,7 @@ QList<SymbolDescription> CutterCore::getAllSymbols()
/* list entrypoints as symbols too */
int n = 0;
RzBinAddr *entry;
CutterRListForeach(core->bin->cur->o->entries, it, RzBinAddr, entry)
CutterRzListForeach(core->bin->cur->o->entries, it, RzBinAddr, entry)
{
SymbolDescription symbol;
symbol.vaddr = entry->vaddr;
@ -3335,7 +3335,7 @@ QList<AnalMethodDescription> CutterCore::getAnalClassMethods(const QString &cls)
ret.reserve(static_cast<int>(meths->len));
RzAnalysisMethod *meth;
CutterRVectorForeach(meths, meth, RzAnalysisMethod)
CutterRzVectorForeach(meths, meth, RzAnalysisMethod)
{
AnalMethodDescription desc;
desc.name = QString::fromUtf8(meth->name);
@ -3360,7 +3360,7 @@ QList<AnalBaseClassDescription> CutterCore::getAnalClassBaseClasses(const QStrin
ret.reserve(static_cast<int>(bases->len));
RzAnalysisBaseClass *base;
CutterRVectorForeach(bases, base, RzAnalysisBaseClass)
CutterRzVectorForeach(bases, base, RzAnalysisBaseClass)
{
AnalBaseClassDescription desc;
desc.id = QString::fromUtf8(base->id);
@ -3385,7 +3385,7 @@ QList<AnalVTableDescription> CutterCore::getAnalClassVTables(const QString &cls)
acVtables.reserve(static_cast<int>(vtables->len));
RzAnalysisVTable *vtable;
CutterRVectorForeach(vtables, vtable, RzAnalysisVTable)
CutterRzVectorForeach(vtables, vtable, RzAnalysisVTable)
{
AnalVTableDescription desc;
desc.id = QString::fromUtf8(vtable->id);
@ -3528,7 +3528,7 @@ QList<TypeDescription> CutterCore::getBaseType(RzBaseTypeKind kind, const char *
RzBaseType *type;
RzListIter *iter;
CutterRListForeach (ts, iter, RzBaseType, type) {
CutterRzListForeach (ts, iter, RzBaseType, type) {
TypeDescription exp;
exp.type = type->name;
@ -3739,9 +3739,9 @@ QList<XrefDescription> CutterCore::getXRefsForVariable(QString variableName, boo
xref.from = addr;
xref.to = addr;
if (findWrites) {
xref.from_str = RAddressString(addr);
xref.from_str = RzAddressString(addr);
} else {
xref.to_str = RAddressString(addr);
xref.to_str = RzAddressString(addr);
}
xrefList << xref;
}
@ -3775,14 +3775,14 @@ QList<XrefDescription> CutterCore::getXRefs(RVA addr, bool to, bool whole_functi
xref.from = xrefObject[RJsonKey::from].toVariant().toULongLong();
if (!to) {
xref.from_str = RAddressString(xref.from);
xref.from_str = RzAddressString(xref.from);
} else {
QString fcn = xrefObject[RJsonKey::fcn_name].toString();
if (!fcn.isEmpty()) {
RVA fcnAddr = xrefObject[RJsonKey::fcn_addr].toVariant().toULongLong();
xref.from_str = fcn + " + 0x" + QString::number(xref.from - fcnAddr, 16);
} else {
xref.from_str = RAddressString(xref.from);
xref.from_str = RzAddressString(xref.from);
}
}

View File

@ -15,11 +15,11 @@
#endif // Q_OS_WIN
// Rizin list iteration macros
#define CutterRListForeach(list, it, type, x) \
#define CutterRzListForeach(list, it, type, x) \
if (list) \
for (it = list->head; it && ((x = static_cast<type *>(it->data))); it = it->n)
#define CutterRVectorForeach(vec, it, type) \
#define CutterRzVectorForeach(vec, it, type) \
if ((vec) && (vec)->a) \
for (it = (type *)(vec)->a; \
(char *)it != (char *)(vec)->a + ((vec)->len * (vec)->elem_size); \
@ -44,17 +44,17 @@ typedef ut64 RVA;
*/
#define RVA_INVALID RVA_MAX
inline QString RAddressString(RVA addr)
inline QString RzAddressString(RVA addr)
{
return QString::asprintf("%#010llx", addr);
}
inline QString RSizeString(RVA size)
inline QString RzSizeString(RVA size)
{
return QString::asprintf("%#llx", size);
}
inline QString RHexString(RVA size)
inline QString RzHexString(RVA size)
{
return QString::asprintf("%#llx", size);
}

View File

@ -619,7 +619,7 @@ bool MainWindow::openProject(const QString &file)
const char *s = rz_project_err_message(err);
QString msg = tr("Failed to open project: %1").arg(QString::fromUtf8(s));
RzListIter *it;
CutterRListForeach(res, it, const char, s) { msg += "\n" + QString::fromUtf8(s); }
CutterRzListForeach(res, it, const char, s) { msg += "\n" + QString::fromUtf8(s); }
QMessageBox::critical(this, tr("Open Project"), msg);
rz_list_free(res);
return false;
@ -1134,7 +1134,7 @@ void MainWindow::updateHistoryMenu(QMenu *menu, bool redo)
bool history = true;
QList<QAction *> actions;
CutterRListForeach(list, it, RzCoreSeekItem, undo) {
CutterRzListForeach(list, it, RzCoreSeekItem, undo) {
RzFlagItem *f = rz_flag_get_at(core->flags, undo->offset, true);
char *fname = NULL;
if (f) {
@ -1151,7 +1151,7 @@ void MainWindow::updateHistoryMenu(QMenu *menu, bool redo)
history = false;
}
if (history != redo || current) { // Include current in both directions
QString addressString = RAddressString(offset);
QString addressString = RzAddressString(offset);
QString toolTip =
QString("%1 %2").arg(addressString, name); // show non truncated name in tooltip

View File

@ -5,18 +5,18 @@ ArenaInfoDialog::ArenaInfoDialog(Arena &arena, QWidget *parent)
: arena(arena), QDialog(parent), ui(new Ui::ArenaInfoDialog)
{
ui->setupUi(this);
setWindowTitle("Arena @ " + RAddressString(arena.offset));
setWindowTitle("Arena @ " + RzAddressString(arena.offset));
updateContents();
}
void ArenaInfoDialog::updateContents()
{
ui->lineEditTop->setText(RAddressString(arena.top));
ui->lineEditLastRem->setText(RAddressString(arena.last_remainder));
ui->lineEditNext->setText(RAddressString(arena.next));
ui->lineEditNextfree->setText(RAddressString(arena.next_free));
ui->lineEditSysMem->setText(RAddressString(arena.system_mem));
ui->lineEditMaxMem->setText(RAddressString(arena.max_system_mem));
ui->lineEditTop->setText(RzAddressString(arena.top));
ui->lineEditLastRem->setText(RzAddressString(arena.last_remainder));
ui->lineEditNext->setText(RzAddressString(arena.next));
ui->lineEditNextfree->setText(RzAddressString(arena.next_free));
ui->lineEditSysMem->setText(RzAddressString(arena.system_mem));
ui->lineEditMaxMem->setText(RzAddressString(arena.max_system_mem));
}
ArenaInfoDialog::~ArenaInfoDialog()

View File

@ -67,7 +67,7 @@ BreakpointsDialog::BreakpointsDialog(const BreakpointDescription &breakpoint, QW
{
switch (breakpoint.type) {
case BreakpointDescription::Address:
ui->breakpointPosition->setText(RAddressString(breakpoint.addr));
ui->breakpointPosition->setText(RzAddressString(breakpoint.addr));
break;
case BreakpointDescription::Named:
ui->breakpointPosition->setText(breakpoint.positionExpression);
@ -102,7 +102,7 @@ BreakpointsDialog::BreakpointsDialog(RVA address, QWidget *parent)
: BreakpointsDialog(false, parent)
{
if (address != RVA_INVALID) {
ui->breakpointPosition->setText(RAddressString(address));
ui->breakpointPosition->setText(RzAddressString(address));
}
refreshOkButton();
}

View File

@ -40,9 +40,9 @@ void CommentsDialog::addOrEditComment(RVA offset, QWidget *parent)
CommentsDialog c(parent);
if (oldComment.isNull() || oldComment.isEmpty()) {
c.setWindowTitle(tr("Add Comment at %1").arg(RAddressString(offset)));
c.setWindowTitle(tr("Add Comment at %1").arg(RzAddressString(offset)));
} else {
c.setWindowTitle(tr("Edit Comment at %1").arg(RAddressString(offset)));
c.setWindowTitle(tr("Edit Comment at %1").arg(RzAddressString(offset)));
}
c.setComment(oldComment);

View File

@ -89,7 +89,7 @@ void EditMethodDialog::setClass(const QString &className)
void EditMethodDialog::setMethod(const AnalMethodDescription &desc)
{
ui->nameEdit->setText(desc.name);
ui->addressEdit->setText(desc.addr != RVA_INVALID ? RAddressString(desc.addr) : nullptr);
ui->addressEdit->setText(desc.addr != RVA_INVALID ? RzAddressString(desc.addr) : nullptr);
if (desc.vtableOffset >= 0) {
ui->virtualCheckBox->setChecked(true);

View File

@ -21,9 +21,9 @@ FlagDialog::FlagDialog(RVA offset, QWidget *parent)
ui->sizeEdit->setValidator(size_validator);
if (flag) {
ui->nameEdit->setText(flag->name);
ui->labelAction->setText(tr("Edit flag at %1").arg(RAddressString(offset)));
ui->labelAction->setText(tr("Edit flag at %1").arg(RzAddressString(offset)));
} else {
ui->labelAction->setText(tr("Add flag at %1").arg(RAddressString(offset)));
ui->labelAction->setText(tr("Add flag at %1").arg(RzAddressString(offset)));
}
// Connect slots

View File

@ -25,7 +25,7 @@ GlibcHeapBinsDialog::GlibcHeapBinsDialog(RVA m_state, MainWindow *main, QWidget
binsModel->reload();
ui->viewBins->resizeColumnsToContents();
graphView = nullptr;
this->setWindowTitle(tr("Bins info for arena @ ") + RAddressString(m_state));
this->setWindowTitle(tr("Bins info for arena @ ") + RzAddressString(m_state));
}
GlibcHeapBinsDialog::~GlibcHeapBinsDialog()
@ -49,9 +49,9 @@ void GlibcHeapBinsDialog::setChainInfo(int index)
RzHeapChunkListItem *item;
RzList *chunks = binsModel->getChunks(index);
QString chainInfo;
CutterRListForeach(chunks, iter, RzHeapChunkListItem, item)
CutterRzListForeach(chunks, iter, RzHeapChunkListItem, item)
{
chainInfo += "" + RAddressString(item->addr);
chainInfo += "" + RzAddressString(item->addr);
}
// Add bin message at the end of the list
@ -127,15 +127,15 @@ QVariant BinsModel::data(const QModelIndex &index, int role) const
case BinNumColumn:
return item->bin_num;
case FdColumn:
return (item->fd == 0) ? tr("N/A") : RAddressString(item->fd);
return (item->fd == 0) ? tr("N/A") : RzAddressString(item->fd);
case BkColumn:
return (item->bk == 0) ? tr("N/A") : RAddressString(item->bk);
return (item->bk == 0) ? tr("N/A") : RzAddressString(item->bk);
case TypeColumn:
return tr(item->type);
case CountColumn:
return rz_list_length(item->chunks);
case SizeColumn:
return (item->size == 0) ? tr("N/A") : RHexString(item->size);
return (item->size == 0) ? tr("N/A") : RzHexString(item->size);
default:
return QVariant();
}

View File

@ -9,7 +9,7 @@ GlibcHeapInfoDialog::GlibcHeapInfoDialog(RVA offset, QString status, QWidget *pa
ui->setupUi(this);
// set window title
QString windowTitle = tr("Chunk @ ") + RAddressString(offset);
QString windowTitle = tr("Chunk @ ") + RzAddressString(offset);
if (!this->status.isEmpty()) {
windowTitle += QString("(" + this->status + ")");
}
@ -34,13 +34,13 @@ void GlibcHeapInfoDialog::updateFields()
}
// Update the information in the widget
this->ui->baseEdit->setText(RAddressString(offset));
this->ui->sizeEdit->setText(RHexString(chunk->size));
this->ui->bkEdit->setText(RAddressString(chunk->bk));
this->ui->fdEdit->setText(RAddressString(chunk->fd));
this->ui->bknsEdit->setText(RAddressString(chunk->bk_nextsize));
this->ui->fdnsEdit->setText(RAddressString(chunk->fd_nextsize));
this->ui->prevSizeEdit->setText(RHexString(chunk->prev_size));
this->ui->baseEdit->setText(RzAddressString(offset));
this->ui->sizeEdit->setText(RzHexString(chunk->size));
this->ui->bkEdit->setText(RzAddressString(chunk->bk));
this->ui->fdEdit->setText(RzAddressString(chunk->fd));
this->ui->bknsEdit->setText(RzAddressString(chunk->bk_nextsize));
this->ui->fdnsEdit->setText(RzAddressString(chunk->fd_nextsize));
this->ui->prevSizeEdit->setText(RzHexString(chunk->prev_size));
if (chunk->is_mmapped) {
this->ui->rbIM->setChecked(true);
} else {

View File

@ -176,7 +176,7 @@ void InitialOptionsDialog::loadOptions(const InitialOptions &options)
}
if (options.binLoadAddr != RVA_INVALID) {
ui->entry_loadOffset->setText(RAddressString(options.binLoadAddr));
ui->entry_loadOffset->setText(RzAddressString(options.binLoadAddr));
}
ui->writeCheckBox->setChecked(options.writeEnabled);

View File

@ -100,7 +100,7 @@ void LinkTypeDialog::on_exprLineEdit_textChanged(const QString &text)
{
RVA addr = Core()->math(text);
if (Core()->isAddressMapped(addr)) {
ui->addressLineEdit->setText(RAddressString(addr));
ui->addressLineEdit->setText(RzAddressString(addr));
addrValid = true;
} else {
ui->addressLineEdit->setText(tr("Invalid Address"));

View File

@ -10,7 +10,7 @@ SetToDataDialog::SetToDataDialog(RVA startAddr, QWidget *parent)
validator->setBottom(1);
ui->sizeEdit->setValidator(validator);
ui->repeatEdit->setValidator(validator);
ui->startAddrLabel->setText(RAddressString(startAddr));
ui->startAddrLabel->setText(RzAddressString(startAddr));
updateEndAddress();
}
@ -32,7 +32,7 @@ int SetToDataDialog::getItemCount()
void SetToDataDialog::updateEndAddress()
{
RVA endAddr = startAddress + (getItemSize() * getItemCount());
ui->endAddrLabel->setText(RAddressString(endAddr));
ui->endAddrLabel->setText(RzAddressString(endAddr));
}
void SetToDataDialog::on_sizeEdit_textChanged(const QString &arg1)

View File

@ -43,12 +43,12 @@ void VersionInfoDialog::fillVersionInfo()
QTreeWidgetItem *addrItemL = new QTreeWidgetItem();
addrItemL->setText(0, "Address:");
addrItemL->setText(1, RAddressString(versym["address"].toDouble()));
addrItemL->setText(1, RzAddressString(versym["address"].toDouble()));
ui->leftTreeWidget->addTopLevelItem(addrItemL);
QTreeWidgetItem *offItemL = new QTreeWidgetItem();
offItemL->setText(0, "Offset:");
offItemL->setText(1, RAddressString(versym["offset"].toDouble()));
offItemL->setText(1, RzAddressString(versym["offset"].toDouble()));
ui->leftTreeWidget->addTopLevelItem(offItemL);
QTreeWidgetItem *linkItemL = new QTreeWidgetItem();
@ -66,7 +66,7 @@ void VersionInfoDialog::fillVersionInfo()
for (QJsonValue val : versym["entries"].toArray()) {
QJsonObject obj = val.toObject();
QTreeWidgetItem *tempItem = new QTreeWidgetItem();
tempItem->setText(0, RAddressString(obj["idx"].toDouble()));
tempItem->setText(0, RzAddressString(obj["idx"].toDouble()));
tempItem->setText(1, obj["value"].toString());
entriesItemL->addChild(tempItem);
}
@ -83,12 +83,12 @@ void VersionInfoDialog::fillVersionInfo()
QTreeWidgetItem *addrItemR = new QTreeWidgetItem();
addrItemR->setText(0, "Address:");
addrItemR->setText(1, RAddressString(verneed["address"].toDouble()));
addrItemR->setText(1, RzAddressString(verneed["address"].toDouble()));
ui->rightTreeWidget->addTopLevelItem(addrItemR);
QTreeWidgetItem *offItemR = new QTreeWidgetItem();
offItemR->setText(0, "Offset:");
offItemR->setText(1, RAddressString(verneed["offset"].toDouble()));
offItemR->setText(1, RzAddressString(verneed["offset"].toDouble()));
ui->rightTreeWidget->addTopLevelItem(offItemR);
QTreeWidgetItem *linkItemR = new QTreeWidgetItem();
@ -107,7 +107,7 @@ void VersionInfoDialog::fillVersionInfo()
QJsonObject parentObj = parentVal.toObject();
QTreeWidgetItem *parentItem = new QTreeWidgetItem();
QString parentString;
parentItem->setText(0, RAddressString(parentObj["idx"].toDouble()));
parentItem->setText(0, RzAddressString(parentObj["idx"].toDouble()));
parentString.append("Version: " + QString::number(parentObj["vn_version"].toDouble())
+ "\t");
parentString.append("File: " + parentObj["file_name"].toString());
@ -117,7 +117,7 @@ void VersionInfoDialog::fillVersionInfo()
QJsonObject childObj = childVal.toObject();
QTreeWidgetItem *childItem = new QTreeWidgetItem();
QString childString;
childItem->setText(0, RAddressString(childObj["idx"].toDouble()));
childItem->setText(0, RzAddressString(childObj["idx"].toDouble()));
childString.append("Name: " + childObj["name"].toString() + "\t");
childString.append("Flags: " + childObj["flags"].toString() + "\t");
childString.append("Version: " + QString::number(childObj["version"].toDouble()));
@ -147,7 +147,7 @@ void VersionInfoDialog::fillVersionInfo()
QTreeWidgetItem *tempItem = new QTreeWidgetItem();
tempItem->setText(0, key);
if (vs[key].isDouble())
tempItem->setText(1, RHexString(vs[key].toDouble()));
tempItem->setText(1, RzHexString(vs[key].toDouble()));
else
tempItem->setText(1, vs[key].toString());
ui->leftTreeWidget->addTopLevelItem(tempItem);

View File

@ -136,7 +136,7 @@ void XrefsDialog::updatePreview(RVA addr)
ui->previewTextEdit->document()->setHtml(disas);
// Does it make any sense?
ui->previewTextEdit->find(normalizeAddr(RAddressString(addr)), QTextDocument::FindBackward);
ui->previewTextEdit->find(normalizeAddr(RzAddressString(addr)), QTextDocument::FindBackward);
ui->previewTextEdit->moveCursor(QTextCursor::StartOfLine, QTextCursor::MoveAnchor);
}

View File

@ -76,7 +76,7 @@ void AddressableItemContextMenu::clearTarget()
void AddressableItemContextMenu::onActionCopyAddress()
{
auto clipboard = QApplication::clipboard();
clipboard->setText(RAddressString(offset));
clipboard->setText(RzAddressString(offset));
}
void AddressableItemContextMenu::onActionShowXrefs()
@ -85,7 +85,7 @@ void AddressableItemContextMenu::onActionShowXrefs()
XrefsDialog dialog(mainWindow, true);
QString tmpName = name;
if (name.isEmpty()) {
name = RAddressString(offset);
name = RzAddressString(offset);
}
dialog.fillRefsForAddress(offset, name, wholeFunction);
dialog.exec();

View File

@ -108,7 +108,7 @@ void DecompilerContextMenu::setupBreakpointsInLineMenu()
{
breakpointsInLineMenu->clear();
for (auto curOffset : this->availableBreakpoints) {
QAction *action = breakpointsInLineMenu->addAction(RAddressString(curOffset));
QAction *action = breakpointsInLineMenu->addAction(RzAddressString(curOffset));
connect(action, &QAction::triggered, this, [this, curOffset] {
BreakpointsDialog::editBreakpoint(Core()->getBreakpointAt(curOffset), this);
});
@ -218,7 +218,7 @@ void DecompilerContextMenu::aboutToShowSlot()
}
}
actionCopyInstructionAddress.setText(
tr("Copy instruction address (%1)").arg(RAddressString(offset)));
tr("Copy instruction address (%1)").arg(RzAddressString(offset)));
if (isReference()) {
actionCopyReferenceAddress.setVisible(true);
RVA referenceAddr = annotationHere->reference.offset;
@ -226,14 +226,14 @@ void DecompilerContextMenu::aboutToShowSlot()
if (annotationHere->type == RZ_CODE_ANNOTATION_TYPE_FUNCTION_NAME) {
actionCopyReferenceAddress.setText(tr("Copy address of %1 (%2)")
.arg(QString(annotationHere->reference.name),
RAddressString(referenceAddr)));
RzAddressString(referenceAddr)));
} else if (flagDetails) {
actionCopyReferenceAddress.setText(
tr("Copy address of %1 (%2)")
.arg(flagDetails->name, RAddressString(referenceAddr)));
.arg(flagDetails->name, RzAddressString(referenceAddr)));
} else {
actionCopyReferenceAddress.setText(
tr("Copy address (%1)").arg(RAddressString(referenceAddr)));
tr("Copy address (%1)").arg(RzAddressString(referenceAddr)));
}
} else {
actionXRefs.setVisible(false);
@ -371,13 +371,13 @@ void DecompilerContextMenu::actionCopyTriggered()
void DecompilerContextMenu::actionCopyInstructionAddressTriggered()
{
QClipboard *clipboard = QApplication::clipboard();
clipboard->setText(RAddressString(offset));
clipboard->setText(RzAddressString(offset));
}
void DecompilerContextMenu::actionCopyReferenceAddressTriggered()
{
QClipboard *clipboard = QApplication::clipboard();
clipboard->setText(RAddressString(annotationHere->reference.offset));
clipboard->setText(RzAddressString(annotationHere->reference.offset));
}
void DecompilerContextMenu::actionAddCommentTriggered()
@ -404,7 +404,7 @@ void DecompilerContextMenu::actionRenameThingHereTriggered()
RzAnalysisFunction *func = Core()->functionAt(func_addr);
if (func == NULL) {
QString function_name = QInputDialog::getText(
this, tr("Define this function at %2").arg(RAddressString(func_addr)),
this, tr("Define this function at %2").arg(RzAddressString(func_addr)),
tr("Function name:"), QLineEdit::Normal, currentName, &ok);
if (ok && !function_name.isEmpty()) {
Core()->createFunctionAt(func_addr, function_name);
@ -483,7 +483,7 @@ void DecompilerContextMenu::actionXRefsTriggered()
XrefsDialog dialog(mainWindow);
QString displayString = (annotationHere->type == RZ_CODE_ANNOTATION_TYPE_FUNCTION_NAME)
? QString(annotationHere->reference.name)
: RAddressString(annotationHere->reference.offset);
: RzAddressString(annotationHere->reference.offset);
dialog.fillRefsForAddress(annotationHere->reference.offset, displayString, false);
dialog.exec();
}
@ -519,13 +519,13 @@ void DecompilerContextMenu::actionAdvancedBreakpointTriggered()
void DecompilerContextMenu::actionContinueUntilTriggered()
{
Core()->continueUntilDebug(RAddressString(offset));
Core()->continueUntilDebug(RzAddressString(offset));
}
void DecompilerContextMenu::actionSetPCTriggered()
{
QString progCounterName = Core()->getRegisterName("PC");
Core()->setRegister(progCounterName, RAddressString(offset).toUpper());
Core()->setRegister(progCounterName, RzAddressString(offset).toUpper());
}
// Set up menus
@ -574,13 +574,13 @@ void DecompilerContextMenu::updateTargetMenuActions()
if (flagDetails) {
name = tr("Show %1 in").arg(flagDetails->name);
} else {
name = tr("Show %1 in").arg(RAddressString(annotationHere->reference.offset));
name = tr("Show %1 in").arg(RzAddressString(annotationHere->reference.offset));
}
} else if (annotationHere->type == RZ_CODE_ANNOTATION_TYPE_FUNCTION_NAME) {
menu = mainWindow->createShowInMenu(this, annotationHere->reference.offset,
MainWindow::AddressTypeHint::Function);
name = tr("%1 (%2)").arg(QString(annotationHere->reference.name),
RAddressString(annotationHere->reference.offset));
RzAddressString(annotationHere->reference.offset));
}
auto action = new QAction(name, this);
showTargetMenuActions.append(action);

View File

@ -409,7 +409,7 @@ void DisassemblyContextMenu::buildRenameMenu(ThingUsedHere *tuh)
actionDeleteFlag.setVisible(false);
if (tuh->type == ThingUsedHere::Type::Address) {
doRenameAction = RENAME_ADD_FLAG;
doRenameInfo.name = RAddressString(tuh->offset);
doRenameInfo.name = RzAddressString(tuh->offset);
doRenameInfo.addr = tuh->offset;
actionRename.setText(tr("Add flag at %1 (used here)").arg(doRenameInfo.name));
} else if (tuh->type == ThingUsedHere::Type::Function) {
@ -698,7 +698,7 @@ void DisassemblyContextMenu::on_actionEditInstruction_triggered()
return;
}
EditInstructionDialog e(EDIT_TEXT, this);
e.setWindowTitle(tr("Edit Instruction at %1").arg(RAddressString(offset)));
e.setWindowTitle(tr("Edit Instruction at %1").arg(RzAddressString(offset)));
QString oldInstructionOpcode = Core()->getInstructionOpcode(offset);
QString oldInstructionBytes = Core()->getInstructionBytes(offset);
@ -725,7 +725,7 @@ void DisassemblyContextMenu::showReverseJmpQuery()
{
QString type;
QJsonArray array = Core()->cmdj("pdj 1 @ " + RAddressString(offset)).array();
QJsonArray array = Core()->cmdj("pdj 1 @ " + RzAddressString(offset)).array();
if (array.isEmpty()) {
return;
}
@ -752,7 +752,7 @@ void DisassemblyContextMenu::on_actionEditBytes_triggered()
return;
}
EditInstructionDialog e(EDIT_BYTES, this);
e.setWindowTitle(tr("Edit Bytes at %1").arg(RAddressString(offset)));
e.setWindowTitle(tr("Edit Bytes at %1").arg(RzAddressString(offset)));
QString oldBytes = Core()->getInstructionBytes(offset);
e.setInstruction(oldBytes);
@ -773,7 +773,7 @@ void DisassemblyContextMenu::on_actionCopy_triggered()
void DisassemblyContextMenu::on_actionCopyAddr_triggered()
{
QClipboard *clipboard = QApplication::clipboard();
clipboard->setText(RAddressString(offset));
clipboard->setText(RzAddressString(offset));
}
void DisassemblyContextMenu::on_actionAddBreakpoint_triggered()
@ -793,13 +793,13 @@ void DisassemblyContextMenu::on_actionAdvancedBreakpoint_triggered()
void DisassemblyContextMenu::on_actionContinueUntil_triggered()
{
Core()->continueUntilDebug(RAddressString(offset));
Core()->continueUntilDebug(RzAddressString(offset));
}
void DisassemblyContextMenu::on_actionSetPC_triggered()
{
QString progCounterName = Core()->getRegisterName("PC");
Core()->setRegister(progCounterName, RAddressString(offset).toUpper());
Core()->setRegister(progCounterName, RzAddressString(offset).toUpper());
}
void DisassemblyContextMenu::on_actionAddComment_triggered()
@ -823,7 +823,7 @@ void DisassemblyContextMenu::on_actionAnalyzeFunction_triggered()
// Create dialog
QString functionName =
QInputDialog::getText(this, tr("New function at %1").arg(RAddressString(offset)),
QInputDialog::getText(this, tr("New function at %1").arg(RzAddressString(offset)),
tr("Function name:"), QLineEdit::Normal, name, &ok);
// If user accepted
@ -887,7 +887,7 @@ void DisassemblyContextMenu::on_actionSetFunctionVarTypes_triggered()
void DisassemblyContextMenu::on_actionXRefs_triggered()
{
XrefsDialog dialog(mainWindow);
dialog.fillRefsForAddress(offset, RAddressString(offset), false);
dialog.fillRefsForAddress(offset, RzAddressString(offset), false);
dialog.exec();
}
@ -990,7 +990,7 @@ void DisassemblyContextMenu::on_actionLinkType_triggered()
{
LinkTypeDialog dialog(mainWindow);
if (!dialog.setDefaultAddress(curHighlightedWord)) {
dialog.setDefaultAddress(RAddressString(offset));
dialog.setDefaultAddress(RzAddressString(offset));
}
dialog.exec();
}

View File

@ -48,8 +48,8 @@ void BacktraceWidget::setBacktraceGrid()
int i = 0;
for (const QJsonValue &value : backtraceValues) {
QJsonObject backtraceItem = value.toObject();
QString progCounter = RAddressString(backtraceItem["pc"].toVariant().toULongLong());
QString stackPointer = RAddressString(backtraceItem["sp"].toVariant().toULongLong());
QString progCounter = RzAddressString(backtraceItem["pc"].toVariant().toULongLong());
QString stackPointer = RzAddressString(backtraceItem["sp"].toVariant().toULongLong());
int frameSize = backtraceItem["frame_size"].toVariant().toInt();
QString funcName = backtraceItem["fname"].toString();
QString desc = backtraceItem["desc"].toString();

View File

@ -55,7 +55,7 @@ QVariant BreakpointModel::data(const QModelIndex &index, int role) const
case Qt::DisplayRole:
switch (index.column()) {
case AddrColumn:
return RAddressString(breakpoint.addr);
return RzAddressString(breakpoint.addr);
case NameColumn:
return breakpoint.name;
case TypeColumn:

View File

@ -45,7 +45,7 @@ void CallGraphView::showExportDialog()
if (global) {
defaultName = "global_callgraph";
} else {
defaultName = QString("callgraph_%1").arg(RAddressString(address));
defaultName = QString("callgraph_%1").arg(RzAddressString(address));
}
showExportGraphDialog(defaultName, global ? "agC" : "agc", address);
}
@ -115,7 +115,7 @@ void CallGraphView::loadCurrentGraph()
}
}
if (blockContent.empty() && !global) {
addBlock({}, RAddressString(address), address);
addBlock({}, RzAddressString(address), address);
}
addressMapping.clear();

View File

@ -120,7 +120,7 @@ QVariant BinClassesModel::data(const QModelIndex &index, int role) const
case TYPE:
return tr("method");
case OFFSET:
return meth->addr == RVA_INVALID ? QString() : RAddressString(meth->addr);
return meth->addr == RVA_INVALID ? QString() : RzAddressString(meth->addr);
case VTABLE:
return meth->vtableOffset < 0 ? QString() : QString("+%1").arg(meth->vtableOffset);
default:
@ -144,7 +144,7 @@ QVariant BinClassesModel::data(const QModelIndex &index, int role) const
case TYPE:
return tr("field");
case OFFSET:
return field->addr == RVA_INVALID ? QString() : RAddressString(field->addr);
return field->addr == RVA_INVALID ? QString() : RzAddressString(field->addr);
default:
return QVariant();
}
@ -186,9 +186,9 @@ QVariant BinClassesModel::data(const QModelIndex &index, int role) const
case TYPE:
return tr("class");
case OFFSET:
return cls->addr == RVA_INVALID ? QString() : RAddressString(cls->addr);
return cls->addr == RVA_INVALID ? QString() : RzAddressString(cls->addr);
case VTABLE:
return cls->vtableAddr == RVA_INVALID ? QString() : RAddressString(cls->vtableAddr);
return cls->vtableAddr == RVA_INVALID ? QString() : RzAddressString(cls->vtableAddr);
default:
return QVariant();
}
@ -457,7 +457,7 @@ QVariant AnalClassesModel::data(const QModelIndex &index, int role) const
case TYPE:
return tr("method");
case OFFSET:
return meth.addr == RVA_INVALID ? QString() : RAddressString(meth.addr);
return meth.addr == RVA_INVALID ? QString() : RzAddressString(meth.addr);
case VTABLE:
return meth.vtableOffset < 0 ? QString()
: QString("+%1").arg(meth.vtableOffset);
@ -493,7 +493,7 @@ QVariant AnalClassesModel::data(const QModelIndex &index, int role) const
case TYPE:
return tr("vtable");
case OFFSET:
return RAddressString(vtable.addr);
return RzAddressString(vtable.addr);
default:
return QVariant();
}

View File

@ -114,7 +114,7 @@ QVariant CommentsModel::data(const QModelIndex &index, int role) const
if (isSubnode) {
switch (index.column()) {
case OffsetNestedColumn:
return RAddressString(comment.offset);
return RzAddressString(comment.offset);
case CommentNestedColumn:
return comment.name;
default:
@ -126,7 +126,7 @@ QVariant CommentsModel::data(const QModelIndex &index, int role) const
} else {
switch (index.column()) {
case CommentsModel::OffsetColumn:
return RAddressString(comment.offset);
return RzAddressString(comment.offset);
case CommentsModel::FunctionColumn:
return Core()->cmdFunctionAt(comment.offset);
case CommentsModel::CommentColumn:

View File

@ -223,7 +223,7 @@ void ConsoleWidget::executeCommand(const QString &command)
}
ui->rzInputLineEdit->setEnabled(false);
QString cmd_line = "[" + RAddressString(Core()->getOffset()) + "]> " + command;
QString cmd_line = "[" + RzAddressString(Core()->getOffset()) + "]> " + command;
addOutput(cmd_line);
RVA oldOffset = Core()->getOffset();

View File

@ -62,7 +62,7 @@ void Dashboard::updateContents()
setPlainText(this->ui->relroEdit, "N/A");
}
setPlainText(this->ui->baddrEdit, RAddressString(item2["baddr"].toVariant().toULongLong()));
setPlainText(this->ui->baddrEdit, RzAddressString(item2["baddr"].toVariant().toULongLong()));
// set booleans
setBool(this->ui->vaEdit, item2, "va");

View File

@ -179,7 +179,7 @@ void DisassemblerGraphView::loadCurrentGraph()
RzAnalysisFunction *fcn = Core()->functionIn(seekable->getOffset());
if (fcn) {
currentFcnAddr = fcn->addr;
QJsonDocument functionsDoc = Core()->cmdj("agJ " + RAddressString(fcn->addr));
QJsonDocument functionsDoc = Core()->cmdj("agJ " + RzAddressString(fcn->addr));
functions = functionsDoc.array();
}
@ -236,7 +236,7 @@ void DisassemblerGraphView::loadCurrentGraph()
db.entry = block_entry;
if (Config()->getGraphBlockEntryOffset()) {
// QColor(0,0,0,0) is transparent
db.header_text = Text("[" + RAddressString(db.entry) + "]", ConfigColor("offset"),
db.header_text = Text("[" + RzAddressString(db.entry) + "]", ConfigColor("offset"),
QColor(0, 0, 0, 0));
}
db.true_path = RVA_INVALID;

View File

@ -29,7 +29,7 @@ void EntrypointWidget::fillEntrypoint()
ui->entrypointTreeWidget->clear();
for (const EntrypointDescription &i : Core()->getAllEntrypoint()) {
QTreeWidgetItem *item = new QTreeWidgetItem();
item->setText(0, RAddressString(i.vaddr));
item->setText(0, RzAddressString(i.vaddr));
item->setText(1, i.type);
item->setData(0, Qt::UserRole, QVariant::fromValue(i));
ui->entrypointTreeWidget->addTopLevelItem(item);

View File

@ -32,9 +32,9 @@ QVariant ExportsModel::data(const QModelIndex &index, int role) const
case Qt::DisplayRole:
switch (index.column()) {
case ExportsModel::OffsetColumn:
return RAddressString(exp.vaddr);
return RzAddressString(exp.vaddr);
case ExportsModel::SizeColumn:
return RSizeString(exp.size);
return RzSizeString(exp.size);
case ExportsModel::TypeColumn:
return exp.type;
case ExportsModel::NameColumn:

View File

@ -36,9 +36,9 @@ QVariant FlagsModel::data(const QModelIndex &index, int role) const
case Qt::DisplayRole:
switch (index.column()) {
case SIZE:
return RSizeString(flag.size);
return RzSizeString(flag.size);
case OFFSET:
return RAddressString(flag.offset);
return RzAddressString(flag.offset);
case NAME:
return flag.name;
case REALNAME:

View File

@ -130,18 +130,18 @@ QVariant FunctionModel::data(const QModelIndex &index, int role) const
if (subnode) {
switch (index.row()) {
case 0:
return tr("Offset: %1").arg(RAddressString(function.offset));
return tr("Offset: %1").arg(RzAddressString(function.offset));
case 1:
return tr("Size: %1").arg(RSizeString(function.linearSize));
return tr("Size: %1").arg(RzSizeString(function.linearSize));
case 2:
return tr("Import: %1")
.arg(functionIsImport(function.offset) ? tr("true") : tr("false"));
case 3:
return tr("Nargs: %1").arg(RSizeString(function.nargs));
return tr("Nargs: %1").arg(RzSizeString(function.nargs));
case 4:
return tr("Nbbs: %1").arg(RSizeString(function.nbbs));
return tr("Nbbs: %1").arg(RzSizeString(function.nbbs));
case 5:
return tr("Nlocals: %1").arg(RSizeString(function.nlocals));
return tr("Nlocals: %1").arg(RzSizeString(function.nlocals));
case 6:
return tr("Call type: %1").arg(function.calltype);
case 7:
@ -164,7 +164,7 @@ QVariant FunctionModel::data(const QModelIndex &index, int role) const
case ImportColumn:
return functionIsImport(function.offset) ? tr("true") : tr("false");
case OffsetColumn:
return RAddressString(function.offset);
return RzAddressString(function.offset);
case NargsColumn:
return QString::number(function.nargs);
case NlocalsColumn:

View File

@ -66,7 +66,7 @@ void GlibcHeapWidget::updateArenas()
// add the new arenas to the arena selector
for (auto &arena : arenas) {
arenaSelectorView->addItem(RAddressString(arena.offset)
arenaSelectorView->addItem(RzAddressString(arena.offset)
+ QString(" (" + arena.type + " Arena)"));
}
@ -138,9 +138,9 @@ QVariant GlibcHeapModel::data(const QModelIndex &index, int role) const
case Qt::DisplayRole:
switch (index.column()) {
case OffsetColumn:
return RAddressString(item.offset);
return RzAddressString(item.offset);
case SizeColumn:
return RHexString(item.size);
return RzHexString(item.size);
case StatusColumn:
return item.status;
default:

View File

@ -29,7 +29,7 @@ QVariant HeadersModel::data(const QModelIndex &index, int role) const
case Qt::DisplayRole:
switch (index.column()) {
case OffsetColumn:
return RAddressString(header.vaddr);
return RzAddressString(header.vaddr);
case NameColumn:
return header.name;
case ValueColumn:

View File

@ -36,7 +36,7 @@ void HeapBinsGraphView::loadCurrentGraph()
|| QString(heapBin->type) == QString("Tcache");
// store info about the chunks in a vector for easy access
CutterRListForeach(heapBin->chunks, iter, RzHeapChunkListItem, item)
CutterRzListForeach(heapBin->chunks, iter, RzHeapChunkListItem, item)
{
GraphHeapChunk graphHeapChunk;
graphHeapChunk.addr = item->addr;
@ -44,12 +44,12 @@ void HeapBinsGraphView::loadCurrentGraph()
if (!chunkInfo) {
break;
}
QString content = "Chunk @ " + RAddressString(chunkInfo->addr) + "\nSize: "
+ RHexString(chunkInfo->size) + "\nFd: " + RAddressString(chunkInfo->fd);
QString content = "Chunk @ " + RzAddressString(chunkInfo->addr) + "\nSize: "
+ RzHexString(chunkInfo->size) + "\nFd: " + RzAddressString(chunkInfo->fd);
// fastbins lack bk pointer
if (!singleLinkedBin) {
content += "\nBk: " + RAddressString(chunkInfo->bk);
content += "\nBk: " + RzAddressString(chunkInfo->bk);
}
graphHeapChunk.fd = chunkInfo->fd;
graphHeapChunk.bk = chunkInfo->bk;
@ -79,9 +79,9 @@ void HeapBinsGraphView::display_single_linked_list(QVector<GraphHeapChunk> chunk
gbBin.edges.emplace_back(heapBin->fd);
QString content = tr(heapBin->type) + tr("bin ") + QString::number(heapBin->bin_num);
if (tcache) {
content += "\nEntry: " + RAddressString(heapBin->fd);
content += "\nEntry: " + RzAddressString(heapBin->fd);
} else {
content += "\nFd: " + RAddressString(heapBin->fd);
content += "\nFd: " + RzAddressString(heapBin->fd);
}
addBlock(gbBin, content);
@ -120,9 +120,9 @@ void HeapBinsGraphView::display_double_linked_list(QVector<GraphHeapChunk> chunk
gbBin.edges.emplace_back(heapBin->fd);
gbBin.edges.emplace_back(heapBin->bk);
QString content = tr(heapBin->type) + tr("bin ") + QString::number(heapBin->bin_num) + tr(" @ ")
+ RAddressString(heapBin->addr);
content += "\nFd: " + RAddressString(heapBin->fd);
content += "\nBk: " + RAddressString(heapBin->bk);
+ RzAddressString(heapBin->addr);
content += "\nFd: " + RzAddressString(heapBin->fd);
content += "\nBk: " + RzAddressString(heapBin->bk);
addBlock(gbBin, content, heapBin->addr);

View File

@ -682,7 +682,7 @@ void HexWidget::copyAddress()
addr = selection.start();
}
QClipboard *clipboard = QApplication::clipboard();
clipboard->setText(RAddressString(addr));
clipboard->setText(RzAddressString(addr));
}
void HexWidget::onRangeDialogAccepted()

View File

@ -38,7 +38,7 @@ QVariant ImportsModel::data(const QModelIndex &index, int role) const
case Qt::DisplayRole:
switch (index.column()) {
case ImportsModel::AddressColumn:
return RAddressString(import.plt);
return RzAddressString(import.plt);
case ImportsModel::TypeColumn:
return import.type;
case ImportsModel::SafetyColumn:

View File

@ -30,9 +30,9 @@ QVariant MemoryMapModel::data(const QModelIndex &index, int role) const
case Qt::DisplayRole:
switch (index.column()) {
case AddrStartColumn:
return RAddressString(memoryMap.addrStart);
return RzAddressString(memoryMap.addrStart);
case AddrEndColumn:
return RAddressString(memoryMap.addrEnd);
return RzAddressString(memoryMap.addrEnd);
case NameColumn:
return memoryMap.name;
case PermColumn:

View File

@ -189,7 +189,7 @@ void RegisterRefsWidget::refreshRegisterRef()
for (const QJsonObject &reg : regRefs) {
RegisterRefDescription desc;
desc.value = RAddressString(reg["value"].toVariant().toULongLong());
desc.value = RzAddressString(reg["value"].toVariant().toULongLong());
desc.reg = reg["name"].toVariant().toString();
desc.refDesc = Core()->formatRefDesc(reg["ref"].toObject());

View File

@ -25,7 +25,7 @@ QVariant RelocsModel::data(const QModelIndex &index, int role) const
case Qt::DisplayRole:
switch (index.column()) {
case RelocsModel::VAddrColumn:
return RAddressString(reloc.vaddr);
return RzAddressString(reloc.vaddr);
case RelocsModel::TypeColumn:
return reloc.type;
case RelocsModel::NameColumn:

View File

@ -29,7 +29,7 @@ QVariant ResourcesModel::data(const QModelIndex &index, int role) const
case NAME:
return res.name;
case VADDR:
return RAddressString(res.vaddr);
return RzAddressString(res.vaddr);
case INDEX:
return QString::number(res.index);
case TYPE:

View File

@ -57,9 +57,9 @@ QVariant SearchModel::data(const QModelIndex &index, int role) const
case Qt::DisplayRole:
switch (index.column()) {
case OFFSET:
return RAddressString(exp.offset);
return RzAddressString(exp.offset);
case SIZE:
return RSizeString(exp.size);
return RzSizeString(exp.size);
case CODE:
return exp.code;
case DATA:

View File

@ -57,13 +57,13 @@ QVariant SectionsModel::data(const QModelIndex &index, int role) const
case SectionsModel::NameColumn:
return section.name;
case SectionsModel::SizeColumn:
return RSizeString(section.size);
return RzSizeString(section.size);
case SectionsModel::AddressColumn:
return RAddressString(section.vaddr);
return RzAddressString(section.vaddr);
case SectionsModel::EndAddressColumn:
return RAddressString(section.vaddr + section.vsize);
return RzAddressString(section.vaddr + section.vsize);
case SectionsModel::VirtualSizeColumn:
return RSizeString(section.vsize);
return RzSizeString(section.vsize);
case SectionsModel::PermissionsColumn:
return section.perm;
case SectionsModel::EntropyColumn:
@ -368,8 +368,8 @@ void AbstractAddrDock::updateDock()
rect->setBrush(QBrush(idx.data(Qt::DecorationRole).value<QColor>()));
addrDockScene->addItem(rect);
addTextItem(textColor, QPoint(0, y), RAddressString(addr));
addTextItem(textColor, QPoint(rectOffset, y), RSizeString(size));
addTextItem(textColor, QPoint(0, y), RzAddressString(addr));
addTextItem(textColor, QPoint(rectOffset, y), RzSizeString(size));
addTextItem(textColor, QPoint(rectOffset + rectWidth, y), name);
addrDockScene->namePosYMap[name] = y;
@ -458,7 +458,7 @@ void AddrDockScene::mousePressEvent(QGraphicsSceneMouseEvent *event)
{
RVA addr = getAddrFromPos((int)event->scenePos().y(), false);
if (addr != RVA_INVALID) {
QToolTip::showText(event->screenPos(), RAddressString(addr));
QToolTip::showText(event->screenPos(), RzAddressString(addr));
if (event->buttons() & Qt::LeftButton) {
RVA seekAddr = getAddrFromPos((int)event->scenePos().y(), true);
disableCenterOn = true;

View File

@ -51,9 +51,9 @@ QVariant SegmentsModel::data(const QModelIndex &index, int role) const
case SegmentsModel::SizeColumn:
return QString::number(segment.size);
case SegmentsModel::AddressColumn:
return RAddressString(segment.vaddr);
return RzAddressString(segment.vaddr);
case SegmentsModel::EndAddressColumn:
return RAddressString(segment.vaddr + segment.size);
return RzAddressString(segment.vaddr + segment.size);
case SegmentsModel::PermColumn:
return segment.perm;
case SegmentsModel::CommentColumn:

View File

@ -222,7 +222,7 @@ void SimpleTextGraphView::blockHelpEvent(GraphView::GraphBlock &block, QHelpEven
QPoint /*pos*/)
{
if (haveAddresses) {
QToolTip::showText(event->globalPos(), RAddressString(blockContent[block.entry].address));
QToolTip::showText(event->globalPos(), RzAddressString(blockContent[block.entry].address));
}
}

View File

@ -153,7 +153,7 @@ void StackModel::reload()
Item item;
item.offset = stackItem["addr"].toVariant().toULongLong();
item.value = RAddressString(stackItem["value"].toVariant().toULongLong());
item.value = RzAddressString(stackItem["value"].toVariant().toULongLong());
item.refDesc = Core()->formatRefDesc(stackItem["ref"].toObject());
values.push_back(item);
@ -182,7 +182,7 @@ QVariant StackModel::data(const QModelIndex &index, int role) const
case Qt::DisplayRole:
switch (index.column()) {
case OffsetColumn:
return RAddressString(item.offset);
return RzAddressString(item.offset);
case ValueColumn:
return item.value;
case DescriptionColumn:

View File

@ -35,7 +35,7 @@ QVariant StringsModel::data(const QModelIndex &index, int role) const
case Qt::DisplayRole:
switch (index.column()) {
case StringsModel::OffsetColumn:
return RAddressString(str.vaddr);
return RzAddressString(str.vaddr);
case StringsModel::StringColumn:
return str.string;
case StringsModel::TypeColumn:

View File

@ -32,7 +32,7 @@ QVariant SymbolsModel::data(const QModelIndex &index, int role) const
case Qt::DisplayRole:
switch (index.column()) {
case SymbolsModel::AddressColumn:
return RAddressString(symbol.vaddr);
return RzAddressString(symbol.vaddr);
case SymbolsModel::TypeColumn:
return QString("%1 %2").arg(symbol.bind, symbol.type).trimmed();
case SymbolsModel::NameColumn:

View File

@ -336,7 +336,7 @@ void TypesWidget::on_actionLink_Type_To_Address_triggered()
if (index.isValid()) {
TypeDescription t = index.data(TypesModel::TypeDescriptionRole).value<TypeDescription>();
dialog.setDefaultType(t.type);
dialog.setDefaultAddress(RAddressString(Core()->getOffset()));
dialog.setDefaultAddress(RzAddressString(Core()->getOffset()));
dialog.exec();
}
}

View File

@ -47,7 +47,7 @@ QVariant VTableModel::data(const QModelIndex &index, int role) const
case NAME:
return res.name;
case ADDRESS:
return RAddressString(res.addr);
return RzAddressString(res.addr);
}
break;
case VTableDescriptionRole:
@ -62,7 +62,7 @@ QVariant VTableModel::data(const QModelIndex &index, int role) const
case NAME:
return tr("VTable") + " " + QString::number(index.row() + 1);
case ADDRESS:
return RAddressString(vtables->at(index.row()).addr);
return RzAddressString(vtables->at(index.row()).addr);
}
break;
case VTableDescriptionRole: {

View File

@ -297,7 +297,7 @@ QList<QString> VisualNavbar::sectionsForAddress(RVA address)
QString VisualNavbar::toolTipForAddress(RVA address)
{
QString ret = "Address: " + RAddressString(address);
QString ret = "Address: " + RzAddressString(address);
// Don't append sections when a debug task is in progress to avoid freezing the interface
if (Core()->isDebugTaskInProgress()) {

View File

@ -29,7 +29,7 @@ QVariant ZignaturesModel::data(const QModelIndex &index, int role) const
case Qt::DisplayRole:
switch (index.column()) {
case OffsetColumn:
return RAddressString(zignature.offset);
return RzAddressString(zignature.offset);
case NameColumn:
return zignature.name;
case ValueColumn:
@ -42,10 +42,10 @@ QVariant ZignaturesModel::data(const QModelIndex &index, int role) const
return QVariant::fromValue(zignature);
case Qt::ToolTipRole: {
QString tmp = QString("Graph:\n\n Cyclomatic complexity: " + RSizeString(zignature.cc)
+ "\n Nodes / basicblocks: " + RSizeString(zignature.nbbs)
+ "\n Edges: " + RSizeString(zignature.edges)
+ "\n Ebbs: " + RSizeString(zignature.ebbs) + "\n\nRefs:\n");
QString tmp = QString("Graph:\n\n Cyclomatic complexity: " + RzSizeString(zignature.cc)
+ "\n Nodes / basicblocks: " + RzSizeString(zignature.nbbs)
+ "\n Edges: " + RzSizeString(zignature.edges)
+ "\n Ebbs: " + RzSizeString(zignature.ebbs) + "\n\nRefs:\n");
for (const QString &ref : zignature.refs) {
tmp.append("\n " + ref);
}