Skip to content

Instantly share code, notes, and snippets.

View jduck's full-sized avatar
🏠
Working from home

Joshua J. Drake jduck

🏠
Working from home
View GitHub Profile
@jduck
jduck / default.xml
Last active November 22, 2020 00:45
Manually created AOSP mirror manifest
<!-- remove this part!
Place this in $AOSPMIRROR/.repo/manifests/default.xml
Created with:
$ cd ~/android/source
$ repo init -u $AOSPMIRROR/platform/manifest.git -b android-4.4_r1
$ cd $AOSPMIRROR/.repo/manifests
$ cat ~/android/source/.repo/manifests/default.xml | sed -E 's/ path=\"[^\"]+\"//g' | ^Cd -E 's/ groups=\"[^\"]+\"//g' > default.xml
@jduck
jduck / strace-static.diff
Last active December 28, 2015 13:48
Enable static for building strace for Android
# dev:~/android/source/external/strace$ git diff
#
# to apply & build:
#
# dev:~/android/source/external/strace$ patch -p1 < strace-static.diff
# dev:~/android/source/external/strace$ cd ../..
# dev:~/android/source$ mmm external/strace
#
diff --git a/Android.mk b/Android.mk
index 5274280..4f1707e 100644
@jduck
jduck / adis.py
Last active February 2, 2017 15:28
Sample utility to disassemble a raw ARM bytecode file using Capstone.
#!/usr/bin/env python
#
# Simple utility to disassemble a raw bytecode file using Capstone.
#
# -jduck
#
import argparse
import capstone
import struct
@jduck
jduck / adb-stty-cd-data-local-tmp2.diff
Created February 6, 2014 17:58
Patch for AOSP's adb client to automatically change directory, set terminal size, and set environment vars.
#
# patch adb to:
# 1. use busybox to set the same terminal size
# 2. change directory to /data/local/tmp automatically
#
# NOTE: needs an executable busybox in /data/local/tmp
#
# Joshua J. Drake - jduck
#
### Keybase proof
I hereby claim:
* I am jduck on github.
* I am jduck (https://keybase.io/jduck) on keybase.
* I have a public key whose fingerprint is 6418 2CD3 AD92 C3E4 C60A 42BF 1373 2308 34DA 0132
To claim this, I am signing this object:
@jduck
jduck / trustnocerts.sh
Last active August 29, 2015 14:07
Disable all Trusted CA CERTs on Android 4.x and later (requires root)
#!/system/bin/sh
#
# disables all trusted root certs on your Android 4.x
# by jduck of #droidsec
#
# requires a working openssl binary in /data/local/tmp
# (you can build one from AOSP "make openssl")
#
# run this as system!! for example:
# shell@flo:/data/local/tmp $ su system -c ./trustnocerts.sh
@jduck
jduck / make-links.rb
Created December 7, 2014 18:44
Test results from an experiment with optimizing Metasploit
--- src/uniq.c.orig 2013-01-30 18:46:24.000000000 -0600
+++ src/uniq.c 2015-02-23 02:30:06.000000000 -0600
@@ -66,6 +66,7 @@
enum countmode
{
count_occurrences, /* -c Print count before output lines. */
+ count_syslog, /* -l Print "last line repeated XX times" */
count_none /* Default. Do not print counts. */
};
#!/usr/bin/env ruby
#
# PoC to show bug in ProgressBar/Zlib handling
#
# Joshua J. Drake (jduck)
#
COMPRESSED_WRONG_SIZE_URL = "http://sourceforge.net/projects/pocfiles/files/"
require 'uri'
diff --git a/project.py b/project.py
index 8b02b7c..890de8c 100644
--- a/project.py
+++ b/project.py
@@ -1878,6 +1878,7 @@ class Project(object):
ssh_proxy=ssh_proxy)
ret = gitcmd.Wait()
if ret == 0:
+ print(gitcmd.stderr, file=sys.stderr)
ok = True