MUGENのSFFを解析してみたよ

今日はMUGENのSFFファイル解析に丸一日を費やしました。 やったことはGitHubに上げるほどでもないけど残したい。 たまには「はてな民」らしくブログにコード貼り付けで。

import java.io.File;
import java.io.BufferedInputStream;
import java.io.RandomAccessFile;
import java.io.FileInputStream;
import java.io.IOException;

class FileDump {
    public static void main(String args[]) throws IOException {
        String inputFile = "billyrb2.sff";
        RandomAccessFile bis = new RandomAccessFile(new File(inputFile),"r");
        int code;
        int i = 0;
        byte h[] = new byte[512];
        byte s[] = new byte[32];
        int seek = 0;
        bis.read(h);
        int next_subfile = Integer.decode(String.format("0x%02x%02x%02x%02x",h[27],h[26],h[25],h[24]));
        for(int n=0; n<512;n++){
            System.out.print(Integer.toHexString(h[n]));
        }
        System.out.print("\n");
        System.out.print(String.format("0x%02x%02x%02x%02x",h[27],h[26],h[25],h[24]));
        System.out.print(Integer.toHexString(next_subfile));
        System.out.print("\n");
    int prev_subfile = 0;
        while (prev_subfile != next_subfile) {
            bis.seek(next_subfile);
            bis.read(s);
        prev_subfile = next_subfile;
            System.out.print(Integer.toHexString(i++));
            System.out.print("\n");
            next_subfile = Integer.decode(String.format("0x%02x%02x%02x%02x",s[3],s[2],s[1],s[0]));
            System.out.print(String.format("0x%02x%02x%02x%02x",s[3],s[2],s[1],s[0]));
            System.out.print(Integer.toHexString(next_subfile));
            System.out.print("\n");
        }
        bis.close();
    }
}

今日のカプエス2はブロッキングのPで草薙京八神庵ロレントでゴッドルガールで1回コンティニュー。 たまに負けることあるから、新鮮味が戻って面白いんですよね。もっとカッコイイムーヴで戦いたい。 MUGENのチームはストZEROリュウ・初侍ガルフォード・リアルバウトビリーです。


🄫1999-2023 id:karmen