Giter Club home page Giter Club logo

binary-mutator's Introduction

binary-mutator

This is a Dyninst-based binary mutator that mutates every flag-use instruction in a given X64 binary.

You can run this tool using make-mutants.pl as follows:

perl make-mutants.pl binary1 [function-name] [debug-on=1, debug-off=0]

This will create a new binary file for every flag-use instruction in binary1. The new binaries will be named as binary1--<jCC/setCC/cmovCC>- where condition will be CT (Condition Taken) or CNT (Condition Not Taken) for jCC instructions, NOP or MOV for cmovCC instructions and SET0 or SET1 for setCC instructions.

perl make-mutants.pl binary1 function1 1/0-to-control-debugging-output

This will create new binary files for every flag-use instruction in function1 in binary1 as explained before.

I ran the tool on the "cruise-o3" binary in the component-based-assurance repository and it generated 483 mutants. I've also manually verified mutants generated for a few jCC, setCC, cmovCC instructions and found them to be correct.

Please note that make-mutants.pl runs a binary named ReplaceInsn which requires dyninst to be installed and dyninst installation paths updated in the Makefile (which is quite basic for now). I have checked in my current version of ReplaceInsn for you to have something to run now.

In order to compile ReplaceInsn, you will need to specify the directory in which your dyninst copy was installed in the DYNINST_INSTALL_ROOT variable in the Makefile.

binary-mutator's People

Contributors

vaibhavbsharma avatar tj-byun avatar

Stargazers

 avatar

Watchers

James Cloos avatar  avatar  avatar

binary-mutator's Issues

A pair of binary mutant shouldn't always fail

When a mutation of a Flag-Use Instruction forces the execution to take a certain side, it shouldn't be that the pair of mutants for the same FUI always crash. Among many cases, here is an example.

Binary: microwave-auto compiled with GCC -O3 o3.zip
Mutants: 0x401786-setCC-SET0, 0x401786-setCC-SET1 mutants.zip
Test input: testcases.zip

DynInst assertion failure

An assertion failure occurs with the attached binary given the following command: ./make-mutants.pl $(realpath ./o2) top_step

Error: source should precede target; edge type cond_not_taken src[4012d8 4012e3] trg[400d30 400d36]
ReplaceInsn: /usr/local/dyninst/dyninstAPI/src/Relocation/CFG/RelocBlock.C:381: void 
Dyninst::Relocation::RelocBlock::preserveBlockGap(): Assertion `0' failed.

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.