Skip to content

Instantly share code, notes, and snippets.

View InvoxiPlayGames's full-sized avatar
📱
windows phone

Emma InvoxiPlayGames

📱
windows phone
View GitHub Profile
@InvoxiPlayGames
InvoxiPlayGames / interactions.php
Created February 16, 2023 01:05
Discord Interactions signature validation in native PHP 7.2+
<?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 / RB3ESongID.cs
Last active February 14, 2024 08:21
RB3ESongID.cs - C# class for generating RB3Enhanced-compatible Song IDs from a given shortname
/*
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 / 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
#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 / 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
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 / amplitude_save.hexpat
Created September 2, 2024 16:47
W.I.P. Amplitude (2016) save file format ImHex pattern
#pragma author InvoxiPlayGames
#pragma description Amplitude (2016) Save File
// Uncomment if providing a PS3 save file, leave commented for PS4
//#pragma endian big
// Symbol/String definition
struct sym {
u32 len;
char string[len];
@InvoxiPlayGames
InvoxiPlayGames / akamai_weirdtoken_generate.py
Created November 9, 2024 12:12
akamai_weirdtoken_generate.py - generates some sort of Akamai token used by some games here and there
# generates some sort of Akamai token used by some games here and there
# in the format of ?token=1735689600_ffeeddccbbaa998877665544332211
# idk what scheme it's called or anything i just know it does what i want it to
# code by Emma 2024 public domain do whatever
import sys
import struct
import hashlib
def create_url_token(path: str, salt: str, expiry: int):
@InvoxiPlayGames
InvoxiPlayGames / physical_store_win7.hexpat
Created February 18, 2025 12:16
ImHex pattern for the SPPSVC "Physical Store" files used in Windows 7
#include <std/mem.pat>
u8 hmac_key[0x10] @ 0x0;
u8 hmac_sha[0x14] @ 0x10;
enum blocktype : u32 {
None = 0,
Named = 1,
Attribute = 2,
Timer = 3,
@InvoxiPlayGames
InvoxiPlayGames / physical_store_vista.hexpat
Created February 19, 2025 04:23
ImHex pattern for the SLSVC "Physical Store" files used in Windows Vista
#include <std/mem.pat>
u8 sha1_salt[0x10] @ 0x0;
// sha1_hash = SHA1(sha1_salt .. 0x28 to EOF)
u8 sha1_hash[0x14] @ 0x10;
struct ps_vista_block {
u32 type;
u32 unk_flags;
u32 id_len;