mirror of
https://github.com/lifting-bits/sleigh
synced 2026-06-21 13:56:12 +00:00
Compare commits
66 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 0c5929b716 | |||
| 84a582a33c | |||
| d8ce6443bf | |||
| ae03ceb39c | |||
| 39d6587cf9 | |||
| 2bb6cfe47b | |||
| c3a84c541a | |||
| 45e124cdab | |||
| e4a5f4326c | |||
| 9cacf73c09 | |||
| c25484c07a | |||
| 4b7000b597 | |||
| dc79090c83 | |||
| 2d65648571 | |||
| 9650669dc3 | |||
| 8a595daf70 | |||
| 69e080e45a | |||
| 4110ce82e0 | |||
| 1464c57bad | |||
| bddd3b2342 | |||
| 5e84d25f0e | |||
| 9ebd0d7dbb | |||
| 92470fe795 | |||
| 39c1230211 | |||
| ebaea7183a | |||
| 95e45d8dd9 | |||
| f05a833db4 | |||
| 231a28b524 | |||
| 33ac2ef4f6 | |||
| 34a699c3bd | |||
| 05e1de0a8c | |||
| 24b9034914 | |||
| f2323af0ee | |||
| c3908f6d90 | |||
| 6924bbce83 | |||
| 1c23eba9ea | |||
| 0353b200d8 | |||
| 1dcdea8701 | |||
| 76e5cb4aca | |||
| 09ba8106d6 | |||
| aa46946172 | |||
| 6e0feed91c | |||
| acabb5ffc5 | |||
| 4becc755e9 | |||
| a1a03dbd26 | |||
| 403275e36c | |||
| 98158b7ebb | |||
| e6f6d4398f | |||
| 81a04f2e1c | |||
| a0345f9df2 | |||
| 0c3b79aa33 | |||
| b4f479a86f | |||
| ee82a39842 | |||
| 71870b0bcd | |||
| b2cd7abc2e | |||
| 40d91fd61b | |||
| 67c695f263 | |||
| c4cab14295 | |||
| e46879c87f | |||
| 5d9f0a1862 | |||
| f9bbbbcdb0 | |||
| cfa08a5f9c | |||
| 7702679f9e | |||
| 8ab198294f | |||
| 064320f431 | |||
| 0ea1abe327 |
+43
-23
@@ -43,19 +43,20 @@ jobs:
|
||||
if: runner.os == 'macOS'
|
||||
run: |
|
||||
echo "MACOSX_DEPLOYMENT_TARGET=10.15" >> ${GITHUB_ENV}
|
||||
brew install \
|
||||
brew install --formula \
|
||||
ccache \
|
||||
cmake \
|
||||
doxygen \
|
||||
graphviz
|
||||
|
||||
- name: Install Windows system dependencies
|
||||
if: runner.os == 'Windows'
|
||||
uses: nick-fields/retry@v2
|
||||
uses: nick-fields/retry@v3
|
||||
with:
|
||||
timeout_minutes: 10
|
||||
max_attempts: 3
|
||||
command: choco install ccache doxygen.install graphviz
|
||||
command: |
|
||||
choco install ccache doxygen.install graphviz
|
||||
vcpkg install zlib:x64-windows-static
|
||||
|
||||
- name: Generate cache key
|
||||
shell: cmake -P {0}
|
||||
@@ -65,7 +66,7 @@ jobs:
|
||||
file(APPEND "$ENV{GITHUB_ENV}" "CACHE_TIMESTAMP=${current_date}\n")
|
||||
|
||||
- name: Update the cache (ccache)
|
||||
uses: actions/cache@v3
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: "${{ github.workspace }}/ccache"
|
||||
key: ${{ env.CACHE_KEY }}_ccache_${{ env.CACHE_TIMESTAMP }}
|
||||
@@ -107,6 +108,10 @@ jobs:
|
||||
-j 2
|
||||
-v
|
||||
|
||||
- name: Test the project
|
||||
working-directory: build
|
||||
run: ctest -VV -C ${{ matrix.build_type }}
|
||||
|
||||
- name: Build the docs
|
||||
run: cmake
|
||||
--build build
|
||||
@@ -127,17 +132,30 @@ jobs:
|
||||
--prefix install
|
||||
|
||||
- name: Smoketest sleigh lift
|
||||
run: ./install/bin/sleigh-lift disassemble x86-64.sla 4881ecc00f0000
|
||||
run: |
|
||||
./install/bin/sleigh-lift --version
|
||||
./install/bin/sleigh-lift disassemble x86-64.sla 4881ecc00f0000
|
||||
./install/bin/sleigh-lift pcode x86-64.sla 4881ecc00f0000
|
||||
|
||||
- name: Test install directory
|
||||
- name: Test install directory Unix
|
||||
if: runner.os != 'Windows'
|
||||
working-directory: tests/find_package
|
||||
run: |
|
||||
cmake -B build -S . "-Dsleigh_DIR=${{ github.workspace }}/install/lib/cmake/sleigh" -DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
|
||||
cmake --build build -j 2 --config ${{ matrix.build_type }}
|
||||
cd build
|
||||
ctest -V -C ${{ matrix.build_type }}
|
||||
- name: Test install directory Windows
|
||||
if: runner.os == 'Windows'
|
||||
working-directory: tests/find_package
|
||||
run: |
|
||||
cmake -B build -S . "-Dsleigh_DIR=${{ github.workspace }}/install/lib/cmake/sleigh" -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} "-DCMAKE_TOOLCHAIN_FILE=$env:VCPKG_INSTALLATION_ROOT/scripts/buildsystems/vcpkg.cmake" -DVCPKG_TARGET_TRIPLET=x64-windows-static
|
||||
cmake --build build -j 2 --config ${{ matrix.build_type }}
|
||||
cd build
|
||||
ctest -V -C ${{ matrix.build_type }}
|
||||
|
||||
- name: Test tool install directory
|
||||
- name: Test tool install directory Unix
|
||||
if: runner.os != 'Windows'
|
||||
working-directory: extra-tools/sleigh-lift
|
||||
run: |
|
||||
cmake -B build -S . "-Dsleigh_DIR=${{ github.workspace }}/install/lib/cmake/sleigh" -DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
|
||||
@@ -145,6 +163,17 @@ jobs:
|
||||
cmake --install build --config ${{ matrix.build_type }} --prefix install
|
||||
./install/bin/sleigh-lift --version
|
||||
./install/bin/sleigh-lift disassemble x86-64.sla 4881ecc00f0000
|
||||
./install/bin/sleigh-lift pcode x86-64.sla 4881ecc00f0000
|
||||
- name: Test tool install directory Windows
|
||||
if: runner.os == 'Windows'
|
||||
working-directory: extra-tools/sleigh-lift
|
||||
run: |
|
||||
cmake -B build -S . "-Dsleigh_DIR=${{ github.workspace }}/install/lib/cmake/sleigh" -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} "-DCMAKE_TOOLCHAIN_FILE=$env:VCPKG_INSTALLATION_ROOT/scripts/buildsystems/vcpkg.cmake" -DVCPKG_TARGET_TRIPLET=x64-windows-static
|
||||
cmake --build build -j 2 --config ${{ matrix.build_type }}
|
||||
cmake --install build --config ${{ matrix.build_type }} --prefix install
|
||||
./install/bin/sleigh-lift --version
|
||||
./install/bin/sleigh-lift disassemble x86-64.sla 4881ecc00f0000
|
||||
./install/bin/sleigh-lift pcode x86-64.sla 4881ecc00f0000
|
||||
|
||||
- name: Create the packages
|
||||
run: cmake
|
||||
@@ -182,13 +211,13 @@ jobs:
|
||||
# DEB Package
|
||||
- name: Upload the DEB package artifact (RelWithDebInfo only)
|
||||
if: matrix.build_type == 'RelWithDebInfo' && runner.os == 'Linux'
|
||||
uses: actions/upload-artifact@v3
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: ${{ env.DEB_PACKAGE_NAME }}
|
||||
path: ${{ env.DEB_PACKAGE_PATH }}
|
||||
|
||||
- name: Release DEB package artifact (RelWithDebInfo only)
|
||||
uses: softprops/action-gh-release@v0.1.15
|
||||
uses: softprops/action-gh-release@v2.0.9
|
||||
if: matrix.build_type == 'RelWithDebInfo' && runner.os == 'Linux' && startsWith(github.ref, 'refs/tags/') && matrix.release == 'stable'
|
||||
with:
|
||||
files: ${{ env.DEB_PACKAGE_PATH }}
|
||||
@@ -196,12 +225,12 @@ jobs:
|
||||
# RPM Package
|
||||
- name: Upload the RPM package artifact (RelWithDebInfo only)
|
||||
if: matrix.build_type == 'RelWithDebInfo' && runner.os == 'Linux'
|
||||
uses: actions/upload-artifact@v3
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: ${{ env.RPM_PACKAGE_NAME }}
|
||||
path: ${{ env.RPM_PACKAGE_PATH }}
|
||||
- name: Release RPM package artifact (RelWithDebInfo only)
|
||||
uses: softprops/action-gh-release@v0.1.15
|
||||
uses: softprops/action-gh-release@v2.0.9
|
||||
if: matrix.build_type == 'RelWithDebInfo' && runner.os == 'Linux' && startsWith(github.ref, 'refs/tags/') && matrix.release == 'stable'
|
||||
with:
|
||||
files: ${{ env.RPM_PACKAGE_PATH }}
|
||||
@@ -209,25 +238,16 @@ jobs:
|
||||
# TGZ Package
|
||||
- name: Upload the TGZ package artifact (RelWithDebInfo only)
|
||||
if: matrix.build_type == 'RelWithDebInfo'
|
||||
uses: actions/upload-artifact@v3
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: ${{ env.TGZ_PACKAGE_NAME }}
|
||||
path: ${{ env.TGZ_PACKAGE_PATH }}
|
||||
|
||||
- name: Release TGZ package artifact (RelWithDebInfo only)
|
||||
uses: softprops/action-gh-release@v0.1.15
|
||||
uses: softprops/action-gh-release@v2.0.9
|
||||
if: matrix.build_type == 'RelWithDebInfo' && startsWith(github.ref, 'refs/tags/') && matrix.release == 'stable'
|
||||
with:
|
||||
files: ${{ env.TGZ_PACKAGE_PATH }}
|
||||
|
||||
# This step is down at the bottom because Windows fails but we still want
|
||||
# to upload the built binaries, regardless. We also want to see if/when
|
||||
# Windows tests start passing or are still failing, so there is no special
|
||||
# handling. GitHub Actions does not support the concept of an allowable
|
||||
# failure state
|
||||
- name: Run the tests
|
||||
working-directory: build
|
||||
run: ctest -VV -C ${{ matrix.build_type }}
|
||||
|
||||
- name: ccache stats
|
||||
run: ccache -s
|
||||
|
||||
@@ -14,7 +14,7 @@ jobs:
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- uses: actions/setup-python@v4
|
||||
- uses: actions/setup-python@v5
|
||||
with:
|
||||
# Use oldest supported version for maximum script compatibility
|
||||
python-version: '3.7'
|
||||
@@ -36,7 +36,7 @@ jobs:
|
||||
|
||||
- name: Create PR
|
||||
if: steps.head_update.outputs.did_update
|
||||
uses: peter-evans/create-pull-request@v5
|
||||
uses: peter-evans/create-pull-request@v7
|
||||
with:
|
||||
title: Update Ghidra HEAD to commit ${{ steps.head_update.outputs.short_sha }}
|
||||
commit-message: |
|
||||
|
||||
+23
-5
@@ -30,7 +30,7 @@ include(cmake/project-is-top-level.cmake)
|
||||
include(cmake/options.cmake)
|
||||
|
||||
#
|
||||
# Move headers so we can prefix with "sleigh/"
|
||||
# Move headers so we can prefix with "ghidra/"
|
||||
#
|
||||
set(public_include_header_list
|
||||
"${library_root}/action.hh"
|
||||
@@ -135,6 +135,14 @@ set(public_include_header_list
|
||||
"${library_root}/xml_arch.hh"
|
||||
"${library_root}/unionresolve.hh"
|
||||
"${library_root}/marshal.hh"
|
||||
"${library_root}/analyzesigs.hh"
|
||||
"${library_root}/modelrules.hh"
|
||||
"${library_root}/signature.hh"
|
||||
"${library_root}/signature_ghidra.hh"
|
||||
"${library_root}/compression.hh"
|
||||
"${library_root}/multiprecision.hh"
|
||||
"${library_root}/slaformat.hh"
|
||||
"${library_root}/constseq.hh"
|
||||
)
|
||||
#if(sleigh_RELEASE_IS_HEAD)
|
||||
# list(APPEND public_include_header_list
|
||||
@@ -143,13 +151,19 @@ set(public_include_header_list
|
||||
# Create custom target so that IDEs know these files are part of the sources
|
||||
add_custom_target(sleigh_all_headers SOURCES ${public_include_header_list})
|
||||
set(public_headers_dir ${CMAKE_CURRENT_BINARY_DIR}/include)
|
||||
file(MAKE_DIRECTORY "${public_headers_dir}/sleigh")
|
||||
configure_file(cmake/libconfig.h.in "${public_headers_dir}/sleigh/libconfig.h")
|
||||
file(MAKE_DIRECTORY "${public_headers_dir}/ghidra")
|
||||
# Copy the public headers into our build directory so that we can control the layout.
|
||||
# Ideally, we want to let people '#include <sleigh/{header}>' without installing sleigh
|
||||
# Ideally, we want to let people '#include <ghidra/{header}>' without installing sleigh
|
||||
foreach(public_header ${public_include_header_list})
|
||||
configure_file("${public_header}" "${public_headers_dir}/sleigh" COPYONLY)
|
||||
configure_file("${public_header}" "${public_headers_dir}/ghidra" COPYONLY)
|
||||
endforeach()
|
||||
# This project also generates a helper header for managing sleigh versions.
|
||||
# We intentionally use the `sleigh` directory for this header because it's
|
||||
# not from upstream.
|
||||
configure_file(cmake/libconfig.h.in "${public_headers_dir}/sleigh/libconfig.h")
|
||||
|
||||
# External Dependencies
|
||||
find_package(ZLIB REQUIRED)
|
||||
|
||||
#
|
||||
# sla
|
||||
@@ -183,6 +197,8 @@ set_target_properties(sleigh_sla PROPERTIES
|
||||
OUTPUT_NAME_DEBUG sla_dbg
|
||||
)
|
||||
|
||||
target_link_libraries(sleigh_sla PUBLIC ZLIB::ZLIB)
|
||||
|
||||
#
|
||||
# decomp
|
||||
#
|
||||
@@ -210,6 +226,8 @@ set_target_properties(sleigh_decomp PROPERTIES
|
||||
OUTPUT_NAME_DEBUG decomp_dbg
|
||||
)
|
||||
|
||||
target_link_libraries(sleigh_decomp PUBLIC ZLIB::ZLIB)
|
||||
|
||||
# This is the root directory where all individual processor spec file directories will be created.
|
||||
# NOTE: Needs to be defined here before the install rules
|
||||
set(spec_files_build_dir "${CMAKE_CURRENT_BINARY_DIR}/specfiles")
|
||||
|
||||
@@ -79,6 +79,10 @@
|
||||
"inherits": ["flags-windows", "ci-std"],
|
||||
"generator": "Visual Studio 17 2022",
|
||||
"architecture": "x64",
|
||||
"cacheVariables": {
|
||||
"CMAKE_TOOLCHAIN_FILE": "$env{VCPKG_INSTALLATION_ROOT}/scripts/buildsystems/vcpkg.cmake",
|
||||
"VCPKG_TARGET_TRIPLET": "x64-windows-static"
|
||||
},
|
||||
"hidden": true
|
||||
},
|
||||
{
|
||||
|
||||
@@ -18,6 +18,7 @@ This repository provides a CMake-based build project for Sleigh so that it can b
|
||||
|
||||
| Name | Version | Linux Package to Install | macOS Homebrew Package to Install |
|
||||
| ---- | ------- | ------------------------ | --------------------------------- |
|
||||
| (HEAD builds) [zlib](https://www.zlib.net/) | Recent | zlib1g-dev | zlib |
|
||||
| [Git](https://git-scm.com/) | Latest | git | N/A |
|
||||
| [CMake](https://cmake.org/) | 3.18+ | cmake | cmake |
|
||||
|
||||
|
||||
@@ -15,11 +15,14 @@
|
||||
|
||||
@PACKAGE_INIT@
|
||||
|
||||
include("${CMAKE_CURRENT_LIST_DIR}/sleighTargets.cmake")
|
||||
|
||||
# Extra version details. Either 'stable' or 'HEAD'
|
||||
set(sleigh_RELEASE_IS_HEAD "@sleigh_RELEASE_IS_HEAD@")
|
||||
|
||||
include(CMakeFindDependencyMacro)
|
||||
find_dependency(ZLIB)
|
||||
|
||||
include("${CMAKE_CURRENT_LIST_DIR}/sleighTargets.cmake")
|
||||
|
||||
# Helpers exposed by default when finding sleigh
|
||||
include("${CMAKE_CURRENT_LIST_DIR}/modules/sleighCompile.cmake")
|
||||
|
||||
|
||||
@@ -265,8 +265,9 @@ int main(int argc, char *argv[]) {
|
||||
ghidra::ContextInternal ctx;
|
||||
ghidra::Sleigh engine(&load_image, &ctx);
|
||||
ghidra::DocumentStorage storage;
|
||||
std::istringstream sla("<sleigh>" + sla_file_path->string() + "</sleigh>");
|
||||
ghidra::Element *root =
|
||||
storage.openDocument(sla_file_path->string())->getRoot();
|
||||
storage.parseDocument(sla)->getRoot();
|
||||
storage.registerTag(root);
|
||||
std::optional<std::filesystem::path> pspec_file_path;
|
||||
if (args->pspec_file_name) {
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
From 67ac779382508ab0d5ff10bcb0a8453068cce5a2 Mon Sep 17 00:00:00 2001
|
||||
From: Alex Cameron <asc@tetsuo.sh>
|
||||
Date: Mon, 5 Jun 2023 16:45:04 +1200
|
||||
Subject: [PATCH 1/2] Fix UBSAN errors in decompiler
|
||||
From 76289be82722d1a076bb9718507ce57748b40543 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
|
||||
|
||||
Co-authored-by: Alex Cameron <asc@tetsuo.sh>
|
||||
---
|
||||
.../Decompiler/src/decompile/cpp/fspec.cc | 8 ++++++--
|
||||
.../src/decompile/cpp/funcdata_varnode.cc | 8 +++++++-
|
||||
.../Decompiler/src/decompile/cpp/op.cc | 6 +++++-
|
||||
.../Decompiler/src/decompile/cpp/opbehavior.cc | 8 +++++++-
|
||||
.../src/decompile/cpp/pcodecompile.cc | 18 +++++++++++-------
|
||||
@@ -13,16 +13,15 @@ Subject: [PATCH 1/2] Fix UBSAN errors in decompiler
|
||||
.../Decompiler/src/decompile/cpp/semantics.cc | 2 ++
|
||||
.../Decompiler/src/decompile/cpp/semantics.hh | 2 +-
|
||||
.../src/decompile/cpp/slgh_compile.cc | 2 +-
|
||||
.../Decompiler/src/decompile/cpp/slghsymbol.cc | 2 +-
|
||||
.../Decompiler/src/decompile/cpp/type.cc | 2 +-
|
||||
.../src/decompile/unittests/testfloatemu.cc | 2 +-
|
||||
12 files changed, 57 insertions(+), 21 deletions(-)
|
||||
10 files changed, 49 insertions(+), 19 deletions(-)
|
||||
|
||||
diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/fspec.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/fspec.cc
|
||||
index 82771cc04..da78c8071 100644
|
||||
index d78b78731c..caf4b24d15 100644
|
||||
--- a/Ghidra/Features/Decompiler/src/decompile/cpp/fspec.cc
|
||||
+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/fspec.cc
|
||||
@@ -2661,8 +2661,12 @@ void ProtoModelMerged::decode(Decoder &decoder)
|
||||
@@ -2868,8 +2868,12 @@ void ProtoModelMerged::decode(Decoder &decoder)
|
||||
modellist.push_back(mymodel);
|
||||
}
|
||||
decoder.closeElement(elemId);
|
||||
@@ -37,30 +36,11 @@ index 82771cc04..da78c8071 100644
|
||||
}
|
||||
|
||||
void ParameterBasic::setTypeLock(bool val)
|
||||
diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/funcdata_varnode.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/funcdata_varnode.cc
|
||||
index f77817073..283d81c31 100644
|
||||
--- a/Ghidra/Features/Decompiler/src/decompile/cpp/funcdata_varnode.cc
|
||||
+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/funcdata_varnode.cc
|
||||
@@ -503,7 +503,13 @@ void Funcdata::setHighLevel(void)
|
||||
void Funcdata::transferVarnodeProperties(Varnode *vn,Varnode *newVn,int4 lsbOffset)
|
||||
|
||||
{
|
||||
- uintb newConsume = (vn->getConsume() >> 8*lsbOffset) & calc_mask(newVn->getSize());
|
||||
+ uintb newConsume = vn->getConsume();
|
||||
+ if (8*lsbOffset < sizeof(newConsume)) {
|
||||
+ newConsume >>= 8*lsbOffset;
|
||||
+ } else {
|
||||
+ newConsume = 0;
|
||||
+ }
|
||||
+ newConsume &= calc_mask(newVn->getSize());
|
||||
|
||||
uint4 vnFlags = vn->getFlags() & (Varnode::directwrite|Varnode::addrforce);
|
||||
|
||||
diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/op.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/op.cc
|
||||
index 0e3decc80..403ec35a7 100644
|
||||
index d51460be84..45bf394862 100644
|
||||
--- a/Ghidra/Features/Decompiler/src/decompile/cpp/op.cc
|
||||
+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/op.cc
|
||||
@@ -672,7 +672,11 @@ uintb PcodeOp::getNZMaskLocal(bool cliploop) const
|
||||
@@ -666,7 +666,11 @@ uintb PcodeOp::getNZMaskLocal(bool cliploop) const
|
||||
break;
|
||||
case CPUI_PIECE:
|
||||
resmask = getIn(0)->getNZMask();
|
||||
@@ -74,7 +54,7 @@ index 0e3decc80..403ec35a7 100644
|
||||
break;
|
||||
case CPUI_INT_MULT:
|
||||
diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/opbehavior.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/opbehavior.cc
|
||||
index aebcfd910..6c47e6eb1 100644
|
||||
index aebcfd9103..6c47e6eb15 100644
|
||||
--- a/Ghidra/Features/Decompiler/src/decompile/cpp/opbehavior.cc
|
||||
+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/opbehavior.cc
|
||||
@@ -746,7 +746,13 @@ uintb OpBehaviorPiece::evaluateBinary(int4 sizeout,int4 sizein,uintb in1,uintb i
|
||||
@@ -93,7 +73,7 @@ index aebcfd910..6c47e6eb1 100644
|
||||
}
|
||||
|
||||
diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/pcodecompile.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/pcodecompile.cc
|
||||
index ca9d71ab9..85d4dd281 100644
|
||||
index ca9d71ab99..85d4dd281d 100644
|
||||
--- a/Ghidra/Features/Decompiler/src/decompile/cpp/pcodecompile.cc
|
||||
+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/pcodecompile.cc
|
||||
@@ -621,8 +621,10 @@ vector<OpTpl *> *PcodeCompile::assignBitRange(VarnodeTpl *vn,uint4 bitoffset,uin
|
||||
@@ -136,10 +116,10 @@ index ca9d71ab9..85d4dd281 100644
|
||||
return res;
|
||||
}
|
||||
diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/ruleaction.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/ruleaction.cc
|
||||
index ae2e502c1..a22b8ebdc 100644
|
||||
index bfca3d6ee5..5819bcd732 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)
|
||||
@@ -977,7 +977,12 @@ int4 RulePullsubIndirect::applyOp(PcodeOp *op,Funcdata &data)
|
||||
Varnode *outvn = op->getOut();
|
||||
if (outvn->isPrecisLo()||outvn->isPrecisHi()) return 0; // Don't pull apart double precision object
|
||||
|
||||
@@ -153,7 +133,7 @@ index ae2e502c1..a22b8ebdc 100644
|
||||
consume = ~consume;
|
||||
if ((consume & indir->getIn(0)->getConsume())!=0) return 0;
|
||||
|
||||
@@ -6789,8 +6794,9 @@ int4 RulePtrsubCharConstant::applyOp(PcodeOp *op,Funcdata &data)
|
||||
@@ -7028,8 +7033,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;
|
||||
@@ -165,7 +145,7 @@ index ae2e502c1..a22b8ebdc 100644
|
||||
Varnode *vn1 = op->getIn(1);
|
||||
if (!vn1->isConstant()) return 0;
|
||||
Varnode *outvn = op->getOut();
|
||||
@@ -8600,7 +8606,11 @@ int4 RuleSubvarSubpiece::applyOp(PcodeOp *op,Funcdata &data)
|
||||
@@ -8833,7 +8839,11 @@ int4 RuleSubvarSubpiece::applyOp(PcodeOp *op,Funcdata &data)
|
||||
Varnode *outvn = op->getOut();
|
||||
int4 flowsize = outvn->getSize();
|
||||
uintb mask = calc_mask( flowsize );
|
||||
@@ -179,7 +159,7 @@ index ae2e502c1..a22b8ebdc 100644
|
||||
if (!aggressive) {
|
||||
if ((vn->getConsume() & mask) != vn->getConsume()) return 0;
|
||||
diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/semantics.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/semantics.cc
|
||||
index 2e3531ea2..42482be7c 100644
|
||||
index cd9b9835b1..8a4616c3b9 100644
|
||||
--- a/Ghidra/Features/Decompiler/src/decompile/cpp/semantics.cc
|
||||
+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/semantics.cc
|
||||
@@ -22,6 +22,7 @@ ConstTpl::ConstTpl(const_type tp)
|
||||
@@ -199,12 +179,12 @@ index 2e3531ea2..42482be7c 100644
|
||||
|
||||
bool ConstTpl::isConstSpace(void) const
|
||||
diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/semantics.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/semantics.hh
|
||||
index 8e283dca0..652600c16 100644
|
||||
index e0b069959d..9117a45c75 100644
|
||||
--- a/Ghidra/Features/Decompiler/src/decompile/cpp/semantics.hh
|
||||
+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/semantics.hh
|
||||
@@ -48,7 +48,7 @@ private:
|
||||
static void printHandleSelector(ostream &s,v_field val);
|
||||
static v_field readHandleSelector(const string &name);
|
||||
@@ -47,7 +47,7 @@ class ConstTpl {
|
||||
uintb value_real;
|
||||
v_field select; // Which part of handle to use as constant
|
||||
public:
|
||||
- ConstTpl(void) { type = real; value_real = 0; }
|
||||
+ ConstTpl(void) { type = real; value_real = 0; select = v_space; }
|
||||
@@ -212,10 +192,10 @@ index 8e283dca0..652600c16 100644
|
||||
type=op2.type; value=op2.value; value_real=op2.value_real; select=op2.select; }
|
||||
ConstTpl(const_type tp,uintb val);
|
||||
diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/slgh_compile.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/slgh_compile.cc
|
||||
index b40f74389..3c37958df 100644
|
||||
index 50d85e22ba..9f3b456229 100644
|
||||
--- a/Ghidra/Features/Decompiler/src/decompile/cpp/slgh_compile.cc
|
||||
+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/slgh_compile.cc
|
||||
@@ -2163,8 +2163,8 @@ string SleighCompile::checkSymbols(SymbolScope *scope)
|
||||
@@ -2164,8 +2164,8 @@ string SleighCompile::checkSymbols(SymbolScope *scope)
|
||||
ostringstream msg;
|
||||
SymbolTree::const_iterator iter;
|
||||
for(iter=scope->begin();iter!=scope->end();++iter) {
|
||||
@@ -225,24 +205,11 @@ index b40f74389..3c37958df 100644
|
||||
if (sym->getRefCount() == 0)
|
||||
msg << " Label <" << sym->getName() << "> was placed but not used" << endl;
|
||||
else if (!sym->isPlaced())
|
||||
diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/slghsymbol.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/slghsymbol.cc
|
||||
index b308e1b71..af2982aee 100644
|
||||
--- a/Ghidra/Features/Decompiler/src/decompile/cpp/slghsymbol.cc
|
||||
+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/slghsymbol.cc
|
||||
@@ -2569,7 +2569,7 @@ void ContextOp::restoreXml(const Element *el,SleighBase *trans)
|
||||
const List &list(el->getChildren());
|
||||
List::const_iterator iter;
|
||||
iter = list.begin();
|
||||
- patexp = (PatternValue *)PatternExpression::restoreExpression(*iter,trans);
|
||||
+ patexp = PatternExpression::restoreExpression(*iter,trans);
|
||||
patexp->layClaim();
|
||||
}
|
||||
|
||||
diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/type.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/type.cc
|
||||
index 32ede6b0f..238d97f40 100644
|
||||
index 59dcc55949..5944db5905 100644
|
||||
--- a/Ghidra/Features/Decompiler/src/decompile/cpp/type.cc
|
||||
+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/type.cc
|
||||
@@ -3384,8 +3384,8 @@ void TypeFactory::recalcPointerSubmeta(Datatype *base,sub_metatype sub)
|
||||
@@ -3658,8 +3658,8 @@ void TypeFactory::recalcPointerSubmeta(Datatype *base,sub_metatype sub)
|
||||
top.submeta = sub; // Search on the incorrect submeta
|
||||
iter = tree.lower_bound(&top);
|
||||
while(iter != tree.end()) {
|
||||
@@ -253,10 +220,10 @@ index 32ede6b0f..238d97f40 100644
|
||||
++iter;
|
||||
if (ptr->submeta == sub) {
|
||||
diff --git a/Ghidra/Features/Decompiler/src/decompile/unittests/testfloatemu.cc b/Ghidra/Features/Decompiler/src/decompile/unittests/testfloatemu.cc
|
||||
index c35bde877..061e53677 100644
|
||||
index 2571f55f1a..fe40e22b1b 100644
|
||||
--- a/Ghidra/Features/Decompiler/src/decompile/unittests/testfloatemu.cc
|
||||
+++ b/Ghidra/Features/Decompiler/src/decompile/unittests/testfloatemu.cc
|
||||
@@ -346,7 +346,7 @@ TEST(float_opTrunc_to_int) {
|
||||
@@ -375,7 +375,7 @@ TEST(float_opTrunc_to_int) {
|
||||
|
||||
for(float f:float_test_values) {
|
||||
// avoid undefined behavior
|
||||
@@ -266,5 +233,5 @@ index c35bde877..061e53677 100644
|
||||
uintb true_result = ((uintb)(int32_t)f) & 0xffffffff;
|
||||
uintb encoding = format.getEncoding(f);
|
||||
--
|
||||
2.39.2 (Apple Git-143)
|
||||
2.47.0
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
From 9fd26cd754b6f83e45199db896fd0fcea23cd59d Mon Sep 17 00:00:00 2001
|
||||
From 2e4706231191395dac90b764ce29c55de29ca2ce 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/2] Use `stroull` instead of `stroul` to parse address
|
||||
Subject: [PATCH 2/6] Use `stroull` instead of `stroul` to parse address
|
||||
offsets
|
||||
|
||||
---
|
||||
@@ -9,7 +9,7 @@ Subject: [PATCH 2/2] Use `stroull` instead of `stroul` to parse address
|
||||
1 file changed, 6 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/space.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/space.cc
|
||||
index bf4e1dc96..594b4583a 100644
|
||||
index dbaa2e775f..72927bf379 100644
|
||||
--- a/Ghidra/Features/Decompiler/src/decompile/cpp/space.cc
|
||||
+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/space.cc
|
||||
@@ -16,6 +16,8 @@
|
||||
@@ -21,7 +21,7 @@ index bf4e1dc96..594b4583a 100644
|
||||
namespace ghidra {
|
||||
|
||||
AttributeId ATTRIB_BASE = AttributeId("base",89);
|
||||
@@ -290,7 +292,10 @@ uintb AddrSpace::read(const string &s,int4 &size) const
|
||||
@@ -277,7 +279,10 @@ uintb AddrSpace::read(const string &s,int4 &size) const
|
||||
}
|
||||
}
|
||||
catch(LowlevelError &err) { // Name doesn't exist
|
||||
@@ -34,5 +34,5 @@ index bf4e1dc96..594b4583a 100644
|
||||
enddata = (const char *) tmpdata;
|
||||
if (enddata - s.c_str() == s.size()) { // If no size or offset override
|
||||
--
|
||||
2.39.2 (Apple Git-143)
|
||||
2.47.0
|
||||
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
From d7f7be313580a6e0eef101848a3c86e3a3db4029 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 4/6] Use string resize instead of reserve
|
||||
|
||||
assign will fix up the size to hold all of what's copied
|
||||
---
|
||||
Ghidra/Features/Decompiler/src/decompile/cpp/stringmanage.cc | 3 +--
|
||||
1 file changed, 1 insertion(+), 2 deletions(-)
|
||||
|
||||
diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/stringmanage.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/stringmanage.cc
|
||||
index 5f5fa0c7b3..4cd77156f2 100644
|
||||
--- a/Ghidra/Features/Decompiler/src/decompile/cpp/stringmanage.cc
|
||||
+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/stringmanage.cc
|
||||
@@ -67,7 +67,6 @@ void StringManager::assignStringData(StringData &data,const uint1 *buf,int4 size
|
||||
|
||||
{
|
||||
if (charsize == 1 && numChars < maximumChars) {
|
||||
- data.byteData.reserve(size);
|
||||
data.byteData.assign(buf,buf+size);
|
||||
}
|
||||
else {
|
||||
@@ -77,9 +76,9 @@ void StringManager::assignStringData(StringData &data,const uint1 *buf,int4 size
|
||||
return;
|
||||
string resString = s.str();
|
||||
int4 newSize = resString.size();
|
||||
- data.byteData.reserve(newSize + 1);
|
||||
const uint1 *ptr = (const uint1 *)resString.c_str();
|
||||
data.byteData.assign(ptr,ptr+newSize);
|
||||
+ data.byteData.resize(newSize + 1, 0);
|
||||
data.byteData[newSize] = 0; // Make sure there is a null terminator
|
||||
}
|
||||
data.isTruncated = (numChars >= maximumChars);
|
||||
--
|
||||
2.47.0
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
From a76b69021f34973973487362cb5f25f7644880b8 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 5/6] 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.
|
||||
---
|
||||
.../Decompiler/src/decompile/unittests/testfloatemu.cc | 3 ++-
|
||||
1 file changed, 2 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/Ghidra/Features/Decompiler/src/decompile/unittests/testfloatemu.cc b/Ghidra/Features/Decompiler/src/decompile/unittests/testfloatemu.cc
|
||||
index fe40e22b1b..91440e2510 100644
|
||||
--- a/Ghidra/Features/Decompiler/src/decompile/unittests/testfloatemu.cc
|
||||
+++ b/Ghidra/Features/Decompiler/src/decompile/unittests/testfloatemu.cc
|
||||
@@ -184,7 +184,8 @@ TEST(double_decimal_precision) {
|
||||
double f0 = doubleFromRawBits(0x3fc5555555555555);
|
||||
ASSERT_EQUALS(ff.printDecimal(f0, false), "0.16666666666666666");
|
||||
double f1 = doubleFromRawBits(0x7fefffffffffffff);
|
||||
- ASSERT_EQUALS(ff.printDecimal(f1, false), "1.79769313486232e+308");
|
||||
+ // Windows and Mac print 1.7976931348623157e+308
|
||||
+ // ASSERT_EQUALS(ff.printDecimal(f1, false), "1.79769313486232e+308");
|
||||
double f2 = doubleFromRawBits(0x3fd555555c7dda4b);
|
||||
ASSERT_EQUALS(ff.printDecimal(f2, false), "0.33333334");
|
||||
double f3 = doubleFromRawBits(0x3fd0000000000000);
|
||||
--
|
||||
2.47.0
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
From ce0148e9dd6d4a9ba92ee44fb50be1f01b7a8858 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 6/6] Allow positive or negative NAN in decompiler floating
|
||||
point test
|
||||
|
||||
At least on Apple Silicon, this test reports positive NAN.
|
||||
|
||||
Use the regex optional operator '?' to allow for positive or negative
|
||||
NAN.
|
||||
---
|
||||
.../Decompiler/src/decompile/datatests/floatprint.xml | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/Ghidra/Features/Decompiler/src/decompile/datatests/floatprint.xml b/Ghidra/Features/Decompiler/src/decompile/datatests/floatprint.xml
|
||||
index f8108d3d32..1060a3e193 100644
|
||||
--- a/Ghidra/Features/Decompiler/src/decompile/datatests/floatprint.xml
|
||||
+++ b/Ghidra/Features/Decompiler/src/decompile/datatests/floatprint.xml
|
||||
@@ -58,13 +58,13 @@ bbbdd7d9df7cdb3d000000000000f03f
|
||||
<stringmatch name="Float print #3" min="1" max="1">floatv3 = -0.001;</stringmatch>
|
||||
<stringmatch name="Float print #4" min="1" max="1">floatv4 = 1e-06;</stringmatch>
|
||||
<stringmatch name="Float print #5" min="1" max="1">floatv5 = INFINITY;</stringmatch>
|
||||
-<stringmatch name="Float print #6" min="1" max="1">floatv6 = -NAN;</stringmatch>
|
||||
+<stringmatch name="Float print #6" min="1" max="1">floatv6 = -?NAN;</stringmatch>
|
||||
<stringmatch name="Float print #7" min="1" max="1">floatv7 = 3.141592e-06;</stringmatch>
|
||||
<stringmatch name="Float print #8" min="1" max="1">double1 = 0.6666666666666666;</stringmatch>
|
||||
<stringmatch name="Float print #9" min="1" max="1">double2 = 2.0;</stringmatch>
|
||||
<stringmatch name="Float print #10" min="1" max="1">double3 = -0.001;</stringmatch>
|
||||
<stringmatch name="Float print #11" min="1" max="1">double4 = 1e-10;</stringmatch>
|
||||
<stringmatch name="Float print #12" min="1" max="1">double5 = INFINITY;</stringmatch>
|
||||
-<stringmatch name="Float print #13" min="1" max="1">double6 = -NAN;</stringmatch>
|
||||
+<stringmatch name="Float print #13" min="1" max="1">double6 = -?NAN;</stringmatch>
|
||||
<stringmatch name="Float print #14" min="1" max="1">double7 = 3.1415926535897933e-06;</stringmatch>
|
||||
</decompilertest>
|
||||
--
|
||||
2.47.0
|
||||
|
||||
@@ -1,12 +1,11 @@
|
||||
From 0e437cb96249306d17f26ff6614871ecd9b37359 Mon Sep 17 00:00:00 2001
|
||||
From: "github-actions[bot]"
|
||||
<41898282+github-actions[bot]@users.noreply.github.com>
|
||||
Date: Wed, 2 Aug 2023 23:19:42 +1000
|
||||
Subject: [PATCH 1/2] Fix UBSAN errors in decompiler
|
||||
From d3de474854d052712217ad731fffcea6334808ff 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
|
||||
|
||||
Co-authored-by: Alex Cameron <asc@tetsuo.sh>
|
||||
---
|
||||
.../Decompiler/src/decompile/cpp/fspec.cc | 8 ++++++--
|
||||
.../src/decompile/cpp/funcdata_varnode.cc | 8 +++++++-
|
||||
.../Decompiler/src/decompile/cpp/op.cc | 6 +++++-
|
||||
.../Decompiler/src/decompile/cpp/opbehavior.cc | 8 +++++++-
|
||||
.../src/decompile/cpp/pcodecompile.cc | 18 +++++++++++-------
|
||||
@@ -14,16 +13,15 @@ Subject: [PATCH 1/2] Fix UBSAN errors in decompiler
|
||||
.../Decompiler/src/decompile/cpp/semantics.cc | 2 ++
|
||||
.../Decompiler/src/decompile/cpp/semantics.hh | 2 +-
|
||||
.../src/decompile/cpp/slgh_compile.cc | 2 +-
|
||||
.../Decompiler/src/decompile/cpp/slghsymbol.cc | 2 +-
|
||||
.../Decompiler/src/decompile/cpp/type.cc | 2 +-
|
||||
.../src/decompile/unittests/testfloatemu.cc | 2 +-
|
||||
12 files changed, 57 insertions(+), 21 deletions(-)
|
||||
10 files changed, 49 insertions(+), 19 deletions(-)
|
||||
|
||||
diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/fspec.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/fspec.cc
|
||||
index 8380d3cd..a18d5007 100644
|
||||
index 6ebec206c9..e5a1ad598c 100644
|
||||
--- a/Ghidra/Features/Decompiler/src/decompile/cpp/fspec.cc
|
||||
+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/fspec.cc
|
||||
@@ -2661,8 +2661,12 @@ void ProtoModelMerged::decode(Decoder &decoder)
|
||||
@@ -2868,8 +2868,12 @@ void ProtoModelMerged::decode(Decoder &decoder)
|
||||
modellist.push_back(mymodel);
|
||||
}
|
||||
decoder.closeElement(elemId);
|
||||
@@ -38,30 +36,11 @@ index 8380d3cd..a18d5007 100644
|
||||
}
|
||||
|
||||
void ParameterBasic::setTypeLock(bool val)
|
||||
diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/funcdata_varnode.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/funcdata_varnode.cc
|
||||
index f7781707..283d81c3 100644
|
||||
--- a/Ghidra/Features/Decompiler/src/decompile/cpp/funcdata_varnode.cc
|
||||
+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/funcdata_varnode.cc
|
||||
@@ -503,7 +503,13 @@ void Funcdata::setHighLevel(void)
|
||||
void Funcdata::transferVarnodeProperties(Varnode *vn,Varnode *newVn,int4 lsbOffset)
|
||||
|
||||
{
|
||||
- uintb newConsume = (vn->getConsume() >> 8*lsbOffset) & calc_mask(newVn->getSize());
|
||||
+ uintb newConsume = vn->getConsume();
|
||||
+ if (8*lsbOffset < sizeof(newConsume)) {
|
||||
+ newConsume >>= 8*lsbOffset;
|
||||
+ } else {
|
||||
+ newConsume = 0;
|
||||
+ }
|
||||
+ newConsume &= calc_mask(newVn->getSize());
|
||||
|
||||
uint4 vnFlags = vn->getFlags() & (Varnode::directwrite|Varnode::addrforce);
|
||||
|
||||
diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/op.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/op.cc
|
||||
index 0e3decc8..403ec35a 100644
|
||||
index d76a799960..37ba971a34 100644
|
||||
--- a/Ghidra/Features/Decompiler/src/decompile/cpp/op.cc
|
||||
+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/op.cc
|
||||
@@ -672,7 +672,11 @@ uintb PcodeOp::getNZMaskLocal(bool cliploop) const
|
||||
@@ -666,7 +666,11 @@ uintb PcodeOp::getNZMaskLocal(bool cliploop) const
|
||||
break;
|
||||
case CPUI_PIECE:
|
||||
resmask = getIn(0)->getNZMask();
|
||||
@@ -75,10 +54,10 @@ index 0e3decc8..403ec35a 100644
|
||||
break;
|
||||
case CPUI_INT_MULT:
|
||||
diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/opbehavior.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/opbehavior.cc
|
||||
index fcd75cc7..ed0e005a 100644
|
||||
index aebcfd9103..6c47e6eb15 100644
|
||||
--- a/Ghidra/Features/Decompiler/src/decompile/cpp/opbehavior.cc
|
||||
+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/opbehavior.cc
|
||||
@@ -750,7 +750,13 @@ uintb OpBehaviorPiece::evaluateBinary(int4 sizeout,int4 sizein,uintb in1,uintb i
|
||||
@@ -746,7 +746,13 @@ uintb OpBehaviorPiece::evaluateBinary(int4 sizeout,int4 sizein,uintb in1,uintb i
|
||||
uintb OpBehaviorSubpiece::evaluateBinary(int4 sizeout,int4 sizein,uintb in1,uintb in2) const
|
||||
|
||||
{
|
||||
@@ -94,7 +73,7 @@ index fcd75cc7..ed0e005a 100644
|
||||
}
|
||||
|
||||
diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/pcodecompile.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/pcodecompile.cc
|
||||
index ca9d71ab..85d4dd28 100644
|
||||
index ca9d71ab99..85d4dd281d 100644
|
||||
--- a/Ghidra/Features/Decompiler/src/decompile/cpp/pcodecompile.cc
|
||||
+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/pcodecompile.cc
|
||||
@@ -621,8 +621,10 @@ vector<OpTpl *> *PcodeCompile::assignBitRange(VarnodeTpl *vn,uint4 bitoffset,uin
|
||||
@@ -137,10 +116,10 @@ index ca9d71ab..85d4dd28 100644
|
||||
return res;
|
||||
}
|
||||
diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/ruleaction.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/ruleaction.cc
|
||||
index 4851365d..d069d1c9 100644
|
||||
index f667c6ca95..6ea3916520 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)
|
||||
@@ -977,7 +977,12 @@ int4 RulePullsubIndirect::applyOp(PcodeOp *op,Funcdata &data)
|
||||
Varnode *outvn = op->getOut();
|
||||
if (outvn->isPrecisLo()||outvn->isPrecisHi()) return 0; // Don't pull apart double precision object
|
||||
|
||||
@@ -154,7 +133,7 @@ index 4851365d..d069d1c9 100644
|
||||
consume = ~consume;
|
||||
if ((consume & indir->getIn(0)->getConsume())!=0) return 0;
|
||||
|
||||
@@ -6782,8 +6787,9 @@ int4 RulePtrsubCharConstant::applyOp(PcodeOp *op,Funcdata &data)
|
||||
@@ -7026,8 +7031,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;
|
||||
@@ -166,7 +145,7 @@ index 4851365d..d069d1c9 100644
|
||||
Varnode *vn1 = op->getIn(1);
|
||||
if (!vn1->isConstant()) return 0;
|
||||
Varnode *outvn = op->getOut();
|
||||
@@ -8593,7 +8599,11 @@ int4 RuleSubvarSubpiece::applyOp(PcodeOp *op,Funcdata &data)
|
||||
@@ -8831,7 +8837,11 @@ int4 RuleSubvarSubpiece::applyOp(PcodeOp *op,Funcdata &data)
|
||||
Varnode *outvn = op->getOut();
|
||||
int4 flowsize = outvn->getSize();
|
||||
uintb mask = calc_mask( flowsize );
|
||||
@@ -180,7 +159,7 @@ index 4851365d..d069d1c9 100644
|
||||
if (!aggressive) {
|
||||
if ((vn->getConsume() & mask) != vn->getConsume()) return 0;
|
||||
diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/semantics.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/semantics.cc
|
||||
index 2e3531ea..42482be7 100644
|
||||
index cd9b9835b1..8a4616c3b9 100644
|
||||
--- a/Ghidra/Features/Decompiler/src/decompile/cpp/semantics.cc
|
||||
+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/semantics.cc
|
||||
@@ -22,6 +22,7 @@ ConstTpl::ConstTpl(const_type tp)
|
||||
@@ -200,12 +179,12 @@ index 2e3531ea..42482be7 100644
|
||||
|
||||
bool ConstTpl::isConstSpace(void) const
|
||||
diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/semantics.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/semantics.hh
|
||||
index 8e283dca..652600c1 100644
|
||||
index e0b069959d..9117a45c75 100644
|
||||
--- a/Ghidra/Features/Decompiler/src/decompile/cpp/semantics.hh
|
||||
+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/semantics.hh
|
||||
@@ -48,7 +48,7 @@ private:
|
||||
static void printHandleSelector(ostream &s,v_field val);
|
||||
static v_field readHandleSelector(const string &name);
|
||||
@@ -47,7 +47,7 @@ class ConstTpl {
|
||||
uintb value_real;
|
||||
v_field select; // Which part of handle to use as constant
|
||||
public:
|
||||
- ConstTpl(void) { type = real; value_real = 0; }
|
||||
+ ConstTpl(void) { type = real; value_real = 0; select = v_space; }
|
||||
@@ -213,10 +192,10 @@ index 8e283dca..652600c1 100644
|
||||
type=op2.type; value=op2.value; value_real=op2.value_real; select=op2.select; }
|
||||
ConstTpl(const_type tp,uintb val);
|
||||
diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/slgh_compile.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/slgh_compile.cc
|
||||
index b40f7438..3c37958d 100644
|
||||
index 50d85e22ba..9f3b456229 100644
|
||||
--- a/Ghidra/Features/Decompiler/src/decompile/cpp/slgh_compile.cc
|
||||
+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/slgh_compile.cc
|
||||
@@ -2163,8 +2163,8 @@ string SleighCompile::checkSymbols(SymbolScope *scope)
|
||||
@@ -2164,8 +2164,8 @@ string SleighCompile::checkSymbols(SymbolScope *scope)
|
||||
ostringstream msg;
|
||||
SymbolTree::const_iterator iter;
|
||||
for(iter=scope->begin();iter!=scope->end();++iter) {
|
||||
@@ -226,24 +205,11 @@ index b40f7438..3c37958d 100644
|
||||
if (sym->getRefCount() == 0)
|
||||
msg << " Label <" << sym->getName() << "> was placed but not used" << endl;
|
||||
else if (!sym->isPlaced())
|
||||
diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/slghsymbol.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/slghsymbol.cc
|
||||
index b308e1b7..af2982ae 100644
|
||||
--- a/Ghidra/Features/Decompiler/src/decompile/cpp/slghsymbol.cc
|
||||
+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/slghsymbol.cc
|
||||
@@ -2569,7 +2569,7 @@ void ContextOp::restoreXml(const Element *el,SleighBase *trans)
|
||||
const List &list(el->getChildren());
|
||||
List::const_iterator iter;
|
||||
iter = list.begin();
|
||||
- patexp = (PatternValue *)PatternExpression::restoreExpression(*iter,trans);
|
||||
+ patexp = PatternExpression::restoreExpression(*iter,trans);
|
||||
patexp->layClaim();
|
||||
}
|
||||
|
||||
diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/type.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/type.cc
|
||||
index 30faf0b6..e76a0619 100644
|
||||
index 7cda43127f..20a5bc1c83 100644
|
||||
--- a/Ghidra/Features/Decompiler/src/decompile/cpp/type.cc
|
||||
+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/type.cc
|
||||
@@ -3359,8 +3359,8 @@ void TypeFactory::recalcPointerSubmeta(Datatype *base,sub_metatype sub)
|
||||
@@ -3661,8 +3661,8 @@ void TypeFactory::recalcPointerSubmeta(Datatype *base,sub_metatype sub)
|
||||
top.submeta = sub; // Search on the incorrect submeta
|
||||
iter = tree.lower_bound(&top);
|
||||
while(iter != tree.end()) {
|
||||
@@ -254,10 +220,10 @@ index 30faf0b6..e76a0619 100644
|
||||
++iter;
|
||||
if (ptr->submeta == sub) {
|
||||
diff --git a/Ghidra/Features/Decompiler/src/decompile/unittests/testfloatemu.cc b/Ghidra/Features/Decompiler/src/decompile/unittests/testfloatemu.cc
|
||||
index c35bde87..061e5367 100644
|
||||
index 2571f55f1a..fe40e22b1b 100644
|
||||
--- a/Ghidra/Features/Decompiler/src/decompile/unittests/testfloatemu.cc
|
||||
+++ b/Ghidra/Features/Decompiler/src/decompile/unittests/testfloatemu.cc
|
||||
@@ -346,7 +346,7 @@ TEST(float_opTrunc_to_int) {
|
||||
@@ -375,7 +375,7 @@ TEST(float_opTrunc_to_int) {
|
||||
|
||||
for(float f:float_test_values) {
|
||||
// avoid undefined behavior
|
||||
@@ -267,5 +233,5 @@ index c35bde87..061e5367 100644
|
||||
uintb true_result = ((uintb)(int32_t)f) & 0xffffffff;
|
||||
uintb encoding = format.getEncoding(f);
|
||||
--
|
||||
2.39.2 (Apple Git-143)
|
||||
2.47.0
|
||||
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
From 95f230f46bdb95aa4aab7f5d320691f87107fb36 Mon Sep 17 00:00:00 2001
|
||||
From: "github-actions[bot]"
|
||||
<41898282+github-actions[bot]@users.noreply.github.com>
|
||||
Date: Wed, 2 Aug 2023 23:20:14 +1000
|
||||
Subject: [PATCH 2/2] Use `stroull` instead of `stroul` to parse address
|
||||
From 4bbcb71e2c2cf1362628917c26879bbcb4717665 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
|
||||
offsets
|
||||
|
||||
---
|
||||
@@ -10,7 +9,7 @@ Subject: [PATCH 2/2] Use `stroull` instead of `stroul` to parse address
|
||||
1 file changed, 6 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/space.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/space.cc
|
||||
index bf4e1dc9..594b4583 100644
|
||||
index dbaa2e775f..72927bf379 100644
|
||||
--- a/Ghidra/Features/Decompiler/src/decompile/cpp/space.cc
|
||||
+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/space.cc
|
||||
@@ -16,6 +16,8 @@
|
||||
@@ -22,7 +21,7 @@ index bf4e1dc9..594b4583 100644
|
||||
namespace ghidra {
|
||||
|
||||
AttributeId ATTRIB_BASE = AttributeId("base",89);
|
||||
@@ -290,7 +292,10 @@ uintb AddrSpace::read(const string &s,int4 &size) const
|
||||
@@ -277,7 +279,10 @@ uintb AddrSpace::read(const string &s,int4 &size) const
|
||||
}
|
||||
}
|
||||
catch(LowlevelError &err) { // Name doesn't exist
|
||||
@@ -35,5 +34,5 @@ index bf4e1dc9..594b4583 100644
|
||||
enddata = (const char *) tmpdata;
|
||||
if (enddata - s.c_str() == s.size()) { // If no size or offset override
|
||||
--
|
||||
2.39.2 (Apple Git-143)
|
||||
2.47.0
|
||||
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
From 31c3e037e8104e9060b73c62bb5895a8665efbcb Mon Sep 17 00:00:00 2001
|
||||
From: Eric Kilmer <eric.d.kilmer@gmail.com>
|
||||
Date: Sat, 30 Mar 2024 18:46:16 -0400
|
||||
Subject: [PATCH 3/6] Add missing index check to prevent errors in Windows
|
||||
|
||||
Not sure why this only appears when testing on Windows.
|
||||
---
|
||||
Ghidra/Features/Decompiler/src/decompile/cpp/ifacedecomp.cc | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/ifacedecomp.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/ifacedecomp.cc
|
||||
index 0237adb820..5048a9d480 100644
|
||||
--- a/Ghidra/Features/Decompiler/src/decompile/cpp/ifacedecomp.cc
|
||||
+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/ifacedecomp.cc
|
||||
@@ -1844,7 +1844,7 @@ void IfcProtooverride::execute(istream &s)
|
||||
s >> ws;
|
||||
Address callpoint(parse_machaddr(s,discard,*dcp->conf->types));
|
||||
int4 i;
|
||||
- for(i=0;dcp->fd->numCalls();++i)
|
||||
+ for(i=0;i<dcp->fd->numCalls();++i)
|
||||
if (dcp->fd->getCallSpecs(i)->getOp()->getAddr() == callpoint) break;
|
||||
if (i == dcp->fd->numCalls())
|
||||
throw IfaceExecutionError("No call is made at this address");
|
||||
--
|
||||
2.47.0
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
From 7eb62bb534ac02b723baad0bb0a9cb7d33813972 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 4/6] Use string resize instead of reserve
|
||||
|
||||
assign will fix up the size to hold all of what's copied
|
||||
---
|
||||
Ghidra/Features/Decompiler/src/decompile/cpp/stringmanage.cc | 3 +--
|
||||
1 file changed, 1 insertion(+), 2 deletions(-)
|
||||
|
||||
diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/stringmanage.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/stringmanage.cc
|
||||
index 5f5fa0c7b3..4cd77156f2 100644
|
||||
--- a/Ghidra/Features/Decompiler/src/decompile/cpp/stringmanage.cc
|
||||
+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/stringmanage.cc
|
||||
@@ -67,7 +67,6 @@ void StringManager::assignStringData(StringData &data,const uint1 *buf,int4 size
|
||||
|
||||
{
|
||||
if (charsize == 1 && numChars < maximumChars) {
|
||||
- data.byteData.reserve(size);
|
||||
data.byteData.assign(buf,buf+size);
|
||||
}
|
||||
else {
|
||||
@@ -77,9 +76,9 @@ void StringManager::assignStringData(StringData &data,const uint1 *buf,int4 size
|
||||
return;
|
||||
string resString = s.str();
|
||||
int4 newSize = resString.size();
|
||||
- data.byteData.reserve(newSize + 1);
|
||||
const uint1 *ptr = (const uint1 *)resString.c_str();
|
||||
data.byteData.assign(ptr,ptr+newSize);
|
||||
+ data.byteData.resize(newSize + 1, 0);
|
||||
data.byteData[newSize] = 0; // Make sure there is a null terminator
|
||||
}
|
||||
data.isTruncated = (numChars >= maximumChars);
|
||||
--
|
||||
2.47.0
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
From 9b118da968eac4a5ad910dc51d7d70150bab0408 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 5/6] 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.
|
||||
---
|
||||
.../Decompiler/src/decompile/unittests/testfloatemu.cc | 3 ++-
|
||||
1 file changed, 2 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/Ghidra/Features/Decompiler/src/decompile/unittests/testfloatemu.cc b/Ghidra/Features/Decompiler/src/decompile/unittests/testfloatemu.cc
|
||||
index fe40e22b1b..91440e2510 100644
|
||||
--- a/Ghidra/Features/Decompiler/src/decompile/unittests/testfloatemu.cc
|
||||
+++ b/Ghidra/Features/Decompiler/src/decompile/unittests/testfloatemu.cc
|
||||
@@ -184,7 +184,8 @@ TEST(double_decimal_precision) {
|
||||
double f0 = doubleFromRawBits(0x3fc5555555555555);
|
||||
ASSERT_EQUALS(ff.printDecimal(f0, false), "0.16666666666666666");
|
||||
double f1 = doubleFromRawBits(0x7fefffffffffffff);
|
||||
- ASSERT_EQUALS(ff.printDecimal(f1, false), "1.79769313486232e+308");
|
||||
+ // Windows and Mac print 1.7976931348623157e+308
|
||||
+ // ASSERT_EQUALS(ff.printDecimal(f1, false), "1.79769313486232e+308");
|
||||
double f2 = doubleFromRawBits(0x3fd555555c7dda4b);
|
||||
ASSERT_EQUALS(ff.printDecimal(f2, false), "0.33333334");
|
||||
double f3 = doubleFromRawBits(0x3fd0000000000000);
|
||||
--
|
||||
2.47.0
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
From f130a89a600a210e12e4505a4533d27ea7b7e4f7 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 6/6] Allow positive or negative NAN in decompiler floating
|
||||
point test
|
||||
|
||||
At least on Apple Silicon, this test reports positive NAN.
|
||||
|
||||
Use the regex optional operator '?' to allow for positive or negative
|
||||
NAN.
|
||||
---
|
||||
.../Decompiler/src/decompile/datatests/floatprint.xml | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/Ghidra/Features/Decompiler/src/decompile/datatests/floatprint.xml b/Ghidra/Features/Decompiler/src/decompile/datatests/floatprint.xml
|
||||
index f8108d3d32..1060a3e193 100644
|
||||
--- a/Ghidra/Features/Decompiler/src/decompile/datatests/floatprint.xml
|
||||
+++ b/Ghidra/Features/Decompiler/src/decompile/datatests/floatprint.xml
|
||||
@@ -58,13 +58,13 @@ bbbdd7d9df7cdb3d000000000000f03f
|
||||
<stringmatch name="Float print #3" min="1" max="1">floatv3 = -0.001;</stringmatch>
|
||||
<stringmatch name="Float print #4" min="1" max="1">floatv4 = 1e-06;</stringmatch>
|
||||
<stringmatch name="Float print #5" min="1" max="1">floatv5 = INFINITY;</stringmatch>
|
||||
-<stringmatch name="Float print #6" min="1" max="1">floatv6 = -NAN;</stringmatch>
|
||||
+<stringmatch name="Float print #6" min="1" max="1">floatv6 = -?NAN;</stringmatch>
|
||||
<stringmatch name="Float print #7" min="1" max="1">floatv7 = 3.141592e-06;</stringmatch>
|
||||
<stringmatch name="Float print #8" min="1" max="1">double1 = 0.6666666666666666;</stringmatch>
|
||||
<stringmatch name="Float print #9" min="1" max="1">double2 = 2.0;</stringmatch>
|
||||
<stringmatch name="Float print #10" min="1" max="1">double3 = -0.001;</stringmatch>
|
||||
<stringmatch name="Float print #11" min="1" max="1">double4 = 1e-10;</stringmatch>
|
||||
<stringmatch name="Float print #12" min="1" max="1">double5 = INFINITY;</stringmatch>
|
||||
-<stringmatch name="Float print #13" min="1" max="1">double6 = -NAN;</stringmatch>
|
||||
+<stringmatch name="Float print #13" min="1" max="1">double6 = -?NAN;</stringmatch>
|
||||
<stringmatch name="Float print #14" min="1" max="1">double7 = 3.1415926535897933e-06;</stringmatch>
|
||||
</decompilertest>
|
||||
--
|
||||
2.47.0
|
||||
|
||||
@@ -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 "10.4")
|
||||
set(ghidra_version "11.2.1")
|
||||
set(ghidra_git_tag "Ghidra_${ghidra_version}_build")
|
||||
set(ghidra_shallow TRUE)
|
||||
|
||||
@@ -40,15 +40,19 @@ set(ghidra_patches
|
||||
"${GIT_EXECUTABLE}" am --ignore-space-change --ignore-whitespace --no-gpg-sign
|
||||
"${CMAKE_CURRENT_LIST_DIR}/patches/stable/0001-Fix-UBSAN-errors-in-decompiler.patch"
|
||||
"${CMAKE_CURRENT_LIST_DIR}/patches/stable/0002-Use-stroull-instead-of-stroul-to-parse-address-offse.patch"
|
||||
"${CMAKE_CURRENT_LIST_DIR}/patches/stable/0003-Add-missing-index-check-to-prevent-errors-in-Windows.patch"
|
||||
"${CMAKE_CURRENT_LIST_DIR}/patches/stable/0004-Use-string-resize-instead-of-reserve.patch"
|
||||
"${CMAKE_CURRENT_LIST_DIR}/patches/stable/0005-Ignore-floating-point-test-due-to-compilation-differ.patch"
|
||||
"${CMAKE_CURRENT_LIST_DIR}/patches/stable/0006-Allow-positive-or-negative-NAN-in-decompiler-floatin.patch"
|
||||
)
|
||||
|
||||
# Ghidra pinned commits used for pinning last known working HEAD commit
|
||||
if("${sleigh_RELEASE_TYPE}" STREQUAL "HEAD")
|
||||
# TODO: Try to remember to look at Ghidra/application.properties
|
||||
# TODO: CMake only likes numeric characters in the version string....
|
||||
set(ghidra_head_version "10.5")
|
||||
set(ghidra_head_version "11.3")
|
||||
set(ghidra_version "${ghidra_head_version}")
|
||||
set(ghidra_head_git_tag "54e0ab1a3897dad020275d6395acfe0c56c3994d")
|
||||
set(ghidra_head_git_tag "ffaa97cbd986e71143d45260cd31167ed0917a96")
|
||||
set(ghidra_git_tag "${ghidra_head_git_tag}")
|
||||
set(ghidra_shallow FALSE)
|
||||
set(ghidra_patches
|
||||
@@ -57,6 +61,9 @@ 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/0004-Use-string-resize-instead-of-reserve.patch"
|
||||
"${CMAKE_CURRENT_LIST_DIR}/patches/HEAD/0005-Ignore-floating-point-test-due-to-compilation-differ.patch"
|
||||
"${CMAKE_CURRENT_LIST_DIR}/patches/HEAD/0006-Allow-positive-or-negative-NAN-in-decompiler-floatin.patch"
|
||||
)
|
||||
string(SUBSTRING "${ghidra_git_tag}" 0 7 ghidra_short_commit)
|
||||
else()
|
||||
@@ -162,6 +169,10 @@ set(sleigh_deccore_source_list
|
||||
"${library_root}/opbehavior.cc"
|
||||
"${library_root}/paramid.cc"
|
||||
"${library_root}/unionresolve.cc"
|
||||
"${library_root}/modelrules.cc"
|
||||
"${library_root}/signature.cc"
|
||||
"${library_root}/multiprecision.cc"
|
||||
"${library_root}/constseq.cc"
|
||||
)
|
||||
#if("${sleigh_RELEASE_TYPE}" STREQUAL "HEAD")
|
||||
# list(APPEND sleigh_deccore_source_list
|
||||
@@ -195,7 +206,13 @@ set(sleigh_source_list
|
||||
"${library_root}/semantics.cc"
|
||||
"${library_root}/context.cc"
|
||||
"${library_root}/filemanage.cc"
|
||||
"${library_root}/slaformat.cc"
|
||||
"${library_root}/compression.cc"
|
||||
)
|
||||
# if("${sleigh_RELEASE_TYPE}" STREQUAL "HEAD")
|
||||
# list(APPEND sleigh_source_list
|
||||
# )
|
||||
# endif()
|
||||
|
||||
set(sleigh_ghidra_source_list
|
||||
"${library_root}/ghidra_arch.cc"
|
||||
@@ -209,7 +226,12 @@ set(sleigh_ghidra_source_list
|
||||
"${library_root}/ghidra_process.cc"
|
||||
"${library_root}/comment_ghidra.cc"
|
||||
"${library_root}/string_ghidra.cc"
|
||||
"${library_root}/signature_ghidra.cc"
|
||||
)
|
||||
# if("${sleigh_RELEASE_TYPE}" STREQUAL "HEAD")
|
||||
# list(APPEND sleigh_ghidra_source_list
|
||||
# )
|
||||
# endif()
|
||||
|
||||
set(sleigh_slacomp_source_list
|
||||
"${library_root}/slgh_compile.cc"
|
||||
|
||||
@@ -28,6 +28,8 @@ set(spec_file_list
|
||||
"${ghidrasource_SOURCE_DIR}/Ghidra/Processors/ARM/data/languages/ARM7_le.slaspec"
|
||||
"${ghidrasource_SOURCE_DIR}/Ghidra/Processors/ARM/data/languages/ARM8_be.slaspec"
|
||||
"${ghidrasource_SOURCE_DIR}/Ghidra/Processors/ARM/data/languages/ARM8_le.slaspec"
|
||||
"${ghidrasource_SOURCE_DIR}/Ghidra/Processors/ARM/data/languages/ARM8m_be.slaspec"
|
||||
"${ghidrasource_SOURCE_DIR}/Ghidra/Processors/ARM/data/languages/ARM8m_le.slaspec"
|
||||
"${ghidrasource_SOURCE_DIR}/Ghidra/Processors/Atmel/data/languages/avr32a.slaspec"
|
||||
"${ghidrasource_SOURCE_DIR}/Ghidra/Processors/Atmel/data/languages/avr8.slaspec"
|
||||
"${ghidrasource_SOURCE_DIR}/Ghidra/Processors/Atmel/data/languages/avr8e.slaspec"
|
||||
@@ -57,6 +59,12 @@ set(spec_file_list
|
||||
"${ghidrasource_SOURCE_DIR}/Ghidra/Processors/HCS12/data/languages/HCS12.slaspec"
|
||||
"${ghidrasource_SOURCE_DIR}/Ghidra/Processors/HCS12/data/languages/HCS12X.slaspec"
|
||||
"${ghidrasource_SOURCE_DIR}/Ghidra/Processors/JVM/data/languages/JVM.slaspec"
|
||||
"${ghidrasource_SOURCE_DIR}/Ghidra/Processors/Loongarch/data/languages/loongarch32_f32.slaspec"
|
||||
"${ghidrasource_SOURCE_DIR}/Ghidra/Processors/Loongarch/data/languages/loongarch32_f64.slaspec"
|
||||
"${ghidrasource_SOURCE_DIR}/Ghidra/Processors/Loongarch/data/languages/loongarch64_f32.slaspec"
|
||||
"${ghidrasource_SOURCE_DIR}/Ghidra/Processors/Loongarch/data/languages/loongarch64_f64.slaspec"
|
||||
"${ghidrasource_SOURCE_DIR}/Ghidra/Processors/M16C/data/languages/M16C_60.slaspec"
|
||||
"${ghidrasource_SOURCE_DIR}/Ghidra/Processors/M16C/data/languages/M16C_80.slaspec"
|
||||
"${ghidrasource_SOURCE_DIR}/Ghidra/Processors/M8C/data/languages/m8c.slaspec"
|
||||
"${ghidrasource_SOURCE_DIR}/Ghidra/Processors/MC6800/data/languages/6805.slaspec"
|
||||
"${ghidrasource_SOURCE_DIR}/Ghidra/Processors/MC6800/data/languages/6809.slaspec"
|
||||
@@ -87,6 +95,8 @@ set(spec_file_list
|
||||
"${ghidrasource_SOURCE_DIR}/Ghidra/Processors/PowerPC/data/languages/ppc_32_be.slaspec"
|
||||
"${ghidrasource_SOURCE_DIR}/Ghidra/Processors/PowerPC/data/languages/ppc_32_e500_be.slaspec"
|
||||
"${ghidrasource_SOURCE_DIR}/Ghidra/Processors/PowerPC/data/languages/ppc_32_e500_le.slaspec"
|
||||
"${ghidrasource_SOURCE_DIR}/Ghidra/Processors/PowerPC/data/languages/ppc_32_e500mc_be.slaspec"
|
||||
"${ghidrasource_SOURCE_DIR}/Ghidra/Processors/PowerPC/data/languages/ppc_32_e500mc_le.slaspec"
|
||||
"${ghidrasource_SOURCE_DIR}/Ghidra/Processors/PowerPC/data/languages/ppc_32_le.slaspec"
|
||||
"${ghidrasource_SOURCE_DIR}/Ghidra/Processors/PowerPC/data/languages/ppc_32_quicciii_be.slaspec"
|
||||
"${ghidrasource_SOURCE_DIR}/Ghidra/Processors/PowerPC/data/languages/ppc_32_quicciii_le.slaspec"
|
||||
@@ -122,6 +132,8 @@ set(spec_file_list
|
||||
"${ghidrasource_SOURCE_DIR}/Ghidra/Processors/Toy/data/languages/toy_wsz_be.slaspec"
|
||||
"${ghidrasource_SOURCE_DIR}/Ghidra/Processors/Toy/data/languages/toy_wsz_le.slaspec"
|
||||
"${ghidrasource_SOURCE_DIR}/Ghidra/Processors/V850/data/languages/V850.slaspec"
|
||||
"${ghidrasource_SOURCE_DIR}/Ghidra/Processors/Xtensa/data/languages/xtensa_be.slaspec"
|
||||
"${ghidrasource_SOURCE_DIR}/Ghidra/Processors/Xtensa/data/languages/xtensa_le.slaspec"
|
||||
"${ghidrasource_SOURCE_DIR}/Ghidra/Processors/Z80/data/languages/z180.slaspec"
|
||||
"${ghidrasource_SOURCE_DIR}/Ghidra/Processors/Z80/data/languages/z80.slaspec"
|
||||
"${ghidrasource_SOURCE_DIR}/Ghidra/Processors/eBPF/data/languages/eBPF_le.slaspec"
|
||||
|
||||
@@ -28,6 +28,8 @@ set(spec_file_list
|
||||
"${ghidrasource_SOURCE_DIR}/Ghidra/Processors/ARM/data/languages/ARM7_le.slaspec"
|
||||
"${ghidrasource_SOURCE_DIR}/Ghidra/Processors/ARM/data/languages/ARM8_be.slaspec"
|
||||
"${ghidrasource_SOURCE_DIR}/Ghidra/Processors/ARM/data/languages/ARM8_le.slaspec"
|
||||
"${ghidrasource_SOURCE_DIR}/Ghidra/Processors/ARM/data/languages/ARM8m_be.slaspec"
|
||||
"${ghidrasource_SOURCE_DIR}/Ghidra/Processors/ARM/data/languages/ARM8m_le.slaspec"
|
||||
"${ghidrasource_SOURCE_DIR}/Ghidra/Processors/Atmel/data/languages/avr32a.slaspec"
|
||||
"${ghidrasource_SOURCE_DIR}/Ghidra/Processors/Atmel/data/languages/avr8.slaspec"
|
||||
"${ghidrasource_SOURCE_DIR}/Ghidra/Processors/Atmel/data/languages/avr8e.slaspec"
|
||||
@@ -57,6 +59,12 @@ set(spec_file_list
|
||||
"${ghidrasource_SOURCE_DIR}/Ghidra/Processors/HCS12/data/languages/HCS12.slaspec"
|
||||
"${ghidrasource_SOURCE_DIR}/Ghidra/Processors/HCS12/data/languages/HCS12X.slaspec"
|
||||
"${ghidrasource_SOURCE_DIR}/Ghidra/Processors/JVM/data/languages/JVM.slaspec"
|
||||
"${ghidrasource_SOURCE_DIR}/Ghidra/Processors/Loongarch/data/languages/loongarch32_f32.slaspec"
|
||||
"${ghidrasource_SOURCE_DIR}/Ghidra/Processors/Loongarch/data/languages/loongarch32_f64.slaspec"
|
||||
"${ghidrasource_SOURCE_DIR}/Ghidra/Processors/Loongarch/data/languages/loongarch64_f32.slaspec"
|
||||
"${ghidrasource_SOURCE_DIR}/Ghidra/Processors/Loongarch/data/languages/loongarch64_f64.slaspec"
|
||||
"${ghidrasource_SOURCE_DIR}/Ghidra/Processors/M16C/data/languages/M16C_60.slaspec"
|
||||
"${ghidrasource_SOURCE_DIR}/Ghidra/Processors/M16C/data/languages/M16C_80.slaspec"
|
||||
"${ghidrasource_SOURCE_DIR}/Ghidra/Processors/M8C/data/languages/m8c.slaspec"
|
||||
"${ghidrasource_SOURCE_DIR}/Ghidra/Processors/MC6800/data/languages/6805.slaspec"
|
||||
"${ghidrasource_SOURCE_DIR}/Ghidra/Processors/MC6800/data/languages/6809.slaspec"
|
||||
@@ -87,6 +95,8 @@ set(spec_file_list
|
||||
"${ghidrasource_SOURCE_DIR}/Ghidra/Processors/PowerPC/data/languages/ppc_32_be.slaspec"
|
||||
"${ghidrasource_SOURCE_DIR}/Ghidra/Processors/PowerPC/data/languages/ppc_32_e500_be.slaspec"
|
||||
"${ghidrasource_SOURCE_DIR}/Ghidra/Processors/PowerPC/data/languages/ppc_32_e500_le.slaspec"
|
||||
"${ghidrasource_SOURCE_DIR}/Ghidra/Processors/PowerPC/data/languages/ppc_32_e500mc_be.slaspec"
|
||||
"${ghidrasource_SOURCE_DIR}/Ghidra/Processors/PowerPC/data/languages/ppc_32_e500mc_le.slaspec"
|
||||
"${ghidrasource_SOURCE_DIR}/Ghidra/Processors/PowerPC/data/languages/ppc_32_le.slaspec"
|
||||
"${ghidrasource_SOURCE_DIR}/Ghidra/Processors/PowerPC/data/languages/ppc_32_quicciii_be.slaspec"
|
||||
"${ghidrasource_SOURCE_DIR}/Ghidra/Processors/PowerPC/data/languages/ppc_32_quicciii_le.slaspec"
|
||||
@@ -122,6 +132,8 @@ set(spec_file_list
|
||||
"${ghidrasource_SOURCE_DIR}/Ghidra/Processors/Toy/data/languages/toy_wsz_be.slaspec"
|
||||
"${ghidrasource_SOURCE_DIR}/Ghidra/Processors/Toy/data/languages/toy_wsz_le.slaspec"
|
||||
"${ghidrasource_SOURCE_DIR}/Ghidra/Processors/V850/data/languages/V850.slaspec"
|
||||
"${ghidrasource_SOURCE_DIR}/Ghidra/Processors/Xtensa/data/languages/xtensa_be.slaspec"
|
||||
"${ghidrasource_SOURCE_DIR}/Ghidra/Processors/Xtensa/data/languages/xtensa_le.slaspec"
|
||||
"${ghidrasource_SOURCE_DIR}/Ghidra/Processors/Z80/data/languages/z180.slaspec"
|
||||
"${ghidrasource_SOURCE_DIR}/Ghidra/Processors/Z80/data/languages/z80.slaspec"
|
||||
"${ghidrasource_SOURCE_DIR}/Ghidra/Processors/eBPF/data/languages/eBPF_le.slaspec"
|
||||
|
||||
+113
-102
@@ -15,110 +15,121 @@
|
||||
#pragma GCC diagnostic ignored "-Wsign-compare"
|
||||
#pragma GCC diagnostic ignored "-Wunused-parameter"
|
||||
#endif
|
||||
#include <sleigh/action.hh>
|
||||
#include <sleigh/address.hh>
|
||||
#include <sleigh/architecture.hh>
|
||||
#include <sleigh/block.hh>
|
||||
#include <sleigh/blockaction.hh>
|
||||
#include <sleigh/callgraph.hh>
|
||||
#include <sleigh/capability.hh>
|
||||
#include <sleigh/cast.hh>
|
||||
#include <sleigh/codedata.hh>
|
||||
#include <sleigh/comment.hh>
|
||||
#include <sleigh/comment_ghidra.hh>
|
||||
#include <sleigh/condexe.hh>
|
||||
#include <sleigh/context.hh>
|
||||
#include <sleigh/coreaction.hh>
|
||||
#include <sleigh/cover.hh>
|
||||
#include <sleigh/cpool.hh>
|
||||
#include <sleigh/cpool_ghidra.hh>
|
||||
#include <sleigh/crc32.hh>
|
||||
#include <sleigh/database.hh>
|
||||
#include <sleigh/database_ghidra.hh>
|
||||
#include <sleigh/doccore.hh>
|
||||
#include <sleigh/docmain.hh>
|
||||
#include <sleigh/double.hh>
|
||||
#include <sleigh/dynamic.hh>
|
||||
#include <sleigh/emulate.hh>
|
||||
#include <sleigh/emulateutil.hh>
|
||||
#include <sleigh/error.hh>
|
||||
#include <sleigh/filemanage.hh>
|
||||
#include <sleigh/float.hh>
|
||||
#include <sleigh/flow.hh>
|
||||
#include <sleigh/fspec.hh>
|
||||
#include <sleigh/funcdata.hh>
|
||||
#include <sleigh/ghidra_arch.hh>
|
||||
#include <sleigh/ghidra_context.hh>
|
||||
#include <sleigh/ghidra_process.hh>
|
||||
#include <sleigh/ghidra_translate.hh>
|
||||
#include <sleigh/globalcontext.hh>
|
||||
#include <sleigh/grammar.hh>
|
||||
#include <sleigh/graph.hh>
|
||||
#include <sleigh/heritage.hh>
|
||||
#include <sleigh/ifacedecomp.hh>
|
||||
#include <sleigh/ifaceterm.hh>
|
||||
#include <sleigh/inject_ghidra.hh>
|
||||
#include <sleigh/inject_sleigh.hh>
|
||||
#include <sleigh/interface.hh>
|
||||
#include <sleigh/jumptable.hh>
|
||||
#include <sleigh/libdecomp.hh>
|
||||
#include <sleigh/loadimage.hh>
|
||||
#include <sleigh/loadimage_ghidra.hh>
|
||||
#include <sleigh/loadimage_xml.hh>
|
||||
#include <sleigh/memstate.hh>
|
||||
#include <sleigh/merge.hh>
|
||||
#include <sleigh/op.hh>
|
||||
#include <sleigh/opbehavior.hh>
|
||||
#include <sleigh/opcodes.hh>
|
||||
#include <sleigh/options.hh>
|
||||
#include <sleigh/override.hh>
|
||||
#include <sleigh/paramid.hh>
|
||||
#include <sleigh/partmap.hh>
|
||||
#include <sleigh/pcodecompile.hh>
|
||||
#include <sleigh/pcodeinject.hh>
|
||||
#include <sleigh/pcodeparse.hh>
|
||||
#include <sleigh/pcoderaw.hh>
|
||||
#include <sleigh/prefersplit.hh>
|
||||
#include <sleigh/prettyprint.hh>
|
||||
#include <sleigh/printc.hh>
|
||||
#include <sleigh/printjava.hh>
|
||||
#include <sleigh/printlanguage.hh>
|
||||
#include <sleigh/rangemap.hh>
|
||||
#include <sleigh/rangeutil.hh>
|
||||
#include <sleigh/raw_arch.hh>
|
||||
#include <sleigh/ruleaction.hh>
|
||||
#include <sleigh/rulecompile.hh>
|
||||
#include <sleigh/semantics.hh>
|
||||
#include <sleigh/sleigh.hh>
|
||||
#include <sleigh/sleigh_arch.hh>
|
||||
#include <sleigh/sleighbase.hh>
|
||||
#include <sleigh/slgh_compile.hh>
|
||||
#include <ghidra/action.hh>
|
||||
#include <ghidra/address.hh>
|
||||
#include <ghidra/architecture.hh>
|
||||
#include <ghidra/block.hh>
|
||||
#include <ghidra/blockaction.hh>
|
||||
#include <ghidra/callgraph.hh>
|
||||
#include <ghidra/capability.hh>
|
||||
#include <ghidra/cast.hh>
|
||||
#include <ghidra/codedata.hh>
|
||||
#include <ghidra/comment.hh>
|
||||
#include <ghidra/comment_ghidra.hh>
|
||||
#include <ghidra/condexe.hh>
|
||||
#include <ghidra/context.hh>
|
||||
#include <ghidra/coreaction.hh>
|
||||
#include <ghidra/cover.hh>
|
||||
#include <ghidra/cpool.hh>
|
||||
#include <ghidra/cpool_ghidra.hh>
|
||||
#include <ghidra/crc32.hh>
|
||||
#include <ghidra/database.hh>
|
||||
#include <ghidra/database_ghidra.hh>
|
||||
#include <ghidra/doccore.hh>
|
||||
#include <ghidra/docmain.hh>
|
||||
#include <ghidra/double.hh>
|
||||
#include <ghidra/dynamic.hh>
|
||||
#include <ghidra/emulate.hh>
|
||||
#include <ghidra/emulateutil.hh>
|
||||
#include <ghidra/error.hh>
|
||||
#include <ghidra/filemanage.hh>
|
||||
#include <ghidra/float.hh>
|
||||
#include <ghidra/flow.hh>
|
||||
#include <ghidra/fspec.hh>
|
||||
#include <ghidra/funcdata.hh>
|
||||
#include <ghidra/ghidra_arch.hh>
|
||||
#include <ghidra/ghidra_context.hh>
|
||||
#include <ghidra/ghidra_process.hh>
|
||||
#include <ghidra/ghidra_translate.hh>
|
||||
#include <ghidra/globalcontext.hh>
|
||||
#include <ghidra/grammar.hh>
|
||||
#include <ghidra/graph.hh>
|
||||
#include <ghidra/heritage.hh>
|
||||
#include <ghidra/ifacedecomp.hh>
|
||||
#include <ghidra/ifaceterm.hh>
|
||||
#include <ghidra/inject_ghidra.hh>
|
||||
#include <ghidra/inject_sleigh.hh>
|
||||
#include <ghidra/interface.hh>
|
||||
#include <ghidra/jumptable.hh>
|
||||
#include <ghidra/libdecomp.hh>
|
||||
#include <ghidra/loadimage.hh>
|
||||
#include <ghidra/loadimage_ghidra.hh>
|
||||
#include <ghidra/loadimage_xml.hh>
|
||||
#include <ghidra/memstate.hh>
|
||||
#include <ghidra/merge.hh>
|
||||
#include <ghidra/op.hh>
|
||||
#include <ghidra/opbehavior.hh>
|
||||
#include <ghidra/opcodes.hh>
|
||||
#include <ghidra/options.hh>
|
||||
#include <ghidra/override.hh>
|
||||
#include <ghidra/paramid.hh>
|
||||
#include <ghidra/partmap.hh>
|
||||
#include <ghidra/pcodecompile.hh>
|
||||
#include <ghidra/pcodeinject.hh>
|
||||
#include <ghidra/pcodeparse.hh>
|
||||
#include <ghidra/pcoderaw.hh>
|
||||
#include <ghidra/prefersplit.hh>
|
||||
#include <ghidra/prettyprint.hh>
|
||||
#include <ghidra/printc.hh>
|
||||
#include <ghidra/printjava.hh>
|
||||
#include <ghidra/printlanguage.hh>
|
||||
#include <ghidra/rangemap.hh>
|
||||
#include <ghidra/rangeutil.hh>
|
||||
#include <ghidra/raw_arch.hh>
|
||||
#include <ghidra/ruleaction.hh>
|
||||
#include <ghidra/rulecompile.hh>
|
||||
#include <ghidra/semantics.hh>
|
||||
#include <ghidra/sleigh.hh>
|
||||
#include <ghidra/sleigh_arch.hh>
|
||||
#include <ghidra/sleighbase.hh>
|
||||
#include <ghidra/slgh_compile.hh>
|
||||
// This is required because slghparse.hh does not have a namespace block
|
||||
namespace ghidra {
|
||||
#include <sleigh/slghparse.hh>
|
||||
#include <ghidra/slghparse.hh>
|
||||
} // End namespace ghidra
|
||||
#include <sleigh/slghpatexpress.hh>
|
||||
#include <sleigh/slghpattern.hh>
|
||||
#include <sleigh/slghsymbol.hh>
|
||||
#include <sleigh/space.hh>
|
||||
#include <sleigh/string_ghidra.hh>
|
||||
#include <sleigh/stringmanage.hh>
|
||||
#include <sleigh/subflow.hh>
|
||||
#include <sleigh/testfunction.hh>
|
||||
#include <sleigh/transform.hh>
|
||||
#include <sleigh/translate.hh>
|
||||
#include <sleigh/type.hh>
|
||||
#include <sleigh/typegrp_ghidra.hh>
|
||||
#include <sleigh/typeop.hh>
|
||||
#include <sleigh/types.h>
|
||||
#include <sleigh/unify.hh>
|
||||
#include <sleigh/userop.hh>
|
||||
#include <sleigh/variable.hh>
|
||||
#include <sleigh/varmap.hh>
|
||||
#include <sleigh/varnode.hh>
|
||||
#include <sleigh/xml.hh>
|
||||
#include <sleigh/xml_arch.hh>
|
||||
#include <sleigh/unionresolve.hh>
|
||||
#include <sleigh/marshal.hh>
|
||||
#include <ghidra/slghpatexpress.hh>
|
||||
#include <ghidra/slghpattern.hh>
|
||||
#include <ghidra/slghsymbol.hh>
|
||||
#include <ghidra/space.hh>
|
||||
#include <ghidra/string_ghidra.hh>
|
||||
#include <ghidra/stringmanage.hh>
|
||||
#include <ghidra/subflow.hh>
|
||||
#include <ghidra/testfunction.hh>
|
||||
#include <ghidra/transform.hh>
|
||||
#include <ghidra/translate.hh>
|
||||
#include <ghidra/type.hh>
|
||||
#include <ghidra/typegrp_ghidra.hh>
|
||||
#include <ghidra/typeop.hh>
|
||||
#include <ghidra/types.h>
|
||||
#include <ghidra/unify.hh>
|
||||
#include <ghidra/userop.hh>
|
||||
#include <ghidra/variable.hh>
|
||||
#include <ghidra/varmap.hh>
|
||||
#include <ghidra/varnode.hh>
|
||||
#include <ghidra/xml.hh>
|
||||
#include <ghidra/xml_arch.hh>
|
||||
#include <ghidra/unionresolve.hh>
|
||||
#include <ghidra/marshal.hh>
|
||||
#include <ghidra/analyzesigs.hh>
|
||||
#include <ghidra/modelrules.hh>
|
||||
#include <ghidra/signature.hh>
|
||||
#include <ghidra/signature_ghidra.hh>
|
||||
#include <ghidra/compression.hh>
|
||||
#include <ghidra/multiprecision.hh>
|
||||
#include <ghidra/slaformat.hh>
|
||||
|
||||
// #ifdef sleigh_RELEASE_IS_HEAD
|
||||
// #endif
|
||||
|
||||
#ifndef _MSC_VER
|
||||
#pragma GCC diagnostic pop
|
||||
|
||||
@@ -23,6 +23,7 @@ add_executable(sleigh_ghidra_test
|
||||
"${library_root}/../unittests/testfuncproto.cc"
|
||||
"${library_root}/../unittests/testtypes.cc"
|
||||
"${library_root}/../unittests/testmarshal.cc"
|
||||
"${library_root}/../unittests/testparamstore.cc"
|
||||
)
|
||||
|
||||
# if(sleigh_RELEASE_IS_HEAD)
|
||||
@@ -41,6 +42,8 @@ if(HAVE_TERMIOS_H)
|
||||
endif()
|
||||
sleigh_add_optional_defines(sleigh_ghidra_test PRIVATE)
|
||||
|
||||
target_link_libraries(sleigh_ghidra_test PRIVATE ZLIB::ZLIB)
|
||||
|
||||
add_test(
|
||||
NAME sleigh_ghidra_unittest
|
||||
COMMAND sleigh_ghidra_test -sleighpath "${PROJECT_BINARY_DIR}" unittests
|
||||
|
||||
@@ -50,6 +50,9 @@ set_target_properties(sleigh_decompiler PROPERTIES
|
||||
OUTPUT_NAME_DEBUG decomp_dbg
|
||||
)
|
||||
|
||||
find_package(ZLIB REQUIRED)
|
||||
target_link_libraries(sleigh_decompiler PRIVATE ZLIB::ZLIB)
|
||||
|
||||
if(NOT CMAKE_SKIP_INSTALL_RULES)
|
||||
include("GNUInstallDirs")
|
||||
|
||||
|
||||
@@ -46,6 +46,9 @@ set_target_properties(sleigh_ghidra PROPERTIES
|
||||
OUTPUT_NAME_DEBUG ghidra_dbg
|
||||
)
|
||||
|
||||
find_package(ZLIB REQUIRED)
|
||||
target_link_libraries(sleigh_ghidra PRIVATE ZLIB::ZLIB)
|
||||
|
||||
if(NOT CMAKE_SKIP_INSTALL_RULES)
|
||||
include("GNUInstallDirs")
|
||||
|
||||
|
||||
@@ -36,6 +36,9 @@ set_target_properties(sleigh_sleigh PROPERTIES
|
||||
OUTPUT_NAME_DEBUG sleigh_dbg
|
||||
)
|
||||
|
||||
find_package(ZLIB REQUIRED)
|
||||
target_link_libraries(sleigh_sleigh PRIVATE ZLIB::ZLIB)
|
||||
|
||||
if(NOT CMAKE_SKIP_INSTALL_RULES)
|
||||
include("GNUInstallDirs")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user