diff --git a/CTFAK/GUI/MainForm.cs b/CTFAK/GUI/MainForm.cs index 807ba27..4b4b74c 100644 --- a/CTFAK/GUI/MainForm.cs +++ b/CTFAK/GUI/MainForm.cs @@ -18,6 +18,7 @@ using CTFAK.MMFParser.EXE.Loaders.Objects; using CTFAK.MMFParser.Translation; using CTFAK.Utils; + namespace CTFAK.GUI { public partial class MainForm : Form @@ -91,6 +92,7 @@ namespace CTFAK.GUI imagesButton.Text = Properties.GlobalStrings.dumpImages; soundsButton.Text = Properties.GlobalStrings.dumpSounds; musicsButton.Text = Properties.GlobalStrings.dumpMusics; + dumpSortedBtn.Text = Properties.GlobalStrings.dumpSorted; FolderBTN.Text=Properties.GlobalStrings.openFolder; @@ -304,17 +306,17 @@ namespace CTFAK.GUI InitKeyTab(); InitPlugins(); var toLog = ""; - toLog += $"Title:{Exe.Instance.GameData.Name}\n"; - toLog += $"Copyright:{Exe.Instance.GameData.Copyright}\n"; + toLog += $"{Properties.Locale.ChunkNames.title}: {Exe.Instance.GameData.Name}\n"; + toLog += $"{Properties.Locale.ChunkNames.copyright}: {Exe.Instance.GameData.Copyright}\n"; //toLog += $"Editor Filename: {Exe.Instance.GameData.EditorFilename}\n"; toLog += $"Product Version: {Exe.Instance.GameData.ProductVersion}\n"; toLog += $"Build: {Exe.Instance.GameData.Build}\n"; toLog += $"Runtime Version: {Exe.Instance.GameData.RuntimeVersion}\n"; - toLog += $"Number Of Images: {Exe.Instance.GameData.Images?.NumberOfItems ?? 0}\n"; - toLog += $"Number Of Sounds: {Exe.Instance.GameData.Sounds?.NumOfItems ?? 0}\n"; - toLog += $"Number Of Musics: {Exe.Instance.GameData.Music?.NumOfItems ?? 0}\n"; - toLog += $"Unique FrameItems: {Exe.Instance.GameData.Frameitems?.NumberOfItems}\n"; - toLog += $"Frame Count: {Exe.Instance.GameData.Frames.Count}\n"; + toLog += $"{Properties.GlobalStrings.imageCount}: {Exe.Instance.GameData.Images?.NumberOfItems ?? 0}\n"; + toLog += $"{Properties.GlobalStrings.soundCount}: {Exe.Instance.GameData.Sounds?.NumOfItems ?? 0}\n"; + toLog += $"{Properties.GlobalStrings.musicCount}: {Exe.Instance.GameData.Music?.NumOfItems ?? 0}\n"; + toLog += $"{Properties.GlobalStrings.frameitemCount}: {Exe.Instance.GameData.Frameitems?.NumberOfItems}\n"; + toLog += $"{Properties.GlobalStrings.frameCount}: {Exe.Instance.GameData.Frames.Count}\n"; toLog += $"Chunks Count: {Exe.Instance.GameData.GameChunks.Chunks.Count}\n"; if (Exe.Instance.GameData.GameChunks.GetChunk() != null) Exe.Instance.GameData.GameChunks.GetChunk().OnImageSaved += UpdateImageBar; @@ -608,43 +610,62 @@ namespace CTFAK.GUI var loader = objInst.FrameItem.Properties.Loader; if (loader is ObjectCommon common) { - if (common.Animations != null) - foreach (var pair in common.Animations.AnimationDict) - { - var animNode = new ChunkNode($"Animation {pair.Key}", pair.Value); - objInstNode.Nodes.Add(animNode); - foreach (var dir in pair.Value.DirectionDict) - if (pair.Value.DirectionDict.Count > 1) - { - var dirNode = new ChunkNode( - $"Direction {pair.Value.DirectionDict.ToList().IndexOf(dir)}", - dir.Value); - animNode.Nodes.Add(dirNode); - for (var a = 0; a < dir.Value.Frames.Count; a++) + if (common.Parent.ObjectType == 2) //Active + { + if (common.Animations != null) + foreach (var pair in common.Animations.AnimationDict) + { + var animNode = new ChunkNode($"Animation {pair.Key}", pair.Value); + objInstNode.Nodes.Add(animNode); + foreach (var dir in pair.Value.DirectionDict) + if (pair.Value.DirectionDict.Count > 1) { - var animFrame = dir.Value.Frames[a]; - bank.Images.TryGetValue(animFrame, out var img); - if (img != null) + var dirNode = new ChunkNode( + $"Direction {pair.Value.DirectionDict.ToList().IndexOf(dir)}", + dir.Value); + animNode.Nodes.Add(dirNode); + for (var a = 0; a < dir.Value.Frames.Count; a++) { - var animFrameNode = new ChunkNode(a.ToString(), img); - dirNode.Nodes.Add(animFrameNode); + var animFrame = dir.Value.Frames[a]; + bank.Images.TryGetValue(animFrame, out var img); + if (img != null) + { + var animFrameNode = new ChunkNode(a.ToString(), img); + dirNode.Nodes.Add(animFrameNode); + } } } - } - else - { - for (var a = 0; a < dir.Value.Frames.Count; a++) + else { - var animFrame = dir.Value.Frames[a]; - bank.Images.TryGetValue(animFrame, out var img); - if (img != null) + for (var a = 0; a < dir.Value.Frames.Count; a++) { - var animFrameNode = new ChunkNode(a.ToString(), img); - animNode.Nodes.Add(animFrameNode); + var animFrame = dir.Value.Frames[a]; + bank.Images.TryGetValue(animFrame, out var img); + if (img != null) + { + var animFrameNode = new ChunkNode(a.ToString(), img); + animNode.Nodes.Add(animFrameNode); + } } } - } + } + } + else if(common.Parent.ObjectType==7)//Counter + { + for (var a = 0; a < common.Counters?.Frames?.Count; a++) + { + var animFrame = common.Counters.Frames[a]; + bank.Images.TryGetValue(animFrame, out var img); + if (img != null) + { + var animFrameNode = new ChunkNode(a.ToString(), img); + objInstNode.Nodes.Add(animFrameNode); + } } + + + } + } else if (loader is Backdrop backdrop) { diff --git a/CTFAK/MMFParser/EXE/ChunkList.cs b/CTFAK/MMFParser/EXE/ChunkList.cs index c13d575..742c02c 100644 --- a/CTFAK/MMFParser/EXE/ChunkList.cs +++ b/CTFAK/MMFParser/EXE/ChunkList.cs @@ -137,19 +137,12 @@ namespace CTFAK.MMFParser.EXE } public void BuildKey() { - - - Settings.AppName=_chunkList.GetChunk()?.Value??""; Settings.Copyright = _chunkList.GetChunk()?.Value??""; Settings.ProjectPath = _chunkList.GetChunk()?.Value??""; - if (Exe.Instance.GameData.ProductBuild > 284)Decryption.MakeKey(Settings.AppName,Settings.Copyright,Settings.ProjectPath); else Decryption.MakeKey(Settings.ProjectPath, Settings.AppName, Settings.Copyright); - - - } } @@ -257,22 +250,18 @@ namespace CTFAK.MMFParser.EXE case 13117: // loader = new Events(chunk);//NOT WORKING break; - - } loader?.Read(); return loader; } - - public T GetChunk() where T : ChunkLoader { foreach (Chunk chunk in Chunks) { if (chunk.Loader != null) { - if (chunk.Loader.GetType().Name == typeof(T).Name) + if (chunk.Loader.GetType() == typeof(T)) { return (T) chunk.Loader; } @@ -288,13 +277,11 @@ namespace CTFAK.MMFParser.EXE var chunk = Chunks[i]; if (chunk.Loader != null) { - if (chunk.Loader.GetType().Name == typeof(T).Name) + if (chunk.Loader.GetType() == typeof(T)) { Chunks.Remove(chunk); return (T) chunk.Loader; } - - } } return null; diff --git a/CTFAK/MMFParser/EXE/Loaders/Banks/SoundBank.cs b/CTFAK/MMFParser/EXE/Loaders/Banks/SoundBank.cs index ebafcea..ce2c9c9 100644 --- a/CTFAK/MMFParser/EXE/Loaders/Banks/SoundBank.cs +++ b/CTFAK/MMFParser/EXE/Loaders/Banks/SoundBank.cs @@ -100,6 +100,7 @@ namespace CTFAK.MMFParser.EXE.Loaders.Banks public override void Read() { + } public SoundBase(ByteReader reader) : base(reader) @@ -122,6 +123,7 @@ namespace CTFAK.MMFParser.EXE.Loaders.Banks public override void Read() { + base.Read(); var start = Reader.Tell(); Handle = (int) Reader.ReadUInt32(); @@ -153,6 +155,7 @@ namespace CTFAK.MMFParser.EXE.Loaders.Banks this.Data = soundData.ReadBytes((int) soundData.Size()); + //Logger.Log("SoundHeader: "+Data.GetHex(4)); if (Settings.DumpSounds) { Name = Helper.CleanInput(Name); diff --git a/CTFAK/MMFParser/EXE/Loaders/Objects/ObjectCommon.cs b/CTFAK/MMFParser/EXE/Loaders/Objects/ObjectCommon.cs index facab62..889f93f 100644 --- a/CTFAK/MMFParser/EXE/Loaders/Objects/ObjectCommon.cs +++ b/CTFAK/MMFParser/EXE/Loaders/Objects/ObjectCommon.cs @@ -6,16 +6,16 @@ namespace CTFAK.MMFParser.EXE.Loaders.Objects { public class ObjectCommon : ChunkLoader { - private short _valuesOffset; - private short _stringsOffset; + private ushort _valuesOffset; + private ushort _stringsOffset; private byte[] Identifier; - private int _fadeinOffset; - private int _fadeoutOffset; + private ushort _fadeinOffset; + private ushort _fadeoutOffset; private ushort _movementsOffset; - private short _animationsOffset; - private short _systemObjectOffset; - public short CounterOffset; - public short ExtensionOffset; + private ushort _animationsOffset; + private ushort _systemObjectOffset; + public ushort _counterOffset; + public ushort _extensionOffset; public Animations Animations; private long _end; @@ -99,46 +99,49 @@ namespace CTFAK.MMFParser.EXE.Loaders.Objects public override void Read() { - if (Parent.ObjectType != 2) return; - long currentPosition = Reader.Tell(); - int size = Reader.ReadInt32(); - bool newobj = Settings.Build >= 284; - if (newobj) + //if(Parent.ObjectType!=2)return; + var currentPosition = Reader.Tell(); + var size = Reader.ReadInt32(); + if (Settings.Build >= 284) { - _animationsOffset = (short) Reader.ReadUInt16(); + _animationsOffset = Reader.ReadUInt16(); _movementsOffset = Reader.ReadUInt16(); + var version = Reader.ReadUInt16(); + Reader.Skip(2); //TODO: Find out + _counterOffset = Reader.ReadUInt16(); + _systemObjectOffset = Reader.ReadUInt16(); } else { _movementsOffset = Reader.ReadUInt16(); - _animationsOffset = Reader.ReadInt16(); + _animationsOffset = Reader.ReadUInt16(); + var version = Reader.ReadUInt16(); + _counterOffset = Reader.ReadUInt16(); + _systemObjectOffset = Reader.ReadUInt16(); } - short version = Reader.ReadInt16(); - CounterOffset = (short) Reader.ReadUInt16(); - _systemObjectOffset = (short) Reader.ReadUInt16(); Flags.flag = Reader.ReadUInt32(); var end = Reader.Tell() + 16; + //Ignoring qualifiers Reader.Seek(end); - if (newobj) + if (Settings.Build == 284) { - _systemObjectOffset = Reader.ReadInt16(); - + _systemObjectOffset = Reader.ReadUInt16(); } else { - ExtensionOffset = Reader.ReadInt16(); + _extensionOffset = Reader.PeekUInt16(); } - - _valuesOffset = Reader.ReadInt16(); - _stringsOffset = Reader.ReadInt16(); - NewFlags.flag = Reader.ReadUInt16(); - preferences.flag = Reader.ReadUInt16(); - byte[] identifier = Reader.ReadFourCc(); - BackColor = Reader.ReadColor(); - _fadeinOffset = Reader.ReadInt32(); - _fadeoutOffset = Reader.ReadInt32(); + _valuesOffset = Reader.ReadUInt16(); + _stringsOffset = Reader.ReadUInt16(); + NewFlags.flag = Reader.ReadUInt32(); + preferences.flag = Reader.ReadUInt32(); + Identifier = Reader.ReadBytes(4); + BackColor = Reader.ReadColor(); + _fadeinOffset = (ushort) Reader.ReadUInt32(); + _fadeoutOffset = (ushort) Reader.ReadUInt32(); + if (_movementsOffset != 0) { Reader.Seek(currentPosition+_movementsOffset); @@ -194,9 +197,9 @@ namespace CTFAK.MMFParser.EXE.Loaders.Objects }*/ - if (_systemObjectOffset > 0) + if (_systemObjectOffset != 0) { - Console.WriteLine("Reading System Object"); + Logger.Log("Reading System Object: "+_systemObjectOffset); Reader.Seek(currentPosition+_systemObjectOffset); if (Parent.ObjectType == ((int) Constants.ObjectType.Text) || Parent.ObjectType == ((int) Constants.ObjectType.Question)) @@ -207,15 +210,20 @@ namespace CTFAK.MMFParser.EXE.Loaders.Objects Parent.ObjectType == ((int) Constants.ObjectType.Lives)|| Parent.ObjectType == ((int) Constants.ObjectType.Counter)) { + Logger.Log("Counter: "+Parent.Name); Counters = new Counters(Reader); Counters.Read(); } } - - - // Console.WriteLine("SysObjOff: " + _systemObjectOffset); - // Console.WriteLine("ExtOff: " + _extensionOffset); + // Logger.Log("anims: "+_animationsOffset); + // Logger.Log("fadeIn: "+_fadeinOffset); + // Logger.Log("fadeOut: "+_fadeoutOffset); + // Logger.Log("movements: "+_movementsOffset); + // Logger.Log("strings: "+_stringsOffset); + // Logger.Log("values: "+_valuesOffset); + // Logger.Log("sysObj: "+_systemObjectOffset); + } public override void Print(bool ext) diff --git a/CTFAK/Program.cs b/CTFAK/Program.cs index 23e2df0..e5b0393 100644 --- a/CTFAK/Program.cs +++ b/CTFAK/Program.cs @@ -1,6 +1,7 @@ using System; using System.Diagnostics; using System.Drawing; +using System.Globalization; using System.IO; using System.Runtime.InteropServices; using System.Threading; @@ -34,10 +35,11 @@ namespace CTFAK // Environment.Exit(0); AppDomain.CurrentDomain.FirstChanceException += (sender, eventArgs) => { - if (eventArgs.Exception is ThreadAbortException) return; + if (eventArgs.Exception is ThreadAbortException) return; + var ex = (Exception) eventArgs.Exception; Logger.Log("ERROR: "); - Logger.Log(eventArgs.Exception.ToString()); + Logger.Log(ex.ToString()); }; Settings.UseGUI = true; diff --git a/CTFAK/Properties/Locale/ChunkNames.Designer.cs b/CTFAK/Properties/Locale/ChunkNames.Designer.cs index fa97838..c8e6690 100644 --- a/CTFAK/Properties/Locale/ChunkNames.Designer.cs +++ b/CTFAK/Properties/Locale/ChunkNames.Designer.cs @@ -79,7 +79,7 @@ namespace CTFAK.Properties.Locale { } /// - /// Looks up a localized string similar to Additinal Frame Item. + /// Looks up a localized string similar to Additional Frame Item. /// internal static string additionalFrameItem { get { @@ -88,7 +88,7 @@ namespace CTFAK.Properties.Locale { } /// - /// Looks up a localized string similar to . + /// Looks up a localized string similar to Additional Object Inst. /// internal static string additionalObjectInstance { get { @@ -97,7 +97,7 @@ namespace CTFAK.Properties.Locale { } /// - /// Looks up a localized string similar to . + /// Looks up a localized string similar to App Doc. /// internal static string appDoc { get { @@ -124,7 +124,7 @@ namespace CTFAK.Properties.Locale { } /// - /// Looks up a localized string similar to . + /// Looks up a localized string similar to Binary Files. /// internal static string binaryFiles { get { @@ -133,7 +133,7 @@ namespace CTFAK.Properties.Locale { } /// - /// Looks up a localized string similar to . + /// Looks up a localized string similar to Bluray Options. /// internal static string blurayOptions { get { @@ -151,7 +151,7 @@ namespace CTFAK.Properties.Locale { } /// - /// Looks up a localized string similar to . + /// Looks up a localized string similar to Demo File Path. /// internal static string demoFilePath { get { @@ -160,7 +160,7 @@ namespace CTFAK.Properties.Locale { } /// - /// Looks up a localized string similar to . + /// Looks up a localized string similar to Demo Version. /// internal static string demoVersion { get { @@ -169,7 +169,7 @@ namespace CTFAK.Properties.Locale { } /// - /// Looks up a localized string similar to . + /// Looks up a localized string similar to EXE Only. /// internal static string exeOnly { get { @@ -187,7 +187,7 @@ namespace CTFAK.Properties.Locale { } /// - /// Looks up a localized string similar to . + /// Looks up a localized string similar to Extented Header. /// internal static string extHeader { get { @@ -196,7 +196,7 @@ namespace CTFAK.Properties.Locale { } /// - /// Looks up a localized string similar to . + /// Looks up a localized string similar to Extension List. /// internal static string extList { get { @@ -205,7 +205,7 @@ namespace CTFAK.Properties.Locale { } /// - /// Looks up a localized string similar to . + /// Looks up a localized string similar to Extra Data. /// internal static string extraData { get { @@ -214,7 +214,7 @@ namespace CTFAK.Properties.Locale { } /// - /// Looks up a localized string similar to . + /// Looks up a localized string similar to Extra Path. /// internal static string extraPath { get { @@ -223,7 +223,7 @@ namespace CTFAK.Properties.Locale { } /// - /// Looks up a localized string similar to . + /// Looks up a localized string similar to Font Bank. /// internal static string fontBank { get { @@ -232,7 +232,7 @@ namespace CTFAK.Properties.Locale { } /// - /// Looks up a localized string similar to . + /// Looks up a localized string similar to Font Offsets. /// internal static string fontOffsets { get { @@ -520,7 +520,7 @@ namespace CTFAK.Properties.Locale { } /// - /// Looks up a localized string similar to . + /// Looks up a localized string similar to Music Bank. /// internal static string musicBank { get { @@ -529,7 +529,7 @@ namespace CTFAK.Properties.Locale { } /// - /// Looks up a localized string similar to . + /// Looks up a localized string similar to Music Offsets. /// internal static string musicOffsets { get { @@ -538,7 +538,7 @@ namespace CTFAK.Properties.Locale { } /// - /// Looks up a localized string similar to . + /// Looks up a localized string similar to MV Timer Base. /// internal static string mvTimerBase { get { @@ -547,7 +547,7 @@ namespace CTFAK.Properties.Locale { } /// - /// Looks up a localized string similar to . + /// Looks up a localized string similar to Object Bank. /// internal static string objectBank { get { @@ -556,7 +556,7 @@ namespace CTFAK.Properties.Locale { } /// - /// Looks up a localized string similar to . + /// Looks up a localized string similar to Object Bank 2. /// internal static string objectBank2 { get { @@ -565,7 +565,7 @@ namespace CTFAK.Properties.Locale { } /// - /// Looks up a localized string similar to . + /// Looks up a localized string similar to Object Common. /// internal static string objectCommon { get { @@ -574,7 +574,7 @@ namespace CTFAK.Properties.Locale { } /// - /// Looks up a localized string similar to . + /// Looks up a localized string similar to Object Effects. /// internal static string objectEffects { get { @@ -583,7 +583,7 @@ namespace CTFAK.Properties.Locale { } /// - /// Looks up a localized string similar to . + /// Looks up a localized string similar to Object Header. /// internal static string objectHeader { get { @@ -592,7 +592,7 @@ namespace CTFAK.Properties.Locale { } /// - /// Looks up a localized string similar to . + /// Looks up a localized string similar to Object Name. /// internal static string objectName { get { @@ -601,7 +601,7 @@ namespace CTFAK.Properties.Locale { } /// - /// Looks up a localized string similar to . + /// Looks up a localized string similar to Object Unknown. /// internal static string objectUnknown { get { @@ -610,7 +610,7 @@ namespace CTFAK.Properties.Locale { } /// - /// Looks up a localized string similar to . + /// Looks up a localized string similar to Other Extensions. /// internal static string otherExts { get { @@ -619,7 +619,7 @@ namespace CTFAK.Properties.Locale { } /// - /// Looks up a localized string similar to . + /// Looks up a localized string similar to Output Path. /// internal static string outputPath { get { @@ -628,7 +628,7 @@ namespace CTFAK.Properties.Locale { } /// - /// Looks up a localized string similar to . + /// Looks up a localized string similar to Project Path. /// internal static string projectPath { get { @@ -637,7 +637,7 @@ namespace CTFAK.Properties.Locale { } /// - /// Looks up a localized string similar to . + /// Looks up a localized string similar to Protection. /// internal static string protection { get { @@ -646,7 +646,7 @@ namespace CTFAK.Properties.Locale { } /// - /// Looks up a localized string similar to . + /// Looks up a localized string similar to Random Seed. /// internal static string randomSeed { get { @@ -655,7 +655,7 @@ namespace CTFAK.Properties.Locale { } /// - /// Looks up a localized string similar to . + /// Looks up a localized string similar to Security Number. /// internal static string secNum { get { @@ -664,7 +664,7 @@ namespace CTFAK.Properties.Locale { } /// - /// Looks up a localized string similar to . + /// Looks up a localized string similar to Shaders. /// internal static string shaders { get { @@ -673,7 +673,7 @@ namespace CTFAK.Properties.Locale { } /// - /// Looks up a localized string similar to . + /// Looks up a localized string similar to Sound Bank. /// internal static string soundBank { get { @@ -682,7 +682,7 @@ namespace CTFAK.Properties.Locale { } /// - /// Looks up a localized string similar to . + /// Looks up a localized string similar to Sound Offsets. /// internal static string soundOffsets { get { @@ -700,7 +700,7 @@ namespace CTFAK.Properties.Locale { } /// - /// Looks up a localized string similar to . + /// Looks up a localized string similar to Unknown-. /// internal static string unknown { get { diff --git a/CTFAK/Properties/Locale/ChunkNames.en-us.resx b/CTFAK/Properties/Locale/ChunkNames.en-us.resx index 536cd90..697e7b0 100644 --- a/CTFAK/Properties/Locale/ChunkNames.en-us.resx +++ b/CTFAK/Properties/Locale/ChunkNames.en-us.resx @@ -47,4 +47,184 @@ Frame Effects + + Unknown- + + + Sound Offsets + + + Additional Object Inst + + + App Doc + + + Binary Files + + + Bluray Options + + + Demo File Path + + + Demo Version + + + EXE Only + + + Extented Header + + + Extension List + + + Extra Data + + + Extra Path + + + Font Bank + + + Font Offsets + + + Frame Fade In + + + Frame Fade In Frame + + + Frame Fade Out + + + Frame Fade Out Frame + + + Frame Handles + + + Frame Header + + + Frame IPhone Options + + + Frame Layer Effects + + + Frame Layers + + + Frame Objects + + + Frame Palette + + + Frame Password + + + Frame Play Header + + + Frame Virtual Rect + + + Global Events + + + Global String Names + + + Global Strings + + + Global Value Names + + + Global Values + + + Icon + + + Image Bank + + + Image Offsets + + + Last + + + Menu + + + Menu Images + + + Mini Header + + + Mosaic Image Table + + + Music Bank + + + Music Offsets + + + MV Timer Base + + + Object Bank + + + Object Bank 2 + + + Object Common + + + Object Effects + + + Object Header + + + Object Name + + + Object Unknown + + + Other Extensions + + + Output Path + + + Project Path + + + Protection + + + Random Seed + + + Security Number + + + Shaders + + + Sound Bank + \ No newline at end of file diff --git a/CTFAK/Properties/Locale/ChunkNames.resx b/CTFAK/Properties/Locale/ChunkNames.resx index 26f95e8..2e51635 100644 --- a/CTFAK/Properties/Locale/ChunkNames.resx +++ b/CTFAK/Properties/Locale/ChunkNames.resx @@ -34,13 +34,13 @@ Menu - + Extra Path Extensions - + Object Bank Global Events @@ -49,22 +49,22 @@ Frame Handles - + Extra Data Additional Extensions - + Project Path - + Output Path - + App Doc - + Other Extensions Global Values @@ -73,19 +73,19 @@ Global Strings - + Extension List Icon - + Demo Version - + Security Number - + Binary Files Menu Images @@ -103,19 +103,19 @@ Global String Names - + Object Bank 2 - + EXE Only - + Protection - + Shaders - + Extented Header Frame @@ -154,10 +154,10 @@ Frame Play Header - Additinal Frame Item + Additional Frame Item - + Additional Object Inst Frame Layers @@ -166,19 +166,19 @@ Frame Virtual Rect - + Demo File Path - + Random Seed Frame Layer Effects - + Bluray Options - + MV Timer Base Mosaic Image Table @@ -190,48 +190,48 @@ Frame IPhone Options - + Object Header - + Object Name - + Object Common - + Object Unknown - + Object Effects Image Offsets - + Font Offsets - + Sound Offsets - + Music Offsets Image Bank - + Font Bank - + Sound Bank - + Music Bank Last - + Unknown- \ No newline at end of file diff --git a/CTFAK/Properties/Locale/ChunkNames.ru-ru.resx b/CTFAK/Properties/Locale/ChunkNames.ru-ru.resx index 626c18d..8d107b0 100644 --- a/CTFAK/Properties/Locale/ChunkNames.ru-ru.resx +++ b/CTFAK/Properties/Locale/ChunkNames.ru-ru.resx @@ -24,7 +24,7 @@ Автор - Copyright + Копирайт Название Сцены @@ -44,4 +44,187 @@ События Сцены + + Неизвестный- + + + Смещения звуков + + + Дополнительный инстанс сцены помогите + + + Документация + + + Бинарные файлы + + + Настройки Bluray + + + Путь к демо-файлу + + + Демо + + + Только для exe + + + Расширенный заголовок + + + Список расширений + + + Дополнительные данные + + + Дополнительный путь + + + Шрифты + + + Смещения шрифтов + + + Эффекты Сцены + + + Вход Сцены + + + Кадр Входа Сцены + + + Выход Сцены + + + Кадр Выхода Сцены + + + Идентификаторы Сцен + + + Заголовок Сцены + + + Настройки айфона? + + + Эффекты слоев сцены + + + Слои Сцены + + + Объекты Сцены + + + Палитра Сцены + + + Пароль Сцены + + + Заголовок воспроизведения + + + Виртуальный член сцены + + + Глобальные события + + + Названия глобальных строк + + + Глобальные строки + + + Названия глобальных чисел + + + Глобальные числа + + + Иконка + + + Изображения + + + Смещения изображений + + + Последний чанк + + + Меню + + + Изображения меню + + + Мини заголовок + + + мозайка какая-то + + + Музыка + + + Смещения музыки + + + База таймера + + + Объекты + + + Объекты 2 + + + Данные Объекта + + + Эффекты Объекта + + + Заголовок Объекта + + + Название Объекта + + + Неизвестная часть объекта + + + Дополнительные Расширения + + + Выходной путь + + + Путь проекта + + + Защита + + + Рандомное семя + + + Защитное число + + + Шейдеры + + + Звуки + \ No newline at end of file diff --git a/CTFAK/Properties/Locale/GlobalStrings.Designer.cs b/CTFAK/Properties/Locale/GlobalStrings.Designer.cs index a192f70..f961a19 100644 --- a/CTFAK/Properties/Locale/GlobalStrings.Designer.cs +++ b/CTFAK/Properties/Locale/GlobalStrings.Designer.cs @@ -105,6 +105,24 @@ namespace CTFAK.Properties { } } + /// + /// Looks up a localized string similar to Frame Count. + /// + internal static string frameCount { + get { + return ResourceManager.GetString("frameCount", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Unique FrameItems. + /// + internal static string frameitemCount { + get { + return ResourceManager.GetString("frameitemCount", resourceCulture); + } + } + /// /// Looks up a localized string similar to Copyright. /// @@ -123,6 +141,15 @@ namespace CTFAK.Properties { } } + /// + /// Looks up a localized string similar to Number of Images. + /// + internal static string imageCount { + get { + return ResourceManager.GetString("imageCount", resourceCulture); + } + } + /// /// Looks up a localized string similar to Loading. /// @@ -132,6 +159,15 @@ namespace CTFAK.Properties { } } + /// + /// Looks up a localized string similar to Number of Musics. + /// + internal static string musicCount { + get { + return ResourceManager.GetString("musicCount", resourceCulture); + } + } + /// /// Looks up a localized string similar to Open Dump Folder. /// @@ -158,5 +194,14 @@ namespace CTFAK.Properties { return ResourceManager.GetString("selectFile", resourceCulture); } } + + /// + /// Looks up a localized string similar to Number of Sounds. + /// + internal static string soundCount { + get { + return ResourceManager.GetString("soundCount", resourceCulture); + } + } } } diff --git a/CTFAK/Properties/Locale/GlobalStrings.en-us.resx b/CTFAK/Properties/Locale/GlobalStrings.en-us.resx index ae8d66f..1c52631 100644 --- a/CTFAK/Properties/Locale/GlobalStrings.en-us.resx +++ b/CTFAK/Properties/Locale/GlobalStrings.en-us.resx @@ -44,4 +44,19 @@ Reading Frame: + + Number of Images + + + Number of Musics + + + Number of Sounds + + + Frame Count + + + Unique FrameItems + \ No newline at end of file diff --git a/CTFAK/Properties/Locale/GlobalStrings.resx b/CTFAK/Properties/Locale/GlobalStrings.resx index 20ce339..fa1a8d0 100644 --- a/CTFAK/Properties/Locale/GlobalStrings.resx +++ b/CTFAK/Properties/Locale/GlobalStrings.resx @@ -51,4 +51,19 @@ Reading Frame: + + Number of Images + + + Number of Sounds + + + Number of Musics + + + Frame Count + + + Unique FrameItems + \ No newline at end of file diff --git a/CTFAK/Properties/Locale/GlobalStrings.ru-ru.resx b/CTFAK/Properties/Locale/GlobalStrings.ru-ru.resx index f5d3e26..a144a30 100644 --- a/CTFAK/Properties/Locale/GlobalStrings.ru-ru.resx +++ b/CTFAK/Properties/Locale/GlobalStrings.ru-ru.resx @@ -21,7 +21,7 @@ Сохранить Музыку - Сохранение с сортировкой + Сохранить Картинки с сортировкой Сохранить звуки @@ -44,4 +44,19 @@ Чтение сцены: + + Количество Картинок + + + Количество Музыки + + + Количество Звуков + + + Количество Сцен + + + Уникальных Объектов + \ No newline at end of file diff --git a/CTFAK/Utils/Decryption.cs b/CTFAK/Utils/Decryption.cs index c7fe265..86caa8b 100644 --- a/CTFAK/Utils/Decryption.cs +++ b/CTFAK/Utils/Decryption.cs @@ -26,50 +26,17 @@ namespace CTFAK.Utils public static void MakeKey(string data1, string data2, string data3) { - var russian = false; - IntPtr keyPtr=new IntPtr(); - if (russian) - { - - - var fixed1 = FixString(Encoding.Unicode.GetBytes(data1)); - var data1Ptr = Marshal.AllocHGlobal(fixed1.Length); - Marshal.Copy(fixed1,0,data1Ptr,fixed1.Length); - - var fixed2 = FixString(Encoding.Unicode.GetBytes(data2)); - var data2Ptr = Marshal.AllocHGlobal(fixed2.Length); - Marshal.Copy(fixed2,0,data2Ptr,fixed2.Length); - - var fixed3 = FixString(Encoding.Unicode.GetBytes(data3)); - var data3Ptr = Marshal.AllocHGlobal(fixed3.Length); - Marshal.Copy(fixed3,0,data1Ptr,fixed3.Length); - - - keyPtr = make_key_w(data1Ptr,data2Ptr,data3Ptr,MagicChar); - Marshal.FreeHGlobal(data1Ptr); - Marshal.FreeHGlobal(data2Ptr); - Marshal.FreeHGlobal(data3Ptr); - } - else - { - var rawKey = ""; - rawKey += data1; - rawKey += data2; - rawKey += data3; - Logger.Log("Combined data " + rawKey, true, ConsoleColor.Yellow); - keyPtr = Marshal.StringToHGlobalAnsi(rawKey); - keyPtr = make_key_combined(keyPtr, MagicChar); - - - } + IntPtr keyPtr; + var combined = ""; + combined += data1; + combined += data2; + combined += data3; + Logger.Log("Combined data " + combined, true, ConsoleColor.Yellow); + keyPtr = Marshal.StringToHGlobalAnsi(combined); + keyPtr = make_key_combined(keyPtr, MagicChar); byte[] key = new byte[256]; Marshal.Copy(keyPtr, key, 0, 256); _decryptionKey = key; - - - - - Logger.Log($"First 16-Bytes of key: {_decryptionKey.GetHex(16)}", true, ConsoleColor.Yellow); Logger.Log(Encoding.Unicode.GetString(_decryptionKey)); File.WriteAllBytes($"{Settings.DumpPath}\\key.bin", _decryptionKey); diff --git a/CTFAK/Utils/Logger.cs b/CTFAK/Utils/Logger.cs index 2123345..66353d3 100644 --- a/CTFAK/Utils/Logger.cs +++ b/CTFAK/Utils/Logger.cs @@ -7,6 +7,13 @@ namespace CTFAK.Utils public static class Logger { static StreamWriter _writer; + + public static void Log(object text, bool logToScreen = true, ConsoleColor color = ConsoleColor.White, + bool logToConsole = true) + { + Log(text.ToString(), logToScreen, color, logToConsole); + + } public static void Log(string text, bool logToScreen = true,ConsoleColor color = ConsoleColor.White, bool logToConsole=true) {