Skip to content

Instantly share code, notes, and snippets.

View Lessica's full-sized avatar

i_82 Lessica

View GitHub Profile
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
@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,
@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)
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);
@joshbuchea
joshbuchea / semantic-commit-messages.md
Last active May 9, 2025 13:18
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

@CanTheAlmighty
CanTheAlmighty / DisplayLink.swift
Last active May 7, 2025 05:33
DisplayLink for OSX
#!/usr/bin/env bash
#
# see: https://gist.github.com/gregorynicholas/2160046ec6946a2ce0fa
# src: https://github.com/mathiasbynens/dotfiles/blob/master/.osx
# updated: 2015-06-06
#
# ask for the administrator password upfront
sudo -v
@zacwest
zacwest / ios-font-sizes.swift
Last active May 8, 2025 21:46
iOS default font sizes - also available on https://www.iosfontsizes.com
let styles: [UIFont.TextStyle] = [
// iOS 17
.extraLargeTitle, .extraLargeTitle2,
// iOS 11
.largeTitle,
// iOS 9
.title1, .title2, .title3, .callout,
// iOS 7
.headline, .subheadline, .body, .footnote, .caption1, .caption2,
]
@steipete
steipete / PSPDFEnvironment.m
Last active March 5, 2024 09:15
Example for DISPATCH_SOURCE_TYPE_MEMORYPRESSURE (Mac only, since 10.9) ... Since we share code between iOS and mac, I'm trying to be a good system citizen and reimplement the equivalent of UIApplicationDidReceiveMemoryWarningNotification on the Mac.
NSString *const PSPDFApplicationDidReceiveMemoryWarningNotification = @"PSPDFApplicationDidReceiveMemoryWarningNotification";
// Test with sudo memory_pressure -l critical. Don't forget to re-set afterwards!
__attribute__((constructor)) static void PSPDFInstallLowMemoryNotificationWarningMac(void) {
static dispatch_source_t source;
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
source = dispatch_source_create(DISPATCH_SOURCE_TYPE_MEMORYPRESSURE, 0, DISPATCH_MEMORYPRESSURE_WARN|DISPATCH_MEMORYPRESSURE_CRITICAL, dispatch_get_main_queue());
dispatch_source_set_event_handler(source, ^{
dispatch_source_memorypressure_flags_t pressureLevel = dispatch_source_get_data(source);
@zwaldowski
zwaldowski / notes-specific-to-mac-os-x-10_9.md
Last active April 22, 2025 21:51
10.9 AppKit Release Notes