forked from semaja2/InsomniaX
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathauthtool.h
executable file
·60 lines (46 loc) · 1.12 KB
/
authtool.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
#include <Carbon/Carbon.h>
#include <Security/Authorization.h>
#include <sys/param.h>
#include <sys/stat.h>
#include <sys/wait.h>
#include <sys/types.h>
#include <sys/fcntl.h>
#include <sys/errno.h>
#include <stdlib.h>
#include <mach-o/dyld.h>
#include <unistd.h>
#include <sys/types.h>
#include <pwd.h>
#include <stdio.h>
#include <string.h>
//#define DEBUG
//#define insomnia_name @"Insomnia_r9.kext"
// Command Ids
enum
{
kMyAuthorizedLoad = 1,
kMyAuthorizedUnload = 2,
kMyAuthorizedHibernateInstant = 3,
kMyAuthorizedHibernateNormal = 4,
kMyAuthorizedHibernateDisable = 5,
kMyAuthorizedHibernateInstall = 6,
kMyAuthorizedRemove = 7,
kMyAuthorizedDiag = 8
};
// Command structure
typedef struct MyAuthorizedCommand
{
int authorizedCommandId;
char file[1024];
} MyAuthorizedCommand;
// Exit codes (positive values) and return codes from exec function
enum
{
kMyAuthorizedCommandInternalError = -1,
kMyAuthorizedCommandSuccess = 0,
kMyAuthorizedCommandExecFailed,
kMyAuthorizedCommandChildError,
kMyAuthorizedCommandAuthFailed,
kMyAuthorizedCommandOperationFailed
};
//long osMinor;