diff --git a/ghidra_scripts/UEFIHelper.java b/ghidra_scripts/UEFIHelper.java index ea40ef9..8ad165c 100644 --- a/ghidra_scripts/UEFIHelper.java +++ b/ghidra_scripts/UEFIHelper.java @@ -181,9 +181,11 @@ private void propagateGlobalVariables(ClangTokenGroup root) throws Exception { } } else { ClangFieldToken sourceToken = (ClangFieldToken) sourceNode; - Structure structureType = (Structure) sourceToken.getDataType(); - sourceDataType = structureType.getDataTypeAt( - sourceToken.getOffset()).getDataType(); + if (sourceToken instanceof Structure) { + Structure structureType = (Structure) sourceToken.getDataType(); + sourceDataType = structureType.getDataTypeAt( + sourceToken.getOffset()).getDataType(); + } } // Apply label names for certain global variables.