Compare commits

...

287 Commits

Author SHA1 Message Date
Eric Kilmer bfd38a983b Ghidra 12.1.2 (#424) 2026-06-08 09:40:23 -04:00
auto-updater[bot] c83e3ec4d8 Update Ghidra HEAD to commit 6e8d599d5 (#422)
Bump Ghidra HEAD commit 6e8d599d5

Changed files:

```
M	Ghidra/Processors/RISCV/data/languages/riscv.csr.sinc
M	Ghidra/Processors/RISCV/data/languages/riscv.table.sinc
```

Commit details:

```
[Commit 1/1]
Hash: 6a40c607cd38f77ee95bb2c8276eb750749279fd
Date: 2026-05-27 09:35:06 -0400
Message: GP-6849: Fixed RISC-V writing to constant and a few register operands

Files changed:
  M	Ghidra/Processors/RISCV/data/languages/riscv.csr.sinc
  M	Ghidra/Processors/RISCV/data/languages/riscv.table.sinc
```

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2026-06-01 09:14:47 -04:00
auto-updater[bot] eeee4453c8 Update Ghidra HEAD to commit 94164bd6e (#421)
* Bump Ghidra HEAD commit 94164bd6e

Changed files:

```
M	Ghidra/Features/Decompiler/src/decompile/cpp/architecture.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/bfd_arch.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/block.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/block.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/blockaction.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/blockaction.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/consolemain.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/coreaction.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/coreaction.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/cpool.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/cpool.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/database.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/error.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/flow.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/funcdata.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/funcdata.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/funcdata_block.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/funcdata_op.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/funcdata_varnode.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/ghidra_arch.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/ghidra_arch.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/ghidra_process.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/ifacedecomp.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/ifaceterm.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/interface.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/jumptable.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/loadimage.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/marshal.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/marshal.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/modelrules.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/multiprecision.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/op.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/op.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/override.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/pcoderaw.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/raw_arch.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/ruleaction.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/semantics.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/semantics.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/sleigh.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/slgh_compile.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/slgh_compile.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/slghparse.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/slghparse.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/slghparse.y
M	Ghidra/Features/Decompiler/src/decompile/cpp/slghpatexpress.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/slghpattern.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/slghscan.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/slghsymbol.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/slghsymbol.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/translate.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/type.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/type.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/userop.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/variable.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/variable.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/varnode.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/varnode.hh
A	Ghidra/Features/Decompiler/src/decompile/unittests/testmultiprec.cc
M	Ghidra/Processors/8051/certification.manifest
M	Ghidra/Processors/8051/data/languages/8051.ldefs
A	Ghidra/Processors/8051/data/languages/cip-51.pspec
M	Ghidra/Processors/8051/data/languages/keil-cx51.cspec
M	Ghidra/Processors/AARCH64/certification.manifest
M	Ghidra/Processors/AARCH64/data/languages/AARCH64.ldefs
M	Ghidra/Processors/AARCH64/data/languages/AARCH64.opinion
D	Ghidra/Processors/AARCH64/data/languages/AARCH64_swift.cspec
M	Ghidra/Processors/AARCH64/data/languages/AppleSilicon.ldefs
M	Ghidra/Processors/MIPS/certification.manifest
M	Ghidra/Processors/MIPS/data/languages/mips.ldefs
M	Ghidra/Processors/MIPS/data/languages/mips.sinc
A	Ghidra/Processors/MIPS/data/languages/mips32_16e.pspec
A	Ghidra/Processors/MIPS/data/languages/mips64_16e.pspec
M	Ghidra/Processors/MIPS/data/languages/mips_dsp.sinc
M	Ghidra/Processors/TI_MSP430/data/languages/TI_MSP430.cspec
M	Ghidra/Processors/x86/certification.manifest
M	Ghidra/Processors/x86/data/languages/avx.sinc
M	Ghidra/Processors/x86/data/languages/avx512.sinc
M	Ghidra/Processors/x86/data/languages/cet.sinc
M	Ghidra/Processors/x86/data/languages/fma.sinc
M	Ghidra/Processors/x86/data/languages/ia.sinc
D	Ghidra/Processors/x86/data/languages/x86-64-swift.cspec
M	Ghidra/Processors/x86/data/languages/x86.ldefs
M	Ghidra/Processors/x86/data/languages/x86.opinion
```

Commit details:

```
[Commit 1/14]
Hash: 6fe164d65107354f22314fd0db8b894b8b1c2fdf
Date: 2026-05-19 14:14:19 +0000
Message: GP-6847 fix musl issue with _exit function for Decompiler

Files changed:
  M	Ghidra/Features/Decompiler/src/decompile/cpp/ghidra_process.cc

[Commit 2/14]
Hash: 47b4d28cb0fdffdceea659a1e8d465c74fdb9e98
Date: 2026-05-18 13:45:39 -0400
Message: GP-6697: Fixed MIPS signed immediates

Files changed:
  M	Ghidra/Processors/MIPS/data/languages/mips.sinc
  M	Ghidra/Processors/MIPS/data/languages/mips_dsp.sinc

[Commit 3/14]
Hash: 3a479c9f7ebee2f8dd91e01b1dca9b04cae1b992
Date: 2026-05-17 19:48:41 -0400
Message: GP-6347: SourceLanguage modules and new extension points

Files changed:
  M	Ghidra/Processors/AARCH64/certification.manifest
  M	Ghidra/Processors/AARCH64/data/languages/AARCH64.ldefs
  M	Ghidra/Processors/AARCH64/data/languages/AARCH64.opinion
  D	Ghidra/Processors/AARCH64/data/languages/AARCH64_swift.cspec
  M	Ghidra/Processors/AARCH64/data/languages/AppleSilicon.ldefs
  M	Ghidra/Processors/x86/certification.manifest
  D	Ghidra/Processors/x86/data/languages/x86-64-swift.cspec
  M	Ghidra/Processors/x86/data/languages/x86.ldefs
  M	Ghidra/Processors/x86/data/languages/x86.opinion

[Commit 4/14]
Hash: 4661fc0bed1a46096a462a1d39f07674fb931c32
Date: 2026-05-04 21:48:44 +0000
Message: GP-6788 Keep track of immediate COPY propagation

Files changed:
  M	Ghidra/Features/Decompiler/src/decompile/cpp/block.cc
  M	Ghidra/Features/Decompiler/src/decompile/cpp/block.hh
  M	Ghidra/Features/Decompiler/src/decompile/cpp/blockaction.cc
  M	Ghidra/Features/Decompiler/src/decompile/cpp/blockaction.hh
  M	Ghidra/Features/Decompiler/src/decompile/cpp/coreaction.cc
  M	Ghidra/Features/Decompiler/src/decompile/cpp/coreaction.hh
  M	Ghidra/Features/Decompiler/src/decompile/cpp/funcdata.cc
  M	Ghidra/Features/Decompiler/src/decompile/cpp/funcdata.hh
  M	Ghidra/Features/Decompiler/src/decompile/cpp/funcdata_block.cc
  M	Ghidra/Features/Decompiler/src/decompile/cpp/funcdata_op.cc
  M	Ghidra/Features/Decompiler/src/decompile/cpp/op.cc
  M	Ghidra/Features/Decompiler/src/decompile/cpp/op.hh
  M	Ghidra/Features/Decompiler/src/decompile/cpp/ruleaction.cc
  M	Ghidra/Features/Decompiler/src/decompile/cpp/variable.cc
  M	Ghidra/Features/Decompiler/src/decompile/cpp/variable.hh
  M	Ghidra/Features/Decompiler/src/decompile/cpp/varnode.cc
  M	Ghidra/Features/Decompiler/src/decompile/cpp/varnode.hh

[Commit 5/14]
Hash: 4e6ba952eacbf27143edb324a343172de9bc1533
Date: 2026-04-24 20:54:00 +0000
Message: GP-6757 Additional memory fixes

Files changed:
  M	Ghidra/Features/Decompiler/src/decompile/cpp/architecture.cc
  M	Ghidra/Features/Decompiler/src/decompile/cpp/cpool.cc
  M	Ghidra/Features/Decompiler/src/decompile/cpp/cpool.hh
  M	Ghidra/Features/Decompiler/src/decompile/cpp/database.cc
  M	Ghidra/Features/Decompiler/src/decompile/cpp/ghidra_arch.cc
  M	Ghidra/Features/Decompiler/src/decompile/cpp/ghidra_arch.hh
  M	Ghidra/Features/Decompiler/src/decompile/cpp/ghidra_process.cc
  M	Ghidra/Features/Decompiler/src/decompile/cpp/marshal.cc
  M	Ghidra/Features/Decompiler/src/decompile/cpp/multiprecision.cc
  M	Ghidra/Features/Decompiler/src/decompile/cpp/pcoderaw.cc
  M	Ghidra/Features/Decompiler/src/decompile/cpp/slgh_compile.cc
  M	Ghidra/Features/Decompiler/src/decompile/cpp/slgh_compile.hh
  M	Ghidra/Features/Decompiler/src/decompile/cpp/slghparse.cc
  M	Ghidra/Features/Decompiler/src/decompile/cpp/slghparse.hh
  M	Ghidra/Features/Decompiler/src/decompile/cpp/slghparse.y
  M	Ghidra/Features/Decompiler/src/decompile/cpp/slghpattern.cc
  M	Ghidra/Features/Decompiler/src/decompile/cpp/slghscan.cc
  M	Ghidra/Features/Decompiler/src/decompile/cpp/slghsymbol.cc
  M	Ghidra/Features/Decompiler/src/decompile/cpp/slghsymbol.hh
  M	Ghidra/Features/Decompiler/src/decompile/cpp/translate.cc
  M	Ghidra/Features/Decompiler/src/decompile/cpp/userop.cc
  A	Ghidra/Features/Decompiler/src/decompile/unittests/testmultiprec.cc

[Commit 6/14]
Hash: 10029bf53d01b0d8af61c6e0c270cc0281650b31
Date: 2026-04-28 16:34:16 +0000
Message: GP-6675: Fixed up some instruction definitions

Files changed:
  M	Ghidra/Processors/x86/data/languages/ia.sinc
  M	Ghidra/Processors/x86/data/languages/x86.ldefs

[Commit 7/14]
Hash: cfaee5f04f142e54f5d6d772a1c07019beaab0b0
Date: 2025-09-02 12:06:29 -0700
Message: Sleigh engine memory fixes

Files changed:
  M	Ghidra/Features/Decompiler/src/decompile/cpp/marshal.cc
  M	Ghidra/Features/Decompiler/src/decompile/cpp/marshal.hh
  M	Ghidra/Features/Decompiler/src/decompile/cpp/semantics.hh
  M	Ghidra/Features/Decompiler/src/decompile/cpp/slghpatexpress.cc
  M	Ghidra/Features/Decompiler/src/decompile/cpp/slghsymbol.cc
  M	Ghidra/Features/Decompiler/src/decompile/cpp/slghsymbol.hh

[Commit 8/14]
Hash: dc38904b1627b83b2ed9064ec44ed8c11d956c1f
Date: 2026-04-20 21:52:06 +0000
Message: GP-6757 unique_ptr protections

Files changed:
  M	Ghidra/Features/Decompiler/src/decompile/cpp/architecture.cc
  M	Ghidra/Features/Decompiler/src/decompile/cpp/bfd_arch.cc
  M	Ghidra/Features/Decompiler/src/decompile/cpp/block.cc
  M	Ghidra/Features/Decompiler/src/decompile/cpp/consolemain.cc
  M	Ghidra/Features/Decompiler/src/decompile/cpp/database.cc
  M	Ghidra/Features/Decompiler/src/decompile/cpp/error.hh
  M	Ghidra/Features/Decompiler/src/decompile/cpp/flow.cc
  M	Ghidra/Features/Decompiler/src/decompile/cpp/funcdata.cc
  M	Ghidra/Features/Decompiler/src/decompile/cpp/ifacedecomp.cc
  M	Ghidra/Features/Decompiler/src/decompile/cpp/ifaceterm.cc
  M	Ghidra/Features/Decompiler/src/decompile/cpp/interface.cc
  M	Ghidra/Features/Decompiler/src/decompile/cpp/jumptable.cc
  M	Ghidra/Features/Decompiler/src/decompile/cpp/loadimage.cc
  M	Ghidra/Features/Decompiler/src/decompile/cpp/modelrules.cc
  M	Ghidra/Features/Decompiler/src/decompile/cpp/override.cc
  M	Ghidra/Features/Decompiler/src/decompile/cpp/raw_arch.cc
  M	Ghidra/Features/Decompiler/src/decompile/cpp/semantics.cc
  M	Ghidra/Features/Decompiler/src/decompile/cpp/sleigh.cc
  M	Ghidra/Features/Decompiler/src/decompile/cpp/slghpatexpress.cc
  M	Ghidra/Features/Decompiler/src/decompile/cpp/slghpattern.cc
  M	Ghidra/Features/Decompiler/src/decompile/cpp/slghsymbol.cc
  M	Ghidra/Features/Decompiler/src/decompile/cpp/translate.cc
  M	Ghidra/Features/Decompiler/src/decompile/cpp/userop.cc

[Commit 9/14]
Hash: 67e0516f62f33bfa833bdc883bb8ea63d64c79e9
Date: 2026-05-07 17:16:49 +0000
Message: GP-6655: Create ldefs for 16e mode, so it appears in Dynamic Listing - Disassemble As

Files changed:
  M	Ghidra/Processors/MIPS/certification.manifest
  M	Ghidra/Processors/MIPS/data/languages/mips.ldefs
  A	Ghidra/Processors/MIPS/data/languages/mips32_16e.pspec
  A	Ghidra/Processors/MIPS/data/languages/mips64_16e.pspec

[Commit 10/14]
Hash: 8a09a052583f60432b68bcadcdc5adfb5fbf16e5
Date: 2026-05-07 16:37:12 +0000
Message: GP-6798: Corrected CIP-51 language definition

Files changed:
  M	Ghidra/Processors/8051/certification.manifest
  M	Ghidra/Processors/8051/data/languages/8051.ldefs
  A	Ghidra/Processors/8051/data/languages/cip-51.pspec
  M	Ghidra/Processors/8051/data/languages/keil-cx51.cspec

[Commit 11/14]
Hash: 4fac3553a866ade6c280cd33c9cfc58497a27be6
Date: 2026-05-05 15:37:34 -0400
Message: GP-6776 additional fixes

Files changed:
  M	Ghidra/Processors/TI_MSP430/data/languages/TI_MSP430.cspec

[Commit 12/14]
Hash: 9e547d2b51a04dad3a4f102d416ceab1fb79e3f9
Date: 2026-04-28 22:47:16 +0000
Message: GP-5525 More targeted data-type warnings

Files changed:
  M	Ghidra/Features/Decompiler/src/decompile/cpp/funcdata.cc
  M	Ghidra/Features/Decompiler/src/decompile/cpp/funcdata.hh
  M	Ghidra/Features/Decompiler/src/decompile/cpp/funcdata_varnode.cc
  M	Ghidra/Features/Decompiler/src/decompile/cpp/type.cc
  M	Ghidra/Features/Decompiler/src/decompile/cpp/type.hh

[Commit 13/14]
Hash: 329d7bae86061e106c64044dce3637fd6ba0646f
Date: 2026-04-06 17:17:48 -0700
Message: address PR feedback
Details:
Fixes issues raised by @GhidorahRex. Adds new bug fx for MASKMOVQ.

Files changed:
  M	Ghidra/Processors/x86/data/languages/ia.sinc

[Commit 14/14]
Hash: b16f1556d26163d6fdc28bfe9dbac3c010b68ba9
Date: 2026-04-01 10:47:29 -0700
Message: fix various bugs in the x86 processor spec
Details:
Specifically:

 * ARPL uses CF instead of ZF for conditional RPL adjustment
 * DAA/DAS incorrect CF computation and missing result flags
 * SHR by-1 OF flag unconditionally set to 0
 * RDTSCP incorrectly restricted to 64-bit mode only
 * SYSEXIT uses wrong register mapping
 * FCMOVNBE condition logic error
 * FYL2X/FYL2XP1 missing log2 computation
 * CVTPD2DQ uses trunc() instead of round()
 * SUBB MMX missing byte lane [8,8]
 * PSLLD/PSLLQ XMM use per-element shift count
 * PCMPxSTRx missing implicit EAX/EDX inputs and EFLAGS outputs
 * CET WRSSQ/WRUSSQ duplicate 0x0F byte in encoding
 * FMA VEX_W0 missing on PS YMM 231-form constructors
 * VTESTPS YMM sign bit offset errors
 * AVX-512 VANDPS YMM dead variable
 * AVX-512 VMOVHLPS copies src2 to both halves
 * AVX-512 VMOVHPD load form dead variable
 * VPSUBSW ZMM form multiple errors
 * CVTPD2PI uses trunc() instead of round()
 * PSRAD XMM uses full 128-bit shift count
 * VMULPS YMM missing 8th element
 * FPREM/FPREM1 broken remainder computation
 * FDECSTP clears wrong condition code bit
 * VMCLEAR incorrectly restricted to 64-bit mode
 * SYSCALL does not model RCX and R11 clobber
 * VRANGESS missing imm8 operand
 * VFPCLASSSD/VFPCLASSSS missing imm8 operand
 * AVX-512 VUCOMISD/VUCOMISS missing EFLAGS computation
 * MASKMOVDQU incorrectly assigns to XmmReg1
 * DAS has same CF computation and missing flags issues as DAA
 * XGETBV/XSETBV ignore ECX selector

Files changed:
  M	Ghidra/Processors/x86/data/languages/avx.sinc
  M	Ghidra/Processors/x86/data/languages/avx512.sinc
  M	Ghidra/Processors/x86/data/languages/cet.sinc
  M	Ghidra/Processors/x86/data/languages/fma.sinc
  M	Ghidra/Processors/x86/data/languages/ia.sinc
```

* Add new unittest file

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Eric Kilmer <eric.kilmer@trailofbits.com>
2026-05-25 17:14:03 -04:00
Eric Kilmer d6d9b4c483 Add skill support for other coding agents and add new release skill 2026-05-15 16:39:48 -04:00
Eric Kilmer 7b4f1bce5e Update stable Ghidra to 12.1 (#420)
Regenerate stable patches against Ghidra_12.1_build and update
the stable source and spec lists for new 12.1 files.
2026-05-15 16:26:28 -04:00
auto-updater[bot] fa806a45c7 Update Ghidra HEAD to commit 3d92a003f (#419)
Bump Ghidra HEAD commit 3d92a003f

Changed files:

```
M	Ghidra/Processors/MIPS/data/languages/mips16.sinc
```

Commit details:

```
[Commit 1/1]
Hash: d29a605572866c2e564a537295e836c310af17f2
Date: 2026-04-29 20:15:19 +0000
Message: GP-6766: Corrected operand ordering for MIPS16e movz and movn

Files changed:
  M	Ghidra/Processors/MIPS/data/languages/mips16.sinc
```

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2026-05-11 10:17:08 -04:00
auto-updater[bot] c1aec71e40 Update Ghidra HEAD to commit b3eef5912 (#418)
Changed files:

```
M	Ghidra/Features/Decompiler/src/decompile/cpp/condexe.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/constseq.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/constseq.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/coreaction.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/coreaction.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/database.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/database.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/float.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/float.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/flow.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/flow.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/funcdata.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/funcdata.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/funcdata_block.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/funcdata_varnode.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/jumptable.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/jumptable.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/merge.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/ruleaction.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/subflow.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/subflow.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/translate.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/translate.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/type.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/type.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/unionresolve.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/unionresolve.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/variable.cc
M	Ghidra/Processors/8051/certification.manifest
M	Ghidra/Processors/8051/data/languages/8051_main.sinc
A	Ghidra/Processors/8051/data/languages/cip-51.slaspec
A	Ghidra/Processors/8051/data/languages/keil-cx51.cspec
M	Ghidra/Processors/ARM/data/languages/ARM.sinc
M	Ghidra/Processors/ARM/data/languages/ARMTHUMBinstructions.sinc
M	Ghidra/Processors/ARM/data/languages/ARMneon.sinc
M	Ghidra/Processors/PIC/data/languages/pic18_instructions.sinc
M	Ghidra/Processors/PowerPC/data/languages/ppc_common.sinc
M	Ghidra/Processors/PowerPC/data/languages/ppc_isa.sinc
```

Commit details:

```
[Commit 1/15]
Hash: 9e18f9439e54f13d31c9fb2b7de373415849150b
Date: 2026-04-29 12:40:29 +0000
Message: GP-0: Fixed missing define statement

Files changed:
  M	Ghidra/Processors/8051/data/languages/8051_main.sinc

[Commit 2/15]
Hash: e12d821d861ec31266367d37ee7ed0aabaaf02ec
Date: 2026-02-26 19:53:42 +0000
Message: GP-6492 Adjustments to union scoring

Files changed:
  M	Ghidra/Features/Decompiler/src/decompile/cpp/constseq.cc
  M	Ghidra/Features/Decompiler/src/decompile/cpp/constseq.hh
  M	Ghidra/Features/Decompiler/src/decompile/cpp/coreaction.cc
  M	Ghidra/Features/Decompiler/src/decompile/cpp/coreaction.hh
  M	Ghidra/Features/Decompiler/src/decompile/cpp/database.cc
  M	Ghidra/Features/Decompiler/src/decompile/cpp/database.hh
  M	Ghidra/Features/Decompiler/src/decompile/cpp/float.cc
  M	Ghidra/Features/Decompiler/src/decompile/cpp/float.hh
  M	Ghidra/Features/Decompiler/src/decompile/cpp/funcdata.cc
  M	Ghidra/Features/Decompiler/src/decompile/cpp/funcdata.hh
  M	Ghidra/Features/Decompiler/src/decompile/cpp/funcdata_varnode.cc
  M	Ghidra/Features/Decompiler/src/decompile/cpp/merge.cc
  M	Ghidra/Features/Decompiler/src/decompile/cpp/ruleaction.cc
  M	Ghidra/Features/Decompiler/src/decompile/cpp/subflow.cc
  M	Ghidra/Features/Decompiler/src/decompile/cpp/subflow.hh
  M	Ghidra/Features/Decompiler/src/decompile/cpp/type.cc
  M	Ghidra/Features/Decompiler/src/decompile/cpp/type.hh
  M	Ghidra/Features/Decompiler/src/decompile/cpp/unionresolve.cc
  M	Ghidra/Features/Decompiler/src/decompile/cpp/unionresolve.hh
  M	Ghidra/Features/Decompiler/src/decompile/cpp/variable.cc

[Commit 3/15]
Hash: d2279118771dd1b503a5efaaaffe772405136290
Date: 2026-04-27 14:04:48 -0400
Message: GP-6333: Fix for ARM Thumb to prevent misaligned branches

Files changed:
  M	Ghidra/Processors/ARM/data/languages/ARM.sinc
  M	Ghidra/Processors/ARM/data/languages/ARMTHUMBinstructions.sinc

[Commit 4/15]
Hash: 741b69d9090262eb0031d92c79cd19bd6b618b93
Date: 2026-03-05 18:55:32 +0000
Message: GP-6538 Don't assume slot == 1 in for RETURN

Files changed:
  M	Ghidra/Features/Decompiler/src/decompile/cpp/condexe.cc

[Commit 5/15]
Hash: 4bec0d1809f80c2231d51def60ee334bdec91dba
Date: 2026-04-24 15:49:42 +0000
Message: GP-6610 Add count of jumptable recover stages

Files changed:
  M	Ghidra/Features/Decompiler/src/decompile/cpp/flow.cc
  M	Ghidra/Features/Decompiler/src/decompile/cpp/flow.hh
  M	Ghidra/Features/Decompiler/src/decompile/cpp/funcdata_block.cc
  M	Ghidra/Features/Decompiler/src/decompile/cpp/jumptable.cc
  M	Ghidra/Features/Decompiler/src/decompile/cpp/jumptable.hh

[Commit 6/15]
Hash: 2b4efbfd681a79a4cd1cd8a962c78beba9b9e2ea
Date: 2026-04-22 18:12:49 +0000
Message: GP-6750: Fixed disassembly error for ARM neon simdExpImm_16

Files changed:
  M	Ghidra/Processors/ARM/data/languages/ARMneon.sinc

[Commit 7/15]
Hash: def6a8d4f962028826446503dd37d333c284cba8
Date: 2026-03-23 16:01:25 +0000
Message: GP-6000: Updated certification for Processor 8051

Files changed:
  M	Ghidra/Processors/8051/certification.manifest

[Commit 8/15]
Hash: 3f5b0be75d7ef8e1956e371f47f0e623dd6e56a0
Date: 2026-01-06 17:39:36 -0500
Message: Add 8051 CIP-51 (Silicon Labs) processor support and Keil C51 compiler specification
Details:
- Add CIP51 variant support to 8051_main.sinc with extended SFR addressing (2-byte)
- Add IFLASH and XRAM address spaces for CIP-51 memory model
- Add cip-51.slaspec for CIP-51 processor definition
- Add keil-cx51.cspec for Keil C51 compiler calling conventions

Files changed:
  M	Ghidra/Processors/8051/data/languages/8051_main.sinc
  A	Ghidra/Processors/8051/data/languages/cip-51.slaspec
  A	Ghidra/Processors/8051/data/languages/keil-cx51.cspec

[Commit 9/15]
Hash: aeba87cceeecbb09257a20da606f92f3b5dbd844
Date: 2026-03-19 16:07:09 +0000
Message: GP-6591: PIC-18 destReg banked register disassembly fix

Files changed:
  M	Ghidra/Processors/PIC/data/languages/pic18_instructions.sinc

[Commit 10/15]
Hash: ac09f8638339d431f339c5a024b779c15e463a94
Date: 2026-03-04 12:05:06 +0000
Message: GP-5508: Remove unused token pieces

Files changed:
  M	Ghidra/Processors/PowerPC/data/languages/ppc_isa.sinc

[Commit 11/15]
Hash: ab08578711be63ccac23a2824caa3b9987544322
Date: 2024-11-24 14:55:06 +0100
Message: Fix PPC STQ negative offsets

Files changed:
  M	Ghidra/Processors/PowerPC/data/languages/ppc_isa.sinc

[Commit 12/15]
Hash: 65a848c4d1956c64a0910b4a85bfcd16c8c9b3ed
Date: 2024-11-24 14:44:21 +0100
Message: Reusing dqPlusRaOrZeroAddress for EA calculation

Files changed:
  M	Ghidra/Processors/PowerPC/data/languages/ppc_isa.sinc

[Commit 13/15]
Hash: 86c31bb5d8e0552ab19948515ba0acdd230fbbbe
Date: 2024-11-24 14:27:16 +0100
Message: Removed PPCAS-specific decoding

Files changed:
  M	Ghidra/Processors/PowerPC/data/languages/ppc_isa.sinc

[Commit 14/15]
Hash: 2037480b4e2da8812b7734f0c9111f38b6c9b8a8
Date: 2024-08-19 10:22:07 +0100
Message: Fix LQ instruction to support signed offsets
Details:
Based on the Power ISA manual sign extended DQ<<4 is added to RA to
get source EA.

Files changed:
  M	Ghidra/Processors/PowerPC/data/languages/ppc_common.sinc
  M	Ghidra/Processors/PowerPC/data/languages/ppc_isa.sinc

[Commit 15/15]
Hash: a1e0d3cd81a75e3648381cd7c1d816dabf4e5c57
Date: 2025-09-08 17:58:32 +0000
Message: GP-3330 Add support stack storage in joined varnodes

Files changed:
  M	Ghidra/Features/Decompiler/src/decompile/cpp/coreaction.cc
  M	Ghidra/Features/Decompiler/src/decompile/cpp/translate.cc
  M	Ghidra/Features/Decompiler/src/decompile/cpp/translate.hh
```

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2026-05-04 09:21:43 -04:00
Duncan Ogilvie d860b53fa9 Set core.longpaths while patching (#417)
The Ghidra source code has very long paths and without this setting you get error messages and the patching fails if you do not clone it very high up the tree.
2026-05-02 14:43:15 -04:00
auto-updater[bot] 532aa25e8a Update Ghidra HEAD to commit aa094ab25 (#416)
Bump Ghidra HEAD commit aa094ab25

Changed files:

```
M	Ghidra/Features/Decompiler/src/decompile/cpp/variable.cc
```

Commit details:

```
[Commit 1/1]
Hash: d4cdef264eb7d87a645ceedcb0b1e22a1078999c
Date: 2026-04-22 17:56:33 +0000
Message: GP-6734 Keep HighEdge map symmetric

Files changed:
  M	Ghidra/Features/Decompiler/src/decompile/cpp/variable.cc
```

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2026-04-27 08:57:34 -04:00
auto-updater[bot] 121c65a08b Update Ghidra HEAD to commit b211a07b5 and patch (#415)
* Bump Ghidra HEAD commit b211a07b5

Changed files:

```
M	Ghidra/Features/Decompiler/src/decompile/cpp/slghscan.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/slghscan.l
```

Commit details:

```
[Commit 1/1]
Hash: 827ebe6a0529b6ed8c52b7186be43b55c57da48b
Date: 2026-03-20 21:34:41 +0000
Message: GP-6608 Use std::stoul to unify to do all integer parsing

Files changed:
  M	Ghidra/Features/Decompiler/src/decompile/cpp/slghscan.cc
  M	Ghidra/Features/Decompiler/src/decompile/cpp/slghscan.l
```

* Patch Ghidra HEAD scan_number to use std::stoull for MSVC

Upstream GP-6608 (Ghidra 827ebe6a0) replaced the hand-rolled integer
parser in slghscan.l with std::stoul. std::stoul returns unsigned long,
which is 64 bits on LP64 (Linux/macOS) but 32 bits on MSVC (LLP64), so
any .slaspec integer literal wider than 0xFFFFFFFF throws out_of_range
and sleigh rejects the spec. This broke the Windows HEAD CI job on the
b211a07b5 bump (68000/PowerPC/Loongarch/coldfire/avr32a specs all have
64-bit immediates).

Swap to std::stoull, which returns unsigned long long (64 bits on all
platforms) and matches the uintb target in scan_number.

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Eric Kilmer <eric.kilmer@trailofbits.com>
2026-04-21 17:39:51 -04:00
dependabot[bot] 8852ca2b09 build(deps): bump actions/upload-pages-artifact from 4 to 5 (#414)
Bumps [actions/upload-pages-artifact](https://github.com/actions/upload-pages-artifact) from 4 to 5.
- [Release notes](https://github.com/actions/upload-pages-artifact/releases)
- [Commits](https://github.com/actions/upload-pages-artifact/compare/v4...v5)

---
updated-dependencies:
- dependency-name: actions/upload-pages-artifact
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-04-14 09:16:29 -04:00
dependabot[bot] 8400ecc4ef build(deps): bump softprops/action-gh-release from 2.6.1 to 3.0.0 (#413)
Bumps [softprops/action-gh-release](https://github.com/softprops/action-gh-release) from 2.6.1 to 3.0.0.
- [Release notes](https://github.com/softprops/action-gh-release/releases)
- [Changelog](https://github.com/softprops/action-gh-release/blob/master/CHANGELOG.md)
- [Commits](https://github.com/softprops/action-gh-release/compare/v2.6.1...v3.0.0)

---
updated-dependencies:
- dependency-name: softprops/action-gh-release
  dependency-version: 3.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-04-13 09:12:43 -04:00
auto-updater[bot] 0bf9bc4334 Update Ghidra HEAD to commit 43f4fcf95 (#412)
Bump Ghidra HEAD commit 43f4fcf95

Changed files:

```
M	Ghidra/Processors/68000/data/languages/68000.pspec
M	Ghidra/Processors/ARM/data/languages/ARM.cspec
M	Ghidra/Processors/ARM/data/languages/ARM.sinc
M	Ghidra/Processors/ARM/data/languages/ARM8m_be.slaspec
M	Ghidra/Processors/ARM/data/languages/ARM8m_le.slaspec
M	Ghidra/Processors/ARM/data/languages/ARMCortex.pspec
M	Ghidra/Processors/ARM/data/languages/ARMTHUMBinstructions.sinc
M	Ghidra/Processors/ARM/data/languages/ARM_apcs.cspec
M	Ghidra/Processors/ARM/data/languages/ARM_v45.cspec
M	Ghidra/Processors/ARM/data/languages/ARM_v45.pspec
M	Ghidra/Processors/ARM/data/languages/ARM_win.cspec
M	Ghidra/Processors/ARM/data/languages/ARMinstructions.sinc
M	Ghidra/Processors/ARM/data/languages/ARMneon.sinc
M	Ghidra/Processors/ARM/data/languages/ARMt.pspec
M	Ghidra/Processors/ARM/data/languages/ARMtTHUMB.pspec
M	Ghidra/Processors/ARM/data/languages/ARMt_v45.pspec
M	Ghidra/Processors/ARM/data/languages/ARMt_v6.pspec
M	Ghidra/Processors/ARM/data/languages/ARMv8.sinc
A	Ghidra/Processors/Hexagon/Module.manifest
A	Ghidra/Processors/Hexagon/certification.manifest
A	Ghidra/Processors/Hexagon/data/languages/Hexagon.opinion
A	Ghidra/Processors/Hexagon/data/languages/hexagon.cspec
A	Ghidra/Processors/Hexagon/data/languages/hexagon.dwarf
A	Ghidra/Processors/Hexagon/data/languages/hexagon.ldefs
A	Ghidra/Processors/Hexagon/data/languages/hexagon.pspec
A	Ghidra/Processors/Hexagon/data/languages/hexagon.sinc
A	Ghidra/Processors/Hexagon/data/languages/hexagon.slaspec
A	Ghidra/Processors/Hexagon/data/languages/hexagon_float.sinc
A	Ghidra/Processors/Hexagon/data/languages/hexagon_hvx.sinc
A	Ghidra/Processors/Hexagon/data/languages/hexagon_left.sinc
A	Ghidra/Processors/Hexagon/data/languages/hexagon_right.sinc
M	Ghidra/Processors/MIPS/data/languages/mips.sinc
M	Ghidra/Processors/MIPS/data/languages/mips16.sinc
M	Ghidra/Processors/MIPS/data/languages/mips32.pspec
M	Ghidra/Processors/MIPS/data/languages/mips32Instructions.sinc
M	Ghidra/Processors/MIPS/data/languages/mips32R6.pspec
M	Ghidra/Processors/MIPS/data/languages/mips32_eabi.cspec
M	Ghidra/Processors/MIPS/data/languages/mips32_fp64.cspec
M	Ghidra/Processors/MIPS/data/languages/mips32be.cspec
M	Ghidra/Processors/MIPS/data/languages/mips32le.cspec
M	Ghidra/Processors/MIPS/data/languages/mips32micro.pspec
M	Ghidra/Processors/MIPS/data/languages/mips64.pspec
M	Ghidra/Processors/MIPS/data/languages/mips64R6.pspec
M	Ghidra/Processors/MIPS/data/languages/mips64_32_n32.cspec
M	Ghidra/Processors/MIPS/data/languages/mips64_32_o32.cspec
M	Ghidra/Processors/MIPS/data/languages/mips64_32_o64.cspec
M	Ghidra/Processors/MIPS/data/languages/mips64be.cspec
M	Ghidra/Processors/MIPS/data/languages/mips64le.cspec
M	Ghidra/Processors/MIPS/data/languages/mips64micro.pspec
M	Ghidra/Processors/MIPS/data/languages/mipsmicro.sinc
M	Ghidra/Processors/PowerPC/data/languages/ppc_32.pspec
M	Ghidra/Processors/PowerPC/data/languages/ppc_32_mpc8270.pspec
M	Ghidra/Processors/PowerPC/data/languages/ppc_64.pspec
M	Ghidra/Processors/Xtensa/data/languages/xtensa.pspec
M	Ghidra/Processors/tricore/data/languages/tc172x.pspec
M	Ghidra/Processors/tricore/data/languages/tc176x.pspec
M	Ghidra/Processors/tricore/data/languages/tc29x.pspec
M	Ghidra/Processors/tricore/data/languages/tricore.pspec
M	Ghidra/Processors/x86/data/languages/x86-16-real.pspec
M	Ghidra/Processors/x86/data/languages/x86-16.pspec
M	Ghidra/Processors/x86/data/languages/x86-64-compat32.pspec
M	Ghidra/Processors/x86/data/languages/x86-64.pspec
M	Ghidra/Processors/x86/data/languages/x86.pspec
```

Commit details:

```
[Commit 1/7]
Hash: 84fb9e72f8065c6d27804209199631e5931cf743
Date: 2026-03-24 17:51:27 +0000
Message: GP-0: Fixed ARM disassembly test regressions

Files changed:
  M	Ghidra/Processors/ARM/data/languages/ARMTHUMBinstructions.sinc
  M	Ghidra/Processors/ARM/data/languages/ARMinstructions.sinc

[Commit 2/7]
Hash: 51471ef7737643fad7fe7eecd7a6e83236b245d0
Date: 2026-03-24 13:20:29 +0000
Message: GP-0: Corrected separator regression in PseudoDisassemblerTest

Files changed:
  M	Ghidra/Processors/ARM/data/languages/ARMTHUMBinstructions.sinc

[Commit 3/7]
Hash: 5636392395b9975c3dde72eb3246ba28a55cbcc0
Date: 2026-03-23 15:30:23 -0400
Message: GP-6621 Add Hexagon processor

Files changed:
  A	Ghidra/Processors/Hexagon/Module.manifest
  A	Ghidra/Processors/Hexagon/certification.manifest
  A	Ghidra/Processors/Hexagon/data/languages/Hexagon.opinion
  A	Ghidra/Processors/Hexagon/data/languages/hexagon.cspec
  A	Ghidra/Processors/Hexagon/data/languages/hexagon.dwarf
  A	Ghidra/Processors/Hexagon/data/languages/hexagon.ldefs
  A	Ghidra/Processors/Hexagon/data/languages/hexagon.pspec
  A	Ghidra/Processors/Hexagon/data/languages/hexagon.sinc
  A	Ghidra/Processors/Hexagon/data/languages/hexagon.slaspec
  A	Ghidra/Processors/Hexagon/data/languages/hexagon_float.sinc
  A	Ghidra/Processors/Hexagon/data/languages/hexagon_hvx.sinc
  A	Ghidra/Processors/Hexagon/data/languages/hexagon_left.sinc
  A	Ghidra/Processors/Hexagon/data/languages/hexagon_right.sinc

[Commit 4/7]
Hash: e0638c831f6ac271d663893c9d26f9f823fc6c2f
Date: 2026-03-20 17:44:03 +0000
Message: GP-0: Corrected ARMAssemblyTest failures

Files changed:
  M	Ghidra/Processors/ARM/data/languages/ARMneon.sinc

[Commit 5/7]
Hash: 5fbbc155a8b08c2711a8b0ef6d59a3c5ef3cf3c9
Date: 2026-03-19 09:23:37 -0400
Message: GP-5849: Fixed ARM Neon instuction collisions with vmov (immediate)

Files changed:
  M	Ghidra/Processors/ARM/data/languages/ARMinstructions.sinc
  M	Ghidra/Processors/ARM/data/languages/ARMneon.sinc

[Commit 6/7]
Hash: 44504c77804cc8aed03f6a21ada6100379cb812a
Date: 2026-03-18 09:59:22 -0400
Message: GP-6145: added missing ARM v8-m instructions

Files changed:
  M	Ghidra/Processors/ARM/data/languages/ARM.sinc
  M	Ghidra/Processors/ARM/data/languages/ARM8m_be.slaspec
  M	Ghidra/Processors/ARM/data/languages/ARM8m_le.slaspec
  M	Ghidra/Processors/ARM/data/languages/ARMTHUMBinstructions.sinc
  M	Ghidra/Processors/ARM/data/languages/ARMinstructions.sinc
  M	Ghidra/Processors/ARM/data/languages/ARMneon.sinc
  M	Ghidra/Processors/ARM/data/languages/ARMv8.sinc

[Commit 7/7]
Hash: fa23479747d6ae439c1bdfce16f248fa99beadaf
Date: 2026-03-18 12:09:45 +0000
Message: GP-4241: Port EmulateInstructionStateModifiers to PcodeUseropLibraryFactories.

Files changed:
  M	Ghidra/Processors/68000/data/languages/68000.pspec
  M	Ghidra/Processors/ARM/data/languages/ARM.cspec
  M	Ghidra/Processors/ARM/data/languages/ARM.sinc
  M	Ghidra/Processors/ARM/data/languages/ARMCortex.pspec
  M	Ghidra/Processors/ARM/data/languages/ARM_apcs.cspec
  M	Ghidra/Processors/ARM/data/languages/ARM_v45.cspec
  M	Ghidra/Processors/ARM/data/languages/ARM_v45.pspec
  M	Ghidra/Processors/ARM/data/languages/ARM_win.cspec
  M	Ghidra/Processors/ARM/data/languages/ARMinstructions.sinc
  M	Ghidra/Processors/ARM/data/languages/ARMt.pspec
  M	Ghidra/Processors/ARM/data/languages/ARMtTHUMB.pspec
  M	Ghidra/Processors/ARM/data/languages/ARMt_v45.pspec
  M	Ghidra/Processors/ARM/data/languages/ARMt_v6.pspec
  M	Ghidra/Processors/MIPS/data/languages/mips.sinc
  M	Ghidra/Processors/MIPS/data/languages/mips16.sinc
  M	Ghidra/Processors/MIPS/data/languages/mips32.pspec
  M	Ghidra/Processors/MIPS/data/languages/mips32Instructions.sinc
  M	Ghidra/Processors/MIPS/data/languages/mips32R6.pspec
  M	Ghidra/Processors/MIPS/data/languages/mips32_eabi.cspec
  M	Ghidra/Processors/MIPS/data/languages/mips32_fp64.cspec
  M	Ghidra/Processors/MIPS/data/languages/mips32be.cspec
  M	Ghidra/Processors/MIPS/data/languages/mips32le.cspec
  M	Ghidra/Processors/MIPS/data/languages/mips32micro.pspec
  M	Ghidra/Processors/MIPS/data/languages/mips64.pspec
  M	Ghidra/Processors/MIPS/data/languages/mips64R6.pspec
  M	Ghidra/Processors/MIPS/data/languages/mips64_32_n32.cspec
  M	Ghidra/Processors/MIPS/data/languages/mips64_32_o32.cspec
  M	Ghidra/Processors/MIPS/data/languages/mips64_32_o64.cspec
  M	Ghidra/Processors/MIPS/data/languages/mips64be.cspec
  M	Ghidra/Processors/MIPS/data/languages/mips64le.cspec
  M	Ghidra/Processors/MIPS/data/languages/mips64micro.pspec
  M	Ghidra/Processors/MIPS/data/languages/mipsmicro.sinc
  M	Ghidra/Processors/PowerPC/data/languages/ppc_32.pspec
  M	Ghidra/Processors/PowerPC/data/languages/ppc_32_mpc8270.pspec
  M	Ghidra/Processors/PowerPC/data/languages/ppc_64.pspec
  M	Ghidra/Processors/Xtensa/data/languages/xtensa.pspec
  M	Ghidra/Processors/tricore/data/languages/tc172x.pspec
  M	Ghidra/Processors/tricore/data/languages/tc176x.pspec
  M	Ghidra/Processors/tricore/data/languages/tc29x.pspec
  M	Ghidra/Processors/tricore/data/languages/tricore.pspec
  M	Ghidra/Processors/x86/data/languages/x86-16-real.pspec
  M	Ghidra/Processors/x86/data/languages/x86-16.pspec
  M	Ghidra/Processors/x86/data/languages/x86-64-compat32.pspec
  M	Ghidra/Processors/x86/data/languages/x86-64.pspec
  M	Ghidra/Processors/x86/data/languages/x86.pspec
```

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2026-03-30 09:52:52 -04:00
dependabot[bot] b9c7dcda40 build(deps): bump actions/deploy-pages from 4 to 5 (#411)
Bumps [actions/deploy-pages](https://github.com/actions/deploy-pages) from 4 to 5.
- [Release notes](https://github.com/actions/deploy-pages/releases)
- [Commits](https://github.com/actions/deploy-pages/compare/v4...v5)

---
updated-dependencies:
- dependency-name: actions/deploy-pages
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-03-30 09:52:32 -04:00
Eric Kilmer 3c525cd665 CI: Create draft release by default (#410)
* CI: Create draft release by default

Handles immutable releases when uploading from multiple builds

* CI: Add publish-release job to undraft release after builds

After all build matrix jobs upload artifacts as draft releases,
this job runs to publish the release by removing the draft flag.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 17:30:14 -04:00
auto-updater[bot] 68e14b713c Update Ghidra HEAD to commit 2ef20c4f4 (#409)
Bump Ghidra HEAD commit 2ef20c4f4

Changed files:

```
M	Ghidra/Processors/MIPS/data/languages/mips.sinc
M	Ghidra/Processors/MIPS/data/languages/mips16.sinc
M	Ghidra/Processors/MIPS/data/languages/mips32Instructions.sinc
```

Commit details:

```
[Commit 1/1]
Hash: 6b73572604f58ce3c050b3e7651e1d7fb887ee5c
Date: 2026-03-10 19:07:32 +0000
Message: Fixed regression with MIPS disassembly

Files changed:
  M	Ghidra/Processors/MIPS/data/languages/mips.sinc
  M	Ghidra/Processors/MIPS/data/languages/mips16.sinc
  M	Ghidra/Processors/MIPS/data/languages/mips32Instructions.sinc
```

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2026-03-23 09:39:07 -04:00
dependabot[bot] 099ccea772 build(deps): bump nick-fields/retry from 3 to 4 (#408)
Bumps [nick-fields/retry](https://github.com/nick-fields/retry) from 3 to 4.
- [Release notes](https://github.com/nick-fields/retry/releases)
- [Commits](https://github.com/nick-fields/retry/compare/v3...v4)

---
updated-dependencies:
- dependency-name: nick-fields/retry
  dependency-version: '4'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-03-20 08:40:39 -04:00
dependabot[bot] 7887f25eee build(deps): bump softprops/action-gh-release from 2.5.0 to 2.6.1 (#406)
Bumps [softprops/action-gh-release](https://github.com/softprops/action-gh-release) from 2.5.0 to 2.6.1.
- [Release notes](https://github.com/softprops/action-gh-release/releases)
- [Changelog](https://github.com/softprops/action-gh-release/blob/master/CHANGELOG.md)
- [Commits](https://github.com/softprops/action-gh-release/compare/v2.5.0...v2.6.1)

---
updated-dependencies:
- dependency-name: softprops/action-gh-release
  dependency-version: 2.6.1
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-03-16 09:43:03 -04:00
dependabot[bot] 7d93971e5d build(deps): bump actions/create-github-app-token from 2 to 3 (#407)
Bumps [actions/create-github-app-token](https://github.com/actions/create-github-app-token) from 2 to 3.
- [Release notes](https://github.com/actions/create-github-app-token/releases)
- [Commits](https://github.com/actions/create-github-app-token/compare/v2...v3)

---
updated-dependencies:
- dependency-name: actions/create-github-app-token
  dependency-version: '3'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-03-16 09:42:21 -04:00
auto-updater[bot] ddb507d83e Update Ghidra HEAD to commit a2d77cbbb (#405)
Bump Ghidra HEAD commit a2d77cbbb

Changed files:

```
M	Ghidra/Features/Decompiler/src/decompile/cpp/Doxyfile
M	Ghidra/Features/Decompiler/src/decompile/cpp/context.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/context.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/error.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/inject_sleigh.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/sleigh.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/sleigh.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/slgh_compile.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/slgh_compile.hh
M	Ghidra/Processors/PowerPC/data/languages/ppc_isa.sinc
```

Commit details:

```
[Commit 1/3]
Hash: e5ee5ed77359266c5c84d54ce8ed4ae20d69b2a8
Date: 2026-03-09 21:34:46 +0000
Message: GP-6545 Switch to using deque for PcodeCacher::issued

Files changed:
  M	Ghidra/Features/Decompiler/src/decompile/cpp/error.hh
  M	Ghidra/Features/Decompiler/src/decompile/cpp/sleigh.cc
  M	Ghidra/Features/Decompiler/src/decompile/cpp/sleigh.hh

[Commit 2/3]
Hash: 5328fa2c6dbfbba7cc95f232f3a9635d9bd8abcb
Date: 2026-03-06 23:37:48 +0000
Message: GP-6554 Refactor ConstructState allocation in ParserContext

Files changed:
  M	Ghidra/Features/Decompiler/src/decompile/cpp/Doxyfile
  M	Ghidra/Features/Decompiler/src/decompile/cpp/context.cc
  M	Ghidra/Features/Decompiler/src/decompile/cpp/context.hh
  M	Ghidra/Features/Decompiler/src/decompile/cpp/inject_sleigh.cc
  M	Ghidra/Features/Decompiler/src/decompile/cpp/sleigh.cc
  M	Ghidra/Features/Decompiler/src/decompile/cpp/sleigh.hh
  M	Ghidra/Features/Decompiler/src/decompile/cpp/slgh_compile.cc
  M	Ghidra/Features/Decompiler/src/decompile/cpp/slgh_compile.hh

[Commit 3/3]
Hash: be9b45ce9e3e7e7b3123a5be18b25a521d745152
Date: 2026-03-08 19:28:21 +0000
Message: PowerPC: s/DataCaseBlockSetToZero/DataCacheBlockSetToZero/
Details:
This is pretty obvious typo, the actual name of the operation is "data
cache block set to zero".

Signed-off-by: Mate Kukri <km@mkukri.xyz>

Files changed:
  M	Ghidra/Processors/PowerPC/data/languages/ppc_isa.sinc
```

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2026-03-16 09:41:38 -04:00
auto-updater[bot] 1360014bf3 Update Ghidra HEAD to commit 8e0fc9bc6 (#404)
Bump Ghidra HEAD commit 8e0fc9bc6

Changed files:

```
M	Ghidra/Features/Decompiler/src/decompile/cpp/ruleaction.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/type.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/type.hh
M	Ghidra/Processors/AARCH64/certification.manifest
M	Ghidra/Processors/MIPS/data/languages/mips.sinc
M	Ghidra/Processors/MIPS/data/languages/mips16.sinc
M	Ghidra/Processors/MIPS/data/languages/mips32Instructions.sinc
M	Ghidra/Processors/MIPS/data/languages/mipsmicro.sinc
M	Ghidra/Processors/Xtensa/data/languages/flix.sinc
M	Ghidra/Processors/Xtensa/data/languages/xtensaArch.sinc
M	Ghidra/Processors/Xtensa/data/languages/xtensaInstructions.sinc
M	Ghidra/Processors/Xtensa/data/languages/xtensaMain.sinc
M	Ghidra/Processors/Xtensa/data/languages/xtensa_depbits.sinc
```

Commit details:

```
[Commit 1/6]
Hash: b90adfdfdd9893802408b943b4266e4990cd63e3
Date: 2026-03-06 04:53:12 -0500
Message: GP-6327: Improving Objective-C msgSend() support

Files changed:
  M	Ghidra/Processors/AARCH64/certification.manifest

[Commit 2/6]
Hash: cbc000b2a017f1f5cf96cf095f9cf0c026082b4c
Date: 2026-02-27 23:01:19 +0000
Message: GP-6501: Fixed up mfc0/mtc0 semantics. Added MIPS32 save/restore instructions

Files changed:
  M	Ghidra/Processors/MIPS/data/languages/mips.sinc
  M	Ghidra/Processors/MIPS/data/languages/mips16.sinc
  M	Ghidra/Processors/MIPS/data/languages/mips32Instructions.sinc
  M	Ghidra/Processors/MIPS/data/languages/mipsmicro.sinc

[Commit 3/6]
Hash: 5f35986024907e891c5e86f566506c81964a1b92
Date: 2026-02-25 19:25:16 +0000
Message: GP-6495 Assign pointer submeta based on needsResolution

Files changed:
  M	Ghidra/Features/Decompiler/src/decompile/cpp/type.cc

[Commit 4/6]
Hash: 2ad8259a29884ded954f23a1a4d92c8124dd1654
Date: 2026-02-25 13:24:42 +0000
Message: GP-6489: Fixed opcode for MIPS sdbbp16 instruction

Files changed:
  M	Ghidra/Processors/MIPS/data/languages/mipsmicro.sinc

[Commit 5/6]
Hash: c81657d2ae45c8c4978114f3d2e6bcd361ce54ef
Date: 2026-02-20 22:55:14 +0000
Message: GP-6486 Correct distance calculation in nearestArrayedComponent methods

Files changed:
  M	Ghidra/Features/Decompiler/src/decompile/cpp/ruleaction.cc
  M	Ghidra/Features/Decompiler/src/decompile/cpp/type.cc
  M	Ghidra/Features/Decompiler/src/decompile/cpp/type.hh

[Commit 6/6]
Hash: 10f2cd12db3f857280e3b01e4a5c65ace3a4d6a0
Date: 2025-10-24 19:58:31 +0000
Message: GP-6050: Renamed most Xtensa token fields to satisfy BE numbering

Files changed:
  M	Ghidra/Processors/Xtensa/data/languages/flix.sinc
  M	Ghidra/Processors/Xtensa/data/languages/xtensaArch.sinc
  M	Ghidra/Processors/Xtensa/data/languages/xtensaInstructions.sinc
  M	Ghidra/Processors/Xtensa/data/languages/xtensaMain.sinc
  M	Ghidra/Processors/Xtensa/data/languages/xtensa_depbits.sinc
```

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2026-03-09 09:29:49 -04:00
Eric Kilmer 4db93c4191 Ghidra 12.0.4 (#403) 2026-03-04 10:51:47 -05:00
Eric Kilmer c0160c4205 ci: Don't archive when using upload-artifact GHA (#402)
Prevents rpm and deb packages from being zipped
2026-03-02 09:21:54 -05:00
dependabot[bot] 1d1d978f0d build(deps): bump actions/upload-artifact from 6 to 7 (#400)
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 6 to 7.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/v6...v7)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-version: '7'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-03-02 09:00:48 -05:00
auto-updater[bot] 7afb02ef95 Update Ghidra HEAD to commit fc73f70b9 (#401)
Bump Ghidra HEAD commit fc73f70b9

Changed files:

```
M	Ghidra/Processors/AARCH64/data/languages/AARCH64base.sinc
M	Ghidra/Processors/AARCH64/data/languages/AARCH64instructions.sinc
```

Commit details:

```
[Commit 1/3]
Hash: ea52a687b2ee0070c868dfc0234001479fce2988
Date: 2026-02-24 10:49:41 -0500
Message: GP-6448: Added AARCH64 CSSC instructions

Files changed:
  M	Ghidra/Processors/AARCH64/data/languages/AARCH64base.sinc
  M	Ghidra/Processors/AARCH64/data/languages/AARCH64instructions.sinc

[Commit 2/3]
Hash: 3fbe33860b6a66815f888415e05539084f596fbd
Date: 2024-04-30 13:33:09 +0930
Message: AA64: fix ldar load size for 32bit variant

Files changed:
  M	Ghidra/Processors/AARCH64/data/languages/AARCH64base.sinc

[Commit 3/3]
Hash: bbe8d7ca93ab42dad6aa0afa1e0fa1b6ab62c608
Date: 2024-04-30 14:30:35 +0930
Message: AA64: fix ldpsw increment size to match load

Files changed:
  M	Ghidra/Processors/AARCH64/data/languages/AARCH64base.sinc
```

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2026-03-02 08:01:02 -05:00
Eric Kilmer 6ecd80ee22 Merge branch 'ekilmer/run-asan-v2': Add ASAN/UBSAN and libc++ assertions CI
Add sanitizer and assertions CI jobs, fix UBSAN signed left shift
errors, and port the compareFinalOrder strict-weak ordering patch
to stable. Drop redundant Linux/macOS Debug builds in favor of
these more targeted checks.

* ekilmer/run-asan-v2:
  Add compareFinalOrder strict-weak ordering patch to stable
  Drop Debug builds on Linux and macOS in favor of sanitizer/assertions
  Install LLVM explicitly in sanitizer and assertions CI jobs
  Add libc++ assertions CI job for strict-weak ordering checks
  Add ASAN/UBSAN CI testing and fix signed left shift UB
2026-02-25 23:05:06 +00:00
Eric Kilmer 0c1eeeae77 Add compareFinalOrder strict-weak ordering patch to stable
Port the existing HEAD patch (0007) to stable as well.
FlowBlock::compareFinalOrder returns true when both blocks have
index 0, violating strict weak ordering irreflexivity. This is
caught by the libc++ assertions CI job.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-25 22:40:23 +00:00
Eric Kilmer f696911f67 Drop Debug builds on Linux and macOS in favor of sanitizer/assertions
The sanitizer and assertions CI jobs provide more useful Debug-like
coverage on Linux than a plain Debug build. Keep Debug builds only for
Windows where sanitizers are not available.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-25 22:04:22 +00:00
Eric Kilmer 27289bcc29 Install LLVM explicitly in sanitizer and assertions CI jobs
Use the official LLVM apt script to install clang rather than relying
on whichever version happens to ship on the runner. The version is
configured via a workflow-level LLVM_VERSION env variable (currently 21)
so bumping is a one-line change.

The assertions job also installs the matching versioned libc++-dev and
libc++abi-dev packages.

Remove CMAKE_CXX_COMPILER from the ci-assertions preset so the CXX
environment variable is respected by CMake in both CI and local use.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-25 22:02:26 +00:00
Eric Kilmer 876fc733fb Add libc++ assertions CI job for strict-weak ordering checks
Add a ci-assertions CMake preset that builds with libc++ in debug
hardening mode (_LIBCPP_HARDENING_MODE_DEBUG), which catches STL
contract violations at runtime — most importantly strict-weak ordering
violations in comparators passed to std::sort.

Add a corresponding assertions CI job that runs HEAD-only, since new
comparator bugs from upstream Ghidra surface there first.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-25 21:16:45 +00:00
Eric Kilmer b6adc0337a Add ASAN/UBSAN CI testing and fix signed left shift UB
Add a sanitizer CI job that builds and tests with AddressSanitizer and
UndefinedBehaviorSanitizer using clang on Ubuntu for both stable and
HEAD release tracks.

Fix three UBSAN signed left shift errors found during sanitizer testing
by casting signed values to unsigned before left shifting:
- address.hh sign_extend(): left shift of negative value / overflow
- slghpatexpress.cc LeftShiftExpression: left shift of negative value

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-25 21:16:13 +00:00
Eric Kilmer 4578ac2fba Add claude skill to help debug test failures
This will likely improve over time as more tests fail or different
methods for exposing bugs are used (like sanitizers)
2026-02-25 16:34:05 +00:00
Eric Kilmer 1b2041b6aa Add CLAUDE.md 2026-02-25 16:34:05 +00:00
Eric Kilmer eb980ff91d Add devcontainer for debugging with latest build tools
Provides a sandboxed Ubuntu 24.04 environment with LLVM 21
(clang, clangd, lld, lldb, libc++), cmake, ninja, and ccache
for building and debugging the decompiler with up-to-date tooling.

While there are only minimal VSCode extensions installed by default, I
automatically install Claude Code and my own dotfiles plus additional tools
2026-02-25 16:31:37 +00:00
auto-updater[bot] fbefd7d828 Update Ghidra HEAD to commit e3c1b6393 (#397)
* Bump Ghidra HEAD commit e3c1b6393

Changed files:

```
M	Ghidra/Features/Decompiler/src/decompile/cpp/Makefile
M	Ghidra/Features/Decompiler/src/decompile/cpp/address.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/address.hh
A	Ghidra/Features/Decompiler/src/decompile/cpp/bitfield.cc
A	Ghidra/Features/Decompiler/src/decompile/cpp/bitfield.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/block.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/constseq.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/coreaction.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/dynamic.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/expression.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/expression.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/flow.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/funcdata.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/funcdata.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/funcdata_block.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/funcdata_varnode.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/grammar.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/grammar.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/grammar.y
M	Ghidra/Features/Decompiler/src/decompile/cpp/jumptable.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/jumptable.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/marshal.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/op.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/opbehavior.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/opcodes.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/prettyprint.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/prettyprint.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/printc.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/printc.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/printjava.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/printlanguage.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/printlanguage.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/ruleaction.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/subflow.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/type.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/type.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/typeop.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/typeop.hh
```

Commit details:

```
[Commit 1/2]
Hash: bf1f4288aa3b317e3c097773ba4b8e7b89ae09c7
Date: 2026-02-10 19:33:46 +0000
Message: GP-5922 Integer formatting for switch cases

Files changed:
  M	Ghidra/Features/Decompiler/src/decompile/cpp/block.hh
  M	Ghidra/Features/Decompiler/src/decompile/cpp/flow.cc
  M	Ghidra/Features/Decompiler/src/decompile/cpp/funcdata.cc
  M	Ghidra/Features/Decompiler/src/decompile/cpp/funcdata_block.cc
  M	Ghidra/Features/Decompiler/src/decompile/cpp/jumptable.cc
  M	Ghidra/Features/Decompiler/src/decompile/cpp/jumptable.hh
  M	Ghidra/Features/Decompiler/src/decompile/cpp/printc.cc
  M	Ghidra/Features/Decompiler/src/decompile/cpp/printc.hh
  M	Ghidra/Features/Decompiler/src/decompile/cpp/printjava.cc
  M	Ghidra/Features/Decompiler/src/decompile/cpp/printlanguage.cc
  M	Ghidra/Features/Decompiler/src/decompile/cpp/printlanguage.hh

[Commit 2/2]
Hash: 402d10d6cc66e1fcf3d8f36bc851ef652773e018
Date: 2025-09-05 00:01:44 +0000
Message: GP-2493 Bitfield support in the Decompiler

Files changed:
  M	Ghidra/Features/Decompiler/src/decompile/cpp/Makefile
  M	Ghidra/Features/Decompiler/src/decompile/cpp/address.cc
  M	Ghidra/Features/Decompiler/src/decompile/cpp/address.hh
  A	Ghidra/Features/Decompiler/src/decompile/cpp/bitfield.cc
  A	Ghidra/Features/Decompiler/src/decompile/cpp/bitfield.hh
  M	Ghidra/Features/Decompiler/src/decompile/cpp/constseq.cc
  M	Ghidra/Features/Decompiler/src/decompile/cpp/coreaction.cc
  M	Ghidra/Features/Decompiler/src/decompile/cpp/dynamic.cc
  M	Ghidra/Features/Decompiler/src/decompile/cpp/expression.cc
  M	Ghidra/Features/Decompiler/src/decompile/cpp/expression.hh
  M	Ghidra/Features/Decompiler/src/decompile/cpp/funcdata.hh
  M	Ghidra/Features/Decompiler/src/decompile/cpp/funcdata_varnode.cc
  M	Ghidra/Features/Decompiler/src/decompile/cpp/grammar.cc
  M	Ghidra/Features/Decompiler/src/decompile/cpp/grammar.hh
  M	Ghidra/Features/Decompiler/src/decompile/cpp/grammar.y
  M	Ghidra/Features/Decompiler/src/decompile/cpp/marshal.cc
  M	Ghidra/Features/Decompiler/src/decompile/cpp/op.cc
  M	Ghidra/Features/Decompiler/src/decompile/cpp/opbehavior.cc
  M	Ghidra/Features/Decompiler/src/decompile/cpp/opcodes.hh
  M	Ghidra/Features/Decompiler/src/decompile/cpp/prettyprint.cc
  M	Ghidra/Features/Decompiler/src/decompile/cpp/prettyprint.hh
  M	Ghidra/Features/Decompiler/src/decompile/cpp/printc.cc
  M	Ghidra/Features/Decompiler/src/decompile/cpp/printc.hh
  M	Ghidra/Features/Decompiler/src/decompile/cpp/printlanguage.cc
  M	Ghidra/Features/Decompiler/src/decompile/cpp/printlanguage.hh
  M	Ghidra/Features/Decompiler/src/decompile/cpp/ruleaction.cc
  M	Ghidra/Features/Decompiler/src/decompile/cpp/subflow.cc
  M	Ghidra/Features/Decompiler/src/decompile/cpp/type.cc
  M	Ghidra/Features/Decompiler/src/decompile/cpp/type.hh
  M	Ghidra/Features/Decompiler/src/decompile/cpp/typeop.cc
  M	Ghidra/Features/Decompiler/src/decompile/cpp/typeop.hh
```

* Add new C++ files to CMake

* Fix more strict weak ordering issues

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Eric Kilmer <eric.kilmer@trailofbits.com>
2026-02-24 22:11:46 -05:00
auto-updater[bot] 9daaa780c2 Update Ghidra HEAD to commit 0ee235fba (#396)
Changed files:

```
M	Ghidra/Features/Decompiler/src/decompile/cpp/address.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/constseq.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/constseq.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/funcdata_op.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/ruleaction.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/typeop.cc
M	Ghidra/Processors/8051/data/languages/80251.sinc
M	Ghidra/Processors/AARCH64/data/languages/AARCH64.pspec
M	Ghidra/Processors/AARCH64/data/languages/AARCH64neon.sinc
M	Ghidra/Processors/ARM/data/languages/ARMinstructions.sinc
M	Ghidra/Processors/CR16/data/languages/CR16C.sinc
M	Ghidra/Processors/MIPS/data/languages/mips16.sinc
M	Ghidra/Processors/PIC/data/languages/pic18_instructions.sinc
M	Ghidra/Processors/PowerPC/data/languages/altivec.sinc
M	Ghidra/Processors/PowerPC/data/languages/ppc_vle.sinc
M	Ghidra/Processors/eBPF/data/languages/eBPF.sinc
```

Commit details:

```
[Commit 1/19]
Hash: 1660b9ca4718c9907d279653a99c6d4190a1071f
Date: 2026-02-09 15:33:05 +0000
Message: GP-6419: Fixed MIPS16 pcodetest failures

Files changed:
  M	Ghidra/Processors/MIPS/data/languages/mips16.sinc

[Commit 2/19]
Hash: a05ba1f778511e92abc29c933cb17da9477cc7c5
Date: 2026-02-05 23:13:56 +0000
Message: GP-6416 Add support for simplifying unequal LEFT then RIGHT shifts

Files changed:
  M	Ghidra/Features/Decompiler/src/decompile/cpp/ruleaction.cc

[Commit 3/19]
Hash: 690a23344f9de200056b8e7af4384e26f42e300b
Date: 2026-02-05 19:28:59 +0000
Message: GP-6393 Deduplicate INDIRECT storage for HeapSequence

Files changed:
  M	Ghidra/Features/Decompiler/src/decompile/cpp/constseq.cc
  M	Ghidra/Features/Decompiler/src/decompile/cpp/constseq.hh

[Commit 4/19]
Hash: 6ced49d1d7fd91663e7627b11fc4e68dd06bca1c
Date: 2026-02-03 16:08:01 +0000
Message: GP-4241: Discoverable per-arch userop-lib framework and AARCH64 port.

Files changed:
  M	Ghidra/Processors/AARCH64/data/languages/AARCH64.pspec

[Commit 5/19]
Hash: 9a9b6cd063bc830c749804be0ab4213ec8de0010
Date: 2026-01-29 20:26:27 +0000
Message: GP-6388 Adjust getInputCast for TypeOpPtradd and TypeOpPtrsub

Files changed:
  M	Ghidra/Features/Decompiler/src/decompile/cpp/typeop.cc

[Commit 6/19]
Hash: c9be1860c181581ee192cb86e97eeec983a6bf00
Date: 2024-05-28 17:09:24 +0930
Message: AArch32: fixed ldrexd
Details:
* fixed addr src register aliased as first dest register of a double word load causing second word load at the value of first load

Files changed:
  M	Ghidra/Processors/ARM/data/languages/ARMinstructions.sinc

[Commit 7/19]
Hash: c0bc9a882b7e6c6d3c0549c4410a8ae1abb68f00
Date: 2024-02-08 10:19:47 +0100
Message: PowerPC VLE: Fix se_blrl flow
Details:
Opcode se_blrl is branch link register and link. Treating it as a return break flow and is wrong. Non VLE is already correct.

Files changed:
  M	Ghidra/Processors/PowerPC/data/languages/ppc_vle.sinc

[Commit 8/19]
Hash: e94681701a89f34cf35edc18085684a8e40fc6b7
Date: 2025-12-02 02:03:52 +0100
Message: CR16: fix CR16C TBIT instruction

Files changed:
  M	Ghidra/Processors/CR16/data/languages/CR16C.sinc

[Commit 9/19]
Hash: af8a3704212b157d21bfddad834f6485fdfabeb1
Date: 2025-12-02 22:00:49 +0100
Message: Fix eBPF compare-and-exchange instruction
Details:
Linux kernel's documentation tells in
https://www.kernel.org/doc/html/v6.0/bpf/instruction-set.html#atomic-operations

> The BPF_CMPXCHG operation atomically compares the value addressed by
> dst_reg + off with R0. If they match, the value addressed by
> dst_reg + off is replaced with src_reg. In either case, the value that
> was at dst_reg + off before the operation is zero-extended and loaded
> back to R0.

If the values don't match, *(dst_reg + off) is not supposed to be
modified.

Moreover, register R0 is always modified and the 32-bit instruction
truncates its value (with a zero-extension). This is also clear in the
implementation of BPF_CMPXCHG in
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/kernel/bpf/core.c?h=v6.18#n2186

    case BPF_CMPXCHG:
            if (BPF_SIZE(insn->code) == BPF_W)
                    BPF_R0 = (u32) atomic_cmpxchg(
                            (atomic_t *)(unsigned long) (DST + insn->off),
                            (u32) BPF_R0, (u32) SRC);
            else if (BPF_SIZE(insn->code) == BPF_DW)
                    BPF_R0 = (u64) atomic64_cmpxchg(
                            (atomic64_t *)(unsigned long) (DST + insn->off),
                            (u64) BPF_R0, (u64) SRC);

Fix the semantic of the compare-and-exchange instruction accordingly.

Files changed:
  M	Ghidra/Processors/eBPF/data/languages/eBPF.sinc

[Commit 10/19]
Hash: ff6eb2213bca878cdcef0e9cec20e524d8d9f944
Date: 2025-12-02 16:19:37 +0100
Message: Fix disassembly of eBPF atomic instructions
Details:
eBPF ISA v3 introduced atomic instructions:
https://www.kernel.org/doc/html/v6.0/bpf/instruction-set.html#atomic-operations

These instructions are encoded using BPF_ATOMIC | BPF_W  | BPF_STX
and BPF_ATOMIC | BPF_DW | BPF_STX for 32-bit and 64-bit operations,
with:

    BPF_ATOMIC = 0xc0
    BPF_DW = 0x18
    BPF_W = 0
    BPF_STX = 0x03

While Ghidra's semantic section is constructed correctly (atomic add
uses an addition ; atomic or uses or ; ...), the disassembly always
displays STXXADDW and STXXADDDW. These mnemonics come from the
deprecated name BPF_XADD = BPF_ATOMIC | BPF_ADD = 0xc0.

Replace the confusing mnemonics with the ones used by binutils and
documented in
https://sourceware.org/git/?p=binutils-gdb.git;a=blob;f=gas/doc/c-bpf.texi;h=003cb92a457985038a9abc1ffbf347f636eb0586;hb=2bc7af1ff7732451b6a7b09462a815c3284f9613#l745

Files changed:
  M	Ghidra/Processors/eBPF/data/languages/eBPF.sinc

[Commit 11/19]
Hash: c1f97cde08ab235c0fe9adb723971a608550fdc2
Date: 2025-12-22 19:47:24 +0100
Message: Fix missing Altivec vadduws instruction

Files changed:
  M	Ghidra/Processors/PowerPC/data/languages/altivec.sinc

[Commit 12/19]
Hash: c981c0b5dd19818117178f3ce4a9d8737c306e65
Date: 2025-12-16 20:07:56 +0000
Message: GP-6004: Refactored out duplicated constructors

Files changed:
  M	Ghidra/Processors/PIC/data/languages/pic18_instructions.sinc

[Commit 13/19]
Hash: 78859d55fdf28dfbe9dac0658948754515d44e36
Date: 2025-12-04 19:25:56 +0000
Message: GP-5905: Fixed issue with 80251 instructions referencing SPX register

Files changed:
  M	Ghidra/Processors/8051/data/languages/80251.sinc

[Commit 14/19]
Hash: 826834c424b631358f06899dfd0203138ba2cb7d
Date: 2025-11-25 13:32:37 +0100
Message: decompiler: Fix extreme value checks in Funcdata::replaceLessequal
Details:
Fixes https://github.com/NationalSecurityAgency/ghidra/issues/8696

The checks for extreme values when transforming <= to < were incomplete
and relied on undefined behavior, making compilers optimize them out.

Specifically, for SLESS_EQUAL, the decompiler relied on integer overflows.
For integers smaller than 8 bytes, no overflow will occur when adding 1,
resulting in a missed case and, thus, x <= INT_MAX will become x < INT_MIN.
For the signed case when subtracting one, the compiler removes the check
due to undefined behavior, resulting in another missed case.

To fix this, add helper functions for computing maximum and minimum values
for signed and unsigned varnodes and directly check for them.

Files changed:
  M	Ghidra/Features/Decompiler/src/decompile/cpp/address.hh
  M	Ghidra/Features/Decompiler/src/decompile/cpp/funcdata_op.cc

[Commit 15/19]
Hash: 2e3bedf7daf1c5c38cbf1c3f90b6f4cd449f7020
Date: 2025-11-04 13:50:15 +0000
Message: GP-6004: Corrected bit-pattern comments

Files changed:
  M	Ghidra/Processors/PIC/data/languages/pic18_instructions.sinc

[Commit 16/19]
Hash: 49c13a7ba733f2af63f3d33d83cba8103456249e
Date: 2025-09-17 10:43:57 +0200
Message: missed one

Files changed:
  M	Ghidra/Processors/PIC/data/languages/pic18_instructions.sinc

[Commit 17/19]
Hash: 48ca4badb7ea2eb18ffd6f9b6ede356932160067
Date: 2025-09-13 16:17:07 -0700
Message: forgot to take out this change

Files changed:
  M	Ghidra/Processors/PIC/data/languages/pic18_instructions.sinc

[Commit 18/19]
Hash: 7fa6bda98ee9a350be49c0b4a8f9cf8c83b39490
Date: 2025-09-10 00:58:15 -0700
Message: remove destREG to fix double inc/dec

Files changed:
  M	Ghidra/Processors/PIC/data/languages/pic18_instructions.sinc

[Commit 19/19]
Hash: 5e4522fc3a2a547c9b1c94ab293890bb9f767ac3
Date: 2024-04-09 16:43:13 +0930
Message: AA64: Change sha1h shift to rotate

Files changed:
  M	Ghidra/Processors/AARCH64/data/languages/AARCH64neon.sinc
```

---------

Co-authored-by: Eric Kilmer <eric.d.kilmer@gmail.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2026-02-17 09:59:06 -05:00
Eric Kilmer 0eb9da05b7 ci: Fix GHA PR update script message character escaping 2026-02-17 09:36:10 -05:00
Eric Kilmer 76278daf20 ci: Fix app-id and private-key options to create-github-app-token 2026-02-17 09:13:42 -05:00
Eric Kilmer db0dc4c479 Ghidra 12.0.3 (#395) 2026-02-11 09:24:27 -05:00
Eric Kilmer efe3b7dcbd Ghidra 12.0.2 (#394) 2026-01-31 17:21:45 -05:00
Eric Kilmer d4b0316955 Use official actions/create-github-app-token (#393) 2026-01-26 17:03:10 -05:00
Eric Kilmer 86f39ba60f Detect new files requiring manual intervention in Ghidra HEAD updates (#390)
Add functionality to the weekly sync workflow to detect newly added or
deleted C++ source files and spec files that may require manual CMake
configuration updates. When such files are detected, the PR body will
include a warning section listing the files and instructions for
maintainers.

This addresses issue #121 where new files added to Sleigh in Ghidra
weren't being noticed, leading to missing headers that required manual
fixes later.

Changes:
- Add CategorizedChanges dataclass to track added/deleted cpp/spec files
- Add helper methods to parse git status and categorize files
- Expand IGNORED_EXTENSIONS to filter more non-relevant file types
- Set new GitHub Actions outputs: needs_manual_intervention and
  intervention_details
- Update workflow to conditionally add warning section to PR body

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-26 09:44:50 -05:00
dependabot[bot] 0dd2d21bdc build(deps): bump actions/upload-pages-artifact from 3 to 4 (#392)
Bumps [actions/upload-pages-artifact](https://github.com/actions/upload-pages-artifact) from 3 to 4.
- [Release notes](https://github.com/actions/upload-pages-artifact/releases)
- [Commits](https://github.com/actions/upload-pages-artifact/compare/v3...v4)

---
updated-dependencies:
- dependency-name: actions/upload-pages-artifact
  dependency-version: '4'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-01-26 08:24:01 -05:00
auto-updater[bot] d02e760030 Update Ghidra HEAD to commit ccbdd4f66 (#391)
Bump Ghidra HEAD commit ccbdd4f66

Changed files:

```
M	Ghidra/Processors/AARCH64/data/languages/AARCH64base.sinc
```

Commit details:

```
[Commit 1/1]
Hash: b5fb4d36ed94a83c52fcf11b701f43b2ef18404a
Date: 2024-05-29 00:43:57 +0930
Message: AA64: Add ls_data8 to ldapr

Files changed:
  M	Ghidra/Processors/AARCH64/data/languages/AARCH64base.sinc
```

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2026-01-26 00:40:10 +00:00
Eric Kilmer 42d2ee7457 Replace peter-evans/create-pull-request with native git and gh CLI (#389)
Reduces third-party dependencies by using native git commands and the
pre-installed gh CLI instead of the peter-evans/create-pull-request
action. Adds idempotency check to skip if PR already exists for branch.

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-24 11:05:28 -05:00
Eric Kilmer 0664b5c545 Dark-mode for index.html 2026-01-23 17:51:57 -05:00
Eric Kilmer cd6078bb22 Publish both stable and HEAD docs to GitHub Pages 2026-01-23 17:44:19 -05:00
Eric Kilmer fc49d2340e Deploy Doxygen docs to GitHub Pages
https://lifting-bits.github.io/sleigh
2026-01-23 17:26:42 -05:00
auto-updater[bot] 1df5e051d3 Update Ghidra HEAD to commit 549735683 (#387)
Bump Ghidra HEAD commit 549735683

Changed files:

```
M	Ghidra/Features/Decompiler/src/decompile/cpp/ruleaction.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/sleighbase.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/slgh_compile.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/slgh_compile.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/slghparse.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/slghparse.y
M	Ghidra/Features/Decompiler/src/decompile/cpp/subflow.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/subflow.hh
M	Ghidra/Processors/RISCV/data/languages/riscv.opinion
```

Commit details:

```
[Commit 1/7]
Hash: 6208df2d50d716b4faf87d3a0c0603d45aac4cb3
Date: 2026-01-13 10:44:59 -0500
Message: GP-1 Corrected RISCV import opinion file

Files changed:
  M	Ghidra/Processors/RISCV/data/languages/riscv.opinion

[Commit 2/7]
Hash: 1789bb9c5e66cb1e5ad2072b73c4bf7fbc713f67
Date: 2026-01-12 21:00:06 -0500
Message: GP-1 minor doc fix

Files changed:
  M	Ghidra/Features/Decompiler/src/decompile/cpp/slgh_compile.cc

[Commit 3/7]
Hash: 7828f235d315807d18ecb873fad34b209a02ce65
Date: 2026-01-12 21:51:54 +0000
Message: GP-6316 Increase maximum temporary size for SLEIGH to 256 bytes

Files changed:
  M	Ghidra/Features/Decompiler/src/decompile/cpp/sleighbase.cc
  M	Ghidra/Features/Decompiler/src/decompile/cpp/slgh_compile.cc
  M	Ghidra/Features/Decompiler/src/decompile/cpp/slgh_compile.hh

[Commit 4/7]
Hash: 4830a7ab99548aa898e861b967f48c92dd741f48
Date: 2026-01-12 19:33:12 +0000
Message: GP-6314 Reset label counter for every named section

Files changed:
  M	Ghidra/Features/Decompiler/src/decompile/cpp/slgh_compile.cc
  M	Ghidra/Features/Decompiler/src/decompile/cpp/slgh_compile.hh
  M	Ghidra/Features/Decompiler/src/decompile/cpp/slghparse.cc
  M	Ghidra/Features/Decompiler/src/decompile/cpp/slghparse.y

[Commit 5/7]
Hash: 123bd5cbe6d54105c96bb8a0b5c1b81f84b29e97
Date: 2026-01-09 20:37:38 +0000
Message: GP-6310 Apply extension patch if consumption is beyond small variable

Files changed:
  M	Ghidra/Features/Decompiler/src/decompile/cpp/subflow.cc
  M	Ghidra/Features/Decompiler/src/decompile/cpp/subflow.hh

[Commit 6/7]
Hash: 451334568f3200f453b6b3985b5949f72747f1c6
Date: 2026-01-09 20:15:16 +0000
Message: Let RuleShiftAnd apply in more situations

Files changed:
  M	Ghidra/Features/Decompiler/src/decompile/cpp/ruleaction.cc

[Commit 7/7]
Hash: 92091a7a2ad59309514d808c7eb890492f5c49e8
Date: 2025-12-02 10:59:10 +0100
Message: decompiler: fix bit extractions with RuleShiftAnd and RuleShiftCompare
Details:
Fixes https://github.com/NationalSecurityAgency/ghidra/issues/8717

RuleShiftAnd previously replaced the AND opcode with COPY. This,
however doesn't update the NZMask of the Varnode. As a result, following
rules may assume the NZMask after the AND operation also applies to the
Varnode being copied.

In combination with RuleShiftCompare, an expression of the form
(a & bitmask) >> const != 0, wrongfully is reduced to a != 0.
Instead of replacing the AND with COPY, we now replace the input
of the shift operation instead. This way, future rules will see
the correct NZMask.

Files changed:
  M	Ghidra/Features/Decompiler/src/decompile/cpp/ruleaction.cc
```
2026-01-19 08:56:30 -05:00
Eric Kilmer edc5fabd3a Ghidra 12.0.1 (#386) 2026-01-15 15:52:35 +00:00
auto-updater[bot] 9316045354 Update Ghidra HEAD to commit 6ef256cef (#385)
Bump Ghidra HEAD commit 6ef256cef

Changed files:

```
M	Ghidra/Processors/AARCH64/data/languages/AARCH64.ldefs
M	Ghidra/Processors/AARCH64/data/languages/AARCH64.opinion
M	Ghidra/Processors/x86/data/languages/x86.opinion
```

Commit details:

```
[Commit 1/1]
Hash: ad00d5734f82266e7d58624a36075da33d8e3005
Date: 2025-12-23 19:04:43 -0500
Message: GP-3960: ElfLoader can now recognize Swift and golang

Files changed:
  M	Ghidra/Processors/AARCH64/data/languages/AARCH64.ldefs
  M	Ghidra/Processors/AARCH64/data/languages/AARCH64.opinion
  M	Ghidra/Processors/x86/data/languages/x86.opinion
```
2026-01-05 09:40:32 -05:00
auto-updater[bot] ec98f45ecf Update Ghidra HEAD to commit dc5836119 (#384)
Bump Ghidra HEAD commit dc5836119

Changed files:

```
M	Ghidra/Features/Decompiler/src/decompile/cpp/coreaction.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/coreaction.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/expression.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/jumptable.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/jumptable.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/sleigh.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/slgh_compile.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/slgh_compile.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/type.cc
```

Commit details:

```
[Commit 1/4]
Hash: 19836741896fd7664c9de9519a8841f9b593ae9f
Date: 2025-12-17 19:52:07 +0000
Message: GP-6237 Move the unique crossbuild region to more significant bits

Files changed:
  M	Ghidra/Features/Decompiler/src/decompile/cpp/sleigh.cc
  M	Ghidra/Features/Decompiler/src/decompile/cpp/slgh_compile.cc
  M	Ghidra/Features/Decompiler/src/decompile/cpp/slgh_compile.hh

[Commit 2/4]
Hash: b8e698d97804de62a7dbf6664b0e3f264725c3d9
Date: 2025-09-12 20:10:43 +0000
Message: GP-3834 Allow 256 case switch, if a LOAD is present

Files changed:
  M	Ghidra/Features/Decompiler/src/decompile/cpp/jumptable.cc
  M	Ghidra/Features/Decompiler/src/decompile/cpp/jumptable.hh
  M	Ghidra/Features/Decompiler/src/decompile/cpp/type.cc

[Commit 3/4]
Hash: 6451d3d3135ba72a4c50f40667ad893b2c944de6
Date: 2025-12-12 00:17:12 +0000
Message: GP-6224 Don't resolve pointer if cast still required

Files changed:
  M	Ghidra/Features/Decompiler/src/decompile/cpp/coreaction.cc
  M	Ghidra/Features/Decompiler/src/decompile/cpp/coreaction.hh

[Commit 4/4]
Hash: 9692dd064064ee712d8a724984f1b6b2bec4bc75
Date: 2025-12-10 19:26:03 +0000
Message: GP-6201 Check for free varnodes in functionalEqualityLevel0

Files changed:
  M	Ghidra/Features/Decompiler/src/decompile/cpp/expression.cc
```
2025-12-22 08:48:25 -05:00
dependabot[bot] e4b6ddb926 build(deps): bump actions/upload-artifact from 5 to 6 (#383)
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 5 to 6.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/v5...v6)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-12-15 12:28:09 -05:00
auto-updater[bot] 9248e9114b Update Ghidra HEAD to commit 7bed72e38 (#382)
Bump Ghidra HEAD commit 7bed72e38

Changed files:

```
M	Ghidra/Features/Decompiler/src/decompile/cpp/funcdata_block.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/ruleaction.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/subflow.cc
M	Ghidra/Processors/68000/data/languages/68000.sinc
M	Ghidra/Processors/PowerPC/data/languages/ppc_vle.sinc
```

Commit details:

```
[Commit 1/5]
Hash: 0e658ae5b6a48fbd688ada2303ad7257f75370ea
Date: 2025-11-18 17:19:57 +0000
Message: GP-6133 INT_ADD correction for RuleStructOffset0 applied to offset pointer

Files changed:
  M	Ghidra/Features/Decompiler/src/decompile/cpp/ruleaction.cc

[Commit 2/5]
Hash: 35ac4cf37cd1e10b14e0e758124dcc5a5741df1f
Date: 2025-11-17 22:23:38 +0000
Message: GP-6130 Correct pointer offsets for buildStore and buildLoad

Files changed:
  M	Ghidra/Features/Decompiler/src/decompile/cpp/subflow.cc

[Commit 3/5]
Hash: f8d7b704df457fe5a10e6bb9766e7bb34db3e98e
Date: 2025-11-04 20:44:18 +0000
Message: GP-6090 Adjustment for duplicate inputs in pushMultiequal

Files changed:
  M	Ghidra/Features/Decompiler/src/decompile/cpp/funcdata_block.cc

[Commit 4/5]
Hash: 27b06c83a6c3ee05bebe2c60df2cc8b59a16b842
Date: 2025-02-03 17:36:04 +0000
Message: GP-5334: Corrected operand count for m68k addressing modes

Files changed:
  M	Ghidra/Processors/68000/data/languages/68000.sinc

[Commit 5/5]
Hash: b54347759775a2b9a8bb50afe4ed3a6c082a1bfb
Date: 2025-11-13 18:59:44 +0000
Message: GP-6109: Fixed issue with PPC assembler not assembling some instructions

Files changed:
  M	Ghidra/Processors/PowerPC/data/languages/ppc_vle.sinc
```
2025-12-15 12:27:40 -05:00
dependabot[bot] a020faccb5 build(deps): bump actions/cache from 4 to 5 (#381)
Bumps [actions/cache](https://github.com/actions/cache) from 4 to 5.
- [Release notes](https://github.com/actions/cache/releases)
- [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md)
- [Commits](https://github.com/actions/cache/compare/v4...v5)

---
updated-dependencies:
- dependency-name: actions/cache
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-12-12 09:08:45 -05:00
dependabot[bot] d74e8e9414 build(deps): bump peter-evans/create-pull-request from 7 to 8 (#380)
Bumps [peter-evans/create-pull-request](https://github.com/peter-evans/create-pull-request) from 7 to 8.
- [Release notes](https://github.com/peter-evans/create-pull-request/releases)
- [Commits](https://github.com/peter-evans/create-pull-request/compare/v7...v8)

---
updated-dependencies:
- dependency-name: peter-evans/create-pull-request
  dependency-version: '8'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-12-10 09:18:54 -05:00
Eric Kilmer f8229f609d Ghidra 12.0 (#379)
- Copied patches directly from `HEAD` to use on `stable`
2025-12-08 18:18:45 -05:00
auto-updater[bot] 4edfcef82e Update Ghidra HEAD to commit d83ea1754 (#378)
Bump Ghidra HEAD commit d83ea1754

Changed files:

```
A	Ghidra/Processors/NDS32/Module.manifest
A	Ghidra/Processors/NDS32/build.gradle
A	Ghidra/Processors/NDS32/certification.manifest
A	Ghidra/Processors/NDS32/data/languages/lsmw.sinc
A	Ghidra/Processors/NDS32/data/languages/nds32.cspec
A	Ghidra/Processors/NDS32/data/languages/nds32.dwarf
A	Ghidra/Processors/NDS32/data/languages/nds32.ldefs
A	Ghidra/Processors/NDS32/data/languages/nds32.opinion
A	Ghidra/Processors/NDS32/data/languages/nds32.pspec
A	Ghidra/Processors/NDS32/data/languages/nds32.sinc
A	Ghidra/Processors/NDS32/data/languages/nds32be.slaspec
A	Ghidra/Processors/NDS32/data/languages/nds32le.slaspec
A	Ghidra/Processors/NDS32/data/patterns/nds32_patterns.xml
A	Ghidra/Processors/NDS32/data/patterns/patternconstraints.xml
M	Ghidra/Processors/RISCV/data/languages/andestar_v5.instr.sinc
M	Ghidra/Processors/RISCV/data/languages/riscv.reg.sinc
```

Commit details:

```
[Commit 1/9]
Hash: d0f88bf9023ac412b50460fe9e0ac5fc76f14d90
Date: 2025-12-04 12:28:50 -0500
Message: GP-6007 Remove Decompiler dependency

Files changed:
  M	Ghidra/Processors/NDS32/build.gradle

[Commit 2/9]
Hash: 923ceb52d4727a2227a8b2512593ec4fb03ab0e2
Date: 2025-12-04 11:25:54 -0500
Message: GP-6007 use -l sleigh compile option with NDS32

Files changed:
  M	Ghidra/Processors/NDS32/build.gradle

[Commit 3/9]
Hash: ddf4ad1182577f759b1c0e7c40d8825abd65b357
Date: 2025-12-03 22:06:38 +0000
Message: GP-6007 minor fixes for Andestar v5

Files changed:
  M	Ghidra/Processors/RISCV/data/languages/andestar_v5.instr.sinc
  M	Ghidra/Processors/RISCV/data/languages/riscv.reg.sinc

[Commit 4/9]
Hash: 2efa886f5ca0996d3ea9f1865d952aa2708389b6
Date: 2025-12-03 21:36:18 +0000
Message: GP-6007 minor fixes for mfusr, mtusr and csreg space as global in cspec

Files changed:
  M	Ghidra/Processors/NDS32/data/languages/nds32.cspec
  M	Ghidra/Processors/NDS32/data/languages/nds32.sinc

[Commit 5/9]
Hash: df6e4049d4f91f8cb9c9ff3888bb5f2a15a411d8
Date: 2025-12-02 20:21:14 +0000
Message: GP-6007: Added additional floating point config instructions

Files changed:
  M	Ghidra/Processors/NDS32/data/languages/nds32.sinc

[Commit 6/9]
Hash: 9bdd19cc087f889a16421b7cda082e2a08653449
Date: 2025-12-02 15:30:45 +0000
Message: GP-6007: Added CSR space and CSRs

Files changed:
  M	Ghidra/Processors/NDS32/data/languages/lsmw.sinc
  M	Ghidra/Processors/NDS32/data/languages/nds32.pspec
  M	Ghidra/Processors/NDS32/data/languages/nds32.sinc

[Commit 7/9]
Hash: ed4ae8bfa1f6b5db8c7356b2a4253c4c647e65f4
Date: 2025-11-26 20:19:40 +0000
Message: GP-6007: Added stubs for nds32 FPU instructions

Files changed:
  M	Ghidra/Processors/NDS32/build.gradle
  M	Ghidra/Processors/NDS32/data/languages/nds32.ldefs
  M	Ghidra/Processors/NDS32/data/languages/nds32.sinc
  M	Ghidra/Processors/NDS32/data/patterns/nds32_patterns.xml

[Commit 8/9]
Hash: 71cd33572c873b1eebd322032506c259632d0d52
Date: 2025-09-22 14:37:16 +0000
Message: GP-6007: Updated NDS32 analyzer and elf relocation handler and test fixups

Files changed:
  M	Ghidra/Processors/NDS32/build.gradle
  A	Ghidra/Processors/NDS32/certification.manifest
  D	Ghidra/Processors/NDS32/data/buildLanguage.xml
  M	Ghidra/Processors/NDS32/data/languages/lsmw.sinc
  M	Ghidra/Processors/NDS32/data/languages/nds32.cspec
  M	Ghidra/Processors/NDS32/data/languages/nds32.sinc
  M	Ghidra/Processors/NDS32/data/languages/nds32be.slaspec
  M	Ghidra/Processors/NDS32/data/languages/nds32le.slaspec
  D	Ghidra/Processors/NDS32/data/sleighArgs.txt

[Commit 9/9]
Hash: fa7c3b1fec5e133f5147b6c541d023c646c0b170
Date: 2020-04-16 18:58:10 +0200
Message: [NDS32] Add support for the NDS32 Processor

Files changed:
  A	Ghidra/Processors/NDS32/Module.manifest
  A	Ghidra/Processors/NDS32/build.gradle
  A	Ghidra/Processors/NDS32/data/buildLanguage.xml
  A	Ghidra/Processors/NDS32/data/languages/lsmw.sinc
  A	Ghidra/Processors/NDS32/data/languages/nds32.cspec
  A	Ghidra/Processors/NDS32/data/languages/nds32.dwarf
  A	Ghidra/Processors/NDS32/data/languages/nds32.ldefs
  A	Ghidra/Processors/NDS32/data/languages/nds32.opinion
  A	Ghidra/Processors/NDS32/data/languages/nds32.pspec
  A	Ghidra/Processors/NDS32/data/languages/nds32.sinc
  A	Ghidra/Processors/NDS32/data/languages/nds32be.slaspec
  A	Ghidra/Processors/NDS32/data/languages/nds32le.slaspec
  A	Ghidra/Processors/NDS32/data/patterns/nds32_patterns.xml
  A	Ghidra/Processors/NDS32/data/patterns/patternconstraints.xml
  A	Ghidra/Processors/NDS32/data/sleighArgs.txt
```
2025-12-08 13:20:49 -05:00
Eric Kilmer 26c6b01b1f Ghidra 11.4.3 (#377) 2025-12-03 14:38:16 -05:00
dependabot[bot] 563adb57e9 build(deps): bump softprops/action-gh-release from 2.4.2 to 2.5.0 (#376)
Bumps [softprops/action-gh-release](https://github.com/softprops/action-gh-release) from 2.4.2 to 2.5.0.
- [Release notes](https://github.com/softprops/action-gh-release/releases)
- [Changelog](https://github.com/softprops/action-gh-release/blob/master/CHANGELOG.md)
- [Commits](https://github.com/softprops/action-gh-release/compare/v2.4.2...v2.5.0)

---
updated-dependencies:
- dependency-name: softprops/action-gh-release
  dependency-version: 2.5.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-12-02 10:26:03 -05:00
auto-updater[bot] 127d913bc9 Update Ghidra HEAD to commit 14ead1aab (#375)
Bump Ghidra HEAD commit 14ead1aab

Changed files:

```
M	Ghidra/Processors/AARCH64/data/languages/AARCH64neon.sinc
M	Ghidra/Processors/ARM/data/languages/ARMTHUMBinstructions.sinc
M	Ghidra/Processors/ARM/data/languages/ARMneon.sinc
M	Ghidra/Processors/PowerPC/certification.manifest
A	Ghidra/Processors/PowerPC/data/patterns/PPC_BE_prepatterns.xml
R060	Ghidra/Processors/PowerPC/data/ppc64-r2CallStubs.xml	Ghidra/Processors/PowerPC/data/patterns/PPC_LE_prepatterns.xml
A	Ghidra/Processors/PowerPC/data/patterns/prepatternconstraints.xml
```

Commit details:

```
[Commit 1/4]
Hash: 88ff4b2008051e2dced18b897d8b4bc280ba675d
Date: 2025-11-24 18:25:40 +0000
Message: GP-6120_emteere_FixThunkDetectionMarkupPPC64

Files changed:
  M	Ghidra/Processors/PowerPC/certification.manifest
  A	Ghidra/Processors/PowerPC/data/patterns/PPC_BE_prepatterns.xml
  A	Ghidra/Processors/PowerPC/data/patterns/PPC_LE_prepatterns.xml
  A	Ghidra/Processors/PowerPC/data/patterns/prepatternconstraints.xml
  D	Ghidra/Processors/PowerPC/data/ppc64-r2CallStubs.xml

[Commit 2/4]
Hash: 40c8aa60b1a4c2f0bb32e775e83557932ff40a05
Date: 2024-05-23 13:46:50 +0930
Message: AArch32: (Thumb32) fixed ldrsh.w & ldrsb.w (pc-relative)
Details:
* double memory load bug

Files changed:
  M	Ghidra/Processors/ARM/data/languages/ARMTHUMBinstructions.sinc

[Commit 3/4]
Hash: 0982753437eaa0a1015e56cd4d8fdd16a1310d63
Date: 2024-05-20 14:13:49 +0930
Message: AArch32: fixed vmvn
Details:
* fixed incorrect shift offset (bytes given in place of bits) and double word order

Files changed:
  M	Ghidra/Processors/ARM/data/languages/ARMneon.sinc

[Commit 4/4]
Hash: c4c7f11d1c310143adeabeb49dcb74313daf0746
Date: 2025-11-13 11:00:06 -0500
Message: fix AArch64 fmadd operand ordering for 32-bit case

Files changed:
  M	Ghidra/Processors/AARCH64/data/languages/AARCH64neon.sinc
```
2025-12-01 10:44:29 -05:00
auto-updater[bot] 0ea6de2744 Update Ghidra HEAD to commit 7a5a9ea5d (#374)
Bump Ghidra HEAD commit 7a5a9ea5d

Changed files:

```
M	Ghidra/Processors/ARM/data/languages/ARMinstructions.sinc
M	Ghidra/Processors/PowerPC/data/languages/ppc_common.sinc
M	Ghidra/Processors/PowerPC/data/languages/ppc_instructions.sinc
```

Commit details:

```
[Commit 1/2]
Hash: 22a5a22d824f68bff4db7d8c123661789f28ca61
Date: 2025-08-10 19:33:56 +0300
Message: PowerPC: fix condition check in bd*f* opcodes

Files changed:
  M	Ghidra/Processors/PowerPC/data/languages/ppc_common.sinc
  M	Ghidra/Processors/PowerPC/data/languages/ppc_instructions.sinc

[Commit 2/2]
Hash: 5857e63741c54a2db54450f5bc32e56fe94b62a5
Date: 2025-11-13 20:31:53 +0000
Message: GP-6118 Fix for specialized ARM cpy pc,lr

Files changed:
  M	Ghidra/Processors/ARM/data/languages/ARMinstructions.sinc
```
2025-11-24 09:28:24 -05:00
dependabot[bot] 27072f1bca build(deps): bump actions/checkout from 5 to 6 (#372)
Bumps [actions/checkout](https://github.com/actions/checkout) from 5 to 6.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v5...v6)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-11-21 09:04:43 -05:00
auto-updater[bot] 185e34f5e7 Update Ghidra HEAD to commit be482754a (#371)
Bump Ghidra HEAD commit be482754a

Changed files:

```
M	Ghidra/Processors/ARM/data/languages/ARM.ldefs
M	Ghidra/Processors/ARM/data/languages/ARMinstructions.sinc
M	Ghidra/Processors/ARM/data/patterns/ARM_BE_patterns.xml
M	Ghidra/Processors/ARM/data/patterns/ARM_LE_patterns.xml
M	Ghidra/Processors/PowerPC/data/patterns/PPC_BE_patterns.xml
M	Ghidra/Processors/PowerPC/data/patterns/PPC_LE_patterns.xml
M	Ghidra/Processors/RISCV/certification.manifest
A	Ghidra/Processors/RISCV/data/languages/RV32.pspec
D	Ghidra/Processors/RISCV/data/languages/RV32G.pspec
D	Ghidra/Processors/RISCV/data/languages/RV32GC.pspec
D	Ghidra/Processors/RISCV/data/languages/RV32I.pspec
D	Ghidra/Processors/RISCV/data/languages/RV32IC.pspec
D	Ghidra/Processors/RISCV/data/languages/RV32IMC.pspec
A	Ghidra/Processors/RISCV/data/languages/RV64.pspec
D	Ghidra/Processors/RISCV/data/languages/RV64G.pspec
D	Ghidra/Processors/RISCV/data/languages/RV64GC.pspec
D	Ghidra/Processors/RISCV/data/languages/RV64I.pspec
D	Ghidra/Processors/RISCV/data/languages/RV64IC.pspec
A	Ghidra/Processors/RISCV/data/languages/andestar_v5.instr.sinc
A	Ghidra/Processors/RISCV/data/languages/andestar_v5.ldefs
A	Ghidra/Processors/RISCV/data/languages/andestar_v5.slaspec
A	Ghidra/Processors/RISCV/data/languages/old/riscv_deprecated.ldefs
M	Ghidra/Processors/RISCV/data/languages/riscv.csr.sinc
M	Ghidra/Processors/RISCV/data/languages/riscv.ilp32d.slaspec
M	Ghidra/Processors/RISCV/data/languages/riscv.instr.sinc
M	Ghidra/Processors/RISCV/data/languages/riscv.ldefs
M	Ghidra/Processors/RISCV/data/languages/riscv.lp64d.slaspec
M	Ghidra/Processors/RISCV/data/languages/riscv.reg.sinc
M	Ghidra/Processors/RISCV/data/languages/riscv.rvc.sinc
M	Ghidra/Processors/RISCV/data/languages/riscv.rvv.sinc
M	Ghidra/Processors/RISCV/data/languages/riscv.table.sinc
M	Ghidra/Processors/RISCV/data/languages/riscv32-fp.cspec
M	Ghidra/Processors/RISCV/data/languages/riscv32.cspec
M	Ghidra/Processors/RISCV/data/languages/riscv64-fp.cspec
M	Ghidra/Processors/RISCV/data/languages/riscv64.cspec
M	Ghidra/Processors/SuperH/data/languages/superh.sinc
M	Ghidra/Processors/Xtensa/data/languages/xtensaArch.sinc
M	Ghidra/Processors/Xtensa/data/languages/xtensaInstructions.sinc
```

Commit details:

```
[Commit 1/6]
Hash: c3a2482e186185c86ba98b93044aa032fad48ce2
Date: 2025-11-05 14:39:41 -0500
Message: GP-5975 Eliminated unused NotFoundException from Memory methods. Revised import to always include pspec symbols within pcode-defined memory blocks.  Added label name check.  Revised language version upgrade to handle certain pspec-defined block and symbol changes. Corrected RISC-V 64-bit-fp cspec.

Files changed:
  M	Ghidra/Processors/RISCV/certification.manifest
  A	Ghidra/Processors/RISCV/data/languages/old/riscv_deprecated.ldefs
  M	Ghidra/Processors/RISCV/data/languages/riscv.ldefs
  M	Ghidra/Processors/RISCV/data/languages/riscv64-fp.cspec

[Commit 2/6]
Hash: ade1ad71ba5b80e910fcd98ad688f658439724a5
Date: 2025-09-30 17:08:48 +0000
Message: GP-5975 Refactored RISCV custom instruction, sinc file layout, simplified context, and moved csr register definitions to be in a special csreg ram space.  Deprecated all most RISCV variants other than default.  Added andestar V5 RISCV variant.

Files changed:
  M	Ghidra/Processors/RISCV/certification.manifest
  A	Ghidra/Processors/RISCV/data/languages/RV32.pspec
  D	Ghidra/Processors/RISCV/data/languages/RV32G.pspec
  D	Ghidra/Processors/RISCV/data/languages/RV32GC.pspec
  D	Ghidra/Processors/RISCV/data/languages/RV32I.pspec
  D	Ghidra/Processors/RISCV/data/languages/RV32IC.pspec
  D	Ghidra/Processors/RISCV/data/languages/RV32IMC.pspec
  A	Ghidra/Processors/RISCV/data/languages/RV64.pspec
  D	Ghidra/Processors/RISCV/data/languages/RV64G.pspec
  D	Ghidra/Processors/RISCV/data/languages/RV64GC.pspec
  D	Ghidra/Processors/RISCV/data/languages/RV64I.pspec
  D	Ghidra/Processors/RISCV/data/languages/RV64IC.pspec
  A	Ghidra/Processors/RISCV/data/languages/andestar_v5.instr.sinc
  A	Ghidra/Processors/RISCV/data/languages/andestar_v5.ldefs
  A	Ghidra/Processors/RISCV/data/languages/andestar_v5.slaspec
  M	Ghidra/Processors/RISCV/data/languages/riscv.csr.sinc
  M	Ghidra/Processors/RISCV/data/languages/riscv.ilp32d.slaspec
  M	Ghidra/Processors/RISCV/data/languages/riscv.instr.sinc
  M	Ghidra/Processors/RISCV/data/languages/riscv.ldefs
  M	Ghidra/Processors/RISCV/data/languages/riscv.lp64d.slaspec
  M	Ghidra/Processors/RISCV/data/languages/riscv.reg.sinc
  M	Ghidra/Processors/RISCV/data/languages/riscv.rvc.sinc
  M	Ghidra/Processors/RISCV/data/languages/riscv.rvv.sinc
  M	Ghidra/Processors/RISCV/data/languages/riscv.table.sinc
  M	Ghidra/Processors/RISCV/data/languages/riscv32-fp.cspec
  M	Ghidra/Processors/RISCV/data/languages/riscv32.cspec
  M	Ghidra/Processors/RISCV/data/languages/riscv64.cspec

[Commit 3/6]
Hash: 0b60036f8fd0dd3cc70233fd3294d38755b7b525
Date: 2025-10-19 17:36:58 +0300
Message: SuperH fix 'bclr' opcode

Files changed:
  M	Ghidra/Processors/SuperH/data/languages/superh.sinc

[Commit 4/6]
Hash: 2419b08085dbfdf9a0ae8934526ebc7c30abce87
Date: 2025-11-06 18:47:35 +0000
Message: GP-6072 Fixed thunk detection and thunk address for Position Independent Code thunks that call to load a link register that is turned into a jump.

Files changed:
  M	Ghidra/Processors/PowerPC/data/patterns/PPC_BE_patterns.xml
  M	Ghidra/Processors/PowerPC/data/patterns/PPC_LE_patterns.xml

[Commit 5/6]
Hash: 3a0736f2647e5c095222473cebbdcad6a25c13a4
Date: 2025-10-03 15:47:44 -0500
Message: Xtensa: BE: Corrected decoding of the following instructions: BBCI, BBSI, BEQZ.N, BNEZ.N, DEPBITS, EXTUI, LDDEC, LDINC, MOVI.N, MUL.AD.*, MULA.AD.*, MUL.DA.*, MUL.DD.*, MULA.DA.*, MULA.DD.*, SLLI, SRAI, SSAI (Closes #8544, Closes #8537)

Files changed:
  M	Ghidra/Processors/Xtensa/data/languages/xtensaArch.sinc
  M	Ghidra/Processors/Xtensa/data/languages/xtensaInstructions.sinc

[Commit 6/6]
Hash: 5924914b47881f5ab936b52ac7649493cb2268c9
Date: 2025-10-30 20:21:11 +0000
Message: GP-6079 ARM instruction CPY into PC with LR set before it is now a call. Also fixed a function start pattern, and spurious references placed on stack save of the PC.

Files changed:
  M	Ghidra/Processors/ARM/data/languages/ARM.ldefs
  M	Ghidra/Processors/ARM/data/languages/ARMinstructions.sinc
  M	Ghidra/Processors/ARM/data/patterns/ARM_BE_patterns.xml
  M	Ghidra/Processors/ARM/data/patterns/ARM_LE_patterns.xml
```
2025-11-17 09:25:49 -05:00
Klaus Kämpf 1ea24c8b8d Catch Sleigh exceptions (#282)
Signed-off-by: Klaus Kämpf <kkaempf@gmail.com>
2025-11-12 12:19:03 -05:00
dependabot[bot] 572082b008 build(deps): bump softprops/action-gh-release from 2.4.1 to 2.4.2 (#370)
Bumps [softprops/action-gh-release](https://github.com/softprops/action-gh-release) from 2.4.1 to 2.4.2.
- [Release notes](https://github.com/softprops/action-gh-release/releases)
- [Changelog](https://github.com/softprops/action-gh-release/blob/master/CHANGELOG.md)
- [Commits](https://github.com/softprops/action-gh-release/compare/v2.4.1...v2.4.2)

---
updated-dependencies:
- dependency-name: softprops/action-gh-release
  dependency-version: 2.4.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-11-10 08:57:18 -05:00
auto-updater[bot] a5496ad829 Update Ghidra HEAD to commit 4b1fd2254 (#369)
Bump Ghidra HEAD commit 4b1fd2254

Changed files:

```
M	Ghidra/Processors/PA-RISC/data/languages/pa-risc.opinion
M	Ghidra/Processors/x86/certification.manifest
A	Ghidra/Processors/x86/data/extensions/rust/unix32/cc.xml
R100	Ghidra/Processors/x86/data/extensions/rust/unix/probe_fixup.xml	Ghidra/Processors/x86/data/extensions/rust/unix32/probe_fixup.xml
A	Ghidra/Processors/x86/data/extensions/rust/unix32/try_fixup.xml
R100	Ghidra/Processors/x86/data/extensions/rust/unix/cc.xml	Ghidra/Processors/x86/data/extensions/rust/unix64/cc.xml
R100	Ghidra/Processors/x86/data/extensions/rust/windows/probe_fixup.xml	Ghidra/Processors/x86/data/extensions/rust/unix64/probe_fixup.xml
R100	Ghidra/Processors/x86/data/extensions/rust/unix/try_fixup.xml	Ghidra/Processors/x86/data/extensions/rust/unix64/try_fixup.xml
A	Ghidra/Processors/x86/data/extensions/rust/windows32/probe_fixup.xml
A	Ghidra/Processors/x86/data/extensions/rust/windows32/try_fixup.xml
A	Ghidra/Processors/x86/data/extensions/rust/windows64/probe_fixup.xml
R100	Ghidra/Processors/x86/data/extensions/rust/windows/try_fixup.xml	Ghidra/Processors/x86/data/extensions/rust/windows64/try_fixup.xml
```

Commit details:

```
[Commit 1/2]
Hash: bb63706226732c5f0c14cf01ae934a2cd6622fb6
Date: 2025-10-09 08:06:13 -0400
Message: GP-5942: Loader for "System Object Model" binaries

Files changed:
  M	Ghidra/Processors/PA-RISC/data/languages/pa-risc.opinion

[Commit 2/2]
Hash: 95ad48cdb371aeef15892767f4962ab1712db86f
Date: 2025-10-28 17:22:13 +0000
Message: GP-4711 Fix for import of 32-bit x86 Unix/Windows Rust binaries

Files changed:
  M	Ghidra/Processors/x86/certification.manifest
  D	Ghidra/Processors/x86/data/extensions/rust/unix/cc.xml
  D	Ghidra/Processors/x86/data/extensions/rust/unix/probe_fixup.xml
  D	Ghidra/Processors/x86/data/extensions/rust/unix/try_fixup.xml
  A	Ghidra/Processors/x86/data/extensions/rust/unix32/cc.xml
  A	Ghidra/Processors/x86/data/extensions/rust/unix32/probe_fixup.xml
  A	Ghidra/Processors/x86/data/extensions/rust/unix32/try_fixup.xml
  A	Ghidra/Processors/x86/data/extensions/rust/unix64/cc.xml
  A	Ghidra/Processors/x86/data/extensions/rust/unix64/probe_fixup.xml
  A	Ghidra/Processors/x86/data/extensions/rust/unix64/try_fixup.xml
  D	Ghidra/Processors/x86/data/extensions/rust/windows/probe_fixup.xml
  D	Ghidra/Processors/x86/data/extensions/rust/windows/try_fixup.xml
  A	Ghidra/Processors/x86/data/extensions/rust/windows32/probe_fixup.xml
  A	Ghidra/Processors/x86/data/extensions/rust/windows32/try_fixup.xml
  A	Ghidra/Processors/x86/data/extensions/rust/windows64/probe_fixup.xml
  A	Ghidra/Processors/x86/data/extensions/rust/windows64/try_fixup.xml
```

Co-authored-by: pgoodman <43664+pgoodman@users.noreply.github.com>
2025-11-03 11:18:43 -05:00
estr3llas 604cd282a6 Fixed URL to ghidra's SLEIGH page. (#368)
Update README.md
2025-10-29 15:39:54 -04:00
dependabot[bot] 14c9c408ca build(deps): bump actions/upload-artifact from 4 to 5 (#367)
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 4 to 5.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/v4...v5)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-10-27 09:12:42 -04:00
dependabot[bot] 21ed4b78e5 build(deps): bump softprops/action-gh-release from 2.4.0 to 2.4.1 (#366)
Bumps [softprops/action-gh-release](https://github.com/softprops/action-gh-release) from 2.4.0 to 2.4.1.
- [Release notes](https://github.com/softprops/action-gh-release/releases)
- [Changelog](https://github.com/softprops/action-gh-release/blob/master/CHANGELOG.md)
- [Commits](https://github.com/softprops/action-gh-release/compare/v2.4.0...v2.4.1)

---
updated-dependencies:
- dependency-name: softprops/action-gh-release
  dependency-version: 2.4.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-10-13 22:11:13 -04:00
dependabot[bot] d2c42d19ed build(deps): bump softprops/action-gh-release from 2.3.4 to 2.4.0 (#365)
Bumps [softprops/action-gh-release](https://github.com/softprops/action-gh-release) from 2.3.4 to 2.4.0.
- [Release notes](https://github.com/softprops/action-gh-release/releases)
- [Changelog](https://github.com/softprops/action-gh-release/blob/master/CHANGELOG.md)
- [Commits](https://github.com/softprops/action-gh-release/compare/v2.3.4...v2.4.0)

---
updated-dependencies:
- dependency-name: softprops/action-gh-release
  dependency-version: 2.4.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-10-07 08:51:40 -04:00
auto-updater[bot] 97f7fd1faf Update Ghidra HEAD to commit 53cca61f8 (#363)
Bump Ghidra HEAD commit 53cca61f8

Changed files:

```
M	Ghidra/Processors/MIPS/data/languages/mips.sinc
M	Ghidra/Processors/MIPS/data/languages/mips16.sinc
M	Ghidra/Processors/eBPF/data/languages/eBPF.sinc
```

Commit details:

```
[Commit 1/7]
Hash: 575dfa7572af0c726fa2d69c512ab486315559e6
Date: 2025-09-10 12:42:00 +0000
Message: GP-5902: Fixed gotos

Files changed:
  M	Ghidra/Processors/MIPS/data/languages/mips16.sinc

[Commit 2/7]
Hash: a6e9ea090022e9a97dd8411e51caad64dc80e63c
Date: 2025-08-30 15:46:00 +0100
Message: mips: Don't use reserved keywords for names

Files changed:
  M	Ghidra/Processors/MIPS/data/languages/mips16.sinc

[Commit 3/7]
Hash: a72a68c4612c368c8f9790e586a6246273714ed1
Date: 2025-08-30 14:47:57 +0100
Message: mips: Use & ~1 rather than & -2

Files changed:
  M	Ghidra/Processors/MIPS/data/languages/mips16.sinc

[Commit 4/7]
Hash: 3c095be95654fb333ea4c22ede44f096b8c341e2
Date: 2025-08-19 20:51:02 +0100
Message: Fix LI failing to match in some cases

Files changed:
  M	Ghidra/Processors/MIPS/data/languages/mips16.sinc

[Commit 5/7]
Hash: 63919665ec3d07639c6cbe30285640b775c8f099
Date: 2025-08-02 01:42:30 +0100
Message: mips: Correctly handle 64-bit regs in INS and EXT 16e2 instructions

Files changed:
  M	Ghidra/Processors/MIPS/data/languages/mips16.sinc

[Commit 6/7]
Hash: b31997bba0bcc7502d47060022f8173e42077365
Date: 2025-08-02 01:08:43 +0100
Message: mips: Add mips16e2 instructions

Files changed:
  M	Ghidra/Processors/MIPS/data/languages/mips.sinc
  M	Ghidra/Processors/MIPS/data/languages/mips16.sinc

[Commit 7/7]
Hash: 4f3f1059dc67d10db6a82c2c29c93d0d11504401
Date: 2025-04-01 22:24:44 +0200
Message: Add eBPF instruction CALLX for indirect calls
Details:
When clang encounters indirect calls in eBPF programs, it emits a call
instruction with a register parameter (`BPF_X`) instead of an immediate
value (`BPF_K`). This encoding (`BPF_JMP | BPF_CALL | BPF_X = 0x8d`) is
decoded by llvm-objdump as `callx`.

For example, here is a simple C program with an indirect call:

    extern void (*ptr_to_some_function)(void);
    void call_ptr_to_some_function(void) {
        ptr_to_some_function();
    }

Compiling and disassembling it gives with clang 14.0 (and LLVM 14.0):

    $ clang -O2 -target bpf -c indirect_call.c -o indirect_call.ebpf
    $ llvm-objdump -rd indirect_call.ebpf

    indirect_call.ebpf:  file format elf64-bpf

    Disassembly of section .text:

    0000000000000000 <call_ptr_to_some_function>:
           0:  18 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00  r1 = 0 ll
                    0000000000000000:  R_BPF_64_64  ptr_to_some_function
           2:  79 11 00 00 00 00 00 00  r1 = *(u64 *)(r1 + 0)
           3:  8d 00 00 00 01 00 00 00  callx r1
           4:  95 00 00 00 00 00 00 00  exit

Contrary to usual eBPF instructions, `callx`'s register operand is
encoded in the immediate field. This encoding is actually specific to
LLVM (and clang). GCC used the destination register to store the target
register.

LLVM 19.1 was modified to use GCC's encoding:
https://github.com/llvm/llvm-project/pull/81546 ("BPF: Change callx insn
encoding"). For example, in an Alpine Linux 3.21 system:

    $ clang -target bpf --version
    Alpine clang version 19.1.4
    Target: bpf
    Thread model: posix
    InstalledDir: /usr/lib/llvm19/bin

    $ clang -O2 -target bpf -c indirect_call.c -o indirect_call.ebpf
    $ llvm-objdump -rd indirect_call.ebpf

    indirect_call.ebpf:  file format elf64-bpf

    Disassembly of section .text:

    0000000000000000 <call_ptr_to_some_function>:
           0:  18 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00  r1 = 0x0 ll
                    0000000000000000:  R_BPF_64_64  ptr_to_some_function
           2:  79 11 00 00 00 00 00 00  r1 = *(u64 *)(r1 + 0x0)
           3:  8d 01 00 00 00 00 00 00  callx r1
           4:  95 00 00 00 00 00 00 00  exit

The instruction is now encoded `8d 01 00...`.

For reference, here are similar commands using GCC showing it is using
the same encoding (here, compiler option `-mxbpf` is required to enable
several features including indirect calls, cf.
https://gcc.gnu.org/onlinedocs/gcc-12.4.0/gcc/eBPF-Options.html ).

    $ bpf-gcc --version
    bpf-gcc (12-20220319-1ubuntu1+2) 12.0.1 20220319 (experimental) [master r12-7719-g8ca61ad148f]

    $ bpf-gcc -O2 -c indirect_call.c -o indirect_call.ebpf -mxbpf
    $ bpf-objdump -mxbpf -rd indirect_call.ebpf

    indirect_call_gcc-12.ebpf:     file format elf64-bpfle

    Disassembly of section .text:

    0000000000000000 <call_ptr_to_some_function>:
       0:  18 00 00 00 00 00 00 00   lddw %r0,0
       8:  00 00 00 00 00 00 00 00
          0: R_BPF_INSN_64  ptr_to_some_function
      10:  79 01 00 00 00 00 00 00   ldxdw %r1,[%r0+0]
      18:  8d 01 00 00 00 00 00 00   call %r1
      20:  95 00 00 00 00 00 00 00   exit

Add both `callx` instruction encodings to eBPF processor.

By the way, the eBPF Verifier used by Linux kernel currently forbids
indirect calls (it fails when `BPF_SRC(insn->code) != BPF_K`, in
https://web.git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/kernel/bpf/verifier.c?h=v6.14#n19141
). But other deployments of eBPF may already support this feature.

Files changed:
  M	Ghidra/Processors/eBPF/data/languages/eBPF.sinc
```
2025-10-06 09:15:44 -04:00
dependabot[bot] cf1dc2bb79 build(deps): bump softprops/action-gh-release from 2.3.3 to 2.3.4 (#364)
Bumps [softprops/action-gh-release](https://github.com/softprops/action-gh-release) from 2.3.3 to 2.3.4.
- [Release notes](https://github.com/softprops/action-gh-release/releases)
- [Changelog](https://github.com/softprops/action-gh-release/blob/master/CHANGELOG.md)
- [Commits](https://github.com/softprops/action-gh-release/compare/v2.3.3...v2.3.4)

---
updated-dependencies:
- dependency-name: softprops/action-gh-release
  dependency-version: 2.3.4
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-10-06 09:15:04 -04:00
auto-updater[bot] a732884632 Update Ghidra HEAD to commit 96506554e (#362)
Bump Ghidra HEAD commit 96506554e

Changed files:

```
M	Ghidra/Processors/AARCH64/certification.manifest
A	Ghidra/Processors/AARCH64/data/languages/AARCH64_apple.cspec
M	Ghidra/Processors/AARCH64/data/languages/AppleSilicon.ldefs
M	Ghidra/Processors/x86/data/languages/x86-64-win.cspec
M	Ghidra/Processors/x86/data/languages/x86win.cspec
M	Ghidra/Processors/x86/data/patterns/x86-64gcc_patterns.xml
M	Ghidra/Processors/x86/data/patterns/x86-64win_patterns.xml
M	Ghidra/Processors/x86/data/patterns/x86gcc_patterns.xml
M	Ghidra/Processors/x86/data/patterns/x86gcc_prepatterns.xml
M	Ghidra/Processors/x86/data/patterns/x86win_patterns.xml
```

Commit details:

```
[Commit 1/4]
Hash: dc069a18c602b71dbbb3bb7d150adb5b39565b8f
Date: 2025-09-24 18:06:03 +0000
Message: GP-5287 Added ENDBR jump target checking instructions as function start patterns for x86 gcc binaries

Files changed:
  M	Ghidra/Processors/x86/data/patterns/x86-64gcc_patterns.xml
  M	Ghidra/Processors/x86/data/patterns/x86gcc_patterns.xml

[Commit 2/4]
Hash: 69ed84a069255d06e500691dfd9229067bb8b209
Date: 2025-09-24 18:03:10 +0000
Message: GP-5526 bug fix for .plt.sec and pattern matching optimization

Files changed:
  M	Ghidra/Processors/x86/data/patterns/x86gcc_prepatterns.xml

[Commit 3/4]
Hash: 0815f463f543e0f09e582de612e04b612460bc4d
Date: 2025-09-24 18:01:43 +0000
Message: GP-5998 Added security_check_cookie function patterns and callfixup for VS2022 based binaries.

Files changed:
  M	Ghidra/Processors/x86/data/languages/x86-64-win.cspec
  M	Ghidra/Processors/x86/data/languages/x86win.cspec
  M	Ghidra/Processors/x86/data/patterns/x86-64win_patterns.xml
  M	Ghidra/Processors/x86/data/patterns/x86win_patterns.xml

[Commit 4/4]
Hash: 6e81a370ce02a1e9e65fe7d9d02240e8773ec8bb
Date: 2025-09-11 17:36:37 +0000
Message: GP-3139 added cspec for AARCH64 apple silicon

Files changed:
  M	Ghidra/Processors/AARCH64/certification.manifest
  A	Ghidra/Processors/AARCH64/data/languages/AARCH64_apple.cspec
  M	Ghidra/Processors/AARCH64/data/languages/AppleSilicon.ldefs
```
2025-09-29 09:02:40 -04:00
auto-updater[bot] 800a597ff6 Update Ghidra HEAD to commit 1ae4378cf (#361)
Bump Ghidra HEAD commit 1ae4378cf

Changed files:

```
M	Ghidra/Processors/Atmel/data/languages/avr32a_instruction_flow.sinc
M	Ghidra/Processors/tricore/data/languages/tricore.ldefs
M	Ghidra/Processors/x86/certification.manifest
M	Ghidra/Processors/x86/data/patterns/prepatternconstraints.xml
A	Ghidra/Processors/x86/data/patterns/x86gcc_prepatterns.xml
```

Commit details:

```
[Commit 1/4]
Hash: 24b2275c0b7bbdb30243d6b3877d0a5fb852243a
Date: 2023-09-05 10:03:20 -0400
Message: tmp assigned rd0 instead of LR

Files changed:
  M	Ghidra/Processors/Atmel/data/languages/avr32a_instruction_flow.sinc

[Commit 2/4]
Hash: be7458a4369e8b0ec0988f96d33a71b33912e750
Date: 2023-08-29 09:24:37 -0400
Message: Update avr32a_instruction_flow.sinc
Details:
The specification for avr32 says the LR register should be reserved for using return addresses, but in reality older compilers seem to use it to hold addresses for ICALL. When they do so without this fix the value in LR is immediately overwritten and during analysis only appears to be a function call to the opcode immediately after ICALL.

Files changed:
  M	Ghidra/Processors/Atmel/data/languages/avr32a_instruction_flow.sinc

[Commit 3/4]
Hash: 4b6d90366c8569b5d780dd14a74445957db55582
Date: 2025-09-10 22:55:14 +0000
Message: GP-5526 Added section tag to function start patterns. New thunk patterns in x86 gcc .plt section.  Changed priority of pre analyzer and disassembly.

Files changed:
  M	Ghidra/Processors/x86/certification.manifest
  M	Ghidra/Processors/x86/data/patterns/prepatternconstraints.xml
  A	Ghidra/Processors/x86/data/patterns/x86gcc_prepatterns.xml

[Commit 4/4]
Hash: 18a7f952c89be6951f4b3bf549a54daff5720cfd
Date: 2024-11-08 15:39:42 +0100
Message: Processors: Rename TriCore Siemens to Infineon

Files changed:
  M	Ghidra/Processors/tricore/data/languages/tricore.ldefs
```
2025-09-22 07:32:52 -04:00
auto-updater[bot] adcbfb179f Update Ghidra HEAD to commit 970c8fbdd (#360)
Bump Ghidra HEAD commit 970c8fbdd

Changed files:

```
M	Ghidra/Features/Decompiler/src/decompile/cpp/condexe.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/condexe.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/expression.cc
M	Ghidra/Features/Decompiler/src/decompile/datatests/condexesub.xml
```

Commit details:

```
[Commit 1/1]
Hash: ce09332fcdd011758d23a2505eced5949ffcc253
Date: 2025-09-02 18:17:49 +0000
Message: GP-4214 Allow INT_ADD in the iblock

Files changed:
  M	Ghidra/Features/Decompiler/src/decompile/cpp/condexe.cc
  M	Ghidra/Features/Decompiler/src/decompile/cpp/condexe.hh
  M	Ghidra/Features/Decompiler/src/decompile/cpp/expression.cc
  M	Ghidra/Features/Decompiler/src/decompile/datatests/condexesub.xml
```
2025-09-14 21:00:45 -04:00
dependabot[bot] 64377586f8 build(deps): bump softprops/action-gh-release from 2.3.2 to 2.3.3 (#359)
Bumps [softprops/action-gh-release](https://github.com/softprops/action-gh-release) from 2.3.2 to 2.3.3.
- [Release notes](https://github.com/softprops/action-gh-release/releases)
- [Changelog](https://github.com/softprops/action-gh-release/blob/master/CHANGELOG.md)
- [Commits](https://github.com/softprops/action-gh-release/compare/v2.3.2...v2.3.3)

---
updated-dependencies:
- dependency-name: softprops/action-gh-release
  dependency-version: 2.3.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-09-08 09:36:45 -04:00
auto-updater[bot] 19fcb07d42 Update Ghidra HEAD to commit f501ffccd (#358)
Bump Ghidra HEAD commit f501ffccd

Changed files:

```
M	Ghidra/Features/Decompiler/src/decompile/cpp/coreaction.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/coreaction.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/double.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/op.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/op.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/opbehavior.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/opbehavior.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/typeop.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/typeop.hh
A	Ghidra/Features/Decompiler/src/decompile/datatests/condconst2.xml
A	Ghidra/Features/Decompiler/src/decompile/datatests/condconstsub.xml
M	Ghidra/Processors/x86/data/languages/x86gcc.cspec
```

Commit details:

```
[Commit 1/2]
Hash: e412f13b30b54acdcfb85ae248f53edaac28598f
Date: 2025-08-25 19:09:30 +0000
Message: GP-5950 Add support for multipath conditional constants

Files changed:
  M	Ghidra/Features/Decompiler/src/decompile/cpp/coreaction.cc
  M	Ghidra/Features/Decompiler/src/decompile/cpp/coreaction.hh
  M	Ghidra/Features/Decompiler/src/decompile/cpp/double.cc
  M	Ghidra/Features/Decompiler/src/decompile/cpp/op.cc
  M	Ghidra/Features/Decompiler/src/decompile/cpp/op.hh
  M	Ghidra/Features/Decompiler/src/decompile/cpp/opbehavior.cc
  M	Ghidra/Features/Decompiler/src/decompile/cpp/opbehavior.hh
  M	Ghidra/Features/Decompiler/src/decompile/cpp/typeop.cc
  M	Ghidra/Features/Decompiler/src/decompile/cpp/typeop.hh
  A	Ghidra/Features/Decompiler/src/decompile/datatests/condconst2.xml
  A	Ghidra/Features/Decompiler/src/decompile/datatests/condconstsub.xml

[Commit 2/2]
Hash: 6229740f8b86198d5a32d881c852bc1d448be6ad
Date: 2025-08-27 19:15:30 +0000
Message: GP-5958 added callfixup for get_pc_thunk.di to x86gcc.cspec

Files changed:
  M	Ghidra/Processors/x86/data/languages/x86gcc.cspec
```
2025-09-07 20:47:44 -04:00
dependabot[bot] 24e7a85db6 build(deps): bump actions/setup-python from 5 to 6 (#357)
Bumps [actions/setup-python](https://github.com/actions/setup-python) from 5 to 6.
- [Release notes](https://github.com/actions/setup-python/releases)
- [Commits](https://github.com/actions/setup-python/compare/v5...v6)

---
updated-dependencies:
- dependency-name: actions/setup-python
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-09-04 17:03:51 -04:00
auto-updater[bot] 6b8620a8cf Update Ghidra HEAD to commit 7a4100d54 (#356)
* Add new source files

* Bump Ghidra HEAD commit 7a4100d54

Changed files:

```
M	Ghidra/Features/Decompiler/src/decompile/cpp/Makefile
M	Ghidra/Features/Decompiler/src/decompile/cpp/cast.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/condexe.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/condexe.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/coreaction.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/coreaction.hh
A	Ghidra/Features/Decompiler/src/decompile/cpp/expression.cc
A	Ghidra/Features/Decompiler/src/decompile/cpp/expression.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/fspec.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/fspec.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/jumptable.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/marshal.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/merge.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/modelrules.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/modelrules.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/op.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/op.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/ruleaction.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/ruleaction.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/variable.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/varnode.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/varnode.hh
M	Ghidra/Features/Decompiler/src/decompile/unittests/testparamstore.cc
M	Ghidra/Features/Decompiler/src/decompile/unittests/testtypes.cc
M	Ghidra/Processors/MIPS/certification.manifest
M	Ghidra/Processors/MIPS/data/languages/mips.ldefs
R068	Ghidra/Processors/MIPS/data/languages/mips32be_eabi.cspec	Ghidra/Processors/MIPS/data/languages/mips32_eabi.cspec
M	Ghidra/Processors/MIPS/data/languages/mips32be.cspec
M	Ghidra/Processors/MIPS/data/languages/mips32le.cspec
D	Ghidra/Processors/MIPS/data/languages/mips32le_eabi.cspec
D	Ghidra/Processors/MIPS/data/languages/mips64.cspec
A	Ghidra/Processors/MIPS/data/languages/mips64be.cspec
A	Ghidra/Processors/MIPS/data/languages/mips64le.cspec
M	Ghidra/Processors/PowerPC/certification.manifest
M	Ghidra/Processors/PowerPC/data/languages/SPE_APU.sinc
M	Ghidra/Processors/PowerPC/data/languages/SPE_EFV.sinc
M	Ghidra/Processors/PowerPC/data/languages/evx.sinc
M	Ghidra/Processors/PowerPC/data/languages/ppc.ldefs
R070	Ghidra/Processors/PowerPC/data/languages/ppc_32_le.cspec	Ghidra/Processors/PowerPC/data/languages/ppc_32.cspec
D	Ghidra/Processors/PowerPC/data/languages/ppc_32_be.cspec
M	Ghidra/Processors/PowerPC/data/languages/ppc_32_e500_be.slaspec
M	Ghidra/Processors/PowerPC/data/languages/ppc_32_e500_le.slaspec
M	Ghidra/Processors/PowerPC/data/languages/ppc_32_e500mc_be.slaspec
M	Ghidra/Processors/PowerPC/data/languages/ppc_32_e500mc_le.slaspec
A	Ghidra/Processors/PowerPC/data/languages/ppc_64_be.cspec
R058	Ghidra/Processors/PowerPC/data/languages/ppc_64.cspec	Ghidra/Processors/PowerPC/data/languages/ppc_64_le.cspec
M	Ghidra/Processors/PowerPC/data/languages/ppc_common.sinc
M	Ghidra/Processors/PowerPC/data/languages/ppc_embedded.sinc
M	Ghidra/Processors/PowerPC/data/languages/ppc_vle.sinc
M	Ghidra/Processors/PowerPC/data/patterns/PPC_BE_patterns.xml
M	Ghidra/Processors/PowerPC/data/patterns/PPC_LE_patterns.xml
M	Ghidra/Processors/x86/data/languages/ia.sinc
```

Commit details:

```
[Commit 1/6]
Hash: f6495e4146e7ae5bebe1d4258793618f196eb6fa
Date: 2025-07-15 23:09:23 +0000
Message: GP-5851 Fix tiling truncations for odd data-type sizes in MultiSlotAssign. Fix for big endian multi-slot return value.

Files changed:
  M	Ghidra/Features/Decompiler/src/decompile/cpp/cast.cc
  M	Ghidra/Features/Decompiler/src/decompile/cpp/fspec.cc
  M	Ghidra/Features/Decompiler/src/decompile/cpp/fspec.hh
  M	Ghidra/Features/Decompiler/src/decompile/cpp/modelrules.cc
  M	Ghidra/Features/Decompiler/src/decompile/cpp/modelrules.hh
  M	Ghidra/Features/Decompiler/src/decompile/unittests/testparamstore.cc
  M	Ghidra/Features/Decompiler/src/decompile/unittests/testtypes.cc

[Commit 2/6]
Hash: f391ddb87c88e553b84cc34a696509a01b08e7f5
Date: 2025-08-26 11:59:06 -0400
Message: GP-5945 Fixed PowerPC e500 instruction extension issues and added function start pattern variants.

Files changed:
  M	Ghidra/Processors/PowerPC/data/languages/SPE_APU.sinc
  M	Ghidra/Processors/PowerPC/data/languages/SPE_EFV.sinc
  M	Ghidra/Processors/PowerPC/data/languages/evx.sinc
  M	Ghidra/Processors/PowerPC/data/languages/ppc_32_e500_be.slaspec
  M	Ghidra/Processors/PowerPC/data/languages/ppc_32_e500_le.slaspec
  M	Ghidra/Processors/PowerPC/data/languages/ppc_32_e500mc_be.slaspec
  M	Ghidra/Processors/PowerPC/data/languages/ppc_32_e500mc_le.slaspec
  M	Ghidra/Processors/PowerPC/data/languages/ppc_common.sinc
  M	Ghidra/Processors/PowerPC/data/languages/ppc_embedded.sinc
  M	Ghidra/Processors/PowerPC/data/languages/ppc_vle.sinc
  M	Ghidra/Processors/PowerPC/data/patterns/PPC_BE_patterns.xml
  M	Ghidra/Processors/PowerPC/data/patterns/PPC_LE_patterns.xml

[Commit 3/6]
Hash: 393e7935af660c07e2139f99468f0f32125fae99
Date: 2025-08-26 08:33:50 -0400
Message: GP-5906: Added x86 SSE4a instructions

Files changed:
  M	Ghidra/Processors/x86/data/languages/ia.sinc

[Commit 4/6]
Hash: d9a5ad2ed0bd888fa950ccf1bf16cf9b6f8211e4
Date: 2025-08-25 19:31:22 +0000
Message: GP-4029 updated mips and ppc language versions

Files changed:
  M	Ghidra/Processors/MIPS/data/languages/mips.ldefs
  M	Ghidra/Processors/PowerPC/data/languages/ppc.ldefs

[Commit 5/6]
Hash: d91aebe74e801d49bf9d37805256e60db465a8d3
Date: 2025-02-25 20:50:19 +0000
Message: GP-4030: Fix MIPS base and eabi 32/64-bit cspecs GP-4029: Update base PowerPC 32/64-bit cspecs

Files changed:
  M	Ghidra/Features/Decompiler/src/decompile/cpp/fspec.cc
  M	Ghidra/Features/Decompiler/src/decompile/cpp/fspec.hh
  M	Ghidra/Features/Decompiler/src/decompile/cpp/marshal.cc
  M	Ghidra/Features/Decompiler/src/decompile/cpp/modelrules.cc
  M	Ghidra/Features/Decompiler/src/decompile/cpp/modelrules.hh
  M	Ghidra/Processors/MIPS/certification.manifest
  M	Ghidra/Processors/MIPS/data/languages/mips.ldefs
  A	Ghidra/Processors/MIPS/data/languages/mips32_eabi.cspec
  M	Ghidra/Processors/MIPS/data/languages/mips32be.cspec
  D	Ghidra/Processors/MIPS/data/languages/mips32be_eabi.cspec
  M	Ghidra/Processors/MIPS/data/languages/mips32le.cspec
  D	Ghidra/Processors/MIPS/data/languages/mips32le_eabi.cspec
  D	Ghidra/Processors/MIPS/data/languages/mips64.cspec
  A	Ghidra/Processors/MIPS/data/languages/mips64be.cspec
  A	Ghidra/Processors/MIPS/data/languages/mips64le.cspec
  M	Ghidra/Processors/PowerPC/certification.manifest
  M	Ghidra/Processors/PowerPC/data/languages/ppc.ldefs
  A	Ghidra/Processors/PowerPC/data/languages/ppc_32.cspec
  D	Ghidra/Processors/PowerPC/data/languages/ppc_32_be.cspec
  D	Ghidra/Processors/PowerPC/data/languages/ppc_32_le.cspec
  D	Ghidra/Processors/PowerPC/data/languages/ppc_64.cspec
  A	Ghidra/Processors/PowerPC/data/languages/ppc_64_be.cspec
  A	Ghidra/Processors/PowerPC/data/languages/ppc_64_le.cspec

[Commit 6/6]
Hash: 8217593e87635153066b8ea7a11d19e1ea02a555
Date: 2025-08-18 23:21:42 +0000
Message: GP-5934 Fix handling of integer minimum in SBORROW, SLESS rules, add SCARRY rule.

Files changed:
  M	Ghidra/Features/Decompiler/src/decompile/cpp/Makefile
  M	Ghidra/Features/Decompiler/src/decompile/cpp/condexe.cc
  M	Ghidra/Features/Decompiler/src/decompile/cpp/condexe.hh
  M	Ghidra/Features/Decompiler/src/decompile/cpp/coreaction.cc
  M	Ghidra/Features/Decompiler/src/decompile/cpp/coreaction.hh
  A	Ghidra/Features/Decompiler/src/decompile/cpp/expression.cc
  A	Ghidra/Features/Decompiler/src/decompile/cpp/expression.hh
  M	Ghidra/Features/Decompiler/src/decompile/cpp/jumptable.hh
  M	Ghidra/Features/Decompiler/src/decompile/cpp/merge.hh
  M	Ghidra/Features/Decompiler/src/decompile/cpp/op.cc
  M	Ghidra/Features/Decompiler/src/decompile/cpp/op.hh
  M	Ghidra/Features/Decompiler/src/decompile/cpp/ruleaction.cc
  M	Ghidra/Features/Decompiler/src/decompile/cpp/ruleaction.hh
  M	Ghidra/Features/Decompiler/src/decompile/cpp/variable.cc
  M	Ghidra/Features/Decompiler/src/decompile/cpp/varnode.cc
  M	Ghidra/Features/Decompiler/src/decompile/cpp/varnode.hh
```

---------

Co-authored-by: Eric Kilmer <eric.d.kilmer@gmail.com>
2025-09-04 17:02:56 -04:00
Eric Kilmer f398228901 Ghidra 11.4.2 (#355)
* Update spec files list
2025-08-27 15:18:17 -04:00
auto-updater[bot] d0d9bf5a67 Update Ghidra HEAD to commit 4fcc1febd (#354)
Bump Ghidra HEAD commit 4fcc1febd

Changed files:

```
M	Ghidra/Features/Decompiler/src/decompile/cpp/condexe.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/condexe.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/coreaction.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/coreaction.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/jumptable.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/jumptable.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/pcodecompile.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/semantics.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/semantics.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/slgh_compile.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/slgh_compile.hh
A	Ghidra/Features/Decompiler/src/decompile/datatests/condexesub.xml
M	Ghidra/Processors/8051/data/languages/80251.sinc
M	Ghidra/Processors/8051/data/languages/8051_main.sinc
M	Ghidra/Processors/AARCH64/data/languages/AARCH64_swift.cspec
M	Ghidra/Processors/MCS96/data/languages/MCS96.sinc
M	Ghidra/Processors/PIC/data/languages/PIC24.sinc
M	Ghidra/Processors/PowerPC/data/languages/SPE_APU.sinc
M	Ghidra/Processors/PowerPC/data/languages/altivec.sinc
M	Ghidra/Processors/SuperH/data/languages/superh.cspec
M	Ghidra/Processors/SuperH/data/languages/superh2a.cspec
M	Ghidra/Processors/x86/data/languages/x86-64-swift.cspec
```

Commit details:

```
[Commit 1/7]
Hash: 3abf7f765e6d045d152589a7f73c8b4fea6c35a5
Date: 2025-08-21 06:42:41 -0400
Message: GP-0: Updating Swift documentation links

Files changed:
  M	Ghidra/Processors/AARCH64/data/languages/AARCH64_swift.cspec
  M	Ghidra/Processors/x86/data/languages/x86-64-swift.cspec

[Commit 2/7]
Hash: 42115f6df02329a745a3878aafa96439088deaf0
Date: 2025-08-18 17:12:23 +0000
Message: GP-5581: Allow optimization by truncation of subpieced unique varnodes.

Files changed:
  M	Ghidra/Features/Decompiler/src/decompile/cpp/pcodecompile.cc
  M	Ghidra/Features/Decompiler/src/decompile/cpp/semantics.cc
  M	Ghidra/Features/Decompiler/src/decompile/cpp/semantics.hh
  M	Ghidra/Features/Decompiler/src/decompile/cpp/slgh_compile.cc
  M	Ghidra/Features/Decompiler/src/decompile/cpp/slgh_compile.hh
  M	Ghidra/Processors/MCS96/data/languages/MCS96.sinc
  M	Ghidra/Processors/PIC/data/languages/PIC24.sinc
  M	Ghidra/Processors/PowerPC/data/languages/SPE_APU.sinc
  M	Ghidra/Processors/PowerPC/data/languages/altivec.sinc

[Commit 3/7]
Hash: bb19782c35fd087d636f1dd5e41f9c5c02ac94ce
Date: 2025-08-11 20:27:21 +0000
Message: GP-5927 Add support for SUBPIECE removal in ConditionalExecution

Files changed:
  M	Ghidra/Features/Decompiler/src/decompile/cpp/condexe.cc
  M	Ghidra/Features/Decompiler/src/decompile/cpp/condexe.hh
  M	Ghidra/Features/Decompiler/src/decompile/cpp/coreaction.cc
  M	Ghidra/Features/Decompiler/src/decompile/cpp/coreaction.hh
  A	Ghidra/Features/Decompiler/src/decompile/datatests/condexesub.xml

[Commit 4/7]
Hash: 9c9938e0662fa3b5cb48a79a10bf5e53edddb19b
Date: 2025-07-30 19:32:34 +0000
Message: GP-5889 Check for common source in duplicated switch guard detection

Files changed:
  M	Ghidra/Features/Decompiler/src/decompile/cpp/coreaction.cc
  M	Ghidra/Features/Decompiler/src/decompile/cpp/coreaction.hh
  M	Ghidra/Features/Decompiler/src/decompile/cpp/jumptable.cc
  M	Ghidra/Features/Decompiler/src/decompile/cpp/jumptable.hh

[Commit 5/7]
Hash: 28313c6574c61da69299fda185b884e2c785d7c1
Date: 2025-08-07 12:44:05 +0000
Message: GP-5912 Adding SH2 GBR register to the preserved by call list

Files changed:
  M	Ghidra/Processors/SuperH/data/languages/superh.cspec
  M	Ghidra/Processors/SuperH/data/languages/superh2a.cspec

[Commit 6/7]
Hash: e7cad294c9b0a19ec9d74ef733e31451fb47c468
Date: 2025-07-29 14:59:32 +0100
Message: Fix 80251 "ANL Rm,#data" showing as "ADD"
Details:
Should be self explanatory, looks like it was just a typo.

Files changed:
  M	Ghidra/Processors/8051/data/languages/80251.sinc

[Commit 7/7]
Hash: cca3fcc208f9f1f8f69f60ed58dd470f976bddf0
Date: 2025-07-29 14:57:07 +0100
Message: Fix ANL Areg,Data for 80251 in source mode
Details:
ANL Areg,Data should be GROUP1 rather than GROUP2, the incorrect group causes the instruction to fail to decode on source mode 80251

Files changed:
  M	Ghidra/Processors/8051/data/languages/8051_main.sinc
```
2025-08-26 17:05:38 -04:00
auto-updater[bot] 632fa35e36 Update Ghidra HEAD to commit 98b938cc6 (#353)
Bump Ghidra HEAD commit 98b938cc6

Changed files:

```
M	Ghidra/Features/Decompiler/src/decompile/cpp/block.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/block.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/blockaction.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/typeop.cc
M	Ghidra/Processors/x86/data/languages/x86-64.dwarf
M	Ghidra/Processors/x86/data/languages/x86.dwarf
```

Commit details:

```
[Commit 1/2]
Hash: e908ab6fbf4311f99fa86d50b60aa4802a6e3fd6
Date: 2025-08-11 11:21:28 -0400
Message: DWARF expression handling refactor
Details:
Cleanup logic of expression evaluation, stub out resolution of register
values to a callback in case we want to use constant propagation to try
to allow successful calculations, and add support for default static
values for treating an arch's stack frame register (e.g. RBP) like the
static CFA value we already have support for.

Add option to decorate params and local vars with their DWARF storage
location info.

Handle arrays with unspecified element type.

Files changed:
  M	Ghidra/Processors/x86/data/languages/x86-64.dwarf
  M	Ghidra/Processors/x86/data/languages/x86.dwarf

[Commit 2/2]
Hash: 29b7cb655283c124b4d999e8b3d45c58e7004b69
Date: 2025-08-07 15:19:32 +0000
Message: GP-5915 Fix bug in ConditionalJoin

Files changed:
  M	Ghidra/Features/Decompiler/src/decompile/cpp/block.cc
  M	Ghidra/Features/Decompiler/src/decompile/cpp/block.hh
  M	Ghidra/Features/Decompiler/src/decompile/cpp/blockaction.cc
  M	Ghidra/Features/Decompiler/src/decompile/cpp/typeop.cc
```
2025-08-18 09:24:31 -04:00
auto-updater[bot] e925db971d Update Ghidra HEAD to commit 42794bc3f (#351)
* Fix some patches and rename test binary

* Bump Ghidra HEAD commit 42794bc3f

Changed files:

```
M	Ghidra/Features/Decompiler/src/decompile/cpp/.gitignore
M	Ghidra/Features/Decompiler/src/decompile/cpp/Makefile
M	Ghidra/Features/Decompiler/src/decompile/cpp/address.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/address.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/coreaction.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/fspec.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/funcdata_varnode.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/heritage.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/jumptable.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/op.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/opbehavior.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/ruleaction.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/slghsymbol.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/stringmanage.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/subflow.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/transform.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/type.cc
```

Commit details:

```
[Commit 1/1]
Hash: 943ccd322ddc280cd28cb7cb6ef8328941c3d574
Date: 2025-07-23 22:49:35 +0000
Message: GP-5869 Fix for some out of bounds array indices and shift amounts

Files changed:
  M	Ghidra/Features/Decompiler/src/decompile/cpp/.gitignore
  M	Ghidra/Features/Decompiler/src/decompile/cpp/Makefile
  M	Ghidra/Features/Decompiler/src/decompile/cpp/address.cc
  M	Ghidra/Features/Decompiler/src/decompile/cpp/address.hh
  M	Ghidra/Features/Decompiler/src/decompile/cpp/coreaction.cc
  M	Ghidra/Features/Decompiler/src/decompile/cpp/fspec.cc
  M	Ghidra/Features/Decompiler/src/decompile/cpp/funcdata_varnode.cc
  M	Ghidra/Features/Decompiler/src/decompile/cpp/heritage.cc
  M	Ghidra/Features/Decompiler/src/decompile/cpp/jumptable.cc
  M	Ghidra/Features/Decompiler/src/decompile/cpp/op.cc
  M	Ghidra/Features/Decompiler/src/decompile/cpp/opbehavior.cc
  M	Ghidra/Features/Decompiler/src/decompile/cpp/ruleaction.cc
  M	Ghidra/Features/Decompiler/src/decompile/cpp/slghsymbol.cc
  M	Ghidra/Features/Decompiler/src/decompile/cpp/stringmanage.cc
  M	Ghidra/Features/Decompiler/src/decompile/cpp/subflow.cc
  M	Ghidra/Features/Decompiler/src/decompile/cpp/transform.cc
  M	Ghidra/Features/Decompiler/src/decompile/cpp/type.cc
```

---------

Co-authored-by: Eric Kilmer <eric.d.kilmer@gmail.com>
2025-08-12 21:29:48 -04:00
dependabot[bot] e590133fc7 build(deps): bump actions/checkout from 4 to 5 (#352)
Bumps [actions/checkout](https://github.com/actions/checkout) from 4 to 5.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v4...v5)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-08-12 13:05:37 -04:00
auto-updater[bot] 760a315270 Update Ghidra HEAD to commit 0a97fd8fe (#350)
Bump Ghidra HEAD commit 0a97fd8fe

Changed files:

```
M	Ghidra/Processors/ARM/data/languages/ARMneon.sinc
M	Ghidra/Processors/HCS08/data/languages/HCS_HC.sinc
M	Ghidra/Processors/MC6800/data/languages/6805.slaspec
M	Ghidra/Processors/SuperH4/data/languages/SuperH4.sinc
M	Ghidra/Processors/SuperH4/data/languages/SuperH4_le.cspec
M	Ghidra/Processors/Toy/certification.manifest
M	Ghidra/Processors/Toy/data/languages/toy.ldefs
M	Ghidra/Processors/Toy/data/languages/toy.sinc
A	Ghidra/Processors/Toy/data/languages/toy64_be_harvard_rev.slaspec
M	Ghidra/Processors/eBPF/certification.manifest
M	Ghidra/Processors/eBPF/data/languages/eBPF.ldefs
M	Ghidra/Processors/eBPF/data/languages/eBPF.opinion
M	Ghidra/Processors/eBPF/data/languages/eBPF.sinc
A	Ghidra/Processors/eBPF/data/languages/eBPF_be.slaspec
M	Ghidra/Processors/eBPF/data/languages/eBPF_le.slaspec
M	Ghidra/Processors/x86/data/languages/avx512.sinc
M	Ghidra/Processors/x86/data/languages/ia.sinc
```

Commit details:

```
[Commit 1/15]
Hash: 352fed0d953aacf3ee6304516b4679c134c9a0f5
Date: 2025-07-29 14:32:54 +0000
Message: GP-5853: Initial implementation of ARM Neon VLD/VSTn instructions.

Files changed:
  M	Ghidra/Processors/ARM/data/languages/ARMneon.sinc

[Commit 2/15]
Hash: 4abf6d55ad54a91afb9adf5e9e122302e4ca10f8
Date: 2025-07-29 07:12:56 -0400
Message: GP-5766: Fixed instruction AVX512 disassembly errors

Files changed:
  M	Ghidra/Processors/x86/data/languages/avx512.sinc
  M	Ghidra/Processors/x86/data/languages/ia.sinc

[Commit 3/15]
Hash: 24d19f6e8c31c038345fb33d3a957fe990222ea2
Date: 2025-04-04 17:54:31 +0200
Message: Add eBPF ISA v4 instructions
Details:
In 2023, the eBPF instruction set was modified to add several
instructions related to signed operations (load with sign-extension,
signed division, etc.), a 32-bit jump instruction and some byte-swap
instructions. This became version 4 of eBPF ISA.

Here are some references about this change:

- https://pchaigno.github.io/bpf/2021/10/20/ebpf-instruction-sets.html
  (a blog post about eBPF instruction set extensions)
- https://lore.kernel.org/bpf/4bfe98be-5333-1c7e-2f6d-42486c8ec039@meta.com/
  (documentation sent to Linux Kernel mailing list)
- https://www.rfc-editor.org/rfc/rfc9669.html#name-sign-extension-load-operati
  (IETF's BPF Instruction Set Architecture standard defined the new
  instructions)
- https://web.git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/kernel/bpf/core.c?h=v6.14#n1859
  (implementation of signed division and remainder in Linux kernel.
  This shows that 32-bit signed DIV and signed MOD are zero-extending
  the result in DST)
- https://web.git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/kernel/bpf/core.c?h=v6.14#n2135
  (implementation of signed memory load in Linux kernel)
- https://web.git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=1f9a1ea821ff25353a0e80d971e7958cd55b47a3
  (commit which added signed memory load instructions in Linux kernel)

This can be tested with a recent enough version of clang and LLVM (this
works with clang 19.1.4 on Alpine 3.21).
For example for signed memory load instructions:

    signed int sext_8bit(signed char x) {
        return x;
    }

produces:

    $ clang -O0 -target bpf -mcpu=v4 -c test.c -o test.ebpf
    $ llvm-objdump -rd test.ebpf
    ...
    0000000000000000 <sext_8bit>:
           0:  73 1a ff ff 00 00 00 00  *(u8 *)(r10 - 0x1) = r1
           1:  91 a1 ff ff 00 00 00 00  r1 = *(s8 *)(r10 - 0x1)
           2:  bc 10 00 00 00 00 00 00  w0 = w1
           3:  95 00 00 00 00 00 00 00  exit

(The second instruction is a signed memory load)

Instruction MOVS (Sign extend register MOV) uses offset to encode the
conversion (whether the source register is to be considered as signed
8-bit, 16-bit or 32-bit integer). The mnemonic for these instructions is
quite unclear:

- They are all named MOVS in the proposal
  https://lore.kernel.org/bpf/4bfe98be-5333-1c7e-2f6d-42486c8ec039@meta.com/
- LLVM and Linux disassemblers only display pseudo-code (`r0 = (s8)r1`)
- RFC 9669 (https://datatracker.ietf.org/doc/rfc9669/) uses MOVSX for
  all instructions.
- GCC uses MOVS for all instructions:
  https://github.com/gcc-mirror/gcc/blob/releases/gcc-14.1.0/gcc/config/bpf/bpf.md?plain=1#L326-L365

To make the disassembled code clearer, decode such instructions with a
size suffix: MOVSB, MOVSH, MOVSW.

The decoding of instructions 32-bit JA, BSWAP16, BSWAP32 and BSWAP64 is
straightforward.

Files changed:
  M	Ghidra/Processors/eBPF/data/languages/eBPF.sinc

[Commit 4/15]
Hash: 39c0a83c0c4540b0776ef2e8fd8c2c7fb966d55c
Date: 2025-07-28 15:48:40 +0000
Message: GP-5877: Fix Patch Instruction action in some Harvard architectures.

Files changed:
  M	Ghidra/Processors/Toy/certification.manifest
  M	Ghidra/Processors/Toy/data/languages/toy.ldefs
  M	Ghidra/Processors/Toy/data/languages/toy.sinc
  A	Ghidra/Processors/Toy/data/languages/toy64_be_harvard_rev.slaspec

[Commit 5/15]
Hash: e2de11d5b284d17828b5513678d2de2a1c775cfe
Date: 2025-04-03 16:48:48 +0200
Message: Fix eBPF zero-extend load instructions
Details:
When a loading less than 8 bytes to a register, the value is supposed to
be zero-extended. This is what the eBPF execution engine in the Linux
kernel does, in
https://web.git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/kernel/bpf/core.c?h=v6.14#n2113
This is also what is specified in RFC 9669 which standardised BPF ISA:
https://www.rfc-editor.org/rfc/rfc9669.html#name-regular-load-and-store-oper

Add the missing `zext` calls in the semantic section of instructions
LDXW, LDXH and LDXB. While at it, add them to other load instructions.

For information, the issue can be seen when analyzing this C program:

    unsigned int div_by_1000(unsigned int value) {
        return value / 1000;
    }

Compiling it with clang gives:

    $ clang -O0 -target bpf -c division.c -o division.ebpf
    $ bpf-objdump -rd division.ebpf
    division.ebpf:     file format elf64-bpfle

    Disassembly of section .text:

    0000000000000000 <div_by_1000>:
       0:    63 1a fc ff 00 00 00 00     stxw [%fp+-4],%r1
       8:    61 a0 fc ff 00 00 00 00     ldxw %r0,[%fp+-4]
      10:    37 00 00 00 e8 03 00 00     div %r0,0x3e8
      18:    95 00 00 00 00 00 00 00     exit

Ghidra decompiles this program as:

    ulonglong div_by_1000(uint param_1)
    {
      undefined4 in_stack_00000000;
      return CONCAT44(in_stack_00000000,param_1) / 1000;
    }

This `in_stack_00000000` comes from the way the parameter is loaded from
the stack. The listing shows the following disassembly and p-code
operations:

    ram:00100008 61 a0 fc ff 00       LDXW       R0,[R10 + -0x4=>Stack[-0x4]]
                 00 00 00
                            $U3e00:8 = INT_ADD R10, -4:8
                            R0 = LOAD ram($U3e00:8)

This shows the value is indeed loaded from 8 bytes at `$U3e00:8` instead
of 4.

After adding `zext` calls, Ghidra decodes the same instruction as:

    ram:00100008 61 a0 fc ff 00       LDXW       R0,[R10 + -0x4=>local_4]
                 00 00 00
                            $U4100:8 = INT_ADD R10, -4:8
                            $U4180:4 = LOAD ram($U4100:8)
                            R0 = INT_ZEXT $U4180:4

This only loads 4 bytes from the stack, as expected.
Moreover the decompilation view is now correct:

    ulonglong div_by_1000(uint param_1)
    {
      return (ulonglong)param_1 / 1000;
    }

Files changed:
  M	Ghidra/Processors/eBPF/data/languages/eBPF.sinc

[Commit 6/15]
Hash: c1d96a214049944549c6429f994907f19de72acb
Date: 2025-03-18 22:24:23 +0100
Message: Fix eBPF CALL operand decoding
Details:
The operand of the CALL instruction missed multiplying the immediate
value by 8. Without this, calls are not decoded correctly.

Such a CALL instruction can be emitted when compiling this simple
`single_call.c` program:

    static int one(void) {
        return 1;
    }

    int call_one(void) {
        return one();
    }

with:

    clang -O0 -target bpf -c single_call.c -o single_call.ebpf

Disassembling with LLVM shows:

    $ llvm-objdump -d single_call.ebpf
    single_call.ebpf:	file format elf64-bpf

    Disassembly of section .text:

    0000000000000000 <call_one>:
           0:	85 10 00 00 01 00 00 00	call 1
           1:	95 00 00 00 00 00 00 00	exit

    0000000000000010 <one>:
           2:	b7 00 00 00 01 00 00 00	r0 = 1
           3:	95 00 00 00 00 00 00 00	exit

The first instruction ("call 1") calls the function located at 0x10 (at
index `2:` in the listing). Ghidra considered the call to target
address 9 instead (as `inst_next = 8` and `imm = 1`). Fix this by
multiplying `imm` by 8 when encountering a `disp32` operand (which is
only used by instruction `CALL`).

Adjust ELF Relocation R_BPF_64_32 to take into account for this
multiplication by 8. Actually it is documented to compute (S + A) / 8 - 1
so the division by 8 was missing.

Files changed:
  M	Ghidra/Processors/eBPF/data/languages/eBPF.sinc

[Commit 7/15]
Hash: adb0eac98aacb8b26d0f935e3f10974482d626a8
Date: 2025-05-07 15:40:24 +0200
Message: Add support for big endian eBPF programs

Files changed:
  M	Ghidra/Processors/eBPF/certification.manifest
  M	Ghidra/Processors/eBPF/data/languages/eBPF.ldefs
  M	Ghidra/Processors/eBPF/data/languages/eBPF.opinion
  M	Ghidra/Processors/eBPF/data/languages/eBPF.sinc
  A	Ghidra/Processors/eBPF/data/languages/eBPF_be.slaspec

[Commit 8/15]
Hash: 52cb7a36e685af547f0e2cc9782dc46755764c51
Date: 2025-04-04 22:00:34 +0200
Message: Fix the semantics of eBPF byte swap instructions
Details:
eBPF byte swap operations (BE16, BE32, BE64, LE16, LE32, LE64) have
semantics that depend on the endianness of the host processor executing
the eBPF program. For example, on a Little-Endian CPU, BE16 swaps the 2
lowest significant bytes of the given destination register.

The semantic section of LE16 contains:

    { dst=((dst) >> 8) | ((dst) << 8); }

This contains several issues:

- It assumes the instruction always swaps the bytes. This should only
  happen on Big-Endian host CPU.
- If `dst` does not contain a 16-bit value (meaning `dst >> 16 != 0`),
  the computed value is wrong. The value should be properly masked. For
  example the Linux kernel defines in
  https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/include/uapi/linux/swab.h?h=v6.14#L14

    #define ___constant_swab16(x) ((__u16)(             \
            (((__u16)(x) & (__u16)0x00ffU) << 8) |      \
            (((__u16)(x) & (__u16)0xff00U) >> 8)))

As the endianness of the CPU has to be the same as the eBPF program
(defined in the ELF header), introduce a macro `ENDIAN` and use it to
implement the byte swap operations.

Files changed:
  M	Ghidra/Processors/eBPF/data/languages/eBPF.sinc
  M	Ghidra/Processors/eBPF/data/languages/eBPF_le.slaspec

[Commit 9/15]
Hash: 997c64f6db8bc50c4f02f15a29d88f02a2dfeadc
Date: 2025-06-16 14:29:10 +0000
Message: GP-5759: Fixed token piece formatting

Files changed:
  M	Ghidra/Processors/SuperH4/data/languages/SuperH4.sinc

[Commit 10/15]
Hash: 24c0699a38246fea7e32900d54d2cfa3ae42358a
Date: 2025-05-23 15:08:01 +0300
Message: SuperH4: fix FSCA opcode destination location

Files changed:
  M	Ghidra/Processors/SuperH4/data/languages/SuperH4.sinc

[Commit 11/15]
Hash: 53d7e1608f5aeb680c53a08cf2a28ff932df5f19
Date: 2025-05-23 15:03:55 +0300
Message: SuperH4: fix fpu registers order

Files changed:
  M	Ghidra/Processors/SuperH4/data/languages/SuperH4_le.cspec

[Commit 12/15]
Hash: c86d9069c577f7a88f7ab59da1113fdd14ad7ff0
Date: 2024-10-29 19:31:21 +0000
Message: Update 6805.slaspec

Files changed:
  M	Ghidra/Processors/MC6800/data/languages/6805.slaspec

[Commit 13/15]
Hash: e04e47a7454df0c0e489e81311c8592ac418f279
Date: 2024-10-29 19:25:20 +0000
Message: Update HCS_HC.sinc
Details:
Incorporate fixes from PR

Files changed:
  M	Ghidra/Processors/HCS08/data/languages/HCS_HC.sinc

[Commit 14/15]
Hash: 67bfea173fc03dae728c07cc468e51e360b14367
Date: 2024-10-17 01:24:10 +0100
Message: Update HCS_HC.sinc
Details:
Fixes https://github.com/NationalSecurityAgency/ghidra/issues/7064 for 68HC05

Files changed:
  M	Ghidra/Processors/HCS08/data/languages/HCS_HC.sinc

[Commit 15/15]
Hash: 270e6867dbd0c6767acadae4ceecfd1728afe88a
Date: 2024-10-17 00:10:26 +0100
Message: Update 6805.slaspec
Details:
Fix for https://github.com/NationalSecurityAgency/ghidra/issues/7064 (incorrect handling of X-indexed JMP and JSR)

Files changed:
  M	Ghidra/Processors/MC6800/data/languages/6805.slaspec
```
2025-08-04 13:36:05 -04:00
Eric Kilmer bf13fdebba Ghidra 11.4.1 (#349) 2025-08-01 17:59:24 +00:00
auto-updater[bot] a49bbcc9cf Update Ghidra HEAD to commit 7e6c01f28 (#348)
Bump Ghidra HEAD commit 7e6c01f28

Changed files:

```
M	Ghidra/Features/Decompiler/src/decompile/cpp/coreaction.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/flow.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/flow.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/funcdata.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/funcdata_op.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/ruleaction.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/type.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/varnode.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/varnode.hh
A	Ghidra/Features/Decompiler/src/decompile/datatests/inlinetarget.xml
M	Ghidra/Processors/MIPS/data/patterns/MIPS_BE_patterns.xml
M	Ghidra/Processors/MIPS/data/patterns/MIPS_LE_patterns.xml
```

Commit details:

```
[Commit 1/5]
Hash: fc4b7800251f59395e1ddc9bb85e932c69e00a65
Date: 2025-06-04 19:56:49 +0000
Message: GP-5736 prevent constant propagation from making RETURN inputs constant (Closes #8183)

Files changed:
  M	Ghidra/Features/Decompiler/src/decompile/cpp/coreaction.cc

[Commit 2/5]
Hash: cc0203307d6b0347cae04f4794798633e36567af
Date: 2025-07-23 17:31:18 +0000
Message: GP-5863 Check for input intersection before creating unreferenced param

Files changed:
  M	Ghidra/Features/Decompiler/src/decompile/cpp/coreaction.cc
  M	Ghidra/Features/Decompiler/src/decompile/cpp/funcdata.hh
  M	Ghidra/Features/Decompiler/src/decompile/cpp/ruleaction.cc
  M	Ghidra/Features/Decompiler/src/decompile/cpp/varnode.cc
  M	Ghidra/Features/Decompiler/src/decompile/cpp/varnode.hh

[Commit 3/5]
Hash: c4c7aa5dad6eb651e76d86d0d1a7a5c2ad6ded61
Date: 2025-07-21 19:40:05 +0000
Message: Fix for infinite loop caused by RulePtrsubUndo

Files changed:
  M	Ghidra/Features/Decompiler/src/decompile/cpp/type.cc

[Commit 4/5]
Hash: 3468c4b5025ff936080e56163b4fc155a538ed83
Date: 2025-07-17 22:42:00 +0000
Message: GP-5843 Added MIPS64 function start patterns

Files changed:
  M	Ghidra/Processors/MIPS/data/patterns/MIPS_BE_patterns.xml
  M	Ghidra/Processors/MIPS/data/patterns/MIPS_LE_patterns.xml

[Commit 5/5]
Hash: 80d66023a974d775e97f770b826d800c1de42461
Date: 2025-07-16 18:29:53 +0000
Message: GP-5832 Update inline target op when inlining a subfunction

Files changed:
  M	Ghidra/Features/Decompiler/src/decompile/cpp/flow.cc
  M	Ghidra/Features/Decompiler/src/decompile/cpp/flow.hh
  M	Ghidra/Features/Decompiler/src/decompile/cpp/funcdata_op.cc
  A	Ghidra/Features/Decompiler/src/decompile/datatests/inlinetarget.xml
```

Co-authored-by: pgoodman <43664+pgoodman@users.noreply.github.com>
2025-07-28 10:16:54 -04:00
auto-updater[bot] 1f41ff02e6 Update Ghidra HEAD to commit 12a8db619 (#347)
Bump Ghidra HEAD commit 12a8db619

Changed files:

```
M	Ghidra/Features/Decompiler/src/decompile/cpp/fspec.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/marshal.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/modelrules.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/modelrules.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/subflow.cc
M	Ghidra/Processors/ARM/data/languages/ARM.cspec
M	Ghidra/Processors/ARM/data/languages/ARM_win.cspec
M	Ghidra/Processors/Atmel/data/languages/avr8gcc.cspec
M	Ghidra/Processors/RISCV/data/languages/riscv32-fp.cspec
M	Ghidra/Processors/RISCV/data/languages/riscv32.cspec
M	Ghidra/Processors/RISCV/data/languages/riscv64-fp.cspec
M	Ghidra/Processors/RISCV/data/languages/riscv64.cspec
```

Commit details:

```
[Commit 1/5]
Hash: 991a4b440c6fe2073ede634359afff2da8e174c8
Date: 2025-07-16 20:22:28 +0000
Message: GP-4356: fixes to avr8 cspec and elf extension, and additions to decompiler model rules

Files changed:
  M	Ghidra/Features/Decompiler/src/decompile/cpp/fspec.cc
  M	Ghidra/Features/Decompiler/src/decompile/cpp/marshal.cc
  M	Ghidra/Features/Decompiler/src/decompile/cpp/modelrules.cc
  M	Ghidra/Features/Decompiler/src/decompile/cpp/modelrules.hh
  M	Ghidra/Processors/Atmel/data/languages/avr8gcc.cspec

[Commit 2/5]
Hash: f26d36c6bb961271fe7fd77a734bd4010c6a210c
Date: 2025-07-16 16:38:27 +0000
Message: GP-5211: Fix RISCV 32- and 64-bit compiler specifications and relocation handler

Files changed:
  M	Ghidra/Processors/RISCV/data/languages/riscv32-fp.cspec
  M	Ghidra/Processors/RISCV/data/languages/riscv32.cspec
  M	Ghidra/Processors/RISCV/data/languages/riscv64-fp.cspec
  M	Ghidra/Processors/RISCV/data/languages/riscv64.cspec

[Commit 3/5]
Hash: 3e117157787f79f842f72d82641426ab9d4b9a28
Date: 2025-07-14 18:38:17 +0000
Message: GP-4989: Fix ARM AAPCS cspec, add soft float calling convention

Files changed:
  M	Ghidra/Processors/ARM/data/languages/ARM.cspec
  M	Ghidra/Processors/ARM/data/languages/ARM_win.cspec

[Commit 4/5]
Hash: 3067d3e61f98d195060be8c2ee65922d16bd29f6
Date: 2025-07-14 17:21:02 +0000
Message: GP-5367: Filter by max_primitives on homogeneous aggregate types in cspec

Files changed:
  M	Ghidra/Features/Decompiler/src/decompile/cpp/marshal.cc
  M	Ghidra/Features/Decompiler/src/decompile/cpp/modelrules.cc
  M	Ghidra/Features/Decompiler/src/decompile/cpp/modelrules.hh

[Commit 5/5]
Hash: b3f4609330128138f3246359bdb834ac7604e81d
Date: 2025-05-23 19:10:25 +0000
Message: GP-5718 fix for index issue

Files changed:
  M	Ghidra/Features/Decompiler/src/decompile/cpp/subflow.cc
```
2025-07-21 09:02:43 -04:00
auto-updater[bot] 060f42d28c Update Ghidra HEAD to commit e63d97b11 (#346)
* ci: Enforce passing tests on HEAD

* Bump Ghidra HEAD commit e63d97b11

Changed files:

```
M	Ghidra/Features/Decompiler/src/decompile/cpp/Doxyfile
M	Ghidra/Features/Decompiler/src/decompile/cpp/inject_sleigh.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/inject_sleigh.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/ruleaction.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/varnode.cc
M	Ghidra/Features/Decompiler/src/decompile/datatests/retstruct.xml
M	Ghidra/Processors/AARCH64/data/languages/AARCH64.cspec
M	Ghidra/Processors/AARCH64/data/languages/AARCH64_win.cspec
```

Commit details:

```
[Commit 1/1]
Hash: de842dbd32b0f27d9d7f222f039f6c8ebfa87598
Date: 2025-07-09 21:14:59 +0000
Message: GP-5816 Fix return recovery for AARCH64 and ARM

Files changed:
  M	Ghidra/Features/Decompiler/src/decompile/cpp/Doxyfile
  M	Ghidra/Features/Decompiler/src/decompile/cpp/inject_sleigh.cc
  M	Ghidra/Features/Decompiler/src/decompile/cpp/inject_sleigh.hh
  M	Ghidra/Features/Decompiler/src/decompile/cpp/ruleaction.cc
  M	Ghidra/Features/Decompiler/src/decompile/cpp/varnode.cc
  M	Ghidra/Features/Decompiler/src/decompile/datatests/retstruct.xml
  M	Ghidra/Processors/AARCH64/data/languages/AARCH64.cspec
  M	Ghidra/Processors/AARCH64/data/languages/AARCH64_win.cspec
```

---------

Co-authored-by: Eric Kilmer <eric.d.kilmer@gmail.com>
2025-07-19 17:39:08 -04:00
Eric Kilmer eadedecf28 Ghidra 11.4 (#345)
* Backport patch to fix datatests/restruct.xml test
2025-07-18 12:37:14 -04:00
auto-updater[bot] 7807d6619a Update Ghidra HEAD to commit 8c48d9f11 (#343)
Bump Ghidra HEAD commit 8c48d9f11

Changed files:

```
M	Ghidra/Processors/AARCH64/data/languages/AARCH64instructions.sinc
M	Ghidra/Processors/AARCH64/data/languages/AARCH64neon.sinc
M	Ghidra/Processors/PA-RISC/build.gradle
M	Ghidra/Processors/RISCV/data/languages/riscv.rv32b.sinc
M	Ghidra/Processors/x86/data/languages/avx.sinc
M	Ghidra/Processors/x86/data/languages/avx512.sinc
M	Ghidra/Processors/x86/data/languages/ia.sinc
M	Ghidra/Processors/x86/data/languages/x86.ldefs
```

Commit details:

```
[Commit 1/6]
Hash: 3d54c90cd604f43bf3029f27f714c37b3b3cd806
Date: 2025-05-30 20:47:03 -0400
Message: Fix RISC-V minu and max instructions' definitions (Closes #8215)

Files changed:
  M	Ghidra/Processors/RISCV/data/languages/riscv.rv32b.sinc

[Commit 2/6]
Hash: fe4244cbc952932b0923a34318021794ea2de805
Date: 2025-06-11 07:56:09 -0400
Message: GP-5622: Implemented pcode for several AARCH64 Neon instructions

Files changed:
  M	Ghidra/Processors/AARCH64/data/languages/AARCH64instructions.sinc
  M	Ghidra/Processors/AARCH64/data/languages/AARCH64neon.sinc

[Commit 3/6]
Hash: b0750c2783b7ecadcd2d4dd62434a2bf09c0e7b3
Date: 2025-06-10 09:21:39 -0400
Message: GP-5725: Corrected operands for several AVX512 instructions

Files changed:
  M	Ghidra/Processors/x86/data/languages/avx.sinc
  M	Ghidra/Processors/x86/data/languages/avx512.sinc
  M	Ghidra/Processors/x86/data/languages/ia.sinc
  M	Ghidra/Processors/x86/data/languages/x86.ldefs

[Commit 4/6]
Hash: 92f25888950324a9d6e3ddcdd36299e5bd5d1fa9
Date: 2025-06-09 15:17:05 -0400
Message: GP-0 Corrected build.gradle for PA-RISC to allow pcode test execution

Files changed:
  M	Ghidra/Processors/PA-RISC/build.gradle

[Commit 5/6]
Hash: 17d8fdfcfa2251d9e1aa386c87ae5a34b04e797e
Date: 2025-06-09 18:48:09 -0400
Message: GP-0 corrected PA-RISC sleigh compile option

Files changed:
  M	Ghidra/Processors/PA-RISC/build.gradle

[Commit 6/6]
Hash: 2acf28604682cc72a5adb111f7acad44130f71f9
Date: 2025-06-09 15:17:05 -0400
Message: GP-0 Corrected build.gradle for PA-RISC to allow pcode test execution

Files changed:
  M	Ghidra/Processors/PA-RISC/build.gradle
```
2025-06-23 16:03:39 -04:00
dependabot[bot] 443cfcfdc7 build(deps): bump softprops/action-gh-release from 2.2.2 to 2.3.2 (#341)
Bumps [softprops/action-gh-release](https://github.com/softprops/action-gh-release) from 2.2.2 to 2.3.2.
- [Release notes](https://github.com/softprops/action-gh-release/releases)
- [Changelog](https://github.com/softprops/action-gh-release/blob/master/CHANGELOG.md)
- [Commits](https://github.com/softprops/action-gh-release/compare/v2.2.2...v2.3.2)

---
updated-dependencies:
- dependency-name: softprops/action-gh-release
  dependency-version: 2.3.2
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-06-11 09:16:46 -04:00
auto-updater[bot] d888cdd5ea Update Ghidra HEAD to commit 5b0cac73c (#339)
Bump Ghidra HEAD commit 5b0cac73c

Changed files:

```
M	Ghidra/Processors/Z80/data/languages/z80.slaspec
```

Commit details:

```
[Commit 1/1]
Hash: eb6fbb17ef9059b76d41942aa8268453d9ef4773
Date: 2025-05-13 14:24:39 +0000
Message: GP-5659: Fixed z80 sub instruction semantics

Files changed:
  M	Ghidra/Processors/Z80/data/languages/z80.slaspec
```
2025-06-09 11:23:28 -04:00
auto-updater[bot] 7a92039e1a Update Ghidra HEAD to commit 65b290624 (#338)
Bump Ghidra HEAD commit 65b290624

Changed files:

```
M	Ghidra/Processors/x86/data/languages/old/x86RealV1.lang
M	Ghidra/Processors/x86/data/languages/old/x86RealV2.lang
M	Ghidra/Processors/x86/data/languages/old/x86RealV3.lang
M	Ghidra/Processors/x86/data/languages/old/x86_ProtV2.lang
M	Ghidra/Processors/x86/data/languages/old/x86_ProtV3.lang
M	Ghidra/Processors/x86/data/languages/old/x86smmV1.lang
M	Ghidra/Processors/x86/data/languages/old/x86smmV2.lang
M	Ghidra/Processors/x86/data/languages/old/x86smmV3.lang
```

Commit details:

```
[Commit 1/1]
Hash: 271ec694ad598cf6569c8d273cc0424c49b2571e
Date: 2025-05-19 16:01:16 -0400
Message: GP-5704 Corrected language upgrade issue affecting x86-16 Protected and SMM mode variants.

Files changed:
  M	Ghidra/Processors/x86/data/languages/old/x86RealV1.lang
  M	Ghidra/Processors/x86/data/languages/old/x86RealV2.lang
  M	Ghidra/Processors/x86/data/languages/old/x86RealV3.lang
  M	Ghidra/Processors/x86/data/languages/old/x86_ProtV2.lang
  M	Ghidra/Processors/x86/data/languages/old/x86_ProtV3.lang
  M	Ghidra/Processors/x86/data/languages/old/x86smmV1.lang
  M	Ghidra/Processors/x86/data/languages/old/x86smmV2.lang
  M	Ghidra/Processors/x86/data/languages/old/x86smmV3.lang
```
2025-05-28 14:58:06 -04:00
auto-updater[bot] 4af948df00 Update Ghidra HEAD to commit fd2dde260 (#337)
Changed files:

```
M	Ghidra/Features/Decompiler/src/decompile/cpp/op.cc
M	Ghidra/Processors/x86/data/languages/ia.sinc
```

Commit details:

```
[Commit 1/3]
Hash: d6815ae407a9662a0fc8332a619eeabec07b7f18
Date: 2025-05-15 16:52:12 +0000
Message: GP-5665: Additional cvt reg32 dest fixes

Files changed:
  M	Ghidra/Processors/x86/data/languages/ia.sinc

[Commit 2/3]
Hash: 27a019d9f83b71b061ae93edaf933cc1ee429b36
Date: 2025-05-14 20:24:04 +0000
Message: GP-5676 fixed issue involving ops with one input in BooleanMatch::evalute

Files changed:
  M	Ghidra/Features/Decompiler/src/decompile/cpp/op.cc

[Commit 3/3]
Hash: 6ab48b885b304d1d22d434e4d0af8c3725aa2f03
Date: 2025-05-14 19:19:32 +0900
Message: x86: Fix missing zero-extension in CVTTSD2SI

Files changed:
  M	Ghidra/Processors/x86/data/languages/ia.sinc
```
2025-05-19 16:03:54 -04:00
auto-updater[bot] 95b848e8ed Update Ghidra HEAD to commit c58647b7d (#336)
Bump Ghidra HEAD commit c58647b7d

Changed files:

```
M	Ghidra/Processors/AARCH64/data/languages/AARCH64.cspec
M	Ghidra/Processors/AARCH64/data/languages/AARCH64_win.cspec
M	Ghidra/Processors/AARCH64/data/languages/AARCH64base.sinc
M	Ghidra/Processors/ARM/certification.manifest
M	Ghidra/Processors/ARM/data/languages/ARM.ldefs
M	Ghidra/Processors/ARM/data/languages/ARM.sinc
M	Ghidra/Processors/ARM/data/languages/ARMTHUMBinstructions.sinc
A	Ghidra/Processors/ARM/data/languages/ARM_apcs.cspec
M	Ghidra/Processors/ARM/data/languages/ARMneon.sinc
M	Ghidra/Processors/x86/data/languages/ia.sinc
M	Ghidra/Processors/x86/data/languages/x86.ldefs
```

Commit details:

```
[Commit 1/10]
Hash: 28ca53cb343e655aa4515ee041dbd93004833d44
Date: 2025-05-07 17:41:41 +0000
Message: GP-4923: cspec, ldefs, opinion file support for ARM apcs abi

Files changed:
  M	Ghidra/Processors/ARM/certification.manifest
  M	Ghidra/Processors/ARM/data/languages/ARM.ldefs
  A	Ghidra/Processors/ARM/data/languages/ARM_apcs.cspec

[Commit 2/10]
Hash: b0b1db632c40a90694c0a77bfcded58a6f141847
Date: 2025-05-07 17:40:54 +0000
Message: GP-5192: Fix aarch64 cspec to match aapcs calling convention

Files changed:
  M	Ghidra/Processors/AARCH64/data/languages/AARCH64.cspec
  M	Ghidra/Processors/AARCH64/data/languages/AARCH64_win.cspec

[Commit 3/10]
Hash: a9e193d811dd27ddb9d6fc8e5368ea66388f57a5
Date: 2025-05-07 13:51:22 +0000
Message: GP-5638 update language verions

Files changed:
  M	Ghidra/Processors/x86/data/languages/x86.ldefs

[Commit 4/10]
Hash: ce839ce9fcabd67308d5c669eaf8f0700c686fa0
Date: 2024-05-30 17:41:37 +0930
Message: x86: PUSH FS/GS long mode improvements.

Files changed:
  M	Ghidra/Processors/x86/data/languages/ia.sinc

[Commit 5/10]
Hash: a917cc0345df88aa01efdecba97324f82a7d1f11
Date: 2025-04-11 14:56:38 +0000
Message: GP-5587: Corrected parsing of AARCH64 dsb instruction

Files changed:
  M	Ghidra/Processors/AARCH64/data/languages/AARCH64base.sinc

[Commit 6/10]
Hash: 7413204896f07a68f3c7c68cd4568801dafbd4ae
Date: 2025-03-10 16:16:04 +0000
Message: GP-5469: Added additional arm VMRS/VMSR instruction variants

Files changed:
  M	Ghidra/Processors/ARM/data/languages/ARM.sinc
  M	Ghidra/Processors/ARM/data/languages/ARMneon.sinc

[Commit 7/10]
Hash: e6b326700c140ca0279c9fd31a59374941dfd721
Date: 2025-01-16 20:13:39 +0000
Message: GP-4731: Fixed decode for mrs

Files changed:
  M	Ghidra/Processors/ARM/data/languages/ARMTHUMBinstructions.sinc

[Commit 8/10]
Hash: 0c43ccb360fdb3815ab6c549107e2de65a7866b8
Date: 2024-12-08 18:52:24 +0000
Message: wrap stack limit instruction decoders in ifdef block

Files changed:
  M	Ghidra/Processors/ARM/data/languages/ARMTHUMBinstructions.sinc

[Commit 9/10]
Hash: bb39e4398be04f4f1762e68983cc972f1b9605a7
Date: 2024-12-08 18:49:34 +0000
Message: define stack limit registers for armv8-m

Files changed:
  M	Ghidra/Processors/ARM/data/languages/ARM.sinc

[Commit 10/10]
Hash: 220763c40f947e170d4892692539e7214fef081f
Date: 2023-04-24 12:25:49 +0200
Message: instruction decoding for armv8 stack pointer limit registers

Files changed:
  M	Ghidra/Processors/ARM/data/languages/ARMTHUMBinstructions.sinc
```
2025-05-12 08:58:38 -04:00
auto-updater[bot] 8e27d6ef0a Update Ghidra HEAD to commit 5e825ebb5 (#335)
Bump Ghidra HEAD commit 5e825ebb5

Changed files:

```
M	Ghidra/Processors/x86/data/languages/avx512.sinc
M	Ghidra/Processors/x86/data/languages/ia.sinc
```

Commit details:

```
[Commit 1/1]
Hash: 4f1933c1a38c559631dcc89d4ae46a7b97c6d55c
Date: 2025-04-24 12:57:38 -0400
Message: GP-5537: Added additional AVX512 instructions

Files changed:
  M	Ghidra/Processors/x86/data/languages/avx512.sinc
  M	Ghidra/Processors/x86/data/languages/ia.sinc
```
2025-05-05 09:07:18 -04:00
auto-updater[bot] 9cc6adc272 Update Ghidra HEAD to commit 4a46edc9f (#334)
Bump Ghidra HEAD commit 4a46edc9f

Changed files:

```
M	Ghidra/Features/Decompiler/src/decompile/cpp/action.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/address.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/architecture.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/block.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/blockaction.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/constseq.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/database.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/database.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/fspec.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/fspec.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/funcdata_varnode.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/heritage.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/merge.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/prettyprint.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/printc.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/rangeutil.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/ruleaction.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/stringmanage.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/subflow.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/type.hh
M	Ghidra/Processors/SuperH4/data/languages/SuperH4.sinc
```

Commit details:

```
[Commit 1/3]
Hash: 6730154316df215c1c4125039c083e5d02d475b8
Date: 2025-04-21 07:54:19 -0400
Message: GP-0: Certify

Files changed:
  M	Ghidra/Features/Decompiler/src/decompile/cpp/action.hh
  M	Ghidra/Features/Decompiler/src/decompile/cpp/address.hh
  M	Ghidra/Features/Decompiler/src/decompile/cpp/blockaction.hh
  M	Ghidra/Features/Decompiler/src/decompile/cpp/database.cc
  M	Ghidra/Features/Decompiler/src/decompile/cpp/database.hh
  M	Ghidra/Features/Decompiler/src/decompile/cpp/prettyprint.hh
  M	Ghidra/Features/Decompiler/src/decompile/cpp/rangeutil.cc
  M	Ghidra/Features/Decompiler/src/decompile/cpp/stringmanage.hh

[Commit 2/3]
Hash: 830306162955c3bffaffa5d0c65d85f0dc49cc99
Date: 2025-04-19 18:06:41 +0200
Message: Many typo's These were found using the command below searching for duplicated words, and manually going through the results to remove the false positives and reword the true positives. Sometimes I removed the doubled word and sometimes I replaced the duplicated word.
Details:
The grep command:
grep -nIEr '\b([a-zA-Z]+)[[:space:]*]+\1\b' ./Ghidra

Files changed:
  M	Ghidra/Features/Decompiler/src/decompile/cpp/action.hh
  M	Ghidra/Features/Decompiler/src/decompile/cpp/address.hh
  M	Ghidra/Features/Decompiler/src/decompile/cpp/architecture.cc
  M	Ghidra/Features/Decompiler/src/decompile/cpp/block.cc
  M	Ghidra/Features/Decompiler/src/decompile/cpp/blockaction.hh
  M	Ghidra/Features/Decompiler/src/decompile/cpp/constseq.cc
  M	Ghidra/Features/Decompiler/src/decompile/cpp/database.cc
  M	Ghidra/Features/Decompiler/src/decompile/cpp/database.hh
  M	Ghidra/Features/Decompiler/src/decompile/cpp/fspec.cc
  M	Ghidra/Features/Decompiler/src/decompile/cpp/funcdata_varnode.cc
  M	Ghidra/Features/Decompiler/src/decompile/cpp/heritage.cc
  M	Ghidra/Features/Decompiler/src/decompile/cpp/merge.cc
  M	Ghidra/Features/Decompiler/src/decompile/cpp/prettyprint.hh
  M	Ghidra/Features/Decompiler/src/decompile/cpp/printc.hh
  M	Ghidra/Features/Decompiler/src/decompile/cpp/rangeutil.cc
  M	Ghidra/Features/Decompiler/src/decompile/cpp/ruleaction.cc
  M	Ghidra/Features/Decompiler/src/decompile/cpp/stringmanage.hh
  M	Ghidra/Features/Decompiler/src/decompile/cpp/subflow.cc
  M	Ghidra/Features/Decompiler/src/decompile/cpp/type.hh
  M	Ghidra/Processors/SuperH4/data/languages/SuperH4.sinc

[Commit 3/3]
Hash: b7e91e80a2cc8e54bf54f28a8551bd8378b30d90
Date: 2025-04-19 17:20:51 +0200
Message: Fix various "function" typos

Files changed:
  M	Ghidra/Features/Decompiler/src/decompile/cpp/fspec.hh
```
2025-04-28 09:09:27 -04:00
Eric Kilmer b763518f2f Refactor update ghidra script (#333)
Can now compare arbitrary commits/tags in Ghidra to collect all changes
between versions. This could be used to backfill or create a page with
all commit information between official version releases or keep running
tabs on changes introduced in HEAD.

Was testing out Cursor and LLM abilities to code this. Seemed to work
decently well!
2025-04-24 14:11:00 -04:00
Eric Kilmer a0a8aa27c0 Minor text output formatting changes, docs, mypy 2025-04-24 14:04:24 -04:00
Eric Kilmer 3efc7415f8 Reduce code duplication
Used Cursor v0.46.11 with claude-3.7-sonnet-thinking Agent mode with context
files:
- scripts/update_ghidra_head.py

and the following prompt (in the same chat as the parent commit):

---------------------

Please reduce code duplication when appropriate
2025-04-24 14:04:24 -04:00
Eric Kilmer 45dc2a0dbb Python Ghidra update script can compare arbitrary commits
Used Cursor v0.46.11 with claude-3.7-sonnet-thinking Agent mode with context
files:
- scripts/update_ghidra_head.py

and the following prompt:

---------------------

Please add an option to allow the user to specify begin and end commits, such
that the script does not read from or update the CMake file and requires
specifying an existing Ghidra git repository. For instance, it would look
something like the following, where `Ghidra_11.3_build` and `Ghidra_11.3.1_build`
are starting and ending commit, respectively.

```
python3 ./scripts/update_ghidra_head.py --ghidra-repo ./src/ghidra-HEAD Ghidra_11.3_build Ghidra_11.3.1_build
```

I also want it to support where only a starting commit is provided, and it shows
the commits from start to the current commit specified by `--ghidra-repo` path.
This also shouldn't update anything

```
python3 ./scripts/update_ghidra_head.py --ghidra-repo ./src/ghidra-HEAD Ghidra_11.3_build
```
2025-04-24 14:04:24 -04:00
Eric Kilmer b9eef57dee Refactor Python Ghidra update script for organization and clarity
Used Cursor v0.46.11 with claude-3.7-sonnet-thinking Agent mode with context
files:
- scripts/update_ghidra_head.py
- .github/workflows/main.yml

and the following prompt:

---------------------

Please refine the Python script to be more succinct, easier to understand, and
extendable. Use professional Python 3 constructs, syntax, and design. Do not
overcomplicate it. This script is standalone and won't be integrated into a
larger project.
2025-04-24 14:04:14 -04:00
Eric Kilmer f9c852bc57 Ghidra 11.3.2 (#332) 2025-04-22 15:32:07 -04:00
dependabot[bot] 3e96d296e0 build(deps): bump softprops/action-gh-release from 2.2.1 to 2.2.2 (#331)
Bumps [softprops/action-gh-release](https://github.com/softprops/action-gh-release) from 2.2.1 to 2.2.2.
- [Release notes](https://github.com/softprops/action-gh-release/releases)
- [Changelog](https://github.com/softprops/action-gh-release/blob/master/CHANGELOG.md)
- [Commits](https://github.com/softprops/action-gh-release/compare/v2.2.1...v2.2.2)

---
updated-dependencies:
- dependency-name: softprops/action-gh-release
  dependency-version: 2.2.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-04-22 14:47:17 -04:00
auto-updater[bot] 9d4d450551 Update Ghidra HEAD to commit 13834faba (#330)
Bump Ghidra HEAD commit 13834faba

Changed files:

```
M	Ghidra/Processors/ARM/data/languages/ARM.cspec
M	Ghidra/Processors/ARM/data/languages/ARM.sinc
M	Ghidra/Processors/ARM/data/languages/ARM_v45.cspec
M	Ghidra/Processors/ARM/data/languages/ARM_win.cspec
M	Ghidra/Processors/ARM/data/languages/ARMinstructions.sinc
M	Ghidra/Processors/MC6800/data/languages/6x09.sinc
M	Ghidra/Processors/MIPS/data/languages/mips16.sinc
M	Ghidra/Processors/x86/data/languages/ia.sinc
M	Ghidra/Processors/x86/data/languages/lockable.sinc
M	Ghidra/Processors/x86/data/languages/x86.ldefs
```

Commit details:

```
[Commit 1/5]
Hash: 41305fb45e91070800d2f0f58f49b2ba3010218a
Date: 2025-04-10 14:46:25 -0400
Message: GP-5011: Fixed x86 stack push/pop sizing issues

Files changed:
  M	Ghidra/Processors/x86/data/languages/ia.sinc

[Commit 2/5]
Hash: 30008b6715aeadc478c5861846d502804aa74003
Date: 2025-04-09 10:04:02 -0400
Message: GP-5030 improved x87 operand display

Files changed:
  M	Ghidra/Processors/x86/data/languages/ia.sinc
  M	Ghidra/Processors/x86/data/languages/lockable.sinc
  M	Ghidra/Processors/x86/data/languages/x86.ldefs

[Commit 3/5]
Hash: b702aa0a6f43eacf066ca194b8bce1794378ce53
Date: 2025-04-04 16:18:36 +0000
Message: GP-5301: Fix ARM/THUMB ISA mode switching for indirect branches in JIT.

Files changed:
  M	Ghidra/Processors/ARM/data/languages/ARM.cspec
  M	Ghidra/Processors/ARM/data/languages/ARM.sinc
  M	Ghidra/Processors/ARM/data/languages/ARM_v45.cspec
  M	Ghidra/Processors/ARM/data/languages/ARM_win.cspec
  M	Ghidra/Processors/ARM/data/languages/ARMinstructions.sinc

[Commit 4/5]
Hash: 96c1ec0970ec1799d11661acde976bd1c7cbdb8a
Date: 2024-11-15 16:14:12 +0000
Message: GP-5131: Fixed MIPS16e instruction delayslot relative addressing

Files changed:
  M	Ghidra/Processors/MIPS/data/languages/mips16.sinc

[Commit 5/5]
Hash: 387c283e8953d28f8f44e8776734c405793e1d1f
Date: 2024-03-14 07:33:47 +0200
Message: Github issue #5767 - 6x09.sinc: Fix COM instruction
Details:
The complement macro was erroneously always complementing A register
instead of the macro parameter op. This caused errors with the COMB
and COM OP1 instructions.

Closes #5767.

Files changed:
  M	Ghidra/Processors/MC6800/data/languages/6x09.sinc
```
2025-04-16 10:25:22 -04:00
Eric Kilmer 184fabc5aa Add missing "Commit details" listing to automated PR commit body 2025-03-24 09:44:30 -04:00
auto-updater[bot] 4cedffc104 Update Ghidra HEAD to commit 69a66e0ee (#329)
Changed files:

```
M	Ghidra/Processors/x86/data/languages/ia.sinc
```

Commit details:

```
[Commit 1/1]
Hash: 48ae03833ea2bb9a9a29d2d11704486cb596e2bf
Date: 2025-01-23 14:58:46 +0000
Message: GP-5299: Fixed pop instruction macros

Files changed:
  M	Ghidra/Processors/x86/data/languages/ia.sinc
```
2025-03-24 07:14:04 -04:00
auto-updater[bot] 873108dd0e Update Ghidra HEAD to commit 24ca217a5 (#328)
Changed files:

```
M	Ghidra/Processors/AARCH64/data/languages/AARCH64_golang.cspec
M	Ghidra/Processors/AARCH64/data/languages/AARCH64_golang.register.info
M	Ghidra/Processors/x86/data/languages/x86-32-golang.cspec
M	Ghidra/Processors/x86/data/languages/x86-32-golang.register.info
M	Ghidra/Processors/x86/data/languages/x86-64-golang.cspec
M	Ghidra/Processors/x86/data/languages/x86-64-golang.register.info
```

Commit details:

```
[Commit 1/1]
Hash: 36c6c8ef77c20b7d1b29ae2b4cee501c2d01fbd2
Date: 2024-11-12 10:36:35 -0500
Message: GP-2432 golang api snapshot, generics, closures, gcwritebarrier
Details:
Apply golang runtime function signatures from info stored in json api
snapshot files.

The api snapshot files are created by a custom go helper program that
uses the go compiler parser to parse the go toolchain source tree and
writes the discovered function and type info into a json file.

The go-api-parser helper program is based off of work contributed by
github user monoidic via issue #6367.

Updates generic functions to take a generic dictionary RTTI
parameter (mostly to allow correct assignment of other parameters).

Updates closure functions to take a closure context parameter.  Closure
contexts are passed via a register that is not involved in normal
parameter passing.

Tweaks the signature of gcWriteBarrier functions so that they don't mess
up decompilation of functions that use them.

Files changed:
  M	Ghidra/Processors/AARCH64/data/languages/AARCH64_golang.cspec
  M	Ghidra/Processors/AARCH64/data/languages/AARCH64_golang.register.info
  M	Ghidra/Processors/x86/data/languages/x86-32-golang.cspec
  M	Ghidra/Processors/x86/data/languages/x86-32-golang.register.info
  M	Ghidra/Processors/x86/data/languages/x86-64-golang.cspec
  M	Ghidra/Processors/x86/data/languages/x86-64-golang.register.info
```
2025-03-19 05:36:01 -04:00
auto-updater[bot] 4ddd7f2f89 Update Ghidra HEAD to commit 2896551d6 (#324)
Changed files:

```
M       Ghidra/Processors/AARCH64/data/languages/AARCH64instructions.sinc
M       Ghidra/Processors/AARCH64/data/languages/AARCH64neon.sinc
M       Ghidra/Processors/ARM/data/languages/ARMv8.sinc
M       Ghidra/Processors/PIC/data/languages/pic16.ldefs
M       Ghidra/Processors/PowerPC/data/patterns/PPC_BE_patterns.xml
M       Ghidra/Processors/PowerPC/data/patterns/PPC_LE_patterns.xml
```

Commit details:

```
[Commit 1/4]
Hash: 1bcc69aecee7ccb6957e5eebdafeea59244e16fb
Date: 2025-03-04 09:20:45 -0500
Message: GP-5402 aarch64 floating point comparisons and NAN

Files changed:
  M     Ghidra/Processors/AARCH64/data/languages/AARCH64instructions.sinc
  M     Ghidra/Processors/AARCH64/data/languages/AARCH64neon.sinc

[Commit 2/4]
Hash: 208f6f3ed1bcfde9fe66f0481b96e99d858dad76
Date: 2025-03-03 22:37:45 +0000
Message: GP-5411 Added plt thunk patterns, pre-fill of edit thunk GUI, loosened thunk address calculation for more complicated thunks

Files changed:
  M     Ghidra/Processors/PowerPC/data/patterns/PPC_BE_patterns.xml
  M     Ghidra/Processors/PowerPC/data/patterns/PPC_LE_patterns.xml

[Commit 3/4]
Hash: 26acd697ac0d0ff10c374f7c2537f9aa7096d24a
Date: 2024-05-16 15:06:26 +0930
Message: AArch32: fixed vselgt
Details:
* added 'and N == V' check missed in the vselcond "gt"

Files changed:
  M     Ghidra/Processors/ARM/data/languages/ARMv8.sinc

[Commit 4/4]
Hash: a38d30f2333190ae582f0a0a3669470d09693cb3
Date: 2024-02-07 21:19:25 +0100
Message: processors:pic: Fix PIC16F description

Files changed:
  M     Ghidra/Processors/PIC/data/languages/pic16.ldefs
```
2025-03-12 21:18:23 +00:00
auto-updater[bot] 00f42b7ef7 Update Ghidra HEAD to commit 58e19e947 (#323)
Changed files:

```
M       Ghidra/Processors/x86/data/languages/ia.sinc
M       Ghidra/Processors/x86/data/languages/x86.ldefs
```

Commit details:

```
[Commit 1/3]
Hash: 74066cdf78e7bc3f6b03a127a1ee647a8e36c357
Date: 2025-02-26 20:29:50 +0000
Message: GP-5424 updated x86 version numbers

Files changed:
  M     Ghidra/Processors/x86/data/languages/x86.ldefs

[Commit 2/3]
Hash: 6e8ef8deb1e98f1cabbf6cfca6a029dc30014e4d
Date: 2024-05-29 17:33:03 +0930
Message: x86: PUSHF/POPF address size fixes (64-bit mode)

Files changed:
  M     Ghidra/Processors/x86/data/languages/ia.sinc

[Commit 3/3]
Hash: f8b0d83b1605efbe1add57dbd001d3fe1cf49897
Date: 2025-02-25 12:19:27 -0500
Message: GP-5191 x86 fpu ip updates

Files changed:
  M     Ghidra/Processors/x86/data/languages/ia.sinc
```
2025-03-12 21:07:25 +00:00
Eric Kilmer 31868c9d70 Use 4 parallelism in CI
GitHub Actions runners have 4 vCPUs available
2025-03-12 16:51:19 -04:00
Eric Kilmer a96b7fdcc6 Actually fix Window ccache support in CI
Add CMAKE_MSVC_DEBUG_INFORMATION_FORMAT=Embedded to CI line
- Needs to be before the first project call

Set required CMake Policy for MSVC ccache debug type
2025-03-12 16:51:19 -04:00
Eric Kilmer 78ed150957 Ghidra 11.3.1 2025-03-12 15:25:56 -04:00
Eric Kilmer bc2f60c4b8 Only ignore test results on HEAD 2025-03-12 15:25:55 -04:00
auto-updater[bot] 85a209708f Update Ghidra HEAD to commit aaf910bd8 (#322)
Changed files:

```
M       Ghidra/Processors/ARM/data/languages/ARMTHUMBinstructions.sinc
M       Ghidra/Processors/ARM/data/languages/ARMneon.sinc
```

Commit details:

```
[Commit 1/2]
Hash: a2af457dea62bb31a176f5874f4918c63b8e59a6
Date: 2025-02-18 13:47:09 +0000
Message: GP-5386: Added missing ARM thumb strt instruction

Files changed:
  M     Ghidra/Processors/ARM/data/languages/ARMTHUMBinstructions.sinc

[Commit 2/2]
Hash: 065ef72288885ab10895b9a77056ef7bcec0b5bc
Date: 2024-05-20 11:22:54 +0930
Message: AArch32: fixed vdup
Details:
* 8byte vector duplication to 16byte performed bitwise AND (destructive) instead of OR of the 8byte shifted results, causing all 16byte vector duplications to be 0
* non-thumb constraints were used in a thumb instruction, added thumb specific constraints and separated them using TMode ctx field

Files changed:
  M     Ghidra/Processors/ARM/data/languages/ARMneon.sinc
```
2025-03-12 19:06:17 +00:00
auto-updater[bot] 6f193278c1 Update Ghidra HEAD to commit 2eff37f65 (#321)
Bump Ghidra HEAD commit 2eff37f65

Changed files:

```
M       Ghidra/Processors/AARCH64/data/languages/AARCH64ldst.sinc
```

Commit details:

```
[Commit 1/1]
Hash: 8473b248a17d3252babf49b7a809e97fd2a2c7a9
Date: 2024-04-30 15:43:55 +0930
Message: AA64: fix ld<n>r registers

Files changed:
  M     Ghidra/Processors/AARCH64/data/languages/AARCH64ldst.sinc
```
2025-03-12 18:39:41 +00:00
Eric Kilmer df49d10291 Ignore failing tests for now. Issue is reported to upstream 2025-03-12 13:54:55 -04:00
pgoodman d2f443e358 Bump Ghidra HEAD commit 684ed5ec6
**NOTE:** Upstream has failing tests. Reported here, within a PR to make
understanding test failures easier:
    https://github.com/NationalSecurityAgency/ghidra/pull/7883

Issue is caused by commit 69dd166c3ae0780c753999476f1fc7ea706ec876

Changed files:

```
M       Ghidra/Processors/ARM/data/languages/ARMneon.sinc
M       Ghidra/Processors/x86/data/languages/x86-64-gcc.cspec
M       Ghidra/Processors/x86/data/languages/x86-64-win.cspec
M       Ghidra/Processors/x86/data/languages/x86gcc.cspec
```

Commit details:

```
[Commit 1/2]
Hash: 115353d34c1d2162dcf8756adfd2af9fea3e1eae
Date: 2025-02-03 12:41:21 -0500
Message: GP-5268: Implemented ARM NEON vld4 instruction

Files changed:
  M     Ghidra/Processors/ARM/data/languages/ARMneon.sinc

[Commit 2/2]
Hash: 69dd166c3ae0780c753999476f1fc7ea706ec876
Date: 2025-02-04 21:37:27 +0000
Message: GP-5183 Fixes to x86 and x64 cspecs

Files changed:
  M     Ghidra/Processors/x86/data/languages/x86-64-gcc.cspec
  M     Ghidra/Processors/x86/data/languages/x86-64-win.cspec
  M     Ghidra/Processors/x86/data/languages/x86gcc.cspec
```
2025-03-12 13:54:09 -04:00
Eric Kilmer b871c4a6b8 Fix bug with Python Ghidra update scripts
It wasn't splitting the commits correctly and added text to the commit
body when there wasn't one

Also put the commit body starting on a new line
2025-03-12 13:11:21 -04:00
Eric Kilmer 58f4812a02 Improve Ghidra update process with commit details and dry run mode (#325)
Add detailed commit information to the Ghidra HEAD update process:
- Display information about each commit affecting sleigh files
- Include these commit details in GitHub Action PR descriptions
- Add --dry-run flag to preview changes without modifying files
- Improve output formatting and error handling

Also reformat the Python script with ruff
2025-03-12 14:41:09 +00:00
Eric Kilmer 9a983d5a01 Ghidra 11.3 (#319) 2025-03-03 19:26:50 -05:00
Eric Kilmer fbec9dee2b Bump Ghidra HEAD commit 5a3a8c36c (#318)
Changed files:

```
M       Ghidra/Features/Decompiler/src/decompile/cpp/heritage.cc
M       Ghidra/Processors/x86/data/languages/avx512.sinc
M       Ghidra/Processors/x86/data/languages/avx512_manual.sinc
```
2025-03-03 18:33:29 -05:00
Eric Kilmer aeea2f6d2e ci: Ignore java file in file update listing 2025-02-09 17:09:58 -05:00
Eric Kilmer e83ec16d28 Bump Ghidra HEAD commit 2ec84c2fb
Changed files:

```
M       Ghidra/Features/Decompiler/src/decompile/cpp/fspec.cc
M       Ghidra/Features/Decompiler/src/decompile/cpp/fspec.hh
M       Ghidra/Features/Decompiler/src/decompile/cpp/funcdata.hh
M       Ghidra/Features/Decompiler/src/decompile/cpp/funcdata_block.cc
M       Ghidra/Features/Decompiler/src/decompile/cpp/funcdata_op.cc
M       Ghidra/Features/Decompiler/src/decompile/cpp/ghidra_translate.cc
M       Ghidra/Features/Decompiler/src/decompile/cpp/ghidra_translate.hh
M       Ghidra/Features/Decompiler/src/decompile/cpp/marshal.cc
M       Ghidra/Features/Decompiler/src/decompile/cpp/modelrules.cc
M       Ghidra/Features/Decompiler/src/decompile/cpp/modelrules.hh
M       Ghidra/Features/Decompiler/src/decompile/cpp/pcoderaw.cc
M       Ghidra/Features/Decompiler/src/decompile/cpp/pcoderaw.hh
M       Ghidra/Features/Decompiler/src/decompile/cpp/ruleaction.cc
M       Ghidra/Features/Decompiler/src/decompile/cpp/ruleaction.hh
M       Ghidra/Features/Decompiler/src/decompile/cpp/rulecompile.hh
M       Ghidra/Features/Decompiler/src/decompile/cpp/sleighbase.cc
M       Ghidra/Features/Decompiler/src/decompile/cpp/sleighbase.hh
M       Ghidra/Features/Decompiler/src/decompile/cpp/translate.cc
M       Ghidra/Features/Decompiler/src/decompile/cpp/translate.hh
M       Ghidra/Features/Decompiler/src/decompile/unittests/testmarshal.cc
M       Ghidra/Processors/ARM/data/languages/ARMneon.sinc
M       Ghidra/Processors/x86/data/languages/avx.sinc
M       Ghidra/Processors/x86/data/languages/avx512.sinc
M       Ghidra/Processors/x86/data/languages/avx512_manual.sinc
M       Ghidra/Processors/x86/data/languages/cet.sinc
M       Ghidra/Processors/x86/data/languages/ia.sinc
M       Ghidra/Processors/x86/data/languages/x86.ldefs
```
2025-02-09 16:48:44 -05:00
Eric Kilmer 52c4f0db49 Bump Ghidra HEAD commit bb4853e41
Changed files:

```
M       Ghidra/Features/Decompiler/src/decompile/cpp/fspec.cc
M       Ghidra/Features/Decompiler/src/decompile/cpp/fspec.hh
M       Ghidra/Features/Decompiler/src/decompile/cpp/heritage.cc
M       Ghidra/Features/Decompiler/src/decompile/cpp/modelrules.hh
```
2025-02-09 16:43:20 -05:00
Eric Kilmer ab92d51452 Bump Ghidra HEAD commit 213825064
Changed files:

```
M       Ghidra/Features/Decompiler/src/decompile/build.gradle
M       Ghidra/Features/Decompiler/src/decompile/cpp/cast.cc
M       Ghidra/Features/Decompiler/src/decompile/cpp/constseq.cc
M       Ghidra/Features/Decompiler/src/decompile/cpp/constseq.hh
M       Ghidra/Features/Decompiler/src/decompile/cpp/coreaction.cc
M       Ghidra/Features/Decompiler/src/decompile/cpp/funcdata.hh
M       Ghidra/Features/Decompiler/src/decompile/cpp/funcdata_op.cc
M       Ghidra/Features/Decompiler/src/decompile/cpp/printc.cc
M       Ghidra/Features/Decompiler/src/decompile/cpp/printc.hh
M       Ghidra/Features/Decompiler/src/decompile/cpp/printlanguage.cc
M       Ghidra/Features/Decompiler/src/decompile/cpp/printlanguage.hh
M       Ghidra/Features/Decompiler/src/decompile/cpp/subflow.cc
M       Ghidra/Features/Decompiler/src/decompile/cpp/subflow.hh
M       Ghidra/Features/Decompiler/src/decompile/cpp/variable.cc
A       Ghidra/Features/Decompiler/src/decompile/datatests/concatsplit.xml
```
2025-02-09 16:40:40 -05:00
Eric Kilmer 5de8b6c8d6 Bump Ghidra HEAD commit cfffcf0c1 (#314)
Changed files:

```
M       Ghidra/Processors/Toy/data/languages/toy.sinc
M       Ghidra/Processors/Toy/data/languages/toyInstructions.sinc
```
2025-02-09 21:40:14 +00:00
Eric Kilmer 91ab01ad36 Bump Ghidra HEAD commit 860c75448 (#313)
Changed files:

```
M       Ghidra/Processors/AARCH64/data/languages/AARCH64_golang.register.info
M       Ghidra/Processors/x86/data/languages/x86-64-golang.register.info
```
2025-02-09 16:23:36 -05:00
Eric Kilmer db074738f1 Bump Ghidra HEAD commit 14527b015 (#310)
Changed files:

```
M       Ghidra/Features/Decompiler/src/decompile/cpp/constseq.cc
M       Ghidra/Features/Decompiler/src/decompile/cpp/coreaction.cc
M       Ghidra/Features/Decompiler/src/decompile/cpp/funcdata_op.cc
M       Ghidra/Features/Decompiler/src/decompile/cpp/funcdata_varnode.cc
M       Ghidra/Features/Decompiler/src/decompile/cpp/ruleaction.cc
M       Ghidra/Features/Decompiler/src/decompile/cpp/subflow.cc
M       Ghidra/Features/Decompiler/src/decompile/cpp/type.cc
M       Ghidra/Features/Decompiler/src/decompile/cpp/type.hh
M       Ghidra/Features/Decompiler/src/decompile/cpp/varnode.cc
M       Ghidra/Features/Decompiler/src/decompile/cpp/varnode.hh
```
2025-02-09 15:48:56 -05:00
Eric Kilmer ca9534df0c Bump Ghidra HEAD commit b69e48765 (#309)
Changed files:

```
M       Ghidra/Features/Decompiler/src/decompile/cpp/fspec.cc
M       Ghidra/Features/Decompiler/src/decompile/cpp/modelrules.cc
M       Ghidra/Features/Decompiler/src/decompile/cpp/modelrules.hh
M       Ghidra/Processors/TI_MSP430/data/languages/TI_MSP430.cspec
```
2025-02-09 15:30:18 -05:00
Eric Kilmer 2e03227e87 Update Ghidra HEAD to commit ec59e407b (#308)
Bump Ghidra HEAD commit ec59e407b

Changed files:

```
M       Ghidra/Features/Decompiler/src/decompile/cpp/condexe.cc
M       Ghidra/Features/Decompiler/src/decompile/cpp/condexe.hh
M       Ghidra/Features/Decompiler/src/decompile/cpp/coreaction.cc
M       Ghidra/Features/Decompiler/src/decompile/cpp/funcdata.hh
M       Ghidra/Features/Decompiler/src/decompile/cpp/funcdata_block.cc
M       Ghidra/Features/Decompiler/src/decompile/cpp/funcdata_op.cc
M       Ghidra/Features/Decompiler/src/decompile/cpp/op.cc
M       Ghidra/Features/Decompiler/src/decompile/cpp/op.hh
M       Ghidra/Features/Decompiler/src/decompile/cpp/ruleaction.cc
M       Ghidra/Features/Decompiler/src/decompile/cpp/ruleaction.hh
M       Ghidra/Features/Decompiler/src/decompile/cpp/subflow.cc
M       Ghidra/Features/Decompiler/src/decompile/cpp/typeop.cc
M       Ghidra/Features/Decompiler/src/decompile/cpp/varnode.cc
M       Ghidra/Features/Decompiler/src/decompile/cpp/varnode.hh
A       Ghidra/Features/Decompiler/src/decompile/datatests/ccmp.xml
M       Ghidra/Processors/68000/data/languages/68000.ldefs
M       Ghidra/Processors/AARCH64/data/languages/AARCH64.ldefs
M       Ghidra/Processors/AARCH64/data/languages/AARCH64_swift.cspec
M       Ghidra/Processors/ARM/data/languages/ARM.ldefs
M       Ghidra/Processors/Loongarch/data/languages/loongarch.ldefs
M       Ghidra/Processors/MIPS/data/languages/mips.ldefs
M       Ghidra/Processors/PowerPC/data/languages/ppc.ldefs
M       Ghidra/Processors/RISCV/data/languages/riscv.ldefs
M       Ghidra/Processors/Sparc/data/languages/SparcV9.ldefs
M       Ghidra/Processors/SuperH4/data/languages/SuperH4.ldefs
M       Ghidra/Processors/Xtensa/data/languages/xtensa.ldefs
M       Ghidra/Processors/x86/data/languages/x86-64-swift.cspec
M       Ghidra/Processors/x86/data/languages/x86.ldefs
```
2025-02-09 15:01:55 -05:00
Eric Kilmer bcb4ff6f4a Update ghidra HEAD to commit 2333ab611
* cron/update-ghidra-2333ab611:
  Fix Windows Debug build with patch for strict weak ordering
  Rework and regenerate patches
  Bump Ghidra HEAD commit 2333ab611
2025-02-09 14:23:39 -05:00
Eric Kilmer ac55146b2c Fix Windows Debug build with patch for strict weak ordering 2025-02-08 20:38:54 -05:00
Eric Kilmer 35fbbf873e Rework and regenerate patches
Only modified ruleaction.cc in 0001-Fix-UBSAN-errors-in-decompiler.patch
2025-02-08 20:38:54 -05:00
pgoodman 014530d317 Bump Ghidra HEAD commit 2333ab611
Changed files:

```
M	Ghidra/Features/Decompiler/src/decompile/cpp/constseq.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/constseq.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/coreaction.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/grammar.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/grammar.y
M	Ghidra/Features/Decompiler/src/decompile/cpp/marshal.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/marshal.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/modelrules.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/printc.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/ruleaction.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/ruleaction.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/subflow.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/subflow.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/testfunction.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/testfunction.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/type.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/type.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/typeop.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/typeop.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/variable.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/variable.hh
A	Ghidra/Features/Decompiler/src/decompile/datatests/enum.xml
M	Ghidra/Features/Decompiler/src/decompile/datatests/heapstring.xml
M	Ghidra/Features/Decompiler/src/decompile/unittests/testtypes.cc
M	Ghidra/Processors/AARCH64/data/languages/AARCH64.opinion
M	Ghidra/Processors/TI_MSP430/data/languages/TI_MSP430.cspec
```
2025-02-08 20:38:54 -05:00
Eric Kilmer 4d8bdb54a3 auto-update use Python version 3.10 in CI 2025-02-06 13:42:12 -05:00
dependabot[bot] 364b5e4ff9 build(deps): bump softprops/action-gh-release from 2.2.0 to 2.2.1 (#306)
Bumps [softprops/action-gh-release](https://github.com/softprops/action-gh-release) from 2.2.0 to 2.2.1.
- [Release notes](https://github.com/softprops/action-gh-release/releases)
- [Changelog](https://github.com/softprops/action-gh-release/blob/master/CHANGELOG.md)
- [Commits](https://github.com/softprops/action-gh-release/compare/v2.2.0...v2.2.1)

---
updated-dependencies:
- dependency-name: softprops/action-gh-release
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-01-08 11:33:10 -05:00
dependabot[bot] 4519d754ab build(deps): bump softprops/action-gh-release from 2.1.0 to 2.2.0 (#305)
Bumps [softprops/action-gh-release](https://github.com/softprops/action-gh-release) from 2.1.0 to 2.2.0.
- [Release notes](https://github.com/softprops/action-gh-release/releases)
- [Changelog](https://github.com/softprops/action-gh-release/blob/master/CHANGELOG.md)
- [Commits](https://github.com/softprops/action-gh-release/compare/v2.1.0...v2.2.0)

---
updated-dependencies:
- dependency-name: softprops/action-gh-release
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-12-11 08:57:30 -05:00
dependabot[bot] 6db8a80488 build(deps): bump softprops/action-gh-release from 2.0.9 to 2.1.0 (#302)
Bumps [softprops/action-gh-release](https://github.com/softprops/action-gh-release) from 2.0.9 to 2.1.0.
- [Release notes](https://github.com/softprops/action-gh-release/releases)
- [Changelog](https://github.com/softprops/action-gh-release/blob/master/CHANGELOG.md)
- [Commits](https://github.com/softprops/action-gh-release/compare/v2.0.9...v2.1.0)

---
updated-dependencies:
- dependency-name: softprops/action-gh-release
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-11-12 09:11:59 -05:00
auto-updater[bot] 39f087356c Update Ghidra HEAD to commit 30ef757d8 (#301)
Bump Ghidra HEAD commit 30ef757d8

Changed files:

```
A	Ghidra/Processors/6502/README.md
M	Ghidra/Processors/6502/certification.manifest
A	Ghidra/Processors/68000/README.md
M	Ghidra/Processors/68000/certification.manifest
A	Ghidra/Processors/8048/README.md
M	Ghidra/Processors/8048/certification.manifest
A	Ghidra/Processors/8051/README.md
M	Ghidra/Processors/8051/certification.manifest
A	Ghidra/Processors/8085/README.md
M	Ghidra/Processors/8085/certification.manifest
A	Ghidra/Processors/AARCH64/README.md
M	Ghidra/Processors/AARCH64/certification.manifest
A	Ghidra/Processors/ARM/README.md
M	Ghidra/Processors/ARM/certification.manifest
A	Ghidra/Processors/Atmel/README.md
M	Ghidra/Processors/Atmel/certification.manifest
A	Ghidra/Processors/BPF/README.md
M	Ghidra/Processors/BPF/certification.manifest
A	Ghidra/Processors/CP1600/README.md
M	Ghidra/Processors/CP1600/certification.manifest
A	Ghidra/Processors/CR16/README.md
M	Ghidra/Processors/CR16/certification.manifest
A	Ghidra/Processors/DATA/README.md
M	Ghidra/Processors/DATA/certification.manifest
A	Ghidra/Processors/Dalvik/README.md
M	Ghidra/Processors/Dalvik/certification.manifest
A	Ghidra/Processors/HCS08/README.md
M	Ghidra/Processors/HCS08/certification.manifest
A	Ghidra/Processors/HCS12/README.md
M	Ghidra/Processors/HCS12/certification.manifest
A	Ghidra/Processors/JVM/README.md
M	Ghidra/Processors/JVM/certification.manifest
A	Ghidra/Processors/Loongarch/README.md
M	Ghidra/Processors/Loongarch/certification.manifest
A	Ghidra/Processors/M16C/README.md
M	Ghidra/Processors/M16C/certification.manifest
A	Ghidra/Processors/M8C/README.md
M	Ghidra/Processors/M8C/certification.manifest
A	Ghidra/Processors/MC6800/README.md
M	Ghidra/Processors/MC6800/certification.manifest
A	Ghidra/Processors/MCS96/README.md
M	Ghidra/Processors/MCS96/certification.manifest
A	Ghidra/Processors/MIPS/README.md
M	Ghidra/Processors/MIPS/certification.manifest
A	Ghidra/Processors/PA-RISC/README.md
M	Ghidra/Processors/PA-RISC/certification.manifest
A	Ghidra/Processors/PIC/README.md
M	Ghidra/Processors/PIC/certification.manifest
A	Ghidra/Processors/PowerPC/README.md
M	Ghidra/Processors/PowerPC/certification.manifest
A	Ghidra/Processors/RISCV/README.md
M	Ghidra/Processors/RISCV/certification.manifest
A	Ghidra/Processors/Sparc/README.md
M	Ghidra/Processors/Sparc/certification.manifest
A	Ghidra/Processors/SuperH/README.md
M	Ghidra/Processors/SuperH/certification.manifest
A	Ghidra/Processors/SuperH4/README.md
M	Ghidra/Processors/SuperH4/certification.manifest
A	Ghidra/Processors/TI_MSP430/README.md
M	Ghidra/Processors/TI_MSP430/certification.manifest
A	Ghidra/Processors/Toy/README.md
M	Ghidra/Processors/Toy/certification.manifest
A	Ghidra/Processors/V850/README.md
M	Ghidra/Processors/V850/certification.manifest
A	Ghidra/Processors/Xtensa/README.md
M	Ghidra/Processors/Xtensa/certification.manifest
A	Ghidra/Processors/Z80/README.md
M	Ghidra/Processors/Z80/certification.manifest
A	Ghidra/Processors/eBPF/README.md
M	Ghidra/Processors/eBPF/certification.manifest
A	Ghidra/Processors/tricore/README.md
M	Ghidra/Processors/tricore/certification.manifest
A	Ghidra/Processors/x86/README.md
M	Ghidra/Processors/x86/certification.manifest
```

Co-authored-by: pgoodman <43664+pgoodman@users.noreply.github.com>
2024-11-11 11:08:50 -05:00
Eric Kilmer 0c5929b716 Ghidra 11.2.1 (#300) 2024-11-06 09:46:41 -05:00
auto-updater[bot] 84a582a33c Update Ghidra HEAD to commit ffaa97cbd (#299)
* Remove index-check patch merged in upstream

Changed files:

```
M	Ghidra/Features/Decompiler/src/decompile/cpp/block.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/block.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/blockaction.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/constseq.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/constseq.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/flow.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/funcdata.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/funcdata_op.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/ifacedecomp.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/ruleaction.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/subflow.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/subflow.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/type.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/type.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/typeop.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/typeop.hh
A	Ghidra/Features/Decompiler/src/decompile/datatests/inline.xml
```

---------

Co-authored-by: Eric Kilmer <eric.d.kilmer@gmail.com>
2024-11-04 08:41:48 -05:00
dependabot[bot] d8ce6443bf build(deps): bump softprops/action-gh-release from 2.0.8 to 2.0.9 (#298)
Bumps [softprops/action-gh-release](https://github.com/softprops/action-gh-release) from 2.0.8 to 2.0.9.
- [Release notes](https://github.com/softprops/action-gh-release/releases)
- [Changelog](https://github.com/softprops/action-gh-release/blob/master/CHANGELOG.md)
- [Commits](https://github.com/softprops/action-gh-release/compare/v2.0.8...v2.0.9)

---
updated-dependencies:
- dependency-name: softprops/action-gh-release
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-11-01 09:17:47 -04:00
Eric Kilmer ae03ceb39c Fix floating point test and allow positive or negative NAN
Apple Silicon mac reports positive NAN instead of negative NAN, so allow
both using a regex
2024-10-30 14:30:42 -04:00
Eric Kilmer 39d6587cf9 Update CI runner and build steps 2024-10-30 12:08:06 -04:00
dependabot[bot] 2bb6cfe47b build(deps): bump peter-evans/create-pull-request from 6 to 7 (#287)
Bumps [peter-evans/create-pull-request](https://github.com/peter-evans/create-pull-request) from 6 to 7.
- [Release notes](https://github.com/peter-evans/create-pull-request/releases)
- [Commits](https://github.com/peter-evans/create-pull-request/compare/v6...v7)

---
updated-dependencies:
- dependency-name: peter-evans/create-pull-request
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Eric Kilmer <eric.d.kilmer@gmail.com>
2024-10-30 13:05:12 +00:00
auto-updater[bot] c3a84c541a Update Ghidra HEAD to commit 7ddd8665b (#294)
Changed files:

```
M	Ghidra/Features/Decompiler/src/decompile/cpp/coreaction.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/cover.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/cpool.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/double.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/filemanage.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/flow.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/fspec.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/funcdata.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/funcdata.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/funcdata_block.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/funcdata_varnode.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/grammar.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/grammar.y
M	Ghidra/Features/Decompiler/src/decompile/cpp/heritage.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/heritage.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/ifacedecomp.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/ifacedecomp.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/jumptable.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/jumptable.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/merge.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/merge.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/op.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/op.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/paramid.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/ruleaction.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/test.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/type.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/type.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/typeop.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/types.h
M	Ghidra/Features/Decompiler/src/decompile/cpp/variable.cc
A	Ghidra/Features/Decompiler/src/decompile/datatests/revisit.xml
A	Ghidra/Features/Decompiler/src/decompile/datatests/switchloop.xml
A	Ghidra/Features/Decompiler/src/decompile/datatests/switchmulti.xml
M	Ghidra/Processors/ARM/src/test.processors/java/ghidra/test/processors/ARM_v8m_O0_EmulatorTest.java
M	Ghidra/Processors/ARM/src/test.processors/java/ghidra/test/processors/ARM_v8m_O3_EmulatorTest.java
```

---------

Co-authored-by: Eric Kilmer <eric.d.kilmer@gmail.com>
2024-10-30 03:14:30 +00:00
Eric Kilmer 45e124cdab Ghidra 11.2 (#296) 2024-10-29 22:35:41 -04:00
auto-updater[bot] e4a5f4326c Update Ghidra HEAD to commit fd1a448bf (#290)
Changed files:

```
M	Ghidra/Features/Decompiler/src/decompile/cpp/Makefile
M	Ghidra/Features/Decompiler/src/decompile/cpp/architecture.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/architecture.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/block.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/block.hh
A	Ghidra/Features/Decompiler/src/decompile/cpp/constseq.cc
A	Ghidra/Features/Decompiler/src/decompile/cpp/constseq.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/coreaction.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/coreaction.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/database.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/database.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/double.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/double.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/float.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/float.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/flow.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/fspec.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/funcdata.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/funcdata.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/funcdata_block.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/funcdata_varnode.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/ghidra_arch.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/jumptable.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/merge.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/op.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/op.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/printc.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/printc.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/ruleaction.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/ruleaction.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/sleigh_arch.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/sleigh_arch.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/sleighbase.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/space.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/stringmanage.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/stringmanage.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/subflow.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/subflow.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/testfunction.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/transform.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/transform.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/type.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/type.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/typeop.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/typeop.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/userop.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/userop.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/variable.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/variable.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/varmap.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/varmap.hh
A	Ghidra/Features/Decompiler/src/decompile/datatests/doublemove.xml
A	Ghidra/Features/Decompiler/src/decompile/datatests/floatcast.xml
A	Ghidra/Features/Decompiler/src/decompile/datatests/floatconv.xml
M	Ghidra/Features/Decompiler/src/decompile/datatests/floatprint.xml
A	Ghidra/Features/Decompiler/src/decompile/datatests/heapstring.xml
A	Ghidra/Features/Decompiler/src/decompile/datatests/orcompare.xml
A	Ghidra/Features/Decompiler/src/decompile/datatests/stackstring.xml
M	Ghidra/Features/Decompiler/src/decompile/unittests/testfloatemu.cc
M	Ghidra/Processors/68000/data/languages/68000.sinc
M	Ghidra/Processors/8051/certification.manifest
A	Ghidra/Processors/8051/data/languages/8051.opinion
M	Ghidra/Processors/AARCH64/data/languages/AARCH64_win.cspec
M	Ghidra/Processors/AARCH64/src/main/java/ghidra/app/util/bin/format/elf/relocation/AARCH64_ElfRelocationHandler.java
M	Ghidra/Processors/ARM/data/languages/ARM.dwarf
M	Ghidra/Processors/ARM/data/languages/ARMneon.dwarf
M	Ghidra/Processors/ARM/data/languages/ARMneon.sinc
M	Ghidra/Processors/ARM/data/languages/ARMv8.sinc
M	Ghidra/Processors/ARM/src/main/java/ghidra/app/util/bin/format/elf/relocation/ARM_ElfRelocationHandler.java
M	Ghidra/Processors/Atmel/ghidra_scripts/CreateAVR8GDTArchiveScript.java
M	Ghidra/Processors/Atmel/src/main/java/ghidra/app/util/bin/format/elf/relocation/AVR32_ElfRelocationHandler.java
M	Ghidra/Processors/Atmel/src/main/java/ghidra/app/util/bin/format/elf/relocation/AVR8_ElfRelocationHandler.java
M	Ghidra/Processors/Loongarch/src/main/java/ghidra/app/util/bin/format/elf/relocation/Loongarch_ElfRelocationHandler.java
A	Ghidra/Processors/M16C/Module.manifest
A	Ghidra/Processors/M16C/build.gradle
A	Ghidra/Processors/M16C/certification.manifest
A	Ghidra/Processors/M16C/data/languages/M16C_60.cspec
A	Ghidra/Processors/M16C/data/languages/M16C_60.ldefs
A	Ghidra/Processors/M16C/data/languages/M16C_60.pspec
A	Ghidra/Processors/M16C/data/languages/M16C_60.slaspec
A	Ghidra/Processors/M16C/data/languages/M16C_80.cspec
A	Ghidra/Processors/M16C/data/languages/M16C_80.ldefs
A	Ghidra/Processors/M16C/data/languages/M16C_80.pspec
A	Ghidra/Processors/M16C/data/languages/M16C_80.slaspec
A	Ghidra/Processors/M16C/data/manuals/M16C_60.idx
A	Ghidra/Processors/M16C/data/manuals/M16C_80.idx
M	Ghidra/Processors/MIPS/data/languages/MIPS.opinion
M	Ghidra/Processors/MIPS/src/main/java/ghidra/app/util/bin/format/elf/relocation/MIPS_ElfRelocationHandler.java
M	Ghidra/Processors/PIC/data/languages/pic16.ldefs
M	Ghidra/Processors/PIC/data/languages/pic16.pspec
M	Ghidra/Processors/PIC/data/languages/pic16.sinc
M	Ghidra/Processors/PIC/data/languages/pic16_instructions.sinc
M	Ghidra/Processors/PIC/data/languages/pic16f.pspec
M	Ghidra/Processors/PIC/src/main/java/ghidra/app/plugin/core/analysis/Pic16Analyzer.java
M	Ghidra/Processors/PIC/src/main/java/ghidra/app/util/bin/format/elf/relocation/PIC30_ElfRelocationHandler.java
M	Ghidra/Processors/PowerPC/data/languages/SPE_APU.sinc
M	Ghidra/Processors/PowerPC/data/languages/evx.sinc
M	Ghidra/Processors/PowerPC/data/languages/ppc.ldefs
M	Ghidra/Processors/PowerPC/data/languages/ppc_32.pspec
M	Ghidra/Processors/PowerPC/data/languages/ppc_32_mpc8270.pspec
M	Ghidra/Processors/PowerPC/data/languages/ppc_64.pspec
M	Ghidra/Processors/PowerPC/src/main/java/ghidra/app/util/bin/format/elf/relocation/PowerPC64_ElfRelocationHandler.java
M	Ghidra/Processors/PowerPC/src/main/java/ghidra/app/util/bin/format/elf/relocation/PowerPC_ElfRelocationHandler.java
M	Ghidra/Processors/RISCV/src/main/java/ghidra/app/util/bin/format/elf/relocation/RISCV_ElfRelocationHandler.java
M	Ghidra/Processors/Sparc/certification.manifest
M	Ghidra/Processors/Sparc/data/languages/SparcV9.ldefs
M	Ghidra/Processors/Sparc/data/languages/SparcV9.sinc
M	Ghidra/Processors/Sparc/data/languages/SparcV9_32.cspec
M	Ghidra/Processors/Sparc/data/languages/SparcV9_64.cspec
M	Ghidra/Processors/Sparc/data/patterns/SPARC_patterns.xml
M	Ghidra/Processors/Sparc/src/main/java/ghidra/app/plugin/core/analysis/SparcAnalyzer.java
A	Ghidra/Processors/Sparc/src/main/java/ghidra/app/plugin/core/analysis/SparcEarlyAddressAnalyzer.java
A	Ghidra/Processors/Sparc/src/main/java/ghidra/app/util/bin/format/elf/relocation/SPARC64_ElfRelocationHandler.java
M	Ghidra/Processors/Sparc/src/main/java/ghidra/app/util/bin/format/elf/relocation/SPARC_ElfRelocationHandler.java
M	Ghidra/Processors/Sparc/src/main/java/ghidra/app/util/bin/format/elf/relocation/SPARC_ElfRelocationType.java
M	Ghidra/Processors/SuperH4/src/main/java/ghidra/app/util/bin/format/elf/relocation/SH_ElfRelocationHandler.java
M	Ghidra/Processors/TI_MSP430/src/main/java/ghidra/app/util/bin/format/elf/relocation/MSP430X_ElfRelocationHandler.java
M	Ghidra/Processors/TI_MSP430/src/main/java/ghidra/app/util/bin/format/elf/relocation/MSP430_ElfRelocationHandler.java
M	Ghidra/Processors/Xtensa/src/main/java/ghidra/app/util/bin/format/elf/relocation/Xtensa_ElfRelocationHandler.java
D	Ghidra/Processors/eBPF/src/main/java/ghidra/app/plugin/core/analysis/eBPFAnalyzer.java
A	Ghidra/Processors/eBPF/src/main/java/ghidra/app/plugin/core/analysis/eBPFHelperDataTypes.java
A	Ghidra/Processors/eBPF/src/main/java/ghidra/app/plugin/core/analysis/eBPFSyscallAnalyzer.java
M	Ghidra/Processors/eBPF/src/main/java/ghidra/app/util/bin/format/elf/relocation/eBPF_ElfRelocationHandler.java
M	Ghidra/Processors/tricore/src/main/java/ghidra/app/util/bin/format/elf/relocation/Tricore_ElfRelocationHandler.java
M	Ghidra/Processors/x86/data/languages/avx.sinc
M	Ghidra/Processors/x86/data/languages/avx2.sinc
M	Ghidra/Processors/x86/data/languages/ia.sinc
M	Ghidra/Processors/x86/data/languages/lockable.sinc
M	Ghidra/Processors/x86/data/languages/x86-64.pspec
M	Ghidra/Processors/x86/data/languages/x86.ldefs
M	Ghidra/Processors/x86/data/languages/x86.pspec
M	Ghidra/Processors/x86/src/main/java/ghidra/app/util/bin/format/elf/relocation/X86_32_ElfRelocationHandler.java
M	Ghidra/Processors/x86/src/main/java/ghidra/app/util/bin/format/elf/relocation/X86_64_ElfRelocationContext.java
M	Ghidra/Processors/x86/src/main/java/ghidra/app/util/bin/format/elf/relocation/X86_64_ElfRelocationHandler.java
```

* Ignore double floating point test due to errors on mac and Windows

* Reformat patches

---------

Co-authored-by: Eric Kilmer <eric.d.kilmer@gmail.com>
2024-10-29 22:08:21 -04:00
Eric Kilmer 9cacf73c09 Ghidra 11.1.2 (#295) 2024-10-29 21:30:43 -04:00
auto-updater[bot] c25484c07a Update Ghidra HEAD to commit a1db2dac1 (#274)
* Bump Ghidra HEAD commit a1db2dac1

Changed files:

```
M	Ghidra/Features/Decompiler/src/decompile/cpp/Makefile
M	Ghidra/Features/Decompiler/src/decompile/cpp/architecture.cc
A	Ghidra/Features/Decompiler/src/decompile/cpp/constseq.cc
A	Ghidra/Features/Decompiler/src/decompile/cpp/constseq.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/coreaction.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/coreaction.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/database.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/database.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/flow.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/funcdata.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/funcdata.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/funcdata_block.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/funcdata_varnode.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/jumptable.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/merge.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/op.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/op.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/printc.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/ruleaction.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/sleighbase.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/stringmanage.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/stringmanage.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/subflow.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/type.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/type.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/typeop.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/userop.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/userop.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/variable.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/variable.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/varmap.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/varmap.hh
A	Ghidra/Features/Decompiler/src/decompile/datatests/stackstring.xml
M	Ghidra/Processors/8051/certification.manifest
A	Ghidra/Processors/8051/data/languages/8051.opinion
M	Ghidra/Processors/AARCH64/src/main/java/ghidra/app/util/bin/format/elf/relocation/AARCH64_ElfRelocationHandler.java
M	Ghidra/Processors/ARM/src/main/java/ghidra/app/util/bin/format/elf/relocation/ARM_ElfRelocationHandler.java
M	Ghidra/Processors/Atmel/ghidra_scripts/CreateAVR8GDTArchiveScript.java
M	Ghidra/Processors/Atmel/src/main/java/ghidra/app/util/bin/format/elf/relocation/AVR32_ElfRelocationHandler.java
M	Ghidra/Processors/Atmel/src/main/java/ghidra/app/util/bin/format/elf/relocation/AVR8_ElfRelocationHandler.java
M	Ghidra/Processors/Loongarch/src/main/java/ghidra/app/util/bin/format/elf/relocation/Loongarch_ElfRelocationHandler.java
M	Ghidra/Processors/MIPS/src/main/java/ghidra/app/util/bin/format/elf/relocation/MIPS_ElfRelocationHandler.java
M	Ghidra/Processors/PIC/src/main/java/ghidra/app/util/bin/format/elf/relocation/PIC30_ElfRelocationHandler.java
M	Ghidra/Processors/PowerPC/src/main/java/ghidra/app/util/bin/format/elf/relocation/PowerPC64_ElfRelocationHandler.java
M	Ghidra/Processors/PowerPC/src/main/java/ghidra/app/util/bin/format/elf/relocation/PowerPC_ElfRelocationHandler.java
M	Ghidra/Processors/RISCV/src/main/java/ghidra/app/util/bin/format/elf/relocation/RISCV_ElfRelocationHandler.java
M	Ghidra/Processors/Sparc/src/main/java/ghidra/app/util/bin/format/elf/relocation/SPARC_ElfRelocationHandler.java
M	Ghidra/Processors/SuperH4/src/main/java/ghidra/app/util/bin/format/elf/relocation/SH_ElfRelocationHandler.java
M	Ghidra/Processors/TI_MSP430/src/main/java/ghidra/app/util/bin/format/elf/relocation/MSP430X_ElfRelocationHandler.java
M	Ghidra/Processors/TI_MSP430/src/main/java/ghidra/app/util/bin/format/elf/relocation/MSP430_ElfRelocationHandler.java
M	Ghidra/Processors/Xtensa/src/main/java/ghidra/app/util/bin/format/elf/relocation/Xtensa_ElfRelocationHandler.java
D	Ghidra/Processors/eBPF/src/main/java/ghidra/app/plugin/core/analysis/eBPFAnalyzer.java
A	Ghidra/Processors/eBPF/src/main/java/ghidra/app/plugin/core/analysis/eBPFHelperDataTypes.java
A	Ghidra/Processors/eBPF/src/main/java/ghidra/app/plugin/core/analysis/eBPFSyscallAnalyzer.java
M	Ghidra/Processors/eBPF/src/main/java/ghidra/app/util/bin/format/elf/relocation/eBPF_ElfRelocationHandler.java
M	Ghidra/Processors/tricore/src/main/java/ghidra/app/util/bin/format/elf/relocation/Tricore_ElfRelocationHandler.java
M	Ghidra/Processors/x86/src/main/java/ghidra/app/util/bin/format/elf/relocation/X86_32_ElfRelocationHandler.java
M	Ghidra/Processors/x86/src/main/java/ghidra/app/util/bin/format/elf/relocation/X86_64_ElfRelocationHandler.java
```

* Remove UBSAN fix in funcdata_varnode.cc

Tests now pass. It is unclear whether the tests rely on this undefined
behavior or not. It is also unclear whether the tests even trigger
undefined behavior at this location anymore. This will be revisited when
future testing with sanitizers is investigated and integrated into CI.

* Add new file constseq.{hh,cc}

* Fix error in Windows with vector::reserve and resize

* Regenerate patches

---------

Co-authored-by: Eric Kilmer <eric.d.kilmer@gmail.com>
2024-10-29 18:54:43 -04:00
dependabot[bot] 4b7000b597 build(deps): bump softprops/action-gh-release from 2.0.7 to 2.0.8 (#278)
Bumps [softprops/action-gh-release](https://github.com/softprops/action-gh-release) from 2.0.7 to 2.0.8.
- [Release notes](https://github.com/softprops/action-gh-release/releases)
- [Changelog](https://github.com/softprops/action-gh-release/blob/master/CHANGELOG.md)
- [Commits](https://github.com/softprops/action-gh-release/compare/v2.0.7...v2.0.8)

---
updated-dependencies:
- dependency-name: softprops/action-gh-release
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-19 08:44:46 -04:00
dependabot[bot] dc79090c83 build(deps): bump softprops/action-gh-release from 2.0.6 to 2.0.7 (#277)
Bumps [softprops/action-gh-release](https://github.com/softprops/action-gh-release) from 2.0.6 to 2.0.7.
- [Release notes](https://github.com/softprops/action-gh-release/releases)
- [Changelog](https://github.com/softprops/action-gh-release/blob/master/CHANGELOG.md)
- [Commits](https://github.com/softprops/action-gh-release/compare/v2.0.6...v2.0.7)

---
updated-dependencies:
- dependency-name: softprops/action-gh-release
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-18 08:50:56 -04:00
dependabot[bot] 2d65648571 build(deps): bump softprops/action-gh-release from 2.0.5 to 2.0.6 (#271)
Bumps [softprops/action-gh-release](https://github.com/softprops/action-gh-release) from 2.0.5 to 2.0.6.
- [Release notes](https://github.com/softprops/action-gh-release/releases)
- [Changelog](https://github.com/softprops/action-gh-release/blob/master/CHANGELOG.md)
- [Commits](https://github.com/softprops/action-gh-release/compare/v2.0.5...v2.0.6)

---
updated-dependencies:
- dependency-name: softprops/action-gh-release
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-20 08:30:04 -04:00
Eric Kilmer 9650669dc3 Ghidra 11.1.1 (#270) 2024-06-18 16:37:45 -04:00
auto-updater[bot] 8a595daf70 Update Ghidra HEAD to commit 3ec2dfb20 (#269)
* Bump Ghidra HEAD commit 3ec2dfb20

Changed files:

```
M	Ghidra/Features/Decompiler/src/decompile/cpp/block.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/blockaction.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/blockaction.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/fspec.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/fspec.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/subflow.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/transform.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/transform.hh
A	Ghidra/Features/Decompiler/src/decompile/datatests/deindirect2.xml
M	Ghidra/Processors/MC6800/data/languages/6805.slaspec
M	Ghidra/Processors/Z80/build.gradle
M	Ghidra/Processors/Z80/data/languages/z80.slaspec
```

* CI: macos fix brew install python

---------

Co-authored-by: Eric Kilmer <eric.d.kilmer@gmail.com>
2024-06-17 11:15:16 -04:00
Eric Kilmer 69e080e45a Ghidra 11.1 (#268)
ZLIB is now a requirement for compressed sleigh files
2024-06-12 07:22:03 -04:00
auto-updater[bot] 4110ce82e0 Update Ghidra HEAD to commit 195abea7e (#267)
Bump Ghidra HEAD commit 195abea7e

Changed files:

```
M	Ghidra/Processors/x86/certification.manifest
M	Ghidra/Processors/x86/data/languages/avx.sinc
M	Ghidra/Processors/x86/data/languages/avx2.sinc
M	Ghidra/Processors/x86/data/languages/avx2_manual.sinc
A	Ghidra/Processors/x86/data/languages/avx512.sinc
A	Ghidra/Processors/x86/data/languages/avx512_manual.sinc
M	Ghidra/Processors/x86/data/languages/avx_manual.sinc
M	Ghidra/Processors/x86/data/languages/fma.sinc
M	Ghidra/Processors/x86/data/languages/ia.sinc
M	Ghidra/Processors/x86/data/languages/lockable.sinc
A	Ghidra/Processors/x86/data/languages/old/x86RealV3.lang
A	Ghidra/Processors/x86/data/languages/old/x86RealV3.trans
A	Ghidra/Processors/x86/data/languages/old/x86V3.lang
A	Ghidra/Processors/x86/data/languages/old/x86V3.trans
A	Ghidra/Processors/x86/data/languages/old/x86_64bit_compat32_v3.lang
A	Ghidra/Processors/x86/data/languages/old/x86_64bit_compat32_v3.trans
A	Ghidra/Processors/x86/data/languages/old/x86_64bit_v3.lang
A	Ghidra/Processors/x86/data/languages/old/x86_64bit_v3.trans
A	Ghidra/Processors/x86/data/languages/old/x86_ProtV3.lang
A	Ghidra/Processors/x86/data/languages/old/x86_ProtV3.trans
A	Ghidra/Processors/x86/data/languages/old/x86smmV3.lang
A	Ghidra/Processors/x86/data/languages/old/x86smmV3.trans
M	Ghidra/Processors/x86/data/languages/x86.ldefs
M	Ghidra/Processors/x86/data/languages/x86.slaspec
M	Ghidra/Processors/x86/src/main/java/ghidra/app/util/bin/format/elf/extend/X86_32_ElfExtension.java
```

Co-authored-by: pgoodman <43664+pgoodman@users.noreply.github.com>
2024-06-10 04:39:50 -04:00
auto-updater[bot] 1464c57bad Update Ghidra HEAD to commit 22b1b485b (#266)
Bump Ghidra HEAD commit 22b1b485b

Changed files:

```
M	Ghidra/Processors/AARCH64/data/languages/AARCH64.ldefs
M	Ghidra/Processors/AARCH64/data/languages/AARCH64_golang.cspec
M	Ghidra/Processors/AARCH64/data/languages/AARCH64_golang.register.info
M	Ghidra/Processors/SuperH/data/languages/superh.sinc
M	Ghidra/Processors/x86/data/languages/x86-32-golang.register.info
M	Ghidra/Processors/x86/data/languages/x86-64-golang.cspec
M	Ghidra/Processors/x86/data/languages/x86-64-golang.register.info
```

Co-authored-by: pgoodman <43664+pgoodman@users.noreply.github.com>
2024-06-03 11:21:28 -04:00
auto-updater[bot] bddd3b2342 Update Ghidra HEAD to commit fb844be1f (#265)
Bump Ghidra HEAD commit fb844be1f

Changed files:

```
M	Ghidra/Features/Decompiler/src/decompile/cpp/filemanage.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/filemanage.hh
M	Ghidra/Processors/tricore/data/languages/tricore.sinc
```

Co-authored-by: pgoodman <43664+pgoodman@users.noreply.github.com>
2024-05-28 08:29:05 -04:00
auto-updater[bot] 5e84d25f0e Update Ghidra HEAD to commit ef3e74b6d (#264)
Bump Ghidra HEAD commit ef3e74b6d

Changed files:

```
M	Ghidra/Features/Decompiler/src/decompile/cpp/coreaction.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/coreaction.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/fspec.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/fspec.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/funcdata_varnode.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/marshal.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/op.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/ruleaction.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/ruleaction.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/varmap.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/varnode.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/varnode.hh
A	Ghidra/Features/Decompiler/src/decompile/datatests/gp.xml
A	Ghidra/Features/Decompiler/src/decompile/datatests/switchhide.xml
M	Ghidra/Processors/68000/data/languages/68000.cspec
M	Ghidra/Processors/68000/data/languages/68000.sinc
M	Ghidra/Processors/68000/src/main/java/ghidra/program/emulation/m68kEmulateInstructionStateModifier.java
M	Ghidra/Processors/AARCH64/data/languages/AARCH64.dwarf
M	Ghidra/Processors/AARCH64/data/languages/AARCH64_golang.register.info
M	Ghidra/Processors/MCS96/data/languages/MCS96.sinc
M	Ghidra/Processors/MIPS/data/languages/mips32be.cspec
M	Ghidra/Processors/MIPS/data/languages/mips32le.cspec
M	Ghidra/Processors/PIC/data/languages/pic16_instructions.sinc
M	Ghidra/Processors/x86/data/languages/ia.sinc
M	Ghidra/Processors/x86/data/languages/x86-64-golang.register.info
```

Co-authored-by: pgoodman <43664+pgoodman@users.noreply.github.com>
2024-05-19 07:25:33 -04:00
dependabot[bot] 9ebd0d7dbb build(deps): bump softprops/action-gh-release from 2.0.4 to 2.0.5 (#263)
Bumps [softprops/action-gh-release](https://github.com/softprops/action-gh-release) from 2.0.4 to 2.0.5.
- [Release notes](https://github.com/softprops/action-gh-release/releases)
- [Changelog](https://github.com/softprops/action-gh-release/blob/master/CHANGELOG.md)
- [Commits](https://github.com/softprops/action-gh-release/compare/v2.0.4...v2.0.5)

---
updated-dependencies:
- dependency-name: softprops/action-gh-release
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-08 09:09:40 -04:00
Eric Kilmer 92470fe795 CI: Specifically use macos-13 image (#262)
macos-latest now points to Apple Silicon macos-14 image, which is
causing some tests to fail, and macos-13 is the latest that support x86
2024-04-29 13:00:08 -04:00
auto-updater[bot] 39c1230211 Update Ghidra HEAD to commit e6c8f5b53 (#260)
Bump Ghidra HEAD commit e6c8f5b53

Changed files:

```
M	Ghidra/Processors/AARCH64/certification.manifest
M	Ghidra/Processors/AARCH64/data/languages/AARCH64.ldefs
M	Ghidra/Processors/AARCH64/data/languages/AARCH64.opinion
A	Ghidra/Processors/AARCH64/data/languages/AARCH64_golang.cspec
A	Ghidra/Processors/AARCH64/data/languages/AARCH64_golang.register.info
M	Ghidra/Processors/AARCH64/data/languages/AppleSilicon.ldefs
```

Co-authored-by: pgoodman <43664+pgoodman@users.noreply.github.com>
2024-04-29 11:17:17 -04:00
Eric Kilmer ebaea7183a CI: Specifically use macos-12 image (#261)
macos-latest now points to Apple Silicon macos-14 image, which is
causing some tests to fail.
2024-04-29 10:48:00 -04:00
auto-updater[bot] 95e45d8dd9 Update Ghidra HEAD to commit 9abfa3da8 (#259)
* Bump Ghidra HEAD commit 9abfa3da8

Changed files:

```
M	Ghidra/Features/Decompiler/src/decompile/cpp/Makefile
M	Ghidra/Features/Decompiler/src/decompile/cpp/address.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/address.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/block.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/block.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/fspec.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/funcdata.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/funcdata_varnode.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/jumptable.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/jumptable.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/modelrules.hh
A	Ghidra/Features/Decompiler/src/decompile/cpp/multiprecision.cc
A	Ghidra/Features/Decompiler/src/decompile/cpp/multiprecision.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/ruleaction.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/ruleaction.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/slgh_compile.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/varnode.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/varnode.hh
A	Ghidra/Features/Decompiler/src/decompile/datatests/divopt.xml
A	Ghidra/Features/Decompiler/src/decompile/datatests/ifswitch.xml
M	Ghidra/Processors/AARCH64/data/languages/AARCH64_win.cspec
M	Ghidra/Processors/AARCH64/data/languages/AARCH64ldst.sinc
M	Ghidra/Processors/PowerPC/certification.manifest
M	Ghidra/Processors/PowerPC/data/languages/ppc_32_be.cspec
M	Ghidra/Processors/PowerPC/data/languages/ppc_32_e500_be.cspec
M	Ghidra/Processors/PowerPC/data/languages/ppc_32_e500_le.cspec
M	Ghidra/Processors/PowerPC/data/languages/ppc_32_e500mc_be.cspec
M	Ghidra/Processors/PowerPC/data/languages/ppc_32_e500mc_le.cspec
M	Ghidra/Processors/PowerPC/data/languages/ppc_32_le.cspec
M	Ghidra/Processors/PowerPC/data/languages/ppc_64_32.cspec
M	Ghidra/Processors/PowerPC/data/patterns/PPC_BE_patterns.xml
A	Ghidra/Processors/PowerPC/data/patterns/PPC_LE_patterns.xml
M	Ghidra/Processors/PowerPC/data/patterns/patternconstraints.xml
```

* Add new files

---------

Co-authored-by: Eric Kilmer <eric.d.kilmer@gmail.com>
2024-04-22 10:02:27 -04:00
auto-updater[bot] f05a833db4 Update Ghidra HEAD to commit 6c60bd031 (#258)
Bump Ghidra HEAD commit 6c60bd031

Changed files:

```
M	Ghidra/Processors/tricore/data/languages/tricore.cspec
```

Co-authored-by: pgoodman <43664+pgoodman@users.noreply.github.com>
2024-04-15 08:39:16 -04:00
Eric Kilmer 231a28b524 Ghidra 11.0.3 (#257) 2024-04-12 10:17:08 -04:00
auto-updater[bot] 33ac2ef4f6 Update Ghidra HEAD to commit cae9190c1 (#256)
* Bump Ghidra HEAD commit cae9190c1

Changed files:

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

* Remove patches merged upstream
2024-04-08 08:27:01 -04:00
Eric Kilmer 34a699c3bd Update stable to Ghidra v11.0.2 (#255)
* Update spec files list
2024-04-01 15:26:18 -04:00
auto-updater[bot] 05e1de0a8c Update Ghidra HEAD to commit 2a7897c36 (#254)
Bump Ghidra HEAD commit 2a7897c36

Changed files:

```
M	Ghidra/Features/Decompiler/src/decompile/.cproject
M	Ghidra/Features/Decompiler/src/decompile/cpp/cast.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/coreaction.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/coreaction.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/emulateutil.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/ifacedecomp.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/marshal.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/prettyprint.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/prettyprint.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/printlanguage.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/printlanguage.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/sleigh_arch.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/slgh_compile.cc
M	Ghidra/Processors/AARCH64/src/main/java/ghidra/app/util/bin/format/elf/relocation/AARCH64_ElfRelocationType.java
M	Ghidra/Processors/ARM/certification.manifest
M	Ghidra/Processors/ARM/data/languages/ARM.ldefs
M	Ghidra/Processors/ARM/data/languages/ARM.sinc
A	Ghidra/Processors/ARM/data/languages/ARM8m_be.slaspec
A	Ghidra/Processors/ARM/data/languages/ARM8m_le.slaspec
M	Ghidra/Processors/ARM/data/languages/ARMTHUMBinstructions.sinc
A	Ghidra/Processors/ARM/data/languages/ARM_CDE.sinc
M	Ghidra/Processors/ARM/data/languages/ARMinstructions.sinc
M	Ghidra/Processors/ARM/src/main/java/ghidra/app/util/bin/format/elf/relocation/ARM_ElfRelocationType.java
A	Ghidra/Processors/ARM/src/test.processors/java/ghidra/test/processors/ARM_v8m_O0_EmulatorTest.java
A	Ghidra/Processors/ARM/src/test.processors/java/ghidra/test/processors/ARM_v8m_O3_EmulatorTest.java
M	Ghidra/Processors/Atmel/src/main/java/ghidra/app/util/bin/format/elf/relocation/AVR8_ElfRelocationType.java
M	Ghidra/Processors/Loongarch/src/main/java/ghidra/app/util/bin/format/elf/relocation/Loongarch_ElfRelocationType.java
M	Ghidra/Processors/MIPS/data/patterns/MIPS_BE_patterns.xml
M	Ghidra/Processors/MIPS/data/patterns/MIPS_LE_patterns.xml
M	Ghidra/Processors/MIPS/src/main/java/ghidra/app/util/bin/format/elf/relocation/MIPS_ElfRelocationContext.java
M	Ghidra/Processors/MIPS/src/main/java/ghidra/app/util/bin/format/elf/relocation/MIPS_ElfRelocationType.java
M	Ghidra/Processors/PowerPC/data/languages/ppc_instructions.sinc
M	Ghidra/Processors/PowerPC/src/main/java/ghidra/app/util/bin/format/elf/relocation/PowerPC64_ElfRelocationType.java
M	Ghidra/Processors/PowerPC/src/main/java/ghidra/app/util/bin/format/elf/relocation/PowerPC_ElfRelocationHandler.java
M	Ghidra/Processors/PowerPC/src/main/java/ghidra/app/util/bin/format/elf/relocation/PowerPC_ElfRelocationType.java
M	Ghidra/Processors/RISCV/src/main/java/ghidra/app/util/bin/format/elf/relocation/RISCV_ElfRelocationType.java
M	Ghidra/Processors/Sparc/certification.manifest
A	Ghidra/Processors/Sparc/data/languages/Sparc.dwarf
M	Ghidra/Processors/Sparc/data/languages/SparcV9.ldefs
M	Ghidra/Processors/Sparc/src/main/java/ghidra/app/util/bin/format/elf/relocation/SPARC_ElfRelocationType.java
M	Ghidra/Processors/SuperH4/src/main/java/ghidra/app/util/bin/format/elf/relocation/SH_ElfRelocationType.java
M	Ghidra/Processors/TI_MSP430/data/languages/TI430Common.sinc
M	Ghidra/Processors/TI_MSP430/data/languages/TI430X.sinc
M	Ghidra/Processors/Toy/data/languages/old/v01stuff/toy.sinc
M	Ghidra/Processors/Xtensa/data/languages/xtensa.cspec
M	Ghidra/Processors/eBPF/src/main/java/ghidra/app/util/bin/format/elf/relocation/eBPF_ElfRelocationType.java
M	Ghidra/Processors/tricore/certification.manifest
M	Ghidra/Processors/tricore/data/languages/tricore.pspec
M	Ghidra/Processors/tricore/data/languages/tricore.sinc
A	Ghidra/Processors/tricore/data/patterns/patternconstraints.xml
A	Ghidra/Processors/tricore/data/patterns/tricore_patterns.xml
A	Ghidra/Processors/tricore/src/main/java/ghidra/app/util/bin/format/elf/relocation/Tricore_ElfRelocationHandler.java
A	Ghidra/Processors/tricore/src/main/java/ghidra/app/util/bin/format/elf/relocation/Tricore_ElfRelocationType.java
M	Ghidra/Processors/x86/data/languages/ia.sinc
M	Ghidra/Processors/x86/src/main/java/ghidra/app/util/bin/format/elf/relocation/X86_32_ElfRelocationType.java
M	Ghidra/Processors/x86/src/main/java/ghidra/app/util/bin/format/elf/relocation/X86_64_ElfRelocationContext.java
M	Ghidra/Processors/x86/src/main/java/ghidra/app/util/bin/format/elf/relocation/X86_64_ElfRelocationType.java
```

Co-authored-by: ekilmer <816362+ekilmer@users.noreply.github.com>
2024-04-01 11:37:00 -04:00
auto-updater[bot] 24b9034914 Update Ghidra HEAD to commit 317a88148 (#245)
Upstream has added a compression mechanism for compiled sleigh files. They use Zlib to perform the compression and have added the source code to the Ghidra repo. However, this commit does not use Ghidra's Zlib source and instead searches for it on the host.

This commit also fixes a number of bugs that prevent various parts of the CI pipeline from working on supported OSes. These patches will be reported upstream.

Changed files:

```
M	Ghidra/Features/Decompiler/src/decompile/cpp/Makefile
M	Ghidra/Features/Decompiler/src/decompile/cpp/address.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/architecture.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/block.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/comment.hh
A	Ghidra/Features/Decompiler/src/decompile/cpp/compression.cc
A	Ghidra/Features/Decompiler/src/decompile/cpp/compression.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/float.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/float.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/flow.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/fspec.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/fspec.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/funcdata.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/funcdata_block.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/ifacedecomp.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/inject_sleigh.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/jumptable.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/marshal.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/marshal.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/op.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/op.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/options.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/pcodeparse.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/pcodeparse.y
M	Ghidra/Features/Decompiler/src/decompile/cpp/semantics.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/semantics.hh
A	Ghidra/Features/Decompiler/src/decompile/cpp/slaformat.cc
A	Ghidra/Features/Decompiler/src/decompile/cpp/slaformat.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/sleigh.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/sleigh_arch.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/sleighbase.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/sleighbase.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/slgh_compile.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/slgh_compile.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/slghparse.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/slghparse.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/slghparse.y
M	Ghidra/Features/Decompiler/src/decompile/cpp/slghpatexpress.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/slghpatexpress.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/slghpattern.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/slghpattern.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/slghscan.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/slghscan.l
M	Ghidra/Features/Decompiler/src/decompile/cpp/slghsymbol.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/slghsymbol.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/space.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/space.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/translate.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/translate.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/type.cc
M	Ghidra/Features/Decompiler/src/decompile/unittests/testfuncproto.cc
M	Ghidra/Features/Decompiler/src/decompile/unittests/testmarshal.cc
A	Ghidra/Features/Decompiler/src/decompile/zlib/README.txt
A	Ghidra/Features/Decompiler/src/decompile/zlib/adler32.c
A	Ghidra/Features/Decompiler/src/decompile/zlib/deflate.c
A	Ghidra/Features/Decompiler/src/decompile/zlib/deflate.h
A	Ghidra/Features/Decompiler/src/decompile/zlib/gzguts.h
A	Ghidra/Features/Decompiler/src/decompile/zlib/inffast.c
A	Ghidra/Features/Decompiler/src/decompile/zlib/inffast.h
A	Ghidra/Features/Decompiler/src/decompile/zlib/inffixed.h
A	Ghidra/Features/Decompiler/src/decompile/zlib/inflate.c
A	Ghidra/Features/Decompiler/src/decompile/zlib/inflate.h
A	Ghidra/Features/Decompiler/src/decompile/zlib/inftrees.c
A	Ghidra/Features/Decompiler/src/decompile/zlib/inftrees.h
A	Ghidra/Features/Decompiler/src/decompile/zlib/trees.c
A	Ghidra/Features/Decompiler/src/decompile/zlib/trees.h
A	Ghidra/Features/Decompiler/src/decompile/zlib/zconf.h
A	Ghidra/Features/Decompiler/src/decompile/zlib/zlib.h
A	Ghidra/Features/Decompiler/src/decompile/zlib/zutil.c
A	Ghidra/Features/Decompiler/src/decompile/zlib/zutil.h
M	Ghidra/Processors/68000/data/languages/68000.ldefs
M	Ghidra/Processors/AARCH64/certification.manifest
M	Ghidra/Processors/AARCH64/data/languages/AARCH64.ldefs
M	Ghidra/Processors/AARCH64/data/languages/AARCH64.opinion
A	Ghidra/Processors/AARCH64/data/languages/AARCH64_swift.cspec
M	Ghidra/Processors/AARCH64/data/languages/AppleSilicon.ldefs
M	Ghidra/Processors/ARM/data/languages/ARM.ldefs
M	Ghidra/Processors/Loongarch/data/languages/loongarch.ldefs
M	Ghidra/Processors/MIPS/data/languages/mips.ldefs
M	Ghidra/Processors/PA-RISC/data/languages/pa-risc.sinc
M	Ghidra/Processors/PowerPC/data/languages/ppc.ldefs
M	Ghidra/Processors/RISCV/data/languages/riscv.ldefs
M	Ghidra/Processors/Sparc/data/languages/SparcV9.ldefs
M	Ghidra/Processors/SuperH4/data/languages/SuperH4.ldefs
M	Ghidra/Processors/Xtensa/data/languages/xtensa.ldefs
M	Ghidra/Processors/x86/certification.manifest
A	Ghidra/Processors/x86/data/languages/x86-64-swift.cspec
M	Ghidra/Processors/x86/data/languages/x86.ldefs
M	Ghidra/Processors/x86/data/languages/x86.opinion
```
2024-04-01 09:58:27 -04:00
dependabot[bot] f2323af0ee build(deps): bump softprops/action-gh-release from 2.0.3 to 2.0.4 (#249)
Bumps [softprops/action-gh-release](https://github.com/softprops/action-gh-release) from 2.0.3 to 2.0.4.
- [Release notes](https://github.com/softprops/action-gh-release/releases)
- [Changelog](https://github.com/softprops/action-gh-release/blob/master/CHANGELOG.md)
- [Commits](https://github.com/softprops/action-gh-release/compare/v2.0.3...v2.0.4)

---
updated-dependencies:
- dependency-name: softprops/action-gh-release
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-03-18 10:38:21 -04:00
dependabot[bot] c3908f6d90 build(deps): bump softprops/action-gh-release from 2.0.2 to 2.0.3 (#248)
Bumps [softprops/action-gh-release](https://github.com/softprops/action-gh-release) from 2.0.2 to 2.0.3.
- [Release notes](https://github.com/softprops/action-gh-release/releases)
- [Changelog](https://github.com/softprops/action-gh-release/blob/master/CHANGELOG.md)
- [Commits](https://github.com/softprops/action-gh-release/compare/v2.0.2...v2.0.3)

---
updated-dependencies:
- dependency-name: softprops/action-gh-release
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-03-12 09:14:23 -04:00
dependabot[bot] 6924bbce83 build(deps): bump softprops/action-gh-release from 0.1.15 to 2.0.2 (#247)
Bumps [softprops/action-gh-release](https://github.com/softprops/action-gh-release) from 0.1.15 to 2.0.2.
- [Release notes](https://github.com/softprops/action-gh-release/releases)
- [Changelog](https://github.com/softprops/action-gh-release/blob/master/CHANGELOG.md)
- [Commits](https://github.com/softprops/action-gh-release/compare/v0.1.15...v2.0.2)

---
updated-dependencies:
- dependency-name: softprops/action-gh-release
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-03-11 09:08:06 -04:00
auto-updater[bot] 1c23eba9ea Update Ghidra HEAD to commit c5bad0a88 (#244)
Bump Ghidra HEAD commit c5bad0a88

Changed files:

```
M	Ghidra/Processors/AARCH64/data/languages/AARCH64base.sinc
M	Ghidra/Processors/tricore/data/languages/tricore.cspec
```

Co-authored-by: pgoodman <43664+pgoodman@users.noreply.github.com>
2024-02-28 15:48:37 -05:00
auto-updater[bot] 0353b200d8 Update Ghidra HEAD to commit 6d6d0317e (#243)
Bump Ghidra HEAD commit 6d6d0317e

Changed files:

```
M	Ghidra/Features/Decompiler/src/decompile/cpp/grammar.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/grammar.y
M	Ghidra/Features/Decompiler/src/decompile/cpp/jumptable.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/type.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/type.hh
D	Ghidra/Processors/AARCH64/src/main/java/ghidra/app/util/bin/format/elf/relocation/AARCH64_ElfRelocationConstants.java
M	Ghidra/Processors/AARCH64/src/main/java/ghidra/app/util/bin/format/elf/relocation/AARCH64_ElfRelocationHandler.java
A	Ghidra/Processors/AARCH64/src/main/java/ghidra/app/util/bin/format/elf/relocation/AARCH64_ElfRelocationType.java
D	Ghidra/Processors/ARM/src/main/java/ghidra/app/util/bin/format/elf/relocation/ARM_ElfRelocationConstants.java
M	Ghidra/Processors/ARM/src/main/java/ghidra/app/util/bin/format/elf/relocation/ARM_ElfRelocationContext.java
M	Ghidra/Processors/ARM/src/main/java/ghidra/app/util/bin/format/elf/relocation/ARM_ElfRelocationHandler.java
A	Ghidra/Processors/ARM/src/main/java/ghidra/app/util/bin/format/elf/relocation/ARM_ElfRelocationType.java
M	Ghidra/Processors/ARM/src/main/java/ghidra/app/util/bin/format/elf/relocation/ElfArmRelocationFixupHandler.java
D	Ghidra/Processors/Atmel/src/main/java/ghidra/app/util/bin/format/elf/AVR8_ElfRelocationConstants.java
M	Ghidra/Processors/Atmel/src/main/java/ghidra/app/util/bin/format/elf/relocation/AVR32_ElfRelocationHandler.java
R073	Ghidra/Processors/Atmel/src/main/java/ghidra/app/util/bin/format/elf/AVR32_ElfRelocationConstants.java	Ghidra/Processors/Atmel/src/main/java/ghidra/app/util/bin/format/elf/relocation/AVR32_ElfRelocationType.java
M	Ghidra/Processors/Atmel/src/main/java/ghidra/app/util/bin/format/elf/relocation/AVR8_ElfRelocationHandler.java
A	Ghidra/Processors/Atmel/src/main/java/ghidra/app/util/bin/format/elf/relocation/AVR8_ElfRelocationType.java
D	Ghidra/Processors/Loongarch/src/main/java/ghidra/app/util/bin/format/elf/relocation/Loongarch_ElfRelocationConstants.java
M	Ghidra/Processors/Loongarch/src/main/java/ghidra/app/util/bin/format/elf/relocation/Loongarch_ElfRelocationHandler.java
A	Ghidra/Processors/Loongarch/src/main/java/ghidra/app/util/bin/format/elf/relocation/Loongarch_ElfRelocationType.java
D	Ghidra/Processors/MIPS/src/main/java/ghidra/app/util/bin/format/elf/relocation/MIPS_ElfRelocationConstants.java
M	Ghidra/Processors/MIPS/src/main/java/ghidra/app/util/bin/format/elf/relocation/MIPS_ElfRelocationContext.java
M	Ghidra/Processors/MIPS/src/main/java/ghidra/app/util/bin/format/elf/relocation/MIPS_ElfRelocationHandler.java
A	Ghidra/Processors/MIPS/src/main/java/ghidra/app/util/bin/format/elf/relocation/MIPS_ElfRelocationType.java
M	Ghidra/Processors/PIC/src/main/java/ghidra/app/util/bin/format/elf/relocation/PIC30_ElfRelocationContext.java
M	Ghidra/Processors/PIC/src/main/java/ghidra/app/util/bin/format/elf/relocation/PIC30_ElfRelocationHandler.java
A	Ghidra/Processors/PIC/src/main/java/ghidra/app/util/bin/format/elf/relocation/PIC30_ElfRelocationType.java
M	Ghidra/Processors/PowerPC/src/main/java/ghidra/app/util/bin/format/elf/extend/PowerPC64_ElfExtension.java
D	Ghidra/Processors/PowerPC/src/main/java/ghidra/app/util/bin/format/elf/relocation/PowerPC64_ElfRelocationConstants.java
M	Ghidra/Processors/PowerPC/src/main/java/ghidra/app/util/bin/format/elf/relocation/PowerPC64_ElfRelocationHandler.java
A	Ghidra/Processors/PowerPC/src/main/java/ghidra/app/util/bin/format/elf/relocation/PowerPC64_ElfRelocationType.java
D	Ghidra/Processors/PowerPC/src/main/java/ghidra/app/util/bin/format/elf/relocation/PowerPC_ElfRelocationConstants.java
A	Ghidra/Processors/PowerPC/src/main/java/ghidra/app/util/bin/format/elf/relocation/PowerPC_ElfRelocationContext.java
M	Ghidra/Processors/PowerPC/src/main/java/ghidra/app/util/bin/format/elf/relocation/PowerPC_ElfRelocationHandler.java
A	Ghidra/Processors/PowerPC/src/main/java/ghidra/app/util/bin/format/elf/relocation/PowerPC_ElfRelocationType.java
D	Ghidra/Processors/RISCV/src/main/java/ghidra/app/util/bin/format/elf/relocation/RISCV_ElfRelocationConstants.java
M	Ghidra/Processors/RISCV/src/main/java/ghidra/app/util/bin/format/elf/relocation/RISCV_ElfRelocationContext.java
M	Ghidra/Processors/RISCV/src/main/java/ghidra/app/util/bin/format/elf/relocation/RISCV_ElfRelocationHandler.java
A	Ghidra/Processors/RISCV/src/main/java/ghidra/app/util/bin/format/elf/relocation/RISCV_ElfRelocationType.java
D	Ghidra/Processors/Sparc/src/main/java/ghidra/app/util/bin/format/elf/relocation/SPARC_ElfRelocationConstants.java
M	Ghidra/Processors/Sparc/src/main/java/ghidra/app/util/bin/format/elf/relocation/SPARC_ElfRelocationHandler.java
A	Ghidra/Processors/Sparc/src/main/java/ghidra/app/util/bin/format/elf/relocation/SPARC_ElfRelocationType.java
M	Ghidra/Processors/SuperH4/src/main/java/ghidra/app/util/bin/format/elf/relocation/ElfSH4RelocationFixupHandler.java
D	Ghidra/Processors/SuperH4/src/main/java/ghidra/app/util/bin/format/elf/relocation/SH_ElfRelocationConstants.java
M	Ghidra/Processors/SuperH4/src/main/java/ghidra/app/util/bin/format/elf/relocation/SH_ElfRelocationHandler.java
A	Ghidra/Processors/SuperH4/src/main/java/ghidra/app/util/bin/format/elf/relocation/SH_ElfRelocationType.java
D	Ghidra/Processors/TI_MSP430/src/main/java/ghidra/app/util/bin/format/elf/relocation/MSP430X_ElfRelocationConstants.java
M	Ghidra/Processors/TI_MSP430/src/main/java/ghidra/app/util/bin/format/elf/relocation/MSP430X_ElfRelocationHandler.java
A	Ghidra/Processors/TI_MSP430/src/main/java/ghidra/app/util/bin/format/elf/relocation/MSP430X_ElfRelocationType.java
M	Ghidra/Processors/TI_MSP430/src/main/java/ghidra/app/util/bin/format/elf/relocation/MSP430_ElfRelocationHandler.java
R050	Ghidra/Processors/TI_MSP430/src/main/java/ghidra/app/util/bin/format/elf/relocation/MSP430_ElfRelocationConstants.java	Ghidra/Processors/TI_MSP430/src/main/java/ghidra/app/util/bin/format/elf/relocation/MSP430_ElfRelocationType.java
D	Ghidra/Processors/Xtensa/src/main/java/ghidra/app/util/bin/format/elf/relocation/Xtensa_ElfRelocationConstants.java
M	Ghidra/Processors/Xtensa/src/main/java/ghidra/app/util/bin/format/elf/relocation/Xtensa_ElfRelocationHandler.java
A	Ghidra/Processors/Xtensa/src/main/java/ghidra/app/util/bin/format/elf/relocation/Xtensa_ElfRelocationType.java
D	Ghidra/Processors/eBPF/src/main/java/ghidra/app/util/bin/format/elf/relocation/ElfeBPFRelocationFixupHandler.java
M	Ghidra/Processors/eBPF/src/main/java/ghidra/app/util/bin/format/elf/relocation/eBPF_ElfRelocationHandler.java
R055	Ghidra/Processors/eBPF/src/main/java/ghidra/app/util/bin/format/elf/relocation/eBPF_ElfRelocationConstants.java	Ghidra/Processors/eBPF/src/main/java/ghidra/app/util/bin/format/elf/relocation/eBPF_ElfRelocationType.java
M	Ghidra/Processors/x86/src/main/java/ghidra/app/util/bin/format/elf/relocation/Elfx86_32bitRelocationFixupHandler.java
M	Ghidra/Processors/x86/src/main/java/ghidra/app/util/bin/format/elf/relocation/Elfx86_64bitRelocationFixupHandler.java
D	Ghidra/Processors/x86/src/main/java/ghidra/app/util/bin/format/elf/relocation/X86_32_ElfRelocationConstants.java
M	Ghidra/Processors/x86/src/main/java/ghidra/app/util/bin/format/elf/relocation/X86_32_ElfRelocationHandler.java
A	Ghidra/Processors/x86/src/main/java/ghidra/app/util/bin/format/elf/relocation/X86_32_ElfRelocationType.java
D	Ghidra/Processors/x86/src/main/java/ghidra/app/util/bin/format/elf/relocation/X86_64_ElfRelocationConstants.java
M	Ghidra/Processors/x86/src/main/java/ghidra/app/util/bin/format/elf/relocation/X86_64_ElfRelocationContext.java
M	Ghidra/Processors/x86/src/main/java/ghidra/app/util/bin/format/elf/relocation/X86_64_ElfRelocationHandler.java
A	Ghidra/Processors/x86/src/main/java/ghidra/app/util/bin/format/elf/relocation/X86_64_ElfRelocationType.java
```

Co-authored-by: pgoodman <43664+pgoodman@users.noreply.github.com>
2024-02-19 11:45:54 -05:00
auto-updater[bot] 1dcdea8701 Update Ghidra HEAD to commit 74d52deab (#242)
Bump Ghidra HEAD commit 74d52deab

Changed files:

```
M	Ghidra/Features/Decompiler/src/decompile/cpp/flow.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/flow.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/funcdata.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/funcdata_block.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/funcdata_varnode.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/jumptable.hh
A	Ghidra/Features/Decompiler/src/decompile/datatests/switchreturn.xml
M	Ghidra/Processors/ARM/data/languages/ARMTHUMBinstructions.sinc
M	Ghidra/Processors/ARM/data/languages/ARMinstructions.sinc
M	Ghidra/Processors/MC6800/data/languages/6x09.sinc
M	Ghidra/Processors/Xtensa/data/languages/xtensa.ldefs
M	Ghidra/Processors/Xtensa/data/languages/xtensaInstructions.sinc
M	Ghidra/Processors/Z80/data/languages/z80.slaspec
```

Co-authored-by: pgoodman <43664+pgoodman@users.noreply.github.com>
2024-02-12 09:24:59 -05:00
auto-updater[bot] 76e5cb4aca Update Ghidra HEAD to commit 33f90ba1c (#241)
Bump Ghidra HEAD commit 33f90ba1c

Changed files:

```
M	Ghidra/Processors/Xtensa/src/main/java/ghidra/app/util/bin/format/elf/relocation/Xtensa_ElfRelocationHandler.java
```

Co-authored-by: pgoodman <43664+pgoodman@users.noreply.github.com>
2024-02-05 11:36:04 +11:00
dependabot[bot] 09ba8106d6 build(deps): bump peter-evans/create-pull-request from 5 to 6 (#240)
Bumps [peter-evans/create-pull-request](https://github.com/peter-evans/create-pull-request) from 5 to 6.
- [Release notes](https://github.com/peter-evans/create-pull-request/releases)
- [Commits](https://github.com/peter-evans/create-pull-request/compare/v5...v6)

---
updated-dependencies:
- dependency-name: peter-evans/create-pull-request
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Alex Cameron <asc@tetsuo.sh>
2024-02-01 19:46:36 +11:00
dependabot[bot] aa46946172 build(deps): bump nick-fields/retry from 2 to 3 (#239)
Bumps [nick-fields/retry](https://github.com/nick-fields/retry) from 2 to 3.
- [Release notes](https://github.com/nick-fields/retry/releases)
- [Changelog](https://github.com/nick-fields/retry/blob/master/.releaserc.js)
- [Commits](https://github.com/nick-fields/retry/compare/v2...v3)

---
updated-dependencies:
- dependency-name: nick-fields/retry
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-01 18:28:46 +11:00
Alex Cameron 6e0feed91c Update stable to Ghidra v11.0.1 (#238) 2024-01-31 09:00:28 -05:00
auto-updater[bot] acabb5ffc5 Update Ghidra HEAD to commit e73d2088e (#237)
Bump Ghidra HEAD commit e73d2088e

Changed files:

```
M	Ghidra/Processors/PowerPC/data/languages/ppc.ldefs
M	Ghidra/Processors/PowerPC/data/languages/ppc_vle.sinc
M	Ghidra/Processors/tricore/data/languages/tc176x.pspec
M	Ghidra/Processors/x86/data/languages/ia.sinc
M	Ghidra/Processors/x86/src/main/java/ghidra/app/util/bin/format/elf/relocation/X86_64_ElfRelocationContext.java
```

Co-authored-by: pgoodman <pgoodman@users.noreply.github.com>
2024-01-29 11:41:41 +11:00
auto-updater[bot] 4becc755e9 Update Ghidra HEAD to commit 85d276bce (#236)
Bump Ghidra HEAD commit 85d276bce

Changed files:

```
M	Ghidra/Features/Decompiler/src/decompile/cpp/condexe.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/condexe.hh
M	Ghidra/Processors/Loongarch/data/languages/loongarch32_instructions.sinc
M	Ghidra/Processors/Loongarch/data/languages/loongarch_main.sinc
M	Ghidra/Processors/PowerPC/certification.manifest
M	Ghidra/Processors/PowerPC/data/languages/4xx.sinc
A	Ghidra/Processors/PowerPC/data/languages/mulhwInstructions.sinc
M	Ghidra/Processors/PowerPC/data/languages/ppc.ldefs
M	Ghidra/Processors/PowerPC/data/languages/ppc_instructions.sinc
M	Ghidra/Processors/PowerPC/data/languages/ppc_isa.sinc
M	Ghidra/Processors/TI_MSP430/build.gradle
M	Ghidra/Processors/TI_MSP430/data/languages/TI430X.sinc
M	Ghidra/Processors/TI_MSP430/data/languages/TI_MSP430.ldefs
M	Ghidra/Processors/TI_MSP430/data/languages/ti_msp430.opinion
A	Ghidra/Processors/TI_MSP430/src/main/java/ghidra/app/util/bin/format/elf/extend/MSP430_ElfExtension.java
A	Ghidra/Processors/TI_MSP430/src/main/java/ghidra/app/util/bin/format/elf/relocation/MSP430X_ElfRelocationConstants.java
A	Ghidra/Processors/TI_MSP430/src/main/java/ghidra/app/util/bin/format/elf/relocation/MSP430X_ElfRelocationHandler.java
A	Ghidra/Processors/TI_MSP430/src/main/java/ghidra/app/util/bin/format/elf/relocation/MSP430_ElfRelocationConstants.java
A	Ghidra/Processors/TI_MSP430/src/main/java/ghidra/app/util/bin/format/elf/relocation/MSP430_ElfRelocationHandler.java
A	Ghidra/Processors/TI_MSP430/src/test.processors/java/ghidra/test/processors/MSP430X_O0_EmulatorTest.java
A	Ghidra/Processors/TI_MSP430/src/test.processors/java/ghidra/test/processors/MSP430X_O3_EmulatorTest.java
A	Ghidra/Processors/TI_MSP430/src/test.processors/java/ghidra/test/processors/MSP430_O0_EmulatorTest.java
A	Ghidra/Processors/TI_MSP430/src/test.processors/java/ghidra/test/processors/MSP430_O3_EmulatorTest.java
```

Co-authored-by: pgoodman <pgoodman@users.noreply.github.com>
2024-01-22 15:01:57 +11:00
dependabot[bot] a1a03dbd26 build(deps): bump actions/cache from 3 to 4 (#235)
Bumps [actions/cache](https://github.com/actions/cache) from 3 to 4.
- [Release notes](https://github.com/actions/cache/releases)
- [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md)
- [Commits](https://github.com/actions/cache/compare/v3...v4)

---
updated-dependencies:
- dependency-name: actions/cache
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-01-18 18:18:36 -05:00
auto-updater[bot] 403275e36c Update Ghidra HEAD to commit 3410dc1ad (#234)
Bump Ghidra HEAD commit 3410dc1ad

Changed files:

```
M	Ghidra/Features/Decompiler/src/decompile/cpp/fspec.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/heritage.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/heritage.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/modelrules.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/modelrules.hh
M	Ghidra/Processors/HCS12/data/languages/HCS_HC12.sinc
M	Ghidra/Processors/x86/data/languages/x86-64-golang.register.info
```

Co-authored-by: pgoodman <pgoodman@users.noreply.github.com>
2024-01-15 15:28:43 +11:00
Eric Kilmer 98158b7ebb CI: Smoketest pcode generation (#233) 2024-01-08 16:18:03 -05:00
auto-updater[bot] e6f6d4398f Update Ghidra HEAD to commit 61f84adc3 (#232)
Bump Ghidra HEAD commit 61f84adc3

Changed files:

```
M	Ghidra/Processors/MIPS/src/main/java/ghidra/app/util/bin/format/elf/extend/MIPS_ElfExtension.java
M	Ghidra/Processors/PowerPC/data/languages/PowerPC.opinion
A	Ghidra/Processors/PowerPC/src/main/java/ghidra/app/util/bin/format/coff/relocation/PowerPC_CoffRelocationHandler.java
```

Co-authored-by: pgoodman <pgoodman@users.noreply.github.com>
2024-01-08 12:08:40 +11:00
Alex Cameron 81a04f2e1c Update stable to Ghidra v11.0 (#230)
* Fix a few more sleigh_RELEASE_IS_HEAD checks

* Update stable sleighspec file list

---------

Co-authored-by: Eric Kilmer <eric.d.kilmer@gmail.com>
2024-01-02 14:50:55 +00:00
auto-updater[bot] a0345f9df2 Update Ghidra HEAD to commit fa8eff4d3 (#231)
Bump Ghidra HEAD commit fa8eff4d3

Changed files:

```
M	Ghidra/Processors/HCS08/certification.manifest
M	Ghidra/Processors/HCS08/data/languages/HC05-M68HC05TB.pspec
A	Ghidra/Processors/HCS08/data/languages/HC05.cspec
M	Ghidra/Processors/HCS08/data/languages/HC05.ldefs
M	Ghidra/Processors/HCS08/data/languages/HC05.pspec
M	Ghidra/Processors/HCS08/data/languages/HCS08.cspec
M	Ghidra/Processors/HCS08/data/languages/HCS_HC.sinc
```

Co-authored-by: pgoodman <pgoodman@users.noreply.github.com>
2024-01-02 14:28:54 +11:00
Eric Kilmer 0c3b79aa33 Switch from "sleigh" to "ghidra" for include directory (#229)
This breaking change only affects header files from upstream Ghidra repository.

Instead of `#include <sleigh/header.hh>`, it will now be
`#include <ghidra/header.hh>` for headers from upstream.

---------

Co-authored-by: Alex Cameron <asc@tetsuo.sh>
2023-12-29 13:35:01 -05:00
Eric Kilmer b4f479a86f Add missing/new files for HEAD release (#228)
* Add new files to HEAD source list(s)

* Install missing headers

* Add extra headers that were missing
2023-12-25 14:10:09 -05:00
Eric Kilmer ee82a39842 Add note about extra ghidra namespace (#185) 2023-12-25 13:43:03 -05:00
auto-updater[bot] 71870b0bcd Update Ghidra HEAD to commit f7013bdfa (#227)
Bump Ghidra HEAD commit f7013bdfa

Changed files:

```
M	Ghidra/Features/Decompiler/src/decompile/cpp/Makefile
A	Ghidra/Features/Decompiler/src/decompile/cpp/analyzesigs.cc
A	Ghidra/Features/Decompiler/src/decompile/cpp/analyzesigs.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/architecture.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/fspec.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/grammar.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/grammar.y
M	Ghidra/Features/Decompiler/src/decompile/cpp/modelrules.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/printc.cc
A	Ghidra/Features/Decompiler/src/decompile/cpp/signature.cc
A	Ghidra/Features/Decompiler/src/decompile/cpp/signature.hh
A	Ghidra/Features/Decompiler/src/decompile/cpp/signature_ghidra.cc
A	Ghidra/Features/Decompiler/src/decompile/cpp/signature_ghidra.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/type.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/type.hh
M	Ghidra/Processors/Atmel/data/languages/avr8.sinc
M	Ghidra/Processors/Atmel/src/test.processors/java/ghidra/test/processors/AVR8_31_GCC_O0_EmulatorTest.java
M	Ghidra/Processors/Atmel/src/test.processors/java/ghidra/test/processors/AVR8_31_GCC_O3_EmulatorTest.java
M	Ghidra/Processors/Atmel/src/test.processors/java/ghidra/test/processors/AVR8_51_GCC_O0_EmulatorTest.java
M	Ghidra/Processors/Atmel/src/test.processors/java/ghidra/test/processors/AVR8_51_GCC_O3_EmulatorTest.java
M	Ghidra/Processors/Atmel/src/test.processors/java/ghidra/test/processors/AVR8_6_GCC_O0_EmulatorTest.java
M	Ghidra/Processors/Atmel/src/test.processors/java/ghidra/test/processors/AVR8_6_GCC_O3_EmulatorTest.java
M	Ghidra/Processors/Atmel/src/test.processors/java/ghidra/test/processors/AVR8_xmega_GCC_O0_EmulatorTest.java
M	Ghidra/Processors/Atmel/src/test.processors/java/ghidra/test/processors/AVR8_xmega_GCC_O3_EmulatorTest.java
A	Ghidra/Processors/Loongarch/src/main/java/ghidra/app/util/bin/format/elf/relocation/Loongarch_ElfRelocationConstants.java
A	Ghidra/Processors/Loongarch/src/main/java/ghidra/app/util/bin/format/elf/relocation/Loongarch_ElfRelocationHandler.java
M	Ghidra/Processors/MIPS/data/languages/mips32Instructions.sinc
M	Ghidra/Processors/PIC/data/languages/PIC24.sinc
M	Ghidra/Processors/PowerPC/certification.manifest
A	Ghidra/Processors/PowerPC/data/languages/SPE_FloatMulAdd.sinc
M	Ghidra/Processors/PowerPC/data/languages/Scalar_SPFP.sinc
M	Ghidra/Processors/PowerPC/data/languages/ppc.ldefs
A	Ghidra/Processors/PowerPC/data/languages/ppc_32_e500mc_be.cspec
A	Ghidra/Processors/PowerPC/data/languages/ppc_32_e500mc_be.slaspec
A	Ghidra/Processors/PowerPC/data/languages/ppc_32_e500mc_le.cspec
A	Ghidra/Processors/PowerPC/data/languages/ppc_32_e500mc_le.slaspec
M	Ghidra/Processors/PowerPC/data/languages/ppc_64_isa_vle_be.slaspec
M	Ghidra/Processors/PowerPC/data/languages/ppc_instructions.sinc
M	Ghidra/Processors/PowerPC/data/languages/ppc_vle.sinc
M	Ghidra/Processors/TI_MSP430/certification.manifest
M	Ghidra/Processors/TI_MSP430/data/languages/TI_MSP430.cspec
A	Ghidra/Processors/TI_MSP430/data/languages/TI_MSP430.dwarf
M	Ghidra/Processors/TI_MSP430/data/languages/TI_MSP430.ldefs
M	Ghidra/Processors/TI_MSP430/data/languages/TI_MSP430X.cspec
A	Ghidra/Processors/TI_MSP430/data/languages/TI_MSP430X.dwarf
M	Ghidra/Processors/x86/data/extensions/rust/unix/cc.xml
M	Ghidra/Processors/x86/src/main/java/ghidra/app/util/bin/format/elf/relocation/X86_64_ElfRelocationContext.java
M	Ghidra/Processors/x86/src/main/java/ghidra/app/util/bin/format/elf/relocation/X86_64_ElfRelocationHandler.java
```

Co-authored-by: pgoodman <pgoodman@users.noreply.github.com>
2023-12-25 12:05:09 -05:00
dependabot[bot] b2cd7abc2e build(deps): bump actions/upload-artifact from 3 to 4 (#226)
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 3 to 4.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/v3...v4)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-12-15 18:02:38 +11:00
auto-updater[bot] 40d91fd61b Update Ghidra HEAD to commit 6242fda15 (#225)
Bump Ghidra HEAD commit 6242fda15

Changed files:

```
M	Ghidra/Features/Decompiler/src/decompile/cpp/coreaction.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/double.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/double.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/heritage.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/marshal.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/modelrules.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/modelrules.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/options.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/options.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/prettyprint.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/prettyprint.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/printc.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/printc.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/type.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/type.hh
M	Ghidra/Processors/68000/data/languages/68000.sinc
M	Ghidra/Processors/JVM/src/main/java/ghidra/javaclass/format/ClassFileAnalysisState.java
M	Ghidra/Processors/MIPS/data/languages/mips.ldefs
M	Ghidra/Processors/MIPS/data/languages/mips32Instructions.sinc
M	Ghidra/Processors/RISCV/data/languages/riscv.custom.sinc
M	Ghidra/Processors/SuperH/data/languages/superh.sinc
M	Ghidra/Processors/x86/certification.manifest
A	Ghidra/Processors/x86/data/extensions/rust/unix/cc.xml
A	Ghidra/Processors/x86/data/extensions/rust/unix/probe_fixup.xml
A	Ghidra/Processors/x86/data/extensions/rust/unix/try_fixup.xml
A	Ghidra/Processors/x86/data/extensions/rust/windows/probe_fixup.xml
A	Ghidra/Processors/x86/data/extensions/rust/windows/try_fixup.xml
M	Ghidra/Processors/x86/data/languages/ia.sinc
M	Ghidra/Processors/x86/data/languages/x86-64-gcc.cspec
M	Ghidra/Processors/x86/data/languages/x86-64-win.cspec
M	Ghidra/Processors/x86/data/languages/x86.opinion
M	Ghidra/Processors/x86/data/languages/x86gcc.cspec
M	Ghidra/Processors/x86/data/languages/x86win.cspec
```

Co-authored-by: pgoodman <pgoodman@users.noreply.github.com>
2023-12-11 12:49:48 +11:00
dependabot[bot] 67c695f263 build(deps): bump actions/setup-python from 4 to 5 (#224)
Bumps [actions/setup-python](https://github.com/actions/setup-python) from 4 to 5.
- [Release notes](https://github.com/actions/setup-python/releases)
- [Commits](https://github.com/actions/setup-python/compare/v4...v5)

---
updated-dependencies:
- dependency-name: actions/setup-python
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-12-07 08:32:27 -05:00
auto-updater[bot] c4cab14295 Update Ghidra HEAD to commit 5fd01c739 (#223)
Bump Ghidra HEAD commit 5fd01c739

Changed files:

```
M	Ghidra/Processors/MC6800/data/languages/6x09.sinc
```

Co-authored-by: pgoodman <pgoodman@users.noreply.github.com>
2023-12-04 09:23:17 -05:00
auto-updater[bot] e46879c87f Update Ghidra HEAD to commit c225fac12 (#221)
Bump Ghidra HEAD commit c225fac12

Changed files:

```
M	Ghidra/Processors/Loongarch/data/languages/ilp32f.cspec
M	Ghidra/Processors/Loongarch/data/languages/loongarch.ldefs
M	Ghidra/Processors/MIPS/data/languages/mips.sinc
A	Ghidra/Processors/Xtensa/Module.manifest
A	Ghidra/Processors/Xtensa/build.gradle
A	Ghidra/Processors/Xtensa/certification.manifest
A	Ghidra/Processors/Xtensa/data/languages/cust.sinc
A	Ghidra/Processors/Xtensa/data/languages/flix.sinc
A	Ghidra/Processors/Xtensa/data/languages/xtensa.cspec
A	Ghidra/Processors/Xtensa/data/languages/xtensa.dwarf
A	Ghidra/Processors/Xtensa/data/languages/xtensa.ldefs
A	Ghidra/Processors/Xtensa/data/languages/xtensa.opinion
A	Ghidra/Processors/Xtensa/data/languages/xtensa.pspec
A	Ghidra/Processors/Xtensa/data/languages/xtensaArch.sinc
A	Ghidra/Processors/Xtensa/data/languages/xtensaInstructions.sinc
A	Ghidra/Processors/Xtensa/data/languages/xtensaMain.sinc
A	Ghidra/Processors/Xtensa/data/languages/xtensa_be.slaspec
A	Ghidra/Processors/Xtensa/data/languages/xtensa_depbits.sinc
A	Ghidra/Processors/Xtensa/data/languages/xtensa_le.slaspec
A	Ghidra/Processors/Xtensa/data/manuals/xtensa.idx
A	Ghidra/Processors/Xtensa/data/patterns/patternconstraints.xml
A	Ghidra/Processors/Xtensa/data/patterns/xtensa_patterns.xml
A	Ghidra/Processors/Xtensa/src/main/java/ghidra/app/util/bin/format/elf/relocation/Xtensa_ElfRelocationConstants.java
A	Ghidra/Processors/Xtensa/src/main/java/ghidra/app/util/bin/format/elf/relocation/Xtensa_ElfRelocationHandler.java
A	Ghidra/Processors/Xtensa/src/main/java/ghidra/program/emulation/XtensaEmulateInstructionStateModifier.java
A	Ghidra/Processors/Xtensa/src/test.processors/java/ghidra/test/processors/Xtensa_O0_EmulatorTest.java
A	Ghidra/Processors/Xtensa/src/test.processors/java/ghidra/test/processors/Xtensa_O3_EmulatorTest.java
```

Co-authored-by: ekilmer <ekilmer@users.noreply.github.com>
2023-11-27 16:18:02 +00:00
auto-updater[bot] 5d9f0a1862 Update Ghidra HEAD to commit eaf6f0e64 (#219)
* Bump Ghidra HEAD commit eaf6f0e64

* Add new files to CMake

```
M	Ghidra/Features/Decompiler/src/decompile/cpp/Makefile
M	Ghidra/Features/Decompiler/src/decompile/cpp/fspec.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/fspec.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/grammar.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/grammar.y
M	Ghidra/Features/Decompiler/src/decompile/cpp/marshal.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/marshal.hh
A	Ghidra/Features/Decompiler/src/decompile/cpp/modelrules.cc
A	Ghidra/Features/Decompiler/src/decompile/cpp/modelrules.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/space.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/translate.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/translate.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/type.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/type.hh
A	Ghidra/Features/Decompiler/src/decompile/datatests/retspecial.xml
M	Ghidra/Features/Decompiler/src/decompile/unittests/testfuncproto.cc
A	Ghidra/Features/Decompiler/src/decompile/unittests/testparamstore.cc
M	Ghidra/Processors/AARCH64/data/languages/AARCH64.cspec
A	Ghidra/Processors/Loongarch/Module.manifest
A	Ghidra/Processors/Loongarch/build.gradle
A	Ghidra/Processors/Loongarch/certification.manifest
A	Ghidra/Processors/Loongarch/data/languages/ilp32d.cspec
A	Ghidra/Processors/Loongarch/data/languages/ilp32f.cspec
A	Ghidra/Processors/Loongarch/data/languages/lasx.sinc
A	Ghidra/Processors/Loongarch/data/languages/lbt.sinc
A	Ghidra/Processors/Loongarch/data/languages/loongarch.ldefs
A	Ghidra/Processors/Loongarch/data/languages/loongarch.opinion
A	Ghidra/Processors/Loongarch/data/languages/loongarch32.pspec
A	Ghidra/Processors/Loongarch/data/languages/loongarch32_f32.slaspec
A	Ghidra/Processors/Loongarch/data/languages/loongarch32_f64.slaspec
A	Ghidra/Processors/Loongarch/data/languages/loongarch32_instructions.sinc
A	Ghidra/Processors/Loongarch/data/languages/loongarch64.pspec
A	Ghidra/Processors/Loongarch/data/languages/loongarch64_f32.slaspec
A	Ghidra/Processors/Loongarch/data/languages/loongarch64_f64.slaspec
A	Ghidra/Processors/Loongarch/data/languages/loongarch64_instructions.sinc
A	Ghidra/Processors/Loongarch/data/languages/loongarch_double.sinc
A	Ghidra/Processors/Loongarch/data/languages/loongarch_float.sinc
A	Ghidra/Processors/Loongarch/data/languages/loongarch_main.sinc
A	Ghidra/Processors/Loongarch/data/languages/lp64d.cspec
A	Ghidra/Processors/Loongarch/data/languages/lp64f.cspec
A	Ghidra/Processors/Loongarch/data/languages/lsx.sinc
A	Ghidra/Processors/Loongarch/data/languages/lvz.sinc
A	Ghidra/Processors/Loongarch/data/manuals/loongarch.idx
A	Ghidra/Processors/Loongarch/data/patterns/loongarch_patterns.xml
A	Ghidra/Processors/Loongarch/data/patterns/patternconstraints.xml
A	Ghidra/Processors/Loongarch/src/main/java/ghidra/app/plugin/core/analysis/LoongsonAnalyzer.java
A	Ghidra/Processors/Loongarch/src/test.processors/java/ghidra/test/processors/Loongarch64_O0_EmulatorTest.java
A	Ghidra/Processors/Loongarch/src/test.processors/java/ghidra/test/processors/Loongarch64_O3_EmulatorTest.java
A	Ghidra/Processors/Loongarch/src/test.processors/java/ghidra/test/processors/Loongarch64f_O0_EmulatorTest.java
A	Ghidra/Processors/Loongarch/src/test.processors/java/ghidra/test/processors/Loongarch64f_O3_EmulatorTest.java
M	Ghidra/Processors/MIPS/src/main/java/ghidra/app/util/bin/format/elf/relocation/MIPS_ElfRelocationHandler.java
```

---------

Co-authored-by: Eric Kilmer <eric.d.kilmer@gmail.com>
2023-11-27 14:27:27 +00:00
auto-updater[bot] f9bbbbcdb0 Update Ghidra HEAD to commit ddf36db43 (#218)
Bump Ghidra HEAD commit ddf36db43

Changed files:

```
M	Ghidra/Features/Decompiler/src/decompile/cpp/ruleaction.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/type.cc
M	Ghidra/Processors/68000/data/languages/68000.sinc
M	Ghidra/Processors/AARCH64/data/languages/AARCH64base.sinc
M	Ghidra/Processors/Atmel/data/languages/avr32a_bit_operations.sinc
M	Ghidra/Processors/HCS12/data/languages/XGATE.sinc
M	Ghidra/Processors/PowerPC/data/languages/ppc.dwarf
M	Ghidra/Processors/tricore/data/languages/tricore.sinc
M	Ghidra/Processors/x86/data/languages/ia.sinc
```

Co-authored-by: pgoodman <pgoodman@users.noreply.github.com>
2023-11-13 12:04:23 +11:00
auto-updater[bot] cfa08a5f9c Update Ghidra HEAD to commit 134806cbe (#217)
Bump Ghidra HEAD commit 134806cbe

Changed files:

```
M	Ghidra/Processors/CR16/Module.manifest
M	Ghidra/Processors/x86/certification.manifest
M	Ghidra/Processors/x86/data/languages/ia.sinc
A	Ghidra/Processors/x86/data/languages/old/x86RealV2.lang
A	Ghidra/Processors/x86/data/languages/old/x86RealV2.trans
A	Ghidra/Processors/x86/data/languages/old/x86V2.lang
A	Ghidra/Processors/x86/data/languages/old/x86V2.trans
A	Ghidra/Processors/x86/data/languages/old/x86_64bit_compat32_v2.lang
A	Ghidra/Processors/x86/data/languages/old/x86_64bit_compat32_v2.trans
A	Ghidra/Processors/x86/data/languages/old/x86_64bit_v2.lang
A	Ghidra/Processors/x86/data/languages/old/x86_64bit_v2.trans
A	Ghidra/Processors/x86/data/languages/old/x86_ProtV2.lang
A	Ghidra/Processors/x86/data/languages/old/x86_ProtV2.trans
A	Ghidra/Processors/x86/data/languages/old/x86smmV2.lang
A	Ghidra/Processors/x86/data/languages/old/x86smmV2.trans
M	Ghidra/Processors/x86/data/languages/x86.ldefs
```

Co-authored-by: pgoodman <pgoodman@users.noreply.github.com>
2023-11-06 11:46:46 +11:00
auto-updater[bot] 7702679f9e Update Ghidra HEAD to commit 7c9aa58aa (#215)
Bump Ghidra HEAD commit 7c9aa58aa

Changed files:

```
M	Ghidra/Features/Decompiler/src/decompile/cpp/slghsymbol.cc
```

Co-authored-by: pgoodman <pgoodman@users.noreply.github.com>
2023-10-30 13:33:15 +11:00
auto-updater[bot] 8ab198294f Update Ghidra HEAD to commit 4c8c6aedb (#214)
Bump Ghidra HEAD commit 4c8c6aedb

Changed files:

```
M	Ghidra/Features/Decompiler/src/decompile/cpp/varmap.cc
```

Co-authored-by: pgoodman <pgoodman@users.noreply.github.com>
2023-10-23 12:56:46 +11:00
auto-updater[bot] 064320f431 Update Ghidra HEAD to commit fae64a82c (#213)
Bump Ghidra HEAD commit fae64a82c

Changed files:

```
M	Ghidra/Features/Decompiler/src/decompile/cpp/blockaction.cc
M	Ghidra/Processors/x86/data/languages/x86-64-win.cspec
```

Co-authored-by: pgoodman <pgoodman@users.noreply.github.com>
2023-10-16 16:08:27 +11:00
auto-updater[bot] 0ea1abe327 Update Ghidra HEAD to commit c24d25f3a (#212)
Bump Ghidra HEAD commit c24d25f3a

Changed files:

```
M	Ghidra/Processors/ARM/data/manuals/ARM.idx
```

Co-authored-by: pgoodman <pgoodman@users.noreply.github.com>
2023-10-09 12:33:02 +11:00
Eric Kilmer 8c12126d65 Update stable to Ghidra v10.4 (#211) 2023-10-04 12:18:22 -04:00
auto-updater[bot] 10ad498c54 Update Ghidra HEAD to commit 54e0ab1a3 (#210)
Bump Ghidra HEAD commit 54e0ab1a3

Changed files:

```
M	Ghidra/Features/Decompiler/src/decompile/cpp/architecture.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/architecture.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/block.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/coreaction.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/double.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/fspec.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/fspec.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/ghidra_arch.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/ghidra_arch.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/grammar.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/grammar.y
M	Ghidra/Features/Decompiler/src/decompile/cpp/options.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/options.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/ruleaction.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/sleigh_arch.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/sleigh_arch.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/type.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/type.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/typeop.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/unionresolve.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/varmap.cc
M	Ghidra/Features/Decompiler/src/decompile/datatests/impliedfield.xml
A	Ghidra/Features/Decompiler/src/decompile/datatests/longdouble.xml
M	Ghidra/Features/Decompiler/src/decompile/datatests/nestedoffset.xml
M	Ghidra/Features/Decompiler/src/decompile/datatests/offsetarray.xml
M	Ghidra/Features/Decompiler/src/decompile/datatests/packstructaccess.xml
M	Ghidra/Processors/x86/data/languages/x86gcc.cspec
```

Co-authored-by: pgoodman <pgoodman@users.noreply.github.com>
2023-10-02 16:59:57 +11:00
auto-updater[bot] 534adad29a Update Ghidra HEAD to commit 650808862 (#209)
Bump Ghidra HEAD commit 650808862

Changed files:

```
M	Ghidra/Features/Decompiler/src/decompile/cpp/coreaction.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/coreaction.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/printc.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/printc.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/type.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/type.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/typeop.cc
A	Ghidra/Features/Decompiler/src/decompile/datatests/ptrtoarray.xml
M	Ghidra/Processors/68000/src/main/java/ghidra/app/plugin/core/analysis/Motorola68KAnalyzer.java
M	Ghidra/Processors/AARCH64/data/languages/AARCH64.cspec
M	Ghidra/Processors/AARCH64/data/languages/AARCH64.pspec
M	Ghidra/Processors/AARCH64/data/languages/AARCH64_ilp32.cspec
M	Ghidra/Processors/ARM/src/main/java/ghidra/app/plugin/core/analysis/ArmAnalyzer.java
M	Ghidra/Processors/MIPS/src/main/java/ghidra/app/plugin/core/analysis/MipsAddressAnalyzer.java
M	Ghidra/Processors/PIC/src/main/java/ghidra/app/plugin/core/analysis/Pic16Analyzer.java
M	Ghidra/Processors/PowerPC/src/main/java/ghidra/app/plugin/core/analysis/PowerPCAddressAnalyzer.java
M	Ghidra/Processors/RISCV/src/main/java/ghidra/app/plugin/core/analysis/RISCVAddressAnalyzer.java
M	Ghidra/Processors/Sparc/src/main/java/ghidra/app/plugin/core/analysis/SparcAnalyzer.java
M	Ghidra/Processors/SuperH4/src/main/java/ghidra/app/plugin/core/analysis/SH4AddressAnalyzer.java
M	Ghidra/Processors/x86/data/languages/ia.sinc
M	Ghidra/Processors/x86/data/languages/lockable.sinc
M	Ghidra/Processors/x86/src/main/java/ghidra/app/plugin/core/analysis/X86Analyzer.java
```

Co-authored-by: pgoodman <pgoodman@users.noreply.github.com>
2023-09-25 12:04:27 +10:00
auto-updater[bot] 393adb711e Update Ghidra HEAD to commit 4561e8335 (#208)
Bump Ghidra HEAD commit 4561e8335

Changed files:

```
M	Ghidra/Features/Decompiler/src/decompile/cpp/Doxyfile
M	Ghidra/Features/Decompiler/src/decompile/cpp/architecture.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/block.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/block.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/cover.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/database.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/fspec.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/funcdata.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/heritage.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/jumptable.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/merge.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/options.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/prettyprint.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/prettyprint.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/printc.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/printc.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/printjava.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/printlanguage.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/printlanguage.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/ruleaction.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/sleigh.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/subflow.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/type.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/typeop.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/variable.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/varmap.cc
A	Ghidra/Features/Decompiler/src/decompile/datatests/boolless.xml
```

Co-authored-by: pgoodman <pgoodman@users.noreply.github.com>
2023-09-18 13:03:13 +10:00
dependabot[bot] fb4dec76cb build(deps): bump tibdex/github-app-token from 1 to 2 (#207)
Bumps [tibdex/github-app-token](https://github.com/tibdex/github-app-token) from 1 to 2.
- [Release notes](https://github.com/tibdex/github-app-token/releases)
- [Commits](https://github.com/tibdex/github-app-token/compare/v1...v2)

---
updated-dependencies:
- dependency-name: tibdex/github-app-token
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-09-11 16:21:32 +10:00
Alex Cameron 331f4cc2b7 Update stable to Ghidra v10.3.3 (#204) 2023-09-05 14:21:36 +00:00
dependabot[bot] 0d84e6ffb5 build(deps): bump actions/checkout from 3 to 4 (#206)
Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v3...v4)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-09-05 15:57:27 +10:00
auto-updater[bot] f84470ac10 Update Ghidra HEAD to commit d7d6b44e2 (#205)
Bump Ghidra HEAD commit d7d6b44e2

Changed files:

```
M	Ghidra/Features/Decompiler/src/decompile/cpp/coreaction.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/coreaction.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/double.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/funcdata_varnode.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/variable.hh
M	Ghidra/Processors/ARM/certification.manifest
M	Ghidra/Processors/ARM/data/languages/ARMv8.sinc
M	Ghidra/Processors/ARM/data/patterns/ARM_BE_patterns.xml
M	Ghidra/Processors/ARM/data/patterns/ARM_LE_patterns.xml
M	Ghidra/Processors/Atmel/data/languages/avr8.sinc
M	Ghidra/Processors/RISCV/src/main/java/ghidra/app/util/bin/format/elf/relocation/RISCV_ElfRelocationContext.java
M	Ghidra/Processors/RISCV/src/main/java/ghidra/app/util/bin/format/elf/relocation/RISCV_ElfRelocationHandler.java
M	Ghidra/Processors/x86/data/languages/x86win.cspec
```

Co-authored-by: pgoodman <pgoodman@users.noreply.github.com>
2023-09-04 10:52:58 +10:00
auto-updater[bot] 04d1204eb5 Update Ghidra HEAD to commit b261137b4 (#203)
Bump Ghidra HEAD commit b261137b4

Changed files:

```
M	Ghidra/Processors/RISCV/src/main/java/ghidra/app/util/bin/format/elf/relocation/RISCV_ElfRelocationContext.java
```

Co-authored-by: pgoodman <pgoodman@users.noreply.github.com>
2023-08-28 10:42:35 +10:00
auto-updater[bot] 1c5fad6a6b Update Ghidra HEAD to commit ba5fcdf4e (#202)
Bump Ghidra HEAD commit ba5fcdf4e

Changed files:

```
M	Ghidra/Processors/MIPS/data/languages/mips.ldefs
A	Ghidra/Processors/RISCV/src/main/java/ghidra/app/util/bin/format/elf/relocation/RISCV_ElfRelocationContext.java
M	Ghidra/Processors/RISCV/src/main/java/ghidra/app/util/bin/format/elf/relocation/RISCV_ElfRelocationHandler.java
M	Ghidra/Processors/x86/data/languages/ia.sinc
M	Ghidra/Processors/x86/data/languages/x86-64-gcc.cspec
M	Ghidra/Processors/x86/data/languages/x86gcc.cspec
```

Co-authored-by: pgoodman <pgoodman@users.noreply.github.com>
2023-08-21 11:08:08 +10:00
auto-updater[bot] 459824f983 Update Ghidra HEAD to commit 72fd30080 (#201)
Bump Ghidra HEAD commit 72fd30080

Changed files:

```
M	Ghidra/Features/Decompiler/src/decompile/cpp/merge.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/merge.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/op.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/printc.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/ruleaction.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/xml.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/xml.y
M	Ghidra/Processors/AARCH64/data/languages/AARCH64neon.sinc
```

Co-authored-by: pgoodman <pgoodman@users.noreply.github.com>
2023-08-14 11:37:44 +10:00
auto-updater[bot] ea5986827e Update Ghidra HEAD to commit 26d4bd910 (#200)
Bump Ghidra HEAD commit 26d4bd910

Changed files:

```
M	Ghidra/Features/Decompiler/src/decompile/cpp/architecture.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/architecture.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/marshal.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/options.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/options.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/ruleaction.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/ruleaction.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/type.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/type.hh
A	Ghidra/Features/Decompiler/src/decompile/datatests/nan.xml
M	Ghidra/Processors/MC6800/data/languages/6x09_push.sinc
M	Ghidra/Processors/x86/data/languages/ia.sinc
```

Co-authored-by: pgoodman <pgoodman@users.noreply.github.com>
2023-08-07 11:39:27 +10:00
Alex Cameron 393ed42fc6 Update stable to Ghidra v10.3.2 (#199) 2023-08-02 10:51:50 -04:00
Alex Cameron 57e6d7c79d Remove buggy UBSAN fix from stable patch and regenerate HEAD patches (#198) 2023-08-02 13:53:16 +00:00
Alex Cameron 8c5b8049a6 Update stable to Ghidra v10.3.1 (#197) 2023-08-02 09:04:17 -04:00
auto-updater[bot] 7b1232ec99 Update Ghidra HEAD to commit b0e0c7372 (#196)
Bump Ghidra HEAD commit b0e0c7372

Changed files:

```
M	Ghidra/Features/Decompiler/src/decompile/cpp/ghidra_arch.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/prettyprint.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/type.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/type.hh
```

Co-authored-by: pgoodman <pgoodman@users.noreply.github.com>
2023-07-31 12:20:13 +10:00
auto-updater[bot] f9a4905c31 Update Ghidra HEAD to commit bece81176 (#195)
* Bump Ghidra HEAD commit bece81176

Changed files:

```
M	Ghidra/Features/Decompiler/src/decompile/cpp/cover.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/cover.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/merge.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/merge.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/rangeutil.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/testfunction.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/testfunction.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/variable.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/variable.hh
A	Ghidra/Features/Decompiler/src/decompile/datatests/varcross.xml
M	Ghidra/Features/Decompiler/src/decompile/unittests/testcirclerange.cc
M	Ghidra/Processors/AARCH64/data/languages/AARCH64.opinion
M	Ghidra/Processors/MC6800/data/languages/6x09.sinc
```

* Fix UBSAN patch

* Update stable UBSAN patch

---------

Co-authored-by: pgoodman <pgoodman@users.noreply.github.com>
Co-authored-by: Alex Cameron <asc@tetsuo.sh>
2023-07-25 14:00:08 +10:00
Alex Cameron ff5929e1fc Remove unnecessary sign_extend patch (#194)
The issue was actually with the UBSAN patch to the `sign_extend` function and not the upstream commit itself. When NationalSecurityAgency/ghidra@3c08b44 landed, I had to regenerate the UBSAN patch but I botched the part of the patch that modifies `sign_extend` and introduced this bug.

Now that the UBSAN patch no longer touches this function, I should just get rid of the new patch and things should "just work".
2023-07-20 09:16:37 -04:00
auto-updater[bot] 844e5e07fe Update Ghidra HEAD to commit befa5aa77 (#193)
Bump Ghidra HEAD commit befa5aa77

Changed files:

```
M	Ghidra/Features/Decompiler/src/decompile/cpp/coreaction.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/fspec.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/fspec.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/heritage.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/heritage.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/ifacedecomp.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/ifacedecomp.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/varmap.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/varmap.hh
A	Ghidra/Features/Decompiler/src/decompile/datatests/stackreturn.xml
M	Ghidra/Processors/MC6800/data/languages/6x09.sinc
```

Co-authored-by: pgoodman <pgoodman@users.noreply.github.com>
2023-07-17 11:51:17 +10:00
Alex Cameron 51bd95f360 Add patch to undo regression in sign_extend (#192)
* Undo UBSAN fix for `sign_extend`

* Add patch to CMake configuration
2023-07-12 09:05:27 -04:00
auto-updater[bot] f63b99a700 Update Ghidra HEAD to commit d932173a2 (#191)
Bump Ghidra HEAD commit d932173a2

Changed files:

```
M	Ghidra/Features/Decompiler/src/decompile/cpp/subflow.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/subflow.hh
M	Ghidra/Processors/68000/data/languages/68000.sinc
M	Ghidra/Processors/ARM/src/main/java/ghidra/app/plugin/core/analysis/ArmAnalyzer.java
M	Ghidra/Processors/PowerPC/src/main/java/ghidra/app/plugin/core/analysis/PowerPCAddressAnalyzer.java
M	Ghidra/Processors/x86/data/languages/x86.opinion
M	Ghidra/Processors/x86/src/main/java/ghidra/app/util/bin/format/elf/relocation/X86_64_ElfRelocationContext.java
```

Co-authored-by: pgoodman <pgoodman@users.noreply.github.com>
2023-07-10 10:47:04 +10:00
auto-updater[bot] f1d1eab45f Update Ghidra HEAD to commit 73e80aa1f (#189)
Bump Ghidra HEAD commit 73e80aa1f

Changed files:

```
M	Ghidra/Processors/MC6800/data/languages/6x09.sinc
M	Ghidra/Processors/x86/certification.manifest
A	Ghidra/Processors/x86/data/languages/x86-64-compat32.pspec
M	Ghidra/Processors/x86/data/languages/x86-64.pspec
M	Ghidra/Processors/x86/data/languages/x86.ldefs
```

Co-authored-by: pgoodman <pgoodman@users.noreply.github.com>
2023-07-03 11:07:26 +10:00
auto-updater[bot] 83ae3b5dfe Update Ghidra HEAD to commit 571963265 (#188)
Bump Ghidra HEAD commit 571963265

Changed files:

```
M	Ghidra/Processors/ARM/data/languages/ARMinstructions.sinc
M	Ghidra/Processors/ARM/data/languages/ARMneon.sinc
M	Ghidra/Processors/PIC/data/languages/PIC24.sinc
M	Ghidra/Processors/x86/data/languages/x86-32-golang.cspec
M	Ghidra/Processors/x86/data/languages/x86-64-golang.cspec
```

Co-authored-by: pgoodman <pgoodman@users.noreply.github.com>
2023-06-26 11:29:58 +10:00
auto-updater[bot] 548b28c67d Update Ghidra HEAD to commit 8cc3a9443 (#187)
Bump Ghidra HEAD commit 8cc3a9443

Changed files:

```
M	Ghidra/Features/Decompiler/src/decompile/cpp/architecture.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/architecture.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/double.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/jumptable.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/jumptable.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/marshal.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/options.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/options.hh
M	Ghidra/Features/Decompiler/src/decompile/datatests/partialunion.xml
M	Ghidra/Processors/6502/data/languages/6502.slaspec
M	Ghidra/Processors/68000/certification.manifest
M	Ghidra/Processors/68000/data/languages/68000.cspec
M	Ghidra/Processors/68000/data/languages/68000.ldefs
M	Ghidra/Processors/68000/data/languages/68000.sinc
A	Ghidra/Processors/68000/data/languages/68000_register.cspec
A	Ghidra/Processors/68000/data/patterns/68000_patterns.xml
A	Ghidra/Processors/68000/data/patterns/patternconstraints.xml
M	Ghidra/Processors/8048/data/languages/8048.pspec
M	Ghidra/Processors/8048/data/languages/8048.slaspec
M	Ghidra/Processors/AARCH64/data/languages/AARCH64instructions.sinc
M	Ghidra/Processors/x86/data/languages/x86win.cspec
```

Co-authored-by: pgoodman <pgoodman@users.noreply.github.com>
2023-06-19 12:32:21 +10:00
auto-updater[bot] f23739ee3f Update Ghidra HEAD to commit 0d71657d0 (#186)
* Bump Ghidra HEAD commit 0d71657d0

Changed files:

```
M	Ghidra/Features/Decompiler/src/decompile/cpp/address.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/address.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/coreaction.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/database.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/dynamic.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/float.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/funcdata_op.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/opbehavior.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/printc.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/rangeutil.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/ruleaction.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/ruleaction.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/slghpatexpress.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/slghpatexpress.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/space.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/subflow.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/type.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/type.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/typeop.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/typeop.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/unionresolve.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/varmap.cc
M	Ghidra/Processors/68000/data/manuals/68000.idx
M	Ghidra/Processors/PowerPC/data/languages/ppc_32_be_Mac.cspec
M	Ghidra/Processors/PowerPC/data/languages/ppc_32_e500_be.cspec
M	Ghidra/Processors/PowerPC/data/languages/ppc_32_e500_le.cspec
M	Ghidra/Processors/PowerPC/data/manuals/PowerISA.idx
M	Ghidra/Processors/x86/data/languages/ia.sinc
M	Ghidra/Processors/x86/data/languages/x86-64-golang.register.info
```

* patches: Regenerate UBSAN fixes patch
* NOTE: Sleigh tests have begun failing upstream. We need to figure this out and file an issue to Ghidra.

---------

Co-authored-by: pgoodman <pgoodman@users.noreply.github.com>
Co-authored-by: Alex Cameron <asc@tetsuo.sh>
2023-06-08 16:28:49 +12:00
Eric Kilmer c8cb034afb Fix GitHub Actions trigger patterns 2023-05-30 10:25:53 -04:00
auto-updater[bot] 384d7de32a Update Ghidra HEAD to commit 3e9419d4d (#184)
Bump Ghidra HEAD commit 3e9419d4d

Changed files:

```
M	Ghidra/Features/Decompiler/src/decompile/cpp/callgraph.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/coreaction.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/coreaction.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/database.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/database.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/database_ghidra.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/flow.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/fspec.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/funcdata.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/funcdata.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/op.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/printc.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/printjava.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/ruleaction.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/type.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/type.hh
A	Ghidra/Features/Decompiler/src/decompile/datatests/switchind.xml
M	Ghidra/Processors/AARCH64/data/languages/AARCH64_win.cspec
M	Ghidra/Processors/x86/data/languages/x86-64-win.cspec
```

Co-authored-by: pgoodman <pgoodman@users.noreply.github.com>
2023-05-29 10:38:59 +10:00
auto-updater[bot] d75230a7bc Update Ghidra HEAD to commit 894bd3cfc (#181)
Bump Ghidra HEAD commit 894bd3cfc

Changed files:

```
M	Ghidra/Features/Decompiler/src/decompile/cpp/ruleaction.cc
M	Ghidra/Processors/AARCH64/src/main/java/ghidra/app/util/bin/format/elf/relocation/AARCH64_ElfRelocationHandler.java
M	Ghidra/Processors/PowerPC/data/languages/ppc_a2.sinc
M	Ghidra/Processors/PowerPC/data/languages/ppc_embedded.sinc
M	Ghidra/Processors/PowerPC/data/languages/ppc_instructions.sinc
M	Ghidra/Processors/PowerPC/data/languages/ppc_isa.sinc
M	Ghidra/Processors/PowerPC/data/languages/ppc_vle.sinc
M	Ghidra/Processors/PowerPC/data/languages/quicciii.sinc
```

Co-authored-by: pgoodman <pgoodman@users.noreply.github.com>
2023-05-22 13:25:58 +10:00
Alex Cameron 7e9641e394 Update stable to Ghidra v10.3 (#179)
* sleigh-lift, support: Qualify names with `ghidra` namespace

* Bump Ghidra HEAD commit 4b99900d2

Changed files:

```
M	Ghidra/Processors/68000/data/languages/68000.sinc
M	Ghidra/Processors/PowerPC/data/languages/ppc_instructions.sinc
M	Ghidra/Processors/x86/data/languages/ia.sinc
```
2023-05-16 09:51:01 -04:00
auto-updater[bot] 37b2cbcf1c Update Ghidra HEAD to commit b3616a683 (#178)
Bump Ghidra HEAD commit b3616a683

Changed files:

```
M	Ghidra/Features/Decompiler/src/decompile/cpp/coreaction.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/fspec.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/fspec.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/jumptable.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/type.cc
M	Ghidra/Processors/68000/src/main/java/ghidra/app/plugin/core/analysis/Motorola68KAnalyzer.java
M	Ghidra/Processors/AARCH64/src/main/java/ghidra/app/plugin/core/analysis/AARCH64PltThunkAnalyzer.java
M	Ghidra/Processors/ARM/certification.manifest
M	Ghidra/Processors/ARM/src/main/java/ghidra/app/plugin/core/analysis/ArmAnalyzer.java
A	Ghidra/Processors/BPF/Module.manifest
A	Ghidra/Processors/BPF/build.gradle
A	Ghidra/Processors/BPF/certification.manifest
A	Ghidra/Processors/BPF/data/languages/BPF.cspec
A	Ghidra/Processors/BPF/data/languages/BPF.ldefs
A	Ghidra/Processors/BPF/data/languages/BPF.pspec
A	Ghidra/Processors/BPF/data/languages/BPF.sinc
A	Ghidra/Processors/BPF/data/languages/BPF_le.slaspec
M	Ghidra/Processors/JVM/resources/ArrayTests.java
M	Ghidra/Processors/JVM/resources/GetPutFieldTest.java
M	Ghidra/Processors/JVM/resources/GetPutStaticTest.java
M	Ghidra/Processors/JVM/resources/NewTests.java
M	Ghidra/Processors/JVM/src/main/java/ghidra/javaclass/analyzers/JavaAnalyzer.java
M	Ghidra/Processors/JVM/src/main/java/ghidra/javaclass/analyzers/JvmSwitchAnalyzer.java
M	Ghidra/Processors/MIPS/src/main/java/ghidra/app/plugin/core/analysis/MipsAddressAnalyzer.java
M	Ghidra/Processors/MIPS/src/main/java/ghidra/app/plugin/core/analysis/MipsPreAnalyzer.java
M	Ghidra/Processors/MIPS/src/main/java/ghidra/app/util/bin/format/elf/extend/MIPS_ElfExtension.java
M	Ghidra/Processors/PIC/src/main/java/ghidra/app/plugin/core/analysis/Pic16Analyzer.java
M	Ghidra/Processors/PIC/src/main/java/ghidra/app/plugin/core/analysis/Pic17c7xxAnalyzer.java
M	Ghidra/Processors/PIC/src/main/java/ghidra/app/plugin/core/analysis/Pic18Analyzer.java
M	Ghidra/Processors/PowerPC/src/main/java/ghidra/app/plugin/core/analysis/PPC64CallStubAnalyzer.java
M	Ghidra/Processors/PowerPC/src/main/java/ghidra/app/plugin/core/analysis/PowerPCAddressAnalyzer.java
M	Ghidra/Processors/PowerPC/src/main/java/ghidra/app/util/bin/format/elf/extend/PowerPC64_ElfExtension.java
M	Ghidra/Processors/PowerPC/src/main/java/ghidra/app/util/bin/format/elf/extend/PowerPC_ElfExtension.java
M	Ghidra/Processors/RISCV/src/main/java/ghidra/app/plugin/core/analysis/RISCVAddressAnalyzer.java
M	Ghidra/Processors/Sparc/src/main/java/ghidra/app/plugin/core/analysis/SparcAnalyzer.java
M	Ghidra/Processors/SuperH4/src/main/java/ghidra/app/plugin/core/analysis/SH4AddressAnalyzer.java
M	Ghidra/Processors/SuperH4/src/main/java/ghidra/app/plugin/core/analysis/SH4EarlyAddressAnalyzer.java
A	Ghidra/Processors/eBPF/Module.manifest
A	Ghidra/Processors/eBPF/build.gradle
A	Ghidra/Processors/eBPF/certification.manifest
A	Ghidra/Processors/eBPF/data/languages/eBPF.cspec
A	Ghidra/Processors/eBPF/data/languages/eBPF.dwarf
A	Ghidra/Processors/eBPF/data/languages/eBPF.ldefs
A	Ghidra/Processors/eBPF/data/languages/eBPF.opinion
A	Ghidra/Processors/eBPF/data/languages/eBPF.pspec
A	Ghidra/Processors/eBPF/data/languages/eBPF.sinc
A	Ghidra/Processors/eBPF/data/languages/eBPF_le.slaspec
A	Ghidra/Processors/eBPF/src/main/java/ghidra/app/plugin/core/analysis/eBPFAnalyzer.java
A	Ghidra/Processors/eBPF/src/main/java/ghidra/app/util/bin/format/elf/extend/eBPF_ElfExtension.java
A	Ghidra/Processors/eBPF/src/main/java/ghidra/app/util/bin/format/elf/relocation/ElfeBPFRelocationFixupHandler.java
A	Ghidra/Processors/eBPF/src/main/java/ghidra/app/util/bin/format/elf/relocation/eBPF_ElfRelocationConstants.java
A	Ghidra/Processors/eBPF/src/main/java/ghidra/app/util/bin/format/elf/relocation/eBPF_ElfRelocationHandler.java
M	Ghidra/Processors/x86/certification.manifest
M	Ghidra/Processors/x86/data/languages/ia.sinc
A	Ghidra/Processors/x86/data/languages/x86-32-golang.cspec
A	Ghidra/Processors/x86/data/languages/x86-32-golang.register.info
A	Ghidra/Processors/x86/data/languages/x86-64-golang.cspec
A	Ghidra/Processors/x86/data/languages/x86-64-golang.register.info
M	Ghidra/Processors/x86/data/languages/x86.ldefs
M	Ghidra/Processors/x86/data/languages/x86.opinion
M	Ghidra/Processors/x86/src/main/java/ghidra/app/plugin/core/analysis/X86Analyzer.java
```

Co-authored-by: pgoodman <pgoodman@users.noreply.github.com>
2023-05-08 18:09:40 +10:00
auto-updater[bot] 7c6b742446 Update Ghidra HEAD to commit 80ccdadeb (#177)
Bump Ghidra HEAD commit 80ccdadeb

Changed files:

```
M	Ghidra/Features/Decompiler/src/decompile/cpp/architecture.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/architecture.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/coreaction.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/database.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/funcdata.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/jumptable.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/jumptable.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/marshal.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/merge.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/options.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/options.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/ruleaction.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/ruleaction.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/subflow.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/subflow.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/type.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/type.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/typeop.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/typeop.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/unionresolve.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/variable.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/variable.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/varmap.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/varmap.hh
A	Ghidra/Features/Decompiler/src/decompile/datatests/partialsplit.xml
M	Ghidra/Processors/68000/data/languages/68000.cspec
M	Ghidra/Processors/68000/data/languages/68000.sinc
M	Ghidra/Processors/AARCH64/src/main/java/ghidra/app/util/bin/format/elf/relocation/AARCH64_ElfRelocationHandler.java
M	Ghidra/Processors/ARM/src/main/java/ghidra/app/plugin/core/analysis/ArmAnalyzer.java
M	Ghidra/Processors/ARM/src/main/java/ghidra/app/util/bin/format/elf/relocation/ARM_ElfRelocationHandler.java
M	Ghidra/Processors/HCS12/data/languages/HCS_HC12.sinc
M	Ghidra/Processors/MIPS/src/main/java/ghidra/app/util/bin/format/elf/relocation/MIPS_ElfRelocationHandler.java
M	Ghidra/Processors/PowerPC/src/main/java/ghidra/app/util/bin/format/elf/relocation/PowerPC64_ElfRelocationHandler.java
M	Ghidra/Processors/PowerPC/src/main/java/ghidra/app/util/bin/format/elf/relocation/PowerPC_ElfRelocationHandler.java
M	Ghidra/Processors/RISCV/src/main/java/ghidra/app/util/bin/format/elf/relocation/RISCV_ElfRelocationHandler.java
M	Ghidra/Processors/SuperH4/src/main/java/ghidra/app/util/bin/format/elf/relocation/SH_ElfRelocationHandler.java
M	Ghidra/Processors/x86/certification.manifest
M	Ghidra/Processors/x86/data/languages/avx.sinc
M	Ghidra/Processors/x86/data/languages/avx_manual.sinc
M	Ghidra/Processors/x86/data/languages/ia.sinc
A	Ghidra/Processors/x86/data/languages/lockable.sinc
M	Ghidra/Processors/x86/data/languages/x86-64-gcc.cspec
M	Ghidra/Processors/x86/data/languages/x86-64.slaspec
M	Ghidra/Processors/x86/data/languages/x86.ldefs
M	Ghidra/Processors/x86/data/languages/x86.slaspec
M	Ghidra/Processors/x86/data/languages/x86borland.cspec
M	Ghidra/Processors/x86/data/languages/x86delphi.cspec
M	Ghidra/Processors/x86/data/languages/x86gcc.cspec
M	Ghidra/Processors/x86/src/main/java/ghidra/app/util/bin/format/elf/relocation/X86_32_ElfRelocationHandler.java
M	Ghidra/Processors/x86/src/main/java/ghidra/app/util/bin/format/elf/relocation/X86_64_ElfRelocationHandler.java
```

Co-authored-by: pgoodman <pgoodman@users.noreply.github.com>
2023-05-02 15:42:54 -04:00
auto-updater[bot] b3669ea4bd Update Ghidra HEAD to commit 7891d2611 (#175)
Bump Ghidra HEAD commit 7891d2611

Changed files:

```
M	Ghidra/Processors/AARCH64/data/languages/AARCH64.ldefs
M	Ghidra/Processors/Atmel/ghidra_scripts/CreateAVR8GDTArchiveScript.java
M	Ghidra/Processors/Dalvik/src/main/java/ghidra/dalvik/dex/inject/ConstantPoolDex.java
M	Ghidra/Processors/JVM/ghidra_scripts/CreateJNIGDTArchivesScript.java
M	Ghidra/Processors/JVM/src/main/java/ghidra/app/util/pcodeInject/ConstantPoolJava.java
```

Co-authored-by: pgoodman <pgoodman@users.noreply.github.com>
2023-04-24 12:18:08 +10:00
auto-updater[bot] e1562dd87f Update Ghidra HEAD to commit 84332ef95 (#174)
* Bump Ghidra HEAD commit 84332ef95

Changed files:

```
M	Ghidra/Features/Decompiler/src/decompile/cpp/sleighexample.cc
```

* cmake: Remove Sleigh example patch

---------

Co-authored-by: pgoodman <pgoodman@users.noreply.github.com>
Co-authored-by: Alex Cameron <asc@tetsuo.sh>
2023-04-18 17:43:43 +10:00
auto-updater[bot] 262f8d8421 Update Ghidra HEAD to commit 85cc8ee88 (#172)
Changed files: ALL decompiler sources

New 'ghidra' namespace!

---------

Co-authored-by: Eric Kilmer <eric.d.kilmer@gmail.com>
2023-04-12 08:33:03 -04:00
Artem Dinaburg ef4e13d243 Add CODEOWNERS file (#173) 2023-04-10 23:12:09 +00:00
auto-updater[bot] 6d6335b2c5 Update Ghidra HEAD to commit ca9a56b5f (#171)
Bump Ghidra HEAD commit ca9a56b5f

Changed files:

```
M	Ghidra/Processors/ARM/data/languages/ARM.cspec
M	Ghidra/Processors/MIPS/data/languages/mips32be.cspec
M	Ghidra/Processors/MIPS/data/languages/mips32le.cspec
A	Ghidra/Processors/PowerPC/src/main/java/ghidra/app/util/bin/format/macho/relocation/PowerPC_MachoRelocationConstants.java
A	Ghidra/Processors/PowerPC/src/main/java/ghidra/app/util/bin/format/macho/relocation/PowerPC_MachoRelocationHandler.java
M	Ghidra/Processors/x86/data/languages/x86-64-gcc.cspec
M	Ghidra/Processors/x86/data/languages/x86.opinion
M	Ghidra/Processors/x86/data/languages/x86gcc.cspec
```

Co-authored-by: pgoodman <pgoodman@users.noreply.github.com>
2023-04-10 09:07:44 -04:00
dependabot[bot] 6f03e21e23 build(deps): bump peter-evans/create-pull-request from 4 to 5 (#170)
Bumps [peter-evans/create-pull-request](https://github.com/peter-evans/create-pull-request) from 4 to 5.
- [Release notes](https://github.com/peter-evans/create-pull-request/releases)
- [Commits](https://github.com/peter-evans/create-pull-request/compare/v4...v5)

---
updated-dependencies:
- dependency-name: peter-evans/create-pull-request
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-04-05 17:12:01 +10:00
auto-updater[bot] cae987f993 Update Ghidra HEAD to commit 02e547dac (#169)
* Bump Ghidra HEAD commit 02e547dac

Changed files:

```
M	Ghidra/Features/Decompiler/src/decompile/cpp/Makefile
M	Ghidra/Features/Decompiler/src/decompile/cpp/coreaction.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/dynamic.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/grammar.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/grammar.y
M	Ghidra/Features/Decompiler/src/decompile/cpp/op.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/opbehavior.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/opbehavior.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/opcodes.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/opcodes.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/pcodeparse.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/pcodeparse.y
M	Ghidra/Features/Decompiler/src/decompile/cpp/printc.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/printlanguage.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/ruleaction.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/ruleaction.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/slgh_compile.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/slghparse.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/slghparse.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/slghparse.y
M	Ghidra/Features/Decompiler/src/decompile/cpp/slghscan.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/slghscan.l
M	Ghidra/Features/Decompiler/src/decompile/cpp/typeop.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/typeop.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/unionresolve.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/xml.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/xml.y
A	Ghidra/Features/Decompiler/src/decompile/datatests/lzcount.xml
M	Ghidra/Processors/68000/data/languages/68000.sinc
M	Ghidra/Processors/68000/src/main/java/ghidra/program/emulation/m68kEmulateInstructionStateModifier.java
M	Ghidra/Processors/AARCH64/data/languages/AARCH64base.sinc
M	Ghidra/Processors/AARCH64/data/languages/AARCH64instructions.sinc
M	Ghidra/Processors/ARM/data/languages/ARM.sinc
M	Ghidra/Processors/ARM/data/languages/ARMTHUMBinstructions.sinc
M	Ghidra/Processors/ARM/data/languages/ARMinstructions.sinc
M	Ghidra/Processors/ARM/src/main/java/ghidra/program/emulation/ARMEmulateInstructionStateModifier.java
M	Ghidra/Processors/MIPS/data/languages/mips.sinc
M	Ghidra/Processors/MIPS/data/languages/mips32Instructions.sinc
M	Ghidra/Processors/MIPS/data/languages/mips64Instructions.sinc
M	Ghidra/Processors/MIPS/data/languages/mipsmicro.sinc
M	Ghidra/Processors/MIPS/src/main/java/ghidra/app/util/bin/format/elf/extend/MIPS_ElfExtension.java
M	Ghidra/Processors/MIPS/src/main/java/ghidra/app/util/bin/format/elf/relocation/MIPS_Elf64Relocation.java
M	Ghidra/Processors/MIPS/src/main/java/ghidra/app/util/bin/format/elf/relocation/MIPS_ElfRelocationConstants.java
M	Ghidra/Processors/MIPS/src/main/java/ghidra/app/util/bin/format/elf/relocation/MIPS_ElfRelocationContext.java
M	Ghidra/Processors/MIPS/src/main/java/ghidra/app/util/bin/format/elf/relocation/MIPS_ElfRelocationHandler.java
M	Ghidra/Processors/MIPS/src/main/java/ghidra/program/emulation/MIPSEmulateInstructionStateModifier.java
M	Ghidra/Processors/PowerPC/data/languages/ppc_common.sinc
M	Ghidra/Processors/PowerPC/data/languages/ppc_instructions.sinc
M	Ghidra/Processors/PowerPC/src/main/java/ghidra/program/emulation/PPCEmulateInstructionStateModifier.java
M	Ghidra/Processors/tricore/data/languages/tricore.sinc
M	Ghidra/Processors/x86/data/languages/ia.sinc
M	Ghidra/Processors/x86/data/languages/lzcnt.sinc
```

* Regenerate patches

---------

Co-authored-by: Eric Kilmer <eric.d.kilmer@gmail.com>
2023-04-03 11:04:47 -04:00
auto-updater[bot] c3564b1e3e Update Ghidra HEAD to commit acb07dd53 (#168)
* Bump Ghidra HEAD commit acb07dd53

Changed files:

```
M	Ghidra/Features/Decompiler/src/decompile/cpp/coreaction.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/funcdata.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/funcdata_varnode.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/merge.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/merge.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/ruleaction.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/ruleaction.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/type.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/type.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/variable.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/variable.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/varmap.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/varnode.cc
A	Ghidra/Features/Decompiler/src/decompile/datatests/piecestruct.xml
M	Ghidra/Processors/ARM/data/languages/ARMTHUMBinstructions.sinc
M	Ghidra/Processors/RISCV/data/languages/riscv.ldefs
M	Ghidra/Processors/RISCV/data/languages/riscv.rv32i.sinc
```

Regenerate RemUsing patch

---------
Co-authored-by: Alex Cameron <asc@tetsuo.sh>
2023-03-28 08:40:37 -04:00
Eric Kilmer 259bccedf0 Add test for patches that remove 'using namespace std' (#155)
If the patch is not present or wrong, this test should fail

Co-authored-by: Duncan Ogilvie <mr.exodia.tpodt@gmail.com>
2023-03-22 20:52:23 -04:00
auto-updater[bot] ddfe4bff8e Update Ghidra and regenerate patches (#167)
* Bump Ghidra HEAD commit a6be09898

* Bump to stable Ghidra 10.2.3

* Add new 'testfuncproto' source file for testing

* Regenerate patches

Better automated refactoring for removal of 'using' declarations in
header files. See https://github.com/ekilmer/remusing_cpp for automated
tool. Some manual fixes are still required, but they are small. Setting
'using namespace std;' in source files is still a manual process due to
edge-cases that are hard to detect.

* Add missing include path for libconfig.h

Only affects 'sleigh_support' library

Changed files:

```
M	Ghidra/Features/Decompiler/src/decompile/cpp/Makefile
M	Ghidra/Features/Decompiler/src/decompile/cpp/address.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/address.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/architecture.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/block.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/capability.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/consolemain.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/coreaction.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/coreaction.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/error.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/filemanage.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/float.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/flow.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/fspec.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/fspec.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/funcdata_block.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/ghidra_process.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/heritage.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/ifacedecomp.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/ifacedecomp.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/inject_ghidra.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/interface.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/jumptable.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/marshal.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/marshal.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/merge.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/op.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/op.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/opcodes.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/partmap.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/printlanguage.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/ruleaction.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/slgh_compile.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/slgh_compile.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/slghsymbol.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/space.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/space.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/test.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/test.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/testfunction.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/testfunction.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/translate.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/type.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/typeop.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/variable.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/variable.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/varnode.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/varnode.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/xml.hh
A	Ghidra/Features/Decompiler/src/decompile/datatests/condconst.xml
A	Ghidra/Features/Decompiler/src/decompile/datatests/condmulti.xml
A	Ghidra/Features/Decompiler/src/decompile/datatests/retstruct.xml
M	Ghidra/Features/Decompiler/src/decompile/unittests/testfloatemu.cc
A	Ghidra/Features/Decompiler/src/decompile/unittests/testfuncproto.cc
M	Ghidra/Features/Decompiler/src/decompile/unittests/testmarshal.cc
M	Ghidra/Processors/6502/data/languages/65c02.slaspec
M	Ghidra/Processors/68000/data/languages/68000.sinc
M	Ghidra/Processors/AARCH64/certification.manifest
M	Ghidra/Processors/AARCH64/data/languages/AARCH64_win.cspec
A	Ghidra/Processors/AARCH64/data/patterns/AARCH64_win_patterns.xml
A	Ghidra/Processors/AARCH64/data/patterns/prepatternconstraints.xml
M	Ghidra/Processors/AARCH64/src/main/java/ghidra/app/util/bin/format/elf/relocation/AARCH64_ElfRelocationHandler.java
M	Ghidra/Processors/AARCH64/src/main/java/ghidra/app/util/bin/format/macho/relocation/AARCH64_MachoRelocationHandler.java
M	Ghidra/Processors/ARM/data/languages/ARM.ldefs
M	Ghidra/Processors/ARM/data/languages/ARMTHUMBinstructions.sinc
M	Ghidra/Processors/ARM/data/languages/ARMneon.sinc
M	Ghidra/Processors/ARM/src/main/java/ghidra/app/util/bin/format/elf/relocation/ARM_ElfRelocationContext.java
M	Ghidra/Processors/ARM/src/main/java/ghidra/app/util/bin/format/elf/relocation/ARM_ElfRelocationHandler.java
M	Ghidra/Processors/ARM/src/main/java/ghidra/app/util/bin/format/macho/relocation/ARM_MachoRelocationHandler.java
M	Ghidra/Processors/Atmel/data/languages/avr32a.slaspec
M	Ghidra/Processors/Atmel/data/languages/avr32a_dsp_operations.sinc
M	Ghidra/Processors/Atmel/src/main/java/ghidra/app/util/bin/format/elf/relocation/AVR32_ElfRelocationHandler.java
M	Ghidra/Processors/Atmel/src/main/java/ghidra/app/util/bin/format/elf/relocation/AVR8_ElfRelocationHandler.java
M	Ghidra/Processors/MC6800/data/languages/6x09.sinc
M	Ghidra/Processors/MIPS/certification.manifest
M	Ghidra/Processors/MIPS/data/languages/mips.sinc
M	Ghidra/Processors/MIPS/data/languages/mips32Instructions.sinc
M	Ghidra/Processors/MIPS/data/languages/mips32R6be.slaspec
M	Ghidra/Processors/MIPS/data/languages/mips32R6le.slaspec
M	Ghidra/Processors/MIPS/data/languages/mips32_fp64.cspec
M	Ghidra/Processors/MIPS/data/languages/mips32be.cspec
M	Ghidra/Processors/MIPS/data/languages/mips32be.slaspec
M	Ghidra/Processors/MIPS/data/languages/mips32be_eabi.cspec
M	Ghidra/Processors/MIPS/data/languages/mips32le.cspec
M	Ghidra/Processors/MIPS/data/languages/mips32le.slaspec
M	Ghidra/Processors/MIPS/data/languages/mips32le_eabi.cspec
M	Ghidra/Processors/MIPS/data/languages/mips64.cspec
M	Ghidra/Processors/MIPS/data/languages/mips64_32_n32.cspec
M	Ghidra/Processors/MIPS/data/languages/mips64_32_o32.cspec
M	Ghidra/Processors/MIPS/data/languages/mips64_32_o64.cspec
M	Ghidra/Processors/MIPS/data/languages/mips64be.slaspec
M	Ghidra/Processors/MIPS/data/languages/mips64le.slaspec
A	Ghidra/Processors/MIPS/data/languages/mips_dsp.sinc
A	Ghidra/Processors/MIPS/data/languages/mips_mt.sinc
M	Ghidra/Processors/MIPS/src/main/java/ghidra/app/plugin/core/analysis/MipsAddressAnalyzer.java
M	Ghidra/Processors/MIPS/src/main/java/ghidra/app/util/bin/format/elf/extend/MIPS_ElfExtension.java
A	Ghidra/Processors/MIPS/src/main/java/ghidra/app/util/bin/format/elf/relocation/MIPS_ElfRelocationContext.java
M	Ghidra/Processors/MIPS/src/main/java/ghidra/app/util/bin/format/elf/relocation/MIPS_ElfRelocationHandler.java
M	Ghidra/Processors/PIC/src/main/java/ghidra/app/util/bin/format/elf/relocation/PIC30_ElfRelocationContext.java
M	Ghidra/Processors/PIC/src/main/java/ghidra/app/util/bin/format/elf/relocation/PIC30_ElfRelocationHandler.java
M	Ghidra/Processors/PowerPC/src/main/java/ghidra/app/util/bin/format/elf/extend/PowerPC_ElfExtension.java
M	Ghidra/Processors/PowerPC/src/main/java/ghidra/app/util/bin/format/elf/relocation/PowerPC64_ElfRelocationHandler.java
M	Ghidra/Processors/PowerPC/src/main/java/ghidra/app/util/bin/format/elf/relocation/PowerPC_ElfRelocationHandler.java
M	Ghidra/Processors/RISCV/data/languages/riscv32-fp.cspec
M	Ghidra/Processors/RISCV/data/languages/riscv32.cspec
M	Ghidra/Processors/RISCV/data/languages/riscv64-fp.cspec
M	Ghidra/Processors/RISCV/data/languages/riscv64.cspec
M	Ghidra/Processors/RISCV/src/main/java/ghidra/app/util/bin/format/elf/relocation/RISCV_ElfRelocationHandler.java
M	Ghidra/Processors/Sparc/data/languages/SparcV9.sinc
M	Ghidra/Processors/Sparc/src/main/java/ghidra/app/util/bin/format/elf/relocation/SPARC_ElfRelocationHandler.java
M	Ghidra/Processors/SuperH4/src/main/java/ghidra/app/util/bin/format/elf/relocation/SH_ElfRelocationHandler.java
M	Ghidra/Processors/Toy/certification.manifest
M	Ghidra/Processors/Toy/data/languages/toy.pspec
M	Ghidra/Processors/tricore/data/languages/tricore.cspec
M	Ghidra/Processors/tricore/data/languages/tricore.ldefs
M	Ghidra/Processors/tricore/data/languages/tricore.sinc
M	Ghidra/Processors/x86/data/languages/ia.sinc
M	Ghidra/Processors/x86/src/main/java/ghidra/app/util/bin/format/coff/relocation/X86_32_CoffRelocationHandler.java
M	Ghidra/Processors/x86/src/main/java/ghidra/app/util/bin/format/coff/relocation/X86_64_CoffRelocationHandler.java
M	Ghidra/Processors/x86/src/main/java/ghidra/app/util/bin/format/elf/relocation/X86_32_ElfRelocationHandler.java
A	Ghidra/Processors/x86/src/main/java/ghidra/app/util/bin/format/elf/relocation/X86_64_ElfRelocationContext.java
M	Ghidra/Processors/x86/src/main/java/ghidra/app/util/bin/format/elf/relocation/X86_64_ElfRelocationHandler.java
M	Ghidra/Processors/x86/src/main/java/ghidra/app/util/bin/format/macho/relocation/X86_32_MachoRelocationHandler.java
M	Ghidra/Processors/x86/src/main/java/ghidra/app/util/bin/format/macho/relocation/X86_64_MachoRelocationHandler.java
```
2023-03-22 19:14:38 -04:00
auto-updater[bot] 186b4fe693 Update Ghidra HEAD to commit d55b7e9aa (#157)
Changed files:

```
M	Ghidra/Features/Decompiler/src/decompile/cpp/block.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/block.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/dynamic.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/dynamic.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/flow.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/flow.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/funcdata.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/funcdata_block.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/jumptable.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/jumptable.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/ruleaction.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/slgh_compile.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/test.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/test.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/testfunction.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/testfunction.hh
M	Ghidra/Processors/MIPS/src/test.slow/java/ghidra/app/plugin/core/analysis/MipsPreAnalyzerTest.java
M	Ghidra/Processors/PowerPC/data/languages/ppc_embedded.sinc
M	Ghidra/Processors/PowerPC/data/languages/ppc_instructions.sinc
M	Ghidra/Processors/V850/data/languages/Instructions/Float.sinc
M	Ghidra/Processors/x86/data/languages/ia.sinc
```

* Update patches.

The "Small improvements to C decompiler testing from CLI" PR was merged!

Fix new code to use `std::` prefix

Co-authored-by: pgoodman <pgoodman@users.noreply.github.com>
Co-authored-by: Eric Kilmer <eric.d.kilmer@gmail.com>
2023-01-16 17:49:22 -05:00
auto-updater[bot] 487732a026 Update Ghidra HEAD to commit 552eb9dd6 (#154)
* Bump Ghidra HEAD commit 552eb9dd6

Changed files:

```
M	Ghidra/Features/Decompiler/src/decompile/cpp/architecture.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/coreaction.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/coreaction.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/database.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/database.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/fspec.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/funcdata.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/funcdata.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/funcdata_varnode.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/merge.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/merge.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/op.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/op.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/printc.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/printlanguage.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/printlanguage.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/ruleaction.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/ruleaction.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/type.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/type.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/typeop.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/typeop.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/userop.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/variable.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/variable.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/varnode.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/varnode.hh
A	Ghidra/Features/Decompiler/src/decompile/datatests/concat.xml
M	Ghidra/Processors/ARM/data/languages/ARMTHUMBinstructions.sinc
M	Ghidra/Processors/PowerPC/data/languages/ppc_instructions.sinc
M	Ghidra/Processors/Z80/data/languages/z80.slaspec
```

* Regenerate patches

Co-authored-by: Alex Cameron <asc@tetsuo.sh>
2022-12-28 12:33:12 -05:00
Eric Kilmer 2c197599aa Fix update_ghidra_head script git output parsing
Python string split behaves differently than I assumed:

>>> "".split("\n")
['']

returns a list of size 1 but

>>> "".split()
[]

returns size 0 and

>>> "".splitlines()
[]

also returns size 0
2022-12-19 11:05:48 -05:00
auto-updater[bot] 316c91ccfb Update Ghidra HEAD to commit b707c2ea6 (#153)
Bump Ghidra HEAD commit b707c2ea6

Changed files:

```

```

Co-authored-by: pgoodman <pgoodman@users.noreply.github.com>
2022-12-19 14:11:24 +11:00
Eric Kilmer b80fefc001 Update auto-updater script
Should now show changed files on each update.

Only updates if files that affect this project have changed
2022-12-15 13:15:44 -05:00
Eric Kilmer d3ca7d78d6 Patch to remove 'using namespace std' from headers (#143)
* Update to latest Ghidra commit

* Regenerate patches from real git repo (originally #140)
2022-12-15 11:08:35 -05:00
auto-updater[bot] 7a045dd5e8 Update Ghidra HEAD to commit db932d222 (#151)
Bump Ghidra HEAD commit db932d222

Co-authored-by: pgoodman <pgoodman@users.noreply.github.com>
2022-12-12 13:29:33 +11:00
Duncan Ogilvie f12acdfd99 Set the git identity before patching (#150) 2022-12-05 09:48:40 -05:00
auto-updater[bot] 97933e2ffe Update Ghidra HEAD to commit d182ba8ed (#149)
Bump Ghidra HEAD commit d182ba8ed

Co-authored-by: pgoodman <pgoodman@users.noreply.github.com>
2022-12-05 12:02:07 +11:00
auto-updater[bot] 4b225d9317 Update Ghidra HEAD to commit 522bda39e (#148)
Bump Ghidra HEAD commit 522bda39e

Co-authored-by: pgoodman <pgoodman@users.noreply.github.com>
2022-11-28 14:49:55 +11:00
dependabot[bot] a130f452ac build(deps): bump softprops/action-gh-release from 0.1.14 to 0.1.15 (#147)
Bumps [softprops/action-gh-release](https://github.com/softprops/action-gh-release) from 0.1.14 to 0.1.15.
- [Release notes](https://github.com/softprops/action-gh-release/releases)
- [Changelog](https://github.com/softprops/action-gh-release/blob/master/CHANGELOG.md)
- [Commits](https://github.com/softprops/action-gh-release/compare/v0.1.14...v0.1.15)

---
updated-dependencies:
- dependency-name: softprops/action-gh-release
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-11-22 11:53:31 -05:00
auto-updater[bot] df7b7c4ff2 Update Ghidra HEAD to commit 75ddd08bb (#146)
Bump Ghidra HEAD commit 75ddd08bb

Co-authored-by: pgoodman <pgoodman@users.noreply.github.com>
2022-11-21 11:58:40 +11:00
Eric Kilmer ded4e6ac03 Update to Ghidra 10.2.2 2022-11-16 09:42:04 -05:00
Eric Kilmer a4e41c9b35 CI: Compile with position independent code 2022-11-16 08:51:56 -05:00
Eric Kilmer 56f3346c60 CI: Fix cache env variables 2022-11-15 13:20:05 -05:00
Eric Kilmer 846b99c008 Remove deprecated CI functionality
See https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
2022-11-15 12:13:50 -05:00
Eric Kilmer fbbd3d7fc1 Update to Ghidra 10.2.1 2022-11-14 09:43:00 -05:00
auto-updater[bot] 32ae1db007 Update Ghidra HEAD to commit 97097daa6 (#145)
Bump Ghidra HEAD commit 97097daa6

Co-authored-by: pgoodman <pgoodman@users.noreply.github.com>
2022-11-14 12:00:58 +11:00
auto-updater[bot] 12a9904dfb Update Ghidra HEAD to commit 69b07161b (#144)
Bump Ghidra HEAD commit 69b07161b

Co-authored-by: pgoodman <pgoodman@users.noreply.github.com>
2022-11-07 12:49:12 +11:00
Eric Kilmer e9b920d618 More robust CI 2022-11-05 10:39:27 -04:00
Eric Kilmer f38eee41a2 Update to Ghidra stable 10.2 2022-11-04 18:08:16 -04:00
Eric Kilmer c888160f53 Add missing unittest file (#141)
testmarshal.cc in HEAD
2022-11-03 10:26:57 -04:00
auto-updater[bot] 82c11bea62 Update Ghidra HEAD to commit 0bd1c24b9 (#138)
Bump Ghidra HEAD commit 0bd1c24b9

Co-authored-by: pgoodman <pgoodman@users.noreply.github.com>
2022-10-31 09:32:39 -04:00
auto-updater[bot] 21280b4e09 Update Ghidra HEAD to commit 12854d131 (#137)
Bump Ghidra HEAD commit 12854d131

Co-authored-by: pgoodman <pgoodman@users.noreply.github.com>
2022-10-24 10:14:59 -04:00
auto-updater[bot] 3b53dfd6f1 Update Ghidra HEAD to commit 480f1e3a8 (#136)
Bump Ghidra HEAD commit 480f1e3a8

Co-authored-by: pgoodman <pgoodman@users.noreply.github.com>
2022-10-17 09:25:46 -04:00
Alex Cameron 49bb897151 sleigh-lift: Convert address size to bits when calculating bitmask (#135) 2022-10-11 13:11:07 +11:00
auto-updater[bot] 3b1afba2dc Update Ghidra HEAD to commit 35b58b310 (#134)
Bump Ghidra HEAD commit 35b58b310

Co-authored-by: pgoodman <pgoodman@users.noreply.github.com>
2022-10-10 15:49:43 +11:00
auto-updater[bot] 1858fc7473 Update Ghidra HEAD to commit b88cf85d5 (#131)
Bump Ghidra HEAD commit b88cf85d5

Co-authored-by: pgoodman <pgoodman@users.noreply.github.com>
2022-10-03 14:58:24 +11:00
Eric Kilmer c08898c9ae CI: Fix Linux Homebrew usage 2022-09-26 14:15:32 -04:00
auto-updater[bot] 8c78874c7e Update Ghidra HEAD to commit 1cdb68b03 (#130)
Bump Ghidra HEAD commit 1cdb68b03

Co-authored-by: pgoodman <pgoodman@users.noreply.github.com>
2022-09-26 12:04:37 +10:00
auto-updater[bot] cdaf9f6cea Update Ghidra HEAD to commit 975db1919 (#129)
Bump Ghidra HEAD commit 975db1919

Co-authored-by: pgoodman <pgoodman@users.noreply.github.com>
2022-09-19 09:06:38 -04:00
auto-updater[bot] 8dc9ab544d Update Ghidra HEAD to commit 6a2cd8055 (#128)
Bump Ghidra HEAD commit 6a2cd8055

Co-authored-by: pgoodman <pgoodman@users.noreply.github.com>
2022-09-12 10:33:42 -04:00
auto-updater[bot] db6dd1e40b Update Ghidra HEAD to commit 5593df495 (#127)
Bump Ghidra HEAD commit 5593df495

Co-authored-by: pgoodman <pgoodman@users.noreply.github.com>
2022-09-05 13:31:28 +10:00
2over12 9966017ca0 Add kSleighFullSpecInstallDir to gDefaultSearchPaths (#126)
Allows FindSpecFile to succeed if the specfiles are still in the install prefix defined in CMake.
2022-08-29 11:34:50 -04:00
auto-updater[bot] 1c2f67ce48 Update Ghidra HEAD to commit 2536099c0 (#125)
Bump Ghidra HEAD commit 2536099c0

Co-authored-by: pgoodman <pgoodman@users.noreply.github.com>
2022-08-29 11:52:48 +10:00
Eric Kilmer 74838a39ba CMake refactor (#105)
* Major CMake refactor

* CI fixes

* Fix CMake errors

* Install graphviz on Windows

* More consistent CMake build types

* Fix compiler defines for Windows

* Fix more bugs

* Add standalone tool building support

* Fix typo

* Update README

* Install sleighLift before trying to smoketest it

* Test coverage preset

The compiler option '-fkeep-inline-functions' originally included with
the coverage build type causes errors with the message "undefined
reference to 'vtable for OpAction*'" for all OpAction subclasses.

This StackOverflow answer might help in resolving this?
https://stackoverflow.com/a/57504289

* Build documentation by default with CI presets

* Use COMPONENT for install commands

This allows for someone to specify which components they want to install
if they only want or need a subset

* Support cross compiling with host system sleigh compiler

* Various fixes found during review

* Move "_WINDOWS" define to CMakeLists.txt file

* Rename ToB 'tools' directory to 'extra-tools'

* Separate projects for sleigh tools

Library is still top-level CMakeLists.txt

More options

* CMake find_package(Git)

* Fix bad merge for patch paths

* Fix missing libconfig.h header install

* Fix issues with installation of headers

* More refactoring

* Refactor sleighexample into its own project/directory

* Refactor specfiles building into separate project/directory

* Check for termios.h header and set define if found

* Update READMEs

* Better consistency with install rules

* Build sleighLift as a standalone project with added source

* More changes to CMake subprojects

* Also add "Specs" component to sleigh installation config

* Try to be better at bootstrapping subprojects (hopefully this doesn't
  bite us, but if it does, I'm happy to remove it and say "not
  supported")

* Address some code review

* Add project sleigh_tool for tool subdirectory

Could make it easier to build just the tools

* Add help text to name the tool executable name

* Add license notice to CMake files

* Fix/Remove too specific CPack packaging configuration

* Consistent capitalization of Sleigh

Co-authored-by: Alex Cameron <asc@tetsuo.sh>
2022-08-22 15:41:53 +10:00
auto-updater[bot] 72d364a90f Update Ghidra HEAD to commit 03bd4b45d (#123)
* Bump Ghidra HEAD commit 03bd4b45d

* Remove merged Ghidra patch

Co-authored-by: pgoodman <pgoodman@users.noreply.github.com>
Co-authored-by: Alex Cameron <asc@tetsuo.sh>
2022-08-22 14:00:57 +10:00
auto-updater[bot] 755f9252f1 Update Ghidra HEAD to commit aad60ecdd (#122)
Bump Ghidra HEAD commit aad60ecdd

Co-authored-by: pgoodman <pgoodman@users.noreply.github.com>
2022-08-15 11:31:09 +10:00
85 changed files with 4739 additions and 2544 deletions
+214
View File
@@ -0,0 +1,214 @@
---
name: debug-test-failures
version: "1.0.0"
description: >
This skill should be used when debugging test failures, build errors, runtime
crashes, or assertion failures in the Sleigh/Ghidra decompiler project. It
covers building with libc++ hardening assertions (ci-head-assertions preset),
running ctest, obtaining stack traces from SIGABRT or crash signals, narrowing
down which datatest triggers a failure, creating patch files for upstream Ghidra
source in src/patches/, and recognizing common C++ bug patterns such as
strict-weak ordering violations in comparators. Relevant when encountering
"the build is failing", "ctest fails", decompiler crashes, or libc++ assertion
errors.
---
# Debugging Test Failures in the Sleigh Project
This project builds the Ghidra decompiler as a standalone C++ library. Ghidra source
is fetched via CMake FetchContent and patches are applied via `git am`. The key
challenge is that bugs live in upstream Ghidra code and fixes must be packaged as
patch files.
## Quick Reference
```bash
# Build with libc++ assertions (catches strict-weak ordering, container misuse, etc.)
cmake --preset ci-head-assertions
cmake --build build/ci-head-assertions
ctest --test-dir build/ci-head-assertions --output-on-failure
# Clean cached Ghidra source (needed after adding/changing patches)
rm -rf build/ci-head-assertions/_deps/ghidrasource-*
# Where the Ghidra C++ source lives after fetch
build/ci-head-assertions/_deps/ghidrasource-src/Ghidra/Features/Decompiler/src/decompile/cpp/
```
## 0. Prerequisites
### Create `CMakeUserPresets.json`
The `ci-head-assertions` preset used throughout this workflow lives in
`CMakeUserPresets.json`, which is not version-controlled and does **not** exist on
a fresh checkout. You must create it in the repository root before any build
commands will work.
Create `/workspaces/sleigh/CMakeUserPresets.json` with this content:
```json
{
"version": 2,
"cmakeMinimumRequired": { "major": 3, "minor": 18, "patch": 0 },
"configurePresets": [
{
"name": "libcxx",
"hidden": true,
"cacheVariables": {
"CMAKE_CXX_COMPILER": "clang++",
"CMAKE_CXX_FLAGS": "-stdlib=libc++ -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_DEBUG -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3 -fstrict-flex-arrays=3 -fstack-clash-protection -fstack-protector-strong",
"CMAKE_EXE_LINKER_FLAGS": "-stdlib=libc++ -lc++abi",
"CMAKE_SHARED_LINKER_FLAGS": "-stdlib=libc++ -lc++abi"
}
},
{
"name": "ci-head",
"hidden": true,
"inherits": ["ci-ubuntu"],
"cacheVariables": { "sleigh_RELEASE_TYPE": "HEAD" }
},
{
"name": "ci-head-assertions",
"binaryDir": "${sourceDir}/build/${presetName}",
"inherits": ["libcxx", "ci-head"],
"generator": "Ninja",
"cacheVariables": { "CMAKE_BUILD_TYPE": "Debug" }
}
]
}
```
This file inherits from `ci-ubuntu` (defined in `CMakePresets.json`), so the
repo's version-controlled presets must also be present (they always are in a
normal checkout).
## 1. Build Presets
### The assertions preset
The `ci-head-assertions` preset (created in Section 0 above) links against libc++
with `_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_DEBUG`. This enables runtime
checks that catch undefined behavior in STL usage — most importantly, it validates
that comparators passed to `std::sort` satisfy strict-weak ordering.
### Other useful presets
| Preset | Source | Purpose |
|--------|--------|---------|
| `ci-head-assertions` | `CMakeUserPresets.json` | HEAD build with libc++ debug assertions (primary debugging preset) |
| `ci-head` | `CMakeUserPresets.json` | HEAD build without assertions (faster, hidden/base preset) |
| `ci-sanitize` | `CMakePresets.json` | Stable build with ASan + UBSan (repo-controlled) |
Note: `ci-head-assertions` and `ci-head` are user-local presets created in
Section 0. `ci-sanitize` is the only sanitizer preset version-controlled in the
repo. Add your own sanitizer presets to `CMakeUserPresets.json` as needed.
## 2. Running Tests
```bash
# Run all tests
ctest --test-dir build/ci-head-assertions --output-on-failure
# Run a specific test
ctest --test-dir build/ci-head-assertions -R decomp_datatest --output-on-failure
```
There are typically 3 tests:
| Test | What it does |
|------|--------------|
| `sleigh_decomp_unittest` | Unit tests (fast) |
| `sleigh_decomp_datatest` | Decompiler data tests — runs XML test files from the `datatests/` directory |
| `sleigh_namespace_std_test` | Namespace compilation test |
The datatest exercises the most code paths and is the most likely to trigger
assertion failures from comparator bugs.
### How datatest works
The test binary loads XML files from the datatests directory in alphabetical order.
Each XML file contains binary data + expected decompiler output patterns. The test
decompiles each function and checks the output against `<stringmatch>` patterns.
The exact command ctest uses (check `tests/CTestTestfile.cmake` for the authoritative version):
```bash
./tests/sleigh_decomp_test \
-sleighpath <build-dir> \
-path <build-dir>/_deps/ghidrasource-src/Ghidra/Features/Decompiler/src/decompile/datatests \
datatests
```
## 3. Getting a Stack Trace from a Crash
When a test crashes (e.g., SIGABRT from an assertion), you need a stack trace to
identify which comparator or code path is the culprit. The test binaries may not
have full debug symbols, so multiple techniques may be needed.
See `references/stack-trace-techniques.md` for the full details on each method.
Here's the summary:
1. **gdb**: Use `gdb -batch` for full demangled backtraces — the simplest method
2. **lldb**: Use `lldb -b` with `-k` for crash-time backtrace commands
3. **LD_PRELOAD backtrace**: Build a small shared library that catches SIGABRT and
prints a backtrace — works when neither debugger can attach (containers)
4. **addr2line**: Resolve raw hex addresses from the backtrace to function names
and source lines
## 4. Narrowing Down Which Test Triggers a Crash
> **Tip**: Often the stack trace from Section 3 identifies the exact function and
> source line, making this step unnecessary. Use this binary search technique only
> when the stack trace is unclear or you need to isolate which specific test input
> triggers the crash.
When you know the test crashes but can't immediately identify the cause from the
stack trace, use binary search on the test XML files.
The idea: copy subsets of test files to a temporary directory and run the test
binary against that subset. Keep halving until you isolate the triggering file.
```bash
cd build/ci-head-assertions
# Copy a subset of test files to a temporary directory
mkdir -p /tmp/test_subset
SRC=_deps/ghidrasource-src/Ghidra/Features/Decompiler/src/decompile/datatests
for f in $(ls $SRC/*.xml | sort | sed -n '1,20p'); do cp "$f" /tmp/test_subset/; done
# Run just those tests
./tests/sleigh_decomp_test -sleighpath . -path /tmp/test_subset datatests
```
Important: some crashes only reproduce when specific files are processed together
(accumulated state from earlier tests), so start by splitting the full set in half
rather than testing individual files. If an individual file doesn't crash alone, try
combining it with files that ran before it in alphabetical order.
## 5. Creating Patches for Ghidra Source
Patches live in `src/patches/HEAD/` (for HEAD builds) and `src/patches/stable/`
(for stable builds). They are applied via `git am` during the CMake FetchContent
step. See `references/patching-workflow.md` for the full step-by-step.
### Quick workflow
1. **Edit the bug** in `build/<preset>/_deps/ghidrasource-src/Ghidra/Features/Decompiler/src/decompile/cpp/`
2. **Commit**: `cd` into the ghidrasource-src dir, `git add` + `git commit`
3. **Generate patches**: `git format-patch -o /workspaces/sleigh/src/patches/HEAD/ <base_commit>..HEAD`
4. **Register** the new patch in `src/setup-ghidra-source.cmake`
5. **Clean and rebuild**: `rm -rf build/<preset>/_deps/ghidrasource-*` then reconfigure
The base commit for HEAD is the `ghidra_head_git_tag` value in `src/setup-ghidra-source.cmake`.
## 6. Common Bug Patterns
The most common bugs are **strict-weak ordering violations** in comparators used
by `std::sort` or `std::set`. These are caught by libc++ assertions at runtime.
Key patterns include null pointer sentinels that don't check self-comparison,
special index early-returns without checking the other operand, and unsafe casts
in `compareDependency` methods of TypePartial* classes.
See `references/common-bug-patterns.md` for detailed before/after code examples,
real-world instances from the codebase (e.g., `PullRecord::operator<` in
`bitfield.cc`, `FlowBlock::compareFinalOrder` in `block.cc`), and a systematic
audit checklist for finding new comparator bugs.
@@ -0,0 +1,72 @@
# Common Bug Patterns in Ghidra Decompiler Source
## Strict-weak ordering violations
The most common class of bugs caught by libc++ assertions. A comparator for
`std::sort` or `std::set` must satisfy:
- **Irreflexivity**: `comp(a, a)` must return `false`
- **Asymmetry**: if `comp(a, b)` is true then `comp(b, a)` must be false
- **Transitivity**: if `comp(a, b)` and `comp(b, c)` then `comp(a, c)`
The libc++ assertion message looks like:
```
strict_weak_ordering_check.h:50: libc++ Hardening assertion
!__comp(*(__first + __a), *(__first + __b)) failed:
Your comparator is not a valid strict-weak ordering
```
### Pattern 1: Null pointer sentinel without self-check
```cpp
// BUG: when both are null, returns true (violates irreflexivity)
if (ptr == nullptr)
return true;
// FIX: only return true when the other is non-null
if (ptr == nullptr)
return (other.ptr != nullptr);
```
Real example: `PullRecord::operator<` in `bitfield.cc` — when both `readOp`
pointers were null, the comparator returned `true`.
### Pattern 2: Special index without self-check
```cpp
// BUG: when comparing the entry point with itself, returns true
if (bl1->getIndex() == 0) return true;
// FIX: check that the other is different
if (bl1->getIndex() == 0) return (bl2->getIndex() != 0);
```
Real example: `FlowBlock::compareFinalOrder` in `block.cc`.
### Pattern 3: Unsafe cast in compareDependency (TypePartial* classes)
The `TypePartialEnum`, `TypePartialStruct`, and `TypePartialUnion` classes have
`compareDependency` methods that cast `op` to their own type. If `op` is actually
the parent container type (not a partial), the cast accesses invalid memory.
```cpp
// BUG: casts op to TypePartialFoo without checking if op IS the container
TypePartialFoo *tp = (TypePartialFoo *) &op;
// FIX: add a guard before the cast
if (container == &op) return 1; // op is our container
TypePartialFoo *tp = (TypePartialFoo *) &op;
```
Real example: `TypePartialEnum::compareDependency` in `type.cc` (patched in 0005).
## How to audit comparators systematically
1. Search for all `operator<`, `::compare`, and `::compareDependency` functions
2. Search for all `sort(`, `stable_sort(`, and `std::set` usage to find which
comparators are actually used in sorting contexts
3. For each comparator, mentally trace the case where both arguments are identical
— does it return false?
4. Check for early-return branches that don't verify the other operand differs
5. For `compareDependency` methods in TypePartial* classes, check for the
container-guard pattern before unsafe casts
@@ -0,0 +1,153 @@
# Patching Workflow for Ghidra Source
## Overview
Ghidra source is fetched via CMake FetchContent from GitHub. Patches are applied
automatically during the configure step using `git am`. The patch files live in
the Sleigh repo and are version-controlled.
## Directory Structure
```
src/patches/
├── HEAD/ # Patches for the HEAD (development) Ghidra commit
│ ├── 0001-Fix-UBSAN-errors-in-decompiler.patch
│ ├── 0002-Use-stroull-instead-of-stroul-to-parse-address-offse.patch
│ └── ...
└── stable/ # Patches for the stable Ghidra release
├── 0001-Fix-UBSAN-errors-in-decompiler.patch
└── ...
```
## Key Configuration
The base commit and patch list are defined in `src/setup-ghidra-source.cmake`:
- `ghidra_head_git_tag`: The pinned HEAD commit hash
- `ghidra_version` / `ghidra_git_tag`: The stable version tag
- `ghidra_patches`: The ordered list of patch files to apply
## Step-by-Step: Creating a New Patch
### 1. Identify the build preset
Determine which build you're fixing. The Ghidra source checkout location depends
on the preset:
```
build/<preset>/_deps/ghidrasource-src/
```
For example:
```
build/ci-head-assertions/_deps/ghidrasource-src/
```
The C++ source files are in:
```
build/<preset>/_deps/ghidrasource-src/Ghidra/Features/Decompiler/src/decompile/cpp/
```
### 2. Make the fix
Edit the file directly in the Ghidra source checkout. The file already has all
existing patches applied, so you're working on top of the current patch stack.
### 3. Commit in the Ghidra source checkout
```bash
cd build/<preset>/_deps/ghidrasource-src
# In a fresh container, git may require identity configuration before committing:
# git config user.name "Your Name" && git config user.email "your@email.com"
git add Ghidra/Features/Decompiler/src/decompile/cpp/<file>.cc
git commit -m "decompiler: Short description
Longer explanation of the bug and fix. Mention what assertion or test
was failing and why."
```
Commit message conventions:
- Prefix with `decompiler:` for decompiler fixes
- First line should be concise (under 72 chars)
- Body explains the *why*, not just the *what*
### 4. Generate patch files
Use `git format-patch` to regenerate ALL patches from the base commit:
```bash
# Get the base commit from src/setup-ghidra-source.cmake
# For HEAD: it's the ghidra_head_git_tag value
# For stable: it's the Ghidra_X.Y.Z_build tag
git format-patch -o /workspaces/sleigh/src/patches/HEAD/ <base_commit>..HEAD
```
This regenerates patches 0001 through 000N. Existing patches will be regenerated
with updated numbering in the `[PATCH N/M]` subject line, but the content stays
the same. The new patch gets the next number.
### 5. Register in CMake
Edit `src/setup-ghidra-source.cmake` and add the new patch file to the appropriate
`ghidra_patches` list:
```cmake
"${CMAKE_CURRENT_LIST_DIR}/patches/HEAD/0006-your-new-patch-name.patch"
```
### 6. Verify from scratch
Clean the cached source so FetchContent re-fetches and applies all patches fresh:
```bash
rm -rf build/<preset>/_deps/ghidrasource-*
cmake --preset <preset>
cmake --build build/<preset>
ctest --test-dir build/<preset> --output-on-failure
```
Watch the configure output for:
```
Applying: <your commit message>
```
If a patch fails to apply, you'll see `Patch failed at NNNN ...` during configure.
## HEAD vs Stable
- **HEAD patches** (`src/patches/HEAD/`): Applied to the development commit. May
include fixes for newly added files (e.g., `bitfield.cc` is HEAD-only).
- **Stable patches** (`src/patches/stable/`): Applied to the release tag. These
are typically a subset of HEAD patches that also apply to stable.
Check `src/setup-ghidra-source.cmake` to see which files are HEAD-only (look for
`if("${sleigh_RELEASE_TYPE}" STREQUAL "HEAD")` blocks).
## Troubleshooting
### Patch fails to apply
If `git am` fails during configure, the Ghidra source checkout may be in a dirty
state. Clean it:
```bash
rm -rf build/<preset>/_deps/ghidrasource-*
```
Then reconfigure. If the patch itself is wrong, fix it and try again.
### Patches conflict with new Ghidra commit
When updating the pinned Ghidra HEAD commit, existing patches may not apply cleanly.
See the [wiki](https://github.com/lifting-bits/sleigh/wiki/Patching-and-Updating)
for the full rebasing procedure.
### Source already patched from manual edits
If you edited files directly in the checkout and then try to reconfigure, CMake
may try to apply patches on top of already-patched code. Always clean the
`_deps/ghidrasource-*` directories before reconfiguring after generating new
patches.
@@ -0,0 +1,149 @@
# Stack Trace Techniques
When a test binary crashes (typically SIGABRT from a libc++ hardening assertion),
these techniques can be used to identify the exact function and source line.
## Method 1: gdb (simplest)
gdb in batch mode produces full demangled backtraces and works reliably in most
environments, including containers with default seccomp profiles.
```bash
cd build/ci-head-assertions
gdb -batch \
-ex "run -sleighpath . -path _deps/ghidrasource-src/Ghidra/Features/Decompiler/src/decompile/datatests datatests" \
-ex "bt" \
./tests/sleigh_decomp_test
```
gdb will run the program, and when it crashes (e.g., SIGABRT), it automatically
stops and prints the backtrace. The output includes fully demangled C++ function
names and source locations.
If gdb is unavailable, try lldb (Method 2). If neither debugger can attach
(restricted ptrace), fall back to Method 3.
## Method 2: lldb
Use lldb in batch mode with the full test arguments. The key is to handle SIGABRT
so it stops instead of terminating.
**Important**: Use `-k` (one-line-on-crash) for the backtrace command, not `-o`.
Commands passed via `-o` run sequentially after file load, but when lldb hits a
signal stop, it enters its event loop and won't execute subsequent `-o` commands.
The `-k` flag queues commands to run specifically when the target crashes.
```bash
cd build/ci-head-assertions
lldb -b \
-o "process handle SIGABRT --stop true --pass false" \
-o "run -sleighpath . -path _deps/ghidrasource-src/Ghidra/Features/Decompiler/src/decompile/datatests datatests" \
-k "thread backtrace" \
-k "quit" \
-- ./tests/sleigh_decomp_test
```
If lldb shows full symbol names (function + file + line), you're done.
If lldb fails with "personality set failed: Operation not permitted", this is
common in Docker containers where ptrace is restricted. Use Method 3 instead.
## Method 3: LD_PRELOAD Backtrace Library
Build a small shared library that intercepts SIGABRT and prints a backtrace:
```bash
cat > /tmp/bt_preload.c << 'BTEOF'
#include <signal.h>
#include <execinfo.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
void bt_handler(int sig) {
void *array[50];
int size = backtrace(array, 50);
fprintf(stderr, "=== BACKTRACE (signal %d) ===\n", sig);
backtrace_symbols_fd(array, size, STDERR_FILENO);
fprintf(stderr, "=== END BACKTRACE ===\n");
signal(sig, SIG_DFL);
raise(sig);
}
__attribute__((constructor))
void install_handler(void) {
signal(SIGABRT, bt_handler);
}
BTEOF
gcc -shared -fPIC -o /tmp/bt_preload.so /tmp/bt_preload.c -rdynamic
```
Run the test with the preloaded library:
```bash
cd build/ci-head-assertions
LD_PRELOAD=/tmp/bt_preload.so ./tests/sleigh_decomp_test \
-sleighpath . \
-path _deps/ghidrasource-src/Ghidra/Features/Decompiler/src/decompile/datatests \
datatests
```
The output will look like:
```
=== BACKTRACE (signal 6) ===
./tests/sleigh_decomp_test(+0xf1a64)[0x55c312f02a64]
./tests/sleigh_decomp_test(+0xf17ea)[0x55c312f027ea]
./tests/sleigh_decomp_test(+0xef732)[0x55c312f00732]
...
=== END BACKTRACE ===
```
The addresses in parentheses (like `+0xf1a64`) are the key — these are offsets
from the binary's load address.
## Method 4: addr2line
Resolve the hex offsets from the backtrace to function names and source lines:
```bash
for addr in 0xf1a64 0xf17ea 0xef732 0x31fbd9 0x31d536; do
echo -n "$addr: "
addr2line -e ./tests/sleigh_decomp_test -f -C "$addr"
echo "---"
done
```
Flags:
- `-e` specifies the executable
- `-f` prints function names
- `-C` demangles C++ names
Example output:
```
0xf1a64: void std::__1::__check_strict_weak_ordering_sorted<...>(...)
/usr/lib/llvm-21/bin/../include/c++/v1/__debug_utils/strict_weak_ordering_check.h:51
---
0x31fbd9: ghidra::BlockGraph::orderBlocks()
/path/to/block.hh:431
---
```
This tells you exactly which sort call and which comparator function triggered
the assertion.
## Putting It All Together
Typical debugging flow:
1. Run the test: `ctest --test-dir build/ci-head-assertions -R decomp_datatest --output-on-failure`
2. See assertion failure → need stack trace
3. Try gdb first (Method 1) — it typically gives the best output with full demangled symbols
4. If gdb is unavailable, try lldb (Method 2)
5. If neither debugger can attach → build LD_PRELOAD library (Method 3)
6. Resolve addresses with addr2line (Method 4) if the backtrace only has hex offsets
7. Now you know which comparator function and sort call is the problem
8. Read the comparator code and check for strict-weak ordering violations
@@ -0,0 +1,67 @@
---
name: sleigh-ghidra-release
description: Update the lifting-bits/sleigh repository for a new upstream Ghidra stable release. Use when bumping Ghidra stable tags or versions, porting or regenerating src/patches/stable from HEAD patches, updating Ghidra source or spec file lists, moving HEAD-only source/header entries into stable, validating local Ghidra builds, or preparing release-update commits and PRs.
---
# Sleigh Ghidra Release
## Overview
Update this repository after NSA publishes a new Ghidra release. Prefer the repo's existing release-update shape: verify the upstream tag, reuse `src/ghidra-stable`, regenerate stable patches mechanically from HEAD patches where possible, update CMake lists, and validate with a local build.
Read [references/release-checklist.md](references/release-checklist.md) when doing the update; it contains the detailed checklist and decision points.
## Workflow
1. Inspect state before changing anything:
- Run `git status --short`.
- Treat existing edits and untracked files as user-owned unless the task clearly says otherwise.
- Keep unrelated files out of release-update commits.
2. Verify the target release:
- Use official upstream sources for release and tag facts.
- Prefer Exa MCP tools for web lookup when available.
- Confirm the tag format, usually `Ghidra_<version>_build`.
3. Prepare `src/ghidra-stable`:
- Use the existing checkout when present.
- If a clone is needed, clone under `src/`.
- Normalize `origin` to HTTPS if the remote uses a local SSH alias:
```bash
git -C src/ghidra-stable remote set-url origin https://github.com/NationalSecurityAgency/ghidra.git
```
- Fetch and check out the release tag:
```bash
git -C src/ghidra-stable fetch origin tag Ghidra_<version>_build --depth=1
git -C src/ghidra-stable checkout --detach Ghidra_<version>_build
git -C src/ghidra-stable config user.name "github-actions[bot]"
git -C src/ghidra-stable config user.email "41898282+github-actions[bot]@users.noreply.github.com"
```
4. Regenerate stable patches mechanically:
- Start from a clean `Ghidra_<version>_build` checkout.
- Try applying HEAD patches in order.
- If a HEAD patch fails, inspect whether it is already upstreamed, still needed with adjusted context, or only applies to HEAD-only code. Abort and retry with the applicable subset when needed.
- Use `format-patch` from `Ghidra_<version>_build..HEAD` to create the new stable patch files.
- Update `src/setup-ghidra-source.cmake` patch ordering to match the regenerated files.
5. Update release metadata and lists:
- Set `ghidra_version` in `src/setup-ghidra-source.cmake`.
- Search for `sleigh_RELEASE_IS_HEAD`; move entries into stable when the release now contains those sources or headers.
- Update `src/spec_files_stable.cmake` from the release checkout's `.slaspec` inventory.
- Check `cmake/packaging.cmake` and reset `PACKAGE_VERSION` to `1` when the release cycle requires it.
6. Validate the exact files CMake will use:
- Re-checkout the release tag in `src/ghidra-stable`.
- Apply `src/patches/stable/*.patch`.
- Configure with `FETCHCONTENT_SOURCE_DIR_GHIDRASOURCE` pointing at the local checkout.
- Build with `cmake --build ... --parallel`.
- Run `ctest`; if no developer-mode configure was used, `No tests were found` may be expected.
7. Review and commit only when asked:
- Use `git diff --cached --stat`, `git diff --cached --name-status`, and `git diff --cached --check`.
- `git diff --check` may flag generated `git format-patch` signature lines; inspect before changing generated patch files.
- Commit messages must follow the repo's 50/72 rule.
@@ -0,0 +1,4 @@
interface:
display_name: "Sleigh Ghidra Release"
short_description: "Update Sleigh for new Ghidra releases"
default_prompt: "Use $sleigh-ghidra-release to update this repo for a new upstream Ghidra release."
@@ -0,0 +1,78 @@
# Release Update Checklist
This checklist is based on the repository wiki page:
https://github.com/lifting-bits/sleigh/wiki/New-Ghidra-Release-Update-Checklist
## Files To Check
- `src/setup-ghidra-source.cmake`: stable version, stable patch list, HEAD pin, source lists.
- `src/patches/stable/`: regenerated patches for the stable Ghidra tag.
- `src/patches/HEAD/`: source patches to port to the new stable release.
- `src/spec_files_stable.cmake`: stable `.slaspec` inventory.
- `src/spec_files_HEAD.cmake`: comparison point for new spec files.
- `CMakeLists.txt`: public Ghidra headers copied into the build include directory.
- `cmake/packaging.cmake`: package version reset when relevant.
## Patch Regeneration
Preferred pattern:
```bash
git -C src/ghidra-stable checkout --detach Ghidra_<version>_build
git -C src/ghidra-stable am --ignore-space-change --ignore-whitespace --no-gpg-sign \
/absolute/path/to/src/patches/HEAD/*.patch
git -C src/ghidra-stable format-patch -o /private/tmp/sleigh-ghidra-stable-patches \
Ghidra_<version>_build..HEAD
```
If a patch fails:
- Run `git -C src/ghidra-stable am --abort`.
- Inspect the failed patch and the target source.
- Decide whether the patch is already upstreamed, still needed with refreshed context, or only applicable to HEAD-only code.
- Reapply the exact applicable patch sequence or subset.
- Regenerate stable patches from the resulting commits; avoid hand-editing patch bodies unless conflict resolution requires it.
## Source And Header Lists
Find HEAD-only gates:
```bash
rg -n "sleigh_RELEASE_IS_HEAD|sleigh_RELEASE_TYPE.*HEAD" \
CMakeLists.txt src cmake support tests
```
When a previously HEAD-only file exists in the new stable release, move it to the normal stable list and leave no dead conditional branch unless the branch still has a purpose.
## Spec Files
Build the stable inventory from the release checkout:
```bash
fd -e slaspec . src/ghidra-stable/Ghidra/Processors
```
Update `src/spec_files_stable.cmake` with sorted
`${ghidrasource_SOURCE_DIR}/...` entries. Compare against both the old stable
list and `src/spec_files_HEAD.cmake`.
## Validation
Verify the generated stable patch files directly:
```bash
git -C src/ghidra-stable checkout --detach Ghidra_<version>_build
git -C src/ghidra-stable am --ignore-space-change --ignore-whitespace --no-gpg-sign \
/absolute/path/to/src/patches/stable/*.patch
```
Then configure and build Sleigh against the local checkout:
```bash
cmake -B build/ghidra-<version>-local -S . \
-DFETCHCONTENT_SOURCE_DIR_GHIDRASOURCE=/absolute/path/to/src/ghidra-stable
cmake --build build/ghidra-<version>-local --parallel
ctest --test-dir build/ghidra-<version>-local --output-on-failure
```
If tests matter for the update, use a developer-mode preset or option. A plain configure may not register tests.
+1
View File
@@ -0,0 +1 @@
../.agents/skills
+37
View File
@@ -0,0 +1,37 @@
FROM mcr.microsoft.com/devcontainers/base:ubuntu-24.04
ENV DEBIAN_FRONTEND=noninteractive
ENV LLVM_VERSION=21
RUN apt-get update && apt-get install -y --no-install-recommends \
ca-certificates \
gnupg \
wget \
software-properties-common \
&& wget -qO- https://apt.llvm.org/llvm-snapshot.gpg.key | gpg --dearmor -o /usr/share/keyrings/llvm-archive-keyring.gpg \
&& echo "deb [signed-by=/usr/share/keyrings/llvm-archive-keyring.gpg] http://apt.llvm.org/noble/ llvm-toolchain-noble-${LLVM_VERSION} main" \
> /etc/apt/sources.list.d/llvm.list \
&& apt-get update && apt-get install -y \
clang-${LLVM_VERSION} \
clangd-${LLVM_VERSION} \
lld-${LLVM_VERSION} \
llvm-${LLVM_VERSION}-dev \
libclang-${LLVM_VERSION}-dev \
libc++-${LLVM_VERSION}-dev \
libc++abi-${LLVM_VERSION}-dev \
lldb-${LLVM_VERSION} \
cmake \
ninja-build \
git \
zlib1g-dev \
ccache \
doxygen \
graphviz \
&& update-alternatives --install /usr/bin/cc cc /usr/bin/clang-${LLVM_VERSION} 100 \
&& update-alternatives --install /usr/bin/c++ c++ /usr/bin/clang++-${LLVM_VERSION} 100 \
&& update-alternatives --install /usr/bin/clang clang /usr/bin/clang-${LLVM_VERSION} 100 \
&& update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-${LLVM_VERSION} 100 \
&& update-alternatives --install /usr/bin/lld lld /usr/bin/lld-${LLVM_VERSION} 100 \
&& update-alternatives --install /usr/bin/lldb lldb /usr/bin/lldb-${LLVM_VERSION} 100 \
&& update-alternatives --install /usr/bin/clangd clangd /usr/bin/clangd-${LLVM_VERSION} 100 \
&& apt-get clean && rm -rf /var/lib/apt/lists/*
+19
View File
@@ -0,0 +1,19 @@
{
"name": "sleigh",
"build": {
"dockerfile": "Dockerfile"
},
"runArgs": [
"--cap-add=SYS_PTRACE",
"--security-opt=seccomp=unconfined",
"--privileged"
],
"customizations": {
"vscode": {
"extensions": [
"ms-vscode.cmake-tools",
"llvm-vs-code-extensions.vscode-clangd",
]
}
}
}
+161
View File
@@ -0,0 +1,161 @@
name: Documentation
on:
release:
types: [published]
workflow_dispatch: # manual trigger
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: pages
cancel-in-progress: false
jobs:
deploy:
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- uses: actions/checkout@v6
- name: Setup Git User for Applying Patches
# See this thread for more details https://github.community/t/github-actions-bot-email-address/17204/5
run: |
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --global user.name "github-actions[bot]"
- name: Install dependencies
run: sudo apt-get update && sudo apt-get install -y doxygen graphviz
# Build stable documentation
- name: Configure (stable)
run: cmake --preset=ci-ubuntu -Dsleigh_RELEASE_TYPE=stable
- name: Build documentation (stable)
run: cmake --build build --target docs
- name: Copy stable docs
run: |
mkdir -p docs-site/stable
cp -r build/docs/html/* docs-site/stable/
# Clean and build HEAD documentation
- name: Clean build directory
run: rm -rf build
- name: Configure (HEAD)
run: cmake --preset=ci-ubuntu -Dsleigh_RELEASE_TYPE=HEAD
- name: Build documentation (HEAD)
run: cmake --build build --target docs
- name: Copy HEAD docs
run: |
mkdir -p docs-site/HEAD
cp -r build/docs/html/* docs-site/HEAD/
# Create landing page
- name: Create landing page
run: |
cat > docs-site/index.html << 'EOF'
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Sleigh Documentation</title>
<style>
:root {
--bg-color: #f5f5f5;
--text-color: #333;
--text-muted: #666;
--card-bg: white;
--card-shadow: rgba(0,0,0,0.1);
--card-shadow-hover: rgba(0,0,0,0.15);
--link-color: #0066cc;
}
@media (prefers-color-scheme: dark) {
:root {
--bg-color: #1a1a1a;
--text-color: #e0e0e0;
--text-muted: #a0a0a0;
--card-bg: #2d2d2d;
--card-shadow: rgba(0,0,0,0.3);
--card-shadow-hover: rgba(0,0,0,0.4);
--link-color: #4da6ff;
}
}
body {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
max-width: 800px;
margin: 0 auto;
padding: 2rem;
background: var(--bg-color);
color: var(--text-color);
}
h1 {
color: var(--text-color);
}
.cards {
display: flex;
gap: 1rem;
margin-top: 2rem;
}
.card {
flex: 1;
background: var(--card-bg);
border-radius: 8px;
padding: 1.5rem;
text-decoration: none;
color: inherit;
box-shadow: 0 2px 4px var(--card-shadow);
transition: box-shadow 0.2s;
}
.card:hover {
box-shadow: 0 4px 8px var(--card-shadow-hover);
}
.card h2 {
margin-top: 0;
color: var(--link-color);
}
.card p {
color: var(--text-muted);
margin-bottom: 0;
}
</style>
</head>
<body>
<h1>Sleigh Documentation</h1>
<p>Select a documentation version:</p>
<div class="cards">
<a href="stable/" class="card">
<h2>Stable</h2>
<p>Documentation for the latest stable release.</p>
</a>
<a href="HEAD/" class="card">
<h2>HEAD</h2>
<p>Documentation for the latest Ghidra HEAD development version.</p>
</a>
</div>
</body>
</html>
EOF
- name: Upload Pages artifact
uses: actions/upload-pages-artifact@v5
with:
path: docs-site
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v5
+301 -76
View File
@@ -3,15 +3,18 @@ name: Build
on:
push:
branches:
- '*'
- "*"
# Version tags should start with "v"
tags:
- 'v*'
- "v*"
pull_request:
branches:
- '*'
- "*"
env:
LLVM_VERSION: 21
jobs:
build:
@@ -23,9 +26,14 @@ jobs:
os: [ubuntu-latest, macos-latest, windows-latest]
build_type: [RelWithDebInfo, Debug]
release: [stable, HEAD]
exclude:
- os: ubuntu-latest
build_type: Debug
- os: macos-latest
build_type: Debug
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v6
- name: Setup Git User for Applying Patches
# See this thread for more details https://github.community/t/github-actions-bot-email-address/17204/5
@@ -37,51 +45,42 @@ jobs:
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y \
clang \
rpm \
doxygen \
xdot \
graphviz
# Minimum supported CMake version testing
curl -L "https://github.com/Kitware/CMake/releases/download/v3.18.0/cmake-3.18.0-Linux-$(uname -m).sh" -o /tmp/cmake-install.sh
mkdir -p "${HOME}/.local"
bash /tmp/cmake-install.sh --skip-license --exclude-subdir "--prefix=${HOME}/.local"
# Use Homebrew for latest build tool version for use in CI
brew install \
ccache
sudo apt-get install -y rpm ccache doxygen graphviz xdot
- name: Install macOS system dependencies
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'
run: choco install ccache
uses: nick-fields/retry@v4
with:
timeout_minutes: 10
max_attempts: 3
command: |
choco install ccache doxygen.install graphviz
Add-Content -Path $env:GITHUB_ENV -Value "CCACHE_EXE=$(Resolve-Path C:\ProgramData\chocolatey\lib\ccache\tools\*\ccache.exe)"
vcpkg install zlib:x64-windows-static
- name: Generate cache key
id: cache_key
shell: cmake -P {0}
run: |
string(TIMESTAMP current_date "%Y-%m-%d-%H;%M;%S" UTC)
message("::set-output name=VALUE::build_${{ matrix.os }}_type-${{ matrix.build_type }}-${{ matrix.release }}")
message("::set-output name=timestamp::${current_date}")
file(APPEND "$ENV{GITHUB_ENV}" "CACHE_KEY=build_${{ matrix.os }}_type-${{ matrix.build_type }}-${{ matrix.release }}\n")
file(APPEND "$ENV{GITHUB_ENV}" "CACHE_TIMESTAMP=${current_date}\n")
- name: Update the cache (ccache)
uses: actions/cache@v3
uses: actions/cache@v5
with:
path: "${{ github.workspace }}/ccache"
key: ${{ steps.cache_key.outputs.VALUE }}_ccache_${{ steps.cache_key.outputs.timestamp }}
key: ${{ env.CACHE_KEY }}_ccache_${{ env.CACHE_TIMESTAMP }}
restore-keys: |
${{ steps.cache_key.outputs.VALUE }}_ccache_
${{ env.CACHE_KEY }}_ccache_
- name: Setup ccache
working-directory: "${{ github.workspace }}"
@@ -96,6 +95,9 @@ jobs:
# This should be multiplied by the number of compilation jobs and be no
# larger than 5G, which is the cache max size
file(APPEND "$ENV{GITHUB_ENV}" "CCACHE_MAXSIZE=400M\n")
# Tell CMake to use ccache
file(APPEND "$ENV{GITHUB_ENV}" "CMAKE_CXX_COMPILER_LAUNCHER=ccache\n")
file(APPEND "$ENV{GITHUB_ENV}" "CMAKE_C_COMPILER_LAUNCHER=ccache\n")
# Clear stats before every build
execute_process(COMMAND ccache -z)
@@ -103,49 +105,91 @@ jobs:
run: cmake --version
- name: Configure the project
run: cmake
-S .
-B build
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache
-DCMAKE_C_COMPILER_LAUNCHER=ccache
shell: pwsh
run: cmake "--preset=ci-$("${{ matrix.os }}".split("-")[0])"
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
-Dsleigh_RELEASE_TYPE=${{ matrix.release }}
-Dsleigh_ENABLE_TESTS=ON
-Dsleigh_ENABLE_EXAMPLES=ON
-Dsleigh_ENABLE_PACKAGING=ON
-Dsleigh_ENABLE_DOCUMENTATION=ON
"-DCMAKE_PROJECT_INCLUDE:FILEPATH=${{ github.workspace }}/cmake/ccache-msvc.cmake"
-DCMAKE_MSVC_DEBUG_INFORMATION_FORMAT=Embedded
- name: Build the project
run: cmake
--build build
--config ${{ matrix.build_type }}
-j 2
-j 4
-v
- name: Test the project
working-directory: build
run: ctest -VV -C ${{ matrix.build_type }}
- name: Build the docs
run: cmake
--build build
--config ${{ matrix.build_type }}
--target docs
-v
- name: Run the example
run: cmake
--build build
-j 2
-j 4
--config ${{ matrix.build_type }}
--target sleighexample_runner
--target sleigh_example_runner
- name: Run the install target
run: cmake --install build
--config ${{ matrix.build_type }}
--prefix install
- name: Test install directory
- name: Smoketest sleigh lift
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 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 }}
cmake --build build -j 4 --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 4 --config ${{ matrix.build_type }}
cd build
ctest -V -C ${{ matrix.build_type }}
- 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 }}
cmake --build build -j 4 --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: 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 4 --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
--build build
-j 2
-j 4
--config ${{ matrix.build_type }}
--target package
@@ -155,76 +199,257 @@ jobs:
sudo dpkg -i build/*.deb
cmake -S tests/find_package -B find_package_build -DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
cmake --build find_package_build -j 2 --config ${{ matrix.build_type }} --verbose
cmake --build find_package_build -j 4 --config ${{ matrix.build_type }} --verbose
- name: Locate the packages (RelWithDebInfo only)
if: matrix.build_type == 'RelWithDebInfo'
shell: bash
id: package_locations
run: |
echo ::set-output name=DEB_PACKAGE_PATH::$(ls build/*.deb)
echo ::set-output name=DEB_PACKAGE_NAME::$(cd build && ls *.deb)
echo "DEB_PACKAGE_PATH=$(ls build/*.deb)" >> $GITHUB_ENV
echo "DEB_PACKAGE_NAME=$(cd build && ls *.deb)" >> $GITHUB_ENV
echo ::set-output name=RPM_PACKAGE_PATH::$(ls build/*.rpm)
echo ::set-output name=RPM_PACKAGE_NAME::$(cd build && ls *.rpm)
echo "RPM_PACKAGE_PATH=$(ls build/*.rpm)" >> $GITHUB_ENV
echo "RPM_PACKAGE_NAME=$(cd build && ls *.rpm)" >> $GITHUB_ENV
# Rename .tar.gz files for OS
pushd build
for f in *.tar.gz; do mv "$f" "${{ runner.os }}-$f"; done
popd
echo ::set-output name=TGZ_PACKAGE_PATH::$(ls build/*.tar.gz)
echo ::set-output name=TGZ_PACKAGE_NAME::$(cd build && ls *.tar.gz)
echo "TGZ_PACKAGE_PATH=$(ls build/*.tar.gz)" >> $GITHUB_ENV
echo "TGZ_PACKAGE_NAME=$(cd build && ls *.tar.gz)" >> $GITHUB_ENV
# 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@v7
with:
name: ${{ steps.package_locations.outputs.DEB_PACKAGE_NAME }}
path: ${{ steps.package_locations.outputs.DEB_PACKAGE_PATH }}
name: ${{ env.DEB_PACKAGE_NAME }}
path: ${{ env.DEB_PACKAGE_PATH }}
archive: false
- name: Release DEB package artifact (RelWithDebInfo only)
uses: softprops/action-gh-release@v0.1.14
uses: softprops/action-gh-release@v3.0.0
if: matrix.build_type == 'RelWithDebInfo' && runner.os == 'Linux' && startsWith(github.ref, 'refs/tags/') && matrix.release == 'stable'
with:
files: ${{ steps.package_locations.outputs.DEB_PACKAGE_PATH }}
files: ${{ env.DEB_PACKAGE_PATH }}
draft: true
# 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@v7
with:
name: ${{ steps.package_locations.outputs.RPM_PACKAGE_NAME }}
path: ${{ steps.package_locations.outputs.RPM_PACKAGE_PATH }}
name: ${{ env.RPM_PACKAGE_NAME }}
path: ${{ env.RPM_PACKAGE_PATH }}
archive: false
- name: Release RPM package artifact (RelWithDebInfo only)
uses: softprops/action-gh-release@v0.1.14
uses: softprops/action-gh-release@v3.0.0
if: matrix.build_type == 'RelWithDebInfo' && runner.os == 'Linux' && startsWith(github.ref, 'refs/tags/') && matrix.release == 'stable'
with:
files: ${{ steps.package_locations.outputs.RPM_PACKAGE_PATH }}
files: ${{ env.RPM_PACKAGE_PATH }}
draft: true
# TGZ Package
- name: Upload the TGZ package artifact (RelWithDebInfo only)
if: matrix.build_type == 'RelWithDebInfo'
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v7
with:
name: ${{ steps.package_locations.outputs.TGZ_PACKAGE_NAME }}
path: ${{ steps.package_locations.outputs.TGZ_PACKAGE_PATH }}
name: ${{ env.TGZ_PACKAGE_NAME }}
path: ${{ env.TGZ_PACKAGE_PATH }}
archive: false
- name: Release TGZ package artifact (RelWithDebInfo only)
uses: softprops/action-gh-release@v0.1.14
uses: softprops/action-gh-release@v3.0.0
if: matrix.build_type == 'RelWithDebInfo' && startsWith(github.ref, 'refs/tags/') && matrix.release == 'stable'
with:
files: ${{ steps.package_locations.outputs.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 -V -C ${{ matrix.build_type }}
files: ${{ env.TGZ_PACKAGE_PATH }}
draft: true
- name: ccache stats
run: ccache -s --verbose
run: ccache -s
publish-release:
needs: [build]
if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- run: gh release edit "${{ github.ref_name }}" --draft=false --repo "${{ github.repository }}"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
sanitizer:
runs-on: ubuntu-latest
permissions:
contents: read
env:
ASAN_OPTIONS: strict_string_checks=1:detect_stack_use_after_return=1:check_initialization_order=1:strict_init_order=1:detect_leaks=1
UBSAN_OPTIONS: print_stacktrace=1
strategy:
fail-fast: false
matrix:
release: [stable, HEAD]
steps:
- uses: actions/checkout@v6
- name: Setup Git User for Applying Patches
run: |
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --global user.name "github-actions[bot]"
- name: Install LLVM
run: |
wget -qO /tmp/llvm.sh https://apt.llvm.org/llvm.sh
chmod +x /tmp/llvm.sh
sudo /tmp/llvm.sh $LLVM_VERSION
echo "CXX=clang++-$LLVM_VERSION" >> "$GITHUB_ENV"
- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y ccache
- name: Generate cache key
shell: cmake -P {0}
run: |
string(TIMESTAMP current_date "%Y-%m-%d-%H;%M;%S" UTC)
file(APPEND "$ENV{GITHUB_ENV}" "CACHE_KEY=sanitizer_${{ matrix.release }}\n")
file(APPEND "$ENV{GITHUB_ENV}" "CACHE_TIMESTAMP=${current_date}\n")
- name: Update the cache (ccache)
uses: actions/cache@v5
with:
path: "${{ github.workspace }}/ccache"
key: ${{ env.CACHE_KEY }}_ccache_${{ env.CACHE_TIMESTAMP }}
restore-keys: |
${{ env.CACHE_KEY }}_ccache_
- name: Setup ccache
working-directory: "${{ github.workspace }}"
shell: cmake -P {0}
run: |
file(MAKE_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/ccache")
file(APPEND "$ENV{GITHUB_ENV}" "CCACHE_BASEDIR=${CMAKE_CURRENT_SOURCE_DIR}\n")
file(APPEND "$ENV{GITHUB_ENV}" "CCACHE_DIR=${CMAKE_CURRENT_SOURCE_DIR}/ccache\n")
file(APPEND "$ENV{GITHUB_ENV}" "CCACHE_COMPRESS=true\n")
file(APPEND "$ENV{GITHUB_ENV}" "CCACHE_COMPRESSLEVEL=10\n")
file(APPEND "$ENV{GITHUB_ENV}" "CCACHE_MAXSIZE=400M\n")
file(APPEND "$ENV{GITHUB_ENV}" "CMAKE_CXX_COMPILER_LAUNCHER=ccache\n")
file(APPEND "$ENV{GITHUB_ENV}" "CMAKE_C_COMPILER_LAUNCHER=ccache\n")
execute_process(COMMAND ccache -z)
- name: Configure the project
run: cmake --preset=ci-sanitize
-Dsleigh_RELEASE_TYPE=${{ matrix.release }}
-Dsleigh_BUILD_DOCUMENTATION=OFF
- name: Build the project
run: cmake
--build build/sanitize
-j 4
-v
- name: Test the project
working-directory: build/sanitize
run: ctest -VV
- name: Run the example
run: cmake
--build build/sanitize
-j 4
--target sleigh_example_runner
- name: Run the install target
run: cmake --install build/sanitize
--prefix install
- name: Smoketest sleigh lift
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: ccache stats
run: ccache -s
assertions:
runs-on: ubuntu-latest
permissions:
contents: read
strategy:
fail-fast: false
matrix:
release: [stable, HEAD]
steps:
- uses: actions/checkout@v6
- name: Setup Git User for Applying Patches
run: |
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --global user.name "github-actions[bot]"
- name: Install LLVM
run: |
wget -qO /tmp/llvm.sh https://apt.llvm.org/llvm.sh
chmod +x /tmp/llvm.sh
sudo /tmp/llvm.sh $LLVM_VERSION
echo "CXX=clang++-$LLVM_VERSION" >> "$GITHUB_ENV"
- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y ccache libc++-$LLVM_VERSION-dev libc++abi-$LLVM_VERSION-dev
- name: Generate cache key
shell: cmake -P {0}
run: |
string(TIMESTAMP current_date "%Y-%m-%d-%H;%M;%S" UTC)
file(APPEND "$ENV{GITHUB_ENV}" "CACHE_KEY=assertions_${{ matrix.release }}\n")
file(APPEND "$ENV{GITHUB_ENV}" "CACHE_TIMESTAMP=${current_date}\n")
- name: Update the cache (ccache)
uses: actions/cache@v5
with:
path: "${{ github.workspace }}/ccache"
key: ${{ env.CACHE_KEY }}_ccache_${{ env.CACHE_TIMESTAMP }}
restore-keys: |
${{ env.CACHE_KEY }}_ccache_
- name: Setup ccache
working-directory: "${{ github.workspace }}"
shell: cmake -P {0}
run: |
file(MAKE_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/ccache")
file(APPEND "$ENV{GITHUB_ENV}" "CCACHE_BASEDIR=${CMAKE_CURRENT_SOURCE_DIR}\n")
file(APPEND "$ENV{GITHUB_ENV}" "CCACHE_DIR=${CMAKE_CURRENT_SOURCE_DIR}/ccache\n")
file(APPEND "$ENV{GITHUB_ENV}" "CCACHE_COMPRESS=true\n")
file(APPEND "$ENV{GITHUB_ENV}" "CCACHE_COMPRESSLEVEL=10\n")
file(APPEND "$ENV{GITHUB_ENV}" "CCACHE_MAXSIZE=400M\n")
file(APPEND "$ENV{GITHUB_ENV}" "CMAKE_CXX_COMPILER_LAUNCHER=ccache\n")
file(APPEND "$ENV{GITHUB_ENV}" "CMAKE_C_COMPILER_LAUNCHER=ccache\n")
execute_process(COMMAND ccache -z)
- name: Configure the project
run: cmake --preset=ci-assertions
-Dsleigh_RELEASE_TYPE=${{ matrix.release }}
-Dsleigh_BUILD_DOCUMENTATION=OFF
- name: Build the project
run: cmake
--build build/assertions
-j 4
-v
- name: Test the project
working-directory: build/assertions
run: ctest -VV
- name: ccache stats
run: ccache -s
+86 -16
View File
@@ -12,34 +12,104 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v6
- uses: actions/setup-python@v4
- uses: actions/setup-python@v6
with:
# Use oldest supported version for maximum script compatibility
python-version: '3.7'
python-version: '3.10'
- name: Run Update Script
id: head_update
run: |
# Sets some outputs. See next step
python3.7 scripts/update_ghidra_head.py --ci
python3 scripts/update_ghidra_head.py --ci
# Need this to run further Actions on the newly created PR
# See here for more details https://github.com/peter-evans/create-pull-request/blob/28fa4848947e0faa7fa50647691d01477589d5e9/docs/concepts-guidelines.md#authenticating-with-github-app-generated-tokens
- uses: tibdex/github-app-token@v1
# See here for more details https://github.com/peter-evans/create-pull-request/blob/main/docs/concepts-guidelines.md#authenticating-with-github-app-generated-tokens
- uses: actions/create-github-app-token@v3
if: steps.head_update.outputs.did_update
id: generate-token
with:
app_id: ${{ secrets.APP_ID }}
private_key: ${{ secrets.APP_PRIVATE_KEY }}
app-id: ${{ secrets.APP_ID }}
private-key: ${{ secrets.APP_PRIVATE_KEY }}
- name: Create PR
- name: Commit, push, and create PR
if: steps.head_update.outputs.did_update
uses: peter-evans/create-pull-request@v4
with:
title: Update Ghidra HEAD to commit ${{ steps.head_update.outputs.short_sha }}
commit-message: Bump Ghidra HEAD commit ${{ steps.head_update.outputs.short_sha }}
branch: cron/update-ghidra-${{ steps.head_update.outputs.short_sha }}
delete-branch: true
token: ${{ steps.generate-token.outputs.token }}
env:
GH_TOKEN: ${{ steps.generate-token.outputs.token }}
run: |
BRANCH="cron/update-ghidra-${{ steps.head_update.outputs.short_sha }}"
# Check if PR already exists for this branch
if gh pr list --head "$BRANCH" --json number --jq '.[0].number' | grep -q .; then
echo "PR already exists for branch $BRANCH, skipping"
exit 0
fi
# Configure git
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
# Create branch and commit
git checkout -b "$BRANCH"
git add -A
git commit -m "$(cat <<'EOF'
Bump Ghidra HEAD commit ${{ steps.head_update.outputs.short_sha }}
Changed files:
${{ steps.head_update.outputs.changed_files }}
Commit details:
${{ steps.head_update.outputs.commit_details }}
EOF
)"
# Push branch
git push -u origin "$BRANCH"
# Build PR body using heredoc with single-quoted delimiter to prevent
# bash from interpreting backticks in the markdown content as command
# substitution. GitHub Actions expressions are expanded before bash
# processes the script, so they still get substituted.
BASE_BODY=$(cat <<'PRBODY'
Changed files:
${{ steps.head_update.outputs.changed_files }}
Commit details:
${{ steps.head_update.outputs.commit_details }}
PRBODY
)
# Add intervention warning if needed
if [ "${{ steps.head_update.outputs.needs_manual_intervention }}" = "true" ]; then
INTERVENTION=$(cat <<'PRBODY'
## :warning: Manual Intervention Required
The following files were added or deleted and may require manual CMake configuration updates:
${{ steps.head_update.outputs.intervention_details }}
### Instructions
- **New C++ sources**: Add to appropriate list in `src/setup-ghidra-source.cmake`
- **Deleted C++ sources**: Remove from `src/setup-ghidra-source.cmake`
- **New spec files**: Review if `.slaspec` files are auto-generated; other types may need manual updates
- **Deleted spec files**: Verify no longer referenced
---
PRBODY
)
PR_BODY="${INTERVENTION}${BASE_BODY}"
else
PR_BODY="$BASE_BODY"
fi
# Create PR
gh pr create \
--title "Update Ghidra HEAD to commit ${{ steps.head_update.outputs.short_sha }}" \
--body "$PR_BODY"
+117
View File
@@ -0,0 +1,117 @@
# CLAUDE.md
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
## Project Overview
Sleigh is a CMake-based build system for Ghidra's Sleigh/decompiler C++ libraries (by Trail of Bits). It wraps NSA's Ghidra source code — fetched via CMake FetchContent during configure — so the Sleigh disassembly and decompilation engines can be built as standalone C++ libraries for reuse outside Ghidra.
**The actual Ghidra C++ source is not in this repo.** It is cloned from GitHub automatically during CMake configuration.
## Build Commands
```sh
# Standard build (fetches Ghidra source on first configure)
cmake -B build -S .
cmake --build build -j$(nproc)
# CI-style build with developer mode (enables tests, docs, warnings)
cmake --preset=ci-ubuntu
cmake --build build -j$(nproc)
# Build with HEAD (bleeding-edge) Ghidra instead of stable
cmake -B build -S . -Dsleigh_RELEASE_TYPE=HEAD
# Use a local Ghidra checkout (avoids re-cloning)
cmake -B build -S . -Dsleigh_RELEASE_TYPE=HEAD \
-DFETCHCONTENT_SOURCE_DIR_GHIDRASOURCE=/path/to/ghidra
# Sanitizer build
cmake --preset=ci-sanitize
cmake --build build/sanitize -j$(nproc)
```
## Running Tests
Tests require `sleigh_DEVELOPER_MODE=ON` (enabled by all `ci-*` presets).
```sh
# Run all tests
cd build && ctest -VV
# Run specific test by name
cd build && ctest -VV -R sleigh_decomp_unittest # unit tests
cd build && ctest -VV -R sleigh_decomp_datatest # data-driven tests
cd build && ctest -VV -R sleigh_namespace_std_test # header hygiene check
```
Test binary: `sleigh_decomp_test` — wraps Ghidra's own test suite. Takes `-sleighpath` for compiled .sla files and a test mode (`unittests` or `datatests`).
## Architecture
### Library Targets
| Target | Library | C++ Std | Description |
|--------|---------|---------|-------------|
| `sleigh::sla` | `sla` | C++11 | Core sleigh: disassembly, encoding, p-code, emulation |
| `sleigh::decomp` | `decomp` | C++11 | Full decompiler (superset of sla) |
| `sleigh::support` | `slaSupport` | C++17 | Trail of Bits helpers: `FindSpecFile()`, version info |
Headers: `<ghidra/*.hh>` for upstream Ghidra headers, `<sleigh/*.h>` for ToB additions.
### Key Directories
- `src/setup-ghidra-source.cmake` — Pinned Ghidra versions, FetchContent, source file lists, patch application. **This is the central file for version bumps and source management.**
- `src/patches/{stable,HEAD}/` — Git-format patches applied to Ghidra source during fetch
- `src/spec_files_{stable,HEAD}.cmake` — Lists of ~148 .slaspec files to compile
- `tools/` — Ghidra executables (sleigh compiler, decompiler, ghidra service)
- `support/` — Trail of Bits support library (C++17)
- `extra-tools/sleigh-lift/` — Demo tool for disassembly/p-code lifting
- `cmake/modules/sleighCompile.cmake``sleigh_compile()` function exported for downstream users
### How Ghidra Source Integration Works
1. `src/setup-ghidra-source.cmake` pins a Ghidra git ref (tag for stable, commit hash for HEAD)
2. CMake FetchContent clones from `github.com/NationalSecurityAgency/ghidra`
3. Patches from `src/patches/` are applied via `git am`
4. Source file lists reference into `Ghidra/Features/Decompiler/src/decompile/cpp/`
5. Headers are copied into `build/include/ghidra/` for clean include paths
### Two Release Tracks
- **stable** (default): Pinned to a Ghidra release tag (e.g., `Ghidra_12.0.3_build`). Shallow clone.
- **HEAD**: Pinned to a specific commit on Ghidra main. Full clone. Updated weekly by CI via `scripts/update_ghidra_head.py`.
## Patch System
Patches fix upstream Ghidra bugs (UB sanitizer issues, portability, strict weak ordering violations) without changing Sleigh functionality. They are standard `git format-patch` files.
- `src/patches/stable/` — Patches for stable release
- `src/patches/HEAD/` — Superset of stable patches plus HEAD-specific fixes
- Custom patches via: `-Dsleigh_ADDITIONAL_PATCHES="path/to/patch1;path/to/patch2"`
When adding patches: create with `git format-patch`, number sequentially, and add to both directories if applicable. Patches in HEAD must be a superset of stable patches.
## Key Gotchas
- **In-source builds are forbidden** — enforced by `cmake/prelude.cmake`
- **First configure is slow** — Ghidra repo clone takes time (especially HEAD which can't shallow clone)
- **Core libraries are C++11** — the support library and extra tools are C++17, but `sleigh::sla` and `sleigh::decomp` must stay C++11
- **Source file lists are manual** — when Ghidra adds/removes .cc files, `src/setup-ghidra-source.cmake` must be updated; the `scripts/update_ghidra_head.py` script detects new files and flags them
- **Strict weak ordering** — a recurring class of upstream bugs in Ghidra comparators; several patches fix these
- **Spec files differ between releases** — `src/spec_files_stable.cmake` and `src/spec_files_HEAD.cmake` are separate lists and must be maintained independently
## CMake Presets Reference
| Preset | Use Case |
|--------|----------|
| `ci-ubuntu` | Linux dev build with warnings and tests |
| `ci-macos` | macOS dev build |
| `ci-windows` | Windows dev build (VS 2022, vcpkg) |
| `ci-sanitize` | ASan + UBSan (builds to `build/sanitize/`) |
| `ci-coverage` | Code coverage (builds to `build/coverage/`) |
## Code Style
- `.clang-format`: BasedOnStyle LLVM
- Compiler warnings are strict in CI (see `flags-unix`/`flags-windows` presets)
+117 -697
View File
@@ -8,6 +8,11 @@
cmake_minimum_required(VERSION 3.18)
# For MSVC ccache to use /Z7 with CMAKE_MSVC_DEBUG_INFORMATION_FORMAT=Embedded
cmake_policy(SET CMP0141 NEW)
include(cmake/prelude.cmake)
# Sets "library_root" variable for decompiler cpp root directory
# Sets "ghidra_version" for numeric version number
# Use "ghidrasource_SOURCE_DIR" variable for Ghidra repo root
@@ -17,29 +22,20 @@ if("${sleigh_RELEASE_TYPE}" STREQUAL "HEAD")
set(sleigh_RELEASE_IS_HEAD TRUE)
endif()
project("sleigh"
project(sleigh
VERSION "${ghidra_version}"
DESCRIPTION "Unofficial CMake build for Ghidra Sleigh"
HOMEPAGE_URL "https://github.com/lifting-bits/sleigh"
LANGUAGES CXX
)
include("cmake/options.cmake")
if(sleigh_ENABLE_TESTS)
include("CTest")
endif()
if(sleigh_ENABLE_PACKAGING)
include("cmake/packaging.cmake")
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
message(WARNING "sleigh: Packaging a Debug version")
endif()
endif()
include(cmake/project-is-top-level.cmake)
include(cmake/options.cmake)
#
# Move headers so we can prefix with "ghidra/"
#
set(public_include_header_list
"${PROJECT_SOURCE_DIR}/include/libsleigh.hh"
"${PROJECT_SOURCE_DIR}/support/Support.h"
"${PROJECT_SOURCE_DIR}/support/Version.h"
"${library_root}/action.hh"
"${library_root}/address.hh"
"${library_root}/architecture.hh"
@@ -140,352 +136,45 @@ set(public_include_header_list
"${library_root}/varnode.hh"
"${library_root}/xml.hh"
"${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"
"${library_root}/expression.hh"
"${library_root}/bitfield.hh"
)
if(sleigh_RELEASE_IS_HEAD)
list(APPEND public_include_header_list
"${library_root}/unionresolve.hh"
"${library_root}/marshal.hh"
)
endif()
# if(sleigh_RELEASE_IS_HEAD)
# list(APPEND public_include_header_list
# )
# endif()
# 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 include/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")
set(sleigh_core_source_list
"${library_root}/xml.cc"
"${library_root}/space.cc"
"${library_root}/float.cc"
"${library_root}/address.cc"
"${library_root}/pcoderaw.cc"
"${library_root}/translate.cc"
"${library_root}/opcodes.cc"
"${library_root}/globalcontext.cc"
)
if(sleigh_RELEASE_IS_HEAD)
list(APPEND sleigh_core_source_list
"${library_root}/marshal.cc"
)
endif()
set(sleigh_deccore_source_list
"${library_root}/capability.cc"
"${library_root}/architecture.cc"
"${library_root}/options.cc"
"${library_root}/graph.cc"
"${library_root}/cover.cc"
"${library_root}/block.cc"
"${library_root}/cast.cc"
"${library_root}/typeop.cc"
"${library_root}/database.cc"
"${library_root}/cpool.cc"
"${library_root}/comment.cc"
"${library_root}/stringmanage.cc"
"${library_root}/fspec.cc"
"${library_root}/action.cc"
"${library_root}/loadimage.cc"
"${library_root}/grammar.cc"
"${library_root}/varnode.cc"
"${library_root}/op.cc"
"${library_root}/type.cc"
"${library_root}/variable.cc"
"${library_root}/varmap.cc"
"${library_root}/jumptable.cc"
"${library_root}/emulate.cc"
"${library_root}/emulateutil.cc"
"${library_root}/flow.cc"
"${library_root}/userop.cc"
"${library_root}/funcdata.cc"
"${library_root}/funcdata_block.cc"
"${library_root}/funcdata_op.cc"
"${library_root}/funcdata_varnode.cc"
"${library_root}/pcodeinject.cc"
"${library_root}/heritage.cc"
"${library_root}/prefersplit.cc"
"${library_root}/rangeutil.cc"
"${library_root}/ruleaction.cc"
"${library_root}/subflow.cc"
"${library_root}/blockaction.cc"
"${library_root}/merge.cc"
"${library_root}/double.cc"
"${library_root}/transform.cc"
"${library_root}/coreaction.cc"
"${library_root}/condexe.cc"
"${library_root}/override.cc"
"${library_root}/dynamic.cc"
"${library_root}/crc32.cc"
"${library_root}/prettyprint.cc"
"${library_root}/printlanguage.cc"
"${library_root}/printc.cc"
"${library_root}/printjava.cc"
"${library_root}/memstate.cc"
"${library_root}/opbehavior.cc"
"${library_root}/paramid.cc"
)
if(sleigh_RELEASE_IS_HEAD)
list(APPEND sleigh_deccore_source_list
"${library_root}/unionresolve.cc"
)
endif()
set(sleigh_extra_source_list
"${library_root}/callgraph.cc"
"${library_root}/ifacedecomp.cc"
"${library_root}/ifaceterm.cc"
"${library_root}/inject_sleigh.cc"
"${library_root}/interface.cc"
"${library_root}/libdecomp.cc"
"${library_root}/loadimage_xml.cc"
"${library_root}/raw_arch.cc"
"${library_root}/rulecompile.cc"
"${library_root}/sleigh_arch.cc"
"${library_root}/testfunction.cc"
"${library_root}/unify.cc"
"${library_root}/xml_arch.cc"
)
set(sleigh_source_list
"${library_root}/sleigh.cc"
"${library_root}/pcodeparse.cc"
"${library_root}/pcodecompile.cc"
"${library_root}/sleighbase.cc"
"${library_root}/slghsymbol.cc"
"${library_root}/slghpatexpress.cc"
"${library_root}/slghpattern.cc"
"${library_root}/semantics.cc"
"${library_root}/context.cc"
"${library_root}/filemanage.cc"
)
set(sleigh_ghidra_source_list
"${library_root}/ghidra_arch.cc"
"${library_root}/inject_ghidra.cc"
"${library_root}/ghidra_translate.cc"
"${library_root}/loadimage_ghidra.cc"
"${library_root}/typegrp_ghidra.cc"
"${library_root}/database_ghidra.cc"
"${library_root}/ghidra_context.cc"
"${library_root}/cpool_ghidra.cc"
"${library_root}/ghidra_process.cc"
"${library_root}/comment_ghidra.cc"
"${library_root}/string_ghidra.cc"
)
set(sleigh_slacomp_source_list
"${library_root}/slgh_compile.cc"
"${library_root}/slghparse.cc"
"${library_root}/slghscan.cc"
)
# External Dependencies
find_package(ZLIB REQUIRED)
#
# sleigh settings
# sla
#
add_library(sleigh_settings INTERFACE)
add_library(sleigh::sleigh_settings ALIAS sleigh_settings)
target_compile_features(sleigh_settings INTERFACE
cxx_std_11
)
set(sleigh_SPEC_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/share/sleigh/specfiles/")
set(sleigh_SPEC_BUILD_DIR "${CMAKE_CURRENT_BINARY_DIR}/specfiles/")
set_target_properties(sleigh_settings PROPERTIES
INTERFACE_POSITION_INDEPENDENT_CODE ON
)
if(sleigh_ENABLE_SANITIZERS)
message(STATUS "sleigh: Sanitizers have been enabled")
if(NOT CMAKE_BUILD_TYPE STREQUAL "Debug")
message(WARNING "sleigh: Debug builds are preferred when sanitizers are enabled")
endif()
set(flag_list
-fno-omit-frame-pointer -fsanitize=undefined,address
)
target_compile_options(sleigh_settings INTERFACE ${flag_list})
target_link_options(sleigh_settings INTERFACE ${flag_list})
endif()
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
set(debug_setting_list
OPACTION_DEBUG
MERGEMULTI_DEBUG
BLOCKCONSISTENT_DEBUG
DFSVERIFY_DEBUG
)
foreach(debug_setting ${debug_setting_list})
if(NOT sleigh_${debug_setting})
continue()
endif()
message(STATUS "sleigh: Enabling debug setting: sleigh_${debug_setting}")
target_compile_definitions(sleigh_settings INTERFACE
${debug_setting}
)
endforeach()
endif()
set(internal_setting_list
CPUI_STATISTICS
CPUI_RULECOMPILE
)
foreach(internal_setting ${internal_setting_list})
if(NOT sleigh_${internal_setting})
continue()
endif()
message(STATUS "sleigh: Enabling internal setting: sleigh_${internal_setting}")
target_compile_definitions(sleigh_settings INTERFACE
${internal_setting}
)
endforeach()
#
# decomp_opt, decomp_dbg
#
add_executable(decomp_opt
${sleigh_core_source_list}
${sleigh_deccore_source_list}
${sleigh_extra_source_list}
${sleigh_source_list}
"${library_root}/consolemain.cc"
)
add_executable(sleigh::decomp_opt ALIAS decomp_opt)
if(NOT CMAKE_HOST_SYSTEM_NAME STREQUAL "Windows")
target_compile_definitions(decomp_opt PRIVATE
__TERMINAL__
)
endif()
target_link_libraries(decomp_opt PRIVATE
sleigh::sleigh_settings
)
target_include_directories(decomp_opt PRIVATE $<BUILD_INTERFACE:${library_root}>)
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
target_compile_definitions(decomp_opt PRIVATE
CPUI_DEBUG
)
set_target_properties(decomp_opt PROPERTIES
OUTPUT_NAME "decomp_dbg"
)
endif()
#
# ghidra_test_dbg
#
if(sleigh_ENABLE_TESTS)
add_executable(ghidra_test_dbg
${sleigh_core_source_list}
${sleigh_deccore_source_list}
${sleigh_source_list}
${sleigh_extra_source_list}
"${library_root}/test.cc"
"${library_root}/../unittests/testcirclerange.cc"
"${library_root}/../unittests/testfloatemu.cc"
"${library_root}/../unittests/testtypes.cc"
)
target_link_libraries(ghidra_test_dbg PRIVATE
sleigh::sleigh_settings
)
target_include_directories(ghidra_test_dbg PRIVATE $<BUILD_INTERFACE:${library_root}>)
if(NOT CMAKE_HOST_SYSTEM_NAME STREQUAL "Windows")
target_compile_definitions(ghidra_test_dbg PRIVATE
__TERMINAL__
)
endif()
add_test(
NAME ghidra_unittest_dbg
COMMAND ghidra_test_dbg -sleighpath "${CMAKE_CURRENT_BINARY_DIR}" unittests
)
add_test(
NAME ghidra_datatest_dbg
COMMAND ghidra_test_dbg -sleighpath "${CMAKE_CURRENT_BINARY_DIR}"
-path "${ghidrasource_SOURCE_DIR}/Ghidra/Features/Decompiler/src/decompile/datatests"
datatests
)
endif()
#
# ghidra_opt, ghidra_dbg
#
add_executable(ghidra_opt
${sleigh_core_source_list}
${sleigh_deccore_source_list}
${sleigh_ghidra_source_list}
)
add_executable(sleigh::ghidra_opt ALIAS ghidra_opt)
target_link_libraries(ghidra_opt PRIVATE
sleigh::sleigh_settings
)
target_include_directories(ghidra_opt PRIVATE $<BUILD_INTERFACE:${library_root}>)
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
target_sources(ghidra_opt PRIVATE
"${library_root}/callgraph.cc"
"${library_root}/ifacedecomp.cc"
"${library_root}/ifaceterm.cc"
"${library_root}/interface.cc"
"${library_root}/testfunction.cc"
)
target_compile_definitions(ghidra_opt PRIVATE
CPUI_DEBUG
)
set_target_properties(ghidra_opt PROPERTIES
OUTPUT_NAME "ghidra_dbg"
)
endif()
#
# sleigh_opt, sleigh_dbg
#
add_executable(sleigh_opt
${sleigh_core_source_list}
${sleigh_source_list}
${sleigh_slacomp_source_list}
)
add_executable(sleigh::sleigh_opt ALIAS sleigh_opt)
target_link_libraries(sleigh_opt PRIVATE
sleigh::sleigh_settings
)
target_include_directories(sleigh_opt PRIVATE $<BUILD_INTERFACE:${library_root}>)
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
set_target_properties(sleigh_opt PROPERTIES
OUTPUT_NAME "sleigh_dbg"
)
endif()
#
# sla, sla_dbg
#
add_library(sla
add_library(sleigh_sla
${sleigh_core_source_list}
${sleigh_source_list}
@@ -495,383 +184,114 @@ add_library(sla
"${library_root}/emulate.cc"
"${library_root}/opbehavior.cc"
)
add_library(sleigh::sla ALIAS sla)
target_link_libraries(sla PUBLIC
sleigh::sleigh_settings
)
add_library(sleigh::sla ALIAS sleigh_sla)
target_compile_features(sleigh_sla PUBLIC cxx_std_11)
# Private include search path '#include "..."
target_include_directories(sla PRIVATE $<BUILD_INTERFACE:${library_root}>)
target_include_directories(sleigh_sla PRIVATE "$<BUILD_INTERFACE:${library_root}>")
# Public include search path in build directory
target_include_directories(
sla SYSTEM
INTERFACE $<BUILD_INTERFACE:${public_headers_dir}>
sleigh_sla SYSTEM
INTERFACE "$<BUILD_INTERFACE:${public_headers_dir}>"
)
target_compile_definitions(sleigh_sla PRIVATE "$<$<CONFIG:Debug>:YYDEBUG>")
sleigh_add_optional_defines(sleigh_sla PUBLIC)
set_target_properties(sleigh_sla PROPERTIES
EXPORT_NAME sla
OUTPUT_NAME sla
OUTPUT_NAME_DEBUG sla_dbg
)
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
target_compile_definitions(sla PRIVATE
YYDEBUG
)
set_target_properties(sla PROPERTIES
OUTPUT_NAME "sla_dbg"
)
endif()
target_link_libraries(sleigh_sla PUBLIC ZLIB::ZLIB)
#
# decomp, decomp_dbg
# decomp
#
add_library(decomp
add_library(sleigh_decomp
${sleigh_core_source_list}
${sleigh_deccore_source_list}
${sleigh_extra_source_list}
${sleigh_source_list}
)
add_library(sleigh::decomp ALIAS decomp)
target_link_libraries(decomp PUBLIC
sleigh::sleigh_settings
)
add_library(sleigh::decomp ALIAS sleigh_decomp)
target_compile_features(sleigh_decomp PUBLIC cxx_std_11)
# Private include search path '#include "..."
target_include_directories(decomp PRIVATE $<BUILD_INTERFACE:${library_root}>)
target_include_directories(sleigh_decomp PRIVATE "$<BUILD_INTERFACE:${library_root}>")
# Public include search path in build directory
target_include_directories(
decomp SYSTEM
INTERFACE $<BUILD_INTERFACE:${public_headers_dir}>
sleigh_decomp SYSTEM
INTERFACE "$<BUILD_INTERFACE:${public_headers_dir}>"
)
sleigh_add_optional_defines(sleigh_decomp PUBLIC)
set_target_properties(sleigh_decomp PROPERTIES
EXPORT_NAME decomp
OUTPUT_NAME decomp
OUTPUT_NAME_DEBUG decomp_dbg
)
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
set_target_properties(decomp PROPERTIES
OUTPUT_NAME "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")
#
# Install rules
#
if(NOT CMAKE_SKIP_INSTALL_RULES)
include(cmake/install-rules.cmake)
endif()
#
# Documentation
# Build tool projects
#
if(sleigh_ENABLE_DOCUMENTATION)
message(STATUS "sleigh: Documentation has been enabled")
find_package(Doxygen REQUIRED COMPONENTS dot)
set(documentation_output "${CMAKE_CURRENT_BINARY_DIR}/doc")
# Always run this target because we have no source file tracking for incremental builds
add_custom_target(sleigh_documentation
COMMAND "${CMAKE_COMMAND}" -E remove_directory "${library_root}/../doc" "${documentation_output}"
COMMAND Doxygen::doxygen Doxyfile
COMMAND "${CMAKE_COMMAND}" -E copy_directory "${library_root}/../doc" "${documentation_output}"
COMMENT "sleigh: Generating the Doxygen documentation"
WORKING_DIRECTORY "${library_root}"
VERBATIM
)
if(sleigh_BUILD_TOOLS)
add_subdirectory(tools)
endif()
#
# Spec files
#
# Sets 'spec_file_list' variable
if(sleigh_RELEASE_IS_HEAD)
include(spec-files-list/spec_files_HEAD.cmake)
else()
include(spec-files-list/spec_files_stable.cmake)
if(sleigh_BUILD_SLEIGHSPECS)
add_subdirectory(sleighspecs)
endif()
# This prefix should match the Ghidra repo to where the sla spec files are located
set(spec_files_dir_prefix Ghidra/Processors)
# This is the root directory where all individual processor spec file directories will be created
set(spec_files_build_dir "${CMAKE_CURRENT_BINARY_DIR}/specfiles")
# This is where we will be copying the generated artifacts for each processor
set(spec_files_root_dir "${spec_files_build_dir}/${spec_files_dir_prefix}")
set(spec_files_build_log_dir ${CMAKE_CURRENT_BINARY_DIR}/spec_build_logs)
add_custom_command(
OUTPUT ${spec_files_build_log_dir}
COMMAND ${CMAKE_COMMAND} -E make_directory ${spec_files_build_log_dir}
)
# Start processing all `.slaspec` files individually
set(spec_targets)
set(spec_files)
set(spec_dirs)
include(cmake/modules/sleighCompile.cmake)
# Example: '<ghidra_source_prefix>/Ghidra/Processors/8051/data/languages/mx51.slaspec'
foreach(spec_file ${spec_file_list})
# Get 'mx51'
get_filename_component(spec_name "${spec_file}" NAME_WLE)
# Get '<ghidra_source_prefix>/Ghidra/Processors/8051/data/languages'
get_filename_component(spec_dir "${spec_file}" DIRECTORY)
# Get '8051/data/languages'
file(RELATIVE_PATH spec_proc_dir
"${ghidrasource_SOURCE_DIR}/${spec_files_dir_prefix}"
"${spec_dir}"
)
# Add relative spec processor directory for later processing
list(APPEND spec_dirs ${spec_proc_dir})
# Get '8051'
get_filename_component(proc_name "${spec_proc_dir}" DIRECTORY)
get_filename_component(proc_name "${proc_name}" DIRECTORY)
set(spec_build_log "${spec_files_build_log_dir}/${spec_name}_build.log")
# Combine back again for the build directory output like
# '<build_prefix>/Ghidra/Processors/8051/data/languages'
set(spec_out_dir "${spec_files_root_dir}/${spec_proc_dir}")
# '<build_prefix>/Ghidra/Processors/8051/data/languages/mx51.sla'
set(spec_out "${spec_out_dir}/${spec_name}.sla")
string(REPLACE "." "_" spec_target_name ${spec_name})
set(spec_target "sleigh_spec_${spec_target_name}")
# Compile the sla file
sleigh_compile(
TARGET "${spec_target}"
COMPILER "$<TARGET_FILE:sleigh::sleigh_opt>"
SLASPEC "${spec_file}"
LOG_FILE "${spec_build_log}"
OUT_FILE "${spec_out}"
)
add_dependencies(${spec_target} sleigh_copy_${proc_name}_dir)
list(APPEND spec_targets ${spec_target})
list(APPEND spec_files ${spec_out})
endforeach()
# Copy and create specfile directories
list(REMOVE_DUPLICATES spec_dirs)
foreach(spec_dir ${spec_dirs})
set(spec_src_dir "${ghidrasource_SOURCE_DIR}/${spec_files_dir_prefix}/${spec_dir}")
set(spec_out_dir "${spec_files_root_dir}/${spec_dir}")
# Get the processor directory name
get_filename_component(proc_name "${spec_dir}" DIRECTORY)
get_filename_component(proc_name "${proc_name}" DIRECTORY)
# Copy all other files from the slaspec source directory:
# '<ghidra_source_prefix>/Ghidra/Processors/8051/data/languages'
# NOTE: This only copies the directory once, so you will need to remove the
# whole directory if you update any of the other files, like '*.cspec' or
# '*.ldef' files
# CMake only guarantees update monitoring for files listed explicitly
add_custom_command(
OUTPUT "${spec_out_dir}"
COMMAND ${CMAKE_COMMAND} -E copy_directory "${spec_src_dir}" "${spec_out_dir}"
)
add_custom_target(sleigh_copy_${proc_name}_dir
DEPENDS "${spec_out_dir}"
)
endforeach()
# All of the sla spec targets are combined into this one
add_custom_target(sleigh_all_sla_specs ALL DEPENDS
${spec_targets}
)
#
# Examples
# Included Example
#
if(sleigh_ENABLE_EXAMPLES)
add_executable(sleighexample
"${library_root}/sleighexample.cc"
)
target_link_libraries(sleighexample PRIVATE
sleigh::sla
sleigh::decomp
)
add_custom_target(sleighexample_runner
"${CMAKE_COMMAND}" -E make_directory "${CMAKE_CURRENT_BINARY_DIR}/specfiles"
COMMAND "${CMAKE_COMMAND}" -E create_symlink "${spec_files_root_dir}/x86/data/languages/x86.sla" "${CMAKE_CURRENT_BINARY_DIR}/specfiles/x86.sla"
COMMAND sleighexample disassemble
WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}"
)
add_dependencies(
sleighexample_runner
sleigh_spec_x86
)
endif()
# Add support library before configuring install targets
add_subdirectory(support)
#
# Install targets
#
if(NOT CMAKE_SKIP_INSTALL_RULES)
include("GNUInstallDirs")
install(
TARGETS
sleigh_settings
sla
decomp
support
decomp_opt
ghidra_opt
sleigh_opt
EXPORT
sleighTargets
INCLUDES DESTINATION
${CMAKE_INSTALL_INCLUDEDIR}
)
install(
DIRECTORY
"${CMAKE_CURRENT_BINARY_DIR}/include/"
DESTINATION
${CMAKE_INSTALL_INCLUDEDIR}
)
# Install the compiled sla files found in 'Ghidra' top-level directory
install(
DIRECTORY
"${spec_files_build_dir}"
DESTINATION
"${CMAKE_INSTALL_DATADIR}/sleigh"
)
set(CMAKE_INSTALL_DOCDIR "${CMAKE_INSTALL_DATAROOTDIR}/doc/sleigh")
if(sleigh_ENABLE_DOCUMENTATION)
# Build docs during install
install(CODE
"execute_process(
COMMAND \"${CMAKE_COMMAND}\" --build \"${CMAKE_BINARY_DIR}\" --target sleigh_documentation
COMMAND_ECHO STDOUT
)"
)
install(
DIRECTORY
"${documentation_output}/html/"
DESTINATION
"${CMAKE_INSTALL_DOCDIR}"
)
endif(sleigh_ENABLE_DOCUMENTATION)
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
set(output_folder_path "${CMAKE_CURRENT_BINARY_DIR}/symlinks")
add_custom_command(
OUTPUT "${output_folder_path}"
COMMAND "${CMAKE_COMMAND}" -E make_directory "${CMAKE_CURRENT_BINARY_DIR}/symlinks"
COMMENT "sleigh: Generating symlink folder"
VERBATIM
)
add_custom_target(sleigh_symlinks_folder_builder DEPENDS
"${output_folder_path}"
)
add_custom_target(sleigh_symlinks_builder ALL)
foreach(target_name "decomp"
"ghidra"
"sleigh")
set(source_name "${target_name}_dbg")
set(destination_name "${target_name}_opt")
set(output_path "${output_folder_path}/${destination_name}")
add_custom_command(
OUTPUT "${output_path}"
COMMAND "${CMAKE_COMMAND}" -E create_symlink "${source_name}" "${destination_name}"
WORKING_DIRECTORY "${output_folder_path}"
COMMENT "sleigh: Generating executable symlink: ${source_name} -> ${destination_name}"
VERBATIM
)
set(target_name "sleigh_${source_name}_symlink_builder")
add_custom_target("${target_name}" DEPENDS
"${output_path}"
)
add_dependencies("${target_name}"
sleigh_symlinks_folder_builder
)
add_dependencies(sleigh_symlinks_builder
"${target_name}"
)
install(
FILES
"${output_path}"
DESTINATION
"${CMAKE_INSTALL_BINDIR}"
PERMISSIONS
OWNER_READ OWNER_WRITE OWNER_EXECUTE
GROUP_READ GROUP_EXECUTE
WORLD_READ WORLD_EXECUTE
)
endforeach()
if(PROJECT_IS_TOP_LEVEL)
include(CMakeDependentOption)
cmake_dependent_option(sleigh_BUILD_EXAMPLE "Build included sleigh example" "${sleigh_DEVELOPER_MODE}" "sleigh_BUILD_SLEIGHSPECS" OFF)
if(sleigh_BUILD_EXAMPLE)
add_subdirectory(example)
endif()
set(
sleigh_INSTALL_CMAKEDIR "${CMAKE_INSTALL_LIBDIR}/cmake/sleigh"
CACHE PATH "CMake package config location relative to the install prefix"
)
mark_as_advanced(sleigh_INSTALL_CMAKEDIR)
install(
EXPORT sleighTargets
DESTINATION "${sleigh_INSTALL_CMAKEDIR}"
NAMESPACE sleigh::
)
# Specfiles installation setup
set(
sleigh_INSTALL_DATADIR "${CMAKE_INSTALL_DATADIR}/sleigh"
CACHE PATH "sleigh data installation location relative to the install prefix"
)
mark_as_advanced(sleigh_INSTALL_DATADIR)
set(sleigh_INSTALL_SPECDIR "${sleigh_INSTALL_DATADIR}/specfiles"
CACHE PATH "sleigh specfile root destination relative to the install prefix"
)
mark_as_advanced(sleigh_INSTALL_SPECDIR)
include(CMakePackageConfigHelpers)
configure_package_config_file(cmake/install-config.cmake.in
${PROJECT_BINARY_DIR}/install-config.cmake
INSTALL_DESTINATION "${sleigh_INSTALL_CMAKEDIR}"
NO_CHECK_REQUIRED_COMPONENTS_MACRO
PATH_VARS sleigh_INSTALL_SPECDIR
)
install(
FILES ${PROJECT_BINARY_DIR}/install-config.cmake
RENAME sleighConfig.cmake
DESTINATION "${sleigh_INSTALL_CMAKEDIR}"
)
install(
FILES cmake/modules/sleighCompile.cmake
DESTINATION "${sleigh_INSTALL_CMAKEDIR}/modules"
)
endif()
add_subdirectory(tools)
#
# Support library provided by Trail of Bits
#
if(sleigh_BUILD_SUPPORT)
# Add support library before configuring install targets
add_subdirectory(support)
endif()
#
# Extras provided by Trail of Bits
#
if(sleigh_BUILD_EXTRATOOLS)
add_subdirectory(extra-tools)
endif()
#
# Developer mode
#
if(NOT sleigh_DEVELOPER_MODE)
return()
elseif(NOT PROJECT_IS_TOP_LEVEL)
message(AUTHOR_WARNING "Developer mode is intended for developers of sleigh")
endif()
include(cmake/dev-mode.cmake)
+146
View File
@@ -0,0 +1,146 @@
{
"version": 2,
"cmakeMinimumRequired": {
"major": 3,
"minor": 18,
"patch": 0
},
"configurePresets": [
{
"name": "cmake-pedantic",
"hidden": true,
"warnings": {
"dev": true,
"deprecated": true,
"uninitialized": true,
"unusedCli": true,
"systemVars": false
},
"errors": {
"dev": true,
"deprecated": true
}
},
{
"name": "dev-mode",
"hidden": true,
"inherits": "cmake-pedantic",
"cacheVariables": {
"sleigh_DEVELOPER_MODE": "ON",
"sleigh_BUILD_DOCUMENTATION": "ON"
}
},
{
"name": "ci-std",
"description": "This preset makes sure the project actually builds with at least the specified standard",
"hidden": true,
"cacheVariables": {
"CMAKE_CXX_EXTENSIONS": "OFF",
"CMAKE_CXX_STANDARD": "11",
"CMAKE_CXX_STANDARD_REQUIRED": "ON",
"CMAKE_POSITION_INDEPENDENT_CODE": "ON"
}
},
{
"name": "ci-std-tools",
"description": "This preset makes sure the project actually builds with at least the specified standard for extra sleigh tools",
"hidden": true,
"inherits": "ci-std",
"cacheVariables": {
"CMAKE_CXX_STANDARD": "17"
}
},
{
"name": "flags-unix",
"hidden": true,
"cacheVariables": {
"CMAKE_CXX_FLAGS": "-Wall -Wextra -Wpedantic -Wconversion -Wsign-conversion -Wcast-qual -Wshadow -Wformat=2 -Wundef"
}
},
{
"name": "flags-windows",
"description": "Note that all the flags after /W4 are required for MSVC to conform to the language standard",
"hidden": true,
"cacheVariables": {
"CMAKE_CXX_FLAGS": "/utf-8 /W4 /permissive- /volatile:iso /Zc:preprocessor /EHsc /Zc:__cplusplus /Zc:externConstexpr /Zc:throwingNew"
}
},
{
"name": "ci-unix",
"generator": "Unix Makefiles",
"hidden": true,
"inherits": ["flags-unix", "ci-std"],
"cacheVariables": {
"CMAKE_BUILD_TYPE": "RelWithDebInfo"
}
},
{
"name": "ci-win64",
"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
},
{
"name": "coverage-unix",
"binaryDir": "${sourceDir}/build/coverage",
"inherits": "ci-unix",
"hidden": true,
"cacheVariables": {
"ENABLE_COVERAGE": "ON",
"CMAKE_BUILD_TYPE": "Coverage",
"CMAKE_CXX_FLAGS_COVERAGE": "-Og -g --coverage -fkeep-static-functions",
"CMAKE_EXE_LINKER_FLAGS_COVERAGE": "--coverage",
"CMAKE_SHARED_LINKER_FLAGS_COVERAGE": "--coverage"
}
},
{
"name": "ci-coverage",
"inherits": ["coverage-unix", "dev-mode"],
"cacheVariables": {
"COVERAGE_HTML_COMMAND": ""
}
},
{
"name": "ci-sanitize",
"binaryDir": "${sourceDir}/build/sanitize",
"inherits": ["ci-unix", "dev-mode"],
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Sanitize",
"CMAKE_CXX_FLAGS_SANITIZE": "-O2 -g -fsanitize=address,undefined -fno-omit-frame-pointer -fno-common"
}
},
{
"name": "ci-assertions",
"binaryDir": "${sourceDir}/build/assertions",
"inherits": ["ci-unix", "dev-mode"],
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Assertions",
"CMAKE_CXX_FLAGS_ASSERTIONS": "-O0 -g -stdlib=libc++ -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_DEBUG -fstack-protector-strong",
"CMAKE_EXE_LINKER_FLAGS_ASSERTIONS": "-stdlib=libc++ -lc++abi",
"CMAKE_SHARED_LINKER_FLAGS_ASSERTIONS": "-stdlib=libc++ -lc++abi"
}
},
{
"name": "ci-build",
"binaryDir": "${sourceDir}/build",
"hidden": true
},
{
"name": "ci-macos",
"inherits": ["ci-build", "ci-unix", "dev-mode"]
},
{
"name": "ci-ubuntu",
"inherits": ["ci-build", "ci-unix", "dev-mode"]
},
{
"name": "ci-windows",
"inherits": ["ci-build", "ci-win64", "dev-mode"]
}
]
}
+1
View File
@@ -0,0 +1 @@
* @ekilmer @tetsuo-cpp
+27 -28
View File
@@ -1,8 +1,8 @@
# SLEIGH Library
# Sleigh Library
[SLEIGH](https://ghidra.re/courses/languages/html/sleigh.html) is a language used to describe the semantics of instruction sets of general-purpose microprocessors, with enough detail to facilitate the reverse engineering of software compiled for these architectures. It is part of the [GHIDRA reverse engineering platform](https://github.com/NationalSecurityAgency/ghidra), and underpins two of its major components: its disassembly and decompilation engines.
[Sleigh](https://ghidra.re/ghidra_docs/languages/html/sleigh.html) is a language used to describe the semantics of instruction sets of general-purpose microprocessors, with enough detail to facilitate the reverse engineering of software compiled for these architectures. It is part of the [Ghidra reverse engineering platform](https://github.com/NationalSecurityAgency/ghidra) and underpins two of its major components: its disassembly and decompilation engines.
This repository provides a CMake-based build project for SLEIGH so that it can be built and packaged as a standalone library, and be reused in projects other than GHIDRA.
This repository provides a CMake-based build project for Sleigh so that it can be built and packaged as a standalone library and be reused in projects other than Ghidra.
## Supported Platforms
@@ -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 |
@@ -32,49 +33,43 @@ For building documentation:
| [Doxygen](https://www.doxygen.nl/) | Latest | doxygen | doxygen |
| [GraphViz](https://graphviz.org/) | Latest | graphviz | graphviz |
## Build and Install the SLEIGH Library
## Build and Install the Sleigh Library
```sh
# Clone this repository (CMake project for SLEIGH)
# Clone this repository (CMake project for sleigh)
git clone https://github.com/lifting-bits/sleigh.git
cd sleigh
# Configure CMake
cmake -B build -S .
# Build SLEIGH
cmake --build build -j
# Build Sleigh
cmake --build build --parallel 8
# Install SLEIGH
cmake --install build --prefix <path where SLEIGH will install>
# Install Sleigh
cmake --install build --prefix ./install
```
### Note on Ghidra source code
The Ghidra source code is not actually included in this git repo, and by default, CMake will automatically pull a stable version from the internet for you.
Please see [`src/README.md`](./src/README.md) for more information on how to customize which Ghidra source code commit will be used/compiled, including specifying your own local copy of the Ghidra source.
Please see [`src/README.md`](src/README.md) for more information on how to customize which Ghidra source code commit will be used/compiled, including specifying your own local copy of the Ghidra source.
## Packaging
The CMake configuration also supports building packages for SLEIGH. If the `sleigh_ENABLE_PACKAGING` option is set during the configuration step, the build step will generate a tarball containing the SLEIGH installation. Additionally, the build will create an RPM package if it finds `rpm` in the `PATH` and/or a DEB package if it finds `dpkg` in the `PATH`.
The CMake configuration also supports building packages for Sleigh.
For example:
```sh
cmake -B build -S . \
-Dsleigh_ENABLE_PACKAGING=ON
# Build SLEIGH
cmake --build build -j
# Package SLEIGH
# Package Sleigh
cmake --build build --target package
```
## API Usage
An example program called `sleigh-lift` has been included to demonstrate how to use the SLEIGH API. It takes a hexadecimal string of bytes and either disassembles it or lifts it to p-code. The program can be invoked like so, where the `action` argument must be either `disassemble` or `pcode`:
An example program called `sleigh-lift` has been included to demonstrate how to use the Sleigh API. It takes a hexadecimal string of bytes and can disassemble it or lift it to p-code. The program can be invoked as follows, where the `action` argument must be either `disassemble` or `pcode`:
```sh
sleigh-lift [action] [sla_file] [bytes] [-a address] [-p root_sla_dir] [-s pspec_file]
@@ -102,11 +97,11 @@ $ sleigh-lift pcode x86-64.sla 4881ecc00f0000
(register,0x202,1) = INT_EQUAL (unique,0x12d00,1) (const,0x0,1)
```
The `sleigh_ENABLE_EXAMPLES` option must be set to `ON` during the configuration step in order to build `sleigh-lift`.
If you do not want to build `sleigh-lift`, you must set the CMake variable `sleigh_BUILD_EXTRATOOLS` option to `OFF` during CMake configuration.
## Helpers
This repository contains a helper that is not part of SLEIGH/GHIDRA, which can be found under `support/`. It has the following signature and can help the user find the location of a given spec file on the system:
This repository contains a helper not part of Sleigh/Ghidra, which you can find in the `support` directory. It has the following signature and can help the user find the location of a given spec file on the system:
```c++
std::optional<std::filesystem::path>
@@ -115,20 +110,24 @@ FindSpecFile(std::string_view file_name,
gDefaultSearchPaths);
```
The `sleigh::FindSpecFile` function will search the the paths provided by the user via the `search_paths` argument for a spec file with the name `file_name`. The default argument for `search_paths` is `sleigh::gDefaultSearchPaths` which contains the install/build directories that the CMake project was configured with as well as a set of common installation locations.
The `sleigh::FindSpecFile` function will search the paths provided by the user via the `search_paths` argument for a spec file with the name `file_name`. The default argument for `search_paths` is `sleigh::gDefaultSearchPaths` which contains the install/build directories generated during CMake configuration and a set of common installation locations.
If you do not want to build the helpers, you must set the CMake variable `sleigh_BUILD_SUPPORT` option to `OFF` during CMake configuration.
## Integration as a Dependency
An installation of sleigh provides a CMake interface that can be used to assist in building your project.
An installation of Sleigh provides a CMake interface that you can use when building your project.
An example of how to use the CMake package config file can be found in the [find_package](tests/find_package/CMakeLists.txt) example.
You can find an example of how to use the CMake package config file in the [find_package](tests/find_package/CMakeLists.txt) example.
We also provide a CMake helper function [`sleigh_compile`](cmake/modules/sleighCompile.cmake) to compile your own `.slaspec` files using the installed sleigh compiler from this project.
We also provide a CMake helper function [`sleigh_compile`](cmake/modules/sleighCompile.cmake) to compile your `.slaspec` files using a sleigh compiler.
Lastly, the installed compiled sleigh files can be located through the CMake variable `sleigh_INSTALL_SPECDIR`, which is an absolute path to the root directory for where the compiled sleigh files are located---you should manually inspect this to know what to expect.
You can find a more complex CMake example with compiling Sleigh specifications in the [`example`](example/CMakeLists.txt) directory, which uses the upstream-provided sleigh example source code.
Referencing the [CMake config file](cmake/install-config.cmake.in) is also suggested for learning more about the exposed CMake variables and modules.
Lastly, you can locate the installed compiled sleigh files through the CMake variable `sleigh_INSTALL_SPECDIR`, which is an absolute path to the root directory for the compiled sleigh files---you should manually inspect this to know what to expect.
Referencing the [CMake config file](cmake/install-config.cmake.in) and [`specfiles` CMake file](sleighspecs/specfiles.cmake.in) is also suggested for learning more about the exposed CMake variables and modules.
## License
See the LICENSE file in the top directory of this repo.
See the [LICENSE file](LICENSE).
+34
View File
@@ -0,0 +1,34 @@
# This module configures ccache to work with MSVC
# Based on: https://github.com/ccache/ccache/wiki/MS-Visual-Studio
# Only do this for Windows MSVC builds
if(NOT WIN32 OR NOT CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
return()
endif()
# Assume the parent environment has this set
# Chocolatey creates a shim which doesn't work when renamed
set(CCACHE_EXE "$ENV{CCACHE_EXE}")
if(NOT CCACHE_EXE)
message(STATUS "ccache not found - MSVC ccache support disabled")
return()
endif()
message(STATUS "Found ccache - ${CCACHE_EXE}")
message(STATUS "Configuring ccache for MSVC")
file(COPY_FILE
"${CCACHE_EXE}" "${CMAKE_BINARY_DIR}/cl.exe"
ONLY_IF_DIFFERENT)
# By default Visual Studio generators will use /Zi which is not compatible
# with ccache, so tell Visual Studio to use /Z7 instead.
message(STATUS "Setting MSVC debug information format to 'Embedded'")
set(CMAKE_MSVC_DEBUG_INFORMATION_FORMAT "$<$<CONFIG:Debug,RelWithDebInfo>:Embedded>")
set(CMAKE_VS_GLOBALS
"CLToolExe=cl.exe"
"CLToolPath=${CMAKE_BINARY_DIR}"
"UseMultiToolTask=true"
"DebugInformationFormat=OldStyle"
)
+33
View File
@@ -0,0 +1,33 @@
# ---- Variables ----
# We use variables separate from what CTest uses, because those have
# customization issues
set(
COVERAGE_TRACE_COMMAND
lcov -c -q
-o "${PROJECT_BINARY_DIR}/coverage.info"
-d "${PROJECT_BINARY_DIR}"
--include "${library_root}/*"
CACHE STRING
"; separated command to generate a trace for the 'coverage' target"
)
set(
COVERAGE_HTML_COMMAND
genhtml --legend -f -q
"${PROJECT_BINARY_DIR}/coverage.info"
-p "${library_root}"
-o "${PROJECT_BINARY_DIR}/coverage_html"
CACHE STRING
"; separated command to generate an HTML report for the 'coverage' target"
)
# ---- Coverage target ----
add_custom_target(
coverage
COMMAND ${COVERAGE_TRACE_COMMAND}
COMMAND ${COVERAGE_HTML_COMMAND}
COMMENT "Generating coverage report"
VERBATIM
)
+13
View File
@@ -0,0 +1,13 @@
include(CTest)
if(BUILD_TESTING)
add_subdirectory(tests)
endif()
if(sleigh_BUILD_DOCUMENTATION)
include(cmake/docs.cmake)
endif()
option(ENABLE_COVERAGE "Enable coverage support separate from CTest's" OFF)
if(ENABLE_COVERAGE)
include(cmake/coverage.cmake)
endif()
+11
View File
@@ -0,0 +1,11 @@
find_package(Doxygen REQUIRED COMPONENTS dot)
# Always run this target because we have no source file tracking for incremental builds
add_custom_target(docs
COMMAND "${CMAKE_COMMAND}" -E remove_directory "${DOXYGEN_OUTPUT_DIRECTORY}/html"
COMMAND Doxygen::doxygen Doxyfile
COMMAND "${CMAKE_COMMAND}" -E copy_directory "${library_root}/../doc" "${DOXYGEN_OUTPUT_DIRECTORY}"
COMMENT "sleigh: Generating the Doxygen documentation"
WORKING_DIRECTORY "${library_root}"
VERBATIM
)
+48 -5
View File
@@ -1,12 +1,55 @@
#
# Copyright (c) 2022-present, Trail of Bits, Inc.
# All rights reserved.
#
# This source code is licensed in accordance with the terms specified in
# the LICENSE file found in the root directory of this source tree.
#
# This file provides access to the installed sleigh targets.
#
# There are optional components that could also be installed:
# * Specs - Compiled sleigh specification files
# * Support - Support library for easier use of sleigh
# * ExtraTools - Extra tools created by Trail of Bits
@PACKAGE_INIT@
include("${CMAKE_CURRENT_LIST_DIR}/sleighTargets.cmake")
# Path relative-root to reach installed specfiles directory
set_and_check(sleigh_INSTALL_SPECDIR "@PACKAGE_sleigh_INSTALL_SPECDIR@")
# 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")
# Find-package component handling for Support library and ExtraTools
set(_sleigh_supported_components Specs Support ExtraTools)
# Specs just sets a variable to the directory of installation
set(_sleigh_Specs_targets "${CMAKE_CURRENT_LIST_DIR}/specfiles.cmake")
set(_sleigh_Support_targets "${CMAKE_CURRENT_LIST_DIR}/sleighSupportTargets.cmake")
set(_sleigh_ExtraTools_targets "${CMAKE_CURRENT_LIST_DIR}/sleighExtraToolsTargets.cmake")
macro(sleigh_load_component comp)
if(NOT EXISTS "${_sleigh_${comp}_targets}" AND ${sleigh_FIND_REQUIRED_${comp}})
set(sleigh_NOT_FOUND_MESSAGE
"sleigh `${comp}` component targets were requested but not found.")
set(sleigh_FOUND FALSE)
return()
endif()
if(EXISTS "${_sleigh_${comp}_targets}")
include("${_sleigh_${comp}_targets}")
endif()
endmacro()
foreach(_comp ${sleigh_FIND_COMPONENTS})
if (NOT _comp IN_LIST _sleigh_supported_components)
set(sleigh_FOUND FALSE)
set(sleigh_NOT_FOUND_MESSAGE "Unsupported component: ${_comp}")
endif()
sleigh_load_component("${_comp}")
endforeach()
+93
View File
@@ -0,0 +1,93 @@
#
# Copyright (c) 2022-present, Trail of Bits, Inc.
# All rights reserved.
#
# This source code is licensed in accordance with the terms specified in
# the LICENSE file found in the root directory of this source tree.
#
if(PROJECT_IS_TOP_LEVEL)
set(CMAKE_INSTALL_INCLUDEDIR include/sleigh CACHE PATH "")
endif()
include(GNUInstallDirs)
install(
TARGETS
sleigh_sla
sleigh_decomp
EXPORT
sleighTargets
RUNTIME #
COMPONENT sleigh_Runtime
LIBRARY #
COMPONENT sleigh_Runtime
NAMELINK_COMPONENT sleigh_Development
ARCHIVE #
COMPONENT sleigh_Development
INCLUDES DESTINATION
"${CMAKE_INSTALL_INCLUDEDIR}"
)
install(
DIRECTORY "${public_headers_dir}/"
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}"
COMPONENT sleigh_Development
)
if(sleigh_BUILD_DOCUMENTATION)
install(
DIRECTORY "${DOXYGEN_OUTPUT_DIRECTORY}/html/"
DESTINATION "${CMAKE_INSTALL_DOCDIR}"
COMPONENT sleigh_Documentation
)
endif()
set(
sleigh_INSTALL_CMAKEDIR "${CMAKE_INSTALL_LIBDIR}/cmake/sleigh"
CACHE PATH "CMake package config location relative to the install prefix"
)
mark_as_advanced(sleigh_INSTALL_CMAKEDIR)
install(
EXPORT sleighTargets
DESTINATION "${sleigh_INSTALL_CMAKEDIR}"
NAMESPACE sleigh::
COMPONENT sleigh_Development
)
include(CMakePackageConfigHelpers)
write_basic_package_version_file(
"sleighConfigVersion.cmake"
COMPATIBILITY SameMinorVersion
)
install(
FILES "${PROJECT_BINARY_DIR}/sleighConfigVersion.cmake"
DESTINATION "${sleigh_INSTALL_CMAKEDIR}"
COMPONENT sleigh_Development
)
configure_package_config_file(cmake/install-config.cmake.in
"${PROJECT_BINARY_DIR}/install-config.cmake"
INSTALL_DESTINATION "${sleigh_INSTALL_CMAKEDIR}"
NO_CHECK_REQUIRED_COMPONENTS_MACRO
)
install(
FILES "${PROJECT_BINARY_DIR}/install-config.cmake"
RENAME sleighConfig.cmake
DESTINATION "${sleigh_INSTALL_CMAKEDIR}"
COMPONENT sleigh_Development
)
install(
FILES cmake/modules/sleighCompile.cmake
DESTINATION "${sleigh_INSTALL_CMAKEDIR}/modules"
COMPONENT sleigh_Development
)
if(PROJECT_IS_TOP_LEVEL)
include(cmake/packaging.cmake)
endif()
+8
View File
@@ -1,3 +1,11 @@
/*
Copyright (c) 2022-present, Trail of Bits, Inc.
All rights reserved.
This source code is licensed in accordance with the terms specified in
the LICENSE file found in the root directory of this source tree.
*/
#ifndef SLEIGH_LIBCONFIG_H
#define SLEIGH_LIBCONFIG_H
+26 -20
View File
@@ -6,29 +6,35 @@
# the LICENSE file found in the root directory of this source tree.
#
option(sleigh_ENABLE_TESTS "Set to true to enable tests" ON)
option(sleigh_ENABLE_EXAMPLES "Set to true to build examples" ON)
option(sleigh_ENABLE_DOCUMENTATION "Set to true to enable the documentation")
option(sleigh_ENABLE_PACKAGING "Set to true to enable packaging")
option(sleigh_ENABLE_SANITIZERS "Set to true to enable sanitizers")
set(sleigh_ADDITIONAL_PATCHES "" CACHE STRING
"The accepted patch format is git patch files, to be applied via git am. The format of the list is a CMake semicolon separated list.")
# ---- Developer mode ----
# Internal debug settings
option(sleigh_OPACTION_DEBUG "Turns on all the action tracing facilities")
option(sleigh_MERGEMULTI_DEBUG "Check for MULTIEQUAL and INDIRECT intersections")
option(sleigh_BLOCKCONSISTENT_DEBUG "Check that block graph structure is consistent")
option(sleigh_DFSVERIFY_DEBUG "Make sure that the block ordering algorithm produces a true depth first traversal of the dominator tree")
# Additional internal settings
option(sleigh_CPUI_STATISTICS "Turn on collection of cover and cast statistics")
option(sleigh_CPUI_RULECOMPILE "Allow user defined dynamic rules")
# Sanity checking
if(CMAKE_HOST_SYSTEM_NAME STREQUAL "Windows")
set(sleigh_ENABLE_DOCUMENTATION OFF CACHE BOOL "Unsupported on Windows" FORCE)
# Developer mode enables targets and code paths in the CMake scripts that are
# only relevant for the developer(s) of sleigh
# Targets necessary to build the project must be provided unconditionally, so
# consumers can trivially build and package the project
if(PROJECT_IS_TOP_LEVEL)
option(sleigh_DEVELOPER_MODE "Enable developer mode")
option(BUILD_SHARED_LIBS "Build shared libs. (Untested and not supported)")
endif()
if(sleigh_DEVELOPER_MODE)
option(sleigh_BUILD_DOCUMENTATION "Build documentation using Doxygen")
set(
DOXYGEN_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/docs"
CACHE PATH "Path for the generated Doxygen documentation"
)
endif()
include(CMakeDependentOption)
# Optional project target building
option(sleigh_BUILD_TOOLS "Build and install executable tools" "${PROJECT_IS_TOP_LEVEL}")
option(sleigh_BUILD_SLEIGHSPECS "Build and install sleigh spec files" "${PROJECT_IS_TOP_LEVEL}")
# Add-ons by ToB
option(sleigh_BUILD_SUPPORT "Build ToB support libraries" "${PROJECT_IS_TOP_LEVEL}")
cmake_dependent_option(sleigh_BUILD_EXTRATOOLS "Build extra ToB sleigh tools" "${PROJECT_IS_TOP_LEVEL}" "sleigh_BUILD_SUPPORT" OFF)
# ---- Warning guard ----
# target_include_directories with the SYSTEM modifier will request the compiler
+26 -29
View File
@@ -11,44 +11,41 @@ if("${sleigh_RELEASE_TYPE}" STREQUAL "HEAD")
set(PACKAGE_VERSION "DEV.${ghidra_short_commit}")
endif()
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "SLEIGH was designed for the GHIDRA reverse engineering platform built by the National Security Agency and is used to describe microprocessors with enough detail to facilitate two major components of GHIDRA, the disassembly and decompilation engines. This is an unofficial release by Trail of Bits.")
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Sleigh was designed for the Ghidra reverse engineering platform built by the National Security Agency and is used to describe microprocessors with enough detail to facilitate two major components of Ghidra, the disassembly and decompilation engines. This is an unofficial release by Trail of Bits.")
set(CPACK_PACKAGE_NAME "sleigh")
set(CPACK_PACKAGE_VENDOR "Trail of Bits")
set(CPACK_PACKAGE_CONTACT "info@trailofbits.com")
set(CPACK_PACKAGE_HOMEPAGE_URL "https://github.com/lifting-bits/sleigh")
set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${PROJECT_VERSION}-${PACKAGE_VERSION}.x86_64")
set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${PROJECT_VERSION}-${PACKAGE_VERSION}.${CMAKE_SYSTEM_PROCESSOR}")
set(CPACK_PACKAGE_RELOCATABLE ON)
set(CPACK_DEBIAN_PACKAGE_RELEASE "${PACKAGE_VERSION}")
set(CPACK_DEBIAN_PACKAGE_PRIORITY "extra")
set(CPACK_DEBIAN_PACKAGE_SECTION "default")
set(CPACK_DEBIAN_PACKAGE_HOMEPAGE "${CPACK_PACKAGE_HOMEPAGE_URL}")
set(CPACK_DEBIAN_PACKAGE_DEPENDS "libc-dev-bin (>=2.31)")
set(CPACK_RPM_PACKAGE_RELEASE_DIST "${PACKAGE_VERSION}")
set(CPACK_RPM_PACKAGE_DESCRIPTION "${CPACK_PACKAGE_DESCRIPTION_SUMMARY}")
set(CPACK_RPM_PACKAGE_GROUP "default")
set(CPACK_RPM_PACKAGE_REQUIRES "glibc >= 2.31")
set(CPACK_GENERATOR "TGZ")
unset(rpm_executable_path CACHE)
find_program(rpm_executable_path "rpm")
if("${rpm_executable_path}" STREQUAL "rpm_executable_path-NOTFOUND")
message(WARNING "sleigh: the RPM package generator requires the 'rpm' tool")
if(CMAKE_HOST_SYSTEM_NAME STREQUAL "Linux")
unset(rpm_executable_path CACHE)
find_program(rpm_executable_path "rpm")
if("${rpm_executable_path}" STREQUAL "rpm_executable_path-NOTFOUND")
message(WARNING "sleigh: the RPM package generator requires the 'rpm' tool")
else()
list(APPEND CPACK_GENERATOR "RPM")
message(STATUS "sleigh: the RPM generator has been enabled")
endif()
set(CPACK_RPM_PACKAGE_RELEASE_DIST "${PACKAGE_VERSION}")
set(CPACK_RPM_PACKAGE_DESCRIPTION "${CPACK_PACKAGE_DESCRIPTION_SUMMARY}")
set(CPACK_RPM_PACKAGE_GROUP "default")
else()
list(APPEND CPACK_GENERATOR "RPM")
message(STATUS "sleigh: the RPM generator has been enabled")
endif()
unset(dpkg_executable_path CACHE)
find_program(dpkg_executable_path "dpkg")
if("${dpkg_executable_path}" STREQUAL "dpkg_executable_path-NOTFOUND")
message(WARNING "sleigh: the DEB package generator requires the 'dpkg' tool")
else()
list(APPEND CPACK_GENERATOR "DEB")
message(STATUS "sleigh: the DEB generator has been enabled")
unset(dpkg_executable_path CACHE)
find_program(dpkg_executable_path "dpkg")
if("${dpkg_executable_path}" STREQUAL "dpkg_executable_path-NOTFOUND")
message(WARNING "sleigh: the DEB package generator requires the 'dpkg' tool")
else()
list(APPEND CPACK_GENERATOR "DEB")
message(STATUS "sleigh: the DEB generator has been enabled")
endif()
set(CPACK_DEBIAN_PACKAGE_RELEASE "${PACKAGE_VERSION}")
set(CPACK_DEBIAN_PACKAGE_PRIORITY "extra")
set(CPACK_DEBIAN_PACKAGE_SECTION "default")
set(CPACK_DEBIAN_PACKAGE_HOMEPAGE "${CPACK_PACKAGE_HOMEPAGE_URL}")
endif()
include(CPack)
+10
View File
@@ -0,0 +1,10 @@
# ---- In-source guard ----
if(CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR)
message(
FATAL_ERROR
"In-source builds are not supported. "
"Please read the documentation before trying to build this project. "
"You may need to delete 'CMakeCache.txt' and 'CMakeFiles/' first."
)
endif()
+6
View File
@@ -0,0 +1,6 @@
# This variable is set by project() in CMake 3.21+
string(
COMPARE EQUAL
"${CMAKE_SOURCE_DIR}" "${PROJECT_SOURCE_DIR}"
PROJECT_IS_TOP_LEVEL
)
+115
View File
@@ -0,0 +1,115 @@
#
# Copyright (c) 2022-present, Trail of Bits, Inc.
# All rights reserved.
#
# This source code is licensed in accordance with the terms specified in
# the LICENSE file found in the root directory of this source tree.
#
cmake_minimum_required(VERSION 3.18)
include(../cmake/prelude.cmake)
# We include this because the source code for this example is in upstream
include(../src/setup-ghidra-source.cmake)
project(sleigh_example
VERSION "${ghidra_version}"
DESCRIPTION "Sleigh example"
HOMEPAGE_URL "https://github.com/lifting-bits/sleigh"
LANGUAGES CXX
)
include(../cmake/project-is-top-level.cmake)
if(NOT TARGET sleigh::sla)
find_package(sleigh)
if(NOT sleigh_FOUND)
message(WARNING "Could not find sleigh library, building from source")
# Exclude from all because there are no install rules for the example
# See sleigh-lift for example with install rules
add_subdirectory(.. sleigh EXCLUDE_FROM_ALL)
endif()
endif()
add_executable(sleigh_example
"${library_root}/sleighexample.cc"
)
target_compile_features(sleigh_example PRIVATE cxx_std_11)
sleigh_add_optional_defines(sleigh_example PRIVATE)
target_link_libraries(sleigh_example PRIVATE
sleigh::sla
)
set_target_properties(sleigh_example PROPERTIES
OUTPUT_NAME sleighexample
)
#
# Compile our required sleigh spec file
#
# Get the native machine's sleigh compiler or use the one we're about to build
# if not cross compiling
if(CMAKE_CROSSCOMPILING)
find_program(
SLEIGH_EXECUTABLE sleigh
DOC "Path to host system sleigh compiler"
REQUIRED
)
set(sleigh_compiler "${SLEIGH_EXECUTABLE}")
else()
# Try to find/acquire or bootstrap the sleigh spec compiler
# Logic is repeated in sleighspecs/CMakeLists.txt
if(NOT TARGET sleigh::sleigh)
find_package(sleigh QUIET)
if(NOT sleigh_FOUND OR NOT TARGET sleigh::sleigh)
find_program(
SLEIGH_EXECUTABLE sleigh
DOC "Path to host system sleigh compiler"
)
if(NOT SLEIGH_EXECUTABLE)
message(WARNING "Could not find sleigh compiler, building from source")
set(saved_skip_install_rules "${CMAKE_SKIP_INSTALL_RULES}")
set(CMAKE_SKIP_INSTALL_RULES TRUE)
add_subdirectory(../tools/spec-compiler spec-compiler EXCLUDE_FROM_ALL)
set(CMAKE_SKIP_INSTALL_RULES "${saved_skip_install_rules}")
endif()
endif()
endif()
endif()
if(SLEIGH_EXECUTABLE)
set(sleigh_compiler "${SLEIGH_EXECUTABLE}")
else()
set(sleigh_compiler "$<TARGET_FILE:sleigh::sleigh>")
endif()
# Compile the sla file
include(../cmake/modules/sleighCompile.cmake)
sleigh_compile(
TARGET sleigh_example_sleigh_spec_x86
COMPILER "${sleigh_compiler}"
SLASPEC "${ghidrasource_SOURCE_DIR}/Ghidra/Processors/x86/data/languages/x86.slaspec"
LOG_FILE "${CMAKE_CURRENT_BINARY_DIR}/specfiles/x86.sla.log"
OUT_FILE "${CMAKE_CURRENT_BINARY_DIR}/specfiles/x86.sla"
)
set_property(
TARGET sleigh_example_sleigh_spec_x86
PROPERTY EXCLUDE_FROM_ALL FALSE
)
#
# Run the example
#
add_custom_target(sleigh_example_runner)
set(example_actions disassemble pcode emulate)
foreach(action ${example_actions})
add_custom_target(sleigh_example_${action}
COMMAND sleigh_example ${action}
COMMENT "Running example ${action}"
WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}"
)
add_dependencies(sleigh_example_${action} sleigh_example_sleigh_spec_x86)
add_dependencies(sleigh_example_runner sleigh_example_${action})
endforeach()
+9
View File
@@ -0,0 +1,9 @@
#
# Copyright (c) 2022-present, Trail of Bits, Inc.
# All rights reserved.
#
# This source code is licensed in accordance with the terms specified in
# the LICENSE file found in the root directory of this source tree.
#
add_subdirectory(sleigh-lift)
+63
View File
@@ -0,0 +1,63 @@
#
# Copyright (c) 2021-present, Trail of Bits, Inc.
# All rights reserved.
#
# This source code is licensed in accordance with the terms specified in
# the LICENSE file found in the root directory of this source tree.
#
cmake_minimum_required(VERSION 3.18)
project(sleighLift CXX)
set(build_from_source FALSE)
if(NOT TARGET sleigh::support)
find_package(sleigh)
if(NOT sleigh_FOUND)
message(WARNING "Could not find sleigh, building from source")
set(sleigh_BUILD_SUPPORT ON CACHE BOOL "" FORCE)
set(sleigh_BUILD_SLEIGHSPECS ON CACHE BOOL "" FORCE)
add_subdirectory(../.. sleigh)
else()
find_package(sleigh REQUIRED COMPONENTS Support Specs)
endif()
endif()
add_executable(sleigh_lift
src/main.cpp
)
add_executable(sleigh::lift ALIAS sleigh_lift)
target_link_libraries(sleigh_lift PRIVATE
sleigh::sla
sleigh::decomp
sleigh::support
)
target_compile_features(sleigh_lift PRIVATE cxx_std_17)
set_target_properties(sleigh_lift PROPERTIES
EXPORT_NAME lift
OUTPUT_NAME sleigh-lift
)
if(NOT CMAKE_SKIP_INSTALL_RULES)
include(GNUInstallDirs)
set(
sleigh_INSTALL_CMAKEDIR "${CMAKE_INSTALL_LIBDIR}/cmake/sleigh"
CACHE PATH "CMake package config location relative to the install prefix"
)
mark_as_advanced(sleigh_INSTALL_CMAKEDIR)
install(
TARGETS sleigh_lift
EXPORT sleighExtraToolsTargets
RUNTIME #
COMPONENT sleigh_ExtraToolsRuntime
)
install(
EXPORT sleighExtraToolsTargets
DESTINATION "${sleigh_INSTALL_CMAKEDIR}"
NAMESPACE sleigh::
COMPONENT sleigh_ExtraToolsDevelopment
)
endif()
@@ -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;
@@ -88,7 +89,7 @@ static std::string ParseHexBytes(std::string_view bytes, uint64_t addr,
<< "' specified in bytes arg." << std::endl;
exit(EXIT_FAILURE);
}
const uint64_t addr_mask = ~0ULL >> (64UL - addr_size);
const uint64_t addr_mask = ~0ULL >> (64UL - addr_size * 8);
auto byte_addr = addr + (i / 2);
auto masked_addr = byte_addr & addr_mask;
// Make sure that if a really big number is specified for `address`,
@@ -108,34 +109,45 @@ 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);
cur_addr = cur_addr + instr_len;
try {
int32_t instr_len = engine.printAssembly(asm_emit, cur_addr);
cur_addr = cur_addr + instr_len;
}
catch(ghidra::UnimplError &err) {
std::cerr << "UnimplError @ " << cur_addr << " (addr 0x" << addr << ", len 0x" << len << "): " << err.explain << "\n";
break;
}
catch (ghidra::BadDataError &err) {
std::cerr << "BadDataError @ " << cur_addr << " (addr 0x" << addr << ", len 0x" << len << "): " << err.explain << "\n";
break;
}
}
}
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,13 +162,23 @@ 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);
cur_addr = cur_addr + instr_len;
try {
int32_t instr_len = engine.oneInstruction(pcode_emit, cur_addr);
cur_addr = cur_addr + instr_len;
}
catch(ghidra::UnimplError &err) {
std::cerr << "UnimplError @ " << cur_addr << " (addr 0x" << addr << ", len 0x" << len << "): " << err.explain << "\n";
break;
}
catch(ghidra::BadDataError &err) {
std::cerr << "BadDataError @ " << cur_addr << " (addr 0x" << addr << ", len 0x" << len << "): " << err.explain << "\n";
break;
}
}
}
@@ -256,16 +278,16 @@ int main(int argc, char *argv[]) {
<< std::endl;
return EXIT_FAILURE;
}
// Put together SLEIGH components
#ifdef sleigh_RELEASE_IS_HEAD
AttributeId::initialize();
ElementId::initialize();
#endif
// Put together Sleigh components
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;
std::istringstream sla("<sleigh>" + sla_file_path->string() + "</sleigh>");
ghidra::Element *root =
storage.parseDocument(sla)->getRoot();
storage.registerTag(root);
std::optional<std::filesystem::path> pspec_file_path;
if (args->pspec_file_name) {
@@ -289,7 +311,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);
@@ -298,15 +321,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) {
#ifdef sleigh_RELEASE_IS_HEAD
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 {
@@ -315,20 +338,10 @@ int main(int argc, char *argv[]) {
}
}
decoder.closeElement(elemId);
#else
const List &list(el->getChildren());
for (List::const_iterator iter = list.begin(); iter != list.end(); ++iter) {
const string &elname((*iter)->getName());
if (elname == "context_data") {
ctx.restoreFromSpec(*iter, &engine);
break;
}
}
#endif
}
// In order to parse and validate the byte string properly, we need to get the
// address size from SLEIGH. Therefore this needs to happen after
// address size from Sleigh. Therefore this needs to happen after
// initialization.
//
// Ensure that we don't start disassembling until we've set the image buffer.
-129
View File
@@ -1,129 +0,0 @@
/*
Copyright (c) 2021-present, Trail of Bits, Inc.
All rights reserved.
This source code is licensed in accordance with the terms specified in
the LICENSE file found in the root directory of this source tree.
*/
#include <sleigh/libconfig.h>
#pragma once
#ifndef _MSC_VER
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated"
#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 <sleigh/slghparse.hh>
#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>
#ifdef sleigh_RELEASE_IS_HEAD
#include <sleigh/unionresolve.hh>
#include <sleigh/marshal.hh>
#endif
#ifndef _MSC_VER
#pragma GCC diagnostic pop
#endif
#include <sleigh/Support.h>
#include <sleigh/Version.h>
@@ -1,165 +0,0 @@
From 031d9830abe8517540389672fd22dc479e46d696 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] 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 66f8d3fa2..c136a964b 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.35.1
@@ -1,26 +0,0 @@
From ae78cca16d5d34d61912cbe6d9cb2f959cc36d21 Mon Sep 17 00:00:00 2001
From: Eric Kilmer <eric.d.kilmer@gmail.com>
Date: Wed, 27 Jul 2022 11:53:41 -0400
Subject: [PATCH] Initialize ID lookup tables to fix sleighexample
---
Ghidra/Features/Decompiler/src/decompile/cpp/sleighexample.cc | 3 +++
1 file changed, 3 insertions(+)
diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/sleighexample.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/sleighexample.cc
index 3a61418e6..87a4d7980 100644
--- a/Ghidra/Features/Decompiler/src/decompile/cpp/sleighexample.cc
+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/sleighexample.cc
@@ -294,6 +294,9 @@ int main(int argc,char **argv)
}
string action(argv[1]);
+ AttributeId::initialize();
+ ElementId::initialize();
+
// Set up the loadimage
MyLoadImage loader(0x80483b4,myprog,408);
// loader->open();
--
2.37.1
@@ -1,137 +0,0 @@
From 44c439d879c18c2873d5605821132957680a4405 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] 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.37.1
@@ -1,293 +0,0 @@
From f62b1e5483a99efe3ae6598291ec010ecee749d4 Mon Sep 17 00:00:00 2001
From: Alex Cameron <asc@tetsuo.sh>
Date: Mon, 7 Feb 2022 02:02:03 +1100
Subject: [PATCH] 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 +++++-
.../Decompiler/src/decompile/cpp/opbehavior.cc | 8 +++++++-
.../src/decompile/cpp/pcodecompile.cc | 18 +++++++++++-------
.../Decompiler/src/decompile/cpp/ruleaction.cc | 18 ++++++++++++++----
.../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 +-
13 files changed, 59 insertions(+), 23 deletions(-)
diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/address.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/address.cc
index 1cb02c5b2..3a60d1322 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 0526ed04c..e79fd041e 100644
--- a/Ghidra/Features/Decompiler/src/decompile/cpp/fspec.cc
+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/fspec.cc
@@ -2633,8 +2633,12 @@ void ProtoModelMerged::decode(Decoder &decoder)
modellist.push_back(mymodel);
}
decoder.closeElement(elemId);
- ((ParamListMerged *)input)->finalize();
- ((ParamListMerged *)output)->finalize();
+ if (input->getType() == ParamList::p_merged) {
+ ((ParamListMerged *)input)->finalize();
+ }
+ if (output->getType() == ParamList::p_merged) {
+ ((ParamListMerged *)output)->finalize();
+ }
}
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 e6b282ac7..f6a35728f 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)
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 b4f8a3f8e..068393416 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
break;
case CPUI_PIECE:
resmask = getIn(0)->getNZMask();
- resmask <<= 8*getIn(1)->getSize();
+ if (8*getIn(1)->getSize() < sizeof(resmask)) {
+ resmask <<= 8*getIn(1)->getSize();
+ } else {
+ resmask = 0;
+ }
resmask |= getIn(1)->getNZMask();
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
--- 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
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)) {
+ res >>= (in2*8);
+ } else {
+ res = 0;
+ }
+ res &= calc_mask(sizeout);
return res;
}
diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/pcodecompile.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/pcodecompile.cc
index 49128f7e6..133da8178 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
uint4 smallsize = (numbits+7)/8; // Size of input (output of rhs)
bool shiftneeded = (bitoffset != 0);
bool zextneeded = true;
- uintb mask = (uintb)2;
- mask = ~(((mask<<(numbits-1))-1) << bitoffset);
+ uintb mask = 0;
+ const int4 masknumbits = sizeof(mask) * 8;
+ if (numbits - 1 < masknumbits && bitoffset < masknumbits)
+ mask = ~(((static_cast<uintb>(2) << (numbits - 1)) - 1) << bitoffset);
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
}
}
- uintb mask = (uintb)2;
- mask = ((mask<<(numbits-1))-1);
-
if (truncneeded && ((bitoffset % 8)==0)) {
truncshift = bitoffset/8;
bitoffset = 0;
@@ -749,8 +748,13 @@ ExprTree *PcodeCompile::createBitRange(SpecificSymbol *sym,uint4 bitoffset,uint4
appendOp(CPUI_INT_RIGHT,res,bitoffset,4);
if (truncneeded)
appendOp(CPUI_SUBPIECE,res,truncshift,4);
- if (maskneeded)
- appendOp(CPUI_INT_AND,res,mask,finalsize);
+ if (maskneeded) {
+ uintb mask = 0;
+ if (numbits - 1 < sizeof(mask) * 8)
+ mask = static_cast<uintb>(2) << (numbits - 1);
+ --mask;
+ appendOp(CPUI_INT_AND, res, mask, finalsize);
+ }
force_size(res->outvn,ConstTpl(ConstTpl::real,finalsize),*res->ops);
return res;
}
diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/ruleaction.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/ruleaction.cc
index b5bdb4700..ef741545c 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)
Varnode *outvn = op->getOut();
if (outvn->isPrecisLo()||outvn->isPrecisHi()) return 0; // Don't pull apart double precision object
- uintb consume = calc_mask(newSize) << 8 * minByte;
+ uintb consume = calc_mask(newSize);
+ if (8 * minByte < sizeof(consume)) {
+ consume <<= 8 * minByte;
+ } else {
+ consume = 0;
+ }
consume = ~consume;
if ((consume & indir->getIn(0)->getConsume())!=0) return 0;
@@ -6785,8 +6790,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;
- TypeSpacebase *sbtype = (TypeSpacebase *)((TypePointer *)sbType)->getPtrTo();
- if (sbtype->getMetatype() != TYPE_SPACEBASE) return 0;
+ Datatype *sbTypePtr = ((TypePointer *)sbType)->getPtrTo();
+ if (sbTypePtr->getMetatype() != TYPE_SPACEBASE) return 0;
+ TypeSpacebase *sbtype = (TypeSpacebase *)sbTypePtr;
Varnode *vn1 = op->getIn(1);
if (!vn1->isConstant()) return 0;
Varnode *outvn = op->getOut();
@@ -7822,7 +7828,11 @@ int4 RuleSubvarSubpiece::applyOp(PcodeOp *op,Funcdata &data)
Varnode *outvn = op->getOut();
int4 flowsize = outvn->getSize();
uintb mask = calc_mask( flowsize );
- mask <<= 8*((int4)op->getIn(1)->getOffset());
+ if (8*((int4)op->getIn(1)->getOffset()) < sizeof(mask)) {
+ mask <<= 8*((int4)op->getIn(1)->getOffset());
+ } else {
+ mask = 0;
+ }
bool aggressive = outvn->isPtrFlow();
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 f8c1580a8..8ae5ff293 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)
{ // Constructor for relative jump constants and uniques
type = tp;
+ select = v_space;
}
ConstTpl::ConstTpl(const_type tp,uintb val)
@@ -54,6 +55,7 @@ ConstTpl::ConstTpl(AddrSpace *sid)
{
type = spaceid;
value.spaceid = sid;
+ select = v_space;
}
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 dccf0437d..f7f598667 100644
--- a/Ghidra/Features/Decompiler/src/decompile/cpp/semantics.hh
+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/semantics.hh
@@ -46,7 +46,7 @@ private:
static void printHandleSelector(ostream &s,v_field val);
static v_field readHandleSelector(const string &name);
public:
- ConstTpl(void) { type = real; value_real = 0; }
+ ConstTpl(void) { type = real; value_real = 0; select = v_space; }
ConstTpl(const ConstTpl &op2) {
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 3ec58b9d0..55fcfd7c8 100644
--- a/Ghidra/Features/Decompiler/src/decompile/cpp/slgh_compile.cc
+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/slgh_compile.cc
@@ -2150,8 +2150,8 @@ string SleighCompile::checkSymbols(SymbolScope *scope)
ostringstream msg;
SymbolTree::const_iterator iter;
for(iter=scope->begin();iter!=scope->end();++iter) {
+ if ((*iter)->getType() != SleighSymbol::label_symbol) continue;
LabelSymbol *sym = (LabelSymbol *)*iter;
- if (sym->getType() != SleighSymbol::label_symbol) continue;
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 5f4a8fe32..50bc33b8b 100644
--- a/Ghidra/Features/Decompiler/src/decompile/cpp/slghsymbol.cc
+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/slghsymbol.cc
@@ -2499,7 +2499,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 b8dbcd55b..b2d0c1bb6 100644
--- a/Ghidra/Features/Decompiler/src/decompile/cpp/type.cc
+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/type.cc
@@ -3073,8 +3073,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()) {
+ if ((*iter)->getMetatype() != TYPE_PTR) break;
TypePointer *ptr = (TypePointer *)*iter;
- if (ptr->getMetatype() != TYPE_PTR) break;
if (ptr->ptrto != base) break;
++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
--- 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) {
for(float f:float_test_values) {
// avoid undefined behavior
- if((int64_t)f > std::numeric_limits<int>::max() || (int64_t)f < std::numeric_limits<int>::min())
+ if(f > std::numeric_limits<int>::max() || f < std::numeric_limits<int>::min() || std::isnan(f))
continue;
uintb true_result = ((uintb)(int32_t)f) & 0xffffffff;
uintb encoding = format.getEncoding(f);
--
2.32.1 (Apple Git-133)
@@ -1,165 +0,0 @@
From 031d9830abe8517540389672fd22dc479e46d696 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] 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 66f8d3fa2..c136a964b 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.35.1
@@ -1,137 +0,0 @@
From 143296b212e6c3c8bc8cc1e0d88511f5bbc858ff 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] 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 9d1f21d04..4f5c8ac2b 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"
@@ -45,3 +48,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 7457a6303..a99fcbcd8 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"
@@ -44,3 +48,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 edb19aed3..78c8ad21c 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 4d404e6ad..0154582b0 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"
@@ -43,3 +47,5 @@ class XmlArchitecture : public SleighArchitecture {
XmlArchitecture(const string &fname,const string &targ,ostream *estream); ///< Constructor
virtual ~XmlArchitecture(void) {}
};
+
+#endif
--
2.37.1
@@ -1,293 +0,0 @@
From 33ff58323d84c0ba57091b5bd408907a7646fd67 Mon Sep 17 00:00:00 2001
From: Alex Cameron <asc@tetsuo.sh>
Date: Tue, 2 Aug 2022 17:04:19 +1000
Subject: [PATCH] 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 +++++-
.../Decompiler/src/decompile/cpp/opbehavior.cc | 8 +++++++-
.../src/decompile/cpp/pcodecompile.cc | 18 +++++++++++-------
.../Decompiler/src/decompile/cpp/ruleaction.cc | 18 ++++++++++++++----
.../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 +-
13 files changed, 59 insertions(+), 23 deletions(-)
diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/address.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/address.cc
index bd0d84d50..8fbd393e4 100644
--- a/Ghidra/Features/Decompiler/src/decompile/cpp/address.cc
+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/address.cc
@@ -631,7 +631,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;
@@ -645,7 +645,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 89685bd76..54dc2cfc8 100644
--- a/Ghidra/Features/Decompiler/src/decompile/cpp/fspec.cc
+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/fspec.cc
@@ -2468,8 +2468,12 @@ void ProtoModelMerged::restoreXml(const Element *el)
foldIn(mymodel);
modellist.push_back(mymodel);
}
- ((ParamListMerged *)input)->finalize();
- ((ParamListMerged *)output)->finalize();
+ if (input->getType() == ParamList::p_merged) {
+ ((ParamListMerged *)input)->finalize();
+ }
+ if (output->getType() == ParamList::p_merged) {
+ ((ParamListMerged *)output)->finalize();
+ }
}
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 a710d2597..3472e391a 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)
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 af89c583a..f7086bbf8 100644
--- a/Ghidra/Features/Decompiler/src/decompile/cpp/op.cc
+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/op.cc
@@ -650,7 +650,11 @@ uintb PcodeOp::getNZMaskLocal(bool cliploop) const
break;
case CPUI_PIECE:
resmask = getIn(0)->getNZMask();
- resmask <<= 8*getIn(1)->getSize();
+ if (8*getIn(1)->getSize() < sizeof(resmask)) {
+ resmask <<= 8*getIn(1)->getSize();
+ } else {
+ resmask = 0;
+ }
resmask |= getIn(1)->getNZMask();
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
--- 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
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)) {
+ res >>= (in2*8);
+ } else {
+ res = 0;
+ }
+ res &= calc_mask(sizeout);
return res;
}
diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/pcodecompile.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/pcodecompile.cc
index 7927becec..4987e37ec 100644
--- a/Ghidra/Features/Decompiler/src/decompile/cpp/pcodecompile.cc
+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/pcodecompile.cc
@@ -622,8 +622,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;
- uintb mask = (uintb)2;
- mask = ~(((mask<<(numbits-1))-1) << bitoffset);
+ uintb mask = 0;
+ const int4 masknumbits = sizeof(mask) * 8;
+ if (numbits - 1 < masknumbits && bitoffset < masknumbits)
+ mask = ~(((static_cast<uintb>(2) << (numbits - 1)) - 1) << bitoffset);
if (vn->getSize().getType()==ConstTpl::real) {
// If we know the size of the bitranged varnode, we can
@@ -727,9 +729,6 @@ ExprTree *PcodeCompile::createBitRange(SpecificSymbol *sym,uint4 bitoffset,uint4
}
}
- uintb mask = (uintb)2;
- mask = ((mask<<(numbits-1))-1);
-
if (truncneeded && ((bitoffset % 8)==0)) {
truncshift = bitoffset/8;
bitoffset = 0;
@@ -752,8 +751,13 @@ ExprTree *PcodeCompile::createBitRange(SpecificSymbol *sym,uint4 bitoffset,uint4
appendOp(CPUI_INT_RIGHT,res,bitoffset,4);
if (truncneeded)
appendOp(CPUI_SUBPIECE,res,truncshift,4);
- if (maskneeded)
- appendOp(CPUI_INT_AND,res,mask,finalsize);
+ if (maskneeded) {
+ uintb mask = 0;
+ if (numbits - 1 < sizeof(mask) * 8)
+ mask = static_cast<uintb>(2) << (numbits - 1);
+ --mask;
+ appendOp(CPUI_INT_AND, res, mask, finalsize);
+ }
force_size(res->outvn,ConstTpl(ConstTpl::real,finalsize),*res->ops);
return res;
}
diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/ruleaction.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/ruleaction.cc
index 2a5d92040..d65ae2918 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)
Varnode *outvn = op->getOut();
if (outvn->isPrecisLo()||outvn->isPrecisHi()) return 0; // Don't pull apart double precision object
- uintb consume = calc_mask(newSize) << 8 * minByte;
+ uintb consume = calc_mask(newSize);
+ if (8 * minByte < sizeof(consume)) {
+ consume <<= 8 * minByte;
+ } else {
+ consume = 0;
+ }
consume = ~consume;
if ((consume & indir->getIn(0)->getConsume())!=0) return 0;
@@ -6767,8 +6772,9 @@ int4 RulePtrsubCharConstant::applyOp(PcodeOp *op,Funcdata &data)
{
Varnode *sb = op->getIn(0);
if (sb->getType()->getMetatype() != TYPE_PTR) return 0;
- TypeSpacebase *sbtype = (TypeSpacebase *)((TypePointer *)sb->getType())->getPtrTo();
- if (sbtype->getMetatype() != TYPE_SPACEBASE) return 0;
+ Datatype *sbTypePtr = ((TypePointer *)sb->getType())->getPtrTo();
+ if (sbTypePtr->getMetatype() != TYPE_SPACEBASE) return 0;
+ TypeSpacebase *sbtype = (TypeSpacebase *)sbTypePtr;
Varnode *vn1 = op->getIn(1);
if (!vn1->isConstant()) return 0;
Varnode *outvn = op->getOut();
@@ -7781,7 +7787,11 @@ int4 RuleSubvarSubpiece::applyOp(PcodeOp *op,Funcdata &data)
Varnode *outvn = op->getOut();
int4 flowsize = outvn->getSize();
uintb mask = calc_mask( flowsize );
- mask <<= 8*((int4)op->getIn(1)->getOffset());
+ if (8*((int4)op->getIn(1)->getOffset()) < sizeof(mask)) {
+ mask <<= 8*((int4)op->getIn(1)->getOffset());
+ } else {
+ mask = 0;
+ }
bool aggressive = outvn->isPtrFlow();
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 f8c1580a8..8ae5ff293 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)
{ // Constructor for relative jump constants and uniques
type = tp;
+ select = v_space;
}
ConstTpl::ConstTpl(const_type tp,uintb val)
@@ -54,6 +55,7 @@ ConstTpl::ConstTpl(AddrSpace *sid)
{
type = spaceid;
value.spaceid = sid;
+ select = v_space;
}
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 dccf0437d..f7f598667 100644
--- a/Ghidra/Features/Decompiler/src/decompile/cpp/semantics.hh
+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/semantics.hh
@@ -46,7 +46,7 @@ private:
static void printHandleSelector(ostream &s,v_field val);
static v_field readHandleSelector(const string &name);
public:
- ConstTpl(void) { type = real; value_real = 0; }
+ ConstTpl(void) { type = real; value_real = 0; select = v_space; }
ConstTpl(const ConstTpl &op2) {
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 40d775b2d..5535d4108 100644
--- a/Ghidra/Features/Decompiler/src/decompile/cpp/slgh_compile.cc
+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/slgh_compile.cc
@@ -2150,8 +2150,8 @@ string SleighCompile::checkSymbols(SymbolScope *scope)
ostringstream msg;
SymbolTree::const_iterator iter;
for(iter=scope->begin();iter!=scope->end();++iter) {
+ if ((*iter)->getType() != SleighSymbol::label_symbol) continue;
LabelSymbol *sym = (LabelSymbol *)*iter;
- if (sym->getType() != SleighSymbol::label_symbol) continue;
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 5f4a8fe32..50bc33b8b 100644
--- a/Ghidra/Features/Decompiler/src/decompile/cpp/slghsymbol.cc
+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/slghsymbol.cc
@@ -2499,7 +2499,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 75b74d465..f478f19a4 100644
--- a/Ghidra/Features/Decompiler/src/decompile/cpp/type.cc
+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/type.cc
@@ -2392,8 +2392,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()) {
+ if ((*iter)->getMetatype() != TYPE_PTR) break;
TypePointer *ptr = (TypePointer *)*iter;
- if (ptr->getMetatype() != TYPE_PTR) break;
if (ptr->ptrto != base) break;
++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
--- 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) {
for(float f:float_test_values) {
// avoid undefined behavior
- if((int64_t)f > std::numeric_limits<int>::max() || (int64_t)f < std::numeric_limits<int>::min())
+ if(f > std::numeric_limits<int>::max() || f < std::numeric_limits<int>::min() || std::isnan(f))
continue;
uintb true_result = ((uintb)(int32_t)f) & 0xffffffff;
uintb encoding = format.getEncoding(f);
--
2.32.1 (Apple Git-133)
+666 -168
View File
@@ -1,211 +1,709 @@
#!/usr/bin/env python3
"""Script to update CMake files for latest Ghidra Sleigh changes"""
import pathlib
import argparse
import os
import re
import shutil
import subprocess
import sys
import tempfile
from typing import AnyStr, Union
from dataclasses import dataclass, field
from pathlib import Path
from typing import List, Dict, Optional, Any, Tuple
PROJECT_ROOT = pathlib.Path(__file__).parent.parent.resolve()
HEAD_SPEC_FILE = PROJECT_ROOT / "spec-files-list" / "spec_files_HEAD.cmake"
assert HEAD_SPEC_FILE.exists()
# Constants
PROJECT_ROOT = Path(__file__).parent.parent.resolve()
HEAD_SPEC_FILE = PROJECT_ROOT / "src" / "spec_files_HEAD.cmake"
SETUP_GHIDRA_FILE = PROJECT_ROOT / "src" / "setup-ghidra-source.cmake"
assert SETUP_GHIDRA_FILE.exists()
GIT_EXE = shutil.which("git")
assert GIT_EXE is not None
# Paths in Ghidra repo that affect this repo
SLEIGH_PATHS = [
"Ghidra/Features/Decompiler/src/decompile", # Source code and tests
"Ghidra/Processors", # Sleigh files
]
# File extensions requiring manual CMake intervention
CPP_EXTENSIONS = {".cc", ".hh"}
SPEC_EXTENSIONS = {".slaspec", ".cspec", ".pspec", ".ldefs", ".opinion", ".sinc"}
# File extensions to ignore (in addition to .java)
IGNORED_EXTENSIONS = {
".java",
".gradle",
".properties",
".txt",
".md",
".html",
".xml",
".png",
".gif",
".jpg",
".ico",
}
# Paths for categorizing files
CPP_PATH = "Ghidra/Features/Decompiler/src/decompile/cpp/"
SPEC_PATH_PREFIX = "Ghidra/Processors/"
# Regex patterns
HEAD_COMMIT_PATTERN = r"set\(ghidra_head_git_tag \"([0-9A-Fa-f]+)\"\)"
VERSION_PATTERN = r"set\(ghidra_head_version \"([0-9]+(\.[0-9]+)*)\"\)"
APP_VERSION_PATTERN = r"application.version=([0-9]+(\.[0-9]+)*)"
def msg(s: str) -> None:
print(f"[!] {s}")
@dataclass
class CategorizedChanges:
"""Holds files categorized by change type and file type."""
added_cpp: List[str] = field(default_factory=list)
deleted_cpp: List[str] = field(default_factory=list)
added_spec: List[str] = field(default_factory=list)
deleted_spec: List[str] = field(default_factory=list)
PathString = Union[AnyStr, pathlib.Path]
def clone_ghidra_git(dir: PathString) -> None:
"""Clone the Ghidra git dir at specified directory"""
# Shallow clone
assert GIT_EXE is not None
subprocess.run(
[
GIT_EXE,
"clone",
"https://github.com/NationalSecurityAgency/ghidra",
"--depth",
"1",
dir,
],
stdout=sys.stdout,
stderr=sys.stderr,
check=True,
)
def update_head_commit(latest_commit: str):
"""Edit the Ghidra script to point to the latest commit"""
head_commit_line = r"set\(ghidra_head_git_tag \"([0-9A-Fa-f]+)\"\)"
updated = False
fd, abspath = tempfile.mkstemp()
with open(fd, "w") as w:
with open(SETUP_GHIDRA_FILE, "r") as r:
for line in r:
match = re.search(head_commit_line, line)
if match is not None:
current_commit = match.group(1)
if current_commit != latest_commit:
msg(f"Found new commit: {latest_commit}")
line = re.sub(
head_commit_line,
f'set(ghidra_head_git_tag "{latest_commit}")',
line,
)
updated = True
w.write(line)
# Make the swap with the new content
shutil.copymode(SETUP_GHIDRA_FILE, abspath)
os.remove(SETUP_GHIDRA_FILE)
shutil.move(abspath, SETUP_GHIDRA_FILE)
return updated
def update_head_version_file(ghidra_root_dir: PathString) -> None:
"""Edit the Ghidra script to point to the latest version"""
cmake_head_version_line = (
r"set\(ghidra_head_version \"([0-9]+(\.[0-9]+)?(\.[0-9]+)?)\"\)"
)
with (ghidra_root_dir / "Ghidra" / "application.properties").open("r") as f:
content = f.read()
match = re.search(
r"application.version=([0-9]+(\.[0-9]+)?(\.[0-9]+)?)", content
def needs_manual_intervention(self) -> bool:
"""Check if any files need manual intervention."""
return bool(
self.added_cpp or self.deleted_cpp or self.added_spec or self.deleted_spec
)
assert match is not None
source_version = match.group(1)
with SETUP_GHIDRA_FILE.open("r") as f:
content = f.read()
match = re.search(cmake_head_version_line, content)
assert match is not None
cmake_version = match.group(1)
def format_intervention_details(self) -> str:
"""Format the intervention details as markdown."""
sections = []
if cmake_version == source_version:
msg(f"No new version bump")
return
if self.added_cpp:
sections.append("### New C++ Source Files")
sections.append(
"These files need to be added to `src/setup-ghidra-source.cmake`:"
)
for f in self.added_cpp:
sections.append(f"- `{f}`")
sections.append("")
msg(f"Found new version: {source_version}")
fd, abspath = tempfile.mkstemp()
with open(fd, "w") as w:
with SETUP_GHIDRA_FILE.open("r") as r:
for line in r:
match = re.search(cmake_head_version_line, line)
if match is not None:
line = re.sub(
cmake_head_version_line,
f'set(ghidra_head_version "{source_version}")',
line,
)
w.write(line)
if self.deleted_cpp:
sections.append("### Deleted C++ Source Files")
sections.append(
"These files need to be removed from `src/setup-ghidra-source.cmake`:"
)
for f in self.deleted_cpp:
sections.append(f"- `{f}`")
sections.append("")
# Make the swap with the new content
shutil.copymode(SETUP_GHIDRA_FILE, abspath)
os.remove(SETUP_GHIDRA_FILE)
shutil.move(abspath, SETUP_GHIDRA_FILE)
if self.added_spec:
sections.append("### New Spec Files")
sections.append(
"Review if these files need manual CMake updates (`.slaspec` files "
"are auto-generated; other types may need manual updates):"
)
for f in self.added_spec:
sections.append(f"- `{f}`")
sections.append("")
if self.deleted_spec:
sections.append("### Deleted Spec Files")
sections.append("Verify these files are no longer referenced:")
for f in self.deleted_spec:
sections.append(f"- `{f}`")
sections.append("")
return "\n".join(sections).rstrip()
def update_spec_files(ghidra_repo_dir: PathString, cmake_file: PathString):
"""Based on the files in the Ghidra repo, write an updated list of spec files."""
spec_files = []
for dirpath, _, fnames in os.walk(ghidra_repo_dir / "Ghidra" / "Processors"):
for file in fnames:
if file.endswith(".slaspec"):
spec_files.append(
(pathlib.Path(dirpath) / file).relative_to(ghidra_repo_dir)
)
assert len(spec_files) > 0
spec_files.sort()
class GitHelper:
"""Helper class for Git operations"""
msg(f"Found {len(spec_files)} slaspec files")
def __init__(self) -> None:
self.git_exe = shutil.which("git")
if self.git_exe is None:
raise RuntimeError("Git executable not found in PATH")
with open(cmake_file, "w") as f:
f.write("set(spec_file_list\n")
for spec in spec_files:
f.write(f' "${{ghidrasource_SOURCE_DIR}}/{spec}"\n')
f.write(")\n")
def get_latest_commit(ghidra_repo_dir: PathString) -> str:
"""Get the commit SHA that the repo is currently at"""
assert GIT_EXE is not None
return (
subprocess.run(
[GIT_EXE, "rev-parse", "HEAD"],
cwd=ghidra_repo_dir,
capture_output=True,
def run(
self, args: List[str], cwd: Path, capture_output: bool = False
) -> subprocess.CompletedProcess:
"""Run a git command with the given arguments"""
assert self.git_exe is not None
cmd = [self.git_exe] + args
return subprocess.run(
cmd,
cwd=cwd,
stdout=subprocess.PIPE if capture_output else sys.stdout,
stderr=subprocess.PIPE if capture_output else sys.stderr,
check=True,
text=True if capture_output else False,
)
.stdout.decode()
.strip()
)
def clone(self, repo_url: str, target_dir: Path) -> None:
"""Clone a git repository"""
print(f"Cloning {repo_url} to {target_dir}...")
self.run(["clone", repo_url, str(target_dir)], cwd=PROJECT_ROOT)
def get_head_commit(self, repo_dir: Path) -> str:
"""Get the HEAD commit SHA of the repository"""
result = self.run(["rev-parse", "HEAD"], cwd=repo_dir, capture_output=True)
return result.stdout.strip()
def check_commit_exists(self, repo_dir: Path, commit: str) -> bool:
"""Check if a commit exists in the repository"""
try:
self.run(["cat-file", "-e", commit], repo_dir, capture_output=True)
return True
except subprocess.CalledProcessError:
return False
@staticmethod
def _should_ignore_file(file_path: str) -> bool:
"""Check if a file should be ignored based on its extension."""
ext = Path(file_path).suffix.lower()
return ext in IGNORED_EXTENSIONS
@staticmethod
def _categorize_file(
status: str, file_path: str, categorized: CategorizedChanges
) -> None:
"""Categorize a file based on its status and type.
Args:
status: Git status code (A, D, M, R, etc.)
file_path: Path to the file
categorized: CategorizedChanges object to update
"""
ext = Path(file_path).suffix.lower()
# Only categorize added (A) or deleted (D) files
if status not in ("A", "D"):
return
# Check if it's a C++ file in the decompiler path
if ext in CPP_EXTENSIONS and CPP_PATH in file_path:
if status == "A":
categorized.added_cpp.append(file_path)
else: # status == "D"
categorized.deleted_cpp.append(file_path)
return
# Check if it's a spec file in the Processors path
if ext in SPEC_EXTENSIONS and file_path.startswith(SPEC_PATH_PREFIX):
if status == "A":
categorized.added_spec.append(file_path)
else: # status == "D"
categorized.deleted_spec.append(file_path)
@staticmethod
def _parse_git_status_line(line: str) -> Tuple[str, str, Optional[str]]:
"""Parse a git status line from --name-status output.
Returns:
Tuple of (status, file_path, new_path_for_rename)
"""
parts = line.split("\t")
status = parts[0]
# Handle rename (R100 or similar)
if status.startswith("R"):
return ("R", parts[1], parts[2])
return (status, parts[1], None)
def get_commit_info(
self, repo_dir: Path, old_commit: str, new_commit: str, paths: List[str]
) -> List[Dict[str, Any]]:
"""Get detailed information about commits affecting specified paths"""
result = self.run(
[
"log",
"--pretty=format:%H%n%ad%n%s%n%b%n====",
"--date=iso",
f"{old_commit}..{new_commit}",
"--",
*paths,
],
cwd=repo_dir,
capture_output=True,
)
log_output = result.stdout.strip()
commits = []
if log_output:
commit_sections = log_output.split("\n====")
for section in commit_sections:
if not section.strip():
continue
lines = section.strip().split("\n")
commit_hash = lines[0]
commit_date = lines[1]
commit_msg = lines[2]
body = "\n".join(lines[3:]) if len(lines) > 3 else ""
# Get files modified in this commit
files_result = self.run(
[
"diff-tree",
"--no-commit-id",
"--name-status",
"-r",
commit_hash,
"--",
*paths,
],
cwd=repo_dir,
capture_output=True,
)
commit_files = files_result.stdout.strip().splitlines()
# Filter out ignored files
filtered_files = []
for line in commit_files:
if not line.strip():
continue
status, file_path, new_path = self._parse_git_status_line(line)
if status == "R":
# For renames, check both old and new paths
if not self._should_ignore_file(file_path):
filtered_files.append(f"D\t{file_path}")
if new_path and not self._should_ignore_file(new_path):
filtered_files.append(f"A\t{new_path}")
elif not self._should_ignore_file(file_path):
filtered_files.append(line)
commit_files = filtered_files
if commit_files:
commits.append(
{
"hash": commit_hash,
"date": commit_date,
"message": commit_msg,
"body": body,
"files": commit_files,
}
)
return commits
def get_changed_files(
self, repo_dir: Path, old_commit: str, new_commit: str, paths: List[str]
) -> Tuple[List[str], CategorizedChanges]:
"""Get list of files changed between commits and categorize them.
Returns:
Tuple of (filtered_files_list, categorized_changes)
"""
result = self.run(
[
"diff",
"--name-status",
f"{old_commit}...{new_commit}",
"--",
*paths,
],
cwd=repo_dir,
capture_output=True,
)
raw_lines = result.stdout.strip().splitlines()
filtered_files = []
categorized = CategorizedChanges()
for line in raw_lines:
if not line.strip():
continue
status, file_path, new_path = self._parse_git_status_line(line)
if status == "R":
# For renames, treat as delete old + add new
if not self._should_ignore_file(file_path):
filtered_files.append(f"D\t{file_path}")
self._categorize_file("D", file_path, categorized)
if new_path and not self._should_ignore_file(new_path):
filtered_files.append(f"A\t{new_path}")
self._categorize_file("A", new_path, categorized)
elif not self._should_ignore_file(file_path):
filtered_files.append(line)
self._categorize_file(status, file_path, categorized)
return filtered_files, categorized
def update_head(ghidra_repo_dir: PathString, ci: bool) -> bool:
"""Update to latest head and make changes to the CMake files"""
tmpdirname = None
if ghidra_repo_dir is None:
tmpdirname = tempfile.TemporaryDirectory()
ghidra_repo_dir = pathlib.Path(tmpdirname.name) / "ghidra"
clone_ghidra_git(ghidra_repo_dir)
class GhidraUpdater:
"""Handles updating Ghidra-related CMake files"""
latest_commit = get_latest_commit(ghidra_repo_dir)
did_update_commit = update_head_commit(latest_commit)
if did_update_commit:
if ci:
print(f"::set-output name=short_sha::{latest_commit[:9]}")
print("::set-output name=did_update::true")
update_spec_files(ghidra_repo_dir, HEAD_SPEC_FILE)
update_head_version_file(ghidra_repo_dir)
else:
msg(f"Already at the latest commit: {latest_commit}")
def __init__(self, ci_mode: bool = False, dry_run: bool = False) -> None:
self.git = GitHelper()
self.ci_mode = ci_mode
self.dry_run = dry_run
if tmpdirname is not None:
tmpdirname.cleanup()
# Validate required paths
if not HEAD_SPEC_FILE.exists():
raise FileNotFoundError(f"HEAD spec file not found: {HEAD_SPEC_FILE}")
if not SETUP_GHIDRA_FILE.exists():
raise FileNotFoundError(f"Setup Ghidra file not found: {SETUP_GHIDRA_FILE}")
if did_update_commit:
return True
else:
return False
# Set up GitHub Actions outputs if in CI mode
if self.ci_mode and "GITHUB_OUTPUT" not in os.environ:
raise RuntimeError("CI mode requires GITHUB_OUTPUT environment variable")
def clone_ghidra_if_needed(
self, repo_dir: Optional[Path] = None
) -> Tuple[Path, Optional[tempfile.TemporaryDirectory]]:
"""Clone Ghidra repo if a directory is not provided"""
temp_dir = None
if repo_dir is None:
temp_dir = tempfile.TemporaryDirectory()
repo_dir = Path(temp_dir.name) / "ghidra"
self.git.clone("https://github.com/NationalSecurityAgency/ghidra", repo_dir)
return repo_dir, temp_dir
def log_github_output(self, key: str, value: str) -> None:
"""Log output for GitHub Actions"""
if self.ci_mode:
with open(os.environ["GITHUB_OUTPUT"], "a") as f:
f.write(f"{key}={value}\n")
def log_github_multiline_output(self, key: str, value: str) -> None:
"""Log multiline output for GitHub Actions"""
if self.ci_mode:
with open(os.environ["GITHUB_OUTPUT"], "a") as f:
f.write(f"{key}<<EOF\n")
f.write(value)
f.write("\nEOF\n")
def display_changes(
self, repo_dir: Path, start_commit: str, end_commit: str
) -> Tuple[List[str], List[Dict[str, Any]], CategorizedChanges]:
"""Display changes between two commits and return the changed files and commit info.
Returns:
Tuple of (changed_files, commit_info, categorized_changes)
"""
# Get changed files and categorized changes
changed_files, categorized = self.git.get_changed_files(
repo_dir, start_commit, end_commit, SLEIGH_PATHS
)
if not changed_files:
print("No sleigh files were modified between these commits")
return [], [], CategorizedChanges()
# Output changes for logging
num_changed = len(changed_files)
print(f"Found {num_changed} changed sleigh files:")
for file in changed_files:
print(f" {file}")
# Display manual intervention warning if needed
if categorized.needs_manual_intervention():
print("\n** Manual intervention may be required **")
if categorized.added_cpp:
print(f" New C++ files: {len(categorized.added_cpp)}")
if categorized.deleted_cpp:
print(f" Deleted C++ files: {len(categorized.deleted_cpp)}")
if categorized.added_spec:
print(f" New spec files: {len(categorized.added_spec)}")
if categorized.deleted_spec:
print(f" Deleted spec files: {len(categorized.deleted_spec)}")
# Get detailed commit info for logging
commit_info = self.git.get_commit_info(
repo_dir, start_commit, end_commit, SLEIGH_PATHS
)
if commit_info:
print(f"\nCommits affecting sleigh files ({len(commit_info)}):\n")
for i, commit in enumerate(commit_info, 1):
print(f"[Commit {i}/{len(commit_info)}]")
print(f"Hash: {commit['hash']}")
print(f"Date: {commit['date']}")
print(f"Message: {commit['message']}")
if commit["body"]:
print(f"Details:\n{commit['body']}")
print("\nFiles changed:")
for file in commit["files"]:
print(f" {file}")
print("")
# Log outputs for GitHub Actions
if self.ci_mode:
self.log_github_output("short_sha", end_commit[:9])
self.log_github_output("did_update", "true")
# Log changed files
changed_files_str = "```\n" + "\n".join(changed_files) + "\n```"
self.log_github_multiline_output("changed_files", changed_files_str)
# Log commit details
if commit_info:
details = ["```"]
for i, commit in enumerate(commit_info, 1):
details.append(f"[Commit {i}/{len(commit_info)}]")
details.append(f"Hash: {commit['hash']}")
details.append(f"Date: {commit['date']}")
details.append(f"Message: {commit['message']}")
if commit["body"]:
details.append(f"Details:\n{commit['body']}")
details.append("\nFiles changed:")
for file in commit["files"]:
details.append(f" {file}")
details.append("")
# Replace trailing newline for last entry
details[-1] = "```"
self.log_github_multiline_output("commit_details", "\n".join(details))
# Log manual intervention outputs
if categorized.needs_manual_intervention():
self.log_github_output("needs_manual_intervention", "true")
self.log_github_multiline_output(
"intervention_details", categorized.format_intervention_details()
)
else:
self.log_github_output("needs_manual_intervention", "false")
return changed_files, commit_info, categorized
def update_head_commit(
self, repo_dir: Path, setup_file: Path
) -> Tuple[bool, str, str]:
"""Update the HEAD commit in the setup file if needed"""
# Get latest commit hash
latest_commit = self.git.get_head_commit(repo_dir)
current_commit = None
# Find current commit hash in setup file
with setup_file.open("r") as f:
for line in f:
match = re.search(HEAD_COMMIT_PATTERN, line)
if match:
current_commit = match.group(1)
break
if current_commit is None:
raise ValueError("Could not find current commit in setup file")
# Check if update is needed
if current_commit == latest_commit:
print(f"Already at the latest commit: {latest_commit}")
return False, current_commit, latest_commit
print(f"Found new commit: {latest_commit}")
# Check if sleigh files were updated and display changes
changed_files, commit_info, _ = self.display_changes(
repo_dir, current_commit, latest_commit
)
if not changed_files:
return False, current_commit, latest_commit
# Update the setup file if not in dry run mode
if not self.dry_run:
self._replace_in_file(
setup_file,
HEAD_COMMIT_PATTERN,
f'set(ghidra_head_git_tag "{latest_commit}")',
)
return True, current_commit, latest_commit
def update_version(self, repo_dir: Path, setup_file: Path) -> None:
"""Update the Ghidra version in the setup file if needed"""
# Get source version from application.properties
app_properties_file = repo_dir / "Ghidra" / "application.properties"
with app_properties_file.open("r") as f:
content = f.read()
match = re.search(APP_VERSION_PATTERN, content)
if not match:
raise ValueError("Could not find version in application.properties")
source_version = match.group(1)
# Get current version from setup file
with setup_file.open("r") as f:
content = f.read()
match = re.search(VERSION_PATTERN, content)
if not match:
raise ValueError("Could not find version in setup file")
cmake_version = match.group(1)
# Check if update is needed
if cmake_version == source_version:
print("No new version bump")
return
print(f"Found new version: {source_version}")
# Update the setup file if not in dry run mode
if not self.dry_run:
self._replace_in_file(
setup_file,
VERSION_PATTERN,
f'set(ghidra_head_version "{source_version}")',
)
def update_spec_files(self, repo_dir: Path, spec_file: Path) -> None:
"""Update the list of spec files in the CMake file"""
# Find all .slaspec files
spec_files = []
processors_dir = repo_dir / "Ghidra" / "Processors"
for path in processors_dir.glob("**/*.slaspec"):
spec_files.append(path.relative_to(repo_dir))
spec_files.sort()
print(f"Found {len(spec_files)} slaspec files")
# Write the updated spec file list
if not self.dry_run and spec_files:
with spec_file.open("w") as f:
f.write("set(spec_file_list\n")
for spec in spec_files:
f.write(f' "${{ghidrasource_SOURCE_DIR}}/{spec}"\n')
f.write(")\n")
def _replace_in_file(self, file_path: Path, pattern: str, replacement: str) -> None:
"""Replace text in a file matching the pattern with the replacement"""
temp_file = tempfile.NamedTemporaryFile(mode="w", delete=False)
with file_path.open("r") as src, open(temp_file.name, "w") as dst:
for line in src:
dst.write(re.sub(pattern, replacement, line))
# Replace the original file with the modified one
shutil.copymode(file_path, temp_file.name)
os.remove(file_path)
shutil.move(temp_file.name, file_path)
def update(self, repo_dir: Optional[Path] = None) -> bool:
"""Main update method to orchestrate the update process"""
# Clone repo if not provided
repo_dir, temp_dir = self.clone_ghidra_if_needed(repo_dir)
try:
# Update the HEAD commit
did_update, _, _ = self.update_head_commit(repo_dir, SETUP_GHIDRA_FILE)
# If commit was updated, also update version and spec files
if did_update:
self.update_version(repo_dir, SETUP_GHIDRA_FILE)
self.update_spec_files(repo_dir, HEAD_SPEC_FILE)
return did_update
finally:
# Clean up temp directory if created
if temp_dir:
temp_dir.cleanup()
def compare_commits(
self, repo_dir: Path, start_commit: str, end_commit: Optional[str] = None
) -> None:
"""Compare changes between two commits without updating any files"""
# If end_commit is not provided, use HEAD
if end_commit is None:
end_commit = self.git.get_head_commit(repo_dir)
print(f"Using HEAD as end commit: {end_commit}")
print(f"Comparing commits {start_commit} to {end_commit}")
# Check if the commits exist
for commit in [start_commit, end_commit]:
if not self.git.check_commit_exists(repo_dir, commit):
raise ValueError(f"Commit {commit} does not exist in the repository")
# Display changes
self.display_changes(repo_dir, start_commit, end_commit)
if __name__ == "__main__":
import argparse, os
def dir_path(string):
if string is None:
return string
string = pathlib.Path(string).expanduser().resolve()
if string.is_dir():
return string
else:
raise NotADirectoryError(string)
def parse_args() -> argparse.Namespace:
"""Parse command line arguments"""
parser = argparse.ArgumentParser(
description="Update CMake files to latest Ghidra commit."
description="Find and collect changes between two Ghidra commits. Update CMake files to latest Ghidra commit if specified."
)
parser.add_argument(
"--ghidra-repo",
type=dir_path,
type=str,
help="Use a specific Ghidra repo directory instead of downloading it from the internet",
)
parser.add_argument(
"--ci",
action="store_true",
help="Output GitHub Actions commands for recording information in CI",
help="Output GitHub Actions commands for recording information in CI. Requires GITHUB_OUTPUT environment variable.",
)
parser.add_argument(
"--dry-run",
action="store_true",
help="Show what would be changed without actually modifying any files",
)
parser.add_argument(
"start_commit",
nargs="?",
type=str,
help="Starting commit for comparison. When specified, no CMake files will be updated.",
)
parser.add_argument(
"end_commit",
nargs="?",
type=str,
help="Ending commit for comparison. If not specified, uses current HEAD of the repo. Requires start_commit.",
)
args = parser.parse_args()
if not update_head(args.ghidra_repo, args.ci):
msg("No update required")
# Convert ghidra-repo path if provided
if args.ghidra_repo:
repo_path = Path(args.ghidra_repo).expanduser().resolve()
if not repo_path.is_dir():
parser.error(f"Ghidra repo directory does not exist: {repo_path}")
args.ghidra_repo = repo_path
# Validate commit arguments
if args.end_commit and not args.start_commit:
parser.error("Cannot specify end_commit without start_commit")
# If commits are specified, a Ghidra repo is required
if args.start_commit and not args.ghidra_repo:
parser.error("--ghidra-repo is required when specifying commits")
return args
def main() -> None:
"""Main entry point"""
args = parse_args()
try:
updater = GhidraUpdater(ci_mode=args.ci, dry_run=args.dry_run)
# If start_commit is specified, run in comparison mode
if args.start_commit:
updater.compare_commits(
args.ghidra_repo, args.start_commit, args.end_commit
)
else:
# Normal update mode
did_update = updater.update(args.ghidra_repo)
if not did_update:
print("No update required")
elif args.dry_run:
print("Update would be required!")
else:
print("Update required!")
except Exception as e:
print(f"Error: {e}", file=sys.stderr)
sys.exit(1)
if __name__ == "__main__":
main()
+203
View File
@@ -0,0 +1,203 @@
#
# Copyright (c) 2022-present, Trail of Bits, Inc.
# All rights reserved.
#
# This source code is licensed in accordance with the terms specified in
# the LICENSE file found in the root directory of this source tree.
#
cmake_minimum_required(VERSION 3.18)
include(../cmake/prelude.cmake)
include(../src/setup-ghidra-source.cmake)
project(sleigh_specs
VERSION "${ghidra_version}"
DESCRIPTION "Sleigh specifications"
HOMEPAGE_URL "https://github.com/lifting-bits/sleigh"
# Language is for installing the helper CMake file
LANGUAGES CXX
)
include(../cmake/project-is-top-level.cmake)
# This is the root directory where all individual processor spec file directories will be created.
if(NOT DEFINED spec_files_build_dir)
set(spec_files_build_dir "${CMAKE_CURRENT_BINARY_DIR}/specfiles")
endif()
# This prefix should match the Ghidra repo to where the sla spec files are located
set(spec_files_dir_prefix "Ghidra/Processors")
# This is where we will be copying the generated artifacts for each processor
set(spec_files_root_dir "${spec_files_build_dir}/${spec_files_dir_prefix}")
set(spec_files_build_log_dir "${CMAKE_CURRENT_BINARY_DIR}/spec_build_logs")
add_custom_command(
OUTPUT "${spec_files_build_log_dir}"
COMMAND ${CMAKE_COMMAND} -E make_directory "${spec_files_build_log_dir}"
)
# Get the native machine's sleigh compiler or use the one we're about to build
# if not cross compiling
if(CMAKE_CROSSCOMPILING)
find_program(
SLEIGH_EXECUTABLE sleigh
DOC "Path to host system sleigh compiler"
REQUIRED
)
else()
# Try to find/acquire or bootstrap the sleigh spec compiler
# Logic is repeated in example/CMakeLists.txt
if(NOT TARGET sleigh::sleigh)
find_package(sleigh QUIET)
if(NOT sleigh_FOUND OR NOT TARGET sleigh::sleigh)
find_program(
SLEIGH_EXECUTABLE sleigh
DOC "Path to host system sleigh compiler"
)
if(NOT SLEIGH_EXECUTABLE)
message(WARNING "Could not find sleigh compiler, building from source")
set(saved_skip_install_rules "${CMAKE_SKIP_INSTALL_RULES}")
set(CMAKE_SKIP_INSTALL_RULES TRUE)
add_subdirectory(../tools/spec-compiler spec-compiler EXCLUDE_FROM_ALL)
set(CMAKE_SKIP_INSTALL_RULES "${saved_skip_install_rules}")
endif()
endif()
endif()
endif()
if(SLEIGH_EXECUTABLE)
set(sleigh_compiler "${SLEIGH_EXECUTABLE}")
else()
set(sleigh_compiler "$<TARGET_FILE:sleigh::sleigh>")
endif()
# Start processing all `.slaspec` files individually
set(spec_targets)
set(spec_files)
set(spec_dirs)
include(../cmake/modules/sleighCompile.cmake)
# Example: '<ghidra_source_prefix>/Ghidra/Processors/8051/data/languages/mx51.slaspec'
foreach(spec_file ${spec_file_list})
# Get 'mx51'
get_filename_component(spec_name "${spec_file}" NAME_WLE)
# Get '<ghidra_source_prefix>/Ghidra/Processors/8051/data/languages'
get_filename_component(spec_dir "${spec_file}" DIRECTORY)
# Get '8051/data/languages'
file(RELATIVE_PATH spec_proc_dir
"${ghidrasource_SOURCE_DIR}/${spec_files_dir_prefix}"
"${spec_dir}"
)
# Add relative spec processor directory for later processing
list(APPEND spec_dirs ${spec_proc_dir})
# Get '8051'
get_filename_component(proc_name "${spec_proc_dir}" DIRECTORY)
get_filename_component(proc_name "${proc_name}" DIRECTORY)
set(spec_build_log "${spec_files_build_log_dir}/${spec_name}_build.log")
# Combine back again for the build directory output like
# '<build_prefix>/Ghidra/Processors/8051/data/languages'
set(spec_out_dir "${spec_files_root_dir}/${spec_proc_dir}")
# '<build_prefix>/Ghidra/Processors/8051/data/languages/mx51.sla'
set(spec_out "${spec_out_dir}/${spec_name}.sla")
string(REPLACE "." "_" spec_target_name ${spec_name})
set(spec_target "sleigh_spec_${spec_target_name}")
# Compile the sla file
sleigh_compile(
TARGET "${spec_target}"
COMPILER "${sleigh_compiler}"
SLASPEC "${spec_file}"
LOG_FILE "${spec_build_log}"
OUT_FILE "${spec_out}"
)
add_dependencies(${spec_target} sleigh_copy_${proc_name}_dir)
list(APPEND spec_targets ${spec_target})
list(APPEND spec_files ${spec_out})
endforeach()
# Copy and create specfile directories
list(REMOVE_DUPLICATES spec_dirs)
foreach(spec_dir ${spec_dirs})
set(spec_src_dir "${ghidrasource_SOURCE_DIR}/${spec_files_dir_prefix}/${spec_dir}")
set(spec_out_dir "${spec_files_root_dir}/${spec_dir}")
# Get the processor directory name
get_filename_component(proc_name "${spec_dir}" DIRECTORY)
get_filename_component(proc_name "${proc_name}" DIRECTORY)
# Copy all other files from the slaspec source directory:
# '<ghidra_source_prefix>/Ghidra/Processors/8051/data/languages'
# NOTE: This only copies the directory once, so you will need to remove the
# whole directory if you update any of the other files, like '*.cspec' or
# '*.ldef' files
# CMake only guarantees update monitoring for files listed explicitly
add_custom_command(
OUTPUT "${spec_out_dir}"
COMMAND ${CMAKE_COMMAND} -E copy_directory "${spec_src_dir}" "${spec_out_dir}"
)
add_custom_target(sleigh_copy_${proc_name}_dir
DEPENDS "${spec_out_dir}"
)
endforeach()
# All of the sla spec targets are combined into this one
add_custom_target(sleigh_all_sla_specs ALL DEPENDS
${spec_targets}
)
if(NOT CMAKE_SKIP_INSTALL_RULES)
include(GNUInstallDirs)
# Specfiles installation setup
set(sleigh_INSTALL_DATADIR "${CMAKE_INSTALL_DATADIR}/sleigh"
CACHE PATH "sleigh data installation location relative to the install prefix"
)
mark_as_advanced(sleigh_INSTALL_DATADIR)
set(sleigh_INSTALL_SPECDIR "${sleigh_INSTALL_DATADIR}/specfiles"
CACHE PATH "sleigh specfile root destination relative to the install prefix"
)
mark_as_advanced(sleigh_INSTALL_SPECDIR)
# Install the compiled sla files found in 'Ghidra' top-level directory
install(
DIRECTORY "${spec_files_build_dir}/"
DESTINATION "${sleigh_INSTALL_SPECDIR}"
COMPONENT sleigh_Runtime
)
set(
sleigh_INSTALL_CMAKEDIR "${CMAKE_INSTALL_LIBDIR}/cmake/sleigh"
CACHE PATH "CMake package config location relative to the install prefix"
)
mark_as_advanced(sleigh_INSTALL_CMAKEDIR)
include(CMakePackageConfigHelpers)
configure_package_config_file(specfiles.cmake.in
"${PROJECT_BINARY_DIR}/specfiles.cmake"
INSTALL_DESTINATION "${sleigh_INSTALL_CMAKEDIR}"
NO_CHECK_REQUIRED_COMPONENTS_MACRO
PATH_VARS sleigh_INSTALL_SPECDIR
)
install(
FILES "${PROJECT_BINARY_DIR}/specfiles.cmake"
DESTINATION "${sleigh_INSTALL_CMAKEDIR}"
COMPONENT sleigh_Development
)
if(PROJECT_IS_TOP_LEVEL)
include(CPack)
endif()
endif()
+12
View File
@@ -0,0 +1,12 @@
#
# Copyright (c) 2022-present, Trail of Bits, Inc.
# All rights reserved.
#
# This source code is licensed in accordance with the terms specified in
# the LICENSE file found in the root directory of this source tree.
#
@PACKAGE_INIT@
# Path relative-root to reach installed specfiles directory
set_and_check(sleigh_INSTALL_SPECDIR "@PACKAGE_sleigh_INSTALL_SPECDIR@")
+21 -21
View File
@@ -1,45 +1,45 @@
# Ghidra Source code
This project uses CMake's [FetchContent](https://cmake.org/cmake/help/latest/module/FetchContent.html) module to set up the Ghidra source tree. This means we can apply [patches](../patches) that live only in this repo for small changes to features like packaging or running tests.
This project uses CMake's [FetchContent](https://cmake.org/cmake/help/latest/module/FetchContent.html) module to set up the Ghidra source tree. Using `FetchContent` means we can apply [patches](patches) that live only in this repo for minor changes that affect usage, packaging, or running tests.
By default, CMake pulls a stable version of Ghidra. You may use a more recent commit by specifying `-Dsleigh_GHIDRA_RELEASE_TYPE=HEAD` during CMake configuration.
See the `sleigh_GHIDRA_*` CMake cache variable comments for more details on how to customize your Ghidra source checkout.
By default, CMake pulls a stable version of Ghidra. During CMake configuration, you may use a more recent commit by specifying `-Dsleigh_RELEASE_TYPE=HEAD`.
## Advanced Usage Notes
Always reference the [CMake Documentation](https://cmake.org/cmake/help/latest/) for explanation of features and cache variable usages/effects.
Always reference the [CMake Documentation](https://cmake.org/cmake/help/latest/) and check CMake cache variables with `ccmake build` to discover all available options.
### Using your own Ghidra checkout
This method is useful for developing new features on top of the latest commits in Ghidra's default branch. If the commit(s) at the tip of Ghidra's default branch are not supported by this repo, we welcome pull requests to update support and pin that commit.
This method helps develop new features on top of the latest commits in Ghidra's default branch. Please open an issue or pull request if the commit at the tip of Ghidra's default branch does not build.
**Arbitrary Ghidra checkouts are not officially supported.**
**Arbitrary Ghidra checkouts/commits are not officially supported.**
If you want to use your own Ghidra source checkout, then set the following during CMake configuration:
Set the following during CMake configuration if you want to use your own Ghidra source checkout:
* `-Dsleigh_GHIDRA_RELEASE_TYPE=HEAD` if using commits on Ghidra's default branch (`master`) or any branch that may be incompatible with the current stable version.
* `-Dsleigh_RELEASE_TYPE=HEAD` if using commits on Ghidra's default branch (`master`) or any branch that may be incompatible with the current stable version.
* `-DFETCHCONTENT_SOURCE_DIR_GHIDRASOURCE=<path to your own Ghidra source>`. Remember, no existing [patches](../patches/HEAD) will be applied to your own source directory.
* `-DFETCHCONTENT_SOURCE_DIR_GHIDRASOURCE=<path to your own Ghidra source>`. Remember, CMake will not apply any [patches](patches/HEAD) to the specified source directory.
```bash
git clone https://github.com/NationalSecurityAgency/ghidra src/ghidra
cmake -B build-dev-head -S . \
-Dsleigh_GHIDRA_RELEASE_TYPE=HEAD \
-DFETCHCONTENT_SOURCE_DIR_GHIDRASOURCE="$(pwd)/src/ghidra"
-Dsleigh_RELEASE_TYPE=HEAD \
"-DFETCHCONTENT_SOURCE_DIR_GHIDRASOURCE=$PWD/src/ghidra"
```
### Reusing Downloaded Ghidra Source
If you want to share a single Ghidra source checkout/clone for multiple build directories, the [_FetchContent Base Directory_](https://cmake.org/cmake/help/latest/module/FetchContent.html#variable:FETCHCONTENT_BASE_DIR) (`FETCHCONTENT_BASE_DIR`) should encode the build generator name and be located outside of the build directory (the name would look something like `cmake_fc_ghidra_${sleigh_GHIDRA_RELEASE_TYPE}_${CMAKE_GENERATOR}`).
The following scenario is discouraged. It can be brittle if everything does not match up. It is only helpful if you do not want to apply Ghidra source patches yourself.
Initially, this means that every new build generator used for building the project will have to re-download the ghidra source tree, but any subsequent run with an already-initialize generator should be faster and skip the download.
Suppose you want to share a single Ghidra source checkout/clone for multiple build directories. In that case, the _FetchContent Base Directory_ (`FETCHCONTENT_BASE_DIR`) should encode the build generator name and be located outside of the build directory (the name would look something like `cmake_fc_ghidra_${sleigh_RELEASE_TYPE}_${CMAKE_GENERATOR}`).
Initially, this means that every new build generator used for building the project will have to re-download the Ghidra source tree. Still, any subsequent run with an already-initialize generator should be faster and skip the download.
```bash
$ cmake -B build-release -S . -G Ninja \
-DCMAKE_BUILD_TYPE=Release \
-DFETCHCONTENT_BASE_DIR=./src/cmake_fc_ghidra_stable_Ninja
"-DFETCHCONTENT_BASE_DIR=$PWD/src/cmake_fc_ghidra_stable_Ninja"
-- Using Ghidra version 10.0.4 at commit 5b07797
-- Populating ghidrasource
-- Configuring done
@@ -69,7 +69,7 @@ HEAD is now at 5b07797cb Updated 10.0.4 Change History
$ cmake -B build-debug -S . -G Ninja \
-DCMAKE_BUILD_TYPE=Debug \
-DFETCHCONTENT_BASE_DIR=./src/cmake_fc_ghidra_stable_Ninja
"-DFETCHCONTENT_BASE_DIR=$PWD/src/cmake_fc_ghidra_stable_Ninja"
-- Using Ghidra version 10.0.4 at commit 5b07797
-- Populating ghidrasource
-- Configuring done
@@ -88,19 +88,19 @@ $ cmake -B build-debug -S . -G Ninja \
...
```
The above also works when using `HEAD` commit of Ghidra.
The above also works when using the `HEAD` commit of Ghidra.
```bash
$ cmake -B build-head-release -S . -G Ninja \
-DCMAKE_BUILD_TYPE=Release \
-Dsleigh_GHIDRA_RELEASE_TYPE=HEAD \
-DFETCHCONTENT_BASE_DIR=./src/cmake_fc_ghidra_HEAD_Ninja
-Dsleigh_RELEASE_TYPE=HEAD \
"-DFETCHCONTENT_BASE_DIR=$PWD/src/cmake_fc_ghidra_HEAD_Ninja"
...
$ cmake -B build-head-debug -S . -G Ninja \
-DCMAKE_BUILD_TYPE=Debug \
-Dsleigh_GHIDRA_RELEASE_TYPE=HEAD \
-DFETCHCONTENT_BASE_DIR=./src/cmake_fc_ghidra_HEAD_Ninja
-Dsleigh_RELEASE_TYPE=HEAD \
"-DFETCHCONTENT_BASE_DIR=$PWD/src/cmake_fc_ghidra_HEAD_Ninja"
...
```
+46
View File
@@ -0,0 +1,46 @@
#
# Copyright (c) 2022-present, Trail of Bits, Inc.
# All rights reserved.
#
# This source code is licensed in accordance with the terms specified in
# the LICENSE file found in the root directory of this source tree.
#
# Internal settings
option(sleigh_CPUI_RULECOMPILE "Allow user defined dynamic rules")
option(sleigh_CPUI_STATISTICS "Turn on collection of cover and cast statistics")
# Internal debug settings (naming is swapped to help with discoverability in CMake options)
option(sleigh_DEBUG_BLOCKCONSISTENT "Check that block graph structure is consistent")
option(sleigh_DEBUG_DFSVERIFY "Make sure that the block ordering algorithm produces a true depth first traversal of the dominator tree")
option(sleigh_DEBUG_MERGEMULTI "Check for MULTIEQUAL and INDIRECT intersections")
option(sleigh_DEBUG_OPACTION "Turns on all the action tracing facilities")
#
# Common options that can apply to all project targets
#
macro(sleigh_add_optional_defines target visibility)
set(opt_defines "")
if(sleigh_CPUI_RULECOMPILE)
list(APPEND opt_defines "CPUI_RULECOMPILE")
endif()
if(sleigh_CPUI_STATISTICS)
list(APPEND opt_defines "CPUI_STATISTICS")
endif()
if(sleigh_DEBUG_BLOCKCONSISTENT)
list(APPEND opt_defines "BLOCKCONSISTENT_DEBUG")
endif()
if(sleigh_DEBUG_DFSVERIFY)
list(APPEND opt_defines "DFSVERIFY_DEBUG")
endif()
if(sleigh_DEBUG_MERGEMULTI)
list(APPEND opt_defines "MERGEMULTI_DEBUG")
endif()
if(sleigh_DEBUG_OPACTION)
list(APPEND opt_defines "OPACTION_DEBUG")
endif()
if(WIN32)
list(APPEND opt_defines "_WINDOWS")
endif()
target_compile_definitions("${target}" ${visibility} ${opt_defines})
endmacro()
@@ -0,0 +1,120 @@
From 98769d3cd2f417a52559bf68700e2f9f3e7a0e4f 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/7] Fix UBSAN errors in decompiler
Co-authored-by: Alex Cameron <asc@tetsuo.sh>
---
.../src/decompile/cpp/pcodecompile.cc | 18 +++++++++++-------
.../Decompiler/src/decompile/cpp/semantics.cc | 2 ++
.../Decompiler/src/decompile/cpp/semantics.hh | 2 +-
.../src/decompile/cpp/slgh_compile.cc | 2 +-
.../src/decompile/unittests/testfloatemu.cc | 2 +-
5 files changed, 16 insertions(+), 10 deletions(-)
diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/pcodecompile.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/pcodecompile.cc
index a67a3de849..37ba4930e6 100644
--- a/Ghidra/Features/Decompiler/src/decompile/cpp/pcodecompile.cc
+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/pcodecompile.cc
@@ -618,8 +618,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;
- uintb mask = (uintb)2;
- mask = ~(((mask<<(numbits-1))-1) << bitoffset);
+ uintb mask = 0;
+ const int4 masknumbits = sizeof(mask) * 8;
+ if (numbits - 1 < masknumbits && bitoffset < masknumbits)
+ mask = ~(((static_cast<uintb>(2) << (numbits - 1)) - 1) << bitoffset);
if (vn->getSize().getType()==ConstTpl::real) {
// If we know the size of the bitranged varnode, we can
@@ -723,9 +725,6 @@ ExprTree *PcodeCompile::createBitRange(SpecificSymbol *sym,uint4 bitoffset,uint4
}
}
- uintb mask = (uintb)2;
- mask = ((mask<<(numbits-1))-1);
-
if (truncneeded && ((bitoffset % 8)==0)) {
truncshift = bitoffset/8;
bitoffset = 0;
@@ -748,8 +747,13 @@ ExprTree *PcodeCompile::createBitRange(SpecificSymbol *sym,uint4 bitoffset,uint4
appendOp(CPUI_INT_RIGHT,res,bitoffset,4);
if (truncneeded)
appendOp(CPUI_SUBPIECE,res,truncshift,4);
- if (maskneeded)
- appendOp(CPUI_INT_AND,res,mask,finalsize);
+ if (maskneeded) {
+ uintb mask = 0;
+ if (numbits - 1 < sizeof(mask) * 8)
+ mask = static_cast<uintb>(2) << (numbits - 1);
+ --mask;
+ appendOp(CPUI_INT_AND, res, mask, finalsize);
+ }
force_size(res->outvn,ConstTpl(ConstTpl::real,finalsize),*res->ops);
return res;
}
diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/semantics.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/semantics.cc
index 18e2ff8ba1..3bfe29f2ef 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)
{ // Constructor for relative jump constants and uniques
type = tp;
+ select = v_space;
}
ConstTpl::ConstTpl(const_type tp,uintb val)
@@ -56,6 +57,7 @@ ConstTpl::ConstTpl(AddrSpace *sid)
{
type = spaceid;
value.spaceid = sid;
+ select = v_space;
}
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 b53b18797d..b2f043e32d 100644
--- a/Ghidra/Features/Decompiler/src/decompile/cpp/semantics.hh
+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/semantics.hh
@@ -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; }
ConstTpl(const ConstTpl &op2) {
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 75bebffcb0..bf5e7ce681 100644
--- a/Ghidra/Features/Decompiler/src/decompile/cpp/slgh_compile.cc
+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/slgh_compile.cc
@@ -2323,8 +2323,8 @@ string SleighCompile::checkSymbols(SymbolScope *scope)
ostringstream msg;
SymbolTree::const_iterator iter;
for(iter=scope->begin();iter!=scope->end();++iter) {
+ if ((*iter)->getType() != SleighSymbol::label_symbol) continue;
LabelSymbol *sym = (LabelSymbol *)*iter;
- if (sym->getType() != SleighSymbol::label_symbol) continue;
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/unittests/testfloatemu.cc b/Ghidra/Features/Decompiler/src/decompile/unittests/testfloatemu.cc
index 2571f55f1a..fe40e22b1b 100644
--- a/Ghidra/Features/Decompiler/src/decompile/unittests/testfloatemu.cc
+++ b/Ghidra/Features/Decompiler/src/decompile/unittests/testfloatemu.cc
@@ -375,7 +375,7 @@ TEST(float_opTrunc_to_int) {
for(float f:float_test_values) {
// avoid undefined behavior
- if((int64_t)f > std::numeric_limits<int>::max() || (int64_t)f < std::numeric_limits<int>::min())
+ if(f > std::numeric_limits<int>::max() || f < std::numeric_limits<int>::min() || std::isnan(f))
continue;
uintb true_result = ((uintb)(int32_t)f) & 0xffffffff;
uintb encoding = format.getEncoding(f);
--
2.51.1
@@ -1,14 +1,15 @@
From 773dda85b84a03c8795e27f1df87e6024bdb208a Mon Sep 17 00:00:00 2001
From 4e6f277eae589c4f9bceb40337d43384248d272c Mon Sep 17 00:00:00 2001
From: Alex Cameron <asc@tetsuo.sh>
Date: Wed, 3 Aug 2022 20:01:18 +1000
Subject: [PATCH] Use `stroull` instead of `stroul` to parse address offsets
Subject: [PATCH 2/7] Use `stroull` instead of `stroul` to parse address
offsets
---
Ghidra/Features/Decompiler/src/decompile/cpp/space.cc | 7 ++++++-
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 c51e58560..c5cc7541d 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 @@
@@ -17,10 +18,10 @@ index c51e58560..c5cc7541d 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
@@ -277,7 +279,10 @@ uintb AddrSpace::read(const string &s,int4 &size) const
}
}
catch(LowlevelError &err) { // Name doesn't exist
@@ -33,5 +34,5 @@ index c51e58560..c5cc7541d 100644
enddata = (const char *) tmpdata;
if (enddata - s.c_str() == s.size()) { // If no size or offset override
--
2.32.1 (Apple Git-133)
2.51.1
@@ -0,0 +1,28 @@
From 41eb6be342d29d6ff618d06b391bf33209fe8ade 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 3/7] Ignore floating point test due to compilation differences
This test fails on macOS and Windows. I'm unsure whether it's an OS or
compiler issue.
---
.../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.51.1
@@ -0,0 +1,37 @@
From 8aa8bf7a146ab43f5b1b27386667af52269720fd 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 4/7] 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.51.1
@@ -0,0 +1,26 @@
From d9242056b580cc994661c41344c9ad51b636b0e5 Mon Sep 17 00:00:00 2001
From: Eric Kilmer <eric.d.kilmer@gmail.com>
Date: Sat, 8 Feb 2025 17:59:57 -0500
Subject: [PATCH 5/7] decompiler: Fix strict weak ordering TypePartialEnum
This fixes Windows Debug error encountered in testing where it was
complaining about lack of strict weak ordering.
---
Ghidra/Features/Decompiler/src/decompile/cpp/type.cc | 1 +
1 file changed, 1 insertion(+)
diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/type.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/type.cc
index 2d48650e70..4a52633ebf 100644
--- a/Ghidra/Features/Decompiler/src/decompile/cpp/type.cc
+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/type.cc
@@ -2703,6 +2703,7 @@ int4 TypePartialEnum::compareDependency(const Datatype &op) const
{
if (submeta != op.getSubMeta()) return (submeta < op.getSubMeta()) ? -1 : 1;
+ if (parent == &op) return 1; // op is our TypeEnum
TypePartialEnum *tp = (TypePartialEnum *) &op; // Both must be partial
if (parent != tp->parent) return (parent < tp->parent) ? -1 : 1; // Compare absolute pointers
if (offset != tp->offset) return (offset < tp->offset) ? -1 : 1;
--
2.51.1
@@ -0,0 +1,29 @@
From f2fdafbd981a441c35ab243bcb74872febd6bbd4 Mon Sep 17 00:00:00 2001
From: "github-actions[bot]"
<41898282+github-actions[bot]@users.noreply.github.com>
Date: Wed, 25 Feb 2026 02:29:10 +0000
Subject: [PATCH 6/7] decompiler: Fix strict weak ordering PullRecord
When both readOp pointers are null, PullRecord::operator< incorrectly
returns true, violating strict weak ordering (irreflexivity). This is
caught by libc++ debug mode hardening assertions at pullList.sort().
---
Ghidra/Features/Decompiler/src/decompile/cpp/bitfield.cc | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/bitfield.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/bitfield.cc
index add61c741b..3e01d2e045 100644
--- a/Ghidra/Features/Decompiler/src/decompile/cpp/bitfield.cc
+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/bitfield.cc
@@ -1058,7 +1058,7 @@ bool BitFieldPullTransform::PullRecord::operator<(const PullRecord &op2) const
return (readOp->getSeqNum() < op2.readOp->getSeqNum());
}
else if (readOp == (PcodeOp *)0)
- return true;
+ return (op2.readOp != (PcodeOp *)0);
else if (op2.readOp == (PcodeOp *)0)
return false;
return false;
--
2.51.1
@@ -0,0 +1,29 @@
From a44beeb3a2569887c33d2dfd509c0d103bd6c447 Mon Sep 17 00:00:00 2001
From: "github-actions[bot]"
<41898282+github-actions[bot]@users.noreply.github.com>
Date: Wed, 25 Feb 2026 02:43:17 +0000
Subject: [PATCH 7/7] decompiler: Fix strict weak ordering compareFinalOrder
FlowBlock::compareFinalOrder returns true when both blocks have index 0,
violating strict weak ordering (irreflexivity). This is caught by libc++
debug mode hardening assertions during BlockGraph::orderBlocks sort.
---
Ghidra/Features/Decompiler/src/decompile/cpp/block.cc | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/block.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/block.cc
index bf7103d916..2e495d9c3f 100644
--- a/Ghidra/Features/Decompiler/src/decompile/cpp/block.cc
+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/block.cc
@@ -709,7 +709,7 @@ string FlowBlock::typeToName(FlowBlock::block_type bt)
bool FlowBlock::compareFinalOrder(const FlowBlock *bl1,const FlowBlock *bl2)
{
- if (bl1->getIndex() == 0) return true; // Make sure the entry point comes first
+ if (bl1->getIndex() == 0) return (bl2->getIndex() != 0); // Make sure the entry point comes first
if (bl2->getIndex() == 0) return false;
PcodeOp *op1 = bl1->lastOp();
PcodeOp *op2 = bl2->lastOp();
--
2.51.1
@@ -0,0 +1,57 @@
From 8afa7d89a368b358a5493b87804985ed9ac70a2f Mon Sep 17 00:00:00 2001
From: "github-actions[bot]"
<41898282+github-actions[bot]@users.noreply.github.com>
Date: Wed, 25 Feb 2026 20:41:10 +0000
Subject: [PATCH] Fix UBSAN signed left shift errors
Cast signed values to unsigned before left shifting to avoid undefined
behavior when the signed value is negative or when the result cannot be
represented in the signed type.
Fixes runtime errors detected by UndefinedBehaviorSanitizer:
- address.hh sign_extend(): left shift of negative value
- address.hh sign_extend(): left shift cannot be represented in type 'intb'
- slghpatexpress.cc LeftShiftExpression: left shift of negative value
---
Ghidra/Features/Decompiler/src/decompile/cpp/address.hh | 2 +-
.../Features/Decompiler/src/decompile/cpp/slghpatexpress.cc | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/address.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/address.hh
index 45144daf3..0e75c68b8 100644
--- a/Ghidra/Features/Decompiler/src/decompile/cpp/address.hh
+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/address.hh
@@ -544,7 +544,7 @@ inline intb sign_extend(intb val,int4 bit)
{
int4 sa = 8*sizeof(intb) - (bit+1);
- val = (val << sa) >> sa;
+ val = static_cast<intb>(static_cast<uintb>(val) << sa) >> sa;
return val;
}
diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/slghpatexpress.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/slghpatexpress.cc
index 941097859..93cce378a 100644
--- a/Ghidra/Features/Decompiler/src/decompile/cpp/slghpatexpress.cc
+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/slghpatexpress.cc
@@ -969,7 +969,7 @@ intb LeftShiftExpression::getValue(ParserWalker &walker) const
{
intb leftval = getLeft()->getValue(walker);
intb rightval = getRight()->getValue(walker);
- return leftval << rightval;
+ return static_cast<intb>(static_cast<uintb>(leftval) << rightval);
}
intb LeftShiftExpression::getSubValue(const vector<intb> &replace,int4 &listpos) const
@@ -977,7 +977,7 @@ intb LeftShiftExpression::getSubValue(const vector<intb> &replace,int4 &listpos)
{
intb leftval = getLeft()->getSubValue(replace,listpos); // Must be left first
intb rightval = getRight()->getSubValue(replace,listpos);
- return leftval << rightval;
+ return static_cast<intb>(static_cast<uintb>(leftval) << rightval);
}
void LeftShiftExpression::encode(Encoder &encoder) const
--
2.51.1
@@ -0,0 +1,49 @@
From eee198c1cc17bfc8b10609ddc8e03e254d0bac9a Mon Sep 17 00:00:00 2001
From: Eric Kilmer <eric.kilmer@trailofbits.com>
Date: Tue, 21 Apr 2026 10:32:17 -0400
Subject: [PATCH] Use std::stoull instead of std::stoul in scan_number for MSVC
std::stoul returns `unsigned long`, which is 32 bits on MSVC (LLP64) but 64
bits on POSIX LP64. scan_number assigns the result into a `uintb` (uint64_t),
so on Windows any integer literal in a .slaspec file that exceeds 0xFFFFFFFF
throws std::out_of_range, the catch-all returns BADINTEGER, and the sleigh
compiler rejects the spec. Affected specs include 68000/PowerPC/Loongarch/
coldfire/avr32a and others that use 64-bit immediates.
std::stoull returns `unsigned long long` (64 bits on all platforms), matching
the uintb target and the pre-GP-6608 behavior. This mirrors the earlier fix
applied to AddrSpace::read in space.cc.
---
Ghidra/Features/Decompiler/src/decompile/cpp/slghscan.cc | 2 +-
Ghidra/Features/Decompiler/src/decompile/cpp/slghscan.l | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/slghscan.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/slghscan.cc
index f3c1e361..d0217389 100644
--- a/Ghidra/Features/Decompiler/src/decompile/cpp/slghscan.cc
+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/slghscan.cc
@@ -1582,7 +1582,7 @@ int4 scan_number(char *numtext,SLEIGHSTYPE *lval,int4 radix,bool signednum)
{
uintb val;
try {
- val = std::stoul(numtext,(size_t *)0,radix);
+ val = std::stoull(numtext,(size_t *)0,radix);
}
catch(...) {
return BADINTEGER;
diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/slghscan.l b/Ghidra/Features/Decompiler/src/decompile/cpp/slghscan.l
index 1c25962a..29db987b 100644
--- a/Ghidra/Features/Decompiler/src/decompile/cpp/slghscan.l
+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/slghscan.l
@@ -461,7 +461,7 @@ int4 scan_number(char *numtext,SLEIGHSTYPE *lval,int4 radix,bool signednum)
{
uintb val;
try {
- val = std::stoul(numtext,(size_t *)0,radix);
+ val = std::stoull(numtext,(size_t *)0,radix);
}
catch(...) {
return BADINTEGER;
--
2.54.0
@@ -0,0 +1,120 @@
From 31a52c1f29a0fe67956bbefc1b1b01d6c0ccd5b1 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/8] Fix UBSAN errors in decompiler
Co-authored-by: Alex Cameron <asc@tetsuo.sh>
---
.../src/decompile/cpp/pcodecompile.cc | 18 +++++++++++-------
.../Decompiler/src/decompile/cpp/semantics.cc | 2 ++
.../Decompiler/src/decompile/cpp/semantics.hh | 2 +-
.../src/decompile/cpp/slgh_compile.cc | 2 +-
.../src/decompile/unittests/testfloatemu.cc | 2 +-
5 files changed, 16 insertions(+), 10 deletions(-)
diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/pcodecompile.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/pcodecompile.cc
index a67a3de849..37ba4930e6 100644
--- a/Ghidra/Features/Decompiler/src/decompile/cpp/pcodecompile.cc
+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/pcodecompile.cc
@@ -618,8 +618,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;
- uintb mask = (uintb)2;
- mask = ~(((mask<<(numbits-1))-1) << bitoffset);
+ uintb mask = 0;
+ const int4 masknumbits = sizeof(mask) * 8;
+ if (numbits - 1 < masknumbits && bitoffset < masknumbits)
+ mask = ~(((static_cast<uintb>(2) << (numbits - 1)) - 1) << bitoffset);
if (vn->getSize().getType()==ConstTpl::real) {
// If we know the size of the bitranged varnode, we can
@@ -723,9 +725,6 @@ ExprTree *PcodeCompile::createBitRange(SpecificSymbol *sym,uint4 bitoffset,uint4
}
}
- uintb mask = (uintb)2;
- mask = ((mask<<(numbits-1))-1);
-
if (truncneeded && ((bitoffset % 8)==0)) {
truncshift = bitoffset/8;
bitoffset = 0;
@@ -748,8 +747,13 @@ ExprTree *PcodeCompile::createBitRange(SpecificSymbol *sym,uint4 bitoffset,uint4
appendOp(CPUI_INT_RIGHT,res,bitoffset,4);
if (truncneeded)
appendOp(CPUI_SUBPIECE,res,truncshift,4);
- if (maskneeded)
- appendOp(CPUI_INT_AND,res,mask,finalsize);
+ if (maskneeded) {
+ uintb mask = 0;
+ if (numbits - 1 < sizeof(mask) * 8)
+ mask = static_cast<uintb>(2) << (numbits - 1);
+ --mask;
+ appendOp(CPUI_INT_AND, res, mask, finalsize);
+ }
force_size(res->outvn,ConstTpl(ConstTpl::real,finalsize),*res->ops);
return res;
}
diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/semantics.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/semantics.cc
index 18e2ff8ba1..3bfe29f2ef 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)
{ // Constructor for relative jump constants and uniques
type = tp;
+ select = v_space;
}
ConstTpl::ConstTpl(const_type tp,uintb val)
@@ -56,6 +57,7 @@ ConstTpl::ConstTpl(AddrSpace *sid)
{
type = spaceid;
value.spaceid = sid;
+ select = v_space;
}
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 b53b18797d..b2f043e32d 100644
--- a/Ghidra/Features/Decompiler/src/decompile/cpp/semantics.hh
+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/semantics.hh
@@ -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; }
ConstTpl(const ConstTpl &op2) {
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 75bebffcb0..bf5e7ce681 100644
--- a/Ghidra/Features/Decompiler/src/decompile/cpp/slgh_compile.cc
+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/slgh_compile.cc
@@ -2323,8 +2323,8 @@ string SleighCompile::checkSymbols(SymbolScope *scope)
ostringstream msg;
SymbolTree::const_iterator iter;
for(iter=scope->begin();iter!=scope->end();++iter) {
+ if ((*iter)->getType() != SleighSymbol::label_symbol) continue;
LabelSymbol *sym = (LabelSymbol *)*iter;
- if (sym->getType() != SleighSymbol::label_symbol) continue;
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/unittests/testfloatemu.cc b/Ghidra/Features/Decompiler/src/decompile/unittests/testfloatemu.cc
index 2571f55f1a..fe40e22b1b 100644
--- a/Ghidra/Features/Decompiler/src/decompile/unittests/testfloatemu.cc
+++ b/Ghidra/Features/Decompiler/src/decompile/unittests/testfloatemu.cc
@@ -375,7 +375,7 @@ TEST(float_opTrunc_to_int) {
for(float f:float_test_values) {
// avoid undefined behavior
- if((int64_t)f > std::numeric_limits<int>::max() || (int64_t)f < std::numeric_limits<int>::min())
+ if(f > std::numeric_limits<int>::max() || f < std::numeric_limits<int>::min() || std::isnan(f))
continue;
uintb true_result = ((uintb)(int32_t)f) & 0xffffffff;
uintb encoding = format.getEncoding(f);
--
2.54.0
@@ -1,14 +1,15 @@
From b719ae7f3716b303ec0c3d8c79e7d55c7e7cbfdf Mon Sep 17 00:00:00 2001
From 0928d2c8e97646042265cee1d2752514d02d3d4f Mon Sep 17 00:00:00 2001
From: Alex Cameron <asc@tetsuo.sh>
Date: Wed, 3 Aug 2022 20:39:30 +1000
Subject: [PATCH] Use `stroull` instead of `stroul` to parse address offsets
Date: Wed, 3 Aug 2022 20:01:18 +1000
Subject: [PATCH 2/8] Use `stroull` instead of `stroul` to parse address
offsets
---
Ghidra/Features/Decompiler/src/decompile/cpp/space.cc | 7 ++++++-
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 5f07edf8e..b86c9beae 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 @@
@@ -17,10 +18,10 @@ index 5f07edf8e..b86c9beae 100644
+#include <climits>
+
/// Calculate \e highest based on \e addressSize, and \e wordsize.
/// This also calculates the default pointerLowerBound
void AddrSpace::calcScaleMask(void)
@@ -260,7 +262,10 @@ uintb AddrSpace::read(const string &s,int4 &size) const
namespace ghidra {
AttributeId ATTRIB_BASE = AttributeId("base",89);
@@ -277,7 +279,10 @@ uintb AddrSpace::read(const string &s,int4 &size) const
}
}
catch(LowlevelError &err) { // Name doesn't exist
@@ -33,5 +34,5 @@ index 5f07edf8e..b86c9beae 100644
enddata = (const char *) tmpdata;
if (enddata - s.c_str() == s.size()) { // If no size or offset override
--
2.32.1 (Apple Git-133)
2.54.0
@@ -0,0 +1,28 @@
From e08c2cb8c6f49a2127b14ba081f1a5ec600c3cea 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 3/8] 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.54.0
@@ -0,0 +1,37 @@
From b5500258acdee1b2f5dfe603b1da33a7eebf699f 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 4/8] 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.54.0
@@ -0,0 +1,26 @@
From 6d5dbe6ffcfc31468ebbf2299ea72f5ef8abcf15 Mon Sep 17 00:00:00 2001
From: Eric Kilmer <eric.d.kilmer@gmail.com>
Date: Sat, 8 Feb 2025 17:59:57 -0500
Subject: [PATCH 5/8] decompiler: Fix strict weak ordering TypePartialEnum
This fixes Windows Debug error encountered in testing where it was
complaining about lack of strict weak ordering.
---
Ghidra/Features/Decompiler/src/decompile/cpp/type.cc | 1 +
1 file changed, 1 insertion(+)
diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/type.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/type.cc
index e3601d3a99..fcc7b3f250 100644
--- a/Ghidra/Features/Decompiler/src/decompile/cpp/type.cc
+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/type.cc
@@ -2704,6 +2704,7 @@ int4 TypePartialEnum::compareDependency(const Datatype &op) const
{
if (submeta != op.getSubMeta()) return (submeta < op.getSubMeta()) ? -1 : 1;
+ if (parent == &op) return 1; // op is our TypeEnum
TypePartialEnum *tp = (TypePartialEnum *) &op; // Both must be partial
if (parent != tp->parent) return (parent < tp->parent) ? -1 : 1; // Compare absolute pointers
if (offset != tp->offset) return (offset < tp->offset) ? -1 : 1;
--
2.54.0
@@ -0,0 +1,29 @@
From 4fba77dafc00c6a359b21b94be1be8d24db37d39 Mon Sep 17 00:00:00 2001
From: "github-actions[bot]"
<41898282+github-actions[bot]@users.noreply.github.com>
Date: Wed, 25 Feb 2026 02:29:10 +0000
Subject: [PATCH 6/8] decompiler: Fix strict weak ordering PullRecord
When both readOp pointers are null, PullRecord::operator< incorrectly
returns true, violating strict weak ordering (irreflexivity). This is
caught by libc++ debug mode hardening assertions at pullList.sort().
---
Ghidra/Features/Decompiler/src/decompile/cpp/bitfield.cc | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/bitfield.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/bitfield.cc
index add61c741b..3e01d2e045 100644
--- a/Ghidra/Features/Decompiler/src/decompile/cpp/bitfield.cc
+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/bitfield.cc
@@ -1058,7 +1058,7 @@ bool BitFieldPullTransform::PullRecord::operator<(const PullRecord &op2) const
return (readOp->getSeqNum() < op2.readOp->getSeqNum());
}
else if (readOp == (PcodeOp *)0)
- return true;
+ return (op2.readOp != (PcodeOp *)0);
else if (op2.readOp == (PcodeOp *)0)
return false;
return false;
--
2.54.0
@@ -0,0 +1,29 @@
From 60f88f2a93a5b9c7a5a2d6b73b100cf353a6982c Mon Sep 17 00:00:00 2001
From: "github-actions[bot]"
<41898282+github-actions[bot]@users.noreply.github.com>
Date: Wed, 25 Feb 2026 02:43:17 +0000
Subject: [PATCH 7/8] decompiler: Fix strict weak ordering compareFinalOrder
FlowBlock::compareFinalOrder returns true when both blocks have index 0,
violating strict weak ordering (irreflexivity). This is caught by libc++
debug mode hardening assertions during BlockGraph::orderBlocks sort.
---
Ghidra/Features/Decompiler/src/decompile/cpp/block.cc | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/block.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/block.cc
index bf7103d916..2e495d9c3f 100644
--- a/Ghidra/Features/Decompiler/src/decompile/cpp/block.cc
+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/block.cc
@@ -709,7 +709,7 @@ string FlowBlock::typeToName(FlowBlock::block_type bt)
bool FlowBlock::compareFinalOrder(const FlowBlock *bl1,const FlowBlock *bl2)
{
- if (bl1->getIndex() == 0) return true; // Make sure the entry point comes first
+ if (bl1->getIndex() == 0) return (bl2->getIndex() != 0); // Make sure the entry point comes first
if (bl2->getIndex() == 0) return false;
PcodeOp *op1 = bl1->lastOp();
PcodeOp *op2 = bl2->lastOp();
--
2.54.0
@@ -0,0 +1,57 @@
From 7da7356c3093390b99172a4adb1422e057243903 Mon Sep 17 00:00:00 2001
From: "github-actions[bot]"
<41898282+github-actions[bot]@users.noreply.github.com>
Date: Wed, 25 Feb 2026 20:41:10 +0000
Subject: [PATCH 8/8] Fix UBSAN signed left shift errors
Cast signed values to unsigned before left shifting to avoid undefined
behavior when the signed value is negative or when the result cannot be
represented in the signed type.
Fixes runtime errors detected by UndefinedBehaviorSanitizer:
- address.hh sign_extend(): left shift of negative value
- address.hh sign_extend(): left shift cannot be represented in type 'intb'
- slghpatexpress.cc LeftShiftExpression: left shift of negative value
---
Ghidra/Features/Decompiler/src/decompile/cpp/address.hh | 2 +-
.../Features/Decompiler/src/decompile/cpp/slghpatexpress.cc | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/address.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/address.hh
index 510432e5a2..0aaddea035 100644
--- a/Ghidra/Features/Decompiler/src/decompile/cpp/address.hh
+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/address.hh
@@ -587,7 +587,7 @@ inline intb sign_extend(intb val,int4 bit)
{
int4 sa = 8*sizeof(intb) - (bit+1);
- val = (val << sa) >> sa;
+ val = static_cast<intb>(static_cast<uintb>(val) << sa) >> sa;
return val;
}
diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/slghpatexpress.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/slghpatexpress.cc
index 9410978595..93cce378af 100644
--- a/Ghidra/Features/Decompiler/src/decompile/cpp/slghpatexpress.cc
+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/slghpatexpress.cc
@@ -969,7 +969,7 @@ intb LeftShiftExpression::getValue(ParserWalker &walker) const
{
intb leftval = getLeft()->getValue(walker);
intb rightval = getRight()->getValue(walker);
- return leftval << rightval;
+ return static_cast<intb>(static_cast<uintb>(leftval) << rightval);
}
intb LeftShiftExpression::getSubValue(const vector<intb> &replace,int4 &listpos) const
@@ -977,7 +977,7 @@ intb LeftShiftExpression::getSubValue(const vector<intb> &replace,int4 &listpos)
{
intb leftval = getLeft()->getSubValue(replace,listpos); // Must be left first
intb rightval = getRight()->getSubValue(replace,listpos);
- return leftval << rightval;
+ return static_cast<intb>(static_cast<uintb>(leftval) << rightval);
}
void LeftShiftExpression::encode(Encoder &encoder) const
--
2.54.0
+204 -14
View File
@@ -1,4 +1,13 @@
#
# Copyright (c) 2022-present, Trail of Bits, Inc.
# All rights reserved.
#
# This source code is licensed in accordance with the terms specified in
# the LICENSE file found in the root directory of this source tree.
#
# ---- Setup Ghidra Source code ----
include_guard(GLOBAL)
# Set up Ghidra repo human-readable version settings
set(sleigh_RELEASE_TYPE "stable" CACHE
@@ -10,36 +19,58 @@ set_property(CACHE sleigh_RELEASE_TYPE PROPERTY STRINGS "stable" "HEAD")
# **** Setup pinned git info ****
find_package(Git REQUIRED)
# Ghidra pinned stable version commit
set(ghidra_version "10.1.5")
set(ghidra_version "12.1.2")
set(ghidra_git_tag "Ghidra_${ghidra_version}_build")
set(ghidra_shallow TRUE)
set(sleigh_ADDITIONAL_PATCHES "" CACHE STRING
"The accepted patch format is git patch files, to be applied via git am. The format of the list is a CMake semicolon separated list.")
# See this thread for more details https://github.community/t/github-actions-bot-email-address/17204/5
set(ghidra_patch_user "github-actions[bot]")
set(ghidra_patch_email "41898282+github-actions[bot]@users.noreply.github.com")
# pinned stable patches list
set(ghidra_patches
PATCH_COMMAND git am --ignore-space-change --ignore-whitespace --no-gpg-sign
"${CMAKE_CURRENT_SOURCE_DIR}/patches/stable/0001-Small-improvements-to-C-decompiler-testing-from-CLI.patch"
"${CMAKE_CURRENT_SOURCE_DIR}/patches/stable/0002-Add-include-guards-to-decompiler-C-headers.patch"
"${CMAKE_CURRENT_SOURCE_DIR}/patches/stable/0003-Fix-UBSAN-errors-in-decompiler.patch"
"${CMAKE_CURRENT_SOURCE_DIR}/patches/stable/0004-Use-stroull-instead-of-stroul-to-parse-address-offse.patch"
PATCH_COMMAND "${GIT_EXECUTABLE}" config user.name "${ghidra_patch_user}" &&
"${GIT_EXECUTABLE}" config user.email "${ghidra_patch_email}" &&
"${GIT_EXECUTABLE}" config core.longpaths true &&
"${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-Ignore-floating-point-test-due-to-compilation-differ.patch"
"${CMAKE_CURRENT_LIST_DIR}/patches/stable/0004-Allow-positive-or-negative-NAN-in-decompiler-floatin.patch"
"${CMAKE_CURRENT_LIST_DIR}/patches/stable/0005-decompiler-Fix-strict-weak-ordering-TypePartialEnum.patch"
"${CMAKE_CURRENT_LIST_DIR}/patches/stable/0006-decompiler-Fix-strict-weak-ordering-PullRecord.patch"
"${CMAKE_CURRENT_LIST_DIR}/patches/stable/0007-decompiler-Fix-strict-weak-ordering-compareFinalOrde.patch"
"${CMAKE_CURRENT_LIST_DIR}/patches/stable/0008-Fix-UBSAN-signed-left-shift-errors.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.2")
set(ghidra_head_version "12.2")
set(ghidra_version "${ghidra_head_version}")
set(ghidra_head_git_tag "cef30890ec3611434c28bc0dd0bff0cae5a753b8")
set(ghidra_head_git_tag "6e8d599d520e5bf42d556d8d2a4871744063a641")
set(ghidra_git_tag "${ghidra_head_git_tag}")
set(ghidra_shallow FALSE)
set(ghidra_patches
PATCH_COMMAND git am --ignore-space-change --ignore-whitespace --no-gpg-sign
"${CMAKE_CURRENT_SOURCE_DIR}/patches/HEAD/0001-Small-improvements-to-C-decompiler-testing-from-CLI.patch"
"${CMAKE_CURRENT_SOURCE_DIR}/patches/HEAD/0002-Initialize-ID-lookup-tables-to-fix-sleighexample.patch"
"${CMAKE_CURRENT_SOURCE_DIR}/patches/HEAD/0003-Add-include-guards-to-decompiler-C-headers.patch"
"${CMAKE_CURRENT_SOURCE_DIR}/patches/HEAD/0004-Fix-UBSAN-errors-in-decompiler.patch"
"${CMAKE_CURRENT_SOURCE_DIR}/patches/HEAD/0005-Use-stroull-instead-of-stroul-to-parse-address-offse.patch"
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-Fix-UBSAN-errors-in-decompiler.patch"
"${CMAKE_CURRENT_LIST_DIR}/patches/HEAD/0002-Use-stroull-instead-of-stroul-to-parse-address-offse.patch"
"${CMAKE_CURRENT_LIST_DIR}/patches/HEAD/0003-Ignore-floating-point-test-due-to-compilation-differ.patch"
"${CMAKE_CURRENT_LIST_DIR}/patches/HEAD/0004-Allow-positive-or-negative-NAN-in-decompiler-floatin.patch"
"${CMAKE_CURRENT_LIST_DIR}/patches/HEAD/0005-decompiler-Fix-strict-weak-ordering-TypePartialEnum.patch"
"${CMAKE_CURRENT_LIST_DIR}/patches/HEAD/0006-decompiler-Fix-strict-weak-ordering-PullRecord.patch"
"${CMAKE_CURRENT_LIST_DIR}/patches/HEAD/0007-decompiler-Fix-strict-weak-ordering-compareFinalOrde.patch"
"${CMAKE_CURRENT_LIST_DIR}/patches/HEAD/0008-Fix-UBSAN-signed-left-shift-errors.patch"
"${CMAKE_CURRENT_LIST_DIR}/patches/HEAD/0009-Use-std-stoull-instead-of-std-stoul-in-scan_number-f.patch"
)
string(SUBSTRING "${ghidra_git_tag}" 0 7 ghidra_short_commit)
else()
@@ -73,3 +104,162 @@ set(library_root "${ghidrasource_SOURCE_DIR}/Ghidra/Features/Decompiler/src/deco
if(NOT EXISTS "${library_root}/sleigh.hh")
message(FATAL_ERROR "The Ghidra source directory has not been initialized correctly. Could not find '${library_root}'")
endif()
# Source collection variables
set(sleigh_core_source_list
"${library_root}/xml.cc"
"${library_root}/space.cc"
"${library_root}/float.cc"
"${library_root}/address.cc"
"${library_root}/pcoderaw.cc"
"${library_root}/translate.cc"
"${library_root}/opcodes.cc"
"${library_root}/globalcontext.cc"
"${library_root}/marshal.cc"
)
# if("${sleigh_RELEASE_TYPE}" STREQUAL "HEAD")
# list(APPEND sleigh_core_source_list
# )
# endif()
set(sleigh_deccore_source_list
"${library_root}/capability.cc"
"${library_root}/architecture.cc"
"${library_root}/options.cc"
"${library_root}/graph.cc"
"${library_root}/cover.cc"
"${library_root}/block.cc"
"${library_root}/cast.cc"
"${library_root}/typeop.cc"
"${library_root}/database.cc"
"${library_root}/cpool.cc"
"${library_root}/comment.cc"
"${library_root}/stringmanage.cc"
"${library_root}/fspec.cc"
"${library_root}/action.cc"
"${library_root}/loadimage.cc"
"${library_root}/grammar.cc"
"${library_root}/varnode.cc"
"${library_root}/op.cc"
"${library_root}/type.cc"
"${library_root}/variable.cc"
"${library_root}/varmap.cc"
"${library_root}/jumptable.cc"
"${library_root}/emulate.cc"
"${library_root}/emulateutil.cc"
"${library_root}/flow.cc"
"${library_root}/userop.cc"
"${library_root}/funcdata.cc"
"${library_root}/funcdata_block.cc"
"${library_root}/funcdata_op.cc"
"${library_root}/funcdata_varnode.cc"
"${library_root}/pcodeinject.cc"
"${library_root}/heritage.cc"
"${library_root}/prefersplit.cc"
"${library_root}/rangeutil.cc"
"${library_root}/ruleaction.cc"
"${library_root}/subflow.cc"
"${library_root}/blockaction.cc"
"${library_root}/merge.cc"
"${library_root}/double.cc"
"${library_root}/transform.cc"
"${library_root}/coreaction.cc"
"${library_root}/condexe.cc"
"${library_root}/override.cc"
"${library_root}/dynamic.cc"
"${library_root}/crc32.cc"
"${library_root}/prettyprint.cc"
"${library_root}/printlanguage.cc"
"${library_root}/printc.cc"
"${library_root}/printjava.cc"
"${library_root}/memstate.cc"
"${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"
"${library_root}/expression.cc"
"${library_root}/bitfield.cc"
)
# if("${sleigh_RELEASE_TYPE}" STREQUAL "HEAD")
# list(APPEND sleigh_deccore_source_list
# )
# endif()
set(sleigh_extra_source_list
"${library_root}/callgraph.cc"
"${library_root}/ifacedecomp.cc"
"${library_root}/ifaceterm.cc"
"${library_root}/inject_sleigh.cc"
"${library_root}/interface.cc"
"${library_root}/libdecomp.cc"
"${library_root}/loadimage_xml.cc"
"${library_root}/raw_arch.cc"
"${library_root}/rulecompile.cc"
"${library_root}/sleigh_arch.cc"
"${library_root}/testfunction.cc"
"${library_root}/unify.cc"
"${library_root}/xml_arch.cc"
)
# if("${sleigh_RELEASE_TYPE}" STREQUAL "HEAD")
# list(APPEND sleigh_extra_source_list
# )
# endif()
set(sleigh_source_list
"${library_root}/sleigh.cc"
"${library_root}/pcodeparse.cc"
"${library_root}/pcodecompile.cc"
"${library_root}/sleighbase.cc"
"${library_root}/slghsymbol.cc"
"${library_root}/slghpatexpress.cc"
"${library_root}/slghpattern.cc"
"${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"
"${library_root}/inject_ghidra.cc"
"${library_root}/ghidra_translate.cc"
"${library_root}/loadimage_ghidra.cc"
"${library_root}/typegrp_ghidra.cc"
"${library_root}/database_ghidra.cc"
"${library_root}/ghidra_context.cc"
"${library_root}/cpool_ghidra.cc"
"${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"
"${library_root}/slghparse.cc"
"${library_root}/slghscan.cc"
)
# Include separate file to make it easier to find user-specified compile
# options
include("${CMAKE_CURRENT_LIST_DIR}/compile_options.cmake")
# Sets 'spec_file_list' variable
if(sleigh_RELEASE_IS_HEAD)
include("${CMAKE_CURRENT_LIST_DIR}/spec_files_HEAD.cmake")
else()
include("${CMAKE_CURRENT_LIST_DIR}/spec_files_stable.cmake")
endif()
@@ -9,6 +9,7 @@ set(spec_file_list
"${ghidrasource_SOURCE_DIR}/Ghidra/Processors/8051/data/languages/80251.slaspec"
"${ghidrasource_SOURCE_DIR}/Ghidra/Processors/8051/data/languages/80390.slaspec"
"${ghidrasource_SOURCE_DIR}/Ghidra/Processors/8051/data/languages/8051.slaspec"
"${ghidrasource_SOURCE_DIR}/Ghidra/Processors/8051/data/languages/cip-51.slaspec"
"${ghidrasource_SOURCE_DIR}/Ghidra/Processors/8051/data/languages/mx51.slaspec"
"${ghidrasource_SOURCE_DIR}/Ghidra/Processors/8085/data/languages/8085.slaspec"
"${ghidrasource_SOURCE_DIR}/Ghidra/Processors/AARCH64/data/languages/AARCH64.slaspec"
@@ -28,11 +29,14 @@ 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"
"${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"
@@ -55,7 +59,14 @@ set(spec_file_list
"${ghidrasource_SOURCE_DIR}/Ghidra/Processors/HCS12/data/languages/HC12.slaspec"
"${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/Hexagon/data/languages/hexagon.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"
@@ -67,6 +78,8 @@ set(spec_file_list
"${ghidrasource_SOURCE_DIR}/Ghidra/Processors/MIPS/data/languages/mips32le.slaspec"
"${ghidrasource_SOURCE_DIR}/Ghidra/Processors/MIPS/data/languages/mips64be.slaspec"
"${ghidrasource_SOURCE_DIR}/Ghidra/Processors/MIPS/data/languages/mips64le.slaspec"
"${ghidrasource_SOURCE_DIR}/Ghidra/Processors/NDS32/data/languages/nds32be.slaspec"
"${ghidrasource_SOURCE_DIR}/Ghidra/Processors/NDS32/data/languages/nds32le.slaspec"
"${ghidrasource_SOURCE_DIR}/Ghidra/Processors/PA-RISC/data/languages/pa-risc32be.slaspec"
"${ghidrasource_SOURCE_DIR}/Ghidra/Processors/PIC/data/languages/PIC24E.slaspec"
"${ghidrasource_SOURCE_DIR}/Ghidra/Processors/PIC/data/languages/PIC24F.slaspec"
@@ -86,6 +99,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"
@@ -97,6 +112,7 @@ set(spec_file_list
"${ghidrasource_SOURCE_DIR}/Ghidra/Processors/PowerPC/data/languages/ppc_64_isa_le.slaspec"
"${ghidrasource_SOURCE_DIR}/Ghidra/Processors/PowerPC/data/languages/ppc_64_isa_vle_be.slaspec"
"${ghidrasource_SOURCE_DIR}/Ghidra/Processors/PowerPC/data/languages/ppc_64_le.slaspec"
"${ghidrasource_SOURCE_DIR}/Ghidra/Processors/RISCV/data/languages/andestar_v5.slaspec"
"${ghidrasource_SOURCE_DIR}/Ghidra/Processors/RISCV/data/languages/riscv.ilp32d.slaspec"
"${ghidrasource_SOURCE_DIR}/Ghidra/Processors/RISCV/data/languages/riscv.lp64d.slaspec"
"${ghidrasource_SOURCE_DIR}/Ghidra/Processors/Sparc/data/languages/SparcV9_32.slaspec"
@@ -110,6 +126,7 @@ set(spec_file_list
"${ghidrasource_SOURCE_DIR}/Ghidra/Processors/TI_MSP430/data/languages/TI_MSP430X.slaspec"
"${ghidrasource_SOURCE_DIR}/Ghidra/Processors/Toy/data/languages/toy64_be.slaspec"
"${ghidrasource_SOURCE_DIR}/Ghidra/Processors/Toy/data/languages/toy64_be_harvard.slaspec"
"${ghidrasource_SOURCE_DIR}/Ghidra/Processors/Toy/data/languages/toy64_be_harvard_rev.slaspec"
"${ghidrasource_SOURCE_DIR}/Ghidra/Processors/Toy/data/languages/toy64_le.slaspec"
"${ghidrasource_SOURCE_DIR}/Ghidra/Processors/Toy/data/languages/toy_be.slaspec"
"${ghidrasource_SOURCE_DIR}/Ghidra/Processors/Toy/data/languages/toy_be_posStack.slaspec"
@@ -121,8 +138,12 @@ 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_be.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"
@@ -9,6 +9,7 @@ set(spec_file_list
"${ghidrasource_SOURCE_DIR}/Ghidra/Processors/8051/data/languages/80251.slaspec"
"${ghidrasource_SOURCE_DIR}/Ghidra/Processors/8051/data/languages/80390.slaspec"
"${ghidrasource_SOURCE_DIR}/Ghidra/Processors/8051/data/languages/8051.slaspec"
"${ghidrasource_SOURCE_DIR}/Ghidra/Processors/8051/data/languages/cip-51.slaspec"
"${ghidrasource_SOURCE_DIR}/Ghidra/Processors/8051/data/languages/mx51.slaspec"
"${ghidrasource_SOURCE_DIR}/Ghidra/Processors/8085/data/languages/8085.slaspec"
"${ghidrasource_SOURCE_DIR}/Ghidra/Processors/AARCH64/data/languages/AARCH64.slaspec"
@@ -28,11 +29,14 @@ 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"
"${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"
@@ -52,8 +56,17 @@ set(spec_file_list
"${ghidrasource_SOURCE_DIR}/Ghidra/Processors/HCS08/data/languages/HC05.slaspec"
"${ghidrasource_SOURCE_DIR}/Ghidra/Processors/HCS08/data/languages/HC08.slaspec"
"${ghidrasource_SOURCE_DIR}/Ghidra/Processors/HCS08/data/languages/HCS08.slaspec"
"${ghidrasource_SOURCE_DIR}/Ghidra/Processors/HCS12/data/languages/HC12.slaspec"
"${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/Hexagon/data/languages/hexagon.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"
@@ -65,6 +78,8 @@ set(spec_file_list
"${ghidrasource_SOURCE_DIR}/Ghidra/Processors/MIPS/data/languages/mips32le.slaspec"
"${ghidrasource_SOURCE_DIR}/Ghidra/Processors/MIPS/data/languages/mips64be.slaspec"
"${ghidrasource_SOURCE_DIR}/Ghidra/Processors/MIPS/data/languages/mips64le.slaspec"
"${ghidrasource_SOURCE_DIR}/Ghidra/Processors/NDS32/data/languages/nds32be.slaspec"
"${ghidrasource_SOURCE_DIR}/Ghidra/Processors/NDS32/data/languages/nds32le.slaspec"
"${ghidrasource_SOURCE_DIR}/Ghidra/Processors/PA-RISC/data/languages/pa-risc32be.slaspec"
"${ghidrasource_SOURCE_DIR}/Ghidra/Processors/PIC/data/languages/PIC24E.slaspec"
"${ghidrasource_SOURCE_DIR}/Ghidra/Processors/PIC/data/languages/PIC24F.slaspec"
@@ -82,6 +97,10 @@ set(spec_file_list
"${ghidrasource_SOURCE_DIR}/Ghidra/Processors/PowerPC/data/languages/ppc_32_4xx_be.slaspec"
"${ghidrasource_SOURCE_DIR}/Ghidra/Processors/PowerPC/data/languages/ppc_32_4xx_le.slaspec"
"${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"
@@ -93,6 +112,7 @@ set(spec_file_list
"${ghidrasource_SOURCE_DIR}/Ghidra/Processors/PowerPC/data/languages/ppc_64_isa_le.slaspec"
"${ghidrasource_SOURCE_DIR}/Ghidra/Processors/PowerPC/data/languages/ppc_64_isa_vle_be.slaspec"
"${ghidrasource_SOURCE_DIR}/Ghidra/Processors/PowerPC/data/languages/ppc_64_le.slaspec"
"${ghidrasource_SOURCE_DIR}/Ghidra/Processors/RISCV/data/languages/andestar_v5.slaspec"
"${ghidrasource_SOURCE_DIR}/Ghidra/Processors/RISCV/data/languages/riscv.ilp32d.slaspec"
"${ghidrasource_SOURCE_DIR}/Ghidra/Processors/RISCV/data/languages/riscv.lp64d.slaspec"
"${ghidrasource_SOURCE_DIR}/Ghidra/Processors/Sparc/data/languages/SparcV9_32.slaspec"
@@ -106,6 +126,7 @@ set(spec_file_list
"${ghidrasource_SOURCE_DIR}/Ghidra/Processors/TI_MSP430/data/languages/TI_MSP430X.slaspec"
"${ghidrasource_SOURCE_DIR}/Ghidra/Processors/Toy/data/languages/toy64_be.slaspec"
"${ghidrasource_SOURCE_DIR}/Ghidra/Processors/Toy/data/languages/toy64_be_harvard.slaspec"
"${ghidrasource_SOURCE_DIR}/Ghidra/Processors/Toy/data/languages/toy64_be_harvard_rev.slaspec"
"${ghidrasource_SOURCE_DIR}/Ghidra/Processors/Toy/data/languages/toy64_le.slaspec"
"${ghidrasource_SOURCE_DIR}/Ghidra/Processors/Toy/data/languages/toy_be.slaspec"
"${ghidrasource_SOURCE_DIR}/Ghidra/Processors/Toy/data/languages/toy_be_posStack.slaspec"
@@ -117,8 +138,12 @@ 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_be.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"
+56 -15
View File
@@ -9,7 +9,7 @@
# Generate the build and install directories to use in the support helpers
configure_file(
"${CMAKE_CURRENT_LIST_DIR}/SpecFilePaths.h.in"
"${CMAKE_CURRENT_BINARY_DIR}/SpecFilePaths.h"
"${CMAKE_CURRENT_BINARY_DIR}/include/sleigh/SpecFilePaths.h"
@ONLY
)
@@ -25,7 +25,7 @@ set(POST_CONFIGURE_FILE "${CMAKE_CURRENT_BINARY_DIR}/Version.cpp")
set(GIT_STATE_FILE "${CMAKE_CURRENT_BINARY_DIR}/git-state-sleigh")
set(GIT_WORKING_DIR "${PROJECT_SOURCE_DIR}")
set(GIT_FAIL_IF_NONZERO_EXIT OFF)
include("${PROJECT_SOURCE_DIR}/cmake/git_watcher.cmake")
include("../cmake/git_watcher.cmake")
# Generate GHIDRA version helpers
configure_file(
@@ -34,26 +34,67 @@ configure_file(
@ONLY
)
add_library(support
add_library(sleigh_support
Support.cpp
"${POST_CONFIGURE_FILE}"
"${CMAKE_CURRENT_BINARY_DIR}/GhidraVersion.cpp"
)
add_library(sleigh::support ALIAS sleigh_support)
# Need to explicitly add this dependency because BYPRODUCTS doesn't work under
# CMake 3.16 with GNU Makefiles
add_dependencies(support check_git)
add_dependencies(sleigh_support check_git)
add_library(sleigh::support ALIAS support)
target_compile_features(support PUBLIC
cxx_std_17
target_compile_features(sleigh_support PUBLIC cxx_std_17)
set_target_properties(sleigh_support PROPERTIES
EXPORT_NAME support
OUTPUT_NAME slaSupport
)
target_include_directories(sleigh_support
${warning_guard}
PUBLIC
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>"
)
target_include_directories(sleigh_support
SYSTEM
PUBLIC
"$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/include>"
# For libconfig.h
"$<BUILD_INTERFACE:${PROJECT_BINARY_DIR}/include>"
)
set_target_properties(support PROPERTIES
INTERFACE_POSITION_INDEPENDENT_CODE ON
)
if(NOT CMAKE_SKIP_INSTALL_RULES)
if(PROJECT_IS_TOP_LEVEL)
set(CMAKE_INSTALL_INCLUDEDIR include/sleigh CACHE PATH "")
endif()
target_include_directories(support PRIVATE
"$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>"
"$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/support>"
)
include(GNUInstallDirs)
install(
TARGETS sleigh_support
EXPORT sleighSupportTargets
RUNTIME #
COMPONENT sleigh_SupportRuntime
LIBRARY #
COMPONENT sleigh_SupportRuntime
NAMELINK_COMPONENT sleigh_SupportDevelopment
ARCHIVE #
COMPONENT sleigh_SupportDevelopment
INCLUDES DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}"
)
install(
DIRECTORY
include/
"${CMAKE_CURRENT_BINARY_DIR}/include/"
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}"
COMPONENT sleigh_SupportDevelopment
)
install(
EXPORT sleighSupportTargets
DESTINATION "${sleigh_INSTALL_CMAKEDIR}"
NAMESPACE sleigh::
COMPONENT sleigh_SupportDevelopment
)
endif()
+2 -2
View File
@@ -6,7 +6,7 @@
the LICENSE file found in the root directory of this source tree.
*/
#include "Version.h"
#include "sleigh/Version.h"
namespace sleigh {
@@ -15,7 +15,7 @@ std::string_view GetGhidraVersion(void) { return "@ghidra_version@"; }
std::string_view GetGhidraCommitHash(void) { return "@ghidra_git_tag@"; }
std::string_view GetGhidraReleaseType(void) {
return "@sleigh_GHIDRA_RELEASE_TYPE@";
return "@sleigh_RELEASE_TYPE@";
}
} // namespace sleigh
+4 -2
View File
@@ -10,7 +10,9 @@
namespace sleigh {
static const char *kSleighSpecInstallDir = "@sleigh_SPEC_INSTALL_DIR@";
static const char *kSleighSpecBuildDir = "@sleigh_SPEC_BUILD_DIR@";
static const char *kSleighSpecInstallDir = "@sleigh_INSTALL_SPECDIR@";
static const char *kSleighFullSpecInstallDir =
"@CMAKE_INSTALL_PREFIX@/@sleigh_INSTALL_SPECDIR@";
static const char *kSleighSpecBuildDir = "@spec_files_build_dir@";
} // namespace sleigh
+4 -4
View File
@@ -6,9 +6,9 @@
the LICENSE file found in the root directory of this source tree.
*/
#include "SpecFilePaths.h"
#include "sleigh/Support.h"
#include "Support.h"
#include "sleigh/SpecFilePaths.h"
namespace sleigh {
@@ -18,7 +18,7 @@ std::optional<std::filesystem::path>
FindSpecFileInSearchPath(std::string_view file_name,
std::filesystem::path search_path) {
search_path.append("Ghidra").append("Processors");
// Check whether a SLEIGH installation exists at this path
// Check whether a Sleigh installation exists at this path
if (!std::filesystem::is_directory(search_path)) {
return {};
}
@@ -46,7 +46,7 @@ FindSpecFileInSearchPath(std::string_view file_name,
const std::vector<std::filesystem::path> gDefaultSearchPaths = {
// Derived from the installation
kSleighSpecInstallDir,
kSleighFullSpecInstallDir,
// Derived from the build
kSleighSpecBuildDir,
// Common install locations
+1 -1
View File
@@ -31,7 +31,7 @@
SOFTWARE.
*/
#include "Version.h"
#include "sleigh/Version.h"
namespace sleigh {
+139
View File
@@ -0,0 +1,139 @@
/*
Copyright (c) 2021-present, Trail of Bits, Inc.
All rights reserved.
This source code is licensed in accordance with the terms specified in
the LICENSE file found in the root directory of this source tree.
*/
#include <sleigh/libconfig.h>
#pragma once
#ifndef _MSC_VER
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated"
#pragma GCC diagnostic ignored "-Wsign-compare"
#pragma GCC diagnostic ignored "-Wunused-parameter"
#endif
#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 <ghidra/slghparse.hh>
} // End namespace ghidra
#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
#endif
#include <sleigh/Support.h>
#include <sleigh/Version.h>
+84
View File
@@ -0,0 +1,84 @@
#
# Copyright (c) 2022-present, Trail of Bits, Inc.
# All rights reserved.
#
# This source code is licensed in accordance with the terms specified in
# the LICENSE file found in the root directory of this source tree.
#
#
# Tests from ghidra repo
#
add_executable(sleigh_decomp_test
${sleigh_core_source_list}
${sleigh_deccore_source_list}
${sleigh_source_list}
${sleigh_extra_source_list}
"${library_root}/test.cc"
"${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"
"${library_root}/../unittests/testparamstore.cc"
)
if(sleigh_RELEASE_IS_HEAD)
target_sources(sleigh_decomp_test PRIVATE
"${library_root}/../unittests/testmultiprec.cc"
)
endif()
target_compile_features(sleigh_decomp_test PRIVATE cxx_std_11)
target_include_directories(sleigh_decomp_test PRIVATE "${library_root}")
include(CheckIncludeFileCXX)
check_include_file_cxx(termios.h HAVE_TERMIOS_H)
if(HAVE_TERMIOS_H)
target_compile_definitions(sleigh_decomp_test PRIVATE
__TERMINAL__
)
endif()
sleigh_add_optional_defines(sleigh_decomp_test PRIVATE)
target_link_libraries(sleigh_decomp_test PRIVATE ZLIB::ZLIB)
add_test(
NAME sleigh_decomp_unittest
COMMAND sleigh_decomp_test -sleighpath "${PROJECT_BINARY_DIR}" unittests
)
add_test(
NAME sleigh_decomp_datatest
COMMAND sleigh_decomp_test -sleighpath "${PROJECT_BINARY_DIR}"
-path "${library_root}/../datatests"
datatests
)
#
# Test for removal of using namespace std patches
#
if(sleigh_BUILD_SUPPORT)
add_executable(sleigh_namespace_std_test
no_using_namespace_std.cpp
)
target_link_libraries(sleigh_namespace_std_test
PRIVATE
sleigh::sla
sleigh::decomp
sleigh::support
)
if(WIN32)
# Ensure no issue with /permissive- and std::byte colliding deeply in the
# sleigh headers when compiling against Windows headers
target_compile_features(sleigh_namespace_std_test PRIVATE cxx_std_20)
endif()
# Really only testing that it compiles
add_test(
NAME sleigh_namespace_std_test
COMMAND sleigh_namespace_std_test
)
endif()
+2 -2
View File
@@ -6,10 +6,10 @@
# the LICENSE file found in the root directory of this source tree.
#
cmake_minimum_required(VERSION 3.15.0)
cmake_minimum_required(VERSION 3.18)
project("sleigh_find_package_test")
find_package(sleigh REQUIRED)
find_package(sleigh REQUIRED COMPONENTS Support)
add_executable(sleigh_test
src/main.cpp
+13
View File
@@ -0,0 +1,13 @@
struct vector {};
struct set {};
struct unordered_map {};
struct string {};
#include <sleigh/libsleigh.hh>
int main() {
vector v;
set s;
unordered_map m;
string str;
}
+28 -2
View File
@@ -1,9 +1,35 @@
#
# Copyright (c) 2021-present, Trail of Bits, Inc.
# Copyright (c) 2022-present, Trail of Bits, Inc.
# All rights reserved.
#
# This source code is licensed in accordance with the terms specified in
# the LICENSE file found in the root directory of this source tree.
#
add_subdirectory(sleigh-lift)
cmake_minimum_required(VERSION 3.18)
include(../cmake/prelude.cmake)
include(../src/setup-ghidra-source.cmake)
project(sleigh_tools
VERSION "${ghidra_version}"
DESCRIPTION "Sleigh tools"
HOMEPAGE_URL "https://github.com/lifting-bits/sleigh"
LANGUAGES CXX
)
option(sleigh_BUILD_SPECCOMPILER "Build the sleigh spec compiler executable (\"sleigh\")" ON)
option(sleigh_BUILD_DECOMPILER "Build the decompiler executable (\"decomp\")" ON)
option(sleigh_BUILD_GHIDRA "Build the Ghidra executable (\"ghidra\")" ON)
if(sleigh_BUILD_SPECCOMPILER)
add_subdirectory(spec-compiler)
endif()
if(sleigh_BUILD_DECOMPILER)
add_subdirectory(decompiler)
endif()
if(sleigh_BUILD_GHIDRA)
add_subdirectory(ghidra)
endif()
+68
View File
@@ -0,0 +1,68 @@
#
# Copyright (c) 2022-present, Trail of Bits, Inc.
# All rights reserved.
#
# This source code is licensed in accordance with the terms specified in
# the LICENSE file found in the root directory of this source tree.
#
cmake_minimum_required(VERSION 3.18)
include(../../cmake/prelude.cmake)
include(../../src/setup-ghidra-source.cmake)
project(sleigh_decompiler
VERSION "${ghidra_version}"
DESCRIPTION "Sleigh decompiler"
HOMEPAGE_URL "https://github.com/lifting-bits/sleigh"
LANGUAGES CXX
)
include(../../cmake/project-is-top-level.cmake)
add_executable(sleigh_decompiler
${sleigh_core_source_list}
${sleigh_deccore_source_list}
${sleigh_extra_source_list}
${sleigh_source_list}
"${library_root}/consolemain.cc"
)
add_executable(sleigh::decompiler ALIAS sleigh_decompiler)
target_compile_features(sleigh_decompiler PUBLIC cxx_std_11)
target_include_directories(sleigh_decompiler PRIVATE "$<BUILD_INTERFACE:${library_root}>")
include(CheckIncludeFileCXX)
check_include_file_cxx(termios.h HAVE_TERMIOS_H)
if(HAVE_TERMIOS_H)
target_compile_definitions(sleigh_decompiler PRIVATE
__TERMINAL__
)
endif()
target_compile_definitions(sleigh_decompiler PRIVATE
$<$<CONFIG:Debug>:CPUI_DEBUG>
)
sleigh_add_optional_defines(sleigh_decompiler PRIVATE)
set_target_properties(sleigh_decompiler PROPERTIES
EXPORT_NAME decompiler
OUTPUT_NAME decomp
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")
install(
TARGETS sleigh_decompiler
EXPORT sleighTargets
RUNTIME COMPONENT sleigh_Runtime
)
if(PROJECT_IS_TOP_LEVEL)
include(CPack)
endif()
endif()
+64
View File
@@ -0,0 +1,64 @@
#
# Copyright (c) 2022-present, Trail of Bits, Inc.
# All rights reserved.
#
# This source code is licensed in accordance with the terms specified in
# the LICENSE file found in the root directory of this source tree.
#
cmake_minimum_required(VERSION 3.18)
include(../../cmake/prelude.cmake)
include(../../src/setup-ghidra-source.cmake)
project(sleigh_ghidra
VERSION "${ghidra_version}"
DESCRIPTION "Sleigh ghidra service"
HOMEPAGE_URL "https://github.com/lifting-bits/sleigh"
LANGUAGES CXX
)
include(../../cmake/project-is-top-level.cmake)
add_executable(sleigh_ghidra
${sleigh_core_source_list}
${sleigh_deccore_source_list}
${sleigh_ghidra_source_list}
"$<$<CONFIG:Debug>:${library_root}/callgraph.cc>"
"$<$<CONFIG:Debug>:${library_root}/ifacedecomp.cc>"
"$<$<CONFIG:Debug>:${library_root}/ifaceterm.cc>"
"$<$<CONFIG:Debug>:${library_root}/interface.cc>"
"$<$<CONFIG:Debug>:${library_root}/testfunction.cc>"
)
add_executable(sleigh::ghidra ALIAS sleigh_ghidra)
target_compile_features(sleigh_ghidra PUBLIC cxx_std_11)
target_include_directories(sleigh_ghidra PRIVATE "$<BUILD_INTERFACE:${library_root}>")
target_compile_definitions(sleigh_ghidra PRIVATE
$<$<CONFIG:Debug>:CPUI_DEBUG>
)
sleigh_add_optional_defines(sleigh_ghidra PRIVATE)
set_target_properties(sleigh_ghidra PROPERTIES
EXPORT_NAME ghidra
OUTPUT_NAME ghidra
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")
install(
TARGETS sleigh_ghidra
EXPORT sleighTargets
RUNTIME COMPONENT sleigh_Runtime
)
if(PROJECT_IS_TOP_LEVEL)
include(CPack)
endif()
endif()
-36
View File
@@ -1,36 +0,0 @@
#
# Copyright (c) 2021-present, Trail of Bits, Inc.
# All rights reserved.
#
# This source code is licensed in accordance with the terms specified in
# the LICENSE file found in the root directory of this source tree.
#
add_executable(sleigh-lift
src/main.cpp
)
add_executable(sleigh::sleigh-lift ALIAS sleigh-lift)
target_link_libraries(sleigh-lift PRIVATE
sleigh::sla
sleigh::decomp
sleigh::support
)
if(NOT CMAKE_SKIP_INSTALL_RULES)
install(
TARGETS
sleigh-lift
EXPORT
"sleigh"
DESTINATION
"${CMAKE_INSTALL_BINDIR}"
PERMISSIONS
OWNER_READ OWNER_WRITE OWNER_EXECUTE
GROUP_READ GROUP_EXECUTE
WORLD_READ WORLD_EXECUTE
)
endif()
+54
View File
@@ -0,0 +1,54 @@
#
# Copyright (c) 2022-present, Trail of Bits, Inc.
# All rights reserved.
#
# This source code is licensed in accordance with the terms specified in
# the LICENSE file found in the root directory of this source tree.
#
cmake_minimum_required(VERSION 3.18)
include(../../cmake/prelude.cmake)
include(../../src/setup-ghidra-source.cmake)
project(sleigh_sleigh
VERSION "${ghidra_version}"
DESCRIPTION "Sleigh spec compiler"
HOMEPAGE_URL "https://github.com/lifting-bits/sleigh"
LANGUAGES CXX
)
include(../../cmake/project-is-top-level.cmake)
add_executable(sleigh_sleigh
${sleigh_core_source_list}
${sleigh_source_list}
${sleigh_slacomp_source_list}
)
add_executable(sleigh::sleigh ALIAS sleigh_sleigh)
target_compile_features(sleigh_sleigh PUBLIC cxx_std_11)
target_include_directories(sleigh_sleigh PRIVATE "$<BUILD_INTERFACE:${library_root}>")
sleigh_add_optional_defines(sleigh_sleigh PRIVATE)
set_target_properties(sleigh_sleigh PROPERTIES
EXPORT_NAME sleigh
OUTPUT_NAME sleigh
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")
install(
TARGETS sleigh_sleigh
EXPORT sleighTargets
RUNTIME COMPONENT sleigh_Runtime
)
if(PROJECT_IS_TOP_LEVEL)
include(CPack)
endif()
endif()