Commit 5a574607 authored by Derrick Sobodash's avatar Derrick Sobodash

Pushing old files from 2003.

parent ab2f32f4
File added
This diff is collapsed.
This diff is collapsed.
#!/usr/bin/php -q
<?php
echo ("\nfsyjcdump v1.0\n(c) Derrick Sobodash 2003\n");
set_time_limit(6000000);
// first string at 0xe52ca
print "Loading ROM into memory...\n";
$fd = fopen("fsyjc.bin", "rb");
$fddump = fread($fd, filesize("fsyjc.bin"));
fclose($fd);
print "Checking for pointers file...";
if (file_exists("fsyjc_pointers.txt")){
print "found!\nLoading pointers...";
$pt = fopen("fsyjc_pointers.txt", "rb");
$ptdump = fread($pt, filesize("fsyjc_pointers.txt"));
fclose($pt);
$pointers = split("\n", $ptdump);
unset($pt, $ptdump);
}
else $pointers = loc_ptr($fddump);
print "\nDumping strings for " . count($pointers) . " pointers...\n";
$output = "";
list($tblf0, $tblf1, $tblf2, $tblf3, $tblf4, $tblf5, $tblf6) = maketablearray();
for ($i=0; $i<count($pointers); $i++) {
print " Dumping string $i...";
$pointer = hexdec(bin2hex(substr($fddump, hexdec($pointers[$i]), 4)));
print " $pointer... ";
$thisline = ""; $chrchr = "";
while ($chrchr != chr(0xff)){
$chrchr = substr($fddump, $pointer, 1); $pointer++;
if($chrchr==chr(0xf0)){
$bank = $tblf0;
$chrchr = substr($fddump, $pointer, 1); $pointer++;
}
else if($chrchr==chr(0xf1)){
$bank = $tblf1;
$chrchr = substr($fddump, $pointer, 1); $pointer++;
}
else if($chrchr==chr(0xf2)){
$bank = $tblf2;
$chrchr = substr($fddump, $pointer, 1); $pointer++;
}
else if($chrchr==chr(0xf3)){
$bank = $tblf3;
$chrchr = substr($fddump, $pointer, 1); $pointer++;
}
else if($chrchr==chr(0xf4)){
$bank = $tblf4;
$chrchr = substr($fddump, $pointer, 1); $pointer++;
}
else if($chrchr==chr(0xf5)){
$bank = $tblf5;
$chrchr = substr($fddump, $pointer, 1); $pointer++;
}
else if($chrchr==chr(0xf6)){
$bank = $tblf6;
$chrchr = substr($fddump, $pointer, 1); $pointer++;
}
else if($chrchr==chr(0xff)){
$chrchr = substr($fddump, $pointer, 1); $pointer++;
if($chrchr==chr(0xff)) {
$thisline .= "{clsr}\r\n";
$chrchr = substr($fddump, $pointer, 1); $pointer++;
$thisline .= "{" . str_pad(bin2hex($chrchr), 2, "0", STR_PAD_LEFT) . "}\r\n";
$chrchr = substr($fddump, $pointer, 1); $pointer++;
}
else if($chrchr==chr(0x00))
break;
}
if(isset($bank))
$thisline .= $bank[hexdec(bin2hex($chrchr))];
else
$thisline .= "{" . str_pad(bin2hex($chrchr), 2, "0", STR_PAD_LEFT) . "}\r\n";
}
unset($bank);
$output .= "{" . $pointers[$i] . "}\r\n$thisline{end}\r\n\r\n";
print "done!\n";
}
$fo = fopen("fsyjc_script.txt", "w");
fputs($fo, $output);
fclose($fo);
print "\nAll done!\n";
function loc_ptr($fddump) {
//$pointer = 0xe52ca;
$pointer_ar = array(0x10d4d8, 0x11105c, 0x113aa2, 0x11581e, 0x116f60, 0x1193d6, 0x11afc2, 0x11d4c8, 0x11de2a);
//$end = 0xf1d56;
$end_ar = array(0x1107f3, 0x1133b4, 0x115365, 0x116abb, 0x118e10, 0x11aa02, 0x11ce66, 0x11daf5, 0x11e5db);
$i=0;
print "Locating string pointers...\n";
for ($z=0; $z<9; $z++) {
$pointer = $pointer_ar[$z];
$end = $end_ar[$z];
while ($pointer < $end) {
if(strpos($fddump, pack("N", $pointer)) === FALSE) {
$pointer++;
$strings[$i] = strpos($fddump, pack("N", $pointer));
}
else {
$strings[$i] = strpos($fddump, pack("N", $pointer));
}
$pointer = strpos($fddump, chr(0xff), $pointer) + 1;
$i++;
print " Found pointer ". str_pad($i, 4, "0", STR_PAD_LEFT) . "...\n";
}
}
$output = "";
for ($i=0; $i<count($strings); $i++)
if($strings[$i] != 0)
$output .= dechex($strings[$i]) . "\n";
$fo = fopen("fsyjc_pointers.txt", "w");
fputs($fo, rtrim($output));
fclose($fo);
return ($strings);
}
function maketablearray() {
// Bank 1
$fd = fopen ("tbl/t0.txt", "rb");
$fddump = fread ($fd, filesize ("tbl/t0.txt"));
fclose ($fd);
$k=0;
for ($i = 0; $i < strlen($fddump); $i = $i+2) {
$tblf0[$k] = substr($fddump, $i, 2);
$k++;
}
// Bank 2
$fd = fopen ("tbl/t1.txt", "rb");
$fddump = fread ($fd, filesize ("tbl/t1.txt"));
fclose ($fd);
$k=0;
for ($i = 0; $i < strlen($fddump); $i = $i+2) {
$tblf1[$k] = substr($fddump, $i, 2);
$k++;
}
// Bank 3
$fd = fopen ("tbl/t2.txt", "rb");
$fddump = fread ($fd, filesize ("tbl/t2.txt"));
fclose ($fd);
$k=0;
for ($i = 0; $i < strlen($fddump); $i = $i+2) {
$tblf2[$k] = substr($fddump, $i, 2);
$k++;
}
// Bank 4
$fd = fopen ("tbl/t3.txt", "rb");
$fddump = fread ($fd, filesize ("tbl/t3.txt"));
fclose ($fd);
$k=0;
for ($i = 0; $i < strlen($fddump); $i = $i+2) {
$tblf3[$k] = substr($fddump, $i, 2);
$k++;
}
// Bank 5
$fd = fopen ("tbl/t4.txt", "rb");
$fddump = fread ($fd, filesize ("tbl/t4.txt"));
fclose ($fd);
$k=0;
for ($i = 0; $i < strlen($fddump); $i = $i+2) {
$tblf4[$k] = substr($fddump, $i, 2);
$k++;
}
// Bank 6
$fd = fopen ("tbl/t5.txt", "rb");
$fddump = fread ($fd, filesize ("tbl/t5.txt"));
fclose ($fd);
$k=0;
for ($i = 0; $i < strlen($fddump); $i = $i+2) {
$tblf5[$k] = substr($fddump, $i, 2);
$k++;
}
// Bank 7
$fd = fopen ("tbl/t6.txt", "rb");
$fddump = fread ($fd, filesize ("tbl/t6.txt"));
fclose ($fd);
$k=0;
for ($i = 0; $i < strlen($fddump); $i = $i+2) {
$tblf6[$k] = substr($fddump, $i, 2);
$k++;
}
return array ($tblf0, $tblf1, $tblf2, $tblf3, $tblf4, $tblf5, $tblf6);
}
?>
\ No newline at end of file
 林雲燕蓉姬發姜子牙雷震楊戩黃飛虎天化土行孫哪吒燃燈龍吉公主姓名職業屬性裝備劍師醫術士太道人神兵將騎拳法獸族朱雀白玄武青等級經驗攻擊防禦移動速度正常中毒死亡生命力全員檢視載入進儲存訊息狀態目標不在範圍內點數足火球41御式落85疾暴6怒仙楂果恢復0九轉金藥2僵屍蛇得到值提升為最大加學?3!物品普通快按A鈕拿取或放回B切換欄位C選擇/已滿了你確定要結束嗎上場:多S強制參戰役的能出請未鬥使用傅山谷勝利條件敵滅敗北角好,可以家去。這一趟來倒是打少獵跟我至吃個‧哈次村搜括成真豐富會有獎
\ No newline at end of file
賞二啊想就恨立刻三們覺兒萬突襲話四呸腦知些什麼誰敢搶食著坐牢吧嘛作前面安城看劫喂怕裡他毛頭小夥對器搞錯只樣手搏否則被殺油馬車哇很高興畫構思失繼續水難逃樂歪兄弟順瞧夠半月該把收那硬送給傢伙男哎呀南邊躲屋往木橋起走腳程拖累留應付擔心藏再沒帶若讓老所報告方追糟怎座封鎖別爺媳婦必須找夫您融離開免保謝各抓住東西狡猾拾宰問題交像兩下臭種眾哦竟然當阿忠惡信激後悔哥事簡單相功見比還嘿都退路乖擒兇類睡眠麻痺幫誤弱改變略明拉時候判刑籠氣勁唬輩直幹啦過『』盯算說渾身靜陰森關而朝歌紂王代父贖罪乃伯侯
\ No newline at end of file
昌之七年皇派者宣晉善卜卦遠近皆臨訴雖無憂卻羑里岐每日念但特地叮囑卒探望即孝眼期也釋跡象才求邑考原叫蠻緣妹病塊綠色石罷又聽元旦宮賀呢千計輿輛國香女光噓聲貴婆廳集合長斯文答睛自己除外騙驚慌八救呵縛;另居趁早既肯歡迎陪嘴、笑伴於泉閉吵門終砸掉耶獄準受達甲乙十部齊哼穿醜嘰衣服嘖緻捉惹煩本姑娘間閒聊倆卿先首領聰辦妞囉寂寞閻漂亮仗哄嚐輕守嚴傻站重笨蛋忘恩養流浪唉丟粗魯新舊趙親陣群此處苦繳稅征勞碼喔扯記憶差惜從需忙管它因和治理民懼活偉討厭感賜舒實際久豈憑懂如玉佩寶稀罕顆隔壁房託做溫柔向清楚
\ No newline at end of file
負義楣消耗擎訣破蒼穹乾坤7虹貫裂刀字斬嘯百步箭颶風矢旋狂囂爆五崩昇炎昧煉燎冰晶雪咒霸積黑嵐歸凝靈觀音凡魂血淨剛護體9魔符迴夢哮犬鬚鳳凰麒麟逸價賊現併助輪表葬注意待顧口費仲官邸儘阻止毀厲害災劃莽撞寵臣尤貪圖財妨賈氏墜樓依究嗯頗同情更妃格耿烈曉恐咱妲貌美花似蠍奉承非極稱懷異株搖錢樹柱珍珠瑪瑙奇賺絲毫共盆幸今遣並衰銜世始瓣盡慢恕禮妥佳趕緊其陷巴棵遲朕掌惱摔摘星她引叛榮諒啟奏解悶何賢微分素逆商量囚禁句怨言逢初焚祈康泰誠奸詐辨腹赦張況烽煙愚平亂替廷傷甚姿俊雅倍固浩蕩琴藝絕聞亦曾韻幽揚恍
\ No newline at end of file
dǩcPzZ߫ĤêYrlgȳ~yHٷJ߻P]b^[HhJnɫɫKOФI۵SϮJKuicCLseykѽLxxCѥJӮwVbdIG]ĨpDza`xtˬGa|jDXQȲvdǴۮIIxҽr׸լO֦׵Jhҷ\tFyjYcgIvqv٫ޤέȱMsѭܫPLI`FʷӧβI{{oZ׮٥lݱw~˧gR˰ƱVMͻH^yI}SǻrYܦiخeMzMIYԣѴXM
\ No newline at end of file
]ܬ[⵬q}͵ة߳\UJаV½KwݲξawQBmi˻_Aj׮qղ߰tȾJWQt]@HlxܼkȭޤѬٺpŲ}ɽӺ˩|xuhx귳WtWѴLoطl]O{PӰ\ܦRhAɦ[زǵջإRβ_ȩiʮLzWBmpܰ^۪ڶELxx߭YdGkϳǾnϽ׷RdKտN[۶ʣ`xѤu@ݦCקDȧƢHźƭ@^ֲr}ӯɦCGȭɲqV
\ No newline at end of file
頑匆根據喜姊疑掛忍蝠馴狗魅蠢彪套漢握僅邀肚窄筆買謀撐佈置贏拼項慚護島股整徒控牽魚鄉歹李酥友肆滋味覆袋醒痴補狐甦珮砍研培軒轅墳齒欲痊癒慰修遺函証臥傾巢疲霜賤訪奔亳遍撤支詭恥戶麗昏穴姻崑崙甘霖智語寫汝爾雙剋躁係削挑鰲絡界郊孟津嶺課戮威厚撥枉呂岳瘟‧矣區鴻貨精戴料帝響爭倀疼踩段操扭曲犧牲堯舜建債償側婚編斷辰鍵駕技超輸撕河妄捏@輔佐塵仍運軌猴<>勾採豔六院蘇狸稟媚惑福牛寬境穢播染戊登基攪挨權瘋趣製監碧企巫蘭HEVN繪貞廖效郭旲紀峰─史蹟川科                      
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment