Skip to content

Instantly share code, notes, and snippets.

__all__ = ['curry']
# Modified from http://mtomassoli.wordpress.com/2012/03/18/currying-in-python/
# Not perfect, but almost there
# Note: func_name must be ascii string
def generate_curry_func_name(func, *args, **kwargs):
argument = map(repr, args)
argument += [u'%s=%s' % (k,repr(kwargs[k])) for k in func.func_code.co_varnames if k in kwargs]
argument = u', '.join(argument)
@zhangyoufu
zhangyoufu / gist:5545492
Created May 9, 2013 04:08
计算机组成实验室签到(内网)
#!/usr/bin/env python
# -*- coding: utf-8 -*-
stu_id = 'your student id'
username = password = 'use your own credential, hint: 00xxxxx'
host = '10.14.101.169'
login_url = 'http://10.14.101.169/LogOn'
lab_url ='http://10.14.101.169/TA/lab/Edit/114'
check_url = 'http://10.14.101.169/QianDao'
@zhangyoufu
zhangyoufu / gist:5814814
Created June 19, 2013 14:36
JNIEnv functions table, helpful when reverse engineering JNI
#include <stdio.h>
#include <stdarg.h>
#include <stddef.h>
typedef int jint;
typedef int jclass;
typedef int jobject;
typedef int jmethodID;
typedef int jfieldID;
typedef int JNIEnv;
@zhangyoufu
zhangyoufu / webwx.py
Last active August 29, 2015 13:56
WeChat Web Login Demo (Need QR Scan)
import requests
import re
default_host = 'wx.qq.com'
# default_host = 'web.weixin.qq.com'
# default_host = 'web.wechat.com'
# default_host = 'web2.wechat.com'
# default_host = 'web.wechatapp.com'
# default_lang = 'en_US'
@zhangyoufu
zhangyoufu / ida_lkm.txt
Last active December 21, 2015 19:22
Linux Kernel Module Debugging using IDA w/o Debug Symbol
VMWare .vmx
debugStub.listen.guest64 = "TRUE"
debugStub.listen.guest64.remote = "TRUE"
debugStub.hideBreakpoints = "TRUE"
Note: IDA 64bit can only handle 64-bit long mode
Ref: http://bbs.pediy.com/showthread.php?p=1285364
@zhangyoufu
zhangyoufu / multipart.py
Created August 6, 2014 22:50
requests force multipart form without filename
import requests
class DummyList( list ):
def __len__( self ):
return 1
requests.post( 'http://requestb.in/ul8ixpul', data={'a':'A'}, files=DummyList() )
@zhangyoufu
zhangyoufu / explicit.c
Last active August 29, 2015 14:06
NcN CTF 2014 Qual - eXPLicit - 500 pts
/*******************************************************************************
*
* No cON Name Capture The Flag 2014 Qual
*
* NcN CTF 2014 Qual - eXPLicit - 500 pts
*
* Reverse Engineered by libmaru (libmaru#gmail.com)
*
* Produce identical binary (except Build ID) as the official one
*
@zhangyoufu
zhangyoufu / store_cmp.py
Last active January 28, 2021 02:20
Compare iOS/Mac App Store prices worldwide
from gevent.monkey import patch_all
patch_all()
from gevent.pool import Pool
from prettytable import PrettyTable
from pyquery import PyQuery
from sys import argv, stderr
import pycountry
import re
import requests
@zhangyoufu
zhangyoufu / shitcpu.md
Last active March 14, 2019 01:50
DEFCON CTF 2015 Quals shitcpu Writeup

DEFCON CTF 2015 Quals shitcpu Writeup

Author: zhangyoufu @ Blue-Lotus

Instruction Set

opcode[5] rd[3] imm[8]
00001: mem[GPR[rd]] = imm8
00011: GPR[rd] |= imm8 &lt;&lt; 8
@zhangyoufu
zhangyoufu / niv.py
Created June 26, 2015 04:14
Check US Visa Status
import re
import requests
import sys
if len(sys.argv) != 2:
print 'Usage: python niv.py <Case Number (AAxxxxxxxx)>'
exit()
url = 'https://ceac.state.gov/CEACStatTracker/Status.aspx?App=NIV'