Skip to content

Instantly share code, notes, and snippets.

View nick-botticelli's full-sized avatar
💭
busy patching kernelcache.release.vma2

Nick Botticelli nick-botticelli

💭
busy patching kernelcache.release.vma2
View GitHub Profile
@iso2022jp
iso2022jp / base94.c
Created November 11, 2012 09:05
base94 encoder/decoder
#include "base94.h"
void base94_encode(const unsigned char *plain, unsigned char *code) {
// high * 2^64 | low
unsigned long long value
= ((unsigned long long)plain[1] << 56) | ((unsigned long long)plain[2] << 48)
| ((unsigned long long)plain[3] << 40) | ((unsigned long long)plain[4] << 32)
@olasd
olasd / stream_to_youtube.sh
Created March 28, 2014 19:58
Stream video to youtube via ffmpeg
#! /bin/bash
#
# Diffusion youtube avec ffmpeg
# Configurer youtube avec une résolution 720p. La vidéo n'est pas scalée.
VBR="2500k" # Bitrate de la vidéo en sortie
FPS="30" # FPS de la vidéo en sortie
QUAL="medium" # Preset de qualité FFMPEG
YOUTUBE_URL="rtmp://a.rtmp.youtube.com/live2" # URL de base RTMP youtube
@o11c
o11c / ctor.cpp
Created April 14, 2014 23:10
llvm global constructors
#include <cstdio>
struct Foo
{
Foo()
{
puts("Hello, ");
}
};
@C0deH4cker
C0deH4cker / macho_extractor.c
Last active November 2, 2023 14:47
Program that will extract a segment from a mach-o file. Should even work on Linux/BSD/UNIX?
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#include <stdint.h>
#include <string.h>
#include <unistd.h>
#include <fcntl.h>
#include <sys/mman.h>
/* For supporting Linux and other systems that don't have mach-o headers */

CLang optimizations on Mac OSX

Version:

Apple LLVM version 6.0 (clang-600.0.57) (based on LLVM 3.5svn)
Target: x86_64-apple-darwin14.1.0
Thread model: posix

This was made with commands:

@ikonst
ikonst / cfdata.py
Last active July 11, 2024 04:33
LLDB extension for saving CFData to local file; useful for remote iOS debugging
'''
INSTALLING
curl --create-dirs -o ~/.lldb/cfdata.py https://gist.githubusercontent.com/ikonst/364af37c44e5f549b722/raw/cfdata.py \
&& echo 'command script import ~/.lldb/cfdata.py' >> ~/.lldbinit
USING
(lldb) cfdata_save some_cfdata /Users/john/foo
(lldb) cfdata_save some_nsdata /Users/john/bar
@hvmonteiro
hvmonteiro / legal-notice-example01
Last active April 29, 2025 08:33
LEGAL Notices for Login/MOTD unix banners
@Petrakeas
Petrakeas / renderscriptresize.java
Last active February 17, 2021 06:57
A method that uses RenderScript to downscale an image without aliasing.
public static Bitmap resizeBitmap2(RenderScript rs, Bitmap src, int dstWidth) {
Bitmap.Config bitmapConfig = src.getConfig();
int srcWidth = src.getWidth();
int srcHeight = src.getHeight();
float srcAspectRatio = (float) srcWidth / srcHeight;
int dstHeight = (int) (dstWidth / srcAspectRatio);
float resizeRatio = (float) srcWidth / dstWidth;
/* Calculate gaussian's radius */
@userlandkernel
userlandkernel / off_finder.sh
Last active November 23, 2023 18:00
Finds all symbol offsets in a decompressed XNU kernelcache
#!/bin/sh
RADARE="$(which rabin2)" #We need rabin2
KERNELCACHE_FILE="$1" #This will be the path to a decompressed kernelcace, e.g: /tmp/kernel
OFFSETS_FILE="$2" #This is the path and name of the file where the offsets should be stored in, don't add .c or .h the script will do!
STRUCTNAME="$3"
H_FILE="$OFFSETS_FILE.h" # your_chosen_name.h
C_FILE="$OFFSETS_FILE.c" # your_chosen_name.c
@userlandkernel
userlandkernel / diagsj72ap.log
Created November 7, 2019 22:20
Spooky scary internal skeletons
help
DiagShell builtin commands:
"time" time <command-line ...>
"echo" echo <arguments ...>
"waitfor" waitfor <timeout-milliseconds> <string-to-match>
"repeat" repeat <time-spec> <command line ...>
"alias" alias [<name>[=<command line>]]
"unalias" unalias <name>
"true" true