How 0xc-dev/stackemulator works
StackEmulate is an interactive x86-64 assembly learning TUI. A learner edits or loads source, assembles it, then steps, reverses, or runs the code in an isolated CPU emulator while inspecting code, registers, and stack state. The README also documents bundled example cycling and file open/save. The sampled code supports the main assembly and execution links; some UI refresh and file-action details are omitted, so those links are grounded in the README or visible app wiring.
Main entry points: app.py TUI controller · assembler.py Assembler · emulator.py CPU emulator · asm_editor.py Assembly editor
Components 12
Source input
- TUI controller
stackemu/app.py - Assembly editor
stackemu/asm_editor.py - Assembly files
examples
Assembly
- Assembler
stackemu/assembler.py - Keystone
- Capstone
Execution
- CPU emulator
stackemu/emulator.py - Unicorn engine
Visualizers
- Code view
stackemu/widgets.py - Register view
stackemu/widgets.py - Stack view
stackemu/widgets.py
Other components
- Learner
Connections 16
- Learner → TUI controller: uses controls
README.md - TUI controller → Assembly editor: shows editor
stackemu/app.py - TUI controller → Assembly files: loads examples
stackemu/app.py - TUI controller → Assembler: assembles source
stackemu/app.py - Assembly editor → Assembler: detects syntax
stackemu/asm_editor.py - Assembler → Keystone: encodes instructions
stackemu/assembler.py - Assembler → Capstone: maps instructions
stackemu/assembler.py - Assembler → CPU emulator: uses code base
stackemu/assembler.py - TUI controller → CPU emulator: loads and controls
stackemu/app.py - CPU emulator → Unicorn engine: executes code
stackemu/emulator.py - TUI controller → Code view: updates display
stackemu/app.py - TUI controller → Register view: composes pane
stackemu/app.py - TUI controller → Stack view: composes pane
stackemu/app.py - Code view → Assembler: uses line map
stackemu/widgets.py - Stack view → CPU emulator: renders snapshots
stackemu/widgets.py - Register view → CPU emulator: renders snapshots
stackemu/widgets.py