Skip to content

Instantly share code, notes, and snippets.

@axt
axt / bbhit_sample.out
Created March 2, 2014 23:10
Sample output of bbhit DynamoRIO tool
SOURCE:
=======
int a() {
printf("a");
}
int b(int x) {
int i;
printf("b");
if (x > 2) {
@axt
axt / bbhit.c
Last active September 18, 2020 07:56
Naive hit tracer implementation using DynamoRIO.
/*
* Naive hit tracer implementation using DynamoRIO.
*
* Author: axt
*
* Build it with the following commands:
* gcc -Dbbhit_EXPORTS -DSHOW_RESULTS -DSHOW_SYMBOLS -fPIC -I../include -I../ext/include -DX86_64 -DLINUX -O2 -fno-stack-protector -o bbhit.c.o -c bbhit.c
* gcc -fPIC -O2 -DX86_64 -DLINUX -fno-stack-protector -fPIC -shared -lgcc -Wl,--hash-style=both -shared -Wl,-soname,libbbhit.so -o libbbhit.so bbhit.c.o ../lib64/debug/libdynamorio.so.4.2 ../ext/lib64/debug/libdrsyms.so
*/
#include <stddef.h>
package hu.axt.iotrace;
import static com.sun.xml.internal.ws.org.objectweb.asm.Opcodes.ACC_FINAL;
import static com.sun.xml.internal.ws.org.objectweb.asm.Opcodes.ACC_PRIVATE;
import static com.sun.xml.internal.ws.org.objectweb.asm.Opcodes.ACC_PUBLIC;
import static com.sun.xml.internal.ws.org.objectweb.asm.Opcodes.ACC_STATIC;
import static com.sun.xml.internal.ws.org.objectweb.asm.Opcodes.ACC_SUPER;
import static com.sun.xml.internal.ws.org.objectweb.asm.Opcodes.ILOAD;
import static com.sun.xml.internal.ws.org.objectweb.asm.Opcodes.INVOKESPECIAL;
import static com.sun.xml.internal.ws.org.objectweb.asm.Opcodes.INVOKESTATIC;
@axt
axt / Crash.java
Created August 31, 2012 10:07
DB2 0Day POC
package org.axt.db2das;
import com.ibm.db2.das.core.DasException;
import com.ibm.db2.das.core.DasService;
import com.ibm.db2.das.core.DasServiceListener;
import com.ibm.db2.das.core.Sqlca;
class TestRunSysCmd implements DasServiceListener, Runnable {
private final String host;
private final byte desttype;
@axt
axt / gist:1240928
Created September 25, 2011 18:25
Runninc sunspider benchmarks to compare Rhino and V8 performance
import java.io.File;
import java.util.ArrayList;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import javax.script.Compilable;
import javax.script.CompiledScript;
import javax.script.ScriptEngine;
import javax.script.ScriptEngineManager;