Skip to content

Instantly share code, notes, and snippets.

Avatar
🏔️
Darwin tooling

Leptos leptos-null

🏔️
Darwin tooling
View GitHub Profile
@leptos-null
leptos-null / inspectivec.cy
Last active Dec 15, 2018
InspectiveC module for Cycript
View inspectivec.cy
/* InspectiveC by DavidGoldman
* Place this file in `/usr/lib/cycript0.9/com/golddavid/inspectivec.cy`
* Run `@import com.golddavid.inspectivec` in cycript to use.
*
* This file has been adapted from
* https://github.com/DavidGoldman/InspectiveC/blob/master/cycript/InspectiveC.cy
* to use new cycript module features.
*
* This module is based on
* https://github.com/limneos/classdump-dyld/blob/master/classdumpdyldlib/classdumpdyld.cy
@leptos-null
leptos-null / printBitRepresentation.h
Last active Sep 2, 2018
Three macros for printing the bit representation of a fixed-point value
View printBitRepresentation.h
#include <stdio.h>
#include <stdlib.h>
#include <limits.h>
/* prints each character representation of the byte one at a time.
* no memory management required; slower, than using a buffer.
*/
#define printBitRepresentationEach(a) \
({ \
for (size_t _i = (sizeof(a) * CHAR_BIT); _i; _i--) { \
@leptos-null
leptos-null / cydia-virtual-dependencies.md
Last active Sep 24, 2019
Explanation of Cydia-provided "virtual dependency" packages
View cydia-virtual-dependencies.md

Cydia Virtual Dependency Packages

Cydia provides "virtual dependency" packages, leveraging dpkg, to allow packages to only be installed on certain kinds of devices.

I have not been able to find official documentation on these packages. Their package names are prefixed with "cy+". To find out exactly what these packages represented I ran a few command on two devices.

Testing

iPhone 5, iOS 10.3.3:

@leptos-null
leptos-null / llvm.nanorc
Last active Jan 21, 2022
LLVM syntax highlighting for nano
View llvm.nanorc
## LLVM syntax highlighting for nano by Leptos
## Based off the official nano C/C++ template
syntax ll "\.ll$"
magic "LLVM source"
comment ";"
# all numeral literals
color brightcyan "-?[0-9]*"
@leptos-null
leptos-null / lw.zsh
Last active Sep 21, 2018
List which: zsh function to print full information about a command
View lw.zsh
function lw() {
for ARG in "$@"
do
WHICH_RESULT=$(which "$ARG") && {
[[ -e "$WHICH_RESULT" ]] && {
l "$WHICH_RESULT"
continue
}
}
echo "$WHICH_RESULT"
@leptos-null
leptos-null / polymaths.c
Last active Sep 21, 2018
Implementation of Descartes' Rule of Signs and Rational Zeros Theorem to show information about a given rational polynomial
View polymaths.c
//
// main.c
// polymaths
//
// Created by Leptos on 9/18/18.
// Copyright © 2018 Leptos. All rights reserved.
//
#include <stdio.h>
#include <math.h>
@leptos-null
leptos-null / cycript-mojave.md
Last active Jan 14, 2022
Using cycript on macOS Mojave
View cycript-mojave.md

Cycript on Mojave

Cycript is a tool I find very helpful. It's an effective REPL for Objective-C. When I updated to macOS Mojave, I found that cycript no longer worked because it was linked against an old version of Ruby. After attempting to compile from source, I tried another solution. install_name_tool is an open source tool for modifying the names of linked shared libraries in a Mach-O.

Solution

$ install_name_tool -change /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/libruby.2.0.0.dylib /System/Library/Frameworks/Ruby.framework/Versions/Current/usr/lib/libruby.dylib Cycript.lib/cycript-apl
$ install_name_tool -change /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/libruby.2.0.0.dylib /System/Library/Frameworks/Ruby.framework/Versions/Current/usr/lib/libruby.dylib Cycript.lib/libcycript.dylib
@leptos-null
leptos-null / Mojave-dynamic-wallpapers.md
Last active Apr 29, 2021
Mojave Dynamic Desktop- How it works
View Mojave-dynamic-wallpapers.md

Mojave Dynamic Desktop- How it works

Prompted by a tweet by NSHipster, and a subsequent thread, I wanted to find out how Mojave dynamic wallpapers worked. NSHipster and ole reverse engineered the file format. In the Twitter thread, NSHipster mentions an edge case: What happens above 66ºN (latitude)?

The first thing to do was find out what process handles the wallpaper on macOS. I primarily do iOS research, and honestly had no idea. I opened Console, searched for "solar", and then changed my static wallpaper to a dynamic one. Voila!

Message: index: 7 next: 14815.999366

Process: Dock

@leptos-null
leptos-null / LMApiaryDeviceCrypto.h
Last active Jul 20, 2021
Fully implemented mirror of YouTube's YTApiaryDeviceCrypto class
View LMApiaryDeviceCrypto.h
//
// LMApiaryDeviceCrypto.h
//
// Created by Leptos on 11/18/18.
// Copyright © 2018 Leptos. All rights reserved.
//
#import <Foundation/Foundation.h>
#define kYouTubeBase64EncodedProjectKey @"vOU14u6GkupSL2pLKI/B7L3pBZJpI8W92RoKHJOu3PY="
@leptos-null
leptos-null / YTIThumbnailDetails.md
Last active Dec 15, 2018
Odd encoding in YTIThumbnailDetails property list
View YTIThumbnailDetails.md

YTIThumbnailDetails classdump notes

While class dumping YouTube Music, I ran into two problematic properties in a protobuf-generated class.

The property largestImageSource had the type encoding

{YTImageSource=@@{YTClientResource=@@{optional<unsigned int>=B(?={dummy_type=[4{empty_struct=}]}I)}}{optional<unsigned int>=B(?={dummy_type=[4{empty_struct=}]}I)}{optional<unsigned int>=B(?={dummy_type=[4{empty_struct=}]}I)}}