Current Best Disassembler

Discussion in 'Sega Dreamcast Development and Research' started by Dreamcast, Mar 12, 2018.

  1. Dreamcast

    Dreamcast Intrepid Member

    Joined:
    Jul 17, 2007
    Messages:
    603
    Likes Received:
    19
    What is the current best tool for disassembling a standard Dreamcast 1ST_READ binary? Accuracy / completeness of the disassembly should weigh more than ease of use.
     
  2. TapamN

    TapamN Member

    Joined:
    Sep 16, 2005
    Messages:
    22
    Likes Received:
    4
    Use objdump. If you have a working DC dev. environment, you should already have it. Accurate and complete.

    sh-elf-objdump -b binary -m sh4 -EL -D --adjust-vma=0x8c010000 1ST_READ.BIN > disassembly.txt
     
    Dreamcast and Mrneo240 like this.
  3. Mrneo240

    Mrneo240 Robust Member

    Joined:
    Sep 15, 2017
    Messages:
    246
    Likes Received:
    160
    A healthy dose of objdump, Ida, and the sh4 reference manual will serve you well.
     
    Dreamcast likes this.
  4. Dreamcast

    Dreamcast Intrepid Member

    Joined:
    Jul 17, 2007
    Messages:
    603
    Likes Received:
    19
    Thanks to both of you for your replies and TapamN for providing a working model!
     
  5. SiZiOUS

    SiZiOUS Spirited Member

    Joined:
    Mar 27, 2009
    Messages:
    105
    Likes Received:
    116
    I personally use IDA Pro. It's powerful even for Windows CE binaries.
     
  6. Mrneo240

    Mrneo240 Robust Member

    Joined:
    Sep 15, 2017
    Messages:
    246
    Likes Received:
    160
    Huh I'm having the opposite experience, I find it wicked easy with WinCE and a little more diffucult with KATANA binaries.

    Probably just me being unfamiliar with it though
     
  7. SiZiOUS

    SiZiOUS Spirited Member

    Joined:
    Mar 27, 2009
    Messages:
    105
    Likes Received:
    116
    For WinCE it works just out-of-the-box, you just need to select the SH4 CPU type in the dialog box.
    For Katana, you must specify the load address, which is usually 0x8C010000.
     
  8. Mrneo240

    Mrneo240 Robust Member

    Joined:
    Sep 15, 2017
    Messages:
    246
    Likes Received:
    160

    I do that and have a ram section set up too. Cpu: sh4, ram 16MB.

    It just seems like following the structure of the code is tricky because of how intermixed data+code are
     
  9. Dreamcast

    Dreamcast Intrepid Member

    Joined:
    Jul 17, 2007
    Messages:
    603
    Likes Received:
    19
    I've also tried IDA, but I'm of the same opinion as @Mrneo240 regarding Katana binaries. I follow @MetalliC's advice here, but after everything loads, it always asks me to jump to the starting address and press 'c' to start the analysis, which only results in the first block being analyzed. I thought it would go through and map out the branches automatically for the most part.
     
  10. Xerxes3rd

    Xerxes3rd Rapidly Rising Member

    Joined:
    Sep 1, 2016
    Messages:
    88
    Likes Received:
    28
    I had mixed results too with IDA and Katana binaries. There seemed to be some sections that it just couldn’t figure out, which I suspect was the result of the binary being compiled with some amount of optimizations enabled. All that said, it was still useful.
     
  11. MetalliC

    MetalliC Spirited Member

    Joined:
    Apr 23, 2014
    Messages:
    122
    Likes Received:
    77
    in many cases you have to manually trace code execution and tell to IDA disassemble code (key C), or set subroutine (key P) there needed.
    or in more automated way - use some emulator, which can generate "trace log" files, and then parse it in IDA using scripts.

    speaking in general, such tasks require moderate tech skills. its not task for dummies there you can click here and there and everything will happen automagically ;)
     

Share This Page