Skip to content

Instantly share code, notes, and snippets.

@rumpeltux
rumpeltux / frida-instruction-trace.js
Last active January 15, 2023 09:06
Example on how to instruction-trace a binary with frida stalker
// solving https://stackoverflow.com/questions/63056570/instruction-counter-made-with-frida-stalker
// convenience function because ASLR addresses are difficult to read
function getAddress(modules, start) {
for (let i = 0; i < modules.length; i += 1) {
const base = modules[i].base;
const size = modules[i].size;
const limit = base.add(size);
if (start.compare(base) < 0 || start.compare(limit) > 0) {
@rumpeltux
rumpeltux / auto_add_headers.sh
Last active August 17, 2019 17:34
Script to automatically add "#ifndef DIRECTORY_FILENAME_H" headers and footers
# Automatically add "#ifndef DIRECTORY_FILENAME_H" headers and footers
# to all filenames mentioned in the commandline.
#
# Usage: find -name \*.h | xargs sh auto_add_headers.sh
for fn in "$@"; do
# 1. Strip optional leading "./"
# 2. Replace "." and "/" by "_"
# 3. Uppercase everything
dn=$(echo $fn | sed 's~^\.*/~~; s~[/.]~_~g; s/./\U&/g');
@rumpeltux
rumpeltux / paypal2qif.py
Last active September 25, 2022 13:18 — forked from jmk/paypal2ofx.py
import csv
import sys
from collections import namedtuple
# Enter whatever is your local currency.
LOCAL_CURRENCY = 'EUR'
rows = csv.reader(sys.stdin)
# This assumes that your PayPal language is set to English.