From 9a8775e18bf4a347b0aad0e85c7bd82c5d7d31bb Mon Sep 17 00:00:00 2001 From: caheckman Date: Tue, 26 Mar 2019 16:31:28 -0400 Subject: [PATCH] Fix for GT-2708 --- .../app/decompiler/component/DecompilerHoverProvider.java | 5 +++-- .../ghidra/app/decompiler/component/DecompilerPanel.java | 7 +++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/Ghidra/Features/Decompiler/src/main/java/ghidra/app/decompiler/component/DecompilerHoverProvider.java b/Ghidra/Features/Decompiler/src/main/java/ghidra/app/decompiler/component/DecompilerHoverProvider.java index 0f54d60bcb..63f1cc7c67 100644 --- a/Ghidra/Features/Decompiler/src/main/java/ghidra/app/decompiler/component/DecompilerHoverProvider.java +++ b/Ghidra/Features/Decompiler/src/main/java/ghidra/app/decompiler/component/DecompilerHoverProvider.java @@ -76,8 +76,9 @@ public class DecompilerHoverProvider extends AbstractHoverProvider { Varnode vn = token.getVarnode(); if (vn != null) { - if (vn.getHigh() instanceof HighGlobal) { - reference = vn.getAddress(); + HighVariable highVar = vn.getHigh(); + if (highVar instanceof HighGlobal) { + reference = highVar.getRepresentative().getAddress(); } } diff --git a/Ghidra/Features/Decompiler/src/main/java/ghidra/app/decompiler/component/DecompilerPanel.java b/Ghidra/Features/Decompiler/src/main/java/ghidra/app/decompiler/component/DecompilerPanel.java index aed2123de5..4cc5528fb2 100644 --- a/Ghidra/Features/Decompiler/src/main/java/ghidra/app/decompiler/component/DecompilerPanel.java +++ b/Ghidra/Features/Decompiler/src/main/java/ghidra/app/decompiler/component/DecompilerPanel.java @@ -40,8 +40,7 @@ import ghidra.app.plugin.core.decompile.DecompileClipboardProvider; import ghidra.program.model.address.*; import ghidra.program.model.listing.Function; import ghidra.program.model.listing.Program; -import ghidra.program.model.pcode.PcodeOp; -import ghidra.program.model.pcode.Varnode; +import ghidra.program.model.pcode.*; import ghidra.program.util.ProgramLocation; import ghidra.program.util.ProgramSelection; import ghidra.util.*; @@ -419,6 +418,10 @@ public class DecompilerPanel extends JPanel implements FieldMouseListener, Field } } + HighVariable highVar = vn.getHigh(); + if (highVar instanceof HighGlobal) { + vn = highVar.getRepresentative(); + } if (vn.isAddress()) { Address addr = vn.getAddress(); if (addr.isMemoryAddress()) {