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

When trying disassembling this error pops out #7

Open
Gabryx64 opened this issue Jan 19, 2021 · 1 comment
Open

When trying disassembling this error pops out #7

Gabryx64 opened this issue Jan 19, 2021 · 1 comment

Comments

@Gabryx64
Copy link

When I try to disassemble something this is what I got from sh2dis:
Traceback (most recent call last):
File "C:\Python27\Scripts\sh2dis-script.py", line 11, in
load_entry_point('sh2dis==1.0', 'console_scripts', 'sh2dis')()
File "build\bdist.win-amd64\egg\sh2dis_main_.py", line 161, in main
File "build\bdist.win-amd64\egg\sh2dis_main_.py", line 32, in get_segments

@Gabryx64 Gabryx64 reopened this Jan 19, 2021
@logic
Copy link
Owner

logic commented Jan 19, 2021

So this looks like two problems.

FIrst, you should have seen an "invalid or unrecognized ROM" error when this happened; I fixed that in 077d833, so you should get a slightly more reasonable error message now.

The main problem, though, is the ROM you're working with appears to be unrecognized.

Right now, sh2dis only knows how to automatically lay out the segments for either an SH7052 or an SH7055 from the Mitsubishi Evo line of ECUs. Since you didn't specify any information about the ROM you were trying to decode, I'll have to assume it isn't one of those; in that case, you'll likely need to add support for it to get_segments in __main__.py. You'll need to know the memory model that your particular use case uses, specifically the size of the ROM image, the size and position of RAM, and the position of the registers.

If your target is another processor entirely (ie. neither sh7052 or sh7055), you'll need to add that as well (see sh2dis/sh7052.py and sh2dis/sh7055.py, as well as the integration in sh2dis/__main__.py and sh2dis/__init__.py). If there are additional opcodes that the processor adds, you can add them to sh2dis/sh2opcodes.py.

If you can share a copy of the ROM you're working with somewhere, and a little more information about where it came from (a device? an ECU? what model? etc), I could probably tell you a bit more.

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