Skip to content

About

No description, website, or topics provided.

Resources

Contributing

Stars

28 stars

Watchers

1 watching

Forks

Latest commit

 

History

18 Commits

Folders and files

Repository files navigation

DMA Hacking Guide

Learn memory analysis, one reliable observation at a time

You have an address, a handful of bytes, and a value that looks almost right. How do you tell whether you found the right object—or just something that happens to look convincing?

This book teaches you to answer that question. Start with bytes and pointers, work through a small reproducible lab, then connect those skills to DMA acquisition, Unity, and larger analysis tools. You can complete the first exercises with Python and an ordinary computer. Hardware comes later.

The examples use synthetic data and programs you control. The practical goal is to understand and verify memory observations in your own development, research, or authorized analysis environment.

New here? Read Chapter 1, then try the 15-minute lab. Already comfortable with pointers? Jump to the advanced reading path or use the topic finder.

Table of contents

Chapter What you will learn
1. Start here What DMA does, what you will learn, and where to begin.
2. Memory foundations Bytes, types, pointers, address spaces, and object lifetime.
3. Tools and your first lab A useful setup and a first result without hardware.
4. Offsets and signatures Find, describe, and validate locations without guessing.
5. Acquisition Connect the source, transport, translation, and analysis layers.
6. Reading memory reliably Exact reads, bounded decoding, and consistency.
7. Controlled experiments Change known inputs and distinguish observation from causation.
8. Protections and observability IOMMUs, permissions, and the limits of visibility claims.
9. Troubleshooting Work from a symptom to the smallest discriminating check.
10. Unity in practice Mono, IL2CPP, managed objects, and your own instrumented build.
11. Address translation Page tables, page boundaries, and missing pages.
12. Performance and freshness Batching, caches, latency distributions, and useful throughput.
13. Reproducibility and tool design Versioned layouts, evidence records, and dependable exports.
14. Build a trustworthy reader An end-to-end project with measurable acceptance criteria.
15. Strings and collections Decode text and variable-length records with explicit units and bounds.
16. Modules, symbols, and build identity Relate loaded addresses, file bytes, symbols, and exact builds.
17. Comparing captures Separate layout changes from meaningful changes in application state.
18. Polling and replay Handle duplicates, failures, generation changes, and observation age.
19. Testing unfamiliar layouts Challenge a decoder with boundaries, mutations, and independent evidence.
20. A complete investigation Turn several captures and a replay trace into a defensible conclusion.

Appendices and practical material

Choose your reading path

First time working with memory

Read Chapters 1, 2, and 3, then run the lab. Return to Chapter 4 once you can explain why a pointer is different from the value it points to. There is no need to understand page tables on your first day.

Comfortable programming, new to DMA

Read acquisition, reliable reads, and protections. Complete the lab's failure cases before connecting an acquisition source. Your first milestone is a correct, repeatable observation—not a fast polling loop.

Building or reviewing an analysis tool

Use Unity layouts, translation, performance, and reproducibility as reference chapters. The capstone gives you acceptance criteria for a reader that survives malformed data and changing layouts.

Continue beyond the first capstone

Chapters 15 through 20 take you from one record to a small investigation: decode a named collection, distinguish module and file locations, compare captures by identity, replay failures, and test the assumptions behind your conclusion. Follow the advanced lab alongside these chapters. It uses ordinary Python and synthetic observations, so you can reproduce the results without a device.

Each of these chapters includes a local contents list, detailed calculations, failure analysis, and exercises with worked solutions. Chapter 15 includes twelve exercises and a strings and collections casebook; Chapters 16–20 each add four. The calculation tools reproduce section mapping, numeric precision, replay state, and the final evidence report.

Find a specific answer

If you are wondering… Read…
“What does 0x mean?” Hex, bytes, and endianness
“Which kind of address is this?” Address spaces
“Why did my offset stop working?” What an offset means
“Do I need to buy a board?” Choose the smallest useful setup
“How do MemProcFS and LeechCore fit together?” Acquisition layers
“Why do I keep reading zero?” Troubleshooting by symptom
“Can one read contain two different moments?” Consistency
“Does IL2CPP preserve C# object layouts?” Unity's managed and native sides
“Why doesn't DMA imply unrestricted access?” IOMMU and platform protections
“How do I measure improvements?” Benchmark design
“Does a string length count bytes or characters?” Text length units
“How do I find an RVA in a file?” Section mapping example
“Did the data change, or just its position?” Semantic comparison
“What should a reader do when a sample fails?” Replay state transitions
“How do I challenge my decoder?” Mutation experiments
“What does a finished investigation look like?” Worked investigation

Run the book's examples

Install Python 3.10 or newer. From the repository root:

python labs/memory_lab.py demo
python labs/advanced_lab.py demo
python -m unittest discover -s tests -v
python tools/book.py check

On systems where Python is named python3, substitute python3. On Windows, py -3 is another common launcher. The examples use the standard library; they require no administrator access, drivers, memory dumps, or DMA hardware.

The lab is a deliberately invented byte format. It is not a Windows memory dump, a Unity object layout, or proof of hardware compatibility. The book labels those boundaries at the point where they matter.

Scope and editions

This edition concentrates on reading and interpreting memory, with controlled state changes in your own fixtures or development builds. It includes the reasoning needed to evaluate acquisition results; it does not promise universal offsets, transparent access through platform protections, or an undetectable device.

Technical references were reviewed on 2026-10-23. Examples tied to external tools are identified separately from the locally executable labs. See the source notes for version-sensitive topics and the corrections for changes from the earlier overview.

Older chapter bookmarks

The original README contained the whole guide. These landing points preserve its chapter headings while the contents above lead directly to the expanded chapters.

Original Chapter 1: Introduction to DMA

Continue to Chapter 1: Start here.

Original Chapter 2: Preliminary knowledge

Continue to Chapter 2: Memory foundations.

Original Chapter 3: Tools and equipment

Continue to Chapter 3: Tools and your first lab.

Original Chapter 4: Identifying offsets

Continue to Chapter 4: Offsets and signatures.

Original Chapter 5: Setting up DMA

Continue to Chapter 5: Acquisition.

Original Chapter 6: Extracting data

Continue to Chapter 6: Reading memory reliably.

Original Chapter 7: Modifying data

Continue to Chapter 7: Controlled experiments.

Original Chapter 8: Observability

Continue to Chapter 8: Protections and observability. The earlier stealth claims are addressed in the corrections.

Original Chapter 9: Challenges and pitfalls

Continue to Chapter 9: Troubleshooting.

Original Chapter 10: Advanced topics

Continue to Chapter 10: Unity, then address translation, performance, and reproducibility.

Back to contents

About

No description, website, or topics provided.

Resources

Contributing

Stars

28 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages