Skip to content

Latest commit

 

History

History
26 lines (22 loc) · 1.01 KB

File metadata and controls

26 lines (22 loc) · 1.01 KB

RustyVM

Simple virtual machine project for learning Rust!

Usage

./rustyvm <path-to-program>

Memory management

Rusty VM use section-based memory manager. Every section determines by it's base address and size. Thats why there is no segment registers. Program can allocate/deallocate memory throw syscall.

When you constructing shellcode, memory manager always will allocate two sections: one for shellcode and one for stack.

Tasks

  • Bytecode execution
  • Arithmetic opcodes (add, sub, not, xor, shl, shr, etc.)
  • Memory mapping (stack, heap, etc.)
  • Memory opcodes (mov)
  • Control flow opcodes (cmp, jmp, je, jne, jge, etc.)
  • Program format and loader
  • Interrupts/Syscalls (int)

Architecture

  • Machine has 256 64-bit register
  • You can do any operation with any register
  • Some registers has special meaning (instruction pointer, stack pointer, etc)
  • Flags register can not be accesed by machine operations
  • Now sections don't have access flags, but it could be added in the future