Skip to content

Instantly share code, notes, and snippets.

💭
Mostly on gitlab.com/dweinstein these days...

David Weinstein dweinstein

💭
Mostly on gitlab.com/dweinstein these days...
View GitHub Profile
View sepsplit.c
/*
* SEP firmware split tool
*
* Copyright (c) 2017 xerub
*/
#include <fcntl.h>
#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
@tuupola
tuupola / protomower.sh
Last active Jun 16, 2020
Extract protocol buffer messages from binary data
View protomower.sh
#!/bin/bash
#
# Try to decode hidden protocol buffers message from binary
size=$(wc -c < $1)
for ((i=1; i<=$size; i++))
do
# Skip $i bytes and decode
dd if=$1 bs=1 skip=$i | protoc --decode_raw
@dweinstein
dweinstein / guess-encoding.js
Last active Oct 21, 2016
Guess encoding of zip based on `_zip_guess_encoding` from libzip
View guess-encoding.js
'use strict';
const ZIP_ENCODING_UNKNOWN = 0;
const ZIP_ENCODING_ASCII = 1;
const ZIP_ENCODING_UTF8_KNOWN = 2;
const ZIP_ENCODING_UTF8_GUESSED = 3;
const ZIP_ENCODING_CP437 = 4;
const ZIP_ENCODING_ERROR = 5;
module.exports.zipEncodings = {
@dweinstein
dweinstein / 0README.md
Last active Oct 9, 2016
Template for organizing Frida agents. Should make it easier for community to be able to reuse code. Example device side agents and how to potentially organize them.
View 0README.md

SUMMARY

The idea here is to organize multiple agent scripts into modules that can be combined into an aggregated agent.

frida agents generally live under e.g., an ./lib/agents directory in a top level project.

TODO

For each agent script we need a top level runner and then we use frida-compile to build into a single agent script that we can load.

@oleavr
oleavr / 00-README.md
Last active Sep 23, 2019
Frida devkit examples
View 00-README.md

frida-gum-example.c

$ clang -Wall -Os -pipe -g3 frida-gum-example.c -o frida-gum-example -L. -lfrida-gum -lresolv -Wl,-dead_strip -Wl,-no_compact_unwind
$ ./frida-gum-example
[*] open("/etc/hosts")
[*] close(3)
[*] open("/etc/fstab")
[*] close(-1)
[*] listener got 4 calls
[*] listener still has 4 calls
@f1sherman
f1sherman / forwarding-example.md
Last active Jun 23, 2020
Port Forwarding Example in OS X El Capitan
View forwarding-example.md

Add the following to /etc/pf.anchors/myname:

rdr pass on lo0 inet proto tcp from any to any port 80 -> 127.0.0.1 port 4000
rdr pass on lo0 inet proto tcp from any to any port 443 -> 127.0.0.1 port 4001

Add the following to /etc/pf-myname.conf:

rdr-anchor "forwarding"
load anchor "forwarding" from "/etc/pf.anchors/myname"
View Simulator_Tweaks.md

#Loading Tweaks in the Simulator

With the latest updates to the simulator, this turns out to be pretty simple:

You need to be using kirb/theos

In order not to require MobileSubstrate to be loaded and your tweak to be compiled for i386/x86_64, add

In your makefile:

@oleavr
oleavr / _FridaCommonJSIntegration.md
Last active Feb 17, 2016
How to consume npm modules from Frida agent scripts
View _FridaCommonJSIntegration.md

Install Node.js 5.x, then:

npm install frida co uuid

and run:

node app.js
@heapwolf
heapwolf / stacktrace.hpp
Last active Aug 29, 2016
a simple zero-touch, header only stack-trace provider for c++
View stacktrace.hpp
#ifndef STACK_TRACE_H
#define STACK_TRACE_H
#include <iostream>
#include <signal.h>
#include <string>
#include <dlfcn.h>
#include <cxxabi.h>
#include <regex>
#include <execinfo.h>
View -
BKAccelerometer_server
BKAccelerometer_server_routine
SBAcquireApplicationTerminationAssertion
SBActivateAssistantWithContext
SBAddAlertItemsSuppressionAssertion
SBAddBiometricUnlockSuppressionAssertion
SBAddDownloadingIconForDisplayIdentifier
SBAddDownloadingIconForDisplayIdentifierWithSoftwareType
SBAddThermalWarningSuppressionAssertion
SBAddWallpaperAnimationSuspensionAssertion
You can’t perform that action at this time.