Skip to content

Instantly share code, notes, and snippets.

@joshenders
joshenders / lldb-hand-rolled-headers.md
Created October 18, 2020 21:05 — forked from zcutlip/lldb-hand-rolled-headers.md
Importing Hand-Rolled C Header Files in LLDB

Importing Hand-Rolled C Header Files in LLDB

Scenario

  • We're debugging a dylib, libhello.dylib
  • The dylib is linked from hello
  • The exported function is helloworld()
  • We do not have source, but have reversed a struct from the library and created a hand-crafted header file

Header File

@joshenders
joshenders / make_ipxe_uefi_usb.md
Created August 29, 2017 08:10 — forked from AdrianKoshka/make_ipxe_uefi_usb.md
Making a UEFI bootable iPXE USB drive

Making a UEFI bootable iPXE USB drive

Build the UEFI executable for iPXE

# First we'll clone iPXE
$ git clone git://git.ipxe.org/ipxe.git
# Go into the src directory of the cloned git repo
$ cd ipxe/src
# Compile the UEFI iPXE executable
def params_to_dict(param_str):
splits = param_str.split(" ")
data = {}
prev_key = None
prev_val = None
for s in splits:
if "=" in s:
key, val = s.split("=")
if prev_key:
#include <netdb.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#define CANARY "in_the_coal_mine"
struct {
char buffer[1024];
#!/bin/sh
#
# Originally found here: http://jenders.vox.com/library/post/macports-workaround-for-installing-distcc-31-on-an-intel-mac.html
#
makefile=/opt/local/var/macports/sources/rsync.macports.org/release/ports/devel/distcc/work/distcc-3.1/Makefile
if test -e $makefile; then # user has a half completed installation
break
#!/usr/bin/env python2
# Quick and dirty demonstration of CVE-2014-0160 by Jared Stafford (jspenguin@jspenguin.org)
# The author disclaims copyright to this source code.
import sys
import struct
import socket
import time
import select
@joshenders
joshenders / gist:3976698
Last active November 7, 2015 07:15 — forked from vena/gist:2856490
How to install Netatalk 3.1.6 under Debian Wheezy

1. Install dependencies

apt-get install automake avahi-daemon build-essential checkinstall db5.1-util db-util git-core libacl1-dev libavahi-client-dev libdb5.1-dev libgcrypt11 libgcrypt11-dev libpam0g-dev libtool pkg-config

2. Download and unpack source

cd /usr/src/
wget http://prdownloads.sourceforge.net/netatalk/netatalk-3.1.6.tar.gz
tar -xvzf netatalk-3.1.6.tar.gz