Skip to content

Instantly share code, notes, and snippets.

View t0rr3sp3dr0's full-sized avatar

Pedro Tôrres t0rr3sp3dr0

View GitHub Profile
@t0rr3sp3dr0
t0rr3sp3dr0 / AlignTwoDisplaysHorizontally.c
Last active June 7, 2025 00:28
clang -framework CoreGraphics ./AlignTwoDisplaysHorizontally.c
#include <CoreGraphics/CoreGraphics.h>
int main() {
CGDirectDisplayID displays[2];
CGGetOnlineDisplayList(2, displays, NULL);
CGDirectDisplayID st;
CGDirectDisplayID nd;
if (CGDisplayIsMain(displays[0])) {
st = displays[0];
from mitmproxy import http
src = 'ax.init.itunes.apple.com'
dst = 'init.itunes.apple.com'
def request(flow: http.HTTPFlow) -> None:
if flow.request.pretty_host in (src, src + '.'):
flow.request.host = dst
#include <dlfcn.h>
//#include <mach-o/dyld.h>
//#include <mach-o/getsect.h>
//#include <mach-o/ldsyms.h>
#include <stdio.h>
#include <string.h>
#include <sys/clonefile.h>
#include <sys/errno.h>
#include <sys/syslimits.h>
@t0rr3sp3dr0
t0rr3sp3dr0 / Untitled.app:Contents:Info.plist
Last active February 20, 2024 02:41
Automator Application Stub
<?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>CFBundleExecutable</key>
<string>Automator Application Stub</string>
<key>CFBundleIconFile</key>
<string>ApplicationStub</string>
<key>LSUIElement</key>
<true/>
@t0rr3sp3dr0
t0rr3sp3dr0 / quarantine-exec.c
Last active February 20, 2024 01:24
exec process within a macOS download quarantine context
#include <errno.h>
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
enum qtn_flags {
QTN_FLAG_DOWNLOAD = 0x0001,
};
typedef struct _qtn_proc *qtn_proc_t;
@t0rr3sp3dr0
t0rr3sp3dr0 / makepath.go
Created February 18, 2024 02:56
macOS POSIX File Path from Device Number and Inode Number
package main
// #cgo LDFLAGS: -framework Carbon
// #include <Carbon/Carbon.h>
import "C"
import (
"fmt"
"unsafe"
)
@t0rr3sp3dr0
t0rr3sp3dr0 / Defaults.strings
Created April 7, 2023 11:16
/Library/Application Support/Microsoft/MAU2.0/Microsoft AutoUpdate.app/Contents/MacOS/Microsoft Update Assistant.app/Contents/Resources/Defaults.strings
<?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>ManifestServer.Beta</key>
<string>https://officecdnmac.microsoft.com/pr/4B2D7701-0A4F-49C8-B4CB-0C2D4043F51F/MacAutoupdate/</string>
<key>ManifestServer.Current</key>
<string>https://officecdnmac.microsoft.com/pr/C1297A47-86C4-4C1F-97FA-950631F94777/MacAutoupdate/</string>
<key>ManifestServer.CurrentThrottle</key>
<string>https://officecdnmac.microsoft.com/pr/A1E15C18-4D18-40B0-8577-616A9470BB10/MacAutoUpdate/</string>
package main
import (
"io/fs"
"os"
"path"
)
var (
osFiles = []*os.File{os.Stdin, os.Stdout, os.Stderr}
https://download-cdn.jetbrains.com/toolbox/feeds/v1/release.feed.xz.signed
GET
0
HTTP/1.1 200 OK
17
Content-Type: binary/octet-stream
Content-Length: 170516
Connection: keep-alive
Accept-Ranges: bytes
Date: Sun, 28 Aug 2022 13:01:29 GMT

README.md