Skip to content

Instantly share code, notes, and snippets.

View dorentus's full-sized avatar
🎲
🌎🌍🌏

ZHANG Yi dorentus

🎲
🌎🌍🌏
View GitHub Profile
@dorentus
dorentus / dynamic_cast.mm
Created August 30, 2016 02:23 — forked from bdash/dynamic_cast.mm
Excerpt from Hopper pseudocode from __dynamic_cast in libc++abi.dylib
if ((*(int8_t *)guard variable for __dynamic_cast::use_strcmp == 0x0) && (___cxa_guard_acquire(guard variable for __dynamic_cast::use_strcmp, rsi, rdx, rcx, r8, r9) != 0x0)) {
rsi = *_NSGetProgname();
rcx = 0x1;
if (strcmp("Adobe Illustrator", rsi) != 0x0) {
rsi = *_NSGetProgname();
rdx = 0x13;
rcx = strncmp("Adobe Photoshop CS5", rsi, rdx) == 0x0 ? 0x1 : 0x0;
}
*(int8_t *)__dynamic_cast::use_strcmp = rcx;
___cxa_guard_release(guard variable for __dynamic_cast::use_strcmp, rsi, rdx, rcx, r8, r9);
@dorentus
dorentus / webview.m
Last active May 27, 2021 06:16
Bypass Apple's UIWebView deprecation detection
#import <Foundation/Foundation.h>
#import <dlfcn.h>
@interface UIWebView : NSObject
@end
@implementation UIWebView
+ (id)alloc
{
#!/usr/bin/arch -x86_64 /bin/sh
exec $SHELL --login