Closed pixelomer closed 5 years ago
Imo, this is too niche of a use case for Logos to add language-level support. But it has the same problem as your other issue: logos does not easily expose the original IMP
for programmer use in any context. Maybe it should.
It actually does, I just forgot to document it at the time and nobody else noticed since'. &%orig
does this. This is now documented in https://github.com/theos/logos/wiki/Syntax#orig-1.
It would be nice if we had a way to retrieve it without calling the method first, but that certainly takes care of a lot of use cases. Neat!
Fetching the original function pointer from outside the hook means that you have to provide:
_ungrouped
)Then it would be some form of:
UIImage * image = %orig_call(UIImage, "imageNamed:", @"duck"); // _ungrouped
UIImage * image = %orig_call(myGroup, UIImage, "imageNamed:", @"rabbit");
which would require parsing the arguments to find which one is the selector string to know if there's a group being passed as first argument.
Could just make the group last instead?
There should be a way to call
%orig
with a different instance variable while not modifyingself
.