Skip to content

Instantly share code, notes, and snippets.

@GaryOderNichts
GaryOderNichts / bMAL_decompress.py
Created May 6, 2024 11:42
Script to decompress .cx files found in Pokemon Rumble U
import zlib
import sys
import struct
"""
.cx file header (0x14 in size):
word[0] 0xe0000000 -> Magic, only the 0x0e is checked
word[1] little endian value, uncompressed size
word[2] 0x624d414c -> "bMAL" Magic
word[3] little endian value, compressed size
@GaryOderNichts
GaryOderNichts / dump2bin.py
Created May 2, 2024 19:46
Scripts to convert data from NFC scan apps to raw bin files
import re
import sys
pattern = r"^\[ ([0-9A-F]{2}):([0-9A-F]{2}):([0-9A-F]{2}):([0-9A-F]{2}):([0-9A-F]{2}):([0-9A-F]{2}):([0-9A-F]{2}):([0-9A-F]{2}) \] Addr\. ([0-9A-F]+)+ : .*"
compiled_regex = re.compile(pattern, re.MULTILINE)
with open(sys.argv[1]) as inf:
with open(sys.argv[2], "wb") as outf:
for l in inf.readlines():
@GaryOderNichts
GaryOderNichts / fsa_capabilities.h
Created March 18, 2024 19:34
FSA capability masks
#pragma once
#define FSA_CAPABILITY_ODD_READ (1llu << 0)
#define FSA_CAPABILITY_ODD_WRITE (1llu << 1)
#define FSA_CAPABILITY_ODD_RAW_OPEN (1llu << 2)
#define FSA_CAPABILITY_ODD_MOUNT (1llu << 3)
#define FSA_CAPABILITY_SLCCMPT_READ (1llu << 4)
#define FSA_CAPABILITY_SLCCMPT_WRITE (1llu << 5)
#define FSA_CAPABILITY_SLCCMPT_RAW_OPEN (1llu << 6)
#define FSA_CAPABILITY_SLCCMPT_MOUNT (1llu << 7)
; $MODE = "UniformRegister"
; $NUM_SPI_PS_INPUT_CNTL = 1
; texCoords R0
; $SPI_PS_INPUT_CNTL[0].SEMANTIC = 0
; $SPI_PS_INPUT_CNTL[0].DEFAULT_VAL = 1
; $SAMPLER_VARS[0].name = "tex0"
; $SAMPLER_VARS[0].type = "SAMPLER2D"
; $SAMPLER_VARS[0].location = 0
//Find Wii IOS syscalls via undefined instruction
//@author rw, GaryOderNichts
//@category ARM
//@keybinding
//@menupath
//@toolbar
import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
@GaryOderNichts
GaryOderNichts / !vscode-wiiu-debugging.md
Last active November 18, 2023 21:19
Guide for Wii U remote GDB debugging with VS Code

Wii U remote GDB debugging with VS Code

This guide will set up VS Code to work with debugging Wii U apps using the GDB stub plugin for Aroma.

Choosing a GDB version

To debug you will need a compatible GDB version installed which supports the powerpc:750 archtitecture.
The one which is bundled with devkitPPC is not recommended, due to being several versions behind.
Edit: It has now been updated to the latest version and can be used without issues. Use /opt/devkitpro/devkitPPC/bin/powerpc-eabi-gdb for the gdb path.
You also install a PowerPC specific version, or use gdb-multiarch which comes with several linux distributions.
Note down the path to the gdb executable, this is required for the next steps.

Additions

acsCoppaStart_002

To set up a Nintendo Network ID
for your child, please contact
Nintendo Customer Support:

1-800-255-3700
@GaryOderNichts
GaryOderNichts / 0x5000000.s
Created August 10, 2022 14:59
Running MCP recovery on retail
.arm.big
.open "patches/sections/0x5000000.bin","patches/patched_sections/0x5000000.bin",0x05000000
; patch IOS_CheckDebugMode to always return 0
.org 0x0501fc98
.thumb
mov r0, #0
mov r0, #0
# may or may not be inspired by plutoo's ctrrpc
import errno
import socket
import os
import sys
import struct
import codecs
from time import sleep
def buffer(size):
#!/bin/bash
# configure script to configure libsndfile for the Wii U
# created 2020 by GaryOderNichts
export PATH=$DEVKITPPC/bin:$PATH
echo '--- configure.ac 2020-10-21 21:28:13.000000000 +0000
+++ configure.ac2 2020-10-21 22:21:16.030237600 +0000
@@ -598,7 +598,6 @@