Skip to content

Instantly share code, notes, and snippets.

Working from home


Working from home
View GitHub Profile
View iocp_client.c
#include <iostream>
using namespace std;
#include <windows.h>
#include <Winsock2.h>
#pragma comment(lib, "Ws2_32.lib")
void InitWs2();
void UninitWs32();
mwpcheung / usbimplementation.go
Last active Jan 12, 2021
golang tcp forward idevice
View usbimplementation.go
package main
import (
type USBController struct {
DeviceID map[string]int
mwpcheung / tlswithproxy.go
Created Jan 11, 2021
connect tls server with socks/https proxy
View tlswithproxy.go
package main
import (
mwpcheung /
Last active Jan 12, 2021
iOS list/delete Recently Deleted photo
void listRecentlyDeleted()
// iOS list system recently deleted photo and delete them
[PHPhotoLibrary requestAuthorization:^(PHAuthorizationStatus status) {
PHFetchOptions* opt = [[PHFetchOptions alloc]init];
opt.includeAllBurstAssets = YES;
opt.includeHiddenAssets = YES;
opt.includeAssetSourceTypes = YES;
PHFetchResult *result = [PHAssetCollection fetchAssetCollectionsWithType:PHAssetCollectionTypeSmartAlbum subtype:(PHAssetCollectionSubtype)1000000201 options:opt];
NSMutableArray* items = [[NSMutableArray alloc]init];
mwpcheung /
Created Oct 14, 2020
fix iOS13 nsdata descrption
void __attribute__((constructor)) constructor()
[NSData load];
@implementation NSData (hook)
+(void)load {
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
Method description = class_getInstanceMethod(self, @selector(description));
mwpcheung /
Created Apr 16, 2020 — forked from eyeplum/
Build Google Protobuf C++ Runtime for iOS
## Environments
# Exit the build pass if any command returns a non-zero value
#set -o errexit
# Echo commands
set -x
mwpcheung / install_m2crypto.txt
Created Jul 6, 2018 — forked from andrisasuke/install_m2crypto.txt
python install m2crypto on Mac OS X
View install_m2crypto.txt
$> brew install openssl
$> brew install swig
$> env LDFLAGS="-L$(brew --prefix openssl)/lib" \
CFLAGS="-I$(brew --prefix openssl)/include" \
SWIG_FEATURES="-cpperraswarn -includeall -I$(brew --prefix openssl)/include" \
pip install m2crypto