theos / logos

Preprocessor that simplifies Objective-C hooking.
https://theos.dev/docs/logos
Other
205 stars 34 forks source link

Define blocks as objects #95

Closed L1ghtmann closed 1 year ago

L1ghtmann commented 1 year ago

What does this implement/fix? Explain your changes.

Does this close any currently open issues?

Any relevant logs, error output, etc?

For:

%hook IALBackupManager
-(void)makeBackupWithFilter:(BOOL)filter andCompletion:(void (^)(BOOL))block {
    %log;
    %orig;
}
%end

Before:

NSLog(@"-[<IALBackupManager: %p> makeBackupWithFilter:%d andCompletion:0x%llx]", self, filter, (uint64_t)block);
IAmLazy[5455] <Notice>: -[<IALBackupManager: 0x280125fe0> makeBackupWithFilter:1 andCompletion:0x16bc9e3f8]

After:

NSLog(@"-[<IALBackupManager: %p> makeBackupWithFilter:%d andCompletion:%@]", self, filter, block)
IAmLazy[5144] <Notice>: -[<IALBackupManager: 0x282c95ce0> makeBackupWithFilter:1 andCompletion:<__NSMallocBlock__: 0x282c95d10>]

Any other comments?

Where has this been tested?

Operating System:

Linux (WSL) iP7 -- iOS 14.3 -- unc0ver

Platform:

Target Platform:

Toolchain Version:

SDK Version: