Skip to content

Instantly share code, notes, and snippets.

View feisuzhu's full-sized avatar

Proton feisuzhu

View GitHub Profile
@feisuzhu
feisuzhu / keeponline.py
Created December 14, 2011 13:17
CMCC-EDU keep online. Y U ALWAYS DROP OUT!!!
import urllib2 as ul
import time
import re
pattern = re.compile(r'<input type="hidden" name="(.*?)" id="\1" value="(.*?)"/>')
pwdstr = "&bpssUSERNAME=18354210483&bpssBUSPWD=891227"
flagstr = "&flag=true"
loginurl = "https://211.137.185.106:8443//mobilelogin.do"
tried = False
@feisuzhu
feisuzhu / extract.py
Created January 4, 2012 07:41
妖々剣戟夢想 bgm extractor
#!/usr/bin/python2
data = open("pack01.pak", "rb").read()
occurances = []
next = 0
while True:
next = data.find("Xiph.Org libVorbis", next+1)
if next == -1: break
@feisuzhu
feisuzhu / extractor.asm
Created January 4, 2012 09:47
妖々剣戟夢想 bgm extractor asm ver. Got no C compiler :(
;MASMPlus 代码模板 - 控制台程序
;link: /SUBSYSTEM:CONSOLE /nologo /SECTION:.text,RWE /MERGE:.rdata=.text /MERGE:.data=.text
.686
.model flat, stdcall
option casemap :none
include windows.inc
include kernel32.inc
include masm32.inc
@feisuzhu
feisuzhu / poly.c
Created January 8, 2012 13:34
aa's homework
#include <stdio.h>
#include <math.h>
#include <stdlib.h>
int SolveLEG(double **CoefMatrix, int ElmtCount, double **Solve)
{
//
// 解多元线性方程组函数 Solve Linear Equation Group.
//
@feisuzhu
feisuzhu / linear.py
Created March 24, 2012 06:18
Linear equations Python ver
#!/usr/bin/python2
class vec(object):
def __init__(self, val):
self.val = list(val)
def __add__(self, other):
return vec(a+b for a, b in zip(self.val, other.val))
def __sub__(self, other):
@feisuzhu
feisuzhu / linear.c
Created March 24, 2012 06:19
Linear equations C ver
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
void vec_add_times(float *vec, float *other, float times, int n)
{
while(n--) {
vec[n] += other[n] * times;
}
}
@feisuzhu
feisuzhu / validate.py
Created May 24, 2012 13:19
Autologin for ChinaNet
#!/usr/bin/python2
# -*- coding: utf-8 -*-
import urllib
import urllib2
import time
mapping = {
u'全国中心': u'zx',
u'全国': u'china',
@feisuzhu
feisuzhu / decode.py
Created May 24, 2012 13:23
Reversed an encrypt algorithm of a VB app
tbl1 = 'dBtEGkliy0aLvj61Ph2TIzQSfnY9ArmUFK4Rgs8uWxM7ObwoN3JcCq5VHDeXZp'
tbl2 = 'N04A83D7qTIoBMsyQdVLHPGWwiv59YhFX61RbCxftcmSkJlaEeuOg2pZUKzrnj'
def decode(s):
s = ''.join([tbl2[tbl1.index(i)] for i in s])
s1 = s[0::2]
s2 = s[1::2]
ss1 = [s1[i:i+2] for i in range(0, len(s1), 2)]
ss2 = [s2[i:i+2] for i in range(0, len(s2), 2)]
rst = ''
@feisuzhu
feisuzhu / sendmsg.php
Created September 27, 2012 13:13
PHP: accept form and send as mail
<?php
$str = '';
foreach($_POST as $k => $v) {
if(is_array($v)) {
$v = implode(', ', $v);
}
$str .= "$k: $v\n";
}
@feisuzhu
feisuzhu / extractor.py
Created April 30, 2013 08:03
Arkanoid TVI 'Isles.dat' extractor
import re
import struct
import zlib
import os
def ensure_dir(f):
d = os.path.dirname(f)
if not os.path.exists(d):
os.makedirs(d)