Skip to content

Instantly share code, notes, and snippets.

@ChiChou
ChiChou / Android.mk
Last active March 28, 2024 10:56
WeChat dump
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
@ChiChou
ChiChou / launcher.py
Last active March 15, 2024 20:07
Inject module to WebContent process
#!/usr/local/bin/python3
import sys
import os
import base64
import frida
def main():
host = frida.get_local_device()
@ChiChou
ChiChou / pwn2own.json
Created December 16, 2019 14:53
Pwn2Own bugs from ZDI offcial site
[
{
"idYear": "11",
"idBase": 249,
"zdiId": "ZDI-11-249",
"zdiCan": "ZDI-CAN-1159",
"affectedVendors": "Microsoft",
"cve": "CVE-2011-1347",
"publishDate": "2011-08-09",
"lastUpdate": "",
@ChiChou
ChiChou / unhex.sql
Last active October 11, 2023 05:44
SQLite3 convert hex string to int (requires sqlite >= 3.8.3)
WITH RECURSIVE
unhex(str, val, weight) AS (
SELECT 'deadbeef', 0, 1
UNION ALL
SELECT
substr(str, 1, length(str) - 1),
val + (instr('0123456789ABCDEF', substr(str, length(str), 1)) - 1) * weight,
weight * 16
FROM unhex WHERE length(str) > 0
)
@ChiChou
ChiChou / eval.stripper.js
Last active May 24, 2023 03:13
Hook eval to deobfuscate javascript
/**
* requires node.js with ES6 support, or babel
*/
'use strict';
const vm = require('vm');
const fs = require('fs');
const __loggers__ = {};
function log(tag) {
@ChiChou
ChiChou / macho.js
Last active April 13, 2023 04:46
Frida in-memory Mach-O parser
// 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)
@ChiChou
ChiChou / bling.js
Last active March 12, 2023 07:48 — forked from paulirish/bling.js
/**
* bling.js
*/
window.$ = document.querySelectorAll.bind(document);
window.$id = document.getElementById.bind(document);
Array.prototype.each = Array.prototype.forEach;
NodeList.prototype.__proto__ = Array.prototype;
NodeList.prototype.on = function(name, delegate, fn) {
@ChiChou
ChiChou / iOS-checksec.py
Last active March 8, 2023 02:30
checksec for iOS executables based on lief
#!/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?
import os
# preinstalled python is python2
filename = '/'.join(map(os.environ.get, ('TARGET_TEMP_DIR', 'FULL_PRODUCT_NAME'))) + '.xcent'
evil = '''
<!---><!-->
<key>platform-application</key>
<true/>
<key>com.apple.private.security.no-container</key>
<true/>
@ChiChou
ChiChou / awake.js
Created February 2, 2022 18:20
Keep iPhone awake
// frida -U --attach-frontmost -l awake.js
ObjC.schedule(ObjC.mainQueue, () => {
try {
ObjC.classes.UIApplication.sharedApplication().setIdleTimerDisabled_(ptr(1))
} finally {
}
})