diff --git a/exeinfo/exeinfo.csproj b/exeinfo/exeinfo.csproj index 311bbf0..12afa71 100644 --- a/exeinfo/exeinfo.csproj +++ b/exeinfo/exeinfo.csproj @@ -30,8 +30,8 @@ x86 - - ..\packages\Claunia.Encoding.1.5.0\lib\portable40-net40+sl5+win8+wp8\Claunia.Encoding.dll + + ..\packages\Claunia.Encoding.1.6.1\lib\portable40-net40+sl5+win8+wp8\Claunia.Encoding.dll diff --git a/exeinfo/packages.config b/exeinfo/packages.config index ac08640..f9f8751 100644 --- a/exeinfo/packages.config +++ b/exeinfo/packages.config @@ -1,4 +1,4 @@  - + \ No newline at end of file diff --git a/exeinfogui/exeinfogui.csproj b/exeinfogui/exeinfogui.csproj index 0ae3a11..03dcaa7 100644 --- a/exeinfogui/exeinfogui.csproj +++ b/exeinfogui/exeinfogui.csproj @@ -8,7 +8,7 @@ Description of exeinfogui - + diff --git a/libexeinfo/Geos/Geos.cs b/libexeinfo/Geos/Geos.cs index bac3052..19ba972 100644 --- a/libexeinfo/Geos/Geos.cs +++ b/libexeinfo/Geos/Geos.cs @@ -28,6 +28,7 @@ using System; using System.Collections.Generic; using System.IO; using System.Runtime.InteropServices; +using System.Text; namespace libexeinfo { @@ -36,6 +37,7 @@ namespace libexeinfo ApplicationHeader applicationHeader; ApplicationHeaderV2 applicationHeader2; Export[] exports; + Encoding geosEncoding = Claunia.Encoding.Encoding.GeosEncoding; GeodeHeader header; GeodeHeaderV2 header2; Import[] imports; @@ -82,7 +84,6 @@ namespace libexeinfo public IEnumerable Strings { get; private set; } public IEnumerable Segments { get; private set; } - // TODO: GEOS character set void Initialize() { Recognized = false; @@ -104,9 +105,9 @@ namespace libexeinfo List strings = new List { - StringHandlers.CToString(isNewHeader ? header2.name : header.name), - StringHandlers.CToString(isNewHeader ? header2.copyright : header.copyright), - StringHandlers.CToString(isNewHeader ? header2.info : header.info) + StringHandlers.CToString(isNewHeader ? header2.name : header.name, geosEncoding), + StringHandlers.CToString(isNewHeader ? header2.copyright : header.copyright, geosEncoding), + StringHandlers.CToString(isNewHeader ? header2.info : header.info, geosEncoding) }; uint segmentBase = 0; @@ -121,7 +122,7 @@ namespace libexeinfo imports = new Import[applicationHeader2.imports]; exports = new Export[applicationHeader2.exports]; segments = new SegmentDescriptor[applicationHeader2.segments]; - strings.Add($"{StringHandlers.CToString(applicationHeader2.name).Trim()}.{StringHandlers.CToString(applicationHeader2.extension).Trim()}"); + strings.Add($"{StringHandlers.CToString(applicationHeader2.name, geosEncoding).Trim()}.{StringHandlers.CToString(applicationHeader2.extension, geosEncoding).Trim()}"); } else { @@ -132,7 +133,7 @@ namespace libexeinfo imports = new Import[applicationHeader.imports]; exports = new Export[applicationHeader.exports]; segments = new SegmentDescriptor[applicationHeader.segments]; - strings.Add($"{StringHandlers.CToString(applicationHeader.name).Trim()}.{StringHandlers.CToString(applicationHeader.extension).Trim()}"); + strings.Add($"{StringHandlers.CToString(applicationHeader.name, geosEncoding).Trim()}.{StringHandlers.CToString(applicationHeader.extension, geosEncoding).Trim()}"); } buffer = new byte[Marshal.SizeOf(typeof(Import))]; @@ -140,7 +141,7 @@ namespace libexeinfo { BaseStream.Read(buffer, 0, buffer.Length); imports[i] = BigEndianMarshal.ByteArrayToStructureLittleEndian(buffer); - strings.Add(StringHandlers.CToString(imports[i].name).Trim()); + strings.Add(StringHandlers.CToString(imports[i].name, geosEncoding).Trim()); } buffer = new byte[Marshal.SizeOf(typeof(Export))]; diff --git a/libexeinfo/Geos/Info.cs b/libexeinfo/Geos/Info.cs index 7ad6170..a5b7b17 100644 --- a/libexeinfo/Geos/Info.cs +++ b/libexeinfo/Geos/Info.cs @@ -43,39 +43,42 @@ namespace libexeinfo sb.AppendFormat("\tAttributes: {0}", isNewHeader ? applicationHeader2.attributes : applicationHeader.attributes) .AppendLine(); - sb.AppendFormat("\tName: {0}", StringHandlers.CToString(isNewHeader ? header2.name : header.name)) + sb.AppendFormat("\tName: {0}", + StringHandlers.CToString(isNewHeader ? header2.name : header.name, geosEncoding)) .AppendLine(); sb.AppendFormat("\tInternal name: \"{0}.{1}\"", isNewHeader - ? StringHandlers.CToString(applicationHeader2.name).Trim() - : StringHandlers.CToString(applicationHeader.name).Trim(), + ? StringHandlers.CToString(applicationHeader2.name, geosEncoding).Trim() + : StringHandlers.CToString(applicationHeader.name, geosEncoding).Trim(), isNewHeader - ? StringHandlers.CToString(applicationHeader2.extension).Trim() - : StringHandlers.CToString(applicationHeader.extension).Trim()).AppendLine(); + ? StringHandlers.CToString(applicationHeader2.extension, geosEncoding).Trim() + : StringHandlers.CToString(applicationHeader.extension, geosEncoding).Trim()) + .AppendLine(); sb.AppendFormat("\tVersion: {0}", isNewHeader ? $"{header2.release.major}.{header2.release.minor} {header2.release.change}-{header2.release.engineering}" : $"{header.release.major}.{header.release.minor} {header.release.change}-{header.release.engineering}") .AppendLine(); sb.AppendFormat("\tCopyright string: {0}", - StringHandlers.CToString(isNewHeader ? header2.copyright : header.copyright)) - .AppendLine(); + StringHandlers.CToString(isNewHeader ? header2.copyright : header.copyright, + geosEncoding)).AppendLine(); sb.AppendFormat("\tInformational string: {0}", - StringHandlers.CToString(isNewHeader ? header2.info : header.info)).AppendLine(); + StringHandlers.CToString(isNewHeader ? header2.info : header.info, geosEncoding)) + .AppendLine(); sb.AppendFormat("\tProtocol: {0}", isNewHeader ? $"{header2.protocol.major}.{header2.protocol.minor}" : $"{header.protocol.major}.{header.protocol.minor}").AppendLine(); sb.AppendFormat("\tApplication token: \"{0}\" id {1}", isNewHeader - ? StringHandlers.CToString(header2.application.str) - : StringHandlers.CToString(header.creator.str), + ? StringHandlers.CToString(header2.application.str, geosEncoding) + : StringHandlers.CToString(header.creator.str, geosEncoding), isNewHeader ? header2.application.manufacturer : header.creator.manufacturer) .AppendLine(); sb.AppendFormat("\tToken: \"{0}\" id {1}", isNewHeader - ? StringHandlers.CToString(header2.token.str) - : StringHandlers.CToString(header.token.str), + ? StringHandlers.CToString(header2.token.str, geosEncoding) + : StringHandlers.CToString(header.token.str, geosEncoding), isNewHeader ? header2.token.manufacturer : header.token.manufacturer).AppendLine(); sb.AppendFormat("\tSegments: {0}", @@ -88,8 +91,9 @@ namespace libexeinfo sb.AppendFormat("\t{0} imports:", imports.Length).AppendLine(); for(int i = 0; i < imports.Length; i++) sb.AppendFormat("\t\tImport \"{0}\", attributes {1}, protocol {2}.{3}", - StringHandlers.CToString(imports[i].name).Trim(), imports[i].attributes, - imports[i].protocol.major, imports[i].protocol.minor).AppendLine(); + StringHandlers.CToString(imports[i].name, geosEncoding).Trim(), + imports[i].attributes, imports[i].protocol.major, imports[i].protocol.minor) + .AppendLine(); sb.AppendFormat("\t{0} exports:", exports.Length).AppendLine(); for(int i = 0; i < exports.Length; i++) diff --git a/libexeinfo/libexeinfo.csproj b/libexeinfo/libexeinfo.csproj index 3d94e79..f24f2a3 100644 --- a/libexeinfo/libexeinfo.csproj +++ b/libexeinfo/libexeinfo.csproj @@ -40,8 +40,8 @@ false - - ..\packages\Claunia.Encoding.1.5.0\lib\portable40-net40+sl5+win8+wp8\Claunia.Encoding.dll + + ..\packages\Claunia.Encoding.1.6.1\lib\portable40-net40+sl5+win8+wp8\Claunia.Encoding.dll diff --git a/libexeinfo/packages.config b/libexeinfo/packages.config index ae611d7..c326bb7 100644 --- a/libexeinfo/packages.config +++ b/libexeinfo/packages.config @@ -1,6 +1,6 @@  - + \ No newline at end of file