Hacking A rough guide to pack/unpack savefiles (data.bin)

WiiCrazy

Be water my friend!
OP
Member
Joined
May 8, 2008
Messages
2,395
Trophies
0
Location
Istanbul
Website
www.tepetaklak.com
XP
387
Country
Don't read below crap, it's old, instead download FE100 1.2b, run the bundled keygrabber and you can avoid most of the mambo jambo here....
http://wiicrazy.tepetaklak.com/index.php/2...-fe100-release/

For a few days I was fiddling with segher's tools to get them pack a savefile I changed... There were these NG-key-id and NG-sig files I was stuck with... Finally found them in the output of xyzzy, key dumping application...

First of all, to use segher's tools in it's current form you should have an unix of some sort, you can either compile the existing one or try the existing precompiled binaries... best is just doing make clean and make afterwards... If you don't have OpenSSL libraries you should install them before compiling... If you don't have a key dump from xyzzy, make sure you have it before using tachtig and twintig, you'll need it...


After compilation you'll need a bunch of files for unpacking and packing save files...

To make it simple I'll refer xyzzy key dump as dump from now on... For unpacking, the stuff is the same for everyone...

Here are the required files (put them in .wii directory under your home (~) directory..

sd-key : 16 bytes encryption key, this is a shared secret.. you can find it as #6 key in your dump, or in the hackmii blog entry (HBE)

sd-iv : 16 bytes initialization vector for encryption... this is not in your dump so you should get it from the HBE.

md5-blanker : 16 bytes...not in the dump, you should get it from HBE.

These are the required files for tachtig (savefile unpacker) from segher's tools to work.. You'll find them in ascii hex form... so you should create binary files out of them with the exact sizes I mentioned above...

Running the tachtig from your home directory as below will result in a folder with the unencrypted contents of the savefile... folder name will be title id...

./tachtig data.bin



Packing a savefile is much more complex than unpacking a savefile since there is an extra process called signing to ensure your wii and every wii sucessfully verify the content of your savefile... Private encryption keys from your wii and your wii's signature takes place in this step... Since we got them with xyzzy, we are good to go...

Here are the files needed to run twintig (savefile packer)

You need these files under ~/.wii/default directory

NG-id : 4 bytes, id of your console... You can see it in ascii form at 0xC6 in device cert of your dump... just make sure you enter it correctly as hex bytes in an hex editor and create a file with 4 bytes... do not copy four bytes from 0xC6 in device cert since that's the represantation of the ascii form of it... Tachtig will also dump it from the savefile you can use that too, it's same after all...

NG-mac : 6 bytes, mac address of your console... Open a savefile from your wii in a hex editor, search for the title id (RSPE for wii sport for ex), 6 bytes after the title id is the mac address of your console... alternatively, it's at 0xF128 in the savefile...


Now here comes the interesting ones,

NG-priv : 30 bytes, Your wii's private elliptical curve cryptography key. it's the #0 key in your dump called ECC key there...

NG-key-id : 4 bytes, get it from your dump, it's at 0x104 in your device cert

NG-sig : 60 bytes, public ECC key for your wii, it's also in the device cert part of the dump. it's located at 0x4...


When you got all files ready, you can run twintig... Of course you can mess with the savefiles before that
wink.gif


./twintig

Like this,



http://www.youtube.com/watch?v=tOuNtuG5q28


Notes,

1. Icon animation didn't work with the packed savefile I tested, I thought it was because I didn't get the correct NG-sig file yet I successfully copied the savefile over to my wii..

2. Don't ask for the files!! Shared ones already posted everywhere, especially the bushing's ... NG-* ones are specific to each wii so you'll not find them anywhere...

3. If you can't get the NG files correctly savefile will be displayed in the SD section of data management yet copying will fail with "data cannot be copied" error message... That flags you got the signature at the end of the savefile wrong...

4. You can create the necesarry folders like,

Code:
cd ~
mkdir .wii
mkdir .wii/default

you should put sd-key, sd-iv, md5-blanker under ~/.wii directory

and NG-id, NG-mac, NG-priv, NG-key-id, NG-sig files under ~/.wii/default directory

5. Here is the hackmii blog entry : http://hackmii.com/2008/04/keys-keys-keys/
 

computerboy

Well-Known Member
Member
Joined
Sep 20, 2008
Messages
802
Trophies
0
XP
309
Country
Swaziland
I get an error it say cannot open sd-key no such file or directory. But it's in the same folder as the tachtig and data.bin
 

Adr990

To boldly go where no man has gone before!
Member
Joined
Apr 22, 2007
Messages
1,567
Trophies
0
Location
The Netherlands
Website
www.hyrule.net
XP
737
Country
Netherlands
You can just compile with a normal windows C++ compiler...? (like Dev C++)

I mean Devkitpro only includes some .h files needed for some things and Programmers note pad...

I ever made a .elf and .dol...(wii) but seriously... ask me now again and I can't remember nor explain
 

computerboy

Well-Known Member
Member
Joined
Sep 20, 2008
Messages
802
Trophies
0
XP
309
Country
Swaziland
how can I create a folder in Home? It won't let me

P.S. Sorry I'm a little bit of a noob in Ubuntu (I started about a month ago)
 

Arm the Homeless

Custom Title
Member
Joined
May 26, 2008
Messages
1,762
Trophies
0
Location
/home/andy/
Website
Visit site
XP
125
Country
United States
computerboy said:
how can I create a folder in Home? It won't let me

P.S. Sorry I'm a little bit of a noob in Ubuntu (I started about a month ago)
Not in /home, $HOME is a variable for YOUR home. As in /home/computerboy.

In the terminal, you would type:
CODEmkdir -p $HOME/.wii/default
 

WiiCrazy

Be water my friend!
OP
Member
Joined
May 8, 2008
Messages
2,395
Trophies
0
Location
Istanbul
Website
www.tepetaklak.com
XP
387
Country
adr990 said:
You can just compile with a normal windows C++ compiler...? (like Dev C++)

I mean Devkitpro only includes some .h files needed for some things and Programmers note pad...

I ever made a .elf and .dol...(wii) but seriously... ask me now again and I can't remember nor explain

Well I tried compiling using visual studio with open ssl libraries but only got some porting issues with unistd.h and types.h... it messes with permissions and stuff...
Compiling with a linux compatibility layer should work but my intention was to debug so I didn't bother as I don't have any in my current pc at the moment... I'll do that when I got my cygwin installed notebook back...

If anyone successfully compiled for windows I'd be more than glad if shared
wink.gif
 

Adr990

To boldly go where no man has gone before!
Member
Joined
Apr 22, 2007
Messages
1,567
Trophies
0
Location
The Netherlands
Website
www.hyrule.net
XP
737
Country
Netherlands
Lol, I did Compiled with Windows...

I didn't know that was... rare...

Tough, it was only a Helo World app... if that makes difference...
Compiled in a .elf and a .dol... (wii)

I loaded up both working.
tongue.gif


I will try to look up how it did it...

(But still I don't know how yet... Unbutu includes a standard compiler for us? I used V-mare but didn't get anything installed what a shame for me... I really want to learn it...)
 

Adr990

To boldly go where no man has gone before!
Member
Joined
Apr 22, 2007
Messages
1,567
Trophies
0
Location
The Netherlands
Website
www.hyrule.net
XP
737
Country
Netherlands
I think I remember how I did it...:
After edit in Programmers notepad and Dev C++
I used the msys.bat to Compile it
wink.gif


Click Guide of Tehskeen!
smile.gif
I learned much there either...

I go install ubuntu I guess again...
 

WiiCrazy

Be water my friend!
OP
Member
Joined
May 8, 2008
Messages
2,395
Trophies
0
Location
Istanbul
Website
www.tepetaklak.com
XP
387
Country
Arm the Homeless said:
computerboy said:
@ Arm the Homeless: waht am I supposed to do next please? cause Im kinda coonfused
unsure.gif
I put the guide up at http://ratm.net63.net/wiisave-guide.html if you can't already understand WiiCrazy's one.

Could you remove that guide... It seems as if you wrote it... There is no credits no link or nothing... What I posted above is completely original, no rip off from someone else's guide or anything... Not a single time I did a copy and paste on that one...
 

Arm the Homeless

Custom Title
Member
Joined
May 26, 2008
Messages
1,762
Trophies
0
Location
/home/andy/
Website
Visit site
XP
125
Country
United States
WiiCrazy said:
Arm the Homeless said:
computerboy said:
@ Arm the Homeless: waht am I supposed to do next please? cause Im kinda coonfused
unsure.gif
I put the guide up at http://ratm.net63.net/wiisave-guide.html if you can't already understand WiiCrazy's one.

Could you remove that guide... It seems as if you wrote it... There is no credits no link or nothing... What I posted above is completely original, no rip off from someone else's guide or anything... Not a single time I did a copy and paste on that one...
Oh. I could add credits if you want.

But sure, I'll remove it. Deleted. (Take this opportunity to click the old link and see my awesome 404 page
tongue.gif
)
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • ShdwTakashi @ ShdwTakashi:
    Good morning!
  • ShdwTakashi @ ShdwTakashi:
    pineapple belong on pizza? The answer is yes until proven otherwise
  • StatusN @ StatusN:
    hi, i need help with unbanning my 3ds, can somebody show me a link to a seed that still works and isnt yet banned, mine got banned yesterday
  • A @ anotherthing:
    The Nintendo servers are going down in 9 days anyway.
  • Xdqwerty @ Xdqwerty:
    Good morning
  • Xdqwerty @ Xdqwerty:
    @StatusN, welcome
  • BakerMan @ BakerMan:
    hey qwerty look at that you ain't the youngest here anymore
    +1
  • S @ salazarcosplay:
    Had a question on 3ds
  • S @ salazarcosplay:
    will one still be able to transfer pokemon from the ds 3ds games to Switch
  • A @ anotherthing:
    Supposedly Bank isn't going down.
  • StatusN @ StatusN:
    i know they are @anotherthing but i modded m y 3ds last month and i installed pretendo but as my 3ds got banned i need a friend seed to unblock my 3ds
  • A @ anotherthing:
    You got banned from Pretendo?
  • StatusN @ StatusN:
    online ban
  • S @ salazarcosplay:
    @anotherthing I think Nintendo should have just re released all pokemon games on the switch
    +1
  • S @ salazarcosplay:
    let you transfer it all
  • StatusN @ StatusN:
    bank got shutdown in april last year
  • Xdqwerty @ Xdqwerty:
    @salazarcosplay, yea the only game they rereleased are the game boy and games boy color ones (remakes don't count)
  • StatusN @ StatusN:
    does anyone have a friend seed link to a seed that isnt already banned and is new, if anyone does then thanks
  • S @ salazarcosplay:
    @Xdqwerty I refuse to get Nintendo Switch online
  • S @ salazarcosplay:
    until they add pokemon mainline games
  • S @ salazarcosplay:
    they could very easily do so
  • Xdqwerty @ Xdqwerty:
    @salazarcosplay, i meant that they got rereleased in virtual console in 3ds
  • S @ salazarcosplay:
    @Xdqwerty why cant they do so for the switch :sad:
  • A @ anotherthing:
    Online was free on the 3DS as well, and it worked well.
    +1
  • S @ salazarcosplay:
    I can't help but think nintendo switch online is the reason we did not get a gameboy/n64/gamecube
    mini classic edition
    S @ salazarcosplay: I can't help but think nintendo switch online is the reason we did not get a...