Skip to content

Instantly share code, notes, and snippets.

@danpashin
danpashin / CreateGhidraApp.sh
Last active March 19, 2026 18:42 — forked from saagarjha/CreateGhidraApp.sh
Creates a Ghidra.app bundle for macOS
#!/bin/sh
set -eu
create_iconset() {
mkdir -p Ghidra.iconset
cat << EOF > Ghidra.iconset/Contents.json
{
"images":
[
@danpashin
danpashin / README.md
Last active February 4, 2026 23:23
Using ipatool feature to list human-readable versions for an AppStore app

POSIX-compliant - you can safely place this func in your .zshrc, .basrc

Tools required:

  • ipatool
  • jq
  • tac
  • grep with regex enabled
#import <Foundation/Foundation.h>
@interface DVTFilePath : NSObject
@property(readonly) NSString *pathString;
@end
@interface DVTToolchain : NSObject
@property(readonly) DVTFilePath *path;
@end
@danpashin
danpashin / formatter.m
Created January 3, 2023 10:34
Since iOS 13 has libicu 65.0, it can format short and long numbers (like 10B or 10 billion). But there's no API in Apple's CoreFoundation yet.
#import "unum.h"
API_AVAILABLE(macosx(10.15), ios(13), tvos(13), watchos(6))
static NSString *_Nullable formatShortNumber(int64_t number) {
UErrorCode status;
// Create formatter
status = U_ZERO_ERROR;
UNumberFormat *formatter = unum_open(14 /* UNUM_DECIMAL_COMPACT_SHORT */, NULL, 0, "en_US", NULL, &status);
assert(!U_FAILURE(status));
@danpashin
danpashin / TwSubtitledNavigationBar.h
Last active December 28, 2022 15:44
Regular UINavigationBar with custom subtitle in large mode that I created during my research on this. Requires CaptainHook library from https://github.com/rpetrich/CaptainHook
//
// TwSubtitledNavigationBar.h
// Twackup
//
// Created by Daniil on 26.12.2022.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@danpashin
danpashin / main.h
Created December 28, 2022 11:52
Some helpers for CaptainHook
#import "CaptainHook.h"
#define CHAllocateClass(name, superName) do { \
CHClass(name) = objc_allocateClassPair(CHClass(superName), #name, 0); \
CHMetaClass(name) = object_getClass(CHClass(name)); \
CHSuperClass(name) = class_getSuperclass(CHClass(name)); \
} while(0);
#define CHAllocateClassApply(name) \
objc_registerClassPair(CHClass(name));
@danpashin
danpashin / main.x
Created October 22, 2022 07:44
VK for iOS SSL pinning bypass
#import <Foundation/Foundation.h>
#import <Security/Security.h>
typedef NS_ENUM(NSInteger, TSKTrustDecision) {
TSKTrustDecisionShouldAllowConnection,
TSKTrustDecisionShouldBlockConnection,
TSKTrustDecisionDomainNotPinned,
};
%hook TSKPinningValidator