Skip to content

Instantly share code, notes, and snippets.

guotianyuan Skifary

Block or report user

Report or block Skifary

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
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 11, 2019
修改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 Oct 11, 2019
替换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.