Skip to content

Instantly share code, notes, and snippets.

@hhc0null
hhc0null / q16_filter.c
Created December 6, 2014 05:53
あってるかどうかわからない
int filter(int size, char *shellcode)
{
int b1; // -0x10(%ebp)
int b2; // -0x14(%ebp)
int x; // -0xc(%ebp)
int y; // -0x8(%ebp)
int i; // -0x4(%ebp)
for(int i = 0; i < size; i+=2) {
b1 = (unsigned int)shellcode[i];
#!/usr/bin/env python2
# too sleepy.....it's kimoi.
# N = p*q
# C = M*(M+B) mod N
import binascii
import itertools
import string
@hhc0null
hhc0null / old_bata_collections.md
Last active September 8, 2020 13:22
bata's CTF problem collections

--- rev ---

MIDDLE

[PoliCTF 2012] Non-Section 500
[NuitDuHack 2013] Crackme300
[NuitDuHack 2013] Crackme500
DIFFICULT

[Hack.lu CTF 2012] #12 Donn Beach - 500

@hhc0null
hhc0null / day18.c
Created December 19, 2014 09:07
waiwai
int table[255] = {0};
int mark = 0xdeadbeef;
int index = 0;
void generate_table()
{
for(index; index < 0xff; index++) {
if(table[index] == 0) {
table[index] = mark;
} else if((index+1)&2) {
@hhc0null
hhc0null / vimrc
Created December 23, 2014 09:31
vimrc
" vim: set fdm=marker commentstring=:
" neobundle {{{
set nocompatible
filetype off
if has('vim_starting')
set runtimepath+=~/.vim/bundle/neobundle.vim
call neobundle#begin(expand('~/.vim/bundle/'))
endif
@hhc0null
hhc0null / day17.py
Last active August 29, 2015 14:12
ADCTF2014 Writeups(pwnable only)
#!/usr/bin/env python2
from pwning import *
import sys
if len(sys.argv) != 2:
print "Usage: {} [align]".format(sys.argv[0])
rhp = ("pwnable.katsudon.org", 32100)
#rhp = ("localhost", 32100)
i. identify the version
ii. pwn it!
@hhc0null
hhc0null / yabai.dump
Created December 31, 2014 19:39
ヤバい
int sub_8049110()
{
8049110: 5d pop %ebp // return address: 0x8048f06
8049111: 8b 45 00 mov 0x0(%ebp),%eax // eax = 0xfffffff
8049114: 83 e0 03 and $0x3,%eax
*ebp &= 3;
8049117: 83 f8 03 cmp $0x3,%eax
804911a: 75 42 jne 804915e <exit@plt+0xb8e>
if(*ebp == 3) {
804911c: 6a 00 push $0x0
@hhc0null
hhc0null / ezhp.c
Created January 1, 2015 15:54
a dirty decompiled code of ezhp(Plaid CTF 2014 Pwnbale 200pts)
/* I might me making some mistakes... */
#define NONUSE 0xfffffffe
#define INUSE 1
typedef struct _chunk {
int size;
chunk_t *next;
chunk_t *back;
} chunk_t;
@hhc0null
hhc0null / kendall.c
Last active August 29, 2015 14:16
BkpCTF 2015 Kendall
// .data section
char data_602800[] = "192.168.000.100";
char data_602810[] = "192.168.000.200";
char data_602820[] = "255.255.255.000";
char data_602830[] = "8.8.8.8";
// .bss section
char bss_602880[128]; // buffer
bool bss_602900; // flag: is_not_authenticated
int bss_602904; // sockfd