Skip to content

Instantly share code, notes, and snippets.

@ariankordi
ariankordi / README.md
Created October 8, 2026 18:37
(vibe-coded) proof of concept to do Xcode 27 wi-fi pairing between a local iPhone and a remote Mac

remote-pair-relay-poc

This proof of concept pairs a local iOS device with a remote macOS pairing host using iOS 27's "pair from Settings" Wi-Fi pairing. The only link between the iOS device's network and the host is one authenticated HTTPS/WebSocket server on the host. After pairing, RoamRun bridges the host and the iOS device over Tailscale for building and debugging. This PoC addresses the open question in RoamRun #19: how to complete the initial pairing when the iOS device and the host are not on the same LAN.

@ariankordi
ariankordi / win-account-picture.cpp
Last active September 8, 2026 16:56
Utility to set Windows account picture without admin with UserTileBroker
/**
* @file win-account-picture.cpp
* @brief Sets a Windows account picture without admin using CUserTileBroker.
* @brief See at https://gist.github.com/ariankordi/09557a817e6682c9063d1e9a1e8d0325
* @author Arian Kordi (https://github.com/ariankordi)
* @author Claude Sonnet 5 (claude@anthropic.com)
* @copyright Unlicense
* @date 2026-09-07
*
* Uses an internal "CUserTileBroker" COM class for setting
@ariankordi
ariankordi / r_f_l_resource.ksy
Created August 17, 2026 02:03
(2025-09?) kaitai for RFL_Res.dat and CFL_Res.dat at the same time. somehow.
meta:
id: r_f_l_resource
#id: c_f_l_resource
title: Resource archive image format for RFL, NFL, CFL.
endian: be # Set to BE for RFL.
seq:
- id: total_archive_count
type: u2
doc: |
@ariankordi
ariankordi / InflateTest.fu
Last active July 30, 2026 05:37
Vibe-coded Fusion port of inflatecpp (MIT, https://github.com/artexety/inflatecpp). It's effectively a ~1200-line zlib/INFLATE decompressor that works in many languages. I believe this was ported by Claude Opus 4.7.
// InflateTest.fu — DEFLATE/ZLIB/GZIP decompressor unit tests
//
// Test vectors generated by tools/gen_test_vectors.py.
// Run: fut -l c -o inflate_test.c inflate.fu InflateTest.fu
// cc inflate_test.c test_main.c -fsanitize=undefined -o inflate_test && ./inflate_test
public static class InflateTest
{
// Raw DEFLATE stored block, input = b"Hi"
const byte[7] Test1Input = {
#pragma once
#include <algorithm>
#include <array>
#include <cassert>
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <cstring>
@ariankordi
ariankordi / NnidResolver.d.mts
Last active May 13, 2026 14:41
JS class for resolving Pretendo Network ID info and Mii data.
/**
* @file NnidResolver.mjs
* Obtained from: https://gist.github.com/ariankordi/0348465eaa2d4c5b95fddd0c00b36795
* Simple class for retrieving information about Nintendo
* Network IDs/Pretendo Network IDs and their Mii data.
* Uses fetch() API in Node, Bun, and web.
*
* In the browser, you will need to use a CORS proxy
* or create your own reverse proxy to the actual API.
* The following is an example of how to set up a basic proxy
@ariankordi
ariankordi / AttributeConverter.fu
Last active April 24, 2026 21:44
IQM shape parser in Fusion + Three.js viewer.
/// Array-only attribute conversion utilities.
public static class AttributeConverter
{
// NOTE: Only C++, JS, and #else implementations were tested.
/// Copy numComponents little-endian f32 values per record from src into dst.
public static void Float32LECopy(byte[] src, uint srcOff, float[]! dst, uint dstOff,
uint numComponents, uint srcStride, uint recordCount)
{
#if C || CPP
@ariankordi
ariankordi / 2026-03-26-CharInfoEx.hexpat
Last active April 9, 2026 02:40
(WIP) ImHex hexpat file for Tomodachi Life: Living the Dream Mii data format, partially reversed from Switch CharInfo format.
#pragma endian little
struct CharInfoEx {
u8 createId[16];
char16 name[11];
u8 fontRegion;
u8 gender;
u8 height;
u8 build;
u8 regionMove;
@ariankordi
ariankordi / MiiImportController.esm.js
Created March 10, 2026 19:31
MiiImportController wip version and esbuild bundled 03/10/2026
var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __commonJS = (cb, mod) => function __require() {
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
};
var __copyProps = (to, from, except, desc) => {
@ariankordi
ariankordi / SakashoObfuscation-test.fu
Last active January 19, 2026 20:00
Miitomo/DeNA (Sakasho) API obfuscation encoding/decoding in Fusion. Tested in JS, C, Python, Go. (SCROLL for MAIN FILE = SakashoObfuscation.fu)
/*
Contents of test-response.bin in Base64:
dmSHgPaISGMWL1ZOiB23IrfdNzdrSy0sADyppku9m/oOlcnctPY3EUcTYoWIhTOx9W5He5PK1zIsjrAR6EQouxY1dSE1U1mVrBkW2zr0BoqtkxYFypAjQSu3CUUKFLO8NgoUElKCCxVyujGjFQqSUAkmUKFoFAoBAD4laODMKB8kNaAsI8lhNLNBch1V1FQpxFW0N4EFgjPah6ut0IqKwQDdRQWxO4Q2UBjYgkqCcqIgAP4pqneIZBG1S9KjAACuABggAGMFvvX114NXSgk71FAAAB4APwK+gxpi1JItKUumKBLsqh16ilVo4gDBAQAwKgCCkQAWZrCImyzWXRUeox25LEBRIqCTLebCBNK4EWwAkgWTe9zbus1sso0AQ0RhchZNOhD2yQULBE+MEYhEdERN2DLmTankGxgmkaFWmxwZasKInd5LNlUoETmFa0SObRqNFmoDYRqNhQMHsMymVAMFFhGxoVE5sFOjPZwJACBjC2p8IADjck3VFojmgysbLVmxNbRLpLLZ8kDhQGQcRDFaGo7QRlgxEegRYAwGDFqBidLE1ADhUHZZ5lwrAhF0aRYRzLQnuegFK5Pmq1nrCBFEYUTOyV0rRy3m7FOyVkcJADA/K2NsvbW1AAAfACd7F5GJXrJ0t0JiADVqWZVLuXbpZjPxAAS5iECItlUAUNtyVkA4ClbN8yAGI01tWETorB6bUIhfYYi7swA8OQCFC7kvAMNKAFgxV9Fwh5gAFv8IM1g73idLOlkKWE6FzaxaowOXAAU8LQD4YuolC4gcVyADOlSDyFhSnPa3tdMQkIFhOLoNt3vkMlo+WOgrXDCDmQtKzNj22zr6wQvgpUAEZG0QWMBgwkR3FhvGLgBgiShY54FkFiK03JajS8LYB9QAAoD4AB70OBjvJmct3LQmxrLXMx2Tcy3R1ZysIgLRnKsd9fULEVc4IyxHyozXhaOIoyZDyZFwDpknhpm+sEQ