Skip to content

rayshader/cp2077-json-sdk

Repository files navigation

cp2077-json-sdk

A JavaScript CLI tool to parse C++ of RED4ext.SDK to a custom AST format in JSON.

The purpose of this project is to import data types of the SDK into an SRE (like Ghidra). An import script can be written for your SRE to add data types.

Enums, structs and classes are supported, ignoring functions. Constant values like constexpr should be evaluated when parsing. It will not interpret constant values when they are imported/externally referenced. In such a case, the field constant will be set next to the constant name. You can evaluate the final value with your import script.

Tip

You can write your own import script to support specialized data types.

Usage

  1. Install nodejs
  2. Install pnpm
  3. Clone this repository:
git clone https://github.com/rayshader/cp2077-json-sdk.git
  1. Pull RED4ext.SDK submodule:
git submodule update --init --recursive
  1. Run pnpm install
  2. Run pnpm start
  3. JSON output can be found in types/ directory.

Development

Run pnpm dev to develop and debug this project.

Test

Run pnpm test to check unit tests with Jest.

About

A tool to parse C++ declarations of RED4ext.SDK to AST-like format in JSON.

Topics

Resources

License

Stars

Watchers

Forks