Skip to content

Instantly share code, notes, and snippets.

View cetfor's full-sized avatar

John Toterhi cetfor

  • Columbus, OH
View GitHub Profile
@cetfor
cetfor / keybase.md
Created July 9, 2018 15:32
keybase.md

Keybase proof

I hereby claim:

  • I am cetfor on github.
  • I am cetfor (https://keybase.io/cetfor) on keybase.
  • I have a public key ASBHlHOFYJOg5ZKnd_FHZsrevyhbS6mGSgcV24hW55cFDAo

To claim this, I am signing this object:

@cetfor
cetfor / GetMLILSSA.py
Created February 8, 2020 16:59
How to get Binary Ninja's MLIL SSA
# Get MLIL SSA form
import binaryninja
target = "cwe369A_x64"
print("Analyzing file: {}".format(target))
bv = binaryninja.BinaryViewType.get_view_of_file(target)
bv.add_analysis_option('linearsweep')
@cetfor
cetfor / GetMLILOperands.py
Created February 8, 2020 18:53
Get MLIL SSA form and print operands
# Get MLIL SSA form and print operands
import binaryninja
target = "cwe369A_x64"
print("Analyzing file: {}".format(target))
bv = binaryninja.BinaryViewType.get_view_of_file(target)
bv.add_analysis_option('linearsweep')
# Get MLIL SSA form
import binaryninja
target = "cwe369A_x64"
target_operations = [
binaryninja.MediumLevelILOperation.MLIL_DIVS,
binaryninja.MediumLevelILOperation.MLIL_DIVS_DP,
binaryninja.MediumLevelILOperation.MLIL_DIVU,
@cetfor
cetfor / BuildAssignmentGraph.py
Created February 8, 2020 23:04
Build a NetworkX digraph of MLIL SSA assignments for data flow analysis
import binaryninja
import networkx as nx
target = "cwe369A_x64"
def build_symbol_graph(bv, func):
graph = nx.DiGraph()
for func in bv.functions:
for block in func.medium_level_il.ssa_form:
for instr in block:
import binaryninja
import networkx as nx
target = "cwe369A_x64"
target_operations = [
binaryninja.MediumLevelILOperation.MLIL_DIVS,
binaryninja.MediumLevelILOperation.MLIL_DIVS_DP,
binaryninja.MediumLevelILOperation.MLIL_DIVU,
binaryninja.MediumLevelILOperation.MLIL_DIVU_DP,
import binaryninja
import networkx as nx
target = "cwe369B_x64"
RETURN_MAP = {
'atoi': 0,
}
target_operations = [
import binaryninja
import networkx as nx
target = "cwe369B_ARM32"
RETURN_MAP = {
'atoi': 0,
}
@cetfor
cetfor / test.py
Last active October 29, 2020 14:18
Binary Ninja Update Analysis Test
import argparse
import binaryninja
import sys
import tempfile
import time
import math
import os
from multiprocessing import Pool, TimeoutError, cpu_count
@cetfor
cetfor / challenge.c
Created January 22, 2021 21:44
Scripts and code for HackOvert Z3 function modeling
// Challenge from:
// https://www.reddit.com/r/ExploitDev/comments/gv72xr/reverse_engineer_passphrase_check/
#include <stdio.h>
#include <string.h>
int check(char* input) {
if (strlen(input) != 15) {
return 0;
} else {