Skip to content

Instantly share code, notes, and snippets.

Avatar

Michael Lynn pudquick

View GitHub Profile
@pudquick
pudquick / iousb.py
Created Oct 7, 2020
IOKit IOUSBDevice enumeration
View iousb.py
import objc
from Foundation import NSBundle
IOKit_bundle = NSBundle.bundleWithIdentifier_('com.apple.framework.IOKit')
functions = [
("IORegistryEntryCreateCFProperties", b"IIo^@II"),
("IOServiceMatching", b"@*"),
("IOServiceGetMatchingServices", b"II@o^I"),
("IOIteratorNext", b"II"),
]
@pudquick
pudquick / proxy.sh
Last active Aug 25, 2020
Minecraft Java <-> Bedrock crossplay server blog post
View proxy.sh
#!/bin/bash
export JAVA_HOME="/Library/Java/JavaVirtualMachines/adoptopenjdk-8.jdk/Contents/Home"
export PATH="$JAVA_HOME/bin:$PATH"
cd "$( dirname "$0" )"
java -Xmx1024M -jar Geyser.jar
@pudquick
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
<key>NSAppleScriptEnabled</key>
<true/>
<key>OSAScriptingDefinition</key>
<string>ScriptableTasks.sdef</string>
@pudquick
pudquick / 00_notes.md
Last active Dec 5, 2019
Discovering variable/constant values in frameworks
View 00_notes.md
View fdsetup-for-crypt.mobileconfig
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>PayloadContent</key>
<array>
<dict>
<key>PayloadDisplayName</key>
<string>Privacy Preferences Policy Control</string>
<key>PayloadIdentifier</key>
View keybase.md

Keybase proof

I hereby claim:

  • I am pudquick on github.
  • I am frogor (https://keybase.io/frogor) on keybase.
  • I have a public key ASBTy_VUW9m2orm3VyY994_c5qlvSMMatsoKxQk0l6LhyAo

To claim this, I am signing this object:

@pudquick
pudquick / codesign.py
Last active Jan 14, 2020
Obtain codesigning information with pyobjc
View codesign.py
import objc
from Foundation import NSBundle, NSURL
Security = NSBundle.bundleWithIdentifier_('com.apple.security')
class StaticCodeError(Exception):
pass
class SigningInfoError(Exception):
pass
@pudquick
pudquick / profile_details.py
Created Apr 19, 2019
locally checking profile signing information
View profile_details.py
#!/usr/bin/python
# So the first thing we need to do is get the mdmclient view of the profiles
import subprocess, objc
from Foundation import NSPropertyListSerialization, NSPropertyListMutableContainers, NSBundle
Security = NSBundle.bundleWithIdentifier_('com.apple.security')
S_functions = [
('SecCertificateCreateWithData', '@@@'),
('SecCertificateCopyValues', '@@^@o^@'),
View chef_user_resource_monkeypatching.rb
require 'base64'
require 'plist'
module Chef::Provider::User::DsclMojaveUserExtensions
# new for 10.14+
def mac_osx_version_greater_than_10_13?
Gem::Version.new(node['platform_version']) > Gem::Version.new('10.13.99')
end
# updated for 10.14+
@pudquick
pudquick / get_serial.py
Created Sep 5, 2018 — forked from pdarragh/get_serial.py
Short PyObjC script to get a Mac's serial number without calling `system_profiler`.
View get_serial.py
#!/usr/bin/python
# (Note that we must use system Python on a Mac.)
####
# Quick script to get the computer's serial number.
#
# Written for @john.e.lamb on the MacAdmins Slack team.
import objc
import CoreFoundation
You can’t perform that action at this time.