Skip to content

Instantly share code, notes, and snippets.

View jevinskie's full-sized avatar

Jevin Sweval jevinskie

View GitHub Profile
#!/usr/bin/env python3
# SPDX-License-Identifier: BSD-3-Clause
# Copyright (c) 2023, Alex Taradov <[email protected]>. All rights reserved.
#------------------------------------------------------------------------------
core_debug = {
'name': 'CD',
'description': 'Core Debug',
'base': 0xe000edf0,
'source': 'DDI0403D_arm_architecture_v7m_reference_manual.pdf',
@ataradov
ataradov / gist:0a46c935eff32bf28e26d6ed5438cdfb
Created April 4, 2025 15:00
Example Python description of a peripheral
itm = {
'name': 'ITM',
'description': 'Instrumentation Trace Macrocell',
'base': 0xe0000000,
'source': '',
'registers': [
('PORT', 0x000, 'RW', 'ITM Stimulus Port', (32, 4)),
('TER', 0xe00, 'RW', 'ITM Trace Enable Register'),
('TPR', 0xe40, 'RW', 'ITM Trace Privilege Register'),
('TCR', 0xe80, 'RW', 'ITM Trace Control Register', [
@Marc-B-Reynolds
Marc-B-Reynolds / xoroshiro128p_fail.c
Last active April 6, 2025 12:27
test driver that demos "xoroshiro128+" failing PractRand
// compile with whatever then run PractRand:
// ./test | RNG_test stdin64 -tlmin 256KB -tf 2 -tlmax 512GB -seed 0
//****************************************************************************
// verbatim from: https://prng.di.unimi.it/xoroshiro128plus.c
/* Written in 2016-2018 by David Blackman and Sebastiano Vigna (vigna@acm.org)
To the extent possible under law, the author has dedicated all copyright
and related and neighboring rights to this software to the public domain
@MangaD
MangaD / cpp_exception_handling.md
Last active September 30, 2025 03:32
Stack Unwinding & Exception Propagation in C++

📌 Stack Unwinding & Exception Propagation in C++

CC0

Disclaimer: ChatGPT generated document.

Stack unwinding is the process of cleaning up the stack when an exception is thrown. It involves destructing local variables and calling cleanup functions while propagating the exception up the call stack until a matching catch block is found.


[ 158.425795] ==================================================================
[ 158.426607] BUG: KASAN: slab-out-of-bounds in usb_destroy_configuration+0x4ec/0x588
[ 158.427343] Read of size 8 at addr ffff00008f7a9548 by task kworker/0:4/3164
[ 158.427916]
[ 158.428053] CPU: 0 UID: 0 PID: 3164 Comm: kworker/0:4 Kdump: loaded Tainted: G OE 6.11.0-14-generic #15
[ 158.428905] Tainted: [O]=OOT_MODULE, [E]=UNSIGNED_MODULE
[ 158.429329] Hardware name: VMware, Inc. VMware20,1/VBSA, BIOS VMW201.00V.24006586.BA64.2406042154 06/04/2024
[ 158.430108] Workqueue: usb_hub_wq hub_event
[ 158.430459] Call trace:
[ 158.430660] dump_backtrace+0x1f8/0x220
@rcalixte
rcalixte / libqt6.md
Created March 7, 2025 13:24
Qt 6 for C & Zig

Qt 6 for C & Zig

Hi all,

As the title suggests, I've been working on Qt 6 bindings and wrappers for C and Zig. These can be thought of as a fork of the recently released Qt bindings for Go. Not to bury the lede, currently only 64-bit variants of Linux and FreeBSD are supported until interested folks on other 64-bit platforms are capable of testing and validation. In theory, any platform natively supported by both Qt and Zig's build system could be supported by these libraries. I'll try to keep this brief and fail but there is a lot to unpack here. This list can be considered an order of preference for how I'm asking folks to interact with the projects in the near-term:

  1. Consumption: Use the libraries! Head to the library repository for whichever target language you prefer and skip to the Building section. Install the dependencies, look over the build options, and then head to the examples repository. Clone the examples repository and kick off the build. While the build is running (and your comput
@JJTech0130
JJTech0130 / debugger_jit_improved.m
Last active October 30, 2025 09:09
Improved method of using a debugger for JIT on iOS... Uses split rx/rw regions, and works on iOS 18.4b1
#import <Foundation/Foundation.h>
#import <mach/mach.h>
#import <stdio.h>
#import <stdlib.h>
#import <string.h>
#include <libkern/OSCacheControl.h>
const int REGION_SIZE = 0x4000*1;
void write_instructions(void* page)
@LemonHaze420
LemonHaze420 / da_ghost_ridaaa.cpp
Created February 14, 2025 21:29
da_ghost_ridaaa.cpp for Ghost Rider 2002 (arc files)
// LemonHaze - 2025
#include <iostream>
#include <ostream>
#include <fstream>
#include <vector>
#include <zlib.h>
struct arc {
struct entry {
int a, b, c, size;
@EthanArbuckle
EthanArbuckle / FeatureFlags
Created February 13, 2025 07:51
iOS FeatureFlags (not just the enabled ones found on-disk)
Domain Feature Enabled States
===================================================================
APS SyncXPC YES resolved=enabled
WatchKADelayOOS YES resolved=enabled
SingleInterfaceFilterOptimization YES resolved=enabled
ShorterConnectDelayV1 YES resolved=enabled
SingleInterfaceFilterOptimizationProxy YES resolved=enabled
AVConference EnableNetworkConditionMonitoring YES resolved=enabled
UseTransportStreamsForNW YES resolved=enabled
UPlusNDowngrade YES resolved=enabled
@EthanArbuckle
EthanArbuckle / sim_dylib_loader.m
Created February 2, 2025 01:12
Make Music.app run in iOS Simulator
//
// sim_dylib_loader.m
// objsee
//
// Created by Ethan Arbuckle on 1/31/25.
//
#include <Foundation/Foundation.h>
#include <objc/runtime.h>
#include <dlfcn.h>