Code Monkey home page Code Monkey logo

svm's Introduction

svm

A register-pointer JavaScript virtual machine written in JavaScript.

Usage

Building

Run npm install from each of the assembler, client, compiler, obtfuscator and preprocessor directories.

Create index.js in the src directory, then run ./build.sh with the repository directory as your current working directory.

Running

Run ./run.sh with the repository directory as your current working directory.

Functionality

  • Compile almost any JavaScript source to obfuscated virtual machine code
  • Dynamic instruction set, randomized output bytecode
  • ES5 compatible output for ES6+ input

Planned Features

Functionality

  • Modules, imports, exports
  • Templates (w/o Babel)
  • Internal async functions
  • Spread elements (w/o Babel)
  • Do expressions
  • With statements
  • Decorators
  • Directives
  • Function generators
  • Catch external exceptions internally
  • Bundling of client sources pre-compilation
  • Conditional sets
  • Run minifier more

Obfuscation

  • Instruction repackaging, shuffling, modification/generation
  • VM internals repackaging
  • Metamorphic bytecode -- copy in code, alternate decryptions, etc
  • Bytecode scheduler/internal async functions
  • Hide instructions via mov and call register
  • Replace jz/jnz with add r0 X r0 with X = r0 + !!condition * off
  • Replace sub with add r0 X r2 with X = div r1 -1
  • Replace eq_typed with eq + typeof
  • Internal negation of Numbers
  • Compiler-client register mapped shuffling
  • Code signing and internal verification
  • Tamper detection - block by block - chained
  • Code flow graph flattening
  • Use register pointing capability
  • Internal offset assertions

Performance

  • Compile-time hotspotting
  • Global value numbering
  • Dead code elimination
  • Register reduction
  • Instructions as arguments
  • Track register state across time rather than live scanning only in optfuscator
  • Inbuilt profiling

Compatibility

  • Remove typed arrays dependency

Architecture

Compiler

The compiler converts JavaScript code into svm assembler. There is no optimization, and this is only intended to convert the semantics of JavaScript to svm assembler.

Optfuscator

The optfuscator, or optimizing obfuscator, optimizes and obfuscates svm assembler (but not svm bytecode).

Assembler

The assembler compiles svm assembler into svm bytecode, and encrypts it. It is planned to output a minimal, obfuscated, and web-compatible client.

Client

The client runs the svm bytecode.

svm's People

Contributors

mjeacocke avatar protryon avatar

Watchers

 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.