This question is related to hooking with Mobile Substrate, but as long as you know Objective-C you probably can help.
I've got this class that I dumped from UIKit. Here is a piece of it:
@interface UIStatusBarItem : NSObject {
int _type;
}
@property(nonatomic, readonly, retain) int type;
@property(nonatomic, readonly, retain) int leftOrder;
@property(nonatomic, readonly, retain) int rightOrder;
@property(nonatomic, readonly, retain) int priority;
...
@end
Naturally, if i wanted to set int type
to, for example, 16, I would do:
MSHookIvar<int>(self, "_type") = 16;
From then on, [self type]
will return 16. This much I know.
My problem is that I don't know what the compiler "names" the int
where the values for int leftOrder
, int rightOrder
, and int priority
are stored. I tried:
MSHookIvar<int>(self, "leftOrder")
but that's incorrect and crashes the phone. All I really need to know is how these variables are auto-named if you don't specify it yourself. Thanks
Also, I hate to sound like a prick, but please don't respond with just "don't do this, it's not safe." I know it's not, and that's why most of my products are in Cydia and not the App Store =P