Update Rizin for defines

This commit is contained in:
Florian Märkl 2020-12-07 19:20:47 +01:00
parent 5218fa0fd6
commit 46f7a8e4f6
No known key found for this signature in database
GPG Key ID: 125BC8A5A6A1E857
5 changed files with 72 additions and 72 deletions

2
rizin

@ -1 +1 @@
Subproject commit 041d73dce38c277a17df1d513f7f3128c4323ba1
Subproject commit ad36954adbd607e9441130e0991c8027a015dd75

View File

@ -25,78 +25,78 @@ void Colors::colorizeAssembly(RichTextPainter::List &list, QString opcode, ut64
// Copied from RZ_API const char* r_print_color_op_type(RPrint *p, ut64 analysis_type) {
QString Colors::getColor(ut64 type)
{
switch (type & RZ_ANAL_OP_TYPE_MASK) {
case RZ_ANAL_OP_TYPE_NOP:
switch (type & RZ_ANALYSIS_OP_TYPE_MASK) {
case RZ_ANALYSIS_OP_TYPE_NOP:
return "nop";
case RZ_ANAL_OP_TYPE_ADD:
case RZ_ANAL_OP_TYPE_SUB:
case RZ_ANAL_OP_TYPE_MUL:
case RZ_ANAL_OP_TYPE_DIV:
case RZ_ANAL_OP_TYPE_MOD:
case RZ_ANAL_OP_TYPE_LENGTH:
case RZ_ANALYSIS_OP_TYPE_ADD:
case RZ_ANALYSIS_OP_TYPE_SUB:
case RZ_ANALYSIS_OP_TYPE_MUL:
case RZ_ANALYSIS_OP_TYPE_DIV:
case RZ_ANALYSIS_OP_TYPE_MOD:
case RZ_ANALYSIS_OP_TYPE_LENGTH:
return "math";
case RZ_ANAL_OP_TYPE_AND:
case RZ_ANAL_OP_TYPE_OR:
case RZ_ANAL_OP_TYPE_XOR:
case RZ_ANAL_OP_TYPE_NOT:
case RZ_ANAL_OP_TYPE_SHL:
case RZ_ANAL_OP_TYPE_SAL:
case RZ_ANAL_OP_TYPE_SAR:
case RZ_ANAL_OP_TYPE_SHR:
case RZ_ANAL_OP_TYPE_ROL:
case RZ_ANAL_OP_TYPE_ROR:
case RZ_ANAL_OP_TYPE_CPL:
case RZ_ANALYSIS_OP_TYPE_AND:
case RZ_ANALYSIS_OP_TYPE_OR:
case RZ_ANALYSIS_OP_TYPE_XOR:
case RZ_ANALYSIS_OP_TYPE_NOT:
case RZ_ANALYSIS_OP_TYPE_SHL:
case RZ_ANALYSIS_OP_TYPE_SAL:
case RZ_ANALYSIS_OP_TYPE_SAR:
case RZ_ANALYSIS_OP_TYPE_SHR:
case RZ_ANALYSIS_OP_TYPE_ROL:
case RZ_ANALYSIS_OP_TYPE_ROR:
case RZ_ANALYSIS_OP_TYPE_CPL:
return "bin";
case RZ_ANAL_OP_TYPE_IO:
case RZ_ANALYSIS_OP_TYPE_IO:
return "swi";
case RZ_ANAL_OP_TYPE_JMP:
case RZ_ANAL_OP_TYPE_UJMP:
case RZ_ANAL_OP_TYPE_IJMP:
case RZ_ANAL_OP_TYPE_RJMP:
case RZ_ANAL_OP_TYPE_IRJMP:
case RZ_ANAL_OP_TYPE_MJMP:
case RZ_ANALYSIS_OP_TYPE_JMP:
case RZ_ANALYSIS_OP_TYPE_UJMP:
case RZ_ANALYSIS_OP_TYPE_IJMP:
case RZ_ANALYSIS_OP_TYPE_RJMP:
case RZ_ANALYSIS_OP_TYPE_IRJMP:
case RZ_ANALYSIS_OP_TYPE_MJMP:
return "jmp";
case RZ_ANAL_OP_TYPE_CJMP:
case RZ_ANAL_OP_TYPE_UCJMP:
case RZ_ANAL_OP_TYPE_SWITCH:
case RZ_ANALYSIS_OP_TYPE_CJMP:
case RZ_ANALYSIS_OP_TYPE_UCJMP:
case RZ_ANALYSIS_OP_TYPE_SWITCH:
return "cjmp";
case RZ_ANAL_OP_TYPE_CMP:
case RZ_ANAL_OP_TYPE_ACMP:
case RZ_ANALYSIS_OP_TYPE_CMP:
case RZ_ANALYSIS_OP_TYPE_ACMP:
return "cmp";
case RZ_ANAL_OP_TYPE_UCALL:
case RZ_ANAL_OP_TYPE_ICALL:
case RZ_ANAL_OP_TYPE_RCALL:
case RZ_ANAL_OP_TYPE_IRCALL:
case RZ_ANAL_OP_TYPE_UCCALL:
case RZ_ANAL_OP_TYPE_CALL:
case RZ_ANAL_OP_TYPE_CCALL:
case RZ_ANALYSIS_OP_TYPE_UCALL:
case RZ_ANALYSIS_OP_TYPE_ICALL:
case RZ_ANALYSIS_OP_TYPE_RCALL:
case RZ_ANALYSIS_OP_TYPE_IRCALL:
case RZ_ANALYSIS_OP_TYPE_UCCALL:
case RZ_ANALYSIS_OP_TYPE_CALL:
case RZ_ANALYSIS_OP_TYPE_CCALL:
return "call";
case RZ_ANAL_OP_TYPE_NEW:
case RZ_ANAL_OP_TYPE_SWI:
case RZ_ANALYSIS_OP_TYPE_NEW:
case RZ_ANALYSIS_OP_TYPE_SWI:
return "swi";
case RZ_ANAL_OP_TYPE_ILL:
case RZ_ANAL_OP_TYPE_TRAP:
case RZ_ANALYSIS_OP_TYPE_ILL:
case RZ_ANALYSIS_OP_TYPE_TRAP:
return "trap";
case RZ_ANAL_OP_TYPE_CRET:
case RZ_ANAL_OP_TYPE_RET:
case RZ_ANALYSIS_OP_TYPE_CRET:
case RZ_ANALYSIS_OP_TYPE_RET:
return "ret";
case RZ_ANAL_OP_TYPE_CAST:
case RZ_ANAL_OP_TYPE_MOV:
case RZ_ANAL_OP_TYPE_LEA:
case RZ_ANAL_OP_TYPE_CMOV: // TODO: add cmov cathegory?
case RZ_ANALYSIS_OP_TYPE_CAST:
case RZ_ANALYSIS_OP_TYPE_MOV:
case RZ_ANALYSIS_OP_TYPE_LEA:
case RZ_ANALYSIS_OP_TYPE_CMOV: // TODO: add cmov cathegory?
return "mov";
case RZ_ANAL_OP_TYPE_PUSH:
case RZ_ANAL_OP_TYPE_UPUSH:
case RZ_ANAL_OP_TYPE_LOAD:
case RZ_ANALYSIS_OP_TYPE_PUSH:
case RZ_ANALYSIS_OP_TYPE_UPUSH:
case RZ_ANALYSIS_OP_TYPE_LOAD:
return "push";
case RZ_ANAL_OP_TYPE_POP:
case RZ_ANAL_OP_TYPE_STORE:
case RZ_ANALYSIS_OP_TYPE_POP:
case RZ_ANALYSIS_OP_TYPE_STORE:
return "pop";
case RZ_ANAL_OP_TYPE_CRYPTO:
case RZ_ANALYSIS_OP_TYPE_CRYPTO:
return "crypto";
case RZ_ANAL_OP_TYPE_NULL:
case RZ_ANALYSIS_OP_TYPE_NULL:
return "other";
case RZ_ANAL_OP_TYPE_UNK:
case RZ_ANALYSIS_OP_TYPE_UNK:
default:
return "invalid";
}

View File

@ -1403,7 +1403,7 @@ QJsonObject CutterCore::getAddrRefs(RVA addr, int depth) {
json["addr"] = QString::number(addr);
// Search for the section the addr is in, avoid duplication for heap/stack with type
if(!(type & RZ_ANAL_ADDR_TYPE_HEAP || type & RZ_ANAL_ADDR_TYPE_STACK)) {
if(!(type & RZ_ANALYSIS_ADDR_TYPE_HEAP || type & RZ_ANALYSIS_ADDR_TYPE_STACK)) {
// Attempt to find the address within a map
RzDebugMap *map = rz_debug_map_get(core->dbg, addr);
if (map && map->name && map->name[0]) {
@ -1433,28 +1433,28 @@ QJsonObject CutterCore::getAddrRefs(RVA addr, int depth) {
// Update type and permission information
if (type != 0) {
if (type & RZ_ANAL_ADDR_TYPE_HEAP) {
if (type & RZ_ANALYSIS_ADDR_TYPE_HEAP) {
json["type"] = "heap";
} else if (type & RZ_ANAL_ADDR_TYPE_STACK) {
} else if (type & RZ_ANALYSIS_ADDR_TYPE_STACK) {
json["type"] = "stack";
} else if (type & RZ_ANAL_ADDR_TYPE_PROGRAM) {
} else if (type & RZ_ANALYSIS_ADDR_TYPE_PROGRAM) {
json["type"] = "program";
} else if (type & RZ_ANAL_ADDR_TYPE_LIBRARY) {
} else if (type & RZ_ANALYSIS_ADDR_TYPE_LIBRARY) {
json["type"] = "library";
} else if (type & RZ_ANAL_ADDR_TYPE_ASCII) {
} else if (type & RZ_ANALYSIS_ADDR_TYPE_ASCII) {
json["type"] = "ascii";
} else if (type & RZ_ANAL_ADDR_TYPE_SEQUENCE) {
} else if (type & RZ_ANALYSIS_ADDR_TYPE_SEQUENCE) {
json["type"] = "sequence";
}
QString perms = "";
if (type & RZ_ANAL_ADDR_TYPE_READ) {
if (type & RZ_ANALYSIS_ADDR_TYPE_READ) {
perms += "r";
}
if (type & RZ_ANAL_ADDR_TYPE_WRITE) {
if (type & RZ_ANALYSIS_ADDR_TYPE_WRITE) {
perms += "w";
}
if (type & RZ_ANAL_ADDR_TYPE_EXEC) {
if (type & RZ_ANALYSIS_ADDR_TYPE_EXEC) {
RzAsmOp op;
buf.resize(32);
perms += "x";
@ -1471,7 +1471,7 @@ QJsonObject CutterCore::getAddrRefs(RVA addr, int depth) {
}
// Try to telescope further if depth permits it
if ((type & RZ_ANAL_ADDR_TYPE_READ) && !(type & RZ_ANAL_ADDR_TYPE_EXEC)) {
if ((type & RZ_ANALYSIS_ADDR_TYPE_READ) && !(type & RZ_ANALYSIS_ADDR_TYPE_EXEC)) {
buf.resize(64);
ut32 *n32 = (ut32 *)buf.data();
ut64 *n64 = (ut64 *)buf.data();
@ -3112,7 +3112,7 @@ bool CutterCore::getAnalMethod(const QString &cls, const QString &meth, AnalMeth
{
CORE_LOCK();
RzAnalysisMethod analMeth;
if (rz_analysis_class_method_get(core->analysis, cls.toUtf8().constData(), meth.toUtf8().constData(), &analMeth) != RZ_ANAL_CLASS_ERR_SUCCESS) {
if (rz_analysis_class_method_get(core->analysis, cls.toUtf8().constData(), meth.toUtf8().constData(), &analMeth) != RZ_ANALYSIS_CLASS_ERR_SUCCESS) {
return false;
}
desc->name = QString::fromUtf8(analMeth.name);

View File

@ -605,7 +605,7 @@ ClassesWidget::Source ClassesWidget::getSource()
case 0:
return Source::BIN;
default:
return Source::ANAL;
return Source::ANALYSIS;
}
}
@ -622,7 +622,7 @@ void ClassesWidget::refreshClasses()
}
bin_model->setClasses(Core()->getAllClassesFromBin());
break;
case Source::ANAL:
case Source::ANALYSIS:
if (!analysis_model) {
proxy_model->setSourceModel(nullptr);
delete bin_model;

View File

@ -193,7 +193,7 @@ private slots:
void refreshClasses();
private:
enum class Source { BIN, ANAL };
enum class Source { BIN, ANALYSIS };
Source getSource();