Skip to content

Instantly share code, notes, and snippets.

Avatar

guotianyuan Skifary

View GitHub Profile
@Skifary
Skifary / main.m
Last active Oct 11, 2019
替换所有block的实现
View main.m
//
// main.m
// TestObjc
//
// Created by Skifary on 14/03/2018.
// Copyright © 2018 skifary. All rights reserved.
//
#import <Foundation/Foundation.h>
@Skifary
Skifary / main.m
Last active Oct 22, 2020
修改block的实现,先打印参数,再输出原有实现
View main.m
#import <Foundation/Foundation.h>
#import "ffi.h"
NSMutableArray *g_allocations;
ffi_cif g_cif;
ffi_closure *g_closure;
void *g_replacement_invoke;
void *g_origin_invoke;
@Skifary
Skifary / main.m
Last active Jul 3, 2020
替换block原有实现
View main.m
#import <Foundation/Foundation.h>
typedef struct __block_impl {
void *isa;
int Flags;
int Reserved;
void *FuncPtr;
}__block_impl;
typedef void(^GlobalBlock)(void);
View gist:56277e8c71fcd28c0531c07e8722e1ea
ACTION = build
AD_HOC_CODE_SIGNING_ALLOWED = NO
ALTERNATE_GROUP = staff
ALTERNATE_MODE = u+w,go-w,a+rX
ALTERNATE_OWNER = grantdavis
ALWAYS_SEARCH_USER_PATHS = NO
ALWAYS_USE_SEPARATE_HEADERMAPS = YES
APPLE_INTERNAL_DEVELOPER_DIR = /AppleInternal/Developer
APPLE_INTERNAL_DIR = /AppleInternal
APPLE_INTERNAL_DOCUMENTATION_DIR = /AppleInternal/Documentation
You can’t perform that action at this time.