Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

An error occurred while dumping 'Resident Evil 2 - beta2 (Japan)' #2

Open
yanmingsohu opened this issue Mar 30, 2020 · 4 comments
Open

Comments

@yanmingsohu
Copy link

  1. "unsupport for symbol type *sym.EndSLD not yet implemented"
  2. "unable to locate overlay with ID 0"
@mewmew
Copy link
Collaborator

mewmew commented Mar 31, 2020

Hi @yanmingsohu

Happy to hear you are looking into gaining a better understanding of how Resident Evil 2 is implemented. The issue you are running into is similar to the one reported in #1, and stems from sym_dump not having complete support for every concept of the SYM file format.

I'd be glad to take a look and see if there is an easy fix, but to do so, I would need access to the SYM file to be able to reproduce the issue. Would you be able to provide a copy of the SYM file?

Cheers,
Robin

@yanmingsohu
Copy link
Author

ok, this is
bio2-ps1-beta2.zip

mewmew added a commit that referenced this issue Mar 31, 2020
The size of the overlay is set to the size in bytes of PSX.EXE, and the
address is set to 0x0 for now. Both of these values are guesses, and
those with more insight into the Bio2 project are encouraged to double
check these values.

Note, we add overlay 0 explicitly as the MAIN.SYM file does not contain
an Overlay symbol to describe overlay ID 0.

Updates #2.
@mewmew
Copy link
Collaborator

mewmew commented Mar 31, 2020

Hi @yanmingsohu!

Thanks for uploading the SYM file to reproduce this issue.

I've now updated sym_dump to handle symbol EndSLD without matching SetSLD (see 3c6f48e).

To be able to recreate the C headers, I had to add a few hacks (see e8d0237). These are now in the bio2 branch. Even if the implementation isn't perfect, hope it may help get some insight. Feel free to suggest improvements!

$ sym_dump -c -src MAIN.SYM
creating: _dump_/types.h
creating: _dump_/bio2/prog/cd.c
creating: _dump_/bio2/prog/config.c
creating: _dump_/bio2/prog/db_menu.c
creating: _dump_/bio2/prog/diedemo.c
creating: _dump_/bio2/prog/diespr.c
creating: _dump_/bio2/prog/door.c
creating: _dump_/bio2/prog/em2a.c
creating: _dump_/bio2/prog/em2a_sub.c
creating: _dump_/bio2/prog/em2b.c
creating: _dump_/bio2/prog/em2b_sub.c
creating: _dump_/bio2/prog/em2c.c
creating: _dump_/bio2/prog/em2d.c
creating: _dump_/bio2/prog/em2e.c
creating: _dump_/bio2/prog/em2f.c
creating: _dump_/bio2/prog/em3a.c
creating: _dump_/bio2/prog/em3b.c
creating: _dump_/bio2/prog/em3e.c
creating: _dump_/bio2/prog/em3f.c
creating: _dump_/bio2/prog/em10.c
creating: _dump_/bio2/prog/em10_s0.c
creating: _dump_/bio2/prog/em20.c
creating: _dump_/bio2/prog/em21.c
creating: _dump_/bio2/prog/em22.c
creating: _dump_/bio2/prog/em22_sub.c
creating: _dump_/bio2/prog/em23.c
creating: _dump_/bio2/prog/em25.c
creating: _dump_/bio2/prog/em25_s0.c
creating: _dump_/bio2/prog/em26.c
creating: _dump_/bio2/prog/em27.c
creating: _dump_/bio2/prog/em28.c
creating: _dump_/bio2/prog/em29.c
creating: _dump_/bio2/prog/em30.c
creating: _dump_/bio2/prog/em31.c
creating: _dump_/bio2/prog/em33.c
creating: _dump_/bio2/prog/em34.c
creating: _dump_/bio2/prog/em36.c
creating: _dump_/bio2/prog/em37.c
creating: _dump_/bio2/prog/em38.c
creating: _dump_/bio2/prog/em_set.c
creating: _dump_/bio2/prog/em_sub.c
creating: _dump_/bio2/prog/em_sub2.c
creating: _dump_/bio2/prog/ending.c
creating: _dump_/bio2/prog/esp.c
creating: _dump_/bio2/prog/esp_r.c
creating: _dump_/bio2/prog/game.c
creating: _dump_/bio2/prog/joint.c
creating: _dump_/bio2/prog/line_scr.c
creating: _dump_/bio2/prog/main.c
creating: _dump_/bio2/prog/md_sub.c
creating: _dump_/bio2/prog/mem_card.c
creating: _dump_/bio2/prog/mizu_sys.c
creating: _dump_/bio2/prog/mojidisp.c
creating: _dump_/bio2/prog/monitor.c
creating: _dump_/bio2/prog/movie.c
creating: _dump_/bio2/prog/oba.c
creating: _dump_/bio2/prog/om.c
creating: _dump_/bio2/prog/oma.c
creating: _dump_/bio2/prog/pad.c
creating: _dump_/bio2/prog/pc_event.c
creating: _dump_/bio2/prog/pc_sys.c
creating: _dump_/bio2/prog/player.c
creating: _dump_/bio2/prog/pl_wep.c
creating: _dump_/bio2/prog/pl_wep2.c
creating: _dump_/bio2/prog/poly_sub.c
creating: _dump_/bio2/prog/psp.c
creating: _dump_/bio2/prog/room.c
creating: _dump_/bio2/prog/root_ck.c
creating: _dump_/bio2/prog/sabun.c
creating: _dump_/bio2/prog/sca.c
creating: _dump_/bio2/prog/sce0.c
creating: _dump_/bio2/prog/sce1.c
creating: _dump_/bio2/prog/sce2.c
creating: _dump_/bio2/prog/sce_at.c
creating: _dump_/bio2/prog/snd.c
creating: _dump_/bio2/prog/spl.c
creating: _dump_/bio2/prog/spl_auto.c
creating: _dump_/bio2/prog/spl_sce.c
creating: _dump_/bio2/prog/spl_sp.c
creating: _dump_/bio2/prog/stage1.c
creating: _dump_/bio2/prog/stage2.c
creating: _dump_/bio2/prog/stage3.c
creating: _dump_/bio2/prog/stage4.c
creating: _dump_/bio2/prog/stage5.c
creating: _dump_/bio2/prog/stage6.c
creating: _dump_/bio2/prog/stage7.c
creating: _dump_/bio2/prog/status.c
creating: _dump_/bio2/prog/st_sub00.c
creating: _dump_/bio2/prog/st_sub01.c
creating: _dump_/bio2/prog/st_sub02.c
creating: _dump_/bio2/prog/st_sub04.c
creating: _dump_/bio2/prog/sub.c
creating: _dump_/bio2/prog/title.c
creating: _dump_/bio2/prog/trans.c
creating: _dump_/bio2/prog/t_atview.c
creating: _dump_/bio2/prog/t_block.c
creating: _dump_/bio2/prog/t_em_set.c
creating: _dump_/bio2/prog/t_esp.c
creating: _dump_/bio2/prog/t_floor.c
creating: _dump_/bio2/prog/t_kat0.c
creating: _dump_/bio2/prog/t_light.c
creating: _dump_/bio2/prog/t_psp.c
creating: _dump_/bio2/prog/t_rview.c
creating: _dump_/bio2/prog/t_sca.c
creating: _dump_/bio2/prog/t_sce_at.c
creating: _dump_/bio2/prog/t_snd.c
...
$ sym_dump -ida MAIN.SYM
creating: _dump_/make_psx.py
creating: _dump_/set_funcs.py
creating: _dump_/set_vars.py
creating: _dump_/make_psx.py
creating: _dump_/set_funcs.py
creating: _dump_/set_vars.py
creating: _dump_/overlay_4/make_psx.py
creating: _dump_/overlay_4/set_funcs.py
creating: _dump_/overlay_4/set_vars.py
...

Note, you need to change Git branch to the bio2 branch. Do so by running the following commands.

$ go get -u github.com/sanctuary/sym
$ cd $GOPATH/src/github.com/sanctuary/sym
$ git checkout bio2
Branch 'bio2' set up to track remote branch 'bio2' from 'origin'.
Switched to a new branch 'bio2'
$ go get github.com/sanctuary/sym/cmd/sym_dump

Extract C headers.

$ $GOPATH/bin/sym_dump -c -src MAIN.SYM
creating: _dump_/types.h
creating: _dump_/bio2/prog/cd.c
creating: _dump_/bio2/prog/config.c
creating: _dump_/bio2/prog/db_menu.c
...

Create IDA Python scripts.

$ $GOPATH/bin/sym_dump -ida MAIN.SYM
creating: _dump_/make_psx.py
creating: _dump_/set_funcs.py
creating: _dump_/set_vars.py
creating: _dump_/make_psx.py
creating: _dump_/set_funcs.py
creating: _dump_/set_vars.py
creating: _dump_/overlay_4/make_psx.py
creating: _dump_/overlay_4/set_funcs.py
creating: _dump_/overlay_4/set_vars.py
...

Hope that helps!

Cheers,
Robin

@yanmingsohu
Copy link
Author

It is so CoOL!
Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants