#์์ด๋ค์์ ํ๋ก์ธ์ค ๋คํ ๋ถ์ํ๊ธฐ
##์ค๋น๋ฌผ
##๋ฐฉ๋ฒ
| 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) |
| 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) |
| try: | |
| 1/0 | |
| finally: | |
| print 'in finally' |
| def life(): | |
| try: | |
| return 'egg'#์ถ์๊ณ๋ | |
| finally: | |
| return 42#the answer to life the universe and everything |
| 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 |
| pip install pyinstaller | |
| pyinstaller-script.py -F myscript.py |
| f=open('myfile') | |
| print os.fstat(f.fileno()).st_size |
| 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 |
#์์ด๋ค์์ ํ๋ก์ธ์ค ๋คํ ๋ถ์ํ๊ธฐ
##์ค๋น๋ฌผ
##๋ฐฉ๋ฒ
| # -*- coding: utf-8 -*- | |
| import time | |
| import pickle | |
| import struct | |
| from math import log,e | |
| from hashlib import md5 | |
| startBlock = 'cat' | |
| def mine(block,diff): |