Skip to content

Instantly share code, notes, and snippets.

@iJasonY iJasonY/main.m forked from Skifary/main.m
Created Mar 12, 2019

What would you like to do?
#import <Foundation/Foundation.h>
typedef struct __block_impl {
void *isa;
int Flags;
int Reserved;
void *FuncPtr;
typedef void(^GlobalBlock)(void);
void hookFunc() {
NSLog(@"hello world");
void HookBlockToPrintHelloWorld(id blk) {
__block_impl *ptr = (__bridge __block_impl *)blk;
ptr->FuncPtr = &hookFunc;
int main(int argc, const char * argv[]) {
GlobalBlock blk = ^void() {
return 0;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.