Asking for help on a reverse engineering issue. (sh4)

Discussion in 'Sega Dreamcast Development and Research' started by Mrneo240, Sep 15, 2017.

  1. Mrneo240

    Mrneo240 Gutsy Member

    Joined:
    Sep 15, 2017
    Messages:
    462
    Likes Received:
    571
    Hey everyone,
    So today I began working on a personal project but I ran into a couple of issues. I solved some of them but once again I'm stuck.

    I'm trying to understand a specific function call and then patch how it is called in an already compiled executable.Most of my assembly knowledge is specific to x86, in Windows. Sh4 on the dreamcast is close but I'm still having issues.

    Looking for people to bounce thoughts off of.
    Boiled down my issue is this:

    function func2 is getting called from within another function and the parameters are sent from a different function

    Start calls func1(a,b,c,d) which then calls func2(a,b,0,1)

    I can see in the disassembly that it goes like this:
    mov 1, r7
    mov 0, r6
    mov.l , r5 (I don't understand mov.l, can I change it just mov?)
    mov.l [a], r4
    jsr @func2 (actually jsr @r3)

    When I patch the mov for r5 it doesn't work correctly (but I am doing it by hand in a compiled binary, maybe I have the bytes wrong)

    HELP?!

    Sidenote: In have SDK r9, r10, and r11.b but I am trying to patch something built with Shinobi VER 1.62 (which should be r10) but my r10 SDK doesn't match, it has VER 1.64.

    Would anyone who has an installed SDK be willing to check if their Shinobi.lib is 1.62 and what SDK it comes from? If kindly also post your shinobi.lib and the header file "km2enum.h"
     
  2. -=FamilyGuy=-

    -=FamilyGuy=- Site Supporter 2049

    Joined:
    Mar 3, 2007
    Messages:
    3,032
    Likes Received:
    890
    Do you have the reference for sh4 instructions? mov.l should be defined there.

    I think @MetalliC amd @megavolt85 could be of help.
     
    Last edited: Sep 15, 2017
    Mrneo240 likes this.
  3. megavolt85

    megavolt85 Peppy Member

    Joined:
    Jan 8, 2015
    Messages:
    311
    Likes Received:
    454
    Code:
    mov Rm, Rn
    
    int m, n;
    n = m;
    
    mov.l Rm, @Rn
    
    int m, *n;
    *n = m;
    
    look Instruction descriptions in attach
     

    Attached Files:

    Last edited: Sep 15, 2017
  4. Mrneo240

    Mrneo240 Gutsy Member

    Joined:
    Sep 15, 2017
    Messages:
    462
    Likes Received:
    571
    Thanks both of you! After reading select pages (550pg PDF haha) from that PDF and finding the renases site, and messing with 3 disassemblers I finally got it!

    Thank you.

    Just figuring out how to appropriately encode an instruction in a hex editor was a struggle. I did get it and then I figured out how registers are ordered.

    Sadly though I wasn't able to accomplish what I wanted and I ended up wasting 3 more CDs but it's all a learning experience.
     
  5. Mrneo240

    Mrneo240 Gutsy Member

    Joined:
    Sep 15, 2017
    Messages:
    462
    Likes Received:
    571
    Bump sadly:
    Family Guy thank you for your self boot script, it's the basis for how I've been making new releases.

    Has anyone ever seen the katana/Dreamcast SDK r6 or r8(.1)? I'm wondering if they contain kamui library very 1.62. It seems at least 2 games were made using whatever SDK release included that version: perpetual blue 3 and Chu Chu Rocket. Their strings are near identical
     
    -=FamilyGuy=- likes this.
sonicdude10
Draft saved Draft deleted
Insert every image as a...
  1.  0%

Share This Page