blaj
blaj is a tool for creating a programmable trainer for speedrunning games. It saves and restores chunks of a game’s memory on a keypress, and can write data to a designated memory location the same way.
Inspiration
Why you built blaj: the practice loop that was too slow, the skip you kept having to reset the whole level to attempt.
How it works
Once a useful piece of game state is located with a memory scanner like Cheat Engine, blaj can save that region and restore it later, teleporting the player back to a particular spot, for example. That turns “reset and replay the level” into a single keypress, so a skip can be drilled consistently instead of once every few minutes.
Configuration lives in plain INI files under C:\Users\<your-user-name>\.blaj.
A [General] section names the target executable, and optional [SaveRestore]
and [Writer] sections define pointers and the keys that trigger them. Each
game gets its own .conf file, which makes configs easy to back up and share.
Pointers are written as a base address followed by a chain of offsets, the same form Cheat Engine displays them in, so a pointer found in Cheat Engine can be transcribed directly:
[General]
exeName = MirrorsEdge.exe
[SaveRestore]
xCoordPointer_4 = 0x01C553D0 0xCC 0x1CC 0x2F8 0xE8
yCoordPointer_4 = 0x01C553D0 0xCC 0x1CC 0x2F8 0xEC
zCoordPointer_4 = 0x01C553D0 0xCC 0x1CC 0x2F8 0xF0
saveState = 4
restoreState = 5The _4 suffix is the number of bytes to save and restore at that location.
Features
- Save and restore values in target process memory
- Write a payload to target process memory using a pointer and offsets
- Trigger memory manipulation with keybinds, so it works with fullscreen games
- Minimal systray application with shark icons showing the status of blaj and the processes it is attached to
- Attach to multiple processes simultaneously
Releases and verification
blaj is Windows-only. Release binaries are signed with Sigstore’s cosign, so a
download can be verified as having been built by the project’s GitHub Actions
workflow and not tampered with since.
Challenges
The parts that fought back: reading another process’s memory, pointer chains that moved, getting keybinds to register from a fullscreen game.
What I learned
What this taught you about process memory, Windows internals, or shipping a tool other people run.
What’s next
Features or fixes you have in mind.