Skip to content

Instantly share code, notes, and snippets.

View RamseyK's full-sized avatar

Ramsey Kant RamseyK

View GitHub Profile
### Keybase proof
I hereby claim:
* I am ramseyk on github.
* I am ramseyk (https://keybase.io/ramseyk) on keybase.
* I have a public key ASCTmAL7-IClzz9Sh3KC1ddk2Ah-x1dQoE12fgZqmSCU2Ao
To claim this, I am signing this object:
@RamseyK
RamseyK / dyld_image_list.c
Last active December 25, 2020 12:44
Example code for retrieving loaded libraries using functions in dyld.h
#include <mach-o/dyld.h>
char *target_image_name = "libdyld";
const struct mach_header* target_mach_header = NULL;
const char *image_name = NULL;
int num_images = _dyld_image_count();
printf("%i images loaded\n", num_images);
for (int i = 0; i < num_images; i++) {
@RamseyK
RamseyK / plistp.sh
Last active October 20, 2018 22:59
plistp - Simple shell wrapper for PlistBuddy to print plists
#!/bin/sh
if [[ ! $1 ]] || [[ ! -f $1 ]]; then
echo "Provide a valid file"
exit
fi
/usr/libexec/PlistBuddy -x -c "Print" $1
@RamseyK
RamseyK / apple_source_download.py
Last active September 27, 2018 21:10
Download Apple Darwin Open Source tarballs - Useful for mirroring Apple sources
import argparse
import sys
import os
import requests
import re
def download(url, output_dir):
# Check to see if the tarball has already been downloaded to the output dir
@RamseyK
RamseyK / compile_protobuf-c_android.sh
Last active November 28, 2022 07:51
Cross compile protobuf and protobuf-c for Android ARM64
#!/usr/bin/env bash
export NDK_ROOT=/Users/"$(whoami)"/android-sdk/ndk-bundle
export ANDROID_NDK=${NDK_ROOT}
export ANDROID_NDK_ROOT=${NDK_ROOT}
export CXXSTL=$NDK_ROOT/sources/cxx-stl/gnu-libstdc++
export ARCH="arm64-v8a"
export CFLAGS="-DANDROID -fpermissive -Wno-format -fPIC -fPIE -pie -g -O2 -I../protobuf/arm64build/include"
export LDFLAGS="-Wl,--allow-shlib-undefined -fPIC -fPIE -pie -L$CXXSTL/libs/arm64-v8a/include -static-libstdc++ -L../protobuf/arm64build/lib"
export CXXFLAGS="-std=c++03 -Wno-c++11-long-long -Wno-c++11-extensions -I$CXXSTL/include $CFLAGS"