Compare commits

...

253 Commits

Author SHA1 Message Date
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
auto-updater[bot] 0474bbdc17 Update Ghidra HEAD to commit cef30890e (#120)
Bump Ghidra HEAD commit cef30890e

Co-authored-by: pgoodman <pgoodman@users.noreply.github.com>
2022-08-08 09:17:23 -04:00
Alex Cameron ff84f3c8de Add address offset parsing patch (#119)
* Fixes tests on Windows

* Update README for full Windows support
2022-08-03 13:15:56 +00:00
Alex Cameron 2aa04f941e Add UBSAN decompiler fixes to patches (#118) 2022-08-02 09:26:34 -04:00
auto-updater[bot] a057b409fa Update Ghidra HEAD to commit 3aac7dae7 (#117)
Bump Ghidra HEAD commit 3aac7dae7

Co-authored-by: pgoodman <pgoodman@users.noreply.github.com>
2022-08-01 08:35:50 -04:00
Eric Kilmer b3e26db5c3 More complete patch for all files with missing include guard (#116) 2022-07-29 15:35:44 -04:00
Eric Kilmer 01cf5e5240 Fix wrong CMake cache variable in CI (#115)
Make real fixes to sleigh-lift
2022-07-29 14:33:12 -04:00
Eric Kilmer 8a0ad2de4a Update to Ghidra stable 10.1.5 (#114)
https://github.com/NationalSecurityAgency/ghidra/releases/tag/Ghidra_10.1.5_build
2022-07-29 10:22:45 -04:00
Eric Kilmer e6cfbacd67 Update CMake minimum to 3.18
Errors with Ghidra repo FetchContent when using CMake less than this
version. FetchContent runs the patch step before update and so we lose
the patches, which can cause build errors.

CMake 3.15 can still be used if you specify your own Ghidra repo on the
command line.
2022-07-28 15:40:05 -04:00
Eric Kilmer 66a6b7c472 Update libsleigh single-header include list 2022-07-28 09:28:13 -04:00
ekilmer 70bbd6ce0b Bump Ghidra HEAD commit 75ae8b3
Add new source file marshal.cc and header marshal.hh

Big changes for supporting stable and HEAD

Conditional compilation based on whether sleigh is HEAD version

Expose CMake variable to determine if version is HEAD
2022-07-27 14:49:35 -04:00
Artem Dinaburg 5ee2f2c162 Fix SLEIGH rebuilds (#111)
* Fix additional_patches cache variable type to default to empty string

Co-authored-by: Eric Kilmer <eric.d.kilmer@gmail.com>
2022-07-21 13:20:20 -04:00
2over12 08b2fdbe4b Allow external patches and expose more headers (#104)
* fix gitwatcher for external inclusion

Co-authored-by: Alex Cameron <asc@tetsuo.sh>
2022-07-20 16:05:40 +00:00
Eric Kilmer 60f5ab437c Add missing headers (#107)
* Update stable headers list

* Add HEAD-only headers

This should really be automated
2022-06-30 15:49:37 +10:00
auto-updater[bot] b8609d4673 Update Ghidra HEAD to commit d2883bbb8 (#102)
Bump Ghidra HEAD commit d2883bbb8

Co-authored-by: pgoodman <pgoodman@users.noreply.github.com>
2022-06-20 15:07:09 +10:00
auto-updater[bot] 52bb4a54d6 Update Ghidra HEAD to commit 849c6d195 (#101)
Bump Ghidra HEAD commit 849c6d195

Co-authored-by: pgoodman <pgoodman@users.noreply.github.com>
2022-06-13 08:48:06 -04:00
dependabot[bot] ed9eb2e521 build(deps): bump actions/setup-python from 3 to 4 (#100)
Bumps [actions/setup-python](https://github.com/actions/setup-python) from 3 to 4.
- [Release notes](https://github.com/actions/setup-python/releases)
- [Commits](https://github.com/actions/setup-python/compare/v3...v4)

---
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>
2022-06-09 09:11:21 -04:00
auto-updater[bot] c6cf5f3728 Update Ghidra HEAD to commit c6cb8a0d8 (#99)
Bump Ghidra HEAD commit c6cb8a0d8

Co-authored-by: pgoodman <pgoodman@users.noreply.github.com>
2022-06-05 21:39:05 -04:00
Eric Kilmer 78c2acabdc Update to Ghidra stable 10.1.4 2022-06-03 13:58:35 -04:00
auto-updater[bot] 4ebe036cff Update Ghidra HEAD to commit 7a30cefeb (#98)
Bump Ghidra HEAD commit 7a30cefeb

Co-authored-by: pgoodman <pgoodman@users.noreply.github.com>
2022-05-30 23:15:58 +10:00
auto-updater[bot] e1c8562ed7 Update Ghidra HEAD to commit f672ba46b (#96)
Bump Ghidra HEAD commit f672ba46b

Co-authored-by: pgoodman <pgoodman@users.noreply.github.com>
2022-05-23 12:43:52 +10:00
Eric Kilmer c7419e7392 Windows support (#85)
* CI: Enable Windows testing

* Fix compilation error on Windows

* Remove compiler warnings as errors

* Move tests to the last step to upload Windows binaries

* Add test for find_package testing in Windows

Makes testing it easier for multi-config generators
2022-05-17 14:49:57 -04:00
auto-updater[bot] 7836647885 Bump Ghidra HEAD commit fafbaacd5 (#94)
Co-authored-by: pgoodman <pgoodman@users.noreply.github.com>
2022-05-16 10:40:46 +10:00
auto-updater[bot] 7f25d7fdb8 Bump Ghidra HEAD commit f249abfac (#91)
Co-authored-by: pgoodman <pgoodman@users.noreply.github.com>
2022-05-09 09:55:34 -04:00
auto-updater[bot] 15ec40ea1b Bump Ghidra HEAD commit f9e7e2cfc (#90)
Co-authored-by: pgoodman <pgoodman@users.noreply.github.com>
2022-05-02 10:51:32 +10:00
63 changed files with 3266 additions and 1553 deletions
+132 -97
View File
@@ -3,15 +3,15 @@ name: Build
on:
push:
branches:
- '*'
- "*"
# Version tags should start with "v"
tags:
- 'v*'
- "v*"
pull_request:
branches:
- '*'
- "*"
jobs:
build:
@@ -20,12 +20,12 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
os: [ubuntu-latest, macos-latest, windows-latest]
build_type: [RelWithDebInfo, Debug]
release: [stable, HEAD]
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,113 +37,152 @@ 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.15.0/cmake-3.15.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'
uses: nick-fields/retry@v3
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@v4
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 }}"
shell: cmake -P {0}
run: |
file(MAKE_DIRECTORY "${{ github.workspace }}/ccache")
file(APPEND "$ENV{GITHUB_ENV}" "CCACHE_BASEDIR=${{ github.workspace }}\n")
file(APPEND "$ENV{GITHUB_ENV}" "CCACHE_DIR=${{ github.workspace }}/ccache\n")
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")
# Trial and error to get all files in here
file(APPEND "$ENV{GITHUB_ENV}" "CCACHE_COMPRESSLEVEL=10\n")
# 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)
- name: CMake version
run: cmake --version
- name: Configure the project
run: |
cmake --version
cmake \
-S . \
-B build \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
-Dsleigh_GHIDRA_RELEASE_TYPE=${{ matrix.release }} \
-Dsleigh_ENABLE_TESTS=ON \
-Dsleigh_ENABLE_EXAMPLES=ON \
-Dsleigh_ENABLE_PACKAGING=ON \
-Dsleigh_ENABLE_DOCUMENTATION=ON
shell: pwsh
run: cmake "--preset=ci-$("${{ matrix.os }}".split("-")[0])"
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
-Dsleigh_RELEASE_TYPE=${{ matrix.release }}
"-DCMAKE_PROJECT_INCLUDE:FILEPATH=${{ github.workspace }}/cmake/ccache-msvc.cmake"
-DCMAKE_MSVC_DEBUG_INFORMATION_FORMAT=Embedded
- name: Build the project
run: |
cmake \
--build build \
-j 2 \
-v
run: cmake
--build build
--config ${{ matrix.build_type }}
-j 4
-v
- name: Run the tests
run: |
( cd build && ctest -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 \
--target sleighexample_runner
run: cmake
--build build
-j 4
--config ${{ matrix.build_type }}
--target sleigh_example_runner
- name: Run the install target
run: |
cmake --install build \
--prefix install
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
cmake --build build -j 2
./build/sleigh_test
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 }}
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 \
run: cmake
--build build
-j 4
--config ${{ matrix.build_type }}
--target package
- name: Test the DEB package
@@ -151,71 +190,67 @@ jobs:
run: |
sudo dpkg -i build/*.deb
cmake \
-S tests/find_package \
-B find_package_build
cmake \
--build find_package_build -j 2 --verbose
cmake -S tests/find_package -B find_package_build -DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
cmake --build find_package_build -j 4 --config ${{ matrix.build_type }} --verbose
- name: Locate the packages (RelWithDebInfo only)
if: matrix.build_type == 'RelWithDebInfo'
id: package_locations
shell: bash
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@v5
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 }}
- name: Release DEB package artifact (RelWithDebInfo only)
uses: softprops/action-gh-release@v0.1.14
uses: softprops/action-gh-release@v2.5.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 }}
# 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@v5
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 }}
- name: Release RPM package artifact (RelWithDebInfo only)
uses: softprops/action-gh-release@v0.1.14
uses: softprops/action-gh-release@v2.5.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 }}
# TGZ Package
- name: Upload the TGZ package artifact (RelWithDebInfo only)
if: matrix.build_type == 'RelWithDebInfo'
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v5
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 }}
- name: Release TGZ package artifact (RelWithDebInfo only)
uses: softprops/action-gh-release@v0.1.14
uses: softprops/action-gh-release@v2.5.0
if: matrix.build_type == 'RelWithDebInfo' && startsWith(github.ref, 'refs/tags/') && matrix.release == 'stable'
with:
files: ${{ steps.package_locations.outputs.TGZ_PACKAGE_PATH }}
files: ${{ env.TGZ_PACKAGE_PATH }}
- name: ccache stats
run: ccache -s --verbose
run: ccache -s
+24 -7
View File
@@ -12,22 +12,22 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v6
- uses: actions/setup-python@v3
- 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
- uses: tibdex/github-app-token@v2
if: steps.head_update.outputs.did_update
id: generate-token
with:
@@ -36,10 +36,27 @@ jobs:
- name: Create PR
if: steps.head_update.outputs.did_update
uses: peter-evans/create-pull-request@v4
uses: peter-evans/create-pull-request@v7
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 }}
commit-message: |
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 }}
body: |
Changed files:
${{ steps.head_update.outputs.changed_files }}
Commit details:
${{ steps.head_update.outputs.commit_details }}
branch: cron/update-ghidra-${{ steps.head_update.outputs.short_sha }}
delete-branch: true
token: ${{ steps.generate-token.outputs.token }}
+198 -681
View File
@@ -6,393 +6,173 @@
# the LICENSE file found in the root directory of this source tree.
#
cmake_minimum_required(VERSION 3.15)
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
include(src/setup-ghidra-source.cmake)
set(sleigh_RELEASE_IS_HEAD FALSE)
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"
"${library_root}/block.hh"
"${library_root}/blockaction.hh"
"${library_root}/callgraph.hh"
"${library_root}/capability.hh"
"${library_root}/cast.hh"
"${library_root}/codedata.hh"
"${library_root}/comment.hh"
"${library_root}/comment_ghidra.hh"
"${library_root}/condexe.hh"
"${library_root}/context.hh"
"${library_root}/coreaction.hh"
"${library_root}/cover.hh"
"${library_root}/cpool.hh"
"${library_root}/cpool_ghidra.hh"
"${library_root}/crc32.hh"
"${library_root}/database.hh"
"${library_root}/database_ghidra.hh"
"${library_root}/doccore.hh"
"${library_root}/docmain.hh"
"${library_root}/double.hh"
"${library_root}/dynamic.hh"
"${library_root}/emulate.hh"
"${library_root}/emulateutil.hh"
"${library_root}/error.hh"
"${library_root}/filemanage.hh"
"${library_root}/float.hh"
"${library_root}/flow.hh"
"${library_root}/fspec.hh"
"${library_root}/funcdata.hh"
"${library_root}/ghidra_arch.hh"
"${library_root}/ghidra_context.hh"
"${library_root}/ghidra_process.hh"
"${library_root}/ghidra_translate.hh"
"${library_root}/globalcontext.hh"
"${library_root}/grammar.hh"
"${library_root}/graph.hh"
"${library_root}/heritage.hh"
"${library_root}/ifacedecomp.hh"
"${library_root}/ifaceterm.hh"
"${library_root}/inject_ghidra.hh"
"${library_root}/inject_sleigh.hh"
"${library_root}/interface.hh"
"${library_root}/jumptable.hh"
"${library_root}/libdecomp.hh"
"${library_root}/loadimage.hh"
"${library_root}/loadimage_ghidra.hh"
"${library_root}/loadimage_xml.hh"
"${library_root}/memstate.hh"
"${library_root}/merge.hh"
"${library_root}/op.hh"
"${library_root}/opbehavior.hh"
"${library_root}/opcodes.hh"
"${library_root}/options.hh"
"${library_root}/override.hh"
"${library_root}/paramid.hh"
"${library_root}/partmap.hh"
"${library_root}/pcodecompile.hh"
"${library_root}/pcodeinject.hh"
"${library_root}/pcodeparse.hh"
"${library_root}/pcoderaw.hh"
"${library_root}/prefersplit.hh"
"${library_root}/prettyprint.hh"
"${library_root}/printc.hh"
"${library_root}/printjava.hh"
"${library_root}/printlanguage.hh"
"${library_root}/rangemap.hh"
"${library_root}/rangeutil.hh"
"${library_root}/raw_arch.hh"
"${library_root}/ruleaction.hh"
"${library_root}/rulecompile.hh"
"${library_root}/semantics.hh"
"${library_root}/sleigh.hh"
"${library_root}/sleigh_arch.hh"
"${library_root}/sleighbase.hh"
"${library_root}/slgh_compile.hh"
"${library_root}/slghparse.hh"
"${library_root}/slghpatexpress.hh"
"${library_root}/slghpattern.hh"
"${library_root}/slghsymbol.hh"
"${library_root}/space.hh"
"${library_root}/string_ghidra.hh"
"${library_root}/stringmanage.hh"
"${library_root}/subflow.hh"
"${library_root}/testfunction.hh"
"${library_root}/transform.hh"
"${library_root}/translate.hh"
"${library_root}/type.hh"
"${library_root}/typegrp_ghidra.hh"
"${library_root}/typeop.hh"
"${library_root}/types.h"
"${library_root}/unify.hh"
"${library_root}/userop.hh"
"${library_root}/variable.hh"
"${library_root}/varmap.hh"
"${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"
)
if(sleigh_RELEASE_IS_HEAD)
list(APPEND public_include_header_list
"${library_root}/expression.hh"
)
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")
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"
)
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_GHIDRA_RELEASE_TYPE}" STREQUAL "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)
target_compile_definitions(decomp_opt PRIVATE
__TERMINAL__
)
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}>)
target_compile_definitions(ghidra_test_dbg PRIVATE
__TERMINAL__
)
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}
@@ -402,377 +182,114 @@ add_library(sla
"${library_root}/emulate.cc"
"${library_root}/opbehavior.cc"
)
add_library(sleigh::sla ALIAS sla)
add_library(sleigh::sla ALIAS sleigh_sla)
target_link_libraries(sla PUBLIC
sleigh::sleigh_settings
)
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)
add_library(sleigh::decomp ALIAS sleigh_decomp)
target_link_libraries(decomp PUBLIC
sleigh::sleigh_settings
)
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(NOT "${sleigh_GHIDRA_RELEASE_TYPE}" STREQUAL "HEAD")
include(spec-files-list/spec_files_stable.cmake)
else()
include(spec-files-list/spec_files_HEAD.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(
FILES
${public_include_header_list}
DESTINATION
${CMAKE_INSTALL_INCLUDEDIR}/sleigh
)
# 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)
+135
View File
@@ -0,0 +1,135 @@
{
"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-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
+29 -30
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
@@ -10,7 +10,7 @@ This repository provides a CMake-based build project for SLEIGH so that it can b
| ---- | ------- |
| Linux | Yes |
| macOS | Yes |
| Windows | Not yet |
| Windows | Yes |
## Dependencies and Prerequisites
@@ -18,8 +18,9 @@ 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.21+ | cmake | cmake |
| [CMake](https://cmake.org/) | 3.18+ | cmake | cmake |
**NOTE**: This CMake project pulls the Ghidra source code from the internet during configuration. See the [note on Ghidra source code section](#note-on-ghidra-source-code) for more details.
@@ -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
)
+49 -3
View File
@@ -1,9 +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@
# 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")
# Path relative-root to reach installed specfiles directory
set_and_check(sleigh_INSTALL_SPECDIR "@PACKAGE_sleigh_INSTALL_SPECDIR@")
# 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()
+19
View File
@@ -0,0 +1,19 @@
/*
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
#cmakedefine sleigh_RELEASE_IS_HEAD
#cmakedefine sleigh_VERSION "@sleigh_VERSION@"
#cmakedefine sleigh_VERSION_MAJOR @sleigh_VERSION_MAJOR@
#cmakedefine sleigh_VERSION_MINOR @sleigh_VERSION_MINOR@
#cmakedefine sleigh_VERSION_PATCH @sleigh_VERSION_PATCH@
#cmakedefine sleigh_VERSION_TWEAK @sleigh_VERSION_TWEAK@
#endif
+1 -1
View File
@@ -6,7 +6,7 @@
# the LICENSE file found in the root directory of this source tree.
#
cmake_minimum_required(VERSION 3.15)
cmake_minimum_required(VERSION 3.18)
# Takes the following required arguments:
#
+28 -13
View File
@@ -6,21 +6,34 @@
# 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")
# ---- 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")
# 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()
# Additional internal settings
option(sleigh_CPUI_STATISTICS "Turn on collection of cover and cast statistics")
option(sleigh_CPUI_RULECOMPILE "Allow user defined dynamic rules")
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 ----
@@ -29,12 +42,14 @@ option(sleigh_CPUI_RULECOMPILE "Allow user defined dynamic rules")
# This is to provide a user experience similar to find_package when
# add_subdirectory or FetchContent is used to consume this project
set(warning_guard "")
if(NOT PROJECT_IS_TOP_LEVEL)
option(sleigh_INCLUDES_WITH_SYSTEM
"Use SYSTEM modifier for sleigh's includes, disabling warnings"
ON
)
mark_as_advanced(sleigh_INCLUDES_WITH_SYSTEM)
if(sleigh_INCLUDES_WITH_SYSTEM)
set(warning_guard SYSTEM)
endif()
+28 -31
View File
@@ -7,48 +7,45 @@
#
set(PACKAGE_VERSION 1)
if("${sleigh_GHIDRA_RELEASE_TYPE}" STREQUAL "HEAD")
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 and is used to describe microprocessors with enough detail to facilitate two major components of GHIDRA, the disassembly and decompilation engines.")
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 "NSA")
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;
}
}
}
@@ -199,10 +221,10 @@ std::optional<LiftArgs> ParseArgs(int argc, char *argv[]) {
const char *addr_str = argv[arg_index++];
try {
addr = std::stoul(addr_str);
} catch (const std::invalid_argument &ia) {
} catch (const std::invalid_argument &) {
std::cerr << "Invalid address argument: " << addr_str << std::endl;
return {};
} catch (const std::out_of_range &oor) {
} catch (const std::out_of_range &) {
std::cerr << "Address argument out of range: " << addr_str << std::endl;
return {};
}
@@ -256,12 +278,16 @@ int main(int argc, char *argv[]) {
<< std::endl;
return EXIT_FAILURE;
}
// Put together SLEIGH components
// 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)->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) {
@@ -285,7 +311,8 @@ int main(int argc, char *argv[]) {
}
}
if (pspec_file_path) {
Element *pspec_root = storage.openDocument(*pspec_file_path)->getRoot();
ghidra::Element *pspec_root =
storage.openDocument(pspec_file_path->string())->getRoot();
storage.registerTag(pspec_root);
}
engine.initialize(storage);
@@ -294,19 +321,27 @@ 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) {
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);
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 {
decoder.openElement();
decoder.closeElementSkipping(subId);
}
}
decoder.closeElement(elemId);
}
// 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.
-39
View File
@@ -1,39 +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.
*/
#pragma once
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated"
#pragma GCC diagnostic ignored "-Wsign-compare"
#pragma GCC diagnostic ignored "-Wunused-parameter"
#include "address.hh"
#include "context.hh"
#include "emulate.hh"
#include "error.hh"
#include "float.hh"
#include "globalcontext.hh"
#include "loadimage.hh"
#include "memstate.hh"
#include "opbehavior.hh"
#include "opcodes.hh"
#include "partmap.hh"
#include "pcoderaw.hh"
#include "semantics.hh"
#include "sleigh.hh"
#include "sleighbase.hh"
#include "slghpatexpress.hh"
#include "slghpattern.hh"
#include "slghsymbol.hh"
#include "space.hh"
#include "translate.hh"
#include "types.h"
#include "xml.hh"
#pragma GCC diagnostic pop
#include "Support.h"
#include "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,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
+480 -177
View File
@@ -1,211 +1,514 @@
#!/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 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
]
# 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}")
class GitHelper:
"""Helper class for Git operations"""
def __init__(self) -> None:
self.git_exe = shutil.which("git")
if self.git_exe is None:
raise RuntimeError("Git executable not found in PATH")
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
)
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)
if cmake_version == source_version:
msg(f"No new version bump")
return
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)
# Make the swap with the new content
shutil.copymode(SETUP_GHIDRA_FILE, abspath)
os.remove(SETUP_GHIDRA_FILE)
shutil.move(abspath, SETUP_GHIDRA_FILE)
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()
msg(f"Found {len(spec_files)} slaspec files")
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
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 Java files
commit_files = [f for f in commit_files if not f.endswith(".java")]
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]
) -> List[str]:
"""Get list of files changed between commits"""
result = self.run(
[
"diff",
"--name-status",
f"{old_commit}...{new_commit}",
"--",
*paths,
],
cwd=repo_dir,
capture_output=True,
)
changed_files = result.stdout.strip().splitlines()
# Filter out Java files
changed_files = [f for f in changed_files if not f.endswith(".java")]
return changed_files
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]]]:
"""Display changes between two commits and return the changed files and commit info"""
# Get changed files
changed_files = 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 [], []
# 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}")
# 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))
return changed_files, commit_info
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 9d1e7b00e8f5dca987038a78fbac400c835a78be 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/5] 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 ca9d71ab99..85d4dd281d 100644
--- a/Ghidra/Features/Decompiler/src/decompile/cpp/pcodecompile.cc
+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/pcodecompile.cc
@@ -621,8 +621,10 @@ vector<OpTpl *> *PcodeCompile::assignBitRange(VarnodeTpl *vn,uint4 bitoffset,uin
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
@@ -726,9 +728,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;
@@ -751,8 +750,13 @@ ExprTree *PcodeCompile::createBitRange(SpecificSymbol *sym,uint4 bitoffset,uint4
appendOp(CPUI_INT_RIGHT,res,bitoffset,4);
if (truncneeded)
appendOp(CPUI_SUBPIECE,res,truncshift,4);
- 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 cd9b9835b1..8a4616c3b9 100644
--- a/Ghidra/Features/Decompiler/src/decompile/cpp/semantics.cc
+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/semantics.cc
@@ -22,6 +22,7 @@ ConstTpl::ConstTpl(const_type tp)
{ // 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 e0b069959d..9117a45c75 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 50d85e22ba..9f3b456229 100644
--- a/Ghidra/Features/Decompiler/src/decompile/cpp/slgh_compile.cc
+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/slgh_compile.cc
@@ -2164,8 +2164,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.50.1
@@ -0,0 +1,38 @@
From 729f72060849dc4f29e89b1c76a980563ffd3e2a Mon Sep 17 00:00:00 2001
From: Alex Cameron <asc@tetsuo.sh>
Date: Wed, 3 Aug 2022 20:01:18 +1000
Subject: [PATCH 2/5] 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 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 @@
#include "space.hh"
#include "translate.hh"
+#include <climits>
+
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
- offset = strtoul(s.c_str(),&tmpdata,0);
+ offset = strtoull(s.c_str(),&tmpdata,0);
+ if (offset == ULLONG_MAX) {
+ throw LowlevelError("Offset outside of valid range");
+ }
offset = addressToByte(offset,wordsize);
enddata = (const char *) tmpdata;
if (enddata - s.c_str() == s.size()) { // If no size or offset override
--
2.50.1
@@ -0,0 +1,28 @@
From 39cfff6f08dad8a85f992e09b3e26716c9173bf7 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/5] 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.50.1
@@ -0,0 +1,37 @@
From 2aa4395ef8874ee9890126f4bdad0d71adf9eacc 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/5] 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.50.1
@@ -0,0 +1,26 @@
From 2a6bd0a0ad7797160db887bba7137b77aa148ba5 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/5] 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 962c525b7f..7db5024b54 100644
--- a/Ghidra/Features/Decompiler/src/decompile/cpp/type.cc
+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/type.cc
@@ -2303,6 +2303,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.50.1
+1 -1
View File
@@ -1,6 +1,6 @@
# Ghidra Patches
This directory contains small patches that should not affect any deployed Ghidra sleigh functionality from its original intent.
This directory contains small patches that do not affect any deployed Ghidra sleigh functionality from its original intent unless otherwise specified.
These patches primarily support packaging and testing, or fixing critical issues that prevent building for one reason or another.
@@ -0,0 +1,224 @@
From 2eb1eb2999fb55204fdffb7469380dadb3e7a25a Mon Sep 17 00:00:00 2001
From: Eric Kilmer <eric.d.kilmer@gmail.com>
Date: Mon, 12 Aug 2024 12:02:35 -0400
Subject: [PATCH 1/6] Fix UBSAN errors in decompiler
Co-authored-by: Alex Cameron <asc@tetsuo.sh>
---
.../Decompiler/src/decompile/cpp/fspec.cc | 8 ++++++--
.../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 | 12 +++++++++---
.../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/type.cc | 2 +-
.../src/decompile/unittests/testfloatemu.cc | 2 +-
10 files changed, 44 insertions(+), 18 deletions(-)
diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/fspec.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/fspec.cc
index cafce3f7ba..b696fe6879 100644
--- a/Ghidra/Features/Decompiler/src/decompile/cpp/fspec.cc
+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/fspec.cc
@@ -2893,8 +2893,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/op.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/op.cc
index a62ee56fc3..66bcd48db0 100644
--- a/Ghidra/Features/Decompiler/src/decompile/cpp/op.cc
+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/op.cc
@@ -666,7 +666,11 @@ uintb PcodeOp::getNZMaskLocal(bool cliploop) const
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 aebcfd9103..6c47e6eb15 100644
--- a/Ghidra/Features/Decompiler/src/decompile/cpp/opbehavior.cc
+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/opbehavior.cc
@@ -746,7 +746,13 @@ uintb OpBehaviorPiece::evaluateBinary(int4 sizeout,int4 sizein,uintb in1,uintb i
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 < 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 ca9d71ab99..85d4dd281d 100644
--- a/Ghidra/Features/Decompiler/src/decompile/cpp/pcodecompile.cc
+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/pcodecompile.cc
@@ -621,8 +621,10 @@ vector<OpTpl *> *PcodeCompile::assignBitRange(VarnodeTpl *vn,uint4 bitoffset,uin
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
@@ -726,9 +728,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;
@@ -751,8 +750,13 @@ ExprTree *PcodeCompile::createBitRange(SpecificSymbol *sym,uint4 bitoffset,uint4
appendOp(CPUI_INT_RIGHT,res,bitoffset,4);
if (truncneeded)
appendOp(CPUI_SUBPIECE,res,truncshift,4);
- 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 8df64ca548..1bd96ea3df 100644
--- a/Ghidra/Features/Decompiler/src/decompile/cpp/ruleaction.cc
+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/ruleaction.cc
@@ -976,7 +976,12 @@ int4 RulePullsubIndirect::applyOp(PcodeOp *op,Funcdata &data)
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;
@@ -7298,8 +7303,9 @@ int4 RulePtrsubCharConstant::applyOp(PcodeOp *op,Funcdata &data)
Varnode *sb = op->getIn(0);
Datatype *sbType = sb->getTypeReadFacing(op);
if (sbType->getMetatype() != TYPE_PTR) return 0;
- 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();
diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/semantics.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/semantics.cc
index cd9b9835b1..8a4616c3b9 100644
--- a/Ghidra/Features/Decompiler/src/decompile/cpp/semantics.cc
+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/semantics.cc
@@ -22,6 +22,7 @@ ConstTpl::ConstTpl(const_type tp)
{ // 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 e0b069959d..9117a45c75 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 50d85e22ba..9f3b456229 100644
--- a/Ghidra/Features/Decompiler/src/decompile/cpp/slgh_compile.cc
+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/slgh_compile.cc
@@ -2164,8 +2164,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/type.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/type.cc
index f00502ba65..7ff2ab7606 100644
--- a/Ghidra/Features/Decompiler/src/decompile/cpp/type.cc
+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/type.cc
@@ -3731,8 +3731,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 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.50.1
@@ -0,0 +1,38 @@
From da383f3b96085349e80b4de6fcb3ed7e88a00a05 Mon Sep 17 00:00:00 2001
From: Alex Cameron <asc@tetsuo.sh>
Date: Wed, 3 Aug 2022 20:01:18 +1000
Subject: [PATCH 2/6] Use `stroull` instead of `stroul` to parse address
offsets
---
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 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 @@
#include "space.hh"
#include "translate.hh"
+#include <climits>
+
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
- offset = strtoul(s.c_str(),&tmpdata,0);
+ offset = strtoull(s.c_str(),&tmpdata,0);
+ if (offset == ULLONG_MAX) {
+ throw LowlevelError("Offset outside of valid range");
+ }
offset = addressToByte(offset,wordsize);
enddata = (const char *) tmpdata;
if (enddata - s.c_str() == s.size()) { // If no size or offset override
--
2.50.1
@@ -0,0 +1,36 @@
From 61ab4b5c63c33aa7c522f6e217e7ab9e01c0b956 Mon Sep 17 00:00:00 2001
From: Eric Kilmer <eric.d.kilmer@gmail.com>
Date: Tue, 29 Oct 2024 15:30:57 -0400
Subject: [PATCH 3/6] Use string resize instead of reserve
assign will fix up the size to hold all of what's copied
---
Ghidra/Features/Decompiler/src/decompile/cpp/stringmanage.cc | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/stringmanage.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/stringmanage.cc
index 5f5fa0c7b3..4cd77156f2 100644
--- a/Ghidra/Features/Decompiler/src/decompile/cpp/stringmanage.cc
+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/stringmanage.cc
@@ -67,7 +67,6 @@ void StringManager::assignStringData(StringData &data,const uint1 *buf,int4 size
{
if (charsize == 1 && numChars < maximumChars) {
- data.byteData.reserve(size);
data.byteData.assign(buf,buf+size);
}
else {
@@ -77,9 +76,9 @@ void StringManager::assignStringData(StringData &data,const uint1 *buf,int4 size
return;
string resString = s.str();
int4 newSize = resString.size();
- data.byteData.reserve(newSize + 1);
const uint1 *ptr = (const uint1 *)resString.c_str();
data.byteData.assign(ptr,ptr+newSize);
+ data.byteData.resize(newSize + 1, 0);
data.byteData[newSize] = 0; // Make sure there is a null terminator
}
data.isTruncated = (numChars >= maximumChars);
--
2.50.1
@@ -0,0 +1,28 @@
From af4f89efce38c924bfc342dfa51507a03177fcf4 Mon Sep 17 00:00:00 2001
From: Eric Kilmer <eric.d.kilmer@gmail.com>
Date: Tue, 29 Oct 2024 17:51:09 -0400
Subject: [PATCH 4/6] Ignore floating point test due to compilation differences
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.50.1
@@ -0,0 +1,37 @@
From 997a83bdf0c562bcc110682177937b0a3f386fdc Mon Sep 17 00:00:00 2001
From: Eric Kilmer <eric.d.kilmer@gmail.com>
Date: Wed, 30 Oct 2024 14:26:57 -0400
Subject: [PATCH 5/6] Allow positive or negative NAN in decompiler floating
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.50.1
@@ -0,0 +1,26 @@
From 7de365659e8a4068106c43eeb7e7dd923726a9e2 Mon Sep 17 00:00:00 2001
From: Eric Kilmer <eric.d.kilmer@gmail.com>
Date: Sat, 8 Feb 2025 17:59:57 -0500
Subject: [PATCH 6/6] decompiler: Fix strict weak ordering TypePartialEnum
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 7ff2ab7606..aa96671bcd 100644
--- a/Ghidra/Features/Decompiler/src/decompile/cpp/type.cc
+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/type.cc
@@ -2303,6 +2303,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.50.1
+201 -12
View File
@@ -1,42 +1,77 @@
#
# 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_GHIDRA_RELEASE_TYPE "stable" CACHE
STRING "Ghidra release type to use. 'HEAD' is used for active development purposes."
set(sleigh_RELEASE_TYPE "stable" CACHE
STRING "Release type to use. 'HEAD' is used for active development purposes."
)
# This is just helper for CMake UIs. CMake does not enforce that the value matches one of those listed.
set_property(CACHE sleigh_GHIDRA_RELEASE_TYPE PROPERTY STRINGS "stable" "HEAD")
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.3")
set(ghidra_git_tag "Ghidra_10.1.3_build")
set(ghidra_version "11.4.3")
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"
PATCH_COMMAND "${GIT_EXECUTABLE}" config user.name "${ghidra_patch_user}" &&
"${GIT_EXECUTABLE}" config user.email "${ghidra_patch_email}" &&
"${GIT_EXECUTABLE}" am --ignore-space-change --ignore-whitespace --no-gpg-sign
"${CMAKE_CURRENT_LIST_DIR}/patches/stable/0001-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-Use-string-resize-instead-of-reserve.patch"
"${CMAKE_CURRENT_LIST_DIR}/patches/stable/0004-Ignore-floating-point-test-due-to-compilation-differ.patch"
"${CMAKE_CURRENT_LIST_DIR}/patches/stable/0005-Allow-positive-or-negative-NAN-in-decompiler-floatin.patch"
"${CMAKE_CURRENT_LIST_DIR}/patches/stable/0006-decompiler-Fix-strict-weak-ordering-TypePartialEnum.patch"
)
# Ghidra pinned commits used for pinning last known working HEAD commit
if("${sleigh_GHIDRA_RELEASE_TYPE}" STREQUAL HEAD)
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.1")
set(ghidra_version "${ghidra_head_version}")
set(ghidra_head_git_tag "9c04807c8cbf3516ea4ff8c4321bc18d38f27661")
set(ghidra_head_git_tag "14ead1aabcb28546153eb9a582a2275d4601de6d")
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"
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"
)
string(SUBSTRING "${ghidra_git_tag}" 0 7 ghidra_short_commit)
else()
set(ghidra_short_commit "${ghidra_git_tag}")
endif()
list(APPEND ghidra_patches ${sleigh_ADDITIONAL_PATCHES})
message(STATUS "Using Ghidra version ${ghidra_version} at git ref ${ghidra_short_commit}")
include(FetchContent)
@@ -58,6 +93,160 @@ message(STATUS "Ghidra source located at '${ghidrasource_SOURCE_DIR}'")
# Sanity check on Ghidra source code checkout
set(library_root "${ghidrasource_SOURCE_DIR}/Ghidra/Features/Decompiler/src/decompile/cpp")
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"
)
if("${sleigh_RELEASE_TYPE}" STREQUAL "HEAD")
list(APPEND sleigh_deccore_source_list
"${library_root}/expression.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"
"${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()
@@ -28,11 +28,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 +55,16 @@ 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/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"
@@ -82,6 +93,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 +108,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 +122,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 +134,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"
@@ -28,11 +28,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 +55,16 @@ 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/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"
@@ -82,6 +93,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"
@@ -106,6 +121,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 +133,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"
+58 -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
)
@@ -22,8 +22,10 @@ configure_file(
# the source code for watching a git repository.
set(PRE_CONFIGURE_FILE "${CMAKE_CURRENT_LIST_DIR}/Version.cpp.in")
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(
@@ -32,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>
+83
View File
@@ -0,0 +1,83 @@
#
# 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
# )
# 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()
+8 -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
@@ -20,3 +20,9 @@ target_link_libraries(sleigh_test PRIVATE
sleigh::decomp
sleigh::support
)
include(CTest)
add_test(
NAME smoketest
COMMAND sleigh_test
)
+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()
-51
View File
@@ -1,51 +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)
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
if(MSVC)
target_compile_options(sleigh-lift PRIVATE
/W4
/WX
)
else()
target_compile_options(sleigh-lift PRIVATE
-Wall
-Werror
-Wextra
)
endif()
endif()
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()