Skip to content

Instantly share code, notes, and snippets.

View nattybear's full-sized avatar

준규 nattybear

View GitHub Profile
@nattybear
nattybear / change.py
Created November 29, 2016 06:51
0x57 위치에 무조건 0x40을 씁니다.
from os import getcwd, listdir
from sys import argv
cwd = getcwd()
list = listdir(cwd)
list.remove(argv[0])
for i in list:
fp = open(i, 'rb')
buf = fp.read()
@nattybear
nattybear / arc.py
Last active November 29, 2016 14:31
from sys import argv, exit
from struct import unpack
from binascii import hexlify
from StringIO import StringIO
from os import getcwd
from zlib import decompress
from os import makedirs
from os.path import dirname
if len(argv) != 2:
zlib.decompress(string, zlib.MAX_WBITS | 16)
from sys import argv, exit
from struct import unpack
from StringIO import StringIO
if len(argv) != 2:
print '[*] Usage: python', argv[0], '<arc>'
exit()
fp = open(argv[1], 'rb')
fp.seek(6)
from sys import argv, exit
from StringIO import StringIO
if len(argv) != 2:
print 'Usage:', argv[0], '<txt>'
exit()
txt = argv[1]
new = txt.split('.')[0] + '.csv'
#include <bits/stdc++.h>
unsigned int convertendian(unsigned int x) {
unsigned int result = (x & 0xFF) << 24;
result| = ((x >> 8) & 0xFF) << 16;
result| = ((x >> 16) & 0xFF) << 8;
result| = ((x >> 24) & 0xFF);
return result;
}
from sys import argv, exit
from binascii import unhexlify
if len(argv) != 2:
print 'Usage:', 'unicodify.exe', '<txt>'
exit()
txt = argv[1]
new = 'unicode_' + txt
# python 2.7.9
# get factorial
def fact(n):
ret = 1
for i in range(1, n+1):
ret = ret * i
return ret
# get combination
def comb(n, k):
def fibo(n):
a, b = 1, 1
c = 1
while True:
if n == c: break
print 'fibonacci %d = %d' % (c, a)
a, b = b, a+b
c = c + 1
n = input("[*] Please input biggest integer n (n>=2, f0=0, f1=1) : ") + 1
count = 0
mylist = []
while count < 5:
num = int(input())
while num > 0:
mylist.append(num)