Compare commits

..

2 Commits

Author SHA1 Message Date
Eric Kilmer 231a28b524 Ghidra 11.0.3 (#257) 2024-04-12 10:17:08 -04:00
auto-updater[bot] 33ac2ef4f6 Update Ghidra HEAD to commit cae9190c1 (#256)
* Bump Ghidra HEAD commit cae9190c1

Changed files:

```
M	Ghidra/Features/Decompiler/src/decompile/cpp/emulate.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/fspec.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/fspec.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/heritage.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/jumptable.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/jumptable.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/marshal.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/modelrules.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/modelrules.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/printc.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/printc.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/sleigh.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/sleighexample.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/test.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/test.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/type.cc
M	Ghidra/Features/Decompiler/src/decompile/datatests/partialsplit.xml
M	Ghidra/Features/Decompiler/src/decompile/datatests/readvolatile.xml
M	Ghidra/Features/Decompiler/src/decompile/unittests/testparamstore.cc
M	Ghidra/Processors/AARCH64/data/patterns/AARCH64_LE_patterns.xml
M	Ghidra/Processors/AARCH64/src/main/java/ghidra/app/util/bin/format/elf/relocation/AARCH64_ElfRelocationHandler.java
M	Ghidra/Processors/ARM/src/main/java/ghidra/app/util/bin/format/elf/relocation/ARM_ElfRelocationHandler.java
M	Ghidra/Processors/Loongarch/src/main/java/ghidra/app/util/bin/format/elf/relocation/Loongarch_ElfRelocationHandler.java
M	Ghidra/Processors/MIPS/src/main/java/ghidra/app/util/bin/format/elf/relocation/MIPS_ElfRelocationHandler.java
M	Ghidra/Processors/PowerPC/src/main/java/ghidra/app/util/bin/format/elf/relocation/PowerPC64_ElfRelocationHandler.java
M	Ghidra/Processors/PowerPC/src/main/java/ghidra/app/util/bin/format/elf/relocation/PowerPC_ElfRelocationHandler.java
M	Ghidra/Processors/RISCV/src/main/java/ghidra/app/util/bin/format/elf/relocation/RISCV_ElfRelocationHandler.java
M	Ghidra/Processors/Sparc/src/main/java/ghidra/app/util/bin/format/elf/relocation/SPARC_ElfRelocationHandler.java
M	Ghidra/Processors/SuperH4/src/main/java/ghidra/app/util/bin/format/elf/relocation/SH_ElfRelocationHandler.java
M	Ghidra/Processors/V850/data/languages/V850.cspec
M	Ghidra/Processors/tricore/data/languages/tricore.cspec
M	Ghidra/Processors/tricore/src/main/java/ghidra/app/util/bin/format/elf/relocation/Tricore_ElfRelocationHandler.java
M	Ghidra/Processors/x86/data/languages/x86-64-gcc.cspec
M	Ghidra/Processors/x86/src/main/java/ghidra/app/util/bin/format/elf/relocation/X86_32_ElfRelocationHandler.java
M	Ghidra/Processors/x86/src/main/java/ghidra/app/util/bin/format/elf/relocation/X86_64_ElfRelocationHandler.java
```

* Remove patches merged upstream
2024-04-08 08:27:01 -04:00
3 changed files with 2 additions and 61 deletions
@@ -1,31 +0,0 @@
From 73d6f5a2a9a39dba3117947b3e27fe112c7d7074 Mon Sep 17 00:00:00 2001
From: Eric Kilmer <eric.d.kilmer@gmail.com>
Date: Mon, 4 Mar 2024 11:18:57 -0500
Subject: [PATCH 3/5] Fix sleighexample
---
Ghidra/Features/Decompiler/src/decompile/cpp/sleighexample.cc | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/sleighexample.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/sleighexample.cc
index f356825c9..5cab3f85c 100644
--- a/Ghidra/Features/Decompiler/src/decompile/cpp/sleighexample.cc
+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/sleighexample.cc
@@ -315,12 +315,12 @@ int main(int argc,char **argv)
ContextInternal context;
// Set up the assembler/pcode-translator
- string sleighfilename = "specfiles/x86.sla";
+ istringstream sleighfilename("<sleigh>specfiles/x86.sla</sleigh>");
Sleigh trans(&loader,&context);
// Read sleigh file into DOM
DocumentStorage docstorage;
- Element *sleighroot = docstorage.openDocument(sleighfilename)->getRoot();
+ Element *sleighroot = docstorage.parseDocument(sleighfilename)->getRoot();
docstorage.registerTag(sleighroot);
trans.initialize(docstorage); // Initialize the translator
--
2.44.0
@@ -1,26 +0,0 @@
From 2b6f5b2a70158503c844e8259717b7168ced9bc0 Mon Sep 17 00:00:00 2001
From: Eric Kilmer <eric.d.kilmer@gmail.com>
Date: Sat, 30 Mar 2024 18:26:27 -0400
Subject: [PATCH 4/5] Fix opening sla files on Windows
Compressed files need to be opened as binaries when reading.
---
Ghidra/Features/Decompiler/src/decompile/cpp/sleigh.cc | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/sleigh.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/sleigh.cc
index 471b99199..ba1a3b22c 100644
--- a/Ghidra/Features/Decompiler/src/decompile/cpp/sleigh.cc
+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/sleigh.cc
@@ -560,7 +560,7 @@ void Sleigh::initialize(DocumentStorage &store)
if (el == (const Element *)0)
throw LowlevelError("Could not find sleigh tag");
sla::FormatDecode decoder(this);
- ifstream s(el->getContent());
+ ifstream s(el->getContent(), std::ios_base::binary);
if (!s)
throw LowlevelError("Could not open .sla file: " + el->getContent());
decoder.ingestStream(s);
--
2.44.0
+2 -4
View File
@@ -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.0.2")
set(ghidra_version "11.0.3")
set(ghidra_git_tag "Ghidra_${ghidra_version}_build")
set(ghidra_shallow TRUE)
@@ -48,7 +48,7 @@ if("${sleigh_RELEASE_TYPE}" STREQUAL "HEAD")
# TODO: CMake only likes numeric characters in the version string....
set(ghidra_head_version "11.1")
set(ghidra_version "${ghidra_head_version}")
set(ghidra_head_git_tag "2a7897c3661e03db2e6c1e0e42d2362b654790a2")
set(ghidra_head_git_tag "cae9190c13709fbd889edbe8f46d28c99df0a588")
set(ghidra_git_tag "${ghidra_head_git_tag}")
set(ghidra_shallow FALSE)
set(ghidra_patches
@@ -57,8 +57,6 @@ if("${sleigh_RELEASE_TYPE}" STREQUAL "HEAD")
"${GIT_EXECUTABLE}" am --ignore-space-change --ignore-whitespace --no-gpg-sign
"${CMAKE_CURRENT_LIST_DIR}/patches/HEAD/0001-Fix-UBSAN-errors-in-decompiler.patch"
"${CMAKE_CURRENT_LIST_DIR}/patches/HEAD/0002-Use-stroull-instead-of-stroul-to-parse-address-offse.patch"
"${CMAKE_CURRENT_LIST_DIR}/patches/HEAD/0003-Fix-sleighexample.patch"
"${CMAKE_CURRENT_LIST_DIR}/patches/HEAD/0004-Fix-opening-sla-files-on-Windows.patch"
"${CMAKE_CURRENT_LIST_DIR}/patches/HEAD/0005-Add-missing-index-check-to-prevent-errors-in-Windows.patch"
)
string(SUBSTRING "${ghidra_git_tag}" 0 7 ghidra_short_commit)