Skip to content

Instantly share code, notes, and snippets.

View withzombies's full-sized avatar

Ryan Stortz withzombies

View GitHub Profile
def returnTypedString():
# type: () -> str
return "lol"
def returnUntypedString():
return "aww"
a = returnTypedString()
b = returnUntypedString()
$ python binja_memcpy.py /bin/bash
Analyzing /bin/bash
100038024 dst:<entry rsi>
src:<entry rdi>
n:<range: -0x80000000 to 0x7fffffff>
1000380c9 dst:<undetermined>
src:<entry rdi>
n:<range: -0x80000000 to 0x7fffffff>
@withzombies
withzombies / StructuredDataView.py
Last active October 3, 2018 19:00
Apply a structure to an address and access its members in BinaryNinja
#!/usr/bin/env python
# Copyright 2017 Ryan Stortz (@withzombies)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
@withzombies
withzombies / crackaddr_vuln.c
Last active May 23, 2024 14:25
halvar's reimplementation of mark dowd's crackaddr vulnerability
/*
Copyright (c) 2011, Thomas Dullien
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer. Redistributions
@withzombies
withzombies / bnil_graph.py
Last active June 3, 2019 14:08
BinaryNInja plugin to graph BNIL Instructions (they're tree form)
#!/usr/bin/env python
# Copyright 2017 Ryan Stortz (@withzombies)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
#!/usr/bin/env python
# Copyright 2017 Ryan Stortz (@withzombies)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# This file describes the network interfaces available on your system
# For more information, see netplan(5).
network:
version: 2
renderer: networkd
ethernets:
enp1s0:
addresses:
- 192.168.88.103/24
gateway4: 192.168.88.1
@withzombies
withzombies / update-heroku-certs.py
Created June 10, 2021 00:28
Script to download the latest lets encrypt certificate and key from DNSimple and apply them to your heroku endpoints
#!/usr/bin/env python3
"""
Copyright 2021 Trail of Bits
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
@withzombies
withzombies / README.md
Created February 1, 2022 18:33
Binary Ninja 3.0 Psuedo C vs Ghidra

For the test case I'm using one from Ghidra's test suite, which is available here

It was compiled on my macOS machine with the following command:

$ clang -o decomp -O1 -g decomp.c -Wall -Wshadow -Wextra -std=c17 -arch arm64e

Some metadata:

CREATE TABLE _SqliteDatabaseProperties (key TEXT, value TEXT, UNIQUE(key));
CREATE TABLE deleted_messages (ROWID INTEGER PRIMARY KEY AUTOINCREMENT UNIQUE, guid TEXT NOT NULL);
CREATE TABLE sqlite_sequence(name,seq);
CREATE TABLE chat_handle_join (chat_id INTEGER REFERENCES chat (ROWID) ON DELETE CASCADE, handle_id INTEGER REFERENCES handle (ROWID) ON DELETE CASCADE, UNIQUE(chat_id, handle_id));
CREATE TABLE sync_deleted_messages (ROWID INTEGER PRIMARY KEY AUTOINCREMENT UNIQUE, guid TEXT NOT NULL, recordID TEXT );
CREATE TABLE message_processing_task (ROWID INTEGER PRIMARY KEY AUTOINCREMENT UNIQUE, guid TEXT NOT NULL, task_flags INTEGER NOT NULL );
CREATE TABLE handle (ROWID INTEGER PRIMARY KEY AUTOINCREMENT UNIQUE, id TEXT NOT NULL, country TEXT, service TEXT NOT NULL, uncanonicalized_id TEXT, person_centric_id TEXT, UNIQUE (id, service) );
CREATE TABLE sync_deleted_chats (ROWID INTEGER PRIMARY KEY AUTOINCREMENT UNIQUE, guid TEXT NOT NULL, recordID TEXT,timestamp INTEGER);
CREATE TABLE message_attachment_join