My hack to fix this on Hopper v4.5
This plugin no longer works on Hopper 4, but there's a pretty easy fix. I'd make a pull request, but this is sloppy (especially the last step) and the author or someone smarter can probably do a better job.
Patches for DYLDSharedCacheLoader.mm:
- Change the return type of
pluginUUIDtoidto prevent a compiler error. - Change the class name to anything that's not
DYLDSharedCacheLoader(Hopper has a built-in class with the same name, and it fails to load a plugin with the same name). I just usedDYLDSharedCacheLoader2. - Add a param
returnAdjustFilename:(NSString * _Nullable * _Nullable)newFilenameto the end of theextractFromData:usingDetectedFileType:returnAdjustOffset:function to match the new SDK. - Add a param
ofFileNamed:(nullable NSString *)filenametodetectedTypesForData:for the same reason. - Add these functions for the same reason:
-(NSArray<NSString*>*)commandLineIdentifiers
{
return @[];
}
+(int)sdkVersion
{
return HOPPER_CURRENT_SDK_VERSION;
}
Build the plugin normally with CMake.
Now for the massively horrifying hack: open the main executable of the compiled bundle in a text editor and find+replace all instances of _open to any other 5-character string (I used _xxxx). This is because Hopper checks plugins for certain function calls and blocks them from loading if any are present (ostensibly to improve performance; I think it's probably an anti-crack tactic). There are numerous open() calls in the dyld source code, but none are used by this plugin just including it. There is definitely a better solution than this, but I don't know what it is.
These steps get the plugin working on my system with Hopper 4.5.22, but YMMV. I hope this helps somebody!
Please open a PR as it makes it much easier to discuss the code changes and the maintainers can also make changes directly to your branch.
As I said, my fix is a horrible hack, not to mention that I have no idea how to automate the last step. Otherwise I would have.
When I have the time, I may find a better solution and then I will create a pull request.
I understand. I would like to help fix the open hack (a simple preprocessor macro is probably enough), but I don't want to have to recreate your patch from a series of instructions first.