mirror of
https://github.com/lifting-bits/sleigh
synced 2026-06-21 13:56:12 +00:00
Compare commits
26 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 393ed42fc6 | |||
| 57e6d7c79d | |||
| 8c5b8049a6 | |||
| 7b1232ec99 | |||
| f9a4905c31 | |||
| ff5929e1fc | |||
| 844e5e07fe | |||
| 51bd95f360 | |||
| f63b99a700 | |||
| f1d1eab45f | |||
| 83ae3b5dfe | |||
| 548b28c67d | |||
| f23739ee3f | |||
| c8cb034afb | |||
| 384d7de32a | |||
| d75230a7bc | |||
| 7e9641e394 | |||
| 37b2cbcf1c | |||
| 7c6b742446 | |||
| b3669ea4bd | |||
| e1562dd87f | |||
| 262f8d8421 | |||
| ef4e13d243 | |||
| 6d6335b2c5 | |||
| 6f03e21e23 | |||
| cae987f993 |
@@ -3,15 +3,15 @@ name: Build
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- '*'
|
||||
- "*"
|
||||
|
||||
# Version tags should start with "v"
|
||||
tags:
|
||||
- 'v*'
|
||||
- "v*"
|
||||
|
||||
pull_request:
|
||||
branches:
|
||||
- '*'
|
||||
- "*"
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
||||
@@ -36,7 +36,7 @@ jobs:
|
||||
|
||||
- name: Create PR
|
||||
if: steps.head_update.outputs.did_update
|
||||
uses: peter-evans/create-pull-request@v4
|
||||
uses: peter-evans/create-pull-request@v5
|
||||
with:
|
||||
title: Update Ghidra HEAD to commit ${{ steps.head_update.outputs.short_sha }}
|
||||
commit-message: |
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
* @ekilmer @tetsuo-cpp
|
||||
@@ -45,7 +45,7 @@ static void PrintVersion(void) {
|
||||
}
|
||||
}
|
||||
|
||||
class InMemoryLoadImage : public LoadImage {
|
||||
class InMemoryLoadImage : public ghidra::LoadImage {
|
||||
public:
|
||||
explicit InMemoryLoadImage(uint64_t base_addr)
|
||||
: LoadImage("nofile"), base_addr(base_addr) {}
|
||||
@@ -55,7 +55,8 @@ public:
|
||||
image_buffer = std::move(buf);
|
||||
}
|
||||
|
||||
void loadFill(unsigned char *ptr, int size, const Address &addr) override {
|
||||
void loadFill(unsigned char *ptr, int size,
|
||||
const ghidra::Address &addr) override {
|
||||
uint64_t start = addr.getOffset();
|
||||
for (int i = 0; i < size; ++i) {
|
||||
uint64_t offset = start + i;
|
||||
@@ -108,18 +109,18 @@ static std::string ParseHexBytes(std::string_view bytes, uint64_t addr,
|
||||
return buffer;
|
||||
}
|
||||
|
||||
class AssemblyPrinter : public AssemblyEmit {
|
||||
class AssemblyPrinter : public ghidra::AssemblyEmit {
|
||||
public:
|
||||
void dump(const Address &addr, const std::string &mnemonic,
|
||||
void dump(const ghidra::Address &addr, const std::string &mnemonic,
|
||||
const std::string &body) override {
|
||||
addr.printRaw(std::cout);
|
||||
std::cout << ": " << mnemonic << ' ' << body << std::endl;
|
||||
}
|
||||
};
|
||||
|
||||
static void PrintAssembly(Sleigh &engine, uint64_t addr, size_t len) {
|
||||
static void PrintAssembly(ghidra::Sleigh &engine, uint64_t addr, size_t len) {
|
||||
AssemblyPrinter asm_emit;
|
||||
Address cur_addr(engine.getDefaultCodeSpace(), addr),
|
||||
ghidra::Address cur_addr(engine.getDefaultCodeSpace(), addr),
|
||||
last_addr(engine.getDefaultCodeSpace(), addr + len);
|
||||
while (cur_addr < last_addr) {
|
||||
int32_t instr_len = engine.printAssembly(asm_emit, cur_addr);
|
||||
@@ -127,15 +128,16 @@ static void PrintAssembly(Sleigh &engine, uint64_t addr, size_t len) {
|
||||
}
|
||||
}
|
||||
|
||||
static void PrintVarData(std::ostream &s, VarnodeData &data) {
|
||||
static void PrintVarData(std::ostream &s, ghidra::VarnodeData &data) {
|
||||
s << '(' << data.space->getName() << ',';
|
||||
data.space->printOffset(s, data.offset);
|
||||
s << ',' << std::dec << data.size << ')';
|
||||
}
|
||||
|
||||
class PcodePrinter : public PcodeEmit {
|
||||
class PcodePrinter : public ghidra::PcodeEmit {
|
||||
public:
|
||||
void dump(const Address &, OpCode op, VarnodeData *outvar, VarnodeData *vars,
|
||||
void dump(const ghidra::Address &, ghidra::OpCode op,
|
||||
ghidra::VarnodeData *outvar, ghidra::VarnodeData *vars,
|
||||
int32_t isize) override {
|
||||
if (outvar) {
|
||||
PrintVarData(std::cout, *outvar);
|
||||
@@ -150,9 +152,9 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
static void PrintPcode(Sleigh &engine, uint64_t addr, size_t len) {
|
||||
static void PrintPcode(ghidra::Sleigh &engine, uint64_t addr, size_t len) {
|
||||
PcodePrinter pcode_emit;
|
||||
Address cur_addr(engine.getDefaultCodeSpace(), addr),
|
||||
ghidra::Address cur_addr(engine.getDefaultCodeSpace(), addr),
|
||||
last_addr(engine.getDefaultCodeSpace(), addr + len);
|
||||
while (cur_addr < last_addr) {
|
||||
int32_t instr_len = engine.oneInstruction(pcode_emit, cur_addr);
|
||||
@@ -257,13 +259,14 @@ int main(int argc, char *argv[]) {
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
// Put together Sleigh components
|
||||
AttributeId::initialize();
|
||||
ElementId::initialize();
|
||||
ghidra::AttributeId::initialize();
|
||||
ghidra::ElementId::initialize();
|
||||
InMemoryLoadImage load_image(addr);
|
||||
ContextInternal ctx;
|
||||
Sleigh engine(&load_image, &ctx);
|
||||
DocumentStorage storage;
|
||||
Element *root = storage.openDocument(sla_file_path->string())->getRoot();
|
||||
ghidra::ContextInternal ctx;
|
||||
ghidra::Sleigh engine(&load_image, &ctx);
|
||||
ghidra::DocumentStorage storage;
|
||||
ghidra::Element *root =
|
||||
storage.openDocument(sla_file_path->string())->getRoot();
|
||||
storage.registerTag(root);
|
||||
std::optional<std::filesystem::path> pspec_file_path;
|
||||
if (args->pspec_file_name) {
|
||||
@@ -287,7 +290,8 @@ int main(int argc, char *argv[]) {
|
||||
}
|
||||
}
|
||||
if (pspec_file_path) {
|
||||
Element *pspec_root = storage.openDocument(pspec_file_path->string())->getRoot();
|
||||
ghidra::Element *pspec_root =
|
||||
storage.openDocument(pspec_file_path->string())->getRoot();
|
||||
storage.registerTag(pspec_root);
|
||||
}
|
||||
engine.initialize(storage);
|
||||
@@ -296,14 +300,15 @@ int main(int argc, char *argv[]) {
|
||||
// we can set the default context
|
||||
// This imitates what is done in
|
||||
// void Architecture::parseProcessorConfig(DocumentStorage &store)
|
||||
const Element *el = storage.getTag("processor_spec");
|
||||
const ghidra::Element *el = storage.getTag("processor_spec");
|
||||
if (el) {
|
||||
XmlDecode decoder(&engine, el);
|
||||
uint4 elemId = decoder.openElement(ELEM_PROCESSOR_SPEC);
|
||||
for(;;) {
|
||||
uint4 subId = decoder.peekElement();
|
||||
if (subId == 0) break;
|
||||
else if (subId == ELEM_CONTEXT_DATA) {
|
||||
ghidra::XmlDecode decoder(&engine, el);
|
||||
ghidra::uint4 elemId = decoder.openElement(ghidra::ELEM_PROCESSOR_SPEC);
|
||||
for (;;) {
|
||||
ghidra::uint4 subId = decoder.peekElement();
|
||||
if (subId == 0)
|
||||
break;
|
||||
else if (subId == ghidra::ELEM_CONTEXT_DATA) {
|
||||
ctx.decodeFromSpec(decoder);
|
||||
break;
|
||||
} else {
|
||||
|
||||
@@ -1,137 +0,0 @@
|
||||
From 0ca6d7c5c7f927a37482962df4399031581cf8af Mon Sep 17 00:00:00 2001
|
||||
From: Eric Kilmer <eric.d.kilmer@gmail.com>
|
||||
Date: Thu, 28 Jul 2022 09:20:03 -0400
|
||||
Subject: [PATCH 1/7] Add include guards to decompiler C++ headers
|
||||
|
||||
---
|
||||
Ghidra/Features/Decompiler/src/decompile/cpp/bfd_arch.hh | 5 +++++
|
||||
Ghidra/Features/Decompiler/src/decompile/cpp/graph.hh | 6 ++++++
|
||||
Ghidra/Features/Decompiler/src/decompile/cpp/ifaceterm.hh | 5 +++++
|
||||
Ghidra/Features/Decompiler/src/decompile/cpp/raw_arch.hh | 5 +++++
|
||||
.../Features/Decompiler/src/decompile/cpp/slgh_compile.hh | 5 +++++
|
||||
Ghidra/Features/Decompiler/src/decompile/cpp/xml_arch.hh | 6 ++++++
|
||||
6 files changed, 32 insertions(+)
|
||||
|
||||
diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/bfd_arch.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/bfd_arch.hh
|
||||
index 875d3bb78..6ade01ecc 100644
|
||||
--- a/Ghidra/Features/Decompiler/src/decompile/cpp/bfd_arch.hh
|
||||
+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/bfd_arch.hh
|
||||
@@ -17,6 +17,9 @@
|
||||
/// \file bfd_arch.hh
|
||||
/// \brief Specific implementation of Architecture using GNU BFD libraries
|
||||
|
||||
+#ifndef __BFD_ARCH__
|
||||
+#define __BFD_ARCH__
|
||||
+
|
||||
#include "sleigh_arch.hh"
|
||||
#include "loadimage_bfd.hh"
|
||||
|
||||
@@ -47,3 +50,5 @@ class BfdArchitecture : public SleighArchitecture {
|
||||
BfdArchitecture(const string &fname,const string &targ,ostream *estream); ///< Constructor
|
||||
virtual ~BfdArchitecture(void) {}
|
||||
};
|
||||
+
|
||||
+#endif
|
||||
diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/graph.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/graph.hh
|
||||
index 364a5258d..edd6ce865 100644
|
||||
--- a/Ghidra/Features/Decompiler/src/decompile/cpp/graph.hh
|
||||
+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/graph.hh
|
||||
@@ -14,8 +14,14 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
+
|
||||
+#ifndef __GRAPH__
|
||||
+#define __GRAPH__
|
||||
+
|
||||
#include "funcdata.hh"
|
||||
|
||||
extern void dump_dataflow_graph(Funcdata &data,ostream &s);
|
||||
extern void dump_controlflow_graph(const string &name,const BlockGraph &graph,ostream &s);
|
||||
extern void dump_dom_graph(const string &name,const BlockGraph &graph,ostream &s);
|
||||
+
|
||||
+#endif
|
||||
diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/ifaceterm.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/ifaceterm.hh
|
||||
index 3ca912dd6..0b70d8b22 100644
|
||||
--- a/Ghidra/Features/Decompiler/src/decompile/cpp/ifaceterm.hh
|
||||
+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/ifaceterm.hh
|
||||
@@ -16,6 +16,9 @@
|
||||
/// \file ifaceterm.hh
|
||||
/// \brief Add some terminal capabilities to the command-line interface (IfaceStatus)
|
||||
|
||||
+#ifndef __IFACE_TERM__
|
||||
+#define __IFACE_TERM__
|
||||
+
|
||||
#include "interface.hh"
|
||||
|
||||
#ifdef __TERMINAL__
|
||||
@@ -48,3 +51,5 @@ class IfaceTerm : public IfaceStatus {
|
||||
virtual void popScript(void);
|
||||
virtual bool isStreamFinished(void) const;
|
||||
};
|
||||
+
|
||||
+#endif
|
||||
diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/raw_arch.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/raw_arch.hh
|
||||
index 2245840a0..490abf901 100644
|
||||
--- a/Ghidra/Features/Decompiler/src/decompile/cpp/raw_arch.hh
|
||||
+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/raw_arch.hh
|
||||
@@ -15,6 +15,10 @@
|
||||
*/
|
||||
/// \file raw_arch.hh
|
||||
/// \brief Bare bones capability for treating a file as a raw executable image
|
||||
+
|
||||
+#ifndef __RAW_ARCH__
|
||||
+#define __RAW_ARCH__
|
||||
+
|
||||
#include "sleigh_arch.hh"
|
||||
#include "loadimage.hh"
|
||||
|
||||
@@ -46,3 +50,4 @@ class RawBinaryArchitecture : public SleighArchitecture {
|
||||
virtual ~RawBinaryArchitecture(void) {}
|
||||
};
|
||||
|
||||
+#endif
|
||||
diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/slgh_compile.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/slgh_compile.hh
|
||||
index 91e12244b..2b18e10fc 100644
|
||||
--- a/Ghidra/Features/Decompiler/src/decompile/cpp/slgh_compile.hh
|
||||
+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/slgh_compile.hh
|
||||
@@ -16,6 +16,9 @@
|
||||
/// \file slgh_compile.hh
|
||||
/// \brief High-level control of the sleigh compilation process
|
||||
|
||||
+#ifndef __SLGH_COMPILE__
|
||||
+#define __SLGH_COMPILE__
|
||||
+
|
||||
#include "sleighbase.hh"
|
||||
#include "pcodecompile.hh"
|
||||
#include "filemanage.hh"
|
||||
@@ -450,3 +453,5 @@ class SleighCompile : public SleighBase {
|
||||
|
||||
extern SleighCompile *slgh; ///< A global reference to the SLEIGH compiler accessible to the parse functions
|
||||
extern int yydebug; ///< Debug state for the SLEIGH parse functions
|
||||
+
|
||||
+#endif
|
||||
diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/xml_arch.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/xml_arch.hh
|
||||
index d395fb8a3..6371148b0 100644
|
||||
--- a/Ghidra/Features/Decompiler/src/decompile/cpp/xml_arch.hh
|
||||
+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/xml_arch.hh
|
||||
@@ -15,6 +15,10 @@
|
||||
*/
|
||||
/// \file xml_arch.hh
|
||||
/// \brief Extension to read executables based on an XML format
|
||||
+
|
||||
+#ifndef __XML_ARCH__
|
||||
+#define __XML_ARCH__
|
||||
+
|
||||
#include "sleigh_arch.hh"
|
||||
#include "loadimage_xml.hh"
|
||||
|
||||
@@ -45,3 +49,5 @@ class XmlArchitecture : public SleighArchitecture {
|
||||
XmlArchitecture(const string &fname,const string &targ,ostream *estream); ///< Constructor
|
||||
virtual ~XmlArchitecture(void) {}
|
||||
};
|
||||
+
|
||||
+#endif
|
||||
--
|
||||
2.40.0
|
||||
|
||||
+35
-58
@@ -1,10 +1,9 @@
|
||||
From 1f00ab9f7c53b6611fc1cf16455bb6069c0c0b69 Mon Sep 17 00:00:00 2001
|
||||
From 67ac779382508ab0d5ff10bcb0a8453068cce5a2 Mon Sep 17 00:00:00 2001
|
||||
From: Alex Cameron <asc@tetsuo.sh>
|
||||
Date: Mon, 7 Feb 2022 02:02:03 +1100
|
||||
Subject: [PATCH 2/7] Fix UBSAN errors in decompiler
|
||||
Date: Mon, 5 Jun 2023 16:45:04 +1200
|
||||
Subject: [PATCH 1/2] Fix UBSAN errors in decompiler
|
||||
|
||||
---
|
||||
.../Decompiler/src/decompile/cpp/address.cc | 4 ++--
|
||||
.../Decompiler/src/decompile/cpp/fspec.cc | 8 ++++++--
|
||||
.../src/decompile/cpp/funcdata_varnode.cc | 8 +++++++-
|
||||
.../Decompiler/src/decompile/cpp/op.cc | 6 +++++-
|
||||
@@ -17,35 +16,13 @@ Subject: [PATCH 2/7] Fix UBSAN errors in decompiler
|
||||
.../Decompiler/src/decompile/cpp/slghsymbol.cc | 2 +-
|
||||
.../Decompiler/src/decompile/cpp/type.cc | 2 +-
|
||||
.../src/decompile/unittests/testfloatemu.cc | 2 +-
|
||||
13 files changed, 59 insertions(+), 23 deletions(-)
|
||||
12 files changed, 57 insertions(+), 21 deletions(-)
|
||||
|
||||
diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/address.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/address.cc
|
||||
index 26694b558..395fee432 100644
|
||||
--- a/Ghidra/Features/Decompiler/src/decompile/cpp/address.cc
|
||||
+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/address.cc
|
||||
@@ -685,7 +685,7 @@ uintb sign_extend(uintb in,int4 sizein,int4 sizeout)
|
||||
void sign_extend(intb &val,int4 bit)
|
||||
|
||||
{
|
||||
- intb mask = 0;
|
||||
+ uintb mask = 0;
|
||||
mask = (~mask)<<bit;
|
||||
if (((val>>bit)&1)!=0)
|
||||
val |= mask;
|
||||
@@ -699,7 +699,7 @@ void sign_extend(intb &val,int4 bit)
|
||||
void zero_extend(intb &val,int4 bit)
|
||||
|
||||
{
|
||||
- intb mask = 0;
|
||||
+ uintb mask = 0;
|
||||
mask = (~mask)<<bit;
|
||||
mask <<= 1;
|
||||
val &= (~mask);
|
||||
diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/fspec.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/fspec.cc
|
||||
index 0f8c95d60..95ab4b0ee 100644
|
||||
index 82771cc04..da78c8071 100644
|
||||
--- a/Ghidra/Features/Decompiler/src/decompile/cpp/fspec.cc
|
||||
+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/fspec.cc
|
||||
@@ -2659,8 +2659,12 @@ void ProtoModelMerged::decode(Decoder &decoder)
|
||||
@@ -2661,8 +2661,12 @@ void ProtoModelMerged::decode(Decoder &decoder)
|
||||
modellist.push_back(mymodel);
|
||||
}
|
||||
decoder.closeElement(elemId);
|
||||
@@ -61,10 +38,10 @@ index 0f8c95d60..95ab4b0ee 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 0a641091b..70acfad8f 100644
|
||||
index f77817073..283d81c31 100644
|
||||
--- a/Ghidra/Features/Decompiler/src/decompile/cpp/funcdata_varnode.cc
|
||||
+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/funcdata_varnode.cc
|
||||
@@ -501,7 +501,13 @@ void Funcdata::setHighLevel(void)
|
||||
@@ -503,7 +503,13 @@ void Funcdata::setHighLevel(void)
|
||||
void Funcdata::transferVarnodeProperties(Varnode *vn,Varnode *newVn,int4 lsbOffset)
|
||||
|
||||
{
|
||||
@@ -80,10 +57,10 @@ index 0a641091b..70acfad8f 100644
|
||||
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 4c0749590..24551ed11 100644
|
||||
index 0e3decc80..403ec35a7 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
|
||||
@@ -672,7 +672,11 @@ uintb PcodeOp::getNZMaskLocal(bool cliploop) const
|
||||
break;
|
||||
case CPUI_PIECE:
|
||||
resmask = getIn(0)->getNZMask();
|
||||
@@ -97,16 +74,16 @@ index 4c0749590..24551ed11 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 3b84bac6a..3e0c39904 100644
|
||||
index aebcfd910..6c47e6eb1 100644
|
||||
--- a/Ghidra/Features/Decompiler/src/decompile/cpp/opbehavior.cc
|
||||
+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/opbehavior.cc
|
||||
@@ -747,7 +747,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
|
||||
|
||||
{
|
||||
- uintb res = (in1>>(in2*8)) & calc_mask(sizeout);
|
||||
+ uintb res = in1;
|
||||
+ if ((in2*8) < sizeof(in1)) {
|
||||
+ if (in2 < sizeof(in1)) {
|
||||
+ res >>= (in2*8);
|
||||
+ } else {
|
||||
+ res = 0;
|
||||
@@ -116,10 +93,10 @@ index 3b84bac6a..3e0c39904 100644
|
||||
}
|
||||
|
||||
diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/pcodecompile.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/pcodecompile.cc
|
||||
index 49128f7e6..133da8178 100644
|
||||
index ca9d71ab9..85d4dd281 100644
|
||||
--- a/Ghidra/Features/Decompiler/src/decompile/cpp/pcodecompile.cc
|
||||
+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/pcodecompile.cc
|
||||
@@ -619,8 +619,10 @@ vector<OpTpl *> *PcodeCompile::assignBitRange(VarnodeTpl *vn,uint4 bitoffset,uin
|
||||
@@ -621,8 +621,10 @@ vector<OpTpl *> *PcodeCompile::assignBitRange(VarnodeTpl *vn,uint4 bitoffset,uin
|
||||
uint4 smallsize = (numbits+7)/8; // Size of input (output of rhs)
|
||||
bool shiftneeded = (bitoffset != 0);
|
||||
bool zextneeded = true;
|
||||
@@ -132,7 +109,7 @@ index 49128f7e6..133da8178 100644
|
||||
|
||||
if (vn->getSize().getType()==ConstTpl::real) {
|
||||
// If we know the size of the bitranged varnode, we can
|
||||
@@ -724,9 +726,6 @@ ExprTree *PcodeCompile::createBitRange(SpecificSymbol *sym,uint4 bitoffset,uint4
|
||||
@@ -726,9 +728,6 @@ ExprTree *PcodeCompile::createBitRange(SpecificSymbol *sym,uint4 bitoffset,uint4
|
||||
}
|
||||
}
|
||||
|
||||
@@ -142,7 +119,7 @@ index 49128f7e6..133da8178 100644
|
||||
if (truncneeded && ((bitoffset % 8)==0)) {
|
||||
truncshift = bitoffset/8;
|
||||
bitoffset = 0;
|
||||
@@ -749,8 +748,13 @@ ExprTree *PcodeCompile::createBitRange(SpecificSymbol *sym,uint4 bitoffset,uint4
|
||||
@@ -751,8 +750,13 @@ ExprTree *PcodeCompile::createBitRange(SpecificSymbol *sym,uint4 bitoffset,uint4
|
||||
appendOp(CPUI_INT_RIGHT,res,bitoffset,4);
|
||||
if (truncneeded)
|
||||
appendOp(CPUI_SUBPIECE,res,truncshift,4);
|
||||
@@ -159,10 +136,10 @@ index 49128f7e6..133da8178 100644
|
||||
return res;
|
||||
}
|
||||
diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/ruleaction.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/ruleaction.cc
|
||||
index 9068f2a81..216f2f45f 100644
|
||||
index ae2e502c1..a22b8ebdc 100644
|
||||
--- a/Ghidra/Features/Decompiler/src/decompile/cpp/ruleaction.cc
|
||||
+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/ruleaction.cc
|
||||
@@ -974,7 +974,12 @@ int4 RulePullsubIndirect::applyOp(PcodeOp *op,Funcdata &data)
|
||||
@@ -976,7 +976,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
|
||||
|
||||
@@ -176,7 +153,7 @@ index 9068f2a81..216f2f45f 100644
|
||||
consume = ~consume;
|
||||
if ((consume & indir->getIn(0)->getConsume())!=0) return 0;
|
||||
|
||||
@@ -6738,8 +6743,9 @@ int4 RulePtrsubCharConstant::applyOp(PcodeOp *op,Funcdata &data)
|
||||
@@ -6789,8 +6794,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;
|
||||
@@ -188,7 +165,7 @@ index 9068f2a81..216f2f45f 100644
|
||||
Varnode *vn1 = op->getIn(1);
|
||||
if (!vn1->isConstant()) return 0;
|
||||
Varnode *outvn = op->getOut();
|
||||
@@ -8469,7 +8475,11 @@ int4 RuleSubvarSubpiece::applyOp(PcodeOp *op,Funcdata &data)
|
||||
@@ -8600,7 +8606,11 @@ int4 RuleSubvarSubpiece::applyOp(PcodeOp *op,Funcdata &data)
|
||||
Varnode *outvn = op->getOut();
|
||||
int4 flowsize = outvn->getSize();
|
||||
uintb mask = calc_mask( flowsize );
|
||||
@@ -202,10 +179,10 @@ index 9068f2a81..216f2f45f 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 ecebc0970..1c9ab7560 100644
|
||||
index 2e3531ea2..42482be7c 100644
|
||||
--- a/Ghidra/Features/Decompiler/src/decompile/cpp/semantics.cc
|
||||
+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/semantics.cc
|
||||
@@ -20,6 +20,7 @@ ConstTpl::ConstTpl(const_type tp)
|
||||
@@ -22,6 +22,7 @@ ConstTpl::ConstTpl(const_type tp)
|
||||
|
||||
{ // Constructor for relative jump constants and uniques
|
||||
type = tp;
|
||||
@@ -213,7 +190,7 @@ index ecebc0970..1c9ab7560 100644
|
||||
}
|
||||
|
||||
ConstTpl::ConstTpl(const_type tp,uintb val)
|
||||
@@ -54,6 +55,7 @@ ConstTpl::ConstTpl(AddrSpace *sid)
|
||||
@@ -56,6 +57,7 @@ ConstTpl::ConstTpl(AddrSpace *sid)
|
||||
{
|
||||
type = spaceid;
|
||||
value.spaceid = sid;
|
||||
@@ -222,10 +199,10 @@ index ecebc0970..1c9ab7560 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 3b836244c..1fbd169c9 100644
|
||||
index 8e283dca0..652600c16 100644
|
||||
--- a/Ghidra/Features/Decompiler/src/decompile/cpp/semantics.hh
|
||||
+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/semantics.hh
|
||||
@@ -46,7 +46,7 @@ class ConstTpl {
|
||||
@@ -48,7 +48,7 @@ private:
|
||||
static void printHandleSelector(ostream &s,v_field val);
|
||||
static v_field readHandleSelector(const string &name);
|
||||
public:
|
||||
@@ -235,10 +212,10 @@ index 3b836244c..1fbd169c9 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 b92a3de3b..ac9a70c93 100644
|
||||
index b40f74389..3c37958df 100644
|
||||
--- a/Ghidra/Features/Decompiler/src/decompile/cpp/slgh_compile.cc
|
||||
+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/slgh_compile.cc
|
||||
@@ -2157,8 +2157,8 @@ string SleighCompile::checkSymbols(SymbolScope *scope)
|
||||
@@ -2163,8 +2163,8 @@ string SleighCompile::checkSymbols(SymbolScope *scope)
|
||||
ostringstream msg;
|
||||
SymbolTree::const_iterator iter;
|
||||
for(iter=scope->begin();iter!=scope->end();++iter) {
|
||||
@@ -249,10 +226,10 @@ index b92a3de3b..ac9a70c93 100644
|
||||
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 8516dbf10..352a0ae99 100644
|
||||
index b308e1b71..af2982aee 100644
|
||||
--- a/Ghidra/Features/Decompiler/src/decompile/cpp/slghsymbol.cc
|
||||
+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/slghsymbol.cc
|
||||
@@ -2566,7 +2566,7 @@ void ContextOp::restoreXml(const Element *el,SleighBase *trans)
|
||||
@@ -2569,7 +2569,7 @@ void ContextOp::restoreXml(const Element *el,SleighBase *trans)
|
||||
const List &list(el->getChildren());
|
||||
List::const_iterator iter;
|
||||
iter = list.begin();
|
||||
@@ -262,10 +239,10 @@ index 8516dbf10..352a0ae99 100644
|
||||
}
|
||||
|
||||
diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/type.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/type.cc
|
||||
index 9fc48aa7d..8b75afb6d 100644
|
||||
index 32ede6b0f..238d97f40 100644
|
||||
--- a/Ghidra/Features/Decompiler/src/decompile/cpp/type.cc
|
||||
+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/type.cc
|
||||
@@ -3233,8 +3233,8 @@ void TypeFactory::recalcPointerSubmeta(Datatype *base,sub_metatype sub)
|
||||
@@ -3384,8 +3384,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()) {
|
||||
@@ -276,10 +253,10 @@ index 9fc48aa7d..8b75afb6d 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 f88b4d000..3b16ed13c 100644
|
||||
index c35bde877..061e53677 100644
|
||||
--- a/Ghidra/Features/Decompiler/src/decompile/unittests/testfloatemu.cc
|
||||
+++ b/Ghidra/Features/Decompiler/src/decompile/unittests/testfloatemu.cc
|
||||
@@ -343,7 +343,7 @@ TEST(float_opTrunc_to_int) {
|
||||
@@ -346,7 +346,7 @@ TEST(float_opTrunc_to_int) {
|
||||
|
||||
for(float f:float_test_values) {
|
||||
// avoid undefined behavior
|
||||
@@ -289,5 +266,5 @@ index f88b4d000..3b16ed13c 100644
|
||||
uintb true_result = ((uintb)(int32_t)f) & 0xffffffff;
|
||||
uintb encoding = format.getEncoding(f);
|
||||
--
|
||||
2.40.0
|
||||
2.39.2 (Apple Git-143)
|
||||
|
||||
+7
-7
@@ -1,7 +1,7 @@
|
||||
From ad4a5782300ff499c1633da6923669545b78a2cc Mon Sep 17 00:00:00 2001
|
||||
From 9fd26cd754b6f83e45199db896fd0fcea23cd59d Mon Sep 17 00:00:00 2001
|
||||
From: Alex Cameron <asc@tetsuo.sh>
|
||||
Date: Wed, 3 Aug 2022 20:01:18 +1000
|
||||
Subject: [PATCH 3/7] Use `stroull` instead of `stroul` to parse address
|
||||
Subject: [PATCH 2/2] Use `stroull` instead of `stroul` to parse address
|
||||
offsets
|
||||
|
||||
---
|
||||
@@ -9,7 +9,7 @@ Subject: [PATCH 3/7] 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 b511f8919..4ae8f18a6 100644
|
||||
index bf4e1dc96..594b4583a 100644
|
||||
--- a/Ghidra/Features/Decompiler/src/decompile/cpp/space.cc
|
||||
+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/space.cc
|
||||
@@ -16,6 +16,8 @@
|
||||
@@ -18,10 +18,10 @@ index b511f8919..4ae8f18a6 100644
|
||||
|
||||
+#include <climits>
|
||||
+
|
||||
namespace ghidra {
|
||||
|
||||
AttributeId ATTRIB_BASE = AttributeId("base",89);
|
||||
AttributeId ATTRIB_DEADCODEDELAY = AttributeId("deadcodedelay",90);
|
||||
AttributeId ATTRIB_DELAY = AttributeId("delay", 91);
|
||||
@@ -288,7 +290,10 @@ uintb AddrSpace::read(const string &s,int4 &size) const
|
||||
@@ -290,7 +292,10 @@ uintb AddrSpace::read(const string &s,int4 &size) const
|
||||
}
|
||||
}
|
||||
catch(LowlevelError &err) { // Name doesn't exist
|
||||
@@ -34,5 +34,5 @@ index b511f8919..4ae8f18a6 100644
|
||||
enddata = (const char *) tmpdata;
|
||||
if (enddata - s.c_str() == s.size()) { // If no size or offset override
|
||||
--
|
||||
2.40.0
|
||||
2.39.2 (Apple Git-143)
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,51 +0,0 @@
|
||||
From 24a158c4514567a0cc253f0c0a4b7a9f5df7384d Mon Sep 17 00:00:00 2001
|
||||
From: Eric Kilmer <eric.d.kilmer@gmail.com>
|
||||
Date: Wed, 15 Mar 2023 23:04:28 -0400
|
||||
Subject: [PATCH 6/7] (3/4) decompiler: Manually fix std namespace in generated
|
||||
file
|
||||
|
||||
We must manually fix the symbols from std namespace because the
|
||||
automated tool does not know how to parse yacc/bison files.
|
||||
---
|
||||
.../Decompiler/src/decompile/cpp/slghparse.y | 14 +++++++-------
|
||||
1 file changed, 7 insertions(+), 7 deletions(-)
|
||||
|
||||
diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/slghparse.y b/Ghidra/Features/Decompiler/src/decompile/cpp/slghparse.y
|
||||
index 0e2172f79..039963cd5 100644
|
||||
--- a/Ghidra/Features/Decompiler/src/decompile/cpp/slghparse.y
|
||||
+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/slghparse.y
|
||||
@@ -32,24 +32,24 @@ using namespace std;
|
||||
char ch;
|
||||
uintb *i;
|
||||
intb *big;
|
||||
- string *str;
|
||||
- vector<string> *strlist;
|
||||
- vector<intb> *biglist;
|
||||
- vector<ExprTree *> *param;
|
||||
+ std::string *str;
|
||||
+ std::vector<std::string> *strlist;
|
||||
+ std::vector<intb> *biglist;
|
||||
+ std::vector<ExprTree *> *param;
|
||||
SpaceQuality *spacequal;
|
||||
FieldQuality *fieldqual;
|
||||
StarQuality *starqual;
|
||||
VarnodeTpl *varnode;
|
||||
ExprTree *tree;
|
||||
- vector<OpTpl *> *stmt;
|
||||
+ std::vector<OpTpl *> *stmt;
|
||||
ConstructTpl *sem;
|
||||
SectionVector *sectionstart;
|
||||
Constructor *construct;
|
||||
PatternEquation *pateq;
|
||||
PatternExpression *patexp;
|
||||
|
||||
- vector<SleighSymbol *> *symlist;
|
||||
- vector<ContextChange *> *contop;
|
||||
+ std::vector<SleighSymbol *> *symlist;
|
||||
+ std::vector<ContextChange *> *contop;
|
||||
SleighSymbol *anysym;
|
||||
SpaceSymbol *spacesym;
|
||||
SectionSymbol *sectionsym;
|
||||
--
|
||||
2.40.0
|
||||
|
||||
@@ -1,29 +0,0 @@
|
||||
From ed427a72a0d2f70565752902f274a748835afa1a Mon Sep 17 00:00:00 2001
|
||||
From: Eric Kilmer <eric.d.kilmer@gmail.com>
|
||||
Date: Wed, 15 Mar 2023 23:10:22 -0400
|
||||
Subject: [PATCH 7/7] (4/4) decompiler: Manually fix missed std variable usage
|
||||
|
||||
Unfortunately, the heuristics in remusing are unable to automatically
|
||||
fix this case of variables from the C++ standard library.
|
||||
|
||||
This was fixed by resolving the error(s) produced by the compiler.
|
||||
---
|
||||
Ghidra/Features/Decompiler/src/decompile/cpp/ghidra_process.hh | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/ghidra_process.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/ghidra_process.hh
|
||||
index 64fd45e35..428319a65 100644
|
||||
--- a/Ghidra/Features/Decompiler/src/decompile/cpp/ghidra_process.hh
|
||||
+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/ghidra_process.hh
|
||||
@@ -79,7 +79,7 @@ class GhidraCommand {
|
||||
virtual void loadParameters(void); ///< Read parameters directing command execution
|
||||
virtual void sendResult(void); ///< Send results of the command (if any) back to the Ghidra client
|
||||
public:
|
||||
- GhidraCommand(void) : sin(cin),sout(cout) {
|
||||
+ GhidraCommand(void) : sin(std::cin),sout(std::cout) {
|
||||
ghidra = (ArchitectureGhidra *)0;
|
||||
} ///< Construct given i/o streams
|
||||
virtual ~GhidraCommand(void) {} ///< Destructor
|
||||
--
|
||||
2.40.0
|
||||
|
||||
+37
-59
@@ -1,10 +1,10 @@
|
||||
From 4fa4b34e64c277f699a0c4d9cda1a2de739b9130 Mon Sep 17 00:00:00 2001
|
||||
From: Alex Cameron <asc@tetsuo.sh>
|
||||
Date: Mon, 7 Feb 2022 02:02:03 +1100
|
||||
Subject: [PATCH 3/8] Fix UBSAN errors in decompiler
|
||||
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
|
||||
|
||||
---
|
||||
.../Decompiler/src/decompile/cpp/address.cc | 4 ++--
|
||||
.../Decompiler/src/decompile/cpp/fspec.cc | 8 ++++++--
|
||||
.../src/decompile/cpp/funcdata_varnode.cc | 8 +++++++-
|
||||
.../Decompiler/src/decompile/cpp/op.cc | 6 +++++-
|
||||
@@ -17,35 +17,13 @@ Subject: [PATCH 3/8] Fix UBSAN errors in decompiler
|
||||
.../Decompiler/src/decompile/cpp/slghsymbol.cc | 2 +-
|
||||
.../Decompiler/src/decompile/cpp/type.cc | 2 +-
|
||||
.../src/decompile/unittests/testfloatemu.cc | 2 +-
|
||||
13 files changed, 59 insertions(+), 23 deletions(-)
|
||||
12 files changed, 57 insertions(+), 21 deletions(-)
|
||||
|
||||
diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/address.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/address.cc
|
||||
index b3758ddd1..0b3bf04c8 100644
|
||||
--- a/Ghidra/Features/Decompiler/src/decompile/cpp/address.cc
|
||||
+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/address.cc
|
||||
@@ -685,7 +685,7 @@ uintb sign_extend(uintb in,int4 sizein,int4 sizeout)
|
||||
void sign_extend(intb &val,int4 bit)
|
||||
|
||||
{
|
||||
- intb mask = 0;
|
||||
+ uintb mask = 0;
|
||||
mask = (~mask)<<bit;
|
||||
if (((val>>bit)&1)!=0)
|
||||
val |= mask;
|
||||
@@ -699,7 +699,7 @@ void sign_extend(intb &val,int4 bit)
|
||||
void zero_extend(intb &val,int4 bit)
|
||||
|
||||
{
|
||||
- intb mask = 0;
|
||||
+ uintb mask = 0;
|
||||
mask = (~mask)<<bit;
|
||||
mask <<= 1;
|
||||
val &= (~mask);
|
||||
diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/fspec.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/fspec.cc
|
||||
index c52d92c80..937b57157 100644
|
||||
index 8380d3cd..a18d5007 100644
|
||||
--- a/Ghidra/Features/Decompiler/src/decompile/cpp/fspec.cc
|
||||
+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/fspec.cc
|
||||
@@ -2649,8 +2649,12 @@ void ProtoModelMerged::decode(Decoder &decoder)
|
||||
@@ -2661,8 +2661,12 @@ void ProtoModelMerged::decode(Decoder &decoder)
|
||||
modellist.push_back(mymodel);
|
||||
}
|
||||
decoder.closeElement(elemId);
|
||||
@@ -61,10 +39,10 @@ index c52d92c80..937b57157 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 63784131d..ff8bb6a23 100644
|
||||
index f7781707..283d81c3 100644
|
||||
--- a/Ghidra/Features/Decompiler/src/decompile/cpp/funcdata_varnode.cc
|
||||
+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/funcdata_varnode.cc
|
||||
@@ -501,7 +501,13 @@ void Funcdata::setHighLevel(void)
|
||||
@@ -503,7 +503,13 @@ void Funcdata::setHighLevel(void)
|
||||
void Funcdata::transferVarnodeProperties(Varnode *vn,Varnode *newVn,int4 lsbOffset)
|
||||
|
||||
{
|
||||
@@ -80,10 +58,10 @@ index 63784131d..ff8bb6a23 100644
|
||||
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 b4f8a3f8e..068393416 100644
|
||||
index 0e3decc8..403ec35a 100644
|
||||
--- a/Ghidra/Features/Decompiler/src/decompile/cpp/op.cc
|
||||
+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/op.cc
|
||||
@@ -667,7 +667,11 @@ uintb PcodeOp::getNZMaskLocal(bool cliploop) const
|
||||
@@ -672,7 +672,11 @@ uintb PcodeOp::getNZMaskLocal(bool cliploop) const
|
||||
break;
|
||||
case CPUI_PIECE:
|
||||
resmask = getIn(0)->getNZMask();
|
||||
@@ -97,16 +75,16 @@ index b4f8a3f8e..068393416 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 3b84bac6a..3e0c39904 100644
|
||||
index fcd75cc7..ed0e005a 100644
|
||||
--- a/Ghidra/Features/Decompiler/src/decompile/cpp/opbehavior.cc
|
||||
+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/opbehavior.cc
|
||||
@@ -747,7 +747,13 @@ uintb OpBehaviorPiece::evaluateBinary(int4 sizeout,int4 sizein,uintb in1,uintb i
|
||||
@@ -750,7 +750,13 @@ uintb OpBehaviorPiece::evaluateBinary(int4 sizeout,int4 sizein,uintb in1,uintb i
|
||||
uintb OpBehaviorSubpiece::evaluateBinary(int4 sizeout,int4 sizein,uintb in1,uintb in2) const
|
||||
|
||||
{
|
||||
- uintb res = (in1>>(in2*8)) & calc_mask(sizeout);
|
||||
+ uintb res = in1;
|
||||
+ if ((in2*8) < sizeof(in1)) {
|
||||
+ if (in2 < sizeof(in1)) {
|
||||
+ res >>= (in2*8);
|
||||
+ } else {
|
||||
+ res = 0;
|
||||
@@ -116,10 +94,10 @@ index 3b84bac6a..3e0c39904 100644
|
||||
}
|
||||
|
||||
diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/pcodecompile.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/pcodecompile.cc
|
||||
index 49128f7e6..133da8178 100644
|
||||
index ca9d71ab..85d4dd28 100644
|
||||
--- a/Ghidra/Features/Decompiler/src/decompile/cpp/pcodecompile.cc
|
||||
+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/pcodecompile.cc
|
||||
@@ -619,8 +619,10 @@ vector<OpTpl *> *PcodeCompile::assignBitRange(VarnodeTpl *vn,uint4 bitoffset,uin
|
||||
@@ -621,8 +621,10 @@ vector<OpTpl *> *PcodeCompile::assignBitRange(VarnodeTpl *vn,uint4 bitoffset,uin
|
||||
uint4 smallsize = (numbits+7)/8; // Size of input (output of rhs)
|
||||
bool shiftneeded = (bitoffset != 0);
|
||||
bool zextneeded = true;
|
||||
@@ -132,7 +110,7 @@ index 49128f7e6..133da8178 100644
|
||||
|
||||
if (vn->getSize().getType()==ConstTpl::real) {
|
||||
// If we know the size of the bitranged varnode, we can
|
||||
@@ -724,9 +726,6 @@ ExprTree *PcodeCompile::createBitRange(SpecificSymbol *sym,uint4 bitoffset,uint4
|
||||
@@ -726,9 +728,6 @@ ExprTree *PcodeCompile::createBitRange(SpecificSymbol *sym,uint4 bitoffset,uint4
|
||||
}
|
||||
}
|
||||
|
||||
@@ -142,7 +120,7 @@ index 49128f7e6..133da8178 100644
|
||||
if (truncneeded && ((bitoffset % 8)==0)) {
|
||||
truncshift = bitoffset/8;
|
||||
bitoffset = 0;
|
||||
@@ -749,8 +748,13 @@ ExprTree *PcodeCompile::createBitRange(SpecificSymbol *sym,uint4 bitoffset,uint4
|
||||
@@ -751,8 +750,13 @@ ExprTree *PcodeCompile::createBitRange(SpecificSymbol *sym,uint4 bitoffset,uint4
|
||||
appendOp(CPUI_INT_RIGHT,res,bitoffset,4);
|
||||
if (truncneeded)
|
||||
appendOp(CPUI_SUBPIECE,res,truncshift,4);
|
||||
@@ -159,10 +137,10 @@ index 49128f7e6..133da8178 100644
|
||||
return res;
|
||||
}
|
||||
diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/ruleaction.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/ruleaction.cc
|
||||
index 973a7a31d..3955b836b 100644
|
||||
index 4851365d..d069d1c9 100644
|
||||
--- a/Ghidra/Features/Decompiler/src/decompile/cpp/ruleaction.cc
|
||||
+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/ruleaction.cc
|
||||
@@ -974,7 +974,12 @@ int4 RulePullsubIndirect::applyOp(PcodeOp *op,Funcdata &data)
|
||||
@@ -976,7 +976,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
|
||||
|
||||
@@ -176,7 +154,7 @@ index 973a7a31d..3955b836b 100644
|
||||
consume = ~consume;
|
||||
if ((consume & indir->getIn(0)->getConsume())!=0) return 0;
|
||||
|
||||
@@ -6805,8 +6810,9 @@ int4 RulePtrsubCharConstant::applyOp(PcodeOp *op,Funcdata &data)
|
||||
@@ -6782,8 +6787,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;
|
||||
@@ -188,7 +166,7 @@ index 973a7a31d..3955b836b 100644
|
||||
Varnode *vn1 = op->getIn(1);
|
||||
if (!vn1->isConstant()) return 0;
|
||||
Varnode *outvn = op->getOut();
|
||||
@@ -8289,7 +8295,11 @@ int4 RuleSubvarSubpiece::applyOp(PcodeOp *op,Funcdata &data)
|
||||
@@ -8593,7 +8599,11 @@ int4 RuleSubvarSubpiece::applyOp(PcodeOp *op,Funcdata &data)
|
||||
Varnode *outvn = op->getOut();
|
||||
int4 flowsize = outvn->getSize();
|
||||
uintb mask = calc_mask( flowsize );
|
||||
@@ -202,10 +180,10 @@ index 973a7a31d..3955b836b 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 ecebc0970..1c9ab7560 100644
|
||||
index 2e3531ea..42482be7 100644
|
||||
--- a/Ghidra/Features/Decompiler/src/decompile/cpp/semantics.cc
|
||||
+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/semantics.cc
|
||||
@@ -20,6 +20,7 @@ ConstTpl::ConstTpl(const_type tp)
|
||||
@@ -22,6 +22,7 @@ ConstTpl::ConstTpl(const_type tp)
|
||||
|
||||
{ // Constructor for relative jump constants and uniques
|
||||
type = tp;
|
||||
@@ -213,7 +191,7 @@ index ecebc0970..1c9ab7560 100644
|
||||
}
|
||||
|
||||
ConstTpl::ConstTpl(const_type tp,uintb val)
|
||||
@@ -54,6 +55,7 @@ ConstTpl::ConstTpl(AddrSpace *sid)
|
||||
@@ -56,6 +57,7 @@ ConstTpl::ConstTpl(AddrSpace *sid)
|
||||
{
|
||||
type = spaceid;
|
||||
value.spaceid = sid;
|
||||
@@ -222,10 +200,10 @@ index ecebc0970..1c9ab7560 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 3b836244c..1fbd169c9 100644
|
||||
index 8e283dca..652600c1 100644
|
||||
--- a/Ghidra/Features/Decompiler/src/decompile/cpp/semantics.hh
|
||||
+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/semantics.hh
|
||||
@@ -46,7 +46,7 @@ class ConstTpl {
|
||||
@@ -48,7 +48,7 @@ private:
|
||||
static void printHandleSelector(ostream &s,v_field val);
|
||||
static v_field readHandleSelector(const string &name);
|
||||
public:
|
||||
@@ -235,10 +213,10 @@ index 3b836244c..1fbd169c9 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 c26cd468f..40d731480 100644
|
||||
index b40f7438..3c37958d 100644
|
||||
--- a/Ghidra/Features/Decompiler/src/decompile/cpp/slgh_compile.cc
|
||||
+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/slgh_compile.cc
|
||||
@@ -2152,8 +2152,8 @@ string SleighCompile::checkSymbols(SymbolScope *scope)
|
||||
@@ -2163,8 +2163,8 @@ string SleighCompile::checkSymbols(SymbolScope *scope)
|
||||
ostringstream msg;
|
||||
SymbolTree::const_iterator iter;
|
||||
for(iter=scope->begin();iter!=scope->end();++iter) {
|
||||
@@ -249,10 +227,10 @@ index c26cd468f..40d731480 100644
|
||||
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 dbb8f9e51..85bd54261 100644
|
||||
index b308e1b7..af2982ae 100644
|
||||
--- a/Ghidra/Features/Decompiler/src/decompile/cpp/slghsymbol.cc
|
||||
+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/slghsymbol.cc
|
||||
@@ -2565,7 +2565,7 @@ void ContextOp::restoreXml(const Element *el,SleighBase *trans)
|
||||
@@ -2569,7 +2569,7 @@ void ContextOp::restoreXml(const Element *el,SleighBase *trans)
|
||||
const List &list(el->getChildren());
|
||||
List::const_iterator iter;
|
||||
iter = list.begin();
|
||||
@@ -262,10 +240,10 @@ index dbb8f9e51..85bd54261 100644
|
||||
}
|
||||
|
||||
diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/type.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/type.cc
|
||||
index 8d5dc17ed..f50e07f84 100644
|
||||
index 30faf0b6..e76a0619 100644
|
||||
--- a/Ghidra/Features/Decompiler/src/decompile/cpp/type.cc
|
||||
+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/type.cc
|
||||
@@ -3233,8 +3233,8 @@ void TypeFactory::recalcPointerSubmeta(Datatype *base,sub_metatype sub)
|
||||
@@ -3359,8 +3359,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()) {
|
||||
@@ -276,10 +254,10 @@ index 8d5dc17ed..f50e07f84 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 ab99382a3..67d92c573 100644
|
||||
index c35bde87..061e5367 100644
|
||||
--- a/Ghidra/Features/Decompiler/src/decompile/unittests/testfloatemu.cc
|
||||
+++ b/Ghidra/Features/Decompiler/src/decompile/unittests/testfloatemu.cc
|
||||
@@ -338,7 +338,7 @@ TEST(float_opTrunc_to_int) {
|
||||
@@ -346,7 +346,7 @@ TEST(float_opTrunc_to_int) {
|
||||
|
||||
for(float f:float_test_values) {
|
||||
// avoid undefined behavior
|
||||
@@ -289,5 +267,5 @@ index ab99382a3..67d92c573 100644
|
||||
uintb true_result = ((uintb)(int32_t)f) & 0xffffffff;
|
||||
uintb encoding = format.getEncoding(f);
|
||||
--
|
||||
2.40.0
|
||||
2.39.2 (Apple Git-143)
|
||||
|
||||
@@ -1,165 +0,0 @@
|
||||
From 2ade75baba3f2945d5b53e5c1eedb53ebe10f61b Mon Sep 17 00:00:00 2001
|
||||
From: Eric Kilmer <eric.d.kilmer@gmail.com>
|
||||
Date: Sun, 13 Feb 2022 12:59:42 -0500
|
||||
Subject: [PATCH 1/8] Small improvements to C++ decompiler testing from CLI
|
||||
|
||||
* Fixes argument parsing to accept more than one option for specifying
|
||||
paths.
|
||||
|
||||
* Return a non-zero exit code (clamped to max value 255, even if more
|
||||
than 255 tests fail) indicating number of failed tests. This is
|
||||
helpful when running in a script (like in CI) to detect failures
|
||||
instead of detecting failures through manual visual inspection of
|
||||
output text.
|
||||
---
|
||||
.../Decompiler/src/decompile/cpp/test.cc | 42 ++++++++++++++-----
|
||||
.../Decompiler/src/decompile/cpp/test.hh | 2 +-
|
||||
.../src/decompile/cpp/testfunction.cc | 3 +-
|
||||
.../src/decompile/cpp/testfunction.hh | 2 +-
|
||||
4 files changed, 36 insertions(+), 13 deletions(-)
|
||||
|
||||
diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/test.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/test.cc
|
||||
index e81f2564a..ebc049c29 100644
|
||||
--- a/Ghidra/Features/Decompiler/src/decompile/cpp/test.cc
|
||||
+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/test.cc
|
||||
@@ -14,6 +14,9 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
#include "test.hh"
|
||||
+
|
||||
+#include <algorithm>
|
||||
+
|
||||
#include "libdecomp.hh"
|
||||
|
||||
vector<UnitTest *> UnitTest::tests;
|
||||
@@ -21,7 +24,8 @@ vector<UnitTest *> UnitTest::tests;
|
||||
/// Run all the tests unless a non-empty set of names is passed in.
|
||||
/// In which case, only the named tests in the set are run.
|
||||
/// \param testNames is the set of names
|
||||
-void UnitTest::run(set<string> &testNames)
|
||||
+/// \return number of failed tests
|
||||
+int UnitTest::run(set<string> &testNames)
|
||||
|
||||
{
|
||||
int total = 0;
|
||||
@@ -42,6 +46,7 @@ void UnitTest::run(set<string> &testNames)
|
||||
}
|
||||
std::cerr << "==============================" << std::endl;
|
||||
std::cerr << passed << "/" << total << " tests passed." << std::endl;
|
||||
+ return total - passed;
|
||||
}
|
||||
|
||||
/// Create list of the absolute path of all tests to be run
|
||||
@@ -85,7 +90,7 @@ int main(int argc, char **argv) {
|
||||
set<string> dataTestNames;
|
||||
string dirname("../datatests");
|
||||
string sleighdirname("../../../../../../..");
|
||||
- if (argc > 0) {
|
||||
+ while (argc > 0) {
|
||||
string command(argv[0]);
|
||||
if (command == "-path") {
|
||||
dirname = argv[1];
|
||||
@@ -109,30 +114,47 @@ int main(int argc, char **argv) {
|
||||
argv += 1;
|
||||
argc -= 1;
|
||||
}
|
||||
- }
|
||||
- if (argc > 0) {
|
||||
- string command(argv[0]);
|
||||
- if (command == "unittests") {
|
||||
+ else if (command == "unittests") {
|
||||
runUnitTests = true;
|
||||
runDataTests = false; // Run only unit tests
|
||||
unitTestNames.insert(argv + 1,argv + argc);
|
||||
+ break;
|
||||
}
|
||||
else if (command == "datatests") {
|
||||
runUnitTests = false; // Run only data-tests
|
||||
runDataTests = true;
|
||||
dataTestNames.insert(argv + 1,argv + argc);
|
||||
+ break;
|
||||
}
|
||||
else {
|
||||
- cout << "USAGE: ghidra_test [-path <datatestdir>] [[unittests|datatests] [testname1 testname2 ...]]" << endl;
|
||||
+ cout << "USAGE: ghidra_test [-usesleighenv] [-sleighpath <sleighdir>] [-path <datatestdir>] [[unittests|datatests] [testname1 testname2 ...]]" << endl;
|
||||
+ return -1;
|
||||
}
|
||||
}
|
||||
startDecompilerLibrary(sleighdirname.c_str());
|
||||
- if (runUnitTests)
|
||||
- UnitTest::run(unitTestNames);
|
||||
+
|
||||
+ // Keep track of failed tests as return code to indicate failures, clamped at
|
||||
+ // max 255 value
|
||||
+ int failedTests = 0;
|
||||
+ if (runUnitTests) {
|
||||
+ int errors = UnitTest::run(unitTestNames);
|
||||
+ // Clamp at 255 max return code
|
||||
+ failedTests = std::min(
|
||||
+ failedTests +
|
||||
+ (errors < 0 ? 255 : std::min(errors, 255)),
|
||||
+ 255);
|
||||
+ }
|
||||
if (runDataTests) {
|
||||
vector<string> testFiles;
|
||||
gatherDataTests(dirname,dataTestNames,testFiles);
|
||||
cout << endl << endl;
|
||||
- FunctionTestCollection::runTestFiles(testFiles,cout);
|
||||
+ int errors = FunctionTestCollection::runTestFiles(testFiles,cout);
|
||||
+ // Clamp at 255 max return code
|
||||
+ failedTests = std::min(
|
||||
+ failedTests +
|
||||
+ (errors < 0 ? 255 : std::min(errors, 255)),
|
||||
+ 255);
|
||||
}
|
||||
+
|
||||
+ return failedTests;
|
||||
}
|
||||
diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/test.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/test.hh
|
||||
index 8b762c5b1..a138f511d 100644
|
||||
--- a/Ghidra/Features/Decompiler/src/decompile/cpp/test.hh
|
||||
+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/test.hh
|
||||
@@ -54,7 +54,7 @@ struct UnitTest {
|
||||
tests.push_back(this);
|
||||
}
|
||||
|
||||
- static void run(std::set<std::string> &testNames); ///< Run all the instantiated tests
|
||||
+ static int run(std::set<std::string> &testNames); ///< Run all the instantiated tests
|
||||
};
|
||||
|
||||
|
||||
diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/testfunction.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/testfunction.cc
|
||||
index 6311dba06..4f7110bb4 100644
|
||||
--- a/Ghidra/Features/Decompiler/src/decompile/cpp/testfunction.cc
|
||||
+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/testfunction.cc
|
||||
@@ -304,7 +304,7 @@ void FunctionTestCollection::runTests(list<string> &lateStream)
|
||||
/// Run through all XML files in the given list, processing each in turn.
|
||||
/// \param testFiles is the given list of test files
|
||||
/// \param s is the output stream to print results to
|
||||
-void FunctionTestCollection::runTestFiles(const vector<string> &testFiles,ostream &s)
|
||||
+int FunctionTestCollection::runTestFiles(const vector<string> &testFiles,ostream &s)
|
||||
|
||||
{
|
||||
int4 totalTestsApplied = 0;
|
||||
@@ -344,4 +344,5 @@ void FunctionTestCollection::runTestFiles(const vector<string> &testFiles,ostrea
|
||||
if (iter == failures.end()) break;
|
||||
}
|
||||
}
|
||||
+ return totalTestsApplied - totalTestsSucceeded;
|
||||
}
|
||||
diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/testfunction.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/testfunction.hh
|
||||
index 52125b401..46abd6bce 100644
|
||||
--- a/Ghidra/Features/Decompiler/src/decompile/cpp/testfunction.hh
|
||||
+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/testfunction.hh
|
||||
@@ -91,7 +91,7 @@ class FunctionTestCollection {
|
||||
void restoreXml(DocumentStorage &store,const Element *el); ///< Load tests from a \<decompilertest> tag.
|
||||
void restoreXmlOldForm(DocumentStorage &store,const Element *el); ///< Load tests from \<binaryimage> tag.
|
||||
void runTests(list<string> &lateStream); ///< Run the script and perform the tests
|
||||
- static void runTestFiles(const vector<string> &testFiles,ostream &s); ///< Run tests for each listed file
|
||||
+ static int runTestFiles(const vector<string> &testFiles,ostream &s); ///< Run tests for each listed file
|
||||
};
|
||||
|
||||
#endif
|
||||
--
|
||||
2.40.0
|
||||
|
||||
@@ -1,137 +0,0 @@
|
||||
From 9f82d92228afeaac6e8482a1e842fea9d195e750 Mon Sep 17 00:00:00 2001
|
||||
From: Eric Kilmer <eric.d.kilmer@gmail.com>
|
||||
Date: Thu, 28 Jul 2022 09:20:03 -0400
|
||||
Subject: [PATCH 2/8] Add include guards to decompiler C++ headers
|
||||
|
||||
---
|
||||
Ghidra/Features/Decompiler/src/decompile/cpp/bfd_arch.hh | 5 +++++
|
||||
Ghidra/Features/Decompiler/src/decompile/cpp/graph.hh | 6 ++++++
|
||||
Ghidra/Features/Decompiler/src/decompile/cpp/ifaceterm.hh | 5 +++++
|
||||
Ghidra/Features/Decompiler/src/decompile/cpp/raw_arch.hh | 5 +++++
|
||||
.../Features/Decompiler/src/decompile/cpp/slgh_compile.hh | 5 +++++
|
||||
Ghidra/Features/Decompiler/src/decompile/cpp/xml_arch.hh | 6 ++++++
|
||||
6 files changed, 32 insertions(+)
|
||||
|
||||
diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/bfd_arch.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/bfd_arch.hh
|
||||
index 875d3bb78..6ade01ecc 100644
|
||||
--- a/Ghidra/Features/Decompiler/src/decompile/cpp/bfd_arch.hh
|
||||
+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/bfd_arch.hh
|
||||
@@ -17,6 +17,9 @@
|
||||
/// \file bfd_arch.hh
|
||||
/// \brief Specific implementation of Architecture using GNU BFD libraries
|
||||
|
||||
+#ifndef __BFD_ARCH__
|
||||
+#define __BFD_ARCH__
|
||||
+
|
||||
#include "sleigh_arch.hh"
|
||||
#include "loadimage_bfd.hh"
|
||||
|
||||
@@ -47,3 +50,5 @@ class BfdArchitecture : public SleighArchitecture {
|
||||
BfdArchitecture(const string &fname,const string &targ,ostream *estream); ///< Constructor
|
||||
virtual ~BfdArchitecture(void) {}
|
||||
};
|
||||
+
|
||||
+#endif
|
||||
diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/graph.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/graph.hh
|
||||
index 364a5258d..edd6ce865 100644
|
||||
--- a/Ghidra/Features/Decompiler/src/decompile/cpp/graph.hh
|
||||
+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/graph.hh
|
||||
@@ -14,8 +14,14 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
+
|
||||
+#ifndef __GRAPH__
|
||||
+#define __GRAPH__
|
||||
+
|
||||
#include "funcdata.hh"
|
||||
|
||||
extern void dump_dataflow_graph(Funcdata &data,ostream &s);
|
||||
extern void dump_controlflow_graph(const string &name,const BlockGraph &graph,ostream &s);
|
||||
extern void dump_dom_graph(const string &name,const BlockGraph &graph,ostream &s);
|
||||
+
|
||||
+#endif
|
||||
diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/ifaceterm.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/ifaceterm.hh
|
||||
index 3ca912dd6..0b70d8b22 100644
|
||||
--- a/Ghidra/Features/Decompiler/src/decompile/cpp/ifaceterm.hh
|
||||
+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/ifaceterm.hh
|
||||
@@ -16,6 +16,9 @@
|
||||
/// \file ifaceterm.hh
|
||||
/// \brief Add some terminal capabilities to the command-line interface (IfaceStatus)
|
||||
|
||||
+#ifndef __IFACE_TERM__
|
||||
+#define __IFACE_TERM__
|
||||
+
|
||||
#include "interface.hh"
|
||||
|
||||
#ifdef __TERMINAL__
|
||||
@@ -48,3 +51,5 @@ class IfaceTerm : public IfaceStatus {
|
||||
virtual void popScript(void);
|
||||
virtual bool isStreamFinished(void) const;
|
||||
};
|
||||
+
|
||||
+#endif
|
||||
diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/raw_arch.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/raw_arch.hh
|
||||
index 2245840a0..490abf901 100644
|
||||
--- a/Ghidra/Features/Decompiler/src/decompile/cpp/raw_arch.hh
|
||||
+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/raw_arch.hh
|
||||
@@ -15,6 +15,10 @@
|
||||
*/
|
||||
/// \file raw_arch.hh
|
||||
/// \brief Bare bones capability for treating a file as a raw executable image
|
||||
+
|
||||
+#ifndef __RAW_ARCH__
|
||||
+#define __RAW_ARCH__
|
||||
+
|
||||
#include "sleigh_arch.hh"
|
||||
#include "loadimage.hh"
|
||||
|
||||
@@ -46,3 +50,4 @@ class RawBinaryArchitecture : public SleighArchitecture {
|
||||
virtual ~RawBinaryArchitecture(void) {}
|
||||
};
|
||||
|
||||
+#endif
|
||||
diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/slgh_compile.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/slgh_compile.hh
|
||||
index e7ab19185..8fd9ba2fd 100644
|
||||
--- a/Ghidra/Features/Decompiler/src/decompile/cpp/slgh_compile.hh
|
||||
+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/slgh_compile.hh
|
||||
@@ -16,6 +16,9 @@
|
||||
/// \file slgh_compile.hh
|
||||
/// \brief High-level control of the sleigh compilation process
|
||||
|
||||
+#ifndef __SLGH_COMPILE__
|
||||
+#define __SLGH_COMPILE__
|
||||
+
|
||||
#include "sleighbase.hh"
|
||||
#include "pcodecompile.hh"
|
||||
#include "filemanage.hh"
|
||||
@@ -446,3 +449,5 @@ class SleighCompile : public SleighBase {
|
||||
|
||||
extern SleighCompile *slgh; ///< A global reference to the SLEIGH compiler accessible to the parse functions
|
||||
extern int yydebug; ///< Debug state for the SLEIGH parse functions
|
||||
+
|
||||
+#endif
|
||||
diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/xml_arch.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/xml_arch.hh
|
||||
index d395fb8a3..6371148b0 100644
|
||||
--- a/Ghidra/Features/Decompiler/src/decompile/cpp/xml_arch.hh
|
||||
+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/xml_arch.hh
|
||||
@@ -15,6 +15,10 @@
|
||||
*/
|
||||
/// \file xml_arch.hh
|
||||
/// \brief Extension to read executables based on an XML format
|
||||
+
|
||||
+#ifndef __XML_ARCH__
|
||||
+#define __XML_ARCH__
|
||||
+
|
||||
#include "sleigh_arch.hh"
|
||||
#include "loadimage_xml.hh"
|
||||
|
||||
@@ -45,3 +49,5 @@ class XmlArchitecture : public SleighArchitecture {
|
||||
XmlArchitecture(const string &fname,const string &targ,ostream *estream); ///< Constructor
|
||||
virtual ~XmlArchitecture(void) {}
|
||||
};
|
||||
+
|
||||
+#endif
|
||||
--
|
||||
2.40.0
|
||||
|
||||
+10
-9
@@ -1,7 +1,8 @@
|
||||
From a5f1be9df17f10db97dbd12243b001591d8b64d9 Mon Sep 17 00:00:00 2001
|
||||
From: Alex Cameron <asc@tetsuo.sh>
|
||||
Date: Wed, 3 Aug 2022 20:01:18 +1000
|
||||
Subject: [PATCH 4/8] Use `stroull` instead of `stroul` to parse address
|
||||
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
|
||||
offsets
|
||||
|
||||
---
|
||||
@@ -9,7 +10,7 @@ Subject: [PATCH 4/8] 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 40a3e3bfe..ff6f282ca 100644
|
||||
index bf4e1dc9..594b4583 100644
|
||||
--- a/Ghidra/Features/Decompiler/src/decompile/cpp/space.cc
|
||||
+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/space.cc
|
||||
@@ -16,6 +16,8 @@
|
||||
@@ -18,10 +19,10 @@ index 40a3e3bfe..ff6f282ca 100644
|
||||
|
||||
+#include <climits>
|
||||
+
|
||||
namespace ghidra {
|
||||
|
||||
AttributeId ATTRIB_BASE = AttributeId("base",89);
|
||||
AttributeId ATTRIB_DEADCODEDELAY = AttributeId("deadcodedelay",90);
|
||||
AttributeId ATTRIB_DELAY = AttributeId("delay", 91);
|
||||
@@ -268,7 +270,10 @@ uintb AddrSpace::read(const string &s,int4 &size) const
|
||||
@@ -290,7 +292,10 @@ uintb AddrSpace::read(const string &s,int4 &size) const
|
||||
}
|
||||
}
|
||||
catch(LowlevelError &err) { // Name doesn't exist
|
||||
@@ -34,5 +35,5 @@ index 40a3e3bfe..ff6f282ca 100644
|
||||
enddata = (const char *) tmpdata;
|
||||
if (enddata - s.c_str() == s.size()) { // If no size or offset override
|
||||
--
|
||||
2.40.0
|
||||
2.39.2 (Apple Git-143)
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,51 +0,0 @@
|
||||
From 893e32017fb08c773bfedafe790667db3a39cf62 Mon Sep 17 00:00:00 2001
|
||||
From: Eric Kilmer <eric.d.kilmer@gmail.com>
|
||||
Date: Sun, 19 Mar 2023 15:46:26 -0400
|
||||
Subject: [PATCH 7/8] (3/4) decompiler: Manually fix std namespace in generated
|
||||
file
|
||||
|
||||
We must manually fix the symbols from std namespace because the
|
||||
automated tool does not know how to parse yacc/bison files.
|
||||
---
|
||||
.../Decompiler/src/decompile/cpp/slghparse.y | 14 +++++++-------
|
||||
1 file changed, 7 insertions(+), 7 deletions(-)
|
||||
|
||||
diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/slghparse.y b/Ghidra/Features/Decompiler/src/decompile/cpp/slghparse.y
|
||||
index 0e2172f79..039963cd5 100644
|
||||
--- a/Ghidra/Features/Decompiler/src/decompile/cpp/slghparse.y
|
||||
+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/slghparse.y
|
||||
@@ -32,24 +32,24 @@ using namespace std;
|
||||
char ch;
|
||||
uintb *i;
|
||||
intb *big;
|
||||
- string *str;
|
||||
- vector<string> *strlist;
|
||||
- vector<intb> *biglist;
|
||||
- vector<ExprTree *> *param;
|
||||
+ std::string *str;
|
||||
+ std::vector<std::string> *strlist;
|
||||
+ std::vector<intb> *biglist;
|
||||
+ std::vector<ExprTree *> *param;
|
||||
SpaceQuality *spacequal;
|
||||
FieldQuality *fieldqual;
|
||||
StarQuality *starqual;
|
||||
VarnodeTpl *varnode;
|
||||
ExprTree *tree;
|
||||
- vector<OpTpl *> *stmt;
|
||||
+ std::vector<OpTpl *> *stmt;
|
||||
ConstructTpl *sem;
|
||||
SectionVector *sectionstart;
|
||||
Constructor *construct;
|
||||
PatternEquation *pateq;
|
||||
PatternExpression *patexp;
|
||||
|
||||
- vector<SleighSymbol *> *symlist;
|
||||
- vector<ContextChange *> *contop;
|
||||
+ std::vector<SleighSymbol *> *symlist;
|
||||
+ std::vector<ContextChange *> *contop;
|
||||
SleighSymbol *anysym;
|
||||
SpaceSymbol *spacesym;
|
||||
SectionSymbol *sectionsym;
|
||||
--
|
||||
2.40.0
|
||||
|
||||
@@ -1,29 +0,0 @@
|
||||
From 92dd6f2579323dba0b5438c245f342507d27ec01 Mon Sep 17 00:00:00 2001
|
||||
From: Eric Kilmer <eric.d.kilmer@gmail.com>
|
||||
Date: Sun, 19 Mar 2023 15:47:28 -0400
|
||||
Subject: [PATCH 8/8] (4/4) decompiler: Manually fix missed std variable usage
|
||||
|
||||
Unfortunately, the heuristics in remusing are unable to automatically
|
||||
fix this case of variables from the C++ standard library.
|
||||
|
||||
This was fixed by resolving the error(s) produced by the compiler.
|
||||
---
|
||||
Ghidra/Features/Decompiler/src/decompile/cpp/ghidra_process.hh | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/ghidra_process.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/ghidra_process.hh
|
||||
index 64fd45e35..428319a65 100644
|
||||
--- a/Ghidra/Features/Decompiler/src/decompile/cpp/ghidra_process.hh
|
||||
+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/ghidra_process.hh
|
||||
@@ -79,7 +79,7 @@ class GhidraCommand {
|
||||
virtual void loadParameters(void); ///< Read parameters directing command execution
|
||||
virtual void sendResult(void); ///< Send results of the command (if any) back to the Ghidra client
|
||||
public:
|
||||
- GhidraCommand(void) : sin(cin),sout(cout) {
|
||||
+ GhidraCommand(void) : sin(std::cin),sout(std::cout) {
|
||||
ghidra = (ArchitectureGhidra *)0;
|
||||
} ///< Construct given i/o streams
|
||||
virtual ~GhidraCommand(void) {} ///< Destructor
|
||||
--
|
||||
2.40.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.2.3")
|
||||
set(ghidra_version "10.3.2")
|
||||
set(ghidra_git_tag "Ghidra_${ghidra_version}_build")
|
||||
set(ghidra_shallow TRUE)
|
||||
|
||||
@@ -38,36 +38,25 @@ set(ghidra_patches
|
||||
PATCH_COMMAND "${GIT_EXECUTABLE}" config user.name "${ghidra_patch_user}" &&
|
||||
"${GIT_EXECUTABLE}" config user.email "${ghidra_patch_email}" &&
|
||||
"${GIT_EXECUTABLE}" am --ignore-space-change --ignore-whitespace --no-gpg-sign
|
||||
"${CMAKE_CURRENT_LIST_DIR}/patches/stable/0001-Small-improvements-to-C-decompiler-testing-from-CLI.patch"
|
||||
"${CMAKE_CURRENT_LIST_DIR}/patches/stable/0002-Add-include-guards-to-decompiler-C-headers.patch"
|
||||
"${CMAKE_CURRENT_LIST_DIR}/patches/stable/0003-Fix-UBSAN-errors-in-decompiler.patch"
|
||||
"${CMAKE_CURRENT_LIST_DIR}/patches/stable/0004-Use-stroull-instead-of-stroul-to-parse-address-offse.patch"
|
||||
"${CMAKE_CURRENT_LIST_DIR}/patches/stable/0005-1-4-decompiler-Add-using-namespace-std-to-all-.cc.patch"
|
||||
"${CMAKE_CURRENT_LIST_DIR}/patches/stable/0006-2-4-decompiler-Remusing-automated-std-namespace-fix.patch"
|
||||
"${CMAKE_CURRENT_LIST_DIR}/patches/stable/0007-3-4-decompiler-Manually-fix-std-namespace-in-generat.patch"
|
||||
"${CMAKE_CURRENT_LIST_DIR}/patches/stable/0008-4-4-decompiler-Manually-fix-missed-std-variable-usag.patch"
|
||||
"${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"
|
||||
)
|
||||
|
||||
# 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.3")
|
||||
set(ghidra_head_version "10.4")
|
||||
set(ghidra_version "${ghidra_head_version}")
|
||||
set(ghidra_head_git_tag "acb07dd535a9ff10d230e989cc45523482e76fa9")
|
||||
set(ghidra_head_git_tag "b0e0c7372af0236f3dd809ee19e35e01b437b770")
|
||||
set(ghidra_git_tag "${ghidra_head_git_tag}")
|
||||
set(ghidra_shallow FALSE)
|
||||
set(ghidra_patches
|
||||
PATCH_COMMAND "${GIT_EXECUTABLE}" config user.name "${ghidra_patch_user}" &&
|
||||
"${GIT_EXECUTABLE}" config user.email "${ghidra_patch_email}" &&
|
||||
"${GIT_EXECUTABLE}" am --ignore-space-change --ignore-whitespace --no-gpg-sign
|
||||
"${CMAKE_CURRENT_LIST_DIR}/patches/HEAD/0001-Add-include-guards-to-decompiler-C-headers.patch"
|
||||
"${CMAKE_CURRENT_LIST_DIR}/patches/HEAD/0002-Fix-UBSAN-errors-in-decompiler.patch"
|
||||
"${CMAKE_CURRENT_LIST_DIR}/patches/HEAD/0003-Use-stroull-instead-of-stroul-to-parse-address-offse.patch"
|
||||
"${CMAKE_CURRENT_LIST_DIR}/patches/HEAD/0004-1-4-decompiler-Add-using-namespace-std-to-all-.cc-fi.patch"
|
||||
"${CMAKE_CURRENT_LIST_DIR}/patches/HEAD/0005-2-4-decompiler-Automated-std-namespace-fix-with-remu.patch"
|
||||
"${CMAKE_CURRENT_LIST_DIR}/patches/HEAD/0006-3-4-decompiler-Manually-fix-std-namespace-in-generat.patch"
|
||||
"${CMAKE_CURRENT_LIST_DIR}/patches/HEAD/0007-4-4-decompiler-Manually-fix-missed-std-variable-usag.patch"
|
||||
"${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"
|
||||
)
|
||||
string(SUBSTRING "${ghidra_git_tag}" 0 7 ghidra_short_commit)
|
||||
else()
|
||||
|
||||
@@ -33,6 +33,7 @@ set(spec_file_list
|
||||
"${ghidrasource_SOURCE_DIR}/Ghidra/Processors/Atmel/data/languages/avr8e.slaspec"
|
||||
"${ghidrasource_SOURCE_DIR}/Ghidra/Processors/Atmel/data/languages/avr8eind.slaspec"
|
||||
"${ghidrasource_SOURCE_DIR}/Ghidra/Processors/Atmel/data/languages/avr8xmega.slaspec"
|
||||
"${ghidrasource_SOURCE_DIR}/Ghidra/Processors/BPF/data/languages/BPF_le.slaspec"
|
||||
"${ghidrasource_SOURCE_DIR}/Ghidra/Processors/CP1600/data/languages/CP1600.slaspec"
|
||||
"${ghidrasource_SOURCE_DIR}/Ghidra/Processors/CR16/data/languages/CR16B.slaspec"
|
||||
"${ghidrasource_SOURCE_DIR}/Ghidra/Processors/CR16/data/languages/CR16C.slaspec"
|
||||
@@ -123,6 +124,7 @@ set(spec_file_list
|
||||
"${ghidrasource_SOURCE_DIR}/Ghidra/Processors/V850/data/languages/V850.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"
|
||||
"${ghidrasource_SOURCE_DIR}/Ghidra/Processors/tricore/data/languages/tricore.slaspec"
|
||||
"${ghidrasource_SOURCE_DIR}/Ghidra/Processors/x86/data/languages/x86-64.slaspec"
|
||||
"${ghidrasource_SOURCE_DIR}/Ghidra/Processors/x86/data/languages/x86.slaspec"
|
||||
|
||||
@@ -33,6 +33,7 @@ set(spec_file_list
|
||||
"${ghidrasource_SOURCE_DIR}/Ghidra/Processors/Atmel/data/languages/avr8e.slaspec"
|
||||
"${ghidrasource_SOURCE_DIR}/Ghidra/Processors/Atmel/data/languages/avr8eind.slaspec"
|
||||
"${ghidrasource_SOURCE_DIR}/Ghidra/Processors/Atmel/data/languages/avr8xmega.slaspec"
|
||||
"${ghidrasource_SOURCE_DIR}/Ghidra/Processors/BPF/data/languages/BPF_le.slaspec"
|
||||
"${ghidrasource_SOURCE_DIR}/Ghidra/Processors/CP1600/data/languages/CP1600.slaspec"
|
||||
"${ghidrasource_SOURCE_DIR}/Ghidra/Processors/CR16/data/languages/CR16B.slaspec"
|
||||
"${ghidrasource_SOURCE_DIR}/Ghidra/Processors/CR16/data/languages/CR16C.slaspec"
|
||||
@@ -123,6 +124,7 @@ set(spec_file_list
|
||||
"${ghidrasource_SOURCE_DIR}/Ghidra/Processors/V850/data/languages/V850.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"
|
||||
"${ghidrasource_SOURCE_DIR}/Ghidra/Processors/tricore/data/languages/tricore.slaspec"
|
||||
"${ghidrasource_SOURCE_DIR}/Ghidra/Processors/x86/data/languages/x86-64.slaspec"
|
||||
"${ghidrasource_SOURCE_DIR}/Ghidra/Processors/x86/data/languages/x86.slaspec"
|
||||
|
||||
@@ -93,7 +93,9 @@
|
||||
#include <sleigh/sleigh_arch.hh>
|
||||
#include <sleigh/sleighbase.hh>
|
||||
#include <sleigh/slgh_compile.hh>
|
||||
namespace ghidra {
|
||||
#include <sleigh/slghparse.hh>
|
||||
} // End namespace ghidra
|
||||
#include <sleigh/slghpatexpress.hh>
|
||||
#include <sleigh/slghpattern.hh>
|
||||
#include <sleigh/slghsymbol.hh>
|
||||
|
||||
@@ -20,15 +20,15 @@ add_executable(sleigh_ghidra_test
|
||||
|
||||
"${library_root}/../unittests/testcirclerange.cc"
|
||||
"${library_root}/../unittests/testfloatemu.cc"
|
||||
"${library_root}/../unittests/testfuncproto.cc"
|
||||
"${library_root}/../unittests/testtypes.cc"
|
||||
"${library_root}/../unittests/testmarshal.cc"
|
||||
)
|
||||
|
||||
if(sleigh_RELEASE_IS_HEAD)
|
||||
target_sources(sleigh_ghidra_test PRIVATE
|
||||
"${library_root}/../unittests/testfuncproto.cc"
|
||||
)
|
||||
endif()
|
||||
# if(sleigh_RELEASE_IS_HEAD)
|
||||
# target_sources(sleigh_ghidra_test PRIVATE
|
||||
# )
|
||||
# endif()
|
||||
|
||||
target_compile_features(sleigh_ghidra_test PRIVATE cxx_std_11)
|
||||
target_include_directories(sleigh_ghidra_test PRIVATE "${library_root}")
|
||||
|
||||
Reference in New Issue
Block a user