Introduce preamble segment and disassemble preamble

This commit is contained in:
Ryan Dwyer committed 2021-10-05 23:24:25 +10:00
1 parent d6a0d4745a
commit d425d4f11c
12 files changed
+78 -74

No files matched your search

+6 -2
View File
@@ -32,6 +32,7 @@ class Extractor:
self.extract_lib()
self.extract_mpconfigs()
self.extract_mpstrings()
self.extract_preamble()
self.extract_rsp()
self.extract_textureconfig()
self.extract_textures()
@@ -197,9 +198,9 @@ class Extractor:
end = self.val('animations')
self.write_extracted('garbage2.bin', self.rom[start:end])
# In all versions, lib starts at 0x1000 and is compressed from 0x3050 onwards
# In all versions, lib starts at 0x1050 and is compressed from 0x3050 onwards
def extract_lib(self):
part1 = self.rom[0x1000:0x3050]
part1 = self.rom[0x1050:0x3050]
part2 = self.decompress(self.rom[0x3050:])
self.write_extracted('lib.bin', part1 + part2)
@@ -244,6 +245,9 @@ class Extractor:
def extract_bootloader(self):
self.write_extracted('bootloader.bin', self.rom[0x40:0x1000])
def extract_preamble(self):
self.write_extracted('preamble.bin', self.rom[0x1000:0x1050])
def extract_rsp_segment(self, name, pos, length):
if pos < 0:
pos = len(self.data) + pos
+2 -2
View File
@@ -68,10 +68,10 @@ def get_segment(fd, locations, segname):
fd.seek(start)
return fd.read(end - start)
# lib is compressed from offset 0x2050 onwards
# lib is compressed from offset 0x2000 onwards
def pack_lib(fd, locations):
lib = get_segment(fd, locations, 'lib')
zipped = lib[0:0x2050] + zip(lib[0x2050:])
zipped = lib[0:0x2000] + zip(lib[0x2000:])
attempt(fd, locations, 'lib', zipped, 'ROMALLOCATION_LIB')
def pack_data(fd, locations):