Skip to content

Instantly share code, notes, and snippets.

View arbipher's full-sized avatar
🐪

Weng Shiwei 翁士伟 arbipher

🐪
View GitHub Profile
@arbipher
arbipher / .go
Created November 2, 2017 16:13
golang crypto randint
func RandomNumber(max *big.Int) *big.Int {
n, err := rand.Int(rand.Reader, max)
if err != nil {
fmt.Println(err)
panic("error random number")
}
return n
}
@arbipher
arbipher / brute.py
Last active November 13, 2017 06:32
#!/usr/bin/env python3
import requests
import re
import sys
from multiprocessing.dummy import Pool, Manager
import concurrent.futures
site = 'http://10.0.0.8'
login_page = site + '/DVWA/login.php'
@arbipher
arbipher / DDPA.code
Last active December 3, 2017 04:52
gradual typing tests
# EXPECT-WELL-FORMED
tr = true;
fl = false;
one = 1;
f = fun x -> (
rf = x + one
);
#!/bin/python3
import math
import os
import random
import re
import sys
from collections import deque
@arbipher
arbipher / oracle.ml
Last active November 21, 2019 18:58
generate inf bool stream
module Oracle = struct
(* encoding count as co-binary
0 = t inf_t
1 = f inf_t
2 .. 3 = b f inf_t
4 .. 7 = b^2 f inf_t
...
2^k .. 2^(k+1)-1 = b^k f inf_t
\bar{b^k f} is the mirror of \bar{f b^k}, in which f is the MSB bit
@arbipher
arbipher / debug.ml
Last active December 20, 2019 14:38
code on angstrom
(* #require "Angstrom";; *)
open Angstrom
type exp =
| Int of int
| Plus of exp * exp
let (let*) = (>>=)
let ws = skip_while (function
@arbipher
arbipher / lambda.ml
Last active May 31, 2020 06:06
parse a naive language by angstrom
#require "angstrom";;
open Angstrom
type tid = string
and exp =
| Var of tid
| Neg of exp
| Int of int
| Plus of exp * exp
@arbipher
arbipher / z3datatype.ml
Created November 6, 2020 21:40
z3-datatype-ocaml
open Z3
let ctx : context = mk_context []
let solver : Solver.solver = Solver.mk_solver ctx None
let intSort : Sort.sort = Arithmetic.Integer.mk_sort ctx
let boolSort : Sort.sort = Boolean.mk_sort ctx
V "4.8.9.0"
R
C 3
= 0x55c429b82298
R
P 0x55c429b82298
C 7
= 0x55c42a5b59d8
R
P 0x55c429b82298
@arbipher
arbipher / search-git.sh
Created August 27, 2021 18:51
search git history
for commit in $(cat losted.txt | awk '$2 == "commit" { print $3 }'); do git cat-file -p $commit | grep SMTProver; break; done