Skip to content

Instantly share code, notes, and snippets.

View MCMi460's full-sized avatar

Deltaion Lee MCMi460

View GitHub Profile
@Delation
Delation / pythag.py
Last active November 2, 2023 00:57
Pythagorean Tripes
import math
def brute_search(recursion_depth:int = 200):
nums = list(range(recursion_depth))
i = 1
while i < len(nums):
a = nums[i]
for b in range(a, recursion_depth):
c = math.sqrt(a**2 + b**2) # Pythagorean theorem
if c.is_integer():
@MCMi460
MCMi460 / OptiFine in MultiMC.md
Last active January 23, 2024 16:36 — forked from jspanos71/OptiFine in MultiMC
How to install OptiFine in MultiMC (works with 1.20.1)

The OptiFine installer requires that your target version of Minecraft be installed in the default launcher and has been opened at least once. Do this first.

  1. Download OptiFine for your version
  2. Double-click and run using Java (you may need to install a version of Java)
  3. Select "Extract OptiFine"
    • This will put the extracted file of OptiFine in your Downloads folder.
    • Newer versions of Minecraft will require some finagling. Click to reveal these steps.
@MCMi460
MCMi460 / content_category.py
Last active January 25, 2024 16:29
Get the Content Categories from a 3DS Title ID
# Content Categories from Title ID 3DS
# https://www.3dbrew.org/wiki/Titles
title_id = 0x0004000E00086300 # Animal Crossing: New Leaf Update Ver. 1.5
target = int(hex(title_id)[3:7], 16) # Grab "ABCD" from 0xCCCCABCDLLLLLLRR
categories = [
('TWL', 0x8000),
('CanSkipConvertJumpId', 0x100),
('NotRequireRightForMount', 0x80),
('NotRequireUserApproval', 0x40),
('RequireBatchUpdate', 0x20),

Requirements

You will need a 3DS running Luma CFW, as well as a computer that is capable of creating an access point or running a proxy.

SSL Module Patch

It is necessary to disable Root CA Verification in order to capture all 3DS traffic. We recommend doing this with SciresM's 3DS-SSL-Patch.

For ease of use, you can download this premade code.ips patch and place it at /luma/titles/0004013000002F02/code.ips on your 3DS' SD card. Make sure that you've enabled Luma's game patching feature by holding down the select button while powering on your 3DS.

local rshift, lshift=bit.rshift, bit.lshift
local md,mw,mb=memory.readdwordunsigned,memory.readwordunsigned,memory.readbyteunsigned
local gt,sf=gui.text,string.format
local table={}
local on,enbl,overprint,enblo=1,1,1,1
if mb(0x023FFE09)==0x00 then -- Not "2" ~ Not B2/W2
pos_m=md(0x02000024)+0x3461C
zds=md(0x02000024)+0x3DFAC
owstart=md(0x02000024)+0x34E04
@joshenders
joshenders / devkitpro_setup_macos.md
Last active June 27, 2024 02:26
Getting started with Nintendo Switch Development using devkitpro on macOS

Getting started with Nintendo Switch Development using devkitpro on macOS

Prerequsite: Ensure Xcode command line tools are installed

xcode-select --install

Install the devkitpro Package Manager

Requirements

You will need a 3DS running Luma CFW, as well as a computer that is capable of creating an access point or running a proxy.

SSL Module Patch

It is necessary to disable Root CA Verification in order to capture all 3DS traffic. We recommend doing this with SciresM's 3DS-SSL-Patch.

For ease of use, you can download this premade code.ips patch and place it at /luma/titles/0004013000002F02/code.ips on your 3DS' SD card. Make sure that you've enabled Luma's game patching feature by holding down the select button while powering on your 3DS.

@PlatinumMaster
PlatinumMaster / NARCTool.py
Last active December 29, 2023 01:20
[WIP] NARC Tool for the DS games (currently supports files with no directories).
import struct
import os
# NARC Tool
def NARC_Unpack(narc):
if ('.' in narc) == True:
output_folder = narc.split('.')[0] + "_u"
else:
output_folder = narc + "_u"
@jspanos71
jspanos71 / OptiFine in MultiMC
Last active February 27, 2024 16:39
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.
@jaames
jaames / mii-qr.py
Created July 24, 2018 21:02
Decrypt Mii QR code data from 3DS / Wii U / Miitomo
# Decrypt Mii QR codes from 3DS / Wii U / Miitomo
# Usage: python3 <input file> <output file>
# QR docs: https://www.3dbrew.org/wiki/Mii_Maker
from Crypto.Cipher import AES
from sys import argv
key = bytes([0x59, 0xFC, 0x81, 0x7E, 0x64, 0x46, 0xEA, 0x61, 0x90, 0x34, 0x7B, 0x20, 0xE9, 0xBD, 0xCE, 0x52])
with open(argv[1], "rb") as infile, open(argv[2], "wb") as outfile: