Profile Photo
I know with Disk Arbitration framework, I can use DARegisterDiskMountApprovalCallback to prevent external disks from mounting. The disks includes thumb drive, external hard disk, etc., but there are many types of peripherals out there, like a usb wireless receiver or a USB ethernet adapter. Is there any other framework for us to use to… (Show more)
in Kernel
Profile Photo
Hello, I'd like to know if there is a way to get this properties(like the image below) of a USB thumb drive from a mount point(/Volumes/mydrive) in a generic kernel extension? Thanks!   https://www.dropbox.com/s/5ykusvrlz7apzzs/IORegistryExplorer.png?raw=1
in Kernel
Profile Photo
I use printf() in my kernel extension to print some debug logs. When the message is a bit long(beyond 300 characters, I'm not sure the exact length), it will not be shown in Console.app. To shrink the message a little bit, it can be shown successfully. Is there any limit on the message length in the kernel? I'm using macOS 10.14.6. Thanks!
in Kernel
Profile Photo
In a background daemon(run as root), I want to get user name from a user id(like 501). I tried to use getpwuid() function, but the pw_name it returns is root. Is there any other API I can use to get user name from any valid user id?   One more related question: How can I get the currently active logged-in user in a background daemon… (Show more)
in Kernel
Profile Photo
Hello, I'd like to check if a process opens any ip socket given a process id. I don't need to know what ports the process opens and how many. An yes-or-no answer is enough. Is there a quick and efficient API to check that? Thanks!
in Kernel
Profile Photo
I have a installer package with a kernel extension. I've got both of them notarized successfully. I verify that by using this command "spctl -a -vv -t install bundle-name". I also add this preinstall script to my package. #!/bin/sh… (Show more)
in Kernel
Profile Photo
Hello, I have a command line tool, which depends on some my own dylibs and some third-party dylibs. All of them are build successfully on MacOS and run without problem on my test machine. I want to distribute the app with a installer package. I can enable hardened runtime on the command line tool and every dylib file, codesign them, build the… (Show more)
in Mac Apps
Profile Photo
I'm using MAC policy API in one of my kernel extension. In file operation related callback functions, like mpo_vnode_check_open, I'd like to get the process's real path. I can use proc_selfpid() to get the PID, but I have no idea how to get process path from there. The functionality I need is to check if a process is built-in system process or… (Show more)
in Kernel
Profile Photo
When I get a volume path like /Volumes/somedrive, I need to check if it's a USB drive, a CD/DVD drive or a network share. Is there a way to get this information by C/C++ or Objective-C code? Thanks!
in Cocoa
Profile Photo
I'm using Xcode 10 on MacOS Mojave to create a MacOS app. This app will be distributed outside of Mac App Store, so I let Xcode auto-sign it with Developer ID. My question is how to move the target .app to a specific folder after code signing. The post-build action doesn't work since it seems to happen before code signing. I don't want to do code… (Show more)
in Xcode IDE and Editor
Profile Photo
I have a C struct like this. struct someStruct { char path[10][MAXPATHLEN]; }; I'd like to copy a list of Swift strings into the char[10][] array. For me it's very challenging to handle two dimensional char array in Swift. Could anyone share some code which can work with Swift 5? Thanks!
in Swift
Load more items