天使帝國四《Empire of Angels IV》 *.dbfs

How to translate the files of a game
huehuehue
Posts: 36
Joined: Tue Aug 26, 2014 7:33 am

天使帝國四《Empire of Angels IV》 *.dbfs

Post by huehuehue »

im not sure if this is the correct place to put this, but anyone knows how to view/decrpyt this file?

sample:
https://drive.google.com/file/d/0BzpSyk ... sp=sharing
https://drive.google.com/file/d/0BzpSyk ... sp=sharing
https://drive.google.com/file/d/0BzpSyk ... sp=sharing

nvm, just copy paste it in c#
https://github.com/lsssk11331/dbfs-decrypt

Code: Select all

public class C_FileCodec
{
  public static void EncodeFile(string strPath)
  {
    try
    {
      int startIndex = strPath.LastIndexOf("\\") + 1;
      int length1 = strPath.Length;
      string str1 = strPath.Substring(startIndex, length1 - startIndex);
      int length2 = str1.LastIndexOf(".");
      string str2 = str1.Substring(0, length2);
      string path = strPath.Substring(0, strPath.LastIndexOf("\\") + 1) + str2 + ".dbfs";
      FileStream fileStream1 = File.Open(strPath, FileMode.Open, FileAccess.Read);
      FileStream fileStream2 = File.Open(path, FileMode.Create, FileAccess.Write);
      byte[] rgbKey = new byte[32]{ (byte) 24, (byte) 55, (byte) 102, (byte) 24, (byte) 98, (byte) 26, (byte) 67, (byte) 29, (byte) 84, (byte) 19, (byte) 37, (byte) 118, (byte) 104, (byte) 85, (byte) 121, (byte) 27, (byte) 93, (byte) 86, (byte) 24, (byte) 55, (byte) 102, (byte) 24, (byte) 98, (byte) 26, (byte) 67, (byte) 29, (byte) 9, (byte) 2, (byte) 49, (byte) 69, (byte) 73, (byte) 92 };
      byte[] rgbIV = new byte[16]{ (byte) 22, (byte) 56, (byte) 82, (byte) 77, (byte) 84, (byte) 31, (byte) 74, (byte) 24, (byte) 55, (byte) 102, (byte) 24, (byte) 98, (byte) 26, (byte) 67, (byte) 29, (byte) 99 };
      RijndaelManaged rijndaelManaged = new RijndaelManaged();
      CryptoStream cryptoStream = new CryptoStream((Stream) fileStream2, rijndaelManaged.CreateEncryptor(rgbKey, rgbIV), CryptoStreamMode.Write);
      BinaryReader binaryReader = new BinaryReader((Stream) fileStream1);
      cryptoStream.Write(binaryReader.ReadBytes((int) fileStream1.Length), 0, (int) fileStream1.Length);
      cryptoStream.FlushFinalBlock();
      cryptoStream.Close();
      fileStream1.Close();
      fileStream2.Close();
      Console.WriteLine("輸出:{0}", (object) path);
    }
    catch (Exception ex)
    {
      Console.WriteLine("Exception:" + ex.Message);
      Console.Read();
    }
  }

  public static void DecodeFile(string strPath)
  {
    int startIndex = strPath.LastIndexOf("\\") + 1;
    int length1 = strPath.Length;
    string str1 = strPath.Substring(startIndex, length1 - startIndex);
    int length2 = str1.LastIndexOf(".");
    string str2 = str1.Substring(0, length2) + "Org.dbf";
    string path = strPath.Substring(0, strPath.LastIndexOf("\\") + 1) + str2;
    FileStream fileStream = File.Open(strPath, FileMode.Open, FileAccess.Read);
    byte[] rgbKey = new byte[32]{ (byte) 24, (byte) 55, (byte) 102, (byte) 24, (byte) 98, (byte) 26, (byte) 67, (byte) 29, (byte) 84, (byte) 19, (byte) 37, (byte) 118, (byte) 104, (byte) 85, (byte) 121, (byte) 27, (byte) 93, (byte) 86, (byte) 24, (byte) 55, (byte) 102, (byte) 24, (byte) 98, (byte) 26, (byte) 67, (byte) 29, (byte) 9, (byte) 2, (byte) 49, (byte) 69, (byte) 73, (byte) 92 };
    byte[] rgbIV = new byte[16]{ (byte) 22, (byte) 56, (byte) 82, (byte) 77, (byte) 84, (byte) 31, (byte) 74, (byte) 24, (byte) 55, (byte) 102, (byte) 24, (byte) 98, (byte) 26, (byte) 67, (byte) 29, (byte) 99 };
    RijndaelManaged rijndaelManaged = new RijndaelManaged();
    StreamReader streamReader = new StreamReader((Stream) new CryptoStream((Stream) fileStream, rijndaelManaged.CreateDecryptor(rgbKey, rgbIV), CryptoStreamMode.Read));
    StreamWriter streamWriter = new StreamWriter(path);
    streamWriter.Write(streamReader.ReadToEnd());
    streamWriter.Flush();
    streamWriter.Close();
    streamReader.Close();
    fileStream.Close();
  }

  public static string DecodeFile2(string strPath)
  {
    FileStream fileStream = File.Open(strPath, FileMode.Open, FileAccess.Read);
    byte[] numArray = new byte[0];
    BinaryReader binaryReader = new BinaryReader((Stream) fileStream);
    binaryReader.BaseStream.Seek(0L, SeekOrigin.Begin);
    return C_FileCodec.DecodeBytes(binaryReader.ReadBytes((int) binaryReader.BaseStream.Length));
  }

  public static string DecodeBytes(byte[] bytes)
  {
    MemoryStream memoryStream = new MemoryStream(bytes);
    byte[] rgbKey = new byte[32]{ (byte) 24, (byte) 55, (byte) 102, (byte) 24, (byte) 98, (byte) 26, (byte) 67, (byte) 29, (byte) 84, (byte) 19, (byte) 37, (byte) 118, (byte) 104, (byte) 85, (byte) 121, (byte) 27, (byte) 93, (byte) 86, (byte) 24, (byte) 55, (byte) 102, (byte) 24, (byte) 98, (byte) 26, (byte) 67, (byte) 29, (byte) 9, (byte) 2, (byte) 49, (byte) 69, (byte) 73, (byte) 92 };
    byte[] rgbIV = new byte[16]{ (byte) 22, (byte) 56, (byte) 82, (byte) 77, (byte) 84, (byte) 31, (byte) 74, (byte) 24, (byte) 55, (byte) 102, (byte) 24, (byte) 98, (byte) 26, (byte) 67, (byte) 29, (byte) 99 };
    RijndaelManaged rijndaelManaged = new RijndaelManaged();
    return new StreamReader((Stream) new CryptoStream((Stream) memoryStream, rijndaelManaged.CreateDecryptor(rgbKey, rgbIV), CryptoStreamMode.Read)).ReadToEnd();
  }
}