mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-03 17:59:46 +02:00
Merge remote-tracking branch 'origin/Ghidra_12.0'
This commit is contained in:
commit
5ceb49b11f
2 changed files with 25 additions and 8 deletions
|
@ -34,7 +34,7 @@ def configureVisualStudio() {
|
|||
println " -> To manually specify the location of vswhere.exe, add \"-PvswherePath=<vswhere path>\" 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
|
||||
|
|
|
@ -563,14 +563,15 @@ public class CreateThunkFunctionCmd extends BackgroundCommand<Program> {
|
|||
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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue