*.tab又什么文件打开

来源:百度知道 编辑:UC知道 时间:2024/06/19 07:21:36
就是打开拉,别搞那么复杂~~~是个课程表的

1..tab文件格式

是存放游戏所有英文脚本的文件,文件内容是加密存储的,用一般文本编辑器打开是看不到任何可用信息。解密内容的方法是对文件所有字节与0xDD进行异或操作。
以下是解密文件的源码(C#):

private void button1_Click(object sender, System.EventArgs e)
{
// Create the reader for data.
FileStream fs = new FileStream("c:\\grim.tab", FileMode.Open, FileAccess.Read);
BinaryReader r = new BinaryReader(fs);

FileStream fs2 = new FileStream("c:\\text.txt", FileMode.Create);
BinaryWriter w = new BinaryWriter(fs2);
fs.Position = 4;
while(fs.Position < fs.Length)
{
w.Write((byte)(r.ReadByte()^ 0xdd));
}
r.Close();
w.Close();
fs.Close();
fs2.Close();

}

解密后的文件内容就是一般的文本,可以看到所有游戏对话都在其中。下面节选文件内容的2段进行分析:

sito030 Oh yeah, yeah. Yeah. That is what I told him.

sito031 Are you kidding me?

sito032 gave him the idea in the first place!

可以看出左边是说话人的名称标识,右边是说话的内容