This is RelocManager.h in view mode; [Download] [Up]
#import <objc/Object.h> #import <mach/mach.h> #import <mach-o/loader.h> typedef struct _Reloc { pointer_t address; vm_size_t size; pointer_t data; vm_address_t maxAddress; long displacement; pointer_t maxData; struct { unsigned short readIn : 1; } rFlags; } Reloc; #define WARPM(m, p) \ ((typeof(p))[(m) pointerFor: (p) withSize: sizeof(*(p))]) #define WARP(p) WARPM(regionManager, p) #define WARPIDM(m, theID) \ ([(m) pointerForID: (id)(theID)]) #define WARPID(theID) WARPIDM(regionManager, theID) #define UNWARPM(m, p) \ ((typeof(p))[(m) originalPointerFor: (p)]) #define UNWARP(p) UNWARPM(regionManager, (p)) #define WARPSTRINGM(m, s) ((char *)[(m) pointerForString: (s)]) #define WARPSTRING(s) WARPSTRINGM(regionManager, s) @interface RelocManager : Object { void *relocs; int numRelocs; int relocSize; struct _rmFlags { unsigned short invalid : 1; unsigned short shouldSortRelocs : 1; } rmFlags; Reloc *lastReloc; } -(void *)pointerFor: (const void *)pointer; -(void *)pointerFor: (const void *)pointer withSize: (int)size; -(char *)pointerForString: (const char *)pointer isNullTerminated: (BOOL *)isNT; -(char *)pointerForString: (const char *)string; -pointerForID: (const id)pointer; -(void *)originalPointerFor: (const void *)pointer; -(int)getDataAt: (const void *)start for: (int)numBytes into: (void *)data; -(struct mach_header **)getMachHeaders; -(struct mach_header **)getMachHeadersWithNames: (char ***)names; -(struct mach_header *)getMachHeader; -(void *)getSectData: (STR)segName section: (STR)sectName size: (int *)pSize forHeader: (struct mach_header *)header withSlide:(unsigned)slide; -(void *)getSectData: (STR)segName section: (STR)sectName size: (int *)pSize; -(const struct section *)getSeg: (STR)segName sect: (STR)sectName; -invalidate; -(void)readInAllRelocs; -(Reloc *)relocFor: (const void *)pointer; -(Reloc *)oldRelocFor: (const void *)pointer; -(BOOL)readInReloc: (Reloc *)reloc; -(const struct section *)firstSection; -(unsigned)getMaximumAddress; -(unsigned)getMaximumAddressForHeader: (struct mach_header *)header withSlide:(unsigned)slide; -(unsigned)getMaximumTextAddress; -(unsigned)getMaximumDataAddress; @end
These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.