From 56bfbb02ec46bc7887c6b61bec8fea11f712f866 Mon Sep 17 00:00:00 2001 From: shchmue Date: Mon, 20 Sep 2021 13:35:02 -0600 Subject: [PATCH] Make build_package3.py Python 2&3 compatible --- fusee/build_package3.py | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/fusee/build_package3.py b/fusee/build_package3.py index 2c81792a0..5bbc7340a 100644 --- a/fusee/build_package3.py +++ b/fusee/build_package3.py @@ -15,12 +15,12 @@ def read_file(fn): def pad(data, size): assert len(data) <= size - return (data + '\x00' * size)[:size] + return (data + b'\x00' * size)[:size] def get_overlay(program, i): return program[0x2B000 + 0x14000 * i:0x2B000 + 0x14000 * (i+1)] -KIP_NAMES = ['Loader', 'NCM', 'ProcessManager', 'sm', 'boot', 'spl', 'ams_mitm'] +KIP_NAMES = [b'Loader', b'NCM', b'ProcessManager', b'sm', b'boot', b'spl', b'ams_mitm'] def get_kips(ams_dir): emummc = read_file(os.path.join(ams_dir, 'emummc/emummc_unpacked.kip')) @@ -32,13 +32,13 @@ def get_kips(ams_dir): spl = read_file(os.path.join(ams_dir, 'stratosphere/spl/spl.kip')) ams_mitm = read_file(os.path.join(ams_dir, 'stratosphere/ams_mitm/ams_mitm.kip')) return (emummc, { - 'Loader' : loader, - 'NCM' : ncm, - 'ProcessManager' : pm, - 'sm' : sm, - 'boot' : boot, - 'spl' : spl, - 'ams_mitm' : ams_mitm, + b'Loader' : loader, + b'NCM' : ncm, + b'ProcessManager' : pm, + b'sm' : sm, + b'boot' : boot, + b'spl' : spl, + b'ams_mitm' : ams_mitm, }) def write_kip_meta(f, kip, ofs): @@ -81,14 +81,14 @@ def write_header(f, all_kips, wb_size, tk_size, xf_size, ex_size, ms_size, fs_si # Write git_revision; f.write(pk('