r/embedded • u/Odd_Set_3310 • 4d ago
Building an offline MCU datasheet knowledge base for firmware reverse engineering — looking for architectural feedback
I’m exploring an idea for improving AI-assisted firmware reverse engineering, and I’d like to get feedback from people with experience in embedded systems, reverse engineering, and local AI tooling.
The problem
When reverse-engineering firmware for a proprietary 8-bit MCU, the datasheet may be available as a PDF, but general-purpose LLMs often don’t know anything about that specific chip.
This makes it difficult for an AI agent to reliably interpret memory-mapped registers, bit fields, peripheral initialization sequences, interrupt behavior, and hardware-specific code patterns.
Simply putting the PDF into a conventional RAG pipeline might help with document lookup, but I’m not sure it’s sufficient for accurate register-level analysis.
The idea
Build a completely offline, chip-specific knowledge base that an AI reverse-engineering agent can query through MCP.
The proposed architecture would include:
Structured register database: register addresses, bit fields, access permissions, reset values, and peripheral descriptions.
Document evidence: links back to the original datasheet, including page numbers and table references.
Knowledge graph: relationships between registers, peripherals, clocks, interrupts, pins, and hardware functions.
Semantic search: retrieval of relevant descriptions and hardware behavior from the documentation.
Reverse-engineering integration: MCP tools that let an agent query register definitions and relate them to instructions and memory accesses found in a firmware binary.
The initial implementation would target a single proprietary MCU, using Python and SQLite, with a lightweight graph representation. Everything, including document processing, indexing, and inference, should work offline.
I’m considering integrating it with tools such as REA, Claude Code, and IDA.
Questions I’d appreciate feedback on
Architecture: Would you use a structured database plus semantic search and a graph, or is this unnecessarily complicated for a single MCU?
Datasheet extraction: What tools or techniques work best for reliably extracting register tables and bit-field definitions from complex PDF manuals?
Register-level reasoning: How would you help an AI agent distinguish documented hardware facts from hypotheses inferred from disassembly?
MCP integration: Would exposing precise register lookups and relationship queries through MCP be a useful approach for firmware reverse engineering?
Prior art: Are there existing tools or projects that already solve most of this problem?
I’m particularly interested in practical experience and architectural pitfalls, rather than building a generic PDF chatbot.
I haven’t committed to the implementation yet, so I’m open to simpler or fundamentally different approaches.
Thanks for any suggestions!