From a6ded89c27c30ef44e52c570fbeda092ce5d7c9f Mon Sep 17 00:00:00 2001 From: Ryan Kurtz Date: Thu, 16 Jul 2026 13:35:05 -0400 Subject: [PATCH] GP-0: Certify --- .../bin/format/pe/DelayImportDescriptor.java | 22 +++++++++---------- 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/Ghidra/Features/Base/src/main/java/ghidra/app/util/bin/format/pe/DelayImportDescriptor.java b/Ghidra/Features/Base/src/main/java/ghidra/app/util/bin/format/pe/DelayImportDescriptor.java index 3d74b92c4f..1395a92c6c 100644 --- a/Ghidra/Features/Base/src/main/java/ghidra/app/util/bin/format/pe/DelayImportDescriptor.java +++ b/Ghidra/Features/Base/src/main/java/ghidra/app/util/bin/format/pe/DelayImportDescriptor.java @@ -85,18 +85,16 @@ public class DelayImportDescriptor implements StructConverter { return; } - // Warn if the INT and IAT declare different numbers of entries. - // These are parallel arrays so a length mismatch is malformed. - // The thunk lists include the trailing null terminator, so the - // import count is size() - 1. This only surfaces the discrepancy; - // it does not change import enumeration. - if (pIAT != 0 && pINT != 0 && thunksIAT.size() != thunksINT.size()) { - int intCount = Math.max(0, thunksINT.size() - 1); - int iatCount = Math.max(0, thunksIAT.size() - 1); - Msg.warn(this, "Delay-load INT/IAT import count mismatch for " + - (dllName != null ? dllName : "unknown DLL") + - ": INT=" + intCount + " IAT=" + iatCount); - } + // Warn if the INT and IAT declare different numbers of entries. These are parallel arrays + // so a length mismatch is malformed. The thunk lists include the trailing null terminator, + // so the import count is size() - 1. This only surfaces the discrepancy; it does not change + // import enumeration. + if (pIAT != 0 && pINT != 0 && thunksIAT.size() != thunksINT.size()) { + int intCount = Math.max(0, thunksINT.size() - 1); + int iatCount = Math.max(0, thunksIAT.size() - 1); + Msg.warn(this, "Delay-load INT/IAT import count mismatch for '%s': INT=%d IAT=%d" + .formatted(dllName != null ? dllName : "unknown DLL", intCount, iatCount)); + } thunksBoundIAT = readThunks(ntHeader, reader, pBoundIAT, false); if (thunksBoundIAT == null) {