Skip to content

Instantly share code, notes, and snippets.

View SiD3W4y's full-sized avatar

Tanguy Dubroca SiD3W4y

View GitHub Profile
@SiD3W4y
SiD3W4y / covdiff.py
Created April 9, 2019 00:47
Script diffing two sets of GBA basic block traces
import sys
def getvals(path):
lines = open(path, "r").readlines()
lst = []
for line in lines:
line = line.strip()
if len(line) >= 10:
public static void main(String[] args) {
LinkedListHT ll = new LinkedListHT();
System.out.println("~~~ Test addHead Method ~~~");
System.out.println("Size of list should be 0, actually is: "+ll.size());
System.out.println();
ll.addHead(44); ll.addHead(222);
ll.addHead(6); ll.addHead(222);
System.out.println("List should be [222, 6, 222, 44].\nActually is: "+ll);
System.out.println();
@SiD3W4y
SiD3W4y / pinbf.py
Created February 18, 2019 21:57
Bruteforce solver for BadVM using intel PIN
import subprocess
import string
INSCOUNT_PATH="<path to pintools>/pintools/source/tools/ManualExamples/obj-intel64/inscount0.so"
def inscount(user_data):
# BadVM patched is a patched version removing the sleep calls
p = subprocess.Popen(['pin', '-t', INSCOUNT_PATH, '--', './BadVM_patched'],
stdin=subprocess.PIPE,
stdout=subprocess.PIPE,
@SiD3W4y
SiD3W4y / nid_list.txt
Created August 29, 2018 13:16
PSP nid list scraped from PPSSPP source
0x91E4F6A7,sceKernelLibcClock
0x27CC57F0,sceKernelLibcTime
0x71EC4271,sceKernelLibcGettimeofday
0xBFA98062,sceKernelDcacheInvalidateRange
0xC8186A58,sceKernelUtilsMd5Digest
0x9E5C5086,sceKernelUtilsMd5BlockInit
0x61E1E525,sceKernelUtilsMd5BlockUpdate
0xB8D24E78,sceKernelUtilsMd5BlockResult
0x840259F1,sceKernelUtilsSha1Digest
0xF8FCD5BA,sceKernelUtilsSha1BlockInit
@SiD3W4y
SiD3W4y / bruteforce_unicorn.py
Created March 1, 2018 21:14
Bruteforce script solving a fun reversing challenge made by BZHugs
from unicorn import *
from unicorn.x86_const import *
import struct
import sys
MAIN_SYM = 0x580
PTRACE_SYM = 0x560
PUTS_SYM = 0x550
@SiD3W4y
SiD3W4y / stealth.py
Created February 23, 2018 20:16
import unittest without using any obvious method, could be used to fake tests using unittest for automatic grading (theorically and with further improvement)
# it is the bytecode used in the code constructor
#def s():
# import unittest as m
# return m
# we need a dummy function to inject the code object in it
def dummy():
pass
dummy.__code__=type(dummy.__code__)(0,0,1,2,67,b'd\x01d\x00l\x00}\x00|\x00S\x00',(None,0),('unittest',),('m',),'','',1,b'\x00\x01\x08\x01')
import struct
# LSE LadyBot assembler lib
class Ops:
MOVE = 0x00
ADD = 0x10
EQ = 0x20
LT = 0x30
LE = 0x40
@SiD3W4y
SiD3W4y / example.c
Created September 17, 2017 13:11
Simple tutorial on Reverse Engineering and understanding assembly
#include <stdio.h>
int main()
{
int a = 2;
int b = 4;
int c = a + b + 3;
printf("Resultat %d\n",c);
from unicorn import *
from unicorn.x86_const import *
import struct
class FlagStream:
flag = "flag"
def __init__(self,pattern):
self.flag += pattern
@SiD3W4y
SiD3W4y / tablEZ_100.py
Last active November 4, 2017 08:26
Solver for CSAW CTF 2017 "tablez"
import struct
# Table dumped from executable
maybe_table = struct.pack ("512B", *[
0x01,0xbb,0x02,0x9b,0x03,0xc4,0x04,0x6c,0x05,0x4a,0x06,
0x2e,0x07,0x22,0x08,0x45,0x09,0x33,0x0a,0xb8,0x0b,0xd5,
0x0c,0x06,0x0d,0x0a,0x0e,0xbc,0x0f,0xfa,0x10,0x79,0x11,
0x24,0x12,0xe1,0x13,0xb2,0x14,0xbf,0x15,0x2c,0x16,0xad,
0x17,0x86,0x18,0x60,0x19,0xa4,0x1a,0xb6,0x1b,0xd8,0x1c,
0x59,0x1d,0x87,0x1e,0x41,0x1f,0x94,0x20,0x77,0x21,0xf0,