Beispiel #1
0
import struct
from pprint import pprint
from util.structs import makes_header_struct
from sh2 import opcodes


IPStruct = makes_header_struct('IPStruct', '<',
   ('hardware_identifier', '16s'),
   ('maker_id', '16s'),
   ('product_number', '10s'),
   ('version', '6s'),
   ('release_date', '8s'),
   ('device_information', '8s'),
   ('compatible_area_symbols', '10s'),
   ('space', '6s'),
   ('compatible_peripherals', '16s'),
   ('game_title', '112s'),
   ('reserved', '16s'),
   ('ipsize', 'L'),
   ('reserved2', 'L'),
   ('stack_m', 'L'),
   ('stack_s', 'L'),
   ('first_read_address', 'L'),
   ('first_read_size', 'L'),
   ('reserved3', 'L'),
   ('reserved4', 'L'))


class UnknownOpcode(Exception): pass


if __name__ == '__main__':
Beispiel #2
0
# -*- coding: utf-8 -*-
import io
from util.structs import makes_header_struct


SceneHeader = makes_header_struct('SceneHeader', '<',
                           ('file_type', '4s'),
                           ('file_size', 'I'),
                           ('start_data', 'H'),
                           ('start_script', 'H'),
                           ('unk1', 'H'))


TextHeader = makes_header_struct('TextHeader', '<',
                          ('ptr_beg_1', 'B'),
                          ('diag_ptr', 'H'),
                          ('ptr_end_1', 'H'),

                          ('ptr_beg_2', 'B'),
                          ('tag_ptr', 'H'),
                          ('ptr_end_2', 'H'),

                          ('unk1', 'B'),
                          ('unk2', 'H'),
                          ('end_code', 'B'),

                          ('zero', 'B'))


class Scene: