Skip to content

Commit

Permalink
🚧 Add support for msg12/22(TODO)
Browse files Browse the repository at this point in the history
  • Loading branch information
ca1e committed Apr 28, 2023
1 parent 682b75f commit 365d980
Show file tree
Hide file tree
Showing 5 changed files with 56 additions and 298 deletions.
48 changes: 0 additions & 48 deletions Programv1.cs

This file was deleted.

212 changes: 0 additions & 212 deletions Programv2.cs

This file was deleted.

18 changes: 12 additions & 6 deletions REngine-msg-tool/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,27 +9,33 @@ class Program
{
static void Main(string[] args)
{
Console.WriteLine("Resident Evil msg tool. -- by cale -- Version 2.0 -- 27.04.2023");
Console.WriteLine();
if (args.Length != 1)
{
Console.WriteLine($"export: re2-msg-tool.exe msg_file_01.msg.<14|15|17>");
Console.WriteLine($"import: re2-msg-tool.exe msg_file_01.msg.<14|15|17>.txt");
Console.WriteLine($"export: re2-msg-tool.exe msg_file_01.msg.<12|14|15|17|22>");
Console.WriteLine($"import: re2-msg-tool.exe msg_file_01.msg.<12|14|15|17|22>.txt");
return;
}
var txtFile = args[0];
var msgFile = new MsgFile();

var muchMsg = txtFile switch
{
var t when t.EndsWith(".msg.14")
var t when t.EndsWith(".msg.12")
|| t.EndsWith(".msg.14")
|| t.EndsWith(".msg.15")
|| t.EndsWith(".msg.17") => true,
|| t.EndsWith(".msg.20")
|| t.EndsWith(".msg.22") => true,
_ => false,
};
var muchTxt= txtFile switch
{
var t when t.EndsWith(".msg.14.txt")
var t when t.EndsWith(".msg.12.txt")
|| t.EndsWith(".msg.14.txt")
|| t.EndsWith(".msg.15.txt")
|| t.EndsWith(".msg.17.txt") => true,
|| t.EndsWith(".msg.17.txt")
|| t.EndsWith(".msg.22.txt") => true,
_ => false,
};
if(muchMsg)
Expand Down
58 changes: 42 additions & 16 deletions REngine-msg-tool/ReToolMsg/MsgFile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -261,27 +261,53 @@ private void UpdateOffsets(Dictionary<string, long> offsets)

public enum MsgVersion
{
V12 = 12,
V14 = 14,
V15,
V17 = 17,
V20 = 20,
V22 = 22,
}

public enum Language// 14, 15, 17

/*
see: https://github.com/dtlnor/REMSG_Converter/blob/main/REMSG.py#L47
*/
public enum Language
{
ja,
en,
fr,
it,
de,
es,
ru,
pl,
ptBR = 10,
ko,
zhTW,
zhCN,
// for msg.17
ar = 21,
th = 26
Japanese = 0,
English,
French,
Italian,
German,
Spanish,
Russian,
Polish,
Dutch,
Portuguese,
PortugueseBr,
Korean,
TransitionalChinese,
SimplelifiedChinese,
Finnish,
Swedish,
Danish,
Norwegian,
Czech,
Hungarian,
Slovak,
Arabic,
Turkish,
Bulgarian,
Greek,
Romanian,
Thai,
Ukrainian,
Vietnamese,
Indonesian,
Fiction,
Hindi,
LatinAmericanSpanish,
//Max = 33
}
}
18 changes: 2 additions & 16 deletions REngine-msg-tool/ReToolMsg/Util.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,22 +50,8 @@ public static string ReadStringZ(long dataBase, Stream data, long offset)

private static readonly byte[] m_Key = new byte[]
{
207,
206,
251,
248,
236,
10,
51,
102,
147,
169,
29,
147,
80,
57,
95,
9
0xCF, 0xCE, 0xFB, 0xF8, 0xEC, 0x0A, 0x33, 0x66,
0x93, 0xA9, 0x1D, 0x93, 0x50, 0x39, 0x5F, 0x09
};
}
}

0 comments on commit 365d980

Please sign in to comment.