Skip to content

Instantly share code, notes, and snippets.

View zckevin's full-sized avatar
🏠
Working from home

zckevin

🏠
Working from home
View GitHub Profile
@zckevin
zckevin / run.sh
Created July 4, 2019 00:20
Phicomm N1 as router
#!/bin/bash
nohup /root/ssr/installed/bin/ss-local -u -c /root/shadowsocksr.json >/dev/null 2>&1 &
nohup /root/overture/overture-linux-arm64 -c /root/overture/config.json >/dev/null 2>&1 &
nohup /root/tun2socks-linux-arm64 \
-proxyType socks \
-proxyServer localhost:12345 \
-tunName tun0 \
-tunAddr 241.0.0.2 -tunGw 241.0.0.1 \
-loglevel debug \
@zckevin
zckevin / map_gen.js
Created July 6, 2019 07:36
Generate prepack input for xxx.
var m = {}
Object.getOwnPropertyNames(window).filter(key => {
let s = window[key] && window[key].toString()
return !key.startsWith("_$") && s && s.indexOf("native code") != -1
}).map(key => {
let fn = window[key]
let ownKeys = [], protoKeys = []
if (fn) {
ownKeys = Object.getOwnPropertyNames(fn).filter(s => {
if (s === "caller" || s === "callee" || s === "arguments" || s === "constructor") return false
@zckevin
zckevin / runtime-debug.db22c3fb5c.patch
Last active July 7, 2019 03:55
Accessing variables trapped by JavaScript closure using V8 runtime functions.
diff --git a/src/runtime/runtime-debug.cc b/src/runtime/runtime-debug.cc
index 98aa3b98e7..2e424ead9e 100644
--- a/src/runtime/runtime-debug.cc
+++ b/src/runtime/runtime-debug.cc
@@ -322,18 +322,19 @@ RUNTIME_FUNCTION(Runtime_GetGeneratorScopeDetails) {
HandleScope scope(isolate);
DCHECK_EQ(2, args.length());
- if (!args[0]->IsJSGeneratorObject()) {
- return ReadOnlyRoots(isolate).undefined_value();
@zckevin
zckevin / raw.js
Created July 7, 2019 04:11
mmEwMD
var _$gm = function _$gm(_$tM, _$rZ) {
var _$de;
return function(_$vl, _$aZ) {
if (_$de === _$yV) {
_$de = _$ar(_$wL(_$tM), _$wL(_$rZ));
}
return _$de;
};
}
var _$xa = function _$xa(_$rZ) {
// 1. filter out toxic function
let _key = userFns.filter(key=> {
let fn = window[key]
if (testHack(fn)) return key
return false
})[1];
window[_key] = function() {}
// 2. then, wrap all functions
function _wrap(k) {
@zckevin
zckevin / mitm.py
Created August 12, 2019 09:05
Using mitmproxy to inject Javascript file.
# Mitmproxy: 4.0.4
# Python: 3.6.5
# OpenSSL: OpenSSL 1.1.0h-fips 27 Mar 2018
# Platform: Linux-4.16.3-301.fc28.x86_64-x86_64-with-fedora-28-Twenty_Eight
# usage
# mitmdump -p $LISTEN_PORT -s ./mitm.py
import os
from bs4 import BeautifulSoup
@zckevin
zckevin / .gclient
Last active August 15, 2019 04:00
Compile chromium from scratch
solutions = [
{ "name" : "src",
"url" : "https://chromium.googlesource.com/chromium/src.git",
"deps_file" : "DEPS",
"managed" : True,
"custom_deps" : {
},
"custom_vars": {},
},
];
@zckevin
zckevin / run.sh
Last active August 15, 2019 01:25
Build chrome from sharepoint backup
systemctl stop firewalld
# compiling dependencies
dnf install mosh tmux git python bzip2 tar pkgconfig atk-devel alsa-lib-devel \
bison binutils brlapi-devel bluez-libs-devel bzip2-devel cairo-devel \
cups-devel dbus-devel dbus-glib-devel expat-devel fontconfig-devel \
freetype-devel gcc-c++ glib2-devel glibc gperf glib2-devel \
gtk3-devel java-1.8.0-openjdk-devel libatomic libcap-devel libffi-devel \
libgcc libgnome-keyring-devel libjpeg-devel libstdc++ libX11-devel \
libXScrnSaver-devel libXtst-devel libxkbcommon-x11-devel ncurses-compat-libs \
@zckevin
zckevin / wgcf.py
Created October 27, 2019 13:55 — forked from oskar456/wgcf.py
Cloudflare WARP linux client (using wg-quick for actual tunnel setup)
#!/usr/bin/env python3
import subprocess
import json
import os
from pathlib import Path
import requests
from requests.compat import urljoin