-
Notifications
You must be signed in to change notification settings - Fork 13
/
Task.h
96 lines (66 loc) · 1.76 KB
/
Task.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
//
// Task.h
// TaskExplorer
//
// Created by Patrick Wardle on 5/2/15.
// Copyright (c) 2015 Objective-See, LLC. All rights reserved.
//
#import "Binary.h"
#import <Foundation/Foundation.h>
/*
//32bit
struct dyld_image_info_32 {
int imageLoadAddress;
int imageFilePath;
int imageFileModDate;
};
*/
@interface Task : NSObject
{
//pid
NSNumber* pid;
//uid
//uid_t uid;
//main binary
Binary* binary;
//parent id
NSNumber* ppid;
//children (for tree view)
NSMutableArray* children;
}
@property (nonatomic, retain)NSNumber* pid;
//main binary
@property(nonatomic, retain)Binary* binary;
//process args
@property(nonatomic, retain)NSMutableArray* arguments;
//loaded dylibs
@property(nonatomic, retain)NSMutableArray* dylibs;
//open files
@property(nonatomic, retain)NSMutableArray* files;
//connections
@property(nonatomic, retain)NSMutableArray* connections;
//uid
@property uid_t uid;
//parent's pid
@property (nonatomic, retain)NSNumber* ppid;
//children
@property (nonatomic, retain)NSMutableArray* children;
/* METHODS */
//init w/ a pid + path
// note: icons are dynamically determined only when process is shown in alert
-(id)initWithPID:(NSNumber*)taskPID;
//get task's path
// ->via 'proc_pidpath()' or via task's args ('KERN_PROCARGS2')
-(NSString*)getPath;
//get command-line args
-(void)getArguments;
//enumerate all dylibs
// ->new ones are added to 'existingDylibs' (global) dictionary
-(void)enumerateDylibs:(NSMutableDictionary*)allDylibs shouldWait:(BOOL)shouldWait;
//enumerate all open files
-(void)enumerateFiles:(BOOL)shouldWait;
//enumerate network sockets/connections
-(void)enumerateNetworking:(BOOL)shouldWait;
//convert self to JSON string
-(NSString*)toJSON:(BOOL)detailed;
@end