Skip to content

Instantly share code, notes, and snippets.

View hiromu's full-sized avatar

Hiromu Yakura hiromu

View GitHub Profile
DROP TABLE `myTable`;
CREATE TABLE `myTable` (
`id` mediumint(8) unsigned NOT NULL auto_increment,
`name` varchar(255) default NULL,
`password` varchar(255),
`permission` mediumint default NULL,
`score` varchar(100) default NULL,
PRIMARY KEY (`id`)
) AUTO_INCREMENT=1;
Well, this is a straightforward one; a classic case of a many time pad. The 12th message contains the flag.
Code:
import os
key = os.urandom(1024)
messages = [message.rstrip('\n') for message in open("messages")]
def xor_string(x, y):
an interesting play ..
Sam says "I love you, no really."
Mike says "Hot steamy grits!"
Mike says "Hot steamy grits!"
Mike says "No."
Sam says "Get off my colon"
Harold says "Who said OJ?"
Sam says "Who said OJ?"
@hiromu
hiromu / gist:7085032
Created October 21, 2013 14:42
SECCON 2013 香川大会 14. ↑↑↓↓←→←→ (Programming 200)
#!/usr/bin/env python
s = 0
count = 0
step = [(0, -0.8), (0, -0.8), (0, 0.8), (0, 0.8), (-0.8, 0), (0.8, 0), (-0.8, 0), (0.8, 0)]
def accelX():
return step[count % 8][0]
def accelY():
@hiromu
hiromu / pwclient
Created August 18, 2013 02:04
pwclient - fix bug about parsing command-line option - add option to specify filename
#!/usr/bin/env python
#
# Patchwork command line client
# Copyright (C) 2008 Nate Case <ncase@xes-inc.com>
#
# This file is part of the Patchwork package.
#
# Patchwork is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
@hiromu
hiromu / gist:5797766
Created June 17, 2013 15:25
Aizu Online Judgeから精進用スプレッドシートを作るGoogle Apps Script
function getAOJData(userid) {
var response = UrlFetchApp.fetch("http://judge.u-aizu.ac.jp/onlinejudge/webservice/user?id=" + userid);
if(response.getResponseCode() != 200)
return false;
var xml = response.getContentText();
var doc = Xml.parse(xml);
var data = doc.getElement();
var res = {};
@hiromu
hiromu / gist:5325264
Last active December 15, 2015 21:19
Arduino Analog Debug
void setup() {
Serial.begin(9600);
}
void loop() {
Serial.println(analogRead(0));
}
@hiromu
hiromu / Geometry.cpp
Created November 8, 2012 15:05
Library of Geometry
#include <iostream>
#include <algorithm>
#include <vector>
#include <cmath>
#include <limits.h>
#include <float.h>
#define eps 1e-10
#define M INT_MAX
using namespace std;
@hiromu
hiromu / sudden_death.py
Created October 7, 2012 12:07
Test for using Twitter Streaming API
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import tweepy
import json
import pymongo
db_host = 'localhost'
db_port = 27017
@hiromu
hiromu / main.cpp
Created January 5, 2012 15:07
Coin Puzzle
#include <vector>
#include <iostream>
using namespace std;
int ans[] = {100, 10, 100, 10, 100, 10, 100, 10};
void debug(vector<int> v)
{
int i;