Skip to content

Instantly share code, notes, and snippets.

@ariankordi
ariankordi / README.txt
Created December 4, 2025 02:11
Patches for Cemu's source that allow using its built-in NEX client for the Wii U Friends List standalone, along with an example
Have you ever wanted to access the Nintendo- or, now Pretendo Network friends list server, but you don't want to use the same old NintendoClients/examples/wiiu/friends.py being used for years and is kinda stinky and yucky because it's Python?
Well, Cemu has (I believe) the only NEX client that's not in Python, like NintendoClients. Because it's in C++, it should be much easier/painless to use and call from.. whatever else.
NOTE that the library is async and multi-threaded, but the example above does not properly await yet. Ooooooooops!
Compile command (Works on my macOS):
- Change: Boost platform, Boost/fmt includes, potentially the output target, potentially remove test.cpp from being built if you do not need it
clang++ -DBOOST_OS_MACOS=1 -Wno-macro-redefined -std=c++20 -I /opt/homebrew/Cellar/boost/1.89.0_1/include/ -I /opt/homebrew/Cellar/fmt/12.1.0/include/ -I ../../ -include ../../Common/precompiled.h ../../Common/unix/platform.cpp ./nex.cpp ./nexFriends.cpp ./nexThread.cpp ./prudp.cpp ../../util/cryp
@ariankordi
ariankordi / raylib_headless_cube.c
Last active November 25, 2025 18:48
raylib example for rendering without creating a window, still using the GPU on modern OpenGL. This uses OS-specific APIs (WGL on Windows, CGL on macOS, EGL on Linux/Android) to create the context. TBD: I'm planning on wrapping all of that into a reusable library to use outside of this example, but for the time being here's the standalone example…
// (soon to be) A header for initializing OpenGL headlessly without a window.
// TODO:
// - Find a way to report errors other than TraceLog from raylib, to remove dependency.
// - Provide a "Finalize" function to clean up the context - requires state keeping
// - Potentially delete and refactor "borrowed" code to be all original and public domain.
//
#include "raylib.h" // TraceLog, LOG_ERROR
#include <stddef.h> // NULL
@ariankordi
ariankordi / RFLCharData.hexpat
Created November 17, 2025 20:54
ImHex hex patterns for mii data (may expand and/or make into github repo
#pragma description "RFLiCharData (aka RFLStoreData, CFLiRFLMiiDataCore, FFLiMiiDataCoreRFL, FFLiMiiDataOfficialRFL)"
#pragma endian big
// Enums
enum Gender : u8 {
male = 0,
female = 1,
all = 2
};
@ariankordi
ariankordi / RFLResource.js
Created September 22, 2025 18:29
(2025-05-13) Wii RFL_Res.dat resource reader in JS using Kaitai. Displays each shape in the resource. This REQUIRES having RFL_Res.dat in the directory you're using it in.
// This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild
(function (root, factory) {
if (typeof define === 'function' && define.amd) {
define(['kaitai-struct/KaitaiStream'], factory);
} else if (typeof module === 'object' && module.exports) {
module.exports = factory(require('kaitai-struct/KaitaiStream'));
} else {
root.RFLResource = factory(root.KaitaiStream);
}
@ariankordi
ariankordi / FFLTestingThumbProvider.cpp
Created July 13, 2025 01:29
Mii thumbnailer for Windows PoC using the FFL-Testing Mii renderer server
/**
* \file FFLTestingThumbProvider.cpp
* \author Arian Kordi (https://github.com/ariankordi)
* \date 2025/07/12
*
* \brief Windows thumbnail provider for Mii data files using
* the FFL-Testing Mii renderer server: https://github.com/ariankordi/FFL-Testing
* \details Requires setting up and running on default port of 12346.
* Not ideal for real use. Should be considered a proof-of-concept/toy.
* https://github.com/ariankordi
@ariankordi
ariankordi / ffl-res-parse-toy.html
Created June 28, 2025 20:16
Sample to parse FFL (Mii) resource files in JS using struct-fu. Parses entire header, including shape and texture headers. Originally made on Feb. 12.
<body>
<h1>upload an FFL resource, then open your console</h1>
<p>
if you need it, get it from archive.org: <a target="_blank" href="https://web.archive.org/web/20180502054513/http://download-cdn.miitomo.com/native/20180125111639/android/v2/asset_model_character_mii_AFLResHigh_2_3_dat.zip">https://web.archive.org/web/20180502054513/http://download-cdn.miitomo.com/native/20180125111639/android/v2/asset_model_character_mii_AFLResHigh_2_3_dat.zip</a>
<div style="font-size: 11px;">
before you try, if you paste that below it won't work since archive.org has no CORS policy :( this proxy from kaeru would work if it were https: <a target="_blank" href="http://ia-proxy.fs3d.net:8989/20180502054513id_/http://download-cdn.miitomo.com/native/20180125111639/android/v2/asset_model_character_mii_AFLResHigh_2_3_dat.zip">http://ia-proxy.fs3d.net:8989/20180502054513id_/http://download-cdn.miitomo.com/native/20180125111639/android/v2/asset_model_character_mii_AFLResHigh_2_3_dat.zip</a>
</div>
</p>
<!-- Inline HTML
@ariankordi
ariankordi / simple-ver3storedata-studio-from-c.js
Last active July 28, 2025 00:43
simple mii studio data encoding in C and JS, from 3DS/Wii U format Mii data (Ver3StoreData/FFLStoreData). meant to encode hex data to be used in a url like this: https://studio.mii.nintendo.com/miis/image.png?type=face&width=270&data=000d142a303f434b717a7b84939ba6b2bbbec5cbc9d0e2ea010d15252b3250535960736f726870757f8289a0a7aeb1
// @ts-check
/*!
* Utility for converting 3DS/Wii U format Mii data (Ver3StoreData/FFLStoreData)
* to URL data format used on studio.mii.nintendo.com rendering API.
* @author Arian Kordi <https://github.com/ariankordi>
*/
/* eslint @stylistic/indent: ['error', 4] -- Define indent rules. */
@ariankordi
ariankordi / miitomo mitmproggsy.py
Created September 14, 2024 04:19
Scripts to assist in deobfuscating Miitomo/DeNA XOR + LZ4 encryption, with a mitmproxy script, Go reverse proxy, and Python decoding script. (Note: AI slop)
import mitmproxy.http
from mitmproxy import ctx
import lz4.block
import binascii
# NOTE: miitomo common key is '9ec1c78fa2cb34e2bed5691c08432f04'
COMMON_KEY = "9ec1c78fa2cb34e2bed5691c08432f04"
SESSION_ID_COOKIE_NAME = "player_session_id"
def transform_common_key(s):
https://sentry.io/api/*
# remove DISCORD(tm) NITRO(tm) button below friends list button in most cases
discord.com##[href="/store"]
discord.com##[href="/shop"]
discord.com##[href="/discovery"]
discord.com##[href="//discord.com/snowsgiving"]
discord.com##[href="/activities"]
discord.com##div[data-list-item-id=private-channels-uid_40___snowsgiving]
# remove discord ready animation n video
discord.com##video[class^="ready"]
@ariankordi
ariankordi / mii2charinfonx.py
Created July 12, 2024 21:15
uses HEYimHEROIC/mii2studio (PLACE IN THAT REPO!!!) to convert to the Switch Mii format, nn::mii::CharInfo, hacky script
import sys
from struct import pack
import os
from kaitaistruct import KaitaiStream, BytesIO
if len(sys.argv) < 4:
print("CLI Usage: python mii2studio.py <input mii file / qr code / cmoc entry number> <output studio mii file> <input type (wii/ds/3ds/wiiu/miitomo/switchdb/switch/studio)>\n")
input_file = input("Enter the path to the input file (binary file or QR Code), a CMOC entry number, or a URL to a QR Code: ")
output_file = input("Enter the path to the output file (which will be importable with Mii Studio): ")