Skip to content

Instantly share code, notes, and snippets.

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

mwpcheung

🏠
Working from home
View GitHub Profile
@mwpcheung
mwpcheung / amd64_asm_test.go
Created December 21, 2023 17:08
golang make amd64 shellcode call any address
package main
import (
"bytes"
"encoding/binary"
"fmt"
"simulator/gapstone"
"testing"
)
@mwpcheung
mwpcheung / arm64_asm_test.go
Created December 21, 2023 17:03
golang make arm64 shellcode to call any address
package main
import (
"bytes"
"encoding/binary"
"fmt"
"simulator/gapstone"
"testing"
)
#include <iostream>
using namespace std;
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <Winsock2.h>
#pragma comment(lib, "Ws2_32.lib")
void InitWs2();
void UninitWs32();
@mwpcheung
mwpcheung / usbimplementation.go
Last active January 12, 2021 05:08
golang tcp forward idevice
package main
import (
"log"
"sync"
)
type USBController struct {
DeviceID map[string]int
sync.RWMutex
@mwpcheung
mwpcheung / tlswithproxy.go
Created January 11, 2021 09:11
connect tls server with socks/https proxy
package main
import (
"bufio"
"bytes"
"crypto/tls"
"encoding/base64"
"encoding/hex"
"fmt"
"log"
@mwpcheung
mwpcheung / listRecentlyDeleted.mm
Last active January 12, 2021 05:09
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
mwpcheung / nsdata+hook.mm
Created October 14, 2020 05:18
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
mwpcheung / ios-static.sh
Created April 16, 2020 11:14 — forked from eyeplum/ios-static.sh
Build Google Protobuf C++ Runtime for iOS
#!/bin/bash
## Environments
# Exit the build pass if any command returns a non-zero value
#set -o errexit
# Echo commands
set -x
@mwpcheung
mwpcheung / install_m2crypto.txt
Created July 6, 2018 13:04 — forked from andrisasuke/install_m2crypto.txt
python install m2crypto on Mac OS X
$> 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