Closed smooker closed 5 years ago
(Apologies for the late reply, I was on an extended vacation, and then catching up from vacation.)
There's not a lot of information for me to go on here (specifically, you didn't say anything about the ROM you're working with, like where it came from, what memory layout it's using, etc), which means I can't really give you any concrete help.
The error you're getting is intentional, although I'll admit it's somewhat obtuse; your ROM (in the interrupt vector table, from the looks of things) is referencing an address that's not in one of the defined address space segments. (Think "illegal memory access" errors in typical programming, and you have the right idea.) It's there as a check to make sure the disassembler is doing the right thing; if you start accessing memory in places it shouldn't be, it's a good bet that something has gone horribly wrong.
My best guess is that the ROM you're disassembling either is in a different format than sh2dis is expecting, or needs a different segment map defined for it. If it's the former, there's probably not much I can do; you'd need someone with more expertise with your particular ROM format to weigh in here (is it a single flat segment or split into multiple sections? where is the interrupt table? where are the registers? where is the RAM? etc).
If it's a question of the segment map being incorrect for your ROM, I've added basic maps for the SH7052 and SH7055 platforms, but every vendor will likely do something different here, based on flash/RAM they've added to the board. See get_segments
in __main__.py
to get an idea of the really rudimentary logic I used to switch between the two; you'll want to add a heuristic there to identify your ROM and lay out the memory space appropriately.
If you don't know what your platform's memory space looks like (which wouldn't be surprising, if you're reverse-engineering it from scratch), one easy thing to try would be to add an appropriately-sized ROM segment, ditch the register segment (REG) entirely, and expand the RAM segment out to 0xFFFFFFFF
(the maximum). (You might have to define a dummy REG segment at some ridiculous location to make things happy, it's been a while since I needed to play with this.)
And, if none of this made any sense, I'm going to go out on a limb and say you're probably not going to get anywhere with sh2dis, and might want to look into something else (like IDA Pro).
Anyway, I'm going to close this, since this sh2dis is actually working as intended here. Best of luck!