How atwodots/drvm works
DRVM is a C++ Java class-file disassembler and an in-progress JVM, aimed especially at running J2ME games. A user supplies a .class file and selects dumping or execution: the CLI parses the file, then either renders its class metadata or initializes and invokes Java entry points through the VM. The execution side includes class loading, bytecode interpretation, heap objects, and native support. The README documents both general class-file disassembly and execution without external libraries; unsampled implementation details are represented only where documented or indexed.
Main entry points: ClassFile.cpp Class-file parser · main.cpp CLI options · VM.cpp Bytecode interpreter · ClassLoader.cpp Class loader
Components 18
Command line
- CLI options
src/main.cpp - Help and usage
src/maintain/Help.cpp - Program information
src/maintain/ProgramInfo.cpp
Class-file analysis
- Class-file parser
src/classfile/ClassFile.cpp - Binary reader
src/classfile/BinaryReader.cpp - Constant pool
include/classfile/ConstantPool.hpp - Class attributes
include/classfile/Attribute.hpp - Fields and methods
include/classfile/Method.hpp - Class-file dump
src/classfile/ClassFile.cpp - Class information
src/classfile/Info.cpp
JVM runtime
- Class loader
src/vm/ClassLoader.cpp - Bytecode interpreter
src/vm/VM.cpp - Opcode definitions
include/Opcode.hpp - Object and array heap
include/heap/Heap.hpp - Java exceptions
include/vm/JavaException.hpp
Runtime support
- System natives
src/java/lang/System.cpp - Random natives
src/java/util/Random.cpp
Other components
- Class-file user
Connections 20
- Class-file user → CLI options: selects mode
README.md - CLI options → Help and usage: requests help
src/main.cpp - CLI options → Program information: requests info
src/main.cpp - CLI options → Class-file parser: parses file
src/main.cpp - CLI options → Class-file dump: dumps class
src/main.cpp - CLI options → Class loader: creates loader
src/main.cpp - CLI options → Bytecode interpreter: invokes methods
src/main.cpp - Class-file parser → Binary reader: reads bytes
src/classfile/ClassFile.cpp - Class-file parser → Opcode definitions: uses opcode data
src/classfile/ClassFile.cpp - Class-file parser → Class-file dump: provides class data
README.md - Class-file parser → Constant pool: parses constants
- Class-file parser → Class attributes: parses attributes
src/classfile/ClassFile.cpp - Class-file parser → Fields and methods: parses members
- Class loader → Class-file parser: loads class files
- Bytecode interpreter → Class loader: loads classes
- Bytecode interpreter → Object and array heap: allocates objects
src/vm/VM.cpp - Bytecode interpreter → Opcode definitions: dispatches instructions
src/vm/VM.cpp - Bytecode interpreter → Java exceptions: handles exceptions
- Bytecode interpreter → System natives: uses system native
- Bytecode interpreter → Random natives: supports random native