logic / sh2dis

An SH2-compatible (Renesas SuperH) disassembler.
http://code.logic.net/sh2dis/
23 stars 4 forks source link

When trying disassembling this error pops out #7

Open Gabryx64 opened 3 years ago

Gabryx64 commented 3 years ago

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

logic commented 3 years ago

So this looks like two problems.

FIrst, you should have seen an "invalid or unrecognized ROM" error when this happened; I fixed that in 077d833c2900d4249e447fe608f064422eb4af82, 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.