mirror of
https://github.com/FoxdieTeam/mgs_reversing.git
synced 2024-11-23 05:19:52 +00:00
Uninitializer - injecting uninitialized memory to built overlays
This commit is contained in:
parent
f03389ed04
commit
1ce16d8f69
@ -151,6 +151,9 @@ ninja.variable("psyq_aspsx_2_81_exe", prefix("wibo", "$psyq_path/ASPSX/2.81/ASPS
|
||||
ninja.variable("psyq_psylink_exe", prefix("wibo", "$psyq_path/psyq_4.4/bin/psylink.exe"))
|
||||
ninja.newline()
|
||||
|
||||
ninja.variable("psyq_psylink_overlay_fopen_patch_exe", prefix("wibo", "$psyq_path/psyq_4.4/bin/psylink_overlay_fopen_patch.exe"))
|
||||
ninja.newline()
|
||||
|
||||
ninja.variable("src_dir", "../src")
|
||||
ninja.newline()
|
||||
|
||||
@ -183,13 +186,13 @@ ninja.newline()
|
||||
ninja.rule("psyq_cc_44", "$psyq_cc_44_exe -quiet -O2 -G $gSize -g -Wall $in -o $out""", "Compile $in -> $out")
|
||||
ninja.newline()
|
||||
|
||||
ninja.rule("psyq_aspsx_assemble_44_overlays", "$psyq_aspsx_44_exe -q -G0 -soverlay $in -o $out""", "Compile $in -> $out")
|
||||
ninja.rule("psyq_aspsx_assemble_44_overlays", "$psyq_aspsx_44_exe -q -G0 -s-overlay $in -o $out""", "Compile $in -> $out")
|
||||
ninja.newline()
|
||||
|
||||
ninja.rule("psyq_aspsx_assemble_44", "$psyq_aspsx_44_exe -q $in -o $out", "Assemble $in -> $out")
|
||||
ninja.newline()
|
||||
|
||||
ninja.rule("psyq_aspsx_assemble_2_81_overlays", "$psyq_aspsx_2_81_exe -q -G0 -soverlay $in -o $out""", "Compile $in -> $out")
|
||||
ninja.rule("psyq_aspsx_assemble_2_81_overlays", "$psyq_aspsx_2_81_exe -q -G0 -s-overlay $in -o $out""", "Compile $in -> $out")
|
||||
ninja.newline()
|
||||
|
||||
ninja.rule("psyq_aspsx_assemble_2_81", "$psyq_aspsx_2_81_exe -q $in -o $out", "Assemble $in -> $out")
|
||||
@ -202,7 +205,7 @@ ninja.newline()
|
||||
ninja.rule("psyq_aspsx_assemble_2_56", "$psyq_aspsx_2_56_exe -q $in -o $out", "Assemble $in -> $out")
|
||||
ninja.newline()
|
||||
|
||||
ninja.rule("linker_command_file_preprocess", f"{sys.executable} $src_dir/../build/linker_command_file_preprocess.py $in $psyq_sdk $out {' '.join(args.defines)} $overlay", "Preprocess $in -> $out")
|
||||
ninja.rule("linker_command_file_preprocess", f"{sys.executable} $src_dir/../build/linker_command_file_preprocess.py $in $psyq_sdk $out {' '.join(args.defines)} $overlay $overlay_suffix", "Preprocess $in -> $out")
|
||||
ninja.newline()
|
||||
|
||||
# For some reason VR executable links with PsyQ 4.5!?
|
||||
@ -211,6 +214,12 @@ psqy_lib = f'{args.psyq_path}/psyq_4.5/LIB' if args.variant == 'vr_exe' else f'{
|
||||
ninja.rule("psylink", f"$psyq_psylink_exe /l {psqy_lib} /c /n 4000 /q /gp .sdata /m \"@$src_dir/../{args.obj_directory}/linker_command_file$suffix.txt\",$src_dir/../{args.obj_directory}/_mgsi$suffix.cpe,$src_dir/../{args.obj_directory}/asm$suffix.sym,$src_dir/../{args.obj_directory}/asm$suffix.map", "Link $out")
|
||||
ninja.newline()
|
||||
|
||||
ninja.rule("psylink_overlay_fopen_patch", f"{sys.executable} $src_dir/../build/create_dummy_file.py $src_dir/../{args.obj_directory}/$overlay_bin && {sys.executable} $src_dir/../build/create_dummy_file.py $src_dir/../{args.obj_directory}/$overlay_bss_bin && $psyq_psylink_overlay_fopen_patch_exe /l {psqy_lib} /c /n 4000 /q /gp .sdata /m \"@$src_dir/../{args.obj_directory}/linker_command_file$suffix.txt\",$src_dir/../{args.obj_directory}/_mgsi$suffix.cpe,$src_dir/../{args.obj_directory}/asm$suffix.sym,$src_dir/../{args.obj_directory}/asm$suffix.map", "Link (uninitialized) $out")
|
||||
ninja.newline()
|
||||
|
||||
ninja.rule("uninitializer", f"{sys.executable} $src_dir/../build/uninitializer.py inject $in $out", "Uninitializer $in -> $out")
|
||||
ninja.newline()
|
||||
|
||||
# TODO: update the tool so we can set the output name optionally
|
||||
# cmd /c doesn't like forward slashed relative paths
|
||||
ninja.rule("cpe2exe", prefix("wine", "cmd /c \"$psyq_path_backslashed\\psyq_4.3\\bin\\cpe2exe.exe -CJ $in > NUL\""), "cpe2exe $in -> $out")
|
||||
@ -333,11 +342,27 @@ def gen_build_target(targetName):
|
||||
|
||||
linkerDeps.append(cOFile)
|
||||
|
||||
# Build main exe
|
||||
|
||||
# preprocess linker_command_file.txt
|
||||
linkerCommandFile = f"../{args.obj_directory}/linker_command_file.txt"
|
||||
ninja.build(linkerCommandFile, "linker_command_file_preprocess", f"linker_command_file.txt", variables={'psyq_sdk': args.psyq_path})
|
||||
ninja.newline()
|
||||
|
||||
# run the linker to generate the cpe
|
||||
cpeFile = f"../{args.obj_directory}/_mgsi.cpe"
|
||||
ninja.build(cpeFile, "psylink", implicit=linkerDeps + [linkerCommandFile])
|
||||
ninja.newline()
|
||||
|
||||
# cpe to exe
|
||||
exeFile = f"../{args.obj_directory}/_mgsi.exe"
|
||||
ninja.build(exeFile, "cpe2exe", cpeFile)
|
||||
ninja.newline()
|
||||
|
||||
# Run linker separately for each overlay to make it possible
|
||||
# to share objects (same symbols) across overlays.
|
||||
|
||||
OVERLAYS = [
|
||||
None, # Main executable
|
||||
"sound",
|
||||
"select1", "select2", "select3", "select4", "selectd",
|
||||
"change",
|
||||
@ -353,29 +378,58 @@ def gen_build_target(targetName):
|
||||
]
|
||||
|
||||
if args.variant == 'vr_exe':
|
||||
OVERLAYS = [None]
|
||||
OVERLAYS = []
|
||||
|
||||
for overlay in OVERLAYS:
|
||||
suffix = f"_{overlay}" if overlay else ""
|
||||
# It turns out that MGS overlays contain uninitialized memory
|
||||
# in:
|
||||
# - Padding between values in data/rdata (e.g. padding between strings)
|
||||
# - BSS
|
||||
# Our psylink doesn't have the same problem and it fills those
|
||||
# spaces correctly with 0s.
|
||||
#
|
||||
# To inject back the uninitialized memory we run the linker twice.
|
||||
# The first run uses unmodified psylink, so the generated overlay
|
||||
# has 0s in those described places. The second run uses a modified
|
||||
# version of psylink that writes on top of an existing file
|
||||
# (fopen(, "r+b") instead of fopen(, "wb")). Before the second run
|
||||
# we create a dummy file filled with a repeating non-zero byte -
|
||||
# this represents the uninitialized memory that we will detect.
|
||||
# After that we can use those two generated files, diff them
|
||||
# and combined with the uninitialized memory extracted from original
|
||||
# files to generate an overlay with uninitialized memory.
|
||||
|
||||
# preprocess linker_command_file.txt
|
||||
linkerCommandFile = f"../{args.obj_directory}/linker_command_file{suffix}.txt"
|
||||
linkerCommandPreprocessVars = {"overlay": f"OVERLAY={overlay}"} if overlay else {}
|
||||
linkerCommandPreprocessVars['psyq_sdk'] = args.psyq_path
|
||||
# First run (LHS)
|
||||
linkerCommandFile = f"../{args.obj_directory}/linker_command_file_{overlay}_lhs.txt"
|
||||
linkerCommandPreprocessVars = {
|
||||
"overlay": f"OVERLAY={overlay}",
|
||||
"overlay_suffix": "OVERLAY_SUFFIX=lhs",
|
||||
"psyq_sdk": args.psyq_path
|
||||
}
|
||||
ninja.build(linkerCommandFile, "linker_command_file_preprocess", f"linker_command_file.txt", variables=linkerCommandPreprocessVars)
|
||||
ninja.newline()
|
||||
|
||||
# run the linker to generate the cpe
|
||||
cpeFile = f"../{args.obj_directory}/_mgsi{suffix}.cpe"
|
||||
ninja.build(cpeFile, "psylink", implicit=linkerDeps + [linkerCommandFile], variables={"suffix": suffix})
|
||||
lhsOverlayFile = f"../{args.obj_directory}/{overlay}_lhs.bin"
|
||||
ninja.build(lhsOverlayFile, "psylink", implicit=linkerDeps + [linkerCommandFile], variables={"suffix": f"_{overlay}_lhs"})
|
||||
ninja.newline()
|
||||
|
||||
if overlay is None:
|
||||
# cpe to exe (only needed for main executable)
|
||||
exeFile = f"../{args.obj_directory}/_mgsi{suffix}.exe"
|
||||
ninja.build(exeFile, "cpe2exe", cpeFile)
|
||||
ninja.newline()
|
||||
# Second run (RHS)
|
||||
linkerCommandFile = f"../{args.obj_directory}/linker_command_file_{overlay}_rhs.txt"
|
||||
linkerCommandPreprocessVars = {
|
||||
"overlay": f"OVERLAY={overlay}",
|
||||
"overlay_suffix": "OVERLAY_SUFFIX=rhs",
|
||||
"psyq_sdk": args.psyq_path
|
||||
}
|
||||
ninja.build(linkerCommandFile, "linker_command_file_preprocess", f"linker_command_file.txt", variables=linkerCommandPreprocessVars)
|
||||
ninja.newline()
|
||||
|
||||
rhsOverlayFile = f"../{args.obj_directory}/{overlay}_rhs.bin"
|
||||
ninja.build(rhsOverlayFile, "psylink_overlay_fopen_patch", implicit=linkerDeps + [linkerCommandFile], variables={"overlay_bin": f"{overlay}_rhs.bin", "overlay_bss_bin": f"{overlay}_rhs_bss.bin", "suffix": f"_{overlay}_rhs"})
|
||||
ninja.newline()
|
||||
|
||||
overlayFile = f"../{args.obj_directory}/{overlay}.bin"
|
||||
ninja.build(overlayFile, "uninitializer", inputs=[lhsOverlayFile, rhsOverlayFile, f"../um/{overlay}.bin"], variables={"overlay": f"{overlay}"})
|
||||
ninja.newline()
|
||||
|
||||
#init_psyq_ini_files(args.psyq_path)
|
||||
gen_build_target("SLPM_862.47")
|
||||
|
@ -359,11 +359,12 @@ def main():
|
||||
# It's not a problem, because it's the same exact executable,
|
||||
# but sometimes, if you are not careful, that won't be the case,
|
||||
# for example if some additional PsyQ functions land in main exe.
|
||||
overlay_main_exe_path = OBJ_EXE.replace("_mgsi.exe", f"_mgsi_{overlay}.cpe")
|
||||
exe_hash = sha256(overlay_main_exe_path)
|
||||
if exe_hash != TARGET_CPE_HASH:
|
||||
fail(f"{overlay_main_exe_path} (something changed in main executable used to build the corresponding overlay)")
|
||||
failed = True
|
||||
for run in ["lhs", "rhs"]:
|
||||
overlay_main_exe_path = OBJ_EXE.replace("_mgsi.exe", f"_mgsi_{overlay}_{run}.cpe")
|
||||
exe_hash = sha256(overlay_main_exe_path)
|
||||
if exe_hash != TARGET_CPE_HASH:
|
||||
fail(f"{overlay_main_exe_path} (something changed in main executable used to build the corresponding overlay)")
|
||||
failed = True
|
||||
|
||||
overlay_hash = sha256(overlay_path)
|
||||
if overlay_hash != overlay_target_hash:
|
||||
|
14
build/create_dummy_file.py
Normal file
14
build/create_dummy_file.py
Normal file
@ -0,0 +1,14 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
import sys
|
||||
|
||||
DUMMY_FILE_SIZE = 1 * 1024 * 1024
|
||||
|
||||
def main(dst):
|
||||
# \x9e is the least frequent byte in s00a.bin
|
||||
# (but any non-zero byte would work)
|
||||
open(dst, 'wb').write(b'\x9e' * DUMMY_FILE_SIZE)
|
||||
|
||||
if __name__ == '__main__':
|
||||
dst = sys.argv[1]
|
||||
main(dst)
|
@ -307,16 +307,21 @@ bss group bss
|
||||
|
||||
{% if OVERLAY %}
|
||||
|
||||
overlay group file("{{OBJ_DIR}}\{{OVERLAY}}.bin")
|
||||
overlay group file("{{OBJ_DIR}}\{{OVERLAY}}_{{OVERLAY_SUFFIX}}.bin")
|
||||
section overlay.data, overlay
|
||||
section overlay.text, overlay
|
||||
section overlay.ctors, overlay
|
||||
section overlay.dtors, overlay
|
||||
section overlay.rdata, overlay
|
||||
section overlay.sdata, overlay
|
||||
{% if OVERLAY_SUFFIX == "lhs" %}
|
||||
section overlay.sbss, overlay
|
||||
section overlay.bss, overlay
|
||||
section overlay.fixme, overlay
|
||||
{% else %}
|
||||
overlay_bss group file("{{OBJ_DIR}}\{{OVERLAY}}_{{OVERLAY_SUFFIX}}_bss.bin")
|
||||
section overlay.sbss, overlay_bss
|
||||
section overlay.bss, overlay_bss
|
||||
{% endif %}
|
||||
|
||||
{% if OVERLAY == "sound" %}
|
||||
include "{{OBJ_DIR}}\overlays\sound\overlay.obj"
|
||||
|
@ -7,7 +7,7 @@ from jinja2 import Environment, FileSystemLoader
|
||||
|
||||
def process_flag(flag):
|
||||
# Either "KEY=VALUE":
|
||||
kv = re.match(r'^([A-Z]+)=(.*)$', flag)
|
||||
kv = re.match(r'^([A-Z_]+)=(.*)$', flag)
|
||||
if kv:
|
||||
return (kv.group(1), kv.group(2))
|
||||
else:
|
||||
|
161
build/uninitializer.py
Normal file
161
build/uninitializer.py
Normal file
@ -0,0 +1,161 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
# Uninitializer has two modes of operation:
|
||||
#
|
||||
# INJECT
|
||||
# ======
|
||||
# In this mode, uninitializer is given 3 inputs:
|
||||
# - LHS overlay: overlay without uninitialized memory
|
||||
# (BSS filled with 0s, gaps in data/rdata filled with 0s)
|
||||
# - RHS overlay: overlay with uninitialized memory
|
||||
# (BSS filled with 0x9e, gaps in data/rdata filled with 0x9e)
|
||||
# - Uninitialized memory template: memory to be injected into
|
||||
# the resulting file. This memory was extracted from original
|
||||
# overlays.
|
||||
#
|
||||
# The program iterates over those three files simultaneously.
|
||||
# If it detects uninitialized byte (byte in LHS = 0, byte in RHS = 0x9e)
|
||||
# it injects a byte from uninitialized memory template.
|
||||
#
|
||||
# EXTRACT
|
||||
# =======
|
||||
# This mode can be used to generate the uninitialized memory
|
||||
# template file. Uninitializer is given 3 inputs:
|
||||
# - LHS overlay
|
||||
# - RHS overlay
|
||||
# - Original overlay file (from MGS)
|
||||
#
|
||||
# The program iterates over those three files, detects uninitialized
|
||||
# bytes and creates the uninitialized memory template file based on
|
||||
# the given original overlay file.
|
||||
#
|
||||
# EXTRACT - example usage
|
||||
# =======================
|
||||
#
|
||||
# BSS
|
||||
# ---
|
||||
#
|
||||
# At the end of overlay.c file you might have such data:
|
||||
# const char s01a_dword_800E4CC8[] = {0x6, 0x11, 'd', 'r'};
|
||||
# const char s01a_dword_800E4CCC[] = {'a', 'w', '_', 'l'};
|
||||
# const char s01a_dword_800E4CD0[] = {'o', 'n', 'g', '_'};
|
||||
#
|
||||
# Once you have determined that this is indeed BSS and not rdata,
|
||||
# you should replace it with:
|
||||
# int SECTION("overlay.bss") s01a_dword_800E4CC8;
|
||||
# int SECTION("overlay.bss") s01a_dword_800E4CCC;
|
||||
# int SECTION("overlay.bss") s01a_dword_800E4CD0;
|
||||
#
|
||||
# Next, see the "Extracting" section below.
|
||||
#
|
||||
# rdata
|
||||
# -----
|
||||
#
|
||||
# Once you have identified all rdata in overlay.c, you might
|
||||
# want to inline some strings to source files. Please remember
|
||||
# that memleaks only happen at file boundaries, so there are
|
||||
# no memleaks between strings in a single file. Apart from that
|
||||
# perform the inlining as usual.
|
||||
#
|
||||
# Extracting
|
||||
# ----------
|
||||
#
|
||||
# Rebuild the project. If there was any uninitialized memory
|
||||
# in variables you modified (as described in sections above),
|
||||
# the build will fail - the uninitialized memory files don't
|
||||
# have the new uninitialized memory. You have to generate it again!
|
||||
# You can do it by executing the following command (replacing s03er):
|
||||
#
|
||||
# python3 ../src/../build/uninitializer.py extract ../obj/s03er_lhs.bin ../obj/s03er_rhs.bin ~/stage/s03er/00e05a.bin ../um/s03er.bin
|
||||
#
|
||||
# If the command succeeds, after rebuilding the project the overlay
|
||||
# should match. If the command fails at any of assertions,
|
||||
# this means that the built overlay differs in more than memleaks
|
||||
# compared to the original overlay - you have to find the difference
|
||||
# manually (comparing lhs file with target file).
|
||||
|
||||
import sys
|
||||
from create_dummy_file import DUMMY_FILE_SIZE
|
||||
import os
|
||||
import string
|
||||
|
||||
def inject(lhs, rhs, uninitialized, out):
|
||||
lhs = open(lhs, 'rb').read()
|
||||
rhs = open(rhs, 'rb').read()
|
||||
|
||||
if os.path.isfile(uninitialized):
|
||||
uninitialized = open(uninitialized, 'rb').read()
|
||||
else:
|
||||
uninitialized = b""
|
||||
uninitialized += b"\x00" * DUMMY_FILE_SIZE
|
||||
|
||||
uninitialized_cur_idx = 0
|
||||
|
||||
assert len(lhs) < DUMMY_FILE_SIZE
|
||||
assert len(lhs) < len(rhs)
|
||||
|
||||
out_arr = bytearray(lhs)
|
||||
|
||||
for i, (lb, rb) in enumerate(zip(lhs, rhs)):
|
||||
if lb == rb:
|
||||
continue
|
||||
|
||||
assert lb == 0 and rb == 0x9e
|
||||
|
||||
# Uninitialized memory!
|
||||
out_arr[i] = uninitialized[uninitialized_cur_idx]
|
||||
uninitialized_cur_idx += 1
|
||||
|
||||
open(out, 'wb').write(bytes(out_arr))
|
||||
|
||||
def extract(lhs, rhs, target, uninitialized_out):
|
||||
lhs = open(lhs, 'rb').read()
|
||||
rhs = open(rhs, 'rb').read()
|
||||
target = open(target, 'rb').read()
|
||||
|
||||
assert len(lhs) < DUMMY_FILE_SIZE
|
||||
assert len(lhs) < len(rhs)
|
||||
assert len(lhs) == len(target)
|
||||
|
||||
uninitialized_out_arr = []
|
||||
nonzero_uninitialized = 0
|
||||
|
||||
for i, (lb, rb, tb) in enumerate(zip(lhs, rhs, target)):
|
||||
if lb == rb and rb == tb:
|
||||
continue
|
||||
|
||||
assert lb == 0 and rb == 0x9e
|
||||
|
||||
# Uninitialized memory!
|
||||
uninitialized_out_arr.append(tb)
|
||||
|
||||
if tb != 0:
|
||||
nonzero_uninitialized += 1
|
||||
|
||||
# Trim trailing zeros
|
||||
while uninitialized_out_arr and uninitialized_out_arr[-1] == 0:
|
||||
uninitialized_out_arr.pop()
|
||||
|
||||
open(uninitialized_out, 'wb').write(bytes(uninitialized_out_arr))
|
||||
|
||||
print("Extracted", len(uninitialized_out_arr), "bytes of uninitialized memory")
|
||||
print(f"({nonzero_uninitialized} non-zero bytes)")
|
||||
print()
|
||||
uninitialized_out_arr = [c for c in uninitialized_out_arr if c in bytes(string.printable, encoding='ascii')]
|
||||
print(bytes(uninitialized_out_arr).decode('ascii'))
|
||||
|
||||
if __name__ == '__main__':
|
||||
if sys.argv[1] == 'inject':
|
||||
lhs = sys.argv[2]
|
||||
rhs = sys.argv[3]
|
||||
uninitialized = sys.argv[4]
|
||||
out = sys.argv[5]
|
||||
inject(lhs, rhs, uninitialized, out)
|
||||
elif sys.argv[1] == 'extract':
|
||||
lhs = sys.argv[2]
|
||||
rhs = sys.argv[3]
|
||||
target = sys.argv[4]
|
||||
uninitialized_out = sys.argv[5]
|
||||
extract(lhs, rhs, target, uninitialized_out)
|
||||
else:
|
||||
print("Unknown mode:", sys.argv[1])
|
@ -929,40 +929,40 @@ const char camera_aCamexcolorb_800D0684[] = "cam_ex_color_b";
|
||||
const char camera_aCamexexorb_800D0694[] = "cam_ex_exor_b";
|
||||
const char camera_aCamerac_800D06A4[] = "camera.c";
|
||||
|
||||
int SECTION("overlay.fixme") camera_dword_800D0700;
|
||||
int SECTION("overlay.fixme") camera_dword_800D0704;
|
||||
int SECTION("overlay.fixme") camera_dword_800D0708;
|
||||
int SECTION("overlay.fixme") camera_dword_800D070C;
|
||||
int SECTION("overlay.fixme") camera_dword_800D0710;
|
||||
int SECTION("overlay.fixme") camera_dword_800D0714;
|
||||
int SECTION("overlay.fixme") camera_dword_800D0718;
|
||||
int SECTION("overlay.fixme") camera_dword_800D071C;
|
||||
int SECTION("overlay.fixme") camera_dword_800D0720;
|
||||
int SECTION("overlay.fixme") camera_dword_800D0724;
|
||||
int SECTION("overlay.fixme") camera_dword_800D0728;
|
||||
int SECTION("overlay.fixme") camera_dword_800D072C;
|
||||
int SECTION("overlay.fixme") camera_dword_800D0730;
|
||||
int SECTION("overlay.fixme") camera_dword_800D0734;
|
||||
int SECTION("overlay.fixme") camera_dword_800D0738;
|
||||
int SECTION("overlay.fixme") camera_dword_800D073C;
|
||||
int SECTION("overlay.fixme") camera_dword_800D0740;
|
||||
int SECTION("overlay.fixme") camera_dword_800D0744;
|
||||
int SECTION("overlay.fixme") camera_dword_800D0748;
|
||||
int SECTION("overlay.fixme") camera_dword_800D074C;
|
||||
int SECTION("overlay.fixme") camera_dword_800D0750;
|
||||
int SECTION("overlay.fixme") camera_dword_800D0754;
|
||||
int SECTION("overlay.fixme") camera_dword_800D0758;
|
||||
int SECTION("overlay.fixme") camera_dword_800D075C;
|
||||
int SECTION("overlay.fixme") camera_dword_800D0760;
|
||||
int SECTION("overlay.fixme") camera_dword_800D0764;
|
||||
int SECTION("overlay.fixme") camera_dword_800D0768;
|
||||
int SECTION("overlay.fixme") camera_dword_800D076C;
|
||||
int SECTION("overlay.fixme") camera_dword_800D0770;
|
||||
int SECTION("overlay.fixme") camera_dword_800D0774;
|
||||
int SECTION("overlay.fixme") camera_dword_800D0778;
|
||||
int SECTION("overlay.fixme") camera_dword_800D077C;
|
||||
int SECTION("overlay.fixme") camera_sprt_800D0780;
|
||||
int SECTION("overlay.fixme") camera_dword_800D0784;
|
||||
int SECTION("overlay.fixme") camera_dword_800D0788;
|
||||
int SECTION("overlay.fixme") camera_dword_800D078C;
|
||||
int SECTION("overlay.fixme") camera_dword_800D0790;
|
||||
int SECTION("overlay.bss") camera_dword_800D0700;
|
||||
int SECTION("overlay.bss") camera_dword_800D0704;
|
||||
int SECTION("overlay.bss") camera_dword_800D0708;
|
||||
int SECTION("overlay.bss") camera_dword_800D070C;
|
||||
int SECTION("overlay.bss") camera_dword_800D0710;
|
||||
int SECTION("overlay.bss") camera_dword_800D0714;
|
||||
int SECTION("overlay.bss") camera_dword_800D0718;
|
||||
int SECTION("overlay.bss") camera_dword_800D071C;
|
||||
int SECTION("overlay.bss") camera_dword_800D0720;
|
||||
int SECTION("overlay.bss") camera_dword_800D0724;
|
||||
int SECTION("overlay.bss") camera_dword_800D0728;
|
||||
int SECTION("overlay.bss") camera_dword_800D072C;
|
||||
int SECTION("overlay.bss") camera_dword_800D0730;
|
||||
int SECTION("overlay.bss") camera_dword_800D0734;
|
||||
int SECTION("overlay.bss") camera_dword_800D0738;
|
||||
int SECTION("overlay.bss") camera_dword_800D073C;
|
||||
int SECTION("overlay.bss") camera_dword_800D0740;
|
||||
int SECTION("overlay.bss") camera_dword_800D0744;
|
||||
int SECTION("overlay.bss") camera_dword_800D0748;
|
||||
int SECTION("overlay.bss") camera_dword_800D074C;
|
||||
int SECTION("overlay.bss") camera_dword_800D0750;
|
||||
int SECTION("overlay.bss") camera_dword_800D0754;
|
||||
int SECTION("overlay.bss") camera_dword_800D0758;
|
||||
int SECTION("overlay.bss") camera_dword_800D075C;
|
||||
int SECTION("overlay.bss") camera_dword_800D0760;
|
||||
int SECTION("overlay.bss") camera_dword_800D0764;
|
||||
int SECTION("overlay.bss") camera_dword_800D0768;
|
||||
int SECTION("overlay.bss") camera_dword_800D076C;
|
||||
int SECTION("overlay.bss") camera_dword_800D0770;
|
||||
int SECTION("overlay.bss") camera_dword_800D0774;
|
||||
int SECTION("overlay.bss") camera_dword_800D0778;
|
||||
int SECTION("overlay.bss") camera_dword_800D077C;
|
||||
int SECTION("overlay.bss") camera_sprt_800D0780;
|
||||
int SECTION("overlay.bss") camera_dword_800D0784;
|
||||
int SECTION("overlay.bss") camera_dword_800D0788;
|
||||
int SECTION("overlay.bss") camera_dword_800D078C;
|
||||
int SECTION("overlay.bss") camera_dword_800D0790;
|
||||
|
@ -17,8 +17,6 @@ typedef struct CameraShakeWork
|
||||
extern int THING_Gcl_GetInt( int o );
|
||||
extern int THING_Gcl_GetSVector( int o, SVECTOR* svec );
|
||||
|
||||
extern const char aCamshakeC[];
|
||||
|
||||
extern SVECTOR GM_PlayerPosition_800ABA10;
|
||||
extern int GM_CameraShakeOffset_800ABA98;
|
||||
|
||||
@ -85,7 +83,7 @@ void *NewCameraShake_800DF6AC( int name, int where, int argc, char **argv )
|
||||
|
||||
work = (CameraShakeWork *)GV_NewActor_800150E4( 5, sizeof( CameraShakeWork ) ) ;
|
||||
if ( work != NULL ) {
|
||||
GV_SetNamedActor_8001514C( &( work->actor ), ( TActorFunction )CameraShakeAct_800DF4B8, ( TActorFunction )CameraShakeDie_800DF634, aCamshakeC );
|
||||
GV_SetNamedActor_8001514C( &( work->actor ), ( TActorFunction )CameraShakeAct_800DF4B8, ( TActorFunction )CameraShakeDie_800DF634, "camshake.c" );
|
||||
if ( CameraShakeGetResources_S_800DF63C( work, name, where ) < 0 )
|
||||
{
|
||||
GV_DestroyActor_800151C8( &( work->actor ) );
|
||||
|
@ -1,5 +1,6 @@
|
||||
#include "Game/game.h"
|
||||
#include "libgv/libgv.h"
|
||||
#include "libgcl/hash.h"
|
||||
|
||||
typedef struct ZoomCameraWork
|
||||
{
|
||||
@ -22,8 +23,7 @@ typedef struct _ZoomWork
|
||||
int proc;
|
||||
} ZoomWork;
|
||||
|
||||
extern unsigned short cat_in_mes_list[];
|
||||
extern const char aCatinC[];
|
||||
unsigned short cat_in_mes_list[] = { HASH_KILL };
|
||||
|
||||
extern int GM_GameStatus_800AB3CC;
|
||||
extern OBJECT *GM_PlayerBody_800ABA20;
|
||||
@ -144,7 +144,7 @@ int NewZoomCamera_800DF9BC( ZoomWork *work, int name, int where )
|
||||
return -1;
|
||||
}
|
||||
|
||||
GV_SetNamedActor_8001514C( &( cam->actor ), (TActorFunction)ZoomCameraAct_800DF740, (TActorFunction)ZoomCameraDie_800DF80C, aCatinC );
|
||||
GV_SetNamedActor_8001514C( &( cam->actor ), (TActorFunction)ZoomCameraAct_800DF740, (TActorFunction)ZoomCameraDie_800DF80C, "cat_in.c" );
|
||||
|
||||
ZoomCameraGetResources_800DF81C( cam, name, where );
|
||||
cam->timer = &work->timer;
|
||||
@ -162,7 +162,7 @@ void *NewZoom_800DFA88( int name, int where )
|
||||
work = (ZoomWork *)GV_NewActor_800150E4( EXEC_LEVEL2, sizeof( ZoomWork ) );
|
||||
if (work != NULL)
|
||||
{
|
||||
GV_SetNamedActor_8001514C( &( work->actor ), (TActorFunction)ZoomAct_800DF89C, (TActorFunction)ZoomDie_800DF910, aCatinC );
|
||||
GV_SetNamedActor_8001514C( &( work->actor ), (TActorFunction)ZoomAct_800DF89C, (TActorFunction)ZoomDie_800DF910, "cat_in.c" );
|
||||
|
||||
if ( NewZoomCamera_800DF9BC( work, name, where ) < 0 )
|
||||
{
|
||||
|
@ -1,10 +1,3 @@
|
||||
#include "libgcl/hash.h"
|
||||
|
||||
unsigned short mes_list_800C3688[] = { 0xBA27, 0x560E };
|
||||
|
||||
// Takabe/camshake.c
|
||||
const char aCamshakeC[] = "camshake.c";
|
||||
|
||||
// Takabe/cat_in.c
|
||||
unsigned short cat_in_mes_list[] = { HASH_KILL, /* memleak */ 0x0200 /* memleak */ };
|
||||
const char aCatinC[] = "cat_in.c\x00\x04";
|
||||
|
@ -1,5 +1,7 @@
|
||||
#include "libdg/libdg.h"
|
||||
|
||||
// Warning: cat_in.c contains both BSS and rdata
|
||||
|
||||
// BSS which can't actually be declared as BSS due to memleaks
|
||||
|
||||
const char s00a_dword_800E0C9C[] = {0x0, 0x0, '#', '('};
|
||||
|
@ -306,7 +306,6 @@ typedef struct LitMdlWork
|
||||
int field_584;
|
||||
} LitMdlWork;
|
||||
|
||||
extern char aLitmdlC[];
|
||||
extern DG_DEF litmdl_dg_def; // with 1 DG_MDL
|
||||
extern MATRIX DG_ZeroMatrix_8009D430;
|
||||
extern SVECTOR DG_ZeroVector_800AB39C;
|
||||
@ -363,7 +362,7 @@ GV_ACT *s01a_lit_mdl_800E2C88(int arg0, int arg1, int arg2, int arg3)
|
||||
if (work != NULL)
|
||||
{
|
||||
GV_SetNamedActor_8001514C(&work->actor, (TActorFunction)s01a_lit_mdl_800E2928,
|
||||
(TActorFunction)s01a_lit_mdl_800E2ABC, aLitmdlC);
|
||||
(TActorFunction)s01a_lit_mdl_800E2ABC, "lit_mdl.c");
|
||||
if (s01a_lit_mdl_800E2ADC(work, arg0, arg1, arg2, arg3) < 0)
|
||||
{
|
||||
GV_DestroyActor_800151C8(&work->actor);
|
||||
|
@ -420,9 +420,6 @@ DG_DEF litmdl_dg_def =
|
||||
}
|
||||
};
|
||||
|
||||
// Takabe/cat_in.c
|
||||
unsigned short cat_in_mes_list[] = { HASH_KILL, /* memleak */ 0x10C3 /* memleak */ };
|
||||
|
||||
const char aCancelC[] = {'c', 'a', 'n', 'c', 'e', 'l', '.', 'c', 0x0, 'D', 'G', '_'};
|
||||
|
||||
const char aTobcntTitle[] = "title";
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -96,9 +96,6 @@ unsigned short fadeio_msgs[] = {HASH_KILL, 0x71F1};
|
||||
// Takabe/cinema.c
|
||||
unsigned short mes_list_800C3680[] = { 0xD420, 0x745D };
|
||||
|
||||
// Takabe/cat_in.c
|
||||
unsigned short cat_in_mes_list[] = { HASH_KILL, 0x0000 };
|
||||
|
||||
const char s03e_dword_800CBE84[] = {0xe0, 0xff, 0xbd, '\''};
|
||||
const char s03e_dword_800CBE88[] = {0x14, 0x0, 0xb1, 0xaf};
|
||||
const char s03e_dword_800CBE8C[] = {'!', 0x88, 0x80, 0x0};
|
||||
@ -582,8 +579,5 @@ const char aSpark2C[] = {'s', 'p', 'a', 'r', 'k', '2', '.', 'c', 0x0, 0x81, 'J',
|
||||
const char aFadeioC[] = {'f', 'a', 'd', 'e', 'i', 'o', '.', 'c', 0x0, 0x90, 0x1, 0x90};
|
||||
const char aCinemaC[] = {'c', 'i', 'n', 'e', 'm', 'a', '.', 'c', 0x0, 0x90, 0x1, 0x90};
|
||||
|
||||
// Takabe/cat_in.c
|
||||
const char aCatinC[] = {'c', 'a', 't', '_', 'i', 'n', '.', 'c', 0x0, 0x90, 0x89, 0x90};
|
||||
|
||||
void * const s03e_dword_800CC6B8 = NULL;
|
||||
const char s03e_dword_800CC6BC[] = {0xe5, 0x96, 0xe6, 0x96};
|
||||
void SECTION("overlay.bss") *s03e_dword_800CC6B8;
|
||||
int SECTION("overlay.bss") s03e_dword_800CC6BC;
|
||||
|
@ -96,9 +96,6 @@ unsigned short fadeio_msgs[] = {HASH_KILL, 0x71F1};
|
||||
// Takabe/cinema.c
|
||||
unsigned short mes_list_800C3680[] = { 0xD420, 0x745D };
|
||||
|
||||
// Takabe/cat_in.c
|
||||
unsigned short cat_in_mes_list[] = { HASH_KILL, 0x0000 };
|
||||
|
||||
const char s03e_dword_800CBE84[] = {0xe0, 0xff, 0xbd, '\''};
|
||||
const char s03e_dword_800CBE88[] = {0x14, 0x0, 0xb1, 0xaf};
|
||||
const char s03e_dword_800CBE8C[] = {'!', 0x88, 0x80, 0x0};
|
||||
@ -582,8 +579,6 @@ const char aSpark2C[] = {'s', 'p', 'a', 'r', 'k', '2', '.', 'c', 0x0, 'a', 'd',
|
||||
const char aFadeioC[] = {'f', 'a', 'd', 'e', 'i', 'o', '.', 'c', 0x0, '8', '0', '0'};
|
||||
const char aCinemaC[] = {'c', 'i', 'n', 'e', 'm', 'a', '.', 'c', 0x0, '_', 'L', 'o'};
|
||||
|
||||
// Takabe/cat_in.c
|
||||
const char aCatinC[] = {'c', 'a', 't', '_', 'i', 'n', '.', 'c', 0x0, 0xd, '\n', ' '};
|
||||
|
||||
const char s03e_dword_800CC6B8[] = {0x0, 0x0, 0x0, 0x0};
|
||||
const char s03e_dword_800CC6BC[] = {'F', '6', '1','0'};
|
||||
void SECTION("overlay.bss") *s03e_dword_800CC6B8;
|
||||
int SECTION("overlay.bss") s03e_dword_800CC6BC;
|
||||
|
0
um/camera.bin
Normal file
0
um/camera.bin
Normal file
0
um/change.bin
Normal file
0
um/change.bin
Normal file
0
um/d03a.bin
Normal file
0
um/d03a.bin
Normal file
0
um/d11c.bin
Normal file
0
um/d11c.bin
Normal file
BIN
um/s00a.bin
Normal file
BIN
um/s00a.bin
Normal file
Binary file not shown.
BIN
um/s01a.bin
Normal file
BIN
um/s01a.bin
Normal file
Binary file not shown.
BIN
um/s03e.bin
Normal file
BIN
um/s03e.bin
Normal file
Binary file not shown.
BIN
um/s03er.bin
Normal file
BIN
um/s03er.bin
Normal file
Binary file not shown.
0
um/s16b.bin
Normal file
0
um/s16b.bin
Normal file
0
um/select.bin
Normal file
0
um/select.bin
Normal file
0
um/select1.bin
Normal file
0
um/select1.bin
Normal file
0
um/select2.bin
Normal file
0
um/select2.bin
Normal file
0
um/select3.bin
Normal file
0
um/select3.bin
Normal file
0
um/select4.bin
Normal file
0
um/select4.bin
Normal file
0
um/selectd.bin
Normal file
0
um/selectd.bin
Normal file
0
um/sound.bin
Normal file
0
um/sound.bin
Normal file
0
um/title.bin
Normal file
0
um/title.bin
Normal file
Loading…
Reference in New Issue
Block a user