Skip to content

Instantly share code, notes, and snippets.

@hhc0null
hhc0null / 0010.cpp
Created August 10, 2013 05:46
AOJ0010
#include <cmath>
#include <cstdio>
#include <iostream>
#include <iomanip>
#include <stack>
#include <list>
#include <vector>
using namespace std;
@hhc0null
hhc0null / 0011.cpp
Created August 10, 2013 05:48
AOJ0011
// AOJ0011 ACed
#include <algorithm>
#include <cstdio>
#include <cmath>
#include <iostream>
#include <string>
using namespace std;
@hhc0null
hhc0null / fizzbuzz_20131028.c
Created October 27, 2013 16:36
i did my best...turai...
char b[10];
void fizzbuzz(int x){for(int i=1;i<=x;i++){sprintf(b,"%d",i),printf("%s\n",i%15?i%3?i%5?b:"buzz":"fizz":"fizzbuzz");}}
void main(int c,char **v) {fizzbuzz(atoi(v[1]));}
@hhc0null
hhc0null / call_main
Created December 28, 2013 13:59
debugging on x86_64
0x00007ffff780ccae in __libc_start_main () from /lib64/libc.so.6
10: /x $eax = 0xf7b7ef60
9: /x $ecx = 0x0
8: /x $edx = 0xffffe658
7: /x $ebx = 0x400e90 # <- main address
6: /x $esi = 0xffffe648
5: /x $edi = 0x1
2: /t $ps = 1000000110
1: x/4i $pc
=> 0x7ffff780ccae <__libc_start_main+142>: callq *%rbx # call main
@hhc0null
hhc0null / func_args
Created December 28, 2013 15:44
function arguments on x86_64
Function Arguments: RDI, RSI, RDX, RCX, R8, R9
@hhc0null
hhc0null / to_raw_unicode_escape.py
Last active January 1, 2016 18:39
this is a solver code for the PyExec of 30C3 CTF.
#!/usr/bin/env python2
from binascii import hexlify,unhexlify
code1 = """
import os
print str(os.listdir('.'))
"""
@hhc0null
hhc0null / .gdbinit
Created September 12, 2014 09:50
PEDA使えない環境?
# ~/.gdbinit
# show the 4 instructions include the next instruction to be executed.
display/4i $pc
# show the current EFLAGS.
display/t $ps
display/16wx $ebp - 0x20
display/16wx $esp
display/x $edi
display/x $esi
@hhc0null
hhc0null / un_code.c
Created October 15, 2014 10:45
un_code.c
/*
デフォルトで26.85に設定している.
_is_thermistor_adc_readyは1秒おきにtrueになる.(1秒おきに温度を取得して表示)
それ以外の間はずっと前回取得した値を表示する.
---
なぜか、26.85が表示されて、現在の値が表示されて、26.85が表示されて、現在の値が表示されて。。。という繰り返し
*/
void ControlRoutine(void)
{
@hhc0null
hhc0null / in-case-building-opencv-with-java.memo
Created October 29, 2014 10:28
In case you wanna build OpenCV with Java, set a JAVA_HOME variable.
it's necessary to do `export JAVA_HOME=/usr/lib/jvm/<jvm-directory>'.
@hhc0null
hhc0null / rpisverbose.txt
Last active August 29, 2015 14:08
RP IS VERBOSE!!!
# rp is verbose:( don't you think so?
rp -f [filename] -r 4|sed -r -e 's/\x1b\[[0-9]*m//g' -e 's/\(.*found\)//g'|grep -e 'ret[[:space:]]*;[[:space:]]*'