Skip to content

Instantly share code, notes, and snippets.

@marysaka
marysaka / gpu_compiler.m
Last active December 9, 2021 03:13
Simple program to compile a given Metal file into a device specific dynamic Metal library (GPU code)
// clang gpu_compiler.m -fobjc-arc -fmodules -mmacosx-version-min=11.0 -framework Foundation -framework CoreGraphics -o gpu_compiler
#import <Foundation/Foundation.h>
#import <Metal/Metal.h>
void compile_to_gpu_code(id<MTLDevice> device, NSString *programString, NSString *destinationPath) {
NSError *error;
MTLCompileOptions *options = [MTLCompileOptions new];
options.libraryType = MTLLibraryTypeDynamic;
options.installName = [NSString stringWithFormat:@"@executable_path/userCreatedDylib.metallib"];
@marysaka
marysaka / syscall_ios.py
Created August 21, 2021 11:34
IDA 7.4+ helper script for Wii's IOS syscalls
# Based on https://wiibrew.org/wiki/IOS/Syscall_IDAPython
from idc import *
from idautils import *
from ida_bytes import *
from ida_idaapi import BADADDR
from ida_xref import add_cref
# NOTE: most names here are custom because even official names are confusing.
syscall_names = {
@marysaka
marysaka / twitter_cleaner.py
Created November 15, 2024 15:20
Some Python script to delete all your tweets (or until a certain cutoff date) based on Twitter Archive (tweet.js)
import requests
import json
import sys
import time
from requests.models import Response
# Common Twitter WebApp Bearer
USER_AUTH_TOKEN = "AAAAAAAAAAAAAAAAAAAAANRILgAAAAAAnNwIzUejRCOuH5E6I8xnZz4puTs%3D1Zv7ttfk8LF81IUq16cHjhLTvJu4FA33AGWWjCpTnA"