Warning
The following guide need to disable SIP to work.
Please confirm the risk of disabling the SIP by yourself.
Another solution which does not require disabling SIP is currently under investigation.
Reboot into Recovery OS + Disable SIP
extension StringProtocol { | |
/// str[NSRange(location:0, length: 9)] | |
subscript(_ range: NSRange) -> SubSequence { | |
guard let stringRange = Range<String.Index>(range, in: self) else { | |
fatalError("String index is out of range") | |
} | |
return self[stringRange] | |
} | |
Some notes, tools, and techniques for reverse engineering macOS binaries.
#include <dlfcn.h> | |
#include <stdio.h> | |
#include <unistd.h> | |
#include <sys/types.h> | |
#include <mach/mach.h> | |
#include <mach/error.h> | |
#include <errno.h> | |
#include <stdlib.h> | |
#include <sys/sysctl.h> | |
#include <sys/mman.h> |
#!/bin/zsh | |
makeXCFramework () { | |
BASEDIR=$(pwd) | |
echo "Script location: ${BASEDIR}" | |
LIBNAME=$(basename $BASEDIR) | |
echo "lib is: $LIBNAME" | |
cd Frameworks |
import Combine | |
/// Classes implementing this protocol can be target of convenience Publisher | |
/// bindings and assignments without causing accidental retain cycles. | |
/// Those bindings and assignments are also released together with the target. | |
/// | |
/// For example: | |
/// | |
/// aPublisher.bind(to: self) { me, object in |
struct KeychainItem { | |
// MARK: Nested Types | |
enum KeychainError: Error { | |
case noPassword | |
case unexpectedPasswordData | |
case unexpectedItemData | |
case unhandledError(status: OSStatus) | |
} |
@resultBuilder | |
public struct ArrayBuilder<Element> { | |
public static func buildPartialBlock(first: Element) -> [Element] { [first] } | |
public static func buildPartialBlock(first: [Element]) -> [Element] { first } | |
public static func buildPartialBlock(accumulated: [Element], next: Element) -> [Element] { accumulated + [next] } | |
public static func buildPartialBlock(accumulated: [Element], next: [Element]) -> [Element] { accumulated + next } | |
// Empty Case | |
public static func buildBlock() -> [Element] { [] } | |
// If/Else |