Skip to content

Instantly share code, notes, and snippets.

@wkrsz
wkrsz / README
Last active March 6, 2018 03:12
Git pre-push hook that shows changes and ask for confirmation when pushing to production repo.
Whenever you push to remote that has "production" in its name,
this hook will show commits and changes and then ask for confirmation.
Copy or symlink to .git/hooks/pre-push.
Deployment by pushing code to remote github repo are very convenient
but prone to accidents. I wanted something that would force me to
review what's being pushed.
My Bash-foo is very limited to suggestions for improvements are very welcome.
@alexander-hanel
alexander-hanel / yolo.py
Last active January 17, 2020 03:40
old and new names in idc.py (in progress)
import re
import sys
import os
def load_apis():
new_old_apis = [
# start of changes for idc.py
("hasValue", "has_value"),
("byteValue", "byte_value"),
("isLoaded", "is_loaded"),
@avdi
avdi / gist:9038972
Created February 16, 2014 19:00
Get syntax highlighted source code for pasting into e.g. Google Docs on Linux
# You will need the pygments and xclip packages
# This example highlights some Bash source code
# '-O noclasses=true' tells pygments to embed colors inline in the source
# the '-t text/html' option tells xclip what "target" to specify for the selection
pygmentize -l bash -f html -O noclasses=true mysource.sh | xclip -selection clipboard -t text/html

Sadly I don't have a dev device on iOS 10, but for anyone playing around with zIVA caring about the kernel task port:

Starting with iOS 10.3 (and macOS 10.12.4), Apple changed convert_port_to_locked_task (and a few other port-to-something conversion functions) to blacklist the kernel task by means of a direct check. As a result, you can still obtain the kernel task port, but almost all APIs will simply treat it like MACH_PORT_NULL, thus rendering it useless. The check is a simple pointer comparison though, so it can be circumvented by just remapping the task struct at an additional virtual address and creating a new port from that with a ROP equivalent of:

vm_map_remap(
    kernel_map,
    &remap_addr,
    sizeof(task_t),
    0,

VM_FLAGS_ANYWHERE | VM_FLAGS_RETURN_DATA_ADDR,

@Siguza
Siguza / dsc_syms.c
Last active February 20, 2022 02:19
dyld_shared_cache symbols to r2 flags
// Moved here: https://github.com/Siguza/misc/blob/master/dsc_syms.c
@xerub
xerub / Simp.py
Last active July 15, 2022 00:18
AArch64 mov simplifier IDA plugin
# AArch64 mov simplifier IDA plugin
#
# Copyright (c) 2015 xerub
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
@evands
evands / combine_static_libraries.sh
Created January 14, 2015 20:40
Combine multiple .a static libraries, which may each have multiple architectures, into a single static library
#!/bin/sh
# Combined all static libaries in the current directory into a single static library
# It is hardcoded to use the i386, armv7, and armv7s architectures; this can easily be changed via the 'archs' variable at the top
# The script takes a single argument, which is the name of the final, combined library to be created.
#
# For example:
# => combine_static_libraries.sh combined-library
#
# Script by Evan Schoenberg, Regular Rate and Rhythm Software
@jj1bdx
jj1bdx / avr-devenv-install-macos.md
Last active January 25, 2023 10:47
Installing 8bit AVR development kit from macOS HomeBrew and FreeBSD Ports with the optiboot environment

AVR 8bit HomeBrew installation for macOS

In case you have a trouble for updating the tap, perform uninstalling of the related tools and osx-cross/avr tap:

brew remove avr-binutils avr-gcc
brew untap osx-cross/avr

For installing the tap, do the following:

@mems
mems / icloudtabs2md.js
Last active February 26, 2023 21:38
Generate a markdown links list from iCloud tabs
#!/usr/bin/env node
/*
Generate a markdown links list from iCloud tabs, on macOS
Usage:
./icloudtabs2md.js > icloudtabs.md
./icloudtabs2md.js | pbcopy
Require:
@cheesecakeufo
cheesecakeufo / xpc_idapro.py
Last active April 20, 2023 13:59
xpc functions fix - IDA
# Created to make RE-ing XPC a bit easier (in a shitty way)
# yes, somethings are hard-coded but I've done it because I don't want to spend more time on this
# created by Abraham Masri @cheesecakeufo
import re
import idaapi
import idautils
paths = ["/usr/include/xpc/xpc.h",
"/usr/include/xpc/activity.h",