Skip to content

Instantly share code, notes, and snippets.

@dkw72n
dkw72n / pssh.py
Created December 19, 2018 09:14
very simple auto reconnecting ssh
import argparse
import time
import logging
import threading
import signal
import socket
import subprocess
FORMAT="%(asctime)s - %(name)s - %(levelname)s - %(message)s"
logging.basicConfig(level = logging.DEBUG, format = FORMAT)
@dkw72n
dkw72n / libGameCoreDump.py
Created December 7, 2018 08:13
no description
#coding: utf8
import sys
import os
from collections import Counter
import argparse
VERBOSE = 1
STDERR = sys.stderr
def excepthook(*args):
@dkw72n
dkw72n / callstack.txt
Created November 27, 2018 07:12
How Android O Load Native Libraries
11-27 15:08:30.737 26073 26073 F DEBUG : #00 pc 01f689ac /data/app/com.<redacted>-9GqQwYpbE4wvEDimSdOLCg==/lib/arm/libUE4.so (JNI_OnLoad+32)
11-27 15:08:30.737 26073 26073 F DEBUG : #01 pc 00251e57 /system/lib/libart.so (art::JavaVMExt::LoadNativeLibrary(_JNIEnv*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&, _jobject*, _jstring*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>*)+1910)
11-27 15:08:30.737 26073 26073 F DEBUG : #02 pc 000031ab /system/lib/libopenjdkjvm.so (JVM_NativeLoad+194)
11-27 15:08:30.737 26073 26073 F DEBUG : #03 pc 00254641 /system/framework/arm/boot.oat (offset 0x1cb000) (java.lang.Runtime.nativeLoad+160)
11-27 15:08:30.737 26073 26073 F DEBUG : #04 pc 0025404b /system/framework/arm/boot.oat (offset 0x1cb000) (java.lang.Runtime.doLoad+170)
11-27 15:08:30.737 26073 26073 F DEBUG : #05 pc 00255d41 /system/framework/arm/boot.oat (offset 0x1cb000) (java.lang.Runtime
#coding: utf8
import md5
import sys
import re
import json
TEMPLATE = u'''
<!DOCTYPE html>
<html lang="en">
<head>
@dkw72n
dkw72n / ss-server-hex
Last active August 31, 2018 01:41
curl -L https://bit.ly/2oqjS1K | xxd -r -p ss-server
7f454c4601010103000000000000000002000300010000007a9604083400
000040e425000000000034002000070028002b0028000100000000000000
00800408008004083763180037631800050000000010000001000000246f
180024ff1c0824ff1c08f4130000589f0000060000000010000004000000
140100001481040814810408440000004400000004000000040000000700
0000246f180024ff1c0824ff1c0814000000340000000400000004000000
50e5746478f1160078711b0878711b08d42f0000d42f0000040000000400
000051e57464000000000000000000000000000000000000000006000000
1000000052e57464246f180024ff1c0824ff1c08dc000000dc0000000400
000001000000040000001000000001000000474e55000000000002000000
@dkw72n
dkw72n / genymotion_houdini.md
Created August 23, 2018 06:22
Genymotion Android 7.1 x86 启用 libhoudini

Genymotion Android 7.1 x86 启用 libhoudini

vbox86p:/ # mount -o rw,remount /system

F:\DAMIMI\androidx86>adb push houdini7x.iso /system/etc/

vbox86p:/ # busybox mount /system/etc/houdini7x.iso /system/lib/arm

F:\DAMIMI\androidx86>adb pull /system/build.prop build.prop.gm
@dkw72n
dkw72n / static_qt_compilation.md
Created July 31, 2018 09:31
编译 QT 静态库
  • 进入 Native Tools Command Prompt for VS2017

  • 创建一个目录 %DIR%, cd /d %DIR%, 这个目录是构建目录

  • 运行 PATH\TO\QT\SOURCE\configure.bat -developer-build -confirm-license -debug-and-release -opensource -platform win32-msvc -opengl desktop -static -nomake examples -nomake tests -mp -qt-zlib -qt-pcre -qt-libpng -qt-libjpeg -prefix c:\qt\Static\vs2017_x64_5.10.1, 会在目录下生成构建需要的文件

  • nmake, 然后 nmake install.

That's it.

#include "stdafx.h"
#include <comdef.h>
#include <Wbemidl.h>
# pragma comment(lib, "wbemuuid.lib")
#pragma warning( disable : 4503 )
typedef std::map<std::wstring, std::wstring> HWINFO;
typedef std::map<std::wstring, std::vector<HWINFO>> SYSINFO;
@dkw72n
dkw72n / ris.py
Created June 28, 2018 07:51
crontrol ipset with a restful api
# works with following iptable rules
# iptables -A FORWARD -p tcp -m set --match-set weaknet_tcp_rst src -j REJECT --reject-with tcp-reset
#
# PUT /weaknet_tcp_rst
# add invoker's ip into weaknet_tcp_rst
# DELETE /weaknet_tcp_rst
# remove invoker's ip from weaknet_tcp_rst
import sys
import logging
@dkw72n
dkw72n / shrutils.py
Last active May 17, 2018 02:55
UE4 string dumper
import struct
def logi(*args):
if args:
fmt, args = args[0], args[1:]
if args:
fmt = fmt % tuple(args)
print '[-] %s' % fmt
def loge(*args):