Skip to content

Instantly share code, notes, and snippets.

View cetfor's full-sized avatar

John Toterhi cetfor

View GitHub Profile
@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 / emulate_pcode.py
Last active June 4, 2022 17:54
PCode Emulation with Python
from ghidra.app.emulator import EmulatorHelper
from ghidra.program.model.symbol import SymbolUtilities
# Tested with Ghidra v9.1 and v9.1.1, future releases are likely to simplify
# and/or expand the EmulatorHelper class in the API.
# == Helper functions ======================================================
def getAddress(offset):
return currentProgram.getAddressFactory().getDefaultAddressSpace().getAddress(offset)
@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 / cdecl.c
Last active November 8, 2021 12:27
Example source for my calling conventions article
// gcc -m32 -mpreferred-stack-boundary=2 cdecl.c -o cdecl
#include <stdio.h>
void printFavNums(int num1, int num2) {
printf("My favorite numbers are %d and %d!\n", num1, num2);
}
int main()
{