Code Monkey home page Code Monkey logo

movfuscator's Introduction

M/o/Vfuscator

The single instruction compiler.

Overview

The M/o/Vfuscator (short 'o', sounds like "mobfuscator") compiles programs into "mov" instructions, and only "mov" instructions. Arithmetic, comparisons, jumps, function calls, and everything else a program needs are all emulated through movs, and there is no SMC cheating. The compiler is inspired by the paper "mov is Turing-complete", by Stephen Dolan.

The original M/o/Vfuscator (M/o/Vfuscator 1.0) compiles programs from the esoteric language BrainF@$!, and is best used in conjunction with the BFBASIC compiler by Jeffry Johnston. M/o/Vfuscator 2.0 is a complete C compiler, and will be available soon.

Usage

Compile the M/o/Vfuscator with:

  gcc movfuscator.c -o movfuscator

Compile BF to movs with:

  ./movfuscator < example.bf > example.asm

Build a mov executable:

  nasm -felf example.asm -o example.o
  ld -melf_i386 example.o -o example

The complete process from a BASIC program to a mov-only executable:

  ./bfbasic.sh example.bas example.bf
  ./movfuscator < example.bf > example.asm
  nasm -felf example.asm -o example.o
  ld -melf_i386 example.o -o example
  ./example

Flags:

  -mmio    Use memory mapped I/O.  Allows mov instructions instead of int 0x80 for I/O, but requires I/O streams to be backed by files.
  -nojmp   Replace the single jmp instruction with a faulting mov to implement the program loop.
  -mov     Use only mov instructions; same as -mmio -nojmp.
  -cell16  Use 16 bit memory cells.
  -O       Enable optimization.

Author

  • chris domas, @xoreaxeaxeax

References

movfuscator's People

Contributors

xoreaxeaxeax avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.