Skip to content

Instantly share code, notes, and snippets.

@Lessica
Lessica / patch-to-securityd-tweak.mm
Last active February 28, 2024 11:28
A patch to securityd
#import <Foundation/Foundation.h>
#import <os/log.h>
#define FAKE_BASE 0x100000000
#define FAKE_PAGE 4096
template <unsigned B> inline int64_t SignExtend64(uint64_t x) {
static_assert(B > 0, "Bit width can't be 0.");
static_assert(B <= 64, "Bit width out of range.");
return int64_t(x << (64 - B)) >> (64 - B);