This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <stdint.h> | |
| #include <stdio.h> | |
| template<typename T> T get_bits(T value, unsigned msb, unsigned lsb) { | |
| return (value >> lsb) & ((1 << (msb - lsb + 1)) - 1); | |
| } | |
| template<typename T, unsigned N = (sizeof(T) * 8)> int log2(T value) { | |
| unsigned i = 0; | |
| while (i < N && (value >>= 1)) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Author: Agustin Gianni (agustingianni@gmail.com). | |
| // License: BSD variant "if you steal my shit i'll cut you". | |
| #include <iostream> | |
| #include <random> | |
| #include <limits> | |
| #include <cassert> | |
| #include <cstdio> | |
| using namespace std; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Small utility to measure how much time does it take to | |
| // run an arbitrary function. | |
| // Written by Agustin Gianni (agustin.gianni@gmail.com). | |
| // Based on https://ngathanasiou.wordpress.com/2015/04/01/benchmarking-in-c/ | |
| // | |
| // $ clang++ measure.cpp -o measure -std=c++11 -Wall && ./measure | |
| // Return value: Boom! | |
| // Elapsed time: 0 ms | |
| #include <ctime> | |
| #include <chrono> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // | |
| // Created by Agustin Gianni on 11/18/16. | |
| // | |
| #ifndef THREADPROFILER_DISKPOOL_H | |
| #define THREADPROFILER_DISKPOOL_H | |
| #include <atomic> | |
| #include <string> | |
| #include <cstddef> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| export SAMPLES_DIR=/Users/anon/workspace/fuzzing/tests | |
| export TEST_PROGRAM=/Users/anon/workspace/retools/build/src/tools/binary_info/binary_info | |
| export AFL_PATH=/Users/anon/Downloads/afl-2.35b | |
| export MINIMIZED_SAMPLES_DIR=$SAMPLES_DIR/minimized | |
| mkdir fuzzing_build | |
| pushd fuzzing_build |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import sys | |
| #sys.path.append("C:\\Program Files (x86)\\Microsoft Research\\Z3-4.1\\python") | |
| from z3 import * | |
| s=Solver() | |
| x=BitVec("x", 64) | |
| y=BitVec("y", 64) | |
| w=BitVec("w", 64) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| # Download and build OS X Mavericks XNU Source | |
| if [ ! -d "dtrace-118" ]; then | |
| curl -O http://opensource.apple.com/tarballs/dtrace/dtrace-118.tar.gz | |
| tar zxf dtrace-118.tar.gz | |
| rm dtrace-118.tar.gz | |
| fi | |
| if [ ! -d "AvailabilityVersions-6" ]; then | |
| curl -O http://opensource.apple.com/tarballs/AvailabilityVersions/AvailabilityVersions-6.tar.gz | |
| tar zxf AvailabilityVersions-6.tar.gz |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <iostream> | |
| #include <libdebug/Debugger.h> | |
| #include <string> | |
| using namespace std; | |
| using namespace lldb; | |
| int main(int argc, char** argv) | |
| { | |
| if (argc < 1) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #ifndef DEBUGGER_H_ | |
| #define DEBUGGER_H_ | |
| #include <map> | |
| #include <string> | |
| #include <vector> | |
| #include <Conditionals.h> | |
| #include <lldb/API/LLDB.h> | |
| #include <optional.h> |
This file has been truncated, but you can view the full file.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "operation": [ | |
| "CheckFPAdvSIMDEnabled64();", | |
| "bits(datasize) operand = V[n];", | |
| "bits(datasize) result;", | |
| "integer element;", | |
| "", | |
| "for e = 0 to elements-1", | |
| " element = SInt(Elem[operand, e, esize]);", | |
| " if neg then", |