Fix Jump Tables (Fix #574)

This commit is contained in:
Florian Märkl 2018-09-20 13:27:24 +02:00
parent 9527df8502
commit f6955e4eab
2 changed files with 15 additions and 1 deletions

View File

@ -1253,7 +1253,6 @@ void CutterCore::setSettings()
setConfig("anal.hasnext", false);
setConfig("asm.lines.call", false);
setConfig("anal.autoname", true);
setConfig("anal.jmptbl", false);
setConfig("cfg.fortunes.tts", false);

View File

@ -233,6 +233,21 @@ void DisassemblerGraphView::loadCurrentGraph()
}
gb.exits.push_back(block_jump);
}
QJsonObject switchOp = block["switchop"].toObject();
if (!switchOp.isEmpty()) {
QJsonArray caseArray = switchOp["cases"].toArray();
for (QJsonValue caseOpValue : caseArray) {
QJsonObject caseOp = caseOpValue.toObject();
bool ok;
RVA caseJump = caseOp["jump"].toVariant().toULongLong(&ok);
if (!ok) {
continue;
}
gb.exits.push_back(caseJump);
}
}
QJsonArray opArray = block["ops"].toArray();
for (int opIndex = 0; opIndex < opArray.size(); opIndex++) {
QJsonObject op = opArray[opIndex].toObject();