Skip to content

Instantly share code, notes, and snippets.

Michael Lynn pudquick

Block or report user

Report or block pudquick

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
pudquick / main.m
Created Jun 28, 2017 — forked from steventroughtonsmith/main.m
Load Mach-O executable at runtime and execute its entry point
View main.m
void callEntryPointOfImage(char *path, int argc, char **argv)
void *handle;
int (*binary_main)(int binary_argc, char **binary_argv);
char *error;
int err = 0;
printf("Loading %s\n", path);
handle = dlopen (path, RTLD_LAZY);
pudquick /
Created Dec 23, 2015
Programmatically immediately lock the screen of a Mac running OS X, regardless of security settings, screensaver settings, or Fast User Switch settings
from ctypes import CDLL
loginPF = CDLL('/System/Library/PrivateFrameworks/login.framework/Versions/Current/login')
result = loginPF.SACLockScreenImmediate()
pudquick / Info.plist
Created Oct 29, 2019 — forked from steventroughtonsmith/Info.plist
[Catalyst] Registering for & responding to AppleScript events in a Mac Catalyst app
View Info.plist
View fdsetup-for-crypt.mobileconfig
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "">
<plist version="1.0">
<string>Privacy Preferences Policy Control</string>
pudquick /
Last active Oct 14, 2019
Discovering variable/constant values in frameworks
View 01_snip.txt
EFI found at IODeviceTree:/efi
Current EFI boot device string is: '<array><dict><key>IOMatch</key><dict><key>IOProviderClass
Boot option is 8BE4DF61-93CA-11D2-AA0D-00E098032B8C:Boot0080
Processing boot option 'Mac OS X'
Boot option matches XML representation
pudquick /
Last active Oct 10, 2019
Get Mac's serial number, hardware UUID, and board-id via python
import objc
from Foundation import NSBundle
IOKit_bundle = NSBundle.bundleWithIdentifier_('')
functions = [("IOServiceGetMatchingService", b"II@"),
("IOServiceMatching", b"@*"),
("IORegistryEntryCreateCFProperty", b"@I@@I"),
View gist:98c52375dac3525d5de2
#!/usr/bin/env python
# To look at:
# To look at:
Playing around with CoreWLAN to return information about the wi-fi connection
pudquick /
Last active Oct 3, 2019
Using PrivateFrameworks to get marketing model information for Apple Macs without hitting their internet API (where possible) via python and pyobjc
# Tested on 10.11
# Note:
# The marketing information embedded in the ServerInformation.framework is not the same as what
# About This Mac displays - there are differences.
# For example:
# ServerInformation: 15" MacBook Pro with Retina display (Mid 2015)
# About This Mac: MacBook Pro (Retina, 15-inch, Mid 2015)
pudquick / Example.scpt
Created Mar 3, 2018
Make DMGs from folders
View Example.scpt
property destination_for_dmgs : "/Users/mike/Desktop"
on open the_items
repeat with an_item in the_items
set the_info to info for an_item
if kind of the_info is "Folder" then
set dmg_path to quoted form of (destination_for_dmgs & "/" & (name of the_info) & ".dmg")
set src_path to quoted form of POSIX path of an_item
set vol_name to quoted form of (name of the_info)
set command_str to "hdiutil create " & dmg_path & " -volname " & vol_name & " -srcfolder " & src_path
You can’t perform that action at this time.