Skip to content

Class project for C S 393P - Program Synthesis: Automatically translating machine code between architectures

Notifications You must be signed in to change notification settings

WhyToFly/synthlation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Synthlation

Class project for CS 393P - Program Synthesis: "Stochastic Binary Translation"

Heavily inspired by the paper Stochastic Superoptimization (Schkufza, Sharma, Aiken)

What this does

The program takes a compiled Game Boy ROM as an input and emulates it.

It runs test cases for a small part of the program and saves the results.

It then uses MCMC sampling to optimize program proposals until an equivalent x86 assembly program is found.

Installation

Clone this repo

git clone https://github.com/WhyToFly/synthlation.git
cd synthlation

Clone modified version of Baekalfen's PyBoy Game Boy Emulator and install it

git clone https://github.com/WhyToFly/PyBoy.git
cd PyBoy
pip install -r requirements.txt
python setup.py build_ext --inplace
pip install .
cd ..

Install assembly and emulation modules

pip install keystone-engine capstone unicorn

Running

Run the synth script with the program you want to synthesize (from the /gb_programs/ directory) as an input

e.g. for the "add" program (adds the two input values)

python synth.py add

About

Class project for C S 393P - Program Synthesis: Automatically translating machine code between architectures

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published