Trishty
Legend of Zelda
- 7/3/09
- 1,055
- 51
Làm xong extractor cho gõ name ^v^
cậu xem thử, mình dùng cái này extract ra đc 1ltb 1dtx 212wav trg file test.rez đó
cậu xem thử, mình dùng cái này extract ra đc 1ltb 1dtx 212wav trg file test.rez đó
PHP:
<?php
function hexToStr($hex){ $string=''; for ($i=0; $i < strlen($hex)-1; $i+=2) { $string .= chr(hexdec($hex[$i].$hex[$i+1])); }return $string;}
function read_stdin()
{
$fr=fopen("php://stdin","r"); // open our file pointer to read from stdin
$input = fgets($fr,128); // read a maximum of 128 characters
$input = rtrim($input); // trim any trailing spaces.
fclose ($fr); // close the file handle
return $input; // return the text entered
}
echo "Nhap ten file rez: ";
$tenfile = read_stdin();
echo "\nNhap 1 de extract sounds";
echo "\nNhap 2 de extract textures";
echo "\nNhap 3 de extract models\n";
$loai = read_stdin();
while($loai<=3)
{
if ($loai=="1")
{
$rez = file_get_contents($tenfile); // get the rez as a string
$wavs = explode(hexTostr('52494646'),$rez); //make an array containing the wavs, its header is cut off, but we gonna fix that
foreach($wavs as $k => $v) {
if($k==0) continue; //skip the first, its the rez header
$f = fopen("sound_".$k.".wav","a+"); //save as sound_NUMBER
fwrite($f,hexTostr('52494646 ').$v); //write the header + the wav itself
fclose($f);
}
echo "\nExtract sounds thanh cong";
break;
}
else if ($loai=="2")
{
$rez = file_get_contents($tenfile); // get the rez as a string
$dtxs = explode(hexTostr('00000000FBFFFFFF'),$rez); //make an array containing the dtxs, its header is cut off, but we gonna fix that
foreach($dtxs as $k => $v) {
if($k==0) continue; //skip the first, its the rez header
$f = fopen("texture_".$k.".dtx","a+"); //save as texture_NUMBER
fwrite($f,hexTostr('00000000FBFFFFFF ').$v); //write the header + the dtx itself
fclose($f);
}
echo "\nExtract textures thanh cong";
break;
}
else if ($loai=="3")
{
$rez = file_get_contents($tenfile); // get the rez as a string
$ltbs = explode(hexTostr('0100090000000000'),$rez); //make an array containing the ltbs, its header is cut off, but we gonna fix that
foreach($ltbs as $k => $v) {
if($k==0) continue; //skip the first, its the rez header
$f = fopen("model_".$k.".ltb","a+"); //save as model_NUMBER
fwrite($f,hexTostr('0100090000000000 ').$v); //write the header + the ltb itself
fclose($f);
}
echo "\nExtract models thanh cong";
break;
}
else
{
echo "\nBan nhap sai, xin nhap lai so 1 hoac 2 hoac 3\n";
$loai = read_stdin();
}
}
sleep(5);
?>
Attachments
Chỉnh sửa cuối:


