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

disassembly to show strings as is (rather than hex)? #5

Open
gingerbeardman opened this issue Jul 12, 2017 · 2 comments
Open

disassembly to show strings as is (rather than hex)? #5

gingerbeardman opened this issue Jul 12, 2017 · 2 comments

Comments

@gingerbeardman
Copy link

gingerbeardman commented Jul 12, 2017

edit: I see this is already on your roadmap

I'm not familiar enough with GG or Z80, but could the disassembler present (some) data as strings?

at the end of Magical Puzzle Popils.gg there are a bunch of English strings, and some elsewhere. Would be great if these could be displayed as is. Even better if it could display the Japanese text, but that seems to use an encoding I'm not familar with.

@gingerbeardman gingerbeardman changed the title disassembly disassembly to show strings as is (rather than hex)? Jul 12, 2017
@earwig
Copy link
Owner

earwig commented Jul 12, 2017

Yeah, disassembler's kinda useless at the moment and shouldn't be expected to do anything interesting yet. Telling the difference between code and data is really the "hard" problem here. I don't know how to do it other than a combination of heuristics ("these look like instructions" vs. "this looks like ascii" or "this has a pattern that looks like game data"), trying to trace through the code to see what gets executed (though, see halting problem), and using spatial locality to figure that data is likely next to other data and code is likely next to other code. But that's so error-prone.

@gingerbeardman
Copy link
Author

gingerbeardman commented Jul 12, 2017

The way I've seen it done in the past is to allow the user to give hints to the disassembler by marking addresses/ranges as known code/data (either through a GUI or special files containing symbols, blocks, labels, etc). After that, you could use code path analysis of some sort to infer/prove other things from the hints.

Maybe modern tools can help out not have to reinvent the wheel here?

For example, z80dasm does this:

z80dasm has several features that can improve the readability of generated assembly code. It can guess locations of labels in the code from jumps and similar instructions. You can supply it with a symbol file and z80dasm will use label names from there instead of automatically generated ones. If you define code and data sections for a binary z80dasm can also use this information to produce a nicer disassembly.

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