kernel-extension

Retrieve path of process from OSX 10.10/10.11 kernel

南楼画角 提交于 2019-11-29 15:32:27
I would like to retrieve the path of a process from a PID in a kext, like so: Get name from PID? However, sys/proc_info.h and libproc.h are not available anymore (afaik). Is there any other way to retrieve proc_info for a process struct proc *p from a kext? The function that is supposed to return a process's main executable's vnode , proc_getexecutablevnode() is in the private KPI, which is only available to kexts published by Apple. The information it relies on is supposedly stored in the p_textvp field of struct proc , which once again is not part of the public ABI - Apple can choose to

OSX Kext not being properly freed

拈花ヽ惹草 提交于 2019-11-29 11:22:04
I have written a device driver kext for a hot-plug SCSI device, based somewhat on Wagerlabs code (using a driver-user client-application model) and everything works. The only remaining concern is that the driver appears not to be consistently freed, especially if the application crashes. For example, when I try to unload the kext, even with the device disconnected and the application closed, there are still outstanding instances of the driver and user client (with the driver generally outnumbering the user client). I have logging in the driver functions like free() , and when I shut down the

Codesigning Kext with kext enabled certificate fails during kextload, “code signature invalid”

戏子无情 提交于 2019-11-29 02:04:28
So we have a certificate that allows us to sign kexts, but when we run > sudo kextload friendly.kext, it fails and we sign the kext we want, and to prove it's signed, here's some diagnostic output: 👉 codesign --verify -vvvv friendly.kext friendly.kext: valid on disk friendly.kext: satisfies its Designated Requirement 👉 spctl -a -vvvv friendly.kext friendly.kext: accepted source=Developer ID origin=Developer ID Application: Friendly Corporation /Library/Extensions 👉 codesign -dvvv friendly.kext Executable=/Library/Extensions/friendly.kext/Contents/MacOS/friendly Identifier=com.friendly.friendly

Retrieve path of process from OSX 10.10/10.11 kernel

北慕城南 提交于 2019-11-28 09:06:45
问题 I would like to retrieve the path of a process from a PID in a kext, like so: Get name from PID? However, sys/proc_info.h and libproc.h are not available anymore (afaik). Is there any other way to retrieve proc_info for a process struct proc *p from a kext? 回答1: The function that is supposed to return a process's main executable's vnode , proc_getexecutablevnode() is in the private KPI, which is only available to kexts published by Apple. The information it relies on is supposedly stored in

Reading and writing to USB (HID) interrupt endpoints on Mac

廉价感情. 提交于 2019-11-28 05:26:36
I am attempting to communicate with a rather specific USB device and developing both Windows and Mac code to do so. The device is a USB device with a HID interface (class 3) with two endpoints, an interrupt input and an interrupt output. The nature of the device is such that data is sent out from the device on the input endpoint only when data is requested from the host: the host sends it data which the device responds to on its input interrupt endpoint. Getting data to the device (a write) is much more simple... The code for Windows is rather straight-forward: I get a handle to the device and

OSX Kext not being properly freed

只愿长相守 提交于 2019-11-28 04:36:43
问题 I have written a device driver kext for a hot-plug SCSI device, based somewhat on Wagerlabs code (using a driver-user client-application model) and everything works. The only remaining concern is that the driver appears not to be consistently freed, especially if the application crashes. For example, when I try to unload the kext, even with the device disconnected and the application closed, there are still outstanding instances of the driver and user client (with the driver generally

Codesigning Kext with kext enabled certificate fails during kextload, “code signature invalid”

心不动则不痛 提交于 2019-11-27 16:42:38
问题 So we have a certificate that allows us to sign kexts, but when we run > sudo kextload friendly.kext, it fails and we sign the kext we want, and to prove it's signed, here's some diagnostic output: 👉 codesign --verify -vvvv friendly.kext friendly.kext: valid on disk friendly.kext: satisfies its Designated Requirement 👉 spctl -a -vvvv friendly.kext friendly.kext: accepted source=Developer ID origin=Developer ID Application: Friendly Corporation /Library/Extensions 👉 codesign -dvvv friendly