This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <android/log.h> | |
#include <jni.h> | |
#include <binder/Binder.h> | |
#include <binder/Parcel.h> | |
#include <binder/IServiceManager.h> | |
#include <dlfcn.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <unistd.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from ghidra.program.model.address import Address | |
from ghidra.program.model.mem import MemoryAccessException | |
from ghidra.program.flatapi import FlatProgramAPI | |
from ghidra.util.task import TaskMonitor | |
import math | |
import json | |
from os.path import isfile, join, dirname | |
import struct as st | |
import string |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <speex/speex.h> | |
#include <iostream> | |
#include <fstream> | |
#include <vector> | |
#include <iterator> | |
#include <cassert> | |
int main(int argc, char const *argv[]) | |
{ | |
if (argc < 2) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sark | |
for segname in ['.bss', '.data']: | |
for line in sark.Segment(name=segname).lines: | |
if not line.name: | |
continue | |
if line.name.startswith('g_'): | |
continue |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def strs(f=None, visited=None, level=0, maxlevel=-1): | |
if maxlevel >= 0 and level > maxlevel: | |
return [], set() | |
if not f: | |
f = sark.Function() | |
if not visited: | |
visited = set() | |
root = True | |
else: | |
root = False |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def _masquerade(self,origin): | |
self.__class__ = type(origin.__class__.__name__,(self.__class__,origin.__class__),{}) | |
self.__dict__ = origin.__dict__ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from pyclibrary import CParser | |
import re | |
hook_template = ''' | |
(function() { | |
var name = '__NAME__'; | |
var address = Module.findExportByName(null, name); | |
if (address != null) { | |
console.log('[!] Hooking: ' + name + ' @ 0x' + address.toString(16)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Inserts C code directly into Python files, which can then be dynamically linked | |
in and called via ctypes. | |
""" | |
import atexit | |
import ctypes | |
import os | |
import shlex | |
import sys | |
import tempfile |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from pwn import * | |
context.bits = 64 | |
#libc = ELF('./libc-2.23.so') | |
libc = ELF('./libc-2.24.so') | |
main = ELF('./babyheap.dbg') | |
#main = ELF('./babyheap') | |
#dbg_file = './libc-2.23.debug' | |
def gdb_load_symbols_cmd(sym_file, elf, base): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
typedef void **va_list; | |
typedef uint8_t jboolean; | |
typedef int8_t jbyte; | |
typedef uint16_t jchar; | |
typedef int16_t jshort; | |
typedef int32_t jint; | |
typedef int64_t jlong; | |
typedef float jfloat; | |
typedef double jdouble; |
NewerOlder