{"id":13831744,"url":"https://github.com/lifting-bits/sleigh","last_synced_at":"2026-02-01T00:27:03.646Z","repository":{"id":36973171,"uuid":"415934955","full_name":"lifting-bits/sleigh","owner":"lifting-bits","description":"Unofficial CMake build for Ghidra's C++ SLEIGH code","archived":false,"fork":false,"pushed_at":"2026-01-23T22:52:00.000Z","size":810,"stargazers_count":170,"open_issues_count":5,"forks_count":22,"subscribers_count":8,"default_branch":"master","last_synced_at":"2026-01-24T11:11:08.732Z","etag":null,"topics":["binary-analysis","cmake","cplusplus","cpp","decompiler","disassembler","ghidra","reverse-engineering","sleigh"],"latest_commit_sha":null,"homepage":"https://lifting-bits.github.io/sleigh/","language":"CMake","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lifting-bits.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":"CODEOWNERS","security":null,"support":"support/CMakeLists.txt","governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2021-10-11T13:18:25.000Z","updated_at":"2026-01-23T22:52:04.000Z","dependencies_parsed_at":"2023-09-25T05:10:58.319Z","dependency_job_id":"e2db4cdc-d038-4178-b890-9da70d2f8aa4","html_url":"https://github.com/lifting-bits/sleigh","commit_stats":{"total_commits":261,"total_committers":12,"mean_commits":21.75,"dds":0.5670498084291188,"last_synced_commit":"6db8a804888655ad7876ad31b63a14a895f6f82e"},"previous_names":[],"tags_count":34,"template":false,"template_full_name":null,"purl":"pkg:github/lifting-bits/sleigh","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lifting-bits%2Fsleigh","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lifting-bits%2Fsleigh/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lifting-bits%2Fsleigh/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lifting-bits%2Fsleigh/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lifting-bits","download_url":"https://codeload.github.com/lifting-bits/sleigh/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lifting-bits%2Fsleigh/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28961824,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-31T23:03:11.038Z","status":"ssl_error","status_checked_at":"2026-01-31T22:56:44.691Z","response_time":128,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["binary-analysis","cmake","cplusplus","cpp","decompiler","disassembler","ghidra","reverse-engineering","sleigh"],"created_at":"2024-08-04T10:01:38.906Z","updated_at":"2026-02-01T00:27:03.640Z","avatar_url":"https://github.com/lifting-bits.png","language":"CMake","readme":"# Sleigh Library\n\n[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.\n\nThis 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.\n\n## Supported Platforms\n\n| Name | Support |\n| ---- | ------- |\n| Linux | Yes |\n| macOS | Yes |\n| Windows | Yes |\n\n## Dependencies and Prerequisites\n\n### Required\n\n| Name | Version | Linux Package to Install | macOS Homebrew Package to Install |\n| ---- | ------- | ------------------------ | --------------------------------- |\n| (HEAD builds) [zlib](https://www.zlib.net/) | Recent | zlib1g-dev | zlib |\n| [Git](https://git-scm.com/) | Latest | git | N/A |\n| [CMake](https://cmake.org/) | 3.18+ | cmake | cmake |\n\n**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.\n\n### Optional\n\nFor building documentation:\n\n| Name | Version | Linux Package to Install | macOS Homebrew Package to Install |\n| ---- | ------- | ------------------------ | --------------------------------- |\n| [Doxygen](https://www.doxygen.nl/) | Latest | doxygen | doxygen |\n| [GraphViz](https://graphviz.org/) | Latest | graphviz | graphviz |\n\n## Build and Install the Sleigh Library\n\n```sh\n# Clone this repository (CMake project for sleigh)\ngit clone https://github.com/lifting-bits/sleigh.git\ncd sleigh\n\n# Configure CMake\ncmake -B build -S .\n\n# Build Sleigh\ncmake --build build --parallel 8\n\n# Install Sleigh\ncmake --install build --prefix ./install\n```\n\n### Note on Ghidra source code\n\nThe 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.\n\nPlease 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.\n\n## Packaging\n\nThe CMake configuration also supports building packages for Sleigh.\n\nFor example:\n\n```sh\n# Package Sleigh\ncmake --build build --target package\n```\n\n## API Usage\n\nAn 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`:\n\n```sh\nsleigh-lift [action] [sla_file] [bytes] [-a address] [-p root_sla_dir] [-s pspec_file]\n```\n\nFor example, to disassemble the following byte string:\n\n```sh\n$ sleigh-lift disassemble x86-64.sla 4881ecc00f0000\n0x00000000: SUB RSP,0xfc0\n```\n\nAnd to lift it to p-code:\n\n```sh\n$ sleigh-lift pcode x86-64.sla 4881ecc00f0000\n(register,0x200,1) = INT_LESS (register,0x20,8) (const,0xfc0,8)\n(register,0x20b,1) = INT_SBORROW (register,0x20,8) (const,0xfc0,8)\n(register,0x20,8) = INT_SUB (register,0x20,8) (const,0xfc0,8)\n(register,0x207,1) = INT_SLESS (register,0x20,8) (const,0x0,8)\n(register,0x206,1) = INT_EQUAL (register,0x20,8) (const,0x0,8)\n(unique,0x12c00,8) = INT_AND (register,0x20,8) (const,0xff,8)\n(unique,0x12c80,1) = POPCOUNT (unique,0x12c00,8)\n(unique,0x12d00,1) = INT_AND (unique,0x12c80,1) (const,0x1,1)\n(register,0x202,1) = INT_EQUAL (unique,0x12d00,1) (const,0x0,1)\n```\n\nIf you do not want to build `sleigh-lift`, you must set the CMake variable `sleigh_BUILD_EXTRATOOLS` option to `OFF` during CMake configuration.\n\n## Helpers\n\nThis 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:\n\n```c++\nstd::optional\u003cstd::filesystem::path\u003e\nFindSpecFile(std::string_view file_name,\n             const std::vector\u003cstd::filesystem::path\u003e \u0026search_paths =\n                 gDefaultSearchPaths);\n```\n\nThe `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.\n\nIf you do not want to build the helpers, you must set the CMake variable `sleigh_BUILD_SUPPORT` option to `OFF` during CMake configuration.\n\n## Integration as a Dependency\n\nAn installation of Sleigh provides a CMake interface that you can use when building your project.\n\nYou can find an example of how to use the CMake package config file in the [find_package](tests/find_package/CMakeLists.txt) example.\n\nWe also provide a CMake helper function [`sleigh_compile`](cmake/modules/sleighCompile.cmake) to compile your `.slaspec` files using a sleigh compiler.\n\nYou 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.\n\nLastly, 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.\n\nReferencing 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.\n\n## License\n\nSee the [LICENSE file](LICENSE).\n","funding_links":[],"categories":["CMake"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flifting-bits%2Fsleigh","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flifting-bits%2Fsleigh","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flifting-bits%2Fsleigh/lists"}