ktastic7/decomp-doctrine
À propos
A portable knowledge-preservation and reproducibility framework for LLM-assisted reverse engineering and decompilation.
Sécurité et confidentialitéProgression mesurée des étoiles
- in 24h
- 0
- in 7 days
- Historique en cours
- in 15 days
- Historique en cours
- in 1 month
- Historique en cours
Variations nettes sur des périodes qui se chevauchent, pas des totaux quotidiens. Les mesures absentes restent vides. Les étoiles indiquent l’intérêt, pas la qualité.
README.md
OriginalDecomp Doctrine
A knowledge-preservation and reproducibility framework for LLM-assisted reverse engineering and decompilation.
[!IMPORTANT] Project scope: This repository contains a general-purpose framework, methodology, prompts, documentation, and templates for preserving knowledge developed during reverse-engineering and decompilation work. It does not distribute proprietary game binaries, game assets, leaked source code, DRM keys, or game-specific reconstructed source code. See PROJECT_SCOPE.md and LEGAL_AND_CONTENT_POLICY.md for the project's boundaries.
Start here: Master Bootstrap Prompt · User / Interaction Guide · Semantic Decompilation Archiving · Lessons from the original Doctrine · License & Attribution
Creating the Rosetta Stone - The Decomp Doctrine - A Tool to Preserve & Enhance Your Work
In my free time I've had a lot of fun using LLMs to help me mod games, and while doing this I wanted to accomplish a few things.
First, I wanted to preserve all the work I was doing with the LLM, partly out of a general paranoia of losing access to my saved chats/progress. I wanted the option of being able to take everything I had done and move it over to a different LLM/model if I ever needed to.
I also wanted it to help me understand how other mods were written and what they were capable of, so I could learn from their work, find bugs/errors that might exist, and potentially patch them myself. I wanted to look for compatibility issues between different mods and make my own mods in ways that didn't conflict with other people's work.
In trying to accomplish all of this, I eventually ended up creating something akin to an Agent script, but considerably more involved.
The closest thing I've found to the system I created is this proposed Agent Memory Architecture:
https://datatracker.ietf.org/doc/html/draft-infantado-agent-memory-architecture-00
What I created is primarily a series of text files that I came to refer to as a "Doctrine." These files can be fed into other LLMs fairly easily, and together they do things like:
- Set down the rules for how I want the LLM to create mods and approach development.
- Preserve the history of the work performed within the Doctrine.
- Follow an Archive-first replacement policy when updating files, so an LLM error or oversight doesn't permanently remove useful information, while also preserving the history of how the project developed.
- Build an encyclopedia of every mod I've had it examine: its features, bugs, how it interacts with the game's libraries, how it integrates with other mods, and mappings of its functions/API calls.
- Preserve that information in both a human-optimized format, so I can learn from it, and an LLM-optimized format, so another model can make effective use of it.
- Preserve enough context that the project can be reconstructed from the text files if necessary, without depending entirely on the original chat history.
- Record what went right, what went wrong, and why, so the same mistakes don't keep getting rediscovered with every new project.
- Record test results, logs, benchmarks, and experiments so it can help determine not only what works, but what works better.
And then I realized something:
This same idea could potentially be very useful for preserving the work many of you are doing with game decomps.
With completed decomp projects being taken down, mirrors are obviously extremely valuable, and major props to the people keeping those alive, but I started wondering if there was another layer of preservation that could exist alongside them.
Instead of preserving only the completed decomp, what if you also preserved the knowledge required to produce it?
The basic idea would be to create a Doctrine/encyclopedia alongside the decompilation process. As you reverse engineer the original executable, the Doctrine records what was discovered, how systems relate to each other, what approaches worked or failed, what assumptions were proven wrong, what structures were identified, and how the project progressed from the original binary toward the finished result.
Another person with the Doctrine, an LLM, and their own legitimate copy of the original executable could then use that accumulated knowledge as a roadmap toward recreating the work.
In other words:
If sharing the destination becomes difficult, preserve the roadmap that got you there.
And because the roadmap is primarily structured knowledge rather than simply a copy of the finished source tree, multiple groups could potentially compare and combine their findings. One team's understanding of a subsystem might fill in gaps in another team's work, potentially producing a better overall reconstruction than either one independently.
That's why I've started thinking of this as creating a sort of "Rosetta Stone" for a decompile.
It also has another benefit that I think is easy to overlook: it could make these projects substantially more educational.
Instead of someone only receiving the finished result, they could see how people figured things out, what evidence led to a conclusion, what failed, what changed, how one system connects to another, and why a particular implementation was chosen. For anyone interested in learning reverse engineering or decompilation, that seems like an incredibly valuable resource.
To better explain what I'm talking about, here is an output from when I asked an LLM to examine how the Doctrine concept could be adapted specifically for preserving decomp work:
Semantic Decompilation Archiving
And here is the follow-up where I asked it what lessons from building my original Doctrine system would apply to a Decomp Doctrine:
Lessons from the original Doctrine
The good stuff
I also tried to turn the concept into something other people could actually experiment with.
Here is a Bootstrap Prompt I created using my existing Doctrine work and an LLM. The goal is to give someone a starting framework for building a Doctrine around their own decomp project:
Decomp Doctrine - Master Bootstrap Prompt
And here is an instruction/usage guide explaining how I think you should interact with the LLM while building it:
Building and Operating a Decomp Doctrine with an LLM
That second part is actually pretty important.
One of the biggest things I learned while developing my own Doctrine is that its effectiveness doesn't come only from what you tell the LLM to record. It also comes from how you interact with the LLM while developing the Doctrine itself.
For example, rather than deciding on a system in my head, describing it badly, and immediately writing that misunderstanding into the Doctrine, I often explain what I'm trying to accomplish first and ask the LLM how it interprets the goal.
We work out the idea together, identify where my wording might create ambiguity, and then update the Doctrine.
That sounds like a small distinction, but over a long-running project it matters enormously. Otherwise tiny misunderstandings can gradually become "facts" inside the project and contaminate everything built on top of them.
The guide goes much deeper into that process, including how to iterate safely, how to preserve old information instead of overwriting it, how to separate verified facts from assumptions, and how to prevent the Doctrine itself from becoming corrupted over time.
One important caveat: I'm not claiming that doing this magically makes a project immune to copyright claims or DMCA notices. I'm not a lawyer, and the legal status of any particular project is going to depend on what is actually being distributed and how it was produced.
What I'm suggesting is primarily a knowledge-preservation system: preserve the discoveries, reasoning, architecture, testing, failures, and reconstruction process alongside the finished work, rather than allowing all of that accumulated knowledge to disappear if one repository vanishes.
I'm very curious what people who actually work on decomps think of this.
There are probably problems with the idea I haven't encountered yet, and I'm especially interested in whether something like this already exists in the decomp/reverse-engineering community under another name.
But if it doesn't, I think there might be something genuinely useful here.
One last thing
On a slightly more personal note, I'm also interested in finding ways to turn the kind of work I've been doing here into something I can actually do for a living.
If anyone reading this has a project, job, or problem where you think the ideas or skills behind this might be useful, even if it's something completely different from game decomps, feel free to reach out. I'm especially interested in projects involving LLM workflows, knowledge preservation, project documentation, software/code analysis, long-running agent systems, or figuring out how to adapt something like the Doctrine concept to another field.
I'm not looking for donations or handouts. I'd much rather find people who have real problems they need solved and see if I can put what I've learned building things like this to useful work while earning a living doing it.
And that doesn't have to mean paid work, either. If you're working on an interesting project and want to ask questions, bounce ideas off me, experiment with this system, or think I might be useful to what you're building, I'm happy to hear from you.
Basically, if reading all of this makes you think “I wonder if this could be adapted to X…”, I'd genuinely like to hear what X is.
You can reach me through my GitHub profile (@ktastic7) or on Reddit (u/So-Tastic).
License and attribution
Except where otherwise noted, the original framework materials, documentation, prompts, and templates in this repository are made available under the Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license, to the extent the project maintainer holds the rights necessary to license them.
Please see LICENSE and NOTICE.md for attribution requirements, exclusions, and additional details.
Explorer des projets similaires
Chargement…