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

support for symbol kind 0x05 not yet implemented #1

Open
Nightshades1 opened this issue Oct 18, 2018 · 6 comments
Open

support for symbol kind 0x05 not yet implemented #1

Nightshades1 opened this issue Oct 18, 2018 · 6 comments

Comments

@Nightshades1
Copy link

MAIN.zip
TR5 Symbols.

mewmew added a commit that referenced this issue Oct 18, 2018
Now capable of parsing MAIN.SYM (from Tomb5).

Updates #1.
@mewmew
Copy link
Collaborator

mewmew commented Oct 18, 2018

Hi @Nightshades1,

Thanks for the notice.

I've now updated sym_dump to handle symbol kinds 0x05 and 0x06. As of rev c2001ca it can parse MAIN.SYM in the same way as DYMPSYM.EXE of PsyQ.

To be able to recreate the C headers, I had to add a few hacks. These are now in the tomb5 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
2018/10/18 22:34:02 unable to locate function "PCread"
2018/10/18 22:34:02 unable to locate function "PCwrite"
2018/10/18 22:34:02 unable to locate function "__sn_cpp_structors"
creating: _dump_/types.h
creating: _dump_/projects2/tomb5/game/box.c
creating: _dump_/projects2/tomb5/game/camera.c
creating: _dump_/projects2/tomb5/game/collide.c
creating: _dump_/projects2/tomb5/game/control.c
creating: _dump_/projects2/tomb5/game/debris.c
creating: _dump_/projects2/tomb5/game/delstuff.c
creating: _dump_/projects2/tomb5/game/deltapak.c
creating: _dump_/projects2/tomb5/game/door.c
creating: _dump_/projects2/tomb5/game/draw.c
creating: _dump_/projects2/tomb5/game/effect2.c
creating: _dump_/projects2/tomb5/game/effects.c
creating: _dump_/projects2/tomb5/game/flmtorch.c
creating: _dump_/projects2/tomb5/game/gameflow.c
creating: _dump_/projects2/tomb5/game/hair.c
creating: _dump_/projects2/tomb5/game/health.c
creating: _dump_/projects2/tomb5/game/items.c
creating: _dump_/projects2/tomb5/game/lara.c
creating: _dump_/projects2/tomb5/game/lara1gun.c
creating: _dump_/projects2/tomb5/game/lara2gun.c
creating: _dump_/projects2/tomb5/game/laraclmb.c
creating: _dump_/projects2/tomb5/game/larafire.c
...
$ sym_dump -ida MAIN.SYM
2018/10/18 22:35:26 unable to locate function "PCread"
2018/10/18 22:35:26 unable to locate function "PCwrite"
2018/10/18 22:35:26 unable to locate function "__sn_cpp_structors"
creating: _dump_/make_psx.py
creating: _dump_/set_funcs.py
creating: _dump_/set_vars.py
creating: _dump_/types.h

@Nightshades1
Copy link
Author

Hi @mewmew Mew Mooooooo ! :) Thank you for your support, i'm having issue again (is it normal ?) I re-downloaded it with go get -u github.com/sanctuary/sym/cmd/sym_dump then i went on github, downloaded as ZIP (tomb5 branch) extracted in go\src\github.com\sanctuary\sym to get the updated changes.

Then i went to cmd\sym_dump
go build
go install

I go in my directory where the .SYM is, Left shift+Right click -> Open new console here, sym_dump.exe -c -src MAIN.SYM.

I get that:
image

@Nightshades1
Copy link
Author

Nightshades1 commented Oct 19, 2018

Tbh I don't even know why sony haven't still provided a real debugger for the psx (debug without the real hardware) plus the original parser/dissector that should rebuild most of the game code, i'm sure those guys have something like this, same for .CPE file, sony making the playstation classic oh god ...

Also is .MAP file supported ? it's always nice to get a nice listing in IDA.

@mewmew
Copy link
Collaborator

mewmew commented Oct 19, 2018

Hi @Nightshades1,

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

$ go get -u github.com/sanctuary/sym
$ cd $GOPATH/src/github.com/sanctuary/sym
$ git checkout tomb5
Branch 'tomb5' set up to track remote branch 'tomb5' from 'origin'.
Switched to a new branch 'tomb5'
$ 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_/projects2/tomb5/game/box.c
creating: _dump_/projects2/tomb5/game/camera.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_/types.h

Hope that helps!

Cheers,
-- Mew Moo!

@Nightshades1
Copy link
Author

Nightshades1 commented Oct 20, 2018

Ok this worked fine however certain function name aren't here, look's like your parser did skip or maybe you haven't implemented everything yet =P.

From the .MAP file of the game, 0007F9C0 WANK3 in IDA this result it as being sub_7F9C0 =p.

Lot of functions name were set that's great though, hope that you can make it close to perfection later haha.

@galaxyhaxz
Copy link
Collaborator

It seems this issue (and probably for Resident Evil as well) are caused by unimplemented class types. Could this perhaps be easily implemented by looking at the official code?

Class 103 (0x67) should be of type FILE which I've also seen in other games. It references an object file.

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

3 participants