-
Notifications
You must be signed in to change notification settings - Fork 5
/
Address.m
61 lines (52 loc) · 1.2 KB
/
Address.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
@implementation Address
+(instancetype)rebaseWithAddress:(long)address
{
Address* result=Address.alloc.init.autorelease;
result.type=ADDRESS_REBASE;
result.address=address;
return result;
}
+(instancetype)bindWithAddress:(long)address ordinal:(int)ordinal name:(NSString*)name addend:(int)addend
{
Address* result=Address.alloc.init.autorelease;
result.type=ADDRESS_BIND;
result.address=address;
result.dylibOrdinal=ordinal;
result.name=name;
result.addend=addend;
return result;
}
+(instancetype)exportWithAddress:(long)address name:(NSString*)name
{
Address* result=Address.alloc.init.autorelease;
result.type=ADDRESS_EXPORT;
result.address=address;
result.name=name;
return result;
}
+(instancetype)reexportWithName:(NSString*)name importName:(NSString*)importName importOrdinal:(int)ordinal
{
Address* result=Address.alloc.init.autorelease;
result.type=ADDRESS_REEXPORT;
result.name=name;
result.importName=importName;
result.dylibOrdinal=ordinal;
return result;
}
-(BOOL)isRebase
{
return self.type==ADDRESS_REBASE;
}
-(BOOL)isBind
{
return self.type==ADDRESS_BIND;
}
-(BOOL)isExport
{
return self.type==ADDRESS_EXPORT;
}
-(BOOL)isReexport
{
return self.type==ADDRESS_REEXPORT;
}
@end