Skip to content

Instantly share code, notes, and snippets.

View joshwatson's full-sized avatar
💅

Josh Watson joshwatson

💅
View GitHub Profile

Keybase proof

I hereby claim:

  • I am joshwatson on github.
  • I am joshwatson (https://keybase.io/joshwatson) on keybase.
  • I have a public key whose fingerprint is 352E 838F 1A8D B323 096F D51D 44BE C0DE 18F4 1C38

To claim this, I am signing this object:

@joshwatson
joshwatson / jirabot.py
Last active April 16, 2016 23:50
Simple Slack slash command that generates jira ticket URLs from a ticket number
# 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 Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
@joshwatson
joshwatson / find_virtual_functions.py
Last active April 27, 2016 13:41
Binary Ninja script to identify virtual functions missed by auto-analysis
#! /usr/bin/python
import sys
import platform
import time
import os
try:
import binaryninja as binja
except ImportError:
@joshwatson
joshwatson / load_pdb.py
Last active April 26, 2017 17:03
PDB Loading Plugin for binaryninja
import os
import threading
import pdbparse
from pdbparse.pe import Sections
from pdbparse.omap import Omap
import binaryninja as bn
def load_pdb_thread(bv):
@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
@joshwatson
joshwatson / microcorruption.py
Last active January 8, 2023 03:05
Microcorruption Memory Dump BinaryView for Binary Ninja
import struct
import traceback
from binaryninja import (
BinaryView, Architecture,
SegmentReadable, SegmentExecutable, SegmentWritable
)
class MicrocorruptionView(BinaryView):
name = "Microcorruption"
long_name = "Microcorruption Memory Dump"
@joshwatson
joshwatson / micocorruption_binary.py
Last active December 17, 2020 16:35
Generate a Microcorruption Memory Dump
from __future__ import print_function
from argparse import ArgumentParser
import sys
def decode_binary(input_file, output_file):
next_addr = 0
for line in input_file:
addr,data = line.split(':')[:2]
@joshwatson
joshwatson / vtable-navigator.py
Last active January 21, 2017 03:04
Binary Ninja IL Example: Navigating to a Virtual Function Based on an Indirect Call
import struct
from binaryninja import *
def find_vtable(bv, function_il):
for bb in function_il:
for il in bb:
# vtable is referenced directly
if (il.operation == LLIL_STORE and
il.dest.operation == LLIL_REG and
@joshwatson
joshwatson / callgraph.py
Last active July 10, 2020 02:08
Callgraph Generating Binary Ninja Plugin
import struct
import threading
import binaryninja as bn
class Graph(object):
def __init__(self, view):
# type: (Graph, bn.BinaryView) -> None
self.view = view
@joshwatson
joshwatson / BNILExprVisitor.py
Last active April 29, 2017 02:40
BNIL Expression Visitor
class BNILExprVisitor(object):
'''A class to faciliate visiting BNIL instructions.
The following example outputs all addition expressions that are assigned
to an MLIL variable.
>>> visit = BNILExprVisitor()
>>> @visit.add(MediumLevelILOperation.MLIL_SET_VAR)
... def visit_set_var(expr)
... visit(expr.src)