Skip to content

Instantly share code, notes, and snippets.

View ChainSwordCS's full-sized avatar
💾
Usually slow to respond.

ChainSwordCS ChainSwordCS

💾
Usually slow to respond.
View GitHub Profile
@ChainSwordCS
ChainSwordCS / nro-lz4-fixup.py
Last active August 29, 2026 00:39
simple script to fix the header of a .nro.lz4 file, so you can decompress it with standard tools
#!/usr/bin/env python3
# nro-lz4-fixup.py
# simple script to fix the header of a .nro.lz4 file,
# so you can decompress it with standard tools (namely, lz4, the cli utility)
# doesn't work on all .nro.lz4 files. idk why. something stupid i'm sure. ymmv
# License: MIT
@ChainSwordCS
ChainSwordCS / parse_har_1.py
Last active August 11, 2026 00:25
simple script to parse a .har file and spit out a CSV with a list of URLs,* for scraping or some quick and dirty web archival.
# python 3.12.3+
# simple script to parse a .har file and spit out a CSV with a list of URLs,*
# for scraping or some quick and dirty web archival.
# (plug the output url list txt file into wget)
# *: Right now, it spits out all the URLs for which the response was bigger than 1 MiB, or was a "partial-content" response type.
# note: for PROPER archival of webpages, consider using something else, like wget,
@ChainSwordCS
ChainSwordCS / nacp.hexpat
Created May 29, 2026 02:34
incomplete/partial parser for control.nacp (Nintendo Switch), for use with ImHex
/** (incomplete) parser for control.nacp [Nintendo Switch]
see also:
https://switchbrew.org/wiki/NACP
*/
#pragma endian little
import std.core;
import std.io;
import std.mem;
see:
https://switchbrew.github.io/libnx/structNacpStruct.html
https://switchbrew.github.io/libnx/structNacpLanguageEntry.html
https://switchbrew.github.io/libnx/nacp_8h.html#details
pseudocode:
Result r = nsGetApplicationControlData(NsApplicationControlSource_Storage, appId, ctrlData, sizeof(NsApplicationControlData), &actualSize);
ctrlData->nacp.lang[0].name
@ChainSwordCS
ChainSwordCS / assetextract.py
Created December 11, 2024 23:48
a quick and dirty script designed to recursively extract files from Unity `.asset` YAML files, which were extracted using AssetRipper
'''
UNLICENSE
This is free and unencumbered software released into the public domain.
Anyone is free to copy, modify, publish, use, compile, sell, or
distribute this software, either in source code form or as a compiled
binary, for any purpose, commercial or non-commercial, and by any
means.
@ChainSwordCS
ChainSwordCS / OptiFine in MultiMC
Created July 6, 2021 06:12 — forked from jspanos71/OptiFine in MultiMC
How to install OptiFine in MultiMC
The OptiFine installer requires that MC be installed in the default launcher and has opened the version of MC at least once. Do this first.
1. Download OptiFine
2. Extract OptiFine
a. Double click the download from step 1
b. Click Extract button
c. Navigate to MultiMC instance you wish to install OptiFine into (C:\mc\MultiMC\instances\1.13\.minecraft\)
3. Move extracted Optifine to instance \ libraries folder (C:\mc\MultiMC\instances\1.13\libraries\)
4. In MultiMC edit instance, go to Version screen and select the Minecraft entry in the list. Then click Add to Minecraft.jar
5. Select the OptiFine file you extracted and moved in step 3.