Let DisassemblyContextMenu get an entity address from addr if offset is not present

On 16-bit x86 binaries, the JSON output of the command `anj` returns
the function address in "addr", not in "offset"
This commit is contained in:
Alberto Marnetto
2026-01-28 21:54:39 +01:00
committed by pancake
parent f1f01e5d1a
commit 3ea6674dfc

View File

@@ -437,7 +437,12 @@ QVector<DisassemblyContextMenu::ThingUsedHere> DisassemblyContextMenu::getThingU
result.reserve(array.size());
for (const auto &thing : array) {
auto obj = thing.toObject();
RVA offset = obj["offset"].toVariant().toULongLong();
RVA offset = 0;
if (obj.contains("offset")) {
offset = obj["offset"].toVariant().toULongLong();
} else if (obj.contains("addr")) {
offset = obj["addr"].toVariant().toULongLong();
}
QString name;
// If real names display is enabled, show flag's real name instead of