Skip to content

Instantly share code, notes, and snippets.

View zcutlip's full-sized avatar

Zachary Cutlip zcutlip

View GitHub Profile
@zcutlip
zcutlip / shell_history_backup.zsh
Last active November 10, 2023 21:36
Shell history backup function
# shellcheck shell=bash
# shellcheck disable=SC1091
# source from .zshrc or similar:
# source "$DOTFILES/shell_history_backup.zsh" && _backup_shell_hist
function _backup_shell_hist(){
if [ -n "$SHELL_HIST_BACKUP_LOC" ]
then
_histfile_base="$(basename "$HISTFILE")"
@zcutlip
zcutlip / CommerceKit.h
Created December 9, 2021 00:35
Working progress on CommerceKit class dumping
/*
./classdump.py ../build/Release/formatType ./CommerceKit.json
*/
@interface CKDialogController : CKServiceInterface
{
}
@zcutlip
zcutlip / ida_hello.py
Created July 15, 2021 20:58
IDA python script that prints to console in batch mode
import idc
import os
# you won't see this on the console
print("hello")
class Log:
def __init__(self, logfile):
self.logfile = logfile
@zcutlip
zcutlip / swp.json
Last active July 2, 2021 01:01
Star Wars Planets
{
"meta": {
"date": "2021-07-02T01:01:52+00:00",
"url": "https://en.wikipedia.org/wiki/List_of_Star_Wars_planets_and_moons"
},
"planets": {
"Abafar": {
"appearances": [
{
"title": "Star Wars: The Clone Wars",
@zcutlip
zcutlip / ascii_radio.txt
Created June 4, 2021 19:31 — forked from nick3499/ascii_radio.txt
Python 3: Radio Streams VLC: csv.reader(), subprocess.run()
:::::::.. :::. :::::::-. ::: ...
;;;;``;;;; ;;`;; ;;, `';,;;; .;;;;;;;.
[[[,/[[[' ,[[ '[[, `[[ [[[[[,[[ \[[,
$$$$$$c c$$$cc$$$c $$, $$$$$$$$, $$$
888b "88bo,888 888,888_,o8P'888"888,_ _,88P
MMMM "W" YMM ""` MMMMP"` MMM "YMMMMMP"
Date/time: 2021-03-02T18:47:39.428075-08:00
Information source: https://en.wikipedia.org/wiki/List_of_Star_Wars_planets_and_moons
Planets added:
Aleen
Endor (Sanctuary)
Esseles
Jestefad
Sissubo
@zcutlip
zcutlip / fahmonitor.lua
Created June 14, 2020 17:00
Hammerspoon module to pause/unpause Folding@Home
screenSleep = false
screenSaver = false
screenLock = false
--[[
A module to pause/unpause Folding@Home depending on screensaver, screen lock, and
screen sleep state.
Folding@Home's "only when idle" mode does not pause/unpause the client at obvious times
or for obvious reasons. Instead, This module uses screen state as in indicator that the
user is/isn't interacting with the system.
@zcutlip
zcutlip / color_bb.py
Last active December 20, 2022 06:43
Ghidra Script to Colorize all Basic Blocks for a Provided list of Addresses
from java.awt import Color
from ghidra.util.task import ConsoleTaskMonitor
from ghidra.program.model.block import BasicBlockModel
from docking.options.editor import GhidraColorChooser
"""
Ghidra script to colorize all basic blocks identified by the input file.
Prompts for a file to use as input. This script will attempt to sanity check
that a basic block actually does start at each provided address.
@zcutlip
zcutlip / function_bb.py
Created February 12, 2020 22:12
Ghidra Script to List all Basic Block Addresses for a Function
import os
from ghidra.program.model.block import BasicBlockModel
from ghidra.util.task import ConsoleTaskMonitor
"""
Ghidra script to identify the addresses of all basic blocks within a function
Prompts for name of a function, and name of an output file. Locates all basic block addreses
and writes them to the output file.
"""
@zcutlip
zcutlip / example.md
Created February 4, 2020 00:34
Using py-object-file to Parse a Mach-O

Using py-object-file to Parse a Mach-O

First, instantiate a Mach object, passing it the path to a mach-o binary:

m = Mach("/usr/lib/libobjc.A.dylib")

The Mach class treats all mach-o binaries as if they're fat binaries with at least once slice. So to work with your mach-o you first have to get its slice, even if it's not a fat binary. You can either to this by architecture name or slice index: