https://github.com/widberg/sinker
https://github.com/widberg/sinker
Last synced: 4 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/widberg/sinker
- Owner: widberg
- Created: 2023-02-19T15:46:28.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2025-09-11T00:25:35.000Z (9 months ago)
- Last Synced: 2025-10-26T23:41:35.116Z (8 months ago)
- Language: C++
- Size: 268 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Sinker
[](https://github.com/widberg/sinker/actions/workflows/tests.yml)
[](https://sinker.readthedocs.io/en/latest/?badge=latest)
[](https://codecov.io/gh/widberg/sinker)
```cpp
//$ symbol game::CoreMainLoop, "void (__stdcall *)()";
//$ tag game::CoreMainLoop, hook;
//$ address game::CoreMainLoop, [retail], @0x00688bf0;
void __stdcall wrap_game_CoreMainLoop() {
BROADCAST(Tick);
// Do stuff before the real game::CoreMainLoop() is called.
real_game_CoreMainLoop();
// Do stuff after the real game::CoreMainLoop() is called.
}
```
Instrument Windows binaries hook, line, and sinker at runtime with this batteries included hook specification and installation suite. [Sinker Script](https://sinker.readthedocs.io/en/latest/sinkerscript.html) is a simple domain-specific language for specifying addresses in a loaded module programmatically. The [Sinker Compiler](https://sinker.readthedocs.io/en/latest/sinkercompiler.html) makes it easy to amalgamate many Sinker Script files and produce `.def` headers for easy use of the Sinker Runtime Library from C++. The [Sinker Runtime Library](https://sinker.readthedocs.io/en/latest/sinkerruntimelibrary.html) installs the specified hooks into a module at runtime.
## Documentation
The documentation is hosted on [Read the Docs](https://sinker.readthedocs.io/en/latest/).
## Getting Started
Instructions on how to include Sinker in your CMake project can be found in the [CMake Integration](https://sinker.readthedocs.io/en/latest/cmakeintegration.html) section of the documentation. I recommend reading the rest of the documentation first to get a feel for how Sinker works.
## Contributing
Instructions on how to build and test the project.
### Prerequisites
* Git
* CMake
* [re2c](https://github.com/skvadrik/re2c) (Optional†)
* Bison or [WinFlexBison](https://github.com/lexxmark/winflexbison) (Optional†)
†Only needed if editing the Sinker Script grammar file.
### Checkout
```sh
git clone https://github.com/widberg/sinker.git --recurse-submodules --shallow-submodules
```
#### Build and Test
```sh
cmake -B build -DSINKER_BUILD_TESTS=ON
cmake --build build --target check-sinker
```