Skip to content

Instantly share code, notes, and snippets.

View hym3242's full-sized avatar
💭
still lovin' TIOCSTI

hym3242 hym3242

💭
still lovin' TIOCSTI
View GitHub Profile
@hym3242
hym3242 / genAAPBPlayURL.bashfunction
Last active January 26, 2024 14:22
Generate direct m3u8 url from a url to americanarchive.org catalog
bash$ type genaapbplayurl
genaapbplayurl is a function
genaapbplayurl ()
{
curl -si "https://americanarchive.org/media/$(basename "$1")" -H "Referer: https://americanarchive.org/catalog/$(basename "$1")" --compressed | grep '^Location:' | cut -d ' ' -f 2
}

iOS Shared Cache Extraction

Having fallen off the iOS-exploration train due to completing my Masters and other commitments, I have finally climbed back aboard in pursuit of understanding the telephony stack.

Like most things in iOS that are used frequently, the vast majority of the frameworks and libraries used in the telephony stack reside in the DYLD shared cache located at /System/Library/Caches/com.apple.dyld/dyld_shared_cache_armv7.

In this post I am going to explain how to go about extracting this cache file so that you can then work with each library individually.

Get The Cache

The first step in all of this is to copy the cache over to your local machine. I did this using a program called iExplorer, but you can just as easily do it over SSH. As a side note, you can connect to your iDevice using SSH over USB if you install a tool called iProxy.

@hym3242
hym3242 / trivia.md
Created January 19, 2024 08:08
Misc trivia i know
  • The "force quit applications" window is from loginwindow.
@hym3242
hym3242 / macOS.10.15.AppKit.symbols.dump!grep.NSKeyBindingCommands.txt
Last active April 18, 2024 17:14
dump of macOS 10.15 AppKit symbols (grep NSKeyBindingCommands)
0x000000000041e50d ( 0x205) -[NSTextView(NSKeyBindingCommands) insertTab:] [FUNC, OBJC, NameNList, MangledNameNList, Merged, NList, FunctionStarts]
0x000000000046d4ee ( 0x22d) -[NSTextView(NSKeyBindingCommands) insertNewline:] [FUNC, OBJC, NameNList, MangledNameNList, Merged, NList, FunctionStarts]
0x000000000046e21a ( 0x35a) -[NSTextView(NSKeyBindingCommands) deleteBackward:] [FUNC, OBJC, NameNList, MangledNameNList, Merged, NList, FunctionStarts]
0x000000000046e574 ( 0x358) -[NSTextView(NSKeyBindingCommands) _checkInList:listStart:markerRange:emptyItem:atEnd:inBlock:blockStart:forCharacterRange:] [FUNC, OBJC, NameNList, MangledNameNList, Merged, NList, FunctionStarts]
0x0000000000471d20 ( 0x9e) -[NSTextView(NSKeyBindingCommands) deleteWordBackward:] [FUNC, OBJC, NameNList, MangledNameNList, Merged, NList, FunctionStarts]
0x000000000084cf2c ( 0xe5) -[NSTextView(NSKeyBindingCommands) _verticalDistanceForPageScroll] [FUNC, OBJC, NameNList, MangledNameNList, Merged, NList, FunctionStarts]
0x
@hym3242
hym3242 / StandardKeyBinding.dict.dump
Last active May 15, 2024 23:52
Dump of /System/Library/Frameworks/AppKit.framework/Resources/StandardKeyBinding.dict on macOS Ventura 13.4, plus some notes
$ # plz forgive this dumb method of visualization.
$ cp /System/Library/Frameworks/AppKit.framework/Resources/StandardKeyBinding.dict .
$ plutil -convert xml1 StandardKeyBinding.dict
$ plutil -p StandardKeyBinding.dict | unicode-vis | cat -v | tr '\t' '+'
{
"^C" => "insertNewline:"
"^H" => "deleteBackward:"
"^Y" => "insertBacktab:" //shift+tab
"^[" => "cancelOperation:"
"^?" => "deleteBackward:"
@hym3242
hym3242 / raw cat -v to show raw bytes input.md
Last active December 30, 2023 13:09
raw cat -v to show raw bytes input. like showkey by catb.
$ type rawcatv
rawcatv is a function
rawcatv ()
{
    sh -c 'trap "stty icanon" SIGINT; stty -icanon; cat -v $@;' _ $@
}
@hym3242
hym3242 / Download ChromeStandaloneInstaller.exe with Google.com URL
Last active March 31, 2024 20:54
Download ChromeStandaloneInstaller.exe from google.com. keywords: google chrome standalone installer link url download
https://www.google.com/chrome/?system=true&standalone=1&platform=win64
https://www.google.com/chrome/?system=true&standalone=1&platform=win
https://www.google.com/chrome/?system=true&standalone=1&platform=mac
https://google.cn/chrome/?standalone=1&platform=mac
https://google.cn/chrome/?standalone=1&platform=win
https://google.cn/chrome/?standalone=1&platform=win64
@hym3242
hym3242 / terminal_mouse_hover_effect_showcase.c
Created November 24, 2023 12:15
a c program that showcases how to utilize the all event mouse reporting of terminals to create a hover effect
//Copyleft 2023 hym3242
//No rights reserved
//please forgive my bad code
//tested pass on FreeBSD 13.2
//inspired by vttest(1) and xterm manual concerning ctrl sequences (https://invisible-island.net/xterm/ctlseqs/ctlseqs.html)
//Usage: stty -echo -icanon; stdbuf -o0 ./mouse 2>debug_output.txt
#include <stdio.h>
#include <unistd.h>
#include <signal.h>
@hym3242
hym3242 / DisableLineBufferInNetcat&Cat.md
Last active October 25, 2023 15:45
netcat/cat in raw mode (not line buffered, every keypress is immediately sent over)

Put this in your .bashrc/.profile:

rawcat() { sh -c 'trap "stty icanon" SIGINT; stty -icanon; cat $@;' _ $@; }
rawnc() { sh -c 'trap "stty icanon" SIGINT; stty -icanon; nc $@;' _ $@; }

The trap is used to set cat/nc to icanon state when it is Ctrl+C'd, otherwise it will be stuck in -icanon even if you run the normal /bin/cat, or any program that reads stdin like cat, like hexdump.

When using cat > file stty would complain, but still works as expected for some unknown reason

see man stty

@hym3242
hym3242 / ForceCommandUseAlternateScreen.md
Last active October 22, 2023 21:50
Forcing the FreeBSD default man/less/top to use alternate screen.

Add this to your .profile/.bashrc etc:

altdo() { 
  echo -e '\e[?1049h'; "$@"; echo -e '\e[?1049l'; 
}

then run altdo man or altdo less, altdo top etc.