Skip to content

Instantly share code, notes, and snippets.

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

qunwang6

🏠
Working from home
View GitHub Profile
@qunwang6
qunwang6 / objc_description.m
Created March 20, 2024 01:08 — forked from DerekSelander/objc_description.m
Dumps Objective-C class/instance info at runtime
//
// MIT License
//
// Copyright (c) 2024 Derek Selander
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
@qunwang6
qunwang6 / fairplay_iokit_uc_run_versioned.c
Created February 4, 2021 00:59 — forked from pwn0rz/fairplay_iokit_uc_run_versioned.c
CVE-2021-1791 Fairplay OOB Read POC
#include <IOKit/IOKitLib.h>
#include <mach/mach.h>
#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
#include <ctype.h>
void hexdump(void *ptr, int buflen) {
unsigned char *buf = (unsigned char*)ptr;
int i, j;
The issue is caused by an incorrect software catelog. As apple is releasing big sur thursday, they changed the software catelog to the production one. The problem is that the production one does not yet have the bridge os firmware for big sur just yet. So in order to update right now you need to change back to the devleoper catelog.
//Set software catalog to developer
sudo nvram IASUCatalogURL=https://swscan.apple.com/content/catalogs/others/index-10.16seed-10.16-10.15-10.14-10.13-10.12-10.11-10.10-10.9-mountainlion-lion-snowleopard-leopard.merged-1.sucatalog
// Once updated, restore your NVRAM back to default for future updates
sudo nvram -d IASUCatalogURL
@qunwang6
qunwang6 / Apple resigning an ipa
Created April 4, 2020 16:06 — forked from phatfly/Apple resigning an ipa
Resigning an iOS xcarchive for the app store (xcarchive to ipa)
Resigning an iOS ipa for the app store
Introduction
Friday, October 18, 2019
For the release of company iOS applications to the Apple app store we need to resign those apps with our appropriate distribution certificate. This is the process you need to follow, as-of-this-writing, to properly re-sign an foo.ipa to upload to Apple using the Application Loader.
This writing is making the assumption that the foo.ipa bundle that you has been created appropriately and that is only needs to be resigned.
@qunwang6
qunwang6 / sshguard_banned_ips.sh
Created March 7, 2020 13:08 — forked from rlei/sshguard_banned_ips.sh
Generate CSV of country/city/geo location/ISP information of the IPs banned by sshguard. Requires jq (https://stedolan.github.io/jq/).
#!/bin/sh
echo '"country","city","latitude","longitude","ISP","organization","IP"'
sudo iptables-save | grep sshguard | grep -oE '[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+' | xargs -I{} curl -s http://ip-api.com/json/{} | jq -r '[.country, .city, .lat, .lon, .isp, .org, .query] | @csv'
@qunwang6
qunwang6 / Set_Proxy.md
Created March 6, 2020 11:48 — forked from maboloshi/Set_Proxy.md
[软件 Proxy 设置] #proxy #git #ssh #chrome #Sublime-Text-3

软件 Proxy 设置

Proxy 一般有2种协议,一种是 HTTP/HTTPS 协议,一种是 SOCKS 协议。优先使用 SOCKS 协议的 SOCKS5 版本。[2种协议的区别 待补充外部引用]

一般各平台的 Shadowsocks 客户端除了提供一个本地的 socks5 Proxy ,还会提供一个本地的 http Proxy 。 在 ShadowSocks 中的高级设置中查看 socks5 协议监听的端口,HTTP Proxy 设置中查看 http 协议监听的端口。

注意:shadowsocks-windows的socks5和http端口号是同一个,所以不用费尽心思在软件设定中找单独的http端口设置功能了。

Chrome 浏览器 Proxy 设置

@qunwang6
qunwang6 / A Language Snippets
Created October 22, 2019 12:58 — forked from kingspp/A Language Snippets
Language Snippets #MySnippet
This gist reveals language snippets
import uuid, BaseHTTPServer, select, types, webbrowser, editor, os, urllib
from SimpleHTTPServer import SimpleHTTPRequestHandler
try:
from cStringIO import StringIO
except ImportError:
from StringIO import StringIO
global mobile_config_str
mobile_config_str = ''
def test(state):
' test if the state is final '
return all(d == 0 or d == 2 for d in state)
def next(state, cross=2):
' generate all possible moves from the current state '
for i, d in enumerate(state):
if d == 1:
l = left(state, i, cross)
@qunwang6
qunwang6 / Matrix.lua
Created April 7, 2018 10:10 — forked from Rami-Sabbagh/Matrix.lua
Raspberry Pi Lua GPIO LED Matrix
--LED Matrix RAMI
local json = dofile("/home/pi/Desktop/Matrix/json.lua")
local socket = require("socket")
local periphery = require('periphery')
local GPIO = periphery.GPIO
print("Using GPIO:",GPIO.version)