Hacking how to unpack and repack vc .bin file

bp2000

Well-Known Member
OP
Member
Joined
Dec 13, 2008
Messages
155
Trophies
0
XP
93
Country
United States
can somebody please tell me how to unpack the content.bin file of a wii vurtual console game
 

dsfgd

Well-Known Member
Newcomer
Joined
May 17, 2008
Messages
71
Trophies
0
Age
34
Location
Germany
XP
116
Country
Gambia, The
i can, but i don't think you can understand how to do it.

things you need:
- SDkey
- SDiv
- PRNGseed key
- some C / C++ knowledge

i explain it with Homebrew Channel as content.bin:
- first you need to read the first 1600 Byte of content.bin and decrypt it with SDkey+SDiv, for decrypting use Openssl, aes_cbc_decrypt
- then read the decrypted data, you will find on offset 0x08 a 4 Byte unsigned long, in big endian format, this is the size of icon.bin (it should be 0x0000330C = 13068)
- so now read a buffer of it from 0x640 to 0x394B, decrypt it and you get the icon.bin, now you need the offset to Pre-TMD Header and TMD File
the calculation is simple: Pre-TMD Header is 1600 + 13068 mod 64 = 14720 = 0x3980
Pre-TMD Header and TMD file are NOT encrypted.
first 4 byte are the size of this header (0x00000070 = 112 mod 64 = 128), in this header you can find the size of TMD, but you don't need it, you must read the TMD, so get the size there.

so TMD is at 0x3A00 and has the size of 556 Byte (mod 64 = 576)
read the tmd to know where the contents are and how big they are, you will also need the index, to calculate index_iv

the first content (0x0000) is at offset 0x3C40 and has a size of 638384 Byte (mod 64 = 638400)
the second content (0x0001) is at offset 0x9FA00 and has a size of 760000 Byte (mod 64 = 760000)

the index_iv = xxxx & 0x0000000000000000000000000000, xxxx = index, so for the first content, the index_iv is "0x00000000000000000000000000000000"
so to decrypt it, you need the PRNGseed, as key, the rest is the same as any wad.

after decrypting you get the same files, (except of the *.tik) as if you unpacked a wad.

to re-encrypt it, you do exact the same, backwards with aes_cbc_encrypt.....

this is a fast written, maybe not fully correct tutorial to unpack content.bin files.

for those who don't know what mod 64 is, it's modulo, and a align of 64 Byte,
calculation sample:
13068 mod 64 = 13068 / 64 = 204,1875 = 204 + 1 = 205 *64 = 13120
 

jinxvorheeze

Well-Known Member
Member
Joined
May 13, 2008
Messages
572
Trophies
0
XP
15
Country
United States
I don't think anyone is going to make a video for you. It's not exactly an easy process, and is not something a video is going to help you better understand. Sorry mate.
 

datahoarder

Organized.
Member
Joined
Jul 7, 2007
Messages
567
Trophies
1
XP
749
Country
United States
Is there a way to batch extract the content.bin files/folders from a folder of .WADs and then maybe have a batch .tik ticket file installer?
This would save me some time from installing via Wad Manager and then swapping SD cards and then using 4.0 to move the channels. Thanks.
 

Supremekhaoz

New Member
Newbie
Joined
May 3, 2009
Messages
2
Trophies
0
XP
48
Country
United States
dsfgd said:
i can, but i don't think you can understand how to do it.

things you need:
- SDkey
- SDiv
- PRNGseed key
- some C / C++ knowledge

i explain it with Homebrew Channel as content.bin:
- first you need to read the first 1600 Byte of content.bin and decrypt it with SDkey+SDiv, for decrypting use Openssl, aes_cbc_decrypt
- then read the decrypted data, you will find on offset 0x08 a 4 Byte unsigned long, in big endian format, this is the size of icon.bin (it should be 0x0000330C = 13068)
- so now read a buffer of it from 0x640 to 0x394B, decrypt it and you get the icon.bin, now you need the offset to Pre-TMD Header and TMD File
the calculation is simple: Pre-TMD Header is 1600 + 13068 mod 64 = 14720 = 0x3980
Pre-TMD Header and TMD file are NOT encrypted.
first 4 byte are the size of this header (0x00000070 = 112 mod 64 = 128), in this header you can find the size of TMD, but you don't need it, you must read the TMD, so get the size there.

so TMD is at 0x3A00 and has the size of 556 Byte (mod 64 = 576)
read the tmd to know where the contents are and how big they are, you will also need the index, to calculate index_iv

the first content (0x0000) is at offset 0x3C40 and has a size of 638384 Byte (mod 64 = 638400)
the second content (0x0001) is at offset 0x9FA00 and has a size of 760000 Byte (mod 64 = 760000)

the index_iv = xxxx & 0x0000000000000000000000000000, xxxx = index, so for the first content, the index_iv is "0x00000000000000000000000000000000"
so to decrypt it, you need the PRNGseed, as key, the rest is the same as any wad.

after decrypting you get the same files, (except of the *.tik) as if you unpacked a wad.

to re-encrypt it, you do exact the same, backwards with aes_cbc_encrypt.....

this is a fast written, maybe not fully correct tutorial to unpack content.bin files.

for those who don't know what mod 64 is, it's modulo, and a align of 64 Byte,
calculation sample:
13068 mod 64 = 13068 / 64 = 204,1875 = 204 + 1 = 205 *64 = 13120
i dont understans this help me i even got original mario vc game to get the key cuse i never had hbc
 

Aattring

Member
Newcomer
Joined
Jun 17, 2009
Messages
5
Trophies
0
XP
49
Country
United States
I tryed following your instructions. Below is the output:

CODE ? ?NABPÂÂR­?
?`?ðͼÄX???º§¹k
Ú?ux;Zû?÷p?SÆ?HAJP ? ?HADP HALP
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂ IMETÂÂ?ÂÂÂÂ?ÂÂè? ?
 

BillandAlisha

Well-Known Member
Member
Joined
Dec 10, 2008
Messages
185
Trophies
0
Age
43
Location
Michigan
XP
67
Country
United States
mad.gif
Just, stop bumping. It's annoying.
mad.gif
 
D

Deleted-119707

Guest
5 bumps? wtf. wait for an answer or youll get none. ok?
use the search function.
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • No one is chatting at the moment.
    Maximumbeans @ Maximumbeans: butte