-
Notifications
You must be signed in to change notification settings - Fork 0
/
kclist_main.h
77 lines (58 loc) · 2.41 KB
/
kclist_main.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
#ifndef _KCLIST_MAIN_H
#define _KCLIST_MAIN_H
#include <CoreFoundation/CoreFoundation.h>
#include <IOKit/kext/OSKext.h>
#include <getopt.h>
#include <sysexits.h>
#include <IOKit/kext/OSKext.h>
#include "kext_tools_util.h"
#include "kernelcache.h"
#pragma mark Basic Types & Constants
/*******************************************************************************
* Constants
*******************************************************************************/
enum {
kKclistExitOK = EX_OK,
// don't think we use it
kKclistExitUnspecified = 11,
// don't actually exit with this, it's just a sentinel value
kKclistExitHelp = 33,
};
#pragma mark Command-line Option Definitions
/*******************************************************************************
* Command-line options. This data is used by getopt_long_only().
*
* Options common to all kext tools are in kext_tools_util.h.
*******************************************************************************/
#define kOptArch 'a'
#define kOptUUID 'u'
#define kOptNameUUID "uuid"
#define kOptChars "a:hvu"
int longopt = 0;
struct option sOptInfo[] = {
{ kOptNameHelp, no_argument, NULL, kOptHelp },
{ kOptNameArch, required_argument, NULL, kOptArch },
{ kOptNameUUID, no_argument, NULL, kOptUUID },
{ kOptNameVerbose, no_argument, NULL, kOptVerbose },
{ NULL, 0, NULL, 0 } // sentinel to terminate list
};
typedef struct {
char * kernelcachePath;
CFMutableSetRef kextIDs;
const NXArchInfo * archInfo;
Boolean verbose;
Boolean printUUIDs;
} KclistArgs;
#pragma mark Function Prototypes
/*******************************************************************************
* Function Prototypes
*******************************************************************************/
ExitStatus readArgs(
int * argc,
char * const ** argv,
KclistArgs * toolArgs);
ExitStatus checkArgs(KclistArgs * toolArgs);
void listPrelinkedKexts(KclistArgs * toolArgs, CFPropertyListRef kcInfoPlist, const char *prelinkTextBytes, uint64_t prelinkTextSourceAddress, uint64_t prelinkTextSourceSize);
void printKextInfo(CFDictionaryRef kextPlist, Boolean beVerbose, Boolean printUUIDs, const char *kextTextBytes);
void usage(UsageLevel usageLevel);
#endif /* _KCLIST_MAIN_H */