Hi.
I’m testing VMProtect on macOS latest demo version.
My product is dynamic library with objc classes. I did load dylib successfully with turning off packing option. But it seems to fail load objc classes in dylib. (tested on 10.15)
Test code:
//
// in dylib
//
@interface Hello : NSObject
- (void)greeting;
@end
//
// in app linking with dylib
//
- (void)someMethod {
//
// This code is work well with non protect code.
//
Hello *hello = [[Hello alloc] init];
[hello greeting];
}
Linking with VMP version libHello.dylib, class Hello is nil so it will not work correctly.
I can lookup C-level symbols with dlsym like this:
Class cls = (__bridge Class)dlsym(RTLD_DEFAULT, "OBJC_CLASS_$_Hello");
but [cls alloc] will rise runtime error “no class for metaclass 0x10037e0d8”.
I think C-level linking works successfully but objc runtime don’t load classes correctly. Is there way to fix?