About project Tokyo dolls

Extraction and unpacking of game archives and compression, encryption, obfuscation, decoding of unknown files
libaibaba
Posts: 18
Joined: Mon Oct 29, 2018 3:04 pm

About project Tokyo dolls

Post by libaibaba »

First of all, the script in this link is wrong. It doesn't apply to current assetshttps://zenhax.com/viewtopic.php?f=9&t=12638&p=51441&hilit=Project+Tokyo+Dolls#p51441
When I look at the article, I see this https://estertion.win/2019/03/project-tokyo-dolls-拆解相关/
https://gist.github.com/esterTion/6b3fd18e2f67d72fdb6d28c5fe195e8a

This works well, but you need to install related tools that support php7.2 or below, such as wampserver.
Because it only deals with one asset, I made a small change

Code: Select all

<?php
//Come from https://gist.github.com/esterTion/6b3fd18e2f67d72fdb6d28c5fe195e8a
$dir = "G://prim/*";
foreach(glob($dir) as $file)
{

$dat = file_get_contents($file);

$key = implode('', array_reverse(str_split(base64_decode('Y2VJOCQpWSNZcyRyNVJGNVd8NFctXzE7Kkw7KVZVenc='), 1)));
$iv  = implode('', array_reverse(str_split(base64_decode('ZTBnJDJuUnAmIWRBUVJXP2pxeCxXPn1FI2ZKRzFEKkw='), 1)));

$head = substr($dat, 0, 0x400);
$body = substr($dat, 0x400);

$headdec = mcrypt_decrypt(MCRYPT_RIJNDAEL_256, $key, $head, MCRYPT_MODE_CBC, $iv);

file_put_contents($file, $headdec.$body);
}


I still don't make BMS scripts as usual, sorry。
Finally, as I have always stated, English is not my native language, which depends on translation software. Please forgive me for my English
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: About project Tokyo dolls

Post by aluigi »

I don't have samples for testing the script but I guess this one may work:

Code: Select all

set KEY string "Y2VJOCQpWSNZcyRyNVJGNVd8NFctXzE7Kkw7KVZVenc="
set IV  string "ZTBnJDJuUnAmIWRBUVJXP2pxeCxXPn1FI2ZKRzFEKkw="

string KEY U KEY
string IV  U IV

get NAME basename

encryption "mcrypt rijndael-256_cbc" KEY IV 0 32
log NAME 0 0x400
get SIZE asize
math SIZE - 0x400
encryption "" ""
append
log NAME 0x400 SIZE
append