forked from theevilbit/Shield
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathProcess.h
106 lines (73 loc) · 2.14 KB
/
Process.h
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
//
// Process.h
// Shield System Extension
//
// Created by csaby on 2021. 05. 15..
// Copyright © 2021. csaba.fitzl. All rights reserved.
//
/* CONSTS */
//code signing keys
#define KEY_SIGNATURE_FLAGS @"csFlags"
#define KEY_SIGNATURE_STATUS @"signatureStatus"
#define KEY_SIGNATURE_SIGNER @"signatureSigner"
#define KEY_SIGNATURE_IDENTIFIER @"signatureID"
#define KEY_SIGNATURE_TEAM_IDENTIFIER @"teamID"
#define KEY_SIGNATURE_AUTHORITIES @"signatureAuthorities"
//code sign options
enum csOptions{csNone, csStatic, csDynamic};
//signers
enum Signer{None, Apple, AppStore, DevID, AdHoc};
//cs options
#define CS_STATIC_CHECK YES
#define CS_CDHASH_LEN 20
//architectures
enum Architectures{ArchUnknown, ArchAppleSilicon, ArchIntel};
/* CLASSES */
@class Process;
/* OBJECT: PROCESS */
@interface Process : NSObject
/* PROPERTIES */
//the original message
@property es_message_t* _Nonnull p_message;
//pid
@property pid_t pid;
//ppid
@property pid_t ppid;
//target process pid
@property pid_t target_pid;
//user id
@property uid_t uid;
//event
// exec, fork, exit
@property u_int32_t event;
//exit code
@property int exit;
//path
@property(nonatomic, retain)NSString* _Nullable path;
//args
@property(nonatomic, retain)NSMutableArray* _Nonnull arguments;
//environment variables
@property(nonatomic, retain)NSMutableArray* _Nonnull env;
//ancestors
@property(nonatomic, retain)NSMutableArray* _Nonnull ancestors;
//platform binary
@property(nonatomic, retain)NSNumber* _Nonnull isPlatformBinary;
//csflags
@property(nonatomic, retain)NSNumber* _Nonnull csFlags;
//cd hash
@property(nonatomic, retain)NSMutableString* _Nonnull cdHash;
//signing ID
@property(nonatomic, retain)NSString* _Nonnull signingID;
//team ID
@property(nonatomic, retain)NSString* _Nonnull teamID;
//signing info
// manually generated via CS APIs if `codesign:TRUE` is set
@property(nonatomic, retain)NSMutableDictionary* _Nonnull signingInfo;
//timestamp
@property(nonatomic, retain)NSDate* _Nonnull timestamp;
/* METHODS */
//init
// flag controls code signing options
-(id _Nullable)init:(es_message_t* _Nonnull)message csOption:(NSUInteger)csOption;
//-(BOOL)alerting;
@end