mirror of
https://github.com/lifting-bits/sleigh
synced 2026-06-21 13:56:12 +00:00
@@ -1,7 +1,7 @@
|
||||
From b25de9d74c90bd1216e10b5697a27c3815641621 Mon Sep 17 00:00:00 2001
|
||||
From 54276cc9def6836b02a3f77471b84a7a096eb8ec Mon Sep 17 00:00:00 2001
|
||||
From: Eric Kilmer <eric.d.kilmer@gmail.com>
|
||||
Date: Mon, 12 Aug 2024 12:02:35 -0400
|
||||
Subject: [PATCH 1/6] Fix UBSAN errors in decompiler
|
||||
Subject: [PATCH 1/7] Fix UBSAN errors in decompiler
|
||||
|
||||
Co-authored-by: Alex Cameron <asc@tetsuo.sh>
|
||||
---
|
||||
@@ -18,10 +18,10 @@ Co-authored-by: Alex Cameron <asc@tetsuo.sh>
|
||||
10 files changed, 44 insertions(+), 18 deletions(-)
|
||||
|
||||
diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/fspec.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/fspec.cc
|
||||
index 3e9f310446..c903810382 100644
|
||||
index cafce3f7ba..b696fe6879 100644
|
||||
--- a/Ghidra/Features/Decompiler/src/decompile/cpp/fspec.cc
|
||||
+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/fspec.cc
|
||||
@@ -2868,8 +2868,12 @@ void ProtoModelMerged::decode(Decoder &decoder)
|
||||
@@ -2893,8 +2893,12 @@ void ProtoModelMerged::decode(Decoder &decoder)
|
||||
modellist.push_back(mymodel);
|
||||
}
|
||||
decoder.closeElement(elemId);
|
||||
@@ -37,7 +37,7 @@ index 3e9f310446..c903810382 100644
|
||||
|
||||
void ParameterBasic::setTypeLock(bool val)
|
||||
diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/op.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/op.cc
|
||||
index e165951fe6..00169e22e5 100644
|
||||
index a62ee56fc3..66bcd48db0 100644
|
||||
--- a/Ghidra/Features/Decompiler/src/decompile/cpp/op.cc
|
||||
+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/op.cc
|
||||
@@ -666,7 +666,11 @@ uintb PcodeOp::getNZMaskLocal(bool cliploop) const
|
||||
@@ -116,7 +116,7 @@ index ca9d71ab99..85d4dd281d 100644
|
||||
return res;
|
||||
}
|
||||
diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/ruleaction.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/ruleaction.cc
|
||||
index b7fda34cc9..a3d164aa2d 100644
|
||||
index 2b4a9474e5..aa86e740b2 100644
|
||||
--- a/Ghidra/Features/Decompiler/src/decompile/cpp/ruleaction.cc
|
||||
+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/ruleaction.cc
|
||||
@@ -976,7 +976,12 @@ int4 RulePullsubIndirect::applyOp(PcodeOp *op,Funcdata &data)
|
||||
@@ -133,7 +133,7 @@ index b7fda34cc9..a3d164aa2d 100644
|
||||
consume = ~consume;
|
||||
if ((consume & indir->getIn(0)->getConsume())!=0) return 0;
|
||||
|
||||
@@ -7288,8 +7293,9 @@ int4 RulePtrsubCharConstant::applyOp(PcodeOp *op,Funcdata &data)
|
||||
@@ -7298,8 +7303,9 @@ int4 RulePtrsubCharConstant::applyOp(PcodeOp *op,Funcdata &data)
|
||||
Varnode *sb = op->getIn(0);
|
||||
Datatype *sbType = sb->getTypeReadFacing(op);
|
||||
if (sbType->getMetatype() != TYPE_PTR) return 0;
|
||||
@@ -220,5 +220,5 @@ index 2571f55f1a..fe40e22b1b 100644
|
||||
uintb true_result = ((uintb)(int32_t)f) & 0xffffffff;
|
||||
uintb encoding = format.getEncoding(f);
|
||||
--
|
||||
2.49.0
|
||||
2.50.1
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
From 1bd544111236b4b8f88429a074788e6616b05a38 Mon Sep 17 00:00:00 2001
|
||||
From 69272257372c594e866b34150c436962be1fa3a4 Mon Sep 17 00:00:00 2001
|
||||
From: Alex Cameron <asc@tetsuo.sh>
|
||||
Date: Wed, 3 Aug 2022 20:01:18 +1000
|
||||
Subject: [PATCH 2/6] Use `stroull` instead of `stroul` to parse address
|
||||
Subject: [PATCH 2/7] Use `stroull` instead of `stroul` to parse address
|
||||
offsets
|
||||
|
||||
---
|
||||
@@ -34,5 +34,5 @@ index dbaa2e775f..72927bf379 100644
|
||||
enddata = (const char *) tmpdata;
|
||||
if (enddata - s.c_str() == s.size()) { // If no size or offset override
|
||||
--
|
||||
2.49.0
|
||||
2.50.1
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
From f3b2fd0b950221005e02d294ef665e38d7f68b12 Mon Sep 17 00:00:00 2001
|
||||
From afef7a58fc2eb987fea303fc06c6d290fe3aa8a5 Mon Sep 17 00:00:00 2001
|
||||
From: Eric Kilmer <eric.d.kilmer@gmail.com>
|
||||
Date: Tue, 29 Oct 2024 15:30:57 -0400
|
||||
Subject: [PATCH 3/6] Use string resize instead of reserve
|
||||
Subject: [PATCH 3/7] Use string resize instead of reserve
|
||||
|
||||
assign will fix up the size to hold all of what's copied
|
||||
---
|
||||
@@ -32,5 +32,5 @@ index 5f5fa0c7b3..4cd77156f2 100644
|
||||
}
|
||||
data.isTruncated = (numChars >= maximumChars);
|
||||
--
|
||||
2.49.0
|
||||
2.50.1
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
From 643f66ceb6add640d24a7c4b001e5236dfb8428f Mon Sep 17 00:00:00 2001
|
||||
From 84384e8d472511bb20cf3ebfa67415dc6293cb80 Mon Sep 17 00:00:00 2001
|
||||
From: Eric Kilmer <eric.d.kilmer@gmail.com>
|
||||
Date: Tue, 29 Oct 2024 17:51:09 -0400
|
||||
Subject: [PATCH 4/6] Ignore floating point test due to compilation differences
|
||||
Subject: [PATCH 4/7] Ignore floating point test due to compilation differences
|
||||
|
||||
This test fails on macOS and Windows. I'm unsure whether it's an OS or
|
||||
compiler issue.
|
||||
@@ -24,5 +24,5 @@ index fe40e22b1b..91440e2510 100644
|
||||
ASSERT_EQUALS(ff.printDecimal(f2, false), "0.33333334");
|
||||
double f3 = doubleFromRawBits(0x3fd0000000000000);
|
||||
--
|
||||
2.49.0
|
||||
2.50.1
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
From 739a7cabff6e8718102b21bd4c639bb1d468794a Mon Sep 17 00:00:00 2001
|
||||
From c5524b18432739e441c4347f2d836d56faa74c77 Mon Sep 17 00:00:00 2001
|
||||
From: Eric Kilmer <eric.d.kilmer@gmail.com>
|
||||
Date: Wed, 30 Oct 2024 14:26:57 -0400
|
||||
Subject: [PATCH 5/6] Allow positive or negative NAN in decompiler floating
|
||||
Subject: [PATCH 5/7] Allow positive or negative NAN in decompiler floating
|
||||
point test
|
||||
|
||||
At least on Apple Silicon, this test reports positive NAN.
|
||||
@@ -33,5 +33,5 @@ index f8108d3d32..1060a3e193 100644
|
||||
<stringmatch name="Float print #14" min="1" max="1">double7 = 3.1415926535897933e-06;</stringmatch>
|
||||
</decompilertest>
|
||||
--
|
||||
2.49.0
|
||||
2.50.1
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
From d8ff76548dceea9e1a3a034dfd4967f246a7f716 Mon Sep 17 00:00:00 2001
|
||||
From 3330b9d1de3370d933bf7c3063fd4ca3744d1630 Mon Sep 17 00:00:00 2001
|
||||
From: Eric Kilmer <eric.d.kilmer@gmail.com>
|
||||
Date: Sat, 8 Feb 2025 17:59:57 -0500
|
||||
Subject: [PATCH 6/6] decompiler: Fix strict weak ordering TypePartialEnum
|
||||
Subject: [PATCH 6/7] decompiler: Fix strict weak ordering TypePartialEnum
|
||||
|
||||
This fixes Windows Debug error encountered in testing where it was
|
||||
complaining about lack of strict weak ordering.
|
||||
@@ -22,5 +22,5 @@ index f25b019a4f..2f1337a740 100644
|
||||
if (parent != tp->parent) return (parent < tp->parent) ? -1 : 1; // Compare absolute pointers
|
||||
if (offset != tp->offset) return (offset < tp->offset) ? -1 : 1;
|
||||
--
|
||||
2.49.0
|
||||
2.50.1
|
||||
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
From 4750c32e2390bdabdf77fca54b4c4f6a06585b02 Mon Sep 17 00:00:00 2001
|
||||
From: Eric Kilmer <eric.d.kilmer@gmail.com>
|
||||
Date: Fri, 18 Jul 2025 12:01:13 -0400
|
||||
Subject: [PATCH 7/7] Backport fix for datatests/retstruct.xml tests
|
||||
|
||||
---
|
||||
.../Features/Decompiler/src/decompile/datatests/retstruct.xml | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/Ghidra/Features/Decompiler/src/decompile/datatests/retstruct.xml b/Ghidra/Features/Decompiler/src/decompile/datatests/retstruct.xml
|
||||
index 4cc656af77..bbccfe65ee 100644
|
||||
--- a/Ghidra/Features/Decompiler/src/decompile/datatests/retstruct.xml
|
||||
+++ b/Ghidra/Features/Decompiler/src/decompile/datatests/retstruct.xml
|
||||
@@ -1,5 +1,5 @@
|
||||
<decompilertest>
|
||||
-<binaryimage arch="x86:LE:32:default:gcc">
|
||||
+<binaryimage arch="x86:LE:32:default:win">
|
||||
<!--
|
||||
Example function returning a structure stored across multiple registers
|
||||
-->
|
||||
--
|
||||
2.50.1
|
||||
|
||||
@@ -22,7 +22,7 @@ set_property(CACHE sleigh_RELEASE_TYPE PROPERTY STRINGS "stable" "HEAD")
|
||||
find_package(Git REQUIRED)
|
||||
|
||||
# Ghidra pinned stable version commit
|
||||
set(ghidra_version "11.3.2")
|
||||
set(ghidra_version "11.4")
|
||||
set(ghidra_git_tag "Ghidra_${ghidra_version}_build")
|
||||
set(ghidra_shallow TRUE)
|
||||
|
||||
@@ -44,6 +44,7 @@ set(ghidra_patches
|
||||
"${CMAKE_CURRENT_LIST_DIR}/patches/stable/0004-Ignore-floating-point-test-due-to-compilation-differ.patch"
|
||||
"${CMAKE_CURRENT_LIST_DIR}/patches/stable/0005-Allow-positive-or-negative-NAN-in-decompiler-floatin.patch"
|
||||
"${CMAKE_CURRENT_LIST_DIR}/patches/stable/0006-decompiler-Fix-strict-weak-ordering-TypePartialEnum.patch"
|
||||
"${CMAKE_CURRENT_LIST_DIR}/patches/stable/0007-Backport-fix-for-datatests-retstruct.xml-tests.patch"
|
||||
)
|
||||
|
||||
# Ghidra pinned commits used for pinning last known working HEAD commit
|
||||
|
||||
Reference in New Issue
Block a user