Skip to content

Instantly share code, notes, and snippets.

View InvoxiPlayGames's full-sized avatar
🦊
fox on the computer

Emma InvoxiPlayGames

🦊
fox on the computer
View GitHub Profile
@InvoxiPlayGames
InvoxiPlayGames / rpcs3_prx_hash.py
Created March 1, 2024 06:26
rpcs3_prx_hash.py - implementation of RPCS3 prx hashing to help make patch files. wont work on every file but works for RB3Enhanced
View rpcs3_prx_hash.py
import sys
import math
import hashlib
from elftools.elf.elffile import ELFFile
def cmod(a, b):
return abs(a)%abs(b)*(1-2*(a<0))
# referencing RPCS3(Nekotekina): https://github.com/RPCS3/rpcs3/blob/master/Utilities/StrFmt.cpp#L127
def base57(in_data):
@InvoxiPlayGames
InvoxiPlayGames / uidsys-output.c
Created February 22, 2024 01:21
uidsys-output.c - very basic C utility to output a list of all titles found in a Wii's uid.sys
View uidsys-output.c
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#ifndef SHOULD_BE_BE
#define BE16(i) ((((i) & 0xFF) << 8 | ((i) >> 8) & 0xFF) & 0xFFFF)
#define BE(i) (((i) & 0xff) << 24 | ((i) & 0xff00) << 8 | ((i) & 0xff0000) >> 8 | ((i) >> 24) & 0xff)
#define BE64(i) (BE((i) & 0xFFFFFFFF) << 32 | BE(((i) >> 32) & 0xFFFFFFFF))
#else
#define BE16(i) i
@InvoxiPlayGames
InvoxiPlayGames / RB3ESongID.cs
Last active February 14, 2024 08:21
RB3ESongID.cs - C# class for generating RB3Enhanced-compatible Song IDs from a given shortname
View RB3ESongID.cs
/*
RB3ESongID.cs by Emma (ipg.gay), 2024
granted to you under the public domain - feel free to use and modify
for ideal usage: *always* use the song ID from the songs.dta if it is an integer.
otherwise, use the symbol from the song_id DataNode. don't assume the shortname at
the start of songs.dta is always the same as the song_id on these broken customs
*/
using System.Text;
@InvoxiPlayGames
InvoxiPlayGames / interactions.php
Created February 16, 2023 01:05
Discord Interactions signature validation in native PHP 7.2+
View interactions.php
<?php
$timestamp = $_SERVER['HTTP_X_SIGNATURE_TIMESTAMP'];
$signature = hex2bin($_SERVER['HTTP_X_SIGNATURE_ED25519']);
if ($signature === false) {
die(http_response_code(403));
}
$publickey = hex2bin("[ YOUR_APP_PUBLIC_KEY ]"); // REPLACE THIS WITH YOUR OWN APP'S!
$postdata = file_get_contents('php://input');
// signature verification;
@InvoxiPlayGames
InvoxiPlayGames / 45410914 - Rock Band 3.patch.toml
Created December 18, 2022 19:43
RB3Enhanced Loader Xenia Canary Patch
View 45410914 - Rock Band 3.patch.toml
# This patch requires a build of Xenia Canary that supports writable_code_segments, and having it enabled in the config.
# (Not merged as of 18-Dec-2022, see: https://github.com/xenia-canary/xenia-canary/pull/100)
# Commit 28f3eb6 or later of RB3Enhanced recommended, due to removing the DEMO check.
title_name = "Rock Band 3"
title_id = "45410914"
hash = [
"464451C1022FFF32", # EA disc default.xex + TU5 applied
"02B607A811A4C291" # RB3DX modded pre-patched TU5 XEX
]
@InvoxiPlayGames
InvoxiPlayGames / tcp-to-tls-proxy.js
Created December 3, 2022 02:51
tcp-to-tls-proxy.js - A simple NodeJS proxy to forward a given unencrypted TCP connection to a TLS encrypted server
View tcp-to-tls-proxy.js
/*
tcp-to-tls-proxy.js - A simple NodeJS proxy to forward a given unencrypted TCP connection to a TLS encrypted server.
by InvoxiPlayGames, hereby released into the public domain. Not that there's much to it to license.
I created this as a way to connect to my modern, TLS 1.3-supporting XMPP server from iChat on a
PowerBook running OS X Leopard (hence the default ports), but this can be used for anything that
accepts a raw TLS connection where a legacy client can only handle an unencrypted connection.
Please be safe with this, don't run this over an external network as it *is* reducing security.
To use, replace the host and port in tls_settings with your target server, and host_port with
@InvoxiPlayGames
InvoxiPlayGames / ppcasm.h
Created May 4, 2022 22:06
PowerPC assembly opcode macros for C
View ppcasm.h
/*
ppcasm.h by InvoxiPlayGames, 2021
WTFPL License
*/
#include <stdint.h>
// Poke values
#define POKE_8(addr, val) do { *(uint8_t*)(addr) = (uint8_t)(val); } while (0)
#define POKE_16(addr, val) do { *(uint16_t*)(addr) = (uint16_t)(val); } while (0)
@InvoxiPlayGames
InvoxiPlayGames / RBWiiKeytarUnderstander.cs
Created January 12, 2022 08:27
RBWiiKeytarUnderstander.cs - Basic Rock Band 3 Wii Keyboard / Keytar Parser in C#
View RBWiiKeytarUnderstander.cs
/*
RBWiiKeytarUnderstander.cs by InvoxiPlayGames 2022
Licensed under WTFPL
Requires LibUsbDotNet NuGet package, licensed under LGPLv3
Use Zadig to install WinUSB or LibUSB drivers for the device
*/
using LibUsbDotNet;
using LibUsbDotNet.Main;
using LibUsbDotNet.WinUsb;
using System;
@InvoxiPlayGames
InvoxiPlayGames / py_ubi_crc.py
Last active November 9, 2023 08:35
py_ubi_crc.py - a python ubiart (?) crc32 implementation
View py_ubi_crc.py
# python ubiart (?) crc32 implementation by github.com/InvoxiPlayGames
# function usage - crc(bytearray), if using a string, crc(bytearray(uppercasestring, "utf8"))
# code licensing: don't be a dick with it, credit for general usage would be nice but not required
# if you use parts of this python script in your own project, credit is required
import math
def shifter(a, b, c):
# the masks are because python likes to get excited with bit shifting
d = 0
a = (a - b - c) ^ (c >> 0xd)
@InvoxiPlayGames
InvoxiPlayGames / string-gecko.py
Created October 13, 2021 14:42
string-gecko.py - generate Wii gecko/ocarina codes to replace ASCII strings in game executables
View string-gecko.py
# string-gecko.py by github.com/InvoxiPlayGames
# command usage: python string-gecko.py [dol|dump] [filename] [oldstring] [newstring]
# code licensing: don't be a dick with it, credit for general usage would be nice but not required
# but if you use parts of this python script in your own project, credit is required
import struct
import sys
memorybase = 0x80000000
memorysize = 0x01800000 # size of Wii MEM1, i think