Skip to content

NKarpinsky/RustyVM

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

67 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Simple project just for learning Rust!

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages