Disassembler
Using Resource under WinUAE, gets somewhat frustrating. I've been meaning to write my own disassembler for years, and finally got around to it. It's easier than I expected, but like any programming project there's so much that needs to be done.
It currently just loads and does raw disassembly of an Amiga executable. Still need to get "labels" working, follow branches to determine what to actually disassemble and what is data. Etc. http://i.imgur.com/diFkq.png |
Nice work, copse! :bowdown
|
Hi copse,
why do you want to reinvent the wheel again? Matthew Hey (alias matthey http://eab.abime.net/member.php?u=16145 ) is also already working on an improved version of ADis. Maybe, you could get in contact with him and work together. http://www.heywheel.com/matthey/Amiga/ADis.lha http://www.heywheel.com/matthey/Amiga/programming.html |
Quote:
My word! Next you will be asking why I would use goto when everyone knows it shouldn't be used :) |
Ok, I can understand your point of view that you prefer to learn writing a disassembler from scratch rather than fighting with other programmers concepts.
But, I guess you won't have to accept all the flaws of the current ADis as far as there are any in Matt's disassembler project. He has excellent knowledge about the 68k instructions and he has always an open mind for discussing things. So, don't hesitate to get in contact with him if he won't reply in this thread anyway sooner or later. I'm sure, he will welcome all your suggestions for improving the ADis disassembler. (Just don't know if he would rename the BRA or JMP instructions into a GOTO cammand ? :D |
There's also http://eab.abime.net/showthread.php?t=51527
|
Quote:
The licensing situation is unclear, as it is inherited code. When I say unclear, I mean it is important to me to be able to look at the license for it, and understand the repercussions. "It should be OK" is not good enough. Also, I find the source code arcane and incomprehensible as to why it does what it does. I understand Matt inherited the code, so I in no way wish to assign the blame for this to him. |
Quote:
Not sure how I missed that in "Today's Posts". |
Quote:
Quote:
|
Ah, it was late and I was confused. When looking at existing disassemblers I looked at GNU binutils, AsmPro, WinUAE, IRA and ADis. ADis was probably the best, but to me its licensing situation was unclear. A clear licensing situation to me, is where it has MIT, GPL, BSD or a similar reliable license accompanying source releases. It might be sufficient for you to accept someone saying it is open source, with no restrictions, but unless that's provably in writing in all relevant source releases, I can only take it as hearsay.
But in the end, I think it is best to start from scratch. Having now written a disassembler, I have something I understand 100%. |
Quote:
Quote:
|
Lots more work on this. If anyone has any pointers with regard to the relocation information I want, I'd appreciate it.
I've handled the HUNK_RELOC32, HUNK_DREL32 and HUNK_RELOC32SHORT relocations, but nothing else. I've also looked at a lot of code that parses hunks, and documentation that deals with hunks, and I've been unable to find clear information on hunk types like HUNK_RELOC8. Anyone got any solid leads on these? One piece of code just handled them the same as HUNK_RELOC32, but I believe that is wrong. The UI toolkit I am using is starting to get in the way. On the plus side, the display is virtually generated, so there's no huge buffer that the user scrolls through. But there's no way do Resource-style markup, like inverting symbols that are in other hunks. My symbol/label handling is the only existing code that I am unhappy with. It looks okay, but it is superficially done. Resource does it a lot more intelligently. http://i.imgur.com/BTMFS.png |
RELOC16/8 are linker object only, can't be used in executables.
There is also RELRELOC32 which is supported by AOS (afaik v39+ only) but it has buggy implementation which makes it totally useless. (Relative to relocation address instead of relative to beginning of hunk) Check AROS rom/dos/internalloadseg_aos.c |
This is a pretty good hunk reference on Aminet:
http://aminet.net/docs/misc/abfs.lha An online hunk reference with some info not found elsewhere: http://amiga-dev.wikidot.com/file-format:hunk |
Quote:
I'd be curious to know why anyone would use HUNK_ABSRELOC16. |
Quote:
EXT_ABSREF16 references occur often in object files, but they are always refering to absolute external constants and never to an address in a section, so all of them can be resolved by the linker. |
Quote:
|
To make the frontend code more flexible and less Amiga/68k dependent, I wanted to start by adding support for other platforms that are also m68k-based. The easiest is of course the Atari ST, and the screenshot below is shows disassembly of a random PRG file.
Anyone got any handy links for other 68k executable file formats other than Amiga loadfiles and ST prgs? I've been struggling to find any for the Sharp X68000 platform. http://i.imgur.com/zWokd.png |
Quote:
Here is a link to a page with downloads to help you get hold of some X68000 executables: http://gamesx.com/wiki/doku.php?id=x...s_of_mdx_files This is an X68000 hard drive image (129MB): http://nfggames.com/users/eidis/X68000.zip Which can be opened in Windows with DiskExplorer v1.69: http://nfggames.com/users/eidis/editd169.zip to get what you need. |
Quote:
|
All times are GMT +2. The time now is 04:31. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.