Skip to content

Instantly share code, notes, and snippets.

View marysaka's full-sized avatar
🍵

Mary Guillemard marysaka

🍵
View GitHub Profile
@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 / 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 / psc-9.0.0.idc
Last active January 13, 2021 13:52
PSC 9.0.0
This file has been truncated, but you can view the full file.
// PSC 9.0.0 IDC by Thog, 2019/10/03
// main: 5e83dd40cbc929aa4073f087c90ee65e1ef517e787a8b5621f350f43920ee3aa
// Notes:
// - This currently only contains a full reversing of time.
// - Not all names are officials.
#define UNLOADED_FILE 1
#include <idc.idc>
static main(void)
/*----------------------------------------------------------------------------*/
/*-- blz.c - Bottom LZ coding for Nintendo GBA/DS --*/
/*-- Copyright (C) 2011 CUE --*/
/*-- --*/
/*-- This program is free software: you can redistribute it and/or modify --*/
/*-- it under the terms of the GNU General Public License as published by --*/
/*-- the Free Software Foundation, either version 3 of the License, or --*/
/*-- (at your option) any later version. --*/
/*-- --*/
/*-- This program is distributed in the hope that it will be useful, --*/
#define UNLOADED_FILE 1
#include <idc.idc>
static main(void)
{
// set 'loading idc file' mode
set_inf_attr(INF_GENFLAGS, INFFL_LOADIDC|get_inf_attr(INF_GENFLAGS));
GenInfo(); // various settings
Segments(); // segmentation
Enums(); // enumerations
@marysaka
marysaka / pleroma_on_steamlink.md
Created November 16, 2017 12:30
Pleroma on the Steam Link
@marysaka
marysaka / switch_bct.py
Created October 3, 2017 19:01
Switch Simple BCT parser
#!/usr/bin/python3
from struct import *
import sys
def main():
args = sys.argv[1::]
if len(args) < 1:
print(sys.argv[0] + " boot.bct")
return
@marysaka
marysaka / decoder.ex
Created July 28, 2017 22:28
Simple RESP (REdis Serialization Protocol) decoder/encoder in Elixir
defmodule Redis.Protocol.Decoder do
def decode(<<"*", elem_count :: binary-size(1), "\r\n", rest :: binary>>) do
elem_count = elem_count |> String.to_integer
decode_array(rest, elem_count, [])
end
def decode(<<"+", rest :: binary>>), do: decode_simple_string(rest)
def decode(<<"-", rest :: binary>>), do: decode_error_string(rest)
def decode(<<"$", size :: binary-size(1), rest :: binary>>), do: decode_bulk_string(size |> String.to_integer, rest)
@marysaka
marysaka / puush.ex
Created July 17, 2017 17:38
Simple Puush Uploader in Elixir (httpc/crypto deps)
defmodule Puush do
def up(key, file_name), do: up(key, file_name, File.read!(file_name))
def up(key, name, data) do
boundary = "------#{:crypto.strong_rand_bytes(128) |> Base.encode16}"
payload = multipart_payload(boundary, [{"z", "waifu"}, {"k", key}], [{"f", name, data}])
case :httpc.request(:post, {'https://puush.me/api/up', [], 'multipart/form-data; boundary=#{boundary}', payload}, [], []) do
{:ok, {{_,200,_},_,body}} ->
case body |> to_string |> String.split(",") do
["0", url,_,_] -> {:ok, url}
data -> {:error, List.first(data)}
package eu.thog.prometheus.core;
import com.google.common.eventbus.EventBus;
import net.minecraftforge.fml.common.*;
import net.minecraftforge.fml.common.versioning.ArtifactVersion;
import net.minecraftforge.fml.common.versioning.VersionRange;
import net.minecraftforge.fml.relauncher.ReflectionHelper;
import java.io.File;
import java.net.URL;