I would like to hook a method, which takes an argument of type __NSFrozenDictionaryM.
My goal is to be able to change the value of this argument just before running %orig.
If so you should reverse the method until you track the origin of the argument and figure out how it is generated, then do some hacks at that points. Now you are in the middle of the chain.
Thanks for your help. The problem is that it’s very difficult to track the origin of this chain, but I’ll definitely try.
I’ve also thought about another solution: it consists in hooking the init method of the class corresponding to my argument type and when it corresponds to the desired pattern, change the behavior of init in order to initialize it with my own content.
Something like (pseudo code):
%hook NSDictionnary
- id initWithValue: id value {
if (matchesPattern) {
return %orig(@{ desiredValue: true });
}
return %orig;
}
%end
The above solution is in my case horrible, but it could help someone I hope.