Skip to content

Instantly share code, notes, and snippets.

@wareya
wareya / decompress.py
Created May 19, 2017 17:47
(teardown of someone else's extractor) decompress the contents of whatever .ks.scn files are considered (mdf?)
import sys
import os
import zlib
import glob
for arg in sys.argv[1:]:
for file in glob.glob(arg):
if os.path.splitext(file)[1].lower() == '.scn':
if not os.access(os.path.splitext(file)[0] + '.psb', os.F_OK):
data = open(arg, 'rb').read()
@wareya
wareya / rio.cpp
Created May 22, 2017 07:08
will engine arc stuff stuff
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <vector>
#include <string>
void fread_or_die(void * a, size_t b, size_t c, FILE * d)
{
size_t got = fread(a, b, c, d);
@wareya
wareya / wsc.cpp
Created May 22, 2017 07:09
will engine VM stuff (whatever version shirokuma bell stars uses)
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <vector>
#include <string>
const char * filename;
bool trap = false;
@wareya
wareya / msd.cpp
Last active May 23, 2017 02:53
extracts dialogue (?) from whatever format hanahira's script is in
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <vector>
#include <string>
const char * filename;
bool trap = false;
@wareya
wareya / scriptdump.cpp
Created May 23, 2017 07:07
Script dumper for A Clockwork Leyline
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <deque>
void fread_or_die(void * a, size_t b, int c, FILE * d)
{
int got = fread(a, b, c, d);
if(feof(d)) {puts("feof"); exit(0);}
@wareya
wareya / scriptdump.cpp
Created May 25, 2017 04:09
Script dumper from already-decrypted rld files (tested against Soramitsu)
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <deque>
bool flag = false;
void fread_or_die(void * a, size_t b, int c, FILE * d)
{
@wareya
wareya / dump.py
Last active May 25, 2017 05:47
script dumper that works for kamimaho (based on kssize.py)
# Modified to spit out main script content in utf-8
# Extract script with xp3viewer
import glob
import os
import re
import sys
# count mode
@wareya
wareya / parse.c
Last active June 1, 2017 03:51
dumps script data from light games that use utf-8 instead of utf-16 to plaintext
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#define and &&
#define or ||
#ifndef NULL
#define NULL 0
#endif
@wareya
wareya / ns.py
Last active May 31, 2017 09:50
Real parser for nscripter scripts (whatever version axanael uses) (i.e. not a pile of hacky regexes)
#!/usr/bin/env python
# apply regex \n([^「  \t『(\n«〝]) -> \1 (or similar) to the output to remove linewraps
# apply regex (《[^》]*》)(〈[^〉]*〉) -> \2\1 to put furigana in kanji,kana order
import re
import sys
import codecs
suppress_newline = False
@wareya
wareya / minefield.cpp
Last active June 29, 2017 16:18
A semi-generic dumper for extremely simple packfile formats that happen to follow a specific format.
#include <stdio.h>
#include <string_view>
#include <vector>
#include <fstream>
struct entry
{
// modifies input cstring, insults null terminators, etc. cleanup of cstring is responsibility of calling code.