Repository navigation
Expand file tree
/
Copy pathkctool_main.h
More file actions
76 lines (55 loc) · 2.1 KB
/
Copy pathkctool_main.h
File metadata and controls
76 lines (55 loc) · 2.1 KB
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
#ifndef _KCTOOL_MAIN_H
#define _KCTOOL_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 {
kKctoolExitOK = EX_OK,
// don't think we use it
kKctoolExitUnspecified = 11,
// don't actually exit with this, it's just a sentinel value
kKctoolExitHelp = 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 kOptChars "a:h"
int longopt = 0;
struct option sOptInfo[] = {
{ kOptNameHelp, no_argument, NULL, kOptHelp },
{ kOptNameArch, required_argument, NULL, kOptArch },
{ NULL, 0, NULL, 0 } // sentinel to terminate list
};
typedef struct {
const NXArchInfo * archInfo;
char * kernelcachePath;
CFStringRef kextID;
const char * segmentName;
const char * sectionName;
const UInt8 * kernelcacheImageBytes;
CFPropertyListRef kernelcacheInfoPlist;
} KctoolArgs;
#pragma mark Function Prototypes
/*******************************************************************************
* Function Prototypes
*******************************************************************************/
ExitStatus readArgs(
int * argc,
char * const ** argv,
KctoolArgs * toolArgs);
ExitStatus printKextInfo(KctoolArgs * toolArgs);
Boolean getKextAddressAndSize(CFDictionaryRef infoDict, uint64_t *addr, uint64_t *size);
void usage(UsageLevel usageLevel);
#endif /* _KCTOOL_MAIN_H */