Files
lifting-bits-sleigh/src
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
..
2025-04-22 15:32:07 -04:00
2022-08-22 15:41:53 +10:00
2022-08-22 15:41:53 +10:00
2024-10-29 22:35:41 -04:00

Ghidra Source code

This project uses CMake's FetchContent module to set up the Ghidra source tree. Using FetchContent means we can apply 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. During CMake configuration, you may use a more recent commit by specifying -Dsleigh_RELEASE_TYPE=HEAD.

Advanced Usage Notes

Always reference the CMake Documentation and check CMake cache variables with ccmake build to discover all available options.

Using your own Ghidra checkout

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/commits are not officially supported.

Set the following during CMake configuration if you want to use your own Ghidra source checkout:

  • -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, CMake will not apply any patches to the specified source directory.

git clone https://github.com/NationalSecurityAgency/ghidra src/ghidra

cmake -B build-dev-head -S . \
  -Dsleigh_RELEASE_TYPE=HEAD \
  "-DFETCHCONTENT_SOURCE_DIR_GHIDRASOURCE=$PWD/src/ghidra"

Reusing Downloaded Ghidra Source

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.

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.

$ cmake -B build-release -S . -G Ninja \
    -DCMAKE_BUILD_TYPE=Release \
    "-DFETCHCONTENT_BASE_DIR=$PWD/src/cmake_fc_ghidra_stable_Ninja"
-- Using Ghidra version 10.0.4 at commit 5b07797
-- Populating ghidrasource
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/me/sleigh/src/cmake_fc_ghidra_stable_Ninja/ghidrasource-subbuild
[1/9] Creating directories for 'ghidrasource-populate'
[1/9] Performing download step (git clone) for 'ghidrasource-populate'
Cloning into 'ghidrasource-src'...
remote: Enumerating objects: 129964, done.
remote: Counting objects: 100% (4238/4238), done.
remote: Compressing objects: 100% (1889/1889), done.
remote: Total 129964 (delta 2078), reused 3993 (delta 2038), pack-reused 125726
Receiving objects: 100% (129964/129964), 172.50 MiB | 15.10 MiB/s, done.
Resolving deltas: 100% (79637/79637), done.
HEAD is now at 5b07797cb Updated 10.0.4 Change History
[2/9] Performing update step for 'ghidrasource-populate'
[4/9] No patch step for 'ghidrasource-populate'
[5/9] No configure step for 'ghidrasource-populate'
[6/9] No build step for 'ghidrasource-populate'
[7/9] No install step for 'ghidrasource-populate'
[8/9] No test step for 'ghidrasource-populate'
[9/9] Completed 'ghidrasource-populate'
-- Ghidra source located at '/Users/me/sleigh/src/cmake_fc_ghidra_stable_Ninja/ghidrasource-src'
-- The C compiler identification is AppleClang 13.0.0.13000029
-- The CXX compiler identification is AppleClang 13.0.0.13000029
...

$ cmake -B build-debug -S . -G Ninja \
    -DCMAKE_BUILD_TYPE=Debug \
    "-DFETCHCONTENT_BASE_DIR=$PWD/src/cmake_fc_ghidra_stable_Ninja"
-- Using Ghidra version 10.0.4 at commit 5b07797
-- Populating ghidrasource
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/me/sleigh/src/cmake_fc_ghidra_stable_Ninja/ghidrasource-subbuild
[0/7] Performing update step for 'ghidrasource-populate'
[2/7] No patch step for 'ghidrasource-populate'
[3/7] No configure step for 'ghidrasource-populate'
[4/7] No build step for 'ghidrasource-populate'
[5/7] No install step for 'ghidrasource-populate'
[6/7] No test step for 'ghidrasource-populate'
[7/7] Completed 'ghidrasource-populate'
-- Ghidra source located at '/Users/me/sleigh/src/cmake_fc_ghidra_stable_Ninja/ghidrasource-src'
-- The C compiler identification is AppleClang 13.0.0.13000029
-- The CXX compiler identification is AppleClang 13.0.0.13000029
...

The above also works when using the HEAD commit of Ghidra.

$ cmake -B build-head-release -S . -G Ninja \
    -DCMAKE_BUILD_TYPE=Release \
    -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_RELEASE_TYPE=HEAD \
    "-DFETCHCONTENT_BASE_DIR=$PWD/src/cmake_fc_ghidra_HEAD_Ninja"
...

This setup is nice if you want to clear the project build directories but don't want to re-download Ghidra source code every time. However, to be safe, you should remove these directories if you change the Ghidra git commit SHA of stable or HEAD.