Skip to content

Instantly share code, notes, and snippets.

View NeatMonster's full-sized avatar

Alex A. NeatMonster

View GitHub Profile
@NeatMonster
NeatMonster / GASimple.java
Created October 21, 2015 20:06
Simple demo of a Genetic Algorithm (GA) (w/o JFreeChart)
package fr.neatmonster.labs;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collections;
@NeatMonster
NeatMonster / value-profiling.diff
Created June 28, 2017 15:40
This small patch adds support for value profiling into AFL 2.42b.
diff -Naur a/llvm_mode/afl-clang-fast.c b/llvm_mode/afl-clang-fast.c
--- a/llvm_mode/afl-clang-fast.c 2017-01-25 03:51:26.000000000 +0100
+++ b/llvm_mode/afl-clang-fast.c 2017-06-21 16:35:01.203146919 +0200
@@ -120,7 +120,28 @@
http://clang.llvm.org/docs/SanitizerCoverage.html#tracing-pcs-with-guards */
#ifdef USE_TRACE_PC
- cc_params[cc_par_cnt++] = "-fsanitize-coverage=trace-pc-guard";
+ u8 *trace_ind = "";
+ #ifdef USE_TRACE_IND
@NeatMonster
NeatMonster / test.c
Created June 28, 2017 15:54
Sample program for testing value profiling.
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <string.h>
#include <unistd.h>
typedef void (*F)();
static F t[256];
@NeatMonster
NeatMonster / value-profiling.diff
Created July 3, 2017 08:28
This small patch adds support for value profiling into AFL 2.44b.
diff -Naur a/llvm_mode/afl-llvm-rt.o.c b/llvm_mode/afl-llvm-rt.o.c
--- a/llvm_mode/afl-llvm-rt.o.c 2017-02-01 02:59:41.000000000 +0100
+++ b/llvm_mode/afl-llvm-rt.o.c 2017-06-29 15:55:53.052681442 +0200
@@ -304,3 +304,205 @@
}
}
+
+/* This function is called on every indirect call, but only if the binary has
+ been compiled with -fsanitize-coverage=trace-pc,indirect-calls. */
@NeatMonster
NeatMonster / frida-libjpeg.py
Created July 19, 2017 08:04
Dumping JPEGs w/ Frida
import frida, sys
images = {}
def on_message(message, data):
global image
if message['type'] == 'send':
if message['payload'].startswith('['):
message = message['payload']
save = message[message.index(']')+1:]
import ida_netnode
"""
You can also switch the shell into IDC mode and enter del_user_info().
You can also edit your `~/ida-x/cfg/ida.cfg` and set `STORE_USER_INFO` to `NO`.
"""
# This will replace the original user blob with the evaluation version blob.
ORIGINAL_USER = \
@NeatMonster
NeatMonster / dmca.txt
Created April 21, 2019 12:34
Companies that have issued the greatest number of DCMA requests to GitHub as of today
97 Pearson
76 Codility
52 Stereoarts
43 Webkul
43 FHAdmin
41 Attributor
37 OffensiveSecurity
35 Odoo
35 Jetbrains
29 Mobiscroll
import os
import sys
from construct import *
BOOT_IMG_HDR = Struct(
"magic" / Const(b"ANDROID!"),
"kernel_size" / Int32ul,
"kernel_addr" / Int32ul,
"ramdisk_size" / Int32ul,
import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
import org.objectweb.asm.ClassVisitor;
import org.objectweb.asm.ClassWriter;
import org.objectweb.asm.commons.ClassRemapper;
import argparse
from construct import Int16ul, Int64ul
def main(args):
with open(args.kernel, 'rb') as f:
data = f.read()
sym_addrs = data.find(Int64ul.build(0xffffff8008080000) * 2)
for offset in range(0, len(data), 0x100):