Skip to content

Instantly share code, notes, and snippets.

# Load the contents of the receipt file
receipt_file = open('./receipt_data.bin', 'rb').read()
# Use asn1crypto's cms definitions to parse the PKCS#7 format
from asn1crypto.cms import ContentInfo
pkcs_container = ContentInfo.load(receipt_file)
# Extract the certificates, signature, and receipt_data
certificates = pkcs_container['content']['certificates']
signer_info = pkcs_container['content']['signer_infos'][0]
@andrewpedia
andrewpedia / dump-stack.js
Created January 30, 2024 15:03 — forked from oleavr/dump-stack.js
ArtStackVisitor example
const Java = require('frida-java-bridge');
const { getApi, withRunnableArtThread, ArtStackVisitor, translateMethod } = require('frida-java-bridge/lib/android');
Java.perform(() => {
const AccountManager = Java.use('android.accounts.AccountManager');
const m = AccountManager.getAccounts;
m.implementation = function (...args) {
console.log('getAccounts() called from: ' + JSON.stringify(captureBacktrace(), null, 2));
return m.apply(this, args);
@andrewpedia
andrewpedia / child-gating-poc.py
Created January 7, 2024 05:01 — forked from patois/child-gating-poc.py
Frida child-gating and spawn-gating example
"""
This POC is based on example from https://frida.re/news/#child-gating
and is aimed to instrument child processes along with the main one.
"""
from __future__ import print_function
import frida
from frida_tools.application import Reactor
import threading

ELF Format Cheatsheet

Introduction

Executable and Linkable Format (ELF), is the default binary format on Linux-based systems.

ELF

Compilation

@andrewpedia
andrewpedia / fridanotes.md
Created September 16, 2023 19:01 — forked from elevenchars/fridanotes.md
My notes on injecting a frida gadget into an apk
@andrewpedia
andrewpedia / help.vim
Created October 21, 2022 15:34 — forked from wbthomason/help.vim
Neovim: Open help in a floating window
scriptencoding utf-8
" This function originates from https://www.reddit.com/r/neovim/comments/eq1xpt/how_open_help_in_floating_windows/; it isn't mine
function! CreateCenteredFloatingWindow() abort
let width = min([&columns - 4, max([80, &columns - 20])])
let height = min([&lines - 4, max([20, &lines - 10])])
let top = ((&lines - height) / 2) - 1
let left = (&columns - width) / 2
let opts = {'relative': 'editor', 'row': top, 'col': left, 'width': width, 'height': height, 'style': 'minimal'}
@andrewpedia
andrewpedia / ios14-certificate-pinning-bypass.md
Created August 27, 2022 03:17 — forked from AkdM/ios14-certificate-pinning-bypass.md
iOS 14 app TLS decrypt / certificate pinning bypass steps

This is not a tutorial, just a small guide to myself but feel free to get some infos here.

Working on an iPhone 7 running iOS 14.5.1

  1. Jailbreak an iPhone/iPad/whatever

  2. If necessary, you'll need to bypass Jailbreak detection for some apps with tweaks like A-Bypass, Hestia, HideJB, etc.

  3. Get the PID of the app you want to capture traffic from with frida-ps -Ua ( a is for showing running apps only, you can -U to show all running processes instead)

@andrewpedia
andrewpedia / common.cy
Created August 19, 2022 07:57 — forked from G5t4r/common.cy
A script for cycript
// 打印按钮的action及其target
function actionWithTargets(button) {
var allTargets = [button allTargets].allObjects();
if (!allTargets) {
return "is not a uicontrol"
}
var allShow = [];
for (var i = 0; i < allTargets.length; i++) {
var target = allTargets[i];
var actions = [button actionsForTarget: target forControlEvent: UIControlEventTouchUpInside];

Disable Device Enrollment Notification on Mac.md

Restart the Mac in Recovery Mode by holding Comment-R during restart

Open Terminal in the recovery screen and type

csrutil disable
@andrewpedia
andrewpedia / FLASH_FULL_BASE.bat
Created February 13, 2022 09:13 — forked from zhuanyi/FLASH_FULL_BASE.bat
EMUI 9.1 Flasher Full Base Flashing Script
@echo off
echo *** WELCOME TO EMUI 9.1 Flasher by Vorion and Pretoriano80 ***
echo.
echo Thanks to @Ante0, @Atarii, @dkionline, @frantm, @lastfuckingdroid, @Mankindtw, @Pretoriano80, @shimp208, @zanooda123
echo ... and of course to [email protected]
echo.
pause
echo.
echo ******* PLEASE READ EVERYTHING THIS TOOLS TELLS YOU TO DO! *******