Preventing debugging is trivial, hooking is a different beast. In hooking the symbol table for the dynamically linking methods/functions is altered.I want to be able to know when that table has been changed!
Look at the code in https://github.com/GGossip/InjectLib, /macOS-InjectPluginCode/InlineInjectPlugin/InlineInjectPlugin.m
//Adobe Illustrator
if (checkAppVersion("27.5.0")) {
NSLog(@"Loading com.adobe.illustrator 27.5.0");
hookPtrA(0x100BF9F84, ret1);
}
```BOOL hookPtrA(intptr_t addr, void *replaceMethod, void **retOriginalFunctionAddress) {
return hookPtr(0, addr, replaceMethod, retOriginalFunctionAddress);
}
int ret1(void) {
NSLog(@"==== return value 1.");
return 1;
}
The code that is supposed to check for a valid license, by simply changing the pointer in the link symbol table the licensing is bypassed.
This may not seem like a big issue BUT hooking dynamic libraries is very common and very dangerous. For example Pegasus/Trident used it to achieve persistence. I was on the team at LookOut that did the initial reverse engineering on Pegasus/Trident.
What I'm looking for is a way , at runtime, to verify the symbol table hasn't been altered.
So there are no "bad licenses" to check for!
We are using a hardened runtime.
One thing I am recommending is that the license checker doesn't return a bool, I was thinking something like a key modded by something variable, but that we can verify.
Topic:
App & System Services
SubTopic:
Core OS
Tags: