Converting a patched rom into extinfo.dat

Discussion in 'DSTT' started by Arkanell, Mar 30, 2010.

Mar 30, 2010
  1. Arkanell
    OP

    Newcomer Arkanell Member

    Joined:
    Mar 27, 2010
    Messages:
    17
    Country:
    United Kingdom
    Tools Needed

    A patched rom (we are going to be using Pokemon Soul Silver for this tutorial)
    An Unpatched Rom

    Hex Comparison tool (HexCmp / Somthing free)
    Emulator (DeSmuME)
    ttdt


    -- Step 1: Find out what the patcher did --

    first we need to find out what the patch did to do this we will compare the patched and unpatched roms using the Hex Comparison tool

    we will ignore all difference's between 0x00000000 and 0x0000015F this is the roms header and does not need to be edited whaen using extinfo.dat


    Go to the first difference after the header

    [​IMG]

    As you can see, the start of the difference is at 0x00004300


    -- Step 2: Find the correct place in memory --

    now open up the unpatched rom in DeSmuME, go to Tools>Ram Search

    now we need to search for the first 4 bytes at 0x00004300

    but wait, due to the way the DS work's you have to put the values in backwards like so

    9A A3 17 5C >> 5C 17 A3 9A

    set every thing up like so

    [​IMG]

    now click search

    [​IMG]

    it looks like we were lucky this time as there is only one result
    but we should check that everything is correct (sometimes you will get more that one result so you will have to check them all)

    Go to Tools>View Memory and close the window Titled "ARM7 memory"

    Now we are going to check if we have the correct offset.

    In the View address box type the offet we have just found, and click go.

    [​IMG]

    It looks like we have foud the correct place so all that is left to be done is add this to extinfo.dat

    [​IMG]

    Now repeat for every difference in the patched file.



    There is a shortcut for the rest of the Edits but I cannot guarantee this working

    Since the rom loads into memory the same as it is in the rom all we have to do is workout an offset and apply it to the patch locations in the rom


    Code:
    Patch in RomÂÂÂÂÂÂ0x00004300
    Patch in MemoryÂÂ 0x02000300
    Memory OffsetÂÂÂÂ 0x02000000ÂÂ(it is allways this)
    DiffrenceÂÂÂÂÂÂÂÂ 0x00004000

    ok the next patch is at 0x00004A18 in the rom
    if we take away 0x00004000 and Add 0x02000000 we get 0x02000A18

    looking at the memory using DeSmuME we can see if this is correct

    [​IMG]

    and it is

    you may notice that I have highlighted more than the patch at the bottom
    you can use the hex preceeding and following the target area to confirm that this it the correct place (very usefull if you get more than one hit)


    In the next tutorial i will be showing how to convert a (J) infolib.dat / extinfo.dat into a (U) one
     


  2. drwhojan

    Member drwhojan GBAtemp Addict

    Joined:
    Jul 14, 2009
    Messages:
    2,829
    Location:
    this planet earth
    Country:
    United Kingdom
    This is very nice work Arkanell !!!, well done..

    I will have to take some time to read through it and get it in mined, but i knew i nedded a better hex editor

    So we have to wait for a Jap patch version befor we can edit it into the extinfo.dat for (U) and (E) clean roms ?
     
  3. Arkanell
    OP

    Newcomer Arkanell Member

    Joined:
    Mar 27, 2010
    Messages:
    17
    Country:
    United Kingdom

    unfortunetly yes, but thankfully J roms are usually patched before U and E games are even released
     
  4. Pong20302000

    Member Pong20302000 making notes on everything

    Joined:
    Sep 8, 2009
    Messages:
    8,076
    Location:
    One's inner self
    Country:
    Japan
    im quite confused

    as i can deal with alot of japanese i use the latest editors (all in jap) and add the hex (U) & (E) games and it works fine when i load them up of the firmware

    is this the problem that people cant understand how to use the jap editors to add the data?

    or have i got the wrong end of the stick
     
  5. drwhojan

    Member drwhojan GBAtemp Addict

    Joined:
    Jul 14, 2009
    Messages:
    2,829
    Location:
    this planet earth
    Country:
    United Kingdom
    Thats what i tought...


    ...

    I wounder if they is a way of geting the speed information manuly for infolib.dat like this ?
     
  6. Pong20302000

    Member Pong20302000 making notes on everything

    Joined:
    Sep 8, 2009
    Messages:
    8,076
    Location:
    One's inner self
    Country:
    Japan
    well getting the infolib data and adding it is EASY!

    just using the cheat code edititor to get the Rom info and then i just edit it into the infolib.dat
    (i also read there is now a .nds file you can load up then load the rom and it will create the infolib.dat automatically)
     
  7. Pong20302000

    Member Pong20302000 making notes on everything

    Joined:
    Sep 8, 2009
    Messages:
    8,076
    Location:
    One's inner self
    Country:
    Japan
    may i also ask what is the difference in the (J) and (U) infolib / extinfo data?

    surely the data being added is all that matters?
     
  8. drwhojan

    Member drwhojan GBAtemp Addict

    Joined:
    Jul 14, 2009
    Messages:
    2,829
    Location:
    this planet earth
    Country:
    United Kingdom
    For R4 orignal errorcode-4 with certin games , the game has to self boot to get the ture info, if you put the GameID into infolib.dat and boot the game you still get a bunch of 0s in infolib

    If the game boots its self with a gameID thats not in infolib , it will gerate the code

    http://www.ndstti.cn/download/tool/infolib_custom.7z

    But i heard that R4 Clone can use the makelib.nds and InfolibMerge.nds and the game will boot passed errorcode=-4 and genrate the info in LIB folder anyway, But i don't have an R4 clone to try it with

    http://gbatemp.net/index.php?showtopic=214...t&p=2712974
     
  9. drwhojan

    Member drwhojan GBAtemp Addict

    Joined:
    Jul 14, 2009
    Messages:
    2,829
    Location:
    this planet earth
    Country:
    United Kingdom
    The codes are there , just have to be addressed in diffrent places , are it will not run
     
  10. Pong20302000

    Member Pong20302000 making notes on everything

    Joined:
    Sep 8, 2009
    Messages:
    8,076
    Location:
    One's inner self
    Country:
    Japan
    im not quite sure what u mean

    how can there be different type of (U) & (J) infolib, extinfo

    i mean i understand that

    (J) IPGJ 93243212
    (U) IPGE 39432423 (these numbers are random for example perposes)

    are different and also the hex required to remove the AP are also different

    but how can there be a different kind of file
     
  11. House Spider

    Banned House Spider In the GBAtemp attic.

    Joined:
    Apr 25, 2009
    Messages:
    1,282
    Location:
    Dundalk
    Country:
    Ireland
    Nice tutorial there.
     
  12. basher11

    Member basher11 GBAtemp's Official Vocaloid Lover

    Joined:
    Jun 29, 2009
    Messages:
    4,382
    Country:
    United States
    this is going straight to pkm XD
     
  13. drwhojan

    Member drwhojan GBAtemp Addict

    Joined:
    Jul 14, 2009
    Messages:
    2,829
    Location:
    this planet earth
    Country:
    United Kingdom
    I See Hex Comparison tool (HexCmp) auto fineds the diffrences between the two opened roms , and marks it in color, where the hex diffrence is
     
  14. drwhojan

    Member drwhojan GBAtemp Addict

    Joined:
    Jul 14, 2009
    Messages:
    2,829
    Location:
    this planet earth
    Country:
    United Kingdom
    Pong20302000 ^

    This one i think , hex adress required to remove the AP

    0x00004300 in hex

    0x2000300 in extinfo.dat adress
     
  15. Arkanell
    OP

    Newcomer Arkanell Member

    Joined:
    Mar 27, 2010
    Messages:
    17
    Country:
    United Kingdom
     
  16. drwhojan

    Member drwhojan GBAtemp Addict

    Joined:
    Jul 14, 2009
    Messages:
    2,829
    Location:
    this planet earth
    Country:
    United Kingdom
    Do you know where infolib.dat codes would be in hex edit and what to look out for ?

    Nice work and many thanks...

    I also building up a piture now of what you are saying...

    EDIT: I can see it would be possiable for trimed roms also !, Trimed roms would also change of the GameID
     
  17. drwhojan

    Member drwhojan GBAtemp Addict

    Joined:
    Jul 14, 2009
    Messages:
    2,829
    Location:
    this planet earth
    Country:
    United Kingdom
    Do you think this is bacuse of the diffrent files sizes , (U) rom 128MB and (J) rom 32MB , mabe parting the addresses abit in hex ?
     
  18. TyRaNtM

    Member TyRaNtM I did some projects..

    Joined:
    Oct 13, 2007
    Messages:
    999
    Location:
    Chile
    Country:
    Chile
    Code:
    ORIGINALÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ | PATCHED
    00004300 | 9A A3 17 5C 2F 12 B8 49 | 00004300 | 1C 00 9F E5 00 10 90 E5 |
    00004308 | B4 C0 96 64 51 79 45 D3 | 00004308 | 18 20 9F E5 02 00 51 E1 |
    00004310 | B9 6F 38 07 A8 CC E3 55 | 00004310 | 72 10 A0 03 08 10 C0 05 |
    00004318 | A6 0D C6 E3 75 D9 EB BD | 00004318 | 8E 10 A0 03 C4 10 C0 05 |
    00004320 | 64 41 6E 67 D6 D2 C7 0A | 00004320 | 1E FF 2F E1 A0 F0 25 02 |
    00004328 | 19 49 9A 9BÂÂÂÂÂÂÂÂÂÂÂÂ | 00004328 | 34 5D 09 E0ÂÂÂÂÂÂÂÂÂÂÂÂ |
    ------------------------------------------------------------------------
    00004A18 | 1E FF 2F E1ÂÂÂÂÂÂÂÂÂÂÂÂ | 00004A18 | 38 FE FF EAÂÂÂÂÂÂÂÂÂÂÂÂ |
    ------------------------------------------------------------------------
    000DF418 |ÂÂÂÂÂÂÂÂÂÂD1ÂÂÂÂÂÂÂÂÂÂÂÂ | 000DF418 |ÂÂÂÂÂÂÂÂÂÂE0ÂÂÂÂÂÂÂÂÂÂÂÂ |
    ------------------------------------------------------------------------
    Code:
    000DF418 |ÂÂÂÂÂÂÂÂÂÂD1ÂÂÂÂÂÂÂÂÂÂÂÂ | 000DF418 |ÂÂÂÂÂÂÂÂÂÂE0ÂÂÂÂÂÂÂÂÂÂÂÂ |


    This part need to be added in extinfo.dat, and maybe that is the reason that the freezes still happen.
     
  19. drwhojan

    Member drwhojan GBAtemp Addict

    Joined:
    Jul 14, 2009
    Messages:
    2,829
    Location:
    this planet earth
    Country:
    United Kingdom
    I have just be thinking , they was no (J) rom fix for sonic racing , are even a patch for it , they must have broght it out for extinfo.dat and infolib.dat insted direct...
     
  20. drwhojan

    Member drwhojan GBAtemp Addict

    Joined:
    Jul 14, 2009
    Messages:
    2,829
    Location:
    this planet earth
    Country:
    United Kingdom
    Its possible ? see if you can add it in !, have to fined the address for extinfo.dat...
     

Share This Page