Skip to content

Instantly share code, notes, and snippets.

View brinlyau's full-sized avatar

Brinly brinlyau

View GitHub Profile
@brinlyau
brinlyau / bn_patch_bti_to_nops.py
Created March 14, 2026 00:11
Patch BTI instructions to NOPS for devices without hw support for them.
import struct
def patch_bti_globally():
# ARM64 BTI variants byte patterns
# 0x5f2403d5 -> bti j
# 0x9f2403d5 -> bti c
# 0xdf2403d5 -> bti jc
bti_patterns = [
b"\x5f\x24\x03\xd5",
b"\x9f\x24\x03\xd5",
@brinlyau
brinlyau / biggest_funcs.py
Created March 4, 2026 06:32
binary ninja find biggest functions
tool = {
"name": "find_largest_functions",
"description": "Finds and displays the 25 largest functions in the binary by size, filtering for functions whose names start with 'sub_'",
"parameters": {
"properties": {},
"required": []
}
}
try:
**Last Updated:** February 24, 2026
## 1. Terms of Sale
By purchasing a "Pro" tier (Basic, Standard, or Savior) within the FreeLine app, you agree to the following:
* **Service vs. Software:** FreeLine is 100% open-source software. You are paying for the **convenience of a precompiled ready to use app**. This includes access to our routing API pings, cloud-based destination searching, and automated server maintenance.
* **One-Time Contribution:** All Pro upgrades are one-time payments, not subscriptions.
* **Donations:** A portion (20%) of net proceeds is donated to **OpenStreetMap (OSM)** and **HeiGIT** to support the global open-data ecosystem.
* **Refunds:** Transactions are processed by the Google Play Store. You may request a refund through the Google Play interface. For technical issues, contact `support@brinly.me` .
@brinlyau
brinlyau / extractkallsyms.c
Created February 20, 2026 20:59
Extract kallsyms from your Android boot.img
/*
* extract-kallsyms - Extract kernel symbol table from boot.img or raw kernel
*
* Supports boot image header versions 0-4 and kernel compression (LZ4, gzip).
* Handles both pre-6.4 and 6.4+ kallsyms layouts, relative and absolute addresses.
*
* Usage:
* extract-kallsyms -i boot.img [-o output_file]
* extract-kallsyms -k kernel_image [-o output_file]
*/
#!/usr/bin/env python3
"""
Scrape Google Project Zero issues and extract the first post content.
Usage:
python3 scrape_pzero.py "powervr"
python3 scrape_pzero.py "samsung" --status open
python3 scrape_pzero.py "qualcomm adreno" --status closed -o adreno.json
python3 scrape_pzero.py "webrtc" --status all --limit 10
@brinlyau
brinlyau / img4.patch
Created January 28, 2025 12:18
xerub img4tool patch for openssl brew
From 4b07a97c683c14e27993c446b924cb98a025fb7a Mon Sep 17 00:00:00 2001
From: Brinly <brinly@brinly.me>
Date: Wed, 17 Jan 2018 16:39:21 +1100
Subject: [PATCH] Make it compilable with brews openssl
---
Makefile | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/Makefile b/Makefile
@brinlyau
brinlyau / ImportR2File.py
Last active November 20, 2020 09:47 — forked from PsychoTea/ImportR2File.py
ImportR2File.py (IDA7.4 version)
#see https://twitter.com/iBSparkes/status/1321196435413602304
import idc
def define_func(addr, name):
idc.create_insn(addr)
ida_funcs.add_func(addr)
idc.set_name(addr, name, idc.SN_NOWARN)
print("%s @ %s" % (name, hex(addr)))
➜ arm64_intrinsics git:(master) ✗ cmake .
-- The C compiler identification is AppleClang 11.0.0.11000033
-- The CXX compiler identification is AppleClang 11.0.0.11000033
-- Check for working C compiler: /Library/Developer/CommandLineTools/usr/bin/cc
-- Check for working C compiler: /Library/Developer/CommandLineTools/usr/bin/cc - works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /Library/Developer/CommandLineTools/usr/bin/c++
{"bug_type":"210","timestamp":"2019-12-11 10:59:46.68 +1100","os_version":"iPhone OS 13.2.3 (17B111)","incident_id":"04B99C5C-7E33-4038-ADF0-710B1CDC5009"}
{
"build" : "iPhone OS 13.2.3 (17B111)",
"product" : "iPhone11,2",
"kernel" : "Darwin Kernel Version 19.0.0: Wed Oct 9 22:42:11 PDT 2019; root:xnu-6153.42.1~1\/RELEASE_ARM64_T8020",
"incident" : "04B99C5C-7E33-4038-ADF0-710B1CDC5009",
"crashReporterKey" : "c568d8d2a0afd599f21048b1eafda4fe1849a67c",
"date" : "2019-12-11 10:59:24.62 +1100",
"panicString" : "panic(cpu 4 caller 0xfffffff00d5aa6a0): AOP PANIC - SCMto:0 - prox(5)\nSCMto:0\nRTKit: RTKit_iOS-1264.42.21.debug - Client: AppleSPUFirmwareBuilder-233.0.4~11954\n!UUID: 583328ee-9a5f-36ed-89dd-4a7c1a4b5894\nTime: 0x0000000032d255ba\n\nFaulting task 0 Call Stack: 0x000000000108b898 0x000000000108b32c 0x0000000001075678 0x0000000001083070 0x0000000001082634 0x000000000101edf0 0x000000000101e7f4 0x000000000100ae30 0x000000000100af88 0x000000000106cc90 0x000000000102768c 0x000000000108bc20 0
From 9fa70def18054b4ce92e9818896ff69503aaa64c Mon Sep 17 00:00:00 2001
From: XiNGRZ <chenxingyu92@gmail.com>
Date: Thu, 13 Jul 2017 00:20:34 +0800
Subject: [PATCH 1/1] qpnp-haptic: make its strength adjustable via VibratorHW
Change-Id: I62f5de46e4d1cf4a911d3c487cfa7429177a6ff7
---
drivers/soc/qcom/qpnp-haptic.c | 41 ++++++++++++++++++++++++++++++----
1 file changed, 37 insertions(+), 4 deletions(-)