Skip to content

Instantly share code, notes, and snippets.

View Lessica's full-sized avatar

i_82 Lessica

View GitHub Profile
@CanTheAlmighty
CanTheAlmighty / DisplayLink.swift
Last active May 7, 2025 05:33
DisplayLink for OSX
@joshbuchea
joshbuchea / semantic-commit-messages.md
Last active May 10, 2025 04:34
Semantic Commit Messages

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example

typedef struct __CFUserNotification *CFUserNotificationRef;
FOUNDATION_EXTERN CFUserNotificationRef CFUserNotificationCreate ( CFAllocatorRef allocator, CFTimeInterval timeout, CFOptionFlags flags, SInt32 *error, CFDictionaryRef dictionary );
FOUNDATION_EXTERN SInt32 CFUserNotificationReceiveResponse ( CFUserNotificationRef userNotification, CFTimeInterval timeout, CFOptionFlags *responseFlags );
FOUNDATION_EXTERN CFDictionaryRef CFUserNotificationGetResponseDictionary ( CFUserNotificationRef userNotification );
//官方使用例子
SInt32 CFUserNotificationDisplayNotice(CFTimeInterval timeout, CFOptionFlags flags, CFURLRef iconURL, CFURLRef soundURL, CFURLRef localizationURL, CFStringRef alertHeader, CFStringRef alertMessage, CFStringRef defaultButtonTitle) {
CHECK_FOR_FORK();
CFUserNotificationRef userNotification;
SInt32 retval = ERR_SUCCESS;
CFMutableDictionaryRef dict = CFDictionaryCreateMutable(kCFAllocatorSystemDefault, 0, &kCFCopyStringDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks);
@shaps80
shaps80 / 1. UserDefaults+Key.swift
Last active September 25, 2020 08:29
Adds a Swift extension to make UserDefaults more consistent to work with.
//
// UserDefaults.swift
//
// Created by Shaps Benkau on 24/05/2018.
// Copyright © 2018 152percent Ltd. All rights reserved.
//
import Foundation
#if os(iOS)
@jaybo
jaybo / TestMatchThreads.cpp
Last active September 29, 2022 04:55
Multithreading template matching OpenCV
#include <opencv2/opencv.hpp>
#include <chrono>
using namespace std;
typedef std::chrono::high_resolution_clock Clock;
void threadCallback(GpuMat &imS, GpuMat &imT, int count)
{
std::cout << "Start Thread = " << std::this_thread::get_id() << std::endl;
GpuMat imR = GpuMat(imS.size().height - imT.size().height + 1,
Whenever I try using Frida from the official repo https://build.frida.re I kept getting the following errors after which my device panics and restarts:
default 15:46:47.251624 +0530 kernel AMFI: '/private/var/tmp/frida-D8kjW6.dylib' has no CMS blob?
default 15:46:47.251817 +0530 kernel AMFI: '/private/var/tmp/frida-D8kjW6.dylib': Unrecoverable CT signature issue, bailing out.
Looks like codesigning/entitlements issue. Here are the steps I followed to get Frida Running on a jailbroken iOS 12 device
Downloads Latest version of Frida from https://github.com/frida/frida/releases. In my case it was frida-server-12.4.0-ios-arm64.xz.
xz -d frida-server-12.4.0-ios-arm64.xz
scp frida-server-12.4.0-ios-arm64 root@<ios-device-ip>:/usr/bin/frida-server
@zwaldowski
zwaldowski / EventGenerator.swift
Created April 26, 2019 05:35
UIKit Touch Synthesis (Hacks! Hacks hacks! Hacks!)
import UIKit
import ObjectiveC.runtime
// MARK: - IOKit
@objc private protocol IOHIDEvent: NSObjectProtocol {}
private struct IOHIDDigitizerEventMask: OptionSet {
let rawValue: UInt32
init(rawValue: UInt32) { self.rawValue = rawValue }
@merlos
merlos / GPX File example
Last active January 20, 2025 13:24
Example of GPX file
<?xml version="1.0" encoding="UTF-8"?>
<gpx xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.topografix.com/GPX/1/1" xsi:schemaLocation="http://www.topografix.com/GPX/1/1 http://www.topografix.com/GPX/1/1/gpx.xsd" version="1.1" creator="Open GPX Tracker for iOS">
<wpt lat="40.762468446233115" lon="-73.99090283852468">
<time>2019-12-06T14:19:25Z</time>
<name>09:19:25</name>
<desc>Dec 6, 2019 at 09:19:25</desc>
</wpt>
<wpt lat="40.80559910750484" lon="-73.95810627601767">
<time>2019-12-06T14:19:29Z</time>
<name>09:19:29</name>
@nullpixel
nullpixel / write_memory.c
Last active October 17, 2021 16:12
MSHookMemory wrapper for all modern jailbreaks.
#include <mach/mach.h> // mach_task_self, vm_protect
#include <substrate.h> // MSFindSymbol
// MARK: - Types
typedef void (*MSHookMemory_ptr_t)(void *target, const void *data, size_t size);
#define ENSURE_KERN_SUCCESS(ret) \
if (ret != KERN_SUCCESS) { \
@neoighodaro
neoighodaro / open_shortcut.m
Created April 5, 2020 10:46 — forked from CPDigitalDarkroom/open_shortcut.m
Open an app shortcut programmatically
- (void)openShortcut:(SBSApplicationShortcutItem *)shortcutItem {
UIHandleApplicationShortcutAction *openAction = [[UIHandleApplicationShortcutAction alloc] initWithSBSShortcutItem:shortcutItem];
NSDictionary *activationOptions = @{
@"__ActivateSuspended" : [NSNumber numberWithBool:(shortcutItem.activationMode == 1)],
@"__Actions": @[
openAction
],
@"__PromptUnlockDevice" : [NSNumber numberWithBool:YES],