Skip to content

Instantly share code, notes, and snippets.

View WerWolv's full-sized avatar
⚗️
Hacking the Planet

Nik WerWolv

⚗️
Hacking the Planet
View GitHub Profile
@WerWolv
WerWolv / fez_save_file.hexpat
Last active September 3, 2026 03:53
ImHex Pattern for FEZ's Save File format. Take a look at the blog post at https://werwolv.net/posts/file_format_reverse_engineering to learn more
import std.core;
import std.io;
import type.time;
import std.sys;
using int = s32;
using long = s64;
struct SevenBitEncodedIntByte {
u8 byte;
enum TestEnum : u32 {
A = 1,
B = 5,
C = 10,
D = 50
};
u32 testUnsigned1 @ 0x00 [[property("Unsigned Values", "Test Unsigned 1")]];
u32 testUnsigned2 @ 0x04 [[property("Unsigned Values", "Test Unsigned 2")]];
static const char *g_strings[StrId_max][SetLanguage_Total] = {
[StrId_limit_warn] = {
STR_EN("Applet Modus"),
},
[StrId_version] = {
STR_EN("Version: %s"),
},
[StrId_author] = {
#pragma once
#include <switch.h>
typedef union {
u32 color_abgr;
struct {
u8 r, g, b, a;
};
#pragma once
extern "C" {
#include "types.h"
}
#include <string>
#include <vector>
class MemoryDump {
#include "helpers/memory_dump.hpp"
#include <stdio.h>
#define BUFFER_SIZE 0x10000
MemoryDump::MemoryDump(std::string filePath, DumpType dumpType, bool discardFile) {
m_dataHeader = { 0 };
m_dataHeader.magic = 0x4E5A4445;
m_dataHeader.endOfHeader = '@';
struct home_led_mcycle_t
{
u8 intensity;
u8 fade_out;
u8 duration;
};
struct home_led_ctxt_t
{
u8 intensity_start[1];
#include <stdio.h>
//#include <switch.h>
#include "gui.hpp"
#include "gui_main.hpp"
#include <chrono>
#include <curl/curl.h>
#include <iostream>
#include <math.h>
#include <fstream>
#include <stdint.h>
#define SVC(code) asm volatile ("SVC %0" : : "I" (code))
#define CODE_BASE_ADDR (0x8000000ULL)
__attribute__((naked)) void SVC_Handler(void) {
__asm__ __volatile__ (
" TST lr, #0x4 \n\t"
" ITE eq \n\t"
#include "debug_process.hpp"
#include <cmath>
#include <cstring>
#include <stdio.h>
DebugProcess::DebugProcess() {
m_debugHandle = 0;
u64 pids[300];