diff --git a/Ghidra/Debug/Debugger-agent-gdb/data/debugger-launchers/ssh-gdb.ps1 b/Ghidra/Debug/Debugger-agent-gdb/data/debugger-launchers/ssh-gdb.ps1 index 9900c4a0ab..cc6474cde5 100644 --- a/Ghidra/Debug/Debugger-agent-gdb/data/debugger-launchers/ssh-gdb.ps1 +++ b/Ghidra/Debug/Debugger-agent-gdb/data/debugger-launchers/ssh-gdb.ps1 @@ -57,14 +57,14 @@ are copied and installed. NOTE: Automatic resolution will cause this session to terminate. When it has finished, try launching again. -"@ "Would you like to install 'ghidragdb==$version'?" +"@ "Would you like to install 'ghidragdb>=$version'?" if ($answer) { Write-Host "Copying Wheels to $Env:OPT_HOST" Mitigate-Scp-PyModules "Debug/Debugger-rmi-trace" "Debug/Debugger-agent-gdb" Write-Host "Installing Wheels into GDB's embedded Python" - $arglist = Compute-Gdb-PipInstall-Args "'-f'" "os.environ['HOME']" "'ghidragdb==$version'" + $arglist = Compute-Gdb-PipInstall-Args "'-f'" "os.environ['HOME']" "'ghidragdb>=$version'" $sshargs = Compute-Ssh-Args $arglist False Start-Process -FilePath $sshargs[0] -ArgumentList $sshargs[1..$sshargs.Count] -NoNewWindow -Wait } diff --git a/Ghidra/Debug/Debugger-agent-gdb/data/debugger-launchers/ssh-gdb.sh b/Ghidra/Debug/Debugger-agent-gdb/data/debugger-launchers/ssh-gdb.sh index 17977f17ed..070feab61d 100755 --- a/Ghidra/Debug/Debugger-agent-gdb/data/debugger-launchers/ssh-gdb.sh +++ b/Ghidra/Debug/Debugger-agent-gdb/data/debugger-launchers/ssh-gdb.sh @@ -57,7 +57,7 @@ version=$(get-ghidra-version) function do-installation() { local -a pipargs - compute-gdb-pipinstall-args "'-f'" "os.environ['HOME']" "'ghidragdb==$version'" + compute-gdb-pipinstall-args "'-f'" "os.environ['HOME']" "'ghidragdb>=$version'" local -a sshargs compute-ssh-args false "${pipargs[@]}" @@ -90,7 +90,7 @@ are copied and installed. NOTE: Automatic resolution will cause this session to terminate. When it has finished, try launching again. -" "Would you like to install 'ghidragdb==$version'?"; then +" "Would you like to install 'ghidragdb>=$version'?"; then echo "Copying Wheels to $OPT_HOST" mitigate-scp-pymodules "Debug/Debugger-rmi-trace" "Debug/Debugger-agent-gdb" diff --git a/Ghidra/Debug/Debugger-agent-lldb/data/debugger-launchers/ssh-lldb.ps1 b/Ghidra/Debug/Debugger-agent-lldb/data/debugger-launchers/ssh-lldb.ps1 index d260cfc65a..4ddc7bf771 100644 --- a/Ghidra/Debug/Debugger-agent-lldb/data/debugger-launchers/ssh-lldb.ps1 +++ b/Ghidra/Debug/Debugger-agent-lldb/data/debugger-launchers/ssh-lldb.ps1 @@ -56,14 +56,14 @@ are copied and installed. NOTE: Automatic resolution will cause this session to terminate. When it has finished, try launching again. -"@ "Would you like to install 'ghidralldb==$version'?" +"@ "Would you like to install 'ghidralldb>=$version'?" if ($answer) { Write-Host "Copying Wheels to $Env:OPT_HOST" Mitigate-Scp-PyModules "Debug/Debugger-rmi-trace" "Debug/Debugger-agent-lldb" Write-Host "Installing Wheels into LLDB's embedded Python" - $arglist = Compute-Lldb-PipInstall-Args "'-f'" "os.environ['HOME']" "'ghidralldb==$version'" + $arglist = Compute-Lldb-PipInstall-Args "'-f'" "os.environ['HOME']" "'ghidralldb>=$version'" $sshargs = Compute-Ssh-Args $arglist False Start-Process -FilePath $sshargs[0] -ArgumentList $sshargs[1..$sshargs.Count] -NoNewWindow -Wait } diff --git a/Ghidra/Debug/Debugger-agent-lldb/data/debugger-launchers/ssh-lldb.sh b/Ghidra/Debug/Debugger-agent-lldb/data/debugger-launchers/ssh-lldb.sh index be4d8e64f8..48a1b033fd 100755 --- a/Ghidra/Debug/Debugger-agent-lldb/data/debugger-launchers/ssh-lldb.sh +++ b/Ghidra/Debug/Debugger-agent-lldb/data/debugger-launchers/ssh-lldb.sh @@ -56,7 +56,7 @@ version=$(get-ghidra-version) function do-installation() { local -a pipargs - compute-lldb-pipinstall-args "'-f'" "os.environ['HOME']" "'ghidralldb==$version'" + compute-lldb-pipinstall-args "'-f'" "os.environ['HOME']" "'ghidralldb>=$version'" local -a sshargs compute-ssh-args false "${pipargs[@]}" @@ -89,7 +89,7 @@ are copied and installed. NOTE: Automatic resolution may cause this session to terminate. When it has finished, try launching again. -" "Would you like to install 'ghidralldb==$version'?"; then +" "Would you like to install 'ghidralldb>=$version'?"; then echo "Copying Wheels to $OPT_HOST" mitigate-scp-pymodules "Debug/Debugger-rmi-trace" "Debug/Debugger-agent-lldb" diff --git a/Ghidra/Debug/Debugger-rmi-trace/data/support/setuputils.ps1 b/Ghidra/Debug/Debugger-rmi-trace/data/support/setuputils.ps1 index 6046a06905..b4e050f88d 100644 --- a/Ghidra/Debug/Debugger-rmi-trace/data/support/setuputils.ps1 +++ b/Ghidra/Debug/Debugger-rmi-trace/data/support/setuputils.ps1 @@ -12,7 +12,7 @@ function Find-App-Properties { function Get-Ghidra-Version { $props = Find-App-Properties - $m = Get-Content $props | Select-String -Pattern "application\.version=(.*)" + $m = Get-Content $props | Select-String -Pattern "application\.version=([0-9]*\.[0-9]*)\.?.*" return $m.Matches.Groups[1].Value } diff --git a/Ghidra/Debug/Debugger-rmi-trace/data/support/setuputils.sh b/Ghidra/Debug/Debugger-rmi-trace/data/support/setuputils.sh index b1e9610e51..747b0d453e 100644 --- a/Ghidra/Debug/Debugger-rmi-trace/data/support/setuputils.sh +++ b/Ghidra/Debug/Debugger-rmi-trace/data/support/setuputils.sh @@ -29,7 +29,7 @@ find-app-properties() { } get-ghidra-version() { - local app_ver_re='application\.version=(.*)' + local app_ver_re='application\.version=([0-9]*\.[0-9]*)\.?.*' local props=$(find-app-properties) local version=$(cat "$props" | while read line; do if [[ $line =~ $app_ver_re ]]; then diff --git a/Ghidra/Features/Base/src/main/java/ghidra/program/util/SymbolicPropogator.java b/Ghidra/Features/Base/src/main/java/ghidra/program/util/SymbolicPropogator.java index 55479b7093..211a29d763 100644 --- a/Ghidra/Features/Base/src/main/java/ghidra/program/util/SymbolicPropogator.java +++ b/Ghidra/Features/Base/src/main/java/ghidra/program/util/SymbolicPropogator.java @@ -1968,11 +1968,6 @@ public class SymbolicPropogator { return; } - // don't check for params on external calls - if (callTarget != null && callTarget.isExternalAddress()) { - return; - } - // find the calling conventions // look up any register parameters // get the value of each, as soon as find no value, stop diff --git a/Ghidra/Features/Base/src/main/java/ghidra/program/util/VarnodeContext.java b/Ghidra/Features/Base/src/main/java/ghidra/program/util/VarnodeContext.java index 561dec807a..549ac28a5b 100644 --- a/Ghidra/Features/Base/src/main/java/ghidra/program/util/VarnodeContext.java +++ b/Ghidra/Features/Base/src/main/java/ghidra/program/util/VarnodeContext.java @@ -521,8 +521,7 @@ public class VarnodeContext implements ProcessorContext { Reference[] refsFrom = program.getReferenceManager().getReferencesFrom(addr); if (refsFrom.length > 0 && refsFrom[0].isExternalReference()) { Address external = refsFrom[0].getToAddress(); - return createVarnode(external.getOffset(), external.getAddressSpace().getSpaceID(), - 0); + return createVarnode(external.getOffset(), external.getAddressSpace().getSpaceID(), 0); } // If the memory is Writeable, then maybe don't trust it @@ -768,7 +767,7 @@ public class VarnodeContext implements ProcessorContext { return; } - Varnode split[] = splitToBytes(value); + Varnode split[] = splitToBytes(value, out.getSize()); // copy in partial values after for (int nodeOff = 0; nodeOff < len; nodeOff++) { if (split == null) { @@ -856,22 +855,21 @@ public class VarnodeContext implements ProcessorContext { return new Varnode(addr, size); } - public Varnode[] splitToBytes(Varnode v) { + public Varnode[] splitToBytes(Varnode v, int len) { if (!isConstant(v)) { return null; } - - int size = v.getSize(); - Varnode split[] = new Varnode[size]; + + Varnode split[] = new Varnode[len]; long value = v.getOffset(); if (isBE) { - for (int i = 0; i < v.getSize(); i++) { + for (int i = 0; i < len; i++) { long subv = value >> (i * 8); - split[size - i - 1] = createConstantVarnode(subv, 1); + split[len - i - 1] = createConstantVarnode(subv, 1); } } else { - for (int i = 0; i < v.getSize(); i++) { + for (int i = 0; i < len; i++) { long subv = value >> (i * 8); split[i] = createConstantVarnode(subv, 1); } @@ -1405,6 +1403,7 @@ public class VarnodeContext implements ProcessorContext { if (!in.isRegister() || !out.isRegister()) { // normal case easy get value, put value putValue(out, val1, mustClearAll); + return; } if (mustClearAll) { clearVals.add(out); @@ -1665,7 +1664,9 @@ public class VarnodeContext implements ProcessorContext { if (isBadAddress(val1)) { return val1; } - return createVarnode(0, addrFactory.getConstantSpace().getSpaceID(), val1.getSize()); + int size = val1.getSize(); + size = size > 0 ? size : 1; // turning into constant, make sure has a size + return createVarnode(0, addrFactory.getConstantSpace().getSpaceID(), size); } int spaceID = val1.getSpace(); long valbase = 0; diff --git a/Ghidra/Processors/Z80/data/languages/z80.slaspec b/Ghidra/Processors/Z80/data/languages/z80.slaspec index 12a590ba7f..1ac5c4387d 100644 --- a/Ghidra/Processors/Z80/data/languages/z80.slaspec +++ b/Ghidra/Processors/Z80/data/languages/z80.slaspec @@ -847,7 +847,7 @@ cc2: "C" is bits3_3=0x7 { c:1 = $(C_flag); export c; } subtractionFlags(a_temp, r_temp); a_temp = a_temp - r_temp; setResultFlags(a_temp); - a_temp = A; + A = a_temp; } :SUB imm8 is op0_8=0xd6; imm8 {