Skip to content

Instantly share code, notes, and snippets.

Avatar

Cameron Lowell Palmer palmerc

  • NTNU
  • Oslo, Norway
View GitHub Profile
View signing elements
def find_codesign_elements(path):
elements = find(path, '*.appex')
elements.extend(find(path, '*.framework'))
elements.extend(find(path, '*.dylib'))
return elements
def find_codesign_artifacts(path):
artifacts = find(path, '_CodeSignature')
artifacts.extend(find(path, 'CodeResources'))
@palmerc
palmerc / build-llvm.sh
Last active Apr 7, 2021
Compile LLVM on macOS
View build-llvm.sh
#!/usr/bin/env bash
set -e
SCRIPT_DIR=$(pwd)
COMMAND_LINE_TOOLS_DIR=/Library/Developer/CommandLineTools
CLT_USR_INCLUDE=${COMMAND_LINE_TOOLS_DIR}/SDKs/MacOSX.sdk/usr/include
CLT_USR_LIB=${COMMAND_LINE_TOOLS_DIR}/SDKs/MacOSX.sdk/usr/lib
@palmerc
palmerc / no.corporate.wireguard.plist
Last active Sep 24, 2022
WireGuard LaunchD Startup
View no.corporate.wireguard.plist
<?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>Label</key>
<string>no.corporate.wireguard</string>
<key>RunAtLoad</key><true/>
<key>OnDemand</key><false/>
<key>Disabled</key><false/>
<key>WatchPaths</key>
View proxy.pac
function FindProxyForURL(url, host) {
return "SOCKS 192.168.11.146:8889";
}
View quebec-proxy.pac
function FindProxyForURL(url, host) {
return "SOCKS 192.168.11.146:8889";
}
@palmerc
palmerc / apollo.txt
Created Sep 29, 2019 — forked from littlelailo/apollo.txt
Apple Bootrom Bug
View apollo.txt
This bug was also called moonshine in the beginning
Basically the following bug is present in all bootroms I have looked at:
1. When usb is started to get an image over dfu, dfu registers an interface to handle all the commands and allocates a buffer for input and output
2. if you send data to dfu the setup packet is handled by the main code which then calls out to the interface code
3. the interface code verifies that wLength is shorter than the input output buffer length and if that's the case it updates a pointer passed as an argument with a pointer to the input output buffer
4. it then returns wLength which is the length it wants to recieve into the buffer
5. the usb main code then updates a global var with the length and gets ready to recieve the data packages
6. if a data package is recieved it gets written to the input output buffer via the pointer which was passed as an argument and another global variable is used to keep track of how many bytes were recieved already
7. if all the data was recieved th
View expat.diff
diff --git a/Modules/_elementtree.c b/Modules/_elementtree.c
index 1b8f812..97485eb 100644
--- a/Modules/_elementtree.c
+++ b/Modules/_elementtree.c
@@ -2781,7 +2781,7 @@ _elementtree_TreeBuilder_start_impl(TreeBuilderObject *self, PyObject *tag,
/* ==================================================================== */
/* the expat interface */
-#include "expat.h"
+#include "expat_internal.h"
@palmerc
palmerc / userpic.sh
Last active Sep 9, 2022 — forked from acidprime/userpic.sh
Updating a user's picture from a script
View userpic.sh
#!/bin/bash
set -e
declare -x USERNAME="$1"
declare -x USERPIC="$2"
declare -r DSIMPORT_CMD="/usr/bin/dsimport"
declare -r ID_CMD="/usr/bin/id"
View WireGuard Launchd
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd";>
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.cameronpalmer.wireguard</string>
<key>ProgramArguments</key>
<array>
<string>/usr/local/bin/wg-quick</string>
<string>up</string>
View Privacy Policy
This app collects no data whatsoever.