Skip to content

Instantly share code, notes, and snippets.

View simontime's full-sized avatar
🥨

Simon Aarons simontime

🥨
View GitHub Profile
@simontime
simontime / decode_ash.c
Last active February 11, 2023 01:42 — forked from NWPlayer123/decode_ash.c
decompression code from My Pokemon Ranch, seems similar to the ash used by the Wii Menu
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
uint16_t left9[0x400];
uint16_t right9[0x400];
uint16_t left12[0x10000];
uint16_t right12[0x10000];
uint32_t stack[0x100];
@simontime
simontime / yay0dump.c
Created June 20, 2020 15:43
Scans through a ROM and decompresses all Yay0 data found inside.
#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
#ifdef _MSC_VER
#define __builtin_bswap32(x) _byteswap_ulong(x)
#endif
typedef struct
{
@simontime
simontime / yakuza.c
Created May 22, 2020 23:27
Encrypts & decrypts Yakuza Kiwami 2 saves (doesn't do checksum yet)
#include <stdio.h>
#include <stdlib.h>
static const char Key[] = "STarYZgr3DL11";
static const int KeyLen = 13;
int main(int argc, char **argv)
{
FILE *in, *out;
char *data;
@simontime
simontime / bdf.c
Created March 31, 2019 17:29
Switch CertStore .bdf extractor
#include <stdio.h>
#include <stdint.h>
#include <string.h>
#include <stdlib.h>
typedef struct Header {
uint32_t Magic;
uint32_t NumFiles;
} Header;
@simontime
simontime / fizzbuzz.c
Last active January 18, 2019 11:59
Best and shortest fizzbuzz in C
#include <stdio.h>
#include <string.h>
void main() {
for (char i = 1, output[9]; i <= 100; i++, memset(output, 0, 9)) {
if (!(i % 3)) strcpy(output, "Fizz");
if (!(i % 5)) strcpy(!output[0] ? output : output + 4, "Buzz");
printf("%d: %s\n", i, output[0] ? output : "N/A");
}
}
@simontime
simontime / Program.cs
Created January 14, 2019 12:53
Sex-B-Gone Discord Bot
using DSharpPlus;
using System.Threading.Tasks;
using System.Text.RegularExpressions;
using System;
using System.IO;
class Program {
static DiscordClient Client = new DiscordClient(
new DiscordConfiguration { Token = File.ReadAllText("token.txt") });
@simontime
simontime / Program.cs
Last active January 9, 2019 09:44
Need for speed GIN to WAV converter
using System.IO;
internal class Program
{
private static void Main(string[] args)
{
var buffer = new byte[0x4C];
int[] samples = new int[0x20],
coeffs1 = new int[] { 0, 0xF0, 0x1CC, 0x188 },
@simontime
simontime / arc.c
Created December 29, 2018 16:13
Monster Hunter Generations Ultimate ARC extractor
#define _CRT_SECURE_NO_WARNINGS
#define ZLIB_WINAPI
#include <direct.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/stat.h>
#include <zlib.h>
@simontime
simontime / keybase.md
Created December 15, 2018 15:08
Keybase stuff

Keybase proof

I hereby claim:

  • I am simontime on github.
  • I am simontime (https://keybase.io/simontime) on keybase.
  • I have a public key ASDhnJf97ZJw9x_Zr52-Isc1p4So7jIauURJ3GO8EGUfZQo

To claim this, I am signing this object:

@simontime
simontime / main.c
Last active December 15, 2018 07:20
Nintendo Switch screenshot filename encryptor/decryptor using x86 AES-NI intrinsics
#include <stdio.h>
#include <string.h>
#include <wmmintrin.h>
#define u8 unsigned char
#define i128 __m128i
#define exp(k, rc) expand(k, _mm_aeskeygenassist_si128(k, rc))
#define c(b) b - (b < 58 ? 48 : 55)