Compiling Segher's Wii tools.

Discussion in 'Wii - Hacking' started by ChaosBoi, Dec 10, 2008.

Dec 10, 2008

Compiling Segher's Wii tools. by ChaosBoi at 7:30 AM (4,279 Views / 0 Likes) 21 replies

  1. ChaosBoi
    OP

    Member ChaosBoi Ushiromiya Battler

    Joined:
    Feb 19, 2007
    Messages:
    1,326
    Location:
    California
    Country:
    United States
    Okay, I've looked everywhere on google and have not found an answer that'll guide me through this process. As you can probably tell, I've just recently installed Linux so I'm not very familiar with it. From what I've read out of the results I found, I need (and have already downloaded) OpenSSL and the 3 required keys. So now what do I do after getting all of them?

    EDIT: And by the way, I would also like to know what to type in for the tools that both decompiles and compiles the .bin saves. The games I want to decompile the saves for are backups so I can't use Waninkoko's save extractor [​IMG] .
     


  2. noobwarrior7

    Member noobwarrior7 GBAtemp Advanced Maniac

    Joined:
    Aug 2, 2008
    Messages:
    1,594
    Location:
    USA
    Country:
    United States
    you can just use fs_browser and find all the files and copy them to your sd card, you won't be able to copy them back in that form though.
     
  3. WiiCrazy

    Member WiiCrazy Be water my friend!

    Joined:
    May 8, 2008
    Messages:
    2,391
    Location:
    Istanbul
    Country:
    Turkey
    If you installed openssl, you just need to issue make in the folder that you extracted the tools archive... and it comes with precompiled binaries for linux so you actually don't have to compile...

    I had used it to decrypt my nand dump previously.. this time like you I want to extract the data.bin files for savegames... now I'm opening up space for installing a virtual machine with linux... If I succeed in decrypting and extracting that file, I'll notify you...
     
  4. ChaosBoi
    OP

    Member ChaosBoi Ushiromiya Battler

    Joined:
    Feb 19, 2007
    Messages:
    1,326
    Location:
    California
    Country:
    United States
    Okay, cool. I never figured out how to use the precompiled tools because even though Linux reads them as executables, I couldn't get them to work when I tried using the Terminal. When I was searching for answers, pretty much all of them told me I had to compile my own in order to use it.
     
  5. WiiCrazy

    Member WiiCrazy Be water my friend!

    Joined:
    May 8, 2008
    Messages:
    2,391
    Location:
    Istanbul
    Country:
    Turkey
    Well actually I had probably compiled them too in order for them to work too [​IMG]
    Just I don't remember well, if they match the static libraries in your system they may successfuly run... I had library errors at that time...

    Also, make sure you have the keys in proper places and in proper format, you should convert them to binary...
     
  6. WiiCrazy

    Member WiiCrazy Be water my friend!

    Joined:
    May 8, 2008
    Messages:
    2,391
    Location:
    Istanbul
    Country:
    Turkey
    Well I successfully extracted a data.bin savefile... here is how I did it...
    On a fresh installation of Pardus (most distros should work by the way)
    Copied the sources to the .wii directory in ~ (home) directory...
    issued make clean and then make... sources compiled...

    Now got the keys from bushing's blog post on hackmii.. you need sd-key, sd-iv and md5-blanker...
    They are not specific to each wii...
    For each one created a binary file with the 16 byte key and put those under the .wii folder
    Put my data.bin into ~ and from there issued,
    .wii/tachtig data.bin

    program responded with the details of the file and spitted the contents of the savefile into a folder with title id as name...

    now changing the savefile and repacking needs a bit of examination...
     
  7. ChaosBoi
    OP

    Member ChaosBoi Ushiromiya Battler

    Joined:
    Feb 19, 2007
    Messages:
    1,326
    Location:
    California
    Country:
    United States
    So then I don't need to compile my own anymore or what? That's the biggest issue I have right now so hopefully I don't need to.
     
  8. Arm the Homeless

    Member Arm the Homeless Custom Title

    Joined:
    May 26, 2008
    Messages:
    1,762
    Location:
    /home/andy/
    Country:
    United States
  9. ChaosBoi
    OP

    Member ChaosBoi Ushiromiya Battler

    Joined:
    Feb 19, 2007
    Messages:
    1,326
    Location:
    California
    Country:
    United States
    Yeah, that's the one I downloaded except it didn't have the .wii directory in it though.
     
  10. WiiCrazy

    Member WiiCrazy Be water my friend!

    Joined:
    May 8, 2008
    Messages:
    2,391
    Location:
    Istanbul
    Country:
    Turkey
    I am in the packing part, I have NG-id, NG-mac, NG-priv at the moment, yet I lack 60 byte NG-sig file and 4 byte NG-key-id... these are all specific to each wii... Probably they are in the device cert (that's what xyzzy calls it) part but I couldn't find where actually they are and if encrypted or not...

    Any clue?

    ps: no asking for illegal stuff by the way
     
  11. Arm the Homeless

    Member Arm the Homeless Custom Title

    Joined:
    May 26, 2008
    Messages:
    1,762
    Location:
    /home/andy/
    Country:
    United States
    Because:

    1) Unpacking: I already had those in. The .wii directory is in Segher's Wii.git directory. They don't have to be in ~. I just removed the keys now.
    2) Repacking: Keys are specific to each Wii.
     
  12. WiiCrazy

    Member WiiCrazy Be water my friend!

    Joined:
    May 8, 2008
    Messages:
    2,391
    Location:
    Istanbul
    Country:
    Turkey

    Did you repack anything successfully?

    I guess the NG-sig is the 60 bytes in the device cert at offset 0x104, what do you think?
     
  13. WiiCrazy

    Member WiiCrazy Be water my friend!

    Joined:
    May 8, 2008
    Messages:
    2,391
    Location:
    Istanbul
    Country:
    Turkey
  14. ChaosBoi
    OP

    Member ChaosBoi Ushiromiya Battler

    Joined:
    Feb 19, 2007
    Messages:
    1,326
    Location:
    California
    Country:
    United States
    I got the precompiled apps to work [​IMG] . Thanks a lot guys ^^.
     
  15. WiiCrazy

    Member WiiCrazy Be water my friend!

    Joined:
    May 8, 2008
    Messages:
    2,391
    Location:
    Istanbul
    Country:
    Turkey
    what about twintig?
     
  16. ChaosBoi
    OP

    Member ChaosBoi Ushiromiya Battler

    Joined:
    Feb 19, 2007
    Messages:
    1,326
    Location:
    California
    Country:
    United States
    Just tried it and unfortunately, no [​IMG] . When I tried to recompile the save, I get "cannot open default/NG-id: No such file or directory".

    It's odd because I typed in .wii/twintig data.bin and it gives me that error.
     
  17. WiiCrazy

    Member WiiCrazy Be water my friend!

    Joined:
    May 8, 2008
    Messages:
    2,391
    Location:
    Istanbul
    Country:
    Turkey
    You should have binary files for them... it's the first of the batch it's complaining, if you put there NG-id file, then it will complain about NG-mac file.. and so on...
    You can get some of those from the output of xyzzy application..

    NG-id and NG-mac contents are already in the save file... just wiibrew for them
    NG-priv is the ECC key in the xyzzy key dump...

    Missing pieces are NG-sig and NG-key-id
     
  18. ChaosBoi
    OP

    Member ChaosBoi Ushiromiya Battler

    Joined:
    Feb 19, 2007
    Messages:
    1,326
    Location:
    California
    Country:
    United States
    Wait, I'm a bit lost on what I need to look for exactly :? .
     
  19. WiiCrazy

    Member WiiCrazy Be water my friend!

    Joined:
    May 8, 2008
    Messages:
    2,391
    Location:
    Istanbul
    Country:
    Turkey
    Well then, all of these should be in binary files under default directory...
    I'll call xyzzy key dump as dump from now on...

    NG-id is your console id... it's 4 bytes... look at the device cert in the dump, you can see the ascii version of it after text NG

    NG-mac is your console's mac id.. it's 6 bytes... it's at offset 0xf128 in the save file... alternatively you can get this value by other means (using backup disc for ex.)

    NG-priv is the actual encryption key.. it's 30 bytes and it's the ECC key in the dump...

    have no clue about the NG-key-id and NG-sig... both of them probably from the device cert... yet I saw no information to confirm this...

    http://www.wiibrew.org/wiki/Savegame_Files
    http://www.wiibrew.org/wiki/Wii_Savegame_Parser
     
  20. ChaosBoi
    OP

    Member ChaosBoi Ushiromiya Battler

    Joined:
    Feb 19, 2007
    Messages:
    1,326
    Location:
    California
    Country:
    United States
    So all I need to do is type in the NG-id along with the NG-mac and then the source directory?
     

Share This Page