-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathlockdown.c
73 lines (49 loc) · 1.35 KB
/
lockdown.c
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
/*++
Copyright (C) 2011, Velocity Limitless Organization
Licensed under the GNU General Public License v2
File name:
lockdown.c
Abstract:
Override liblockdown.dylib, hacktivate.
--*/
#include <voodoo.h>
#ifdef _HACKTIVATE_
PLOCKDOWN_COPY_VALUE pLockdown_copy_value;
CFTypeRef
lockdown_copy_value(
__in PVOID LockdownConnection,
__in CFStringRef Domain,
__in CFStringRef Key
)
/*++
Routine Description:
Copy a value from domain:key using LockdownConnection
as a connection to lockdownd.
Arguments:
LockdownConnection - Connection to lockdownd.
Domain - Domain that key is in.
Key - Key to retrieve.
Return Value:
Pointer to anything?
--*/
{
CFStringRef ActivationState = CFSTR("FactoryActivated");
CFStringRef DeviceUdid = CFSTR(DEVICE_UDID);
//
// Check to see if the real function is null.
//
if(!pLockdown_copy_value)
pLockdown_copy_value = dlsym(RTLD_NEXT, "lockdown_copy_value");
//
// Check to see if the string is ours or not.
//
if(!CFStringCompare(Key, CFSTR("ActivationState"), 0))
return ActivationState;
if(!CFStringCompare(Key, CFSTR("BrickState"), 0))
return kCFBooleanFalse;
//
// It's not.
//
return pLockdown_copy_value(LockdownConnection, Domain, Key);
}
#endif