Git Product home page Git Product logo

bintests's Introduction

Binary Rewriting Test Suite

This repository comprises a set of PE executable files encompassing a diverse array of code. Its primary goal is to facilitate testing the accuracy of bin2bin transformations. We are focused on assessing the effectiveness of our binary rewriting capabilities, particularly when applied to substantially large binaries exceeding 200MB which may have various "odd" behaviors. For now this repo will only contain x86 executables.

Usage

Any PE files under 32bit/ and 64bit/ can be executed on the commandline. They will output text, you can compare this text with the transformed version of the binary to see if they match.

SEH Tests

All tests under the seh/ folder are 64bit PE executable files. These tests do not print anything out if successful, instead the exit code should be checked to make sure it is zero. If it is non-zero then the SEH test has failed.

Why?

Most research papers on the topic of binary rewriting usually targets ELF files. Majority of these papers use the binutils that gnu ships. We are building software to protect windows executable files and I couldnt find a large repo with pre-compiled test bins ready to use. That is why this exists. This is also used by our CI workflows to test our code as we write it. Very useful!

Test List

The test bins consist of tests from the following projects:

This also contains all sorts of misc tests aimed at breaking disassembly (recursive functions, functions that call each other, noreturn functions, all sorts of jump tables).

Compile Options & Binary Information

Most bins will be compiled with /O2, /GL, and /LTCG. However not all bins will be compiled with these options. Real world bins will have a wide range of optimization/compiler options so we try to replicate this by not having every single binary use /O2, /GL, etc. Its important to note this because code compiled with /GL you cannot assume volitile registers are really volitile. The compiler can do some non-abi stuff with functions inside of the binary.

bintests's People

Contributors

54 avatar cr3swapper avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

gavz notpidgey

bintests's Issues

Nasty x86 binary

Are you interested in some nasty byte-codes, like this?

; nasm -g -f win32 strange_offset.s && x86_64-w64-mingw32-cc -g -no-pie -m32 -o strange_offset.exe strange_offset.obj
; nasm -g -f elf strange_offset.s && gcc -g -no-pie -m32 -o strange_offset strange_offset.o
section .text
    global main

    extern printf
    extern exit

main:
    mov EAX, 0x02eb11b0
    cmp EAX, 0x02eb11b0
    fake_jmp dw 0xfa74

    push EAX
    push reveal_key
    call printf

finish:
    ; exit the program
    push 0
    call exit

section .data
    reveal_key db 'The key is "%x"', 0

This will print The key is "2eb1111"

pascal/delphi binaries

Its been brought to my attention that we should have a few delphi/pascal binaries in here.

luajit tests

luajit does some insane optimization shit that would be a good to test on our framework.

we need tests with stack cookie (/GS) enabled

when /GS is enabled functions with stack cookies use GSHandlerCheck exception handler function.

image

I literally cannot find anywhere on google that defines the language specific data for __GSHandlerCheck but after some reverse engineering it contains this information:

typedef struct GSHandlerData {
    unsigned long stackCookieOffset;
}

firefox

add firefox to our misc rewrite binaries. or maybe just tor. xul.dll is the main module.

seperate the large llvm bins out

so the large llvm binaries that are in 32bit/64bit bog down CI. This repo needs to run everytime we make a push so we can see the effects we make on code coverage and stability. I suggest a change to the file structure:

64bit/ci/*.exe
64bit/ci/*.pdb
32bit/ci/*.exe
32bit/ci/*.pdb

we move the larger bins to just 32bit/.exe and 32bit/.pdb this way we can run them locally still without clogging up CI with huge binaries to rewrite.

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.