Skip to content

Instantly share code, notes, and snippets.

Avatar

Ash Wolf Treeki

View GitHub Profile
View gist:7297a459bb104ae5401c1ce5f7e205a6
/* WARNING: Type propagation algorithm not settling */
uint ProduceNewFlowerGenes(ulonglong geneSetA,uint geneSetB)
{
int iVar1;
uint outputGene3;
uint outputGene2;
ulonglong geneSetA_;
@Treeki
Treeki / TurnipPrices.cpp
Last active Sep 17, 2020
AC:NH turnip price calculator
View TurnipPrices.cpp
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
// munged from https://github.com/simontime/Resead
namespace sead
{
class Random
{
@Treeki
Treeki / acnh_unsave.py
Created Mar 25, 2020
savefile decrypter for Animal Crossing: New Horizons
View acnh_unsave.py
# savefile decrypter for Animal Crossing: New Horizons
# copyright Ash Wolf (Ninji) 2020
import struct, binascii, sys, Crypto.Cipher.AES, Crypto.Util.Counter
if len(sys.argv) != 4:
print('Usage: %s [main.dat] [mainHeader.dat] [output.dat]' % sys.argv[0])
sys.exit()
class SeadRandom:
@Treeki
Treeki / ida_romfs.py
Created Dec 27, 2019
quick-and-dirty Psion firmware analysis scripts
View ida_romfs.py
import json
with open('/Users/ash/src/psion/all_exports.json', 'r') as f:
all_exports = json.load(f)
del all_exports['EKERN'] #not valid for Windermere
def get_pascal_string(addr):
count = Byte(addr)
return ''.join([chr(Byte(addr + 1 + x)) for x in range(count)])
def scan_file(path, safepath, addr, size):
@Treeki
Treeki / FetchCosmoUpdate.py
Created Dec 11, 2019
get the Cosmo Communicator's latest OTA update from the DigitimeTech server
View FetchCosmoUpdate.py
import binascii, struct, zlib
key = b'Ti92T_77Zij_MiTik'
def decrypt_pkt(buf):
a = buf[:2]
b = buf[10:12]
if buf[8] == 1:
raise 'gzipped!!'
View keybase.md

Keybase proof

I hereby claim:

  • I am treeki on github.
  • I am ninji (https://keybase.io/ninji) on keybase.
  • I have a public key ASA14uVhXUBlklIXELI8OKbNzPAvJnyCI-mlCKTdBtHQbAo

To claim this, I am signing this object:

View redragon_notes
Notifications from Mouse:
08 02 x :: sends message with wParam 8, lParam x to GUI
08 01 x :: sends message with wParam 9, lParam x to GUI
08 06 x :: sends message with wParam 0xA, lParam x to GUI
08 09 __ 01 __ 04 :: sends message with wParam 0xB, lParam 0 to GUI
08 09 __ 01 __ 08 :: sends message with wParam 0xB, lParam 1 to GUI
08 09 __ 01 __ 02 :: sends message with wParam 0xB, lParam 2 to GUI
08 09 __ 02 __ 00 :: sends message with wParam 0xB, lParam 3 to GUI
08 09 __ 06 __ __ :: sends message with wParam 0xB, lParam 4 to GUI
View odeus.py
# runs under Python 2 (yes, I know...)
# required modules: pip install unicorn pefile
# this code is made available under the MIT license, as follows:
# Copyright (c) 2018 Ash Wolf
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
View animtiles.txt
tilenum = 0x300
tileset = 3
framedelays = 4,4,4,4
texname = ww_300.bin
end tile
tilenum = 0x301
tileset = 3
@Treeki
Treeki / gds_read.py
Created Mar 29, 2018
fucking around with Professor Layton and the Curious Village
View gds_read.py
import struct
import sys
# 1 is maybe s32?
# Commands:
# Room In --
# 18 -- (8?)
# 88 -- (1:a, 6:b)
# 236 -- (1:a, 1:b)
You can’t perform that action at this time.