Jump to content

MS/Obj-C - How to set property in class?


modnull

3 posts in this topic

Recommended Posts

Posted

Hi! So i'm trying to get into mod/hack development for iOS, and have been following some of the pinned tutorials. In there their new function simply returns a number (like 999 I think), but what I'm currently trying to do is overwrite a function that normally sets a property inside the class (It's an NSSet). My question is, how can I set that property from my own function? For example:

 

#import <substrate.h>
#import <Foundation/Foundation.h>

static void customPowersSet() {
    // I imagine it would be something like this, but that's a complete guess
	self.powersSet = [NSSet setWithArray:@[@1,@3,@7,@6,@8,@5,@2]];
}

%ctor {
	MSHookFunction(MSFindSymbol(NULL, "____BikeInfo_setPowersSet__"),(void*)customPowersSet, NULL);
}

 

I'm coming from C# so this sudden switch to Objective-C has been... interesting so far! It would be great if someone could point me in the right direction :)

Archived

This topic is now archived and is closed to further replies.

×
  • Create New...

Important Information

We would like to place cookies on your device to help make this website better. The website cannot give you the best user experience without cookies. You can accept or decline our cookies. You may also adjust your cookie settings. Privacy Policy - Guidelines