Skip to content

Instantly share code, notes, and snippets.

View zhangkn's full-sized avatar
❣️
https://kunnan.blog.csdn.net/

公众号:iOS逆向 zhangkn

❣️
https://kunnan.blog.csdn.net/
View GitHub Profile
UIWebClip *clip = [UIWebClip webClipWithIdentifier:nil];
//UIWebClip *clip = [UIWebClip webClipWithURL:[webpage.request.mainDocumentURL absoluteString]];
[clip retain];
[clip setPageURL:webpage.request.mainDocumentURL];
[clip setTitle:[webpage stringByEvaluatingJavaScriptFromString:@"document.title"]];
UIWebDocumentView *docView = nil;
UIScrollView *webpagescroller = [[webpage subviews] objectAtIndex:0];
for (UIView* aView in [webpagescroller subviews]){
if ([aView isKindOfClass:[NSClassFromString(@"UIWebBrowserView") class]]){
docView = (UIWebDocumentView *)aView;

Assume LLVM Source tree is located at ../LLVM
The -DLLVM_CREATE_XCODE_TOOLCHAIN=on is only useful for macOS users that requires an Xcode Toolchain to use within Xcode. This enables an extra target called install-xcode-toolchain.
Add -DCMAKE_INSTALL_PREFIX=~/Library/Developer/ installs the Toolchain for the current user.
To install the toolchain globally, replace with -DCMAKE_INSTALL_PREFIX=/Library/Developer/ and invoke sudo ninja install-xcode-toolchain

LLVM Development:

cmake -G "Ninja" -DCMAKE_BUILD_TYPE=Debug -DLLVM_APPEND_VC_REV=on -DLLVM_CREATE_XCODE_TOOLCHAIN=on -DCMAKE_INSTALL_PREFIX=~/Library/Developer/ ../LLVM

Daily Usage

@zhangkn
zhangkn / lldb_cheat_sheet.md
Created January 11, 2018 10:03 — forked from ryanchang/lldb_cheat_sheet.md
LLDB Cheat Sheet

LLDB Cheat Sheet

A complete gdb to lldb command map.

Print out

  • Print object
(lldb) po responseObject
(lldb) po [responseObject objectForKey@"state"]
  • p - Print primitive type
@zhangkn
zhangkn / unwxapkg.py
Created January 5, 2018 02:50 — forked from feix/unwxapkg.py
#!/usr/bin/env python2
# lrdcq
# usage python2 unwxapkg.py filename
import sys, os
import struct
class WxapkgFile(object):
nameLen = 0
var CryptoJS = require('crypto-js')
var request = require('request-promise')
/*
* npm install crypto-js request-promise request
* node wx_t1t_hack.js
*/
// export function testEncription(msg, fullKey) {
// var fullKey = fullKey.slice(0, 16)
'''
Break on Objective-C 's method using its address'
'''
import shlex
import lldb
import re
def breakonmethod(debugger, command, exe_ctx,result, internal_dict):
args=shlex.split(command)
Class=args[0]
Method=args[1]
@zhangkn
zhangkn / fixheader.sh
Created November 27, 2017 06:13 — forked from ChiChou/fixheader.sh
fix header generated from class-dump
#!/bin/bash
#
# NOTE: You need to `brew install gnu-sed` on Mac
#
# by @codecolorist
# http://github.com/chichou
#
# fix some compilation error of headers generated by class-dump
#
# usage: fixheader.sh DIRECTORY