From 031277071db6fff872a5536cc15699cc65c3d9ed Mon Sep 17 00:00:00 2001 From: Bluzume <39113159+KuromeSan@users.noreply.github.com> Date: Wed, 18 Aug 2021 02:35:49 +1200 Subject: [PATCH] Fix more Locale related issues. --- .vs/AppInfoParser/v16/.suo | Bin 79872 -> 79872 bytes AppInfoCli/CXMLBuilder.cs | 24 ++++++++++++------------ AppInfoCli/CXMLReader.cs | 12 ++++++------ 3 files changed, 18 insertions(+), 18 deletions(-) diff --git a/.vs/AppInfoParser/v16/.suo b/.vs/AppInfoParser/v16/.suo index 2be95d48b7e6759efa33b8a31335492f96a76b2d..69557e86d34494d70d5267334bfeea33d59912f5 100644 GIT binary patch delta 3687 zcmbtWdr(y86~E{1U0B{Muf=6S#0^nkVIMpVn2iuki~&|eGu1FI4-*?TiCtPDR<5J* zi4pcF*Hmrjnt_f zo^yWpd!5Jk?I(^4;<(UK7@Np(oQg0tJv~iA(Oq4R1U|ex@P$uZ_!;CAYp=vcezhi* zRDpm~g-c)^PVh}|6zf%`YFNzJe-~zi#Q?_z2a-iC0zpWCsaEI01!gjH2(-%dVV_JU zdAijR-4x{`*hki~eYSND&z5H2n@OIS^DWY6Cy|Wt>6s+iR&0cHLLR|HFcK_;0)m6% z)XJndwlbq~H8E@je|wJX=Y3o$$ua_q6l-fquOO@=R1#hw%zT-i{+>_YNOCi|sCAN3 z<0ETHzTWDvJy!1{{G)zIcH1iFEVZ!o}l%xWQ7gi0p?>Nz=V4@h_#J8SeTF z=8)g1IN}Y2P(lJBo}eZK5&UCANZ(Be_Hh!)XhHyC0U?~gQo4|!<+$Zs7%6P9&L>ky zzDRh?XD=c7V?rBYDItxJL11IDuuJ%jz_y1jwNZG9Xgs4fT6X%r|A6F=2!3bSm|bKy z5Z)j#TTe0-{~1)Q4yWpjKufR=%Y(xQaLu!SZ{5DD4eiX2v7J(blJ+VUsu!}{tVzyOa{6l zn%(*mp_qNAQ-vCRii4nt z7@O(t*m+Ma|4_*enoYKRw@$^olPDIx zba$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;e!4I5T>-6_A%QI9= zGjj!Vri+%z0e@FHMpL%aBf9hBi~R=5b_8V9_KGt+CR1eM~j9S&gdaN2;CZVB== zY4K-`T^y30qvB=XMS)X>Er$0o^>;oMEvA+;}GNEC85q$Rl J!jU3c`EQvh!xsPm diff --git a/AppInfoCli/CXMLBuilder.cs b/AppInfoCli/CXMLBuilder.cs index 0090f11..e0a3d45 100644 --- a/AppInfoCli/CXMLBuilder.cs +++ b/AppInfoCli/CXMLBuilder.cs @@ -44,7 +44,7 @@ namespace CXMLDecompiler { GetSilicaTypingInformation(XMLFile); MagicNumber = GetTypingInformation("MAGIC"); - Version = int.Parse(GetTypingInformation("VERSION")); + Version = Int32.Parse(GetTypingInformation("VERSION"), CultureInfo.InvariantCulture); InfoFile = File.Open(CxmlFile, FileMode.OpenOrCreate, FileAccess.ReadWrite); InfoFile.SetLength(0); @@ -336,7 +336,7 @@ namespace CXMLDecompiler public AttributeType DetermineType(string ElementName, string AttributeName) { - return (AttributeType)int.Parse(GetTypingInformation(ElementName + ":" + AttributeName)); + return (AttributeType)Int32.Parse(GetTypingInformation(ElementName + ":" + AttributeName), CultureInfo.InvariantCulture); } public void WriteAttribute(XmlAttribute attribute, MemoryStream WorkRam, BinaryWriter bWorkRam, string ElementName) { @@ -352,13 +352,13 @@ namespace CXMLDecompiler Console.ReadKey(); break; case AttributeType.TYPE_INT: - int intWrite = Int32.Parse(attribute.Value); + int intWrite = Int32.Parse(attribute.Value, CultureInfo.InvariantCulture); bWorkRam.Write((int)intWrite); bWorkRam.Write((int)0x00); Console.WriteLine("Int - Value: " + intWrite.ToString()); break; case AttributeType.TYPE_FLOAT: - float FloatValue = Single.Parse(attribute.Value.Substring(0, attribute.Value.Length - 1)); + float FloatValue = Single.Parse(attribute.Value.Substring(0, attribute.Value.Length - 1), CultureInfo.InvariantCulture); bWorkRam.Write((float)FloatValue); bWorkRam.Write((int)0x00); Console.WriteLine("Float - Value: " + FloatValue.ToString()); @@ -378,10 +378,10 @@ namespace CXMLDecompiler Console.WriteLine("Char: " + attribute.Value); break; case AttributeType.TYPE_HASH_ID: - int hashId = int.Parse(attribute.Value, NumberStyles.HexNumber); + int hashId = Int32.Parse(attribute.Value, NumberStyles.HexNumber, CultureInfo.InvariantCulture); if (HashStrings) - hashId = int.Parse(Tools.GenerateShortHash(Encoding.UTF8.GetBytes(attribute.Value)), NumberStyles.HexNumber); + hashId = Int32.Parse(Tools.GenerateShortHash(Encoding.UTF8.GetBytes(attribute.Value)), NumberStyles.HexNumber, CultureInfo.InvariantCulture); int HashTableOffset = AddGetHashIdTable(hashId); int HashTableSize = 4; @@ -393,7 +393,7 @@ namespace CXMLDecompiler string[] arr = attribute.Value.Replace("[", "").Replace("]", "").Replace(" ", "").Split(','); int[] intArr = new int[arr.Length]; for (int i = 0; i < intArr.Length; i++) - intArr[i] = int.Parse(arr[i]); + intArr[i] = Int32.Parse(arr[i], CultureInfo.InvariantCulture); int IntArrayOffset = AddGetIntArrayTable(intArr); int IntArraySize = intArr.Length; @@ -406,7 +406,7 @@ namespace CXMLDecompiler arr = attribute.Value.Replace("[", "").Replace("]", "").Replace(" ", "").Replace("f", "").Split(','); float[] floatArr = new float[arr.Length]; for (int i = 0; i < floatArr.Length; i++) - floatArr[i] = float.Parse(arr[i]); + floatArr[i] = Single.Parse(arr[i], CultureInfo.InvariantCulture); int FloatArrayOffset = AddGetFloatArrayTable(floatArr); int FloatArraySize = floatArr.Length; @@ -438,9 +438,9 @@ namespace CXMLDecompiler Console.WriteLine("ID String: " + StringIdTableOffset + " sz: 0"); break; case AttributeType.TYPE_ID_INT_LOOPBACK: - int hash = int.Parse(attribute.Value, NumberStyles.HexNumber); + int hash = Int32.Parse(attribute.Value, NumberStyles.HexNumber, CultureInfo.InvariantCulture); if (HashStrings) - hash = int.Parse(Tools.GenerateShortHash(Encoding.UTF8.GetBytes(attribute.Value)), NumberStyles.HexNumber); + hash = Int32.Parse(Tools.GenerateShortHash(Encoding.UTF8.GetBytes(attribute.Value)), NumberStyles.HexNumber, CultureInfo.InvariantCulture); int IntIdTableOffset = AddGetIntIdTable(hash, Convert.ToInt32(TreeTable.Position)); bWorkRam.Write(IntIdTableOffset); bWorkRam.Write((int)0x00); @@ -448,9 +448,9 @@ namespace CXMLDecompiler Console.WriteLine("Loopback ID Int: " + IntIdTableOffset + " sz: 0"); break; case AttributeType.TYPE_ID_INT: - hash = int.Parse(attribute.Value, NumberStyles.HexNumber); + hash = Int32.Parse(attribute.Value, NumberStyles.HexNumber, CultureInfo.InvariantCulture); if (HashStrings) - hash = int.Parse(Tools.GenerateShortHash(Encoding.UTF8.GetBytes(attribute.Value)), NumberStyles.HexNumber); + hash = Int32.Parse(Tools.GenerateShortHash(Encoding.UTF8.GetBytes(attribute.Value)), NumberStyles.HexNumber, CultureInfo.InvariantCulture); IntIdTableOffset = AddGetIntIdTable(hash, -1); bWorkRam.Write(IntIdTableOffset); diff --git a/AppInfoCli/CXMLReader.cs b/AppInfoCli/CXMLReader.cs index 8ece126..ea2213e 100644 --- a/AppInfoCli/CXMLReader.cs +++ b/AppInfoCli/CXMLReader.cs @@ -414,7 +414,7 @@ namespace CXML int bytesRemaining = Convert.ToInt32(InfoFile.Length - InfoFile.Position); if (bytesRemaining > 0) // Some RCS files have unexplainable random XML Data at the end of them, Dont ask me. im just the messanger { - Console.WriteLine(bytesRemaining.ToString("X8") + " Excess Bytes Found, Shoving it in SilicaTypingInformation."); + Console.WriteLine(bytesRemaining.ToString("X8", CultureInfo.InvariantCulture) + " Excess Bytes Found, Shoving it in SilicaTypingInformation."); byte[] ExcessData = new byte[bytesRemaining]; InfoFile.Read(ExcessData, 0x00, bytesRemaining); byte[] Compressed = ZlibStream.CompressBuffer(ExcessData); @@ -557,7 +557,7 @@ namespace CXML public void RegisterFile(Int64 ElementPtr, String NewName, Boolean FileEntry, String IdealName=null) { - Console.WriteLine("Adding Entry for Loopback: 0x" + ElementPtr.ToString("X8") + " (" + NewName + ")"); + Console.WriteLine("Adding Entry for Loopback: 0x" + ElementPtr.ToString("X8", CultureInfo.InvariantCulture) + " (" + NewName + ")"); for(int i = 0; i < FileList.Count; i++) { if(FileList[i].FilePointer == ElementPtr) @@ -745,9 +745,9 @@ namespace CXML int IDValue = bIntIDTable.ReadInt32(); LoopbackAttribute = Tools.ReadStringAt(StringTable, StringPtr); - Console.WriteLine("Int Loopback: " + LoopbackAttribute + " " + LoopbackPtr.ToString("X") + " (" + ElementPtr.ToString("X") + ")"); + Console.WriteLine("Int Loopback: " + LoopbackAttribute + " " + LoopbackPtr.ToString("X", CultureInfo.InvariantCulture) + " (" + ElementPtr.ToString("X") + ")"); - AttributeValue = IDValue.ToString("X8"); + AttributeValue = IDValue.ToString("X8", CultureInfo.InvariantCulture); RegisterFile(LoopbackPtr, AttributeValue.ToString(), false); Console.WriteLine("Loopback Int: " + IntIdTableOffset + " sz: " + bTreeTable.ReadInt32()); @@ -757,7 +757,7 @@ namespace CXML IntIDTable.Seek(IntIdTableOffset + 4, SeekOrigin.Begin); IDValue = bIntIDTable.ReadInt32(); - AttributeValue = IDValue.ToString("X8"); + AttributeValue = IDValue.ToString("X8", CultureInfo.InvariantCulture); Console.WriteLine("Int Id: " + IntIdTableOffset + " sz: " + bTreeTable.ReadInt32()); break; default: @@ -766,7 +766,7 @@ namespace CXML break; }; - AddTypingInfo(ElementName + ":" + AttributeName, ((int)Type).ToString()); + AddTypingInfo(ElementName + ":" + AttributeName, ((int)Type).ToString(CultureInfo.InvariantCulture)); Console.WriteLine(AttributeName + "=" + AttributeValue.ToString()); XMLFile.WriteAttributeString(AttributeName, AttributeValue.ToString()); XMLFile.Flush();