From 6bb33b0025265b9145c70563b937fe158729e5dc Mon Sep 17 00:00:00 2001 From: Ryan Kurtz Date: Thu, 18 Sep 2025 12:40:28 -0400 Subject: [PATCH 1/2] GP-6005: The Windows build can now use prerelease versions of Visual Studio with the new -PvswherePrerelease arg --- GPL/vsconfig.gradle | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/GPL/vsconfig.gradle b/GPL/vsconfig.gradle index 610aa08313..9821653a43 100644 --- a/GPL/vsconfig.gradle +++ b/GPL/vsconfig.gradle @@ -34,7 +34,7 @@ def configureVisualStudio() { println " -> To manually specify the location of vswhere.exe, add \"-PvswherePath=\" to the Gradle command line arguments" return } - def vswhereProcess = "\"${vswherePath}\" -products * -latest -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -format json -utf8".execute() + def vswhereProcess = "\"${vswherePath}\" -products * -sort -prerelease -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -format json -utf8".execute() def vswhereOutput = vswhereProcess.text.trim() def vswhereExit = vswhereProcess.exitValue() if (vswhereExit != 0) { @@ -49,11 +49,27 @@ def configureVisualStudio() { return } def vswhereJson = new groovy.json.JsonSlurper().parseText(vswhereOutput); - if (vswhereJson.isEmpty()) { + def usePrerelease = project.hasProperty("vswherePrerelease") + def i = -1 + println " -> Searching for Visual Studio installations..." + vswhereJson.eachWithIndex { item, index -> + def isPrerelease = item.get("isPrerelease") + def name = item.get("displayName") + (isPrerelease ? " Prerelease" : "") + if (i == -1) { + if (usePrerelease || !isPrerelease) { + i = index + } + } + println " ${index + 1}: ${name}" + + (i == index ? " (selected)" : "") + + (isPrerelease && !usePrerelease ? " (enable with -PvswherePrerelease)" : "") + } + if (i == -1) { println " -> Visual Studio not found!" return } - def vsInstallDir = vswhereJson[0].installationPath + + def vsInstallDir = vswhereJson[i].installationPath println " -> Installation Directory: ${vsInstallDir}" // Use vcvarsall.bat to determine the latest Visual Studio's default SDK and tool versions From cae8caac1436d4c98bbd825e83c0fbecbda9a7da Mon Sep 17 00:00:00 2001 From: ghidra1 Date: Thu, 25 Sep 2025 13:03:49 -0400 Subject: [PATCH 2/2] GP-5526 Correct CreateThunkCmd NPE --- .../app/cmd/function/CreateThunkFunctionCmd.java | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/Ghidra/Features/Base/src/main/java/ghidra/app/cmd/function/CreateThunkFunctionCmd.java b/Ghidra/Features/Base/src/main/java/ghidra/app/cmd/function/CreateThunkFunctionCmd.java index 1743a23304..52278eb741 100644 --- a/Ghidra/Features/Base/src/main/java/ghidra/app/cmd/function/CreateThunkFunctionCmd.java +++ b/Ghidra/Features/Base/src/main/java/ghidra/app/cmd/function/CreateThunkFunctionCmd.java @@ -563,14 +563,15 @@ public class CreateThunkFunctionCmd extends BackgroundCommand { Listing listing = program.getListing(); Instruction instr = listing.getInstructionAt(entry); - if (instr == null) { - return null; - } + // if there is no pcode, go to the next instruction // assume fallthrough (ie. x86 instruction ENDBR64) // TODO: at some point, might need to do a NOP detection - if (instr.getPcode().length == 0) { - instr = listing.getInstructionAfter(entry); + while (instr != null && instr.getPcode().length == 0) { + instr = listing.getInstructionAfter(instr.getAddress()); + } + if (instr == null) { + return null; } FlowType flowType;