Skip to content

Instantly share code, notes, and snippets.

@quend
quend / compile_to_bitcode.sh
Last active September 22, 2016 18:22
Script to compile the OpenSSL project to LLVM Bitcode on a Linux system.
#!/bin/bash
#!/usr/bin/env bash
# Run this script in the main directory of openssl.
# Requires python3
set -e
# download necessary parsing script
wget https://gist.githubusercontent.com/quend/e44520133e2cd8a6da98ce1c2a02a7b1/raw/8c93794dc2dc6cdd84255eb2de8416b59cf53a9b/comp_db_generate.py
@joshwatson
joshwatson / bookmarks.py
Last active October 12, 2016 10:58
Create/List bookmarks in Binary Ninja
'''
bookmarks.py - Create/List bookmarks in Binary Ninja
Copyright (c) 2016 Josh Watson
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
anonymous
anonymous / solve_test.py
Created October 2, 2015 12:40
angr symbolic argv test
#!/usr/bin/env python
import angr
p = angr.Project('test')
key_str = angr.StringSpec(sym_length=20)
initial_state = p.factory.entry_state(args=['./test', key_str])
pg = p.factory.path_group(initial_state)
@steipete
steipete / openssl-build.h
Last active May 30, 2023 11:34
Updated script that builds OpenSSL with Bitcode enabled (tested with Xcode 7.0b3)
#!/bin/bash
# This script downlaods and builds the iOS and Mac openSSL libraries with Bitcode enabled
# Credits:
# https://github.com/st3fan/ios-openssl
# https://github.com/x2on/OpenSSL-for-iPhone/blob/master/build-libssl.sh
# Peter Steinberger, PSPDFKit GmbH, @steipete.
set -e
@tomhopper
tomhopper / PRESS.R
Last active November 6, 2022 00:46
Functions that return the PRESS statistic (predictive residual sum of squares) and predictive r-squared for a linear model (class lm) in R
#' @title PRESS
#' @author Thomas Hopper
#' @description Returns the PRESS statistic (predictive residual sum of squares).
#' Useful for evaluating predictive power of regression models.
#' @param linear.model A linear regression model (class 'lm'). Required.
#'
PRESS <- function(linear.model) {
#' calculate the predictive residuals
pr <- residuals(linear.model)/(1-lm.influence(linear.model)$hat)
#' calculate the PRESS