Skip to content

Instantly share code, notes, and snippets.

View anch0vy's full-sized avatar
😸
Working from home

anch0vy anch0vy

😸
Working from home
View GitHub Profile
@anch0vy
anch0vy / ch0vycoin.py
Created August 5, 2015 08:08
ch0vycoin
# -*- coding: utf-8 -*-
import time
import pickle
import struct
from math import log,e
from hashlib import md5
startBlock = 'cat'
def mine(block,diff):
@anch0vy
anch0vy / ida_dump.md
Created August 4, 2015 16:03
IDA에서 dump 분석하기
def wtf(r):
global dontknow_table
for x in range(len(dontknow_table)):
dontknow_table[x]^=xor_table[r]
r3=0x0
while 1:
r7 = [input[r3:r3+2][::-1] - 0x3332][::-1]
r7 = ~r7
f=open('myfile')
print os.fstat(f.fileno()).st_size
pip install pyinstaller
pyinstaller-script.py -F myscript.py
import sys
import math
if __name__=='__main__':
for x in sys.argv[1:]:
counts=[0]*256
entropy=0
with open(x,'rb') as f:
fr=f.read()
for xx in fr:
counts[ord(xx)]+=1
def life():
try:
return 'egg'#삶은계란
finally:
return 42#the answer to life the universe and everything
try:
1/0
finally:
print 'in finally'
import socket
import os
s = socket.socket(socket.AF_INET, socket.SOCK_RAW, socket.IPPROTO_TCP)
if os.name=='nt':
HOST = socket.gethostbyname(socket.gethostname())
s.bind((HOST, 0))
s.setsockopt(socket.IPPROTO_IP, socket.IP_HDRINCL, 1)
s.ioctl(socket.SIO_RCVALL, socket.RCVALL_ON)
while True:
RawPacketData,(ip,port)=s.recvfrom(65565)
import socket
import StringIO
import struct
from struct import pack
def make_packet(bf,ori):
len_ori=len(ori)
if len(ori)%8!=0:
ori=ori+'\x00'*(8-len(ori)%8)
encoded=bf.encode(ori)
len_enc=len(encoded)