This project implements a Windows DLL that provides memory scanning functionality similar to Cheat Engine. When loaded into another application, it opens a console window with an interactive command shell that allows you to scan, read, and modify memory.
The project is organized into the following files:
module.go- Main package, initialization code, and shared constantsmemory_scanner.go- Memory scanning functionalitydefault_handler.go- Basic command handler implementationmemory_scanner_handler.go- Memory scanner command handlercommand_receiver.go- Command line interface management
To build the DLL directly on Windows:
go build -buildmode=c-shared -o mymodule.dllThis will create a Windows DLL that can be loaded by any application. No additional tools are required as Go natively supports Windows APIs.
To build a Windows DLL from Linux, you'll need to install the MinGW cross-compiler:
For Debian/Ubuntu:
sudo apt-get install gcc-mingw-w64For Fedora:
sudo dnf install mingw64-gccOnce MinGW is installed, use the following command to cross-compile:
CC=x86_64-w64-mingw32-gcc \
GOOS=windows \
GOARCH=amd64 \
CGO_ENABLED=1 \
go build -buildmode=c-shared -o mymodule.dllFor Linux users using vim with gopls, you may need to export these variables to ensure they are available to the language server:
# Add to ~/.bashrc or ~/.profile
export CC=x86_64-w64-mingw32-gcc
export GOOS=windows
export GOARCH=amd64
export CGO_ENABLED=1- Creates a console window when the DLL is loaded
- Provides an interactive command-line interface
- Memory scanning features similar to Cheat Engine:
- Scan for specific values (int32, hex patterns)
- Filter previous scan results
- Wildcard support for hex pattern scanning using "??" notation
- Value change monitoring (scan for values that changed, unchanged, increased, or decreased)
- Read memory from specific addresses
- Write values to memory
- Multithreaded scanning - Uses goroutines for faster memory scans
- Memory region enumeration and information
- Extensible command handler system
- Build the DLL using one of the methods above
- Build and run the loader:
cd loader go build ./loader.exe - A console window will open automatically
- Use the interactive shell to issue commands
help- Display available commandsexit- Exit the programecho [text]- Display the provided textinfo- Display process information
scan int32 [value]- Scan memory for a 32-bit integer valuescan hex [pattern]- Scan memory for a hex pattern (e.g.,scan hex FF??DE)- Use
??as wildcards in the pattern to match any byte
- Use
scan changed- Find addresses whose values changed since last stored scanscan unchanged- Find addresses whose values didn't changescan increased- Find addresses whose values increasedscan decreased- Find addresses whose values decreasedstore- Store current scan results for future value change comparisonsview [page_size]- View current scan results with pagination (default page size: 10)- Use
nfor next page,pfor previous page,qto quit viewing - Can enter page number directly to jump to that page
- Use
filter [value]- Filter previous results for a new valuememory list- List all readable memory regionsmemory read [address] [length]- Read memory at specified addressmemory write [address] [type] [value]- Write value to memory address- Types: int32, byte
