From 073fb1d0414ff86fa4fbd80b58aac0b75701d718 Mon Sep 17 00:00:00 2001 From: KN4CK3R Date: Sat, 6 Apr 2019 23:50:23 +0200 Subject: [PATCH 001/223] Fixed logic error. --- ReClass.NET/AddressParser/TokenReader.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ReClass.NET/AddressParser/TokenReader.cs b/ReClass.NET/AddressParser/TokenReader.cs index d3abb4bc..d6e5d020 100644 --- a/ReClass.NET/AddressParser/TokenReader.cs +++ b/ReClass.NET/AddressParser/TokenReader.cs @@ -138,7 +138,10 @@ private bool TryReadNumberToken() { sb.Append(currentCharacter); - hasHexadecimalIdentifier = !hasHexadecimalIdentifier && IsHexadecimalIdentifier(currentCharacter); + if (!hasHexadecimalIdentifier) + { + hasHexadecimalIdentifier = IsHexadecimalIdentifier(currentCharacter); + } ReadNextCharacter(); } From c6f771baa5dda7d684c5478f0e8a617583808c53 Mon Sep 17 00:00:00 2001 From: KN4CK3R Date: Sat, 6 Apr 2019 23:51:36 +0200 Subject: [PATCH 002/223] Added test project. --- ReClass.NET.sln | 26 +++++++ .../AddressParser/TokenReaderTest.cs | 35 ++++++++++ ReClass.NET_Tests/Properties/AssemblyInfo.cs | 20 ++++++ ReClass.NET_Tests/ReClass.NET_Tests.csproj | 70 +++++++++++++++++++ 4 files changed, 151 insertions(+) create mode 100644 ReClass.NET_Tests/AddressParser/TokenReaderTest.cs create mode 100644 ReClass.NET_Tests/Properties/AssemblyInfo.cs create mode 100644 ReClass.NET_Tests/ReClass.NET_Tests.csproj diff --git a/ReClass.NET.sln b/ReClass.NET.sln index fed7d3e0..9b52dc5d 100644 --- a/ReClass.NET.sln +++ b/ReClass.NET.sln @@ -20,46 +20,72 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution README.md = README.md EndProjectSection EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ReClass.NET_Tests", "ReClass.NET_Tests\ReClass.NET_Tests.csproj", "{E2D0424D-738F-41C3-9935-1B282624600F}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU Debug|x64 = Debug|x64 Debug|x86 = Debug|x86 + Release|Any CPU = Release|Any CPU Release|x64 = Release|x64 Release|x86 = Release|x86 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution + {BFB8917D-E9B4-463F-A6E8-612C35728C78}.Debug|Any CPU.ActiveCfg = Debug|x86 {BFB8917D-E9B4-463F-A6E8-612C35728C78}.Debug|x64.ActiveCfg = Debug|x64 {BFB8917D-E9B4-463F-A6E8-612C35728C78}.Debug|x64.Build.0 = Debug|x64 {BFB8917D-E9B4-463F-A6E8-612C35728C78}.Debug|x86.ActiveCfg = Debug|x86 {BFB8917D-E9B4-463F-A6E8-612C35728C78}.Debug|x86.Build.0 = Debug|x86 + {BFB8917D-E9B4-463F-A6E8-612C35728C78}.Release|Any CPU.ActiveCfg = Release|x86 {BFB8917D-E9B4-463F-A6E8-612C35728C78}.Release|x64.ActiveCfg = Release|x64 {BFB8917D-E9B4-463F-A6E8-612C35728C78}.Release|x64.Build.0 = Release|x64 {BFB8917D-E9B4-463F-A6E8-612C35728C78}.Release|x86.ActiveCfg = Release|x86 {BFB8917D-E9B4-463F-A6E8-612C35728C78}.Release|x86.Build.0 = Release|x86 + {22CA6FDB-7622-4F94-8FC2-2E7AB481C86F}.Debug|Any CPU.ActiveCfg = Debug|Win32 {22CA6FDB-7622-4F94-8FC2-2E7AB481C86F}.Debug|x64.ActiveCfg = Debug|x64 {22CA6FDB-7622-4F94-8FC2-2E7AB481C86F}.Debug|x64.Build.0 = Debug|x64 {22CA6FDB-7622-4F94-8FC2-2E7AB481C86F}.Debug|x86.ActiveCfg = Debug|Win32 {22CA6FDB-7622-4F94-8FC2-2E7AB481C86F}.Debug|x86.Build.0 = Debug|Win32 + {22CA6FDB-7622-4F94-8FC2-2E7AB481C86F}.Release|Any CPU.ActiveCfg = Release|Win32 {22CA6FDB-7622-4F94-8FC2-2E7AB481C86F}.Release|x64.ActiveCfg = Release|x64 {22CA6FDB-7622-4F94-8FC2-2E7AB481C86F}.Release|x64.Build.0 = Release|x64 {22CA6FDB-7622-4F94-8FC2-2E7AB481C86F}.Release|x86.ActiveCfg = Release|Win32 {22CA6FDB-7622-4F94-8FC2-2E7AB481C86F}.Release|x86.Build.0 = Release|Win32 + {48C5258A-FA49-4173-AEE5-0FCA5190DFF2}.Debug|Any CPU.ActiveCfg = Debug|x86 {48C5258A-FA49-4173-AEE5-0FCA5190DFF2}.Debug|x64.ActiveCfg = Debug|x64 {48C5258A-FA49-4173-AEE5-0FCA5190DFF2}.Debug|x64.Build.0 = Debug|x64 {48C5258A-FA49-4173-AEE5-0FCA5190DFF2}.Debug|x86.ActiveCfg = Debug|x86 {48C5258A-FA49-4173-AEE5-0FCA5190DFF2}.Debug|x86.Build.0 = Debug|x86 + {48C5258A-FA49-4173-AEE5-0FCA5190DFF2}.Release|Any CPU.ActiveCfg = Release|x86 {48C5258A-FA49-4173-AEE5-0FCA5190DFF2}.Release|x64.ActiveCfg = Release|x64 {48C5258A-FA49-4173-AEE5-0FCA5190DFF2}.Release|x64.Build.0 = Release|x64 {48C5258A-FA49-4173-AEE5-0FCA5190DFF2}.Release|x86.ActiveCfg = Release|x86 {48C5258A-FA49-4173-AEE5-0FCA5190DFF2}.Release|x86.Build.0 = Release|x86 + {16591D29-2370-428A-BA11-87E38D0F3551}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {16591D29-2370-428A-BA11-87E38D0F3551}.Debug|Any CPU.Build.0 = Debug|Any CPU {16591D29-2370-428A-BA11-87E38D0F3551}.Debug|x64.ActiveCfg = Debug|Any CPU {16591D29-2370-428A-BA11-87E38D0F3551}.Debug|x64.Build.0 = Debug|Any CPU {16591D29-2370-428A-BA11-87E38D0F3551}.Debug|x86.ActiveCfg = Debug|Any CPU {16591D29-2370-428A-BA11-87E38D0F3551}.Debug|x86.Build.0 = Debug|Any CPU + {16591D29-2370-428A-BA11-87E38D0F3551}.Release|Any CPU.ActiveCfg = Release|Any CPU + {16591D29-2370-428A-BA11-87E38D0F3551}.Release|Any CPU.Build.0 = Release|Any CPU {16591D29-2370-428A-BA11-87E38D0F3551}.Release|x64.ActiveCfg = Release|Any CPU {16591D29-2370-428A-BA11-87E38D0F3551}.Release|x64.Build.0 = Release|Any CPU {16591D29-2370-428A-BA11-87E38D0F3551}.Release|x86.ActiveCfg = Release|Any CPU {16591D29-2370-428A-BA11-87E38D0F3551}.Release|x86.Build.0 = Release|Any CPU + {E2D0424D-738F-41C3-9935-1B282624600F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E2D0424D-738F-41C3-9935-1B282624600F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E2D0424D-738F-41C3-9935-1B282624600F}.Debug|x64.ActiveCfg = Debug|Any CPU + {E2D0424D-738F-41C3-9935-1B282624600F}.Debug|x64.Build.0 = Debug|Any CPU + {E2D0424D-738F-41C3-9935-1B282624600F}.Debug|x86.ActiveCfg = Debug|Any CPU + {E2D0424D-738F-41C3-9935-1B282624600F}.Debug|x86.Build.0 = Debug|Any CPU + {E2D0424D-738F-41C3-9935-1B282624600F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E2D0424D-738F-41C3-9935-1B282624600F}.Release|Any CPU.Build.0 = Release|Any CPU + {E2D0424D-738F-41C3-9935-1B282624600F}.Release|x64.ActiveCfg = Release|Any CPU + {E2D0424D-738F-41C3-9935-1B282624600F}.Release|x64.Build.0 = Release|Any CPU + {E2D0424D-738F-41C3-9935-1B282624600F}.Release|x86.ActiveCfg = Release|Any CPU + {E2D0424D-738F-41C3-9935-1B282624600F}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/ReClass.NET_Tests/AddressParser/TokenReaderTest.cs b/ReClass.NET_Tests/AddressParser/TokenReaderTest.cs new file mode 100644 index 00000000..426dc44a --- /dev/null +++ b/ReClass.NET_Tests/AddressParser/TokenReaderTest.cs @@ -0,0 +1,35 @@ +using System.IO; +using NFluent; +using ReClassNET.AddressParser; +using Xunit; + +namespace ReClass.NET_Tests.AddressParser +{ + public class TokenReaderTest + { + [Theory] + [InlineData("", Token.None)] + [InlineData("0", Token.Number)] + [InlineData("1", Token.Number)] + [InlineData("0x0", Token.Number)] + [InlineData("0x1", Token.Number)] + [InlineData("00000000", Token.Number)] + [InlineData("0x00000000", Token.Number)] + [InlineData("+", Token.Add)] + [InlineData("-", Token.Subtract)] + [InlineData("*", Token.Multiply)] + [InlineData("/", Token.Divide)] + [InlineData("(", Token.OpenParenthesis)] + [InlineData(")", Token.CloseParenthesis)] + [InlineData("[", Token.OpenBrackets)] + [InlineData("]", Token.CloseBrackets)] + [InlineData(",", Token.Comma)] + [InlineData("", Token.Identifier)] + public void ReadBasicToken(string formula, Token type) + { + var tokenizer = new Tokenizer(new StringReader(formula)); + + Check.That(tokenizer.Token).IsEqualTo(type); + } + } +} diff --git a/ReClass.NET_Tests/Properties/AssemblyInfo.cs b/ReClass.NET_Tests/Properties/AssemblyInfo.cs new file mode 100644 index 00000000..dfba9306 --- /dev/null +++ b/ReClass.NET_Tests/Properties/AssemblyInfo.cs @@ -0,0 +1,20 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +[assembly: AssemblyTitle("ReClass.NET_Tests")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("ReClass.NET_Tests")] +[assembly: AssemblyCopyright("Copyright © 2019")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +[assembly: ComVisible(false)] + +[assembly: Guid("e2d0424d-738f-41c3-9935-1b282624600f")] + +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/ReClass.NET_Tests/ReClass.NET_Tests.csproj b/ReClass.NET_Tests/ReClass.NET_Tests.csproj new file mode 100644 index 00000000..5ef53ac6 --- /dev/null +++ b/ReClass.NET_Tests/ReClass.NET_Tests.csproj @@ -0,0 +1,70 @@ + + + + + Debug + AnyCPU + {E2D0424D-738F-41C3-9935-1B282624600F} + Library + Properties + ReClass.NET_Tests + ReClass.NET_Tests + v4.7.2 + 512 + {3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + 15.0 + $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) + $(ProgramFiles)\Common Files\microsoft shared\VSTT\$(VisualStudioVersion)\UITestExtensionPackages + False + UnitTest + + + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + x86 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + {bfb8917d-e9b4-463f-a6e8-612c35728c78} + ReClass.NET + + + + + 2.5.0 + + + 2.4.1 + + + 2.4.1 + runtime; build; native; contentfiles; analyzers; buildtransitive + all + + + + + \ No newline at end of file From ae719b3ffde12a187aafb9785466dd590e0327df Mon Sep 17 00:00:00 2001 From: KN4CK3R Date: Mon, 8 Apr 2019 00:41:28 +0200 Subject: [PATCH 003/223] Throw exceptions on invalid tokens. --- ReClass.NET/AddressParser/TokenReader.cs | 56 +++--------------------- 1 file changed, 5 insertions(+), 51 deletions(-) diff --git a/ReClass.NET/AddressParser/TokenReader.cs b/ReClass.NET/AddressParser/TokenReader.cs index d6e5d020..02a43919 100644 --- a/ReClass.NET/AddressParser/TokenReader.cs +++ b/ReClass.NET/AddressParser/TokenReader.cs @@ -151,57 +151,11 @@ private bool TryReadNumberToken() sb.Remove(0, 2); } - Number = long.Parse(sb.ToString(), NumberStyles.HexNumber); - - Token = Token.Number; - - return true; - } - - return false; - } - - /*private bool TryReadNumberToken() - { - bool IsDigit(char c) => char.IsDigit(c); - bool IsDecimalPoint(char c) => c == '.'; - bool IsHexadecimalIdentifier(char c) => c == 'x' || c == 'X'; - bool IsHexadecimalDigit(char c) => 'a' <= c && c <= 'f' || 'A' <= c && c <= 'F'; - - if (char.IsDigit(currentCharacter) || currentCharacter == '.') - { - var sb = new StringBuilder(); - var hasDecimalPoint = false; - var hasHexadecimalIdentifier = false; - var hasHexadecimalDigit = false; - - while (IsDigit(currentCharacter) - || IsDecimalPoint(currentCharacter) && !hasDecimalPoint && !hasHexadecimalIdentifier && !hasHexadecimalDigit - || IsHexadecimalIdentifier(currentCharacter) && !hasDecimalPoint && !hasHexadecimalIdentifier && sb.Length == 1 && sb[0] == '0' - || IsHexadecimalDigit(currentCharacter) && !hasDecimalPoint) - { - sb.Append(currentCharacter); - - hasDecimalPoint = !hasDecimalPoint && IsDecimalPoint(currentCharacter); - hasHexadecimalIdentifier = !hasHexadecimalIdentifier && IsHexadecimalIdentifier(currentCharacter); - hasHexadecimalDigit = !hasHexadecimalDigit && IsHexadecimalDigit(currentCharacter); - - ReadNextCharacter(); - } - - if (hasHexadecimalIdentifier || hasHexadecimalDigit) + if (!long.TryParse(sb.ToString(), NumberStyles.HexNumber, CultureInfo.InvariantCulture, out var number)) { - if (hasHexadecimalIdentifier) - { - sb.Remove(0, 2); - } - - Number = long.Parse(sb.ToString(), NumberStyles.HexNumber); - } - else - { - Number = double.Parse(sb.ToString(), CultureInfo.InvariantCulture); + throw new ParseException($"Could not parse '{sb}' as number."); } + Number = number; Token = Token.Number; @@ -209,7 +163,7 @@ private bool TryReadNumberToken() } return false; - }*/ + } private bool TryReadIdentifierToken() { @@ -228,7 +182,7 @@ private bool TryReadIdentifierToken() if (currentCharacter != '>') { - return false; + throw new ParseException("Invalid identifier, missing '>'."); } ReadNextCharacter(); From 2905799a6c6d1b28ea52ada1ee87c156b91c03e9 Mon Sep 17 00:00:00 2001 From: KN4CK3R Date: Mon, 8 Apr 2019 00:42:59 +0200 Subject: [PATCH 004/223] Added more tests. --- .../AddressParser/TokenReaderTest.cs | 41 ++++++++++++++++++- 1 file changed, 39 insertions(+), 2 deletions(-) diff --git a/ReClass.NET_Tests/AddressParser/TokenReaderTest.cs b/ReClass.NET_Tests/AddressParser/TokenReaderTest.cs index 426dc44a..08ade1f6 100644 --- a/ReClass.NET_Tests/AddressParser/TokenReaderTest.cs +++ b/ReClass.NET_Tests/AddressParser/TokenReaderTest.cs @@ -9,6 +9,10 @@ public class TokenReaderTest { [Theory] [InlineData("", Token.None)] + [InlineData(" ", Token.None)] + [InlineData("\t", Token.None)] + [InlineData("\n", Token.None)] + [InlineData(" \t\n", Token.None)] [InlineData("0", Token.Number)] [InlineData("1", Token.Number)] [InlineData("0x0", Token.Number)] @@ -25,11 +29,44 @@ public class TokenReaderTest [InlineData("]", Token.CloseBrackets)] [InlineData(",", Token.Comma)] [InlineData("", Token.Identifier)] - public void ReadBasicToken(string formula, Token type) + public void TestTokenType(string expression, Token type) { - var tokenizer = new Tokenizer(new StringReader(formula)); + var tokenizer = new Tokenizer(new StringReader(expression)); Check.That(tokenizer.Token).IsEqualTo(type); } + + [Theory] + [InlineData("0", 0)] + [InlineData("1", 1)] + [InlineData("0x0", 0)] + [InlineData("0x1", 1)] + [InlineData("00000000", 0)] + [InlineData("0x00000000", 0)] + [InlineData("12345678", 0x12345678)] + [InlineData("0x12345678", 0x12345678)] + public void TestNumberValue(string expression, long value) + { + var tokenizer = new Tokenizer(new StringReader(expression)); + + Check.That(tokenizer.Number).IsEqualTo(value); + } + + [Theory] + [InlineData("<>", "")] + [InlineData("", "test")] + [InlineData("", "module.test")] + public void TestIdentifierValue(string expression, string value) + { + var tokenizer = new Tokenizer(new StringReader(expression)); + + Check.That(tokenizer.Identifier).IsEqualTo(value); + } + + [Fact] + public void TestInvalidIdentifier() + { + Assert.Throws(() => new Tokenizer(new StringReader("<"))); + } } } From d2ccf63f68325d09d6e4b41af898b1f857a78730 Mon Sep 17 00:00:00 2001 From: KN4CK3R Date: Tue, 9 Apr 2019 13:15:26 +0200 Subject: [PATCH 005/223] Changed filename. Changed class name. --- .../AddressParser/{ExpressionParser.cs => Parser.cs} | 6 +++--- ReClass.NET/AddressParser/{TokenReader.cs => Tokenizer.cs} | 2 ++ ReClass.NET/Memory/RemoteProcess.cs | 2 +- ReClass.NET/ReClass.NET.csproj | 4 ++-- 4 files changed, 8 insertions(+), 6 deletions(-) rename ReClass.NET/AddressParser/{ExpressionParser.cs => Parser.cs} (96%) rename ReClass.NET/AddressParser/{TokenReader.cs => Tokenizer.cs} (98%) diff --git a/ReClass.NET/AddressParser/ExpressionParser.cs b/ReClass.NET/AddressParser/Parser.cs similarity index 96% rename from ReClass.NET/AddressParser/ExpressionParser.cs rename to ReClass.NET/AddressParser/Parser.cs index 5d20aa09..67c26ae3 100644 --- a/ReClass.NET/AddressParser/ExpressionParser.cs +++ b/ReClass.NET/AddressParser/Parser.cs @@ -3,11 +3,11 @@ namespace ReClassNET.AddressParser { - public class ExpressionParser + public class Parser { private readonly Tokenizer tokenizer; - public ExpressionParser(Tokenizer tokenizer) + public Parser(Tokenizer tokenizer) { this.tokenizer = tokenizer; } @@ -190,7 +190,7 @@ public static IExpression Parse(string str) public static IExpression Parse(Tokenizer tokenizer) { - var parser = new ExpressionParser(tokenizer); + var parser = new Parser(tokenizer); return parser.ParseExpression(); } diff --git a/ReClass.NET/AddressParser/TokenReader.cs b/ReClass.NET/AddressParser/Tokenizer.cs similarity index 98% rename from ReClass.NET/AddressParser/TokenReader.cs rename to ReClass.NET/AddressParser/Tokenizer.cs index 02a43919..7726fabb 100644 --- a/ReClass.NET/AddressParser/TokenReader.cs +++ b/ReClass.NET/AddressParser/Tokenizer.cs @@ -71,6 +71,8 @@ public void ReadNextToken() { return; } + + throw new ParseException($"Invalid character '{currentCharacter}'."); } private void ReadNextCharacter() diff --git a/ReClass.NET/Memory/RemoteProcess.cs b/ReClass.NET/Memory/RemoteProcess.cs index a154632f..aee60957 100644 --- a/ReClass.NET/Memory/RemoteProcess.cs +++ b/ReClass.NET/Memory/RemoteProcess.cs @@ -720,7 +720,7 @@ public IntPtr ParseAddress(string addressFormula) if (!formulaCache.TryGetValue(addressFormula, out var func)) { - var expression = ExpressionParser.Parse(addressFormula); + var expression = Parser.Parse(addressFormula); func = DynamicCompiler.CompileAddressFormula(expression); diff --git a/ReClass.NET/ReClass.NET.csproj b/ReClass.NET/ReClass.NET.csproj index 6c1157b2..6e5f1be0 100644 --- a/ReClass.NET/ReClass.NET.csproj +++ b/ReClass.NET/ReClass.NET.csproj @@ -140,9 +140,9 @@ - + - + From 387034599f13ef2d43ec6e3ac0dbef1115d8aaed Mon Sep 17 00:00:00 2001 From: KN4CK3R Date: Tue, 9 Apr 2019 13:15:42 +0200 Subject: [PATCH 006/223] Added more tests. --- ReClass.NET_Tests/AddressParser/TokenReaderTest.cs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/ReClass.NET_Tests/AddressParser/TokenReaderTest.cs b/ReClass.NET_Tests/AddressParser/TokenReaderTest.cs index 08ade1f6..3cc9571f 100644 --- a/ReClass.NET_Tests/AddressParser/TokenReaderTest.cs +++ b/ReClass.NET_Tests/AddressParser/TokenReaderTest.cs @@ -63,10 +63,15 @@ public void TestIdentifierValue(string expression, string value) Check.That(tokenizer.Identifier).IsEqualTo(value); } - [Fact] - public void TestInvalidIdentifier() + [Theory] + [InlineData("<")] + [InlineData(">")] + [InlineData("10000000000000000")] + [InlineData("0x")] + [InlineData("x")] + public void TestInvalidExpression(string expression) { - Assert.Throws(() => new Tokenizer(new StringReader("<"))); + Check.ThatCode(() => new Tokenizer(new StringReader(expression))).Throws(); } } } From 4ed2b477490a679e13207f2d3dbcc63e05e14c2c Mon Sep 17 00:00:00 2001 From: KN4CK3R Date: Mon, 15 Apr 2019 14:42:56 +0200 Subject: [PATCH 007/223] Renamed class. Added expression tests. --- .../{TokenReaderTest.cs => TokenizerTest.cs} | 27 ++++++++++++++++++- ReClass.NET_Tests/ReClass.NET_Tests.csproj | 4 +-- 2 files changed, 28 insertions(+), 3 deletions(-) rename ReClass.NET_Tests/AddressParser/{TokenReaderTest.cs => TokenizerTest.cs} (63%) diff --git a/ReClass.NET_Tests/AddressParser/TokenReaderTest.cs b/ReClass.NET_Tests/AddressParser/TokenizerTest.cs similarity index 63% rename from ReClass.NET_Tests/AddressParser/TokenReaderTest.cs rename to ReClass.NET_Tests/AddressParser/TokenizerTest.cs index 3cc9571f..a3cd9a6e 100644 --- a/ReClass.NET_Tests/AddressParser/TokenReaderTest.cs +++ b/ReClass.NET_Tests/AddressParser/TokenizerTest.cs @@ -5,7 +5,7 @@ namespace ReClass.NET_Tests.AddressParser { - public class TokenReaderTest + public class TokenizerTest { [Theory] [InlineData("", Token.None)] @@ -73,5 +73,30 @@ public void TestInvalidExpression(string expression) { Check.ThatCode(() => new Tokenizer(new StringReader(expression))).Throws(); } + + [Theory] + [InlineData("1 + 2", Token.Number, Token.Add, Token.Number)] + [InlineData("1+2", Token.Number, Token.Add, Token.Number)] + [InlineData("+1", Token.Add, Token.Number)] + [InlineData("1 + ( 2 )", Token.Number, Token.Add, Token.OpenParenthesis, Token.Number, Token.CloseParenthesis)] + [InlineData("1 + )( 2", Token.Number, Token.Add, Token.CloseParenthesis, Token.OpenParenthesis, Token.Number)] + [InlineData("1+", Token.Number, Token.Add, Token.Identifier)] + [InlineData("0x1+", Token.Number, Token.Add, Token.Identifier)] + [InlineData("(0x1+)", Token.OpenParenthesis, Token.Number, Token.Add, Token.Identifier, Token.CloseParenthesis)] + [InlineData("[ 1 ] + 2", Token.OpenBrackets, Token.Number, Token.CloseBrackets, Token.Add, Token.Number)] + [InlineData("[1 + 2]", Token.OpenBrackets, Token.Number, Token.Add, Token.Number, Token.CloseBrackets)] + public void TestExpressions(string expression, params Token[] tokens) + { + var tokenizer = new Tokenizer(new StringReader(expression)); + + foreach (var token in tokens) + { + Check.That(tokenizer.Token).IsEqualTo(token); + + tokenizer.ReadNextToken(); + } + + Check.That(tokenizer.Token).IsEqualTo(Token.None); + } } } diff --git a/ReClass.NET_Tests/ReClass.NET_Tests.csproj b/ReClass.NET_Tests/ReClass.NET_Tests.csproj index 5ef53ac6..e4000a1e 100644 --- a/ReClass.NET_Tests/ReClass.NET_Tests.csproj +++ b/ReClass.NET_Tests/ReClass.NET_Tests.csproj @@ -1,4 +1,4 @@ - + @@ -43,7 +43,7 @@ - + From a9e941e0237700f6cb85c2fef8595df44dcc308e Mon Sep 17 00:00:00 2001 From: KN4CK3R Date: Mon, 15 Apr 2019 14:43:59 +0200 Subject: [PATCH 008/223] Added interface for Tokenizer. --- ReClass.NET/AddressParser/ITokenizer.cs | 25 +++++++++++++++++++++++++ ReClass.NET/AddressParser/Parser.cs | 4 ++-- ReClass.NET/AddressParser/Tokenizer.cs | 14 +------------- ReClass.NET/ReClass.NET.csproj | 1 + 4 files changed, 29 insertions(+), 15 deletions(-) create mode 100644 ReClass.NET/AddressParser/ITokenizer.cs diff --git a/ReClass.NET/AddressParser/ITokenizer.cs b/ReClass.NET/AddressParser/ITokenizer.cs new file mode 100644 index 00000000..625e1a0f --- /dev/null +++ b/ReClass.NET/AddressParser/ITokenizer.cs @@ -0,0 +1,25 @@ +namespace ReClassNET.AddressParser +{ + public interface ITokenizer + { + /// + /// The current token. It is set to if no more tokens are avaiable. + /// + Token Token { get; } + + /// + /// The current identifier. + /// + string Identifier { get; } + + /// + /// The current number. + /// + long Number { get; } + + /// + /// Reads the next token. + /// + void ReadNextToken(); + } +} diff --git a/ReClass.NET/AddressParser/Parser.cs b/ReClass.NET/AddressParser/Parser.cs index 67c26ae3..7a70a91b 100644 --- a/ReClass.NET/AddressParser/Parser.cs +++ b/ReClass.NET/AddressParser/Parser.cs @@ -5,9 +5,9 @@ namespace ReClassNET.AddressParser { public class Parser { - private readonly Tokenizer tokenizer; + private readonly ITokenizer tokenizer; - public Parser(Tokenizer tokenizer) + public Parser(ITokenizer tokenizer) { this.tokenizer = tokenizer; } diff --git a/ReClass.NET/AddressParser/Tokenizer.cs b/ReClass.NET/AddressParser/Tokenizer.cs index 7726fabb..a43907ec 100644 --- a/ReClass.NET/AddressParser/Tokenizer.cs +++ b/ReClass.NET/AddressParser/Tokenizer.cs @@ -8,25 +8,16 @@ namespace ReClassNET.AddressParser /// /// Parses the given text and reads individual tokens from it. /// - public class Tokenizer + public class Tokenizer : ITokenizer { private readonly TextReader reader; private char currentCharacter; - /// - /// The current token. It is set to if no more tokens are avaiable. - /// public Token Token { get; private set; } - /// - /// The current identifier. - /// public string Identifier { get; private set; } - /// - /// The current number. - /// public long Number { get; private set; } public Tokenizer(TextReader reader) @@ -39,9 +30,6 @@ public Tokenizer(TextReader reader) ReadNextToken(); } - /// - /// Reads the next token from the input. - /// public void ReadNextToken() { SkipWhitespaces(); diff --git a/ReClass.NET/ReClass.NET.csproj b/ReClass.NET/ReClass.NET.csproj index 6e5f1be0..45c36c5d 100644 --- a/ReClass.NET/ReClass.NET.csproj +++ b/ReClass.NET/ReClass.NET.csproj @@ -139,6 +139,7 @@ + From 504a2296ea2f4de70e8bb2eb585f83fe7b611f0f Mon Sep 17 00:00:00 2001 From: KN4CK3R Date: Mon, 15 Apr 2019 15:59:59 +0200 Subject: [PATCH 009/223] Added tests for the parser class. --- ReClass.NET_Tests/AddressParser/ParserTest.cs | 103 ++++++++++++++++++ ReClass.NET_Tests/ReClass.NET_Tests.csproj | 12 +- 2 files changed, 107 insertions(+), 8 deletions(-) create mode 100644 ReClass.NET_Tests/AddressParser/ParserTest.cs diff --git a/ReClass.NET_Tests/AddressParser/ParserTest.cs b/ReClass.NET_Tests/AddressParser/ParserTest.cs new file mode 100644 index 00000000..cf2f0fcd --- /dev/null +++ b/ReClass.NET_Tests/AddressParser/ParserTest.cs @@ -0,0 +1,103 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using NFluent; +using ReClassNET.AddressParser; +using Xunit; + +namespace ReClass.NET_Tests.AddressParser +{ + public class ParserTest + { + private class TokenizerStub : ITokenizer + { + private readonly Tuple[] values; + + private int index = 0; + + public Token Token => values[index].Item1; + public string Identifier => values[index].Item2; + public long Number => values[index].Item3; + + public TokenizerStub(params Tuple[] values) + { + this.values = values + .Append(Tuple.Create(Token.None, null, 0)) + .ToArray(); + } + + public void ReadNextToken() + { + if (index < values.Length - 1) + { + ++index; + } + } + } + + public static IEnumerable InvalidExpressionData() + { + return new List + { + new object[] { new TokenizerStub() }, + new object[] { new TokenizerStub(Tuple.Create(Token.Add, "", 0L)) }, + new object[] { new TokenizerStub(Tuple.Create(Token.Subtract, "", 0L)) }, + new object[] { new TokenizerStub(Tuple.Create(Token.Multiply, "", 0L)) }, + new object[] { new TokenizerStub(Tuple.Create(Token.Divide, "", 0L)) }, + new object[] { new TokenizerStub(Tuple.Create(Token.Comma, "", 0L)) }, + new object[] { new TokenizerStub(Tuple.Create(Token.OpenParenthesis, "", 0L)) }, + new object[] { new TokenizerStub(Tuple.Create(Token.CloseParenthesis, "", 0L)) }, + new object[] { new TokenizerStub(Tuple.Create(Token.OpenBrackets, "", 0L)) }, + new object[] { new TokenizerStub(Tuple.Create(Token.CloseBrackets, "", 0L)) }, + + new object[] { new TokenizerStub( + Tuple.Create(Token.Number, "", 0L), + Tuple.Create(Token.Subtract, "", 0L) + ) }, + new object[] { new TokenizerStub( + Tuple.Create(Token.Number, "", 0L), + Tuple.Create(Token.OpenParenthesis, "", 0L) + ) }, + new object[] { new TokenizerStub( + Tuple.Create(Token.Number, "", 0L), + Tuple.Create(Token.CloseParenthesis, "", 0L) + ) }, + new object[] { new TokenizerStub( + Tuple.Create(Token.OpenParenthesis, "", 0L), + Tuple.Create(Token.CloseParenthesis, "", 0L) + ) }, + new object[] { new TokenizerStub( + Tuple.Create(Token.OpenParenthesis, "", 0L), + Tuple.Create(Token.Number, "", 0L) + ) }, + }; + } + + [Theory] + [MemberData(nameof(InvalidExpressionData))] + public void InvalidExpressionTests(ITokenizer tokenizer) + { + var parser = new Parser(tokenizer); + + Check.ThatCode(() => parser.ParseExpression()).Throws(); + } + + [Theory] + [InlineData("1", typeof(ConstantExpression))] + [InlineData("1 + 2", typeof(AddExpression))] + [InlineData("1 + 2 * 3", typeof(MultiplyExpression))] + [InlineData("(1 + 2) * 3", typeof(MultiplyExpression))] + [InlineData("1 + (2 * 3)", typeof(AddExpression))] + [InlineData("(1 + (2 * 3))", typeof(AddExpression))] + public void ValidExpressionTests(string expression, Type type) + { + var tokenizer = new Tokenizer(new StringReader(expression)); + var parser = new Parser(tokenizer); + + Check.That(parser.ParseExpression()).IsInstanceOfType(type); + } + } +} diff --git a/ReClass.NET_Tests/ReClass.NET_Tests.csproj b/ReClass.NET_Tests/ReClass.NET_Tests.csproj index e4000a1e..78cff692 100644 --- a/ReClass.NET_Tests/ReClass.NET_Tests.csproj +++ b/ReClass.NET_Tests/ReClass.NET_Tests.csproj @@ -1,5 +1,5 @@ - - + + Debug @@ -12,10 +12,6 @@ v4.7.2 512 {3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - 15.0 - $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) - $(ProgramFiles)\Common Files\microsoft shared\VSTT\$(VisualStudioVersion)\UITestExtensionPackages - False UnitTest @@ -43,6 +39,7 @@ + @@ -61,10 +58,9 @@ 2.4.1 - runtime; build; native; contentfiles; analyzers; buildtransitive + runtime; build; native; contentfiles; analyzers all - \ No newline at end of file From c10ea5748fb177835535775dd40da8302861f7fc Mon Sep 17 00:00:00 2001 From: KN4CK3R Date: Tue, 16 Apr 2019 09:53:31 +0200 Subject: [PATCH 010/223] Fixed expected result. --- ReClass.NET_Tests/AddressParser/ParserTest.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ReClass.NET_Tests/AddressParser/ParserTest.cs b/ReClass.NET_Tests/AddressParser/ParserTest.cs index cf2f0fcd..d18b144d 100644 --- a/ReClass.NET_Tests/AddressParser/ParserTest.cs +++ b/ReClass.NET_Tests/AddressParser/ParserTest.cs @@ -88,7 +88,7 @@ public void InvalidExpressionTests(ITokenizer tokenizer) [Theory] [InlineData("1", typeof(ConstantExpression))] [InlineData("1 + 2", typeof(AddExpression))] - [InlineData("1 + 2 * 3", typeof(MultiplyExpression))] + [InlineData("1 + 2 * 3", typeof(AddExpression))] [InlineData("(1 + 2) * 3", typeof(MultiplyExpression))] [InlineData("1 + (2 * 3)", typeof(AddExpression))] [InlineData("(1 + (2 * 3))", typeof(AddExpression))] From 013880c3b8646b60c080480f635aabc6f9ad1600 Mon Sep 17 00:00:00 2001 From: KN4CK3R Date: Tue, 16 Apr 2019 10:07:17 +0200 Subject: [PATCH 011/223] Use InlineData instead of a stub. --- ReClass.NET/AddressParser/Parser.cs | 6 +- ReClass.NET_Tests/AddressParser/ParserTest.cs | 110 +++++------------- 2 files changed, 33 insertions(+), 83 deletions(-) diff --git a/ReClass.NET/AddressParser/Parser.cs b/ReClass.NET/AddressParser/Parser.cs index 7a70a91b..6090c443 100644 --- a/ReClass.NET/AddressParser/Parser.cs +++ b/ReClass.NET/AddressParser/Parser.cs @@ -178,8 +178,6 @@ private IExpression ParseLeaf() } } - #region Convenience Helpers - public static IExpression Parse(string str) { using (var sr = new StringReader(str)) @@ -188,12 +186,10 @@ public static IExpression Parse(string str) } } - public static IExpression Parse(Tokenizer tokenizer) + private static IExpression Parse(ITokenizer tokenizer) { var parser = new Parser(tokenizer); return parser.ParseExpression(); } - - #endregion } } diff --git a/ReClass.NET_Tests/AddressParser/ParserTest.cs b/ReClass.NET_Tests/AddressParser/ParserTest.cs index d18b144d..57fb0a7f 100644 --- a/ReClass.NET_Tests/AddressParser/ParserTest.cs +++ b/ReClass.NET_Tests/AddressParser/ParserTest.cs @@ -1,9 +1,4 @@ using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using NFluent; using ReClassNET.AddressParser; using Xunit; @@ -12,77 +7,39 @@ namespace ReClass.NET_Tests.AddressParser { public class ParserTest { - private class TokenizerStub : ITokenizer - { - private readonly Tuple[] values; - - private int index = 0; - - public Token Token => values[index].Item1; - public string Identifier => values[index].Item2; - public long Number => values[index].Item3; - - public TokenizerStub(params Tuple[] values) - { - this.values = values - .Append(Tuple.Create(Token.None, null, 0)) - .ToArray(); - } - - public void ReadNextToken() - { - if (index < values.Length - 1) - { - ++index; - } - } - } - - public static IEnumerable InvalidExpressionData() - { - return new List - { - new object[] { new TokenizerStub() }, - new object[] { new TokenizerStub(Tuple.Create(Token.Add, "", 0L)) }, - new object[] { new TokenizerStub(Tuple.Create(Token.Subtract, "", 0L)) }, - new object[] { new TokenizerStub(Tuple.Create(Token.Multiply, "", 0L)) }, - new object[] { new TokenizerStub(Tuple.Create(Token.Divide, "", 0L)) }, - new object[] { new TokenizerStub(Tuple.Create(Token.Comma, "", 0L)) }, - new object[] { new TokenizerStub(Tuple.Create(Token.OpenParenthesis, "", 0L)) }, - new object[] { new TokenizerStub(Tuple.Create(Token.CloseParenthesis, "", 0L)) }, - new object[] { new TokenizerStub(Tuple.Create(Token.OpenBrackets, "", 0L)) }, - new object[] { new TokenizerStub(Tuple.Create(Token.CloseBrackets, "", 0L)) }, - - new object[] { new TokenizerStub( - Tuple.Create(Token.Number, "", 0L), - Tuple.Create(Token.Subtract, "", 0L) - ) }, - new object[] { new TokenizerStub( - Tuple.Create(Token.Number, "", 0L), - Tuple.Create(Token.OpenParenthesis, "", 0L) - ) }, - new object[] { new TokenizerStub( - Tuple.Create(Token.Number, "", 0L), - Tuple.Create(Token.CloseParenthesis, "", 0L) - ) }, - new object[] { new TokenizerStub( - Tuple.Create(Token.OpenParenthesis, "", 0L), - Tuple.Create(Token.CloseParenthesis, "", 0L) - ) }, - new object[] { new TokenizerStub( - Tuple.Create(Token.OpenParenthesis, "", 0L), - Tuple.Create(Token.Number, "", 0L) - ) }, - }; - } - [Theory] - [MemberData(nameof(InvalidExpressionData))] - public void InvalidExpressionTests(ITokenizer tokenizer) + [InlineData("-")] + [InlineData("+")] + [InlineData("*")] + [InlineData("/")] + [InlineData(",")] + [InlineData("(")] + [InlineData(")")] + [InlineData("[")] + [InlineData("]")] + [InlineData("1-")] + [InlineData("1(")] + [InlineData("1)")] + [InlineData("1[")] + [InlineData("1]")] + [InlineData("(1")] + [InlineData(")1")] + [InlineData("[1")] + [InlineData("]1")] + [InlineData("1+(")] + [InlineData("1+)")] + [InlineData("1 + ()")] + [InlineData("(1 + 2")] + [InlineData("1 + 2)")] + [InlineData("[1 + 2)")] + [InlineData("(1 + 2]")] + [InlineData("[1,]")] + [InlineData("[1,")] + [InlineData("1,")] + [InlineData("1,2")] + public void InvalidExpressionTests(string expression) { - var parser = new Parser(tokenizer); - - Check.ThatCode(() => parser.ParseExpression()).Throws(); + Check.ThatCode(() => Parser.Parse(expression)).Throws(); } [Theory] @@ -94,10 +51,7 @@ public void InvalidExpressionTests(ITokenizer tokenizer) [InlineData("(1 + (2 * 3))", typeof(AddExpression))] public void ValidExpressionTests(string expression, Type type) { - var tokenizer = new Tokenizer(new StringReader(expression)); - var parser = new Parser(tokenizer); - - Check.That(parser.ParseExpression()).IsInstanceOfType(type); + Check.That(Parser.Parse(expression)).IsInstanceOfType(type); } } } From ffcabb590405da4e30b340de6e6adc893427e72d Mon Sep 17 00:00:00 2001 From: KN4CK3R Date: Tue, 16 Apr 2019 13:28:14 +0200 Subject: [PATCH 012/223] Added more tests. --- ReClass.NET/AddressParser/Parser.cs | 5 +++++ ReClass.NET_Tests/AddressParser/ParserTest.cs | 19 ++++++++++++++++++- 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/ReClass.NET/AddressParser/Parser.cs b/ReClass.NET/AddressParser/Parser.cs index 6090c443..d07cdf28 100644 --- a/ReClass.NET/AddressParser/Parser.cs +++ b/ReClass.NET/AddressParser/Parser.cs @@ -151,6 +151,11 @@ private IExpression ParseLeaf() throw new ParseException("Missing read byte count"); } + if (tokenizer.Number != 4 && tokenizer.Number != 8) + { + throw new ParseException("The byte count must be 4 or 8."); + } + byteCount = (int)tokenizer.Number; tokenizer.ReadNextToken(); diff --git a/ReClass.NET_Tests/AddressParser/ParserTest.cs b/ReClass.NET_Tests/AddressParser/ParserTest.cs index 57fb0a7f..40a2bfd3 100644 --- a/ReClass.NET_Tests/AddressParser/ParserTest.cs +++ b/ReClass.NET_Tests/AddressParser/ParserTest.cs @@ -33,8 +33,9 @@ public class ParserTest [InlineData("1 + 2)")] [InlineData("[1 + 2)")] [InlineData("(1 + 2]")] - [InlineData("[1,]")] [InlineData("[1,")] + [InlineData("[1,]")] + [InlineData("[1,2]")] [InlineData("1,")] [InlineData("1,2")] public void InvalidExpressionTests(string expression) @@ -45,13 +46,29 @@ public void InvalidExpressionTests(string expression) [Theory] [InlineData("1", typeof(ConstantExpression))] [InlineData("1 + 2", typeof(AddExpression))] + [InlineData("1 - 2", typeof(SubtractExpression))] + [InlineData("1 * 2", typeof(MultiplyExpression))] + [InlineData("1 / 2", typeof(DivideExpression))] [InlineData("1 + 2 * 3", typeof(AddExpression))] [InlineData("(1 + 2) * 3", typeof(MultiplyExpression))] [InlineData("1 + (2 * 3)", typeof(AddExpression))] [InlineData("(1 + (2 * 3))", typeof(AddExpression))] + [InlineData("[1]", typeof(ReadMemoryExpression))] + [InlineData("[1,4]", typeof(ReadMemoryExpression))] + [InlineData("[1,8]", typeof(ReadMemoryExpression))] + [InlineData("", typeof(ModuleExpression))] + [InlineData("[]", typeof(ReadMemoryExpression))] public void ValidExpressionTests(string expression, Type type) { Check.That(Parser.Parse(expression)).IsInstanceOfType(type); } + + [Fact] + public void ReadMemoryDefaultByteCountCheck() + { + var expression = (ReadMemoryExpression)Parser.Parse("[1]"); + + Check.That(expression.ByteCount).IsEqualTo(IntPtr.Size); + } } } From fb32699472a892353f52e4b53bf1be03489bdee6 Mon Sep 17 00:00:00 2001 From: KN4CK3R Date: Tue, 16 Apr 2019 13:31:33 +0200 Subject: [PATCH 013/223] Dropped support for ReClass 2007 files to get rid of the SQLite dependency. --- .../DataExchange/ReClass/ReClass2007File.cs | 212 ------------------ ReClass.NET/Forms/MainForm.Functions.cs | 8 +- ReClass.NET/Forms/MainForm.cs | 1 - ReClass.NET/ReClass.NET.csproj | 6 - 4 files changed, 2 insertions(+), 225 deletions(-) delete mode 100644 ReClass.NET/DataExchange/ReClass/ReClass2007File.cs diff --git a/ReClass.NET/DataExchange/ReClass/ReClass2007File.cs b/ReClass.NET/DataExchange/ReClass/ReClass2007File.cs deleted file mode 100644 index c969b9a9..00000000 --- a/ReClass.NET/DataExchange/ReClass/ReClass2007File.cs +++ /dev/null @@ -1,212 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Data; -using System.Data.SQLite; -using System.Diagnostics.Contracts; -using System.Linq; -using ReClassNET.DataExchange.ReClass.Legacy; -using ReClassNET.Extensions; -using ReClassNET.Logger; -using ReClassNET.Nodes; -using ReClassNET.Project; - -namespace ReClassNET.DataExchange.ReClass -{ - public class ReClass2007File : IReClassImport - { - public const string FormatName = "ReClass 2007 File"; - public const string FileExtension = ".rdc"; - - private static readonly Type[] typeMap = - { - null, - typeof(ClassInstanceNode), - typeof(ClassNode), - null, - typeof(Hex32Node), - typeof(Hex16Node), - typeof(Hex8Node), - typeof(ClassPointerNode), - typeof(Int32Node), - typeof(Int16Node), - typeof(Int8Node), - typeof(FloatNode), - typeof(UInt32Node), - typeof(UInt16Node), - typeof(UInt8Node), - typeof(Utf8TextNode), - typeof(FunctionPtrNode) - }; - - private readonly ReClassNetProject project; - - public ReClass2007File(ReClassNetProject project) - { - Contract.Requires(project != null); - - this.project = project; - } - - public void Load(string filePath, ILogger logger) - { - using (var connection = new SQLiteConnection($"Data Source={filePath}")) - { - connection.Open(); - - var classes = new Dictionary(); - var vtables = new Dictionary(); - - foreach (var row in Query(connection, "SELECT tbl_name FROM sqlite_master WHERE tbl_name LIKE 'class%'")) - { - var id = Convert.ToInt32(row["tbl_name"].ToString().Substring(5)); - - var classRow = Query(connection, $"SELECT variable, comment FROM class{id} WHERE type = 2 LIMIT 1").FirstOrDefault(); - if (classRow == null) - { - continue; - } - - // Skip the vtable classes. - if (classRow["variable"].ToString() == "VTABLE") - { - var vtableNode = new VirtualMethodTableNode(); - - Query(connection, $"SELECT variable, comment FROM class{id} WHERE type = 16") - .Select(e => new VirtualMethodNode - { - Name = Convert.ToString(e["variable"]), - Comment = Convert.ToString(e["comment"]) - }) - .ForEach(vtableNode.AddNode); - - foreach (var method in vtableNode.Nodes.Where(m => m.Name == "void function()")) - { - method.Name = string.Empty; - } - - vtables.Add(id, vtableNode); - - continue; - } - - var node = new ClassNode(false) - { - Name = classRow["variable"].ToString(), - Comment = classRow["comment"].ToString() - }; - - project.AddClass(node); - - classes.Add(id, node); - } - - foreach (var kv in classes) - { - ReadNodeRows( - Query(connection, $"SELECT variable, comment, type, length, ref FROM class{kv.Key} WHERE type != 2"), - kv.Value, - classes, - vtables, - logger - ).ForEach(kv.Value.AddNode); - } - } - } - - private static IEnumerable ReadNodeRows(IEnumerable rows, ClassNode parent, IReadOnlyDictionary classes, IReadOnlyDictionary vtables, ILogger logger) - { - Contract.Requires(rows != null); - Contract.Requires(parent != null); - Contract.Requires(logger != null); - - foreach (var row in rows) - { - Type nodeType = null; - - var typeVal = Convert.ToInt32(row["type"]); - if (typeVal >= 0 && typeVal < typeMap.Length) - { - nodeType = typeMap[typeVal]; - } - - if (nodeType == null) - { - logger.Log(LogLevel.Error, $"Skipping node with unknown type: {row["type"]}"); - logger.Log(LogLevel.Warning, string.Join(",", row.ItemArray)); - - continue; - } - - var node = BaseNode.CreateInstanceFromType(nodeType, false); - if (node == null) - { - logger.Log(LogLevel.Error, $"Could not create node of type: {nodeType}"); - - continue; - } - - node.Name = Convert.ToString(row["variable"]); - node.Comment = Convert.ToString(row["comment"]); - - // ClassInstanceNode, ClassPointerNode - if (node is BaseWrapperNode wrapperNode) - { - var reference = Convert.ToInt32(row["ref"]); - if (!classes.ContainsKey(reference)) - { - if (!vtables.TryGetValue(reference, out var vtableNode)) - { - logger.Log(LogLevel.Error, $"Skipping node with unknown reference: {row["ref"]}"); - logger.Log(LogLevel.Warning, string.Join(",", row.ItemArray)); - - continue; - } - - yield return vtableNode; - - continue; - } - - var innerClassNode = classes[reference]; - if (wrapperNode.ShouldPerformCycleCheckForInnerNode() && !ClassUtil.IsCyclicIfClassIsAccessibleFromParent(parent, innerClassNode, classes.Values)) - { - logger.Log(LogLevel.Error, $"Skipping node with cycle reference: {parent.Name}->{node.Name}"); - - continue; - } - - if (node is ClassPointerNode classPointerNode) - { - node = classPointerNode.GetEquivalentNode(innerClassNode); - } - else - { - wrapperNode.ChangeInnerNode(innerClassNode); - } - } - if (node is BaseTextNode textNode) - { - textNode.Length = Math.Max(IntPtr.Size, Convert.ToInt32(row["length"])); - } - - yield return node; - } - } - - private static IEnumerable Query(SQLiteConnection connection, string query) - { - Contract.Requires(connection != null); - Contract.Requires(query != null); - Contract.Ensures(Contract.Result>() != null); - - using (var adapter = new SQLiteDataAdapter(query, connection)) - { - var ds = new DataSet(); - - adapter.Fill(ds); - - return ds.Tables[0].AsEnumerable(); - } - } - } -} diff --git a/ReClass.NET/Forms/MainForm.Functions.cs b/ReClass.NET/Forms/MainForm.Functions.cs index 5bf0d1c0..72270773 100644 --- a/ReClass.NET/Forms/MainForm.Functions.cs +++ b/ReClass.NET/Forms/MainForm.Functions.cs @@ -192,11 +192,10 @@ public static string ShowOpenProjectFileDialog() using (var ofd = new OpenFileDialog()) { ofd.CheckFileExists = true; - ofd.Filter = $"All ReClass Types |*{ReClassNetFile.FileExtension};*{ReClassFile.FileExtension};*{ReClassQtFile.FileExtension};*{ReClass2007File.FileExtension}" + ofd.Filter = $"All ReClass Types |*{ReClassNetFile.FileExtension};*{ReClassFile.FileExtension};*{ReClassQtFile.FileExtension}" + $"|{ReClassNetFile.FormatName} (*{ReClassNetFile.FileExtension})|*{ReClassNetFile.FileExtension}" + $"|{ReClassFile.FormatName} (*{ReClassFile.FileExtension})|*{ReClassFile.FileExtension}" - + $"|{ReClassQtFile.FormatName} (*{ReClassQtFile.FileExtension})|*{ReClassQtFile.FileExtension}" - + $"|{ReClass2007File.FormatName} (*{ReClass2007File.FileExtension})|*{ReClass2007File.FileExtension}"; + + $"|{ReClassQtFile.FormatName} (*{ReClassQtFile.FileExtension})|*{ReClassQtFile.FileExtension}"; if (ofd.ShowDialog() == DialogResult.OK) { @@ -247,9 +246,6 @@ private static void LoadProjectFromPath(string path, ref ReClassNetProject proje case ReClassFile.FileExtension: import = new ReClassFile(project); break; - case ReClass2007File.FileExtension: - import = new ReClass2007File(project); - break; default: Program.Logger.Log(LogLevel.Error, $"The file '{path}' has an unknown type."); return; diff --git a/ReClass.NET/Forms/MainForm.cs b/ReClass.NET/Forms/MainForm.cs index e69875b2..21c5df8d 100644 --- a/ReClass.NET/Forms/MainForm.cs +++ b/ReClass.NET/Forms/MainForm.cs @@ -710,7 +710,6 @@ private void MainForm_DragEnter(object sender, DragEventArgs e) case ReClassNetFile.FileExtension: case ReClassQtFile.FileExtension: case ReClassFile.FileExtension: - case ReClass2007File.FileExtension: e.Effect = DragDropEffects.Copy; break; } diff --git a/ReClass.NET/ReClass.NET.csproj b/ReClass.NET/ReClass.NET.csproj index 45c36c5d..bb36a2e0 100644 --- a/ReClass.NET/ReClass.NET.csproj +++ b/ReClass.NET/ReClass.NET.csproj @@ -298,7 +298,6 @@ - Form @@ -993,11 +992,6 @@ - - - 1.0.109.2 - - From 9f663a67478642a6a074febf074aff664dc4ad19 Mon Sep 17 00:00:00 2001 From: KN4CK3R Date: Tue, 16 Apr 2019 13:32:21 +0200 Subject: [PATCH 014/223] Removed unused references. --- ReClass.NET/ReClass.NET.csproj | 2 -- 1 file changed, 2 deletions(-) diff --git a/ReClass.NET/ReClass.NET.csproj b/ReClass.NET/ReClass.NET.csproj index bb36a2e0..cc375e78 100644 --- a/ReClass.NET/ReClass.NET.csproj +++ b/ReClass.NET/ReClass.NET.csproj @@ -128,9 +128,7 @@ - - From b7ebbae95c75c32a4676909267abb8389521634f Mon Sep 17 00:00:00 2001 From: KN4CK3R Date: Tue, 16 Apr 2019 14:16:09 +0200 Subject: [PATCH 015/223] Use the given Encoding instance. --- ReClass.NET/Memory/RemoteProcess.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ReClass.NET/Memory/RemoteProcess.cs b/ReClass.NET/Memory/RemoteProcess.cs index aee60957..ff2c0cdd 100644 --- a/ReClass.NET/Memory/RemoteProcess.cs +++ b/ReClass.NET/Memory/RemoteProcess.cs @@ -372,7 +372,7 @@ public string ReadRemoteString(Encoding encoding, IntPtr address, int length) /// Reads a string from the address in the remote process with the given length and encoding. The string gets truncated at the first zero character. /// The encoding used by the string. /// The address of the string. - /// The length of the string. + /// The maximum length of the string. /// The string. public string ReadRemoteStringUntilFirstNullCharacter(Encoding encoding, IntPtr address, int length) { @@ -391,7 +391,7 @@ public string ReadRemoteStringUntilFirstNullCharacter(Encoding encoding, IntPtr try { - return Encoding.UTF8.GetString(data, 0, Math.Min(index, data.Length)); + return encoding.GetString(data, 0, Math.Min(index, data.Length)); } catch { From ee55fdb92ae9150d7b8bc3147e29f3cfaa404177 Mon Sep 17 00:00:00 2001 From: KN4CK3R Date: Tue, 16 Apr 2019 15:03:42 +0200 Subject: [PATCH 016/223] Added interfaces to break down RemoteProcess functionality. --- ReClass.NET/AddressParser/DynamicCompiler.cs | 44 ++++---- ReClass.NET/AddressParser/IExecuter.cs | 2 +- ReClass.NET/AddressParser/Interpreter.cs | 20 ++-- ReClass.NET/Memory/IProcessReader.cs | 16 +++ ReClass.NET/Memory/IRemoteMemoryReader.cs | 106 +++++++++++++++++++ ReClass.NET/Memory/IRemoteMemoryWriter.cs | 20 ++++ ReClass.NET/Memory/RemoteProcess.cs | 74 +------------ ReClass.NET/ReClass.NET.csproj | 3 + 8 files changed, 179 insertions(+), 106 deletions(-) create mode 100644 ReClass.NET/Memory/IProcessReader.cs create mode 100644 ReClass.NET/Memory/IRemoteMemoryReader.cs create mode 100644 ReClass.NET/Memory/IRemoteMemoryWriter.cs diff --git a/ReClass.NET/AddressParser/DynamicCompiler.cs b/ReClass.NET/AddressParser/DynamicCompiler.cs index 15ee1795..4458e210 100644 --- a/ReClass.NET/AddressParser/DynamicCompiler.cs +++ b/ReClass.NET/AddressParser/DynamicCompiler.cs @@ -9,68 +9,68 @@ namespace ReClassNET.AddressParser { public class DynamicCompiler : IExecuter { - public IntPtr Execute(IExpression operation, RemoteProcess process) + public IntPtr Execute(IExpression operation, IProcessReader processReader) { Contract.Requires(operation != null); - Contract.Requires(process != null); + Contract.Requires(processReader != null); - return CompileAddressFormula(operation)(process); + return CompileAddressFormula(operation)(processReader); } - public static Func CompileAddressFormula(IExpression expression) + public static Func CompileAddressFormula(IExpression expression) { Contract.Requires(expression != null); - var processParameter = Expression.Parameter(typeof(RemoteProcess)); + var processParameter = Expression.Parameter(typeof(IProcessReader)); - return Expression.Lambda>( + return Expression.Lambda>( GenerateMethodBody(expression, processParameter), processParameter ).Compile(); } - private static Expression GenerateMethodBody(IExpression operation, ParameterExpression processParameter) + private static Expression GenerateMethodBody(IExpression operation, Expression parameter) { Contract.Requires(operation != null); - Contract.Requires(processParameter != null); + Contract.Requires(parameter != null); switch (operation) { case AddExpression addExpression: { - var argument1 = GenerateMethodBody(addExpression.Lhs, processParameter); - var argument2 = GenerateMethodBody(addExpression.Rhs, processParameter); + var argument1 = GenerateMethodBody(addExpression.Lhs, parameter); + var argument2 = GenerateMethodBody(addExpression.Rhs, parameter); return Expression.Call(null, GetIntPtrExtension(nameof(IntPtrExtension.Add)), argument1, argument2); } case SubtractExpression subtractExpression: { - var argument1 = GenerateMethodBody(subtractExpression.Lhs, processParameter); - var argument2 = GenerateMethodBody(subtractExpression.Rhs, processParameter); + var argument1 = GenerateMethodBody(subtractExpression.Lhs, parameter); + var argument2 = GenerateMethodBody(subtractExpression.Rhs, parameter); return Expression.Call(null, GetIntPtrExtension(nameof(IntPtrExtension.Sub)), argument1, argument2); } case MultiplyExpression multiplyExpression: { - var argument1 = GenerateMethodBody(multiplyExpression.Lhs, processParameter); - var argument2 = GenerateMethodBody(multiplyExpression.Rhs, processParameter); + var argument1 = GenerateMethodBody(multiplyExpression.Lhs, parameter); + var argument2 = GenerateMethodBody(multiplyExpression.Rhs, parameter); return Expression.Call(null, GetIntPtrExtension(nameof(IntPtrExtension.Mul)), argument1, argument2); } case DivideExpression divideExpression: { - var argument1 = GenerateMethodBody(divideExpression.Lhs, processParameter); - var argument2 = GenerateMethodBody(divideExpression.Rhs, processParameter); + var argument1 = GenerateMethodBody(divideExpression.Lhs, parameter); + var argument2 = GenerateMethodBody(divideExpression.Rhs, parameter); return Expression.Call(null, GetIntPtrExtension(nameof(IntPtrExtension.Div)), argument1, argument2); } case ModuleExpression moduleExpression: { - var getModuleByNameFunc = typeof(RemoteProcess).GetRuntimeMethod(nameof(RemoteProcess.GetModuleByName), new[] { typeof(string) }); + var getModuleByNameFunc = typeof(IProcessReader).GetRuntimeMethod(nameof(IProcessReader.GetModuleByName), new[] { typeof(string) }); var moduleNameConstant = Expression.Constant(moduleExpression.Name); var moduleVariable = Expression.Variable(typeof(Memory.Module)); - var assignExpression = Expression.Assign(moduleVariable, Expression.Call(processParameter, getModuleByNameFunc, moduleNameConstant)); + var assignExpression = Expression.Assign(moduleVariable, Expression.Call(parameter, getModuleByNameFunc, moduleNameConstant)); return Expression.Block( new[] { moduleVariable }, @@ -90,12 +90,12 @@ private static Expression GenerateMethodBody(IExpression operation, ParameterExp } case ReadMemoryExpression readMemoryExpression: { - var argument = GenerateMethodBody(readMemoryExpression.Expression, processParameter); + var argument = GenerateMethodBody(readMemoryExpression.Expression, parameter); - var functionName = readMemoryExpression.ByteCount == 4 ? nameof(RemoteProcess.ReadRemoteInt32) : nameof(RemoteProcess.ReadRemoteInt64); - var readRemoteIntFn = typeof(RemoteProcess).GetRuntimeMethod(functionName, new[] { typeof(IntPtr) }); + var functionName = readMemoryExpression.ByteCount == 4 ? nameof(IProcessReader.ReadRemoteInt32) : nameof(IProcessReader.ReadRemoteInt64); + var readRemoteIntFn = typeof(IProcessReader).GetRuntimeMethod(functionName, new[] { typeof(IntPtr) }); - var callExpression = Expression.Call(processParameter, readRemoteIntFn, argument); + var callExpression = Expression.Call(parameter, readRemoteIntFn, argument); var paramType = readMemoryExpression.ByteCount == 4 ? typeof(int) : typeof(long); var convertFn = typeof(IntPtrExtension).GetRuntimeMethod(nameof(IntPtrExtension.From), new[] { paramType }); diff --git a/ReClass.NET/AddressParser/IExecuter.cs b/ReClass.NET/AddressParser/IExecuter.cs index 07e036ad..930813a7 100644 --- a/ReClass.NET/AddressParser/IExecuter.cs +++ b/ReClass.NET/AddressParser/IExecuter.cs @@ -5,6 +5,6 @@ namespace ReClassNET.AddressParser { public interface IExecuter { - IntPtr Execute(IExpression expression, RemoteProcess process); + IntPtr Execute(IExpression expression, IProcessReader processReader); } } diff --git a/ReClass.NET/AddressParser/Interpreter.cs b/ReClass.NET/AddressParser/Interpreter.cs index b113f57d..4e743516 100644 --- a/ReClass.NET/AddressParser/Interpreter.cs +++ b/ReClass.NET/AddressParser/Interpreter.cs @@ -7,10 +7,10 @@ namespace ReClassNET.AddressParser { public class Interpreter : IExecuter { - public IntPtr Execute(IExpression expression, RemoteProcess process) + public IntPtr Execute(IExpression expression, IProcessReader processReader) { Contract.Requires(expression != null); - Contract.Requires(process != null); + Contract.Requires(processReader != null); switch (expression) { @@ -18,7 +18,7 @@ public IntPtr Execute(IExpression expression, RemoteProcess process) return IntPtrExtension.From(constantExpression.Value); case ModuleExpression moduleExpression: { - var module = process.GetModuleByName(moduleExpression.Name); + var module = processReader.GetModuleByName(moduleExpression.Name); if (module != null) { return module.Start; @@ -27,22 +27,22 @@ public IntPtr Execute(IExpression expression, RemoteProcess process) return IntPtr.Zero; } case AddExpression addExpression: - return Execute(addExpression.Lhs, process).Add(Execute(addExpression.Rhs, process)); + return Execute(addExpression.Lhs, processReader).Add(Execute(addExpression.Rhs, processReader)); case SubtractExpression subtractExpression: - return Execute(subtractExpression.Lhs, process).Sub(Execute(subtractExpression.Rhs, process)); + return Execute(subtractExpression.Lhs, processReader).Sub(Execute(subtractExpression.Rhs, processReader)); case MultiplyExpression multiplyExpression: - return Execute(multiplyExpression.Lhs, process).Mul(Execute(multiplyExpression.Rhs, process)); + return Execute(multiplyExpression.Lhs, processReader).Mul(Execute(multiplyExpression.Rhs, processReader)); case DivideExpression divideExpression: - return Execute(divideExpression.Lhs, process).Div(Execute(divideExpression.Rhs, process)); + return Execute(divideExpression.Lhs, processReader).Div(Execute(divideExpression.Rhs, processReader)); case ReadMemoryExpression readMemoryExpression: - var readFromAddress = Execute(readMemoryExpression.Expression, process); + var readFromAddress = Execute(readMemoryExpression.Expression, processReader); if (readMemoryExpression.ByteCount == 4) { - return IntPtrExtension.From(process.ReadRemoteInt32(readFromAddress)); + return IntPtrExtension.From(processReader.ReadRemoteInt32(readFromAddress)); } else { - return IntPtrExtension.From(process.ReadRemoteInt64(readFromAddress)); + return IntPtrExtension.From(processReader.ReadRemoteInt64(readFromAddress)); } default: throw new ArgumentException($"Unsupported operation '{expression.GetType().FullName}'."); diff --git a/ReClass.NET/Memory/IProcessReader.cs b/ReClass.NET/Memory/IProcessReader.cs new file mode 100644 index 00000000..048bbea7 --- /dev/null +++ b/ReClass.NET/Memory/IProcessReader.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; + +namespace ReClassNET.Memory +{ + public interface IProcessReader : IRemoteMemoryReader + { + Section GetSectionToPointer(IntPtr address); + + Module GetModuleToPointer(IntPtr address); + + Module GetModuleByName(string name); + + bool EnumerateRemoteSectionsAndModules(out List
sections, out List modules); + } +} diff --git a/ReClass.NET/Memory/IRemoteMemoryReader.cs b/ReClass.NET/Memory/IRemoteMemoryReader.cs new file mode 100644 index 00000000..b4f75544 --- /dev/null +++ b/ReClass.NET/Memory/IRemoteMemoryReader.cs @@ -0,0 +1,106 @@ +using System; +using System.Text; + +namespace ReClassNET.Memory +{ + public interface IRemoteMemoryReader + { + /// Reads remote memory from the address into the buffer. + /// The address to read from. + /// [out] The data buffer to fill. If the remote process is not valid, the buffer will get filled with zeros. + bool ReadRemoteMemoryIntoBuffer(IntPtr address, ref byte[] buffer); + + /// Reads remote memory from the address into the buffer. + /// The address to read from. + /// [out] The data buffer to fill. If the remote process is not valid, the buffer will get filled with zeros. + /// The offset in the data. + /// The number of bytes to read. + bool ReadRemoteMemoryIntoBuffer(IntPtr address, ref byte[] buffer, int offset, int length); + + /// Reads bytes from the address in the remote process. + /// The address to read from. + /// The size in bytes to read. + /// An array of bytes. + byte[] ReadRemoteMemory(IntPtr address, int size); + + /// Reads the object from the address in the remote process. + /// Type of the value to read. + /// The address to read from. + /// The remote object. + T ReadRemoteObject(IntPtr address) where T : struct; + + /// Reads a from the address in the remote process. + /// The address to read from. + /// The data read as or 0 if the read fails. + sbyte ReadRemoteInt8(IntPtr address); + + /// Reads a from the address in the remote process. + /// The address to read from. + /// The data read as or 0 if the read fails. + byte ReadRemoteUInt8(IntPtr address); + + /// Reads a from the address in the remote process. + /// The address to read from. + /// The data read as or 0 if the read fails. + short ReadRemoteInt16(IntPtr address); + + /// Reads a from the address in the remote process. + /// The address to read from. + /// The data read as or 0 if the read fails. + ushort ReadRemoteUInt16(IntPtr address); + + /// Reads a from the address in the remote process. + /// The address to read from. + /// The data read as or 0 if the read fails. + int ReadRemoteInt32(IntPtr address); + + /// Reads a from the address in the remote process. + /// The address to read from. + /// The data read as or 0 if the read fails. + uint ReadRemoteUInt32(IntPtr address); + + /// Reads a from the address in the remote process. + /// The address to read from. + /// The data read as or 0 if the read fails. + long ReadRemoteInt64(IntPtr address); + + /// Reads a from the address in the remote process. + /// The address to read from. + /// The data read as or 0 if the read fails. + ulong ReadRemoteUInt64(IntPtr address); + + /// Reads a from the address in the remote process. + /// The address to read from. + /// The data read as or 0 if the read fails. + float ReadRemoteFloat(IntPtr address); + + /// Reads a from the address in the remote process. + /// The address to read from. + /// The data read as or 0 if the read fails. + double ReadRemoteDouble(IntPtr address); + + /// Reads a from the address in the remote process. + /// The address to read from. + /// The data read as or 0 if the read fails. + IntPtr ReadRemoteIntPtr(IntPtr address); + + /// Reads a string from the address in the remote process with the given length using the provided encoding. + /// The encoding used by the string. + /// The address of the string. + /// The length of the string. + /// The string. + string ReadRemoteString(Encoding encoding, IntPtr address, int length); + + /// Reads a string from the address in the remote process with the given length and encoding. The string gets truncated at the first zero character. + /// The encoding used by the string. + /// The address of the string. + /// The maximum length of the string. + /// The string. + string ReadRemoteStringUntilFirstNullCharacter(Encoding encoding, IntPtr address, int length); + + /// Reads remote runtime type information for the given address from the remote process. + /// The address. + /// A string containing the runtime type information or null if no information could get found. + string ReadRemoteRuntimeTypeInformation(IntPtr address); + } +} diff --git a/ReClass.NET/Memory/IRemoteMemoryWriter.cs b/ReClass.NET/Memory/IRemoteMemoryWriter.cs new file mode 100644 index 00000000..bc466d42 --- /dev/null +++ b/ReClass.NET/Memory/IRemoteMemoryWriter.cs @@ -0,0 +1,20 @@ +using System; + +namespace ReClassNET.Memory +{ + public interface IRemoteMemoryWriter + { + /// Writes the given to the in the remote process. + /// The address to write to. + /// The data to write. + /// True if it succeeds, false if it fails. + bool WriteRemoteMemory(IntPtr address, byte[] data); + + /// Writes the given to the in the remote process. + /// Type of the value to write. + /// The address to write to. + /// The value to write. + /// True if it succeeds, false if it fails. + bool WriteRemoteMemory(IntPtr address, T value) where T : struct; + } +} diff --git a/ReClass.NET/Memory/RemoteProcess.cs b/ReClass.NET/Memory/RemoteProcess.cs index ff2c0cdd..9378b262 100644 --- a/ReClass.NET/Memory/RemoteProcess.cs +++ b/ReClass.NET/Memory/RemoteProcess.cs @@ -13,13 +13,12 @@ using ReClassNET.MemoryScanner; using ReClassNET.Native; using ReClassNET.Symbols; -using ReClassNET.Util; namespace ReClassNET.Memory { public delegate void RemoteProcessEvent(RemoteProcess sender); - public class RemoteProcess : IDisposable + public class RemoteProcess : IDisposable, IRemoteMemoryReader, IRemoteMemoryWriter, IProcessReader { private readonly object processSync = new object(); @@ -151,9 +150,6 @@ public void Close() #region ReadMemory - /// Reads remote memory from the address into the buffer. - /// The address to read from. - /// [out] The data buffer to fill. If the remote process is not valid, the buffer will get filled with zeros. public bool ReadRemoteMemoryIntoBuffer(IntPtr address, ref byte[] buffer) { Contract.Requires(buffer != null); @@ -162,11 +158,6 @@ public bool ReadRemoteMemoryIntoBuffer(IntPtr address, ref byte[] buffer) return ReadRemoteMemoryIntoBuffer(address, ref buffer, 0, buffer.Length); } - /// Reads remote memory from the address into the buffer. - /// The address to read from. - /// [out] The data buffer to fill. If the remote process is not valid, the buffer will get filled with zeros. - /// The offset in the data. - /// The number of bytes to read. public bool ReadRemoteMemoryIntoBuffer(IntPtr address, ref byte[] buffer, int offset, int length) { Contract.Requires(buffer != null); @@ -188,10 +179,6 @@ public bool ReadRemoteMemoryIntoBuffer(IntPtr address, ref byte[] buffer, int of return coreFunctions.ReadRemoteMemory(handle, address, ref buffer, offset, length); } - /// Reads bytes from the address in the remote process. - /// The address to read from. - /// The size in bytes to read. - /// An array of bytes. public byte[] ReadRemoteMemory(IntPtr address, int size) { Contract.Requires(size >= 0); @@ -202,10 +189,6 @@ public byte[] ReadRemoteMemory(IntPtr address, int size) return data; } - /// Reads the object from the address in the remote process. - /// Type of the value to read. - /// The address to read from. - /// The remote object. public T ReadRemoteObject(IntPtr address) where T : struct { var data = ReadRemoteMemory(address, Marshal.SizeOf()); @@ -219,9 +202,6 @@ public T ReadRemoteObject(IntPtr address) where T : struct #region Read Remote Primitive Types - /// Reads a from the address in the remote process. - /// The address to read from. - /// The data read as or 0 if the read fails. public sbyte ReadRemoteInt8(IntPtr address) { var data = ReadRemoteMemory(address, sizeof(sbyte)); @@ -229,9 +209,6 @@ public sbyte ReadRemoteInt8(IntPtr address) return (sbyte)data[0]; } - /// Reads a from the address in the remote process. - /// The address to read from. - /// The data read as or 0 if the read fails. public byte ReadRemoteUInt8(IntPtr address) { var data = ReadRemoteMemory(address, sizeof(byte)); @@ -239,9 +216,6 @@ public byte ReadRemoteUInt8(IntPtr address) return data[0]; } - /// Reads a from the address in the remote process. - /// The address to read from. - /// The data read as or 0 if the read fails. public short ReadRemoteInt16(IntPtr address) { var data = ReadRemoteMemory(address, sizeof(short)); @@ -249,9 +223,6 @@ public short ReadRemoteInt16(IntPtr address) return BitConverter.ToInt16(data, 0); } - /// Reads a from the address in the remote process. - /// The address to read from. - /// The data read as or 0 if the read fails. public ushort ReadRemoteUInt16(IntPtr address) { var data = ReadRemoteMemory(address, sizeof(ushort)); @@ -259,9 +230,6 @@ public ushort ReadRemoteUInt16(IntPtr address) return BitConverter.ToUInt16(data, 0); } - /// Reads a from the address in the remote process. - /// The address to read from. - /// The data read as or 0 if the read fails. public int ReadRemoteInt32(IntPtr address) { var data = ReadRemoteMemory(address, sizeof(int)); @@ -269,9 +237,6 @@ public int ReadRemoteInt32(IntPtr address) return BitConverter.ToInt32(data, 0); } - /// Reads a from the address in the remote process. - /// The address to read from. - /// The data read as or 0 if the read fails. public uint ReadRemoteUInt32(IntPtr address) { var data = ReadRemoteMemory(address, sizeof(uint)); @@ -279,9 +244,6 @@ public uint ReadRemoteUInt32(IntPtr address) return BitConverter.ToUInt32(data, 0); } - /// Reads a from the address in the remote process. - /// The address to read from. - /// The data read as or 0 if the read fails. public long ReadRemoteInt64(IntPtr address) { var data = ReadRemoteMemory(address, sizeof(long)); @@ -289,9 +251,6 @@ public long ReadRemoteInt64(IntPtr address) return BitConverter.ToInt64(data, 0); } - /// Reads a from the address in the remote process. - /// The address to read from. - /// The data read as or 0 if the read fails. public ulong ReadRemoteUInt64(IntPtr address) { var data = ReadRemoteMemory(address, sizeof(ulong)); @@ -299,9 +258,6 @@ public ulong ReadRemoteUInt64(IntPtr address) return BitConverter.ToUInt64(data, 0); } - /// Reads a from the address in the remote process. - /// The address to read from. - /// The data read as or 0 if the read fails. public float ReadRemoteFloat(IntPtr address) { var data = ReadRemoteMemory(address, sizeof(float)); @@ -309,9 +265,6 @@ public float ReadRemoteFloat(IntPtr address) return BitConverter.ToSingle(data, 0); } - /// Reads a from the address in the remote process. - /// The address to read from. - /// The data read as or 0 if the read fails. public double ReadRemoteDouble(IntPtr address) { var data = ReadRemoteMemory(address, sizeof(double)); @@ -319,9 +272,6 @@ public double ReadRemoteDouble(IntPtr address) return BitConverter.ToDouble(data, 0); } - /// Reads a from the address in the remote process. - /// The address to read from. - /// The data read as or 0 if the read fails. public IntPtr ReadRemoteIntPtr(IntPtr address) { #if RECLASSNET64 @@ -333,11 +283,6 @@ public IntPtr ReadRemoteIntPtr(IntPtr address) #endregion - /// Reads a string from the address in the remote process with the given length using the provided encoding. - /// The encoding used by the string. - /// The address of the string. - /// The length of the string. - /// The string. public string ReadRemoteString(Encoding encoding, IntPtr address, int length) { Contract.Requires(encoding != null); @@ -369,11 +314,6 @@ public string ReadRemoteString(Encoding encoding, IntPtr address, int length) } } - /// Reads a string from the address in the remote process with the given length and encoding. The string gets truncated at the first zero character. - /// The encoding used by the string. - /// The address of the string. - /// The maximum length of the string. - /// The string. public string ReadRemoteStringUntilFirstNullCharacter(Encoding encoding, IntPtr address, int length) { Contract.Requires(encoding != null); @@ -399,9 +339,6 @@ public string ReadRemoteStringUntilFirstNullCharacter(Encoding encoding, IntPtr } } - /// Reads remote runtime type information for the given address from the remote process. - /// The address. - /// A string containing the runtime type information or null if no information could get found. public string ReadRemoteRuntimeTypeInformation(IntPtr address) { if (address.MayBeValid()) @@ -548,10 +485,6 @@ private string ReadRemoteRuntimeTypeInformation64(IntPtr address) #region WriteMemory - /// Writes the given to the in the remote process. - /// The address to write to. - /// The data to write. - /// True if it succeeds, false if it fails. public bool WriteRemoteMemory(IntPtr address, byte[] data) { Contract.Requires(data != null); @@ -564,11 +497,6 @@ public bool WriteRemoteMemory(IntPtr address, byte[] data) return coreFunctions.WriteRemoteMemory(handle, address, ref data, 0, data.Length); } - /// Writes the given to the in the remote process. - /// Type of the value to write. - /// The address to write to. - /// The value to write. - /// True if it succeeds, false if it fails. public bool WriteRemoteMemory(IntPtr address, T value) where T : struct { var data = new byte[Marshal.SizeOf()]; diff --git a/ReClass.NET/ReClass.NET.csproj b/ReClass.NET/ReClass.NET.csproj index cc375e78..cb9f189e 100644 --- a/ReClass.NET/ReClass.NET.csproj +++ b/ReClass.NET/ReClass.NET.csproj @@ -258,6 +258,9 @@ + + + From e0b94625cf9589a2c23cffb73a312823413f180f Mon Sep 17 00:00:00 2001 From: KN4CK3R Date: Tue, 16 Apr 2019 15:36:34 +0200 Subject: [PATCH 017/223] Added tests for Interpreter and DynamicCompiler. Implemented missing NegateExpression. --- ReClass.NET/AddressParser/DynamicCompiler.cs | 28 +++++--- ReClass.NET/AddressParser/Interpreter.cs | 2 + ReClass.NET/Extensions/IntPtrExtensions.cs | 11 ++++ .../AddressParser/DynamicCompilerTest.cs | 17 +++++ .../AddressParser/ExecutorTest.cs | 65 +++++++++++++++++++ .../AddressParser/InterpreterTest.cs | 17 +++++ ReClass.NET_Tests/ReClass.NET_Tests.csproj | 6 ++ 7 files changed, 136 insertions(+), 10 deletions(-) create mode 100644 ReClass.NET_Tests/AddressParser/DynamicCompilerTest.cs create mode 100644 ReClass.NET_Tests/AddressParser/ExecutorTest.cs create mode 100644 ReClass.NET_Tests/AddressParser/InterpreterTest.cs diff --git a/ReClass.NET/AddressParser/DynamicCompiler.cs b/ReClass.NET/AddressParser/DynamicCompiler.cs index 4458e210..d1228398 100644 --- a/ReClass.NET/AddressParser/DynamicCompiler.cs +++ b/ReClass.NET/AddressParser/DynamicCompiler.cs @@ -29,13 +29,27 @@ public static Func CompileAddressFormula(IExpression exp ).Compile(); } - private static Expression GenerateMethodBody(IExpression operation, Expression parameter) + private static Expression GenerateMethodBody(IExpression expression, Expression parameter) { - Contract.Requires(operation != null); + Contract.Requires(expression != null); Contract.Requires(parameter != null); - switch (operation) + switch (expression) { + case ConstantExpression constantExpression: + { + var convertFn = typeof(IntPtrExtension).GetRuntimeMethod(nameof(IntPtrExtension.From), new[] { typeof(long) }); + + return Expression.Call(null, convertFn, Expression.Constant(constantExpression.Value)); + } + case NegateExpression negateExpression: + { + var argument = GenerateMethodBody(negateExpression.Expression, parameter); + + var negateFn = typeof(IntPtrExtension).GetRuntimeMethod(nameof(IntPtrExtension.Negate), new[] { typeof(IntPtr) }); + + return Expression.Call(null, negateFn, argument); + } case AddExpression addExpression: { var argument1 = GenerateMethodBody(addExpression.Lhs, parameter); @@ -82,12 +96,6 @@ private static Expression GenerateMethodBody(IExpression operation, Expression p ) ); } - case ConstantExpression constantExpression: - { - var convertFn = typeof(IntPtrExtension).GetRuntimeMethod(nameof(IntPtrExtension.From), new[] { typeof(long) }); - - return Expression.Call(null, convertFn, Expression.Constant(constantExpression.Value)); - } case ReadMemoryExpression readMemoryExpression: { var argument = GenerateMethodBody(readMemoryExpression.Expression, parameter); @@ -104,7 +112,7 @@ private static Expression GenerateMethodBody(IExpression operation, Expression p } } - throw new ArgumentException($"Unsupported operation '{operation.GetType().FullName}'."); + throw new ArgumentException($"Unsupported operation '{expression.GetType().FullName}'."); } private static MethodInfo GetIntPtrExtension(string name) diff --git a/ReClass.NET/AddressParser/Interpreter.cs b/ReClass.NET/AddressParser/Interpreter.cs index 4e743516..c585764a 100644 --- a/ReClass.NET/AddressParser/Interpreter.cs +++ b/ReClass.NET/AddressParser/Interpreter.cs @@ -16,6 +16,8 @@ public IntPtr Execute(IExpression expression, IProcessReader processReader) { case ConstantExpression constantExpression: return IntPtrExtension.From(constantExpression.Value); + case NegateExpression negateExpression: + return Execute(negateExpression.Expression, processReader).Negate(); case ModuleExpression moduleExpression: { var module = processReader.GetModuleByName(moduleExpression.Name); diff --git a/ReClass.NET/Extensions/IntPtrExtensions.cs b/ReClass.NET/Extensions/IntPtrExtensions.cs index 504f4927..e98eee15 100644 --- a/ReClass.NET/Extensions/IntPtrExtensions.cs +++ b/ReClass.NET/Extensions/IntPtrExtensions.cs @@ -81,6 +81,17 @@ public static int Mod(this IntPtr lhs, int mod) #endif } + [Pure] + [DebuggerStepThrough] + public static IntPtr Negate(this IntPtr ptr) + { +#if RECLASSNET64 + return new IntPtr(-ptr.ToInt64()); +#else + return new IntPtr(-ptr.ToInt32()); +#endif + } + [Pure] [DebuggerStepThrough] public static bool InRange(this IntPtr address, IntPtr start, IntPtr end) diff --git a/ReClass.NET_Tests/AddressParser/DynamicCompilerTest.cs b/ReClass.NET_Tests/AddressParser/DynamicCompilerTest.cs new file mode 100644 index 00000000..df5a490e --- /dev/null +++ b/ReClass.NET_Tests/AddressParser/DynamicCompilerTest.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using ReClassNET.AddressParser; + +namespace ReClass.NET_Tests.AddressParser +{ + public class DynamicCompilerTest : ExecutorTest + { + protected override IExecuter CreateExecutor() + { + return new DynamicCompiler(); + } + } +} diff --git a/ReClass.NET_Tests/AddressParser/ExecutorTest.cs b/ReClass.NET_Tests/AddressParser/ExecutorTest.cs new file mode 100644 index 00000000..e4c44662 --- /dev/null +++ b/ReClass.NET_Tests/AddressParser/ExecutorTest.cs @@ -0,0 +1,65 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Moq; +using NFluent; +using ReClassNET.AddressParser; +using ReClassNET.Memory; +using Xunit; + +namespace ReClass.NET_Tests.AddressParser +{ + public abstract class ExecutorTest + { + protected abstract IExecuter CreateExecutor(); + + public static IEnumerable GetSimpleExpressionTestData() => new List + { + new object[] { "0", (IntPtr)0x0 }, + new object[] { "0 + 0", (IntPtr)0x0 }, + new object[] { "+0", (IntPtr)0x0 }, + new object[] { "-0", (IntPtr)0x0 }, + new object[] { "-1", (IntPtr)(-1) }, + new object[] { "+0 + 0", (IntPtr)0x0 }, + new object[] { "-0 - 0", (IntPtr)0x0 }, + new object[] { "0 + 1", (IntPtr)0x1 }, + new object[] { "0 - 1", (IntPtr)(-1) }, + new object[] { "1 + 2 * 3", (IntPtr)0x7 }, + new object[] { "0x123 + 0x234 * 0x345", (IntPtr)0x73527 } + }; + + [Theory] + [MemberData(nameof(GetSimpleExpressionTestData))] + public void SimpleExpressionTest(string expression, IntPtr expected) + { + var mock = new Mock(); + + var executor = CreateExecutor(); + + Check.That(executor.Execute(Parser.Parse(expression), mock.Object)).IsEqualTo(expected); + } + + public static IEnumerable GetModuleExpressionTestData() => new List + { + new object[] { "", (IntPtr)0x100 }, + new object[] { " + 0", (IntPtr)0x100 }, + new object[] { " + 10", (IntPtr)0x110 }, + new object[] { " * 2", (IntPtr)0x200 } + }; + + [Theory] + [MemberData(nameof(GetModuleExpressionTestData))] + public void ModuleExpressionTest(string expression, IntPtr expected) + { + var mock = new Mock(); + mock.Setup(p => p.GetModuleByName("test.module")) + .Returns(new Module { Start = (IntPtr)0x100 }); + + var executor = CreateExecutor(); + + Check.That(executor.Execute(Parser.Parse(expression), mock.Object)).IsEqualTo(expected); + } + } +} diff --git a/ReClass.NET_Tests/AddressParser/InterpreterTest.cs b/ReClass.NET_Tests/AddressParser/InterpreterTest.cs new file mode 100644 index 00000000..5f201ec0 --- /dev/null +++ b/ReClass.NET_Tests/AddressParser/InterpreterTest.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using ReClassNET.AddressParser; + +namespace ReClass.NET_Tests.AddressParser +{ + public class InterpreterTest : ExecutorTest + { + protected override IExecuter CreateExecutor() + { + return new Interpreter(); + } + } +} diff --git a/ReClass.NET_Tests/ReClass.NET_Tests.csproj b/ReClass.NET_Tests/ReClass.NET_Tests.csproj index 78cff692..57e837c9 100644 --- a/ReClass.NET_Tests/ReClass.NET_Tests.csproj +++ b/ReClass.NET_Tests/ReClass.NET_Tests.csproj @@ -39,6 +39,9 @@ + + + @@ -50,6 +53,9 @@ + + 4.10.1 + 2.5.0 From 4ff826c341e0e85c819eb95c4286e7c9a90a11ff Mon Sep 17 00:00:00 2001 From: KN4CK3R Date: Tue, 16 Apr 2019 15:39:41 +0200 Subject: [PATCH 018/223] Fixed typo. --- ReClass.NET/AddressParser/DynamicCompiler.cs | 10 +++++----- .../AddressParser/{IExecuter.cs => IExecutor.cs} | 2 +- ReClass.NET/AddressParser/Interpreter.cs | 2 +- ReClass.NET/Memory/RemoteProcess.cs | 2 +- ReClass.NET/ReClass.NET.csproj | 2 +- ReClass.NET_Tests/AddressParser/DynamicCompilerTest.cs | 2 +- ReClass.NET_Tests/AddressParser/ExecutorTest.cs | 2 +- ReClass.NET_Tests/AddressParser/InterpreterTest.cs | 2 +- 8 files changed, 12 insertions(+), 12 deletions(-) rename ReClass.NET/AddressParser/{IExecuter.cs => IExecutor.cs} (85%) diff --git a/ReClass.NET/AddressParser/DynamicCompiler.cs b/ReClass.NET/AddressParser/DynamicCompiler.cs index d1228398..0e80a4af 100644 --- a/ReClass.NET/AddressParser/DynamicCompiler.cs +++ b/ReClass.NET/AddressParser/DynamicCompiler.cs @@ -7,17 +7,17 @@ namespace ReClassNET.AddressParser { - public class DynamicCompiler : IExecuter + public class DynamicCompiler : IExecutor { - public IntPtr Execute(IExpression operation, IProcessReader processReader) + public IntPtr Execute(IExpression expression, IProcessReader processReader) { - Contract.Requires(operation != null); + Contract.Requires(expression != null); Contract.Requires(processReader != null); - return CompileAddressFormula(operation)(processReader); + return CompileExpression(expression)(processReader); } - public static Func CompileAddressFormula(IExpression expression) + public static Func CompileExpression(IExpression expression) { Contract.Requires(expression != null); diff --git a/ReClass.NET/AddressParser/IExecuter.cs b/ReClass.NET/AddressParser/IExecutor.cs similarity index 85% rename from ReClass.NET/AddressParser/IExecuter.cs rename to ReClass.NET/AddressParser/IExecutor.cs index 930813a7..0620d0e4 100644 --- a/ReClass.NET/AddressParser/IExecuter.cs +++ b/ReClass.NET/AddressParser/IExecutor.cs @@ -3,7 +3,7 @@ namespace ReClassNET.AddressParser { - public interface IExecuter + public interface IExecutor { IntPtr Execute(IExpression expression, IProcessReader processReader); } diff --git a/ReClass.NET/AddressParser/Interpreter.cs b/ReClass.NET/AddressParser/Interpreter.cs index c585764a..ad7ee372 100644 --- a/ReClass.NET/AddressParser/Interpreter.cs +++ b/ReClass.NET/AddressParser/Interpreter.cs @@ -5,7 +5,7 @@ namespace ReClassNET.AddressParser { - public class Interpreter : IExecuter + public class Interpreter : IExecutor { public IntPtr Execute(IExpression expression, IProcessReader processReader) { diff --git a/ReClass.NET/Memory/RemoteProcess.cs b/ReClass.NET/Memory/RemoteProcess.cs index 9378b262..436c3e05 100644 --- a/ReClass.NET/Memory/RemoteProcess.cs +++ b/ReClass.NET/Memory/RemoteProcess.cs @@ -650,7 +650,7 @@ public IntPtr ParseAddress(string addressFormula) { var expression = Parser.Parse(addressFormula); - func = DynamicCompiler.CompileAddressFormula(expression); + func = DynamicCompiler.CompileExpression(expression); formulaCache.Add(addressFormula, func); } diff --git a/ReClass.NET/ReClass.NET.csproj b/ReClass.NET/ReClass.NET.csproj index cb9f189e..cb62f939 100644 --- a/ReClass.NET/ReClass.NET.csproj +++ b/ReClass.NET/ReClass.NET.csproj @@ -134,7 +134,7 @@ - + diff --git a/ReClass.NET_Tests/AddressParser/DynamicCompilerTest.cs b/ReClass.NET_Tests/AddressParser/DynamicCompilerTest.cs index df5a490e..1ba20a85 100644 --- a/ReClass.NET_Tests/AddressParser/DynamicCompilerTest.cs +++ b/ReClass.NET_Tests/AddressParser/DynamicCompilerTest.cs @@ -9,7 +9,7 @@ namespace ReClass.NET_Tests.AddressParser { public class DynamicCompilerTest : ExecutorTest { - protected override IExecuter CreateExecutor() + protected override IExecutor CreateExecutor() { return new DynamicCompiler(); } diff --git a/ReClass.NET_Tests/AddressParser/ExecutorTest.cs b/ReClass.NET_Tests/AddressParser/ExecutorTest.cs index e4c44662..8fd28c98 100644 --- a/ReClass.NET_Tests/AddressParser/ExecutorTest.cs +++ b/ReClass.NET_Tests/AddressParser/ExecutorTest.cs @@ -13,7 +13,7 @@ namespace ReClass.NET_Tests.AddressParser { public abstract class ExecutorTest { - protected abstract IExecuter CreateExecutor(); + protected abstract IExecutor CreateExecutor(); public static IEnumerable GetSimpleExpressionTestData() => new List { diff --git a/ReClass.NET_Tests/AddressParser/InterpreterTest.cs b/ReClass.NET_Tests/AddressParser/InterpreterTest.cs index 5f201ec0..92348e8a 100644 --- a/ReClass.NET_Tests/AddressParser/InterpreterTest.cs +++ b/ReClass.NET_Tests/AddressParser/InterpreterTest.cs @@ -9,7 +9,7 @@ namespace ReClass.NET_Tests.AddressParser { public class InterpreterTest : ExecutorTest { - protected override IExecuter CreateExecutor() + protected override IExecutor CreateExecutor() { return new Interpreter(); } From a4b9dee823add41eb4cd0f76f10d2549fba62f63 Mon Sep 17 00:00:00 2001 From: KN4CK3R Date: Tue, 16 Apr 2019 16:19:56 +0200 Subject: [PATCH 019/223] Added ReadMemoryExpression tests. --- ReClass.NET/AddressParser/DynamicCompiler.cs | 4 +-- .../AddressParser/ExecutorTest.cs | 32 ++++++++++++++++++- 2 files changed, 33 insertions(+), 3 deletions(-) diff --git a/ReClass.NET/AddressParser/DynamicCompiler.cs b/ReClass.NET/AddressParser/DynamicCompiler.cs index 0e80a4af..47eccb5e 100644 --- a/ReClass.NET/AddressParser/DynamicCompiler.cs +++ b/ReClass.NET/AddressParser/DynamicCompiler.cs @@ -100,8 +100,8 @@ private static Expression GenerateMethodBody(IExpression expression, Expression { var argument = GenerateMethodBody(readMemoryExpression.Expression, parameter); - var functionName = readMemoryExpression.ByteCount == 4 ? nameof(IProcessReader.ReadRemoteInt32) : nameof(IProcessReader.ReadRemoteInt64); - var readRemoteIntFn = typeof(IProcessReader).GetRuntimeMethod(functionName, new[] { typeof(IntPtr) }); + var functionName = readMemoryExpression.ByteCount == 4 ? nameof(IRemoteMemoryReader.ReadRemoteInt32) : nameof(IRemoteMemoryReader.ReadRemoteInt64); + var readRemoteIntFn = typeof(IRemoteMemoryReader).GetRuntimeMethod(functionName, new[] { typeof(IntPtr) }); var callExpression = Expression.Call(parameter, readRemoteIntFn, argument); diff --git a/ReClass.NET_Tests/AddressParser/ExecutorTest.cs b/ReClass.NET_Tests/AddressParser/ExecutorTest.cs index 8fd28c98..01a4597c 100644 --- a/ReClass.NET_Tests/AddressParser/ExecutorTest.cs +++ b/ReClass.NET_Tests/AddressParser/ExecutorTest.cs @@ -27,7 +27,8 @@ public abstract class ExecutorTest new object[] { "0 + 1", (IntPtr)0x1 }, new object[] { "0 - 1", (IntPtr)(-1) }, new object[] { "1 + 2 * 3", (IntPtr)0x7 }, - new object[] { "0x123 + 0x234 * 0x345", (IntPtr)0x73527 } + new object[] { "0x123 + 0x234 * 0x345", (IntPtr)0x73527 }, + new object[] { "4 / 0x2", (IntPtr)0x2 } }; [Theory] @@ -61,5 +62,34 @@ public void ModuleExpressionTest(string expression, IntPtr expected) Check.That(executor.Execute(Parser.Parse(expression), mock.Object)).IsEqualTo(expected); } + + public static IEnumerable GetReadMemoryExpressionTestData() => new List + { + new object[] { "[0]", (IntPtr)0x0 }, + new object[] { "[0] + 10", (IntPtr)0x10 }, + new object[] { "[10]", (IntPtr)0x10 }, + new object[] { "[10 + 10]", (IntPtr)0x20 }, + new object[] { "[[10] + 10]", (IntPtr)0x20 }, + new object[] { "[[10] + [10]] + [10]", (IntPtr)0x30 } + }; + + [Theory] + [MemberData(nameof(GetReadMemoryExpressionTestData))] + public void ReadMemoryExpressionTest(string expression, IntPtr expected) + { + var mock = new Mock(); + mock.Setup(p => p.ReadRemoteInt32((IntPtr)0)) + .Returns(0); + mock.Setup(p => p.ReadRemoteInt32((IntPtr)0x10)) + .Returns(0x10); + mock.Setup(p => p.ReadRemoteInt32((IntPtr)0x20)) + .Returns(0x20); + mock.Setup(p => p.ReadRemoteInt32((IntPtr)0x30)) + .Returns(0x30); + + var executor = CreateExecutor(); + + Check.That(executor.Execute(Parser.Parse(expression), mock.Object)).IsEqualTo(expected); + } } } From 164a582ed8f163f3d7278ef40e2191d5d1a9cff2 Mon Sep 17 00:00:00 2001 From: KN4CK3R Date: Tue, 16 Apr 2019 19:33:29 +0200 Subject: [PATCH 020/223] Added more tests. Fixed project plattform configuration. --- ReClass.NET.sln | 26 +++++---- .../AddressParser/ExecutorTest.cs | 54 ++++++++++++++----- ReClass.NET_Tests/ReClass.NET_Tests.csproj | 26 +++++++-- 3 files changed, 77 insertions(+), 29 deletions(-) diff --git a/ReClass.NET.sln b/ReClass.NET.sln index 9b52dc5d..ec68abfc 100644 --- a/ReClass.NET.sln +++ b/ReClass.NET.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.26730.10 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.28803.156 MinimumVisualStudioVersion = 10.0.40219.1 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ReClass.NET", "ReClass.NET\ReClass.NET.csproj", "{BFB8917D-E9B4-463F-A6E8-612C35728C78}" ProjectSection(ProjectDependencies) = postProject @@ -74,18 +74,16 @@ Global {16591D29-2370-428A-BA11-87E38D0F3551}.Release|x64.Build.0 = Release|Any CPU {16591D29-2370-428A-BA11-87E38D0F3551}.Release|x86.ActiveCfg = Release|Any CPU {16591D29-2370-428A-BA11-87E38D0F3551}.Release|x86.Build.0 = Release|Any CPU - {E2D0424D-738F-41C3-9935-1B282624600F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {E2D0424D-738F-41C3-9935-1B282624600F}.Debug|Any CPU.Build.0 = Debug|Any CPU - {E2D0424D-738F-41C3-9935-1B282624600F}.Debug|x64.ActiveCfg = Debug|Any CPU - {E2D0424D-738F-41C3-9935-1B282624600F}.Debug|x64.Build.0 = Debug|Any CPU - {E2D0424D-738F-41C3-9935-1B282624600F}.Debug|x86.ActiveCfg = Debug|Any CPU - {E2D0424D-738F-41C3-9935-1B282624600F}.Debug|x86.Build.0 = Debug|Any CPU - {E2D0424D-738F-41C3-9935-1B282624600F}.Release|Any CPU.ActiveCfg = Release|Any CPU - {E2D0424D-738F-41C3-9935-1B282624600F}.Release|Any CPU.Build.0 = Release|Any CPU - {E2D0424D-738F-41C3-9935-1B282624600F}.Release|x64.ActiveCfg = Release|Any CPU - {E2D0424D-738F-41C3-9935-1B282624600F}.Release|x64.Build.0 = Release|Any CPU - {E2D0424D-738F-41C3-9935-1B282624600F}.Release|x86.ActiveCfg = Release|Any CPU - {E2D0424D-738F-41C3-9935-1B282624600F}.Release|x86.Build.0 = Release|Any CPU + {E2D0424D-738F-41C3-9935-1B282624600F}.Debug|Any CPU.ActiveCfg = Debug|x86 + {E2D0424D-738F-41C3-9935-1B282624600F}.Debug|x64.ActiveCfg = Debug|x64 + {E2D0424D-738F-41C3-9935-1B282624600F}.Debug|x64.Build.0 = Debug|x64 + {E2D0424D-738F-41C3-9935-1B282624600F}.Debug|x86.ActiveCfg = Debug|x86 + {E2D0424D-738F-41C3-9935-1B282624600F}.Debug|x86.Build.0 = Debug|x86 + {E2D0424D-738F-41C3-9935-1B282624600F}.Release|Any CPU.ActiveCfg = Release|x86 + {E2D0424D-738F-41C3-9935-1B282624600F}.Release|x64.ActiveCfg = Release|x64 + {E2D0424D-738F-41C3-9935-1B282624600F}.Release|x64.Build.0 = Release|x64 + {E2D0424D-738F-41C3-9935-1B282624600F}.Release|x86.ActiveCfg = Release|x86 + {E2D0424D-738F-41C3-9935-1B282624600F}.Release|x86.Build.0 = Release|x86 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/ReClass.NET_Tests/AddressParser/ExecutorTest.cs b/ReClass.NET_Tests/AddressParser/ExecutorTest.cs index 01a4597c..c85284d2 100644 --- a/ReClass.NET_Tests/AddressParser/ExecutorTest.cs +++ b/ReClass.NET_Tests/AddressParser/ExecutorTest.cs @@ -1,8 +1,5 @@ using System; using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using Moq; using NFluent; using ReClassNET.AddressParser; @@ -63,19 +60,19 @@ public void ModuleExpressionTest(string expression, IntPtr expected) Check.That(executor.Execute(Parser.Parse(expression), mock.Object)).IsEqualTo(expected); } - public static IEnumerable GetReadMemoryExpressionTestData() => new List + public static IEnumerable GetReadMemoryExpressionTestData(int bytesToRead) => new List { - new object[] { "[0]", (IntPtr)0x0 }, - new object[] { "[0] + 10", (IntPtr)0x10 }, - new object[] { "[10]", (IntPtr)0x10 }, - new object[] { "[10 + 10]", (IntPtr)0x20 }, - new object[] { "[[10] + 10]", (IntPtr)0x20 }, - new object[] { "[[10] + [10]] + [10]", (IntPtr)0x30 } + new object[] { $"[0,{bytesToRead}]", (IntPtr)0x0 }, + new object[] { $"[0,{bytesToRead}] + 10", (IntPtr)0x10 }, + new object[] { $"[10,{bytesToRead}]", (IntPtr)0x10 }, + new object[] { $"[10 + 10,{bytesToRead}]", (IntPtr)0x20 }, + new object[] { $"[[10,{bytesToRead}] + 10,{bytesToRead}]", (IntPtr)0x20 }, + new object[] { $"[[10,{bytesToRead}] + [10,{bytesToRead}],{bytesToRead}] + [10,{bytesToRead}]", (IntPtr)0x30 } }; [Theory] - [MemberData(nameof(GetReadMemoryExpressionTestData))] - public void ReadMemoryExpressionTest(string expression, IntPtr expected) + [MemberData(nameof(GetReadMemoryExpressionTestData), 4)] + public void ReadMemoryExpression32Test(string expression, IntPtr expected) { var mock = new Mock(); mock.Setup(p => p.ReadRemoteInt32((IntPtr)0)) @@ -91,5 +88,38 @@ public void ReadMemoryExpressionTest(string expression, IntPtr expected) Check.That(executor.Execute(Parser.Parse(expression), mock.Object)).IsEqualTo(expected); } + + [Theory] + [MemberData(nameof(GetReadMemoryExpressionTestData), 8)] + public void ReadMemoryExpression64Test(string expression, IntPtr expected) + { + var mock = new Mock(); + mock.Setup(p => p.ReadRemoteInt64((IntPtr)0)) + .Returns(0); + mock.Setup(p => p.ReadRemoteInt64((IntPtr)0x10)) + .Returns(0x10); + mock.Setup(p => p.ReadRemoteInt64((IntPtr)0x20)) + .Returns(0x20); + mock.Setup(p => p.ReadRemoteInt64((IntPtr)0x30)) + .Returns(0x30); + + var executor = CreateExecutor(); + + Check.That(executor.Execute(Parser.Parse(expression), mock.Object)).IsEqualTo(expected); + } + + [Fact] + public void ReadMemoryExpressionInvariantTest() + { + var mock = new Mock(); + mock.Setup(p => p.ReadRemoteInt32((IntPtr)0x10)) + .Returns(0x10); + mock.Setup(p => p.ReadRemoteInt64((IntPtr)0x10)) + .Returns(0x10); + + var executor = CreateExecutor(); + + Check.That(executor.Execute(Parser.Parse("[10]"), mock.Object)).IsEqualTo((IntPtr)0x10); + } } } diff --git a/ReClass.NET_Tests/ReClass.NET_Tests.csproj b/ReClass.NET_Tests/ReClass.NET_Tests.csproj index 57e837c9..ebc1d829 100644 --- a/ReClass.NET_Tests/ReClass.NET_Tests.csproj +++ b/ReClass.NET_Tests/ReClass.NET_Tests.csproj @@ -3,7 +3,7 @@ Debug - AnyCPU + x86 {E2D0424D-738F-41C3-9935-1B282624600F} Library Properties @@ -16,7 +16,7 @@ - + true full false @@ -26,13 +26,33 @@ 4 x86 - + pdbonly true bin\Release\ TRACE prompt 4 + x86 + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + x64 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + x64 From de54c063dcd6fdcad341ec783bc83a362b96e8d8 Mon Sep 17 00:00:00 2001 From: KN4CK3R Date: Tue, 16 Apr 2019 20:58:55 +0200 Subject: [PATCH 021/223] Removed method overload. --- ReClass.NET/Forms/ProcessInfoForm.cs | 55 ++++++++++++++-------------- ReClass.NET/Memory/RemoteProcess.cs | 15 ++------ 2 files changed, 32 insertions(+), 38 deletions(-) diff --git a/ReClass.NET/Forms/ProcessInfoForm.cs b/ReClass.NET/Forms/ProcessInfoForm.cs index 5c1e5fe0..18990d3f 100644 --- a/ReClass.NET/Forms/ProcessInfoForm.cs +++ b/ReClass.NET/Forms/ProcessInfoForm.cs @@ -66,29 +66,30 @@ private async void ProcessInfoForm_Load(object sender, EventArgs e) return; } - var sections = new DataTable(); - sections.Columns.Add("address", typeof(string)); - sections.Columns.Add("size", typeof(string)); - sections.Columns.Add("name", typeof(string)); - sections.Columns.Add("protection", typeof(string)); - sections.Columns.Add("type", typeof(string)); - sections.Columns.Add("module", typeof(string)); - sections.Columns.Add("section", typeof(Section)); - - var modules = new DataTable(); - modules.Columns.Add("icon", typeof(Icon)); - modules.Columns.Add("name", typeof(string)); - modules.Columns.Add("address", typeof(string)); - modules.Columns.Add("size", typeof(string)); - modules.Columns.Add("path", typeof(string)); - modules.Columns.Add("module", typeof(Module)); + var sectionsTable = new DataTable(); + sectionsTable.Columns.Add("address", typeof(string)); + sectionsTable.Columns.Add("size", typeof(string)); + sectionsTable.Columns.Add("name", typeof(string)); + sectionsTable.Columns.Add("protection", typeof(string)); + sectionsTable.Columns.Add("type", typeof(string)); + sectionsTable.Columns.Add("module", typeof(string)); + sectionsTable.Columns.Add("section", typeof(Section)); + + var modulesTable = new DataTable(); + modulesTable.Columns.Add("icon", typeof(Icon)); + modulesTable.Columns.Add("name", typeof(string)); + modulesTable.Columns.Add("address", typeof(string)); + modulesTable.Columns.Add("size", typeof(string)); + modulesTable.Columns.Add("path", typeof(string)); + modulesTable.Columns.Add("module", typeof(Module)); await Task.Run(() => { - process.EnumerateRemoteSectionsAndModules( - delegate (Section section) + if (process.EnumerateRemoteSectionsAndModules(out var sections, out var modules)) + { + foreach (var section in sections) { - var row = sections.NewRow(); + var row = sectionsTable.NewRow(); row["address"] = section.Start.ToString(Constants.AddressHexFormat); row["size"] = section.Size.ToString(Constants.AddressHexFormat); row["name"] = section.Name; @@ -96,24 +97,24 @@ await Task.Run(() => row["type"] = section.Type.ToString(); row["module"] = section.ModuleName; row["section"] = section; - sections.Rows.Add(row); - }, - delegate (Module module) + sectionsTable.Rows.Add(row); + } + foreach (var module in modules) { - var row = modules.NewRow(); + var row = modulesTable.NewRow(); row["icon"] = NativeMethods.GetIconForFile(module.Path); row["name"] = module.Name; row["address"] = module.Start.ToString(Constants.AddressHexFormat); row["size"] = module.Size.ToString(Constants.AddressHexFormat); row["path"] = module.Path; row["module"] = module; - modules.Rows.Add(row); + modulesTable.Rows.Add(row); } - ); + } }); - sectionsDataGridView.DataSource = sections; - modulesDataGridView.DataSource = modules; + sectionsDataGridView.DataSource = sectionsTable; + modulesDataGridView.DataSource = modulesTable; } private void SelectRow_CellMouseDown(object sender, DataGridViewCellMouseEventArgs e) diff --git a/ReClass.NET/Memory/RemoteProcess.cs b/ReClass.NET/Memory/RemoteProcess.cs index 436c3e05..6b09b159 100644 --- a/ReClass.NET/Memory/RemoteProcess.cs +++ b/ReClass.NET/Memory/RemoteProcess.cs @@ -566,16 +566,6 @@ public string GetNamedAddress(IntPtr address) return null; } - public void EnumerateRemoteSectionsAndModules(Action
callbackSection, Action callbackModule) - { - if (!IsValid) - { - return; - } - - coreFunctions.EnumerateRemoteSectionsAndModules(handle, callbackSection, callbackModule); - } - public bool EnumerateRemoteSectionsAndModules(out List
sections, out List modules) { if (!IsValid) @@ -586,7 +576,10 @@ public bool EnumerateRemoteSectionsAndModules(out List
sections, out Li return false; } - coreFunctions.EnumerateRemoteSectionsAndModules(handle, out sections, out modules); + sections = new List
(); + modules = new List(); + + coreFunctions.EnumerateRemoteSectionsAndModules(handle, sections.Add, modules.Add); return true; } From f4e6ff5a7660580a4a0031c13faa20021bddbbfa Mon Sep 17 00:00:00 2001 From: KN4CK3R Date: Tue, 16 Apr 2019 23:24:43 +0200 Subject: [PATCH 022/223] Refactored code. --- ReClass.NET/Forms/ProcessInfoForm.cs | 87 ++++++++++++++-------------- ReClass.NET/Memory/Dumper.cs | 64 +++++++------------- ReClass.NET/Memory/SimplePeHeader.cs | 54 +++++++++++++++++ ReClass.NET/ReClass.NET.csproj | 1 + 4 files changed, 117 insertions(+), 89 deletions(-) create mode 100644 ReClass.NET/Memory/SimplePeHeader.cs diff --git a/ReClass.NET/Forms/ProcessInfoForm.cs b/ReClass.NET/Forms/ProcessInfoForm.cs index 18990d3f..4a126fe4 100644 --- a/ReClass.NET/Forms/ProcessInfoForm.cs +++ b/ReClass.NET/Forms/ProcessInfoForm.cs @@ -14,12 +14,12 @@ namespace ReClassNET.Forms { public partial class ProcessInfoForm : IconForm { - private readonly RemoteProcess process; + private readonly IProcessReader process; /// The context menu of the sections grid view. public ContextMenuStrip GridContextMenu => contextMenuStrip; - public ProcessInfoForm(RemoteProcess process) + public ProcessInfoForm(IProcessReader process) { Contract.Requires(process != null); @@ -61,11 +61,6 @@ protected override void OnFormClosed(FormClosedEventArgs e) private async void ProcessInfoForm_Load(object sender, EventArgs e) { - if (!process.IsValid) - { - return; - } - var sectionsTable = new DataTable(); sectionsTable.Columns.Add("address", typeof(string)); sectionsTable.Columns.Add("size", typeof(string)); @@ -146,11 +141,8 @@ private void createClassAtAddressToolStripMenuItem_Click(object sender, EventArg private void dumpToolStripMenuItem_Click(object sender, EventArgs e) { - bool isModule; - string fileName; - var initialDirectory = string.Empty; - IntPtr address; - int size; + Func createDialogFn; + Action dumpFn; if (GetToolStripSourceControl(sender) == modulesDataGridView) { @@ -160,11 +152,18 @@ private void dumpToolStripMenuItem_Click(object sender, EventArgs e) return; } - isModule = true; - fileName = $"{Path.GetFileNameWithoutExtension(module.Name)}_Dumped{Path.GetExtension(module.Name)}"; - initialDirectory = Path.GetDirectoryName(module.Path); - address = module.Start; - size = module.Size.ToInt32(); + createDialogFn = () => new SaveFileDialog + { + FileName = $"{Path.GetFileNameWithoutExtension(module.Name)}_Dumped{Path.GetExtension(module.Name)}", + InitialDirectory = Path.GetDirectoryName(module.Path) + }; + + dumpFn = (d, s) => + { + d.DumpModule(module, s); + + MessageBox.Show("Module successfully dumped.", Constants.ApplicationName, MessageBoxButtons.OK, MessageBoxIcon.Information); + }; } else { @@ -174,43 +173,41 @@ private void dumpToolStripMenuItem_Click(object sender, EventArgs e) return; } - isModule = false; - fileName = $"Section_{section.Start.ToString("X")}_{section.End.ToString("X")}.dat"; - address = section.Start; - size = section.Size.ToInt32(); + createDialogFn = () => new SaveFileDialog + { + FileName = $"Section_{section.Start.ToString("X")}_{section.End.ToString("X")}.dat" + }; + + dumpFn = (d, s) => + { + d.DumpSection(section, s); + + MessageBox.Show("Section successfully dumped.", Constants.ApplicationName, MessageBoxButtons.OK, MessageBoxIcon.Information); + }; } - using (var sfd = new SaveFileDialog()) + using (var sfd = createDialogFn()) { - sfd.FileName = fileName; sfd.Filter = "All|*.*"; - sfd.InitialDirectory = initialDirectory; - if (sfd.ShowDialog() == DialogResult.OK) + if (sfd.ShowDialog() != DialogResult.OK) { - var dumper = new Dumper(process); + return; + } - try - { - using (var stream = sfd.OpenFile()) - { - if (isModule) - { - dumper.DumpModule(address, size, stream); - } - else - { - dumper.DumpSection(address, size, stream); - } - - MessageBox.Show("Module successfully dumped.", Constants.ApplicationName, MessageBoxButtons.OK, MessageBoxIcon.Information); - } - } - catch (Exception ex) + var dumper = new Dumper(process); + + try + { + using (var stream = sfd.OpenFile()) { - Program.ShowException(ex); + dumpFn(dumper, stream); } } + catch (Exception ex) + { + Program.ShowException(ex); + } } } @@ -235,7 +232,7 @@ private IntPtr GetSelectedAddress(object sender) } } - private Control GetToolStripSourceControl(object sender) + private static Control GetToolStripSourceControl(object sender) { return ((sender as ToolStripMenuItem)?.GetCurrentParent() as ContextMenuStrip)?.SourceControl; } diff --git a/ReClass.NET/Memory/Dumper.cs b/ReClass.NET/Memory/Dumper.cs index a5cc926a..12d76eb7 100644 --- a/ReClass.NET/Memory/Dumper.cs +++ b/ReClass.NET/Memory/Dumper.cs @@ -6,9 +6,9 @@ namespace ReClassNET.Memory { public class Dumper { - private readonly RemoteProcess process; + private readonly IRemoteMemoryReader process; - public Dumper(RemoteProcess process) + public Dumper(IRemoteMemoryReader process) { Contract.Requires(process != null); Contract.Ensures(this.process != null); @@ -16,11 +16,11 @@ public Dumper(RemoteProcess process) this.process = process; } - /// Dumps a section to the given stream. - /// The begin of the section. - /// The size of the section. + /// Dumps a chunk of memory to the given stream. + /// The begin of the chunk. + /// The size of the chunk. /// The stream to dump to. - public void DumpSection(IntPtr address, int size, Stream stream) + public void DumpRaw(IntPtr address, int size, Stream stream) { Contract.Requires(size >= 0); Contract.Requires(stream != null); @@ -30,54 +30,30 @@ public void DumpSection(IntPtr address, int size, Stream stream) stream.Write(data, 0, data.Length); } - /// Dumps a module to the given stream. The section headers of the pe header get fixed to make a valid pe file. - /// The begin of the module. - /// The size of the module. + /// Dumps a section to the given stream. + /// The section to dump. /// The stream to dump to. - public void DumpModule(IntPtr address, int size, Stream stream) + public void DumpSection(Section section, Stream stream) { - Contract.Requires(size >= 0); + Contract.Requires(section != null); Contract.Requires(stream != null); - var data = process.ReadRemoteMemory(address, size); - - var pe = new SimplePeHeader(data); - - // Fix the section headers. - using (var bw = new BinaryWriter(new MemoryStream(data))) - { - for (var i = 0; i < pe.NumberOfSections; ++i) - { - var offset = pe.SectionOffset(i); - bw.Seek(offset + 16, SeekOrigin.Begin); - bw.Write(BitConverter.ToUInt32(data, offset + 8)); // SizeOfRawData = VirtualSize - bw.Write(BitConverter.ToUInt32(data, offset + 12)); // PointerToRawData = VirtualAddress - } - } - - stream.Write(data, 0, data.Length); + DumpRaw(section.Start, section.Size.ToInt32(), stream); } - private class SimplePeHeader + /// Dumps a module to the given stream. The section headers of the pe header get fixed to build a valid pe file. + /// The module to dump. + /// The stream to dump to. + public void DumpModule(Module module, Stream stream) { - private readonly byte[] data; - - private int e_lfanew => BitConverter.ToInt32(data, 60); - - private int FileHeader => e_lfanew + 4; - - public int NumberOfSections => BitConverter.ToInt16(data, FileHeader + 2); - - private int SizeOfOptionalHeader => BitConverter.ToInt16(data, FileHeader + 16); + Contract.Requires(module != null); + Contract.Requires(stream != null); - private int FirstSectionOffset => e_lfanew + 24 + SizeOfOptionalHeader; + var data = process.ReadRemoteMemory(module.Start, module.Size.ToInt32()); - public int SectionOffset(int index) => FirstSectionOffset + index * 40; + SimplePeHeader.FixSectionHeaders(data); - public SimplePeHeader(byte[] data) - { - this.data = data; - } + stream.Write(data, 0, data.Length); } } } diff --git a/ReClass.NET/Memory/SimplePeHeader.cs b/ReClass.NET/Memory/SimplePeHeader.cs new file mode 100644 index 00000000..e3ffa4b2 --- /dev/null +++ b/ReClass.NET/Memory/SimplePeHeader.cs @@ -0,0 +1,54 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ReClassNET.Memory +{ + public class SimplePeHeader + { + private readonly byte[] data; + + private int e_lfanew => BitConverter.ToInt32(data, 60); + + private int FileHeader => e_lfanew + 4; + + public int NumberOfSections => BitConverter.ToInt16(data, FileHeader + 2); + + private int SizeOfOptionalHeader => BitConverter.ToInt16(data, FileHeader + 16); + + private int FirstSectionOffset => e_lfanew + 24 + SizeOfOptionalHeader; + + public int SectionOffset(int index) => FirstSectionOffset + index * 40; + + private SimplePeHeader(byte[] data) + { + this.data = data; + } + + /// + /// Rewrites the section headers to build a valid pe file. + /// + /// The memory of a dumped module. + public static void FixSectionHeaders(byte[] data) + { + var pe = new SimplePeHeader(data); + + using (var ms = new MemoryStream(data)) + { + using (var bw = new BinaryWriter(ms)) + { + for (var i = 0; i < pe.NumberOfSections; ++i) + { + var offset = pe.SectionOffset(i); + bw.Seek(offset + 16, SeekOrigin.Begin); + bw.Write(BitConverter.ToUInt32(data, offset + 8)); // SizeOfRawData = VirtualSize + bw.Write(BitConverter.ToUInt32(data, offset + 12)); // PointerToRawData = VirtualAddress + } + } + } + } + } +} diff --git a/ReClass.NET/ReClass.NET.csproj b/ReClass.NET/ReClass.NET.csproj index cb62f939..093f428d 100644 --- a/ReClass.NET/ReClass.NET.csproj +++ b/ReClass.NET/ReClass.NET.csproj @@ -265,6 +265,7 @@ + From 64bd7030087d74fa468ba3069ec6c53273e59725 Mon Sep 17 00:00:00 2001 From: c0dycode Date: Sun, 21 Apr 2019 02:13:11 +0200 Subject: [PATCH 023/223] Switched Enum value and name around when reading saved ones so they match the coloumn text --- ReClass.NET/Forms/EnumEditorForm.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ReClass.NET/Forms/EnumEditorForm.cs b/ReClass.NET/Forms/EnumEditorForm.cs index e4b07bcd..573ea1b9 100644 --- a/ReClass.NET/Forms/EnumEditorForm.cs +++ b/ReClass.NET/Forms/EnumEditorForm.cs @@ -26,7 +26,7 @@ public EnumEditorForm(EnumDescription @enum) foreach (var kv in @enum.Values) { - enumDataGridView.Rows.Add(kv.Key, kv.Value); + enumDataGridView.Rows.Add(kv.Value, kv.Key); } } From 90ae192991e7e3ca1a8dd230e65364fc637b5970 Mon Sep 17 00:00:00 2001 From: KN4CK3R Date: Tue, 23 Apr 2019 11:22:24 +0200 Subject: [PATCH 024/223] Added tests for CircularBuffer and GrowingList. --- ReClass.NET/Util/GrowingList.cs | 4 + ReClass.NET_Tests/ReClass.NET_Tests.csproj | 3 + ReClass.NET_Tests/Util/CircularBufferTest.cs | 86 ++++++++++++++++++ ReClass.NET_Tests/Util/GrowingListTest.cs | 91 ++++++++++++++++++++ 4 files changed, 184 insertions(+) create mode 100644 ReClass.NET_Tests/Util/CircularBufferTest.cs create mode 100644 ReClass.NET_Tests/Util/GrowingListTest.cs diff --git a/ReClass.NET/Util/GrowingList.cs b/ReClass.NET/Util/GrowingList.cs index 49bd66b5..2c08e9f4 100644 --- a/ReClass.NET/Util/GrowingList.cs +++ b/ReClass.NET/Util/GrowingList.cs @@ -9,6 +9,8 @@ public class GrowingList public T DefaultValue { get; set; } + public int Count => list.Count; + public GrowingList() { Contract.Ensures(list != null); @@ -24,6 +26,8 @@ public GrowingList(T defaultValue) private void GrowToSize(int size) { + list.Capacity = size; + for (var i = list.Count; i <= size; ++i) { list.Add(DefaultValue); diff --git a/ReClass.NET_Tests/ReClass.NET_Tests.csproj b/ReClass.NET_Tests/ReClass.NET_Tests.csproj index ebc1d829..b5256a8f 100644 --- a/ReClass.NET_Tests/ReClass.NET_Tests.csproj +++ b/ReClass.NET_Tests/ReClass.NET_Tests.csproj @@ -15,6 +15,7 @@ UnitTest + latest true @@ -65,6 +66,8 @@ + + diff --git a/ReClass.NET_Tests/Util/CircularBufferTest.cs b/ReClass.NET_Tests/Util/CircularBufferTest.cs new file mode 100644 index 00000000..c82f4334 --- /dev/null +++ b/ReClass.NET_Tests/Util/CircularBufferTest.cs @@ -0,0 +1,86 @@ +using System; +using System.Linq; +using NFluent; +using ReClassNET.Util; +using Xunit; + +namespace ReClass.NET_Tests.Util +{ + public class CircularBufferTest + { + [Fact] + public void CheckInitialCapacityCount() + { + const int Capacity = 5; + + var cb = new CircularBuffer(Capacity); + + Check.That(cb.Capacity).IsEqualTo(Capacity); + Check.That(cb.Count).IsEqualTo(0); + } + + [Fact] + public void DequeueFromEmptyBufferThrows() + { + var cb = new CircularBuffer(1); + + Check.ThatCode(() => cb.Dequeue()).Throws(); + } + + [Theory] + [InlineData(1)] + [InlineData(2)] + [InlineData(10)] + [InlineData(100)] + public void CheckEnqueueAndDeque(int value) + { + var cb = new CircularBuffer(1); + + var overwrittenValue = cb.Enqueue(value); + + Check.That(overwrittenValue).IsEqualTo(default); + + Check.That(cb.Dequeue()).IsEqualTo(value); + } + + [Theory] + [InlineData(1)] + [InlineData(1, 2)] + [InlineData(1, 2, 3)] + [InlineData(1, 2, 3, 4)] + [InlineData(1, 2, 3, 4, 5)] + public void CheckMultipleEnqueueAndDeque(params int[] values) + { + var cb = new CircularBuffer(values.Length); + + foreach (var value in values) + { + cb.Enqueue(value); + } + + foreach (var value in values.Reverse()) + { + Check.That(cb.Dequeue()).IsEqualTo(value); + } + } + + [Theory] + [InlineData(1, 2)] + [InlineData(1, 2, 3)] + [InlineData(1, 2, 3, 4)] + [InlineData(1, 2, 3, 4, 5)] + public void CheckOverflow(params int[] values) + { + var cb = new CircularBuffer(1); + + cb.Enqueue(values[0]); + + for (var i = 1; i < values.Length; ++i) + { + Check.That(cb.Enqueue(values[i])).IsEqualTo(values[i - 1]); + } + + Check.That(cb.Dequeue()).IsEqualTo(values[values.Length - 1]); + } + } +} diff --git a/ReClass.NET_Tests/Util/GrowingListTest.cs b/ReClass.NET_Tests/Util/GrowingListTest.cs new file mode 100644 index 00000000..66af03bf --- /dev/null +++ b/ReClass.NET_Tests/Util/GrowingListTest.cs @@ -0,0 +1,91 @@ +using NFluent; +using ReClassNET.Util; +using Xunit; + +namespace ReClass.NET_Tests.Util +{ + public class GrowingListTest + { + [Theory] + [InlineData(0)] + [InlineData(1)] + [InlineData(2)] + [InlineData(10)] + [InlineData(100)] + public void CheckSetCount(int index) + { + var gl = new GrowingList + { + [index] = default + }; + + Check.That(gl.Count).IsEqualTo(index + 1); + } + + [Theory] + [InlineData(0, 1, 2)] + [InlineData(1, 2, 3)] + [InlineData(2, 10, 11)] + [InlineData(10, 8, 11)] + [InlineData(100, 200, 201)] + [InlineData(0, 0, 1)] + [InlineData(10, 1, 11)] + [InlineData(2, 1, 3)] + public void CheckMultipleSetCount(int index1, int index2, int expected) + { + var gl = new GrowingList + { + [index1] = default, + [index2] = default + }; + + Check.That(gl.Count).IsEqualTo(expected); + } + + [Theory] + [InlineData(0)] + [InlineData(1)] + [InlineData(2)] + [InlineData(10)] + [InlineData(100)] + public void CheckGetCount(int index) + { + var gl = new GrowingList(); + + var _ = gl[index]; + + Check.That(gl.Count).IsEqualTo(index + 1); + } + + [Theory] + [InlineData(0, 1, 2)] + [InlineData(1, 2, 3)] + [InlineData(2, 10, 11)] + [InlineData(10, 8, 11)] + [InlineData(100, 200, 201)] + [InlineData(0, 0, 1)] + [InlineData(10, 1, 11)] + [InlineData(2, 1, 3)] + public void CheckMultipleGetCount(int index1, int index2, int expected) + { + var gl = new GrowingList(); + + var _ = gl[index1]; + _ = gl[index2]; + + Check.That(gl.Count).IsEqualTo(expected); + } + + [Theory] + [InlineData(1, 0)] + [InlineData(1, 10)] + [InlineData(-1, 0)] + [InlineData(-1, 20)] + public void CheckDefaultValue(int value, int index) + { + var gl = new GrowingList(value); + + Check.That(gl[index]).IsEqualTo(value); + } + } +} From 5bfdc2e80d5ee4e0b41514500f4966e65b121462 Mon Sep 17 00:00:00 2001 From: KN4CK3R Date: Tue, 23 Apr 2019 14:23:25 +0200 Subject: [PATCH 025/223] Added tests for CommandLineArgs and DirectedGraph. --- ReClass.NET/Util/CommandLineArgs.cs | 5 - ReClass.NET/Util/DirectedGraph.cs | 8 +- ReClass.NET_Tests/ReClass.NET_Tests.csproj | 2 + ReClass.NET_Tests/Util/CommandLineArgsTest.cs | 112 ++++++++++ ReClass.NET_Tests/Util/DirectedGraphTest.cs | 195 ++++++++++++++++++ 5 files changed, 313 insertions(+), 9 deletions(-) create mode 100644 ReClass.NET_Tests/Util/CommandLineArgsTest.cs create mode 100644 ReClass.NET_Tests/Util/DirectedGraphTest.cs diff --git a/ReClass.NET/Util/CommandLineArgs.cs b/ReClass.NET/Util/CommandLineArgs.cs index 2a22fc5a..ed504a92 100644 --- a/ReClass.NET/Util/CommandLineArgs.cs +++ b/ReClass.NET/Util/CommandLineArgs.cs @@ -60,11 +60,6 @@ public string this[string strKey] { get { - if (string.IsNullOrEmpty(strKey)) - { - return FileName; - } - if (parms.TryGetValue(strKey.ToLower(), out var strValue)) { return strValue; diff --git a/ReClass.NET/Util/DirectedGraph.cs b/ReClass.NET/Util/DirectedGraph.cs index 9e07ab9a..51968b92 100644 --- a/ReClass.NET/Util/DirectedGraph.cs +++ b/ReClass.NET/Util/DirectedGraph.cs @@ -47,7 +47,7 @@ public void AddVertices(IEnumerable vertices) /// /// /// - public bool HasVertex(T vertex) + public bool ContainsVertex(T vertex) { return adjacencyList.ContainsKey(vertex); } @@ -60,7 +60,7 @@ public bool HasVertex(T vertex) /// True if a new edge was added, false otherwise. public bool AddEdge(T from, T to) { - if (!HasVertex(to) || !adjacencyList.TryGetValue(from, out var edges)) + if (!ContainsVertex(to) || !adjacencyList.TryGetValue(from, out var edges)) { throw new ArgumentException("Vertex does not exist in graph."); } @@ -74,9 +74,9 @@ public bool AddEdge(T from, T to) /// /// /// - public bool HasEdge(T from, T to) + public bool ContainsEdge(T from, T to) { - if (!HasVertex(to) || !adjacencyList.TryGetValue(from, out var edges)) + if (!ContainsVertex(to) || !adjacencyList.TryGetValue(from, out var edges)) { throw new ArgumentException("Vertex does not exist in graph."); } diff --git a/ReClass.NET_Tests/ReClass.NET_Tests.csproj b/ReClass.NET_Tests/ReClass.NET_Tests.csproj index b5256a8f..2db93137 100644 --- a/ReClass.NET_Tests/ReClass.NET_Tests.csproj +++ b/ReClass.NET_Tests/ReClass.NET_Tests.csproj @@ -67,6 +67,8 @@ + + diff --git a/ReClass.NET_Tests/Util/CommandLineArgsTest.cs b/ReClass.NET_Tests/Util/CommandLineArgsTest.cs new file mode 100644 index 00000000..7ef2ff60 --- /dev/null +++ b/ReClass.NET_Tests/Util/CommandLineArgsTest.cs @@ -0,0 +1,112 @@ +using System.Collections.Generic; +using System.Linq; +using NFluent; +using ReClassNET.Util; +using Xunit; + +namespace ReClass.NET_Tests.Util +{ + public class CommandLineArgsTest + { + [Fact] + public void TestNullArgs() + { + var sut = new CommandLineArgs(null); + + Check.That(sut.FileNames).IsEmpty(); + Check.That(sut.Parameters).IsEmpty(); + } + + [Fact] + public void TestEmptyArgs() + { + var sut = new CommandLineArgs(new string[0]); + + Check.That(sut.FileNames).IsEmpty(); + Check.That(sut.Parameters).IsEmpty(); + } + + [Fact] + public void TestEmptyStringArgs() + { + var sut = new CommandLineArgs(new[] { string.Empty, string.Empty }); + + Check.That(sut.FileNames).IsEmpty(); + Check.That(sut.Parameters).IsEmpty(); + } + + [Theory] + [InlineData("test.test")] + [InlineData("test.test", "test2.test")] + [InlineData("C:/test.test", "test2.test")] + [InlineData("test.test", "C:/test2.test")] + [InlineData("C:/test.test", "C:/test2.test")] + [InlineData(@"C:\test.test", "test2.test")] + [InlineData(@"test.test", @"C:\test2.test")] + [InlineData(@"C:\test.test", @"C:\test2.test")] + public void TestFilenames(params string[] args) + { + var sut = new CommandLineArgs(args); + + Check.That(sut.FileName).IsEqualTo(args[0]); + Check.That(sut.FileNames).HasSize(args.Length); + Check.That(sut.FileNames).IsEquivalentTo(args); + + Check.That(sut.Parameters).IsEmpty(); + } + + [Theory] + [InlineData("-p")] + [InlineData("-p=")] + [InlineData("-p:")] + [InlineData("-p=123")] + [InlineData("-p:123")] + [InlineData("--p")] + [InlineData("--p=")] + [InlineData("--p:")] + [InlineData("--p=123")] + [InlineData("--p:123")] + public void TestParameterFormats(string arg) + { + var sut = new CommandLineArgs(new [] { arg }); + + Check.That(sut.Parameters).HasSize(1); + Check.That(sut.Parameters.First().Key).IsEqualTo("p"); + + Check.That(sut.FileNames).IsEmpty(); + } + + [Theory] + [InlineData("-p", "")] + [InlineData("-p=", "")] + [InlineData("-p:", "")] + [InlineData("-p=123", "123")] + [InlineData("-p:123", "123")] + public void TestParameterValues(string arg, string expectedValue) + { + var sut = new CommandLineArgs(new[] { arg }); + + Check.That(sut.Parameters.First().Value).IsEqualTo(expectedValue); + } + + public static IEnumerable GetTestFilenamesAndParametersData() => new List + { + new object[] { new[] { "test.test" }, 1, 0 }, + new object[] { new[] { "-p" }, 0, 1 }, + new object[] { new[] { "test.test", "-p" }, 1, 1 }, + new object[] { new[] { "test.test", "-p", "test2.test" }, 2, 1 }, + new object[] { new[] { "test.test", "-p", "-p2=123", "test2.test" }, 2, 2 }, + new object[] { new[] { "-p3:4", "test.test", "-p", "-p2=123", "test2.test" }, 2, 3 } + }; + + [Theory] + [MemberData(nameof(GetTestFilenamesAndParametersData))] + public void TestFilenamesAndParameters(string[] args, int expectedFilenames, int expectedParameters) + { + var sut = new CommandLineArgs(args); + + Check.That(sut.FileNames).HasSize(expectedFilenames); + Check.That(sut.Parameters).HasSize(expectedParameters); + } + } +} diff --git a/ReClass.NET_Tests/Util/DirectedGraphTest.cs b/ReClass.NET_Tests/Util/DirectedGraphTest.cs new file mode 100644 index 00000000..624ae7e4 --- /dev/null +++ b/ReClass.NET_Tests/Util/DirectedGraphTest.cs @@ -0,0 +1,195 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using NFluent; +using ReClassNET.Util; +using Xunit; + +namespace ReClass.NET_Tests.Util +{ + public class DirectedGraphTest + { + [Fact] + public void TestAddContainsVertex() + { + const int Vertex = 0; + + var sut = new DirectedGraph(); + + Check.That(sut.AddVertex(Vertex)).IsTrue(); + + Check.That(sut.ContainsVertex(Vertex)).IsTrue(); + } + + [Fact] + public void TestAddExistingVertex() + { + const int Vertex = 0; + + var sut = new DirectedGraph(); + + sut.AddVertex(Vertex); + + Check.That(sut.AddVertex(Vertex)).IsFalse(); + } + + [Fact] + public void TestContainsWithEmptyGraph() + { + const int Vertex = 0; + + var sut = new DirectedGraph(); + + Check.That(sut.ContainsVertex(Vertex)).IsFalse(); + } + + [Fact] + public void TestAddContainsMultipleVertices() + { + var vertices = new[] { 0, 1, 2, 3 }; + + var sut = new DirectedGraph(); + + sut.AddVertices(vertices); + + foreach (var vertex in vertices) + { + Check.That(sut.ContainsVertex(vertex)).IsTrue(); + } + + Check.That(sut.Vertices).IsEquivalentTo(vertices); + } + + [Fact] + public void TestAddEdgeToNonExistingVertex() + { + const int Vertex1 = 0; + const int Vertex2 = 1; + + var sut = new DirectedGraph(); + + Check.ThatCode(() => sut.AddEdge(Vertex1, Vertex2)).Throws(); + + sut.AddVertex(Vertex1); + + Check.ThatCode(() => sut.AddEdge(Vertex1, Vertex2)).Throws(); + Check.ThatCode(() => sut.AddEdge(Vertex2, Vertex1)).Throws(); + } + + [Fact] + public void TestContainsEdgeToNonExistingVertex() + { + const int Vertex1 = 0; + const int Vertex2 = 1; + + var sut = new DirectedGraph(); + + Check.ThatCode(() => sut.ContainsEdge(Vertex1, Vertex2)).Throws(); + + sut.AddVertex(Vertex1); + + Check.ThatCode(() => sut.ContainsEdge(Vertex1, Vertex2)).Throws(); + Check.ThatCode(() => sut.ContainsEdge(Vertex2, Vertex1)).Throws(); + } + + [Fact] + public void TestAddContainsEdge() + { + const int Vertex1 = 0; + const int Vertex2 = 1; + + var sut = new DirectedGraph(); + + sut.AddVertex(Vertex1); + sut.AddVertex(Vertex2); + + Check.That(sut.ContainsEdge(Vertex1, Vertex2)).IsFalse(); + + Check.That(sut.AddEdge(Vertex1, Vertex2)).IsTrue(); + + Check.That(sut.ContainsEdge(Vertex1, Vertex2)).IsTrue(); + } + + [Fact] + public void TestAddExistingEdge() + { + const int Vertex1 = 0; + const int Vertex2 = 1; + + var sut = new DirectedGraph(); + + sut.AddVertex(Vertex1); + sut.AddVertex(Vertex2); + sut.AddEdge(Vertex1, Vertex2); + + Check.That(sut.AddEdge(Vertex1, Vertex2)).IsFalse(); + } + + [Fact] + public void TestGetNeighboursOfNonExistingVertex() + { + const int Vertex = 0; + + var sut = new DirectedGraph(); + + Check.ThatCode(() => sut.GetNeighbours(Vertex)).Throws(); + } + + public static IEnumerable GetTestGetNeighboursData() => new List + { + new object[] { new[] { 1 }, new[] { new[] { 1, 1 } }, new[] { 1 } }, + new object[] { new[] { 1, 2 }, new[] { new[] { 2, 1 } }, new int[0] }, + new object[] { new[] { 1, 2 }, new[] { new[] { 1, 2 } }, new[] { 2 } }, + new object[] { new[] { 1, 2, 3 }, new[] { new[] { 2, 1 }, new[] { 2, 3 } }, new int[0] }, + new object[] { new[] { 1, 2, 3 }, new[] { new[] { 1, 2 }, new[] { 2, 3 } }, new[] { 2 } }, + new object[] { new[] { 1, 2, 3 }, new[] { new[] { 1, 2 }, new[] { 1, 3 } }, new[] { 2, 3 } }, + new object[] { new[] { 1, 2, 3 }, new[] { new[] { 1, 1 }, new[] { 1, 2 }, new[] { 1, 3 } }, new[] { 1, 2, 3 } } + }; + + [Theory] + [MemberData(nameof(GetTestGetNeighboursData))] + public void TestGetNeighbours(int[] vertices, int[][] edges, int[] neighbours) + { + var sut = new DirectedGraph(); + + sut.AddVertices(vertices); + + foreach (var edge in edges) + { + sut.AddEdge(edge[0], edge[1]); + } + + Check.That(sut.GetNeighbours(vertices[0])).IsEquivalentTo(neighbours); + } + + public static IEnumerable GetTestContainsCycleData() => new List + { + new object[] { new[] { 1 }, new[] { new[] { 1, 1 } }, true }, + new object[] { new[] { 1, 2 }, new[] { new[] { 1, 2 } }, false }, + new object[] { new[] { 1, 2 }, new[] { new[] { 1, 2 }, new[] { 2, 1 } }, true }, + new object[] { new[] { 1, 2, 3 }, new[] { new[] { 1, 2 }, new[] { 2, 3 } }, false }, + new object[] { new[] { 1, 2, 3 }, new[] { new[] { 1, 2 }, new[] { 1, 3 }, new[] { 2, 3 } }, false }, + new object[] { new[] { 1, 2, 3 }, new[] { new[] { 1, 2 }, new[] { 2, 3 }, new[] { 3, 1 } }, true }, + new object[] { new[] { 1, 2, 3 }, new[] { new[] { 1, 2 }, new[] { 2, 3 }, new[] { 3, 2 } }, true }, + new object[] { new[] { 1, 2, 3 }, new[] { new[] { 1, 2 }, new[] { 2, 1 }, new[] { 2, 3 }, new[] { 3, 2 } }, true } + }; + + [Theory] + [MemberData(nameof(GetTestContainsCycleData))] + public void TestContainsCycle(int[] vertices, int[][] edges, bool containsCycle) + { + var sut = new DirectedGraph(); + + sut.AddVertices(vertices); + + foreach (var edge in edges) + { + sut.AddEdge(edge[0], edge[1]); + } + + Check.That(sut.ContainsCycle()).IsEqualTo(containsCycle); + } + } +} From f024d1a498db6b6d1e565a2af0a7993183c077a4 Mon Sep 17 00:00:00 2001 From: KN4CK3R Date: Wed, 24 Apr 2019 09:36:37 +0200 Subject: [PATCH 026/223] Extracted methods to individual classes. --- ReClass.NET/Forms/ScannerForm.cs | 4 +- ReClass.NET/MemoryScanner/MemoryRecord.cs | 4 +- ReClass.NET/Nodes/ClassNode.cs | 11 ++-- ReClass.NET/ReClass.NET.csproj | 2 + ReClass.NET/Util/HexadecimalFormatter.cs | 46 ++++++++++++++++ ReClass.NET/Util/NumberFormat.cs | 28 ++++++++++ ReClass.NET/Util/Util.cs | 66 ----------------------- 7 files changed, 88 insertions(+), 73 deletions(-) create mode 100644 ReClass.NET/Util/HexadecimalFormatter.cs create mode 100644 ReClass.NET/Util/NumberFormat.cs diff --git a/ReClass.NET/Forms/ScannerForm.cs b/ReClass.NET/Forms/ScannerForm.cs index cfbefa55..47f602a5 100644 --- a/ReClass.NET/Forms/ScannerForm.cs +++ b/ReClass.NET/Forms/ScannerForm.cs @@ -764,9 +764,9 @@ int CalculateSignificantDigits(string input, NumberFormatInfo numberFormat) return digits; } - var nf1 = Utils.GuessNumberFormat(dualValueBox.Value1); + var nf1 = NumberFormat.GuessNumberFormat(dualValueBox.Value1); if (!double.TryParse(dualValueBox.Value1, NumberStyles.Float, nf1, out var value1)) throw new InvalidInputException(dualValueBox.Value1); - var nf2 = Utils.GuessNumberFormat(dualValueBox.Value2); + var nf2 = NumberFormat.GuessNumberFormat(dualValueBox.Value2); if (!double.TryParse(dualValueBox.Value2, NumberStyles.Float, nf2, out var value2) && checkBothInputFields) throw new InvalidInputException(dualValueBox.Value2); var significantDigits = Math.Max( diff --git a/ReClass.NET/MemoryScanner/MemoryRecord.cs b/ReClass.NET/MemoryScanner/MemoryRecord.cs index aefc35c7..a9b3968f 100644 --- a/ReClass.NET/MemoryScanner/MemoryRecord.cs +++ b/ReClass.NET/MemoryScanner/MemoryRecord.cs @@ -253,7 +253,7 @@ public void SetValue(RemoteProcess process, string input, bool isHex) } else if (ValueType == ScanValueType.Float || ValueType == ScanValueType.Double) { - var nf = Utils.GuessNumberFormat(input); + var nf = NumberFormat.GuessNumberFormat(input); double.TryParse(input, NumberStyles.Float, nf, out var value); switch (ValueType) @@ -281,7 +281,7 @@ public void SetValue(RemoteProcess process, string input, bool isHex) private static string FormatValue(long value, bool showAsHex) => showAsHex ? value.ToString("X") : value.ToString(); private static string FormatValue(float value) => value.ToString("0.0000"); private static string FormatValue(double value) => value.ToString("0.0000"); - private static string FormatValue(byte[] value) => Utils.ByteArrayToHexString(value); + private static string FormatValue(byte[] value) => HexadecimalFormatter.ToString(value); private static string FormatValue(string value) => value; } } diff --git a/ReClass.NET/Nodes/ClassNode.cs b/ReClass.NET/Nodes/ClassNode.cs index 3fd6543b..5e6b0cbe 100644 --- a/ReClass.NET/Nodes/ClassNode.cs +++ b/ReClass.NET/Nodes/ClassNode.cs @@ -133,12 +133,17 @@ public override Size Draw(ViewInfo view, int x, int y) nv.Level++; foreach (var node in Nodes) { + Size AggregateNodeSizes(Size baseSize, Size newSize) + { + return new Size(Math.Max(baseSize.Width, newSize.Width), baseSize.Height + newSize.Height); + } + // Draw the node if it is in the visible area. if (view.ClientArea.Contains(tx, y)) { var innerSize = node.Draw(nv, tx, y); - size = Utils.AggregateNodeSizes(size, innerSize.Extend(childOffset, 0)); + size = AggregateNodeSizes(size, innerSize.Extend(childOffset, 0)); y += innerSize.Height; } @@ -153,14 +158,14 @@ public override Size Draw(ViewInfo view, int x, int y) // then draw the node... var innerSize = node.Draw(nv, tx, y); - size = Utils.AggregateNodeSizes(size, innerSize.Extend(childOffset, 0)); + size = AggregateNodeSizes(size, innerSize.Extend(childOffset, 0)); y += innerSize.Height; } else { // or skip drawing and just use the calculated height. - size = Utils.AggregateNodeSizes(size, new Size(0, calculatedHeight)); + size = AggregateNodeSizes(size, new Size(0, calculatedHeight)); y += calculatedHeight; } diff --git a/ReClass.NET/ReClass.NET.csproj b/ReClass.NET/ReClass.NET.csproj index 093f428d..ae45a20f 100644 --- a/ReClass.NET/ReClass.NET.csproj +++ b/ReClass.NET/ReClass.NET.csproj @@ -505,7 +505,9 @@ + + diff --git a/ReClass.NET/Util/HexadecimalFormatter.cs b/ReClass.NET/Util/HexadecimalFormatter.cs new file mode 100644 index 00000000..6e4fa50c --- /dev/null +++ b/ReClass.NET/Util/HexadecimalFormatter.cs @@ -0,0 +1,46 @@ +using System.Diagnostics.Contracts; + +namespace ReClassNET.Util +{ + public static class HexadecimalFormatter + { + private static readonly uint[] lookup = CreateHexLookup(); + + private static uint[] CreateHexLookup() + { + var result = new uint[256]; + for (var i = 0; i < 256; i++) + { + var s = i.ToString("X2"); + result[i] = (uint)s[0] + ((uint)s[1] << 16); + } + return result; + } + + public static string ToString(byte[] data) + { + Contract.Requires(data != null); + + if (data.Length == 0) + { + return string.Empty; + } + + var result = new char[data.Length * 2 + data.Length - 1]; + + var val = lookup[data[0]]; + result[0] = (char)val; + result[1] = (char)(val >> 16); + + for (var i = 1; i < data.Length; i++) + { + val = lookup[data[i]]; + result[3 * i - 1] = ' '; + result[3 * i] = (char)val; + result[3 * i + 1] = (char)(val >> 16); + } + + return new string(result); + } + } +} diff --git a/ReClass.NET/Util/NumberFormat.cs b/ReClass.NET/Util/NumberFormat.cs new file mode 100644 index 00000000..df374619 --- /dev/null +++ b/ReClass.NET/Util/NumberFormat.cs @@ -0,0 +1,28 @@ +using System.Diagnostics.Contracts; +using System.Globalization; + +namespace ReClassNET.Util +{ + public class NumberFormat + { + public static NumberFormatInfo GuessNumberFormat(string input) + { + Contract.Requires(input != null); + Contract.Ensures(Contract.Result() != null); + + if (input.Contains(",") && !input.Contains(".")) + { + return new NumberFormatInfo + { + NumberDecimalSeparator = ",", + NumberGroupSeparator = "." + }; + } + return new NumberFormatInfo + { + NumberDecimalSeparator = ".", + NumberGroupSeparator = "," + }; + } + } +} diff --git a/ReClass.NET/Util/Util.cs b/ReClass.NET/Util/Util.cs index b756199f..850f23ad 100644 --- a/ReClass.NET/Util/Util.cs +++ b/ReClass.NET/Util/Util.cs @@ -1,8 +1,6 @@ using System; using System.Collections.Generic; using System.Diagnostics.Contracts; -using System.Drawing; -using System.Globalization; namespace ReClassNET.Util { @@ -52,69 +50,5 @@ public static void Swap(ref T lhs, ref T rhs) lhs = rhs; rhs = temp; } - - public static Size AggregateNodeSizes(Size baseSize, Size newSize) - { - return new Size(Math.Max(baseSize.Width, newSize.Width), baseSize.Height + newSize.Height); - } - - public static NumberFormatInfo GuessNumberFormat(string input) - { - Contract.Requires(input != null); - Contract.Ensures(Contract.Result() != null); - - if (input.Contains(",") && !input.Contains(".")) - { - return new NumberFormatInfo - { - NumberDecimalSeparator = ",", - NumberGroupSeparator = "." - }; - } - return new NumberFormatInfo - { - NumberDecimalSeparator = ".", - NumberGroupSeparator = "," - }; - } - - private static readonly uint[] hexLookup = CreateHexLookup(); - - private static uint[] CreateHexLookup() - { - var result = new uint[256]; - for (var i = 0; i < 256; i++) - { - var s = i.ToString("X2"); - result[i] = (uint)s[0] + ((uint)s[1] << 16); - } - return result; - } - - public static string ByteArrayToHexString(byte[] data) - { - Contract.Requires(data != null); - - if (data.Length == 0) - { - return string.Empty; - } - - var lookup = hexLookup; - var result = new char[data.Length * 2 + data.Length - 1]; - - var val = lookup[data[0]]; - result[0] = (char)val; - result[1] = (char)(val >> 16); - - for (var i = 1; i < data.Length; i++) - { - val = lookup[data[i]]; - result[3 * i - 1] = ' '; - result[3 * i] = (char)val; - result[3 * i + 1] = (char)(val >> 16); - } - return new string(result); - } } } From ec18bd675b7a7603bcb5c6af86f30146e1ece11e Mon Sep 17 00:00:00 2001 From: KN4CK3R Date: Wed, 24 Apr 2019 14:02:16 +0200 Subject: [PATCH 027/223] Added tests for CustomDataMap, HexadecimalFormatter, PathUtil and XElementSerializer. --- ReClass.NET/Util/CustomDataMap.cs | 82 ++++----- ReClass.NET/Util/NumberFormat.cs | 8 +- ReClass.NET/Util/PathUtil.cs | 2 +- ReClass.NET_Tests/ReClass.NET_Tests.csproj | 7 + ReClass.NET_Tests/Util/CustomDataMapTest.cs | 158 ++++++++++++++++++ .../Util/HexadecimalFormatterTest.cs | 24 +++ ReClass.NET_Tests/Util/NumberFormatTest.cs | 22 +++ ReClass.NET_Tests/Util/PathUtilTest.cs | 31 ++++ .../Util/XElementSerializerTest.cs | 101 +++++++++++ 9 files changed, 393 insertions(+), 42 deletions(-) create mode 100644 ReClass.NET_Tests/Util/CustomDataMapTest.cs create mode 100644 ReClass.NET_Tests/Util/HexadecimalFormatterTest.cs create mode 100644 ReClass.NET_Tests/Util/NumberFormatTest.cs create mode 100644 ReClass.NET_Tests/Util/PathUtilTest.cs create mode 100644 ReClass.NET_Tests/Util/XElementSerializerTest.cs diff --git a/ReClass.NET/Util/CustomDataMap.cs b/ReClass.NET/Util/CustomDataMap.cs index 224fa39d..6a077486 100644 --- a/ReClass.NET/Util/CustomDataMap.cs +++ b/ReClass.NET/Util/CustomDataMap.cs @@ -47,36 +47,30 @@ public string this[string key] } /// - /// Sets a configuration item. + /// Removes an item. /// /// The key of the item. - /// - /// The value of the item. - /// If the value is null the item gets removed. - /// + public void RemoveValue(string key) + { + ValidateKey(key); + + data.Remove(key); + } + + /// + /// Sets the string value of an item. + /// + /// The key of the item. + /// The value of the item. public void SetString(string key, string value) { - if (key == null) - { - throw new ArgumentNullException(nameof(key)); - } - if (key.Length == 0) - { - throw new ArgumentException(); - } + ValidateKey(key); - if (value == null) - { - data.Remove(key); - } - else - { - data[key] = value; - } + data[key] = value; } /// - /// Sets a configuration item. + /// Sets the boolean value of an item. /// /// The key of the item. /// The value of the item. @@ -86,7 +80,7 @@ public void SetBool(string key, bool value) } /// - /// Sets a configuration item. + /// Sets the long value of an item. /// /// The key of the item. /// The value of the item. @@ -96,7 +90,7 @@ public void SetLong(string key, long value) } /// - /// Sets a configuration item. + /// Sets the ulong value of an item. /// /// The key of the item. /// The value of the item. @@ -105,13 +99,18 @@ public void SetULong(string key, ulong value) SetString(key, value.ToString(NumberFormatInfo.InvariantInfo)); } + /// + /// Sets the XElement value of an item. + /// + /// The key of the item. + /// The value of the item. public void SetXElement(string key, XElement value) { - SetString(key, value.ToString()); + SetString(key, value?.ToString()); } /// - /// Gets the value of the config item. + /// Gets the string value of the item. /// /// The key of the item. /// The value of the config item or null if the key does not exists. @@ -121,21 +120,14 @@ public string GetString(string key) } /// - /// Gets the value of the config item. + /// Gets the string value of the item. /// /// The key of the item. /// The default value if the key does not exists. /// The value of the config item or if the key does not exists. public string GetString(string key, string def) { - if (key == null) - { - throw new ArgumentNullException(nameof(key)); - } - if (key.Length == 0) - { - throw new ArgumentException(); - } + ValidateKey(key); if (data.TryGetValue(key, out var value)) { @@ -146,7 +138,7 @@ public string GetString(string key, string def) } /// - /// Gets the value of the config item. + /// Gets the boolean value of the item. /// /// The key of the item. /// The default value if the key does not exists. @@ -163,7 +155,7 @@ public bool GetBool(string key, bool def) } /// - /// Gets the value of the config item. + /// Gets the long value of the item. /// /// The key of the item. /// The default value if the key does not exists. @@ -185,7 +177,7 @@ public long GetLong(string key, long def) } /// - /// Gets the value of the config item. + /// Gets the ulong value of the item. /// /// The key of the item. /// The default value if the key does not exists. @@ -207,7 +199,7 @@ public ulong GetULong(string key, ulong def) } /// - /// Gets the value of the config item. + /// Gets the XElement value of the item. /// /// The key of the item. /// The default value if the key does not exists. @@ -222,5 +214,17 @@ public XElement GetXElement(string key, XElement def) return XElement.Parse(str); } + + /// + /// Validates the given key. + /// + /// The key of an item. + private static void ValidateKey(string key) + { + if (key == null) + { + throw new ArgumentNullException(nameof(key)); + } + } } } diff --git a/ReClass.NET/Util/NumberFormat.cs b/ReClass.NET/Util/NumberFormat.cs index df374619..6c4e91be 100644 --- a/ReClass.NET/Util/NumberFormat.cs +++ b/ReClass.NET/Util/NumberFormat.cs @@ -3,14 +3,17 @@ namespace ReClassNET.Util { - public class NumberFormat + public static class NumberFormat { public static NumberFormatInfo GuessNumberFormat(string input) { Contract.Requires(input != null); Contract.Ensures(Contract.Result() != null); - if (input.Contains(",") && !input.Contains(".")) + var commaIndex = input.IndexOf(','); + var dotIndex = input.IndexOf('.'); + + if (commaIndex > dotIndex) { return new NumberFormatInfo { @@ -18,6 +21,7 @@ public static NumberFormatInfo GuessNumberFormat(string input) NumberGroupSeparator = "." }; } + return new NumberFormatInfo { NumberDecimalSeparator = ".", diff --git a/ReClass.NET/Util/PathUtil.cs b/ReClass.NET/Util/PathUtil.cs index 977da60d..f4170bf5 100644 --- a/ReClass.NET/Util/PathUtil.cs +++ b/ReClass.NET/Util/PathUtil.cs @@ -89,7 +89,7 @@ public static string FileUrlToPath(string url) if (url.StartsWith("file:///", StringComparison.OrdinalIgnoreCase)) { - url = url.Substring(8, url.Length - 8); + url = url.Substring(8); } url = url.Replace('/', Path.DirectorySeparatorChar); diff --git a/ReClass.NET_Tests/ReClass.NET_Tests.csproj b/ReClass.NET_Tests/ReClass.NET_Tests.csproj index 2db93137..89129de9 100644 --- a/ReClass.NET_Tests/ReClass.NET_Tests.csproj +++ b/ReClass.NET_Tests/ReClass.NET_Tests.csproj @@ -58,6 +58,8 @@ + + @@ -68,8 +70,13 @@ + + + + + diff --git a/ReClass.NET_Tests/Util/CustomDataMapTest.cs b/ReClass.NET_Tests/Util/CustomDataMapTest.cs new file mode 100644 index 00000000..74315728 --- /dev/null +++ b/ReClass.NET_Tests/Util/CustomDataMapTest.cs @@ -0,0 +1,158 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Xml.Linq; +using NFluent; +using ReClassNET.Util; +using Xunit; + +namespace ReClass.NET_Tests.Util +{ + public class CustomDataMapTest + { + [Fact] + public void TestNullKeyNotAllowed() + { + var sut = new CustomDataMap(); + + Check.ThatCode(() => sut.SetString(null, default)).Throws(); + Check.ThatCode(() => sut.SetBool(null, default)).Throws(); + Check.ThatCode(() => sut.SetLong(null, default)).Throws(); + Check.ThatCode(() => sut.SetULong(null, default)).Throws(); + Check.ThatCode(() => sut.SetXElement(null, default)).Throws(); + Check.ThatCode(() => sut.GetString(null)).Throws(); + Check.ThatCode(() => sut.GetBool(null, default)).Throws(); + Check.ThatCode(() => sut.GetLong(null, default)).Throws(); + Check.ThatCode(() => sut.GetULong(null, default)).Throws(); + Check.ThatCode(() => sut.GetXElement(null, default)).Throws(); + } + + [Theory] + [InlineData("key", "")] + [InlineData("key", "value")] + public void TestSetGetString(string key, string value) + { + var sut = new CustomDataMap(); + + sut.SetString(key, value); + + Check.That(sut.GetString(key)).IsEqualTo(value); + } + + [Theory] + [InlineData("key", "")] + [InlineData("key", "value")] + public void TestIndexString(string key, string value) + { + var sut = new CustomDataMap(); + + sut.SetString(key, value); + + Check.That(sut[key]).IsEqualTo(value); + } + + [Fact] + public void TestItemEnumeration() + { + var data = new Dictionary + { + { "key1", "value1" }, + { "key2", "value2" }, + { "key3", "value3" } + }; + + var sut = new CustomDataMap(); + + foreach (var kv in data) + { + sut.SetString(kv.Key, kv.Value); + } + + Check.That(sut).IsEquivalentTo(data); + } + + [Fact] + public void TestRemoveItem() + { + const string KeyToRemove = "key2"; + + var data = new Dictionary + { + { "key1", "value1" }, + { KeyToRemove, "value2" }, + { "key3", "value3" } + }; + + var sut = new CustomDataMap(); + + foreach (var kv in data) + { + sut.SetString(kv.Key, kv.Value); + } + + sut.RemoveValue(KeyToRemove); + + Check.That(sut).IsEquivalentTo(data.Where(kv => kv.Key != KeyToRemove)); + } + + [Theory] + [InlineData("key", true)] + [InlineData("key", false)] + public void TestSetGetBool(string key, bool value) + { + var sut = new CustomDataMap(); + + sut.SetBool(key, value); + + Check.That(sut.GetBool(key, !value)).IsEqualTo(value); + } + + [Theory] + [InlineData("key", -1)] + [InlineData("key", 0)] + [InlineData("key", 1)] + [InlineData("key", long.MaxValue)] + [InlineData("key", long.MinValue)] + public void TestSetGetLong(string key, long value) + { + var sut = new CustomDataMap(); + + sut.SetLong(key, value); + + Check.That(sut.GetLong(key, 0)).IsEqualTo(value); + } + + [Theory] + [InlineData("key", 0)] + [InlineData("key", 1)] + [InlineData("key", ulong.MaxValue)] + [InlineData("key", ulong.MinValue)] + public void TestSetGetULong(string key, ulong value) + { + var sut = new CustomDataMap(); + + sut.SetULong(key, value); + + Check.That(sut.GetULong(key, 0)).IsEqualTo(value); + } + + public static IEnumerable GetTestSetGetXElementData() => new List + { + new object[] { "key", null }, + new object[] { "key", new XElement("name") }, + new object[] { "key", new XElement("name", new XAttribute("attr", "test")) }, + new object[] { "key", new XElement("name", new XElement("value", "test")) } + }; + + [Theory] + [MemberData(nameof(GetTestSetGetXElementData))] + public void TestSetGetXElement(string key, XElement value) + { + var sut = new CustomDataMap(); + + sut.SetXElement(key, value); + + Check.That(XNode.DeepEquals(sut.GetXElement(key, null), value)).IsTrue(); + } + } +} diff --git a/ReClass.NET_Tests/Util/HexadecimalFormatterTest.cs b/ReClass.NET_Tests/Util/HexadecimalFormatterTest.cs new file mode 100644 index 00000000..abc2da21 --- /dev/null +++ b/ReClass.NET_Tests/Util/HexadecimalFormatterTest.cs @@ -0,0 +1,24 @@ +using System.Collections.Generic; +using NFluent; +using ReClassNET.Util; +using Xunit; + +namespace ReClass.NET_Tests.Util +{ + public class HexadecimalFormatterTest + { + public static IEnumerable GetTestData() => new List + { + new object[] { new byte[0], string.Empty }, + new object[] { new byte[] { 0x12 }, "12" }, + new object[] { new byte[] { 0x12, 0x23, 0x34, 0x45 }, "12 23 34 45" } + }; + + [Theory] + [MemberData(nameof(GetTestData))] + public void Test(byte[] data, string expected) + { + Check.That(HexadecimalFormatter.ToString(data)).IsEqualTo(expected); + } + } +} diff --git a/ReClass.NET_Tests/Util/NumberFormatTest.cs b/ReClass.NET_Tests/Util/NumberFormatTest.cs new file mode 100644 index 00000000..9660f8a8 --- /dev/null +++ b/ReClass.NET_Tests/Util/NumberFormatTest.cs @@ -0,0 +1,22 @@ +using NFluent; +using ReClassNET.Util; +using Xunit; + +namespace ReClass.NET_Tests.Util +{ + public class NumberFormatTest + { + [Theory] + [InlineData("123,34", ",", ".")] + [InlineData("123.34", ".", ",")] + [InlineData("1.123,34", ",", ".")] + [InlineData("1,123.34", ".", ",")] + public void TestGuess(string input, string expectedDecimalSeparator, string expectedGroupSeparator) + { + var nf = NumberFormat.GuessNumberFormat(input); + + Check.That(nf.NumberDecimalSeparator).IsEqualTo(expectedDecimalSeparator); + Check.That(nf.NumberGroupSeparator).IsEqualTo(expectedGroupSeparator); + } + } +} diff --git a/ReClass.NET_Tests/Util/PathUtilTest.cs b/ReClass.NET_Tests/Util/PathUtilTest.cs new file mode 100644 index 00000000..5209171d --- /dev/null +++ b/ReClass.NET_Tests/Util/PathUtilTest.cs @@ -0,0 +1,31 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using NFluent; +using ReClassNET.Util; +using Xunit; + +namespace ReClass.NET_Tests.Util +{ + public class PathUtilTest + { + public static IEnumerable GetTestConversionData() => new List + { + new object[] { string.Empty, string.Empty }, + new object[] { "C:/", "C:" + Path.DirectorySeparatorChar }, + new object[] { @"C:\", "C:" + Path.DirectorySeparatorChar }, + new object[] { "C:/test.test", Path.Combine("C:" + Path.DirectorySeparatorChar, "test.test") }, + new object[] { "file:///C:/test.test", Path.Combine("C:" + Path.DirectorySeparatorChar, "test.test") }, + }; + + [Theory] + [MemberData(nameof(GetTestConversionData))] + public void TestConversion(string input, string expected) + { + Check.That(PathUtil.FileUrlToPath(input)).IsEqualTo(expected); + } + } +} diff --git a/ReClass.NET_Tests/Util/XElementSerializerTest.cs b/ReClass.NET_Tests/Util/XElementSerializerTest.cs new file mode 100644 index 00000000..c372b41f --- /dev/null +++ b/ReClass.NET_Tests/Util/XElementSerializerTest.cs @@ -0,0 +1,101 @@ +using System; +using System.Collections.Generic; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using NFluent; +using ReClassNET.Extensions; +using ReClassNET.Util; +using Xunit; + +namespace ReClass.NET_Tests.Util +{ + public class XElementSerializerTest + { + [Theory] + [InlineData(true)] + [InlineData(false)] + public void TestBoolSerialization(bool value) + { + const string Name = "BoolValue"; + + var element = XElementSerializer.ToXml(Name, value); + + Check.That(element.Name.LocalName).IsEqualTo(Name); + + Check.That(XElementSerializer.ToBool(element)).IsEqualTo(value); + } + + [Theory] + [InlineData(0)] + [InlineData(1)] + [InlineData(-1)] + [InlineData(int.MaxValue)] + [InlineData(int.MinValue)] + public void TestIntSerialization(int value) + { + const string Name = "IntValue"; + + var element = XElementSerializer.ToXml(Name, value); + + Check.That(element.Name.LocalName).IsEqualTo(Name); + + Check.That(XElementSerializer.ToInt(element)).IsEqualTo(value); + } + + [Theory] + [InlineData("")] + [InlineData("test")] + public void TestStringSerialization(string value) + { + const string Name = "StringValue"; + + var element = XElementSerializer.ToXml(Name, value); + + Check.That(element.Name.LocalName).IsEqualTo(Name); + + Check.That(XElementSerializer.ToString(element)).IsEqualTo(value); + } + + public static IEnumerable GetTestColorSerializationData() => new List + { + new object[] { Color.Empty }, + new object[] { Color.Red }, + new object[] { Color.Blue }, + new object[] { Color.FromArgb(123, 123, 123) } + }; + + [Theory] + [MemberData(nameof(GetTestColorSerializationData))] + public void TestColorSerialization(Color value) + { + const string Name = "ColorValue"; + + var element = XElementSerializer.ToXml(Name, value); + + Check.That(element.Name.LocalName).IsEqualTo(Name); + + Check.That(XElementSerializer.ToColor(element).ToRgb()).IsEqualTo(value.ToRgb()); + } + + public static IEnumerable GetTestDictionarySerializationData() => new List + { + new object[] { new Dictionary() }, + new object[] { new Dictionary { { "test", "test" }, { "test2", "test2" } } } + }; + + [Theory] + [MemberData(nameof(GetTestDictionarySerializationData))] + public void TestDictionarySerialization(Dictionary value) + { + const string Name = "DictionaryValue"; + + var element = XElementSerializer.ToXml(Name, value); + + Check.That(element.Name.LocalName).IsEqualTo(Name); + + Check.That(XElementSerializer.ToDictionary(element)).IsEquivalentTo(value); + } + } +} From 1b75514fc54e5fbe07cc01f6deaf26ea0f64416b Mon Sep 17 00:00:00 2001 From: KN4CK3R Date: Wed, 24 Apr 2019 14:09:53 +0200 Subject: [PATCH 028/223] Upgraded target framework version. --- ReClass.NET/App.config | 6 +++--- ReClass.NET/Properties/Settings.Designer.cs | 10 +++++----- ReClass.NET/ReClass.NET.csproj | 3 ++- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/ReClass.NET/App.config b/ReClass.NET/App.config index 731f6de6..ecdcf8a5 100644 --- a/ReClass.NET/App.config +++ b/ReClass.NET/App.config @@ -1,6 +1,6 @@ - + - + - \ No newline at end of file + diff --git a/ReClass.NET/Properties/Settings.Designer.cs b/ReClass.NET/Properties/Settings.Designer.cs index 8d3e4a41..cfa4e29c 100644 --- a/ReClass.NET/Properties/Settings.Designer.cs +++ b/ReClass.NET/Properties/Settings.Designer.cs @@ -1,10 +1,10 @@ //------------------------------------------------------------------------------ // -// Dieser Code wurde von einem Tool generiert. -// Laufzeitversion:4.0.30319.42000 +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 // -// Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn -// der Code erneut generiert wird. +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. // //------------------------------------------------------------------------------ @@ -12,7 +12,7 @@ namespace ReClassNET.Properties { [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "14.0.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "15.9.0.0")] internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); diff --git a/ReClass.NET/ReClass.NET.csproj b/ReClass.NET/ReClass.NET.csproj index ae45a20f..383dc35d 100644 --- a/ReClass.NET/ReClass.NET.csproj +++ b/ReClass.NET/ReClass.NET.csproj @@ -9,12 +9,13 @@ Properties ReClassNET ReClass.NET - v4.6.1 + v4.7.2 512 true 0 + x86 From ba12e96c00cfc60e9080cf164cbb41f1df759a51 Mon Sep 17 00:00:00 2001 From: KN4CK3R Date: Wed, 24 Apr 2019 14:35:26 +0200 Subject: [PATCH 029/223] .NET Framework 4.7 contains an Append method. --- ReClass.NET/Extensions/LinqExtensions.cs | 9 --------- ReClass.NET_Launcher/App.config | 6 +++--- ReClass.NET_Launcher/ReClass.NET_Launcher.csproj | 3 ++- 3 files changed, 5 insertions(+), 13 deletions(-) diff --git a/ReClass.NET/Extensions/LinqExtensions.cs b/ReClass.NET/Extensions/LinqExtensions.cs index 7d169528..5df0cb13 100644 --- a/ReClass.NET/Extensions/LinqExtensions.cs +++ b/ReClass.NET/Extensions/LinqExtensions.cs @@ -131,15 +131,6 @@ public static IEnumerable Yield(this TSource item) yield return item; } - [DebuggerStepThrough] - public static IEnumerable Append(this IEnumerable source, TSource item) - { - Contract.Ensures(Contract.Result>() != null); - Contract.Requires(source != null); - - return source.Concat(Yield(item)); - } - [DebuggerStepThrough] public static IEnumerable Traverse(this IEnumerable source, Func> childSelector) { diff --git a/ReClass.NET_Launcher/App.config b/ReClass.NET_Launcher/App.config index 731f6de6..ecdcf8a5 100644 --- a/ReClass.NET_Launcher/App.config +++ b/ReClass.NET_Launcher/App.config @@ -1,6 +1,6 @@ - + - + - \ No newline at end of file + diff --git a/ReClass.NET_Launcher/ReClass.NET_Launcher.csproj b/ReClass.NET_Launcher/ReClass.NET_Launcher.csproj index 5da1c43a..72eba584 100644 --- a/ReClass.NET_Launcher/ReClass.NET_Launcher.csproj +++ b/ReClass.NET_Launcher/ReClass.NET_Launcher.csproj @@ -8,9 +8,10 @@ WinExe ReClassNET_Launcher ReClass.NET_Launcher - v4.6.1 + v4.7.2 512 true + AnyCPU From 873b31b1ba21b38ea41937f5c222c586c7025b0d Mon Sep 17 00:00:00 2001 From: KN4CK3R Date: Wed, 24 Apr 2019 15:52:33 +0200 Subject: [PATCH 030/223] Added tests for IntPtrComparer. --- ReClass.NET/Util/IntPtrComparer.cs | 3 +- ReClass.NET_Tests/ReClass.NET_Tests.csproj | 1 + ReClass.NET_Tests/Util/IntPtrComparerTest.cs | 33 ++++++++++++++++++++ 3 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 ReClass.NET_Tests/Util/IntPtrComparerTest.cs diff --git a/ReClass.NET/Util/IntPtrComparer.cs b/ReClass.NET/Util/IntPtrComparer.cs index 3400e39d..857c9782 100644 --- a/ReClass.NET/Util/IntPtrComparer.cs +++ b/ReClass.NET/Util/IntPtrComparer.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using ReClassNET.Extensions; namespace ReClassNET.Util { @@ -9,7 +10,7 @@ public class IntPtrComparer : IComparer public int Compare(IntPtr x, IntPtr y) { - return x.ToInt64().CompareTo(y.ToInt64()); + return x.CompareTo(y); } } } diff --git a/ReClass.NET_Tests/ReClass.NET_Tests.csproj b/ReClass.NET_Tests/ReClass.NET_Tests.csproj index 89129de9..fe6dc77d 100644 --- a/ReClass.NET_Tests/ReClass.NET_Tests.csproj +++ b/ReClass.NET_Tests/ReClass.NET_Tests.csproj @@ -74,6 +74,7 @@ + diff --git a/ReClass.NET_Tests/Util/IntPtrComparerTest.cs b/ReClass.NET_Tests/Util/IntPtrComparerTest.cs new file mode 100644 index 00000000..1b07ecb9 --- /dev/null +++ b/ReClass.NET_Tests/Util/IntPtrComparerTest.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using NFluent; +using ReClassNET.Util; +using Xunit; + +namespace ReClass.NET_Tests.Util +{ + public class IntPtrComparerTest + { + public static TheoryData GetTestCompareData() => new TheoryData + { + { IntPtr.Zero, IntPtr.Zero, false }, + { (IntPtr)0x1, IntPtr.Zero, false }, + { (IntPtr)0x1, (IntPtr)0x10, true }, + { (IntPtr)0x1, unchecked((IntPtr)(int)0xFFFFFFFF), true }, + { unchecked((IntPtr)(int)0xFFFFFFFF), unchecked((IntPtr)(int)0xFFFFFFFF), false }, + { unchecked((IntPtr)(int)0xFFFFFFFF), IntPtr.Zero, false } + }; + + [Theory] + [MemberData(nameof(GetTestCompareData))] + public void TestCompare(IntPtr lhs, IntPtr rhs, bool lhsIsSmaller) + { + var comparer = IntPtrComparer.Instance; + + Check.That(comparer.Compare(lhs, rhs) < 0).IsEqualTo(lhsIsSmaller); + } + } +} From c0e472dd9fc490587aad52a90aa119a6ebc955d4 Mon Sep 17 00:00:00 2001 From: KN4CK3R Date: Wed, 24 Apr 2019 15:53:28 +0200 Subject: [PATCH 031/223] Refactored code. --- ReClass.NET/ReClass.NET.csproj | 1 - .../Util/Rtf/RtfBuilder.RtfFormatLock.cs | 32 ------- .../Util/Rtf/RtfBuilder.RtfFormatWrapper.cs | 10 -- ReClass.NET/Util/Rtf/RtfBuilder.cs | 95 +++++-------------- 4 files changed, 25 insertions(+), 113 deletions(-) delete mode 100644 ReClass.NET/Util/Rtf/RtfBuilder.RtfFormatLock.cs diff --git a/ReClass.NET/ReClass.NET.csproj b/ReClass.NET/ReClass.NET.csproj index 383dc35d..4f324a92 100644 --- a/ReClass.NET/ReClass.NET.csproj +++ b/ReClass.NET/ReClass.NET.csproj @@ -511,7 +511,6 @@ - diff --git a/ReClass.NET/Util/Rtf/RtfBuilder.RtfFormatLock.cs b/ReClass.NET/Util/Rtf/RtfBuilder.RtfFormatLock.cs deleted file mode 100644 index 52e52ac2..00000000 --- a/ReClass.NET/Util/Rtf/RtfBuilder.RtfFormatLock.cs +++ /dev/null @@ -1,32 +0,0 @@ -using System; -using System.Diagnostics.Contracts; - -namespace ReClassNET.Util.Rtf -{ - partial class RtfBuilder - { - private class RtfFormatLock : IDisposable - { - private readonly RtfBuilder builder; - private readonly RtfFormatWrapper wrapped; - - public RtfFormatLock(RtfBuilder builder) - { - Contract.Requires(builder != null); - - this.builder = builder; - - wrapped = new RtfFormatWrapper(builder); - - builder.isLocked = true; - } - - public void Dispose() - { - wrapped.Dispose(); - - builder.isLocked = false; - } - } - } -} \ No newline at end of file diff --git a/ReClass.NET/Util/Rtf/RtfBuilder.RtfFormatWrapper.cs b/ReClass.NET/Util/Rtf/RtfBuilder.RtfFormatWrapper.cs index 55b55bcb..08078ebb 100644 --- a/ReClass.NET/Util/Rtf/RtfBuilder.RtfFormatWrapper.cs +++ b/ReClass.NET/Util/Rtf/RtfBuilder.RtfFormatWrapper.cs @@ -16,11 +16,6 @@ public RtfFormatWrapper(RtfBuilder builder) this.builder = builder; - if (builder.isLocked) - { - return; - } - var buffer = builder.buffer; int oldLength = buffer.Length; @@ -67,11 +62,6 @@ public RtfFormatWrapper(RtfBuilder builder) public void Dispose() { - if (builder.isLocked) - { - return; - } - var buffer = builder.buffer; var oldLength = buffer.Length; diff --git a/ReClass.NET/Util/Rtf/RtfBuilder.cs b/ReClass.NET/Util/Rtf/RtfBuilder.cs index a8732ce0..ff92a1d8 100644 --- a/ReClass.NET/Util/Rtf/RtfBuilder.cs +++ b/ReClass.NET/Util/Rtf/RtfBuilder.cs @@ -1,6 +1,5 @@ using System; using System.Collections.Generic; -using System.Diagnostics; using System.Drawing; using System.Linq; using System.Text; @@ -28,8 +27,6 @@ public partial class RtfBuilder private float fontSize; private FontStyle fontStyle; - protected bool isLocked; - public RtfBuilder() : this(RtfFont.Calibri, 22.0f) { @@ -60,30 +57,46 @@ public RtfBuilder Append(char value) public RtfBuilder Append(string value) { - AppendInternal(value); + if (!string.IsNullOrEmpty(value)) + { + using (new RtfFormatWrapper(this)) + { + value = EscapeString(value); + if (value.IndexOf(Environment.NewLine, StringComparison.Ordinal) >= 0) + { + var lines = value.Split(new[] { Environment.NewLine }, StringSplitOptions.None); + + buffer.Append(string.Join(@"\line ", lines)); + } + else + { + buffer.Append(value); + } + } + } return this; } public RtfBuilder AppendLevel(int level) { - AppendLevelInternal(level); + buffer.AppendFormat(@"\level{0} ", level); return this; } public RtfBuilder AppendLine() { - AppendLineInternal(); + buffer.AppendLine(@"\line"); return this; } public RtfBuilder AppendLine(string value) { - AppendLineInternal(value); + Append(value); - return this; + return AppendLine(); } public RtfBuilder AppendParagraph() @@ -95,12 +108,11 @@ public RtfBuilder AppendParagraph() public RtfBuilder AppendPage() { - AppendPageInternal(); + buffer.AppendLine(@"\page"); return this; } - [DebuggerStepThrough] public RtfBuilder SetForeColor(Color color) { foreColor = color; @@ -108,7 +120,6 @@ public RtfBuilder SetForeColor(Color color) return this; } - [DebuggerStepThrough] public RtfBuilder SetBackColor(Color color) { backColor = color; @@ -116,7 +127,6 @@ public RtfBuilder SetBackColor(Color color) return this; } - [DebuggerStepThrough] public RtfBuilder SetFont(RtfFont font) { fontIndex = IndexOfFont(font); @@ -124,7 +134,6 @@ public RtfBuilder SetFont(RtfFont font) return this; } - [DebuggerStepThrough] public RtfBuilder SetFontSize(float size) { fontSize = size; @@ -132,10 +141,9 @@ public RtfBuilder SetFontSize(float size) return this; } - [DebuggerStepThrough] - public RtfBuilder SetFontStyle(FontStyle fontStyle) + public RtfBuilder SetFontStyle(FontStyle style) { - this.fontStyle = fontStyle; + fontStyle = style; return this; } @@ -198,64 +206,11 @@ private static string GetKnownFontString(RtfFont font) public RtfBuilder Reset() { - ResetInternal(); + buffer.AppendLine(@"\pard"); return this; } - protected void AppendInternal(string value) - { - if (!string.IsNullOrEmpty(value)) - { - using (new RtfFormatWrapper(this)) - { - value = EscapeString(value); - if (value.IndexOf(Environment.NewLine, StringComparison.Ordinal) >= 0) - { - var lines = value.Split(new[] { Environment.NewLine }, StringSplitOptions.None); - - buffer.Append(string.Join(@"\line ", lines)); - } - else - { - buffer.Append(value); - } - } - } - } - - protected void AppendLevelInternal(int level) - { - buffer.AppendFormat(@"\level{0} ", level); - } - - protected void AppendLineInternal(string value) - { - Append(value); - - buffer.AppendLine(@"\line"); - } - - protected void AppendLineInternal() - { - buffer.AppendLine(@"\line"); - } - - protected void AppendPageInternal() - { - buffer.AppendLine(@"\page"); - } - - public IDisposable FormatLock() - { - return new RtfFormatLock(this); - } - - protected void ResetInternal() - { - buffer.AppendLine(@"\pard"); - } - public override string ToString() { var sb = new StringBuilder(); From 5ae0961c2f6e6317cb607216437498742b7808fa Mon Sep 17 00:00:00 2001 From: KN4CK3R Date: Thu, 25 Apr 2019 11:11:56 +0200 Subject: [PATCH 032/223] Refactored NodeDissector. --- ReClass.NET/Memory/NodeDissector.cs | 109 ++++++++++++++++------------ 1 file changed, 63 insertions(+), 46 deletions(-) diff --git a/ReClass.NET/Memory/NodeDissector.cs b/ReClass.NET/Memory/NodeDissector.cs index 8046efe1..22cc99d8 100644 --- a/ReClass.NET/Memory/NodeDissector.cs +++ b/ReClass.NET/Memory/NodeDissector.cs @@ -17,19 +17,20 @@ public static void DissectNodes(IEnumerable nodes, MemoryBuffer mem foreach (var node in nodes) { - var type = GuessExplicitNode(node, memory); - if (type != null) + if (GuessNode(node, memory, out var guessedNode)) { - node.GetParentContainer()?.ReplaceChildNode(node, type); + node.GetParentContainer()?.ReplaceChildNode(node, guessedNode); } } } - public static BaseNode GuessExplicitNode(BaseHexNode node, MemoryBuffer memory) + public static bool GuessNode(BaseHexNode node, MemoryBuffer memory, out BaseNode guessedNode) { Contract.Requires(node != null); Contract.Requires(memory != null); + guessedNode = null; + var offset = node.Offset; var is4ByteAligned = offset % 4 == 0; var is8ByteAligned = offset % 8 == 0; @@ -37,7 +38,7 @@ public static BaseNode GuessExplicitNode(BaseHexNode node, MemoryBuffer memory) // The node is not aligned, skip it. if (!is4ByteAligned) { - return null; + return false; } var data64 = memory.ReadObject(offset); @@ -46,46 +47,48 @@ public static BaseNode GuessExplicitNode(BaseHexNode node, MemoryBuffer memory) var raw = memory.ReadBytes(offset, node.MemorySize); if (raw.InterpretAsUtf8().IsLikelyPrintableData() >= 0.75f) { - return new Utf8TextNode(); + guessedNode = new Utf8TextNode(); + + return true; } if (raw.InterpretAsUtf16().IsLikelyPrintableData() >= 0.75f) { - return new Utf16TextNode(); + guessedNode = new Utf16TextNode(); + + return true; } +#if RECLASSNET64 if (is8ByteAligned) { -#if RECLASSNET64 - var pointerType = GuessPointerNode(data64.IntPtr, memory); - if (pointerType != null) + if (GuessPointerNode(data64.IntPtr, memory.Process, out guessedNode)) { - return pointerType; + return true; } -#endif } +#else + if (GuessPointerNode(data32.IntPtr, memory.Process, out guessedNode)) + { + return true; + } +#endif + // 0 could be anything. + if (data32.IntValue != 0) { -#if RECLASSNET32 - var pointerNode = GuessPointerNode(data32.IntPtr, memory); - if (pointerNode != null) + // If the data represents a reasonable range, it could be a float. + if (-999999.0f <= data32.FloatValue && data32.FloatValue <= 999999.0f && !data32.FloatValue.IsNearlyEqual(0.0f, 0.001f)) { - return pointerNode; + guessedNode = new FloatNode(); + + return true; } -#endif - // 0 could be anything. - if (data32.IntValue != 0) + if (-999999 <= data32.IntValue && data32.IntValue <= 999999) { - // If the data represents a reasonable range, it could be a float. - if (-999999.0f <= data32.FloatValue && data32.FloatValue <= 999999.0f && !data32.FloatValue.IsNearlyEqual(0.0f, 0.001f)) - { - return new FloatNode(); - } + guessedNode = new Int32Node(); - if (-999999 <= data32.IntValue && data32.IntValue <= 999999) - { - return new Int32Node(); - } + return true; } } @@ -96,60 +99,74 @@ public static BaseNode GuessExplicitNode(BaseHexNode node, MemoryBuffer memory) // If the data represents a reasonable range, it could be a double. if (-999999.0 <= data64.DoubleValue && data64.DoubleValue <= 999999.0 && !data64.DoubleValue.IsNearlyEqual(0.0, 0.001)) { - return new DoubleNode(); + guessedNode = new DoubleNode(); + + return true; } } } - return null; + return false; } - private static BaseNode GuessPointerNode(IntPtr address, MemoryBuffer memory) + private static bool GuessPointerNode(IntPtr address, IProcessReader process, out BaseNode node) { - Contract.Requires(memory != null); + Contract.Requires(process != null); + + node = null; if (address.IsNull()) { - return null; + return false; } - var section = memory.Process.GetSectionToPointer(address); + var section = process.GetSectionToPointer(address); if (section == null) { - return null; + return false; } if (section.Category == SectionCategory.CODE) // If the section contains code, it should be a function pointer. { - return new FunctionPtrNode(); + node = new FunctionPtrNode(); + + return true; } if (section.Category == SectionCategory.DATA || section.Category == SectionCategory.HEAP) // If the section contains data, it is at least a pointer to a class or something. { // Check if it is a vtable. Check if the first 3 values are pointers to a code section. - var possibleVmt = memory.Process.ReadRemoteObject(address); - if (memory.Process.GetSectionToPointer(possibleVmt.Pointer1)?.Category == SectionCategory.CODE - && memory.Process.GetSectionToPointer(possibleVmt.Pointer2)?.Category == SectionCategory.CODE - && memory.Process.GetSectionToPointer(possibleVmt.Pointer3)?.Category == SectionCategory.CODE) + var possibleVmt = process.ReadRemoteObject(address); + if (process.GetSectionToPointer(possibleVmt.Pointer1)?.Category == SectionCategory.CODE + && process.GetSectionToPointer(possibleVmt.Pointer2)?.Category == SectionCategory.CODE + && process.GetSectionToPointer(possibleVmt.Pointer3)?.Category == SectionCategory.CODE) { - return new VirtualMethodTableNode(); + node = new VirtualMethodTableNode(); + + return true; } // Check if it is a string. - var data = memory.Process.ReadRemoteMemory(address, IntPtr.Size * 2); + var data = process.ReadRemoteMemory(address, IntPtr.Size * 2); if (data.Take(IntPtr.Size).InterpretAsUtf8().IsLikelyPrintableData() >= 07.5f) { - return new Utf8TextPtrNode(); + node = new Utf8TextPtrNode(); + + return true; } if (data.InterpretAsUtf16().IsLikelyPrintableData() >= 0.75f) { - return new Utf16TextPtrNode(); + node = new Utf16TextPtrNode(); + + return true; } // Now it could be a pointer to something else but we can't tell. :( - return new PointerNode(); + node = new PointerNode(); + + return true; } - return null; + return false; } } } From f377de95a9c57c76b952fd3a9e1714074a249c15 Mon Sep 17 00:00:00 2001 From: KN4CK3R Date: Thu, 25 Apr 2019 15:41:01 +0200 Subject: [PATCH 033/223] Refactored IsLikelyPrintableData. --- ReClass.NET/Extensions/StringExtensions.cs | 16 +++++++++++----- ReClass.NET/Memory/NodeDissector.cs | 8 ++++---- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/ReClass.NET/Extensions/StringExtensions.cs b/ReClass.NET/Extensions/StringExtensions.cs index b0c8c50e..6f2711c2 100644 --- a/ReClass.NET/Extensions/StringExtensions.cs +++ b/ReClass.NET/Extensions/StringExtensions.cs @@ -40,17 +40,23 @@ public static bool IsPrintableData(this IEnumerable source) { Contract.Requires(source != null); - return IsLikelyPrintableData(source) >= 1.0f; + return CalculatePrintableDataThreshold(source) >= 1.0f; } [DebuggerStepThrough] - public static float IsLikelyPrintableData(this IEnumerable source) + public static bool IsLikelyPrintableData(this IEnumerable source) { Contract.Requires(source != null); - bool doCountValid = true; - int countValid = 0; - int countAll = 0; + return CalculatePrintableDataThreshold(source) >= 0.75f; + } + + [DebuggerStepThrough] + public static float CalculatePrintableDataThreshold(this IEnumerable source) + { + var doCountValid = true; + var countValid = 0; + var countAll = 0; foreach (var c in source) { diff --git a/ReClass.NET/Memory/NodeDissector.cs b/ReClass.NET/Memory/NodeDissector.cs index 22cc99d8..7b82f782 100644 --- a/ReClass.NET/Memory/NodeDissector.cs +++ b/ReClass.NET/Memory/NodeDissector.cs @@ -45,13 +45,13 @@ public static bool GuessNode(BaseHexNode node, MemoryBuffer memory, out BaseNode var data32 = memory.ReadObject(offset); var raw = memory.ReadBytes(offset, node.MemorySize); - if (raw.InterpretAsUtf8().IsLikelyPrintableData() >= 0.75f) + if (raw.InterpretAsUtf8().IsLikelyPrintableData()) { guessedNode = new Utf8TextNode(); return true; } - if (raw.InterpretAsUtf16().IsLikelyPrintableData() >= 0.75f) + if (raw.InterpretAsUtf16().IsLikelyPrintableData()) { guessedNode = new Utf16TextNode(); @@ -147,13 +147,13 @@ private static bool GuessPointerNode(IntPtr address, IProcessReader process, out // Check if it is a string. var data = process.ReadRemoteMemory(address, IntPtr.Size * 2); - if (data.Take(IntPtr.Size).InterpretAsUtf8().IsLikelyPrintableData() >= 07.5f) + if (data.Take(IntPtr.Size).InterpretAsUtf8().IsLikelyPrintableData()) { node = new Utf8TextPtrNode(); return true; } - if (data.InterpretAsUtf16().IsLikelyPrintableData() >= 0.75f) + if (data.InterpretAsUtf16().IsLikelyPrintableData()) { node = new Utf16TextPtrNode(); From 227ea071a745b56790dc8b304186be69a24b5fd3 Mon Sep 17 00:00:00 2001 From: KN4CK3R Date: Fri, 26 Apr 2019 10:12:54 +0200 Subject: [PATCH 034/223] Added tests for class EncodingExtension. Changed method name. --- ReClass.NET/Extensions/EncodingExtensions.cs | 4 +- ReClass.NET/Memory/RemoteProcess.cs | 6 +-- .../Comparer/StringMemoryComparer.cs | 2 +- ReClass.NET/MemoryScanner/MemoryRecord.cs | 2 +- ReClass.NET/Nodes/BaseTextNode.cs | 2 +- .../Extensions/EncodingExtensionTest.cs | 41 +++++++++++++++++++ ReClass.NET_Tests/ReClass.NET_Tests.csproj | 1 + 7 files changed, 50 insertions(+), 8 deletions(-) create mode 100644 ReClass.NET_Tests/Extensions/EncodingExtensionTest.cs diff --git a/ReClass.NET/Extensions/EncodingExtensions.cs b/ReClass.NET/Extensions/EncodingExtensions.cs index 696295f4..94ed21b2 100644 --- a/ReClass.NET/Extensions/EncodingExtensions.cs +++ b/ReClass.NET/Extensions/EncodingExtensions.cs @@ -8,10 +8,10 @@ public static class EncodingExtension /// Gets the (perhaps wrong) byte count per character. Special characters may need more bytes. /// The encoding. /// The byte count per character. - public static int GetSimpleByteCountPerChar(this Encoding encoding) + public static int GuessByteCountPerChar(this Encoding encoding) { if (encoding.Equals(Encoding.UTF8) || encoding.Equals(Encoding.ASCII)) return 1; - if (encoding.Equals(Encoding.Unicode)) return 2; + if (encoding.Equals(Encoding.Unicode) || encoding.Equals(Encoding.BigEndianUnicode)) return 2; if (encoding.Equals(Encoding.UTF32)) return 4; throw new NotImplementedException(); diff --git a/ReClass.NET/Memory/RemoteProcess.cs b/ReClass.NET/Memory/RemoteProcess.cs index 6b09b159..1bbbd283 100644 --- a/ReClass.NET/Memory/RemoteProcess.cs +++ b/ReClass.NET/Memory/RemoteProcess.cs @@ -289,7 +289,7 @@ public string ReadRemoteString(Encoding encoding, IntPtr address, int length) Contract.Requires(length >= 0); Contract.Ensures(Contract.Result() != null); - var data = ReadRemoteMemory(address, length * encoding.GetSimpleByteCountPerChar()); + var data = ReadRemoteMemory(address, length * encoding.GuessByteCountPerChar()); try { @@ -320,10 +320,10 @@ public string ReadRemoteStringUntilFirstNullCharacter(Encoding encoding, IntPtr Contract.Requires(length >= 0); Contract.Ensures(Contract.Result() != null); - var data = ReadRemoteMemory(address, length * encoding.GetSimpleByteCountPerChar()); + var data = ReadRemoteMemory(address, length * encoding.GuessByteCountPerChar()); // TODO We should cache the pattern per encoding. - var index = PatternScanner.FindPattern(BytePattern.From(new byte[encoding.GetSimpleByteCountPerChar()]), data); + var index = PatternScanner.FindPattern(BytePattern.From(new byte[encoding.GuessByteCountPerChar()]), data); if (index == -1) { index = data.Length; diff --git a/ReClass.NET/MemoryScanner/Comparer/StringMemoryComparer.cs b/ReClass.NET/MemoryScanner/Comparer/StringMemoryComparer.cs index 44b958ed..91b7b840 100644 --- a/ReClass.NET/MemoryScanner/Comparer/StringMemoryComparer.cs +++ b/ReClass.NET/MemoryScanner/Comparer/StringMemoryComparer.cs @@ -19,7 +19,7 @@ public StringMemoryComparer(string value, Encoding encoding, bool caseSensitive) Value = value; Encoding = encoding; CaseSensitive = caseSensitive; - ValueSize = Value.Length * Encoding.GetSimpleByteCountPerChar(); + ValueSize = Value.Length * Encoding.GuessByteCountPerChar(); } public bool Compare(byte[] data, int index, out ScanResult result) diff --git a/ReClass.NET/MemoryScanner/MemoryRecord.cs b/ReClass.NET/MemoryScanner/MemoryRecord.cs index a9b3968f..ea17019d 100644 --- a/ReClass.NET/MemoryScanner/MemoryRecord.cs +++ b/ReClass.NET/MemoryScanner/MemoryRecord.cs @@ -177,7 +177,7 @@ public void RefreshValue(RemoteProcess process) buffer = new byte[ValueLength]; break; case ScanValueType.String: - buffer = new byte[ValueLength * Encoding.GetSimpleByteCountPerChar()]; + buffer = new byte[ValueLength * Encoding.GuessByteCountPerChar()]; break; default: throw new InvalidOperationException(); diff --git a/ReClass.NET/Nodes/BaseTextNode.cs b/ReClass.NET/Nodes/BaseTextNode.cs index e5ab03ce..60984853 100644 --- a/ReClass.NET/Nodes/BaseTextNode.cs +++ b/ReClass.NET/Nodes/BaseTextNode.cs @@ -17,7 +17,7 @@ public abstract class BaseTextNode : BaseNode public abstract Encoding Encoding { get; } /// Size of one character in bytes. - private int CharacterSize => Encoding.GetSimpleByteCountPerChar(); + private int CharacterSize => Encoding.GuessByteCountPerChar(); public override void CopyFromNode(BaseNode node) { diff --git a/ReClass.NET_Tests/Extensions/EncodingExtensionTest.cs b/ReClass.NET_Tests/Extensions/EncodingExtensionTest.cs new file mode 100644 index 00000000..12521302 --- /dev/null +++ b/ReClass.NET_Tests/Extensions/EncodingExtensionTest.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using NFluent; +using ReClassNET.Extensions; +using Xunit; + +namespace ReClass.NET_Tests.Extensions +{ + public class EncodingExtensionTest + { + public static TheoryData GetTestSimpleByteCountData() => new TheoryData + { + { Encoding.ASCII, 1 }, + { Encoding.UTF8, 1 }, + { Encoding.Unicode, 2 }, + { Encoding.BigEndianUnicode, 2 }, + { Encoding.UTF32, 4 } + }; + + [Theory] + [MemberData(nameof(GetTestSimpleByteCountData))] + public void TestSimpleByteCount(Encoding encoding, int expectedByteCount) + { + Check.That(encoding.GuessByteCountPerChar()).IsEqualTo(expectedByteCount); + } + + public static IEnumerable GetTestSimpleByteCountNotImplementedData() => Encoding.GetEncodings() + .Select(e => e.GetEncoding()) + .WhereNot(e => e.Equals(Encoding.ASCII) || e.Equals(Encoding.UTF8) || e.Equals(Encoding.Unicode) || e.Equals(Encoding.BigEndianUnicode) || e.Equals(Encoding.UTF32)) + .Select(e => new object[] { e }); + + [Theory] + [MemberData(nameof(GetTestSimpleByteCountNotImplementedData))] + public void TestSimpleByteCountNotImplemented(Encoding encoding) + { + Check.ThatCode(encoding.GuessByteCountPerChar).Throws(); + } + } +} diff --git a/ReClass.NET_Tests/ReClass.NET_Tests.csproj b/ReClass.NET_Tests/ReClass.NET_Tests.csproj index fe6dc77d..6ecc3ea1 100644 --- a/ReClass.NET_Tests/ReClass.NET_Tests.csproj +++ b/ReClass.NET_Tests/ReClass.NET_Tests.csproj @@ -67,6 +67,7 @@ + From 4a231ab5ed294e0c6f25f1b1dba9eea00c1a77af Mon Sep 17 00:00:00 2001 From: KN4CK3R Date: Fri, 26 Apr 2019 20:40:16 +0200 Subject: [PATCH 035/223] Added tests for ColorExtension, DictionaryExtension and FloatingPointExtension. --- .../Extensions/FloatingPointExtensions.cs | 30 +--------- .../Comparer/DoubleMemoryComparer.cs | 2 +- .../Comparer/FloatMemoryComparer.cs | 2 +- .../Extensions/ColorExtensionTest.cs | 52 +++++++++++++++++ .../Extensions/DictionaryExtensionTest.cs | 30 ++++++++++ .../Extensions/FloatingPointExtensionTest.cs | 57 +++++++++++++++++++ ReClass.NET_Tests/ReClass.NET_Tests.csproj | 3 + 7 files changed, 146 insertions(+), 30 deletions(-) create mode 100644 ReClass.NET_Tests/Extensions/ColorExtensionTest.cs create mode 100644 ReClass.NET_Tests/Extensions/DictionaryExtensionTest.cs create mode 100644 ReClass.NET_Tests/Extensions/FloatingPointExtensionTest.cs diff --git a/ReClass.NET/Extensions/FloatingPointExtensions.cs b/ReClass.NET/Extensions/FloatingPointExtensions.cs index b905165c..410c56e8 100644 --- a/ReClass.NET/Extensions/FloatingPointExtensions.cs +++ b/ReClass.NET/Extensions/FloatingPointExtensions.cs @@ -6,13 +6,6 @@ namespace ReClassNET.Extensions { public static class FloatingPointExtension { - [Pure] - [DebuggerStepThrough] - public static bool IsNearlyEqual(this float val, float other) - { - return IsNearlyEqual(val, other, float.Epsilon); - } - [Pure] [DebuggerStepThrough] public static bool IsNearlyEqual(this float val, float other, float epsilon) @@ -22,20 +15,7 @@ public static bool IsNearlyEqual(this float val, float other, float epsilon) return true; } - var diff = Math.Abs(val - other); - if (val == 0.0f || other == 0.0f || diff < float.Epsilon) - { - return diff < epsilon; - } - - return diff / (Math.Abs(val) + Math.Abs(other)) < epsilon; - } - - [Pure] - [DebuggerStepThrough] - public static bool IsNearlyEqual(this double val, double other) - { - return IsNearlyEqual(val, other, double.Epsilon); + return Math.Abs(val - other) <= epsilon; } [Pure] @@ -47,13 +27,7 @@ public static bool IsNearlyEqual(this double val, double other, double epsilon) return true; } - var diff = Math.Abs(val - other); - if (val == 0.0 || other == 0.0 || diff < double.Epsilon) - { - return diff < epsilon; - } - - return diff / (Math.Abs(val) + Math.Abs(other)) < epsilon; + return Math.Abs(val - other) <= epsilon; } } } diff --git a/ReClass.NET/MemoryScanner/Comparer/DoubleMemoryComparer.cs b/ReClass.NET/MemoryScanner/Comparer/DoubleMemoryComparer.cs index 56c50164..eabd011a 100644 --- a/ReClass.NET/MemoryScanner/Comparer/DoubleMemoryComparer.cs +++ b/ReClass.NET/MemoryScanner/Comparer/DoubleMemoryComparer.cs @@ -45,7 +45,7 @@ private bool CheckRoundedEquality(double value) switch (RoundType) { case ScanRoundMode.Strict: - return Value1.IsNearlyEqual(Math.Round(value, significantDigits, MidpointRounding.AwayFromZero)); + return Value1.IsNearlyEqual(Math.Round(value, significantDigits, MidpointRounding.AwayFromZero), 0.0001); case ScanRoundMode.Normal: return minValue < value && value < maxValue; case ScanRoundMode.Truncate: diff --git a/ReClass.NET/MemoryScanner/Comparer/FloatMemoryComparer.cs b/ReClass.NET/MemoryScanner/Comparer/FloatMemoryComparer.cs index 52e96974..bdcddad8 100644 --- a/ReClass.NET/MemoryScanner/Comparer/FloatMemoryComparer.cs +++ b/ReClass.NET/MemoryScanner/Comparer/FloatMemoryComparer.cs @@ -45,7 +45,7 @@ private bool CheckRoundedEquality(float value) switch (RoundType) { case ScanRoundMode.Strict: - return Value1.IsNearlyEqual((float)Math.Round(value, significantDigits, MidpointRounding.AwayFromZero)); + return Value1.IsNearlyEqual((float)Math.Round(value, significantDigits, MidpointRounding.AwayFromZero), 0.0001f); case ScanRoundMode.Normal: return minValue < value && value < maxValue; case ScanRoundMode.Truncate: diff --git a/ReClass.NET_Tests/Extensions/ColorExtensionTest.cs b/ReClass.NET_Tests/Extensions/ColorExtensionTest.cs new file mode 100644 index 00000000..fdc1a65c --- /dev/null +++ b/ReClass.NET_Tests/Extensions/ColorExtensionTest.cs @@ -0,0 +1,52 @@ +using System.Drawing; +using NFluent; +using ReClassNET.Extensions; +using Xunit; + +namespace ReClass.NET_Tests.Extensions +{ + public class ColorExtensionTest + { + public static TheoryData GetTestInvertedColorData() => new TheoryData + { + { Color.White, Color.Black }, + { Color.Black, Color.White }, + { Color.Red, Color.Cyan }, + { Color.Cyan, Color.Red }, + { Color.Blue, Color.Yellow }, + { Color.Yellow, Color.Blue }, + { Color.Lime, Color.Fuchsia }, + { Color.Fuchsia, Color.Lime }, + { Color.FromArgb(100, 100, 100), Color.FromArgb(155, 155, 155) }, + { Color.FromArgb(50, 100, 150), Color.FromArgb(205, 155, 105) } + }; + + [Theory] + [MemberData(nameof(GetTestInvertedColorData))] + public void TestInvertedColor(Color sut, Color expected) + { + Check.That(sut.Invert().ToArgb()).IsEqualTo(expected.ToArgb()); + } + + public static TheoryData GetTestToRgbData() => new TheoryData + { + { Color.White, 0xFF_FF_FF }, + { Color.Black, 0x00_00_00 }, + { Color.Red, 0xFF_00_00 }, + { Color.Cyan, 0x00_FF_FF }, + { Color.Blue, 0x00_00_FF }, + { Color.Yellow, 0xFF_FF_00 }, + { Color.Lime, 0x00_FF_00 }, + { Color.Fuchsia, 0xFF_00_FF }, + { Color.FromArgb(100, 100, 100), 100 << 16 | 100 << 8 | 100 }, + { Color.FromArgb(50, 100, 150), 50 << 16 | 100 << 8 | 150 } + }; + + [Theory] + [MemberData(nameof(GetTestToRgbData))] + public void TestToRgb(Color sut, int expected) + { + Check.That(sut.ToRgb()).IsEqualTo(expected); + } + } +} diff --git a/ReClass.NET_Tests/Extensions/DictionaryExtensionTest.cs b/ReClass.NET_Tests/Extensions/DictionaryExtensionTest.cs new file mode 100644 index 00000000..0b0d2a70 --- /dev/null +++ b/ReClass.NET_Tests/Extensions/DictionaryExtensionTest.cs @@ -0,0 +1,30 @@ +using System.Collections.Generic; +using NFluent; +using ReClassNET.Extensions; +using Xunit; + +namespace ReClass.NET_Tests.Extensions +{ + public class DictionaryExtensionTest + { + [Fact] + public void TestRemoveWhere() + { + var sut = new Dictionary + { + { 0, "val0" }, + { 1, "val1" }, + { 2, "val2" }, + { 3, "val3" } + }; + + sut.RemoveWhere(kv => kv.Key % 2 == 1); + + Check.That(sut.Keys).IsEquivalentTo(0, 2); + + sut.RemoveWhere(kv => kv.Key == 2); + + Check.That(sut.Keys).IsEquivalentTo(0); + } + } +} diff --git a/ReClass.NET_Tests/Extensions/FloatingPointExtensionTest.cs b/ReClass.NET_Tests/Extensions/FloatingPointExtensionTest.cs new file mode 100644 index 00000000..a295fd7a --- /dev/null +++ b/ReClass.NET_Tests/Extensions/FloatingPointExtensionTest.cs @@ -0,0 +1,57 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using NFluent; +using NFluent.Extensions; +using ReClassNET.Extensions; +using Xunit; + +namespace ReClass.NET_Tests.Extensions +{ + public class FloatingPointExtensionTest + { + [Theory] + [InlineData(0.0f, 0.0f, 0.0f, true)] + [InlineData(0.0f, 1.0f, 0.0f, false)] + [InlineData(0.0f, 1.0f, 1.0f, true)] + [InlineData(1.0f, 0.0f, 1.0f, true)] + [InlineData(-1.0f, 0.0f, 1.0f, true)] + [InlineData(-1.0f, 1.0f, 1.0f, false)] + [InlineData(-0.5f, 0.5f, 1.0f, true)] + [InlineData(-0.25f, 0.75f, 1.0f, true)] + [InlineData(-0.25f, 0.25f, 0.5f, true)] + [InlineData(0.9999f, 1.0f, 0.0f, false)] + [InlineData(0.9999f, 1.0f, 0.1f, true)] + [InlineData(0.9999f, 1.0f, 0.01f, true)] + [InlineData(0.9999f, 1.0f, 0.001f, true)] + [InlineData(0.9999f, 1.0f, 0.0001f, true, Skip = "Should work but float can't hold these values")] + [InlineData(0.9999f, 1.0f, 0.00001f, false, Skip = "Should work but float can't hold these values")] + public void TestNearlyEqualFloat(float value1, float value2, float epsilon, bool expected) + { + Check.That(value1.IsNearlyEqual(value2, epsilon)).IsEqualTo(expected); + } + + [Theory] + [InlineData(0.0, 0.0, 0.0, true)] + [InlineData(0.0, 1.0, 0.0, false)] + [InlineData(0.0, 1.0, 1.0, true)] + [InlineData(1.0, 0.0, 1.0, true)] + [InlineData(-1.0, 0.0, 1.0, true)] + [InlineData(-1.0, 1.0, 1.0, false)] + [InlineData(-0.5, 0.5, 1.0, true)] + [InlineData(-0.25, 0.75, 1.0, true)] + [InlineData(-0.25, 0.25, 0.5, true)] + [InlineData(0.9999, 1.0, 0.0, false)] + [InlineData(0.9999, 1.0, 0.1, true)] + [InlineData(0.9999, 1.0, 0.01, true)] + [InlineData(0.9999, 1.0, 0.001, true)] + [InlineData(0.9999, 1.0, 0.0001, true)] + [InlineData(0.9999, 1.0, 0.00001, false)] + public void TestNearlyEqualDouble(double value1, double value2, double epsilon, bool expected) + { + Check.That(value1.IsNearlyEqual(value2, epsilon)).IsEqualTo(expected); + } + } +} diff --git a/ReClass.NET_Tests/ReClass.NET_Tests.csproj b/ReClass.NET_Tests/ReClass.NET_Tests.csproj index 6ecc3ea1..bb7d9fa0 100644 --- a/ReClass.NET_Tests/ReClass.NET_Tests.csproj +++ b/ReClass.NET_Tests/ReClass.NET_Tests.csproj @@ -67,7 +67,10 @@ + + + From 181ddf939d670b1065c37ef8d65b0bfe90a2d5c3 Mon Sep 17 00:00:00 2001 From: KN4CK3R Date: Mon, 29 Apr 2019 19:54:54 +0200 Subject: [PATCH 036/223] Removed Join method. --- ReClass.NET/Extensions/LinqExtensions.cs | 12 +----------- ReClass.NET/Util/Rtf/RtfBuilder.cs | 10 ++++++++-- 2 files changed, 9 insertions(+), 13 deletions(-) diff --git a/ReClass.NET/Extensions/LinqExtensions.cs b/ReClass.NET/Extensions/LinqExtensions.cs index 5df0cb13..117562ce 100644 --- a/ReClass.NET/Extensions/LinqExtensions.cs +++ b/ReClass.NET/Extensions/LinqExtensions.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Diagnostics; using System.Diagnostics.Contracts; @@ -8,16 +8,6 @@ namespace ReClassNET.Extensions { public static class LinqExtension { - public static string Join(this IEnumerable source) - { - return Join(source, string.Empty); - } - - public static string Join(this IEnumerable source, string separator) - { - return string.Join(separator, source); - } - public static TResult Max(this IEnumerable source, Func selector, IComparer comparer) { comparer = comparer ?? Comparer.Default; diff --git a/ReClass.NET/Util/Rtf/RtfBuilder.cs b/ReClass.NET/Util/Rtf/RtfBuilder.cs index ff92a1d8..20334875 100644 --- a/ReClass.NET/Util/Rtf/RtfBuilder.cs +++ b/ReClass.NET/Util/Rtf/RtfBuilder.cs @@ -218,11 +218,17 @@ public override string ToString() sb.Append(@"{\rtf1\ansi\ansicpg1252\deff0\deflang3081"); sb.Append(@"{\fonttbl"); - sb.Append(usedFonts.Select((f, i) => string.Format(f, i)).Join()); + for (var i = 0; i < usedFonts.Count; ++i) + { + sb.AppendFormat(usedFonts[i], i); + } sb.AppendLine("}"); sb.Append(@"{\colortbl ;"); - sb.Append(usedColors.Select(c => $@"\red{c.R}\green{c.G}\blue{c.B};").Join()); + foreach (var color in usedColors) + { + sb.Append($@"\red{color.R}\green{color.G}\blue{color.B};"); + } sb.AppendLine("}"); sb.Append(@"\viewkind4\uc1\pard\plain\f0"); From f69f9c0a9a4b8e80940dadfe049c73495c04f28c Mon Sep 17 00:00:00 2001 From: KN4CK3R Date: Mon, 29 Apr 2019 19:55:37 +0200 Subject: [PATCH 037/223] Changed method name. --- ReClass.NET/Extensions/LinqExtensions.cs | 44 +++++------------------- ReClass.NET/UI/ProjectView.cs | 2 +- 2 files changed, 10 insertions(+), 36 deletions(-) diff --git a/ReClass.NET/Extensions/LinqExtensions.cs b/ReClass.NET/Extensions/LinqExtensions.cs index 117562ce..d0cf32e7 100644 --- a/ReClass.NET/Extensions/LinqExtensions.cs +++ b/ReClass.NET/Extensions/LinqExtensions.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Diagnostics; using System.Diagnostics.Contracts; @@ -201,45 +201,19 @@ public static IEnumerable DistinctBy(this IEnumerable(this IEnumerable first, IEnumerable second) + public static bool IsEquivalentTo(this IEnumerable source, IEnumerable other) { - Contract.Requires(first != null); - Contract.Requires(second != null); - - return SequenceEqualsEx(first, second, EqualityComparer.Default); - } + Contract.Requires(source != null); + Contract.Requires(other != null); - [DebuggerStepThrough] - public static bool SequenceEqualsEx(this IEnumerable first, IEnumerable second, IEqualityComparer comparer) - { - Contract.Requires(first != null); - Contract.Requires(second != null); - Contract.Requires(comparer != null); + var expected = new List(source); - var counter = new Dictionary(comparer); - foreach (var element in first) - { - if (counter.ContainsKey(element)) - { - counter[element]++; - } - else - { - counter.Add(element, 1); - } - } - foreach (var element in second) + if (other.Any(item => !expected.Remove(item))) { - if (counter.ContainsKey(element)) - { - counter[element]--; - } - else - { - return false; - } + return false; } - return counter.Values.All(c => c == 0); + + return expected.Count == 0; } /// diff --git a/ReClass.NET/UI/ProjectView.cs b/ReClass.NET/UI/ProjectView.cs index b860c66f..9be2363d 100644 --- a/ReClass.NET/UI/ProjectView.cs +++ b/ReClass.NET/UI/ProjectView.cs @@ -72,7 +72,7 @@ private void RebuildClassHierarchy(HashSet seen) .Distinct() .ToList(); - if (distinctClasses.SequenceEqualsEx(Nodes.Cast().Select(t => t.ClassNode))) + if (distinctClasses.IsEquivalentTo(Nodes.Cast().Select(t => t.ClassNode))) { return; } From 7c917fb1e1e0c4702d990a7aa685e6a9a16821c3 Mon Sep 17 00:00:00 2001 From: KN4CK3R Date: Mon, 29 Apr 2019 22:06:00 +0200 Subject: [PATCH 038/223] Replaced Yield method with Prepend. --- ReClass.NET/Extensions/LinqExtensions.cs | 8 -------- ReClass.NET/Forms/MainForm.cs | 2 +- ReClass.NET/UI/EnumComboBox.cs | 4 ++-- ReClass.NET/UI/EnumDescriptionDisplay.cs | 16 ---------------- ReClass.NET/UI/NodeTypesBuilder.cs | 2 +- 5 files changed, 4 insertions(+), 28 deletions(-) diff --git a/ReClass.NET/Extensions/LinqExtensions.cs b/ReClass.NET/Extensions/LinqExtensions.cs index d0cf32e7..99aade64 100644 --- a/ReClass.NET/Extensions/LinqExtensions.cs +++ b/ReClass.NET/Extensions/LinqExtensions.cs @@ -113,14 +113,6 @@ public static void ForEach(this IEnumerable source, Action Yield(this TSource item) - { - Contract.Ensures(Contract.Result>() != null); - - yield return item; - } - [DebuggerStepThrough] public static IEnumerable Traverse(this IEnumerable source, Func> childSelector) { diff --git a/ReClass.NET/Forms/MainForm.cs b/ReClass.NET/Forms/MainForm.cs index 21c5df8d..33f951dd 100644 --- a/ReClass.NET/Forms/MainForm.cs +++ b/ReClass.NET/Forms/MainForm.cs @@ -800,7 +800,7 @@ private void memoryViewControl_ChangeClassTypeClick(object sender, NodeClickEven Name = "None" }; - using (var csf = new ClassSelectionForm(noneClass.Yield().Concat(classes))) + using (var csf = new ClassSelectionForm(classes.Prepend(noneClass))) { if (csf.ShowDialog() == DialogResult.OK) { diff --git a/ReClass.NET/UI/EnumComboBox.cs b/ReClass.NET/UI/EnumComboBox.cs index c266a9fa..c22fb6e7 100644 --- a/ReClass.NET/UI/EnumComboBox.cs +++ b/ReClass.NET/UI/EnumComboBox.cs @@ -93,7 +93,7 @@ public EnumComboBox() public void SetAvailableValues(TEnum item1, params TEnum[] items) { - SetAvailableValues(item1.Yield().Concat(items)); + SetAvailableValues(items.Prepend(item1)); } public void SetAvailableValues(IEnumerable values) @@ -105,7 +105,7 @@ public void SetAvailableValues(IEnumerable values) public void SetAvailableValuesExclude(TEnum item1, params TEnum[] items) { - SetAvailableValuesExclude(item1.Yield().Concat(items)); + SetAvailableValuesExclude(items.Prepend(item1)); } public void SetAvailableValuesExclude(IEnumerable values) diff --git a/ReClass.NET/UI/EnumDescriptionDisplay.cs b/ReClass.NET/UI/EnumDescriptionDisplay.cs index 692b22ce..5f638238 100644 --- a/ReClass.NET/UI/EnumDescriptionDisplay.cs +++ b/ReClass.NET/UI/EnumDescriptionDisplay.cs @@ -4,8 +4,6 @@ using System.Diagnostics.Contracts; using System.Linq; using System.Reflection; -using ReClassNET.Extensions; -using ReClassNET.Util; namespace ReClassNET.UI { @@ -21,13 +19,6 @@ public static List> Create() return CreateExact(Enum.GetValues(typeof(TEnum)).Cast()); } - public static List> CreateExact(TEnum item1, params TEnum[] include) - { - Contract.Ensures(Contract.Result>>() != null); - - return CreateExact(item1.Yield().Concat(include)); - } - public static List> CreateExact(IEnumerable include) { Contract.Requires(include != null); @@ -43,13 +34,6 @@ public static List> CreateExact(IEnumerable .ToList(); } - public static List> CreateExclude(TEnum item1, params TEnum[] exclude) - { - Contract.Ensures(Contract.Result>>() != null); - - return CreateExclude(item1.Yield().Concat(exclude)); - } - public static List> CreateExclude(IEnumerable exclude) { Contract.Requires(exclude != null); diff --git a/ReClass.NET/UI/NodeTypesBuilder.cs b/ReClass.NET/UI/NodeTypesBuilder.cs index 33828756..b896e785 100644 --- a/ReClass.NET/UI/NodeTypesBuilder.cs +++ b/ReClass.NET/UI/NodeTypesBuilder.cs @@ -119,7 +119,7 @@ public static IEnumerable CreateToolStripMenuItems(Action h Text = "None" }; - items = noneItem.Yield().Append(new ToolStripSeparator()).Concat(items); + items = items.Prepend(new ToolStripSeparator()).Prepend(noneItem); } return items; From b77f29e50da1cc5192442813d1e35f214999f274 Mon Sep 17 00:00:00 2001 From: KN4CK3R Date: Thu, 2 May 2019 21:30:42 +0200 Subject: [PATCH 039/223] Use build in methods to check if a character is printable. --- ReClass.NET/Extensions/StringExtensions.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ReClass.NET/Extensions/StringExtensions.cs b/ReClass.NET/Extensions/StringExtensions.cs index 6f2711c2..83114a8c 100644 --- a/ReClass.NET/Extensions/StringExtensions.cs +++ b/ReClass.NET/Extensions/StringExtensions.cs @@ -13,7 +13,7 @@ public static class StringExtension [DebuggerStepThrough] public static bool IsPrintable(this char c) { - return ' ' <= c && c <= '~'; + return !char.IsControl(c) || char.IsWhiteSpace(c); } [DebuggerStepThrough] @@ -75,6 +75,11 @@ public static float CalculatePrintableDataThreshold(this IEnumerable sourc } } + if (countAll == 0) + { + return 0.0f; + } + return countValid / (float)countAll; } From 955e46eff177e0230a977f6417dfcfe97c489737 Mon Sep 17 00:00:00 2001 From: KN4CK3R Date: Thu, 2 May 2019 21:31:41 +0200 Subject: [PATCH 040/223] Added LinqExtensions tests. Added StringExtensions tests. --- .../Extensions/LinqExtensionTests.cs | 131 +++++++++++++++ .../Extensions/StringExtensionTest.cs | 151 ++++++++++++++++++ ReClass.NET_Tests/ReClass.NET_Tests.csproj | 2 + 3 files changed, 284 insertions(+) create mode 100644 ReClass.NET_Tests/Extensions/LinqExtensionTests.cs create mode 100644 ReClass.NET_Tests/Extensions/StringExtensionTest.cs diff --git a/ReClass.NET_Tests/Extensions/LinqExtensionTests.cs b/ReClass.NET_Tests/Extensions/LinqExtensionTests.cs new file mode 100644 index 00000000..7fb1919f --- /dev/null +++ b/ReClass.NET_Tests/Extensions/LinqExtensionTests.cs @@ -0,0 +1,131 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using NFluent; +using ReClassNET.Extensions; +using Xunit; + +namespace ReClass.NET_Tests.Extensions +{ + public class LinqExtensionTests + { + public static TheoryData, bool> GetTestNoneData => new TheoryData, bool> + { + { new int[0], true }, + { new int[1], false }, + { Enumerable.Empty(), true } + }; + + [Theory] + [MemberData(nameof(GetTestNoneData))] + public void TestNone(IEnumerable sut, bool expected) + { + Check.That(sut.None()).IsEqualTo(expected); + } + + public static TheoryData, Func, bool> GetTestNoneWithSelectorData => new TheoryData, Func, bool> + { + { new int[0], i => false, true }, + { new int[0], i => true, true }, + { new [] { 1 }, i => i == 1, false }, + { new [] { 1 }, i => i != 1, true }, + { new [] { 1, 3, 5 }, i => i % 2 == 0, true } + }; + + [Theory] + [MemberData(nameof(GetTestNoneWithSelectorData))] + public void TestNoneWithSelector(IEnumerable sut, Func selector, bool expected) + { + Check.That(sut.None(selector)).IsEqualTo(expected); + } + + public static TheoryData, Func> GetTestWhereNotData => new TheoryData, Func> + { + { new int[0], i => false }, + { new int[0], i => true }, + { new [] { 1 }, i => i == 1 }, + { new [] { 1, 3, 5 }, i => i % 2 == 1 } + }; + + [Theory] + [MemberData(nameof(GetTestWhereNotData))] + public void TestWhereNot(IEnumerable sut, Func selector) + { + Check.That(sut.WhereNot(selector)).IsEmpty(); + } + + public static TheoryData, int, int> GetTestFindIndexData => new TheoryData, int, int> + { + { new int[0], 1, -1 }, + { new [] { 1 }, 1, 0 }, + { new [] { 1 }, 2, -1 }, + { new [] { 1, 3, 5 }, 1, 0 }, + { new [] { 1, 3, 5 }, 2, -1 }, + { new [] { 1, 3, 5 }, 3, 1 }, + { new [] { 1, 3, 5 }, 4, -1 }, + { new [] { 1, 3, 5 }, 5, 2 } + }; + + [Theory] + [MemberData(nameof(GetTestFindIndexData))] + public void TestFindIndex(IEnumerable sut, int item, int expected) + { + Check.That(sut.FindIndex(i => i == item)).IsEqualTo(expected); + } + + public static TheoryData> GetTestForEachData => new TheoryData> + { + { Enumerable.Empty() }, + { Enumerable.Repeat(0, 1) }, + { Enumerable.Repeat(0, 2) }, + { Enumerable.Repeat(0, 10) } + }; + + [Theory] + [MemberData(nameof(GetTestForEachData))] + public void TestForEach(IEnumerable sut) + { + var sutCpy = sut.ToList(); + + var counter = 0; + sutCpy.ForEach(_ => counter++); + + Check.That(counter).IsEqualTo(sutCpy.Count); + } + + public static TheoryData, Func, IEnumerable> GetTestDistinctByData => new TheoryData, Func, IEnumerable> + { + { Enumerable.Empty(), i => i, Enumerable.Empty() }, + { new [] { 1 }, i => i, new [] { 1 } }, + { new [] { 1, 1, 1, 1 }, i => i, new [] { 1 } }, + { new [] { 1, 2, 3, 4 }, i => i, new [] { 1, 2, 3, 4 } }, + { new [] { 1, 1, 2, 2, 3, 3 }, i => i, new [] { 1, 2, 3 } }, + { new [] { 1, 1, 2, 2, 3, 4 }, i => i, new [] { 1, 2, 3, 4 } }, + { new [] { 1, 1, 2, 2, 3, 4 }, i => 0, new [] { 1 } } + }; + + [Theory] + [MemberData(nameof(GetTestDistinctByData))] + public void TestDistinctBy(IEnumerable sut, Func selector, IEnumerable expected) + { + Check.That(sut.DistinctBy(selector)).IsEquivalentTo(expected); + } + + public static TheoryData, IEnumerable, bool> GetTestIsEquivalentToData => new TheoryData, IEnumerable, bool> + { + { Enumerable.Empty(), Enumerable.Empty(), true }, + { Enumerable.Empty(), new int[0], true }, + { new [] { 1 }, new int[0], false }, + { new [] { 1 }, new [] { 2 }, false }, + { new [] { 1, 2, 3 }, new [] { 1, 2, 3 }, true }, + { new [] { 1, 2, 3 }, new [] { 3, 1, 2 }, true } + }; + + [Theory] + [MemberData(nameof(GetTestIsEquivalentToData))] + public void TestIsEquivalentTo(IEnumerable sut, IEnumerable other, bool expected) + { + Check.That(sut.IsEquivalentTo(other)).IsEqualTo(expected); + } + } +} diff --git a/ReClass.NET_Tests/Extensions/StringExtensionTest.cs b/ReClass.NET_Tests/Extensions/StringExtensionTest.cs new file mode 100644 index 00000000..5b41a8ba --- /dev/null +++ b/ReClass.NET_Tests/Extensions/StringExtensionTest.cs @@ -0,0 +1,151 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using NFluent; +using ReClassNET.Extensions; +using Xunit; + +namespace ReClass.NET_Tests.Extensions +{ + public class StringExtensionTest + { + public static TheoryData GetTestIsPrintableData() => new TheoryData + { + '0', '9', ' ', '\t', '\n', 'a', 'A', 'z', 'Z', '-', '_', '°', '^', '"', '\\', '\"', '&', '@', '€', '$', '|', '<', '>', ';', ',', '.', ':', '#', '*', '+', '~', '`', '´', 'ß', '?', '=', '(', ')', '[', ']', '{', '}' + }; + + [Theory] + [MemberData(nameof(GetTestIsPrintableData))] + public void TestIsPrintable(char c) + { + Check.That(c.IsPrintable()).IsTrue(); + } + + public static TheoryData GetTestIsNotPrintableData() => new TheoryData + { + '\u0000','\u0001', '\u0002', '\u009A','\u009B', '\u009C', '\u009D','\u009E', '\u009F' + }; + + [Theory] + [MemberData(nameof(GetTestIsNotPrintableData))] + public void TestIsNotPrintable(char c) + { + Check.That(c.IsPrintable()).IsFalse(); + } + + public static TheoryData GetTestLimitLengthData() => new TheoryData + { + { string.Empty, 0, string.Empty }, + { string.Empty, 1, string.Empty }, + { "01234", 0, string.Empty }, + { "01234", 1, "0" }, + { "01234", 5, "01234" }, + { "01234", 10, "01234" } + }; + + [Theory] + [MemberData(nameof(GetTestLimitLengthData))] + public void TestLimitLength(string sut, int length, string expected) + { + Check.That(sut.LimitLength(length)).IsEqualTo(expected); + } + + [Fact] + public void TestLimitLengthThrows() + { + Check.ThatCode(() => "".LimitLength(-1)).Throws(); + } + + public static TheoryData, IEnumerable> GetTestInterpretAsUtf8Data() => new TheoryData, IEnumerable> + { + { new byte[0], string.Empty }, + { new [] { (byte)'t', (byte)'e', (byte)'s', (byte)'t' }, "test".ToArray() /* https://github.com/tpierrain/NFluent/issues/299 */ } + }; + + [Theory] + [MemberData(nameof(GetTestInterpretAsUtf8Data))] + public void TestInterpretAsUtf8(IEnumerable sut, IEnumerable expected) + { + Check.That(sut.InterpretAsUtf8()).ContainsExactly(expected); + } + + public static TheoryData, IEnumerable> GetTestInterpretAsUtf16Data() => new TheoryData, IEnumerable> + { + { new byte[0], string.Empty }, + { new [] { (byte)'t', (byte)0, (byte)'e', (byte)0, (byte)'s', (byte)0, (byte)'t', (byte)0 }, "test".ToArray() /* https://github.com/tpierrain/NFluent/issues/299 */ } + }; + + [Theory] + [MemberData(nameof(GetTestInterpretAsUtf16Data))] + public void TestInterpretAsUtf16(IEnumerable sut, IEnumerable expected) + { + Check.That(sut.InterpretAsUtf16()).ContainsExactly(expected); + } + + public static TheoryData, float> GetTestCalculatePrintableDataThresholdData() => new TheoryData, float> + { + { new char[0], 0.0f }, + { new [] { '\0' }, 0.0f }, + { new [] { 'a' }, 1.0f }, + { new [] { '\0', 'a' }, 0.0f }, + { new [] { 'a', '\0' }, 0.5f }, + { new [] { '\0', 'a', 'a' }, 0.0f }, + { new [] { 'a', 'a', '\0' }, 2 / 3.0f }, + { new [] { 'a', 'a', '\0', '\0' }, 0.5f }, + { new [] { 'a', 'a', '\0', '\0', '\0' }, 2 / 5.0f } + }; + + [Theory] + [MemberData(nameof(GetTestCalculatePrintableDataThresholdData))] + public void TestCalculatePrintableDataThreshold(IEnumerable sut, float expected) + { + Check.That(sut.CalculatePrintableDataThreshold()).IsCloseTo(expected, 0.001); + } + + [Theory] + [InlineData('a')] + [InlineData('a', 'a')] + [InlineData('a', 'a', 'f')] + [InlineData('#', '+', 'r', '?', 'ß', '%', '&', '§', '_', '0', '/', '(', 'ö')] + public void TestIsPrintableData(params char[] sut) + { + Check.That(sut.IsPrintableData()).IsTrue(); + } + + [Theory] + [InlineData] + [InlineData('a', '\0')] + [InlineData('\0', 'a')] + [InlineData('a', 'a', '\0')] + [InlineData('a', 'a', 'f', '\0')] + [InlineData('a', 'a', '\0', 'f')] + [InlineData('a', '\0', 'a', 'f')] + [InlineData('\0', 'a', 'a', 'f')] + public void TestIsNotPrintableData(params char[] sut) + { + Check.That(sut.IsPrintableData()).IsFalse(); + } + + [Theory] + [InlineData('a', 'a', 'f', '\0')] + [InlineData('1', '2', '3', '4', '5', '6', '7', '8', '\0', '\0')] + [InlineData('1', '2', '3', '4', '5', '6', '7', '8', '9', '0', 'a', 'b', '\0', '\0', '\0', '\0')] + public void TestIsLikelyPrintableData(params char[] sut) + { + Check.That(sut.IsLikelyPrintableData()).IsTrue(); + } + + [Theory] + [InlineData] + [InlineData('a', '\0')] + [InlineData('\0', 'a')] + [InlineData('a', 'a', '\0')] + [InlineData('a', 'a', '\0', 'f')] + [InlineData('a', 'a', '\0', '\0')] + [InlineData('a', '\0', 'a', 'f')] + public void TestIsNotLikelyPrintableData(params char[] sut) + { + Check.That(sut.IsPrintableData()).IsFalse(); + } + } +} diff --git a/ReClass.NET_Tests/ReClass.NET_Tests.csproj b/ReClass.NET_Tests/ReClass.NET_Tests.csproj index bb7d9fa0..45bcbb3f 100644 --- a/ReClass.NET_Tests/ReClass.NET_Tests.csproj +++ b/ReClass.NET_Tests/ReClass.NET_Tests.csproj @@ -71,6 +71,8 @@ + + From da2f39a8862fc0cec1316fc187cd0003288743b2 Mon Sep 17 00:00:00 2001 From: KN4CK3R Date: Fri, 3 May 2019 13:04:25 +0200 Subject: [PATCH 041/223] The bug is fixed in NFluent 2.6.0. --- ReClass.NET_Tests/Extensions/StringExtensionTest.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ReClass.NET_Tests/Extensions/StringExtensionTest.cs b/ReClass.NET_Tests/Extensions/StringExtensionTest.cs index 5b41a8ba..74779eb9 100644 --- a/ReClass.NET_Tests/Extensions/StringExtensionTest.cs +++ b/ReClass.NET_Tests/Extensions/StringExtensionTest.cs @@ -59,7 +59,7 @@ public void TestLimitLengthThrows() public static TheoryData, IEnumerable> GetTestInterpretAsUtf8Data() => new TheoryData, IEnumerable> { { new byte[0], string.Empty }, - { new [] { (byte)'t', (byte)'e', (byte)'s', (byte)'t' }, "test".ToArray() /* https://github.com/tpierrain/NFluent/issues/299 */ } + { new [] { (byte)'t', (byte)'e', (byte)'s', (byte)'t' }, "test" } }; [Theory] @@ -72,7 +72,7 @@ public void TestInterpretAsUtf8(IEnumerable sut, IEnumerable expecte public static TheoryData, IEnumerable> GetTestInterpretAsUtf16Data() => new TheoryData, IEnumerable> { { new byte[0], string.Empty }, - { new [] { (byte)'t', (byte)0, (byte)'e', (byte)0, (byte)'s', (byte)0, (byte)'t', (byte)0 }, "test".ToArray() /* https://github.com/tpierrain/NFluent/issues/299 */ } + { new [] { (byte)'t', (byte)0, (byte)'e', (byte)0, (byte)'s', (byte)0, (byte)'t', (byte)0 }, "test" } }; [Theory] From 7cdcd7b3d6ca4585bd6f0b137cd71a9b14f131ea Mon Sep 17 00:00:00 2001 From: KN4CK3R Date: Fri, 3 May 2019 13:46:36 +0200 Subject: [PATCH 042/223] Removed unused methods. --- ReClass.NET/Extensions/LinqExtensions.cs | 48 ------------------------ 1 file changed, 48 deletions(-) diff --git a/ReClass.NET/Extensions/LinqExtensions.cs b/ReClass.NET/Extensions/LinqExtensions.cs index 99aade64..c623d8ae 100644 --- a/ReClass.NET/Extensions/LinqExtensions.cs +++ b/ReClass.NET/Extensions/LinqExtensions.cs @@ -8,54 +8,6 @@ namespace ReClassNET.Extensions { public static class LinqExtension { - public static TResult Max(this IEnumerable source, Func selector, IComparer comparer) - { - comparer = comparer ?? Comparer.Default; - - using (var it = source.GetEnumerator()) - { - if (!it.MoveNext()) - { - throw new InvalidOperationException(); - } - - var max = selector(it.Current); - while (it.MoveNext()) - { - var current = selector(it.Current); - if (comparer.Compare(current, max) > 0) - { - max = current; - } - } - return max; - } - } - - public static TResult Min(this IEnumerable source, Func selector, IComparer comparer) - { - comparer = comparer ?? Comparer.Default; - - using (var it = source.GetEnumerator()) - { - if (!it.MoveNext()) - { - throw new InvalidOperationException(); - } - - var min = selector(it.Current); - while (it.MoveNext()) - { - var current = selector(it.Current); - if (comparer.Compare(current, min) < 0) - { - min = current; - } - } - return min; - } - } - [DebuggerStepThrough] public static bool None(this IEnumerable source) { From 2ef1863ce6d7cf54a3cd61cf689f13abbd4fe2b0 Mon Sep 17 00:00:00 2001 From: KN4CK3R Date: Fri, 3 May 2019 13:48:08 +0200 Subject: [PATCH 043/223] Removed SkipUntil method. Use better fitting name for TakeUntil method. --- ReClass.NET/Extensions/LinqExtensions.cs | 27 ++---------------------- ReClass.NET/UI/MemoryViewControl.cs | 7 +++--- 2 files changed, 6 insertions(+), 28 deletions(-) diff --git a/ReClass.NET/Extensions/LinqExtensions.cs b/ReClass.NET/Extensions/LinqExtensions.cs index c623d8ae..57b64a47 100644 --- a/ReClass.NET/Extensions/LinqExtensions.cs +++ b/ReClass.NET/Extensions/LinqExtensions.cs @@ -87,30 +87,7 @@ public static IEnumerable Traverse(this IEnumerable s } [DebuggerStepThrough] - public static IEnumerable SkipUntil(this IEnumerable source, Func predicate) - { - Contract.Requires(source != null); - Contract.Requires(predicate != null); - Contract.Ensures(Contract.Result>() != null); - - using (var iterator = source.GetEnumerator()) - { - while (iterator.MoveNext()) - { - if (predicate(iterator.Current)) - { - break; - } - } - while (iterator.MoveNext()) - { - yield return iterator.Current; - } - } - } - - [DebuggerStepThrough] - public static IEnumerable TakeUntil(this IEnumerable source, Func predicate) + public static IEnumerable TakeWhileInclusive(this IEnumerable source, Func predicate) { Contract.Requires(source != null); Contract.Requires(predicate != null); @@ -120,7 +97,7 @@ public static IEnumerable TakeUntil(this IEnumerable { yield return item; - if (predicate(item)) + if (!predicate(item)) { yield break; } diff --git a/ReClass.NET/UI/MemoryViewControl.cs b/ReClass.NET/UI/MemoryViewControl.cs index ead9e1f1..56fd3944 100644 --- a/ReClass.NET/UI/MemoryViewControl.cs +++ b/ReClass.NET/UI/MemoryViewControl.cs @@ -314,7 +314,7 @@ protected override void OnMouseClick(MouseEventArgs e) var containerNode = selectedNode.GetParentContainer(); foreach (var spot in containerNode.Nodes .SkipWhile(n => n != first.Node) - .TakeUntil(n => n == last.Node) + .TakeWhileInclusive(n => n != last.Node) .Select(n => new HotSpot { Address = (IntPtr)(containerNode.Offset + n.Offset), @@ -557,7 +557,8 @@ protected override bool ProcessCmdKey(ref Message msg, Keys keyData) if (key == Keys.Down) { var temp = query - .SkipUntil(h => h.Node == selectionCaret.Node) + .SkipWhile(h => h.Node != selectionCaret.Node) + .Skip(1) .ToList(); toSelect = temp.FirstOrDefault(); @@ -593,7 +594,7 @@ protected override bool ProcessCmdKey(ref Message msg, Keys keyData) var containerNode = toSelect.Node.GetParentContainer(); foreach (var spot in containerNode.Nodes .SkipWhile(n => n != first.Node) - .TakeUntil(n => n == last.Node) + .TakeWhileInclusive(n => n != last.Node) .Select(n => new HotSpot { Address = (IntPtr)(containerNode.Offset + n.Offset), From 8c1e60db99b24d13875a0ee27bf85cfe7f44c957 Mon Sep 17 00:00:00 2001 From: KN4CK3R Date: Fri, 3 May 2019 15:41:11 +0200 Subject: [PATCH 044/223] Throw if sequence is empty. --- ReClass.NET/Extensions/LinqExtensions.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ReClass.NET/Extensions/LinqExtensions.cs b/ReClass.NET/Extensions/LinqExtensions.cs index 57b64a47..a36149ff 100644 --- a/ReClass.NET/Extensions/LinqExtensions.cs +++ b/ReClass.NET/Extensions/LinqExtensions.cs @@ -163,6 +163,12 @@ public static TSource PredicateOrFirst(this IEnumerable source first = false; } } + + if (first) + { + throw new InvalidOperationException("Sequence contains no elements"); + } + return result; } From 8bd76320683b329de6a3808b6fd8665685fd0f1c Mon Sep 17 00:00:00 2001 From: KN4CK3R Date: Fri, 3 May 2019 15:41:42 +0200 Subject: [PATCH 045/223] Added more tests. --- .../Extensions/LinqExtensionTests.cs | 77 ++++++++++++++++++- 1 file changed, 73 insertions(+), 4 deletions(-) diff --git a/ReClass.NET_Tests/Extensions/LinqExtensionTests.cs b/ReClass.NET_Tests/Extensions/LinqExtensionTests.cs index 7fb1919f..386e07ed 100644 --- a/ReClass.NET_Tests/Extensions/LinqExtensionTests.cs +++ b/ReClass.NET_Tests/Extensions/LinqExtensionTests.cs @@ -75,10 +75,10 @@ public void TestFindIndex(IEnumerable sut, int item, int expected) public static TheoryData> GetTestForEachData => new TheoryData> { - { Enumerable.Empty() }, - { Enumerable.Repeat(0, 1) }, - { Enumerable.Repeat(0, 2) }, - { Enumerable.Repeat(0, 10) } + Enumerable.Empty(), + Enumerable.Repeat(0, 1), + Enumerable.Repeat(0, 2), + Enumerable.Repeat(0, 10) }; [Theory] @@ -127,5 +127,74 @@ public void TestIsEquivalentTo(IEnumerable sut, IEnumerable other, boo { Check.That(sut.IsEquivalentTo(other)).IsEqualTo(expected); } + + public static TheoryData, Func, IEnumerable> GetTestTakeWhileInclusiveData => new TheoryData, Func, IEnumerable> + { + { Enumerable.Empty(), i => false, Enumerable.Empty() }, + { new [] { 1 }, i => false, new [] { 1 } }, + { new [] { 1 }, i => true, new [] { 1 } }, + { new [] { 1, 1 }, i => false, new [] { 1 } }, + { new [] { 1, 1 }, i => true, new [] { 1, 1 } }, + { new [] { 1, 2, 3, 4 }, i => i != 2, new [] { 1, 2 } }, + { new [] { 1, 2, 3, 4 }, i => i != 3, new [] { 1, 2, 3 } }, + { new [] { 4, 3, 2, 1 }, i => false, new [] { 4 } } + }; + + [Theory] + [MemberData(nameof(GetTestTakeWhileInclusiveData))] + public void TestTakeWhileInclusive(IEnumerable sut, Func predicate, IEnumerable expected) + { + Check.That(sut.TakeWhileInclusive(predicate)).IsEquivalentTo(expected); + } + + public static TheoryData, Func, IEnumerable>> GetTestGroupWhileData => new TheoryData, Func, IEnumerable>> + { + { Enumerable.Empty(), (x, y) => false, Enumerable.Empty>() }, + { new [] { 1, 2, 3 }, (x, y) => x == y, new [] { new[] { 1 }, new[] { 2 }, new[] { 3 } } }, + { new [] { 1, 1, 2, 3, 3, 4 }, (x, y) => x == y, new [] { new[] { 1, 1 }, new[] { 2 }, new[] { 3, 3 }, new[] { 4 } } }, + { new [] { 1, 1, 2, 3, 3, 4 }, (x, y) => x != y, new [] { new[] { 1 }, new[] { 1, 2, 3 }, new[] { 3, 4 } } } + }; + + [Theory] + [MemberData(nameof(GetTestGroupWhileData))] + public void TestGroupWhile(IEnumerable sut, Func predicate, IEnumerable> expected) + { + using (var expectedIt = expected.GetEnumerator()) + { + using (var groupIt = sut.GroupWhile(predicate).GetEnumerator()) + { + while (groupIt.MoveNext()) + { + Check.That(expectedIt.MoveNext()).IsTrue(); + + Check.That(groupIt.Current).IsEquivalentTo(expectedIt.Current); + } + } + + Check.That(expectedIt.MoveNext()).IsFalse(); + } + } + + public static TheoryData, Func, int> GetTestPredicateOrFirstData => new TheoryData, Func, int> + { + { new [] { 1 }, i => false, 1 }, + { new [] { 1 }, i => true, 1 }, + { new [] { 1, 2, 3, 4 }, i => i == 2, 2 }, + { new [] { 1, 2, 3, 4 }, i => i == 4, 4 }, + { new [] { 1, 2, 3, 4 }, i => i == 5, 1 } + }; + + [Theory] + [MemberData(nameof(GetTestPredicateOrFirstData))] + public void TestPredicateOrFirst(IEnumerable sut, Func predicate, int expected) + { + Check.That(sut.PredicateOrFirst(predicate)).IsEqualTo(expected); + } + + [Fact] + public void TestPredicateOrFirstThrows() + { + Check.ThatCode(() => Enumerable.Empty().PredicateOrFirst(i => true)).Throws(); + } } } From abfdeb2c53a5e635ba1eedb3e9bd2de0bc018c00 Mon Sep 17 00:00:00 2001 From: KN4CK3R Date: Fri, 3 May 2019 18:49:23 +0200 Subject: [PATCH 046/223] Use simpler test. --- .../Extensions/LinqExtensionTests.cs | 20 ++++++------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/ReClass.NET_Tests/Extensions/LinqExtensionTests.cs b/ReClass.NET_Tests/Extensions/LinqExtensionTests.cs index 386e07ed..97448aef 100644 --- a/ReClass.NET_Tests/Extensions/LinqExtensionTests.cs +++ b/ReClass.NET_Tests/Extensions/LinqExtensionTests.cs @@ -73,24 +73,16 @@ public void TestFindIndex(IEnumerable sut, int item, int expected) Check.That(sut.FindIndex(i => i == item)).IsEqualTo(expected); } - public static TheoryData> GetTestForEachData => new TheoryData> - { - Enumerable.Empty(), - Enumerable.Repeat(0, 1), - Enumerable.Repeat(0, 2), - Enumerable.Repeat(0, 10) - }; - [Theory] - [MemberData(nameof(GetTestForEachData))] - public void TestForEach(IEnumerable sut) + [InlineData(0)] + [InlineData(1)] + [InlineData(10)] + public void TestForEach(int expected) { - var sutCpy = sut.ToList(); - var counter = 0; - sutCpy.ForEach(_ => counter++); + Enumerable.Repeat(0, expected).ForEach(_ => ++counter); - Check.That(counter).IsEqualTo(sutCpy.Count); + Check.That(counter).IsEqualTo(expected); } public static TheoryData, Func, IEnumerable> GetTestDistinctByData => new TheoryData, Func, IEnumerable> From 65b3fe80bb1c489698c41cab3abcd58c01210abb Mon Sep 17 00:00:00 2001 From: KN4CK3R Date: Fri, 3 May 2019 19:51:00 +0200 Subject: [PATCH 047/223] Added test. --- ReClass.NET/Extensions/LinqExtensions.cs | 8 ++--- .../Extensions/LinqExtensionTests.cs | 33 +++++++++++++++++++ 2 files changed, 37 insertions(+), 4 deletions(-) diff --git a/ReClass.NET/Extensions/LinqExtensions.cs b/ReClass.NET/Extensions/LinqExtensions.cs index a36149ff..22966d63 100644 --- a/ReClass.NET/Extensions/LinqExtensions.cs +++ b/ReClass.NET/Extensions/LinqExtensions.cs @@ -72,16 +72,16 @@ public static IEnumerable Traverse(this IEnumerable s Contract.Requires(childSelector != null); Contract.Ensures(Contract.Result>() != null); - var stack = new Stack(source); - while (stack.Any()) + var queue = new Queue(source); + while (queue.Count > 0) { - var next = stack.Pop(); + var next = queue.Dequeue(); yield return next; foreach (var child in childSelector(next)) { - stack.Push(child); + queue.Enqueue(child); } } } diff --git a/ReClass.NET_Tests/Extensions/LinqExtensionTests.cs b/ReClass.NET_Tests/Extensions/LinqExtensionTests.cs index 97448aef..cb420f5d 100644 --- a/ReClass.NET_Tests/Extensions/LinqExtensionTests.cs +++ b/ReClass.NET_Tests/Extensions/LinqExtensionTests.cs @@ -188,5 +188,38 @@ public void TestPredicateOrFirstThrows() { Check.ThatCode(() => Enumerable.Empty().PredicateOrFirst(i => true)).Throws(); } + + public class Traversable + { + public IList Children { get; } = new List(); + } + + [Fact] + public void TestTraverse() + { + var traversable = new Traversable(); + var child1 = new Traversable(); + child1.Children.Add(new Traversable()); + var child2 = new Traversable(); + child2.Children.Add(new Traversable()); + child2.Children.Add(new Traversable()); + var child3 = new Traversable(); + child3.Children.Add(new Traversable()); + child3.Children.Add(new Traversable()); + child3.Children.Add(new Traversable()); + traversable.Children.Add(child1); + traversable.Children.Add(child2); + traversable.Children.Add(child3); + + var expected = new[] { traversable } + .Append(child1) + .Append(child2) + .Append(child3) + .Concat(child1.Children) + .Concat(child2.Children) + .Concat(child3.Children); + + Check.That(new[] { traversable }.Traverse(t => t.Children)).ContainsExactly(expected); + } } } From 3cfbf185d714e24df55f6f9f8a4c36dd5d881a33 Mon Sep 17 00:00:00 2001 From: KN4CK3R Date: Sat, 4 May 2019 16:06:15 +0200 Subject: [PATCH 048/223] Changed method name. --- ReClass.NET/Extensions/RichTextBoxExtensions.cs | 4 ++-- ReClass.NET/Forms/CodeForm.cs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ReClass.NET/Extensions/RichTextBoxExtensions.cs b/ReClass.NET/Extensions/RichTextBoxExtensions.cs index 19f8fe20..634c4909 100644 --- a/ReClass.NET/Extensions/RichTextBoxExtensions.cs +++ b/ReClass.NET/Extensions/RichTextBoxExtensions.cs @@ -7,7 +7,7 @@ namespace ReClassNET.Extensions { public static class RichTextBoxExtension { - public static void SetInnerPadding(this TextBoxBase textBox, int left, int top, int right, int bottom) + public static void SetInnerMargin(this TextBoxBase textBox, int left, int top, int right, int bottom) { var rect = textBox.GetFormattingRect(); @@ -37,7 +37,7 @@ public RECT(Rectangle r) } } - [DllImport("User32.dll", CharSet = CharSet.Auto)] + [DllImport("user32.dll", CharSet = CharSet.Auto)] private static extern int SendMessage(IntPtr hWnd, uint msg, int wParam, ref RECT rect); [DllImport("user32.dll", CharSet = CharSet.Auto)] diff --git a/ReClass.NET/Forms/CodeForm.cs b/ReClass.NET/Forms/CodeForm.cs index 8e94a4e3..f84d3f0e 100644 --- a/ReClass.NET/Forms/CodeForm.cs +++ b/ReClass.NET/Forms/CodeForm.cs @@ -27,7 +27,7 @@ public CodeForm(ICodeGenerator generator, IReadOnlyList classes, IRea InitializeComponent(); - codeRichTextBox.SetInnerPadding(5, 5, 5, 5); + codeRichTextBox.SetInnerMargin(5, 5, 5, 5); var code = generator.GenerateCode(classes, enums, logger); From 94da570cabbfcfa2c70a6a419ca123246f85f605 Mon Sep 17 00:00:00 2001 From: KN4CK3R Date: Sat, 4 May 2019 16:06:55 +0200 Subject: [PATCH 049/223] Removed extension. --- ReClass.NET/Extensions/SizeExtensions.cs | 12 ------------ ReClass.NET/Nodes/ClassNode.cs | 9 +++++++-- ReClass.NET/ReClass.NET.csproj | 1 - 3 files changed, 7 insertions(+), 15 deletions(-) delete mode 100644 ReClass.NET/Extensions/SizeExtensions.cs diff --git a/ReClass.NET/Extensions/SizeExtensions.cs b/ReClass.NET/Extensions/SizeExtensions.cs deleted file mode 100644 index cc62726e..00000000 --- a/ReClass.NET/Extensions/SizeExtensions.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System.Drawing; - -namespace ReClassNET.Extensions -{ - public static class SizeExtension - { - public static Size Extend(this Size size, int width, int height) - { - return new Size(size.Width + width, size.Height + height); - } - } -} diff --git a/ReClass.NET/Nodes/ClassNode.cs b/ReClass.NET/Nodes/ClassNode.cs index 5e6b0cbe..a0642a49 100644 --- a/ReClass.NET/Nodes/ClassNode.cs +++ b/ReClass.NET/Nodes/ClassNode.cs @@ -138,12 +138,17 @@ Size AggregateNodeSizes(Size baseSize, Size newSize) return new Size(Math.Max(baseSize.Width, newSize.Width), baseSize.Height + newSize.Height); } + Size ExtendWidth(Size baseSize, int width) + { + return new Size(baseSize.Width + width, baseSize.Height); + } + // Draw the node if it is in the visible area. if (view.ClientArea.Contains(tx, y)) { var innerSize = node.Draw(nv, tx, y); - size = AggregateNodeSizes(size, innerSize.Extend(childOffset, 0)); + size = AggregateNodeSizes(size, ExtendWidth(innerSize, childOffset)); y += innerSize.Height; } @@ -158,7 +163,7 @@ Size AggregateNodeSizes(Size baseSize, Size newSize) // then draw the node... var innerSize = node.Draw(nv, tx, y); - size = AggregateNodeSizes(size, innerSize.Extend(childOffset, 0)); + size = AggregateNodeSizes(size, ExtendWidth(innerSize, childOffset)); y += innerSize.Height; } diff --git a/ReClass.NET/ReClass.NET.csproj b/ReClass.NET/ReClass.NET.csproj index 4f324a92..fc40bc7e 100644 --- a/ReClass.NET/ReClass.NET.csproj +++ b/ReClass.NET/ReClass.NET.csproj @@ -391,7 +391,6 @@ - From 8637de556a3beb0a13c49fa9514cd1ab7a3fb2f1 Mon Sep 17 00:00:00 2001 From: KN4CK3R Date: Sat, 4 May 2019 16:34:53 +0200 Subject: [PATCH 050/223] Added tests for StringBuilderExtension and StringReaderExtension. --- .../Extensions/StringBuilderExtensionTest.cs | 31 +++++++++++++++++++ .../Extensions/StringReaderExtensionTest.cs | 31 +++++++++++++++++++ ReClass.NET_Tests/ReClass.NET_Tests.csproj | 2 ++ 3 files changed, 64 insertions(+) create mode 100644 ReClass.NET_Tests/Extensions/StringBuilderExtensionTest.cs create mode 100644 ReClass.NET_Tests/Extensions/StringReaderExtensionTest.cs diff --git a/ReClass.NET_Tests/Extensions/StringBuilderExtensionTest.cs b/ReClass.NET_Tests/Extensions/StringBuilderExtensionTest.cs new file mode 100644 index 00000000..538f680a --- /dev/null +++ b/ReClass.NET_Tests/Extensions/StringBuilderExtensionTest.cs @@ -0,0 +1,31 @@ +using System.Text; +using NFluent; +using ReClassNET.Extensions; +using Xunit; + +namespace ReClass.NET_Tests.Extensions +{ + public class StringBuilderExtensionTest + { + [Fact] + public void TestPrependChar() + { + var sut = new StringBuilder("test"); + sut.Prepend('x'); + + Check.That(sut.ToString()).IsEqualTo("xtest"); + } + + [Theory] + [InlineData(null)] + [InlineData("")] + [InlineData("test")] + public void TestPrependString(string value) + { + var sut = new StringBuilder("test"); + sut.Prepend(value); + + Check.That(sut.ToString()).IsEqualTo(value + "test"); + } + } +} diff --git a/ReClass.NET_Tests/Extensions/StringReaderExtensionTest.cs b/ReClass.NET_Tests/Extensions/StringReaderExtensionTest.cs new file mode 100644 index 00000000..6933f951 --- /dev/null +++ b/ReClass.NET_Tests/Extensions/StringReaderExtensionTest.cs @@ -0,0 +1,31 @@ +using System.IO; +using NFluent; +using ReClassNET.Extensions; +using Xunit; + +namespace ReClass.NET_Tests.Extensions +{ + public class StringReaderExtensionTest + { + [Theory] + [InlineData("", -1)] + [InlineData(" ", -1)] + [InlineData("\t", -1)] + [InlineData("\r", -1)] + [InlineData("\n", -1)] + [InlineData("x", (int)'x')] + [InlineData("x ", (int)'x')] + [InlineData(" x", (int)'x')] + [InlineData(" x", (int)'x')] + [InlineData("\tx ", (int)'x')] + [InlineData("\rx ", (int)'x')] + [InlineData("\nx ", (int)'x')] + public void TestReadSkipWhitespaces(string input, int expected) + { + using (var sut = new StringReader(input)) + { + Check.That(sut.ReadSkipWhitespaces()).IsEqualTo(expected); + } + } + } +} diff --git a/ReClass.NET_Tests/ReClass.NET_Tests.csproj b/ReClass.NET_Tests/ReClass.NET_Tests.csproj index 45bcbb3f..2555f076 100644 --- a/ReClass.NET_Tests/ReClass.NET_Tests.csproj +++ b/ReClass.NET_Tests/ReClass.NET_Tests.csproj @@ -72,7 +72,9 @@ + + From 3de551c197972c1bb61c51b576df1bc073a4e010 Mon Sep 17 00:00:00 2001 From: KN4CK3R Date: Sat, 4 May 2019 17:44:04 +0200 Subject: [PATCH 051/223] Refactored extensions. Added tests. --- ReClass.NET/Extensions/ByteExtension.cs | 21 ++++ ReClass.NET/Extensions/ColorExtensions.cs | 13 ++- ReClass.NET/Extensions/Extensions.cs | 95 ------------------- ReClass.NET/Extensions/ListExtension.cs | 49 ++++++++++ ReClass.NET/Extensions/PointExtension.cs | 23 +++++ ReClass.NET/Memory/RemoteProcess.cs | 6 +- ReClass.NET/ReClass.NET.csproj | 4 +- ReClass.NET/UI/MemoryViewControl.cs | 6 +- .../Extensions/ByteExtensionTest.cs | 28 ++++++ .../Extensions/ListExtensionTest.cs | 24 +++++ .../Extensions/PointExtensionTest.cs | 25 +++++ ReClass.NET_Tests/ReClass.NET_Tests.csproj | 3 + 12 files changed, 195 insertions(+), 102 deletions(-) create mode 100644 ReClass.NET/Extensions/ByteExtension.cs delete mode 100644 ReClass.NET/Extensions/Extensions.cs create mode 100644 ReClass.NET/Extensions/ListExtension.cs create mode 100644 ReClass.NET/Extensions/PointExtension.cs create mode 100644 ReClass.NET_Tests/Extensions/ByteExtensionTest.cs create mode 100644 ReClass.NET_Tests/Extensions/ListExtensionTest.cs create mode 100644 ReClass.NET_Tests/Extensions/PointExtensionTest.cs diff --git a/ReClass.NET/Extensions/ByteExtension.cs b/ReClass.NET/Extensions/ByteExtension.cs new file mode 100644 index 00000000..1ed5035d --- /dev/null +++ b/ReClass.NET/Extensions/ByteExtension.cs @@ -0,0 +1,21 @@ +using System; +using System.Diagnostics; +using System.Diagnostics.Contracts; + +namespace ReClassNET.Extensions +{ + public static class ByteExtension + { + /// + /// Sets every element in the array to zero. + /// + /// + [DebuggerStepThrough] + public static void FillWithZero(this byte[] array) + { + Contract.Requires(array != null); + + Array.Clear(array, 0, array.Length); + } + } +} diff --git a/ReClass.NET/Extensions/ColorExtensions.cs b/ReClass.NET/Extensions/ColorExtensions.cs index c8d8edd1..c28c0937 100644 --- a/ReClass.NET/Extensions/ColorExtensions.cs +++ b/ReClass.NET/Extensions/ColorExtensions.cs @@ -1,9 +1,20 @@ -using System.Drawing; +using System.Diagnostics; +using System.Diagnostics.Contracts; +using System.Drawing; namespace ReClassNET.Extensions { public static class ExtensionColor { + [Pure] + [DebuggerStepThrough] + public static int ToRgb(this Color color) + { + return 0xFFFFFF & color.ToArgb(); + } + + [Pure] + [DebuggerStepThrough] public static Color Invert(this Color color) { return Color.FromArgb(color.A, 255 - color.R, 255 - color.G, 255 - color.B); diff --git a/ReClass.NET/Extensions/Extensions.cs b/ReClass.NET/Extensions/Extensions.cs deleted file mode 100644 index ef0ded0b..00000000 --- a/ReClass.NET/Extensions/Extensions.cs +++ /dev/null @@ -1,95 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.Diagnostics.Contracts; -using System.Drawing; -using System.Linq; -using ReClassNET.Nodes; - -namespace ReClassNET.Extensions -{ - public static class Extensions - { - [Pure] - [DebuggerStepThrough] - public static int ToRgb(this Color color) - { - return 0xFFFFFF & color.ToArgb(); - } - - [DebuggerStepThrough] - public static void FillWithZero(this byte[] b) - { - Contract.Requires(b != null); - - for (var i = 0; i < b.Length; ++i) - { - b[i] = 0; - } - } - - [Pure] - [DebuggerStepThrough] - public static Point OffsetEx(this Point p, int x, int y) - { - var temp = p; - temp.Offset(x, y); - return temp; - } - - public static IEnumerable Descendants(this BaseNode root) - { - Contract.Requires(root != null); - - var nodes = new Stack(); - nodes.Push(root); - while (nodes.Any()) - { - var node = nodes.Pop(); - yield return node; - - if (node is ClassNode classNode) - { - foreach (var child in classNode.Nodes) - { - nodes.Push(child); - } - } - } - } - - #region List - - [DebuggerStepThrough] - public static T BinaryFind(this IList source, Func comparer) - { - Contract.Requires(source != null); - Contract.Requires(comparer != null); - - var lo = 0; - var hi = source.Count - 1; - - while (lo <= hi) - { - var median = lo + (hi - lo >> 1); - var num = comparer(source[median]); - if (num == 0) - { - return source[median]; - } - if (num > 0) - { - lo = median + 1; - } - else - { - hi = median - 1; - } - } - - return default(T); - } - - #endregion - } -} diff --git a/ReClass.NET/Extensions/ListExtension.cs b/ReClass.NET/Extensions/ListExtension.cs new file mode 100644 index 00000000..cad4b572 --- /dev/null +++ b/ReClass.NET/Extensions/ListExtension.cs @@ -0,0 +1,49 @@ +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Diagnostics.Contracts; + +namespace ReClassNET.Extensions +{ + public static class ListExtension + { + /// + /// Searches a range of elements in the sorted list for an element using the specified comparer and returns the zero-based index of the element. + /// + /// + /// + /// The comparer to use + /// The zero-based index in the sorted list, if an item is found; otherwise, a negative number that is the bitwise complement of the index of the next element that is larger or, if there is no larger element, the bitwise complement of . + [Pure] + [DebuggerStepThrough] + public static int BinarySearch(this IList source, Func comparer) + { + Contract.Requires(source != null); + Contract.Requires(comparer != null); + + var lo = 0; + var hi = source.Count - 1; + + while (lo <= hi) + { + var i = lo + (hi - lo >> 1); + + var order = comparer(source[i]); + if (order == 0) + { + return i; + } + if (order > 0) + { + lo = i + 1; + } + else + { + hi = i - 1; + } + } + + return ~lo; + } + } +} diff --git a/ReClass.NET/Extensions/PointExtension.cs b/ReClass.NET/Extensions/PointExtension.cs new file mode 100644 index 00000000..a43fa48f --- /dev/null +++ b/ReClass.NET/Extensions/PointExtension.cs @@ -0,0 +1,23 @@ +using System.Diagnostics; +using System.Diagnostics.Contracts; +using System.Drawing; + +namespace ReClassNET.Extensions +{ + public static class PointExtension + { + /// + /// Creates a new point which is relocated with the given offsets. + /// + /// + /// The offset in x direction. + /// The offset in y direction. + /// The relocated point. + [Pure] + [DebuggerStepThrough] + public static Point Relocate(this Point point, int offsetX, int offsetY) + { + return new Point(point.X + offsetX, point.Y + offsetY); + } + } +} diff --git a/ReClass.NET/Memory/RemoteProcess.cs b/ReClass.NET/Memory/RemoteProcess.cs index 1bbbd283..3c04c8fa 100644 --- a/ReClass.NET/Memory/RemoteProcess.cs +++ b/ReClass.NET/Memory/RemoteProcess.cs @@ -514,7 +514,8 @@ public Section GetSectionToPointer(IntPtr address) { lock (sections) { - return sections.BinaryFind(s => address.CompareToRange(s.Start, s.End)); + var index = sections.BinarySearch(s => address.CompareToRange(s.Start, s.End)); + return index < 0 ? null : sections[index]; } } @@ -522,7 +523,8 @@ public Module GetModuleToPointer(IntPtr address) { lock (modules) { - return modules.BinaryFind(m => address.CompareToRange(m.Start, m.End)); + var index = modules.BinarySearch(m => address.CompareToRange(m.Start, m.End)); + return index < 0 ? null : modules[index]; } } diff --git a/ReClass.NET/ReClass.NET.csproj b/ReClass.NET/ReClass.NET.csproj index fc40bc7e..d7a2ba42 100644 --- a/ReClass.NET/ReClass.NET.csproj +++ b/ReClass.NET/ReClass.NET.csproj @@ -171,6 +171,9 @@ + + + @@ -408,7 +411,6 @@ SettingsForm.cs - Component diff --git a/ReClass.NET/UI/MemoryViewControl.cs b/ReClass.NET/UI/MemoryViewControl.cs index 56fd3944..c870ea4a 100644 --- a/ReClass.NET/UI/MemoryViewControl.cs +++ b/ReClass.NET/UI/MemoryViewControl.cs @@ -457,7 +457,7 @@ protected override void OnMouseHover(EventArgs e) if (selectedNodes.Count > 1) { var memorySize = selectedNodes.Sum(h => h.Node.MemorySize); - nodeInfoToolTip.Show($"{selectedNodes.Count} Nodes selected, {memorySize} bytes", this, toolTipPosition.OffsetEx(16, 16)); + nodeInfoToolTip.Show($"{selectedNodes.Count} Nodes selected, {memorySize} bytes", this, toolTipPosition.Relocate(16, 16)); } else { @@ -469,14 +469,14 @@ protected override void OnMouseHover(EventArgs e) { memoryPreviewPopUp.InitializeMemory(spot.Memory.Process, previewAddress); - memoryPreviewPopUp.Show(this, toolTipPosition.OffsetEx(16, 16)); + memoryPreviewPopUp.Show(this, toolTipPosition.Relocate(16, 16)); } else { var text = spot.Node.GetToolTipText(spot, spot.Memory); if (!string.IsNullOrEmpty(text)) { - nodeInfoToolTip.Show(text, this, toolTipPosition.OffsetEx(16, 16)); + nodeInfoToolTip.Show(text, this, toolTipPosition.Relocate(16, 16)); } } diff --git a/ReClass.NET_Tests/Extensions/ByteExtensionTest.cs b/ReClass.NET_Tests/Extensions/ByteExtensionTest.cs new file mode 100644 index 00000000..e3633864 --- /dev/null +++ b/ReClass.NET_Tests/Extensions/ByteExtensionTest.cs @@ -0,0 +1,28 @@ +using System.Linq; +using NFluent; +using ReClassNET.Extensions; +using Xunit; + +namespace ReClass.NET_Tests.Extensions +{ + public class ByteExtensionTest + { + public static TheoryData GetTestFillWithZeroData() => new TheoryData + { + new byte[0], + Enumerable.Repeat(1, 1).Select(i => (byte)i).ToArray(), + Enumerable.Repeat(1, 10).Select(i => (byte)i).ToArray(), + Enumerable.Repeat(1, 100).Select(i => (byte)i).ToArray(), + Enumerable.Repeat(1, 1000).Select(i => (byte)i).ToArray() + }; + + [Theory] + [MemberData(nameof(GetTestFillWithZeroData))] + public void TestFillWithZero(byte[] sut) + { + sut.FillWithZero(); + + Check.That(sut.All(b => b == 0)).IsTrue(); + } + } +} diff --git a/ReClass.NET_Tests/Extensions/ListExtensionTest.cs b/ReClass.NET_Tests/Extensions/ListExtensionTest.cs new file mode 100644 index 00000000..377bd2b3 --- /dev/null +++ b/ReClass.NET_Tests/Extensions/ListExtensionTest.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using NFluent; +using ReClassNET.Extensions; +using Xunit; + +namespace ReClass.NET_Tests.Extensions +{ + public class ListExtensionTest + { + public static TheoryData, Func, int> GetTestBinarySearchData() => new TheoryData, Func, int> + { + + }; + + public void TestBinarySearch(IList sut, Func comparer, int expected) + { + Check.That(sut.BinarySearch(comparer)).IsEqualTo(expected); + } + } +} diff --git a/ReClass.NET_Tests/Extensions/PointExtensionTest.cs b/ReClass.NET_Tests/Extensions/PointExtensionTest.cs new file mode 100644 index 00000000..dc6264d6 --- /dev/null +++ b/ReClass.NET_Tests/Extensions/PointExtensionTest.cs @@ -0,0 +1,25 @@ +using System.Drawing; +using NFluent; +using ReClassNET.Extensions; +using Xunit; + +namespace ReClass.NET_Tests.Extensions +{ + public class PointExtensionTest + { + public static TheoryData GetTestRelocateData() => new TheoryData + { + { Point.Empty, 0, 0, Point.Empty }, + { Point.Empty, 1, 1, new Point(1, 1) }, + { Point.Empty, -1, -1, new Point(-1, -1) }, + { new Point(-1, -1), 1, 1, Point.Empty }, + }; + + [Theory] + [MemberData(nameof(GetTestRelocateData))] + public void TestRelocate(Point sut, int offsetX, int offsetY, Point expected) + { + Check.That(sut.Relocate(offsetX, offsetY)).IsEqualTo(expected); + } + } +} diff --git a/ReClass.NET_Tests/ReClass.NET_Tests.csproj b/ReClass.NET_Tests/ReClass.NET_Tests.csproj index 2555f076..415c5127 100644 --- a/ReClass.NET_Tests/ReClass.NET_Tests.csproj +++ b/ReClass.NET_Tests/ReClass.NET_Tests.csproj @@ -67,11 +67,14 @@ + + + From 6ff0b3b96cc2cb370239e7d0c7aa7b9d6b8d5205 Mon Sep 17 00:00:00 2001 From: KN4CK3R Date: Sat, 4 May 2019 22:53:46 +0200 Subject: [PATCH 052/223] Fixed pattern parser. Added tests. --- ReClass.NET/MemoryScanner/BytePattern.cs | 57 ++++---- .../MemoryScanner/BytePatternTest.cs | 125 ++++++++++++++++++ ReClass.NET_Tests/ReClass.NET_Tests.csproj | 1 + 3 files changed, 158 insertions(+), 25 deletions(-) create mode 100644 ReClass.NET_Tests/MemoryScanner/BytePatternTest.cs diff --git a/ReClass.NET/MemoryScanner/BytePattern.cs b/ReClass.NET/MemoryScanner/BytePattern.cs index 6f4779a7..64ff463c 100644 --- a/ReClass.NET/MemoryScanner/BytePattern.cs +++ b/ReClass.NET/MemoryScanner/BytePattern.cs @@ -8,7 +8,7 @@ namespace ReClassNET.MemoryScanner { - public enum PatternFormat + public enum PatternMaskFormat { /// /// Example: AA BB ?? D? ?E FF @@ -17,7 +17,7 @@ public enum PatternFormat /// /// Example: \xAA\xBB\x00\x00\x00\xFF xx???x /// - PatternAndMask + Separated } public class BytePattern @@ -42,7 +42,7 @@ private interface IPatternByte /// /// /// - Tuple ToString(PatternFormat format); + Tuple ToString(PatternMaskFormat format); } private class PatternByte : IPatternByte @@ -128,13 +128,13 @@ public bool Equals(byte b) return false; } - public Tuple ToString(PatternFormat format) + public Tuple ToString(PatternMaskFormat format) { switch (format) { - case PatternFormat.PatternAndMask: + case PatternMaskFormat.Separated: return HasWildcard ? Tuple.Create("\\x00", "?") : Tuple.Create($"\\x{ToByte():X02}", "x"); - case PatternFormat.Combined: + case PatternMaskFormat.Combined: var sb = new StringBuilder(); if (nibble1.IsWildcard) sb.Append('?'); else sb.AppendFormat("{0:X}", nibble1.Value); @@ -146,7 +146,7 @@ public Tuple ToString(PatternFormat format) } } - public override string ToString() => ToString(PatternFormat.Combined).Item1; + public override string ToString() => ToString(PatternMaskFormat.Combined).Item1; } private class SimplePatternByte : IPatternByte @@ -162,13 +162,13 @@ public SimplePatternByte(byte value) public bool Equals(byte b) => value == b; - public Tuple ToString(PatternFormat format) + public Tuple ToString(PatternMaskFormat format) { switch (format) { - case PatternFormat.PatternAndMask: + case PatternMaskFormat.Separated: return Tuple.Create($"\\x{ToByte():X02}", "x"); - case PatternFormat.Combined: + case PatternMaskFormat.Combined: return Tuple.Create($"{ToByte():X02}", (string)null); default: throw new ArgumentOutOfRangeException(nameof(format), format, null); @@ -215,16 +215,23 @@ public static BytePattern Parse(string value) using (var sr = new StringReader(value)) { - var pb = new PatternByte(); - while (pb.TryRead(sr)) + while (true) { - if (!pb.HasWildcard) + var pb = new PatternByte(); + if (pb.TryRead(sr)) { - pattern.pattern.Add(new SimplePatternByte(pb.ToByte())); + if (!pb.HasWildcard) + { + pattern.pattern.Add(new SimplePatternByte(pb.ToByte())); + } + else + { + pattern.pattern.Add(pb); + } } else { - pattern.pattern.Add(pb); + break; } } @@ -259,9 +266,9 @@ public static BytePattern From(IEnumerable> data) { var pattern = new BytePattern(); - foreach (var i in data) + foreach (var (value, isWildcard) in data) { - var pb = i.Item2 ? (IPatternByte)PatternByte.NewWildcardByte() : new SimplePatternByte(i.Item1); + var pb = isWildcard ? (IPatternByte)PatternByte.NewWildcardByte() : new SimplePatternByte(value); pattern.pattern.Add(pb); } @@ -309,32 +316,32 @@ public byte[] ToByteArray() } /// - /// Formats the in the specified . + /// Formats the in the specified . /// /// The format of the pattern. - /// A tuple containing the format. If is not the second item is null. - public Tuple ToString(PatternFormat format) + /// A tuple containing the format. If is not the second item is null. + public Tuple ToString(PatternMaskFormat format) { switch (format) { - case PatternFormat.PatternAndMask: + case PatternMaskFormat.Separated: var sb1 = new StringBuilder(); var sb2 = new StringBuilder(); pattern - .Select(p => p.ToString(PatternFormat.PatternAndMask)) + .Select(p => p.ToString(PatternMaskFormat.Separated)) .ForEach(t => { sb1.Append(t.Item1); sb2.Append(t.Item2); }); return Tuple.Create(sb1.ToString(), sb2.ToString()); - case PatternFormat.Combined: - return Tuple.Create(string.Join(" ", pattern.Select(p => p.ToString(PatternFormat.Combined).Item1)), null); + case PatternMaskFormat.Combined: + return Tuple.Create(string.Join(" ", pattern.Select(p => p.ToString(PatternMaskFormat.Combined).Item1)), null); default: throw new ArgumentOutOfRangeException(nameof(format), format, null); } } - public override string ToString() => ToString(PatternFormat.Combined).Item1; + public override string ToString() => ToString(PatternMaskFormat.Combined).Item1; } } diff --git a/ReClass.NET_Tests/MemoryScanner/BytePatternTest.cs b/ReClass.NET_Tests/MemoryScanner/BytePatternTest.cs new file mode 100644 index 00000000..bf230f2b --- /dev/null +++ b/ReClass.NET_Tests/MemoryScanner/BytePatternTest.cs @@ -0,0 +1,125 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using NFluent; +using ReClassNET.MemoryScanner; +using Xunit; + +namespace ReClass.NET_Tests.MemoryScanner +{ + public class BytePatternTest + { + [Theory] + [InlineData("", 0, false)] + [InlineData("0", 1, true)] + [InlineData("a", 1, true)] + [InlineData("A", 1, true)] + [InlineData("00", 1, false)] + [InlineData("aa", 1, false)] + [InlineData("AA", 1, false)] + [InlineData("0000", 2, false)] + [InlineData("00aa", 2, false)] + [InlineData("00 aa", 2, false)] + [InlineData("00\taa", 2, false)] + [InlineData("?", 1, true)] + [InlineData("??", 1, true)] + [InlineData("????", 2, true)] + [InlineData("?? ??", 2, true)] + [InlineData("a?", 1, true)] + [InlineData("?a", 1, true)] + [InlineData("aa ?a", 2, true)] + [InlineData("aa ?? 00", 3, true)] + public void TestParse(string input, int expectedLength, bool expectedHasWildcards) + { + var sut = BytePattern.Parse(input); + + Check.That(sut.Length).IsEqualTo(expectedLength); + Check.That(sut.HasWildcards).IsEqualTo(expectedHasWildcards); + } + + [Fact] + public void TestParseThrows() + { + Check.ThatCode(() => BytePattern.Parse("aa bb zz")).Throws(); + } + + public static TheoryData, int> GetTestFromByteEnumerationData() => new TheoryData, int> + { + { new byte[0], 0 }, + { new byte[] { 0x00, 0x11, 0xaa }, 3 } + }; + + [Theory] + [MemberData(nameof(GetTestFromByteEnumerationData))] + public void TestFromByteEnumeration(IEnumerable input, int expectedLength) + { + var sut = BytePattern.From(input); + + Check.That(sut.Length).IsEqualTo(expectedLength); + Check.That(sut.HasWildcards).IsFalse(); + } + + public static TheoryData>, int, bool> GetTestFromByteEnumerationWithWildcardsData() => new TheoryData>, int, bool> + { + { new Tuple[0], 0, false }, + { new [] { Tuple.Create((byte)0, false) }, 1, false }, + { new [] { Tuple.Create((byte)0, true) }, 1, true }, + { new [] { Tuple.Create((byte)0xaa, false), Tuple.Create((byte)0, true) }, 2, true } + }; + + [Theory] + [MemberData(nameof(GetTestFromByteEnumerationWithWildcardsData))] + public void TestFromByteEnumerationWithWildcards(IEnumerable> input, int expectedLength, bool expectedHasWildcards) + { + var sut = BytePattern.From(input); + + Check.That(sut.Length).IsEqualTo(expectedLength); + Check.That(sut.HasWildcards).IsEqualTo(expectedHasWildcards); + } + + [Fact] + public void TestToArrayWithWildcardsThrows() + { + var sut = BytePattern.Parse("0?"); + + Check.ThatCode(() => sut.ToByteArray()).Throws(); + } + + [Theory] + [InlineData("")] + [InlineData("00AA", (byte)0x00, (byte)0xAA)] + [InlineData("00 aa bb 99", (byte)0x00, (byte)0xAA, (byte)0xBB, (byte)0x99)] + public void TestToArray(string input, params byte[] expected) + { + var sut = BytePattern.Parse(input); + + Check.That(sut.ToByteArray()).ContainsExactly(expected); + } + + public static TheoryData GetTestToStringData() => new TheoryData + { + { string.Empty, PatternMaskFormat.Separated, string.Empty, string.Empty }, + { string.Empty, PatternMaskFormat.Combined, string.Empty, null }, + { "aa bb 00", PatternMaskFormat.Separated, @"\xAA\xBB\x00", "xxx" }, + { "aa bb 00", PatternMaskFormat.Combined, "AA BB 00", null }, + { "aa ?? 00", PatternMaskFormat.Separated, @"\xAA\x00\x00", "x?x" }, + { "aa ?? 00", PatternMaskFormat.Combined, "AA ?? 00", null }, + { "a? ?? ?0", PatternMaskFormat.Separated, @"\x00\x00\x00", "???" }, + { "a? ?? ?0", PatternMaskFormat.Combined, "A? ?? ?0", null }, + }; + + [Theory] + [MemberData(nameof(GetTestToStringData))] + public void TestToString(string input, PatternMaskFormat format, string expectedPattern, string expectedMask) + { + var sut = BytePattern.Parse(input); + + var (pattern, mask) = sut.ToString(format); + + Check.That(pattern).IsEqualTo(expectedPattern); + Check.That(mask).IsEqualTo(expectedMask); + } + } +} diff --git a/ReClass.NET_Tests/ReClass.NET_Tests.csproj b/ReClass.NET_Tests/ReClass.NET_Tests.csproj index 415c5127..6189993d 100644 --- a/ReClass.NET_Tests/ReClass.NET_Tests.csproj +++ b/ReClass.NET_Tests/ReClass.NET_Tests.csproj @@ -78,6 +78,7 @@ + From c4851e48c7761352d273816c2e5f188500cb52a2 Mon Sep 17 00:00:00 2001 From: KN4CK3R Date: Sun, 5 May 2019 12:05:11 +0200 Subject: [PATCH 053/223] Made methods static. --- ReClass.NET/Forms/ProcessInfoForm.cs | 14 ++++++-------- ReClass.NET/Memory/Dumper.cs | 27 ++++++++++----------------- 2 files changed, 16 insertions(+), 25 deletions(-) diff --git a/ReClass.NET/Forms/ProcessInfoForm.cs b/ReClass.NET/Forms/ProcessInfoForm.cs index 4a126fe4..e3b7cd0f 100644 --- a/ReClass.NET/Forms/ProcessInfoForm.cs +++ b/ReClass.NET/Forms/ProcessInfoForm.cs @@ -142,7 +142,7 @@ private void createClassAtAddressToolStripMenuItem_Click(object sender, EventArg private void dumpToolStripMenuItem_Click(object sender, EventArgs e) { Func createDialogFn; - Action dumpFn; + Action dumpFn; if (GetToolStripSourceControl(sender) == modulesDataGridView) { @@ -158,9 +158,9 @@ private void dumpToolStripMenuItem_Click(object sender, EventArgs e) InitialDirectory = Path.GetDirectoryName(module.Path) }; - dumpFn = (d, s) => + dumpFn = (reader, stream) => { - d.DumpModule(module, s); + Dumper.DumpModule(reader, module, stream); MessageBox.Show("Module successfully dumped.", Constants.ApplicationName, MessageBoxButtons.OK, MessageBoxIcon.Information); }; @@ -178,9 +178,9 @@ private void dumpToolStripMenuItem_Click(object sender, EventArgs e) FileName = $"Section_{section.Start.ToString("X")}_{section.End.ToString("X")}.dat" }; - dumpFn = (d, s) => + dumpFn = (reader, stream) => { - d.DumpSection(section, s); + Dumper.DumpSection(reader, section, stream); MessageBox.Show("Section successfully dumped.", Constants.ApplicationName, MessageBoxButtons.OK, MessageBoxIcon.Information); }; @@ -195,13 +195,11 @@ private void dumpToolStripMenuItem_Click(object sender, EventArgs e) return; } - var dumper = new Dumper(process); - try { using (var stream = sfd.OpenFile()) { - dumpFn(dumper, stream); + dumpFn(process, stream); } } catch (Exception ex) diff --git a/ReClass.NET/Memory/Dumper.cs b/ReClass.NET/Memory/Dumper.cs index 12d76eb7..ba434ae0 100644 --- a/ReClass.NET/Memory/Dumper.cs +++ b/ReClass.NET/Memory/Dumper.cs @@ -4,52 +4,45 @@ namespace ReClassNET.Memory { - public class Dumper + public static class Dumper { - private readonly IRemoteMemoryReader process; - - public Dumper(IRemoteMemoryReader process) - { - Contract.Requires(process != null); - Contract.Ensures(this.process != null); - - this.process = process; - } - /// Dumps a chunk of memory to the given stream. + /// The memory reader to use. /// The begin of the chunk. /// The size of the chunk. /// The stream to dump to. - public void DumpRaw(IntPtr address, int size, Stream stream) + public static void DumpRaw(IRemoteMemoryReader reader, IntPtr address, int size, Stream stream) { Contract.Requires(size >= 0); Contract.Requires(stream != null); - var data = process.ReadRemoteMemory(address, size); + var data = reader.ReadRemoteMemory(address, size); stream.Write(data, 0, data.Length); } /// Dumps a section to the given stream. + /// The memory reader to use. /// The section to dump. /// The stream to dump to. - public void DumpSection(Section section, Stream stream) + public static void DumpSection(IRemoteMemoryReader reader, Section section, Stream stream) { Contract.Requires(section != null); Contract.Requires(stream != null); - DumpRaw(section.Start, section.Size.ToInt32(), stream); + DumpRaw(reader, section.Start, section.Size.ToInt32(), stream); } /// Dumps a module to the given stream. The section headers of the pe header get fixed to build a valid pe file. + /// The memory reader to use. /// The module to dump. /// The stream to dump to. - public void DumpModule(Module module, Stream stream) + public static void DumpModule(IRemoteMemoryReader reader, Module module, Stream stream) { Contract.Requires(module != null); Contract.Requires(stream != null); - var data = process.ReadRemoteMemory(module.Start, module.Size.ToInt32()); + var data = reader.ReadRemoteMemory(module.Start, module.Size.ToInt32()); SimplePeHeader.FixSectionHeaders(data); From 6caaded747ba7da0cfcd5f81d3d5cf23950e8b82 Mon Sep 17 00:00:00 2001 From: KN4CK3R Date: Sun, 5 May 2019 12:05:46 +0200 Subject: [PATCH 054/223] Use only the interface. --- ReClass.NET/Memory/Disassembler.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/ReClass.NET/Memory/Disassembler.cs b/ReClass.NET/Memory/Disassembler.cs index f62ea7ea..d83dfc97 100644 --- a/ReClass.NET/Memory/Disassembler.cs +++ b/ReClass.NET/Memory/Disassembler.cs @@ -27,7 +27,7 @@ public Disassembler(CoreFunctionsManager coreFunctions) /// The address of the code. /// The length of the code in bytes. /// A list of . - public IReadOnlyList RemoteDisassembleCode(RemoteProcess process, IntPtr address, int length) + public IReadOnlyList RemoteDisassembleCode(IRemoteMemoryReader process, IntPtr address, int length) { Contract.Requires(process != null); Contract.Ensures(Contract.Result>() != null); @@ -41,7 +41,7 @@ public IReadOnlyList RemoteDisassembleCode(RemoteProces /// The length of the code in bytes. /// The maximum number of instructions to disassemble. If is -1, all available instructions get returned. /// A list of . - public IReadOnlyList RemoteDisassembleCode(RemoteProcess process, IntPtr address, int length, int maxInstructions) + public IReadOnlyList RemoteDisassembleCode(IRemoteMemoryReader process, IntPtr address, int length, int maxInstructions) { Contract.Requires(process != null); Contract.Ensures(Contract.Result>() != null); @@ -89,7 +89,7 @@ public IReadOnlyList DisassembleCode(byte[] data, IntPt /// The address of the code. /// The maximum maxLength of the code. /// A list of which belong to the function. - public IReadOnlyList RemoteDisassembleFunction(RemoteProcess process, IntPtr address, int maxLength) + public IReadOnlyList RemoteDisassembleFunction(IRemoteMemoryReader process, IntPtr address, int maxLength) { Contract.Requires(process != null); Contract.Ensures(Contract.Result>() != null); @@ -141,7 +141,7 @@ public IReadOnlyList DisassembleFunction(byte[] data, I /// The process to read from. /// The address of the code. /// The prior instruction. - public DisassembledInstruction RemoteGetPreviousInstruction(RemoteProcess process, IntPtr address) + public DisassembledInstruction RemoteGetPreviousInstruction(IRemoteMemoryReader process, IntPtr address) { const int TotalBufferSize = 7 * MaximumInstructionLength; const int BufferShiftSize = 6 * MaximumInstructionLength; @@ -203,7 +203,7 @@ public DisassembledInstruction RemoteGetPreviousInstruction(RemoteProcess proces /// The process to read from. /// The address inside the function. /// The start address of the function (maybe) or if no start address could be found. - public IntPtr RemoteGetFunctionStartAddress(RemoteProcess process, IntPtr address) + public IntPtr RemoteGetFunctionStartAddress(IRemoteMemoryReader process, IntPtr address) { const int BufferLength = 512; From e5c9b913a353f2ce370748160c5e10e31cffd278 Mon Sep 17 00:00:00 2001 From: KN4CK3R Date: Sun, 5 May 2019 23:06:32 +0200 Subject: [PATCH 055/223] Fixed length calculation. --- ReClass.NET/Memory/MemoryBuffer.cs | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/ReClass.NET/Memory/MemoryBuffer.cs b/ReClass.NET/Memory/MemoryBuffer.cs index df4f0176..cfb0b67f 100644 --- a/ReClass.NET/Memory/MemoryBuffer.cs +++ b/ReClass.NET/Memory/MemoryBuffer.cs @@ -151,7 +151,7 @@ public T ReadObject(int offset) where T : struct offset = Offset + offset; if (offset + Marshal.SizeOf(typeof(T)) > data.Length) { - return default(T); + return default; } var handle = GCHandle.Alloc(data, GCHandleType.Pinned); @@ -173,7 +173,7 @@ public sbyte ReadInt8(int offset) offset = Offset + offset; if (offset + sizeof(sbyte) > data.Length) { - return default(sbyte); + return default; } return (sbyte)data[offset]; @@ -189,7 +189,7 @@ public byte ReadUInt8(int offset) offset = Offset + offset; if (offset + sizeof(byte) > data.Length) { - return default(byte); + return default; } return data[offset]; @@ -205,7 +205,7 @@ public short ReadInt16(int offset) offset = Offset + offset; if (offset + sizeof(short) > data.Length) { - return default(short); + return default; } return BitConverter.ToInt16(data, offset); @@ -221,7 +221,7 @@ public ushort ReadUInt16(int offset) offset = Offset + offset; if (offset + sizeof(ushort) > data.Length) { - return default(ushort); + return default; } return BitConverter.ToUInt16(data, offset); @@ -237,7 +237,7 @@ public int ReadInt32(int offset) offset = Offset + offset; if (offset + sizeof(int) > data.Length) { - return default(int); + return default; } return BitConverter.ToInt32(data, offset); @@ -253,7 +253,7 @@ public uint ReadUInt32(int offset) offset = Offset + offset; if (offset + sizeof(uint) > data.Length) { - return default(uint); + return default; } return BitConverter.ToUInt32(data, offset); @@ -269,7 +269,7 @@ public long ReadInt64(int offset) offset = Offset + offset; if (offset + sizeof(long) > data.Length) { - return default(long); + return default; } return BitConverter.ToInt64(data, offset); @@ -285,7 +285,7 @@ public ulong ReadUInt64(int offset) offset = Offset + offset; if (offset + sizeof(ulong) > data.Length) { - return default(ulong); + return default; } return BitConverter.ToUInt64(data, offset); @@ -301,7 +301,7 @@ public float ReadFloat(int offset) offset = Offset + offset; if (offset + sizeof(float) > data.Length) { - return default(float); + return default; } return BitConverter.ToSingle(data, offset); @@ -317,7 +317,7 @@ public double ReadDouble(int offset) offset = Offset + offset; if (offset + sizeof(double) > data.Length) { - return default(double); + return default; } return BitConverter.ToDouble(data, offset); @@ -373,7 +373,12 @@ public string ReadString(Encoding encoding, int offset, int length) if (Offset + offset + length > data.Length) { - length = data.Length - Offset - offset; + length = Math.Max(data.Length - Offset - offset, 0); + } + + if (length <= 0) + { + return string.Empty; } var sb = new StringBuilder(encoding.GetString(data, Offset + offset, length)); From fffb672a6388b0521e5c5091c491c7416586609b Mon Sep 17 00:00:00 2001 From: KN4CK3R Date: Sun, 5 May 2019 23:07:35 +0200 Subject: [PATCH 056/223] Added some tests. --- ReClass.NET_Tests/Memory/MemoryBufferTest.cs | 144 +++++++++++++++++++ ReClass.NET_Tests/ReClass.NET_Tests.csproj | 1 + 2 files changed, 145 insertions(+) create mode 100644 ReClass.NET_Tests/Memory/MemoryBufferTest.cs diff --git a/ReClass.NET_Tests/Memory/MemoryBufferTest.cs b/ReClass.NET_Tests/Memory/MemoryBufferTest.cs new file mode 100644 index 00000000..25dc9255 --- /dev/null +++ b/ReClass.NET_Tests/Memory/MemoryBufferTest.cs @@ -0,0 +1,144 @@ +using System; +using NFluent; +using ReClassNET.Memory; +using Xunit; + +namespace ReClass.NET_Tests.Memory +{ + public class MemoryBufferTest + { + private static MemoryBuffer CreateFromBytes(params byte[] data) + { + var buffer = new MemoryBuffer(data.Length); + Array.Copy(data, buffer.RawData, data.Length); + return buffer; + } + + public static TheoryData GetTestReadBytesData() => new TheoryData + { + { CreateFromBytes(), 0, 0, new byte[0] }, + { CreateFromBytes(), 0, 4, new byte[] { 0, 0, 0, 0 } }, + { CreateFromBytes(), 10, 4, new byte[] { 0, 0, 0, 0 } }, + { CreateFromBytes(1, 2, 3, 4), 0, 0, new byte[0] }, + { CreateFromBytes(1, 2, 3, 4), 0, 4, new byte[] { 1, 2, 3, 4 } }, + { CreateFromBytes(1, 2, 3, 4), 2, 4, new byte[] { 0, 0, 0, 0 } }, + { CreateFromBytes(1, 2, 3, 4), 10, 4, new byte[] { 0, 0, 0, 0 } }, + { CreateFromBytes(1, 2, 3, 4, 5, 6), 2, 4, new byte[] { 3, 4, 5, 6 } } + }; + + [Theory] + [MemberData(nameof(GetTestReadBytesData))] + public void TestReadBytesReturn(MemoryBuffer sut, int offset, int length, byte[] expected) + { + Check.That(sut.ReadBytes(offset, length)).ContainsExactly(expected); + } + + [Theory] + [MemberData(nameof(GetTestReadBytesData))] + public void TestReadBytesFill(MemoryBuffer sut, int offset, int length, byte[] expected) + { + var data = new byte[length]; + + sut.ReadBytes(offset, data); + + Check.That(data).ContainsExactly(expected); + } + + public static TheoryData GetTestReadUInt8Data() => new TheoryData + { + { CreateFromBytes(), 0, 0, 0 }, + { CreateFromBytes(), 4, 0, 0 }, + { CreateFromBytes(1, 2, 3, 4), 0, 1, 1 }, + { CreateFromBytes(1, 2, 3, 4), 2, 3, 3 }, + { CreateFromBytes(1, 2, 3, 0xFF), 3, -1, 255 } + }; + + [Theory] + [MemberData(nameof(GetTestReadUInt8Data))] + public void TestReadInt8(MemoryBuffer sut, int offset, sbyte expectedSigned, byte expectedUnsigned) + { + Check.That(sut.ReadInt8(offset)).IsEqualTo(expectedSigned); + Check.That(sut.ReadUInt8(offset)).IsEqualTo(expectedUnsigned); + } + + public static TheoryData GetTestReadUInt16Data() => new TheoryData + { + { CreateFromBytes(), 0, 0, 0 }, + { CreateFromBytes(), 4, 0, 0 }, + { CreateFromBytes(1, 2, 3, 4), 0, 0x0201, 0x0201 }, + { CreateFromBytes(1, 2, 3, 4), 2, 0x0403, 0x0403 }, + { CreateFromBytes(1, 2, 3, 0xBF, 0xFF), 3, unchecked((short)0xFFBF), 0xFFBF } + }; + + [Theory] + [MemberData(nameof(GetTestReadUInt16Data))] + public void TestReadInt16(MemoryBuffer sut, int offset, short expectedSigned, ushort expectedUnsigned) + { + Check.That(sut.ReadInt16(offset)).IsEqualTo(expectedSigned); + Check.That(sut.ReadUInt16(offset)).IsEqualTo(expectedUnsigned); + } + + public static TheoryData GetTestReadUInt32Data() => new TheoryData + { + { CreateFromBytes(), 0, 0, 0 }, + { CreateFromBytes(), 4, 0, 0 }, + { CreateFromBytes(1, 2, 3, 4), 0, 0x04030201, 0x04030201 }, + { CreateFromBytes(1, 2, 3, 4, 0xBF, 0xFF), 2, unchecked((int)0xFFBF0403), 0xFFBF0403 } + }; + + [Theory] + [MemberData(nameof(GetTestReadUInt32Data))] + public void TestReadInt32(MemoryBuffer sut, int offset, int expectedSigned, uint expectedUnsigned) + { + Check.That(sut.ReadInt32(offset)).IsEqualTo(expectedSigned); + Check.That(sut.ReadUInt32(offset)).IsEqualTo(expectedUnsigned); + } + + public static TheoryData GetTestReadUInt64Data() => new TheoryData + { + { CreateFromBytes(), 0, 0, 0 }, + { CreateFromBytes(), 4, 0, 0 }, + { CreateFromBytes(1, 2, 3, 4, 5, 6, 7, 8), 0, 0x0807060504030201, 0x0807060504030201 }, + { CreateFromBytes(1, 2, 3, 4, 5, 6, 0xBF, 0xFF, 0xBF, 0xFF), 2, unchecked((long)0xFFBFFFBF06050403), 0xFFBFFFBF06050403 } + }; + + [Theory] + [MemberData(nameof(GetTestReadUInt64Data))] + public void TestReadInt64(MemoryBuffer sut, int offset, long expectedSigned, ulong expectedUnsigned) + { + Check.That(sut.ReadInt64(offset)).IsEqualTo(expectedSigned); + Check.That(sut.ReadUInt64(offset)).IsEqualTo(expectedUnsigned); + } + + public static TheoryData GetTestReadFloatData() => new TheoryData + { + { CreateFromBytes(), 0, 0.0f }, + { CreateFromBytes(), 4, 0.0f }, + { CreateFromBytes(0, 0x40, 0x9A, 0x44), 0, 1234.0f }, + { CreateFromBytes(1, 2, 0, 8, 0x87, 0x45), 2, 4321.0f } + }; + + [Theory] + [MemberData(nameof(GetTestReadFloatData))] + public void TestReadFloat(MemoryBuffer sut, int offset, float expected) + { + Check.That(sut.ReadFloat(offset)).IsCloseTo(expected, 0.0001); + } + + public static TheoryData GetTestReadDoubleData() => new TheoryData + { + { CreateFromBytes(), 0, 0.0 }, + { CreateFromBytes(), 4, 0.0 }, + //409349ba786c2268 + { CreateFromBytes(0x54, 0x74, 0x24, 0x97, 0x1F, 0xE1, 0xB0, 0x40), 0, 4321.1234 }, + { CreateFromBytes(1, 2, 0x68, 0x22, 0x6C, 0x78, 0xBA, 0x49, 0x93, 0x40), 2, 1234.4321 } + }; + + [Theory] + [MemberData(nameof(GetTestReadDoubleData))] + public void TestReadDouble(MemoryBuffer sut, int offset, double expected) + { + Check.That(sut.ReadDouble(offset)).IsCloseTo(expected, 0.0001); + } + } +} diff --git a/ReClass.NET_Tests/ReClass.NET_Tests.csproj b/ReClass.NET_Tests/ReClass.NET_Tests.csproj index 6189993d..f2314d5b 100644 --- a/ReClass.NET_Tests/ReClass.NET_Tests.csproj +++ b/ReClass.NET_Tests/ReClass.NET_Tests.csproj @@ -79,6 +79,7 @@ + From bfcfd58d8f3719ca3b8aa6ddc82e2fd747fb5073 Mon Sep 17 00:00:00 2001 From: Robert Blody Date: Mon, 6 May 2019 16:58:05 -0400 Subject: [PATCH 057/223] Addressed Issue #107 Bitfield now starts by LSN 0. --- ReClass.NET/Nodes/BitFieldNode.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/ReClass.NET/Nodes/BitFieldNode.cs b/ReClass.NET/Nodes/BitFieldNode.cs index 174e811a..df797766 100644 --- a/ReClass.NET/Nodes/BitFieldNode.cs +++ b/ReClass.NET/Nodes/BitFieldNode.cs @@ -161,11 +161,14 @@ public override Size Draw(ViewInfo view, int x, int y) using (var brush = new SolidBrush(view.Settings.ValueColor)) { - view.Context.DrawString("1", view.Font.Font, brush, tx + (bits - 1) * view.Font.Width + 1, y, format); + view.Context.DrawString("0", view.Font.Font, brush, tx + (bits - 1) * view.Font.Width + 1, y, format); for (var i = 8; i <= bits; i += 8) { - view.Context.DrawString(i.ToString(), view.Font.Font, brush, tx + (bits - i) * view.Font.Width, y, format); + if(i < bits) + view.Context.DrawString(i.ToString(), view.Font.Font, brush, tx + (bits - i - 1) * view.Font.Width, y, format); + else + view.Context.DrawString((i-1).ToString(), view.Font.Font, brush, tx + (bits - i) * view.Font.Width, y, format); } } From f202cae93f47e9d58bce23a21ab119cc90eaae16 Mon Sep 17 00:00:00 2001 From: Robert Blody Date: Mon, 6 May 2019 17:45:12 -0400 Subject: [PATCH 058/223] Redesigned Bitfield display. Bitfield display now follows the Windows Calculator bitfield format. --- ReClass.NET/Nodes/BitFieldNode.cs | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/ReClass.NET/Nodes/BitFieldNode.cs b/ReClass.NET/Nodes/BitFieldNode.cs index df797766..686f5f16 100644 --- a/ReClass.NET/Nodes/BitFieldNode.cs +++ b/ReClass.NET/Nodes/BitFieldNode.cs @@ -163,12 +163,9 @@ public override Size Draw(ViewInfo view, int x, int y) { view.Context.DrawString("0", view.Font.Font, brush, tx + (bits - 1) * view.Font.Width + 1, y, format); - for (var i = 8; i <= bits; i += 8) + for (var i = 4; i < bits; i += 4) { - if(i < bits) - view.Context.DrawString(i.ToString(), view.Font.Font, brush, tx + (bits - i - 1) * view.Font.Width, y, format); - else - view.Context.DrawString((i-1).ToString(), view.Font.Font, brush, tx + (bits - i) * view.Font.Width, y, format); + view.Context.DrawString(i.ToString(), view.Font.Font, brush, tx + (bits - i - 1) * view.Font.Width, y, format); } } From 3a7404f5e037ae1b53a9fe00923ea8b8d860b106 Mon Sep 17 00:00:00 2001 From: KN4CK3R Date: Tue, 7 May 2019 11:12:38 +0200 Subject: [PATCH 059/223] Added proper equals check for encodings. --- ReClass.NET/CodeGenerator/CppCodeGenerator.cs | 4 ++-- .../DataExchange/Scanner/ReClassScanFile.cs | 3 ++- ReClass.NET/Extensions/EncodingExtensions.cs | 17 ++++++++++++--- ReClass.NET/MemoryScanner/ScanResultStore.cs | 2 +- ReClass.NET/ReClass.NET.csproj | 1 + .../Extensions/EncodingExtensionTest.cs | 21 +++++++++++++++++++ 6 files changed, 41 insertions(+), 7 deletions(-) diff --git a/ReClass.NET/CodeGenerator/CppCodeGenerator.cs b/ReClass.NET/CodeGenerator/CppCodeGenerator.cs index 80971e61..ead4bc0d 100644 --- a/ReClass.NET/CodeGenerator/CppCodeGenerator.cs +++ b/ReClass.NET/CodeGenerator/CppCodeGenerator.cs @@ -496,11 +496,11 @@ private static BaseNode TransformNode(BaseNode node) BaseNode GetCharacterNodeForEncoding(Encoding encoding) { - if (encoding.Equals(Encoding.Unicode)) + if (encoding.IsSameCodePage(Encoding.Unicode)) { return new Utf16CharacterNode(); } - if (encoding.Equals(Encoding.UTF32)) + if (encoding.IsSameCodePage(Encoding.UTF32)) { return new Utf32CharacterNode(); } diff --git a/ReClass.NET/DataExchange/Scanner/ReClassScanFile.cs b/ReClass.NET/DataExchange/Scanner/ReClassScanFile.cs index b86fa626..623c80fb 100644 --- a/ReClass.NET/DataExchange/Scanner/ReClassScanFile.cs +++ b/ReClass.NET/DataExchange/Scanner/ReClassScanFile.cs @@ -6,6 +6,7 @@ using System.Linq; using System.Text; using System.Xml.Linq; +using ReClassNET.Extensions; using ReClassNET.Logger; using ReClassNET.MemoryScanner; @@ -152,7 +153,7 @@ public void Save(IEnumerable records, string filePath, ILogger log temp.SetAttributeValue(XmlValueLengthAttribute, r.ValueLength); if (r.ValueType == ScanValueType.String) { - temp.SetAttributeValue(XmlEncodingAttribute, r.Encoding == Encoding.UTF8 ? "UTF8" : r.Encoding == Encoding.Unicode ? "UTF16" : "UTF32"); + temp.SetAttributeValue(XmlEncodingAttribute, r.Encoding.IsSameCodePage(Encoding.UTF8) ? "UTF8" : r.Encoding.IsSameCodePage(Encoding.Unicode) ? "UTF16" : "UTF32"); } } return temp; diff --git a/ReClass.NET/Extensions/EncodingExtensions.cs b/ReClass.NET/Extensions/EncodingExtensions.cs index 94ed21b2..9f522dfa 100644 --- a/ReClass.NET/Extensions/EncodingExtensions.cs +++ b/ReClass.NET/Extensions/EncodingExtensions.cs @@ -10,11 +10,22 @@ public static class EncodingExtension /// The byte count per character. public static int GuessByteCountPerChar(this Encoding encoding) { - if (encoding.Equals(Encoding.UTF8) || encoding.Equals(Encoding.ASCII)) return 1; - if (encoding.Equals(Encoding.Unicode) || encoding.Equals(Encoding.BigEndianUnicode)) return 2; - if (encoding.Equals(Encoding.UTF32)) return 4; + if (encoding.IsSameCodePage(Encoding.UTF8) || encoding.IsSameCodePage(Encoding.ASCII)) return 1; + if (encoding.IsSameCodePage(Encoding.Unicode) || encoding.IsSameCodePage(Encoding.BigEndianUnicode)) return 2; + if (encoding.IsSameCodePage(Encoding.UTF32)) return 4; throw new NotImplementedException(); } + + /// + /// Checks if the code page of both encodings is equal. + /// + /// + /// + /// + public static bool IsSameCodePage(this Encoding encoding, Encoding other) + { + return encoding.CodePage == other.CodePage; + } } } diff --git a/ReClass.NET/MemoryScanner/ScanResultStore.cs b/ReClass.NET/MemoryScanner/ScanResultStore.cs index 70a03d04..5ddb1a45 100644 --- a/ReClass.NET/MemoryScanner/ScanResultStore.cs +++ b/ReClass.NET/MemoryScanner/ScanResultStore.cs @@ -261,7 +261,7 @@ private static void WriteSearchResult(BinaryWriter bw, ScanResult result) bw.Write(arrayOfBytesSearchResult.Value); break; case StringScanResult stringSearchResult: - bw.Write(stringSearchResult.Encoding == Encoding.UTF8 ? 0 : stringSearchResult.Encoding == Encoding.Unicode ? 1 : 2); + bw.Write(stringSearchResult.Encoding.IsSameCodePage(Encoding.UTF8) ? 0 : stringSearchResult.Encoding.IsSameCodePage(Encoding.Unicode) ? 1 : 2); bw.Write(stringSearchResult.Value); break; } diff --git a/ReClass.NET/ReClass.NET.csproj b/ReClass.NET/ReClass.NET.csproj index d7a2ba42..d19a26a8 100644 --- a/ReClass.NET/ReClass.NET.csproj +++ b/ReClass.NET/ReClass.NET.csproj @@ -16,6 +16,7 @@ 0 + latest x86 diff --git a/ReClass.NET_Tests/Extensions/EncodingExtensionTest.cs b/ReClass.NET_Tests/Extensions/EncodingExtensionTest.cs index 12521302..f1c1a1a5 100644 --- a/ReClass.NET_Tests/Extensions/EncodingExtensionTest.cs +++ b/ReClass.NET_Tests/Extensions/EncodingExtensionTest.cs @@ -37,5 +37,26 @@ public void TestSimpleByteCountNotImplemented(Encoding encoding) { Check.ThatCode(encoding.GuessByteCountPerChar).Throws(); } + + public static TheoryData GetTestIsSameCodePageData() => new TheoryData + { + { Encoding.ASCII, Encoding.ASCII, true }, + { Encoding.UTF8, Encoding.UTF8, true }, + { Encoding.Unicode, Encoding.Unicode, true }, + { Encoding.UTF32, Encoding.UTF32, true }, + { Encoding.ASCII, Encoding.UTF8, false }, + { Encoding.ASCII, Encoding.Unicode, false }, + { Encoding.ASCII, Encoding.UTF32, false }, + { Encoding.UTF8, Encoding.UTF32, false }, + { Encoding.Unicode, Encoding.UTF32, false }, + { Encoding.UTF8, Encoding.Unicode, false } + }; + + [Theory] + [MemberData(nameof(GetTestIsSameCodePageData))] + public void TestIsSameCodePage(Encoding sut, Encoding other, bool expected) + { + Check.That(sut.IsSameCodePage(other)).IsEqualTo(expected); + } } } From d7af6033d67a42a55afdfb1938f0c92dcda4c013 Mon Sep 17 00:00:00 2001 From: KN4CK3R Date: Tue, 7 May 2019 11:49:58 +0200 Subject: [PATCH 060/223] Replaced ReadPrintableAsciiString with ReadString and the correct encoding. --- ReClass.NET/Extensions/EncodingExtensions.cs | 2 +- ReClass.NET/Memory/MemoryBuffer.cs | 25 -------------------- ReClass.NET/Nodes/Hex16Node.cs | 2 +- ReClass.NET/Nodes/Hex32Node.cs | 2 +- ReClass.NET/Nodes/Hex64Node.cs | 2 +- ReClass.NET/Nodes/Hex8Node.cs | 2 +- ReClass.NET/Settings.cs | 3 +++ 7 files changed, 8 insertions(+), 30 deletions(-) diff --git a/ReClass.NET/Extensions/EncodingExtensions.cs b/ReClass.NET/Extensions/EncodingExtensions.cs index 9f522dfa..4f9f3bba 100644 --- a/ReClass.NET/Extensions/EncodingExtensions.cs +++ b/ReClass.NET/Extensions/EncodingExtensions.cs @@ -10,7 +10,7 @@ public static class EncodingExtension /// The byte count per character. public static int GuessByteCountPerChar(this Encoding encoding) { - if (encoding.IsSameCodePage(Encoding.UTF8) || encoding.IsSameCodePage(Encoding.ASCII)) return 1; + if (encoding.IsSameCodePage(Encoding.UTF8) || encoding.CodePage == 1252 /* Windows-1252 */ || encoding.IsSameCodePage(Encoding.ASCII)) return 1; if (encoding.IsSameCodePage(Encoding.Unicode) || encoding.IsSameCodePage(Encoding.BigEndianUnicode)) return 2; if (encoding.IsSameCodePage(Encoding.UTF32)) return 4; diff --git a/ReClass.NET/Memory/MemoryBuffer.cs b/ReClass.NET/Memory/MemoryBuffer.cs index cfb0b67f..6da1ce7d 100644 --- a/ReClass.NET/Memory/MemoryBuffer.cs +++ b/ReClass.NET/Memory/MemoryBuffer.cs @@ -339,31 +339,6 @@ public IntPtr ReadIntPtr(int offset) #endregion - public string ReadPrintableAsciiString(int offset, int length) - { - Contract.Requires(offset >= 0); - Contract.Requires(length >= 0); - Contract.Ensures(Contract.Result() != null); - - if (Offset + offset + length > data.Length) - { - length = Math.Max(data.Length - Offset - offset, 0); - } - - if (length <= 0) - { - return string.Empty; - } - - var sb = new StringBuilder(length); - for (var i = 0; i < length; ++i) - { - var c = (char)data[Offset + offset + i]; - sb.Append(c.IsPrintable() ? c : '.'); - } - return sb.ToString(); - } - public string ReadString(Encoding encoding, int offset, int length) { Contract.Requires(encoding != null); diff --git a/ReClass.NET/Nodes/Hex16Node.cs b/ReClass.NET/Nodes/Hex16Node.cs index b63fbddc..bd72c878 100644 --- a/ReClass.NET/Nodes/Hex16Node.cs +++ b/ReClass.NET/Nodes/Hex16Node.cs @@ -23,7 +23,7 @@ public override string GetToolTipText(HotSpot spot, MemoryBuffer memory) public override Size Draw(ViewInfo view, int x, int y) { - return Draw(view, x, y, view.Settings.ShowNodeText ? view.Memory.ReadPrintableAsciiString(Offset, 2) + " " : null, 2); + return Draw(view, x, y, view.Settings.ShowNodeText ? view.Memory.ReadString(view.Settings.RawDataEncoding, Offset, 2) + " " : null, 2); } public override void Update(HotSpot spot) diff --git a/ReClass.NET/Nodes/Hex32Node.cs b/ReClass.NET/Nodes/Hex32Node.cs index 0ccfb4d3..50591423 100644 --- a/ReClass.NET/Nodes/Hex32Node.cs +++ b/ReClass.NET/Nodes/Hex32Node.cs @@ -33,7 +33,7 @@ public override string GetToolTipText(HotSpot spot, MemoryBuffer memory) public override Size Draw(ViewInfo view, int x, int y) { - return Draw(view, x, y, view.Settings.ShowNodeText ? view.Memory.ReadPrintableAsciiString(Offset, 4) + " " : null, 4); + return Draw(view, x, y, view.Settings.ShowNodeText ? view.Memory.ReadString(view.Settings.RawDataEncoding, Offset, 4) + " " : null, 4); } public override void Update(HotSpot spot) diff --git a/ReClass.NET/Nodes/Hex64Node.cs b/ReClass.NET/Nodes/Hex64Node.cs index 82a54782..ef9c909b 100644 --- a/ReClass.NET/Nodes/Hex64Node.cs +++ b/ReClass.NET/Nodes/Hex64Node.cs @@ -33,7 +33,7 @@ public override string GetToolTipText(HotSpot spot, MemoryBuffer memory) public override Size Draw(ViewInfo view, int x, int y) { - return Draw(view, x, y, view.Settings.ShowNodeText ? view.Memory.ReadPrintableAsciiString(Offset, 8) + " " : null, 8); + return Draw(view, x, y, view.Settings.ShowNodeText ? view.Memory.ReadString(view.Settings.RawDataEncoding, Offset, 8) + " " : null, 8); } public override void Update(HotSpot spot) diff --git a/ReClass.NET/Nodes/Hex8Node.cs b/ReClass.NET/Nodes/Hex8Node.cs index 9319f65d..fdb435e5 100644 --- a/ReClass.NET/Nodes/Hex8Node.cs +++ b/ReClass.NET/Nodes/Hex8Node.cs @@ -23,7 +23,7 @@ public override string GetToolTipText(HotSpot spot, MemoryBuffer memory) public override Size Draw(ViewInfo view, int x, int y) { - return Draw(view, x, y, view.Settings.ShowNodeText ? view.Memory.ReadPrintableAsciiString(Offset, 1) + " " : null, 1); + return Draw(view, x, y, view.Settings.ShowNodeText ? view.Memory.ReadString(view.Settings.RawDataEncoding, Offset, 1) + " " : null, 1); } public override void Update(HotSpot spot) diff --git a/ReClass.NET/Settings.cs b/ReClass.NET/Settings.cs index 16421515..49372adf 100644 --- a/ReClass.NET/Settings.cs +++ b/ReClass.NET/Settings.cs @@ -1,4 +1,5 @@ using System.Drawing; +using System.Text; using ReClassNET.Util; namespace ReClassNET @@ -21,6 +22,8 @@ public class Settings public bool HighlightChangedValues { get; set; } = true; + public Encoding RawDataEncoding { get; set; } = Encoding.GetEncoding(1252); /* Windows-1252 */ + // Comment Drawing Settings public bool ShowCommentFloat { get; set; } = true; From b1a45f9f143c54d1c06f91423c6070f3186eb25d Mon Sep 17 00:00:00 2001 From: KN4CK3R Date: Thu, 9 May 2019 10:44:34 +0200 Subject: [PATCH 061/223] Split bitfield display in groups. --- ReClass.NET/Nodes/BitFieldNode.cs | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/ReClass.NET/Nodes/BitFieldNode.cs b/ReClass.NET/Nodes/BitFieldNode.cs index 686f5f16..14e25d43 100644 --- a/ReClass.NET/Nodes/BitFieldNode.cs +++ b/ReClass.NET/Nodes/BitFieldNode.cs @@ -1,6 +1,7 @@ using System; using System.Diagnostics.Contracts; using System.Drawing; +using System.Text; using ReClassNET.Memory; using ReClassNET.UI; @@ -88,7 +89,7 @@ public BaseNumericNode GetUnderlayingNode() /// Converts the memory value to a bit string. /// The process memory. /// The value converted to a bit string. - private string ConvertValueToBitString(MemoryBuffer memory) + private string ConvertValueToGroupedBitString(MemoryBuffer memory) { Contract.Requires(memory != null); Contract.Ensures(Contract.Result() != null); @@ -109,7 +110,17 @@ private string ConvertValueToBitString(MemoryBuffer memory) str = Convert.ToString(memory.ReadUInt8(Offset), 2); break; } - return str.PadLeft(bits, '0'); + + str = str.PadLeft(bits, '0'); + + var sb = new StringBuilder(str); + + for (var i = bits - 4; i > 0; i -= 4) + { + sb.Insert(i, ' '); + } + + return sb.ToString(); } public override Size Draw(ViewInfo view, int x, int y) @@ -143,7 +154,10 @@ public override Size Draw(ViewInfo view, int x, int y) var rect = new Rectangle(x + i * view.Font.Width, y, view.Font.Width, view.Font.Height); AddHotSpot(view, rect, string.Empty, i, HotSpotType.Edit); } - x = AddText(view, x, y, view.Settings.ValueColor, HotSpot.NoneId, ConvertValueToBitString(view.Memory)) + view.Font.Width; + + var value = ConvertValueToGroupedBitString(view.Memory); + + x = AddText(view, x, y, view.Settings.ValueColor, HotSpot.NoneId, value) + view.Font.Width; x += view.Font.Width; @@ -161,11 +175,11 @@ public override Size Draw(ViewInfo view, int x, int y) using (var brush = new SolidBrush(view.Settings.ValueColor)) { - view.Context.DrawString("0", view.Font.Font, brush, tx + (bits - 1) * view.Font.Width + 1, y, format); + var maxCharCount = bits + (bits / 4 - 1) - 1; - for (var i = 4; i < bits; i += 4) + for (int bitCount = 0, padding = 0; bitCount < bits; bitCount += 4, padding += 5) { - view.Context.DrawString(i.ToString(), view.Font.Font, brush, tx + (bits - i - 1) * view.Font.Width, y, format); + view.Context.DrawString(bitCount.ToString(), view.Font.Font, brush, tx + (maxCharCount - padding) * view.Font.Width, y, format); } } From 1608c07761ca2d9f4956cc4fbcb95675bd5a492e Mon Sep 17 00:00:00 2001 From: KN4CK3R Date: Thu, 9 May 2019 14:47:11 +0200 Subject: [PATCH 062/223] Use more efficient number to bit string conversion. --- ReClass.NET/Nodes/BitFieldNode.cs | 26 ++---- ReClass.NET/ReClass.NET.csproj | 1 + ReClass.NET/Util/BitString.cs | 96 ++++++++++++++++++++++ ReClass.NET_Tests/ReClass.NET_Tests.csproj | 1 + ReClass.NET_Tests/Util/BitStringTest.cs | 74 +++++++++++++++++ 5 files changed, 177 insertions(+), 21 deletions(-) create mode 100644 ReClass.NET/Util/BitString.cs create mode 100644 ReClass.NET_Tests/Util/BitStringTest.cs diff --git a/ReClass.NET/Nodes/BitFieldNode.cs b/ReClass.NET/Nodes/BitFieldNode.cs index 14e25d43..cd97c68c 100644 --- a/ReClass.NET/Nodes/BitFieldNode.cs +++ b/ReClass.NET/Nodes/BitFieldNode.cs @@ -1,9 +1,9 @@ using System; using System.Diagnostics.Contracts; using System.Drawing; -using System.Text; using ReClassNET.Memory; using ReClassNET.UI; +using ReClassNET.Util; namespace ReClassNET.Nodes { @@ -94,33 +94,17 @@ private string ConvertValueToGroupedBitString(MemoryBuffer memory) Contract.Requires(memory != null); Contract.Ensures(Contract.Result() != null); - string str; switch(bits) { case 64: - str = Convert.ToString(memory.ReadInt64(Offset), 2); - break; + return BitString.ToString(memory.ReadInt64(Offset)); case 32: - str = Convert.ToString(memory.ReadInt32(Offset), 2); - break; + return BitString.ToString(memory.ReadInt32(Offset)); case 16: - str = Convert.ToString(memory.ReadInt16(Offset), 2); - break; + return BitString.ToString(memory.ReadInt16(Offset)); default: - str = Convert.ToString(memory.ReadUInt8(Offset), 2); - break; + return BitString.ToString(memory.ReadUInt8(Offset)); } - - str = str.PadLeft(bits, '0'); - - var sb = new StringBuilder(str); - - for (var i = bits - 4; i > 0; i -= 4) - { - sb.Insert(i, ' '); - } - - return sb.ToString(); } public override Size Draw(ViewInfo view, int x, int y) diff --git a/ReClass.NET/ReClass.NET.csproj b/ReClass.NET/ReClass.NET.csproj index d19a26a8..ceaf1ffd 100644 --- a/ReClass.NET/ReClass.NET.csproj +++ b/ReClass.NET/ReClass.NET.csproj @@ -383,6 +383,7 @@ Component + diff --git a/ReClass.NET/Util/BitString.cs b/ReClass.NET/Util/BitString.cs new file mode 100644 index 00000000..3343ed43 --- /dev/null +++ b/ReClass.NET/Util/BitString.cs @@ -0,0 +1,96 @@ +using System; +using System.Text; + +namespace ReClassNET.Util +{ + public static class BitString + { + /// + /// Converts the value to the corresponding bit string. + /// Format: 0000 0000 + /// + /// The value to convert. + /// The corresponding bit string. + public static string ToString(byte value) + { + return AddPaddingAndBuildBlocks(8, Convert.ToString(value, 2)); + } + + /// + /// Converts the value to the corresponding bit string. + /// Format: 0000 0000 0000 0000 + /// + /// The value to convert. + /// The corresponding bit string. + public static string ToString(short value) + { + return AddPaddingAndBuildBlocks(16, Convert.ToString(value, 2)); + } + + /// + /// Converts the value to the corresponding bit string. + /// Format: 0000 0000 0000 0000 0000 0000 0000 0000 + /// + /// The value to convert. + /// The corresponding bit string. + public static string ToString(int value) + { + return AddPaddingAndBuildBlocks(32, Convert.ToString(value, 2)); + } + + /// + /// Converts the value to the corresponding bit string. + /// Format: 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 + /// + /// The value to convert. + /// The corresponding bit string. + public static string ToString(long value) + { + return AddPaddingAndBuildBlocks(64, Convert.ToString(value, 2)); + } + + private static string AddPaddingAndBuildBlocks(int bits, string value) + { + var sb = new StringBuilder(bits); + + var padding = bits - value.Length; + + // Add full padding blocks. + while (padding > 4) + { + sb.Append("0000 "); + padding -= 4; + } + + // Add only a part of a block. + if (padding > 0) + { + // {padding} 0 bits + for (var i = 0; i < padding; ++i) + { + sb.Append('0'); + } + + // and {4 - padding} bits of the value. + sb.Append(value, 0, 4 - padding); + + if (value.Length > padding) + { + sb.Append(' '); + } + } + + // Add all remaining blocks. + for (var i = padding == 0 ? 0 : 4 - padding; i < value.Length; i += 4) + { + sb.Append(value, i, 4); + if (i < value.Length - 4) + { + sb.Append(' '); + } + } + + return sb.ToString(); + } + } +} diff --git a/ReClass.NET_Tests/ReClass.NET_Tests.csproj b/ReClass.NET_Tests/ReClass.NET_Tests.csproj index f2314d5b..d1b1c359 100644 --- a/ReClass.NET_Tests/ReClass.NET_Tests.csproj +++ b/ReClass.NET_Tests/ReClass.NET_Tests.csproj @@ -81,6 +81,7 @@ + diff --git a/ReClass.NET_Tests/Util/BitStringTest.cs b/ReClass.NET_Tests/Util/BitStringTest.cs new file mode 100644 index 00000000..e078106e --- /dev/null +++ b/ReClass.NET_Tests/Util/BitStringTest.cs @@ -0,0 +1,74 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using NFluent; +using ReClassNET.Util; +using Xunit; + +namespace ReClass.NET_Tests.Util +{ + public class BitStringTest + { + [Theory] + [InlineData(0, "0000 0000")] + [InlineData(1, "0000 0001")] + [InlineData(127, "0111 1111")] + [InlineData(128, "1000 0000")] + [InlineData(255, "1111 1111")] + [InlineData(0b1010_1010, "1010 1010")] + public void TestToStringByte(byte value, string expected) + { + Check.That(BitString.ToString(value)).IsEqualTo(expected); + } + + [Theory] + [InlineData(0, "0000 0000 0000 0000")] + [InlineData(1, "0000 0000 0000 0001")] + [InlineData(127, "0000 0000 0111 1111")] + [InlineData(128, "0000 0000 1000 0000")] + [InlineData(255, "0000 0000 1111 1111")] + [InlineData(short.MaxValue, "0111 1111 1111 1111")] + [InlineData(short.MinValue, "1000 0000 0000 0000")] + [InlineData(unchecked((short)0b1010_1010_1010_1010), "1010 1010 1010 1010")] + public void TestToStringShort(short value, string expected) + { + Check.That(BitString.ToString(value)).IsEqualTo(expected); + } + + [Theory] + [InlineData(0, "0000 0000 0000 0000 0000 0000 0000 0000")] + [InlineData(1, "0000 0000 0000 0000 0000 0000 0000 0001")] + [InlineData(127, "0000 0000 0000 0000 0000 0000 0111 1111")] + [InlineData(128, "0000 0000 0000 0000 0000 0000 1000 0000")] + [InlineData(255, "0000 0000 0000 0000 0000 0000 1111 1111")] + [InlineData(short.MaxValue, "0000 0000 0000 0000 0111 1111 1111 1111")] + [InlineData(short.MinValue, "1111 1111 1111 1111 1000 0000 0000 0000")] + [InlineData(int.MaxValue, "0111 1111 1111 1111 1111 1111 1111 1111")] + [InlineData(int.MinValue, "1000 0000 0000 0000 0000 0000 0000 0000")] + [InlineData(unchecked((int)0b1010_1010_1010_1010_1010_1010_1010_1010), "1010 1010 1010 1010 1010 1010 1010 1010")] + public void TestToStringInt(int value, string expected) + { + Check.That(BitString.ToString(value)).IsEqualTo(expected); + } + + [Theory] + [InlineData(0, "0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000")] + [InlineData(1, "0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0001")] + [InlineData(127, "0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0111 1111")] + [InlineData(128, "0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 1000 0000")] + [InlineData(255, "0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 1111 1111")] + [InlineData(short.MaxValue, "0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0111 1111 1111 1111")] + [InlineData(short.MinValue, "1111 1111 1111 1111 1111 1111 1111 1111 1111 1111 1111 1111 1000 0000 0000 0000")] + [InlineData(int.MaxValue, "0000 0000 0000 0000 0000 0000 0000 0000 0111 1111 1111 1111 1111 1111 1111 1111")] + [InlineData(int.MinValue, "1111 1111 1111 1111 1111 1111 1111 1111 1000 0000 0000 0000 0000 0000 0000 0000")] + [InlineData(long.MaxValue, "0111 1111 1111 1111 1111 1111 1111 1111 1111 1111 1111 1111 1111 1111 1111 1111")] + [InlineData(long.MinValue, "1000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000")] + [InlineData(unchecked((long)0b1010_1010_1010_1010_1010_1010_1010_1010_1010_1010_1010_1010_1010_1010_1010_1010), "1010 1010 1010 1010 1010 1010 1010 1010 1010 1010 1010 1010 1010 1010 1010 1010")] + public void TestToStringLong(long value, string expected) + { + Check.That(BitString.ToString(value)).IsEqualTo(expected); + } + } +} From 8f5b4cbe531538440e041ce469d0b920e8136341 Mon Sep 17 00:00:00 2001 From: KN4CK3R Date: Thu, 9 May 2019 15:29:34 +0200 Subject: [PATCH 063/223] =?UTF-8?q?Check=20if=20character=20is=20=EF=BF=BD?= =?UTF-8?q?.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ReClass.NET/Extensions/StringExtensions.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ReClass.NET/Extensions/StringExtensions.cs b/ReClass.NET/Extensions/StringExtensions.cs index 83114a8c..89c5caf6 100644 --- a/ReClass.NET/Extensions/StringExtensions.cs +++ b/ReClass.NET/Extensions/StringExtensions.cs @@ -13,7 +13,7 @@ public static class StringExtension [DebuggerStepThrough] public static bool IsPrintable(this char c) { - return !char.IsControl(c) || char.IsWhiteSpace(c); + return (!char.IsControl(c) || char.IsWhiteSpace(c)) && c != '\xFFFD' /* Unicode REPLACEMENT CHARACTER � */; } [DebuggerStepThrough] From 04662b4b93de8100f2b2533586e01b3e0e814f75 Mon Sep 17 00:00:00 2001 From: KN4CK3R Date: Thu, 9 May 2019 15:58:10 +0200 Subject: [PATCH 064/223] Added encoding 1252. --- ReClass.NET_Tests/Extensions/EncodingExtensionTest.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ReClass.NET_Tests/Extensions/EncodingExtensionTest.cs b/ReClass.NET_Tests/Extensions/EncodingExtensionTest.cs index f1c1a1a5..fa563b9c 100644 --- a/ReClass.NET_Tests/Extensions/EncodingExtensionTest.cs +++ b/ReClass.NET_Tests/Extensions/EncodingExtensionTest.cs @@ -13,6 +13,7 @@ public class EncodingExtensionTest public static TheoryData GetTestSimpleByteCountData() => new TheoryData { { Encoding.ASCII, 1 }, + { Encoding.GetEncoding(1252), 1 }, { Encoding.UTF8, 1 }, { Encoding.Unicode, 2 }, { Encoding.BigEndianUnicode, 2 }, @@ -28,7 +29,7 @@ public void TestSimpleByteCount(Encoding encoding, int expectedByteCount) public static IEnumerable GetTestSimpleByteCountNotImplementedData() => Encoding.GetEncodings() .Select(e => e.GetEncoding()) - .WhereNot(e => e.Equals(Encoding.ASCII) || e.Equals(Encoding.UTF8) || e.Equals(Encoding.Unicode) || e.Equals(Encoding.BigEndianUnicode) || e.Equals(Encoding.UTF32)) + .WhereNot(e => e.IsSameCodePage(Encoding.ASCII) || e.IsSameCodePage(Encoding.UTF8) || e.IsSameCodePage(Encoding.Unicode) || e.IsSameCodePage(Encoding.BigEndianUnicode) || e.IsSameCodePage(Encoding.UTF32) || e.CodePage == 1252) .Select(e => new object[] { e }); [Theory] From 25a7559d86c650e34c79bb770569b4d393a104a7 Mon Sep 17 00:00:00 2001 From: KN4CK3R Date: Thu, 9 May 2019 15:58:34 +0200 Subject: [PATCH 065/223] Added ReadString test. --- ReClass.NET_Tests/Memory/MemoryBufferTest.cs | 26 +++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/ReClass.NET_Tests/Memory/MemoryBufferTest.cs b/ReClass.NET_Tests/Memory/MemoryBufferTest.cs index 25dc9255..7e545f56 100644 --- a/ReClass.NET_Tests/Memory/MemoryBufferTest.cs +++ b/ReClass.NET_Tests/Memory/MemoryBufferTest.cs @@ -1,4 +1,5 @@ using System; +using System.Text; using NFluent; using ReClassNET.Memory; using Xunit; @@ -129,7 +130,6 @@ public void TestReadFloat(MemoryBuffer sut, int offset, float expected) { { CreateFromBytes(), 0, 0.0 }, { CreateFromBytes(), 4, 0.0 }, - //409349ba786c2268 { CreateFromBytes(0x54, 0x74, 0x24, 0x97, 0x1F, 0xE1, 0xB0, 0x40), 0, 4321.1234 }, { CreateFromBytes(1, 2, 0x68, 0x22, 0x6C, 0x78, 0xBA, 0x49, 0x93, 0x40), 2, 1234.4321 } }; @@ -140,5 +140,29 @@ public void TestReadDouble(MemoryBuffer sut, int offset, double expected) { Check.That(sut.ReadDouble(offset)).IsCloseTo(expected, 0.0001); } + + public static TheoryData GetTestReadStringData() => new TheoryData + { + { CreateFromBytes(), Encoding.ASCII, 0, 0, string.Empty }, + { CreateFromBytes(), Encoding.ASCII, 4, 0, string.Empty }, + { CreateFromBytes(), Encoding.ASCII, 0, 4, string.Empty }, + { CreateFromBytes(0x31, 0x32, 0x33, 0x61, 0x62, 0x63), Encoding.ASCII, 0, 6, "123abc" }, + { CreateFromBytes(0x31, 0x32, 0x33, 0x61, 0x62, 0x63), Encoding.ASCII, 2, 3, "3ab" }, + { CreateFromBytes(0, 0, 0, 0, 0, 0), Encoding.GetEncoding(1252), 0, 6, "......" }, + { CreateFromBytes(0, 0, 0, 0, 0, 0), Encoding.UTF8, 0, 6, "......" }, + { CreateFromBytes(0, 1, 2, 3, 4, 5), Encoding.UTF8, 0, 6, "......" }, + { CreateFromBytes(0x31, 0x32, 0x33, 0x61, 0x62, 0x63, 0xC4, 0xD6, 0xDC), Encoding.GetEncoding(1252), 0, 9, "123abcÄÖÜ" }, + { CreateFromBytes(0x31, 0x32, 0x33, 0x61, 0x62, 0x63, 0xC3, 0x84, 0xC3, 0x96, 0xC3, 0x9C), Encoding.UTF8, 0, 12, "123abcÄÖÜ" }, + { CreateFromBytes(0x61, 0xC3), Encoding.UTF8, 0, 2, "a." }, + { CreateFromBytes(0x31, 0x00, 0x32, 0x00, 0x33, 0x00, 0x61, 0x00, 0x62, 0x00, 0x63, 0x00, 0xC4, 0x00, 0xD6, 0x00, 0xDC, 0x00), Encoding.Unicode, 0, 18, "123abcÄÖÜ" }, + { CreateFromBytes(0x31, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x00, 0x33, 0x00, 0x00, 0x00, 0x61, 0x00, 0x00, 0x00, 0x62, 0x00, 0x00, 0x00, 0x63, 0x00, 0x00, 0x00, 0xC4, 0x00, 0x00, 0x00, 0xD6, 0x00, 0x00, 0x00, 0xDC, 0x00, 0x00, 0x00), Encoding.UTF32, 0, 36, "123abcÄÖÜ" } + }; + + [Theory] + [MemberData(nameof(GetTestReadStringData))] + public void TestReadString(MemoryBuffer sut, Encoding encoding, int offset, int length, string expected) + { + Check.That(sut.ReadString(encoding, offset, length)).IsEqualTo(expected); + } } } From 0aa2848828df31095966adaeb04d819776d1d116 Mon Sep 17 00:00:00 2001 From: KN4CK3R Date: Thu, 9 May 2019 17:10:26 +0200 Subject: [PATCH 066/223] Changed method name. --- ReClass.NET/Nodes/BitFieldNode.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ReClass.NET/Nodes/BitFieldNode.cs b/ReClass.NET/Nodes/BitFieldNode.cs index cd97c68c..ac7bc770 100644 --- a/ReClass.NET/Nodes/BitFieldNode.cs +++ b/ReClass.NET/Nodes/BitFieldNode.cs @@ -89,7 +89,7 @@ public BaseNumericNode GetUnderlayingNode() /// Converts the memory value to a bit string. /// The process memory. /// The value converted to a bit string. - private string ConvertValueToGroupedBitString(MemoryBuffer memory) + private string ConvertValueToBitString(MemoryBuffer memory) { Contract.Requires(memory != null); Contract.Ensures(Contract.Result() != null); @@ -139,7 +139,7 @@ public override Size Draw(ViewInfo view, int x, int y) AddHotSpot(view, rect, string.Empty, i, HotSpotType.Edit); } - var value = ConvertValueToGroupedBitString(view.Memory); + var value = ConvertValueToBitString(view.Memory); x = AddText(view, x, y, view.Settings.ValueColor, HotSpot.NoneId, value) + view.Font.Width; From 569a5906ad0f8354ba58b385e2edddbf325ab700 Mon Sep 17 00:00:00 2001 From: KN4CK3R Date: Fri, 10 May 2019 10:54:05 +0200 Subject: [PATCH 067/223] Simplified code. --- ReClass.NET/Native/NativeMethods.Windows.cs | 71 +++------------------ 1 file changed, 9 insertions(+), 62 deletions(-) diff --git a/ReClass.NET/Native/NativeMethods.Windows.cs b/ReClass.NET/Native/NativeMethods.Windows.cs index d74bf135..36e25d13 100644 --- a/ReClass.NET/Native/NativeMethods.Windows.cs +++ b/ReClass.NET/Native/NativeMethods.Windows.cs @@ -177,85 +177,32 @@ public bool RegisterExtension(string fileExtension, string extensionId, string a { var classesRoot = Registry.ClassesRoot; - try - { - classesRoot.CreateSubKey(fileExtension); - } - catch (Exception) - { - - } - using (var fileExtensionKey = classesRoot.OpenSubKey(fileExtension, true)) + using (var fileExtensionKey = classesRoot.CreateSubKey(fileExtension)) { fileExtensionKey?.SetValue(string.Empty, extensionId, RegistryValueKind.String); } - try - { - classesRoot.CreateSubKey(extensionId); - } - catch (Exception) - { - - } - using (var extensionInfoKey = classesRoot.OpenSubKey(extensionId, true)) + using (var extensionInfoKey = classesRoot.CreateSubKey(extensionId)) { extensionInfoKey?.SetValue(string.Empty, applicationName, RegistryValueKind.String); - try - { - extensionInfoKey?.CreateSubKey("DefaultIcon"); - } - catch (Exception) - { - - } - - using (var icon = extensionInfoKey?.OpenSubKey("DefaultIcon", true)) + using (var icon = extensionInfoKey?.CreateSubKey("DefaultIcon")) { if (applicationPath.IndexOfAny(new[] { ' ', '\t' }) < 0) { - icon?.SetValue(string.Empty, applicationPath + ",0", RegistryValueKind.String); - } - else - { - icon?.SetValue(string.Empty, "\"" + applicationPath + "\",0", RegistryValueKind.String); + applicationPath = "\"" + applicationPath + "\""; } - } - try - { - extensionInfoKey?.CreateSubKey("shell"); - } - catch (Exception) - { + icon?.SetValue(string.Empty, "\"" + applicationPath + "\",0", RegistryValueKind.String); } - using (var shellKey = extensionInfoKey?.OpenSubKey("shell", true)) - { - try - { - shellKey?.CreateSubKey("open"); - } - catch (Exception) - { - - } - using (var openKey = shellKey?.OpenSubKey("open", true)) + using (var shellKey = extensionInfoKey?.CreateSubKey("shell")) + { + using (var openKey = shellKey?.CreateSubKey("open")) { - openKey?.SetValue(string.Empty, $"&Open with {applicationName}", RegistryValueKind.String); - try - { - openKey?.CreateSubKey("command"); - } - catch (Exception) - { - - } - - using (var commandKey = openKey?.OpenSubKey("command", true)) + using (var commandKey = openKey?.CreateSubKey("command")) { commandKey?.SetValue(string.Empty, $"\"{applicationPath}\" \"%1\"", RegistryValueKind.String); } From 326a77c77e6934726ce119c7b328720db736c579 Mon Sep 17 00:00:00 2001 From: KN4CK3R Date: Fri, 10 May 2019 10:58:06 +0200 Subject: [PATCH 068/223] Removed unneeded usings. --- ReClass.NET_Tests/AddressParser/DynamicCompilerTest.cs | 7 +------ ReClass.NET_Tests/AddressParser/InterpreterTest.cs | 7 +------ 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/ReClass.NET_Tests/AddressParser/DynamicCompilerTest.cs b/ReClass.NET_Tests/AddressParser/DynamicCompilerTest.cs index 1ba20a85..cada902a 100644 --- a/ReClass.NET_Tests/AddressParser/DynamicCompilerTest.cs +++ b/ReClass.NET_Tests/AddressParser/DynamicCompilerTest.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using ReClassNET.AddressParser; +using ReClassNET.AddressParser; namespace ReClass.NET_Tests.AddressParser { diff --git a/ReClass.NET_Tests/AddressParser/InterpreterTest.cs b/ReClass.NET_Tests/AddressParser/InterpreterTest.cs index 92348e8a..b7ee2295 100644 --- a/ReClass.NET_Tests/AddressParser/InterpreterTest.cs +++ b/ReClass.NET_Tests/AddressParser/InterpreterTest.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using ReClassNET.AddressParser; +using ReClassNET.AddressParser; namespace ReClass.NET_Tests.AddressParser { From ebce22ced12258e8ec6460c5404218e6be42243f Mon Sep 17 00:00:00 2001 From: KN4CK3R Date: Fri, 10 May 2019 11:29:56 +0200 Subject: [PATCH 069/223] Implemented test. --- ReClass.NET_Tests/Extensions/ListExtensionTest.cs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/ReClass.NET_Tests/Extensions/ListExtensionTest.cs b/ReClass.NET_Tests/Extensions/ListExtensionTest.cs index 377bd2b3..6cf535db 100644 --- a/ReClass.NET_Tests/Extensions/ListExtensionTest.cs +++ b/ReClass.NET_Tests/Extensions/ListExtensionTest.cs @@ -1,8 +1,5 @@ using System; using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using NFluent; using ReClassNET.Extensions; using Xunit; @@ -13,9 +10,15 @@ public class ListExtensionTest { public static TheoryData, Func, int> GetTestBinarySearchData() => new TheoryData, Func, int> { - + { new List { 0, 2, 4, 6, 8, 10, 12 }, i => 2.CompareTo(i), 1 }, + { new List { 0, 2, 4, 6, 8, 10, 12 }, i => 8.CompareTo(i), 4 }, + { new List { 1, 3, 5, 7, 9, 11, 13 }, i => 1.CompareTo(i), 0 }, + { new List { 1, 3, 5, 7, 9, 11, 13 }, i => 2.CompareTo(i), ~1 }, + { new List { 1, 3, 5, 7, 9, 11, 13 }, i => 14.CompareTo(i), ~7 }, }; + [Theory] + [MemberData(nameof(GetTestBinarySearchData))] public void TestBinarySearch(IList sut, Func comparer, int expected) { Check.That(sut.BinarySearch(comparer)).IsEqualTo(expected); From 3becbe1a11e2a4e377a61688ff0a60e2eee6f8ba Mon Sep 17 00:00:00 2001 From: KN4CK3R Date: Fri, 10 May 2019 11:32:25 +0200 Subject: [PATCH 070/223] Changed class name. --- .../Extensions/{LinqExtensions.cs => EnumerableExtension.cs} | 2 +- ReClass.NET/ReClass.NET.csproj | 2 +- .../{LinqExtensionTests.cs => EnumerableExtensionTests.cs} | 2 +- ReClass.NET_Tests/ReClass.NET_Tests.csproj | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) rename ReClass.NET/Extensions/{LinqExtensions.cs => EnumerableExtension.cs} (99%) rename ReClass.NET_Tests/Extensions/{LinqExtensionTests.cs => EnumerableExtensionTests.cs} (99%) diff --git a/ReClass.NET/Extensions/LinqExtensions.cs b/ReClass.NET/Extensions/EnumerableExtension.cs similarity index 99% rename from ReClass.NET/Extensions/LinqExtensions.cs rename to ReClass.NET/Extensions/EnumerableExtension.cs index 22966d63..f027df42 100644 --- a/ReClass.NET/Extensions/LinqExtensions.cs +++ b/ReClass.NET/Extensions/EnumerableExtension.cs @@ -6,7 +6,7 @@ namespace ReClassNET.Extensions { - public static class LinqExtension + public static class EnumerableExtension { [DebuggerStepThrough] public static bool None(this IEnumerable source) diff --git a/ReClass.NET/ReClass.NET.csproj b/ReClass.NET/ReClass.NET.csproj index ceaf1ffd..8025a590 100644 --- a/ReClass.NET/ReClass.NET.csproj +++ b/ReClass.NET/ReClass.NET.csproj @@ -508,7 +508,7 @@ - + diff --git a/ReClass.NET_Tests/Extensions/LinqExtensionTests.cs b/ReClass.NET_Tests/Extensions/EnumerableExtensionTests.cs similarity index 99% rename from ReClass.NET_Tests/Extensions/LinqExtensionTests.cs rename to ReClass.NET_Tests/Extensions/EnumerableExtensionTests.cs index cb420f5d..90bb3573 100644 --- a/ReClass.NET_Tests/Extensions/LinqExtensionTests.cs +++ b/ReClass.NET_Tests/Extensions/EnumerableExtensionTests.cs @@ -7,7 +7,7 @@ namespace ReClass.NET_Tests.Extensions { - public class LinqExtensionTests + public class EnumerableExtensionTest { public static TheoryData, bool> GetTestNoneData => new TheoryData, bool> { diff --git a/ReClass.NET_Tests/ReClass.NET_Tests.csproj b/ReClass.NET_Tests/ReClass.NET_Tests.csproj index d1b1c359..f205bfcc 100644 --- a/ReClass.NET_Tests/ReClass.NET_Tests.csproj +++ b/ReClass.NET_Tests/ReClass.NET_Tests.csproj @@ -72,7 +72,7 @@ - + From 30ef791efe26134f0d5572ecc1f7eb84cd1e9218 Mon Sep 17 00:00:00 2001 From: KN4CK3R Date: Fri, 10 May 2019 11:34:25 +0200 Subject: [PATCH 071/223] Removed unneeded usings. --- .../Extensions/FloatingPointExtensionTest.cs | 8 +------- ReClass.NET_Tests/Extensions/StringExtensionTest.cs | 1 - ReClass.NET_Tests/MemoryScanner/BytePatternTest.cs | 3 --- ReClass.NET_Tests/Util/BitStringTest.cs | 7 +------ ReClass.NET_Tests/Util/DirectedGraphTest.cs | 3 --- ReClass.NET_Tests/Util/IntPtrComparerTest.cs | 4 ---- ReClass.NET_Tests/Util/PathUtilTest.cs | 6 +----- ReClass.NET_Tests/Util/XElementSerializerTest.cs | 6 +----- 8 files changed, 4 insertions(+), 34 deletions(-) diff --git a/ReClass.NET_Tests/Extensions/FloatingPointExtensionTest.cs b/ReClass.NET_Tests/Extensions/FloatingPointExtensionTest.cs index a295fd7a..844f8229 100644 --- a/ReClass.NET_Tests/Extensions/FloatingPointExtensionTest.cs +++ b/ReClass.NET_Tests/Extensions/FloatingPointExtensionTest.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using NFluent; -using NFluent.Extensions; +using NFluent; using ReClassNET.Extensions; using Xunit; diff --git a/ReClass.NET_Tests/Extensions/StringExtensionTest.cs b/ReClass.NET_Tests/Extensions/StringExtensionTest.cs index 74779eb9..5977bf07 100644 --- a/ReClass.NET_Tests/Extensions/StringExtensionTest.cs +++ b/ReClass.NET_Tests/Extensions/StringExtensionTest.cs @@ -1,6 +1,5 @@ using System; using System.Collections.Generic; -using System.Linq; using NFluent; using ReClassNET.Extensions; using Xunit; diff --git a/ReClass.NET_Tests/MemoryScanner/BytePatternTest.cs b/ReClass.NET_Tests/MemoryScanner/BytePatternTest.cs index bf230f2b..957863a4 100644 --- a/ReClass.NET_Tests/MemoryScanner/BytePatternTest.cs +++ b/ReClass.NET_Tests/MemoryScanner/BytePatternTest.cs @@ -1,8 +1,5 @@ using System; using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using NFluent; using ReClassNET.MemoryScanner; using Xunit; diff --git a/ReClass.NET_Tests/Util/BitStringTest.cs b/ReClass.NET_Tests/Util/BitStringTest.cs index e078106e..7a6a0b79 100644 --- a/ReClass.NET_Tests/Util/BitStringTest.cs +++ b/ReClass.NET_Tests/Util/BitStringTest.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using NFluent; +using NFluent; using ReClassNET.Util; using Xunit; diff --git a/ReClass.NET_Tests/Util/DirectedGraphTest.cs b/ReClass.NET_Tests/Util/DirectedGraphTest.cs index 624ae7e4..feea18af 100644 --- a/ReClass.NET_Tests/Util/DirectedGraphTest.cs +++ b/ReClass.NET_Tests/Util/DirectedGraphTest.cs @@ -1,8 +1,5 @@ using System; using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using NFluent; using ReClassNET.Util; using Xunit; diff --git a/ReClass.NET_Tests/Util/IntPtrComparerTest.cs b/ReClass.NET_Tests/Util/IntPtrComparerTest.cs index 1b07ecb9..ec47827b 100644 --- a/ReClass.NET_Tests/Util/IntPtrComparerTest.cs +++ b/ReClass.NET_Tests/Util/IntPtrComparerTest.cs @@ -1,8 +1,4 @@ using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using NFluent; using ReClassNET.Util; using Xunit; diff --git a/ReClass.NET_Tests/Util/PathUtilTest.cs b/ReClass.NET_Tests/Util/PathUtilTest.cs index 5209171d..5e28a654 100644 --- a/ReClass.NET_Tests/Util/PathUtilTest.cs +++ b/ReClass.NET_Tests/Util/PathUtilTest.cs @@ -1,9 +1,5 @@ -using System; -using System.Collections.Generic; +using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using NFluent; using ReClassNET.Util; using Xunit; diff --git a/ReClass.NET_Tests/Util/XElementSerializerTest.cs b/ReClass.NET_Tests/Util/XElementSerializerTest.cs index c372b41f..d81a7a4f 100644 --- a/ReClass.NET_Tests/Util/XElementSerializerTest.cs +++ b/ReClass.NET_Tests/Util/XElementSerializerTest.cs @@ -1,9 +1,5 @@ -using System; -using System.Collections.Generic; +using System.Collections.Generic; using System.Drawing; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using NFluent; using ReClassNET.Extensions; using ReClassNET.Util; From 3a771dd703a677bf1e58fba431aa414654ec23a5 Mon Sep 17 00:00:00 2001 From: KN4CK3R Date: Sun, 12 May 2019 22:32:36 +0200 Subject: [PATCH 072/223] Use correct method names. --- ReClass.NET/Extensions/StringExtensions.cs | 6 +++--- ReClass.NET/Memory/NodeDissector.cs | 8 ++++---- ReClass.NET/Nodes/BaseHexCommentNode.cs | 4 ++-- .../Extensions/StringExtensionTest.cs | 16 ++++++++-------- 4 files changed, 17 insertions(+), 17 deletions(-) diff --git a/ReClass.NET/Extensions/StringExtensions.cs b/ReClass.NET/Extensions/StringExtensions.cs index 89c5caf6..b3bc0533 100644 --- a/ReClass.NET/Extensions/StringExtensions.cs +++ b/ReClass.NET/Extensions/StringExtensions.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Diagnostics; using System.Diagnostics.Contracts; @@ -17,7 +17,7 @@ public static bool IsPrintable(this char c) } [DebuggerStepThrough] - public static IEnumerable InterpretAsUtf8(this IEnumerable source) + public static IEnumerable InterpretAsSingleByteCharacter(this IEnumerable source) { Contract.Requires(source != null); @@ -25,7 +25,7 @@ public static IEnumerable InterpretAsUtf8(this IEnumerable source) } [DebuggerStepThrough] - public static IEnumerable InterpretAsUtf16(this IEnumerable source) + public static IEnumerable InterpretAsDoubleByteCharacter(this IEnumerable source) { Contract.Requires(source != null); diff --git a/ReClass.NET/Memory/NodeDissector.cs b/ReClass.NET/Memory/NodeDissector.cs index 7b82f782..c29aa884 100644 --- a/ReClass.NET/Memory/NodeDissector.cs +++ b/ReClass.NET/Memory/NodeDissector.cs @@ -45,13 +45,13 @@ public static bool GuessNode(BaseHexNode node, MemoryBuffer memory, out BaseNode var data32 = memory.ReadObject(offset); var raw = memory.ReadBytes(offset, node.MemorySize); - if (raw.InterpretAsUtf8().IsLikelyPrintableData()) + if (raw.InterpretAsSingleByteCharacter().IsLikelyPrintableData()) { guessedNode = new Utf8TextNode(); return true; } - if (raw.InterpretAsUtf16().IsLikelyPrintableData()) + if (raw.InterpretAsDoubleByteCharacter().IsLikelyPrintableData()) { guessedNode = new Utf16TextNode(); @@ -147,13 +147,13 @@ private static bool GuessPointerNode(IntPtr address, IProcessReader process, out // Check if it is a string. var data = process.ReadRemoteMemory(address, IntPtr.Size * 2); - if (data.Take(IntPtr.Size).InterpretAsUtf8().IsLikelyPrintableData()) + if (data.Take(IntPtr.Size).InterpretAsSingleByteCharacter().IsLikelyPrintableData()) { node = new Utf8TextPtrNode(); return true; } - if (data.InterpretAsUtf16().IsLikelyPrintableData()) + if (data.InterpretAsDoubleByteCharacter().IsLikelyPrintableData()) { node = new Utf16TextPtrNode(); diff --git a/ReClass.NET/Nodes/BaseHexCommentNode.cs b/ReClass.NET/Nodes/BaseHexCommentNode.cs index f59fca44..6c72f480 100644 --- a/ReClass.NET/Nodes/BaseHexCommentNode.cs +++ b/ReClass.NET/Nodes/BaseHexCommentNode.cs @@ -67,12 +67,12 @@ protected int AddComment(ViewInfo view, int x, int y, float fvalue, IntPtr ivalu var data = view.Memory.Process.ReadRemoteMemory(ivalue, 64); // First check if it could be an UTF8 string and if not try UTF16. - if (data.Take(IntPtr.Size).InterpretAsUtf8().IsPrintableData()) + if (data.Take(IntPtr.Size).InterpretAsSingleByteCharacter().IsPrintableData()) { var text = new string(Encoding.UTF8.GetChars(data).TakeWhile(c => c != 0).ToArray()); x = AddText(view, x, y, view.Settings.TextColor, HotSpot.ReadOnlyId, $"'{text}'") + view.Font.Width; } - else if(data.Take(IntPtr.Size * 2).InterpretAsUtf16().IsPrintableData()) + else if(data.Take(IntPtr.Size * 2).InterpretAsDoubleByteCharacter().IsPrintableData()) { var text = new string(Encoding.Unicode.GetChars(data).TakeWhile(c => c != 0).ToArray()); x = AddText(view, x, y, view.Settings.TextColor, HotSpot.ReadOnlyId, $"L'{text}'") + view.Font.Width; diff --git a/ReClass.NET_Tests/Extensions/StringExtensionTest.cs b/ReClass.NET_Tests/Extensions/StringExtensionTest.cs index 5977bf07..9a66e19f 100644 --- a/ReClass.NET_Tests/Extensions/StringExtensionTest.cs +++ b/ReClass.NET_Tests/Extensions/StringExtensionTest.cs @@ -55,30 +55,30 @@ public void TestLimitLengthThrows() Check.ThatCode(() => "".LimitLength(-1)).Throws(); } - public static TheoryData, IEnumerable> GetTestInterpretAsUtf8Data() => new TheoryData, IEnumerable> + public static TheoryData, IEnumerable> GetTestInterpretAsSingleByteCharacterData() => new TheoryData, IEnumerable> { { new byte[0], string.Empty }, { new [] { (byte)'t', (byte)'e', (byte)'s', (byte)'t' }, "test" } }; [Theory] - [MemberData(nameof(GetTestInterpretAsUtf8Data))] - public void TestInterpretAsUtf8(IEnumerable sut, IEnumerable expected) + [MemberData(nameof(GetTestInterpretAsSingleByteCharacterData))] + public void TestInterpretAsSingleByteCharacter(IEnumerable sut, IEnumerable expected) { - Check.That(sut.InterpretAsUtf8()).ContainsExactly(expected); + Check.That(sut.InterpretAsSingleByteCharacter()).ContainsExactly(expected); } - public static TheoryData, IEnumerable> GetTestInterpretAsUtf16Data() => new TheoryData, IEnumerable> + public static TheoryData, IEnumerable> GetTestInterpretAsDoubleByteCharacterData() => new TheoryData, IEnumerable> { { new byte[0], string.Empty }, { new [] { (byte)'t', (byte)0, (byte)'e', (byte)0, (byte)'s', (byte)0, (byte)'t', (byte)0 }, "test" } }; [Theory] - [MemberData(nameof(GetTestInterpretAsUtf16Data))] - public void TestInterpretAsUtf16(IEnumerable sut, IEnumerable expected) + [MemberData(nameof(GetTestInterpretAsDoubleByteCharacterData))] + public void TestInterpretAsDoubleByteCharacter(IEnumerable sut, IEnumerable expected) { - Check.That(sut.InterpretAsUtf16()).ContainsExactly(expected); + Check.That(sut.InterpretAsDoubleByteCharacter()).ContainsExactly(expected); } public static TheoryData, float> GetTestCalculatePrintableDataThresholdData() => new TheoryData, float> From f68c16a871375e2e6d7b37538135366bb12ed8ed Mon Sep 17 00:00:00 2001 From: KN4CK3R Date: Sun, 12 May 2019 22:35:31 +0200 Subject: [PATCH 073/223] Use more restricted IsPrintable implementation. --- ReClass.NET/Extensions/StringExtensions.cs | 4 ++-- ReClass.NET_Tests/Extensions/StringExtensionTest.cs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ReClass.NET/Extensions/StringExtensions.cs b/ReClass.NET/Extensions/StringExtensions.cs index b3bc0533..31baa487 100644 --- a/ReClass.NET/Extensions/StringExtensions.cs +++ b/ReClass.NET/Extensions/StringExtensions.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Diagnostics; using System.Diagnostics.Contracts; @@ -13,7 +13,7 @@ public static class StringExtension [DebuggerStepThrough] public static bool IsPrintable(this char c) { - return (!char.IsControl(c) || char.IsWhiteSpace(c)) && c != '\xFFFD' /* Unicode REPLACEMENT CHARACTER � */; + return (' ' <= c && c <= '~' || '\xA1' <= c && c <= '\xFF') && c != '\xFFFD' /* Unicode REPLACEMENT CHARACTER � */; } [DebuggerStepThrough] diff --git a/ReClass.NET_Tests/Extensions/StringExtensionTest.cs b/ReClass.NET_Tests/Extensions/StringExtensionTest.cs index 9a66e19f..0166d90a 100644 --- a/ReClass.NET_Tests/Extensions/StringExtensionTest.cs +++ b/ReClass.NET_Tests/Extensions/StringExtensionTest.cs @@ -10,7 +10,7 @@ public class StringExtensionTest { public static TheoryData GetTestIsPrintableData() => new TheoryData { - '0', '9', ' ', '\t', '\n', 'a', 'A', 'z', 'Z', '-', '_', '°', '^', '"', '\\', '\"', '&', '@', '€', '$', '|', '<', '>', ';', ',', '.', ':', '#', '*', '+', '~', '`', '´', 'ß', '?', '=', '(', ')', '[', ']', '{', '}' + '0', '9', ' ', 'a', 'A', 'z', 'Z', '-', '_', '°', '^', '"', '\\', '\"', '&', '@', '$', '|', '<', '>', ';', ',', '.', ':', '#', '*', '+', '~', '`', '´', 'ß', '?', '=', '(', ')', '[', ']', '{', '}' }; [Theory] From dbe005c0efa71fdbd721c8719c49d49ce262ae79 Mon Sep 17 00:00:00 2001 From: KN4CK3R Date: Mon, 13 May 2019 11:19:27 +0200 Subject: [PATCH 074/223] Fixed #111. --- ReClass.NET/Nodes/ArrayNode.cs | 3 +-- ReClass.NET/Nodes/BaseClassWrapperNode.cs | 6 ++++-- ReClass.NET/Nodes/BaseWrapperNode.cs | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/ReClass.NET/Nodes/ArrayNode.cs b/ReClass.NET/Nodes/ArrayNode.cs index 85643e5d..d21d4c0c 100644 --- a/ReClass.NET/Nodes/ArrayNode.cs +++ b/ReClass.NET/Nodes/ArrayNode.cs @@ -1,6 +1,5 @@ using System; using System.Drawing; -using ReClassNET.Extensions; using ReClassNET.UI; namespace ReClassNET.Nodes @@ -20,7 +19,7 @@ public override void GetUserInterfaceInfo(out string name, out Image icon) public override void Initialize() { - InnerNode = IntPtr.Size == 4 ? (BaseNode)new Hex32Node() : new Hex64Node(); + ChangeInnerNode(IntPtr.Size == 4 ? (BaseNode)new Hex32Node() : new Hex64Node()); } public override Size Draw(ViewInfo view, int x, int y) diff --git a/ReClass.NET/Nodes/BaseClassWrapperNode.cs b/ReClass.NET/Nodes/BaseClassWrapperNode.cs index 6cc94aee..aa50aaba 100644 --- a/ReClass.NET/Nodes/BaseClassWrapperNode.cs +++ b/ReClass.NET/Nodes/BaseClassWrapperNode.cs @@ -4,8 +4,10 @@ public abstract class BaseClassWrapperNode : BaseWrapperNode { public override void Initialize() { - InnerNode = ClassNode.Create(); - InnerNode.Initialize(); + var node = ClassNode.Create(); + node.Initialize(); + + ChangeInnerNode(node); } public override bool CanChangeInnerNodeTo(BaseNode node) diff --git a/ReClass.NET/Nodes/BaseWrapperNode.cs b/ReClass.NET/Nodes/BaseWrapperNode.cs index 687e03cc..b9316722 100644 --- a/ReClass.NET/Nodes/BaseWrapperNode.cs +++ b/ReClass.NET/Nodes/BaseWrapperNode.cs @@ -6,7 +6,7 @@ namespace ReClassNET.Nodes public abstract class BaseWrapperNode : BaseNode { /// Gets or sets the inner node. - public BaseNode InnerNode { get; protected set; } + public BaseNode InnerNode { get; private set; } /// Gets signaled if the inner node was changed. public event NodeEventHandler InnerNodeChanged; From f14b7d0540eb54f33a5101647c248e60d483e538 Mon Sep 17 00:00:00 2001 From: KN4CK3R Date: Mon, 13 May 2019 14:53:10 +0200 Subject: [PATCH 075/223] Removed MemoryBuffer.Process to reduce coupling. --- ReClass.NET/Forms/MainForm.Functions.cs | 4 +-- ReClass.NET/Forms/MainForm.cs | 8 ++--- ReClass.NET/Memory/MemoryBuffer.cs | 23 ++++---------- ReClass.NET/Memory/NodeDissector.cs | 10 +++--- ReClass.NET/Nodes/BaseFunctionNode.cs | 8 ++--- ReClass.NET/Nodes/BaseFunctionPtrNode.cs | 20 ++++++------ ReClass.NET/Nodes/BaseHexCommentNode.cs | 10 +++--- ReClass.NET/Nodes/BaseHexNode.cs | 2 +- ReClass.NET/Nodes/BaseMatrixNode.cs | 2 +- ReClass.NET/Nodes/BaseNode.cs | 8 ++--- ReClass.NET/Nodes/BaseTextNode.cs | 2 +- ReClass.NET/Nodes/BaseTextPtrNode.cs | 2 +- ReClass.NET/Nodes/BaseWrapperNode.cs | 1 - ReClass.NET/Nodes/BitFieldNode.cs | 2 +- ReClass.NET/Nodes/BoolNode.cs | 2 +- ReClass.NET/Nodes/DoubleNode.cs | 2 +- ReClass.NET/Nodes/FloatNode.cs | 2 +- ReClass.NET/Nodes/FunctionNode.cs | 14 ++++----- ReClass.NET/Nodes/Hex16Node.cs | 4 +-- ReClass.NET/Nodes/Hex32Node.cs | 10 +++--- ReClass.NET/Nodes/Hex64Node.cs | 10 +++--- ReClass.NET/Nodes/Hex8Node.cs | 4 +-- ReClass.NET/Nodes/Int16Node.cs | 2 +- ReClass.NET/Nodes/Int32Node.cs | 2 +- ReClass.NET/Nodes/Int64Node.cs | 2 +- ReClass.NET/Nodes/Int8Node.cs | 2 +- ReClass.NET/Nodes/PointerNode.cs | 9 +++--- ReClass.NET/Nodes/UInt16Node.cs | 2 +- ReClass.NET/Nodes/UInt32Node.cs | 2 +- ReClass.NET/Nodes/UInt64Node.cs | 2 +- ReClass.NET/Nodes/UInt8Node.cs | 2 +- ReClass.NET/Nodes/VirtualMethodTableNode.cs | 3 +- ReClass.NET/UI/HotSpot.cs | 2 ++ ReClass.NET/UI/MemoryPreviewPopUp.cs | 8 ++--- ReClass.NET/UI/MemoryViewControl.cs | 35 ++++++++++++++------- ReClass.NET/UI/ViewInfo.cs | 2 ++ 36 files changed, 111 insertions(+), 114 deletions(-) diff --git a/ReClass.NET/Forms/MainForm.Functions.cs b/ReClass.NET/Forms/MainForm.Functions.cs index 72270773..11d66d37 100644 --- a/ReClass.NET/Forms/MainForm.Functions.cs +++ b/ReClass.NET/Forms/MainForm.Functions.cs @@ -310,7 +310,7 @@ public void ReplaceSelectedNodesWithType(Type type) node.IsSelected = true; - var info = new MemoryViewControl.SelectedNodeInfo(node, selected.Memory, selected.Address, selected.Level); + var info = new MemoryViewControl.SelectedNodeInfo(node, selected.Process, selected.Memory, selected.Address, selected.Level); newSelected.Add(info); @@ -319,7 +319,7 @@ public void ReplaceSelectedNodesWithType(Type type) { foreach (var createdNode in createdNodes) { - hotSpotsToReplace.Enqueue(new MemoryViewControl.SelectedNodeInfo(createdNode, selected.Memory, selected.Address + createdNode.Offset - node.Offset, selected.Level)); + hotSpotsToReplace.Enqueue(new MemoryViewControl.SelectedNodeInfo(createdNode, selected.Process, selected.Memory, selected.Address + createdNode.Offset - node.Offset, selected.Level)); } } } diff --git a/ReClass.NET/Forms/MainForm.cs b/ReClass.NET/Forms/MainForm.cs index 33f951dd..3fe93267 100644 --- a/ReClass.NET/Forms/MainForm.cs +++ b/ReClass.NET/Forms/MainForm.cs @@ -62,10 +62,8 @@ public MainForm() processInfoToolStripStatusLabel.Text = "No process selected"; }; - memoryViewControl.Memory = new MemoryBuffer - { - Process = Program.RemoteProcess - }; + memoryViewControl.Process = Program.RemoteProcess; + memoryViewControl.Memory = new MemoryBuffer(); pluginManager = new PluginManager(new DefaultPluginHost(this, Program.RemoteProcess, Program.Logger)); } @@ -555,7 +553,7 @@ private void dissectNodesToolStripMenuItem_Click(object sender, EventArgs e) foreach (var g in hexNodes.GroupBy(n => n.Node.GetParentContainer())) { - NodeDissector.DissectNodes(g.Select(h => (BaseHexNode)h.Node), g.First().Memory); + NodeDissector.DissectNodes(g.Select(h => (BaseHexNode)h.Node), Program.RemoteProcess, g.First().Memory); } ClearSelection(); diff --git a/ReClass.NET/Memory/MemoryBuffer.cs b/ReClass.NET/Memory/MemoryBuffer.cs index 6da1ce7d..ddaed91b 100644 --- a/ReClass.NET/Memory/MemoryBuffer.cs +++ b/ReClass.NET/Memory/MemoryBuffer.cs @@ -13,8 +13,6 @@ public class MemoryBuffer private bool hasHistory; - public RemoteProcess Process { get; set; } - public byte[] RawData => data; public int Size @@ -81,19 +79,13 @@ public MemoryBuffer Clone() return new MemoryBuffer(this) { - Offset = Offset, - Process = Process + Offset = Offset }; } - public void Update(IntPtr address) - { - Update(address, true); - } - - public void Update(IntPtr address, bool setHistory) + public void UpdateFrom(IRemoteMemoryReader reader, IntPtr address) { - if (Process == null) + if (reader == null) { data.FillWithZero(); @@ -102,14 +94,11 @@ public void Update(IntPtr address, bool setHistory) return; } - if (setHistory) - { - Array.Copy(data, historyData, data.Length); + Array.Copy(data, historyData, data.Length); - hasHistory = ContainsValidData; - } + hasHistory = ContainsValidData; - ContainsValidData = Process.ReadRemoteMemoryIntoBuffer(address, ref data); + ContainsValidData = reader.ReadRemoteMemoryIntoBuffer(address, ref data); if (!ContainsValidData) { data.FillWithZero(); diff --git a/ReClass.NET/Memory/NodeDissector.cs b/ReClass.NET/Memory/NodeDissector.cs index c29aa884..3e103b16 100644 --- a/ReClass.NET/Memory/NodeDissector.cs +++ b/ReClass.NET/Memory/NodeDissector.cs @@ -9,7 +9,7 @@ namespace ReClassNET.Memory { public class NodeDissector { - public static void DissectNodes(IEnumerable nodes, MemoryBuffer memory) + public static void DissectNodes(IEnumerable nodes, IProcessReader reader, MemoryBuffer memory) { Contract.Requires(nodes != null); Contract.Requires(Contract.ForAll(nodes, n => n != null)); @@ -17,14 +17,14 @@ public static void DissectNodes(IEnumerable nodes, MemoryBuffer mem foreach (var node in nodes) { - if (GuessNode(node, memory, out var guessedNode)) + if (GuessNode(node, reader, memory, out var guessedNode)) { node.GetParentContainer()?.ReplaceChildNode(node, guessedNode); } } } - public static bool GuessNode(BaseHexNode node, MemoryBuffer memory, out BaseNode guessedNode) + public static bool GuessNode(BaseHexNode node, IProcessReader reader, MemoryBuffer memory, out BaseNode guessedNode) { Contract.Requires(node != null); Contract.Requires(memory != null); @@ -61,13 +61,13 @@ public static bool GuessNode(BaseHexNode node, MemoryBuffer memory, out BaseNode #if RECLASSNET64 if (is8ByteAligned) { - if (GuessPointerNode(data64.IntPtr, memory.Process, out guessedNode)) + if (GuessPointerNode(data64.IntPtr, reader, out guessedNode)) { return true; } } #else - if (GuessPointerNode(data32.IntPtr, memory.Process, out guessedNode)) + if (GuessPointerNode(data32.IntPtr, reader, out guessedNode)) { return true; } diff --git a/ReClass.NET/Nodes/BaseFunctionNode.cs b/ReClass.NET/Nodes/BaseFunctionNode.cs index 14ca74a4..8bb7bbf1 100644 --- a/ReClass.NET/Nodes/BaseFunctionNode.cs +++ b/ReClass.NET/Nodes/BaseFunctionNode.cs @@ -54,14 +54,14 @@ protected Size DrawInstructions(ViewInfo view, int tx, int y) return new Size(maxWidth, y - origY); } - protected void DisassembleRemoteCode(MemoryBuffer memory, IntPtr address, out int memorySize) + protected void DisassembleRemoteCode(RemoteProcess process, IntPtr address, out int memorySize) { - Contract.Requires(memory != null); + Contract.Requires(process != null); memorySize = 0; - var disassembler = new Disassembler(memory.Process.CoreFunctions); - foreach (var instruction in disassembler.RemoteDisassembleFunction(memory.Process, address, 8192)) + var disassembler = new Disassembler(process.CoreFunctions); + foreach (var instruction in disassembler.RemoteDisassembleFunction(process, address, 8192)) { memorySize += instruction.Length; diff --git a/ReClass.NET/Nodes/BaseFunctionPtrNode.cs b/ReClass.NET/Nodes/BaseFunctionPtrNode.cs index c151c674..a94e5e2a 100644 --- a/ReClass.NET/Nodes/BaseFunctionPtrNode.cs +++ b/ReClass.NET/Nodes/BaseFunctionPtrNode.cs @@ -13,11 +13,11 @@ public abstract class BaseFunctionPtrNode : BaseFunctionNode { public override int MemorySize => IntPtr.Size; - public override string GetToolTipText(HotSpot spot, MemoryBuffer memory) + public override string GetToolTipText(HotSpot spot) { - var ptr = memory.ReadIntPtr(Offset); + var ptr = spot.Memory.ReadIntPtr(Offset); - DisassembleRemoteCode(memory, ptr); + DisassembleRemoteCode(spot.Process, ptr); return string.Join("\n", instructions.Select(i => i.Instruction)); } @@ -59,10 +59,10 @@ protected Size Draw(ViewInfo view, int x, int y, string type, string name) { var value = view.Memory.ReadIntPtr(Offset); - var module = view.Memory.Process.GetModuleToPointer(value); + var module = view.Process.GetModuleToPointer(value); if (module != null) { - var symbols = view.Memory.Process.Symbols.GetSymbolsForModule(module); + var symbols = view.Process.Symbols.GetSymbolsForModule(module); var symbol = symbols?.GetSymbolString(value, module); if (!string.IsNullOrEmpty(symbol)) { @@ -81,7 +81,7 @@ protected Size Draw(ViewInfo view, int x, int y, string type, string name) { var ptr = view.Memory.ReadIntPtr(Offset); - DisassembleRemoteCode(view.Memory, ptr); + DisassembleRemoteCode(view.Process, ptr); var instructionSize = DrawInstructions(view, tx, y); @@ -107,9 +107,9 @@ public override int CalculateDrawnHeight(ViewInfo view) return height; } - private void DisassembleRemoteCode(MemoryBuffer memory, IntPtr address) + private void DisassembleRemoteCode(RemoteProcess process, IntPtr address) { - Contract.Requires(memory != null); + Contract.Requires(process != null); if (this.address != address) { @@ -117,9 +117,9 @@ private void DisassembleRemoteCode(MemoryBuffer memory, IntPtr address) this.address = address; - if (!address.IsNull() && memory.Process.IsValid) + if (!address.IsNull() && process.IsValid) { - DisassembleRemoteCode(memory, address, out _); + DisassembleRemoteCode(process, address, out _); } } } diff --git a/ReClass.NET/Nodes/BaseHexCommentNode.cs b/ReClass.NET/Nodes/BaseHexCommentNode.cs index 6c72f480..063dd8c5 100644 --- a/ReClass.NET/Nodes/BaseHexCommentNode.cs +++ b/ReClass.NET/Nodes/BaseHexCommentNode.cs @@ -30,7 +30,7 @@ protected int AddComment(ViewInfo view, int x, int y, float fvalue, IntPtr ivalu } } - var namedAddress = view.Memory.Process.GetNamedAddress(ivalue); + var namedAddress = view.Process.GetNamedAddress(ivalue); if (!string.IsNullOrEmpty(namedAddress)) { if (view.Settings.ShowCommentPointer) @@ -41,7 +41,7 @@ protected int AddComment(ViewInfo view, int x, int y, float fvalue, IntPtr ivalu if (view.Settings.ShowCommentRtti) { - var rtti = view.Memory.Process.ReadRemoteRuntimeTypeInformation(ivalue); + var rtti = view.Process.ReadRemoteRuntimeTypeInformation(ivalue); if (!string.IsNullOrEmpty(rtti)) { x = AddText(view, x, y, view.Settings.OffsetColor, HotSpot.ReadOnlyId, rtti) + view.Font.Width; @@ -50,10 +50,10 @@ protected int AddComment(ViewInfo view, int x, int y, float fvalue, IntPtr ivalu if (view.Settings.ShowCommentSymbol) { - var module = view.Memory.Process.GetModuleToPointer(ivalue); + var module = view.Process.GetModuleToPointer(ivalue); if (module != null) { - var symbols = view.Memory.Process.Symbols.GetSymbolsForModule(module); + var symbols = view.Process.Symbols.GetSymbolsForModule(module); var symbol = symbols?.GetSymbolString(ivalue, module); if (!string.IsNullOrEmpty(symbol)) { @@ -64,7 +64,7 @@ protected int AddComment(ViewInfo view, int x, int y, float fvalue, IntPtr ivalu if (view.Settings.ShowCommentString) { - var data = view.Memory.Process.ReadRemoteMemory(ivalue, 64); + var data = view.Process.ReadRemoteMemory(ivalue, 64); // First check if it could be an UTF8 string and if not try UTF16. if (data.Take(IntPtr.Size).InterpretAsSingleByteCharacter().IsPrintableData()) diff --git a/ReClass.NET/Nodes/BaseHexNode.cs b/ReClass.NET/Nodes/BaseHexNode.cs index 023bcd6e..db0666fd 100644 --- a/ReClass.NET/Nodes/BaseHexNode.cs +++ b/ReClass.NET/Nodes/BaseHexNode.cs @@ -113,7 +113,7 @@ public void Update(HotSpot spot, int maxId) { if (byte.TryParse(spot.Text, NumberStyles.HexNumber, null, out var val)) { - spot.Memory.Process.WriteRemoteMemory(spot.Address + spot.Id, val); + spot.Process.WriteRemoteMemory(spot.Address + spot.Id, val); } } } diff --git a/ReClass.NET/Nodes/BaseMatrixNode.cs b/ReClass.NET/Nodes/BaseMatrixNode.cs index 5a31bc84..910e2b40 100644 --- a/ReClass.NET/Nodes/BaseMatrixNode.cs +++ b/ReClass.NET/Nodes/BaseMatrixNode.cs @@ -136,7 +136,7 @@ public void Update(HotSpot spot, int max) { if (float.TryParse(spot.Text, out var val)) { - spot.Memory.Process.WriteRemoteMemory(spot.Address + spot.Id * ValueTypeSize, val); + spot.Process.WriteRemoteMemory(spot.Address + spot.Id * ValueTypeSize, val); } } } diff --git a/ReClass.NET/Nodes/BaseNode.cs b/ReClass.NET/Nodes/BaseNode.cs index a0cfed16..1a7d7991 100644 --- a/ReClass.NET/Nodes/BaseNode.cs +++ b/ReClass.NET/Nodes/BaseNode.cs @@ -106,10 +106,9 @@ protected BaseNode() public abstract void GetUserInterfaceInfo(out string name, out Image icon); - public virtual bool UseMemoryPreviewToolTip(HotSpot spot, MemoryBuffer memory, out IntPtr address) + public virtual bool UseMemoryPreviewToolTip(HotSpot spot, out IntPtr address) { Contract.Requires(spot != null); - Contract.Requires(memory != null); address = IntPtr.Zero; @@ -118,12 +117,10 @@ public virtual bool UseMemoryPreviewToolTip(HotSpot spot, MemoryBuffer memory, o /// Gets informations about this node to show in a tool tip. /// The spot. - /// The process memory. /// The information to show in a tool tip or null if no information should be shown. - public virtual string GetToolTipText(HotSpot spot, MemoryBuffer memory) + public virtual string GetToolTipText(HotSpot spot) { Contract.Requires(spot != null); - Contract.Requires(memory != null); return null; } @@ -297,6 +294,7 @@ protected void AddHotSpot(ViewInfo view, Rectangle spot, string text, int id, Ho Type = type, Node = this, Level = view.Level, + Process = view.Process, Memory = view.Memory }); } diff --git a/ReClass.NET/Nodes/BaseTextNode.cs b/ReClass.NET/Nodes/BaseTextNode.cs index 60984853..4906b7a5 100644 --- a/ReClass.NET/Nodes/BaseTextNode.cs +++ b/ReClass.NET/Nodes/BaseTextNode.cs @@ -88,7 +88,7 @@ public override void Update(HotSpot spot) else if (spot.Id == 1) { var data = Encoding.GetBytes(spot.Text); - spot.Memory.Process.WriteRemoteMemory(spot.Address, data); + spot.Process.WriteRemoteMemory(spot.Address, data); } } diff --git a/ReClass.NET/Nodes/BaseTextPtrNode.cs b/ReClass.NET/Nodes/BaseTextPtrNode.cs index 13857f2d..3c108dd5 100644 --- a/ReClass.NET/Nodes/BaseTextPtrNode.cs +++ b/ReClass.NET/Nodes/BaseTextPtrNode.cs @@ -30,7 +30,7 @@ public Size DrawText(ViewInfo view, int x, int y, string type) } var ptr = view.Memory.ReadIntPtr(Offset); - var text = view.Memory.Process.ReadRemoteString(Encoding, ptr, 64); + var text = view.Process.ReadRemoteString(Encoding, ptr, 64); var origX = x; diff --git a/ReClass.NET/Nodes/BaseWrapperNode.cs b/ReClass.NET/Nodes/BaseWrapperNode.cs index b9316722..b499f0ce 100644 --- a/ReClass.NET/Nodes/BaseWrapperNode.cs +++ b/ReClass.NET/Nodes/BaseWrapperNode.cs @@ -1,5 +1,4 @@ using System; -using System.Security.Permissions; namespace ReClassNET.Nodes { diff --git a/ReClass.NET/Nodes/BitFieldNode.cs b/ReClass.NET/Nodes/BitFieldNode.cs index ac7bc770..65d1da38 100644 --- a/ReClass.NET/Nodes/BitFieldNode.cs +++ b/ReClass.NET/Nodes/BitFieldNode.cs @@ -209,7 +209,7 @@ public override void Update(HotSpot spot) { val &= (byte)~(1 << bit); } - spot.Memory.Process.WriteRemoteMemory(spot.Address + add, val); + spot.Process.WriteRemoteMemory(spot.Address + add, val); } } } diff --git a/ReClass.NET/Nodes/BoolNode.cs b/ReClass.NET/Nodes/BoolNode.cs index ba97f7ed..488d9e19 100644 --- a/ReClass.NET/Nodes/BoolNode.cs +++ b/ReClass.NET/Nodes/BoolNode.cs @@ -62,7 +62,7 @@ public override void Update(HotSpot spot) { if (bool.TryParse(spot.Text, out var val)) { - spot.Memory.Process.WriteRemoteMemory(spot.Address, (byte)(val ? 1 : 0)); + spot.Process.WriteRemoteMemory(spot.Address, (byte)(val ? 1 : 0)); } } } diff --git a/ReClass.NET/Nodes/DoubleNode.cs b/ReClass.NET/Nodes/DoubleNode.cs index 495935fc..c2cd44dc 100644 --- a/ReClass.NET/Nodes/DoubleNode.cs +++ b/ReClass.NET/Nodes/DoubleNode.cs @@ -27,7 +27,7 @@ public override void Update(HotSpot spot) { if (double.TryParse(spot.Text, out var val)) { - spot.Memory.Process.WriteRemoteMemory(spot.Address, val); + spot.Process.WriteRemoteMemory(spot.Address, val); } } } diff --git a/ReClass.NET/Nodes/FloatNode.cs b/ReClass.NET/Nodes/FloatNode.cs index e607b26f..8e1da21d 100644 --- a/ReClass.NET/Nodes/FloatNode.cs +++ b/ReClass.NET/Nodes/FloatNode.cs @@ -27,7 +27,7 @@ public override void Update(HotSpot spot) { if (float.TryParse(spot.Text, out var val)) { - spot.Memory.Process.WriteRemoteMemory(spot.Address, val); + spot.Process.WriteRemoteMemory(spot.Address, val); } } } diff --git a/ReClass.NET/Nodes/FunctionNode.cs b/ReClass.NET/Nodes/FunctionNode.cs index 1c0608f3..b4cd4b62 100644 --- a/ReClass.NET/Nodes/FunctionNode.cs +++ b/ReClass.NET/Nodes/FunctionNode.cs @@ -23,9 +23,9 @@ public override void GetUserInterfaceInfo(out string name, out Image icon) icon = Properties.Resources.B16x16_Button_Function; } - public override string GetToolTipText(HotSpot spot, MemoryBuffer memory) + public override string GetToolTipText(HotSpot spot) { - DisassembleRemoteCode(memory, spot.Address); + DisassembleRemoteCode(spot.Process, spot.Address); return string.Join("\n", instructions.Select(i => i.Instruction)); } @@ -68,7 +68,7 @@ public override Size Draw(ViewInfo view, int x, int y) var size = new Size(x - origX, view.Font.Height); var ptr = view.Address + Offset; - DisassembleRemoteCode(view.Memory, ptr); + DisassembleRemoteCode(view.Process, ptr); if (LevelsOpen[view.Level]) { @@ -118,9 +118,9 @@ public override void Update(HotSpot spot) } } - private void DisassembleRemoteCode(MemoryBuffer memory, IntPtr address) + private void DisassembleRemoteCode(RemoteProcess process, IntPtr address) { - Contract.Requires(memory != null); + Contract.Requires(process != null); if (this.address != address) { @@ -128,9 +128,9 @@ private void DisassembleRemoteCode(MemoryBuffer memory, IntPtr address) this.address = address; - if (!address.IsNull() && memory.Process.IsValid) + if (!address.IsNull() && process.IsValid) { - DisassembleRemoteCode(memory, address, out memorySize); + DisassembleRemoteCode(process, address, out memorySize); } GetParentContainer()?.ChildHasChanged(this); diff --git a/ReClass.NET/Nodes/Hex16Node.cs b/ReClass.NET/Nodes/Hex16Node.cs index bd72c878..09c619a0 100644 --- a/ReClass.NET/Nodes/Hex16Node.cs +++ b/ReClass.NET/Nodes/Hex16Node.cs @@ -14,9 +14,9 @@ public override void GetUserInterfaceInfo(out string name, out Image icon) icon = Properties.Resources.B16x16_Button_Hex_16; } - public override string GetToolTipText(HotSpot spot, MemoryBuffer memory) + public override string GetToolTipText(HotSpot spot) { - var value = memory.ReadObject(Offset); + var value = spot.Memory.ReadObject(Offset); return $"Int16: {value.ShortValue}\nUInt16: 0x{value.UShortValue:X04}"; } diff --git a/ReClass.NET/Nodes/Hex32Node.cs b/ReClass.NET/Nodes/Hex32Node.cs index 50591423..3c31c6ac 100644 --- a/ReClass.NET/Nodes/Hex32Node.cs +++ b/ReClass.NET/Nodes/Hex32Node.cs @@ -15,18 +15,18 @@ public override void GetUserInterfaceInfo(out string name, out Image icon) icon = Properties.Resources.B16x16_Button_Hex_32; } - public override bool UseMemoryPreviewToolTip(HotSpot spot, MemoryBuffer memory, out IntPtr address) + public override bool UseMemoryPreviewToolTip(HotSpot spot, out IntPtr address) { - var value = memory.ReadObject(Offset); + var value = spot.Memory.ReadObject(Offset); address = value.IntPtr; - return memory.Process?.GetNamedAddress(value.IntPtr) != null; + return spot.Process?.GetNamedAddress(value.IntPtr) != null; } - public override string GetToolTipText(HotSpot spot, MemoryBuffer memory) + public override string GetToolTipText(HotSpot spot) { - var value = memory.ReadObject(Offset); + var value = spot.Memory.ReadObject(Offset); return $"Int32: {value.IntValue}\nUInt32: 0x{value.UIntValue:X08}\nFloat: {value.FloatValue:0.000}"; } diff --git a/ReClass.NET/Nodes/Hex64Node.cs b/ReClass.NET/Nodes/Hex64Node.cs index ef9c909b..74472c65 100644 --- a/ReClass.NET/Nodes/Hex64Node.cs +++ b/ReClass.NET/Nodes/Hex64Node.cs @@ -15,18 +15,18 @@ public override void GetUserInterfaceInfo(out string name, out Image icon) icon = Properties.Resources.B16x16_Button_Hex_64; } - public override bool UseMemoryPreviewToolTip(HotSpot spot, MemoryBuffer memory, out IntPtr address) + public override bool UseMemoryPreviewToolTip(HotSpot spot, out IntPtr address) { - var value = memory.ReadObject(Offset); + var value = spot.Memory.ReadObject(Offset); address = value.IntPtr; - return memory.Process.GetSectionToPointer(value.IntPtr) != null; + return spot.Process.GetSectionToPointer(value.IntPtr) != null; } - public override string GetToolTipText(HotSpot spot, MemoryBuffer memory) + public override string GetToolTipText(HotSpot spot) { - var value = memory.ReadObject(Offset); + var value = spot.Memory.ReadObject(Offset); return $"Int64: {value.LongValue}\nUInt64: 0x{value.ULongValue:X016}\nFloat: {value.FloatValue:0.000}\nDouble: {value.DoubleValue:0.000}"; } diff --git a/ReClass.NET/Nodes/Hex8Node.cs b/ReClass.NET/Nodes/Hex8Node.cs index fdb435e5..75337e96 100644 --- a/ReClass.NET/Nodes/Hex8Node.cs +++ b/ReClass.NET/Nodes/Hex8Node.cs @@ -14,9 +14,9 @@ public override void GetUserInterfaceInfo(out string name, out Image icon) icon = Properties.Resources.B16x16_Button_Hex_8; } - public override string GetToolTipText(HotSpot spot, MemoryBuffer memory) + public override string GetToolTipText(HotSpot spot) { - var b = memory.ReadUInt8(Offset); + var b = spot.Memory.ReadUInt8(Offset); return $"Int8: {(int)b}\nUInt8: 0x{b:X02}"; } diff --git a/ReClass.NET/Nodes/Int16Node.cs b/ReClass.NET/Nodes/Int16Node.cs index e54c9351..7c81307e 100644 --- a/ReClass.NET/Nodes/Int16Node.cs +++ b/ReClass.NET/Nodes/Int16Node.cs @@ -30,7 +30,7 @@ public override void Update(HotSpot spot) { if (short.TryParse(spot.Text, out var val) || spot.Text.TryGetHexString(out var hexValue) && short.TryParse(hexValue, NumberStyles.HexNumber, null, out val)) { - spot.Memory.Process.WriteRemoteMemory(spot.Address, val); + spot.Process.WriteRemoteMemory(spot.Address, val); } } } diff --git a/ReClass.NET/Nodes/Int32Node.cs b/ReClass.NET/Nodes/Int32Node.cs index f2742cbc..4d0f375c 100644 --- a/ReClass.NET/Nodes/Int32Node.cs +++ b/ReClass.NET/Nodes/Int32Node.cs @@ -30,7 +30,7 @@ public override void Update(HotSpot spot) { if (int.TryParse(spot.Text, out var val) || spot.Text.TryGetHexString(out var hexValue) && int.TryParse(hexValue, NumberStyles.HexNumber, null, out val)) { - spot.Memory.Process.WriteRemoteMemory(spot.Address, val); + spot.Process.WriteRemoteMemory(spot.Address, val); } } } diff --git a/ReClass.NET/Nodes/Int64Node.cs b/ReClass.NET/Nodes/Int64Node.cs index d4146f22..81b5e9b7 100644 --- a/ReClass.NET/Nodes/Int64Node.cs +++ b/ReClass.NET/Nodes/Int64Node.cs @@ -30,7 +30,7 @@ public override void Update(HotSpot spot) { if (long.TryParse(spot.Text, out var val) || spot.Text.TryGetHexString(out var hexValue) && long.TryParse(hexValue, NumberStyles.HexNumber, null, out val)) { - spot.Memory.Process.WriteRemoteMemory(spot.Address, val); + spot.Process.WriteRemoteMemory(spot.Address, val); } } } diff --git a/ReClass.NET/Nodes/Int8Node.cs b/ReClass.NET/Nodes/Int8Node.cs index e1ed38c9..769be064 100644 --- a/ReClass.NET/Nodes/Int8Node.cs +++ b/ReClass.NET/Nodes/Int8Node.cs @@ -30,7 +30,7 @@ public override void Update(HotSpot spot) { if (sbyte.TryParse(spot.Text, out var val) || spot.Text.TryGetHexString(out var hexValue) && sbyte.TryParse(hexValue, NumberStyles.HexNumber, null, out val)) { - spot.Memory.Process.WriteRemoteMemory(spot.Address, val); + spot.Process.WriteRemoteMemory(spot.Address, val); } } } diff --git a/ReClass.NET/Nodes/PointerNode.cs b/ReClass.NET/Nodes/PointerNode.cs index 04c001b1..584a1f3f 100644 --- a/ReClass.NET/Nodes/PointerNode.cs +++ b/ReClass.NET/Nodes/PointerNode.cs @@ -24,13 +24,13 @@ public override void GetUserInterfaceInfo(out string name, out Image icon) icon = Properties.Resources.B16x16_Button_Pointer; } - public override bool UseMemoryPreviewToolTip(HotSpot spot, MemoryBuffer memory, out IntPtr address) + public override bool UseMemoryPreviewToolTip(HotSpot spot, out IntPtr address) { // TODO Should the preview be disabled if an inner node is set? - address = memory.ReadIntPtr(Offset); + address = spot.Memory.ReadIntPtr(Offset); - return memory.Process?.GetNamedAddress(address) != null; + return spot.Process.GetNamedAddress(address) != null; } public override bool CanChangeInnerNodeTo(BaseNode node) @@ -99,8 +99,7 @@ public override Size Draw(ViewInfo view, int x, int y) if (LevelsOpen[view.Level] && InnerNode != null) { memory.Size = InnerNode.MemorySize; - memory.Process = view.Memory.Process; - memory.Update(ptr); + memory.UpdateFrom(view.Process, ptr); var v = view.Clone(); v.Address = ptr; diff --git a/ReClass.NET/Nodes/UInt16Node.cs b/ReClass.NET/Nodes/UInt16Node.cs index c0b28138..538ba5cd 100644 --- a/ReClass.NET/Nodes/UInt16Node.cs +++ b/ReClass.NET/Nodes/UInt16Node.cs @@ -30,7 +30,7 @@ public override void Update(HotSpot spot) { if (ushort.TryParse(spot.Text, out var val) || spot.Text.TryGetHexString(out var hexValue) && ushort.TryParse(hexValue, NumberStyles.HexNumber, null, out val)) { - spot.Memory.Process.WriteRemoteMemory(spot.Address, val); + spot.Process.WriteRemoteMemory(spot.Address, val); } } } diff --git a/ReClass.NET/Nodes/UInt32Node.cs b/ReClass.NET/Nodes/UInt32Node.cs index 19925380..0ef9ac50 100644 --- a/ReClass.NET/Nodes/UInt32Node.cs +++ b/ReClass.NET/Nodes/UInt32Node.cs @@ -30,7 +30,7 @@ public override void Update(HotSpot spot) { if (uint.TryParse(spot.Text, out var val) || spot.Text.TryGetHexString(out var hexValue) && uint.TryParse(hexValue, NumberStyles.HexNumber, null, out val)) { - spot.Memory.Process.WriteRemoteMemory(spot.Address, val); + spot.Process.WriteRemoteMemory(spot.Address, val); } } } diff --git a/ReClass.NET/Nodes/UInt64Node.cs b/ReClass.NET/Nodes/UInt64Node.cs index b8a1b8f3..c60b643e 100644 --- a/ReClass.NET/Nodes/UInt64Node.cs +++ b/ReClass.NET/Nodes/UInt64Node.cs @@ -30,7 +30,7 @@ public override void Update(HotSpot spot) { if (ulong.TryParse(spot.Text, out var val) || spot.Text.TryGetHexString(out var hexValue) && ulong.TryParse(hexValue, NumberStyles.HexNumber, null, out val)) { - spot.Memory.Process.WriteRemoteMemory(spot.Address, val); + spot.Process.WriteRemoteMemory(spot.Address, val); } } } diff --git a/ReClass.NET/Nodes/UInt8Node.cs b/ReClass.NET/Nodes/UInt8Node.cs index 7f157a23..eda54e49 100644 --- a/ReClass.NET/Nodes/UInt8Node.cs +++ b/ReClass.NET/Nodes/UInt8Node.cs @@ -30,7 +30,7 @@ public override void Update(HotSpot spot) { if (byte.TryParse(spot.Text, out var val) || spot.Text.TryGetHexString(out var hexValue) && byte.TryParse(hexValue, NumberStyles.HexNumber, null, out val)) { - spot.Memory.Process.WriteRemoteMemory(spot.Address, val); + spot.Process.WriteRemoteMemory(spot.Address, val); } } } diff --git a/ReClass.NET/Nodes/VirtualMethodTableNode.cs b/ReClass.NET/Nodes/VirtualMethodTableNode.cs index 76465ec9..846772f2 100644 --- a/ReClass.NET/Nodes/VirtualMethodTableNode.cs +++ b/ReClass.NET/Nodes/VirtualMethodTableNode.cs @@ -72,8 +72,7 @@ public override Size Draw(ViewInfo view, int x, int y) var ptr = view.Memory.ReadIntPtr(Offset); memory.Size = Nodes.Count * IntPtr.Size; - memory.Process = view.Memory.Process; - memory.Update(ptr); + memory.UpdateFrom(view.Process, ptr); var v = view.Clone(); v.Address = ptr; diff --git a/ReClass.NET/UI/HotSpot.cs b/ReClass.NET/UI/HotSpot.cs index fc5e1dfc..3a0d4bc0 100644 --- a/ReClass.NET/UI/HotSpot.cs +++ b/ReClass.NET/UI/HotSpot.cs @@ -42,6 +42,8 @@ public class HotSpot public IntPtr Address { get; set; } + public RemoteProcess Process { get; set; } + public MemoryBuffer Memory { get; set; } } } diff --git a/ReClass.NET/UI/MemoryPreviewPopUp.cs b/ReClass.NET/UI/MemoryPreviewPopUp.cs index 1d04834a..0f13353d 100644 --- a/ReClass.NET/UI/MemoryPreviewPopUp.cs +++ b/ReClass.NET/UI/MemoryPreviewPopUp.cs @@ -212,15 +212,15 @@ public void InitializeMemory(RemoteProcess process, IntPtr address) memoryAddress = address; - var memory = panel.ViewInfo.Memory; - memory.Process = process; - memory.Update(address); + panel.ViewInfo.Process = process; + + panel.ViewInfo.Memory.UpdateFrom(process, address); } /// Updates the memory buffer to get current data. public void UpdateMemory() { - panel.ViewInfo.Memory.Update(memoryAddress); + panel.ViewInfo.Memory.UpdateFrom(panel.ViewInfo.Process, memoryAddress); panel.Invalidate(); } diff --git a/ReClass.NET/UI/MemoryViewControl.cs b/ReClass.NET/UI/MemoryViewControl.cs index c870ea4a..666a4c75 100644 --- a/ReClass.NET/UI/MemoryViewControl.cs +++ b/ReClass.NET/UI/MemoryViewControl.cs @@ -24,7 +24,9 @@ public class SelectedNodeInfo /// The selected node. /// public BaseNode Node { get; } - + + public RemoteProcess Process { get; } + /// /// The memory this node uses. /// @@ -37,12 +39,14 @@ public class SelectedNodeInfo public int Level { get; } - public SelectedNodeInfo(BaseNode node, MemoryBuffer memory, IntPtr address, int level) + public SelectedNodeInfo(BaseNode node, RemoteProcess process, MemoryBuffer memory, IntPtr address, int level) { Contract.Requires(node != null); + Contract.Requires(process != null); Contract.Requires(memory != null); Node = node; + Process = process; Memory = memory; Address = address; Level = level; @@ -75,15 +79,19 @@ public ClassNode ClassNode classNode = value; VerticalScroll.Value = VerticalScroll.Minimum; - if (classNode != null && Memory?.Process != null) + if (classNode != null && Process != null) { - classNode.UpdateAddress(Memory.Process); + classNode.UpdateAddress(Process); } Invalidate(); } } + [Browsable(false)] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public RemoteProcess Process { get; set; } + [Browsable(false)] [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public MemoryBuffer Memory { get; set; } @@ -148,9 +156,9 @@ protected override void OnPaint(PaintEventArgs e) return; } - if (Memory.Process != null) + if (Process != null) { - ClassNode.UpdateAddress(Memory.Process); + ClassNode.UpdateAddress(Process); } if (memoryPreviewPopUp.Visible) @@ -159,13 +167,14 @@ protected override void OnPaint(PaintEventArgs e) } Memory.Size = ClassNode.MemorySize; - Memory.Update(ClassNode.Address); + Memory.UpdateFrom(Process, ClassNode.Address); var view = new ViewInfo { Settings = Program.Settings, Context = e.Graphics, Font = font, + Process = Process, Memory = Memory, CurrentTime = DateTime.UtcNow, ClientArea = ClientRectangle, @@ -319,6 +328,7 @@ protected override void OnMouseClick(MouseEventArgs e) { Address = (IntPtr)(containerNode.Offset + n.Offset), Node = n, + Process = first.Process, Memory = first.Memory, Level = first.Level })) @@ -465,15 +475,15 @@ protected override void OnMouseHover(EventArgs e) { if (spot.Rect.Contains(toolTipPosition)) { - if (spot.Node.UseMemoryPreviewToolTip(spot, spot.Memory, out var previewAddress)) + if (spot.Node.UseMemoryPreviewToolTip(spot, out var previewAddress)) { - memoryPreviewPopUp.InitializeMemory(spot.Memory.Process, previewAddress); + memoryPreviewPopUp.InitializeMemory(spot.Process, previewAddress); memoryPreviewPopUp.Show(this, toolTipPosition.Relocate(16, 16)); } else { - var text = spot.Node.GetToolTipText(spot, spot.Memory); + var text = spot.Node.GetToolTipText(spot); if (!string.IsNullOrEmpty(text)) { nodeInfoToolTip.Show(text, this, toolTipPosition.Relocate(16, 16)); @@ -599,6 +609,7 @@ protected override bool ProcessCmdKey(ref Message msg, Keys keyData) { Address = (IntPtr)(containerNode.Offset + n.Offset), Node = n, + Process = toSelect.Process, Memory = toSelect.Memory, Level = toSelect.Level })) @@ -704,7 +715,7 @@ private void editBox_Committed(object sender, EventArgs e) public IReadOnlyList GetSelectedNodes() { return selectedNodes - .Select(h => new SelectedNodeInfo(h.Node, h.Memory, h.Address, h.Level)) + .Select(h => new SelectedNodeInfo(h.Node, h.Process, h.Memory, h.Address, h.Level)) .ToList(); } @@ -718,7 +729,7 @@ public void SetSelectedNodes(IEnumerable nodes) selectedNodes.Clear(); - selectedNodes.AddRange(nodes.Select(i => new HotSpot { Type = HotSpotType.Select, Node = i.Node, Memory = i.Memory, Address = i.Address, Level = i.Level })); + selectedNodes.AddRange(nodes.Select(i => new HotSpot { Type = HotSpotType.Select, Node = i.Node, Process = i.Process, Memory = i.Memory, Address = i.Address, Level = i.Level })); selectedNodes.ForEach(h => h.Node.IsSelected = true); OnSelectionChanged(); diff --git a/ReClass.NET/UI/ViewInfo.cs b/ReClass.NET/UI/ViewInfo.cs index 5ccfe64c..0519d37d 100644 --- a/ReClass.NET/UI/ViewInfo.cs +++ b/ReClass.NET/UI/ViewInfo.cs @@ -12,6 +12,7 @@ public class ViewInfo public Graphics Context { get; set; } public FontEx Font { get; set; } + public RemoteProcess Process { get; set; } public MemoryBuffer Memory { get; set; } public DateTime CurrentTime { get; set; } @@ -29,6 +30,7 @@ public ViewInfo Clone() Settings = Settings, Context = Context, Font = Font, + Process = Process, Memory = Memory, CurrentTime = CurrentTime, ClientArea = ClientArea, From 60a017d9a0c37f21ac405741406f04195f9daad1 Mon Sep 17 00:00:00 2001 From: KN4CK3R Date: Wed, 15 May 2019 13:40:39 +0200 Subject: [PATCH 076/223] Reduced coupling for the MemoryViewControl. --- ReClass.NET/Forms/MainForm.Designer.cs | 21 +-- ReClass.NET/Forms/MainForm.Functions.cs | 7 +- ReClass.NET/Forms/MainForm.cs | 47 +++++- ReClass.NET/ReClass.NET.csproj | 1 + ReClass.NET/UI/DrawContextRequestEventArgs.cs | 23 +++ ReClass.NET/UI/MemoryViewControl.cs | 142 +++++++----------- 6 files changed, 131 insertions(+), 110 deletions(-) create mode 100644 ReClass.NET/UI/DrawContextRequestEventArgs.cs diff --git a/ReClass.NET/Forms/MainForm.Designer.cs b/ReClass.NET/Forms/MainForm.Designer.cs index 3d5cd7c2..f9eaffa6 100644 --- a/ReClass.NET/Forms/MainForm.Designer.cs +++ b/ReClass.NET/Forms/MainForm.Designer.cs @@ -157,12 +157,12 @@ private void InitializeComponent() this.projectToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.goToClassToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.cleanUnusedClassesToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.showEnumsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.toolStripSeparator16 = new System.Windows.Forms.ToolStripSeparator(); this.generateCppCodeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.generateCSharpCodeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.helpToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.aboutToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.showEnumsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); ((System.ComponentModel.ISupportInitialize)(this.splitContainer)).BeginInit(); this.splitContainer.Panel1.SuspendLayout(); this.splitContainer.Panel2.SuspendLayout(); @@ -349,7 +349,7 @@ private void InitializeComponent() // this.editEnumsToolStripMenuItem.Image = global::ReClassNET.Properties.Resources.B16x16_Category; this.editEnumsToolStripMenuItem.Name = "editEnumsToolStripMenuItem"; - this.editEnumsToolStripMenuItem.Size = new System.Drawing.Size(180, 22); + this.editEnumsToolStripMenuItem.Size = new System.Drawing.Size(142, 22); this.editEnumsToolStripMenuItem.Text = "Edit enums..."; this.editEnumsToolStripMenuItem.Click += new System.EventHandler(this.editEnumsToolStripMenuItem_Click); // @@ -362,6 +362,7 @@ private void InitializeComponent() this.memoryViewControl.NodeContextMenuStrip = this.selectedNodeContextMenuStrip; this.memoryViewControl.Size = new System.Drawing.Size(936, 524); this.memoryViewControl.TabIndex = 0; + this.memoryViewControl.DrawContextRequested += new ReClassNET.UI.DrawContextRequestEventHandler(this.memoryViewControl_DrawContextRequested); this.memoryViewControl.SelectionChanged += new System.EventHandler(this.memoryViewControl_SelectionChanged); this.memoryViewControl.ChangeClassTypeClick += new ReClassNET.UI.NodeClickEventHandler(this.memoryViewControl_ChangeClassTypeClick); this.memoryViewControl.ChangeWrappedTypeClick += new ReClassNET.UI.NodeClickEventHandler(this.memoryViewControl_ChangeWrappedTypeClick); @@ -1301,6 +1302,14 @@ private void InitializeComponent() this.cleanUnusedClassesToolStripMenuItem.Text = "Remove unused classes"; this.cleanUnusedClassesToolStripMenuItem.Click += new System.EventHandler(this.cleanUnusedClassesToolStripMenuItem_Click); // + // showEnumsToolStripMenuItem + // + this.showEnumsToolStripMenuItem.Image = global::ReClassNET.Properties.Resources.B16x16_Category; + this.showEnumsToolStripMenuItem.Name = "showEnumsToolStripMenuItem"; + this.showEnumsToolStripMenuItem.Size = new System.Drawing.Size(198, 22); + this.showEnumsToolStripMenuItem.Text = "Show Enums..."; + this.showEnumsToolStripMenuItem.Click += new System.EventHandler(this.showEnumsToolStripMenuItem_Click); + // // toolStripSeparator16 // this.toolStripSeparator16.Name = "toolStripSeparator16"; @@ -1338,14 +1347,6 @@ private void InitializeComponent() this.aboutToolStripMenuItem.Text = "About..."; this.aboutToolStripMenuItem.Click += new System.EventHandler(this.aboutToolStripMenuItem_Click); // - // showEnumsToolStripMenuItem - // - this.showEnumsToolStripMenuItem.Image = global::ReClassNET.Properties.Resources.B16x16_Category; - this.showEnumsToolStripMenuItem.Name = "showEnumsToolStripMenuItem"; - this.showEnumsToolStripMenuItem.Size = new System.Drawing.Size(198, 22); - this.showEnumsToolStripMenuItem.Text = "Show Enums..."; - this.showEnumsToolStripMenuItem.Click += new System.EventHandler(this.showEnumsToolStripMenuItem_Click); - // // MainForm // this.AllowDrop = true; diff --git a/ReClass.NET/Forms/MainForm.Functions.cs b/ReClass.NET/Forms/MainForm.Functions.cs index 11d66d37..28f1f7c0 100644 --- a/ReClass.NET/Forms/MainForm.Functions.cs +++ b/ReClass.NET/Forms/MainForm.Functions.cs @@ -112,7 +112,7 @@ void UpdateClassNodes(BaseNode node) projectView.Clear(); projectView.AddEnums(currentProject.Enums); projectView.AddClasses(currentProject.Classes); - memoryViewControl.ClassNode = currentProject.Classes.FirstOrDefault(); + CurrentClassNode = currentProject.Classes.FirstOrDefault(); } /// Opens the and calls with the result. @@ -123,12 +123,13 @@ private void AskAddOrInsertBytes(string title, Action callback) Contract.Requires(title != null); Contract.Requires(callback != null); - if (memoryViewControl.ClassNode == null) + var classNode = CurrentClassNode; + if (classNode == null) { return; } - using (var ib = new InputBytesForm(memoryViewControl.ClassNode.MemorySize)) + using (var ib = new InputBytesForm(classNode.MemorySize)) { ib.Text = title; diff --git a/ReClass.NET/Forms/MainForm.cs b/ReClass.NET/Forms/MainForm.cs index 3fe93267..e230d942 100644 --- a/ReClass.NET/Forms/MainForm.cs +++ b/ReClass.NET/Forms/MainForm.cs @@ -29,6 +29,10 @@ public partial class MainForm : IconForm private ReClassNetProject currentProject; public ReClassNetProject CurrentProject => currentProject; + private ClassNode currentClassNode; + + private readonly MemoryBuffer memoryViewBuffer = new MemoryBuffer(); + private Task updateProcessInformationsTask; private Task loadSymbolsTask; private CancellationTokenSource loadSymbolsTaskToken; @@ -37,6 +41,20 @@ public partial class MainForm : IconForm public MenuStrip MainMenu => mainMenuStrip; + public ClassNode CurrentClassNode + { + get => currentClassNode; + set + { + currentClassNode = value; + + projectView.SelectedClass = value; + + memoryViewControl.Reset(); + memoryViewControl.Invalidate(); + } + } + public MainForm() { Contract.Ensures(pluginManager != null); @@ -62,9 +80,6 @@ public MainForm() processInfoToolStripStatusLabel.Text = "No process selected"; }; - memoryViewControl.Process = Program.RemoteProcess; - memoryViewControl.Memory = new MemoryBuffer(); - pluginManager = new PluginManager(new DefaultPluginHost(this, Program.RemoteProcess, Program.Logger)); } @@ -250,8 +265,6 @@ private void goToClassToolStripMenuItem_Click(object sender, EventArgs e) private void clearProjectToolStripMenuItem_Click(object sender, EventArgs e) { SetProject(new ReClassNetProject()); - - memoryViewControl.ClassNode = null; } private void saveToolStripMenuItem_Click(object sender, EventArgs e) @@ -744,9 +757,7 @@ private void processUpdateTimer_Tick(object sender, EventArgs e) private void classesView_ClassSelected(object sender, ClassNode node) { - memoryViewControl.ClassNode = node; - - memoryViewControl.Invalidate(); + CurrentClassNode = node; } private void memoryViewControl_KeyDown(object sender, KeyEventArgs e) @@ -975,5 +986,25 @@ private void showEnumsToolStripMenuItem_Click(object sender, EventArgs e) elf.ShowDialog(); } } + + private void memoryViewControl_DrawContextRequested(object sender, DrawContextRequestEventArgs args) + { + var process = Program.RemoteProcess; + + var classNode = CurrentClassNode; + if (classNode != null) + { + classNode.UpdateAddress(process); + + memoryViewBuffer.Size = classNode.MemorySize; + memoryViewBuffer.UpdateFrom(process, classNode.Address); + + args.Settings = Program.Settings; + args.Process = process; + args.Memory = memoryViewBuffer; + args.Node = classNode; + args.BaseAddress = classNode.Address; + } + } } } diff --git a/ReClass.NET/ReClass.NET.csproj b/ReClass.NET/ReClass.NET.csproj index 8025a590..5b3f1352 100644 --- a/ReClass.NET/ReClass.NET.csproj +++ b/ReClass.NET/ReClass.NET.csproj @@ -313,6 +313,7 @@ + diff --git a/ReClass.NET/UI/DrawContextRequestEventArgs.cs b/ReClass.NET/UI/DrawContextRequestEventArgs.cs new file mode 100644 index 00000000..1c874a3b --- /dev/null +++ b/ReClass.NET/UI/DrawContextRequestEventArgs.cs @@ -0,0 +1,23 @@ +using System; +using ReClassNET.Memory; +using ReClassNET.Nodes; + +namespace ReClassNET.UI +{ + public class DrawContextRequestEventArgs : EventArgs + { + public DateTime CurrentTime { get; set; } = DateTime.UtcNow; + + public Settings Settings { get; set; } + + public RemoteProcess Process { get; set; } + + public MemoryBuffer Memory { get; set; } + + public BaseNode Node { get; set; } + + public IntPtr BaseAddress { get; set; } + } + + public delegate void DrawContextRequestEventHandler(object sender, DrawContextRequestEventArgs args); +} diff --git a/ReClass.NET/UI/MemoryViewControl.cs b/ReClass.NET/UI/MemoryViewControl.cs index 666a4c75..9e94db08 100644 --- a/ReClass.NET/UI/MemoryViewControl.cs +++ b/ReClass.NET/UI/MemoryViewControl.cs @@ -1,7 +1,5 @@ using System; using System.Collections.Generic; -using System.ComponentModel; -using System.Diagnostics; using System.Diagnostics.Contracts; using System.Drawing; using System.Linq; @@ -53,8 +51,6 @@ public SelectedNodeInfo(BaseNode node, RemoteProcess process, MemoryBuffer memor } } - private ClassNode classNode; - private readonly List hotSpots = new List(); private readonly List selectedNodes = new List(); @@ -63,41 +59,9 @@ public SelectedNodeInfo(BaseNode node, RemoteProcess process, MemoryBuffer memor private readonly FontEx font; - [Browsable(false)] - [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] - public ClassNode ClassNode - { - get => classNode; - set - { - editBox.Visible = false; - - ClearSelection(); - - OnSelectionChanged(); - - classNode = value; - - VerticalScroll.Value = VerticalScroll.Minimum; - if (classNode != null && Process != null) - { - classNode.UpdateAddress(Process); - } - - Invalidate(); - } - } - - [Browsable(false)] - [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] - public RemoteProcess Process { get; set; } - - [Browsable(false)] - [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] - public MemoryBuffer Memory { get; set; } - public ContextMenuStrip NodeContextMenuStrip { get; set; } + public event DrawContextRequestEventHandler DrawContextRequested; public event EventHandler SelectionChanged; public event NodeClickEventHandler ChangeClassTypeClick; public event NodeClickEventHandler ChangeWrappedTypeClick; @@ -144,6 +108,11 @@ protected override void OnPaint(PaintEventArgs e) return; } + var args = new DrawContextRequestEventArgs(); + + var requestHandler = DrawContextRequested; + requestHandler?.Invoke(this, args); + hotSpots.Clear(); using (var brush = new SolidBrush(Program.Settings.BackgroundColor)) @@ -151,86 +120,69 @@ protected override void OnPaint(PaintEventArgs e) e.Graphics.FillRectangle(brush, ClientRectangle); } - if (ClassNode == null) + if (args.Process == null || args.Memory == null || args.Node == null) { return; } - if (Process != null) - { - ClassNode.UpdateAddress(Process); - } - if (memoryPreviewPopUp.Visible) { memoryPreviewPopUp.UpdateMemory(); } - Memory.Size = ClassNode.MemorySize; - Memory.UpdateFrom(Process, ClassNode.Address); - var view = new ViewInfo { - Settings = Program.Settings, + Settings = args.Settings, Context = e.Graphics, Font = font, - Process = Process, - Memory = Memory, - CurrentTime = DateTime.UtcNow, + Process = args.Process, + Memory = args.Memory, + CurrentTime = args.CurrentTime, ClientArea = ClientRectangle, HotSpots = hotSpots, - Address = classNode.Address, + Address = args.BaseAddress, Level = 0, MultipleNodesSelected = selectedNodes.Count > 1 }; - try - { - var drawnSize = ClassNode.Draw( - view, - -HorizontalScroll.Value, - -VerticalScroll.Value * font.Height - ); - drawnSize.Width += 50; - - /*foreach (var spot in hotSpots.Where(h => h.Type == HotSpotType.Select)) - { - e.Graphics.DrawRectangle(new Pen(new SolidBrush(Color.FromArgb(150, 255, 0, 0)), 1), spot.Rect); - }*/ + var drawnSize = args.Node.Draw( + view, + -HorizontalScroll.Value, + -VerticalScroll.Value * font.Height + ); + drawnSize.Width += 10; - if (drawnSize.Height > ClientSize.Height) - { - VerticalScroll.Enabled = true; + /*foreach (var spot in hotSpots.Where(h => h.Type == HotSpotType.Select)) + { + e.Graphics.DrawRectangle(new Pen(new SolidBrush(Color.FromArgb(150, 255, 0, 0)), 1), spot.Rect); + }*/ - VerticalScroll.LargeChange = ClientSize.Height / font.Height; - VerticalScroll.Maximum = (drawnSize.Height - ClientSize.Height) / font.Height + VerticalScroll.LargeChange; - } - else - { - VerticalScroll.Enabled = false; + if (drawnSize.Height > ClientSize.Height) + { + VerticalScroll.Enabled = true; - VerticalScroll.Value = VerticalScroll.Minimum; - } + VerticalScroll.LargeChange = ClientSize.Height / font.Height; + VerticalScroll.Maximum = (drawnSize.Height - ClientSize.Height) / font.Height + VerticalScroll.LargeChange; + } + else + { + VerticalScroll.Enabled = false; - if (drawnSize.Width > ClientSize.Width) - { - HorizontalScroll.Enabled = true; + VerticalScroll.Value = VerticalScroll.Minimum; + } - HorizontalScroll.LargeChange = ClientSize.Width; - HorizontalScroll.Maximum = drawnSize.Width - ClientSize.Width + HorizontalScroll.LargeChange; - } - else - { - HorizontalScroll.Enabled = false; + if (drawnSize.Width > ClientSize.Width) + { + HorizontalScroll.Enabled = true; - HorizontalScroll.Value = HorizontalScroll.Minimum; - } + HorizontalScroll.LargeChange = ClientSize.Width; + HorizontalScroll.Maximum = drawnSize.Width - ClientSize.Width + HorizontalScroll.LargeChange; } - catch (Exception) + else { - Debug.Assert(false); + HorizontalScroll.Enabled = false; - throw; + HorizontalScroll.Value = HorizontalScroll.Minimum; } } @@ -759,5 +711,17 @@ public void ClearSelection() //Invalidate(); } + + /// + /// Resets the control to the initial state. + /// + public void Reset() + { + ClearSelection(); + + editBox.Visible = false; + + VerticalScroll.Value = VerticalScroll.Minimum; + } } } From 74d6ccf6f45aa6637a355fc33c3970b038548b90 Mon Sep 17 00:00:00 2001 From: KN4CK3R Date: Thu, 16 May 2019 11:02:54 +0200 Subject: [PATCH 077/223] Initialize the PointerNode with a class instance because this is the average use case. (Fixes #112) --- ReClass.NET/Nodes/PointerNode.cs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/ReClass.NET/Nodes/PointerNode.cs b/ReClass.NET/Nodes/PointerNode.cs index 584a1f3f..d84ef2f6 100644 --- a/ReClass.NET/Nodes/PointerNode.cs +++ b/ReClass.NET/Nodes/PointerNode.cs @@ -18,6 +18,15 @@ public PointerNode() LevelsOpen.DefaultValue = true; } + public override void Initialize() + { + var node = new ClassInstanceNode(); + node.Initialize(); + ((BaseContainerNode)node.InnerNode).AddBytes(16 * IntPtr.Size); + + ChangeInnerNode(node); + } + public override void GetUserInterfaceInfo(out string name, out Image icon) { name = "Pointer"; From 7710bedb280f94a6e6587ec94411f1bd292a512d Mon Sep 17 00:00:00 2001 From: KN4CK3R Date: Thu, 16 May 2019 11:47:02 +0200 Subject: [PATCH 078/223] Decoupled address parsing from ClassNode. --- ReClass.NET/Forms/MainForm.cs | 17 +++++++++--- ReClass.NET/Nodes/ClassNode.cs | 38 ++------------------------ ReClass.NET/UI/LinkedWindowFeatures.cs | 6 ++-- 3 files changed, 19 insertions(+), 42 deletions(-) diff --git a/ReClass.NET/Forms/MainForm.cs b/ReClass.NET/Forms/MainForm.cs index e230d942..0ea6c239 100644 --- a/ReClass.NET/Forms/MainForm.cs +++ b/ReClass.NET/Forms/MainForm.cs @@ -7,6 +7,7 @@ using System.Threading; using System.Threading.Tasks; using System.Windows.Forms; +using ReClassNET.AddressParser; using ReClassNET.CodeGenerator; using ReClassNET.Core; using ReClassNET.DataExchange.ReClass; @@ -994,16 +995,24 @@ private void memoryViewControl_DrawContextRequested(object sender, DrawContextRe var classNode = CurrentClassNode; if (classNode != null) { - classNode.UpdateAddress(process); - memoryViewBuffer.Size = classNode.MemorySize; - memoryViewBuffer.UpdateFrom(process, classNode.Address); + + IntPtr address; + try + { + address = process.ParseAddress(classNode.AddressFormula); + } + catch (ParseException) + { + address = IntPtr.Zero; + } + memoryViewBuffer.UpdateFrom(process, address); args.Settings = Program.Settings; args.Process = process; args.Memory = memoryViewBuffer; args.Node = classNode; - args.BaseAddress = classNode.Address; + args.BaseAddress = address; } } } diff --git a/ReClass.NET/Nodes/ClassNode.cs b/ReClass.NET/Nodes/ClassNode.cs index a0642a49..49442810 100644 --- a/ReClass.NET/Nodes/ClassNode.cs +++ b/ReClass.NET/Nodes/ClassNode.cs @@ -1,13 +1,8 @@ using System; -using System.Collections.Generic; using System.Diagnostics.Contracts; using System.Drawing; using System.Linq; -using ReClassNET.AddressParser; -using ReClassNET.Extensions; -using ReClassNET.Memory; using ReClassNET.UI; -using ReClassNET.Util; namespace ReClassNET.Nodes { @@ -19,8 +14,10 @@ public class ClassNode : BaseContainerNode #if RECLASSNET64 public static IntPtr DefaultAddress { get; } = (IntPtr)0x140000000; + public static string DefaultAddressFormula { get; } = "140000000"; #else public static IntPtr DefaultAddress { get; } = (IntPtr)0x400000; + public static string DefaultAddressFormula { get; } = "400000"; #endif public override int MemorySize => Nodes.Sum(n => n.MemorySize); @@ -39,20 +36,7 @@ public NodeUuid Uuid } } - private IntPtr address; - - public IntPtr Address - { - get => address; - set - { - Contract.Ensures(AddressFormula != null); - address = value; - AddressFormula = value.ToString("X"); - } - } - - public string AddressFormula { get; set; } + public string AddressFormula { get; set; } = DefaultAddressFormula; public event NodeEventHandler NodesChanged; @@ -64,8 +48,6 @@ internal ClassNode(bool notifyClassCreated) Uuid = new NodeUuid(true); - Address = DefaultAddress; - if (notifyClassCreated) { ClassCreated?.Invoke(this); @@ -208,20 +190,6 @@ public override void Update(HotSpot spot) } } - public void UpdateAddress(RemoteProcess process) - { - Contract.Requires(process != null); - - try - { - address = process.ParseAddress(AddressFormula); - } - catch (ParseException) - { - Address = IntPtr.Zero; - } - } - protected internal override void ChildHasChanged(BaseNode child) { NodesChanged?.Invoke(this); diff --git a/ReClass.NET/UI/LinkedWindowFeatures.cs b/ReClass.NET/UI/LinkedWindowFeatures.cs index 02f3f3e9..14eeb691 100644 --- a/ReClass.NET/UI/LinkedWindowFeatures.cs +++ b/ReClass.NET/UI/LinkedWindowFeatures.cs @@ -22,10 +22,10 @@ public static ClassNode CreateClassAtAddress(IntPtr address, bool addDefaultByte var classView = Program.MainForm.ProjectView; var node = ClassNode.Create(); - node.Address = address; + node.AddressFormula = address.ToString("X"); if (addDefaultBytes) { - node.AddBytes(64); + node.AddBytes(16 * IntPtr.Size); } classView.SelectedClass = node; @@ -56,7 +56,7 @@ public static void SetCurrentClassAddress(IntPtr address) return; } - classNode.Address = address; + classNode.AddressFormula = address.ToString("X"); } public static void FindWhatInteractsWithAddress(IntPtr address, int size, bool writeOnly) From 5849827e0a15224396cebfb1a3ba056eb3c9f447 Mon Sep 17 00:00:00 2001 From: KN4CK3R Date: Tue, 18 Jun 2019 20:28:46 +0200 Subject: [PATCH 079/223] Updated to VS2019. --- NativeCore/Windows/NativeCore.vcxproj | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/NativeCore/Windows/NativeCore.vcxproj b/NativeCore/Windows/NativeCore.vcxproj index 6af17c1f..b2b2b2d8 100644 --- a/NativeCore/Windows/NativeCore.vcxproj +++ b/NativeCore/Windows/NativeCore.vcxproj @@ -22,32 +22,32 @@ {22CA6FDB-7622-4F94-8FC2-2E7AB481C86F} Win32Proj NativeCore - 10.0.17134.0 + 10.0 DynamicLibrary true - v141 + v142 Unicode DynamicLibrary false - v141 + v142 true MultiByte DynamicLibrary true - v141 + v142 MultiByte DynamicLibrary false - v141 + v142 true MultiByte From 76c75306f615e1cf9c78b50e59c203a8eb75fce2 Mon Sep 17 00:00:00 2001 From: KN4CK3R Date: Tue, 18 Jun 2019 20:29:06 +0200 Subject: [PATCH 080/223] Added RemoteMemoryReader parameter. --- ReClass.NET/Nodes/BaseHexCommentNode.cs | 2 +- ReClass.NET/Nodes/INodeInfoReader.cs | 10 ++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/ReClass.NET/Nodes/BaseHexCommentNode.cs b/ReClass.NET/Nodes/BaseHexCommentNode.cs index 063dd8c5..6754358e 100644 --- a/ReClass.NET/Nodes/BaseHexCommentNode.cs +++ b/ReClass.NET/Nodes/BaseHexCommentNode.cs @@ -85,7 +85,7 @@ protected int AddComment(ViewInfo view, int x, int y, float fvalue, IntPtr ivalu foreach (var reader in NodeInfoReader) { - var info = reader.ReadNodeInfo(this, nodeAddress, ivalue, view.Memory); + var info = reader.ReadNodeInfo(this, view.Process, view.Memory, nodeAddress, ivalue); if (info != null) { x = AddText(view, x, y, view.Settings.PluginColor, HotSpot.ReadOnlyId, info) + view.Font.Width; diff --git a/ReClass.NET/Nodes/INodeInfoReader.cs b/ReClass.NET/Nodes/INodeInfoReader.cs index 59a3a249..75289ccf 100644 --- a/ReClass.NET/Nodes/INodeInfoReader.cs +++ b/ReClass.NET/Nodes/INodeInfoReader.cs @@ -11,19 +11,21 @@ public interface INodeInfoReader /// Used to print custom informations about a node. /// /// The node. - /// The absolute address of the node. - /// /// The memory value of the node as . + /// The current . /// The current . + /// The absolute address of the node. + /// The memory value of the node as . /// Custom informations about the node or null. - string ReadNodeInfo(BaseHexCommentNode node, IntPtr nodeAddress, IntPtr nodeValue, MemoryBuffer memory); + string ReadNodeInfo(BaseHexCommentNode node, IRemoteMemoryReader reader, MemoryBuffer memory, IntPtr nodeAddress, IntPtr nodeValue); } [ContractClassFor(typeof(INodeInfoReader))] internal abstract class NodeInfoReaderContract : INodeInfoReader { - public string ReadNodeInfo(BaseHexCommentNode node, IntPtr nodeAddress, IntPtr nodeValue, MemoryBuffer memory) + public string ReadNodeInfo(BaseHexCommentNode node, IRemoteMemoryReader reader, MemoryBuffer memory, IntPtr nodeAddress, IntPtr nodeValue) { Contract.Requires(node != null); + Contract.Requires(reader != null); Contract.Requires(memory != null); throw new NotImplementedException(); From fffad0555b74f49191657ee4afc056f9897b50b3 Mon Sep 17 00:00:00 2001 From: KN4CK3R Date: Sun, 23 Jun 2019 20:21:39 +0200 Subject: [PATCH 081/223] Made strings copyable. (#115) --- ReClass.NET/Nodes/BaseTextPtrNode.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ReClass.NET/Nodes/BaseTextPtrNode.cs b/ReClass.NET/Nodes/BaseTextPtrNode.cs index 3c108dd5..116bf166 100644 --- a/ReClass.NET/Nodes/BaseTextPtrNode.cs +++ b/ReClass.NET/Nodes/BaseTextPtrNode.cs @@ -47,7 +47,7 @@ public Size DrawText(ViewInfo view, int x, int y, string type) } x = AddText(view, x, y, view.Settings.TextColor, HotSpot.NoneId, "= '"); - x = AddText(view, x, y, view.Settings.TextColor, HotSpot.NoneId, text); + x = AddText(view, x, y, view.Settings.TextColor, HotSpot.ReadOnlyId, text); x = AddText(view, x, y, view.Settings.TextColor, HotSpot.NoneId, "'") + view.Font.Width; x = AddComment(view, x, y); From c19403b6021498d578a11009d3b4a3f2c6f2ce79 Mon Sep 17 00:00:00 2001 From: KN4CK3R Date: Sun, 23 Jun 2019 20:35:26 +0200 Subject: [PATCH 082/223] Increased read character count (#115). --- ReClass.NET/Memory/RemoteProcess.cs | 2 +- ReClass.NET/Nodes/BaseTextPtrNode.cs | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/ReClass.NET/Memory/RemoteProcess.cs b/ReClass.NET/Memory/RemoteProcess.cs index 3c04c8fa..8c65e2e2 100644 --- a/ReClass.NET/Memory/RemoteProcess.cs +++ b/ReClass.NET/Memory/RemoteProcess.cs @@ -296,7 +296,7 @@ public string ReadRemoteString(Encoding encoding, IntPtr address, int length) var sb = new StringBuilder(encoding.GetString(data)); for (var i = 0; i < sb.Length; ++i) { - if (sb[i] == 0) + if (sb[i] == '\0') { sb.Length = i; break; diff --git a/ReClass.NET/Nodes/BaseTextPtrNode.cs b/ReClass.NET/Nodes/BaseTextPtrNode.cs index 116bf166..d7f8bee9 100644 --- a/ReClass.NET/Nodes/BaseTextPtrNode.cs +++ b/ReClass.NET/Nodes/BaseTextPtrNode.cs @@ -8,6 +8,8 @@ namespace ReClassNET.Nodes { public abstract class BaseTextPtrNode : BaseNode { + private const int MaxStringCharacterCount = 256; + public override int MemorySize => IntPtr.Size; /// The encoding of the string. @@ -30,7 +32,7 @@ public Size DrawText(ViewInfo view, int x, int y, string type) } var ptr = view.Memory.ReadIntPtr(Offset); - var text = view.Process.ReadRemoteString(Encoding, ptr, 64); + var text = view.Process.ReadRemoteString(Encoding, ptr, MaxStringCharacterCount); var origX = x; From 28515e2c455efefd1bcd72ef818773fef160056f Mon Sep 17 00:00:00 2001 From: KN4CK3R Date: Sun, 23 Jun 2019 20:41:27 +0200 Subject: [PATCH 083/223] Made just the string selectable. --- ReClass.NET/Nodes/BaseHexCommentNode.cs | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/ReClass.NET/Nodes/BaseHexCommentNode.cs b/ReClass.NET/Nodes/BaseHexCommentNode.cs index 6754358e..d58e7652 100644 --- a/ReClass.NET/Nodes/BaseHexCommentNode.cs +++ b/ReClass.NET/Nodes/BaseHexCommentNode.cs @@ -66,16 +66,26 @@ protected int AddComment(ViewInfo view, int x, int y, float fvalue, IntPtr ivalu { var data = view.Process.ReadRemoteMemory(ivalue, 64); + var isWideString = false; + string text = null; + // First check if it could be an UTF8 string and if not try UTF16. if (data.Take(IntPtr.Size).InterpretAsSingleByteCharacter().IsPrintableData()) { - var text = new string(Encoding.UTF8.GetChars(data).TakeWhile(c => c != 0).ToArray()); - x = AddText(view, x, y, view.Settings.TextColor, HotSpot.ReadOnlyId, $"'{text}'") + view.Font.Width; + text = new string(Encoding.UTF8.GetChars(data).TakeWhile(c => c != 0).ToArray()); } else if(data.Take(IntPtr.Size * 2).InterpretAsDoubleByteCharacter().IsPrintableData()) { - var text = new string(Encoding.Unicode.GetChars(data).TakeWhile(c => c != 0).ToArray()); - x = AddText(view, x, y, view.Settings.TextColor, HotSpot.ReadOnlyId, $"L'{text}'") + view.Font.Width; + isWideString = true; + + text = new string(Encoding.Unicode.GetChars(data).TakeWhile(c => c != 0).ToArray()); + } + + if (text != null) + { + x = AddText(view, x, y, view.Settings.TextColor, HotSpot.NoneId, isWideString ? "L'" : "'"); + x = AddText(view, x, y, view.Settings.TextColor, HotSpot.ReadOnlyId, text); + x = AddText(view, x, y, view.Settings.TextColor, HotSpot.NoneId, "'") + view.Font.Width; } } From 3147cebd2936c24e88b7a3ed6f9d0821f6acf0c2 Mon Sep 17 00:00:00 2001 From: KN4CK3R Date: Sun, 30 Jun 2019 22:51:30 +0200 Subject: [PATCH 084/223] Added TryGetHexString tests. --- ReClass.NET/Extensions/StringExtensions.cs | 6 ++++-- .../Extensions/StringExtensionTest.cs | 19 +++++++++++++++++++ 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/ReClass.NET/Extensions/StringExtensions.cs b/ReClass.NET/Extensions/StringExtensions.cs index 31baa487..51ae20d2 100644 --- a/ReClass.NET/Extensions/StringExtensions.cs +++ b/ReClass.NET/Extensions/StringExtensions.cs @@ -97,10 +97,12 @@ public static string LimitLength(this string s, int length) return s.Substring(0, length); } - private static readonly Regex HexRegex = new Regex("(0x|h)?([0-9A-F]+)", RegexOptions.Compiled | RegexOptions.IgnoreCase); + private static readonly Regex hexadecimalValueRegex = new Regex("^(0x|h)?([0-9A-F]+)$", RegexOptions.Compiled | RegexOptions.IgnoreCase); public static bool TryGetHexString(this string s, out string value) { - var match = HexRegex.Match(s); + Contract.Requires(s != null); + + var match = hexadecimalValueRegex.Match(s); value = match.Success ? match.Groups[2].Value : null; return match.Success; diff --git a/ReClass.NET_Tests/Extensions/StringExtensionTest.cs b/ReClass.NET_Tests/Extensions/StringExtensionTest.cs index 0166d90a..f1a0fcde 100644 --- a/ReClass.NET_Tests/Extensions/StringExtensionTest.cs +++ b/ReClass.NET_Tests/Extensions/StringExtensionTest.cs @@ -146,5 +146,24 @@ public void TestIsNotLikelyPrintableData(params char[] sut) { Check.That(sut.IsPrintableData()).IsFalse(); } + + [Theory] + [InlineData("", false, null)] + [InlineData("-", false, null)] + [InlineData("-0", false, null)] + [InlineData("-0x0", false, null)] + [InlineData("-h0", false, null)] + [InlineData("0", true, "0")] + [InlineData("h0", true, "0")] + [InlineData("0x0", true, "0")] + [InlineData("0123456789abcdef", true, "0123456789abcdef")] + [InlineData("h0123456789abcdef", true, "0123456789abcdef")] + [InlineData("0x0123456789abcdef", true, "0123456789abcdef")] + [InlineData("0123456789ABCDEF", true, "0123456789ABCDEF")] + public void TestTryGetHexString(string input, bool expectedResult, string expectedValue) + { + Check.That(input.TryGetHexString(out var value)).IsEqualTo(expectedResult); + Check.That(value).IsEqualTo(expectedValue); + } } } From 0be7a4349fce1a1a6254a624f9def8e7c6f43c91 Mon Sep 17 00:00:00 2001 From: KN4CK3R Date: Thu, 4 Jul 2019 22:09:05 +0200 Subject: [PATCH 085/223] Changed method name. --- ReClass.NET/Extensions/IntPtrExtensions.cs | 6 +++--- ReClass.NET/MemoryScanner/Scanner.cs | 10 +++++----- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/ReClass.NET/Extensions/IntPtrExtensions.cs b/ReClass.NET/Extensions/IntPtrExtensions.cs index e98eee15..b592914b 100644 --- a/ReClass.NET/Extensions/IntPtrExtensions.cs +++ b/ReClass.NET/Extensions/IntPtrExtensions.cs @@ -20,7 +20,7 @@ public static bool MayBeValid(this IntPtr ptr) #if RECLASSNET64 return ptr.InRange((IntPtr)0x10000, (IntPtr)long.MaxValue); #else - return ptr.InRange((IntPtr)0x10000, (IntPtr)int.MaxValue); + return ptr.IsInRange((IntPtr)0x10000, (IntPtr)int.MaxValue); #endif } @@ -94,7 +94,7 @@ public static IntPtr Negate(this IntPtr ptr) [Pure] [DebuggerStepThrough] - public static bool InRange(this IntPtr address, IntPtr start, IntPtr end) + public static bool IsInRange(this IntPtr address, IntPtr start, IntPtr end) { #if RECLASSNET64 var val = (ulong)address.ToInt64(); @@ -120,7 +120,7 @@ public static int CompareTo(this IntPtr lhs, IntPtr rhs) [DebuggerStepThrough] public static int CompareToRange(this IntPtr address, IntPtr start, IntPtr end) { - if (InRange(address, start, end)) + if (IsInRange(address, start, end)) { return 0; } diff --git a/ReClass.NET/MemoryScanner/Scanner.cs b/ReClass.NET/MemoryScanner/Scanner.cs index 9f0aa41e..ee0820fc 100644 --- a/ReClass.NET/MemoryScanner/Scanner.cs +++ b/ReClass.NET/MemoryScanner/Scanner.cs @@ -122,9 +122,9 @@ private IList
GetSearchableSections() return process.Sections .Where(s => !s.Protection.HasFlag(SectionProtection.Guard)) - .Where(s => s.Start.InRange(Settings.StartAddress, Settings.StopAddress) - || Settings.StartAddress.InRange(s.Start, s.End) - || Settings.StopAddress.InRange(s.Start, s.End)) + .Where(s => s.Start.IsInRange(Settings.StartAddress, Settings.StopAddress) + || Settings.StartAddress.IsInRange(s.Start, s.End) + || Settings.StopAddress.IsInRange(s.Start, s.End)) .Where(s => { switch (s.Type) @@ -228,12 +228,12 @@ private Task FirstScan(IScanComparer comparer, IProgress progress, Ca var end = s.Address + s.Size; var size = s.Size; - if (Settings.StartAddress.InRange(start, end)) + if (Settings.StartAddress.IsInRange(start, end)) { size = size - Settings.StartAddress.Sub(start).ToInt32(); start = Settings.StartAddress; } - if (Settings.StopAddress.InRange(start, end)) + if (Settings.StopAddress.IsInRange(start, end)) { size = size - end.Sub(Settings.StopAddress).ToInt32(); } From af380879e748ed4f56d7c795d35ce00d95a7cb82 Mon Sep 17 00:00:00 2001 From: KN4CK3R Date: Thu, 4 Jul 2019 22:45:25 +0200 Subject: [PATCH 086/223] Added tests for IntPtrExtension. --- ReClass.NET/Extensions/IntPtrExtensions.cs | 4 + .../Extensions/IntPtrExtensionTest.cs | 103 ++++++++++++++++++ ReClass.NET_Tests/ReClass.NET_Tests.csproj | 1 + 3 files changed, 108 insertions(+) create mode 100644 ReClass.NET_Tests/Extensions/IntPtrExtensionTest.cs diff --git a/ReClass.NET/Extensions/IntPtrExtensions.cs b/ReClass.NET/Extensions/IntPtrExtensions.cs index b592914b..88c73773 100644 --- a/ReClass.NET/Extensions/IntPtrExtensions.cs +++ b/ReClass.NET/Extensions/IntPtrExtensions.cs @@ -156,11 +156,15 @@ public static long ToInt64Bits(this IntPtr ptr) #endif } + [Pure] + [DebuggerStepThrough] public static IntPtr From(int value) { return (IntPtr)value; } + [Pure] + [DebuggerStepThrough] public static IntPtr From(long value) { #if RECLASSNET64 diff --git a/ReClass.NET_Tests/Extensions/IntPtrExtensionTest.cs b/ReClass.NET_Tests/Extensions/IntPtrExtensionTest.cs new file mode 100644 index 00000000..786c681f --- /dev/null +++ b/ReClass.NET_Tests/Extensions/IntPtrExtensionTest.cs @@ -0,0 +1,103 @@ +using System; +using NFluent; +using ReClassNET.Extensions; +using Xunit; + +namespace ReClass.NET_Tests.Extensions +{ + public class IntPtrExtensionTest + { + public static TheoryData GetTestIsNullData => new TheoryData + { + { IntPtr.Zero, true }, + { (IntPtr)1, false } + }; + + [Theory] + [MemberData(nameof(GetTestIsNullData))] + public void TestIsNull(IntPtr ptr, bool expected) + { + Check.That(ptr.IsNull()).IsEqualTo(expected); + } + + public static TheoryData GetTestMayBeValidData => new TheoryData + { + { IntPtr.Zero, false }, + { (IntPtr)1, false }, + { (IntPtr)0x10000, true }, + { (IntPtr)int.MaxValue, true }, +#if RECLASSNET64 + { (IntPtr)long.MaxValue + 1, false } +#else + { (IntPtr)int.MaxValue + 1, false } +#endif + }; + + [Theory] + [MemberData(nameof(GetTestMayBeValidData))] + public void TestMayBeValid(IntPtr ptr, bool expected) + { + Check.That(ptr.MayBeValid()).IsEqualTo(expected); + } + + public static TheoryData GetTestIsInRangeData => new TheoryData + { + { (IntPtr)10, (IntPtr)100, (IntPtr)1000, false }, + { (IntPtr)100, (IntPtr)100, (IntPtr)1000, true }, + { (IntPtr)500, (IntPtr)100, (IntPtr)1000, true }, + { (IntPtr)1000, (IntPtr)100, (IntPtr)1000, true }, + { (IntPtr)1500, (IntPtr)100, (IntPtr)1000, false } + }; + + [Theory] + [MemberData(nameof(GetTestIsInRangeData))] + public void TestIsInRange(IntPtr ptr, IntPtr start, IntPtr end, bool expected) + { + Check.That(ptr.IsInRange(start, end)).IsEqualTo(expected); + } + + public static TheoryData GetTestCompareToData => new TheoryData + { + { (IntPtr)10, (IntPtr)100, -1 }, + { (IntPtr)100, (IntPtr)100, 0 }, + { (IntPtr)500, (IntPtr)100, 1 } + }; + + [Theory] + [MemberData(nameof(GetTestCompareToData))] + public void TestCompareTo(IntPtr ptr, IntPtr other, int expected) + { + Check.That(ptr.CompareTo(other)).IsEqualTo(expected); + } + + public static TheoryData GetTestCompareToRangeData => new TheoryData + { + { (IntPtr)10, (IntPtr)100, (IntPtr)1000, -1 }, + { (IntPtr)100, (IntPtr)100, (IntPtr)1000, 0 }, + { (IntPtr)500, (IntPtr)100, (IntPtr)1000, 0 }, + { (IntPtr)1000, (IntPtr)100, (IntPtr)1000, 0 }, + { (IntPtr)1500, (IntPtr)100, (IntPtr)1000, 1 } + }; + + [Theory] + [MemberData(nameof(GetTestCompareToRangeData))] + public void TestCompareToRange(IntPtr ptr, IntPtr start, IntPtr end, int expected) + { + Check.That(ptr.CompareToRange(start, end)).IsEqualTo(expected); + } + + public static TheoryData GetTestToInt64BitsData => new TheoryData + { + { (IntPtr)0x10, 0x10L }, + { (IntPtr)int.MaxValue, 0x7FFF_FFFFL }, + { (IntPtr)int.MaxValue + 1, 0x8000_0000L } + }; + + [Theory] + [MemberData(nameof(GetTestToInt64BitsData))] + public void TestToInt64Bits(IntPtr ptr, long expected) + { + Check.That(ptr.ToInt64Bits()).IsEqualTo(expected); + } + } +} diff --git a/ReClass.NET_Tests/ReClass.NET_Tests.csproj b/ReClass.NET_Tests/ReClass.NET_Tests.csproj index f205bfcc..3494eb4c 100644 --- a/ReClass.NET_Tests/ReClass.NET_Tests.csproj +++ b/ReClass.NET_Tests/ReClass.NET_Tests.csproj @@ -73,6 +73,7 @@ + From 8f9b29ca81dccd1cf64f26a06657fb98ebaae515 Mon Sep 17 00:00:00 2001 From: KN4CK3R Date: Mon, 8 Jul 2019 22:35:45 +0200 Subject: [PATCH 087/223] Implemented IEquatable. --- ReClass.NET/MemoryScanner/ScanResult.cs | 137 ++++++++++++++++++++++-- 1 file changed, 129 insertions(+), 8 deletions(-) diff --git a/ReClass.NET/MemoryScanner/ScanResult.cs b/ReClass.NET/MemoryScanner/ScanResult.cs index cad1b337..6ebd4766 100644 --- a/ReClass.NET/MemoryScanner/ScanResult.cs +++ b/ReClass.NET/MemoryScanner/ScanResult.cs @@ -1,5 +1,6 @@ using System; using System.Diagnostics.Contracts; +using System.Linq; using System.Text; namespace ReClassNET.MemoryScanner @@ -13,7 +14,7 @@ public abstract class ScanResult public abstract ScanResult Clone(); } - public class ByteScanResult : ScanResult + public class ByteScanResult : ScanResult, IEquatable { public override ScanValueType ValueType => ScanValueType.Byte; @@ -28,9 +29,24 @@ public override ScanResult Clone() { return new ByteScanResult(Value) { Address = Address }; } + + public override bool Equals(object obj) + { + return Equals(obj as ByteScanResult); + } + + public bool Equals(ByteScanResult other) + { + return other != null && Address == other.Address && Value == other.Value; + } + + public override int GetHashCode() + { + return Address.GetHashCode() * 19 + Value.GetHashCode(); + } } - public class ShortScanResult : ScanResult + public class ShortScanResult : ScanResult, IEquatable { public override ScanValueType ValueType => ScanValueType.Short; @@ -45,9 +61,24 @@ public override ScanResult Clone() { return new ShortScanResult(Value) { Address = Address }; } + + public override bool Equals(object obj) + { + return Equals(obj as ShortScanResult); + } + + public bool Equals(ShortScanResult other) + { + return other != null && Address == other.Address && Value == other.Value; + } + + public override int GetHashCode() + { + return Address.GetHashCode() * 19 + Value.GetHashCode(); + } } - public class IntegerScanResult : ScanResult + public class IntegerScanResult : ScanResult, IEquatable { public override ScanValueType ValueType => ScanValueType.Integer; @@ -62,9 +93,24 @@ public override ScanResult Clone() { return new IntegerScanResult(Value) { Address = Address }; } + + public override bool Equals(object obj) + { + return Equals(obj as IntegerScanResult); + } + + public bool Equals(IntegerScanResult other) + { + return other != null && Address == other.Address && Value == other.Value; + } + + public override int GetHashCode() + { + return Address.GetHashCode() * 19 + Value.GetHashCode(); + } } - public class LongScanResult : ScanResult + public class LongScanResult : ScanResult, IEquatable { public override ScanValueType ValueType => ScanValueType.Long; @@ -79,9 +125,24 @@ public override ScanResult Clone() { return new LongScanResult(Value) { Address = Address }; } + + public override bool Equals(object obj) + { + return Equals(obj as LongScanResult); + } + + public bool Equals(LongScanResult other) + { + return other != null && Address == other.Address && Value == other.Value; + } + + public override int GetHashCode() + { + return Address.GetHashCode() * 19 + Value.GetHashCode(); + } } - public class FloatScanResult : ScanResult + public class FloatScanResult : ScanResult, IEquatable { public override ScanValueType ValueType => ScanValueType.Float; @@ -96,9 +157,24 @@ public override ScanResult Clone() { return new FloatScanResult(Value) { Address = Address }; } + + public override bool Equals(object obj) + { + return Equals(obj as FloatScanResult); + } + + public bool Equals(FloatScanResult other) + { + return other != null && Address == other.Address && Value == other.Value; + } + + public override int GetHashCode() + { + return Address.GetHashCode() * 19 + Value.GetHashCode(); + } } - public class DoubleScanResult : ScanResult + public class DoubleScanResult : ScanResult, IEquatable { public override ScanValueType ValueType => ScanValueType.Double; @@ -113,9 +189,24 @@ public override ScanResult Clone() { return new DoubleScanResult(Value) { Address = Address }; } + + public override bool Equals(object obj) + { + return Equals(obj as DoubleScanResult); + } + + public bool Equals(DoubleScanResult other) + { + return other != null && Address == other.Address && Value == other.Value; + } + + public override int GetHashCode() + { + return Address.GetHashCode() * 19 + Value.GetHashCode(); + } } - public class ArrayOfBytesScanResult : ScanResult + public class ArrayOfBytesScanResult : ScanResult, IEquatable { public override ScanValueType ValueType => ScanValueType.ArrayOfBytes; @@ -132,9 +223,24 @@ public override ScanResult Clone() { return new ArrayOfBytesScanResult(Value) { Address = Address }; } + + public override bool Equals(object obj) + { + return Equals(obj as ArrayOfBytesScanResult); + } + + public bool Equals(ArrayOfBytesScanResult other) + { + return other != null && Address == other.Address && Enumerable.SequenceEqual(Value, other.Value); + } + + public override int GetHashCode() + { + return Address.GetHashCode() * 19 + Value.GetHashCode(); + } } - public class StringScanResult : ScanResult + public class StringScanResult : ScanResult, IEquatable { public override ScanValueType ValueType => ScanValueType.String; @@ -155,5 +261,20 @@ public override ScanResult Clone() { return new StringScanResult(Value, Encoding) { Address = Address }; } + + public override bool Equals(object obj) + { + return Equals(obj as StringScanResult); + } + + public bool Equals(StringScanResult other) + { + return other != null && Address == other.Address && Value == other.Value && Encoding.Equals(other.Encoding); + } + + public override int GetHashCode() + { + return Address.GetHashCode() * 19 + Value.GetHashCode() * 19 + Encoding.GetHashCode(); + } } } From 55815f236a63bb0c1a36a376324f05673a73b827 Mon Sep 17 00:00:00 2001 From: KN4CK3R Date: Mon, 8 Jul 2019 22:36:47 +0200 Subject: [PATCH 088/223] Added tests for IntegerMemoryComparer. --- .../Comparer/IntegerMemoryComparer.cs | 153 ++++++++-------- .../Comparer/IntegerMemoryComparerTest.cs | 166 ++++++++++++++++++ ReClass.NET_Tests/ReClass.NET_Tests.csproj | 1 + 3 files changed, 244 insertions(+), 76 deletions(-) create mode 100644 ReClass.NET_Tests/MemoryScanner/Comparer/IntegerMemoryComparerTest.cs diff --git a/ReClass.NET/MemoryScanner/Comparer/IntegerMemoryComparer.cs b/ReClass.NET/MemoryScanner/Comparer/IntegerMemoryComparer.cs index 3a8b97ba..aefd4235 100644 --- a/ReClass.NET/MemoryScanner/Comparer/IntegerMemoryComparer.cs +++ b/ReClass.NET/MemoryScanner/Comparer/IntegerMemoryComparer.cs @@ -29,45 +29,37 @@ public IntegerMemoryComparer(ScanCompareType compareType, int value1, int value2 public bool Compare(byte[] data, int index, out ScanResult result) { - result = null; - - var value = BitConverter.ToInt32(data, index); - - bool IsMatch() - { - switch (CompareType) + return CompareInternal( + data, + index, + value => { - case ScanCompareType.Equal: - return value == Value1; - case ScanCompareType.NotEqual: - return value != Value1; - case ScanCompareType.GreaterThan: - return value > Value1; - case ScanCompareType.GreaterThanOrEqual: - return value >= Value1; - case ScanCompareType.LessThan: - return value < Value1; - case ScanCompareType.LessThanOrEqual: - return value <= Value1; - case ScanCompareType.Between: - return Value1 < value && value < Value2; - case ScanCompareType.BetweenOrEqual: - return Value1 <= value && value <= Value2; - case ScanCompareType.Unknown: - return true; - default: - throw new InvalidCompareTypeException(CompareType); - } - } - - if (!IsMatch()) - { - return false; - } - - result = new IntegerScanResult(value); - - return true; + switch (CompareType) + { + case ScanCompareType.Equal: + return value == Value1; + case ScanCompareType.NotEqual: + return value != Value1; + case ScanCompareType.GreaterThan: + return value > Value1; + case ScanCompareType.GreaterThanOrEqual: + return value >= Value1; + case ScanCompareType.LessThan: + return value < Value1; + case ScanCompareType.LessThanOrEqual: + return value <= Value1; + case ScanCompareType.Between: + return Value1 < value && value < Value2; + case ScanCompareType.BetweenOrEqual: + return Value1 <= value && value <= Value2; + case ScanCompareType.Unknown: + return true; + default: + throw new InvalidCompareTypeException(CompareType); + } + }, + out result + ); } public bool Compare(byte[] data, int index, ScanResult previous, out ScanResult result) @@ -80,49 +72,58 @@ public bool Compare(byte[] data, int index, ScanResult previous, out ScanResult } public bool Compare(byte[] data, int index, IntegerScanResult previous, out ScanResult result) + { + return CompareInternal( + data, + index, + value => + { + switch (CompareType) + { + case ScanCompareType.Equal: + return value == Value1; + case ScanCompareType.NotEqual: + return value != Value1; + case ScanCompareType.GreaterThan: + return value > Value1; + case ScanCompareType.GreaterThanOrEqual: + return value >= Value1; + case ScanCompareType.LessThan: + return value < Value1; + case ScanCompareType.LessThanOrEqual: + return value <= Value1; + case ScanCompareType.Between: + return Value1 < value && value < Value2; + case ScanCompareType.BetweenOrEqual: + return Value1 <= value && value <= Value2; + + case ScanCompareType.Changed: + return value != previous.Value; + case ScanCompareType.NotChanged: + return value == previous.Value; + case ScanCompareType.Increased: + return value > previous.Value; + case ScanCompareType.IncreasedOrEqual: + return value >= previous.Value; + case ScanCompareType.Decreased: + return value < previous.Value; + case ScanCompareType.DecreasedOrEqual: + return value <= previous.Value; + default: + throw new InvalidCompareTypeException(CompareType); + } + }, + out result + ); + } + + private static bool CompareInternal(byte[] data, int index, Func matcher, out ScanResult result) { result = null; var value = BitConverter.ToInt32(data, index); - bool IsMatch() - { - switch (CompareType) - { - case ScanCompareType.Equal: - return value == Value1; - case ScanCompareType.NotEqual: - return value != Value1; - case ScanCompareType.Changed: - return value != previous.Value; - case ScanCompareType.NotChanged: - return value == previous.Value; - case ScanCompareType.GreaterThan: - return value > Value1; - case ScanCompareType.GreaterThanOrEqual: - return value >= Value1; - case ScanCompareType.Increased: - return value > previous.Value; - case ScanCompareType.IncreasedOrEqual: - return value >= previous.Value; - case ScanCompareType.LessThan: - return value < Value1; - case ScanCompareType.LessThanOrEqual: - return value <= Value1; - case ScanCompareType.Decreased: - return value < previous.Value; - case ScanCompareType.DecreasedOrEqual: - return value <= previous.Value; - case ScanCompareType.Between: - return Value1 < value && value < Value2; - case ScanCompareType.BetweenOrEqual: - return Value1 <= value && value <= Value2; - default: - throw new InvalidCompareTypeException(CompareType); - } - } - - if (!IsMatch()) + if (!matcher(value)) { return false; } diff --git a/ReClass.NET_Tests/MemoryScanner/Comparer/IntegerMemoryComparerTest.cs b/ReClass.NET_Tests/MemoryScanner/Comparer/IntegerMemoryComparerTest.cs new file mode 100644 index 00000000..027432bc --- /dev/null +++ b/ReClass.NET_Tests/MemoryScanner/Comparer/IntegerMemoryComparerTest.cs @@ -0,0 +1,166 @@ +using System; +using NFluent; +using ReClassNET.MemoryScanner; +using ReClassNET.MemoryScanner.Comparer; +using Xunit; + +namespace ReClass.NET_Tests.MemoryScanner.Comparer +{ + public class IntegerMemoryComparerTest + { + [Theory] + [InlineData(ScanCompareType.Equal, 0, 0)] + [InlineData(ScanCompareType.Equal, 1, 2)] + [InlineData(ScanCompareType.Equal, 2, 1)] + [InlineData(ScanCompareType.Between, 2, 4)] + [InlineData(ScanCompareType.BetweenOrEqual, 4, 2)] + [InlineData(ScanCompareType.NotEqual, 0, 0)] + public void TestConstructor(ScanCompareType compareType, int value1, int value2) + { + var sut = new IntegerMemoryComparer(compareType, value1, value2); + + Check.That(sut.CompareType).IsEqualTo(compareType); + Check.That(sut.ValueSize).IsEqualTo(sizeof(int)); + Check.That(sut.Value1).IsOneOf(value1, value2); + Check.That(sut.Value2).IsOneOf(value1, value2); + if (compareType == ScanCompareType.Between || compareType == ScanCompareType.BetweenOrEqual) + { + Check.That(sut.Value1 <= sut.Value2).IsTrue(); + } + } + + public static TheoryData GetTestCompareBasicData() => new TheoryData + { + { ScanCompareType.Equal, 0, 0, BitConverter.GetBytes(0), true, new IntegerScanResult(0) }, + { ScanCompareType.Equal, 0, 0, BitConverter.GetBytes(1), false, null }, + { ScanCompareType.Equal, 1, 0, BitConverter.GetBytes(1), true, new IntegerScanResult(1) }, + { ScanCompareType.Equal, 1, 0, BitConverter.GetBytes(0), false, null }, + { ScanCompareType.NotEqual, 1, 0, BitConverter.GetBytes(0), true, new IntegerScanResult(0) }, + { ScanCompareType.NotEqual, 1, 0, BitConverter.GetBytes(1), false, null }, + { ScanCompareType.GreaterThan, 1, 0, BitConverter.GetBytes(0), false, null }, + { ScanCompareType.GreaterThan, 1, 0, BitConverter.GetBytes(2), true, new IntegerScanResult(2) }, + { ScanCompareType.GreaterThanOrEqual, 1, 0, BitConverter.GetBytes(0), false, null }, + { ScanCompareType.GreaterThanOrEqual, 1, 0, BitConverter.GetBytes(1), true, new IntegerScanResult(1) }, + { ScanCompareType.GreaterThanOrEqual, 1, 0, BitConverter.GetBytes(2), true, new IntegerScanResult(2) }, + { ScanCompareType.LessThan, 1, 0, BitConverter.GetBytes(1), false, null }, + { ScanCompareType.LessThan, 1, 0, BitConverter.GetBytes(0), true, new IntegerScanResult(0) }, + { ScanCompareType.LessThanOrEqual, 1, 0, BitConverter.GetBytes(2), false, null }, + { ScanCompareType.LessThanOrEqual, 1, 0, BitConverter.GetBytes(1), true, new IntegerScanResult(1) }, + { ScanCompareType.LessThanOrEqual, 1, 0, BitConverter.GetBytes(0), true, new IntegerScanResult(0) }, + { ScanCompareType.Between, 1, 2, BitConverter.GetBytes(0), false, null }, + { ScanCompareType.Between, 1, 2, BitConverter.GetBytes(1), false, null }, + { ScanCompareType.Between, 1, 2, BitConverter.GetBytes(2), false, null }, + { ScanCompareType.Between, 1, 2, BitConverter.GetBytes(3), false, null }, + { ScanCompareType.BetweenOrEqual, 1, 2, BitConverter.GetBytes(0), false, null }, + { ScanCompareType.BetweenOrEqual, 1, 2, BitConverter.GetBytes(1), true, new IntegerScanResult(1) }, + { ScanCompareType.BetweenOrEqual, 1, 2, BitConverter.GetBytes(2), true, new IntegerScanResult(2) }, + { ScanCompareType.BetweenOrEqual, 1, 2, BitConverter.GetBytes(3), false, null } + }; + + public static TheoryData GetTestCompareScanCompareTypeUnknownData() => new TheoryData + { + { ScanCompareType.Unknown, 0, 0, BitConverter.GetBytes(0), true, new IntegerScanResult(0) }, + { ScanCompareType.Unknown, 0, 0, BitConverter.GetBytes(1), true, new IntegerScanResult(1) } + }; + + [Theory] + [MemberData(nameof(GetTestCompareBasicData))] + [MemberData(nameof(GetTestCompareScanCompareTypeUnknownData))] + public void TestCompare(ScanCompareType compareType, int value1, int value2, byte[] data, bool expectedResult, ScanResult expectedScanResult) + { + var sut = new IntegerMemoryComparer(compareType, value1, value2); + + Check.That(sut.Compare(data, 0, out var scanResult)).IsEqualTo(expectedResult); + Check.That(scanResult).IsEqualTo(expectedScanResult); + if (scanResult != null) + { + Check.That(scanResult).IsInstanceOf(); + } + } + + [Theory] + [InlineData(ScanCompareType.Changed)] + [InlineData(ScanCompareType.NotChanged)] + [InlineData(ScanCompareType.Decreased)] + [InlineData(ScanCompareType.DecreasedOrEqual)] + [InlineData(ScanCompareType.Increased)] + [InlineData(ScanCompareType.IncreasedOrEqual)] + public void TestCompareInvalidCompareTypeThrows(ScanCompareType compareType) + { + var sut = new IntegerMemoryComparer(compareType, 0, 0); + + Check.ThatCode(() => sut.Compare(BitConverter.GetBytes(0), 0, out _)).Throws(); + } + + public static TheoryData GetTestCompareThrowsData() => new TheoryData + { + { null, 0, typeof(ArgumentNullException) }, + { new byte[0], 0, typeof(ArgumentOutOfRangeException) }, + { new byte[4], 4, typeof(ArgumentOutOfRangeException) }, + { new byte[3], 0, typeof(ArgumentException) }, + { new byte[4], 1, typeof(ArgumentException) } + }; + + [Theory] + [MemberData(nameof(GetTestCompareThrowsData))] + public void TestCompareInvalidDataThrows(byte[] data, int index, Type expectedExceptionType) + { + var sut = new IntegerMemoryComparer(ScanCompareType.Equal, 0, 0); + + Check.ThatCode(() => sut.Compare(data, index, out _)).ThrowsType(expectedExceptionType); + } + + public static TheoryData GetTestCompareWithPreviousData() + { + var data = new TheoryData + { + { ScanCompareType.Changed, 0, 0, BitConverter.GetBytes(0), new IntegerScanResult(1), true, new IntegerScanResult(0) }, + { ScanCompareType.Changed, 0, 0, BitConverter.GetBytes(1), new IntegerScanResult(1), false, null }, + { ScanCompareType.NotChanged, 0, 0, BitConverter.GetBytes(1), new IntegerScanResult(1), true, new IntegerScanResult(1) }, + { ScanCompareType.NotChanged, 0, 0, BitConverter.GetBytes(0), new IntegerScanResult(1), false, null }, + { ScanCompareType.Increased, 0, 0, BitConverter.GetBytes(2), new IntegerScanResult(1), true, new IntegerScanResult(2) }, + { ScanCompareType.Increased, 0, 0, BitConverter.GetBytes(1), new IntegerScanResult(1), false, null }, + { ScanCompareType.Increased, 0, 0, BitConverter.GetBytes(0), new IntegerScanResult(1), false, null }, + { ScanCompareType.IncreasedOrEqual, 0, 0, BitConverter.GetBytes(2), new IntegerScanResult(1), true, new IntegerScanResult(2) }, + { ScanCompareType.IncreasedOrEqual, 0, 0, BitConverter.GetBytes(1), new IntegerScanResult(1), true, new IntegerScanResult(1) }, + { ScanCompareType.IncreasedOrEqual, 0, 0, BitConverter.GetBytes(0), new IntegerScanResult(1), false, null }, + { ScanCompareType.Decreased, 0, 0, BitConverter.GetBytes(0), new IntegerScanResult(1), true, new IntegerScanResult(0) }, + { ScanCompareType.Decreased, 0, 0, BitConverter.GetBytes(1), new IntegerScanResult(1), false, null }, + { ScanCompareType.Decreased, 0, 0, BitConverter.GetBytes(2), new IntegerScanResult(1), false, null }, + { ScanCompareType.DecreasedOrEqual, 0, 0, BitConverter.GetBytes(0), new IntegerScanResult(1), true, new IntegerScanResult(0) }, + { ScanCompareType.DecreasedOrEqual, 0, 0, BitConverter.GetBytes(1), new IntegerScanResult(1), true, new IntegerScanResult(1) }, + { ScanCompareType.DecreasedOrEqual, 0, 0, BitConverter.GetBytes(2), new IntegerScanResult(1), false, null } + }; + + var basicData = GetTestCompareBasicData(); + foreach (var x in basicData) + { + data.Add((ScanCompareType)x[0], (int)x[1], (int)x[2], (byte[])x[3], new IntegerScanResult(1), (bool)x[4], (ScanResult)x[5]); + } + + return data; + } + + [Theory] + [MemberData(nameof(GetTestCompareWithPreviousData))] + public void TestCompareWithPrevious(ScanCompareType compareType, int value1, int value2, byte[] data, ScanResult previousScanResult, bool expectedResult, ScanResult expectedScanResult) + { + var sut = new IntegerMemoryComparer(compareType, value1, value2); + + Check.That(sut.Compare(data, 0, previousScanResult, out var scanResult)).IsEqualTo(expectedResult); + Check.That(scanResult).IsEqualTo(expectedScanResult); + if (scanResult != null) + { + Check.That(scanResult).IsInstanceOf(); + } + } + + [Fact] + public void TestCompareWithPreviousThrows() + { + var sut = new IntegerMemoryComparer(ScanCompareType.Unknown, 0, 0); + + Check.ThatCode(() => sut.Compare(BitConverter.GetBytes(0), 0, new IntegerScanResult(0), out _)).Throws(); + } + } +} diff --git a/ReClass.NET_Tests/ReClass.NET_Tests.csproj b/ReClass.NET_Tests/ReClass.NET_Tests.csproj index 3494eb4c..df0caa72 100644 --- a/ReClass.NET_Tests/ReClass.NET_Tests.csproj +++ b/ReClass.NET_Tests/ReClass.NET_Tests.csproj @@ -80,6 +80,7 @@ + From dac1416ff09ae7d4d013bcd4a3dcf773c84875ec Mon Sep 17 00:00:00 2001 From: KN4CK3R Date: Mon, 8 Jul 2019 23:13:06 +0200 Subject: [PATCH 089/223] Added tests. --- .../Comparer/ByteMemoryComparer.cs | 167 ++++++++++-------- .../Comparer/LongMemoryComparer.cs | 153 ++++++++-------- .../Comparer/ShortMemoryComparer.cs | 153 ++++++++-------- .../Comparer/ByteMemoryComparerTest.cs | 164 +++++++++++++++++ .../Comparer/LongMemoryComparerTest.cs | 166 +++++++++++++++++ .../Comparer/ShortMemoryComparerTest.cs | 166 +++++++++++++++++ ReClass.NET_Tests/ReClass.NET_Tests.csproj | 3 + 7 files changed, 744 insertions(+), 228 deletions(-) create mode 100644 ReClass.NET_Tests/MemoryScanner/Comparer/ByteMemoryComparerTest.cs create mode 100644 ReClass.NET_Tests/MemoryScanner/Comparer/LongMemoryComparerTest.cs create mode 100644 ReClass.NET_Tests/MemoryScanner/Comparer/ShortMemoryComparerTest.cs diff --git a/ReClass.NET/MemoryScanner/Comparer/ByteMemoryComparer.cs b/ReClass.NET/MemoryScanner/Comparer/ByteMemoryComparer.cs index 4d175d9f..849c1c38 100644 --- a/ReClass.NET/MemoryScanner/Comparer/ByteMemoryComparer.cs +++ b/ReClass.NET/MemoryScanner/Comparer/ByteMemoryComparer.cs @@ -1,4 +1,5 @@ -using System.Diagnostics; +using System; +using System.Diagnostics; using ReClassNET.Util; namespace ReClassNET.MemoryScanner.Comparer @@ -28,45 +29,37 @@ public ByteMemoryComparer(ScanCompareType compareType, byte value1, byte value2) public bool Compare(byte[] data, int index, out ScanResult result) { - result = null; - - var value = data[index]; - - bool IsMatch() - { - switch (CompareType) + return CompareInternal( + data, + index, + value => { - case ScanCompareType.Equal: - return value == Value1; - case ScanCompareType.NotEqual: - return value != Value1; - case ScanCompareType.GreaterThan: - return value > Value1; - case ScanCompareType.GreaterThanOrEqual: - return value >= Value1; - case ScanCompareType.LessThan: - return value < Value1; - case ScanCompareType.LessThanOrEqual: - return value <= Value1; - case ScanCompareType.Between: - return Value1 < value && value < Value2; - case ScanCompareType.BetweenOrEqual: - return Value1 <= value && value <= Value2; - case ScanCompareType.Unknown: - return true; - default: - throw new InvalidCompareTypeException(CompareType); - } - } - - if (!IsMatch()) - { - return false; - } - - result = new ByteScanResult(value); - - return true; + switch (CompareType) + { + case ScanCompareType.Equal: + return value == Value1; + case ScanCompareType.NotEqual: + return value != Value1; + case ScanCompareType.GreaterThan: + return value > Value1; + case ScanCompareType.GreaterThanOrEqual: + return value >= Value1; + case ScanCompareType.LessThan: + return value < Value1; + case ScanCompareType.LessThanOrEqual: + return value <= Value1; + case ScanCompareType.Between: + return Value1 < value && value < Value2; + case ScanCompareType.BetweenOrEqual: + return Value1 <= value && value <= Value2; + case ScanCompareType.Unknown: + return true; + default: + throw new InvalidCompareTypeException(CompareType); + } + }, + out result + ); } public bool Compare(byte[] data, int index, ScanResult previous, out ScanResult result) @@ -80,48 +73,70 @@ public bool Compare(byte[] data, int index, ScanResult previous, out ScanResult public bool Compare(byte[] data, int index, ByteScanResult previous, out ScanResult result) { - result = null; + return CompareInternal( + data, + index, + value => + { + switch (CompareType) + { + case ScanCompareType.Equal: + return value == Value1; + case ScanCompareType.NotEqual: + return value != Value1; + case ScanCompareType.GreaterThan: + return value > Value1; + case ScanCompareType.GreaterThanOrEqual: + return value >= Value1; + case ScanCompareType.LessThan: + return value < Value1; + case ScanCompareType.LessThanOrEqual: + return value <= Value1; + case ScanCompareType.Between: + return Value1 < value && value < Value2; + case ScanCompareType.BetweenOrEqual: + return Value1 <= value && value <= Value2; + + case ScanCompareType.Changed: + return value != previous.Value; + case ScanCompareType.NotChanged: + return value == previous.Value; + case ScanCompareType.Increased: + return value > previous.Value; + case ScanCompareType.IncreasedOrEqual: + return value >= previous.Value; + case ScanCompareType.Decreased: + return value < previous.Value; + case ScanCompareType.DecreasedOrEqual: + return value <= previous.Value; + default: + throw new InvalidCompareTypeException(CompareType); + } + }, + out result + ); + } - var value = data[index]; + private static bool CompareInternal(byte[] data, int index, Func matcher, out ScanResult result) + { + result = null; - bool IsMatch() + if (data == null) { - switch (CompareType) - { - case ScanCompareType.Equal: - return value == Value1; - case ScanCompareType.NotEqual: - return value != Value1; - case ScanCompareType.Changed: - return value != previous.Value; - case ScanCompareType.NotChanged: - return value == previous.Value; - case ScanCompareType.GreaterThan: - return value > Value1; - case ScanCompareType.GreaterThanOrEqual: - return value >= Value1; - case ScanCompareType.Increased: - return value > previous.Value; - case ScanCompareType.IncreasedOrEqual: - return value >= previous.Value; - case ScanCompareType.LessThan: - return value < Value1; - case ScanCompareType.LessThanOrEqual: - return value <= Value1; - case ScanCompareType.Decreased: - return value < previous.Value; - case ScanCompareType.DecreasedOrEqual: - return value <= previous.Value; - case ScanCompareType.Between: - return Value1 < value && value < Value2; - case ScanCompareType.BetweenOrEqual: - return Value1 <= value && value <= Value2; - default: - throw new InvalidCompareTypeException(CompareType); - } + throw new ArgumentNullException(nameof(data)); + } + if ((uint)index >= data.Length) + { + throw new ArgumentOutOfRangeException(nameof(index)); } + if (index > data.Length - 1) + { + throw new ArgumentException(); + } + + var value = data[index]; - if (!IsMatch()) + if (!matcher(value)) { return false; } diff --git a/ReClass.NET/MemoryScanner/Comparer/LongMemoryComparer.cs b/ReClass.NET/MemoryScanner/Comparer/LongMemoryComparer.cs index 662f1a99..baa5c4fb 100644 --- a/ReClass.NET/MemoryScanner/Comparer/LongMemoryComparer.cs +++ b/ReClass.NET/MemoryScanner/Comparer/LongMemoryComparer.cs @@ -29,45 +29,37 @@ public LongMemoryComparer(ScanCompareType compareType, long value1, long value2) public bool Compare(byte[] data, int index, out ScanResult result) { - result = null; - - var value = BitConverter.ToInt64(data, index); - - bool IsMatch() - { - switch (CompareType) + return CompareInternal( + data, + index, + value => { - case ScanCompareType.Equal: - return value == Value1; - case ScanCompareType.NotEqual: - return value != Value1; - case ScanCompareType.GreaterThan: - return value > Value1; - case ScanCompareType.GreaterThanOrEqual: - return value >= Value1; - case ScanCompareType.LessThan: - return value < Value1; - case ScanCompareType.LessThanOrEqual: - return value <= Value1; - case ScanCompareType.Between: - return Value1 < value && value < Value2; - case ScanCompareType.BetweenOrEqual: - return Value1 <= value && value <= Value2; - case ScanCompareType.Unknown: - return true; - default: - throw new InvalidCompareTypeException(CompareType); - } - } - - if (!IsMatch()) - { - return false; - } - - result = new LongScanResult(value); - - return true; + switch (CompareType) + { + case ScanCompareType.Equal: + return value == Value1; + case ScanCompareType.NotEqual: + return value != Value1; + case ScanCompareType.GreaterThan: + return value > Value1; + case ScanCompareType.GreaterThanOrEqual: + return value >= Value1; + case ScanCompareType.LessThan: + return value < Value1; + case ScanCompareType.LessThanOrEqual: + return value <= Value1; + case ScanCompareType.Between: + return Value1 < value && value < Value2; + case ScanCompareType.BetweenOrEqual: + return Value1 <= value && value <= Value2; + case ScanCompareType.Unknown: + return true; + default: + throw new InvalidCompareTypeException(CompareType); + } + }, + out result + ); } public bool Compare(byte[] data, int index, ScanResult previous, out ScanResult result) @@ -80,49 +72,58 @@ public bool Compare(byte[] data, int index, ScanResult previous, out ScanResult } public bool Compare(byte[] data, int index, LongScanResult previous, out ScanResult result) + { + return CompareInternal( + data, + index, + value => + { + switch (CompareType) + { + case ScanCompareType.Equal: + return value == Value1; + case ScanCompareType.NotEqual: + return value != Value1; + case ScanCompareType.GreaterThan: + return value > Value1; + case ScanCompareType.GreaterThanOrEqual: + return value >= Value1; + case ScanCompareType.LessThan: + return value < Value1; + case ScanCompareType.LessThanOrEqual: + return value <= Value1; + case ScanCompareType.Between: + return Value1 < value && value < Value2; + case ScanCompareType.BetweenOrEqual: + return Value1 <= value && value <= Value2; + + case ScanCompareType.Changed: + return value != previous.Value; + case ScanCompareType.NotChanged: + return value == previous.Value; + case ScanCompareType.Increased: + return value > previous.Value; + case ScanCompareType.IncreasedOrEqual: + return value >= previous.Value; + case ScanCompareType.Decreased: + return value < previous.Value; + case ScanCompareType.DecreasedOrEqual: + return value <= previous.Value; + default: + throw new InvalidCompareTypeException(CompareType); + } + }, + out result + ); + } + + private static bool CompareInternal(byte[] data, int index, Func matcher, out ScanResult result) { result = null; var value = BitConverter.ToInt64(data, index); - bool IsMatch() - { - switch (CompareType) - { - case ScanCompareType.Equal: - return value == Value1; - case ScanCompareType.NotEqual: - return value != Value1; - case ScanCompareType.Changed: - return value != previous.Value; - case ScanCompareType.NotChanged: - return value == previous.Value; - case ScanCompareType.GreaterThan: - return value > Value1; - case ScanCompareType.GreaterThanOrEqual: - return value >= Value1; - case ScanCompareType.Increased: - return value > previous.Value; - case ScanCompareType.IncreasedOrEqual: - return value >= previous.Value; - case ScanCompareType.LessThan: - return value < Value1; - case ScanCompareType.LessThanOrEqual: - return value <= Value1; - case ScanCompareType.Decreased: - return value < previous.Value; - case ScanCompareType.DecreasedOrEqual: - return value <= previous.Value; - case ScanCompareType.Between: - return Value1 < value && value < Value2; - case ScanCompareType.BetweenOrEqual: - return Value1 <= value && value <= Value2; - default: - throw new InvalidCompareTypeException(CompareType); - } - } - - if (!IsMatch()) + if (!matcher(value)) { return false; } diff --git a/ReClass.NET/MemoryScanner/Comparer/ShortMemoryComparer.cs b/ReClass.NET/MemoryScanner/Comparer/ShortMemoryComparer.cs index 8e541704..b40d25f5 100644 --- a/ReClass.NET/MemoryScanner/Comparer/ShortMemoryComparer.cs +++ b/ReClass.NET/MemoryScanner/Comparer/ShortMemoryComparer.cs @@ -29,45 +29,37 @@ public ShortMemoryComparer(ScanCompareType compareType, short value1, short valu public bool Compare(byte[] data, int index, out ScanResult result) { - result = null; - - var value = BitConverter.ToInt16(data, index); - - bool IsMatch() - { - switch (CompareType) + return CompareInternal( + data, + index, + value => { - case ScanCompareType.Equal: - return value == Value1; - case ScanCompareType.NotEqual: - return value != Value1; - case ScanCompareType.GreaterThan: - return value > Value1; - case ScanCompareType.GreaterThanOrEqual: - return value >= Value1; - case ScanCompareType.LessThan: - return value < Value1; - case ScanCompareType.LessThanOrEqual: - return value <= Value1; - case ScanCompareType.Between: - return Value1 < value && value < Value2; - case ScanCompareType.BetweenOrEqual: - return Value1 <= value && value <= Value2; - case ScanCompareType.Unknown: - return true; - default: - throw new InvalidCompareTypeException(CompareType); - } - } - - if (!IsMatch()) - { - return false; - } - - result = new ShortScanResult(value); - - return true; + switch (CompareType) + { + case ScanCompareType.Equal: + return value == Value1; + case ScanCompareType.NotEqual: + return value != Value1; + case ScanCompareType.GreaterThan: + return value > Value1; + case ScanCompareType.GreaterThanOrEqual: + return value >= Value1; + case ScanCompareType.LessThan: + return value < Value1; + case ScanCompareType.LessThanOrEqual: + return value <= Value1; + case ScanCompareType.Between: + return Value1 < value && value < Value2; + case ScanCompareType.BetweenOrEqual: + return Value1 <= value && value <= Value2; + case ScanCompareType.Unknown: + return true; + default: + throw new InvalidCompareTypeException(CompareType); + } + }, + out result + ); } public bool Compare(byte[] data, int index, ScanResult previous, out ScanResult result) @@ -80,49 +72,58 @@ public bool Compare(byte[] data, int index, ScanResult previous, out ScanResult } public bool Compare(byte[] data, int index, ShortScanResult previous, out ScanResult result) + { + return CompareInternal( + data, + index, + value => + { + switch (CompareType) + { + case ScanCompareType.Equal: + return value == Value1; + case ScanCompareType.NotEqual: + return value != Value1; + case ScanCompareType.GreaterThan: + return value > Value1; + case ScanCompareType.GreaterThanOrEqual: + return value >= Value1; + case ScanCompareType.LessThan: + return value < Value1; + case ScanCompareType.LessThanOrEqual: + return value <= Value1; + case ScanCompareType.Between: + return Value1 < value && value < Value2; + case ScanCompareType.BetweenOrEqual: + return Value1 <= value && value <= Value2; + + case ScanCompareType.Changed: + return value != previous.Value; + case ScanCompareType.NotChanged: + return value == previous.Value; + case ScanCompareType.Increased: + return value > previous.Value; + case ScanCompareType.IncreasedOrEqual: + return value >= previous.Value; + case ScanCompareType.Decreased: + return value < previous.Value; + case ScanCompareType.DecreasedOrEqual: + return value <= previous.Value; + default: + throw new InvalidCompareTypeException(CompareType); + } + }, + out result + ); + } + + private static bool CompareInternal(byte[] data, int index, Func matcher, out ScanResult result) { result = null; var value = BitConverter.ToInt16(data, index); - bool IsMatch() - { - switch (CompareType) - { - case ScanCompareType.Equal: - return value == Value1; - case ScanCompareType.NotEqual: - return value != Value1; - case ScanCompareType.Changed: - return value != previous.Value; - case ScanCompareType.NotChanged: - return value == previous.Value; - case ScanCompareType.GreaterThan: - return value > Value1; - case ScanCompareType.GreaterThanOrEqual: - return value >= Value1; - case ScanCompareType.Increased: - return value > previous.Value; - case ScanCompareType.IncreasedOrEqual: - return value >= previous.Value; - case ScanCompareType.LessThan: - return value < Value1; - case ScanCompareType.LessThanOrEqual: - return value <= Value1; - case ScanCompareType.Decreased: - return value < previous.Value; - case ScanCompareType.DecreasedOrEqual: - return value <= previous.Value; - case ScanCompareType.Between: - return Value1 < value && value < Value2; - case ScanCompareType.BetweenOrEqual: - return Value1 <= value && value <= Value2; - default: - throw new InvalidCompareTypeException(CompareType); - } - } - - if (!IsMatch()) + if (!matcher(value)) { return false; } diff --git a/ReClass.NET_Tests/MemoryScanner/Comparer/ByteMemoryComparerTest.cs b/ReClass.NET_Tests/MemoryScanner/Comparer/ByteMemoryComparerTest.cs new file mode 100644 index 00000000..c6d1d2b0 --- /dev/null +++ b/ReClass.NET_Tests/MemoryScanner/Comparer/ByteMemoryComparerTest.cs @@ -0,0 +1,164 @@ +using System; +using NFluent; +using ReClassNET.MemoryScanner; +using ReClassNET.MemoryScanner.Comparer; +using Xunit; + +namespace ReClass.NET_Tests.MemoryScanner.Comparer +{ + public class ByteMemoryComparerTest + { + [Theory] + [InlineData(ScanCompareType.Equal, 0, 0)] + [InlineData(ScanCompareType.Equal, 1, 2)] + [InlineData(ScanCompareType.Equal, 2, 1)] + [InlineData(ScanCompareType.Between, 2, 4)] + [InlineData(ScanCompareType.BetweenOrEqual, 4, 2)] + [InlineData(ScanCompareType.NotEqual, 0, 0)] + public void TestConstructor(ScanCompareType compareType, byte value1, byte value2) + { + var sut = new ByteMemoryComparer(compareType, value1, value2); + + Check.That(sut.CompareType).IsEqualTo(compareType); + Check.That(sut.ValueSize).IsEqualTo(sizeof(byte)); + Check.That(sut.Value1).IsOneOf(value1, value2); + Check.That(sut.Value2).IsOneOf(value1, value2); + if (compareType == ScanCompareType.Between || compareType == ScanCompareType.BetweenOrEqual) + { + Check.That(sut.Value1 <= sut.Value2).IsTrue(); + } + } + + public static TheoryData GetTestCompareBasicData() => new TheoryData + { + { ScanCompareType.Equal, 0, 0, new byte[] { 0 }, true, new ByteScanResult(0) }, + { ScanCompareType.Equal, 0, 0, new byte[] { 1 }, false, null }, + { ScanCompareType.Equal, 1, 0, new byte[] { 1 }, true, new ByteScanResult(1) }, + { ScanCompareType.Equal, 1, 0, new byte[] { 0 }, false, null }, + { ScanCompareType.NotEqual, 1, 0, new byte[] { 0 }, true, new ByteScanResult(0) }, + { ScanCompareType.NotEqual, 1, 0, new byte[] { 1 }, false, null }, + { ScanCompareType.GreaterThan, 1, 0, new byte[] { 0 }, false, null }, + { ScanCompareType.GreaterThan, 1, 0, new byte[] { 2 }, true, new ByteScanResult(2) }, + { ScanCompareType.GreaterThanOrEqual, 1, 0, new byte[] { 0 }, false, null }, + { ScanCompareType.GreaterThanOrEqual, 1, 0, new byte[] { 1 }, true, new ByteScanResult(1) }, + { ScanCompareType.GreaterThanOrEqual, 1, 0, new byte[] { 2 }, true, new ByteScanResult(2) }, + { ScanCompareType.LessThan, 1, 0, new byte[] { 1 }, false, null }, + { ScanCompareType.LessThan, 1, 0, new byte[] { 0 }, true, new ByteScanResult(0) }, + { ScanCompareType.LessThanOrEqual, 1, 0, new byte[] { 2 }, false, null }, + { ScanCompareType.LessThanOrEqual, 1, 0, new byte[] { 1 }, true, new ByteScanResult(1) }, + { ScanCompareType.LessThanOrEqual, 1, 0, new byte[] { 0 }, true, new ByteScanResult(0) }, + { ScanCompareType.Between, 1, 2, new byte[] { 0 }, false, null }, + { ScanCompareType.Between, 1, 2, new byte[] { 1 }, false, null }, + { ScanCompareType.Between, 1, 2, new byte[] { 2 }, false, null }, + { ScanCompareType.Between, 1, 2, new byte[] { 3 }, false, null }, + { ScanCompareType.BetweenOrEqual, 1, 2, new byte[] { 0 }, false, null }, + { ScanCompareType.BetweenOrEqual, 1, 2, new byte[] { 1 }, true, new ByteScanResult(1) }, + { ScanCompareType.BetweenOrEqual, 1, 2, new byte[] { 2 }, true, new ByteScanResult(2) }, + { ScanCompareType.BetweenOrEqual, 1, 2, new byte[] { 3 }, false, null } + }; + + public static TheoryData GetTestCompareScanCompareTypeUnknownData() => new TheoryData + { + { ScanCompareType.Unknown, 0, 0, new byte[] { 0 }, true, new ByteScanResult(0) }, + { ScanCompareType.Unknown, 0, 0, new byte[] { 1 }, true, new ByteScanResult(1) } + }; + + [Theory] + [MemberData(nameof(GetTestCompareBasicData))] + [MemberData(nameof(GetTestCompareScanCompareTypeUnknownData))] + public void TestCompare(ScanCompareType compareType, byte value1, byte value2, byte[] data, bool expectedResult, ScanResult expectedScanResult) + { + var sut = new ByteMemoryComparer(compareType, value1, value2); + + Check.That(sut.Compare(data, 0, out var scanResult)).IsEqualTo(expectedResult); + Check.That(scanResult).IsEqualTo(expectedScanResult); + if (scanResult != null) + { + Check.That(scanResult).IsInstanceOf(); + } + } + + [Theory] + [InlineData(ScanCompareType.Changed)] + [InlineData(ScanCompareType.NotChanged)] + [InlineData(ScanCompareType.Decreased)] + [InlineData(ScanCompareType.DecreasedOrEqual)] + [InlineData(ScanCompareType.Increased)] + [InlineData(ScanCompareType.IncreasedOrEqual)] + public void TestCompareInvalidCompareTypeThrows(ScanCompareType compareType) + { + var sut = new ByteMemoryComparer(compareType, 0, 0); + + Check.ThatCode(() => sut.Compare(new byte[] { 0 }, 0, out _)).Throws(); + } + + public static TheoryData GetTestCompareThrowsData() => new TheoryData + { + { null, 0, typeof(ArgumentNullException) }, + { new byte[0], 0, typeof(ArgumentOutOfRangeException) }, + { new byte[1], 1, typeof(ArgumentOutOfRangeException) } + }; + + [Theory] + [MemberData(nameof(GetTestCompareThrowsData))] + public void TestCompareInvalidDataThrows(byte[] data, int index, Type expectedExceptionType) + { + var sut = new ByteMemoryComparer(ScanCompareType.Equal, 0, 0); + + Check.ThatCode(() => sut.Compare(data, index, out _)).ThrowsType(expectedExceptionType); + } + + public static TheoryData GetTestCompareWithPreviousData() + { + var data = new TheoryData + { + { ScanCompareType.Changed, 0, 0, new byte[] { 0 }, new ByteScanResult(1), true, new ByteScanResult(0) }, + { ScanCompareType.Changed, 0, 0, new byte[] { 1 }, new ByteScanResult(1), false, null }, + { ScanCompareType.NotChanged, 0, 0, new byte[] { 1 }, new ByteScanResult(1), true, new ByteScanResult(1) }, + { ScanCompareType.NotChanged, 0, 0, new byte[] { 0 }, new ByteScanResult(1), false, null }, + { ScanCompareType.Increased, 0, 0, new byte[] { 2 }, new ByteScanResult(1), true, new ByteScanResult(2) }, + { ScanCompareType.Increased, 0, 0, new byte[] { 1 }, new ByteScanResult(1), false, null }, + { ScanCompareType.Increased, 0, 0, new byte[] { 0 }, new ByteScanResult(1), false, null }, + { ScanCompareType.IncreasedOrEqual, 0, 0, new byte[] { 2 }, new ByteScanResult(1), true, new ByteScanResult(2) }, + { ScanCompareType.IncreasedOrEqual, 0, 0, new byte[] { 1 }, new ByteScanResult(1), true, new ByteScanResult(1) }, + { ScanCompareType.IncreasedOrEqual, 0, 0, new byte[] { 0 }, new ByteScanResult(1), false, null }, + { ScanCompareType.Decreased, 0, 0, new byte[] { 0 }, new ByteScanResult(1), true, new ByteScanResult(0) }, + { ScanCompareType.Decreased, 0, 0, new byte[] { 1 }, new ByteScanResult(1), false, null }, + { ScanCompareType.Decreased, 0, 0, new byte[] { 2 }, new ByteScanResult(1), false, null }, + { ScanCompareType.DecreasedOrEqual, 0, 0, new byte[] { 0 }, new ByteScanResult(1), true, new ByteScanResult(0) }, + { ScanCompareType.DecreasedOrEqual, 0, 0, new byte[] { 1 }, new ByteScanResult(1), true, new ByteScanResult(1) }, + { ScanCompareType.DecreasedOrEqual, 0, 0, new byte[] { 2 }, new ByteScanResult(1), false, null } + }; + + var basicData = GetTestCompareBasicData(); + foreach (var x in basicData) + { + data.Add((ScanCompareType)x[0], (byte)x[1], (byte)x[2], (byte[])x[3], new ByteScanResult(1), (bool)x[4], (ScanResult)x[5]); + } + + return data; + } + + [Theory] + [MemberData(nameof(GetTestCompareWithPreviousData))] + public void TestCompareWithPrevious(ScanCompareType compareType, byte value1, byte value2, byte[] data, ScanResult previousScanResult, bool expectedResult, ScanResult expectedScanResult) + { + var sut = new ByteMemoryComparer(compareType, value1, value2); + + Check.That(sut.Compare(data, 0, previousScanResult, out var scanResult)).IsEqualTo(expectedResult); + Check.That(scanResult).IsEqualTo(expectedScanResult); + if (scanResult != null) + { + Check.That(scanResult).IsInstanceOf(); + } + } + + [Fact] + public void TestCompareWithPreviousThrows() + { + var sut = new ByteMemoryComparer(ScanCompareType.Unknown, 0, 0); + + Check.ThatCode(() => sut.Compare(new byte[] { 0 }, 0, new ByteScanResult(0), out _)).Throws(); + } + } +} diff --git a/ReClass.NET_Tests/MemoryScanner/Comparer/LongMemoryComparerTest.cs b/ReClass.NET_Tests/MemoryScanner/Comparer/LongMemoryComparerTest.cs new file mode 100644 index 00000000..86fc5e70 --- /dev/null +++ b/ReClass.NET_Tests/MemoryScanner/Comparer/LongMemoryComparerTest.cs @@ -0,0 +1,166 @@ +using System; +using NFluent; +using ReClassNET.MemoryScanner; +using ReClassNET.MemoryScanner.Comparer; +using Xunit; + +namespace ReClass.NET_Tests.MemoryScanner.Comparer +{ + public class LongMemoryComparerTest + { + [Theory] + [InlineData(ScanCompareType.Equal, 0L, 0L)] + [InlineData(ScanCompareType.Equal, 1L, 2L)] + [InlineData(ScanCompareType.Equal, 2L, 1L)] + [InlineData(ScanCompareType.Between, 2L, 4L)] + [InlineData(ScanCompareType.BetweenOrEqual, 4L, 2L)] + [InlineData(ScanCompareType.NotEqual, 0L, 0L)] + public void TestConstructor(ScanCompareType compareType, long value1, long value2) + { + var sut = new LongMemoryComparer(compareType, value1, value2); + + Check.That(sut.CompareType).IsEqualTo(compareType); + Check.That(sut.ValueSize).IsEqualTo(sizeof(long)); + Check.That(sut.Value1).IsOneOf(value1, value2); + Check.That(sut.Value2).IsOneOf(value1, value2); + if (compareType == ScanCompareType.Between || compareType == ScanCompareType.BetweenOrEqual) + { + Check.That(sut.Value1 <= sut.Value2).IsTrue(); + } + } + + public static TheoryData GetTestCompareBasicData() => new TheoryData + { + { ScanCompareType.Equal, 0L, 0L, BitConverter.GetBytes(0L), true, new LongScanResult(0L) }, + { ScanCompareType.Equal, 0L, 0L, BitConverter.GetBytes(1L), false, null }, + { ScanCompareType.Equal, 1L, 0L, BitConverter.GetBytes(1L), true, new LongScanResult(1L) }, + { ScanCompareType.Equal, 1L, 0L, BitConverter.GetBytes(0L), false, null }, + { ScanCompareType.NotEqual, 1L, 0L, BitConverter.GetBytes(0L), true, new LongScanResult(0L) }, + { ScanCompareType.NotEqual, 1L, 0L, BitConverter.GetBytes(1L), false, null }, + { ScanCompareType.GreaterThan, 1L, 0L, BitConverter.GetBytes(0L), false, null }, + { ScanCompareType.GreaterThan, 1L, 0L, BitConverter.GetBytes(2L), true, new LongScanResult(2L) }, + { ScanCompareType.GreaterThanOrEqual, 1L, 0L, BitConverter.GetBytes(0L), false, null }, + { ScanCompareType.GreaterThanOrEqual, 1L, 0L, BitConverter.GetBytes(1L), true, new LongScanResult(1L) }, + { ScanCompareType.GreaterThanOrEqual, 1L, 0L, BitConverter.GetBytes(2L), true, new LongScanResult(2L) }, + { ScanCompareType.LessThan, 1L, 0L, BitConverter.GetBytes(1L), false, null }, + { ScanCompareType.LessThan, 1L, 0L, BitConverter.GetBytes(0L), true, new LongScanResult(0L) }, + { ScanCompareType.LessThanOrEqual, 1L, 0L, BitConverter.GetBytes(2L), false, null }, + { ScanCompareType.LessThanOrEqual, 1L, 0L, BitConverter.GetBytes(1L), true, new LongScanResult(1L) }, + { ScanCompareType.LessThanOrEqual, 1L, 0L, BitConverter.GetBytes(0L), true, new LongScanResult(0L) }, + { ScanCompareType.Between, 1L, 2L, BitConverter.GetBytes(0L), false, null }, + { ScanCompareType.Between, 1L, 2L, BitConverter.GetBytes(1L), false, null }, + { ScanCompareType.Between, 1L, 2L, BitConverter.GetBytes(2L), false, null }, + { ScanCompareType.Between, 1L, 2L, BitConverter.GetBytes(3L), false, null }, + { ScanCompareType.BetweenOrEqual, 1L, 2L, BitConverter.GetBytes(0L), false, null }, + { ScanCompareType.BetweenOrEqual, 1L, 2L, BitConverter.GetBytes(1L), true, new LongScanResult(1L) }, + { ScanCompareType.BetweenOrEqual, 1L, 2L, BitConverter.GetBytes(2L), true, new LongScanResult(2L) }, + { ScanCompareType.BetweenOrEqual, 1L, 2L, BitConverter.GetBytes(3L), false, null } + }; + + public static TheoryData GetTestCompareScanCompareTypeUnknownData() => new TheoryData + { + { ScanCompareType.Unknown, 0L, 0L, BitConverter.GetBytes(0L), true, new LongScanResult(0L) }, + { ScanCompareType.Unknown, 0L, 0L, BitConverter.GetBytes(1L), true, new LongScanResult(1L) } + }; + + [Theory] + [MemberData(nameof(GetTestCompareBasicData))] + [MemberData(nameof(GetTestCompareScanCompareTypeUnknownData))] + public void TestCompare(ScanCompareType compareType, long value1, long value2, byte[] data, bool expectedResult, ScanResult expectedScanResult) + { + var sut = new LongMemoryComparer(compareType, value1, value2); + + Check.That(sut.Compare(data, 0, out var scanResult)).IsEqualTo(expectedResult); + Check.That(scanResult).IsEqualTo(expectedScanResult); + if (scanResult != null) + { + Check.That(scanResult).IsInstanceOf(); + } + } + + [Theory] + [InlineData(ScanCompareType.Changed)] + [InlineData(ScanCompareType.NotChanged)] + [InlineData(ScanCompareType.Decreased)] + [InlineData(ScanCompareType.DecreasedOrEqual)] + [InlineData(ScanCompareType.Increased)] + [InlineData(ScanCompareType.IncreasedOrEqual)] + public void TestCompareInvalidCompareTypeThrows(ScanCompareType compareType) + { + var sut = new LongMemoryComparer(compareType, 0L, 0L); + + Check.ThatCode(() => sut.Compare(BitConverter.GetBytes(0L), 0, out _)).Throws(); + } + + public static TheoryData GetTestCompareThrowsData() => new TheoryData + { + { null, 0, typeof(ArgumentNullException) }, + { new byte[0], 0, typeof(ArgumentOutOfRangeException) }, + { new byte[8], 8, typeof(ArgumentOutOfRangeException) }, + { new byte[7], 0, typeof(ArgumentException) }, + { new byte[8], 1, typeof(ArgumentException) } + }; + + [Theory] + [MemberData(nameof(GetTestCompareThrowsData))] + public void TestCompareInvalidDataThrows(byte[] data, int index, Type expectedExceptionType) + { + var sut = new LongMemoryComparer(ScanCompareType.Equal, 0L, 0L); + + Check.ThatCode(() => sut.Compare(data, index, out _)).ThrowsType(expectedExceptionType); + } + + public static TheoryData GetTestCompareWithPreviousData() + { + var data = new TheoryData + { + { ScanCompareType.Changed, 0L, 0L, BitConverter.GetBytes(0L), new LongScanResult(1L), true, new LongScanResult(0) }, + { ScanCompareType.Changed, 0L, 0L, BitConverter.GetBytes(1L), new LongScanResult(1L), false, null }, + { ScanCompareType.NotChanged, 0L, 0L, BitConverter.GetBytes(1L), new LongScanResult(1L), true, new LongScanResult(1) }, + { ScanCompareType.NotChanged, 0L, 0L, BitConverter.GetBytes(0L), new LongScanResult(1L), false, null }, + { ScanCompareType.Increased, 0L, 0L, BitConverter.GetBytes(2L), new LongScanResult(1L), true, new LongScanResult(2) }, + { ScanCompareType.Increased, 0L, 0L, BitConverter.GetBytes(1L), new LongScanResult(1L), false, null }, + { ScanCompareType.Increased, 0L, 0L, BitConverter.GetBytes(0L), new LongScanResult(1L), false, null }, + { ScanCompareType.IncreasedOrEqual, 0L, 0L, BitConverter.GetBytes(2L), new LongScanResult(1L), true, new LongScanResult(2) }, + { ScanCompareType.IncreasedOrEqual, 0L, 0L, BitConverter.GetBytes(1L), new LongScanResult(1L), true, new LongScanResult(1) }, + { ScanCompareType.IncreasedOrEqual, 0L, 0L, BitConverter.GetBytes(0L), new LongScanResult(1L), false, null }, + { ScanCompareType.Decreased, 0L, 0L, BitConverter.GetBytes(0L), new LongScanResult(1L), true, new LongScanResult(0) }, + { ScanCompareType.Decreased, 0L, 0L, BitConverter.GetBytes(1L), new LongScanResult(1L), false, null }, + { ScanCompareType.Decreased, 0L, 0L, BitConverter.GetBytes(2L), new LongScanResult(1L), false, null }, + { ScanCompareType.DecreasedOrEqual, 0L, 0L, BitConverter.GetBytes(0L), new LongScanResult(1L), true, new LongScanResult(0) }, + { ScanCompareType.DecreasedOrEqual, 0L, 0L, BitConverter.GetBytes(1L), new LongScanResult(1L), true, new LongScanResult(1) }, + { ScanCompareType.DecreasedOrEqual, 0L, 0L, BitConverter.GetBytes(2L), new LongScanResult(1L), false, null } + }; + + var basicData = GetTestCompareBasicData(); + foreach (var x in basicData) + { + data.Add((ScanCompareType)x[0], (long)x[1], (long)x[2], (byte[])x[3], new LongScanResult(1L), (bool)x[4], (ScanResult)x[5]); + } + + return data; + } + + [Theory] + [MemberData(nameof(GetTestCompareWithPreviousData))] + public void TestCompareWithPrevious(ScanCompareType compareType, long value1, long value2, byte[] data, ScanResult previousScanResult, bool expectedResult, ScanResult expectedScanResult) + { + var sut = new LongMemoryComparer(compareType, value1, value2); + + Check.That(sut.Compare(data, 0, previousScanResult, out var scanResult)).IsEqualTo(expectedResult); + Check.That(scanResult).IsEqualTo(expectedScanResult); + if (scanResult != null) + { + Check.That(scanResult).IsInstanceOf(); + } + } + + [Fact] + public void TestCompareWithPreviousThrows() + { + var sut = new LongMemoryComparer(ScanCompareType.Unknown, 0L, 0L); + + Check.ThatCode(() => sut.Compare(BitConverter.GetBytes(0L), 0, new LongScanResult(0L), out _)).Throws(); + } + } +} diff --git a/ReClass.NET_Tests/MemoryScanner/Comparer/ShortMemoryComparerTest.cs b/ReClass.NET_Tests/MemoryScanner/Comparer/ShortMemoryComparerTest.cs new file mode 100644 index 00000000..6f013063 --- /dev/null +++ b/ReClass.NET_Tests/MemoryScanner/Comparer/ShortMemoryComparerTest.cs @@ -0,0 +1,166 @@ +using System; +using NFluent; +using ReClassNET.MemoryScanner; +using ReClassNET.MemoryScanner.Comparer; +using Xunit; + +namespace ReClass.NET_Tests.MemoryScanner.Comparer +{ + public class ShortMemoryComparerTest + { + [Theory] + [InlineData(ScanCompareType.Equal, 0, 0)] + [InlineData(ScanCompareType.Equal, 1, 2)] + [InlineData(ScanCompareType.Equal, 2, 1)] + [InlineData(ScanCompareType.Between, 2, 4)] + [InlineData(ScanCompareType.BetweenOrEqual, 4, 2)] + [InlineData(ScanCompareType.NotEqual, 0, 0)] + public void TestConstructor(ScanCompareType compareType, short value1, short value2) + { + var sut = new ShortMemoryComparer(compareType, value1, value2); + + Check.That(sut.CompareType).IsEqualTo(compareType); + Check.That(sut.ValueSize).IsEqualTo(sizeof(short)); + Check.That(sut.Value1).IsOneOf(value1, value2); + Check.That(sut.Value2).IsOneOf(value1, value2); + if (compareType == ScanCompareType.Between || compareType == ScanCompareType.BetweenOrEqual) + { + Check.That(sut.Value1 <= sut.Value2).IsTrue(); + } + } + + public static TheoryData GetTestCompareBasicData() => new TheoryData + { + { ScanCompareType.Equal, 0, 0, BitConverter.GetBytes((short)0), true, new ShortScanResult(0) }, + { ScanCompareType.Equal, 0, 0, BitConverter.GetBytes((short)1), false, null }, + { ScanCompareType.Equal, 1, 0, BitConverter.GetBytes((short)1), true, new ShortScanResult(1) }, + { ScanCompareType.Equal, 1, 0, BitConverter.GetBytes((short)0), false, null }, + { ScanCompareType.NotEqual, 1, 0, BitConverter.GetBytes((short)0), true, new ShortScanResult(0) }, + { ScanCompareType.NotEqual, 1, 0, BitConverter.GetBytes((short)1), false, null }, + { ScanCompareType.GreaterThan, 1, 0, BitConverter.GetBytes((short)0), false, null }, + { ScanCompareType.GreaterThan, 1, 0, BitConverter.GetBytes((short)2), true, new ShortScanResult(2) }, + { ScanCompareType.GreaterThanOrEqual, 1, 0, BitConverter.GetBytes((short)0), false, null }, + { ScanCompareType.GreaterThanOrEqual, 1, 0, BitConverter.GetBytes((short)1), true, new ShortScanResult(1) }, + { ScanCompareType.GreaterThanOrEqual, 1, 0, BitConverter.GetBytes((short)2), true, new ShortScanResult(2) }, + { ScanCompareType.LessThan, 1, 0, BitConverter.GetBytes((short)1), false, null }, + { ScanCompareType.LessThan, 1, 0, BitConverter.GetBytes((short)0), true, new ShortScanResult(0) }, + { ScanCompareType.LessThanOrEqual, 1, 0, BitConverter.GetBytes((short)2), false, null }, + { ScanCompareType.LessThanOrEqual, 1, 0, BitConverter.GetBytes((short)1), true, new ShortScanResult(1) }, + { ScanCompareType.LessThanOrEqual, 1, 0, BitConverter.GetBytes((short)0), true, new ShortScanResult(0) }, + { ScanCompareType.Between, 1, 2, BitConverter.GetBytes((short)0), false, null }, + { ScanCompareType.Between, 1, 2, BitConverter.GetBytes((short)1), false, null }, + { ScanCompareType.Between, 1, 2, BitConverter.GetBytes((short)2), false, null }, + { ScanCompareType.Between, 1, 2, BitConverter.GetBytes((short)3), false, null }, + { ScanCompareType.BetweenOrEqual, 1, 2, BitConverter.GetBytes((short)0), false, null }, + { ScanCompareType.BetweenOrEqual, 1, 2, BitConverter.GetBytes((short)1), true, new ShortScanResult(1) }, + { ScanCompareType.BetweenOrEqual, 1, 2, BitConverter.GetBytes((short)2), true, new ShortScanResult(2) }, + { ScanCompareType.BetweenOrEqual, 1, 2, BitConverter.GetBytes((short)3), false, null } + }; + + public static TheoryData GetTestCompareScanCompareTypeUnknownData() => new TheoryData + { + { ScanCompareType.Unknown, 0, 0, BitConverter.GetBytes((short)0), true, new ShortScanResult(0) }, + { ScanCompareType.Unknown, 0, 0, BitConverter.GetBytes((short)1), true, new ShortScanResult(1) } + }; + + [Theory] + [MemberData(nameof(GetTestCompareBasicData))] + [MemberData(nameof(GetTestCompareScanCompareTypeUnknownData))] + public void TestCompare(ScanCompareType compareType, short value1, short value2, byte[] data, bool expectedResult, ScanResult expectedScanResult) + { + var sut = new ShortMemoryComparer(compareType, value1, value2); + + Check.That(sut.Compare(data, 0, out var scanResult)).IsEqualTo(expectedResult); + Check.That(scanResult).IsEqualTo(expectedScanResult); + if (scanResult != null) + { + Check.That(scanResult).IsInstanceOf(); + } + } + + [Theory] + [InlineData(ScanCompareType.Changed)] + [InlineData(ScanCompareType.NotChanged)] + [InlineData(ScanCompareType.Decreased)] + [InlineData(ScanCompareType.DecreasedOrEqual)] + [InlineData(ScanCompareType.Increased)] + [InlineData(ScanCompareType.IncreasedOrEqual)] + public void TestCompareInvalidCompareTypeThrows(ScanCompareType compareType) + { + var sut = new ShortMemoryComparer(compareType, 0, 0); + + Check.ThatCode(() => sut.Compare(BitConverter.GetBytes((short)0), 0, out _)).Throws(); + } + + public static TheoryData GetTestCompareThrowsData() => new TheoryData + { + { null, 0, typeof(ArgumentNullException) }, + { new byte[0], 0, typeof(ArgumentOutOfRangeException) }, + { new byte[2], 2, typeof(ArgumentOutOfRangeException) }, + { new byte[1], 0, typeof(ArgumentException) }, + { new byte[2], 1, typeof(ArgumentException) } + }; + + [Theory] + [MemberData(nameof(GetTestCompareThrowsData))] + public void TestCompareInvalidDataThrows(byte[] data, int index, Type expectedExceptionType) + { + var sut = new ShortMemoryComparer(ScanCompareType.Equal, 0, 0); + + Check.ThatCode(() => sut.Compare(data, index, out _)).ThrowsType(expectedExceptionType); + } + + public static TheoryData GetTestCompareWithPreviousData() + { + var data = new TheoryData + { + { ScanCompareType.Changed, 0, 0, BitConverter.GetBytes((short)0), new ShortScanResult(1), true, new ShortScanResult(0) }, + { ScanCompareType.Changed, 0, 0, BitConverter.GetBytes((short)1), new ShortScanResult(1), false, null }, + { ScanCompareType.NotChanged, 0, 0, BitConverter.GetBytes((short)1), new ShortScanResult(1), true, new ShortScanResult(1) }, + { ScanCompareType.NotChanged, 0, 0, BitConverter.GetBytes((short)0), new ShortScanResult(1), false, null }, + { ScanCompareType.Increased, 0, 0, BitConverter.GetBytes((short)2), new ShortScanResult(1), true, new ShortScanResult(2) }, + { ScanCompareType.Increased, 0, 0, BitConverter.GetBytes((short)1), new ShortScanResult(1), false, null }, + { ScanCompareType.Increased, 0, 0, BitConverter.GetBytes((short)0), new ShortScanResult(1), false, null }, + { ScanCompareType.IncreasedOrEqual, 0, 0, BitConverter.GetBytes((short)2), new ShortScanResult(1), true, new ShortScanResult(2) }, + { ScanCompareType.IncreasedOrEqual, 0, 0, BitConverter.GetBytes((short)1), new ShortScanResult(1), true, new ShortScanResult(1) }, + { ScanCompareType.IncreasedOrEqual, 0, 0, BitConverter.GetBytes((short)0), new ShortScanResult(1), false, null }, + { ScanCompareType.Decreased, 0, 0, BitConverter.GetBytes((short)0), new ShortScanResult(1), true, new ShortScanResult(0) }, + { ScanCompareType.Decreased, 0, 0, BitConverter.GetBytes((short)1), new ShortScanResult(1), false, null }, + { ScanCompareType.Decreased, 0, 0, BitConverter.GetBytes((short)2), new ShortScanResult(1), false, null }, + { ScanCompareType.DecreasedOrEqual, 0, 0, BitConverter.GetBytes((short)0), new ShortScanResult(1), true, new ShortScanResult(0) }, + { ScanCompareType.DecreasedOrEqual, 0, 0, BitConverter.GetBytes((short)1), new ShortScanResult(1), true, new ShortScanResult(1) }, + { ScanCompareType.DecreasedOrEqual, 0, 0, BitConverter.GetBytes((short)2), new ShortScanResult(1), false, null } + }; + + var basicData = GetTestCompareBasicData(); + foreach (var x in basicData) + { + data.Add((ScanCompareType)x[0], (short)x[1], (short)x[2], (byte[])x[3], new ShortScanResult(1), (bool)x[4], (ScanResult)x[5]); + } + + return data; + } + + [Theory] + [MemberData(nameof(GetTestCompareWithPreviousData))] + public void TestCompareWithPrevious(ScanCompareType compareType, short value1, short value2, byte[] data, ScanResult previousScanResult, bool expectedResult, ScanResult expectedScanResult) + { + var sut = new ShortMemoryComparer(compareType, value1, value2); + + Check.That(sut.Compare(data, 0, previousScanResult, out var scanResult)).IsEqualTo(expectedResult); + Check.That(scanResult).IsEqualTo(expectedScanResult); + if (scanResult != null) + { + Check.That(scanResult).IsInstanceOf(); + } + } + + [Fact] + public void TestCompareWithPreviousThrows() + { + var sut = new ShortMemoryComparer(ScanCompareType.Unknown, 0, 0); + + Check.ThatCode(() => sut.Compare(BitConverter.GetBytes((short)0), 0, new ShortScanResult(0), out _)).Throws(); + } + } +} diff --git a/ReClass.NET_Tests/ReClass.NET_Tests.csproj b/ReClass.NET_Tests/ReClass.NET_Tests.csproj index df0caa72..bfb7bd79 100644 --- a/ReClass.NET_Tests/ReClass.NET_Tests.csproj +++ b/ReClass.NET_Tests/ReClass.NET_Tests.csproj @@ -80,6 +80,9 @@ + + + From 439eb9479ec8d3df9b376753999408fff1502c96 Mon Sep 17 00:00:00 2001 From: KN4CK3R Date: Mon, 8 Jul 2019 23:16:02 +0200 Subject: [PATCH 090/223] Added missing test. --- ReClass.NET_Tests/AddressParser/ExecutorTest.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ReClass.NET_Tests/AddressParser/ExecutorTest.cs b/ReClass.NET_Tests/AddressParser/ExecutorTest.cs index c85284d2..748eac5a 100644 --- a/ReClass.NET_Tests/AddressParser/ExecutorTest.cs +++ b/ReClass.NET_Tests/AddressParser/ExecutorTest.cs @@ -44,7 +44,8 @@ public void SimpleExpressionTest(string expression, IntPtr expected) new object[] { "", (IntPtr)0x100 }, new object[] { " + 0", (IntPtr)0x100 }, new object[] { " + 10", (IntPtr)0x110 }, - new object[] { " * 2", (IntPtr)0x200 } + new object[] { " * 2", (IntPtr)0x200 }, + new object[] { "", (IntPtr)0x0 }, }; [Theory] From d596b3ff4b72d1fb4637a17e51b6353f07ea66f7 Mon Sep 17 00:00:00 2001 From: KN4CK3R Date: Tue, 9 Jul 2019 18:38:13 +0200 Subject: [PATCH 091/223] Fixed #122. --- ReClass.NET/Extensions/IntPtrExtensions.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ReClass.NET/Extensions/IntPtrExtensions.cs b/ReClass.NET/Extensions/IntPtrExtensions.cs index 88c73773..7f2ff58a 100644 --- a/ReClass.NET/Extensions/IntPtrExtensions.cs +++ b/ReClass.NET/Extensions/IntPtrExtensions.cs @@ -18,7 +18,7 @@ public static bool IsNull(this IntPtr ptr) public static bool MayBeValid(this IntPtr ptr) { #if RECLASSNET64 - return ptr.InRange((IntPtr)0x10000, (IntPtr)long.MaxValue); + return ptr.IsInRange((IntPtr)0x10000, (IntPtr)long.MaxValue); #else return ptr.IsInRange((IntPtr)0x10000, (IntPtr)int.MaxValue); #endif From c3d27b599e6c1fe7bdadc3f6e7909dc06db28e8d Mon Sep 17 00:00:00 2001 From: KN4CK3R Date: Mon, 29 Jul 2019 23:08:43 +0200 Subject: [PATCH 092/223] Moved value switch. --- ReClass.NET/Forms/ScannerForm.cs | 16 ++++++++++++++++ .../MemoryScanner/Comparer/ByteMemoryComparer.cs | 8 -------- .../Comparer/DoubleMemoryComparer.cs | 8 -------- .../Comparer/FloatMemoryComparer.cs | 8 -------- .../Comparer/IntegerMemoryComparer.cs | 8 -------- .../MemoryScanner/Comparer/LongMemoryComparer.cs | 8 -------- .../Comparer/ShortMemoryComparer.cs | 8 -------- .../Comparer/ByteMemoryComparerTest.cs | 4 ---- .../Comparer/IntegerMemoryComparerTest.cs | 4 ---- .../Comparer/LongMemoryComparerTest.cs | 4 ---- .../Comparer/ShortMemoryComparerTest.cs | 4 ---- 11 files changed, 16 insertions(+), 64 deletions(-) diff --git a/ReClass.NET/Forms/ScannerForm.cs b/ReClass.NET/Forms/ScannerForm.cs index 47f602a5..7427974e 100644 --- a/ReClass.NET/Forms/ScannerForm.cs +++ b/ReClass.NET/Forms/ScannerForm.cs @@ -734,6 +734,14 @@ private IScanComparer CreateComparer(ScanSettings settings) if (!long.TryParse(dualValueBox.Value1, numberStyle, null, out var value1)) throw new InvalidInputException(dualValueBox.Value1); if (!long.TryParse(dualValueBox.Value2, numberStyle, null, out var value2) && checkBothInputFields) throw new InvalidInputException(dualValueBox.Value2); + if (compareType == ScanCompareType.Between || compareType == ScanCompareType.BetweenOrEqual) + { + if (value1 > value2) + { + Utils.Swap(ref value1, ref value2); + } + } + switch (settings.ValueType) { case ScanValueType.Byte: @@ -769,6 +777,14 @@ int CalculateSignificantDigits(string input, NumberFormatInfo numberFormat) var nf2 = NumberFormat.GuessNumberFormat(dualValueBox.Value2); if (!double.TryParse(dualValueBox.Value2, NumberStyles.Float, nf2, out var value2) && checkBothInputFields) throw new InvalidInputException(dualValueBox.Value2); + if (compareType == ScanCompareType.Between || compareType == ScanCompareType.BetweenOrEqual) + { + if (value1 > value2) + { + Utils.Swap(ref value1, ref value2); + } + } + var significantDigits = Math.Max( CalculateSignificantDigits(dualValueBox.Value1, nf1), CalculateSignificantDigits(dualValueBox.Value2, nf2) diff --git a/ReClass.NET/MemoryScanner/Comparer/ByteMemoryComparer.cs b/ReClass.NET/MemoryScanner/Comparer/ByteMemoryComparer.cs index 849c1c38..737554f5 100644 --- a/ReClass.NET/MemoryScanner/Comparer/ByteMemoryComparer.cs +++ b/ReClass.NET/MemoryScanner/Comparer/ByteMemoryComparer.cs @@ -15,14 +15,6 @@ public ByteMemoryComparer(ScanCompareType compareType, byte value1, byte value2) { CompareType = compareType; - if (compareType == ScanCompareType.Between || compareType == ScanCompareType.BetweenOrEqual) - { - if (value1 > value2) - { - Utils.Swap(ref value1, ref value2); - } - } - Value1 = value1; Value2 = value2; } diff --git a/ReClass.NET/MemoryScanner/Comparer/DoubleMemoryComparer.cs b/ReClass.NET/MemoryScanner/Comparer/DoubleMemoryComparer.cs index eabd011a..ee713f59 100644 --- a/ReClass.NET/MemoryScanner/Comparer/DoubleMemoryComparer.cs +++ b/ReClass.NET/MemoryScanner/Comparer/DoubleMemoryComparer.cs @@ -21,14 +21,6 @@ public DoubleMemoryComparer(ScanCompareType compareType, ScanRoundMode roundType { CompareType = compareType; - if (compareType == ScanCompareType.Between || compareType == ScanCompareType.BetweenOrEqual) - { - if (value1 > value2) - { - Utils.Swap(ref value1, ref value2); - } - } - RoundType = roundType; this.significantDigits = Math.Max(significantDigits, 1); Value1 = Math.Round(value1, this.significantDigits, MidpointRounding.AwayFromZero); diff --git a/ReClass.NET/MemoryScanner/Comparer/FloatMemoryComparer.cs b/ReClass.NET/MemoryScanner/Comparer/FloatMemoryComparer.cs index bdcddad8..c56200cc 100644 --- a/ReClass.NET/MemoryScanner/Comparer/FloatMemoryComparer.cs +++ b/ReClass.NET/MemoryScanner/Comparer/FloatMemoryComparer.cs @@ -21,14 +21,6 @@ public FloatMemoryComparer(ScanCompareType compareType, ScanRoundMode roundType, { CompareType = compareType; - if (compareType == ScanCompareType.Between || compareType == ScanCompareType.BetweenOrEqual) - { - if (value1 > value2) - { - Utils.Swap(ref value1, ref value2); - } - } - RoundType = roundType; this.significantDigits = Math.Max(significantDigits, 1); Value1 = (float)Math.Round(value1, this.significantDigits, MidpointRounding.AwayFromZero); diff --git a/ReClass.NET/MemoryScanner/Comparer/IntegerMemoryComparer.cs b/ReClass.NET/MemoryScanner/Comparer/IntegerMemoryComparer.cs index aefd4235..6d2dedd1 100644 --- a/ReClass.NET/MemoryScanner/Comparer/IntegerMemoryComparer.cs +++ b/ReClass.NET/MemoryScanner/Comparer/IntegerMemoryComparer.cs @@ -15,14 +15,6 @@ public IntegerMemoryComparer(ScanCompareType compareType, int value1, int value2 { CompareType = compareType; - if (compareType == ScanCompareType.Between || compareType == ScanCompareType.BetweenOrEqual) - { - if (value1 > value2) - { - Utils.Swap(ref value1, ref value2); - } - } - Value1 = value1; Value2 = value2; } diff --git a/ReClass.NET/MemoryScanner/Comparer/LongMemoryComparer.cs b/ReClass.NET/MemoryScanner/Comparer/LongMemoryComparer.cs index baa5c4fb..e6fb54ed 100644 --- a/ReClass.NET/MemoryScanner/Comparer/LongMemoryComparer.cs +++ b/ReClass.NET/MemoryScanner/Comparer/LongMemoryComparer.cs @@ -15,14 +15,6 @@ public LongMemoryComparer(ScanCompareType compareType, long value1, long value2) { CompareType = compareType; - if (compareType == ScanCompareType.Between || compareType == ScanCompareType.BetweenOrEqual) - { - if (value1 > value2) - { - Utils.Swap(ref value1, ref value2); - } - } - Value1 = value1; Value2 = value2; } diff --git a/ReClass.NET/MemoryScanner/Comparer/ShortMemoryComparer.cs b/ReClass.NET/MemoryScanner/Comparer/ShortMemoryComparer.cs index b40d25f5..3f7e7edd 100644 --- a/ReClass.NET/MemoryScanner/Comparer/ShortMemoryComparer.cs +++ b/ReClass.NET/MemoryScanner/Comparer/ShortMemoryComparer.cs @@ -15,14 +15,6 @@ public ShortMemoryComparer(ScanCompareType compareType, short value1, short valu { CompareType = compareType; - if (compareType == ScanCompareType.Between || compareType == ScanCompareType.BetweenOrEqual) - { - if (value1 > value2) - { - Utils.Swap(ref value1, ref value2); - } - } - Value1 = value1; Value2 = value2; } diff --git a/ReClass.NET_Tests/MemoryScanner/Comparer/ByteMemoryComparerTest.cs b/ReClass.NET_Tests/MemoryScanner/Comparer/ByteMemoryComparerTest.cs index c6d1d2b0..bdb74875 100644 --- a/ReClass.NET_Tests/MemoryScanner/Comparer/ByteMemoryComparerTest.cs +++ b/ReClass.NET_Tests/MemoryScanner/Comparer/ByteMemoryComparerTest.cs @@ -23,10 +23,6 @@ public void TestConstructor(ScanCompareType compareType, byte value1, byte value Check.That(sut.ValueSize).IsEqualTo(sizeof(byte)); Check.That(sut.Value1).IsOneOf(value1, value2); Check.That(sut.Value2).IsOneOf(value1, value2); - if (compareType == ScanCompareType.Between || compareType == ScanCompareType.BetweenOrEqual) - { - Check.That(sut.Value1 <= sut.Value2).IsTrue(); - } } public static TheoryData GetTestCompareBasicData() => new TheoryData diff --git a/ReClass.NET_Tests/MemoryScanner/Comparer/IntegerMemoryComparerTest.cs b/ReClass.NET_Tests/MemoryScanner/Comparer/IntegerMemoryComparerTest.cs index 027432bc..acbfd201 100644 --- a/ReClass.NET_Tests/MemoryScanner/Comparer/IntegerMemoryComparerTest.cs +++ b/ReClass.NET_Tests/MemoryScanner/Comparer/IntegerMemoryComparerTest.cs @@ -23,10 +23,6 @@ public void TestConstructor(ScanCompareType compareType, int value1, int value2) Check.That(sut.ValueSize).IsEqualTo(sizeof(int)); Check.That(sut.Value1).IsOneOf(value1, value2); Check.That(sut.Value2).IsOneOf(value1, value2); - if (compareType == ScanCompareType.Between || compareType == ScanCompareType.BetweenOrEqual) - { - Check.That(sut.Value1 <= sut.Value2).IsTrue(); - } } public static TheoryData GetTestCompareBasicData() => new TheoryData diff --git a/ReClass.NET_Tests/MemoryScanner/Comparer/LongMemoryComparerTest.cs b/ReClass.NET_Tests/MemoryScanner/Comparer/LongMemoryComparerTest.cs index 86fc5e70..f2790648 100644 --- a/ReClass.NET_Tests/MemoryScanner/Comparer/LongMemoryComparerTest.cs +++ b/ReClass.NET_Tests/MemoryScanner/Comparer/LongMemoryComparerTest.cs @@ -23,10 +23,6 @@ public void TestConstructor(ScanCompareType compareType, long value1, long value Check.That(sut.ValueSize).IsEqualTo(sizeof(long)); Check.That(sut.Value1).IsOneOf(value1, value2); Check.That(sut.Value2).IsOneOf(value1, value2); - if (compareType == ScanCompareType.Between || compareType == ScanCompareType.BetweenOrEqual) - { - Check.That(sut.Value1 <= sut.Value2).IsTrue(); - } } public static TheoryData GetTestCompareBasicData() => new TheoryData diff --git a/ReClass.NET_Tests/MemoryScanner/Comparer/ShortMemoryComparerTest.cs b/ReClass.NET_Tests/MemoryScanner/Comparer/ShortMemoryComparerTest.cs index 6f013063..7c3109fe 100644 --- a/ReClass.NET_Tests/MemoryScanner/Comparer/ShortMemoryComparerTest.cs +++ b/ReClass.NET_Tests/MemoryScanner/Comparer/ShortMemoryComparerTest.cs @@ -23,10 +23,6 @@ public void TestConstructor(ScanCompareType compareType, short value1, short val Check.That(sut.ValueSize).IsEqualTo(sizeof(short)); Check.That(sut.Value1).IsOneOf(value1, value2); Check.That(sut.Value2).IsOneOf(value1, value2); - if (compareType == ScanCompareType.Between || compareType == ScanCompareType.BetweenOrEqual) - { - Check.That(sut.Value1 <= sut.Value2).IsTrue(); - } } public static TheoryData GetTestCompareBasicData() => new TheoryData From 61771286097093e871aa2e811c10560b9fe3d51d Mon Sep 17 00:00:00 2001 From: KN4CK3R Date: Mon, 29 Jul 2019 23:10:22 +0200 Subject: [PATCH 093/223] Added x64 define. --- ReClass.NET_Tests/ReClass.NET_Tests.csproj | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ReClass.NET_Tests/ReClass.NET_Tests.csproj b/ReClass.NET_Tests/ReClass.NET_Tests.csproj index bfb7bd79..53798768 100644 --- a/ReClass.NET_Tests/ReClass.NET_Tests.csproj +++ b/ReClass.NET_Tests/ReClass.NET_Tests.csproj @@ -41,7 +41,7 @@ full false bin\Debug\ - DEBUG;TRACE + TRACE;DEBUG;RECLASSNET64 prompt 4 x64 @@ -50,7 +50,7 @@ pdbonly true bin\Release\ - TRACE + TRACE;RECLASSNET64 prompt 4 x64 @@ -81,6 +81,7 @@ + From d198b09d4a852d1c2cf54b18dd8a6ba425a17333 Mon Sep 17 00:00:00 2001 From: titto Date: Wed, 7 Aug 2019 01:10:37 +1000 Subject: [PATCH 094/223] Fixed the issue with enums in the flags mode caused by conversion from signed to unsigned values. Fixed ordering of the values in the Enums editor. --- ReClass.NET/Nodes/EnumNode.cs | 74 ++++++++++++++++---------- ReClass.NET/Project/EnumDescription.cs | 2 +- 2 files changed, 48 insertions(+), 28 deletions(-) diff --git a/ReClass.NET/Nodes/EnumNode.cs b/ReClass.NET/Nodes/EnumNode.cs index 9a4dd947..1621e19e 100644 --- a/ReClass.NET/Nodes/EnumNode.cs +++ b/ReClass.NET/Nodes/EnumNode.cs @@ -51,27 +51,49 @@ public BaseNumericNode GetUnderlayingNode() throw new Exception(); // TODO } - public long ReadValueFromMemory(MemoryBuffer memory) + private long ReadValueFromMemory(MemoryBuffer memory) + { + switch (Enum.Size) + { + case EnumDescription.UnderlyingTypeSize.OneByte: + return memory.ReadInt8(Offset); + case EnumDescription.UnderlyingTypeSize.TwoBytes: + return memory.ReadInt16(Offset); + case EnumDescription.UnderlyingTypeSize.FourBytes: + return memory.ReadInt32(Offset); + case EnumDescription.UnderlyingTypeSize.EightBytes: + return memory.ReadInt64(Offset); + } + + throw new Exception(); // TODO + } + + private ulong ReadFlagsValueFromMemory(MemoryBuffer memory) { - switch (Enum.Size) - { - case EnumDescription.UnderlyingTypeSize.OneByte: - return memory.ReadInt8(Offset); - case EnumDescription.UnderlyingTypeSize.TwoBytes: - return memory.ReadInt16(Offset); - case EnumDescription.UnderlyingTypeSize.FourBytes: - return memory.ReadInt32(Offset); - case EnumDescription.UnderlyingTypeSize.EightBytes: - return memory.ReadInt64(Offset); - } - - throw new Exception(); // TODO - } - - private string GetStringRepresentation(long value) + // Flags should be read as an unsigned value. + switch (Enum.Size) + { + case EnumDescription.UnderlyingTypeSize.OneByte: + return memory.ReadUInt8(Offset); + case EnumDescription.UnderlyingTypeSize.TwoBytes: + return memory.ReadUInt16(Offset); + case EnumDescription.UnderlyingTypeSize.FourBytes: + return memory.ReadUInt32(Offset); + case EnumDescription.UnderlyingTypeSize.EightBytes: + return memory.ReadUInt64(Offset); + } + + throw new Exception(); // TODO + } + + private string GetTextRepresentation(MemoryBuffer memory) + { + return Enum.UseFlagsMode ? GetFlagsStringRepresentation(memory) : GetStringRepresentation(memory); + } + + private string GetStringRepresentation(MemoryBuffer memory) { - if (!Enum.UseFlagsMode) - { + var value = ReadValueFromMemory(memory); var index = Enum.Values.FindIndex(kv => kv.Value == value); if (index == -1) { @@ -79,14 +101,12 @@ private string GetStringRepresentation(long value) } return Enum.Values[index].Key; - } - - return GetFlagsStringRepresentation(value); } - private string GetFlagsStringRepresentation(long value) - { - var result = (ulong)value; + private string GetFlagsStringRepresentation(MemoryBuffer memory) + { + var value = ReadFlagsValueFromMemory(memory); + var result = value; var values = Enum.Values; @@ -163,9 +183,9 @@ public override Size Draw(ViewInfo view, int x, int y) x = AddText(view, x, y, view.Settings.TextColor, HotSpot.NoneId, "=") + view.Font.Width; - var value = ReadValueFromMemory(view.Memory); + var text = GetTextRepresentation(view.Memory); - x = AddText(view, x, y, view.Settings.TextColor, HotSpot.NoneId, GetStringRepresentation(value)) + view.Font.Width; + x = AddText(view, x, y, view.Settings.TextColor, HotSpot.NoneId, text) + view.Font.Width; x = AddComment(view, x, y); diff --git a/ReClass.NET/Project/EnumDescription.cs b/ReClass.NET/Project/EnumDescription.cs index e40d647c..6c72596b 100644 --- a/ReClass.NET/Project/EnumDescription.cs +++ b/ReClass.NET/Project/EnumDescription.cs @@ -26,7 +26,7 @@ public enum UnderlyingTypeSize public void SetData(bool useFlagsMode, UnderlyingTypeSize size, IEnumerable> values) { - var temp = values.OrderBy(t => t.Key).ToList(); + var temp = values.OrderBy(t => t.Value).ToList(); if (useFlagsMode) { From 314da154c2806df672feb3d1c94a91d1566f8933 Mon Sep 17 00:00:00 2001 From: KN4CK3R Date: Sun, 11 Aug 2019 11:23:28 +0200 Subject: [PATCH 095/223] Fixed #130. --- ReClass.NET/Nodes/BitFieldNode.cs | 4 +++- ReClass.NET/Util/BitString.cs | 14 ++++++++------ 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/ReClass.NET/Nodes/BitFieldNode.cs b/ReClass.NET/Nodes/BitFieldNode.cs index 65d1da38..82b7d274 100644 --- a/ReClass.NET/Nodes/BitFieldNode.cs +++ b/ReClass.NET/Nodes/BitFieldNode.cs @@ -109,6 +109,8 @@ private string ConvertValueToBitString(MemoryBuffer memory) public override Size Draw(ViewInfo view, int x, int y) { + const int BitsPerBlock = 4; + if (IsHidden && !IsWrapped) { return DrawHidden(view, x, y); @@ -135,7 +137,7 @@ public override Size Draw(ViewInfo view, int x, int y) for (var i = 0; i < bits; ++i) { - var rect = new Rectangle(x + i * view.Font.Width, y, view.Font.Width, view.Font.Height); + var rect = new Rectangle(x + (i + i / BitsPerBlock) * view.Font.Width, y, view.Font.Width, view.Font.Height); AddHotSpot(view, rect, string.Empty, i, HotSpotType.Edit); } diff --git a/ReClass.NET/Util/BitString.cs b/ReClass.NET/Util/BitString.cs index 3343ed43..ba3cd1f8 100644 --- a/ReClass.NET/Util/BitString.cs +++ b/ReClass.NET/Util/BitString.cs @@ -51,15 +51,17 @@ public static string ToString(long value) private static string AddPaddingAndBuildBlocks(int bits, string value) { + const int BitsPerBlock = 4; + var sb = new StringBuilder(bits); var padding = bits - value.Length; // Add full padding blocks. - while (padding > 4) + while (padding > BitsPerBlock) { sb.Append("0000 "); - padding -= 4; + padding -= BitsPerBlock; } // Add only a part of a block. @@ -72,7 +74,7 @@ private static string AddPaddingAndBuildBlocks(int bits, string value) } // and {4 - padding} bits of the value. - sb.Append(value, 0, 4 - padding); + sb.Append(value, 0, BitsPerBlock - padding); if (value.Length > padding) { @@ -81,10 +83,10 @@ private static string AddPaddingAndBuildBlocks(int bits, string value) } // Add all remaining blocks. - for (var i = padding == 0 ? 0 : 4 - padding; i < value.Length; i += 4) + for (var i = padding == 0 ? 0 : BitsPerBlock - padding; i < value.Length; i += BitsPerBlock) { - sb.Append(value, i, 4); - if (i < value.Length - 4) + sb.Append(value, i, BitsPerBlock); + if (i < value.Length - BitsPerBlock) { sb.Append(' '); } From a762d0c03e99754a9d9ea35d5b267004261fef29 Mon Sep 17 00:00:00 2001 From: KN4CK3R Date: Sun, 18 Aug 2019 20:48:11 +0200 Subject: [PATCH 096/223] Fixed indentation. --- ReClass.NET/Nodes/EnumNode.cs | 403 +++++++++++++++++----------------- 1 file changed, 201 insertions(+), 202 deletions(-) diff --git a/ReClass.NET/Nodes/EnumNode.cs b/ReClass.NET/Nodes/EnumNode.cs index 1621e19e..4ba0c714 100644 --- a/ReClass.NET/Nodes/EnumNode.cs +++ b/ReClass.NET/Nodes/EnumNode.cs @@ -1,204 +1,203 @@ -using System; -using System.Diagnostics.Contracts; -using System.Drawing; -using System.Text; -using ReClassNET.Extensions; -using ReClassNET.Memory; -using ReClassNET.Project; -using ReClassNET.UI; - -namespace ReClassNET.Nodes -{ - public class EnumNode : BaseNode - { - public override int MemorySize => (int)Enum.Size; - - public EnumDescription Enum { get; private set; } = EnumDescription.Default; - - public override void GetUserInterfaceInfo(out string name, out Image icon) - { - name = "Enum"; - icon = Properties.Resources.B16x16_Button_Enum; - } - - public void ChangeEnum(EnumDescription @enum) - { - Contract.Requires(@enum != null); - - Enum = @enum; - - GetParentContainer()?.ChildHasChanged(this); - } - - /// - /// Gets the underlaying node for the enum field. - /// - /// - public BaseNumericNode GetUnderlayingNode() - { - switch (Enum.Size) - { - case EnumDescription.UnderlyingTypeSize.OneByte: - return new UInt8Node(); - case EnumDescription.UnderlyingTypeSize.TwoBytes: - return new UInt16Node(); - case EnumDescription.UnderlyingTypeSize.FourBytes: - return new UInt32Node(); - case EnumDescription.UnderlyingTypeSize.EightBytes: - return new UInt64Node(); - } - - throw new Exception(); // TODO - } - - private long ReadValueFromMemory(MemoryBuffer memory) +using System; +using System.Diagnostics.Contracts; +using System.Drawing; +using System.Text; +using ReClassNET.Extensions; +using ReClassNET.Memory; +using ReClassNET.Project; +using ReClassNET.UI; + +namespace ReClassNET.Nodes +{ + public class EnumNode : BaseNode + { + public override int MemorySize => (int)Enum.Size; + + public EnumDescription Enum { get; private set; } = EnumDescription.Default; + + public override void GetUserInterfaceInfo(out string name, out Image icon) + { + name = "Enum"; + icon = Properties.Resources.B16x16_Button_Enum; + } + + public void ChangeEnum(EnumDescription @enum) + { + Contract.Requires(@enum != null); + + Enum = @enum; + + GetParentContainer()?.ChildHasChanged(this); + } + + /// + /// Gets the underlaying node for the enum field. + /// + /// + public BaseNumericNode GetUnderlayingNode() + { + switch (Enum.Size) + { + case EnumDescription.UnderlyingTypeSize.OneByte: + return new UInt8Node(); + case EnumDescription.UnderlyingTypeSize.TwoBytes: + return new UInt16Node(); + case EnumDescription.UnderlyingTypeSize.FourBytes: + return new UInt32Node(); + case EnumDescription.UnderlyingTypeSize.EightBytes: + return new UInt64Node(); + } + + throw new Exception(); // TODO + } + + private long ReadValueFromMemory(MemoryBuffer memory) + { + switch (Enum.Size) + { + case EnumDescription.UnderlyingTypeSize.OneByte: + return memory.ReadInt8(Offset); + case EnumDescription.UnderlyingTypeSize.TwoBytes: + return memory.ReadInt16(Offset); + case EnumDescription.UnderlyingTypeSize.FourBytes: + return memory.ReadInt32(Offset); + case EnumDescription.UnderlyingTypeSize.EightBytes: + return memory.ReadInt64(Offset); + } + + throw new Exception(); // TODO + } + + private ulong ReadFlagsValueFromMemory(MemoryBuffer memory) + { + switch (Enum.Size) + { + case EnumDescription.UnderlyingTypeSize.OneByte: + return memory.ReadUInt8(Offset); + case EnumDescription.UnderlyingTypeSize.TwoBytes: + return memory.ReadUInt16(Offset); + case EnumDescription.UnderlyingTypeSize.FourBytes: + return memory.ReadUInt32(Offset); + case EnumDescription.UnderlyingTypeSize.EightBytes: + return memory.ReadUInt64(Offset); + } + + throw new Exception(); // TODO + } + + private string GetTextRepresentation(MemoryBuffer memory) + { + return Enum.UseFlagsMode ? GetFlagsStringRepresentation(memory) : GetStringRepresentation(memory); + } + + private string GetStringRepresentation(MemoryBuffer memory) + { + var value = ReadValueFromMemory(memory); + var index = Enum.Values.FindIndex(kv => kv.Value == value); + if (index == -1) + { + return value.ToString(); + } + + return Enum.Values[index].Key; + } + + private string GetFlagsStringRepresentation(MemoryBuffer memory) + { + var value = ReadFlagsValueFromMemory(memory); + var result = value; + + var values = Enum.Values; + + var index = values.Count - 1; + var retval = new StringBuilder(); + var firstTime = true; + var saveResult = result; + + while (index >= 0) + { + var temp = (ulong)values[index].Value; + if (index == 0 && temp == 0) + { + break; + } + + if ((result & temp) == temp) + { + result -= temp; + if (!firstTime) + { + retval.Prepend(" | "); + } + + retval.Prepend(values[index].Key); + firstTime = false; + } + + index--; + } + + if (result != 0) + { + return value.ToString(); + } + + if (saveResult == 0) + { + if (values.Count > 0 && values[0].Value == 0) + { + return values[0].Key; + } + + return "0"; + } + + return retval.ToString(); + } + + public override Size Draw(ViewInfo view, int x, int y) { - switch (Enum.Size) - { - case EnumDescription.UnderlyingTypeSize.OneByte: - return memory.ReadInt8(Offset); - case EnumDescription.UnderlyingTypeSize.TwoBytes: - return memory.ReadInt16(Offset); - case EnumDescription.UnderlyingTypeSize.FourBytes: - return memory.ReadInt32(Offset); - case EnumDescription.UnderlyingTypeSize.EightBytes: - return memory.ReadInt64(Offset); - } - - throw new Exception(); // TODO - } - - private ulong ReadFlagsValueFromMemory(MemoryBuffer memory) - { - // Flags should be read as an unsigned value. - switch (Enum.Size) - { - case EnumDescription.UnderlyingTypeSize.OneByte: - return memory.ReadUInt8(Offset); - case EnumDescription.UnderlyingTypeSize.TwoBytes: - return memory.ReadUInt16(Offset); - case EnumDescription.UnderlyingTypeSize.FourBytes: - return memory.ReadUInt32(Offset); - case EnumDescription.UnderlyingTypeSize.EightBytes: - return memory.ReadUInt64(Offset); - } - - throw new Exception(); // TODO - } - - private string GetTextRepresentation(MemoryBuffer memory) - { - return Enum.UseFlagsMode ? GetFlagsStringRepresentation(memory) : GetStringRepresentation(memory); - } - - private string GetStringRepresentation(MemoryBuffer memory) - { - var value = ReadValueFromMemory(memory); - var index = Enum.Values.FindIndex(kv => kv.Value == value); - if (index == -1) - { - return value.ToString(); - } - - return Enum.Values[index].Key; - } - - private string GetFlagsStringRepresentation(MemoryBuffer memory) + if (IsHidden && !IsWrapped) + { + return DrawHidden(view, x, y); + } + + var origX = x; + + AddSelection(view, x, y, view.Font.Height); + + x += TextPadding; + + x = AddIcon(view, x, y, Icons.Enum, HotSpot.NoneId, HotSpotType.None); + + x = AddAddressOffset(view, x, y); + + x = AddText(view, x, y, view.Settings.TypeColor, HotSpot.NoneId, "Enum") + view.Font.Width; + if (!IsWrapped) + { + x = AddText(view, x, y, view.Settings.NameColor, HotSpot.NameId, Name) + view.Font.Width; + } + x = AddText(view, x, y, view.Settings.ValueColor, HotSpot.NoneId, $"<{Enum.Name}>") + view.Font.Width; + x = AddIcon(view, x, y, Icons.Change, 4, HotSpotType.ChangeEnumType) + view.Font.Width; + + x = AddText(view, x, y, view.Settings.TextColor, HotSpot.NoneId, "=") + view.Font.Width; + + var text = GetTextRepresentation(view.Memory); + + x = AddText(view, x, y, view.Settings.TextColor, HotSpot.NoneId, text) + view.Font.Width; + + x = AddComment(view, x, y); + + DrawInvalidMemoryIndicatorIcon(view, y); + AddContextDropDownIcon(view, y); + AddDeleteIcon(view, y); + + return new Size(x - origX, view.Font.Height); + } + + public override int CalculateDrawnHeight(ViewInfo view) { - var value = ReadFlagsValueFromMemory(memory); - var result = value; - - var values = Enum.Values; - - var index = values.Count - 1; - var retval = new StringBuilder(); - var firstTime = true; - var saveResult = result; - - while (index >= 0) - { - var temp = (ulong)values[index].Value; - if (index == 0 && temp == 0) - { - break; - } - - if ((result & temp) == temp) - { - result -= temp; - if (!firstTime) - { - retval.Prepend(" | "); - } - - retval.Prepend(values[index].Key); - firstTime = false; - } - - index--; - } - - if (result != 0) - { - return value.ToString(); - } - - if (saveResult == 0) - { - if (values.Count > 0 && values[0].Value == 0) - { - return values[0].Key; - } - - return "0"; - } - - return retval.ToString(); - } - - public override Size Draw(ViewInfo view, int x, int y) - { - if (IsHidden && !IsWrapped) - { - return DrawHidden(view, x, y); - } - - var origX = x; - - AddSelection(view, x, y, view.Font.Height); - - x += TextPadding; - - x = AddIcon(view, x, y, Icons.Enum, HotSpot.NoneId, HotSpotType.None); - - x = AddAddressOffset(view, x, y); - - x = AddText(view, x, y, view.Settings.TypeColor, HotSpot.NoneId, "Enum") + view.Font.Width; - if (!IsWrapped) - { - x = AddText(view, x, y, view.Settings.NameColor, HotSpot.NameId, Name) + view.Font.Width; - } - x = AddText(view, x, y, view.Settings.ValueColor, HotSpot.NoneId, $"<{Enum.Name}>") + view.Font.Width; - x = AddIcon(view, x, y, Icons.Change, 4, HotSpotType.ChangeEnumType) + view.Font.Width; - - x = AddText(view, x, y, view.Settings.TextColor, HotSpot.NoneId, "=") + view.Font.Width; - - var text = GetTextRepresentation(view.Memory); - - x = AddText(view, x, y, view.Settings.TextColor, HotSpot.NoneId, text) + view.Font.Width; - - x = AddComment(view, x, y); - - DrawInvalidMemoryIndicatorIcon(view, y); - AddContextDropDownIcon(view, y); - AddDeleteIcon(view, y); - - return new Size(x - origX, view.Font.Height); - } - - public override int CalculateDrawnHeight(ViewInfo view) - { - return IsHidden && !IsWrapped ? HiddenHeight : view.Font.Height; - } - } -} + return IsHidden && !IsWrapped ? HiddenHeight : view.Font.Height; + } + } +} From a94d601a09712a8be0bba1b60677f5ca1384e530 Mon Sep 17 00:00:00 2001 From: KN4CK3R Date: Sun, 18 Aug 2019 20:51:56 +0200 Subject: [PATCH 097/223] Changed method names. --- ReClass.NET/Nodes/EnumNode.cs | 46 +++++++++++++++++------------------ 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/ReClass.NET/Nodes/EnumNode.cs b/ReClass.NET/Nodes/EnumNode.cs index 4ba0c714..82d817a4 100644 --- a/ReClass.NET/Nodes/EnumNode.cs +++ b/ReClass.NET/Nodes/EnumNode.cs @@ -51,7 +51,12 @@ public BaseNumericNode GetUnderlayingNode() throw new Exception(); // TODO } - private long ReadValueFromMemory(MemoryBuffer memory) + private string GetTextRepresentation(MemoryBuffer memory) + { + return Enum.UseFlagsMode ? GetFlagsStringRepresentation(memory) : GetStringRepresentation(memory); + } + + private long ReadSignedValueFromMemory(MemoryBuffer memory) { switch (Enum.Size) { @@ -63,12 +68,24 @@ private long ReadValueFromMemory(MemoryBuffer memory) return memory.ReadInt32(Offset); case EnumDescription.UnderlyingTypeSize.EightBytes: return memory.ReadInt64(Offset); + default: + throw new ArgumentOutOfRangeException(); } + } - throw new Exception(); // TODO + private string GetStringRepresentation(MemoryBuffer memory) + { + var value = ReadSignedValueFromMemory(memory); + var index = Enum.Values.FindIndex(kv => kv.Value == value); + if (index == -1) + { + return value.ToString(); + } + + return Enum.Values[index].Key; } - private ulong ReadFlagsValueFromMemory(MemoryBuffer memory) + private ulong ReadUnsignedValueFromMemory(MemoryBuffer memory) { switch (Enum.Size) { @@ -80,31 +97,14 @@ private ulong ReadFlagsValueFromMemory(MemoryBuffer memory) return memory.ReadUInt32(Offset); case EnumDescription.UnderlyingTypeSize.EightBytes: return memory.ReadUInt64(Offset); + default: + throw new ArgumentOutOfRangeException(); } - - throw new Exception(); // TODO - } - - private string GetTextRepresentation(MemoryBuffer memory) - { - return Enum.UseFlagsMode ? GetFlagsStringRepresentation(memory) : GetStringRepresentation(memory); - } - - private string GetStringRepresentation(MemoryBuffer memory) - { - var value = ReadValueFromMemory(memory); - var index = Enum.Values.FindIndex(kv => kv.Value == value); - if (index == -1) - { - return value.ToString(); - } - - return Enum.Values[index].Key; } private string GetFlagsStringRepresentation(MemoryBuffer memory) { - var value = ReadFlagsValueFromMemory(memory); + var value = ReadUnsignedValueFromMemory(memory); var result = value; var values = Enum.Values; From 613b19ce920bdfa9e9a5c395fb8da5941ec38054 Mon Sep 17 00:00:00 2001 From: KN4CK3R Date: Sun, 18 Aug 2019 20:56:04 +0200 Subject: [PATCH 098/223] Removed unused method. --- ReClass.NET/Nodes/EnumNode.cs | 21 --------------------- 1 file changed, 21 deletions(-) diff --git a/ReClass.NET/Nodes/EnumNode.cs b/ReClass.NET/Nodes/EnumNode.cs index 82d817a4..96a91c55 100644 --- a/ReClass.NET/Nodes/EnumNode.cs +++ b/ReClass.NET/Nodes/EnumNode.cs @@ -30,27 +30,6 @@ public void ChangeEnum(EnumDescription @enum) GetParentContainer()?.ChildHasChanged(this); } - /// - /// Gets the underlaying node for the enum field. - /// - /// - public BaseNumericNode GetUnderlayingNode() - { - switch (Enum.Size) - { - case EnumDescription.UnderlyingTypeSize.OneByte: - return new UInt8Node(); - case EnumDescription.UnderlyingTypeSize.TwoBytes: - return new UInt16Node(); - case EnumDescription.UnderlyingTypeSize.FourBytes: - return new UInt32Node(); - case EnumDescription.UnderlyingTypeSize.EightBytes: - return new UInt64Node(); - } - - throw new Exception(); // TODO - } - private string GetTextRepresentation(MemoryBuffer memory) { return Enum.UseFlagsMode ? GetFlagsStringRepresentation(memory) : GetStringRepresentation(memory); From 458642778e71a046ec7ef16acad40bf50b34a1eb Mon Sep 17 00:00:00 2001 From: KN4CK3R Date: Sun, 18 Aug 2019 20:58:07 +0200 Subject: [PATCH 099/223] Added compiler size check for classes. --- ReClass.NET/CodeGenerator/CppCodeGenerator.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ReClass.NET/CodeGenerator/CppCodeGenerator.cs b/ReClass.NET/CodeGenerator/CppCodeGenerator.cs index ead4bc0d..40510e36 100644 --- a/ReClass.NET/CodeGenerator/CppCodeGenerator.cs +++ b/ReClass.NET/CodeGenerator/CppCodeGenerator.cs @@ -348,6 +348,8 @@ private void WriteClass(IndentedTextWriter writer, ClassNode @class, IEnumerable writer.Indent--; writer.Write("}; //Size: 0x"); writer.WriteLine($"{@class.MemorySize:X04}"); + + writer.WriteLine($"static_assert(sizeof({@class.Name}) == 0x{@class.MemorySize:X});"); } /// From 6bb863d9bd7dbe2ed3ecc9b6995151e08662b1e2 Mon Sep 17 00:00:00 2001 From: KN4CK3R Date: Fri, 13 Sep 2019 16:44:36 +0200 Subject: [PATCH 100/223] Added missing file. --- .../Comparer/FloatMemoryComparer.cs | 1 - .../Comparer/FloatMemoryComparerTest.cs | 170 ++++++++++++++++++ 2 files changed, 170 insertions(+), 1 deletion(-) create mode 100644 ReClass.NET_Tests/MemoryScanner/Comparer/FloatMemoryComparerTest.cs diff --git a/ReClass.NET/MemoryScanner/Comparer/FloatMemoryComparer.cs b/ReClass.NET/MemoryScanner/Comparer/FloatMemoryComparer.cs index c56200cc..57aa6b9d 100644 --- a/ReClass.NET/MemoryScanner/Comparer/FloatMemoryComparer.cs +++ b/ReClass.NET/MemoryScanner/Comparer/FloatMemoryComparer.cs @@ -1,7 +1,6 @@ using System; using System.Diagnostics; using ReClassNET.Extensions; -using ReClassNET.Util; namespace ReClassNET.MemoryScanner.Comparer { diff --git a/ReClass.NET_Tests/MemoryScanner/Comparer/FloatMemoryComparerTest.cs b/ReClass.NET_Tests/MemoryScanner/Comparer/FloatMemoryComparerTest.cs new file mode 100644 index 00000000..5084f442 --- /dev/null +++ b/ReClass.NET_Tests/MemoryScanner/Comparer/FloatMemoryComparerTest.cs @@ -0,0 +1,170 @@ +using System; +using NFluent; +using ReClassNET.MemoryScanner; +using ReClassNET.MemoryScanner.Comparer; +using Xunit; + +namespace ReClass.NET_Tests.MemoryScanner.Comparer +{ + public class FloatMemoryComparerTest + { + [Theory] + [InlineData(ScanCompareType.Equal, ScanRoundMode.Normal, 0.0f, 0.0f)] + [InlineData(ScanCompareType.Equal, ScanRoundMode.Strict, 1.0f, 2.0f)] + [InlineData(ScanCompareType.Equal, ScanRoundMode.Truncate, 2.0f, 1.0f)] + [InlineData(ScanCompareType.Between, ScanRoundMode.Normal, 2.0f, 4.0f)] + [InlineData(ScanCompareType.BetweenOrEqual, ScanRoundMode.Strict, 4.0f, 2.0f)] + [InlineData(ScanCompareType.NotEqual, ScanRoundMode.Truncate, 0.0f, 0.0f)] + public void TestConstructor(ScanCompareType compareType, ScanRoundMode roundMode, float value1, float value2) + { + var sut = new FloatMemoryComparer(compareType, roundMode, 1, value1, value2); + + Check.That(sut.CompareType).IsEqualTo(compareType); + Check.That(sut.RoundType).IsEqualTo(roundMode); + Check.That(sut.ValueSize).IsEqualTo(sizeof(float)); + Check.That(sut.Value1).IsOneOf(value1, value2); + Check.That(sut.Value2).IsOneOf(value1, value2); + } + + [Theory] + [InlineData(1)] + [InlineData(2)] + [InlineData(3)] + public void TestConstructorSignificantDigits(int significantDigits) + { + const float Value1 = 1.234567f; + const float Value2 = 7.654321f; + + var sut = new FloatMemoryComparer(ScanCompareType.Equal, ScanRoundMode.Normal, significantDigits, Value1, Value2); + + Check.That(sut.Value1).IsEqualTo((float)Math.Round(Value1, significantDigits, MidpointRounding.AwayFromZero)); + Check.That(sut.Value2).IsEqualTo((float)Math.Round(Value2, significantDigits, MidpointRounding.AwayFromZero)); + } + + public static TheoryData GetTestCompareBasicData() => new TheoryData + { + { ScanCompareType.GreaterThan, 1.0f, 0.0f, BitConverter.GetBytes(0.0f), false, null }, + { ScanCompareType.GreaterThan, 1.0f, 0.0f, BitConverter.GetBytes(2.0f), true, new FloatScanResult(2.0f) }, + { ScanCompareType.GreaterThanOrEqual, 1.0f, 0.0f, BitConverter.GetBytes(0.0f), false, null }, + { ScanCompareType.GreaterThanOrEqual, 1.0f, 0.0f, BitConverter.GetBytes(1.0f), true, new FloatScanResult(1.0f) }, + { ScanCompareType.GreaterThanOrEqual, 1.0f, 0.0f, BitConverter.GetBytes(2.0f), true, new FloatScanResult(2.0f) }, + { ScanCompareType.LessThan, 1.0f, 0.0f, BitConverter.GetBytes(1.0f), false, null }, + { ScanCompareType.LessThan, 1.0f, 0.0f, BitConverter.GetBytes(0.0f), true, new FloatScanResult(0.0f) }, + { ScanCompareType.LessThanOrEqual, 1.0f, 0.0f, BitConverter.GetBytes(2.0f), false, null }, + { ScanCompareType.LessThanOrEqual, 1.0f, 0.0f, BitConverter.GetBytes(1.0f), true, new FloatScanResult(1.0f) }, + { ScanCompareType.LessThanOrEqual, 1.0f, 0.0f, BitConverter.GetBytes(0.0f), true, new FloatScanResult(0.0f) }, + { ScanCompareType.Between, 1.0f, 2.0f, BitConverter.GetBytes(0.0f), false, null }, + { ScanCompareType.Between, 1.0f, 2.0f, BitConverter.GetBytes(1.0f), false, null }, + { ScanCompareType.Between, 1.0f, 2.0f, BitConverter.GetBytes(2.0f), false, null }, + { ScanCompareType.Between, 1.0f, 2.0f, BitConverter.GetBytes(3.0f), false, null }, + { ScanCompareType.BetweenOrEqual, 1.0f, 2.0f, BitConverter.GetBytes(0.0f), false, null }, + { ScanCompareType.BetweenOrEqual, 1.0f, 2.0f, BitConverter.GetBytes(1.0f), true, new FloatScanResult(1.0f) }, + { ScanCompareType.BetweenOrEqual, 1.0f, 2.0f, BitConverter.GetBytes(2.0f), true, new FloatScanResult(2.0f) }, + { ScanCompareType.BetweenOrEqual, 1.0f, 2.0f, BitConverter.GetBytes(3.0f), false, null } + }; + + public static TheoryData GetTestCompareScanCompareTypeUnknownData() => new TheoryData + { + { ScanCompareType.Unknown, 0.0f, 0.0f, BitConverter.GetBytes(0.0f), true, new FloatScanResult(0.0f) }, + { ScanCompareType.Unknown, 0.0f, 0.0f, BitConverter.GetBytes(1.0f), true, new FloatScanResult(1.0f) } + }; + + [Theory] + [MemberData(nameof(GetTestCompareBasicData))] + [MemberData(nameof(GetTestCompareScanCompareTypeUnknownData))] + public void TestCompare(ScanCompareType compareType, float value1, float value2, byte[] data, bool expectedResult, ScanResult expectedScanResult) + { + var sut = new FloatMemoryComparer(compareType, ScanRoundMode.Normal, 1, value1, value2); + + Check.That(sut.Compare(data, 0, out var scanResult)).IsEqualTo(expectedResult); + Check.That(scanResult).IsEqualTo(expectedScanResult); + if (scanResult != null) + { + Check.That(scanResult).IsInstanceOf(); + } + } + + [Theory] + [InlineData(ScanCompareType.Changed)] + [InlineData(ScanCompareType.NotChanged)] + [InlineData(ScanCompareType.Decreased)] + [InlineData(ScanCompareType.DecreasedOrEqual)] + [InlineData(ScanCompareType.Increased)] + [InlineData(ScanCompareType.IncreasedOrEqual)] + public void TestCompareInvalidCompareTypeThrows(ScanCompareType compareType) + { + var sut = new FloatMemoryComparer(compareType, ScanRoundMode.Normal, 1, 0.0f, 0.0f); + + Check.ThatCode(() => sut.Compare(BitConverter.GetBytes(0.0f), 0, out _)).Throws(); + } + + public static TheoryData GetTestCompareThrowsData() => new TheoryData + { + { null, 0, typeof(ArgumentNullException) }, + { new byte[0], 0, typeof(ArgumentOutOfRangeException) }, + { new byte[1], 1, typeof(ArgumentOutOfRangeException) } + }; + + [Theory] + [MemberData(nameof(GetTestCompareThrowsData))] + public void TestCompareInvalidDataThrows(byte[] data, int index, Type expectedExceptionType) + { + var sut = new FloatMemoryComparer(ScanCompareType.Unknown, ScanRoundMode.Normal, 1, 0.0f, 0.0f); + + Check.ThatCode(() => sut.Compare(data, index, out _)).ThrowsType(expectedExceptionType); + } + + public static TheoryData GetTestCompareWithPreviousData() + { + var data = new TheoryData + { + { ScanCompareType.Changed, 0.0f, 0.0f, BitConverter.GetBytes(0.0f), new FloatScanResult(1.0f), true, new FloatScanResult(0.0f) }, + { ScanCompareType.Changed, 0.0f, 0.0f, BitConverter.GetBytes(1.0f), new FloatScanResult(1.0f), false, null }, + { ScanCompareType.NotChanged, 0.0f, 0.0f, BitConverter.GetBytes(1.0f), new FloatScanResult(1.0f), true, new FloatScanResult(1.0f) }, + { ScanCompareType.NotChanged, 0.0f, 0.0f, BitConverter.GetBytes(0.0f), new FloatScanResult(1.0f), false, null }, + { ScanCompareType.Increased, 0.0f, 0.0f, BitConverter.GetBytes(2.0f), new FloatScanResult(1.0f), true, new FloatScanResult(2.0f) }, + { ScanCompareType.Increased, 0.0f, 0.0f, BitConverter.GetBytes(1.0f), new FloatScanResult(1.0f), false, null }, + { ScanCompareType.Increased, 0.0f, 0.0f, BitConverter.GetBytes(0.0f), new FloatScanResult(1.0f), false, null }, + { ScanCompareType.IncreasedOrEqual, 0.0f, 0.0f, BitConverter.GetBytes(2.0f), new FloatScanResult(1.0f), true, new FloatScanResult(2.0f) }, + { ScanCompareType.IncreasedOrEqual, 0.0f, 0.0f, BitConverter.GetBytes(1.0f), new FloatScanResult(1.0f), true, new FloatScanResult(1.0f) }, + { ScanCompareType.IncreasedOrEqual, 0.0f, 0.0f, BitConverter.GetBytes(0.0f), new FloatScanResult(1.0f), false, null }, + { ScanCompareType.Decreased, 0.0f, 0.0f, BitConverter.GetBytes(0.0f), new FloatScanResult(1.0f), true, new FloatScanResult(0.0f) }, + { ScanCompareType.Decreased, 0.0f, 0.0f, BitConverter.GetBytes(1.0f), new FloatScanResult(1.0f), false, null }, + { ScanCompareType.Decreased, 0.0f, 0.0f, BitConverter.GetBytes(2.0f), new FloatScanResult(1.0f), false, null }, + { ScanCompareType.DecreasedOrEqual, 0.0f, 0.0f, BitConverter.GetBytes(0.0f), new FloatScanResult(1.0f), true, new FloatScanResult(0.0f) }, + { ScanCompareType.DecreasedOrEqual, 0.0f, 0.0f, BitConverter.GetBytes(1.0f), new FloatScanResult(1.0f), true, new FloatScanResult(1.0f) }, + { ScanCompareType.DecreasedOrEqual, 0.0f, 0.0f, BitConverter.GetBytes(2.0f), new FloatScanResult(1.0f), false, null } + }; + + var basicData = GetTestCompareBasicData(); + foreach (var x in basicData) + { + data.Add((ScanCompareType)x[0], (float)x[1], (float)x[2], (byte[])x[3], new FloatScanResult(1.0f), (bool)x[4], (ScanResult)x[5]); + } + + return data; + } + + [Theory] + [MemberData(nameof(GetTestCompareWithPreviousData))] + public void TestCompareWithPrevious(ScanCompareType compareType, float value1, float value2, byte[] data, ScanResult previousScanResult, bool expectedResult, ScanResult expectedScanResult) + { + var sut = new FloatMemoryComparer(compareType, ScanRoundMode.Normal, 1, value1, value2); + + Check.That(sut.Compare(data, 0, previousScanResult, out var scanResult)).IsEqualTo(expectedResult); + Check.That(scanResult).IsEqualTo(expectedScanResult); + if (scanResult != null) + { + Check.That(scanResult).IsInstanceOf(); + } + } + + [Fact] + public void TestCompareWithPreviousThrows() + { + var sut = new FloatMemoryComparer(ScanCompareType.Unknown, ScanRoundMode.Normal, 1, 0, 0); + + Check.ThatCode(() => sut.Compare(BitConverter.GetBytes(0.0f), 0, new FloatScanResult(0.0f), out _)).Throws(); + } + } +} From 386f89d773dc0260501b69ced8ab71475d37e1bd Mon Sep 17 00:00:00 2001 From: namazso Date: Sat, 21 Sep 2019 23:18:49 +0200 Subject: [PATCH 101/223] Almost only-RPM module enumeration --- .../EnumerateRemoteSectionsAndModules.cpp | 201 +++++++++++++----- 1 file changed, 142 insertions(+), 59 deletions(-) diff --git a/NativeCore/Windows/EnumerateRemoteSectionsAndModules.cpp b/NativeCore/Windows/EnumerateRemoteSectionsAndModules.cpp index f21f2539..d20e64f3 100644 --- a/NativeCore/Windows/EnumerateRemoteSectionsAndModules.cpp +++ b/NativeCore/Windows/EnumerateRemoteSectionsAndModules.cpp @@ -1,10 +1,108 @@ #include +#include #include #include #include #include "NativeCore.hpp" +template +static DWORD EnumerateRemoteModulesNative(HANDLE process, Proc proc) +{ + const auto ntdll = GetModuleHandle(TEXT("ntdll")); + if (!ntdll) + return ERROR_MOD_NOT_FOUND; + + using tRtlNtStatusToDosError = ULONG (NTAPI *)( + _In_ NTSTATUS Status + ); + const auto _RtlNtStatusToDosError = tRtlNtStatusToDosError(GetProcAddress(ntdll, "RtlNtStatusToDosError")); + if (!_RtlNtStatusToDosError) + return ERROR_NOT_FOUND; + + using tNtQueryInformationProcess = NTSTATUS (NTAPI *)( + _In_ HANDLE ProcessHandle, + _In_ PROCESSINFOCLASS ProcessInformationClass, + _Out_writes_bytes_(ProcessInformationLength) PVOID ProcessInformation, + _In_ ULONG ProcessInformationLength, + _Out_opt_ PULONG ReturnLength + ); + + const auto _NtQueryInformationProcess = tNtQueryInformationProcess(GetProcAddress(ntdll, "NtQueryInformationProcess")); + if (!_NtQueryInformationProcess) + return ERROR_NOT_FOUND; + + PROCESS_BASIC_INFORMATION pbi; + const auto status = _NtQueryInformationProcess(process, ProcessBasicInformation, &pbi, sizeof(pbi), nullptr); + if (!NT_SUCCESS(status)) + return _RtlNtStatusToDosError(status); + + PPEB_LDR_DATA ldr; + auto success = ReadRemoteMemory(process, &pbi.PebBaseAddress->Ldr, &ldr, 0, sizeof(ldr)); + if (!success) + return ERROR_READ_FAULT; // we seem to swallow the error anyways, might aswell give a distinctive one back + + const auto list_head = &ldr->InMemoryOrderModuleList; // remote address + PLIST_ENTRY list_current; // remote address + success = ReadRemoteMemory(process, &list_head->Flink, &list_current, 0, sizeof(list_current)); + if (!success) + return ERROR_READ_FAULT; + + while (list_current != list_head) + { + // TODO: error handling - what do we do if module list changed? We can't un-call the callback + + LDR_DATA_TABLE_ENTRY mod; + success = ReadRemoteMemory(process, CONTAINING_RECORD(list_current, LDR_DATA_TABLE_ENTRY, InMemoryOrderLinks), &mod, 0, sizeof(mod)); + if (!success) + return ERROR_SUCCESS; // return success here to prevent running the other one + + EnumerateRemoteModuleData data = {}; + data.BaseAddress = mod.DllBase; + data.Size = *(ULONG*)&mod.Reserved2[1]; // instead of undocced member could read ImageSize from headers + const auto path_len = std::min(sizeof(RC_UnicodeChar) * (PATH_MAXIMUM_LENGTH - 1), size_t(mod.FullDllName.Length)); + success = ReadRemoteMemory(process, mod.FullDllName.Buffer, data.Path, 0, int(path_len)); + if (!success) + return ERROR_SUCCESS; // return success here to prevent running the other one + + // UNICODE_STRING is not guaranteed to be null terminated + data.Path[path_len / 2] = 0; + + proc(&data); + + list_current = mod.InMemoryOrderLinks.Flink; + } + + return ERROR_SUCCESS; +} + +template +static DWORD EnumerateRemoteModulesWinapi(HANDLE process, Proc proc) +{ + const auto handle = CreateToolhelp32Snapshot(TH32CS_SNAPMODULE, GetProcessId(process)); + if (handle == INVALID_HANDLE_VALUE) + return GetLastError(); + + MODULEENTRY32W me32 = {}; + me32.dwSize = sizeof(MODULEENTRY32W); + if (Module32FirstW(handle, &me32)) + { + do + { + EnumerateRemoteModuleData data = {}; + data.BaseAddress = me32.modBaseAddr; + data.Size = me32.modBaseSize; + std::memcpy(data.Path, me32.szExePath, std::min(MAX_PATH, PATH_MAXIMUM_LENGTH)); + + proc(&data); + } while (Module32NextW(handle, &me32)); + } + + CloseHandle(handle); + + return ERROR_SUCCESS; +} + void RC_CallConv EnumerateRemoteSectionsAndModules(RC_Pointer process, EnumerateRemoteSectionsCallback callbackSection, EnumerateRemoteModulesCallback callbackModule) { if (callbackSection == nullptr && callbackModule == nullptr) @@ -55,82 +153,67 @@ void RC_CallConv EnumerateRemoteSectionsAndModules(RC_Pointer process, Enumerate address = reinterpret_cast(memInfo.BaseAddress) + memInfo.RegionSize; } - const auto handle = CreateToolhelp32Snapshot(TH32CS_SNAPMODULE, GetProcessId(process)); - if (handle != INVALID_HANDLE_VALUE) + const auto moduleEnumerator = [&](EnumerateRemoteModuleData* data) { - MODULEENTRY32W me32 = {}; - me32.dwSize = sizeof(MODULEENTRY32W); - if (Module32FirstW(handle, &me32)) + if (callbackModule != nullptr) + callbackModule(data); + + if (callbackSection != nullptr) { - do - { - if (callbackModule != nullptr) + auto it = std::lower_bound(std::begin(sections), std::end(sections), static_cast(data->BaseAddress), [§ions](const auto& lhs, const LPVOID& rhs) { - EnumerateRemoteModuleData data = {}; - data.BaseAddress = me32.modBaseAddr; - data.Size = me32.modBaseSize; - std::memcpy(data.Path, me32.szExePath, std::min(MAX_PATH, PATH_MAXIMUM_LENGTH)); - - callbackModule(&data); - } + return lhs.BaseAddress < rhs; + }); - if (callbackSection != nullptr) - { - auto it = std::lower_bound(std::begin(sections), std::end(sections), static_cast(me32.modBaseAddr), [§ions](const auto& lhs, const LPVOID& rhs) - { - return lhs.BaseAddress < rhs; - }); + IMAGE_DOS_HEADER DosHdr = {}; + IMAGE_NT_HEADERS NtHdr = {}; - IMAGE_DOS_HEADER DosHdr = {}; - IMAGE_NT_HEADERS NtHdr = {}; + ReadRemoteMemory(process, data->BaseAddress, &DosHdr, 0, sizeof(IMAGE_DOS_HEADER)); + ReadRemoteMemory(process, PUCHAR(data->BaseAddress) + DosHdr.e_lfanew, &NtHdr, 0, sizeof(IMAGE_NT_HEADERS)); - ReadRemoteMemory(process, me32.modBaseAddr, &DosHdr, 0, sizeof(IMAGE_DOS_HEADER)); - ReadRemoteMemory(process, me32.modBaseAddr + DosHdr.e_lfanew, &NtHdr, 0, sizeof(IMAGE_NT_HEADERS)); + std::vector sectionHeaders(NtHdr.FileHeader.NumberOfSections); + ReadRemoteMemory(process, PUCHAR(data->BaseAddress) + DosHdr.e_lfanew + sizeof(IMAGE_NT_HEADERS), sectionHeaders.data(), 0, NtHdr.FileHeader.NumberOfSections * sizeof(IMAGE_SECTION_HEADER)); + for (auto i = 0; i < NtHdr.FileHeader.NumberOfSections; ++i) + { + auto&& sectionHeader = sectionHeaders[i]; - std::vector sectionHeaders(NtHdr.FileHeader.NumberOfSections); - ReadRemoteMemory(process, me32.modBaseAddr + DosHdr.e_lfanew + sizeof(IMAGE_NT_HEADERS), sectionHeaders.data(), 0, NtHdr.FileHeader.NumberOfSections * sizeof(IMAGE_SECTION_HEADER)); - for (auto i = 0; i < NtHdr.FileHeader.NumberOfSections; ++i) + const auto sectionAddress = reinterpret_cast(data->BaseAddress) + sectionHeader.VirtualAddress; + for (auto j = it; j != std::end(sections); ++j) + { + if (sectionAddress >= reinterpret_cast(j->BaseAddress) && sectionAddress < reinterpret_cast(j->BaseAddress) + static_cast(j->Size)) { - auto&& sectionHeader = sectionHeaders[i]; + // Copy the name because it is not null padded. + char buffer[IMAGE_SIZEOF_SHORT_NAME + 1] = { 0 }; + std::memcpy(buffer, sectionHeader.Name, IMAGE_SIZEOF_SHORT_NAME); - const auto sectionAddress = reinterpret_cast(me32.modBaseAddr) + sectionHeader.VirtualAddress; - for (auto j = it; j != std::end(sections); ++j) + if (std::strcmp(buffer, ".text") == 0 || std::strcmp(buffer, "code") == 0) + { + j->Category = SectionCategory::CODE; + } + else if (std::strcmp(buffer, ".data") == 0 || std::strcmp(buffer, "data") == 0 || std::strcmp(buffer, ".rdata") == 0 || std::strcmp(buffer, ".idata") == 0) { - if (sectionAddress >= reinterpret_cast(j->BaseAddress) && sectionAddress < reinterpret_cast(j->BaseAddress) + static_cast(j->Size)) - { - // Copy the name because it is not null padded. - char buffer[IMAGE_SIZEOF_SHORT_NAME + 1] = { 0 }; - std::memcpy(buffer, sectionHeader.Name, IMAGE_SIZEOF_SHORT_NAME); - - if (std::strcmp(buffer, ".text") == 0 || std::strcmp(buffer, "code") == 0) - { - j->Category = SectionCategory::CODE; - } - else if (std::strcmp(buffer, ".data") == 0 || std::strcmp(buffer, "data") == 0 || std::strcmp(buffer, ".rdata") == 0 || std::strcmp(buffer, ".idata") == 0) - { - j->Category = SectionCategory::DATA; - } - - MultiByteToUnicode(buffer, j->Name, IMAGE_SIZEOF_SHORT_NAME); - std::memcpy(j->ModulePath, me32.szExePath, std::min(MAX_PATH, PATH_MAXIMUM_LENGTH)); - - break; - } + j->Category = SectionCategory::DATA; } + MultiByteToUnicode(buffer, j->Name, IMAGE_SIZEOF_SHORT_NAME); + std::memcpy(j->ModulePath, data->Path, std::min(MAX_PATH, PATH_MAXIMUM_LENGTH)); + + break; } } - } while (Module32NextW(handle, &me32)); - } - CloseHandle(handle); + } + } + }; + + if(EnumerateRemoteModulesNative(process, moduleEnumerator) != ERROR_SUCCESS) + EnumerateRemoteModulesWinapi(process, moduleEnumerator); - if (callbackSection != nullptr) + if (callbackSection != nullptr) + { + for (auto&& section : sections) { - for (auto&& section : sections) - { - callbackSection(§ion); - } + callbackSection(§ion); } } } From 40a0f63c4b98845bb784a4b5e8bcf0577b08238c Mon Sep 17 00:00:00 2001 From: namazso Date: Sat, 21 Sep 2019 23:40:38 +0200 Subject: [PATCH 102/223] move PEB getting part out of module enumeration --- .../EnumerateRemoteSectionsAndModules.cpp | 22 ++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/NativeCore/Windows/EnumerateRemoteSectionsAndModules.cpp b/NativeCore/Windows/EnumerateRemoteSectionsAndModules.cpp index d20e64f3..782f0383 100644 --- a/NativeCore/Windows/EnumerateRemoteSectionsAndModules.cpp +++ b/NativeCore/Windows/EnumerateRemoteSectionsAndModules.cpp @@ -6,8 +6,7 @@ #include "NativeCore.hpp" -template -static DWORD EnumerateRemoteModulesNative(HANDLE process, Proc proc) +static DWORD GetRemotePeb(HANDLE process, PPEB* ppeb) { const auto ntdll = GetModuleHandle(TEXT("ntdll")); if (!ntdll) @@ -27,18 +26,31 @@ static DWORD EnumerateRemoteModulesNative(HANDLE process, Proc proc) _In_ ULONG ProcessInformationLength, _Out_opt_ PULONG ReturnLength ); - + const auto _NtQueryInformationProcess = tNtQueryInformationProcess(GetProcAddress(ntdll, "NtQueryInformationProcess")); if (!_NtQueryInformationProcess) return ERROR_NOT_FOUND; - + PROCESS_BASIC_INFORMATION pbi; const auto status = _NtQueryInformationProcess(process, ProcessBasicInformation, &pbi, sizeof(pbi), nullptr); if (!NT_SUCCESS(status)) return _RtlNtStatusToDosError(status); + *ppeb = pbi.PebBaseAddress; + + return ERROR_SUCCESS; +} + +template +static DWORD EnumerateRemoteModulesNative(HANDLE process, Proc proc) +{ + PPEB ppeb; + const auto error = GetRemotePeb(process, &ppeb); + if (error != ERROR_SUCCESS) + return error; + PPEB_LDR_DATA ldr; - auto success = ReadRemoteMemory(process, &pbi.PebBaseAddress->Ldr, &ldr, 0, sizeof(ldr)); + auto success = ReadRemoteMemory(process, ppeb->Ldr, &ldr, 0, sizeof(ldr)); if (!success) return ERROR_READ_FAULT; // we seem to swallow the error anyways, might aswell give a distinctive one back From e8c25cb870df6aee863150f04f5f3565fa061267 Mon Sep 17 00:00:00 2001 From: namazso Date: Sun, 29 Sep 2019 02:25:12 +0200 Subject: [PATCH 103/223] conform the C standard --- .../Windows/EnumerateRemoteSectionsAndModules.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/NativeCore/Windows/EnumerateRemoteSectionsAndModules.cpp b/NativeCore/Windows/EnumerateRemoteSectionsAndModules.cpp index 782f0383..ab9fa8e8 100644 --- a/NativeCore/Windows/EnumerateRemoteSectionsAndModules.cpp +++ b/NativeCore/Windows/EnumerateRemoteSectionsAndModules.cpp @@ -15,8 +15,8 @@ static DWORD GetRemotePeb(HANDLE process, PPEB* ppeb) using tRtlNtStatusToDosError = ULONG (NTAPI *)( _In_ NTSTATUS Status ); - const auto _RtlNtStatusToDosError = tRtlNtStatusToDosError(GetProcAddress(ntdll, "RtlNtStatusToDosError")); - if (!_RtlNtStatusToDosError) + const auto pRtlNtStatusToDosError = tRtlNtStatusToDosError(GetProcAddress(ntdll, "RtlNtStatusToDosError")); + if (!pRtlNtStatusToDosError) return ERROR_NOT_FOUND; using tNtQueryInformationProcess = NTSTATUS (NTAPI *)( @@ -27,14 +27,14 @@ static DWORD GetRemotePeb(HANDLE process, PPEB* ppeb) _Out_opt_ PULONG ReturnLength ); - const auto _NtQueryInformationProcess = tNtQueryInformationProcess(GetProcAddress(ntdll, "NtQueryInformationProcess")); - if (!_NtQueryInformationProcess) + const auto pNtQueryInformationProcess = tNtQueryInformationProcess(GetProcAddress(ntdll, "NtQueryInformationProcess")); + if (!pNtQueryInformationProcess) return ERROR_NOT_FOUND; PROCESS_BASIC_INFORMATION pbi; - const auto status = _NtQueryInformationProcess(process, ProcessBasicInformation, &pbi, sizeof(pbi), nullptr); + const auto status = pNtQueryInformationProcess(process, ProcessBasicInformation, &pbi, sizeof(pbi), nullptr); if (!NT_SUCCESS(status)) - return _RtlNtStatusToDosError(status); + return pRtlNtStatusToDosError(status); *ppeb = pbi.PebBaseAddress; From 0d9fe99b2532f9f534c7d88e7c6a6a4cbf491895 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 9 Oct 2019 15:01:18 +0200 Subject: [PATCH 104/223] Added keyboard shortcut for opening 'Go to class...' dialog --- ReClass.NET/Forms/MainForm.Designer.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/ReClass.NET/Forms/MainForm.Designer.cs b/ReClass.NET/Forms/MainForm.Designer.cs index f9eaffa6..dc38bd37 100644 --- a/ReClass.NET/Forms/MainForm.Designer.cs +++ b/ReClass.NET/Forms/MainForm.Designer.cs @@ -1290,6 +1290,7 @@ private void InitializeComponent() // this.goToClassToolStripMenuItem.Image = global::ReClassNET.Properties.Resources.B16x16_Class_Type; this.goToClassToolStripMenuItem.Name = "goToClassToolStripMenuItem"; + this.goToClassToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.F))); this.goToClassToolStripMenuItem.Size = new System.Drawing.Size(198, 22); this.goToClassToolStripMenuItem.Text = "Go to class..."; this.goToClassToolStripMenuItem.Click += new System.EventHandler(this.goToClassToolStripMenuItem_Click); From 46c23087da85cbc83523723cd95519d4b163cdf2 Mon Sep 17 00:00:00 2001 From: LichProject Date: Tue, 29 Oct 2019 03:58:14 +0300 Subject: [PATCH 105/223] Possible quality for C# generator. Improved code-style, HEX offsets instead of decimal, support Vectors. --- .../CodeGenerator/CSharpCodeGenerator.cs | 26 +++++++++---------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/ReClass.NET/CodeGenerator/CSharpCodeGenerator.cs b/ReClass.NET/CodeGenerator/CSharpCodeGenerator.cs index b4d36d17..91bf5fcf 100644 --- a/ReClass.NET/CodeGenerator/CSharpCodeGenerator.cs +++ b/ReClass.NET/CodeGenerator/CSharpCodeGenerator.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.CodeDom.Compiler; using System.Collections.Generic; using System.Diagnostics.Contracts; @@ -32,8 +32,12 @@ public class CSharpCodeGenerator : ICodeGenerator [typeof(Utf16TextPtrNode)] = "IntPtr", [typeof(Utf32TextPtrNode)] = "IntPtr", [typeof(PointerNode)] = "IntPtr", - [typeof(VirtualMethodTableNode)] = "IntPtr" - }; + [typeof(VirtualMethodTableNode)] = "IntPtr", + + [typeof(Vector2Node)] = "Vector2", + [typeof(Vector3Node)] = "Vector3", + [typeof(Vector4Node)] = "Vector4" + }; public Language Language => Language.CSharp; @@ -48,6 +52,9 @@ public string GenerateCode(IReadOnlyList classes, IReadOnlyList Date: Fri, 1 Nov 2019 20:09:55 +0100 Subject: [PATCH 106/223] Updated to C++17. Use non deprecated header file. --- NativeCore/Windows/EnumerateProcesses.cpp | 5 ++--- NativeCore/Windows/NativeCore.vcxproj | 4 ++++ 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/NativeCore/Windows/EnumerateProcesses.cpp b/NativeCore/Windows/EnumerateProcesses.cpp index e7d14faf..534b4a84 100644 --- a/NativeCore/Windows/EnumerateProcesses.cpp +++ b/NativeCore/Windows/EnumerateProcesses.cpp @@ -1,8 +1,7 @@ #include #include #include -#include -namespace fs = std::experimental::filesystem; +#include #include "NativeCore.hpp" @@ -73,7 +72,7 @@ void RC_CallConv EnumerateProcesses(EnumerateProcessCallback callbackProcess) EnumerateProcessData data = { }; data.Id = pe32.th32ProcessID; GetModuleFileNameExW(process, nullptr, reinterpret_cast(data.Path), PATH_MAXIMUM_LENGTH); - const auto name = fs::path(data.Path).filename().u16string(); + const auto name = std::filesystem::path(data.Path).filename().u16string(); str16cpy(data.Name, name.c_str(), std::min(name.length(), PATH_MAXIMUM_LENGTH - 1)); callbackProcess(&data); diff --git a/NativeCore/Windows/NativeCore.vcxproj b/NativeCore/Windows/NativeCore.vcxproj index b2b2b2d8..1e8d6695 100644 --- a/NativeCore/Windows/NativeCore.vcxproj +++ b/NativeCore/Windows/NativeCore.vcxproj @@ -104,6 +104,7 @@ Level3 Disabled WIN32;_DEBUG;_WINDOWS;_USRDLL;NATIVECORE_EXPORTS;_CRT_SECURE_NO_WARNINGS;NOMINMAX;RECLASSNET32;%(PreprocessorDefinitions) + stdcpp17 Windows @@ -119,6 +120,7 @@ Level3 Disabled _DEBUG;_WINDOWS;_USRDLL;NATIVECORE_EXPORTS;_CRT_SECURE_NO_WARNINGS;NOMINMAX;RECLASSNET64;%(PreprocessorDefinitions) + stdcpp17 Windows @@ -136,6 +138,7 @@ true true WIN32;NDEBUG;_WINDOWS;_USRDLL;NATIVECORE_EXPORTS;_CRT_SECURE_NO_WARNINGS;NOMINMAX;RECLASSNET32;%(PreprocessorDefinitions) + stdcpp17 Windows @@ -155,6 +158,7 @@ true true NDEBUG;_WINDOWS;_USRDLL;NATIVECORE_EXPORTS;_CRT_SECURE_NO_WARNINGS;NOMINMAX;RECLASSNET64;%(PreprocessorDefinitions) + stdcpp17 Windows From 8125eac282d56fa0b9040294ca49b2febd7d9237 Mon Sep 17 00:00:00 2001 From: KN4CK3R Date: Fri, 1 Nov 2019 20:14:44 +0100 Subject: [PATCH 107/223] Ignore codecvt deprecation warning until there is an official replacement. --- NativeCore/Windows/NativeCore.vcxproj | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/NativeCore/Windows/NativeCore.vcxproj b/NativeCore/Windows/NativeCore.vcxproj index 1e8d6695..520adc23 100644 --- a/NativeCore/Windows/NativeCore.vcxproj +++ b/NativeCore/Windows/NativeCore.vcxproj @@ -103,7 +103,7 @@ Level3 Disabled - WIN32;_DEBUG;_WINDOWS;_USRDLL;NATIVECORE_EXPORTS;_CRT_SECURE_NO_WARNINGS;NOMINMAX;RECLASSNET32;%(PreprocessorDefinitions) + WIN32;_DEBUG;_WINDOWS;_USRDLL;NATIVECORE_EXPORTS;_CRT_SECURE_NO_WARNINGS;NOMINMAX;RECLASSNET32;_SILENCE_CXX17_CODECVT_HEADER_DEPRECATION_WARNING;%(PreprocessorDefinitions) stdcpp17 @@ -119,7 +119,7 @@ Level3 Disabled - _DEBUG;_WINDOWS;_USRDLL;NATIVECORE_EXPORTS;_CRT_SECURE_NO_WARNINGS;NOMINMAX;RECLASSNET64;%(PreprocessorDefinitions) + _DEBUG;_WINDOWS;_USRDLL;NATIVECORE_EXPORTS;_CRT_SECURE_NO_WARNINGS;NOMINMAX;RECLASSNET64;_SILENCE_CXX17_CODECVT_HEADER_DEPRECATION_WARNING;%(PreprocessorDefinitions) stdcpp17 @@ -137,7 +137,7 @@ MaxSpeed true true - WIN32;NDEBUG;_WINDOWS;_USRDLL;NATIVECORE_EXPORTS;_CRT_SECURE_NO_WARNINGS;NOMINMAX;RECLASSNET32;%(PreprocessorDefinitions) + WIN32;NDEBUG;_WINDOWS;_USRDLL;NATIVECORE_EXPORTS;_CRT_SECURE_NO_WARNINGS;NOMINMAX;RECLASSNET32;_SILENCE_CXX17_CODECVT_HEADER_DEPRECATION_WARNING;%(PreprocessorDefinitions) stdcpp17 @@ -157,7 +157,7 @@ MaxSpeed true true - NDEBUG;_WINDOWS;_USRDLL;NATIVECORE_EXPORTS;_CRT_SECURE_NO_WARNINGS;NOMINMAX;RECLASSNET64;%(PreprocessorDefinitions) + NDEBUG;_WINDOWS;_USRDLL;NATIVECORE_EXPORTS;_CRT_SECURE_NO_WARNINGS;NOMINMAX;RECLASSNET64;_SILENCE_CXX17_CODECVT_HEADER_DEPRECATION_WARNING;%(PreprocessorDefinitions) stdcpp17 From 1d7214b0825d5700c7193ce414137bad39f978a6 Mon Sep 17 00:00:00 2001 From: Joel Noguera Date: Thu, 2 Jan 2020 12:53:01 -0300 Subject: [PATCH 108/223] New plugin available In case you find it interesting, I have made public a new plugin for this tool. --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 0040f004..b457de8b 100644 --- a/README.md +++ b/README.md @@ -53,6 +53,7 @@ This is a port of ReClass to the .NET platform with lots of additional features. - [LoadBinary Plugin](https://github.com/ReClassNET/ReClass.NET-LoadBinaryPlugin) - [Handle Abuser Plugin](https://github.com/ReClassNET/ReClass.NET-HandleAbuser) - [Unreal Plugin](https://github.com/DrP3pp3r/ReClass.NET-UnrealPlugin) (by [DrP3pp3r](https://github.com/DrP3pp3r)) +- [DriverReader](https://github.com/niemand-sec/ReClass.NET-DriverReader) (by [Niemand](https://github.com/niemand-sec)) To install a plugin just copy it in the "Plugins" folder. If you want to develop your own plugin just learn from the code of the [Sample Plugins](https://github.com/ReClassNET/ReClass.NET-SamplePlugin) and [Frostbite Plugin](https://github.com/ReClassNET/ReClass.NET-FrostbitePlugin) repositories. If you have developed a nice plugin, leave me a message and I will add it to the list above. @@ -118,4 +119,4 @@ Settings - leveln - [buddyfavors](https://github.com/buddyfavors) - [DrP3pp3r](https://github.com/DrP3pp3r) -- [ko1N](https://github.com/ko1N) \ No newline at end of file +- [ko1N](https://github.com/ko1N) From 4fba08f622256fb34b8431d9f940b2c8408a855c Mon Sep 17 00:00:00 2001 From: zeffy Date: Fri, 17 Jan 2020 15:58:09 -0800 Subject: [PATCH 109/223] Add some checks that should fix some issues with certain packers - Add sanity check for section size - Catch bad conversion exception of section name - Detect section category by characteristics flags rather than name --- .../EnumerateRemoteSectionsAndModules.cpp | 21 ++++++++++++------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/NativeCore/Windows/EnumerateRemoteSectionsAndModules.cpp b/NativeCore/Windows/EnumerateRemoteSectionsAndModules.cpp index f21f2539..e92f1d24 100644 --- a/NativeCore/Windows/EnumerateRemoteSectionsAndModules.cpp +++ b/NativeCore/Windows/EnumerateRemoteSectionsAndModules.cpp @@ -96,22 +96,27 @@ void RC_CallConv EnumerateRemoteSectionsAndModules(RC_Pointer process, Enumerate const auto sectionAddress = reinterpret_cast(me32.modBaseAddr) + sectionHeader.VirtualAddress; for (auto j = it; j != std::end(sections); ++j) { - if (sectionAddress >= reinterpret_cast(j->BaseAddress) && sectionAddress < reinterpret_cast(j->BaseAddress) + static_cast(j->Size)) + if (sectionAddress >= reinterpret_cast(j->BaseAddress) + && sectionAddress < reinterpret_cast(j->BaseAddress) + static_cast(j->Size) + && sectionHeader.VirtualAddress + sectionHeader.Misc.VirtualSize <= me32.modBaseSize ) { - // Copy the name because it is not null padded. - char buffer[IMAGE_SIZEOF_SHORT_NAME + 1] = { 0 }; - std::memcpy(buffer, sectionHeader.Name, IMAGE_SIZEOF_SHORT_NAME); - - if (std::strcmp(buffer, ".text") == 0 || std::strcmp(buffer, "code") == 0) + if ((sectionHeader.Characteristics & IMAGE_SCN_CNT_CODE) == IMAGE_SCN_CNT_CODE) { j->Category = SectionCategory::CODE; } - else if (std::strcmp(buffer, ".data") == 0 || std::strcmp(buffer, "data") == 0 || std::strcmp(buffer, ".rdata") == 0 || std::strcmp(buffer, ".idata") == 0) + else if (sectionHeader.Characteristics & (IMAGE_SCN_CNT_INITIALIZED_DATA | IMAGE_SCN_CNT_UNINITIALIZED_DATA)) { j->Category = SectionCategory::DATA; } - MultiByteToUnicode(buffer, j->Name, IMAGE_SIZEOF_SHORT_NAME); + try { + // Copy the name because it is not null padded. + char buffer[IMAGE_SIZEOF_SHORT_NAME + 1] = { 0 }; + std::memcpy(buffer, sectionHeader.Name, IMAGE_SIZEOF_SHORT_NAME); + MultiByteToUnicode(buffer, j->Name, IMAGE_SIZEOF_SHORT_NAME); + } catch (std::range_error &) { + std::memset(j->Name, 0, sizeof j->Name); + } std::memcpy(j->ModulePath, me32.szExePath, std::min(MAX_PATH, PATH_MAXIMUM_LENGTH)); break; From 79f3734b59d568b4a75fb9599c9386da34cd9ee1 Mon Sep 17 00:00:00 2001 From: Timboy67678 Date: Sun, 16 Feb 2020 00:49:56 +1000 Subject: [PATCH 110/223] Implemented run as admin and randomize window title option --- ReClass.NET/Forms/MainForm.cs | 10 +++- ReClass.NET/Forms/SettingsForm.Designer.cs | 69 +++++++++++++++------- ReClass.NET/Forms/SettingsForm.cs | 18 ++++++ ReClass.NET/Program.cs | 8 +++ ReClass.NET/Settings.cs | 4 ++ ReClass.NET/Util/SettingsSerializer.cs | 6 +- ReClass.NET/Util/Util.cs | 9 +++ ReClass.NET/Util/WinUtil.cs | 4 ++ 8 files changed, 103 insertions(+), 25 deletions(-) diff --git a/ReClass.NET/Forms/MainForm.cs b/ReClass.NET/Forms/MainForm.cs index 0ea6c239..9b3aec3b 100644 --- a/ReClass.NET/Forms/MainForm.cs +++ b/ReClass.NET/Forms/MainForm.cs @@ -63,21 +63,25 @@ public MainForm() InitializeComponent(); - Text = $"{Constants.ApplicationName} ({Constants.Platform})"; + string randomWindowTitle = Utils.RandomString(Program.GlobalRandom.Next(15, 20)); + + Text = $"{(Program.Settings.RandomizeWindowTitle ? randomWindowTitle : Constants.ApplicationName)} ({Constants.Platform})"; mainMenuStrip.Renderer = new CustomToolStripProfessionalRenderer(true, true); toolStrip.Renderer = new CustomToolStripProfessionalRenderer(true, false); Program.RemoteProcess.ProcessAttached += sender => { + string randomWindowTitle = Utils.RandomString(Program.GlobalRandom.Next(15, 20)); var text = $"{sender.UnderlayingProcess.Name} (ID: {sender.UnderlayingProcess.Id.ToString()})"; - Text = $"{Constants.ApplicationName} ({Constants.Platform}) - {text}"; + Text = $"{(Program.Settings.RandomizeWindowTitle ? randomWindowTitle : Constants.ApplicationName)} ({Constants.Platform}) - {text}"; processInfoToolStripStatusLabel.Text = text; }; Program.RemoteProcess.ProcessClosed += sender => { - Text = $"{Constants.ApplicationName} ({Constants.Platform})"; + string randomWindowTitle = Utils.RandomString(Program.GlobalRandom.Next(15, 20)); + Text = $"{(Program.Settings.RandomizeWindowTitle ? randomWindowTitle : Constants.ApplicationName)} ({Constants.Platform})"; processInfoToolStripStatusLabel.Text = "No process selected"; }; diff --git a/ReClass.NET/Forms/SettingsForm.Designer.cs b/ReClass.NET/Forms/SettingsForm.Designer.cs index cc5764b1..35faed19 100644 --- a/ReClass.NET/Forms/SettingsForm.Designer.cs +++ b/ReClass.NET/Forms/SettingsForm.Designer.cs @@ -43,6 +43,8 @@ private void InitializeComponent() this.showIntegerCheckBox = new System.Windows.Forms.CheckBox(); this.showFloatCheckBox = new System.Windows.Forms.CheckBox(); this.displayGroupBox = new System.Windows.Forms.GroupBox(); + this.randomizeWindowTitleCheckBox = new System.Windows.Forms.CheckBox(); + this.runAsAdminCheckBox = new System.Windows.Forms.CheckBox(); this.highlightChangedValuesCheckBox = new System.Windows.Forms.CheckBox(); this.showTextCheckBox = new System.Windows.Forms.CheckBox(); this.showNodeOffsetCheckBox = new System.Windows.Forms.CheckBox(); @@ -288,17 +290,40 @@ private void InitializeComponent() // // displayGroupBox // + this.displayGroupBox.Controls.Add(this.randomizeWindowTitleCheckBox); + this.displayGroupBox.Controls.Add(this.runAsAdminCheckBox); this.displayGroupBox.Controls.Add(this.highlightChangedValuesCheckBox); this.displayGroupBox.Controls.Add(this.showTextCheckBox); this.displayGroupBox.Controls.Add(this.showNodeOffsetCheckBox); this.displayGroupBox.Controls.Add(this.showNodeAddressCheckBox); this.displayGroupBox.Location = new System.Drawing.Point(283, 39); this.displayGroupBox.Name = "displayGroupBox"; - this.displayGroupBox.Size = new System.Drawing.Size(265, 113); + this.displayGroupBox.Size = new System.Drawing.Size(265, 160); this.displayGroupBox.TabIndex = 2; this.displayGroupBox.TabStop = false; this.displayGroupBox.Text = "Display"; // + // randomizeWindowTitleCheckBox + // + this.randomizeWindowTitleCheckBox.AutoSize = true; + this.randomizeWindowTitleCheckBox.Location = new System.Drawing.Point(6, 134); + this.randomizeWindowTitleCheckBox.Name = "randomizeWindowTitleCheckBox"; + this.randomizeWindowTitleCheckBox.Size = new System.Drawing.Size(137, 17); + this.randomizeWindowTitleCheckBox.TabIndex = 5; + this.randomizeWindowTitleCheckBox.Text = "Randomize window title"; + this.randomizeWindowTitleCheckBox.UseVisualStyleBackColor = true; + // + // runAsAdminCheckBox + // + this.runAsAdminCheckBox.AutoSize = true; + this.runAsAdminCheckBox.Location = new System.Drawing.Point(6, 111); + this.runAsAdminCheckBox.Name = "runAsAdminCheckBox"; + this.runAsAdminCheckBox.Size = new System.Drawing.Size(122, 17); + this.runAsAdminCheckBox.TabIndex = 4; + this.runAsAdminCheckBox.Text = "Run as administrator"; + this.runAsAdminCheckBox.UseVisualStyleBackColor = true; + this.runAsAdminCheckBox.CheckedChanged += new System.EventHandler(this.runAsAdminCheckBox_CheckedChanged); + // // highlightChangedValuesCheckBox // this.highlightChangedValuesCheckBox.AutoSize = true; @@ -695,7 +720,7 @@ private void InitializeComponent() this.boolSettingsLabel.TabIndex = 46; this.boolSettingsLabel.Text = "Bool:"; // - // boolSettingsTextBox + // boolTypeTextBox // this.boolTypeTextBox.Location = new System.Drawing.Point(346, 32); this.boolTypeTextBox.Name = "boolTypeTextBox"; @@ -720,7 +745,7 @@ private void InitializeComponent() this.functionPtrSettingsLabel.TabIndex = 43; this.functionPtrSettingsLabel.Text = "Function Pointer:"; // - // functionPtrSettingsTextBox + // functionPtrTypeTextBox // this.functionPtrTypeTextBox.Location = new System.Drawing.Point(346, 230); this.functionPtrTypeTextBox.Name = "functionPtrTypeTextBox"; @@ -736,7 +761,7 @@ private void InitializeComponent() this.utf16TextSettingsLabel.TabIndex = 39; this.utf16TextSettingsLabel.Text = "UTF16:"; // - // utf16TextSettingsTextBox + // utf16TextTypeTextBox // this.utf16TextTypeTextBox.Location = new System.Drawing.Point(346, 208); this.utf16TextTypeTextBox.Name = "utf16TextTypeTextBox"; @@ -752,7 +777,7 @@ private void InitializeComponent() this.utf8TextSettingsLabel.TabIndex = 35; this.utf8TextSettingsLabel.Text = "UTF8:"; // - // utf8TextSettingsTextBox + // utf8TextTypeTextBox // this.utf8TextTypeTextBox.Location = new System.Drawing.Point(346, 186); this.utf8TextTypeTextBox.Name = "utf8TextTypeTextBox"; @@ -768,7 +793,7 @@ private void InitializeComponent() this.matrix3x3SettingsLabel.TabIndex = 33; this.matrix3x3SettingsLabel.Text = "Matrix (3x3):"; // - // matrix3x3SettingsTextBox + // matrix3x3TypeTextBox // this.matrix3x3TypeTextBox.Location = new System.Drawing.Point(346, 120); this.matrix3x3TypeTextBox.Name = "matrix3x3TypeTextBox"; @@ -784,7 +809,7 @@ private void InitializeComponent() this.matrix3x4SettingsLabel.TabIndex = 31; this.matrix3x4SettingsLabel.Text = "Matrix (3x4):"; // - // matrix3x4SettingsTextBox + // matrix3x4TypeTextBox // this.matrix3x4TypeTextBox.Location = new System.Drawing.Point(346, 142); this.matrix3x4TypeTextBox.Name = "matrix3x4TypeTextBox"; @@ -800,7 +825,7 @@ private void InitializeComponent() this.matrix4x4SettingsLabel.TabIndex = 29; this.matrix4x4SettingsLabel.Text = "Matrix (4x4):"; // - // matrix4x4SettingsTextBox + // matrix4x4TypeTextBox // this.matrix4x4TypeTextBox.Location = new System.Drawing.Point(346, 164); this.matrix4x4TypeTextBox.Name = "matrix4x4TypeTextBox"; @@ -816,7 +841,7 @@ private void InitializeComponent() this.vector2SettingsLabel.TabIndex = 27; this.vector2SettingsLabel.Text = "Vector2:"; // - // vector2SettingsTextBox + // vector2TypeTextBox // this.vector2TypeTextBox.Location = new System.Drawing.Point(346, 54); this.vector2TypeTextBox.Name = "vector2TypeTextBox"; @@ -832,7 +857,7 @@ private void InitializeComponent() this.vector3SettingsLabel.TabIndex = 25; this.vector3SettingsLabel.Text = "Vector3:"; // - // vector3SettingsTextBox + // vector3TypeTextBox // this.vector3TypeTextBox.Location = new System.Drawing.Point(346, 76); this.vector3TypeTextBox.Name = "vector3TypeTextBox"; @@ -848,7 +873,7 @@ private void InitializeComponent() this.vector4SettingsLabel.TabIndex = 23; this.vector4SettingsLabel.Text = "Vector4:"; // - // vector4SettingsTextBox + // vector4TypeTextBox // this.vector4TypeTextBox.Location = new System.Drawing.Point(346, 98); this.vector4TypeTextBox.Name = "vector4TypeTextBox"; @@ -864,7 +889,7 @@ private void InitializeComponent() this.doubleSettingsLabel.TabIndex = 21; this.doubleSettingsLabel.Text = "Double:"; // - // doubleSettingsTextBox + // doubleTypeTextBox // this.doubleTypeTextBox.Location = new System.Drawing.Point(98, 230); this.doubleTypeTextBox.Name = "doubleTypeTextBox"; @@ -880,7 +905,7 @@ private void InitializeComponent() this.floatSettingsLabel.TabIndex = 19; this.floatSettingsLabel.Text = "Float:"; // - // floatSettingsTextBox + // floatTypeTextBox // this.floatTypeTextBox.Location = new System.Drawing.Point(98, 208); this.floatTypeTextBox.Name = "floatTypeTextBox"; @@ -896,7 +921,7 @@ private void InitializeComponent() this.uint64SettingsLabel.TabIndex = 17; this.uint64SettingsLabel.Text = "UInt64:"; // - // uint64SettingsTextBox + // uint64TypeTextBox // this.uint64TypeTextBox.Location = new System.Drawing.Point(98, 186); this.uint64TypeTextBox.Name = "uint64TypeTextBox"; @@ -912,7 +937,7 @@ private void InitializeComponent() this.uint32SettingsLabel.TabIndex = 15; this.uint32SettingsLabel.Text = "UInt32:"; // - // uint32SettingsTextBox + // uint32TypeTextBox // this.uint32TypeTextBox.Location = new System.Drawing.Point(98, 164); this.uint32TypeTextBox.Name = "uint32TypeTextBox"; @@ -928,7 +953,7 @@ private void InitializeComponent() this.uint16SettingsLabel.TabIndex = 13; this.uint16SettingsLabel.Text = "UInt16:"; // - // uint16SettingsTextBox + // uint16TypeTextBox // this.uint16TypeTextBox.Location = new System.Drawing.Point(98, 142); this.uint16TypeTextBox.Name = "uint16TypeTextBox"; @@ -944,7 +969,7 @@ private void InitializeComponent() this.uint8SettingsLabel.TabIndex = 11; this.uint8SettingsLabel.Text = "UInt8:"; // - // uint8SettingsTextBox + // uint8TypeTextBox // this.uint8TypeTextBox.Location = new System.Drawing.Point(98, 120); this.uint8TypeTextBox.Name = "uint8TypeTextBox"; @@ -960,7 +985,7 @@ private void InitializeComponent() this.int64SettingsLabel.TabIndex = 9; this.int64SettingsLabel.Text = "Int64:"; // - // int64SettingsTextBox + // int64TypeTextBox // this.int64TypeTextBox.Location = new System.Drawing.Point(98, 98); this.int64TypeTextBox.Name = "int64TypeTextBox"; @@ -976,7 +1001,7 @@ private void InitializeComponent() this.int32SettingsLabel.TabIndex = 7; this.int32SettingsLabel.Text = "Int32:"; // - // int32SettingsTextBox + // int32TypeTextBox // this.int32TypeTextBox.Location = new System.Drawing.Point(98, 76); this.int32TypeTextBox.Name = "int32TypeTextBox"; @@ -992,7 +1017,7 @@ private void InitializeComponent() this.int16SettingsLabel.TabIndex = 5; this.int16SettingsLabel.Text = "Int16:"; // - // int16SettingsTextBox + // int16TypeTextBox // this.int16TypeTextBox.Location = new System.Drawing.Point(98, 54); this.int16TypeTextBox.Name = "int16TypeTextBox"; @@ -1008,7 +1033,7 @@ private void InitializeComponent() this.int8SettingsLabel.TabIndex = 3; this.int8SettingsLabel.Text = "Int8:"; // - // int8SettingsTextBox + // int8TypeTextBox // this.int8TypeTextBox.Location = new System.Drawing.Point(98, 32); this.int8TypeTextBox.Name = "int8TypeTextBox"; @@ -1153,5 +1178,7 @@ private void InitializeComponent() private System.Windows.Forms.Button removeAssociationButton; private System.Windows.Forms.Button createAssociationButton; private System.Windows.Forms.Label associationInfoLabel; + private System.Windows.Forms.CheckBox randomizeWindowTitleCheckBox; + private System.Windows.Forms.CheckBox runAsAdminCheckBox; } } \ No newline at end of file diff --git a/ReClass.NET/Forms/SettingsForm.cs b/ReClass.NET/Forms/SettingsForm.cs index f065b959..8a66ac94 100644 --- a/ReClass.NET/Forms/SettingsForm.cs +++ b/ReClass.NET/Forms/SettingsForm.cs @@ -1,4 +1,5 @@ using System; +using System.Diagnostics; using System.Diagnostics.Contracts; using System.Windows.Forms; using ReClassNET.Extensions; @@ -105,6 +106,8 @@ private void SetGeneralBindings() SetBinding(showSymbolsCheckBox, nameof(CheckBox.Checked), settings, nameof(Settings.ShowCommentSymbol)); SetBinding(showStringCheckBox, nameof(CheckBox.Checked), settings, nameof(Settings.ShowCommentString)); SetBinding(showPluginInfoCheckBox, nameof(CheckBox.Checked), settings, nameof(Settings.ShowCommentPluginInfo)); + SetBinding(runAsAdminCheckBox, nameof(CheckBox.Checked), settings, nameof(Settings.RunAsAdmin)); + SetBinding(randomizeWindowTitleCheckBox, nameof(CheckBox.Checked), settings, nameof(Settings.RandomizeWindowTitle)); } private void SetColorBindings() @@ -149,5 +152,20 @@ private void SetTypedefinitionBindings() SetBinding(utf16TextTypeTextBox, nameof(TextBox.Text), typeMapping, nameof(CppTypeMapping.TypeUtf16Text)); SetBinding(functionPtrTypeTextBox, nameof(TextBox.Text), typeMapping, nameof(CppTypeMapping.TypeFunctionPtr)); } + + private void runAsAdminCheckBox_CheckedChanged(object sender, EventArgs e) + { + settings.RunAsAdmin = runAsAdminCheckBox.Checked; + + if (runAsAdminCheckBox.Checked && !WinUtil.IsAdministrator) + { + var msgboxResult = MessageBox.Show("Would you like to restart ReClass.NET as administrator now?", "ReClass.NET", MessageBoxButtons.YesNo, MessageBoxIcon.Information); + if(msgboxResult == DialogResult.Yes) + { + WinUtil.RunElevated(Process.GetCurrentProcess().MainModule.FileName, string.Empty); + Program.MainForm.Close(); + } + } + } } } diff --git a/ReClass.NET/Program.cs b/ReClass.NET/Program.cs index 2a65548b..edb8beba 100644 --- a/ReClass.NET/Program.cs +++ b/ReClass.NET/Program.cs @@ -1,4 +1,5 @@ using System; +using System.Diagnostics; using System.Drawing; using System.Globalization; using System.Windows.Forms; @@ -66,6 +67,13 @@ static void Main(string[] args) Settings = SettingsSerializer.Load(); Logger = new GuiLogger(); + if(Settings.RunAsAdmin && !WinUtil.IsAdministrator) + { + //todo: maybe better paramaters than just the first one? + WinUtil.RunElevated(Process.GetCurrentProcess().MainModule.FileName, CommandLineArgs.FileName); + return; + } + #if !DEBUG try { diff --git a/ReClass.NET/Settings.cs b/ReClass.NET/Settings.cs index 49372adf..b5d9268b 100644 --- a/ReClass.NET/Settings.cs +++ b/ReClass.NET/Settings.cs @@ -12,6 +12,10 @@ public class Settings public bool StayOnTop { get; set; } = false; + public bool RunAsAdmin { get; set; } = false; + + public bool RandomizeWindowTitle { get; set; } = false; + // Node Drawing Settings public bool ShowNodeAddress { get; set; } = true; diff --git a/ReClass.NET/Util/SettingsSerializer.cs b/ReClass.NET/Util/SettingsSerializer.cs index 30897511..8376e2e6 100644 --- a/ReClass.NET/Util/SettingsSerializer.cs +++ b/ReClass.NET/Util/SettingsSerializer.cs @@ -35,6 +35,8 @@ public static Settings Load() { XElementSerializer.TryRead(general, nameof(settings.LastProcess), e => settings.LastProcess = XElementSerializer.ToString(e)); XElementSerializer.TryRead(general, nameof(settings.StayOnTop), e => settings.StayOnTop = XElementSerializer.ToBool(e)); + XElementSerializer.TryRead(general, nameof(settings.RunAsAdmin), e => settings.RunAsAdmin = XElementSerializer.ToBool(e)); + XElementSerializer.TryRead(general, nameof(settings.RandomizeWindowTitle), e => settings.RandomizeWindowTitle = XElementSerializer.ToBool(e)); } var display = root?.Element(XmlDisplayElement); if (display != null) @@ -105,7 +107,9 @@ public static void Save(Settings settings) new XElement( XmlGeneralElement, XElementSerializer.ToXml(nameof(settings.LastProcess), settings.LastProcess), - XElementSerializer.ToXml(nameof(settings.StayOnTop), settings.StayOnTop) + XElementSerializer.ToXml(nameof(settings.StayOnTop), settings.StayOnTop), + XElementSerializer.ToXml(nameof(settings.RunAsAdmin), settings.RunAsAdmin), + XElementSerializer.ToXml(nameof(settings.RandomizeWindowTitle), settings.RandomizeWindowTitle) ), new XElement( XmlDisplayElement, diff --git a/ReClass.NET/Util/Util.cs b/ReClass.NET/Util/Util.cs index 850f23ad..15859b6d 100644 --- a/ReClass.NET/Util/Util.cs +++ b/ReClass.NET/Util/Util.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.Diagnostics.Contracts; +using System.Linq; namespace ReClassNET.Util { @@ -50,5 +51,13 @@ public static void Swap(ref T lhs, ref T rhs) lhs = rhs; rhs = temp; } + + //thx again stack overflow https://stackoverflow.com/a/1344242 + public static string RandomString(int length) + { + const string chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"; + return new string(Enumerable.Repeat(chars, length) + .Select(s => s[Program.GlobalRandom.Next(s.Length)]).ToArray()); + } } } diff --git a/ReClass.NET/Util/WinUtil.cs b/ReClass.NET/Util/WinUtil.cs index f01c0b07..8c8fbaf9 100644 --- a/ReClass.NET/Util/WinUtil.cs +++ b/ReClass.NET/Util/WinUtil.cs @@ -1,6 +1,7 @@ using System; using System.Diagnostics; using System.Diagnostics.Contracts; +using System.Security.Principal; using Microsoft.Win32; namespace ReClassNET.Util @@ -23,6 +24,9 @@ public static class WinUtil public static bool IsAtLeastWindows10 { get; } + //from https://stackoverflow.com/a/11660205 + public static bool IsAdministrator => new WindowsPrincipal(WindowsIdentity.GetCurrent()).IsInRole(WindowsBuiltInRole.Administrator); + static WinUtil() { var os = Environment.OSVersion; From ebd70188f5d160479b4ca3330c827f25ba345910 Mon Sep 17 00:00:00 2001 From: Timboy67678 Date: Sun, 16 Feb 2020 01:00:47 +1000 Subject: [PATCH 111/223] added actual parameters --- ReClass.NET/Program.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ReClass.NET/Program.cs b/ReClass.NET/Program.cs index edb8beba..ab0d78fd 100644 --- a/ReClass.NET/Program.cs +++ b/ReClass.NET/Program.cs @@ -69,8 +69,7 @@ static void Main(string[] args) if(Settings.RunAsAdmin && !WinUtil.IsAdministrator) { - //todo: maybe better paramaters than just the first one? - WinUtil.RunElevated(Process.GetCurrentProcess().MainModule.FileName, CommandLineArgs.FileName); + WinUtil.RunElevated(Process.GetCurrentProcess().MainModule.FileName, args.Length > 0 ? string.Join(" ", args) : null); return; } From 3edc3d11c9c00c91981b8913fc654b2ace20e755 Mon Sep 17 00:00:00 2001 From: Timboy67678 <994534+Timboy67678@users.noreply.github.com> Date: Sun, 16 Feb 2020 05:11:06 +1000 Subject: [PATCH 112/223] implemented suggestions by @KN4CK3R --- ReClass.NET/Forms/MainForm.cs | 23 +++++++++++++--------- ReClass.NET/Forms/SettingsForm.Designer.cs | 5 ++--- ReClass.NET/Forms/SettingsForm.cs | 16 +-------------- ReClass.NET/Program.cs | 2 +- 4 files changed, 18 insertions(+), 28 deletions(-) diff --git a/ReClass.NET/Forms/MainForm.cs b/ReClass.NET/Forms/MainForm.cs index 9b3aec3b..19a91628 100644 --- a/ReClass.NET/Forms/MainForm.cs +++ b/ReClass.NET/Forms/MainForm.cs @@ -56,32 +56,37 @@ public ClassNode CurrentClassNode } } + private void UpdateWindowTitle(string extra = null) + { + var title = $"{(Program.Settings.RandomizeWindowTitle ? Utils.RandomString(Program.GlobalRandom.Next(15, 20)) : Constants.ApplicationName)} ({Constants.Platform})"; + if (!string.IsNullOrEmpty(extra)) + { + title += $" - {extra}"; + } + Text = title; + } + public MainForm() { Contract.Ensures(pluginManager != null); Contract.Ensures(currentProject != null); InitializeComponent(); - - string randomWindowTitle = Utils.RandomString(Program.GlobalRandom.Next(15, 20)); - - Text = $"{(Program.Settings.RandomizeWindowTitle ? randomWindowTitle : Constants.ApplicationName)} ({Constants.Platform})"; + UpdateWindowTitle(); mainMenuStrip.Renderer = new CustomToolStripProfessionalRenderer(true, true); toolStrip.Renderer = new CustomToolStripProfessionalRenderer(true, false); Program.RemoteProcess.ProcessAttached += sender => { - string randomWindowTitle = Utils.RandomString(Program.GlobalRandom.Next(15, 20)); var text = $"{sender.UnderlayingProcess.Name} (ID: {sender.UnderlayingProcess.Id.ToString()})"; - - Text = $"{(Program.Settings.RandomizeWindowTitle ? randomWindowTitle : Constants.ApplicationName)} ({Constants.Platform}) - {text}"; processInfoToolStripStatusLabel.Text = text; + UpdateWindowTitle(text); + }; Program.RemoteProcess.ProcessClosed += sender => { - string randomWindowTitle = Utils.RandomString(Program.GlobalRandom.Next(15, 20)); - Text = $"{(Program.Settings.RandomizeWindowTitle ? randomWindowTitle : Constants.ApplicationName)} ({Constants.Platform})"; + UpdateWindowTitle(); processInfoToolStripStatusLabel.Text = "No process selected"; }; diff --git a/ReClass.NET/Forms/SettingsForm.Designer.cs b/ReClass.NET/Forms/SettingsForm.Designer.cs index 35faed19..517e8196 100644 --- a/ReClass.NET/Forms/SettingsForm.Designer.cs +++ b/ReClass.NET/Forms/SettingsForm.Designer.cs @@ -318,11 +318,10 @@ private void InitializeComponent() this.runAsAdminCheckBox.AutoSize = true; this.runAsAdminCheckBox.Location = new System.Drawing.Point(6, 111); this.runAsAdminCheckBox.Name = "runAsAdminCheckBox"; - this.runAsAdminCheckBox.Size = new System.Drawing.Size(122, 17); + this.runAsAdminCheckBox.Size = new System.Drawing.Size(200, 17); this.runAsAdminCheckBox.TabIndex = 4; - this.runAsAdminCheckBox.Text = "Run as administrator"; + this.runAsAdminCheckBox.Text = "Run as administrator (requires restart)"; this.runAsAdminCheckBox.UseVisualStyleBackColor = true; - this.runAsAdminCheckBox.CheckedChanged += new System.EventHandler(this.runAsAdminCheckBox_CheckedChanged); // // highlightChangedValuesCheckBox // diff --git a/ReClass.NET/Forms/SettingsForm.cs b/ReClass.NET/Forms/SettingsForm.cs index 8a66ac94..9c3f8a18 100644 --- a/ReClass.NET/Forms/SettingsForm.cs +++ b/ReClass.NET/Forms/SettingsForm.cs @@ -44,6 +44,7 @@ public SettingsForm(Settings settings, CppTypeMapping typeMapping) if (NativeMethods.IsUnix()) { fileAssociationGroupBox.Enabled = false; + runAsAdminCheckBox.Enabled = false; } else { @@ -152,20 +153,5 @@ private void SetTypedefinitionBindings() SetBinding(utf16TextTypeTextBox, nameof(TextBox.Text), typeMapping, nameof(CppTypeMapping.TypeUtf16Text)); SetBinding(functionPtrTypeTextBox, nameof(TextBox.Text), typeMapping, nameof(CppTypeMapping.TypeFunctionPtr)); } - - private void runAsAdminCheckBox_CheckedChanged(object sender, EventArgs e) - { - settings.RunAsAdmin = runAsAdminCheckBox.Checked; - - if (runAsAdminCheckBox.Checked && !WinUtil.IsAdministrator) - { - var msgboxResult = MessageBox.Show("Would you like to restart ReClass.NET as administrator now?", "ReClass.NET", MessageBoxButtons.YesNo, MessageBoxIcon.Information); - if(msgboxResult == DialogResult.Yes) - { - WinUtil.RunElevated(Process.GetCurrentProcess().MainModule.FileName, string.Empty); - Program.MainForm.Close(); - } - } - } } } diff --git a/ReClass.NET/Program.cs b/ReClass.NET/Program.cs index ab0d78fd..edeebd88 100644 --- a/ReClass.NET/Program.cs +++ b/ReClass.NET/Program.cs @@ -67,7 +67,7 @@ static void Main(string[] args) Settings = SettingsSerializer.Load(); Logger = new GuiLogger(); - if(Settings.RunAsAdmin && !WinUtil.IsAdministrator) + if(!NativeMethods.IsUnix() && Settings.RunAsAdmin && !WinUtil.IsAdministrator) { WinUtil.RunElevated(Process.GetCurrentProcess().MainModule.FileName, args.Length > 0 ? string.Join(" ", args) : null); return; From 8cee86ff9f745a8f2cef66bd25d02b1a1fcd52c4 Mon Sep 17 00:00:00 2001 From: KN4CK3R Date: Wed, 19 Feb 2020 10:31:34 +0100 Subject: [PATCH 113/223] Use C# 8 features. --- .../ReClass/ReClassNetFile.Read.cs | 222 +++++++++--------- 1 file changed, 106 insertions(+), 116 deletions(-) diff --git a/ReClass.NET/DataExchange/ReClass/ReClassNetFile.Read.cs b/ReClass.NET/DataExchange/ReClass/ReClassNetFile.Read.cs index fa86084b..4abee4fb 100644 --- a/ReClass.NET/DataExchange/ReClass/ReClassNetFile.Read.cs +++ b/ReClass.NET/DataExchange/ReClass/ReClassNetFile.Read.cs @@ -17,10 +17,9 @@ public partial class ReClassNetFile { public void Load(string filePath, ILogger logger) { - using (var fs = new FileStream(filePath, FileMode.Open)) - { - Load(fs, logger); - } + using var fs = new FileStream(filePath, FileMode.Open); + + Load(fs, logger); } public void Load(Stream input, ILogger logger) @@ -28,112 +27,109 @@ public void Load(Stream input, ILogger logger) Contract.Requires(input != null); Contract.Requires(logger != null); - using (var archive = new ZipArchive(input, ZipArchiveMode.Read)) + using var archive = new ZipArchive(input, ZipArchiveMode.Read); + var dataEntry = archive.GetEntry(DataFileName); + if (dataEntry == null) { - var dataEntry = archive.GetEntry(DataFileName); - if (dataEntry == null) - { - throw new FormatException(); - } - using (var entryStream = dataEntry.Open()) - { - var document = XDocument.Load(entryStream); - if (document.Root?.Element(XmlClassesElement) == null) - { - throw new FormatException("The data has not the correct format."); - } + throw new FormatException(); + } - uint.TryParse(document.Root.Attribute(XmlVersionAttribute)?.Value, out var fileVersion); - if ((fileVersion & FileVersionCriticalMask) > (FileVersion & FileVersionCriticalMask)) - { - throw new FormatException($"The file version is unsupported. A newer {Constants.ApplicationName} version is required to read it."); - } + using var entryStream = dataEntry.Open(); + var document = XDocument.Load(entryStream); + if (document.Root?.Element(XmlClassesElement) == null) + { + throw new FormatException("The data has not the correct format."); + } - var platform = document.Root.Attribute(XmlPlatformAttribute)?.Value; - if (platform != Constants.Platform) - { - logger.Log(LogLevel.Warning, $"The platform of the file ({platform}) doesn't match the program platform ({Constants.Platform})."); - } + uint.TryParse(document.Root.Attribute(XmlVersionAttribute)?.Value, out var fileVersion); + if ((fileVersion & FileVersionCriticalMask) > (FileVersion & FileVersionCriticalMask)) + { + throw new FormatException($"The file version is unsupported. A newer {Constants.ApplicationName} version is required to read it."); + } - var customDataElement = document.Root.Element(XmlCustomDataElement); - if (customDataElement != null) - { - project.CustomData.Deserialize(customDataElement); - } + var platform = document.Root.Attribute(XmlPlatformAttribute)?.Value; + if (platform != Constants.Platform) + { + logger.Log(LogLevel.Warning, $"The platform of the file ({platform}) doesn't match the program platform ({Constants.Platform})."); + } + + var customDataElement = document.Root.Element(XmlCustomDataElement); + if (customDataElement != null) + { + project.CustomData.Deserialize(customDataElement); + } - var typeMappingElement = document.Root.Element(XmlTypeMappingElement); - if (typeMappingElement != null) + var typeMappingElement = document.Root.Element(XmlTypeMappingElement); + if (typeMappingElement != null) + { + project.TypeMapping.Deserialize(typeMappingElement); + } + + var enumsElement = document.Root.Element(XmlEnumsElement); + if (enumsElement != null) + { + foreach (var enumElement in enumsElement.Elements(XmlEnumElement)) + { + var name = enumElement.Attribute(XmlNameAttribute)?.Value ?? string.Empty; + var useFlagsMode = (bool?)enumElement.Attribute(XmlFlagsAttribute) ?? false; + var size = enumElement.Attribute(XmlSizeAttribute).GetEnumValue(); + + var values = new Dictionary(); + foreach (var itemElement in enumElement.Elements(XmlItemElement)) { - project.TypeMapping.Deserialize(typeMappingElement); + var itemName = itemElement.Attribute(XmlNameAttribute)?.Value ?? string.Empty; + var itemValue = (long?)itemElement.Attribute(XmlValueAttribute) ?? 0L; + + values.Add(itemName, itemValue); } - var enumsElement = document.Root.Element(XmlEnumsElement); - if (enumsElement != null) + var @enum = new EnumDescription { - foreach (var enumElement in enumsElement.Elements(XmlEnumElement)) - { - var name = enumElement.Attribute(XmlNameAttribute)?.Value ?? string.Empty; - var useFlagsMode = (bool?)enumElement.Attribute(XmlFlagsAttribute) ?? false; - var size = enumElement.Attribute(XmlSizeAttribute).GetEnumValue(); - - var values = new Dictionary(); - foreach (var itemElement in enumElement.Elements(XmlItemElement)) - { - var itemName = itemElement.Attribute(XmlNameAttribute)?.Value ?? string.Empty; - var itemValue = (long?)itemElement.Attribute(XmlValueAttribute) ?? 0L; - - values.Add(itemName, itemValue); - } - - var @enum = new EnumDescription - { - Name = name - }; - @enum.SetData(useFlagsMode, size, values); - - project.AddEnum(@enum); - } - } + Name = name + }; + @enum.SetData(useFlagsMode, size, values); + + project.AddEnum(@enum); + } + } - var classes = new List>(); + var classes = new List>(); - var classesElement = document.Root.Element(XmlClassesElement); - if (classesElement != null) + var classesElement = document.Root.Element(XmlClassesElement); + if (classesElement != null) + { + foreach (var element in classesElement + .Elements(XmlClassElement) + .DistinctBy(e => e.Attribute(XmlUuidAttribute)?.Value)) + { + var node = new ClassNode(false) { - foreach (var element in classesElement - .Elements(XmlClassElement) - .DistinctBy(e => e.Attribute(XmlUuidAttribute)?.Value)) - { - var node = new ClassNode(false) - { - Uuid = NodeUuid.FromBase64String(element.Attribute(XmlUuidAttribute)?.Value, true), - Name = element.Attribute(XmlNameAttribute)?.Value ?? string.Empty, - Comment = element.Attribute(XmlCommentAttribute)?.Value ?? string.Empty, - AddressFormula = element.Attribute(XmlAddressAttribute)?.Value ?? string.Empty - }; - - if (!project.ContainsClass(node.Uuid)) - { - project.AddClass(node); - - classes.Add(Tuple.Create(element, node)); - } - } - } + Uuid = NodeUuid.FromBase64String(element.Attribute(XmlUuidAttribute)?.Value, true), + Name = element.Attribute(XmlNameAttribute)?.Value ?? string.Empty, + Comment = element.Attribute(XmlCommentAttribute)?.Value ?? string.Empty, + AddressFormula = element.Attribute(XmlAddressAttribute)?.Value ?? string.Empty + }; - foreach (var t in classes) + if (!project.ContainsClass(node.Uuid)) { - var nodes = t.Item1.Elements(XmlNodeElement) - .Select(e => CreateNodeFromElement(e, t.Item2, logger)) - .Where(n => n != null); + project.AddClass(node); - foreach (var node in nodes) - { - t.Item2.AddNode(node); - } + classes.Add(Tuple.Create(element, node)); } } } + + foreach (var t in classes) + { + var nodes = t.Item1.Elements(XmlNodeElement) + .Select(e => CreateNodeFromElement(e, t.Item2, logger)) + .Where(n => n != null); + + foreach (var node in nodes) + { + t.Item2.AddNode(node); + } + } } private BaseNode CreateNodeFromElement(XElement element, BaseNode parent, ILogger logger) @@ -199,15 +195,11 @@ ClassNode GetClassNodeFromElementReference() return null; } - switch (node) + node = node switch { - case BaseClassArrayNode classArrayNode: - node = classArrayNode.GetEquivalentNode(0, innerClass); - break; - case ClassPointerNode classPointerNode: - node = classPointerNode.GetEquivalentNode(innerClass); - break; - } + BaseClassArrayNode classArrayNode => classArrayNode.GetEquivalentNode(0, innerClass), + ClassPointerNode classPointerNode => classPointerNode.GetEquivalentNode(innerClass) + }; } else { @@ -321,26 +313,24 @@ public static Tuple, List> DeserializeNodesFromStream( Contract.Requires(logger != null); Contract.Ensures(Contract.Result, List>>() != null); - using (var project = new ReClassNetProject()) - { - templateProject?.Classes.ForEach(project.AddClass); + using var project = new ReClassNetProject(); + templateProject?.Classes.ForEach(project.AddClass); - var file = new ReClassNetFile(project); - file.Load(input, logger); + var file = new ReClassNetFile(project); + file.Load(input, logger); - var classes = project.Classes - .Where(c => c.Name != SerializationClassName); - if (templateProject != null) - { - classes = classes.Where(c => !templateProject.ContainsClass(c.Uuid)); - } + var classes = project.Classes + .Where(c => c.Name != SerializationClassName); + if (templateProject != null) + { + classes = classes.Where(c => !templateProject.ContainsClass(c.Uuid)); + } - var nodes = project.Classes - .Where(c => c.Name == SerializationClassName) - .SelectMany(c => c.Nodes); + var nodes = project.Classes + .Where(c => c.Name == SerializationClassName) + .SelectMany(c => c.Nodes); - return Tuple.Create(classes.ToList(), nodes.ToList()); - } + return Tuple.Create(classes.ToList(), nodes.ToList()); } } } From 2a181ed6d45a5dfb8ceb5c7c18184ea4a0d646ce Mon Sep 17 00:00:00 2001 From: KN4CK3R Date: Wed, 19 Feb 2020 10:41:17 +0100 Subject: [PATCH 114/223] Speed up file loading. (#148) --- .../ReClass/ReClassNetFile.Read.cs | 17 +++---- ReClass.NET/Nodes/BaseContainerNode.cs | 51 +++++++++++++------ 2 files changed, 44 insertions(+), 24 deletions(-) diff --git a/ReClass.NET/DataExchange/ReClass/ReClassNetFile.Read.cs b/ReClass.NET/DataExchange/ReClass/ReClassNetFile.Read.cs index 4abee4fb..228e5178 100644 --- a/ReClass.NET/DataExchange/ReClass/ReClassNetFile.Read.cs +++ b/ReClass.NET/DataExchange/ReClass/ReClassNetFile.Read.cs @@ -93,7 +93,7 @@ public void Load(Stream input, ILogger logger) } } - var classes = new List>(); + var classes = new List<(XElement, ClassNode)>(); var classesElement = document.Root.Element(XmlClassesElement); if (classesElement != null) @@ -114,21 +114,20 @@ public void Load(Stream input, ILogger logger) { project.AddClass(node); - classes.Add(Tuple.Create(element, node)); + classes.Add((element, node)); } } } - foreach (var t in classes) + foreach (var (element, classNode) in classes) { - var nodes = t.Item1.Elements(XmlNodeElement) - .Select(e => CreateNodeFromElement(e, t.Item2, logger)) + var nodes = element.Elements(XmlNodeElement) + .Select(e => CreateNodeFromElement(e, classNode, logger)) .Where(n => n != null); - foreach (var node in nodes) - { - t.Item2.AddNode(node); - } + classNode.BeginUpdate(); + classNode.AddNodes(nodes); + classNode.EndUpdate(); } } diff --git a/ReClass.NET/Nodes/BaseContainerNode.cs b/ReClass.NET/Nodes/BaseContainerNode.cs index f9201720..6926111f 100644 --- a/ReClass.NET/Nodes/BaseContainerNode.cs +++ b/ReClass.NET/Nodes/BaseContainerNode.cs @@ -8,6 +8,8 @@ public abstract class BaseContainerNode : BaseNode { private readonly List nodes = new List(); + private int updateCount; + /// The child nodes of the container. public IReadOnlyList Nodes => nodes; @@ -122,6 +124,35 @@ private bool TryGetNeighbour(BaseNode node, int offset, out BaseNode neighbour) return true; } + /// + /// Disables internal events to speed up batch processing. + /// must be called to restore the functionality. + /// + public void BeginUpdate() + { + updateCount++; + } + + /// + /// Enables internal events disabled by . + /// + public void EndUpdate() + { + updateCount = Math.Max(0, updateCount - 1); + + OnNodesUpdated(); + } + + private void OnNodesUpdated() + { + if (updateCount == 0) + { + UpdateOffsets(); + + GetParentContainer()?.ChildHasChanged(this); + } + } + /// Replaces the old node with the new node. /// The old node to replacce. /// The new node. @@ -172,9 +203,7 @@ public void ReplaceChildNode(BaseNode oldNode, BaseNode newNode, ref List @@ -253,9 +282,7 @@ protected void InsertBytes(int index, int size, ref List createdNodes) index++; } - UpdateOffsets(); - - GetParentContainer()?.ChildHasChanged(this); + OnNodesUpdated(); } /// @@ -286,9 +313,7 @@ public void AddNode(BaseNode node) nodes.Add(node); - UpdateOffsets(); - - GetParentContainer()?.ChildHasChanged(this); + OnNodesUpdated(); } /// @@ -312,9 +337,7 @@ public void InsertNode(BaseNode position, BaseNode node) nodes.Insert(index, node); - UpdateOffsets(); - - GetParentContainer()?.ChildHasChanged(this); + OnNodesUpdated(); } /// Removes the specified node. @@ -327,9 +350,7 @@ public bool RemoveNode(BaseNode node) var result = nodes.Remove(node); if (result) { - UpdateOffsets(); - - GetParentContainer()?.ChildHasChanged(this); + OnNodesUpdated(); } return result; } From 811746bf0c733f88356ec7f9370a1873387e9873 Mon Sep 17 00:00:00 2001 From: KN4CK3R Date: Wed, 19 Feb 2020 11:00:24 +0100 Subject: [PATCH 115/223] Speed up node replacement. --- ReClass.NET/Forms/MainForm.Functions.cs | 51 ++++++++++++++++--------- 1 file changed, 32 insertions(+), 19 deletions(-) diff --git a/ReClass.NET/Forms/MainForm.Functions.cs b/ReClass.NET/Forms/MainForm.Functions.cs index 28f1f7c0..9fad2852 100644 --- a/ReClass.NET/Forms/MainForm.Functions.cs +++ b/ReClass.NET/Forms/MainForm.Functions.cs @@ -292,38 +292,47 @@ public void ReplaceSelectedNodesWithType(Type type) var hotSpotPartitions = selectedNodes .WhereNot(s => s.Node is ClassNode) .GroupBy(s => s.Node.GetParentContainer()) - .SelectMany(g => g - .OrderBy(s => s.Node.Offset) - .GroupWhile((h1, h2) => h1.Node.Offset + h1.Node.MemorySize == h2.Node.Offset) - ); + .Select(g => new + { + Container = g.Key, + Partitions = g.OrderBy(s => s.Node.Offset) + .GroupWhile((s1, s2) => s1.Node.Offset + s1.Node.MemorySize == s2.Node.Offset) + }); - foreach (var selectedPartition in hotSpotPartitions) + foreach (var containerPartitions in hotSpotPartitions) { - var hotSpotsToReplace = new Queue(selectedPartition); - while (hotSpotsToReplace.Count > 0) + containerPartitions.Container.BeginUpdate(); + + foreach (var partition in containerPartitions.Partitions) { - var selected = hotSpotsToReplace.Dequeue(); + var hotSpotsToReplace = new Queue(partition); + while (hotSpotsToReplace.Count > 0) + { + var selected = hotSpotsToReplace.Dequeue(); - var node = BaseNode.CreateInstanceFromType(type); + var node = BaseNode.CreateInstanceFromType(type); - var createdNodes = new List(); - selected.Node.GetParentContainer().ReplaceChildNode(selected.Node, node, ref createdNodes); + var createdNodes = new List(); + containerPartitions.Container.ReplaceChildNode(selected.Node, node, ref createdNodes); - node.IsSelected = true; + node.IsSelected = true; - var info = new MemoryViewControl.SelectedNodeInfo(node, selected.Process, selected.Memory, selected.Address, selected.Level); + var info = new MemoryViewControl.SelectedNodeInfo(node, selected.Process, selected.Memory, selected.Address, selected.Level); - newSelected.Add(info); + newSelected.Add(info); - // If more than one node is selected I assume the user wants to replace the complete range with the desired node type. - if (selectedNodes.Count > 1) - { - foreach (var createdNode in createdNodes) + // If more than one node is selected I assume the user wants to replace the complete range with the desired node type. + if (selectedNodes.Count > 1) { - hotSpotsToReplace.Enqueue(new MemoryViewControl.SelectedNodeInfo(createdNode, selected.Process, selected.Memory, selected.Address + createdNode.Offset - node.Offset, selected.Level)); + foreach (var createdNode in createdNodes) + { + hotSpotsToReplace.Enqueue(new MemoryViewControl.SelectedNodeInfo(createdNode, selected.Process, selected.Memory, selected.Address + createdNode.Offset - node.Offset, selected.Level)); + } } } } + + containerPartitions.Container.EndUpdate(); } memoryViewControl.ClearSelection(); @@ -373,6 +382,8 @@ private void PasteNodeFromClipboardToSelection() var classNode = selectedNode.GetParentClass(); if (containerNode != null && classNode != null) { + containerNode.BeginUpdate(); + foreach (var node in result.Item2) { if (node is BaseWrapperNode) @@ -394,6 +405,8 @@ private void PasteNodeFromClipboardToSelection() containerNode.InsertNode(selectedNode, node); } + + containerNode.EndUpdate(); } } } From 98141f2daff5163ffe6c95b6683067ca244ed789 Mon Sep 17 00:00:00 2001 From: KN4CK3R Date: Wed, 19 Feb 2020 14:24:22 +0100 Subject: [PATCH 116/223] Fixed scrollbar not working in huge classes because of 16bit value. (#148) --- ReClass.NET/UI/ScrollableCustomControl.cs | 54 ++++++++++++++++++----- 1 file changed, 44 insertions(+), 10 deletions(-) diff --git a/ReClass.NET/UI/ScrollableCustomControl.cs b/ReClass.NET/UI/ScrollableCustomControl.cs index ce254b83..4de6a4de 100644 --- a/ReClass.NET/UI/ScrollableCustomControl.cs +++ b/ReClass.NET/UI/ScrollableCustomControl.cs @@ -1,11 +1,35 @@ using System; using System.Diagnostics.Contracts; +using System.Runtime.InteropServices; using System.Windows.Forms; namespace ReClassNET.UI { public class ScrollableCustomControl : UserControl { + private const int WM_HSCROLL = 0x114; + private const int WM_VSCROLL = 0x115; + private const int SBS_HORZ = 0x0000; + private const int SBS_VERT = 0x0001; + private const int SIF_ALL = 0x0001 | 0x0002 | 0x0004 | 0x0010; + + [DllImport("user32.dll", ExactSpelling = true, CharSet = CharSet.Auto)] + private static extern bool GetScrollInfo(HandleRef hWnd, int fnBar, SCROLLINFO si); + + [StructLayout(LayoutKind.Sequential)] + private class SCROLLINFO + { + public int cbSize = Marshal.SizeOf(typeof(SCROLLINFO)); + public int fMask = SIF_ALL; + public int nMin; + public int nMax; + public int nPage; + public int nPos; + public int nTrackPos; + } + + private readonly SCROLLINFO scrollinfo = new SCROLLINFO(); + public ScrollableCustomControl() { VScroll = true; @@ -49,7 +73,7 @@ protected override void OnMouseWheel(MouseEventArgs e) private const int SB_BOTTOM = 7; private const int SB_ENDSCROLL = 8; - private ScrollEventType WParamToScrollEventType(IntPtr wParam) + private static ScrollEventType WParamToScrollEventType(IntPtr wParam) { switch (LoWord((int)wParam)) { @@ -76,9 +100,6 @@ private ScrollEventType WParamToScrollEventType(IntPtr wParam) } } - private const int WM_HSCROLL = 0x114; - private const int WM_VSCROLL = 0x115; - private void SetValue(ScrollEventType type, ScrollProperties scrollProperties, int newValue) { Contract.Requires(scrollProperties != null); @@ -163,9 +184,20 @@ public void DoScroll(ScrollOrientation orientation, int amount) SetValue(ScrollEventType.ThumbPosition, scrollProperties, scrollProperties.Value + amount); } - private void ProcessMessage(ref Message msg, ScrollProperties scrollProperties) + private void ProcessMessage(ref Message msg) { - Contract.Requires(scrollProperties != null); + ScrollProperties scrollProperties; + int bar; + if (msg.Msg == WM_VSCROLL) + { + scrollProperties = VerticalScroll; + bar = SBS_VERT; + } + else + { + scrollProperties = HorizontalScroll; + bar = SBS_HORZ; + } var type = WParamToScrollEventType(msg.WParam); switch (type) @@ -180,7 +212,11 @@ private void ProcessMessage(ref Message msg, ScrollProperties scrollProperties) break; case ScrollEventType.ThumbTrack: case ScrollEventType.ThumbPosition: - SetValue(type, scrollProperties, HiWord((int)msg.WParam)); + + if (GetScrollInfo(new HandleRef(this, Handle), bar, scrollinfo)) + { + SetValue(type, scrollProperties, scrollinfo.nTrackPos); + } break; } } @@ -198,7 +234,7 @@ protected override void WndProc(ref Message msg) break; } - ProcessMessage(ref msg, msg.Msg == WM_VSCROLL ? VerticalScroll : (ScrollProperties)HorizontalScroll); + ProcessMessage(ref msg); return; } @@ -207,8 +243,6 @@ protected override void WndProc(ref Message msg) base.WndProc(ref msg); } - static int HiWord(int number) => (number >> 16) & 0xffff; - static int LoWord(int number) => number & 0xffff; } } From d53fc959e617dbbad5b39ad883a2abbc39afcddf Mon Sep 17 00:00:00 2001 From: namazso Date: Wed, 18 Mar 2020 22:30:23 +0100 Subject: [PATCH 117/223] fix broken code - how did this work --- NativeCore/Windows/EnumerateRemoteSectionsAndModules.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NativeCore/Windows/EnumerateRemoteSectionsAndModules.cpp b/NativeCore/Windows/EnumerateRemoteSectionsAndModules.cpp index ab9fa8e8..8c3f6feb 100644 --- a/NativeCore/Windows/EnumerateRemoteSectionsAndModules.cpp +++ b/NativeCore/Windows/EnumerateRemoteSectionsAndModules.cpp @@ -50,7 +50,7 @@ static DWORD EnumerateRemoteModulesNative(HANDLE process, Proc proc) return error; PPEB_LDR_DATA ldr; - auto success = ReadRemoteMemory(process, ppeb->Ldr, &ldr, 0, sizeof(ldr)); + auto success = ReadRemoteMemory(process, &ppeb->Ldr, &ldr, 0, sizeof(ldr)); if (!success) return ERROR_READ_FAULT; // we seem to swallow the error anyways, might aswell give a distinctive one back From 97cda277aa311d3f0b88f5d04cfeb1d9661bc509 Mon Sep 17 00:00:00 2001 From: Dr_P3pp3r Date: Sat, 11 Apr 2020 03:27:54 +0200 Subject: [PATCH 118/223] Add memory type checkboxes into memory scanner gui. --- ReClass.NET/Forms/ScannerForm.Designer.cs | 127 +++++++++++++++------- ReClass.NET/Forms/ScannerForm.cs | 10 +- 2 files changed, 93 insertions(+), 44 deletions(-) diff --git a/ReClass.NET/Forms/ScannerForm.Designer.cs b/ReClass.NET/Forms/ScannerForm.Designer.cs index bbd88cb9..ccde5411 100644 --- a/ReClass.NET/Forms/ScannerForm.Designer.cs +++ b/ReClass.NET/Forms/ScannerForm.Designer.cs @@ -43,6 +43,9 @@ private void InitializeComponent() this.scanCopyOnWriteCheckBox = new System.Windows.Forms.CheckBox(); this.scanExecutableCheckBox = new System.Windows.Forms.CheckBox(); this.scanWritableCheckBox = new System.Windows.Forms.CheckBox(); + this.scanMappedCheckBox = new System.Windows.Forms.CheckBox(); + this.scanImageCheckBox = new System.Windows.Forms.CheckBox(); + this.scanPrivateCheckBox = new System.Windows.Forms.CheckBox(); this.stopAddressTextBox = new System.Windows.Forms.TextBox(); this.label4 = new System.Windows.Forms.Label(); this.startAddressTextBox = new System.Windows.Forms.TextBox(); @@ -191,6 +194,9 @@ private void InitializeComponent() this.scanOptionsGroupBox.Controls.Add(this.scanCopyOnWriteCheckBox); this.scanOptionsGroupBox.Controls.Add(this.scanExecutableCheckBox); this.scanOptionsGroupBox.Controls.Add(this.scanWritableCheckBox); + this.scanOptionsGroupBox.Controls.Add(this.scanMappedCheckBox); + this.scanOptionsGroupBox.Controls.Add(this.scanImageCheckBox); + this.scanOptionsGroupBox.Controls.Add(this.scanPrivateCheckBox); this.scanOptionsGroupBox.Controls.Add(this.stopAddressTextBox); this.scanOptionsGroupBox.Controls.Add(this.label4); this.scanOptionsGroupBox.Controls.Add(this.startAddressTextBox); @@ -198,37 +204,37 @@ private void InitializeComponent() this.scanOptionsGroupBox.Location = new System.Drawing.Point(3, 239); this.scanOptionsGroupBox.Margin = new System.Windows.Forms.Padding(3, 0, 3, 3); this.scanOptionsGroupBox.Name = "scanOptionsGroupBox"; - this.scanOptionsGroupBox.Size = new System.Drawing.Size(308, 120); + this.scanOptionsGroupBox.Size = new System.Drawing.Size(308, 141); this.scanOptionsGroupBox.TabIndex = 9; this.scanOptionsGroupBox.TabStop = false; this.scanOptionsGroupBox.Text = "Scan Options"; // // fastScanAlignmentTextBox // - this.fastScanAlignmentTextBox.Location = new System.Drawing.Point(133, 91); + this.fastScanAlignmentTextBox.Location = new System.Drawing.Point(144, 112); this.fastScanAlignmentTextBox.Name = "fastScanAlignmentTextBox"; this.fastScanAlignmentTextBox.Size = new System.Drawing.Size(26, 20); - this.fastScanAlignmentTextBox.TabIndex = 9; + this.fastScanAlignmentTextBox.TabIndex = 11; // // fastScanCheckBox // this.fastScanCheckBox.AutoSize = true; this.fastScanCheckBox.Checked = true; this.fastScanCheckBox.CheckState = System.Windows.Forms.CheckState.Checked; - this.fastScanCheckBox.Location = new System.Drawing.Point(9, 93); + this.fastScanCheckBox.Location = new System.Drawing.Point(9, 114); this.fastScanCheckBox.Name = "fastScanCheckBox"; this.fastScanCheckBox.Size = new System.Drawing.Size(129, 17); - this.fastScanCheckBox.TabIndex = 8; + this.fastScanCheckBox.TabIndex = 10; this.fastScanCheckBox.Text = "Fast Scan, Alignment:"; this.fastScanCheckBox.UseVisualStyleBackColor = true; // // scanCopyOnWriteCheckBox // this.scanCopyOnWriteCheckBox.AutoSize = true; - this.scanCopyOnWriteCheckBox.Location = new System.Drawing.Point(189, 68); + this.scanCopyOnWriteCheckBox.Location = new System.Drawing.Point(189, 91); this.scanCopyOnWriteCheckBox.Name = "scanCopyOnWriteCheckBox"; this.scanCopyOnWriteCheckBox.Size = new System.Drawing.Size(95, 17); - this.scanCopyOnWriteCheckBox.TabIndex = 7; + this.scanCopyOnWriteCheckBox.TabIndex = 9; this.scanCopyOnWriteCheckBox.Text = "Copy On Write"; this.scanCopyOnWriteCheckBox.ThreeState = true; this.scanCopyOnWriteCheckBox.UseVisualStyleBackColor = true; @@ -238,10 +244,10 @@ private void InitializeComponent() this.scanExecutableCheckBox.AutoSize = true; this.scanExecutableCheckBox.Checked = true; this.scanExecutableCheckBox.CheckState = System.Windows.Forms.CheckState.Indeterminate; - this.scanExecutableCheckBox.Location = new System.Drawing.Point(91, 68); + this.scanExecutableCheckBox.Location = new System.Drawing.Point(91, 91); this.scanExecutableCheckBox.Name = "scanExecutableCheckBox"; this.scanExecutableCheckBox.Size = new System.Drawing.Size(79, 17); - this.scanExecutableCheckBox.TabIndex = 6; + this.scanExecutableCheckBox.TabIndex = 8; this.scanExecutableCheckBox.Text = "Executable"; this.scanExecutableCheckBox.ThreeState = true; this.scanExecutableCheckBox.UseVisualStyleBackColor = true; @@ -251,14 +257,48 @@ private void InitializeComponent() this.scanWritableCheckBox.AutoSize = true; this.scanWritableCheckBox.Checked = true; this.scanWritableCheckBox.CheckState = System.Windows.Forms.CheckState.Checked; - this.scanWritableCheckBox.Location = new System.Drawing.Point(9, 68); + this.scanWritableCheckBox.Location = new System.Drawing.Point(9, 91); this.scanWritableCheckBox.Name = "scanWritableCheckBox"; this.scanWritableCheckBox.Size = new System.Drawing.Size(65, 17); - this.scanWritableCheckBox.TabIndex = 5; + this.scanWritableCheckBox.TabIndex = 7; this.scanWritableCheckBox.Text = "Writable"; this.scanWritableCheckBox.ThreeState = true; this.scanWritableCheckBox.UseVisualStyleBackColor = true; // + // scanMappedCheckBox + // + this.scanMappedCheckBox.AutoSize = true; + this.scanMappedCheckBox.Location = new System.Drawing.Point(189, 68); + this.scanMappedCheckBox.Name = "scanMappedCheckBox"; + this.scanMappedCheckBox.Size = new System.Drawing.Size(65, 17); + this.scanMappedCheckBox.TabIndex = 6; + this.scanMappedCheckBox.Text = "Mapped"; + this.scanMappedCheckBox.UseVisualStyleBackColor = true; + // + // scanImageCheckBox + // + this.scanImageCheckBox.AutoSize = true; + this.scanImageCheckBox.Checked = true; + this.scanImageCheckBox.CheckState = System.Windows.Forms.CheckState.Checked; + this.scanImageCheckBox.Location = new System.Drawing.Point(91, 68); + this.scanImageCheckBox.Name = "scanImageCheckBox"; + this.scanImageCheckBox.Size = new System.Drawing.Size(55, 17); + this.scanImageCheckBox.TabIndex = 5; + this.scanImageCheckBox.Text = "Image"; + this.scanImageCheckBox.UseVisualStyleBackColor = true; + // + // scanPrivateCheckBox + // + this.scanPrivateCheckBox.AutoSize = true; + this.scanPrivateCheckBox.Checked = true; + this.scanPrivateCheckBox.CheckState = System.Windows.Forms.CheckState.Checked; + this.scanPrivateCheckBox.Location = new System.Drawing.Point(9, 68); + this.scanPrivateCheckBox.Name = "scanPrivateCheckBox"; + this.scanPrivateCheckBox.Size = new System.Drawing.Size(59, 17); + this.scanPrivateCheckBox.TabIndex = 4; + this.scanPrivateCheckBox.Text = "Private"; + this.scanPrivateCheckBox.UseVisualStyleBackColor = true; + // // stopAddressTextBox // this.stopAddressTextBox.Location = new System.Drawing.Point(66, 42); @@ -302,7 +342,7 @@ private void InitializeComponent() this.flowLayoutPanel.Location = new System.Drawing.Point(292, 80); this.flowLayoutPanel.Margin = new System.Windows.Forms.Padding(0); this.flowLayoutPanel.Name = "flowLayoutPanel"; - this.flowLayoutPanel.Size = new System.Drawing.Size(317, 294); + this.flowLayoutPanel.Size = new System.Drawing.Size(317, 314); this.flowLayoutPanel.TabIndex = 9; this.flowLayoutPanel.WrapContents = false; // @@ -461,8 +501,8 @@ private void InitializeComponent() // // resultMemoryRecordList // - this.resultMemoryRecordList.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); + this.resultMemoryRecordList.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); this.resultMemoryRecordList.ContextMenuStrip = this.resultListContextMenuStrip; this.resultMemoryRecordList.Location = new System.Drawing.Point(11, 80); this.resultMemoryRecordList.Name = "resultMemoryRecordList"; @@ -471,24 +511,24 @@ private void InitializeComponent() this.resultMemoryRecordList.ShowPreviousValueColumn = true; this.resultMemoryRecordList.ShowValueColumn = true; this.resultMemoryRecordList.ShowValueTypeColumn = false; - this.resultMemoryRecordList.Size = new System.Drawing.Size(268, 292); + this.resultMemoryRecordList.Size = new System.Drawing.Size(268, 314); this.resultMemoryRecordList.TabIndex = 16; this.resultMemoryRecordList.RecordDoubleClick += new ReClassNET.UI.MemorySearchResultControlResultDoubleClickEventHandler(this.memorySearchResultControl_ResultDoubleClick); // // resultListContextMenuStrip // this.resultListContextMenuStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.addSelectedResultsToAddressListToolStripMenuItem, - this.removeSelectedRecordsToolStripMenuItem, - this.changeToolStripMenuItem, - this.toolStripSeparator2, - this.setCurrentClassAddressToolStripMenuItem, - this.createClassAtAddressToolStripMenuItem, - this.toolStripSeparator3, - this.findOutWhatAccessesThisAddressToolStripMenuItem, - this.findOutWhatWritesToThisAddressToolStripMenuItem, - this.toolStripSeparator4, - this.copyAddressToolStripMenuItem}); + this.addSelectedResultsToAddressListToolStripMenuItem, + this.removeSelectedRecordsToolStripMenuItem, + this.changeToolStripMenuItem, + this.toolStripSeparator2, + this.setCurrentClassAddressToolStripMenuItem, + this.createClassAtAddressToolStripMenuItem, + this.toolStripSeparator3, + this.findOutWhatAccessesThisAddressToolStripMenuItem, + this.findOutWhatWritesToThisAddressToolStripMenuItem, + this.toolStripSeparator4, + this.copyAddressToolStripMenuItem}); this.resultListContextMenuStrip.Name = "resultListContextMenuStrip"; this.resultListContextMenuStrip.Size = new System.Drawing.Size(270, 198); this.resultListContextMenuStrip.Opening += new System.ComponentModel.CancelEventHandler(this.resultListContextMenuStrip_Opening); @@ -512,10 +552,10 @@ private void InitializeComponent() // changeToolStripMenuItem // this.changeToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.descriptionToolStripMenuItem, - this.addressToolStripMenuItem, - this.valueTypeToolStripMenuItem, - this.valueToolStripMenuItem}); + this.descriptionToolStripMenuItem, + this.addressToolStripMenuItem, + this.valueTypeToolStripMenuItem, + this.valueToolStripMenuItem}); this.changeToolStripMenuItem.Enabled = false; this.changeToolStripMenuItem.Image = global::ReClassNET.Properties.Resources.B16x16_Textfield_Rename; this.changeToolStripMenuItem.Name = "changeToolStripMenuItem"; @@ -603,11 +643,11 @@ private void InitializeComponent() // // addressListMemoryRecordList // - this.addressListMemoryRecordList.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); + this.addressListMemoryRecordList.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); this.addressListMemoryRecordList.ContextMenuStrip = this.resultListContextMenuStrip; - this.addressListMemoryRecordList.Location = new System.Drawing.Point(11, 402); + this.addressListMemoryRecordList.Location = new System.Drawing.Point(11, 425); this.addressListMemoryRecordList.Name = "addressListMemoryRecordList"; this.addressListMemoryRecordList.ShowAddressColumn = true; this.addressListMemoryRecordList.ShowDescriptionColumn = true; @@ -620,7 +660,7 @@ private void InitializeComponent() // toolStripPanel // this.toolStripPanel.Controls.Add(this.menuToolStrip); - this.toolStripPanel.Location = new System.Drawing.Point(11, 375); + this.toolStripPanel.Location = new System.Drawing.Point(11, 397); this.toolStripPanel.Name = "toolStripPanel"; this.toolStripPanel.Orientation = System.Windows.Forms.Orientation.Horizontal; this.toolStripPanel.RenderMode = System.Windows.Forms.ToolStripRenderMode.Professional; @@ -632,11 +672,11 @@ private void InitializeComponent() this.menuToolStrip.Dock = System.Windows.Forms.DockStyle.None; this.menuToolStrip.GripStyle = System.Windows.Forms.ToolStripGripStyle.Hidden; this.menuToolStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.openAddressFileToolStripButton, - this.saveAddressFileToolStripButton, - this.saveAddressFileAsToolStripButton, - this.toolStripSeparator1, - this.clearAddressListToolStripButton}); + this.openAddressFileToolStripButton, + this.saveAddressFileToolStripButton, + this.saveAddressFileAsToolStripButton, + this.toolStripSeparator1, + this.clearAddressListToolStripButton}); this.menuToolStrip.Location = new System.Drawing.Point(0, 0); this.menuToolStrip.Name = "menuToolStrip"; this.menuToolStrip.Size = new System.Drawing.Size(101, 25); @@ -707,7 +747,7 @@ private void InitializeComponent() // this.showInputCorrelatorIconButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.showInputCorrelatorIconButton.Image = global::ReClassNET.Properties.Resources.B16x16_Canvas_Size; - this.showInputCorrelatorIconButton.Location = new System.Drawing.Point(580, 378); + this.showInputCorrelatorIconButton.Location = new System.Drawing.Point(580, 398); this.showInputCorrelatorIconButton.Name = "showInputCorrelatorIconButton"; this.showInputCorrelatorIconButton.Pressed = false; this.showInputCorrelatorIconButton.Selected = false; @@ -731,7 +771,7 @@ private void InitializeComponent() // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(612, 584); + this.ClientSize = new System.Drawing.Size(612, 607); this.Controls.Add(this.cancelScanIconButton); this.Controls.Add(this.showInputCorrelatorIconButton); this.Controls.Add(this.undoIconButton); @@ -785,6 +825,9 @@ private void InitializeComponent() private System.Windows.Forms.CheckBox scanCopyOnWriteCheckBox; private System.Windows.Forms.CheckBox scanExecutableCheckBox; private System.Windows.Forms.CheckBox scanWritableCheckBox; + private System.Windows.Forms.CheckBox scanMappedCheckBox; + private System.Windows.Forms.CheckBox scanImageCheckBox; + private System.Windows.Forms.CheckBox scanPrivateCheckBox; private System.Windows.Forms.TextBox stopAddressTextBox; private System.Windows.Forms.Label label4; private System.Windows.Forms.TextBox startAddressTextBox; diff --git a/ReClass.NET/Forms/ScannerForm.cs b/ReClass.NET/Forms/ScannerForm.cs index 7427974e..3aaed815 100644 --- a/ReClass.NET/Forms/ScannerForm.cs +++ b/ReClass.NET/Forms/ScannerForm.cs @@ -675,6 +675,9 @@ SettingState CheckStateToSettingState(CheckState state) } } + settings.ScanPrivateMemory = scanPrivateCheckBox.Checked; + settings.ScanImageMemory = scanImageCheckBox.Checked; + settings.ScanMappedMemory = scanMappedCheckBox.Checked; settings.ScanWritableMemory = CheckStateToSettingState(scanWritableCheckBox.CheckState); settings.ScanExecutableMemory = CheckStateToSettingState(scanExecutableCheckBox.CheckState); settings.ScanCopyOnWriteMemory = CheckStateToSettingState(scanCopyOnWriteCheckBox.CheckState); @@ -697,7 +700,7 @@ private void SetGuiFromSettings(ScanSettings settings) fastScanCheckBox.Checked = settings.EnableFastScan; fastScanAlignmentTextBox.Text = Math.Max(1, settings.FastScanAlignment).ToString(); - + CheckState SettingStateToCheckState(SettingState state) { switch (state) @@ -711,6 +714,9 @@ CheckState SettingStateToCheckState(SettingState state) } } + scanPrivateCheckBox.Checked = settings.ScanPrivateMemory; + scanImageCheckBox.Checked = settings.ScanImageMemory; + scanMappedCheckBox.Checked = settings.ScanMappedMemory; scanWritableCheckBox.CheckState = SettingStateToCheckState(settings.ScanWritableMemory); scanExecutableCheckBox.CheckState = SettingStateToCheckState(settings.ScanExecutableMemory); scanCopyOnWriteCheckBox.CheckState = SettingStateToCheckState(settings.ScanCopyOnWriteMemory); @@ -865,7 +871,7 @@ internal class InvalidInputException : Exception public InvalidInputException(string input) : base($"'{input}' is not a valid input.") { - + } } } From b8625dcb8c57805a5cb095c35f97b29710a53ccf Mon Sep 17 00:00:00 2001 From: KN4CK3R Date: Tue, 5 May 2020 11:33:55 +0200 Subject: [PATCH 119/223] Fixed merge error. --- .../EnumerateRemoteSectionsAndModules.cpp | 49 +++++++++---------- 1 file changed, 24 insertions(+), 25 deletions(-) diff --git a/NativeCore/Windows/EnumerateRemoteSectionsAndModules.cpp b/NativeCore/Windows/EnumerateRemoteSectionsAndModules.cpp index a4ec301e..38413e0d 100644 --- a/NativeCore/Windows/EnumerateRemoteSectionsAndModules.cpp +++ b/NativeCore/Windows/EnumerateRemoteSectionsAndModules.cpp @@ -193,32 +193,31 @@ void RC_CallConv EnumerateRemoteSectionsAndModules(RC_Pointer process, Enumerate for (auto j = it; j != std::end(sections); ++j) { if (sectionAddress >= reinterpret_cast(j->BaseAddress) - && sectionAddress < reinterpret_cast(j->BaseAddress) + static_cast(j->Size) - && sectionHeader.VirtualAddress + sectionHeader.Misc.VirtualSize <= me32.modBaseSize ) - { - if ((sectionHeader.Characteristics & IMAGE_SCN_CNT_CODE) == IMAGE_SCN_CNT_CODE) - { - j->Category = SectionCategory::CODE; - } - else if (sectionHeader.Characteristics & (IMAGE_SCN_CNT_INITIALIZED_DATA | IMAGE_SCN_CNT_UNINITIALIZED_DATA)) - { - j->Category = SectionCategory::DATA; - } - - try { - // Copy the name because it is not null padded. - char buffer[IMAGE_SIZEOF_SHORT_NAME + 1] = { 0 }; - std::memcpy(buffer, sectionHeader.Name, IMAGE_SIZEOF_SHORT_NAME); - MultiByteToUnicode(buffer, j->Name, IMAGE_SIZEOF_SHORT_NAME); - } catch (std::range_error &) { - std::memset(j->Name, 0, sizeof j->Name); - } - std::memcpy(j->ModulePath, me32.szExePath, std::min(MAX_PATH, PATH_MAXIMUM_LENGTH)); - - break; - } + && sectionAddress < reinterpret_cast(j->BaseAddress) + static_cast(j->Size) + && sectionHeader.VirtualAddress + sectionHeader.Misc.VirtualSize <= data->Size) + { + if ((sectionHeader.Characteristics & IMAGE_SCN_CNT_CODE) == IMAGE_SCN_CNT_CODE) + { + j->Category = SectionCategory::CODE; + } + else if (sectionHeader.Characteristics & (IMAGE_SCN_CNT_INITIALIZED_DATA | IMAGE_SCN_CNT_UNINITIALIZED_DATA)) + { + j->Category = SectionCategory::DATA; + } + + try { + // Copy the name because it is not null padded. + char buffer[IMAGE_SIZEOF_SHORT_NAME + 1] = { 0 }; + std::memcpy(buffer, sectionHeader.Name, IMAGE_SIZEOF_SHORT_NAME); + MultiByteToUnicode(buffer, j->Name, IMAGE_SIZEOF_SHORT_NAME); + } catch (std::range_error &) { + std::memset(j->Name, 0, sizeof j->Name); + } + std::memcpy(j->ModulePath, data->Path, std::min(MAX_PATH, PATH_MAXIMUM_LENGTH)); + + break; + } } - } } }; From 406a7ce28f4825005bf6593da9b902a1ffa62f96 Mon Sep 17 00:00:00 2001 From: KN4CK3R Date: Tue, 5 May 2020 11:53:06 +0200 Subject: [PATCH 120/223] Restructured code (1/4) --- .../EnumerateRemoteSectionsAndModules.cpp | 59 +++++++++++-------- 1 file changed, 35 insertions(+), 24 deletions(-) diff --git a/NativeCore/Windows/EnumerateRemoteSectionsAndModules.cpp b/NativeCore/Windows/EnumerateRemoteSectionsAndModules.cpp index 38413e0d..61f6bef8 100644 --- a/NativeCore/Windows/EnumerateRemoteSectionsAndModules.cpp +++ b/NativeCore/Windows/EnumerateRemoteSectionsAndModules.cpp @@ -160,7 +160,7 @@ void RC_CallConv EnumerateRemoteSectionsAndModules(RC_Pointer process, Enumerate section.Category = section.Type == SectionType::Private ? SectionCategory::HEAP : SectionCategory::Unknown; - sections.push_back(std::move(section)); + sections.push_back(section); } address = reinterpret_cast(memInfo.BaseAddress) + memInfo.RegionSize; } @@ -168,52 +168,61 @@ void RC_CallConv EnumerateRemoteSectionsAndModules(RC_Pointer process, Enumerate const auto moduleEnumerator = [&](EnumerateRemoteModuleData* data) { if (callbackModule != nullptr) + { callbackModule(data); + } if (callbackSection != nullptr) { auto it = std::lower_bound(std::begin(sections), std::end(sections), static_cast(data->BaseAddress), [§ions](const auto& lhs, const LPVOID& rhs) - { - return lhs.BaseAddress < rhs; - }); - - IMAGE_DOS_HEADER DosHdr = {}; - IMAGE_NT_HEADERS NtHdr = {}; + { + return lhs.BaseAddress < rhs; + }); - ReadRemoteMemory(process, data->BaseAddress, &DosHdr, 0, sizeof(IMAGE_DOS_HEADER)); - ReadRemoteMemory(process, PUCHAR(data->BaseAddress) + DosHdr.e_lfanew, &NtHdr, 0, sizeof(IMAGE_NT_HEADERS)); + IMAGE_DOS_HEADER imageDosHeader = {}; + IMAGE_NT_HEADERS imageNtHeaders = {}; - std::vector sectionHeaders(NtHdr.FileHeader.NumberOfSections); - ReadRemoteMemory(process, PUCHAR(data->BaseAddress) + DosHdr.e_lfanew + sizeof(IMAGE_NT_HEADERS), sectionHeaders.data(), 0, NtHdr.FileHeader.NumberOfSections * sizeof(IMAGE_SECTION_HEADER)); - for (auto i = 0; i < NtHdr.FileHeader.NumberOfSections; ++i) + if (!ReadRemoteMemory(process, data->BaseAddress, &imageDosHeader, 0, sizeof(IMAGE_DOS_HEADER)) + || !ReadRemoteMemory(process, PUCHAR(data->BaseAddress) + imageDosHeader.e_lfanew, &imageNtHeaders, 0, sizeof(IMAGE_NT_HEADERS))) { - auto&& sectionHeader = sectionHeaders[i]; + return; + } + std::vector sectionHeaders(imageNtHeaders.FileHeader.NumberOfSections); + ReadRemoteMemory(process, PUCHAR(data->BaseAddress) + imageDosHeader.e_lfanew + sizeof(IMAGE_NT_HEADERS), sectionHeaders.data(), 0, imageNtHeaders.FileHeader.NumberOfSections * sizeof(IMAGE_SECTION_HEADER)); + for (auto&& sectionHeader : sectionHeaders) + { const auto sectionAddress = reinterpret_cast(data->BaseAddress) + sectionHeader.VirtualAddress; - for (auto j = it; j != std::end(sections); ++j) + + for (; it != std::end(sections); ++it) { - if (sectionAddress >= reinterpret_cast(j->BaseAddress) - && sectionAddress < reinterpret_cast(j->BaseAddress) + static_cast(j->Size) + auto&& section = *it; + + if (sectionAddress >= reinterpret_cast(section.BaseAddress) + && sectionAddress < reinterpret_cast(section.BaseAddress) + static_cast(section.Size) && sectionHeader.VirtualAddress + sectionHeader.Misc.VirtualSize <= data->Size) { if ((sectionHeader.Characteristics & IMAGE_SCN_CNT_CODE) == IMAGE_SCN_CNT_CODE) { - j->Category = SectionCategory::CODE; + section.Category = SectionCategory::CODE; } else if (sectionHeader.Characteristics & (IMAGE_SCN_CNT_INITIALIZED_DATA | IMAGE_SCN_CNT_UNINITIALIZED_DATA)) { - j->Category = SectionCategory::DATA; + section.Category = SectionCategory::DATA; } - try { + try + { // Copy the name because it is not null padded. char buffer[IMAGE_SIZEOF_SHORT_NAME + 1] = { 0 }; std::memcpy(buffer, sectionHeader.Name, IMAGE_SIZEOF_SHORT_NAME); - MultiByteToUnicode(buffer, j->Name, IMAGE_SIZEOF_SHORT_NAME); - } catch (std::range_error &) { - std::memset(j->Name, 0, sizeof j->Name); + MultiByteToUnicode(buffer, section.Name, IMAGE_SIZEOF_SHORT_NAME); + } + catch (std::range_error &) + { + std::memset(section.Name, 0, sizeof(section.Name)); } - std::memcpy(j->ModulePath, data->Path, std::min(MAX_PATH, PATH_MAXIMUM_LENGTH)); + std::memcpy(section.ModulePath, data->Path, std::min(MAX_PATH, PATH_MAXIMUM_LENGTH)); break; } @@ -222,8 +231,10 @@ void RC_CallConv EnumerateRemoteSectionsAndModules(RC_Pointer process, Enumerate } }; - if(EnumerateRemoteModulesNative(process, moduleEnumerator) != ERROR_SUCCESS) + if (EnumerateRemoteModulesNative(process, moduleEnumerator) != ERROR_SUCCESS) + { EnumerateRemoteModulesWinapi(process, moduleEnumerator); + } if (callbackSection != nullptr) { From bbf580a16d2e8a476907d4084a54e474272173ad Mon Sep 17 00:00:00 2001 From: KN4CK3R Date: Tue, 5 May 2020 12:07:52 +0200 Subject: [PATCH 121/223] Restructured code (2/4) --- .../EnumerateRemoteSectionsAndModules.cpp | 51 ++++++++++--------- 1 file changed, 27 insertions(+), 24 deletions(-) diff --git a/NativeCore/Windows/EnumerateRemoteSectionsAndModules.cpp b/NativeCore/Windows/EnumerateRemoteSectionsAndModules.cpp index 61f6bef8..a5b15b79 100644 --- a/NativeCore/Windows/EnumerateRemoteSectionsAndModules.cpp +++ b/NativeCore/Windows/EnumerateRemoteSectionsAndModules.cpp @@ -3,6 +3,7 @@ #include #include #include +#include #include "NativeCore.hpp" @@ -41,24 +42,25 @@ static DWORD GetRemotePeb(HANDLE process, PPEB* ppeb) return ERROR_SUCCESS; } -template -static DWORD EnumerateRemoteModulesNative(HANDLE process, Proc proc) +using InternalEnumerateRemoteModulesCallback = std::function; + +static bool EnumerateRemoteModulesNative(HANDLE process, const InternalEnumerateRemoteModulesCallback& callback) { PPEB ppeb; const auto error = GetRemotePeb(process, &ppeb); if (error != ERROR_SUCCESS) - return error; + return false; PPEB_LDR_DATA ldr; auto success = ReadRemoteMemory(process, &ppeb->Ldr, &ldr, 0, sizeof(ldr)); if (!success) - return ERROR_READ_FAULT; // we seem to swallow the error anyways, might aswell give a distinctive one back + return false; const auto list_head = &ldr->InMemoryOrderModuleList; // remote address PLIST_ENTRY list_current; // remote address success = ReadRemoteMemory(process, &list_head->Flink, &list_current, 0, sizeof(list_current)); if (!success) - return ERROR_READ_FAULT; + return false; while (list_current != list_head) { @@ -67,7 +69,7 @@ static DWORD EnumerateRemoteModulesNative(HANDLE process, Proc proc) LDR_DATA_TABLE_ENTRY mod; success = ReadRemoteMemory(process, CONTAINING_RECORD(list_current, LDR_DATA_TABLE_ENTRY, InMemoryOrderLinks), &mod, 0, sizeof(mod)); if (!success) - return ERROR_SUCCESS; // return success here to prevent running the other one + break; EnumerateRemoteModuleData data = {}; data.BaseAddress = mod.DllBase; @@ -75,25 +77,26 @@ static DWORD EnumerateRemoteModulesNative(HANDLE process, Proc proc) const auto path_len = std::min(sizeof(RC_UnicodeChar) * (PATH_MAXIMUM_LENGTH - 1), size_t(mod.FullDllName.Length)); success = ReadRemoteMemory(process, mod.FullDllName.Buffer, data.Path, 0, int(path_len)); if (!success) - return ERROR_SUCCESS; // return success here to prevent running the other one + break; // UNICODE_STRING is not guaranteed to be null terminated data.Path[path_len / 2] = 0; - proc(&data); + callback(data); list_current = mod.InMemoryOrderLinks.Flink; } - return ERROR_SUCCESS; + return true; } -template -static DWORD EnumerateRemoteModulesWinapi(HANDLE process, Proc proc) +bool EnumerateRemoteModulesWinapi(HANDLE process, const InternalEnumerateRemoteModulesCallback& callback) { const auto handle = CreateToolhelp32Snapshot(TH32CS_SNAPMODULE, GetProcessId(process)); if (handle == INVALID_HANDLE_VALUE) - return GetLastError(); + { + return false; + } MODULEENTRY32W me32 = {}; me32.dwSize = sizeof(MODULEENTRY32W); @@ -106,13 +109,13 @@ static DWORD EnumerateRemoteModulesWinapi(HANDLE process, Proc proc) data.Size = me32.modBaseSize; std::memcpy(data.Path, me32.szExePath, std::min(MAX_PATH, PATH_MAXIMUM_LENGTH)); - proc(&data); + callback(data); } while (Module32NextW(handle, &me32)); } CloseHandle(handle); - return ERROR_SUCCESS; + return true; } void RC_CallConv EnumerateRemoteSectionsAndModules(RC_Pointer process, EnumerateRemoteSectionsCallback callbackSection, EnumerateRemoteModulesCallback callbackModule) @@ -165,16 +168,16 @@ void RC_CallConv EnumerateRemoteSectionsAndModules(RC_Pointer process, Enumerate address = reinterpret_cast(memInfo.BaseAddress) + memInfo.RegionSize; } - const auto moduleEnumerator = [&](EnumerateRemoteModuleData* data) + const auto moduleEnumerator = [&](EnumerateRemoteModuleData& data) { if (callbackModule != nullptr) { - callbackModule(data); + callbackModule(&data); } if (callbackSection != nullptr) { - auto it = std::lower_bound(std::begin(sections), std::end(sections), static_cast(data->BaseAddress), [§ions](const auto& lhs, const LPVOID& rhs) + auto it = std::lower_bound(std::begin(sections), std::end(sections), static_cast(data.BaseAddress), [§ions](const auto& lhs, const LPVOID& rhs) { return lhs.BaseAddress < rhs; }); @@ -182,17 +185,17 @@ void RC_CallConv EnumerateRemoteSectionsAndModules(RC_Pointer process, Enumerate IMAGE_DOS_HEADER imageDosHeader = {}; IMAGE_NT_HEADERS imageNtHeaders = {}; - if (!ReadRemoteMemory(process, data->BaseAddress, &imageDosHeader, 0, sizeof(IMAGE_DOS_HEADER)) - || !ReadRemoteMemory(process, PUCHAR(data->BaseAddress) + imageDosHeader.e_lfanew, &imageNtHeaders, 0, sizeof(IMAGE_NT_HEADERS))) + if (!ReadRemoteMemory(process, data.BaseAddress, &imageDosHeader, 0, sizeof(IMAGE_DOS_HEADER)) + || !ReadRemoteMemory(process, PUCHAR(data.BaseAddress) + imageDosHeader.e_lfanew, &imageNtHeaders, 0, sizeof(IMAGE_NT_HEADERS))) { return; } std::vector sectionHeaders(imageNtHeaders.FileHeader.NumberOfSections); - ReadRemoteMemory(process, PUCHAR(data->BaseAddress) + imageDosHeader.e_lfanew + sizeof(IMAGE_NT_HEADERS), sectionHeaders.data(), 0, imageNtHeaders.FileHeader.NumberOfSections * sizeof(IMAGE_SECTION_HEADER)); + ReadRemoteMemory(process, PUCHAR(data.BaseAddress) + imageDosHeader.e_lfanew + sizeof(IMAGE_NT_HEADERS), sectionHeaders.data(), 0, imageNtHeaders.FileHeader.NumberOfSections * sizeof(IMAGE_SECTION_HEADER)); for (auto&& sectionHeader : sectionHeaders) { - const auto sectionAddress = reinterpret_cast(data->BaseAddress) + sectionHeader.VirtualAddress; + const auto sectionAddress = reinterpret_cast(data.BaseAddress) + sectionHeader.VirtualAddress; for (; it != std::end(sections); ++it) { @@ -200,7 +203,7 @@ void RC_CallConv EnumerateRemoteSectionsAndModules(RC_Pointer process, Enumerate if (sectionAddress >= reinterpret_cast(section.BaseAddress) && sectionAddress < reinterpret_cast(section.BaseAddress) + static_cast(section.Size) - && sectionHeader.VirtualAddress + sectionHeader.Misc.VirtualSize <= data->Size) + && sectionHeader.VirtualAddress + sectionHeader.Misc.VirtualSize <= data.Size) { if ((sectionHeader.Characteristics & IMAGE_SCN_CNT_CODE) == IMAGE_SCN_CNT_CODE) { @@ -222,7 +225,7 @@ void RC_CallConv EnumerateRemoteSectionsAndModules(RC_Pointer process, Enumerate { std::memset(section.Name, 0, sizeof(section.Name)); } - std::memcpy(section.ModulePath, data->Path, std::min(MAX_PATH, PATH_MAXIMUM_LENGTH)); + std::memcpy(section.ModulePath, data.Path, std::min(MAX_PATH, PATH_MAXIMUM_LENGTH)); break; } @@ -231,7 +234,7 @@ void RC_CallConv EnumerateRemoteSectionsAndModules(RC_Pointer process, Enumerate } }; - if (EnumerateRemoteModulesNative(process, moduleEnumerator) != ERROR_SUCCESS) + if (!EnumerateRemoteModulesNative(process, moduleEnumerator)) { EnumerateRemoteModulesWinapi(process, moduleEnumerator); } From e5f78fac7f3b31b2d95ad12141f9a18e9698a7b2 Mon Sep 17 00:00:00 2001 From: KN4CK3R Date: Tue, 5 May 2020 12:23:34 +0200 Subject: [PATCH 122/223] Restructured code (3/4) --- .../EnumerateRemoteSectionsAndModules.cpp | 52 ++++++++++--------- 1 file changed, 27 insertions(+), 25 deletions(-) diff --git a/NativeCore/Windows/EnumerateRemoteSectionsAndModules.cpp b/NativeCore/Windows/EnumerateRemoteSectionsAndModules.cpp index a5b15b79..36b44160 100644 --- a/NativeCore/Windows/EnumerateRemoteSectionsAndModules.cpp +++ b/NativeCore/Windows/EnumerateRemoteSectionsAndModules.cpp @@ -44,53 +44,55 @@ static DWORD GetRemotePeb(HANDLE process, PPEB* ppeb) using InternalEnumerateRemoteModulesCallback = std::function; -static bool EnumerateRemoteModulesNative(HANDLE process, const InternalEnumerateRemoteModulesCallback& callback) +bool EnumerateRemoteModulesNative(const RC_Pointer process, const InternalEnumerateRemoteModulesCallback& callback) { PPEB ppeb; - const auto error = GetRemotePeb(process, &ppeb); - if (error != ERROR_SUCCESS) + if (GetRemotePeb(process, &ppeb) != ERROR_SUCCESS) + { return false; + } PPEB_LDR_DATA ldr; - auto success = ReadRemoteMemory(process, &ppeb->Ldr, &ldr, 0, sizeof(ldr)); - if (!success) + if (!ReadRemoteMemory(process, &ppeb->Ldr, &ldr, 0, sizeof(PPEB_LDR_DATA))) + { return false; + } - const auto list_head = &ldr->InMemoryOrderModuleList; // remote address - PLIST_ENTRY list_current; // remote address - success = ReadRemoteMemory(process, &list_head->Flink, &list_current, 0, sizeof(list_current)); - if (!success) + const auto head = &ldr->InMemoryOrderModuleList; + PLIST_ENTRY current; + if (!ReadRemoteMemory(process, &head->Flink, ¤t, 0, sizeof(PLIST_ENTRY))) + { return false; + } - while (list_current != list_head) + while (current != head) { - // TODO: error handling - what do we do if module list changed? We can't un-call the callback - - LDR_DATA_TABLE_ENTRY mod; - success = ReadRemoteMemory(process, CONTAINING_RECORD(list_current, LDR_DATA_TABLE_ENTRY, InMemoryOrderLinks), &mod, 0, sizeof(mod)); - if (!success) + LDR_DATA_TABLE_ENTRY entry; + if (!ReadRemoteMemory(process, CONTAINING_RECORD(current, LDR_DATA_TABLE_ENTRY, InMemoryOrderLinks), &entry, 0, sizeof(entry))) + { break; + } EnumerateRemoteModuleData data = {}; - data.BaseAddress = mod.DllBase; - data.Size = *(ULONG*)&mod.Reserved2[1]; // instead of undocced member could read ImageSize from headers - const auto path_len = std::min(sizeof(RC_UnicodeChar) * (PATH_MAXIMUM_LENGTH - 1), size_t(mod.FullDllName.Length)); - success = ReadRemoteMemory(process, mod.FullDllName.Buffer, data.Path, 0, int(path_len)); - if (!success) + data.BaseAddress = entry.DllBase; + data.Size = *reinterpret_cast(&entry.Reserved2[1]); // instead of undocced member could read ImageSize from headers + + const auto length = std::min(sizeof(RC_UnicodeChar) * (PATH_MAXIMUM_LENGTH - 1), entry.FullDllName.Length); + if (!ReadRemoteMemory(process, entry.FullDllName.Buffer, data.Path, 0, length)) + { break; - - // UNICODE_STRING is not guaranteed to be null terminated - data.Path[path_len / 2] = 0; + } + data.Path[length / 2] = 0; callback(data); - list_current = mod.InMemoryOrderLinks.Flink; + current = entry.InMemoryOrderLinks.Flink; } return true; } -bool EnumerateRemoteModulesWinapi(HANDLE process, const InternalEnumerateRemoteModulesCallback& callback) +bool EnumerateRemoteModulesWinapi(const RC_Pointer process, const InternalEnumerateRemoteModulesCallback& callback) { const auto handle = CreateToolhelp32Snapshot(TH32CS_SNAPMODULE, GetProcessId(process)); if (handle == INVALID_HANDLE_VALUE) From be7455ab4c1b8adcb183e3d3b7172974c1759bfd Mon Sep 17 00:00:00 2001 From: KN4CK3R Date: Tue, 5 May 2020 12:51:13 +0200 Subject: [PATCH 123/223] Restructured code (4/4) --- .../EnumerateRemoteSectionsAndModules.cpp | 84 ++++++++----------- 1 file changed, 37 insertions(+), 47 deletions(-) diff --git a/NativeCore/Windows/EnumerateRemoteSectionsAndModules.cpp b/NativeCore/Windows/EnumerateRemoteSectionsAndModules.cpp index 36b44160..d310a977 100644 --- a/NativeCore/Windows/EnumerateRemoteSectionsAndModules.cpp +++ b/NativeCore/Windows/EnumerateRemoteSectionsAndModules.cpp @@ -7,47 +7,37 @@ #include "NativeCore.hpp" -static DWORD GetRemotePeb(HANDLE process, PPEB* ppeb) +PPEB GetRemotePeb(const HANDLE process) { - const auto ntdll = GetModuleHandle(TEXT("ntdll")); + static auto* const ntdll = GetModuleHandle(TEXT("ntdll")); if (!ntdll) - return ERROR_MOD_NOT_FOUND; - - using tRtlNtStatusToDosError = ULONG (NTAPI *)( - _In_ NTSTATUS Status - ); - const auto pRtlNtStatusToDosError = tRtlNtStatusToDosError(GetProcAddress(ntdll, "RtlNtStatusToDosError")); - if (!pRtlNtStatusToDosError) - return ERROR_NOT_FOUND; - - using tNtQueryInformationProcess = NTSTATUS (NTAPI *)( - _In_ HANDLE ProcessHandle, - _In_ PROCESSINFOCLASS ProcessInformationClass, - _Out_writes_bytes_(ProcessInformationLength) PVOID ProcessInformation, - _In_ ULONG ProcessInformationLength, - _Out_opt_ PULONG ReturnLength - ); - - const auto pNtQueryInformationProcess = tNtQueryInformationProcess(GetProcAddress(ntdll, "NtQueryInformationProcess")); + { + return nullptr; + } + + using tNtQueryInformationProcess = NTSTATUS (NTAPI*)(_In_ HANDLE ProcessHandle, _In_ PROCESSINFOCLASS ProcessInformationClass, _Out_writes_bytes_(ProcessInformationLength) PVOID ProcessInformation, _In_ ULONG ProcessInformationLength, _Out_opt_ PULONG ReturnLength); + + static const auto pNtQueryInformationProcess = tNtQueryInformationProcess(GetProcAddress(ntdll, "NtQueryInformationProcess")); if (!pNtQueryInformationProcess) - return ERROR_NOT_FOUND; + { + return nullptr; + } PROCESS_BASIC_INFORMATION pbi; - const auto status = pNtQueryInformationProcess(process, ProcessBasicInformation, &pbi, sizeof(pbi), nullptr); - if (!NT_SUCCESS(status)) - return pRtlNtStatusToDosError(status); + if (!NT_SUCCESS(pNtQueryInformationProcess(process, ProcessBasicInformation, &pbi, sizeof(PROCESS_BASIC_INFORMATION), nullptr))) + { + return nullptr; + } - *ppeb = pbi.PebBaseAddress; - - return ERROR_SUCCESS; + return pbi.PebBaseAddress; } using InternalEnumerateRemoteModulesCallback = std::function; bool EnumerateRemoteModulesNative(const RC_Pointer process, const InternalEnumerateRemoteModulesCallback& callback) { - PPEB ppeb; - if (GetRemotePeb(process, &ppeb) != ERROR_SUCCESS) + auto* const ppeb = GetRemotePeb(process); + if (ppeb == nullptr) { return false; } @@ -58,7 +48,7 @@ bool EnumerateRemoteModulesNative(const RC_Pointer process, const InternalEnumer return false; } - const auto head = &ldr->InMemoryOrderModuleList; + auto* const head = &ldr->InMemoryOrderModuleList; PLIST_ENTRY current; if (!ReadRemoteMemory(process, &head->Flink, ¤t, 0, sizeof(PLIST_ENTRY))) { @@ -94,7 +84,7 @@ bool EnumerateRemoteModulesNative(const RC_Pointer process, const InternalEnumer bool EnumerateRemoteModulesWinapi(const RC_Pointer process, const InternalEnumerateRemoteModulesCallback& callback) { - const auto handle = CreateToolhelp32Snapshot(TH32CS_SNAPMODULE, GetProcessId(process)); + auto* const handle = CreateToolhelp32Snapshot(TH32CS_SNAPMODULE, GetProcessId(process)); if (handle == INVALID_HANDLE_VALUE) { return false; @@ -129,28 +119,28 @@ void RC_CallConv EnumerateRemoteSectionsAndModules(RC_Pointer process, Enumerate std::vector sections; - MEMORY_BASIC_INFORMATION memInfo = { }; - memInfo.RegionSize = 0x1000; + MEMORY_BASIC_INFORMATION memory = { }; + memory.RegionSize = 0x1000; size_t address = 0; - while (VirtualQueryEx(process, reinterpret_cast(address), &memInfo, sizeof(MEMORY_BASIC_INFORMATION)) != 0 && address + memInfo.RegionSize > address) + while (VirtualQueryEx(process, reinterpret_cast(address), &memory, sizeof(MEMORY_BASIC_INFORMATION)) != 0 && address + memory.RegionSize > address) { - if (memInfo.State == MEM_COMMIT) + if (memory.State == MEM_COMMIT) { EnumerateRemoteSectionData section = {}; - section.BaseAddress = memInfo.BaseAddress; - section.Size = memInfo.RegionSize; + section.BaseAddress = memory.BaseAddress; + section.Size = memory.RegionSize; section.Protection = SectionProtection::NoAccess; - if ((memInfo.Protect & PAGE_EXECUTE) == PAGE_EXECUTE) section.Protection |= SectionProtection::Execute; - if ((memInfo.Protect & PAGE_EXECUTE_READ) == PAGE_EXECUTE_READ) section.Protection |= SectionProtection::Execute | SectionProtection::Read; - if ((memInfo.Protect & PAGE_EXECUTE_READWRITE) == PAGE_EXECUTE_READWRITE) section.Protection |= SectionProtection::Execute | SectionProtection::Read | SectionProtection::Write; - if ((memInfo.Protect & PAGE_EXECUTE_WRITECOPY) == PAGE_EXECUTE_WRITECOPY) section.Protection |= SectionProtection::Execute | SectionProtection::Read | SectionProtection::CopyOnWrite; - if ((memInfo.Protect & PAGE_READONLY) == PAGE_READONLY) section.Protection |= SectionProtection::Read; - if ((memInfo.Protect & PAGE_READWRITE) == PAGE_READWRITE) section.Protection |= SectionProtection::Read | SectionProtection::Write; - if ((memInfo.Protect & PAGE_WRITECOPY) == PAGE_WRITECOPY) section.Protection |= SectionProtection::Read | SectionProtection::CopyOnWrite; - if ((memInfo.Protect & PAGE_GUARD) == PAGE_GUARD) section.Protection |= SectionProtection::Guard; + if ((memory.Protect & PAGE_EXECUTE) == PAGE_EXECUTE) section.Protection |= SectionProtection::Execute; + if ((memory.Protect & PAGE_EXECUTE_READ) == PAGE_EXECUTE_READ) section.Protection |= SectionProtection::Execute | SectionProtection::Read; + if ((memory.Protect & PAGE_EXECUTE_READWRITE) == PAGE_EXECUTE_READWRITE) section.Protection |= SectionProtection::Execute | SectionProtection::Read | SectionProtection::Write; + if ((memory.Protect & PAGE_EXECUTE_WRITECOPY) == PAGE_EXECUTE_WRITECOPY) section.Protection |= SectionProtection::Execute | SectionProtection::Read | SectionProtection::CopyOnWrite; + if ((memory.Protect & PAGE_READONLY) == PAGE_READONLY) section.Protection |= SectionProtection::Read; + if ((memory.Protect & PAGE_READWRITE) == PAGE_READWRITE) section.Protection |= SectionProtection::Read | SectionProtection::Write; + if ((memory.Protect & PAGE_WRITECOPY) == PAGE_WRITECOPY) section.Protection |= SectionProtection::Read | SectionProtection::CopyOnWrite; + if ((memory.Protect & PAGE_GUARD) == PAGE_GUARD) section.Protection |= SectionProtection::Guard; - switch (memInfo.Type) + switch (memory.Type) { case MEM_IMAGE: section.Type = SectionType::Image; @@ -167,7 +157,7 @@ void RC_CallConv EnumerateRemoteSectionsAndModules(RC_Pointer process, Enumerate sections.push_back(section); } - address = reinterpret_cast(memInfo.BaseAddress) + memInfo.RegionSize; + address = reinterpret_cast(memory.BaseAddress) + memory.RegionSize; } const auto moduleEnumerator = [&](EnumerateRemoteModuleData& data) From c0c080ebd007847789dd0f900f61f25bfb92a229 Mon Sep 17 00:00:00 2001 From: KN4CK3R Date: Wed, 6 May 2020 12:04:11 +0200 Subject: [PATCH 124/223] Simplified code. --- ReClass.NET/Memory/RemoteProcess.cs | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/ReClass.NET/Memory/RemoteProcess.cs b/ReClass.NET/Memory/RemoteProcess.cs index 8c65e2e2..14337cf9 100644 --- a/ReClass.NET/Memory/RemoteProcess.cs +++ b/ReClass.NET/Memory/RemoteProcess.cs @@ -61,12 +61,10 @@ public IEnumerable Modules { get { - List cpy; lock (modules) { - cpy = modules.ToList(); + return new List(modules); } - return cpy; } } @@ -75,12 +73,10 @@ public IEnumerable
Sections { get { - List
cpy; lock (sections) { - cpy = sections.ToList(); + return new List
(sections); } - return cpy; } } @@ -568,20 +564,20 @@ public string GetNamedAddress(IntPtr address) return null; } - public bool EnumerateRemoteSectionsAndModules(out List
sections, out List modules) + public bool EnumerateRemoteSectionsAndModules(out List
_sections, out List _modules) { if (!IsValid) { - sections = null; - modules = null; + _sections = null; + _modules = null; return false; } - sections = new List
(); - modules = new List(); + _sections = new List
(); + _modules = new List(); - coreFunctions.EnumerateRemoteSectionsAndModules(handle, sections.Add, modules.Add); + coreFunctions.EnumerateRemoteSectionsAndModules(handle, _sections.Add, _modules.Add); return true; } @@ -600,11 +596,11 @@ public Task UpdateProcessInformationsAsync() if (!IsValid) { - lock(modules) + lock (modules) { modules.Clear(); } - lock(sections) + lock (sections) { sections.Clear(); } From f8170a3237162e675b6cc99db5b8c297406d15a1 Mon Sep 17 00:00:00 2001 From: KN4CK3R Date: Thu, 7 May 2020 11:54:43 +0200 Subject: [PATCH 125/223] Fixed url protocol. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b457de8b..3ed4a224 100644 --- a/README.md +++ b/README.md @@ -92,7 +92,7 @@ Memory Scanner ![](https://abload.de/img/scannerytub1.jpg) Pointer Preview -![](http://abload.de/img/memorypreview2gsfp.jpg) +![](https://abload.de/img/memorypreview2gsfp.jpg) Code Generator ![](https://abload.de/img/codegeneratorqdat2.jpg) From 6a2bdeff8d0e8c0b61cb7e11ca7a6f709464040c Mon Sep 17 00:00:00 2001 From: KN4CK3R Date: Thu, 7 May 2020 13:18:15 +0200 Subject: [PATCH 126/223] Added editor config to force coding style. --- .editorconfig | 204 ++++++++++++++++++++++++++++++++++++++++++++++++ ReClass.NET.sln | 1 + 2 files changed, 205 insertions(+) create mode 100644 .editorconfig diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 00000000..6b2f3f66 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,204 @@ +root = true + +[*] +charset = utf-8 +trim_trailing_whitespace = true + +[*.cs] + +#### Core EditorConfig Options #### + +# Indentation and spacing +indent_size = 4 +indent_style = tab +tab_width = 4 + +# New line preferences +end_of_line = crlf +insert_final_newline = false + +#### .NET Coding Conventions #### + +# Organize usings +dotnet_separate_import_directive_groups = false +dotnet_sort_system_directives_first = true + +# this. and Me. preferences +dotnet_style_qualification_for_event = false:silent +dotnet_style_qualification_for_field = false:silent +dotnet_style_qualification_for_method = false:silent +dotnet_style_qualification_for_property = false:silent + +# Language keywords vs BCL types preferences +dotnet_style_predefined_type_for_locals_parameters_members = true:silent +dotnet_style_predefined_type_for_member_access = true:silent + +# Parentheses preferences +dotnet_style_parentheses_in_arithmetic_binary_operators = always_for_clarity:silent +dotnet_style_parentheses_in_other_binary_operators = always_for_clarity:silent +dotnet_style_parentheses_in_other_operators = never_if_unnecessary:silent +dotnet_style_parentheses_in_relational_binary_operators = always_for_clarity:silent + +# Modifier preferences +dotnet_style_require_accessibility_modifiers = for_non_interface_members:silent + +# Expression-level preferences +dotnet_style_coalesce_expression = true:suggestion +dotnet_style_collection_initializer = true:suggestion +dotnet_style_explicit_tuple_names = true:suggestion +dotnet_style_null_propagation = true:suggestion +dotnet_style_object_initializer = true:suggestion +dotnet_style_prefer_auto_properties = true:suggestion +dotnet_style_prefer_compound_assignment = true:suggestion +dotnet_style_prefer_conditional_expression_over_assignment = true:silent +dotnet_style_prefer_conditional_expression_over_return = true:silent +dotnet_style_prefer_inferred_anonymous_type_member_names = true:suggestion +dotnet_style_prefer_inferred_tuple_names = true:suggestion +dotnet_style_prefer_is_null_check_over_reference_equality_method = true:suggestion +dotnet_style_prefer_simplified_interpolation = true:suggestion + +# Field preferences +dotnet_style_readonly_field = true:suggestion + +# Parameter preferences +dotnet_code_quality_unused_parameters = all:suggestion + +#### C# Coding Conventions #### + +# var preferences +csharp_style_var_elsewhere = true:suggestion +csharp_style_var_for_built_in_types = true:suggestion +csharp_style_var_when_type_is_apparent = true:suggestion + +# Expression-bodied members +csharp_style_expression_bodied_accessors = true:suggestion +csharp_style_expression_bodied_constructors = false:silent +csharp_style_expression_bodied_indexers = true:suggestion +csharp_style_expression_bodied_lambdas = true:suggestion +csharp_style_expression_bodied_local_functions = true:suggestion +csharp_style_expression_bodied_methods = true:silent +csharp_style_expression_bodied_operators = true:suggestion +csharp_style_expression_bodied_properties = true:suggestion + +# Pattern matching preferences +csharp_style_pattern_matching_over_as_with_null_check = true:suggestion +csharp_style_pattern_matching_over_is_with_cast_check = true:suggestion +csharp_style_prefer_switch_expression = true:suggestion + +# Null-checking preferences +csharp_style_conditional_delegate_call = true:suggestion + +# Modifier preferences +csharp_prefer_static_local_function = true:suggestion +csharp_preferred_modifier_order = public,private,protected,internal,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,volatile,async:silent + +# Code-block preferences +csharp_prefer_braces = true:suggestion +csharp_prefer_simple_using_statement = true:suggestion + +# Expression-level preferences +csharp_prefer_simple_default_expression = true:suggestion +csharp_style_deconstructed_variable_declaration = true:suggestion +csharp_style_inlined_variable_declaration = true:suggestion +csharp_style_pattern_local_over_anonymous_function = true:suggestion +csharp_style_prefer_index_operator = true:suggestion +csharp_style_prefer_range_operator = true:suggestion +csharp_style_throw_expression = true:suggestion +csharp_style_unused_value_assignment_preference = discard_variable:suggestion +csharp_style_unused_value_expression_statement_preference = discard_variable:silent + +# 'using' directive preferences +csharp_using_directive_placement = outside_namespace:error + +#### C# Formatting Rules #### + +# New line preferences +csharp_new_line_before_catch = true +csharp_new_line_before_else = true +csharp_new_line_before_finally = true +csharp_new_line_before_members_in_anonymous_types = true +csharp_new_line_before_members_in_object_initializers = true +csharp_new_line_before_open_brace = all + +# Indentation preferences +csharp_indent_block_contents = true +csharp_indent_braces = false +csharp_indent_case_contents = true +csharp_indent_case_contents_when_block = true +csharp_indent_labels = one_less_than_current +csharp_indent_switch_labels = true + +# Space preferences +csharp_space_after_cast = false +csharp_space_after_colon_in_inheritance_clause = true +csharp_space_after_comma = true +csharp_space_after_dot = false +csharp_space_after_keywords_in_control_flow_statements = true +csharp_space_after_semicolon_in_for_statement = true +csharp_space_around_binary_operators = before_and_after +csharp_space_around_declaration_statements = false +csharp_space_before_colon_in_inheritance_clause = true +csharp_space_before_comma = false +csharp_space_before_dot = false +csharp_space_before_open_square_brackets = false +csharp_space_before_semicolon_in_for_statement = false +csharp_space_between_empty_square_brackets = false +csharp_space_between_method_call_empty_parameter_list_parentheses = false +csharp_space_between_method_call_name_and_opening_parenthesis = false +csharp_space_between_method_call_parameter_list_parentheses = false +csharp_space_between_method_declaration_empty_parameter_list_parentheses = false +csharp_space_between_method_declaration_name_and_open_parenthesis = false +csharp_space_between_method_declaration_parameter_list_parentheses = false +csharp_space_between_parentheses = false +csharp_space_between_square_brackets = false + +# Wrapping preferences +csharp_preserve_single_line_blocks = true +csharp_preserve_single_line_statements = true + +#### Naming styles #### + +# Naming rules + +dotnet_naming_rule.interface_should_be_begins_with_i.severity = suggestion +dotnet_naming_rule.interface_should_be_begins_with_i.symbols = interface +dotnet_naming_rule.interface_should_be_begins_with_i.style = begins_with_i + +dotnet_naming_rule.types_should_be_pascal_case.severity = suggestion +dotnet_naming_rule.types_should_be_pascal_case.symbols = types +dotnet_naming_rule.types_should_be_pascal_case.style = pascal_case + +dotnet_naming_rule.non_field_members_should_be_pascal_case.severity = suggestion +dotnet_naming_rule.non_field_members_should_be_pascal_case.symbols = non_field_members +dotnet_naming_rule.non_field_members_should_be_pascal_case.style = pascal_case + +# Symbol specifications + +dotnet_naming_symbols.interface.applicable_kinds = interface +dotnet_naming_symbols.interface.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected +dotnet_naming_symbols.interface.required_modifiers = + +dotnet_naming_symbols.types.applicable_kinds = class, struct, interface, enum +dotnet_naming_symbols.types.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected +dotnet_naming_symbols.types.required_modifiers = + +dotnet_naming_symbols.non_field_members.applicable_kinds = property, event, method +dotnet_naming_symbols.non_field_members.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected +dotnet_naming_symbols.non_field_members.required_modifiers = + +# Naming styles + +dotnet_naming_style.pascal_case.required_prefix = +dotnet_naming_style.pascal_case.required_suffix = +dotnet_naming_style.pascal_case.word_separator = +dotnet_naming_style.pascal_case.capitalization = pascal_case + +dotnet_naming_style.begins_with_i.required_prefix = I +dotnet_naming_style.begins_with_i.required_suffix = +dotnet_naming_style.begins_with_i.word_separator = +dotnet_naming_style.begins_with_i.capitalization = pascal_case + +# Warnings + +# CS8509: The switch expression does not handle all possible values of its input type (it is not exhaustive). +dotnet_diagnostic.CS8509.severity = none diff --git a/ReClass.NET.sln b/ReClass.NET.sln index ec68abfc..6345bb67 100644 --- a/ReClass.NET.sln +++ b/ReClass.NET.sln @@ -17,6 +17,7 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ReClass.NET_Launcher", "ReC EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{19CF2B0F-2722-4108-8308-B628D91F7A1E}" ProjectSection(SolutionItems) = preProject + .editorconfig = .editorconfig README.md = README.md EndProjectSection EndProject From 534b68461232ef8ef9eb917fc4e70456adcd70df Mon Sep 17 00:00:00 2001 From: KN4CK3R Date: Thu, 7 May 2020 13:25:03 +0200 Subject: [PATCH 127/223] Updated config. --- .editorconfig | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.editorconfig b/.editorconfig index 6b2f3f66..e7f5fa79 100644 --- a/.editorconfig +++ b/.editorconfig @@ -4,6 +4,13 @@ root = true charset = utf-8 trim_trailing_whitespace = true +[*.{c,h,cpp,hpp}] + +# Indentation and spacing +indent_size = 4 +indent_style = tab +tab_width = 4 + [*.cs] #### Core EditorConfig Options #### @@ -198,7 +205,7 @@ dotnet_naming_style.begins_with_i.required_suffix = dotnet_naming_style.begins_with_i.word_separator = dotnet_naming_style.begins_with_i.capitalization = pascal_case -# Warnings +#### Warnings #### # CS8509: The switch expression does not handle all possible values of its input type (it is not exhaustive). dotnet_diagnostic.CS8509.severity = none From 15c50631cc2c50c8d776b649dd1a0481b25f86d7 Mon Sep 17 00:00:00 2001 From: KN4CK3R Date: Sun, 5 Jul 2020 10:16:36 +0200 Subject: [PATCH 128/223] Fixed reading wrong module size. (Fixes #161) --- NativeCore/Windows/EnumerateRemoteSectionsAndModules.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NativeCore/Windows/EnumerateRemoteSectionsAndModules.cpp b/NativeCore/Windows/EnumerateRemoteSectionsAndModules.cpp index d310a977..066b077b 100644 --- a/NativeCore/Windows/EnumerateRemoteSectionsAndModules.cpp +++ b/NativeCore/Windows/EnumerateRemoteSectionsAndModules.cpp @@ -65,7 +65,7 @@ bool EnumerateRemoteModulesNative(const RC_Pointer process, const InternalEnumer EnumerateRemoteModuleData data = {}; data.BaseAddress = entry.DllBase; - data.Size = *reinterpret_cast(&entry.Reserved2[1]); // instead of undocced member could read ImageSize from headers + data.Size = *reinterpret_cast(&entry.Reserved3[1]); // instead of undocced member could read ImageSize from headers const auto length = std::min(sizeof(RC_UnicodeChar) * (PATH_MAXIMUM_LENGTH - 1), entry.FullDllName.Length); if (!ReadRemoteMemory(process, entry.FullDllName.Buffer, data.Path, 0, length)) From 55671436d22cda7a0675fc54449913f657f585d9 Mon Sep 17 00:00:00 2001 From: KN4CK3R Date: Sun, 5 Jul 2020 11:54:55 +0200 Subject: [PATCH 129/223] Code cleanup. Use using directive. Use pattern matching. Removed unneeded imports. --- .../CodeGenerator/CSharpCodeGenerator.cs | 75 +++---- ReClass.NET/CodeGenerator/CppCodeGenerator.cs | 170 +++++++------- .../DataExchange/ReClass/ReClassClipboard.cs | 28 +-- .../ReClass/ReClassNetFile.Write.cs | 128 ++++++----- .../DataExchange/Scanner/CheatEngineFile.cs | 89 ++++---- .../DataExchange/Scanner/ReClassScanFile.cs | 208 +++++++++--------- .../Debugger/RemoteDebugger.Handler.cs | 3 +- ReClass.NET/Debugger/RemoteDebugger.cs | 1 - ReClass.NET/Extensions/EncodingExtensions.cs | 17 +- ReClass.NET/Extensions/EnumerableExtension.cs | 32 ++- .../Extensions/XAttributeExtensions.cs | 2 +- ReClass.NET/Logger/BaseLogger.cs | 2 +- ReClass.NET/Logger/GuiLogger.cs | 2 +- ReClass.NET/Memory/ProcessInfo.cs | 6 +- ReClass.NET/Memory/SimplePeHeader.cs | 22 +- ReClass.NET/MemoryScanner/BytePattern.cs | 32 ++- .../MemoryScanner/InputCorrelatedScanner.cs | 25 +-- ReClass.NET/MemoryScanner/ScanResultBlock.cs | 1 - ReClass.NET/MemoryScanner/ScanResultStore.cs | 48 ++-- ReClass.NET/MemoryScanner/Scanner.cs | 49 ++--- ReClass.NET/Symbols/SymbolReader.cs | 25 +-- ReClass.NET/Symbols/SymbolStore.cs | 28 ++- 22 files changed, 466 insertions(+), 527 deletions(-) diff --git a/ReClass.NET/CodeGenerator/CSharpCodeGenerator.cs b/ReClass.NET/CodeGenerator/CSharpCodeGenerator.cs index 91bf5fcf..d512223c 100644 --- a/ReClass.NET/CodeGenerator/CSharpCodeGenerator.cs +++ b/ReClass.NET/CodeGenerator/CSharpCodeGenerator.cs @@ -43,59 +43,56 @@ public class CSharpCodeGenerator : ICodeGenerator public string GenerateCode(IReadOnlyList classes, IReadOnlyList enums, ILogger logger) { - using (var sw = new StringWriter()) + using var sw = new StringWriter(); + using var iw = new IndentedTextWriter(sw, "\t"); + + iw.WriteLine($"// Created with {Constants.ApplicationName} {Constants.ApplicationVersion} by {Constants.Author}"); + iw.WriteLine(); + iw.WriteLine("// Warning: The C# code generator doesn't support all node types!"); + iw.WriteLine(); + iw.WriteLine("using System.Runtime.InteropServices;"); + + iw.WriteLine("// optional namespace, only for vectors"); + iw.WriteLine("using System.Numerics;"); + iw.WriteLine(); + + using (var en = enums.GetEnumerator()) { - using (var iw = new IndentedTextWriter(sw, "\t")) + if (en.MoveNext()) { - iw.WriteLine($"// Created with {Constants.ApplicationName} {Constants.ApplicationVersion} by {Constants.Author}"); - iw.WriteLine(); - iw.WriteLine("// Warning: The C# code generator doesn't support all node types!"); - iw.WriteLine(); - iw.WriteLine("using System.Runtime.InteropServices;"); + WriteEnum(iw, en.Current); - iw.WriteLine("// optional namespace, only for vectors"); - iw.WriteLine("using System.Numerics;"); - iw.WriteLine(); - - using (var en = enums.GetEnumerator()) + while (en.MoveNext()) { - if (en.MoveNext()) - { - WriteEnum(iw, en.Current); + iw.WriteLine(); - while (en.MoveNext()) - { - iw.WriteLine(); + WriteEnum(iw, en.Current); + } - WriteEnum(iw, en.Current); - } + iw.WriteLine(); + } + } - iw.WriteLine(); - } - } + var classesToWrite = classes + .Where(c => c.Nodes.None(n => n is FunctionNode)) // Skip class which contains FunctionNodes because these are not data classes. + .Distinct(); - var classesToWrite = classes - .Where(c => c.Nodes.None(n => n is FunctionNode)) // Skip class which contains FunctionNodes because these are not data classes. - .Distinct(); + using (var en = classesToWrite.GetEnumerator()) + { + if (en.MoveNext()) + { + WriteClass(iw, en.Current, logger); - using (var en = classesToWrite.GetEnumerator()) + while (en.MoveNext()) { - if (en.MoveNext()) - { - WriteClass(iw, en.Current, logger); - - while (en.MoveNext()) - { - iw.WriteLine(); + iw.WriteLine(); - WriteClass(iw, en.Current, logger); - } - } + WriteClass(iw, en.Current, logger); } } - - return sw.ToString(); } + + return sw.ToString(); } /// diff --git a/ReClass.NET/CodeGenerator/CppCodeGenerator.cs b/ReClass.NET/CodeGenerator/CppCodeGenerator.cs index 40510e36..41733634 100644 --- a/ReClass.NET/CodeGenerator/CppCodeGenerator.cs +++ b/ReClass.NET/CodeGenerator/CppCodeGenerator.cs @@ -154,76 +154,73 @@ public CppCodeGenerator(CppTypeMapping typeMapping) public string GenerateCode(IReadOnlyList classes, IReadOnlyList enums, ILogger logger) { - using (var sw = new StringWriter()) + using var sw = new StringWriter(); + using var iw = new IndentedTextWriter(sw, "\t"); + + iw.WriteLine($"// Created with {Constants.ApplicationName} {Constants.ApplicationVersion} by {Constants.Author}"); + iw.WriteLine(); + + using (var en = enums.GetEnumerator()) { - using (var iw = new IndentedTextWriter(sw, "\t")) + if (en.MoveNext()) { - iw.WriteLine($"// Created with {Constants.ApplicationName} {Constants.ApplicationVersion} by {Constants.Author}"); - iw.WriteLine(); + WriteEnum(iw, en.Current); - using (var en = enums.GetEnumerator()) + while (en.MoveNext()) { - if (en.MoveNext()) - { - WriteEnum(iw, en.Current); + iw.WriteLine(); - while (en.MoveNext()) - { - iw.WriteLine(); + WriteEnum(iw, en.Current); + } - WriteEnum(iw, en.Current); - } + iw.WriteLine(); + } + } - iw.WriteLine(); - } - } + var alreadySeen = new HashSet(); - var alreadySeen = new HashSet(); + IEnumerable GetReversedClassHierarchy(ClassNode node) + { + Contract.Requires(node != null); + Contract.Ensures(Contract.Result>() != null); - IEnumerable GetReversedClassHierarchy(ClassNode node) - { - Contract.Requires(node != null); - Contract.Ensures(Contract.Result>() != null); + if (!alreadySeen.Add(node)) + { + return Enumerable.Empty(); + } - if (!alreadySeen.Add(node)) - { - return Enumerable.Empty(); - } + var classNodes = node.Nodes + .OfType() + .Where(w => !w.IsNodePresentInChain()) // Pointers are forward declared + .Select(w => w.ResolveMostInnerNode() as ClassNode) + .Where(n => n != null); - var classNodes = node.Nodes - .OfType() - .Where(w => !w.IsNodePresentInChain()) // Pointers are forward declared - .Select(w => w.ResolveMostInnerNode() as ClassNode) - .Where(n => n != null); + return classNodes + .SelectMany(GetReversedClassHierarchy) + .Append(node); + } - return classNodes - .SelectMany(GetReversedClassHierarchy) - .Append(node); - } + var classesToWrite = classes + .Where(c => c.Nodes.None(n => n is FunctionNode)) // Skip class which contains FunctionNodes because these are not data classes. + .SelectMany(GetReversedClassHierarchy) // Order the classes by their use hierarchy. + .Distinct(); - var classesToWrite = classes - .Where(c => c.Nodes.None(n => n is FunctionNode)) // Skip class which contains FunctionNodes because these are not data classes. - .SelectMany(GetReversedClassHierarchy) // Order the classes by their use hierarchy. - .Distinct(); + using (var en = classesToWrite.GetEnumerator()) + { + if (en.MoveNext()) + { + WriteClass(iw, en.Current, classes, logger); - using (var en = classesToWrite.GetEnumerator()) + while (en.MoveNext()) { - if (en.MoveNext()) - { - WriteClass(iw, en.Current, classes, logger); - - while (en.MoveNext()) - { - iw.WriteLine(); + iw.WriteLine(); - WriteClass(iw, en.Current, classes, logger); - } - } + WriteClass(iw, en.Current, classes, logger); } } - - return sw.ToString(); } + + return sw.ToString(); } /// @@ -366,7 +363,7 @@ private void WriteNodes(IndentedTextWriter writer, IEnumerable nodes, var fill = 0; var fillStart = 0; - BaseNode CreatePaddingMember(int offset, int count) + static BaseNode CreatePaddingMember(int offset, int count) { var node = new ArrayNode { @@ -496,7 +493,7 @@ private static BaseNode TransformNode(BaseNode node) return custom.TransformNode(node); } - BaseNode GetCharacterNodeForEncoding(Encoding encoding) + static BaseNode GetCharacterNodeForEncoding(Encoding encoding) { if (encoding.IsSameCodePage(Encoding.Unicode)) { @@ -509,35 +506,35 @@ BaseNode GetCharacterNodeForEncoding(Encoding encoding) return new Utf8CharacterNode(); } - if (node is BaseTextNode textNode) - { - var arrayNode = new ArrayNode { Count = textNode.Length }; - arrayNode.CopyFromNode(node); - arrayNode.ChangeInnerNode(GetCharacterNodeForEncoding(textNode.Encoding)); - return arrayNode; - } - - if (node is BaseTextPtrNode textPtrNode) - { - var pointerNode = new PointerNode(); - pointerNode.CopyFromNode(node); - pointerNode.ChangeInnerNode(GetCharacterNodeForEncoding(textPtrNode.Encoding)); - return pointerNode; - } - - if (node is BitFieldNode bitFieldNode) - { - var underlayingNode = bitFieldNode.GetUnderlayingNode(); - underlayingNode.CopyFromNode(node); - return underlayingNode; - } - - if (node is BaseHexNode hexNode) + switch (node) { - var arrayNode = new ArrayNode { Count = hexNode.MemorySize }; - arrayNode.CopyFromNode(node); - arrayNode.ChangeInnerNode(new Utf8CharacterNode()); - return arrayNode; + case BaseTextNode textNode: + { + var arrayNode = new ArrayNode { Count = textNode.Length }; + arrayNode.CopyFromNode(node); + arrayNode.ChangeInnerNode(GetCharacterNodeForEncoding(textNode.Encoding)); + return arrayNode; + } + case BaseTextPtrNode textPtrNode: + { + var pointerNode = new PointerNode(); + pointerNode.CopyFromNode(node); + pointerNode.ChangeInnerNode(GetCharacterNodeForEncoding(textPtrNode.Encoding)); + return pointerNode; + } + case BitFieldNode bitFieldNode: + { + var underlayingNode = bitFieldNode.GetUnderlayingNode(); + underlayingNode.CopyFromNode(node); + return underlayingNode; + } + case BaseHexNode hexNode: + { + var arrayNode = new ArrayNode { Count = hexNode.MemorySize }; + arrayNode.CopyFromNode(node); + arrayNode.ChangeInnerNode(new Utf8CharacterNode()); + return arrayNode; + } } return node; @@ -564,13 +561,12 @@ private string GetTypeDefinition(BaseNode node, ILogger logger) return type; } - if (node is ClassInstanceNode classInstanceNode) - { - return $"class {classInstanceNode.InnerNode.Name}"; - } - if (node is EnumNode enumNode) + switch (node) { - return enumNode.Enum.Name; + case ClassInstanceNode classInstanceNode: + return $"class {classInstanceNode.InnerNode.Name}"; + case EnumNode enumNode: + return enumNode.Enum.Name; } return null; diff --git a/ReClass.NET/DataExchange/ReClass/ReClassClipboard.cs b/ReClass.NET/DataExchange/ReClass/ReClassClipboard.cs index 45b45c0c..908040c9 100644 --- a/ReClass.NET/DataExchange/ReClass/ReClassClipboard.cs +++ b/ReClass.NET/DataExchange/ReClass/ReClassClipboard.cs @@ -25,12 +25,11 @@ public static void Copy(IEnumerable nodes, ILogger logger) Contract.Requires(nodes != null); Contract.Requires(logger != null); - using (var ms = new MemoryStream()) - { - ReClassNetFile.SerializeNodesToStream(ms, nodes, logger); + using var ms = new MemoryStream(); - Clipboard.SetData(ClipboardFormat, ms.ToArray()); - } + ReClassNetFile.SerializeNodesToStream(ms, nodes, logger); + + Clipboard.SetData(ClipboardFormat, ms.ToArray()); } /// Pastes nodes from the clipboard. @@ -43,23 +42,14 @@ public static Tuple, List> Paste(ReClassNetProject tem Contract.Requires(logger != null); Contract.Ensures(Contract.Result, List>>() != null); - var classes = new List(); - var nodes = new List(); - - if (ContainsNodes) + if (ContainsNodes && Clipboard.GetData(ClipboardFormat) is byte[] data) { - if (Clipboard.GetData(ClipboardFormat) is byte[] data) - { - using (var ms = new MemoryStream(data)) - { - var result = ReClassNetFile.DeserializeNodesFromStream(ms, templateProject, logger); - classes.AddRange(result.Item1); - nodes.AddRange(result.Item2); - } - } + using var ms = new MemoryStream(data); + + return ReClassNetFile.DeserializeNodesFromStream(ms, templateProject, logger); } - return Tuple.Create(classes, nodes); + return Tuple.Create(new List(), new List()); } } } diff --git a/ReClass.NET/DataExchange/ReClass/ReClassNetFile.Write.cs b/ReClass.NET/DataExchange/ReClass/ReClassNetFile.Write.cs index 1e0cc696..65f9040b 100644 --- a/ReClass.NET/DataExchange/ReClass/ReClassNetFile.Write.cs +++ b/ReClass.NET/DataExchange/ReClass/ReClassNetFile.Write.cs @@ -14,36 +14,33 @@ public partial class ReClassNetFile { public void Save(string filePath, ILogger logger) { - using (var fs = new FileStream(filePath, FileMode.Create)) - { - Save(fs, logger); - } + using var fs = new FileStream(filePath, FileMode.Create); + + Save(fs, logger); } public void Save(Stream output, ILogger logger) { - using (var archive = new ZipArchive(output, ZipArchiveMode.Create)) - { - var dataEntry = archive.CreateEntry(DataFileName); - using (var entryStream = dataEntry.Open()) - { - var document = new XDocument( - new XComment($"{Constants.ApplicationName} {Constants.ApplicationVersion} by {Constants.Author}"), - new XComment($"Website: {Constants.HomepageUrl}"), - new XElement( - XmlRootElement, - new XAttribute(XmlVersionAttribute, FileVersion), - new XAttribute(XmlPlatformAttribute, Constants.Platform), - project.CustomData.Serialize(XmlCustomDataElement), - project.TypeMapping.Serialize(XmlTypeMappingElement), - new XElement(XmlEnumsElement, CreateEnumElements(project.Enums)), - new XElement(XmlClassesElement, CreateClassElements(project.Classes, logger)) - ) - ); - - document.Save(entryStream); - } - } + using var archive = new ZipArchive(output, ZipArchiveMode.Create); + + var dataEntry = archive.CreateEntry(DataFileName); + using var entryStream = dataEntry.Open(); + + var document = new XDocument( + new XComment($"{Constants.ApplicationName} {Constants.ApplicationVersion} by {Constants.Author}"), + new XComment($"Website: {Constants.HomepageUrl}"), + new XElement( + XmlRootElement, + new XAttribute(XmlVersionAttribute, FileVersion), + new XAttribute(XmlPlatformAttribute, Constants.Platform), + project.CustomData.Serialize(XmlCustomDataElement), + project.TypeMapping.Serialize(XmlTypeMappingElement), + new XElement(XmlEnumsElement, CreateEnumElements(project.Enums)), + new XElement(XmlClassesElement, CreateClassElements(project.Classes, logger)) + ) + ); + + document.Save(entryStream); } private static IEnumerable CreateEnumElements(IEnumerable enums) @@ -185,61 +182,60 @@ public static void SerializeNodesToStream(Stream output, IEnumerable n Contract.Requires(Contract.ForAll(nodes, n => n != null)); Contract.Requires(logger != null); - using (var project = new ReClassNetProject()) + using var project = new ReClassNetProject(); + + void RecursiveAddClasses(BaseNode node) { - void RecursiveAddClasses(BaseNode node) + ClassNode classNode = null; + switch (node) { - ClassNode classNode = null; - switch (node) - { - case ClassNode c1: - classNode = c1; - break; - case BaseWrapperNode wrapperNode when wrapperNode.ResolveMostInnerNode() is ClassNode c2: - classNode = c2; - break; - } + case ClassNode c1: + classNode = c1; + break; + case BaseWrapperNode wrapperNode when wrapperNode.ResolveMostInnerNode() is ClassNode c2: + classNode = c2; + break; + } - if (classNode == null || project.ContainsClass(classNode.Uuid)) - { - return; - } + if (classNode == null || project.ContainsClass(classNode.Uuid)) + { + return; + } - project.AddClass(classNode); + project.AddClass(classNode); - foreach (var wrapperNodeChild in classNode.Nodes.OfType()) - { - RecursiveAddClasses(wrapperNodeChild); - } + foreach (var wrapperNodeChild in classNode.Nodes.OfType()) + { + RecursiveAddClasses(wrapperNodeChild); } + } - var serialisationClass = new ClassNode(false) - { - Name = SerializationClassName - }; + var serialisationClass = new ClassNode(false) + { + Name = SerializationClassName + }; - var needsSerialisationClass = true; + var needsSerialisationClass = true; - foreach (var node in nodes) - { - RecursiveAddClasses(node); + foreach (var node in nodes) + { + RecursiveAddClasses(node); - if (!(node is ClassNode)) + if (!(node is ClassNode)) + { + if (needsSerialisationClass) { - if (needsSerialisationClass) - { - needsSerialisationClass = false; - - project.AddClass(serialisationClass); - } + needsSerialisationClass = false; - serialisationClass.AddNode(node); + project.AddClass(serialisationClass); } - } - var file = new ReClassNetFile(project); - file.Save(output, logger); + serialisationClass.AddNode(node); + } } + + var file = new ReClassNetFile(project); + file.Save(output, logger); } } } diff --git a/ReClass.NET/DataExchange/Scanner/CheatEngineFile.cs b/ReClass.NET/DataExchange/Scanner/CheatEngineFile.cs index 757846af..1c6b95d9 100644 --- a/ReClass.NET/DataExchange/Scanner/CheatEngineFile.cs +++ b/ReClass.NET/DataExchange/Scanner/CheatEngineFile.cs @@ -27,65 +27,64 @@ public class CheatEngineFile : IScannerImport public IEnumerable Load(string filePath, ILogger logger) { - using (var stream = File.OpenRead(filePath)) + using var stream = File.OpenRead(filePath); + + var document = XDocument.Load(stream); + if (document.Root != null) { - var document = XDocument.Load(stream); - if (document.Root != null) + var version = document.Root.Attribute(XmlVersionElement)?.Value; + if (string.Compare(version, Version26, StringComparison.Ordinal) >= 0) { - var version = document.Root.Attribute(XmlVersionElement)?.Value; - if (string.Compare(version, Version26, StringComparison.Ordinal) >= 0) + var entries = document.Root.Element(XmlEntriesElement); + if (entries != null) { - var entries = document.Root.Element(XmlEntriesElement); - if (entries != null) + foreach (var entry in entries.Elements(XmlEntryElement)) { - foreach (var entry in entries.Elements(XmlEntryElement)) + var description = entry.Element(XmlDescriptionElement)?.Value.Trim() ?? string.Empty; + if (description == "\"No description\"") { - var description = entry.Element(XmlDescriptionElement)?.Value.Trim() ?? string.Empty; - if (description == "\"No description\"") - { - description = string.Empty; - } - var variableTypeStr = entry.Element(XmlValueTypeElement)?.Value.Trim() ?? string.Empty; - var valueType = Parse(variableTypeStr, logger); + description = string.Empty; + } + var variableTypeStr = entry.Element(XmlValueTypeElement)?.Value.Trim() ?? string.Empty; + var valueType = Parse(variableTypeStr, logger); - var record = new MemoryRecord - { - Description = description, - ValueType = valueType - }; + var record = new MemoryRecord + { + Description = description, + ValueType = valueType + }; - var addressStr = entry.Element(XmlAddressElement)?.Value.Trim() ?? string.Empty; - var addressParts = addressStr.Split('+'); - if (addressParts.Length == 2) - { - long.TryParse(addressParts[1], NumberStyles.HexNumber, null, out var value); - record.AddressOrOffset = (IntPtr)value; + var addressStr = entry.Element(XmlAddressElement)?.Value.Trim() ?? string.Empty; + var addressParts = addressStr.Split('+'); + if (addressParts.Length == 2) + { + long.TryParse(addressParts[1], NumberStyles.HexNumber, null, out var value); + record.AddressOrOffset = (IntPtr)value; - record.ModuleName = addressParts[0].Trim(); - } - else - { - long.TryParse(addressStr, NumberStyles.HexNumber, null, out var value); - record.AddressOrOffset = (IntPtr)value; - } + record.ModuleName = addressParts[0].Trim(); + } + else + { + long.TryParse(addressStr, NumberStyles.HexNumber, null, out var value); + record.AddressOrOffset = (IntPtr)value; + } - if (valueType == ScanValueType.ArrayOfBytes || valueType == ScanValueType.String) - { - var lengthStr = entry.Element(XmlLengthElement)?.Value ?? string.Empty; - int.TryParse(lengthStr, NumberStyles.Integer, null, out var valueLength); + if (valueType == ScanValueType.ArrayOfBytes || valueType == ScanValueType.String) + { + var lengthStr = entry.Element(XmlLengthElement)?.Value ?? string.Empty; + int.TryParse(lengthStr, NumberStyles.Integer, null, out var valueLength); - record.ValueLength = Math.Max(1, valueLength); + record.ValueLength = Math.Max(1, valueLength); - if (valueType == ScanValueType.String) - { - var isUnicode = (entry.Element(XmlUnicodeElement)?.Value ?? string.Empty) == "1"; + if (valueType == ScanValueType.String) + { + var isUnicode = (entry.Element(XmlUnicodeElement)?.Value ?? string.Empty) == "1"; - record.Encoding = isUnicode ? Encoding.Unicode : Encoding.UTF8; - } + record.Encoding = isUnicode ? Encoding.Unicode : Encoding.UTF8; } - - yield return record; } + + yield return record; } } } diff --git a/ReClass.NET/DataExchange/Scanner/ReClassScanFile.cs b/ReClass.NET/DataExchange/Scanner/ReClassScanFile.cs index 623c80fb..8af86952 100644 --- a/ReClass.NET/DataExchange/Scanner/ReClassScanFile.cs +++ b/ReClass.NET/DataExchange/Scanner/ReClassScanFile.cs @@ -35,136 +35,128 @@ public class ReClassScanFile : IScannerImport, IScannerExport public IEnumerable Load(string filePath, ILogger logger) { - using (var fs = new FileStream(filePath, FileMode.Open)) + using var fs = new FileStream(filePath, FileMode.Open); + using var archive = new ZipArchive(fs, ZipArchiveMode.Read); + + var dataEntry = archive.GetEntry(DataFileName); + if (dataEntry == null) { - using (var archive = new ZipArchive(fs, ZipArchiveMode.Read)) - { - var dataEntry = archive.GetEntry(DataFileName); - if (dataEntry == null) - { - throw new FormatException(); - } - using (var entryStream = dataEntry.Open()) - { - var document = XDocument.Load(entryStream); - if (document.Root == null) - { - logger.Log(LogLevel.Error, "File has not the correct format."); - yield break; - } + throw new FormatException(); + } - //var version = document.Root.Attribute(XmlVersionAttribute)?.Value; - var platform = document.Root.Attribute(XmlPlatformAttribute)?.Value; - if (platform != Constants.Platform) - { - logger.Log(LogLevel.Warning, $"The platform of the file ({platform}) doesn't match the program platform ({Constants.Platform})."); - } + using var entryStream = dataEntry.Open(); + var document = XDocument.Load(entryStream); + if (document.Root == null) + { + logger.Log(LogLevel.Error, "File has not the correct format."); + yield break; + } - foreach (var element in document.Root.Elements(XmlRecordElement)) - { - var valueTypeStr = element.Attribute(XmlValueTypeAttribute)?.Value ?? string.Empty; + //var version = document.Root.Attribute(XmlVersionAttribute)?.Value; + var platform = document.Root.Attribute(XmlPlatformAttribute)?.Value; + if (platform != Constants.Platform) + { + logger.Log(LogLevel.Warning, $"The platform of the file ({platform}) doesn't match the program platform ({Constants.Platform})."); + } - if (!Enum.TryParse(valueTypeStr, out var valueType)) - { - logger?.Log(LogLevel.Warning, $"Unknown value type: {valueTypeStr}"); - continue; - } + foreach (var element in document.Root.Elements(XmlRecordElement)) + { + var valueTypeStr = element.Attribute(XmlValueTypeAttribute)?.Value ?? string.Empty; - var description = element.Attribute(XmlDescriptionAttribute)?.Value ?? string.Empty; + if (!Enum.TryParse(valueTypeStr, out var valueType)) + { + logger?.Log(LogLevel.Warning, $"Unknown value type: {valueTypeStr}"); + continue; + } - var addressStr = element.Attribute(XmlAddressAttribute)?.Value ?? string.Empty; - var moduleName = element.Attribute(XmlModuleAttribute)?.Value ?? string.Empty; + var description = element.Attribute(XmlDescriptionAttribute)?.Value ?? string.Empty; - long.TryParse(addressStr, NumberStyles.HexNumber, null, out var address); + var addressStr = element.Attribute(XmlAddressAttribute)?.Value ?? string.Empty; + var moduleName = element.Attribute(XmlModuleAttribute)?.Value ?? string.Empty; - var record = new MemoryRecord - { - Description = description, - AddressOrOffset = (IntPtr)address, - ValueType = valueType - }; + long.TryParse(addressStr, NumberStyles.HexNumber, null, out var address); - if (!string.IsNullOrEmpty(moduleName)) - { - record.ModuleName = moduleName; - } + var record = new MemoryRecord + { + Description = description, + AddressOrOffset = (IntPtr)address, + ValueType = valueType + }; - if (valueType == ScanValueType.ArrayOfBytes || valueType == ScanValueType.String) - { - var lengthStr = element.Attribute(XmlValueLengthAttribute)?.Value ?? string.Empty; - int.TryParse(lengthStr, NumberStyles.Integer, null, out var valueLength); - - record.ValueLength = Math.Max(1, valueLength); - - if (valueType == ScanValueType.String) - { - switch (element.Attribute(XmlEncodingAttribute)?.Value ?? string.Empty) - { - default: - record.Encoding = Encoding.UTF8; - break; - case "UTF16": - record.Encoding = Encoding.Unicode; - break; - case "UTF32": - record.Encoding = Encoding.UTF32; - break; - } - } - } + if (!string.IsNullOrEmpty(moduleName)) + { + record.ModuleName = moduleName; + } - yield return record; + if (valueType == ScanValueType.ArrayOfBytes || valueType == ScanValueType.String) + { + var lengthStr = element.Attribute(XmlValueLengthAttribute)?.Value ?? string.Empty; + int.TryParse(lengthStr, NumberStyles.Integer, null, out var valueLength); + + record.ValueLength = Math.Max(1, valueLength); + + if (valueType == ScanValueType.String) + { + switch (element.Attribute(XmlEncodingAttribute)?.Value ?? string.Empty) + { + default: + record.Encoding = Encoding.UTF8; + break; + case "UTF16": + record.Encoding = Encoding.Unicode; + break; + case "UTF32": + record.Encoding = Encoding.UTF32; + break; } } } + + yield return record; } } public void Save(IEnumerable records, string filePath, ILogger logger) { - using (var fs = new FileStream(filePath, FileMode.Create)) - { - using (var archive = new ZipArchive(fs, ZipArchiveMode.Create)) - { - var dataEntry = archive.CreateEntry(DataFileName); - using (var entryStream = dataEntry.Open()) + using var fs = new FileStream(filePath, FileMode.Create); + using var archive = new ZipArchive(fs, ZipArchiveMode.Create); + + var dataEntry = archive.CreateEntry(DataFileName); + using var entryStream = dataEntry.Open(); + + var document = new XDocument( + new XComment($"{Constants.ApplicationName} Scanner {Constants.ApplicationVersion} by {Constants.Author}"), + new XComment($"Website: {Constants.HomepageUrl}"), + new XElement( + XmlRootElement, + new XAttribute(XmlVersionAttribute, Version1), + new XAttribute(XmlPlatformAttribute, Constants.Platform), + records.Select(r => { - var document = new XDocument( - new XComment($"{Constants.ApplicationName} Scanner {Constants.ApplicationVersion} by {Constants.Author}"), - new XComment($"Website: {Constants.HomepageUrl}"), - new XElement( - XmlRootElement, - new XAttribute(XmlVersionAttribute, Version1), - new XAttribute(XmlPlatformAttribute, Constants.Platform), - records.Select(r => - { - var temp = new XElement( - XmlRecordElement, - new XAttribute(XmlValueTypeAttribute, r.ValueType.ToString()), - new XAttribute(XmlDescriptionAttribute, r.Description ?? string.Empty), - new XAttribute(XmlAddressAttribute, r.AddressOrOffset.ToString(Constants.AddressHexFormat)) - ); - if (r.IsRelativeAddress) - { - temp.SetAttributeValue(XmlModuleAttribute, r.ModuleName); - } - if (r.ValueType == ScanValueType.ArrayOfBytes || r.ValueType == ScanValueType.String) - { - temp.SetAttributeValue(XmlValueLengthAttribute, r.ValueLength); - if (r.ValueType == ScanValueType.String) - { - temp.SetAttributeValue(XmlEncodingAttribute, r.Encoding.IsSameCodePage(Encoding.UTF8) ? "UTF8" : r.Encoding.IsSameCodePage(Encoding.Unicode) ? "UTF16" : "UTF32"); - } - } - return temp; - }) - ) + var temp = new XElement( + XmlRecordElement, + new XAttribute(XmlValueTypeAttribute, r.ValueType.ToString()), + new XAttribute(XmlDescriptionAttribute, r.Description ?? string.Empty), + new XAttribute(XmlAddressAttribute, r.AddressOrOffset.ToString(Constants.AddressHexFormat)) ); + if (r.IsRelativeAddress) + { + temp.SetAttributeValue(XmlModuleAttribute, r.ModuleName); + } + if (r.ValueType == ScanValueType.ArrayOfBytes || r.ValueType == ScanValueType.String) + { + temp.SetAttributeValue(XmlValueLengthAttribute, r.ValueLength); + if (r.ValueType == ScanValueType.String) + { + temp.SetAttributeValue(XmlEncodingAttribute, r.Encoding.IsSameCodePage(Encoding.UTF8) ? "UTF8" : r.Encoding.IsSameCodePage(Encoding.Unicode) ? "UTF16" : "UTF32"); + } + } + return temp; + }) + ) + ); - document.Save(entryStream); - } - } - } + document.Save(entryStream); } } } diff --git a/ReClass.NET/Debugger/RemoteDebugger.Handler.cs b/ReClass.NET/Debugger/RemoteDebugger.Handler.cs index 45009e14..60e07402 100644 --- a/ReClass.NET/Debugger/RemoteDebugger.Handler.cs +++ b/ReClass.NET/Debugger/RemoteDebugger.Handler.cs @@ -10,8 +10,7 @@ private void HandleExceptionEvent(ref DebugEvent evt) foreach (var bp in breakpoints) { - var hwbp = bp as HardwareBreakpoint; - if (hwbp?.Register == causedBy) + if (bp is HardwareBreakpoint hwbp && hwbp.Register == causedBy) { hwbp.Handler(ref evt); diff --git a/ReClass.NET/Debugger/RemoteDebugger.cs b/ReClass.NET/Debugger/RemoteDebugger.cs index bb468553..920877da 100644 --- a/ReClass.NET/Debugger/RemoteDebugger.cs +++ b/ReClass.NET/Debugger/RemoteDebugger.cs @@ -5,7 +5,6 @@ using ReClassNET.Extensions; using ReClassNET.Forms; using ReClassNET.Memory; -using ReClassNET.Util; namespace ReClassNET.Debugger { diff --git a/ReClass.NET/Extensions/EncodingExtensions.cs b/ReClass.NET/Extensions/EncodingExtensions.cs index 4f9f3bba..4a3ed695 100644 --- a/ReClass.NET/Extensions/EncodingExtensions.cs +++ b/ReClass.NET/Extensions/EncodingExtensions.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Text; namespace ReClassNET.Extensions @@ -10,9 +10,18 @@ public static class EncodingExtension /// The byte count per character. public static int GuessByteCountPerChar(this Encoding encoding) { - if (encoding.IsSameCodePage(Encoding.UTF8) || encoding.CodePage == 1252 /* Windows-1252 */ || encoding.IsSameCodePage(Encoding.ASCII)) return 1; - if (encoding.IsSameCodePage(Encoding.Unicode) || encoding.IsSameCodePage(Encoding.BigEndianUnicode)) return 2; - if (encoding.IsSameCodePage(Encoding.UTF32)) return 4; + if (encoding.IsSameCodePage(Encoding.UTF8) || encoding.CodePage == 1252 /* Windows-1252 */ || encoding.IsSameCodePage(Encoding.ASCII)) + { + return 1; + } + if (encoding.IsSameCodePage(Encoding.Unicode) || encoding.IsSameCodePage(Encoding.BigEndianUnicode)) + { + return 2; + } + if (encoding.IsSameCodePage(Encoding.UTF32)) + { + return 4; + } throw new NotImplementedException(); } diff --git a/ReClass.NET/Extensions/EnumerableExtension.cs b/ReClass.NET/Extensions/EnumerableExtension.cs index f027df42..0619c87f 100644 --- a/ReClass.NET/Extensions/EnumerableExtension.cs +++ b/ReClass.NET/Extensions/EnumerableExtension.cs @@ -177,31 +177,29 @@ public static IEnumerable> GroupWhile(this IEnumerable sour Contract.Requires(source != null); Contract.Requires(condition != null); - using (var it = source.GetEnumerator()) + using var it = source.GetEnumerator(); + if (it.MoveNext()) { - if (it.MoveNext()) + var previous = it.Current; + var list = new List { previous }; + + while (it.MoveNext()) { - var previous = it.Current; - var list = new List { previous }; + var item = it.Current; - while (it.MoveNext()) + if (condition(previous, item) == false) { - var item = it.Current; - - if (condition(previous, item) == false) - { - yield return list; - - list = new List(); - } + yield return list; - list.Add(item); - - previous = item; + list = new List(); } - yield return list; + list.Add(item); + + previous = item; } + + yield return list; } } } diff --git a/ReClass.NET/Extensions/XAttributeExtensions.cs b/ReClass.NET/Extensions/XAttributeExtensions.cs index 9a5f8c5d..d559e50d 100644 --- a/ReClass.NET/Extensions/XAttributeExtensions.cs +++ b/ReClass.NET/Extensions/XAttributeExtensions.cs @@ -7,7 +7,7 @@ public static class XAttributeExtensions { public static TEnum GetEnumValue(this XAttribute attribute) where TEnum : struct { - TEnum @enum = default(TEnum); + TEnum @enum = default; if (attribute != null) { Enum.TryParse(attribute.Value, out @enum); diff --git a/ReClass.NET/Logger/BaseLogger.cs b/ReClass.NET/Logger/BaseLogger.cs index 5c5f9bc4..7b1f58b4 100644 --- a/ReClass.NET/Logger/BaseLogger.cs +++ b/ReClass.NET/Logger/BaseLogger.cs @@ -4,7 +4,7 @@ namespace ReClassNET.Logger { - class BaseLogger : ILogger + public abstract class BaseLogger : ILogger { private readonly object sync = new object(); diff --git a/ReClass.NET/Logger/GuiLogger.cs b/ReClass.NET/Logger/GuiLogger.cs index 924dc6a8..7371afc2 100644 --- a/ReClass.NET/Logger/GuiLogger.cs +++ b/ReClass.NET/Logger/GuiLogger.cs @@ -6,7 +6,7 @@ namespace ReClassNET.Logger { /// A logger which displays messages in a form. - class GuiLogger : BaseLogger + public class GuiLogger : BaseLogger { private readonly LogForm form; diff --git a/ReClass.NET/Memory/ProcessInfo.cs b/ReClass.NET/Memory/ProcessInfo.cs index fe60ae2f..b2f8c67e 100644 --- a/ReClass.NET/Memory/ProcessInfo.cs +++ b/ReClass.NET/Memory/ProcessInfo.cs @@ -24,10 +24,8 @@ public ProcessInfo(IntPtr id, string name, string path) Path = path; icon = new Lazy(() => { - using (var i = NativeMethods.GetIconForFile(Path)) - { - return i?.ToBitmap(); - } + using var i = NativeMethods.GetIconForFile(Path); + return i?.ToBitmap(); }); } } diff --git a/ReClass.NET/Memory/SimplePeHeader.cs b/ReClass.NET/Memory/SimplePeHeader.cs index e3ffa4b2..89f0e804 100644 --- a/ReClass.NET/Memory/SimplePeHeader.cs +++ b/ReClass.NET/Memory/SimplePeHeader.cs @@ -1,9 +1,5 @@ using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace ReClassNET.Memory { @@ -36,18 +32,14 @@ public static void FixSectionHeaders(byte[] data) { var pe = new SimplePeHeader(data); - using (var ms = new MemoryStream(data)) + using var ms = new MemoryStream(data); + using var bw = new BinaryWriter(ms); + for (var i = 0; i < pe.NumberOfSections; ++i) { - using (var bw = new BinaryWriter(ms)) - { - for (var i = 0; i < pe.NumberOfSections; ++i) - { - var offset = pe.SectionOffset(i); - bw.Seek(offset + 16, SeekOrigin.Begin); - bw.Write(BitConverter.ToUInt32(data, offset + 8)); // SizeOfRawData = VirtualSize - bw.Write(BitConverter.ToUInt32(data, offset + 12)); // PointerToRawData = VirtualAddress - } - } + var offset = pe.SectionOffset(i); + bw.Seek(offset + 16, SeekOrigin.Begin); + bw.Write(BitConverter.ToUInt32(data, offset + 8)); // SizeOfRawData = VirtualSize + bw.Write(BitConverter.ToUInt32(data, offset + 12)); // PointerToRawData = VirtualAddress } } } diff --git a/ReClass.NET/MemoryScanner/BytePattern.cs b/ReClass.NET/MemoryScanner/BytePattern.cs index 64ff463c..3bbca9ed 100644 --- a/ReClass.NET/MemoryScanner/BytePattern.cs +++ b/ReClass.NET/MemoryScanner/BytePattern.cs @@ -213,35 +213,33 @@ public static BytePattern Parse(string value) var pattern = new BytePattern(); - using (var sr = new StringReader(value)) + using var sr = new StringReader(value); + while (true) { - while (true) + var pb = new PatternByte(); + if (pb.TryRead(sr)) { - var pb = new PatternByte(); - if (pb.TryRead(sr)) + if (!pb.HasWildcard) { - if (!pb.HasWildcard) - { - pattern.pattern.Add(new SimplePatternByte(pb.ToByte())); - } - else - { - pattern.pattern.Add(pb); - } + pattern.pattern.Add(new SimplePatternByte(pb.ToByte())); } else { - break; + pattern.pattern.Add(pb); } } - - // Check if we are not at the end of the stream - if (sr.Peek() != -1) + else { - throw new ArgumentException($"'{value}' is not a valid byte pattern."); + break; } } + // Check if we are not at the end of the stream + if (sr.Peek() != -1) + { + throw new ArgumentException($"'{value}' is not a valid byte pattern."); + } + return pattern; } diff --git a/ReClass.NET/MemoryScanner/InputCorrelatedScanner.cs b/ReClass.NET/MemoryScanner/InputCorrelatedScanner.cs index 5e711e94..3a953d11 100644 --- a/ReClass.NET/MemoryScanner/InputCorrelatedScanner.cs +++ b/ReClass.NET/MemoryScanner/InputCorrelatedScanner.cs @@ -56,23 +56,16 @@ private IScanComparer CreateScanComparer(ScanCompareType compareType) { Contract.Ensures(Contract.Result() != null); - switch (Settings.ValueType) + return Settings.ValueType switch { - case ScanValueType.Byte: - return new ByteMemoryComparer(compareType, 0, 0); - case ScanValueType.Short: - return new ShortMemoryComparer(compareType, 0, 0); - case ScanValueType.Integer: - return new IntegerMemoryComparer(compareType, 0, 0); - case ScanValueType.Long: - return new LongMemoryComparer(compareType, 0, 0); - case ScanValueType.Float: - return new FloatMemoryComparer(compareType, ScanRoundMode.Normal, 2, 0, 0); - case ScanValueType.Double: - return new DoubleMemoryComparer(compareType, ScanRoundMode.Normal, 2, 0, 0); - default: - throw new InvalidOperationException(); - } + ScanValueType.Byte => new ByteMemoryComparer(compareType, 0, 0), + ScanValueType.Short => new ShortMemoryComparer(compareType, 0, 0), + ScanValueType.Integer => new IntegerMemoryComparer(compareType, 0, 0), + ScanValueType.Long => new LongMemoryComparer(compareType, 0, 0), + ScanValueType.Float => new FloatMemoryComparer(compareType, ScanRoundMode.Normal, 2, 0, 0), + ScanValueType.Double => new DoubleMemoryComparer(compareType, ScanRoundMode.Normal, 2, 0, 0), + _ => throw new InvalidOperationException(), + }; } /// diff --git a/ReClass.NET/MemoryScanner/ScanResultBlock.cs b/ReClass.NET/MemoryScanner/ScanResultBlock.cs index 14aad1ac..ab657c15 100644 --- a/ReClass.NET/MemoryScanner/ScanResultBlock.cs +++ b/ReClass.NET/MemoryScanner/ScanResultBlock.cs @@ -2,7 +2,6 @@ using System.Collections.Generic; using System.Diagnostics.Contracts; using ReClassNET.Extensions; -using ReClassNET.Util; namespace ReClassNET.MemoryScanner { diff --git a/ReClass.NET/MemoryScanner/ScanResultStore.cs b/ReClass.NET/MemoryScanner/ScanResultStore.cs index 5ddb1a45..1d03daf2 100644 --- a/ReClass.NET/MemoryScanner/ScanResultStore.cs +++ b/ReClass.NET/MemoryScanner/ScanResultStore.cs @@ -4,7 +4,6 @@ using System.IO; using System.Text; using ReClassNET.Extensions; -using ReClassNET.Util; namespace ReClassNET.MemoryScanner { @@ -130,16 +129,14 @@ private void AppendBlockToFile(ScanResultBlock block) { Contract.Requires(block != null); - using (var bw = new BinaryWriter(fileStream, Encoding.Unicode, true)) - { - bw.Write(block.Start); - bw.Write(block.End); - bw.Write(block.Results.Count); + using var bw = new BinaryWriter(fileStream, Encoding.Unicode, true); + bw.Write(block.Start); + bw.Write(block.End); + bw.Write(block.Results.Count); - foreach (var result in block.Results) - { - WriteSearchResult(bw, result); - } + foreach (var result in block.Results) + { + WriteSearchResult(bw, result); } } @@ -150,28 +147,25 @@ private IEnumerable ReadBlocksFromFile() { Contract.Ensures(Contract.Result>() != null); - using (var stream = File.OpenRead(storePath)) - { - using (var br = new BinaryReader(stream, Encoding.Unicode)) - { - var length = stream.Length; + using var stream = File.OpenRead(storePath); + using var br = new BinaryReader(stream, Encoding.Unicode); - while (stream.Position < length) - { - var start = br.ReadIntPtr(); - var end = br.ReadIntPtr(); + var length = stream.Length; - var resultCount = br.ReadInt32(); + while (stream.Position < length) + { + var start = br.ReadIntPtr(); + var end = br.ReadIntPtr(); - var results = new List(resultCount); - for (var i = 0; i < resultCount; ++i) - { - results.Add(ReadScanResult(br)); - } + var resultCount = br.ReadInt32(); - yield return new ScanResultBlock(start, end, results); - } + var results = new List(resultCount); + for (var i = 0; i < resultCount; ++i) + { + results.Add(ReadScanResult(br)); } + + yield return new ScanResultBlock(start, end, results); } } diff --git a/ReClass.NET/MemoryScanner/Scanner.cs b/ReClass.NET/MemoryScanner/Scanner.cs index ee0820fc..3220e46d 100644 --- a/ReClass.NET/MemoryScanner/Scanner.cs +++ b/ReClass.NET/MemoryScanner/Scanner.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Diagnostics.Contracts; using System.IO; @@ -125,45 +125,42 @@ private IList
GetSearchableSections() .Where(s => s.Start.IsInRange(Settings.StartAddress, Settings.StopAddress) || Settings.StartAddress.IsInRange(s.Start, s.End) || Settings.StopAddress.IsInRange(s.Start, s.End)) - .Where(s => + .Where(s => s.Type switch { - switch (s.Type) - { - case SectionType.Private: return Settings.ScanPrivateMemory; - case SectionType.Image: return Settings.ScanImageMemory; - case SectionType.Mapped: return Settings.ScanMappedMemory; - default: return false; - } + SectionType.Private => Settings.ScanPrivateMemory, + SectionType.Image => Settings.ScanImageMemory, + SectionType.Mapped => Settings.ScanMappedMemory, + _ => false }) .Where(s => { var isWritable = s.Protection.HasFlag(SectionProtection.Write); - switch (Settings.ScanWritableMemory) + return Settings.ScanWritableMemory switch { - case SettingState.Yes: return isWritable; - case SettingState.No: return !isWritable; - default: return true; - } + SettingState.Yes => isWritable, + SettingState.No => !isWritable, + _ => true + }; }) .Where(s => { var isExecutable = s.Protection.HasFlag(SectionProtection.Execute); - switch (Settings.ScanExecutableMemory) + return Settings.ScanExecutableMemory switch { - case SettingState.Yes: return isExecutable; - case SettingState.No: return !isExecutable; - default: return true; - } + SettingState.Yes => isExecutable, + SettingState.No => !isExecutable, + _ => true + }; }) .Where(s => { var isCopyOnWrite = s.Protection.HasFlag(SectionProtection.CopyOnWrite); - switch (Settings.ScanCopyOnWriteMemory) + return Settings.ScanCopyOnWriteMemory switch { - case SettingState.Yes: return isCopyOnWrite; - case SettingState.No: return !isCopyOnWrite; - default: return true; - } + SettingState.Yes => isCopyOnWrite, + SettingState.No => !isCopyOnWrite, + _ => true + }; }) .ToList(); } @@ -230,12 +227,12 @@ private Task FirstScan(IScanComparer comparer, IProgress progress, Ca if (Settings.StartAddress.IsInRange(start, end)) { - size = size - Settings.StartAddress.Sub(start).ToInt32(); + size -= Settings.StartAddress.Sub(start).ToInt32(); start = Settings.StartAddress; } if (Settings.StopAddress.IsInRange(start, end)) { - size = size - end.Sub(Settings.StopAddress).ToInt32(); + size -= end.Sub(Settings.StopAddress).ToInt32(); } context.EnsureBufferSize(size); diff --git a/ReClass.NET/Symbols/SymbolReader.cs b/ReClass.NET/Symbols/SymbolReader.cs index c3df31b6..230880b2 100644 --- a/ReClass.NET/Symbols/SymbolReader.cs +++ b/ReClass.NET/Symbols/SymbolReader.cs @@ -5,7 +5,6 @@ using ReClassNET.Extensions; using ReClassNET.Memory; using ReClassNET.Native; -using ReClassNET.Util; namespace ReClassNET.Symbols { @@ -49,10 +48,8 @@ public static void TryResolveSymbolsForModule(Module module, string searchPath) { Contract.Requires(module != null); - using (var diaSource = new ComDisposableWrapper(new DiaSource())) - { - diaSource.Interface.loadDataForExe(module.Path, searchPath, null); - } + using var diaSource = new ComDisposableWrapper(new DiaSource()); + diaSource.Interface.loadDataForExe(module.Path, searchPath, null); } public static SymbolReader FromModule(Module module, string searchPath) @@ -93,12 +90,11 @@ public string GetSymbolString(IntPtr address, Module module) diaSession.Interface.findSymbolByRVA((uint)rva.ToInt32(), SymTagEnum.SymTagNull, out var diaSymbol); if (diaSymbol != null) { - using (var symbol = new ComDisposableWrapper(diaSymbol)) - { - var sb = new StringBuilder(); - ReadSymbol(symbol.Interface, sb); - return sb.ToString(); - } + using var symbol = new ComDisposableWrapper(diaSymbol); + + var sb = new StringBuilder(); + ReadSymbol(symbol.Interface, sb); + return sb.ToString(); } return null; } @@ -134,10 +130,9 @@ private void ReadSymbolType(IDiaSymbol symbol, StringBuilder sb) if (symbol.type != null) { - using (var type = new ComDisposableWrapper(symbol.type)) - { - ReadType(type.Interface, sb); - } + using var type = new ComDisposableWrapper(symbol.type); + + ReadType(type.Interface, sb); } } diff --git a/ReClass.NET/Symbols/SymbolStore.cs b/ReClass.NET/Symbols/SymbolStore.cs index 5f9d3f16..4992c558 100644 --- a/ReClass.NET/Symbols/SymbolStore.cs +++ b/ReClass.NET/Symbols/SymbolStore.cs @@ -89,25 +89,23 @@ public SymbolStore() private void ResolveSearchPath() { - using (var vsKey = Registry.CurrentUser.OpenSubKey(@"Software\Microsoft\VisualStudio")) + using var vsKey = Registry.CurrentUser.OpenSubKey(@"Software\Microsoft\VisualStudio"); + if (vsKey == null) { - if (vsKey != null) + return; + } + + foreach (var subKeyName in vsKey.GetSubKeyNames()) + { + using var debuggerKey = vsKey.OpenSubKey($@"{subKeyName}\Debugger"); + if (debuggerKey?.GetValue("SymbolCacheDir") is string symbolCacheDir) { - foreach (var subKeyName in vsKey.GetSubKeyNames()) + if (Directory.Exists(symbolCacheDir)) { - using (var debuggerKey = vsKey.OpenSubKey($@"{subKeyName}\Debugger")) - { - if (debuggerKey?.GetValue("SymbolCacheDir") is string symbolCacheDir) - { - if (Directory.Exists(symbolCacheDir)) - { - SymbolCachePath = symbolCacheDir; - } - - return; - } - } + SymbolCachePath = symbolCacheDir; } + + break; } } } From cf52ca3a9a37f3dae54190a5fc903016e7f9bb49 Mon Sep 17 00:00:00 2001 From: KN4CK3R Date: Sun, 5 Jul 2020 11:55:22 +0200 Subject: [PATCH 130/223] Do not use Beep because of errors on unix systems. --- ReClass.NET/Program.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/ReClass.NET/Program.cs b/ReClass.NET/Program.cs index edeebd88..0247418a 100644 --- a/ReClass.NET/Program.cs +++ b/ReClass.NET/Program.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Diagnostics; using System.Drawing; using System.Globalization; @@ -67,9 +67,9 @@ static void Main(string[] args) Settings = SettingsSerializer.Load(); Logger = new GuiLogger(); - if(!NativeMethods.IsUnix() && Settings.RunAsAdmin && !WinUtil.IsAdministrator) + if (!NativeMethods.IsUnix() && Settings.RunAsAdmin && !WinUtil.IsAdministrator) { - WinUtil.RunElevated(Process.GetCurrentProcess().MainModule.FileName, args.Length > 0 ? string.Join(" ", args) : null); + WinUtil.RunElevated(Process.GetCurrentProcess().MainModule.FileName, args.Length > 0 ? string.Join(" ", args) : null); return; } @@ -106,6 +106,7 @@ public static void ShowException(Exception ex) var msg = new ExceptionMessageBox(ex) { + Beep = false, ShowToolBar = true, Symbol = ExceptionMessageBoxSymbol.Error }; From 43b27807dde006d4986e1917a5142c2fad3b8928 Mon Sep 17 00:00:00 2001 From: KN4CK3R Date: Sun, 5 Jul 2020 11:55:58 +0200 Subject: [PATCH 131/223] Fixed comment. --- ReClass.NET/DataExchange/ReClass/ReClassNetFile.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ReClass.NET/DataExchange/ReClass/ReClassNetFile.cs b/ReClass.NET/DataExchange/ReClass/ReClassNetFile.cs index d648ec4e..eb25e52b 100644 --- a/ReClass.NET/DataExchange/ReClass/ReClassNetFile.cs +++ b/ReClass.NET/DataExchange/ReClass/ReClassNetFile.cs @@ -21,7 +21,7 @@ public ReClassNetFile(ReClassNetProject project) static ReClassNetFile() { - // Obsolete: The name of the class was changed. Because of this older files can't load this nodes. + // Obsolete: The name of the class was changed. Because of this older versions can't load these nodes. buildInStringToTypeMap["UTF8TextNode"] = typeof(Utf8TextNode); buildInStringToTypeMap["UTF8TextPtrNode"] = typeof(Utf8TextPtrNode); buildInStringToTypeMap["UTF16TextNode"] = typeof(Utf16TextNode); From 58ec90fdbed9b6e3d19d3ab02f0f32704e4cacbe Mon Sep 17 00:00:00 2001 From: KN4CK3R Date: Sun, 5 Jul 2020 11:56:19 +0200 Subject: [PATCH 132/223] Use tuple deconstruction. --- ReClass.NET/DataExchange/ReClass/ReClassFile.cs | 8 ++++---- ReClass.NET/DataExchange/ReClass/ReClassQtFile.cs | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/ReClass.NET/DataExchange/ReClass/ReClassFile.cs b/ReClass.NET/DataExchange/ReClass/ReClassFile.cs index f036b32b..9bb01985 100644 --- a/ReClass.NET/DataExchange/ReClass/ReClassFile.cs +++ b/ReClass.NET/DataExchange/ReClass/ReClassFile.cs @@ -74,15 +74,15 @@ public void Load(string filePath, ILogger logger) } var classMap = classes.ToDictionary(t => t.Item2.Name, t => t.Item2); - foreach (var t in classes) + foreach (var (classElement, classNode) in classes) { ReadNodeElements( - t.Item1.Elements("Node"), - t.Item2, + classElement.Elements("Node"), + classNode, classMap, typeMap, logger - ).ForEach(t.Item2.AddNode); + ).ForEach(classNode.AddNode); } } diff --git a/ReClass.NET/DataExchange/ReClass/ReClassQtFile.cs b/ReClass.NET/DataExchange/ReClass/ReClassQtFile.cs index 43dfdcc2..275624c0 100644 --- a/ReClass.NET/DataExchange/ReClass/ReClassQtFile.cs +++ b/ReClass.NET/DataExchange/ReClass/ReClassQtFile.cs @@ -77,14 +77,14 @@ public void Load(string filePath, ILogger logger) } var classMap = classes.ToDictionary(c => c.Item1.Attribute("ClassId")?.Value, c => c.Item2); - foreach (var t in classes) + foreach (var (classElement, classNode) in classes) { ReadNodeElements( - t.Item1.Elements("Node"), - t.Item2, + classElement.Elements("Node"), + classNode, classMap, logger - ).ForEach(t.Item2.AddNode); + ).ForEach(classNode.AddNode); } } From 700e22d072161b89d2c5c36c5c7dffc05a2bb328 Mon Sep 17 00:00:00 2001 From: KN4CK3R Date: Sun, 5 Jul 2020 12:44:05 +0200 Subject: [PATCH 133/223] General code cleanup. --- ReClass.NET/AddressParser/DynamicCompiler.cs | 4 +- ReClass.NET/AddressParser/ITokenizer.cs | 2 +- ReClass.NET/AddressParser/Parser.cs | 9 +- .../DataExchange/Scanner/CrySearchFile.cs | 4 +- ReClass.NET/Debugger/RemoteDebugger.cs | 12 +- .../Extensions/RichTextBoxExtensions.cs | 4 +- ReClass.NET/Forms/ClassSelectionForm.cs | 3 +- ReClass.NET/Forms/EnumListForm.cs | 20 +- ReClass.NET/Forms/EnumSelectionForm.cs | 20 +- ReClass.NET/Forms/FoundCodeForm.cs | 3 +- ReClass.NET/Forms/MainForm.Functions.cs | 43 ++-- ReClass.NET/Forms/MainForm.cs | 178 ++++++++-------- ReClass.NET/Forms/ProcessInfoForm.cs | 38 ++-- ReClass.NET/Forms/ScannerForm.cs | 118 +++++----- ReClass.NET/Forms/SettingsForm.cs | 3 +- .../Comparer/ByteMemoryComparer.cs | 3 +- .../Comparer/DoubleMemoryComparer.cs | 3 +- .../Comparer/IntegerMemoryComparer.cs | 3 +- .../Comparer/LongMemoryComparer.cs | 3 +- .../Comparer/ShortMemoryComparer.cs | 3 +- .../Comparer/StringMemoryComparer.cs | 3 +- ReClass.NET/MemoryScanner/ScanResult.cs | 4 +- ReClass.NET/Native/NativeMethods.Windows.cs | 14 +- ReClass.NET/Nodes/BaseFunctionNode.cs | 10 +- ReClass.NET/Nodes/BaseFunctionPtrNode.cs | 13 +- ReClass.NET/Nodes/BaseNode.cs | 12 +- ReClass.NET/Nodes/ClassInstanceNode.cs | 3 +- ReClass.NET/Nodes/FunctionNode.cs | 12 +- ReClass.NET/Nodes/Hex8Node.cs | 3 +- ReClass.NET/Nodes/Matrix3x3Node.cs | 4 +- ReClass.NET/Nodes/Matrix3x4Node.cs | 4 +- ReClass.NET/Nodes/Matrix4x4Node.cs | 4 +- ReClass.NET/Nodes/Vector2Node.cs | 4 +- ReClass.NET/Nodes/Vector3Node.cs | 4 +- ReClass.NET/Nodes/Vector4Node.cs | 4 +- ReClass.NET/Plugins/PluginInfo.cs | 2 +- ReClass.NET/Program.cs | 4 +- ReClass.NET/Symbols/ComDisposableWrapper.cs | 12 +- ReClass.NET/Symbols/SymbolStore.cs | 17 +- ReClass.NET/UI/BannerBox.cs | 4 +- ReClass.NET/UI/BannerFactory.cs | 13 +- ReClass.NET/UI/ColorBox.cs | 15 +- ReClass.NET/UI/DpiUtil.cs | 58 +++-- ReClass.NET/UI/EnumComboBox.cs | 5 +- ReClass.NET/UI/IconButton.cs | 30 ++- ReClass.NET/UI/LinkedWindowFeatures.cs | 5 +- ReClass.NET/UI/MemoryRecordList.cs | 3 +- ReClass.NET/UI/NodeTypesBuilder.cs | 3 +- ReClass.NET/UI/PlaceholderTextBox.cs | 9 +- ReClass.NET/UI/ProjectView.cs | 3 +- ReClass.NET/Util/CircularBuffer.cs | 4 +- ReClass.NET/Util/HexadecimalFormatter.cs | 4 +- ReClass.NET/Util/PathUtil.cs | 6 +- ReClass.NET/Util/Rtf/RtfBuilder.cs | 3 +- ReClass.NET/Util/SettingsSerializer.cs | 201 +++++++++--------- ReClass.NET/Util/Util.cs | 8 +- ReClass.NET/Util/WinUtil.cs | 16 +- 57 files changed, 468 insertions(+), 531 deletions(-) diff --git a/ReClass.NET/AddressParser/DynamicCompiler.cs b/ReClass.NET/AddressParser/DynamicCompiler.cs index 47eccb5e..44896bbd 100644 --- a/ReClass.NET/AddressParser/DynamicCompiler.cs +++ b/ReClass.NET/AddressParser/DynamicCompiler.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Diagnostics.Contracts; using System.Linq.Expressions; using System.Reflection; @@ -92,7 +92,7 @@ private static Expression GenerateMethodBody(IExpression expression, Expression Expression.Condition( Expression.Equal(moduleVariable, Expression.Constant(null)), Expression.Constant(IntPtr.Zero), - Expression.MakeMemberAccess(moduleVariable, typeof(Memory.Module).GetProperty(nameof(Memory.Module.Start))) + Expression.MakeMemberAccess(moduleVariable, typeof(Memory.Module).GetProperty(nameof(Memory.Module.Start))!) ) ); } diff --git a/ReClass.NET/AddressParser/ITokenizer.cs b/ReClass.NET/AddressParser/ITokenizer.cs index 625e1a0f..171113a1 100644 --- a/ReClass.NET/AddressParser/ITokenizer.cs +++ b/ReClass.NET/AddressParser/ITokenizer.cs @@ -1,4 +1,4 @@ -namespace ReClassNET.AddressParser +namespace ReClassNET.AddressParser { public interface ITokenizer { diff --git a/ReClass.NET/AddressParser/Parser.cs b/ReClass.NET/AddressParser/Parser.cs index d07cdf28..4db14fda 100644 --- a/ReClass.NET/AddressParser/Parser.cs +++ b/ReClass.NET/AddressParser/Parser.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.IO; namespace ReClassNET.AddressParser @@ -185,10 +185,9 @@ private IExpression ParseLeaf() public static IExpression Parse(string str) { - using (var sr = new StringReader(str)) - { - return Parse(new Tokenizer(sr)); - } + using var sr = new StringReader(str); + + return Parse(new Tokenizer(sr)); } private static IExpression Parse(ITokenizer tokenizer) diff --git a/ReClass.NET/DataExchange/Scanner/CrySearchFile.cs b/ReClass.NET/DataExchange/Scanner/CrySearchFile.cs index 42d77147..2aca38c7 100644 --- a/ReClass.NET/DataExchange/Scanner/CrySearchFile.cs +++ b/ReClass.NET/DataExchange/Scanner/CrySearchFile.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Globalization; using System.Text; @@ -72,7 +72,7 @@ public IEnumerable Load(string filePath, ILogger logger) switch (valueTypeStr) { default: - case "8": + // case "8": record.Encoding = Encoding.UTF8; break; case "9": diff --git a/ReClass.NET/Debugger/RemoteDebugger.cs b/ReClass.NET/Debugger/RemoteDebugger.cs index 920877da..3224293a 100644 --- a/ReClass.NET/Debugger/RemoteDebugger.cs +++ b/ReClass.NET/Debugger/RemoteDebugger.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Diagnostics.Contracts; using System.Linq; @@ -168,13 +168,11 @@ private List SplitBreakpoint(IntPtr address, int size) continue; } } - if (size >= 1) - { - splits.Add(new BreakpointSplit { Address = address, Size = 1 }); - address += 1; - size -= 1; - } + splits.Add(new BreakpointSplit { Address = address, Size = 1 }); + + address += 1; + size -= 1; } return splits; diff --git a/ReClass.NET/Extensions/RichTextBoxExtensions.cs b/ReClass.NET/Extensions/RichTextBoxExtensions.cs index 634c4909..4c1b49a3 100644 --- a/ReClass.NET/Extensions/RichTextBoxExtensions.cs +++ b/ReClass.NET/Extensions/RichTextBoxExtensions.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Drawing; using System.Runtime.InteropServices; using System.Windows.Forms; @@ -16,7 +16,7 @@ public static void SetInnerMargin(this TextBoxBase textBox, int left, int top, i } [StructLayout(LayoutKind.Sequential)] - private struct RECT + private readonly struct RECT { public readonly int Left; public readonly int Top; diff --git a/ReClass.NET/Forms/ClassSelectionForm.cs b/ReClass.NET/Forms/ClassSelectionForm.cs index ee55f0e8..e8ed984d 100644 --- a/ReClass.NET/Forms/ClassSelectionForm.cs +++ b/ReClass.NET/Forms/ClassSelectionForm.cs @@ -1,6 +1,5 @@ -using System; +using System; using System.Collections.Generic; -using System.Data; using System.Diagnostics.Contracts; using System.Linq; using System.Windows.Forms; diff --git a/ReClass.NET/Forms/EnumListForm.cs b/ReClass.NET/Forms/EnumListForm.cs index a2e109c6..f8cafe56 100644 --- a/ReClass.NET/Forms/EnumListForm.cs +++ b/ReClass.NET/Forms/EnumListForm.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Diagnostics.Contracts; using System.Linq; @@ -57,10 +57,9 @@ private void editEnumIconButton_Click(object sender, EventArgs e) return; } - using (var eef = new EnumEditorForm(@enum)) - { - eef.ShowDialog(); - } + using var eef = new EnumEditorForm(@enum); + + eef.ShowDialog(); } private void addEnumIconButton_Click(object sender, EventArgs e) @@ -70,14 +69,13 @@ private void addEnumIconButton_Click(object sender, EventArgs e) Name = "Enum" }; - using (var eef = new EnumEditorForm(@enum)) + using var eef = new EnumEditorForm(@enum); + + if (eef.ShowDialog() == DialogResult.OK) { - if (eef.ShowDialog() == DialogResult.OK) - { - project.AddEnum(@enum); + project.AddEnum(@enum); - ShowFilteredEnums(); - } + ShowFilteredEnums(); } } diff --git a/ReClass.NET/Forms/EnumSelectionForm.cs b/ReClass.NET/Forms/EnumSelectionForm.cs index 03d11d69..6ef69d17 100644 --- a/ReClass.NET/Forms/EnumSelectionForm.cs +++ b/ReClass.NET/Forms/EnumSelectionForm.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Diagnostics.Contracts; using System.Linq; @@ -57,10 +57,9 @@ private void editEnumIconButton_Click(object sender, EventArgs e) return; } - using (var eef = new EnumEditorForm(@enum)) - { - eef.ShowDialog(); - } + using var eef = new EnumEditorForm(@enum); + + eef.ShowDialog(); } private void addEnumIconButton_Click(object sender, EventArgs e) @@ -70,14 +69,13 @@ private void addEnumIconButton_Click(object sender, EventArgs e) Name = "Enum" }; - using (var eef = new EnumEditorForm(@enum)) + using var eef = new EnumEditorForm(@enum); + + if (eef.ShowDialog() == DialogResult.OK) { - if (eef.ShowDialog() == DialogResult.OK) - { - project.AddEnum(@enum); + project.AddEnum(@enum); - ShowFilteredEnums(); - } + ShowFilteredEnums(); } } diff --git a/ReClass.NET/Forms/FoundCodeForm.cs b/ReClass.NET/Forms/FoundCodeForm.cs index 68ccd141..3169db2a 100644 --- a/ReClass.NET/Forms/FoundCodeForm.cs +++ b/ReClass.NET/Forms/FoundCodeForm.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Data; using System.Diagnostics.Contracts; using System.Drawing; @@ -10,7 +10,6 @@ using ReClassNET.Memory; using ReClassNET.Nodes; using ReClassNET.UI; -using ReClassNET.Util; namespace ReClassNET.Forms { diff --git a/ReClass.NET/Forms/MainForm.Functions.cs b/ReClass.NET/Forms/MainForm.Functions.cs index 9fad2852..6e0d7439 100644 --- a/ReClass.NET/Forms/MainForm.Functions.cs +++ b/ReClass.NET/Forms/MainForm.Functions.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Diagnostics; using System.Diagnostics.Contracts; @@ -15,7 +15,6 @@ using ReClassNET.Nodes; using ReClassNET.Project; using ReClassNET.UI; -using ReClassNET.Util; namespace ReClassNET.Forms { @@ -129,14 +128,14 @@ private void AskAddOrInsertBytes(string title, Action callback) return; } - using (var ib = new InputBytesForm(classNode.MemorySize)) + using var ib = new InputBytesForm(classNode.MemorySize) { - ib.Text = title; + Text = title + }; - if (ib.ShowDialog() == DialogResult.OK) - { - callback(ib.Bytes); - } + if (ib.ShowDialog() == DialogResult.OK) + { + callback(ib.Bytes); } } @@ -190,18 +189,18 @@ public void ClearSelection() /// The path to the selected file or null if no file was selected. public static string ShowOpenProjectFileDialog() { - using (var ofd = new OpenFileDialog()) + using var ofd = new OpenFileDialog { - ofd.CheckFileExists = true; - ofd.Filter = $"All ReClass Types |*{ReClassNetFile.FileExtension};*{ReClassFile.FileExtension};*{ReClassQtFile.FileExtension}" - + $"|{ReClassNetFile.FormatName} (*{ReClassNetFile.FileExtension})|*{ReClassNetFile.FileExtension}" - + $"|{ReClassFile.FormatName} (*{ReClassFile.FileExtension})|*{ReClassFile.FileExtension}" - + $"|{ReClassQtFile.FormatName} (*{ReClassQtFile.FileExtension})|*{ReClassQtFile.FileExtension}"; + CheckFileExists = true, + Filter = $"All ReClass Types |*{ReClassNetFile.FileExtension};*{ReClassFile.FileExtension};*{ReClassQtFile.FileExtension}" + + $"|{ReClassNetFile.FormatName} (*{ReClassNetFile.FileExtension})|*{ReClassNetFile.FileExtension}" + + $"|{ReClassFile.FormatName} (*{ReClassFile.FileExtension})|*{ReClassFile.FileExtension}" + + $"|{ReClassQtFile.FormatName} (*{ReClassQtFile.FileExtension})|*{ReClassQtFile.FileExtension}" + }; - if (ofd.ShowDialog() == DialogResult.OK) - { - return ofd.FileName; - } + if (ofd.ShowDialog() == DialogResult.OK) + { + return ofd.FileName; } return null; @@ -264,7 +263,7 @@ private void LoadAllSymbolsForCurrentProcess() infoToolStripStatusLabel.Visible = true; - int index = 0; + var index = 0; var progress = new Progress>>( report => @@ -365,8 +364,8 @@ private void CopySelectedNodesToClipboard() private void PasteNodeFromClipboardToSelection() { - var result = ReClassClipboard.Paste(CurrentProject, Program.Logger); - foreach (var pastedClassNode in result.Item1) + var (classNodes, nodes) = ReClassClipboard.Paste(CurrentProject, Program.Logger); + foreach (var pastedClassNode in classNodes) { if (!CurrentProject.ContainsClass(pastedClassNode.Uuid)) { @@ -384,7 +383,7 @@ private void PasteNodeFromClipboardToSelection() { containerNode.BeginUpdate(); - foreach (var node in result.Item2) + foreach (var node in nodes) { if (node is BaseWrapperNode) { diff --git a/ReClass.NET/Forms/MainForm.cs b/ReClass.NET/Forms/MainForm.cs index 19a91628..11aa1362 100644 --- a/ReClass.NET/Forms/MainForm.cs +++ b/ReClass.NET/Forms/MainForm.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.ComponentModel; using System.Diagnostics.Contracts; using System.IO; @@ -164,7 +164,7 @@ private async void MainForm_FormClosing(object sender, FormClosingEventArgs e) } catch { - + // ignored } loadSymbolsTask = null; @@ -178,7 +178,7 @@ private async void MainForm_FormClosing(object sender, FormClosingEventArgs e) } catch { - + // ignored } updateProcessInformationsTask = null; @@ -259,15 +259,14 @@ private void mergeWithProjectToolStripMenuItem_Click(object sender, EventArgs e) private void goToClassToolStripMenuItem_Click(object sender, EventArgs e) { - using (var csf = new ClassSelectionForm(currentProject.Classes.OrderBy(c => c.Name))) + using var csf = new ClassSelectionForm(currentProject.Classes.OrderBy(c => c.Name)); + + if (csf.ShowDialog() == DialogResult.OK) { - if (csf.ShowDialog() == DialogResult.OK) + var selectedClassNode = csf.SelectedClass; + if (selectedClassNode != null) { - var selectedClassNode = csf.SelectedClass; - if (selectedClassNode != null) - { - projectView.SelectedClass = selectedClassNode; - } + projectView.SelectedClass = selectedClassNode; } } } @@ -302,34 +301,32 @@ private void saveAsToolStripMenuItem_Click(object sender, EventArgs e) return; } - using (var sfd = new SaveFileDialog()) + using var sfd = new SaveFileDialog { - sfd.DefaultExt = ReClassNetFile.FileExtension; - sfd.Filter = $"{ReClassNetFile.FormatName} (*{ReClassNetFile.FileExtension})|*{ReClassNetFile.FileExtension}"; + DefaultExt = ReClassNetFile.FileExtension, + Filter = $"{ReClassNetFile.FormatName} (*{ReClassNetFile.FileExtension})|*{ReClassNetFile.FileExtension}" + }; - if (sfd.ShowDialog() == DialogResult.OK) - { - currentProject.Path = sfd.FileName; + if (sfd.ShowDialog() == DialogResult.OK) + { + currentProject.Path = sfd.FileName; - saveToolStripMenuItem_Click(sender, e); - } + saveToolStripMenuItem_Click(sender, e); } } private void settingsToolStripMenuItem_Click(object sender, EventArgs e) { - using (var sd = new SettingsForm(Program.Settings, CurrentProject.TypeMapping)) - { - sd.ShowDialog(); - } + using var sd = new SettingsForm(Program.Settings, CurrentProject.TypeMapping); + + sd.ShowDialog(); } private void pluginsToolStripButton_Click(object sender, EventArgs e) { - using (var pf = new PluginForm(pluginManager)) - { - pf.ShowDialog(); - } + using var pf = new PluginForm(pluginManager); + + pf.ShowDialog(); } private void quitToolStripMenuItem_Click(object sender, EventArgs e) @@ -354,20 +351,21 @@ private void namedAddressesToolStripMenuItem_Click(object sender, EventArgs e) private void loadSymbolToolStripMenuItem_Click(object sender, EventArgs e) { - using (var ofd = new OpenFileDialog()) + using var ofd = new OpenFileDialog { - ofd.Filter = "Program Debug Database (*.pdb)|*.pdb|All Files (*.*)|*.*"; + Filter = "Program Debug Database (*.pdb)|*.pdb|All Files (*.*)|*.*" + }; + - if (ofd.ShowDialog() == DialogResult.OK) + if (ofd.ShowDialog() == DialogResult.OK) + { + try { - try - { - Program.RemoteProcess.Symbols.LoadSymbolsFromPDB(ofd.FileName); - } - catch (Exception ex) - { - Program.Logger.Log(ex); - } + Program.RemoteProcess.Symbols.LoadSymbolsFromPDB(ofd.FileName); + } + catch (Exception ex) + { + Program.Logger.Log(ex); } } } @@ -414,10 +412,9 @@ private void generateCSharpCodeToolStripMenuItem_Click(object sender, EventArgs private void aboutToolStripMenuItem_Click(object sender, EventArgs e) { - using (var af = new AboutForm()) - { - af.ShowDialog(); - } + using var af = new AboutForm(); + + af.ShowDialog(); } #endregion @@ -426,18 +423,17 @@ private void aboutToolStripMenuItem_Click(object sender, EventArgs e) private void attachToProcessToolStripSplitButton_ButtonClick(object sender, EventArgs e) { - using (var pb = new ProcessBrowserForm(Program.Settings.LastProcess)) + using var pb = new ProcessBrowserForm(Program.Settings.LastProcess); + + if (pb.ShowDialog() == DialogResult.OK) { - if (pb.ShowDialog() == DialogResult.OK) + if (pb.SelectedProcess != null) { - if (pb.SelectedProcess != null) - { - AttachToProcess(pb.SelectedProcess); + AttachToProcess(pb.SelectedProcess); - if (pb.LoadSymbols) - { - LoadAllSymbolsForCurrentProcess(); - } + if (pb.LoadSymbols) + { + LoadAllSymbolsForCurrentProcess(); } } } @@ -819,36 +815,34 @@ private void memoryViewControl_ChangeClassTypeClick(object sender, NodeClickEven Name = "None" }; - using (var csf = new ClassSelectionForm(classes.Prepend(noneClass))) + using var csf = new ClassSelectionForm(classes.Prepend(noneClass)); + + if (csf.ShowDialog() == DialogResult.OK) { - if (csf.ShowDialog() == DialogResult.OK) + var selectedClassNode = csf.SelectedClass; + if (selectedClassNode != null) { - var selectedClassNode = csf.SelectedClass; - if (selectedClassNode != null) + if (selectedClassNode == noneClass) { - if (selectedClassNode == noneClass) - { - selectedClassNode = null; - } - - functionNode.BelongsToClass = selectedClassNode; + selectedClassNode = null; } + + functionNode.BelongsToClass = selectedClassNode; } } } else if (e.Node is BaseWrapperNode refNode) { - using (var csf = new ClassSelectionForm(classes)) + using var csf = new ClassSelectionForm(classes); + + if (csf.ShowDialog() == DialogResult.OK) { - if (csf.ShowDialog() == DialogResult.OK) + var selectedClassNode = csf.SelectedClass; + if (refNode.CanChangeInnerNodeTo(selectedClassNode)) { - var selectedClassNode = csf.SelectedClass; - if (refNode.CanChangeInnerNodeTo(selectedClassNode)) + if (!refNode.GetRootWrapperNode().ShouldPerformCycleCheckForInnerNode() || IsCycleFree(e.Node.GetParentClass(), selectedClassNode)) { - if (!refNode.GetRootWrapperNode().ShouldPerformCycleCheckForInnerNode() || IsCycleFree(e.Node.GetParentClass(), selectedClassNode)) - { - refNode.ChangeInnerNode(selectedClassNode); - } + refNode.ChangeInnerNode(selectedClassNode); } } } @@ -878,26 +872,25 @@ private void memoryViewControl_ChangeEnumTypeClick(object sender, NodeClickEvent { if (e.Node is EnumNode enumNode) { - using (var csf = new EnumSelectionForm(CurrentProject)) - { - var size = enumNode.Enum.Size; + using var csf = new EnumSelectionForm(CurrentProject); - if (csf.ShowDialog() == DialogResult.OK) - { - var @enum = csf.SelectedItem; - if (@enum != null) - { - enumNode.ChangeEnum(@enum); - } - } + var size = enumNode.Enum.Size; - if (size != enumNode.Enum.Size) + if (csf.ShowDialog() == DialogResult.OK) + { + var @enum = csf.SelectedItem; + if (@enum != null) { - // Update the parent container because the enum size has changed. - enumNode.GetParentContainer()?.ChildHasChanged(enumNode); + enumNode.ChangeEnum(@enum); } } + if (size != enumNode.Enum.Size) + { + // Update the parent container because the enum size has changed. + enumNode.GetParentContainer()?.ChildHasChanged(enumNode); + } + foreach (var @enum in CurrentProject.Enums) { projectView.UpdateEnumNode(@enum); @@ -971,10 +964,9 @@ private void deleteClassToolStripMenuItem_Click(object sender, EventArgs e) private void editEnumsToolStripMenuItem_Click(object sender, EventArgs e) { - using (var elf = new EnumListForm(currentProject)) - { - elf.ShowDialog(); - } + using var elf = new EnumListForm(currentProject); + + elf.ShowDialog(); } private void editEnumToolStripMenuItem_Click(object sender, EventArgs e) @@ -982,19 +974,17 @@ private void editEnumToolStripMenuItem_Click(object sender, EventArgs e) var @enum = projectView.SelectedEnum; if (@enum != null) { - using (var eef = new EnumEditorForm(@enum)) - { - eef.ShowDialog(); - } + using var eef = new EnumEditorForm(@enum); + + eef.ShowDialog(); } } private void showEnumsToolStripMenuItem_Click(object sender, EventArgs e) { - using (var elf = new EnumListForm(currentProject)) - { - elf.ShowDialog(); - } + using var elf = new EnumListForm(currentProject); + + elf.ShowDialog(); } private void memoryViewControl_DrawContextRequested(object sender, DrawContextRequestEventArgs args) diff --git a/ReClass.NET/Forms/ProcessInfoForm.cs b/ReClass.NET/Forms/ProcessInfoForm.cs index e3b7cd0f..e347270b 100644 --- a/ReClass.NET/Forms/ProcessInfoForm.cs +++ b/ReClass.NET/Forms/ProcessInfoForm.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Data; using System.Diagnostics.Contracts; using System.Drawing; @@ -186,26 +186,23 @@ private void dumpToolStripMenuItem_Click(object sender, EventArgs e) }; } - using (var sfd = createDialogFn()) + using var sfd = createDialogFn(); + sfd.Filter = "All|*.*"; + + if (sfd.ShowDialog() != DialogResult.OK) { - sfd.Filter = "All|*.*"; + return; + } - if (sfd.ShowDialog() != DialogResult.OK) - { - return; - } + try + { + using var stream = sfd.OpenFile(); - try - { - using (var stream = sfd.OpenFile()) - { - dumpFn(process, stream); - } - } - catch (Exception ex) - { - Program.ShowException(ex); - } + dumpFn(process, stream); + } + catch (Exception ex) + { + Program.ShowException(ex); } } @@ -224,10 +221,7 @@ private IntPtr GetSelectedAddress(object sender) { return GetSelectedModule()?.Start ?? IntPtr.Zero; } - else - { - return GetSelectedSection()?.Start ?? IntPtr.Zero; - } + return GetSelectedSection()?.Start ?? IntPtr.Zero; } private static Control GetToolStripSourceControl(object sender) diff --git a/ReClass.NET/Forms/ScannerForm.cs b/ReClass.NET/Forms/ScannerForm.cs index 3aaed815..ecbd6b96 100644 --- a/ReClass.NET/Forms/ScannerForm.cs +++ b/ReClass.NET/Forms/ScannerForm.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.ComponentModel; using System.Diagnostics.Contracts; using System.Globalization; @@ -206,58 +206,60 @@ private void memorySearchResultControl_ResultDoubleClick(object sender, MemoryRe private void openAddressFileToolStripButton_Click(object sender, EventArgs e) { - using (var ofd = new OpenFileDialog()) + using var ofd = new OpenFileDialog { - ofd.CheckFileExists = true; - ofd.Filter = $"All Scanner Types |*{ReClassScanFile.FileExtension};*{CheatEngineFile.FileExtension};*{CrySearchFile.FileExtension}" - + $"|{ReClassScanFile.FormatName} (*{ReClassScanFile.FileExtension})|*{ReClassScanFile.FileExtension}" - + $"|{CheatEngineFile.FormatName} (*{CheatEngineFile.FileExtension})|*{CheatEngineFile.FileExtension}" - + $"|{CrySearchFile.FormatName} (*{CrySearchFile.FileExtension})|*{CrySearchFile.FileExtension}"; + CheckFileExists = true, + Filter = $"All Scanner Types |*{ReClassScanFile.FileExtension};*{CheatEngineFile.FileExtension};*{CrySearchFile.FileExtension}" + + $"|{ReClassScanFile.FormatName} (*{ReClassScanFile.FileExtension})|*{ReClassScanFile.FileExtension}" + + $"|{CheatEngineFile.FormatName} (*{CheatEngineFile.FileExtension})|*{CheatEngineFile.FileExtension}" + + $"|{CrySearchFile.FormatName} (*{CrySearchFile.FileExtension})|*{CrySearchFile.FileExtension}" + }; - if (ofd.ShowDialog() == DialogResult.OK) + if (ofd.ShowDialog() == DialogResult.OK) + { + IScannerImport import = null; + switch (Path.GetExtension(ofd.FileName)?.ToLower()) + { + case ReClassScanFile.FileExtension: + import = new ReClassScanFile(); + break; + case CheatEngineFile.FileExtension: + import = new CheatEngineFile(); + break; + case CrySearchFile.FileExtension: + import = new CrySearchFile(); + break; + default: + Program.Logger.Log(LogLevel.Error, $"The file '{ofd.FileName}' has an unknown type."); + break; + } + if (import == null) { - IScannerImport import = null; - switch (Path.GetExtension(ofd.FileName)?.ToLower()) + return; + } + + if (addressListMemoryRecordList.Records.Any()) + { + if (MessageBox.Show("The address list contains addresses. Do you really want to open the file?", $"{Constants.ApplicationName} Scanner", MessageBoxButtons.YesNo, MessageBoxIcon.Question) != DialogResult.Yes) { - case ReClassScanFile.FileExtension: - import = new ReClassScanFile(); - break; - case CheatEngineFile.FileExtension: - import = new CheatEngineFile(); - break; - case CrySearchFile.FileExtension: - import = new CrySearchFile(); - break; - default: - Program.Logger.Log(LogLevel.Error, $"The file '{ofd.FileName}' has an unknown type."); - break; + return; } - if (import != null) - { - if (addressListMemoryRecordList.Records.Any()) - { - if (MessageBox.Show("The address list contains addresses. Do you really want to open the file?", $"{Constants.ApplicationName} Scanner", MessageBoxButtons.YesNo, MessageBoxIcon.Question) != DialogResult.Yes) - { - return; - } - } + } - if (import is ReClassScanFile) - { - addressFilePath = ofd.FileName; - } - - addressListMemoryRecordList.SetRecords( - import.Load(ofd.FileName, Program.Logger) - .Select(r => - { - r.ResolveAddress(process); - r.RefreshValue(process); - return r; - }) - ); - } + if (import is ReClassScanFile) + { + addressFilePath = ofd.FileName; } + + addressListMemoryRecordList.SetRecords( + import.Load(ofd.FileName, Program.Logger) + .Select(r => + { + r.ResolveAddress(process); + r.RefreshValue(process); + return r; + }) + ); } } @@ -286,17 +288,17 @@ private void saveAsToolStripButton_Click(object sender, EventArgs e) return; } - using (var sfd = new SaveFileDialog()) + using var sfd = new SaveFileDialog { - sfd.DefaultExt = ReClassScanFile.FileExtension; - sfd.Filter = $"{ReClassScanFile.FormatName} (*{ReClassScanFile.FileExtension})|*{ReClassScanFile.FileExtension}"; + DefaultExt = ReClassScanFile.FileExtension, + Filter = $"{ReClassScanFile.FormatName} (*{ReClassScanFile.FileExtension})|*{ReClassScanFile.FileExtension}" + }; - if (sfd.ShowDialog() == DialogResult.OK) - { - addressFilePath = sfd.FileName; + if (sfd.ShowDialog() == DialogResult.OK) + { + addressFilePath = sfd.FileName; - saveAddressFileToolStripButton_Click(sender, e); - } + saveAddressFileToolStripButton_Click(sender, e); } } @@ -652,8 +654,8 @@ private ScanSettings CreateSearchSettings() long.TryParse(startAddressTextBox.Text, NumberStyles.HexNumber, null, out var startAddressVar); long.TryParse(stopAddressTextBox.Text, NumberStyles.HexNumber, null, out var endAddressVar); #if RECLASSNET64 - settings.StartAddress = unchecked((IntPtr)startAddressVar); - settings.StopAddress = unchecked((IntPtr)endAddressVar); + settings.StartAddress = (IntPtr)startAddressVar; + settings.StopAddress = (IntPtr)endAddressVar; #else settings.StartAddress = unchecked((IntPtr)(int)startAddressVar); settings.StopAddress = unchecked((IntPtr)(int)endAddressVar); @@ -662,7 +664,7 @@ private ScanSettings CreateSearchSettings() int.TryParse(fastScanAlignmentTextBox.Text, out var alignment); settings.FastScanAlignment = Math.Max(1, alignment); - SettingState CheckStateToSettingState(CheckState state) + static SettingState CheckStateToSettingState(CheckState state) { switch (state) { @@ -701,7 +703,7 @@ private void SetGuiFromSettings(ScanSettings settings) fastScanCheckBox.Checked = settings.EnableFastScan; fastScanAlignmentTextBox.Text = Math.Max(1, settings.FastScanAlignment).ToString(); - CheckState SettingStateToCheckState(SettingState state) + static CheckState SettingStateToCheckState(SettingState state) { switch (state) { diff --git a/ReClass.NET/Forms/SettingsForm.cs b/ReClass.NET/Forms/SettingsForm.cs index 9c3f8a18..9f52cac1 100644 --- a/ReClass.NET/Forms/SettingsForm.cs +++ b/ReClass.NET/Forms/SettingsForm.cs @@ -1,5 +1,4 @@ -using System; -using System.Diagnostics; +using System; using System.Diagnostics.Contracts; using System.Windows.Forms; using ReClassNET.Extensions; diff --git a/ReClass.NET/MemoryScanner/Comparer/ByteMemoryComparer.cs b/ReClass.NET/MemoryScanner/Comparer/ByteMemoryComparer.cs index 737554f5..2f094a8b 100644 --- a/ReClass.NET/MemoryScanner/Comparer/ByteMemoryComparer.cs +++ b/ReClass.NET/MemoryScanner/Comparer/ByteMemoryComparer.cs @@ -1,6 +1,5 @@ -using System; +using System; using System.Diagnostics; -using ReClassNET.Util; namespace ReClassNET.MemoryScanner.Comparer { diff --git a/ReClass.NET/MemoryScanner/Comparer/DoubleMemoryComparer.cs b/ReClass.NET/MemoryScanner/Comparer/DoubleMemoryComparer.cs index ee713f59..ec0b33d3 100644 --- a/ReClass.NET/MemoryScanner/Comparer/DoubleMemoryComparer.cs +++ b/ReClass.NET/MemoryScanner/Comparer/DoubleMemoryComparer.cs @@ -1,7 +1,6 @@ -using System; +using System; using System.Diagnostics; using ReClassNET.Extensions; -using ReClassNET.Util; namespace ReClassNET.MemoryScanner.Comparer { diff --git a/ReClass.NET/MemoryScanner/Comparer/IntegerMemoryComparer.cs b/ReClass.NET/MemoryScanner/Comparer/IntegerMemoryComparer.cs index 6d2dedd1..b6c68794 100644 --- a/ReClass.NET/MemoryScanner/Comparer/IntegerMemoryComparer.cs +++ b/ReClass.NET/MemoryScanner/Comparer/IntegerMemoryComparer.cs @@ -1,6 +1,5 @@ -using System; +using System; using System.Diagnostics; -using ReClassNET.Util; namespace ReClassNET.MemoryScanner.Comparer { diff --git a/ReClass.NET/MemoryScanner/Comparer/LongMemoryComparer.cs b/ReClass.NET/MemoryScanner/Comparer/LongMemoryComparer.cs index e6fb54ed..6a161fb5 100644 --- a/ReClass.NET/MemoryScanner/Comparer/LongMemoryComparer.cs +++ b/ReClass.NET/MemoryScanner/Comparer/LongMemoryComparer.cs @@ -1,6 +1,5 @@ -using System; +using System; using System.Diagnostics; -using ReClassNET.Util; namespace ReClassNET.MemoryScanner.Comparer { diff --git a/ReClass.NET/MemoryScanner/Comparer/ShortMemoryComparer.cs b/ReClass.NET/MemoryScanner/Comparer/ShortMemoryComparer.cs index 3f7e7edd..0b35c49f 100644 --- a/ReClass.NET/MemoryScanner/Comparer/ShortMemoryComparer.cs +++ b/ReClass.NET/MemoryScanner/Comparer/ShortMemoryComparer.cs @@ -1,6 +1,5 @@ -using System; +using System; using System.Diagnostics; -using ReClassNET.Util; namespace ReClassNET.MemoryScanner.Comparer { diff --git a/ReClass.NET/MemoryScanner/Comparer/StringMemoryComparer.cs b/ReClass.NET/MemoryScanner/Comparer/StringMemoryComparer.cs index 91b7b840..264229d0 100644 --- a/ReClass.NET/MemoryScanner/Comparer/StringMemoryComparer.cs +++ b/ReClass.NET/MemoryScanner/Comparer/StringMemoryComparer.cs @@ -1,8 +1,7 @@ -using System; +using System; using System.Diagnostics; using System.Text; using ReClassNET.Extensions; -using ReClassNET.Util; namespace ReClassNET.MemoryScanner.Comparer { diff --git a/ReClass.NET/MemoryScanner/ScanResult.cs b/ReClass.NET/MemoryScanner/ScanResult.cs index 6ebd4766..1684cc28 100644 --- a/ReClass.NET/MemoryScanner/ScanResult.cs +++ b/ReClass.NET/MemoryScanner/ScanResult.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Diagnostics.Contracts; using System.Linq; using System.Text; @@ -231,7 +231,7 @@ public override bool Equals(object obj) public bool Equals(ArrayOfBytesScanResult other) { - return other != null && Address == other.Address && Enumerable.SequenceEqual(Value, other.Value); + return other != null && Address == other.Address && Value.SequenceEqual(other.Value); } public override int GetHashCode() diff --git a/ReClass.NET/Native/NativeMethods.Windows.cs b/ReClass.NET/Native/NativeMethods.Windows.cs index 36e25d13..5b5ce08e 100644 --- a/ReClass.NET/Native/NativeMethods.Windows.cs +++ b/ReClass.NET/Native/NativeMethods.Windows.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Diagnostics.Contracts; using System.Drawing; using System.Runtime.InteropServices; @@ -231,9 +231,9 @@ public void UnregisterExtension(string fileExtension, string extensionId) ShChangeNotify(); } - catch (Exception) + catch { - + // ignored } } @@ -243,9 +243,9 @@ private static void ShChangeNotify() { SHChangeNotify(SHCNE_ASSOCCHANGED, SHCNF_IDLIST, IntPtr.Zero, IntPtr.Zero); } - catch (Exception) + catch { - + // ignored } } @@ -268,9 +268,9 @@ public static void SetButtonShield(Button button, bool setShield) SendMessage(h, BCM_SETSHIELD, IntPtr.Zero, (IntPtr)(setShield ? 1 : 0)); } - catch (Exception) + catch { - + // ignored } } } diff --git a/ReClass.NET/Nodes/BaseFunctionNode.cs b/ReClass.NET/Nodes/BaseFunctionNode.cs index 8bb7bbf1..a7e1c6f6 100644 --- a/ReClass.NET/Nodes/BaseFunctionNode.cs +++ b/ReClass.NET/Nodes/BaseFunctionNode.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Diagnostics.Contracts; using System.Drawing; @@ -17,8 +17,8 @@ protected class FunctionNodeInstruction public string Instruction { get; set; } } - protected IntPtr address = IntPtr.Zero; - protected readonly List instructions = new List(); + protected IntPtr Address = IntPtr.Zero; + protected readonly List Instructions = new List(); protected Size DrawInstructions(ViewInfo view, int tx, int y) { @@ -31,7 +31,7 @@ protected Size DrawInstructions(ViewInfo view, int tx, int y) using (var brush = new SolidBrush(view.Settings.HiddenColor)) { - foreach (var instruction in instructions) + foreach (var instruction in Instructions) { y += view.Font.Height; @@ -65,7 +65,7 @@ protected void DisassembleRemoteCode(RemoteProcess process, IntPtr address, out { memorySize += instruction.Length; - instructions.Add(new FunctionNodeInstruction + Instructions.Add(new FunctionNodeInstruction { Address = instruction.Address.ToString(Constants.AddressHexFormat), Data = string.Join(" ", instruction.Data.Take(instruction.Length).Select(b => $"{b:X2}")), diff --git a/ReClass.NET/Nodes/BaseFunctionPtrNode.cs b/ReClass.NET/Nodes/BaseFunctionPtrNode.cs index a94e5e2a..578b0a43 100644 --- a/ReClass.NET/Nodes/BaseFunctionPtrNode.cs +++ b/ReClass.NET/Nodes/BaseFunctionPtrNode.cs @@ -1,11 +1,10 @@ -using System; +using System; using System.Diagnostics.Contracts; using System.Drawing; using System.Linq; using ReClassNET.Extensions; using ReClassNET.Memory; using ReClassNET.UI; -using ReClassNET.Util; namespace ReClassNET.Nodes { @@ -19,7 +18,7 @@ public override string GetToolTipText(HotSpot spot) DisassembleRemoteCode(spot.Process, ptr); - return string.Join("\n", instructions.Select(i => i.Instruction)); + return string.Join("\n", Instructions.Select(i => i.Instruction)); } protected Size Draw(ViewInfo view, int x, int y, string type, string name) @@ -102,7 +101,7 @@ public override int CalculateDrawnHeight(ViewInfo view) var height = view.Font.Height; if (LevelsOpen[view.Level]) { - height += instructions.Count * view.Font.Height; + height += Instructions.Count * view.Font.Height; } return height; } @@ -111,11 +110,11 @@ private void DisassembleRemoteCode(RemoteProcess process, IntPtr address) { Contract.Requires(process != null); - if (this.address != address) + if (this.Address != address) { - instructions.Clear(); + Instructions.Clear(); - this.address = address; + this.Address = address; if (!address.IsNull() && process.IsValid) { diff --git a/ReClass.NET/Nodes/BaseNode.cs b/ReClass.NET/Nodes/BaseNode.cs index 1a7d7991..19cd948f 100644 --- a/ReClass.NET/Nodes/BaseNode.cs +++ b/ReClass.NET/Nodes/BaseNode.cs @@ -1,10 +1,9 @@ -using System; +using System; using System.Collections.Generic; using System.Diagnostics; using System.Diagnostics.Contracts; using System.Drawing; using ReClassNET.Extensions; -using ReClassNET.Memory; using ReClassNET.UI; using ReClassNET.Util; @@ -16,7 +15,7 @@ namespace ReClassNET.Nodes [ContractClass(typeof(BaseNodeContract))] public abstract class BaseNode { - private string DebuggerDisplay => $"Type: {GetType().Name} Name: {Name} Offset: 0x{Offset.ToString("X")}"; + private string DebuggerDisplay => $"Type: {GetType().Name} Name: {Name} Offset: 0x{Offset:X}"; internal static readonly List NodeInfoReader = new List(); @@ -375,10 +374,9 @@ protected void AddSelection(ViewInfo view, int x, int y, int height) if (IsSelected) { - using (var brush = new SolidBrush(view.Settings.SelectedColor)) - { - view.Context.FillRectangle(brush, 0, y, view.ClientArea.Right, height); - } + using var brush = new SolidBrush(view.Settings.SelectedColor); + + view.Context.FillRectangle(brush, 0, y, view.ClientArea.Right, height); } AddHotSpot(view, new Rectangle(0, y, view.ClientArea.Right - (IsSelected ? 16 : 0), height), string.Empty, HotSpot.NoneId, HotSpotType.Select); diff --git a/ReClass.NET/Nodes/ClassInstanceNode.cs b/ReClass.NET/Nodes/ClassInstanceNode.cs index a8682dac..c968a59c 100644 --- a/ReClass.NET/Nodes/ClassInstanceNode.cs +++ b/ReClass.NET/Nodes/ClassInstanceNode.cs @@ -1,6 +1,5 @@ -using System; +using System; using System.Drawing; -using ReClassNET.Extensions; using ReClassNET.UI; namespace ReClassNET.Nodes diff --git a/ReClass.NET/Nodes/FunctionNode.cs b/ReClass.NET/Nodes/FunctionNode.cs index b4cd4b62..867d7c26 100644 --- a/ReClass.NET/Nodes/FunctionNode.cs +++ b/ReClass.NET/Nodes/FunctionNode.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Diagnostics.Contracts; using System.Drawing; using System.Linq; @@ -27,7 +27,7 @@ public override string GetToolTipText(HotSpot spot) { DisassembleRemoteCode(spot.Process, spot.Address); - return string.Join("\n", instructions.Select(i => i.Instruction)); + return string.Join("\n", Instructions.Select(i => i.Instruction)); } public override Size Draw(ViewInfo view, int x, int y) @@ -103,7 +103,7 @@ public override int CalculateDrawnHeight(ViewInfo view) var height = view.Font.Height; if (LevelsOpen[view.Level]) { - height += instructions.Count * view.Font.Height; + height += Instructions.Count * view.Font.Height; } return height; } @@ -122,11 +122,11 @@ private void DisassembleRemoteCode(RemoteProcess process, IntPtr address) { Contract.Requires(process != null); - if (this.address != address) + if (this.Address != address) { - instructions.Clear(); + Instructions.Clear(); - this.address = address; + this.Address = address; if (!address.IsNull() && process.IsValid) { diff --git a/ReClass.NET/Nodes/Hex8Node.cs b/ReClass.NET/Nodes/Hex8Node.cs index 75337e96..e1e903bd 100644 --- a/ReClass.NET/Nodes/Hex8Node.cs +++ b/ReClass.NET/Nodes/Hex8Node.cs @@ -1,5 +1,4 @@ -using System.Drawing; -using ReClassNET.Memory; +using System.Drawing; using ReClassNET.UI; namespace ReClassNET.Nodes diff --git a/ReClass.NET/Nodes/Matrix3x3Node.cs b/ReClass.NET/Nodes/Matrix3x3Node.cs index 6d6b87f1..68366ad7 100644 --- a/ReClass.NET/Nodes/Matrix3x3Node.cs +++ b/ReClass.NET/Nodes/Matrix3x3Node.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Drawing; using System.Runtime.InteropServices; using ReClassNET.UI; @@ -8,7 +8,7 @@ namespace ReClassNET.Nodes public class Matrix3x3Node : BaseMatrixNode { [StructLayout(LayoutKind.Explicit)] - private struct Matrix3x3Data + private readonly struct Matrix3x3Data { [FieldOffset(0)] public readonly float _11; diff --git a/ReClass.NET/Nodes/Matrix3x4Node.cs b/ReClass.NET/Nodes/Matrix3x4Node.cs index d00322da..093e8d81 100644 --- a/ReClass.NET/Nodes/Matrix3x4Node.cs +++ b/ReClass.NET/Nodes/Matrix3x4Node.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Drawing; using System.Runtime.InteropServices; using ReClassNET.UI; @@ -8,7 +8,7 @@ namespace ReClassNET.Nodes public class Matrix3x4Node : BaseMatrixNode { [StructLayout(LayoutKind.Explicit)] - private struct Matrix3x4Data + private readonly struct Matrix3x4Data { [FieldOffset(0)] public readonly float _11; diff --git a/ReClass.NET/Nodes/Matrix4x4Node.cs b/ReClass.NET/Nodes/Matrix4x4Node.cs index a2adb2f0..40f23531 100644 --- a/ReClass.NET/Nodes/Matrix4x4Node.cs +++ b/ReClass.NET/Nodes/Matrix4x4Node.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Drawing; using System.Runtime.InteropServices; using ReClassNET.UI; @@ -8,7 +8,7 @@ namespace ReClassNET.Nodes public class Matrix4x4Node : BaseMatrixNode { [StructLayout(LayoutKind.Explicit)] - private struct Matrix4x4Data + private readonly struct Matrix4x4Data { [FieldOffset(0)] public readonly float _11; diff --git a/ReClass.NET/Nodes/Vector2Node.cs b/ReClass.NET/Nodes/Vector2Node.cs index b0b1643e..b23809e1 100644 --- a/ReClass.NET/Nodes/Vector2Node.cs +++ b/ReClass.NET/Nodes/Vector2Node.cs @@ -1,4 +1,4 @@ -using System.Drawing; +using System.Drawing; using System.Runtime.InteropServices; using ReClassNET.UI; @@ -7,7 +7,7 @@ namespace ReClassNET.Nodes public class Vector2Node : BaseMatrixNode { [StructLayout(LayoutKind.Explicit)] - private struct Vector2Data + private readonly struct Vector2Data { [FieldOffset(0)] public readonly float X; diff --git a/ReClass.NET/Nodes/Vector3Node.cs b/ReClass.NET/Nodes/Vector3Node.cs index 99c14b49..6b174376 100644 --- a/ReClass.NET/Nodes/Vector3Node.cs +++ b/ReClass.NET/Nodes/Vector3Node.cs @@ -1,4 +1,4 @@ -using System.Drawing; +using System.Drawing; using System.Runtime.InteropServices; using ReClassNET.UI; @@ -7,7 +7,7 @@ namespace ReClassNET.Nodes public class Vector3Node : BaseMatrixNode { [StructLayout(LayoutKind.Explicit)] - private struct Vector3Data + private readonly struct Vector3Data { [FieldOffset(0)] public readonly float X; diff --git a/ReClass.NET/Nodes/Vector4Node.cs b/ReClass.NET/Nodes/Vector4Node.cs index 2fc086b4..0bc97dbd 100644 --- a/ReClass.NET/Nodes/Vector4Node.cs +++ b/ReClass.NET/Nodes/Vector4Node.cs @@ -1,4 +1,4 @@ -using System.Drawing; +using System.Drawing; using System.Runtime.InteropServices; using ReClassNET.UI; @@ -7,7 +7,7 @@ namespace ReClassNET.Nodes public class Vector4Node : BaseMatrixNode { [StructLayout(LayoutKind.Explicit)] - private struct Vector4Data + private readonly struct Vector4Data { [FieldOffset(0)] public readonly float X; diff --git a/ReClass.NET/Plugins/PluginInfo.cs b/ReClass.NET/Plugins/PluginInfo.cs index ccf29df2..c9c9e72f 100644 --- a/ReClass.NET/Plugins/PluginInfo.cs +++ b/ReClass.NET/Plugins/PluginInfo.cs @@ -79,7 +79,7 @@ public void Dispose() } catch { - + // ignored } } diff --git a/ReClass.NET/Program.cs b/ReClass.NET/Program.cs index 0247418a..65ea6838 100644 --- a/ReClass.NET/Program.cs +++ b/ReClass.NET/Program.cs @@ -47,7 +47,7 @@ static void Main(string[] args) } catch { - + // ignored } MonoSpaceFont = new FontEx @@ -69,7 +69,7 @@ static void Main(string[] args) if (!NativeMethods.IsUnix() && Settings.RunAsAdmin && !WinUtil.IsAdministrator) { - WinUtil.RunElevated(Process.GetCurrentProcess().MainModule.FileName, args.Length > 0 ? string.Join(" ", args) : null); + WinUtil.RunElevated(Process.GetCurrentProcess().MainModule?.FileName, args.Length > 0 ? string.Join(" ", args) : null); return; } diff --git a/ReClass.NET/Symbols/ComDisposableWrapper.cs b/ReClass.NET/Symbols/ComDisposableWrapper.cs index aedd3224..8666bb75 100644 --- a/ReClass.NET/Symbols/ComDisposableWrapper.cs +++ b/ReClass.NET/Symbols/ComDisposableWrapper.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Diagnostics.Contracts; using System.Runtime.InteropServices; @@ -6,26 +6,26 @@ namespace ReClassNET.Symbols { class DisposableWrapper : IDisposable { - protected object obj; + protected object Object; [ContractInvariantMethod] private void ObjectInvariants() { - Contract.Invariant(obj != null); + Contract.Invariant(Object != null); } public DisposableWrapper(object obj) { Contract.Requires(obj != null); - this.obj = obj; + this.Object = obj; } protected virtual void Dispose(bool disposing) { if (disposing) { - Marshal.ReleaseComObject(obj); + Marshal.ReleaseComObject(Object); } } @@ -44,7 +44,7 @@ public void Dispose() class ComDisposableWrapper : DisposableWrapper { - public T Interface => (T)obj; + public T Interface => (T)Object; public ComDisposableWrapper(T com) : base(com) diff --git a/ReClass.NET/Symbols/SymbolStore.cs b/ReClass.NET/Symbols/SymbolStore.cs index 4992c558..80aee721 100644 --- a/ReClass.NET/Symbols/SymbolStore.cs +++ b/ReClass.NET/Symbols/SymbolStore.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Diagnostics.Contracts; using System.IO; @@ -9,22 +9,21 @@ using ReClassNET.Extensions; using ReClassNET.Memory; using ReClassNET.Native; -using ReClassNET.Util; namespace ReClassNET.Symbols { class DiaUtil : IDisposable { - public readonly IDiaDataSource diaDataSource; - public readonly IDiaSession diaSession; + public readonly IDiaDataSource DiaDataSource; + public readonly IDiaSession DiaSession; public DiaUtil(string pdbName) { Contract.Requires(pdbName != null); - diaDataSource = new DiaSource(); - diaDataSource.loadDataFromPdb(pdbName); - diaDataSource.openSession(out diaSession); + DiaDataSource = new DiaSource(); + DiaDataSource.loadDataFromPdb(pdbName); + DiaDataSource.openSession(out DiaSession); } private bool isDisposed; @@ -33,8 +32,8 @@ protected virtual void Dispose(bool disposing) { if (!isDisposed) { - Marshal.ReleaseComObject(diaSession); - Marshal.ReleaseComObject(diaDataSource); + Marshal.ReleaseComObject(DiaSession); + Marshal.ReleaseComObject(DiaDataSource); isDisposed = true; } diff --git a/ReClass.NET/UI/BannerBox.cs b/ReClass.NET/UI/BannerBox.cs index c20c541e..ca8eb6e5 100644 --- a/ReClass.NET/UI/BannerBox.cs +++ b/ReClass.NET/UI/BannerBox.cs @@ -1,4 +1,4 @@ -using System.ComponentModel; +using System.ComponentModel; using System.Drawing; using System.Windows.Forms; @@ -79,7 +79,7 @@ private void UpdateBanner() } catch { - + // ignored } } } diff --git a/ReClass.NET/UI/BannerFactory.cs b/ReClass.NET/UI/BannerFactory.cs index 7e4c697d..87448e09 100644 --- a/ReClass.NET/UI/BannerFactory.cs +++ b/ReClass.NET/UI/BannerFactory.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Diagnostics.Contracts; using System.Drawing; @@ -113,13 +113,10 @@ public static Image CreateBanner(int bannerWidth, int bannerHeight, Image icon, private static void DrawText(Graphics g, string text, int x, int y, Font font, Color color) { - using (var brush = new SolidBrush(color)) - { - using (var format = new StringFormat(StringFormatFlags.FitBlackBox | StringFormatFlags.NoClip)) - { - g.DrawString(text, font, brush, x, y, format); - } - } + using var brush = new SolidBrush(color); + using var format = new StringFormat(StringFormatFlags.FitBlackBox | StringFormatFlags.NoClip); + + g.DrawString(text, font, brush, x, y, format); } private static int DpiScaleInt(int x, int height) => (int)Math.Round((x * height) / (double)StdHeight); diff --git a/ReClass.NET/UI/ColorBox.cs b/ReClass.NET/UI/ColorBox.cs index 97148fff..d51efdaa 100644 --- a/ReClass.NET/UI/ColorBox.cs +++ b/ReClass.NET/UI/ColorBox.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.ComponentModel; using System.Diagnostics.Contracts; using System.Drawing; @@ -77,22 +77,21 @@ private void OnTextChanged(object sender, EventArgs e) } catch { - + // ignored } } private void OnPanelClick(object sender, EventArgs e) { - using (var cd = new ColorDialog + using var cd = new ColorDialog { FullOpen = true, Color = Color - }) + }; + + if (cd.ShowDialog() == DialogResult.OK) { - if (cd.ShowDialog() == DialogResult.OK) - { - Color = cd.Color; - } + Color = cd.Color; } } diff --git a/ReClass.NET/UI/DpiUtil.cs b/ReClass.NET/UI/DpiUtil.cs index 398a090f..c3fb88c2 100644 --- a/ReClass.NET/UI/DpiUtil.cs +++ b/ReClass.NET/UI/DpiUtil.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Diagnostics.Contracts; using System.Drawing; using System.Drawing.Drawing2D; @@ -43,21 +43,19 @@ private static void EnsureInitialized() try { - using (var g = Graphics.FromHwnd(IntPtr.Zero)) + using var g = Graphics.FromHwnd(IntPtr.Zero); + dpiX = (int)g.DpiX; + dpiY = (int)g.DpiY; + + if (dpiX <= 0 || dpiY <= 0) { - dpiX = (int)g.DpiX; - dpiY = (int)g.DpiY; - - if (dpiX <= 0 || dpiY <= 0) - { - dpiX = StdDpi; - dpiY = StdDpi; - } + dpiX = StdDpi; + dpiY = StdDpi; } } catch { - + // ignored } scaleX = dpiX / (double)StdDpi; @@ -111,34 +109,32 @@ private static Image ScaleImage(Image img, int w, int h) Contract.Requires(w >= 0); Contract.Requires(h >= 0); - var bmp = new Bitmap(w, h, PixelFormat.Format32bppArgb); - using (Graphics g = Graphics.FromImage(bmp)) - { - g.Clear(Color.Transparent); + using var bmp = new Bitmap(w, h, PixelFormat.Format32bppArgb); + using var g = Graphics.FromImage(bmp); + g.Clear(Color.Transparent); - g.SmoothingMode = SmoothingMode.HighQuality; - g.CompositingQuality = CompositingQuality.HighQuality; + g.SmoothingMode = SmoothingMode.HighQuality; + g.CompositingQuality = CompositingQuality.HighQuality; - var wSrc = img.Width; - var hSrc = img.Height; + var wSrc = img.Width; + var hSrc = img.Height; - InterpolationMode im = InterpolationMode.HighQualityBicubic; - if (wSrc > 0 && hSrc > 0) + var im = InterpolationMode.HighQualityBicubic; + if (wSrc > 0 && hSrc > 0) + { + if ((w % wSrc) == 0 && (h % hSrc) == 0) { - if ((w % wSrc) == 0 && (h % hSrc) == 0) - { - im = InterpolationMode.NearestNeighbor; - } + im = InterpolationMode.NearestNeighbor; } + } - g.InterpolationMode = im; + g.InterpolationMode = im; - var rSource = new RectangleF(0.0f, 0.0f, wSrc, hSrc); - var rDest = new RectangleF(0.0f, 0.0f, w, h); - AdjustScaleRects(ref rSource, ref rDest); + var rSource = new RectangleF(0.0f, 0.0f, wSrc, hSrc); + var rDest = new RectangleF(0.0f, 0.0f, w, h); + AdjustScaleRects(ref rSource, ref rDest); - g.DrawImage(img, rDest, rSource, GraphicsUnit.Pixel); - } + g.DrawImage(img, rDest, rSource, GraphicsUnit.Pixel); return bmp; } diff --git a/ReClass.NET/UI/EnumComboBox.cs b/ReClass.NET/UI/EnumComboBox.cs index c22fb6e7..b0567ead 100644 --- a/ReClass.NET/UI/EnumComboBox.cs +++ b/ReClass.NET/UI/EnumComboBox.cs @@ -1,10 +1,9 @@ -using System.Collections.Generic; +using System.Collections.Generic; using System.ComponentModel; using System.Diagnostics.Contracts; using System.Linq; using System.Windows.Forms; using ReClassNET.Extensions; -using ReClassNET.Util; namespace ReClassNET.UI { @@ -52,7 +51,7 @@ public class EnumComboBox : ComboBox where TEnum : struct [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public new TEnum SelectedValue { - get => ((EnumDescriptionDisplay)base.SelectedItem)?.Value ?? default(TEnum); + get => ((EnumDescriptionDisplay)base.SelectedItem)?.Value ?? default; set => base.SelectedItem = base.Items.Cast>().PredicateOrFirst(e => e.Value.Equals(value)); } diff --git a/ReClass.NET/UI/IconButton.cs b/ReClass.NET/UI/IconButton.cs index d3331c2c..c2d80304 100644 --- a/ReClass.NET/UI/IconButton.cs +++ b/ReClass.NET/UI/IconButton.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.ComponentModel; using System.Diagnostics.Contracts; using System.Drawing; @@ -100,18 +100,16 @@ private void RenderButtonBackground(Graphics g) else { drawHotBorder = false; - using (var brush = new SolidBrush(BackColor)) - { - g.FillRectangle(brush, bounds); - } + using var brush = new SolidBrush(BackColor); + + g.FillRectangle(brush, bounds); } if (drawHotBorder) { - using (var pen = new Pen(colorTable.ButtonSelectedBorder)) - { - g.DrawRectangle(pen, bounds.X, bounds.Y, bounds.Width - 1, bounds.Height - 1); - } + using var pen = new Pen(colorTable.ButtonSelectedBorder); + + g.DrawRectangle(pen, bounds.X, bounds.Y, bounds.Width - 1, bounds.Height - 1); } } @@ -124,10 +122,9 @@ private void RenderPressedButtonFill(Graphics g, Rectangle bounds) return; } - using (var brush = new LinearGradientBrush(bounds, colorTable.ButtonPressedGradientBegin, colorTable.ButtonPressedGradientEnd, LinearGradientMode.Vertical)) - { - g.FillRectangle(brush, bounds); - } + using var brush = new LinearGradientBrush(bounds, colorTable.ButtonPressedGradientBegin, colorTable.ButtonPressedGradientEnd, LinearGradientMode.Vertical); + + g.FillRectangle(brush, bounds); } private void RenderSelectedButtonFill(Graphics g, Rectangle bounds) @@ -139,10 +136,9 @@ private void RenderSelectedButtonFill(Graphics g, Rectangle bounds) return; } - using (var brush = new LinearGradientBrush(bounds, colorTable.ButtonSelectedGradientBegin, colorTable.ButtonSelectedGradientEnd, LinearGradientMode.Vertical)) - { - g.FillRectangle(brush, bounds); - } + using var brush = new LinearGradientBrush(bounds, colorTable.ButtonSelectedGradientBegin, colorTable.ButtonSelectedGradientEnd, LinearGradientMode.Vertical); + + g.FillRectangle(brush, bounds); } private void RenderImage(Graphics g) diff --git a/ReClass.NET/UI/LinkedWindowFeatures.cs b/ReClass.NET/UI/LinkedWindowFeatures.cs index 14eeb691..36dab03e 100644 --- a/ReClass.NET/UI/LinkedWindowFeatures.cs +++ b/ReClass.NET/UI/LinkedWindowFeatures.cs @@ -1,15 +1,12 @@ -using System; -using System.Collections.Generic; +using System; using System.Diagnostics.Contracts; using System.Linq; using System.Windows.Forms; -using ReClassNET.CodeGenerator; using ReClassNET.Debugger; using ReClassNET.Forms; using ReClassNET.MemoryScanner; using ReClassNET.MemoryScanner.Comparer; using ReClassNET.Nodes; -using ReClassNET.Project; namespace ReClassNET.UI { diff --git a/ReClass.NET/UI/MemoryRecordList.cs b/ReClass.NET/UI/MemoryRecordList.cs index f3d63b92..4bd53773 100644 --- a/ReClass.NET/UI/MemoryRecordList.cs +++ b/ReClass.NET/UI/MemoryRecordList.cs @@ -1,4 +1,4 @@ -using System.Collections.Generic; +using System.Collections.Generic; using System.ComponentModel; using System.Diagnostics.Contracts; using System.Drawing; @@ -7,7 +7,6 @@ using ReClassNET.Extensions; using ReClassNET.Memory; using ReClassNET.MemoryScanner; -using ReClassNET.Util; namespace ReClassNET.UI { diff --git a/ReClass.NET/UI/NodeTypesBuilder.cs b/ReClass.NET/UI/NodeTypesBuilder.cs index b896e785..e5e85161 100644 --- a/ReClass.NET/UI/NodeTypesBuilder.cs +++ b/ReClass.NET/UI/NodeTypesBuilder.cs @@ -1,10 +1,9 @@ -using System; +using System; using System.Collections.Generic; using System.Diagnostics.Contracts; using System.Drawing; using System.Linq; using System.Windows.Forms; -using ReClassNET.Extensions; using ReClassNET.Nodes; using ReClassNET.Plugins; diff --git a/ReClass.NET/UI/PlaceholderTextBox.cs b/ReClass.NET/UI/PlaceholderTextBox.cs index d0ac5d25..282bb08d 100644 --- a/ReClass.NET/UI/PlaceholderTextBox.cs +++ b/ReClass.NET/UI/PlaceholderTextBox.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.ComponentModel; using System.Drawing; using System.Windows.Forms; @@ -66,10 +66,9 @@ protected override void OnPaint(PaintEventArgs e) if (string.IsNullOrEmpty(Text) && Focused == false) { - using (var brush = new SolidBrush(PlaceholderColor)) - { - e.Graphics.DrawString(PlaceholderText ?? string.Empty, Font, brush, new PointF(-1.0f, 1.0f)); - } + using var brush = new SolidBrush(PlaceholderColor); + + e.Graphics.DrawString(PlaceholderText ?? string.Empty, Font, brush, new PointF(-1.0f, 1.0f)); } } } diff --git a/ReClass.NET/UI/ProjectView.cs b/ReClass.NET/UI/ProjectView.cs index 9be2363d..94d1f27d 100644 --- a/ReClass.NET/UI/ProjectView.cs +++ b/ReClass.NET/UI/ProjectView.cs @@ -1,9 +1,8 @@ -using System.Collections; +using System.Collections; using System.Collections.Generic; using System.ComponentModel; using System.Diagnostics.Contracts; using System.Linq; -using System.Runtime.Remoting.Contexts; using System.Windows.Forms; using ReClassNET.Extensions; using ReClassNET.Nodes; diff --git a/ReClass.NET/Util/CircularBuffer.cs b/ReClass.NET/Util/CircularBuffer.cs index 4a802c6a..4a10ae72 100644 --- a/ReClass.NET/Util/CircularBuffer.cs +++ b/ReClass.NET/Util/CircularBuffer.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections; using System.Collections.Generic; @@ -56,7 +56,7 @@ public T Dequeue() } var dequeued = buffer[head]; - buffer[head] = default(T); + buffer[head] = default; if (head == 0) { head = Capacity - 1; diff --git a/ReClass.NET/Util/HexadecimalFormatter.cs b/ReClass.NET/Util/HexadecimalFormatter.cs index 6e4fa50c..18f6e907 100644 --- a/ReClass.NET/Util/HexadecimalFormatter.cs +++ b/ReClass.NET/Util/HexadecimalFormatter.cs @@ -1,4 +1,4 @@ -using System.Diagnostics.Contracts; +using System.Diagnostics.Contracts; namespace ReClassNET.Util { @@ -12,7 +12,7 @@ private static uint[] CreateHexLookup() for (var i = 0; i < 256; i++) { var s = i.ToString("X2"); - result[i] = (uint)s[0] + ((uint)s[1] << 16); + result[i] = s[0] + ((uint)s[1] << 16); } return result; } diff --git a/ReClass.NET/Util/PathUtil.cs b/ReClass.NET/Util/PathUtil.cs index f4170bf5..e8823d5d 100644 --- a/ReClass.NET/Util/PathUtil.cs +++ b/ReClass.NET/Util/PathUtil.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Diagnostics.Contracts; using System.IO; using System.Reflection; @@ -14,9 +14,9 @@ public class PathUtil { path = Assembly.GetExecutingAssembly().Location; } - catch (Exception) + catch { - + // ignored } if (string.IsNullOrEmpty(path)) diff --git a/ReClass.NET/Util/Rtf/RtfBuilder.cs b/ReClass.NET/Util/Rtf/RtfBuilder.cs index 20334875..4015722d 100644 --- a/ReClass.NET/Util/Rtf/RtfBuilder.cs +++ b/ReClass.NET/Util/Rtf/RtfBuilder.cs @@ -1,9 +1,8 @@ -using System; +using System; using System.Collections.Generic; using System.Drawing; using System.Linq; using System.Text; -using ReClassNET.Extensions; namespace ReClassNET.Util.Rtf { diff --git a/ReClass.NET/Util/SettingsSerializer.cs b/ReClass.NET/Util/SettingsSerializer.cs index 8376e2e6..2a5a4e82 100644 --- a/ReClass.NET/Util/SettingsSerializer.cs +++ b/ReClass.NET/Util/SettingsSerializer.cs @@ -1,4 +1,3 @@ -using System; using System.Diagnostics.Contracts; using System.IO; using System.Xml.Linq; @@ -25,61 +24,60 @@ public static Settings Load() { var path = Path.Combine(PathUtil.SettingsFolderPath, Constants.SettingsFile); - using (var sr = new StreamReader(path)) + using var sr = new StreamReader(path); + + var document = XDocument.Load(sr); + var root = document.Root; + + var general = root?.Element(XmlGeneralElement); + if (general != null) + { + XElementSerializer.TryRead(general, nameof(settings.LastProcess), e => settings.LastProcess = XElementSerializer.ToString(e)); + XElementSerializer.TryRead(general, nameof(settings.StayOnTop), e => settings.StayOnTop = XElementSerializer.ToBool(e)); + XElementSerializer.TryRead(general, nameof(settings.RunAsAdmin), e => settings.RunAsAdmin = XElementSerializer.ToBool(e)); + XElementSerializer.TryRead(general, nameof(settings.RandomizeWindowTitle), e => settings.RandomizeWindowTitle = XElementSerializer.ToBool(e)); + } + var display = root?.Element(XmlDisplayElement); + if (display != null) + { + XElementSerializer.TryRead(display, nameof(settings.ShowNodeAddress), e => settings.ShowNodeAddress = XElementSerializer.ToBool(e)); + XElementSerializer.TryRead(display, nameof(settings.ShowNodeOffset), e => settings.ShowNodeOffset = XElementSerializer.ToBool(e)); + XElementSerializer.TryRead(display, nameof(settings.ShowNodeText), e => settings.ShowNodeText = XElementSerializer.ToBool(e)); + XElementSerializer.TryRead(display, nameof(settings.HighlightChangedValues), e => settings.HighlightChangedValues = XElementSerializer.ToBool(e)); + XElementSerializer.TryRead(display, nameof(settings.ShowCommentFloat), e => settings.ShowCommentFloat = XElementSerializer.ToBool(e)); + XElementSerializer.TryRead(display, nameof(settings.ShowCommentInteger), e => settings.ShowCommentInteger = XElementSerializer.ToBool(e)); + XElementSerializer.TryRead(display, nameof(settings.ShowCommentPointer), e => settings.ShowCommentPointer = XElementSerializer.ToBool(e)); + XElementSerializer.TryRead(display, nameof(settings.ShowCommentRtti), e => settings.ShowCommentRtti = XElementSerializer.ToBool(e)); + XElementSerializer.TryRead(display, nameof(settings.ShowCommentSymbol), e => settings.ShowCommentSymbol = XElementSerializer.ToBool(e)); + XElementSerializer.TryRead(display, nameof(settings.ShowCommentString), e => settings.ShowCommentString = XElementSerializer.ToBool(e)); + XElementSerializer.TryRead(display, nameof(settings.ShowCommentPluginInfo), e => settings.ShowCommentPluginInfo = XElementSerializer.ToBool(e)); + } + var colors = root?.Element(XmlColorsElement); + if (colors != null) + { + XElementSerializer.TryRead(colors, nameof(settings.BackgroundColor), e => settings.BackgroundColor = XElementSerializer.ToColor(e)); + XElementSerializer.TryRead(colors, nameof(settings.SelectedColor), e => settings.SelectedColor = XElementSerializer.ToColor(e)); + XElementSerializer.TryRead(colors, nameof(settings.HiddenColor), e => settings.HiddenColor = XElementSerializer.ToColor(e)); + XElementSerializer.TryRead(colors, nameof(settings.OffsetColor), e => settings.OffsetColor = XElementSerializer.ToColor(e)); + XElementSerializer.TryRead(colors, nameof(settings.AddressColor), e => settings.AddressColor = XElementSerializer.ToColor(e)); + XElementSerializer.TryRead(colors, nameof(settings.HexColor), e => settings.HexColor = XElementSerializer.ToColor(e)); + XElementSerializer.TryRead(colors, nameof(settings.TypeColor), e => settings.TypeColor = XElementSerializer.ToColor(e)); + XElementSerializer.TryRead(colors, nameof(settings.NameColor), e => settings.NameColor = XElementSerializer.ToColor(e)); + XElementSerializer.TryRead(colors, nameof(settings.ValueColor), e => settings.ValueColor = XElementSerializer.ToColor(e)); + XElementSerializer.TryRead(colors, nameof(settings.IndexColor), e => settings.IndexColor = XElementSerializer.ToColor(e)); + XElementSerializer.TryRead(colors, nameof(settings.CommentColor), e => settings.CommentColor = XElementSerializer.ToColor(e)); + XElementSerializer.TryRead(colors, nameof(settings.TextColor), e => settings.TextColor = XElementSerializer.ToColor(e)); + XElementSerializer.TryRead(colors, nameof(settings.VTableColor), e => settings.VTableColor = XElementSerializer.ToColor(e)); + } + var customData = root?.Element(XmlCustomDataElement); + if (customData != null) { - var document = XDocument.Load(sr); - var root = document.Root; - - var general = root?.Element(XmlGeneralElement); - if (general != null) - { - XElementSerializer.TryRead(general, nameof(settings.LastProcess), e => settings.LastProcess = XElementSerializer.ToString(e)); - XElementSerializer.TryRead(general, nameof(settings.StayOnTop), e => settings.StayOnTop = XElementSerializer.ToBool(e)); - XElementSerializer.TryRead(general, nameof(settings.RunAsAdmin), e => settings.RunAsAdmin = XElementSerializer.ToBool(e)); - XElementSerializer.TryRead(general, nameof(settings.RandomizeWindowTitle), e => settings.RandomizeWindowTitle = XElementSerializer.ToBool(e)); - } - var display = root?.Element(XmlDisplayElement); - if (display != null) - { - XElementSerializer.TryRead(display, nameof(settings.ShowNodeAddress), e => settings.ShowNodeAddress = XElementSerializer.ToBool(e)); - XElementSerializer.TryRead(display, nameof(settings.ShowNodeOffset), e => settings.ShowNodeOffset = XElementSerializer.ToBool(e)); - XElementSerializer.TryRead(display, nameof(settings.ShowNodeText), e => settings.ShowNodeText = XElementSerializer.ToBool(e)); - XElementSerializer.TryRead(display, nameof(settings.HighlightChangedValues), e => settings.HighlightChangedValues = XElementSerializer.ToBool(e)); - XElementSerializer.TryRead(display, nameof(settings.ShowCommentFloat), e => settings.ShowCommentFloat = XElementSerializer.ToBool(e)); - XElementSerializer.TryRead(display, nameof(settings.ShowCommentInteger), e => settings.ShowCommentInteger = XElementSerializer.ToBool(e)); - XElementSerializer.TryRead(display, nameof(settings.ShowCommentPointer), e => settings.ShowCommentPointer = XElementSerializer.ToBool(e)); - XElementSerializer.TryRead(display, nameof(settings.ShowCommentRtti), e => settings.ShowCommentRtti = XElementSerializer.ToBool(e)); - XElementSerializer.TryRead(display, nameof(settings.ShowCommentSymbol), e => settings.ShowCommentSymbol = XElementSerializer.ToBool(e)); - XElementSerializer.TryRead(display, nameof(settings.ShowCommentString), e => settings.ShowCommentString = XElementSerializer.ToBool(e)); - XElementSerializer.TryRead(display, nameof(settings.ShowCommentPluginInfo), e => settings.ShowCommentPluginInfo = XElementSerializer.ToBool(e)); - } - var colors = root?.Element(XmlColorsElement); - if (colors != null) - { - XElementSerializer.TryRead(colors, nameof(settings.BackgroundColor), e => settings.BackgroundColor = XElementSerializer.ToColor(e)); - XElementSerializer.TryRead(colors, nameof(settings.SelectedColor), e => settings.SelectedColor = XElementSerializer.ToColor(e)); - XElementSerializer.TryRead(colors, nameof(settings.HiddenColor), e => settings.HiddenColor = XElementSerializer.ToColor(e)); - XElementSerializer.TryRead(colors, nameof(settings.OffsetColor), e => settings.OffsetColor = XElementSerializer.ToColor(e)); - XElementSerializer.TryRead(colors, nameof(settings.AddressColor), e => settings.AddressColor = XElementSerializer.ToColor(e)); - XElementSerializer.TryRead(colors, nameof(settings.HexColor), e => settings.HexColor = XElementSerializer.ToColor(e)); - XElementSerializer.TryRead(colors, nameof(settings.TypeColor), e => settings.TypeColor = XElementSerializer.ToColor(e)); - XElementSerializer.TryRead(colors, nameof(settings.NameColor), e => settings.NameColor = XElementSerializer.ToColor(e)); - XElementSerializer.TryRead(colors, nameof(settings.ValueColor), e => settings.ValueColor = XElementSerializer.ToColor(e)); - XElementSerializer.TryRead(colors, nameof(settings.IndexColor), e => settings.IndexColor = XElementSerializer.ToColor(e)); - XElementSerializer.TryRead(colors, nameof(settings.CommentColor), e => settings.CommentColor = XElementSerializer.ToColor(e)); - XElementSerializer.TryRead(colors, nameof(settings.TextColor), e => settings.TextColor = XElementSerializer.ToColor(e)); - XElementSerializer.TryRead(colors, nameof(settings.VTableColor), e => settings.VTableColor = XElementSerializer.ToColor(e)); - } - var customData = root?.Element(XmlCustomDataElement); - if (customData != null) - { - settings.CustomData.Deserialize(customData); - } + settings.CustomData.Deserialize(customData); } } catch { - + // ignored } return settings; @@ -97,56 +95,55 @@ public static void Save(Settings settings) var path = Path.Combine(PathUtil.SettingsFolderPath, Constants.SettingsFile); - using (var sw = new StreamWriter(path)) - { - var document = new XDocument( - new XComment($"{Constants.ApplicationName} {Constants.ApplicationVersion} by {Constants.Author}"), - new XComment($"Website: {Constants.HomepageUrl}"), + using var sw = new StreamWriter(path); + + var document = new XDocument( + new XComment($"{Constants.ApplicationName} {Constants.ApplicationVersion} by {Constants.Author}"), + new XComment($"Website: {Constants.HomepageUrl}"), + new XElement( + XmlRootElement, new XElement( - XmlRootElement, - new XElement( - XmlGeneralElement, - XElementSerializer.ToXml(nameof(settings.LastProcess), settings.LastProcess), - XElementSerializer.ToXml(nameof(settings.StayOnTop), settings.StayOnTop), - XElementSerializer.ToXml(nameof(settings.RunAsAdmin), settings.RunAsAdmin), - XElementSerializer.ToXml(nameof(settings.RandomizeWindowTitle), settings.RandomizeWindowTitle) - ), - new XElement( - XmlDisplayElement, - XElementSerializer.ToXml(nameof(settings.ShowNodeAddress), settings.ShowNodeAddress), - XElementSerializer.ToXml(nameof(settings.ShowNodeOffset), settings.ShowNodeOffset), - XElementSerializer.ToXml(nameof(settings.ShowNodeText), settings.ShowNodeText), - XElementSerializer.ToXml(nameof(settings.HighlightChangedValues), settings.HighlightChangedValues), - XElementSerializer.ToXml(nameof(settings.ShowCommentFloat), settings.ShowCommentFloat), - XElementSerializer.ToXml(nameof(settings.ShowCommentInteger), settings.ShowCommentInteger), - XElementSerializer.ToXml(nameof(settings.ShowCommentPointer), settings.ShowCommentPointer), - XElementSerializer.ToXml(nameof(settings.ShowCommentRtti), settings.ShowCommentRtti), - XElementSerializer.ToXml(nameof(settings.ShowCommentSymbol), settings.ShowCommentSymbol), - XElementSerializer.ToXml(nameof(settings.ShowCommentString), settings.ShowCommentString), - XElementSerializer.ToXml(nameof(settings.ShowCommentPluginInfo), settings.ShowCommentPluginInfo) - ), - new XElement( - XmlColorsElement, - XElementSerializer.ToXml(nameof(settings.BackgroundColor), settings.BackgroundColor), - XElementSerializer.ToXml(nameof(settings.SelectedColor), settings.SelectedColor), - XElementSerializer.ToXml(nameof(settings.HiddenColor), settings.HiddenColor), - XElementSerializer.ToXml(nameof(settings.OffsetColor), settings.OffsetColor), - XElementSerializer.ToXml(nameof(settings.AddressColor), settings.AddressColor), - XElementSerializer.ToXml(nameof(settings.HexColor), settings.HexColor), - XElementSerializer.ToXml(nameof(settings.TypeColor), settings.TypeColor), - XElementSerializer.ToXml(nameof(settings.NameColor), settings.NameColor), - XElementSerializer.ToXml(nameof(settings.ValueColor), settings.ValueColor), - XElementSerializer.ToXml(nameof(settings.IndexColor), settings.IndexColor), - XElementSerializer.ToXml(nameof(settings.CommentColor), settings.CommentColor), - XElementSerializer.ToXml(nameof(settings.TextColor), settings.TextColor), - XElementSerializer.ToXml(nameof(settings.VTableColor), settings.VTableColor) - ), - settings.CustomData.Serialize(XmlCustomDataElement) - ) - ); - - document.Save(sw); - } + XmlGeneralElement, + XElementSerializer.ToXml(nameof(settings.LastProcess), settings.LastProcess), + XElementSerializer.ToXml(nameof(settings.StayOnTop), settings.StayOnTop), + XElementSerializer.ToXml(nameof(settings.RunAsAdmin), settings.RunAsAdmin), + XElementSerializer.ToXml(nameof(settings.RandomizeWindowTitle), settings.RandomizeWindowTitle) + ), + new XElement( + XmlDisplayElement, + XElementSerializer.ToXml(nameof(settings.ShowNodeAddress), settings.ShowNodeAddress), + XElementSerializer.ToXml(nameof(settings.ShowNodeOffset), settings.ShowNodeOffset), + XElementSerializer.ToXml(nameof(settings.ShowNodeText), settings.ShowNodeText), + XElementSerializer.ToXml(nameof(settings.HighlightChangedValues), settings.HighlightChangedValues), + XElementSerializer.ToXml(nameof(settings.ShowCommentFloat), settings.ShowCommentFloat), + XElementSerializer.ToXml(nameof(settings.ShowCommentInteger), settings.ShowCommentInteger), + XElementSerializer.ToXml(nameof(settings.ShowCommentPointer), settings.ShowCommentPointer), + XElementSerializer.ToXml(nameof(settings.ShowCommentRtti), settings.ShowCommentRtti), + XElementSerializer.ToXml(nameof(settings.ShowCommentSymbol), settings.ShowCommentSymbol), + XElementSerializer.ToXml(nameof(settings.ShowCommentString), settings.ShowCommentString), + XElementSerializer.ToXml(nameof(settings.ShowCommentPluginInfo), settings.ShowCommentPluginInfo) + ), + new XElement( + XmlColorsElement, + XElementSerializer.ToXml(nameof(settings.BackgroundColor), settings.BackgroundColor), + XElementSerializer.ToXml(nameof(settings.SelectedColor), settings.SelectedColor), + XElementSerializer.ToXml(nameof(settings.HiddenColor), settings.HiddenColor), + XElementSerializer.ToXml(nameof(settings.OffsetColor), settings.OffsetColor), + XElementSerializer.ToXml(nameof(settings.AddressColor), settings.AddressColor), + XElementSerializer.ToXml(nameof(settings.HexColor), settings.HexColor), + XElementSerializer.ToXml(nameof(settings.TypeColor), settings.TypeColor), + XElementSerializer.ToXml(nameof(settings.NameColor), settings.NameColor), + XElementSerializer.ToXml(nameof(settings.ValueColor), settings.ValueColor), + XElementSerializer.ToXml(nameof(settings.IndexColor), settings.IndexColor), + XElementSerializer.ToXml(nameof(settings.CommentColor), settings.CommentColor), + XElementSerializer.ToXml(nameof(settings.TextColor), settings.TextColor), + XElementSerializer.ToXml(nameof(settings.VTableColor), settings.VTableColor) + ), + settings.CustomData.Serialize(XmlCustomDataElement) + ) + ); + + document.Save(sw); } #endregion @@ -160,9 +157,9 @@ private static void EnsureSettingsDirectoryAvailable() Directory.CreateDirectory(PathUtil.SettingsFolderPath); } } - catch (Exception) + catch { - + // ignored } } } diff --git a/ReClass.NET/Util/Util.cs b/ReClass.NET/Util/Util.cs index 15859b6d..a2f79378 100644 --- a/ReClass.NET/Util/Util.cs +++ b/ReClass.NET/Util/Util.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Diagnostics.Contracts; using System.Linq; @@ -33,7 +33,7 @@ public static T Max(T item1, T item2, Func keySelector) where U : IC return Max(item1, item2, keySelector, Comparer.Default); } - public static T Max(T item1, T item2, Func keySelector, IComparer comparer) + public static T1 Max(T1 item1, T1 item2, Func keySelector, IComparer comparer) { Contract.Requires(keySelector != null); Contract.Requires(comparer != null); @@ -55,8 +55,8 @@ public static void Swap(ref T lhs, ref T rhs) //thx again stack overflow https://stackoverflow.com/a/1344242 public static string RandomString(int length) { - const string chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"; - return new string(Enumerable.Repeat(chars, length) + const string Chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"; + return new string(Enumerable.Repeat(Chars, length) .Select(s => s[Program.GlobalRandom.Next(s.Length)]).ToArray()); } } diff --git a/ReClass.NET/Util/WinUtil.cs b/ReClass.NET/Util/WinUtil.cs index 8c8fbaf9..8173c315 100644 --- a/ReClass.NET/Util/WinUtil.cs +++ b/ReClass.NET/Util/WinUtil.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Diagnostics; using System.Diagnostics.Contracts; using System.Security.Principal; @@ -43,21 +43,19 @@ static WinUtil() try { - using (var rk = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Microsoft\Windows NT\CurrentVersion", false)) + using var rk = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Microsoft\Windows NT\CurrentVersion", false); + if (rk != null) { - if (rk != null) + var str = rk.GetValue("CurrentMajorVersionNumber", string.Empty)?.ToString(); + if (uint.TryParse(str, out var u)) { - var str = rk.GetValue("CurrentMajorVersionNumber", string.Empty)?.ToString(); - if (uint.TryParse(str, out var u)) - { - IsAtLeastWindows10 = u >= 10; - } + IsAtLeastWindows10 = u >= 10; } } } catch { - + // ignored } } From bc67ff6f36f81ac4fdb61d25b34503dde0522880 Mon Sep 17 00:00:00 2001 From: KN4CK3R Date: Sun, 5 Jul 2020 14:45:23 +0200 Subject: [PATCH 134/223] Fixed wrong byte size. --- ReClass.NET/MemoryScanner/Comparer/StringMemoryComparer.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ReClass.NET/MemoryScanner/Comparer/StringMemoryComparer.cs b/ReClass.NET/MemoryScanner/Comparer/StringMemoryComparer.cs index 264229d0..2e457306 100644 --- a/ReClass.NET/MemoryScanner/Comparer/StringMemoryComparer.cs +++ b/ReClass.NET/MemoryScanner/Comparer/StringMemoryComparer.cs @@ -25,7 +25,7 @@ public bool Compare(byte[] data, int index, out ScanResult result) { result = null; - var value = Encoding.GetString(data, index, Value.Length); + var value = Encoding.GetString(data, index, ValueSize); if (!Value.Equals(value, CaseSensitive ? StringComparison.InvariantCulture : StringComparison.InvariantCultureIgnoreCase)) { From 01239e5b3523046cc5aad496c3a35f2890519403 Mon Sep 17 00:00:00 2001 From: KN4CK3R Date: Sun, 5 Jul 2020 19:18:31 +0200 Subject: [PATCH 135/223] Extracted interface IScannerWorker. --- ReClass.NET/MemoryScanner/IScannerWorker.cs | 29 +++++++++++++++++++++ ReClass.NET/MemoryScanner/ScannerWorker.cs | 20 ++------------ 2 files changed, 31 insertions(+), 18 deletions(-) create mode 100644 ReClass.NET/MemoryScanner/IScannerWorker.cs diff --git a/ReClass.NET/MemoryScanner/IScannerWorker.cs b/ReClass.NET/MemoryScanner/IScannerWorker.cs new file mode 100644 index 00000000..494c5874 --- /dev/null +++ b/ReClass.NET/MemoryScanner/IScannerWorker.cs @@ -0,0 +1,29 @@ +using System.Collections.Generic; +using System.Threading; +using ReClassNET.MemoryScanner.Comparer; + +namespace ReClassNET.MemoryScanner +{ + internal interface IScannerWorker + { + /// + /// Uses the to scan the byte array for results. + /// + /// The data to scan. + /// The length of the parameter. + /// The to stop the scan. + /// An enumeration of all s. + IList Search(byte[] data, int count, CancellationToken ct); + + /// + /// Uses the to scan the byte array for results. + /// The comparer uses the provided previous results to compare to the current value. + /// + /// The data to scan. + /// The length of the parameter. + /// The previous results to use. + /// The to stop the scan. + /// An enumeration of all s. + IList Search(byte[] data, int count, IEnumerable previousResults, CancellationToken ct); + } +} diff --git a/ReClass.NET/MemoryScanner/ScannerWorker.cs b/ReClass.NET/MemoryScanner/ScannerWorker.cs index b83dc714..4da20b68 100644 --- a/ReClass.NET/MemoryScanner/ScannerWorker.cs +++ b/ReClass.NET/MemoryScanner/ScannerWorker.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Diagnostics.Contracts; using System.Threading; @@ -6,7 +6,7 @@ namespace ReClassNET.MemoryScanner { - internal class ScannerWorker + internal class ScannerWorker : IScannerWorker { private readonly ScanSettings settings; private readonly IScanComparer comparer; @@ -20,13 +20,6 @@ public ScannerWorker(ScanSettings settings, IScanComparer comparer) this.comparer = comparer; } - /// - /// Uses the to scan the byte array for results. - /// - /// The data to scan. - /// The length of the parameter. - /// The to stop the scan. - /// An enumeration of all s. public IList Search(byte[] data, int count, CancellationToken ct) { Contract.Requires(data != null); @@ -53,15 +46,6 @@ public IList Search(byte[] data, int count, CancellationToken ct) return results; } - /// - /// Uses the to scan the byte array for results. - /// The comparer uses the provided previous results to compare to the current value. - /// - /// The data to scan. - /// The length of the parameter. - /// The previous results to use. - /// The to stop the scan. - /// An enumeration of all s. public IList Search(byte[] data, int count, IEnumerable previousResults, CancellationToken ct) { Contract.Requires(data != null); From 8b091bb753593bb338614a4af03bda6a2d75a514 Mon Sep 17 00:00:00 2001 From: KN4CK3R Date: Sun, 5 Jul 2020 19:23:39 +0200 Subject: [PATCH 136/223] Extracted ISimpleScanComparer interface. --- .../Comparer/ArrayOfBytesMemoryComparer.cs | 4 +- .../Comparer/ByteMemoryComparer.cs | 2 +- .../Comparer/DoubleMemoryComparer.cs | 2 +- .../Comparer/FloatMemoryComparer.cs | 4 +- .../MemoryScanner/Comparer/IScanComparer.cs | 57 ------------------- .../Comparer/ISimpleScanComparer.cs | 27 +++++++++ .../Comparer/IntegerMemoryComparer.cs | 2 +- .../Comparer/LongMemoryComparer.cs | 2 +- .../Comparer/ShortMemoryComparer.cs | 2 +- .../Comparer/StringMemoryComparer.cs | 2 +- ReClass.NET/MemoryScanner/Scanner.cs | 14 ++++- ReClass.NET/MemoryScanner/ScannerContext.cs | 11 ++-- ReClass.NET/MemoryScanner/ScannerWorker.cs | 4 +- ReClass.NET/ReClass.NET.csproj | 4 +- 14 files changed, 58 insertions(+), 79 deletions(-) create mode 100644 ReClass.NET/MemoryScanner/Comparer/ISimpleScanComparer.cs diff --git a/ReClass.NET/MemoryScanner/Comparer/ArrayOfBytesMemoryComparer.cs b/ReClass.NET/MemoryScanner/Comparer/ArrayOfBytesMemoryComparer.cs index e7e2bcbc..3e377f25 100644 --- a/ReClass.NET/MemoryScanner/Comparer/ArrayOfBytesMemoryComparer.cs +++ b/ReClass.NET/MemoryScanner/Comparer/ArrayOfBytesMemoryComparer.cs @@ -1,10 +1,10 @@ -using System; +using System; using System.Diagnostics; using System.Diagnostics.Contracts; namespace ReClassNET.MemoryScanner.Comparer { - public class ArrayOfBytesMemoryComparer : IScanComparer + public class ArrayOfBytesMemoryComparer : ISimpleScanComparer { public ScanCompareType CompareType => ScanCompareType.Equal; public int ValueSize => bytePattern?.Length ?? byteArray.Length; diff --git a/ReClass.NET/MemoryScanner/Comparer/ByteMemoryComparer.cs b/ReClass.NET/MemoryScanner/Comparer/ByteMemoryComparer.cs index 2f094a8b..0c376e9a 100644 --- a/ReClass.NET/MemoryScanner/Comparer/ByteMemoryComparer.cs +++ b/ReClass.NET/MemoryScanner/Comparer/ByteMemoryComparer.cs @@ -3,7 +3,7 @@ namespace ReClassNET.MemoryScanner.Comparer { - public class ByteMemoryComparer : IScanComparer + public class ByteMemoryComparer : ISimpleScanComparer { public ScanCompareType CompareType { get; } public byte Value1 { get; } diff --git a/ReClass.NET/MemoryScanner/Comparer/DoubleMemoryComparer.cs b/ReClass.NET/MemoryScanner/Comparer/DoubleMemoryComparer.cs index ec0b33d3..1a7c7dc5 100644 --- a/ReClass.NET/MemoryScanner/Comparer/DoubleMemoryComparer.cs +++ b/ReClass.NET/MemoryScanner/Comparer/DoubleMemoryComparer.cs @@ -4,7 +4,7 @@ namespace ReClassNET.MemoryScanner.Comparer { - public class DoubleMemoryComparer : IScanComparer + public class DoubleMemoryComparer : ISimpleScanComparer { public ScanCompareType CompareType { get; } public ScanRoundMode RoundType { get; } diff --git a/ReClass.NET/MemoryScanner/Comparer/FloatMemoryComparer.cs b/ReClass.NET/MemoryScanner/Comparer/FloatMemoryComparer.cs index 57aa6b9d..3e529422 100644 --- a/ReClass.NET/MemoryScanner/Comparer/FloatMemoryComparer.cs +++ b/ReClass.NET/MemoryScanner/Comparer/FloatMemoryComparer.cs @@ -1,10 +1,10 @@ -using System; +using System; using System.Diagnostics; using ReClassNET.Extensions; namespace ReClassNET.MemoryScanner.Comparer { - public class FloatMemoryComparer : IScanComparer + public class FloatMemoryComparer : ISimpleScanComparer { public ScanCompareType CompareType { get; } public ScanRoundMode RoundType { get; } diff --git a/ReClass.NET/MemoryScanner/Comparer/IScanComparer.cs b/ReClass.NET/MemoryScanner/Comparer/IScanComparer.cs index 35be65f5..4f3c2e4f 100644 --- a/ReClass.NET/MemoryScanner/Comparer/IScanComparer.cs +++ b/ReClass.NET/MemoryScanner/Comparer/IScanComparer.cs @@ -1,64 +1,7 @@ -using System; -using System.Diagnostics.Contracts; - namespace ReClassNET.MemoryScanner.Comparer { - [ContractClass(typeof(ScanComparerContract))] public interface IScanComparer { ScanCompareType CompareType { get; } - int ValueSize { get; } - - /// - /// Compares the data at the provided index to the current . - /// - /// The byte array to be compared. - /// The index into the byte array. - /// [out] The scan result if the matched. - /// True if matched. - bool Compare(byte[] data, int index, out ScanResult result); - - /// - /// Compares the data at the provided index to the current . - /// The previous results may be used. - /// - /// The byte array to be compared. - /// The index into the byte array. - /// Scan result to be compared. - /// [out] The scan result if the matched. - /// True if matched. - bool Compare(byte[] data, int index, ScanResult previous, out ScanResult result); - } - - [ContractClassFor(typeof(IScanComparer))] - internal abstract class ScanComparerContract : IScanComparer - { - public ScanCompareType CompareType => throw new NotImplementedException(); - - public int ValueSize - { - get - { - Contract.Ensures(ValueSize > 0); - - throw new NotImplementedException(); - } - } - public bool Compare(byte[] data, int index, out ScanResult result) - { - Contract.Requires(data != null); - Contract.Requires(index >= 0); - - throw new NotImplementedException(); - } - - public bool Compare(byte[] data, int index, ScanResult previous, out ScanResult result) - { - Contract.Requires(data != null); - Contract.Requires(index >= 0); - Contract.Requires(previous != null); - - throw new NotImplementedException(); - } } } diff --git a/ReClass.NET/MemoryScanner/Comparer/ISimpleScanComparer.cs b/ReClass.NET/MemoryScanner/Comparer/ISimpleScanComparer.cs new file mode 100644 index 00000000..a54b2f70 --- /dev/null +++ b/ReClass.NET/MemoryScanner/Comparer/ISimpleScanComparer.cs @@ -0,0 +1,27 @@ +namespace ReClassNET.MemoryScanner.Comparer +{ + public interface ISimpleScanComparer : IScanComparer + { + int ValueSize { get; } + + /// + /// Compares the data at the provided index to the current . + /// + /// The byte array to be compared. + /// The index into the byte array. + /// [out] The scan result if the matched. + /// True if matched. + bool Compare(byte[] data, int index, out ScanResult result); + + /// + /// Compares the data at the provided index to the current . + /// The previous results may be used. + /// + /// The byte array to be compared. + /// The index into the byte array. + /// Scan result to be compared. + /// [out] The scan result if the matched. + /// True if matched. + bool Compare(byte[] data, int index, ScanResult previous, out ScanResult result); + } +} \ No newline at end of file diff --git a/ReClass.NET/MemoryScanner/Comparer/IntegerMemoryComparer.cs b/ReClass.NET/MemoryScanner/Comparer/IntegerMemoryComparer.cs index b6c68794..a55e074e 100644 --- a/ReClass.NET/MemoryScanner/Comparer/IntegerMemoryComparer.cs +++ b/ReClass.NET/MemoryScanner/Comparer/IntegerMemoryComparer.cs @@ -3,7 +3,7 @@ namespace ReClassNET.MemoryScanner.Comparer { - public class IntegerMemoryComparer : IScanComparer + public class IntegerMemoryComparer : ISimpleScanComparer { public ScanCompareType CompareType { get; } public int Value1 { get; } diff --git a/ReClass.NET/MemoryScanner/Comparer/LongMemoryComparer.cs b/ReClass.NET/MemoryScanner/Comparer/LongMemoryComparer.cs index 6a161fb5..75c15945 100644 --- a/ReClass.NET/MemoryScanner/Comparer/LongMemoryComparer.cs +++ b/ReClass.NET/MemoryScanner/Comparer/LongMemoryComparer.cs @@ -3,7 +3,7 @@ namespace ReClassNET.MemoryScanner.Comparer { - public class LongMemoryComparer : IScanComparer + public class LongMemoryComparer : ISimpleScanComparer { public ScanCompareType CompareType { get; } public long Value1 { get; } diff --git a/ReClass.NET/MemoryScanner/Comparer/ShortMemoryComparer.cs b/ReClass.NET/MemoryScanner/Comparer/ShortMemoryComparer.cs index 0b35c49f..1754ff23 100644 --- a/ReClass.NET/MemoryScanner/Comparer/ShortMemoryComparer.cs +++ b/ReClass.NET/MemoryScanner/Comparer/ShortMemoryComparer.cs @@ -3,7 +3,7 @@ namespace ReClassNET.MemoryScanner.Comparer { - public class ShortMemoryComparer : IScanComparer + public class ShortMemoryComparer : ISimpleScanComparer { public ScanCompareType CompareType { get; } public short Value1 { get; } diff --git a/ReClass.NET/MemoryScanner/Comparer/StringMemoryComparer.cs b/ReClass.NET/MemoryScanner/Comparer/StringMemoryComparer.cs index 2e457306..c6875aba 100644 --- a/ReClass.NET/MemoryScanner/Comparer/StringMemoryComparer.cs +++ b/ReClass.NET/MemoryScanner/Comparer/StringMemoryComparer.cs @@ -5,7 +5,7 @@ namespace ReClassNET.MemoryScanner.Comparer { - public class StringMemoryComparer : IScanComparer + public class StringMemoryComparer : ISimpleScanComparer { public ScanCompareType CompareType => ScanCompareType.Equal; public bool CaseSensitive { get; } diff --git a/ReClass.NET/MemoryScanner/Scanner.cs b/ReClass.NET/MemoryScanner/Scanner.cs index 3220e46d..fad4b00d 100644 --- a/ReClass.NET/MemoryScanner/Scanner.cs +++ b/ReClass.NET/MemoryScanner/Scanner.cs @@ -216,7 +216,7 @@ private Task FirstScan(IScanComparer comparer, IProgress progress, Ca var result = Parallel.ForEach( regions, // Sections get grouped by the framework to balance the workers. - () => new ScannerContext(Settings, comparer, initialBufferSize), // Create a new context for every worker (thread). + () => new ScannerContext(CreateWorker(Settings, comparer), initialBufferSize), // Create a new context for every worker (thread). (s, state, _, context) => { if (!ct.IsCancellationRequested) @@ -295,7 +295,7 @@ private Task NextScan(IScanComparer comparer, IProgress progress, Can { var result = Parallel.ForEach( CurrentStore.GetResultBlocks(), - () => new ScannerContext(Settings, comparer, 0), + () => new ScannerContext(CreateWorker(Settings, comparer), 0), (b, state, _, context) => { if (!ct.IsCancellationRequested) @@ -397,5 +397,15 @@ private static ScanResultBlock CreateResultBlock(IReadOnlyList resul ); return block; } + + private static IScannerWorker CreateWorker(ScanSettings settings, IScanComparer comparer) + { + if (comparer is ISimpleScanComparer simpleScanComparer) + { + return new ScannerWorker(settings, simpleScanComparer); + } + + throw new Exception(); + } } } diff --git a/ReClass.NET/MemoryScanner/ScannerContext.cs b/ReClass.NET/MemoryScanner/ScannerContext.cs index 6b6f20cc..55caffc1 100644 --- a/ReClass.NET/MemoryScanner/ScannerContext.cs +++ b/ReClass.NET/MemoryScanner/ScannerContext.cs @@ -1,24 +1,21 @@ -using System.Diagnostics.Contracts; -using ReClassNET.MemoryScanner.Comparer; +using System.Diagnostics.Contracts; namespace ReClassNET.MemoryScanner { internal class ScannerContext { public byte[] Buffer { get; private set; } - public ScannerWorker Worker { get; } + public IScannerWorker Worker { get; } - public ScannerContext(ScanSettings settings, IScanComparer comparer, int bufferSize) + public ScannerContext(IScannerWorker worker, int bufferSize) { - Contract.Requires(settings != null); - Contract.Requires(comparer != null); Contract.Requires(bufferSize >= 0); Contract.Ensures(Buffer != null); Contract.Ensures(Worker != null); EnsureBufferSize(bufferSize); - Worker = new ScannerWorker(settings, comparer); + Worker = worker; } public void EnsureBufferSize(int size) diff --git a/ReClass.NET/MemoryScanner/ScannerWorker.cs b/ReClass.NET/MemoryScanner/ScannerWorker.cs index 4da20b68..3a41dd78 100644 --- a/ReClass.NET/MemoryScanner/ScannerWorker.cs +++ b/ReClass.NET/MemoryScanner/ScannerWorker.cs @@ -9,9 +9,9 @@ namespace ReClassNET.MemoryScanner internal class ScannerWorker : IScannerWorker { private readonly ScanSettings settings; - private readonly IScanComparer comparer; + private readonly ISimpleScanComparer comparer; - public ScannerWorker(ScanSettings settings, IScanComparer comparer) + public ScannerWorker(ScanSettings settings, ISimpleScanComparer comparer) { Contract.Requires(settings != null); Contract.Requires(comparer != null); diff --git a/ReClass.NET/ReClass.NET.csproj b/ReClass.NET/ReClass.NET.csproj index 5b3f1352..884119f0 100644 --- a/ReClass.NET/ReClass.NET.csproj +++ b/ReClass.NET/ReClass.NET.csproj @@ -1,4 +1,4 @@ - + @@ -244,10 +244,12 @@ + + From 4bc3d72e3aa1e1a79055d46b94bd46074b0a694e Mon Sep 17 00:00:00 2001 From: KN4CK3R Date: Sun, 5 Jul 2020 19:27:01 +0200 Subject: [PATCH 137/223] Added ScanResult.ValueSize. --- ReClass.NET/MemoryScanner/ScanResult.cs | 18 ++++++++++++++++++ ReClass.NET/MemoryScanner/Scanner.cs | 16 +++++++++------- 2 files changed, 27 insertions(+), 7 deletions(-) diff --git a/ReClass.NET/MemoryScanner/ScanResult.cs b/ReClass.NET/MemoryScanner/ScanResult.cs index 1684cc28..238f994b 100644 --- a/ReClass.NET/MemoryScanner/ScanResult.cs +++ b/ReClass.NET/MemoryScanner/ScanResult.cs @@ -11,6 +11,8 @@ public abstract class ScanResult public IntPtr Address { get; set; } + public abstract int ValueSize { get; } + public abstract ScanResult Clone(); } @@ -18,6 +20,8 @@ public class ByteScanResult : ScanResult, IEquatable { public override ScanValueType ValueType => ScanValueType.Byte; + public override int ValueSize => sizeof(byte); + public byte Value { get; } public ByteScanResult(byte value) @@ -50,6 +54,8 @@ public class ShortScanResult : ScanResult, IEquatable { public override ScanValueType ValueType => ScanValueType.Short; + public override int ValueSize => sizeof(short); + public short Value { get; } public ShortScanResult(short value) @@ -82,6 +88,8 @@ public class IntegerScanResult : ScanResult, IEquatable { public override ScanValueType ValueType => ScanValueType.Integer; + public override int ValueSize => sizeof(int); + public int Value { get; } public IntegerScanResult(int value) @@ -114,6 +122,8 @@ public class LongScanResult : ScanResult, IEquatable { public override ScanValueType ValueType => ScanValueType.Long; + public override int ValueSize => sizeof(long); + public long Value { get; } public LongScanResult(long value) @@ -146,6 +156,8 @@ public class FloatScanResult : ScanResult, IEquatable { public override ScanValueType ValueType => ScanValueType.Float; + public override int ValueSize => sizeof(float); + public float Value { get; } public FloatScanResult(float value) @@ -178,6 +190,8 @@ public class DoubleScanResult : ScanResult, IEquatable { public override ScanValueType ValueType => ScanValueType.Double; + public override int ValueSize => sizeof(double); + public double Value { get; } public DoubleScanResult(double value) @@ -210,6 +224,8 @@ public class ArrayOfBytesScanResult : ScanResult, IEquatable ScanValueType.ArrayOfBytes; + public override int ValueSize => Value.Length; + public byte[] Value { get; } public ArrayOfBytesScanResult(byte[] value) @@ -244,6 +260,8 @@ public class StringScanResult : ScanResult, IEquatable { public override ScanValueType ValueType => ScanValueType.String; + public override int ValueSize => Value.Length; + public string Value { get; } public Encoding Encoding { get; } diff --git a/ReClass.NET/MemoryScanner/Scanner.cs b/ReClass.NET/MemoryScanner/Scanner.cs index fad4b00d..167f3fee 100644 --- a/ReClass.NET/MemoryScanner/Scanner.cs +++ b/ReClass.NET/MemoryScanner/Scanner.cs @@ -244,7 +244,7 @@ private Task FirstScan(IScanComparer comparer, IProgress progress, Ca .ToList(); if (results.Count > 0) { - var block = CreateResultBlock(results, start, comparer.ValueSize); + var block = CreateResultBlock(results, start); store.AddBlock(block); // Store the result block. } } @@ -309,7 +309,7 @@ private Task NextScan(IScanComparer comparer, IProgress progress, Can .ToList(); if (results.Count > 0) { - var block = CreateResultBlock(results, b.Start, comparer.ValueSize); + var block = CreateResultBlock(results, b.Start); store.AddBlock(block); } } @@ -375,16 +375,18 @@ private static List ConsolidateSections(IList
///
/// The results in this block. /// The start address of the previous block or section. - /// The size of the value type. /// The new result block. - private static ScanResultBlock CreateResultBlock(IReadOnlyList results, IntPtr previousStartAddress, int valueSize) + private static ScanResultBlock CreateResultBlock(IReadOnlyList results, IntPtr previousStartAddress) { + var firstResult = results.First(); + var lastResult = results.Last(); + // Calculate start and end address - var startAddress = results.First().Address.Add(previousStartAddress); - var endAddress = results.Last().Address.Add(previousStartAddress) + valueSize; + var startAddress = firstResult.Address.Add(previousStartAddress); + var endAddress = lastResult.Address.Add(previousStartAddress) + lastResult.ValueSize; // Adjust the offsets of the results - var firstOffset = results.First().Address; + var firstOffset = firstResult.Address; foreach (var result in results) { result.Address = result.Address.Sub(firstOffset); From 30f5320c5f77fe76a5eec4dfcedc570c392298d1 Mon Sep 17 00:00:00 2001 From: KN4CK3R Date: Sun, 5 Jul 2020 19:29:12 +0200 Subject: [PATCH 138/223] Renamed class. --- ReClass.NET/MemoryScanner/Scanner.cs | 3 ++- .../{ScannerWorker.cs => SimpleScannerWorker.cs} | 4 ++-- ReClass.NET/ReClass.NET.csproj | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) rename ReClass.NET/MemoryScanner/{ScannerWorker.cs => SimpleScannerWorker.cs} (92%) diff --git a/ReClass.NET/MemoryScanner/Scanner.cs b/ReClass.NET/MemoryScanner/Scanner.cs index 167f3fee..ad91adbb 100644 --- a/ReClass.NET/MemoryScanner/Scanner.cs +++ b/ReClass.NET/MemoryScanner/Scanner.cs @@ -404,7 +404,8 @@ private static IScannerWorker CreateWorker(ScanSettings settings, IScanComparer { if (comparer is ISimpleScanComparer simpleScanComparer) { - return new ScannerWorker(settings, simpleScanComparer); + return new SimpleScannerWorker(settings, simpleScanComparer); + } } throw new Exception(); diff --git a/ReClass.NET/MemoryScanner/ScannerWorker.cs b/ReClass.NET/MemoryScanner/SimpleScannerWorker.cs similarity index 92% rename from ReClass.NET/MemoryScanner/ScannerWorker.cs rename to ReClass.NET/MemoryScanner/SimpleScannerWorker.cs index 3a41dd78..3c384f5d 100644 --- a/ReClass.NET/MemoryScanner/ScannerWorker.cs +++ b/ReClass.NET/MemoryScanner/SimpleScannerWorker.cs @@ -6,12 +6,12 @@ namespace ReClassNET.MemoryScanner { - internal class ScannerWorker : IScannerWorker + internal class SimpleScannerWorker : IScannerWorker { private readonly ScanSettings settings; private readonly ISimpleScanComparer comparer; - public ScannerWorker(ScanSettings settings, ISimpleScanComparer comparer) + public SimpleScannerWorker(ScanSettings settings, ISimpleScanComparer comparer) { Contract.Requires(settings != null); Contract.Requires(comparer != null); diff --git a/ReClass.NET/ReClass.NET.csproj b/ReClass.NET/ReClass.NET.csproj index 884119f0..53ae6a15 100644 --- a/ReClass.NET/ReClass.NET.csproj +++ b/ReClass.NET/ReClass.NET.csproj @@ -254,7 +254,7 @@ - + From 0bb9d3b583c77b87e44deb67562b9144883b010f Mon Sep 17 00:00:00 2001 From: KN4CK3R Date: Sun, 5 Jul 2020 19:40:46 +0200 Subject: [PATCH 139/223] Added IComplexScanComparer. Implemented RegexStringMemoryComparer. Implemented ComplexScannerWorker. --- .../Comparer/IComplexScanComparer.cs | 26 +++++++ .../Comparer/RegexStringMemoryComparer.cs | 74 +++++++++++++++++++ .../MemoryScanner/ComplexScannerWorker.cs | 57 ++++++++++++++ ReClass.NET/MemoryScanner/ScanResult.cs | 14 ++++ ReClass.NET/MemoryScanner/Scanner.cs | 3 + ReClass.NET/ReClass.NET.csproj | 5 +- 6 files changed, 178 insertions(+), 1 deletion(-) create mode 100644 ReClass.NET/MemoryScanner/Comparer/IComplexScanComparer.cs create mode 100644 ReClass.NET/MemoryScanner/Comparer/RegexStringMemoryComparer.cs create mode 100644 ReClass.NET/MemoryScanner/ComplexScannerWorker.cs diff --git a/ReClass.NET/MemoryScanner/Comparer/IComplexScanComparer.cs b/ReClass.NET/MemoryScanner/Comparer/IComplexScanComparer.cs new file mode 100644 index 00000000..55e1cd8e --- /dev/null +++ b/ReClass.NET/MemoryScanner/Comparer/IComplexScanComparer.cs @@ -0,0 +1,26 @@ +using System.Collections.Generic; + +namespace ReClassNET.MemoryScanner.Comparer +{ + public interface IComplexScanComparer : IScanComparer + { + /// + /// Compares all data to the current . + /// + /// The byte array to be compared. + /// The index into the byte array. + /// List of matches. + IEnumerable Compare(byte[] data, int size); + + /// + /// Compares all data to the current . + /// The previous results may be used. + /// + /// The byte array to be compared. + /// The index into the byte array. + /// Scan result to be compared. + /// [out] The scan result if the matched. + /// True if matched. + bool CompareWithPrevious(byte[] data, int size, ScanResult previous, out ScanResult result); + } +} diff --git a/ReClass.NET/MemoryScanner/Comparer/RegexStringMemoryComparer.cs b/ReClass.NET/MemoryScanner/Comparer/RegexStringMemoryComparer.cs new file mode 100644 index 00000000..5163200b --- /dev/null +++ b/ReClass.NET/MemoryScanner/Comparer/RegexStringMemoryComparer.cs @@ -0,0 +1,74 @@ +using System; +using System.Collections.Generic; +using System.Text; +using System.Text.RegularExpressions; + +namespace ReClassNET.MemoryScanner.Comparer +{ + public class RegexStringMemoryComparer : IComplexScanComparer + { + public ScanCompareType CompareType => ScanCompareType.Equal; + + public Regex Pattern { get; } + + public Encoding Encoding { get; } + + public RegexStringMemoryComparer(string pattern, Encoding encoding) + { + Pattern = new Regex(pattern, RegexOptions.Singleline | RegexOptions.Compiled); + + Encoding = encoding; + } + + public IEnumerable Compare(byte[] data, int size) + { + var buffer = Encoding.GetString(data, 0, size); + var bufferArray = buffer.ToCharArray(); + + var lastIndex = 0; + var lastOffset = 0; + + var match = Pattern.Match(buffer); + while (match.Success) + { + var byteOffset = Encoding.GetByteCount(bufferArray, lastIndex, match.Index) + lastOffset; + + lastIndex = match.Index; + lastOffset = byteOffset; + + yield return new RegexStringScanResult(match.Value, Encoding) + { + Address = (IntPtr)byteOffset + }; + + match = match.NextMatch(); + } + } + + public bool CompareWithPrevious(byte[] data, int size, ScanResult previous, out ScanResult result) + { + result = null; + + var byteOffset = previous.Address.ToInt32(); + if (byteOffset >= size) + { + return false; + } + + var buffer = Encoding.GetString(data, byteOffset, size - byteOffset); + + var match = Pattern.Match(buffer); + if (!match.Success) + { + return false; + } + + result = new RegexStringScanResult(match.Value, Encoding) + { + Address = (IntPtr)byteOffset + }; + + return true; + } + } +} diff --git a/ReClass.NET/MemoryScanner/ComplexScannerWorker.cs b/ReClass.NET/MemoryScanner/ComplexScannerWorker.cs new file mode 100644 index 00000000..d7299c5d --- /dev/null +++ b/ReClass.NET/MemoryScanner/ComplexScannerWorker.cs @@ -0,0 +1,57 @@ +using System.Collections.Generic; +using System.Threading; +using ReClassNET.MemoryScanner.Comparer; + +namespace ReClassNET.MemoryScanner +{ + internal class ComplexScannerWorker : IScannerWorker + { + private readonly ScanSettings settings; + private readonly IComplexScanComparer comparer; + + public ComplexScannerWorker(ScanSettings settings, IComplexScanComparer comparer) + { + this.settings = settings; + this.comparer = comparer; + } + + public IList Search(byte[] data, int count, CancellationToken ct) + { + var results = new List(); + + foreach (var result in comparer.Compare(data, count)) + { + results.Add(result); + + if (ct.IsCancellationRequested) + { + break; + } + } + + return results; + } + + public IList Search(byte[] data, int count, IEnumerable previousResults, CancellationToken ct) + { + var results = new List(); + + foreach (var previousResult in previousResults) + { + if (ct.IsCancellationRequested) + { + break; + } + + if (comparer.CompareWithPrevious(data, count, previousResult, out var result)) + { + result.Address = previousResult.Address; + + results.Add(result); + } + } + + return results; + } + } +} diff --git a/ReClass.NET/MemoryScanner/ScanResult.cs b/ReClass.NET/MemoryScanner/ScanResult.cs index 238f994b..51172316 100644 --- a/ReClass.NET/MemoryScanner/ScanResult.cs +++ b/ReClass.NET/MemoryScanner/ScanResult.cs @@ -295,4 +295,18 @@ public override int GetHashCode() return Address.GetHashCode() * 19 + Value.GetHashCode() * 19 + Encoding.GetHashCode(); } } + + public class RegexStringScanResult : StringScanResult + { + public RegexStringScanResult(string value, Encoding encoding) + : base(value, encoding) + { + + } + + public override ScanResult Clone() + { + return new RegexStringScanResult(Value, Encoding) { Address = Address }; + } + } } diff --git a/ReClass.NET/MemoryScanner/Scanner.cs b/ReClass.NET/MemoryScanner/Scanner.cs index ad91adbb..99937f86 100644 --- a/ReClass.NET/MemoryScanner/Scanner.cs +++ b/ReClass.NET/MemoryScanner/Scanner.cs @@ -406,6 +406,9 @@ private static IScannerWorker CreateWorker(ScanSettings settings, IScanComparer { return new SimpleScannerWorker(settings, simpleScanComparer); } + if (comparer is IComplexScanComparer complexScanComparer) + { + return new ComplexScannerWorker(settings, complexScanComparer); } throw new Exception(); diff --git a/ReClass.NET/ReClass.NET.csproj b/ReClass.NET/ReClass.NET.csproj index 53ae6a15..7277a1f8 100644 --- a/ReClass.NET/ReClass.NET.csproj +++ b/ReClass.NET/ReClass.NET.csproj @@ -1,4 +1,4 @@ - + @@ -242,12 +242,15 @@ + + + From 30ad5e92ab6579c31a012388b5b54a0191ca2ecd Mon Sep 17 00:00:00 2001 From: KN4CK3R Date: Sun, 5 Jul 2020 20:19:56 +0200 Subject: [PATCH 140/223] Added ScanValueType.Regex. --- ReClass.NET/Forms/ScannerForm.cs | 19 ++++++++++++++----- .../Comparer/RegexStringMemoryComparer.cs | 10 ++++++++-- ReClass.NET/MemoryScanner/MemoryRecord.cs | 5 ++++- ReClass.NET/MemoryScanner/ScanResultStore.cs | 14 +++++++++++--- ReClass.NET/MemoryScanner/ScanValueType.cs | 6 ++++-- 5 files changed, 41 insertions(+), 13 deletions(-) diff --git a/ReClass.NET/Forms/ScannerForm.cs b/ReClass.NET/Forms/ScannerForm.cs index ecbd6b96..03a38858 100644 --- a/ReClass.NET/Forms/ScannerForm.cs +++ b/ReClass.NET/Forms/ScannerForm.cs @@ -456,6 +456,7 @@ private void OnCompareTypeChanged() case ScanValueType.Double: case ScanValueType.ArrayOfBytes: case ScanValueType.String: + case ScanValueType.Regex: isHexCheckBox.Checked = false; enableHexCheckBox = false; break; @@ -487,6 +488,7 @@ private void OnValueTypeChanged() case ScanValueType.Double: case ScanValueType.ArrayOfBytes: case ScanValueType.String: + case ScanValueType.Regex: isHexCheckBox.Checked = false; isHexCheckBox.Enabled = false; break; @@ -508,7 +510,7 @@ private void OnValueTypeChanged() fastScanAlignmentTextBox.Text = alignment.ToString(); floatingOptionsGroupBox.Visible = valueType == ScanValueType.Float || valueType == ScanValueType.Double; - stringOptionsGroupBox.Visible = valueType == ScanValueType.String; + stringOptionsGroupBox.Visible = valueType == ScanValueType.String || valueType == ScanValueType.Regex; } /// @@ -518,7 +520,7 @@ private void SetValidCompareTypes() { var compareType = compareTypeComboBox.SelectedValue; var valueType = valueTypeComboBox.SelectedValue; - if (valueType == ScanValueType.ArrayOfBytes || valueType == ScanValueType.String) + if (valueType == ScanValueType.ArrayOfBytes || valueType == ScanValueType.String || valueType == ScanValueType.Regex) { compareTypeComboBox.SetAvailableValues(ScanCompareType.Equal); } @@ -814,7 +816,7 @@ int CalculateSignificantDigits(string input, NumberFormatInfo numberFormat) return new ArrayOfBytesMemoryComparer(pattern); } - else if (settings.ValueType == ScanValueType.String) + else if (settings.ValueType == ScanValueType.String || settings.ValueType == ScanValueType.Regex) { if (string.IsNullOrEmpty(dualValueBox.Value1)) { @@ -822,8 +824,14 @@ int CalculateSignificantDigits(string input, NumberFormatInfo numberFormat) } var encoding = encodingUtf8RadioButton.Checked ? Encoding.UTF8 : encodingUtf16RadioButton.Checked ? Encoding.Unicode : Encoding.UTF32; - - return new StringMemoryComparer(dualValueBox.Value1, encoding, caseSensitiveCheckBox.Checked); + if (settings.ValueType == ScanValueType.String) + { + return new StringMemoryComparer(dualValueBox.Value1, encoding, caseSensitiveCheckBox.Checked); + } + else + { + return new RegexStringMemoryComparer(dualValueBox.Value1, encoding, caseSensitiveCheckBox.Checked); + } } throw new InvalidOperationException(); @@ -858,6 +866,7 @@ private static void FindWhatInteractsWithSelectedRecord(MemoryRecord record, boo size = record.ValueLength; break; case ScanValueType.String: + case ScanValueType.Regex: size = record.ValueLength; break; default: diff --git a/ReClass.NET/MemoryScanner/Comparer/RegexStringMemoryComparer.cs b/ReClass.NET/MemoryScanner/Comparer/RegexStringMemoryComparer.cs index 5163200b..7a76ede5 100644 --- a/ReClass.NET/MemoryScanner/Comparer/RegexStringMemoryComparer.cs +++ b/ReClass.NET/MemoryScanner/Comparer/RegexStringMemoryComparer.cs @@ -13,9 +13,15 @@ public class RegexStringMemoryComparer : IComplexScanComparer public Encoding Encoding { get; } - public RegexStringMemoryComparer(string pattern, Encoding encoding) + public RegexStringMemoryComparer(string pattern, Encoding encoding, bool caseSensitive) { - Pattern = new Regex(pattern, RegexOptions.Singleline | RegexOptions.Compiled); + var options = RegexOptions.Singleline | RegexOptions.Compiled; + if (!caseSensitive) + { + options |= RegexOptions.IgnoreCase; + } + + Pattern = new Regex(pattern, options); Encoding = encoding; } diff --git a/ReClass.NET/MemoryScanner/MemoryRecord.cs b/ReClass.NET/MemoryScanner/MemoryRecord.cs index ea17019d..11361d5f 100644 --- a/ReClass.NET/MemoryScanner/MemoryRecord.cs +++ b/ReClass.NET/MemoryScanner/MemoryRecord.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.ComponentModel; using System.Diagnostics.Contracts; using System.Globalization; @@ -102,6 +102,7 @@ public MemoryRecord(ScanResult result) ValueStr = FormatValue(byteData); break; case ScanValueType.String: + case ScanValueType.Regex: var strResult = (StringScanResult)result; ValueLength = strResult.Value.Length; Encoding = strResult.Encoding; @@ -177,6 +178,7 @@ public void RefreshValue(RemoteProcess process) buffer = new byte[ValueLength]; break; case ScanValueType.String: + case ScanValueType.Regex: buffer = new byte[ValueLength * Encoding.GuessByteCountPerChar()]; break; default: @@ -209,6 +211,7 @@ public void RefreshValue(RemoteProcess process) ValueStr = FormatValue(buffer); break; case ScanValueType.String: + case ScanValueType.Regex: ValueStr = FormatValue(Encoding.GetString(buffer)); break; } diff --git a/ReClass.NET/MemoryScanner/ScanResultStore.cs b/ReClass.NET/MemoryScanner/ScanResultStore.cs index 1d03daf2..e88033b8 100644 --- a/ReClass.NET/MemoryScanner/ScanResultStore.cs +++ b/ReClass.NET/MemoryScanner/ScanResultStore.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Diagnostics.Contracts; using System.IO; @@ -206,8 +206,16 @@ private ScanResult ReadScanResult(BinaryReader br) result = new ArrayOfBytesScanResult(br.ReadBytes(br.ReadInt32())); break; case ScanValueType.String: - var encoding = br.ReadInt32(); - result = new StringScanResult(br.ReadString(), encoding == 0 ? Encoding.UTF8 : encoding == 1 ? Encoding.Unicode : Encoding.UTF32); + case ScanValueType.Regex: + var encoding = br.ReadInt32() switch + { + 0 => Encoding.UTF8, + 1 => Encoding.Unicode, + _ => Encoding.UTF32 + }; + var value = br.ReadString(); + + result = valueType == ScanValueType.String ? new StringScanResult(value, encoding) : new RegexStringScanResult(value, encoding); break; default: throw new ArgumentOutOfRangeException(); diff --git a/ReClass.NET/MemoryScanner/ScanValueType.cs b/ReClass.NET/MemoryScanner/ScanValueType.cs index 7bfef7a4..8371e061 100644 --- a/ReClass.NET/MemoryScanner/ScanValueType.cs +++ b/ReClass.NET/MemoryScanner/ScanValueType.cs @@ -1,4 +1,4 @@ -using System.ComponentModel; +using System.ComponentModel; namespace ReClassNET.MemoryScanner { @@ -19,6 +19,8 @@ public enum ScanValueType [Description("Array of Bytes")] ArrayOfBytes, [Description("String")] - String + String, + [Description("Regular Expression")] + Regex } } From 14bd0e876f7a3f3521b3d87d1b2161ae7f6bb611 Mon Sep 17 00:00:00 2001 From: KN4CK3R Date: Sun, 5 Jul 2020 20:20:11 +0200 Subject: [PATCH 141/223] Removed unneeded code. --- ReClass.NET/MemoryScanner/ComplexScannerWorker.cs | 2 -- 1 file changed, 2 deletions(-) diff --git a/ReClass.NET/MemoryScanner/ComplexScannerWorker.cs b/ReClass.NET/MemoryScanner/ComplexScannerWorker.cs index d7299c5d..fab1b22c 100644 --- a/ReClass.NET/MemoryScanner/ComplexScannerWorker.cs +++ b/ReClass.NET/MemoryScanner/ComplexScannerWorker.cs @@ -45,8 +45,6 @@ public IList Search(byte[] data, int count, IEnumerable if (comparer.CompareWithPrevious(data, count, previousResult, out var result)) { - result.Address = previousResult.Address; - results.Add(result); } } From 6ba85fcdcb20a33cc380449e90126d156f80357e Mon Sep 17 00:00:00 2001 From: KN4CK3R Date: Sun, 5 Jul 2020 20:20:28 +0200 Subject: [PATCH 142/223] Use better variable name. --- ReClass.NET/MemoryScanner/Scanner.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ReClass.NET/MemoryScanner/Scanner.cs b/ReClass.NET/MemoryScanner/Scanner.cs index 99937f86..acf8532b 100644 --- a/ReClass.NET/MemoryScanner/Scanner.cs +++ b/ReClass.NET/MemoryScanner/Scanner.cs @@ -82,9 +82,9 @@ public IEnumerable GetResults() return CurrentStore.GetResultBlocks().SelectMany(rb => rb.Results.Select(r => { // Convert the block offset to a real address. - var c = r.Clone(); - c.Address = c.Address.Add(rb.Start); - return c; + var scanResult = r.Clone(); + scanResult.Address = scanResult.Address.Add(rb.Start); + return scanResult; })); } From f0e6dbdd2627fa48c1066d029032fc2b569d8215 Mon Sep 17 00:00:00 2001 From: KN4CK3R Date: Sun, 5 Jul 2020 20:21:14 +0200 Subject: [PATCH 143/223] Fixed parameter too big. --- ReClass.NET/MemoryScanner/Comparer/RegexStringMemoryComparer.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ReClass.NET/MemoryScanner/Comparer/RegexStringMemoryComparer.cs b/ReClass.NET/MemoryScanner/Comparer/RegexStringMemoryComparer.cs index 7a76ede5..efd9d448 100644 --- a/ReClass.NET/MemoryScanner/Comparer/RegexStringMemoryComparer.cs +++ b/ReClass.NET/MemoryScanner/Comparer/RegexStringMemoryComparer.cs @@ -37,7 +37,7 @@ public IEnumerable Compare(byte[] data, int size) var match = Pattern.Match(buffer); while (match.Success) { - var byteOffset = Encoding.GetByteCount(bufferArray, lastIndex, match.Index) + lastOffset; + var byteOffset = Encoding.GetByteCount(bufferArray, lastIndex, match.Index - lastIndex) + lastOffset; lastIndex = match.Index; lastOffset = byteOffset; From ff54aa658cc2ebffc302ac115032f10f926bfa45 Mon Sep 17 00:00:00 2001 From: KN4CK3R Date: Sun, 5 Jul 2020 20:21:31 +0200 Subject: [PATCH 144/223] Fixed wrong size calculation. --- ReClass.NET/MemoryScanner/ScanResult.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ReClass.NET/MemoryScanner/ScanResult.cs b/ReClass.NET/MemoryScanner/ScanResult.cs index 51172316..d46ff437 100644 --- a/ReClass.NET/MemoryScanner/ScanResult.cs +++ b/ReClass.NET/MemoryScanner/ScanResult.cs @@ -2,6 +2,7 @@ using System.Diagnostics.Contracts; using System.Linq; using System.Text; +using ReClassNET.Extensions; namespace ReClassNET.MemoryScanner { @@ -260,7 +261,7 @@ public class StringScanResult : ScanResult, IEquatable { public override ScanValueType ValueType => ScanValueType.String; - public override int ValueSize => Value.Length; + public override int ValueSize => Value.Length * Encoding.GuessByteCountPerChar(); public string Value { get; } @@ -298,6 +299,8 @@ public override int GetHashCode() public class RegexStringScanResult : StringScanResult { + public override ScanValueType ValueType => ScanValueType.Regex; + public RegexStringScanResult(string value, Encoding encoding) : base(value, encoding) { From 4df29d680e5cb16a787ffb527cb9edd47a64bc3a Mon Sep 17 00:00:00 2001 From: KN4CK3R Date: Sun, 5 Jul 2020 20:23:59 +0200 Subject: [PATCH 145/223] Use latest C# language version. --- ReClass.NET_Launcher/ReClass.NET_Launcher.csproj | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ReClass.NET_Launcher/ReClass.NET_Launcher.csproj b/ReClass.NET_Launcher/ReClass.NET_Launcher.csproj index 72eba584..87001366 100644 --- a/ReClass.NET_Launcher/ReClass.NET_Launcher.csproj +++ b/ReClass.NET_Launcher/ReClass.NET_Launcher.csproj @@ -24,6 +24,7 @@ prompt 4 false + latest AnyCPU @@ -35,6 +36,7 @@ prompt 4 false + latest ReClassNet.ico From dc723706bb8a3e38a67cec5f610727a87598c5f7 Mon Sep 17 00:00:00 2001 From: KN4CK3R Date: Wed, 15 Jul 2020 16:18:37 +0200 Subject: [PATCH 146/223] Rewrote the memory view scrolling. (Fixes #162) --- ReClass.NET/ReClass.NET.csproj | 3 - ReClass.NET/UI/MemoryViewControl.cs | 64 ++---- ReClass.NET/UI/ScrollableCustomControl.cs | 248 ---------------------- 3 files changed, 17 insertions(+), 298 deletions(-) delete mode 100644 ReClass.NET/UI/ScrollableCustomControl.cs diff --git a/ReClass.NET/ReClass.NET.csproj b/ReClass.NET/ReClass.NET.csproj index 7277a1f8..c7249340 100644 --- a/ReClass.NET/ReClass.NET.csproj +++ b/ReClass.NET/ReClass.NET.csproj @@ -505,9 +505,6 @@ - - UserControl - diff --git a/ReClass.NET/UI/MemoryViewControl.cs b/ReClass.NET/UI/MemoryViewControl.cs index 9e94db08..64b05a23 100644 --- a/ReClass.NET/UI/MemoryViewControl.cs +++ b/ReClass.NET/UI/MemoryViewControl.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Diagnostics.Contracts; using System.Drawing; @@ -11,7 +11,7 @@ namespace ReClassNET.UI { - public partial class MemoryViewControl : ScrollableCustomControl + public partial class MemoryViewControl : UserControl { /// /// Contains informations about a selected node. @@ -78,6 +78,8 @@ public MemoryViewControl() return; } + AutoScroll = true; + font = Program.MonoSpaceFont; editBox.Font = font; @@ -85,18 +87,6 @@ public MemoryViewControl() memoryPreviewPopUp = new MemoryPreviewPopUp(font); } - protected override void OnLoad(EventArgs e) - { - base.OnLoad(e); - - VerticalScroll.Enabled = true; - VerticalScroll.Visible = true; - VerticalScroll.SmallChange = 10; - HorizontalScroll.Enabled = true; - HorizontalScroll.Visible = true; - HorizontalScroll.SmallChange = 100; - } - protected override void OnPaint(PaintEventArgs e) { base.OnPaint(e); @@ -147,8 +137,8 @@ protected override void OnPaint(PaintEventArgs e) var drawnSize = args.Node.Draw( view, - -HorizontalScroll.Value, - -VerticalScroll.Value * font.Height + AutoScrollPosition.X, + AutoScrollPosition.Y ); drawnSize.Width += 10; @@ -157,33 +147,7 @@ protected override void OnPaint(PaintEventArgs e) e.Graphics.DrawRectangle(new Pen(new SolidBrush(Color.FromArgb(150, 255, 0, 0)), 1), spot.Rect); }*/ - if (drawnSize.Height > ClientSize.Height) - { - VerticalScroll.Enabled = true; - - VerticalScroll.LargeChange = ClientSize.Height / font.Height; - VerticalScroll.Maximum = (drawnSize.Height - ClientSize.Height) / font.Height + VerticalScroll.LargeChange; - } - else - { - VerticalScroll.Enabled = false; - - VerticalScroll.Value = VerticalScroll.Minimum; - } - - if (drawnSize.Width > ClientSize.Width) - { - HorizontalScroll.Enabled = true; - - HorizontalScroll.LargeChange = ClientSize.Width; - HorizontalScroll.Maximum = drawnSize.Width - ClientSize.Width + HorizontalScroll.LargeChange; - } - else - { - HorizontalScroll.Enabled = false; - - HorizontalScroll.Value = HorizontalScroll.Minimum; - } + AutoScrollMinSize = new Size(Math.Max(drawnSize.Width, ClientSize.Width), Math.Max(drawnSize.Height, ClientSize.Height)); } private void OnSelectionChanged() @@ -333,9 +297,12 @@ protected override void OnMouseClick(MouseEventArgs e) } else if (hotSpot.Type == HotSpotType.ChangeClassType || hotSpot.Type == HotSpotType.ChangeWrappedType || hotSpot.Type == HotSpotType.ChangeEnumType) { - var handler = hotSpot.Type == HotSpotType.ChangeClassType - ? ChangeClassTypeClick : hotSpot.Type == HotSpotType.ChangeWrappedType - ? ChangeWrappedTypeClick : ChangeEnumTypeClick; + var handler = hotSpot.Type switch + { + HotSpotType.ChangeClassType => ChangeClassTypeClick, + HotSpotType.ChangeWrappedType => ChangeWrappedTypeClick, + HotSpotType.ChangeEnumType => ChangeEnumTypeClick + }; handler?.Invoke(this, new NodeClickEventArgs(hitObject, hotSpot.Address, hotSpot.Memory, e.Button, e.Location)); @@ -574,7 +541,10 @@ protected override bool ProcessCmdKey(ref Message msg, Keys keyData) if (isAtEnd) { - DoScroll(ScrollOrientation.VerticalScroll, key == Keys.Down ? 1 : - 1); + const int ScrollAmount = 3; + + var position = AutoScrollPosition; + AutoScrollPosition = new Point(-position.X, -position.Y + (key == Keys.Down ? ScrollAmount : -ScrollAmount) * font.Height); } Invalidate(); diff --git a/ReClass.NET/UI/ScrollableCustomControl.cs b/ReClass.NET/UI/ScrollableCustomControl.cs deleted file mode 100644 index 4de6a4de..00000000 --- a/ReClass.NET/UI/ScrollableCustomControl.cs +++ /dev/null @@ -1,248 +0,0 @@ -using System; -using System.Diagnostics.Contracts; -using System.Runtime.InteropServices; -using System.Windows.Forms; - -namespace ReClassNET.UI -{ - public class ScrollableCustomControl : UserControl - { - private const int WM_HSCROLL = 0x114; - private const int WM_VSCROLL = 0x115; - private const int SBS_HORZ = 0x0000; - private const int SBS_VERT = 0x0001; - private const int SIF_ALL = 0x0001 | 0x0002 | 0x0004 | 0x0010; - - [DllImport("user32.dll", ExactSpelling = true, CharSet = CharSet.Auto)] - private static extern bool GetScrollInfo(HandleRef hWnd, int fnBar, SCROLLINFO si); - - [StructLayout(LayoutKind.Sequential)] - private class SCROLLINFO - { - public int cbSize = Marshal.SizeOf(typeof(SCROLLINFO)); - public int fMask = SIF_ALL; - public int nMin; - public int nMax; - public int nPage; - public int nPos; - public int nTrackPos; - } - - private readonly SCROLLINFO scrollinfo = new SCROLLINFO(); - - public ScrollableCustomControl() - { - VScroll = true; - HScroll = true; - } - - protected override void OnMouseWheel(MouseEventArgs e) - { - Contract.Assume(VerticalScroll != null); - Contract.Assume(HorizontalScroll != null); - - const int WHEEL_DELTA = 120; - - var scrollProperties = VerticalScroll.Enabled ? VerticalScroll : (ScrollProperties)HorizontalScroll; - - var wheelDelta = e.Delta; - while (Math.Abs(wheelDelta) >= WHEEL_DELTA) - { - if (wheelDelta > 0) - { - wheelDelta -= WHEEL_DELTA; - DoScroll(ScrollEventType.SmallDecrement, scrollProperties); - } - else - { - wheelDelta += WHEEL_DELTA; - DoScroll(ScrollEventType.SmallIncrement, scrollProperties); - } - } - - base.OnMouseWheel(e); - } - - private const int SB_LINEUP = 0; - private const int SB_LINEDOWN = 1; - private const int SB_PAGEUP = 2; - private const int SB_PAGEDOWN = 3; - private const int SB_THUMBPOSITION = 4; - private const int SB_THUMBTRACK = 5; - private const int SB_TOP = 6; - private const int SB_BOTTOM = 7; - private const int SB_ENDSCROLL = 8; - - private static ScrollEventType WParamToScrollEventType(IntPtr wParam) - { - switch (LoWord((int)wParam)) - { - case SB_LINEUP: - return ScrollEventType.SmallDecrement; - case SB_LINEDOWN: - return ScrollEventType.SmallIncrement; - case SB_PAGEUP: - return ScrollEventType.LargeDecrement; - case SB_PAGEDOWN: - return ScrollEventType.LargeIncrement; - case SB_THUMBTRACK: - return ScrollEventType.ThumbTrack; - case SB_TOP: - return ScrollEventType.First; - case SB_BOTTOM: - return ScrollEventType.Last; - case SB_THUMBPOSITION: - return ScrollEventType.ThumbPosition; - case SB_ENDSCROLL: - return ScrollEventType.EndScroll; - default: - return ScrollEventType.EndScroll; - } - } - - private void SetValue(ScrollEventType type, ScrollProperties scrollProperties, int newValue) - { - Contract.Requires(scrollProperties != null); - - if (!scrollProperties.Enabled) - { - return; - } - - if (newValue < scrollProperties.Minimum) - { - newValue = scrollProperties.Minimum; - } - if (newValue > scrollProperties.Maximum - scrollProperties.LargeChange) - { - newValue = scrollProperties.Maximum - scrollProperties.LargeChange + 1; - } - if (scrollProperties.Value != newValue) - { - var oldValue = scrollProperties.Value; - - scrollProperties.Value = newValue; - - if (type != ScrollEventType.EndScroll) - { - OnScroll(new ScrollEventArgs( - type, - oldValue, - newValue, - scrollProperties is VScrollProperties ? ScrollOrientation.VerticalScroll : ScrollOrientation.HorizontalScroll - )); - Invalidate(); - } - } - } - - private void DoScroll(ScrollEventType type, ScrollProperties scrollProperties) - { - Contract.Requires(scrollProperties != null); - - var oldValue = scrollProperties.Value; - var newValue = oldValue; - - switch (type) - { - case ScrollEventType.SmallDecrement: - newValue = oldValue - (ModifierKeys == Keys.Control ? 1 : scrollProperties.SmallChange); - break; - case ScrollEventType.SmallIncrement: - newValue = oldValue + (ModifierKeys == Keys.Control ? 1 : scrollProperties.SmallChange); - break; - case ScrollEventType.LargeDecrement: - newValue = oldValue - scrollProperties.LargeChange; - break; - case ScrollEventType.LargeIncrement: - newValue = oldValue + scrollProperties.LargeChange; - break; - case ScrollEventType.First: - newValue = scrollProperties.Minimum; - break; - case ScrollEventType.Last: - newValue = scrollProperties.Maximum; - break; - } - - SetValue(type, scrollProperties, newValue); - } - - public void DoScroll(ScrollOrientation orientation, int amount) - { - if (orientation == ScrollOrientation.VerticalScroll && VerticalScroll.Enabled == false) - { - return; - } - if (orientation == ScrollOrientation.HorizontalScroll && HorizontalScroll.Enabled == false) - { - return; - } - - var scrollProperties = orientation == ScrollOrientation.VerticalScroll ? VerticalScroll : (ScrollProperties)HorizontalScroll; - - SetValue(ScrollEventType.ThumbPosition, scrollProperties, scrollProperties.Value + amount); - } - - private void ProcessMessage(ref Message msg) - { - ScrollProperties scrollProperties; - int bar; - if (msg.Msg == WM_VSCROLL) - { - scrollProperties = VerticalScroll; - bar = SBS_VERT; - } - else - { - scrollProperties = HorizontalScroll; - bar = SBS_HORZ; - } - - var type = WParamToScrollEventType(msg.WParam); - switch (type) - { - case ScrollEventType.SmallDecrement: - case ScrollEventType.SmallIncrement: - case ScrollEventType.LargeDecrement: - case ScrollEventType.LargeIncrement: - case ScrollEventType.First: - case ScrollEventType.Last: - DoScroll(type, scrollProperties); - break; - case ScrollEventType.ThumbTrack: - case ScrollEventType.ThumbPosition: - - if (GetScrollInfo(new HandleRef(this, Handle), bar, scrollinfo)) - { - SetValue(type, scrollProperties, scrollinfo.nTrackPos); - } - break; - } - } - - protected override void WndProc(ref Message msg) - { - if (msg.HWnd == Handle) - { - switch (msg.Msg) - { - case WM_VSCROLL: - case WM_HSCROLL: - if (msg.LParam != IntPtr.Zero) - { - break; - } - - ProcessMessage(ref msg); - - return; - } - } - - base.WndProc(ref msg); - } - - static int LoWord(int number) => number & 0xffff; - } -} From 8ded5959295c2edd86a0a0e3450f34b443a38902 Mon Sep 17 00:00:00 2001 From: KN4CK3R Date: Thu, 6 Aug 2020 22:48:41 +0200 Subject: [PATCH 147/223] Should fix the scrolling issue. (#164) --- ReClass.NET/UI/MemoryViewControl.cs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/ReClass.NET/UI/MemoryViewControl.cs b/ReClass.NET/UI/MemoryViewControl.cs index 64b05a23..835aaeec 100644 --- a/ReClass.NET/UI/MemoryViewControl.cs +++ b/ReClass.NET/UI/MemoryViewControl.cs @@ -135,10 +135,12 @@ protected override void OnPaint(PaintEventArgs e) MultipleNodesSelected = selectedNodes.Count > 1 }; + var scrollPosition = AutoScrollPosition; + var drawnSize = args.Node.Draw( view, - AutoScrollPosition.X, - AutoScrollPosition.Y + scrollPosition.X, + scrollPosition.Y ); drawnSize.Width += 10; @@ -148,6 +150,9 @@ protected override void OnPaint(PaintEventArgs e) }*/ AutoScrollMinSize = new Size(Math.Max(drawnSize.Width, ClientSize.Width), Math.Max(drawnSize.Height, ClientSize.Height)); + + // Sometimes setting AutoScrollMinSize resets AutoScrollPosition. This restores the original position. + AutoScrollPosition = new Point(-scrollPosition.X, -scrollPosition.Y); } private void OnSelectionChanged() From 3fcd108eacce79370e1e02ff6fd6864955f48e48 Mon Sep 17 00:00:00 2001 From: KN4CK3R Date: Sun, 30 Aug 2020 17:31:32 +0200 Subject: [PATCH 148/223] Do not dispose the returned image (#168). --- ReClass.NET/UI/DpiUtil.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ReClass.NET/UI/DpiUtil.cs b/ReClass.NET/UI/DpiUtil.cs index c3fb88c2..c46c7038 100644 --- a/ReClass.NET/UI/DpiUtil.cs +++ b/ReClass.NET/UI/DpiUtil.cs @@ -109,7 +109,7 @@ private static Image ScaleImage(Image img, int w, int h) Contract.Requires(w >= 0); Contract.Requires(h >= 0); - using var bmp = new Bitmap(w, h, PixelFormat.Format32bppArgb); + var bmp = new Bitmap(w, h, PixelFormat.Format32bppArgb); using var g = Graphics.FromImage(bmp); g.Clear(Color.Transparent); From 5172c82c1d4ffc69b9bbcc0221355506a153bf30 Mon Sep 17 00:00:00 2001 From: KN4CK3R Date: Sun, 30 Aug 2020 17:59:30 +0200 Subject: [PATCH 149/223] Use better variable names. --- ReClass.NET/UI/DpiUtil.cs | 75 ++++++++++++++++++++------------------- 1 file changed, 38 insertions(+), 37 deletions(-) diff --git a/ReClass.NET/UI/DpiUtil.cs b/ReClass.NET/UI/DpiUtil.cs index c46c7038..0f24b004 100644 --- a/ReClass.NET/UI/DpiUtil.cs +++ b/ReClass.NET/UI/DpiUtil.cs @@ -83,73 +83,74 @@ public static int ScaleIntY(int i) return (int)Math.Round(i * scaleY); } - public static Image ScaleImage(Image img) + public static Image ScaleImage(Image sourceImage) { - if (img == null) + if (sourceImage == null) { return null; } - int w = img.Width; - int h = img.Height; - int sw = ScaleIntX(w); - int sh = ScaleIntY(h); + var width = sourceImage.Width; + var height = sourceImage.Height; + var scaledWidth = ScaleIntX(width); + var scaledHeight = ScaleIntY(height); - if (w == sw && h == sh) + if (width == scaledWidth && height == scaledHeight) { - return img; + return sourceImage; } - return ScaleImage(img, sw, sh); + return ScaleImage(sourceImage, scaledWidth, scaledHeight); } - private static Image ScaleImage(Image img, int w, int h) + private static Image ScaleImage(Image sourceImage, int width, int height) { - Contract.Requires(img != null); - Contract.Requires(w >= 0); - Contract.Requires(h >= 0); + Contract.Requires(sourceImage != null); + Contract.Requires(width >= 0); + Contract.Requires(height >= 0); - var bmp = new Bitmap(w, h, PixelFormat.Format32bppArgb); - using var g = Graphics.FromImage(bmp); + var scaledImage = new Bitmap(width, height, PixelFormat.Format32bppArgb); + + using var g = Graphics.FromImage(scaledImage); g.Clear(Color.Transparent); g.SmoothingMode = SmoothingMode.HighQuality; g.CompositingQuality = CompositingQuality.HighQuality; - var wSrc = img.Width; - var hSrc = img.Height; + var sourceWidth = sourceImage.Width; + var sourceHeight = sourceImage.Height; - var im = InterpolationMode.HighQualityBicubic; - if (wSrc > 0 && hSrc > 0) + var interpolationMode = InterpolationMode.HighQualityBicubic; + if (sourceWidth > 0 && sourceHeight > 0) { - if ((w % wSrc) == 0 && (h % hSrc) == 0) + if ((width % sourceWidth) == 0 && (height % sourceHeight) == 0) { - im = InterpolationMode.NearestNeighbor; + interpolationMode = InterpolationMode.NearestNeighbor; } } - g.InterpolationMode = im; + g.InterpolationMode = interpolationMode; - var rSource = new RectangleF(0.0f, 0.0f, wSrc, hSrc); - var rDest = new RectangleF(0.0f, 0.0f, w, h); - AdjustScaleRects(ref rSource, ref rDest); + var srcRect = new RectangleF(0.0f, 0.0f, sourceWidth, sourceHeight); + var destRect = new RectangleF(0.0f, 0.0f, width, height); + AdjustScaleRects(ref srcRect, ref destRect); - g.DrawImage(img, rDest, rSource, GraphicsUnit.Pixel); + g.DrawImage(sourceImage, destRect, srcRect, GraphicsUnit.Pixel); - return bmp; + return scaledImage; } - private static void AdjustScaleRects(ref RectangleF rSource, ref RectangleF rDest) + private static void AdjustScaleRects(ref RectangleF srcRect, ref RectangleF destRect) { - if (rDest.Width > rSource.Width) - rSource.X = rSource.X - 0.5f; - if (rDest.Height > rSource.Height) - rSource.Y = rSource.Y - 0.5f; - - if (rDest.Width < rSource.Width) - rSource.X = rSource.X + 0.5f; - if (rDest.Height < rSource.Height) - rSource.Y = rSource.Y + 0.5f; + if (destRect.Width > srcRect.Width) + srcRect.X -= 0.5f; + if (destRect.Height > srcRect.Height) + srcRect.Y -= 0.5f; + + if (destRect.Width < srcRect.Width) + srcRect.X += 0.5f; + if (destRect.Height < srcRect.Height) + srcRect.Y += 0.5f; } } } From 30f09c810f3645c846abd4c7f05c617af8d71c2c Mon Sep 17 00:00:00 2001 From: Frederik Munk Madsen Date: Mon, 14 Sep 2020 22:51:15 +0200 Subject: [PATCH 150/223] Focus MemoryView when EditBox commits --- ReClass.NET/UI/MemoryViewControl.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ReClass.NET/UI/MemoryViewControl.cs b/ReClass.NET/UI/MemoryViewControl.cs index 835aaeec..4a3740bd 100644 --- a/ReClass.NET/UI/MemoryViewControl.cs +++ b/ReClass.NET/UI/MemoryViewControl.cs @@ -631,6 +631,8 @@ private void editBox_Committed(object sender, EventArgs e) Invalidate(); } + + Focus(); } #endregion From a8a8266476335d29a59e9691257336895bcc3563 Mon Sep 17 00:00:00 2001 From: Frederik Munk Madsen Date: Mon, 14 Sep 2020 22:53:17 +0200 Subject: [PATCH 151/223] Edit node name when F2 is pressed --- ReClass.NET/Forms/MainForm.Functions.cs | 11 +++++++++ ReClass.NET/Forms/MainForm.cs | 26 +++++++++++--------- ReClass.NET/UI/HotSpotTextBox.cs | 2 +- ReClass.NET/UI/MemoryViewControl.Designer.cs | 2 +- ReClass.NET/UI/MemoryViewControl.cs | 14 +++++++++++ 5 files changed, 41 insertions(+), 14 deletions(-) diff --git a/ReClass.NET/Forms/MainForm.Functions.cs b/ReClass.NET/Forms/MainForm.Functions.cs index 6e0d7439..160cb9fc 100644 --- a/ReClass.NET/Forms/MainForm.Functions.cs +++ b/ReClass.NET/Forms/MainForm.Functions.cs @@ -410,6 +410,17 @@ private void PasteNodeFromClipboardToSelection() } } + private void EditSelectedNodeName() + { + var selected = memoryViewControl.GetSelectedNodes(); + var selectedNode = selected.FirstOrDefault(); + + if (selected.Count == 1) + { + memoryViewControl.ShowEditBoxForName(selectedNode); + } + } + private void RemoveSelectedNodes() { memoryViewControl.GetSelectedNodes() diff --git a/ReClass.NET/Forms/MainForm.cs b/ReClass.NET/Forms/MainForm.cs index 11aa1362..7df1daff 100644 --- a/ReClass.NET/Forms/MainForm.cs +++ b/ReClass.NET/Forms/MainForm.cs @@ -766,22 +766,24 @@ private void classesView_ClassSelected(object sender, ClassNode node) CurrentClassNode = node; } - private void memoryViewControl_KeyDown(object sender, KeyEventArgs e) + private void memoryViewControl_KeyDown(object sender, KeyEventArgs args) { - if (e.Control) + switch (args.KeyCode) { - if (e.KeyCode == Keys.C) - { + case Keys.C when args.Control: CopySelectedNodesToClipboard(); - } - else if (e.KeyCode == Keys.V) - { + break; + case Keys.V when args.Control: PasteNodeFromClipboardToSelection(); - } - } - else if (e.KeyCode == Keys.Delete) - { - RemoveSelectedNodes(); + break; + + case Keys.Delete: + RemoveSelectedNodes(); + break; + + case Keys.F2: + EditSelectedNodeName(); + break; } } diff --git a/ReClass.NET/UI/HotSpotTextBox.cs b/ReClass.NET/UI/HotSpotTextBox.cs index be90dc8d..2fbd7ba7 100644 --- a/ReClass.NET/UI/HotSpotTextBox.cs +++ b/ReClass.NET/UI/HotSpotTextBox.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.ComponentModel; using System.Windows.Forms; diff --git a/ReClass.NET/UI/MemoryViewControl.Designer.cs b/ReClass.NET/UI/MemoryViewControl.Designer.cs index 5642eba4..7f0bcca8 100644 --- a/ReClass.NET/UI/MemoryViewControl.Designer.cs +++ b/ReClass.NET/UI/MemoryViewControl.Designer.cs @@ -1,4 +1,4 @@ -namespace ReClassNET.UI +namespace ReClassNET.UI { partial class MemoryViewControl { diff --git a/ReClass.NET/UI/MemoryViewControl.cs b/ReClass.NET/UI/MemoryViewControl.cs index 4a3740bd..96bdd48f 100644 --- a/ReClass.NET/UI/MemoryViewControl.cs +++ b/ReClass.NET/UI/MemoryViewControl.cs @@ -381,6 +381,20 @@ protected override void OnMouseDoubleClick(MouseEventArgs e) base.OnMouseDoubleClick(e); } + public void ShowEditBoxForName(SelectedNodeInfo selection) + { + var hotSpot = hotSpots.FirstOrDefault(spot => spot.Address == selection.Address && + spot.Type == HotSpotType.Edit && + spot.Text == selection.Node.Name); + if (hotSpot != null) + { + editBox.BackColor = Program.Settings.SelectedColor; + editBox.HotSpot = hotSpot; + editBox.Visible = true; + editBox.ReadOnly = false; + } + } + private Point toolTipPosition; protected override void OnMouseHover(EventArgs e) { From acfb2331ad507248b21410e88933ee9ab221b59a Mon Sep 17 00:00:00 2001 From: KN4CK3R Date: Tue, 29 Sep 2020 18:09:31 +0200 Subject: [PATCH 152/223] Enable DPI scaling setting. --- ReClass.NET/App.config | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/ReClass.NET/App.config b/ReClass.NET/App.config index ecdcf8a5..1b379a17 100644 --- a/ReClass.NET/App.config +++ b/ReClass.NET/App.config @@ -1,6 +1,9 @@ - - - - + + + + + + + \ No newline at end of file From ad77de0b75127eb9e5b7c64d6b8dc1494f85ed7b Mon Sep 17 00:00:00 2001 From: KN4CK3R Date: Tue, 29 Sep 2020 18:11:06 +0200 Subject: [PATCH 153/223] Added DpiUtil tests. --- ReClass.NET/Program.cs | 1 + ReClass.NET/UI/DpiUtil.cs | 60 +++++++--------------- ReClass.NET_Tests/ReClass.NET_Tests.csproj | 2 + ReClass.NET_Tests/UI/DpiUtilTest.cs | 43 ++++++++++++++++ 4 files changed, 65 insertions(+), 41 deletions(-) create mode 100644 ReClass.NET_Tests/UI/DpiUtilTest.cs diff --git a/ReClass.NET/Program.cs b/ReClass.NET/Program.cs index 65ea6838..f28cb0bd 100644 --- a/ReClass.NET/Program.cs +++ b/ReClass.NET/Program.cs @@ -44,6 +44,7 @@ static void Main(string[] args) try { DpiUtil.ConfigureProcess(); + DpiUtil.TrySetDpiFromCurrentDesktop(); } catch { diff --git a/ReClass.NET/UI/DpiUtil.cs b/ReClass.NET/UI/DpiUtil.cs index 0f24b004..58b8b7e0 100644 --- a/ReClass.NET/UI/DpiUtil.cs +++ b/ReClass.NET/UI/DpiUtil.cs @@ -9,77 +9,55 @@ namespace ReClassNET.UI { public static class DpiUtil { - private const int StdDpi = 96; + public const int DefalutDpi = 96; - private static bool initialized; - - private static int dpiX = StdDpi; - private static int dpiY = StdDpi; + private static int dpiX = DefalutDpi; + private static int dpiY = DefalutDpi; private static double scaleX = 1.0; private static double scaleY = 1.0; - public static bool ScalingRequired + public static void ConfigureProcess() { - get - { - if (Program.DesignMode) - { - return false; - } - - EnsureInitialized(); - - return dpiX != StdDpi || dpiY != StdDpi; - } + NativeMethods.SetProcessDpiAwareness(); } - private static void EnsureInitialized() + public static void SetDpi(int x, int y) { - if (initialized) + dpiX = x; + dpiY = y; + + if (dpiX <= 0 || dpiY <= 0) { - return; + dpiX = DefalutDpi; + dpiY = DefalutDpi; } + scaleX = dpiX / (double)DefalutDpi; + scaleY = dpiY / (double)DefalutDpi; + } + + public static void TrySetDpiFromCurrentDesktop() + { try { using var g = Graphics.FromHwnd(IntPtr.Zero); - dpiX = (int)g.DpiX; - dpiY = (int)g.DpiY; - if (dpiX <= 0 || dpiY <= 0) - { - dpiX = StdDpi; - dpiY = StdDpi; - } + SetDpi((int)g.DpiX, (int)g.DpiY); } catch { // ignored } - - scaleX = dpiX / (double)StdDpi; - scaleY = dpiY / (double)StdDpi; - - initialized = true; - } - - public static void ConfigureProcess() - { - NativeMethods.SetProcessDpiAwareness(); } public static int ScaleIntX(int i) { - EnsureInitialized(); - return (int)Math.Round(i * scaleX); } public static int ScaleIntY(int i) { - EnsureInitialized(); - return (int)Math.Round(i * scaleY); } diff --git a/ReClass.NET_Tests/ReClass.NET_Tests.csproj b/ReClass.NET_Tests/ReClass.NET_Tests.csproj index 53798768..1ed78ef2 100644 --- a/ReClass.NET_Tests/ReClass.NET_Tests.csproj +++ b/ReClass.NET_Tests/ReClass.NET_Tests.csproj @@ -87,6 +87,7 @@ + @@ -121,5 +122,6 @@ all + \ No newline at end of file diff --git a/ReClass.NET_Tests/UI/DpiUtilTest.cs b/ReClass.NET_Tests/UI/DpiUtilTest.cs new file mode 100644 index 00000000..bf768490 --- /dev/null +++ b/ReClass.NET_Tests/UI/DpiUtilTest.cs @@ -0,0 +1,43 @@ +using System.Drawing; +using NFluent; +using ReClassNET.UI; +using Xunit; + +namespace ReClass.NET_Tests.UI +{ + public class DpiUtilTest + { + [Fact] + public void ScaleImageReturnsNullOnNull() + { + Check.That(DpiUtil.ScaleImage(null)).IsNull(); + } + + [Fact] + public void ScaleImageReturnsOriginalInstanceOnSameSize() + { + DpiUtil.SetDpi(DpiUtil.DefalutDpi, DpiUtil.DefalutDpi); + + using var sourceImage = new Bitmap(10, 10); + var scaledImage = DpiUtil.ScaleImage(sourceImage); + + Check.That(sourceImage).IsSameReferenceAs(scaledImage); + } + + [Fact] + public void ScaleImageReturnsScaledImage() + { + const int SourceSize = 10; + const int ScaleFactor = 2; + + DpiUtil.SetDpi(DpiUtil.DefalutDpi * ScaleFactor, DpiUtil.DefalutDpi * ScaleFactor); + + using var sourceImage = new Bitmap(SourceSize, SourceSize); + using var scaledImage = DpiUtil.ScaleImage(sourceImage); + + Check.That(sourceImage).Not.IsSameReferenceAs(scaledImage); + Check.That(scaledImage.Width).IsEqualTo(sourceImage.Width * ScaleFactor); + Check.That(scaledImage.Height).IsEqualTo(sourceImage.Height * ScaleFactor); + } + } +} From 7f10070f8f91651d30176af5eb752e22a403dd2a Mon Sep 17 00:00:00 2001 From: KN4CK3R Date: Tue, 29 Sep 2020 18:33:29 +0200 Subject: [PATCH 154/223] Addition to #170. --- ReClass.NET/Forms/MainForm.Functions.cs | 8 +++---- ReClass.NET/UI/MemoryViewControl.cs | 31 ++++++++++++++----------- 2 files changed, 21 insertions(+), 18 deletions(-) diff --git a/ReClass.NET/Forms/MainForm.Functions.cs b/ReClass.NET/Forms/MainForm.Functions.cs index 160cb9fc..8339bcf0 100644 --- a/ReClass.NET/Forms/MainForm.Functions.cs +++ b/ReClass.NET/Forms/MainForm.Functions.cs @@ -412,12 +412,10 @@ private void PasteNodeFromClipboardToSelection() private void EditSelectedNodeName() { - var selected = memoryViewControl.GetSelectedNodes(); - var selectedNode = selected.FirstOrDefault(); - - if (selected.Count == 1) + var selectedNodes = memoryViewControl.GetSelectedNodes(); + if (selectedNodes.Count == 1) { - memoryViewControl.ShowEditBoxForName(selectedNode); + memoryViewControl.ShowNodeNameEditBox(selectedNodes[0].Node); } } diff --git a/ReClass.NET/UI/MemoryViewControl.cs b/ReClass.NET/UI/MemoryViewControl.cs index 96bdd48f..0d32a9fe 100644 --- a/ReClass.NET/UI/MemoryViewControl.cs +++ b/ReClass.NET/UI/MemoryViewControl.cs @@ -354,11 +354,7 @@ protected override void OnMouseDoubleClick(MouseEventArgs e) } if (hotSpot.Type == HotSpotType.Edit) { - editBox.BackColor = Program.Settings.SelectedColor; - editBox.HotSpot = hotSpot; - editBox.Visible = true; - - editBox.ReadOnly = hotSpot.Id == HotSpot.ReadOnlyId; + ShowNodeNameEditBox(hotSpot); break; } @@ -381,20 +377,29 @@ protected override void OnMouseDoubleClick(MouseEventArgs e) base.OnMouseDoubleClick(e); } - public void ShowEditBoxForName(SelectedNodeInfo selection) + public void ShowNodeNameEditBox(BaseNode node) { - var hotSpot = hotSpots.FirstOrDefault(spot => spot.Address == selection.Address && - spot.Type == HotSpotType.Edit && - spot.Text == selection.Node.Name); + if (node == null || node is BaseHexNode) + { + return; + } + + var hotSpot = hotSpots + .FirstOrDefault(s => s.Node == node && s.Type == HotSpotType.Edit && s.Id == HotSpot.NameId); if (hotSpot != null) { - editBox.BackColor = Program.Settings.SelectedColor; - editBox.HotSpot = hotSpot; - editBox.Visible = true; - editBox.ReadOnly = false; + ShowNodeNameEditBox(hotSpot); } } + private void ShowNodeNameEditBox(HotSpot hotSpot) + { + editBox.BackColor = Program.Settings.SelectedColor; + editBox.HotSpot = hotSpot; + editBox.Visible = true; + editBox.ReadOnly = hotSpot.Id == HotSpot.ReadOnlyId; + } + private Point toolTipPosition; protected override void OnMouseHover(EventArgs e) { From c945ab41dc5bd291d3a3a8a83694c9c935b29936 Mon Sep 17 00:00:00 2001 From: KN4CK3R Date: Thu, 8 Oct 2020 21:20:10 +0200 Subject: [PATCH 155/223] Restore old behaviour. --- ReClass.NET/UI/MemoryViewControl.cs | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/ReClass.NET/UI/MemoryViewControl.cs b/ReClass.NET/UI/MemoryViewControl.cs index 0d32a9fe..befa4dd8 100644 --- a/ReClass.NET/UI/MemoryViewControl.cs +++ b/ReClass.NET/UI/MemoryViewControl.cs @@ -464,6 +464,8 @@ protected override void OnMouseMove(MouseEventArgs e) protected override void OnMouseWheel(MouseEventArgs e) { + editBox.Visible = false; + if (memoryPreviewPopUp.Visible) { memoryPreviewPopUp.HandleMouseWheelEvent(e); @@ -474,15 +476,6 @@ protected override void OnMouseWheel(MouseEventArgs e) } } - protected override void OnScroll(ScrollEventArgs e) - { - Contract.Requires(e != null); - - base.OnScroll(e); - - editBox.Visible = false; - } - protected override bool ProcessCmdKey(ref Message msg, Keys keyData) { if (editBox.Visible == false) // Only process keys if the edit field is not visible. From 3a95ffe7e3aa2f6b272c0a80cfb825aab0315b2d Mon Sep 17 00:00:00 2001 From: KN4CK3R Date: Thu, 8 Oct 2020 22:01:32 +0200 Subject: [PATCH 156/223] Moved methods out of wrong region. --- ReClass.NET/UI/MemoryViewControl.cs | 46 ++++++++++++++--------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/ReClass.NET/UI/MemoryViewControl.cs b/ReClass.NET/UI/MemoryViewControl.cs index befa4dd8..d69681d5 100644 --- a/ReClass.NET/UI/MemoryViewControl.cs +++ b/ReClass.NET/UI/MemoryViewControl.cs @@ -377,29 +377,6 @@ protected override void OnMouseDoubleClick(MouseEventArgs e) base.OnMouseDoubleClick(e); } - public void ShowNodeNameEditBox(BaseNode node) - { - if (node == null || node is BaseHexNode) - { - return; - } - - var hotSpot = hotSpots - .FirstOrDefault(s => s.Node == node && s.Type == HotSpotType.Edit && s.Id == HotSpot.NameId); - if (hotSpot != null) - { - ShowNodeNameEditBox(hotSpot); - } - } - - private void ShowNodeNameEditBox(HotSpot hotSpot) - { - editBox.BackColor = Program.Settings.SelectedColor; - editBox.HotSpot = hotSpot; - editBox.Visible = true; - editBox.ReadOnly = hotSpot.Id == HotSpot.ReadOnlyId; - } - private Point toolTipPosition; protected override void OnMouseHover(EventArgs e) { @@ -685,6 +662,29 @@ private void ShowNodeContextMenu(Point location) NodeContextMenuStrip?.Show(this, location); } + public void ShowNodeNameEditBox(BaseNode node) + { + if (node == null || node is BaseHexNode) + { + return; + } + + var hotSpot = hotSpots + .FirstOrDefault(s => s.Node == node && s.Type == HotSpotType.Edit && s.Id == HotSpot.NameId); + if (hotSpot != null) + { + ShowNodeNameEditBox(hotSpot); + } + } + + private void ShowNodeNameEditBox(HotSpot hotSpot) + { + editBox.BackColor = Program.Settings.SelectedColor; + editBox.HotSpot = hotSpot; + editBox.Visible = true; + editBox.ReadOnly = hotSpot.Id == HotSpot.ReadOnlyId; + } + /// /// Resets the selection state of all selected nodes. /// From 7f134722a4911fd4567714a6bce087b75a76de11 Mon Sep 17 00:00:00 2001 From: KN4CK3R Date: Thu, 8 Oct 2020 22:03:55 +0200 Subject: [PATCH 157/223] Directly call SetBounds. --- ReClass.NET/UI/HotSpotTextBox.cs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/ReClass.NET/UI/HotSpotTextBox.cs b/ReClass.NET/UI/HotSpotTextBox.cs index 2fbd7ba7..23939f09 100644 --- a/ReClass.NET/UI/HotSpotTextBox.cs +++ b/ReClass.NET/UI/HotSpotTextBox.cs @@ -19,10 +19,7 @@ public HotSpot HotSpot { hotSpot = value; - Left = hotSpot.Rect.Left + 2; - Top = hotSpot.Rect.Top; - Width = hotSpot.Rect.Width; - Height = hotSpot.Rect.Height; + SetBounds(hotSpot.Rect.Left + 2, hotSpot.Rect.Top, hotSpot.Rect.Width, hotSpot.Rect.Height); MinimumWidth = Width; From 08a5996e2a3433256688f042bc1ba0e54c8417fa Mon Sep 17 00:00:00 2001 From: KN4CK3R Date: Thu, 8 Oct 2020 22:09:12 +0200 Subject: [PATCH 158/223] Made minimum width member private. --- ReClass.NET/UI/HotSpotTextBox.cs | 11 ++++++----- ReClass.NET/UI/MemoryViewControl.Designer.cs | 3 +-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/ReClass.NET/UI/HotSpotTextBox.cs b/ReClass.NET/UI/HotSpotTextBox.cs index 23939f09..ca05744b 100644 --- a/ReClass.NET/UI/HotSpotTextBox.cs +++ b/ReClass.NET/UI/HotSpotTextBox.cs @@ -19,18 +19,19 @@ public HotSpot HotSpot { hotSpot = value; - SetBounds(hotSpot.Rect.Left + 2, hotSpot.Rect.Top, hotSpot.Rect.Width, hotSpot.Rect.Height); + var rect = hotSpot.Rect; - MinimumWidth = Width; + SetBounds(rect.Left + 2, rect.Top, rect.Width, rect.Height); + + minimumWidth = rect.Width; Text = hotSpot.Text.Trim(); } } } - public int MinimumWidth { get; set; } - private FontEx font; + private int minimumWidth; [Browsable(false)] [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] @@ -94,7 +95,7 @@ protected override void OnTextChanged(EventArgs e) base.OnTextChanged(e); var w = (TextLength + 1) * font.Width; - if (w > MinimumWidth) + if (w > minimumWidth) { Width = w; } diff --git a/ReClass.NET/UI/MemoryViewControl.Designer.cs b/ReClass.NET/UI/MemoryViewControl.Designer.cs index 7f0bcca8..b56874ff 100644 --- a/ReClass.NET/UI/MemoryViewControl.Designer.cs +++ b/ReClass.NET/UI/MemoryViewControl.Designer.cs @@ -43,8 +43,7 @@ private void InitializeComponent() // editBox // this.editBox.BorderStyle = System.Windows.Forms.BorderStyle.None; - this.editBox.Location = new System.Drawing.Point(36, 81); - this.editBox.MinimumWidth = 0; + this.editBox.Location = new System.Drawing.Point(0, 0); this.editBox.Name = "editBox"; this.editBox.Size = new System.Drawing.Size(100, 13); this.editBox.TabIndex = 1; From 93850bf5c40e79f075640ddecc438ee4d109310e Mon Sep 17 00:00:00 2001 From: KN4CK3R Date: Thu, 8 Oct 2020 22:28:35 +0200 Subject: [PATCH 159/223] Added ShowOnHotSpot method. --- ReClass.NET/UI/HotSpotTextBox.cs | 84 ++++++++++++-------- ReClass.NET/UI/MemoryViewControl.Designer.cs | 72 ++++++++--------- ReClass.NET/UI/MemoryViewControl.cs | 32 +++----- 3 files changed, 97 insertions(+), 91 deletions(-) diff --git a/ReClass.NET/UI/HotSpotTextBox.cs b/ReClass.NET/UI/HotSpotTextBox.cs index ca05744b..70b19a64 100644 --- a/ReClass.NET/UI/HotSpotTextBox.cs +++ b/ReClass.NET/UI/HotSpotTextBox.cs @@ -1,34 +1,13 @@ using System; using System.ComponentModel; +using System.Drawing; using System.Windows.Forms; namespace ReClassNET.UI { public class HotSpotTextBox : TextBox { - private HotSpot hotSpot; - - [Browsable(false)] - [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] - public HotSpot HotSpot - { - get => hotSpot; - set - { - if (hotSpot != value) - { - hotSpot = value; - - var rect = hotSpot.Rect; - - SetBounds(rect.Left + 2, rect.Top, rect.Width, rect.Height); - - minimumWidth = rect.Width; - - Text = hotSpot.Text.Trim(); - } - } - } + private HotSpot currentHotSpot; private FontEx font; private int minimumWidth; @@ -49,20 +28,24 @@ public HotSpot HotSpot } } - public event EventHandler Committed; + public event HotSpotTextBoxCommitEventHandler Committed; public HotSpotTextBox() { BorderStyle = BorderStyle.None; } + #region Events + protected override void OnVisibleChanged(EventArgs e) { base.OnVisibleChanged(e); if (Visible) { - if (HotSpot != null) + BackColor = Program.Settings.BackgroundColor; + + if (currentHotSpot != null) { Focus(); Select(0, TextLength); @@ -83,13 +66,6 @@ protected override void OnKeyDown(KeyEventArgs e) base.OnKeyDown(e); } - /*protected override void OnLeave(EventArgs e) - { - base.OnLeave(e); - - OnCommit(); - }*/ - protected override void OnTextChanged(EventArgs e) { base.OnTextChanged(e); @@ -105,9 +81,49 @@ private void OnCommit() { Visible = false; - hotSpot.Text = Text.Trim(); + currentHotSpot.Text = Text.Trim(); + + Committed?.Invoke(this, new HotSpotTextBoxCommitEventArgs(currentHotSpot)); + } - Committed?.Invoke(this, EventArgs.Empty); + #endregion + + public void ShowOnHotSpot(HotSpot hotSpot) + { + currentHotSpot = hotSpot; + + if (hotSpot == null) + { + Visible = false; + + return; + } + + AlignToRect(hotSpot.Rect); + + Text = hotSpot.Text.Trim(); + ReadOnly = hotSpot.Id == HotSpot.ReadOnlyId; + + Visible = true; + } + + private void AlignToRect(Rectangle rect) + { + SetBounds(rect.Left + 2, rect.Top, rect.Width, rect.Height); + + minimumWidth = rect.Width; + } + } + + public delegate void HotSpotTextBoxCommitEventHandler(object sender, HotSpotTextBoxCommitEventArgs e); + + public class HotSpotTextBoxCommitEventArgs : EventArgs + { + public HotSpot HotSpot { get; set; } + + public HotSpotTextBoxCommitEventArgs(HotSpot hotSpot) + { + HotSpot = hotSpot; } } } diff --git a/ReClass.NET/UI/MemoryViewControl.Designer.cs b/ReClass.NET/UI/MemoryViewControl.Designer.cs index b56874ff..a7e9ccc1 100644 --- a/ReClass.NET/UI/MemoryViewControl.Designer.cs +++ b/ReClass.NET/UI/MemoryViewControl.Designer.cs @@ -28,47 +28,47 @@ protected override void Dispose(bool disposing) /// private void InitializeComponent() { - this.components = new System.ComponentModel.Container(); - this.repaintTimer = new System.Windows.Forms.Timer(this.components); - this.editBox = new ReClassNET.UI.HotSpotTextBox(); - this.nodeInfoToolTip = new System.Windows.Forms.ToolTip(this.components); - this.SuspendLayout(); - // - // repaintTimer - // - this.repaintTimer.Enabled = true; - this.repaintTimer.Interval = 250; - this.repaintTimer.Tick += new System.EventHandler(this.repaintTimer_Tick); - // - // editBox - // - this.editBox.BorderStyle = System.Windows.Forms.BorderStyle.None; - this.editBox.Location = new System.Drawing.Point(0, 0); - this.editBox.Name = "editBox"; - this.editBox.Size = new System.Drawing.Size(100, 13); - this.editBox.TabIndex = 1; - this.editBox.TabStop = false; - this.editBox.Visible = false; - this.editBox.Committed += new System.EventHandler(this.editBox_Committed); - // - // nodeInfoToolTip - // - this.nodeInfoToolTip.ShowAlways = true; - // - // MemoryViewControl - // - this.Controls.Add(this.editBox); - this.DoubleBuffered = true; - this.Name = "MemoryViewControl"; - this.Size = new System.Drawing.Size(150, 162); - this.ResumeLayout(false); - this.PerformLayout(); + this.components = new System.ComponentModel.Container(); + this.repaintTimer = new System.Windows.Forms.Timer(this.components); + this.hotSpotEditBox = new ReClassNET.UI.HotSpotTextBox(); + this.nodeInfoToolTip = new System.Windows.Forms.ToolTip(this.components); + this.SuspendLayout(); + // + // repaintTimer + // + this.repaintTimer.Enabled = true; + this.repaintTimer.Interval = 250; + this.repaintTimer.Tick += new System.EventHandler(this.repaintTimer_Tick); + // + // hotSpotEditBox + // + this.hotSpotEditBox.BorderStyle = System.Windows.Forms.BorderStyle.None; + this.hotSpotEditBox.Location = new System.Drawing.Point(0, 0); + this.hotSpotEditBox.Name = "hotSpotEditBox"; + this.hotSpotEditBox.Size = new System.Drawing.Size(100, 13); + this.hotSpotEditBox.TabIndex = 1; + this.hotSpotEditBox.TabStop = false; + this.hotSpotEditBox.Visible = false; + this.hotSpotEditBox.Committed += new ReClassNET.UI.HotSpotTextBoxCommitEventHandler(this.editBox_Committed); + // + // nodeInfoToolTip + // + this.nodeInfoToolTip.ShowAlways = true; + // + // MemoryViewControl + // + this.Controls.Add(this.hotSpotEditBox); + this.DoubleBuffered = true; + this.Name = "MemoryViewControl"; + this.Size = new System.Drawing.Size(150, 162); + this.ResumeLayout(false); + this.PerformLayout(); } #endregion private System.Windows.Forms.Timer repaintTimer; - private HotSpotTextBox editBox; + private HotSpotTextBox hotSpotEditBox; private System.Windows.Forms.ToolTip nodeInfoToolTip; } } diff --git a/ReClass.NET/UI/MemoryViewControl.cs b/ReClass.NET/UI/MemoryViewControl.cs index d69681d5..f6cef494 100644 --- a/ReClass.NET/UI/MemoryViewControl.cs +++ b/ReClass.NET/UI/MemoryViewControl.cs @@ -82,7 +82,7 @@ public MemoryViewControl() font = Program.MonoSpaceFont; - editBox.Font = font; + hotSpotEditBox.Font = font; memoryPreviewPopUp = new MemoryPreviewPopUp(font); } @@ -166,6 +166,8 @@ protected override void OnMouseClick(MouseEventArgs e) { Contract.Requires(e != null); + hotSpotEditBox.Hide(); + var invalidate = false; foreach (var hotSpot in hotSpots) @@ -316,8 +318,6 @@ protected override void OnMouseClick(MouseEventArgs e) } } - editBox.Visible = false; - if (invalidate) { Invalidate(); @@ -330,7 +330,7 @@ protected override void OnMouseDoubleClick(MouseEventArgs e) { Contract.Requires(e != null); - editBox.Visible = false; + hotSpotEditBox.Hide(); var invalidate = false; @@ -354,7 +354,7 @@ protected override void OnMouseDoubleClick(MouseEventArgs e) } if (hotSpot.Type == HotSpotType.Edit) { - ShowNodeNameEditBox(hotSpot); + hotSpotEditBox.ShowOnHotSpot(hotSpot); break; } @@ -441,7 +441,7 @@ protected override void OnMouseMove(MouseEventArgs e) protected override void OnMouseWheel(MouseEventArgs e) { - editBox.Visible = false; + hotSpotEditBox.Hide(); if (memoryPreviewPopUp.Visible) { @@ -455,7 +455,7 @@ protected override void OnMouseWheel(MouseEventArgs e) protected override bool ProcessCmdKey(ref Message msg, Keys keyData) { - if (editBox.Visible == false) // Only process keys if the edit field is not visible. + if (hotSpotEditBox.Visible == false) // Only process keys if the edit field is not visible. { var key = keyData & Keys.KeyCode; var modifier = keyData & Keys.Modifiers; @@ -602,11 +602,9 @@ private void repaintTimer_Tick(object sender, EventArgs e) Invalidate(false); } - private void editBox_Committed(object sender, EventArgs e) + private void editBox_Committed(object sender, HotSpotTextBoxCommitEventArgs e) { - var hotspotTextBox = sender as HotSpotTextBox; - - var hotSpot = hotspotTextBox?.HotSpot; + var hotSpot = e.HotSpot; if (hotSpot != null) { try @@ -673,18 +671,10 @@ public void ShowNodeNameEditBox(BaseNode node) .FirstOrDefault(s => s.Node == node && s.Type == HotSpotType.Edit && s.Id == HotSpot.NameId); if (hotSpot != null) { - ShowNodeNameEditBox(hotSpot); + hotSpotEditBox.ShowOnHotSpot(hotSpot); } } - private void ShowNodeNameEditBox(HotSpot hotSpot) - { - editBox.BackColor = Program.Settings.SelectedColor; - editBox.HotSpot = hotSpot; - editBox.Visible = true; - editBox.ReadOnly = hotSpot.Id == HotSpot.ReadOnlyId; - } - /// /// Resets the selection state of all selected nodes. /// @@ -708,7 +698,7 @@ public void Reset() { ClearSelection(); - editBox.Visible = false; + hotSpotEditBox.Hide(); VerticalScroll.Value = VerticalScroll.Minimum; } From 6e5f25bd3e6cf006d007ee979c00df5e6adc30de Mon Sep 17 00:00:00 2001 From: KN4CK3R Date: Thu, 8 Oct 2020 22:42:58 +0200 Subject: [PATCH 160/223] Fixes #169. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 3ed4a224..5859c353 100644 --- a/README.md +++ b/README.md @@ -52,7 +52,7 @@ This is a port of ReClass to the .NET platform with lots of additional features. - [MemoryPipe Plugin](https://github.com/ReClassNET/ReClass.NET-MemoryPipePlugin) - [LoadBinary Plugin](https://github.com/ReClassNET/ReClass.NET-LoadBinaryPlugin) - [Handle Abuser Plugin](https://github.com/ReClassNET/ReClass.NET-HandleAbuser) -- [Unreal Plugin](https://github.com/DrP3pp3r/ReClass.NET-UnrealPlugin) (by [DrP3pp3r](https://github.com/DrP3pp3r)) +- Unreal Plugin (not available anymore) (by [DrP3pp3r](https://github.com/DrP3pp3r)) - [DriverReader](https://github.com/niemand-sec/ReClass.NET-DriverReader) (by [Niemand](https://github.com/niemand-sec)) To install a plugin just copy it in the "Plugins" folder. From c8c47eab6e39c82624b56c8c62f85e826aa750e3 Mon Sep 17 00:00:00 2001 From: KN4CK3R Date: Thu, 8 Oct 2020 22:46:06 +0200 Subject: [PATCH 161/223] Added BlackHat reference. --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 5859c353..771e3fbe 100644 --- a/README.md +++ b/README.md @@ -120,3 +120,4 @@ Settings - [buddyfavors](https://github.com/buddyfavors) - [DrP3pp3r](https://github.com/DrP3pp3r) - [ko1N](https://github.com/ko1N) +- [Niemand](https://github.com/niemand-sec) (see his talk at [BlackHat Europe 2019 (London) "Unveiling the underground world of Anti-Cheats"](https://www.blackhat.com/eu-19/briefings/schedule/index.html#unveiling-the-underground-world-of-anti-cheats-17358)) \ No newline at end of file From a451675941b861f4538230640fae8ffea9cd577e Mon Sep 17 00:00:00 2001 From: KN4CK3R Date: Sat, 10 Oct 2020 16:08:23 +0200 Subject: [PATCH 162/223] Moved files to seperate folder. --- ReClass.NET/{UI => Controls}/BannerBox.cs | 0 .../{UI => Controls}/ColorBox.Designer.cs | 0 ReClass.NET/{UI => Controls}/ColorBox.cs | 0 ReClass.NET/{UI => Controls}/ColorBox.resx | 0 .../{UI => Controls}/CustomToolStripItems.cs | 0 .../DrawContextRequestEventArgs.cs | 0 .../{UI => Controls}/DualValueBox.Designer.cs | 0 ReClass.NET/{UI => Controls}/DualValueBox.cs | 0 .../{UI => Controls}/DualValueBox.resx | 0 ReClass.NET/{UI => Controls}/EnumComboBox.cs | 0 .../EnumDescriptionDisplay.cs | 0 .../{UI => Controls}/HotSpotTextBox.cs | 0 .../{UI => Controls}/HotkeyBox.Designer.cs | 0 ReClass.NET/{UI => Controls}/HotkeyBox.cs | 0 ReClass.NET/{UI => Controls}/HotkeyBox.resx | 0 ReClass.NET/{UI => Controls}/IconButton.cs | 0 .../{UI => Controls}/MemoryPreviewPopUp.cs | 0 .../MemoryRecordList.Designer.cs | 0 .../{UI => Controls}/MemoryRecordList.cs | 0 .../{UI => Controls}/MemoryRecordList.resx | 0 .../MemoryViewControl.Designer.cs | 0 .../{UI => Controls}/MemoryViewControl.cs | 0 .../{UI => Controls}/MemoryViewControl.resx | 0 .../{UI => Controls}/NodeClickEventArgs.cs | 0 .../{UI => Controls}/PlaceholderTextBox.cs | 0 .../{UI => Controls}/ProjectView.Designer.cs | 0 ReClass.NET/{UI => Controls}/ProjectView.cs | 0 ReClass.NET/{UI => Controls}/ProjectView.resx | 0 ReClass.NET/{UI => Controls}/ViewInfo.cs | 0 ReClass.NET/ReClass.NET.csproj | 59 ++++++++++--------- 30 files changed, 30 insertions(+), 29 deletions(-) rename ReClass.NET/{UI => Controls}/BannerBox.cs (100%) rename ReClass.NET/{UI => Controls}/ColorBox.Designer.cs (100%) rename ReClass.NET/{UI => Controls}/ColorBox.cs (100%) rename ReClass.NET/{UI => Controls}/ColorBox.resx (100%) rename ReClass.NET/{UI => Controls}/CustomToolStripItems.cs (100%) rename ReClass.NET/{UI => Controls}/DrawContextRequestEventArgs.cs (100%) rename ReClass.NET/{UI => Controls}/DualValueBox.Designer.cs (100%) rename ReClass.NET/{UI => Controls}/DualValueBox.cs (100%) rename ReClass.NET/{UI => Controls}/DualValueBox.resx (100%) rename ReClass.NET/{UI => Controls}/EnumComboBox.cs (100%) rename ReClass.NET/{UI => Controls}/EnumDescriptionDisplay.cs (100%) rename ReClass.NET/{UI => Controls}/HotSpotTextBox.cs (100%) rename ReClass.NET/{UI => Controls}/HotkeyBox.Designer.cs (100%) rename ReClass.NET/{UI => Controls}/HotkeyBox.cs (100%) rename ReClass.NET/{UI => Controls}/HotkeyBox.resx (100%) rename ReClass.NET/{UI => Controls}/IconButton.cs (100%) rename ReClass.NET/{UI => Controls}/MemoryPreviewPopUp.cs (100%) rename ReClass.NET/{UI => Controls}/MemoryRecordList.Designer.cs (100%) rename ReClass.NET/{UI => Controls}/MemoryRecordList.cs (100%) rename ReClass.NET/{UI => Controls}/MemoryRecordList.resx (100%) rename ReClass.NET/{UI => Controls}/MemoryViewControl.Designer.cs (100%) rename ReClass.NET/{UI => Controls}/MemoryViewControl.cs (100%) rename ReClass.NET/{UI => Controls}/MemoryViewControl.resx (100%) rename ReClass.NET/{UI => Controls}/NodeClickEventArgs.cs (100%) rename ReClass.NET/{UI => Controls}/PlaceholderTextBox.cs (100%) rename ReClass.NET/{UI => Controls}/ProjectView.Designer.cs (100%) rename ReClass.NET/{UI => Controls}/ProjectView.cs (100%) rename ReClass.NET/{UI => Controls}/ProjectView.resx (100%) rename ReClass.NET/{UI => Controls}/ViewInfo.cs (100%) diff --git a/ReClass.NET/UI/BannerBox.cs b/ReClass.NET/Controls/BannerBox.cs similarity index 100% rename from ReClass.NET/UI/BannerBox.cs rename to ReClass.NET/Controls/BannerBox.cs diff --git a/ReClass.NET/UI/ColorBox.Designer.cs b/ReClass.NET/Controls/ColorBox.Designer.cs similarity index 100% rename from ReClass.NET/UI/ColorBox.Designer.cs rename to ReClass.NET/Controls/ColorBox.Designer.cs diff --git a/ReClass.NET/UI/ColorBox.cs b/ReClass.NET/Controls/ColorBox.cs similarity index 100% rename from ReClass.NET/UI/ColorBox.cs rename to ReClass.NET/Controls/ColorBox.cs diff --git a/ReClass.NET/UI/ColorBox.resx b/ReClass.NET/Controls/ColorBox.resx similarity index 100% rename from ReClass.NET/UI/ColorBox.resx rename to ReClass.NET/Controls/ColorBox.resx diff --git a/ReClass.NET/UI/CustomToolStripItems.cs b/ReClass.NET/Controls/CustomToolStripItems.cs similarity index 100% rename from ReClass.NET/UI/CustomToolStripItems.cs rename to ReClass.NET/Controls/CustomToolStripItems.cs diff --git a/ReClass.NET/UI/DrawContextRequestEventArgs.cs b/ReClass.NET/Controls/DrawContextRequestEventArgs.cs similarity index 100% rename from ReClass.NET/UI/DrawContextRequestEventArgs.cs rename to ReClass.NET/Controls/DrawContextRequestEventArgs.cs diff --git a/ReClass.NET/UI/DualValueBox.Designer.cs b/ReClass.NET/Controls/DualValueBox.Designer.cs similarity index 100% rename from ReClass.NET/UI/DualValueBox.Designer.cs rename to ReClass.NET/Controls/DualValueBox.Designer.cs diff --git a/ReClass.NET/UI/DualValueBox.cs b/ReClass.NET/Controls/DualValueBox.cs similarity index 100% rename from ReClass.NET/UI/DualValueBox.cs rename to ReClass.NET/Controls/DualValueBox.cs diff --git a/ReClass.NET/UI/DualValueBox.resx b/ReClass.NET/Controls/DualValueBox.resx similarity index 100% rename from ReClass.NET/UI/DualValueBox.resx rename to ReClass.NET/Controls/DualValueBox.resx diff --git a/ReClass.NET/UI/EnumComboBox.cs b/ReClass.NET/Controls/EnumComboBox.cs similarity index 100% rename from ReClass.NET/UI/EnumComboBox.cs rename to ReClass.NET/Controls/EnumComboBox.cs diff --git a/ReClass.NET/UI/EnumDescriptionDisplay.cs b/ReClass.NET/Controls/EnumDescriptionDisplay.cs similarity index 100% rename from ReClass.NET/UI/EnumDescriptionDisplay.cs rename to ReClass.NET/Controls/EnumDescriptionDisplay.cs diff --git a/ReClass.NET/UI/HotSpotTextBox.cs b/ReClass.NET/Controls/HotSpotTextBox.cs similarity index 100% rename from ReClass.NET/UI/HotSpotTextBox.cs rename to ReClass.NET/Controls/HotSpotTextBox.cs diff --git a/ReClass.NET/UI/HotkeyBox.Designer.cs b/ReClass.NET/Controls/HotkeyBox.Designer.cs similarity index 100% rename from ReClass.NET/UI/HotkeyBox.Designer.cs rename to ReClass.NET/Controls/HotkeyBox.Designer.cs diff --git a/ReClass.NET/UI/HotkeyBox.cs b/ReClass.NET/Controls/HotkeyBox.cs similarity index 100% rename from ReClass.NET/UI/HotkeyBox.cs rename to ReClass.NET/Controls/HotkeyBox.cs diff --git a/ReClass.NET/UI/HotkeyBox.resx b/ReClass.NET/Controls/HotkeyBox.resx similarity index 100% rename from ReClass.NET/UI/HotkeyBox.resx rename to ReClass.NET/Controls/HotkeyBox.resx diff --git a/ReClass.NET/UI/IconButton.cs b/ReClass.NET/Controls/IconButton.cs similarity index 100% rename from ReClass.NET/UI/IconButton.cs rename to ReClass.NET/Controls/IconButton.cs diff --git a/ReClass.NET/UI/MemoryPreviewPopUp.cs b/ReClass.NET/Controls/MemoryPreviewPopUp.cs similarity index 100% rename from ReClass.NET/UI/MemoryPreviewPopUp.cs rename to ReClass.NET/Controls/MemoryPreviewPopUp.cs diff --git a/ReClass.NET/UI/MemoryRecordList.Designer.cs b/ReClass.NET/Controls/MemoryRecordList.Designer.cs similarity index 100% rename from ReClass.NET/UI/MemoryRecordList.Designer.cs rename to ReClass.NET/Controls/MemoryRecordList.Designer.cs diff --git a/ReClass.NET/UI/MemoryRecordList.cs b/ReClass.NET/Controls/MemoryRecordList.cs similarity index 100% rename from ReClass.NET/UI/MemoryRecordList.cs rename to ReClass.NET/Controls/MemoryRecordList.cs diff --git a/ReClass.NET/UI/MemoryRecordList.resx b/ReClass.NET/Controls/MemoryRecordList.resx similarity index 100% rename from ReClass.NET/UI/MemoryRecordList.resx rename to ReClass.NET/Controls/MemoryRecordList.resx diff --git a/ReClass.NET/UI/MemoryViewControl.Designer.cs b/ReClass.NET/Controls/MemoryViewControl.Designer.cs similarity index 100% rename from ReClass.NET/UI/MemoryViewControl.Designer.cs rename to ReClass.NET/Controls/MemoryViewControl.Designer.cs diff --git a/ReClass.NET/UI/MemoryViewControl.cs b/ReClass.NET/Controls/MemoryViewControl.cs similarity index 100% rename from ReClass.NET/UI/MemoryViewControl.cs rename to ReClass.NET/Controls/MemoryViewControl.cs diff --git a/ReClass.NET/UI/MemoryViewControl.resx b/ReClass.NET/Controls/MemoryViewControl.resx similarity index 100% rename from ReClass.NET/UI/MemoryViewControl.resx rename to ReClass.NET/Controls/MemoryViewControl.resx diff --git a/ReClass.NET/UI/NodeClickEventArgs.cs b/ReClass.NET/Controls/NodeClickEventArgs.cs similarity index 100% rename from ReClass.NET/UI/NodeClickEventArgs.cs rename to ReClass.NET/Controls/NodeClickEventArgs.cs diff --git a/ReClass.NET/UI/PlaceholderTextBox.cs b/ReClass.NET/Controls/PlaceholderTextBox.cs similarity index 100% rename from ReClass.NET/UI/PlaceholderTextBox.cs rename to ReClass.NET/Controls/PlaceholderTextBox.cs diff --git a/ReClass.NET/UI/ProjectView.Designer.cs b/ReClass.NET/Controls/ProjectView.Designer.cs similarity index 100% rename from ReClass.NET/UI/ProjectView.Designer.cs rename to ReClass.NET/Controls/ProjectView.Designer.cs diff --git a/ReClass.NET/UI/ProjectView.cs b/ReClass.NET/Controls/ProjectView.cs similarity index 100% rename from ReClass.NET/UI/ProjectView.cs rename to ReClass.NET/Controls/ProjectView.cs diff --git a/ReClass.NET/UI/ProjectView.resx b/ReClass.NET/Controls/ProjectView.resx similarity index 100% rename from ReClass.NET/UI/ProjectView.resx rename to ReClass.NET/Controls/ProjectView.resx diff --git a/ReClass.NET/UI/ViewInfo.cs b/ReClass.NET/Controls/ViewInfo.cs similarity index 100% rename from ReClass.NET/UI/ViewInfo.cs rename to ReClass.NET/Controls/ViewInfo.cs diff --git a/ReClass.NET/ReClass.NET.csproj b/ReClass.NET/ReClass.NET.csproj index c7249340..736b0388 100644 --- a/ReClass.NET/ReClass.NET.csproj +++ b/ReClass.NET/ReClass.NET.csproj @@ -295,7 +295,7 @@ - + Component @@ -318,14 +318,14 @@ - - + + - + UserControl - + ProjectView.cs @@ -334,13 +334,13 @@ CodeForm.cs - + UserControl - + ColorBox.cs - + Component @@ -352,41 +352,41 @@ LogForm.cs - + UserControl - + DualValueBox.cs - + Component - - + + UserControl - + HotkeyBox.cs - + Component - + Component - + UserControl - + MemoryRecordList.cs - + MemoryViewControl.cs - + Component @@ -420,7 +420,7 @@ - + Component @@ -439,7 +439,7 @@ - + UserControl @@ -510,7 +510,7 @@ - + @@ -558,7 +558,7 @@ ScannerForm.cs - + ProjectView.cs Designer @@ -569,19 +569,19 @@ MainForm.cs Designer - + ColorBox.cs - + DualValueBox.cs - + HotkeyBox.cs - + MemoryRecordList.cs - + MemoryViewControl.cs @@ -1011,6 +1011,7 @@ + powershell -Command "((Get-Date).ToUniversalTime()).ToString(\"yyyy\/MM\/dd HH:mm:ss\") | Out-File '$(ProjectDir)Resources\BuildDate.txt'" From a03b37113b06d191c588cb24c610de9e524cca2f Mon Sep 17 00:00:00 2001 From: KN4CK3R Date: Sat, 10 Oct 2020 16:11:48 +0200 Subject: [PATCH 163/223] Adjusted namespaces. --- ReClass.NET/CodeGenerator/CppCodeGenerator.cs | 4 +- ReClass.NET/Controls/BannerBox.cs | 3 +- ReClass.NET/Controls/ColorBox.Designer.cs | 2 +- ReClass.NET/Controls/ColorBox.cs | 2 +- ReClass.NET/Controls/CustomToolStripItems.cs | 4 +- .../Controls/DrawContextRequestEventArgs.cs | 4 +- ReClass.NET/Controls/DualValueBox.Designer.cs | 2 +- ReClass.NET/Controls/DualValueBox.cs | 4 +- ReClass.NET/Controls/EnumComboBox.cs | 2 +- .../Controls/EnumDescriptionDisplay.cs | 4 +- ReClass.NET/Controls/HotSpotTextBox.cs | 3 +- ReClass.NET/Controls/HotkeyBox.Designer.cs | 2 +- ReClass.NET/Controls/HotkeyBox.cs | 4 +- ReClass.NET/Controls/IconButton.cs | 2 +- ReClass.NET/Controls/MemoryPreviewPopUp.cs | 5 +- .../Controls/MemoryRecordList.Designer.cs | 2 +- ReClass.NET/Controls/MemoryRecordList.cs | 3 +- .../Controls/MemoryViewControl.Designer.cs | 6 +- ReClass.NET/Controls/MemoryViewControl.cs | 3 +- ReClass.NET/Controls/NodeClickEventArgs.cs | 4 +- ReClass.NET/Controls/PlaceholderTextBox.cs | 2 +- ReClass.NET/Controls/ProjectView.Designer.cs | 2 +- ReClass.NET/Controls/ProjectView.cs | 2 +- ReClass.NET/Controls/ViewInfo.cs | 5 +- .../ReClass/Legacy/BaseClassArrayNode.cs | 4 +- .../ReClass/Legacy/ClassPointerNode.cs | 4 +- .../DataExchange/ReClass/Legacy/CustomNode.cs | 4 +- ReClass.NET/Forms/AboutForm.Designer.cs | 8 +- .../Forms/ClassSelectionForm.Designer.cs | 12 +- ReClass.NET/Forms/CodeForm.Designer.cs | 8 +- ReClass.NET/Forms/EnumEditorForm.Designer.cs | 8 +- ReClass.NET/Forms/EnumEditorForm.cs | 3 +- ReClass.NET/Forms/EnumListForm.Designer.cs | 24 ++-- .../Forms/EnumSelectionForm.Designer.cs | 24 ++-- ReClass.NET/Forms/FoundCodeForm.Designer.cs | 8 +- .../Forms/InputCorrelatorForm.Designer.cs | 12 +- ReClass.NET/Forms/MainForm.Designer.cs | 134 +++++++++--------- ReClass.NET/Forms/MainForm.Functions.cs | 1 + ReClass.NET/Forms/MainForm.cs | 1 + .../Forms/NamedAddressesForm.Designer.cs | 24 ++-- ReClass.NET/Forms/PluginForm.Designer.cs | 8 +- .../Forms/ProcessBrowserForm.Designer.cs | 8 +- ReClass.NET/Forms/ProcessInfoForm.Designer.cs | 8 +- ReClass.NET/Forms/ScannerForm.Designer.cs | 34 ++--- ReClass.NET/Forms/ScannerForm.cs | 1 + ReClass.NET/Forms/SettingsForm.Designer.cs | 64 +++++---- ReClass.NET/Forms/SettingsForm.cs | 1 + ReClass.NET/Nodes/ArrayNode.cs | 4 +- ReClass.NET/Nodes/BaseFunctionNode.cs | 1 + ReClass.NET/Nodes/BaseFunctionPtrNode.cs | 1 + ReClass.NET/Nodes/BaseHexCommentNode.cs | 3 +- ReClass.NET/Nodes/BaseHexNode.cs | 1 + ReClass.NET/Nodes/BaseMatrixNode.cs | 3 +- ReClass.NET/Nodes/BaseNode.cs | 1 + ReClass.NET/Nodes/BaseNumericNode.cs | 3 +- ReClass.NET/Nodes/BaseTextNode.cs | 3 +- ReClass.NET/Nodes/BaseTextPtrNode.cs | 3 +- ReClass.NET/Nodes/BaseWrapperArrayNode.cs | 3 +- ReClass.NET/Nodes/BitFieldNode.cs | 3 +- ReClass.NET/Nodes/BoolNode.cs | 3 +- ReClass.NET/Nodes/ClassInstanceNode.cs | 1 + ReClass.NET/Nodes/ClassNode.cs | 3 +- ReClass.NET/Nodes/DoubleNode.cs | 3 +- ReClass.NET/Nodes/EnumNode.cs | 3 +- ReClass.NET/Nodes/FloatNode.cs | 3 +- ReClass.NET/Nodes/FunctionNode.cs | 1 + ReClass.NET/Nodes/FunctionPtrNode.cs | 4 +- ReClass.NET/Nodes/Hex16Node.cs | 3 +- ReClass.NET/Nodes/Hex32Node.cs | 3 +- ReClass.NET/Nodes/Hex64Node.cs | 3 +- ReClass.NET/Nodes/Hex8Node.cs | 1 + ReClass.NET/Nodes/Int16Node.cs | 3 +- ReClass.NET/Nodes/Int32Node.cs | 3 +- ReClass.NET/Nodes/Int64Node.cs | 3 +- ReClass.NET/Nodes/Int8Node.cs | 3 +- ReClass.NET/Nodes/Matrix3x3Node.cs | 1 + ReClass.NET/Nodes/Matrix3x4Node.cs | 1 + ReClass.NET/Nodes/Matrix4x4Node.cs | 1 + ReClass.NET/Nodes/PointerNode.cs | 3 +- ReClass.NET/Nodes/UInt16Node.cs | 3 +- ReClass.NET/Nodes/UInt32Node.cs | 3 +- ReClass.NET/Nodes/UInt64Node.cs | 3 +- ReClass.NET/Nodes/UInt8Node.cs | 3 +- ReClass.NET/Nodes/UTF16TextNode.cs | 4 +- ReClass.NET/Nodes/UTF16TextPtrNode.cs | 4 +- ReClass.NET/Nodes/UTF32TextNode.cs | 4 +- ReClass.NET/Nodes/UTF32TextPtrNode.cs | 4 +- ReClass.NET/Nodes/UTF8TextNode.cs | 4 +- ReClass.NET/Nodes/UTF8TextPtrNode.cs | 4 +- ReClass.NET/Nodes/UnionNode.cs | 3 +- ReClass.NET/Nodes/Vector2Node.cs | 1 + ReClass.NET/Nodes/Vector3Node.cs | 1 + ReClass.NET/Nodes/Vector4Node.cs | 1 + ReClass.NET/Nodes/VirtualMethodNode.cs | 4 +- ReClass.NET/Nodes/VirtualMethodTableNode.cs | 3 +- ReClass.NET/UI/NodeTypesBuilder.cs | 1 + 96 files changed, 344 insertions(+), 263 deletions(-) diff --git a/ReClass.NET/CodeGenerator/CppCodeGenerator.cs b/ReClass.NET/CodeGenerator/CppCodeGenerator.cs index 41733634..10318705 100644 --- a/ReClass.NET/CodeGenerator/CppCodeGenerator.cs +++ b/ReClass.NET/CodeGenerator/CppCodeGenerator.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.CodeDom.Compiler; using System.Collections.Generic; using System.Diagnostics.Contracts; @@ -6,11 +6,11 @@ using System.IO; using System.Linq; using System.Text; +using ReClassNET.Controls; using ReClassNET.Extensions; using ReClassNET.Logger; using ReClassNET.Nodes; using ReClassNET.Project; -using ReClassNET.UI; namespace ReClassNET.CodeGenerator { diff --git a/ReClass.NET/Controls/BannerBox.cs b/ReClass.NET/Controls/BannerBox.cs index ca8eb6e5..b3cdab8c 100644 --- a/ReClass.NET/Controls/BannerBox.cs +++ b/ReClass.NET/Controls/BannerBox.cs @@ -1,8 +1,9 @@ using System.ComponentModel; using System.Drawing; using System.Windows.Forms; +using ReClassNET.UI; -namespace ReClassNET.UI +namespace ReClassNET.Controls { public class BannerBox : Control, ISupportInitialize { diff --git a/ReClass.NET/Controls/ColorBox.Designer.cs b/ReClass.NET/Controls/ColorBox.Designer.cs index 2cdd1b19..0757df19 100644 --- a/ReClass.NET/Controls/ColorBox.Designer.cs +++ b/ReClass.NET/Controls/ColorBox.Designer.cs @@ -1,4 +1,4 @@ -namespace ReClassNET.UI +namespace ReClassNET.Controls { partial class ColorBox { diff --git a/ReClass.NET/Controls/ColorBox.cs b/ReClass.NET/Controls/ColorBox.cs index d51efdaa..9325e645 100644 --- a/ReClass.NET/Controls/ColorBox.cs +++ b/ReClass.NET/Controls/ColorBox.cs @@ -4,7 +4,7 @@ using System.Drawing; using System.Windows.Forms; -namespace ReClassNET.UI +namespace ReClassNET.Controls { [DefaultEvent(nameof(ColorChanged))] [DefaultBindingProperty(nameof(Color))] diff --git a/ReClass.NET/Controls/CustomToolStripItems.cs b/ReClass.NET/Controls/CustomToolStripItems.cs index 779b24d0..ea186f17 100644 --- a/ReClass.NET/Controls/CustomToolStripItems.cs +++ b/ReClass.NET/Controls/CustomToolStripItems.cs @@ -1,8 +1,8 @@ -using System; +using System; using System.Windows.Forms; using System.Windows.Forms.Design; -namespace ReClassNET.UI +namespace ReClassNET.Controls { [ToolStripItemDesignerAvailability(ToolStripItemDesignerAvailability.All)] public class IntegerToolStripMenuItem : ToolStripMenuItem diff --git a/ReClass.NET/Controls/DrawContextRequestEventArgs.cs b/ReClass.NET/Controls/DrawContextRequestEventArgs.cs index 1c874a3b..2f57a36f 100644 --- a/ReClass.NET/Controls/DrawContextRequestEventArgs.cs +++ b/ReClass.NET/Controls/DrawContextRequestEventArgs.cs @@ -1,8 +1,8 @@ -using System; +using System; using ReClassNET.Memory; using ReClassNET.Nodes; -namespace ReClassNET.UI +namespace ReClassNET.Controls { public class DrawContextRequestEventArgs : EventArgs { diff --git a/ReClass.NET/Controls/DualValueBox.Designer.cs b/ReClass.NET/Controls/DualValueBox.Designer.cs index f94500f7..dd5a675b 100644 --- a/ReClass.NET/Controls/DualValueBox.Designer.cs +++ b/ReClass.NET/Controls/DualValueBox.Designer.cs @@ -1,4 +1,4 @@ -namespace ReClassNET.UI +namespace ReClassNET.Controls { partial class DualValueBox { diff --git a/ReClass.NET/Controls/DualValueBox.cs b/ReClass.NET/Controls/DualValueBox.cs index a3f473f9..d2b8d264 100644 --- a/ReClass.NET/Controls/DualValueBox.cs +++ b/ReClass.NET/Controls/DualValueBox.cs @@ -1,8 +1,8 @@ -using System.ComponentModel; +using System.ComponentModel; using System.Windows.Forms; using System.Windows.Forms.Design; -namespace ReClassNET.UI +namespace ReClassNET.Controls { [Designer(typeof(DualValueControlDesigner))] public partial class DualValueBox : UserControl diff --git a/ReClass.NET/Controls/EnumComboBox.cs b/ReClass.NET/Controls/EnumComboBox.cs index b0567ead..4875b85d 100644 --- a/ReClass.NET/Controls/EnumComboBox.cs +++ b/ReClass.NET/Controls/EnumComboBox.cs @@ -5,7 +5,7 @@ using System.Windows.Forms; using ReClassNET.Extensions; -namespace ReClassNET.UI +namespace ReClassNET.Controls { public class EnumComboBox : ComboBox where TEnum : struct { diff --git a/ReClass.NET/Controls/EnumDescriptionDisplay.cs b/ReClass.NET/Controls/EnumDescriptionDisplay.cs index 5f638238..e2fa4c1b 100644 --- a/ReClass.NET/Controls/EnumDescriptionDisplay.cs +++ b/ReClass.NET/Controls/EnumDescriptionDisplay.cs @@ -1,11 +1,11 @@ -using System; +using System; using System.Collections.Generic; using System.ComponentModel; using System.Diagnostics.Contracts; using System.Linq; using System.Reflection; -namespace ReClassNET.UI +namespace ReClassNET.Controls { public class EnumDescriptionDisplay where TEnum : struct { diff --git a/ReClass.NET/Controls/HotSpotTextBox.cs b/ReClass.NET/Controls/HotSpotTextBox.cs index 70b19a64..218cdeb7 100644 --- a/ReClass.NET/Controls/HotSpotTextBox.cs +++ b/ReClass.NET/Controls/HotSpotTextBox.cs @@ -2,8 +2,9 @@ using System.ComponentModel; using System.Drawing; using System.Windows.Forms; +using ReClassNET.UI; -namespace ReClassNET.UI +namespace ReClassNET.Controls { public class HotSpotTextBox : TextBox { diff --git a/ReClass.NET/Controls/HotkeyBox.Designer.cs b/ReClass.NET/Controls/HotkeyBox.Designer.cs index 5654a7d5..c65ead37 100644 --- a/ReClass.NET/Controls/HotkeyBox.Designer.cs +++ b/ReClass.NET/Controls/HotkeyBox.Designer.cs @@ -1,4 +1,4 @@ -namespace ReClassNET.UI +namespace ReClassNET.Controls { partial class HotkeyBox { diff --git a/ReClass.NET/Controls/HotkeyBox.cs b/ReClass.NET/Controls/HotkeyBox.cs index 8a5d1747..9a24e7b3 100644 --- a/ReClass.NET/Controls/HotkeyBox.cs +++ b/ReClass.NET/Controls/HotkeyBox.cs @@ -1,11 +1,11 @@ -using System; +using System; using System.ComponentModel; using System.Linq; using System.Windows.Forms; using System.Windows.Forms.Design; using ReClassNET.Input; -namespace ReClassNET.UI +namespace ReClassNET.Controls { [Designer(typeof(HotkeyBoxDesigner))] public partial class HotkeyBox : UserControl diff --git a/ReClass.NET/Controls/IconButton.cs b/ReClass.NET/Controls/IconButton.cs index c2d80304..5d45a198 100644 --- a/ReClass.NET/Controls/IconButton.cs +++ b/ReClass.NET/Controls/IconButton.cs @@ -6,7 +6,7 @@ using System.Windows.Forms; using System.Windows.Forms.Design; -namespace ReClassNET.UI +namespace ReClassNET.Controls { /// /// Based on . diff --git a/ReClass.NET/Controls/MemoryPreviewPopUp.cs b/ReClass.NET/Controls/MemoryPreviewPopUp.cs index 0f13353d..218e24de 100644 --- a/ReClass.NET/Controls/MemoryPreviewPopUp.cs +++ b/ReClass.NET/Controls/MemoryPreviewPopUp.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.ComponentModel; using System.Diagnostics.Contracts; @@ -8,8 +8,9 @@ using ReClassNET.Extensions; using ReClassNET.Memory; using ReClassNET.Nodes; +using ReClassNET.UI; -namespace ReClassNET.UI +namespace ReClassNET.Controls { [ToolboxItem(false)] public class MemoryPreviewPopUp : ToolStripDropDown diff --git a/ReClass.NET/Controls/MemoryRecordList.Designer.cs b/ReClass.NET/Controls/MemoryRecordList.Designer.cs index 34475868..8f3e0379 100644 --- a/ReClass.NET/Controls/MemoryRecordList.Designer.cs +++ b/ReClass.NET/Controls/MemoryRecordList.Designer.cs @@ -1,4 +1,4 @@ -namespace ReClassNET.UI +namespace ReClassNET.Controls { partial class MemoryRecordList { diff --git a/ReClass.NET/Controls/MemoryRecordList.cs b/ReClass.NET/Controls/MemoryRecordList.cs index 4bd53773..b3a06672 100644 --- a/ReClass.NET/Controls/MemoryRecordList.cs +++ b/ReClass.NET/Controls/MemoryRecordList.cs @@ -7,8 +7,9 @@ using ReClassNET.Extensions; using ReClassNET.Memory; using ReClassNET.MemoryScanner; +using ReClassNET.UI; -namespace ReClassNET.UI +namespace ReClassNET.Controls { public delegate void MemorySearchResultControlResultDoubleClickEventHandler(object sender, MemoryRecord record); diff --git a/ReClass.NET/Controls/MemoryViewControl.Designer.cs b/ReClass.NET/Controls/MemoryViewControl.Designer.cs index a7e9ccc1..942c196d 100644 --- a/ReClass.NET/Controls/MemoryViewControl.Designer.cs +++ b/ReClass.NET/Controls/MemoryViewControl.Designer.cs @@ -1,4 +1,4 @@ -namespace ReClassNET.UI +namespace ReClassNET.Controls { partial class MemoryViewControl { @@ -30,7 +30,7 @@ private void InitializeComponent() { this.components = new System.ComponentModel.Container(); this.repaintTimer = new System.Windows.Forms.Timer(this.components); - this.hotSpotEditBox = new ReClassNET.UI.HotSpotTextBox(); + this.hotSpotEditBox = new HotSpotTextBox(); this.nodeInfoToolTip = new System.Windows.Forms.ToolTip(this.components); this.SuspendLayout(); // @@ -49,7 +49,7 @@ private void InitializeComponent() this.hotSpotEditBox.TabIndex = 1; this.hotSpotEditBox.TabStop = false; this.hotSpotEditBox.Visible = false; - this.hotSpotEditBox.Committed += new ReClassNET.UI.HotSpotTextBoxCommitEventHandler(this.editBox_Committed); + this.hotSpotEditBox.Committed += new HotSpotTextBoxCommitEventHandler(this.editBox_Committed); // // nodeInfoToolTip // diff --git a/ReClass.NET/Controls/MemoryViewControl.cs b/ReClass.NET/Controls/MemoryViewControl.cs index f6cef494..c6d2742c 100644 --- a/ReClass.NET/Controls/MemoryViewControl.cs +++ b/ReClass.NET/Controls/MemoryViewControl.cs @@ -7,9 +7,10 @@ using ReClassNET.Extensions; using ReClassNET.Memory; using ReClassNET.Nodes; +using ReClassNET.UI; using ReClassNET.Util; -namespace ReClassNET.UI +namespace ReClassNET.Controls { public partial class MemoryViewControl : UserControl { diff --git a/ReClass.NET/Controls/NodeClickEventArgs.cs b/ReClass.NET/Controls/NodeClickEventArgs.cs index 70f3948a..3d9dd82f 100644 --- a/ReClass.NET/Controls/NodeClickEventArgs.cs +++ b/ReClass.NET/Controls/NodeClickEventArgs.cs @@ -1,11 +1,11 @@ -using System; +using System; using System.Diagnostics.Contracts; using System.Drawing; using System.Windows.Forms; using ReClassNET.Memory; using ReClassNET.Nodes; -namespace ReClassNET.UI +namespace ReClassNET.Controls { public class NodeClickEventArgs : EventArgs { diff --git a/ReClass.NET/Controls/PlaceholderTextBox.cs b/ReClass.NET/Controls/PlaceholderTextBox.cs index 282bb08d..59734c10 100644 --- a/ReClass.NET/Controls/PlaceholderTextBox.cs +++ b/ReClass.NET/Controls/PlaceholderTextBox.cs @@ -3,7 +3,7 @@ using System.Drawing; using System.Windows.Forms; -namespace ReClassNET.UI +namespace ReClassNET.Controls { public class PlaceholderTextBox : TextBox { diff --git a/ReClass.NET/Controls/ProjectView.Designer.cs b/ReClass.NET/Controls/ProjectView.Designer.cs index 1658a477..25d6422e 100644 --- a/ReClass.NET/Controls/ProjectView.Designer.cs +++ b/ReClass.NET/Controls/ProjectView.Designer.cs @@ -1,4 +1,4 @@ -namespace ReClassNET.UI +namespace ReClassNET.Controls { partial class ProjectView { diff --git a/ReClass.NET/Controls/ProjectView.cs b/ReClass.NET/Controls/ProjectView.cs index 94d1f27d..f1b12261 100644 --- a/ReClass.NET/Controls/ProjectView.cs +++ b/ReClass.NET/Controls/ProjectView.cs @@ -8,7 +8,7 @@ using ReClassNET.Nodes; using ReClassNET.Project; -namespace ReClassNET.UI +namespace ReClassNET.Controls { public partial class ProjectView : UserControl { diff --git a/ReClass.NET/Controls/ViewInfo.cs b/ReClass.NET/Controls/ViewInfo.cs index 0519d37d..7f0028e5 100644 --- a/ReClass.NET/Controls/ViewInfo.cs +++ b/ReClass.NET/Controls/ViewInfo.cs @@ -1,9 +1,10 @@ -using System; +using System; using System.Collections.Generic; using System.Drawing; using ReClassNET.Memory; +using ReClassNET.UI; -namespace ReClassNET.UI +namespace ReClassNET.Controls { public class ViewInfo { diff --git a/ReClass.NET/DataExchange/ReClass/Legacy/BaseClassArrayNode.cs b/ReClass.NET/DataExchange/ReClass/Legacy/BaseClassArrayNode.cs index 97f4561b..563902f1 100644 --- a/ReClass.NET/DataExchange/ReClass/Legacy/BaseClassArrayNode.cs +++ b/ReClass.NET/DataExchange/ReClass/Legacy/BaseClassArrayNode.cs @@ -1,7 +1,7 @@ -using System; +using System; using System.Drawing; +using ReClassNET.Controls; using ReClassNET.Nodes; -using ReClassNET.UI; namespace ReClassNET.DataExchange.ReClass.Legacy { diff --git a/ReClass.NET/DataExchange/ReClass/Legacy/ClassPointerNode.cs b/ReClass.NET/DataExchange/ReClass/Legacy/ClassPointerNode.cs index 6511cb04..fc5de075 100644 --- a/ReClass.NET/DataExchange/ReClass/Legacy/ClassPointerNode.cs +++ b/ReClass.NET/DataExchange/ReClass/Legacy/ClassPointerNode.cs @@ -1,7 +1,7 @@ -using System; +using System; using System.Drawing; +using ReClassNET.Controls; using ReClassNET.Nodes; -using ReClassNET.UI; namespace ReClassNET.DataExchange.ReClass.Legacy { diff --git a/ReClass.NET/DataExchange/ReClass/Legacy/CustomNode.cs b/ReClass.NET/DataExchange/ReClass/Legacy/CustomNode.cs index 96238c84..53c6bd13 100644 --- a/ReClass.NET/DataExchange/ReClass/Legacy/CustomNode.cs +++ b/ReClass.NET/DataExchange/ReClass/Legacy/CustomNode.cs @@ -1,8 +1,8 @@ -using System; +using System; using System.Collections.Generic; using System.Drawing; +using ReClassNET.Controls; using ReClassNET.Nodes; -using ReClassNET.UI; namespace ReClassNET.DataExchange.ReClass.Legacy { diff --git a/ReClass.NET/Forms/AboutForm.Designer.cs b/ReClass.NET/Forms/AboutForm.Designer.cs index 25e94816..97793e12 100644 --- a/ReClass.NET/Forms/AboutForm.Designer.cs +++ b/ReClass.NET/Forms/AboutForm.Designer.cs @@ -1,4 +1,6 @@ -namespace ReClassNET.Forms +using ReClassNET.Controls; + +namespace ReClassNET.Forms { partial class AboutForm { @@ -29,7 +31,7 @@ protected override void Dispose(bool disposing) private void InitializeComponent() { System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(AboutForm)); - this.bannerBox = new ReClassNET.UI.BannerBox(); + this.bannerBox = new BannerBox(); this.infoLabel = new System.Windows.Forms.Label(); this.platformLabel = new System.Windows.Forms.Label(); this.buildTimeLabel = new System.Windows.Forms.Label(); @@ -191,7 +193,7 @@ private void InitializeComponent() #endregion - private UI.BannerBox bannerBox; + private BannerBox bannerBox; private System.Windows.Forms.Label infoLabel; private System.Windows.Forms.Label platformLabel; private System.Windows.Forms.Label buildTimeLabel; diff --git a/ReClass.NET/Forms/ClassSelectionForm.Designer.cs b/ReClass.NET/Forms/ClassSelectionForm.Designer.cs index 7a2aa18f..cc441d54 100644 --- a/ReClass.NET/Forms/ClassSelectionForm.Designer.cs +++ b/ReClass.NET/Forms/ClassSelectionForm.Designer.cs @@ -1,4 +1,6 @@ -namespace ReClassNET.Forms +using ReClassNET.Controls; + +namespace ReClassNET.Forms { partial class ClassSelectionForm { @@ -28,9 +30,9 @@ protected override void Dispose(bool disposing) /// private void InitializeComponent() { - this.bannerBox = new ReClassNET.UI.BannerBox(); + this.bannerBox = new BannerBox(); this.classesListBox = new System.Windows.Forms.ListBox(); - this.filterNameTextBox = new ReClassNET.UI.PlaceholderTextBox(); + this.filterNameTextBox = new PlaceholderTextBox(); this.cancelButton = new System.Windows.Forms.Button(); this.selectButton = new System.Windows.Forms.Button(); ((System.ComponentModel.ISupportInitialize)(this.bannerBox)).BeginInit(); @@ -118,9 +120,9 @@ private void InitializeComponent() #endregion - private UI.BannerBox bannerBox; + private BannerBox bannerBox; private System.Windows.Forms.ListBox classesListBox; - private UI.PlaceholderTextBox filterNameTextBox; + private PlaceholderTextBox filterNameTextBox; private System.Windows.Forms.Button cancelButton; private System.Windows.Forms.Button selectButton; } diff --git a/ReClass.NET/Forms/CodeForm.Designer.cs b/ReClass.NET/Forms/CodeForm.Designer.cs index fee807e4..4c419b03 100644 --- a/ReClass.NET/Forms/CodeForm.Designer.cs +++ b/ReClass.NET/Forms/CodeForm.Designer.cs @@ -1,4 +1,6 @@ -namespace ReClassNET.Forms +using ReClassNET.Controls; + +namespace ReClassNET.Forms { partial class CodeForm { @@ -28,7 +30,7 @@ protected override void Dispose(bool disposing) /// private void InitializeComponent() { - this.bannerBox = new ReClassNET.UI.BannerBox(); + this.bannerBox = new BannerBox(); this.codeRichTextBox = new System.Windows.Forms.RichTextBox(); ((System.ComponentModel.ISupportInitialize)(this.bannerBox)).BeginInit(); this.SuspendLayout(); @@ -71,7 +73,7 @@ private void InitializeComponent() } #endregion - private UI.BannerBox bannerBox; + private BannerBox bannerBox; private System.Windows.Forms.RichTextBox codeRichTextBox; } } \ No newline at end of file diff --git a/ReClass.NET/Forms/EnumEditorForm.Designer.cs b/ReClass.NET/Forms/EnumEditorForm.Designer.cs index 998c6184..c06e2978 100644 --- a/ReClass.NET/Forms/EnumEditorForm.Designer.cs +++ b/ReClass.NET/Forms/EnumEditorForm.Designer.cs @@ -1,4 +1,6 @@ -namespace ReClassNET.Forms +using ReClassNET.Controls; + +namespace ReClassNET.Forms { partial class EnumEditorForm { @@ -28,7 +30,7 @@ protected override void Dispose(bool disposing) ///
private void InitializeComponent() { - this.bannerBox = new ReClassNET.UI.BannerBox(); + this.bannerBox = new BannerBox(); this.saveButton = new System.Windows.Forms.Button(); this.enumNameLabel = new System.Windows.Forms.Label(); this.cancelButton = new System.Windows.Forms.Button(); @@ -179,7 +181,7 @@ private void InitializeComponent() #endregion - private UI.BannerBox bannerBox; + private BannerBox bannerBox; private System.Windows.Forms.Button saveButton; private System.Windows.Forms.Label enumNameLabel; private System.Windows.Forms.Button cancelButton; diff --git a/ReClass.NET/Forms/EnumEditorForm.cs b/ReClass.NET/Forms/EnumEditorForm.cs index 573ea1b9..cfdc5302 100644 --- a/ReClass.NET/Forms/EnumEditorForm.cs +++ b/ReClass.NET/Forms/EnumEditorForm.cs @@ -1,8 +1,9 @@ -using System; +using System; using System.Collections.Generic; using System.Diagnostics.Contracts; using System.Linq; using System.Windows.Forms; +using ReClassNET.Controls; using ReClassNET.Project; using ReClassNET.UI; diff --git a/ReClass.NET/Forms/EnumListForm.Designer.cs b/ReClass.NET/Forms/EnumListForm.Designer.cs index b03c4e31..44d1f381 100644 --- a/ReClass.NET/Forms/EnumListForm.Designer.cs +++ b/ReClass.NET/Forms/EnumListForm.Designer.cs @@ -1,4 +1,6 @@ -namespace ReClassNET.Forms +using ReClassNET.Controls; + +namespace ReClassNET.Forms { partial class EnumListForm { @@ -28,12 +30,12 @@ protected override void Dispose(bool disposing) ///
private void InitializeComponent() { - this.filterNameTextBox = new ReClassNET.UI.PlaceholderTextBox(); + this.filterNameTextBox = new PlaceholderTextBox(); this.itemListBox = new System.Windows.Forms.ListBox(); - this.bannerBox = new ReClassNET.UI.BannerBox(); - this.addEnumIconButton = new ReClassNET.UI.IconButton(); - this.removeEnumIconButton = new ReClassNET.UI.IconButton(); - this.editEnumIconButton = new ReClassNET.UI.IconButton(); + this.bannerBox = new BannerBox(); + this.addEnumIconButton = new IconButton(); + this.removeEnumIconButton = new IconButton(); + this.editEnumIconButton = new IconButton(); ((System.ComponentModel.ISupportInitialize)(this.bannerBox)).BeginInit(); this.SuspendLayout(); // @@ -130,11 +132,11 @@ private void InitializeComponent() } #endregion - private UI.PlaceholderTextBox filterNameTextBox; + private PlaceholderTextBox filterNameTextBox; private System.Windows.Forms.ListBox itemListBox; - private UI.BannerBox bannerBox; - private UI.IconButton addEnumIconButton; - private UI.IconButton removeEnumIconButton; - private UI.IconButton editEnumIconButton; + private BannerBox bannerBox; + private IconButton addEnumIconButton; + private IconButton removeEnumIconButton; + private IconButton editEnumIconButton; } } \ No newline at end of file diff --git a/ReClass.NET/Forms/EnumSelectionForm.Designer.cs b/ReClass.NET/Forms/EnumSelectionForm.Designer.cs index 3e96b886..6334244a 100644 --- a/ReClass.NET/Forms/EnumSelectionForm.Designer.cs +++ b/ReClass.NET/Forms/EnumSelectionForm.Designer.cs @@ -1,4 +1,6 @@ -namespace ReClassNET.Forms +using ReClassNET.Controls; + +namespace ReClassNET.Forms { partial class EnumSelectionForm { @@ -30,12 +32,12 @@ private void InitializeComponent() { this.selectButton = new System.Windows.Forms.Button(); this.cancelButton = new System.Windows.Forms.Button(); - this.filterNameTextBox = new ReClassNET.UI.PlaceholderTextBox(); + this.filterNameTextBox = new PlaceholderTextBox(); this.itemListBox = new System.Windows.Forms.ListBox(); - this.bannerBox = new ReClassNET.UI.BannerBox(); - this.addEnumIconButton = new ReClassNET.UI.IconButton(); - this.removeEnumIconButton = new ReClassNET.UI.IconButton(); - this.editEnumIconButton = new ReClassNET.UI.IconButton(); + this.bannerBox = new BannerBox(); + this.addEnumIconButton = new IconButton(); + this.removeEnumIconButton = new IconButton(); + this.editEnumIconButton = new IconButton(); ((System.ComponentModel.ISupportInitialize)(this.bannerBox)).BeginInit(); this.SuspendLayout(); // @@ -163,11 +165,11 @@ private void InitializeComponent() private System.Windows.Forms.Button selectButton; private System.Windows.Forms.Button cancelButton; - private UI.PlaceholderTextBox filterNameTextBox; + private PlaceholderTextBox filterNameTextBox; private System.Windows.Forms.ListBox itemListBox; - private UI.BannerBox bannerBox; - private UI.IconButton addEnumIconButton; - private UI.IconButton removeEnumIconButton; - private UI.IconButton editEnumIconButton; + private BannerBox bannerBox; + private IconButton addEnumIconButton; + private IconButton removeEnumIconButton; + private IconButton editEnumIconButton; } } \ No newline at end of file diff --git a/ReClass.NET/Forms/FoundCodeForm.Designer.cs b/ReClass.NET/Forms/FoundCodeForm.Designer.cs index 1e1d5dcf..75df742e 100644 --- a/ReClass.NET/Forms/FoundCodeForm.Designer.cs +++ b/ReClass.NET/Forms/FoundCodeForm.Designer.cs @@ -1,4 +1,6 @@ -namespace ReClassNET.Forms +using ReClassNET.Controls; + +namespace ReClassNET.Forms { partial class FoundCodeForm { @@ -36,7 +38,7 @@ private void InitializeComponent() this.stopButton = new System.Windows.Forms.Button(); this.closeButton = new System.Windows.Forms.Button(); this.createFunctionButton = new System.Windows.Forms.Button(); - this.bannerBox = new ReClassNET.UI.BannerBox(); + this.bannerBox = new BannerBox(); ((System.ComponentModel.ISupportInitialize)(this.splitContainer)).BeginInit(); this.splitContainer.Panel1.SuspendLayout(); this.splitContainer.Panel2.SuspendLayout(); @@ -194,6 +196,6 @@ private void InitializeComponent() private System.Windows.Forms.Button closeButton; private System.Windows.Forms.TextBox infoTextBox; private System.Windows.Forms.Button createFunctionButton; - private UI.BannerBox bannerBox; + private BannerBox bannerBox; } } \ No newline at end of file diff --git a/ReClass.NET/Forms/InputCorrelatorForm.Designer.cs b/ReClass.NET/Forms/InputCorrelatorForm.Designer.cs index 6b75bc36..27a18a9f 100644 --- a/ReClass.NET/Forms/InputCorrelatorForm.Designer.cs +++ b/ReClass.NET/Forms/InputCorrelatorForm.Designer.cs @@ -1,4 +1,6 @@ -namespace ReClassNET.Forms +using ReClassNET.Controls; + +namespace ReClassNET.Forms { partial class InputCorrelatorForm { @@ -30,14 +32,14 @@ private void InitializeComponent() { this.components = new System.ComponentModel.Container(); this.refineTimer = new System.Windows.Forms.Timer(this.components); - this.bannerBox = new ReClassNET.UI.BannerBox(); + this.bannerBox = new BannerBox(); this.settingsGroupBox = new System.Windows.Forms.GroupBox(); this.removeButton = new System.Windows.Forms.Button(); this.addButton = new System.Windows.Forms.Button(); this.valueTypeComboBox = new ReClassNET.Forms.ScannerForm.ScanValueTypeComboBox(); this.label1 = new System.Windows.Forms.Label(); this.hotkeyListBox = new System.Windows.Forms.ListBox(); - this.hotkeyBox = new ReClassNET.UI.HotkeyBox(); + this.hotkeyBox = new HotkeyBox(); this.startStopButton = new System.Windows.Forms.Button(); this.infoLabel = new System.Windows.Forms.Label(); ((System.ComponentModel.ISupportInitialize)(this.bannerBox)).BeginInit(); @@ -181,9 +183,9 @@ private void InitializeComponent() #endregion private System.Windows.Forms.Timer refineTimer; - private UI.BannerBox bannerBox; + private BannerBox bannerBox; private System.Windows.Forms.GroupBox settingsGroupBox; - private UI.HotkeyBox hotkeyBox; + private HotkeyBox hotkeyBox; private System.Windows.Forms.ListBox hotkeyListBox; private System.Windows.Forms.Button removeButton; private System.Windows.Forms.Button addButton; diff --git a/ReClass.NET/Forms/MainForm.Designer.cs b/ReClass.NET/Forms/MainForm.Designer.cs index dc38bd37..71a1a118 100644 --- a/ReClass.NET/Forms/MainForm.Designer.cs +++ b/ReClass.NET/Forms/MainForm.Designer.cs @@ -1,4 +1,6 @@ -namespace ReClassNET.Forms +using ReClassNET.Controls; + +namespace ReClassNET.Forms { partial class MainForm { @@ -32,7 +34,7 @@ private void InitializeComponent() System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MainForm)); this.processUpdateTimer = new System.Windows.Forms.Timer(this.components); this.splitContainer = new System.Windows.Forms.SplitContainer(); - this.projectView = new ReClassNET.UI.ProjectView(); + this.projectView = new ProjectView(); this.projectClassContextMenuStrip = new System.Windows.Forms.ContextMenuStrip(this.components); this.deleteClassToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.toolStripSeparator19 = new System.Windows.Forms.ToolStripSeparator(); @@ -51,26 +53,26 @@ private void InitializeComponent() this.editEnumToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.projectEnumsContextMenuStrip = new System.Windows.Forms.ContextMenuStrip(this.components); this.editEnumsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.memoryViewControl = new ReClassNET.UI.MemoryViewControl(); + this.memoryViewControl = new MemoryViewControl(); this.selectedNodeContextMenuStrip = new System.Windows.Forms.ContextMenuStrip(this.components); this.changeTypeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.addBytesToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.integerToolStripMenuItem1 = new ReClassNET.UI.IntegerToolStripMenuItem(); - this.integerToolStripMenuItem2 = new ReClassNET.UI.IntegerToolStripMenuItem(); - this.integerToolStripMenuItem3 = new ReClassNET.UI.IntegerToolStripMenuItem(); - this.integerToolStripMenuItem4 = new ReClassNET.UI.IntegerToolStripMenuItem(); - this.integerToolStripMenuItem5 = new ReClassNET.UI.IntegerToolStripMenuItem(); - this.integerToolStripMenuItem6 = new ReClassNET.UI.IntegerToolStripMenuItem(); - this.integerToolStripMenuItem7 = new ReClassNET.UI.IntegerToolStripMenuItem(); + this.integerToolStripMenuItem1 = new IntegerToolStripMenuItem(); + this.integerToolStripMenuItem2 = new IntegerToolStripMenuItem(); + this.integerToolStripMenuItem3 = new IntegerToolStripMenuItem(); + this.integerToolStripMenuItem4 = new IntegerToolStripMenuItem(); + this.integerToolStripMenuItem5 = new IntegerToolStripMenuItem(); + this.integerToolStripMenuItem6 = new IntegerToolStripMenuItem(); + this.integerToolStripMenuItem7 = new IntegerToolStripMenuItem(); this.toolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem(); this.insertBytesToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.integerToolStripMenuItem8 = new ReClassNET.UI.IntegerToolStripMenuItem(); - this.integerToolStripMenuItem9 = new ReClassNET.UI.IntegerToolStripMenuItem(); - this.integerToolStripMenuItem10 = new ReClassNET.UI.IntegerToolStripMenuItem(); - this.integerToolStripMenuItem11 = new ReClassNET.UI.IntegerToolStripMenuItem(); - this.integerToolStripMenuItem12 = new ReClassNET.UI.IntegerToolStripMenuItem(); - this.integerToolStripMenuItem13 = new ReClassNET.UI.IntegerToolStripMenuItem(); - this.integerToolStripMenuItem14 = new ReClassNET.UI.IntegerToolStripMenuItem(); + this.integerToolStripMenuItem8 = new IntegerToolStripMenuItem(); + this.integerToolStripMenuItem9 = new IntegerToolStripMenuItem(); + this.integerToolStripMenuItem10 = new IntegerToolStripMenuItem(); + this.integerToolStripMenuItem11 = new IntegerToolStripMenuItem(); + this.integerToolStripMenuItem12 = new IntegerToolStripMenuItem(); + this.integerToolStripMenuItem13 = new IntegerToolStripMenuItem(); + this.integerToolStripMenuItem14 = new IntegerToolStripMenuItem(); this.toolStripMenuItem2 = new System.Windows.Forms.ToolStripMenuItem(); this.toolStripSeparator8 = new System.Windows.Forms.ToolStripSeparator(); this.createClassFromNodesToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); @@ -105,22 +107,22 @@ private void InitializeComponent() this.toolStripSeparator7 = new System.Windows.Forms.ToolStripSeparator(); this.newClassToolStripButton = new System.Windows.Forms.ToolStripButton(); this.addBytesToolStripDropDownButton = new System.Windows.Forms.ToolStripDropDownButton(); - this.add4BytesToolStripMenuItem = new ReClassNET.UI.IntegerToolStripMenuItem(); - this.add8BytesToolStripMenuItem = new ReClassNET.UI.IntegerToolStripMenuItem(); - this.add64BytesToolStripMenuItem = new ReClassNET.UI.IntegerToolStripMenuItem(); - this.add256BytesToolStripMenuItem = new ReClassNET.UI.IntegerToolStripMenuItem(); - this.add1024BytesToolStripMenuItem = new ReClassNET.UI.IntegerToolStripMenuItem(); - this.add2048BytesToolStripMenuItem = new ReClassNET.UI.IntegerToolStripMenuItem(); - this.add4096BytesToolStripMenuItem = new ReClassNET.UI.IntegerToolStripMenuItem(); + this.add4BytesToolStripMenuItem = new IntegerToolStripMenuItem(); + this.add8BytesToolStripMenuItem = new IntegerToolStripMenuItem(); + this.add64BytesToolStripMenuItem = new IntegerToolStripMenuItem(); + this.add256BytesToolStripMenuItem = new IntegerToolStripMenuItem(); + this.add1024BytesToolStripMenuItem = new IntegerToolStripMenuItem(); + this.add2048BytesToolStripMenuItem = new IntegerToolStripMenuItem(); + this.add4096BytesToolStripMenuItem = new IntegerToolStripMenuItem(); this.addXBytesToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.insertBytesToolStripDropDownButton = new System.Windows.Forms.ToolStripDropDownButton(); - this.insert4BytesToolStripMenuItem = new ReClassNET.UI.IntegerToolStripMenuItem(); - this.insert8BytesToolStripMenuItem = new ReClassNET.UI.IntegerToolStripMenuItem(); - this.insert64BytesToolStripMenuItem = new ReClassNET.UI.IntegerToolStripMenuItem(); - this.insert256BytesToolStripMenuItem = new ReClassNET.UI.IntegerToolStripMenuItem(); - this.insert1024BytesToolStripMenuItem = new ReClassNET.UI.IntegerToolStripMenuItem(); - this.insert2048BytesToolStripMenuItem = new ReClassNET.UI.IntegerToolStripMenuItem(); - this.insert4096BytesToolStripMenuItem = new ReClassNET.UI.IntegerToolStripMenuItem(); + this.insert4BytesToolStripMenuItem = new IntegerToolStripMenuItem(); + this.insert8BytesToolStripMenuItem = new IntegerToolStripMenuItem(); + this.insert64BytesToolStripMenuItem = new IntegerToolStripMenuItem(); + this.insert256BytesToolStripMenuItem = new IntegerToolStripMenuItem(); + this.insert1024BytesToolStripMenuItem = new IntegerToolStripMenuItem(); + this.insert2048BytesToolStripMenuItem = new IntegerToolStripMenuItem(); + this.insert4096BytesToolStripMenuItem = new IntegerToolStripMenuItem(); this.insertXBytesToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.nodeTypesToolStripSeparator = new System.Windows.Forms.ToolStripSeparator(); this.statusStrip = new System.Windows.Forms.StatusStrip(); @@ -213,7 +215,7 @@ private void InitializeComponent() this.projectView.Name = "projectView"; this.projectView.Size = new System.Drawing.Size(201, 524); this.projectView.TabIndex = 0; - this.projectView.SelectionChanged += new ReClassNET.UI.ProjectView.SelectionChangedEvent(this.classesView_ClassSelected); + this.projectView.SelectionChanged += new ProjectView.SelectionChangedEvent(this.classesView_ClassSelected); // // projectClassContextMenuStrip // @@ -362,11 +364,11 @@ private void InitializeComponent() this.memoryViewControl.NodeContextMenuStrip = this.selectedNodeContextMenuStrip; this.memoryViewControl.Size = new System.Drawing.Size(936, 524); this.memoryViewControl.TabIndex = 0; - this.memoryViewControl.DrawContextRequested += new ReClassNET.UI.DrawContextRequestEventHandler(this.memoryViewControl_DrawContextRequested); + this.memoryViewControl.DrawContextRequested += new DrawContextRequestEventHandler(this.memoryViewControl_DrawContextRequested); this.memoryViewControl.SelectionChanged += new System.EventHandler(this.memoryViewControl_SelectionChanged); - this.memoryViewControl.ChangeClassTypeClick += new ReClassNET.UI.NodeClickEventHandler(this.memoryViewControl_ChangeClassTypeClick); - this.memoryViewControl.ChangeWrappedTypeClick += new ReClassNET.UI.NodeClickEventHandler(this.memoryViewControl_ChangeWrappedTypeClick); - this.memoryViewControl.ChangeEnumTypeClick += new ReClassNET.UI.NodeClickEventHandler(this.memoryViewControl_ChangeEnumTypeClick); + this.memoryViewControl.ChangeClassTypeClick += new NodeClickEventHandler(this.memoryViewControl_ChangeClassTypeClick); + this.memoryViewControl.ChangeWrappedTypeClick += new NodeClickEventHandler(this.memoryViewControl_ChangeWrappedTypeClick); + this.memoryViewControl.ChangeEnumTypeClick += new NodeClickEventHandler(this.memoryViewControl_ChangeEnumTypeClick); this.memoryViewControl.KeyDown += new System.Windows.Forms.KeyEventHandler(this.memoryViewControl_KeyDown); // // selectedNodeContextMenuStrip @@ -1388,7 +1390,7 @@ private void InitializeComponent() #endregion - private UI.MemoryViewControl memoryViewControl; + private MemoryViewControl memoryViewControl; private System.Windows.Forms.StatusStrip statusStrip; private System.Windows.Forms.MenuStrip mainMenuStrip; private System.Windows.Forms.ToolStripMenuItem fileToolStripMenuItem; @@ -1421,25 +1423,25 @@ private void InitializeComponent() private System.Windows.Forms.ToolStripSeparator toolStripSeparator7; private System.Windows.Forms.ToolStripButton newClassToolStripButton; private System.Windows.Forms.ToolStripDropDownButton addBytesToolStripDropDownButton; - private UI.IntegerToolStripMenuItem add4BytesToolStripMenuItem; - private UI.IntegerToolStripMenuItem add8BytesToolStripMenuItem; - private UI.IntegerToolStripMenuItem add64BytesToolStripMenuItem; - private UI.IntegerToolStripMenuItem add256BytesToolStripMenuItem; - private UI.IntegerToolStripMenuItem add1024BytesToolStripMenuItem; - private UI.IntegerToolStripMenuItem add2048BytesToolStripMenuItem; - private UI.IntegerToolStripMenuItem add4096BytesToolStripMenuItem; + private IntegerToolStripMenuItem add4BytesToolStripMenuItem; + private IntegerToolStripMenuItem add8BytesToolStripMenuItem; + private IntegerToolStripMenuItem add64BytesToolStripMenuItem; + private IntegerToolStripMenuItem add256BytesToolStripMenuItem; + private IntegerToolStripMenuItem add1024BytesToolStripMenuItem; + private IntegerToolStripMenuItem add2048BytesToolStripMenuItem; + private IntegerToolStripMenuItem add4096BytesToolStripMenuItem; private System.Windows.Forms.ToolStripDropDownButton insertBytesToolStripDropDownButton; - private UI.IntegerToolStripMenuItem insert4BytesToolStripMenuItem; - private UI.IntegerToolStripMenuItem insert8BytesToolStripMenuItem; - private UI.IntegerToolStripMenuItem insert64BytesToolStripMenuItem; - private UI.IntegerToolStripMenuItem insert256BytesToolStripMenuItem; - private UI.IntegerToolStripMenuItem insert1024BytesToolStripMenuItem; - private UI.IntegerToolStripMenuItem insert2048BytesToolStripMenuItem; - private UI.IntegerToolStripMenuItem insert4096BytesToolStripMenuItem; + private IntegerToolStripMenuItem insert4BytesToolStripMenuItem; + private IntegerToolStripMenuItem insert8BytesToolStripMenuItem; + private IntegerToolStripMenuItem insert64BytesToolStripMenuItem; + private IntegerToolStripMenuItem insert256BytesToolStripMenuItem; + private IntegerToolStripMenuItem insert1024BytesToolStripMenuItem; + private IntegerToolStripMenuItem insert2048BytesToolStripMenuItem; + private IntegerToolStripMenuItem insert4096BytesToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem addXBytesToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem insertXBytesToolStripMenuItem; private System.Windows.Forms.ToolStripSeparator nodeTypesToolStripSeparator; - private UI.ProjectView projectView; + private ProjectView projectView; private System.Windows.Forms.ToolStripMenuItem projectToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem cleanUnusedClassesToolStripMenuItem; private System.Windows.Forms.ToolStripSeparator toolStripSeparator16; @@ -1459,21 +1461,21 @@ private void InitializeComponent() private System.Windows.Forms.ContextMenuStrip selectedNodeContextMenuStrip; private System.Windows.Forms.ToolStripMenuItem changeTypeToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem addBytesToolStripMenuItem; - private UI.IntegerToolStripMenuItem integerToolStripMenuItem1; - private UI.IntegerToolStripMenuItem integerToolStripMenuItem2; - private UI.IntegerToolStripMenuItem integerToolStripMenuItem3; - private UI.IntegerToolStripMenuItem integerToolStripMenuItem4; - private UI.IntegerToolStripMenuItem integerToolStripMenuItem5; - private UI.IntegerToolStripMenuItem integerToolStripMenuItem6; - private UI.IntegerToolStripMenuItem integerToolStripMenuItem7; + private IntegerToolStripMenuItem integerToolStripMenuItem1; + private IntegerToolStripMenuItem integerToolStripMenuItem2; + private IntegerToolStripMenuItem integerToolStripMenuItem3; + private IntegerToolStripMenuItem integerToolStripMenuItem4; + private IntegerToolStripMenuItem integerToolStripMenuItem5; + private IntegerToolStripMenuItem integerToolStripMenuItem6; + private IntegerToolStripMenuItem integerToolStripMenuItem7; private System.Windows.Forms.ToolStripMenuItem insertBytesToolStripMenuItem; - private UI.IntegerToolStripMenuItem integerToolStripMenuItem8; - private UI.IntegerToolStripMenuItem integerToolStripMenuItem9; - private UI.IntegerToolStripMenuItem integerToolStripMenuItem10; - private UI.IntegerToolStripMenuItem integerToolStripMenuItem11; - private UI.IntegerToolStripMenuItem integerToolStripMenuItem12; - private UI.IntegerToolStripMenuItem integerToolStripMenuItem13; - private UI.IntegerToolStripMenuItem integerToolStripMenuItem14; + private IntegerToolStripMenuItem integerToolStripMenuItem8; + private IntegerToolStripMenuItem integerToolStripMenuItem9; + private IntegerToolStripMenuItem integerToolStripMenuItem10; + private IntegerToolStripMenuItem integerToolStripMenuItem11; + private IntegerToolStripMenuItem integerToolStripMenuItem12; + private IntegerToolStripMenuItem integerToolStripMenuItem13; + private IntegerToolStripMenuItem integerToolStripMenuItem14; private System.Windows.Forms.ToolStripSeparator toolStripSeparator8; private System.Windows.Forms.ToolStripMenuItem createClassFromNodesToolStripMenuItem; private System.Windows.Forms.ToolStripSeparator toolStripSeparator13; diff --git a/ReClass.NET/Forms/MainForm.Functions.cs b/ReClass.NET/Forms/MainForm.Functions.cs index 8339bcf0..84f1b53a 100644 --- a/ReClass.NET/Forms/MainForm.Functions.cs +++ b/ReClass.NET/Forms/MainForm.Functions.cs @@ -8,6 +8,7 @@ using System.Threading.Tasks; using System.Windows.Forms; using ReClassNET.CodeGenerator; +using ReClassNET.Controls; using ReClassNET.DataExchange.ReClass; using ReClassNET.Extensions; using ReClassNET.Logger; diff --git a/ReClass.NET/Forms/MainForm.cs b/ReClass.NET/Forms/MainForm.cs index 7df1daff..32526168 100644 --- a/ReClass.NET/Forms/MainForm.cs +++ b/ReClass.NET/Forms/MainForm.cs @@ -9,6 +9,7 @@ using System.Windows.Forms; using ReClassNET.AddressParser; using ReClassNET.CodeGenerator; +using ReClassNET.Controls; using ReClassNET.Core; using ReClassNET.DataExchange.ReClass; using ReClassNET.Extensions; diff --git a/ReClass.NET/Forms/NamedAddressesForm.Designer.cs b/ReClass.NET/Forms/NamedAddressesForm.Designer.cs index ed7e807c..a6a8a6e3 100644 --- a/ReClass.NET/Forms/NamedAddressesForm.Designer.cs +++ b/ReClass.NET/Forms/NamedAddressesForm.Designer.cs @@ -1,4 +1,6 @@ -namespace ReClassNET.Forms +using ReClassNET.Controls; + +namespace ReClassNET.Forms { partial class NamedAddressesForm { @@ -28,12 +30,12 @@ protected override void Dispose(bool disposing) ///
private void InitializeComponent() { - this.bannerBox = new ReClassNET.UI.BannerBox(); - this.addressTextBox = new ReClassNET.UI.PlaceholderTextBox(); - this.nameTextBox = new ReClassNET.UI.PlaceholderTextBox(); + this.bannerBox = new BannerBox(); + this.addressTextBox = new PlaceholderTextBox(); + this.nameTextBox = new PlaceholderTextBox(); this.namedAddressesListBox = new System.Windows.Forms.ListBox(); - this.removeAddressIconButton = new ReClassNET.UI.IconButton(); - this.addAddressIconButton = new ReClassNET.UI.IconButton(); + this.removeAddressIconButton = new IconButton(); + this.addAddressIconButton = new IconButton(); ((System.ComponentModel.ISupportInitialize)(this.bannerBox)).BeginInit(); this.SuspendLayout(); // @@ -128,11 +130,11 @@ private void InitializeComponent() #endregion - private UI.BannerBox bannerBox; - private UI.PlaceholderTextBox addressTextBox; - private UI.PlaceholderTextBox nameTextBox; + private BannerBox bannerBox; + private PlaceholderTextBox addressTextBox; + private PlaceholderTextBox nameTextBox; private System.Windows.Forms.ListBox namedAddressesListBox; - private UI.IconButton removeAddressIconButton; - private UI.IconButton addAddressIconButton; + private IconButton removeAddressIconButton; + private IconButton addAddressIconButton; } } \ No newline at end of file diff --git a/ReClass.NET/Forms/PluginForm.Designer.cs b/ReClass.NET/Forms/PluginForm.Designer.cs index 0caecd06..86a82777 100644 --- a/ReClass.NET/Forms/PluginForm.Designer.cs +++ b/ReClass.NET/Forms/PluginForm.Designer.cs @@ -1,4 +1,6 @@ -namespace ReClassNET.Forms +using ReClassNET.Controls; + +namespace ReClassNET.Forms { partial class PluginForm { @@ -43,7 +45,7 @@ private void InitializeComponent() this.label1 = new System.Windows.Forms.Label(); this.getMoreLinkLabel = new System.Windows.Forms.LinkLabel(); this.closeButton = new System.Windows.Forms.Button(); - this.bannerBox = new ReClassNET.UI.BannerBox(); + this.bannerBox = new BannerBox(); this.tabControl.SuspendLayout(); this.pluginsTabPage.SuspendLayout(); this.descriptionGroupBox.SuspendLayout(); @@ -275,7 +277,7 @@ private void InitializeComponent() private System.Windows.Forms.DataGridViewTextBoxColumn nameColumn; private System.Windows.Forms.DataGridViewTextBoxColumn versionColumn; private System.Windows.Forms.DataGridViewTextBoxColumn authorColumn; - private UI.BannerBox bannerBox; + private BannerBox bannerBox; private System.Windows.Forms.ComboBox functionsProvidersComboBox; private System.Windows.Forms.Label label2; } diff --git a/ReClass.NET/Forms/ProcessBrowserForm.Designer.cs b/ReClass.NET/Forms/ProcessBrowserForm.Designer.cs index d8677633..d4e111d5 100644 --- a/ReClass.NET/Forms/ProcessBrowserForm.Designer.cs +++ b/ReClass.NET/Forms/ProcessBrowserForm.Designer.cs @@ -1,4 +1,6 @@ -namespace ReClassNET.Forms +using ReClassNET.Controls; + +namespace ReClassNET.Forms { partial class ProcessBrowserForm { @@ -42,7 +44,7 @@ private void InitializeComponent() this.label2 = new System.Windows.Forms.Label(); this.label1 = new System.Windows.Forms.Label(); this.filterTextBox = new System.Windows.Forms.TextBox(); - this.bannerBox = new ReClassNET.UI.BannerBox(); + this.bannerBox = new BannerBox(); ((System.ComponentModel.ISupportInitialize)(this.processDataGridView)).BeginInit(); this.filterGroupBox.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.bannerBox)).BeginInit(); @@ -271,6 +273,6 @@ private void InitializeComponent() private System.Windows.Forms.Label label2; private System.Windows.Forms.Label label1; private System.Windows.Forms.TextBox filterTextBox; - private UI.BannerBox bannerBox; + private BannerBox bannerBox; } } \ No newline at end of file diff --git a/ReClass.NET/Forms/ProcessInfoForm.Designer.cs b/ReClass.NET/Forms/ProcessInfoForm.Designer.cs index c4d9e46b..8be2cb73 100644 --- a/ReClass.NET/Forms/ProcessInfoForm.Designer.cs +++ b/ReClass.NET/Forms/ProcessInfoForm.Designer.cs @@ -1,4 +1,6 @@ -namespace ReClassNET.Forms +using ReClassNET.Controls; + +namespace ReClassNET.Forms { partial class ProcessInfoForm { @@ -41,7 +43,7 @@ private void InitializeComponent() this.protectionColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.typeColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.moduleColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.bannerBox1 = new ReClassNET.UI.BannerBox(); + this.bannerBox1 = new BannerBox(); this.tabControl = new System.Windows.Forms.TabControl(); this.modulesTabPage = new System.Windows.Forms.TabPage(); this.modulesDataGridView = new System.Windows.Forms.DataGridView(); @@ -325,7 +327,7 @@ private void InitializeComponent() private System.Windows.Forms.ContextMenuStrip contextMenuStrip; private System.Windows.Forms.ToolStripMenuItem setCurrentClassAddressToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem createClassAtAddressToolStripMenuItem; - private UI.BannerBox bannerBox1; + private BannerBox bannerBox1; private System.Windows.Forms.TabControl tabControl; private System.Windows.Forms.TabPage modulesTabPage; private System.Windows.Forms.DataGridView modulesDataGridView; diff --git a/ReClass.NET/Forms/ScannerForm.Designer.cs b/ReClass.NET/Forms/ScannerForm.Designer.cs index ccde5411..58d867ea 100644 --- a/ReClass.NET/Forms/ScannerForm.Designer.cs +++ b/ReClass.NET/Forms/ScannerForm.Designer.cs @@ -1,4 +1,6 @@ -namespace ReClassNET.Forms +using ReClassNET.Controls; + +namespace ReClassNET.Forms { partial class ScannerForm { @@ -29,14 +31,14 @@ protected override void Dispose(bool disposing) private void InitializeComponent() { this.components = new System.ComponentModel.Container(); - this.bannerBox = new ReClassNET.UI.BannerBox(); + this.bannerBox = new BannerBox(); this.filterGroupBox = new System.Windows.Forms.GroupBox(); this.valueTypeComboBox = new ReClassNET.Forms.ScannerForm.ScanValueTypeComboBox(); this.label3 = new System.Windows.Forms.Label(); this.compareTypeComboBox = new ReClassNET.Forms.ScannerForm.ScanCompareTypeComboBox(); this.label1 = new System.Windows.Forms.Label(); this.isHexCheckBox = new System.Windows.Forms.CheckBox(); - this.dualValueBox = new ReClassNET.UI.DualValueBox(); + this.dualValueBox = new DualValueBox(); this.scanOptionsGroupBox = new System.Windows.Forms.GroupBox(); this.fastScanAlignmentTextBox = new System.Windows.Forms.TextBox(); this.fastScanCheckBox = new System.Windows.Forms.CheckBox(); @@ -65,7 +67,7 @@ private void InitializeComponent() this.scanProgressBar = new System.Windows.Forms.ProgressBar(); this.resultCountLabel = new System.Windows.Forms.Label(); this.updateValuesTimer = new System.Windows.Forms.Timer(this.components); - this.resultMemoryRecordList = new ReClassNET.UI.MemoryRecordList(); + this.resultMemoryRecordList = new MemoryRecordList(); this.resultListContextMenuStrip = new System.Windows.Forms.ContextMenuStrip(this.components); this.addSelectedResultsToAddressListToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.removeSelectedRecordsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); @@ -82,7 +84,7 @@ private void InitializeComponent() this.findOutWhatWritesToThisAddressToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.toolStripSeparator4 = new System.Windows.Forms.ToolStripSeparator(); this.copyAddressToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.addressListMemoryRecordList = new ReClassNET.UI.MemoryRecordList(); + this.addressListMemoryRecordList = new MemoryRecordList(); this.toolStripPanel = new System.Windows.Forms.ToolStripPanel(); this.menuToolStrip = new System.Windows.Forms.ToolStrip(); this.openAddressFileToolStripButton = new System.Windows.Forms.ToolStripButton(); @@ -91,9 +93,9 @@ private void InitializeComponent() this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator(); this.clearAddressListToolStripButton = new System.Windows.Forms.ToolStripButton(); this.infoToolTip = new System.Windows.Forms.ToolTip(this.components); - this.undoIconButton = new ReClassNET.UI.IconButton(); - this.showInputCorrelatorIconButton = new ReClassNET.UI.IconButton(); - this.cancelScanIconButton = new ReClassNET.UI.IconButton(); + this.undoIconButton = new IconButton(); + this.showInputCorrelatorIconButton = new IconButton(); + this.cancelScanIconButton = new IconButton(); ((System.ComponentModel.ISupportInitialize)(this.bannerBox)).BeginInit(); this.filterGroupBox.SuspendLayout(); this.scanOptionsGroupBox.SuspendLayout(); @@ -513,7 +515,7 @@ private void InitializeComponent() this.resultMemoryRecordList.ShowValueTypeColumn = false; this.resultMemoryRecordList.Size = new System.Drawing.Size(268, 314); this.resultMemoryRecordList.TabIndex = 16; - this.resultMemoryRecordList.RecordDoubleClick += new ReClassNET.UI.MemorySearchResultControlResultDoubleClickEventHandler(this.memorySearchResultControl_ResultDoubleClick); + this.resultMemoryRecordList.RecordDoubleClick += new MemorySearchResultControlResultDoubleClickEventHandler(this.memorySearchResultControl_ResultDoubleClick); // // resultListContextMenuStrip // @@ -811,9 +813,9 @@ private void InitializeComponent() #endregion - private UI.BannerBox bannerBox; + private BannerBox bannerBox; private System.Windows.Forms.GroupBox filterGroupBox; - private UI.DualValueBox dualValueBox; + private DualValueBox dualValueBox; private System.Windows.Forms.CheckBox isHexCheckBox; private ScanCompareTypeComboBox compareTypeComboBox; private System.Windows.Forms.Label label1; @@ -847,8 +849,8 @@ private void InitializeComponent() private System.Windows.Forms.ProgressBar scanProgressBar; private System.Windows.Forms.Label resultCountLabel; private System.Windows.Forms.Timer updateValuesTimer; - private UI.MemoryRecordList resultMemoryRecordList; - private UI.MemoryRecordList addressListMemoryRecordList; + private MemoryRecordList resultMemoryRecordList; + private MemoryRecordList addressListMemoryRecordList; private System.Windows.Forms.ToolStripPanel toolStripPanel; private System.Windows.Forms.ToolStrip menuToolStrip; private System.Windows.Forms.ToolStripButton openAddressFileToolStripButton; @@ -873,8 +875,8 @@ private void InitializeComponent() private System.Windows.Forms.ToolStripMenuItem valueToolStripMenuItem; private System.Windows.Forms.ToolStripSeparator toolStripSeparator4; private System.Windows.Forms.ToolStripMenuItem copyAddressToolStripMenuItem; - private UI.IconButton undoIconButton; - private UI.IconButton showInputCorrelatorIconButton; - private UI.IconButton cancelScanIconButton; + private IconButton undoIconButton; + private IconButton showInputCorrelatorIconButton; + private IconButton cancelScanIconButton; } } \ No newline at end of file diff --git a/ReClass.NET/Forms/ScannerForm.cs b/ReClass.NET/Forms/ScannerForm.cs index 03a38858..c52e7187 100644 --- a/ReClass.NET/Forms/ScannerForm.cs +++ b/ReClass.NET/Forms/ScannerForm.cs @@ -8,6 +8,7 @@ using System.Threading; using System.Threading.Tasks; using System.Windows.Forms; +using ReClassNET.Controls; using ReClassNET.DataExchange.Scanner; using ReClassNET.Extensions; using ReClassNET.Logger; diff --git a/ReClass.NET/Forms/SettingsForm.Designer.cs b/ReClass.NET/Forms/SettingsForm.Designer.cs index 517e8196..d00f8b9d 100644 --- a/ReClass.NET/Forms/SettingsForm.Designer.cs +++ b/ReClass.NET/Forms/SettingsForm.Designer.cs @@ -1,4 +1,6 @@ -namespace ReClassNET.Forms +using ReClassNET.Controls; + +namespace ReClassNET.Forms { partial class SettingsForm { @@ -54,32 +56,32 @@ private void InitializeComponent() this.nodeColorGroupBox = new System.Windows.Forms.GroupBox(); this.nodeValueLabel = new System.Windows.Forms.Label(); this.nodePluginLabel = new System.Windows.Forms.Label(); - this.nodeHexValueColorBox = new ReClassNET.UI.ColorBox(); - this.nodePluginColorBox = new ReClassNET.UI.ColorBox(); + this.nodeHexValueColorBox = new ColorBox(); + this.nodePluginColorBox = new ColorBox(); this.nodeHexValueLabel = new System.Windows.Forms.Label(); this.nodeVTableLabel = new System.Windows.Forms.Label(); - this.nodeOffsetColorBox = new ReClassNET.UI.ColorBox(); - this.nodeVTableColorBox = new ReClassNET.UI.ColorBox(); + this.nodeOffsetColorBox = new ColorBox(); + this.nodeVTableColorBox = new ColorBox(); this.nodeOffsetLabel = new System.Windows.Forms.Label(); this.nodeTextLabel = new System.Windows.Forms.Label(); - this.nodeAddressColorBox = new ReClassNET.UI.ColorBox(); - this.nodeTextColorBox = new ReClassNET.UI.ColorBox(); + this.nodeAddressColorBox = new ColorBox(); + this.nodeTextColorBox = new ColorBox(); this.nodeAddressLabel = new System.Windows.Forms.Label(); this.nodeCommentLabel = new System.Windows.Forms.Label(); - this.nodeHiddenColorBox = new ReClassNET.UI.ColorBox(); - this.nodeCommentColorBox = new ReClassNET.UI.ColorBox(); + this.nodeHiddenColorBox = new ColorBox(); + this.nodeCommentColorBox = new ColorBox(); this.nodeHiddenLabel = new System.Windows.Forms.Label(); this.nodeIndexLabel = new System.Windows.Forms.Label(); - this.nodeSelectedColorBox = new ReClassNET.UI.ColorBox(); - this.nodeIndexColorBox = new ReClassNET.UI.ColorBox(); + this.nodeSelectedColorBox = new ColorBox(); + this.nodeIndexColorBox = new ColorBox(); this.nodeSelectedLabel = new System.Windows.Forms.Label(); - this.nodeTypeColorBox = new ReClassNET.UI.ColorBox(); - this.nodeValueColorBox = new ReClassNET.UI.ColorBox(); + this.nodeTypeColorBox = new ColorBox(); + this.nodeValueColorBox = new ColorBox(); this.nodeTypeLabel = new System.Windows.Forms.Label(); this.nodeNameLabel = new System.Windows.Forms.Label(); - this.nodeNameColorBox = new ReClassNET.UI.ColorBox(); + this.nodeNameColorBox = new ColorBox(); this.backgroundLabel = new System.Windows.Forms.Label(); - this.backgroundColorBox = new ReClassNET.UI.ColorBox(); + this.backgroundColorBox = new ColorBox(); this.typeDefinitionsSettingsTabPage = new System.Windows.Forms.TabPage(); this.boolSettingsLabel = new System.Windows.Forms.Label(); this.boolTypeTextBox = new System.Windows.Forms.TextBox(); @@ -122,7 +124,7 @@ private void InitializeComponent() this.int16TypeTextBox = new System.Windows.Forms.TextBox(); this.int8SettingsLabel = new System.Windows.Forms.Label(); this.int8TypeTextBox = new System.Windows.Forms.TextBox(); - this.bannerBox = new ReClassNET.UI.BannerBox(); + this.bannerBox = new BannerBox(); this.settingsTabControl.SuspendLayout(); this.generalSettingsTabPage.SuspendLayout(); this.fileAssociationGroupBox.SuspendLayout(); @@ -1102,34 +1104,34 @@ private void InitializeComponent() private System.Windows.Forms.CheckBox showPluginInfoCheckBox; private System.Windows.Forms.CheckBox showStringCheckBox; private System.Windows.Forms.CheckBox showSymbolsCheckBox; - private UI.ColorBox backgroundColorBox; + private ColorBox backgroundColorBox; private System.Windows.Forms.Label nodeSelectedLabel; - private UI.ColorBox nodeSelectedColorBox; + private ColorBox nodeSelectedColorBox; private System.Windows.Forms.Label nodeHiddenLabel; - private UI.ColorBox nodeHiddenColorBox; + private ColorBox nodeHiddenColorBox; private System.Windows.Forms.Label nodeAddressLabel; - private UI.ColorBox nodeAddressColorBox; + private ColorBox nodeAddressColorBox; private System.Windows.Forms.Label nodeOffsetLabel; - private UI.ColorBox nodeOffsetColorBox; + private ColorBox nodeOffsetColorBox; private System.Windows.Forms.Label nodeHexValueLabel; - private UI.ColorBox nodeHexValueColorBox; + private ColorBox nodeHexValueColorBox; private System.Windows.Forms.Label backgroundLabel; private System.Windows.Forms.Label nodeValueLabel; - private UI.ColorBox nodeValueColorBox; + private ColorBox nodeValueColorBox; private System.Windows.Forms.Label nodeNameLabel; - private UI.ColorBox nodeNameColorBox; + private ColorBox nodeNameColorBox; private System.Windows.Forms.Label nodeTypeLabel; - private UI.ColorBox nodeTypeColorBox; + private ColorBox nodeTypeColorBox; private System.Windows.Forms.Label nodeVTableLabel; - private UI.ColorBox nodeVTableColorBox; + private ColorBox nodeVTableColorBox; private System.Windows.Forms.Label nodeTextLabel; - private UI.ColorBox nodeTextColorBox; + private ColorBox nodeTextColorBox; private System.Windows.Forms.Label nodeCommentLabel; - private UI.ColorBox nodeCommentColorBox; + private ColorBox nodeCommentColorBox; private System.Windows.Forms.Label nodeIndexLabel; - private UI.ColorBox nodeIndexColorBox; + private ColorBox nodeIndexColorBox; private System.Windows.Forms.Label nodePluginLabel; - private UI.ColorBox nodePluginColorBox; + private ColorBox nodePluginColorBox; private System.Windows.Forms.Label floatSettingsLabel; private System.Windows.Forms.TextBox floatTypeTextBox; private System.Windows.Forms.Label uint64SettingsLabel; @@ -1170,7 +1172,7 @@ private void InitializeComponent() private System.Windows.Forms.TextBox doubleTypeTextBox; private System.Windows.Forms.GroupBox nodeColorGroupBox; private System.Windows.Forms.Label label1; - private UI.BannerBox bannerBox; + private BannerBox bannerBox; private System.Windows.Forms.Label boolSettingsLabel; private System.Windows.Forms.TextBox boolTypeTextBox; private System.Windows.Forms.GroupBox fileAssociationGroupBox; diff --git a/ReClass.NET/Forms/SettingsForm.cs b/ReClass.NET/Forms/SettingsForm.cs index 9f52cac1..4c242fa3 100644 --- a/ReClass.NET/Forms/SettingsForm.cs +++ b/ReClass.NET/Forms/SettingsForm.cs @@ -1,6 +1,7 @@ using System; using System.Diagnostics.Contracts; using System.Windows.Forms; +using ReClassNET.Controls; using ReClassNET.Extensions; using ReClassNET.Native; using ReClassNET.Project; diff --git a/ReClass.NET/Nodes/ArrayNode.cs b/ReClass.NET/Nodes/ArrayNode.cs index d21d4c0c..3f72e24a 100644 --- a/ReClass.NET/Nodes/ArrayNode.cs +++ b/ReClass.NET/Nodes/ArrayNode.cs @@ -1,6 +1,6 @@ -using System; +using System; using System.Drawing; -using ReClassNET.UI; +using ReClassNET.Controls; namespace ReClassNET.Nodes { diff --git a/ReClass.NET/Nodes/BaseFunctionNode.cs b/ReClass.NET/Nodes/BaseFunctionNode.cs index a7e1c6f6..cf28ecd7 100644 --- a/ReClass.NET/Nodes/BaseFunctionNode.cs +++ b/ReClass.NET/Nodes/BaseFunctionNode.cs @@ -3,6 +3,7 @@ using System.Diagnostics.Contracts; using System.Drawing; using System.Linq; +using ReClassNET.Controls; using ReClassNET.Memory; using ReClassNET.UI; diff --git a/ReClass.NET/Nodes/BaseFunctionPtrNode.cs b/ReClass.NET/Nodes/BaseFunctionPtrNode.cs index 578b0a43..476fff1c 100644 --- a/ReClass.NET/Nodes/BaseFunctionPtrNode.cs +++ b/ReClass.NET/Nodes/BaseFunctionPtrNode.cs @@ -2,6 +2,7 @@ using System.Diagnostics.Contracts; using System.Drawing; using System.Linq; +using ReClassNET.Controls; using ReClassNET.Extensions; using ReClassNET.Memory; using ReClassNET.UI; diff --git a/ReClass.NET/Nodes/BaseHexCommentNode.cs b/ReClass.NET/Nodes/BaseHexCommentNode.cs index d58e7652..d6515452 100644 --- a/ReClass.NET/Nodes/BaseHexCommentNode.cs +++ b/ReClass.NET/Nodes/BaseHexCommentNode.cs @@ -1,7 +1,8 @@ -using System; +using System; using System.Diagnostics.Contracts; using System.Linq; using System.Text; +using ReClassNET.Controls; using ReClassNET.Extensions; using ReClassNET.UI; diff --git a/ReClass.NET/Nodes/BaseHexNode.cs b/ReClass.NET/Nodes/BaseHexNode.cs index db0666fd..b32f745a 100644 --- a/ReClass.NET/Nodes/BaseHexNode.cs +++ b/ReClass.NET/Nodes/BaseHexNode.cs @@ -3,6 +3,7 @@ using System.Diagnostics.Contracts; using System.Drawing; using System.Globalization; +using ReClassNET.Controls; using ReClassNET.Extensions; using ReClassNET.Memory; using ReClassNET.UI; diff --git a/ReClass.NET/Nodes/BaseMatrixNode.cs b/ReClass.NET/Nodes/BaseMatrixNode.cs index 910e2b40..55057e0a 100644 --- a/ReClass.NET/Nodes/BaseMatrixNode.cs +++ b/ReClass.NET/Nodes/BaseMatrixNode.cs @@ -1,5 +1,6 @@ -using System.Diagnostics.Contracts; +using System.Diagnostics.Contracts; using System.Drawing; +using ReClassNET.Controls; using ReClassNET.UI; namespace ReClassNET.Nodes diff --git a/ReClass.NET/Nodes/BaseNode.cs b/ReClass.NET/Nodes/BaseNode.cs index 19cd948f..05e21eb9 100644 --- a/ReClass.NET/Nodes/BaseNode.cs +++ b/ReClass.NET/Nodes/BaseNode.cs @@ -3,6 +3,7 @@ using System.Diagnostics; using System.Diagnostics.Contracts; using System.Drawing; +using ReClassNET.Controls; using ReClassNET.Extensions; using ReClassNET.UI; using ReClassNET.Util; diff --git a/ReClass.NET/Nodes/BaseNumericNode.cs b/ReClass.NET/Nodes/BaseNumericNode.cs index edbbfacc..5714b9f0 100644 --- a/ReClass.NET/Nodes/BaseNumericNode.cs +++ b/ReClass.NET/Nodes/BaseNumericNode.cs @@ -1,5 +1,6 @@ -using System.Diagnostics.Contracts; +using System.Diagnostics.Contracts; using System.Drawing; +using ReClassNET.Controls; using ReClassNET.UI; namespace ReClassNET.Nodes diff --git a/ReClass.NET/Nodes/BaseTextNode.cs b/ReClass.NET/Nodes/BaseTextNode.cs index 4906b7a5..e35fd6b7 100644 --- a/ReClass.NET/Nodes/BaseTextNode.cs +++ b/ReClass.NET/Nodes/BaseTextNode.cs @@ -1,6 +1,7 @@ -using System.Diagnostics.Contracts; +using System.Diagnostics.Contracts; using System.Drawing; using System.Text; +using ReClassNET.Controls; using ReClassNET.Extensions; using ReClassNET.Memory; using ReClassNET.UI; diff --git a/ReClass.NET/Nodes/BaseTextPtrNode.cs b/ReClass.NET/Nodes/BaseTextPtrNode.cs index d7f8bee9..ea32e11b 100644 --- a/ReClass.NET/Nodes/BaseTextPtrNode.cs +++ b/ReClass.NET/Nodes/BaseTextPtrNode.cs @@ -1,7 +1,8 @@ -using System; +using System; using System.Diagnostics.Contracts; using System.Drawing; using System.Text; +using ReClassNET.Controls; using ReClassNET.UI; namespace ReClassNET.Nodes diff --git a/ReClass.NET/Nodes/BaseWrapperArrayNode.cs b/ReClass.NET/Nodes/BaseWrapperArrayNode.cs index 462940da..5ec12c14 100644 --- a/ReClass.NET/Nodes/BaseWrapperArrayNode.cs +++ b/ReClass.NET/Nodes/BaseWrapperArrayNode.cs @@ -1,5 +1,6 @@ -using System; +using System; using System.Drawing; +using ReClassNET.Controls; using ReClassNET.UI; namespace ReClassNET.Nodes diff --git a/ReClass.NET/Nodes/BitFieldNode.cs b/ReClass.NET/Nodes/BitFieldNode.cs index 82b7d274..733d4f8f 100644 --- a/ReClass.NET/Nodes/BitFieldNode.cs +++ b/ReClass.NET/Nodes/BitFieldNode.cs @@ -1,6 +1,7 @@ -using System; +using System; using System.Diagnostics.Contracts; using System.Drawing; +using ReClassNET.Controls; using ReClassNET.Memory; using ReClassNET.UI; using ReClassNET.Util; diff --git a/ReClass.NET/Nodes/BoolNode.cs b/ReClass.NET/Nodes/BoolNode.cs index 488d9e19..b5f12f5a 100644 --- a/ReClass.NET/Nodes/BoolNode.cs +++ b/ReClass.NET/Nodes/BoolNode.cs @@ -1,4 +1,5 @@ -using System.Drawing; +using System.Drawing; +using ReClassNET.Controls; using ReClassNET.UI; namespace ReClassNET.Nodes diff --git a/ReClass.NET/Nodes/ClassInstanceNode.cs b/ReClass.NET/Nodes/ClassInstanceNode.cs index c968a59c..d5c36a54 100644 --- a/ReClass.NET/Nodes/ClassInstanceNode.cs +++ b/ReClass.NET/Nodes/ClassInstanceNode.cs @@ -1,5 +1,6 @@ using System; using System.Drawing; +using ReClassNET.Controls; using ReClassNET.UI; namespace ReClassNET.Nodes diff --git a/ReClass.NET/Nodes/ClassNode.cs b/ReClass.NET/Nodes/ClassNode.cs index 49442810..7ce6a53f 100644 --- a/ReClass.NET/Nodes/ClassNode.cs +++ b/ReClass.NET/Nodes/ClassNode.cs @@ -1,7 +1,8 @@ -using System; +using System; using System.Diagnostics.Contracts; using System.Drawing; using System.Linq; +using ReClassNET.Controls; using ReClassNET.UI; namespace ReClassNET.Nodes diff --git a/ReClass.NET/Nodes/DoubleNode.cs b/ReClass.NET/Nodes/DoubleNode.cs index c2cd44dc..7c0deda8 100644 --- a/ReClass.NET/Nodes/DoubleNode.cs +++ b/ReClass.NET/Nodes/DoubleNode.cs @@ -1,4 +1,5 @@ -using System.Drawing; +using System.Drawing; +using ReClassNET.Controls; using ReClassNET.Memory; using ReClassNET.UI; diff --git a/ReClass.NET/Nodes/EnumNode.cs b/ReClass.NET/Nodes/EnumNode.cs index 96a91c55..f4b16ca7 100644 --- a/ReClass.NET/Nodes/EnumNode.cs +++ b/ReClass.NET/Nodes/EnumNode.cs @@ -1,7 +1,8 @@ -using System; +using System; using System.Diagnostics.Contracts; using System.Drawing; using System.Text; +using ReClassNET.Controls; using ReClassNET.Extensions; using ReClassNET.Memory; using ReClassNET.Project; diff --git a/ReClass.NET/Nodes/FloatNode.cs b/ReClass.NET/Nodes/FloatNode.cs index 8e1da21d..4fe0072b 100644 --- a/ReClass.NET/Nodes/FloatNode.cs +++ b/ReClass.NET/Nodes/FloatNode.cs @@ -1,4 +1,5 @@ -using System.Drawing; +using System.Drawing; +using ReClassNET.Controls; using ReClassNET.Memory; using ReClassNET.UI; diff --git a/ReClass.NET/Nodes/FunctionNode.cs b/ReClass.NET/Nodes/FunctionNode.cs index 867d7c26..0f5311cb 100644 --- a/ReClass.NET/Nodes/FunctionNode.cs +++ b/ReClass.NET/Nodes/FunctionNode.cs @@ -2,6 +2,7 @@ using System.Diagnostics.Contracts; using System.Drawing; using System.Linq; +using ReClassNET.Controls; using ReClassNET.Extensions; using ReClassNET.Memory; using ReClassNET.UI; diff --git a/ReClass.NET/Nodes/FunctionPtrNode.cs b/ReClass.NET/Nodes/FunctionPtrNode.cs index 7530d91c..74a8042c 100644 --- a/ReClass.NET/Nodes/FunctionPtrNode.cs +++ b/ReClass.NET/Nodes/FunctionPtrNode.cs @@ -1,5 +1,5 @@ -using System.Drawing; -using ReClassNET.UI; +using System.Drawing; +using ReClassNET.Controls; namespace ReClassNET.Nodes { diff --git a/ReClass.NET/Nodes/Hex16Node.cs b/ReClass.NET/Nodes/Hex16Node.cs index 09c619a0..1c4c0165 100644 --- a/ReClass.NET/Nodes/Hex16Node.cs +++ b/ReClass.NET/Nodes/Hex16Node.cs @@ -1,4 +1,5 @@ -using System.Drawing; +using System.Drawing; +using ReClassNET.Controls; using ReClassNET.Memory; using ReClassNET.UI; diff --git a/ReClass.NET/Nodes/Hex32Node.cs b/ReClass.NET/Nodes/Hex32Node.cs index 3c31c6ac..5dc57825 100644 --- a/ReClass.NET/Nodes/Hex32Node.cs +++ b/ReClass.NET/Nodes/Hex32Node.cs @@ -1,5 +1,6 @@ -using System; +using System; using System.Drawing; +using ReClassNET.Controls; using ReClassNET.Memory; using ReClassNET.UI; diff --git a/ReClass.NET/Nodes/Hex64Node.cs b/ReClass.NET/Nodes/Hex64Node.cs index 74472c65..9ba992d8 100644 --- a/ReClass.NET/Nodes/Hex64Node.cs +++ b/ReClass.NET/Nodes/Hex64Node.cs @@ -1,5 +1,6 @@ -using System; +using System; using System.Drawing; +using ReClassNET.Controls; using ReClassNET.Memory; using ReClassNET.UI; diff --git a/ReClass.NET/Nodes/Hex8Node.cs b/ReClass.NET/Nodes/Hex8Node.cs index e1e903bd..bac7c22b 100644 --- a/ReClass.NET/Nodes/Hex8Node.cs +++ b/ReClass.NET/Nodes/Hex8Node.cs @@ -1,4 +1,5 @@ using System.Drawing; +using ReClassNET.Controls; using ReClassNET.UI; namespace ReClassNET.Nodes diff --git a/ReClass.NET/Nodes/Int16Node.cs b/ReClass.NET/Nodes/Int16Node.cs index 7c81307e..7d4c7e1e 100644 --- a/ReClass.NET/Nodes/Int16Node.cs +++ b/ReClass.NET/Nodes/Int16Node.cs @@ -1,5 +1,6 @@ -using System.Drawing; +using System.Drawing; using System.Globalization; +using ReClassNET.Controls; using ReClassNET.Extensions; using ReClassNET.Memory; using ReClassNET.UI; diff --git a/ReClass.NET/Nodes/Int32Node.cs b/ReClass.NET/Nodes/Int32Node.cs index 4d0f375c..c495e9e0 100644 --- a/ReClass.NET/Nodes/Int32Node.cs +++ b/ReClass.NET/Nodes/Int32Node.cs @@ -1,5 +1,6 @@ -using System.Drawing; +using System.Drawing; using System.Globalization; +using ReClassNET.Controls; using ReClassNET.Extensions; using ReClassNET.Memory; using ReClassNET.UI; diff --git a/ReClass.NET/Nodes/Int64Node.cs b/ReClass.NET/Nodes/Int64Node.cs index 81b5e9b7..cd750b94 100644 --- a/ReClass.NET/Nodes/Int64Node.cs +++ b/ReClass.NET/Nodes/Int64Node.cs @@ -1,5 +1,6 @@ -using System.Drawing; +using System.Drawing; using System.Globalization; +using ReClassNET.Controls; using ReClassNET.Extensions; using ReClassNET.Memory; using ReClassNET.UI; diff --git a/ReClass.NET/Nodes/Int8Node.cs b/ReClass.NET/Nodes/Int8Node.cs index 769be064..bd09480f 100644 --- a/ReClass.NET/Nodes/Int8Node.cs +++ b/ReClass.NET/Nodes/Int8Node.cs @@ -1,5 +1,6 @@ -using System.Drawing; +using System.Drawing; using System.Globalization; +using ReClassNET.Controls; using ReClassNET.Extensions; using ReClassNET.Memory; using ReClassNET.UI; diff --git a/ReClass.NET/Nodes/Matrix3x3Node.cs b/ReClass.NET/Nodes/Matrix3x3Node.cs index 68366ad7..0fbb8eea 100644 --- a/ReClass.NET/Nodes/Matrix3x3Node.cs +++ b/ReClass.NET/Nodes/Matrix3x3Node.cs @@ -1,6 +1,7 @@ using System; using System.Drawing; using System.Runtime.InteropServices; +using ReClassNET.Controls; using ReClassNET.UI; namespace ReClassNET.Nodes diff --git a/ReClass.NET/Nodes/Matrix3x4Node.cs b/ReClass.NET/Nodes/Matrix3x4Node.cs index 093e8d81..5018cc7e 100644 --- a/ReClass.NET/Nodes/Matrix3x4Node.cs +++ b/ReClass.NET/Nodes/Matrix3x4Node.cs @@ -1,6 +1,7 @@ using System; using System.Drawing; using System.Runtime.InteropServices; +using ReClassNET.Controls; using ReClassNET.UI; namespace ReClassNET.Nodes diff --git a/ReClass.NET/Nodes/Matrix4x4Node.cs b/ReClass.NET/Nodes/Matrix4x4Node.cs index 40f23531..bef0b97e 100644 --- a/ReClass.NET/Nodes/Matrix4x4Node.cs +++ b/ReClass.NET/Nodes/Matrix4x4Node.cs @@ -1,6 +1,7 @@ using System; using System.Drawing; using System.Runtime.InteropServices; +using ReClassNET.Controls; using ReClassNET.UI; namespace ReClassNET.Nodes diff --git a/ReClass.NET/Nodes/PointerNode.cs b/ReClass.NET/Nodes/PointerNode.cs index d84ef2f6..358c48a3 100644 --- a/ReClass.NET/Nodes/PointerNode.cs +++ b/ReClass.NET/Nodes/PointerNode.cs @@ -1,5 +1,6 @@ -using System; +using System; using System.Drawing; +using ReClassNET.Controls; using ReClassNET.Memory; using ReClassNET.UI; diff --git a/ReClass.NET/Nodes/UInt16Node.cs b/ReClass.NET/Nodes/UInt16Node.cs index 538ba5cd..81fb9bc8 100644 --- a/ReClass.NET/Nodes/UInt16Node.cs +++ b/ReClass.NET/Nodes/UInt16Node.cs @@ -1,5 +1,6 @@ -using System.Drawing; +using System.Drawing; using System.Globalization; +using ReClassNET.Controls; using ReClassNET.Extensions; using ReClassNET.Memory; using ReClassNET.UI; diff --git a/ReClass.NET/Nodes/UInt32Node.cs b/ReClass.NET/Nodes/UInt32Node.cs index 0ef9ac50..081b574f 100644 --- a/ReClass.NET/Nodes/UInt32Node.cs +++ b/ReClass.NET/Nodes/UInt32Node.cs @@ -1,5 +1,6 @@ -using System.Drawing; +using System.Drawing; using System.Globalization; +using ReClassNET.Controls; using ReClassNET.Extensions; using ReClassNET.Memory; using ReClassNET.UI; diff --git a/ReClass.NET/Nodes/UInt64Node.cs b/ReClass.NET/Nodes/UInt64Node.cs index c60b643e..20464b9b 100644 --- a/ReClass.NET/Nodes/UInt64Node.cs +++ b/ReClass.NET/Nodes/UInt64Node.cs @@ -1,5 +1,6 @@ -using System.Drawing; +using System.Drawing; using System.Globalization; +using ReClassNET.Controls; using ReClassNET.Extensions; using ReClassNET.Memory; using ReClassNET.UI; diff --git a/ReClass.NET/Nodes/UInt8Node.cs b/ReClass.NET/Nodes/UInt8Node.cs index eda54e49..a5dec2c9 100644 --- a/ReClass.NET/Nodes/UInt8Node.cs +++ b/ReClass.NET/Nodes/UInt8Node.cs @@ -1,5 +1,6 @@ -using System.Drawing; +using System.Drawing; using System.Globalization; +using ReClassNET.Controls; using ReClassNET.Extensions; using ReClassNET.Memory; using ReClassNET.UI; diff --git a/ReClass.NET/Nodes/UTF16TextNode.cs b/ReClass.NET/Nodes/UTF16TextNode.cs index 8a7cef54..a0e3a175 100644 --- a/ReClass.NET/Nodes/UTF16TextNode.cs +++ b/ReClass.NET/Nodes/UTF16TextNode.cs @@ -1,6 +1,6 @@ -using System.Drawing; +using System.Drawing; using System.Text; -using ReClassNET.UI; +using ReClassNET.Controls; namespace ReClassNET.Nodes { diff --git a/ReClass.NET/Nodes/UTF16TextPtrNode.cs b/ReClass.NET/Nodes/UTF16TextPtrNode.cs index ec210c23..54ab0271 100644 --- a/ReClass.NET/Nodes/UTF16TextPtrNode.cs +++ b/ReClass.NET/Nodes/UTF16TextPtrNode.cs @@ -1,6 +1,6 @@ -using System.Drawing; +using System.Drawing; using System.Text; -using ReClassNET.UI; +using ReClassNET.Controls; namespace ReClassNET.Nodes { diff --git a/ReClass.NET/Nodes/UTF32TextNode.cs b/ReClass.NET/Nodes/UTF32TextNode.cs index 0868a3ae..b7d9fa41 100644 --- a/ReClass.NET/Nodes/UTF32TextNode.cs +++ b/ReClass.NET/Nodes/UTF32TextNode.cs @@ -1,6 +1,6 @@ -using System.Drawing; +using System.Drawing; using System.Text; -using ReClassNET.UI; +using ReClassNET.Controls; namespace ReClassNET.Nodes { diff --git a/ReClass.NET/Nodes/UTF32TextPtrNode.cs b/ReClass.NET/Nodes/UTF32TextPtrNode.cs index 840717fd..97934150 100644 --- a/ReClass.NET/Nodes/UTF32TextPtrNode.cs +++ b/ReClass.NET/Nodes/UTF32TextPtrNode.cs @@ -1,6 +1,6 @@ -using System.Drawing; +using System.Drawing; using System.Text; -using ReClassNET.UI; +using ReClassNET.Controls; namespace ReClassNET.Nodes { diff --git a/ReClass.NET/Nodes/UTF8TextNode.cs b/ReClass.NET/Nodes/UTF8TextNode.cs index 934c2d19..6fdbd0c3 100644 --- a/ReClass.NET/Nodes/UTF8TextNode.cs +++ b/ReClass.NET/Nodes/UTF8TextNode.cs @@ -1,6 +1,6 @@ -using System.Drawing; +using System.Drawing; using System.Text; -using ReClassNET.UI; +using ReClassNET.Controls; namespace ReClassNET.Nodes { diff --git a/ReClass.NET/Nodes/UTF8TextPtrNode.cs b/ReClass.NET/Nodes/UTF8TextPtrNode.cs index 71c7bfc8..ddebecd0 100644 --- a/ReClass.NET/Nodes/UTF8TextPtrNode.cs +++ b/ReClass.NET/Nodes/UTF8TextPtrNode.cs @@ -1,6 +1,6 @@ -using System.Drawing; +using System.Drawing; using System.Text; -using ReClassNET.UI; +using ReClassNET.Controls; namespace ReClassNET.Nodes { diff --git a/ReClass.NET/Nodes/UnionNode.cs b/ReClass.NET/Nodes/UnionNode.cs index 80d43c85..5506e8f9 100644 --- a/ReClass.NET/Nodes/UnionNode.cs +++ b/ReClass.NET/Nodes/UnionNode.cs @@ -1,6 +1,7 @@ -using System; +using System; using System.Drawing; using System.Linq; +using ReClassNET.Controls; using ReClassNET.UI; namespace ReClassNET.Nodes diff --git a/ReClass.NET/Nodes/Vector2Node.cs b/ReClass.NET/Nodes/Vector2Node.cs index b23809e1..8464478d 100644 --- a/ReClass.NET/Nodes/Vector2Node.cs +++ b/ReClass.NET/Nodes/Vector2Node.cs @@ -1,5 +1,6 @@ using System.Drawing; using System.Runtime.InteropServices; +using ReClassNET.Controls; using ReClassNET.UI; namespace ReClassNET.Nodes diff --git a/ReClass.NET/Nodes/Vector3Node.cs b/ReClass.NET/Nodes/Vector3Node.cs index 6b174376..6d5e93df 100644 --- a/ReClass.NET/Nodes/Vector3Node.cs +++ b/ReClass.NET/Nodes/Vector3Node.cs @@ -1,5 +1,6 @@ using System.Drawing; using System.Runtime.InteropServices; +using ReClassNET.Controls; using ReClassNET.UI; namespace ReClassNET.Nodes diff --git a/ReClass.NET/Nodes/Vector4Node.cs b/ReClass.NET/Nodes/Vector4Node.cs index 0bc97dbd..8ca4af3b 100644 --- a/ReClass.NET/Nodes/Vector4Node.cs +++ b/ReClass.NET/Nodes/Vector4Node.cs @@ -1,5 +1,6 @@ using System.Drawing; using System.Runtime.InteropServices; +using ReClassNET.Controls; using ReClassNET.UI; namespace ReClassNET.Nodes diff --git a/ReClass.NET/Nodes/VirtualMethodNode.cs b/ReClass.NET/Nodes/VirtualMethodNode.cs index 88b80a61..f71d6c90 100644 --- a/ReClass.NET/Nodes/VirtualMethodNode.cs +++ b/ReClass.NET/Nodes/VirtualMethodNode.cs @@ -1,7 +1,7 @@ -using System; +using System; using System.Diagnostics.Contracts; using System.Drawing; -using ReClassNET.UI; +using ReClassNET.Controls; namespace ReClassNET.Nodes { diff --git a/ReClass.NET/Nodes/VirtualMethodTableNode.cs b/ReClass.NET/Nodes/VirtualMethodTableNode.cs index 846772f2..08d8fc65 100644 --- a/ReClass.NET/Nodes/VirtualMethodTableNode.cs +++ b/ReClass.NET/Nodes/VirtualMethodTableNode.cs @@ -1,6 +1,7 @@ -using System; +using System; using System.Drawing; using System.Linq; +using ReClassNET.Controls; using ReClassNET.Memory; using ReClassNET.UI; diff --git a/ReClass.NET/UI/NodeTypesBuilder.cs b/ReClass.NET/UI/NodeTypesBuilder.cs index e5e85161..689171ab 100644 --- a/ReClass.NET/UI/NodeTypesBuilder.cs +++ b/ReClass.NET/UI/NodeTypesBuilder.cs @@ -4,6 +4,7 @@ using System.Drawing; using System.Linq; using System.Windows.Forms; +using ReClassNET.Controls; using ReClassNET.Nodes; using ReClassNET.Plugins; From e82e0d8e55ada31141f9c51b143594dd2f0e4355 Mon Sep 17 00:00:00 2001 From: KN4CK3R Date: Sat, 10 Oct 2020 17:20:16 +0200 Subject: [PATCH 164/223] Added IconProvider. --- .../Controls/DrawContextRequestEventArgs.cs | 3 ++ ReClass.NET/Controls/MemoryViewControl.cs | 1 + ReClass.NET/Controls/ViewInfo.cs | 2 ++ ReClass.NET/Forms/MainForm.cs | 2 ++ ReClass.NET/Nodes/BaseFunctionPtrNode.cs | 4 +-- ReClass.NET/Nodes/BaseHexNode.cs | 4 ++- ReClass.NET/Nodes/BaseMatrixNode.cs | 8 ++--- ReClass.NET/Nodes/BaseNode.cs | 33 +++++++++++-------- ReClass.NET/Nodes/BaseNumericNode.cs | 2 +- ReClass.NET/Nodes/BaseTextNode.cs | 5 +-- ReClass.NET/Nodes/BaseTextPtrNode.cs | 5 +-- ReClass.NET/Nodes/BaseWrapperArrayNode.cs | 8 ++--- ReClass.NET/Nodes/BitFieldNode.cs | 3 +- ReClass.NET/Nodes/BoolNode.cs | 3 +- ReClass.NET/Nodes/ClassInstanceNode.cs | 4 +-- ReClass.NET/Nodes/ClassNode.cs | 2 +- ReClass.NET/Nodes/DoubleNode.cs | 2 +- ReClass.NET/Nodes/EnumNode.cs | 6 ++-- ReClass.NET/Nodes/FloatNode.cs | 2 +- ReClass.NET/Nodes/FunctionNode.cs | 6 ++-- ReClass.NET/Nodes/Int16Node.cs | 2 +- ReClass.NET/Nodes/Int32Node.cs | 2 +- ReClass.NET/Nodes/Int64Node.cs | 2 +- ReClass.NET/Nodes/Int8Node.cs | 2 +- ReClass.NET/Nodes/PointerNode.cs | 6 ++-- ReClass.NET/Nodes/UInt16Node.cs | 2 +- ReClass.NET/Nodes/UInt32Node.cs | 2 +- ReClass.NET/Nodes/UInt64Node.cs | 2 +- ReClass.NET/Nodes/UInt8Node.cs | 2 +- ReClass.NET/Nodes/UnionNode.cs | 2 +- ReClass.NET/Nodes/VirtualMethodTableNode.cs | 2 +- ReClass.NET/ReClass.NET.csproj | 2 +- ReClass.NET/UI/IconProvider.cs | 31 +++++++++++++++++ ReClass.NET/UI/Icons.cs | 31 ----------------- 34 files changed, 108 insertions(+), 87 deletions(-) create mode 100644 ReClass.NET/UI/IconProvider.cs delete mode 100644 ReClass.NET/UI/Icons.cs diff --git a/ReClass.NET/Controls/DrawContextRequestEventArgs.cs b/ReClass.NET/Controls/DrawContextRequestEventArgs.cs index 2f57a36f..13c04d03 100644 --- a/ReClass.NET/Controls/DrawContextRequestEventArgs.cs +++ b/ReClass.NET/Controls/DrawContextRequestEventArgs.cs @@ -1,6 +1,7 @@ using System; using ReClassNET.Memory; using ReClassNET.Nodes; +using ReClassNET.UI; namespace ReClassNET.Controls { @@ -10,6 +11,8 @@ public class DrawContextRequestEventArgs : EventArgs public Settings Settings { get; set; } + public IconProvider IconProvider { get; set; } + public RemoteProcess Process { get; set; } public MemoryBuffer Memory { get; set; } diff --git a/ReClass.NET/Controls/MemoryViewControl.cs b/ReClass.NET/Controls/MemoryViewControl.cs index c6d2742c..34d8741c 100644 --- a/ReClass.NET/Controls/MemoryViewControl.cs +++ b/ReClass.NET/Controls/MemoryViewControl.cs @@ -126,6 +126,7 @@ protected override void OnPaint(PaintEventArgs e) Settings = args.Settings, Context = e.Graphics, Font = font, + IconProvider = args.IconProvider, Process = args.Process, Memory = args.Memory, CurrentTime = args.CurrentTime, diff --git a/ReClass.NET/Controls/ViewInfo.cs b/ReClass.NET/Controls/ViewInfo.cs index 7f0028e5..84b5fb91 100644 --- a/ReClass.NET/Controls/ViewInfo.cs +++ b/ReClass.NET/Controls/ViewInfo.cs @@ -12,6 +12,7 @@ public class ViewInfo public Graphics Context { get; set; } public FontEx Font { get; set; } + public IconProvider IconProvider { get; set; } public RemoteProcess Process { get; set; } public MemoryBuffer Memory { get; set; } @@ -31,6 +32,7 @@ public ViewInfo Clone() Settings = Settings, Context = Context, Font = Font, + IconProvider = IconProvider, Process = Process, Memory = Memory, CurrentTime = CurrentTime, diff --git a/ReClass.NET/Forms/MainForm.cs b/ReClass.NET/Forms/MainForm.cs index 32526168..9b6aa9bb 100644 --- a/ReClass.NET/Forms/MainForm.cs +++ b/ReClass.NET/Forms/MainForm.cs @@ -27,6 +27,7 @@ namespace ReClassNET.Forms public partial class MainForm : IconForm { private readonly PluginManager pluginManager; + private readonly IconProvider iconProvider = new IconProvider(); private ReClassNetProject currentProject; public ReClassNetProject CurrentProject => currentProject; @@ -1011,6 +1012,7 @@ private void memoryViewControl_DrawContextRequested(object sender, DrawContextRe memoryViewBuffer.UpdateFrom(process, address); args.Settings = Program.Settings; + args.IconProvider = iconProvider; args.Process = process; args.Memory = memoryViewBuffer; args.Node = classNode; diff --git a/ReClass.NET/Nodes/BaseFunctionPtrNode.cs b/ReClass.NET/Nodes/BaseFunctionPtrNode.cs index 476fff1c..0a4d4a9f 100644 --- a/ReClass.NET/Nodes/BaseFunctionPtrNode.cs +++ b/ReClass.NET/Nodes/BaseFunctionPtrNode.cs @@ -37,9 +37,9 @@ protected Size Draw(ViewInfo view, int x, int y, string type, string name) AddSelection(view, x, y, view.Font.Height); - x += TextPadding; + x = AddIconPadding(view, x); - x = AddIcon(view, x, y, Icons.Function, HotSpot.NoneId, HotSpotType.None); + x = AddIcon(view, x, y, view.IconProvider.Function, HotSpot.NoneId, HotSpotType.None); var tx = x; diff --git a/ReClass.NET/Nodes/BaseHexNode.cs b/ReClass.NET/Nodes/BaseHexNode.cs index b32f745a..cce27cab 100644 --- a/ReClass.NET/Nodes/BaseHexNode.cs +++ b/ReClass.NET/Nodes/BaseHexNode.cs @@ -45,7 +45,9 @@ protected Size Draw(ViewInfo view, int x, int y, string text, int length) AddSelection(view, x, y, view.Font.Height); - x += TextPadding + 16; + x = AddIconPadding(view, x); + x = AddIconPadding(view, x); + x = AddAddressOffset(view, x, y); if (!string.IsNullOrEmpty(text)) diff --git a/ReClass.NET/Nodes/BaseMatrixNode.cs b/ReClass.NET/Nodes/BaseMatrixNode.cs index 55057e0a..7a1927d0 100644 --- a/ReClass.NET/Nodes/BaseMatrixNode.cs +++ b/ReClass.NET/Nodes/BaseMatrixNode.cs @@ -33,9 +33,9 @@ protected Size DrawMatrixType(ViewInfo view, int x, int y, string type, DrawMatr AddSelection(view, x, y, view.Font.Height); - x += TextPadding; + x = AddIconPadding(view, x); - x = AddIcon(view, x, y, Icons.Matrix, HotSpot.NoneId, HotSpotType.None); + x = AddIcon(view, x, y, view.IconProvider.Matrix, HotSpot.NoneId, HotSpotType.None); var tx = x; @@ -83,9 +83,9 @@ protected Size DrawVectorType(ViewInfo view, int x, int y, string type, DrawVect AddSelection(view, x, y, view.Font.Height); - x += TextPadding; + x = AddIconPadding(view, x); - x = AddIcon(view, x, y, Icons.Vector, HotSpot.NoneId, HotSpotType.None); + x = AddIcon(view, x, y, view.IconProvider.Vector, HotSpot.NoneId, HotSpotType.None); x = AddAddressOffset(view, x, y); x = AddText(view, x, y, view.Settings.TypeColor, HotSpot.NoneId, type) + view.Font.Width; diff --git a/ReClass.NET/Nodes/BaseNode.cs b/ReClass.NET/Nodes/BaseNode.cs index 05e21eb9..953f2db9 100644 --- a/ReClass.NET/Nodes/BaseNode.cs +++ b/ReClass.NET/Nodes/BaseNode.cs @@ -20,7 +20,6 @@ public abstract class BaseNode internal static readonly List NodeInfoReader = new List(); - protected static readonly int TextPadding = Icons.Dimensions; protected static readonly int HiddenHeight = 0; private static int nodeIndex = 0; @@ -383,6 +382,11 @@ protected void AddSelection(ViewInfo view, int x, int y, int height) AddHotSpot(view, new Rectangle(0, y, view.ClientArea.Right - (IsSelected ? 16 : 0), height), string.Empty, HotSpot.NoneId, HotSpotType.Select); } + protected int AddIconPadding(ViewInfo view, int x) + { + return x + view.IconProvider.Dimensions; + } + /// Draws an icon and adds a if is not . /// The view information. /// The x coordinate. @@ -397,19 +401,21 @@ protected int AddIcon(ViewInfo view, int x, int y, Image icon, int id, HotSpotTy Contract.Requires(view.Context != null); Contract.Requires(icon != null); - if (y > view.ClientArea.Bottom || y + Icons.Dimensions < 0) + var size = view.IconProvider.Dimensions; + + if (y > view.ClientArea.Bottom || y + size < 0) { - return x + Icons.Dimensions; + return x + size; } - view.Context.DrawImage(icon, x + 2, y, Icons.Dimensions, Icons.Dimensions); + view.Context.DrawImage(icon, x + 2, y, size, size); if (id != HotSpot.NoneId) { - AddHotSpot(view, new Rectangle(x, y, Icons.Dimensions, Icons.Dimensions), string.Empty, id, type); + AddHotSpot(view, new Rectangle(x, y, size, size), string.Empty, id, type); } - return x + Icons.Dimensions; + return x + size; } /// Adds a togglable Open/Close icon. @@ -422,12 +428,13 @@ protected int AddOpenCloseIcon(ViewInfo view, int x, int y) Contract.Requires(view != null); Contract.Requires(view.Context != null); - if (y > view.ClientArea.Bottom || y + Icons.Dimensions < 0) + if (y > view.ClientArea.Bottom || y + view.IconProvider.Dimensions < 0) { - return x + Icons.Dimensions; + return x + view.IconProvider.Dimensions; } - return AddIcon(view, x, y, LevelsOpen[view.Level] ? Icons.OpenCloseOpen : Icons.OpenCloseClosed, 0, HotSpotType.OpenClose); + var icon = LevelsOpen[view.Level] ? view.IconProvider.OpenCloseOpen : view.IconProvider.OpenCloseClosed; + return AddIcon(view, x, y, icon, 0, HotSpotType.OpenClose); } /// Draws a context drop icon if the node is selected. @@ -438,14 +445,14 @@ protected void AddContextDropDownIcon(ViewInfo view, int y) Contract.Requires(view != null); Contract.Requires(view.Context != null); - if (view.MultipleNodesSelected || y > view.ClientArea.Bottom || y + Icons.Dimensions < 0 || IsWrapped) + if (view.MultipleNodesSelected || y > view.ClientArea.Bottom || y + view.IconProvider.Dimensions < 0 || IsWrapped) { return; } if (IsSelected) { - AddIcon(view, 0, y, Icons.DropArrow, 0, HotSpotType.Context); + AddIcon(view, 0, y, view.IconProvider.DropArrow, 0, HotSpotType.Context); } } @@ -457,14 +464,14 @@ protected void AddDeleteIcon(ViewInfo view, int y) Contract.Requires(view != null); Contract.Requires(view.Context != null); - if (y > view.ClientArea.Bottom || y + Icons.Dimensions < 0 || IsWrapped) + if (y > view.ClientArea.Bottom || y + view.IconProvider.Dimensions < 0 || IsWrapped) { return; } if (IsSelected) { - AddIcon(view, view.ClientArea.Right - Icons.Dimensions, y, Icons.Delete, 0, HotSpotType.Delete); + AddIcon(view, view.ClientArea.Right - view.IconProvider.Dimensions, y, view.IconProvider.Delete, 0, HotSpotType.Delete); } } diff --git a/ReClass.NET/Nodes/BaseNumericNode.cs b/ReClass.NET/Nodes/BaseNumericNode.cs index 5714b9f0..c0a540fc 100644 --- a/ReClass.NET/Nodes/BaseNumericNode.cs +++ b/ReClass.NET/Nodes/BaseNumericNode.cs @@ -32,7 +32,7 @@ protected Size DrawNumeric(ViewInfo view, int x, int y, Image icon, string type, AddSelection(view, x, y, view.Font.Height); - x += TextPadding; + x = AddIconPadding(view, x); x = AddIcon(view, x, y, icon, HotSpot.NoneId, HotSpotType.None); x = AddAddressOffset(view, x, y); diff --git a/ReClass.NET/Nodes/BaseTextNode.cs b/ReClass.NET/Nodes/BaseTextNode.cs index e35fd6b7..70b52dda 100644 --- a/ReClass.NET/Nodes/BaseTextNode.cs +++ b/ReClass.NET/Nodes/BaseTextNode.cs @@ -42,8 +42,9 @@ protected Size DrawText(ViewInfo view, int x, int y, string type) AddSelection(view, x, y, view.Font.Height); - x += TextPadding; - x = AddIcon(view, x, y, Icons.Text, HotSpot.NoneId, HotSpotType.None); + x = AddIconPadding(view, x); + + x = AddIcon(view, x, y, view.IconProvider.Text, HotSpot.NoneId, HotSpotType.None); x = AddAddressOffset(view, x, y); x = AddText(view, x, y, view.Settings.TypeColor, HotSpot.NoneId, type) + view.Font.Width; diff --git a/ReClass.NET/Nodes/BaseTextPtrNode.cs b/ReClass.NET/Nodes/BaseTextPtrNode.cs index ea32e11b..df0f6ee2 100644 --- a/ReClass.NET/Nodes/BaseTextPtrNode.cs +++ b/ReClass.NET/Nodes/BaseTextPtrNode.cs @@ -39,8 +39,9 @@ public Size DrawText(ViewInfo view, int x, int y, string type) AddSelection(view, x, y, view.Font.Height); - x += TextPadding; - x = AddIcon(view, x, y, Icons.Text, HotSpot.NoneId, HotSpotType.None); + x = AddIconPadding(view, x); + + x = AddIcon(view, x, y, view.IconProvider.Text, HotSpot.NoneId, HotSpotType.None); x = AddAddressOffset(view, x, y); x = AddText(view, x, y, view.Settings.TypeColor, HotSpot.NoneId, type) + view.Font.Width; diff --git a/ReClass.NET/Nodes/BaseWrapperArrayNode.cs b/ReClass.NET/Nodes/BaseWrapperArrayNode.cs index 5ec12c14..6694ba6f 100644 --- a/ReClass.NET/Nodes/BaseWrapperArrayNode.cs +++ b/ReClass.NET/Nodes/BaseWrapperArrayNode.cs @@ -40,7 +40,7 @@ protected Size Draw(ViewInfo view, int x, int y, string type) AddSelection(view, x, y, view.Font.Height); x = AddOpenCloseIcon(view, x, y); - x = AddIcon(view, x, y, Icons.Array, HotSpot.NoneId, HotSpotType.None); + x = AddIcon(view, x, y, view.IconProvider.Array, HotSpot.NoneId, HotSpotType.None); var tx = x; x = AddAddressOffset(view, x, y); @@ -54,14 +54,14 @@ protected Size Draw(ViewInfo view, int x, int y, string type) x = AddText(view, x, y, view.Settings.IndexColor, IsReadOnly ? HotSpot.NoneId : 0, Count.ToString()); x = AddText(view, x, y, view.Settings.IndexColor, HotSpot.NoneId, "]"); - x = AddIcon(view, x, y, Icons.LeftArrow, 2, HotSpotType.Click); + x = AddIcon(view, x, y, view.IconProvider.LeftArrow, 2, HotSpotType.Click); x = AddText(view, x, y, view.Settings.IndexColor, HotSpot.NoneId, "("); x = AddText(view, x, y, view.Settings.IndexColor, 1, CurrentIndex.ToString()); x = AddText(view, x, y, view.Settings.IndexColor, HotSpot.NoneId, ")"); - x = AddIcon(view, x, y, Icons.RightArrow, 3, HotSpotType.Click) + view.Font.Width; + x = AddIcon(view, x, y, view.IconProvider.RightArrow, 3, HotSpotType.Click) + view.Font.Width; x = AddText(view, x, y, view.Settings.ValueColor, HotSpot.NoneId, $"") + view.Font.Width; - x = AddIcon(view, x + 2, y, Icons.Change, 4, HotSpotType.ChangeWrappedType); + x = AddIcon(view, x + 2, y, view.IconProvider.Change, 4, HotSpotType.ChangeWrappedType); x += view.Font.Width; x = AddComment(view, x, y); diff --git a/ReClass.NET/Nodes/BitFieldNode.cs b/ReClass.NET/Nodes/BitFieldNode.cs index 733d4f8f..f12b4f0b 100644 --- a/ReClass.NET/Nodes/BitFieldNode.cs +++ b/ReClass.NET/Nodes/BitFieldNode.cs @@ -122,7 +122,8 @@ public override Size Draw(ViewInfo view, int x, int y) AddSelection(view, x, y, view.Font.Height); - x += TextPadding + Icons.Dimensions; + x = AddIconPadding(view, x); + x = AddIconPadding(view, x); x = AddAddressOffset(view, x, y); diff --git a/ReClass.NET/Nodes/BoolNode.cs b/ReClass.NET/Nodes/BoolNode.cs index b5f12f5a..e448b8f4 100644 --- a/ReClass.NET/Nodes/BoolNode.cs +++ b/ReClass.NET/Nodes/BoolNode.cs @@ -25,7 +25,8 @@ public override Size Draw(ViewInfo view, int x, int y) AddSelection(view, x, y, view.Font.Height); - x += TextPadding + Icons.Dimensions; + x = AddIconPadding(view, x); + x = AddIconPadding(view, x); x = AddAddressOffset(view, x, y); diff --git a/ReClass.NET/Nodes/ClassInstanceNode.cs b/ReClass.NET/Nodes/ClassInstanceNode.cs index d5c36a54..a6395c6b 100644 --- a/ReClass.NET/Nodes/ClassInstanceNode.cs +++ b/ReClass.NET/Nodes/ClassInstanceNode.cs @@ -30,7 +30,7 @@ public override Size Draw(ViewInfo view, int x, int y) AddSelection(view, x, y, view.Font.Height); x = AddOpenCloseIcon(view, x, y); - x = AddIcon(view, x, y, Icons.Class, HotSpot.NoneId, HotSpotType.None); + x = AddIcon(view, x, y, view.IconProvider.Class, HotSpot.NoneId, HotSpotType.None); var tx = x; x = AddAddressOffset(view, x, y); @@ -41,7 +41,7 @@ public override Size Draw(ViewInfo view, int x, int y) x = AddText(view, x, y, view.Settings.NameColor, HotSpot.NameId, Name) + view.Font.Width; } x = AddText(view, x, y, view.Settings.ValueColor, HotSpot.NoneId, $"<{InnerNode.Name}>") + view.Font.Width; - x = AddIcon(view, x, y, Icons.Change, 4, HotSpotType.ChangeClassType) + view.Font.Width; + x = AddIcon(view, x, y, view.IconProvider.Change, 4, HotSpotType.ChangeClassType) + view.Font.Width; x = AddComment(view, x, y); diff --git a/ReClass.NET/Nodes/ClassNode.cs b/ReClass.NET/Nodes/ClassNode.cs index 7ce6a53f..3c4897a3 100644 --- a/ReClass.NET/Nodes/ClassNode.cs +++ b/ReClass.NET/Nodes/ClassNode.cs @@ -96,7 +96,7 @@ public override Size Draw(ViewInfo view, int x, int y) var tx = x; - x = AddIcon(view, x, y, Icons.Class, HotSpot.NoneId, HotSpotType.None); + x = AddIcon(view, x, y, view.IconProvider.Class, HotSpot.NoneId, HotSpotType.None); x = AddText(view, x, y, view.Settings.OffsetColor, 0, AddressFormula) + view.Font.Width; x = AddText(view, x, y, view.Settings.TypeColor, HotSpot.NoneId, "Class") + view.Font.Width; diff --git a/ReClass.NET/Nodes/DoubleNode.cs b/ReClass.NET/Nodes/DoubleNode.cs index 7c0deda8..f37e4c08 100644 --- a/ReClass.NET/Nodes/DoubleNode.cs +++ b/ReClass.NET/Nodes/DoubleNode.cs @@ -17,7 +17,7 @@ public override void GetUserInterfaceInfo(out string name, out Image icon) public override Size Draw(ViewInfo view, int x, int y) { - return DrawNumeric(view, x, y, Icons.Double, "Double", ReadValueFromMemory(view.Memory).ToString("0.000"), null); + return DrawNumeric(view, x, y, view.IconProvider.Double, "Double", ReadValueFromMemory(view.Memory).ToString("0.000"), null); } public override void Update(HotSpot spot) diff --git a/ReClass.NET/Nodes/EnumNode.cs b/ReClass.NET/Nodes/EnumNode.cs index f4b16ca7..cc6f25df 100644 --- a/ReClass.NET/Nodes/EnumNode.cs +++ b/ReClass.NET/Nodes/EnumNode.cs @@ -146,9 +146,9 @@ public override Size Draw(ViewInfo view, int x, int y) AddSelection(view, x, y, view.Font.Height); - x += TextPadding; + x = AddIconPadding(view, x); - x = AddIcon(view, x, y, Icons.Enum, HotSpot.NoneId, HotSpotType.None); + x = AddIcon(view, x, y, view.IconProvider.Enum, HotSpot.NoneId, HotSpotType.None); x = AddAddressOffset(view, x, y); @@ -158,7 +158,7 @@ public override Size Draw(ViewInfo view, int x, int y) x = AddText(view, x, y, view.Settings.NameColor, HotSpot.NameId, Name) + view.Font.Width; } x = AddText(view, x, y, view.Settings.ValueColor, HotSpot.NoneId, $"<{Enum.Name}>") + view.Font.Width; - x = AddIcon(view, x, y, Icons.Change, 4, HotSpotType.ChangeEnumType) + view.Font.Width; + x = AddIcon(view, x, y, view.IconProvider.Change, 4, HotSpotType.ChangeEnumType) + view.Font.Width; x = AddText(view, x, y, view.Settings.TextColor, HotSpot.NoneId, "=") + view.Font.Width; diff --git a/ReClass.NET/Nodes/FloatNode.cs b/ReClass.NET/Nodes/FloatNode.cs index 4fe0072b..73e47e7a 100644 --- a/ReClass.NET/Nodes/FloatNode.cs +++ b/ReClass.NET/Nodes/FloatNode.cs @@ -17,7 +17,7 @@ public override void GetUserInterfaceInfo(out string name, out Image icon) public override Size Draw(ViewInfo view, int x, int y) { - return DrawNumeric(view, x, y, Icons.Float, "Float", ReadValueFromMemory(view.Memory).ToString("0.000"), null); + return DrawNumeric(view, x, y, view.IconProvider.Float, "Float", ReadValueFromMemory(view.Memory).ToString("0.000"), null); } public override void Update(HotSpot spot) diff --git a/ReClass.NET/Nodes/FunctionNode.cs b/ReClass.NET/Nodes/FunctionNode.cs index 0f5311cb..75dd6d2b 100644 --- a/ReClass.NET/Nodes/FunctionNode.cs +++ b/ReClass.NET/Nodes/FunctionNode.cs @@ -44,9 +44,9 @@ public override Size Draw(ViewInfo view, int x, int y) AddSelection(view, x, y, view.Font.Height); - x += TextPadding; + x = AddIconPadding(view, x); - x = AddIcon(view, x, y, Icons.Function, HotSpot.NoneId, HotSpotType.None); + x = AddIcon(view, x, y, view.IconProvider.Function, HotSpot.NoneId, HotSpotType.None); var tx = x; @@ -82,7 +82,7 @@ public override Size Draw(ViewInfo view, int x, int y) y += view.Font.Height; x = AddText(view, tx, y, view.Settings.TextColor, HotSpot.NoneId, "Belongs to: "); x = AddText(view, x, y, view.Settings.ValueColor, HotSpot.NoneId, BelongsToClass == null ? "" : $"<{BelongsToClass.Name}>") + view.Font.Width; - x = AddIcon(view, x, y, Icons.Change, 1, HotSpotType.ChangeClassType); + x = AddIcon(view, x, y, view.IconProvider.Change, 1, HotSpotType.ChangeClassType); size.Width = Math.Max(size.Width, x - origX); size.Height += view.Font.Height; diff --git a/ReClass.NET/Nodes/Int16Node.cs b/ReClass.NET/Nodes/Int16Node.cs index 7d4c7e1e..cba270a4 100644 --- a/ReClass.NET/Nodes/Int16Node.cs +++ b/ReClass.NET/Nodes/Int16Node.cs @@ -20,7 +20,7 @@ public override void GetUserInterfaceInfo(out string name, out Image icon) public override Size Draw(ViewInfo view, int x, int y) { var value = ReadValueFromMemory(view.Memory); - return DrawNumeric(view, x, y, Icons.Signed, "Int16", value.ToString(), $"0x{value:X}"); + return DrawNumeric(view, x, y, view.IconProvider.Signed, "Int16", value.ToString(), $"0x{value:X}"); } public override void Update(HotSpot spot) diff --git a/ReClass.NET/Nodes/Int32Node.cs b/ReClass.NET/Nodes/Int32Node.cs index c495e9e0..28518e87 100644 --- a/ReClass.NET/Nodes/Int32Node.cs +++ b/ReClass.NET/Nodes/Int32Node.cs @@ -20,7 +20,7 @@ public override void GetUserInterfaceInfo(out string name, out Image icon) public override Size Draw(ViewInfo view, int x, int y) { var value = ReadValueFromMemory(view.Memory); - return DrawNumeric(view, x, y, Icons.Signed, "Int32", value.ToString(), $"0x{value:X}"); + return DrawNumeric(view, x, y, view.IconProvider.Signed, "Int32", value.ToString(), $"0x{value:X}"); } public override void Update(HotSpot spot) diff --git a/ReClass.NET/Nodes/Int64Node.cs b/ReClass.NET/Nodes/Int64Node.cs index cd750b94..3cb9e8a5 100644 --- a/ReClass.NET/Nodes/Int64Node.cs +++ b/ReClass.NET/Nodes/Int64Node.cs @@ -20,7 +20,7 @@ public override void GetUserInterfaceInfo(out string name, out Image icon) public override Size Draw(ViewInfo view, int x, int y) { var value = ReadValueFromMemory(view.Memory); - return DrawNumeric(view, x, y, Icons.Signed, "Int64", value.ToString(), $"0x{value:X}"); + return DrawNumeric(view, x, y, view.IconProvider.Signed, "Int64", value.ToString(), $"0x{value:X}"); } public override void Update(HotSpot spot) diff --git a/ReClass.NET/Nodes/Int8Node.cs b/ReClass.NET/Nodes/Int8Node.cs index bd09480f..4690a69b 100644 --- a/ReClass.NET/Nodes/Int8Node.cs +++ b/ReClass.NET/Nodes/Int8Node.cs @@ -20,7 +20,7 @@ public override void GetUserInterfaceInfo(out string name, out Image icon) public override Size Draw(ViewInfo view, int x, int y) { var value = ReadValueFromMemory(view.Memory); - return DrawNumeric(view, x, y, Icons.Signed, "Int8", value.ToString(), $"0x{value:X}"); + return DrawNumeric(view, x, y, view.IconProvider.Signed, "Int8", value.ToString(), $"0x{value:X}"); } public override void Update(HotSpot spot) diff --git a/ReClass.NET/Nodes/PointerNode.cs b/ReClass.NET/Nodes/PointerNode.cs index 358c48a3..0c7b5139 100644 --- a/ReClass.NET/Nodes/PointerNode.cs +++ b/ReClass.NET/Nodes/PointerNode.cs @@ -73,9 +73,9 @@ public override Size Draw(ViewInfo view, int x, int y) } else { - x += TextPadding; + x = AddIconPadding(view, x); } - x = AddIcon(view, x, y, Icons.Pointer, HotSpot.NoneId, HotSpotType.None); + x = AddIcon(view, x, y, view.IconProvider.Pointer, HotSpot.NoneId, HotSpotType.None); var tx = x; x = AddAddressOffset(view, x, y); @@ -89,7 +89,7 @@ public override Size Draw(ViewInfo view, int x, int y) { x = AddText(view, x, y, view.Settings.ValueColor, HotSpot.NoneId, "") + view.Font.Width; } - x = AddIcon(view, x, y, Icons.Change, 4, HotSpotType.ChangeWrappedType) + view.Font.Width; + x = AddIcon(view, x, y, view.IconProvider.Change, 4, HotSpotType.ChangeWrappedType) + view.Font.Width; var ptr = view.Memory.ReadIntPtr(Offset); diff --git a/ReClass.NET/Nodes/UInt16Node.cs b/ReClass.NET/Nodes/UInt16Node.cs index 81fb9bc8..32177b36 100644 --- a/ReClass.NET/Nodes/UInt16Node.cs +++ b/ReClass.NET/Nodes/UInt16Node.cs @@ -20,7 +20,7 @@ public override void GetUserInterfaceInfo(out string name, out Image icon) public override Size Draw(ViewInfo view, int x, int y) { var value = ReadValueFromMemory(view.Memory); - return DrawNumeric(view, x, y, Icons.Unsigned, "UInt16", value.ToString(), $"0x{value:X}"); + return DrawNumeric(view, x, y, view.IconProvider.Unsigned, "UInt16", value.ToString(), $"0x{value:X}"); } public override void Update(HotSpot spot) diff --git a/ReClass.NET/Nodes/UInt32Node.cs b/ReClass.NET/Nodes/UInt32Node.cs index 081b574f..625f58a3 100644 --- a/ReClass.NET/Nodes/UInt32Node.cs +++ b/ReClass.NET/Nodes/UInt32Node.cs @@ -20,7 +20,7 @@ public override void GetUserInterfaceInfo(out string name, out Image icon) public override Size Draw(ViewInfo view, int x, int y) { var value = ReadValueFromMemory(view.Memory); - return DrawNumeric(view, x, y, Icons.Unsigned, "UInt32", value.ToString(), $"0x{value:X}"); + return DrawNumeric(view, x, y, view.IconProvider.Unsigned, "UInt32", value.ToString(), $"0x{value:X}"); } public override void Update(HotSpot spot) diff --git a/ReClass.NET/Nodes/UInt64Node.cs b/ReClass.NET/Nodes/UInt64Node.cs index 20464b9b..903a8bae 100644 --- a/ReClass.NET/Nodes/UInt64Node.cs +++ b/ReClass.NET/Nodes/UInt64Node.cs @@ -20,7 +20,7 @@ public override void GetUserInterfaceInfo(out string name, out Image icon) public override Size Draw(ViewInfo view, int x, int y) { var value = ReadValueFromMemory(view.Memory); - return DrawNumeric(view, x, y, Icons.Unsigned, "UInt64", value.ToString(), $"0x{value:X}"); + return DrawNumeric(view, x, y, view.IconProvider.Unsigned, "UInt64", value.ToString(), $"0x{value:X}"); } public override void Update(HotSpot spot) diff --git a/ReClass.NET/Nodes/UInt8Node.cs b/ReClass.NET/Nodes/UInt8Node.cs index a5dec2c9..da5be305 100644 --- a/ReClass.NET/Nodes/UInt8Node.cs +++ b/ReClass.NET/Nodes/UInt8Node.cs @@ -20,7 +20,7 @@ public override void GetUserInterfaceInfo(out string name, out Image icon) public override Size Draw(ViewInfo view, int x, int y) { var value = ReadValueFromMemory(view.Memory); - return DrawNumeric(view, x, y, Icons.Unsigned, "UInt8", value.ToString(), $"0x{value:X}"); + return DrawNumeric(view, x, y, view.IconProvider.Unsigned, "UInt8", value.ToString(), $"0x{value:X}"); } public override void Update(HotSpot spot) diff --git a/ReClass.NET/Nodes/UnionNode.cs b/ReClass.NET/Nodes/UnionNode.cs index 5506e8f9..e30eb3cb 100644 --- a/ReClass.NET/Nodes/UnionNode.cs +++ b/ReClass.NET/Nodes/UnionNode.cs @@ -57,7 +57,7 @@ public override Size Draw(ViewInfo view, int x, int y) AddSelection(view, x, y, view.Font.Height); x = AddOpenCloseIcon(view, x, y); - x = AddIcon(view, x, y, Icons.Union, -1, HotSpotType.None); + x = AddIcon(view, x, y, view.IconProvider.Union, -1, HotSpotType.None); var tx = x; x = AddAddressOffset(view, x, y); diff --git a/ReClass.NET/Nodes/VirtualMethodTableNode.cs b/ReClass.NET/Nodes/VirtualMethodTableNode.cs index 08d8fc65..64b10a65 100644 --- a/ReClass.NET/Nodes/VirtualMethodTableNode.cs +++ b/ReClass.NET/Nodes/VirtualMethodTableNode.cs @@ -47,7 +47,7 @@ public override Size Draw(ViewInfo view, int x, int y) AddSelection(view, x, y, view.Font.Height); x = AddOpenCloseIcon(view, x, y); - x = AddIcon(view, x, y, Icons.VTable, HotSpot.NoneId, HotSpotType.None); + x = AddIcon(view, x, y, view.IconProvider.VirtualTable, HotSpot.NoneId, HotSpotType.None); var tx = x; x = AddAddressOffset(view, x, y); diff --git a/ReClass.NET/ReClass.NET.csproj b/ReClass.NET/ReClass.NET.csproj index 736b0388..c16db79d 100644 --- a/ReClass.NET/ReClass.NET.csproj +++ b/ReClass.NET/ReClass.NET.csproj @@ -371,6 +371,7 @@ Component + Component @@ -423,7 +424,6 @@ Component - Form diff --git a/ReClass.NET/UI/IconProvider.cs b/ReClass.NET/UI/IconProvider.cs new file mode 100644 index 00000000..f60bce26 --- /dev/null +++ b/ReClass.NET/UI/IconProvider.cs @@ -0,0 +1,31 @@ +using System.Drawing; + +namespace ReClassNET.UI +{ + public class IconProvider + { + public int Dimensions { get; } = DpiUtil.ScaleIntX(16); + + public Image OpenCloseOpen { get; } = DpiUtil.ScaleImage(Properties.Resources.B16x16_Open_Icon); + public Image OpenCloseClosed { get; } = DpiUtil.ScaleImage(Properties.Resources.B16x16_Closed_Icon); + public Image Delete { get; } = DpiUtil.ScaleImage(Properties.Resources.B16x16_Button_Delete); + public Image DropArrow { get; } = DpiUtil.ScaleImage(Properties.Resources.B16x16_Button_Drop_Down); + public Image Class { get; } = DpiUtil.ScaleImage(Properties.Resources.B16x16_Class_Type); + public Image Enum { get; } = DpiUtil.ScaleImage(Properties.Resources.B16x16_Enum_Type); + public Image Array { get; } = DpiUtil.ScaleImage(Properties.Resources.B16x16_Array_Type); + public Image Union => Array; + public Image LeftArrow { get; } = DpiUtil.ScaleImage(Properties.Resources.B16x16_Left_Button); + public Image RightArrow { get; } = DpiUtil.ScaleImage(Properties.Resources.B16x16_Right_Button); + public Image Change { get; } = DpiUtil.ScaleImage(Properties.Resources.B16x16_Exchange_Button); + public Image Unsigned { get; } = DpiUtil.ScaleImage(Properties.Resources.B16x16_Unsigned_Type); + public Image Signed { get; } = DpiUtil.ScaleImage(Properties.Resources.B16x16_Signed_Type); + public Image Float { get; } = DpiUtil.ScaleImage(Properties.Resources.B16x16_Float_Type); + public Image Double { get; } = DpiUtil.ScaleImage(Properties.Resources.B16x16_Double_Type); + public Image Vector { get; } = DpiUtil.ScaleImage(Properties.Resources.B16x16_Vector_Type); + public Image Matrix { get; } = DpiUtil.ScaleImage(Properties.Resources.B16x16_Matrix_Type); + public Image Text { get; } = DpiUtil.ScaleImage(Properties.Resources.B16x16_Text_Type); + public Image Pointer { get; } = DpiUtil.ScaleImage(Properties.Resources.B16x16_Pointer_Type); + public Image Function { get; } = DpiUtil.ScaleImage(Properties.Resources.B16x16_Function_Type); + public Image VirtualTable { get; } = DpiUtil.ScaleImage(Properties.Resources.B16x16_Interface_Type); + } +} diff --git a/ReClass.NET/UI/Icons.cs b/ReClass.NET/UI/Icons.cs deleted file mode 100644 index 0ae65d0e..00000000 --- a/ReClass.NET/UI/Icons.cs +++ /dev/null @@ -1,31 +0,0 @@ -using System.Drawing; - -namespace ReClassNET.UI -{ - public class Icons - { - public static int Dimensions { get; } = DpiUtil.ScaleIntX(16); - - public static Image OpenCloseOpen { get; } = DpiUtil.ScaleImage(Properties.Resources.B16x16_Open_Icon); - public static Image OpenCloseClosed { get; } = DpiUtil.ScaleImage(Properties.Resources.B16x16_Closed_Icon); - public static Image Delete { get; } = DpiUtil.ScaleImage(Properties.Resources.B16x16_Button_Delete); - public static Image DropArrow { get; } = DpiUtil.ScaleImage(Properties.Resources.B16x16_Button_Drop_Down); - public static Image Class { get; } = DpiUtil.ScaleImage(Properties.Resources.B16x16_Class_Type); - public static Image Enum { get; } = DpiUtil.ScaleImage(Properties.Resources.B16x16_Enum_Type); - public static Image Array { get; } = DpiUtil.ScaleImage(Properties.Resources.B16x16_Array_Type); - public static Image Union => Array; - public static Image LeftArrow { get; } = DpiUtil.ScaleImage(Properties.Resources.B16x16_Left_Button); - public static Image RightArrow { get; } = DpiUtil.ScaleImage(Properties.Resources.B16x16_Right_Button); - public static Image Change { get; } = DpiUtil.ScaleImage(Properties.Resources.B16x16_Exchange_Button); - public static Image Unsigned { get; } = DpiUtil.ScaleImage(Properties.Resources.B16x16_Unsigned_Type); - public static Image Signed { get; } = DpiUtil.ScaleImage(Properties.Resources.B16x16_Signed_Type); - public static Image Float { get; } = DpiUtil.ScaleImage(Properties.Resources.B16x16_Float_Type); - public static Image Double { get; } = DpiUtil.ScaleImage(Properties.Resources.B16x16_Double_Type); - public static Image Vector { get; } = DpiUtil.ScaleImage(Properties.Resources.B16x16_Vector_Type); - public static Image Matrix { get; } = DpiUtil.ScaleImage(Properties.Resources.B16x16_Matrix_Type); - public static Image Text { get; } = DpiUtil.ScaleImage(Properties.Resources.B16x16_Text_Type); - public static Image Pointer { get; } = DpiUtil.ScaleImage(Properties.Resources.B16x16_Pointer_Type); - public static Image Function { get; } = DpiUtil.ScaleImage(Properties.Resources.B16x16_Function_Type); - public static Image VTable { get; } = DpiUtil.ScaleImage(Properties.Resources.B16x16_Interface_Type); - } -} From 924382387e89b40980e2970ce014eb2820f83717 Mon Sep 17 00:00:00 2001 From: KN4CK3R Date: Sat, 10 Oct 2020 19:53:41 +0200 Subject: [PATCH 165/223] Renamed ViewInfo to DrawContext. --- ReClass.NET/CodeGenerator/CppCodeGenerator.cs | 12 +-- .../Controls/{ViewInfo.cs => DrawContext.cs} | 10 +-- ReClass.NET/Controls/MemoryPreviewPopUp.cs | 30 +++---- ReClass.NET/Controls/MemoryViewControl.cs | 4 +- .../ReClass/Legacy/BaseClassArrayNode.cs | 4 +- .../ReClass/Legacy/ClassPointerNode.cs | 4 +- .../DataExchange/ReClass/Legacy/CustomNode.cs | 4 +- ReClass.NET/Nodes/ArrayNode.cs | 6 +- ReClass.NET/Nodes/BaseFunctionNode.cs | 6 +- ReClass.NET/Nodes/BaseFunctionPtrNode.cs | 4 +- ReClass.NET/Nodes/BaseHexCommentNode.cs | 2 +- ReClass.NET/Nodes/BaseHexNode.cs | 4 +- ReClass.NET/Nodes/BaseMatrixNode.cs | 8 +- ReClass.NET/Nodes/BaseNode.cs | 90 +++++++++---------- ReClass.NET/Nodes/BaseNumericNode.cs | 6 +- ReClass.NET/Nodes/BaseTextNode.cs | 4 +- ReClass.NET/Nodes/BaseTextPtrNode.cs | 6 +- ReClass.NET/Nodes/BaseWrapperArrayNode.cs | 6 +- ReClass.NET/Nodes/BitFieldNode.cs | 48 +++++----- ReClass.NET/Nodes/BoolNode.cs | 34 +++---- ReClass.NET/Nodes/ClassInstanceNode.cs | 40 ++++----- ReClass.NET/Nodes/ClassNode.cs | 30 +++---- ReClass.NET/Nodes/DoubleNode.cs | 4 +- ReClass.NET/Nodes/EnumNode.cs | 38 ++++---- ReClass.NET/Nodes/FloatNode.cs | 4 +- ReClass.NET/Nodes/FunctionNode.cs | 58 ++++++------ ReClass.NET/Nodes/FunctionPtrNode.cs | 4 +- ReClass.NET/Nodes/Hex16Node.cs | 4 +- ReClass.NET/Nodes/Hex32Node.cs | 6 +- ReClass.NET/Nodes/Hex64Node.cs | 6 +- ReClass.NET/Nodes/Hex8Node.cs | 4 +- ReClass.NET/Nodes/Int16Node.cs | 6 +- ReClass.NET/Nodes/Int32Node.cs | 6 +- ReClass.NET/Nodes/Int64Node.cs | 6 +- ReClass.NET/Nodes/Int8Node.cs | 6 +- ReClass.NET/Nodes/Matrix3x3Node.cs | 56 ++++++------ ReClass.NET/Nodes/Matrix3x4Node.cs | 68 +++++++------- ReClass.NET/Nodes/Matrix4x4Node.cs | 88 +++++++++--------- ReClass.NET/Nodes/PointerNode.cs | 46 +++++----- ReClass.NET/Nodes/UInt16Node.cs | 6 +- ReClass.NET/Nodes/UInt32Node.cs | 6 +- ReClass.NET/Nodes/UInt64Node.cs | 6 +- ReClass.NET/Nodes/UInt8Node.cs | 6 +- ReClass.NET/Nodes/UTF16TextNode.cs | 4 +- ReClass.NET/Nodes/UTF16TextPtrNode.cs | 4 +- ReClass.NET/Nodes/UTF32TextNode.cs | 4 +- ReClass.NET/Nodes/UTF32TextPtrNode.cs | 4 +- ReClass.NET/Nodes/UTF8TextNode.cs | 4 +- ReClass.NET/Nodes/UTF8TextPtrNode.cs | 4 +- ReClass.NET/Nodes/UnionNode.cs | 36 ++++---- ReClass.NET/Nodes/Vector2Node.cs | 18 ++-- ReClass.NET/Nodes/Vector3Node.cs | 24 ++--- ReClass.NET/Nodes/Vector4Node.cs | 28 +++--- ReClass.NET/Nodes/VirtualMethodNode.cs | 4 +- ReClass.NET/Nodes/VirtualMethodTableNode.cs | 36 ++++---- ReClass.NET/ReClass.NET.csproj | 2 +- 56 files changed, 484 insertions(+), 484 deletions(-) rename ReClass.NET/Controls/{ViewInfo.cs => DrawContext.cs} (86%) diff --git a/ReClass.NET/CodeGenerator/CppCodeGenerator.cs b/ReClass.NET/CodeGenerator/CppCodeGenerator.cs index 10318705..71bca3a8 100644 --- a/ReClass.NET/CodeGenerator/CppCodeGenerator.cs +++ b/ReClass.NET/CodeGenerator/CppCodeGenerator.cs @@ -100,24 +100,24 @@ private class Utf8CharacterNode : BaseNode { public override int MemorySize => throw new NotImplementedException(); public override void GetUserInterfaceInfo(out string name, out Image icon) => throw new NotImplementedException(); - public override Size Draw(ViewInfo view, int x, int y) => throw new NotImplementedException(); - public override int CalculateDrawnHeight(ViewInfo view) => throw new NotImplementedException(); + public override Size Draw(DrawContext context, int x, int y) => throw new NotImplementedException(); + public override int CalculateDrawnHeight(DrawContext view) => throw new NotImplementedException(); } private class Utf16CharacterNode : BaseNode { public override int MemorySize => throw new NotImplementedException(); public override void GetUserInterfaceInfo(out string name, out Image icon) => throw new NotImplementedException(); - public override Size Draw(ViewInfo view, int x, int y) => throw new NotImplementedException(); - public override int CalculateDrawnHeight(ViewInfo view) => throw new NotImplementedException(); + public override Size Draw(DrawContext context, int x, int y) => throw new NotImplementedException(); + public override int CalculateDrawnHeight(DrawContext view) => throw new NotImplementedException(); } private class Utf32CharacterNode : BaseNode { public override int MemorySize => throw new NotImplementedException(); public override void GetUserInterfaceInfo(out string name, out Image icon) => throw new NotImplementedException(); - public override Size Draw(ViewInfo view, int x, int y) => throw new NotImplementedException(); - public override int CalculateDrawnHeight(ViewInfo view) => throw new NotImplementedException(); + public override Size Draw(DrawContext context, int x, int y) => throw new NotImplementedException(); + public override int CalculateDrawnHeight(DrawContext view) => throw new NotImplementedException(); } #endregion diff --git a/ReClass.NET/Controls/ViewInfo.cs b/ReClass.NET/Controls/DrawContext.cs similarity index 86% rename from ReClass.NET/Controls/ViewInfo.cs rename to ReClass.NET/Controls/DrawContext.cs index 84b5fb91..6d233780 100644 --- a/ReClass.NET/Controls/ViewInfo.cs +++ b/ReClass.NET/Controls/DrawContext.cs @@ -6,11 +6,11 @@ namespace ReClassNET.Controls { - public class ViewInfo + public class DrawContext { public Settings Settings { get; set; } - public Graphics Context { get; set; } + public Graphics Graphics { get; set; } public FontEx Font { get; set; } public IconProvider IconProvider { get; set; } @@ -25,12 +25,12 @@ public class ViewInfo public int Level { get; set; } public bool MultipleNodesSelected { get; set; } - public ViewInfo Clone() + public DrawContext Clone() { - return new ViewInfo + return new DrawContext { Settings = Settings, - Context = Context, + Graphics = Graphics, Font = Font, IconProvider = IconProvider, Process = Process, diff --git a/ReClass.NET/Controls/MemoryPreviewPopUp.cs b/ReClass.NET/Controls/MemoryPreviewPopUp.cs index 218e24de..982edfcb 100644 --- a/ReClass.NET/Controls/MemoryPreviewPopUp.cs +++ b/ReClass.NET/Controls/MemoryPreviewPopUp.cs @@ -23,7 +23,7 @@ private class MemoryPreviewPanel : Panel { private const int MinNodeCount = 10; - public ViewInfo ViewInfo { get; } + public DrawContext DrawContext { get; } private readonly List nodes; @@ -35,7 +35,7 @@ public MemoryPreviewPanel(FontEx font) nodes = new List(); - ViewInfo = new ViewInfo + DrawContext = new DrawContext { Font = font, @@ -75,7 +75,7 @@ BaseHexNode CreateNode(int index) nodes.RemoveRange(count, nodes.Count - count); } - ViewInfo.Memory.Size = nodes.Select(n => n.MemorySize).Sum(); + DrawContext.Memory.Size = nodes.Select(n => n.MemorySize).Sum(); } /// Changes the number of nodes with the provided delta. @@ -100,29 +100,29 @@ private void CalculateSize() { var size = new Size( ToolTipWidth, - nodes.Sum(n => n.CalculateDrawnHeight(ViewInfo)) + ToolTipPadding + nodes.Sum(n => n.CalculateDrawnHeight(DrawContext)) + ToolTipPadding ); - ViewInfo.ClientArea = new Rectangle(ToolTipPadding / 2, ToolTipPadding / 2, size.Width - ToolTipPadding, size.Height - ToolTipPadding); + DrawContext.ClientArea = new Rectangle(ToolTipPadding / 2, ToolTipPadding / 2, size.Width - ToolTipPadding, size.Height - ToolTipPadding); Size = MinimumSize = MaximumSize = size; } protected override void OnPaint(PaintEventArgs e) { - ViewInfo.HotSpots.Clear(); + DrawContext.HotSpots.Clear(); // Some settings are not usefull for the preview. - ViewInfo.Settings = Program.Settings.Clone(); - ViewInfo.Settings.ShowNodeAddress = false; + DrawContext.Settings = Program.Settings.Clone(); + DrawContext.Settings.ShowNodeAddress = false; - ViewInfo.Context = e.Graphics; + DrawContext.Graphics = e.Graphics; - using (var brush = new SolidBrush(ViewInfo.Settings.BackgroundColor)) + using (var brush = new SolidBrush(DrawContext.Settings.BackgroundColor)) { e.Graphics.FillRectangle(brush, ClientRectangle); } - using (var pen = new Pen(ViewInfo.Settings.BackgroundColor.Invert(), 1)) + using (var pen = new Pen(DrawContext.Settings.BackgroundColor.Invert(), 1)) { e.Graphics.DrawRectangle(pen, new Rectangle(Bounds.X, Bounds.Y, Bounds.Width - 1, Bounds.Height - 1)); } @@ -131,7 +131,7 @@ protected override void OnPaint(PaintEventArgs e) int y = 2; foreach (var node in nodes) { - y += node.Draw(ViewInfo, x, y).Height; + y += node.Draw(DrawContext, x, y).Height; } } } @@ -213,15 +213,15 @@ public void InitializeMemory(RemoteProcess process, IntPtr address) memoryAddress = address; - panel.ViewInfo.Process = process; + panel.DrawContext.Process = process; - panel.ViewInfo.Memory.UpdateFrom(process, address); + panel.DrawContext.Memory.UpdateFrom(process, address); } /// Updates the memory buffer to get current data. public void UpdateMemory() { - panel.ViewInfo.Memory.UpdateFrom(panel.ViewInfo.Process, memoryAddress); + panel.DrawContext.Memory.UpdateFrom(panel.DrawContext.Process, memoryAddress); panel.Invalidate(); } diff --git a/ReClass.NET/Controls/MemoryViewControl.cs b/ReClass.NET/Controls/MemoryViewControl.cs index 34d8741c..64b8dfa4 100644 --- a/ReClass.NET/Controls/MemoryViewControl.cs +++ b/ReClass.NET/Controls/MemoryViewControl.cs @@ -121,10 +121,10 @@ protected override void OnPaint(PaintEventArgs e) memoryPreviewPopUp.UpdateMemory(); } - var view = new ViewInfo + var view = new DrawContext { Settings = args.Settings, - Context = e.Graphics, + Graphics = e.Graphics, Font = font, IconProvider = args.IconProvider, Process = args.Process, diff --git a/ReClass.NET/DataExchange/ReClass/Legacy/BaseClassArrayNode.cs b/ReClass.NET/DataExchange/ReClass/Legacy/BaseClassArrayNode.cs index 563902f1..82006a0e 100644 --- a/ReClass.NET/DataExchange/ReClass/Legacy/BaseClassArrayNode.cs +++ b/ReClass.NET/DataExchange/ReClass/Legacy/BaseClassArrayNode.cs @@ -14,12 +14,12 @@ public override void GetUserInterfaceInfo(out string name, out Image icon) throw new NotImplementedException(); } - public override int CalculateDrawnHeight(ViewInfo view) + public override int CalculateDrawnHeight(DrawContext view) { throw new NotImplementedException(); } - public override Size Draw(ViewInfo view, int x, int y) + public override Size Draw(DrawContext context, int x, int y) { throw new NotImplementedException(); } diff --git a/ReClass.NET/DataExchange/ReClass/Legacy/ClassPointerNode.cs b/ReClass.NET/DataExchange/ReClass/Legacy/ClassPointerNode.cs index fc5de075..81588504 100644 --- a/ReClass.NET/DataExchange/ReClass/Legacy/ClassPointerNode.cs +++ b/ReClass.NET/DataExchange/ReClass/Legacy/ClassPointerNode.cs @@ -14,12 +14,12 @@ public override void GetUserInterfaceInfo(out string name, out Image icon) throw new NotImplementedException(); } - public override int CalculateDrawnHeight(ViewInfo view) + public override int CalculateDrawnHeight(DrawContext view) { throw new NotImplementedException(); } - public override Size Draw(ViewInfo view, int x, int y) + public override Size Draw(DrawContext context, int x, int y) { throw new NotImplementedException(); } diff --git a/ReClass.NET/DataExchange/ReClass/Legacy/CustomNode.cs b/ReClass.NET/DataExchange/ReClass/Legacy/CustomNode.cs index 53c6bd13..42c9bd05 100644 --- a/ReClass.NET/DataExchange/ReClass/Legacy/CustomNode.cs +++ b/ReClass.NET/DataExchange/ReClass/Legacy/CustomNode.cs @@ -15,12 +15,12 @@ public override void GetUserInterfaceInfo(out string name, out Image icon) throw new NotImplementedException(); } - public override int CalculateDrawnHeight(ViewInfo view) + public override int CalculateDrawnHeight(DrawContext view) { throw new NotImplementedException(); } - public override Size Draw(ViewInfo view, int x, int y) + public override Size Draw(DrawContext context, int x, int y) { throw new NotImplementedException(); } diff --git a/ReClass.NET/Nodes/ArrayNode.cs b/ReClass.NET/Nodes/ArrayNode.cs index 3f72e24a..6c30e194 100644 --- a/ReClass.NET/Nodes/ArrayNode.cs +++ b/ReClass.NET/Nodes/ArrayNode.cs @@ -22,12 +22,12 @@ public override void Initialize() ChangeInnerNode(IntPtr.Size == 4 ? (BaseNode)new Hex32Node() : new Hex64Node()); } - public override Size Draw(ViewInfo view, int x, int y) + public override Size Draw(DrawContext context, int x, int y) { - return Draw(view, x, y, "Array"); + return Draw(context, x, y, "Array"); } - protected override Size DrawChild(ViewInfo view, int x, int y) + protected override Size DrawChild(DrawContext view, int x, int y) { var v = view.Clone(); v.Address = view.Address + Offset + InnerNode.MemorySize * CurrentIndex; diff --git a/ReClass.NET/Nodes/BaseFunctionNode.cs b/ReClass.NET/Nodes/BaseFunctionNode.cs index cf28ecd7..8e143585 100644 --- a/ReClass.NET/Nodes/BaseFunctionNode.cs +++ b/ReClass.NET/Nodes/BaseFunctionNode.cs @@ -21,7 +21,7 @@ protected class FunctionNodeInstruction protected IntPtr Address = IntPtr.Zero; protected readonly List Instructions = new List(); - protected Size DrawInstructions(ViewInfo view, int tx, int y) + protected Size DrawInstructions(DrawContext view, int tx, int y) { Contract.Requires(view != null); @@ -38,12 +38,12 @@ protected Size DrawInstructions(ViewInfo view, int tx, int y) var x = AddText(view, tx, y, view.Settings.AddressColor, HotSpot.ReadOnlyId, instruction.Address) + 6; - view.Context.FillRectangle(brush, x, y, 1, view.Font.Height); + view.Graphics.FillRectangle(brush, x, y, 1, view.Font.Height); x += 6; x = Math.Max(AddText(view, x, y, view.Settings.HexColor, HotSpot.ReadOnlyId, instruction.Data) + 6, x + minWidth); - view.Context.FillRectangle(brush, x, y, 1, view.Font.Height); + view.Graphics.FillRectangle(brush, x, y, 1, view.Font.Height); x += 6; x = AddText(view, x, y, view.Settings.ValueColor, HotSpot.ReadOnlyId, instruction.Instruction); diff --git a/ReClass.NET/Nodes/BaseFunctionPtrNode.cs b/ReClass.NET/Nodes/BaseFunctionPtrNode.cs index 0a4d4a9f..577459f7 100644 --- a/ReClass.NET/Nodes/BaseFunctionPtrNode.cs +++ b/ReClass.NET/Nodes/BaseFunctionPtrNode.cs @@ -22,7 +22,7 @@ public override string GetToolTipText(HotSpot spot) return string.Join("\n", Instructions.Select(i => i.Instruction)); } - protected Size Draw(ViewInfo view, int x, int y, string type, string name) + protected Size Draw(DrawContext view, int x, int y, string type, string name) { Contract.Requires(view != null); Contract.Requires(type != null); @@ -92,7 +92,7 @@ protected Size Draw(ViewInfo view, int x, int y, string type, string name) return size; } - public override int CalculateDrawnHeight(ViewInfo view) + public override int CalculateDrawnHeight(DrawContext view) { if (IsHidden) { diff --git a/ReClass.NET/Nodes/BaseHexCommentNode.cs b/ReClass.NET/Nodes/BaseHexCommentNode.cs index d6515452..ca1421e1 100644 --- a/ReClass.NET/Nodes/BaseHexCommentNode.cs +++ b/ReClass.NET/Nodes/BaseHexCommentNode.cs @@ -10,7 +10,7 @@ namespace ReClassNET.Nodes { public abstract class BaseHexCommentNode : BaseHexNode { - protected int AddComment(ViewInfo view, int x, int y, float fvalue, IntPtr ivalue, UIntPtr uvalue) + protected int AddComment(DrawContext view, int x, int y, float fvalue, IntPtr ivalue, UIntPtr uvalue) { Contract.Requires(view != null); diff --git a/ReClass.NET/Nodes/BaseHexNode.cs b/ReClass.NET/Nodes/BaseHexNode.cs index cce27cab..f57dd68b 100644 --- a/ReClass.NET/Nodes/BaseHexNode.cs +++ b/ReClass.NET/Nodes/BaseHexNode.cs @@ -32,7 +32,7 @@ protected BaseHexNode() buffer = new byte[MemorySize]; } - protected Size Draw(ViewInfo view, int x, int y, string text, int length) + protected Size Draw(DrawContext view, int x, int y, string text, int length) { Contract.Requires(view != null); @@ -98,7 +98,7 @@ protected Size Draw(ViewInfo view, int x, int y, string text, int length) return new Size(x - origX, view.Font.Height); } - public override int CalculateDrawnHeight(ViewInfo view) + public override int CalculateDrawnHeight(DrawContext view) { return IsHidden && !IsWrapped ? HiddenHeight : view.Font.Height; } diff --git a/ReClass.NET/Nodes/BaseMatrixNode.cs b/ReClass.NET/Nodes/BaseMatrixNode.cs index 7a1927d0..ac964051 100644 --- a/ReClass.NET/Nodes/BaseMatrixNode.cs +++ b/ReClass.NET/Nodes/BaseMatrixNode.cs @@ -17,7 +17,7 @@ protected BaseMatrixNode() protected delegate void DrawMatrixValues(int x, ref int maxX, ref int y); - protected Size DrawMatrixType(ViewInfo view, int x, int y, string type, DrawMatrixValues drawValues) + protected Size DrawMatrixType(DrawContext view, int x, int y, string type, DrawMatrixValues drawValues) { Contract.Requires(view != null); Contract.Requires(type != null); @@ -65,7 +65,7 @@ protected Size DrawMatrixType(ViewInfo view, int x, int y, string type, DrawMatr } protected delegate void DrawVectorValues(ref int x, ref int y); - protected Size DrawVectorType(ViewInfo view, int x, int y, string type, DrawVectorValues drawValues) + protected Size DrawVectorType(DrawContext view, int x, int y, string type, DrawVectorValues drawValues) { Contract.Requires(view != null); Contract.Requires(type != null); @@ -110,7 +110,7 @@ protected Size DrawVectorType(ViewInfo view, int x, int y, string type, DrawVect return new Size(x - origX, y - origY + view.Font.Height); } - public override int CalculateDrawnHeight(ViewInfo view) + public override int CalculateDrawnHeight(DrawContext view) { if (IsHidden && !IsWrapped) { @@ -125,7 +125,7 @@ public override int CalculateDrawnHeight(ViewInfo view) return height; } - protected abstract int CalculateValuesHeight(ViewInfo view); + protected abstract int CalculateValuesHeight(DrawContext view); public void Update(HotSpot spot, int max) { diff --git a/ReClass.NET/Nodes/BaseNode.cs b/ReClass.NET/Nodes/BaseNode.cs index 953f2db9..41c1cd49 100644 --- a/ReClass.NET/Nodes/BaseNode.cs +++ b/ReClass.NET/Nodes/BaseNode.cs @@ -221,20 +221,20 @@ public virtual void ClearSelection() } /// Draws the node. - /// The view information. + /// The drawing context. /// The x coordinate. /// The y coordinate. /// The pixel size the node occupies. - public abstract Size Draw(ViewInfo view, int x, int y); + public abstract Size Draw(DrawContext context, int x, int y); /// /// Calculates the height of the node if drawn. /// This method is used to determine if a node outside the visible area should be drawn. - /// The returned height must be equal to the height which is returned by the method. + /// The returned height must be equal to the height which is returned by the method. /// - /// The view information. + /// The drawing context. /// The calculated height. - public abstract int CalculateDrawnHeight(ViewInfo view); + public abstract int CalculateDrawnHeight(DrawContext view); /// Updates the node from the given . Sets the and of the node. /// The spot. @@ -268,12 +268,12 @@ internal void SetLevelOpen(int level, bool open) } /// Adds a the user can interact with. - /// The view information. + /// The drawing context. /// The spot. /// The text to edit. /// The id of the spot. /// The type of the spot. - protected void AddHotSpot(ViewInfo view, Rectangle spot, string text, int id, HotSpotType type) + protected void AddHotSpot(DrawContext view, Rectangle spot, string text, int id, HotSpotType type) { Contract.Requires(view != null); Contract.Requires(view.Memory != null); @@ -299,17 +299,17 @@ protected void AddHotSpot(ViewInfo view, Rectangle spot, string text, int id, Ho } /// Draws the specific text and adds a if is not . - /// The view information. + /// The drawing context. /// The x coordinate. /// The y coordinate. /// The color of the text. /// Id for the clickable area. /// The text to draw. /// The new x coordinate after drawing the text. - protected int AddText(ViewInfo view, int x, int y, Color color, int hitId, string text) + protected int AddText(DrawContext view, int x, int y, Color color, int hitId, string text) { Contract.Requires(view != null); - Contract.Requires(view.Context != null); + Contract.Requires(view.Graphics != null); Contract.Requires(view.Font != null); Contract.Requires(text != null); @@ -323,10 +323,10 @@ protected int AddText(ViewInfo view, int x, int y, Color color, int hitId, strin AddHotSpot(view, rect, text, hitId, HotSpotType.Edit); } - view.Context.DrawStringEx(text, view.Font.Font, color, x, y); + view.Graphics.DrawStringEx(text, view.Font.Font, color, x, y); /*using (var brush = new SolidBrush(color)) { - view.Context.DrawString(text, view.Font.Font, brush, x, y); + context.Graphics.DrawString(text, context.Font.Font, brush, x, y); }*/ } @@ -334,14 +334,14 @@ protected int AddText(ViewInfo view, int x, int y, Color color, int hitId, strin } /// Draws the address and of the node. - /// The view information. + /// The drawing context. /// The x coordinate. /// The y coordinate. /// The new x coordinate after drawing the text. - protected int AddAddressOffset(ViewInfo view, int x, int y) + protected int AddAddressOffset(DrawContext view, int x, int y) { Contract.Requires(view != null); - Contract.Requires(view.Context != null); + Contract.Requires(view.Graphics != null); Contract.Requires(view.Font != null); if (view.Settings.ShowNodeOffset) @@ -358,14 +358,14 @@ protected int AddAddressOffset(ViewInfo view, int x, int y) } /// Draws a bar which indicates the selection status of the node. A for this area gets added too. - /// The view information. + /// The drawing context. /// The x coordinate. /// The y coordinate. /// The height of the bar. - protected void AddSelection(ViewInfo view, int x, int y, int height) + protected void AddSelection(DrawContext view, int x, int y, int height) { Contract.Requires(view != null); - Contract.Requires(view.Context != null); + Contract.Requires(view.Graphics != null); if (y > view.ClientArea.Bottom || y + height < 0 || IsWrapped) { @@ -376,29 +376,29 @@ protected void AddSelection(ViewInfo view, int x, int y, int height) { using var brush = new SolidBrush(view.Settings.SelectedColor); - view.Context.FillRectangle(brush, 0, y, view.ClientArea.Right, height); + view.Graphics.FillRectangle(brush, 0, y, view.ClientArea.Right, height); } AddHotSpot(view, new Rectangle(0, y, view.ClientArea.Right - (IsSelected ? 16 : 0), height), string.Empty, HotSpot.NoneId, HotSpotType.Select); } - protected int AddIconPadding(ViewInfo view, int x) + protected int AddIconPadding(DrawContext view, int x) { return x + view.IconProvider.Dimensions; } /// Draws an icon and adds a if is not . - /// The view information. + /// The drawing context. /// The x coordinate. /// The y coordinate. /// The icon. /// The id of the spot. /// The type of the spot. /// The new x coordinate after drawing the icon. - protected int AddIcon(ViewInfo view, int x, int y, Image icon, int id, HotSpotType type) + protected int AddIcon(DrawContext view, int x, int y, Image icon, int id, HotSpotType type) { Contract.Requires(view != null); - Contract.Requires(view.Context != null); + Contract.Requires(view.Graphics != null); Contract.Requires(icon != null); var size = view.IconProvider.Dimensions; @@ -408,7 +408,7 @@ protected int AddIcon(ViewInfo view, int x, int y, Image icon, int id, HotSpotTy return x + size; } - view.Context.DrawImage(icon, x + 2, y, size, size); + view.Graphics.DrawImage(icon, x + 2, y, size, size); if (id != HotSpot.NoneId) { @@ -419,14 +419,14 @@ protected int AddIcon(ViewInfo view, int x, int y, Image icon, int id, HotSpotTy } /// Adds a togglable Open/Close icon. - /// The view information. + /// The drawing context. /// The x coordinate. /// The y coordinate. /// The new x coordinate after drawing the icon. - protected int AddOpenCloseIcon(ViewInfo view, int x, int y) + protected int AddOpenCloseIcon(DrawContext view, int x, int y) { Contract.Requires(view != null); - Contract.Requires(view.Context != null); + Contract.Requires(view.Graphics != null); if (y > view.ClientArea.Bottom || y + view.IconProvider.Dimensions < 0) { @@ -438,12 +438,12 @@ protected int AddOpenCloseIcon(ViewInfo view, int x, int y) } /// Draws a context drop icon if the node is selected. - /// The view information. + /// The drawing context. /// The y coordinate. - protected void AddContextDropDownIcon(ViewInfo view, int y) + protected void AddContextDropDownIcon(DrawContext view, int y) { Contract.Requires(view != null); - Contract.Requires(view.Context != null); + Contract.Requires(view.Graphics != null); if (view.MultipleNodesSelected || y > view.ClientArea.Bottom || y + view.IconProvider.Dimensions < 0 || IsWrapped) { @@ -457,12 +457,12 @@ protected void AddContextDropDownIcon(ViewInfo view, int y) } /// Draws a delete icon if the node is selected. - /// The view information. + /// The drawing context. /// The y coordinate. - protected void AddDeleteIcon(ViewInfo view, int y) + protected void AddDeleteIcon(DrawContext view, int y) { Contract.Requires(view != null); - Contract.Requires(view.Context != null); + Contract.Requires(view.Graphics != null); if (y > view.ClientArea.Bottom || y + view.IconProvider.Dimensions < 0 || IsWrapped) { @@ -476,14 +476,14 @@ protected void AddDeleteIcon(ViewInfo view, int y) } /// Draws the . - /// The view information. + /// The drawing context. /// The x coordinate. /// The y coordinate. /// The new x coordinate after drawing the comment. - protected virtual int AddComment(ViewInfo view, int x, int y) + protected virtual int AddComment(DrawContext view, int x, int y) { Contract.Requires(view != null); - Contract.Requires(view.Context != null); + Contract.Requires(view.Graphics != null); Contract.Requires(view.Font != null); x = AddText(view, x, y, view.Settings.CommentColor, HotSpot.NoneId, "//"); @@ -493,27 +493,27 @@ protected virtual int AddComment(ViewInfo view, int x, int y) } /// Draws a vertical line to show the hidden state. - /// The view information. + /// The drawing context. /// The x coordinate. /// The y coordinate. /// The size of the drawing. - protected Size DrawHidden(ViewInfo view, int x, int y) + protected Size DrawHidden(DrawContext view, int x, int y) { Contract.Requires(view != null); - Contract.Requires(view.Context != null); + Contract.Requires(view.Graphics != null); using (var brush = new SolidBrush(IsSelected ? view.Settings.SelectedColor : view.Settings.HiddenColor)) { - view.Context.FillRectangle(brush, 0, y, view.ClientArea.Right, 1); + view.Graphics.FillRectangle(brush, 0, y, view.ClientArea.Right, 1); } return new Size(0, HiddenHeight); } /// Draws an error indicator if the used memory buffer is not valid. - /// The view information. + /// The drawing context. /// The y coordinate. - protected void DrawInvalidMemoryIndicatorIcon(ViewInfo view, int y) + protected void DrawInvalidMemoryIndicatorIcon(DrawContext view, int y) { if (!view.Memory.ContainsValidData) { @@ -535,14 +535,14 @@ public override int MemorySize } } - public override Size Draw(ViewInfo view, int x, int y) + public override Size Draw(DrawContext context, int x, int y) { - Contract.Requires(view != null); + Contract.Requires(context != null); throw new NotImplementedException(); } - public override int CalculateDrawnHeight(ViewInfo view) + public override int CalculateDrawnHeight(DrawContext view) { Contract.Requires(view != null); diff --git a/ReClass.NET/Nodes/BaseNumericNode.cs b/ReClass.NET/Nodes/BaseNumericNode.cs index c0a540fc..ae223dee 100644 --- a/ReClass.NET/Nodes/BaseNumericNode.cs +++ b/ReClass.NET/Nodes/BaseNumericNode.cs @@ -8,7 +8,7 @@ namespace ReClassNET.Nodes public abstract class BaseNumericNode : BaseNode { /// Draws the node. - /// The view information. + /// The drawing context. /// The x coordinate. /// The y coordinate. /// The icon of the node. @@ -16,7 +16,7 @@ public abstract class BaseNumericNode : BaseNode /// The value of the node. /// An alternative value of the node. /// The pixel size the node occupies. - protected Size DrawNumeric(ViewInfo view, int x, int y, Image icon, string type, string value, string alternativeValue) + protected Size DrawNumeric(DrawContext view, int x, int y, Image icon, string type, string value, string alternativeValue) { Contract.Requires(view != null); Contract.Requires(icon != null); @@ -58,7 +58,7 @@ protected Size DrawNumeric(ViewInfo view, int x, int y, Image icon, string type, return new Size(x - origX, view.Font.Height); } - public override int CalculateDrawnHeight(ViewInfo view) + public override int CalculateDrawnHeight(DrawContext view) { return IsHidden && !IsWrapped ? HiddenHeight : view.Font.Height; } diff --git a/ReClass.NET/Nodes/BaseTextNode.cs b/ReClass.NET/Nodes/BaseTextNode.cs index 70b52dda..213e0034 100644 --- a/ReClass.NET/Nodes/BaseTextNode.cs +++ b/ReClass.NET/Nodes/BaseTextNode.cs @@ -25,7 +25,7 @@ public override void CopyFromNode(BaseNode node) Length = node.MemorySize / CharacterSize; } - protected Size DrawText(ViewInfo view, int x, int y, string type) + protected Size DrawText(DrawContext view, int x, int y, string type) { Contract.Requires(view != null); Contract.Requires(type != null); @@ -69,7 +69,7 @@ protected Size DrawText(ViewInfo view, int x, int y, string type) return new Size(x - origX, view.Font.Height); } - public override int CalculateDrawnHeight(ViewInfo view) + public override int CalculateDrawnHeight(DrawContext view) { return IsHidden && !IsWrapped ? HiddenHeight : view.Font.Height; } diff --git a/ReClass.NET/Nodes/BaseTextPtrNode.cs b/ReClass.NET/Nodes/BaseTextPtrNode.cs index df0f6ee2..2afd4974 100644 --- a/ReClass.NET/Nodes/BaseTextPtrNode.cs +++ b/ReClass.NET/Nodes/BaseTextPtrNode.cs @@ -17,12 +17,12 @@ public abstract class BaseTextPtrNode : BaseNode public abstract Encoding Encoding { get; } /// Draws this node. - /// The view information. + /// The drawing context. /// The x coordinate. /// The y coordinate. /// The name of the type. /// The pixel size the node occupies. - public Size DrawText(ViewInfo view, int x, int y, string type) + public Size DrawText(DrawContext view, int x, int y, string type) { Contract.Requires(view != null); Contract.Requires(type != null); @@ -63,7 +63,7 @@ public Size DrawText(ViewInfo view, int x, int y, string type) return new Size(x - origX, view.Font.Height); } - public override int CalculateDrawnHeight(ViewInfo view) + public override int CalculateDrawnHeight(DrawContext view) { return IsHidden && !IsWrapped ? HiddenHeight : view.Font.Height; } diff --git a/ReClass.NET/Nodes/BaseWrapperArrayNode.cs b/ReClass.NET/Nodes/BaseWrapperArrayNode.cs index 6694ba6f..62ac318c 100644 --- a/ReClass.NET/Nodes/BaseWrapperArrayNode.cs +++ b/ReClass.NET/Nodes/BaseWrapperArrayNode.cs @@ -28,7 +28,7 @@ public override bool CanChangeInnerNodeTo(BaseNode node) return true; } - protected Size Draw(ViewInfo view, int x, int y, string type) + protected Size Draw(DrawContext view, int x, int y, string type) { if (IsHidden && !IsWrapped) { @@ -85,9 +85,9 @@ protected Size Draw(ViewInfo view, int x, int y, string type) return size; } - protected abstract Size DrawChild(ViewInfo view, int x, int y); + protected abstract Size DrawChild(DrawContext view, int x, int y); - public override int CalculateDrawnHeight(ViewInfo view) + public override int CalculateDrawnHeight(DrawContext view) { if (IsHidden && !IsWrapped) { diff --git a/ReClass.NET/Nodes/BitFieldNode.cs b/ReClass.NET/Nodes/BitFieldNode.cs index f12b4f0b..cf44700a 100644 --- a/ReClass.NET/Nodes/BitFieldNode.cs +++ b/ReClass.NET/Nodes/BitFieldNode.cs @@ -108,76 +108,76 @@ private string ConvertValueToBitString(MemoryBuffer memory) } } - public override Size Draw(ViewInfo view, int x, int y) + public override Size Draw(DrawContext context, int x, int y) { const int BitsPerBlock = 4; if (IsHidden && !IsWrapped) { - return DrawHidden(view, x, y); + return DrawHidden(context, x, y); } var origX = x; var origY = y; - AddSelection(view, x, y, view.Font.Height); + AddSelection(context, x, y, context.Font.Height); - x = AddIconPadding(view, x); - x = AddIconPadding(view, x); + x = AddIconPadding(context, x); + x = AddIconPadding(context, x); - x = AddAddressOffset(view, x, y); + x = AddAddressOffset(context, x, y); - x = AddText(view, x, y, view.Settings.TypeColor, HotSpot.NoneId, "Bits") + view.Font.Width; + x = AddText(context, x, y, context.Settings.TypeColor, HotSpot.NoneId, "Bits") + context.Font.Width; if (!IsWrapped) { - x = AddText(view, x, y, view.Settings.NameColor, HotSpot.NameId, Name) + view.Font.Width; + x = AddText(context, x, y, context.Settings.NameColor, HotSpot.NameId, Name) + context.Font.Width; } - x = AddOpenCloseIcon(view, x, y) + view.Font.Width; + x = AddOpenCloseIcon(context, x, y) + context.Font.Width; var tx = x - 3; for (var i = 0; i < bits; ++i) { - var rect = new Rectangle(x + (i + i / BitsPerBlock) * view.Font.Width, y, view.Font.Width, view.Font.Height); - AddHotSpot(view, rect, string.Empty, i, HotSpotType.Edit); + var rect = new Rectangle(x + (i + i / BitsPerBlock) * context.Font.Width, y, context.Font.Width, context.Font.Height); + AddHotSpot(context, rect, string.Empty, i, HotSpotType.Edit); } - var value = ConvertValueToBitString(view.Memory); + var value = ConvertValueToBitString(context.Memory); - x = AddText(view, x, y, view.Settings.ValueColor, HotSpot.NoneId, value) + view.Font.Width; + x = AddText(context, x, y, context.Settings.ValueColor, HotSpot.NoneId, value) + context.Font.Width; - x += view.Font.Width; + x += context.Font.Width; - x = AddComment(view, x, y); + x = AddComment(context, x, y); - DrawInvalidMemoryIndicatorIcon(view, y); - AddContextDropDownIcon(view, y); - AddDeleteIcon(view, y); + DrawInvalidMemoryIndicatorIcon(context, y); + AddContextDropDownIcon(context, y); + AddDeleteIcon(context, y); - if (LevelsOpen[view.Level]) + if (LevelsOpen[context.Level]) { - y += view.Font.Height; + y += context.Font.Height; var format = new StringFormat(StringFormatFlags.DirectionVertical); - using (var brush = new SolidBrush(view.Settings.ValueColor)) + using (var brush = new SolidBrush(context.Settings.ValueColor)) { var maxCharCount = bits + (bits / 4 - 1) - 1; for (int bitCount = 0, padding = 0; bitCount < bits; bitCount += 4, padding += 5) { - view.Context.DrawString(bitCount.ToString(), view.Font.Font, brush, tx + (maxCharCount - padding) * view.Font.Width, y, format); + context.Graphics.DrawString(bitCount.ToString(), context.Font.Font, brush, tx + (maxCharCount - padding) * context.Font.Width, y, format); } } y += 2; } - return new Size(x - origX, y - origY + view.Font.Height); + return new Size(x - origX, y - origY + context.Font.Height); } - public override int CalculateDrawnHeight(ViewInfo view) + public override int CalculateDrawnHeight(DrawContext view) { if (IsHidden && !IsWrapped) { diff --git a/ReClass.NET/Nodes/BoolNode.cs b/ReClass.NET/Nodes/BoolNode.cs index e448b8f4..44e17e0a 100644 --- a/ReClass.NET/Nodes/BoolNode.cs +++ b/ReClass.NET/Nodes/BoolNode.cs @@ -14,42 +14,42 @@ public override void GetUserInterfaceInfo(out string name, out Image icon) icon = Properties.Resources.B16x16_Button_Bool; } - public override Size Draw(ViewInfo view, int x, int y) + public override Size Draw(DrawContext context, int x, int y) { if (IsHidden && !IsWrapped) { - return DrawHidden(view, x, y); + return DrawHidden(context, x, y); } var origX = x; - AddSelection(view, x, y, view.Font.Height); + AddSelection(context, x, y, context.Font.Height); - x = AddIconPadding(view, x); - x = AddIconPadding(view, x); + x = AddIconPadding(context, x); + x = AddIconPadding(context, x); - x = AddAddressOffset(view, x, y); + x = AddAddressOffset(context, x, y); - x = AddText(view, x, y, view.Settings.TypeColor, HotSpot.NoneId, "Bool") + view.Font.Width; + x = AddText(context, x, y, context.Settings.TypeColor, HotSpot.NoneId, "Bool") + context.Font.Width; if (!IsWrapped) { - x = AddText(view, x, y, view.Settings.NameColor, HotSpot.NameId, Name) + view.Font.Width; + x = AddText(context, x, y, context.Settings.NameColor, HotSpot.NameId, Name) + context.Font.Width; } - x = AddText(view, x, y, view.Settings.NameColor, HotSpot.NoneId, "=") + view.Font.Width; + x = AddText(context, x, y, context.Settings.NameColor, HotSpot.NoneId, "=") + context.Font.Width; - var value = view.Memory.ReadUInt8(Offset); - x = AddText(view, x, y, view.Settings.ValueColor, 0, value == 0 ? "false" : "true") + view.Font.Width; + var value = context.Memory.ReadUInt8(Offset); + x = AddText(context, x, y, context.Settings.ValueColor, 0, value == 0 ? "false" : "true") + context.Font.Width; - x = AddComment(view, x, y); + x = AddComment(context, x, y); - DrawInvalidMemoryIndicatorIcon(view, y); - AddContextDropDownIcon(view, y); - AddDeleteIcon(view, y); + DrawInvalidMemoryIndicatorIcon(context, y); + AddContextDropDownIcon(context, y); + AddDeleteIcon(context, y); - return new Size(x - origX, view.Font.Height); + return new Size(x - origX, context.Font.Height); } - public override int CalculateDrawnHeight(ViewInfo view) + public override int CalculateDrawnHeight(DrawContext view) { return IsHidden && !IsWrapped ? HiddenHeight : view.Font.Height; } diff --git a/ReClass.NET/Nodes/ClassInstanceNode.cs b/ReClass.NET/Nodes/ClassInstanceNode.cs index a6395c6b..d18646a8 100644 --- a/ReClass.NET/Nodes/ClassInstanceNode.cs +++ b/ReClass.NET/Nodes/ClassInstanceNode.cs @@ -17,47 +17,47 @@ public override void GetUserInterfaceInfo(out string name, out Image icon) icon = Properties.Resources.B16x16_Button_Class_Instance; } - public override Size Draw(ViewInfo view, int x, int y) + public override Size Draw(DrawContext context, int x, int y) { if (IsHidden && !IsWrapped) { - return DrawHidden(view, x, y); + return DrawHidden(context, x, y); } var origX = x; var origY = y; - AddSelection(view, x, y, view.Font.Height); + AddSelection(context, x, y, context.Font.Height); - x = AddOpenCloseIcon(view, x, y); - x = AddIcon(view, x, y, view.IconProvider.Class, HotSpot.NoneId, HotSpotType.None); + x = AddOpenCloseIcon(context, x, y); + x = AddIcon(context, x, y, context.IconProvider.Class, HotSpot.NoneId, HotSpotType.None); var tx = x; - x = AddAddressOffset(view, x, y); + x = AddAddressOffset(context, x, y); - x = AddText(view, x, y, view.Settings.TypeColor, HotSpot.NoneId, "Instance") + view.Font.Width; + x = AddText(context, x, y, context.Settings.TypeColor, HotSpot.NoneId, "Instance") + context.Font.Width; if (!IsWrapped) { - x = AddText(view, x, y, view.Settings.NameColor, HotSpot.NameId, Name) + view.Font.Width; + x = AddText(context, x, y, context.Settings.NameColor, HotSpot.NameId, Name) + context.Font.Width; } - x = AddText(view, x, y, view.Settings.ValueColor, HotSpot.NoneId, $"<{InnerNode.Name}>") + view.Font.Width; - x = AddIcon(view, x, y, view.IconProvider.Change, 4, HotSpotType.ChangeClassType) + view.Font.Width; + x = AddText(context, x, y, context.Settings.ValueColor, HotSpot.NoneId, $"<{InnerNode.Name}>") + context.Font.Width; + x = AddIcon(context, x, y, context.IconProvider.Change, 4, HotSpotType.ChangeClassType) + context.Font.Width; - x = AddComment(view, x, y); + x = AddComment(context, x, y); - DrawInvalidMemoryIndicatorIcon(view, y); - AddContextDropDownIcon(view, y); - AddDeleteIcon(view, y); + DrawInvalidMemoryIndicatorIcon(context, y); + AddContextDropDownIcon(context, y); + AddDeleteIcon(context, y); - y += view.Font.Height; + y += context.Font.Height; var size = new Size(x - origX, y - origY); - if (LevelsOpen[view.Level]) + if (LevelsOpen[context.Level]) { - var v = view.Clone(); - v.Address = view.Address + Offset; - v.Memory = view.Memory.Clone(); + var v = context.Clone(); + v.Address = context.Address + Offset; + v.Memory = context.Memory.Clone(); v.Memory.Offset += Offset; var innerSize = InnerNode.Draw(v, tx, y); @@ -68,7 +68,7 @@ public override Size Draw(ViewInfo view, int x, int y) return size; } - public override int CalculateDrawnHeight(ViewInfo view) + public override int CalculateDrawnHeight(DrawContext view) { if (IsHidden && !IsWrapped) { diff --git a/ReClass.NET/Nodes/ClassNode.cs b/ReClass.NET/Nodes/ClassNode.cs index 3c4897a3..65544d1c 100644 --- a/ReClass.NET/Nodes/ClassNode.cs +++ b/ReClass.NET/Nodes/ClassNode.cs @@ -85,34 +85,34 @@ public override void Initialize() AddBytes(IntPtr.Size); } - public override Size Draw(ViewInfo view, int x, int y) + public override Size Draw(DrawContext context, int x, int y) { - AddSelection(view, 0, y, view.Font.Height); + AddSelection(context, 0, y, context.Font.Height); var origX = x; var origY = y; - x = AddOpenCloseIcon(view, x, y); + x = AddOpenCloseIcon(context, x, y); var tx = x; - x = AddIcon(view, x, y, view.IconProvider.Class, HotSpot.NoneId, HotSpotType.None); - x = AddText(view, x, y, view.Settings.OffsetColor, 0, AddressFormula) + view.Font.Width; + x = AddIcon(context, x, y, context.IconProvider.Class, HotSpot.NoneId, HotSpotType.None); + x = AddText(context, x, y, context.Settings.OffsetColor, 0, AddressFormula) + context.Font.Width; - x = AddText(view, x, y, view.Settings.TypeColor, HotSpot.NoneId, "Class") + view.Font.Width; - x = AddText(view, x, y, view.Settings.NameColor, HotSpot.NameId, Name) + view.Font.Width; - x = AddText(view, x, y, view.Settings.ValueColor, HotSpot.NoneId, $"[{MemorySize}]") + view.Font.Width; - x = AddComment(view, x, y); + x = AddText(context, x, y, context.Settings.TypeColor, HotSpot.NoneId, "Class") + context.Font.Width; + x = AddText(context, x, y, context.Settings.NameColor, HotSpot.NameId, Name) + context.Font.Width; + x = AddText(context, x, y, context.Settings.ValueColor, HotSpot.NoneId, $"[{MemorySize}]") + context.Font.Width; + x = AddComment(context, x, y); - y += view.Font.Height; + y += context.Font.Height; var size = new Size(x - origX, y - origY); - if (LevelsOpen[view.Level]) + if (LevelsOpen[context.Level]) { var childOffset = tx - origX; - var nv = view.Clone(); + var nv = context.Clone(); nv.Level++; foreach (var node in Nodes) { @@ -127,7 +127,7 @@ Size ExtendWidth(Size baseSize, int width) } // Draw the node if it is in the visible area. - if (view.ClientArea.Contains(tx, y)) + if (context.ClientArea.Contains(tx, y)) { var innerSize = node.Draw(nv, tx, y); @@ -141,7 +141,7 @@ Size ExtendWidth(Size baseSize, int width) var calculatedHeight = node.CalculateDrawnHeight(nv); // and check if the node area overlaps with the visible area... - if (new Rectangle(tx, y, 9999999, calculatedHeight).IntersectsWith(view.ClientArea)) + if (new Rectangle(tx, y, 9999999, calculatedHeight).IntersectsWith(context.ClientArea)) { // then draw the node... var innerSize = node.Draw(nv, tx, y); @@ -164,7 +164,7 @@ Size ExtendWidth(Size baseSize, int width) return size; } - public override int CalculateDrawnHeight(ViewInfo view) + public override int CalculateDrawnHeight(DrawContext view) { if (IsHidden) { diff --git a/ReClass.NET/Nodes/DoubleNode.cs b/ReClass.NET/Nodes/DoubleNode.cs index f37e4c08..c7de5fee 100644 --- a/ReClass.NET/Nodes/DoubleNode.cs +++ b/ReClass.NET/Nodes/DoubleNode.cs @@ -15,9 +15,9 @@ public override void GetUserInterfaceInfo(out string name, out Image icon) icon = Properties.Resources.B16x16_Button_Double; } - public override Size Draw(ViewInfo view, int x, int y) + public override Size Draw(DrawContext context, int x, int y) { - return DrawNumeric(view, x, y, view.IconProvider.Double, "Double", ReadValueFromMemory(view.Memory).ToString("0.000"), null); + return DrawNumeric(context, x, y, context.IconProvider.Double, "Double", ReadValueFromMemory(context.Memory).ToString("0.000"), null); } public override void Update(HotSpot spot) diff --git a/ReClass.NET/Nodes/EnumNode.cs b/ReClass.NET/Nodes/EnumNode.cs index cc6f25df..411cd002 100644 --- a/ReClass.NET/Nodes/EnumNode.cs +++ b/ReClass.NET/Nodes/EnumNode.cs @@ -135,47 +135,47 @@ private string GetFlagsStringRepresentation(MemoryBuffer memory) return retval.ToString(); } - public override Size Draw(ViewInfo view, int x, int y) + public override Size Draw(DrawContext context, int x, int y) { if (IsHidden && !IsWrapped) { - return DrawHidden(view, x, y); + return DrawHidden(context, x, y); } var origX = x; - AddSelection(view, x, y, view.Font.Height); + AddSelection(context, x, y, context.Font.Height); - x = AddIconPadding(view, x); + x = AddIconPadding(context, x); - x = AddIcon(view, x, y, view.IconProvider.Enum, HotSpot.NoneId, HotSpotType.None); + x = AddIcon(context, x, y, context.IconProvider.Enum, HotSpot.NoneId, HotSpotType.None); - x = AddAddressOffset(view, x, y); + x = AddAddressOffset(context, x, y); - x = AddText(view, x, y, view.Settings.TypeColor, HotSpot.NoneId, "Enum") + view.Font.Width; + x = AddText(context, x, y, context.Settings.TypeColor, HotSpot.NoneId, "Enum") + context.Font.Width; if (!IsWrapped) { - x = AddText(view, x, y, view.Settings.NameColor, HotSpot.NameId, Name) + view.Font.Width; + x = AddText(context, x, y, context.Settings.NameColor, HotSpot.NameId, Name) + context.Font.Width; } - x = AddText(view, x, y, view.Settings.ValueColor, HotSpot.NoneId, $"<{Enum.Name}>") + view.Font.Width; - x = AddIcon(view, x, y, view.IconProvider.Change, 4, HotSpotType.ChangeEnumType) + view.Font.Width; + x = AddText(context, x, y, context.Settings.ValueColor, HotSpot.NoneId, $"<{Enum.Name}>") + context.Font.Width; + x = AddIcon(context, x, y, context.IconProvider.Change, 4, HotSpotType.ChangeEnumType) + context.Font.Width; - x = AddText(view, x, y, view.Settings.TextColor, HotSpot.NoneId, "=") + view.Font.Width; + x = AddText(context, x, y, context.Settings.TextColor, HotSpot.NoneId, "=") + context.Font.Width; - var text = GetTextRepresentation(view.Memory); + var text = GetTextRepresentation(context.Memory); - x = AddText(view, x, y, view.Settings.TextColor, HotSpot.NoneId, text) + view.Font.Width; + x = AddText(context, x, y, context.Settings.TextColor, HotSpot.NoneId, text) + context.Font.Width; - x = AddComment(view, x, y); + x = AddComment(context, x, y); - DrawInvalidMemoryIndicatorIcon(view, y); - AddContextDropDownIcon(view, y); - AddDeleteIcon(view, y); + DrawInvalidMemoryIndicatorIcon(context, y); + AddContextDropDownIcon(context, y); + AddDeleteIcon(context, y); - return new Size(x - origX, view.Font.Height); + return new Size(x - origX, context.Font.Height); } - public override int CalculateDrawnHeight(ViewInfo view) + public override int CalculateDrawnHeight(DrawContext view) { return IsHidden && !IsWrapped ? HiddenHeight : view.Font.Height; } diff --git a/ReClass.NET/Nodes/FloatNode.cs b/ReClass.NET/Nodes/FloatNode.cs index 73e47e7a..4b51c51f 100644 --- a/ReClass.NET/Nodes/FloatNode.cs +++ b/ReClass.NET/Nodes/FloatNode.cs @@ -15,9 +15,9 @@ public override void GetUserInterfaceInfo(out string name, out Image icon) icon = Properties.Resources.B16x16_Button_Float; } - public override Size Draw(ViewInfo view, int x, int y) + public override Size Draw(DrawContext context, int x, int y) { - return DrawNumeric(view, x, y, view.IconProvider.Float, "Float", ReadValueFromMemory(view.Memory).ToString("0.000"), null); + return DrawNumeric(context, x, y, context.IconProvider.Float, "Float", ReadValueFromMemory(context.Memory).ToString("0.000"), null); } public override void Update(HotSpot spot) diff --git a/ReClass.NET/Nodes/FunctionNode.cs b/ReClass.NET/Nodes/FunctionNode.cs index 75dd6d2b..30dfd5bd 100644 --- a/ReClass.NET/Nodes/FunctionNode.cs +++ b/ReClass.NET/Nodes/FunctionNode.cs @@ -31,62 +31,62 @@ public override string GetToolTipText(HotSpot spot) return string.Join("\n", Instructions.Select(i => i.Instruction)); } - public override Size Draw(ViewInfo view, int x, int y) + public override Size Draw(DrawContext context, int x, int y) { - Contract.Requires(view != null); + Contract.Requires(context != null); if (IsHidden && !IsWrapped) { - return DrawHidden(view, x, y); + return DrawHidden(context, x, y); } var origX = x; - AddSelection(view, x, y, view.Font.Height); + AddSelection(context, x, y, context.Font.Height); - x = AddIconPadding(view, x); + x = AddIconPadding(context, x); - x = AddIcon(view, x, y, view.IconProvider.Function, HotSpot.NoneId, HotSpotType.None); + x = AddIcon(context, x, y, context.IconProvider.Function, HotSpot.NoneId, HotSpotType.None); var tx = x; - x = AddAddressOffset(view, x, y); + x = AddAddressOffset(context, x, y); - x = AddText(view, x, y, view.Settings.TypeColor, HotSpot.NoneId, "Function") + view.Font.Width; + x = AddText(context, x, y, context.Settings.TypeColor, HotSpot.NoneId, "Function") + context.Font.Width; if (!IsWrapped) { - x = AddText(view, x, y, view.Settings.NameColor, HotSpot.NameId, Name) + view.Font.Width; + x = AddText(context, x, y, context.Settings.NameColor, HotSpot.NameId, Name) + context.Font.Width; } - x = AddOpenCloseIcon(view, x, y) + view.Font.Width; + x = AddOpenCloseIcon(context, x, y) + context.Font.Width; - x = AddComment(view, x, y); + x = AddComment(context, x, y); - DrawInvalidMemoryIndicatorIcon(view, y); - AddContextDropDownIcon(view, y); - AddDeleteIcon(view, y); + DrawInvalidMemoryIndicatorIcon(context, y); + AddContextDropDownIcon(context, y); + AddDeleteIcon(context, y); - var size = new Size(x - origX, view.Font.Height); + var size = new Size(x - origX, context.Font.Height); - var ptr = view.Address + Offset; - DisassembleRemoteCode(view.Process, ptr); + var ptr = context.Address + Offset; + DisassembleRemoteCode(context.Process, ptr); - if (LevelsOpen[view.Level]) + if (LevelsOpen[context.Level]) { - y += view.Font.Height; - x = AddText(view, tx, y, view.Settings.TypeColor, HotSpot.NoneId, "Signature:") + view.Font.Width; - x = AddText(view, x, y, view.Settings.ValueColor, 0, Signature); + y += context.Font.Height; + x = AddText(context, tx, y, context.Settings.TypeColor, HotSpot.NoneId, "Signature:") + context.Font.Width; + x = AddText(context, x, y, context.Settings.ValueColor, 0, Signature); size.Width = Math.Max(size.Width, x - origX); - size.Height += view.Font.Height; + size.Height += context.Font.Height; - y += view.Font.Height; - x = AddText(view, tx, y, view.Settings.TextColor, HotSpot.NoneId, "Belongs to: "); - x = AddText(view, x, y, view.Settings.ValueColor, HotSpot.NoneId, BelongsToClass == null ? "" : $"<{BelongsToClass.Name}>") + view.Font.Width; - x = AddIcon(view, x, y, view.IconProvider.Change, 1, HotSpotType.ChangeClassType); + y += context.Font.Height; + x = AddText(context, tx, y, context.Settings.TextColor, HotSpot.NoneId, "Belongs to: "); + x = AddText(context, x, y, context.Settings.ValueColor, HotSpot.NoneId, BelongsToClass == null ? "" : $"<{BelongsToClass.Name}>") + context.Font.Width; + x = AddIcon(context, x, y, context.IconProvider.Change, 1, HotSpotType.ChangeClassType); size.Width = Math.Max(size.Width, x - origX); - size.Height += view.Font.Height; + size.Height += context.Font.Height; - var instructionSize = DrawInstructions(view, tx, y + 4); + var instructionSize = DrawInstructions(context, tx, y + 4); size.Width = Math.Max(size.Width, instructionSize.Width + tx - origX); size.Height += instructionSize.Height + 4; } @@ -94,7 +94,7 @@ public override Size Draw(ViewInfo view, int x, int y) return size; } - public override int CalculateDrawnHeight(ViewInfo view) + public override int CalculateDrawnHeight(DrawContext view) { if (IsHidden && !IsWrapped) { diff --git a/ReClass.NET/Nodes/FunctionPtrNode.cs b/ReClass.NET/Nodes/FunctionPtrNode.cs index 74a8042c..6b7d28e7 100644 --- a/ReClass.NET/Nodes/FunctionPtrNode.cs +++ b/ReClass.NET/Nodes/FunctionPtrNode.cs @@ -11,9 +11,9 @@ public override void GetUserInterfaceInfo(out string name, out Image icon) icon = Properties.Resources.B16x16_Button_Function_Pointer; } - public override Size Draw(ViewInfo view, int x, int y) + public override Size Draw(DrawContext context, int x, int y) { - return Draw(view, x, y, "FunctionPtr", Name); + return Draw(context, x, y, "FunctionPtr", Name); } } } diff --git a/ReClass.NET/Nodes/Hex16Node.cs b/ReClass.NET/Nodes/Hex16Node.cs index 1c4c0165..c567bda6 100644 --- a/ReClass.NET/Nodes/Hex16Node.cs +++ b/ReClass.NET/Nodes/Hex16Node.cs @@ -22,9 +22,9 @@ public override string GetToolTipText(HotSpot spot) return $"Int16: {value.ShortValue}\nUInt16: 0x{value.UShortValue:X04}"; } - public override Size Draw(ViewInfo view, int x, int y) + public override Size Draw(DrawContext context, int x, int y) { - return Draw(view, x, y, view.Settings.ShowNodeText ? view.Memory.ReadString(view.Settings.RawDataEncoding, Offset, 2) + " " : null, 2); + return Draw(context, x, y, context.Settings.ShowNodeText ? context.Memory.ReadString(context.Settings.RawDataEncoding, Offset, 2) + " " : null, 2); } public override void Update(HotSpot spot) diff --git a/ReClass.NET/Nodes/Hex32Node.cs b/ReClass.NET/Nodes/Hex32Node.cs index 5dc57825..75ebed62 100644 --- a/ReClass.NET/Nodes/Hex32Node.cs +++ b/ReClass.NET/Nodes/Hex32Node.cs @@ -32,9 +32,9 @@ public override string GetToolTipText(HotSpot spot) return $"Int32: {value.IntValue}\nUInt32: 0x{value.UIntValue:X08}\nFloat: {value.FloatValue:0.000}"; } - public override Size Draw(ViewInfo view, int x, int y) + public override Size Draw(DrawContext context, int x, int y) { - return Draw(view, x, y, view.Settings.ShowNodeText ? view.Memory.ReadString(view.Settings.RawDataEncoding, Offset, 4) + " " : null, 4); + return Draw(context, x, y, context.Settings.ShowNodeText ? context.Memory.ReadString(context.Settings.RawDataEncoding, Offset, 4) + " " : null, 4); } public override void Update(HotSpot spot) @@ -42,7 +42,7 @@ public override void Update(HotSpot spot) Update(spot, 4); } - protected override int AddComment(ViewInfo view, int x, int y) + protected override int AddComment(DrawContext view, int x, int y) { x = base.AddComment(view, x, y); diff --git a/ReClass.NET/Nodes/Hex64Node.cs b/ReClass.NET/Nodes/Hex64Node.cs index 9ba992d8..093bcdfb 100644 --- a/ReClass.NET/Nodes/Hex64Node.cs +++ b/ReClass.NET/Nodes/Hex64Node.cs @@ -32,9 +32,9 @@ public override string GetToolTipText(HotSpot spot) return $"Int64: {value.LongValue}\nUInt64: 0x{value.ULongValue:X016}\nFloat: {value.FloatValue:0.000}\nDouble: {value.DoubleValue:0.000}"; } - public override Size Draw(ViewInfo view, int x, int y) + public override Size Draw(DrawContext context, int x, int y) { - return Draw(view, x, y, view.Settings.ShowNodeText ? view.Memory.ReadString(view.Settings.RawDataEncoding, Offset, 8) + " " : null, 8); + return Draw(context, x, y, context.Settings.ShowNodeText ? context.Memory.ReadString(context.Settings.RawDataEncoding, Offset, 8) + " " : null, 8); } public override void Update(HotSpot spot) @@ -42,7 +42,7 @@ public override void Update(HotSpot spot) Update(spot, 8); } - protected override int AddComment(ViewInfo view, int x, int y) + protected override int AddComment(DrawContext view, int x, int y) { x = base.AddComment(view, x, y); diff --git a/ReClass.NET/Nodes/Hex8Node.cs b/ReClass.NET/Nodes/Hex8Node.cs index bac7c22b..7c29884e 100644 --- a/ReClass.NET/Nodes/Hex8Node.cs +++ b/ReClass.NET/Nodes/Hex8Node.cs @@ -21,9 +21,9 @@ public override string GetToolTipText(HotSpot spot) return $"Int8: {(int)b}\nUInt8: 0x{b:X02}"; } - public override Size Draw(ViewInfo view, int x, int y) + public override Size Draw(DrawContext context, int x, int y) { - return Draw(view, x, y, view.Settings.ShowNodeText ? view.Memory.ReadString(view.Settings.RawDataEncoding, Offset, 1) + " " : null, 1); + return Draw(context, x, y, context.Settings.ShowNodeText ? context.Memory.ReadString(context.Settings.RawDataEncoding, Offset, 1) + " " : null, 1); } public override void Update(HotSpot spot) diff --git a/ReClass.NET/Nodes/Int16Node.cs b/ReClass.NET/Nodes/Int16Node.cs index cba270a4..e67b2145 100644 --- a/ReClass.NET/Nodes/Int16Node.cs +++ b/ReClass.NET/Nodes/Int16Node.cs @@ -17,10 +17,10 @@ public override void GetUserInterfaceInfo(out string name, out Image icon) icon = Properties.Resources.B16x16_Button_Int_16; } - public override Size Draw(ViewInfo view, int x, int y) + public override Size Draw(DrawContext context, int x, int y) { - var value = ReadValueFromMemory(view.Memory); - return DrawNumeric(view, x, y, view.IconProvider.Signed, "Int16", value.ToString(), $"0x{value:X}"); + var value = ReadValueFromMemory(context.Memory); + return DrawNumeric(context, x, y, context.IconProvider.Signed, "Int16", value.ToString(), $"0x{value:X}"); } public override void Update(HotSpot spot) diff --git a/ReClass.NET/Nodes/Int32Node.cs b/ReClass.NET/Nodes/Int32Node.cs index 28518e87..5ba2090e 100644 --- a/ReClass.NET/Nodes/Int32Node.cs +++ b/ReClass.NET/Nodes/Int32Node.cs @@ -17,10 +17,10 @@ public override void GetUserInterfaceInfo(out string name, out Image icon) icon = Properties.Resources.B16x16_Button_Int_32; } - public override Size Draw(ViewInfo view, int x, int y) + public override Size Draw(DrawContext context, int x, int y) { - var value = ReadValueFromMemory(view.Memory); - return DrawNumeric(view, x, y, view.IconProvider.Signed, "Int32", value.ToString(), $"0x{value:X}"); + var value = ReadValueFromMemory(context.Memory); + return DrawNumeric(context, x, y, context.IconProvider.Signed, "Int32", value.ToString(), $"0x{value:X}"); } public override void Update(HotSpot spot) diff --git a/ReClass.NET/Nodes/Int64Node.cs b/ReClass.NET/Nodes/Int64Node.cs index 3cb9e8a5..935e4569 100644 --- a/ReClass.NET/Nodes/Int64Node.cs +++ b/ReClass.NET/Nodes/Int64Node.cs @@ -17,10 +17,10 @@ public override void GetUserInterfaceInfo(out string name, out Image icon) icon = Properties.Resources.B16x16_Button_Int_64; } - public override Size Draw(ViewInfo view, int x, int y) + public override Size Draw(DrawContext context, int x, int y) { - var value = ReadValueFromMemory(view.Memory); - return DrawNumeric(view, x, y, view.IconProvider.Signed, "Int64", value.ToString(), $"0x{value:X}"); + var value = ReadValueFromMemory(context.Memory); + return DrawNumeric(context, x, y, context.IconProvider.Signed, "Int64", value.ToString(), $"0x{value:X}"); } public override void Update(HotSpot spot) diff --git a/ReClass.NET/Nodes/Int8Node.cs b/ReClass.NET/Nodes/Int8Node.cs index 4690a69b..fbfe4038 100644 --- a/ReClass.NET/Nodes/Int8Node.cs +++ b/ReClass.NET/Nodes/Int8Node.cs @@ -17,10 +17,10 @@ public override void GetUserInterfaceInfo(out string name, out Image icon) icon = Properties.Resources.B16x16_Button_Int_8; } - public override Size Draw(ViewInfo view, int x, int y) + public override Size Draw(DrawContext context, int x, int y) { - var value = ReadValueFromMemory(view.Memory); - return DrawNumeric(view, x, y, view.IconProvider.Signed, "Int8", value.ToString(), $"0x{value:X}"); + var value = ReadValueFromMemory(context.Memory); + return DrawNumeric(context, x, y, context.IconProvider.Signed, "Int8", value.ToString(), $"0x{value:X}"); } public override void Update(HotSpot spot) diff --git a/ReClass.NET/Nodes/Matrix3x3Node.cs b/ReClass.NET/Nodes/Matrix3x3Node.cs index 0fbb8eea..c0de02d8 100644 --- a/ReClass.NET/Nodes/Matrix3x3Node.cs +++ b/ReClass.NET/Nodes/Matrix3x3Node.cs @@ -41,48 +41,48 @@ public override void GetUserInterfaceInfo(out string name, out Image icon) icon = Properties.Resources.B16x16_Button_Matrix_3x3; } - public override Size Draw(ViewInfo view, int x2, int y2) + public override Size Draw(DrawContext context, int x2, int y2) { - return DrawMatrixType(view, x2, y2, "Matrix (3x3)", (int defaultX, ref int maxX, ref int y) => + return DrawMatrixType(context, x2, y2, "Matrix (3x3)", (int defaultX, ref int maxX, ref int y) => { - var value = view.Memory.ReadObject(Offset); + var value = context.Memory.ReadObject(Offset); - y += view.Font.Height; + y += context.Font.Height; var x = defaultX; - x = AddText(view, x, y, view.Settings.NameColor, HotSpot.NoneId, "|"); - x = AddText(view, x, y, view.Settings.ValueColor, 0, $"{value._11,14:0.000}"); - x = AddText(view, x, y, view.Settings.NameColor, HotSpot.NoneId, ","); - x = AddText(view, x, y, view.Settings.ValueColor, 1, $"{value._12,14:0.000}"); - x = AddText(view, x, y, view.Settings.NameColor, HotSpot.NoneId, ","); - x = AddText(view, x, y, view.Settings.ValueColor, 2, $"{value._13,14:0.000}"); - x = AddText(view, x, y, view.Settings.NameColor, HotSpot.NoneId, "|"); + x = AddText(context, x, y, context.Settings.NameColor, HotSpot.NoneId, "|"); + x = AddText(context, x, y, context.Settings.ValueColor, 0, $"{value._11,14:0.000}"); + x = AddText(context, x, y, context.Settings.NameColor, HotSpot.NoneId, ","); + x = AddText(context, x, y, context.Settings.ValueColor, 1, $"{value._12,14:0.000}"); + x = AddText(context, x, y, context.Settings.NameColor, HotSpot.NoneId, ","); + x = AddText(context, x, y, context.Settings.ValueColor, 2, $"{value._13,14:0.000}"); + x = AddText(context, x, y, context.Settings.NameColor, HotSpot.NoneId, "|"); maxX = Math.Max(x, maxX); - y += view.Font.Height; + y += context.Font.Height; x = defaultX; - x = AddText(view, x, y, view.Settings.NameColor, HotSpot.NoneId, "|"); - x = AddText(view, x, y, view.Settings.ValueColor, 3, $"{value._21,14:0.000}"); - x = AddText(view, x, y, view.Settings.NameColor, HotSpot.NoneId, ","); - x = AddText(view, x, y, view.Settings.ValueColor, 4, $"{value._22,14:0.000}"); - x = AddText(view, x, y, view.Settings.NameColor, HotSpot.NoneId, ","); - x = AddText(view, x, y, view.Settings.ValueColor, 5, $"{value._23,14:0.000}"); - x = AddText(view, x, y, view.Settings.NameColor, HotSpot.NoneId, "|"); + x = AddText(context, x, y, context.Settings.NameColor, HotSpot.NoneId, "|"); + x = AddText(context, x, y, context.Settings.ValueColor, 3, $"{value._21,14:0.000}"); + x = AddText(context, x, y, context.Settings.NameColor, HotSpot.NoneId, ","); + x = AddText(context, x, y, context.Settings.ValueColor, 4, $"{value._22,14:0.000}"); + x = AddText(context, x, y, context.Settings.NameColor, HotSpot.NoneId, ","); + x = AddText(context, x, y, context.Settings.ValueColor, 5, $"{value._23,14:0.000}"); + x = AddText(context, x, y, context.Settings.NameColor, HotSpot.NoneId, "|"); maxX = Math.Max(x, maxX); - y += view.Font.Height; + y += context.Font.Height; x = defaultX; - x = AddText(view, x, y, view.Settings.NameColor, HotSpot.NoneId, "|"); - x = AddText(view, x, y, view.Settings.ValueColor, 6, $"{value._31,14:0.000}"); - x = AddText(view, x, y, view.Settings.NameColor, HotSpot.NoneId, ","); - x = AddText(view, x, y, view.Settings.ValueColor, 7, $"{value._32,14:0.000}"); - x = AddText(view, x, y, view.Settings.NameColor, HotSpot.NoneId, ","); - x = AddText(view, x, y, view.Settings.ValueColor, 8, $"{value._33,14:0.000}"); - x = AddText(view, x, y, view.Settings.NameColor, HotSpot.NoneId, "|"); + x = AddText(context, x, y, context.Settings.NameColor, HotSpot.NoneId, "|"); + x = AddText(context, x, y, context.Settings.ValueColor, 6, $"{value._31,14:0.000}"); + x = AddText(context, x, y, context.Settings.NameColor, HotSpot.NoneId, ","); + x = AddText(context, x, y, context.Settings.ValueColor, 7, $"{value._32,14:0.000}"); + x = AddText(context, x, y, context.Settings.NameColor, HotSpot.NoneId, ","); + x = AddText(context, x, y, context.Settings.ValueColor, 8, $"{value._33,14:0.000}"); + x = AddText(context, x, y, context.Settings.NameColor, HotSpot.NoneId, "|"); maxX = Math.Max(x, maxX); }); } - protected override int CalculateValuesHeight(ViewInfo view) + protected override int CalculateValuesHeight(DrawContext view) { return 3 * view.Font.Height; } diff --git a/ReClass.NET/Nodes/Matrix3x4Node.cs b/ReClass.NET/Nodes/Matrix3x4Node.cs index 5018cc7e..ab790584 100644 --- a/ReClass.NET/Nodes/Matrix3x4Node.cs +++ b/ReClass.NET/Nodes/Matrix3x4Node.cs @@ -47,54 +47,54 @@ public override void GetUserInterfaceInfo(out string name, out Image icon) icon = Properties.Resources.B16x16_Button_Matrix_3x4; } - public override Size Draw(ViewInfo view, int x2, int y2) + public override Size Draw(DrawContext context, int x2, int y2) { - return DrawMatrixType(view, x2, y2, "Matrix (3x4)", (int defaultX, ref int maxX, ref int y) => + return DrawMatrixType(context, x2, y2, "Matrix (3x4)", (int defaultX, ref int maxX, ref int y) => { - var value = view.Memory.ReadObject(Offset); + var value = context.Memory.ReadObject(Offset); - y += view.Font.Height; + y += context.Font.Height; var x = defaultX; - x = AddText(view, x, y, view.Settings.NameColor, HotSpot.NoneId, "|"); - x = AddText(view, x, y, view.Settings.ValueColor, 0, $"{value._11,14:0.000}"); - x = AddText(view, x, y, view.Settings.NameColor, HotSpot.NoneId, ","); - x = AddText(view, x, y, view.Settings.ValueColor, 1, $"{value._12,14:0.000}"); - x = AddText(view, x, y, view.Settings.NameColor, HotSpot.NoneId, ","); - x = AddText(view, x, y, view.Settings.ValueColor, 2, $"{value._13,14:0.000}"); - x = AddText(view, x, y, view.Settings.NameColor, HotSpot.NoneId, ","); - x = AddText(view, x, y, view.Settings.ValueColor, 3, $"{value._14,14:0.000}"); - x = AddText(view, x, y, view.Settings.NameColor, HotSpot.NoneId, "|"); + x = AddText(context, x, y, context.Settings.NameColor, HotSpot.NoneId, "|"); + x = AddText(context, x, y, context.Settings.ValueColor, 0, $"{value._11,14:0.000}"); + x = AddText(context, x, y, context.Settings.NameColor, HotSpot.NoneId, ","); + x = AddText(context, x, y, context.Settings.ValueColor, 1, $"{value._12,14:0.000}"); + x = AddText(context, x, y, context.Settings.NameColor, HotSpot.NoneId, ","); + x = AddText(context, x, y, context.Settings.ValueColor, 2, $"{value._13,14:0.000}"); + x = AddText(context, x, y, context.Settings.NameColor, HotSpot.NoneId, ","); + x = AddText(context, x, y, context.Settings.ValueColor, 3, $"{value._14,14:0.000}"); + x = AddText(context, x, y, context.Settings.NameColor, HotSpot.NoneId, "|"); maxX = Math.Max(x, maxX); - y += view.Font.Height; + y += context.Font.Height; x = defaultX; - x = AddText(view, x, y, view.Settings.NameColor, HotSpot.NoneId, "|"); - x = AddText(view, x, y, view.Settings.ValueColor, 4, $"{value._21,14:0.000}"); - x = AddText(view, x, y, view.Settings.NameColor, HotSpot.NoneId, ","); - x = AddText(view, x, y, view.Settings.ValueColor, 5, $"{value._22,14:0.000}"); - x = AddText(view, x, y, view.Settings.NameColor, HotSpot.NoneId, ","); - x = AddText(view, x, y, view.Settings.ValueColor, 6, $"{value._23,14:0.000}"); - x = AddText(view, x, y, view.Settings.NameColor, HotSpot.NoneId, ","); - x = AddText(view, x, y, view.Settings.ValueColor, 7, $"{value._24,14:0.000}"); - x = AddText(view, x, y, view.Settings.NameColor, HotSpot.NoneId, "|"); + x = AddText(context, x, y, context.Settings.NameColor, HotSpot.NoneId, "|"); + x = AddText(context, x, y, context.Settings.ValueColor, 4, $"{value._21,14:0.000}"); + x = AddText(context, x, y, context.Settings.NameColor, HotSpot.NoneId, ","); + x = AddText(context, x, y, context.Settings.ValueColor, 5, $"{value._22,14:0.000}"); + x = AddText(context, x, y, context.Settings.NameColor, HotSpot.NoneId, ","); + x = AddText(context, x, y, context.Settings.ValueColor, 6, $"{value._23,14:0.000}"); + x = AddText(context, x, y, context.Settings.NameColor, HotSpot.NoneId, ","); + x = AddText(context, x, y, context.Settings.ValueColor, 7, $"{value._24,14:0.000}"); + x = AddText(context, x, y, context.Settings.NameColor, HotSpot.NoneId, "|"); maxX = Math.Max(x, maxX); - y += view.Font.Height; + y += context.Font.Height; x = defaultX; - x = AddText(view, x, y, view.Settings.NameColor, HotSpot.NoneId, "|"); - x = AddText(view, x, y, view.Settings.ValueColor, 8, $"{value._31,14:0.000}"); - x = AddText(view, x, y, view.Settings.NameColor, HotSpot.NoneId, ","); - x = AddText(view, x, y, view.Settings.ValueColor, 9, $"{value._32,14:0.000}"); - x = AddText(view, x, y, view.Settings.NameColor, HotSpot.NoneId, ","); - x = AddText(view, x, y, view.Settings.ValueColor, 10, $"{value._33,14:0.000}"); - x = AddText(view, x, y, view.Settings.NameColor, HotSpot.NoneId, ","); - x = AddText(view, x, y, view.Settings.ValueColor, 11, $"{value._34,14:0.000}"); - x = AddText(view, x, y, view.Settings.NameColor, HotSpot.NoneId, "|"); + x = AddText(context, x, y, context.Settings.NameColor, HotSpot.NoneId, "|"); + x = AddText(context, x, y, context.Settings.ValueColor, 8, $"{value._31,14:0.000}"); + x = AddText(context, x, y, context.Settings.NameColor, HotSpot.NoneId, ","); + x = AddText(context, x, y, context.Settings.ValueColor, 9, $"{value._32,14:0.000}"); + x = AddText(context, x, y, context.Settings.NameColor, HotSpot.NoneId, ","); + x = AddText(context, x, y, context.Settings.ValueColor, 10, $"{value._33,14:0.000}"); + x = AddText(context, x, y, context.Settings.NameColor, HotSpot.NoneId, ","); + x = AddText(context, x, y, context.Settings.ValueColor, 11, $"{value._34,14:0.000}"); + x = AddText(context, x, y, context.Settings.NameColor, HotSpot.NoneId, "|"); maxX = Math.Max(x, maxX); }); } - protected override int CalculateValuesHeight(ViewInfo view) + protected override int CalculateValuesHeight(DrawContext view) { return 3 * view.Font.Height; } diff --git a/ReClass.NET/Nodes/Matrix4x4Node.cs b/ReClass.NET/Nodes/Matrix4x4Node.cs index bef0b97e..097e1469 100644 --- a/ReClass.NET/Nodes/Matrix4x4Node.cs +++ b/ReClass.NET/Nodes/Matrix4x4Node.cs @@ -55,67 +55,67 @@ public override void GetUserInterfaceInfo(out string name, out Image icon) icon = Properties.Resources.B16x16_Button_Matrix_4x4; } - public override Size Draw(ViewInfo view, int x2, int y2) + public override Size Draw(DrawContext context, int x2, int y2) { - return DrawMatrixType(view, x2, y2, "Matrix (4x4)", (int defaultX, ref int maxX, ref int y) => + return DrawMatrixType(context, x2, y2, "Matrix (4x4)", (int defaultX, ref int maxX, ref int y) => { - var value = view.Memory.ReadObject(Offset); + var value = context.Memory.ReadObject(Offset); - y += view.Font.Height; + y += context.Font.Height; var x = defaultX; - x = AddText(view, x, y, view.Settings.NameColor, HotSpot.NoneId, "|"); - x = AddText(view, x, y, view.Settings.ValueColor, 0, $"{value._11,14:0.000}"); - x = AddText(view, x, y, view.Settings.NameColor, HotSpot.NoneId, ","); - x = AddText(view, x, y, view.Settings.ValueColor, 1, $"{value._12,14:0.000}"); - x = AddText(view, x, y, view.Settings.NameColor, HotSpot.NoneId, ","); - x = AddText(view, x, y, view.Settings.ValueColor, 2, $"{value._13,14:0.000}"); - x = AddText(view, x, y, view.Settings.NameColor, HotSpot.NoneId, ","); - x = AddText(view, x, y, view.Settings.ValueColor, 3, $"{value._14,14:0.000}"); - x = AddText(view, x, y, view.Settings.NameColor, HotSpot.NoneId, "|"); + x = AddText(context, x, y, context.Settings.NameColor, HotSpot.NoneId, "|"); + x = AddText(context, x, y, context.Settings.ValueColor, 0, $"{value._11,14:0.000}"); + x = AddText(context, x, y, context.Settings.NameColor, HotSpot.NoneId, ","); + x = AddText(context, x, y, context.Settings.ValueColor, 1, $"{value._12,14:0.000}"); + x = AddText(context, x, y, context.Settings.NameColor, HotSpot.NoneId, ","); + x = AddText(context, x, y, context.Settings.ValueColor, 2, $"{value._13,14:0.000}"); + x = AddText(context, x, y, context.Settings.NameColor, HotSpot.NoneId, ","); + x = AddText(context, x, y, context.Settings.ValueColor, 3, $"{value._14,14:0.000}"); + x = AddText(context, x, y, context.Settings.NameColor, HotSpot.NoneId, "|"); maxX = Math.Max(x, maxX); - y += view.Font.Height; + y += context.Font.Height; x = defaultX; - x = AddText(view, x, y, view.Settings.NameColor, HotSpot.NoneId, "|"); - x = AddText(view, x, y, view.Settings.ValueColor, 4, $"{value._21,14:0.000}"); - x = AddText(view, x, y, view.Settings.NameColor, HotSpot.NoneId, ","); - x = AddText(view, x, y, view.Settings.ValueColor, 5, $"{value._22,14:0.000}"); - x = AddText(view, x, y, view.Settings.NameColor, HotSpot.NoneId, ","); - x = AddText(view, x, y, view.Settings.ValueColor, 6, $"{value._23,14:0.000}"); - x = AddText(view, x, y, view.Settings.NameColor, HotSpot.NoneId, ","); - x = AddText(view, x, y, view.Settings.ValueColor, 7, $"{value._24,14:0.000}"); - x = AddText(view, x, y, view.Settings.NameColor, HotSpot.NoneId, "|"); + x = AddText(context, x, y, context.Settings.NameColor, HotSpot.NoneId, "|"); + x = AddText(context, x, y, context.Settings.ValueColor, 4, $"{value._21,14:0.000}"); + x = AddText(context, x, y, context.Settings.NameColor, HotSpot.NoneId, ","); + x = AddText(context, x, y, context.Settings.ValueColor, 5, $"{value._22,14:0.000}"); + x = AddText(context, x, y, context.Settings.NameColor, HotSpot.NoneId, ","); + x = AddText(context, x, y, context.Settings.ValueColor, 6, $"{value._23,14:0.000}"); + x = AddText(context, x, y, context.Settings.NameColor, HotSpot.NoneId, ","); + x = AddText(context, x, y, context.Settings.ValueColor, 7, $"{value._24,14:0.000}"); + x = AddText(context, x, y, context.Settings.NameColor, HotSpot.NoneId, "|"); maxX = Math.Max(x, maxX); - y += view.Font.Height; + y += context.Font.Height; x = defaultX; - x = AddText(view, x, y, view.Settings.NameColor, HotSpot.NoneId, "|"); - x = AddText(view, x, y, view.Settings.ValueColor, 8, $"{value._31,14:0.000}"); - x = AddText(view, x, y, view.Settings.NameColor, HotSpot.NoneId, ","); - x = AddText(view, x, y, view.Settings.ValueColor, 9, $"{value._32,14:0.000}"); - x = AddText(view, x, y, view.Settings.NameColor, HotSpot.NoneId, ","); - x = AddText(view, x, y, view.Settings.ValueColor, 10, $"{value._33,14:0.000}"); - x = AddText(view, x, y, view.Settings.NameColor, HotSpot.NoneId, ","); - x = AddText(view, x, y, view.Settings.ValueColor, 11, $"{value._34,14:0.000}"); - x = AddText(view, x, y, view.Settings.NameColor, HotSpot.NoneId, "|"); + x = AddText(context, x, y, context.Settings.NameColor, HotSpot.NoneId, "|"); + x = AddText(context, x, y, context.Settings.ValueColor, 8, $"{value._31,14:0.000}"); + x = AddText(context, x, y, context.Settings.NameColor, HotSpot.NoneId, ","); + x = AddText(context, x, y, context.Settings.ValueColor, 9, $"{value._32,14:0.000}"); + x = AddText(context, x, y, context.Settings.NameColor, HotSpot.NoneId, ","); + x = AddText(context, x, y, context.Settings.ValueColor, 10, $"{value._33,14:0.000}"); + x = AddText(context, x, y, context.Settings.NameColor, HotSpot.NoneId, ","); + x = AddText(context, x, y, context.Settings.ValueColor, 11, $"{value._34,14:0.000}"); + x = AddText(context, x, y, context.Settings.NameColor, HotSpot.NoneId, "|"); maxX = Math.Max(x, maxX); - y += view.Font.Height; + y += context.Font.Height; x = defaultX; - x = AddText(view, x, y, view.Settings.NameColor, HotSpot.NoneId, "|"); - x = AddText(view, x, y, view.Settings.ValueColor, 12, $"{value._41,14:0.000}"); - x = AddText(view, x, y, view.Settings.NameColor, HotSpot.NoneId, ","); - x = AddText(view, x, y, view.Settings.ValueColor, 13, $"{value._42,14:0.000}"); - x = AddText(view, x, y, view.Settings.NameColor, HotSpot.NoneId, ","); - x = AddText(view, x, y, view.Settings.ValueColor, 14, $"{value._43,14:0.000}"); - x = AddText(view, x, y, view.Settings.NameColor, HotSpot.NoneId, ","); - x = AddText(view, x, y, view.Settings.ValueColor, 15, $"{value._44,14:0.000}"); - x = AddText(view, x, y, view.Settings.NameColor, HotSpot.NoneId, "|"); + x = AddText(context, x, y, context.Settings.NameColor, HotSpot.NoneId, "|"); + x = AddText(context, x, y, context.Settings.ValueColor, 12, $"{value._41,14:0.000}"); + x = AddText(context, x, y, context.Settings.NameColor, HotSpot.NoneId, ","); + x = AddText(context, x, y, context.Settings.ValueColor, 13, $"{value._42,14:0.000}"); + x = AddText(context, x, y, context.Settings.NameColor, HotSpot.NoneId, ","); + x = AddText(context, x, y, context.Settings.ValueColor, 14, $"{value._43,14:0.000}"); + x = AddText(context, x, y, context.Settings.NameColor, HotSpot.NoneId, ","); + x = AddText(context, x, y, context.Settings.ValueColor, 15, $"{value._44,14:0.000}"); + x = AddText(context, x, y, context.Settings.NameColor, HotSpot.NoneId, "|"); maxX = Math.Max(x, maxX); }); } - protected override int CalculateValuesHeight(ViewInfo view) + protected override int CalculateValuesHeight(DrawContext view) { return 4 * view.Font.Height; } diff --git a/ReClass.NET/Nodes/PointerNode.cs b/ReClass.NET/Nodes/PointerNode.cs index 0c7b5139..8920feb6 100644 --- a/ReClass.NET/Nodes/PointerNode.cs +++ b/ReClass.NET/Nodes/PointerNode.cs @@ -55,63 +55,63 @@ public override bool CanChangeInnerNodeTo(BaseNode node) return true; } - public override Size Draw(ViewInfo view, int x, int y) + public override Size Draw(DrawContext context, int x, int y) { if (IsHidden && !IsWrapped) { - return DrawHidden(view, x, y); + return DrawHidden(context, x, y); } var origX = x; var origY = y; - AddSelection(view, x, y, view.Font.Height); + AddSelection(context, x, y, context.Font.Height); if (InnerNode != null) { - x = AddOpenCloseIcon(view, x, y); + x = AddOpenCloseIcon(context, x, y); } else { - x = AddIconPadding(view, x); + x = AddIconPadding(context, x); } - x = AddIcon(view, x, y, view.IconProvider.Pointer, HotSpot.NoneId, HotSpotType.None); + x = AddIcon(context, x, y, context.IconProvider.Pointer, HotSpot.NoneId, HotSpotType.None); var tx = x; - x = AddAddressOffset(view, x, y); + x = AddAddressOffset(context, x, y); - x = AddText(view, x, y, view.Settings.TypeColor, HotSpot.NoneId, "Ptr") + view.Font.Width; + x = AddText(context, x, y, context.Settings.TypeColor, HotSpot.NoneId, "Ptr") + context.Font.Width; if (!IsWrapped) { - x = AddText(view, x, y, view.Settings.NameColor, HotSpot.NameId, Name) + view.Font.Width; + x = AddText(context, x, y, context.Settings.NameColor, HotSpot.NameId, Name) + context.Font.Width; } if (InnerNode == null) { - x = AddText(view, x, y, view.Settings.ValueColor, HotSpot.NoneId, "") + view.Font.Width; + x = AddText(context, x, y, context.Settings.ValueColor, HotSpot.NoneId, "") + context.Font.Width; } - x = AddIcon(view, x, y, view.IconProvider.Change, 4, HotSpotType.ChangeWrappedType) + view.Font.Width; + x = AddIcon(context, x, y, context.IconProvider.Change, 4, HotSpotType.ChangeWrappedType) + context.Font.Width; - var ptr = view.Memory.ReadIntPtr(Offset); + var ptr = context.Memory.ReadIntPtr(Offset); - x = AddText(view, x, y, view.Settings.OffsetColor, HotSpot.NoneId, "->") + view.Font.Width; - x = AddText(view, x, y, view.Settings.ValueColor, 0, "0x" + ptr.ToString(Constants.AddressHexFormat)) + view.Font.Width; + x = AddText(context, x, y, context.Settings.OffsetColor, HotSpot.NoneId, "->") + context.Font.Width; + x = AddText(context, x, y, context.Settings.ValueColor, 0, "0x" + ptr.ToString(Constants.AddressHexFormat)) + context.Font.Width; - x = AddComment(view, x, y); + x = AddComment(context, x, y); - DrawInvalidMemoryIndicatorIcon(view, y); - AddContextDropDownIcon(view, y); - AddDeleteIcon(view, y); + DrawInvalidMemoryIndicatorIcon(context, y); + AddContextDropDownIcon(context, y); + AddDeleteIcon(context, y); - y += view.Font.Height; + y += context.Font.Height; var size = new Size(x - origX, y - origY); - if (LevelsOpen[view.Level] && InnerNode != null) + if (LevelsOpen[context.Level] && InnerNode != null) { memory.Size = InnerNode.MemorySize; - memory.UpdateFrom(view.Process, ptr); + memory.UpdateFrom(context.Process, ptr); - var v = view.Clone(); + var v = context.Clone(); v.Address = ptr; v.Memory = memory; @@ -124,7 +124,7 @@ public override Size Draw(ViewInfo view, int x, int y) return size; } - public override int CalculateDrawnHeight(ViewInfo view) + public override int CalculateDrawnHeight(DrawContext view) { if (IsHidden && !IsWrapped) { diff --git a/ReClass.NET/Nodes/UInt16Node.cs b/ReClass.NET/Nodes/UInt16Node.cs index 32177b36..47f72602 100644 --- a/ReClass.NET/Nodes/UInt16Node.cs +++ b/ReClass.NET/Nodes/UInt16Node.cs @@ -17,10 +17,10 @@ public override void GetUserInterfaceInfo(out string name, out Image icon) icon = Properties.Resources.B16x16_Button_UInt_16; } - public override Size Draw(ViewInfo view, int x, int y) + public override Size Draw(DrawContext context, int x, int y) { - var value = ReadValueFromMemory(view.Memory); - return DrawNumeric(view, x, y, view.IconProvider.Unsigned, "UInt16", value.ToString(), $"0x{value:X}"); + var value = ReadValueFromMemory(context.Memory); + return DrawNumeric(context, x, y, context.IconProvider.Unsigned, "UInt16", value.ToString(), $"0x{value:X}"); } public override void Update(HotSpot spot) diff --git a/ReClass.NET/Nodes/UInt32Node.cs b/ReClass.NET/Nodes/UInt32Node.cs index 625f58a3..ad97faae 100644 --- a/ReClass.NET/Nodes/UInt32Node.cs +++ b/ReClass.NET/Nodes/UInt32Node.cs @@ -17,10 +17,10 @@ public override void GetUserInterfaceInfo(out string name, out Image icon) icon = Properties.Resources.B16x16_Button_UInt_32; } - public override Size Draw(ViewInfo view, int x, int y) + public override Size Draw(DrawContext context, int x, int y) { - var value = ReadValueFromMemory(view.Memory); - return DrawNumeric(view, x, y, view.IconProvider.Unsigned, "UInt32", value.ToString(), $"0x{value:X}"); + var value = ReadValueFromMemory(context.Memory); + return DrawNumeric(context, x, y, context.IconProvider.Unsigned, "UInt32", value.ToString(), $"0x{value:X}"); } public override void Update(HotSpot spot) diff --git a/ReClass.NET/Nodes/UInt64Node.cs b/ReClass.NET/Nodes/UInt64Node.cs index 903a8bae..603eb784 100644 --- a/ReClass.NET/Nodes/UInt64Node.cs +++ b/ReClass.NET/Nodes/UInt64Node.cs @@ -17,10 +17,10 @@ public override void GetUserInterfaceInfo(out string name, out Image icon) icon = Properties.Resources.B16x16_Button_UInt_64; } - public override Size Draw(ViewInfo view, int x, int y) + public override Size Draw(DrawContext context, int x, int y) { - var value = ReadValueFromMemory(view.Memory); - return DrawNumeric(view, x, y, view.IconProvider.Unsigned, "UInt64", value.ToString(), $"0x{value:X}"); + var value = ReadValueFromMemory(context.Memory); + return DrawNumeric(context, x, y, context.IconProvider.Unsigned, "UInt64", value.ToString(), $"0x{value:X}"); } public override void Update(HotSpot spot) diff --git a/ReClass.NET/Nodes/UInt8Node.cs b/ReClass.NET/Nodes/UInt8Node.cs index da5be305..ce6def15 100644 --- a/ReClass.NET/Nodes/UInt8Node.cs +++ b/ReClass.NET/Nodes/UInt8Node.cs @@ -17,10 +17,10 @@ public override void GetUserInterfaceInfo(out string name, out Image icon) icon = Properties.Resources.B16x16_Button_UInt_8; } - public override Size Draw(ViewInfo view, int x, int y) + public override Size Draw(DrawContext context, int x, int y) { - var value = ReadValueFromMemory(view.Memory); - return DrawNumeric(view, x, y, view.IconProvider.Unsigned, "UInt8", value.ToString(), $"0x{value:X}"); + var value = ReadValueFromMemory(context.Memory); + return DrawNumeric(context, x, y, context.IconProvider.Unsigned, "UInt8", value.ToString(), $"0x{value:X}"); } public override void Update(HotSpot spot) diff --git a/ReClass.NET/Nodes/UTF16TextNode.cs b/ReClass.NET/Nodes/UTF16TextNode.cs index a0e3a175..9ea1bc6a 100644 --- a/ReClass.NET/Nodes/UTF16TextNode.cs +++ b/ReClass.NET/Nodes/UTF16TextNode.cs @@ -14,9 +14,9 @@ public override void GetUserInterfaceInfo(out string name, out Image icon) icon = Properties.Resources.B16x16_Button_UText; } - public override Size Draw(ViewInfo view, int x, int y) + public override Size Draw(DrawContext context, int x, int y) { - return DrawText(view, x, y, "Text16"); + return DrawText(context, x, y, "Text16"); } } } diff --git a/ReClass.NET/Nodes/UTF16TextPtrNode.cs b/ReClass.NET/Nodes/UTF16TextPtrNode.cs index 54ab0271..dc02f3f1 100644 --- a/ReClass.NET/Nodes/UTF16TextPtrNode.cs +++ b/ReClass.NET/Nodes/UTF16TextPtrNode.cs @@ -14,9 +14,9 @@ public override void GetUserInterfaceInfo(out string name, out Image icon) icon = Properties.Resources.B16x16_Button_UText_Pointer; } - public override Size Draw(ViewInfo view, int x, int y) + public override Size Draw(DrawContext context, int x, int y) { - return DrawText(view, x, y, "Text16Ptr"); + return DrawText(context, x, y, "Text16Ptr"); } } } diff --git a/ReClass.NET/Nodes/UTF32TextNode.cs b/ReClass.NET/Nodes/UTF32TextNode.cs index b7d9fa41..f08d7735 100644 --- a/ReClass.NET/Nodes/UTF32TextNode.cs +++ b/ReClass.NET/Nodes/UTF32TextNode.cs @@ -14,9 +14,9 @@ public override void GetUserInterfaceInfo(out string name, out Image icon) icon = Properties.Resources.B16x16_Button_UText; } - public override Size Draw(ViewInfo view, int x, int y) + public override Size Draw(DrawContext context, int x, int y) { - return DrawText(view, x, y, "Text32"); + return DrawText(context, x, y, "Text32"); } } } diff --git a/ReClass.NET/Nodes/UTF32TextPtrNode.cs b/ReClass.NET/Nodes/UTF32TextPtrNode.cs index 97934150..3e7b920e 100644 --- a/ReClass.NET/Nodes/UTF32TextPtrNode.cs +++ b/ReClass.NET/Nodes/UTF32TextPtrNode.cs @@ -14,9 +14,9 @@ public override void GetUserInterfaceInfo(out string name, out Image icon) icon = Properties.Resources.B16x16_Button_UText_Pointer; } - public override Size Draw(ViewInfo view, int x, int y) + public override Size Draw(DrawContext context, int x, int y) { - return DrawText(view, x, y, "Text32Ptr"); + return DrawText(context, x, y, "Text32Ptr"); } } } diff --git a/ReClass.NET/Nodes/UTF8TextNode.cs b/ReClass.NET/Nodes/UTF8TextNode.cs index 6fdbd0c3..ef9c5ff6 100644 --- a/ReClass.NET/Nodes/UTF8TextNode.cs +++ b/ReClass.NET/Nodes/UTF8TextNode.cs @@ -14,9 +14,9 @@ public override void GetUserInterfaceInfo(out string name, out Image icon) icon = Properties.Resources.B16x16_Button_Text; } - public override Size Draw(ViewInfo view, int x, int y) + public override Size Draw(DrawContext context, int x, int y) { - return DrawText(view, x, y, "Text8"); + return DrawText(context, x, y, "Text8"); } } } diff --git a/ReClass.NET/Nodes/UTF8TextPtrNode.cs b/ReClass.NET/Nodes/UTF8TextPtrNode.cs index ddebecd0..d1173ff2 100644 --- a/ReClass.NET/Nodes/UTF8TextPtrNode.cs +++ b/ReClass.NET/Nodes/UTF8TextPtrNode.cs @@ -14,9 +14,9 @@ public override void GetUserInterfaceInfo(out string name, out Image icon) icon = Properties.Resources.B16x16_Button_Text_Pointer; } - public override Size Draw(ViewInfo view, int x, int y) + public override Size Draw(DrawContext context, int x, int y) { - return DrawText(view, x, y, "Text8Ptr"); + return DrawText(context, x, y, "Text8Ptr"); } } } diff --git a/ReClass.NET/Nodes/UnionNode.cs b/ReClass.NET/Nodes/UnionNode.cs index e30eb3cb..5d1df2d4 100644 --- a/ReClass.NET/Nodes/UnionNode.cs +++ b/ReClass.NET/Nodes/UnionNode.cs @@ -44,45 +44,45 @@ public override void UpdateOffsets() } } - public override Size Draw(ViewInfo view, int x, int y) + public override Size Draw(DrawContext context, int x, int y) { if (IsHidden && !IsWrapped) { - return DrawHidden(view, x, y); + return DrawHidden(context, x, y); } var origX = x; var origY = y; - AddSelection(view, x, y, view.Font.Height); + AddSelection(context, x, y, context.Font.Height); - x = AddOpenCloseIcon(view, x, y); - x = AddIcon(view, x, y, view.IconProvider.Union, -1, HotSpotType.None); + x = AddOpenCloseIcon(context, x, y); + x = AddIcon(context, x, y, context.IconProvider.Union, -1, HotSpotType.None); var tx = x; - x = AddAddressOffset(view, x, y); + x = AddAddressOffset(context, x, y); - x = AddText(view, x, y, view.Settings.TypeColor, HotSpot.NoneId, "Union") + view.Font.Width; + x = AddText(context, x, y, context.Settings.TypeColor, HotSpot.NoneId, "Union") + context.Font.Width; - x = AddText(view, x, y, view.Settings.ValueColor, HotSpot.NoneId, $"[Nodes: {Nodes.Count}, Size: {MemorySize}]") + view.Font.Width; + x = AddText(context, x, y, context.Settings.ValueColor, HotSpot.NoneId, $"[Nodes: {Nodes.Count}, Size: {MemorySize}]") + context.Font.Width; - x = AddComment(view, x, y); + x = AddComment(context, x, y); - DrawInvalidMemoryIndicatorIcon(view, y); - AddContextDropDownIcon(view, y); - AddDeleteIcon(view, y); + DrawInvalidMemoryIndicatorIcon(context, y); + AddContextDropDownIcon(context, y); + AddDeleteIcon(context, y); - y += view.Font.Height; + y += context.Font.Height; var size = new Size(x - origX, y - origY); - if (LevelsOpen[view.Level]) + if (LevelsOpen[context.Level]) { - var v = view.Clone(); + var v = context.Clone(); v.Settings = Program.Settings.Clone(); v.Settings.ShowNodeAddress = false; - v.Address = view.Address + Offset; - v.Memory = view.Memory.Clone(); + v.Address = context.Address + Offset; + v.Memory = context.Memory.Clone(); v.Memory.Offset += Offset; foreach (var node in Nodes) @@ -99,7 +99,7 @@ public override Size Draw(ViewInfo view, int x, int y) return size; } - public override int CalculateDrawnHeight(ViewInfo view) + public override int CalculateDrawnHeight(DrawContext view) { if (IsHidden && !IsWrapped) { diff --git a/ReClass.NET/Nodes/Vector2Node.cs b/ReClass.NET/Nodes/Vector2Node.cs index 8464478d..5ad249dd 100644 --- a/ReClass.NET/Nodes/Vector2Node.cs +++ b/ReClass.NET/Nodes/Vector2Node.cs @@ -26,21 +26,21 @@ public override void GetUserInterfaceInfo(out string name, out Image icon) icon = Properties.Resources.B16x16_Button_Vector_2; } - public override Size Draw(ViewInfo view, int x2, int y2) + public override Size Draw(DrawContext context, int x2, int y2) { - return DrawVectorType(view, x2, y2, "Vector2", (ref int x, ref int y) => + return DrawVectorType(context, x2, y2, "Vector2", (ref int x, ref int y) => { - var value = view.Memory.ReadObject(Offset); + var value = context.Memory.ReadObject(Offset); - x = AddText(view, x, y, view.Settings.NameColor, HotSpot.NoneId, "("); - x = AddText(view, x, y, view.Settings.ValueColor, 0, $"{value.X:0.000}"); - x = AddText(view, x, y, view.Settings.NameColor, HotSpot.NoneId, ","); - x = AddText(view, x, y, view.Settings.ValueColor, 1, $"{value.Y:0.000}"); - x = AddText(view, x, y, view.Settings.NameColor, HotSpot.NoneId, ")"); + x = AddText(context, x, y, context.Settings.NameColor, HotSpot.NoneId, "("); + x = AddText(context, x, y, context.Settings.ValueColor, 0, $"{value.X:0.000}"); + x = AddText(context, x, y, context.Settings.NameColor, HotSpot.NoneId, ","); + x = AddText(context, x, y, context.Settings.ValueColor, 1, $"{value.Y:0.000}"); + x = AddText(context, x, y, context.Settings.NameColor, HotSpot.NoneId, ")"); }); } - protected override int CalculateValuesHeight(ViewInfo view) + protected override int CalculateValuesHeight(DrawContext view) { return 0; } diff --git a/ReClass.NET/Nodes/Vector3Node.cs b/ReClass.NET/Nodes/Vector3Node.cs index 6d5e93df..2d153ec7 100644 --- a/ReClass.NET/Nodes/Vector3Node.cs +++ b/ReClass.NET/Nodes/Vector3Node.cs @@ -28,23 +28,23 @@ public override void GetUserInterfaceInfo(out string name, out Image icon) icon = Properties.Resources.B16x16_Button_Vector_3; } - public override Size Draw(ViewInfo view, int x2, int y2) + public override Size Draw(DrawContext context, int x2, int y2) { - return DrawVectorType(view, x2, y2, "Vector3", (ref int x, ref int y) => + return DrawVectorType(context, x2, y2, "Vector3", (ref int x, ref int y) => { - var value = view.Memory.ReadObject(Offset); - - x = AddText(view, x, y, view.Settings.NameColor, HotSpot.NoneId, "("); - x = AddText(view, x, y, view.Settings.ValueColor, 0, $"{value.X:0.000}"); - x = AddText(view, x, y, view.Settings.NameColor, HotSpot.NoneId, ","); - x = AddText(view, x, y, view.Settings.ValueColor, 1, $"{value.Y:0.000}"); - x = AddText(view, x, y, view.Settings.NameColor, HotSpot.NoneId, ","); - x = AddText(view, x, y, view.Settings.ValueColor, 2, $"{value.Z:0.000}"); - x = AddText(view, x, y, view.Settings.NameColor, HotSpot.NoneId, ")"); + var value = context.Memory.ReadObject(Offset); + + x = AddText(context, x, y, context.Settings.NameColor, HotSpot.NoneId, "("); + x = AddText(context, x, y, context.Settings.ValueColor, 0, $"{value.X:0.000}"); + x = AddText(context, x, y, context.Settings.NameColor, HotSpot.NoneId, ","); + x = AddText(context, x, y, context.Settings.ValueColor, 1, $"{value.Y:0.000}"); + x = AddText(context, x, y, context.Settings.NameColor, HotSpot.NoneId, ","); + x = AddText(context, x, y, context.Settings.ValueColor, 2, $"{value.Z:0.000}"); + x = AddText(context, x, y, context.Settings.NameColor, HotSpot.NoneId, ")"); }); } - protected override int CalculateValuesHeight(ViewInfo view) + protected override int CalculateValuesHeight(DrawContext view) { return 0; } diff --git a/ReClass.NET/Nodes/Vector4Node.cs b/ReClass.NET/Nodes/Vector4Node.cs index 8ca4af3b..3c193cb4 100644 --- a/ReClass.NET/Nodes/Vector4Node.cs +++ b/ReClass.NET/Nodes/Vector4Node.cs @@ -30,25 +30,25 @@ public override void GetUserInterfaceInfo(out string name, out Image icon) icon = Properties.Resources.B16x16_Button_Vector_4; } - public override Size Draw(ViewInfo view, int x2, int y2) + public override Size Draw(DrawContext context, int x2, int y2) { - return DrawVectorType(view, x2, y2, "Vector4", (ref int x, ref int y) => + return DrawVectorType(context, x2, y2, "Vector4", (ref int x, ref int y) => { - var value = view.Memory.ReadObject(Offset); - - x = AddText(view, x, y, view.Settings.NameColor, HotSpot.NoneId, "("); - x = AddText(view, x, y, view.Settings.ValueColor, 0, $"{value.X:0.000}"); - x = AddText(view, x, y, view.Settings.NameColor, HotSpot.NoneId, ","); - x = AddText(view, x, y, view.Settings.ValueColor, 1, $"{value.Y:0.000}"); - x = AddText(view, x, y, view.Settings.NameColor, HotSpot.NoneId, ","); - x = AddText(view, x, y, view.Settings.ValueColor, 2, $"{value.Z:0.000}"); - x = AddText(view, x, y, view.Settings.NameColor, HotSpot.NoneId, ","); - x = AddText(view, x, y, view.Settings.ValueColor, 3, $"{value.W:0.000}"); - x = AddText(view, x, y, view.Settings.NameColor, HotSpot.NoneId, ")"); + var value = context.Memory.ReadObject(Offset); + + x = AddText(context, x, y, context.Settings.NameColor, HotSpot.NoneId, "("); + x = AddText(context, x, y, context.Settings.ValueColor, 0, $"{value.X:0.000}"); + x = AddText(context, x, y, context.Settings.NameColor, HotSpot.NoneId, ","); + x = AddText(context, x, y, context.Settings.ValueColor, 1, $"{value.Y:0.000}"); + x = AddText(context, x, y, context.Settings.NameColor, HotSpot.NoneId, ","); + x = AddText(context, x, y, context.Settings.ValueColor, 2, $"{value.Z:0.000}"); + x = AddText(context, x, y, context.Settings.NameColor, HotSpot.NoneId, ","); + x = AddText(context, x, y, context.Settings.ValueColor, 3, $"{value.W:0.000}"); + x = AddText(context, x, y, context.Settings.NameColor, HotSpot.NoneId, ")"); }); } - protected override int CalculateValuesHeight(ViewInfo view) + protected override int CalculateValuesHeight(DrawContext view) { return 0; } diff --git a/ReClass.NET/Nodes/VirtualMethodNode.cs b/ReClass.NET/Nodes/VirtualMethodNode.cs index f71d6c90..22bae685 100644 --- a/ReClass.NET/Nodes/VirtualMethodNode.cs +++ b/ReClass.NET/Nodes/VirtualMethodNode.cs @@ -21,9 +21,9 @@ public VirtualMethodNode() Name = string.Empty; } - public override Size Draw(ViewInfo view, int x, int y) + public override Size Draw(DrawContext context, int x, int y) { - return Draw(view, x, y, $"({Offset / IntPtr.Size})", MethodName); + return Draw(context, x, y, $"({Offset / IntPtr.Size})", MethodName); } } } diff --git a/ReClass.NET/Nodes/VirtualMethodTableNode.cs b/ReClass.NET/Nodes/VirtualMethodTableNode.cs index 64b10a65..bd08fb28 100644 --- a/ReClass.NET/Nodes/VirtualMethodTableNode.cs +++ b/ReClass.NET/Nodes/VirtualMethodTableNode.cs @@ -34,48 +34,48 @@ public override void Initialize() } } - public override Size Draw(ViewInfo view, int x, int y) + public override Size Draw(DrawContext context, int x, int y) { if (IsHidden && !IsWrapped) { - return DrawHidden(view, x, y); + return DrawHidden(context, x, y); } var origX = x; var origY = y; - AddSelection(view, x, y, view.Font.Height); + AddSelection(context, x, y, context.Font.Height); - x = AddOpenCloseIcon(view, x, y); - x = AddIcon(view, x, y, view.IconProvider.VirtualTable, HotSpot.NoneId, HotSpotType.None); + x = AddOpenCloseIcon(context, x, y); + x = AddIcon(context, x, y, context.IconProvider.VirtualTable, HotSpot.NoneId, HotSpotType.None); var tx = x; - x = AddAddressOffset(view, x, y); + x = AddAddressOffset(context, x, y); - x = AddText(view, x, y, view.Settings.VTableColor, HotSpot.NoneId, $"VTable[{Nodes.Count}]") + view.Font.Width; + x = AddText(context, x, y, context.Settings.VTableColor, HotSpot.NoneId, $"VTable[{Nodes.Count}]") + context.Font.Width; if (!IsWrapped) { - x = AddText(view, x, y, view.Settings.NameColor, HotSpot.NameId, Name) + view.Font.Width; + x = AddText(context, x, y, context.Settings.NameColor, HotSpot.NameId, Name) + context.Font.Width; } - x = AddComment(view, x, y); + x = AddComment(context, x, y); - DrawInvalidMemoryIndicatorIcon(view, y); - AddContextDropDownIcon(view, y); - AddDeleteIcon(view, y); + DrawInvalidMemoryIndicatorIcon(context, y); + AddContextDropDownIcon(context, y); + AddDeleteIcon(context, y); - y += view.Font.Height; + y += context.Font.Height; var size = new Size(x - origX, y - origY); - if (LevelsOpen[view.Level]) + if (LevelsOpen[context.Level]) { - var ptr = view.Memory.ReadIntPtr(Offset); + var ptr = context.Memory.ReadIntPtr(Offset); memory.Size = Nodes.Count * IntPtr.Size; - memory.UpdateFrom(view.Process, ptr); + memory.UpdateFrom(context.Process, ptr); - var v = view.Clone(); + var v = context.Clone(); v.Address = ptr; v.Memory = memory; @@ -93,7 +93,7 @@ public override Size Draw(ViewInfo view, int x, int y) return size; } - public override int CalculateDrawnHeight(ViewInfo view) + public override int CalculateDrawnHeight(DrawContext view) { if (IsHidden && !IsWrapped) { diff --git a/ReClass.NET/ReClass.NET.csproj b/ReClass.NET/ReClass.NET.csproj index c16db79d..b5761ac2 100644 --- a/ReClass.NET/ReClass.NET.csproj +++ b/ReClass.NET/ReClass.NET.csproj @@ -510,7 +510,7 @@ - + From 099638ddda21871275a500813083a382dc84c188 Mon Sep 17 00:00:00 2001 From: KN4CK3R Date: Sat, 10 Oct 2020 19:59:03 +0200 Subject: [PATCH 166/223] Set IconProvider for preview. --- ReClass.NET/Controls/MemoryPreviewPopUp.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/ReClass.NET/Controls/MemoryPreviewPopUp.cs b/ReClass.NET/Controls/MemoryPreviewPopUp.cs index 982edfcb..c407a40d 100644 --- a/ReClass.NET/Controls/MemoryPreviewPopUp.cs +++ b/ReClass.NET/Controls/MemoryPreviewPopUp.cs @@ -38,6 +38,7 @@ public MemoryPreviewPanel(FontEx font) DrawContext = new DrawContext { Font = font, + IconProvider = new IconProvider(), // TODO use single instance Memory = new MemoryBuffer(), From fd4d4b3c18b071d871412e80cc47985958e20bd3 Mon Sep 17 00:00:00 2001 From: KN4CK3R Date: Sat, 10 Oct 2020 20:14:08 +0200 Subject: [PATCH 167/223] Changed Visual Studio version (fixes #150). --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 771e3fbe..6a83bf03 100644 --- a/README.md +++ b/README.md @@ -74,7 +74,7 @@ Just download the [latest version](https://github.com/ReClassNET/ReClass.NET/rel Valid operations are read ([..]), add (+), sub (-), mul (*) and div (/). Please note that all operations are integer calculations. ## Compiling -If you want to compile ReClass.NET just fork the repository and open the ReClass.NET.sln file with Visual Studio 2017. +If you want to compile ReClass.NET just fork the repository and open the ReClass.NET.sln file with Visual Studio 2019. Compile the project and copy the dependencies to the output folder. ## Videos From 02de2bb1b617852083058329b2ff092191c79d5c Mon Sep 17 00:00:00 2001 From: KN4CK3R Date: Sat, 10 Oct 2020 20:20:06 +0200 Subject: [PATCH 168/223] Write field offset in own line. --- ReClass.NET/CodeGenerator/CSharpCodeGenerator.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ReClass.NET/CodeGenerator/CSharpCodeGenerator.cs b/ReClass.NET/CodeGenerator/CSharpCodeGenerator.cs index d512223c..b1364ace 100644 --- a/ReClass.NET/CodeGenerator/CSharpCodeGenerator.cs +++ b/ReClass.NET/CodeGenerator/CSharpCodeGenerator.cs @@ -174,7 +174,8 @@ private static void WriteClass(IndentedTextWriter writer, ClassNode @class, ILog var type = GetTypeDefinition(node); if (type != null) { - writer.Write($"[FieldOffset(0x{node.Offset:X})] public readonly {type} {node.Name};"); + writer.WriteLine($"[FieldOffset(0x{node.Offset:X})]"); + writer.Write($"public readonly {type} {node.Name};"); if (!string.IsNullOrEmpty(node.Comment)) { writer.Write(" "); From aeaf3e6f057b11df69a741c3584bd8da05c7438e Mon Sep 17 00:00:00 2001 From: KN4CK3R Date: Sat, 10 Oct 2020 20:22:25 +0200 Subject: [PATCH 169/223] Fixed generation of comments. --- ReClass.NET/CodeGenerator/CSharpCodeGenerator.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ReClass.NET/CodeGenerator/CSharpCodeGenerator.cs b/ReClass.NET/CodeGenerator/CSharpCodeGenerator.cs index b1364ace..5ab710ee 100644 --- a/ReClass.NET/CodeGenerator/CSharpCodeGenerator.cs +++ b/ReClass.NET/CodeGenerator/CSharpCodeGenerator.cs @@ -178,7 +178,7 @@ private static void WriteClass(IndentedTextWriter writer, ClassNode @class, ILog writer.Write($"public readonly {type} {node.Name};"); if (!string.IsNullOrEmpty(node.Comment)) { - writer.Write(" "); + writer.Write(" //"); writer.Write(node.Comment); } writer.WriteLine(); From 1f3fad139b0a85ee100f8f8933d1e1e7d56aafbd Mon Sep 17 00:00:00 2001 From: KN4CK3R Date: Sat, 10 Oct 2020 20:50:34 +0200 Subject: [PATCH 170/223] Added support for UTF8 strings. --- .../CodeGenerator/CSharpCodeGenerator.cs | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/ReClass.NET/CodeGenerator/CSharpCodeGenerator.cs b/ReClass.NET/CodeGenerator/CSharpCodeGenerator.cs index 5ab710ee..2a90c1e5 100644 --- a/ReClass.NET/CodeGenerator/CSharpCodeGenerator.cs +++ b/ReClass.NET/CodeGenerator/CSharpCodeGenerator.cs @@ -171,10 +171,14 @@ private static void WriteClass(IndentedTextWriter writer, ClassNode @class, ILog .WhereNot(n => n is FunctionNode || n is BaseHexNode); foreach (var node in nodes) { - var type = GetTypeDefinition(node); + var (type, attribute) = GetTypeDefinition(node); if (type != null) { writer.WriteLine($"[FieldOffset(0x{node.Offset:X})]"); + if (attribute != null) + { + writer.WriteLine(attribute); + } writer.Write($"public readonly {type} {node.Name};"); if (!string.IsNullOrEmpty(node.Comment)) { @@ -198,7 +202,7 @@ private static void WriteClass(IndentedTextWriter writer, ClassNode @class, ILog ///
/// The target node. /// The type definition for the node or null if no simple type is available. - private static string GetTypeDefinition(BaseNode node) + private static (string typeName, string attribute) GetTypeDefinition(BaseNode node) { Contract.Requires(node != null); @@ -211,15 +215,20 @@ private static string GetTypeDefinition(BaseNode node) if (nodeTypeToTypeDefinationMap.TryGetValue(node.GetType(), out var type)) { - return type; + return (type, null); } if (node is EnumNode enumNode) { - return enumNode.Enum.Name; + return (enumNode.Enum.Name, null); + } + + if (node is Utf8TextNode utf8TextNode) + { + return ("string", $"[MarshalAs(UnmanagedType.ByValTStr, SizeConst = {utf8TextNode.Length})]"); } - return null; + return (null, null); } } } From 594b9f802b63634744052088f00bfeb980944855 Mon Sep 17 00:00:00 2001 From: KN4CK3R Date: Sun, 11 Oct 2020 12:30:19 +0200 Subject: [PATCH 171/223] Output the additional attribute first. --- ReClass.NET/CodeGenerator/CSharpCodeGenerator.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ReClass.NET/CodeGenerator/CSharpCodeGenerator.cs b/ReClass.NET/CodeGenerator/CSharpCodeGenerator.cs index 2a90c1e5..79be0afe 100644 --- a/ReClass.NET/CodeGenerator/CSharpCodeGenerator.cs +++ b/ReClass.NET/CodeGenerator/CSharpCodeGenerator.cs @@ -174,11 +174,12 @@ private static void WriteClass(IndentedTextWriter writer, ClassNode @class, ILog var (type, attribute) = GetTypeDefinition(node); if (type != null) { - writer.WriteLine($"[FieldOffset(0x{node.Offset:X})]"); if (attribute != null) { writer.WriteLine(attribute); } + + writer.WriteLine($"[FieldOffset(0x{node.Offset:X})]"); writer.Write($"public readonly {type} {node.Name};"); if (!string.IsNullOrEmpty(node.Comment)) { From fdc07483c63f248d842cf6aabd0aec361af35e9f Mon Sep 17 00:00:00 2001 From: KN4CK3R Date: Sun, 11 Oct 2020 15:47:40 +0200 Subject: [PATCH 172/223] Added support for unicode strings. (fixes #149) --- .../CodeGenerator/CSharpCodeGenerator.cs | 64 +++++++++++++++---- 1 file changed, 52 insertions(+), 12 deletions(-) diff --git a/ReClass.NET/CodeGenerator/CSharpCodeGenerator.cs b/ReClass.NET/CodeGenerator/CSharpCodeGenerator.cs index 79be0afe..0eedf1f9 100644 --- a/ReClass.NET/CodeGenerator/CSharpCodeGenerator.cs +++ b/ReClass.NET/CodeGenerator/CSharpCodeGenerator.cs @@ -37,7 +37,7 @@ public class CSharpCodeGenerator : ICodeGenerator [typeof(Vector2Node)] = "Vector2", [typeof(Vector3Node)] = "Vector3", [typeof(Vector4Node)] = "Vector4" - }; + }; public Language Language => Language.CSharp; @@ -77,21 +77,42 @@ public string GenerateCode(IReadOnlyList classes, IReadOnlyList c.Nodes.None(n => n is FunctionNode)) // Skip class which contains FunctionNodes because these are not data classes. .Distinct(); + var unicodeStringClassLengthsToGenerate = new HashSet(); + using (var en = classesToWrite.GetEnumerator()) { if (en.MoveNext()) { + void FindUnicodeStringClasses(IEnumerable nodes) + { + unicodeStringClassLengthsToGenerate.UnionWith(nodes.OfType().Select(n => n.Length)); + } + + FindUnicodeStringClasses(en.Current!.Nodes); + WriteClass(iw, en.Current, logger); while (en.MoveNext()) { iw.WriteLine(); + FindUnicodeStringClasses(en.Current!.Nodes); + WriteClass(iw, en.Current, logger); } } } + if (unicodeStringClassLengthsToGenerate.Any()) + { + foreach (var length in unicodeStringClassLengthsToGenerate) + { + iw.WriteLine(); + + WriteUnicodeStringClass(iw, length); + } + } + return sw.ToString(); } @@ -152,7 +173,7 @@ private static void WriteClass(IndentedTextWriter writer, ClassNode @class, ILog Contract.Requires(@class != null); Contract.Requires(logger != null); - writer.WriteLine("[StructLayout(LayoutKind.Explicit)]"); + writer.WriteLine("[StructLayout(LayoutKind.Explicit, CharSet = CharSet.Ansi)]"); writer.Write("public struct "); writer.Write(@class.Name); @@ -199,10 +220,10 @@ private static void WriteClass(IndentedTextWriter writer, ClassNode @class, ILog } /// - /// Gets the type definition for the given node. If the node is not a simple node null is returned. + /// Gets the type definition for the given node. If the node is not expressible null as typename is returned. /// /// The target node. - /// The type definition for the node or null if no simple type is available. + /// The type definition for the node or null as typename if the node is not expressible. private static (string typeName, string attribute) GetTypeDefinition(BaseNode node) { Contract.Requires(node != null); @@ -219,17 +240,36 @@ private static (string typeName, string attribute) GetTypeDefinition(BaseNode no return (type, null); } - if (node is EnumNode enumNode) + return node switch { - return (enumNode.Enum.Name, null); - } + EnumNode enumNode => (enumNode.Enum.Name, null), + Utf8TextNode utf8TextNode => ("string", $"[MarshalAs(UnmanagedType.ByValTStr, SizeConst = {utf8TextNode.Length})]"), + Utf16TextNode utf16TextNode => (GetUnicodeStringClassName(utf16TextNode.Length), "[MarshalAs(UnmanagedType.Struct)]"), + _ => (null, null) + }; + } - if (node is Utf8TextNode utf8TextNode) - { - return ("string", $"[MarshalAs(UnmanagedType.ByValTStr, SizeConst = {utf8TextNode.Length})]"); - } + private static string GetUnicodeStringClassName(int length) => $"__UnicodeString{length}"; - return (null, null); + /// + /// Writes a helper class for unicode strings with the specific length. + /// + /// The writer to output to. + /// The string length for this class. + private static void WriteUnicodeStringClass(IndentedTextWriter writer, int length) + { + var className = GetUnicodeStringClassName(length); + + writer.WriteLine("[StructLayout(LayoutKind.Sequential, CharSet=CharSet.Unicode)]"); + writer.WriteLine($"public struct {className}"); + writer.WriteLine("{"); + writer.Indent++; + writer.WriteLine($"[MarshalAs(UnmanagedType.ByValTStr, SizeConst = {length})]"); + writer.WriteLine("public string Value;"); + writer.WriteLine(); + writer.WriteLine($"public static implicit operator string({className} value) => value.Value;"); + writer.Indent--; + writer.WriteLine("}"); } } } From 062cced817db2a71fe8fd41dbeec2753cafa1e1d Mon Sep 17 00:00:00 2001 From: KN4CK3R Date: Sat, 17 Oct 2020 12:23:10 +0200 Subject: [PATCH 173/223] Fixed parameter names. --- ReClass.NET/CodeGenerator/CppCodeGenerator.cs | 6 +- .../ReClass/Legacy/BaseClassArrayNode.cs | 2 +- .../ReClass/Legacy/ClassPointerNode.cs | 2 +- .../DataExchange/ReClass/Legacy/CustomNode.cs | 2 +- ReClass.NET/Nodes/ArrayNode.cs | 12 +- ReClass.NET/Nodes/BaseFunctionPtrNode.cs | 56 +++--- ReClass.NET/Nodes/BaseHexNode.cs | 52 +++--- ReClass.NET/Nodes/BaseMatrixNode.cs | 78 ++++---- ReClass.NET/Nodes/BaseNode.cs | 172 +++++++++--------- ReClass.NET/Nodes/BaseNumericNode.cs | 40 ++-- ReClass.NET/Nodes/BaseTextNode.cs | 46 ++--- ReClass.NET/Nodes/BaseTextPtrNode.cs | 44 ++--- ReClass.NET/Nodes/BaseWrapperArrayNode.cs | 64 +++---- ReClass.NET/Nodes/BitFieldNode.cs | 8 +- ReClass.NET/Nodes/BoolNode.cs | 4 +- ReClass.NET/Nodes/ClassInstanceNode.cs | 18 +- ReClass.NET/Nodes/ClassNode.cs | 18 +- ReClass.NET/Nodes/EnumNode.cs | 4 +- ReClass.NET/Nodes/FunctionNode.cs | 8 +- ReClass.NET/Nodes/Hex32Node.cs | 8 +- ReClass.NET/Nodes/Hex64Node.cs | 8 +- ReClass.NET/Nodes/Matrix3x3Node.cs | 4 +- ReClass.NET/Nodes/Matrix3x4Node.cs | 4 +- ReClass.NET/Nodes/Matrix4x4Node.cs | 4 +- ReClass.NET/Nodes/PointerNode.cs | 32 ++-- ReClass.NET/Nodes/UnionNode.cs | 22 +-- ReClass.NET/Nodes/Vector2Node.cs | 2 +- ReClass.NET/Nodes/Vector3Node.cs | 2 +- ReClass.NET/Nodes/Vector4Node.cs | 2 +- ReClass.NET/Nodes/VirtualMethodTableNode.cs | 16 +- 30 files changed, 368 insertions(+), 372 deletions(-) diff --git a/ReClass.NET/CodeGenerator/CppCodeGenerator.cs b/ReClass.NET/CodeGenerator/CppCodeGenerator.cs index 71bca3a8..8988118e 100644 --- a/ReClass.NET/CodeGenerator/CppCodeGenerator.cs +++ b/ReClass.NET/CodeGenerator/CppCodeGenerator.cs @@ -101,7 +101,7 @@ private class Utf8CharacterNode : BaseNode public override int MemorySize => throw new NotImplementedException(); public override void GetUserInterfaceInfo(out string name, out Image icon) => throw new NotImplementedException(); public override Size Draw(DrawContext context, int x, int y) => throw new NotImplementedException(); - public override int CalculateDrawnHeight(DrawContext view) => throw new NotImplementedException(); + public override int CalculateDrawnHeight(DrawContext context) => throw new NotImplementedException(); } private class Utf16CharacterNode : BaseNode @@ -109,7 +109,7 @@ private class Utf16CharacterNode : BaseNode public override int MemorySize => throw new NotImplementedException(); public override void GetUserInterfaceInfo(out string name, out Image icon) => throw new NotImplementedException(); public override Size Draw(DrawContext context, int x, int y) => throw new NotImplementedException(); - public override int CalculateDrawnHeight(DrawContext view) => throw new NotImplementedException(); + public override int CalculateDrawnHeight(DrawContext context) => throw new NotImplementedException(); } private class Utf32CharacterNode : BaseNode @@ -117,7 +117,7 @@ private class Utf32CharacterNode : BaseNode public override int MemorySize => throw new NotImplementedException(); public override void GetUserInterfaceInfo(out string name, out Image icon) => throw new NotImplementedException(); public override Size Draw(DrawContext context, int x, int y) => throw new NotImplementedException(); - public override int CalculateDrawnHeight(DrawContext view) => throw new NotImplementedException(); + public override int CalculateDrawnHeight(DrawContext context) => throw new NotImplementedException(); } #endregion diff --git a/ReClass.NET/DataExchange/ReClass/Legacy/BaseClassArrayNode.cs b/ReClass.NET/DataExchange/ReClass/Legacy/BaseClassArrayNode.cs index 82006a0e..0871658d 100644 --- a/ReClass.NET/DataExchange/ReClass/Legacy/BaseClassArrayNode.cs +++ b/ReClass.NET/DataExchange/ReClass/Legacy/BaseClassArrayNode.cs @@ -14,7 +14,7 @@ public override void GetUserInterfaceInfo(out string name, out Image icon) throw new NotImplementedException(); } - public override int CalculateDrawnHeight(DrawContext view) + public override int CalculateDrawnHeight(DrawContext context) { throw new NotImplementedException(); } diff --git a/ReClass.NET/DataExchange/ReClass/Legacy/ClassPointerNode.cs b/ReClass.NET/DataExchange/ReClass/Legacy/ClassPointerNode.cs index 81588504..243707e8 100644 --- a/ReClass.NET/DataExchange/ReClass/Legacy/ClassPointerNode.cs +++ b/ReClass.NET/DataExchange/ReClass/Legacy/ClassPointerNode.cs @@ -14,7 +14,7 @@ public override void GetUserInterfaceInfo(out string name, out Image icon) throw new NotImplementedException(); } - public override int CalculateDrawnHeight(DrawContext view) + public override int CalculateDrawnHeight(DrawContext context) { throw new NotImplementedException(); } diff --git a/ReClass.NET/DataExchange/ReClass/Legacy/CustomNode.cs b/ReClass.NET/DataExchange/ReClass/Legacy/CustomNode.cs index 42c9bd05..0645f860 100644 --- a/ReClass.NET/DataExchange/ReClass/Legacy/CustomNode.cs +++ b/ReClass.NET/DataExchange/ReClass/Legacy/CustomNode.cs @@ -15,7 +15,7 @@ public override void GetUserInterfaceInfo(out string name, out Image icon) throw new NotImplementedException(); } - public override int CalculateDrawnHeight(DrawContext view) + public override int CalculateDrawnHeight(DrawContext context) { throw new NotImplementedException(); } diff --git a/ReClass.NET/Nodes/ArrayNode.cs b/ReClass.NET/Nodes/ArrayNode.cs index 6c30e194..4a0fbec3 100644 --- a/ReClass.NET/Nodes/ArrayNode.cs +++ b/ReClass.NET/Nodes/ArrayNode.cs @@ -27,14 +27,14 @@ public override Size Draw(DrawContext context, int x, int y) return Draw(context, x, y, "Array"); } - protected override Size DrawChild(DrawContext view, int x, int y) + protected override Size DrawChild(DrawContext context, int x, int y) { - var v = view.Clone(); - v.Address = view.Address + Offset + InnerNode.MemorySize * CurrentIndex; - v.Memory = view.Memory.Clone(); - v.Memory.Offset += Offset + InnerNode.MemorySize * CurrentIndex; + var innerContext = context.Clone(); + innerContext.Address = context.Address + Offset + InnerNode.MemorySize * CurrentIndex; + innerContext.Memory = context.Memory.Clone(); + innerContext.Memory.Offset += Offset + InnerNode.MemorySize * CurrentIndex; - return InnerNode.Draw(v, x, y); + return InnerNode.Draw(innerContext, x, y); } } } diff --git a/ReClass.NET/Nodes/BaseFunctionPtrNode.cs b/ReClass.NET/Nodes/BaseFunctionPtrNode.cs index 577459f7..4fd73a2c 100644 --- a/ReClass.NET/Nodes/BaseFunctionPtrNode.cs +++ b/ReClass.NET/Nodes/BaseFunctionPtrNode.cs @@ -22,68 +22,68 @@ public override string GetToolTipText(HotSpot spot) return string.Join("\n", Instructions.Select(i => i.Instruction)); } - protected Size Draw(DrawContext view, int x, int y, string type, string name) + protected Size Draw(DrawContext context, int x, int y, string type, string name) { - Contract.Requires(view != null); + Contract.Requires(context != null); Contract.Requires(type != null); Contract.Requires(name != null); if (IsHidden && !IsWrapped) { - return DrawHidden(view, x, y); + return DrawHidden(context, x, y); } var origX = x; - AddSelection(view, x, y, view.Font.Height); + AddSelection(context, x, y, context.Font.Height); - x = AddIconPadding(view, x); + x = AddIconPadding(context, x); - x = AddIcon(view, x, y, view.IconProvider.Function, HotSpot.NoneId, HotSpotType.None); + x = AddIcon(context, x, y, context.IconProvider.Function, HotSpot.NoneId, HotSpotType.None); var tx = x; - x = AddAddressOffset(view, x, y); + x = AddAddressOffset(context, x, y); - x = AddText(view, x, y, view.Settings.TypeColor, HotSpot.NoneId, type) + view.Font.Width; + x = AddText(context, x, y, context.Settings.TypeColor, HotSpot.NoneId, type) + context.Font.Width; if (!IsWrapped) { - x = AddText(view, x, y, view.Settings.NameColor, HotSpot.NameId, name) + view.Font.Width; + x = AddText(context, x, y, context.Settings.NameColor, HotSpot.NameId, name) + context.Font.Width; } - x = AddOpenCloseIcon(view, x, y) + view.Font.Width; + x = AddOpenCloseIcon(context, x, y) + context.Font.Width; - x = AddComment(view, x, y); + x = AddComment(context, x, y); - if (view.Settings.ShowCommentSymbol) + if (context.Settings.ShowCommentSymbol) { - var value = view.Memory.ReadIntPtr(Offset); + var value = context.Memory.ReadIntPtr(Offset); - var module = view.Process.GetModuleToPointer(value); + var module = context.Process.GetModuleToPointer(value); if (module != null) { - var symbols = view.Process.Symbols.GetSymbolsForModule(module); + var symbols = context.Process.Symbols.GetSymbolsForModule(module); var symbol = symbols?.GetSymbolString(value, module); if (!string.IsNullOrEmpty(symbol)) { - x = AddText(view, x, y, view.Settings.OffsetColor, HotSpot.ReadOnlyId, symbol); + x = AddText(context, x, y, context.Settings.OffsetColor, HotSpot.ReadOnlyId, symbol); } } } - DrawInvalidMemoryIndicatorIcon(view, y); - AddContextDropDownIcon(view, y); - AddDeleteIcon(view, y); + DrawInvalidMemoryIndicatorIcon(context, y); + AddContextDropDownIcon(context, y); + AddDeleteIcon(context, y); - var size = new Size(x - origX, view.Font.Height); + var size = new Size(x - origX, context.Font.Height); - if (LevelsOpen[view.Level]) + if (LevelsOpen[context.Level]) { - var ptr = view.Memory.ReadIntPtr(Offset); + var ptr = context.Memory.ReadIntPtr(Offset); - DisassembleRemoteCode(view.Process, ptr); + DisassembleRemoteCode(context.Process, ptr); - var instructionSize = DrawInstructions(view, tx, y); + var instructionSize = DrawInstructions(context, tx, y); size.Width = Math.Max(size.Width, instructionSize.Width + tx - origX); size.Height += instructionSize.Height; @@ -92,17 +92,17 @@ protected Size Draw(DrawContext view, int x, int y, string type, string name) return size; } - public override int CalculateDrawnHeight(DrawContext view) + public override int CalculateDrawnHeight(DrawContext context) { if (IsHidden) { return HiddenHeight; } - var height = view.Font.Height; - if (LevelsOpen[view.Level]) + var height = context.Font.Height; + if (LevelsOpen[context.Level]) { - height += Instructions.Count * view.Font.Height; + height += Instructions.Count * context.Font.Height; } return height; } diff --git a/ReClass.NET/Nodes/BaseHexNode.cs b/ReClass.NET/Nodes/BaseHexNode.cs index f57dd68b..060db7da 100644 --- a/ReClass.NET/Nodes/BaseHexNode.cs +++ b/ReClass.NET/Nodes/BaseHexNode.cs @@ -32,53 +32,53 @@ protected BaseHexNode() buffer = new byte[MemorySize]; } - protected Size Draw(DrawContext view, int x, int y, string text, int length) + protected Size Draw(DrawContext context, int x, int y, string text, int length) { - Contract.Requires(view != null); + Contract.Requires(context != null); if (IsHidden && !IsWrapped) { - return DrawHidden(view, x, y); + return DrawHidden(context, x, y); } var origX = x; - AddSelection(view, x, y, view.Font.Height); + AddSelection(context, x, y, context.Font.Height); - x = AddIconPadding(view, x); - x = AddIconPadding(view, x); + x = AddIconPadding(context, x); + x = AddIconPadding(context, x); - x = AddAddressOffset(view, x, y); + x = AddAddressOffset(context, x, y); if (!string.IsNullOrEmpty(text)) { - x = AddText(view, x, y, view.Settings.TextColor, HotSpot.NoneId, text); + x = AddText(context, x, y, context.Settings.TextColor, HotSpot.NoneId, text); } - view.Memory.ReadBytes(Offset, buffer); + context.Memory.ReadBytes(Offset, buffer); - var color = view.Settings.HexColor; - if (view.Settings.HighlightChangedValues) + var color = context.Settings.HexColor; + if (context.Settings.HighlightChangedValues) { - var address = view.Address + Offset; + var address = context.Address + Offset; - highlightTimer.RemoveWhere(kv => kv.Value.Value < view.CurrentTime); + highlightTimer.RemoveWhere(kv => kv.Value.Value < context.CurrentTime); if (highlightTimer.TryGetValue(address, out var until)) { - if (until.Value >= view.CurrentTime) + if (until.Value >= context.CurrentTime) { color = GetRandomHighlightColor(); - if (view.Memory.HasChanged(Offset, MemorySize)) + if (context.Memory.HasChanged(Offset, MemorySize)) { - until.Value = view.CurrentTime.Add(hightlightDuration); + until.Value = context.CurrentTime.Add(hightlightDuration); } } } - else if (view.Memory.HasChanged(Offset, MemorySize)) + else if (context.Memory.HasChanged(Offset, MemorySize)) { - highlightTimer.Add(address, view.CurrentTime.Add(hightlightDuration)); + highlightTimer.Add(address, context.CurrentTime.Add(hightlightDuration)); color = GetRandomHighlightColor(); } @@ -86,21 +86,21 @@ protected Size Draw(DrawContext view, int x, int y, string text, int length) for (var i = 0; i < length; ++i) { - x = AddText(view, x, y, color, i, $"{buffer[i]:X02}") + view.Font.Width; + x = AddText(context, x, y, color, i, $"{buffer[i]:X02}") + context.Font.Width; } - x = AddComment(view, x, y); + x = AddComment(context, x, y); - DrawInvalidMemoryIndicatorIcon(view, y); - AddContextDropDownIcon(view, y); - AddDeleteIcon(view, y); + DrawInvalidMemoryIndicatorIcon(context, y); + AddContextDropDownIcon(context, y); + AddDeleteIcon(context, y); - return new Size(x - origX, view.Font.Height); + return new Size(x - origX, context.Font.Height); } - public override int CalculateDrawnHeight(DrawContext view) + public override int CalculateDrawnHeight(DrawContext context) { - return IsHidden && !IsWrapped ? HiddenHeight : view.Font.Height; + return IsHidden && !IsWrapped ? HiddenHeight : context.Font.Height; } /// Updates the node from the given spot. Sets the value of the selected byte. diff --git a/ReClass.NET/Nodes/BaseMatrixNode.cs b/ReClass.NET/Nodes/BaseMatrixNode.cs index ac964051..d97d7bc0 100644 --- a/ReClass.NET/Nodes/BaseMatrixNode.cs +++ b/ReClass.NET/Nodes/BaseMatrixNode.cs @@ -17,115 +17,115 @@ protected BaseMatrixNode() protected delegate void DrawMatrixValues(int x, ref int maxX, ref int y); - protected Size DrawMatrixType(DrawContext view, int x, int y, string type, DrawMatrixValues drawValues) + protected Size DrawMatrixType(DrawContext context, int x, int y, string type, DrawMatrixValues drawValues) { - Contract.Requires(view != null); + Contract.Requires(context != null); Contract.Requires(type != null); Contract.Requires(drawValues != null); if (IsHidden && !IsWrapped) { - return DrawHidden(view, x, y); + return DrawHidden(context, x, y); } var origX = x; var origY = y; - AddSelection(view, x, y, view.Font.Height); + AddSelection(context, x, y, context.Font.Height); - x = AddIconPadding(view, x); + x = AddIconPadding(context, x); - x = AddIcon(view, x, y, view.IconProvider.Matrix, HotSpot.NoneId, HotSpotType.None); + x = AddIcon(context, x, y, context.IconProvider.Matrix, HotSpot.NoneId, HotSpotType.None); var tx = x; - x = AddAddressOffset(view, x, y); + x = AddAddressOffset(context, x, y); - x = AddText(view, x, y, view.Settings.TypeColor, HotSpot.NoneId, type) + view.Font.Width; + x = AddText(context, x, y, context.Settings.TypeColor, HotSpot.NoneId, type) + context.Font.Width; if (!IsWrapped) { - x = AddText(view, x, y, view.Settings.NameColor, HotSpot.NameId, Name); + x = AddText(context, x, y, context.Settings.NameColor, HotSpot.NameId, Name); } - x = AddOpenCloseIcon(view, x, y); + x = AddOpenCloseIcon(context, x, y); - x += view.Font.Width; + x += context.Font.Width; - x = AddComment(view, x, y); + x = AddComment(context, x, y); - DrawInvalidMemoryIndicatorIcon(view, y); - AddContextDropDownIcon(view, y); - AddDeleteIcon(view, y); + DrawInvalidMemoryIndicatorIcon(context, y); + AddContextDropDownIcon(context, y); + AddDeleteIcon(context, y); - if (LevelsOpen[view.Level]) + if (LevelsOpen[context.Level]) { drawValues(tx, ref x, ref y); } - return new Size(x - origX, y - origY + view.Font.Height); + return new Size(x - origX, y - origY + context.Font.Height); } protected delegate void DrawVectorValues(ref int x, ref int y); - protected Size DrawVectorType(DrawContext view, int x, int y, string type, DrawVectorValues drawValues) + protected Size DrawVectorType(DrawContext context, int x, int y, string type, DrawVectorValues drawValues) { - Contract.Requires(view != null); + Contract.Requires(context != null); Contract.Requires(type != null); Contract.Requires(drawValues != null); if (IsHidden && !IsWrapped) { - return DrawHidden(view, x, y); + return DrawHidden(context, x, y); } - DrawInvalidMemoryIndicatorIcon(view, y); + DrawInvalidMemoryIndicatorIcon(context, y); var origX = x; var origY = y; - AddSelection(view, x, y, view.Font.Height); + AddSelection(context, x, y, context.Font.Height); - x = AddIconPadding(view, x); + x = AddIconPadding(context, x); - x = AddIcon(view, x, y, view.IconProvider.Vector, HotSpot.NoneId, HotSpotType.None); - x = AddAddressOffset(view, x, y); + x = AddIcon(context, x, y, context.IconProvider.Vector, HotSpot.NoneId, HotSpotType.None); + x = AddAddressOffset(context, x, y); - x = AddText(view, x, y, view.Settings.TypeColor, HotSpot.NoneId, type) + view.Font.Width; + x = AddText(context, x, y, context.Settings.TypeColor, HotSpot.NoneId, type) + context.Font.Width; if (!IsWrapped) { - x = AddText(view, x, y, view.Settings.NameColor, HotSpot.NameId, Name); + x = AddText(context, x, y, context.Settings.NameColor, HotSpot.NameId, Name); } - x = AddOpenCloseIcon(view, x, y); + x = AddOpenCloseIcon(context, x, y); - if (LevelsOpen[view.Level]) + if (LevelsOpen[context.Level]) { drawValues(ref x, ref y); } - x += view.Font.Width; + x += context.Font.Width; - x = AddComment(view, x, y); + x = AddComment(context, x, y); - AddContextDropDownIcon(view, y); - AddDeleteIcon(view, y); + AddContextDropDownIcon(context, y); + AddDeleteIcon(context, y); - return new Size(x - origX, y - origY + view.Font.Height); + return new Size(x - origX, y - origY + context.Font.Height); } - public override int CalculateDrawnHeight(DrawContext view) + public override int CalculateDrawnHeight(DrawContext context) { if (IsHidden && !IsWrapped) { return HiddenHeight; } - var height = view.Font.Height; - if (LevelsOpen[view.Level]) + var height = context.Font.Height; + if (LevelsOpen[context.Level]) { - height += CalculateValuesHeight(view); + height += CalculateValuesHeight(context); } return height; } - protected abstract int CalculateValuesHeight(DrawContext view); + protected abstract int CalculateValuesHeight(DrawContext context); public void Update(HotSpot spot, int max) { diff --git a/ReClass.NET/Nodes/BaseNode.cs b/ReClass.NET/Nodes/BaseNode.cs index 41c1cd49..adef39e5 100644 --- a/ReClass.NET/Nodes/BaseNode.cs +++ b/ReClass.NET/Nodes/BaseNode.cs @@ -232,9 +232,9 @@ public virtual void ClearSelection() /// This method is used to determine if a node outside the visible area should be drawn. /// The returned height must be equal to the height which is returned by the method. ///
- /// The drawing context. + /// The drawing context. /// The calculated height. - public abstract int CalculateDrawnHeight(DrawContext view); + public abstract int CalculateDrawnHeight(DrawContext context); /// Updates the node from the given . Sets the and of the node. /// The spot. @@ -268,62 +268,62 @@ internal void SetLevelOpen(int level, bool open) } /// Adds a the user can interact with. - /// The drawing context. + /// The drawing context. /// The spot. /// The text to edit. /// The id of the spot. /// The type of the spot. - protected void AddHotSpot(DrawContext view, Rectangle spot, string text, int id, HotSpotType type) + protected void AddHotSpot(DrawContext context, Rectangle spot, string text, int id, HotSpotType type) { - Contract.Requires(view != null); - Contract.Requires(view.Memory != null); + Contract.Requires(context != null); + Contract.Requires(context.Memory != null); Contract.Requires(text != null); - if (spot.Top > view.ClientArea.Bottom || spot.Bottom < 0) + if (spot.Top > context.ClientArea.Bottom || spot.Bottom < 0) { return; } - view.HotSpots.Add(new HotSpot + context.HotSpots.Add(new HotSpot { Rect = spot, Text = text, - Address = view.Address + Offset, + Address = context.Address + Offset, Id = id, Type = type, Node = this, - Level = view.Level, - Process = view.Process, - Memory = view.Memory + Level = context.Level, + Process = context.Process, + Memory = context.Memory }); } /// Draws the specific text and adds a if is not . - /// The drawing context. + /// The drawing context. /// The x coordinate. /// The y coordinate. /// The color of the text. /// Id for the clickable area. /// The text to draw. /// The new x coordinate after drawing the text. - protected int AddText(DrawContext view, int x, int y, Color color, int hitId, string text) + protected int AddText(DrawContext context, int x, int y, Color color, int hitId, string text) { - Contract.Requires(view != null); - Contract.Requires(view.Graphics != null); - Contract.Requires(view.Font != null); + Contract.Requires(context != null); + Contract.Requires(context.Graphics != null); + Contract.Requires(context.Font != null); Contract.Requires(text != null); - var width = Math.Max(text.Length, hitId != HotSpot.NoneId ? 1 : 0) * view.Font.Width; + var width = Math.Max(text.Length, hitId != HotSpot.NoneId ? 1 : 0) * context.Font.Width; - if (y >= -view.Font.Height && y + view.Font.Height <= view.ClientArea.Bottom + view.Font.Height) + if (y >= -context.Font.Height && y + context.Font.Height <= context.ClientArea.Bottom + context.Font.Height) { if (hitId != HotSpot.NoneId) { - var rect = new Rectangle(x, y, width, view.Font.Height); - AddHotSpot(view, rect, text, hitId, HotSpotType.Edit); + var rect = new Rectangle(x, y, width, context.Font.Height); + AddHotSpot(context, rect, text, hitId, HotSpotType.Edit); } - view.Graphics.DrawStringEx(text, view.Font.Font, color, x, y); + context.Graphics.DrawStringEx(text, context.Font.Font, color, x, y); /*using (var brush = new SolidBrush(color)) { context.Graphics.DrawString(text, context.Font.Font, brush, x, y); @@ -334,52 +334,52 @@ protected int AddText(DrawContext view, int x, int y, Color color, int hitId, st } /// Draws the address and of the node. - /// The drawing context. + /// The drawing context. /// The x coordinate. /// The y coordinate. /// The new x coordinate after drawing the text. - protected int AddAddressOffset(DrawContext view, int x, int y) + protected int AddAddressOffset(DrawContext context, int x, int y) { - Contract.Requires(view != null); - Contract.Requires(view.Graphics != null); - Contract.Requires(view.Font != null); + Contract.Requires(context != null); + Contract.Requires(context.Graphics != null); + Contract.Requires(context.Font != null); - if (view.Settings.ShowNodeOffset) + if (context.Settings.ShowNodeOffset) { - x = AddText(view, x, y, view.Settings.OffsetColor, HotSpot.NoneId, $"{Offset:X04}") + view.Font.Width; + x = AddText(context, x, y, context.Settings.OffsetColor, HotSpot.NoneId, $"{Offset:X04}") + context.Font.Width; } - if (view.Settings.ShowNodeAddress) + if (context.Settings.ShowNodeAddress) { - x = AddText(view, x, y, view.Settings.AddressColor, HotSpot.AddressId, (view.Address + Offset).ToString(Constants.AddressHexFormat)) + view.Font.Width; + x = AddText(context, x, y, context.Settings.AddressColor, HotSpot.AddressId, (context.Address + Offset).ToString(Constants.AddressHexFormat)) + context.Font.Width; } return x; } /// Draws a bar which indicates the selection status of the node. A for this area gets added too. - /// The drawing context. + /// The drawing context. /// The x coordinate. /// The y coordinate. /// The height of the bar. - protected void AddSelection(DrawContext view, int x, int y, int height) + protected void AddSelection(DrawContext context, int x, int y, int height) { - Contract.Requires(view != null); - Contract.Requires(view.Graphics != null); + Contract.Requires(context != null); + Contract.Requires(context.Graphics != null); - if (y > view.ClientArea.Bottom || y + height < 0 || IsWrapped) + if (y > context.ClientArea.Bottom || y + height < 0 || IsWrapped) { return; } if (IsSelected) { - using var brush = new SolidBrush(view.Settings.SelectedColor); + using var brush = new SolidBrush(context.Settings.SelectedColor); - view.Graphics.FillRectangle(brush, 0, y, view.ClientArea.Right, height); + context.Graphics.FillRectangle(brush, 0, y, context.ClientArea.Right, height); } - AddHotSpot(view, new Rectangle(0, y, view.ClientArea.Right - (IsSelected ? 16 : 0), height), string.Empty, HotSpot.NoneId, HotSpotType.Select); + AddHotSpot(context, new Rectangle(0, y, context.ClientArea.Right - (IsSelected ? 16 : 0), height), string.Empty, HotSpot.NoneId, HotSpotType.Select); } protected int AddIconPadding(DrawContext view, int x) @@ -388,136 +388,136 @@ protected int AddIconPadding(DrawContext view, int x) } /// Draws an icon and adds a if is not . - /// The drawing context. + /// The drawing context. /// The x coordinate. /// The y coordinate. /// The icon. /// The id of the spot. /// The type of the spot. /// The new x coordinate after drawing the icon. - protected int AddIcon(DrawContext view, int x, int y, Image icon, int id, HotSpotType type) + protected int AddIcon(DrawContext context, int x, int y, Image icon, int id, HotSpotType type) { - Contract.Requires(view != null); - Contract.Requires(view.Graphics != null); + Contract.Requires(context != null); + Contract.Requires(context.Graphics != null); Contract.Requires(icon != null); - var size = view.IconProvider.Dimensions; + var size = context.IconProvider.Dimensions; - if (y > view.ClientArea.Bottom || y + size < 0) + if (y > context.ClientArea.Bottom || y + size < 0) { return x + size; } - view.Graphics.DrawImage(icon, x + 2, y, size, size); + context.Graphics.DrawImage(icon, x + 2, y, size, size); if (id != HotSpot.NoneId) { - AddHotSpot(view, new Rectangle(x, y, size, size), string.Empty, id, type); + AddHotSpot(context, new Rectangle(x, y, size, size), string.Empty, id, type); } return x + size; } /// Adds a togglable Open/Close icon. - /// The drawing context. + /// The drawing context. /// The x coordinate. /// The y coordinate. /// The new x coordinate after drawing the icon. - protected int AddOpenCloseIcon(DrawContext view, int x, int y) + protected int AddOpenCloseIcon(DrawContext context, int x, int y) { - Contract.Requires(view != null); - Contract.Requires(view.Graphics != null); + Contract.Requires(context != null); + Contract.Requires(context.Graphics != null); - if (y > view.ClientArea.Bottom || y + view.IconProvider.Dimensions < 0) + if (y > context.ClientArea.Bottom || y + context.IconProvider.Dimensions < 0) { - return x + view.IconProvider.Dimensions; + return x + context.IconProvider.Dimensions; } - var icon = LevelsOpen[view.Level] ? view.IconProvider.OpenCloseOpen : view.IconProvider.OpenCloseClosed; - return AddIcon(view, x, y, icon, 0, HotSpotType.OpenClose); + var icon = LevelsOpen[context.Level] ? context.IconProvider.OpenCloseOpen : context.IconProvider.OpenCloseClosed; + return AddIcon(context, x, y, icon, 0, HotSpotType.OpenClose); } /// Draws a context drop icon if the node is selected. - /// The drawing context. + /// The drawing context. /// The y coordinate. - protected void AddContextDropDownIcon(DrawContext view, int y) + protected void AddContextDropDownIcon(DrawContext context, int y) { - Contract.Requires(view != null); - Contract.Requires(view.Graphics != null); + Contract.Requires(context != null); + Contract.Requires(context.Graphics != null); - if (view.MultipleNodesSelected || y > view.ClientArea.Bottom || y + view.IconProvider.Dimensions < 0 || IsWrapped) + if (context.MultipleNodesSelected || y > context.ClientArea.Bottom || y + context.IconProvider.Dimensions < 0 || IsWrapped) { return; } if (IsSelected) { - AddIcon(view, 0, y, view.IconProvider.DropArrow, 0, HotSpotType.Context); + AddIcon(context, 0, y, context.IconProvider.DropArrow, 0, HotSpotType.Context); } } /// Draws a delete icon if the node is selected. - /// The drawing context. + /// The drawing context. /// The y coordinate. - protected void AddDeleteIcon(DrawContext view, int y) + protected void AddDeleteIcon(DrawContext context, int y) { - Contract.Requires(view != null); - Contract.Requires(view.Graphics != null); + Contract.Requires(context != null); + Contract.Requires(context.Graphics != null); - if (y > view.ClientArea.Bottom || y + view.IconProvider.Dimensions < 0 || IsWrapped) + if (y > context.ClientArea.Bottom || y + context.IconProvider.Dimensions < 0 || IsWrapped) { return; } if (IsSelected) { - AddIcon(view, view.ClientArea.Right - view.IconProvider.Dimensions, y, view.IconProvider.Delete, 0, HotSpotType.Delete); + AddIcon(context, context.ClientArea.Right - context.IconProvider.Dimensions, y, context.IconProvider.Delete, 0, HotSpotType.Delete); } } /// Draws the . - /// The drawing context. + /// The drawing context. /// The x coordinate. /// The y coordinate. /// The new x coordinate after drawing the comment. - protected virtual int AddComment(DrawContext view, int x, int y) + protected virtual int AddComment(DrawContext context, int x, int y) { - Contract.Requires(view != null); - Contract.Requires(view.Graphics != null); - Contract.Requires(view.Font != null); + Contract.Requires(context != null); + Contract.Requires(context.Graphics != null); + Contract.Requires(context.Font != null); - x = AddText(view, x, y, view.Settings.CommentColor, HotSpot.NoneId, "//"); - x = AddText(view, x, y, view.Settings.CommentColor, HotSpot.CommentId, Comment) + view.Font.Width; + x = AddText(context, x, y, context.Settings.CommentColor, HotSpot.NoneId, "//"); + x = AddText(context, x, y, context.Settings.CommentColor, HotSpot.CommentId, Comment) + context.Font.Width; return x; } /// Draws a vertical line to show the hidden state. - /// The drawing context. + /// The drawing context. /// The x coordinate. /// The y coordinate. /// The size of the drawing. - protected Size DrawHidden(DrawContext view, int x, int y) + protected Size DrawHidden(DrawContext context, int x, int y) { - Contract.Requires(view != null); - Contract.Requires(view.Graphics != null); + Contract.Requires(context != null); + Contract.Requires(context.Graphics != null); - using (var brush = new SolidBrush(IsSelected ? view.Settings.SelectedColor : view.Settings.HiddenColor)) + using (var brush = new SolidBrush(IsSelected ? context.Settings.SelectedColor : context.Settings.HiddenColor)) { - view.Graphics.FillRectangle(brush, 0, y, view.ClientArea.Right, 1); + context.Graphics.FillRectangle(brush, 0, y, context.ClientArea.Right, 1); } return new Size(0, HiddenHeight); } /// Draws an error indicator if the used memory buffer is not valid. - /// The drawing context. + /// The drawing context. /// The y coordinate. - protected void DrawInvalidMemoryIndicatorIcon(DrawContext view, int y) + protected void DrawInvalidMemoryIndicatorIcon(DrawContext context, int y) { - if (!view.Memory.ContainsValidData) + if (!context.Memory.ContainsValidData) { - AddIcon(view, 0, y, Properties.Resources.B16x16_Error, HotSpot.NoneId, HotSpotType.None); + AddIcon(context, 0, y, Properties.Resources.B16x16_Error, HotSpot.NoneId, HotSpotType.None); } } } @@ -542,9 +542,9 @@ public override Size Draw(DrawContext context, int x, int y) throw new NotImplementedException(); } - public override int CalculateDrawnHeight(DrawContext view) + public override int CalculateDrawnHeight(DrawContext context) { - Contract.Requires(view != null); + Contract.Requires(context != null); throw new NotImplementedException(); } diff --git a/ReClass.NET/Nodes/BaseNumericNode.cs b/ReClass.NET/Nodes/BaseNumericNode.cs index ae223dee..61782ca6 100644 --- a/ReClass.NET/Nodes/BaseNumericNode.cs +++ b/ReClass.NET/Nodes/BaseNumericNode.cs @@ -8,7 +8,7 @@ namespace ReClassNET.Nodes public abstract class BaseNumericNode : BaseNode { /// Draws the node. - /// The drawing context. + /// The drawing context. /// The x coordinate. /// The y coordinate. /// The icon of the node. @@ -16,51 +16,51 @@ public abstract class BaseNumericNode : BaseNode /// The value of the node. /// An alternative value of the node. /// The pixel size the node occupies. - protected Size DrawNumeric(DrawContext view, int x, int y, Image icon, string type, string value, string alternativeValue) + protected Size DrawNumeric(DrawContext context, int x, int y, Image icon, string type, string value, string alternativeValue) { - Contract.Requires(view != null); + Contract.Requires(context != null); Contract.Requires(icon != null); Contract.Requires(type != null); Contract.Requires(value != null); if (IsHidden && !IsWrapped) { - return DrawHidden(view, x, y); + return DrawHidden(context, x, y); } var origX = x; - AddSelection(view, x, y, view.Font.Height); + AddSelection(context, x, y, context.Font.Height); - x = AddIconPadding(view, x); + x = AddIconPadding(context, x); - x = AddIcon(view, x, y, icon, HotSpot.NoneId, HotSpotType.None); - x = AddAddressOffset(view, x, y); + x = AddIcon(context, x, y, icon, HotSpot.NoneId, HotSpotType.None); + x = AddAddressOffset(context, x, y); - x = AddText(view, x, y, view.Settings.TypeColor, HotSpot.NoneId, type) + view.Font.Width; + x = AddText(context, x, y, context.Settings.TypeColor, HotSpot.NoneId, type) + context.Font.Width; if (!IsWrapped) { - x = AddText(view, x, y, view.Settings.NameColor, HotSpot.NameId, Name) + view.Font.Width; + x = AddText(context, x, y, context.Settings.NameColor, HotSpot.NameId, Name) + context.Font.Width; } - x = AddText(view, x, y, view.Settings.NameColor, HotSpot.NoneId, "=") + view.Font.Width; - x = AddText(view, x, y, view.Settings.ValueColor, 0, value) + view.Font.Width; + x = AddText(context, x, y, context.Settings.NameColor, HotSpot.NoneId, "=") + context.Font.Width; + x = AddText(context, x, y, context.Settings.ValueColor, 0, value) + context.Font.Width; if (alternativeValue != null) { - x = AddText(view, x, y, view.Settings.ValueColor, 1, alternativeValue) + view.Font.Width; + x = AddText(context, x, y, context.Settings.ValueColor, 1, alternativeValue) + context.Font.Width; } - x = AddComment(view, x, y); + x = AddComment(context, x, y); - DrawInvalidMemoryIndicatorIcon(view, y); - AddContextDropDownIcon(view, y); - AddDeleteIcon(view, y); + DrawInvalidMemoryIndicatorIcon(context, y); + AddContextDropDownIcon(context, y); + AddDeleteIcon(context, y); - return new Size(x - origX, view.Font.Height); + return new Size(x - origX, context.Font.Height); } - public override int CalculateDrawnHeight(DrawContext view) + public override int CalculateDrawnHeight(DrawContext context) { - return IsHidden && !IsWrapped ? HiddenHeight : view.Font.Height; + return IsHidden && !IsWrapped ? HiddenHeight : context.Font.Height; } } } diff --git a/ReClass.NET/Nodes/BaseTextNode.cs b/ReClass.NET/Nodes/BaseTextNode.cs index 213e0034..d395b24d 100644 --- a/ReClass.NET/Nodes/BaseTextNode.cs +++ b/ReClass.NET/Nodes/BaseTextNode.cs @@ -25,53 +25,53 @@ public override void CopyFromNode(BaseNode node) Length = node.MemorySize / CharacterSize; } - protected Size DrawText(DrawContext view, int x, int y, string type) + protected Size DrawText(DrawContext context, int x, int y, string type) { - Contract.Requires(view != null); + Contract.Requires(context != null); Contract.Requires(type != null); if (IsHidden && !IsWrapped) { - return DrawHidden(view, x, y); + return DrawHidden(context, x, y); } var length = MemorySize / CharacterSize; - var text = ReadValueFromMemory(view.Memory); + var text = ReadValueFromMemory(context.Memory); var origX = x; - AddSelection(view, x, y, view.Font.Height); + AddSelection(context, x, y, context.Font.Height); - x = AddIconPadding(view, x); + x = AddIconPadding(context, x); - x = AddIcon(view, x, y, view.IconProvider.Text, HotSpot.NoneId, HotSpotType.None); - x = AddAddressOffset(view, x, y); + x = AddIcon(context, x, y, context.IconProvider.Text, HotSpot.NoneId, HotSpotType.None); + x = AddAddressOffset(context, x, y); - x = AddText(view, x, y, view.Settings.TypeColor, HotSpot.NoneId, type) + view.Font.Width; + x = AddText(context, x, y, context.Settings.TypeColor, HotSpot.NoneId, type) + context.Font.Width; if (!IsWrapped) { - x = AddText(view, x, y, view.Settings.NameColor, HotSpot.NameId, Name); + x = AddText(context, x, y, context.Settings.NameColor, HotSpot.NameId, Name); } - x = AddText(view, x, y, view.Settings.IndexColor, HotSpot.NoneId, "["); - x = AddText(view, x, y, view.Settings.IndexColor, 0, length.ToString()); - x = AddText(view, x, y, view.Settings.IndexColor, HotSpot.NoneId, "]") + view.Font.Width; + x = AddText(context, x, y, context.Settings.IndexColor, HotSpot.NoneId, "["); + x = AddText(context, x, y, context.Settings.IndexColor, 0, length.ToString()); + x = AddText(context, x, y, context.Settings.IndexColor, HotSpot.NoneId, "]") + context.Font.Width; - x = AddText(view, x, y, view.Settings.TextColor, HotSpot.NoneId, "= '"); - x = AddText(view, x, y, view.Settings.TextColor, 1, text.LimitLength(150)); - x = AddText(view, x, y, view.Settings.TextColor, HotSpot.NoneId, "'") + view.Font.Width; + x = AddText(context, x, y, context.Settings.TextColor, HotSpot.NoneId, "= '"); + x = AddText(context, x, y, context.Settings.TextColor, 1, text.LimitLength(150)); + x = AddText(context, x, y, context.Settings.TextColor, HotSpot.NoneId, "'") + context.Font.Width; - x = AddComment(view, x, y); + x = AddComment(context, x, y); - DrawInvalidMemoryIndicatorIcon(view, y); - AddContextDropDownIcon(view, y); - AddDeleteIcon(view, y); + DrawInvalidMemoryIndicatorIcon(context, y); + AddContextDropDownIcon(context, y); + AddDeleteIcon(context, y); - return new Size(x - origX, view.Font.Height); + return new Size(x - origX, context.Font.Height); } - public override int CalculateDrawnHeight(DrawContext view) + public override int CalculateDrawnHeight(DrawContext context) { - return IsHidden && !IsWrapped ? HiddenHeight : view.Font.Height; + return IsHidden && !IsWrapped ? HiddenHeight : context.Font.Height; } public override void Update(HotSpot spot) diff --git a/ReClass.NET/Nodes/BaseTextPtrNode.cs b/ReClass.NET/Nodes/BaseTextPtrNode.cs index 2afd4974..95096602 100644 --- a/ReClass.NET/Nodes/BaseTextPtrNode.cs +++ b/ReClass.NET/Nodes/BaseTextPtrNode.cs @@ -17,55 +17,55 @@ public abstract class BaseTextPtrNode : BaseNode public abstract Encoding Encoding { get; } /// Draws this node. - /// The drawing context. + /// The drawing context. /// The x coordinate. /// The y coordinate. /// The name of the type. /// The pixel size the node occupies. - public Size DrawText(DrawContext view, int x, int y, string type) + public Size DrawText(DrawContext context, int x, int y, string type) { - Contract.Requires(view != null); + Contract.Requires(context != null); Contract.Requires(type != null); if (IsHidden && !IsWrapped) { - return DrawHidden(view, x, y); + return DrawHidden(context, x, y); } - var ptr = view.Memory.ReadIntPtr(Offset); - var text = view.Process.ReadRemoteString(Encoding, ptr, MaxStringCharacterCount); + var ptr = context.Memory.ReadIntPtr(Offset); + var text = context.Process.ReadRemoteString(Encoding, ptr, MaxStringCharacterCount); var origX = x; - AddSelection(view, x, y, view.Font.Height); + AddSelection(context, x, y, context.Font.Height); - x = AddIconPadding(view, x); + x = AddIconPadding(context, x); - x = AddIcon(view, x, y, view.IconProvider.Text, HotSpot.NoneId, HotSpotType.None); - x = AddAddressOffset(view, x, y); + x = AddIcon(context, x, y, context.IconProvider.Text, HotSpot.NoneId, HotSpotType.None); + x = AddAddressOffset(context, x, y); - x = AddText(view, x, y, view.Settings.TypeColor, HotSpot.NoneId, type) + view.Font.Width; + x = AddText(context, x, y, context.Settings.TypeColor, HotSpot.NoneId, type) + context.Font.Width; if (!IsWrapped) { - x = AddText(view, x, y, view.Settings.NameColor, HotSpot.NameId, Name) + view.Font.Width; + x = AddText(context, x, y, context.Settings.NameColor, HotSpot.NameId, Name) + context.Font.Width; } - x = AddText(view, x, y, view.Settings.TextColor, HotSpot.NoneId, "= '"); - x = AddText(view, x, y, view.Settings.TextColor, HotSpot.ReadOnlyId, text); - x = AddText(view, x, y, view.Settings.TextColor, HotSpot.NoneId, "'") + view.Font.Width; + x = AddText(context, x, y, context.Settings.TextColor, HotSpot.NoneId, "= '"); + x = AddText(context, x, y, context.Settings.TextColor, HotSpot.ReadOnlyId, text); + x = AddText(context, x, y, context.Settings.TextColor, HotSpot.NoneId, "'") + context.Font.Width; - x = AddComment(view, x, y); + x = AddComment(context, x, y); - DrawInvalidMemoryIndicatorIcon(view, y); - AddContextDropDownIcon(view, y); - AddDeleteIcon(view, y); + DrawInvalidMemoryIndicatorIcon(context, y); + AddContextDropDownIcon(context, y); + AddDeleteIcon(context, y); - return new Size(x - origX, view.Font.Height); + return new Size(x - origX, context.Font.Height); } - public override int CalculateDrawnHeight(DrawContext view) + public override int CalculateDrawnHeight(DrawContext context) { - return IsHidden && !IsWrapped ? HiddenHeight : view.Font.Height; + return IsHidden && !IsWrapped ? HiddenHeight : context.Font.Height; } } } diff --git a/ReClass.NET/Nodes/BaseWrapperArrayNode.cs b/ReClass.NET/Nodes/BaseWrapperArrayNode.cs index 62ac318c..52d5d948 100644 --- a/ReClass.NET/Nodes/BaseWrapperArrayNode.cs +++ b/ReClass.NET/Nodes/BaseWrapperArrayNode.cs @@ -28,55 +28,55 @@ public override bool CanChangeInnerNodeTo(BaseNode node) return true; } - protected Size Draw(DrawContext view, int x, int y, string type) + protected Size Draw(DrawContext context, int x, int y, string type) { if (IsHidden && !IsWrapped) { - return DrawHidden(view, x, y); + return DrawHidden(context, x, y); } var origX = x; - AddSelection(view, x, y, view.Font.Height); + AddSelection(context, x, y, context.Font.Height); - x = AddOpenCloseIcon(view, x, y); - x = AddIcon(view, x, y, view.IconProvider.Array, HotSpot.NoneId, HotSpotType.None); + x = AddOpenCloseIcon(context, x, y); + x = AddIcon(context, x, y, context.IconProvider.Array, HotSpot.NoneId, HotSpotType.None); var tx = x; - x = AddAddressOffset(view, x, y); + x = AddAddressOffset(context, x, y); - x = AddText(view, x, y, view.Settings.TypeColor, HotSpot.NoneId, type) + view.Font.Width; + x = AddText(context, x, y, context.Settings.TypeColor, HotSpot.NoneId, type) + context.Font.Width; if (!IsWrapped) { - x = AddText(view, x, y, view.Settings.NameColor, HotSpot.NameId, Name); + x = AddText(context, x, y, context.Settings.NameColor, HotSpot.NameId, Name); } - x = AddText(view, x, y, view.Settings.IndexColor, HotSpot.NoneId, "["); - x = AddText(view, x, y, view.Settings.IndexColor, IsReadOnly ? HotSpot.NoneId : 0, Count.ToString()); - x = AddText(view, x, y, view.Settings.IndexColor, HotSpot.NoneId, "]"); + x = AddText(context, x, y, context.Settings.IndexColor, HotSpot.NoneId, "["); + x = AddText(context, x, y, context.Settings.IndexColor, IsReadOnly ? HotSpot.NoneId : 0, Count.ToString()); + x = AddText(context, x, y, context.Settings.IndexColor, HotSpot.NoneId, "]"); - x = AddIcon(view, x, y, view.IconProvider.LeftArrow, 2, HotSpotType.Click); - x = AddText(view, x, y, view.Settings.IndexColor, HotSpot.NoneId, "("); - x = AddText(view, x, y, view.Settings.IndexColor, 1, CurrentIndex.ToString()); - x = AddText(view, x, y, view.Settings.IndexColor, HotSpot.NoneId, ")"); - x = AddIcon(view, x, y, view.IconProvider.RightArrow, 3, HotSpotType.Click) + view.Font.Width; + x = AddIcon(context, x, y, context.IconProvider.LeftArrow, 2, HotSpotType.Click); + x = AddText(context, x, y, context.Settings.IndexColor, HotSpot.NoneId, "("); + x = AddText(context, x, y, context.Settings.IndexColor, 1, CurrentIndex.ToString()); + x = AddText(context, x, y, context.Settings.IndexColor, HotSpot.NoneId, ")"); + x = AddIcon(context, x, y, context.IconProvider.RightArrow, 3, HotSpotType.Click) + context.Font.Width; - x = AddText(view, x, y, view.Settings.ValueColor, HotSpot.NoneId, $"") + view.Font.Width; - x = AddIcon(view, x + 2, y, view.IconProvider.Change, 4, HotSpotType.ChangeWrappedType); + x = AddText(context, x, y, context.Settings.ValueColor, HotSpot.NoneId, $"") + context.Font.Width; + x = AddIcon(context, x + 2, y, context.IconProvider.Change, 4, HotSpotType.ChangeWrappedType); - x += view.Font.Width; - x = AddComment(view, x, y); + x += context.Font.Width; + x = AddComment(context, x, y); - DrawInvalidMemoryIndicatorIcon(view, y); - AddContextDropDownIcon(view, y); - AddDeleteIcon(view, y); + DrawInvalidMemoryIndicatorIcon(context, y); + AddContextDropDownIcon(context, y); + AddDeleteIcon(context, y); - y += view.Font.Height; + y += context.Font.Height; - var size = new Size(x - origX, view.Font.Height); + var size = new Size(x - origX, context.Font.Height); - if (LevelsOpen[view.Level]) + if (LevelsOpen[context.Level]) { - var childSize = DrawChild(view, tx, y); + var childSize = DrawChild(context, tx, y); size.Width = Math.Max(size.Width, childSize.Width + tx - origX); size.Height += childSize.Height; @@ -85,19 +85,19 @@ protected Size Draw(DrawContext view, int x, int y, string type) return size; } - protected abstract Size DrawChild(DrawContext view, int x, int y); + protected abstract Size DrawChild(DrawContext context, int x, int y); - public override int CalculateDrawnHeight(DrawContext view) + public override int CalculateDrawnHeight(DrawContext context) { if (IsHidden && !IsWrapped) { return HiddenHeight; } - var height = view.Font.Height; - if (LevelsOpen[view.Level]) + var height = context.Font.Height; + if (LevelsOpen[context.Level]) { - height += InnerNode.CalculateDrawnHeight(view); + height += InnerNode.CalculateDrawnHeight(context); } return height; } diff --git a/ReClass.NET/Nodes/BitFieldNode.cs b/ReClass.NET/Nodes/BitFieldNode.cs index cf44700a..7255e0e3 100644 --- a/ReClass.NET/Nodes/BitFieldNode.cs +++ b/ReClass.NET/Nodes/BitFieldNode.cs @@ -177,17 +177,17 @@ public override Size Draw(DrawContext context, int x, int y) return new Size(x - origX, y - origY + context.Font.Height); } - public override int CalculateDrawnHeight(DrawContext view) + public override int CalculateDrawnHeight(DrawContext context) { if (IsHidden && !IsWrapped) { return HiddenHeight; } - var height = view.Font.Height; - if (LevelsOpen[view.Level]) + var height = context.Font.Height; + if (LevelsOpen[context.Level]) { - height += view.Font.Height + 2; + height += context.Font.Height + 2; } return height; } diff --git a/ReClass.NET/Nodes/BoolNode.cs b/ReClass.NET/Nodes/BoolNode.cs index 44e17e0a..076c0d48 100644 --- a/ReClass.NET/Nodes/BoolNode.cs +++ b/ReClass.NET/Nodes/BoolNode.cs @@ -49,9 +49,9 @@ public override Size Draw(DrawContext context, int x, int y) return new Size(x - origX, context.Font.Height); } - public override int CalculateDrawnHeight(DrawContext view) + public override int CalculateDrawnHeight(DrawContext context) { - return IsHidden && !IsWrapped ? HiddenHeight : view.Font.Height; + return IsHidden && !IsWrapped ? HiddenHeight : context.Font.Height; } /// Updates the node from the given spot and sets the value. diff --git a/ReClass.NET/Nodes/ClassInstanceNode.cs b/ReClass.NET/Nodes/ClassInstanceNode.cs index d18646a8..0a52b51a 100644 --- a/ReClass.NET/Nodes/ClassInstanceNode.cs +++ b/ReClass.NET/Nodes/ClassInstanceNode.cs @@ -55,12 +55,12 @@ public override Size Draw(DrawContext context, int x, int y) if (LevelsOpen[context.Level]) { - var v = context.Clone(); - v.Address = context.Address + Offset; - v.Memory = context.Memory.Clone(); - v.Memory.Offset += Offset; + var innerContext = context.Clone(); + innerContext.Address = context.Address + Offset; + innerContext.Memory = context.Memory.Clone(); + innerContext.Memory.Offset += Offset; - var innerSize = InnerNode.Draw(v, tx, y); + var innerSize = InnerNode.Draw(innerContext, tx, y); size.Width = Math.Max(size.Width, innerSize.Width + tx - origX); size.Height += innerSize.Height; } @@ -68,17 +68,17 @@ public override Size Draw(DrawContext context, int x, int y) return size; } - public override int CalculateDrawnHeight(DrawContext view) + public override int CalculateDrawnHeight(DrawContext context) { if (IsHidden && !IsWrapped) { return HiddenHeight; } - var height = view.Font.Height; - if (LevelsOpen[view.Level]) + var height = context.Font.Height; + if (LevelsOpen[context.Level]) { - height += InnerNode.CalculateDrawnHeight(view); + height += InnerNode.CalculateDrawnHeight(context); } return height; } diff --git a/ReClass.NET/Nodes/ClassNode.cs b/ReClass.NET/Nodes/ClassNode.cs index 65544d1c..2125e8e9 100644 --- a/ReClass.NET/Nodes/ClassNode.cs +++ b/ReClass.NET/Nodes/ClassNode.cs @@ -112,8 +112,8 @@ public override Size Draw(DrawContext context, int x, int y) { var childOffset = tx - origX; - var nv = context.Clone(); - nv.Level++; + var innerContext = context.Clone(); + innerContext.Level++; foreach (var node in Nodes) { Size AggregateNodeSizes(Size baseSize, Size newSize) @@ -129,7 +129,7 @@ Size ExtendWidth(Size baseSize, int width) // Draw the node if it is in the visible area. if (context.ClientArea.Contains(tx, y)) { - var innerSize = node.Draw(nv, tx, y); + var innerSize = node.Draw(innerContext, tx, y); size = AggregateNodeSizes(size, ExtendWidth(innerSize, childOffset)); @@ -138,13 +138,13 @@ Size ExtendWidth(Size baseSize, int width) else { // Otherwise calculate the height... - var calculatedHeight = node.CalculateDrawnHeight(nv); + var calculatedHeight = node.CalculateDrawnHeight(innerContext); // and check if the node area overlaps with the visible area... if (new Rectangle(tx, y, 9999999, calculatedHeight).IntersectsWith(context.ClientArea)) { // then draw the node... - var innerSize = node.Draw(nv, tx, y); + var innerSize = node.Draw(innerContext, tx, y); size = AggregateNodeSizes(size, ExtendWidth(innerSize, childOffset)); @@ -164,17 +164,17 @@ Size ExtendWidth(Size baseSize, int width) return size; } - public override int CalculateDrawnHeight(DrawContext view) + public override int CalculateDrawnHeight(DrawContext context) { if (IsHidden) { return HiddenHeight; } - var height = view.Font.Height; - if (LevelsOpen[view.Level]) + var height = context.Font.Height; + if (LevelsOpen[context.Level]) { - var nv = view.Clone(); + var nv = context.Clone(); nv.Level++; height += Nodes.Sum(n => n.CalculateDrawnHeight(nv)); } diff --git a/ReClass.NET/Nodes/EnumNode.cs b/ReClass.NET/Nodes/EnumNode.cs index 411cd002..d2fcf746 100644 --- a/ReClass.NET/Nodes/EnumNode.cs +++ b/ReClass.NET/Nodes/EnumNode.cs @@ -175,9 +175,9 @@ public override Size Draw(DrawContext context, int x, int y) return new Size(x - origX, context.Font.Height); } - public override int CalculateDrawnHeight(DrawContext view) + public override int CalculateDrawnHeight(DrawContext context) { - return IsHidden && !IsWrapped ? HiddenHeight : view.Font.Height; + return IsHidden && !IsWrapped ? HiddenHeight : context.Font.Height; } } } diff --git a/ReClass.NET/Nodes/FunctionNode.cs b/ReClass.NET/Nodes/FunctionNode.cs index 30dfd5bd..8a6c4429 100644 --- a/ReClass.NET/Nodes/FunctionNode.cs +++ b/ReClass.NET/Nodes/FunctionNode.cs @@ -94,17 +94,17 @@ public override Size Draw(DrawContext context, int x, int y) return size; } - public override int CalculateDrawnHeight(DrawContext view) + public override int CalculateDrawnHeight(DrawContext context) { if (IsHidden && !IsWrapped) { return HiddenHeight; } - var height = view.Font.Height; - if (LevelsOpen[view.Level]) + var height = context.Font.Height; + if (LevelsOpen[context.Level]) { - height += Instructions.Count * view.Font.Height; + height += Instructions.Count * context.Font.Height; } return height; } diff --git a/ReClass.NET/Nodes/Hex32Node.cs b/ReClass.NET/Nodes/Hex32Node.cs index 75ebed62..b58567fb 100644 --- a/ReClass.NET/Nodes/Hex32Node.cs +++ b/ReClass.NET/Nodes/Hex32Node.cs @@ -42,13 +42,13 @@ public override void Update(HotSpot spot) Update(spot, 4); } - protected override int AddComment(DrawContext view, int x, int y) + protected override int AddComment(DrawContext context, int x, int y) { - x = base.AddComment(view, x, y); + x = base.AddComment(context, x, y); - var value = view.Memory.ReadObject(Offset); + var value = context.Memory.ReadObject(Offset); - x = AddComment(view, x, y, value.FloatValue, value.IntPtr, value.UIntPtr); + x = AddComment(context, x, y, value.FloatValue, value.IntPtr, value.UIntPtr); return x; } diff --git a/ReClass.NET/Nodes/Hex64Node.cs b/ReClass.NET/Nodes/Hex64Node.cs index 093bcdfb..3cacf264 100644 --- a/ReClass.NET/Nodes/Hex64Node.cs +++ b/ReClass.NET/Nodes/Hex64Node.cs @@ -42,13 +42,13 @@ public override void Update(HotSpot spot) Update(spot, 8); } - protected override int AddComment(DrawContext view, int x, int y) + protected override int AddComment(DrawContext context, int x, int y) { - x = base.AddComment(view, x, y); + x = base.AddComment(context, x, y); - var value = view.Memory.ReadObject(Offset); + var value = context.Memory.ReadObject(Offset); - x = AddComment(view, x, y, value.FloatValue, value.IntPtr, value.UIntPtr); + x = AddComment(context, x, y, value.FloatValue, value.IntPtr, value.UIntPtr); return x; } diff --git a/ReClass.NET/Nodes/Matrix3x3Node.cs b/ReClass.NET/Nodes/Matrix3x3Node.cs index c0de02d8..91a212b9 100644 --- a/ReClass.NET/Nodes/Matrix3x3Node.cs +++ b/ReClass.NET/Nodes/Matrix3x3Node.cs @@ -82,9 +82,9 @@ public override Size Draw(DrawContext context, int x2, int y2) }); } - protected override int CalculateValuesHeight(DrawContext view) + protected override int CalculateValuesHeight(DrawContext context) { - return 3 * view.Font.Height; + return 3 * context.Font.Height; } public override void Update(HotSpot spot) diff --git a/ReClass.NET/Nodes/Matrix3x4Node.cs b/ReClass.NET/Nodes/Matrix3x4Node.cs index ab790584..8a5969c0 100644 --- a/ReClass.NET/Nodes/Matrix3x4Node.cs +++ b/ReClass.NET/Nodes/Matrix3x4Node.cs @@ -94,9 +94,9 @@ public override Size Draw(DrawContext context, int x2, int y2) }); } - protected override int CalculateValuesHeight(DrawContext view) + protected override int CalculateValuesHeight(DrawContext context) { - return 3 * view.Font.Height; + return 3 * context.Font.Height; } public override void Update(HotSpot spot) diff --git a/ReClass.NET/Nodes/Matrix4x4Node.cs b/ReClass.NET/Nodes/Matrix4x4Node.cs index 097e1469..d8c022f9 100644 --- a/ReClass.NET/Nodes/Matrix4x4Node.cs +++ b/ReClass.NET/Nodes/Matrix4x4Node.cs @@ -115,9 +115,9 @@ public override Size Draw(DrawContext context, int x2, int y2) }); } - protected override int CalculateValuesHeight(DrawContext view) + protected override int CalculateValuesHeight(DrawContext context) { - return 4 * view.Font.Height; + return 4 * context.Font.Height; } public override void Update(HotSpot spot) diff --git a/ReClass.NET/Nodes/PointerNode.cs b/ReClass.NET/Nodes/PointerNode.cs index 8920feb6..027b0d28 100644 --- a/ReClass.NET/Nodes/PointerNode.cs +++ b/ReClass.NET/Nodes/PointerNode.cs @@ -43,17 +43,13 @@ public override bool UseMemoryPreviewToolTip(HotSpot spot, out IntPtr address) return spot.Process.GetNamedAddress(address) != null; } - public override bool CanChangeInnerNodeTo(BaseNode node) - { - switch (node) + public override bool CanChangeInnerNodeTo(BaseNode node) => + node switch { - case ClassNode _: - case VirtualMethodNode _: - return false; - } - - return true; - } + ClassNode _ => false, + VirtualMethodNode _ => false, + _ => true + }; public override Size Draw(DrawContext context, int x, int y) { @@ -111,11 +107,11 @@ public override Size Draw(DrawContext context, int x, int y) memory.Size = InnerNode.MemorySize; memory.UpdateFrom(context.Process, ptr); - var v = context.Clone(); - v.Address = ptr; - v.Memory = memory; + var innerContext = context.Clone(); + innerContext.Address = ptr; + innerContext.Memory = memory; - var innerSize = InnerNode.Draw(v, tx, y); + var innerSize = InnerNode.Draw(innerContext, tx, y); size.Width = Math.Max(size.Width, innerSize.Width + tx - origX); size.Height += innerSize.Height; @@ -124,17 +120,17 @@ public override Size Draw(DrawContext context, int x, int y) return size; } - public override int CalculateDrawnHeight(DrawContext view) + public override int CalculateDrawnHeight(DrawContext context) { if (IsHidden && !IsWrapped) { return HiddenHeight; } - var height = view.Font.Height; - if (LevelsOpen[view.Level] && InnerNode != null) + var height = context.Font.Height; + if (LevelsOpen[context.Level] && InnerNode != null) { - height += InnerNode.CalculateDrawnHeight(view); + height += InnerNode.CalculateDrawnHeight(context); } return height; } diff --git a/ReClass.NET/Nodes/UnionNode.cs b/ReClass.NET/Nodes/UnionNode.cs index 5d1df2d4..f46108c2 100644 --- a/ReClass.NET/Nodes/UnionNode.cs +++ b/ReClass.NET/Nodes/UnionNode.cs @@ -78,16 +78,16 @@ public override Size Draw(DrawContext context, int x, int y) if (LevelsOpen[context.Level]) { - var v = context.Clone(); - v.Settings = Program.Settings.Clone(); - v.Settings.ShowNodeAddress = false; - v.Address = context.Address + Offset; - v.Memory = context.Memory.Clone(); - v.Memory.Offset += Offset; + var innerContext = context.Clone(); + innerContext.Settings = Program.Settings.Clone(); + innerContext.Settings.ShowNodeAddress = false; + innerContext.Address = context.Address + Offset; + innerContext.Memory = context.Memory.Clone(); + innerContext.Memory.Offset += Offset; foreach (var node in Nodes) { - var innerSize = node.Draw(v, tx, y); + var innerSize = node.Draw(innerContext, tx, y); size.Width = Math.Max(size.Width, innerSize.Width + tx - origX); size.Height += innerSize.Height; @@ -99,17 +99,17 @@ public override Size Draw(DrawContext context, int x, int y) return size; } - public override int CalculateDrawnHeight(DrawContext view) + public override int CalculateDrawnHeight(DrawContext context) { if (IsHidden && !IsWrapped) { return HiddenHeight; } - var height = view.Font.Height; - if (LevelsOpen[view.Level]) + var height = context.Font.Height; + if (LevelsOpen[context.Level]) { - height += Nodes.Sum(n => n.CalculateDrawnHeight(view)); + height += Nodes.Sum(n => n.CalculateDrawnHeight(context)); } return height; } diff --git a/ReClass.NET/Nodes/Vector2Node.cs b/ReClass.NET/Nodes/Vector2Node.cs index 5ad249dd..a9e876d6 100644 --- a/ReClass.NET/Nodes/Vector2Node.cs +++ b/ReClass.NET/Nodes/Vector2Node.cs @@ -40,7 +40,7 @@ public override Size Draw(DrawContext context, int x2, int y2) }); } - protected override int CalculateValuesHeight(DrawContext view) + protected override int CalculateValuesHeight(DrawContext context) { return 0; } diff --git a/ReClass.NET/Nodes/Vector3Node.cs b/ReClass.NET/Nodes/Vector3Node.cs index 2d153ec7..8f49111a 100644 --- a/ReClass.NET/Nodes/Vector3Node.cs +++ b/ReClass.NET/Nodes/Vector3Node.cs @@ -44,7 +44,7 @@ public override Size Draw(DrawContext context, int x2, int y2) }); } - protected override int CalculateValuesHeight(DrawContext view) + protected override int CalculateValuesHeight(DrawContext context) { return 0; } diff --git a/ReClass.NET/Nodes/Vector4Node.cs b/ReClass.NET/Nodes/Vector4Node.cs index 3c193cb4..7321d1d3 100644 --- a/ReClass.NET/Nodes/Vector4Node.cs +++ b/ReClass.NET/Nodes/Vector4Node.cs @@ -48,7 +48,7 @@ public override Size Draw(DrawContext context, int x2, int y2) }); } - protected override int CalculateValuesHeight(DrawContext view) + protected override int CalculateValuesHeight(DrawContext context) { return 0; } diff --git a/ReClass.NET/Nodes/VirtualMethodTableNode.cs b/ReClass.NET/Nodes/VirtualMethodTableNode.cs index bd08fb28..9e82ab40 100644 --- a/ReClass.NET/Nodes/VirtualMethodTableNode.cs +++ b/ReClass.NET/Nodes/VirtualMethodTableNode.cs @@ -75,13 +75,13 @@ public override Size Draw(DrawContext context, int x, int y) memory.Size = Nodes.Count * IntPtr.Size; memory.UpdateFrom(context.Process, ptr); - var v = context.Clone(); - v.Address = ptr; - v.Memory = memory; + var innerContext = context.Clone(); + innerContext.Address = ptr; + innerContext.Memory = memory; foreach (var node in Nodes) { - var innerSize = node.Draw(v, tx, y); + var innerSize = node.Draw(innerContext, tx, y); size.Width = Math.Max(size.Width, innerSize.Width + tx - origX); size.Height += innerSize.Height; @@ -93,17 +93,17 @@ public override Size Draw(DrawContext context, int x, int y) return size; } - public override int CalculateDrawnHeight(DrawContext view) + public override int CalculateDrawnHeight(DrawContext context) { if (IsHidden && !IsWrapped) { return HiddenHeight; } - var height = view.Font.Height; - if (LevelsOpen[view.Level]) + var height = context.Font.Height; + if (LevelsOpen[context.Level]) { - height += Nodes.Sum(n => n.CalculateDrawnHeight(view)); + height += Nodes.Sum(n => n.CalculateDrawnHeight(context)); } return height; } From 8773c39ceb67ca2a2606fee845f8e4cf7377ff92 Mon Sep 17 00:00:00 2001 From: KN4CK3R Date: Sun, 18 Oct 2020 13:49:01 +0200 Subject: [PATCH 174/223] Added nodes for native integer sizes. --- ReClass.NET/Memory/MemoryBuffer.cs | 16 ++++++++- ReClass.NET/Nodes/IntNativeNode.cs | 52 ++++++++++++++++++++++++++++ ReClass.NET/Nodes/UIntNativeNode.cs | 53 +++++++++++++++++++++++++++++ ReClass.NET/ReClass.NET.csproj | 2 ++ 4 files changed, 122 insertions(+), 1 deletion(-) create mode 100644 ReClass.NET/Nodes/IntNativeNode.cs create mode 100644 ReClass.NET/Nodes/UIntNativeNode.cs diff --git a/ReClass.NET/Memory/MemoryBuffer.cs b/ReClass.NET/Memory/MemoryBuffer.cs index ddaed91b..f81b3885 100644 --- a/ReClass.NET/Memory/MemoryBuffer.cs +++ b/ReClass.NET/Memory/MemoryBuffer.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Diagnostics.Contracts; using System.Runtime.InteropServices; using System.Text; @@ -326,6 +326,20 @@ public IntPtr ReadIntPtr(int offset) #endif } + /// Reads a from the specific offset. + /// The offset into the data. + /// The data read as or 0 if the offset is outside the data. + public UIntPtr ReadUIntPtr(int offset) + { + Contract.Requires(offset >= 0); + +#if RECLASSNET64 + return (UIntPtr)ReadUInt64(offset); +#else + return (UIntPtr)ReadUInt32(offset); +#endif + } + #endregion public string ReadString(Encoding encoding, int offset, int length) diff --git a/ReClass.NET/Nodes/IntNativeNode.cs b/ReClass.NET/Nodes/IntNativeNode.cs new file mode 100644 index 00000000..bde88d62 --- /dev/null +++ b/ReClass.NET/Nodes/IntNativeNode.cs @@ -0,0 +1,52 @@ +using System; +using System.Drawing; +using System.Globalization; +using ReClassNET.Controls; +using ReClassNET.Extensions; +using ReClassNET.Memory; +using ReClassNET.UI; + +namespace ReClassNET.Nodes +{ + public class IntNativeNode : BaseNumericNode + { + public override int MemorySize => 8; + + public override void GetUserInterfaceInfo(out string name, out Image icon) + { + name = "NInt"; + icon = Properties.Resources.B16x16_Button_Int_64; + } + + public override Size Draw(DrawContext context, int x, int y) + { + var value = ReadValueFromMemory(context.Memory); + return DrawNumeric(context, x, y, context.IconProvider.Signed, "NInt", value.ToInt64().ToString(), "0x" + value.ToString(Constants.AddressHexFormat)); + } + + public override void Update(HotSpot spot) + { + base.Update(spot); + + if (spot.Id == 0 || spot.Id == 1) + { +#if RECLASSNET64 + if (long.TryParse(spot.Text, out var val) || spot.Text.TryGetHexString(out var hexValue) && long.TryParse(hexValue, NumberStyles.HexNumber, null, out val)) + { + spot.Process.WriteRemoteMemory(spot.Address, val); + } +#else + if (int.TryParse(spot.Text, out var val) || spot.Text.TryGetHexString(out var hexValue) && int.TryParse(hexValue, NumberStyles.HexNumber, null, out val)) + { + spot.Process.WriteRemoteMemory(spot.Address, val); + } +#endif + } + } + + public IntPtr ReadValueFromMemory(MemoryBuffer memory) + { + return memory.ReadIntPtr(Offset); + } + } +} diff --git a/ReClass.NET/Nodes/UIntNativeNode.cs b/ReClass.NET/Nodes/UIntNativeNode.cs new file mode 100644 index 00000000..4902cee8 --- /dev/null +++ b/ReClass.NET/Nodes/UIntNativeNode.cs @@ -0,0 +1,53 @@ +using System; +using System.Drawing; +using System.Globalization; +using ReClassNET.Controls; +using ReClassNET.Extensions; +using ReClassNET.Memory; +using ReClassNET.UI; + +namespace ReClassNET.Nodes +{ + public class UIntNativeNode : BaseNumericNode + { + public override int MemorySize => 8; + + public override void GetUserInterfaceInfo(out string name, out Image icon) + { + name = "NUInt"; + icon = Properties.Resources.B16x16_Button_UInt_64; + } + + public override Size Draw(DrawContext context, int x, int y) + { + var value = ReadValueFromMemory(context.Memory); + var uvalue = value.ToUInt64(); + return DrawNumeric(context, x, y, context.IconProvider.Unsigned, "NUInt", uvalue.ToString(), "0x" + uvalue.ToString(Constants.AddressHexFormat)); + } + + public override void Update(HotSpot spot) + { + base.Update(spot); + + if (spot.Id == 0 || spot.Id == 1) + { +#if RECLASSNET64 + if (ulong.TryParse(spot.Text, out var val) || spot.Text.TryGetHexString(out var hexValue) && ulong.TryParse(hexValue, NumberStyles.HexNumber, null, out val)) + { + spot.Process.WriteRemoteMemory(spot.Address, val); + } +#else + if (uint.TryParse(spot.Text, out var val) || spot.Text.TryGetHexString(out var hexValue) && uint.TryParse(hexValue, NumberStyles.HexNumber, null, out val)) + { + spot.Process.WriteRemoteMemory(spot.Address, val); + } +#endif + } + } + + public UIntPtr ReadValueFromMemory(MemoryBuffer memory) + { + return memory.ReadUIntPtr(Offset); + } + } +} diff --git a/ReClass.NET/ReClass.NET.csproj b/ReClass.NET/ReClass.NET.csproj index b5761ac2..c0fd19d6 100644 --- a/ReClass.NET/ReClass.NET.csproj +++ b/ReClass.NET/ReClass.NET.csproj @@ -289,8 +289,10 @@ + + From 3162e2d54856e6d3f23fa4376961890fc9b0760b Mon Sep 17 00:00:00 2001 From: KN4CK3R Date: Sun, 18 Oct 2020 14:04:41 +0200 Subject: [PATCH 175/223] Added icons. --- ReClass.NET/Nodes/IntNativeNode.cs | 2 +- ReClass.NET/Nodes/UIntNativeNode.cs | 2 +- ReClass.NET/Properties/Resources.Designer.cs | 24 ++++++++++++++++-- ReClass.NET/Properties/Resources.resx | 6 +++++ ReClass.NET/ReClass.NET.csproj | 7 ++++- .../Resources/Images/B16x16_Button_NInt.png | Bin 0 -> 188 bytes .../Resources/Images/B16x16_Button_NUInt.png | Bin 0 -> 189 bytes 7 files changed, 36 insertions(+), 5 deletions(-) create mode 100644 ReClass.NET/Resources/Images/B16x16_Button_NInt.png create mode 100644 ReClass.NET/Resources/Images/B16x16_Button_NUInt.png diff --git a/ReClass.NET/Nodes/IntNativeNode.cs b/ReClass.NET/Nodes/IntNativeNode.cs index bde88d62..b50f6e3f 100644 --- a/ReClass.NET/Nodes/IntNativeNode.cs +++ b/ReClass.NET/Nodes/IntNativeNode.cs @@ -15,7 +15,7 @@ public class IntNativeNode : BaseNumericNode public override void GetUserInterfaceInfo(out string name, out Image icon) { name = "NInt"; - icon = Properties.Resources.B16x16_Button_Int_64; + icon = Properties.Resources.B16x16_Button_NInt; } public override Size Draw(DrawContext context, int x, int y) diff --git a/ReClass.NET/Nodes/UIntNativeNode.cs b/ReClass.NET/Nodes/UIntNativeNode.cs index 4902cee8..50da79f0 100644 --- a/ReClass.NET/Nodes/UIntNativeNode.cs +++ b/ReClass.NET/Nodes/UIntNativeNode.cs @@ -15,7 +15,7 @@ public class UIntNativeNode : BaseNumericNode public override void GetUserInterfaceInfo(out string name, out Image icon) { name = "NUInt"; - icon = Properties.Resources.B16x16_Button_UInt_64; + icon = Properties.Resources.B16x16_Button_NUInt; } public override Size Draw(DrawContext context, int x, int y) diff --git a/ReClass.NET/Properties/Resources.Designer.cs b/ReClass.NET/Properties/Resources.Designer.cs index 538bd01c..3d412074 100644 --- a/ReClass.NET/Properties/Resources.Designer.cs +++ b/ReClass.NET/Properties/Resources.Designer.cs @@ -19,7 +19,7 @@ namespace ReClassNET.Properties { // class via a tool like ResGen or Visual Studio. // To add or remove a member, edit your .ResX file then rerun ResGen // with the /str option, or rebuild your VS project. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] internal class Resources { @@ -510,6 +510,26 @@ internal static System.Drawing.Bitmap B16x16_Button_Matrix_4x4 { } } + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap B16x16_Button_NInt { + get { + object obj = ResourceManager.GetObject("B16x16_Button_NInt", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap B16x16_Button_NUInt { + get { + object obj = ResourceManager.GetObject("B16x16_Button_NUInt", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// @@ -1351,7 +1371,7 @@ internal static System.Drawing.Bitmap B32x32_Plugin { } /// - /// Looks up a localized string similar to 2019/03/31 20:34:22 + /// Looks up a localized string similar to 2020/10/17 09:45:04 ///. /// internal static string BuildDate { diff --git a/ReClass.NET/Properties/Resources.resx b/ReClass.NET/Properties/Resources.resx index 7c64e77f..48c2c826 100644 --- a/ReClass.NET/Properties/Resources.resx +++ b/ReClass.NET/Properties/Resources.resx @@ -511,4 +511,10 @@ ..\Resources\Images\B16x16_Button_Union.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Resources\Images\B16x16_Button_NInt.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\Images\B16x16_Button_NUInt.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + \ No newline at end of file diff --git a/ReClass.NET/ReClass.NET.csproj b/ReClass.NET/ReClass.NET.csproj index c0fd19d6..415d3b07 100644 --- a/ReClass.NET/ReClass.NET.csproj +++ b/ReClass.NET/ReClass.NET.csproj @@ -1013,7 +1013,12 @@ - + + + + + + powershell -Command "((Get-Date).ToUniversalTime()).ToString(\"yyyy\/MM\/dd HH:mm:ss\") | Out-File '$(ProjectDir)Resources\BuildDate.txt'" diff --git a/ReClass.NET/Resources/Images/B16x16_Button_NInt.png b/ReClass.NET/Resources/Images/B16x16_Button_NInt.png new file mode 100644 index 0000000000000000000000000000000000000000..0e07b5766d59d437f99e1a44beac99872739e304 GIT binary patch literal 188 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbKJV{wqX6T`Z5GB1G~mUKs7M+SzC z{oH>NS%G}c0G|+7ApM`g07y>n*|io(F_#4S1^@rgaQzf7P%VR#r;B5VM)1_Lfm{p< z9LyKK{ANS%G}c0G|+7AkEg z4(0=2{`cqQ%@k$z^{{Q3CC?Z!^(Irq1v|#YSqJ8^KQM`JD*M`S$CB}b_tUCCp}7Vv e>l2RcWq!So@yMxvJcohCF?hQAxvX Date: Sun, 18 Oct 2020 14:05:35 +0200 Subject: [PATCH 176/223] Fixed memory size. --- ReClass.NET/Nodes/IntNativeNode.cs | 2 +- ReClass.NET/Nodes/UIntNativeNode.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ReClass.NET/Nodes/IntNativeNode.cs b/ReClass.NET/Nodes/IntNativeNode.cs index b50f6e3f..b6278de8 100644 --- a/ReClass.NET/Nodes/IntNativeNode.cs +++ b/ReClass.NET/Nodes/IntNativeNode.cs @@ -10,7 +10,7 @@ namespace ReClassNET.Nodes { public class IntNativeNode : BaseNumericNode { - public override int MemorySize => 8; + public override int MemorySize => IntPtr.Size; public override void GetUserInterfaceInfo(out string name, out Image icon) { diff --git a/ReClass.NET/Nodes/UIntNativeNode.cs b/ReClass.NET/Nodes/UIntNativeNode.cs index 50da79f0..0ad770b4 100644 --- a/ReClass.NET/Nodes/UIntNativeNode.cs +++ b/ReClass.NET/Nodes/UIntNativeNode.cs @@ -10,7 +10,7 @@ namespace ReClassNET.Nodes { public class UIntNativeNode : BaseNumericNode { - public override int MemorySize => 8; + public override int MemorySize => UIntPtr.Size; public override void GetUserInterfaceInfo(out string name, out Image icon) { From b09b294d21f4877ebca9e5b568a4dc05915cd35c Mon Sep 17 00:00:00 2001 From: KN4CK3R Date: Sun, 18 Oct 2020 14:08:39 +0200 Subject: [PATCH 177/223] Changed node name. --- ReClass.NET/Nodes/{IntNativeNode.cs => NIntNode.cs} | 2 +- ReClass.NET/Nodes/{UIntNativeNode.cs => NUIntNode.cs} | 2 +- ReClass.NET/ReClass.NET.csproj | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) rename ReClass.NET/Nodes/{IntNativeNode.cs => NIntNode.cs} (96%) rename ReClass.NET/Nodes/{UIntNativeNode.cs => NUIntNode.cs} (96%) diff --git a/ReClass.NET/Nodes/IntNativeNode.cs b/ReClass.NET/Nodes/NIntNode.cs similarity index 96% rename from ReClass.NET/Nodes/IntNativeNode.cs rename to ReClass.NET/Nodes/NIntNode.cs index b6278de8..3b469e7e 100644 --- a/ReClass.NET/Nodes/IntNativeNode.cs +++ b/ReClass.NET/Nodes/NIntNode.cs @@ -8,7 +8,7 @@ namespace ReClassNET.Nodes { - public class IntNativeNode : BaseNumericNode + public class NIntNode : BaseNumericNode { public override int MemorySize => IntPtr.Size; diff --git a/ReClass.NET/Nodes/UIntNativeNode.cs b/ReClass.NET/Nodes/NUIntNode.cs similarity index 96% rename from ReClass.NET/Nodes/UIntNativeNode.cs rename to ReClass.NET/Nodes/NUIntNode.cs index 0ad770b4..2736d071 100644 --- a/ReClass.NET/Nodes/UIntNativeNode.cs +++ b/ReClass.NET/Nodes/NUIntNode.cs @@ -8,7 +8,7 @@ namespace ReClassNET.Nodes { - public class UIntNativeNode : BaseNumericNode + public class NUIntNode : BaseNumericNode { public override int MemorySize => UIntPtr.Size; diff --git a/ReClass.NET/ReClass.NET.csproj b/ReClass.NET/ReClass.NET.csproj index 415d3b07..77ac1145 100644 --- a/ReClass.NET/ReClass.NET.csproj +++ b/ReClass.NET/ReClass.NET.csproj @@ -289,10 +289,10 @@ - + - + From 3b6d432298f2665247bca349fd039984dd2cd4b3 Mon Sep 17 00:00:00 2001 From: KN4CK3R Date: Sun, 18 Oct 2020 14:19:18 +0200 Subject: [PATCH 178/223] Changed hex display. --- ReClass.NET/Nodes/NIntNode.cs | 4 ++-- ReClass.NET/Nodes/NUIntNode.cs | 5 ++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/ReClass.NET/Nodes/NIntNode.cs b/ReClass.NET/Nodes/NIntNode.cs index 3b469e7e..63661b08 100644 --- a/ReClass.NET/Nodes/NIntNode.cs +++ b/ReClass.NET/Nodes/NIntNode.cs @@ -20,8 +20,8 @@ public override void GetUserInterfaceInfo(out string name, out Image icon) public override Size Draw(DrawContext context, int x, int y) { - var value = ReadValueFromMemory(context.Memory); - return DrawNumeric(context, x, y, context.IconProvider.Signed, "NInt", value.ToInt64().ToString(), "0x" + value.ToString(Constants.AddressHexFormat)); + var value = ReadValueFromMemory(context.Memory).ToInt64(); + return DrawNumeric(context, x, y, context.IconProvider.Signed, "NInt", value.ToString(), $"0x{value:X}"); } public override void Update(HotSpot spot) diff --git a/ReClass.NET/Nodes/NUIntNode.cs b/ReClass.NET/Nodes/NUIntNode.cs index 2736d071..8f98c7d4 100644 --- a/ReClass.NET/Nodes/NUIntNode.cs +++ b/ReClass.NET/Nodes/NUIntNode.cs @@ -20,9 +20,8 @@ public override void GetUserInterfaceInfo(out string name, out Image icon) public override Size Draw(DrawContext context, int x, int y) { - var value = ReadValueFromMemory(context.Memory); - var uvalue = value.ToUInt64(); - return DrawNumeric(context, x, y, context.IconProvider.Unsigned, "NUInt", uvalue.ToString(), "0x" + uvalue.ToString(Constants.AddressHexFormat)); + var value = ReadValueFromMemory(context.Memory).ToUInt64(); + return DrawNumeric(context, x, y, context.IconProvider.Unsigned, "NUInt", value.ToString(), $"0x{value:X}"); } public override void Update(HotSpot spot) From c61bae4374ddfaa5bb62942a9a43fe3c5fb8c25b Mon Sep 17 00:00:00 2001 From: KN4CK3R Date: Sun, 18 Oct 2020 14:20:37 +0200 Subject: [PATCH 179/223] Added node type to gui. --- ReClass.NET/UI/NodeTypesBuilder.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ReClass.NET/UI/NodeTypesBuilder.cs b/ReClass.NET/UI/NodeTypesBuilder.cs index 689171ab..8d519022 100644 --- a/ReClass.NET/UI/NodeTypesBuilder.cs +++ b/ReClass.NET/UI/NodeTypesBuilder.cs @@ -18,8 +18,8 @@ internal static class NodeTypesBuilder static NodeTypesBuilder() { defaultNodeTypeGroupList.Add(new[] { typeof(Hex64Node), typeof(Hex32Node), typeof(Hex16Node), typeof(Hex8Node) }); - defaultNodeTypeGroupList.Add(new[] { typeof(Int64Node), typeof(Int32Node), typeof(Int16Node), typeof(Int8Node) }); - defaultNodeTypeGroupList.Add(new[] { typeof(UInt64Node), typeof(UInt32Node), typeof(UInt16Node), typeof(UInt8Node) }); + defaultNodeTypeGroupList.Add(new[] { typeof(NIntNode), typeof(Int64Node), typeof(Int32Node), typeof(Int16Node), typeof(Int8Node) }); + defaultNodeTypeGroupList.Add(new[] { typeof(NUIntNode), typeof(UInt64Node), typeof(UInt32Node), typeof(UInt16Node), typeof(UInt8Node) }); defaultNodeTypeGroupList.Add(new[] { typeof(BoolNode), typeof(BitFieldNode), typeof(EnumNode) }); defaultNodeTypeGroupList.Add(new[] { typeof(FloatNode), typeof(DoubleNode) }); defaultNodeTypeGroupList.Add(new[] { typeof(Vector4Node), typeof(Vector3Node), typeof(Vector2Node), typeof(Matrix4x4Node), typeof(Matrix3x4Node), typeof(Matrix3x3Node) }); From 6b7ea59e9b4dac4ceb3d9d86dec602606ac6afd5 Mon Sep 17 00:00:00 2001 From: KN4CK3R Date: Sun, 18 Oct 2020 14:25:26 +0200 Subject: [PATCH 180/223] Added import and export for native int nodes. --- ReClass.NET/DataExchange/ReClass/ReClassNetFile.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ReClass.NET/DataExchange/ReClass/ReClassNetFile.cs b/ReClass.NET/DataExchange/ReClass/ReClassNetFile.cs index eb25e52b..af258a04 100644 --- a/ReClass.NET/DataExchange/ReClass/ReClassNetFile.cs +++ b/ReClass.NET/DataExchange/ReClass/ReClassNetFile.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Diagnostics.Contracts; using System.Linq; @@ -54,6 +54,7 @@ static ReClassNetFile() typeof(Int16Node), typeof(Int32Node), typeof(Int64Node), + typeof(NIntNode), typeof(Matrix3x3Node), typeof(Matrix3x4Node), typeof(Matrix4x4Node), @@ -61,6 +62,7 @@ static ReClassNetFile() typeof(UInt16Node), typeof(UInt32Node), typeof(UInt64Node), + typeof(NUIntNode), typeof(Utf8TextNode), typeof(Utf8TextPtrNode), typeof(Utf16TextNode), From be778fd129052d1b6ecee705019e546793e91d5f Mon Sep 17 00:00:00 2001 From: KN4CK3R Date: Sun, 18 Oct 2020 14:49:17 +0200 Subject: [PATCH 181/223] Added memory searcher functionality. --- ReClass.NET/Forms/MainForm.cs | 30 +++++++++++++++++++++++++----- 1 file changed, 25 insertions(+), 5 deletions(-) diff --git a/ReClass.NET/Forms/MainForm.cs b/ReClass.NET/Forms/MainForm.cs index 9b6aa9bb..81c6cf63 100644 --- a/ReClass.NET/Forms/MainForm.cs +++ b/ReClass.NET/Forms/MainForm.cs @@ -595,10 +595,10 @@ private void searchForEqualValuesToolStripMenuItem_Click(object sender, EventArg comparer = new ArrayOfBytesMemoryComparer(node.ReadValueFromMemory(selectedNode.Memory)); break; case FloatNode node: - comparer = new FloatMemoryComparer(ScanCompareType.Equal, ScanRoundMode.Normal, 2, node.ReadValueFromMemory(selectedNode.Memory), 0); + comparer = new FloatMemoryComparer(ScanCompareType.Equal, ScanRoundMode.Normal, 2, node.ReadValueFromMemory(selectedNode.Memory), 0.0f); break; case DoubleNode node: - comparer = new DoubleMemoryComparer(ScanCompareType.Equal, ScanRoundMode.Normal, 2, node.ReadValueFromMemory(selectedNode.Memory), 0); + comparer = new DoubleMemoryComparer(ScanCompareType.Equal, ScanRoundMode.Normal, 2, node.ReadValueFromMemory(selectedNode.Memory), 0.0); break; case Int8Node node: comparer = new ByteMemoryComparer(ScanCompareType.Equal, (byte)node.ReadValueFromMemory(selectedNode.Memory), 0); @@ -619,11 +619,31 @@ private void searchForEqualValuesToolStripMenuItem_Click(object sender, EventArg comparer = new IntegerMemoryComparer(ScanCompareType.Equal, (int)node.ReadValueFromMemory(selectedNode.Memory), 0); break; case Int64Node node: - comparer = new LongMemoryComparer(ScanCompareType.Equal, node.ReadValueFromMemory(selectedNode.Memory), 0); + comparer = new LongMemoryComparer(ScanCompareType.Equal, node.ReadValueFromMemory(selectedNode.Memory), 0L); break; case UInt64Node node: - comparer = new LongMemoryComparer(ScanCompareType.Equal, (long)node.ReadValueFromMemory(selectedNode.Memory), 0); + comparer = new LongMemoryComparer(ScanCompareType.Equal, (long)node.ReadValueFromMemory(selectedNode.Memory), 0L); break; + case NIntNode node: + { + var value = node.ReadValueFromMemory(selectedNode.Memory); +#if RECLASSNET64 + comparer = new LongMemoryComparer(ScanCompareType.Equal, value.ToInt64(), 0L); +#else + comparer = new IntegerMemoryComparer(ScanCompareType.Equal, value.ToInt32(), 0); +#endif + break; + } + case NUIntNode node: + { + var value = node.ReadValueFromMemory(selectedNode.Memory); +#if RECLASSNET64 + comparer = new LongMemoryComparer(ScanCompareType.Equal, (long)value.ToUInt64(), 0L); +#else + comparer = new IntegerMemoryComparer(ScanCompareType.Equal, (int)value.ToUInt32(), 0); +#endif + break; + } case Utf8TextNode node: comparer = new StringMemoryComparer(node.ReadValueFromMemory(selectedNode.Memory), Encoding.UTF8, true); break; @@ -716,7 +736,7 @@ private void shrinkClassToolStripMenuItem_Click(object sender, EventArgs e) } } - #endregion +#endregion private void MainForm_DragEnter(object sender, DragEventArgs e) { From 12381e077b707bb1a4be5104ff12baab9eae6f9b Mon Sep 17 00:00:00 2001 From: KN4CK3R Date: Sun, 18 Oct 2020 15:28:26 +0200 Subject: [PATCH 182/223] Add support for code generation. --- ReClass.NET/CodeGenerator/CSharpCodeGenerator.cs | 2 ++ ReClass.NET/CodeGenerator/CppCodeGenerator.cs | 2 ++ ReClass.NET/Project/CppTypeMapping.cs | 8 +++++++- 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/ReClass.NET/CodeGenerator/CSharpCodeGenerator.cs b/ReClass.NET/CodeGenerator/CSharpCodeGenerator.cs index 0eedf1f9..c46bb836 100644 --- a/ReClass.NET/CodeGenerator/CSharpCodeGenerator.cs +++ b/ReClass.NET/CodeGenerator/CSharpCodeGenerator.cs @@ -22,10 +22,12 @@ public class CSharpCodeGenerator : ICodeGenerator [typeof(Int16Node)] = "short", [typeof(Int32Node)] = "int", [typeof(Int64Node)] = "long", + [typeof(NIntNode)] = "IntPtr", [typeof(UInt8Node)] = "byte", [typeof(UInt16Node)] = "ushort", [typeof(UInt32Node)] = "uint", [typeof(UInt64Node)] = "ulong", + [typeof(NUIntNode)] = "UIntPtr", [typeof(FunctionPtrNode)] = "IntPtr", [typeof(Utf8TextPtrNode)] = "IntPtr", diff --git a/ReClass.NET/CodeGenerator/CppCodeGenerator.cs b/ReClass.NET/CodeGenerator/CppCodeGenerator.cs index 8988118e..4cefbf8f 100644 --- a/ReClass.NET/CodeGenerator/CppCodeGenerator.cs +++ b/ReClass.NET/CodeGenerator/CppCodeGenerator.cs @@ -136,6 +136,7 @@ public CppCodeGenerator(CppTypeMapping typeMapping) [typeof(Int16Node)] = typeMapping.TypeInt16, [typeof(Int32Node)] = typeMapping.TypeInt32, [typeof(Int64Node)] = typeMapping.TypeInt64, + [typeof(NIntNode)] = typeMapping.TypeNInt, [typeof(Matrix3x3Node)] = typeMapping.TypeMatrix3x3, [typeof(Matrix3x4Node)] = typeMapping.TypeMatrix3x4, [typeof(Matrix4x4Node)] = typeMapping.TypeMatrix4x4, @@ -143,6 +144,7 @@ public CppCodeGenerator(CppTypeMapping typeMapping) [typeof(UInt16Node)] = typeMapping.TypeUInt16, [typeof(UInt32Node)] = typeMapping.TypeUInt32, [typeof(UInt64Node)] = typeMapping.TypeUInt64, + [typeof(NUIntNode)] = typeMapping.TypeNUInt, [typeof(Utf8CharacterNode)] = typeMapping.TypeUtf8Text, [typeof(Utf16CharacterNode)] = typeMapping.TypeUtf16Text, [typeof(Utf32CharacterNode)] = typeMapping.TypeUtf32Text, diff --git a/ReClass.NET/Project/CppTypeMapping.cs b/ReClass.NET/Project/CppTypeMapping.cs index eb90a174..03e1bc48 100644 --- a/ReClass.NET/Project/CppTypeMapping.cs +++ b/ReClass.NET/Project/CppTypeMapping.cs @@ -1,4 +1,4 @@ -using System.Xml.Linq; +using System.Xml.Linq; using ReClassNET.Util; namespace ReClassNET.Project @@ -11,11 +11,13 @@ public class CppTypeMapping public string TypeInt16 { get; set; } = "int16_t"; public string TypeInt32 { get; set; } = "int32_t"; public string TypeInt64 { get; set; } = "int64_t"; + public string TypeNInt { get; set; } = "ptrdiff_t"; public string TypeUInt8 { get; set; } = "uint8_t"; public string TypeUInt16 { get; set; } = "uint16_t"; public string TypeUInt32 { get; set; } = "uint32_t"; public string TypeUInt64 { get; set; } = "uint64_t"; + public string TypeNUInt { get; set; } = "size_t"; public string TypeFloat { get; set; } = "float"; public string TypeDouble { get; set; } = "double"; @@ -43,10 +45,12 @@ internal XElement Serialize(string name) XElementSerializer.ToXml(nameof(TypeInt16), TypeInt16), XElementSerializer.ToXml(nameof(TypeInt32), TypeInt32), XElementSerializer.ToXml(nameof(TypeInt64), TypeInt64), + XElementSerializer.ToXml(nameof(TypeNInt), TypeNInt), XElementSerializer.ToXml(nameof(TypeUInt8), TypeUInt8), XElementSerializer.ToXml(nameof(TypeUInt16), TypeUInt16), XElementSerializer.ToXml(nameof(TypeUInt32), TypeUInt32), XElementSerializer.ToXml(nameof(TypeUInt64), TypeUInt64), + XElementSerializer.ToXml(nameof(TypeNUInt), TypeNUInt), XElementSerializer.ToXml(nameof(TypeFloat), TypeFloat), XElementSerializer.ToXml(nameof(TypeDouble), TypeDouble), XElementSerializer.ToXml(nameof(TypeVector2), TypeVector2), @@ -69,10 +73,12 @@ internal void Deserialize(XElement element) XElementSerializer.TryRead(element, nameof(TypeInt16), e => TypeInt16 = XElementSerializer.ToString(e)); XElementSerializer.TryRead(element, nameof(TypeInt32), e => TypeInt32 = XElementSerializer.ToString(e)); XElementSerializer.TryRead(element, nameof(TypeInt64), e => TypeInt64 = XElementSerializer.ToString(e)); + XElementSerializer.TryRead(element, nameof(TypeNInt), e => TypeNInt = XElementSerializer.ToString(e)); XElementSerializer.TryRead(element, nameof(TypeUInt8), e => TypeUInt8 = XElementSerializer.ToString(e)); XElementSerializer.TryRead(element, nameof(TypeUInt16), e => TypeUInt16 = XElementSerializer.ToString(e)); XElementSerializer.TryRead(element, nameof(TypeUInt32), e => TypeUInt32 = XElementSerializer.ToString(e)); XElementSerializer.TryRead(element, nameof(TypeUInt64), e => TypeUInt64 = XElementSerializer.ToString(e)); + XElementSerializer.TryRead(element, nameof(TypeNUInt), e => TypeNUInt = XElementSerializer.ToString(e)); XElementSerializer.TryRead(element, nameof(TypeFloat), e => TypeFloat = XElementSerializer.ToString(e)); XElementSerializer.TryRead(element, nameof(TypeDouble), e => TypeDouble = XElementSerializer.ToString(e)); XElementSerializer.TryRead(element, nameof(TypeVector2), e => TypeVector2 = XElementSerializer.ToString(e)); From 802fb66d3384337393cc8e1134836d4d98021e69 Mon Sep 17 00:00:00 2001 From: KN4CK3R Date: Sun, 18 Oct 2020 15:31:56 +0200 Subject: [PATCH 183/223] Fixed formatting for negative 4byte values. --- ReClass.NET/Nodes/NIntNode.cs | 7 ++++++- ReClass.NET/Nodes/NUIntNode.cs | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/ReClass.NET/Nodes/NIntNode.cs b/ReClass.NET/Nodes/NIntNode.cs index 63661b08..77d021e0 100644 --- a/ReClass.NET/Nodes/NIntNode.cs +++ b/ReClass.NET/Nodes/NIntNode.cs @@ -20,7 +20,12 @@ public override void GetUserInterfaceInfo(out string name, out Image icon) public override Size Draw(DrawContext context, int x, int y) { - var value = ReadValueFromMemory(context.Memory).ToInt64(); + var value = ReadValueFromMemory(context.Memory) +#if RECLASSNET64 + .ToInt64(); +#else + .ToInt32(); +#endif return DrawNumeric(context, x, y, context.IconProvider.Signed, "NInt", value.ToString(), $"0x{value:X}"); } diff --git a/ReClass.NET/Nodes/NUIntNode.cs b/ReClass.NET/Nodes/NUIntNode.cs index 8f98c7d4..1b502ad0 100644 --- a/ReClass.NET/Nodes/NUIntNode.cs +++ b/ReClass.NET/Nodes/NUIntNode.cs @@ -20,7 +20,12 @@ public override void GetUserInterfaceInfo(out string name, out Image icon) public override Size Draw(DrawContext context, int x, int y) { - var value = ReadValueFromMemory(context.Memory).ToUInt64(); + var value = ReadValueFromMemory(context.Memory) +#if RECLASSNET64 + .ToUInt64(); +#else + .ToUInt32(); +#endif return DrawNumeric(context, x, y, context.IconProvider.Unsigned, "NUInt", value.ToString(), $"0x{value:X}"); } From 00652273722e81639556ef79d43de2a4b715a199 Mon Sep 17 00:00:00 2001 From: KN4CK3R Date: Sun, 18 Oct 2020 19:47:11 +0200 Subject: [PATCH 184/223] Enable search context menu for native int nodes. --- ReClass.NET/Forms/MainForm.cs | 38 +++++++++++++++++------------------ 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/ReClass.NET/Forms/MainForm.cs b/ReClass.NET/Forms/MainForm.cs index 81c6cf63..0b3f3008 100644 --- a/ReClass.NET/Forms/MainForm.cs +++ b/ReClass.NET/Forms/MainForm.cs @@ -466,26 +466,26 @@ private void selectedNodeContextMenuStrip_Opening(object sender, CancelEventArgs var parentNode = node?.GetParentContainer(); var nodeIsClass = node is ClassNode; - var nodeIsSearchableValueNode = false; - switch (node) + var nodeIsSearchableValueNode = node switch { - case BaseHexNode _: - case FloatNode _: - case DoubleNode _: - case Int8Node _: - case UInt8Node _: - case Int16Node _: - case UInt16Node _: - case Int32Node _: - case UInt32Node _: - case Int64Node _: - case UInt64Node _: - case Utf8TextNode _: - case Utf16TextNode _: - case Utf32TextNode _: - nodeIsSearchableValueNode = true; - break; - } + BaseHexNode _ => true, + FloatNode _ => true, + DoubleNode _ => true, + Int8Node _ => true, + UInt8Node _ => true, + Int16Node _ => true, + UInt16Node _ => true, + Int32Node _ => true, + UInt32Node _ => true, + Int64Node _ => true, + UInt64Node _ => true, + NIntNode _ => true, + NUIntNode _ => true, + Utf8TextNode _ => true, + Utf16TextNode _ => true, + Utf32TextNode _ => true, + _ => false + }; addBytesToolStripMenuItem.Enabled = parentNode != null || nodeIsClass; insertBytesToolStripMenuItem.Enabled = count == 1 && parentNode != null; From 7406e05231404b78e3aae2d70c156137305f520a Mon Sep 17 00:00:00 2001 From: KN4CK3R Date: Sun, 18 Oct 2020 19:59:54 +0200 Subject: [PATCH 185/223] Added missing type settings to form. --- ReClass.NET/Forms/SettingsForm.Designer.cs | 2170 ++++++++++---------- ReClass.NET/Forms/SettingsForm.cs | 12 +- 2 files changed, 1124 insertions(+), 1058 deletions(-) diff --git a/ReClass.NET/Forms/SettingsForm.Designer.cs b/ReClass.NET/Forms/SettingsForm.Designer.cs index d00f8b9d..82e4efd9 100644 --- a/ReClass.NET/Forms/SettingsForm.Designer.cs +++ b/ReClass.NET/Forms/SettingsForm.Designer.cs @@ -30,1058 +30,1118 @@ protected override void Dispose(bool disposing) /// private void InitializeComponent() { - this.settingsTabControl = new System.Windows.Forms.TabControl(); - this.generalSettingsTabPage = new System.Windows.Forms.TabPage(); - this.fileAssociationGroupBox = new System.Windows.Forms.GroupBox(); - this.removeAssociationButton = new System.Windows.Forms.Button(); - this.createAssociationButton = new System.Windows.Forms.Button(); - this.associationInfoLabel = new System.Windows.Forms.Label(); - this.commentsGroupBox = new System.Windows.Forms.GroupBox(); - this.showPluginInfoCheckBox = new System.Windows.Forms.CheckBox(); - this.showStringCheckBox = new System.Windows.Forms.CheckBox(); - this.showSymbolsCheckBox = new System.Windows.Forms.CheckBox(); - this.showRttiCheckBox = new System.Windows.Forms.CheckBox(); - this.showPointerCheckBox = new System.Windows.Forms.CheckBox(); - this.showIntegerCheckBox = new System.Windows.Forms.CheckBox(); - this.showFloatCheckBox = new System.Windows.Forms.CheckBox(); - this.displayGroupBox = new System.Windows.Forms.GroupBox(); - this.randomizeWindowTitleCheckBox = new System.Windows.Forms.CheckBox(); - this.runAsAdminCheckBox = new System.Windows.Forms.CheckBox(); - this.highlightChangedValuesCheckBox = new System.Windows.Forms.CheckBox(); - this.showTextCheckBox = new System.Windows.Forms.CheckBox(); - this.showNodeOffsetCheckBox = new System.Windows.Forms.CheckBox(); - this.showNodeAddressCheckBox = new System.Windows.Forms.CheckBox(); - this.stayOnTopCheckBox = new System.Windows.Forms.CheckBox(); - this.colorsSettingTabPage = new System.Windows.Forms.TabPage(); - this.nodeColorGroupBox = new System.Windows.Forms.GroupBox(); - this.nodeValueLabel = new System.Windows.Forms.Label(); - this.nodePluginLabel = new System.Windows.Forms.Label(); - this.nodeHexValueColorBox = new ColorBox(); - this.nodePluginColorBox = new ColorBox(); - this.nodeHexValueLabel = new System.Windows.Forms.Label(); - this.nodeVTableLabel = new System.Windows.Forms.Label(); - this.nodeOffsetColorBox = new ColorBox(); - this.nodeVTableColorBox = new ColorBox(); - this.nodeOffsetLabel = new System.Windows.Forms.Label(); - this.nodeTextLabel = new System.Windows.Forms.Label(); - this.nodeAddressColorBox = new ColorBox(); - this.nodeTextColorBox = new ColorBox(); - this.nodeAddressLabel = new System.Windows.Forms.Label(); - this.nodeCommentLabel = new System.Windows.Forms.Label(); - this.nodeHiddenColorBox = new ColorBox(); - this.nodeCommentColorBox = new ColorBox(); - this.nodeHiddenLabel = new System.Windows.Forms.Label(); - this.nodeIndexLabel = new System.Windows.Forms.Label(); - this.nodeSelectedColorBox = new ColorBox(); - this.nodeIndexColorBox = new ColorBox(); - this.nodeSelectedLabel = new System.Windows.Forms.Label(); - this.nodeTypeColorBox = new ColorBox(); - this.nodeValueColorBox = new ColorBox(); - this.nodeTypeLabel = new System.Windows.Forms.Label(); - this.nodeNameLabel = new System.Windows.Forms.Label(); - this.nodeNameColorBox = new ColorBox(); - this.backgroundLabel = new System.Windows.Forms.Label(); - this.backgroundColorBox = new ColorBox(); - this.typeDefinitionsSettingsTabPage = new System.Windows.Forms.TabPage(); - this.boolSettingsLabel = new System.Windows.Forms.Label(); - this.boolTypeTextBox = new System.Windows.Forms.TextBox(); - this.label1 = new System.Windows.Forms.Label(); - this.functionPtrSettingsLabel = new System.Windows.Forms.Label(); - this.functionPtrTypeTextBox = new System.Windows.Forms.TextBox(); - this.utf16TextSettingsLabel = new System.Windows.Forms.Label(); - this.utf16TextTypeTextBox = new System.Windows.Forms.TextBox(); - this.utf8TextSettingsLabel = new System.Windows.Forms.Label(); - this.utf8TextTypeTextBox = new System.Windows.Forms.TextBox(); - this.matrix3x3SettingsLabel = new System.Windows.Forms.Label(); - this.matrix3x3TypeTextBox = new System.Windows.Forms.TextBox(); - this.matrix3x4SettingsLabel = new System.Windows.Forms.Label(); - this.matrix3x4TypeTextBox = new System.Windows.Forms.TextBox(); - this.matrix4x4SettingsLabel = new System.Windows.Forms.Label(); - this.matrix4x4TypeTextBox = new System.Windows.Forms.TextBox(); - this.vector2SettingsLabel = new System.Windows.Forms.Label(); - this.vector2TypeTextBox = new System.Windows.Forms.TextBox(); - this.vector3SettingsLabel = new System.Windows.Forms.Label(); - this.vector3TypeTextBox = new System.Windows.Forms.TextBox(); - this.vector4SettingsLabel = new System.Windows.Forms.Label(); - this.vector4TypeTextBox = new System.Windows.Forms.TextBox(); - this.doubleSettingsLabel = new System.Windows.Forms.Label(); - this.doubleTypeTextBox = new System.Windows.Forms.TextBox(); - this.floatSettingsLabel = new System.Windows.Forms.Label(); - this.floatTypeTextBox = new System.Windows.Forms.TextBox(); - this.uint64SettingsLabel = new System.Windows.Forms.Label(); - this.uint64TypeTextBox = new System.Windows.Forms.TextBox(); - this.uint32SettingsLabel = new System.Windows.Forms.Label(); - this.uint32TypeTextBox = new System.Windows.Forms.TextBox(); - this.uint16SettingsLabel = new System.Windows.Forms.Label(); - this.uint16TypeTextBox = new System.Windows.Forms.TextBox(); - this.uint8SettingsLabel = new System.Windows.Forms.Label(); - this.uint8TypeTextBox = new System.Windows.Forms.TextBox(); - this.int64SettingsLabel = new System.Windows.Forms.Label(); - this.int64TypeTextBox = new System.Windows.Forms.TextBox(); - this.int32SettingsLabel = new System.Windows.Forms.Label(); - this.int32TypeTextBox = new System.Windows.Forms.TextBox(); - this.int16SettingsLabel = new System.Windows.Forms.Label(); - this.int16TypeTextBox = new System.Windows.Forms.TextBox(); - this.int8SettingsLabel = new System.Windows.Forms.Label(); - this.int8TypeTextBox = new System.Windows.Forms.TextBox(); - this.bannerBox = new BannerBox(); - this.settingsTabControl.SuspendLayout(); - this.generalSettingsTabPage.SuspendLayout(); - this.fileAssociationGroupBox.SuspendLayout(); - this.commentsGroupBox.SuspendLayout(); - this.displayGroupBox.SuspendLayout(); - this.colorsSettingTabPage.SuspendLayout(); - this.nodeColorGroupBox.SuspendLayout(); - this.typeDefinitionsSettingsTabPage.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.bannerBox)).BeginInit(); - this.SuspendLayout(); - // - // settingsTabControl - // - this.settingsTabControl.Controls.Add(this.generalSettingsTabPage); - this.settingsTabControl.Controls.Add(this.colorsSettingTabPage); - this.settingsTabControl.Controls.Add(this.typeDefinitionsSettingsTabPage); - this.settingsTabControl.Location = new System.Drawing.Point(12, 60); - this.settingsTabControl.Name = "settingsTabControl"; - this.settingsTabControl.SelectedIndex = 0; - this.settingsTabControl.Size = new System.Drawing.Size(562, 355); - this.settingsTabControl.TabIndex = 1; - // - // generalSettingsTabPage - // - this.generalSettingsTabPage.Controls.Add(this.fileAssociationGroupBox); - this.generalSettingsTabPage.Controls.Add(this.commentsGroupBox); - this.generalSettingsTabPage.Controls.Add(this.displayGroupBox); - this.generalSettingsTabPage.Controls.Add(this.stayOnTopCheckBox); - this.generalSettingsTabPage.Location = new System.Drawing.Point(4, 22); - this.generalSettingsTabPage.Name = "generalSettingsTabPage"; - this.generalSettingsTabPage.Padding = new System.Windows.Forms.Padding(3); - this.generalSettingsTabPage.Size = new System.Drawing.Size(554, 329); - this.generalSettingsTabPage.TabIndex = 0; - this.generalSettingsTabPage.Text = "General"; - this.generalSettingsTabPage.UseVisualStyleBackColor = true; - // - // fileAssociationGroupBox - // - this.fileAssociationGroupBox.Controls.Add(this.removeAssociationButton); - this.fileAssociationGroupBox.Controls.Add(this.createAssociationButton); - this.fileAssociationGroupBox.Controls.Add(this.associationInfoLabel); - this.fileAssociationGroupBox.Location = new System.Drawing.Point(6, 231); - this.fileAssociationGroupBox.Name = "fileAssociationGroupBox"; - this.fileAssociationGroupBox.Size = new System.Drawing.Size(542, 85); - this.fileAssociationGroupBox.TabIndex = 4; - this.fileAssociationGroupBox.TabStop = false; - this.fileAssociationGroupBox.Text = "RCNET File Association"; - // - // removeAssociationButton - // - this.removeAssociationButton.FlatStyle = System.Windows.Forms.FlatStyle.System; - this.removeAssociationButton.Location = new System.Drawing.Point(146, 52); - this.removeAssociationButton.Name = "removeAssociationButton"; - this.removeAssociationButton.Size = new System.Drawing.Size(135, 23); - this.removeAssociationButton.TabIndex = 2; - this.removeAssociationButton.Text = "&Remove Association"; - this.removeAssociationButton.UseVisualStyleBackColor = true; - this.removeAssociationButton.Click += new System.EventHandler(this.removeAssociationButton_Click); - // - // createAssociationButton - // - this.createAssociationButton.FlatStyle = System.Windows.Forms.FlatStyle.System; - this.createAssociationButton.Location = new System.Drawing.Point(9, 52); - this.createAssociationButton.Name = "createAssociationButton"; - this.createAssociationButton.Size = new System.Drawing.Size(131, 23); - this.createAssociationButton.TabIndex = 1; - this.createAssociationButton.Text = "Create &Association"; - this.createAssociationButton.UseVisualStyleBackColor = true; - this.createAssociationButton.Click += new System.EventHandler(this.createAssociationButton_Click); - // - // associationInfoLabel - // - this.associationInfoLabel.Location = new System.Drawing.Point(6, 21); - this.associationInfoLabel.Name = "associationInfoLabel"; - this.associationInfoLabel.Size = new System.Drawing.Size(525, 28); - this.associationInfoLabel.TabIndex = 0; - this.associationInfoLabel.Text = "RCNET files can be associated with ReClass.NET. When you double-click a RCNET fil" + + this.settingsTabControl = new System.Windows.Forms.TabControl(); + this.generalSettingsTabPage = new System.Windows.Forms.TabPage(); + this.fileAssociationGroupBox = new System.Windows.Forms.GroupBox(); + this.removeAssociationButton = new System.Windows.Forms.Button(); + this.createAssociationButton = new System.Windows.Forms.Button(); + this.associationInfoLabel = new System.Windows.Forms.Label(); + this.commentsGroupBox = new System.Windows.Forms.GroupBox(); + this.showPluginInfoCheckBox = new System.Windows.Forms.CheckBox(); + this.showStringCheckBox = new System.Windows.Forms.CheckBox(); + this.showSymbolsCheckBox = new System.Windows.Forms.CheckBox(); + this.showRttiCheckBox = new System.Windows.Forms.CheckBox(); + this.showPointerCheckBox = new System.Windows.Forms.CheckBox(); + this.showIntegerCheckBox = new System.Windows.Forms.CheckBox(); + this.showFloatCheckBox = new System.Windows.Forms.CheckBox(); + this.displayGroupBox = new System.Windows.Forms.GroupBox(); + this.randomizeWindowTitleCheckBox = new System.Windows.Forms.CheckBox(); + this.runAsAdminCheckBox = new System.Windows.Forms.CheckBox(); + this.highlightChangedValuesCheckBox = new System.Windows.Forms.CheckBox(); + this.showTextCheckBox = new System.Windows.Forms.CheckBox(); + this.showNodeOffsetCheckBox = new System.Windows.Forms.CheckBox(); + this.showNodeAddressCheckBox = new System.Windows.Forms.CheckBox(); + this.stayOnTopCheckBox = new System.Windows.Forms.CheckBox(); + this.colorsSettingTabPage = new System.Windows.Forms.TabPage(); + this.nodeColorGroupBox = new System.Windows.Forms.GroupBox(); + this.nodeValueLabel = new System.Windows.Forms.Label(); + this.nodePluginLabel = new System.Windows.Forms.Label(); + this.nodeHexValueColorBox = new ReClassNET.Controls.ColorBox(); + this.nodePluginColorBox = new ReClassNET.Controls.ColorBox(); + this.nodeHexValueLabel = new System.Windows.Forms.Label(); + this.nodeVTableLabel = new System.Windows.Forms.Label(); + this.nodeOffsetColorBox = new ReClassNET.Controls.ColorBox(); + this.nodeVTableColorBox = new ReClassNET.Controls.ColorBox(); + this.nodeOffsetLabel = new System.Windows.Forms.Label(); + this.nodeTextLabel = new System.Windows.Forms.Label(); + this.nodeAddressColorBox = new ReClassNET.Controls.ColorBox(); + this.nodeTextColorBox = new ReClassNET.Controls.ColorBox(); + this.nodeAddressLabel = new System.Windows.Forms.Label(); + this.nodeCommentLabel = new System.Windows.Forms.Label(); + this.nodeHiddenColorBox = new ReClassNET.Controls.ColorBox(); + this.nodeCommentColorBox = new ReClassNET.Controls.ColorBox(); + this.nodeHiddenLabel = new System.Windows.Forms.Label(); + this.nodeIndexLabel = new System.Windows.Forms.Label(); + this.nodeSelectedColorBox = new ReClassNET.Controls.ColorBox(); + this.nodeIndexColorBox = new ReClassNET.Controls.ColorBox(); + this.nodeSelectedLabel = new System.Windows.Forms.Label(); + this.nodeTypeColorBox = new ReClassNET.Controls.ColorBox(); + this.nodeValueColorBox = new ReClassNET.Controls.ColorBox(); + this.nodeTypeLabel = new System.Windows.Forms.Label(); + this.nodeNameLabel = new System.Windows.Forms.Label(); + this.nodeNameColorBox = new ReClassNET.Controls.ColorBox(); + this.backgroundLabel = new System.Windows.Forms.Label(); + this.backgroundColorBox = new ReClassNET.Controls.ColorBox(); + this.typeDefinitionsSettingsTabPage = new System.Windows.Forms.TabPage(); + this.nuintSettingsLabel = new System.Windows.Forms.Label(); + this.nuintTypeTextBox = new System.Windows.Forms.TextBox(); + this.nintSettingsLabel = new System.Windows.Forms.Label(); + this.nintTypeTextBox = new System.Windows.Forms.TextBox(); + this.boolSettingsLabel = new System.Windows.Forms.Label(); + this.boolTypeTextBox = new System.Windows.Forms.TextBox(); + this.generatorInfoLabel = new System.Windows.Forms.Label(); + this.functionPtrSettingsLabel = new System.Windows.Forms.Label(); + this.functionPtrTypeTextBox = new System.Windows.Forms.TextBox(); + this.utf16TextSettingsLabel = new System.Windows.Forms.Label(); + this.utf16TextTypeTextBox = new System.Windows.Forms.TextBox(); + this.utf8TextSettingsLabel = new System.Windows.Forms.Label(); + this.utf8TextTypeTextBox = new System.Windows.Forms.TextBox(); + this.matrix3x3SettingsLabel = new System.Windows.Forms.Label(); + this.matrix3x3TypeTextBox = new System.Windows.Forms.TextBox(); + this.matrix3x4SettingsLabel = new System.Windows.Forms.Label(); + this.matrix3x4TypeTextBox = new System.Windows.Forms.TextBox(); + this.matrix4x4SettingsLabel = new System.Windows.Forms.Label(); + this.matrix4x4TypeTextBox = new System.Windows.Forms.TextBox(); + this.vector2SettingsLabel = new System.Windows.Forms.Label(); + this.vector2TypeTextBox = new System.Windows.Forms.TextBox(); + this.vector3SettingsLabel = new System.Windows.Forms.Label(); + this.vector3TypeTextBox = new System.Windows.Forms.TextBox(); + this.vector4SettingsLabel = new System.Windows.Forms.Label(); + this.vector4TypeTextBox = new System.Windows.Forms.TextBox(); + this.doubleSettingsLabel = new System.Windows.Forms.Label(); + this.doubleTypeTextBox = new System.Windows.Forms.TextBox(); + this.floatSettingsLabel = new System.Windows.Forms.Label(); + this.floatTypeTextBox = new System.Windows.Forms.TextBox(); + this.uint64SettingsLabel = new System.Windows.Forms.Label(); + this.uint64TypeTextBox = new System.Windows.Forms.TextBox(); + this.uint32SettingsLabel = new System.Windows.Forms.Label(); + this.uint32TypeTextBox = new System.Windows.Forms.TextBox(); + this.uint16SettingsLabel = new System.Windows.Forms.Label(); + this.uint16TypeTextBox = new System.Windows.Forms.TextBox(); + this.uint8SettingsLabel = new System.Windows.Forms.Label(); + this.uint8TypeTextBox = new System.Windows.Forms.TextBox(); + this.int64SettingsLabel = new System.Windows.Forms.Label(); + this.int64TypeTextBox = new System.Windows.Forms.TextBox(); + this.int32SettingsLabel = new System.Windows.Forms.Label(); + this.int32TypeTextBox = new System.Windows.Forms.TextBox(); + this.int16SettingsLabel = new System.Windows.Forms.Label(); + this.int16TypeTextBox = new System.Windows.Forms.TextBox(); + this.int8SettingsLabel = new System.Windows.Forms.Label(); + this.int8TypeTextBox = new System.Windows.Forms.TextBox(); + this.bannerBox = new ReClassNET.Controls.BannerBox(); + this.utf32TextSettingsLabel = new System.Windows.Forms.Label(); + this.utf32TextTypeTextBox = new System.Windows.Forms.TextBox(); + this.settingsTabControl.SuspendLayout(); + this.generalSettingsTabPage.SuspendLayout(); + this.fileAssociationGroupBox.SuspendLayout(); + this.commentsGroupBox.SuspendLayout(); + this.displayGroupBox.SuspendLayout(); + this.colorsSettingTabPage.SuspendLayout(); + this.nodeColorGroupBox.SuspendLayout(); + this.typeDefinitionsSettingsTabPage.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.bannerBox)).BeginInit(); + this.SuspendLayout(); + // + // settingsTabControl + // + this.settingsTabControl.Controls.Add(this.generalSettingsTabPage); + this.settingsTabControl.Controls.Add(this.colorsSettingTabPage); + this.settingsTabControl.Controls.Add(this.typeDefinitionsSettingsTabPage); + this.settingsTabControl.Location = new System.Drawing.Point(12, 60); + this.settingsTabControl.Name = "settingsTabControl"; + this.settingsTabControl.SelectedIndex = 0; + this.settingsTabControl.Size = new System.Drawing.Size(562, 355); + this.settingsTabControl.TabIndex = 1; + // + // generalSettingsTabPage + // + this.generalSettingsTabPage.Controls.Add(this.fileAssociationGroupBox); + this.generalSettingsTabPage.Controls.Add(this.commentsGroupBox); + this.generalSettingsTabPage.Controls.Add(this.displayGroupBox); + this.generalSettingsTabPage.Controls.Add(this.stayOnTopCheckBox); + this.generalSettingsTabPage.Location = new System.Drawing.Point(4, 22); + this.generalSettingsTabPage.Name = "generalSettingsTabPage"; + this.generalSettingsTabPage.Padding = new System.Windows.Forms.Padding(3); + this.generalSettingsTabPage.Size = new System.Drawing.Size(554, 329); + this.generalSettingsTabPage.TabIndex = 0; + this.generalSettingsTabPage.Text = "General"; + this.generalSettingsTabPage.UseVisualStyleBackColor = true; + // + // fileAssociationGroupBox + // + this.fileAssociationGroupBox.Controls.Add(this.removeAssociationButton); + this.fileAssociationGroupBox.Controls.Add(this.createAssociationButton); + this.fileAssociationGroupBox.Controls.Add(this.associationInfoLabel); + this.fileAssociationGroupBox.Location = new System.Drawing.Point(6, 231); + this.fileAssociationGroupBox.Name = "fileAssociationGroupBox"; + this.fileAssociationGroupBox.Size = new System.Drawing.Size(542, 85); + this.fileAssociationGroupBox.TabIndex = 4; + this.fileAssociationGroupBox.TabStop = false; + this.fileAssociationGroupBox.Text = "RCNET File Association"; + // + // removeAssociationButton + // + this.removeAssociationButton.FlatStyle = System.Windows.Forms.FlatStyle.System; + this.removeAssociationButton.Location = new System.Drawing.Point(146, 52); + this.removeAssociationButton.Name = "removeAssociationButton"; + this.removeAssociationButton.Size = new System.Drawing.Size(135, 23); + this.removeAssociationButton.TabIndex = 2; + this.removeAssociationButton.Text = "&Remove Association"; + this.removeAssociationButton.UseVisualStyleBackColor = true; + this.removeAssociationButton.Click += new System.EventHandler(this.removeAssociationButton_Click); + // + // createAssociationButton + // + this.createAssociationButton.FlatStyle = System.Windows.Forms.FlatStyle.System; + this.createAssociationButton.Location = new System.Drawing.Point(9, 52); + this.createAssociationButton.Name = "createAssociationButton"; + this.createAssociationButton.Size = new System.Drawing.Size(131, 23); + this.createAssociationButton.TabIndex = 1; + this.createAssociationButton.Text = "Create &Association"; + this.createAssociationButton.UseVisualStyleBackColor = true; + this.createAssociationButton.Click += new System.EventHandler(this.createAssociationButton_Click); + // + // associationInfoLabel + // + this.associationInfoLabel.Location = new System.Drawing.Point(6, 21); + this.associationInfoLabel.Name = "associationInfoLabel"; + this.associationInfoLabel.Size = new System.Drawing.Size(525, 28); + this.associationInfoLabel.TabIndex = 0; + this.associationInfoLabel.Text = "RCNET files can be associated with ReClass.NET. When you double-click a RCNET fil" + "e, they will automatically be opened by ReClass.NET."; - // - // commentsGroupBox - // - this.commentsGroupBox.Controls.Add(this.showPluginInfoCheckBox); - this.commentsGroupBox.Controls.Add(this.showStringCheckBox); - this.commentsGroupBox.Controls.Add(this.showSymbolsCheckBox); - this.commentsGroupBox.Controls.Add(this.showRttiCheckBox); - this.commentsGroupBox.Controls.Add(this.showPointerCheckBox); - this.commentsGroupBox.Controls.Add(this.showIntegerCheckBox); - this.commentsGroupBox.Controls.Add(this.showFloatCheckBox); - this.commentsGroupBox.Location = new System.Drawing.Point(6, 39); - this.commentsGroupBox.Name = "commentsGroupBox"; - this.commentsGroupBox.Size = new System.Drawing.Size(265, 186); - this.commentsGroupBox.TabIndex = 3; - this.commentsGroupBox.TabStop = false; - this.commentsGroupBox.Text = "Node Comments"; - // - // showPluginInfoCheckBox - // - this.showPluginInfoCheckBox.AutoSize = true; - this.showPluginInfoCheckBox.Location = new System.Drawing.Point(6, 157); - this.showPluginInfoCheckBox.Name = "showPluginInfoCheckBox"; - this.showPluginInfoCheckBox.Size = new System.Drawing.Size(111, 17); - this.showPluginInfoCheckBox.TabIndex = 6; - this.showPluginInfoCheckBox.Text = "Show Plugin Infos"; - this.showPluginInfoCheckBox.UseVisualStyleBackColor = true; - // - // showStringCheckBox - // - this.showStringCheckBox.AutoSize = true; - this.showStringCheckBox.Location = new System.Drawing.Point(6, 134); - this.showStringCheckBox.Name = "showStringCheckBox"; - this.showStringCheckBox.Size = new System.Drawing.Size(88, 17); - this.showStringCheckBox.TabIndex = 5; - this.showStringCheckBox.Text = "Show Strings"; - this.showStringCheckBox.UseVisualStyleBackColor = true; - // - // showSymbolsCheckBox - // - this.showSymbolsCheckBox.AutoSize = true; - this.showSymbolsCheckBox.Location = new System.Drawing.Point(6, 111); - this.showSymbolsCheckBox.Name = "showSymbolsCheckBox"; - this.showSymbolsCheckBox.Size = new System.Drawing.Size(130, 17); - this.showSymbolsCheckBox.TabIndex = 4; - this.showSymbolsCheckBox.Text = "Show Debug Symbols"; - this.showSymbolsCheckBox.UseVisualStyleBackColor = true; - // - // showRttiCheckBox - // - this.showRttiCheckBox.AutoSize = true; - this.showRttiCheckBox.Location = new System.Drawing.Point(6, 88); - this.showRttiCheckBox.Name = "showRttiCheckBox"; - this.showRttiCheckBox.Size = new System.Drawing.Size(81, 17); - this.showRttiCheckBox.TabIndex = 3; - this.showRttiCheckBox.Text = "Show RTTI"; - this.showRttiCheckBox.UseVisualStyleBackColor = true; - // - // showPointerCheckBox - // - this.showPointerCheckBox.AutoSize = true; - this.showPointerCheckBox.Location = new System.Drawing.Point(6, 65); - this.showPointerCheckBox.Name = "showPointerCheckBox"; - this.showPointerCheckBox.Size = new System.Drawing.Size(94, 17); - this.showPointerCheckBox.TabIndex = 2; - this.showPointerCheckBox.Text = "Show Pointers"; - this.showPointerCheckBox.UseVisualStyleBackColor = true; - // - // showIntegerCheckBox - // - this.showIntegerCheckBox.AutoSize = true; - this.showIntegerCheckBox.Location = new System.Drawing.Point(6, 42); - this.showIntegerCheckBox.Name = "showIntegerCheckBox"; - this.showIntegerCheckBox.Size = new System.Drawing.Size(124, 17); - this.showIntegerCheckBox.TabIndex = 1; - this.showIntegerCheckBox.Text = "Show Integer Values"; - this.showIntegerCheckBox.UseVisualStyleBackColor = true; - // - // showFloatCheckBox - // - this.showFloatCheckBox.AutoSize = true; - this.showFloatCheckBox.Location = new System.Drawing.Point(6, 19); - this.showFloatCheckBox.Name = "showFloatCheckBox"; - this.showFloatCheckBox.Size = new System.Drawing.Size(114, 17); - this.showFloatCheckBox.TabIndex = 0; - this.showFloatCheckBox.Text = "Show Float Values"; - this.showFloatCheckBox.UseVisualStyleBackColor = true; - // - // displayGroupBox - // - this.displayGroupBox.Controls.Add(this.randomizeWindowTitleCheckBox); - this.displayGroupBox.Controls.Add(this.runAsAdminCheckBox); - this.displayGroupBox.Controls.Add(this.highlightChangedValuesCheckBox); - this.displayGroupBox.Controls.Add(this.showTextCheckBox); - this.displayGroupBox.Controls.Add(this.showNodeOffsetCheckBox); - this.displayGroupBox.Controls.Add(this.showNodeAddressCheckBox); - this.displayGroupBox.Location = new System.Drawing.Point(283, 39); - this.displayGroupBox.Name = "displayGroupBox"; - this.displayGroupBox.Size = new System.Drawing.Size(265, 160); - this.displayGroupBox.TabIndex = 2; - this.displayGroupBox.TabStop = false; - this.displayGroupBox.Text = "Display"; - // - // randomizeWindowTitleCheckBox - // - this.randomizeWindowTitleCheckBox.AutoSize = true; - this.randomizeWindowTitleCheckBox.Location = new System.Drawing.Point(6, 134); - this.randomizeWindowTitleCheckBox.Name = "randomizeWindowTitleCheckBox"; - this.randomizeWindowTitleCheckBox.Size = new System.Drawing.Size(137, 17); - this.randomizeWindowTitleCheckBox.TabIndex = 5; - this.randomizeWindowTitleCheckBox.Text = "Randomize window title"; - this.randomizeWindowTitleCheckBox.UseVisualStyleBackColor = true; - // - // runAsAdminCheckBox - // - this.runAsAdminCheckBox.AutoSize = true; - this.runAsAdminCheckBox.Location = new System.Drawing.Point(6, 111); - this.runAsAdminCheckBox.Name = "runAsAdminCheckBox"; - this.runAsAdminCheckBox.Size = new System.Drawing.Size(200, 17); - this.runAsAdminCheckBox.TabIndex = 4; - this.runAsAdminCheckBox.Text = "Run as administrator (requires restart)"; - this.runAsAdminCheckBox.UseVisualStyleBackColor = true; - // - // highlightChangedValuesCheckBox - // - this.highlightChangedValuesCheckBox.AutoSize = true; - this.highlightChangedValuesCheckBox.Location = new System.Drawing.Point(6, 88); - this.highlightChangedValuesCheckBox.Name = "highlightChangedValuesCheckBox"; - this.highlightChangedValuesCheckBox.Size = new System.Drawing.Size(148, 17); - this.highlightChangedValuesCheckBox.TabIndex = 3; - this.highlightChangedValuesCheckBox.Text = "Highlight Changed Values"; - this.highlightChangedValuesCheckBox.UseVisualStyleBackColor = true; - // - // showTextCheckBox - // - this.showTextCheckBox.AutoSize = true; - this.showTextCheckBox.Location = new System.Drawing.Point(6, 65); - this.showTextCheckBox.Name = "showTextCheckBox"; - this.showTextCheckBox.Size = new System.Drawing.Size(166, 17); - this.showTextCheckBox.TabIndex = 2; - this.showTextCheckBox.Text = "Show Textual Representation"; - this.showTextCheckBox.UseVisualStyleBackColor = true; - // - // showNodeOffsetCheckBox - // - this.showNodeOffsetCheckBox.AutoSize = true; - this.showNodeOffsetCheckBox.Location = new System.Drawing.Point(6, 42); - this.showNodeOffsetCheckBox.Name = "showNodeOffsetCheckBox"; - this.showNodeOffsetCheckBox.Size = new System.Drawing.Size(113, 17); - this.showNodeOffsetCheckBox.TabIndex = 1; - this.showNodeOffsetCheckBox.Text = "Show Node Offset"; - this.showNodeOffsetCheckBox.UseVisualStyleBackColor = true; - // - // showNodeAddressCheckBox - // - this.showNodeAddressCheckBox.AutoSize = true; - this.showNodeAddressCheckBox.Location = new System.Drawing.Point(6, 19); - this.showNodeAddressCheckBox.Name = "showNodeAddressCheckBox"; - this.showNodeAddressCheckBox.Size = new System.Drawing.Size(123, 17); - this.showNodeAddressCheckBox.TabIndex = 0; - this.showNodeAddressCheckBox.Text = "Show Node Address"; - this.showNodeAddressCheckBox.UseVisualStyleBackColor = true; - // - // stayOnTopCheckBox - // - this.stayOnTopCheckBox.AutoSize = true; - this.stayOnTopCheckBox.Location = new System.Drawing.Point(6, 6); - this.stayOnTopCheckBox.Name = "stayOnTopCheckBox"; - this.stayOnTopCheckBox.Size = new System.Drawing.Size(187, 17); - this.stayOnTopCheckBox.TabIndex = 1; - this.stayOnTopCheckBox.Text = "Force ReClass.NET to stay on top"; - this.stayOnTopCheckBox.UseVisualStyleBackColor = true; - // - // colorsSettingTabPage - // - this.colorsSettingTabPage.Controls.Add(this.nodeColorGroupBox); - this.colorsSettingTabPage.Controls.Add(this.backgroundLabel); - this.colorsSettingTabPage.Controls.Add(this.backgroundColorBox); - this.colorsSettingTabPage.Location = new System.Drawing.Point(4, 22); - this.colorsSettingTabPage.Name = "colorsSettingTabPage"; - this.colorsSettingTabPage.Padding = new System.Windows.Forms.Padding(3); - this.colorsSettingTabPage.Size = new System.Drawing.Size(554, 329); - this.colorsSettingTabPage.TabIndex = 1; - this.colorsSettingTabPage.Text = "Colors"; - this.colorsSettingTabPage.UseVisualStyleBackColor = true; - // - // nodeColorGroupBox - // - this.nodeColorGroupBox.Controls.Add(this.nodeValueLabel); - this.nodeColorGroupBox.Controls.Add(this.nodePluginLabel); - this.nodeColorGroupBox.Controls.Add(this.nodeHexValueColorBox); - this.nodeColorGroupBox.Controls.Add(this.nodePluginColorBox); - this.nodeColorGroupBox.Controls.Add(this.nodeHexValueLabel); - this.nodeColorGroupBox.Controls.Add(this.nodeVTableLabel); - this.nodeColorGroupBox.Controls.Add(this.nodeOffsetColorBox); - this.nodeColorGroupBox.Controls.Add(this.nodeVTableColorBox); - this.nodeColorGroupBox.Controls.Add(this.nodeOffsetLabel); - this.nodeColorGroupBox.Controls.Add(this.nodeTextLabel); - this.nodeColorGroupBox.Controls.Add(this.nodeAddressColorBox); - this.nodeColorGroupBox.Controls.Add(this.nodeTextColorBox); - this.nodeColorGroupBox.Controls.Add(this.nodeAddressLabel); - this.nodeColorGroupBox.Controls.Add(this.nodeCommentLabel); - this.nodeColorGroupBox.Controls.Add(this.nodeHiddenColorBox); - this.nodeColorGroupBox.Controls.Add(this.nodeCommentColorBox); - this.nodeColorGroupBox.Controls.Add(this.nodeHiddenLabel); - this.nodeColorGroupBox.Controls.Add(this.nodeIndexLabel); - this.nodeColorGroupBox.Controls.Add(this.nodeSelectedColorBox); - this.nodeColorGroupBox.Controls.Add(this.nodeIndexColorBox); - this.nodeColorGroupBox.Controls.Add(this.nodeSelectedLabel); - this.nodeColorGroupBox.Controls.Add(this.nodeTypeColorBox); - this.nodeColorGroupBox.Controls.Add(this.nodeValueColorBox); - this.nodeColorGroupBox.Controls.Add(this.nodeTypeLabel); - this.nodeColorGroupBox.Controls.Add(this.nodeNameLabel); - this.nodeColorGroupBox.Controls.Add(this.nodeNameColorBox); - this.nodeColorGroupBox.Location = new System.Drawing.Point(9, 43); - this.nodeColorGroupBox.Name = "nodeColorGroupBox"; - this.nodeColorGroupBox.Size = new System.Drawing.Size(539, 225); - this.nodeColorGroupBox.TabIndex = 28; - this.nodeColorGroupBox.TabStop = false; - this.nodeColorGroupBox.Text = "Node Colors"; - // - // nodeValueLabel - // - this.nodeValueLabel.AutoSize = true; - this.nodeValueLabel.Location = new System.Drawing.Point(9, 198); - this.nodeValueLabel.Name = "nodeValueLabel"; - this.nodeValueLabel.Size = new System.Drawing.Size(64, 13); - this.nodeValueLabel.TabIndex = 17; - this.nodeValueLabel.Text = "Value Color:"; - // - // nodePluginLabel - // - this.nodePluginLabel.AutoSize = true; - this.nodePluginLabel.Location = new System.Drawing.Point(286, 172); - this.nodePluginLabel.Name = "nodePluginLabel"; - this.nodePluginLabel.Size = new System.Drawing.Size(87, 13); - this.nodePluginLabel.TabIndex = 27; - this.nodePluginLabel.Text = "Plugin Info Color:"; - // - // nodeHexValueColorBox - // - this.nodeHexValueColorBox.Color = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))); - this.nodeHexValueColorBox.Location = new System.Drawing.Point(133, 117); - this.nodeHexValueColorBox.Name = "nodeHexValueColorBox"; - this.nodeHexValueColorBox.Size = new System.Drawing.Size(123, 20); - this.nodeHexValueColorBox.TabIndex = 2; - // - // nodePluginColorBox - // - this.nodePluginColorBox.Color = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))); - this.nodePluginColorBox.Location = new System.Drawing.Point(410, 169); - this.nodePluginColorBox.Name = "nodePluginColorBox"; - this.nodePluginColorBox.Size = new System.Drawing.Size(123, 20); - this.nodePluginColorBox.TabIndex = 26; - // - // nodeHexValueLabel - // - this.nodeHexValueLabel.AutoSize = true; - this.nodeHexValueLabel.Location = new System.Drawing.Point(9, 120); - this.nodeHexValueLabel.Name = "nodeHexValueLabel"; - this.nodeHexValueLabel.Size = new System.Drawing.Size(86, 13); - this.nodeHexValueLabel.TabIndex = 3; - this.nodeHexValueLabel.Text = "Hex Value Color:"; - // - // nodeVTableLabel - // - this.nodeVTableLabel.AutoSize = true; - this.nodeVTableLabel.Location = new System.Drawing.Point(286, 94); - this.nodeVTableLabel.Name = "nodeVTableLabel"; - this.nodeVTableLabel.Size = new System.Drawing.Size(71, 13); - this.nodeVTableLabel.TabIndex = 25; - this.nodeVTableLabel.Text = "VTable Color:"; - // - // nodeOffsetColorBox - // - this.nodeOffsetColorBox.Color = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))); - this.nodeOffsetColorBox.Location = new System.Drawing.Point(133, 91); - this.nodeOffsetColorBox.Name = "nodeOffsetColorBox"; - this.nodeOffsetColorBox.Size = new System.Drawing.Size(123, 20); - this.nodeOffsetColorBox.TabIndex = 4; - // - // nodeVTableColorBox - // - this.nodeVTableColorBox.Color = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))); - this.nodeVTableColorBox.Location = new System.Drawing.Point(410, 91); - this.nodeVTableColorBox.Name = "nodeVTableColorBox"; - this.nodeVTableColorBox.Size = new System.Drawing.Size(123, 20); - this.nodeVTableColorBox.TabIndex = 24; - // - // nodeOffsetLabel - // - this.nodeOffsetLabel.AutoSize = true; - this.nodeOffsetLabel.Location = new System.Drawing.Point(9, 94); - this.nodeOffsetLabel.Name = "nodeOffsetLabel"; - this.nodeOffsetLabel.Size = new System.Drawing.Size(65, 13); - this.nodeOffsetLabel.TabIndex = 5; - this.nodeOffsetLabel.Text = "Offset Color:"; - // - // nodeTextLabel - // - this.nodeTextLabel.AutoSize = true; - this.nodeTextLabel.Location = new System.Drawing.Point(286, 146); - this.nodeTextLabel.Name = "nodeTextLabel"; - this.nodeTextLabel.Size = new System.Drawing.Size(58, 13); - this.nodeTextLabel.TabIndex = 23; - this.nodeTextLabel.Text = "Text Color:"; - // - // nodeAddressColorBox - // - this.nodeAddressColorBox.Color = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))); - this.nodeAddressColorBox.Location = new System.Drawing.Point(133, 65); - this.nodeAddressColorBox.Name = "nodeAddressColorBox"; - this.nodeAddressColorBox.Size = new System.Drawing.Size(123, 20); - this.nodeAddressColorBox.TabIndex = 6; - // - // nodeTextColorBox - // - this.nodeTextColorBox.Color = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))); - this.nodeTextColorBox.Location = new System.Drawing.Point(410, 143); - this.nodeTextColorBox.Name = "nodeTextColorBox"; - this.nodeTextColorBox.Size = new System.Drawing.Size(123, 20); - this.nodeTextColorBox.TabIndex = 22; - // - // nodeAddressLabel - // - this.nodeAddressLabel.AutoSize = true; - this.nodeAddressLabel.Location = new System.Drawing.Point(9, 68); - this.nodeAddressLabel.Name = "nodeAddressLabel"; - this.nodeAddressLabel.Size = new System.Drawing.Size(75, 13); - this.nodeAddressLabel.TabIndex = 7; - this.nodeAddressLabel.Text = "Address Color:"; - // - // nodeCommentLabel - // - this.nodeCommentLabel.AutoSize = true; - this.nodeCommentLabel.Location = new System.Drawing.Point(286, 120); - this.nodeCommentLabel.Name = "nodeCommentLabel"; - this.nodeCommentLabel.Size = new System.Drawing.Size(81, 13); - this.nodeCommentLabel.TabIndex = 21; - this.nodeCommentLabel.Text = "Comment Color:"; - // - // nodeHiddenColorBox - // - this.nodeHiddenColorBox.Color = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))); - this.nodeHiddenColorBox.Location = new System.Drawing.Point(410, 18); - this.nodeHiddenColorBox.Name = "nodeHiddenColorBox"; - this.nodeHiddenColorBox.Size = new System.Drawing.Size(123, 20); - this.nodeHiddenColorBox.TabIndex = 8; - // - // nodeCommentColorBox - // - this.nodeCommentColorBox.Color = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))); - this.nodeCommentColorBox.Location = new System.Drawing.Point(410, 117); - this.nodeCommentColorBox.Name = "nodeCommentColorBox"; - this.nodeCommentColorBox.Size = new System.Drawing.Size(123, 20); - this.nodeCommentColorBox.TabIndex = 20; - // - // nodeHiddenLabel - // - this.nodeHiddenLabel.AutoSize = true; - this.nodeHiddenLabel.Location = new System.Drawing.Point(286, 21); - this.nodeHiddenLabel.Name = "nodeHiddenLabel"; - this.nodeHiddenLabel.Size = new System.Drawing.Size(71, 13); - this.nodeHiddenLabel.TabIndex = 9; - this.nodeHiddenLabel.Text = "Hidden Color:"; - // - // nodeIndexLabel - // - this.nodeIndexLabel.AutoSize = true; - this.nodeIndexLabel.Location = new System.Drawing.Point(286, 68); - this.nodeIndexLabel.Name = "nodeIndexLabel"; - this.nodeIndexLabel.Size = new System.Drawing.Size(63, 13); - this.nodeIndexLabel.TabIndex = 19; - this.nodeIndexLabel.Text = "Index Color:"; - // - // nodeSelectedColorBox - // - this.nodeSelectedColorBox.Color = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))); - this.nodeSelectedColorBox.Location = new System.Drawing.Point(133, 18); - this.nodeSelectedColorBox.Name = "nodeSelectedColorBox"; - this.nodeSelectedColorBox.Size = new System.Drawing.Size(123, 20); - this.nodeSelectedColorBox.TabIndex = 10; - // - // nodeIndexColorBox - // - this.nodeIndexColorBox.Color = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))); - this.nodeIndexColorBox.Location = new System.Drawing.Point(410, 65); - this.nodeIndexColorBox.Name = "nodeIndexColorBox"; - this.nodeIndexColorBox.Size = new System.Drawing.Size(123, 20); - this.nodeIndexColorBox.TabIndex = 18; - // - // nodeSelectedLabel - // - this.nodeSelectedLabel.AutoSize = true; - this.nodeSelectedLabel.Location = new System.Drawing.Point(9, 21); - this.nodeSelectedLabel.Name = "nodeSelectedLabel"; - this.nodeSelectedLabel.Size = new System.Drawing.Size(79, 13); - this.nodeSelectedLabel.TabIndex = 11; - this.nodeSelectedLabel.Text = "Selected Color:"; - // - // nodeTypeColorBox - // - this.nodeTypeColorBox.Color = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))); - this.nodeTypeColorBox.Location = new System.Drawing.Point(133, 143); - this.nodeTypeColorBox.Name = "nodeTypeColorBox"; - this.nodeTypeColorBox.Size = new System.Drawing.Size(123, 20); - this.nodeTypeColorBox.TabIndex = 12; - // - // nodeValueColorBox - // - this.nodeValueColorBox.Color = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))); - this.nodeValueColorBox.Location = new System.Drawing.Point(133, 195); - this.nodeValueColorBox.Name = "nodeValueColorBox"; - this.nodeValueColorBox.Size = new System.Drawing.Size(123, 20); - this.nodeValueColorBox.TabIndex = 16; - // - // nodeTypeLabel - // - this.nodeTypeLabel.AutoSize = true; - this.nodeTypeLabel.Location = new System.Drawing.Point(9, 146); - this.nodeTypeLabel.Name = "nodeTypeLabel"; - this.nodeTypeLabel.Size = new System.Drawing.Size(61, 13); - this.nodeTypeLabel.TabIndex = 13; - this.nodeTypeLabel.Text = "Type Color:"; - // - // nodeNameLabel - // - this.nodeNameLabel.AutoSize = true; - this.nodeNameLabel.Location = new System.Drawing.Point(9, 172); - this.nodeNameLabel.Name = "nodeNameLabel"; - this.nodeNameLabel.Size = new System.Drawing.Size(65, 13); - this.nodeNameLabel.TabIndex = 15; - this.nodeNameLabel.Text = "Name Color:"; - // - // nodeNameColorBox - // - this.nodeNameColorBox.Color = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))); - this.nodeNameColorBox.Location = new System.Drawing.Point(133, 169); - this.nodeNameColorBox.Name = "nodeNameColorBox"; - this.nodeNameColorBox.Size = new System.Drawing.Size(123, 20); - this.nodeNameColorBox.TabIndex = 14; - // - // backgroundLabel - // - this.backgroundLabel.AutoSize = true; - this.backgroundLabel.Location = new System.Drawing.Point(6, 14); - this.backgroundLabel.Name = "backgroundLabel"; - this.backgroundLabel.Size = new System.Drawing.Size(161, 13); - this.backgroundLabel.TabIndex = 1; - this.backgroundLabel.Text = "Memory View Background Color:"; - // - // backgroundColorBox - // - this.backgroundColorBox.Color = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))); - this.backgroundColorBox.Location = new System.Drawing.Point(175, 11); - this.backgroundColorBox.Name = "backgroundColorBox"; - this.backgroundColorBox.Size = new System.Drawing.Size(123, 20); - this.backgroundColorBox.TabIndex = 0; - // - // typeDefinitionsSettingsTabPage - // - this.typeDefinitionsSettingsTabPage.Controls.Add(this.boolSettingsLabel); - this.typeDefinitionsSettingsTabPage.Controls.Add(this.boolTypeTextBox); - this.typeDefinitionsSettingsTabPage.Controls.Add(this.label1); - this.typeDefinitionsSettingsTabPage.Controls.Add(this.functionPtrSettingsLabel); - this.typeDefinitionsSettingsTabPage.Controls.Add(this.functionPtrTypeTextBox); - this.typeDefinitionsSettingsTabPage.Controls.Add(this.utf16TextSettingsLabel); - this.typeDefinitionsSettingsTabPage.Controls.Add(this.utf16TextTypeTextBox); - this.typeDefinitionsSettingsTabPage.Controls.Add(this.utf8TextSettingsLabel); - this.typeDefinitionsSettingsTabPage.Controls.Add(this.utf8TextTypeTextBox); - this.typeDefinitionsSettingsTabPage.Controls.Add(this.matrix3x3SettingsLabel); - this.typeDefinitionsSettingsTabPage.Controls.Add(this.matrix3x3TypeTextBox); - this.typeDefinitionsSettingsTabPage.Controls.Add(this.matrix3x4SettingsLabel); - this.typeDefinitionsSettingsTabPage.Controls.Add(this.matrix3x4TypeTextBox); - this.typeDefinitionsSettingsTabPage.Controls.Add(this.matrix4x4SettingsLabel); - this.typeDefinitionsSettingsTabPage.Controls.Add(this.matrix4x4TypeTextBox); - this.typeDefinitionsSettingsTabPage.Controls.Add(this.vector2SettingsLabel); - this.typeDefinitionsSettingsTabPage.Controls.Add(this.vector2TypeTextBox); - this.typeDefinitionsSettingsTabPage.Controls.Add(this.vector3SettingsLabel); - this.typeDefinitionsSettingsTabPage.Controls.Add(this.vector3TypeTextBox); - this.typeDefinitionsSettingsTabPage.Controls.Add(this.vector4SettingsLabel); - this.typeDefinitionsSettingsTabPage.Controls.Add(this.vector4TypeTextBox); - this.typeDefinitionsSettingsTabPage.Controls.Add(this.doubleSettingsLabel); - this.typeDefinitionsSettingsTabPage.Controls.Add(this.doubleTypeTextBox); - this.typeDefinitionsSettingsTabPage.Controls.Add(this.floatSettingsLabel); - this.typeDefinitionsSettingsTabPage.Controls.Add(this.floatTypeTextBox); - this.typeDefinitionsSettingsTabPage.Controls.Add(this.uint64SettingsLabel); - this.typeDefinitionsSettingsTabPage.Controls.Add(this.uint64TypeTextBox); - this.typeDefinitionsSettingsTabPage.Controls.Add(this.uint32SettingsLabel); - this.typeDefinitionsSettingsTabPage.Controls.Add(this.uint32TypeTextBox); - this.typeDefinitionsSettingsTabPage.Controls.Add(this.uint16SettingsLabel); - this.typeDefinitionsSettingsTabPage.Controls.Add(this.uint16TypeTextBox); - this.typeDefinitionsSettingsTabPage.Controls.Add(this.uint8SettingsLabel); - this.typeDefinitionsSettingsTabPage.Controls.Add(this.uint8TypeTextBox); - this.typeDefinitionsSettingsTabPage.Controls.Add(this.int64SettingsLabel); - this.typeDefinitionsSettingsTabPage.Controls.Add(this.int64TypeTextBox); - this.typeDefinitionsSettingsTabPage.Controls.Add(this.int32SettingsLabel); - this.typeDefinitionsSettingsTabPage.Controls.Add(this.int32TypeTextBox); - this.typeDefinitionsSettingsTabPage.Controls.Add(this.int16SettingsLabel); - this.typeDefinitionsSettingsTabPage.Controls.Add(this.int16TypeTextBox); - this.typeDefinitionsSettingsTabPage.Controls.Add(this.int8SettingsLabel); - this.typeDefinitionsSettingsTabPage.Controls.Add(this.int8TypeTextBox); - this.typeDefinitionsSettingsTabPage.Location = new System.Drawing.Point(4, 22); - this.typeDefinitionsSettingsTabPage.Name = "typeDefinitionsSettingsTabPage"; - this.typeDefinitionsSettingsTabPage.Padding = new System.Windows.Forms.Padding(3); - this.typeDefinitionsSettingsTabPage.Size = new System.Drawing.Size(554, 329); - this.typeDefinitionsSettingsTabPage.TabIndex = 2; - this.typeDefinitionsSettingsTabPage.Text = "Type Definitions"; - this.typeDefinitionsSettingsTabPage.UseVisualStyleBackColor = true; - // - // boolSettingsLabel - // - this.boolSettingsLabel.AutoSize = true; - this.boolSettingsLabel.Location = new System.Drawing.Point(254, 35); - this.boolSettingsLabel.Name = "boolSettingsLabel"; - this.boolSettingsLabel.Size = new System.Drawing.Size(31, 13); - this.boolSettingsLabel.TabIndex = 46; - this.boolSettingsLabel.Text = "Bool:"; - // - // boolTypeTextBox - // - this.boolTypeTextBox.Location = new System.Drawing.Point(346, 32); - this.boolTypeTextBox.Name = "boolTypeTextBox"; - this.boolTypeTextBox.Size = new System.Drawing.Size(120, 20); - this.boolTypeTextBox.TabIndex = 45; - // - // label1 - // - this.label1.AutoSize = true; - this.label1.Location = new System.Drawing.Point(6, 6); - this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(214, 13); - this.label1.TabIndex = 44; - this.label1.Text = "These types are used to generate the code:"; - // - // functionPtrSettingsLabel - // - this.functionPtrSettingsLabel.AutoSize = true; - this.functionPtrSettingsLabel.Location = new System.Drawing.Point(254, 233); - this.functionPtrSettingsLabel.Name = "functionPtrSettingsLabel"; - this.functionPtrSettingsLabel.Size = new System.Drawing.Size(87, 13); - this.functionPtrSettingsLabel.TabIndex = 43; - this.functionPtrSettingsLabel.Text = "Function Pointer:"; - // - // functionPtrTypeTextBox - // - this.functionPtrTypeTextBox.Location = new System.Drawing.Point(346, 230); - this.functionPtrTypeTextBox.Name = "functionPtrTypeTextBox"; - this.functionPtrTypeTextBox.Size = new System.Drawing.Size(120, 20); - this.functionPtrTypeTextBox.TabIndex = 42; - // - // utf16TextSettingsLabel - // - this.utf16TextSettingsLabel.AutoSize = true; - this.utf16TextSettingsLabel.Location = new System.Drawing.Point(254, 211); - this.utf16TextSettingsLabel.Name = "utf16TextSettingsLabel"; - this.utf16TextSettingsLabel.Size = new System.Drawing.Size(43, 13); - this.utf16TextSettingsLabel.TabIndex = 39; - this.utf16TextSettingsLabel.Text = "UTF16:"; - // - // utf16TextTypeTextBox - // - this.utf16TextTypeTextBox.Location = new System.Drawing.Point(346, 208); - this.utf16TextTypeTextBox.Name = "utf16TextTypeTextBox"; - this.utf16TextTypeTextBox.Size = new System.Drawing.Size(120, 20); - this.utf16TextTypeTextBox.TabIndex = 38; - // - // utf8TextSettingsLabel - // - this.utf8TextSettingsLabel.AutoSize = true; - this.utf8TextSettingsLabel.Location = new System.Drawing.Point(254, 189); - this.utf8TextSettingsLabel.Name = "utf8TextSettingsLabel"; - this.utf8TextSettingsLabel.Size = new System.Drawing.Size(37, 13); - this.utf8TextSettingsLabel.TabIndex = 35; - this.utf8TextSettingsLabel.Text = "UTF8:"; - // - // utf8TextTypeTextBox - // - this.utf8TextTypeTextBox.Location = new System.Drawing.Point(346, 186); - this.utf8TextTypeTextBox.Name = "utf8TextTypeTextBox"; - this.utf8TextTypeTextBox.Size = new System.Drawing.Size(120, 20); - this.utf8TextTypeTextBox.TabIndex = 34; - // - // matrix3x3SettingsLabel - // - this.matrix3x3SettingsLabel.AutoSize = true; - this.matrix3x3SettingsLabel.Location = new System.Drawing.Point(254, 123); - this.matrix3x3SettingsLabel.Name = "matrix3x3SettingsLabel"; - this.matrix3x3SettingsLabel.Size = new System.Drawing.Size(64, 13); - this.matrix3x3SettingsLabel.TabIndex = 33; - this.matrix3x3SettingsLabel.Text = "Matrix (3x3):"; - // - // matrix3x3TypeTextBox - // - this.matrix3x3TypeTextBox.Location = new System.Drawing.Point(346, 120); - this.matrix3x3TypeTextBox.Name = "matrix3x3TypeTextBox"; - this.matrix3x3TypeTextBox.Size = new System.Drawing.Size(120, 20); - this.matrix3x3TypeTextBox.TabIndex = 32; - // - // matrix3x4SettingsLabel - // - this.matrix3x4SettingsLabel.AutoSize = true; - this.matrix3x4SettingsLabel.Location = new System.Drawing.Point(254, 145); - this.matrix3x4SettingsLabel.Name = "matrix3x4SettingsLabel"; - this.matrix3x4SettingsLabel.Size = new System.Drawing.Size(64, 13); - this.matrix3x4SettingsLabel.TabIndex = 31; - this.matrix3x4SettingsLabel.Text = "Matrix (3x4):"; - // - // matrix3x4TypeTextBox - // - this.matrix3x4TypeTextBox.Location = new System.Drawing.Point(346, 142); - this.matrix3x4TypeTextBox.Name = "matrix3x4TypeTextBox"; - this.matrix3x4TypeTextBox.Size = new System.Drawing.Size(120, 20); - this.matrix3x4TypeTextBox.TabIndex = 30; - // - // matrix4x4SettingsLabel - // - this.matrix4x4SettingsLabel.AutoSize = true; - this.matrix4x4SettingsLabel.Location = new System.Drawing.Point(254, 167); - this.matrix4x4SettingsLabel.Name = "matrix4x4SettingsLabel"; - this.matrix4x4SettingsLabel.Size = new System.Drawing.Size(64, 13); - this.matrix4x4SettingsLabel.TabIndex = 29; - this.matrix4x4SettingsLabel.Text = "Matrix (4x4):"; - // - // matrix4x4TypeTextBox - // - this.matrix4x4TypeTextBox.Location = new System.Drawing.Point(346, 164); - this.matrix4x4TypeTextBox.Name = "matrix4x4TypeTextBox"; - this.matrix4x4TypeTextBox.Size = new System.Drawing.Size(120, 20); - this.matrix4x4TypeTextBox.TabIndex = 28; - // - // vector2SettingsLabel - // - this.vector2SettingsLabel.AutoSize = true; - this.vector2SettingsLabel.Location = new System.Drawing.Point(254, 57); - this.vector2SettingsLabel.Name = "vector2SettingsLabel"; - this.vector2SettingsLabel.Size = new System.Drawing.Size(47, 13); - this.vector2SettingsLabel.TabIndex = 27; - this.vector2SettingsLabel.Text = "Vector2:"; - // - // vector2TypeTextBox - // - this.vector2TypeTextBox.Location = new System.Drawing.Point(346, 54); - this.vector2TypeTextBox.Name = "vector2TypeTextBox"; - this.vector2TypeTextBox.Size = new System.Drawing.Size(120, 20); - this.vector2TypeTextBox.TabIndex = 26; - // - // vector3SettingsLabel - // - this.vector3SettingsLabel.AutoSize = true; - this.vector3SettingsLabel.Location = new System.Drawing.Point(254, 79); - this.vector3SettingsLabel.Name = "vector3SettingsLabel"; - this.vector3SettingsLabel.Size = new System.Drawing.Size(47, 13); - this.vector3SettingsLabel.TabIndex = 25; - this.vector3SettingsLabel.Text = "Vector3:"; - // - // vector3TypeTextBox - // - this.vector3TypeTextBox.Location = new System.Drawing.Point(346, 76); - this.vector3TypeTextBox.Name = "vector3TypeTextBox"; - this.vector3TypeTextBox.Size = new System.Drawing.Size(120, 20); - this.vector3TypeTextBox.TabIndex = 24; - // - // vector4SettingsLabel - // - this.vector4SettingsLabel.AutoSize = true; - this.vector4SettingsLabel.Location = new System.Drawing.Point(254, 101); - this.vector4SettingsLabel.Name = "vector4SettingsLabel"; - this.vector4SettingsLabel.Size = new System.Drawing.Size(47, 13); - this.vector4SettingsLabel.TabIndex = 23; - this.vector4SettingsLabel.Text = "Vector4:"; - // - // vector4TypeTextBox - // - this.vector4TypeTextBox.Location = new System.Drawing.Point(346, 98); - this.vector4TypeTextBox.Name = "vector4TypeTextBox"; - this.vector4TypeTextBox.Size = new System.Drawing.Size(120, 20); - this.vector4TypeTextBox.TabIndex = 22; - // - // doubleSettingsLabel - // - this.doubleSettingsLabel.AutoSize = true; - this.doubleSettingsLabel.Location = new System.Drawing.Point(6, 233); - this.doubleSettingsLabel.Name = "doubleSettingsLabel"; - this.doubleSettingsLabel.Size = new System.Drawing.Size(44, 13); - this.doubleSettingsLabel.TabIndex = 21; - this.doubleSettingsLabel.Text = "Double:"; - // - // doubleTypeTextBox - // - this.doubleTypeTextBox.Location = new System.Drawing.Point(98, 230); - this.doubleTypeTextBox.Name = "doubleTypeTextBox"; - this.doubleTypeTextBox.Size = new System.Drawing.Size(120, 20); - this.doubleTypeTextBox.TabIndex = 20; - // - // floatSettingsLabel - // - this.floatSettingsLabel.AutoSize = true; - this.floatSettingsLabel.Location = new System.Drawing.Point(6, 211); - this.floatSettingsLabel.Name = "floatSettingsLabel"; - this.floatSettingsLabel.Size = new System.Drawing.Size(33, 13); - this.floatSettingsLabel.TabIndex = 19; - this.floatSettingsLabel.Text = "Float:"; - // - // floatTypeTextBox - // - this.floatTypeTextBox.Location = new System.Drawing.Point(98, 208); - this.floatTypeTextBox.Name = "floatTypeTextBox"; - this.floatTypeTextBox.Size = new System.Drawing.Size(120, 20); - this.floatTypeTextBox.TabIndex = 18; - // - // uint64SettingsLabel - // - this.uint64SettingsLabel.AutoSize = true; - this.uint64SettingsLabel.Location = new System.Drawing.Point(6, 189); - this.uint64SettingsLabel.Name = "uint64SettingsLabel"; - this.uint64SettingsLabel.Size = new System.Drawing.Size(42, 13); - this.uint64SettingsLabel.TabIndex = 17; - this.uint64SettingsLabel.Text = "UInt64:"; - // - // uint64TypeTextBox - // - this.uint64TypeTextBox.Location = new System.Drawing.Point(98, 186); - this.uint64TypeTextBox.Name = "uint64TypeTextBox"; - this.uint64TypeTextBox.Size = new System.Drawing.Size(120, 20); - this.uint64TypeTextBox.TabIndex = 16; - // - // uint32SettingsLabel - // - this.uint32SettingsLabel.AutoSize = true; - this.uint32SettingsLabel.Location = new System.Drawing.Point(6, 167); - this.uint32SettingsLabel.Name = "uint32SettingsLabel"; - this.uint32SettingsLabel.Size = new System.Drawing.Size(42, 13); - this.uint32SettingsLabel.TabIndex = 15; - this.uint32SettingsLabel.Text = "UInt32:"; - // - // uint32TypeTextBox - // - this.uint32TypeTextBox.Location = new System.Drawing.Point(98, 164); - this.uint32TypeTextBox.Name = "uint32TypeTextBox"; - this.uint32TypeTextBox.Size = new System.Drawing.Size(120, 20); - this.uint32TypeTextBox.TabIndex = 14; - // - // uint16SettingsLabel - // - this.uint16SettingsLabel.AutoSize = true; - this.uint16SettingsLabel.Location = new System.Drawing.Point(6, 145); - this.uint16SettingsLabel.Name = "uint16SettingsLabel"; - this.uint16SettingsLabel.Size = new System.Drawing.Size(42, 13); - this.uint16SettingsLabel.TabIndex = 13; - this.uint16SettingsLabel.Text = "UInt16:"; - // - // uint16TypeTextBox - // - this.uint16TypeTextBox.Location = new System.Drawing.Point(98, 142); - this.uint16TypeTextBox.Name = "uint16TypeTextBox"; - this.uint16TypeTextBox.Size = new System.Drawing.Size(120, 20); - this.uint16TypeTextBox.TabIndex = 12; - // - // uint8SettingsLabel - // - this.uint8SettingsLabel.AutoSize = true; - this.uint8SettingsLabel.Location = new System.Drawing.Point(6, 123); - this.uint8SettingsLabel.Name = "uint8SettingsLabel"; - this.uint8SettingsLabel.Size = new System.Drawing.Size(36, 13); - this.uint8SettingsLabel.TabIndex = 11; - this.uint8SettingsLabel.Text = "UInt8:"; - // - // uint8TypeTextBox - // - this.uint8TypeTextBox.Location = new System.Drawing.Point(98, 120); - this.uint8TypeTextBox.Name = "uint8TypeTextBox"; - this.uint8TypeTextBox.Size = new System.Drawing.Size(120, 20); - this.uint8TypeTextBox.TabIndex = 10; - // - // int64SettingsLabel - // - this.int64SettingsLabel.AutoSize = true; - this.int64SettingsLabel.Location = new System.Drawing.Point(6, 101); - this.int64SettingsLabel.Name = "int64SettingsLabel"; - this.int64SettingsLabel.Size = new System.Drawing.Size(34, 13); - this.int64SettingsLabel.TabIndex = 9; - this.int64SettingsLabel.Text = "Int64:"; - // - // int64TypeTextBox - // - this.int64TypeTextBox.Location = new System.Drawing.Point(98, 98); - this.int64TypeTextBox.Name = "int64TypeTextBox"; - this.int64TypeTextBox.Size = new System.Drawing.Size(120, 20); - this.int64TypeTextBox.TabIndex = 8; - // - // int32SettingsLabel - // - this.int32SettingsLabel.AutoSize = true; - this.int32SettingsLabel.Location = new System.Drawing.Point(6, 79); - this.int32SettingsLabel.Name = "int32SettingsLabel"; - this.int32SettingsLabel.Size = new System.Drawing.Size(34, 13); - this.int32SettingsLabel.TabIndex = 7; - this.int32SettingsLabel.Text = "Int32:"; - // - // int32TypeTextBox - // - this.int32TypeTextBox.Location = new System.Drawing.Point(98, 76); - this.int32TypeTextBox.Name = "int32TypeTextBox"; - this.int32TypeTextBox.Size = new System.Drawing.Size(120, 20); - this.int32TypeTextBox.TabIndex = 6; - // - // int16SettingsLabel - // - this.int16SettingsLabel.AutoSize = true; - this.int16SettingsLabel.Location = new System.Drawing.Point(6, 57); - this.int16SettingsLabel.Name = "int16SettingsLabel"; - this.int16SettingsLabel.Size = new System.Drawing.Size(34, 13); - this.int16SettingsLabel.TabIndex = 5; - this.int16SettingsLabel.Text = "Int16:"; - // - // int16TypeTextBox - // - this.int16TypeTextBox.Location = new System.Drawing.Point(98, 54); - this.int16TypeTextBox.Name = "int16TypeTextBox"; - this.int16TypeTextBox.Size = new System.Drawing.Size(120, 20); - this.int16TypeTextBox.TabIndex = 4; - // - // int8SettingsLabel - // - this.int8SettingsLabel.AutoSize = true; - this.int8SettingsLabel.Location = new System.Drawing.Point(6, 35); - this.int8SettingsLabel.Name = "int8SettingsLabel"; - this.int8SettingsLabel.Size = new System.Drawing.Size(28, 13); - this.int8SettingsLabel.TabIndex = 3; - this.int8SettingsLabel.Text = "Int8:"; - // - // int8TypeTextBox - // - this.int8TypeTextBox.Location = new System.Drawing.Point(98, 32); - this.int8TypeTextBox.Name = "int8TypeTextBox"; - this.int8TypeTextBox.Size = new System.Drawing.Size(120, 20); - this.int8TypeTextBox.TabIndex = 2; - // - // bannerBox - // - this.bannerBox.Dock = System.Windows.Forms.DockStyle.Top; - this.bannerBox.Icon = global::ReClassNET.Properties.Resources.B32x32_Cogs; - this.bannerBox.Location = new System.Drawing.Point(0, 0); - this.bannerBox.Name = "bannerBox"; - this.bannerBox.Size = new System.Drawing.Size(586, 48); - this.bannerBox.TabIndex = 2; - this.bannerBox.Text = "Configure the global settings."; - this.bannerBox.Title = "Settings"; - // - // SettingsForm - // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(586, 427); - this.Controls.Add(this.bannerBox); - this.Controls.Add(this.settingsTabControl); - this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; - this.MaximizeBox = false; - this.MinimizeBox = false; - this.Name = "SettingsForm"; - this.ShowInTaskbar = false; - this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; - this.Text = "ReClass.NET - Settings"; - this.settingsTabControl.ResumeLayout(false); - this.generalSettingsTabPage.ResumeLayout(false); - this.generalSettingsTabPage.PerformLayout(); - this.fileAssociationGroupBox.ResumeLayout(false); - this.commentsGroupBox.ResumeLayout(false); - this.commentsGroupBox.PerformLayout(); - this.displayGroupBox.ResumeLayout(false); - this.displayGroupBox.PerformLayout(); - this.colorsSettingTabPage.ResumeLayout(false); - this.colorsSettingTabPage.PerformLayout(); - this.nodeColorGroupBox.ResumeLayout(false); - this.nodeColorGroupBox.PerformLayout(); - this.typeDefinitionsSettingsTabPage.ResumeLayout(false); - this.typeDefinitionsSettingsTabPage.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)(this.bannerBox)).EndInit(); - this.ResumeLayout(false); + // + // commentsGroupBox + // + this.commentsGroupBox.Controls.Add(this.showPluginInfoCheckBox); + this.commentsGroupBox.Controls.Add(this.showStringCheckBox); + this.commentsGroupBox.Controls.Add(this.showSymbolsCheckBox); + this.commentsGroupBox.Controls.Add(this.showRttiCheckBox); + this.commentsGroupBox.Controls.Add(this.showPointerCheckBox); + this.commentsGroupBox.Controls.Add(this.showIntegerCheckBox); + this.commentsGroupBox.Controls.Add(this.showFloatCheckBox); + this.commentsGroupBox.Location = new System.Drawing.Point(6, 39); + this.commentsGroupBox.Name = "commentsGroupBox"; + this.commentsGroupBox.Size = new System.Drawing.Size(265, 186); + this.commentsGroupBox.TabIndex = 3; + this.commentsGroupBox.TabStop = false; + this.commentsGroupBox.Text = "Node Comments"; + // + // showPluginInfoCheckBox + // + this.showPluginInfoCheckBox.AutoSize = true; + this.showPluginInfoCheckBox.Location = new System.Drawing.Point(6, 157); + this.showPluginInfoCheckBox.Name = "showPluginInfoCheckBox"; + this.showPluginInfoCheckBox.Size = new System.Drawing.Size(111, 17); + this.showPluginInfoCheckBox.TabIndex = 6; + this.showPluginInfoCheckBox.Text = "Show Plugin Infos"; + this.showPluginInfoCheckBox.UseVisualStyleBackColor = true; + // + // showStringCheckBox + // + this.showStringCheckBox.AutoSize = true; + this.showStringCheckBox.Location = new System.Drawing.Point(6, 134); + this.showStringCheckBox.Name = "showStringCheckBox"; + this.showStringCheckBox.Size = new System.Drawing.Size(88, 17); + this.showStringCheckBox.TabIndex = 5; + this.showStringCheckBox.Text = "Show Strings"; + this.showStringCheckBox.UseVisualStyleBackColor = true; + // + // showSymbolsCheckBox + // + this.showSymbolsCheckBox.AutoSize = true; + this.showSymbolsCheckBox.Location = new System.Drawing.Point(6, 111); + this.showSymbolsCheckBox.Name = "showSymbolsCheckBox"; + this.showSymbolsCheckBox.Size = new System.Drawing.Size(130, 17); + this.showSymbolsCheckBox.TabIndex = 4; + this.showSymbolsCheckBox.Text = "Show Debug Symbols"; + this.showSymbolsCheckBox.UseVisualStyleBackColor = true; + // + // showRttiCheckBox + // + this.showRttiCheckBox.AutoSize = true; + this.showRttiCheckBox.Location = new System.Drawing.Point(6, 88); + this.showRttiCheckBox.Name = "showRttiCheckBox"; + this.showRttiCheckBox.Size = new System.Drawing.Size(81, 17); + this.showRttiCheckBox.TabIndex = 3; + this.showRttiCheckBox.Text = "Show RTTI"; + this.showRttiCheckBox.UseVisualStyleBackColor = true; + // + // showPointerCheckBox + // + this.showPointerCheckBox.AutoSize = true; + this.showPointerCheckBox.Location = new System.Drawing.Point(6, 65); + this.showPointerCheckBox.Name = "showPointerCheckBox"; + this.showPointerCheckBox.Size = new System.Drawing.Size(94, 17); + this.showPointerCheckBox.TabIndex = 2; + this.showPointerCheckBox.Text = "Show Pointers"; + this.showPointerCheckBox.UseVisualStyleBackColor = true; + // + // showIntegerCheckBox + // + this.showIntegerCheckBox.AutoSize = true; + this.showIntegerCheckBox.Location = new System.Drawing.Point(6, 42); + this.showIntegerCheckBox.Name = "showIntegerCheckBox"; + this.showIntegerCheckBox.Size = new System.Drawing.Size(124, 17); + this.showIntegerCheckBox.TabIndex = 1; + this.showIntegerCheckBox.Text = "Show Integer Values"; + this.showIntegerCheckBox.UseVisualStyleBackColor = true; + // + // showFloatCheckBox + // + this.showFloatCheckBox.AutoSize = true; + this.showFloatCheckBox.Location = new System.Drawing.Point(6, 19); + this.showFloatCheckBox.Name = "showFloatCheckBox"; + this.showFloatCheckBox.Size = new System.Drawing.Size(114, 17); + this.showFloatCheckBox.TabIndex = 0; + this.showFloatCheckBox.Text = "Show Float Values"; + this.showFloatCheckBox.UseVisualStyleBackColor = true; + // + // displayGroupBox + // + this.displayGroupBox.Controls.Add(this.randomizeWindowTitleCheckBox); + this.displayGroupBox.Controls.Add(this.runAsAdminCheckBox); + this.displayGroupBox.Controls.Add(this.highlightChangedValuesCheckBox); + this.displayGroupBox.Controls.Add(this.showTextCheckBox); + this.displayGroupBox.Controls.Add(this.showNodeOffsetCheckBox); + this.displayGroupBox.Controls.Add(this.showNodeAddressCheckBox); + this.displayGroupBox.Location = new System.Drawing.Point(283, 39); + this.displayGroupBox.Name = "displayGroupBox"; + this.displayGroupBox.Size = new System.Drawing.Size(265, 160); + this.displayGroupBox.TabIndex = 2; + this.displayGroupBox.TabStop = false; + this.displayGroupBox.Text = "Display"; + // + // randomizeWindowTitleCheckBox + // + this.randomizeWindowTitleCheckBox.AutoSize = true; + this.randomizeWindowTitleCheckBox.Location = new System.Drawing.Point(6, 134); + this.randomizeWindowTitleCheckBox.Name = "randomizeWindowTitleCheckBox"; + this.randomizeWindowTitleCheckBox.Size = new System.Drawing.Size(137, 17); + this.randomizeWindowTitleCheckBox.TabIndex = 5; + this.randomizeWindowTitleCheckBox.Text = "Randomize window title"; + this.randomizeWindowTitleCheckBox.UseVisualStyleBackColor = true; + // + // runAsAdminCheckBox + // + this.runAsAdminCheckBox.AutoSize = true; + this.runAsAdminCheckBox.Location = new System.Drawing.Point(6, 111); + this.runAsAdminCheckBox.Name = "runAsAdminCheckBox"; + this.runAsAdminCheckBox.Size = new System.Drawing.Size(200, 17); + this.runAsAdminCheckBox.TabIndex = 4; + this.runAsAdminCheckBox.Text = "Run as administrator (requires restart)"; + this.runAsAdminCheckBox.UseVisualStyleBackColor = true; + // + // highlightChangedValuesCheckBox + // + this.highlightChangedValuesCheckBox.AutoSize = true; + this.highlightChangedValuesCheckBox.Location = new System.Drawing.Point(6, 88); + this.highlightChangedValuesCheckBox.Name = "highlightChangedValuesCheckBox"; + this.highlightChangedValuesCheckBox.Size = new System.Drawing.Size(148, 17); + this.highlightChangedValuesCheckBox.TabIndex = 3; + this.highlightChangedValuesCheckBox.Text = "Highlight Changed Values"; + this.highlightChangedValuesCheckBox.UseVisualStyleBackColor = true; + // + // showTextCheckBox + // + this.showTextCheckBox.AutoSize = true; + this.showTextCheckBox.Location = new System.Drawing.Point(6, 65); + this.showTextCheckBox.Name = "showTextCheckBox"; + this.showTextCheckBox.Size = new System.Drawing.Size(166, 17); + this.showTextCheckBox.TabIndex = 2; + this.showTextCheckBox.Text = "Show Textual Representation"; + this.showTextCheckBox.UseVisualStyleBackColor = true; + // + // showNodeOffsetCheckBox + // + this.showNodeOffsetCheckBox.AutoSize = true; + this.showNodeOffsetCheckBox.Location = new System.Drawing.Point(6, 42); + this.showNodeOffsetCheckBox.Name = "showNodeOffsetCheckBox"; + this.showNodeOffsetCheckBox.Size = new System.Drawing.Size(113, 17); + this.showNodeOffsetCheckBox.TabIndex = 1; + this.showNodeOffsetCheckBox.Text = "Show Node Offset"; + this.showNodeOffsetCheckBox.UseVisualStyleBackColor = true; + // + // showNodeAddressCheckBox + // + this.showNodeAddressCheckBox.AutoSize = true; + this.showNodeAddressCheckBox.Location = new System.Drawing.Point(6, 19); + this.showNodeAddressCheckBox.Name = "showNodeAddressCheckBox"; + this.showNodeAddressCheckBox.Size = new System.Drawing.Size(123, 17); + this.showNodeAddressCheckBox.TabIndex = 0; + this.showNodeAddressCheckBox.Text = "Show Node Address"; + this.showNodeAddressCheckBox.UseVisualStyleBackColor = true; + // + // stayOnTopCheckBox + // + this.stayOnTopCheckBox.AutoSize = true; + this.stayOnTopCheckBox.Location = new System.Drawing.Point(6, 6); + this.stayOnTopCheckBox.Name = "stayOnTopCheckBox"; + this.stayOnTopCheckBox.Size = new System.Drawing.Size(187, 17); + this.stayOnTopCheckBox.TabIndex = 1; + this.stayOnTopCheckBox.Text = "Force ReClass.NET to stay on top"; + this.stayOnTopCheckBox.UseVisualStyleBackColor = true; + // + // colorsSettingTabPage + // + this.colorsSettingTabPage.Controls.Add(this.nodeColorGroupBox); + this.colorsSettingTabPage.Controls.Add(this.backgroundLabel); + this.colorsSettingTabPage.Controls.Add(this.backgroundColorBox); + this.colorsSettingTabPage.Location = new System.Drawing.Point(4, 22); + this.colorsSettingTabPage.Name = "colorsSettingTabPage"; + this.colorsSettingTabPage.Padding = new System.Windows.Forms.Padding(3); + this.colorsSettingTabPage.Size = new System.Drawing.Size(554, 329); + this.colorsSettingTabPage.TabIndex = 1; + this.colorsSettingTabPage.Text = "Colors"; + this.colorsSettingTabPage.UseVisualStyleBackColor = true; + // + // nodeColorGroupBox + // + this.nodeColorGroupBox.Controls.Add(this.nodeValueLabel); + this.nodeColorGroupBox.Controls.Add(this.nodePluginLabel); + this.nodeColorGroupBox.Controls.Add(this.nodeHexValueColorBox); + this.nodeColorGroupBox.Controls.Add(this.nodePluginColorBox); + this.nodeColorGroupBox.Controls.Add(this.nodeHexValueLabel); + this.nodeColorGroupBox.Controls.Add(this.nodeVTableLabel); + this.nodeColorGroupBox.Controls.Add(this.nodeOffsetColorBox); + this.nodeColorGroupBox.Controls.Add(this.nodeVTableColorBox); + this.nodeColorGroupBox.Controls.Add(this.nodeOffsetLabel); + this.nodeColorGroupBox.Controls.Add(this.nodeTextLabel); + this.nodeColorGroupBox.Controls.Add(this.nodeAddressColorBox); + this.nodeColorGroupBox.Controls.Add(this.nodeTextColorBox); + this.nodeColorGroupBox.Controls.Add(this.nodeAddressLabel); + this.nodeColorGroupBox.Controls.Add(this.nodeCommentLabel); + this.nodeColorGroupBox.Controls.Add(this.nodeHiddenColorBox); + this.nodeColorGroupBox.Controls.Add(this.nodeCommentColorBox); + this.nodeColorGroupBox.Controls.Add(this.nodeHiddenLabel); + this.nodeColorGroupBox.Controls.Add(this.nodeIndexLabel); + this.nodeColorGroupBox.Controls.Add(this.nodeSelectedColorBox); + this.nodeColorGroupBox.Controls.Add(this.nodeIndexColorBox); + this.nodeColorGroupBox.Controls.Add(this.nodeSelectedLabel); + this.nodeColorGroupBox.Controls.Add(this.nodeTypeColorBox); + this.nodeColorGroupBox.Controls.Add(this.nodeValueColorBox); + this.nodeColorGroupBox.Controls.Add(this.nodeTypeLabel); + this.nodeColorGroupBox.Controls.Add(this.nodeNameLabel); + this.nodeColorGroupBox.Controls.Add(this.nodeNameColorBox); + this.nodeColorGroupBox.Location = new System.Drawing.Point(9, 43); + this.nodeColorGroupBox.Name = "nodeColorGroupBox"; + this.nodeColorGroupBox.Size = new System.Drawing.Size(539, 225); + this.nodeColorGroupBox.TabIndex = 28; + this.nodeColorGroupBox.TabStop = false; + this.nodeColorGroupBox.Text = "Node Colors"; + // + // nodeValueLabel + // + this.nodeValueLabel.AutoSize = true; + this.nodeValueLabel.Location = new System.Drawing.Point(9, 198); + this.nodeValueLabel.Name = "nodeValueLabel"; + this.nodeValueLabel.Size = new System.Drawing.Size(64, 13); + this.nodeValueLabel.TabIndex = 17; + this.nodeValueLabel.Text = "Value Color:"; + // + // nodePluginLabel + // + this.nodePluginLabel.AutoSize = true; + this.nodePluginLabel.Location = new System.Drawing.Point(286, 172); + this.nodePluginLabel.Name = "nodePluginLabel"; + this.nodePluginLabel.Size = new System.Drawing.Size(87, 13); + this.nodePluginLabel.TabIndex = 27; + this.nodePluginLabel.Text = "Plugin Info Color:"; + // + // nodeHexValueColorBox + // + this.nodeHexValueColorBox.Color = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))); + this.nodeHexValueColorBox.Location = new System.Drawing.Point(133, 117); + this.nodeHexValueColorBox.Name = "nodeHexValueColorBox"; + this.nodeHexValueColorBox.Size = new System.Drawing.Size(123, 20); + this.nodeHexValueColorBox.TabIndex = 2; + // + // nodePluginColorBox + // + this.nodePluginColorBox.Color = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))); + this.nodePluginColorBox.Location = new System.Drawing.Point(410, 169); + this.nodePluginColorBox.Name = "nodePluginColorBox"; + this.nodePluginColorBox.Size = new System.Drawing.Size(123, 20); + this.nodePluginColorBox.TabIndex = 26; + // + // nodeHexValueLabel + // + this.nodeHexValueLabel.AutoSize = true; + this.nodeHexValueLabel.Location = new System.Drawing.Point(9, 120); + this.nodeHexValueLabel.Name = "nodeHexValueLabel"; + this.nodeHexValueLabel.Size = new System.Drawing.Size(86, 13); + this.nodeHexValueLabel.TabIndex = 3; + this.nodeHexValueLabel.Text = "Hex Value Color:"; + // + // nodeVTableLabel + // + this.nodeVTableLabel.AutoSize = true; + this.nodeVTableLabel.Location = new System.Drawing.Point(286, 94); + this.nodeVTableLabel.Name = "nodeVTableLabel"; + this.nodeVTableLabel.Size = new System.Drawing.Size(71, 13); + this.nodeVTableLabel.TabIndex = 25; + this.nodeVTableLabel.Text = "VTable Color:"; + // + // nodeOffsetColorBox + // + this.nodeOffsetColorBox.Color = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))); + this.nodeOffsetColorBox.Location = new System.Drawing.Point(133, 91); + this.nodeOffsetColorBox.Name = "nodeOffsetColorBox"; + this.nodeOffsetColorBox.Size = new System.Drawing.Size(123, 20); + this.nodeOffsetColorBox.TabIndex = 4; + // + // nodeVTableColorBox + // + this.nodeVTableColorBox.Color = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))); + this.nodeVTableColorBox.Location = new System.Drawing.Point(410, 91); + this.nodeVTableColorBox.Name = "nodeVTableColorBox"; + this.nodeVTableColorBox.Size = new System.Drawing.Size(123, 20); + this.nodeVTableColorBox.TabIndex = 24; + // + // nodeOffsetLabel + // + this.nodeOffsetLabel.AutoSize = true; + this.nodeOffsetLabel.Location = new System.Drawing.Point(9, 94); + this.nodeOffsetLabel.Name = "nodeOffsetLabel"; + this.nodeOffsetLabel.Size = new System.Drawing.Size(65, 13); + this.nodeOffsetLabel.TabIndex = 5; + this.nodeOffsetLabel.Text = "Offset Color:"; + // + // nodeTextLabel + // + this.nodeTextLabel.AutoSize = true; + this.nodeTextLabel.Location = new System.Drawing.Point(286, 146); + this.nodeTextLabel.Name = "nodeTextLabel"; + this.nodeTextLabel.Size = new System.Drawing.Size(58, 13); + this.nodeTextLabel.TabIndex = 23; + this.nodeTextLabel.Text = "Text Color:"; + // + // nodeAddressColorBox + // + this.nodeAddressColorBox.Color = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))); + this.nodeAddressColorBox.Location = new System.Drawing.Point(133, 65); + this.nodeAddressColorBox.Name = "nodeAddressColorBox"; + this.nodeAddressColorBox.Size = new System.Drawing.Size(123, 20); + this.nodeAddressColorBox.TabIndex = 6; + // + // nodeTextColorBox + // + this.nodeTextColorBox.Color = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))); + this.nodeTextColorBox.Location = new System.Drawing.Point(410, 143); + this.nodeTextColorBox.Name = "nodeTextColorBox"; + this.nodeTextColorBox.Size = new System.Drawing.Size(123, 20); + this.nodeTextColorBox.TabIndex = 22; + // + // nodeAddressLabel + // + this.nodeAddressLabel.AutoSize = true; + this.nodeAddressLabel.Location = new System.Drawing.Point(9, 68); + this.nodeAddressLabel.Name = "nodeAddressLabel"; + this.nodeAddressLabel.Size = new System.Drawing.Size(75, 13); + this.nodeAddressLabel.TabIndex = 7; + this.nodeAddressLabel.Text = "Address Color:"; + // + // nodeCommentLabel + // + this.nodeCommentLabel.AutoSize = true; + this.nodeCommentLabel.Location = new System.Drawing.Point(286, 120); + this.nodeCommentLabel.Name = "nodeCommentLabel"; + this.nodeCommentLabel.Size = new System.Drawing.Size(81, 13); + this.nodeCommentLabel.TabIndex = 21; + this.nodeCommentLabel.Text = "Comment Color:"; + // + // nodeHiddenColorBox + // + this.nodeHiddenColorBox.Color = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))); + this.nodeHiddenColorBox.Location = new System.Drawing.Point(410, 18); + this.nodeHiddenColorBox.Name = "nodeHiddenColorBox"; + this.nodeHiddenColorBox.Size = new System.Drawing.Size(123, 20); + this.nodeHiddenColorBox.TabIndex = 8; + // + // nodeCommentColorBox + // + this.nodeCommentColorBox.Color = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))); + this.nodeCommentColorBox.Location = new System.Drawing.Point(410, 117); + this.nodeCommentColorBox.Name = "nodeCommentColorBox"; + this.nodeCommentColorBox.Size = new System.Drawing.Size(123, 20); + this.nodeCommentColorBox.TabIndex = 20; + // + // nodeHiddenLabel + // + this.nodeHiddenLabel.AutoSize = true; + this.nodeHiddenLabel.Location = new System.Drawing.Point(286, 21); + this.nodeHiddenLabel.Name = "nodeHiddenLabel"; + this.nodeHiddenLabel.Size = new System.Drawing.Size(71, 13); + this.nodeHiddenLabel.TabIndex = 9; + this.nodeHiddenLabel.Text = "Hidden Color:"; + // + // nodeIndexLabel + // + this.nodeIndexLabel.AutoSize = true; + this.nodeIndexLabel.Location = new System.Drawing.Point(286, 68); + this.nodeIndexLabel.Name = "nodeIndexLabel"; + this.nodeIndexLabel.Size = new System.Drawing.Size(63, 13); + this.nodeIndexLabel.TabIndex = 19; + this.nodeIndexLabel.Text = "Index Color:"; + // + // nodeSelectedColorBox + // + this.nodeSelectedColorBox.Color = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))); + this.nodeSelectedColorBox.Location = new System.Drawing.Point(133, 18); + this.nodeSelectedColorBox.Name = "nodeSelectedColorBox"; + this.nodeSelectedColorBox.Size = new System.Drawing.Size(123, 20); + this.nodeSelectedColorBox.TabIndex = 10; + // + // nodeIndexColorBox + // + this.nodeIndexColorBox.Color = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))); + this.nodeIndexColorBox.Location = new System.Drawing.Point(410, 65); + this.nodeIndexColorBox.Name = "nodeIndexColorBox"; + this.nodeIndexColorBox.Size = new System.Drawing.Size(123, 20); + this.nodeIndexColorBox.TabIndex = 18; + // + // nodeSelectedLabel + // + this.nodeSelectedLabel.AutoSize = true; + this.nodeSelectedLabel.Location = new System.Drawing.Point(9, 21); + this.nodeSelectedLabel.Name = "nodeSelectedLabel"; + this.nodeSelectedLabel.Size = new System.Drawing.Size(79, 13); + this.nodeSelectedLabel.TabIndex = 11; + this.nodeSelectedLabel.Text = "Selected Color:"; + // + // nodeTypeColorBox + // + this.nodeTypeColorBox.Color = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))); + this.nodeTypeColorBox.Location = new System.Drawing.Point(133, 143); + this.nodeTypeColorBox.Name = "nodeTypeColorBox"; + this.nodeTypeColorBox.Size = new System.Drawing.Size(123, 20); + this.nodeTypeColorBox.TabIndex = 12; + // + // nodeValueColorBox + // + this.nodeValueColorBox.Color = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))); + this.nodeValueColorBox.Location = new System.Drawing.Point(133, 195); + this.nodeValueColorBox.Name = "nodeValueColorBox"; + this.nodeValueColorBox.Size = new System.Drawing.Size(123, 20); + this.nodeValueColorBox.TabIndex = 16; + // + // nodeTypeLabel + // + this.nodeTypeLabel.AutoSize = true; + this.nodeTypeLabel.Location = new System.Drawing.Point(9, 146); + this.nodeTypeLabel.Name = "nodeTypeLabel"; + this.nodeTypeLabel.Size = new System.Drawing.Size(61, 13); + this.nodeTypeLabel.TabIndex = 13; + this.nodeTypeLabel.Text = "Type Color:"; + // + // nodeNameLabel + // + this.nodeNameLabel.AutoSize = true; + this.nodeNameLabel.Location = new System.Drawing.Point(9, 172); + this.nodeNameLabel.Name = "nodeNameLabel"; + this.nodeNameLabel.Size = new System.Drawing.Size(65, 13); + this.nodeNameLabel.TabIndex = 15; + this.nodeNameLabel.Text = "Name Color:"; + // + // nodeNameColorBox + // + this.nodeNameColorBox.Color = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))); + this.nodeNameColorBox.Location = new System.Drawing.Point(133, 169); + this.nodeNameColorBox.Name = "nodeNameColorBox"; + this.nodeNameColorBox.Size = new System.Drawing.Size(123, 20); + this.nodeNameColorBox.TabIndex = 14; + // + // backgroundLabel + // + this.backgroundLabel.AutoSize = true; + this.backgroundLabel.Location = new System.Drawing.Point(6, 14); + this.backgroundLabel.Name = "backgroundLabel"; + this.backgroundLabel.Size = new System.Drawing.Size(161, 13); + this.backgroundLabel.TabIndex = 1; + this.backgroundLabel.Text = "Memory View Background Color:"; + // + // backgroundColorBox + // + this.backgroundColorBox.Color = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))); + this.backgroundColorBox.Location = new System.Drawing.Point(175, 11); + this.backgroundColorBox.Name = "backgroundColorBox"; + this.backgroundColorBox.Size = new System.Drawing.Size(123, 20); + this.backgroundColorBox.TabIndex = 0; + // + // typeDefinitionsSettingsTabPage + // + this.typeDefinitionsSettingsTabPage.Controls.Add(this.utf32TextSettingsLabel); + this.typeDefinitionsSettingsTabPage.Controls.Add(this.utf32TextTypeTextBox); + this.typeDefinitionsSettingsTabPage.Controls.Add(this.nuintSettingsLabel); + this.typeDefinitionsSettingsTabPage.Controls.Add(this.nuintTypeTextBox); + this.typeDefinitionsSettingsTabPage.Controls.Add(this.nintSettingsLabel); + this.typeDefinitionsSettingsTabPage.Controls.Add(this.nintTypeTextBox); + this.typeDefinitionsSettingsTabPage.Controls.Add(this.boolSettingsLabel); + this.typeDefinitionsSettingsTabPage.Controls.Add(this.boolTypeTextBox); + this.typeDefinitionsSettingsTabPage.Controls.Add(this.generatorInfoLabel); + this.typeDefinitionsSettingsTabPage.Controls.Add(this.functionPtrSettingsLabel); + this.typeDefinitionsSettingsTabPage.Controls.Add(this.functionPtrTypeTextBox); + this.typeDefinitionsSettingsTabPage.Controls.Add(this.utf16TextSettingsLabel); + this.typeDefinitionsSettingsTabPage.Controls.Add(this.utf16TextTypeTextBox); + this.typeDefinitionsSettingsTabPage.Controls.Add(this.utf8TextSettingsLabel); + this.typeDefinitionsSettingsTabPage.Controls.Add(this.utf8TextTypeTextBox); + this.typeDefinitionsSettingsTabPage.Controls.Add(this.matrix3x3SettingsLabel); + this.typeDefinitionsSettingsTabPage.Controls.Add(this.matrix3x3TypeTextBox); + this.typeDefinitionsSettingsTabPage.Controls.Add(this.matrix3x4SettingsLabel); + this.typeDefinitionsSettingsTabPage.Controls.Add(this.matrix3x4TypeTextBox); + this.typeDefinitionsSettingsTabPage.Controls.Add(this.matrix4x4SettingsLabel); + this.typeDefinitionsSettingsTabPage.Controls.Add(this.matrix4x4TypeTextBox); + this.typeDefinitionsSettingsTabPage.Controls.Add(this.vector2SettingsLabel); + this.typeDefinitionsSettingsTabPage.Controls.Add(this.vector2TypeTextBox); + this.typeDefinitionsSettingsTabPage.Controls.Add(this.vector3SettingsLabel); + this.typeDefinitionsSettingsTabPage.Controls.Add(this.vector3TypeTextBox); + this.typeDefinitionsSettingsTabPage.Controls.Add(this.vector4SettingsLabel); + this.typeDefinitionsSettingsTabPage.Controls.Add(this.vector4TypeTextBox); + this.typeDefinitionsSettingsTabPage.Controls.Add(this.doubleSettingsLabel); + this.typeDefinitionsSettingsTabPage.Controls.Add(this.doubleTypeTextBox); + this.typeDefinitionsSettingsTabPage.Controls.Add(this.floatSettingsLabel); + this.typeDefinitionsSettingsTabPage.Controls.Add(this.floatTypeTextBox); + this.typeDefinitionsSettingsTabPage.Controls.Add(this.uint64SettingsLabel); + this.typeDefinitionsSettingsTabPage.Controls.Add(this.uint64TypeTextBox); + this.typeDefinitionsSettingsTabPage.Controls.Add(this.uint32SettingsLabel); + this.typeDefinitionsSettingsTabPage.Controls.Add(this.uint32TypeTextBox); + this.typeDefinitionsSettingsTabPage.Controls.Add(this.uint16SettingsLabel); + this.typeDefinitionsSettingsTabPage.Controls.Add(this.uint16TypeTextBox); + this.typeDefinitionsSettingsTabPage.Controls.Add(this.uint8SettingsLabel); + this.typeDefinitionsSettingsTabPage.Controls.Add(this.uint8TypeTextBox); + this.typeDefinitionsSettingsTabPage.Controls.Add(this.int64SettingsLabel); + this.typeDefinitionsSettingsTabPage.Controls.Add(this.int64TypeTextBox); + this.typeDefinitionsSettingsTabPage.Controls.Add(this.int32SettingsLabel); + this.typeDefinitionsSettingsTabPage.Controls.Add(this.int32TypeTextBox); + this.typeDefinitionsSettingsTabPage.Controls.Add(this.int16SettingsLabel); + this.typeDefinitionsSettingsTabPage.Controls.Add(this.int16TypeTextBox); + this.typeDefinitionsSettingsTabPage.Controls.Add(this.int8SettingsLabel); + this.typeDefinitionsSettingsTabPage.Controls.Add(this.int8TypeTextBox); + this.typeDefinitionsSettingsTabPage.Location = new System.Drawing.Point(4, 22); + this.typeDefinitionsSettingsTabPage.Name = "typeDefinitionsSettingsTabPage"; + this.typeDefinitionsSettingsTabPage.Padding = new System.Windows.Forms.Padding(3); + this.typeDefinitionsSettingsTabPage.Size = new System.Drawing.Size(554, 329); + this.typeDefinitionsSettingsTabPage.TabIndex = 2; + this.typeDefinitionsSettingsTabPage.Text = "Type Definitions"; + this.typeDefinitionsSettingsTabPage.UseVisualStyleBackColor = true; + // + // nuintSettingsLabel + // + this.nuintSettingsLabel.AutoSize = true; + this.nuintSettingsLabel.Location = new System.Drawing.Point(6, 233); + this.nuintSettingsLabel.Name = "nuintSettingsLabel"; + this.nuintSettingsLabel.Size = new System.Drawing.Size(38, 13); + this.nuintSettingsLabel.TabIndex = 50; + this.nuintSettingsLabel.Text = "NUInt:"; + // + // nuintTypeTextBox + // + this.nuintTypeTextBox.Location = new System.Drawing.Point(98, 230); + this.nuintTypeTextBox.Name = "nuintTypeTextBox"; + this.nuintTypeTextBox.Size = new System.Drawing.Size(120, 20); + this.nuintTypeTextBox.TabIndex = 49; + // + // nintSettingsLabel + // + this.nintSettingsLabel.AutoSize = true; + this.nintSettingsLabel.Location = new System.Drawing.Point(6, 123); + this.nintSettingsLabel.Name = "nintSettingsLabel"; + this.nintSettingsLabel.Size = new System.Drawing.Size(30, 13); + this.nintSettingsLabel.TabIndex = 48; + this.nintSettingsLabel.Text = "NInt:"; + // + // nintTypeTextBox + // + this.nintTypeTextBox.Location = new System.Drawing.Point(98, 120); + this.nintTypeTextBox.Name = "nintTypeTextBox"; + this.nintTypeTextBox.Size = new System.Drawing.Size(120, 20); + this.nintTypeTextBox.TabIndex = 47; + // + // boolSettingsLabel + // + this.boolSettingsLabel.AutoSize = true; + this.boolSettingsLabel.Location = new System.Drawing.Point(254, 35); + this.boolSettingsLabel.Name = "boolSettingsLabel"; + this.boolSettingsLabel.Size = new System.Drawing.Size(31, 13); + this.boolSettingsLabel.TabIndex = 46; + this.boolSettingsLabel.Text = "Bool:"; + // + // boolTypeTextBox + // + this.boolTypeTextBox.Location = new System.Drawing.Point(346, 32); + this.boolTypeTextBox.Name = "boolTypeTextBox"; + this.boolTypeTextBox.Size = new System.Drawing.Size(120, 20); + this.boolTypeTextBox.TabIndex = 45; + // + // generatorInfoLabel + // + this.generatorInfoLabel.AutoSize = true; + this.generatorInfoLabel.Location = new System.Drawing.Point(6, 6); + this.generatorInfoLabel.Name = "generatorInfoLabel"; + this.generatorInfoLabel.Size = new System.Drawing.Size(236, 13); + this.generatorInfoLabel.TabIndex = 44; + this.generatorInfoLabel.Text = "These types are used to generate the C++ code:"; + // + // functionPtrSettingsLabel + // + this.functionPtrSettingsLabel.AutoSize = true; + this.functionPtrSettingsLabel.Location = new System.Drawing.Point(254, 255); + this.functionPtrSettingsLabel.Name = "functionPtrSettingsLabel"; + this.functionPtrSettingsLabel.Size = new System.Drawing.Size(87, 13); + this.functionPtrSettingsLabel.TabIndex = 43; + this.functionPtrSettingsLabel.Text = "Function Pointer:"; + // + // functionPtrTypeTextBox + // + this.functionPtrTypeTextBox.Location = new System.Drawing.Point(346, 252); + this.functionPtrTypeTextBox.Name = "functionPtrTypeTextBox"; + this.functionPtrTypeTextBox.Size = new System.Drawing.Size(120, 20); + this.functionPtrTypeTextBox.TabIndex = 42; + // + // utf16TextSettingsLabel + // + this.utf16TextSettingsLabel.AutoSize = true; + this.utf16TextSettingsLabel.Location = new System.Drawing.Point(254, 211); + this.utf16TextSettingsLabel.Name = "utf16TextSettingsLabel"; + this.utf16TextSettingsLabel.Size = new System.Drawing.Size(43, 13); + this.utf16TextSettingsLabel.TabIndex = 39; + this.utf16TextSettingsLabel.Text = "UTF16:"; + // + // utf16TextTypeTextBox + // + this.utf16TextTypeTextBox.Location = new System.Drawing.Point(346, 208); + this.utf16TextTypeTextBox.Name = "utf16TextTypeTextBox"; + this.utf16TextTypeTextBox.Size = new System.Drawing.Size(120, 20); + this.utf16TextTypeTextBox.TabIndex = 38; + // + // utf8TextSettingsLabel + // + this.utf8TextSettingsLabel.AutoSize = true; + this.utf8TextSettingsLabel.Location = new System.Drawing.Point(254, 189); + this.utf8TextSettingsLabel.Name = "utf8TextSettingsLabel"; + this.utf8TextSettingsLabel.Size = new System.Drawing.Size(37, 13); + this.utf8TextSettingsLabel.TabIndex = 35; + this.utf8TextSettingsLabel.Text = "UTF8:"; + // + // utf8TextTypeTextBox + // + this.utf8TextTypeTextBox.Location = new System.Drawing.Point(346, 186); + this.utf8TextTypeTextBox.Name = "utf8TextTypeTextBox"; + this.utf8TextTypeTextBox.Size = new System.Drawing.Size(120, 20); + this.utf8TextTypeTextBox.TabIndex = 34; + // + // matrix3x3SettingsLabel + // + this.matrix3x3SettingsLabel.AutoSize = true; + this.matrix3x3SettingsLabel.Location = new System.Drawing.Point(254, 123); + this.matrix3x3SettingsLabel.Name = "matrix3x3SettingsLabel"; + this.matrix3x3SettingsLabel.Size = new System.Drawing.Size(64, 13); + this.matrix3x3SettingsLabel.TabIndex = 33; + this.matrix3x3SettingsLabel.Text = "Matrix (3x3):"; + // + // matrix3x3TypeTextBox + // + this.matrix3x3TypeTextBox.Location = new System.Drawing.Point(346, 120); + this.matrix3x3TypeTextBox.Name = "matrix3x3TypeTextBox"; + this.matrix3x3TypeTextBox.Size = new System.Drawing.Size(120, 20); + this.matrix3x3TypeTextBox.TabIndex = 32; + // + // matrix3x4SettingsLabel + // + this.matrix3x4SettingsLabel.AutoSize = true; + this.matrix3x4SettingsLabel.Location = new System.Drawing.Point(254, 145); + this.matrix3x4SettingsLabel.Name = "matrix3x4SettingsLabel"; + this.matrix3x4SettingsLabel.Size = new System.Drawing.Size(64, 13); + this.matrix3x4SettingsLabel.TabIndex = 31; + this.matrix3x4SettingsLabel.Text = "Matrix (3x4):"; + // + // matrix3x4TypeTextBox + // + this.matrix3x4TypeTextBox.Location = new System.Drawing.Point(346, 142); + this.matrix3x4TypeTextBox.Name = "matrix3x4TypeTextBox"; + this.matrix3x4TypeTextBox.Size = new System.Drawing.Size(120, 20); + this.matrix3x4TypeTextBox.TabIndex = 30; + // + // matrix4x4SettingsLabel + // + this.matrix4x4SettingsLabel.AutoSize = true; + this.matrix4x4SettingsLabel.Location = new System.Drawing.Point(254, 167); + this.matrix4x4SettingsLabel.Name = "matrix4x4SettingsLabel"; + this.matrix4x4SettingsLabel.Size = new System.Drawing.Size(64, 13); + this.matrix4x4SettingsLabel.TabIndex = 29; + this.matrix4x4SettingsLabel.Text = "Matrix (4x4):"; + // + // matrix4x4TypeTextBox + // + this.matrix4x4TypeTextBox.Location = new System.Drawing.Point(346, 164); + this.matrix4x4TypeTextBox.Name = "matrix4x4TypeTextBox"; + this.matrix4x4TypeTextBox.Size = new System.Drawing.Size(120, 20); + this.matrix4x4TypeTextBox.TabIndex = 28; + // + // vector2SettingsLabel + // + this.vector2SettingsLabel.AutoSize = true; + this.vector2SettingsLabel.Location = new System.Drawing.Point(254, 57); + this.vector2SettingsLabel.Name = "vector2SettingsLabel"; + this.vector2SettingsLabel.Size = new System.Drawing.Size(47, 13); + this.vector2SettingsLabel.TabIndex = 27; + this.vector2SettingsLabel.Text = "Vector2:"; + // + // vector2TypeTextBox + // + this.vector2TypeTextBox.Location = new System.Drawing.Point(346, 54); + this.vector2TypeTextBox.Name = "vector2TypeTextBox"; + this.vector2TypeTextBox.Size = new System.Drawing.Size(120, 20); + this.vector2TypeTextBox.TabIndex = 26; + // + // vector3SettingsLabel + // + this.vector3SettingsLabel.AutoSize = true; + this.vector3SettingsLabel.Location = new System.Drawing.Point(254, 79); + this.vector3SettingsLabel.Name = "vector3SettingsLabel"; + this.vector3SettingsLabel.Size = new System.Drawing.Size(47, 13); + this.vector3SettingsLabel.TabIndex = 25; + this.vector3SettingsLabel.Text = "Vector3:"; + // + // vector3TypeTextBox + // + this.vector3TypeTextBox.Location = new System.Drawing.Point(346, 76); + this.vector3TypeTextBox.Name = "vector3TypeTextBox"; + this.vector3TypeTextBox.Size = new System.Drawing.Size(120, 20); + this.vector3TypeTextBox.TabIndex = 24; + // + // vector4SettingsLabel + // + this.vector4SettingsLabel.AutoSize = true; + this.vector4SettingsLabel.Location = new System.Drawing.Point(254, 101); + this.vector4SettingsLabel.Name = "vector4SettingsLabel"; + this.vector4SettingsLabel.Size = new System.Drawing.Size(47, 13); + this.vector4SettingsLabel.TabIndex = 23; + this.vector4SettingsLabel.Text = "Vector4:"; + // + // vector4TypeTextBox + // + this.vector4TypeTextBox.Location = new System.Drawing.Point(346, 98); + this.vector4TypeTextBox.Name = "vector4TypeTextBox"; + this.vector4TypeTextBox.Size = new System.Drawing.Size(120, 20); + this.vector4TypeTextBox.TabIndex = 22; + // + // doubleSettingsLabel + // + this.doubleSettingsLabel.AutoSize = true; + this.doubleSettingsLabel.Location = new System.Drawing.Point(6, 277); + this.doubleSettingsLabel.Name = "doubleSettingsLabel"; + this.doubleSettingsLabel.Size = new System.Drawing.Size(44, 13); + this.doubleSettingsLabel.TabIndex = 21; + this.doubleSettingsLabel.Text = "Double:"; + // + // doubleTypeTextBox + // + this.doubleTypeTextBox.Location = new System.Drawing.Point(98, 274); + this.doubleTypeTextBox.Name = "doubleTypeTextBox"; + this.doubleTypeTextBox.Size = new System.Drawing.Size(120, 20); + this.doubleTypeTextBox.TabIndex = 20; + // + // floatSettingsLabel + // + this.floatSettingsLabel.AutoSize = true; + this.floatSettingsLabel.Location = new System.Drawing.Point(6, 255); + this.floatSettingsLabel.Name = "floatSettingsLabel"; + this.floatSettingsLabel.Size = new System.Drawing.Size(33, 13); + this.floatSettingsLabel.TabIndex = 19; + this.floatSettingsLabel.Text = "Float:"; + // + // floatTypeTextBox + // + this.floatTypeTextBox.Location = new System.Drawing.Point(98, 252); + this.floatTypeTextBox.Name = "floatTypeTextBox"; + this.floatTypeTextBox.Size = new System.Drawing.Size(120, 20); + this.floatTypeTextBox.TabIndex = 18; + // + // uint64SettingsLabel + // + this.uint64SettingsLabel.AutoSize = true; + this.uint64SettingsLabel.Location = new System.Drawing.Point(6, 211); + this.uint64SettingsLabel.Name = "uint64SettingsLabel"; + this.uint64SettingsLabel.Size = new System.Drawing.Size(42, 13); + this.uint64SettingsLabel.TabIndex = 17; + this.uint64SettingsLabel.Text = "UInt64:"; + // + // uint64TypeTextBox + // + this.uint64TypeTextBox.Location = new System.Drawing.Point(98, 208); + this.uint64TypeTextBox.Name = "uint64TypeTextBox"; + this.uint64TypeTextBox.Size = new System.Drawing.Size(120, 20); + this.uint64TypeTextBox.TabIndex = 16; + // + // uint32SettingsLabel + // + this.uint32SettingsLabel.AutoSize = true; + this.uint32SettingsLabel.Location = new System.Drawing.Point(6, 189); + this.uint32SettingsLabel.Name = "uint32SettingsLabel"; + this.uint32SettingsLabel.Size = new System.Drawing.Size(42, 13); + this.uint32SettingsLabel.TabIndex = 15; + this.uint32SettingsLabel.Text = "UInt32:"; + // + // uint32TypeTextBox + // + this.uint32TypeTextBox.Location = new System.Drawing.Point(98, 186); + this.uint32TypeTextBox.Name = "uint32TypeTextBox"; + this.uint32TypeTextBox.Size = new System.Drawing.Size(120, 20); + this.uint32TypeTextBox.TabIndex = 14; + // + // uint16SettingsLabel + // + this.uint16SettingsLabel.AutoSize = true; + this.uint16SettingsLabel.Location = new System.Drawing.Point(6, 167); + this.uint16SettingsLabel.Name = "uint16SettingsLabel"; + this.uint16SettingsLabel.Size = new System.Drawing.Size(42, 13); + this.uint16SettingsLabel.TabIndex = 13; + this.uint16SettingsLabel.Text = "UInt16:"; + // + // uint16TypeTextBox + // + this.uint16TypeTextBox.Location = new System.Drawing.Point(98, 164); + this.uint16TypeTextBox.Name = "uint16TypeTextBox"; + this.uint16TypeTextBox.Size = new System.Drawing.Size(120, 20); + this.uint16TypeTextBox.TabIndex = 12; + // + // uint8SettingsLabel + // + this.uint8SettingsLabel.AutoSize = true; + this.uint8SettingsLabel.Location = new System.Drawing.Point(6, 145); + this.uint8SettingsLabel.Name = "uint8SettingsLabel"; + this.uint8SettingsLabel.Size = new System.Drawing.Size(36, 13); + this.uint8SettingsLabel.TabIndex = 11; + this.uint8SettingsLabel.Text = "UInt8:"; + // + // uint8TypeTextBox + // + this.uint8TypeTextBox.Location = new System.Drawing.Point(98, 142); + this.uint8TypeTextBox.Name = "uint8TypeTextBox"; + this.uint8TypeTextBox.Size = new System.Drawing.Size(120, 20); + this.uint8TypeTextBox.TabIndex = 10; + // + // int64SettingsLabel + // + this.int64SettingsLabel.AutoSize = true; + this.int64SettingsLabel.Location = new System.Drawing.Point(6, 101); + this.int64SettingsLabel.Name = "int64SettingsLabel"; + this.int64SettingsLabel.Size = new System.Drawing.Size(34, 13); + this.int64SettingsLabel.TabIndex = 9; + this.int64SettingsLabel.Text = "Int64:"; + // + // int64TypeTextBox + // + this.int64TypeTextBox.Location = new System.Drawing.Point(98, 98); + this.int64TypeTextBox.Name = "int64TypeTextBox"; + this.int64TypeTextBox.Size = new System.Drawing.Size(120, 20); + this.int64TypeTextBox.TabIndex = 8; + // + // int32SettingsLabel + // + this.int32SettingsLabel.AutoSize = true; + this.int32SettingsLabel.Location = new System.Drawing.Point(6, 79); + this.int32SettingsLabel.Name = "int32SettingsLabel"; + this.int32SettingsLabel.Size = new System.Drawing.Size(34, 13); + this.int32SettingsLabel.TabIndex = 7; + this.int32SettingsLabel.Text = "Int32:"; + // + // int32TypeTextBox + // + this.int32TypeTextBox.Location = new System.Drawing.Point(98, 76); + this.int32TypeTextBox.Name = "int32TypeTextBox"; + this.int32TypeTextBox.Size = new System.Drawing.Size(120, 20); + this.int32TypeTextBox.TabIndex = 6; + // + // int16SettingsLabel + // + this.int16SettingsLabel.AutoSize = true; + this.int16SettingsLabel.Location = new System.Drawing.Point(6, 57); + this.int16SettingsLabel.Name = "int16SettingsLabel"; + this.int16SettingsLabel.Size = new System.Drawing.Size(34, 13); + this.int16SettingsLabel.TabIndex = 5; + this.int16SettingsLabel.Text = "Int16:"; + // + // int16TypeTextBox + // + this.int16TypeTextBox.Location = new System.Drawing.Point(98, 54); + this.int16TypeTextBox.Name = "int16TypeTextBox"; + this.int16TypeTextBox.Size = new System.Drawing.Size(120, 20); + this.int16TypeTextBox.TabIndex = 4; + // + // int8SettingsLabel + // + this.int8SettingsLabel.AutoSize = true; + this.int8SettingsLabel.Location = new System.Drawing.Point(6, 35); + this.int8SettingsLabel.Name = "int8SettingsLabel"; + this.int8SettingsLabel.Size = new System.Drawing.Size(28, 13); + this.int8SettingsLabel.TabIndex = 3; + this.int8SettingsLabel.Text = "Int8:"; + // + // int8TypeTextBox + // + this.int8TypeTextBox.Location = new System.Drawing.Point(98, 32); + this.int8TypeTextBox.Name = "int8TypeTextBox"; + this.int8TypeTextBox.Size = new System.Drawing.Size(120, 20); + this.int8TypeTextBox.TabIndex = 2; + // + // bannerBox + // + this.bannerBox.Dock = System.Windows.Forms.DockStyle.Top; + this.bannerBox.Icon = global::ReClassNET.Properties.Resources.B32x32_Cogs; + this.bannerBox.Location = new System.Drawing.Point(0, 0); + this.bannerBox.Name = "bannerBox"; + this.bannerBox.Size = new System.Drawing.Size(586, 48); + this.bannerBox.TabIndex = 2; + this.bannerBox.Text = "Configure the global settings."; + this.bannerBox.Title = "Settings"; + // + // utf32TextSettingsLabel + // + this.utf32TextSettingsLabel.AutoSize = true; + this.utf32TextSettingsLabel.Location = new System.Drawing.Point(254, 233); + this.utf32TextSettingsLabel.Name = "utf32TextSettingsLabel"; + this.utf32TextSettingsLabel.Size = new System.Drawing.Size(43, 13); + this.utf32TextSettingsLabel.TabIndex = 52; + this.utf32TextSettingsLabel.Text = "UTF32:"; + // + // utf32TextTypeTextBox + // + this.utf32TextTypeTextBox.Location = new System.Drawing.Point(346, 230); + this.utf32TextTypeTextBox.Name = "utf32TextTypeTextBox"; + this.utf32TextTypeTextBox.Size = new System.Drawing.Size(120, 20); + this.utf32TextTypeTextBox.TabIndex = 51; + // + // SettingsForm + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(586, 427); + this.Controls.Add(this.bannerBox); + this.Controls.Add(this.settingsTabControl); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; + this.MaximizeBox = false; + this.MinimizeBox = false; + this.Name = "SettingsForm"; + this.ShowInTaskbar = false; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; + this.Text = "ReClass.NET - Settings"; + this.settingsTabControl.ResumeLayout(false); + this.generalSettingsTabPage.ResumeLayout(false); + this.generalSettingsTabPage.PerformLayout(); + this.fileAssociationGroupBox.ResumeLayout(false); + this.commentsGroupBox.ResumeLayout(false); + this.commentsGroupBox.PerformLayout(); + this.displayGroupBox.ResumeLayout(false); + this.displayGroupBox.PerformLayout(); + this.colorsSettingTabPage.ResumeLayout(false); + this.colorsSettingTabPage.PerformLayout(); + this.nodeColorGroupBox.ResumeLayout(false); + this.nodeColorGroupBox.PerformLayout(); + this.typeDefinitionsSettingsTabPage.ResumeLayout(false); + this.typeDefinitionsSettingsTabPage.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.bannerBox)).EndInit(); + this.ResumeLayout(false); } @@ -1171,7 +1231,7 @@ private void InitializeComponent() private System.Windows.Forms.Label doubleSettingsLabel; private System.Windows.Forms.TextBox doubleTypeTextBox; private System.Windows.Forms.GroupBox nodeColorGroupBox; - private System.Windows.Forms.Label label1; + private System.Windows.Forms.Label generatorInfoLabel; private BannerBox bannerBox; private System.Windows.Forms.Label boolSettingsLabel; private System.Windows.Forms.TextBox boolTypeTextBox; @@ -1181,5 +1241,11 @@ private void InitializeComponent() private System.Windows.Forms.Label associationInfoLabel; private System.Windows.Forms.CheckBox randomizeWindowTitleCheckBox; private System.Windows.Forms.CheckBox runAsAdminCheckBox; + private System.Windows.Forms.Label nuintSettingsLabel; + private System.Windows.Forms.TextBox nuintTypeTextBox; + private System.Windows.Forms.Label nintSettingsLabel; + private System.Windows.Forms.TextBox nintTypeTextBox; + private System.Windows.Forms.Label utf32TextSettingsLabel; + private System.Windows.Forms.TextBox utf32TextTypeTextBox; } } \ No newline at end of file diff --git a/ReClass.NET/Forms/SettingsForm.cs b/ReClass.NET/Forms/SettingsForm.cs index 4c242fa3..fcc4121e 100644 --- a/ReClass.NET/Forms/SettingsForm.cs +++ b/ReClass.NET/Forms/SettingsForm.cs @@ -39,7 +39,7 @@ public SettingsForm(Settings settings, CppTypeMapping typeMapping) SetGeneralBindings(); SetColorBindings(); - SetTypedefinitionBindings(); + SetTypeDefinitionBindings(); if (NativeMethods.IsUnix()) { @@ -90,10 +90,7 @@ private static void SetBinding(IBindableComponent control, string propertyName, private void SetGeneralBindings() { SetBinding(stayOnTopCheckBox, nameof(CheckBox.Checked), settings, nameof(Settings.StayOnTop)); - stayOnTopCheckBox.CheckedChanged += (sender, e) => - { - GlobalWindowManager.Windows.ForEach(w => w.TopMost = stayOnTopCheckBox.Checked); - }; + stayOnTopCheckBox.CheckedChanged += (_, _2) => GlobalWindowManager.Windows.ForEach(w => w.TopMost = stayOnTopCheckBox.Checked); SetBinding(showNodeAddressCheckBox, nameof(CheckBox.Checked), settings, nameof(Settings.ShowNodeAddress)); SetBinding(showNodeOffsetCheckBox, nameof(CheckBox.Checked), settings, nameof(Settings.ShowNodeOffset)); @@ -130,17 +127,19 @@ private void SetColorBindings() SetBinding(nodePluginColorBox, nameof(ColorBox.Color), settings, nameof(Settings.PluginColor)); } - private void SetTypedefinitionBindings() + private void SetTypeDefinitionBindings() { SetBinding(boolTypeTextBox, nameof(TextBox.Text), typeMapping, nameof(CppTypeMapping.TypeBool)); SetBinding(int8TypeTextBox, nameof(TextBox.Text), typeMapping, nameof(CppTypeMapping.TypeInt8)); SetBinding(int16TypeTextBox, nameof(TextBox.Text), typeMapping, nameof(CppTypeMapping.TypeInt16)); SetBinding(int32TypeTextBox, nameof(TextBox.Text), typeMapping, nameof(CppTypeMapping.TypeInt32)); SetBinding(int64TypeTextBox, nameof(TextBox.Text), typeMapping, nameof(CppTypeMapping.TypeInt64)); + SetBinding(nintTypeTextBox, nameof(TextBox.Text), typeMapping, nameof(CppTypeMapping.TypeNInt)); SetBinding(uint8TypeTextBox, nameof(TextBox.Text), typeMapping, nameof(CppTypeMapping.TypeUInt8)); SetBinding(uint16TypeTextBox, nameof(TextBox.Text), typeMapping, nameof(CppTypeMapping.TypeUInt16)); SetBinding(uint32TypeTextBox, nameof(TextBox.Text), typeMapping, nameof(CppTypeMapping.TypeUInt32)); SetBinding(uint64TypeTextBox, nameof(TextBox.Text), typeMapping, nameof(CppTypeMapping.TypeUInt64)); + SetBinding(nuintTypeTextBox, nameof(TextBox.Text), typeMapping, nameof(CppTypeMapping.TypeNUInt)); SetBinding(floatTypeTextBox, nameof(TextBox.Text), typeMapping, nameof(CppTypeMapping.TypeFloat)); SetBinding(doubleTypeTextBox, nameof(TextBox.Text), typeMapping, nameof(CppTypeMapping.TypeDouble)); SetBinding(vector2TypeTextBox, nameof(TextBox.Text), typeMapping, nameof(CppTypeMapping.TypeVector2)); @@ -151,6 +150,7 @@ private void SetTypedefinitionBindings() SetBinding(matrix4x4TypeTextBox, nameof(TextBox.Text), typeMapping, nameof(CppTypeMapping.TypeMatrix4x4)); SetBinding(utf8TextTypeTextBox, nameof(TextBox.Text), typeMapping, nameof(CppTypeMapping.TypeUtf8Text)); SetBinding(utf16TextTypeTextBox, nameof(TextBox.Text), typeMapping, nameof(CppTypeMapping.TypeUtf16Text)); + SetBinding(utf32TextTypeTextBox, nameof(TextBox.Text), typeMapping, nameof(CppTypeMapping.TypeUtf32Text)); SetBinding(functionPtrTypeTextBox, nameof(TextBox.Text), typeMapping, nameof(CppTypeMapping.TypeFunctionPtr)); } } From b54f55be2ef6f716c59bb4c9c8761b060247ca4c Mon Sep 17 00:00:00 2001 From: GH-Rake Date: Thu, 22 Oct 2020 20:26:26 -0400 Subject: [PATCH 186/223] Fix RegisterExtension double quoted path --- ReClass.NET/Native/NativeMethods.Windows.cs | 5 ----- 1 file changed, 5 deletions(-) diff --git a/ReClass.NET/Native/NativeMethods.Windows.cs b/ReClass.NET/Native/NativeMethods.Windows.cs index 5b5ce08e..f27f9184 100644 --- a/ReClass.NET/Native/NativeMethods.Windows.cs +++ b/ReClass.NET/Native/NativeMethods.Windows.cs @@ -188,11 +188,6 @@ public bool RegisterExtension(string fileExtension, string extensionId, string a using (var icon = extensionInfoKey?.CreateSubKey("DefaultIcon")) { - if (applicationPath.IndexOfAny(new[] { ' ', '\t' }) < 0) - { - applicationPath = "\"" + applicationPath + "\""; - } - icon?.SetValue(string.Empty, "\"" + applicationPath + "\",0", RegistryValueKind.String); } From a2d1c6d4987dc15cf2d923bb20b5de8d7590f5ae Mon Sep 17 00:00:00 2001 From: ko1N Date: Sat, 31 Oct 2020 20:35:43 +0100 Subject: [PATCH 187/223] Added containerized builds via docker/podman --- Makefile | 32 ++++++++++++++++++++++++++++++++ ReClass.NET/Makefile | 18 ++++++++++++++++++ ReClass.NET_Launcher/Makefile | 14 ++++++++++++++ 3 files changed, 64 insertions(+) diff --git a/Makefile b/Makefile index f169682b..50b259f4 100644 --- a/Makefile +++ b/Makefile @@ -1,3 +1,5 @@ +.PHONY: all clean debug clean_debug release clean_release update docker_all docker_debug docker_release podman_all podman_debug podman_release dist + all: debug release dist clean: clean_debug clean_release @@ -27,6 +29,36 @@ clean_release: update: cd ReClass.NET && make update +docker_all: + make docker_debug + make docker_release + make dist + +docker_debug: + cd ReClass.NET_Launcher && make docker_debug + cd ReClass.NET && make docker_debug + docker container run --rm -v ${PWD}:/build:z -w /build gcc:latest bash -c "cd NativeCore/Unix && make debug" + +docker_release: + cd ReClass.NET_Launcher && make docker_release + cd ReClass.NET && make docker_release + docker container run --rm -v ${PWD}:/build:z -w /build gcc:latest bash -c "cd NativeCore/Unix && make release" + +podman_all: + make podman_debug + make podman_release + make dist + +podman_debug: + cd ReClass.NET_Launcher && make podman_debug + cd ReClass.NET && make podman_debug + podman container run --rm -v ${PWD}:/build:z -w /build gcc:latest bash -c "cd NativeCore/Unix && make debug" + +podman_release: + cd ReClass.NET_Launcher && make podman_release + cd ReClass.NET && make podman_release + podman container run --rm -v ${PWD}:/build:z -w /build gcc:latest bash -c "cd NativeCore/Unix && make release" + dist: test -d build || mkdir -p build cp -r ReClass.NET/bin/* build/ diff --git a/ReClass.NET/Makefile b/ReClass.NET/Makefile index 52bcae5b..779202bd 100644 --- a/ReClass.NET/Makefile +++ b/ReClass.NET/Makefile @@ -1,3 +1,5 @@ +.PHONY: all clean debug clean_debug release clean_release update docker_debug docker_release podman_debug podman_release + all: debug release clean: clean_debug clean_release @@ -18,3 +20,19 @@ clean_release: update: mono --runtime=v4.0 ../Dependencies/nuget.exe restore ReClass.NET.csproj -SolutionDirectory ../ + +docker_debug: + podman container run --rm -v ${PWD}/..:/build:z -w /build mono:latest bash -c "cd ReClass.NET && msbuild /p:Configuration=Debug /p:Platform=x86 ReClass.NET.csproj" + podman container run --rm -v ${PWD}/..:/build:z -w /build mono:latest bash -c "cd ReClass.NET && msbuild /p:Configuration=Debug /p:Platform=x64 ReClass.NET.csproj" + +docker_release: + podman container run --rm -v ${PWD}/..:/build:z -w /build mono:latest bash -c "cd ReClass.NET && msbuild /p:Configuration=Release /p:Platform=x86 ReClass.NET.csproj" + podman container run --rm -v ${PWD}/..:/build:z -w /build mono:latest bash -c "cd ReClass.NET && msbuild /p:Configuration=Release /p:Platform=x64 ReClass.NET.csproj" + +podman_debug: + podman container run --rm -v ${PWD}/..:/build:z -w /build mono:latest bash -c "cd ReClass.NET && msbuild /p:Configuration=Debug /p:Platform=x86 ReClass.NET.csproj" + podman container run --rm -v ${PWD}/..:/build:z -w /build mono:latest bash -c "cd ReClass.NET && msbuild /p:Configuration=Debug /p:Platform=x64 ReClass.NET.csproj" + +podman_release: + podman container run --rm -v ${PWD}/..:/build:z -w /build mono:latest bash -c "cd ReClass.NET && msbuild /p:Configuration=Release /p:Platform=x86 ReClass.NET.csproj" + podman container run --rm -v ${PWD}/..:/build:z -w /build mono:latest bash -c "cd ReClass.NET && msbuild /p:Configuration=Release /p:Platform=x64 ReClass.NET.csproj" diff --git a/ReClass.NET_Launcher/Makefile b/ReClass.NET_Launcher/Makefile index eb8e3c4d..0a121e0d 100644 --- a/ReClass.NET_Launcher/Makefile +++ b/ReClass.NET_Launcher/Makefile @@ -1,3 +1,5 @@ +.PHONY: all clean debug clean_debug release clean_release docker_debug docker_release podman_debug podman_release + all: debug release clean: clean_debug clean_release @@ -13,3 +15,15 @@ release: clean_release: msbuild /t:Clean ReClass.NET_Launcher.csproj + +docker_debug: + docker container run --rm -v ${PWD}/..:/build:z -w /build mono:latest bash -c "cd ReClass.NET_Launcher && msbuild /p:Configuration=Debug ReClass.NET_Launcher.csproj" + +docker_release: + docker container run --rm -v ${PWD}/..:/build:z -w /build mono:latest bash -c "cd ReClass.NET_Launcher && msbuild /p:Configuration=Release ReClass.NET_Launcher.csproj" + +podman_debug: + podman container run --rm -v ${PWD}/..:/build:z -w /build mono:latest bash -c "cd ReClass.NET_Launcher && msbuild /p:Configuration=Debug ReClass.NET_Launcher.csproj" + +podman_release: + podman container run --rm -v ${PWD}/..:/build:z -w /build mono:latest bash -c "cd ReClass.NET_Launcher && msbuild /p:Configuration=Release ReClass.NET_Launcher.csproj" From a584d57eb0f811af5f9378ca66f8e1686b4f7980 Mon Sep 17 00:00:00 2001 From: ko1N Date: Sat, 31 Oct 2020 22:32:22 +0100 Subject: [PATCH 188/223] Docker now generates the files as the current user --- Makefile | 8 ++++++-- ReClass.NET/Makefile | 8 ++++---- ReClass.NET_Launcher/Makefile | 4 ++-- 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/Makefile b/Makefile index 50b259f4..72130cd8 100644 --- a/Makefile +++ b/Makefile @@ -26,6 +26,10 @@ clean_release: cd NativeCore/Unix && make clean_release rm -rf build/Release +test: + echo ${PWD} + echo ${USER} + update: cd ReClass.NET && make update @@ -37,12 +41,12 @@ docker_all: docker_debug: cd ReClass.NET_Launcher && make docker_debug cd ReClass.NET && make docker_debug - docker container run --rm -v ${PWD}:/build:z -w /build gcc:latest bash -c "cd NativeCore/Unix && make debug" + docker container run --rm -v ${PWD}:/build:z -w /build -u $(shell id -u ${USER}):$(shell id -g ${USER}) gcc:latest bash -c "cd NativeCore/Unix && make debug" docker_release: cd ReClass.NET_Launcher && make docker_release cd ReClass.NET && make docker_release - docker container run --rm -v ${PWD}:/build:z -w /build gcc:latest bash -c "cd NativeCore/Unix && make release" + docker container run --rm -v ${PWD}:/build:z -w /build -u $(shell id -u ${USER}):$(shell id -g ${USER}) gcc:latest bash -c "cd NativeCore/Unix && make release" podman_all: make podman_debug diff --git a/ReClass.NET/Makefile b/ReClass.NET/Makefile index 779202bd..d66fd569 100644 --- a/ReClass.NET/Makefile +++ b/ReClass.NET/Makefile @@ -22,12 +22,12 @@ update: mono --runtime=v4.0 ../Dependencies/nuget.exe restore ReClass.NET.csproj -SolutionDirectory ../ docker_debug: - podman container run --rm -v ${PWD}/..:/build:z -w /build mono:latest bash -c "cd ReClass.NET && msbuild /p:Configuration=Debug /p:Platform=x86 ReClass.NET.csproj" - podman container run --rm -v ${PWD}/..:/build:z -w /build mono:latest bash -c "cd ReClass.NET && msbuild /p:Configuration=Debug /p:Platform=x64 ReClass.NET.csproj" + docker container run --rm -v ${PWD}/..:/build:z -w /build -u $(shell id -u ${USER}):$(shell id -g ${USER}) mono:latest bash -c "cd ReClass.NET && msbuild /p:Configuration=Debug /p:Platform=x86 ReClass.NET.csproj" + docker container run --rm -v ${PWD}/..:/build:z -w /build -u $(shell id -u ${USER}):$(shell id -g ${USER}) mono:latest bash -c "cd ReClass.NET && msbuild /p:Configuration=Debug /p:Platform=x64 ReClass.NET.csproj" docker_release: - podman container run --rm -v ${PWD}/..:/build:z -w /build mono:latest bash -c "cd ReClass.NET && msbuild /p:Configuration=Release /p:Platform=x86 ReClass.NET.csproj" - podman container run --rm -v ${PWD}/..:/build:z -w /build mono:latest bash -c "cd ReClass.NET && msbuild /p:Configuration=Release /p:Platform=x64 ReClass.NET.csproj" + docker container run --rm -v ${PWD}/..:/build:z -w /build -u $(shell id -u ${USER}):$(shell id -g ${USER}) mono:latest bash -c "cd ReClass.NET && msbuild /p:Configuration=Release /p:Platform=x86 ReClass.NET.csproj" + docker container run --rm -v ${PWD}/..:/build:z -w /build -u $(shell id -u ${USER}):$(shell id -g ${USER}) mono:latest bash -c "cd ReClass.NET && msbuild /p:Configuration=Release /p:Platform=x64 ReClass.NET.csproj" podman_debug: podman container run --rm -v ${PWD}/..:/build:z -w /build mono:latest bash -c "cd ReClass.NET && msbuild /p:Configuration=Debug /p:Platform=x86 ReClass.NET.csproj" diff --git a/ReClass.NET_Launcher/Makefile b/ReClass.NET_Launcher/Makefile index 0a121e0d..bc9ddd11 100644 --- a/ReClass.NET_Launcher/Makefile +++ b/ReClass.NET_Launcher/Makefile @@ -17,10 +17,10 @@ clean_release: msbuild /t:Clean ReClass.NET_Launcher.csproj docker_debug: - docker container run --rm -v ${PWD}/..:/build:z -w /build mono:latest bash -c "cd ReClass.NET_Launcher && msbuild /p:Configuration=Debug ReClass.NET_Launcher.csproj" + docker container run --rm -v ${PWD}/..:/build:z -w /build -u $(shell id -u ${USER}):$(shell id -g ${USER}) mono:latest bash -c "cd ReClass.NET_Launcher && msbuild /p:Configuration=Debug ReClass.NET_Launcher.csproj" docker_release: - docker container run --rm -v ${PWD}/..:/build:z -w /build mono:latest bash -c "cd ReClass.NET_Launcher && msbuild /p:Configuration=Release ReClass.NET_Launcher.csproj" + docker container run --rm -v ${PWD}/..:/build:z -w /build -u $(shell id -u ${USER}):$(shell id -g ${USER}) mono:latest bash -c "cd ReClass.NET_Launcher && msbuild /p:Configuration=Release ReClass.NET_Launcher.csproj" podman_debug: podman container run --rm -v ${PWD}/..:/build:z -w /build mono:latest bash -c "cd ReClass.NET_Launcher && msbuild /p:Configuration=Debug ReClass.NET_Launcher.csproj" From 1816cbee5c6796bebf0e039f57357064810ea3b1 Mon Sep 17 00:00:00 2001 From: ko1N Date: Thu, 5 Nov 2020 10:12:27 +0100 Subject: [PATCH 189/223] Removed test block from Makefile --- Makefile | 4 ---- 1 file changed, 4 deletions(-) diff --git a/Makefile b/Makefile index 72130cd8..10ab0620 100644 --- a/Makefile +++ b/Makefile @@ -26,10 +26,6 @@ clean_release: cd NativeCore/Unix && make clean_release rm -rf build/Release -test: - echo ${PWD} - echo ${USER} - update: cd ReClass.NET && make update From 726b6ab444ef004fe77add0f1a99c5f22dca96b4 Mon Sep 17 00:00:00 2001 From: KN4CK3R Date: Mon, 9 Nov 2020 00:06:28 +0100 Subject: [PATCH 190/223] Auto scale plugin images. --- ReClass.NET/Forms/PluginForm.Designer.cs | 91 ++++++++++++------------ ReClass.NET/Forms/PluginForm.cs | 2 +- 2 files changed, 47 insertions(+), 46 deletions(-) diff --git a/ReClass.NET/Forms/PluginForm.Designer.cs b/ReClass.NET/Forms/PluginForm.Designer.cs index 86a82777..c1df5042 100644 --- a/ReClass.NET/Forms/PluginForm.Designer.cs +++ b/ReClass.NET/Forms/PluginForm.Designer.cs @@ -35,17 +35,17 @@ private void InitializeComponent() this.descriptionGroupBox = new System.Windows.Forms.GroupBox(); this.descriptionLabel = new System.Windows.Forms.Label(); this.pluginsDataGridView = new System.Windows.Forms.DataGridView(); - this.iconColumn = new System.Windows.Forms.DataGridViewImageColumn(); - this.nameColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.versionColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.authorColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.nativesTabPage = new System.Windows.Forms.TabPage(); this.label2 = new System.Windows.Forms.Label(); this.functionsProvidersComboBox = new System.Windows.Forms.ComboBox(); this.label1 = new System.Windows.Forms.Label(); this.getMoreLinkLabel = new System.Windows.Forms.LinkLabel(); this.closeButton = new System.Windows.Forms.Button(); - this.bannerBox = new BannerBox(); + this.bannerBox = new ReClassNET.Controls.BannerBox(); + this.iconColumn = new System.Windows.Forms.DataGridViewImageColumn(); + this.nameColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.versionColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.authorColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.tabControl.SuspendLayout(); this.pluginsTabPage.SuspendLayout(); this.descriptionGroupBox.SuspendLayout(); @@ -119,43 +119,6 @@ private void InitializeComponent() this.pluginsDataGridView.TabIndex = 0; this.pluginsDataGridView.SelectionChanged += new System.EventHandler(this.pluginsDataGridView_SelectionChanged); // - // iconColumn - // - this.iconColumn.DataPropertyName = "Icon"; - this.iconColumn.HeaderText = ""; - this.iconColumn.MinimumWidth = 18; - this.iconColumn.Name = "iconColumn"; - this.iconColumn.ReadOnly = true; - this.iconColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True; - this.iconColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic; - this.iconColumn.Width = 18; - // - // nameColumn - // - this.nameColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; - this.nameColumn.DataPropertyName = "Name"; - this.nameColumn.HeaderText = "Name"; - this.nameColumn.Name = "nameColumn"; - this.nameColumn.ReadOnly = true; - // - // versionColumn - // - this.versionColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells; - this.versionColumn.DataPropertyName = "Version"; - this.versionColumn.HeaderText = "Version"; - this.versionColumn.Name = "versionColumn"; - this.versionColumn.ReadOnly = true; - this.versionColumn.Width = 67; - // - // authorColumn - // - this.authorColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells; - this.authorColumn.DataPropertyName = "Author"; - this.authorColumn.HeaderText = "Author"; - this.authorColumn.Name = "authorColumn"; - this.authorColumn.ReadOnly = true; - this.authorColumn.Width = 63; - // // nativesTabPage // this.nativesTabPage.Controls.Add(this.label2); @@ -233,6 +196,44 @@ private void InitializeComponent() this.bannerBox.Text = "Here you can configure all loaded ReClass.NET plugins."; this.bannerBox.Title = "Plugins"; // + // iconColumn + // + this.iconColumn.DataPropertyName = "Icon"; + this.iconColumn.HeaderText = ""; + this.iconColumn.ImageLayout = System.Windows.Forms.DataGridViewImageCellLayout.Zoom; + this.iconColumn.MinimumWidth = 18; + this.iconColumn.Name = "iconColumn"; + this.iconColumn.ReadOnly = true; + this.iconColumn.Resizable = System.Windows.Forms.DataGridViewTriState.False; + this.iconColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic; + this.iconColumn.Width = 18; + // + // nameColumn + // + this.nameColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; + this.nameColumn.DataPropertyName = "Name"; + this.nameColumn.HeaderText = "Name"; + this.nameColumn.Name = "nameColumn"; + this.nameColumn.ReadOnly = true; + // + // versionColumn + // + this.versionColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells; + this.versionColumn.DataPropertyName = "Version"; + this.versionColumn.HeaderText = "Version"; + this.versionColumn.Name = "versionColumn"; + this.versionColumn.ReadOnly = true; + this.versionColumn.Width = 67; + // + // authorColumn + // + this.authorColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells; + this.authorColumn.DataPropertyName = "Author"; + this.authorColumn.HeaderText = "Author"; + this.authorColumn.Name = "authorColumn"; + this.authorColumn.ReadOnly = true; + this.authorColumn.Width = 63; + // // PluginForm // this.AcceptButton = this.closeButton; @@ -273,12 +274,12 @@ private void InitializeComponent() private System.Windows.Forms.Button closeButton; private System.Windows.Forms.Label descriptionLabel; private System.Windows.Forms.Label label1; + private BannerBox bannerBox; + private System.Windows.Forms.ComboBox functionsProvidersComboBox; + private System.Windows.Forms.Label label2; private System.Windows.Forms.DataGridViewImageColumn iconColumn; private System.Windows.Forms.DataGridViewTextBoxColumn nameColumn; private System.Windows.Forms.DataGridViewTextBoxColumn versionColumn; private System.Windows.Forms.DataGridViewTextBoxColumn authorColumn; - private BannerBox bannerBox; - private System.Windows.Forms.ComboBox functionsProvidersComboBox; - private System.Windows.Forms.Label label2; } } \ No newline at end of file diff --git a/ReClass.NET/Forms/PluginForm.cs b/ReClass.NET/Forms/PluginForm.cs index c8493df2..81577f7f 100644 --- a/ReClass.NET/Forms/PluginForm.cs +++ b/ReClass.NET/Forms/PluginForm.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Diagnostics; using System.Diagnostics.Contracts; using System.Drawing; From ead9f20327da4ba4507ec687ee626fddb3b37836 Mon Sep 17 00:00:00 2001 From: KN4CK3R Date: Tue, 10 Nov 2020 00:14:33 +0100 Subject: [PATCH 191/223] Removed methods which read structs from memory. This change is needed to add support for little/big endian support. Benchmarks have shown that the ReadObject method is faster for structs with more than six 4 byte fields. Only the matrix nodes have such big structures so this change speeds up all smaller reads. --- ReClass.NET/Memory/IRemoteMemoryReader.cs | 8 +- ReClass.NET/Memory/MemoryBuffer.cs | 17 ---- ReClass.NET/Memory/NodeDissector.cs | 20 +++-- ReClass.NET/Memory/RemoteProcess.cs | 13 +-- ReClass.NET/Memory/UnionDataType.cs | 19 ++--- ReClass.NET/Nodes/BaseMatrixNode.cs | 42 ++++++++-- ReClass.NET/Nodes/Hex16Node.cs | 2 +- ReClass.NET/Nodes/Hex32Node.cs | 11 ++- ReClass.NET/Nodes/Hex64Node.cs | 12 ++- ReClass.NET/Nodes/Matrix3x3Node.cs | 63 +-------------- ReClass.NET/Nodes/Matrix3x4Node.cs | 75 +----------------- ReClass.NET/Nodes/Matrix4x4Node.cs | 96 +---------------------- ReClass.NET/Nodes/Vector2Node.cs | 21 +---- ReClass.NET/Nodes/Vector3Node.cs | 25 +----- ReClass.NET/Nodes/Vector4Node.cs | 29 +------ 15 files changed, 85 insertions(+), 368 deletions(-) diff --git a/ReClass.NET/Memory/IRemoteMemoryReader.cs b/ReClass.NET/Memory/IRemoteMemoryReader.cs index b4f75544..3f926c82 100644 --- a/ReClass.NET/Memory/IRemoteMemoryReader.cs +++ b/ReClass.NET/Memory/IRemoteMemoryReader.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Text; namespace ReClassNET.Memory @@ -23,12 +23,6 @@ public interface IRemoteMemoryReader /// An array of bytes. byte[] ReadRemoteMemory(IntPtr address, int size); - /// Reads the object from the address in the remote process. - /// Type of the value to read. - /// The address to read from. - /// The remote object. - T ReadRemoteObject(IntPtr address) where T : struct; - /// Reads a from the address in the remote process. /// The address to read from. /// The data read as or 0 if the read fails. diff --git a/ReClass.NET/Memory/MemoryBuffer.cs b/ReClass.NET/Memory/MemoryBuffer.cs index f81b3885..52f874b5 100644 --- a/ReClass.NET/Memory/MemoryBuffer.cs +++ b/ReClass.NET/Memory/MemoryBuffer.cs @@ -133,23 +133,6 @@ public void ReadBytes(int offset, byte[] buffer) Array.Copy(data, offset, buffer, 0, buffer.Length); } - public T ReadObject(int offset) where T : struct - { - Contract.Requires(offset >= 0); - - offset = Offset + offset; - if (offset + Marshal.SizeOf(typeof(T)) > data.Length) - { - return default; - } - - var handle = GCHandle.Alloc(data, GCHandleType.Pinned); - var obj = Marshal.PtrToStructure(handle.AddrOfPinnedObject() + offset); - handle.Free(); - - return obj; - } - #region Read Primitive Types /// Reads a from the specific offset. diff --git a/ReClass.NET/Memory/NodeDissector.cs b/ReClass.NET/Memory/NodeDissector.cs index 3e103b16..e03b92e9 100644 --- a/ReClass.NET/Memory/NodeDissector.cs +++ b/ReClass.NET/Memory/NodeDissector.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Diagnostics.Contracts; using System.Linq; @@ -41,8 +41,15 @@ public static bool GuessNode(BaseHexNode node, IProcessReader reader, MemoryBuff return false; } - var data64 = memory.ReadObject(offset); - var data32 = memory.ReadObject(offset); + var data64 = new UInt64FloatDoubleData + { + Raw1 = memory.ReadInt32(offset), + Raw2 = memory.ReadInt32(offset + sizeof(int)) + }; ; + var data32 = new UInt32FloatData + { + Raw = memory.ReadInt32(offset) + }; var raw = memory.ReadBytes(offset, node.MemorySize); if (raw.InterpretAsSingleByteCharacter().IsLikelyPrintableData()) @@ -135,10 +142,9 @@ private static bool GuessPointerNode(IntPtr address, IProcessReader process, out if (section.Category == SectionCategory.DATA || section.Category == SectionCategory.HEAP) // If the section contains data, it is at least a pointer to a class or something. { // Check if it is a vtable. Check if the first 3 values are pointers to a code section. - var possibleVmt = process.ReadRemoteObject(address); - if (process.GetSectionToPointer(possibleVmt.Pointer1)?.Category == SectionCategory.CODE - && process.GetSectionToPointer(possibleVmt.Pointer2)?.Category == SectionCategory.CODE - && process.GetSectionToPointer(possibleVmt.Pointer3)?.Category == SectionCategory.CODE) + if (process.GetSectionToPointer(process.ReadRemoteIntPtr(address))?.Category == SectionCategory.CODE + && process.GetSectionToPointer(process.ReadRemoteIntPtr(address + IntPtr.Size))?.Category == SectionCategory.CODE + && process.GetSectionToPointer(process.ReadRemoteIntPtr(address + 2 * IntPtr.Size))?.Category == SectionCategory.CODE) { node = new VirtualMethodTableNode(); diff --git a/ReClass.NET/Memory/RemoteProcess.cs b/ReClass.NET/Memory/RemoteProcess.cs index 14337cf9..b23286c0 100644 --- a/ReClass.NET/Memory/RemoteProcess.cs +++ b/ReClass.NET/Memory/RemoteProcess.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Diagnostics.Contracts; using System.Linq; @@ -185,17 +185,6 @@ public byte[] ReadRemoteMemory(IntPtr address, int size) return data; } - public T ReadRemoteObject(IntPtr address) where T : struct - { - var data = ReadRemoteMemory(address, Marshal.SizeOf()); - - var gcHandle = GCHandle.Alloc(data, GCHandleType.Pinned); - var obj = (T)Marshal.PtrToStructure(gcHandle.AddrOfPinnedObject(), typeof(T)); - gcHandle.Free(); - - return obj; - } - #region Read Remote Primitive Types public sbyte ReadRemoteInt8(IntPtr address) diff --git a/ReClass.NET/Memory/UnionDataType.cs b/ReClass.NET/Memory/UnionDataType.cs index 3c53b48b..36a47a7e 100644 --- a/ReClass.NET/Memory/UnionDataType.cs +++ b/ReClass.NET/Memory/UnionDataType.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Runtime.InteropServices; namespace ReClassNET.Memory @@ -26,6 +26,9 @@ public struct UInt16Data [StructLayout(LayoutKind.Explicit)] public struct UInt32FloatData { + [FieldOffset(0)] + public int Raw; + [FieldOffset(0)] public int IntValue; @@ -43,6 +46,12 @@ public struct UInt32FloatData [StructLayout(LayoutKind.Explicit)] public struct UInt64FloatDoubleData { + [FieldOffset(0)] + public int Raw1; + + [FieldOffset(4)] + public int Raw2; + [FieldOffset(0)] public long LongValue; @@ -69,12 +78,4 @@ public struct UInt64FloatDoubleData [FieldOffset(0)] public double DoubleValue; } - - [StructLayout(LayoutKind.Sequential)] - public struct ThreePointersData - { - public IntPtr Pointer1; - public IntPtr Pointer2; - public IntPtr Pointer3; - } } diff --git a/ReClass.NET/Nodes/BaseMatrixNode.cs b/ReClass.NET/Nodes/BaseMatrixNode.cs index d97d7bc0..d080b08d 100644 --- a/ReClass.NET/Nodes/BaseMatrixNode.cs +++ b/ReClass.NET/Nodes/BaseMatrixNode.cs @@ -1,3 +1,4 @@ +using System; using System.Diagnostics.Contracts; using System.Drawing; using ReClassNET.Controls; @@ -17,11 +18,10 @@ protected BaseMatrixNode() protected delegate void DrawMatrixValues(int x, ref int maxX, ref int y); - protected Size DrawMatrixType(DrawContext context, int x, int y, string type, DrawMatrixValues drawValues) + protected Size DrawMatrixType(DrawContext context, int x, int y, string type, int rows, int columns) { Contract.Requires(context != null); Contract.Requires(type != null); - Contract.Requires(drawValues != null); if (IsHidden && !IsWrapped) { @@ -58,18 +58,36 @@ protected Size DrawMatrixType(DrawContext context, int x, int y, string type, Dr if (LevelsOpen[context.Level]) { - drawValues(tx, ref x, ref y); + var index = 0; + for (var row = 0; row < rows; ++row) + { + y += context.Font.Height; + var x2 = tx; + + x2 = AddText(context, x2, y, context.Settings.NameColor, HotSpot.NoneId, "|"); + + for (var column = 0; column < columns; ++column) + { + var value = context.Memory.ReadFloat(Offset + index * sizeof(float)); + x2 = AddText(context, x2, y, context.Settings.ValueColor, index, $"{value,14:0.000}"); + + index++; + } + + x2 = AddText(context, x2, y, context.Settings.NameColor, HotSpot.NoneId, "|"); + + x = Math.Max(x2, x); + } } return new Size(x - origX, y - origY + context.Font.Height); } protected delegate void DrawVectorValues(ref int x, ref int y); - protected Size DrawVectorType(DrawContext context, int x, int y, string type, DrawVectorValues drawValues) + protected Size DrawVectorType(DrawContext context, int x, int y, string type, int columns) { Contract.Requires(context != null); Contract.Requires(type != null); - Contract.Requires(drawValues != null); if (IsHidden && !IsWrapped) { @@ -97,7 +115,19 @@ protected Size DrawVectorType(DrawContext context, int x, int y, string type, Dr if (LevelsOpen[context.Level]) { - drawValues(ref x, ref y); + x = AddText(context, x, y, context.Settings.NameColor, HotSpot.NoneId, "("); + for (var column = 0; column < columns; ++column) + { + var value = context.Memory.ReadFloat(Offset + column * sizeof(float)); + + x = AddText(context, x, y, context.Settings.ValueColor, column, $"{value:0.000}"); + + if (column < columns - 1) + { + x = AddText(context, x, y, context.Settings.NameColor, HotSpot.NoneId, ","); + } + } + x = AddText(context, x, y, context.Settings.NameColor, HotSpot.NoneId, ")"); } x += context.Font.Width; diff --git a/ReClass.NET/Nodes/Hex16Node.cs b/ReClass.NET/Nodes/Hex16Node.cs index c567bda6..2e18994a 100644 --- a/ReClass.NET/Nodes/Hex16Node.cs +++ b/ReClass.NET/Nodes/Hex16Node.cs @@ -17,7 +17,7 @@ public override void GetUserInterfaceInfo(out string name, out Image icon) public override string GetToolTipText(HotSpot spot) { - var value = spot.Memory.ReadObject(Offset); + var value = new UInt16Data { ShortValue = spot.Memory.ReadInt16(Offset) }; return $"Int16: {value.ShortValue}\nUInt16: 0x{value.UShortValue:X04}"; } diff --git a/ReClass.NET/Nodes/Hex32Node.cs b/ReClass.NET/Nodes/Hex32Node.cs index b58567fb..c7b54027 100644 --- a/ReClass.NET/Nodes/Hex32Node.cs +++ b/ReClass.NET/Nodes/Hex32Node.cs @@ -18,7 +18,7 @@ public override void GetUserInterfaceInfo(out string name, out Image icon) public override bool UseMemoryPreviewToolTip(HotSpot spot, out IntPtr address) { - var value = spot.Memory.ReadObject(Offset); + var value = ReadFromBuffer(spot.Memory, Offset); address = value.IntPtr; @@ -27,7 +27,7 @@ public override bool UseMemoryPreviewToolTip(HotSpot spot, out IntPtr address) public override string GetToolTipText(HotSpot spot) { - var value = spot.Memory.ReadObject(Offset); + var value = ReadFromBuffer(spot.Memory, Offset); return $"Int32: {value.IntValue}\nUInt32: 0x{value.UIntValue:X08}\nFloat: {value.FloatValue:0.000}"; } @@ -46,11 +46,16 @@ protected override int AddComment(DrawContext context, int x, int y) { x = base.AddComment(context, x, y); - var value = context.Memory.ReadObject(Offset); + var value = ReadFromBuffer(context.Memory, Offset); x = AddComment(context, x, y, value.FloatValue, value.IntPtr, value.UIntPtr); return x; } + + private static UInt32FloatData ReadFromBuffer(MemoryBuffer memory, int offset) => new UInt32FloatData + { + Raw = memory.ReadInt32(offset) + }; } } diff --git a/ReClass.NET/Nodes/Hex64Node.cs b/ReClass.NET/Nodes/Hex64Node.cs index 3cacf264..d54f1e71 100644 --- a/ReClass.NET/Nodes/Hex64Node.cs +++ b/ReClass.NET/Nodes/Hex64Node.cs @@ -18,7 +18,7 @@ public override void GetUserInterfaceInfo(out string name, out Image icon) public override bool UseMemoryPreviewToolTip(HotSpot spot, out IntPtr address) { - var value = spot.Memory.ReadObject(Offset); + var value = ReadFromBuffer(spot.Memory, Offset); address = value.IntPtr; @@ -27,7 +27,7 @@ public override bool UseMemoryPreviewToolTip(HotSpot spot, out IntPtr address) public override string GetToolTipText(HotSpot spot) { - var value = spot.Memory.ReadObject(Offset); + var value = ReadFromBuffer(spot.Memory, Offset); return $"Int64: {value.LongValue}\nUInt64: 0x{value.ULongValue:X016}\nFloat: {value.FloatValue:0.000}\nDouble: {value.DoubleValue:0.000}"; } @@ -46,11 +46,17 @@ protected override int AddComment(DrawContext context, int x, int y) { x = base.AddComment(context, x, y); - var value = context.Memory.ReadObject(Offset); + var value = ReadFromBuffer(context.Memory, Offset); x = AddComment(context, x, y, value.FloatValue, value.IntPtr, value.UIntPtr); return x; } + + private static UInt64FloatDoubleData ReadFromBuffer(MemoryBuffer memory, int offset) => new UInt64FloatDoubleData + { + Raw1 = memory.ReadInt32(offset), + Raw2 = memory.ReadInt32(offset + sizeof(int)) + }; } } diff --git a/ReClass.NET/Nodes/Matrix3x3Node.cs b/ReClass.NET/Nodes/Matrix3x3Node.cs index 91a212b9..37bc1802 100644 --- a/ReClass.NET/Nodes/Matrix3x3Node.cs +++ b/ReClass.NET/Nodes/Matrix3x3Node.cs @@ -1,6 +1,4 @@ -using System; using System.Drawing; -using System.Runtime.InteropServices; using ReClassNET.Controls; using ReClassNET.UI; @@ -8,29 +6,6 @@ namespace ReClassNET.Nodes { public class Matrix3x3Node : BaseMatrixNode { - [StructLayout(LayoutKind.Explicit)] - private readonly struct Matrix3x3Data - { - [FieldOffset(0)] - public readonly float _11; - [FieldOffset(4)] - public readonly float _12; - [FieldOffset(8)] - public readonly float _13; - [FieldOffset(12)] - public readonly float _21; - [FieldOffset(16)] - public readonly float _22; - [FieldOffset(20)] - public readonly float _23; - [FieldOffset(24)] - public readonly float _31; - [FieldOffset(28)] - public readonly float _32; - [FieldOffset(32)] - public readonly float _33; - } - public override int ValueTypeSize => sizeof(float); public override int MemorySize => 9 * ValueTypeSize; @@ -43,43 +18,7 @@ public override void GetUserInterfaceInfo(out string name, out Image icon) public override Size Draw(DrawContext context, int x2, int y2) { - return DrawMatrixType(context, x2, y2, "Matrix (3x3)", (int defaultX, ref int maxX, ref int y) => - { - var value = context.Memory.ReadObject(Offset); - - y += context.Font.Height; - var x = defaultX; - x = AddText(context, x, y, context.Settings.NameColor, HotSpot.NoneId, "|"); - x = AddText(context, x, y, context.Settings.ValueColor, 0, $"{value._11,14:0.000}"); - x = AddText(context, x, y, context.Settings.NameColor, HotSpot.NoneId, ","); - x = AddText(context, x, y, context.Settings.ValueColor, 1, $"{value._12,14:0.000}"); - x = AddText(context, x, y, context.Settings.NameColor, HotSpot.NoneId, ","); - x = AddText(context, x, y, context.Settings.ValueColor, 2, $"{value._13,14:0.000}"); - x = AddText(context, x, y, context.Settings.NameColor, HotSpot.NoneId, "|"); - maxX = Math.Max(x, maxX); - - y += context.Font.Height; - x = defaultX; - x = AddText(context, x, y, context.Settings.NameColor, HotSpot.NoneId, "|"); - x = AddText(context, x, y, context.Settings.ValueColor, 3, $"{value._21,14:0.000}"); - x = AddText(context, x, y, context.Settings.NameColor, HotSpot.NoneId, ","); - x = AddText(context, x, y, context.Settings.ValueColor, 4, $"{value._22,14:0.000}"); - x = AddText(context, x, y, context.Settings.NameColor, HotSpot.NoneId, ","); - x = AddText(context, x, y, context.Settings.ValueColor, 5, $"{value._23,14:0.000}"); - x = AddText(context, x, y, context.Settings.NameColor, HotSpot.NoneId, "|"); - maxX = Math.Max(x, maxX); - - y += context.Font.Height; - x = defaultX; - x = AddText(context, x, y, context.Settings.NameColor, HotSpot.NoneId, "|"); - x = AddText(context, x, y, context.Settings.ValueColor, 6, $"{value._31,14:0.000}"); - x = AddText(context, x, y, context.Settings.NameColor, HotSpot.NoneId, ","); - x = AddText(context, x, y, context.Settings.ValueColor, 7, $"{value._32,14:0.000}"); - x = AddText(context, x, y, context.Settings.NameColor, HotSpot.NoneId, ","); - x = AddText(context, x, y, context.Settings.ValueColor, 8, $"{value._33,14:0.000}"); - x = AddText(context, x, y, context.Settings.NameColor, HotSpot.NoneId, "|"); - maxX = Math.Max(x, maxX); - }); + return DrawMatrixType(context, x2, y2, "Matrix (3x3)", 3, 3); } protected override int CalculateValuesHeight(DrawContext context) diff --git a/ReClass.NET/Nodes/Matrix3x4Node.cs b/ReClass.NET/Nodes/Matrix3x4Node.cs index 8a5969c0..96948064 100644 --- a/ReClass.NET/Nodes/Matrix3x4Node.cs +++ b/ReClass.NET/Nodes/Matrix3x4Node.cs @@ -1,6 +1,4 @@ -using System; using System.Drawing; -using System.Runtime.InteropServices; using ReClassNET.Controls; using ReClassNET.UI; @@ -8,35 +6,6 @@ namespace ReClassNET.Nodes { public class Matrix3x4Node : BaseMatrixNode { - [StructLayout(LayoutKind.Explicit)] - private readonly struct Matrix3x4Data - { - [FieldOffset(0)] - public readonly float _11; - [FieldOffset(4)] - public readonly float _12; - [FieldOffset(8)] - public readonly float _13; - [FieldOffset(12)] - public readonly float _14; - [FieldOffset(16)] - public readonly float _21; - [FieldOffset(20)] - public readonly float _22; - [FieldOffset(24)] - public readonly float _23; - [FieldOffset(28)] - public readonly float _24; - [FieldOffset(32)] - public readonly float _31; - [FieldOffset(36)] - public readonly float _32; - [FieldOffset(40)] - public readonly float _33; - [FieldOffset(44)] - public readonly float _34; - } - public override int ValueTypeSize => sizeof(float); public override int MemorySize => 12 * ValueTypeSize; @@ -49,49 +18,7 @@ public override void GetUserInterfaceInfo(out string name, out Image icon) public override Size Draw(DrawContext context, int x2, int y2) { - return DrawMatrixType(context, x2, y2, "Matrix (3x4)", (int defaultX, ref int maxX, ref int y) => - { - var value = context.Memory.ReadObject(Offset); - - y += context.Font.Height; - var x = defaultX; - x = AddText(context, x, y, context.Settings.NameColor, HotSpot.NoneId, "|"); - x = AddText(context, x, y, context.Settings.ValueColor, 0, $"{value._11,14:0.000}"); - x = AddText(context, x, y, context.Settings.NameColor, HotSpot.NoneId, ","); - x = AddText(context, x, y, context.Settings.ValueColor, 1, $"{value._12,14:0.000}"); - x = AddText(context, x, y, context.Settings.NameColor, HotSpot.NoneId, ","); - x = AddText(context, x, y, context.Settings.ValueColor, 2, $"{value._13,14:0.000}"); - x = AddText(context, x, y, context.Settings.NameColor, HotSpot.NoneId, ","); - x = AddText(context, x, y, context.Settings.ValueColor, 3, $"{value._14,14:0.000}"); - x = AddText(context, x, y, context.Settings.NameColor, HotSpot.NoneId, "|"); - maxX = Math.Max(x, maxX); - - y += context.Font.Height; - x = defaultX; - x = AddText(context, x, y, context.Settings.NameColor, HotSpot.NoneId, "|"); - x = AddText(context, x, y, context.Settings.ValueColor, 4, $"{value._21,14:0.000}"); - x = AddText(context, x, y, context.Settings.NameColor, HotSpot.NoneId, ","); - x = AddText(context, x, y, context.Settings.ValueColor, 5, $"{value._22,14:0.000}"); - x = AddText(context, x, y, context.Settings.NameColor, HotSpot.NoneId, ","); - x = AddText(context, x, y, context.Settings.ValueColor, 6, $"{value._23,14:0.000}"); - x = AddText(context, x, y, context.Settings.NameColor, HotSpot.NoneId, ","); - x = AddText(context, x, y, context.Settings.ValueColor, 7, $"{value._24,14:0.000}"); - x = AddText(context, x, y, context.Settings.NameColor, HotSpot.NoneId, "|"); - maxX = Math.Max(x, maxX); - - y += context.Font.Height; - x = defaultX; - x = AddText(context, x, y, context.Settings.NameColor, HotSpot.NoneId, "|"); - x = AddText(context, x, y, context.Settings.ValueColor, 8, $"{value._31,14:0.000}"); - x = AddText(context, x, y, context.Settings.NameColor, HotSpot.NoneId, ","); - x = AddText(context, x, y, context.Settings.ValueColor, 9, $"{value._32,14:0.000}"); - x = AddText(context, x, y, context.Settings.NameColor, HotSpot.NoneId, ","); - x = AddText(context, x, y, context.Settings.ValueColor, 10, $"{value._33,14:0.000}"); - x = AddText(context, x, y, context.Settings.NameColor, HotSpot.NoneId, ","); - x = AddText(context, x, y, context.Settings.ValueColor, 11, $"{value._34,14:0.000}"); - x = AddText(context, x, y, context.Settings.NameColor, HotSpot.NoneId, "|"); - maxX = Math.Max(x, maxX); - }); + return DrawMatrixType(context, x2, y2, "Matrix (3x4)", 3, 4); } protected override int CalculateValuesHeight(DrawContext context) diff --git a/ReClass.NET/Nodes/Matrix4x4Node.cs b/ReClass.NET/Nodes/Matrix4x4Node.cs index d8c022f9..69318694 100644 --- a/ReClass.NET/Nodes/Matrix4x4Node.cs +++ b/ReClass.NET/Nodes/Matrix4x4Node.cs @@ -1,6 +1,4 @@ -using System; using System.Drawing; -using System.Runtime.InteropServices; using ReClassNET.Controls; using ReClassNET.UI; @@ -8,43 +6,6 @@ namespace ReClassNET.Nodes { public class Matrix4x4Node : BaseMatrixNode { - [StructLayout(LayoutKind.Explicit)] - private readonly struct Matrix4x4Data - { - [FieldOffset(0)] - public readonly float _11; - [FieldOffset(4)] - public readonly float _12; - [FieldOffset(8)] - public readonly float _13; - [FieldOffset(12)] - public readonly float _14; - [FieldOffset(16)] - public readonly float _21; - [FieldOffset(20)] - public readonly float _22; - [FieldOffset(24)] - public readonly float _23; - [FieldOffset(28)] - public readonly float _24; - [FieldOffset(32)] - public readonly float _31; - [FieldOffset(36)] - public readonly float _32; - [FieldOffset(40)] - public readonly float _33; - [FieldOffset(44)] - public readonly float _34; - [FieldOffset(48)] - public readonly float _41; - [FieldOffset(52)] - public readonly float _42; - [FieldOffset(56)] - public readonly float _43; - [FieldOffset(60)] - public readonly float _44; - } - public override int ValueTypeSize => sizeof(float); public override int MemorySize => 16 * ValueTypeSize; @@ -57,62 +18,7 @@ public override void GetUserInterfaceInfo(out string name, out Image icon) public override Size Draw(DrawContext context, int x2, int y2) { - return DrawMatrixType(context, x2, y2, "Matrix (4x4)", (int defaultX, ref int maxX, ref int y) => - { - var value = context.Memory.ReadObject(Offset); - - y += context.Font.Height; - var x = defaultX; - x = AddText(context, x, y, context.Settings.NameColor, HotSpot.NoneId, "|"); - x = AddText(context, x, y, context.Settings.ValueColor, 0, $"{value._11,14:0.000}"); - x = AddText(context, x, y, context.Settings.NameColor, HotSpot.NoneId, ","); - x = AddText(context, x, y, context.Settings.ValueColor, 1, $"{value._12,14:0.000}"); - x = AddText(context, x, y, context.Settings.NameColor, HotSpot.NoneId, ","); - x = AddText(context, x, y, context.Settings.ValueColor, 2, $"{value._13,14:0.000}"); - x = AddText(context, x, y, context.Settings.NameColor, HotSpot.NoneId, ","); - x = AddText(context, x, y, context.Settings.ValueColor, 3, $"{value._14,14:0.000}"); - x = AddText(context, x, y, context.Settings.NameColor, HotSpot.NoneId, "|"); - maxX = Math.Max(x, maxX); - - y += context.Font.Height; - x = defaultX; - x = AddText(context, x, y, context.Settings.NameColor, HotSpot.NoneId, "|"); - x = AddText(context, x, y, context.Settings.ValueColor, 4, $"{value._21,14:0.000}"); - x = AddText(context, x, y, context.Settings.NameColor, HotSpot.NoneId, ","); - x = AddText(context, x, y, context.Settings.ValueColor, 5, $"{value._22,14:0.000}"); - x = AddText(context, x, y, context.Settings.NameColor, HotSpot.NoneId, ","); - x = AddText(context, x, y, context.Settings.ValueColor, 6, $"{value._23,14:0.000}"); - x = AddText(context, x, y, context.Settings.NameColor, HotSpot.NoneId, ","); - x = AddText(context, x, y, context.Settings.ValueColor, 7, $"{value._24,14:0.000}"); - x = AddText(context, x, y, context.Settings.NameColor, HotSpot.NoneId, "|"); - maxX = Math.Max(x, maxX); - - y += context.Font.Height; - x = defaultX; - x = AddText(context, x, y, context.Settings.NameColor, HotSpot.NoneId, "|"); - x = AddText(context, x, y, context.Settings.ValueColor, 8, $"{value._31,14:0.000}"); - x = AddText(context, x, y, context.Settings.NameColor, HotSpot.NoneId, ","); - x = AddText(context, x, y, context.Settings.ValueColor, 9, $"{value._32,14:0.000}"); - x = AddText(context, x, y, context.Settings.NameColor, HotSpot.NoneId, ","); - x = AddText(context, x, y, context.Settings.ValueColor, 10, $"{value._33,14:0.000}"); - x = AddText(context, x, y, context.Settings.NameColor, HotSpot.NoneId, ","); - x = AddText(context, x, y, context.Settings.ValueColor, 11, $"{value._34,14:0.000}"); - x = AddText(context, x, y, context.Settings.NameColor, HotSpot.NoneId, "|"); - maxX = Math.Max(x, maxX); - - y += context.Font.Height; - x = defaultX; - x = AddText(context, x, y, context.Settings.NameColor, HotSpot.NoneId, "|"); - x = AddText(context, x, y, context.Settings.ValueColor, 12, $"{value._41,14:0.000}"); - x = AddText(context, x, y, context.Settings.NameColor, HotSpot.NoneId, ","); - x = AddText(context, x, y, context.Settings.ValueColor, 13, $"{value._42,14:0.000}"); - x = AddText(context, x, y, context.Settings.NameColor, HotSpot.NoneId, ","); - x = AddText(context, x, y, context.Settings.ValueColor, 14, $"{value._43,14:0.000}"); - x = AddText(context, x, y, context.Settings.NameColor, HotSpot.NoneId, ","); - x = AddText(context, x, y, context.Settings.ValueColor, 15, $"{value._44,14:0.000}"); - x = AddText(context, x, y, context.Settings.NameColor, HotSpot.NoneId, "|"); - maxX = Math.Max(x, maxX); - }); + return DrawMatrixType(context, x2, y2, "Matrix (4x4)", 4, 4); } protected override int CalculateValuesHeight(DrawContext context) diff --git a/ReClass.NET/Nodes/Vector2Node.cs b/ReClass.NET/Nodes/Vector2Node.cs index a9e876d6..a3df104a 100644 --- a/ReClass.NET/Nodes/Vector2Node.cs +++ b/ReClass.NET/Nodes/Vector2Node.cs @@ -1,5 +1,4 @@ using System.Drawing; -using System.Runtime.InteropServices; using ReClassNET.Controls; using ReClassNET.UI; @@ -7,15 +6,6 @@ namespace ReClassNET.Nodes { public class Vector2Node : BaseMatrixNode { - [StructLayout(LayoutKind.Explicit)] - private readonly struct Vector2Data - { - [FieldOffset(0)] - public readonly float X; - [FieldOffset(4)] - public readonly float Y; - } - public override int ValueTypeSize => sizeof(float); public override int MemorySize => 2 * ValueTypeSize; @@ -28,16 +18,7 @@ public override void GetUserInterfaceInfo(out string name, out Image icon) public override Size Draw(DrawContext context, int x2, int y2) { - return DrawVectorType(context, x2, y2, "Vector2", (ref int x, ref int y) => - { - var value = context.Memory.ReadObject(Offset); - - x = AddText(context, x, y, context.Settings.NameColor, HotSpot.NoneId, "("); - x = AddText(context, x, y, context.Settings.ValueColor, 0, $"{value.X:0.000}"); - x = AddText(context, x, y, context.Settings.NameColor, HotSpot.NoneId, ","); - x = AddText(context, x, y, context.Settings.ValueColor, 1, $"{value.Y:0.000}"); - x = AddText(context, x, y, context.Settings.NameColor, HotSpot.NoneId, ")"); - }); + return DrawVectorType(context, x2, y2, "Vector2", 2); } protected override int CalculateValuesHeight(DrawContext context) diff --git a/ReClass.NET/Nodes/Vector3Node.cs b/ReClass.NET/Nodes/Vector3Node.cs index 8f49111a..b2b84b25 100644 --- a/ReClass.NET/Nodes/Vector3Node.cs +++ b/ReClass.NET/Nodes/Vector3Node.cs @@ -1,5 +1,4 @@ using System.Drawing; -using System.Runtime.InteropServices; using ReClassNET.Controls; using ReClassNET.UI; @@ -7,17 +6,6 @@ namespace ReClassNET.Nodes { public class Vector3Node : BaseMatrixNode { - [StructLayout(LayoutKind.Explicit)] - private readonly struct Vector3Data - { - [FieldOffset(0)] - public readonly float X; - [FieldOffset(4)] - public readonly float Y; - [FieldOffset(8)] - public readonly float Z; - } - public override int ValueTypeSize => sizeof(float); public override int MemorySize => 3 * ValueTypeSize; @@ -30,18 +18,7 @@ public override void GetUserInterfaceInfo(out string name, out Image icon) public override Size Draw(DrawContext context, int x2, int y2) { - return DrawVectorType(context, x2, y2, "Vector3", (ref int x, ref int y) => - { - var value = context.Memory.ReadObject(Offset); - - x = AddText(context, x, y, context.Settings.NameColor, HotSpot.NoneId, "("); - x = AddText(context, x, y, context.Settings.ValueColor, 0, $"{value.X:0.000}"); - x = AddText(context, x, y, context.Settings.NameColor, HotSpot.NoneId, ","); - x = AddText(context, x, y, context.Settings.ValueColor, 1, $"{value.Y:0.000}"); - x = AddText(context, x, y, context.Settings.NameColor, HotSpot.NoneId, ","); - x = AddText(context, x, y, context.Settings.ValueColor, 2, $"{value.Z:0.000}"); - x = AddText(context, x, y, context.Settings.NameColor, HotSpot.NoneId, ")"); - }); + return DrawVectorType(context, x2, y2, "Vector3", 3); } protected override int CalculateValuesHeight(DrawContext context) diff --git a/ReClass.NET/Nodes/Vector4Node.cs b/ReClass.NET/Nodes/Vector4Node.cs index 7321d1d3..54f1a43c 100644 --- a/ReClass.NET/Nodes/Vector4Node.cs +++ b/ReClass.NET/Nodes/Vector4Node.cs @@ -1,5 +1,4 @@ using System.Drawing; -using System.Runtime.InteropServices; using ReClassNET.Controls; using ReClassNET.UI; @@ -7,19 +6,6 @@ namespace ReClassNET.Nodes { public class Vector4Node : BaseMatrixNode { - [StructLayout(LayoutKind.Explicit)] - private readonly struct Vector4Data - { - [FieldOffset(0)] - public readonly float X; - [FieldOffset(4)] - public readonly float Y; - [FieldOffset(8)] - public readonly float Z; - [FieldOffset(12)] - public readonly float W; - } - public override int ValueTypeSize => sizeof(float); public override int MemorySize => 4 * ValueTypeSize; @@ -32,20 +18,7 @@ public override void GetUserInterfaceInfo(out string name, out Image icon) public override Size Draw(DrawContext context, int x2, int y2) { - return DrawVectorType(context, x2, y2, "Vector4", (ref int x, ref int y) => - { - var value = context.Memory.ReadObject(Offset); - - x = AddText(context, x, y, context.Settings.NameColor, HotSpot.NoneId, "("); - x = AddText(context, x, y, context.Settings.ValueColor, 0, $"{value.X:0.000}"); - x = AddText(context, x, y, context.Settings.NameColor, HotSpot.NoneId, ","); - x = AddText(context, x, y, context.Settings.ValueColor, 1, $"{value.Y:0.000}"); - x = AddText(context, x, y, context.Settings.NameColor, HotSpot.NoneId, ","); - x = AddText(context, x, y, context.Settings.ValueColor, 2, $"{value.Z:0.000}"); - x = AddText(context, x, y, context.Settings.NameColor, HotSpot.NoneId, ","); - x = AddText(context, x, y, context.Settings.ValueColor, 3, $"{value.W:0.000}"); - x = AddText(context, x, y, context.Settings.NameColor, HotSpot.NoneId, ")"); - }); + return DrawVectorType(context, x2, y2, "Vector4", 4); } protected override int CalculateValuesHeight(DrawContext context) From 64b947998021dd7fb7bd51723f15147fb4d275c4 Mon Sep 17 00:00:00 2001 From: KN4CK3R Date: Wed, 11 Nov 2020 18:19:25 +0100 Subject: [PATCH 192/223] Use switch expressions. --- .../Comparer/ByteMemoryComparer.cs | 86 +++++--------- .../Comparer/DoubleMemoryComparer.cs | 111 ++++++------------ .../Comparer/FloatMemoryComparer.cs | 111 ++++++------------ .../Comparer/IntegerMemoryComparer.cs | 86 +++++--------- .../Comparer/LongMemoryComparer.cs | 86 +++++--------- .../Comparer/ShortMemoryComparer.cs | 86 +++++--------- 6 files changed, 184 insertions(+), 382 deletions(-) diff --git a/ReClass.NET/MemoryScanner/Comparer/ByteMemoryComparer.cs b/ReClass.NET/MemoryScanner/Comparer/ByteMemoryComparer.cs index 0c376e9a..10efe5cc 100644 --- a/ReClass.NET/MemoryScanner/Comparer/ByteMemoryComparer.cs +++ b/ReClass.NET/MemoryScanner/Comparer/ByteMemoryComparer.cs @@ -23,31 +23,18 @@ public bool Compare(byte[] data, int index, out ScanResult result) return CompareInternal( data, index, - value => + value => CompareType switch { - switch (CompareType) - { - case ScanCompareType.Equal: - return value == Value1; - case ScanCompareType.NotEqual: - return value != Value1; - case ScanCompareType.GreaterThan: - return value > Value1; - case ScanCompareType.GreaterThanOrEqual: - return value >= Value1; - case ScanCompareType.LessThan: - return value < Value1; - case ScanCompareType.LessThanOrEqual: - return value <= Value1; - case ScanCompareType.Between: - return Value1 < value && value < Value2; - case ScanCompareType.BetweenOrEqual: - return Value1 <= value && value <= Value2; - case ScanCompareType.Unknown: - return true; - default: - throw new InvalidCompareTypeException(CompareType); - } + ScanCompareType.Equal => value == Value1, + ScanCompareType.NotEqual => value != Value1, + ScanCompareType.GreaterThan => value > Value1, + ScanCompareType.GreaterThanOrEqual => value >= Value1, + ScanCompareType.LessThan => value < Value1, + ScanCompareType.LessThanOrEqual => value <= Value1, + ScanCompareType.Between => Value1 < value && value < Value2, + ScanCompareType.BetweenOrEqual => Value1 <= value && value <= Value2, + ScanCompareType.Unknown => true, + _ => throw new InvalidCompareTypeException(CompareType) }, out result ); @@ -67,42 +54,23 @@ public bool Compare(byte[] data, int index, ByteScanResult previous, out ScanRes return CompareInternal( data, index, - value => + value => CompareType switch { - switch (CompareType) - { - case ScanCompareType.Equal: - return value == Value1; - case ScanCompareType.NotEqual: - return value != Value1; - case ScanCompareType.GreaterThan: - return value > Value1; - case ScanCompareType.GreaterThanOrEqual: - return value >= Value1; - case ScanCompareType.LessThan: - return value < Value1; - case ScanCompareType.LessThanOrEqual: - return value <= Value1; - case ScanCompareType.Between: - return Value1 < value && value < Value2; - case ScanCompareType.BetweenOrEqual: - return Value1 <= value && value <= Value2; - - case ScanCompareType.Changed: - return value != previous.Value; - case ScanCompareType.NotChanged: - return value == previous.Value; - case ScanCompareType.Increased: - return value > previous.Value; - case ScanCompareType.IncreasedOrEqual: - return value >= previous.Value; - case ScanCompareType.Decreased: - return value < previous.Value; - case ScanCompareType.DecreasedOrEqual: - return value <= previous.Value; - default: - throw new InvalidCompareTypeException(CompareType); - } + ScanCompareType.Equal => value == Value1, + ScanCompareType.NotEqual => value != Value1, + ScanCompareType.GreaterThan => value > Value1, + ScanCompareType.GreaterThanOrEqual => value >= Value1, + ScanCompareType.LessThan => value < Value1, + ScanCompareType.LessThanOrEqual => value <= Value1, + ScanCompareType.Between => Value1 < value && value < Value2, + ScanCompareType.BetweenOrEqual => Value1 <= value && value <= Value2, + ScanCompareType.Changed => value != previous.Value, + ScanCompareType.NotChanged => value == previous.Value, + ScanCompareType.Increased => value > previous.Value, + ScanCompareType.IncreasedOrEqual => value >= previous.Value, + ScanCompareType.Decreased => value < previous.Value, + ScanCompareType.DecreasedOrEqual => value <= previous.Value, + _ => throw new InvalidCompareTypeException(CompareType) }, out result ); diff --git a/ReClass.NET/MemoryScanner/Comparer/DoubleMemoryComparer.cs b/ReClass.NET/MemoryScanner/Comparer/DoubleMemoryComparer.cs index 1a7c7dc5..22ea04e1 100644 --- a/ReClass.NET/MemoryScanner/Comparer/DoubleMemoryComparer.cs +++ b/ReClass.NET/MemoryScanner/Comparer/DoubleMemoryComparer.cs @@ -31,20 +31,14 @@ public DoubleMemoryComparer(ScanCompareType compareType, ScanRoundMode roundType maxValue = value1 + 1.0 / factor; } - private bool CheckRoundedEquality(double value) + private bool CheckRoundedEquality(double value) => + RoundType switch { - switch (RoundType) - { - case ScanRoundMode.Strict: - return Value1.IsNearlyEqual(Math.Round(value, significantDigits, MidpointRounding.AwayFromZero), 0.0001); - case ScanRoundMode.Normal: - return minValue < value && value < maxValue; - case ScanRoundMode.Truncate: - return (long)value == (long)Value1; - default: - throw new ArgumentOutOfRangeException(); - } - } + ScanRoundMode.Strict => Value1.IsNearlyEqual(Math.Round(value, significantDigits, MidpointRounding.AwayFromZero), 0.0001), + ScanRoundMode.Normal => minValue < value && value < maxValue, + ScanRoundMode.Truncate => (long)value == (long)Value1, + _ => throw new ArgumentOutOfRangeException() + }; public bool Compare(byte[] data, int index, out ScanResult result) { @@ -52,32 +46,20 @@ public bool Compare(byte[] data, int index, out ScanResult result) var value = BitConverter.ToDouble(data, index); - bool IsMatch() + bool IsMatch() => + CompareType switch { - switch (CompareType) - { - case ScanCompareType.Equal: - return CheckRoundedEquality(value); - case ScanCompareType.NotEqual: - return !CheckRoundedEquality(value); - case ScanCompareType.GreaterThan: - return value > Value1; - case ScanCompareType.GreaterThanOrEqual: - return value >= Value1; - case ScanCompareType.LessThan: - return value < Value1; - case ScanCompareType.LessThanOrEqual: - return value <= Value1; - case ScanCompareType.Between: - return Value1 < value && value < Value2; - case ScanCompareType.BetweenOrEqual: - return Value1 <= value && value <= Value2; - case ScanCompareType.Unknown: - return true; - default: - throw new InvalidCompareTypeException(CompareType); - } - } + ScanCompareType.Equal => CheckRoundedEquality(value), + ScanCompareType.NotEqual => !CheckRoundedEquality(value), + ScanCompareType.GreaterThan => value > Value1, + ScanCompareType.GreaterThanOrEqual => value >= Value1, + ScanCompareType.LessThan => value < Value1, + ScanCompareType.LessThanOrEqual => value <= Value1, + ScanCompareType.Between => Value1 < value && value < Value2, + ScanCompareType.BetweenOrEqual => Value1 <= value && value <= Value2, + ScanCompareType.Unknown => true, + _ => throw new InvalidCompareTypeException(CompareType) + }; if (!IsMatch()) { @@ -104,42 +86,25 @@ public bool Compare(byte[] data, int index, DoubleScanResult previous, out ScanR var value = BitConverter.ToDouble(data, index); - bool IsMatch() + bool IsMatch() => + CompareType switch { - switch (CompareType) - { - case ScanCompareType.Equal: - return CheckRoundedEquality(value); - case ScanCompareType.NotEqual: - return !CheckRoundedEquality(value); - case ScanCompareType.Changed: - return value != previous.Value; - case ScanCompareType.NotChanged: - return value == previous.Value; - case ScanCompareType.GreaterThan: - return value > Value1; - case ScanCompareType.GreaterThanOrEqual: - return value >= Value1; - case ScanCompareType.Increased: - return value > previous.Value; - case ScanCompareType.IncreasedOrEqual: - return value >= previous.Value; - case ScanCompareType.LessThan: - return value < Value1; - case ScanCompareType.LessThanOrEqual: - return value <= Value1; - case ScanCompareType.Decreased: - return value < previous.Value; - case ScanCompareType.DecreasedOrEqual: - return value <= previous.Value; - case ScanCompareType.Between: - return Value1 < value && value < Value2; - case ScanCompareType.BetweenOrEqual: - return Value1 <= value && value <= Value2; - default: - throw new InvalidCompareTypeException(CompareType); - } - } + ScanCompareType.Equal => CheckRoundedEquality(value), + ScanCompareType.NotEqual => !CheckRoundedEquality(value), + ScanCompareType.Changed => value != previous.Value, + ScanCompareType.NotChanged => value == previous.Value, + ScanCompareType.GreaterThan => value > Value1, + ScanCompareType.GreaterThanOrEqual => value >= Value1, + ScanCompareType.Increased => value > previous.Value, + ScanCompareType.IncreasedOrEqual => value >= previous.Value, + ScanCompareType.LessThan => value < Value1, + ScanCompareType.LessThanOrEqual => value <= Value1, + ScanCompareType.Decreased => value < previous.Value, + ScanCompareType.DecreasedOrEqual => value <= previous.Value, + ScanCompareType.Between => Value1 < value && value < Value2, + ScanCompareType.BetweenOrEqual => Value1 <= value && value <= Value2, + _ => throw new InvalidCompareTypeException(CompareType) + }; if (!IsMatch()) { diff --git a/ReClass.NET/MemoryScanner/Comparer/FloatMemoryComparer.cs b/ReClass.NET/MemoryScanner/Comparer/FloatMemoryComparer.cs index 3e529422..abf9118d 100644 --- a/ReClass.NET/MemoryScanner/Comparer/FloatMemoryComparer.cs +++ b/ReClass.NET/MemoryScanner/Comparer/FloatMemoryComparer.cs @@ -31,20 +31,14 @@ public FloatMemoryComparer(ScanCompareType compareType, ScanRoundMode roundType, maxValue = value1 + 1.0f / factor; } - private bool CheckRoundedEquality(float value) + private bool CheckRoundedEquality(float value) => + RoundType switch { - switch (RoundType) - { - case ScanRoundMode.Strict: - return Value1.IsNearlyEqual((float)Math.Round(value, significantDigits, MidpointRounding.AwayFromZero), 0.0001f); - case ScanRoundMode.Normal: - return minValue < value && value < maxValue; - case ScanRoundMode.Truncate: - return (int)value == (int)Value1; - default: - throw new ArgumentOutOfRangeException(); - } - } + ScanRoundMode.Strict => Value1.IsNearlyEqual((float)Math.Round(value, significantDigits, MidpointRounding.AwayFromZero), 0.0001f), + ScanRoundMode.Normal => minValue < value && value < maxValue, + ScanRoundMode.Truncate => (int)value == (int)Value1, + _ => throw new ArgumentOutOfRangeException() + }; public bool Compare(byte[] data, int index, out ScanResult result) { @@ -52,32 +46,20 @@ public bool Compare(byte[] data, int index, out ScanResult result) var value = BitConverter.ToSingle(data, index); - bool IsMatch() + bool IsMatch() => + CompareType switch { - switch (CompareType) - { - case ScanCompareType.Equal: - return CheckRoundedEquality(value); - case ScanCompareType.NotEqual: - return !CheckRoundedEquality(value); - case ScanCompareType.GreaterThan: - return value > Value1; - case ScanCompareType.GreaterThanOrEqual: - return value >= Value1; - case ScanCompareType.LessThan: - return value < Value1; - case ScanCompareType.LessThanOrEqual: - return value <= Value1; - case ScanCompareType.Between: - return Value1 < value && value < Value2; - case ScanCompareType.BetweenOrEqual: - return Value1 <= value && value <= Value2; - case ScanCompareType.Unknown: - return true; - default: - throw new InvalidCompareTypeException(CompareType); - } - } + ScanCompareType.Equal => CheckRoundedEquality(value), + ScanCompareType.NotEqual => !CheckRoundedEquality(value), + ScanCompareType.GreaterThan => value > Value1, + ScanCompareType.GreaterThanOrEqual => value >= Value1, + ScanCompareType.LessThan => value < Value1, + ScanCompareType.LessThanOrEqual => value <= Value1, + ScanCompareType.Between => Value1 < value && value < Value2, + ScanCompareType.BetweenOrEqual => Value1 <= value && value <= Value2, + ScanCompareType.Unknown => true, + _ => throw new InvalidCompareTypeException(CompareType) + }; if (!IsMatch()) { @@ -104,42 +86,25 @@ public bool Compare(byte[] data, int index, FloatScanResult previous, out ScanRe var value = BitConverter.ToSingle(data, index); - bool IsMatch() + bool IsMatch() => + CompareType switch { - switch (CompareType) - { - case ScanCompareType.Equal: - return CheckRoundedEquality(value); - case ScanCompareType.NotEqual: - return !CheckRoundedEquality(value); - case ScanCompareType.Changed: - return value != previous.Value; - case ScanCompareType.NotChanged: - return value == previous.Value; - case ScanCompareType.GreaterThan: - return value > Value1; - case ScanCompareType.GreaterThanOrEqual: - return value >= Value1; - case ScanCompareType.Increased: - return value > previous.Value; - case ScanCompareType.IncreasedOrEqual: - return value >= previous.Value; - case ScanCompareType.LessThan: - return value < Value1; - case ScanCompareType.LessThanOrEqual: - return value <= Value1; - case ScanCompareType.Decreased: - return value < previous.Value; - case ScanCompareType.DecreasedOrEqual: - return value <= previous.Value; - case ScanCompareType.Between: - return Value1 < value && value < Value2; - case ScanCompareType.BetweenOrEqual: - return Value1 <= value && value <= Value2; - default: - throw new InvalidCompareTypeException(CompareType); - } - } + ScanCompareType.Equal => CheckRoundedEquality(value), + ScanCompareType.NotEqual => !CheckRoundedEquality(value), + ScanCompareType.Changed => value != previous.Value, + ScanCompareType.NotChanged => value == previous.Value, + ScanCompareType.GreaterThan => value > Value1, + ScanCompareType.GreaterThanOrEqual => value >= Value1, + ScanCompareType.Increased => value > previous.Value, + ScanCompareType.IncreasedOrEqual => value >= previous.Value, + ScanCompareType.LessThan => value < Value1, + ScanCompareType.LessThanOrEqual => value <= Value1, + ScanCompareType.Decreased => value < previous.Value, + ScanCompareType.DecreasedOrEqual => value <= previous.Value, + ScanCompareType.Between => Value1 < value && value < Value2, + ScanCompareType.BetweenOrEqual => Value1 <= value && value <= Value2, + _ => throw new InvalidCompareTypeException(CompareType) + }; if (!IsMatch()) { diff --git a/ReClass.NET/MemoryScanner/Comparer/IntegerMemoryComparer.cs b/ReClass.NET/MemoryScanner/Comparer/IntegerMemoryComparer.cs index a55e074e..1935accf 100644 --- a/ReClass.NET/MemoryScanner/Comparer/IntegerMemoryComparer.cs +++ b/ReClass.NET/MemoryScanner/Comparer/IntegerMemoryComparer.cs @@ -23,31 +23,18 @@ public bool Compare(byte[] data, int index, out ScanResult result) return CompareInternal( data, index, - value => + value => CompareType switch { - switch (CompareType) - { - case ScanCompareType.Equal: - return value == Value1; - case ScanCompareType.NotEqual: - return value != Value1; - case ScanCompareType.GreaterThan: - return value > Value1; - case ScanCompareType.GreaterThanOrEqual: - return value >= Value1; - case ScanCompareType.LessThan: - return value < Value1; - case ScanCompareType.LessThanOrEqual: - return value <= Value1; - case ScanCompareType.Between: - return Value1 < value && value < Value2; - case ScanCompareType.BetweenOrEqual: - return Value1 <= value && value <= Value2; - case ScanCompareType.Unknown: - return true; - default: - throw new InvalidCompareTypeException(CompareType); - } + ScanCompareType.Equal => value == Value1, + ScanCompareType.NotEqual => value != Value1, + ScanCompareType.GreaterThan => value > Value1, + ScanCompareType.GreaterThanOrEqual => value >= Value1, + ScanCompareType.LessThan => value < Value1, + ScanCompareType.LessThanOrEqual => value <= Value1, + ScanCompareType.Between => Value1 < value && value < Value2, + ScanCompareType.BetweenOrEqual => Value1 <= value && value <= Value2, + ScanCompareType.Unknown => true, + _ => throw new InvalidCompareTypeException(CompareType) }, out result ); @@ -67,42 +54,23 @@ public bool Compare(byte[] data, int index, IntegerScanResult previous, out Scan return CompareInternal( data, index, - value => + value => CompareType switch { - switch (CompareType) - { - case ScanCompareType.Equal: - return value == Value1; - case ScanCompareType.NotEqual: - return value != Value1; - case ScanCompareType.GreaterThan: - return value > Value1; - case ScanCompareType.GreaterThanOrEqual: - return value >= Value1; - case ScanCompareType.LessThan: - return value < Value1; - case ScanCompareType.LessThanOrEqual: - return value <= Value1; - case ScanCompareType.Between: - return Value1 < value && value < Value2; - case ScanCompareType.BetweenOrEqual: - return Value1 <= value && value <= Value2; - - case ScanCompareType.Changed: - return value != previous.Value; - case ScanCompareType.NotChanged: - return value == previous.Value; - case ScanCompareType.Increased: - return value > previous.Value; - case ScanCompareType.IncreasedOrEqual: - return value >= previous.Value; - case ScanCompareType.Decreased: - return value < previous.Value; - case ScanCompareType.DecreasedOrEqual: - return value <= previous.Value; - default: - throw new InvalidCompareTypeException(CompareType); - } + ScanCompareType.Equal => value == Value1, + ScanCompareType.NotEqual => value != Value1, + ScanCompareType.GreaterThan => value > Value1, + ScanCompareType.GreaterThanOrEqual => value >= Value1, + ScanCompareType.LessThan => value < Value1, + ScanCompareType.LessThanOrEqual => value <= Value1, + ScanCompareType.Between => Value1 < value && value < Value2, + ScanCompareType.BetweenOrEqual => Value1 <= value && value <= Value2, + ScanCompareType.Changed => value != previous.Value, + ScanCompareType.NotChanged => value == previous.Value, + ScanCompareType.Increased => value > previous.Value, + ScanCompareType.IncreasedOrEqual => value >= previous.Value, + ScanCompareType.Decreased => value < previous.Value, + ScanCompareType.DecreasedOrEqual => value <= previous.Value, + _ => throw new InvalidCompareTypeException(CompareType) }, out result ); diff --git a/ReClass.NET/MemoryScanner/Comparer/LongMemoryComparer.cs b/ReClass.NET/MemoryScanner/Comparer/LongMemoryComparer.cs index 75c15945..3b1172cf 100644 --- a/ReClass.NET/MemoryScanner/Comparer/LongMemoryComparer.cs +++ b/ReClass.NET/MemoryScanner/Comparer/LongMemoryComparer.cs @@ -23,31 +23,18 @@ public bool Compare(byte[] data, int index, out ScanResult result) return CompareInternal( data, index, - value => + value => CompareType switch { - switch (CompareType) - { - case ScanCompareType.Equal: - return value == Value1; - case ScanCompareType.NotEqual: - return value != Value1; - case ScanCompareType.GreaterThan: - return value > Value1; - case ScanCompareType.GreaterThanOrEqual: - return value >= Value1; - case ScanCompareType.LessThan: - return value < Value1; - case ScanCompareType.LessThanOrEqual: - return value <= Value1; - case ScanCompareType.Between: - return Value1 < value && value < Value2; - case ScanCompareType.BetweenOrEqual: - return Value1 <= value && value <= Value2; - case ScanCompareType.Unknown: - return true; - default: - throw new InvalidCompareTypeException(CompareType); - } + ScanCompareType.Equal => value == Value1, + ScanCompareType.NotEqual => value != Value1, + ScanCompareType.GreaterThan => value > Value1, + ScanCompareType.GreaterThanOrEqual => value >= Value1, + ScanCompareType.LessThan => value < Value1, + ScanCompareType.LessThanOrEqual => value <= Value1, + ScanCompareType.Between => Value1 < value && value < Value2, + ScanCompareType.BetweenOrEqual => Value1 <= value && value <= Value2, + ScanCompareType.Unknown => true, + _ => throw new InvalidCompareTypeException(CompareType) }, out result ); @@ -67,42 +54,23 @@ public bool Compare(byte[] data, int index, LongScanResult previous, out ScanRes return CompareInternal( data, index, - value => + value => CompareType switch { - switch (CompareType) - { - case ScanCompareType.Equal: - return value == Value1; - case ScanCompareType.NotEqual: - return value != Value1; - case ScanCompareType.GreaterThan: - return value > Value1; - case ScanCompareType.GreaterThanOrEqual: - return value >= Value1; - case ScanCompareType.LessThan: - return value < Value1; - case ScanCompareType.LessThanOrEqual: - return value <= Value1; - case ScanCompareType.Between: - return Value1 < value && value < Value2; - case ScanCompareType.BetweenOrEqual: - return Value1 <= value && value <= Value2; - - case ScanCompareType.Changed: - return value != previous.Value; - case ScanCompareType.NotChanged: - return value == previous.Value; - case ScanCompareType.Increased: - return value > previous.Value; - case ScanCompareType.IncreasedOrEqual: - return value >= previous.Value; - case ScanCompareType.Decreased: - return value < previous.Value; - case ScanCompareType.DecreasedOrEqual: - return value <= previous.Value; - default: - throw new InvalidCompareTypeException(CompareType); - } + ScanCompareType.Equal => value == Value1, + ScanCompareType.NotEqual => value != Value1, + ScanCompareType.GreaterThan => value > Value1, + ScanCompareType.GreaterThanOrEqual => value >= Value1, + ScanCompareType.LessThan => value < Value1, + ScanCompareType.LessThanOrEqual => value <= Value1, + ScanCompareType.Between => Value1 < value && value < Value2, + ScanCompareType.BetweenOrEqual => Value1 <= value && value <= Value2, + ScanCompareType.Changed => value != previous.Value, + ScanCompareType.NotChanged => value == previous.Value, + ScanCompareType.Increased => value > previous.Value, + ScanCompareType.IncreasedOrEqual => value >= previous.Value, + ScanCompareType.Decreased => value < previous.Value, + ScanCompareType.DecreasedOrEqual => value <= previous.Value, + _ => throw new InvalidCompareTypeException(CompareType) }, out result ); diff --git a/ReClass.NET/MemoryScanner/Comparer/ShortMemoryComparer.cs b/ReClass.NET/MemoryScanner/Comparer/ShortMemoryComparer.cs index 1754ff23..5cdfbad0 100644 --- a/ReClass.NET/MemoryScanner/Comparer/ShortMemoryComparer.cs +++ b/ReClass.NET/MemoryScanner/Comparer/ShortMemoryComparer.cs @@ -23,31 +23,18 @@ public bool Compare(byte[] data, int index, out ScanResult result) return CompareInternal( data, index, - value => + value => CompareType switch { - switch (CompareType) - { - case ScanCompareType.Equal: - return value == Value1; - case ScanCompareType.NotEqual: - return value != Value1; - case ScanCompareType.GreaterThan: - return value > Value1; - case ScanCompareType.GreaterThanOrEqual: - return value >= Value1; - case ScanCompareType.LessThan: - return value < Value1; - case ScanCompareType.LessThanOrEqual: - return value <= Value1; - case ScanCompareType.Between: - return Value1 < value && value < Value2; - case ScanCompareType.BetweenOrEqual: - return Value1 <= value && value <= Value2; - case ScanCompareType.Unknown: - return true; - default: - throw new InvalidCompareTypeException(CompareType); - } + ScanCompareType.Equal => value == Value1, + ScanCompareType.NotEqual => value != Value1, + ScanCompareType.GreaterThan => value > Value1, + ScanCompareType.GreaterThanOrEqual => value >= Value1, + ScanCompareType.LessThan => value < Value1, + ScanCompareType.LessThanOrEqual => value <= Value1, + ScanCompareType.Between => Value1 < value && value < Value2, + ScanCompareType.BetweenOrEqual => Value1 <= value && value <= Value2, + ScanCompareType.Unknown => true, + _ => throw new InvalidCompareTypeException(CompareType) }, out result ); @@ -67,42 +54,23 @@ public bool Compare(byte[] data, int index, ShortScanResult previous, out ScanRe return CompareInternal( data, index, - value => + value => CompareType switch { - switch (CompareType) - { - case ScanCompareType.Equal: - return value == Value1; - case ScanCompareType.NotEqual: - return value != Value1; - case ScanCompareType.GreaterThan: - return value > Value1; - case ScanCompareType.GreaterThanOrEqual: - return value >= Value1; - case ScanCompareType.LessThan: - return value < Value1; - case ScanCompareType.LessThanOrEqual: - return value <= Value1; - case ScanCompareType.Between: - return Value1 < value && value < Value2; - case ScanCompareType.BetweenOrEqual: - return Value1 <= value && value <= Value2; - - case ScanCompareType.Changed: - return value != previous.Value; - case ScanCompareType.NotChanged: - return value == previous.Value; - case ScanCompareType.Increased: - return value > previous.Value; - case ScanCompareType.IncreasedOrEqual: - return value >= previous.Value; - case ScanCompareType.Decreased: - return value < previous.Value; - case ScanCompareType.DecreasedOrEqual: - return value <= previous.Value; - default: - throw new InvalidCompareTypeException(CompareType); - } + ScanCompareType.Equal => value == Value1, + ScanCompareType.NotEqual => value != Value1, + ScanCompareType.GreaterThan => value > Value1, + ScanCompareType.GreaterThanOrEqual => value >= Value1, + ScanCompareType.LessThan => value < Value1, + ScanCompareType.LessThanOrEqual => value <= Value1, + ScanCompareType.Between => Value1 < value && value < Value2, + ScanCompareType.BetweenOrEqual => Value1 <= value && value <= Value2, + ScanCompareType.Changed => value != previous.Value, + ScanCompareType.NotChanged => value == previous.Value, + ScanCompareType.Increased => value > previous.Value, + ScanCompareType.IncreasedOrEqual => value >= previous.Value, + ScanCompareType.Decreased => value < previous.Value, + ScanCompareType.DecreasedOrEqual => value <= previous.Value, + _ => throw new InvalidCompareTypeException(CompareType) }, out result ); From e611be53e59f9cdab5b0f0439c2cb774bdeef18f Mon Sep 17 00:00:00 2001 From: KN4CK3R Date: Wed, 11 Nov 2020 18:27:21 +0100 Subject: [PATCH 193/223] Match other comparer logic. --- .../Comparer/DoubleMemoryComparer.cs | 46 +++++++++---------- .../Comparer/FloatMemoryComparer.cs | 46 +++++++++---------- 2 files changed, 44 insertions(+), 48 deletions(-) diff --git a/ReClass.NET/MemoryScanner/Comparer/DoubleMemoryComparer.cs b/ReClass.NET/MemoryScanner/Comparer/DoubleMemoryComparer.cs index 22ea04e1..b8428041 100644 --- a/ReClass.NET/MemoryScanner/Comparer/DoubleMemoryComparer.cs +++ b/ReClass.NET/MemoryScanner/Comparer/DoubleMemoryComparer.cs @@ -42,12 +42,10 @@ private bool CheckRoundedEquality(double value) => public bool Compare(byte[] data, int index, out ScanResult result) { - result = null; - - var value = BitConverter.ToDouble(data, index); - - bool IsMatch() => - CompareType switch + return CompareInternal( + data, + index, + value => CompareType switch { ScanCompareType.Equal => CheckRoundedEquality(value), ScanCompareType.NotEqual => !CheckRoundedEquality(value), @@ -59,18 +57,11 @@ bool IsMatch() => ScanCompareType.BetweenOrEqual => Value1 <= value && value <= Value2, ScanCompareType.Unknown => true, _ => throw new InvalidCompareTypeException(CompareType) - }; - - if (!IsMatch()) - { - return false; + }, + out result + ); } - result = new DoubleScanResult(value); - - return true; - } - public bool Compare(byte[] data, int index, ScanResult previous, out ScanResult result) { #if DEBUG @@ -82,12 +73,10 @@ public bool Compare(byte[] data, int index, ScanResult previous, out ScanResult public bool Compare(byte[] data, int index, DoubleScanResult previous, out ScanResult result) { - result = null; - - var value = BitConverter.ToDouble(data, index); - - bool IsMatch() => - CompareType switch + return CompareInternal( + data, + index, + value => CompareType switch { ScanCompareType.Equal => CheckRoundedEquality(value), ScanCompareType.NotEqual => !CheckRoundedEquality(value), @@ -104,9 +93,18 @@ bool IsMatch() => ScanCompareType.Between => Value1 < value && value < Value2, ScanCompareType.BetweenOrEqual => Value1 <= value && value <= Value2, _ => throw new InvalidCompareTypeException(CompareType) - }; + }, + out result + ); + } + + private static bool CompareInternal(byte[] data, int index, Func matcher, out ScanResult result) + { + result = null; + + var value = BitConverter.ToDouble(data, index); - if (!IsMatch()) + if (!matcher(value)) { return false; } diff --git a/ReClass.NET/MemoryScanner/Comparer/FloatMemoryComparer.cs b/ReClass.NET/MemoryScanner/Comparer/FloatMemoryComparer.cs index abf9118d..27c8dd13 100644 --- a/ReClass.NET/MemoryScanner/Comparer/FloatMemoryComparer.cs +++ b/ReClass.NET/MemoryScanner/Comparer/FloatMemoryComparer.cs @@ -42,12 +42,10 @@ private bool CheckRoundedEquality(float value) => public bool Compare(byte[] data, int index, out ScanResult result) { - result = null; - - var value = BitConverter.ToSingle(data, index); - - bool IsMatch() => - CompareType switch + return CompareInternal( + data, + index, + value => CompareType switch { ScanCompareType.Equal => CheckRoundedEquality(value), ScanCompareType.NotEqual => !CheckRoundedEquality(value), @@ -59,18 +57,11 @@ bool IsMatch() => ScanCompareType.BetweenOrEqual => Value1 <= value && value <= Value2, ScanCompareType.Unknown => true, _ => throw new InvalidCompareTypeException(CompareType) - }; - - if (!IsMatch()) - { - return false; + }, + out result + ); } - result = new FloatScanResult(value); - - return true; - } - public bool Compare(byte[] data, int index, ScanResult previous, out ScanResult result) { #if DEBUG @@ -82,12 +73,10 @@ public bool Compare(byte[] data, int index, ScanResult previous, out ScanResult public bool Compare(byte[] data, int index, FloatScanResult previous, out ScanResult result) { - result = null; - - var value = BitConverter.ToSingle(data, index); - - bool IsMatch() => - CompareType switch + return CompareInternal( + data, + index, + value => CompareType switch { ScanCompareType.Equal => CheckRoundedEquality(value), ScanCompareType.NotEqual => !CheckRoundedEquality(value), @@ -104,9 +93,18 @@ bool IsMatch() => ScanCompareType.Between => Value1 < value && value < Value2, ScanCompareType.BetweenOrEqual => Value1 <= value && value <= Value2, _ => throw new InvalidCompareTypeException(CompareType) - }; + }, + out result + ); + } + + private static bool CompareInternal(byte[] data, int index, Func matcher, out ScanResult result) + { + result = null; + + var value = BitConverter.ToSingle(data, index); - if (!IsMatch()) + if (!matcher(value)) { return false; } From 82b9db37f3e6f27c7dcea63a791874a2bcf8a041 Mon Sep 17 00:00:00 2001 From: KN4CK3R Date: Wed, 11 Nov 2020 20:06:23 +0100 Subject: [PATCH 194/223] Fixed padding to next node. --- ReClass.NET/Nodes/BitFieldNode.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ReClass.NET/Nodes/BitFieldNode.cs b/ReClass.NET/Nodes/BitFieldNode.cs index 7255e0e3..8f302fda 100644 --- a/ReClass.NET/Nodes/BitFieldNode.cs +++ b/ReClass.NET/Nodes/BitFieldNode.cs @@ -171,7 +171,7 @@ public override Size Draw(DrawContext context, int x, int y) } } - y += 2; + y += 8; } return new Size(x - origX, y - origY + context.Font.Height); @@ -187,7 +187,7 @@ public override int CalculateDrawnHeight(DrawContext context) var height = context.Font.Height; if (LevelsOpen[context.Level]) { - height += context.Font.Height + 2; + height += context.Font.Height + 8; } return height; } From 6547cc1b3572f66cc0dbfaeb77d26dda091c3428 Mon Sep 17 00:00:00 2001 From: KN4CK3R Date: Wed, 11 Nov 2020 20:30:08 +0100 Subject: [PATCH 195/223] Replaced NodeUuid with Guid. --- .../ReClass/ReClassNetFile.Read.cs | 14 +- .../ReClass/ReClassNetFile.Write.cs | 11 +- ReClass.NET/Nodes/ClassNode.cs | 14 +- ReClass.NET/Nodes/NodeUuid.cs | 206 ------------------ ReClass.NET/Project/ReClassNetProject.cs | 6 +- ReClass.NET/ReClass.NET.csproj | 3 +- 6 files changed, 22 insertions(+), 232 deletions(-) delete mode 100644 ReClass.NET/Nodes/NodeUuid.cs diff --git a/ReClass.NET/DataExchange/ReClass/ReClassNetFile.Read.cs b/ReClass.NET/DataExchange/ReClass/ReClassNetFile.Read.cs index 228e5178..4a3cb65d 100644 --- a/ReClass.NET/DataExchange/ReClass/ReClassNetFile.Read.cs +++ b/ReClass.NET/DataExchange/ReClass/ReClassNetFile.Read.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Diagnostics.Contracts; using System.IO; @@ -104,7 +104,7 @@ public void Load(Stream input, ILogger logger) { var node = new ClassNode(false) { - Uuid = NodeUuid.FromBase64String(element.Attribute(XmlUuidAttribute)?.Value, true), + Uuid = ParseUuid(element.Attribute(XmlUuidAttribute)?.Value), Name = element.Attribute(XmlNameAttribute)?.Value ?? string.Empty, Comment = element.Attribute(XmlCommentAttribute)?.Value ?? string.Empty, AddressFormula = element.Attribute(XmlAddressAttribute)?.Value ?? string.Empty @@ -173,7 +173,7 @@ BaseNode CreateNode() { ClassNode GetClassNodeFromElementReference() { - var reference = NodeUuid.FromBase64String(element.Attribute(XmlReferenceAttribute)?.Value, false); + var reference = ParseUuid(element.Attribute(XmlReferenceAttribute)?.Value); if (!project.ContainsClass(reference)) { logger.Log(LogLevel.Error, $"Skipping node with unknown reference: {reference}"); @@ -286,7 +286,7 @@ ClassNode GetClassNodeFromElementReference() { functionNode.Signature = element.Attribute(XmlSignatureAttribute)?.Value ?? string.Empty; - var reference = NodeUuid.FromBase64String(element.Attribute(XmlReferenceAttribute)?.Value, false); + var reference = ParseUuid(element.Attribute(XmlReferenceAttribute)?.Value); if (project.ContainsClass(reference)) { functionNode.BelongsToClass = project.GetClassByUuid(reference); @@ -306,6 +306,12 @@ ClassNode GetClassNodeFromElementReference() return node; } + private static Guid ParseUuid(string raw) => raw == null + ? throw new ArgumentNullException() + : raw.Length == 24 + ? new Guid(Convert.FromBase64String(raw)) + : Guid.Parse(raw); + public static Tuple, List> DeserializeNodesFromStream(Stream input, ReClassNetProject templateProject, ILogger logger) { Contract.Requires(input != null); diff --git a/ReClass.NET/DataExchange/ReClass/ReClassNetFile.Write.cs b/ReClass.NET/DataExchange/ReClass/ReClassNetFile.Write.cs index 65f9040b..1d33ebc5 100644 --- a/ReClass.NET/DataExchange/ReClass/ReClassNetFile.Write.cs +++ b/ReClass.NET/DataExchange/ReClass/ReClassNetFile.Write.cs @@ -1,4 +1,5 @@ -using System.Collections.Generic; +using System; +using System.Collections.Generic; using System.Diagnostics.Contracts; using System.IO; using System.IO.Compression; @@ -67,7 +68,7 @@ private static IEnumerable CreateClassElements(IEnumerable return classes.Select(c => new XElement( XmlClassElement, - new XAttribute(XmlUuidAttribute, c.Uuid.ToBase64String()), + new XAttribute(XmlUuidAttribute, c.Uuid), new XAttribute(XmlNameAttribute, c.Name ?? string.Empty), new XAttribute(XmlCommentAttribute, c.Comment ?? string.Empty), new XAttribute(XmlAddressAttribute, c.AddressFormula ?? string.Empty), @@ -118,7 +119,7 @@ XElement CreateElement() { if (node is BaseClassWrapperNode classWrapperNode) { - element.SetAttributeValue(XmlReferenceAttribute, ((ClassNode)classWrapperNode.InnerNode).Uuid.ToBase64String()); + element.SetAttributeValue(XmlReferenceAttribute, ((ClassNode)classWrapperNode.InnerNode).Uuid); } else if (wrapperNode.InnerNode != null) { @@ -160,8 +161,8 @@ XElement CreateElement() } case FunctionNode functionNode: { - var uuid = functionNode.BelongsToClass == null ? NodeUuid.Zero : functionNode.BelongsToClass.Uuid; - element.SetAttributeValue(XmlReferenceAttribute, uuid.ToBase64String()); + var uuid = functionNode.BelongsToClass?.Uuid ?? Guid.Empty; + element.SetAttributeValue(XmlReferenceAttribute, uuid); element.SetAttributeValue(XmlSignatureAttribute, functionNode.Signature); break; } diff --git a/ReClass.NET/Nodes/ClassNode.cs b/ReClass.NET/Nodes/ClassNode.cs index 2125e8e9..9b144061 100644 --- a/ReClass.NET/Nodes/ClassNode.cs +++ b/ReClass.NET/Nodes/ClassNode.cs @@ -25,17 +25,7 @@ public class ClassNode : BaseContainerNode protected override bool ShouldCompensateSizeChanges => true; - private NodeUuid uuid; - public NodeUuid Uuid - { - get => uuid; - set - { - Contract.Requires(value != null); - - uuid = value; - } - } + public Guid Uuid { get; set; } public string AddressFormula { get; set; } = DefaultAddressFormula; @@ -47,7 +37,7 @@ internal ClassNode(bool notifyClassCreated) LevelsOpen.DefaultValue = true; - Uuid = new NodeUuid(true); + Uuid = Guid.NewGuid(); if (notifyClassCreated) { diff --git a/ReClass.NET/Nodes/NodeUuid.cs b/ReClass.NET/Nodes/NodeUuid.cs deleted file mode 100644 index 3eddf506..00000000 --- a/ReClass.NET/Nodes/NodeUuid.cs +++ /dev/null @@ -1,206 +0,0 @@ -using System; -using System.Diagnostics.Contracts; - -namespace ReClassNET.Nodes -{ - public sealed class NodeUuid : IComparable, IEquatable - { - /// Size in bytes of a UUID. - public const int UuidSize = 16; - - /// Zero UUID (all bytes are zero). - public static readonly NodeUuid Zero = new NodeUuid(false); - - /// The maximum reserved UUID value. - private static readonly NodeUuid maxReserved = new NodeUuid(new byte[] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0xFF, 0xFF }); - - /// Checks if the given UUID is reserved. - /// The uuid. - /// True if reserved, false if not. - public static bool IsReserved(NodeUuid uuid) - { - Contract.Requires(uuid != null); - - return uuid.CompareTo(maxReserved) <= 0; - } - - private byte[] uuidBytes; - private readonly int uuidHash; - - /// Get the 16 UUID bytes. - public byte[] UuidBytes => uuidBytes; - - /// Construct a new UUID object. - /// If this parameter is true, a new UUID is generated. - /// If it is false, the UUID is initialized to zero. - public NodeUuid(bool createNew) - { - Contract.Ensures(uuidBytes != null); - - if (createNew) - { - CreateNew(); - } - else - { - SetZero(); - } - - uuidHash = CalculateHash(); - } - - /// Construct a new UUID object. - /// Initial value of the object. - private NodeUuid(byte[] valueBytes) - { - Contract.Requires(valueBytes != null); - Contract.Requires(valueBytes.Length == UuidSize); - Contract.Ensures(uuidBytes != null); - - SetValue(valueBytes); - - uuidHash = CalculateHash(); - } - - public static NodeUuid FromBase64String(string base64, bool createNew) - { - try - { - if (base64 != null) - { - var bytes = Convert.FromBase64String(base64); - - if (bytes.Length == UuidSize) - { - return new NodeUuid(bytes); - } - } - } - catch (ArgumentNullException) - { - - } - - return new NodeUuid(createNew); - } - - /// Create a new, random UUID. - /// Returns true if a random UUID has been generated, otherwise it returns false. - private void CreateNew() - { - Contract.Ensures(uuidBytes != null); - - while (true) - { - uuidBytes = Guid.NewGuid().ToByteArray(); - - if (uuidBytes == null || uuidBytes.Length != UuidSize) - { - throw new InvalidOperationException(); - } - - // Do not generate reserved UUIDs. - if (!IsReserved(this)) - { - break; - } - } - } - - /// Sets the UUID to the given value. - /// Initial value of the object. - private void SetValue(byte[] valueBytes) - { - Contract.Requires(valueBytes != null); - Contract.Requires(valueBytes.Length == UuidSize); - Contract.Ensures(uuidBytes != null); - - uuidBytes = new byte[UuidSize]; - - Array.Copy(valueBytes, uuidBytes, UuidSize); - } - - /// Sets the UUID to zero. - private void SetZero() - { - Contract.Ensures(uuidBytes != null); - - uuidBytes = new byte[UuidSize]; - } - - public override bool Equals(object obj) - { - return Equals(obj as NodeUuid); - } - - public bool Equals(NodeUuid other) - { - if (other == null) - { - return false; - } - - for (var i = 0; i < UuidSize; ++i) - { - if (uuidBytes[i] != other.uuidBytes[i]) - { - return false; - } - } - - return true; - } - - private int CalculateHash() - { - var hash = 17; - unchecked - { - foreach (var b in uuidBytes) - { - hash = hash * 31 + b.GetHashCode(); - } - } - return hash; - } - - public override int GetHashCode() - { - return uuidHash; - } - - public int CompareTo(NodeUuid other) - { - for (var i = 0; i < UuidSize; ++i) - { - if (uuidBytes[i] < other.uuidBytes[i]) - { - return -1; - } - if (uuidBytes[i] > other.uuidBytes[i]) - { - return 1; - } - } - - return 0; - } - - public string ToBase64String() - { - return Convert.ToBase64String(uuidBytes); - } - - /// Convert the UUID to its string representation. - /// String containing the UUID value. - public string ToHexString() - { - return BitConverter.ToString(uuidBytes).Replace("-", string.Empty); - } - - public override string ToString() - { - return ToHexString(); - } - } -} diff --git a/ReClass.NET/Project/ReClassNetProject.cs b/ReClass.NET/Project/ReClassNetProject.cs index c91a3286..90f4b5ca 100644 --- a/ReClass.NET/Project/ReClassNetProject.cs +++ b/ReClass.NET/Project/ReClassNetProject.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Diagnostics.Contracts; using System.Linq; @@ -59,14 +59,14 @@ public void AddClass(ClassNode node) ClassAdded?.Invoke(node); } - public bool ContainsClass(NodeUuid uuid) + public bool ContainsClass(Guid uuid) { Contract.Requires(uuid != null); return classes.Any(c => c.Uuid.Equals(uuid)); } - public ClassNode GetClassByUuid(NodeUuid uuid) + public ClassNode GetClassByUuid(Guid uuid) { Contract.Requires(uuid != null); diff --git a/ReClass.NET/ReClass.NET.csproj b/ReClass.NET/ReClass.NET.csproj index 77ac1145..9eb45804 100644 --- a/ReClass.NET/ReClass.NET.csproj +++ b/ReClass.NET/ReClass.NET.csproj @@ -1,4 +1,4 @@ - + @@ -290,7 +290,6 @@ - From 7f890e16726039e8ada1fc289cd0244068769174 Mon Sep 17 00:00:00 2001 From: KN4CK3R Date: Sun, 22 Nov 2020 20:02:15 +0100 Subject: [PATCH 196/223] Removed unused constructor. Prevent negative size. --- ReClass.NET/Memory/MemoryBuffer.cs | 14 +++----------- ReClass.NET_Tests/Memory/MemoryBufferTest.cs | 7 +++++-- 2 files changed, 8 insertions(+), 13 deletions(-) diff --git a/ReClass.NET/Memory/MemoryBuffer.cs b/ReClass.NET/Memory/MemoryBuffer.cs index 52f874b5..c6e847fe 100644 --- a/ReClass.NET/Memory/MemoryBuffer.cs +++ b/ReClass.NET/Memory/MemoryBuffer.cs @@ -20,7 +20,7 @@ public int Size get => data.Length; set { - if (value != data.Length) + if (value >= 0 && value != data.Length) { data = new byte[value]; historyData = new byte[value]; @@ -44,20 +44,12 @@ private void ObjectInvariants() } public MemoryBuffer() - : this(0) { Contract.Ensures(data != null); Contract.Ensures(historyData != null); - } - - public MemoryBuffer(int size) - { - Contract.Requires(size >= 0); - Contract.Ensures(data != null); - Contract.Ensures(historyData != null); - data = new byte[size]; - historyData = new byte[size]; + data = Array.Empty(); + historyData = Array.Empty(); } public MemoryBuffer(MemoryBuffer other) diff --git a/ReClass.NET_Tests/Memory/MemoryBufferTest.cs b/ReClass.NET_Tests/Memory/MemoryBufferTest.cs index 7e545f56..d9fb45a1 100644 --- a/ReClass.NET_Tests/Memory/MemoryBufferTest.cs +++ b/ReClass.NET_Tests/Memory/MemoryBufferTest.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Text; using NFluent; using ReClassNET.Memory; @@ -10,7 +10,10 @@ public class MemoryBufferTest { private static MemoryBuffer CreateFromBytes(params byte[] data) { - var buffer = new MemoryBuffer(data.Length); + var buffer = new MemoryBuffer + { + Size = data.Length + }; Array.Copy(data, buffer.RawData, data.Length); return buffer; } From 8f6bd4146a8e6ee843ed66209d26dae98b6a17cb Mon Sep 17 00:00:00 2001 From: KN4CK3R Date: Sun, 22 Nov 2020 20:16:10 +0100 Subject: [PATCH 197/223] Removed unused constant. --- ReClass.NET/ReClass.NET.csproj | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ReClass.NET/ReClass.NET.csproj b/ReClass.NET/ReClass.NET.csproj index 9eb45804..76b54d3b 100644 --- a/ReClass.NET/ReClass.NET.csproj +++ b/ReClass.NET/ReClass.NET.csproj @@ -25,7 +25,7 @@ false $(SolutionDir)bin\Debug\x86\ $(SolutionDir)obj\$(Configuration)\x86\$(MSBuildProjectName)\ - TRACE;DEBUG;RECLASSNET32 + TRACE;DEBUG prompt 4 false @@ -79,7 +79,7 @@ true $(SolutionDir)bin\Release\x86\ $(SolutionDir)obj\$(Configuration)\x86\$(MSBuildProjectName)\ - TRACE;RECLASSNET32;RELEASE + TRACE;RELEASE prompt 4 From c0f7e53728dc3e794df2ef9d7b57882ed947b086 Mon Sep 17 00:00:00 2001 From: KN4CK3R Date: Sun, 22 Nov 2020 21:34:38 +0100 Subject: [PATCH 198/223] Added BigEndianBitConverter and LittleEndianBitConverter. --- ReClass.NET/ReClass.NET.csproj | 3 + .../Util/Conversion/BigEndianBitConverter.cs | 39 ++++++ .../Util/Conversion/EndianBitConverter.cs | 83 +++++++++++++ .../Conversion/LittleEndianBitConverter.cs | 39 ++++++ ReClass.NET_Tests/ReClass.NET_Tests.csproj | 3 + .../Conversion/BigEndianBitConverterTest.cs | 114 ++++++++++++++++++ .../Util/Conversion/EndianBitConverterTest.cs | 25 ++++ .../LittleEndianBitConverterTest.cs | 114 ++++++++++++++++++ 8 files changed, 420 insertions(+) create mode 100644 ReClass.NET/Util/Conversion/BigEndianBitConverter.cs create mode 100644 ReClass.NET/Util/Conversion/EndianBitConverter.cs create mode 100644 ReClass.NET/Util/Conversion/LittleEndianBitConverter.cs create mode 100644 ReClass.NET_Tests/Util/Conversion/BigEndianBitConverterTest.cs create mode 100644 ReClass.NET_Tests/Util/Conversion/EndianBitConverterTest.cs create mode 100644 ReClass.NET_Tests/Util/Conversion/LittleEndianBitConverterTest.cs diff --git a/ReClass.NET/ReClass.NET.csproj b/ReClass.NET/ReClass.NET.csproj index 76b54d3b..be3a033a 100644 --- a/ReClass.NET/ReClass.NET.csproj +++ b/ReClass.NET/ReClass.NET.csproj @@ -394,6 +394,9 @@ + + + diff --git a/ReClass.NET/Util/Conversion/BigEndianBitConverter.cs b/ReClass.NET/Util/Conversion/BigEndianBitConverter.cs new file mode 100644 index 00000000..4469dca0 --- /dev/null +++ b/ReClass.NET/Util/Conversion/BigEndianBitConverter.cs @@ -0,0 +1,39 @@ +using System; + +namespace ReClassNET.Util.Conversion +{ + public sealed class BigEndianBitConverter : EndianBitConverter + { + protected override long FromBytes(byte[] buffer, int index, int bytesToConvert) + { + if (buffer == null) + { + throw new ArgumentNullException(nameof(buffer)); + } + if (index + bytesToConvert > buffer.Length) + { + throw new ArgumentOutOfRangeException(nameof(index)); + } + + long ret = 0; + for (var i = 0; i < bytesToConvert; i++) + { + ret = unchecked((ret << 8) | buffer[index + i]); + } + return ret; + } + + protected override byte[] ToBytes(long value, int bytes) + { + var endOffset = bytes - 1; + + var buffer = new byte[bytes]; + for (var i = 0; i < bytes; i++) + { + buffer[endOffset - i] = unchecked((byte)(value & 0xFF)); + value >>= 8; + } + return buffer; + } + } +} diff --git a/ReClass.NET/Util/Conversion/EndianBitConverter.cs b/ReClass.NET/Util/Conversion/EndianBitConverter.cs new file mode 100644 index 00000000..eb231dd8 --- /dev/null +++ b/ReClass.NET/Util/Conversion/EndianBitConverter.cs @@ -0,0 +1,83 @@ +using System; +using System.Runtime.InteropServices; + +namespace ReClassNET.Util.Conversion +{ + public abstract class EndianBitConverter + { + public static LittleEndianBitConverter Little { get; } = new LittleEndianBitConverter(); + + public static BigEndianBitConverter Big { get; } = new BigEndianBitConverter(); + + public static EndianBitConverter System { get; } = BitConverter.IsLittleEndian ? (EndianBitConverter)Little : Big; + + + public bool ToBoolean(byte[] value, int startIndex) => BitConverter.ToBoolean(value, startIndex); + + public char ToChar(byte[] value, int startIndex) => unchecked((char)FromBytes(value, startIndex, 2)); + + public double ToDouble(byte[] value, int startIndex) => BitConverter.Int64BitsToDouble(ToInt64(value, startIndex)); + + public float ToSingle(byte[] value, int startIndex) => new Int32FloatUnion(ToInt32(value, startIndex)).FloatValue; + + public short ToInt16(byte[] value, int startIndex) => unchecked((short)FromBytes(value, startIndex, 2)); + + public int ToInt32(byte[] value, int startIndex) => unchecked((int)FromBytes(value, startIndex, 4)); + + public long ToInt64(byte[] value, int startIndex) => FromBytes(value, startIndex, 8); + + public ushort ToUInt16(byte[] value, int startIndex) => unchecked((ushort)FromBytes(value, startIndex, 2)); + + public uint ToUInt32(byte[] value, int startIndex) => unchecked((uint)FromBytes(value, startIndex, 4)); + + public ulong ToUInt64(byte[] value, int startIndex) => unchecked((ulong)FromBytes(value, startIndex, 8)); + + protected abstract long FromBytes(byte[] value, int index, int bytesToConvert); + + + public byte[] GetBytes(bool value) => BitConverter.GetBytes(value); + + public byte[] GetBytes(char value) => ToBytes(value, 2); + + public byte[] GetBytes(double value) => ToBytes(BitConverter.DoubleToInt64Bits(value), 8); + + public byte[] GetBytes(short value) => ToBytes(value, 2); + + public byte[] GetBytes(int value) => ToBytes(value, 4); + + public byte[] GetBytes(long value) => ToBytes(value, 8); + + public byte[] GetBytes(float value) => ToBytes(new Int32FloatUnion(value).IntValue, 4); + + public byte[] GetBytes(ushort value) => ToBytes(value, 2); + + public byte[] GetBytes(uint value) => ToBytes(value, 4); + + public byte[] GetBytes(ulong value) => ToBytes(unchecked((long)value), 8); + + protected abstract byte[] ToBytes(long value, int bytes); + + + [StructLayout(LayoutKind.Explicit)] + private readonly struct Int32FloatUnion + { + [FieldOffset(0)] + public readonly int IntValue; + + [FieldOffset(0)] + public readonly float FloatValue; + + internal Int32FloatUnion(int value) + { + FloatValue = 0.0f; + IntValue = value; + } + + internal Int32FloatUnion(float value) + { + IntValue = 0; + FloatValue = value; + } + } + } +} diff --git a/ReClass.NET/Util/Conversion/LittleEndianBitConverter.cs b/ReClass.NET/Util/Conversion/LittleEndianBitConverter.cs new file mode 100644 index 00000000..af12706a --- /dev/null +++ b/ReClass.NET/Util/Conversion/LittleEndianBitConverter.cs @@ -0,0 +1,39 @@ +using System; + +namespace ReClassNET.Util.Conversion +{ + public sealed class LittleEndianBitConverter : EndianBitConverter + { + protected override long FromBytes(byte[] buffer, int index, int bytesToConvert) + { + if (buffer == null) + { + throw new ArgumentNullException(nameof(buffer)); + } + if (index + bytesToConvert > buffer.Length) + { + throw new ArgumentOutOfRangeException(nameof(index)); + } + + var ret = 0L; + for (var i = 0; i < bytesToConvert; i++) + { + ret = unchecked((ret << 8) | buffer[index + bytesToConvert - 1 - i]); + } + return ret; + } + + protected override byte[] ToBytes(long value, int bytes) + { + var buffer = new byte[bytes]; + + for (var i = 0; i < bytes; i++) + { + buffer[i] = unchecked((byte)(value & 0xFF)); + value >>= 8; + } + + return buffer; + } + } +} diff --git a/ReClass.NET_Tests/ReClass.NET_Tests.csproj b/ReClass.NET_Tests/ReClass.NET_Tests.csproj index 1ed78ef2..02c7ae25 100644 --- a/ReClass.NET_Tests/ReClass.NET_Tests.csproj +++ b/ReClass.NET_Tests/ReClass.NET_Tests.csproj @@ -91,6 +91,9 @@ + + + diff --git a/ReClass.NET_Tests/Util/Conversion/BigEndianBitConverterTest.cs b/ReClass.NET_Tests/Util/Conversion/BigEndianBitConverterTest.cs new file mode 100644 index 00000000..a55599a3 --- /dev/null +++ b/ReClass.NET_Tests/Util/Conversion/BigEndianBitConverterTest.cs @@ -0,0 +1,114 @@ +using System; +using NFluent; +using ReClassNET.Util.Conversion; +using Xunit; + +namespace ReClass.NET_Tests.Util.Conversion +{ + public class BigEndianBitConverterTest + { + [Fact] + public void ToXXX_ThrowsOnNull() + { + var sut = new BigEndianBitConverter(); + + Check.ThatCode(() => sut.ToInt32(null, 0)).Throws(); + } + + [Fact] + public void ToXXX_ThrowsOnInvalidIndexOrSize() + { + var sut = new BigEndianBitConverter(); + + var data = new byte[3]; + Check.ThatCode(() => sut.ToInt32(data, 0)).Throws(); + + data = new byte[4]; + Check.ThatCode(() => sut.ToInt32(data, 1)).Throws(); + } + + [Fact] + public void GetBytes() + { + var sut = new BigEndianBitConverter(); + + Check.That(new byte[] { 0 }).ContainsExactly(sut.GetBytes(false)); + Check.That(new byte[] { 1 }).ContainsExactly(sut.GetBytes(true)); + + Check.That(new byte[] { 0, 0 }).ContainsExactly(sut.GetBytes((short)0)); + Check.That(new byte[] { 0, 1 }).ContainsExactly(sut.GetBytes((short)1)); + Check.That(new byte[] { 1, 0 }).ContainsExactly(sut.GetBytes((short)256)); + Check.That(new byte[] { 255, 255 }).ContainsExactly(sut.GetBytes((short)-1)); + + Check.That(new byte[] { 0, 0 }).ContainsExactly(sut.GetBytes((ushort)0)); + Check.That(new byte[] { 0, 1 }).ContainsExactly(sut.GetBytes((ushort)1)); + Check.That(new byte[] { 1, 0 }).ContainsExactly(sut.GetBytes((ushort)256)); + Check.That(new byte[] { 255, 255 }).ContainsExactly(sut.GetBytes(ushort.MaxValue)); + + Check.That(new byte[] { 0, 0, 0, 0 }).ContainsExactly(sut.GetBytes(0)); + Check.That(new byte[] { 0, 0, 0, 1 }).ContainsExactly(sut.GetBytes(1)); + Check.That(new byte[] { 0, 0, 1, 0 }).ContainsExactly(sut.GetBytes(256)); + Check.That(new byte[] { 0, 1, 0, 0 }).ContainsExactly(sut.GetBytes(65536)); + Check.That(new byte[] { 1, 0, 0, 0 }).ContainsExactly(sut.GetBytes(16777216)); + Check.That(new byte[] { 255, 255, 255, 255 }).ContainsExactly(sut.GetBytes(-1)); + + Check.That(new byte[] { 0, 0, 0, 0 }).ContainsExactly(sut.GetBytes(0u)); + Check.That(new byte[] { 0, 0, 0, 1 }).ContainsExactly(sut.GetBytes(1u)); + Check.That(new byte[] { 0, 0, 1, 0 }).ContainsExactly(sut.GetBytes(256u)); + Check.That(new byte[] { 0, 1, 0, 0 }).ContainsExactly(sut.GetBytes(65536u)); + Check.That(new byte[] { 1, 0, 0, 0 }).ContainsExactly(sut.GetBytes(16777216u)); + Check.That(new byte[] { 255, 255, 255, 255 }).ContainsExactly(sut.GetBytes(uint.MaxValue)); + + Check.That(new byte[] { 0, 0, 0, 0, 0, 0, 0, 0 }).ContainsExactly(sut.GetBytes(0L)); + Check.That(new byte[] { 0, 0, 0, 0, 0, 0, 0, 1 }).ContainsExactly(sut.GetBytes(1L)); + Check.That(new byte[] { 0, 0, 0, 0, 0, 0, 1, 0 }).ContainsExactly(sut.GetBytes(256L)); + Check.That(new byte[] { 0, 0, 0, 0, 0, 1, 0, 0 }).ContainsExactly(sut.GetBytes(65536L)); + Check.That(new byte[] { 0, 0, 0, 0, 1, 0, 0, 0 }).ContainsExactly(sut.GetBytes(16777216L)); + Check.That(new byte[] { 0, 0, 0, 1, 0, 0, 0, 0 }).ContainsExactly(sut.GetBytes(4294967296L)); + Check.That(new byte[] { 0, 0, 1, 0, 0, 0, 0, 0 }).ContainsExactly(sut.GetBytes(1099511627776L)); + Check.That(new byte[] { 0, 1, 0, 0, 0, 0, 0, 0 }).ContainsExactly(sut.GetBytes(281474976710656L)); + Check.That(new byte[] { 1, 0, 0, 0, 0, 0, 0, 0 }).ContainsExactly(sut.GetBytes(72057594037927936L)); + Check.That(new byte[] { 255, 255, 255, 255, 255, 255, 255, 255 }).ContainsExactly(sut.GetBytes(-1L)); + + Check.That(new byte[] { 0, 0, 0, 0, 0, 0, 0, 0 }).ContainsExactly(sut.GetBytes(0UL)); + Check.That(new byte[] { 0, 0, 0, 0, 0, 0, 0, 1 }).ContainsExactly(sut.GetBytes(1UL)); + Check.That(new byte[] { 0, 0, 0, 0, 0, 0, 1, 0 }).ContainsExactly(sut.GetBytes(256UL)); + Check.That(new byte[] { 0, 0, 0, 0, 0, 1, 0, 0 }).ContainsExactly(sut.GetBytes(65536UL)); + Check.That(new byte[] { 0, 0, 0, 0, 1, 0, 0, 0 }).ContainsExactly(sut.GetBytes(16777216UL)); + Check.That(new byte[] { 0, 0, 0, 1, 0, 0, 0, 0 }).ContainsExactly(sut.GetBytes(4294967296UL)); + Check.That(new byte[] { 0, 0, 1, 0, 0, 0, 0, 0 }).ContainsExactly(sut.GetBytes(1099511627776UL)); + Check.That(new byte[] { 0, 1, 0, 0, 0, 0, 0, 0 }).ContainsExactly(sut.GetBytes(281474976710656UL)); + Check.That(new byte[] { 1, 0, 0, 0, 0, 0, 0, 0 }).ContainsExactly(sut.GetBytes(72057594037927936UL)); + Check.That(new byte[] { 255, 255, 255, 255, 255, 255, 255, 255 }).ContainsExactly(sut.GetBytes(ulong.MaxValue)); + } + + [Fact] + public void ToXXX() + { + var sut = new BigEndianBitConverter(); + + var data = new byte[] { 0, 0, 0, 0, 0, 0, 0, 3 }; + Check.That(sut.ToBoolean(data, 0)).IsFalse(); + Check.That(sut.ToBoolean(data, 7)).IsTrue(); + Check.That(sut.ToChar(data, 0)).IsEqualTo('\0'); + Check.That(sut.ToChar(data, 6)).IsEqualTo('\u0003'); + Check.That(sut.ToInt16(data, 0)).IsEqualTo(0); + Check.That(sut.ToInt16(data, 6)).IsEqualTo(3); + Check.That(sut.ToUInt16(data, 0)).IsEqualTo(0u); + Check.That(sut.ToUInt16(data, 6)).IsEqualTo(3u); + Check.That(sut.ToInt32(data, 0)).IsEqualTo(0); + Check.That(sut.ToInt32(data, 4)).IsEqualTo(3); + Check.That(sut.ToUInt32(data, 0)).IsEqualTo(0u); + Check.That(sut.ToUInt32(data, 4)).IsEqualTo(3u); + Check.That(sut.ToInt64(data, 0)).IsEqualTo(3L); + Check.That(sut.ToUInt64(data, 0)).IsEqualTo(3UL); + + data = new byte[] { 0x41, 0x20, 0, 0, 0, 0, 0, 0 }; + Check.That(sut.ToSingle(data, 0)).IsEqualTo(10.0f); + Check.That(sut.ToSingle(data, 4)).IsEqualTo(0.0f); + + data = new byte[] { 0x40, 0x24, 0, 0, 0, 0, 0, 0 }; + Check.That(sut.ToDouble(data, 0)).IsEqualTo(10.0); + } + } +} diff --git a/ReClass.NET_Tests/Util/Conversion/EndianBitConverterTest.cs b/ReClass.NET_Tests/Util/Conversion/EndianBitConverterTest.cs new file mode 100644 index 00000000..1a5e54a1 --- /dev/null +++ b/ReClass.NET_Tests/Util/Conversion/EndianBitConverterTest.cs @@ -0,0 +1,25 @@ +using System; +using NFluent; +using ReClassNET.Util.Conversion; +using Xunit; + +namespace ReClass.NET_Tests.Util.Conversion +{ + public class EndianBitConverterTest + { + [Fact] + public void Properties_AreNotNull() + { + Check.That(EndianBitConverter.System).IsNotNull(); + Check.That(EndianBitConverter.Big).IsNotNull(); + Check.That(EndianBitConverter.Little).IsNotNull(); + } + + [Fact] + public void Types() + { + Check.That(EndianBitConverter.Big.GetType()).IsNotEqualTo(EndianBitConverter.Little.GetType()); + Check.That(EndianBitConverter.System.GetType()).IsEqualTo(BitConverter.IsLittleEndian ? EndianBitConverter.Little.GetType() : EndianBitConverter.Big.GetType()); + } + } +} diff --git a/ReClass.NET_Tests/Util/Conversion/LittleEndianBitConverterTest.cs b/ReClass.NET_Tests/Util/Conversion/LittleEndianBitConverterTest.cs new file mode 100644 index 00000000..5a740ef5 --- /dev/null +++ b/ReClass.NET_Tests/Util/Conversion/LittleEndianBitConverterTest.cs @@ -0,0 +1,114 @@ +using System; +using NFluent; +using ReClassNET.Util.Conversion; +using Xunit; + +namespace ReClass.NET_Tests.Util.Conversion +{ + public class LittleEndianBitConverterTest + { + [Fact] + public void ToXXX_ThrowsOnNull() + { + var sut = new LittleEndianBitConverter(); + + Check.ThatCode(() => sut.ToInt32(null, 0)).Throws(); + } + + [Fact] + public void ToXXX_ThrowsOnInvalidIndexOrSize() + { + var sut = new LittleEndianBitConverter(); + + var data = new byte[3]; + Check.ThatCode(() => sut.ToInt32(data, 0)).Throws(); + + data = new byte[4]; + Check.ThatCode(() => sut.ToInt32(data, 1)).Throws(); + } + + [Fact] + public void GetBytes() + { + var sut = new LittleEndianBitConverter(); + + Check.That(new byte[] { 0 }).ContainsExactly(sut.GetBytes(false)); + Check.That(new byte[] { 1 }).ContainsExactly(sut.GetBytes(true)); + + Check.That(new byte[] { 0, 0 }).ContainsExactly(sut.GetBytes((short)0)); + Check.That(new byte[] { 1, 0 }).ContainsExactly(sut.GetBytes((short)1)); + Check.That(new byte[] { 0, 1 }).ContainsExactly(sut.GetBytes((short)256)); + Check.That(new byte[] { 255, 255 }).ContainsExactly(sut.GetBytes((short)-1)); + + Check.That(new byte[] { 0, 0 }).ContainsExactly(sut.GetBytes((ushort)0)); + Check.That(new byte[] { 1, 0 }).ContainsExactly(sut.GetBytes((ushort)1)); + Check.That(new byte[] { 0, 1 }).ContainsExactly(sut.GetBytes((ushort)256)); + Check.That(new byte[] { 255, 255 }).ContainsExactly(sut.GetBytes(ushort.MaxValue)); + + Check.That(new byte[] { 0, 0, 0, 0 }).ContainsExactly(sut.GetBytes(0)); + Check.That(new byte[] { 1, 0, 0, 0 }).ContainsExactly(sut.GetBytes(1)); + Check.That(new byte[] { 0, 1, 0, 0 }).ContainsExactly(sut.GetBytes(256)); + Check.That(new byte[] { 0, 0, 1, 0 }).ContainsExactly(sut.GetBytes(65536)); + Check.That(new byte[] { 0, 0, 0, 1 }).ContainsExactly(sut.GetBytes(16777216)); + Check.That(new byte[] { 255, 255, 255, 255 }).ContainsExactly(sut.GetBytes(-1)); + + Check.That(new byte[] { 0, 0, 0, 0 }).ContainsExactly(sut.GetBytes(0u)); + Check.That(new byte[] { 1, 0, 0, 0 }).ContainsExactly(sut.GetBytes(1u)); + Check.That(new byte[] { 0, 1, 0, 0 }).ContainsExactly(sut.GetBytes(256u)); + Check.That(new byte[] { 0, 0, 1, 0 }).ContainsExactly(sut.GetBytes(65536u)); + Check.That(new byte[] { 0, 0, 0, 1 }).ContainsExactly(sut.GetBytes(16777216u)); + Check.That(new byte[] { 255, 255, 255, 255 }).ContainsExactly(sut.GetBytes(uint.MaxValue)); + + Check.That(new byte[] { 0, 0, 0, 0, 0, 0, 0, 0 }).ContainsExactly(sut.GetBytes(0L)); + Check.That(new byte[] { 1, 0, 0, 0, 0, 0, 0, 0 }).ContainsExactly(sut.GetBytes(1L)); + Check.That(new byte[] { 0, 1, 0, 0, 0, 0, 0, 0 }).ContainsExactly(sut.GetBytes(256L)); + Check.That(new byte[] { 0, 0, 1, 0, 0, 0, 0, 0 }).ContainsExactly(sut.GetBytes(65536L)); + Check.That(new byte[] { 0, 0, 0, 1, 0, 0, 0, 0 }).ContainsExactly(sut.GetBytes(16777216L)); + Check.That(new byte[] { 0, 0, 0, 0, 1, 0, 0, 0 }).ContainsExactly(sut.GetBytes(4294967296L)); + Check.That(new byte[] { 0, 0, 0, 0, 0, 1, 0, 0 }).ContainsExactly(sut.GetBytes(1099511627776L)); + Check.That(new byte[] { 0, 0, 0, 0, 0, 0, 1, 0 }).ContainsExactly(sut.GetBytes(281474976710656L)); + Check.That(new byte[] { 0, 0, 0, 0, 0, 0, 0, 1 }).ContainsExactly(sut.GetBytes(72057594037927936L)); + Check.That(new byte[] { 255, 255, 255, 255, 255, 255, 255, 255 }).ContainsExactly(sut.GetBytes(-1L)); + + Check.That(new byte[] { 0, 0, 0, 0, 0, 0, 0, 0 }).ContainsExactly(sut.GetBytes(0UL)); + Check.That(new byte[] { 1, 0, 0, 0, 0, 0, 0, 0 }).ContainsExactly(sut.GetBytes(1UL)); + Check.That(new byte[] { 0, 1, 0, 0, 0, 0, 0, 0 }).ContainsExactly(sut.GetBytes(256UL)); + Check.That(new byte[] { 0, 0, 1, 0, 0, 0, 0, 0 }).ContainsExactly(sut.GetBytes(65536UL)); + Check.That(new byte[] { 0, 0, 0, 1, 0, 0, 0, 0 }).ContainsExactly(sut.GetBytes(16777216UL)); + Check.That(new byte[] { 0, 0, 0, 0, 1, 0, 0, 0 }).ContainsExactly(sut.GetBytes(4294967296UL)); + Check.That(new byte[] { 0, 0, 0, 0, 0, 1, 0, 0 }).ContainsExactly(sut.GetBytes(1099511627776UL)); + Check.That(new byte[] { 0, 0, 0, 0, 0, 0, 1, 0 }).ContainsExactly(sut.GetBytes(281474976710656UL)); + Check.That(new byte[] { 0, 0, 0, 0, 0, 0, 0, 1 }).ContainsExactly(sut.GetBytes(72057594037927936UL)); + Check.That(new byte[] { 255, 255, 255, 255, 255, 255, 255, 255 }).ContainsExactly(sut.GetBytes(ulong.MaxValue)); + } + + [Fact] + public void ToXXX() + { + var sut = new LittleEndianBitConverter(); + + var data = new byte[] { 0x03, 0, 0, 0, 0, 0, 0, 0 }; + Check.That(sut.ToBoolean(data, 0)).IsTrue(); + Check.That(sut.ToBoolean(data, 7)).IsFalse(); + Check.That(sut.ToChar(data, 0)).IsEqualTo('\u0003'); + Check.That(sut.ToChar(data, 6)).IsEqualTo('\0'); + Check.That(sut.ToInt16(data, 0)).IsEqualTo(3); + Check.That(sut.ToInt16(data, 6)).IsEqualTo(0); + Check.That(sut.ToUInt16(data, 0)).IsEqualTo(3u); + Check.That(sut.ToUInt16(data, 6)).IsEqualTo(0u); + Check.That(sut.ToInt32(data, 0)).IsEqualTo(3); + Check.That(sut.ToInt32(data, 4)).IsEqualTo(0); + Check.That(sut.ToUInt32(data, 0)).IsEqualTo(3u); + Check.That(sut.ToUInt32(data, 4)).IsEqualTo(0u); + Check.That(sut.ToInt64(data, 0)).IsEqualTo(3L); + Check.That(sut.ToUInt64(data, 0)).IsEqualTo(3UL); + + data = new byte[] { 0, 0, 0, 0, 0, 0, 0x20, 0x41 }; + Check.That(sut.ToSingle(data, 0)).IsEqualTo(0.0f); + Check.That(sut.ToSingle(data, 4)).IsEqualTo(10.0f); + + data = new byte[] { 0, 0, 0, 0, 0, 0, 0x24, 0x40 }; + Check.That(sut.ToDouble(data, 0)).IsEqualTo(10.0); + } + } +} From 15b08867a6580db54937ec7d0e487d202d623b4d Mon Sep 17 00:00:00 2001 From: KN4CK3R Date: Sun, 22 Nov 2020 21:56:39 +0100 Subject: [PATCH 199/223] Replaced BitConverter with EndianBitConverter. --- ReClass.NET/Forms/MainForm.cs | 26 +++++++++--------- ReClass.NET/Forms/ScannerForm.cs | 10 +++---- ReClass.NET/Memory/IRemoteMemoryReader.cs | 3 +++ ReClass.NET/Memory/IRemoteMemoryWriter.cs | 5 +++- ReClass.NET/Memory/MemoryBuffer.cs | 27 +++++++++---------- ReClass.NET/Memory/RemoteProcess.cs | 3 +++ .../Comparer/DoubleMemoryComparer.cs | 19 ++++++++----- .../Comparer/FloatMemoryComparer.cs | 19 ++++++++----- .../Comparer/IntegerMemoryComparer.cs | 11 +++++--- .../Comparer/LongMemoryComparer.cs | 11 +++++--- .../Comparer/ShortMemoryComparer.cs | 11 +++++--- .../MemoryScanner/InputCorrelatedScanner.cs | 14 +++++----- ReClass.NET/MemoryScanner/MemoryRecord.cs | 22 +++++++-------- .../Comparer/FloatMemoryComparerTest.cs | 19 +++++++------ .../Comparer/IntegerMemoryComparerTest.cs | 17 +++++++----- .../Comparer/LongMemoryComparerTest.cs | 17 +++++++----- .../Comparer/ShortMemoryComparerTest.cs | 17 +++++++----- 17 files changed, 149 insertions(+), 102 deletions(-) diff --git a/ReClass.NET/Forms/MainForm.cs b/ReClass.NET/Forms/MainForm.cs index 0b3f3008..bff83d26 100644 --- a/ReClass.NET/Forms/MainForm.cs +++ b/ReClass.NET/Forms/MainForm.cs @@ -588,6 +588,8 @@ private void searchForEqualValuesToolStripMenuItem_Click(object sender, EventArg return; } + var bitConverter = Program.RemoteProcess.BitConverter; + IScanComparer comparer; switch (selectedNode.Node) { @@ -595,10 +597,10 @@ private void searchForEqualValuesToolStripMenuItem_Click(object sender, EventArg comparer = new ArrayOfBytesMemoryComparer(node.ReadValueFromMemory(selectedNode.Memory)); break; case FloatNode node: - comparer = new FloatMemoryComparer(ScanCompareType.Equal, ScanRoundMode.Normal, 2, node.ReadValueFromMemory(selectedNode.Memory), 0.0f); + comparer = new FloatMemoryComparer(ScanCompareType.Equal, ScanRoundMode.Normal, 2, node.ReadValueFromMemory(selectedNode.Memory), 0.0f, bitConverter); break; case DoubleNode node: - comparer = new DoubleMemoryComparer(ScanCompareType.Equal, ScanRoundMode.Normal, 2, node.ReadValueFromMemory(selectedNode.Memory), 0.0); + comparer = new DoubleMemoryComparer(ScanCompareType.Equal, ScanRoundMode.Normal, 2, node.ReadValueFromMemory(selectedNode.Memory), 0.0, bitConverter); break; case Int8Node node: comparer = new ByteMemoryComparer(ScanCompareType.Equal, (byte)node.ReadValueFromMemory(selectedNode.Memory), 0); @@ -607,30 +609,30 @@ private void searchForEqualValuesToolStripMenuItem_Click(object sender, EventArg comparer = new ByteMemoryComparer(ScanCompareType.Equal, node.ReadValueFromMemory(selectedNode.Memory), 0); break; case Int16Node node: - comparer = new ShortMemoryComparer(ScanCompareType.Equal, node.ReadValueFromMemory(selectedNode.Memory), 0); + comparer = new ShortMemoryComparer(ScanCompareType.Equal, node.ReadValueFromMemory(selectedNode.Memory), 0, bitConverter); break; case UInt16Node node: - comparer = new ShortMemoryComparer(ScanCompareType.Equal, (short)node.ReadValueFromMemory(selectedNode.Memory), 0); + comparer = new ShortMemoryComparer(ScanCompareType.Equal, (short)node.ReadValueFromMemory(selectedNode.Memory), 0, bitConverter); break; case Int32Node node: - comparer = new IntegerMemoryComparer(ScanCompareType.Equal, node.ReadValueFromMemory(selectedNode.Memory), 0); + comparer = new IntegerMemoryComparer(ScanCompareType.Equal, node.ReadValueFromMemory(selectedNode.Memory), 0, bitConverter); break; case UInt32Node node: - comparer = new IntegerMemoryComparer(ScanCompareType.Equal, (int)node.ReadValueFromMemory(selectedNode.Memory), 0); + comparer = new IntegerMemoryComparer(ScanCompareType.Equal, (int)node.ReadValueFromMemory(selectedNode.Memory), 0, bitConverter); break; case Int64Node node: - comparer = new LongMemoryComparer(ScanCompareType.Equal, node.ReadValueFromMemory(selectedNode.Memory), 0L); + comparer = new LongMemoryComparer(ScanCompareType.Equal, node.ReadValueFromMemory(selectedNode.Memory), 0L, bitConverter); break; case UInt64Node node: - comparer = new LongMemoryComparer(ScanCompareType.Equal, (long)node.ReadValueFromMemory(selectedNode.Memory), 0L); + comparer = new LongMemoryComparer(ScanCompareType.Equal, (long)node.ReadValueFromMemory(selectedNode.Memory), 0L, bitConverter); break; case NIntNode node: { var value = node.ReadValueFromMemory(selectedNode.Memory); #if RECLASSNET64 - comparer = new LongMemoryComparer(ScanCompareType.Equal, value.ToInt64(), 0L); + comparer = new LongMemoryComparer(ScanCompareType.Equal, value.ToInt64(), 0L, bitConverter); #else - comparer = new IntegerMemoryComparer(ScanCompareType.Equal, value.ToInt32(), 0); + comparer = new IntegerMemoryComparer(ScanCompareType.Equal, value.ToInt32(), 0, bitConverter); #endif break; } @@ -638,9 +640,9 @@ private void searchForEqualValuesToolStripMenuItem_Click(object sender, EventArg { var value = node.ReadValueFromMemory(selectedNode.Memory); #if RECLASSNET64 - comparer = new LongMemoryComparer(ScanCompareType.Equal, (long)value.ToUInt64(), 0L); + comparer = new LongMemoryComparer(ScanCompareType.Equal, (long)value.ToUInt64(), 0L, bitConverter); #else - comparer = new IntegerMemoryComparer(ScanCompareType.Equal, (int)value.ToUInt32(), 0); + comparer = new IntegerMemoryComparer(ScanCompareType.Equal, (int)value.ToUInt32(), 0, bitConverter); #endif break; } diff --git a/ReClass.NET/Forms/ScannerForm.cs b/ReClass.NET/Forms/ScannerForm.cs index c52e7187..0fb4d430 100644 --- a/ReClass.NET/Forms/ScannerForm.cs +++ b/ReClass.NET/Forms/ScannerForm.cs @@ -758,11 +758,11 @@ private IScanComparer CreateComparer(ScanSettings settings) case ScanValueType.Byte: return new ByteMemoryComparer(compareType, (byte)value1, (byte)value2); case ScanValueType.Short: - return new ShortMemoryComparer(compareType, (short)value1, (short)value2); + return new ShortMemoryComparer(compareType, (short)value1, (short)value2, process.BitConverter); case ScanValueType.Integer: - return new IntegerMemoryComparer(compareType, (int)value1, (int)value2); + return new IntegerMemoryComparer(compareType, (int)value1, (int)value2, process.BitConverter); case ScanValueType.Long: - return new LongMemoryComparer(compareType, value1, value2); + return new LongMemoryComparer(compareType, value1, value2, process.BitConverter); } } else if (settings.ValueType == ScanValueType.Float || settings.ValueType == ScanValueType.Double) @@ -806,9 +806,9 @@ int CalculateSignificantDigits(string input, NumberFormatInfo numberFormat) switch (settings.ValueType) { case ScanValueType.Float: - return new FloatMemoryComparer(compareType, roundMode, significantDigits, (float)value1, (float)value2); + return new FloatMemoryComparer(compareType, roundMode, significantDigits, (float)value1, (float)value2, process.BitConverter); case ScanValueType.Double: - return new DoubleMemoryComparer(compareType, roundMode, significantDigits, value1, value2); + return new DoubleMemoryComparer(compareType, roundMode, significantDigits, value1, value2, process.BitConverter); } } else if (settings.ValueType == ScanValueType.ArrayOfBytes) diff --git a/ReClass.NET/Memory/IRemoteMemoryReader.cs b/ReClass.NET/Memory/IRemoteMemoryReader.cs index 3f926c82..ed514ddd 100644 --- a/ReClass.NET/Memory/IRemoteMemoryReader.cs +++ b/ReClass.NET/Memory/IRemoteMemoryReader.cs @@ -1,10 +1,13 @@ using System; using System.Text; +using ReClassNET.Util.Conversion; namespace ReClassNET.Memory { public interface IRemoteMemoryReader { + EndianBitConverter BitConverter { get; set; } + /// Reads remote memory from the address into the buffer. /// The address to read from. /// [out] The data buffer to fill. If the remote process is not valid, the buffer will get filled with zeros. diff --git a/ReClass.NET/Memory/IRemoteMemoryWriter.cs b/ReClass.NET/Memory/IRemoteMemoryWriter.cs index bc466d42..57bba946 100644 --- a/ReClass.NET/Memory/IRemoteMemoryWriter.cs +++ b/ReClass.NET/Memory/IRemoteMemoryWriter.cs @@ -1,9 +1,12 @@ -using System; +using System; +using ReClassNET.Util.Conversion; namespace ReClassNET.Memory { public interface IRemoteMemoryWriter { + EndianBitConverter BitConverter { get; set; } + /// Writes the given to the in the remote process. /// The address to write to. /// The data to write. diff --git a/ReClass.NET/Memory/MemoryBuffer.cs b/ReClass.NET/Memory/MemoryBuffer.cs index c6e847fe..e1b515a4 100644 --- a/ReClass.NET/Memory/MemoryBuffer.cs +++ b/ReClass.NET/Memory/MemoryBuffer.cs @@ -1,8 +1,8 @@ using System; using System.Diagnostics.Contracts; -using System.Runtime.InteropServices; using System.Text; using ReClassNET.Extensions; +using ReClassNET.Util.Conversion; namespace ReClassNET.Memory { @@ -15,6 +15,8 @@ public class MemoryBuffer public byte[] RawData => data; + public EndianBitConverter BitConverter { get; set; } = EndianBitConverter.System; + public int Size { get => data.Length; @@ -52,25 +54,18 @@ public MemoryBuffer() historyData = Array.Empty(); } - public MemoryBuffer(MemoryBuffer other) - { - Contract.Requires(other != null); - Contract.Ensures(data != null); - Contract.Ensures(historyData != null); - - data = other.data; - historyData = other.historyData; - hasHistory = other.hasHistory; - - ContainsValidData = other.ContainsValidData; - } - public MemoryBuffer Clone() { Contract.Ensures(Contract.Result() != null); - return new MemoryBuffer(this) + return new MemoryBuffer { + data = data, + historyData = historyData, + hasHistory = hasHistory, + + BitConverter = BitConverter, + ContainsValidData = ContainsValidData, Offset = Offset }; } @@ -90,6 +85,8 @@ public void UpdateFrom(IRemoteMemoryReader reader, IntPtr address) hasHistory = ContainsValidData; + BitConverter = reader.BitConverter; + ContainsValidData = reader.ReadRemoteMemoryIntoBuffer(address, ref data); if (!ContainsValidData) { diff --git a/ReClass.NET/Memory/RemoteProcess.cs b/ReClass.NET/Memory/RemoteProcess.cs index b23286c0..bebdf175 100644 --- a/ReClass.NET/Memory/RemoteProcess.cs +++ b/ReClass.NET/Memory/RemoteProcess.cs @@ -13,6 +13,7 @@ using ReClassNET.MemoryScanner; using ReClassNET.Native; using ReClassNET.Symbols; +using ReClassNET.Util.Conversion; namespace ReClassNET.Memory { @@ -56,6 +57,8 @@ public class RemoteProcess : IDisposable, IRemoteMemoryReader, IRemoteMemoryWrit public SymbolStore Symbols => symbols; + public EndianBitConverter BitConverter { get; set; } = EndianBitConverter.System; + /// Gets a copy of the current modules list. This list may change if the remote process (un)loads a module. public IEnumerable Modules { diff --git a/ReClass.NET/MemoryScanner/Comparer/DoubleMemoryComparer.cs b/ReClass.NET/MemoryScanner/Comparer/DoubleMemoryComparer.cs index b8428041..5e866608 100644 --- a/ReClass.NET/MemoryScanner/Comparer/DoubleMemoryComparer.cs +++ b/ReClass.NET/MemoryScanner/Comparer/DoubleMemoryComparer.cs @@ -1,6 +1,7 @@ using System; using System.Diagnostics; using ReClassNET.Extensions; +using ReClassNET.Util.Conversion; namespace ReClassNET.MemoryScanner.Comparer { @@ -16,7 +17,9 @@ public class DoubleMemoryComparer : ISimpleScanComparer private readonly double minValue; private readonly double maxValue; - public DoubleMemoryComparer(ScanCompareType compareType, ScanRoundMode roundType, int significantDigits, double value1, double value2) + private readonly EndianBitConverter bitConverter; + + public DoubleMemoryComparer(ScanCompareType compareType, ScanRoundMode roundType, int significantDigits, double value1, double value2, EndianBitConverter bitConverter) { CompareType = compareType; @@ -29,11 +32,13 @@ public DoubleMemoryComparer(ScanCompareType compareType, ScanRoundMode roundType minValue = value1 - 1.0 / factor; maxValue = value1 + 1.0 / factor; + + this.bitConverter = bitConverter; } private bool CheckRoundedEquality(double value) => RoundType switch - { + { ScanRoundMode.Strict => Value1.IsNearlyEqual(Math.Round(value, significantDigits, MidpointRounding.AwayFromZero), 0.0001), ScanRoundMode.Normal => minValue < value && value < maxValue, ScanRoundMode.Truncate => (long)value == (long)Value1, @@ -46,7 +51,7 @@ public bool Compare(byte[] data, int index, out ScanResult result) data, index, value => CompareType switch - { + { ScanCompareType.Equal => CheckRoundedEquality(value), ScanCompareType.NotEqual => !CheckRoundedEquality(value), ScanCompareType.GreaterThan => value > Value1, @@ -60,7 +65,7 @@ public bool Compare(byte[] data, int index, out ScanResult result) }, out result ); - } + } public bool Compare(byte[] data, int index, ScanResult previous, out ScanResult result) { @@ -77,7 +82,7 @@ public bool Compare(byte[] data, int index, DoubleScanResult previous, out ScanR data, index, value => CompareType switch - { + { ScanCompareType.Equal => CheckRoundedEquality(value), ScanCompareType.NotEqual => !CheckRoundedEquality(value), ScanCompareType.Changed => value != previous.Value, @@ -98,11 +103,11 @@ out result ); } - private static bool CompareInternal(byte[] data, int index, Func matcher, out ScanResult result) + private bool CompareInternal(byte[] data, int index, Func matcher, out ScanResult result) { result = null; - var value = BitConverter.ToDouble(data, index); + var value = bitConverter.ToDouble(data, index); if (!matcher(value)) { diff --git a/ReClass.NET/MemoryScanner/Comparer/FloatMemoryComparer.cs b/ReClass.NET/MemoryScanner/Comparer/FloatMemoryComparer.cs index 27c8dd13..60a3acdf 100644 --- a/ReClass.NET/MemoryScanner/Comparer/FloatMemoryComparer.cs +++ b/ReClass.NET/MemoryScanner/Comparer/FloatMemoryComparer.cs @@ -1,6 +1,7 @@ using System; using System.Diagnostics; using ReClassNET.Extensions; +using ReClassNET.Util.Conversion; namespace ReClassNET.MemoryScanner.Comparer { @@ -16,7 +17,9 @@ public class FloatMemoryComparer : ISimpleScanComparer private readonly float minValue; private readonly float maxValue; - public FloatMemoryComparer(ScanCompareType compareType, ScanRoundMode roundType, int significantDigits, float value1, float value2) + private readonly EndianBitConverter bitConverter; + + public FloatMemoryComparer(ScanCompareType compareType, ScanRoundMode roundType, int significantDigits, float value1, float value2, EndianBitConverter bitConverter) { CompareType = compareType; @@ -29,11 +32,13 @@ public FloatMemoryComparer(ScanCompareType compareType, ScanRoundMode roundType, minValue = value1 - 1.0f / factor; maxValue = value1 + 1.0f / factor; + + this.bitConverter = bitConverter; } private bool CheckRoundedEquality(float value) => RoundType switch - { + { ScanRoundMode.Strict => Value1.IsNearlyEqual((float)Math.Round(value, significantDigits, MidpointRounding.AwayFromZero), 0.0001f), ScanRoundMode.Normal => minValue < value && value < maxValue, ScanRoundMode.Truncate => (int)value == (int)Value1, @@ -46,7 +51,7 @@ public bool Compare(byte[] data, int index, out ScanResult result) data, index, value => CompareType switch - { + { ScanCompareType.Equal => CheckRoundedEquality(value), ScanCompareType.NotEqual => !CheckRoundedEquality(value), ScanCompareType.GreaterThan => value > Value1, @@ -60,7 +65,7 @@ public bool Compare(byte[] data, int index, out ScanResult result) }, out result ); - } + } public bool Compare(byte[] data, int index, ScanResult previous, out ScanResult result) { @@ -77,7 +82,7 @@ public bool Compare(byte[] data, int index, FloatScanResult previous, out ScanRe data, index, value => CompareType switch - { + { ScanCompareType.Equal => CheckRoundedEquality(value), ScanCompareType.NotEqual => !CheckRoundedEquality(value), ScanCompareType.Changed => value != previous.Value, @@ -98,11 +103,11 @@ out result ); } - private static bool CompareInternal(byte[] data, int index, Func matcher, out ScanResult result) + private bool CompareInternal(byte[] data, int index, Func matcher, out ScanResult result) { result = null; - var value = BitConverter.ToSingle(data, index); + var value = bitConverter.ToSingle(data, index); if (!matcher(value)) { diff --git a/ReClass.NET/MemoryScanner/Comparer/IntegerMemoryComparer.cs b/ReClass.NET/MemoryScanner/Comparer/IntegerMemoryComparer.cs index 1935accf..44b372af 100644 --- a/ReClass.NET/MemoryScanner/Comparer/IntegerMemoryComparer.cs +++ b/ReClass.NET/MemoryScanner/Comparer/IntegerMemoryComparer.cs @@ -1,5 +1,6 @@ using System; using System.Diagnostics; +using ReClassNET.Util.Conversion; namespace ReClassNET.MemoryScanner.Comparer { @@ -10,12 +11,16 @@ public class IntegerMemoryComparer : ISimpleScanComparer public int Value2 { get; } public int ValueSize => sizeof(int); - public IntegerMemoryComparer(ScanCompareType compareType, int value1, int value2) + private readonly EndianBitConverter bitConverter; + + public IntegerMemoryComparer(ScanCompareType compareType, int value1, int value2, EndianBitConverter bitConverter) { CompareType = compareType; Value1 = value1; Value2 = value2; + + this.bitConverter = bitConverter; } public bool Compare(byte[] data, int index, out ScanResult result) @@ -76,11 +81,11 @@ out result ); } - private static bool CompareInternal(byte[] data, int index, Func matcher, out ScanResult result) + private bool CompareInternal(byte[] data, int index, Func matcher, out ScanResult result) { result = null; - var value = BitConverter.ToInt32(data, index); + var value = bitConverter.ToInt32(data, index); if (!matcher(value)) { diff --git a/ReClass.NET/MemoryScanner/Comparer/LongMemoryComparer.cs b/ReClass.NET/MemoryScanner/Comparer/LongMemoryComparer.cs index 3b1172cf..f95051ad 100644 --- a/ReClass.NET/MemoryScanner/Comparer/LongMemoryComparer.cs +++ b/ReClass.NET/MemoryScanner/Comparer/LongMemoryComparer.cs @@ -1,5 +1,6 @@ using System; using System.Diagnostics; +using ReClassNET.Util.Conversion; namespace ReClassNET.MemoryScanner.Comparer { @@ -10,12 +11,16 @@ public class LongMemoryComparer : ISimpleScanComparer public long Value2 { get; } public int ValueSize => sizeof(long); - public LongMemoryComparer(ScanCompareType compareType, long value1, long value2) + private readonly EndianBitConverter bitConverter; + + public LongMemoryComparer(ScanCompareType compareType, long value1, long value2, EndianBitConverter bitConverter) { CompareType = compareType; Value1 = value1; Value2 = value2; + + this.bitConverter = bitConverter; } public bool Compare(byte[] data, int index, out ScanResult result) @@ -76,11 +81,11 @@ out result ); } - private static bool CompareInternal(byte[] data, int index, Func matcher, out ScanResult result) + private bool CompareInternal(byte[] data, int index, Func matcher, out ScanResult result) { result = null; - var value = BitConverter.ToInt64(data, index); + var value = bitConverter.ToInt64(data, index); if (!matcher(value)) { diff --git a/ReClass.NET/MemoryScanner/Comparer/ShortMemoryComparer.cs b/ReClass.NET/MemoryScanner/Comparer/ShortMemoryComparer.cs index 5cdfbad0..6d8ba6a3 100644 --- a/ReClass.NET/MemoryScanner/Comparer/ShortMemoryComparer.cs +++ b/ReClass.NET/MemoryScanner/Comparer/ShortMemoryComparer.cs @@ -1,5 +1,6 @@ using System; using System.Diagnostics; +using ReClassNET.Util.Conversion; namespace ReClassNET.MemoryScanner.Comparer { @@ -10,12 +11,16 @@ public class ShortMemoryComparer : ISimpleScanComparer public short Value2 { get; } public int ValueSize => sizeof(short); - public ShortMemoryComparer(ScanCompareType compareType, short value1, short value2) + private readonly EndianBitConverter bitConverter; + + public ShortMemoryComparer(ScanCompareType compareType, short value1, short value2, EndianBitConverter bitConverter) { CompareType = compareType; Value1 = value1; Value2 = value2; + + this.bitConverter = bitConverter; } public bool Compare(byte[] data, int index, out ScanResult result) @@ -76,11 +81,11 @@ out result ); } - private static bool CompareInternal(byte[] data, int index, Func matcher, out ScanResult result) + private bool CompareInternal(byte[] data, int index, Func matcher, out ScanResult result) { result = null; - var value = BitConverter.ToInt16(data, index); + var value = bitConverter.ToInt16(data, index); if (!matcher(value)) { diff --git a/ReClass.NET/MemoryScanner/InputCorrelatedScanner.cs b/ReClass.NET/MemoryScanner/InputCorrelatedScanner.cs index 3a953d11..33e3b719 100644 --- a/ReClass.NET/MemoryScanner/InputCorrelatedScanner.cs +++ b/ReClass.NET/MemoryScanner/InputCorrelatedScanner.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Diagnostics.Contracts; using System.Linq; @@ -13,6 +13,7 @@ namespace ReClassNET.MemoryScanner { public class InputCorrelatedScanner : Scanner { + private readonly RemoteProcess process; private readonly KeyboardInput input; private readonly List hotkeys; @@ -29,6 +30,7 @@ public InputCorrelatedScanner(RemoteProcess process, KeyboardInput input, IEnume Contract.Requires(hotkeys != null); Contract.Ensures(this.input != null); + this.process = process; this.input = input; this.hotkeys = hotkeys.ToList(); } @@ -59,11 +61,11 @@ private IScanComparer CreateScanComparer(ScanCompareType compareType) return Settings.ValueType switch { ScanValueType.Byte => new ByteMemoryComparer(compareType, 0, 0), - ScanValueType.Short => new ShortMemoryComparer(compareType, 0, 0), - ScanValueType.Integer => new IntegerMemoryComparer(compareType, 0, 0), - ScanValueType.Long => new LongMemoryComparer(compareType, 0, 0), - ScanValueType.Float => new FloatMemoryComparer(compareType, ScanRoundMode.Normal, 2, 0, 0), - ScanValueType.Double => new DoubleMemoryComparer(compareType, ScanRoundMode.Normal, 2, 0, 0), + ScanValueType.Short => new ShortMemoryComparer(compareType, 0, 0, process.BitConverter), + ScanValueType.Integer => new IntegerMemoryComparer(compareType, 0, 0, process.BitConverter), + ScanValueType.Long => new LongMemoryComparer(compareType, 0, 0, process.BitConverter), + ScanValueType.Float => new FloatMemoryComparer(compareType, ScanRoundMode.Normal, 2, 0, 0, process.BitConverter), + ScanValueType.Double => new DoubleMemoryComparer(compareType, ScanRoundMode.Normal, 2, 0, 0, process.BitConverter), _ => throw new InvalidOperationException(), }; } diff --git a/ReClass.NET/MemoryScanner/MemoryRecord.cs b/ReClass.NET/MemoryScanner/MemoryRecord.cs index 11361d5f..e40e3ff9 100644 --- a/ReClass.NET/MemoryScanner/MemoryRecord.cs +++ b/ReClass.NET/MemoryScanner/MemoryRecord.cs @@ -193,19 +193,19 @@ public void RefreshValue(RemoteProcess process) ValueStr = FormatValue(buffer[0], ShowValueHexadecimal); break; case ScanValueType.Short: - ValueStr = FormatValue(BitConverter.ToInt16(buffer, 0), ShowValueHexadecimal); + ValueStr = FormatValue(process.BitConverter.ToInt16(buffer, 0), ShowValueHexadecimal); break; case ScanValueType.Integer: - ValueStr = FormatValue(BitConverter.ToInt32(buffer, 0), ShowValueHexadecimal); + ValueStr = FormatValue(process.BitConverter.ToInt32(buffer, 0), ShowValueHexadecimal); break; case ScanValueType.Long: - ValueStr = FormatValue(BitConverter.ToInt64(buffer, 0), ShowValueHexadecimal); + ValueStr = FormatValue(process.BitConverter.ToInt64(buffer, 0), ShowValueHexadecimal); break; case ScanValueType.Float: - ValueStr = FormatValue(BitConverter.ToSingle(buffer, 0)); + ValueStr = FormatValue(process.BitConverter.ToSingle(buffer, 0)); break; case ScanValueType.Double: - ValueStr = FormatValue(BitConverter.ToDouble(buffer, 0)); + ValueStr = FormatValue(process.BitConverter.ToDouble(buffer, 0)); break; case ScanValueType.ArrayOfBytes: ValueStr = FormatValue(buffer); @@ -241,16 +241,16 @@ public void SetValue(RemoteProcess process, string input, bool isHex) switch (ValueType) { case ScanValueType.Byte: - data = BitConverter.GetBytes((byte)value); + data = process.BitConverter.GetBytes((byte)value); break; case ScanValueType.Short: - data = BitConverter.GetBytes((short)value); + data = process.BitConverter.GetBytes((short)value); break; case ScanValueType.Integer: - data = BitConverter.GetBytes((int)value); + data = process.BitConverter.GetBytes((int)value); break; case ScanValueType.Long: - data = BitConverter.GetBytes(value); + data = process.BitConverter.GetBytes(value); break; } } @@ -262,10 +262,10 @@ public void SetValue(RemoteProcess process, string input, bool isHex) switch (ValueType) { case ScanValueType.Float: - data = BitConverter.GetBytes((float)value); + data = process.BitConverter.GetBytes((float)value); break; case ScanValueType.Double: - data = BitConverter.GetBytes(value); + data = process.BitConverter.GetBytes(value); break; } } diff --git a/ReClass.NET_Tests/MemoryScanner/Comparer/FloatMemoryComparerTest.cs b/ReClass.NET_Tests/MemoryScanner/Comparer/FloatMemoryComparerTest.cs index 5084f442..b9824d4d 100644 --- a/ReClass.NET_Tests/MemoryScanner/Comparer/FloatMemoryComparerTest.cs +++ b/ReClass.NET_Tests/MemoryScanner/Comparer/FloatMemoryComparerTest.cs @@ -1,13 +1,16 @@ -using System; +using System; using NFluent; using ReClassNET.MemoryScanner; using ReClassNET.MemoryScanner.Comparer; +using ReClassNET.Util.Conversion; using Xunit; namespace ReClass.NET_Tests.MemoryScanner.Comparer { public class FloatMemoryComparerTest { + private static EndianBitConverter BitConverter { get; } = EndianBitConverter.System; + [Theory] [InlineData(ScanCompareType.Equal, ScanRoundMode.Normal, 0.0f, 0.0f)] [InlineData(ScanCompareType.Equal, ScanRoundMode.Strict, 1.0f, 2.0f)] @@ -17,7 +20,7 @@ public class FloatMemoryComparerTest [InlineData(ScanCompareType.NotEqual, ScanRoundMode.Truncate, 0.0f, 0.0f)] public void TestConstructor(ScanCompareType compareType, ScanRoundMode roundMode, float value1, float value2) { - var sut = new FloatMemoryComparer(compareType, roundMode, 1, value1, value2); + var sut = new FloatMemoryComparer(compareType, roundMode, 1, value1, value2, BitConverter); Check.That(sut.CompareType).IsEqualTo(compareType); Check.That(sut.RoundType).IsEqualTo(roundMode); @@ -35,7 +38,7 @@ public void TestConstructorSignificantDigits(int significantDigits) const float Value1 = 1.234567f; const float Value2 = 7.654321f; - var sut = new FloatMemoryComparer(ScanCompareType.Equal, ScanRoundMode.Normal, significantDigits, Value1, Value2); + var sut = new FloatMemoryComparer(ScanCompareType.Equal, ScanRoundMode.Normal, significantDigits, Value1, Value2, BitConverter); Check.That(sut.Value1).IsEqualTo((float)Math.Round(Value1, significantDigits, MidpointRounding.AwayFromZero)); Check.That(sut.Value2).IsEqualTo((float)Math.Round(Value2, significantDigits, MidpointRounding.AwayFromZero)); @@ -74,7 +77,7 @@ public void TestConstructorSignificantDigits(int significantDigits) [MemberData(nameof(GetTestCompareScanCompareTypeUnknownData))] public void TestCompare(ScanCompareType compareType, float value1, float value2, byte[] data, bool expectedResult, ScanResult expectedScanResult) { - var sut = new FloatMemoryComparer(compareType, ScanRoundMode.Normal, 1, value1, value2); + var sut = new FloatMemoryComparer(compareType, ScanRoundMode.Normal, 1, value1, value2, BitConverter); Check.That(sut.Compare(data, 0, out var scanResult)).IsEqualTo(expectedResult); Check.That(scanResult).IsEqualTo(expectedScanResult); @@ -93,7 +96,7 @@ public void TestCompare(ScanCompareType compareType, float value1, float value2, [InlineData(ScanCompareType.IncreasedOrEqual)] public void TestCompareInvalidCompareTypeThrows(ScanCompareType compareType) { - var sut = new FloatMemoryComparer(compareType, ScanRoundMode.Normal, 1, 0.0f, 0.0f); + var sut = new FloatMemoryComparer(compareType, ScanRoundMode.Normal, 1, 0.0f, 0.0f, BitConverter); Check.ThatCode(() => sut.Compare(BitConverter.GetBytes(0.0f), 0, out _)).Throws(); } @@ -109,7 +112,7 @@ public void TestCompareInvalidCompareTypeThrows(ScanCompareType compareType) [MemberData(nameof(GetTestCompareThrowsData))] public void TestCompareInvalidDataThrows(byte[] data, int index, Type expectedExceptionType) { - var sut = new FloatMemoryComparer(ScanCompareType.Unknown, ScanRoundMode.Normal, 1, 0.0f, 0.0f); + var sut = new FloatMemoryComparer(ScanCompareType.Unknown, ScanRoundMode.Normal, 1, 0.0f, 0.0f, BitConverter); Check.ThatCode(() => sut.Compare(data, index, out _)).ThrowsType(expectedExceptionType); } @@ -149,7 +152,7 @@ public static TheoryData sut.Compare(BitConverter.GetBytes(0.0f), 0, new FloatScanResult(0.0f), out _)).Throws(); } diff --git a/ReClass.NET_Tests/MemoryScanner/Comparer/IntegerMemoryComparerTest.cs b/ReClass.NET_Tests/MemoryScanner/Comparer/IntegerMemoryComparerTest.cs index acbfd201..0d6b8e1d 100644 --- a/ReClass.NET_Tests/MemoryScanner/Comparer/IntegerMemoryComparerTest.cs +++ b/ReClass.NET_Tests/MemoryScanner/Comparer/IntegerMemoryComparerTest.cs @@ -1,13 +1,16 @@ -using System; +using System; using NFluent; using ReClassNET.MemoryScanner; using ReClassNET.MemoryScanner.Comparer; +using ReClassNET.Util.Conversion; using Xunit; namespace ReClass.NET_Tests.MemoryScanner.Comparer { public class IntegerMemoryComparerTest { + private static EndianBitConverter BitConverter { get; } = EndianBitConverter.System; + [Theory] [InlineData(ScanCompareType.Equal, 0, 0)] [InlineData(ScanCompareType.Equal, 1, 2)] @@ -17,7 +20,7 @@ public class IntegerMemoryComparerTest [InlineData(ScanCompareType.NotEqual, 0, 0)] public void TestConstructor(ScanCompareType compareType, int value1, int value2) { - var sut = new IntegerMemoryComparer(compareType, value1, value2); + var sut = new IntegerMemoryComparer(compareType, value1, value2, BitConverter); Check.That(sut.CompareType).IsEqualTo(compareType); Check.That(sut.ValueSize).IsEqualTo(sizeof(int)); @@ -64,7 +67,7 @@ public void TestConstructor(ScanCompareType compareType, int value1, int value2) [MemberData(nameof(GetTestCompareScanCompareTypeUnknownData))] public void TestCompare(ScanCompareType compareType, int value1, int value2, byte[] data, bool expectedResult, ScanResult expectedScanResult) { - var sut = new IntegerMemoryComparer(compareType, value1, value2); + var sut = new IntegerMemoryComparer(compareType, value1, value2, BitConverter); Check.That(sut.Compare(data, 0, out var scanResult)).IsEqualTo(expectedResult); Check.That(scanResult).IsEqualTo(expectedScanResult); @@ -83,7 +86,7 @@ public void TestCompare(ScanCompareType compareType, int value1, int value2, byt [InlineData(ScanCompareType.IncreasedOrEqual)] public void TestCompareInvalidCompareTypeThrows(ScanCompareType compareType) { - var sut = new IntegerMemoryComparer(compareType, 0, 0); + var sut = new IntegerMemoryComparer(compareType, 0, 0, BitConverter); Check.ThatCode(() => sut.Compare(BitConverter.GetBytes(0), 0, out _)).Throws(); } @@ -101,7 +104,7 @@ public void TestCompareInvalidCompareTypeThrows(ScanCompareType compareType) [MemberData(nameof(GetTestCompareThrowsData))] public void TestCompareInvalidDataThrows(byte[] data, int index, Type expectedExceptionType) { - var sut = new IntegerMemoryComparer(ScanCompareType.Equal, 0, 0); + var sut = new IntegerMemoryComparer(ScanCompareType.Equal, 0, 0, BitConverter); Check.ThatCode(() => sut.Compare(data, index, out _)).ThrowsType(expectedExceptionType); } @@ -141,7 +144,7 @@ public static TheoryData sut.Compare(BitConverter.GetBytes(0), 0, new IntegerScanResult(0), out _)).Throws(); } diff --git a/ReClass.NET_Tests/MemoryScanner/Comparer/LongMemoryComparerTest.cs b/ReClass.NET_Tests/MemoryScanner/Comparer/LongMemoryComparerTest.cs index f2790648..a298ebb3 100644 --- a/ReClass.NET_Tests/MemoryScanner/Comparer/LongMemoryComparerTest.cs +++ b/ReClass.NET_Tests/MemoryScanner/Comparer/LongMemoryComparerTest.cs @@ -1,13 +1,16 @@ -using System; +using System; using NFluent; using ReClassNET.MemoryScanner; using ReClassNET.MemoryScanner.Comparer; +using ReClassNET.Util.Conversion; using Xunit; namespace ReClass.NET_Tests.MemoryScanner.Comparer { public class LongMemoryComparerTest { + private static EndianBitConverter BitConverter { get; } = EndianBitConverter.System; + [Theory] [InlineData(ScanCompareType.Equal, 0L, 0L)] [InlineData(ScanCompareType.Equal, 1L, 2L)] @@ -17,7 +20,7 @@ public class LongMemoryComparerTest [InlineData(ScanCompareType.NotEqual, 0L, 0L)] public void TestConstructor(ScanCompareType compareType, long value1, long value2) { - var sut = new LongMemoryComparer(compareType, value1, value2); + var sut = new LongMemoryComparer(compareType, value1, value2, BitConverter); Check.That(sut.CompareType).IsEqualTo(compareType); Check.That(sut.ValueSize).IsEqualTo(sizeof(long)); @@ -64,7 +67,7 @@ public void TestConstructor(ScanCompareType compareType, long value1, long value [MemberData(nameof(GetTestCompareScanCompareTypeUnknownData))] public void TestCompare(ScanCompareType compareType, long value1, long value2, byte[] data, bool expectedResult, ScanResult expectedScanResult) { - var sut = new LongMemoryComparer(compareType, value1, value2); + var sut = new LongMemoryComparer(compareType, value1, value2, BitConverter); Check.That(sut.Compare(data, 0, out var scanResult)).IsEqualTo(expectedResult); Check.That(scanResult).IsEqualTo(expectedScanResult); @@ -83,7 +86,7 @@ public void TestCompare(ScanCompareType compareType, long value1, long value2, b [InlineData(ScanCompareType.IncreasedOrEqual)] public void TestCompareInvalidCompareTypeThrows(ScanCompareType compareType) { - var sut = new LongMemoryComparer(compareType, 0L, 0L); + var sut = new LongMemoryComparer(compareType, 0L, 0L, BitConverter); Check.ThatCode(() => sut.Compare(BitConverter.GetBytes(0L), 0, out _)).Throws(); } @@ -101,7 +104,7 @@ public void TestCompareInvalidCompareTypeThrows(ScanCompareType compareType) [MemberData(nameof(GetTestCompareThrowsData))] public void TestCompareInvalidDataThrows(byte[] data, int index, Type expectedExceptionType) { - var sut = new LongMemoryComparer(ScanCompareType.Equal, 0L, 0L); + var sut = new LongMemoryComparer(ScanCompareType.Equal, 0L, 0L, BitConverter); Check.ThatCode(() => sut.Compare(data, index, out _)).ThrowsType(expectedExceptionType); } @@ -141,7 +144,7 @@ public static TheoryData sut.Compare(BitConverter.GetBytes(0L), 0, new LongScanResult(0L), out _)).Throws(); } diff --git a/ReClass.NET_Tests/MemoryScanner/Comparer/ShortMemoryComparerTest.cs b/ReClass.NET_Tests/MemoryScanner/Comparer/ShortMemoryComparerTest.cs index 7c3109fe..b87f37ef 100644 --- a/ReClass.NET_Tests/MemoryScanner/Comparer/ShortMemoryComparerTest.cs +++ b/ReClass.NET_Tests/MemoryScanner/Comparer/ShortMemoryComparerTest.cs @@ -1,13 +1,16 @@ -using System; +using System; using NFluent; using ReClassNET.MemoryScanner; using ReClassNET.MemoryScanner.Comparer; +using ReClassNET.Util.Conversion; using Xunit; namespace ReClass.NET_Tests.MemoryScanner.Comparer { public class ShortMemoryComparerTest { + private static EndianBitConverter BitConverter { get; } = EndianBitConverter.System; + [Theory] [InlineData(ScanCompareType.Equal, 0, 0)] [InlineData(ScanCompareType.Equal, 1, 2)] @@ -17,7 +20,7 @@ public class ShortMemoryComparerTest [InlineData(ScanCompareType.NotEqual, 0, 0)] public void TestConstructor(ScanCompareType compareType, short value1, short value2) { - var sut = new ShortMemoryComparer(compareType, value1, value2); + var sut = new ShortMemoryComparer(compareType, value1, value2, BitConverter); Check.That(sut.CompareType).IsEqualTo(compareType); Check.That(sut.ValueSize).IsEqualTo(sizeof(short)); @@ -64,7 +67,7 @@ public void TestConstructor(ScanCompareType compareType, short value1, short val [MemberData(nameof(GetTestCompareScanCompareTypeUnknownData))] public void TestCompare(ScanCompareType compareType, short value1, short value2, byte[] data, bool expectedResult, ScanResult expectedScanResult) { - var sut = new ShortMemoryComparer(compareType, value1, value2); + var sut = new ShortMemoryComparer(compareType, value1, value2, BitConverter); Check.That(sut.Compare(data, 0, out var scanResult)).IsEqualTo(expectedResult); Check.That(scanResult).IsEqualTo(expectedScanResult); @@ -83,7 +86,7 @@ public void TestCompare(ScanCompareType compareType, short value1, short value2, [InlineData(ScanCompareType.IncreasedOrEqual)] public void TestCompareInvalidCompareTypeThrows(ScanCompareType compareType) { - var sut = new ShortMemoryComparer(compareType, 0, 0); + var sut = new ShortMemoryComparer(compareType, 0, 0, BitConverter); Check.ThatCode(() => sut.Compare(BitConverter.GetBytes((short)0), 0, out _)).Throws(); } @@ -101,7 +104,7 @@ public void TestCompareInvalidCompareTypeThrows(ScanCompareType compareType) [MemberData(nameof(GetTestCompareThrowsData))] public void TestCompareInvalidDataThrows(byte[] data, int index, Type expectedExceptionType) { - var sut = new ShortMemoryComparer(ScanCompareType.Equal, 0, 0); + var sut = new ShortMemoryComparer(ScanCompareType.Equal, 0, 0, BitConverter); Check.ThatCode(() => sut.Compare(data, index, out _)).ThrowsType(expectedExceptionType); } @@ -141,7 +144,7 @@ public static TheoryData sut.Compare(BitConverter.GetBytes((short)0), 0, new ShortScanResult(0), out _)).Throws(); } From 4c50197e7cdfe88b0c7f03a73d84a2e3506d6f7c Mon Sep 17 00:00:00 2001 From: KN4CK3R Date: Sun, 22 Nov 2020 22:05:24 +0100 Subject: [PATCH 200/223] Added converter switch to menu. --- ReClass.NET/Forms/MainForm.Designer.cs | 105 +++++++++++++++---------- ReClass.NET/Forms/MainForm.cs | 7 ++ 2 files changed, 69 insertions(+), 43 deletions(-) diff --git a/ReClass.NET/Forms/MainForm.Designer.cs b/ReClass.NET/Forms/MainForm.Designer.cs index 71a1a118..e2b2a199 100644 --- a/ReClass.NET/Forms/MainForm.Designer.cs +++ b/ReClass.NET/Forms/MainForm.Designer.cs @@ -34,7 +34,7 @@ private void InitializeComponent() System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MainForm)); this.processUpdateTimer = new System.Windows.Forms.Timer(this.components); this.splitContainer = new System.Windows.Forms.SplitContainer(); - this.projectView = new ProjectView(); + this.projectView = new ReClassNET.Controls.ProjectView(); this.projectClassContextMenuStrip = new System.Windows.Forms.ContextMenuStrip(this.components); this.deleteClassToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.toolStripSeparator19 = new System.Windows.Forms.ToolStripSeparator(); @@ -53,26 +53,26 @@ private void InitializeComponent() this.editEnumToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.projectEnumsContextMenuStrip = new System.Windows.Forms.ContextMenuStrip(this.components); this.editEnumsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.memoryViewControl = new MemoryViewControl(); + this.memoryViewControl = new ReClassNET.Controls.MemoryViewControl(); this.selectedNodeContextMenuStrip = new System.Windows.Forms.ContextMenuStrip(this.components); this.changeTypeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.addBytesToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.integerToolStripMenuItem1 = new IntegerToolStripMenuItem(); - this.integerToolStripMenuItem2 = new IntegerToolStripMenuItem(); - this.integerToolStripMenuItem3 = new IntegerToolStripMenuItem(); - this.integerToolStripMenuItem4 = new IntegerToolStripMenuItem(); - this.integerToolStripMenuItem5 = new IntegerToolStripMenuItem(); - this.integerToolStripMenuItem6 = new IntegerToolStripMenuItem(); - this.integerToolStripMenuItem7 = new IntegerToolStripMenuItem(); + this.integerToolStripMenuItem1 = new ReClassNET.Controls.IntegerToolStripMenuItem(); + this.integerToolStripMenuItem2 = new ReClassNET.Controls.IntegerToolStripMenuItem(); + this.integerToolStripMenuItem3 = new ReClassNET.Controls.IntegerToolStripMenuItem(); + this.integerToolStripMenuItem4 = new ReClassNET.Controls.IntegerToolStripMenuItem(); + this.integerToolStripMenuItem5 = new ReClassNET.Controls.IntegerToolStripMenuItem(); + this.integerToolStripMenuItem6 = new ReClassNET.Controls.IntegerToolStripMenuItem(); + this.integerToolStripMenuItem7 = new ReClassNET.Controls.IntegerToolStripMenuItem(); this.toolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem(); this.insertBytesToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.integerToolStripMenuItem8 = new IntegerToolStripMenuItem(); - this.integerToolStripMenuItem9 = new IntegerToolStripMenuItem(); - this.integerToolStripMenuItem10 = new IntegerToolStripMenuItem(); - this.integerToolStripMenuItem11 = new IntegerToolStripMenuItem(); - this.integerToolStripMenuItem12 = new IntegerToolStripMenuItem(); - this.integerToolStripMenuItem13 = new IntegerToolStripMenuItem(); - this.integerToolStripMenuItem14 = new IntegerToolStripMenuItem(); + this.integerToolStripMenuItem8 = new ReClassNET.Controls.IntegerToolStripMenuItem(); + this.integerToolStripMenuItem9 = new ReClassNET.Controls.IntegerToolStripMenuItem(); + this.integerToolStripMenuItem10 = new ReClassNET.Controls.IntegerToolStripMenuItem(); + this.integerToolStripMenuItem11 = new ReClassNET.Controls.IntegerToolStripMenuItem(); + this.integerToolStripMenuItem12 = new ReClassNET.Controls.IntegerToolStripMenuItem(); + this.integerToolStripMenuItem13 = new ReClassNET.Controls.IntegerToolStripMenuItem(); + this.integerToolStripMenuItem14 = new ReClassNET.Controls.IntegerToolStripMenuItem(); this.toolStripMenuItem2 = new System.Windows.Forms.ToolStripMenuItem(); this.toolStripSeparator8 = new System.Windows.Forms.ToolStripSeparator(); this.createClassFromNodesToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); @@ -107,22 +107,22 @@ private void InitializeComponent() this.toolStripSeparator7 = new System.Windows.Forms.ToolStripSeparator(); this.newClassToolStripButton = new System.Windows.Forms.ToolStripButton(); this.addBytesToolStripDropDownButton = new System.Windows.Forms.ToolStripDropDownButton(); - this.add4BytesToolStripMenuItem = new IntegerToolStripMenuItem(); - this.add8BytesToolStripMenuItem = new IntegerToolStripMenuItem(); - this.add64BytesToolStripMenuItem = new IntegerToolStripMenuItem(); - this.add256BytesToolStripMenuItem = new IntegerToolStripMenuItem(); - this.add1024BytesToolStripMenuItem = new IntegerToolStripMenuItem(); - this.add2048BytesToolStripMenuItem = new IntegerToolStripMenuItem(); - this.add4096BytesToolStripMenuItem = new IntegerToolStripMenuItem(); + this.add4BytesToolStripMenuItem = new ReClassNET.Controls.IntegerToolStripMenuItem(); + this.add8BytesToolStripMenuItem = new ReClassNET.Controls.IntegerToolStripMenuItem(); + this.add64BytesToolStripMenuItem = new ReClassNET.Controls.IntegerToolStripMenuItem(); + this.add256BytesToolStripMenuItem = new ReClassNET.Controls.IntegerToolStripMenuItem(); + this.add1024BytesToolStripMenuItem = new ReClassNET.Controls.IntegerToolStripMenuItem(); + this.add2048BytesToolStripMenuItem = new ReClassNET.Controls.IntegerToolStripMenuItem(); + this.add4096BytesToolStripMenuItem = new ReClassNET.Controls.IntegerToolStripMenuItem(); this.addXBytesToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.insertBytesToolStripDropDownButton = new System.Windows.Forms.ToolStripDropDownButton(); - this.insert4BytesToolStripMenuItem = new IntegerToolStripMenuItem(); - this.insert8BytesToolStripMenuItem = new IntegerToolStripMenuItem(); - this.insert64BytesToolStripMenuItem = new IntegerToolStripMenuItem(); - this.insert256BytesToolStripMenuItem = new IntegerToolStripMenuItem(); - this.insert1024BytesToolStripMenuItem = new IntegerToolStripMenuItem(); - this.insert2048BytesToolStripMenuItem = new IntegerToolStripMenuItem(); - this.insert4096BytesToolStripMenuItem = new IntegerToolStripMenuItem(); + this.insert4BytesToolStripMenuItem = new ReClassNET.Controls.IntegerToolStripMenuItem(); + this.insert8BytesToolStripMenuItem = new ReClassNET.Controls.IntegerToolStripMenuItem(); + this.insert64BytesToolStripMenuItem = new ReClassNET.Controls.IntegerToolStripMenuItem(); + this.insert256BytesToolStripMenuItem = new ReClassNET.Controls.IntegerToolStripMenuItem(); + this.insert1024BytesToolStripMenuItem = new ReClassNET.Controls.IntegerToolStripMenuItem(); + this.insert2048BytesToolStripMenuItem = new ReClassNET.Controls.IntegerToolStripMenuItem(); + this.insert4096BytesToolStripMenuItem = new ReClassNET.Controls.IntegerToolStripMenuItem(); this.insertXBytesToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.nodeTypesToolStripSeparator = new System.Windows.Forms.ToolStripSeparator(); this.statusStrip = new System.Windows.Forms.StatusStrip(); @@ -149,6 +149,8 @@ private void InitializeComponent() this.processInformationsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.memorySearcherToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.namedAddressesToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripSeparator23 = new System.Windows.Forms.ToolStripSeparator(); + this.isLittleEndianToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.toolStripSeparator17 = new System.Windows.Forms.ToolStripSeparator(); this.loadSymbolToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.loadSymbolsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); @@ -215,7 +217,7 @@ private void InitializeComponent() this.projectView.Name = "projectView"; this.projectView.Size = new System.Drawing.Size(201, 524); this.projectView.TabIndex = 0; - this.projectView.SelectionChanged += new ProjectView.SelectionChangedEvent(this.classesView_ClassSelected); + this.projectView.SelectionChanged += new ReClassNET.Controls.ProjectView.SelectionChangedEvent(this.classesView_ClassSelected); // // projectClassContextMenuStrip // @@ -273,33 +275,33 @@ private void InitializeComponent() this.toolStripSeparator22, this.addNewClassToolStripMenuItem}); this.projectClassesContextMenuStrip.Name = "rootContextMenuStrip"; - this.projectClassesContextMenuStrip.Size = new System.Drawing.Size(221, 126); + this.projectClassesContextMenuStrip.Size = new System.Drawing.Size(222, 126); // // enableHierarchyViewToolStripMenuItem // this.enableHierarchyViewToolStripMenuItem.Name = "enableHierarchyViewToolStripMenuItem"; - this.enableHierarchyViewToolStripMenuItem.Size = new System.Drawing.Size(220, 22); + this.enableHierarchyViewToolStripMenuItem.Size = new System.Drawing.Size(221, 22); this.enableHierarchyViewToolStripMenuItem.Text = "Enable hierarchy view"; this.enableHierarchyViewToolStripMenuItem.Click += new System.EventHandler(this.enableHierarchyViewToolStripMenuItem_Click); // // autoExpandHierarchyViewToolStripMenuItem // this.autoExpandHierarchyViewToolStripMenuItem.Name = "autoExpandHierarchyViewToolStripMenuItem"; - this.autoExpandHierarchyViewToolStripMenuItem.Size = new System.Drawing.Size(220, 22); + this.autoExpandHierarchyViewToolStripMenuItem.Size = new System.Drawing.Size(221, 22); this.autoExpandHierarchyViewToolStripMenuItem.Text = "Auto expand hierarchy view"; this.autoExpandHierarchyViewToolStripMenuItem.Click += new System.EventHandler(this.autoExpandHierarchyViewToolStripMenuItem_Click); // // toolStripSeparator21 // this.toolStripSeparator21.Name = "toolStripSeparator21"; - this.toolStripSeparator21.Size = new System.Drawing.Size(217, 6); + this.toolStripSeparator21.Size = new System.Drawing.Size(218, 6); // // expandAllClassesToolStripMenuItem // this.expandAllClassesToolStripMenuItem.Enabled = false; this.expandAllClassesToolStripMenuItem.Image = global::ReClassNET.Properties.Resources.B16x16_Tree_Expand; this.expandAllClassesToolStripMenuItem.Name = "expandAllClassesToolStripMenuItem"; - this.expandAllClassesToolStripMenuItem.Size = new System.Drawing.Size(220, 22); + this.expandAllClassesToolStripMenuItem.Size = new System.Drawing.Size(221, 22); this.expandAllClassesToolStripMenuItem.Text = "Expand all classes"; this.expandAllClassesToolStripMenuItem.Click += new System.EventHandler(this.expandAllClassesToolStripMenuItem_Click); // @@ -308,20 +310,20 @@ private void InitializeComponent() this.collapseAllClassesToolStripMenuItem.Enabled = false; this.collapseAllClassesToolStripMenuItem.Image = global::ReClassNET.Properties.Resources.B16x16_Tree_Collapse; this.collapseAllClassesToolStripMenuItem.Name = "collapseAllClassesToolStripMenuItem"; - this.collapseAllClassesToolStripMenuItem.Size = new System.Drawing.Size(220, 22); + this.collapseAllClassesToolStripMenuItem.Size = new System.Drawing.Size(221, 22); this.collapseAllClassesToolStripMenuItem.Text = "Collapse all classes"; this.collapseAllClassesToolStripMenuItem.Click += new System.EventHandler(this.collapseAllClassesToolStripMenuItem_Click); // // toolStripSeparator22 // this.toolStripSeparator22.Name = "toolStripSeparator22"; - this.toolStripSeparator22.Size = new System.Drawing.Size(217, 6); + this.toolStripSeparator22.Size = new System.Drawing.Size(218, 6); // // addNewClassToolStripMenuItem // this.addNewClassToolStripMenuItem.Image = global::ReClassNET.Properties.Resources.B16x16_Button_Class_Add; this.addNewClassToolStripMenuItem.Name = "addNewClassToolStripMenuItem"; - this.addNewClassToolStripMenuItem.Size = new System.Drawing.Size(220, 22); + this.addNewClassToolStripMenuItem.Size = new System.Drawing.Size(221, 22); this.addNewClassToolStripMenuItem.Text = "Add new class"; this.addNewClassToolStripMenuItem.Click += new System.EventHandler(this.newClassToolStripButton_Click); // @@ -364,11 +366,11 @@ private void InitializeComponent() this.memoryViewControl.NodeContextMenuStrip = this.selectedNodeContextMenuStrip; this.memoryViewControl.Size = new System.Drawing.Size(936, 524); this.memoryViewControl.TabIndex = 0; - this.memoryViewControl.DrawContextRequested += new DrawContextRequestEventHandler(this.memoryViewControl_DrawContextRequested); + this.memoryViewControl.DrawContextRequested += new ReClassNET.Controls.DrawContextRequestEventHandler(this.memoryViewControl_DrawContextRequested); this.memoryViewControl.SelectionChanged += new System.EventHandler(this.memoryViewControl_SelectionChanged); - this.memoryViewControl.ChangeClassTypeClick += new NodeClickEventHandler(this.memoryViewControl_ChangeClassTypeClick); - this.memoryViewControl.ChangeWrappedTypeClick += new NodeClickEventHandler(this.memoryViewControl_ChangeWrappedTypeClick); - this.memoryViewControl.ChangeEnumTypeClick += new NodeClickEventHandler(this.memoryViewControl_ChangeEnumTypeClick); + this.memoryViewControl.ChangeClassTypeClick += new ReClassNET.Controls.NodeClickEventHandler(this.memoryViewControl_ChangeClassTypeClick); + this.memoryViewControl.ChangeWrappedTypeClick += new ReClassNET.Controls.NodeClickEventHandler(this.memoryViewControl_ChangeWrappedTypeClick); + this.memoryViewControl.ChangeEnumTypeClick += new ReClassNET.Controls.NodeClickEventHandler(this.memoryViewControl_ChangeEnumTypeClick); this.memoryViewControl.KeyDown += new System.Windows.Forms.KeyEventHandler(this.memoryViewControl_KeyDown); // // selectedNodeContextMenuStrip @@ -1190,6 +1192,8 @@ private void InitializeComponent() this.processInformationsToolStripMenuItem, this.memorySearcherToolStripMenuItem, this.namedAddressesToolStripMenuItem, + this.toolStripSeparator23, + this.isLittleEndianToolStripMenuItem, this.toolStripSeparator17, this.loadSymbolToolStripMenuItem, this.loadSymbolsToolStripMenuItem, @@ -1225,6 +1229,19 @@ private void InitializeComponent() this.namedAddressesToolStripMenuItem.Text = "Named Addresses..."; this.namedAddressesToolStripMenuItem.Click += new System.EventHandler(this.namedAddressesToolStripMenuItem_Click); // + // toolStripSeparator23 + // + this.toolStripSeparator23.Name = "toolStripSeparator23"; + this.toolStripSeparator23.Size = new System.Drawing.Size(191, 6); + // + // isLittleEndianToolStripMenuItem + // + this.isLittleEndianToolStripMenuItem.CheckOnClick = true; + this.isLittleEndianToolStripMenuItem.Name = "isLittleEndianToolStripMenuItem"; + this.isLittleEndianToolStripMenuItem.Size = new System.Drawing.Size(194, 22); + this.isLittleEndianToolStripMenuItem.Text = "Is Little Endian"; + this.isLittleEndianToolStripMenuItem.Click += new System.EventHandler(this.isLittleEndianToolStripMenuItem_Click); + // // toolStripSeparator17 // this.toolStripSeparator17.Name = "toolStripSeparator17"; @@ -1523,6 +1540,8 @@ private void InitializeComponent() private System.Windows.Forms.ContextMenuStrip projectEnumsContextMenuStrip; private System.Windows.Forms.ToolStripMenuItem editEnumsToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem showEnumsToolStripMenuItem; + private System.Windows.Forms.ToolStripSeparator toolStripSeparator23; + private System.Windows.Forms.ToolStripMenuItem isLittleEndianToolStripMenuItem; } } diff --git a/ReClass.NET/Forms/MainForm.cs b/ReClass.NET/Forms/MainForm.cs index bff83d26..e9a18b38 100644 --- a/ReClass.NET/Forms/MainForm.cs +++ b/ReClass.NET/Forms/MainForm.cs @@ -21,6 +21,7 @@ using ReClassNET.Project; using ReClassNET.UI; using ReClassNET.Util; +using ReClassNET.Util.Conversion; namespace ReClassNET.Forms { @@ -78,6 +79,7 @@ public MainForm() mainMenuStrip.Renderer = new CustomToolStripProfessionalRenderer(true, true); toolStrip.Renderer = new CustomToolStripProfessionalRenderer(true, false); + isLittleEndianToolStripMenuItem.Checked = BitConverter.IsLittleEndian; Program.RemoteProcess.ProcessAttached += sender => { @@ -351,6 +353,11 @@ private void namedAddressesToolStripMenuItem_Click(object sender, EventArgs e) new NamedAddressesForm(Program.RemoteProcess).Show(); } + private void isLittleEndianToolStripMenuItem_Click(object sender, EventArgs e) + { + Program.RemoteProcess.BitConverter = isLittleEndianToolStripMenuItem.Checked ? (EndianBitConverter)EndianBitConverter.Little : EndianBitConverter.Big; + } + private void loadSymbolToolStripMenuItem_Click(object sender, EventArgs e) { using var ofd = new OpenFileDialog From e7d0513cb46a61b42b18743e44cb508079e70f75 Mon Sep 17 00:00:00 2001 From: KN4CK3R Date: Mon, 23 Nov 2020 14:20:31 +0100 Subject: [PATCH 201/223] Filter null pointers. --- ReClass.NET/Nodes/BaseHexCommentNode.cs | 103 ++++++++++++------------ 1 file changed, 53 insertions(+), 50 deletions(-) diff --git a/ReClass.NET/Nodes/BaseHexCommentNode.cs b/ReClass.NET/Nodes/BaseHexCommentNode.cs index ca1421e1..f2a4053f 100644 --- a/ReClass.NET/Nodes/BaseHexCommentNode.cs +++ b/ReClass.NET/Nodes/BaseHexCommentNode.cs @@ -31,75 +31,78 @@ protected int AddComment(DrawContext view, int x, int y, float fvalue, IntPtr iv } } - var namedAddress = view.Process.GetNamedAddress(ivalue); - if (!string.IsNullOrEmpty(namedAddress)) + if (ivalue != IntPtr.Zero) { - if (view.Settings.ShowCommentPointer) + var namedAddress = view.Process.GetNamedAddress(ivalue); + if (!string.IsNullOrEmpty(namedAddress)) { - x = AddText(view, x, y, view.Settings.OffsetColor, HotSpot.NoneId, "->") + view.Font.Width; - x = AddText(view, x, y, view.Settings.OffsetColor, HotSpot.ReadOnlyId, namedAddress) + view.Font.Width; - } - - if (view.Settings.ShowCommentRtti) - { - var rtti = view.Process.ReadRemoteRuntimeTypeInformation(ivalue); - if (!string.IsNullOrEmpty(rtti)) + if (view.Settings.ShowCommentPointer) { - x = AddText(view, x, y, view.Settings.OffsetColor, HotSpot.ReadOnlyId, rtti) + view.Font.Width; + x = AddText(view, x, y, view.Settings.OffsetColor, HotSpot.NoneId, "->") + view.Font.Width; + x = AddText(view, x, y, view.Settings.OffsetColor, HotSpot.ReadOnlyId, namedAddress) + view.Font.Width; } - } - if (view.Settings.ShowCommentSymbol) - { - var module = view.Process.GetModuleToPointer(ivalue); - if (module != null) + if (view.Settings.ShowCommentRtti) { - var symbols = view.Process.Symbols.GetSymbolsForModule(module); - var symbol = symbols?.GetSymbolString(ivalue, module); - if (!string.IsNullOrEmpty(symbol)) + var rtti = view.Process.ReadRemoteRuntimeTypeInformation(ivalue); + if (!string.IsNullOrEmpty(rtti)) { - x = AddText(view, x, y, view.Settings.OffsetColor, HotSpot.ReadOnlyId, symbol) + view.Font.Width; + x = AddText(view, x, y, view.Settings.OffsetColor, HotSpot.ReadOnlyId, rtti) + view.Font.Width; } } - } - if (view.Settings.ShowCommentString) - { - var data = view.Process.ReadRemoteMemory(ivalue, 64); - - var isWideString = false; - string text = null; - - // First check if it could be an UTF8 string and if not try UTF16. - if (data.Take(IntPtr.Size).InterpretAsSingleByteCharacter().IsPrintableData()) + if (view.Settings.ShowCommentSymbol) { - text = new string(Encoding.UTF8.GetChars(data).TakeWhile(c => c != 0).ToArray()); + var module = view.Process.GetModuleToPointer(ivalue); + if (module != null) + { + var symbols = view.Process.Symbols.GetSymbolsForModule(module); + var symbol = symbols?.GetSymbolString(ivalue, module); + if (!string.IsNullOrEmpty(symbol)) + { + x = AddText(view, x, y, view.Settings.OffsetColor, HotSpot.ReadOnlyId, symbol) + view.Font.Width; + } + } } - else if(data.Take(IntPtr.Size * 2).InterpretAsDoubleByteCharacter().IsPrintableData()) + + if (view.Settings.ShowCommentString) { - isWideString = true; + var data = view.Process.ReadRemoteMemory(ivalue, 64); - text = new string(Encoding.Unicode.GetChars(data).TakeWhile(c => c != 0).ToArray()); - } + var isWideString = false; + string text = null; - if (text != null) - { - x = AddText(view, x, y, view.Settings.TextColor, HotSpot.NoneId, isWideString ? "L'" : "'"); - x = AddText(view, x, y, view.Settings.TextColor, HotSpot.ReadOnlyId, text); - x = AddText(view, x, y, view.Settings.TextColor, HotSpot.NoneId, "'") + view.Font.Width; - } - } + // First check if it could be an UTF8 string and if not try UTF16. + if (data.Take(IntPtr.Size).InterpretAsSingleByteCharacter().IsPrintableData()) + { + text = new string(Encoding.UTF8.GetChars(data).TakeWhile(c => c != 0).ToArray()); + } + else if (data.Take(IntPtr.Size * 2).InterpretAsDoubleByteCharacter().IsPrintableData()) + { + isWideString = true; - if (view.Settings.ShowCommentPluginInfo) - { - var nodeAddress = view.Address + Offset; + text = new string(Encoding.Unicode.GetChars(data).TakeWhile(c => c != 0).ToArray()); + } + + if (text != null) + { + x = AddText(view, x, y, view.Settings.TextColor, HotSpot.NoneId, isWideString ? "L'" : "'"); + x = AddText(view, x, y, view.Settings.TextColor, HotSpot.ReadOnlyId, text); + x = AddText(view, x, y, view.Settings.TextColor, HotSpot.NoneId, "'") + view.Font.Width; + } + } - foreach (var reader in NodeInfoReader) + if (view.Settings.ShowCommentPluginInfo) { - var info = reader.ReadNodeInfo(this, view.Process, view.Memory, nodeAddress, ivalue); - if (info != null) + var nodeAddress = view.Address + Offset; + + foreach (var reader in NodeInfoReader) { - x = AddText(view, x, y, view.Settings.PluginColor, HotSpot.ReadOnlyId, info) + view.Font.Width; + var info = reader.ReadNodeInfo(this, view.Process, view.Memory, nodeAddress, ivalue); + if (info != null) + { + x = AddText(view, x, y, view.Settings.PluginColor, HotSpot.ReadOnlyId, info) + view.Font.Width; + } } } } From e968a2908f3f53a42be61a27a61552f0e91fdc4a Mon Sep 17 00:00:00 2001 From: KN4CK3R Date: Mon, 23 Nov 2020 14:35:14 +0100 Subject: [PATCH 202/223] Reduced IRemoteMemoryReader interface size. --- ReClass.NET/AddressParser/DynamicCompiler.cs | 45 ++--- .../IRemoteMemoryReaderExtension.cs | 146 +++++++++++++++ ReClass.NET/Memory/IRemoteMemoryReader.cs | 70 -------- ReClass.NET/Memory/RemoteProcess.cs | 168 ++---------------- ReClass.NET/Nodes/BaseTextPtrNode.cs | 3 +- ReClass.NET/ReClass.NET.csproj | 3 +- .../AddressParser/ExecutorTest.cs | 3 +- 7 files changed, 183 insertions(+), 255 deletions(-) create mode 100644 ReClass.NET/Extensions/IRemoteMemoryReaderExtension.cs diff --git a/ReClass.NET/AddressParser/DynamicCompiler.cs b/ReClass.NET/AddressParser/DynamicCompiler.cs index 44896bbd..5a23f586 100644 --- a/ReClass.NET/AddressParser/DynamicCompiler.cs +++ b/ReClass.NET/AddressParser/DynamicCompiler.cs @@ -29,10 +29,12 @@ public static Func CompileExpression(IExpression express ).Compile(); } - private static Expression GenerateMethodBody(IExpression expression, Expression parameter) + private static Expression GenerateMethodBody(IExpression expression, Expression processParameter) { Contract.Requires(expression != null); - Contract.Requires(parameter != null); + Contract.Requires(processParameter != null); + + static MethodInfo GetIntPtrExtension(string name) => typeof(IntPtrExtension).GetRuntimeMethod(name, new[] { typeof(IntPtr), typeof(IntPtr) }); switch (expression) { @@ -44,7 +46,7 @@ private static Expression GenerateMethodBody(IExpression expression, Expression } case NegateExpression negateExpression: { - var argument = GenerateMethodBody(negateExpression.Expression, parameter); + var argument = GenerateMethodBody(negateExpression.Expression, processParameter); var negateFn = typeof(IntPtrExtension).GetRuntimeMethod(nameof(IntPtrExtension.Negate), new[] { typeof(IntPtr) }); @@ -52,29 +54,29 @@ private static Expression GenerateMethodBody(IExpression expression, Expression } case AddExpression addExpression: { - var argument1 = GenerateMethodBody(addExpression.Lhs, parameter); - var argument2 = GenerateMethodBody(addExpression.Rhs, parameter); + var argument1 = GenerateMethodBody(addExpression.Lhs, processParameter); + var argument2 = GenerateMethodBody(addExpression.Rhs, processParameter); return Expression.Call(null, GetIntPtrExtension(nameof(IntPtrExtension.Add)), argument1, argument2); } case SubtractExpression subtractExpression: { - var argument1 = GenerateMethodBody(subtractExpression.Lhs, parameter); - var argument2 = GenerateMethodBody(subtractExpression.Rhs, parameter); + var argument1 = GenerateMethodBody(subtractExpression.Lhs, processParameter); + var argument2 = GenerateMethodBody(subtractExpression.Rhs, processParameter); return Expression.Call(null, GetIntPtrExtension(nameof(IntPtrExtension.Sub)), argument1, argument2); } case MultiplyExpression multiplyExpression: { - var argument1 = GenerateMethodBody(multiplyExpression.Lhs, parameter); - var argument2 = GenerateMethodBody(multiplyExpression.Rhs, parameter); + var argument1 = GenerateMethodBody(multiplyExpression.Lhs, processParameter); + var argument2 = GenerateMethodBody(multiplyExpression.Rhs, processParameter); return Expression.Call(null, GetIntPtrExtension(nameof(IntPtrExtension.Mul)), argument1, argument2); } case DivideExpression divideExpression: { - var argument1 = GenerateMethodBody(divideExpression.Lhs, parameter); - var argument2 = GenerateMethodBody(divideExpression.Rhs, parameter); + var argument1 = GenerateMethodBody(divideExpression.Lhs, processParameter); + var argument2 = GenerateMethodBody(divideExpression.Rhs, processParameter); return Expression.Call(null, GetIntPtrExtension(nameof(IntPtrExtension.Div)), argument1, argument2); } @@ -84,7 +86,7 @@ private static Expression GenerateMethodBody(IExpression expression, Expression var moduleNameConstant = Expression.Constant(moduleExpression.Name); var moduleVariable = Expression.Variable(typeof(Memory.Module)); - var assignExpression = Expression.Assign(moduleVariable, Expression.Call(parameter, getModuleByNameFunc, moduleNameConstant)); + var assignExpression = Expression.Assign(moduleVariable, Expression.Call(processParameter, getModuleByNameFunc, moduleNameConstant)); return Expression.Block( new[] { moduleVariable }, @@ -98,28 +100,15 @@ private static Expression GenerateMethodBody(IExpression expression, Expression } case ReadMemoryExpression readMemoryExpression: { - var argument = GenerateMethodBody(readMemoryExpression.Expression, parameter); - - var functionName = readMemoryExpression.ByteCount == 4 ? nameof(IRemoteMemoryReader.ReadRemoteInt32) : nameof(IRemoteMemoryReader.ReadRemoteInt64); - var readRemoteIntFn = typeof(IRemoteMemoryReader).GetRuntimeMethod(functionName, new[] { typeof(IntPtr) }); + var addressParameter = GenerateMethodBody(readMemoryExpression.Expression, processParameter); - var callExpression = Expression.Call(parameter, readRemoteIntFn, argument); + var readRemoteIntPtrFn = typeof(IRemoteMemoryReaderExtension).GetRuntimeMethod(nameof(IRemoteMemoryReaderExtension.ReadRemoteIntPtr), new[] { typeof(IRemoteMemoryReader), typeof(IntPtr) }); - var paramType = readMemoryExpression.ByteCount == 4 ? typeof(int) : typeof(long); - var convertFn = typeof(IntPtrExtension).GetRuntimeMethod(nameof(IntPtrExtension.From), new[] { paramType }); - - return Expression.Call(null, convertFn, callExpression); + return Expression.Call(null, readRemoteIntPtrFn, processParameter, addressParameter); } } throw new ArgumentException($"Unsupported operation '{expression.GetType().FullName}'."); } - - private static MethodInfo GetIntPtrExtension(string name) - { - Contract.Requires(name != null); - - return typeof(IntPtrExtension).GetRuntimeMethod(name, new[] { typeof(IntPtr), typeof(IntPtr) }); - } } } diff --git a/ReClass.NET/Extensions/IRemoteMemoryReaderExtension.cs b/ReClass.NET/Extensions/IRemoteMemoryReaderExtension.cs new file mode 100644 index 00000000..b8f36bab --- /dev/null +++ b/ReClass.NET/Extensions/IRemoteMemoryReaderExtension.cs @@ -0,0 +1,146 @@ +using System; +using System.Diagnostics.Contracts; +using System.Text; +using ReClassNET.Memory; +using ReClassNET.MemoryScanner; + +namespace ReClassNET.Extensions +{ + public static class IRemoteMemoryReaderExtension + { + public static sbyte ReadRemoteInt8(this IRemoteMemoryReader reader, IntPtr address) + { + var data = reader.ReadRemoteMemory(address, sizeof(sbyte)); + + return (sbyte)data[0]; + } + + public static byte ReadRemoteUInt8(this IRemoteMemoryReader reader, IntPtr address) + { + var data = reader.ReadRemoteMemory(address, sizeof(byte)); + + return data[0]; + } + + public static short ReadRemoteInt16(this IRemoteMemoryReader reader, IntPtr address) + { + var data = reader.ReadRemoteMemory(address, sizeof(short)); + + return reader.BitConverter.ToInt16(data, 0); + } + + public static ushort ReadRemoteUInt16(this IRemoteMemoryReader reader, IntPtr address) + { + var data = reader.ReadRemoteMemory(address, sizeof(ushort)); + + return reader.BitConverter.ToUInt16(data, 0); + } + + public static int ReadRemoteInt32(this IRemoteMemoryReader reader, IntPtr address) + { + var data = reader.ReadRemoteMemory(address, sizeof(int)); + + return reader.BitConverter.ToInt32(data, 0); + } + + public static uint ReadRemoteUInt32(this IRemoteMemoryReader reader, IntPtr address) + { + var data = reader.ReadRemoteMemory(address, sizeof(uint)); + + return reader.BitConverter.ToUInt32(data, 0); + } + + public static long ReadRemoteInt64(this IRemoteMemoryReader reader, IntPtr address) + { + var data = reader.ReadRemoteMemory(address, sizeof(long)); + + return reader.BitConverter.ToInt64(data, 0); + } + + public static ulong ReadRemoteUInt64(this IRemoteMemoryReader reader, IntPtr address) + { + var data = reader.ReadRemoteMemory(address, sizeof(ulong)); + + return reader.BitConverter.ToUInt64(data, 0); + } + + public static float ReadRemoteFloat(this IRemoteMemoryReader reader, IntPtr address) + { + var data = reader.ReadRemoteMemory(address, sizeof(float)); + + return reader.BitConverter.ToSingle(data, 0); + } + + public static double ReadRemoteDouble(this IRemoteMemoryReader reader, IntPtr address) + { + var data = reader.ReadRemoteMemory(address, sizeof(double)); + + return reader.BitConverter.ToDouble(data, 0); + } + + public static IntPtr ReadRemoteIntPtr(this IRemoteMemoryReader reader, IntPtr address) + { +#if RECLASSNET64 + return (IntPtr)reader.ReadRemoteInt64(address); +#else + return (IntPtr)reader.ReadRemoteInt32(address); +#endif + } + + public static string ReadRemoteString(this IRemoteMemoryReader reader, IntPtr address, Encoding encoding, int length) + { + Contract.Requires(encoding != null); + Contract.Requires(length >= 0); + Contract.Ensures(Contract.Result() != null); + + var data = reader.ReadRemoteMemory(address, length * encoding.GuessByteCountPerChar()); + + try + { + var sb = new StringBuilder(encoding.GetString(data)); + for (var i = 0; i < sb.Length; ++i) + { + if (sb[i] == '\0') + { + sb.Length = i; + break; + } + if (!sb[i].IsPrintable()) + { + sb[i] = '.'; + } + } + return sb.ToString(); + } + catch + { + return string.Empty; + } + } + + public static string ReadRemoteStringUntilFirstNullCharacter(this IRemoteMemoryReader reader, IntPtr address, Encoding encoding, int length) + { + Contract.Requires(encoding != null); + Contract.Requires(length >= 0); + Contract.Ensures(Contract.Result() != null); + + var data = reader.ReadRemoteMemory(address, length * encoding.GuessByteCountPerChar()); + + // TODO We should cache the pattern per encoding. + var index = PatternScanner.FindPattern(BytePattern.From(new byte[encoding.GuessByteCountPerChar()]), data); + if (index == -1) + { + index = data.Length; + } + + try + { + return encoding.GetString(data, 0, Math.Min(index, data.Length)); + } + catch + { + return string.Empty; + } + } + } +} diff --git a/ReClass.NET/Memory/IRemoteMemoryReader.cs b/ReClass.NET/Memory/IRemoteMemoryReader.cs index ed514ddd..f60a4aaf 100644 --- a/ReClass.NET/Memory/IRemoteMemoryReader.cs +++ b/ReClass.NET/Memory/IRemoteMemoryReader.cs @@ -1,5 +1,4 @@ using System; -using System.Text; using ReClassNET.Util.Conversion; namespace ReClassNET.Memory @@ -26,75 +25,6 @@ public interface IRemoteMemoryReader /// An array of bytes. byte[] ReadRemoteMemory(IntPtr address, int size); - /// Reads a from the address in the remote process. - /// The address to read from. - /// The data read as or 0 if the read fails. - sbyte ReadRemoteInt8(IntPtr address); - - /// Reads a from the address in the remote process. - /// The address to read from. - /// The data read as or 0 if the read fails. - byte ReadRemoteUInt8(IntPtr address); - - /// Reads a from the address in the remote process. - /// The address to read from. - /// The data read as or 0 if the read fails. - short ReadRemoteInt16(IntPtr address); - - /// Reads a from the address in the remote process. - /// The address to read from. - /// The data read as or 0 if the read fails. - ushort ReadRemoteUInt16(IntPtr address); - - /// Reads a from the address in the remote process. - /// The address to read from. - /// The data read as or 0 if the read fails. - int ReadRemoteInt32(IntPtr address); - - /// Reads a from the address in the remote process. - /// The address to read from. - /// The data read as or 0 if the read fails. - uint ReadRemoteUInt32(IntPtr address); - - /// Reads a from the address in the remote process. - /// The address to read from. - /// The data read as or 0 if the read fails. - long ReadRemoteInt64(IntPtr address); - - /// Reads a from the address in the remote process. - /// The address to read from. - /// The data read as or 0 if the read fails. - ulong ReadRemoteUInt64(IntPtr address); - - /// Reads a from the address in the remote process. - /// The address to read from. - /// The data read as or 0 if the read fails. - float ReadRemoteFloat(IntPtr address); - - /// Reads a from the address in the remote process. - /// The address to read from. - /// The data read as or 0 if the read fails. - double ReadRemoteDouble(IntPtr address); - - /// Reads a from the address in the remote process. - /// The address to read from. - /// The data read as or 0 if the read fails. - IntPtr ReadRemoteIntPtr(IntPtr address); - - /// Reads a string from the address in the remote process with the given length using the provided encoding. - /// The encoding used by the string. - /// The address of the string. - /// The length of the string. - /// The string. - string ReadRemoteString(Encoding encoding, IntPtr address, int length); - - /// Reads a string from the address in the remote process with the given length and encoding. The string gets truncated at the first zero character. - /// The encoding used by the string. - /// The address of the string. - /// The maximum length of the string. - /// The string. - string ReadRemoteStringUntilFirstNullCharacter(Encoding encoding, IntPtr address, int length); - /// Reads remote runtime type information for the given address from the remote process. /// The address. /// A string containing the runtime type information or null if no information could get found. diff --git a/ReClass.NET/Memory/RemoteProcess.cs b/ReClass.NET/Memory/RemoteProcess.cs index bebdf175..55aa6d83 100644 --- a/ReClass.NET/Memory/RemoteProcess.cs +++ b/ReClass.NET/Memory/RemoteProcess.cs @@ -10,7 +10,6 @@ using ReClassNET.Core; using ReClassNET.Debugger; using ReClassNET.Extensions; -using ReClassNET.MemoryScanner; using ReClassNET.Native; using ReClassNET.Symbols; using ReClassNET.Util.Conversion; @@ -188,152 +187,13 @@ public byte[] ReadRemoteMemory(IntPtr address, int size) return data; } - #region Read Remote Primitive Types - - public sbyte ReadRemoteInt8(IntPtr address) - { - var data = ReadRemoteMemory(address, sizeof(sbyte)); - - return (sbyte)data[0]; - } - - public byte ReadRemoteUInt8(IntPtr address) - { - var data = ReadRemoteMemory(address, sizeof(byte)); - - return data[0]; - } - - public short ReadRemoteInt16(IntPtr address) - { - var data = ReadRemoteMemory(address, sizeof(short)); - - return BitConverter.ToInt16(data, 0); - } - - public ushort ReadRemoteUInt16(IntPtr address) - { - var data = ReadRemoteMemory(address, sizeof(ushort)); - - return BitConverter.ToUInt16(data, 0); - } - - public int ReadRemoteInt32(IntPtr address) - { - var data = ReadRemoteMemory(address, sizeof(int)); - - return BitConverter.ToInt32(data, 0); - } - - public uint ReadRemoteUInt32(IntPtr address) - { - var data = ReadRemoteMemory(address, sizeof(uint)); - - return BitConverter.ToUInt32(data, 0); - } - - public long ReadRemoteInt64(IntPtr address) - { - var data = ReadRemoteMemory(address, sizeof(long)); - - return BitConverter.ToInt64(data, 0); - } - - public ulong ReadRemoteUInt64(IntPtr address) - { - var data = ReadRemoteMemory(address, sizeof(ulong)); - - return BitConverter.ToUInt64(data, 0); - } - - public float ReadRemoteFloat(IntPtr address) - { - var data = ReadRemoteMemory(address, sizeof(float)); - - return BitConverter.ToSingle(data, 0); - } - - public double ReadRemoteDouble(IntPtr address) - { - var data = ReadRemoteMemory(address, sizeof(double)); - - return BitConverter.ToDouble(data, 0); - } - - public IntPtr ReadRemoteIntPtr(IntPtr address) - { -#if RECLASSNET64 - return (IntPtr)ReadRemoteInt64(address); -#else - return (IntPtr)ReadRemoteInt32(address); -#endif - } - - #endregion - - public string ReadRemoteString(Encoding encoding, IntPtr address, int length) - { - Contract.Requires(encoding != null); - Contract.Requires(length >= 0); - Contract.Ensures(Contract.Result() != null); - - var data = ReadRemoteMemory(address, length * encoding.GuessByteCountPerChar()); - - try - { - var sb = new StringBuilder(encoding.GetString(data)); - for (var i = 0; i < sb.Length; ++i) - { - if (sb[i] == '\0') - { - sb.Length = i; - break; - } - if (!sb[i].IsPrintable()) - { - sb[i] = '.'; - } - } - return sb.ToString(); - } - catch - { - return string.Empty; - } - } - - public string ReadRemoteStringUntilFirstNullCharacter(Encoding encoding, IntPtr address, int length) - { - Contract.Requires(encoding != null); - Contract.Requires(length >= 0); - Contract.Ensures(Contract.Result() != null); - - var data = ReadRemoteMemory(address, length * encoding.GuessByteCountPerChar()); - - // TODO We should cache the pattern per encoding. - var index = PatternScanner.FindPattern(BytePattern.From(new byte[encoding.GuessByteCountPerChar()]), data); - if (index == -1) - { - index = data.Length; - } - - try - { - return encoding.GetString(data, 0, Math.Min(index, data.Length)); - } - catch - { - return string.Empty; - } - } - public string ReadRemoteRuntimeTypeInformation(IntPtr address) { if (address.MayBeValid()) { if (!rttiCache.TryGetValue(address, out var rtti)) { - var objectLocatorPtr = ReadRemoteIntPtr(address - IntPtr.Size); + var objectLocatorPtr = this.ReadRemoteIntPtr(address - IntPtr.Size); if (objectLocatorPtr.MayBeValid()) { @@ -354,25 +214,25 @@ public string ReadRemoteRuntimeTypeInformation(IntPtr address) private string ReadRemoteRuntimeTypeInformation32(IntPtr address) { - var classHierarchyDescriptorPtr = ReadRemoteIntPtr(address + 0x10); + var classHierarchyDescriptorPtr = this.ReadRemoteIntPtr(address + 0x10); if (classHierarchyDescriptorPtr.MayBeValid()) { - var baseClassCount = ReadRemoteInt32(classHierarchyDescriptorPtr + 8); + var baseClassCount = this.ReadRemoteInt32(classHierarchyDescriptorPtr + 8); if (baseClassCount > 0 && baseClassCount < 25) { - var baseClassArrayPtr = ReadRemoteIntPtr(classHierarchyDescriptorPtr + 0xC); + var baseClassArrayPtr = this.ReadRemoteIntPtr(classHierarchyDescriptorPtr + 0xC); if (baseClassArrayPtr.MayBeValid()) { var sb = new StringBuilder(); for (var i = 0; i < baseClassCount; ++i) { - var baseClassDescriptorPtr = ReadRemoteIntPtr(baseClassArrayPtr + (4 * i)); + var baseClassDescriptorPtr = this.ReadRemoteIntPtr(baseClassArrayPtr + (4 * i)); if (baseClassDescriptorPtr.MayBeValid()) { - var typeDescriptorPtr = ReadRemoteIntPtr(baseClassDescriptorPtr); + var typeDescriptorPtr = this.ReadRemoteIntPtr(baseClassDescriptorPtr); if (typeDescriptorPtr.MayBeValid()) { - var name = ReadRemoteStringUntilFirstNullCharacter(Encoding.UTF8, typeDescriptorPtr + 0x0C, 60); + var name = this.ReadRemoteStringUntilFirstNullCharacter(typeDescriptorPtr + 0x0C, Encoding.UTF8, 60); if (name.EndsWith("@@")) { name = NativeMethods.UndecorateSymbolName("?" + name); @@ -403,20 +263,20 @@ private string ReadRemoteRuntimeTypeInformation32(IntPtr address) private string ReadRemoteRuntimeTypeInformation64(IntPtr address) { - int baseOffset = ReadRemoteInt32(address + 0x14); + int baseOffset = this.ReadRemoteInt32(address + 0x14); if (baseOffset != 0) { var baseAddress = address - baseOffset; - var classHierarchyDescriptorOffset = ReadRemoteInt32(address + 0x10); + var classHierarchyDescriptorOffset = this.ReadRemoteInt32(address + 0x10); if (classHierarchyDescriptorOffset != 0) { var classHierarchyDescriptorPtr = baseAddress + classHierarchyDescriptorOffset; - var baseClassCount = ReadRemoteInt32(classHierarchyDescriptorPtr + 0x08); + var baseClassCount = this.ReadRemoteInt32(classHierarchyDescriptorPtr + 0x08); if (baseClassCount > 0 && baseClassCount < 25) { - var baseClassArrayOffset = ReadRemoteInt32(classHierarchyDescriptorPtr + 0x0C); + var baseClassArrayOffset = this.ReadRemoteInt32(classHierarchyDescriptorPtr + 0x0C); if (baseClassArrayOffset != 0) { var baseClassArrayPtr = baseAddress + baseClassArrayOffset; @@ -424,17 +284,17 @@ private string ReadRemoteRuntimeTypeInformation64(IntPtr address) var sb = new StringBuilder(); for (var i = 0; i < baseClassCount; ++i) { - var baseClassDescriptorOffset = ReadRemoteInt32(baseClassArrayPtr + (4 * i)); + var baseClassDescriptorOffset = this.ReadRemoteInt32(baseClassArrayPtr + (4 * i)); if (baseClassDescriptorOffset != 0) { var baseClassDescriptorPtr = baseAddress + baseClassDescriptorOffset; - var typeDescriptorOffset = ReadRemoteInt32(baseClassDescriptorPtr); + var typeDescriptorOffset = this.ReadRemoteInt32(baseClassDescriptorPtr); if (typeDescriptorOffset != 0) { var typeDescriptorPtr = baseAddress + typeDescriptorOffset; - var name = ReadRemoteStringUntilFirstNullCharacter(Encoding.UTF8, typeDescriptorPtr + 0x14, 60); + var name = this.ReadRemoteStringUntilFirstNullCharacter(typeDescriptorPtr + 0x14, Encoding.UTF8, 60); if (string.IsNullOrEmpty(name)) { break; diff --git a/ReClass.NET/Nodes/BaseTextPtrNode.cs b/ReClass.NET/Nodes/BaseTextPtrNode.cs index 95096602..d7b00238 100644 --- a/ReClass.NET/Nodes/BaseTextPtrNode.cs +++ b/ReClass.NET/Nodes/BaseTextPtrNode.cs @@ -3,6 +3,7 @@ using System.Drawing; using System.Text; using ReClassNET.Controls; +using ReClassNET.Extensions; using ReClassNET.UI; namespace ReClassNET.Nodes @@ -33,7 +34,7 @@ public Size DrawText(DrawContext context, int x, int y, string type) } var ptr = context.Memory.ReadIntPtr(Offset); - var text = context.Process.ReadRemoteString(Encoding, ptr, MaxStringCharacterCount); + var text = context.Process.ReadRemoteString(ptr, Encoding, MaxStringCharacterCount); var origX = x; diff --git a/ReClass.NET/ReClass.NET.csproj b/ReClass.NET/ReClass.NET.csproj index be3a033a..1914f3cf 100644 --- a/ReClass.NET/ReClass.NET.csproj +++ b/ReClass.NET/ReClass.NET.csproj @@ -1,4 +1,4 @@ - + @@ -173,6 +173,7 @@ + diff --git a/ReClass.NET_Tests/AddressParser/ExecutorTest.cs b/ReClass.NET_Tests/AddressParser/ExecutorTest.cs index 748eac5a..6f203bc4 100644 --- a/ReClass.NET_Tests/AddressParser/ExecutorTest.cs +++ b/ReClass.NET_Tests/AddressParser/ExecutorTest.cs @@ -1,8 +1,9 @@ -using System; +using System; using System.Collections.Generic; using Moq; using NFluent; using ReClassNET.AddressParser; +using ReClassNET.Extensions; using ReClassNET.Memory; using Xunit; From cb74eb50f68548aacd1cc37641001e6be377bd6e Mon Sep 17 00:00:00 2001 From: KN4CK3R Date: Mon, 23 Nov 2020 15:07:20 +0100 Subject: [PATCH 203/223] Restored old functionality. --- ReClass.NET/AddressParser/DynamicCompiler.cs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/ReClass.NET/AddressParser/DynamicCompiler.cs b/ReClass.NET/AddressParser/DynamicCompiler.cs index 5a23f586..2ffd110b 100644 --- a/ReClass.NET/AddressParser/DynamicCompiler.cs +++ b/ReClass.NET/AddressParser/DynamicCompiler.cs @@ -102,9 +102,15 @@ private static Expression GenerateMethodBody(IExpression expression, Expression { var addressParameter = GenerateMethodBody(readMemoryExpression.Expression, processParameter); - var readRemoteIntPtrFn = typeof(IRemoteMemoryReaderExtension).GetRuntimeMethod(nameof(IRemoteMemoryReaderExtension.ReadRemoteIntPtr), new[] { typeof(IRemoteMemoryReader), typeof(IntPtr) }); + var functionName = readMemoryExpression.ByteCount == 4 ? nameof(IRemoteMemoryReaderExtension.ReadRemoteInt32) : nameof(IRemoteMemoryReaderExtension.ReadRemoteInt64); + var readRemoteIntPtrFn = typeof(IRemoteMemoryReaderExtension).GetRuntimeMethod(functionName, new[] { typeof(IRemoteMemoryReader), typeof(IntPtr) }); - return Expression.Call(null, readRemoteIntPtrFn, processParameter, addressParameter); + var callExpression = Expression.Call(null, readRemoteIntPtrFn, processParameter, addressParameter); + + var paramType = readMemoryExpression.ByteCount == 4 ? typeof(int) : typeof(long); + var convertFn = typeof(IntPtrExtension).GetRuntimeMethod(nameof(IntPtrExtension.From), new[] { paramType }); + + return Expression.Call(null, convertFn, callExpression); } } From 9041ff4243ddc328af13d7cfe6b1373c9080c80a Mon Sep 17 00:00:00 2001 From: KN4CK3R Date: Mon, 23 Nov 2020 15:09:36 +0100 Subject: [PATCH 204/223] Adjusted tests. --- .../AddressParser/ExecutorTest.cs | 57 ++++++++++++------- 1 file changed, 36 insertions(+), 21 deletions(-) diff --git a/ReClass.NET_Tests/AddressParser/ExecutorTest.cs b/ReClass.NET_Tests/AddressParser/ExecutorTest.cs index 6f203bc4..75de668e 100644 --- a/ReClass.NET_Tests/AddressParser/ExecutorTest.cs +++ b/ReClass.NET_Tests/AddressParser/ExecutorTest.cs @@ -3,8 +3,8 @@ using Moq; using NFluent; using ReClassNET.AddressParser; -using ReClassNET.Extensions; using ReClassNET.Memory; +using ReClassNET.Util.Conversion; using Xunit; namespace ReClass.NET_Tests.AddressParser @@ -76,15 +76,20 @@ public void ModuleExpressionTest(string expression, IntPtr expected) [MemberData(nameof(GetReadMemoryExpressionTestData), 4)] public void ReadMemoryExpression32Test(string expression, IntPtr expected) { + var converter = EndianBitConverter.System; + var mock = new Mock(); - mock.Setup(p => p.ReadRemoteInt32((IntPtr)0)) - .Returns(0); - mock.Setup(p => p.ReadRemoteInt32((IntPtr)0x10)) - .Returns(0x10); - mock.Setup(p => p.ReadRemoteInt32((IntPtr)0x20)) - .Returns(0x20); - mock.Setup(p => p.ReadRemoteInt32((IntPtr)0x30)) - .Returns(0x30); + mock.SetupProperty(p => p.BitConverter) + .SetupGet(p => p.BitConverter) + .Returns(converter); + mock.Setup(p => p.ReadRemoteMemory((IntPtr)0, sizeof(int))) + .Returns(converter.GetBytes(0)); + mock.Setup(p => p.ReadRemoteMemory((IntPtr)0x10, sizeof(int))) + .Returns(converter.GetBytes(0x10)); + mock.Setup(p => p.ReadRemoteMemory((IntPtr)0x20, sizeof(int))) + .Returns(converter.GetBytes(0x20)); + mock.Setup(p => p.ReadRemoteMemory((IntPtr)0x30, sizeof(int))) + .Returns(converter.GetBytes(0x30)); var executor = CreateExecutor(); @@ -95,15 +100,20 @@ public void ReadMemoryExpression32Test(string expression, IntPtr expected) [MemberData(nameof(GetReadMemoryExpressionTestData), 8)] public void ReadMemoryExpression64Test(string expression, IntPtr expected) { + var converter = EndianBitConverter.System; + var mock = new Mock(); - mock.Setup(p => p.ReadRemoteInt64((IntPtr)0)) - .Returns(0); - mock.Setup(p => p.ReadRemoteInt64((IntPtr)0x10)) - .Returns(0x10); - mock.Setup(p => p.ReadRemoteInt64((IntPtr)0x20)) - .Returns(0x20); - mock.Setup(p => p.ReadRemoteInt64((IntPtr)0x30)) - .Returns(0x30); + mock.SetupProperty(p => p.BitConverter) + .SetupGet(p => p.BitConverter) + .Returns(converter); + mock.Setup(p => p.ReadRemoteMemory((IntPtr)0, sizeof(long))) + .Returns(converter.GetBytes(0L)); + mock.Setup(p => p.ReadRemoteMemory((IntPtr)0x10, sizeof(long))) + .Returns(converter.GetBytes(0x10L)); + mock.Setup(p => p.ReadRemoteMemory((IntPtr)0x20, sizeof(long))) + .Returns(converter.GetBytes(0x20L)); + mock.Setup(p => p.ReadRemoteMemory((IntPtr)0x30, sizeof(long))) + .Returns(converter.GetBytes(0x30L)); var executor = CreateExecutor(); @@ -113,11 +123,16 @@ public void ReadMemoryExpression64Test(string expression, IntPtr expected) [Fact] public void ReadMemoryExpressionInvariantTest() { + var converter = EndianBitConverter.System; + var mock = new Mock(); - mock.Setup(p => p.ReadRemoteInt32((IntPtr)0x10)) - .Returns(0x10); - mock.Setup(p => p.ReadRemoteInt64((IntPtr)0x10)) - .Returns(0x10); + mock.SetupProperty(p => p.BitConverter) + .SetupGet(p => p.BitConverter) + .Returns(converter); + mock.Setup(p => p.ReadRemoteMemory((IntPtr)0x10, sizeof(int))) + .Returns(converter.GetBytes(0x10)); + mock.Setup(p => p.ReadRemoteMemory((IntPtr)0x10, sizeof(long))) + .Returns(converter.GetBytes(0x10L)); var executor = CreateExecutor(); From 774ec6f94a86426d70c76fc26d68e95caaa3696c Mon Sep 17 00:00:00 2001 From: KN4CK3R Date: Mon, 23 Nov 2020 22:14:01 +0100 Subject: [PATCH 205/223] Replaced generic method with normal methods. --- .../IRemoteMemoryWriterExtension.cs | 40 +++++++++++++++++++ ReClass.NET/Memory/IRemoteMemoryWriter.cs | 8 +--- ReClass.NET/Memory/RemoteProcess.cs | 11 ----- ReClass.NET/Nodes/BaseMatrixNode.cs | 1 + ReClass.NET/Nodes/BitFieldNode.cs | 1 + ReClass.NET/Nodes/BoolNode.cs | 1 + ReClass.NET/Nodes/DoubleNode.cs | 1 + ReClass.NET/Nodes/FloatNode.cs | 1 + ReClass.NET/ReClass.NET.csproj | 1 + 9 files changed, 47 insertions(+), 18 deletions(-) create mode 100644 ReClass.NET/Extensions/IRemoteMemoryWriterExtension.cs diff --git a/ReClass.NET/Extensions/IRemoteMemoryWriterExtension.cs b/ReClass.NET/Extensions/IRemoteMemoryWriterExtension.cs new file mode 100644 index 00000000..c587a2d1 --- /dev/null +++ b/ReClass.NET/Extensions/IRemoteMemoryWriterExtension.cs @@ -0,0 +1,40 @@ +using System; +using System.Text; +using ReClassNET.Memory; + +namespace ReClassNET.Extensions +{ + public static class IRemoteMemoryWriterExtension + { + public static void WriteRemoteMemory(this IRemoteMemoryWriter writer, IntPtr address, sbyte value) => writer.WriteRemoteMemory(address, writer.BitConverter.GetBytes(value)); + + public static void WriteRemoteMemory(this IRemoteMemoryWriter writer, IntPtr address, byte value) => writer.WriteRemoteMemory(address, writer.BitConverter.GetBytes(value)); + + public static void WriteRemoteMemory(this IRemoteMemoryWriter writer, IntPtr address, short value) => writer.WriteRemoteMemory(address, writer.BitConverter.GetBytes(value)); + + public static void WriteRemoteMemory(this IRemoteMemoryWriter writer, IntPtr address, ushort value) => writer.WriteRemoteMemory(address, writer.BitConverter.GetBytes(value)); + + public static void WriteRemoteMemory(this IRemoteMemoryWriter writer, IntPtr address, int value) => writer.WriteRemoteMemory(address, writer.BitConverter.GetBytes(value)); + + public static void WriteRemoteMemory(this IRemoteMemoryWriter writer, IntPtr address, uint value) => writer.WriteRemoteMemory(address, writer.BitConverter.GetBytes(value)); + + public static void WriteRemoteMemory(this IRemoteMemoryWriter writer, IntPtr address, long value) => writer.WriteRemoteMemory(address, writer.BitConverter.GetBytes(value)); + + public static void WriteRemoteMemory(this IRemoteMemoryWriter writer, IntPtr address, ulong value) => writer.WriteRemoteMemory(address, writer.BitConverter.GetBytes(value)); + + public static void WriteRemoteMemory(this IRemoteMemoryWriter writer, IntPtr address, float value) => writer.WriteRemoteMemory(address, writer.BitConverter.GetBytes(value)); + + public static void WriteRemoteMemory(this IRemoteMemoryWriter writer, IntPtr address, double value) => writer.WriteRemoteMemory(address, writer.BitConverter.GetBytes(value)); + + public static void WriteRemoteMemory(this IRemoteMemoryWriter writer, IntPtr address, IntPtr value) + { +#if RECLASSNET64 + writer.WriteRemoteMemory(address, value.ToInt64()); +#else + writer.WriteRemoteMemory(address, value.ToInt32()); +#endif + } + + public static void WriteRemoteMemory(this IRemoteMemoryWriter writer, IntPtr address, string value, Encoding encoding) => writer.WriteRemoteMemory(address, encoding.GetBytes(value)); + } +} diff --git a/ReClass.NET/Memory/IRemoteMemoryWriter.cs b/ReClass.NET/Memory/IRemoteMemoryWriter.cs index 57bba946..fc895b3a 100644 --- a/ReClass.NET/Memory/IRemoteMemoryWriter.cs +++ b/ReClass.NET/Memory/IRemoteMemoryWriter.cs @@ -1,4 +1,5 @@ using System; +using System.Text; using ReClassNET.Util.Conversion; namespace ReClassNET.Memory @@ -12,12 +13,5 @@ public interface IRemoteMemoryWriter /// The data to write. /// True if it succeeds, false if it fails. bool WriteRemoteMemory(IntPtr address, byte[] data); - - /// Writes the given to the in the remote process. - /// Type of the value to write. - /// The address to write to. - /// The value to write. - /// True if it succeeds, false if it fails. - bool WriteRemoteMemory(IntPtr address, T value) where T : struct; } } diff --git a/ReClass.NET/Memory/RemoteProcess.cs b/ReClass.NET/Memory/RemoteProcess.cs index 55aa6d83..0f994e20 100644 --- a/ReClass.NET/Memory/RemoteProcess.cs +++ b/ReClass.NET/Memory/RemoteProcess.cs @@ -345,17 +345,6 @@ public bool WriteRemoteMemory(IntPtr address, byte[] data) return coreFunctions.WriteRemoteMemory(handle, address, ref data, 0, data.Length); } - public bool WriteRemoteMemory(IntPtr address, T value) where T : struct - { - var data = new byte[Marshal.SizeOf()]; - - var gcHandle = GCHandle.Alloc(data, GCHandleType.Pinned); - Marshal.StructureToPtr(value, gcHandle.AddrOfPinnedObject(), false); - gcHandle.Free(); - - return WriteRemoteMemory(address, data); - } - #endregion public Section GetSectionToPointer(IntPtr address) diff --git a/ReClass.NET/Nodes/BaseMatrixNode.cs b/ReClass.NET/Nodes/BaseMatrixNode.cs index d080b08d..84929c5e 100644 --- a/ReClass.NET/Nodes/BaseMatrixNode.cs +++ b/ReClass.NET/Nodes/BaseMatrixNode.cs @@ -2,6 +2,7 @@ using System.Diagnostics.Contracts; using System.Drawing; using ReClassNET.Controls; +using ReClassNET.Extensions; using ReClassNET.UI; namespace ReClassNET.Nodes diff --git a/ReClass.NET/Nodes/BitFieldNode.cs b/ReClass.NET/Nodes/BitFieldNode.cs index 8f302fda..22461c37 100644 --- a/ReClass.NET/Nodes/BitFieldNode.cs +++ b/ReClass.NET/Nodes/BitFieldNode.cs @@ -2,6 +2,7 @@ using System.Diagnostics.Contracts; using System.Drawing; using ReClassNET.Controls; +using ReClassNET.Extensions; using ReClassNET.Memory; using ReClassNET.UI; using ReClassNET.Util; diff --git a/ReClass.NET/Nodes/BoolNode.cs b/ReClass.NET/Nodes/BoolNode.cs index 076c0d48..89e164dd 100644 --- a/ReClass.NET/Nodes/BoolNode.cs +++ b/ReClass.NET/Nodes/BoolNode.cs @@ -1,5 +1,6 @@ using System.Drawing; using ReClassNET.Controls; +using ReClassNET.Extensions; using ReClassNET.UI; namespace ReClassNET.Nodes diff --git a/ReClass.NET/Nodes/DoubleNode.cs b/ReClass.NET/Nodes/DoubleNode.cs index c7de5fee..58df6e15 100644 --- a/ReClass.NET/Nodes/DoubleNode.cs +++ b/ReClass.NET/Nodes/DoubleNode.cs @@ -1,5 +1,6 @@ using System.Drawing; using ReClassNET.Controls; +using ReClassNET.Extensions; using ReClassNET.Memory; using ReClassNET.UI; diff --git a/ReClass.NET/Nodes/FloatNode.cs b/ReClass.NET/Nodes/FloatNode.cs index 4b51c51f..b02ebaff 100644 --- a/ReClass.NET/Nodes/FloatNode.cs +++ b/ReClass.NET/Nodes/FloatNode.cs @@ -1,5 +1,6 @@ using System.Drawing; using ReClassNET.Controls; +using ReClassNET.Extensions; using ReClassNET.Memory; using ReClassNET.UI; diff --git a/ReClass.NET/ReClass.NET.csproj b/ReClass.NET/ReClass.NET.csproj index 1914f3cf..0c990cc2 100644 --- a/ReClass.NET/ReClass.NET.csproj +++ b/ReClass.NET/ReClass.NET.csproj @@ -174,6 +174,7 @@ + From 96b36cf7a97d41863b6d75098f681615884d55f7 Mon Sep 17 00:00:00 2001 From: KN4CK3R Date: Sun, 29 Nov 2020 22:04:55 +0100 Subject: [PATCH 206/223] Fixed context menu not working with Mono. (fixes #181) --- ReClass.NET/Forms/LogForm.Designer.cs | 2 +- ReClass.NET/Forms/ProcessInfoForm.Designer.cs | 7 ++++--- ReClass.NET/Forms/ProcessInfoForm.cs | 8 ++++++++ 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/ReClass.NET/Forms/LogForm.Designer.cs b/ReClass.NET/Forms/LogForm.Designer.cs index 5bd2d132..384b0974 100644 --- a/ReClass.NET/Forms/LogForm.Designer.cs +++ b/ReClass.NET/Forms/LogForm.Designer.cs @@ -86,7 +86,7 @@ private void InitializeComponent() this.entriesDataGridView.Name = "entriesDataGridView"; this.entriesDataGridView.ReadOnly = true; this.entriesDataGridView.RowHeadersVisible = false; - this.entriesDataGridView.RowTemplate.ContextMenuStrip = this.contextMenuStrip; + this.entriesDataGridView.ContextMenuStrip = this.contextMenuStrip; this.entriesDataGridView.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; this.entriesDataGridView.Size = new System.Drawing.Size(563, 188); this.entriesDataGridView.TabIndex = 1; diff --git a/ReClass.NET/Forms/ProcessInfoForm.Designer.cs b/ReClass.NET/Forms/ProcessInfoForm.Designer.cs index 8be2cb73..90fa7959 100644 --- a/ReClass.NET/Forms/ProcessInfoForm.Designer.cs +++ b/ReClass.NET/Forms/ProcessInfoForm.Designer.cs @@ -43,7 +43,7 @@ private void InitializeComponent() this.protectionColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.typeColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.moduleColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.bannerBox1 = new BannerBox(); + this.bannerBox1 = new ReClassNET.Controls.BannerBox(); this.tabControl = new System.Windows.Forms.TabControl(); this.modulesTabPage = new System.Windows.Forms.TabPage(); this.modulesDataGridView = new System.Windows.Forms.DataGridView(); @@ -71,6 +71,7 @@ private void InitializeComponent() this.dumpToolStripMenuItem}); this.contextMenuStrip.Name = "contextMenuStrip"; this.contextMenuStrip.Size = new System.Drawing.Size(203, 98); + this.contextMenuStrip.Opening += new System.ComponentModel.CancelEventHandler(this.contextMenuStrip_Opening); // // setCurrentClassAddressToolStripMenuItem // @@ -115,13 +116,13 @@ private void InitializeComponent() this.protectionColumn, this.typeColumn, this.moduleColumn}); + this.sectionsDataGridView.ContextMenuStrip = this.contextMenuStrip; this.sectionsDataGridView.Dock = System.Windows.Forms.DockStyle.Fill; this.sectionsDataGridView.Location = new System.Drawing.Point(3, 3); this.sectionsDataGridView.MultiSelect = false; this.sectionsDataGridView.Name = "sectionsDataGridView"; this.sectionsDataGridView.ReadOnly = true; this.sectionsDataGridView.RowHeadersVisible = false; - this.sectionsDataGridView.RowTemplate.ContextMenuStrip = this.contextMenuStrip; this.sectionsDataGridView.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; this.sectionsDataGridView.Size = new System.Drawing.Size(796, 386); this.sectionsDataGridView.TabIndex = 0; @@ -229,13 +230,13 @@ private void InitializeComponent() this.moduleAddressDataGridViewTextBoxColumn, this.moduleSizeDataGridViewTextBoxColumn, this.modulePathDataGridViewTextBoxColumn}); + this.modulesDataGridView.ContextMenuStrip = this.contextMenuStrip; this.modulesDataGridView.Dock = System.Windows.Forms.DockStyle.Fill; this.modulesDataGridView.Location = new System.Drawing.Point(3, 3); this.modulesDataGridView.MultiSelect = false; this.modulesDataGridView.Name = "modulesDataGridView"; this.modulesDataGridView.ReadOnly = true; this.modulesDataGridView.RowHeadersVisible = false; - this.modulesDataGridView.RowTemplate.ContextMenuStrip = this.contextMenuStrip; this.modulesDataGridView.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; this.modulesDataGridView.Size = new System.Drawing.Size(796, 386); this.modulesDataGridView.TabIndex = 1; diff --git a/ReClass.NET/Forms/ProcessInfoForm.cs b/ReClass.NET/Forms/ProcessInfoForm.cs index e347270b..fc56d3eb 100644 --- a/ReClass.NET/Forms/ProcessInfoForm.cs +++ b/ReClass.NET/Forms/ProcessInfoForm.cs @@ -1,4 +1,5 @@ using System; +using System.ComponentModel; using System.Data; using System.Diagnostics.Contracts; using System.Drawing; @@ -129,6 +130,13 @@ private void SelectRow_CellMouseDown(object sender, DataGridViewCellMouseEventAr } } + private void contextMenuStrip_Opening(object sender, CancelEventArgs e) + { + var sourceControl = (sender as ContextMenuStrip)?.SourceControl; + + e.Cancel = sourceControl == null || (sourceControl == modulesDataGridView && GetSelectedModule() == null) || (sourceControl == sectionsDataGridView && GetSelectedSection() == null); + } + private void setCurrentClassAddressToolStripMenuItem_Click(object sender, EventArgs e) { LinkedWindowFeatures.SetCurrentClassAddress(GetSelectedAddress(sender)); From ede1e75b297ed3fb5bb3e815f90621913eebe916 Mon Sep 17 00:00:00 2001 From: KN4CK3R Date: Thu, 13 May 2021 21:33:02 +0200 Subject: [PATCH 207/223] Updated to diStorm 3.5.2 --- .../Dependencies/distorm/include/distorm.h | 93 +- .../Dependencies/distorm/include/mnemonics.h | 472 +- NativeCore/Dependencies/distorm/src/config.h | 7 +- NativeCore/Dependencies/distorm/src/decoder.c | 786 ++- NativeCore/Dependencies/distorm/src/decoder.h | 18 +- NativeCore/Dependencies/distorm/src/distorm.c | 450 +- .../Dependencies/distorm/src/instructions.c | 126 +- .../Dependencies/distorm/src/instructions.h | 304 +- NativeCore/Dependencies/distorm/src/insts.c | 5253 +++++++++-------- NativeCore/Dependencies/distorm/src/insts.h | 2 +- .../Dependencies/distorm/src/mnemonics.c | 465 +- .../Dependencies/distorm/src/operands.c | 1109 ++-- .../Dependencies/distorm/src/operands.h | 9 +- NativeCore/Dependencies/distorm/src/prefix.c | 387 +- NativeCore/Dependencies/distorm/src/prefix.h | 37 +- .../Dependencies/distorm/src/textdefs.c | 174 +- .../Dependencies/distorm/src/textdefs.h | 13 +- NativeCore/Dependencies/distorm/src/wstring.h | 31 +- NativeCore/Dependencies/distorm/src/x86defs.h | 2 +- NativeCore/Unix/Makefile | 10 +- NativeCore/Unix/NativeCore.Unix.vcxproj | 1 - .../Unix/NativeCore.Unix.vcxproj.filters | 6 - NativeCore/Windows/NativeCore.vcxproj | 1 - NativeCore/Windows/NativeCore.vcxproj.filters | 3 - 24 files changed, 4882 insertions(+), 4877 deletions(-) diff --git a/NativeCore/Dependencies/distorm/include/distorm.h b/NativeCore/Dependencies/distorm/include/distorm.h index d99bbc39..2e09c4a6 100644 --- a/NativeCore/Dependencies/distorm/include/distorm.h +++ b/NativeCore/Dependencies/distorm/include/distorm.h @@ -1,4 +1,4 @@ -/* diStorm 3.4.0 */ +/* diStorm 3.5.2 */ /* distorm.h @@ -6,7 +6,7 @@ distorm.h diStorm3 - Powerful disassembler for X86/AMD64 http://ragestorm.net/distorm/ distorm at gmail dot com -Copyright (C) 2003-2018 Gil Dabah +Copyright (C) 2003-2021 Gil Dabah This library is licensed under the BSD license. See the file COPYING. */ @@ -33,29 +33,27 @@ This library is licensed under the BSD license. See the file COPYING. #undef SUPPORT_64BIT_OFFSET #endif -/* If your compiler doesn't support stdint.h, define your own 64 bits type. */ -#ifdef SUPPORT_64BIT_OFFSET - #ifdef _MSC_VER - #define OFFSET_INTEGER unsigned __int64 - #else - #include - #define OFFSET_INTEGER uint64_t - #endif +#ifndef _MSC_VER +#include #else - /* 32 bit offsets are used. */ - #define OFFSET_INTEGER unsigned long +/* Since MSVC < 2010 isn't shipped with stdint.h, + * here are those from MSVC 2017, which also match + * those in tinycc/libc. */ +typedef signed char int8_t; +typedef short int16_t; +typedef int int32_t; +typedef long long int64_t; +typedef unsigned char uint8_t; +typedef unsigned short uint16_t; +typedef unsigned int uint32_t; +typedef unsigned long long uint64_t; #endif -#ifdef _MSC_VER -/* Since MSVC isn't shipped with stdint.h, we will have our own: */ -typedef signed __int64 int64_t; -typedef unsigned __int64 uint64_t; -typedef signed __int32 int32_t; -typedef unsigned __int32 uint32_t; -typedef signed __int16 int16_t; -typedef unsigned __int16 uint16_t; -typedef signed __int8 int8_t; -typedef unsigned __int8 uint8_t; +#ifdef SUPPORT_64BIT_OFFSET +#define OFFSET_INTEGER uint64_t +#else +/* 32 bit offsets are used. */ +#define OFFSET_INTEGER uint32_t #endif /* Support C++ compilers */ @@ -67,10 +65,10 @@ typedef unsigned __int8 uint8_t; /* *** Helper Macros *** */ /* Get the ISC of the instruction, used with the definitions below. */ -#define META_GET_ISC(meta) (((meta) >> 3) & 0x1f) -#define META_SET_ISC(di, isc) (((di)->meta) |= ((isc) << 3)) +#define META_GET_ISC(meta) (((meta) >> 8) & 0x1f) +#define META_SET_ISC(di, isc) (((di)->meta) |= ((isc) << 8)) /* Get the flow control flags of the instruction, see 'features for decompose' below. */ -#define META_GET_FC(meta) ((meta) & 0x7) +#define META_GET_FC(meta) ((meta) & 0xf) /* Get the target address of a branching instruction. O_PC operand type. */ #define INSTRUCTION_GET_TARGET(di) ((_OffsetType)(((di)->addr + (di)->imm.addr + (di)->size))) @@ -91,7 +89,7 @@ typedef unsigned __int8 uint8_t; #define FLAG_GET_OPSIZE(flags) (((flags) >> 8) & 3) #define FLAG_GET_ADDRSIZE(flags) (((flags) >> 10) & 3) /* To get the LOCK/REPNZ/REP prefixes. */ -#define FLAG_GET_PREFIX(flags) ((flags) & 7) +#define FLAG_GET_PREFIX(flags) (((unsigned int)((int16_t)flags)) & 7) /* Indicates whether the instruction is privileged. */ #define FLAG_GET_PRIVILEGED(flags) (((flags) & FLAG_PRIVILEGED_INSTRUCTION) != 0) @@ -99,10 +97,10 @@ typedef unsigned __int8 uint8_t; * Macros to extract segment registers from 'segment': */ #define SEGMENT_DEFAULT 0x80 -#define SEGMENT_SET(di, seg) ((di->segment) |= seg) #define SEGMENT_GET(segment) (((segment) == R_NONE) ? R_NONE : ((segment) & 0x7f)) -#define SEGMENT_IS_DEFAULT(segment) (((segment) & SEGMENT_DEFAULT) == SEGMENT_DEFAULT) - +#define SEGMENT_GET_UNSAFE(segment) ((segment) & 0x7f) +#define SEGMENT_IS_DEFAULT(segment) (((int8_t)segment) < -1) /* Quick check it's a negative number that isn't -1, so it's (0x80 | SEGREG). */ +#define SEGMENT_IS_DEFAULT_OR_NONE(segment) (((uint8_t)(segment)) > 0x80) /* Decodes modes of the disassembler, 16 bits or 32 bits or 64 bits for AMD64, x86-64. */ typedef enum { Decode16Bits = 0, Decode32Bits = 1, Decode64Bits = 2 } _DecodeType; @@ -110,7 +108,8 @@ typedef enum { Decode16Bits = 0, Decode32Bits = 1, Decode64Bits = 2 } _DecodeTyp typedef OFFSET_INTEGER _OffsetType; typedef struct { - _OffsetType codeOffset, nextOffset; /* nextOffset is OUT only. */ + _OffsetType codeOffset, addrMask; + _OffsetType nextOffset; /* nextOffset is OUT only. */ const uint8_t* code; int codeLen; /* Using signed integer makes it easier to detect an underflow. */ _DecodeType dt; @@ -243,6 +242,8 @@ typedef struct { uint16_t opcode; /* Up to four operands per instruction, ignored if ops[n].type == O_NONE. */ _Operand ops[OPERANDS_NO]; + /* Number of valid ops entries. */ + uint8_t opsNo; /* Size of the whole instruction in bytes. */ uint8_t size; /* Segment information of memory indirection, default segment, or overriden one, can be -1. Use SEGMENT macros. */ @@ -251,8 +252,8 @@ typedef struct { uint8_t base, scale; uint8_t dispSize; /* Meta defines the instruction set class, and the flow control flags. Use META macros. */ - uint8_t meta; - /* The CPU flags that the instruction operates upon. */ + uint16_t meta; + /* The CPU flags that the instruction operates upon, set only with DF_FILL_EFLAGS enabled, otherwise 0. */ uint16_t modifiedFlagsMask, testedFlagsMask, undefinedFlagsMask; } _DInst; @@ -271,11 +272,11 @@ typedef struct { * This structure holds all information the disassembler generates per instruction. */ typedef struct { + _OffsetType offset; /* Start offset of the decoded instruction. */ + unsigned int size; /* Size of decoded instruction in bytes. */ _WString mnemonic; /* Mnemonic of decoded instruction, prefixed if required by REP, LOCK etc. */ _WString operands; /* Operands of the decoded instruction, up to 3 operands, comma-seperated. */ _WString instructionHex; /* Hex dump - little endian, including prefixes. */ - unsigned int size; /* Size of decoded instruction in bytes. */ - _OffsetType offset; /* Start offset of the decoded instruction. */ } _DecodedInst; #endif /* DISTORM_LIGHT */ @@ -285,7 +286,7 @@ typedef struct { #define RM_CX 2 /* CL, CH, CX, ECX, RCX */ #define RM_DX 4 /* DL, DH, DX, EDX, RDX */ #define RM_BX 8 /* BL, BH, BX, EBX, RBX */ -#define RM_SP 0x10 /* SPL, SP, ESP, RSP */ +#define RM_SP 0x10 /* SPL, SP, ESP, RSP */ #define RM_BP 0x20 /* BPL, BP, EBP, RBP */ #define RM_SI 0x40 /* SIL, SI, ESI, RSI */ #define RM_DI 0x80 /* DIL, DI, EDI, RDI */ @@ -303,6 +304,7 @@ typedef struct { #define RM_R13 0x80000 /* R13B, R13W, R13D, R13 */ #define RM_R14 0x100000 /* R14B, R14W, R14D, R14 */ #define RM_R15 0x200000 /* R15B, R15W, R15D, R15 */ +#define RM_SEG 0x400000 /* CS, SS, DS, ES, FS, GS */ /* RIP should be checked using the 'flags' field and FLAG_RIP_RELATIVE. * Segments should be checked using the segment macros. @@ -384,8 +386,21 @@ typedef struct { #define DF_STOP_ON_INT 0x100 /* The decoder will stop and return to the caller when any of the 'CMOVxx' instruction was decoded. */ #define DF_STOP_ON_CMOV 0x200 +/* The decoder will stop and return to the caller when it encounters the HLT instruction. */ +#define DF_STOP_ON_HLT 0x400 +/* The decoder will stop and return to the caller when it encounters a privileged instruction. */ +#define DF_STOP_ON_PRIVILEGED 0x800 +/* The decoder will stop and return to the caller when an instruction couldn't be decoded. */ +#define DF_STOP_ON_UNDECODEABLE 0x1000 +/* The decoder will not synchronize to the next byte after the previosuly decoded instruction, instead it will start decoding at the next byte. */ +#define DF_SINGLE_BYTE_STEP 0x2000 +/* The decoder will fill in the eflags fields for the decoded instruction. */ +#define DF_FILL_EFLAGS 0x4000 +/* The decoder will use the addrMask in CodeInfo structure instead of DF_MAXIMUM_ADDR16/32. */ +#define DF_USE_ADDR_MASK 0x8000 + /* The decoder will stop and return to the caller when any flow control instruction was decoded. */ -#define DF_STOP_ON_FLOW_CONTROL (DF_STOP_ON_CALL | DF_STOP_ON_RET | DF_STOP_ON_SYS | DF_STOP_ON_UNC_BRANCH | DF_STOP_ON_CND_BRANCH | DF_STOP_ON_INT | DF_STOP_ON_CMOV) +#define DF_STOP_ON_FLOW_CONTROL (DF_STOP_ON_CALL | DF_STOP_ON_RET | DF_STOP_ON_SYS | DF_STOP_ON_UNC_BRANCH | DF_STOP_ON_CND_BRANCH | DF_STOP_ON_INT | DF_STOP_ON_CMOV | DF_STOP_ON_HLT) /* Indicates the instruction is not a flow-control instruction. */ #define FC_NONE 0 @@ -406,9 +421,11 @@ typedef struct { #define FC_INT 6 /* Indicates the instruction is one of: CMOVxx. */ #define FC_CMOV 7 +/* Indicates the instruction is HLT. */ +#define FC_HLT 8 /* Return code of the decoding function. */ -typedef enum { DECRES_NONE, DECRES_SUCCESS, DECRES_MEMORYERR, DECRES_INPUTERR, DECRES_FILTERED } _DecodeResult; +typedef enum { DECRES_NONE, DECRES_SUCCESS, DECRES_MEMORYERR, DECRES_INPUTERR } _DecodeResult; /* Define the following interface functions only for outer projects. */ #if !(defined(DISTORM_STATIC) || defined(DISTORM_DYNAMIC)) @@ -431,7 +448,7 @@ typedef enum { DECRES_NONE, DECRES_SUCCESS, DECRES_MEMORYERR, DECRES_INPUTERR, D * Notes: 1)The minimal size of maxInstructions is 15. * 2)You will have to synchronize the offset,code and length by yourself if you pass code fragments and not a complete code block! */ - + /* distorm_decompose * See more documentation online at the GitHub project's wiki. * diff --git a/NativeCore/Dependencies/distorm/include/mnemonics.h b/NativeCore/Dependencies/distorm/include/mnemonics.h index 32d71be8..3a784cca 100644 --- a/NativeCore/Dependencies/distorm/include/mnemonics.h +++ b/NativeCore/Dependencies/distorm/include/mnemonics.h @@ -4,7 +4,7 @@ mnemonics.h diStorm3 - Powerful disassembler for X86/AMD64 http://ragestorm.net/distorm/ distorm at gmail dot com -Copyright (C) 2003-2018 Gil Dabah +Copyright (C) 2003-2021 Gil Dabah This library is licensed under the BSD license. See the file COPYING. */ @@ -41,245 +41,245 @@ extern const _WRegister _REGISTERS[]; #define GET_MNEMONIC_NAME(m) ((_WMnemonic*)&_MNEMONICS[(m)])->p typedef enum { - I_UNDEFINED = 0, I_AAA = 66, I_AAD = 389, I_AAM = 384, I_AAS = 76, I_ADC = 31, I_ADD = 11, I_ADDPD = 3132, - I_ADDPS = 3125, I_ADDSD = 3146, I_ADDSS = 3139, I_ADDSUBPD = 6416, I_ADDSUBPS = 6426, - I_AESDEC = 9231, I_AESDECLAST = 9248, I_AESENC = 9189, I_AESENCLAST = 9206, - I_AESIMC = 9172, I_AESKEYGENASSIST = 9817, I_AND = 41, I_ANDNPD = 3043, I_ANDNPS = 3035, - I_ANDPD = 3012, I_ANDPS = 3005, I_ARPL = 111, I_BLENDPD = 9394, I_BLENDPS = 9375, - I_BLENDVPD = 7641, I_BLENDVPS = 7631, I_BOUND = 104, I_BSF = 4368, I_BSR = 4380, + I_UNDEFINED = 0, I_AAA = 66, I_AAD = 389, I_AAM = 384, I_AAS = 76, I_ADC = 31, I_ADD = 11, I_ADDPD = 3144, + I_ADDPS = 3137, I_ADDSD = 3158, I_ADDSS = 3151, I_ADDSUBPD = 6428, I_ADDSUBPS = 6438, + I_AESDEC = 9243, I_AESDECLAST = 9260, I_AESENC = 9201, I_AESENCLAST = 9218, + I_AESIMC = 9184, I_AESKEYGENASSIST = 9829, I_AND = 41, I_ANDNPD = 3055, I_ANDNPS = 3047, + I_ANDPD = 3024, I_ANDPS = 3017, I_ARPL = 111, I_BLENDPD = 9406, I_BLENDPS = 9387, + I_BLENDVPD = 7653, I_BLENDVPS = 7643, I_BOUND = 104, I_BSF = 4380, I_BSR = 4392, I_BSWAP = 960, I_BT = 872, I_BTC = 934, I_BTR = 912, I_BTS = 887, I_CALL = 456, - I_CALL_FAR = 260, I_CBW = 228, I_CDQ = 250, I_CDQE = 239, I_CLC = 492, I_CLD = 512, - I_CLFLUSH = 4351, I_CLGI = 1855, I_CLI = 502, I_CLTS = 541, I_CMC = 487, I_CMOVA = 694, - I_CMOVAE = 663, I_CMOVB = 656, I_CMOVBE = 686, I_CMOVG = 754, I_CMOVGE = 738, - I_CMOVL = 731, I_CMOVLE = 746, I_CMOVNO = 648, I_CMOVNP = 723, I_CMOVNS = 708, - I_CMOVNZ = 678, I_CMOVO = 641, I_CMOVP = 716, I_CMOVS = 701, I_CMOVZ = 671, - I_CMP = 71, I_CMPEQPD = 4471, I_CMPEQPS = 4392, I_CMPEQSD = 4629, I_CMPEQSS = 4550, - I_CMPLEPD = 4489, I_CMPLEPS = 4410, I_CMPLESD = 4647, I_CMPLESS = 4568, I_CMPLTPD = 4480, - I_CMPLTPS = 4401, I_CMPLTSD = 4638, I_CMPLTSS = 4559, I_CMPNEQPD = 4510, I_CMPNEQPS = 4431, - I_CMPNEQSD = 4668, I_CMPNEQSS = 4589, I_CMPNLEPD = 4530, I_CMPNLEPS = 4451, - I_CMPNLESD = 4688, I_CMPNLESS = 4609, I_CMPNLTPD = 4520, I_CMPNLTPS = 4441, - I_CMPNLTSD = 4678, I_CMPNLTSS = 4599, I_CMPORDPD = 4540, I_CMPORDPS = 4461, - I_CMPORDSD = 4698, I_CMPORDSS = 4619, I_CMPS = 301, I_CMPUNORDPD = 4498, I_CMPUNORDPS = 4419, - I_CMPUNORDSD = 4656, I_CMPUNORDSS = 4577, I_CMPXCHG = 898, I_CMPXCHG16B = 6395, - I_CMPXCHG8B = 6384, I_COMISD = 2801, I_COMISS = 2793, I_CPUID = 865, I_CQO = 255, - I_CRC32 = 9280, I_CVTDQ2PD = 6809, I_CVTDQ2PS = 3329, I_CVTPD2DQ = 6819, I_CVTPD2PI = 2703, - I_CVTPD2PS = 3255, I_CVTPH2PS = 4183, I_CVTPI2PD = 2517, I_CVTPI2PS = 2507, - I_CVTPS2DQ = 3339, I_CVTPS2PD = 3245, I_CVTPS2PH = 4193, I_CVTPS2PI = 2693, - I_CVTSD2SI = 2723, I_CVTSD2SS = 3275, I_CVTSI2SD = 2537, I_CVTSI2SS = 2527, - I_CVTSS2SD = 3265, I_CVTSS2SI = 2713, I_CVTTPD2DQ = 6798, I_CVTTPD2PI = 2636, - I_CVTTPS2DQ = 3349, I_CVTTPS2PI = 2625, I_CVTTSD2SI = 2658, I_CVTTSS2SI = 2647, - I_CWD = 245, I_CWDE = 233, I_DAA = 46, I_DAS = 56, I_DEC = 86, I_DIV = 1646, - I_DIVPD = 3521, I_DIVPS = 3514, I_DIVSD = 3535, I_DIVSS = 3528, I_DPPD = 9637, - I_DPPS = 9624, I_EMMS = 4122, I_ENTER = 340, I_EXTRACTPS = 9502, I_EXTRQ = 4158, - I_F2XM1 = 1192, I_FABS = 1123, I_FADD = 1023, I_FADDP = 1549, I_FBLD = 1601, - I_FBSTP = 1607, I_FCHS = 1117, I_FCLEX = 7311, I_FCMOVB = 1376, I_FCMOVBE = 1392, - I_FCMOVE = 1384, I_FCMOVNB = 1445, I_FCMOVNBE = 1463, I_FCMOVNE = 1454, I_FCMOVNU = 1473, - I_FCMOVU = 1401, I_FCOM = 1035, I_FCOMI = 1512, I_FCOMIP = 1623, I_FCOMP = 1041, - I_FCOMPP = 1563, I_FCOS = 1311, I_FDECSTP = 1238, I_FDIV = 1061, I_FDIVP = 1594, - I_FDIVR = 1067, I_FDIVRP = 1586, I_FEDISI = 1488, I_FEMMS = 574, I_FENI = 1482, - I_FFREE = 1527, I_FIADD = 1317, I_FICOM = 1331, I_FICOMP = 1338, I_FIDIV = 1361, - I_FIDIVR = 1368, I_FILD = 1418, I_FIMUL = 1324, I_FINCSTP = 1247, I_FINIT = 7326, - I_FIST = 1432, I_FISTP = 1438, I_FISTTP = 1424, I_FISUB = 1346, I_FISUBR = 1353, - I_FLD = 1074, I_FLD1 = 1141, I_FLDCW = 1098, I_FLDENV = 1090, I_FLDL2E = 1155, - I_FLDL2T = 1147, I_FLDLG2 = 1170, I_FLDLN2 = 1178, I_FLDPI = 1163, I_FLDZ = 1186, - I_FMUL = 1029, I_FMULP = 1556, I_FNCLEX = 7303, I_FNINIT = 7318, I_FNOP = 1111, - I_FNSAVE = 7333, I_FNSTCW = 7288, I_FNSTENV = 7271, I_FNSTSW = 7348, I_FPATAN = 1213, - I_FPREM = 1256, I_FPREM1 = 1230, I_FPTAN = 1206, I_FRNDINT = 1288, I_FRSTOR = 1519, - I_FSAVE = 7341, I_FSCALE = 1297, I_FSETPM = 1496, I_FSIN = 1305, I_FSINCOS = 1279, - I_FSQRT = 1272, I_FST = 1079, I_FSTCW = 7296, I_FSTENV = 7280, I_FSTP = 1084, - I_FSTSW = 7356, I_FSUB = 1048, I_FSUBP = 1579, I_FSUBR = 1054, I_FSUBRP = 1571, - I_FTST = 1129, I_FUCOM = 1534, I_FUCOMI = 1504, I_FUCOMIP = 1614, I_FUCOMP = 1541, - I_FUCOMPP = 1409, I_FXAM = 1135, I_FXCH = 1105, I_FXRSTOR = 9914, I_FXRSTOR64 = 9923, - I_FXSAVE = 9886, I_FXSAVE64 = 9894, I_FXTRACT = 1221, I_FYL2X = 1199, I_FYL2XP1 = 1263, - I_GETSEC = 633, I_HADDPD = 4203, I_HADDPS = 4211, I_HLT = 482, I_HSUBPD = 4237, - I_HSUBPS = 4245, I_IDIV = 1651, I_IMUL = 117, I_IN = 447, I_INC = 81, I_INS = 123, - I_INSERTPS = 9569, I_INSERTQ = 4165, I_INT = 367, I_INT_3 = 360, I_INT1 = 476, - I_INTO = 372, I_INVD = 555, I_INVEPT = 8306, I_INVLPG = 1727, I_INVLPGA = 1869, - I_INVPCID = 8323, I_INVVPID = 8314, I_IRET = 378, I_JA = 166, I_JAE = 147, - I_JB = 143, I_JBE = 161, I_JCXZ = 427, I_JECXZ = 433, I_JG = 202, I_JGE = 192, - I_JL = 188, I_JLE = 197, I_JMP = 462, I_JMP_FAR = 467, I_JNO = 138, I_JNP = 183, - I_JNS = 174, I_JNZ = 156, I_JO = 134, I_JP = 179, I_JRCXZ = 440, I_JS = 170, - I_JZ = 152, I_LAHF = 289, I_LAR = 522, I_LDDQU = 7016, I_LDMXCSR = 9944, I_LDS = 335, - I_LEA = 223, I_LEAVE = 347, I_LES = 330, I_LFENCE = 4287, I_LFS = 917, I_LGDT = 1703, - I_LGS = 922, I_LIDT = 1709, I_LLDT = 1668, I_LMSW = 1721, I_LODS = 313, I_LOOP = 421, - I_LOOPNZ = 406, I_LOOPZ = 414, I_LSL = 527, I_LSS = 907, I_LTR = 1674, I_LZCNT = 4385, - I_MASKMOVDQU = 7141, I_MASKMOVQ = 7131, I_MAXPD = 3581, I_MAXPS = 3574, I_MAXSD = 3595, - I_MAXSS = 3588, I_MFENCE = 4313, I_MINPD = 3461, I_MINPS = 3454, I_MINSD = 3475, - I_MINSS = 3468, I_MONITOR = 1771, I_MOV = 218, I_MOVAPD = 2481, I_MOVAPS = 2473, - I_MOVBE = 9273, I_MOVD = 3942, I_MOVDDUP = 2208, I_MOVDQ2Q = 6544, I_MOVDQA = 3968, - I_MOVDQU = 3976, I_MOVHLPS = 2173, I_MOVHPD = 2367, I_MOVHPS = 2359, I_MOVLHPS = 2350, - I_MOVLPD = 2190, I_MOVLPS = 2182, I_MOVMSKPD = 2837, I_MOVMSKPS = 2827, I_MOVNTDQ = 6871, - I_MOVNTDQA = 7917, I_MOVNTI = 952, I_MOVNTPD = 2578, I_MOVNTPS = 2569, I_MOVNTQ = 6863, - I_MOVNTSD = 2596, I_MOVNTSS = 2587, I_MOVQ = 3948, I_MOVQ2DQ = 6535, I_MOVS = 295, - I_MOVSD = 2132, I_MOVSHDUP = 2375, I_MOVSLDUP = 2198, I_MOVSS = 2125, I_MOVSX = 939, - I_MOVSXD = 10027, I_MOVUPD = 2117, I_MOVUPS = 2109, I_MOVZX = 927, I_MPSADBW = 9650, - I_MUL = 1641, I_MULPD = 3192, I_MULPS = 3185, I_MULSD = 3206, I_MULSS = 3199, - I_MWAIT = 1780, I_NEG = 1636, I_NOP = 581, I_NOT = 1631, I_OR = 27, I_ORPD = 3075, - I_ORPS = 3069, I_OUT = 451, I_OUTS = 128, I_PABSB = 7710, I_PABSD = 7740, I_PABSW = 7725, - I_PACKSSDW = 3871, I_PACKSSWB = 3703, I_PACKUSDW = 7938, I_PACKUSWB = 3781, - I_PADDB = 7226, I_PADDD = 7256, I_PADDQ = 6503, I_PADDSB = 6952, I_PADDSW = 6969, - I_PADDUSB = 6642, I_PADDUSW = 6661, I_PADDW = 7241, I_PALIGNR = 9432, I_PAND = 6629, - I_PANDN = 6687, I_PAUSE = 10035, I_PAVGB = 6702, I_PAVGUSB = 2100, I_PAVGW = 6747, - I_PBLENDVB = 7621, I_PBLENDW = 9413, I_PCLMULQDQ = 9669, I_PCMPEQB = 4065, - I_PCMPEQD = 4103, I_PCMPEQQ = 7898, I_PCMPEQW = 4084, I_PCMPESTRI = 9748, - I_PCMPESTRM = 9725, I_PCMPGTB = 3724, I_PCMPGTD = 3762, I_PCMPGTQ = 8109, - I_PCMPGTW = 3743, I_PCMPISTRI = 9794, I_PCMPISTRM = 9771, I_PEXTRB = 9451, - I_PEXTRD = 9468, I_PEXTRQ = 9476, I_PEXTRW = 6333, I_PF2ID = 1936, I_PF2IW = 1929, - I_PFACC = 2050, I_PFADD = 1999, I_PFCMPEQ = 2057, I_PFCMPGE = 1960, I_PFCMPGT = 2006, - I_PFMAX = 2015, I_PFMIN = 1969, I_PFMUL = 2066, I_PFNACC = 1943, I_PFPNACC = 1951, - I_PFRCP = 1976, I_PFRCPIT1 = 2022, I_PFRCPIT2 = 2073, I_PFRSQIT1 = 2032, I_PFRSQRT = 1983, - I_PFSUB = 1992, I_PFSUBR = 2042, I_PHADDD = 7397, I_PHADDSW = 7414, I_PHADDW = 7380, - I_PHMINPOSUW = 8281, I_PHSUBD = 7473, I_PHSUBSW = 7490, I_PHSUBW = 7456, I_PI2FD = 1922, - I_PI2FW = 1915, I_PINSRB = 9552, I_PINSRD = 9590, I_PINSRQ = 9598, I_PINSRW = 6316, - I_PMADDUBSW = 7433, I_PMADDWD = 7095, I_PMAXSB = 8196, I_PMAXSD = 8213, I_PMAXSW = 6986, - I_PMAXUB = 6670, I_PMAXUD = 8247, I_PMAXUW = 8230, I_PMINSB = 8128, I_PMINSD = 8145, - I_PMINSW = 6924, I_PMINUB = 6612, I_PMINUD = 8179, I_PMINUW = 8162, I_PMOVMSKB = 6553, - I_PMOVSXBD = 7776, I_PMOVSXBQ = 7797, I_PMOVSXBW = 7755, I_PMOVSXDQ = 7860, - I_PMOVSXWD = 7818, I_PMOVSXWQ = 7839, I_PMOVZXBD = 8004, I_PMOVZXBQ = 8025, - I_PMOVZXBW = 7983, I_PMOVZXDQ = 8088, I_PMOVZXWD = 8046, I_PMOVZXWQ = 8067, - I_PMULDQ = 7881, I_PMULHRSW = 7560, I_PMULHRW = 2083, I_PMULHUW = 6762, I_PMULHW = 6781, - I_PMULLD = 8264, I_PMULLW = 6518, I_PMULUDQ = 7076, I_POP = 22, I_POPA = 98, - I_POPCNT = 4360, I_POPF = 277, I_POR = 6941, I_PREFETCH = 1894, I_PREFETCHNTA = 2424, - I_PREFETCHT0 = 2437, I_PREFETCHT1 = 2449, I_PREFETCHT2 = 2461, I_PREFETCHW = 1904, - I_PSADBW = 7114, I_PSHUFB = 7363, I_PSHUFD = 4010, I_PSHUFHW = 4018, I_PSHUFLW = 4027, - I_PSHUFW = 4002, I_PSIGNB = 7509, I_PSIGND = 7543, I_PSIGNW = 7526, I_PSLLD = 7046, - I_PSLLDQ = 9869, I_PSLLQ = 7061, I_PSLLW = 7031, I_PSRAD = 6732, I_PSRAW = 6717, - I_PSRLD = 6473, I_PSRLDQ = 9852, I_PSRLQ = 6488, I_PSRLW = 6458, I_PSUBB = 7166, - I_PSUBD = 7196, I_PSUBQ = 7211, I_PSUBSB = 6890, I_PSUBSW = 6907, I_PSUBUSB = 6574, - I_PSUBUSW = 6593, I_PSUBW = 7181, I_PSWAPD = 2092, I_PTEST = 7651, I_PUNPCKHBW = 3802, - I_PUNPCKHDQ = 3848, I_PUNPCKHQDQ = 3917, I_PUNPCKHWD = 3825, I_PUNPCKLBW = 3634, - I_PUNPCKLDQ = 3680, I_PUNPCKLQDQ = 3892, I_PUNPCKLWD = 3657, I_PUSH = 16, - I_PUSHA = 91, I_PUSHF = 270, I_PXOR = 7003, I_RCL = 977, I_RCPPS = 2975, I_RCPSS = 2982, - I_RCR = 982, I_RDFSBASE = 9904, I_RDGSBASE = 9934, I_RDMSR = 600, I_RDPMC = 607, - I_RDRAND = 10048, I_RDTSC = 593, I_RDTSCP = 1886, I_RET = 325, I_RETF = 354, - I_ROL = 967, I_ROR = 972, I_ROUNDPD = 9318, I_ROUNDPS = 9299, I_ROUNDSD = 9356, - I_ROUNDSS = 9337, I_RSM = 882, I_RSQRTPS = 2937, I_RSQRTSS = 2946, I_SAHF = 283, + I_CALL_FAR = 260, I_CBW = 228, I_CDQ = 250, I_CDQE = 239, I_CLAC = 1787, I_CLC = 492, + I_CLD = 512, I_CLFLUSH = 4363, I_CLGI = 1867, I_CLI = 502, I_CLTS = 541, I_CMC = 487, + I_CMOVA = 694, I_CMOVAE = 663, I_CMOVB = 656, I_CMOVBE = 686, I_CMOVG = 754, + I_CMOVGE = 738, I_CMOVL = 731, I_CMOVLE = 746, I_CMOVNO = 648, I_CMOVNP = 723, + I_CMOVNS = 708, I_CMOVNZ = 678, I_CMOVO = 641, I_CMOVP = 716, I_CMOVS = 701, + I_CMOVZ = 671, I_CMP = 71, I_CMPEQPD = 4483, I_CMPEQPS = 4404, I_CMPEQSD = 4641, + I_CMPEQSS = 4562, I_CMPLEPD = 4501, I_CMPLEPS = 4422, I_CMPLESD = 4659, I_CMPLESS = 4580, + I_CMPLTPD = 4492, I_CMPLTPS = 4413, I_CMPLTSD = 4650, I_CMPLTSS = 4571, I_CMPNEQPD = 4522, + I_CMPNEQPS = 4443, I_CMPNEQSD = 4680, I_CMPNEQSS = 4601, I_CMPNLEPD = 4542, + I_CMPNLEPS = 4463, I_CMPNLESD = 4700, I_CMPNLESS = 4621, I_CMPNLTPD = 4532, + I_CMPNLTPS = 4453, I_CMPNLTSD = 4690, I_CMPNLTSS = 4611, I_CMPORDPD = 4552, + I_CMPORDPS = 4473, I_CMPORDSD = 4710, I_CMPORDSS = 4631, I_CMPS = 301, I_CMPUNORDPD = 4510, + I_CMPUNORDPS = 4431, I_CMPUNORDSD = 4668, I_CMPUNORDSS = 4589, I_CMPXCHG = 898, + I_CMPXCHG16B = 6407, I_CMPXCHG8B = 6396, I_COMISD = 2813, I_COMISS = 2805, + I_CPUID = 865, I_CQO = 255, I_CRC32 = 9292, I_CVTDQ2PD = 6821, I_CVTDQ2PS = 3341, + I_CVTPD2DQ = 6831, I_CVTPD2PI = 2715, I_CVTPD2PS = 3267, I_CVTPH2PS = 4195, + I_CVTPI2PD = 2529, I_CVTPI2PS = 2519, I_CVTPS2DQ = 3351, I_CVTPS2PD = 3257, + I_CVTPS2PH = 4205, I_CVTPS2PI = 2705, I_CVTSD2SI = 2735, I_CVTSD2SS = 3287, + I_CVTSI2SD = 2549, I_CVTSI2SS = 2539, I_CVTSS2SD = 3277, I_CVTSS2SI = 2725, + I_CVTTPD2DQ = 6810, I_CVTTPD2PI = 2648, I_CVTTPS2DQ = 3361, I_CVTTPS2PI = 2637, + I_CVTTSD2SI = 2670, I_CVTTSS2SI = 2659, I_CWD = 245, I_CWDE = 233, I_DAA = 46, + I_DAS = 56, I_DEC = 86, I_DIV = 1646, I_DIVPD = 3533, I_DIVPS = 3526, I_DIVSD = 3547, + I_DIVSS = 3540, I_DPPD = 9649, I_DPPS = 9636, I_EMMS = 4134, I_ENTER = 340, + I_EXTRACTPS = 9514, I_EXTRQ = 4170, I_F2XM1 = 1192, I_FABS = 1123, I_FADD = 1023, + I_FADDP = 1549, I_FBLD = 1601, I_FBSTP = 1607, I_FCHS = 1117, I_FCLEX = 7323, + I_FCMOVB = 1376, I_FCMOVBE = 1392, I_FCMOVE = 1384, I_FCMOVNB = 1445, I_FCMOVNBE = 1463, + I_FCMOVNE = 1454, I_FCMOVNU = 1473, I_FCMOVU = 1401, I_FCOM = 1035, I_FCOMI = 1512, + I_FCOMIP = 1623, I_FCOMP = 1041, I_FCOMPP = 1563, I_FCOS = 1311, I_FDECSTP = 1238, + I_FDIV = 1061, I_FDIVP = 1594, I_FDIVR = 1067, I_FDIVRP = 1586, I_FEDISI = 1488, + I_FEMMS = 574, I_FENI = 1482, I_FFREE = 1527, I_FIADD = 1317, I_FICOM = 1331, + I_FICOMP = 1338, I_FIDIV = 1361, I_FIDIVR = 1368, I_FILD = 1418, I_FIMUL = 1324, + I_FINCSTP = 1247, I_FINIT = 7338, I_FIST = 1432, I_FISTP = 1438, I_FISTTP = 1424, + I_FISUB = 1346, I_FISUBR = 1353, I_FLD = 1074, I_FLD1 = 1141, I_FLDCW = 1098, + I_FLDENV = 1090, I_FLDL2E = 1155, I_FLDL2T = 1147, I_FLDLG2 = 1170, I_FLDLN2 = 1178, + I_FLDPI = 1163, I_FLDZ = 1186, I_FMUL = 1029, I_FMULP = 1556, I_FNCLEX = 7315, + I_FNINIT = 7330, I_FNOP = 1111, I_FNSAVE = 7345, I_FNSTCW = 7300, I_FNSTENV = 7283, + I_FNSTSW = 7360, I_FPATAN = 1213, I_FPREM = 1256, I_FPREM1 = 1230, I_FPTAN = 1206, + I_FRNDINT = 1288, I_FRSTOR = 1519, I_FSAVE = 7353, I_FSCALE = 1297, I_FSETPM = 1496, + I_FSIN = 1305, I_FSINCOS = 1279, I_FSQRT = 1272, I_FST = 1079, I_FSTCW = 7308, + I_FSTENV = 7292, I_FSTP = 1084, I_FSTSW = 7368, I_FSUB = 1048, I_FSUBP = 1579, + I_FSUBR = 1054, I_FSUBRP = 1571, I_FTST = 1129, I_FUCOM = 1534, I_FUCOMI = 1504, + I_FUCOMIP = 1614, I_FUCOMP = 1541, I_FUCOMPP = 1409, I_FXAM = 1135, I_FXCH = 1105, + I_FXRSTOR = 9926, I_FXRSTOR64 = 9935, I_FXSAVE = 9898, I_FXSAVE64 = 9906, + I_FXTRACT = 1221, I_FYL2X = 1199, I_FYL2XP1 = 1263, I_GETSEC = 633, I_HADDPD = 4215, + I_HADDPS = 4223, I_HLT = 482, I_HSUBPD = 4249, I_HSUBPS = 4257, I_IDIV = 1651, + I_IMUL = 117, I_IN = 447, I_INC = 81, I_INS = 123, I_INSERTPS = 9581, I_INSERTQ = 4177, + I_INT = 367, I_INT_3 = 360, I_INT1 = 476, I_INTO = 372, I_INVD = 555, I_INVEPT = 8318, + I_INVLPG = 1727, I_INVLPGA = 1881, I_INVPCID = 8335, I_INVVPID = 8326, I_IRET = 378, + I_JA = 166, I_JAE = 147, I_JB = 143, I_JBE = 161, I_JCXZ = 427, I_JECXZ = 433, + I_JG = 202, I_JGE = 192, I_JL = 188, I_JLE = 197, I_JMP = 462, I_JMP_FAR = 467, + I_JNO = 138, I_JNP = 183, I_JNS = 174, I_JNZ = 156, I_JO = 134, I_JP = 179, + I_JRCXZ = 440, I_JS = 170, I_JZ = 152, I_LAHF = 289, I_LAR = 522, I_LDDQU = 7028, + I_LDMXCSR = 9956, I_LDS = 335, I_LEA = 223, I_LEAVE = 347, I_LES = 330, I_LFENCE = 4299, + I_LFS = 917, I_LGDT = 1703, I_LGS = 922, I_LIDT = 1709, I_LLDT = 1668, I_LMSW = 1721, + I_LODS = 313, I_LOOP = 421, I_LOOPNZ = 406, I_LOOPZ = 414, I_LSL = 527, I_LSS = 907, + I_LTR = 1674, I_LZCNT = 4397, I_MASKMOVDQU = 7153, I_MASKMOVQ = 7143, I_MAXPD = 3593, + I_MAXPS = 3586, I_MAXSD = 3607, I_MAXSS = 3600, I_MFENCE = 4325, I_MINPD = 3473, + I_MINPS = 3466, I_MINSD = 3487, I_MINSS = 3480, I_MONITOR = 1771, I_MOV = 218, + I_MOVAPD = 2493, I_MOVAPS = 2485, I_MOVBE = 9285, I_MOVD = 3954, I_MOVDDUP = 2220, + I_MOVDQ2Q = 6556, I_MOVDQA = 3980, I_MOVDQU = 3988, I_MOVHLPS = 2185, I_MOVHPD = 2379, + I_MOVHPS = 2371, I_MOVLHPS = 2362, I_MOVLPD = 2202, I_MOVLPS = 2194, I_MOVMSKPD = 2849, + I_MOVMSKPS = 2839, I_MOVNTDQ = 6883, I_MOVNTDQA = 7929, I_MOVNTI = 952, I_MOVNTPD = 2590, + I_MOVNTPS = 2581, I_MOVNTQ = 6875, I_MOVNTSD = 2608, I_MOVNTSS = 2599, I_MOVQ = 3960, + I_MOVQ2DQ = 6547, I_MOVS = 295, I_MOVSD = 2144, I_MOVSHDUP = 2387, I_MOVSLDUP = 2210, + I_MOVSS = 2137, I_MOVSX = 939, I_MOVSXD = 10039, I_MOVUPD = 2129, I_MOVUPS = 2121, + I_MOVZX = 927, I_MPSADBW = 9662, I_MUL = 1641, I_MULPD = 3204, I_MULPS = 3197, + I_MULSD = 3218, I_MULSS = 3211, I_MWAIT = 1780, I_NEG = 1636, I_NOP = 581, + I_NOT = 1631, I_OR = 27, I_ORPD = 3087, I_ORPS = 3081, I_OUT = 451, I_OUTS = 128, + I_PABSB = 7722, I_PABSD = 7752, I_PABSW = 7737, I_PACKSSDW = 3883, I_PACKSSWB = 3715, + I_PACKUSDW = 7950, I_PACKUSWB = 3793, I_PADDB = 7238, I_PADDD = 7268, I_PADDQ = 6515, + I_PADDSB = 6964, I_PADDSW = 6981, I_PADDUSB = 6654, I_PADDUSW = 6673, I_PADDW = 7253, + I_PALIGNR = 9444, I_PAND = 6641, I_PANDN = 6699, I_PAUSE = 10047, I_PAVGB = 6714, + I_PAVGUSB = 2112, I_PAVGW = 6759, I_PBLENDVB = 7633, I_PBLENDW = 9425, I_PCLMULQDQ = 9681, + I_PCMPEQB = 4077, I_PCMPEQD = 4115, I_PCMPEQQ = 7910, I_PCMPEQW = 4096, I_PCMPESTRI = 9760, + I_PCMPESTRM = 9737, I_PCMPGTB = 3736, I_PCMPGTD = 3774, I_PCMPGTQ = 8121, + I_PCMPGTW = 3755, I_PCMPISTRI = 9806, I_PCMPISTRM = 9783, I_PEXTRB = 9463, + I_PEXTRD = 9480, I_PEXTRQ = 9488, I_PEXTRW = 6345, I_PF2ID = 1948, I_PF2IW = 1941, + I_PFACC = 2062, I_PFADD = 2011, I_PFCMPEQ = 2069, I_PFCMPGE = 1972, I_PFCMPGT = 2018, + I_PFMAX = 2027, I_PFMIN = 1981, I_PFMUL = 2078, I_PFNACC = 1955, I_PFPNACC = 1963, + I_PFRCP = 1988, I_PFRCPIT1 = 2034, I_PFRCPIT2 = 2085, I_PFRSQIT1 = 2044, I_PFRSQRT = 1995, + I_PFSUB = 2004, I_PFSUBR = 2054, I_PHADDD = 7409, I_PHADDSW = 7426, I_PHADDW = 7392, + I_PHMINPOSUW = 8293, I_PHSUBD = 7485, I_PHSUBSW = 7502, I_PHSUBW = 7468, I_PI2FD = 1934, + I_PI2FW = 1927, I_PINSRB = 9564, I_PINSRD = 9602, I_PINSRQ = 9610, I_PINSRW = 6328, + I_PMADDUBSW = 7445, I_PMADDWD = 7107, I_PMAXSB = 8208, I_PMAXSD = 8225, I_PMAXSW = 6998, + I_PMAXUB = 6682, I_PMAXUD = 8259, I_PMAXUW = 8242, I_PMINSB = 8140, I_PMINSD = 8157, + I_PMINSW = 6936, I_PMINUB = 6624, I_PMINUD = 8191, I_PMINUW = 8174, I_PMOVMSKB = 6565, + I_PMOVSXBD = 7788, I_PMOVSXBQ = 7809, I_PMOVSXBW = 7767, I_PMOVSXDQ = 7872, + I_PMOVSXWD = 7830, I_PMOVSXWQ = 7851, I_PMOVZXBD = 8016, I_PMOVZXBQ = 8037, + I_PMOVZXBW = 7995, I_PMOVZXDQ = 8100, I_PMOVZXWD = 8058, I_PMOVZXWQ = 8079, + I_PMULDQ = 7893, I_PMULHRSW = 7572, I_PMULHRW = 2095, I_PMULHUW = 6774, I_PMULHW = 6793, + I_PMULLD = 8276, I_PMULLW = 6530, I_PMULUDQ = 7088, I_POP = 22, I_POPA = 98, + I_POPCNT = 4372, I_POPF = 277, I_POR = 6953, I_PREFETCH = 1906, I_PREFETCHNTA = 2436, + I_PREFETCHT0 = 2449, I_PREFETCHT1 = 2461, I_PREFETCHT2 = 2473, I_PREFETCHW = 1916, + I_PSADBW = 7126, I_PSHUFB = 7375, I_PSHUFD = 4022, I_PSHUFHW = 4030, I_PSHUFLW = 4039, + I_PSHUFW = 4014, I_PSIGNB = 7521, I_PSIGND = 7555, I_PSIGNW = 7538, I_PSLLD = 7058, + I_PSLLDQ = 9881, I_PSLLQ = 7073, I_PSLLW = 7043, I_PSRAD = 6744, I_PSRAW = 6729, + I_PSRLD = 6485, I_PSRLDQ = 9864, I_PSRLQ = 6500, I_PSRLW = 6470, I_PSUBB = 7178, + I_PSUBD = 7208, I_PSUBQ = 7223, I_PSUBSB = 6902, I_PSUBSW = 6919, I_PSUBUSB = 6586, + I_PSUBUSW = 6605, I_PSUBW = 7193, I_PSWAPD = 2104, I_PTEST = 7663, I_PUNPCKHBW = 3814, + I_PUNPCKHDQ = 3860, I_PUNPCKHQDQ = 3929, I_PUNPCKHWD = 3837, I_PUNPCKLBW = 3646, + I_PUNPCKLDQ = 3692, I_PUNPCKLQDQ = 3904, I_PUNPCKLWD = 3669, I_PUSH = 16, + I_PUSHA = 91, I_PUSHF = 270, I_PXOR = 7015, I_RCL = 977, I_RCPPS = 2987, I_RCPSS = 2994, + I_RCR = 982, I_RDFSBASE = 9916, I_RDGSBASE = 9946, I_RDMSR = 600, I_RDPMC = 607, + I_RDRAND = 10060, I_RDTSC = 593, I_RDTSCP = 1898, I_RET = 325, I_RETF = 354, + I_ROL = 967, I_ROR = 972, I_ROUNDPD = 9330, I_ROUNDPS = 9311, I_ROUNDSD = 9368, + I_ROUNDSS = 9349, I_RSM = 882, I_RSQRTPS = 2949, I_RSQRTSS = 2958, I_SAHF = 283, I_SAL = 997, I_SALC = 394, I_SAR = 1002, I_SBB = 36, I_SCAS = 319, I_SETA = 807, I_SETAE = 780, I_SETB = 774, I_SETBE = 800, I_SETG = 859, I_SETGE = 845, I_SETL = 839, I_SETLE = 852, I_SETNO = 767, I_SETNP = 832, I_SETNS = 819, I_SETNZ = 793, - I_SETO = 761, I_SETP = 826, I_SETS = 813, I_SETZ = 787, I_SFENCE = 4343, I_SGDT = 1691, - I_SHL = 987, I_SHLD = 876, I_SHR = 992, I_SHRD = 892, I_SHUFPD = 6358, I_SHUFPS = 6350, - I_SIDT = 1697, I_SKINIT = 1861, I_SLDT = 1657, I_SMSW = 1715, I_SQRTPD = 2877, - I_SQRTPS = 2869, I_SQRTSD = 2893, I_SQRTSS = 2885, I_STC = 497, I_STD = 517, - I_STGI = 1849, I_STI = 507, I_STMXCSR = 9973, I_STOS = 307, I_STR = 1663, I_SUB = 51, - I_SUBPD = 3401, I_SUBPS = 3394, I_SUBSD = 3415, I_SUBSS = 3408, I_SWAPGS = 1878, - I_SYSCALL = 532, I_SYSENTER = 614, I_SYSEXIT = 624, I_SYSRET = 547, I_TEST = 206, - I_TZCNT = 4373, I_UCOMISD = 2764, I_UCOMISS = 2755, I_UD2 = 569, I_UNPCKHPD = 2318, - I_UNPCKHPS = 2308, I_UNPCKLPD = 2276, I_UNPCKLPS = 2266, I_VADDPD = 3161, - I_VADDPS = 3153, I_VADDSD = 3177, I_VADDSS = 3169, I_VADDSUBPD = 6436, I_VADDSUBPS = 6447, - I_VAESDEC = 9239, I_VAESDECLAST = 9260, I_VAESENC = 9197, I_VAESENCLAST = 9218, - I_VAESIMC = 9180, I_VAESKEYGENASSIST = 9834, I_VANDNPD = 3060, I_VANDNPS = 3051, - I_VANDPD = 3027, I_VANDPS = 3019, I_VBLENDPD = 9403, I_VBLENDPS = 9384, I_VBLENDVPD = 9703, - I_VBLENDVPS = 9692, I_VBROADCASTF128 = 7694, I_VBROADCASTSD = 7680, I_VBROADCASTSS = 7666, - I_VCMPEQPD = 5110, I_VCMPEQPS = 4708, I_VCMPEQSD = 5914, I_VCMPEQSS = 5512, - I_VCMPEQ_OSPD = 5291, I_VCMPEQ_OSPS = 4889, I_VCMPEQ_OSSD = 6095, I_VCMPEQ_OSSS = 5693, - I_VCMPEQ_UQPD = 5197, I_VCMPEQ_UQPS = 4795, I_VCMPEQ_UQSD = 6001, I_VCMPEQ_UQSS = 5599, - I_VCMPEQ_USPD = 5400, I_VCMPEQ_USPS = 4998, I_VCMPEQ_USSD = 6204, I_VCMPEQ_USSS = 5802, - I_VCMPFALSEPD = 5232, I_VCMPFALSEPS = 4830, I_VCMPFALSESD = 6036, I_VCMPFALSESS = 5634, - I_VCMPFALSE_OSPD = 5441, I_VCMPFALSE_OSPS = 5039, I_VCMPFALSE_OSSD = 6245, - I_VCMPFALSE_OSSS = 5843, I_VCMPGEPD = 5259, I_VCMPGEPS = 4857, I_VCMPGESD = 6063, - I_VCMPGESS = 5661, I_VCMPGE_OQPD = 5471, I_VCMPGE_OQPS = 5069, I_VCMPGE_OQSD = 6275, - I_VCMPGE_OQSS = 5873, I_VCMPGTPD = 5269, I_VCMPGTPS = 4867, I_VCMPGTSD = 6073, - I_VCMPGTSS = 5671, I_VCMPGT_OQPD = 5484, I_VCMPGT_OQPS = 5082, I_VCMPGT_OQSD = 6288, - I_VCMPGT_OQSS = 5886, I_VCMPLEPD = 5130, I_VCMPLEPS = 4728, I_VCMPLESD = 5934, - I_VCMPLESS = 5532, I_VCMPLE_OQPD = 5317, I_VCMPLE_OQPS = 4915, I_VCMPLE_OQSD = 6121, - I_VCMPLE_OQSS = 5719, I_VCMPLTPD = 5120, I_VCMPLTPS = 4718, I_VCMPLTSD = 5924, - I_VCMPLTSS = 5522, I_VCMPLT_OQPD = 5304, I_VCMPLT_OQPS = 4902, I_VCMPLT_OQSD = 6108, - I_VCMPLT_OQSS = 5706, I_VCMPNEQPD = 5153, I_VCMPNEQPS = 4751, I_VCMPNEQSD = 5957, - I_VCMPNEQSS = 5555, I_VCMPNEQ_OQPD = 5245, I_VCMPNEQ_OQPS = 4843, I_VCMPNEQ_OQSD = 6049, - I_VCMPNEQ_OQSS = 5647, I_VCMPNEQ_OSPD = 5457, I_VCMPNEQ_OSPS = 5055, I_VCMPNEQ_OSSD = 6261, - I_VCMPNEQ_OSSS = 5859, I_VCMPNEQ_USPD = 5345, I_VCMPNEQ_USPS = 4943, I_VCMPNEQ_USSD = 6149, - I_VCMPNEQ_USSS = 5747, I_VCMPNGEPD = 5210, I_VCMPNGEPS = 4808, I_VCMPNGESD = 6014, - I_VCMPNGESS = 5612, I_VCMPNGE_UQPD = 5413, I_VCMPNGE_UQPS = 5011, I_VCMPNGE_UQSD = 6217, - I_VCMPNGE_UQSS = 5815, I_VCMPNGTPD = 5221, I_VCMPNGTPS = 4819, I_VCMPNGTSD = 6025, - I_VCMPNGTSS = 5623, I_VCMPNGT_UQPD = 5427, I_VCMPNGT_UQPS = 5025, I_VCMPNGT_UQSD = 6231, - I_VCMPNGT_UQSS = 5829, I_VCMPNLEPD = 5175, I_VCMPNLEPS = 4773, I_VCMPNLESD = 5979, - I_VCMPNLESS = 5577, I_VCMPNLE_UQPD = 5373, I_VCMPNLE_UQPS = 4971, I_VCMPNLE_UQSD = 6177, - I_VCMPNLE_UQSS = 5775, I_VCMPNLTPD = 5164, I_VCMPNLTPS = 4762, I_VCMPNLTSD = 5968, - I_VCMPNLTSS = 5566, I_VCMPNLT_UQPD = 5359, I_VCMPNLT_UQPS = 4957, I_VCMPNLT_UQSD = 6163, - I_VCMPNLT_UQSS = 5761, I_VCMPORDPD = 5186, I_VCMPORDPS = 4784, I_VCMPORDSD = 5990, - I_VCMPORDSS = 5588, I_VCMPORD_SPD = 5387, I_VCMPORD_SPS = 4985, I_VCMPORD_SSD = 6191, - I_VCMPORD_SSS = 5789, I_VCMPTRUEPD = 5279, I_VCMPTRUEPS = 4877, I_VCMPTRUESD = 6083, - I_VCMPTRUESS = 5681, I_VCMPTRUE_USPD = 5497, I_VCMPTRUE_USPS = 5095, I_VCMPTRUE_USSD = 6301, - I_VCMPTRUE_USSS = 5899, I_VCMPUNORDPD = 5140, I_VCMPUNORDPS = 4738, I_VCMPUNORDSD = 5944, - I_VCMPUNORDSS = 5542, I_VCMPUNORD_SPD = 5330, I_VCMPUNORD_SPS = 4928, I_VCMPUNORD_SSD = 6134, - I_VCMPUNORD_SSS = 5732, I_VCOMISD = 2818, I_VCOMISS = 2809, I_VCVTDQ2PD = 6841, - I_VCVTDQ2PS = 3360, I_VCVTPD2DQ = 6852, I_VCVTPD2PS = 3296, I_VCVTPS2DQ = 3371, - I_VCVTPS2PD = 3285, I_VCVTSD2SI = 2744, I_VCVTSD2SS = 3318, I_VCVTSI2SD = 2558, - I_VCVTSI2SS = 2547, I_VCVTSS2SD = 3307, I_VCVTSS2SI = 2733, I_VCVTTPD2DQ = 6829, - I_VCVTTPS2DQ = 3382, I_VCVTTSD2SI = 2681, I_VCVTTSS2SI = 2669, I_VDIVPD = 3550, - I_VDIVPS = 3542, I_VDIVSD = 3566, I_VDIVSS = 3558, I_VDPPD = 9643, I_VDPPS = 9630, - I_VERR = 1679, I_VERW = 1685, I_VEXTRACTF128 = 9538, I_VEXTRACTPS = 9513, - I_VFMADD132PD = 8409, I_VFMADD132PS = 8396, I_VFMADD132SD = 8435, I_VFMADD132SS = 8422, - I_VFMADD213PD = 8689, I_VFMADD213PS = 8676, I_VFMADD213SD = 8715, I_VFMADD213SS = 8702, - I_VFMADD231PD = 8969, I_VFMADD231PS = 8956, I_VFMADD231SD = 8995, I_VFMADD231SS = 8982, - I_VFMADDSUB132PD = 8348, I_VFMADDSUB132PS = 8332, I_VFMADDSUB213PD = 8628, - I_VFMADDSUB213PS = 8612, I_VFMADDSUB231PD = 8908, I_VFMADDSUB231PS = 8892, - I_VFMSUB132PD = 8461, I_VFMSUB132PS = 8448, I_VFMSUB132SD = 8487, I_VFMSUB132SS = 8474, - I_VFMSUB213PD = 8741, I_VFMSUB213PS = 8728, I_VFMSUB213SD = 8767, I_VFMSUB213SS = 8754, - I_VFMSUB231PD = 9021, I_VFMSUB231PS = 9008, I_VFMSUB231SD = 9047, I_VFMSUB231SS = 9034, - I_VFMSUBADD132PD = 8380, I_VFMSUBADD132PS = 8364, I_VFMSUBADD213PD = 8660, - I_VFMSUBADD213PS = 8644, I_VFMSUBADD231PD = 8940, I_VFMSUBADD231PS = 8924, - I_VFNMADD132PD = 8514, I_VFNMADD132PS = 8500, I_VFNMADD132SD = 8542, I_VFNMADD132SS = 8528, - I_VFNMADD213PD = 8794, I_VFNMADD213PS = 8780, I_VFNMADD213SD = 8822, I_VFNMADD213SS = 8808, - I_VFNMADD231PD = 9074, I_VFNMADD231PS = 9060, I_VFNMADD231SD = 9102, I_VFNMADD231SS = 9088, - I_VFNMSUB132PD = 8570, I_VFNMSUB132PS = 8556, I_VFNMSUB132SD = 8598, I_VFNMSUB132SS = 8584, - I_VFNMSUB213PD = 8850, I_VFNMSUB213PS = 8836, I_VFNMSUB213SD = 8878, I_VFNMSUB213SS = 8864, - I_VFNMSUB231PD = 9130, I_VFNMSUB231PS = 9116, I_VFNMSUB231SD = 9158, I_VFNMSUB231SS = 9144, - I_VHADDPD = 4219, I_VHADDPS = 4228, I_VHSUBPD = 4253, I_VHSUBPS = 4262, I_VINSERTF128 = 9525, - I_VINSERTPS = 9579, I_VLDDQU = 7023, I_VLDMXCSR = 9963, I_VMASKMOVDQU = 7153, - I_VMASKMOVPD = 7971, I_VMASKMOVPS = 7959, I_VMAXPD = 3610, I_VMAXPS = 3602, - I_VMAXSD = 3626, I_VMAXSS = 3618, I_VMCALL = 1735, I_VMCLEAR = 10011, I_VMFUNC = 1803, - I_VMINPD = 3490, I_VMINPS = 3482, I_VMINSD = 3506, I_VMINSS = 3498, I_VMLAUNCH = 1743, - I_VMLOAD = 1833, I_VMMCALL = 1824, I_VMOVAPD = 2498, I_VMOVAPS = 2489, I_VMOVD = 3954, - I_VMOVDDUP = 2256, I_VMOVDQA = 3984, I_VMOVDQU = 3993, I_VMOVHLPS = 2217, - I_VMOVHPD = 2404, I_VMOVHPS = 2395, I_VMOVLHPS = 2385, I_VMOVLPD = 2236, I_VMOVLPS = 2227, - I_VMOVMSKPD = 2858, I_VMOVMSKPS = 2847, I_VMOVNTDQ = 6880, I_VMOVNTDQA = 7927, - I_VMOVNTPD = 2615, I_VMOVNTPS = 2605, I_VMOVQ = 3961, I_VMOVSD = 2165, I_VMOVSHDUP = 2413, - I_VMOVSLDUP = 2245, I_VMOVSS = 2157, I_VMOVUPD = 2148, I_VMOVUPS = 2139, I_VMPSADBW = 9659, - I_VMPTRLD = 10002, I_VMPTRST = 6407, I_VMREAD = 4150, I_VMRESUME = 1753, I_VMRUN = 1817, - I_VMSAVE = 1841, I_VMULPD = 3221, I_VMULPS = 3213, I_VMULSD = 3237, I_VMULSS = 3229, - I_VMWRITE = 4174, I_VMXOFF = 1763, I_VMXON = 10020, I_VORPD = 3088, I_VORPS = 3081, - I_VPABSB = 7717, I_VPABSD = 7747, I_VPABSW = 7732, I_VPACKSSDW = 3881, I_VPACKSSWB = 3713, - I_VPACKUSDW = 7948, I_VPACKUSWB = 3791, I_VPADDB = 7233, I_VPADDD = 7263, - I_VPADDQ = 6510, I_VPADDSB = 6960, I_VPADDSW = 6977, I_VPADDUSW = 6651, I_VPADDW = 7248, - I_VPALIGNR = 9441, I_VPAND = 6635, I_VPANDN = 6694, I_VPAVGB = 6709, I_VPAVGW = 6754, - I_VPBLENDVB = 9714, I_VPBLENDW = 9422, I_VPCLMULQDQ = 9680, I_VPCMPEQB = 4074, - I_VPCMPEQD = 4112, I_VPCMPEQQ = 7907, I_VPCMPEQW = 4093, I_VPCMPESTRI = 9759, - I_VPCMPESTRM = 9736, I_VPCMPGTB = 3733, I_VPCMPGTD = 3771, I_VPCMPGTQ = 8118, - I_VPCMPGTW = 3752, I_VPCMPISTRI = 9805, I_VPCMPISTRM = 9782, I_VPERM2F128 = 9287, - I_VPERMILPD = 7592, I_VPERMILPS = 7581, I_VPEXTRB = 9459, I_VPEXTRD = 9484, - I_VPEXTRQ = 9493, I_VPEXTRW = 6341, I_VPHADDD = 7405, I_VPHADDSW = 7423, I_VPHADDW = 7388, - I_VPHMINPOSUW = 8293, I_VPHSUBD = 7481, I_VPHSUBSW = 7499, I_VPHSUBW = 7464, - I_VPINSRB = 9560, I_VPINSRD = 9606, I_VPINSRQ = 9615, I_VPINSRW = 6324, I_VPMADDUBSW = 7444, - I_VPMADDWD = 7104, I_VPMAXSB = 8204, I_VPMAXSD = 8221, I_VPMAXSW = 6994, I_VPMAXUB = 6678, - I_VPMAXUD = 8255, I_VPMAXUW = 8238, I_VPMINSB = 8136, I_VPMINSD = 8153, I_VPMINSW = 6932, - I_VPMINUB = 6620, I_VPMINUD = 8187, I_VPMINUW = 8170, I_VPMOVMSKB = 6563, - I_VPMOVSXBD = 7786, I_VPMOVSXBQ = 7807, I_VPMOVSXBW = 7765, I_VPMOVSXDQ = 7870, - I_VPMOVSXWD = 7828, I_VPMOVSXWQ = 7849, I_VPMOVZXBD = 8014, I_VPMOVZXBQ = 8035, - I_VPMOVZXBW = 7993, I_VPMOVZXDQ = 8098, I_VPMOVZXWD = 8056, I_VPMOVZXWQ = 8077, - I_VPMULDQ = 7889, I_VPMULHRSW = 7570, I_VPMULHUW = 6771, I_VPMULHW = 6789, - I_VPMULLD = 8272, I_VPMULLW = 6526, I_VPMULUDQ = 7085, I_VPOR = 6946, I_VPSADBW = 7122, - I_VPSHUFB = 7371, I_VPSHUFD = 4036, I_VPSHUFHW = 4045, I_VPSHUFLW = 4055, - I_VPSIGNB = 7517, I_VPSIGND = 7551, I_VPSIGNW = 7534, I_VPSLLD = 7053, I_VPSLLDQ = 9877, - I_VPSLLQ = 7068, I_VPSLLW = 7038, I_VPSRAD = 6739, I_VPSRAW = 6724, I_VPSRLD = 6480, - I_VPSRLDQ = 9860, I_VPSRLQ = 6495, I_VPSRLW = 6465, I_VPSUBB = 7173, I_VPSUBD = 7203, - I_VPSUBQ = 7218, I_VPSUBSB = 6898, I_VPSUBSW = 6915, I_VPSUBUSB = 6583, I_VPSUBUSW = 6602, - I_VPSUBW = 7188, I_VPTEST = 7658, I_VPUNPCKHBW = 3813, I_VPUNPCKHDQ = 3859, - I_VPUNPCKHQDQ = 3929, I_VPUNPCKHWD = 3836, I_VPUNPCKLBW = 3645, I_VPUNPCKLDQ = 3691, - I_VPUNPCKLQDQ = 3904, I_VPUNPCKLWD = 3668, I_VPXOR = 7009, I_VRCPPS = 2989, - I_VRCPSS = 2997, I_VROUNDPD = 9327, I_VROUNDPS = 9308, I_VROUNDSD = 9365, - I_VROUNDSS = 9346, I_VRSQRTPS = 2955, I_VRSQRTSS = 2965, I_VSHUFPD = 6375, - I_VSHUFPS = 6366, I_VSQRTPD = 2910, I_VSQRTPS = 2901, I_VSQRTSD = 2928, I_VSQRTSS = 2919, - I_VSTMXCSR = 9992, I_VSUBPD = 3430, I_VSUBPS = 3422, I_VSUBSD = 3446, I_VSUBSS = 3438, - I_VTESTPD = 7612, I_VTESTPS = 7603, I_VUCOMISD = 2783, I_VUCOMISS = 2773, - I_VUNPCKHPD = 2339, I_VUNPCKHPS = 2328, I_VUNPCKLPD = 2297, I_VUNPCKLPS = 2286, - I_VXORPD = 3117, I_VXORPS = 3109, I_VZEROALL = 4140, I_VZEROUPPER = 4128, - I_WAIT = 10042, I_WBINVD = 561, I_WRFSBASE = 9953, I_WRGSBASE = 9982, I_WRMSR = 586, - I_XABORT = 1007, I_XADD = 946, I_XBEGIN = 1015, I_XCHG = 212, I_XEND = 1811, - I_XGETBV = 1787, I_XLAT = 400, I_XOR = 61, I_XORPD = 3102, I_XORPS = 3095, - I_XRSTOR = 4295, I_XRSTOR64 = 4303, I_XSAVE = 4271, I_XSAVE64 = 4278, I_XSAVEOPT = 4321, - I_XSAVEOPT64 = 4331, I_XSETBV = 1795, I__3DNOW = 10056 + I_SETO = 761, I_SETP = 826, I_SETS = 813, I_SETZ = 787, I_SFENCE = 4355, I_SGDT = 1691, + I_SHL = 987, I_SHLD = 876, I_SHR = 992, I_SHRD = 892, I_SHUFPD = 6370, I_SHUFPS = 6362, + I_SIDT = 1697, I_SKINIT = 1873, I_SLDT = 1657, I_SMSW = 1715, I_SQRTPD = 2889, + I_SQRTPS = 2881, I_SQRTSD = 2905, I_SQRTSS = 2897, I_STAC = 1793, I_STC = 497, + I_STD = 517, I_STGI = 1861, I_STI = 507, I_STMXCSR = 9985, I_STOS = 307, I_STR = 1663, + I_SUB = 51, I_SUBPD = 3413, I_SUBPS = 3406, I_SUBSD = 3427, I_SUBSS = 3420, + I_SWAPGS = 1890, I_SYSCALL = 532, I_SYSENTER = 614, I_SYSEXIT = 624, I_SYSRET = 547, + I_TEST = 206, I_TZCNT = 4385, I_UCOMISD = 2776, I_UCOMISS = 2767, I_UD2 = 569, + I_UNPCKHPD = 2330, I_UNPCKHPS = 2320, I_UNPCKLPD = 2288, I_UNPCKLPS = 2278, + I_VADDPD = 3173, I_VADDPS = 3165, I_VADDSD = 3189, I_VADDSS = 3181, I_VADDSUBPD = 6448, + I_VADDSUBPS = 6459, I_VAESDEC = 9251, I_VAESDECLAST = 9272, I_VAESENC = 9209, + I_VAESENCLAST = 9230, I_VAESIMC = 9192, I_VAESKEYGENASSIST = 9846, I_VANDNPD = 3072, + I_VANDNPS = 3063, I_VANDPD = 3039, I_VANDPS = 3031, I_VBLENDPD = 9415, I_VBLENDPS = 9396, + I_VBLENDVPD = 9715, I_VBLENDVPS = 9704, I_VBROADCASTF128 = 7706, I_VBROADCASTSD = 7692, + I_VBROADCASTSS = 7678, I_VCMPEQPD = 5122, I_VCMPEQPS = 4720, I_VCMPEQSD = 5926, + I_VCMPEQSS = 5524, I_VCMPEQ_OSPD = 5303, I_VCMPEQ_OSPS = 4901, I_VCMPEQ_OSSD = 6107, + I_VCMPEQ_OSSS = 5705, I_VCMPEQ_UQPD = 5209, I_VCMPEQ_UQPS = 4807, I_VCMPEQ_UQSD = 6013, + I_VCMPEQ_UQSS = 5611, I_VCMPEQ_USPD = 5412, I_VCMPEQ_USPS = 5010, I_VCMPEQ_USSD = 6216, + I_VCMPEQ_USSS = 5814, I_VCMPFALSEPD = 5244, I_VCMPFALSEPS = 4842, I_VCMPFALSESD = 6048, + I_VCMPFALSESS = 5646, I_VCMPFALSE_OSPD = 5453, I_VCMPFALSE_OSPS = 5051, I_VCMPFALSE_OSSD = 6257, + I_VCMPFALSE_OSSS = 5855, I_VCMPGEPD = 5271, I_VCMPGEPS = 4869, I_VCMPGESD = 6075, + I_VCMPGESS = 5673, I_VCMPGE_OQPD = 5483, I_VCMPGE_OQPS = 5081, I_VCMPGE_OQSD = 6287, + I_VCMPGE_OQSS = 5885, I_VCMPGTPD = 5281, I_VCMPGTPS = 4879, I_VCMPGTSD = 6085, + I_VCMPGTSS = 5683, I_VCMPGT_OQPD = 5496, I_VCMPGT_OQPS = 5094, I_VCMPGT_OQSD = 6300, + I_VCMPGT_OQSS = 5898, I_VCMPLEPD = 5142, I_VCMPLEPS = 4740, I_VCMPLESD = 5946, + I_VCMPLESS = 5544, I_VCMPLE_OQPD = 5329, I_VCMPLE_OQPS = 4927, I_VCMPLE_OQSD = 6133, + I_VCMPLE_OQSS = 5731, I_VCMPLTPD = 5132, I_VCMPLTPS = 4730, I_VCMPLTSD = 5936, + I_VCMPLTSS = 5534, I_VCMPLT_OQPD = 5316, I_VCMPLT_OQPS = 4914, I_VCMPLT_OQSD = 6120, + I_VCMPLT_OQSS = 5718, I_VCMPNEQPD = 5165, I_VCMPNEQPS = 4763, I_VCMPNEQSD = 5969, + I_VCMPNEQSS = 5567, I_VCMPNEQ_OQPD = 5257, I_VCMPNEQ_OQPS = 4855, I_VCMPNEQ_OQSD = 6061, + I_VCMPNEQ_OQSS = 5659, I_VCMPNEQ_OSPD = 5469, I_VCMPNEQ_OSPS = 5067, I_VCMPNEQ_OSSD = 6273, + I_VCMPNEQ_OSSS = 5871, I_VCMPNEQ_USPD = 5357, I_VCMPNEQ_USPS = 4955, I_VCMPNEQ_USSD = 6161, + I_VCMPNEQ_USSS = 5759, I_VCMPNGEPD = 5222, I_VCMPNGEPS = 4820, I_VCMPNGESD = 6026, + I_VCMPNGESS = 5624, I_VCMPNGE_UQPD = 5425, I_VCMPNGE_UQPS = 5023, I_VCMPNGE_UQSD = 6229, + I_VCMPNGE_UQSS = 5827, I_VCMPNGTPD = 5233, I_VCMPNGTPS = 4831, I_VCMPNGTSD = 6037, + I_VCMPNGTSS = 5635, I_VCMPNGT_UQPD = 5439, I_VCMPNGT_UQPS = 5037, I_VCMPNGT_UQSD = 6243, + I_VCMPNGT_UQSS = 5841, I_VCMPNLEPD = 5187, I_VCMPNLEPS = 4785, I_VCMPNLESD = 5991, + I_VCMPNLESS = 5589, I_VCMPNLE_UQPD = 5385, I_VCMPNLE_UQPS = 4983, I_VCMPNLE_UQSD = 6189, + I_VCMPNLE_UQSS = 5787, I_VCMPNLTPD = 5176, I_VCMPNLTPS = 4774, I_VCMPNLTSD = 5980, + I_VCMPNLTSS = 5578, I_VCMPNLT_UQPD = 5371, I_VCMPNLT_UQPS = 4969, I_VCMPNLT_UQSD = 6175, + I_VCMPNLT_UQSS = 5773, I_VCMPORDPD = 5198, I_VCMPORDPS = 4796, I_VCMPORDSD = 6002, + I_VCMPORDSS = 5600, I_VCMPORD_SPD = 5399, I_VCMPORD_SPS = 4997, I_VCMPORD_SSD = 6203, + I_VCMPORD_SSS = 5801, I_VCMPTRUEPD = 5291, I_VCMPTRUEPS = 4889, I_VCMPTRUESD = 6095, + I_VCMPTRUESS = 5693, I_VCMPTRUE_USPD = 5509, I_VCMPTRUE_USPS = 5107, I_VCMPTRUE_USSD = 6313, + I_VCMPTRUE_USSS = 5911, I_VCMPUNORDPD = 5152, I_VCMPUNORDPS = 4750, I_VCMPUNORDSD = 5956, + I_VCMPUNORDSS = 5554, I_VCMPUNORD_SPD = 5342, I_VCMPUNORD_SPS = 4940, I_VCMPUNORD_SSD = 6146, + I_VCMPUNORD_SSS = 5744, I_VCOMISD = 2830, I_VCOMISS = 2821, I_VCVTDQ2PD = 6853, + I_VCVTDQ2PS = 3372, I_VCVTPD2DQ = 6864, I_VCVTPD2PS = 3308, I_VCVTPS2DQ = 3383, + I_VCVTPS2PD = 3297, I_VCVTSD2SI = 2756, I_VCVTSD2SS = 3330, I_VCVTSI2SD = 2570, + I_VCVTSI2SS = 2559, I_VCVTSS2SD = 3319, I_VCVTSS2SI = 2745, I_VCVTTPD2DQ = 6841, + I_VCVTTPS2DQ = 3394, I_VCVTTSD2SI = 2693, I_VCVTTSS2SI = 2681, I_VDIVPD = 3562, + I_VDIVPS = 3554, I_VDIVSD = 3578, I_VDIVSS = 3570, I_VDPPD = 9655, I_VDPPS = 9642, + I_VERR = 1679, I_VERW = 1685, I_VEXTRACTF128 = 9550, I_VEXTRACTPS = 9525, + I_VFMADD132PD = 8421, I_VFMADD132PS = 8408, I_VFMADD132SD = 8447, I_VFMADD132SS = 8434, + I_VFMADD213PD = 8701, I_VFMADD213PS = 8688, I_VFMADD213SD = 8727, I_VFMADD213SS = 8714, + I_VFMADD231PD = 8981, I_VFMADD231PS = 8968, I_VFMADD231SD = 9007, I_VFMADD231SS = 8994, + I_VFMADDSUB132PD = 8360, I_VFMADDSUB132PS = 8344, I_VFMADDSUB213PD = 8640, + I_VFMADDSUB213PS = 8624, I_VFMADDSUB231PD = 8920, I_VFMADDSUB231PS = 8904, + I_VFMSUB132PD = 8473, I_VFMSUB132PS = 8460, I_VFMSUB132SD = 8499, I_VFMSUB132SS = 8486, + I_VFMSUB213PD = 8753, I_VFMSUB213PS = 8740, I_VFMSUB213SD = 8779, I_VFMSUB213SS = 8766, + I_VFMSUB231PD = 9033, I_VFMSUB231PS = 9020, I_VFMSUB231SD = 9059, I_VFMSUB231SS = 9046, + I_VFMSUBADD132PD = 8392, I_VFMSUBADD132PS = 8376, I_VFMSUBADD213PD = 8672, + I_VFMSUBADD213PS = 8656, I_VFMSUBADD231PD = 8952, I_VFMSUBADD231PS = 8936, + I_VFNMADD132PD = 8526, I_VFNMADD132PS = 8512, I_VFNMADD132SD = 8554, I_VFNMADD132SS = 8540, + I_VFNMADD213PD = 8806, I_VFNMADD213PS = 8792, I_VFNMADD213SD = 8834, I_VFNMADD213SS = 8820, + I_VFNMADD231PD = 9086, I_VFNMADD231PS = 9072, I_VFNMADD231SD = 9114, I_VFNMADD231SS = 9100, + I_VFNMSUB132PD = 8582, I_VFNMSUB132PS = 8568, I_VFNMSUB132SD = 8610, I_VFNMSUB132SS = 8596, + I_VFNMSUB213PD = 8862, I_VFNMSUB213PS = 8848, I_VFNMSUB213SD = 8890, I_VFNMSUB213SS = 8876, + I_VFNMSUB231PD = 9142, I_VFNMSUB231PS = 9128, I_VFNMSUB231SD = 9170, I_VFNMSUB231SS = 9156, + I_VHADDPD = 4231, I_VHADDPS = 4240, I_VHSUBPD = 4265, I_VHSUBPS = 4274, I_VINSERTF128 = 9537, + I_VINSERTPS = 9591, I_VLDDQU = 7035, I_VLDMXCSR = 9975, I_VMASKMOVDQU = 7165, + I_VMASKMOVPD = 7983, I_VMASKMOVPS = 7971, I_VMAXPD = 3622, I_VMAXPS = 3614, + I_VMAXSD = 3638, I_VMAXSS = 3630, I_VMCALL = 1735, I_VMCLEAR = 10023, I_VMFUNC = 1815, + I_VMINPD = 3502, I_VMINPS = 3494, I_VMINSD = 3518, I_VMINSS = 3510, I_VMLAUNCH = 1743, + I_VMLOAD = 1845, I_VMMCALL = 1836, I_VMOVAPD = 2510, I_VMOVAPS = 2501, I_VMOVD = 3966, + I_VMOVDDUP = 2268, I_VMOVDQA = 3996, I_VMOVDQU = 4005, I_VMOVHLPS = 2229, + I_VMOVHPD = 2416, I_VMOVHPS = 2407, I_VMOVLHPS = 2397, I_VMOVLPD = 2248, I_VMOVLPS = 2239, + I_VMOVMSKPD = 2870, I_VMOVMSKPS = 2859, I_VMOVNTDQ = 6892, I_VMOVNTDQA = 7939, + I_VMOVNTPD = 2627, I_VMOVNTPS = 2617, I_VMOVQ = 3973, I_VMOVSD = 2177, I_VMOVSHDUP = 2425, + I_VMOVSLDUP = 2257, I_VMOVSS = 2169, I_VMOVUPD = 2160, I_VMOVUPS = 2151, I_VMPSADBW = 9671, + I_VMPTRLD = 10014, I_VMPTRST = 6419, I_VMREAD = 4162, I_VMRESUME = 1753, I_VMRUN = 1829, + I_VMSAVE = 1853, I_VMULPD = 3233, I_VMULPS = 3225, I_VMULSD = 3249, I_VMULSS = 3241, + I_VMWRITE = 4186, I_VMXOFF = 1763, I_VMXON = 10032, I_VORPD = 3100, I_VORPS = 3093, + I_VPABSB = 7729, I_VPABSD = 7759, I_VPABSW = 7744, I_VPACKSSDW = 3893, I_VPACKSSWB = 3725, + I_VPACKUSDW = 7960, I_VPACKUSWB = 3803, I_VPADDB = 7245, I_VPADDD = 7275, + I_VPADDQ = 6522, I_VPADDSB = 6972, I_VPADDSW = 6989, I_VPADDUSW = 6663, I_VPADDW = 7260, + I_VPALIGNR = 9453, I_VPAND = 6647, I_VPANDN = 6706, I_VPAVGB = 6721, I_VPAVGW = 6766, + I_VPBLENDVB = 9726, I_VPBLENDW = 9434, I_VPCLMULQDQ = 9692, I_VPCMPEQB = 4086, + I_VPCMPEQD = 4124, I_VPCMPEQQ = 7919, I_VPCMPEQW = 4105, I_VPCMPESTRI = 9771, + I_VPCMPESTRM = 9748, I_VPCMPGTB = 3745, I_VPCMPGTD = 3783, I_VPCMPGTQ = 8130, + I_VPCMPGTW = 3764, I_VPCMPISTRI = 9817, I_VPCMPISTRM = 9794, I_VPERM2F128 = 9299, + I_VPERMILPD = 7604, I_VPERMILPS = 7593, I_VPEXTRB = 9471, I_VPEXTRD = 9496, + I_VPEXTRQ = 9505, I_VPEXTRW = 6353, I_VPHADDD = 7417, I_VPHADDSW = 7435, I_VPHADDW = 7400, + I_VPHMINPOSUW = 8305, I_VPHSUBD = 7493, I_VPHSUBSW = 7511, I_VPHSUBW = 7476, + I_VPINSRB = 9572, I_VPINSRD = 9618, I_VPINSRQ = 9627, I_VPINSRW = 6336, I_VPMADDUBSW = 7456, + I_VPMADDWD = 7116, I_VPMAXSB = 8216, I_VPMAXSD = 8233, I_VPMAXSW = 7006, I_VPMAXUB = 6690, + I_VPMAXUD = 8267, I_VPMAXUW = 8250, I_VPMINSB = 8148, I_VPMINSD = 8165, I_VPMINSW = 6944, + I_VPMINUB = 6632, I_VPMINUD = 8199, I_VPMINUW = 8182, I_VPMOVMSKB = 6575, + I_VPMOVSXBD = 7798, I_VPMOVSXBQ = 7819, I_VPMOVSXBW = 7777, I_VPMOVSXDQ = 7882, + I_VPMOVSXWD = 7840, I_VPMOVSXWQ = 7861, I_VPMOVZXBD = 8026, I_VPMOVZXBQ = 8047, + I_VPMOVZXBW = 8005, I_VPMOVZXDQ = 8110, I_VPMOVZXWD = 8068, I_VPMOVZXWQ = 8089, + I_VPMULDQ = 7901, I_VPMULHRSW = 7582, I_VPMULHUW = 6783, I_VPMULHW = 6801, + I_VPMULLD = 8284, I_VPMULLW = 6538, I_VPMULUDQ = 7097, I_VPOR = 6958, I_VPSADBW = 7134, + I_VPSHUFB = 7383, I_VPSHUFD = 4048, I_VPSHUFHW = 4057, I_VPSHUFLW = 4067, + I_VPSIGNB = 7529, I_VPSIGND = 7563, I_VPSIGNW = 7546, I_VPSLLD = 7065, I_VPSLLDQ = 9889, + I_VPSLLQ = 7080, I_VPSLLW = 7050, I_VPSRAD = 6751, I_VPSRAW = 6736, I_VPSRLD = 6492, + I_VPSRLDQ = 9872, I_VPSRLQ = 6507, I_VPSRLW = 6477, I_VPSUBB = 7185, I_VPSUBD = 7215, + I_VPSUBQ = 7230, I_VPSUBSB = 6910, I_VPSUBSW = 6927, I_VPSUBUSB = 6595, I_VPSUBUSW = 6614, + I_VPSUBW = 7200, I_VPTEST = 7670, I_VPUNPCKHBW = 3825, I_VPUNPCKHDQ = 3871, + I_VPUNPCKHQDQ = 3941, I_VPUNPCKHWD = 3848, I_VPUNPCKLBW = 3657, I_VPUNPCKLDQ = 3703, + I_VPUNPCKLQDQ = 3916, I_VPUNPCKLWD = 3680, I_VPXOR = 7021, I_VRCPPS = 3001, + I_VRCPSS = 3009, I_VROUNDPD = 9339, I_VROUNDPS = 9320, I_VROUNDSD = 9377, + I_VROUNDSS = 9358, I_VRSQRTPS = 2967, I_VRSQRTSS = 2977, I_VSHUFPD = 6387, + I_VSHUFPS = 6378, I_VSQRTPD = 2922, I_VSQRTPS = 2913, I_VSQRTSD = 2940, I_VSQRTSS = 2931, + I_VSTMXCSR = 10004, I_VSUBPD = 3442, I_VSUBPS = 3434, I_VSUBSD = 3458, I_VSUBSS = 3450, + I_VTESTPD = 7624, I_VTESTPS = 7615, I_VUCOMISD = 2795, I_VUCOMISS = 2785, + I_VUNPCKHPD = 2351, I_VUNPCKHPS = 2340, I_VUNPCKLPD = 2309, I_VUNPCKLPS = 2298, + I_VXORPD = 3129, I_VXORPS = 3121, I_VZEROALL = 4152, I_VZEROUPPER = 4140, + I_WAIT = 10054, I_WBINVD = 561, I_WRFSBASE = 9965, I_WRGSBASE = 9994, I_WRMSR = 586, + I_XABORT = 1007, I_XADD = 946, I_XBEGIN = 1015, I_XCHG = 212, I_XEND = 1823, + I_XGETBV = 1799, I_XLAT = 400, I_XOR = 61, I_XORPD = 3114, I_XORPS = 3107, + I_XRSTOR = 4307, I_XRSTOR64 = 4315, I_XSAVE = 4283, I_XSAVE64 = 4290, I_XSAVEOPT = 4333, + I_XSAVEOPT64 = 4343, I_XSETBV = 1807, I__3DNOW = 10068 } _InstructionType; typedef enum { diff --git a/NativeCore/Dependencies/distorm/src/config.h b/NativeCore/Dependencies/distorm/src/config.h index 3fdaf44a..e78dba36 100644 --- a/NativeCore/Dependencies/distorm/src/config.h +++ b/NativeCore/Dependencies/distorm/src/config.h @@ -4,7 +4,7 @@ config.h diStorm3 - Powerful disassembler for X86/AMD64 http://ragestorm.net/distorm/ distorm at gmail dot com -Copyright (C) 2003-2018 Gil Dabah +Copyright (C) 2003-2021 Gil Dabah This library is licensed under the BSD license. See the file COPYING. */ @@ -13,7 +13,7 @@ This library is licensed under the BSD license. See the file COPYING. #define CONFIG_H /* diStorm version number. */ -#define __DISTORMV__ 0x030400 +#define __DISTORMV__ 0x030502 #include /* memset, memcpy - can be easily self implemented for libc independency. */ @@ -57,6 +57,7 @@ This library is licensed under the BSD license. See the file COPYING. #define _DLLEXPORT_ #define _FASTCALL_ +/* Keep inline as static (arrrrg) as it would break linux on some flavors otherwise. */ #define _INLINE_ static /* GCC ignores this directive... */ /*#define _FASTCALL_ __attribute__((__fastcall__))*/ @@ -94,7 +95,7 @@ This library is licensed under the BSD license. See the file COPYING. #define _DLLEXPORT_ #define _FASTCALL_ -#define _INLINE_ +#define _INLINE_ static /* End of __TINYC__ */ diff --git a/NativeCore/Dependencies/distorm/src/decoder.c b/NativeCore/Dependencies/distorm/src/decoder.c index 188996df..29adcd43 100644 --- a/NativeCore/Dependencies/distorm/src/decoder.c +++ b/NativeCore/Dependencies/distorm/src/decoder.c @@ -4,7 +4,7 @@ decoder.c diStorm3 - Powerful disassembler for X86/AMD64 http://ragestorm.net/distorm/ distorm at gmail dot com -Copyright (C) 2003-2018 Gil Dabah +Copyright (C) 2003-2021 Gil Dabah This library is licensed under the BSD license. See the file COPYING. */ @@ -24,30 +24,34 @@ This library is licensed under the BSD license. See the file COPYING. static _DecodeType decode_get_effective_addr_size(_DecodeType dt, _iflags decodedPrefixes) { /* - * This table is to map from the current decoding mode to an effective address size: + * Map from the current decoding mode to an effective address size: * Decode16 -> Decode32 * Decode32 -> Decode16 * Decode64 -> Decode32 */ - static _DecodeType AddrSizeTable[] = {Decode32Bits, Decode16Bits, Decode32Bits}; /* Switch to non default mode if prefix exists, only for ADDRESS SIZE. */ - if (decodedPrefixes & INST_PRE_ADDR_SIZE) dt = AddrSizeTable[dt]; + if (decodedPrefixes & INST_PRE_ADDR_SIZE) { + if (dt == Decode32Bits) return Decode16Bits; + return Decode32Bits; + } return dt; } static _DecodeType decode_get_effective_op_size(_DecodeType dt, _iflags decodedPrefixes, unsigned int rex, _iflags instFlags) { /* - * This table is to map from the current decoding mode to an effective operand size: + * Map from the current decoding mode to an effective operand size: * Decode16 -> Decode32 * Decode32 -> Decode16 * Decode64 -> Decode16 * Not that in 64bits it's a bit more complicated, because of REX and promoted instructions. */ - static _DecodeType OpSizeTable[] = {Decode32Bits, Decode16Bits, Decode16Bits}; - if (decodedPrefixes & INST_PRE_OP_SIZE) return OpSizeTable[dt]; + if (decodedPrefixes & INST_PRE_OP_SIZE) { + if (dt == Decode16Bits) return Decode32Bits; + return Decode16Bits; + } if (dt == Decode64Bits) { /* @@ -60,83 +64,71 @@ static _DecodeType decode_get_effective_op_size(_DecodeType dt, _iflags decodedP /* Automatically promoted instructions have only INST_64BITS SET! */ if (((instFlags & (INST_64BITS | INST_PRE_REX)) == INST_64BITS) || /* Other instructions in 64 bits can be promoted only with a REX prefix. */ - ((decodedPrefixes & INST_PRE_REX) && (rex & PREFIX_EX_W))) dt = Decode64Bits; - else dt = Decode32Bits; /* Default. */ + ((decodedPrefixes & INST_PRE_REX) && (rex & PREFIX_EX_W))) return Decode64Bits; + return Decode32Bits; /* Default. */ } + return dt; } -/* A helper macro to convert from diStorm's CPU flags to EFLAGS. */ +/* + * A helper macro to convert from diStorm's CPU flags to EFLAGS. + * Copy eflags from compact version (8 bits) to eflags compatible (16 bits). + * From D_COMPACT_IF to D_IF, bit index 1 to 9. + * From D_COMPACT_DF to D_DF, bit index 3 to 10. + * From D_COMPACT_OF to D_OF, bit index 5 to 11. + */ #define CONVERT_FLAGS_TO_EFLAGS(dst, src, field) dst->field = ((src->field & D_COMPACT_SAME_FLAGS) | \ - ((src->field & D_COMPACT_IF) ? D_IF : 0) | \ - ((src->field & D_COMPACT_DF) ? D_DF : 0) | \ - ((src->field & D_COMPACT_OF) ? D_OF : 0)); + ((src->field & D_COMPACT_IF) << (9 - 1)) | \ + ((src->field & D_COMPACT_DF) << (10 - 3)) | \ + ((src->field & D_COMPACT_OF) << (11 - 5))); -static _DecodeResult decode_inst(_CodeInfo* ci, _PrefixState* ps, _DInst* di) +/* If DECRES_SUCCESS is returned, CI is in sync, otherwise it loses sync. */ +/* Important note: CI is keeping track only for code and codeLen, in case of a failure caller has to restart on their own. */ +static _DecodeResult decode_inst(_CodeInfo* ci, _PrefixState* ps, const uint8_t* startCode, _DInst* di) { - /* Remember whether the instruction is privileged. */ - uint16_t privilegedFlag = 0; - - /* The ModR/M byte of the current instruction. */ - unsigned int modrm = 0; - - /* The REX/VEX prefix byte value. */ - unsigned int vrex = ps->vrex; - - /* - * Backup original input, so we can use it later if a problem occurs - * (like not enough data for decoding, invalid opcode, etc). - */ - const uint8_t* startCode = ci->code; - /* Holds the info about the current found instruction. */ - _InstInfo* ii = NULL; - _InstInfo iip; /* Privileged instruction cache. */ - _InstSharedInfo* isi = NULL; - - /* Used only for special CMP instructions which have pseudo opcodes suffix. */ - unsigned char cmpType = 0; - - /* - * Indicates whether it is right to LOCK the instruction by decoding its first operand. - * Only then you know if it's ok to output the LOCK prefix's text... - * Used for first operand only. - */ - int lockable = FALSE; + _InstInfo* ii; + _InstSharedInfo* isi; /* Calculate (and cache) effective-operand-size and effective-address-size only once. */ _DecodeType effOpSz, effAdrSz; _iflags instFlags; - ii = inst_lookup(ci, ps); + /* The ModR/M byte of the current instruction. */ + unsigned int modrm = 0; + int isPrefixed = 0; + + ii = inst_lookup(ci, ps, &isPrefixed); if (ii == NULL) goto _Undecodable; + isi = &InstSharedInfoTable[ii->sharedIndex]; instFlags = FlagsTable[isi->flagsIndex]; - privilegedFlag = ii->opcodeId & OPCODE_ID_PRIVILEGED; - if (privilegedFlag) { + /* Cache the effective operand-size and address-size. */ + if (isPrefixed) { + /* - * Copy the privileged instruction info so we can remove the privileged bit - * from the opcodeId field. This makes sure we're not modifying the tables - * in case we lookup this privileged instruction later. - */ - iip = *ii; - iip.opcodeId &= ~OPCODE_ID_PRIVILEGED; - ii = &iip; - } + * If both REX and OpSize are available we will have to disable the OpSize, because REX has precedence. + * However, only if REX.W is set! + * We had to wait with this test, since the operand size may be a mandatory prefix, + * and we know it only after fetching opcode. + */ + if ((ps->decodedPrefixes & INST_PRE_OP_SIZE) && + (ps->prefixExtType == PET_REX) && + (ps->vrex & PREFIX_EX_W) && + (!ps->isOpSizeMandatory)) { + ps->decodedPrefixes &= ~INST_PRE_OP_SIZE; + prefixes_ignore(ps, PFXIDX_OP_SIZE); + } - /* - * If both REX and OpSize are available we will have to disable the OpSize, because REX has precedence. - * However, only if REX.W is set ! - * We had to wait with this test, since the operand size may be a mandatory prefix, - * and we know it only after prefetching. - */ - if ((ps->prefixExtType == PET_REX) && - (ps->decodedPrefixes & INST_PRE_OP_SIZE) && - (!ps->isOpSizeMandatory) && - (vrex & PREFIX_EX_W)) { - ps->decodedPrefixes &= ~INST_PRE_OP_SIZE; - prefixes_ignore(ps, PFXIDX_OP_SIZE); + effAdrSz = decode_get_effective_addr_size(ci->dt, ps->decodedPrefixes); + effOpSz = decode_get_effective_op_size(ci->dt, ps->decodedPrefixes, ps->vrex, instFlags); + } + else + { + effAdrSz = ci->dt; /* Default is current decoding type since there's no prefix. */ + effOpSz = decode_get_effective_op_size(ci->dt, 0, 0, instFlags); } /* @@ -153,161 +145,188 @@ static _DecodeResult decode_inst(_CodeInfo* ci, _PrefixState* ps, _DInst* di) * Though, don't drop an instruction which is also supported in 16 and 32 bits. */ - /* ! ! ! DISABLED UNTIL FURTHER NOTICE ! ! ! Decode16Bits CAN NOW DECODE 32 BITS INSTRUCTIONS ! ! !*/ - /* if (ii && (dt == Decode16Bits) && (instFlags & INST_32BITS) && (~instFlags & INST_16BITS)) ii = NULL; */ + /* ! ! ! DISABLED UNTIL FURTHER NOTICE ! ! ! Decode16Bits CAN NOW DECODE 32 BITS INSTRUCTIONS ! ! !*/ + /* if (ii && (dt == Decode16Bits) && (instFlags & INST_32BITS) && (~instFlags & INST_16BITS)) ii = NULL; */ - /* Drop instructions which are invalid in 64 bits. */ - if ((ci->dt == Decode64Bits) && (instFlags & INST_INVALID_64BITS)) goto _Undecodable; - - /* If it's only a 64 bits instruction drop it in other decoding modes. */ - if ((ci->dt != Decode64Bits) && (instFlags & INST_64BITS_FETCH)) goto _Undecodable; + memset(di, 0, sizeof(_DInst)); if (instFlags & INST_MODRM_REQUIRED) { /* If the ModRM byte is not part of the opcode, skip the last byte code, so code points now to ModRM. */ - if (~instFlags & INST_MODRM_INCLUDED) { + if (!(instFlags & INST_MODRM_INCLUDED)) { ci->code++; if (--ci->codeLen < 0) goto _Undecodable; } modrm = *ci->code; - - /* Some instructions enforce that reg=000, so validate that. (Specifically EXTRQ). */ - if ((instFlags & INST_FORCE_REG0) && (((modrm >> 3) & 7) != 0)) goto _Undecodable; - /* Some instructions enforce that mod=11, so validate that. */ - if ((instFlags & INST_MODRR_REQUIRED) && (modrm < INST_DIVIDED_MODRM)) goto _Undecodable; } ci->code++; /* Skip the last byte we just read (either last opcode's byte code or a ModRM). */ - /* Cache the effective operand-size and address-size. */ - effOpSz = decode_get_effective_op_size(ci->dt, ps->decodedPrefixes, vrex, instFlags); - effAdrSz = decode_get_effective_addr_size(ci->dt, ps->decodedPrefixes); - - memset(di, 0, sizeof(_DInst)); - di->base = R_NONE; + di->addr = ci->codeOffset & ci->addrMask; + di->opcode = ii->opcodeId; + di->flags = isi->meta & META_INST_PRIVILEGED; /* - * Try to extract the next operand only if the latter exists. - * For example, if there is not first operand, no reason to try to extract second operand... - * I decided that a for-break is better for readability in this specific case than goto. - * Note: do-while with a constant 0 makes the compiler warning about it. + * Store the address size inside the flags. + * This is necessary for the caller to know the size of rSP when using PUSHA for example. */ - for (;;) { - if (isi->d != OT_NONE) { - if (!operands_extract(ci, di, ii, instFlags, (_OpType)isi->d, ONT_1, modrm, ps, effOpSz, effAdrSz, &lockable)) goto _Undecodable; - } else break; + di->base = R_NONE; + di->segment = R_NONE; + + FLAG_SET_ADDRSIZE(di, effAdrSz); + + /* Try to extract the next operand only if the latter exists. */ + if (isi->d != OT_NONE) { + unsigned int opsNo = 1; + _Operand* op = &di->ops[0]; + if (instFlags & (INST_MODRR_REQUIRED | INST_FORCE_REG0)) { + /* Some instructions enforce that mod=11, so validate that. */ + if ((modrm < INST_DIVIDED_MODRM) && (instFlags & INST_MODRR_REQUIRED)) goto _Undecodable; + /* Some instructions enforce that reg=000, so validate that. (Specifically EXTRQ). */ + if ((instFlags & INST_FORCE_REG0) && (((modrm >> 3) & 7) != 0)) goto _Undecodable; + } + if (!operands_extract(ci, di, ii, instFlags, (_OpType)isi->d, modrm, ps, effOpSz, effAdrSz, op++)) goto _Undecodable; if (isi->s != OT_NONE) { - if (!operands_extract(ci, di, ii, instFlags, (_OpType)isi->s, ONT_2, modrm, ps, effOpSz, effAdrSz, NULL)) goto _Undecodable; - } else break; - - /* Use third operand, only if the flags says this InstInfo requires it. */ - if (instFlags & INST_USE_OP3) { - if (!operands_extract(ci, di, ii, instFlags, (_OpType)((_InstInfoEx*)ii)->op3, ONT_3, modrm, ps, effOpSz, effAdrSz, NULL)) goto _Undecodable; - } else break; - - /* Support for a fourth operand is added for (i.e:) INSERTQ instruction. */ - if (instFlags & INST_USE_OP4) { - if (!operands_extract(ci, di, ii, instFlags, (_OpType)((_InstInfoEx*)ii)->op4, ONT_4, modrm, ps, effOpSz, effAdrSz, NULL)) goto _Undecodable; + if (!operands_extract(ci, di, ii, instFlags, (_OpType)isi->s, modrm, ps, effOpSz, effAdrSz, op++)) goto _Undecodable; + opsNo++; + /* Use third operand, only if the flags says this InstInfo requires it. */ + if (instFlags & INST_USE_OP3) { + if (!operands_extract(ci, di, ii, instFlags, (_OpType)((_InstInfoEx*)ii)->op3, modrm, ps, effOpSz, effAdrSz, op++)) goto _Undecodable; + opsNo++; + /* Support for a fourth operand is added for (e.g:) INSERTQ instruction. */ + if (instFlags & INST_USE_OP4) { + if (!operands_extract(ci, di, ii, instFlags, (_OpType)((_InstInfoEx*)ii)->op4, modrm, ps, effOpSz, effAdrSz, op++)) goto _Undecodable; + opsNo++; + } + } } - break; - } /* Continue here after all operands were extracted. */ - - /* If it were a 3DNow! instruction, we will have to find the instruction itself now that we got its operands extracted. */ - if (instFlags & INST_3DNOW_FETCH) { - ii = inst_lookup_3dnow(ci); - if (ii == NULL) goto _Undecodable; - isi = &InstSharedInfoTable[ii->sharedIndex]; - instFlags = FlagsTable[isi->flagsIndex]; + + /* Copy DST_WR flag. */ + di->flags |= (instFlags & INST_DST_WR) >> (31 - 6); /* Copy bit from INST_DST_WR (bit 31) to FLAG_DST_WR (bit 6). */ + /* operands_extract may touched it for FPU operands, so add on top. */ + di->opsNo += (uint8_t)opsNo; } - /* Check whether pseudo opcode is needed, only for CMP instructions: */ - if (instFlags & INST_PSEUDO_OPCODE) { - if (--ci->codeLen < 0) goto _Undecodable; - cmpType = *ci->code; - ci->code++; - if (instFlags & INST_PRE_VEX) { - /* AVX Comparison type must be between 0 to 32, otherwise Reserved. */ - if (cmpType >= INST_VCMP_MAX_RANGE) goto _Undecodable; - } else { - /* SSE Comparison type must be between 0 to 8, otherwise Reserved. */ - if (cmpType >= INST_CMP_MAX_RANGE) goto _Undecodable; + if (instFlags & (INST_3DNOW_FETCH | + INST_PSEUDO_OPCODE | + INST_NATIVE | + INST_PRE_REPNZ | + INST_PRE_REP | + INST_PRE_ADDR_SIZE | + INST_INVALID_64BITS | + INST_64BITS_FETCH)) { /* 8 for 1! */ + + /* If it's a native instruction copy OpSize Prefix. */ + if (ps && instFlags & INST_NATIVE) ps->usedPrefixes |= (ps->decodedPrefixes & INST_PRE_OP_SIZE); + + if (ci->dt != Decode64Bits) { + /* If it's only a 64 bits instruction drop it in other decoding modes. */ + if (instFlags & INST_64BITS_FETCH) goto _Undecodable; + } + else { + /* Drop instructions which are invalid in 64 bits. */ + if (instFlags & INST_INVALID_64BITS) goto _Undecodable; } - } - /* - * There's a limit of 15 bytes on instruction length. The only way to violate - * this limit is by putting redundant prefixes before an instruction. - * start points to first prefix if any, otherwise it points to instruction first byte. - */ - if ((ci->code - ps->start) > INST_MAXIMUM_SIZE) goto _Undecodable; /* Drop instruction. */ + /* If it were a 3DNow! instruction, we will have to find the instruction itself now that we got its operands extracted. */ + if (instFlags & INST_3DNOW_FETCH) { + ii = inst_lookup_3dnow(ci); + if (ii == NULL) goto _Undecodable; + isi = &InstSharedInfoTable[ii->sharedIndex]; + instFlags = FlagsTable[isi->flagsIndex]; + di->opcode = ii->opcodeId; + } - /* - * If we reached here the instruction was fully decoded, we located the instruction in the DB and extracted operands. - * Use the correct mnemonic according to the DT. - * If we are in 32 bits decoding mode it doesn't necessarily mean we will choose mnemonic2, alas, - * it means that if there is a mnemonic2, it will be used. - */ + /* Check whether pseudo opcode is needed, only for CMP instructions: */ + if (instFlags & INST_PSEUDO_OPCODE) { + /* Used only for special CMP instructions which have pseudo opcodes suffix. */ + unsigned int cmpType; - /* Start with prefix LOCK. */ - if ((lockable == TRUE) && (instFlags & INST_PRE_LOCK)) { - ps->usedPrefixes |= INST_PRE_LOCK; - di->flags |= FLAG_LOCK; - } else if ((instFlags & INST_PRE_REPNZ) && (ps->decodedPrefixes & INST_PRE_REPNZ)) { - ps->usedPrefixes |= INST_PRE_REPNZ; - di->flags |= FLAG_REPNZ; - } else if ((instFlags & INST_PRE_REP) && (ps->decodedPrefixes & INST_PRE_REP)) { - ps->usedPrefixes |= INST_PRE_REP; - di->flags |= FLAG_REP; - } + if (--ci->codeLen < 0) goto _Undecodable; + cmpType = *ci->code; + ci->code++; - /* If it's JeCXZ the ADDR_SIZE prefix affects them. */ - if ((instFlags & (INST_PRE_ADDR_SIZE | INST_USE_EXMNEMONIC)) == (INST_PRE_ADDR_SIZE | INST_USE_EXMNEMONIC)) { - ps->usedPrefixes |= INST_PRE_ADDR_SIZE; - if (effAdrSz == Decode16Bits) di->opcode = ii->opcodeId; - else if (effAdrSz == Decode32Bits) di->opcode = ((_InstInfoEx*)ii)->opcodeId2; - /* Ignore REX.W in 64bits, JECXZ is promoted. */ - else /* Decode64Bits */ di->opcode = ((_InstInfoEx*)ii)->opcodeId3; - } + /* + * The opcodeId is the offset to the FIRST pseudo compare mnemonic, + * we will have to fix it so it offsets into the corrected mnemonic. + * Therefore, we use another table to fix the offset. + */ + if (instFlags & INST_PRE_VEX) { + /* AVX Comparison type must be between 0 to 32, otherwise Reserved. */ + if (cmpType >= INST_VCMP_MAX_RANGE) goto _Undecodable; + + /* Use the AVX pseudo compare mnemonics table. */ + di->opcode = ii->opcodeId + VCmpMnemonicOffsets[cmpType]; + } + else { + /* SSE Comparison type must be between 0 to 8, otherwise Reserved. */ + if (cmpType >= INST_CMP_MAX_RANGE) goto _Undecodable; + di->opcode = ii->opcodeId + CmpMnemonicOffsets[cmpType]; + } + + goto _SkipOpcoding; + } + + /* Start with prefix REP/N/Z. */ + if (isPrefixed && (instFlags & (INST_PRE_REPNZ | INST_PRE_REP))) { + if ((instFlags & INST_PRE_REPNZ) && (ps->decodedPrefixes & INST_PRE_REPNZ)) { + ps->usedPrefixes |= INST_PRE_REPNZ; + di->flags |= FLAG_REPNZ; + } + else if ((instFlags & INST_PRE_REP) && (ps->decodedPrefixes & INST_PRE_REP)) { + ps->usedPrefixes |= INST_PRE_REP; + di->flags |= FLAG_REP; + } + } + + if (instFlags & INST_PRE_ADDR_SIZE) { + /* If it's JeCXZ the ADDR_SIZE prefix affects them. */ + if (instFlags & INST_USE_EXMNEMONIC) { + ps->usedPrefixes |= INST_PRE_ADDR_SIZE; + if (effAdrSz == Decode16Bits) di->opcode = ii->opcodeId; + else if (effAdrSz == Decode32Bits) di->opcode = ((_InstInfoEx*)ii)->opcodeId2; + /* Ignore REX.W in 64bits, JECXZ is promoted. */ + else /* Decode64Bits */ di->opcode = ((_InstInfoEx*)ii)->opcodeId3; + } + + /* LOOPxx instructions are also native instruction, but they are special case ones, ADDR_SIZE prefix affects them. */ + else if (instFlags & INST_NATIVE) { + di->opcode = ii->opcodeId; - /* LOOPxx instructions are also native instruction, but they are special case ones, ADDR_SIZE prefix affects them. */ - else if ((instFlags & (INST_PRE_ADDR_SIZE | INST_NATIVE)) == (INST_PRE_ADDR_SIZE | INST_NATIVE)) { - di->opcode = ii->opcodeId; + /* If LOOPxx gets here from 64bits, it must be Decode32Bits because Address Size prefix is set. */ + ps->usedPrefixes |= INST_PRE_ADDR_SIZE; + } - /* If LOOPxx gets here from 64bits, it must be Decode32Bits because Address Size prefix is set. */ - ps->usedPrefixes |= INST_PRE_ADDR_SIZE; + goto _SkipOpcoding; + } } + /* + * If we reached here the instruction was fully decoded, we located the instruction in the DB and extracted operands. + * Use the correct mnemonic according to the DT. + * If we are in 32 bits decoding mode it doesn't necessarily mean we will choose mnemonic2, alas, + * it means that if there is a mnemonic2, it will be used. * Note: * If the instruction is prefixed by operand size we will format it in the non-default decoding mode! * So there might be a situation that an instruction of 32 bit gets formatted in 16 bits decoding mode. * Both ways should end up with a correct and expected formatting of the text. - */ - else if (effOpSz == Decode16Bits) { /* Decode16Bits */ - - /* Set operand size. */ - FLAG_SET_OPSIZE(di, Decode16Bits); - - /* - * If it's a special instruction which has two mnemonics, then use the 16 bits one + update usedPrefixes. - * Note: use 16 bits mnemonic if that instruction supports 32 bit or 64 bit explicitly. - */ - if ((instFlags & INST_USE_EXMNEMONIC) && ((instFlags & (INST_32BITS | INST_64BITS)) == 0)) ps->usedPrefixes |= INST_PRE_OP_SIZE; - di->opcode = ii->opcodeId; - } else if (effOpSz == Decode32Bits) { /* Decode32Bits */ + */ + if (effOpSz == Decode32Bits) { /* Decode32Bits */ /* Set operand size. */ FLAG_SET_OPSIZE(di, Decode32Bits); /* Give a chance for special mnemonic instruction in 32 bits decoding. */ if (instFlags & INST_USE_EXMNEMONIC) { - ps->usedPrefixes |= INST_PRE_OP_SIZE; /* Is it a special instruction which has another mnemonic for mod=11 ? */ if (instFlags & INST_MNEMONIC_MODRM_BASED) { - if (modrm >= INST_DIVIDED_MODRM) di->opcode = ii->opcodeId; - else di->opcode = ((_InstInfoEx*)ii)->opcodeId2; - } else di->opcode = ((_InstInfoEx*)ii)->opcodeId2; - } else di->opcode = ii->opcodeId; - } else { /* Decode64Bits, note that some instructions might be decoded in Decode32Bits above. */ + if (modrm < INST_DIVIDED_MODRM) di->opcode = ((_InstInfoEx*)ii)->opcodeId2; + } + else di->opcode = ((_InstInfoEx*)ii)->opcodeId2; + ps->usedPrefixes |= INST_PRE_OP_SIZE; + } + } + else if (effOpSz == Decode64Bits) { /* Decode64Bits, note that some instructions might be decoded in Decode32Bits above. */ /* Set operand size. */ FLAG_SET_OPSIZE(di, Decode64Bits); @@ -318,85 +337,84 @@ static _DecodeResult decode_inst(_CodeInfo* ci, _PrefixState* ps, _DInst* di) * because they must not use REX (otherwise it will get to the wrong instruction which share same opcode). * See XRSTOR and XSAVEOPT. */ - if ((instFlags & INST_MNEMONIC_MODRM_BASED) && (modrm >= INST_DIVIDED_MODRM)) goto _Undecodable; + if ((modrm >= INST_DIVIDED_MODRM) && (instFlags & INST_MNEMONIC_MODRM_BASED)) goto _Undecodable; /* Use third mnemonic, for 64 bits. */ - if ((instFlags & INST_USE_EXMNEMONIC2) && (vrex & PREFIX_EX_W)) { + if ((instFlags & INST_USE_EXMNEMONIC2) && (ps->vrex & PREFIX_EX_W)) { ps->usedPrefixes |= INST_PRE_REX; di->opcode = ((_InstInfoEx*)ii)->opcodeId3; - } else di->opcode = ((_InstInfoEx*)ii)->opcodeId2; /* Use second mnemonic. */ - } else di->opcode = ii->opcodeId; + } + else di->opcode = ((_InstInfoEx*)ii)->opcodeId2; /* Use second mnemonic. */ + } } + else { /* Decode16Bits */ - /* If it's a native instruction use OpSize Prefix. */ - if ((instFlags & INST_NATIVE) && (ps->decodedPrefixes & INST_PRE_OP_SIZE)) ps->usedPrefixes |= INST_PRE_OP_SIZE; - - /* Check VEX mnemonics: */ - if ((instFlags & INST_PRE_VEX) && - (((((_InstInfoEx*)ii)->flagsEx & INST_MNEMONIC_VEXW_BASED) && (vrex & PREFIX_EX_W)) || - ((((_InstInfoEx*)ii)->flagsEx & INST_MNEMONIC_VEXL_BASED) && (vrex & PREFIX_EX_L)))) { - di->opcode = ((_InstInfoEx*)ii)->opcodeId2; - } + /* Set operand size. */ + FLAG_SET_OPSIZE(di, Decode16Bits); - /* Or is it a special CMP instruction which needs a pseudo opcode suffix ? */ - if (instFlags & INST_PSEUDO_OPCODE) { /* - * The opcodeId is the offset to the FIRST pseudo compare mnemonic, - * we will have to fix it so it offsets into the corrected mnemonic. - * Therefore, we use another table to fix the offset. + * If it's a special instruction which has two mnemonics, then use the 16 bits one + update usedPrefixes. + * Note: use 16 bits mnemonic if that instruction supports 32 bit or 64 bit explicitly. */ - if (instFlags & INST_PRE_VEX) { - /* Use the AVX pseudo compare mnemonics table. */ - di->opcode = ii->opcodeId + VCmpMnemonicOffsets[cmpType]; - } else { - /* Use the SSE pseudo compare mnemonics table. */ - di->opcode = ii->opcodeId + CmpMnemonicOffsets[cmpType]; - } + if ((instFlags & (INST_USE_EXMNEMONIC | INST_32BITS | INST_64BITS)) == INST_USE_EXMNEMONIC) ps->usedPrefixes |= INST_PRE_OP_SIZE; } - /* - * Store the address size inside the flags. - * This is necessary for the caller to know the size of rSP when using PUSHA for example. - */ - FLAG_SET_ADDRSIZE(di, effAdrSz); +_SkipOpcoding: - /* Copy DST_WR flag. */ - if (instFlags & INST_DST_WR) di->flags |= FLAG_DST_WR; + /* Check VEX mnemonics: */ + if (isPrefixed && (instFlags & INST_PRE_VEX) && + (((((_InstInfoEx*)ii)->flagsEx & INST_MNEMONIC_VEXW_BASED) && (ps->vrex & PREFIX_EX_W)) || + ((((_InstInfoEx*)ii)->flagsEx & INST_MNEMONIC_VEXL_BASED) && (ps->vrex & PREFIX_EX_L)))) { + di->opcode = ((_InstInfoEx*)ii)->opcodeId2; + } - /* Set the unused prefixes mask. */ - di->unusedPrefixesMask = prefixes_set_unused_mask(ps); + /* Instruction's size should include prefixes too if exist. */ + di->size = (uint8_t)(ci->code - startCode); + /* + * There's a limit of 15 bytes on instruction length. The only way to violate + * this limit is by putting redundant prefixes before an instruction. + * start points to first prefix if any, otherwise it points to instruction first byte. + */ + if (di->size > INST_MAXIMUM_SIZE) goto _Undecodable; - /* Fix privileged. Assumes the privilegedFlag is 0x8000 only. */ - di->flags |= privilegedFlag; + /* Set the unused prefixes mask, if any prefixes (not) used at all. */ + if (isPrefixed) di->unusedPrefixesMask = prefixes_set_unused_mask(ps); /* Copy instruction meta. */ di->meta = isi->meta; - if (di->segment == 0) di->segment = R_NONE; - /* Take into account the O_MEM base register for the mask. */ - if (di->base != R_NONE) di->usedRegistersMask |= _REGISTERTORCLASS[di->base]; - - /* Copy CPU affected flags. */ - CONVERT_FLAGS_TO_EFLAGS(di, isi, modifiedFlagsMask); - CONVERT_FLAGS_TO_EFLAGS(di, isi, testedFlagsMask); - CONVERT_FLAGS_TO_EFLAGS(di, isi, undefinedFlagsMask); + if (ci->features & DF_FILL_EFLAGS) { + /* Copy CPU affected flags. */ + if (isi->testedFlagsMask) CONVERT_FLAGS_TO_EFLAGS(di, isi, testedFlagsMask); + if (isi->modifiedFlagsMask) CONVERT_FLAGS_TO_EFLAGS(di, isi, modifiedFlagsMask); + if (isi->undefinedFlagsMask) CONVERT_FLAGS_TO_EFLAGS(di, isi, undefinedFlagsMask); + } - /* Calculate the size of the instruction we've just decoded. */ - di->size = (uint8_t)((ci->code - startCode) & 0xff); + /* + * Instruction can still be invalid if it's total length is over 15 bytes with prefixes. + * Up to the caller to check that. + */ return DECRES_SUCCESS; -_Undecodable: /* If the instruction couldn't be decoded for some reason, drop the first byte. */ - memset(di, 0, sizeof(_DInst)); - di->base = R_NONE; - - di->size = 1; - /* Clean prefixes just in case... */ - ps->usedPrefixes = 0; - - /* Special case for WAIT instruction: If it's dropped, you have to return a valid instruction! */ +_Undecodable: /* If the instruction couldn't be decoded for some reason, fail. */ + /* Special case for WAIT instruction: If it's dropped as a prefix, we have to return a valid instruction! */ if (*startCode == INST_WAIT_INDEX) { + int delta; + memset(di, 0, sizeof(_DInst)); + di->addr = ci->codeOffset & ci->addrMask; + di->imm.byte = INST_WAIT_INDEX; + di->segment = R_NONE; + di->base = R_NONE; + di->size = 1; di->opcode = I_WAIT; META_SET_ISC(di, ISC_INTEGER); + + /* Fix ci because WAIT could be a prefix that failed, and ci->code is now out of sync. */ + delta = (int)(ci->code - startCode); /* How many bytes we read so far. */ + ci->codeLen += delta - 1; + ci->code = startCode + 1; + /* codeOffset is fixed outside. */ + return DECRES_SUCCESS; } @@ -414,32 +432,36 @@ static _DecodeResult decode_inst(_CodeInfo* ci, _PrefixState* ps, _DInst* di) */ _DecodeResult decode_internal(_CodeInfo* _ci, int supportOldIntr, _DInst result[], unsigned int maxResultCount, unsigned int* usedInstructionsCount) { + _CodeInfo ci = *_ci; /* A working copy, we don't touch user's _ci except OUT params. */ _PrefixState ps; - unsigned int prefixSize; - _CodeInfo ci; - unsigned int features; - unsigned int mfc; + /* Bookkeep these from ci below, as it makes things way simpler. */ + const uint8_t* code; + int codeLen; + _OffsetType codeOffset; - _OffsetType codeOffset = _ci->codeOffset; - const uint8_t* code = _ci->code; - int codeLen = _ci->codeLen; - - /* - * This is used for printing only, it is the real offset of where the whole instruction begins. - * We need this variable in addition to codeOffset, because prefixes might change the real offset an instruction begins at. - * So we keep track of both. - */ - _OffsetType startInstOffset = 0; - - const uint8_t* p; + _DecodeResult ret = DECRES_SUCCESS; /* Current working decoded instruction in results. */ - unsigned int nextPos = 0; - _DInst *pdi = NULL; + _DInst* pdi = (_DInst*)&result[0]; /* There's always a room for at least one slot, checked earlier. */ + _DInst* maxResultAddr; - _OffsetType addrMask = (_OffsetType)-1; + unsigned int features = ci.features; - _DecodeResult decodeResult; + unsigned int diStructSize; + /* Use next entry. */ +#ifndef DISTORM_LIGHT + if (supportOldIntr) { + diStructSize = sizeof(_DecodedInst); + maxResultAddr = (_DInst*)((size_t)&result[0] + (maxResultCount * sizeof(_DecodedInst))); + } + else +#endif /* DISTORM_LIGHT */ + { + diStructSize = sizeof(_DInst); + maxResultAddr = &result[maxResultCount]; + } + + ci.addrMask = (_OffsetType)-1; #ifdef DISTORM_LIGHT supportOldIntr; /* Unreferenced. */ @@ -449,202 +471,104 @@ _DecodeResult decode_internal(_CodeInfo* _ci, int supportOldIntr, _DInst result[ * Otherwise, we use the textual interface which needs full addresses for formatting bytes output. * So distorm_format will truncate later. */ - if (_ci->features & DF_MAXIMUM_ADDR32) addrMask = 0xffffffff; - else if (_ci->features & DF_MAXIMUM_ADDR16) addrMask = 0xffff; + if (features & DF_MAXIMUM_ADDR32) ci.addrMask = 0xffffffff; + else if (features & DF_MAXIMUM_ADDR16) ci.addrMask = 0xffff; #endif - /* No entries are used yet. */ - *usedInstructionsCount = 0; - ci.dt = _ci->dt; - _ci->nextOffset = codeOffset; + ps.count = 1; /* Force zero'ing ps below. */ /* Decode instructions as long as we have what to decode/enough room in entries. */ - while (codeLen > 0) { - - /* startInstOffset holds the displayed offset of current instruction. */ - startInstOffset = codeOffset; + while (ci.codeLen > 0) { + code = ci.code; + codeLen = ci.codeLen; + codeOffset = ci.codeOffset; - memset(&ps, 0, (size_t)((char*)&ps.pfxIndexer[0] - (char*)&ps)); - memset(ps.pfxIndexer, PFXIDX_NONE, sizeof(int) * PFXIDX_MAX); - ps.start = code; - ps.last = code; - prefixSize = 0; + if (ps.count) memset(&ps, 0, sizeof(ps)); - if (prefixes_is_valid(*code, ci.dt)) { - prefixes_decode(code, codeLen, &ps, ci.dt); - /* Count prefixes, start points to first prefix. */ - prefixSize = (unsigned int)(ps.last - ps.start); - /* - * It might be that we will just notice that we ran out of bytes, or only prefixes - * so we will have to drop everything and halt. - * Also take into consideration of flow control instruction filter. - */ - codeLen -= prefixSize; - if ((codeLen == 0) || (prefixSize == INST_MAXIMUM_SIZE)) { - if (~_ci->features & DF_RETURN_FC_ONLY) { - /* Make sure there is enough room. */ - if (nextPos + (ps.last - code) > maxResultCount) return DECRES_MEMORYERR; - - for (p = code; p < ps.last; p++, startInstOffset++) { - /* Use next entry. */ -#ifndef DISTORM_LIGHT - if (supportOldIntr) { - pdi = (_DInst*)((char*)result + nextPos * sizeof(_DecodedInst)); - } - else -#endif /* DISTORM_LIGHT */ - { - pdi = &result[nextPos]; - } - nextPos++; - memset(pdi, 0, sizeof(_DInst)); - - pdi->flags = FLAG_NOT_DECODABLE; - pdi->imm.byte = *p; - pdi->size = 1; - pdi->addr = startInstOffset & addrMask; - } - *usedInstructionsCount = nextPos; /* Include them all. */ - } - if (codeLen == 0) break; /* Bye bye, out of bytes. */ - } - code += prefixSize; - codeOffset += prefixSize; + /**** INSTRUCTION DECODING NEXT: ****/ - /* If we got only prefixes continue to next instruction. */ - if (prefixSize == INST_MAXIMUM_SIZE) continue; + /* Make sure we didn't run out of output entries. */ + if (pdi >= maxResultAddr) { + ret = DECRES_MEMORYERR; + break; } - /* - * Now we decode the instruction and only then we do further prefixes handling. - * This is because the instruction could not be decoded at all, or an instruction requires - * a mandatory prefix, or some of the prefixes were useless, etc... + ret = decode_inst(&ci, &ps, code, pdi); + /* decode_inst keeps track (only if successful!) for code and codeLen but ignores codeOffset, fix it here. */ + ci.codeOffset += pdi->size; - * Even if there were a mandatory prefix, we already took into account its size as a normal prefix. - * so prefixSize includes that, and the returned size in pdi is simply the size of the real(=without prefixes) instruction. - */ - if (ci.dt == Decode64Bits) { - if (ps.decodedPrefixes & INST_PRE_REX) { - /* REX prefix must precede first byte of instruction. */ - if (ps.rexPos != (code - 1)) { - ps.decodedPrefixes &= ~INST_PRE_REX; - ps.prefixExtType = PET_NONE; - prefixes_ignore(&ps, PFXIDX_REX); - } - /* - * We will disable operand size prefix, - * if it exists only after decoding the instruction, since it might be a mandatory prefix. - * This will be done after calling inst_lookup in decode_inst. - */ - } - /* In 64 bits, segment overrides of CS, DS, ES and SS are ignored. So don't take'em into account. */ - if (ps.decodedPrefixes & INST_PRE_SEGOVRD_MASK32) { - ps.decodedPrefixes &= ~INST_PRE_SEGOVRD_MASK32; - prefixes_ignore(&ps, PFXIDX_SEG); - } - } + if (ret == DECRES_SUCCESS) { - /* Make sure there is at least one more entry to use, for the upcoming instruction. */ - if (nextPos + 1 > maxResultCount) return DECRES_MEMORYERR; -#ifndef DISTORM_LIGHT - if (supportOldIntr) { - pdi = (_DInst*)((char*)result + nextPos * sizeof(_DecodedInst)); - } - else -#endif /* DISTORM_LIGHT */ - { - pdi = &result[nextPos]; - } - nextPos++; + if (features & (DF_SINGLE_BYTE_STEP | DF_RETURN_FC_ONLY | DF_STOP_ON_PRIVILEGED | DF_STOP_ON_FLOW_CONTROL)) { - /* - * The reason we copy these two again is because we have to keep track on the input ourselves. - * There might be a case when an instruction is invalid, and then it will be counted as one byte only. - * But that instruction already read a byte or two from the stream and only then returned the error. - * Thus, we end up unsynchronized on the stream. - * This way, we are totally safe, because we keep track after the call to decode_inst, using the returned size. - */ - ci.code = code; - ci.codeLen = codeLen; - /* Nobody uses codeOffset in the decoder itself, so spare it. */ - - decodeResult = decode_inst(&ci, &ps, pdi); - - /* See if we need to filter this instruction. */ - if ((_ci->features & DF_RETURN_FC_ONLY) && (META_GET_FC(pdi->meta) == FC_NONE)) decodeResult = DECRES_FILTERED; - - /* Set address to the beginning of the instruction. */ - pdi->addr = startInstOffset & addrMask; - /* pdi->disp &= addrMask; */ - - if ((decodeResult == DECRES_INPUTERR) && (ps.decodedPrefixes & INST_PRE_VEX)) { - if (ps.prefixExtType == PET_VEX3BYTES) { - prefixSize -= 2; - codeLen += 2; - } else if (ps.prefixExtType == PET_VEX2BYTES) { - prefixSize -= 1; - codeLen += 1; - } - ps.last = ps.start + prefixSize - 1; - code = ps.last + 1; - codeOffset = startInstOffset + prefixSize; - } else { - /* Advance to next instruction. */ - codeLen -= pdi->size; - codeOffset += pdi->size; - code += pdi->size; - - /* Instruction's size should include prefixes. */ - pdi->size += (uint8_t)prefixSize; - } + /* Sync codeinfo, remember that currently it points to beginning of the instruction and prefixes if any. */ + if (features & DF_SINGLE_BYTE_STEP) { + ci.code = code + 1; + ci.codeLen = codeLen - 1; + ci.codeOffset = codeOffset + 1; + } - /* Drop all prefixes and the instruction itself, because the instruction wasn't successfully decoded. */ - if ((decodeResult == DECRES_INPUTERR) && (~_ci->features & DF_RETURN_FC_ONLY)) { - nextPos--; /* Undo last result. */ - if ((prefixSize + 1) > 0) { /* 1 for the first instruction's byte. */ - if ((nextPos + prefixSize + 1) > maxResultCount) return DECRES_MEMORYERR; + /* See if we need to filter this instruction. */ + if ((features & DF_RETURN_FC_ONLY) && (META_GET_FC(pdi->meta) == FC_NONE)) { + continue; + } - for (p = ps.start; p < ps.last + 1; p++, startInstOffset++) { - /* Use next entry. */ -#ifndef DISTORM_LIGHT - if (supportOldIntr) { - pdi = (_DInst*)((char*)result + nextPos * sizeof(_DecodedInst)); - } - else -#endif /* DISTORM_LIGHT */ - { - pdi = &result[nextPos]; + /* Check whether we need to stop on any feature. */ + if ((features & DF_STOP_ON_PRIVILEGED) && (FLAG_GET_PRIVILEGED(pdi->flags))) { + pdi = (_DInst*)((char*)pdi + diStructSize); + break; /* ret = DECRES_SUCCESS; */ + } + + if (features & DF_STOP_ON_FLOW_CONTROL) { + unsigned int mfc = META_GET_FC(pdi->meta); + if (mfc && (((features & DF_STOP_ON_CALL) && (mfc == FC_CALL)) || + ((features & DF_STOP_ON_RET) && (mfc == FC_RET)) || + ((features & DF_STOP_ON_SYS) && (mfc == FC_SYS)) || + ((features & DF_STOP_ON_UNC_BRANCH) && (mfc == FC_UNC_BRANCH)) || + ((features & DF_STOP_ON_CND_BRANCH) && (mfc == FC_CND_BRANCH)) || + ((features & DF_STOP_ON_INT) && (mfc == FC_INT)) || + ((features & DF_STOP_ON_CMOV) && (mfc == FC_CMOV)) || + ((features & DF_STOP_ON_HLT) && (mfc == FC_HLT)))) { + pdi = (_DInst*)((char*)pdi + diStructSize); + break; /* ret = DECRES_SUCCESS; */ } - nextPos++; + } + } - memset(pdi, 0, sizeof(_DInst)); - pdi->flags = FLAG_NOT_DECODABLE; - pdi->imm.byte = *p; - pdi->size = 1; - pdi->addr = startInstOffset & addrMask; + /* Allocate at least one more entry to use, for the next instruction. */ + pdi = (_DInst*)((char*)pdi + diStructSize); + } + else { /* ret == DECRES_INPUTERR */ + + /* Handle failure of decoding last instruction. */ + if ((!(features & DF_RETURN_FC_ONLY))) { + memset(pdi, 0, sizeof(_DInst)); + pdi->flags = FLAG_NOT_DECODABLE; + pdi->imm.byte = *code; + pdi->size = 1; + pdi->addr = codeOffset & ci.addrMask; + pdi = (_DInst*)((char*)pdi + diStructSize); + + /* If an instruction wasn't decoded then stop on undecodeable if set. */ + if (features & DF_STOP_ON_UNDECODEABLE) { + ret = DECRES_SUCCESS; + break; } } - } else if (decodeResult == DECRES_FILTERED) nextPos--; /* Return it to pool, since it was filtered. */ - - /* Alright, the caller can read, at least, up to this one. */ - *usedInstructionsCount = nextPos; - /* Fix next offset. */ - _ci->nextOffset = codeOffset; - - /* Check whether we need to stop on any flow control instruction. */ - features = _ci->features; - mfc = META_GET_FC(pdi->meta); - if ((decodeResult == DECRES_SUCCESS) && (features & DF_STOP_ON_FLOW_CONTROL)) { - if (((features & DF_STOP_ON_CALL) && (mfc == FC_CALL)) || - ((features & DF_STOP_ON_RET) && (mfc == FC_RET)) || - ((features & DF_STOP_ON_SYS) && (mfc == FC_SYS)) || - ((features & DF_STOP_ON_UNC_BRANCH) && (mfc == FC_UNC_BRANCH)) || - ((features & DF_STOP_ON_CND_BRANCH) && (mfc == FC_CND_BRANCH)) || - ((features & DF_STOP_ON_INT) && (mfc == FC_INT)) || - ((features & DF_STOP_ON_CMOV) && (mfc == FC_CMOV))) - return DECRES_SUCCESS; + + /* Skip a single byte in case of a failure and retry instruction. */ + ci.code = code + 1; + ci.codeLen = codeLen - 1; + ci.codeOffset = codeOffset + 1; + + /* Reset return value. */ + ret = DECRES_SUCCESS; } } - return DECRES_SUCCESS; + /* Set OUT params. */ + *usedInstructionsCount = (unsigned int)(((size_t)pdi - (size_t)result) / (size_t)diStructSize); + _ci->nextOffset = ci.codeOffset; + + return ret; } diff --git a/NativeCore/Dependencies/distorm/src/decoder.h b/NativeCore/Dependencies/distorm/src/decoder.h index 2f9961a5..c40cb646 100644 --- a/NativeCore/Dependencies/distorm/src/decoder.h +++ b/NativeCore/Dependencies/distorm/src/decoder.h @@ -4,20 +4,8 @@ decoder.h diStorm3 - Powerful disassembler for X86/AMD64 http://ragestorm.net/distorm/ distorm at gmail dot com -Copyright (C) 2011 Gil Dabah - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 3 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see +Copyright (C) 2003-2021 Gil Dabah +This library is licensed under the BSD license. See the file COPYING. */ @@ -28,6 +16,6 @@ along with this program. If not, see typedef unsigned int _iflags; -_DecodeResult decode_internal(_CodeInfo* ci, int supportOldIntr, _DInst result[], unsigned int maxResultCount, unsigned int* usedInstructionsCount); +_DecodeResult decode_internal(_CodeInfo* _ci, int supportOldIntr, _DInst result[], unsigned int maxResultCount, unsigned int* usedInstructionsCount); #endif /* DECODER_H */ diff --git a/NativeCore/Dependencies/distorm/src/distorm.c b/NativeCore/Dependencies/distorm/src/distorm.c index 12f360fd..e54c28bb 100644 --- a/NativeCore/Dependencies/distorm/src/distorm.c +++ b/NativeCore/Dependencies/distorm/src/distorm.c @@ -5,7 +5,7 @@ diStorm3 C Library Interface diStorm3 - Powerful disassembler for X86/AMD64 http://ragestorm.net/distorm/ distorm at gmail dot com -Copyright (C) 2003-2018 Gil Dabah +Copyright (C) 2003-2021 Gil Dabah This library is licensed under the BSD license. See the file COPYING. */ @@ -29,31 +29,24 @@ This library is licensed under the BSD license. See the file COPYING. return DECRES_SUCCESS; } - /* DECRES_SUCCESS still may indicate we may have something in the result, so zero it first thing. */ - *usedInstructionsCount = 0; - if ((ci == NULL) || (ci->codeLen < 0) || - ((ci->dt != Decode16Bits) && (ci->dt != Decode32Bits) && (ci->dt != Decode64Bits)) || + ((unsigned)ci->dt > (unsigned)Decode64Bits) || (ci->code == NULL) || (result == NULL) || + (maxInstructions == 0) || ((ci->features & (DF_MAXIMUM_ADDR16 | DF_MAXIMUM_ADDR32)) == (DF_MAXIMUM_ADDR16 | DF_MAXIMUM_ADDR32))) { return DECRES_INPUTERR; } - /* Assume length=0 is success. */ - if (ci->codeLen == 0) { - return DECRES_SUCCESS; - } - return decode_internal(ci, FALSE, result, maxInstructions, usedInstructionsCount); } #ifndef DISTORM_LIGHT /* Helper function to concatenate an explicit size when it's unknown from the operands. */ -static void distorm_format_size(_WString* str, const _DInst* di, int opNum) +static void distorm_format_size(unsigned char** str, const _DInst* di, int opNum) { int isSizingRequired = 0; /* @@ -64,7 +57,7 @@ static void distorm_format_size(_WString* str, const _DInst* di, int opNum) * * If given operand number is higher than 2, then output the size anyways. */ - isSizingRequired = ((opNum >= 2) || ((di->ops[0].type != O_REG) && (di->ops[1].type != O_REG))); + isSizingRequired = ((opNum >= 2) || ((opNum == 0) && (di->ops[0].type != O_REG) && (di->ops[1].type != O_REG))); /* Still not sure? Try some special instructions. */ if (!isSizingRequired) { @@ -74,6 +67,7 @@ static void distorm_format_size(_WString* str, const _DInst* di, int opNum) * MOVZX, MOVSX, MOVSXD. * ROL, ROR, RCL, RCR, SHL, SHR, SAL, SAR. * SHLD, SHRD. + * CVTSI2SS is also an exception. */ switch (di->opcode) { @@ -92,6 +86,7 @@ static void distorm_format_size(_WString* str, const _DInst* di, int opNum) case I_SAR: case I_SHLD: case I_SHRD: + case I_CVTSI2SS: isSizingRequired = 1; break; default: /* Instruction doesn't require sizing. */ break; @@ -100,244 +95,262 @@ static void distorm_format_size(_WString* str, const _DInst* di, int opNum) if (isSizingRequired) { - switch (di->ops[opNum].size) + /*case 0: break; OT_MEM's unknown size. */ + switch (di->ops[opNum].size / 8) { - case 0: break; /* OT_MEM's unknown size. */ - case 8: strcat_WSN(str, "byte "); break; - case 16: strcat_WSN(str, "word "); break; - case 32: strcat_WSN(str, "dword "); break; - case 64: strcat_WSN(str, "qword "); break; - case 80: strcat_WSN(str, "tbyte "); break; - case 128: strcat_WSN(str, "dqword "); break; - case 256: strcat_WSN(str, "yword "); break; - default: /* Big oh uh if it gets here. */ break; + case 1: strcat_WS(*str, "BYTE ", 8, 5); break; + case 2: strcat_WS(*str, "WORD ", 8, 5); break; + case 4: strcat_WS(*str, "DWORD ", 8, 6); break; + case 8: strcat_WS(*str, "QWORD ", 8, 6); break; + case 10: strcat_WS(*str, "TBYTE ", 8, 6); break; + case 16: strcat_WS(*str, "DQWORD ", 8, 7); break; + case 32: strcat_WS(*str, "YWORD ", 8, 6); break; } } } -static void distorm_format_signed_disp(_WString* str, const _DInst* di, uint64_t addrMask) +static void distorm_format_signed_disp(unsigned char** str, const _DInst* di, uint64_t addrMask) { int64_t tmpDisp64; if (di->dispSize) { - chrcat_WS(str, ((int64_t)di->disp < 0) ? MINUS_DISP_CHR : PLUS_DISP_CHR); - if ((int64_t)di->disp < 0) tmpDisp64 = -(int64_t)di->disp; - else tmpDisp64 = di->disp; - tmpDisp64 &= addrMask; - str_code_hqw(str, (uint8_t*)&tmpDisp64); + if (((int64_t)di->disp < 0)) { + chrcat_WS(*str, MINUS_DISP_CHR); + tmpDisp64 = -(int64_t)di->disp; + tmpDisp64 &= addrMask; /* Verify only for neg numbers. */ + } + else { + chrcat_WS(*str, PLUS_DISP_CHR); + tmpDisp64 = di->disp; + } + str_int(str, tmpDisp64); } } +static uint8_t prefixTable[6][8] = { "", "LOCK ", "REPNZ ", "REPNZ ", "REP ", "REPZ " }; +static unsigned int prefixSizesTable[6] = { 0, 5, 6, 6, 4, 5 }; +static uint8_t suffixTable[10] = { 0, 'B', 'W', 0, 'D', 0, 0, 0, 'Q' }; + +/* WARNING: This function is written carefully to be able to work with same input and output buffer in-place! */ #ifdef SUPPORT_64BIT_OFFSET _DLLEXPORT_ void distorm_format64(const _CodeInfo* ci, const _DInst* di, _DecodedInst* result) #else _DLLEXPORT_ void distorm_format32(const _CodeInfo* ci, const _DInst* di, _DecodedInst* result) #endif { - _WString* str; - unsigned int i, isDefault; + unsigned char* str; int64_t tmpDisp64; uint64_t addrMask = (uint64_t)-1; - uint8_t segment; const _WMnemonic* mnemonic; + int suffixSize = -1; + unsigned int i; /* Set address mask, when default is for 64bits addresses. */ - if (ci->features & DF_MAXIMUM_ADDR32) addrMask = 0xffffffff; - else if (ci->features & DF_MAXIMUM_ADDR16) addrMask = 0xffff; - - /* Copy other fields. */ - result->size = di->size; - result->offset = di->addr; - - if (di->flags == FLAG_NOT_DECODABLE) { - str = &result->mnemonic; - result->offset &= addrMask; - strclear_WS(&result->operands); - strcpy_WSN(str, "DB "); - str_code_hb(str, di->imm.byte); - strclear_WS(&result->instructionHex); - str_hex_b(&result->instructionHex, di->imm.byte); - return; /* Skip to next instruction. */ + if (ci->features & DF_USE_ADDR_MASK) addrMask = ci->addrMask; + else { + if (ci->features & DF_MAXIMUM_ADDR32) addrMask = 0xffffffff; + else if (ci->features & DF_MAXIMUM_ADDR16) addrMask = 0xffff; } - str = &result->instructionHex; - strclear_WS(str); /* Gotta have full address for (di->addr - ci->codeOffset) to work in all modes. */ - for (i = 0; i < di->size; i++) - str_hex_b(str, ci->code[(unsigned int)(di->addr - ci->codeOffset + i)]); - - /* Truncate address now. */ - result->offset &= addrMask; - - str = &result->mnemonic; - switch (FLAG_GET_PREFIX(di->flags)) - { - case FLAG_LOCK: - strcpy_WSN(str, "lock "); - break; - case FLAG_REP: - /* REP prefix for CMPS and SCAS is really a REPZ. */ - if ((di->opcode == I_CMPS) || (di->opcode == I_SCAS)) strcpy_WSN(str, "repz "); - else strcpy_WSN(str, "rep "); - break; - case FLAG_REPNZ: - strcpy_WSN(str, "repnz "); - break; - default: - /* Init mnemonic string, cause next touch is concatenation. */ - strclear_WS(str); - break; + str_hex(&result->instructionHex, (const uint8_t*)&ci->code[(unsigned int)(di->addr - ci->codeOffset)], di->size); + + if ((int)((int16_t)di->flags) == -1) { + /* In-place considerations: DI is RESULT. Deref fields first. */ + unsigned int size = di->size; + unsigned int byte = di->imm.byte; + _OffsetType offset = di->addr & addrMask; + + result->offset = offset; + result->size = size; + str = (unsigned char*)&result->mnemonic.p; + strcat_WS(str, "DB ", 4, 3); + str_int(&str, byte); + strfinalize_WS(result->mnemonic, str); + *(uint64_t*)&result->operands = 0; /* Clears length and the string at once. */ + return; /* Skip to next instruction. */ } - mnemonic = (const _WMnemonic*)&_MNEMONICS[di->opcode]; - memcpy((int8_t*)&str->p[str->length], mnemonic->p, mnemonic->length + 1); - str->length += mnemonic->length; - - /* Format operands: */ - str = &result->operands; - strclear_WS(str); - - /* Special treatment for String instructions. */ - if ((META_GET_ISC(di->meta) == ISC_INTEGER) && - ((di->opcode == I_MOVS) || - (di->opcode == I_CMPS) || - (di->opcode == I_STOS) || - (di->opcode == I_LODS) || - (di->opcode == I_SCAS))) - { + str = (unsigned char*)&result->operands.p; + + /* Special treatment for String (movs, cmps, stos, lods, scas) instructions. */ + if ((di->opcode >= I_MOVS) && (di->opcode <= I_SCAS)) { /* * No operands are needed if the address size is the default one, * and no segment is overridden, so add the suffix letter, * to indicate size of operation and continue to next instruction. */ - if ((FLAG_GET_ADDRSIZE(di->flags) == ci->dt) && (SEGMENT_IS_DEFAULT(di->segment))) { - str = &result->mnemonic; - switch (di->ops[0].size) - { - case 8: chrcat_WS(str, 'B'); break; - case 16: chrcat_WS(str, 'W'); break; - case 32: chrcat_WS(str, 'D'); break; - case 64: chrcat_WS(str, 'Q'); break; - } - return; + if ((SEGMENT_IS_DEFAULT_OR_NONE(di->segment)) && (FLAG_GET_ADDRSIZE(di->flags) == ci->dt)) { + suffixSize = di->ops[0].size / 8; + goto skipOperands; } + suffixSize = 0; /* Marks it's a string instruction. */ } - for (i = 0; ((i < OPERANDS_NO) && (di->ops[i].type != O_NONE)); i++) { - if (i > 0) strcat_WSN(str, ", "); - switch (di->ops[i].type) - { - case O_REG: - strcat_WS(str, (const _WString*)&_REGISTERS[di->ops[i].index]); - break; - case O_IMM: - /* If the instruction is 'push', show explicit size (except byte imm). */ - if ((di->opcode == I_PUSH) && (di->ops[i].size != 8)) distorm_format_size(str, di, i); - /* Special fix for negative sign extended immediates. */ - if ((di->flags & FLAG_IMM_SIGNED) && (di->ops[i].size == 8)) { - if (di->imm.sbyte < 0) { - chrcat_WS(str, MINUS_DISP_CHR); - str_code_hb(str, -di->imm.sbyte); - break; + for (i = 0; i < di->opsNo; i++) { + unsigned int type = di->ops[i].type; + if (i > 0) strcat_WS(str, ", ", 2, 2); + if (type == O_REG) { + strcat_WSR(&str, &_REGISTERS[di->ops[i].index]); + } + else if (type == O_IMM) { + /* If the instruction is 'push', show explicit size (except byte imm). */ + if ((di->opcode == I_PUSH) && (di->ops[i].size != 8)) distorm_format_size(&str, di, i); + /* Special fix for negative sign extended immediates. */ + if ((di->flags & FLAG_IMM_SIGNED) && (di->ops[i].size == 8) && (di->imm.sbyte < 0)) { + chrcat_WS(str, MINUS_DISP_CHR); + tmpDisp64 = -di->imm.sbyte; + str_int(&str, tmpDisp64); + } + else { + /* Notice signedness and size of the immediate. */ + if (di->ops[i].size == 0x20) str_int(&str, di->imm.dword); + else str_int(&str, di->imm.qword); + } + } + else if (type == O_PC) { +#ifdef SUPPORT_64BIT_OFFSET + str_int(&str, (di->size + di->imm.sqword + di->addr) & addrMask); +#else + tmpDisp64 = ((_OffsetType)di->imm.sdword + di->addr + di->size) & (uint32_t)addrMask; + str_int(&str, tmpDisp64); +#endif + } + else if (type == O_DISP) { + distorm_format_size(&str, di, i); + chrcat_WS(str, OPEN_CHR); + if (!SEGMENT_IS_DEFAULT_OR_NONE(di->segment)) { + strcat_WSR(&str, &_REGISTERS[SEGMENT_GET_UNSAFE(di->segment)]); + chrcat_WS(str, SEG_OFF_CHR); + } + tmpDisp64 = di->disp & addrMask; + str_int(&str, tmpDisp64); + chrcat_WS(str, CLOSE_CHR); + } + else if (type == O_SMEM) { + int isDefault; + int segment; + distorm_format_size(&str, di, i); + chrcat_WS(str, OPEN_CHR); + + segment = SEGMENT_GET(di->segment); + isDefault = SEGMENT_IS_DEFAULT(di->segment); + + /* + * This is where we need to take special care for String instructions. + * If we got here, it means we need to explicitly show their operands. + * The problem with CMPS and MOVS is that they have two(!) memory operands. + * So we have to complement(!) them ourselves, since the isntruction structure supplies only the segment that can be overridden. + * And make the rest of the String operations explicit. + * We ignore default ES/DS in 64 bits. + * ["MOVS"], [OPT.REGI_EDI, OPT.REGI_ESI] -- DS can be overridden. + * ["CMPS"], [OPT.REGI_ESI, OPT.REGI_EDI] -- DS can be overriden. + * + * suffixSize == 0 was set above for string opcode already. + */ + if (suffixSize == 0) { + if (((di->opcode == I_MOVS) && (i == 0)) || ((di->opcode == I_CMPS) && (i == 1))) { + if (ci->dt != Decode64Bits) { + segment = R_ES; + isDefault = FALSE; } + else isDefault = TRUE; } - if (di->ops[i].size == 64) str_code_hqw(str, (uint8_t*)&di->imm.qword); - else str_code_hdw(str, di->imm.dword); - break; - case O_IMM1: - str_code_hdw(str, di->imm.ex.i1); - break; - case O_IMM2: - str_code_hdw(str, di->imm.ex.i2); - break; - case O_DISP: - distorm_format_size(str, di, i); - chrcat_WS(str, OPEN_CHR); - if ((SEGMENT_GET(di->segment) != R_NONE) && !SEGMENT_IS_DEFAULT(di->segment)) { - strcat_WS(str, (const _WString*)&_REGISTERS[SEGMENT_GET(di->segment)]); - chrcat_WS(str, SEG_OFF_CHR); - } - tmpDisp64 = di->disp & addrMask; - str_code_hqw(str, (uint8_t*)&tmpDisp64); - chrcat_WS(str, CLOSE_CHR); - break; - case O_SMEM: - distorm_format_size(str, di, i); - chrcat_WS(str, OPEN_CHR); - - /* - * This is where we need to take special care for String instructions. - * If we got here, it means we need to explicitly show their operands. - * The problem with CMPS and MOVS is that they have two(!) memory operands. - * So we have to complete it ourselves, since the structure supplies only the segment that can be overridden. - * And make the rest of the String operations explicit. - */ - segment = SEGMENT_GET(di->segment); - isDefault = SEGMENT_IS_DEFAULT(di->segment); - switch (di->opcode) - { - case I_MOVS: - isDefault = FALSE; - if (i == 0) segment = R_ES; - break; - case I_CMPS: + else if (isDefault && ((di->opcode == I_MOVS) || (di->opcode == I_CMPS))) { + if (ci->dt != Decode64Bits) { + segment = R_DS; isDefault = FALSE; - if (i == 1) segment = R_ES; - break; - case I_INS: - case I_LODS: - case I_STOS: - case I_SCAS: isDefault = FALSE; break; - } - if (!isDefault && (segment != R_NONE)) { - strcat_WS(str, (const _WString*)&_REGISTERS[segment]); - chrcat_WS(str, SEG_OFF_CHR); + } } + } + if (!isDefault && (segment != R_NONE)) { + strcat_WSR(&str, &_REGISTERS[segment]); + chrcat_WS(str, SEG_OFF_CHR); + } - strcat_WS(str, (const _WString*)&_REGISTERS[di->ops[i].index]); - - distorm_format_signed_disp(str, di, addrMask); - chrcat_WS(str, CLOSE_CHR); - break; - case O_MEM: - distorm_format_size(str, di, i); - chrcat_WS(str, OPEN_CHR); - if ((SEGMENT_GET(di->segment) != R_NONE) && !SEGMENT_IS_DEFAULT(di->segment)) { - strcat_WS(str, (const _WString*)&_REGISTERS[SEGMENT_GET(di->segment)]); - chrcat_WS(str, SEG_OFF_CHR); - } - if (di->base != R_NONE) { - strcat_WS(str, (const _WString*)&_REGISTERS[di->base]); - chrcat_WS(str, PLUS_DISP_CHR); - } - strcat_WS(str, (const _WString*)&_REGISTERS[di->ops[i].index]); - if (di->scale != 0) { - chrcat_WS(str, '*'); - if (di->scale == 2) chrcat_WS(str, '2'); - else if (di->scale == 4) chrcat_WS(str, '4'); - else /* if (di->scale == 8) */ chrcat_WS(str, '8'); - } + strcat_WSR(&str, &_REGISTERS[di->ops[i].index]); - distorm_format_signed_disp(str, di, addrMask); - chrcat_WS(str, CLOSE_CHR); - break; - case O_PC: -#ifdef SUPPORT_64BIT_OFFSET - str_off64(str, (di->imm.sqword + di->addr + di->size) & addrMask); -#else - str_code_hdw(str, ((_OffsetType)di->imm.sdword + di->addr + di->size) & (uint32_t)addrMask); -#endif - break; - case O_PTR: - str_code_hdw(str, di->imm.ptr.seg); + distorm_format_signed_disp(&str, di, addrMask); + chrcat_WS(str, CLOSE_CHR); + } + else if (type == O_MEM) { + distorm_format_size(&str, di, i); + chrcat_WS(str, OPEN_CHR); + if (!SEGMENT_IS_DEFAULT_OR_NONE(di->segment)) { + strcat_WSR(&str, &_REGISTERS[SEGMENT_GET_UNSAFE(di->segment)]); chrcat_WS(str, SEG_OFF_CHR); - str_code_hdw(str, di->imm.ptr.off); - break; + } + if (di->base != R_NONE) { + strcat_WSR(&str, &_REGISTERS[di->base]); + chrcat_WS(str, PLUS_DISP_CHR); + } + strcat_WSR(&str, &_REGISTERS[di->ops[i].index]); + if (di->scale != 0) { + switch (di->scale) + { + case 2: strcat_WS(str, "*2", 2, 2); break; + case 4: strcat_WS(str, "*4", 2, 2); break; + case 8: strcat_WS(str, "*8", 2, 2); break; + } + } + distorm_format_signed_disp(&str, di, addrMask); + chrcat_WS(str, CLOSE_CHR); + } + else if (type == O_PTR) { + str_int(&str, di->imm.ptr.seg); + chrcat_WS(str, SEG_OFF_CHR); + str_int(&str, di->imm.ptr.off); + } + else if (type == O_IMM1) { + str_int(&str, di->imm.ex.i1); + } + else if (type == O_IMM2) { + str_int(&str, di->imm.ex.i2); } } +skipOperands: + + /* Finalize the operands string. */ + strfinalize_WS(result->operands, str); + + /* Not used anymore. if (di->flags & FLAG_HINT_TAKEN) strcat_WSN(str, " ;TAKEN"); else if (di->flags & FLAG_HINT_NOT_TAKEN) strcat_WSN(str, " ;NOT TAKEN"); + */ + { + /* In-place considerations: DI is RESULT. Deref fields first. */ + unsigned int opcode = di->opcode; + unsigned int prefix = FLAG_GET_PREFIX(di->flags); + unsigned int size = di->size; + _OffsetType offset = di->addr & addrMask; + str = (unsigned char*)&result->mnemonic.p; + mnemonic = (const _WMnemonic*)&_MNEMONICS[opcode]; + + if (prefix) { + /* REP prefix for CMPS and SCAS is really a REPZ. */ + prefix += (opcode == I_CMPS); + prefix += (opcode == I_SCAS); + memcpy(str, &prefixTable[prefix][0], 8); + str += prefixSizesTable[prefix]; + } + + /* + * Always copy 16 bytes from the mnemonic, we have a sentinel padding so we can read past. + * This helps the compiler to remove the call to memcpy and therefore makes this copying much faster. + * The longest instruction is exactly 16 chars long, so we null terminate the string below. + */ + memcpy((int8_t*)str, mnemonic->p, 16); + str += mnemonic->length; + + if (suffixSize > 0) { + *str++ = suffixTable[suffixSize]; + } + strfinalize_WS(result->mnemonic, str); + + result->offset = offset; + result->size = size; + } } #ifdef SUPPORT_64BIT_OFFSET @@ -347,9 +360,8 @@ static void distorm_format_signed_disp(_WString* str, const _DInst* di, uint64_t #endif { _DecodeResult res; - _DInst di; _CodeInfo ci; - unsigned int instsCount = 0, i; + unsigned int i, instsCount; *usedInstructionsCount = 0; @@ -358,19 +370,15 @@ static void distorm_format_signed_disp(_WString* str, const _DInst* di, uint64_t return DECRES_INPUTERR; } - if ((dt != Decode16Bits) && (dt != Decode32Bits) && (dt != Decode64Bits)) { + if ((unsigned)dt > (unsigned)Decode64Bits) { return DECRES_INPUTERR; } - if (code == NULL || result == NULL) { + /* Make sure there's at least one instruction in the result buffer. */ + if ((code == NULL) || (result == NULL) || (maxInstructions == 0)) { return DECRES_INPUTERR; } - /* Assume length=0 is success. */ - if (codeLen == 0) { - return DECRES_SUCCESS; - } - /* * We have to format the result into text. But the interal decoder works with the new structure of _DInst. * Therefore, we will pass the result array(!) from the caller and the interal decoder will fill it in with _DInst's. @@ -384,24 +392,22 @@ static void distorm_format_signed_disp(_WString* str, const _DInst* di, uint64_t ci.code = code; ci.codeLen = codeLen; ci.dt = dt; - ci.features = DF_NONE; - if (dt == Decode16Bits) ci.features = DF_MAXIMUM_ADDR16; - else if (dt == Decode32Bits) ci.features = DF_MAXIMUM_ADDR32; + ci.features = DF_USE_ADDR_MASK; + if (dt == Decode16Bits) ci.addrMask = 0xffff; + else if (dt == Decode32Bits) ci.addrMask = 0xffffffff; + else ci.addrMask = (_OffsetType)-1; - res = decode_internal(&ci, TRUE, (_DInst*)result, maxInstructions, &instsCount); + res = decode_internal(&ci, TRUE, (_DInst*)result, maxInstructions, usedInstructionsCount); + instsCount = *usedInstructionsCount; for (i = 0; i < instsCount; i++) { - if ((*usedInstructionsCount + i) >= maxInstructions) return DECRES_MEMORYERR; - - /* Copy the current decomposed result to a temp structure, so we can override the result with text. */ - memcpy(&di, (char*)result + (i * sizeof(_DecodedInst)), sizeof(_DInst)); + /* distorm_format is optimized and can work with same input/output buffer in-place. */ #ifdef SUPPORT_64BIT_OFFSET - distorm_format64(&ci, &di, &result[i]); + distorm_format64(&ci, (_DInst*)&result[i], &result[i]); #else - distorm_format32(&ci, &di, &result[i]); + distorm_format32(&ci, (_DInst*)&result[i], &result[i]); #endif } - *usedInstructionsCount = instsCount; return res; } diff --git a/NativeCore/Dependencies/distorm/src/instructions.c b/NativeCore/Dependencies/distorm/src/instructions.c index 9107b6b0..ff1c43cd 100644 --- a/NativeCore/Dependencies/distorm/src/instructions.c +++ b/NativeCore/Dependencies/distorm/src/instructions.c @@ -4,7 +4,7 @@ instructions.c diStorm3 - Powerful disassembler for X86/AMD64 http://ragestorm.net/distorm/ distorm at gmail dot com -Copyright (C) 2003-2018 Gil Dabah +Copyright (C) 2003-2021 Gil Dabah This library is licensed under the BSD license. See the file COPYING. */ @@ -168,14 +168,15 @@ static _InstInfo* inst_lookup_prefixed(_InstNode in, _PrefixState* ps) * try to get the instruction and only then check for the operand size prefix. */ - /* If both REPNZ and REP are together, it's illegal for sure. */ + /* If both REPNZ and REP are together, it's illegal for sure. */ if ((ps->decodedPrefixes & INST_PRE_REPS) == INST_PRE_REPS) return NULL; /* Now we know it's either REPNZ+OPSIZE or REP+OPSIZE, so examine the instruction. */ if (ps->decodedPrefixes & INST_PRE_REPNZ) { index = 3; ps->decodedPrefixes &= ~INST_PRE_REPNZ; - } else if (ps->decodedPrefixes & INST_PRE_REP) { + } + else if (ps->decodedPrefixes & INST_PRE_REP) { index = 2; ps->decodedPrefixes &= ~INST_PRE_REP; } @@ -238,7 +239,8 @@ static _InstInfo* inst_vex_lookup(_CodeInfo* ci, _PrefixState* ps) pp = vex & 3; /* Implied leading 0x0f byte by default for 2 bytes VEX prefix. */ start = 1; - } else { /* PET_VEX3BYTES */ + } + else { /* PET_VEX3BYTES */ start = vex & 0x1f; vex2 = *(ps->vexPos + 1); ps->vexV = v = (~vex2 >> 3) & 0xf; @@ -297,7 +299,8 @@ static _InstInfo* inst_vex_lookup(_CodeInfo* ci, _PrefixState* ps) if (instType == INT_LIST_GROUP) { in = InstructionsTree[instIndex + ((*ci->code >> 3) & 7)]; /* Continue below to check prefixed table. */ - } else if (instType == INT_LIST_FULL) { + } + else if (instType == INT_LIST_FULL) { in = InstructionsTree[instIndex + *ci->code]; /* Continue below to check prefixed table. */ } @@ -316,30 +319,40 @@ static _InstInfo* inst_vex_lookup(_CodeInfo* ci, _PrefixState* ps) return NULL; } -_InstInfo* inst_lookup(_CodeInfo* ci, _PrefixState* ps) +_InstInfo* inst_lookup(_CodeInfo* ci, _PrefixState* ps, int* isPrefixed) { - unsigned int tmpIndex0 = 0, tmpIndex1 = 0, tmpIndex2 = 0, rex = ps->vrex; - int instType = 0; - _InstNode in = 0; + unsigned int tmpIndex0, tmpIndex1, tmpIndex2; + int instType; + _InstNode in; _InstInfo* ii = NULL; int isWaitIncluded = FALSE; - /* See whether we have to handle a VEX prefixed instruction. */ - if (ps->decodedPrefixes & INST_PRE_VEX) { - ii = inst_vex_lookup(ci, ps); - if (ii != NULL) { - /* Make sure that VEX.L exists when forced. */ - if ((((_InstInfoEx*)ii)->flagsEx & INST_FORCE_VEXL) && (~ps->vrex & PREFIX_EX_L)) return NULL; - /* If the instruction doesn't use VEX.vvvv it must be zero. */ - if ((((_InstInfoEx*)ii)->flagsEx & INST_VEX_V_UNUSED) && ps->vexV) return NULL; + /* Always safe to read first byte codeLen > 0. */ + tmpIndex0 = *ci->code; + + if (prefixes_is_valid((unsigned char)tmpIndex0, ci->dt)) { + *isPrefixed = TRUE; + prefixes_decode(ci, ps); + if (ci->codeLen < 1) return NULL; /* No more bytes for opcode, halt. */ + tmpIndex0 = *ci->code; /* Reload. */ + + /* If there are too many prefixes, it will be checked later in decode_inst. */ + + /* See whether we have to handle a VEX prefixed instruction. */ + if (ps->decodedPrefixes & INST_PRE_VEX) { + ii = inst_vex_lookup(ci, ps); + if (ii != NULL) { + /* Make sure that VEX.L exists when forced. */ + if ((((_InstInfoEx*)ii)->flagsEx & INST_FORCE_VEXL) && (~ps->vrex & PREFIX_EX_L)) return NULL; + /* If the instruction doesn't use VEX.vvvv it must be zero. */ + if ((((_InstInfoEx*)ii)->flagsEx & INST_VEX_V_UNUSED) && ps->vexV) return NULL; + } + return ii; } - return ii; } - /* Read first byte. */ + /* Account first byte, we know it's safe to read. */ ci->codeLen -= 1; - if (ci->codeLen < 0) return NULL; - tmpIndex0 = *ci->code; /* Check for special 0x9b, WAIT instruction, which can be part of some instructions(x87). */ if (tmpIndex0 == INST_WAIT_INDEX) { @@ -359,27 +372,14 @@ _InstInfo* inst_lookup(_CodeInfo* ci, _PrefixState* ps) /* Walk first byte in InstructionsTree root. */ in = InstructionsTree[tmpIndex0]; - if (in == INT_NOTEXISTS) return NULL; + if ((uint32_t)in == INT_NOTEXISTS) return NULL; instType = INST_NODE_TYPE(in); /* Single byte instruction (OCST_1BYTE). */ if ((instType < INT_INFOS) && (!isWaitIncluded)) { /* Some single byte instructions need extra treatment. */ - switch (tmpIndex0) - { - case INST_ARPL_INDEX: - /* - * ARPL/MOVSXD share the same opcode, and both have different operands and mnemonics, of course. - * Practically, I couldn't come up with a comfortable way to merge the operands' types of ARPL/MOVSXD. - * And since the DB can't be patched dynamically, because the DB has to be multi-threaded compliant, - * I have no choice but to check for ARPL/MOVSXD right here - "right about now, the funk soul brother, check it out now, the funk soul brother...", fatboy slim - */ - if (ci->dt == Decode64Bits) { - return &II_MOVSXD; - } /* else ARPL will be returned because its defined in the DB already. */ - break; - - case INST_NOP_INDEX: /* Nopnopnop */ + if (instType == INT_INFO_TREAT) { + if (tmpIndex0 == INST_NOP_INDEX) { /* Nopnopnop */ /* Check for Pause, since it's prefixed with 0xf3, which is not a real mandatory prefix. */ if (ps->decodedPrefixes & INST_PRE_REP) { /* Flag this prefix as used. */ @@ -395,20 +395,33 @@ _InstInfo* inst_lookup(_CodeInfo* ci, _PrefixState* ps) * 90 XCHG EAX, EAX is a true NOP (and not high dword of RAX = 0 although it should be a 32 bits operation). * Note that if the REX.B is used, then the register is not RAX anymore but R8, which means it's not a NOP. */ - if (rex & PREFIX_EX_W) ps->usedPrefixes |= INST_PRE_REX; - if ((ci->dt != Decode64Bits) || (~rex & PREFIX_EX_B)) return &II_NOP; - break; - - case INST_LEA_INDEX: + if (ps->vrex & PREFIX_EX_W) ps->usedPrefixes |= INST_PRE_REX; + if ((ci->dt != Decode64Bits) || (~ps->vrex & PREFIX_EX_B)) return &II_NOP; + } + else if (tmpIndex0 == INST_LEA_INDEX) { /* Ignore segment override prefixes for LEA instruction. */ ps->decodedPrefixes &= ~INST_PRE_SEGOVRD_MASK; /* Update unused mask for ignoring segment prefix. */ prefixes_ignore(ps, PFXIDX_SEG); - break; + } + else if (tmpIndex0 == INST_ARPL_INDEX) { + /* + * ARPL/MOVSXD share the same opcode, and both have different operands and mnemonics, of course. + * Practically, I couldn't come up with a comfortable way to merge the operands' types of ARPL/MOVSXD. + * And since the DB can't be patched dynamically, because the DB has to be multi-threaded compliant, + * I have no choice but to check for ARPL/MOVSXD right here - "right about now, the funk soul brother, check it out now, the funk soul brother...", fatboy slim + */ + if (ci->dt == Decode64Bits) { + return &II_MOVSXD; + } /* else ARPL will be returned because its defined in the DB already. */ + } } - - /* Return the 1 byte instruction we found. */ - return instType == INT_INFO ? &InstInfos[INST_NODE_INDEX(in)] : (_InstInfo*)&InstInfosEx[INST_NODE_INDEX(in)]; + /* + * Return the 1 byte instruction we found. + * We can have three node types here: infoex, info_treat and info. + * The latter two are really the same basic structure. + */ + return instType == INT_INFOEX ? (_InstInfo*)&InstInfosEx[INST_NODE_INDEX(in)] : &InstInfos[INST_NODE_INDEX(in)]; } /* Read second byte, still doesn't mean all of its bits are used (I.E: ModRM). */ @@ -416,7 +429,7 @@ _InstInfo* inst_lookup(_CodeInfo* ci, _PrefixState* ps) ci->codeLen -= 1; if (ci->codeLen < 0) return NULL; tmpIndex1 = *ci->code; - + /* Try single byte instruction + reg bits (OCST_13BYTES). */ if ((instType == INT_LIST_GROUP) && (!isWaitIncluded)) return inst_get_info(in, (tmpIndex1 >> 3) & 7); @@ -442,13 +455,14 @@ _InstInfo* inst_lookup(_CodeInfo* ci, _PrefixState* ps) if (tmpIndex1 < INST_DIVIDED_MODRM) { /* An instruction which requires a ModR/M byte. Thus it's 1.3 bytes long instruction. */ tmpIndex1 = (tmpIndex1 >> 3) & 7; /* Isolate the 3 REG/OPCODE bits. */ - } else { /* Normal 2 bytes instruction. */ - /* - * Divided instructions can't be in the range of 0x8-0xc0. - * That's because 0-8 are used for 3 bits group. - * And 0xc0-0xff are used for not-divided instruction. - * So the in between range is omitted, thus saving some more place in the tables. - */ + } + else { /* Normal 2 bytes instruction. */ + /* + * Divided instructions can't be in the range of 0x8-0xc0. + * That's because 0-8 are used for 3 bits group. + * And 0xc0-0xff are used for not-divided instruction. + * So the in between range is omitted, thus saving some more place in the tables. + */ tmpIndex1 -= INST_DIVIDED_MODRM - 8; } @@ -525,7 +539,7 @@ _InstInfo* inst_lookup(_CodeInfo* ci, _PrefixState* ps) * hence we don't override 'in', cause we might still need it. */ instType = INST_NODE_TYPE(in2); - + if (instType == INT_INFO) ii = &InstInfos[INST_NODE_INDEX(in2)]; else if (instType == INT_INFOEX) ii = (_InstInfo*)&InstInfosEx[INST_NODE_INDEX(in2)]; @@ -535,7 +549,7 @@ _InstInfo* inst_lookup(_CodeInfo* ci, _PrefixState* ps) * or it was an official 2.3 (because its index was less than 0xc0) - * Then it means the instruction should be using the REG bits, otherwise give a chance to range 0xc0-0xff. */ - /* If we found an instruction only by its REG bits, AND it is not divided, then return it. */ + /* If we found an instruction only by its REG bits, AND it is not divided, then return it. */ if ((ii != NULL) && (INST_INFO_FLAGS(ii) & INST_NOT_DIVIDED)) return ii; /* Otherwise, if the range is above 0xc0, try the special divided range (range 0x8-0xc0 is omitted). */ if (tmpIndex2 >= INST_DIVIDED_MODRM) return inst_get_info(in, tmpIndex2 - INST_DIVIDED_MODRM + 8); diff --git a/NativeCore/Dependencies/distorm/src/instructions.h b/NativeCore/Dependencies/distorm/src/instructions.h index f6c2c53b..4902c99a 100644 --- a/NativeCore/Dependencies/distorm/src/instructions.h +++ b/NativeCore/Dependencies/distorm/src/instructions.h @@ -4,7 +4,7 @@ instructions.h diStorm3 - Powerful disassembler for X86/AMD64 http://ragestorm.net/distorm/ distorm at gmail dot com -Copyright (C) 2003-2018 Gil Dabah +Copyright (C) 2003-2021 Gil Dabah This library is licensed under the BSD license. See the file COPYING. */ @@ -22,6 +22,7 @@ This library is licensed under the BSD license. See the file COPYING. * actually, it depends on the decoding mode, unless there's an operand/address size prefix. * For example, the code: 33 c0 could be decoded/executed as XOR AX, AX or XOR EAX, EAX. */ + typedef enum OpType { /* No operand is set */ OT_NONE = 0, @@ -38,18 +39,6 @@ typedef enum OpType { /* Read a signed extended byte(8 bits) immediate */ OT_SEIMM8, - /* - * Special immediates for instructions which have more than one immediate, - * which is an exception from standard instruction format. - * As to version v1.0: ENTER, INSERTQ, EXTRQ are the only problematic ones. - */ - /* 16 bits immediate using the first imm-slot */ - OT_IMM16_1, - /* 8 bits immediate using the first imm-slot */ - OT_IMM8_1, - /* 8 bits immediate using the second imm-slot */ - OT_IMM8_2, - /* Use a 8bit register */ OT_REG8, /* Use a 16bit register */ @@ -63,71 +52,7 @@ typedef enum OpType { * VMX instructions are promoted automatically without a REX prefix. */ OT_REG32_64, - /* Used only by MOV CR/DR(n). Promoted with REX onlly. */ - OT_FREG32_64_RM, - - /* Use or read (indirection) a 8bit register or immediate byte */ - OT_RM8, - /* Some instructions force 16 bits (mov sreg, rm16) */ - OT_RM16, - /* Use or read a 16/32/64bit register or immediate word/dword/qword */ - OT_RM_FULL, - /* - * 32 or 64 bits (with REX) operand size indirection memory operand. - * Some instructions are promoted automatically without a REX prefix. - */ - OT_RM32_64, - /* 16 or 32 bits RM. This is used only with MOVZXD instruction in 64bits. */ - OT_RM16_32, - /* Same as OT_RMXX but POINTS to 16 bits [cannot use GENERAL-PURPOSE REG!] */ - OT_FPUM16, - /* Same as OT_RMXX but POINTS to 32 bits (single precision) [cannot use GENERAL-PURPOSE REG!] */ - OT_FPUM32, - /* Same as OT_RMXX but POINTS to 64 bits (double precision) [cannot use GENERAL-PURPOSE REG!] */ - OT_FPUM64, - /* Same as OT_RMXX but POINTS to 80 bits (extended precision) [cannot use GENERAL-PURPOSE REG!] */ - OT_FPUM80, - /* - * Special operand type for SSE4 where the ModR/M might - * be a 32 bits register or 8 bits memory indirection operand. - */ - OT_R32_M8, - /* - * Special ModR/M for PINSRW, which need a 16 bits memory operand or 32 bits register. - * In 16 bits decoding mode R32 becomes R16, operand size cannot affect this. - */ - OT_R32_M16, - /* - * Special type for SSE4, ModR/M might be a 32 bits or 64 bits (with REX) register or - * a 8 bits memory indirection operand. - */ - OT_R32_64_M8, - /* - * Special type for SSE4, ModR/M might be a 32 bits or 64 bits (with REX) register or - * a 16 bits memory indirection operand. - */ - OT_R32_64_M16, - /* - * Special operand type for MOV reg16/32/64/mem16, segReg 8C /r. and SMSW. - * It supports all decoding modes, but if used as a memory indirection it's a 16 bit ModR/M indirection. - */ - OT_RFULL_M16, - - /* Use a control register */ - OT_CREG, - /* Use a debug register */ - OT_DREG, - /* Use a segment register */ - OT_SREG, - /* - * SEG is encoded in the flags of the opcode itself! - * This is used for specific "push SS" where SS is a segment where - * each "push SS" has an absolutely different opcode byte. - * We need this to detect whether an operand size prefix is used. - */ - OT_SEG, - /* Use AL */ OT_ACC8, /* Use AX (FSTSW) */ @@ -137,41 +62,11 @@ typedef enum OpType { /* Use AX/EAX, no REX is possible for RAX, used only with IN/OUT which don't support 64 bit registers */ OT_ACC_FULL_NOT64, - /* - * Read one word (seg), and a word/dword/qword (depends on operand size) from memory. - * JMP FAR [EBX] means EBX point to 16:32 ptr. - */ - OT_MEM16_FULL, - /* Read one word (seg) and a word/dword/qword (depends on operand size), usually SEG:OFF, JMP 1234:1234 */ - OT_PTR16_FULL, - /* Read one word (limit) and a dword/qword (limit) (depends on operand size), used by SGDT, SIDT, LGDT, LIDT. */ - OT_MEM16_3264, - /* Read a byte(8 bits) immediate and calculate it relatively to the current offset of the instruction being decoded */ OT_RELCB, /* Read a word/dword immediate and calculate it relatively to the current offset of the instruction being decoded */ OT_RELC_FULL, - /* Use general memory indirection, with varying sizes: */ - OT_MEM, - /* Used when a memory indirection is required, but if the mod field is 11, this operand will be ignored. */ - OT_MEM_OPT, - OT_MEM32, - /* Memory dereference for MOVNTI, either 32 or 64 bits (with REX). */ - OT_MEM32_64, - OT_MEM64, - OT_MEM128, - /* Used for cmpxchg8b/16b. */ - OT_MEM64_128, - - /* Read an immediate as an absolute address, size is known by instruction, used by MOV (memory offset) only */ - OT_MOFFS8, - OT_MOFFS_FULL, - /* Use an immediate of 1, as for SHR R/M, 1 */ - OT_CONST1, - /* Use CL, as for SHR R/M, CL */ - OT_REGCL, - /* * Instruction-Block for one byte long instructions, used by INC/DEC/PUSH/POP/XCHG, * REG is extracted from the value of opcode @@ -181,6 +76,9 @@ typedef enum OpType { /* Use a 16/32/64bit register */ OT_IB_R_FULL, + /* Read an immediate as an absolute address, size is known by instruction, used by MOV (memory offset) only */ + OT_MOFFS8, + OT_MOFFS_FULL, /* Use [(r)SI] as INDIRECTION, for repeatable instructions */ OT_REGI_ESI, /* Use [(r)DI] as INDIRECTION, for repeatable instructions */ @@ -199,19 +97,164 @@ typedef enum OpType { OT_FPU_SSI, /* ST(0), ST(i) */ OT_FPU_SIS, /* ST(i), ST(0) */ + /* SSE registers: */ + OT_XMM, + /* Extract the SSE register from the RM bits this time (used when the REG bits are used for opcode extension) */ + OT_XMM_RM, + /* Implied XMM0 register as operand, used in SSE4. */ + OT_REGXMM0, + /* Reg32/Reg 64 depends on prefix width only. */ + OT_WREG32_64, + + /* XMM is encoded in VEX.VVVV. */ + OT_VXMM, + /* XMM is encoded in the high nibble of an immediate byte. */ + OT_XMM_IMM, + /* YMM/XMM is dependent on VEX.L. */ + OT_YXMM, + /* YMM/XMM (depends on prefix length) is encoded in the high nibble of an immediate byte. */ + OT_YXMM_IMM, + /* YMM is encoded in reg. */ + OT_YMM, + /* YMM is encoded in VEX.VVVV. */ + OT_VYMM, + /* YMM/XMM is dependent on VEX.L, and encoded in VEX.VVVV. */ + OT_VYXMM, + + /* Use an immediate of 1, as for SHR R/M, 1 */ + OT_CONST1, + /* Use CL, as for SHR R/M, CL */ + OT_REGCL, + + /* Use a control register */ + OT_CREG, + /* Use a debug register */ + OT_DREG, + /* Use a segment register */ + OT_SREG, + /* + * SEG is encoded in the flags of the opcode itself! + * This is used for specific "push SS" where SS is a segment where + * each "push SS" has an absolutely different opcode byte. + * We need this to detect whether an operand size prefix is used. + */ + OT_SEG, + + /* + * Special immediates for instructions which have more than one immediate, + * which is an exception from standard instruction format. + * As to version v1.0: ENTER, INSERTQ, EXTRQ are the only problematic ones. + */ + /* 16 bits immediate using the first imm-slot */ + OT_IMM16_1, + /* 8 bits immediate using the first imm-slot */ + OT_IMM8_1, + /* 8 bits immediate using the second imm-slot */ + OT_IMM8_2, + + /* Read one word (seg) and a word/dword/qword (depends on operand size), usually SEG:OFF, JMP 1234:1234 */ + OT_PTR16_FULL, + + /* Used only by MOV CR/DR(n). Promoted with REX onlly. */ + OT_FREG32_64_RM, + /* MMX registers: */ OT_MM, /* Extract the MMX register from the RM bits this time (used when the REG bits are used for opcode extension) */ OT_MM_RM, + + + /**** MEMORY only operands: ****/ + + /* Use general memory indirection, with varying sizes: */ + OT_MEM, + OT_MEM32, + /* Memory dereference for MOVNTI, either 32 or 64 bits (with REX). */ + OT_MEM32_64, + OT_MEM64, + /* Used for cmpxchg8b/16b. */ + OT_MEM64_128, + OT_MEM128, + /* + * Read one word (seg), and a word/dword/qword (depends on operand size) from memory. + * JMP FAR [EBX] means EBX point to 16:32 ptr. + */ + OT_MEM16_FULL, + /* Read one word (limit) and a dword/qword (limit) (depends on operand size), used by SGDT, SIDT, LGDT, LIDT. */ + OT_MEM16_3264, + /* Used when a memory indirection is required, but if the mod field is 11, this operand will be ignored. */ + OT_MEM_OPT, + + /* Same as OT_RMXX but POINTS to 16 bits [cannot use GENERAL-PURPOSE REG!] */ + OT_FPUM16, + /* Same as OT_RMXX but POINTS to 32 bits (single precision) [cannot use GENERAL-PURPOSE REG!] */ + OT_FPUM32, + /* Same as OT_RMXX but POINTS to 64 bits (double precision) [cannot use GENERAL-PURPOSE REG!] */ + OT_FPUM64, + /* Same as OT_RMXX but POINTS to 80 bits (extended precision) [cannot use GENERAL-PURPOSE REG!] */ + OT_FPUM80, + + /* Mem128/Mem256 is dependent on VEX.L. */ + OT_LMEM128_256, + + + /**** MEMORY & REGISTER only operands: ****/ + + /* Use or read (indirection) a 8bit register or immediate byte */ + OT_RM8, + /* Some instructions force 16 bits (mov sreg, rm16) */ + OT_RM16, + /* ModR/M for 32 bits. */ + OT_RM32, + /* + * Special operand type for MOV reg16/32/64/mem16, segReg 8C /r. and SMSW. + * It supports all decoding modes, but if used as a memory indirection it's a 16 bit ModR/M indirection. + */ + OT_RFULL_M16, + /* Use or read a 16/32/64bit register or immediate word/dword/qword */ + OT_RM_FULL, + + /* RM32/RM64 depends on prefix width only. */ + OT_WRM32_64, + /* + * Special type for SSE4, ModR/M might be a 32 bits or 64 bits (with REX) register or + * a 8 bits memory indirection operand. + */ + OT_R32_64_M8, + /* + * Special type for SSE4, ModR/M might be a 32 bits or 64 bits (with REX) register or + * a 16 bits memory indirection operand. + */ + OT_R32_64_M16, + + /* + * 32 or 64 bits (with REX) operand size indirection memory operand. + * Some instructions are promoted automatically without a REX prefix. + */ + OT_RM32_64, + /* 16 or 32 bits RM. This is used only with MOVZXD instruction in 64bits. */ + OT_RM16_32, + + /* + * Special operand type for SSE4 where the ModR/M might + * be a 32 bits register or 8 bits memory indirection operand. + */ + OT_R32_M8, + /* + * Special ModR/M for PINSRW, which need a 16 bits memory operand or 32 bits register. + * In 16 bits decoding mode R32 becomes R16, operand size cannot affect this. + */ + OT_R32_M16, + /* Reg32/Reg64 (prefix width) or Mem8. */ + OT_REG32_64_M8, + /* Reg32/Reg64 (prefix width) or Mem16. */ + OT_REG32_64_M16, + /* ModR/M points to 32 bits MMX variable */ OT_MM32, /* ModR/M points to 32 bits MMX variable */ OT_MM64, - /* SSE registers: */ - OT_XMM, - /* Extract the SSE register from the RM bits this time (used when the REG bits are used for opcode extension) */ - OT_XMM_RM, /* ModR/M points to 16 bits SSE variable */ OT_XMM16, /* ModR/M points to 32 bits SSE variable */ @@ -220,47 +263,18 @@ typedef enum OpType { OT_XMM64, /* ModR/M points to 128 bits SSE variable */ OT_XMM128, - /* Implied XMM0 register as operand, used in SSE4. */ - OT_REGXMM0, /* AVX operands: */ - - /* ModR/M for 32 bits. */ - OT_RM32, - /* Reg32/Reg64 (prefix width) or Mem8. */ - OT_REG32_64_M8, - /* Reg32/Reg64 (prefix width) or Mem16. */ - OT_REG32_64_M16, - /* Reg32/Reg 64 depends on prefix width only. */ - OT_WREG32_64, - /* RM32/RM64 depends on prefix width only. */ - OT_WRM32_64, /* XMM or Mem32/Mem64 depends on perfix width only. */ OT_WXMM32_64, - /* XMM is encoded in VEX.VVVV. */ - OT_VXMM, - /* XMM is encoded in the high nibble of an immediate byte. */ - OT_XMM_IMM, - /* YMM/XMM is dependent on VEX.L. */ - OT_YXMM, - /* YMM/XMM (depends on prefix length) is encoded in the high nibble of an immediate byte. */ - OT_YXMM_IMM, - /* YMM is encoded in reg. */ - OT_YMM, /* YMM or Mem256. */ OT_YMM256, - /* YMM is encoded in VEX.VVVV. */ - OT_VYMM, - /* YMM/XMM is dependent on VEX.L, and encoded in VEX.VVVV. */ - OT_VYXMM, /* YMM/XMM or Mem64/Mem256 is dependent on VEX.L. */ OT_YXMM64_256, /* YMM/XMM or Mem128/Mem256 is dependent on VEX.L. */ OT_YXMM128_256, /* XMM or Mem64/Mem256 is dependent on VEX.L. */ - OT_LXMM64_128, - /* Mem128/Mem256 is dependent on VEX.L. */ - OT_LMEM128_256 + OT_LXMM64_128 } _OpType; /* Flags for instruction: */ @@ -365,7 +379,7 @@ typedef enum OpType { #define INST_VEX_V_UNUSED (1 << 6) /* Indication that the instruction is privileged (Ring 0), this should be checked on the opcodeId field. */ -#define OPCODE_ID_PRIVILEGED ((uint16_t)0x8000) +#define META_INST_PRIVILEGED ((uint16_t)0x8000) /* * Indicates which operand is being decoded. @@ -399,7 +413,6 @@ typedef enum {ONT_NONE = -1, ONT_1 = 0, ONT_2 = 1, ONT_3 = 2, ONT_4 = 3} _Operan typedef struct { uint8_t flagsIndex; /* An index into FlagsTables */ uint8_t s, d; /* OpType. */ - uint8_t meta; /* Hi 5 bits = Instruction set class | Lo 3 bits = flow control flags. */ /* * The following are CPU flag masks that the instruction changes. * The flags are compacted so 8 bits representation is enough. @@ -408,6 +421,7 @@ typedef struct { uint8_t modifiedFlagsMask; uint8_t testedFlagsMask; uint8_t undefinedFlagsMask; + uint16_t meta; /* High byte = Instruction set class | Low byte = flow control flags. */ } _InstSharedInfo; /* @@ -445,6 +459,7 @@ typedef enum { INT_NOTEXISTS = 0, /* Not exists. */ INT_INFO = 1, /* It's an instruction info. */ INT_INFOEX, + INT_INFO_TREAT, /* Extra intervention is required by inst_lookup. */ INT_LIST_GROUP, INT_LIST_FULL, INT_LIST_DIVIDED, @@ -457,7 +472,8 @@ typedef enum { /* Instruction node is treated as { int index:13; int type:3; } */ typedef uint16_t _InstNode; -_InstInfo* inst_lookup(_CodeInfo* ci, _PrefixState* ps); +_InstInfo* inst_lookup(_CodeInfo* ci, _PrefixState* ps, int* isPrefixed); _InstInfo* inst_lookup_3dnow(_CodeInfo* ci); #endif /* INSTRUCTIONS_H */ + diff --git a/NativeCore/Dependencies/distorm/src/insts.c b/NativeCore/Dependencies/distorm/src/insts.c index f7d283e5..7aab70dc 100644 --- a/NativeCore/Dependencies/distorm/src/insts.c +++ b/NativeCore/Dependencies/distorm/src/insts.c @@ -4,7 +4,7 @@ insts.c diStorm3 - Powerful disassembler for X86/AMD64 http://ragestorm.net/distorm/ distorm at gmail dot com -Copyright (C) 2003-2018 Gil Dabah +Copyright (C) 2003-2021 Gil Dabah This library is licensed under the BSD license. See the file COPYING. */ @@ -15,15 +15,15 @@ This library is licensed under the BSD license. See the file COPYING. /* - * GENERATED BY disOps at Sat Nov 10 19:20:27 2018 + * GENERATED BY disOps at Sat Apr 3 17:52:58 2021 */ -_InstInfo II_MOVSXD = /*II*/ {0x1d4, 10027}; +_InstInfo II_MOVSXD = /*II*/ {0x1d7, 10039}; _InstInfo II_NOP = /*II*/ {0x53, 581}; -_InstInfo II_PAUSE = /*II*/ {0x88, 10035}; -_InstInfo II_WAIT = /*II*/ {0x53, 10042}; -_InstInfo II_RDRAND = /*II*/ {0x1d5, 10048}; -_InstInfo II_3DNOW = /*II*/ {0x1d6, 10056}; +_InstInfo II_PAUSE = /*II*/ {0x91, 10047}; +_InstInfo II_WAIT = /*II*/ {0x53, 10054}; +_InstInfo II_RDRAND = /*II*/ {0x1d8, 10060}; +_InstInfo II_3DNOW = /*II*/ {0x1d9, 10068}; _iflags FlagsTable[101] = { 0x80000011, @@ -60,7 +60,6 @@ _iflags FlagsTable[101] = { 0x4014000, 0x8, 0x81000009, -0x9, 0x80000009, 0x1000808, 0x81000808, @@ -94,6 +93,7 @@ _iflags FlagsTable[101] = { 0x80090009, 0x200b0009, 0x20020009, +0x9, 0x80100009, 0x21100009, 0x87000009, @@ -134,7 +134,7 @@ _InstNode Table_0F_0F = 1440; _InstNode Table_0F_38 = 1896; _InstNode Table_0F_3A = 2152; -_InstInfo InstInfos[1246] = { +_InstInfo InstInfos[1248] = { /*II_00*/ {0x0, 11}, /*II_01*/ {0x1, 11}, /*II_02*/ {0x2, 11}, @@ -232,10 +232,10 @@ _InstInfo InstInfos[1246] = { /*II_63*/ {0x32, 111}, /*II_68*/ {0x33, 16}, /*II_6A*/ {0x35, 16}, - /*II_6C*/ {0x36, 32891}, - /*II_6D*/ {0x37, 32891}, - /*II_6E*/ {0x38, 32896}, - /*II_6F*/ {0x39, 32896}, + /*II_6C*/ {0x36, 123}, + /*II_6D*/ {0x37, 123}, + /*II_6E*/ {0x38, 128}, + /*II_6F*/ {0x39, 128}, /*II_70*/ {0x3a, 134}, /*II_71*/ {0x3a, 138}, /*II_72*/ {0x3b, 143}, @@ -319,7 +319,7 @@ _InstInfo InstInfos[1246] = { /*II_CC*/ {0x6d, 360}, /*II_CD*/ {0x6e, 367}, /*II_CE*/ {0x6f, 372}, - /*II_CF*/ {0x70, 33146}, + /*II_CF*/ {0x70, 378}, /*II_D4*/ {0x71, 384}, /*II_D5*/ {0x71, 389}, /*II_D6*/ {0x72, 394}, @@ -327,1060 +327,1062 @@ _InstInfo InstInfos[1246] = { /*II_E0*/ {0x74, 406}, /*II_E1*/ {0x74, 414}, /*II_E2*/ {0x75, 421}, - /*II_E4*/ {0x77, 33215}, - /*II_E5*/ {0x78, 33215}, - /*II_E6*/ {0x79, 33219}, - /*II_E7*/ {0x7a, 33219}, + /*II_E4*/ {0x77, 447}, + /*II_E5*/ {0x78, 447}, + /*II_E6*/ {0x79, 451}, + /*II_E7*/ {0x7a, 451}, /*II_E8*/ {0x7b, 456}, /*II_E9*/ {0x7c, 462}, /*II_EA*/ {0x7d, 467}, /*II_EB*/ {0x7e, 462}, - /*II_EC*/ {0x7f, 33215}, - /*II_ED*/ {0x80, 33215}, - /*II_EE*/ {0x81, 33219}, - /*II_EF*/ {0x82, 33219}, + /*II_EC*/ {0x7f, 447}, + /*II_ED*/ {0x80, 447}, + /*II_EE*/ {0x81, 451}, + /*II_EF*/ {0x82, 451}, /*II_F1*/ {0x6d, 476}, - /*II_F4*/ {0x53, 33250}, - /*II_F5*/ {0x83, 487}, - /*II_F8*/ {0x83, 492}, - /*II_F9*/ {0x83, 497}, - /*II_FA*/ {0x84, 33270}, - /*II_FB*/ {0x84, 33275}, - /*II_FC*/ {0x85, 512}, - /*II_FD*/ {0x85, 517}, - /*II_0F_02*/ {0x86, 522}, - /*II_0F_03*/ {0x86, 527}, - /*II_0F_05*/ {0x87, 532}, - /*II_0F_06*/ {0x88, 33309}, - /*II_0F_07*/ {0x87, 547}, - /*II_0F_08*/ {0x88, 33323}, - /*II_0F_09*/ {0x88, 33329}, - /*II_0F_0B*/ {0x89, 569}, - /*II_0F_0E*/ {0x8a, 574}, - /*II_0F_1F*/ {0x8b, 581}, - /*II_0F_20*/ {0x8c, 32986}, - /*II_0F_21*/ {0x8d, 32986}, - /*II_0F_22*/ {0x8e, 32986}, - /*II_0F_23*/ {0x8f, 32986}, - /*II_0F_30*/ {0x88, 33354}, - /*II_0F_31*/ {0x88, 33361}, - /*II_0F_32*/ {0x88, 33368}, - /*II_0F_33*/ {0x88, 33375}, - /*II_0F_34*/ {0x87, 614}, - /*II_0F_35*/ {0x87, 624}, - /*II_0F_37*/ {0x90, 633}, - /*II_0F_40*/ {0x91, 641}, - /*II_0F_41*/ {0x91, 648}, - /*II_0F_42*/ {0x92, 656}, - /*II_0F_43*/ {0x92, 663}, - /*II_0F_44*/ {0x93, 671}, - /*II_0F_45*/ {0x93, 678}, - /*II_0F_46*/ {0x94, 686}, - /*II_0F_47*/ {0x94, 694}, - /*II_0F_48*/ {0x95, 701}, - /*II_0F_49*/ {0x95, 708}, - /*II_0F_4A*/ {0x96, 716}, - /*II_0F_4B*/ {0x96, 723}, - /*II_0F_4C*/ {0x97, 731}, - /*II_0F_4D*/ {0x97, 738}, - /*II_0F_4E*/ {0x98, 746}, - /*II_0F_4F*/ {0x98, 754}, - /*II_0F_80*/ {0x99, 134}, - /*II_0F_81*/ {0x99, 138}, - /*II_0F_82*/ {0x9a, 143}, - /*II_0F_83*/ {0x9a, 147}, - /*II_0F_84*/ {0x9b, 152}, - /*II_0F_85*/ {0x9b, 156}, - /*II_0F_86*/ {0x9c, 161}, - /*II_0F_87*/ {0x9c, 166}, - /*II_0F_88*/ {0x9d, 170}, - /*II_0F_89*/ {0x9d, 174}, - /*II_0F_8A*/ {0x9e, 179}, - /*II_0F_8B*/ {0x9e, 183}, - /*II_0F_8C*/ {0x9f, 188}, - /*II_0F_8D*/ {0x9f, 192}, - /*II_0F_8E*/ {0xa0, 197}, - /*II_0F_8F*/ {0xa0, 202}, - /*II_0F_90*/ {0xa1, 761}, - /*II_0F_91*/ {0xa1, 767}, - /*II_0F_92*/ {0xa2, 774}, - /*II_0F_93*/ {0xa2, 780}, - /*II_0F_94*/ {0xa3, 787}, - /*II_0F_95*/ {0xa3, 793}, - /*II_0F_96*/ {0xa4, 800}, - /*II_0F_97*/ {0xa4, 807}, - /*II_0F_98*/ {0xa5, 813}, - /*II_0F_99*/ {0xa5, 819}, - /*II_0F_9A*/ {0xa6, 826}, - /*II_0F_9B*/ {0xa6, 832}, - /*II_0F_9C*/ {0xa7, 839}, - /*II_0F_9D*/ {0xa7, 845}, - /*II_0F_9E*/ {0xa8, 852}, - /*II_0F_9F*/ {0xa8, 859}, - /*II_0F_A0*/ {0xa9, 16}, - /*II_0F_A1*/ {0xaa, 22}, - /*II_0F_A2*/ {0x88, 865}, - /*II_0F_A3*/ {0xab, 872}, - /*II_0F_A8*/ {0xad, 16}, - /*II_0F_A9*/ {0xae, 22}, - /*II_0F_AA*/ {0xaf, 882}, - /*II_0F_AB*/ {0xb0, 887}, - /*II_0F_AF*/ {0xb1, 117}, - /*II_0F_B0*/ {0xb2, 898}, - /*II_0F_B1*/ {0xb3, 898}, - /*II_0F_B2*/ {0xb4, 907}, - /*II_0F_B3*/ {0xb0, 912}, - /*II_0F_B4*/ {0xb4, 917}, - /*II_0F_B5*/ {0xb4, 922}, - /*II_0F_B6*/ {0xb5, 927}, - /*II_0F_B7*/ {0xb6, 927}, - /*II_0F_B9*/ {0x89, 569}, - /*II_0F_BB*/ {0xb0, 934}, - /*II_0F_BE*/ {0xb5, 939}, - /*II_0F_BF*/ {0xb6, 939}, - /*II_0F_C0*/ {0xb2, 946}, - /*II_0F_C1*/ {0xb3, 946}, - /*II_0F_C3*/ {0xb7, 952}, - /*II_0F_C8*/ {0xb8, 960}, - /*II_0F_C8*/ {0xb8, 960}, - /*II_0F_C8*/ {0xb8, 960}, - /*II_0F_C8*/ {0xb8, 960}, - /*II_0F_C8*/ {0xb8, 960}, - /*II_0F_C8*/ {0xb8, 960}, - /*II_0F_C8*/ {0xb8, 960}, - /*II_0F_C8*/ {0xb8, 960}, - /*II_80_00*/ {0xb9, 11}, - /*II_80_01*/ {0xba, 27}, - /*II_80_02*/ {0xbb, 31}, - /*II_80_03*/ {0xbb, 36}, - /*II_80_04*/ {0xbc, 41}, - /*II_80_05*/ {0xb9, 51}, - /*II_80_06*/ {0xbd, 61}, - /*II_80_07*/ {0xbe, 71}, - /*II_81_00*/ {0xbf, 11}, - /*II_81_01*/ {0xc0, 27}, - /*II_81_02*/ {0xc1, 31}, - /*II_81_03*/ {0xc1, 36}, - /*II_81_04*/ {0xc2, 41}, - /*II_81_05*/ {0xbf, 51}, - /*II_81_06*/ {0xc3, 61}, - /*II_81_07*/ {0xc4, 71}, - /*II_82_00*/ {0xc5, 11}, - /*II_82_01*/ {0xc6, 27}, - /*II_82_02*/ {0xc7, 31}, - /*II_82_03*/ {0xc7, 36}, - /*II_82_04*/ {0xc8, 41}, - /*II_82_05*/ {0xc5, 51}, - /*II_82_06*/ {0xc9, 61}, - /*II_82_07*/ {0xca, 71}, - /*II_83_00*/ {0xcb, 11}, - /*II_83_01*/ {0xcc, 27}, - /*II_83_02*/ {0xcd, 31}, - /*II_83_03*/ {0xcd, 36}, - /*II_83_04*/ {0xce, 41}, - /*II_83_05*/ {0xcb, 51}, - /*II_83_06*/ {0xcf, 61}, - /*II_83_07*/ {0xd0, 71}, - /*II_8F_00*/ {0xd1, 22}, - /*II_C0_00*/ {0xd2, 967}, - /*II_C0_01*/ {0xd2, 972}, - /*II_C0_02*/ {0xd3, 977}, - /*II_C0_03*/ {0xd3, 982}, - /*II_C0_04*/ {0xd4, 987}, - /*II_C0_05*/ {0xd4, 992}, - /*II_C0_06*/ {0xd4, 997}, - /*II_C0_07*/ {0xd4, 1002}, - /*II_C1_00*/ {0xd5, 967}, - /*II_C1_01*/ {0xd5, 972}, - /*II_C1_02*/ {0xd6, 977}, - /*II_C1_03*/ {0xd6, 982}, - /*II_C1_04*/ {0xd7, 987}, - /*II_C1_05*/ {0xd7, 992}, - /*II_C1_06*/ {0xd7, 997}, - /*II_C1_07*/ {0xd7, 1002}, - /*II_C6_00*/ {0xd8, 218}, - /*II_C6_F8*/ {0xd9, 1007}, - /*II_C7_00*/ {0xda, 218}, - /*II_C7_F8*/ {0xdb, 1015}, - /*II_D0_00*/ {0xdc, 967}, - /*II_D0_01*/ {0xdc, 972}, - /*II_D0_02*/ {0xdd, 977}, - /*II_D0_03*/ {0xdd, 982}, - /*II_D0_04*/ {0xde, 987}, - /*II_D0_05*/ {0xde, 992}, - /*II_D0_06*/ {0xde, 997}, - /*II_D0_07*/ {0xde, 1002}, - /*II_D1_00*/ {0xdf, 967}, - /*II_D1_01*/ {0xdf, 972}, - /*II_D1_02*/ {0xe0, 977}, - /*II_D1_03*/ {0xe0, 982}, - /*II_D1_04*/ {0xe1, 987}, - /*II_D1_05*/ {0xe1, 992}, - /*II_D1_06*/ {0xe1, 997}, - /*II_D1_07*/ {0xe1, 1002}, - /*II_D2_00*/ {0xe2, 967}, - /*II_D2_01*/ {0xe2, 972}, - /*II_D2_02*/ {0xe3, 977}, - /*II_D2_03*/ {0xe3, 982}, - /*II_D2_04*/ {0xe4, 987}, - /*II_D2_05*/ {0xe4, 992}, - /*II_D2_06*/ {0xe4, 997}, - /*II_D2_07*/ {0xe4, 1002}, - /*II_D3_00*/ {0xe5, 967}, - /*II_D3_01*/ {0xe5, 972}, - /*II_D3_02*/ {0xe6, 977}, - /*II_D3_03*/ {0xe6, 982}, - /*II_D3_04*/ {0xe7, 987}, - /*II_D3_05*/ {0xe7, 992}, - /*II_D3_06*/ {0xe7, 997}, - /*II_D3_07*/ {0xe7, 1002}, - /*II_D8_00*/ {0xe8, 1023}, - /*II_D8_01*/ {0xe8, 1029}, - /*II_D8_02*/ {0xe8, 1035}, - /*II_D8_03*/ {0xe8, 1041}, - /*II_D8_04*/ {0xe8, 1048}, - /*II_D8_05*/ {0xe8, 1054}, - /*II_D8_06*/ {0xe8, 1061}, - /*II_D8_07*/ {0xe8, 1067}, - /*II_D8_C0*/ {0xe9, 1023}, - /*II_D8_C0*/ {0xe9, 1023}, - /*II_D8_C0*/ {0xe9, 1023}, - /*II_D8_C0*/ {0xe9, 1023}, - /*II_D8_C0*/ {0xe9, 1023}, - /*II_D8_C0*/ {0xe9, 1023}, - /*II_D8_C0*/ {0xe9, 1023}, - /*II_D8_C0*/ {0xe9, 1023}, - /*II_D8_C8*/ {0xe9, 1029}, - /*II_D8_C8*/ {0xe9, 1029}, - /*II_D8_C8*/ {0xe9, 1029}, - /*II_D8_C8*/ {0xe9, 1029}, - /*II_D8_C8*/ {0xe9, 1029}, - /*II_D8_C8*/ {0xe9, 1029}, - /*II_D8_C8*/ {0xe9, 1029}, - /*II_D8_C8*/ {0xe9, 1029}, - /*II_D8_D0*/ {0xea, 1035}, - /*II_D8_D0*/ {0xea, 1035}, - /*II_D8_D0*/ {0xea, 1035}, - /*II_D8_D0*/ {0xea, 1035}, - /*II_D8_D0*/ {0xea, 1035}, - /*II_D8_D0*/ {0xea, 1035}, - /*II_D8_D0*/ {0xea, 1035}, - /*II_D8_D0*/ {0xea, 1035}, - /*II_D8_D8*/ {0xea, 1041}, - /*II_D8_D9*/ {0xeb, 1041}, - /*II_D8_D8*/ {0xea, 1041}, - /*II_D8_D8*/ {0xea, 1041}, - /*II_D8_D8*/ {0xea, 1041}, - /*II_D8_D8*/ {0xea, 1041}, - /*II_D8_D8*/ {0xea, 1041}, - /*II_D8_D8*/ {0xea, 1041}, - /*II_D8_E0*/ {0xe9, 1048}, - /*II_D8_E0*/ {0xe9, 1048}, - /*II_D8_E0*/ {0xe9, 1048}, - /*II_D8_E0*/ {0xe9, 1048}, - /*II_D8_E0*/ {0xe9, 1048}, - /*II_D8_E0*/ {0xe9, 1048}, - /*II_D8_E0*/ {0xe9, 1048}, - /*II_D8_E0*/ {0xe9, 1048}, - /*II_D8_E8*/ {0xe9, 1054}, - /*II_D8_E8*/ {0xe9, 1054}, - /*II_D8_E8*/ {0xe9, 1054}, - /*II_D8_E8*/ {0xe9, 1054}, - /*II_D8_E8*/ {0xe9, 1054}, - /*II_D8_E8*/ {0xe9, 1054}, - /*II_D8_E8*/ {0xe9, 1054}, - /*II_D8_E8*/ {0xe9, 1054}, - /*II_D8_F0*/ {0xe9, 1061}, - /*II_D8_F0*/ {0xe9, 1061}, - /*II_D8_F0*/ {0xe9, 1061}, - /*II_D8_F0*/ {0xe9, 1061}, - /*II_D8_F0*/ {0xe9, 1061}, - /*II_D8_F0*/ {0xe9, 1061}, - /*II_D8_F0*/ {0xe9, 1061}, - /*II_D8_F0*/ {0xe9, 1061}, - /*II_D8_F8*/ {0xe9, 1067}, - /*II_D8_F8*/ {0xe9, 1067}, - /*II_D8_F8*/ {0xe9, 1067}, - /*II_D8_F8*/ {0xe9, 1067}, - /*II_D8_F8*/ {0xe9, 1067}, - /*II_D8_F8*/ {0xe9, 1067}, - /*II_D8_F8*/ {0xe9, 1067}, - /*II_D8_F8*/ {0xe9, 1067}, - /*II_D9_00*/ {0xe8, 1074}, - /*II_D9_02*/ {0xec, 1079}, - /*II_D9_03*/ {0xec, 1084}, - /*II_D9_04*/ {0xed, 1090}, - /*II_D9_05*/ {0xee, 1098}, - /*II_D9_C0*/ {0xea, 1074}, - /*II_D9_C0*/ {0xea, 1074}, - /*II_D9_C0*/ {0xea, 1074}, - /*II_D9_C0*/ {0xea, 1074}, - /*II_D9_C0*/ {0xea, 1074}, - /*II_D9_C0*/ {0xea, 1074}, - /*II_D9_C0*/ {0xea, 1074}, - /*II_D9_C0*/ {0xea, 1074}, - /*II_D9_C8*/ {0xea, 1105}, - /*II_D9_C9*/ {0xeb, 1105}, - /*II_D9_C8*/ {0xea, 1105}, - /*II_D9_C8*/ {0xea, 1105}, - /*II_D9_C8*/ {0xea, 1105}, - /*II_D9_C8*/ {0xea, 1105}, - /*II_D9_C8*/ {0xea, 1105}, - /*II_D9_C8*/ {0xea, 1105}, - /*II_D9_D0*/ {0xeb, 1111}, - /*II_D9_E0*/ {0xeb, 1117}, - /*II_D9_E1*/ {0xeb, 1123}, - /*II_D9_E4*/ {0xeb, 1129}, - /*II_D9_E5*/ {0xeb, 1135}, - /*II_D9_E8*/ {0xeb, 1141}, - /*II_D9_E9*/ {0xeb, 1147}, - /*II_D9_EA*/ {0xeb, 1155}, - /*II_D9_EB*/ {0xeb, 1163}, - /*II_D9_EC*/ {0xeb, 1170}, - /*II_D9_ED*/ {0xeb, 1178}, - /*II_D9_EE*/ {0xeb, 1186}, - /*II_D9_F0*/ {0xeb, 1192}, - /*II_D9_F1*/ {0xeb, 1199}, - /*II_D9_F2*/ {0xeb, 1206}, - /*II_D9_F3*/ {0xeb, 1213}, - /*II_D9_F4*/ {0xeb, 1221}, - /*II_D9_F5*/ {0xeb, 1230}, - /*II_D9_F6*/ {0xeb, 1238}, - /*II_D9_F7*/ {0xeb, 1247}, - /*II_D9_F8*/ {0xeb, 1256}, - /*II_D9_F9*/ {0xeb, 1263}, - /*II_D9_FA*/ {0xeb, 1272}, - /*II_D9_FB*/ {0xeb, 1279}, - /*II_D9_FC*/ {0xeb, 1288}, - /*II_D9_FD*/ {0xeb, 1297}, - /*II_D9_FE*/ {0xeb, 1305}, - /*II_D9_FF*/ {0xeb, 1311}, - /*II_DA_00*/ {0xe8, 1317}, - /*II_DA_01*/ {0xe8, 1324}, - /*II_DA_02*/ {0xe8, 1331}, - /*II_DA_03*/ {0xe8, 1338}, - /*II_DA_04*/ {0xe8, 1346}, - /*II_DA_05*/ {0xe8, 1353}, - /*II_DA_06*/ {0xe8, 1361}, - /*II_DA_07*/ {0xe8, 1368}, - /*II_DA_C0*/ {0xef, 1376}, - /*II_DA_C0*/ {0xef, 1376}, - /*II_DA_C0*/ {0xef, 1376}, - /*II_DA_C0*/ {0xef, 1376}, - /*II_DA_C0*/ {0xef, 1376}, - /*II_DA_C0*/ {0xef, 1376}, - /*II_DA_C0*/ {0xef, 1376}, - /*II_DA_C0*/ {0xef, 1376}, - /*II_DA_C8*/ {0xf0, 1384}, - /*II_DA_C8*/ {0xf0, 1384}, - /*II_DA_C8*/ {0xf0, 1384}, - /*II_DA_C8*/ {0xf0, 1384}, - /*II_DA_C8*/ {0xf0, 1384}, - /*II_DA_C8*/ {0xf0, 1384}, - /*II_DA_C8*/ {0xf0, 1384}, - /*II_DA_C8*/ {0xf0, 1384}, - /*II_DA_D0*/ {0xf1, 1392}, - /*II_DA_D0*/ {0xf1, 1392}, - /*II_DA_D0*/ {0xf1, 1392}, - /*II_DA_D0*/ {0xf1, 1392}, - /*II_DA_D0*/ {0xf1, 1392}, - /*II_DA_D0*/ {0xf1, 1392}, - /*II_DA_D0*/ {0xf1, 1392}, - /*II_DA_D0*/ {0xf1, 1392}, - /*II_DA_D8*/ {0xf2, 1401}, - /*II_DA_D8*/ {0xf2, 1401}, - /*II_DA_D8*/ {0xf2, 1401}, - /*II_DA_D8*/ {0xf2, 1401}, - /*II_DA_D8*/ {0xf2, 1401}, - /*II_DA_D8*/ {0xf2, 1401}, - /*II_DA_D8*/ {0xf2, 1401}, - /*II_DA_D8*/ {0xf2, 1401}, - /*II_DA_E9*/ {0xeb, 1409}, - /*II_DB_00*/ {0xe8, 1418}, - /*II_DB_01*/ {0xf3, 1424}, - /*II_DB_02*/ {0xec, 1432}, - /*II_DB_03*/ {0xec, 1438}, - /*II_DB_05*/ {0xf4, 1074}, - /*II_DB_07*/ {0xf5, 1084}, - /*II_DB_C0*/ {0xef, 1445}, - /*II_DB_C0*/ {0xef, 1445}, - /*II_DB_C0*/ {0xef, 1445}, - /*II_DB_C0*/ {0xef, 1445}, - /*II_DB_C0*/ {0xef, 1445}, - /*II_DB_C0*/ {0xef, 1445}, - /*II_DB_C0*/ {0xef, 1445}, - /*II_DB_C0*/ {0xef, 1445}, - /*II_DB_C8*/ {0xf0, 1454}, - /*II_DB_C8*/ {0xf0, 1454}, - /*II_DB_C8*/ {0xf0, 1454}, - /*II_DB_C8*/ {0xf0, 1454}, - /*II_DB_C8*/ {0xf0, 1454}, - /*II_DB_C8*/ {0xf0, 1454}, - /*II_DB_C8*/ {0xf0, 1454}, - /*II_DB_C8*/ {0xf0, 1454}, - /*II_DB_D0*/ {0xf1, 1463}, - /*II_DB_D0*/ {0xf1, 1463}, - /*II_DB_D0*/ {0xf1, 1463}, - /*II_DB_D0*/ {0xf1, 1463}, - /*II_DB_D0*/ {0xf1, 1463}, - /*II_DB_D0*/ {0xf1, 1463}, - /*II_DB_D0*/ {0xf1, 1463}, - /*II_DB_D0*/ {0xf1, 1463}, - /*II_DB_D8*/ {0xf2, 1473}, - /*II_DB_D8*/ {0xf2, 1473}, - /*II_DB_D8*/ {0xf2, 1473}, - /*II_DB_D8*/ {0xf2, 1473}, - /*II_DB_D8*/ {0xf2, 1473}, - /*II_DB_D8*/ {0xf2, 1473}, - /*II_DB_D8*/ {0xf2, 1473}, - /*II_DB_D8*/ {0xf2, 1473}, - /*II_DB_E0*/ {0xeb, 1482}, - /*II_DB_E1*/ {0xeb, 1488}, - /*II_DB_E4*/ {0xeb, 1496}, - /*II_DB_E8*/ {0xf6, 1504}, - /*II_DB_E8*/ {0xf6, 1504}, - /*II_DB_E8*/ {0xf6, 1504}, - /*II_DB_E8*/ {0xf6, 1504}, - /*II_DB_E8*/ {0xf6, 1504}, - /*II_DB_E8*/ {0xf6, 1504}, - /*II_DB_E8*/ {0xf6, 1504}, - /*II_DB_E8*/ {0xf6, 1504}, - /*II_DB_F0*/ {0xf7, 1512}, - /*II_DB_F0*/ {0xf7, 1512}, - /*II_DB_F0*/ {0xf7, 1512}, - /*II_DB_F0*/ {0xf7, 1512}, - /*II_DB_F0*/ {0xf7, 1512}, - /*II_DB_F0*/ {0xf7, 1512}, - /*II_DB_F0*/ {0xf7, 1512}, - /*II_DB_F0*/ {0xf7, 1512}, - /*II_DC_00*/ {0xf8, 1023}, - /*II_DC_01*/ {0xf8, 1029}, - /*II_DC_02*/ {0xf8, 1035}, - /*II_DC_03*/ {0xf8, 1041}, - /*II_DC_04*/ {0xf8, 1048}, - /*II_DC_05*/ {0xf8, 1054}, - /*II_DC_06*/ {0xf8, 1061}, - /*II_DC_07*/ {0xf8, 1067}, - /*II_DC_C0*/ {0xf9, 1023}, - /*II_DC_C0*/ {0xf9, 1023}, - /*II_DC_C0*/ {0xf9, 1023}, - /*II_DC_C0*/ {0xf9, 1023}, - /*II_DC_C0*/ {0xf9, 1023}, - /*II_DC_C0*/ {0xf9, 1023}, - /*II_DC_C0*/ {0xf9, 1023}, - /*II_DC_C0*/ {0xf9, 1023}, - /*II_DC_C8*/ {0xf9, 1029}, - /*II_DC_C8*/ {0xf9, 1029}, - /*II_DC_C8*/ {0xf9, 1029}, - /*II_DC_C8*/ {0xf9, 1029}, - /*II_DC_C8*/ {0xf9, 1029}, - /*II_DC_C8*/ {0xf9, 1029}, - /*II_DC_C8*/ {0xf9, 1029}, - /*II_DC_C8*/ {0xf9, 1029}, - /*II_DC_E0*/ {0xf9, 1054}, - /*II_DC_E0*/ {0xf9, 1054}, - /*II_DC_E0*/ {0xf9, 1054}, - /*II_DC_E0*/ {0xf9, 1054}, - /*II_DC_E0*/ {0xf9, 1054}, - /*II_DC_E0*/ {0xf9, 1054}, - /*II_DC_E0*/ {0xf9, 1054}, - /*II_DC_E0*/ {0xf9, 1054}, - /*II_DC_E8*/ {0xf9, 1048}, - /*II_DC_E8*/ {0xf9, 1048}, - /*II_DC_E8*/ {0xf9, 1048}, - /*II_DC_E8*/ {0xf9, 1048}, - /*II_DC_E8*/ {0xf9, 1048}, - /*II_DC_E8*/ {0xf9, 1048}, - /*II_DC_E8*/ {0xf9, 1048}, - /*II_DC_E8*/ {0xf9, 1048}, - /*II_DC_F0*/ {0xf9, 1067}, - /*II_DC_F0*/ {0xf9, 1067}, - /*II_DC_F0*/ {0xf9, 1067}, - /*II_DC_F0*/ {0xf9, 1067}, - /*II_DC_F0*/ {0xf9, 1067}, - /*II_DC_F0*/ {0xf9, 1067}, - /*II_DC_F0*/ {0xf9, 1067}, - /*II_DC_F0*/ {0xf9, 1067}, - /*II_DC_F8*/ {0xf9, 1061}, - /*II_DC_F8*/ {0xf9, 1061}, - /*II_DC_F8*/ {0xf9, 1061}, - /*II_DC_F8*/ {0xf9, 1061}, - /*II_DC_F8*/ {0xf9, 1061}, - /*II_DC_F8*/ {0xf9, 1061}, - /*II_DC_F8*/ {0xf9, 1061}, - /*II_DC_F8*/ {0xf9, 1061}, - /*II_DD_00*/ {0xf8, 1074}, - /*II_DD_01*/ {0xfa, 1424}, - /*II_DD_02*/ {0xfb, 1079}, - /*II_DD_03*/ {0xfb, 1084}, - /*II_DD_04*/ {0xed, 1519}, - /*II_DD_C0*/ {0xea, 1527}, - /*II_DD_C0*/ {0xea, 1527}, - /*II_DD_C0*/ {0xea, 1527}, - /*II_DD_C0*/ {0xea, 1527}, - /*II_DD_C0*/ {0xea, 1527}, - /*II_DD_C0*/ {0xea, 1527}, - /*II_DD_C0*/ {0xea, 1527}, - /*II_DD_C0*/ {0xea, 1527}, - /*II_DD_D0*/ {0xea, 1079}, - /*II_DD_D0*/ {0xea, 1079}, - /*II_DD_D0*/ {0xea, 1079}, - /*II_DD_D0*/ {0xea, 1079}, - /*II_DD_D0*/ {0xea, 1079}, - /*II_DD_D0*/ {0xea, 1079}, - /*II_DD_D0*/ {0xea, 1079}, - /*II_DD_D0*/ {0xea, 1079}, - /*II_DD_D8*/ {0xea, 1084}, - /*II_DD_D8*/ {0xea, 1084}, - /*II_DD_D8*/ {0xea, 1084}, - /*II_DD_D8*/ {0xea, 1084}, - /*II_DD_D8*/ {0xea, 1084}, - /*II_DD_D8*/ {0xea, 1084}, - /*II_DD_D8*/ {0xea, 1084}, - /*II_DD_D8*/ {0xea, 1084}, - /*II_DD_E0*/ {0xf9, 1534}, - /*II_DD_E1*/ {0xeb, 1534}, - /*II_DD_E0*/ {0xf9, 1534}, - /*II_DD_E0*/ {0xf9, 1534}, - /*II_DD_E0*/ {0xf9, 1534}, - /*II_DD_E0*/ {0xf9, 1534}, - /*II_DD_E0*/ {0xf9, 1534}, - /*II_DD_E0*/ {0xf9, 1534}, - /*II_DD_E8*/ {0xea, 1541}, - /*II_DD_E9*/ {0xeb, 1541}, - /*II_DD_E8*/ {0xea, 1541}, - /*II_DD_E8*/ {0xea, 1541}, - /*II_DD_E8*/ {0xea, 1541}, - /*II_DD_E8*/ {0xea, 1541}, - /*II_DD_E8*/ {0xea, 1541}, - /*II_DD_E8*/ {0xea, 1541}, - /*II_DE_00*/ {0xee, 1317}, - /*II_DE_01*/ {0xee, 1324}, - /*II_DE_02*/ {0xee, 1331}, - /*II_DE_03*/ {0xee, 1338}, - /*II_DE_04*/ {0xee, 1346}, - /*II_DE_05*/ {0xee, 1353}, - /*II_DE_06*/ {0xee, 1361}, - /*II_DE_07*/ {0xee, 1368}, - /*II_DE_C0*/ {0xf9, 1549}, - /*II_DE_C1*/ {0xeb, 1549}, - /*II_DE_C0*/ {0xf9, 1549}, - /*II_DE_C0*/ {0xf9, 1549}, - /*II_DE_C0*/ {0xf9, 1549}, - /*II_DE_C0*/ {0xf9, 1549}, - /*II_DE_C0*/ {0xf9, 1549}, - /*II_DE_C0*/ {0xf9, 1549}, - /*II_DE_C8*/ {0xf9, 1556}, - /*II_DE_C9*/ {0xeb, 1556}, - /*II_DE_C8*/ {0xf9, 1556}, - /*II_DE_C8*/ {0xf9, 1556}, - /*II_DE_C8*/ {0xf9, 1556}, - /*II_DE_C8*/ {0xf9, 1556}, - /*II_DE_C8*/ {0xf9, 1556}, - /*II_DE_C8*/ {0xf9, 1556}, - /*II_DE_D9*/ {0xeb, 1563}, - /*II_DE_E0*/ {0xf9, 1571}, - /*II_DE_E1*/ {0xeb, 1571}, - /*II_DE_E0*/ {0xf9, 1571}, - /*II_DE_E0*/ {0xf9, 1571}, - /*II_DE_E0*/ {0xf9, 1571}, - /*II_DE_E0*/ {0xf9, 1571}, - /*II_DE_E0*/ {0xf9, 1571}, - /*II_DE_E0*/ {0xf9, 1571}, - /*II_DE_E8*/ {0xf9, 1579}, - /*II_DE_E9*/ {0xeb, 1579}, - /*II_DE_E8*/ {0xf9, 1579}, - /*II_DE_E8*/ {0xf9, 1579}, - /*II_DE_E8*/ {0xf9, 1579}, - /*II_DE_E8*/ {0xf9, 1579}, - /*II_DE_E8*/ {0xf9, 1579}, - /*II_DE_E8*/ {0xf9, 1579}, - /*II_DE_F0*/ {0xf9, 1586}, - /*II_DE_F1*/ {0xeb, 1586}, - /*II_DE_F0*/ {0xf9, 1586}, - /*II_DE_F0*/ {0xf9, 1586}, - /*II_DE_F0*/ {0xf9, 1586}, - /*II_DE_F0*/ {0xf9, 1586}, - /*II_DE_F0*/ {0xf9, 1586}, - /*II_DE_F0*/ {0xf9, 1586}, - /*II_DE_F8*/ {0xf9, 1594}, - /*II_DE_F9*/ {0xeb, 1594}, - /*II_DE_F8*/ {0xf9, 1594}, - /*II_DE_F8*/ {0xf9, 1594}, - /*II_DE_F8*/ {0xf9, 1594}, - /*II_DE_F8*/ {0xf9, 1594}, - /*II_DE_F8*/ {0xf9, 1594}, - /*II_DE_F8*/ {0xf9, 1594}, - /*II_DF_00*/ {0xee, 1418}, - /*II_DF_01*/ {0xfc, 1424}, - /*II_DF_02*/ {0xfd, 1432}, - /*II_DF_03*/ {0xfd, 1438}, - /*II_DF_04*/ {0xf4, 1601}, - /*II_DF_05*/ {0xf8, 1418}, - /*II_DF_06*/ {0xf5, 1607}, - /*II_DF_07*/ {0xfb, 1438}, - /*II_DF_E8*/ {0xf6, 1614}, - /*II_DF_E8*/ {0xf6, 1614}, - /*II_DF_E8*/ {0xf6, 1614}, - /*II_DF_E8*/ {0xf6, 1614}, - /*II_DF_E8*/ {0xf6, 1614}, - /*II_DF_E8*/ {0xf6, 1614}, - /*II_DF_E8*/ {0xf6, 1614}, - /*II_DF_E8*/ {0xf6, 1614}, - /*II_DF_F0*/ {0xf6, 1623}, - /*II_DF_F0*/ {0xf6, 1623}, - /*II_DF_F0*/ {0xf6, 1623}, - /*II_DF_F0*/ {0xf6, 1623}, - /*II_DF_F0*/ {0xf6, 1623}, - /*II_DF_F0*/ {0xf6, 1623}, - /*II_DF_F0*/ {0xf6, 1623}, - /*II_DF_F0*/ {0xf6, 1623}, - /*II_F6_00*/ {0xfe, 206}, - /*II_F6_02*/ {0xff, 1631}, - /*II_F6_03*/ {0x100, 1636}, - /*II_F6_04*/ {0x101, 1641}, - /*II_F6_05*/ {0x101, 117}, - /*II_F6_06*/ {0x102, 1646}, - /*II_F6_07*/ {0x102, 1651}, - /*II_F7_00*/ {0x103, 206}, - /*II_F7_02*/ {0x104, 1631}, - /*II_F7_03*/ {0x105, 1636}, - /*II_F7_04*/ {0x106, 1641}, - /*II_F7_05*/ {0x106, 117}, - /*II_F7_06*/ {0x107, 1646}, - /*II_F7_07*/ {0x107, 1651}, - /*II_FE_00*/ {0x108, 81}, - /*II_FE_01*/ {0x108, 86}, - /*II_FF_00*/ {0x109, 81}, - /*II_FF_01*/ {0x109, 86}, - /*II_FF_02*/ {0x10a, 456}, - /*II_FF_03*/ {0x10b, 260}, - /*II_FF_04*/ {0x10c, 462}, - /*II_FF_05*/ {0x10d, 467}, - /*II_FF_06*/ {0x10e, 16}, - /*II_0F_00_00*/ {0x10f, 1657}, - /*II_0F_00_01*/ {0x110, 1663}, - /*II_0F_00_02*/ {0x110, 34436}, - /*II_0F_00_03*/ {0x111, 34442}, - /*II_0F_00_04*/ {0x112, 1679}, - /*II_0F_00_05*/ {0x112, 1685}, - /*II_0F_01_00*/ {0x113, 1691}, - /*II_0F_01_01*/ {0x113, 1697}, - /*II_0F_01_02*/ {0x113, 34471}, - /*II_0F_01_03*/ {0x113, 34477}, - /*II_0F_01_04*/ {0x114, 1715}, - /*II_0F_01_06*/ {0x115, 34489}, - /*II_0F_01_07*/ {0x116, 34495}, - /*II_0F_01_C1*/ {0x117, 1735}, - /*II_0F_01_C2*/ {0x117, 1743}, - /*II_0F_01_C3*/ {0x117, 1753}, - /*II_0F_01_C4*/ {0x117, 1763}, - /*II_0F_01_C8*/ {0x118, 1771}, - /*II_0F_01_C9*/ {0x118, 1780}, - /*II_0F_01_D0*/ {0x88, 1787}, - /*II_0F_01_D1*/ {0x88, 1795}, - /*II_0F_01_D4*/ {0x117, 1803}, - /*II_0F_01_D5*/ {0x119, 1811}, - /*II_0F_01_D8*/ {0x11a, 1817}, - /*II_0F_01_D9*/ {0x11b, 1824}, - /*II_0F_01_DA*/ {0x11c, 1833}, - /*II_0F_01_DB*/ {0x11c, 1841}, - /*II_0F_01_DC*/ {0x11b, 1849}, - /*II_0F_01_DD*/ {0x11b, 1855}, - /*II_0F_01_DE*/ {0x11c, 1861}, - /*II_0F_01_DF*/ {0x11d, 1869}, - /*II_0F_01_F8*/ {0x11e, 1878}, - /*II_0F_01_F9*/ {0x11e, 1886}, - /*II_0F_0D_00*/ {0x11f, 1894}, - /*II_0F_0D_01*/ {0x11f, 1904}, - /*II_0F_0F_0C*/ {0x120, 1915}, - /*II_0F_0F_0D*/ {0x121, 1922}, - /*II_0F_0F_1C*/ {0x120, 1929}, - /*II_0F_0F_1D*/ {0x121, 1936}, - /*II_0F_0F_8A*/ {0x120, 1943}, - /*II_0F_0F_8E*/ {0x120, 1951}, - /*II_0F_0F_90*/ {0x121, 1960}, - /*II_0F_0F_94*/ {0x121, 1969}, - /*II_0F_0F_96*/ {0x121, 1976}, - /*II_0F_0F_97*/ {0x121, 1983}, - /*II_0F_0F_9A*/ {0x121, 1992}, - /*II_0F_0F_9E*/ {0x121, 1999}, - /*II_0F_0F_A0*/ {0x121, 2006}, - /*II_0F_0F_A4*/ {0x121, 2015}, - /*II_0F_0F_A6*/ {0x121, 2022}, - /*II_0F_0F_A7*/ {0x121, 2032}, - /*II_0F_0F_AA*/ {0x121, 2042}, - /*II_0F_0F_AE*/ {0x121, 2050}, - /*II_0F_0F_B0*/ {0x121, 2057}, - /*II_0F_0F_B4*/ {0x121, 2066}, - /*II_0F_0F_B6*/ {0x121, 2073}, - /*II_0F_0F_B7*/ {0x121, 2083}, - /*II_0F_0F_BB*/ {0x120, 2092}, - /*II_0F_0F_BF*/ {0x121, 2100}, - /*II_0F_10*/ {0x122, 2109}, - /*II_66_0F_10*/ {0x123, 2117}, - /*II_F3_0F_10*/ {0x124, 2125}, - /*II_F2_0F_10*/ {0x125, 2132}, - /*II_0F_11*/ {0x12a, 2109}, - /*II_66_0F_11*/ {0x12b, 2117}, - /*II_F3_0F_11*/ {0x12c, 2125}, - /*II_F2_0F_11*/ {0x12d, 2132}, - /*II_66_0F_12*/ {0x132, 2190}, - /*II_F3_0F_12*/ {0x133, 2198}, - /*II_F2_0F_12*/ {0x133, 2208}, - /*II_0F_13*/ {0x137, 2182}, - /*II_66_0F_13*/ {0x138, 2190}, - /*II_0F_14*/ {0x13a, 2266}, - /*II_66_0F_14*/ {0x13b, 2276}, - /*II_0F_15*/ {0x13a, 2308}, - /*II_66_0F_15*/ {0x13b, 2318}, - /*II_66_0F_16*/ {0x132, 2367}, - /*II_F3_0F_16*/ {0x13d, 2375}, - /*II_0F_17*/ {0x137, 2359}, - /*II_66_0F_17*/ {0x138, 2367}, - /*II_0F_18_00*/ {0x13e, 2424}, - /*II_0F_18_01*/ {0x13e, 2437}, - /*II_0F_18_02*/ {0x13e, 2449}, - /*II_0F_18_03*/ {0x13e, 2461}, - /*II_0F_28*/ {0x122, 2473}, - /*II_66_0F_28*/ {0x123, 2481}, - /*II_0F_29*/ {0x12a, 2473}, - /*II_66_0F_29*/ {0x12b, 2481}, - /*II_0F_2A*/ {0x13f, 2507}, - /*II_66_0F_2A*/ {0x140, 2517}, - /*II_F3_0F_2A*/ {0x141, 2527}, - /*II_F2_0F_2A*/ {0x142, 2537}, - /*II_0F_2B*/ {0x143, 2569}, - /*II_66_0F_2B*/ {0x144, 2578}, - /*II_F3_0F_2B*/ {0x145, 2587}, - /*II_F2_0F_2B*/ {0x146, 2596}, - /*II_0F_2C*/ {0x148, 2625}, - /*II_66_0F_2C*/ {0x149, 2636}, - /*II_F3_0F_2C*/ {0x14a, 2647}, - /*II_F2_0F_2C*/ {0x14b, 2658}, - /*II_0F_2D*/ {0x148, 2693}, - /*II_66_0F_2D*/ {0x13b, 2703}, - /*II_F3_0F_2D*/ {0x14a, 2713}, - /*II_F2_0F_2D*/ {0x14b, 2723}, - /*II_0F_2E*/ {0x14d, 2755}, - /*II_66_0F_2E*/ {0x14e, 2764}, - /*II_0F_2F*/ {0x14d, 2793}, - /*II_66_0F_2F*/ {0x14e, 2801}, - /*II_0F_50*/ {0x151, 2827}, - /*II_66_0F_50*/ {0x152, 2837}, - /*II_0F_51*/ {0x13a, 2869}, - /*II_66_0F_51*/ {0x13b, 2877}, - /*II_F3_0F_51*/ {0x154, 2885}, - /*II_F2_0F_51*/ {0x14e, 2893}, - /*II_0F_52*/ {0x13a, 2937}, - /*II_F3_0F_52*/ {0x154, 2946}, - /*II_0F_53*/ {0x13a, 2975}, - /*II_F3_0F_53*/ {0x154, 2982}, - /*II_0F_54*/ {0x13a, 3005}, - /*II_66_0F_54*/ {0x13b, 3012}, - /*II_0F_55*/ {0x13a, 3035}, - /*II_66_0F_55*/ {0x13b, 3043}, - /*II_0F_56*/ {0x13a, 3069}, - /*II_66_0F_56*/ {0x13b, 3075}, - /*II_0F_57*/ {0x13a, 3095}, - /*II_66_0F_57*/ {0x13b, 3102}, - /*II_0F_58*/ {0x13a, 3125}, - /*II_66_0F_58*/ {0x13b, 3132}, - /*II_F3_0F_58*/ {0x154, 3139}, - /*II_F2_0F_58*/ {0x14e, 3146}, - /*II_0F_59*/ {0x13a, 3185}, - /*II_66_0F_59*/ {0x13b, 3192}, - /*II_F3_0F_59*/ {0x154, 3199}, - /*II_F2_0F_59*/ {0x14e, 3206}, - /*II_0F_5A*/ {0x14e, 3245}, - /*II_66_0F_5A*/ {0x13b, 3255}, - /*II_F3_0F_5A*/ {0x155, 3265}, - /*II_F2_0F_5A*/ {0x14e, 3275}, - /*II_0F_5B*/ {0x13b, 3329}, - /*II_66_0F_5B*/ {0x13b, 3339}, - /*II_F3_0F_5B*/ {0x13b, 3349}, - /*II_0F_5C*/ {0x13a, 3394}, - /*II_66_0F_5C*/ {0x13b, 3401}, - /*II_F3_0F_5C*/ {0x154, 3408}, - /*II_F2_0F_5C*/ {0x14e, 3415}, - /*II_0F_5D*/ {0x13a, 3454}, - /*II_66_0F_5D*/ {0x13b, 3461}, - /*II_F3_0F_5D*/ {0x154, 3468}, - /*II_F2_0F_5D*/ {0x14e, 3475}, - /*II_0F_5E*/ {0x13a, 3514}, - /*II_66_0F_5E*/ {0x13b, 3521}, - /*II_F3_0F_5E*/ {0x154, 3528}, - /*II_F2_0F_5E*/ {0x14e, 3535}, - /*II_0F_5F*/ {0x13a, 3574}, - /*II_66_0F_5F*/ {0x13b, 3581}, - /*II_F3_0F_5F*/ {0x154, 3588}, - /*II_F2_0F_5F*/ {0x14e, 3595}, - /*II_0F_60*/ {0x158, 3634}, - /*II_66_0F_60*/ {0x13b, 3634}, - /*II_0F_61*/ {0x158, 3657}, - /*II_66_0F_61*/ {0x13b, 3657}, - /*II_0F_62*/ {0x158, 3680}, - /*II_66_0F_62*/ {0x13b, 3680}, - /*II_0F_63*/ {0x159, 3703}, - /*II_66_0F_63*/ {0x13b, 3703}, - /*II_0F_64*/ {0x159, 3724}, - /*II_66_0F_64*/ {0x13b, 3724}, - /*II_0F_65*/ {0x159, 3743}, - /*II_66_0F_65*/ {0x13b, 3743}, - /*II_0F_66*/ {0x159, 3762}, - /*II_66_0F_66*/ {0x13b, 3762}, - /*II_0F_67*/ {0x159, 3781}, - /*II_66_0F_67*/ {0x13b, 3781}, - /*II_0F_68*/ {0x159, 3802}, - /*II_66_0F_68*/ {0x13b, 3802}, - /*II_0F_69*/ {0x159, 3825}, - /*II_66_0F_69*/ {0x13b, 3825}, - /*II_0F_6A*/ {0x159, 3848}, - /*II_66_0F_6A*/ {0x13b, 3848}, - /*II_0F_6B*/ {0x159, 3871}, - /*II_66_0F_6B*/ {0x13b, 3871}, - /*II_66_0F_6C*/ {0x13b, 3892}, - /*II_66_0F_6D*/ {0x13b, 3917}, - /*II_0F_6F*/ {0x15d, 3948}, - /*II_66_0F_6F*/ {0x123, 3968}, - /*II_F3_0F_6F*/ {0x123, 3976}, - /*II_0F_74*/ {0x159, 4065}, - /*II_66_0F_74*/ {0x13b, 4065}, - /*II_0F_75*/ {0x159, 4084}, - /*II_66_0F_75*/ {0x13b, 4084}, - /*II_0F_76*/ {0x159, 4103}, - /*II_66_0F_76*/ {0x13b, 4103}, - /*II_0F_77*/ {0x161, 4122}, - /*II_0F_78*/ {0x163, 4150}, - /*II_0F_79*/ {0x166, 4174}, - /*II_66_0F_79*/ {0x167, 4158}, - /*II_F2_0F_79*/ {0x168, 4165}, - /*II_0F_7A_30*/ {0x169, 4183}, - /*II_0F_7A_31*/ {0x16a, 4193}, - /*II_66_0F_7C*/ {0x16b, 4203}, - /*II_F2_0F_7C*/ {0x16b, 4211}, - /*II_66_0F_7D*/ {0x16b, 4237}, - /*II_F2_0F_7D*/ {0x16b, 4245}, - /*II_F3_0F_7E*/ {0x125, 3948}, - /*II_0F_7F*/ {0x16f, 3948}, - /*II_66_0F_7F*/ {0x12b, 3968}, - /*II_F3_0F_7F*/ {0x12b, 3976}, - /*II_F3_0F_B8*/ {0x173, 4360}, - /*II_0F_BA_04*/ {0x174, 872}, - /*II_0F_BA_05*/ {0x175, 887}, - /*II_0F_BA_06*/ {0x175, 912}, - /*II_0F_BA_07*/ {0x175, 934}, - /*II_0F_BC*/ {0x176, 4368}, - /*II_F3_0F_BC*/ {0x177, 4373}, - /*II_0F_BD*/ {0x176, 4380}, - /*II_F3_0F_BD*/ {0x178, 4385}, - /*II_0F_C7_07*/ {0x188, 6407}, - /*II_66_0F_D0*/ {0x16b, 6416}, - /*II_F2_0F_D0*/ {0x16b, 6426}, - /*II_0F_D1*/ {0x159, 6458}, - /*II_66_0F_D1*/ {0x13b, 6458}, - /*II_0F_D2*/ {0x159, 6473}, - /*II_66_0F_D2*/ {0x13b, 6473}, - /*II_0F_D3*/ {0x159, 6488}, - /*II_66_0F_D3*/ {0x13b, 6488}, - /*II_0F_D4*/ {0x14e, 6503}, - /*II_66_0F_D4*/ {0x13b, 6503}, - /*II_0F_D5*/ {0x159, 6518}, - /*II_66_0F_D5*/ {0x13b, 6518}, - /*II_66_0F_D6*/ {0x12d, 3948}, - /*II_F3_0F_D6*/ {0x189, 6535}, - /*II_F2_0F_D6*/ {0x18a, 6544}, - /*II_0F_D7*/ {0x18c, 6553}, - /*II_66_0F_D7*/ {0x18d, 6553}, - /*II_0F_D8*/ {0x159, 6574}, - /*II_66_0F_D8*/ {0x13b, 6574}, - /*II_0F_D9*/ {0x159, 6593}, - /*II_66_0F_D9*/ {0x13b, 6593}, - /*II_0F_DA*/ {0x18f, 6612}, - /*II_66_0F_DA*/ {0x13b, 6612}, - /*II_0F_DB*/ {0x159, 6629}, - /*II_66_0F_DB*/ {0x13b, 6629}, - /*II_0F_DC*/ {0x159, 6642}, - /*II_66_0F_DC*/ {0x13b, 6642}, - /*II_0F_DD*/ {0x159, 6661}, - /*II_66_0F_DD*/ {0x13b, 6661}, - /*II_0F_DE*/ {0x18f, 6670}, - /*II_66_0F_DE*/ {0x13b, 6670}, - /*II_0F_DF*/ {0x159, 6687}, - /*II_66_0F_DF*/ {0x13b, 6687}, - /*II_0F_E0*/ {0x18f, 6702}, - /*II_66_0F_E0*/ {0x13b, 6702}, - /*II_0F_E1*/ {0x159, 6717}, - /*II_66_0F_E1*/ {0x13b, 6717}, - /*II_0F_E2*/ {0x159, 6732}, - /*II_66_0F_E2*/ {0x13b, 6732}, - /*II_0F_E3*/ {0x18f, 6747}, - /*II_66_0F_E3*/ {0x13b, 6747}, - /*II_0F_E4*/ {0x18f, 6762}, - /*II_66_0F_E4*/ {0x13b, 6762}, - /*II_0F_E5*/ {0x159, 6781}, - /*II_66_0F_E5*/ {0x13b, 6781}, - /*II_66_0F_E6*/ {0x13b, 6798}, - /*II_F3_0F_E6*/ {0x14e, 6809}, - /*II_F2_0F_E6*/ {0x13b, 6819}, - /*II_0F_E7*/ {0x190, 6863}, - /*II_66_0F_E7*/ {0x144, 6871}, - /*II_0F_E8*/ {0x159, 6890}, - /*II_66_0F_E8*/ {0x13b, 6890}, - /*II_0F_E9*/ {0x159, 6907}, - /*II_66_0F_E9*/ {0x13b, 6907}, - /*II_0F_EA*/ {0x18f, 6924}, - /*II_66_0F_EA*/ {0x13b, 6924}, - /*II_0F_EB*/ {0x159, 6941}, - /*II_66_0F_EB*/ {0x13b, 6941}, - /*II_0F_EC*/ {0x159, 6952}, - /*II_66_0F_EC*/ {0x13b, 6952}, - /*II_0F_ED*/ {0x159, 6969}, - /*II_66_0F_ED*/ {0x13b, 6969}, - /*II_0F_EE*/ {0x18f, 6986}, - /*II_66_0F_EE*/ {0x13b, 6986}, - /*II_0F_EF*/ {0x159, 7003}, - /*II_66_0F_EF*/ {0x13b, 7003}, - /*II_F2_0F_F0*/ {0x191, 7016}, - /*II_0F_F1*/ {0x159, 7031}, - /*II_66_0F_F1*/ {0x13b, 7031}, - /*II_0F_F2*/ {0x159, 7046}, - /*II_66_0F_F2*/ {0x13b, 7046}, - /*II_0F_F3*/ {0x159, 7061}, - /*II_66_0F_F3*/ {0x13b, 7061}, - /*II_0F_F4*/ {0x193, 7076}, - /*II_66_0F_F4*/ {0x13b, 7076}, - /*II_0F_F5*/ {0x159, 7095}, - /*II_66_0F_F5*/ {0x13b, 7095}, - /*II_0F_F6*/ {0x18f, 7114}, - /*II_66_0F_F6*/ {0x13b, 7114}, - /*II_0F_F7*/ {0x194, 7131}, - /*II_66_0F_F7*/ {0x195, 7141}, - /*II_0F_F8*/ {0x159, 7166}, - /*II_66_0F_F8*/ {0x13b, 7166}, - /*II_0F_F9*/ {0x159, 7181}, - /*II_66_0F_F9*/ {0x13b, 7181}, - /*II_0F_FA*/ {0x159, 7196}, - /*II_66_0F_FA*/ {0x13b, 7196}, - /*II_0F_FB*/ {0x193, 7211}, - /*II_66_0F_FB*/ {0x13b, 7211}, - /*II_0F_FC*/ {0x159, 7226}, - /*II_66_0F_FC*/ {0x13b, 7226}, - /*II_0F_FD*/ {0x159, 7241}, - /*II_66_0F_FD*/ {0x13b, 7241}, - /*II_0F_FE*/ {0x159, 7256}, - /*II_66_0F_FE*/ {0x13b, 7256}, - /*II_D9_06*/ {0x197, 7271}, - /*II_9B_D9_06*/ {0x198, 7280}, - /*II_D9_07*/ {0xfd, 7288}, - /*II_9B_D9_07*/ {0x199, 7296}, - /*II_DB_E2*/ {0xeb, 7303}, - /*II_9B_DB_E2*/ {0x19a, 7311}, - /*II_DB_E3*/ {0xeb, 7318}, - /*II_9B_DB_E3*/ {0x19a, 7326}, - /*II_DD_06*/ {0x197, 7333}, - /*II_9B_DD_06*/ {0x198, 7341}, - /*II_DD_07*/ {0xfd, 7348}, - /*II_9B_DD_07*/ {0x199, 7356}, - /*II_DF_E0*/ {0x19b, 7348}, - /*II_9B_DF_E0*/ {0x19c, 7356}, - /*II_0F_38_00*/ {0x19d, 7363}, - /*II_66_0F_38_00*/ {0x19e, 7363}, - /*II_0F_38_01*/ {0x19d, 7380}, - /*II_66_0F_38_01*/ {0x19e, 7380}, - /*II_0F_38_02*/ {0x19d, 7397}, - /*II_66_0F_38_02*/ {0x19e, 7397}, - /*II_0F_38_03*/ {0x19d, 7414}, - /*II_66_0F_38_03*/ {0x19e, 7414}, - /*II_0F_38_04*/ {0x19d, 7433}, - /*II_66_0F_38_04*/ {0x19e, 7433}, - /*II_0F_38_05*/ {0x19d, 7456}, - /*II_66_0F_38_05*/ {0x19e, 7456}, - /*II_0F_38_06*/ {0x19d, 7473}, - /*II_66_0F_38_06*/ {0x19e, 7473}, - /*II_0F_38_07*/ {0x19d, 7490}, - /*II_66_0F_38_07*/ {0x19e, 7490}, - /*II_0F_38_08*/ {0x19d, 7509}, - /*II_66_0F_38_08*/ {0x19e, 7509}, - /*II_0F_38_09*/ {0x19d, 7526}, - /*II_66_0F_38_09*/ {0x19e, 7526}, - /*II_0F_38_0A*/ {0x19d, 7543}, - /*II_66_0F_38_0A*/ {0x19e, 7543}, - /*II_0F_38_0B*/ {0x19d, 7560}, - /*II_66_0F_38_0B*/ {0x19e, 7560}, - /*II_66_0F_38_17*/ {0x1a0, 7651}, - /*II_0F_38_1C*/ {0x19d, 7710}, - /*II_66_0F_38_1C*/ {0x19e, 7710}, - /*II_0F_38_1D*/ {0x19d, 7725}, - /*II_66_0F_38_1D*/ {0x19e, 7725}, - /*II_0F_38_1E*/ {0x19d, 7740}, - /*II_66_0F_38_1E*/ {0x19e, 7740}, - /*II_66_0F_38_20*/ {0x1a5, 7755}, - /*II_66_0F_38_21*/ {0x1a6, 7776}, - /*II_66_0F_38_22*/ {0x1a7, 7797}, - /*II_66_0F_38_23*/ {0x1a5, 7818}, - /*II_66_0F_38_24*/ {0x1a6, 7839}, - /*II_66_0F_38_25*/ {0x1a5, 7860}, - /*II_66_0F_38_28*/ {0x1a9, 7881}, - /*II_66_0F_38_29*/ {0x1a9, 7898}, - /*II_66_0F_38_2A*/ {0x1aa, 7917}, - /*II_66_0F_38_2B*/ {0x1a9, 7938}, - /*II_66_0F_38_30*/ {0x1a5, 7983}, - /*II_66_0F_38_31*/ {0x1a6, 8004}, - /*II_66_0F_38_32*/ {0x1a7, 8025}, - /*II_66_0F_38_33*/ {0x1a5, 8046}, - /*II_66_0F_38_34*/ {0x1a6, 8067}, - /*II_66_0F_38_35*/ {0x1a5, 8088}, - /*II_66_0F_38_37*/ {0x1a0, 8109}, - /*II_66_0F_38_38*/ {0x1a9, 8128}, - /*II_66_0F_38_39*/ {0x1a9, 8145}, - /*II_66_0F_38_3A*/ {0x1a9, 8162}, - /*II_66_0F_38_3B*/ {0x1a9, 8179}, - /*II_66_0F_38_3C*/ {0x1a9, 8196}, - /*II_66_0F_38_3D*/ {0x1a9, 8213}, - /*II_66_0F_38_3E*/ {0x1a9, 8230}, - /*II_66_0F_38_3F*/ {0x1a9, 8247}, - /*II_66_0F_38_40*/ {0x1a9, 8264}, - /*II_66_0F_38_41*/ {0x1a9, 8281}, - /*II_66_0F_38_80*/ {0x1ad, 8306}, - /*II_66_0F_38_81*/ {0x1ad, 8314}, - /*II_66_0F_38_82*/ {0x1ad, 8323}, - /*II_66_0F_38_DB*/ {0x1b0, 9172}, - /*II_66_0F_38_DC*/ {0x1b0, 9189}, - /*II_66_0F_38_DD*/ {0x1b0, 9206}, - /*II_66_0F_38_DE*/ {0x1b0, 9231}, - /*II_66_0F_38_DF*/ {0x1b0, 9248}, - /*II_0F_38_F0*/ {0x1b3, 9273}, - /*II_F2_0F_38_F0*/ {0x1b4, 9280}, - /*II_0F_38_F1*/ {0x1b5, 9273}, - /*II_F2_0F_38_F1*/ {0x1b6, 9280}, - /*II_0F_71_02*/ {0x1cd, 6458}, - /*II_66_0F_71_02*/ {0x1ce, 6458}, - /*II_0F_71_04*/ {0x1cd, 6717}, - /*II_66_0F_71_04*/ {0x1ce, 6717}, - /*II_0F_71_06*/ {0x1cd, 7031}, - /*II_66_0F_71_06*/ {0x1ce, 7031}, - /*II_0F_72_02*/ {0x1cd, 6473}, - /*II_66_0F_72_02*/ {0x1ce, 6473}, - /*II_0F_72_04*/ {0x1cd, 6732}, - /*II_66_0F_72_04*/ {0x1ce, 6732}, - /*II_0F_72_06*/ {0x1cd, 7046}, - /*II_66_0F_72_06*/ {0x1ce, 7046}, - /*II_0F_73_02*/ {0x1cd, 6488}, - /*II_66_0F_73_02*/ {0x1ce, 6488}, - /*II_66_0F_73_03*/ {0x1ce, 9852}, - /*II_0F_73_06*/ {0x1cd, 7061}, - /*II_66_0F_73_06*/ {0x1ce, 7061}, - /*II_66_0F_73_07*/ {0x1ce, 9869}, - /*II_F3_0F_AE_00*/ {0x1d0, 9904}, - /*II_F3_0F_AE_01*/ {0x1d0, 9934}, - /*II_0F_AE_02*/ {0x1d1, 9944}, - /*II_F3_0F_AE_02*/ {0x1d0, 9953}, - /*II_0F_AE_03*/ {0x1d1, 9973}, - /*II_F3_0F_AE_03*/ {0x1d0, 9982}, - /*II_0F_C7_06*/ {0x1d3, 10002}, - /*II_66_0F_C7_06*/ {0x188, 10011}, - /*II_F3_0F_C7_06*/ {0x188, 10020} + /*II_F4*/ {0x83, 482}, + /*II_F5*/ {0x84, 487}, + /*II_F8*/ {0x84, 492}, + /*II_F9*/ {0x84, 497}, + /*II_FA*/ {0x85, 502}, + /*II_FB*/ {0x85, 507}, + /*II_FC*/ {0x86, 512}, + /*II_FD*/ {0x86, 517}, + /*II_0F_02*/ {0x87, 522}, + /*II_0F_03*/ {0x87, 527}, + /*II_0F_05*/ {0x88, 532}, + /*II_0F_06*/ {0x89, 541}, + /*II_0F_07*/ {0x88, 547}, + /*II_0F_08*/ {0x89, 555}, + /*II_0F_09*/ {0x89, 561}, + /*II_0F_0B*/ {0x8a, 569}, + /*II_0F_0E*/ {0x8b, 574}, + /*II_0F_1F*/ {0x8c, 581}, + /*II_0F_20*/ {0x8d, 218}, + /*II_0F_21*/ {0x8e, 218}, + /*II_0F_22*/ {0x8f, 218}, + /*II_0F_23*/ {0x90, 218}, + /*II_0F_30*/ {0x89, 586}, + /*II_0F_31*/ {0x89, 593}, + /*II_0F_32*/ {0x89, 600}, + /*II_0F_33*/ {0x89, 607}, + /*II_0F_34*/ {0x88, 614}, + /*II_0F_35*/ {0x88, 624}, + /*II_0F_37*/ {0x91, 633}, + /*II_0F_40*/ {0x92, 641}, + /*II_0F_41*/ {0x92, 648}, + /*II_0F_42*/ {0x93, 656}, + /*II_0F_43*/ {0x93, 663}, + /*II_0F_44*/ {0x94, 671}, + /*II_0F_45*/ {0x94, 678}, + /*II_0F_46*/ {0x95, 686}, + /*II_0F_47*/ {0x95, 694}, + /*II_0F_48*/ {0x96, 701}, + /*II_0F_49*/ {0x96, 708}, + /*II_0F_4A*/ {0x97, 716}, + /*II_0F_4B*/ {0x97, 723}, + /*II_0F_4C*/ {0x98, 731}, + /*II_0F_4D*/ {0x98, 738}, + /*II_0F_4E*/ {0x99, 746}, + /*II_0F_4F*/ {0x99, 754}, + /*II_0F_80*/ {0x9a, 134}, + /*II_0F_81*/ {0x9a, 138}, + /*II_0F_82*/ {0x9b, 143}, + /*II_0F_83*/ {0x9b, 147}, + /*II_0F_84*/ {0x9c, 152}, + /*II_0F_85*/ {0x9c, 156}, + /*II_0F_86*/ {0x9d, 161}, + /*II_0F_87*/ {0x9d, 166}, + /*II_0F_88*/ {0x9e, 170}, + /*II_0F_89*/ {0x9e, 174}, + /*II_0F_8A*/ {0x9f, 179}, + /*II_0F_8B*/ {0x9f, 183}, + /*II_0F_8C*/ {0xa0, 188}, + /*II_0F_8D*/ {0xa0, 192}, + /*II_0F_8E*/ {0xa1, 197}, + /*II_0F_8F*/ {0xa1, 202}, + /*II_0F_90*/ {0xa2, 761}, + /*II_0F_91*/ {0xa2, 767}, + /*II_0F_92*/ {0xa3, 774}, + /*II_0F_93*/ {0xa3, 780}, + /*II_0F_94*/ {0xa4, 787}, + /*II_0F_95*/ {0xa4, 793}, + /*II_0F_96*/ {0xa5, 800}, + /*II_0F_97*/ {0xa5, 807}, + /*II_0F_98*/ {0xa6, 813}, + /*II_0F_99*/ {0xa6, 819}, + /*II_0F_9A*/ {0xa7, 826}, + /*II_0F_9B*/ {0xa7, 832}, + /*II_0F_9C*/ {0xa8, 839}, + /*II_0F_9D*/ {0xa8, 845}, + /*II_0F_9E*/ {0xa9, 852}, + /*II_0F_9F*/ {0xa9, 859}, + /*II_0F_A0*/ {0xaa, 16}, + /*II_0F_A1*/ {0xab, 22}, + /*II_0F_A2*/ {0x91, 865}, + /*II_0F_A3*/ {0xac, 872}, + /*II_0F_A8*/ {0xae, 16}, + /*II_0F_A9*/ {0xaf, 22}, + /*II_0F_AA*/ {0xb0, 882}, + /*II_0F_AB*/ {0xb1, 887}, + /*II_0F_AF*/ {0xb2, 117}, + /*II_0F_B0*/ {0xb3, 898}, + /*II_0F_B1*/ {0xb4, 898}, + /*II_0F_B2*/ {0xb5, 907}, + /*II_0F_B3*/ {0xb1, 912}, + /*II_0F_B4*/ {0xb5, 917}, + /*II_0F_B5*/ {0xb5, 922}, + /*II_0F_B6*/ {0xb6, 927}, + /*II_0F_B7*/ {0xb7, 927}, + /*II_0F_B9*/ {0x8a, 569}, + /*II_0F_BB*/ {0xb1, 934}, + /*II_0F_BE*/ {0xb6, 939}, + /*II_0F_BF*/ {0xb7, 939}, + /*II_0F_C0*/ {0xb3, 946}, + /*II_0F_C1*/ {0xb4, 946}, + /*II_0F_C3*/ {0xb8, 952}, + /*II_0F_C8*/ {0xb9, 960}, + /*II_0F_C8*/ {0xb9, 960}, + /*II_0F_C8*/ {0xb9, 960}, + /*II_0F_C8*/ {0xb9, 960}, + /*II_0F_C8*/ {0xb9, 960}, + /*II_0F_C8*/ {0xb9, 960}, + /*II_0F_C8*/ {0xb9, 960}, + /*II_0F_C8*/ {0xb9, 960}, + /*II_80_00*/ {0xba, 11}, + /*II_80_01*/ {0xbb, 27}, + /*II_80_02*/ {0xbc, 31}, + /*II_80_03*/ {0xbc, 36}, + /*II_80_04*/ {0xbd, 41}, + /*II_80_05*/ {0xba, 51}, + /*II_80_06*/ {0xbe, 61}, + /*II_80_07*/ {0xbf, 71}, + /*II_81_00*/ {0xc0, 11}, + /*II_81_01*/ {0xc1, 27}, + /*II_81_02*/ {0xc2, 31}, + /*II_81_03*/ {0xc2, 36}, + /*II_81_04*/ {0xc3, 41}, + /*II_81_05*/ {0xc0, 51}, + /*II_81_06*/ {0xc4, 61}, + /*II_81_07*/ {0xc5, 71}, + /*II_82_00*/ {0xc6, 11}, + /*II_82_01*/ {0xc7, 27}, + /*II_82_02*/ {0xc8, 31}, + /*II_82_03*/ {0xc8, 36}, + /*II_82_04*/ {0xc9, 41}, + /*II_82_05*/ {0xc6, 51}, + /*II_82_06*/ {0xca, 61}, + /*II_82_07*/ {0xcb, 71}, + /*II_83_00*/ {0xcc, 11}, + /*II_83_01*/ {0xcd, 27}, + /*II_83_02*/ {0xce, 31}, + /*II_83_03*/ {0xce, 36}, + /*II_83_04*/ {0xcf, 41}, + /*II_83_05*/ {0xcc, 51}, + /*II_83_06*/ {0xd0, 61}, + /*II_83_07*/ {0xd1, 71}, + /*II_8F_00*/ {0xd2, 22}, + /*II_C0_00*/ {0xd3, 967}, + /*II_C0_01*/ {0xd3, 972}, + /*II_C0_02*/ {0xd4, 977}, + /*II_C0_03*/ {0xd4, 982}, + /*II_C0_04*/ {0xd5, 987}, + /*II_C0_05*/ {0xd5, 992}, + /*II_C0_06*/ {0xd5, 997}, + /*II_C0_07*/ {0xd5, 1002}, + /*II_C1_00*/ {0xd6, 967}, + /*II_C1_01*/ {0xd6, 972}, + /*II_C1_02*/ {0xd7, 977}, + /*II_C1_03*/ {0xd7, 982}, + /*II_C1_04*/ {0xd8, 987}, + /*II_C1_05*/ {0xd8, 992}, + /*II_C1_06*/ {0xd8, 997}, + /*II_C1_07*/ {0xd8, 1002}, + /*II_C6_00*/ {0xd9, 218}, + /*II_C6_F8*/ {0xda, 1007}, + /*II_C7_00*/ {0xdb, 218}, + /*II_C7_F8*/ {0xdc, 1015}, + /*II_D0_00*/ {0xdd, 967}, + /*II_D0_01*/ {0xdd, 972}, + /*II_D0_02*/ {0xde, 977}, + /*II_D0_03*/ {0xde, 982}, + /*II_D0_04*/ {0xdf, 987}, + /*II_D0_05*/ {0xdf, 992}, + /*II_D0_06*/ {0xdf, 997}, + /*II_D0_07*/ {0xdf, 1002}, + /*II_D1_00*/ {0xe0, 967}, + /*II_D1_01*/ {0xe0, 972}, + /*II_D1_02*/ {0xe1, 977}, + /*II_D1_03*/ {0xe1, 982}, + /*II_D1_04*/ {0xe2, 987}, + /*II_D1_05*/ {0xe2, 992}, + /*II_D1_06*/ {0xe2, 997}, + /*II_D1_07*/ {0xe2, 1002}, + /*II_D2_00*/ {0xe3, 967}, + /*II_D2_01*/ {0xe3, 972}, + /*II_D2_02*/ {0xe4, 977}, + /*II_D2_03*/ {0xe4, 982}, + /*II_D2_04*/ {0xe5, 987}, + /*II_D2_05*/ {0xe5, 992}, + /*II_D2_06*/ {0xe5, 997}, + /*II_D2_07*/ {0xe5, 1002}, + /*II_D3_00*/ {0xe6, 967}, + /*II_D3_01*/ {0xe6, 972}, + /*II_D3_02*/ {0xe7, 977}, + /*II_D3_03*/ {0xe7, 982}, + /*II_D3_04*/ {0xe8, 987}, + /*II_D3_05*/ {0xe8, 992}, + /*II_D3_06*/ {0xe8, 997}, + /*II_D3_07*/ {0xe8, 1002}, + /*II_D8_00*/ {0xe9, 1023}, + /*II_D8_01*/ {0xe9, 1029}, + /*II_D8_02*/ {0xe9, 1035}, + /*II_D8_03*/ {0xe9, 1041}, + /*II_D8_04*/ {0xe9, 1048}, + /*II_D8_05*/ {0xe9, 1054}, + /*II_D8_06*/ {0xe9, 1061}, + /*II_D8_07*/ {0xe9, 1067}, + /*II_D8_C0*/ {0xea, 1023}, + /*II_D8_C0*/ {0xea, 1023}, + /*II_D8_C0*/ {0xea, 1023}, + /*II_D8_C0*/ {0xea, 1023}, + /*II_D8_C0*/ {0xea, 1023}, + /*II_D8_C0*/ {0xea, 1023}, + /*II_D8_C0*/ {0xea, 1023}, + /*II_D8_C0*/ {0xea, 1023}, + /*II_D8_C8*/ {0xea, 1029}, + /*II_D8_C8*/ {0xea, 1029}, + /*II_D8_C8*/ {0xea, 1029}, + /*II_D8_C8*/ {0xea, 1029}, + /*II_D8_C8*/ {0xea, 1029}, + /*II_D8_C8*/ {0xea, 1029}, + /*II_D8_C8*/ {0xea, 1029}, + /*II_D8_C8*/ {0xea, 1029}, + /*II_D8_D0*/ {0xeb, 1035}, + /*II_D8_D0*/ {0xeb, 1035}, + /*II_D8_D0*/ {0xeb, 1035}, + /*II_D8_D0*/ {0xeb, 1035}, + /*II_D8_D0*/ {0xeb, 1035}, + /*II_D8_D0*/ {0xeb, 1035}, + /*II_D8_D0*/ {0xeb, 1035}, + /*II_D8_D0*/ {0xeb, 1035}, + /*II_D8_D8*/ {0xeb, 1041}, + /*II_D8_D9*/ {0xec, 1041}, + /*II_D8_D8*/ {0xeb, 1041}, + /*II_D8_D8*/ {0xeb, 1041}, + /*II_D8_D8*/ {0xeb, 1041}, + /*II_D8_D8*/ {0xeb, 1041}, + /*II_D8_D8*/ {0xeb, 1041}, + /*II_D8_D8*/ {0xeb, 1041}, + /*II_D8_E0*/ {0xea, 1048}, + /*II_D8_E0*/ {0xea, 1048}, + /*II_D8_E0*/ {0xea, 1048}, + /*II_D8_E0*/ {0xea, 1048}, + /*II_D8_E0*/ {0xea, 1048}, + /*II_D8_E0*/ {0xea, 1048}, + /*II_D8_E0*/ {0xea, 1048}, + /*II_D8_E0*/ {0xea, 1048}, + /*II_D8_E8*/ {0xea, 1054}, + /*II_D8_E8*/ {0xea, 1054}, + /*II_D8_E8*/ {0xea, 1054}, + /*II_D8_E8*/ {0xea, 1054}, + /*II_D8_E8*/ {0xea, 1054}, + /*II_D8_E8*/ {0xea, 1054}, + /*II_D8_E8*/ {0xea, 1054}, + /*II_D8_E8*/ {0xea, 1054}, + /*II_D8_F0*/ {0xea, 1061}, + /*II_D8_F0*/ {0xea, 1061}, + /*II_D8_F0*/ {0xea, 1061}, + /*II_D8_F0*/ {0xea, 1061}, + /*II_D8_F0*/ {0xea, 1061}, + /*II_D8_F0*/ {0xea, 1061}, + /*II_D8_F0*/ {0xea, 1061}, + /*II_D8_F0*/ {0xea, 1061}, + /*II_D8_F8*/ {0xea, 1067}, + /*II_D8_F8*/ {0xea, 1067}, + /*II_D8_F8*/ {0xea, 1067}, + /*II_D8_F8*/ {0xea, 1067}, + /*II_D8_F8*/ {0xea, 1067}, + /*II_D8_F8*/ {0xea, 1067}, + /*II_D8_F8*/ {0xea, 1067}, + /*II_D8_F8*/ {0xea, 1067}, + /*II_D9_00*/ {0xe9, 1074}, + /*II_D9_02*/ {0xed, 1079}, + /*II_D9_03*/ {0xed, 1084}, + /*II_D9_04*/ {0xee, 1090}, + /*II_D9_05*/ {0xef, 1098}, + /*II_D9_C0*/ {0xeb, 1074}, + /*II_D9_C0*/ {0xeb, 1074}, + /*II_D9_C0*/ {0xeb, 1074}, + /*II_D9_C0*/ {0xeb, 1074}, + /*II_D9_C0*/ {0xeb, 1074}, + /*II_D9_C0*/ {0xeb, 1074}, + /*II_D9_C0*/ {0xeb, 1074}, + /*II_D9_C0*/ {0xeb, 1074}, + /*II_D9_C8*/ {0xeb, 1105}, + /*II_D9_C9*/ {0xec, 1105}, + /*II_D9_C8*/ {0xeb, 1105}, + /*II_D9_C8*/ {0xeb, 1105}, + /*II_D9_C8*/ {0xeb, 1105}, + /*II_D9_C8*/ {0xeb, 1105}, + /*II_D9_C8*/ {0xeb, 1105}, + /*II_D9_C8*/ {0xeb, 1105}, + /*II_D9_D0*/ {0xec, 1111}, + /*II_D9_E0*/ {0xec, 1117}, + /*II_D9_E1*/ {0xec, 1123}, + /*II_D9_E4*/ {0xec, 1129}, + /*II_D9_E5*/ {0xec, 1135}, + /*II_D9_E8*/ {0xec, 1141}, + /*II_D9_E9*/ {0xec, 1147}, + /*II_D9_EA*/ {0xec, 1155}, + /*II_D9_EB*/ {0xec, 1163}, + /*II_D9_EC*/ {0xec, 1170}, + /*II_D9_ED*/ {0xec, 1178}, + /*II_D9_EE*/ {0xec, 1186}, + /*II_D9_F0*/ {0xec, 1192}, + /*II_D9_F1*/ {0xec, 1199}, + /*II_D9_F2*/ {0xec, 1206}, + /*II_D9_F3*/ {0xec, 1213}, + /*II_D9_F4*/ {0xec, 1221}, + /*II_D9_F5*/ {0xec, 1230}, + /*II_D9_F6*/ {0xec, 1238}, + /*II_D9_F7*/ {0xec, 1247}, + /*II_D9_F8*/ {0xec, 1256}, + /*II_D9_F9*/ {0xec, 1263}, + /*II_D9_FA*/ {0xec, 1272}, + /*II_D9_FB*/ {0xec, 1279}, + /*II_D9_FC*/ {0xec, 1288}, + /*II_D9_FD*/ {0xec, 1297}, + /*II_D9_FE*/ {0xec, 1305}, + /*II_D9_FF*/ {0xec, 1311}, + /*II_DA_00*/ {0xe9, 1317}, + /*II_DA_01*/ {0xe9, 1324}, + /*II_DA_02*/ {0xe9, 1331}, + /*II_DA_03*/ {0xe9, 1338}, + /*II_DA_04*/ {0xe9, 1346}, + /*II_DA_05*/ {0xe9, 1353}, + /*II_DA_06*/ {0xe9, 1361}, + /*II_DA_07*/ {0xe9, 1368}, + /*II_DA_C0*/ {0xf0, 1376}, + /*II_DA_C0*/ {0xf0, 1376}, + /*II_DA_C0*/ {0xf0, 1376}, + /*II_DA_C0*/ {0xf0, 1376}, + /*II_DA_C0*/ {0xf0, 1376}, + /*II_DA_C0*/ {0xf0, 1376}, + /*II_DA_C0*/ {0xf0, 1376}, + /*II_DA_C0*/ {0xf0, 1376}, + /*II_DA_C8*/ {0xf1, 1384}, + /*II_DA_C8*/ {0xf1, 1384}, + /*II_DA_C8*/ {0xf1, 1384}, + /*II_DA_C8*/ {0xf1, 1384}, + /*II_DA_C8*/ {0xf1, 1384}, + /*II_DA_C8*/ {0xf1, 1384}, + /*II_DA_C8*/ {0xf1, 1384}, + /*II_DA_C8*/ {0xf1, 1384}, + /*II_DA_D0*/ {0xf2, 1392}, + /*II_DA_D0*/ {0xf2, 1392}, + /*II_DA_D0*/ {0xf2, 1392}, + /*II_DA_D0*/ {0xf2, 1392}, + /*II_DA_D0*/ {0xf2, 1392}, + /*II_DA_D0*/ {0xf2, 1392}, + /*II_DA_D0*/ {0xf2, 1392}, + /*II_DA_D0*/ {0xf2, 1392}, + /*II_DA_D8*/ {0xf3, 1401}, + /*II_DA_D8*/ {0xf3, 1401}, + /*II_DA_D8*/ {0xf3, 1401}, + /*II_DA_D8*/ {0xf3, 1401}, + /*II_DA_D8*/ {0xf3, 1401}, + /*II_DA_D8*/ {0xf3, 1401}, + /*II_DA_D8*/ {0xf3, 1401}, + /*II_DA_D8*/ {0xf3, 1401}, + /*II_DA_E9*/ {0xec, 1409}, + /*II_DB_00*/ {0xe9, 1418}, + /*II_DB_01*/ {0xf4, 1424}, + /*II_DB_02*/ {0xed, 1432}, + /*II_DB_03*/ {0xed, 1438}, + /*II_DB_05*/ {0xf5, 1074}, + /*II_DB_07*/ {0xf6, 1084}, + /*II_DB_C0*/ {0xf0, 1445}, + /*II_DB_C0*/ {0xf0, 1445}, + /*II_DB_C0*/ {0xf0, 1445}, + /*II_DB_C0*/ {0xf0, 1445}, + /*II_DB_C0*/ {0xf0, 1445}, + /*II_DB_C0*/ {0xf0, 1445}, + /*II_DB_C0*/ {0xf0, 1445}, + /*II_DB_C0*/ {0xf0, 1445}, + /*II_DB_C8*/ {0xf1, 1454}, + /*II_DB_C8*/ {0xf1, 1454}, + /*II_DB_C8*/ {0xf1, 1454}, + /*II_DB_C8*/ {0xf1, 1454}, + /*II_DB_C8*/ {0xf1, 1454}, + /*II_DB_C8*/ {0xf1, 1454}, + /*II_DB_C8*/ {0xf1, 1454}, + /*II_DB_C8*/ {0xf1, 1454}, + /*II_DB_D0*/ {0xf2, 1463}, + /*II_DB_D0*/ {0xf2, 1463}, + /*II_DB_D0*/ {0xf2, 1463}, + /*II_DB_D0*/ {0xf2, 1463}, + /*II_DB_D0*/ {0xf2, 1463}, + /*II_DB_D0*/ {0xf2, 1463}, + /*II_DB_D0*/ {0xf2, 1463}, + /*II_DB_D0*/ {0xf2, 1463}, + /*II_DB_D8*/ {0xf3, 1473}, + /*II_DB_D8*/ {0xf3, 1473}, + /*II_DB_D8*/ {0xf3, 1473}, + /*II_DB_D8*/ {0xf3, 1473}, + /*II_DB_D8*/ {0xf3, 1473}, + /*II_DB_D8*/ {0xf3, 1473}, + /*II_DB_D8*/ {0xf3, 1473}, + /*II_DB_D8*/ {0xf3, 1473}, + /*II_DB_E0*/ {0xec, 1482}, + /*II_DB_E1*/ {0xec, 1488}, + /*II_DB_E4*/ {0xec, 1496}, + /*II_DB_E8*/ {0xf7, 1504}, + /*II_DB_E8*/ {0xf7, 1504}, + /*II_DB_E8*/ {0xf7, 1504}, + /*II_DB_E8*/ {0xf7, 1504}, + /*II_DB_E8*/ {0xf7, 1504}, + /*II_DB_E8*/ {0xf7, 1504}, + /*II_DB_E8*/ {0xf7, 1504}, + /*II_DB_E8*/ {0xf7, 1504}, + /*II_DB_F0*/ {0xf8, 1512}, + /*II_DB_F0*/ {0xf8, 1512}, + /*II_DB_F0*/ {0xf8, 1512}, + /*II_DB_F0*/ {0xf8, 1512}, + /*II_DB_F0*/ {0xf8, 1512}, + /*II_DB_F0*/ {0xf8, 1512}, + /*II_DB_F0*/ {0xf8, 1512}, + /*II_DB_F0*/ {0xf8, 1512}, + /*II_DC_00*/ {0xf9, 1023}, + /*II_DC_01*/ {0xf9, 1029}, + /*II_DC_02*/ {0xf9, 1035}, + /*II_DC_03*/ {0xf9, 1041}, + /*II_DC_04*/ {0xf9, 1048}, + /*II_DC_05*/ {0xf9, 1054}, + /*II_DC_06*/ {0xf9, 1061}, + /*II_DC_07*/ {0xf9, 1067}, + /*II_DC_C0*/ {0xfa, 1023}, + /*II_DC_C0*/ {0xfa, 1023}, + /*II_DC_C0*/ {0xfa, 1023}, + /*II_DC_C0*/ {0xfa, 1023}, + /*II_DC_C0*/ {0xfa, 1023}, + /*II_DC_C0*/ {0xfa, 1023}, + /*II_DC_C0*/ {0xfa, 1023}, + /*II_DC_C0*/ {0xfa, 1023}, + /*II_DC_C8*/ {0xfa, 1029}, + /*II_DC_C8*/ {0xfa, 1029}, + /*II_DC_C8*/ {0xfa, 1029}, + /*II_DC_C8*/ {0xfa, 1029}, + /*II_DC_C8*/ {0xfa, 1029}, + /*II_DC_C8*/ {0xfa, 1029}, + /*II_DC_C8*/ {0xfa, 1029}, + /*II_DC_C8*/ {0xfa, 1029}, + /*II_DC_E0*/ {0xfa, 1054}, + /*II_DC_E0*/ {0xfa, 1054}, + /*II_DC_E0*/ {0xfa, 1054}, + /*II_DC_E0*/ {0xfa, 1054}, + /*II_DC_E0*/ {0xfa, 1054}, + /*II_DC_E0*/ {0xfa, 1054}, + /*II_DC_E0*/ {0xfa, 1054}, + /*II_DC_E0*/ {0xfa, 1054}, + /*II_DC_E8*/ {0xfa, 1048}, + /*II_DC_E8*/ {0xfa, 1048}, + /*II_DC_E8*/ {0xfa, 1048}, + /*II_DC_E8*/ {0xfa, 1048}, + /*II_DC_E8*/ {0xfa, 1048}, + /*II_DC_E8*/ {0xfa, 1048}, + /*II_DC_E8*/ {0xfa, 1048}, + /*II_DC_E8*/ {0xfa, 1048}, + /*II_DC_F0*/ {0xfa, 1067}, + /*II_DC_F0*/ {0xfa, 1067}, + /*II_DC_F0*/ {0xfa, 1067}, + /*II_DC_F0*/ {0xfa, 1067}, + /*II_DC_F0*/ {0xfa, 1067}, + /*II_DC_F0*/ {0xfa, 1067}, + /*II_DC_F0*/ {0xfa, 1067}, + /*II_DC_F0*/ {0xfa, 1067}, + /*II_DC_F8*/ {0xfa, 1061}, + /*II_DC_F8*/ {0xfa, 1061}, + /*II_DC_F8*/ {0xfa, 1061}, + /*II_DC_F8*/ {0xfa, 1061}, + /*II_DC_F8*/ {0xfa, 1061}, + /*II_DC_F8*/ {0xfa, 1061}, + /*II_DC_F8*/ {0xfa, 1061}, + /*II_DC_F8*/ {0xfa, 1061}, + /*II_DD_00*/ {0xf9, 1074}, + /*II_DD_01*/ {0xfb, 1424}, + /*II_DD_02*/ {0xfc, 1079}, + /*II_DD_03*/ {0xfc, 1084}, + /*II_DD_04*/ {0xee, 1519}, + /*II_DD_C0*/ {0xeb, 1527}, + /*II_DD_C0*/ {0xeb, 1527}, + /*II_DD_C0*/ {0xeb, 1527}, + /*II_DD_C0*/ {0xeb, 1527}, + /*II_DD_C0*/ {0xeb, 1527}, + /*II_DD_C0*/ {0xeb, 1527}, + /*II_DD_C0*/ {0xeb, 1527}, + /*II_DD_C0*/ {0xeb, 1527}, + /*II_DD_D0*/ {0xeb, 1079}, + /*II_DD_D0*/ {0xeb, 1079}, + /*II_DD_D0*/ {0xeb, 1079}, + /*II_DD_D0*/ {0xeb, 1079}, + /*II_DD_D0*/ {0xeb, 1079}, + /*II_DD_D0*/ {0xeb, 1079}, + /*II_DD_D0*/ {0xeb, 1079}, + /*II_DD_D0*/ {0xeb, 1079}, + /*II_DD_D8*/ {0xeb, 1084}, + /*II_DD_D8*/ {0xeb, 1084}, + /*II_DD_D8*/ {0xeb, 1084}, + /*II_DD_D8*/ {0xeb, 1084}, + /*II_DD_D8*/ {0xeb, 1084}, + /*II_DD_D8*/ {0xeb, 1084}, + /*II_DD_D8*/ {0xeb, 1084}, + /*II_DD_D8*/ {0xeb, 1084}, + /*II_DD_E0*/ {0xfa, 1534}, + /*II_DD_E1*/ {0xec, 1534}, + /*II_DD_E0*/ {0xfa, 1534}, + /*II_DD_E0*/ {0xfa, 1534}, + /*II_DD_E0*/ {0xfa, 1534}, + /*II_DD_E0*/ {0xfa, 1534}, + /*II_DD_E0*/ {0xfa, 1534}, + /*II_DD_E0*/ {0xfa, 1534}, + /*II_DD_E8*/ {0xeb, 1541}, + /*II_DD_E9*/ {0xec, 1541}, + /*II_DD_E8*/ {0xeb, 1541}, + /*II_DD_E8*/ {0xeb, 1541}, + /*II_DD_E8*/ {0xeb, 1541}, + /*II_DD_E8*/ {0xeb, 1541}, + /*II_DD_E8*/ {0xeb, 1541}, + /*II_DD_E8*/ {0xeb, 1541}, + /*II_DE_00*/ {0xef, 1317}, + /*II_DE_01*/ {0xef, 1324}, + /*II_DE_02*/ {0xef, 1331}, + /*II_DE_03*/ {0xef, 1338}, + /*II_DE_04*/ {0xef, 1346}, + /*II_DE_05*/ {0xef, 1353}, + /*II_DE_06*/ {0xef, 1361}, + /*II_DE_07*/ {0xef, 1368}, + /*II_DE_C0*/ {0xfa, 1549}, + /*II_DE_C1*/ {0xec, 1549}, + /*II_DE_C0*/ {0xfa, 1549}, + /*II_DE_C0*/ {0xfa, 1549}, + /*II_DE_C0*/ {0xfa, 1549}, + /*II_DE_C0*/ {0xfa, 1549}, + /*II_DE_C0*/ {0xfa, 1549}, + /*II_DE_C0*/ {0xfa, 1549}, + /*II_DE_C8*/ {0xfa, 1556}, + /*II_DE_C9*/ {0xec, 1556}, + /*II_DE_C8*/ {0xfa, 1556}, + /*II_DE_C8*/ {0xfa, 1556}, + /*II_DE_C8*/ {0xfa, 1556}, + /*II_DE_C8*/ {0xfa, 1556}, + /*II_DE_C8*/ {0xfa, 1556}, + /*II_DE_C8*/ {0xfa, 1556}, + /*II_DE_D9*/ {0xec, 1563}, + /*II_DE_E0*/ {0xfa, 1571}, + /*II_DE_E1*/ {0xec, 1571}, + /*II_DE_E0*/ {0xfa, 1571}, + /*II_DE_E0*/ {0xfa, 1571}, + /*II_DE_E0*/ {0xfa, 1571}, + /*II_DE_E0*/ {0xfa, 1571}, + /*II_DE_E0*/ {0xfa, 1571}, + /*II_DE_E0*/ {0xfa, 1571}, + /*II_DE_E8*/ {0xfa, 1579}, + /*II_DE_E9*/ {0xec, 1579}, + /*II_DE_E8*/ {0xfa, 1579}, + /*II_DE_E8*/ {0xfa, 1579}, + /*II_DE_E8*/ {0xfa, 1579}, + /*II_DE_E8*/ {0xfa, 1579}, + /*II_DE_E8*/ {0xfa, 1579}, + /*II_DE_E8*/ {0xfa, 1579}, + /*II_DE_F0*/ {0xfa, 1586}, + /*II_DE_F1*/ {0xec, 1586}, + /*II_DE_F0*/ {0xfa, 1586}, + /*II_DE_F0*/ {0xfa, 1586}, + /*II_DE_F0*/ {0xfa, 1586}, + /*II_DE_F0*/ {0xfa, 1586}, + /*II_DE_F0*/ {0xfa, 1586}, + /*II_DE_F0*/ {0xfa, 1586}, + /*II_DE_F8*/ {0xfa, 1594}, + /*II_DE_F9*/ {0xec, 1594}, + /*II_DE_F8*/ {0xfa, 1594}, + /*II_DE_F8*/ {0xfa, 1594}, + /*II_DE_F8*/ {0xfa, 1594}, + /*II_DE_F8*/ {0xfa, 1594}, + /*II_DE_F8*/ {0xfa, 1594}, + /*II_DE_F8*/ {0xfa, 1594}, + /*II_DF_00*/ {0xef, 1418}, + /*II_DF_01*/ {0xfd, 1424}, + /*II_DF_02*/ {0xfe, 1432}, + /*II_DF_03*/ {0xfe, 1438}, + /*II_DF_04*/ {0xf5, 1601}, + /*II_DF_05*/ {0xf9, 1418}, + /*II_DF_06*/ {0xf6, 1607}, + /*II_DF_07*/ {0xfc, 1438}, + /*II_DF_E8*/ {0xf7, 1614}, + /*II_DF_E8*/ {0xf7, 1614}, + /*II_DF_E8*/ {0xf7, 1614}, + /*II_DF_E8*/ {0xf7, 1614}, + /*II_DF_E8*/ {0xf7, 1614}, + /*II_DF_E8*/ {0xf7, 1614}, + /*II_DF_E8*/ {0xf7, 1614}, + /*II_DF_E8*/ {0xf7, 1614}, + /*II_DF_F0*/ {0xf7, 1623}, + /*II_DF_F0*/ {0xf7, 1623}, + /*II_DF_F0*/ {0xf7, 1623}, + /*II_DF_F0*/ {0xf7, 1623}, + /*II_DF_F0*/ {0xf7, 1623}, + /*II_DF_F0*/ {0xf7, 1623}, + /*II_DF_F0*/ {0xf7, 1623}, + /*II_DF_F0*/ {0xf7, 1623}, + /*II_F6_00*/ {0xff, 206}, + /*II_F6_02*/ {0x100, 1631}, + /*II_F6_03*/ {0x101, 1636}, + /*II_F6_04*/ {0x102, 1641}, + /*II_F6_05*/ {0x102, 117}, + /*II_F6_06*/ {0x103, 1646}, + /*II_F6_07*/ {0x103, 1651}, + /*II_F7_00*/ {0x104, 206}, + /*II_F7_02*/ {0x105, 1631}, + /*II_F7_03*/ {0x106, 1636}, + /*II_F7_04*/ {0x107, 1641}, + /*II_F7_05*/ {0x107, 117}, + /*II_F7_06*/ {0x108, 1646}, + /*II_F7_07*/ {0x108, 1651}, + /*II_FE_00*/ {0x109, 81}, + /*II_FE_01*/ {0x109, 86}, + /*II_FF_00*/ {0x10a, 81}, + /*II_FF_01*/ {0x10a, 86}, + /*II_FF_02*/ {0x10b, 456}, + /*II_FF_03*/ {0x10c, 260}, + /*II_FF_04*/ {0x10d, 462}, + /*II_FF_05*/ {0x10e, 467}, + /*II_FF_06*/ {0x10f, 16}, + /*II_0F_00_00*/ {0x110, 1657}, + /*II_0F_00_01*/ {0x111, 1663}, + /*II_0F_00_02*/ {0x112, 1668}, + /*II_0F_00_03*/ {0x113, 1674}, + /*II_0F_00_04*/ {0x114, 1679}, + /*II_0F_00_05*/ {0x114, 1685}, + /*II_0F_01_00*/ {0x115, 1691}, + /*II_0F_01_01*/ {0x115, 1697}, + /*II_0F_01_02*/ {0x116, 1703}, + /*II_0F_01_03*/ {0x116, 1709}, + /*II_0F_01_04*/ {0x117, 1715}, + /*II_0F_01_06*/ {0x118, 1721}, + /*II_0F_01_07*/ {0x119, 1727}, + /*II_0F_01_C1*/ {0x11a, 1735}, + /*II_0F_01_C2*/ {0x11a, 1743}, + /*II_0F_01_C3*/ {0x11a, 1753}, + /*II_0F_01_C4*/ {0x11a, 1763}, + /*II_0F_01_C8*/ {0x11b, 1771}, + /*II_0F_01_C9*/ {0x11b, 1780}, + /*II_0F_01_CA*/ {0x11b, 1787}, + /*II_0F_01_CB*/ {0x11b, 1793}, + /*II_0F_01_D0*/ {0x91, 1799}, + /*II_0F_01_D1*/ {0x91, 1807}, + /*II_0F_01_D4*/ {0x11a, 1815}, + /*II_0F_01_D5*/ {0x11c, 1823}, + /*II_0F_01_D8*/ {0x11d, 1829}, + /*II_0F_01_D9*/ {0x11e, 1836}, + /*II_0F_01_DA*/ {0x11f, 1845}, + /*II_0F_01_DB*/ {0x11f, 1853}, + /*II_0F_01_DC*/ {0x11e, 1861}, + /*II_0F_01_DD*/ {0x11e, 1867}, + /*II_0F_01_DE*/ {0x11f, 1873}, + /*II_0F_01_DF*/ {0x120, 1881}, + /*II_0F_01_F8*/ {0x121, 1890}, + /*II_0F_01_F9*/ {0x121, 1898}, + /*II_0F_0D_00*/ {0x122, 1906}, + /*II_0F_0D_01*/ {0x122, 1916}, + /*II_0F_0F_0C*/ {0x123, 1927}, + /*II_0F_0F_0D*/ {0x124, 1934}, + /*II_0F_0F_1C*/ {0x123, 1941}, + /*II_0F_0F_1D*/ {0x124, 1948}, + /*II_0F_0F_8A*/ {0x123, 1955}, + /*II_0F_0F_8E*/ {0x123, 1963}, + /*II_0F_0F_90*/ {0x124, 1972}, + /*II_0F_0F_94*/ {0x124, 1981}, + /*II_0F_0F_96*/ {0x124, 1988}, + /*II_0F_0F_97*/ {0x124, 1995}, + /*II_0F_0F_9A*/ {0x124, 2004}, + /*II_0F_0F_9E*/ {0x124, 2011}, + /*II_0F_0F_A0*/ {0x124, 2018}, + /*II_0F_0F_A4*/ {0x124, 2027}, + /*II_0F_0F_A6*/ {0x124, 2034}, + /*II_0F_0F_A7*/ {0x124, 2044}, + /*II_0F_0F_AA*/ {0x124, 2054}, + /*II_0F_0F_AE*/ {0x124, 2062}, + /*II_0F_0F_B0*/ {0x124, 2069}, + /*II_0F_0F_B4*/ {0x124, 2078}, + /*II_0F_0F_B6*/ {0x124, 2085}, + /*II_0F_0F_B7*/ {0x124, 2095}, + /*II_0F_0F_BB*/ {0x123, 2104}, + /*II_0F_0F_BF*/ {0x124, 2112}, + /*II_0F_10*/ {0x125, 2121}, + /*II_66_0F_10*/ {0x126, 2129}, + /*II_F3_0F_10*/ {0x127, 2137}, + /*II_F2_0F_10*/ {0x128, 2144}, + /*II_0F_11*/ {0x12d, 2121}, + /*II_66_0F_11*/ {0x12e, 2129}, + /*II_F3_0F_11*/ {0x12f, 2137}, + /*II_F2_0F_11*/ {0x130, 2144}, + /*II_66_0F_12*/ {0x135, 2202}, + /*II_F3_0F_12*/ {0x136, 2210}, + /*II_F2_0F_12*/ {0x136, 2220}, + /*II_0F_13*/ {0x13a, 2194}, + /*II_66_0F_13*/ {0x13b, 2202}, + /*II_0F_14*/ {0x13d, 2278}, + /*II_66_0F_14*/ {0x13e, 2288}, + /*II_0F_15*/ {0x13d, 2320}, + /*II_66_0F_15*/ {0x13e, 2330}, + /*II_66_0F_16*/ {0x135, 2379}, + /*II_F3_0F_16*/ {0x140, 2387}, + /*II_0F_17*/ {0x13a, 2371}, + /*II_66_0F_17*/ {0x13b, 2379}, + /*II_0F_18_00*/ {0x141, 2436}, + /*II_0F_18_01*/ {0x141, 2449}, + /*II_0F_18_02*/ {0x141, 2461}, + /*II_0F_18_03*/ {0x141, 2473}, + /*II_0F_28*/ {0x125, 2485}, + /*II_66_0F_28*/ {0x126, 2493}, + /*II_0F_29*/ {0x12d, 2485}, + /*II_66_0F_29*/ {0x12e, 2493}, + /*II_0F_2A*/ {0x142, 2519}, + /*II_66_0F_2A*/ {0x143, 2529}, + /*II_F3_0F_2A*/ {0x144, 2539}, + /*II_F2_0F_2A*/ {0x145, 2549}, + /*II_0F_2B*/ {0x146, 2581}, + /*II_66_0F_2B*/ {0x147, 2590}, + /*II_F3_0F_2B*/ {0x148, 2599}, + /*II_F2_0F_2B*/ {0x149, 2608}, + /*II_0F_2C*/ {0x14b, 2637}, + /*II_66_0F_2C*/ {0x14c, 2648}, + /*II_F3_0F_2C*/ {0x14d, 2659}, + /*II_F2_0F_2C*/ {0x14e, 2670}, + /*II_0F_2D*/ {0x14b, 2705}, + /*II_66_0F_2D*/ {0x13e, 2715}, + /*II_F3_0F_2D*/ {0x14d, 2725}, + /*II_F2_0F_2D*/ {0x14e, 2735}, + /*II_0F_2E*/ {0x150, 2767}, + /*II_66_0F_2E*/ {0x151, 2776}, + /*II_0F_2F*/ {0x150, 2805}, + /*II_66_0F_2F*/ {0x151, 2813}, + /*II_0F_50*/ {0x154, 2839}, + /*II_66_0F_50*/ {0x155, 2849}, + /*II_0F_51*/ {0x13d, 2881}, + /*II_66_0F_51*/ {0x13e, 2889}, + /*II_F3_0F_51*/ {0x157, 2897}, + /*II_F2_0F_51*/ {0x151, 2905}, + /*II_0F_52*/ {0x13d, 2949}, + /*II_F3_0F_52*/ {0x157, 2958}, + /*II_0F_53*/ {0x13d, 2987}, + /*II_F3_0F_53*/ {0x157, 2994}, + /*II_0F_54*/ {0x13d, 3017}, + /*II_66_0F_54*/ {0x13e, 3024}, + /*II_0F_55*/ {0x13d, 3047}, + /*II_66_0F_55*/ {0x13e, 3055}, + /*II_0F_56*/ {0x13d, 3081}, + /*II_66_0F_56*/ {0x13e, 3087}, + /*II_0F_57*/ {0x13d, 3107}, + /*II_66_0F_57*/ {0x13e, 3114}, + /*II_0F_58*/ {0x13d, 3137}, + /*II_66_0F_58*/ {0x13e, 3144}, + /*II_F3_0F_58*/ {0x157, 3151}, + /*II_F2_0F_58*/ {0x151, 3158}, + /*II_0F_59*/ {0x13d, 3197}, + /*II_66_0F_59*/ {0x13e, 3204}, + /*II_F3_0F_59*/ {0x157, 3211}, + /*II_F2_0F_59*/ {0x151, 3218}, + /*II_0F_5A*/ {0x151, 3257}, + /*II_66_0F_5A*/ {0x13e, 3267}, + /*II_F3_0F_5A*/ {0x158, 3277}, + /*II_F2_0F_5A*/ {0x151, 3287}, + /*II_0F_5B*/ {0x13e, 3341}, + /*II_66_0F_5B*/ {0x13e, 3351}, + /*II_F3_0F_5B*/ {0x13e, 3361}, + /*II_0F_5C*/ {0x13d, 3406}, + /*II_66_0F_5C*/ {0x13e, 3413}, + /*II_F3_0F_5C*/ {0x157, 3420}, + /*II_F2_0F_5C*/ {0x151, 3427}, + /*II_0F_5D*/ {0x13d, 3466}, + /*II_66_0F_5D*/ {0x13e, 3473}, + /*II_F3_0F_5D*/ {0x157, 3480}, + /*II_F2_0F_5D*/ {0x151, 3487}, + /*II_0F_5E*/ {0x13d, 3526}, + /*II_66_0F_5E*/ {0x13e, 3533}, + /*II_F3_0F_5E*/ {0x157, 3540}, + /*II_F2_0F_5E*/ {0x151, 3547}, + /*II_0F_5F*/ {0x13d, 3586}, + /*II_66_0F_5F*/ {0x13e, 3593}, + /*II_F3_0F_5F*/ {0x157, 3600}, + /*II_F2_0F_5F*/ {0x151, 3607}, + /*II_0F_60*/ {0x15b, 3646}, + /*II_66_0F_60*/ {0x13e, 3646}, + /*II_0F_61*/ {0x15b, 3669}, + /*II_66_0F_61*/ {0x13e, 3669}, + /*II_0F_62*/ {0x15b, 3692}, + /*II_66_0F_62*/ {0x13e, 3692}, + /*II_0F_63*/ {0x15c, 3715}, + /*II_66_0F_63*/ {0x13e, 3715}, + /*II_0F_64*/ {0x15c, 3736}, + /*II_66_0F_64*/ {0x13e, 3736}, + /*II_0F_65*/ {0x15c, 3755}, + /*II_66_0F_65*/ {0x13e, 3755}, + /*II_0F_66*/ {0x15c, 3774}, + /*II_66_0F_66*/ {0x13e, 3774}, + /*II_0F_67*/ {0x15c, 3793}, + /*II_66_0F_67*/ {0x13e, 3793}, + /*II_0F_68*/ {0x15c, 3814}, + /*II_66_0F_68*/ {0x13e, 3814}, + /*II_0F_69*/ {0x15c, 3837}, + /*II_66_0F_69*/ {0x13e, 3837}, + /*II_0F_6A*/ {0x15c, 3860}, + /*II_66_0F_6A*/ {0x13e, 3860}, + /*II_0F_6B*/ {0x15c, 3883}, + /*II_66_0F_6B*/ {0x13e, 3883}, + /*II_66_0F_6C*/ {0x13e, 3904}, + /*II_66_0F_6D*/ {0x13e, 3929}, + /*II_0F_6F*/ {0x160, 3960}, + /*II_66_0F_6F*/ {0x126, 3980}, + /*II_F3_0F_6F*/ {0x126, 3988}, + /*II_0F_74*/ {0x15c, 4077}, + /*II_66_0F_74*/ {0x13e, 4077}, + /*II_0F_75*/ {0x15c, 4096}, + /*II_66_0F_75*/ {0x13e, 4096}, + /*II_0F_76*/ {0x15c, 4115}, + /*II_66_0F_76*/ {0x13e, 4115}, + /*II_0F_77*/ {0x164, 4134}, + /*II_0F_78*/ {0x166, 4162}, + /*II_0F_79*/ {0x169, 4186}, + /*II_66_0F_79*/ {0x16a, 4170}, + /*II_F2_0F_79*/ {0x16b, 4177}, + /*II_0F_7A_30*/ {0x16c, 4195}, + /*II_0F_7A_31*/ {0x16d, 4205}, + /*II_66_0F_7C*/ {0x16e, 4215}, + /*II_F2_0F_7C*/ {0x16e, 4223}, + /*II_66_0F_7D*/ {0x16e, 4249}, + /*II_F2_0F_7D*/ {0x16e, 4257}, + /*II_F3_0F_7E*/ {0x128, 3960}, + /*II_0F_7F*/ {0x172, 3960}, + /*II_66_0F_7F*/ {0x12e, 3980}, + /*II_F3_0F_7F*/ {0x12e, 3988}, + /*II_F3_0F_B8*/ {0x176, 4372}, + /*II_0F_BA_04*/ {0x177, 872}, + /*II_0F_BA_05*/ {0x178, 887}, + /*II_0F_BA_06*/ {0x178, 912}, + /*II_0F_BA_07*/ {0x178, 934}, + /*II_0F_BC*/ {0x179, 4380}, + /*II_F3_0F_BC*/ {0x17a, 4385}, + /*II_0F_BD*/ {0x179, 4392}, + /*II_F3_0F_BD*/ {0x17b, 4397}, + /*II_0F_C7_07*/ {0x18b, 6419}, + /*II_66_0F_D0*/ {0x16e, 6428}, + /*II_F2_0F_D0*/ {0x16e, 6438}, + /*II_0F_D1*/ {0x15c, 6470}, + /*II_66_0F_D1*/ {0x13e, 6470}, + /*II_0F_D2*/ {0x15c, 6485}, + /*II_66_0F_D2*/ {0x13e, 6485}, + /*II_0F_D3*/ {0x15c, 6500}, + /*II_66_0F_D3*/ {0x13e, 6500}, + /*II_0F_D4*/ {0x151, 6515}, + /*II_66_0F_D4*/ {0x13e, 6515}, + /*II_0F_D5*/ {0x15c, 6530}, + /*II_66_0F_D5*/ {0x13e, 6530}, + /*II_66_0F_D6*/ {0x130, 3960}, + /*II_F3_0F_D6*/ {0x18c, 6547}, + /*II_F2_0F_D6*/ {0x18d, 6556}, + /*II_0F_D7*/ {0x18f, 6565}, + /*II_66_0F_D7*/ {0x190, 6565}, + /*II_0F_D8*/ {0x15c, 6586}, + /*II_66_0F_D8*/ {0x13e, 6586}, + /*II_0F_D9*/ {0x15c, 6605}, + /*II_66_0F_D9*/ {0x13e, 6605}, + /*II_0F_DA*/ {0x192, 6624}, + /*II_66_0F_DA*/ {0x13e, 6624}, + /*II_0F_DB*/ {0x15c, 6641}, + /*II_66_0F_DB*/ {0x13e, 6641}, + /*II_0F_DC*/ {0x15c, 6654}, + /*II_66_0F_DC*/ {0x13e, 6654}, + /*II_0F_DD*/ {0x15c, 6673}, + /*II_66_0F_DD*/ {0x13e, 6673}, + /*II_0F_DE*/ {0x192, 6682}, + /*II_66_0F_DE*/ {0x13e, 6682}, + /*II_0F_DF*/ {0x15c, 6699}, + /*II_66_0F_DF*/ {0x13e, 6699}, + /*II_0F_E0*/ {0x192, 6714}, + /*II_66_0F_E0*/ {0x13e, 6714}, + /*II_0F_E1*/ {0x15c, 6729}, + /*II_66_0F_E1*/ {0x13e, 6729}, + /*II_0F_E2*/ {0x15c, 6744}, + /*II_66_0F_E2*/ {0x13e, 6744}, + /*II_0F_E3*/ {0x192, 6759}, + /*II_66_0F_E3*/ {0x13e, 6759}, + /*II_0F_E4*/ {0x192, 6774}, + /*II_66_0F_E4*/ {0x13e, 6774}, + /*II_0F_E5*/ {0x15c, 6793}, + /*II_66_0F_E5*/ {0x13e, 6793}, + /*II_66_0F_E6*/ {0x13e, 6810}, + /*II_F3_0F_E6*/ {0x151, 6821}, + /*II_F2_0F_E6*/ {0x13e, 6831}, + /*II_0F_E7*/ {0x193, 6875}, + /*II_66_0F_E7*/ {0x147, 6883}, + /*II_0F_E8*/ {0x15c, 6902}, + /*II_66_0F_E8*/ {0x13e, 6902}, + /*II_0F_E9*/ {0x15c, 6919}, + /*II_66_0F_E9*/ {0x13e, 6919}, + /*II_0F_EA*/ {0x192, 6936}, + /*II_66_0F_EA*/ {0x13e, 6936}, + /*II_0F_EB*/ {0x15c, 6953}, + /*II_66_0F_EB*/ {0x13e, 6953}, + /*II_0F_EC*/ {0x15c, 6964}, + /*II_66_0F_EC*/ {0x13e, 6964}, + /*II_0F_ED*/ {0x15c, 6981}, + /*II_66_0F_ED*/ {0x13e, 6981}, + /*II_0F_EE*/ {0x192, 6998}, + /*II_66_0F_EE*/ {0x13e, 6998}, + /*II_0F_EF*/ {0x15c, 7015}, + /*II_66_0F_EF*/ {0x13e, 7015}, + /*II_F2_0F_F0*/ {0x194, 7028}, + /*II_0F_F1*/ {0x15c, 7043}, + /*II_66_0F_F1*/ {0x13e, 7043}, + /*II_0F_F2*/ {0x15c, 7058}, + /*II_66_0F_F2*/ {0x13e, 7058}, + /*II_0F_F3*/ {0x15c, 7073}, + /*II_66_0F_F3*/ {0x13e, 7073}, + /*II_0F_F4*/ {0x196, 7088}, + /*II_66_0F_F4*/ {0x13e, 7088}, + /*II_0F_F5*/ {0x15c, 7107}, + /*II_66_0F_F5*/ {0x13e, 7107}, + /*II_0F_F6*/ {0x192, 7126}, + /*II_66_0F_F6*/ {0x13e, 7126}, + /*II_0F_F7*/ {0x197, 7143}, + /*II_66_0F_F7*/ {0x198, 7153}, + /*II_0F_F8*/ {0x15c, 7178}, + /*II_66_0F_F8*/ {0x13e, 7178}, + /*II_0F_F9*/ {0x15c, 7193}, + /*II_66_0F_F9*/ {0x13e, 7193}, + /*II_0F_FA*/ {0x15c, 7208}, + /*II_66_0F_FA*/ {0x13e, 7208}, + /*II_0F_FB*/ {0x196, 7223}, + /*II_66_0F_FB*/ {0x13e, 7223}, + /*II_0F_FC*/ {0x15c, 7238}, + /*II_66_0F_FC*/ {0x13e, 7238}, + /*II_0F_FD*/ {0x15c, 7253}, + /*II_66_0F_FD*/ {0x13e, 7253}, + /*II_0F_FE*/ {0x15c, 7268}, + /*II_66_0F_FE*/ {0x13e, 7268}, + /*II_D9_06*/ {0x19a, 7283}, + /*II_9B_D9_06*/ {0x19b, 7292}, + /*II_D9_07*/ {0xfe, 7300}, + /*II_9B_D9_07*/ {0x19c, 7308}, + /*II_DB_E2*/ {0xec, 7315}, + /*II_9B_DB_E2*/ {0x19d, 7323}, + /*II_DB_E3*/ {0xec, 7330}, + /*II_9B_DB_E3*/ {0x19d, 7338}, + /*II_DD_06*/ {0x19a, 7345}, + /*II_9B_DD_06*/ {0x19b, 7353}, + /*II_DD_07*/ {0xfe, 7360}, + /*II_9B_DD_07*/ {0x19c, 7368}, + /*II_DF_E0*/ {0x19e, 7360}, + /*II_9B_DF_E0*/ {0x19f, 7368}, + /*II_0F_38_00*/ {0x1a0, 7375}, + /*II_66_0F_38_00*/ {0x1a1, 7375}, + /*II_0F_38_01*/ {0x1a0, 7392}, + /*II_66_0F_38_01*/ {0x1a1, 7392}, + /*II_0F_38_02*/ {0x1a0, 7409}, + /*II_66_0F_38_02*/ {0x1a1, 7409}, + /*II_0F_38_03*/ {0x1a0, 7426}, + /*II_66_0F_38_03*/ {0x1a1, 7426}, + /*II_0F_38_04*/ {0x1a0, 7445}, + /*II_66_0F_38_04*/ {0x1a1, 7445}, + /*II_0F_38_05*/ {0x1a0, 7468}, + /*II_66_0F_38_05*/ {0x1a1, 7468}, + /*II_0F_38_06*/ {0x1a0, 7485}, + /*II_66_0F_38_06*/ {0x1a1, 7485}, + /*II_0F_38_07*/ {0x1a0, 7502}, + /*II_66_0F_38_07*/ {0x1a1, 7502}, + /*II_0F_38_08*/ {0x1a0, 7521}, + /*II_66_0F_38_08*/ {0x1a1, 7521}, + /*II_0F_38_09*/ {0x1a0, 7538}, + /*II_66_0F_38_09*/ {0x1a1, 7538}, + /*II_0F_38_0A*/ {0x1a0, 7555}, + /*II_66_0F_38_0A*/ {0x1a1, 7555}, + /*II_0F_38_0B*/ {0x1a0, 7572}, + /*II_66_0F_38_0B*/ {0x1a1, 7572}, + /*II_66_0F_38_17*/ {0x1a3, 7663}, + /*II_0F_38_1C*/ {0x1a0, 7722}, + /*II_66_0F_38_1C*/ {0x1a1, 7722}, + /*II_0F_38_1D*/ {0x1a0, 7737}, + /*II_66_0F_38_1D*/ {0x1a1, 7737}, + /*II_0F_38_1E*/ {0x1a0, 7752}, + /*II_66_0F_38_1E*/ {0x1a1, 7752}, + /*II_66_0F_38_20*/ {0x1a8, 7767}, + /*II_66_0F_38_21*/ {0x1a9, 7788}, + /*II_66_0F_38_22*/ {0x1aa, 7809}, + /*II_66_0F_38_23*/ {0x1a8, 7830}, + /*II_66_0F_38_24*/ {0x1a9, 7851}, + /*II_66_0F_38_25*/ {0x1a8, 7872}, + /*II_66_0F_38_28*/ {0x1ac, 7893}, + /*II_66_0F_38_29*/ {0x1ac, 7910}, + /*II_66_0F_38_2A*/ {0x1ad, 7929}, + /*II_66_0F_38_2B*/ {0x1ac, 7950}, + /*II_66_0F_38_30*/ {0x1a8, 7995}, + /*II_66_0F_38_31*/ {0x1a9, 8016}, + /*II_66_0F_38_32*/ {0x1aa, 8037}, + /*II_66_0F_38_33*/ {0x1a8, 8058}, + /*II_66_0F_38_34*/ {0x1a9, 8079}, + /*II_66_0F_38_35*/ {0x1a8, 8100}, + /*II_66_0F_38_37*/ {0x1a3, 8121}, + /*II_66_0F_38_38*/ {0x1ac, 8140}, + /*II_66_0F_38_39*/ {0x1ac, 8157}, + /*II_66_0F_38_3A*/ {0x1ac, 8174}, + /*II_66_0F_38_3B*/ {0x1ac, 8191}, + /*II_66_0F_38_3C*/ {0x1ac, 8208}, + /*II_66_0F_38_3D*/ {0x1ac, 8225}, + /*II_66_0F_38_3E*/ {0x1ac, 8242}, + /*II_66_0F_38_3F*/ {0x1ac, 8259}, + /*II_66_0F_38_40*/ {0x1ac, 8276}, + /*II_66_0F_38_41*/ {0x1ac, 8293}, + /*II_66_0F_38_80*/ {0x1b0, 8318}, + /*II_66_0F_38_81*/ {0x1b0, 8326}, + /*II_66_0F_38_82*/ {0x1b0, 8335}, + /*II_66_0F_38_DB*/ {0x1b3, 9184}, + /*II_66_0F_38_DC*/ {0x1b3, 9201}, + /*II_66_0F_38_DD*/ {0x1b3, 9218}, + /*II_66_0F_38_DE*/ {0x1b3, 9243}, + /*II_66_0F_38_DF*/ {0x1b3, 9260}, + /*II_0F_38_F0*/ {0x1b6, 9285}, + /*II_F2_0F_38_F0*/ {0x1b7, 9292}, + /*II_0F_38_F1*/ {0x1b8, 9285}, + /*II_F2_0F_38_F1*/ {0x1b9, 9292}, + /*II_0F_71_02*/ {0x1d0, 6470}, + /*II_66_0F_71_02*/ {0x1d1, 6470}, + /*II_0F_71_04*/ {0x1d0, 6729}, + /*II_66_0F_71_04*/ {0x1d1, 6729}, + /*II_0F_71_06*/ {0x1d0, 7043}, + /*II_66_0F_71_06*/ {0x1d1, 7043}, + /*II_0F_72_02*/ {0x1d0, 6485}, + /*II_66_0F_72_02*/ {0x1d1, 6485}, + /*II_0F_72_04*/ {0x1d0, 6744}, + /*II_66_0F_72_04*/ {0x1d1, 6744}, + /*II_0F_72_06*/ {0x1d0, 7058}, + /*II_66_0F_72_06*/ {0x1d1, 7058}, + /*II_0F_73_02*/ {0x1d0, 6500}, + /*II_66_0F_73_02*/ {0x1d1, 6500}, + /*II_66_0F_73_03*/ {0x1d1, 9864}, + /*II_0F_73_06*/ {0x1d0, 7073}, + /*II_66_0F_73_06*/ {0x1d1, 7073}, + /*II_66_0F_73_07*/ {0x1d1, 9881}, + /*II_F3_0F_AE_00*/ {0x1d3, 9916}, + /*II_F3_0F_AE_01*/ {0x1d3, 9946}, + /*II_0F_AE_02*/ {0x1d4, 9956}, + /*II_F3_0F_AE_02*/ {0x1d3, 9965}, + /*II_0F_AE_03*/ {0x1d4, 9985}, + /*II_F3_0F_AE_03*/ {0x1d3, 9994}, + /*II_0F_C7_06*/ {0x1d6, 10014}, + /*II_66_0F_C7_06*/ {0x18b, 10023}, + /*II_F3_0F_C7_06*/ {0x18b, 10032} }; _InstInfoEx InstInfosEx[381] = { @@ -1389,382 +1391,382 @@ _InstInfoEx InstInfosEx[381] = { /*II_98*/ {{0x4e, 228}, 0x0, 0, 0, 233, 239}, /*II_99*/ {{0x4e, 245}, 0x0, 0, 0, 250, 255}, /*II_E3*/ {{0x76, 427}, 0x0, 0, 0, 433, 440}, - /*II_0F_A4*/ {{0xac, 876}, 0x0, 1, 0, 0, 0}, - /*II_0F_A5*/ {{0xac, 876}, 0x0, 52, 0, 0, 0}, - /*II_0F_AC*/ {{0xac, 892}, 0x0, 1, 0, 0, 0}, - /*II_0F_AD*/ {{0xac, 892}, 0x0, 52, 0, 0, 0}, - /*II_V_0F_10*/ {{0x126, 2139}, 0x41, 0, 0, 0, 0}, - /*II_V_66_0F_10*/ {{0x126, 2148}, 0x41, 0, 0, 0, 0}, - /*II_V_F3_0F_10*/ {{0x127, 2157}, 0x20, 69, 0, 0, 0}, - /*II_V_F2_0F_10*/ {{0x127, 2165}, 0x20, 69, 0, 0, 0}, - /*II_VRR_F3_0F_10*/ {{0x128, 2157}, 0x60, 0, 0, 0, 0}, - /*II_VRR_F2_0F_10*/ {{0x129, 2165}, 0x60, 0, 0, 0, 0}, - /*II_V_0F_11*/ {{0x12e, 2139}, 0x41, 0, 0, 0, 0}, - /*II_V_66_0F_11*/ {{0x12e, 2148}, 0x41, 0, 0, 0, 0}, - /*II_V_F3_0F_11*/ {{0x127, 2157}, 0x20, 69, 0, 0, 0}, - /*II_V_F2_0F_11*/ {{0x127, 2165}, 0x20, 69, 0, 0, 0}, - /*II_VRR_F3_0F_11*/ {{0x12f, 2157}, 0x60, 0, 0, 0, 0}, - /*II_VRR_F2_0F_11*/ {{0x130, 2165}, 0x60, 0, 0, 0, 0}, - /*II_0F_12*/ {{0x131, 2173}, 0x0, 0, 0, 2182, 0}, - /*II_V_0F_12*/ {{0x134, 2217}, 0x0, 72, 0, 2227, 0}, - /*II_V_66_0F_12*/ {{0x135, 2236}, 0x0, 46, 0, 0, 0}, - /*II_V_F3_0F_12*/ {{0x126, 2245}, 0x41, 0, 0, 0, 0}, - /*II_V_F2_0F_12*/ {{0x136, 2256}, 0x41, 0, 0, 0, 0}, - /*II_V_0F_13*/ {{0x139, 2227}, 0x40, 0, 0, 0, 0}, - /*II_V_66_0F_13*/ {{0x139, 2236}, 0x40, 0, 0, 0, 0}, - /*II_V_0F_14*/ {{0x13c, 2286}, 0x1, 90, 0, 0, 0}, - /*II_V_66_0F_14*/ {{0x13c, 2297}, 0x1, 90, 0, 0, 0}, - /*II_V_0F_15*/ {{0x13c, 2328}, 0x1, 90, 0, 0, 0}, - /*II_V_66_0F_15*/ {{0x13c, 2339}, 0x1, 90, 0, 0, 0}, - /*II_0F_16*/ {{0x131, 2350}, 0x0, 0, 0, 2359, 0}, - /*II_V_0F_16*/ {{0x134, 2385}, 0x0, 72, 0, 2395, 0}, - /*II_V_66_0F_16*/ {{0x135, 2404}, 0x0, 46, 0, 0, 0}, - /*II_V_F3_0F_16*/ {{0x126, 2413}, 0x41, 0, 0, 0, 0}, - /*II_V_0F_17*/ {{0x139, 2395}, 0x40, 0, 0, 0, 0}, - /*II_V_66_0F_17*/ {{0x139, 2404}, 0x40, 0, 0, 0, 0}, - /*II_V_0F_28*/ {{0x126, 2489}, 0x41, 0, 0, 0, 0}, - /*II_V_66_0F_28*/ {{0x126, 2498}, 0x41, 0, 0, 0, 0}, - /*II_V_0F_29*/ {{0x12e, 2489}, 0x41, 0, 0, 0, 0}, - /*II_V_66_0F_29*/ {{0x12e, 2498}, 0x41, 0, 0, 0, 0}, - /*II_V_F3_0F_2A*/ {{0x135, 2547}, 0x2, 79, 0, 0, 0}, - /*II_V_F2_0F_2A*/ {{0x135, 2558}, 0x2, 79, 0, 0, 0}, - /*II_V_0F_2B*/ {{0x147, 2605}, 0x41, 0, 0, 0, 0}, - /*II_V_66_0F_2B*/ {{0x147, 2615}, 0x41, 0, 0, 0, 0}, - /*II_V_F3_0F_2C*/ {{0x14c, 2669}, 0x42, 0, 0, 0, 0}, - /*II_V_F2_0F_2C*/ {{0x14c, 2681}, 0x42, 0, 0, 0, 0}, - /*II_V_F3_0F_2D*/ {{0x14c, 2733}, 0x42, 0, 0, 0, 0}, - /*II_V_F2_0F_2D*/ {{0x14c, 2744}, 0x42, 0, 0, 0, 0}, - /*II_V_0F_2E*/ {{0x14f, 2773}, 0x40, 0, 0, 0, 0}, - /*II_V_66_0F_2E*/ {{0x150, 2783}, 0x40, 0, 0, 0, 0}, - /*II_V_0F_2F*/ {{0x14f, 2809}, 0x40, 0, 0, 0, 0}, - /*II_V_66_0F_2F*/ {{0x150, 2818}, 0x40, 0, 0, 0, 0}, - /*II_V_0F_50*/ {{0x153, 2847}, 0x41, 0, 0, 0, 0}, - /*II_V_66_0F_50*/ {{0x153, 2858}, 0x41, 0, 0, 0, 0}, - /*II_V_0F_51*/ {{0x126, 2901}, 0x41, 0, 0, 0, 0}, - /*II_V_66_0F_51*/ {{0x126, 2910}, 0x41, 0, 0, 0, 0}, - /*II_V_F3_0F_51*/ {{0x135, 2919}, 0x0, 71, 0, 0, 0}, - /*II_V_F2_0F_51*/ {{0x135, 2928}, 0x0, 72, 0, 0, 0}, - /*II_V_0F_52*/ {{0x126, 2955}, 0x41, 0, 0, 0, 0}, - /*II_V_F3_0F_52*/ {{0x135, 2965}, 0x0, 71, 0, 0, 0}, - /*II_V_0F_53*/ {{0x126, 2989}, 0x41, 0, 0, 0, 0}, - /*II_V_F3_0F_53*/ {{0x135, 2997}, 0x0, 71, 0, 0, 0}, - /*II_V_0F_54*/ {{0x13c, 3019}, 0x1, 90, 0, 0, 0}, - /*II_V_66_0F_54*/ {{0x13c, 3027}, 0x1, 90, 0, 0, 0}, - /*II_V_0F_55*/ {{0x13c, 3051}, 0x1, 90, 0, 0, 0}, - /*II_V_66_0F_55*/ {{0x13c, 3060}, 0x1, 90, 0, 0, 0}, - /*II_V_0F_56*/ {{0x13c, 3081}, 0x1, 90, 0, 0, 0}, - /*II_V_66_0F_56*/ {{0x13c, 3088}, 0x1, 90, 0, 0, 0}, - /*II_V_0F_57*/ {{0x13c, 3109}, 0x1, 90, 0, 0, 0}, - /*II_V_66_0F_57*/ {{0x13c, 3117}, 0x1, 90, 0, 0, 0}, - /*II_V_0F_58*/ {{0x13c, 3153}, 0x1, 90, 0, 0, 0}, - /*II_V_66_0F_58*/ {{0x13c, 3161}, 0x1, 90, 0, 0, 0}, - /*II_V_F3_0F_58*/ {{0x135, 3169}, 0x0, 71, 0, 0, 0}, - /*II_V_F2_0F_58*/ {{0x135, 3177}, 0x0, 72, 0, 0, 0}, - /*II_V_0F_59*/ {{0x13c, 3213}, 0x1, 90, 0, 0, 0}, - /*II_V_66_0F_59*/ {{0x13c, 3221}, 0x1, 90, 0, 0, 0}, - /*II_V_F3_0F_59*/ {{0x135, 3229}, 0x0, 71, 0, 0, 0}, - /*II_V_F2_0F_59*/ {{0x135, 3237}, 0x0, 72, 0, 0, 0}, - /*II_V_0F_5A*/ {{0x156, 3285}, 0x41, 0, 0, 0, 0}, - /*II_V_66_0F_5A*/ {{0x157, 3296}, 0x41, 0, 0, 0, 0}, - /*II_V_F3_0F_5A*/ {{0x135, 3307}, 0x0, 71, 0, 0, 0}, - /*II_V_F2_0F_5A*/ {{0x135, 3318}, 0x0, 72, 0, 0, 0}, - /*II_V_0F_5B*/ {{0x126, 3360}, 0x41, 0, 0, 0, 0}, - /*II_V_66_0F_5B*/ {{0x126, 3371}, 0x41, 0, 0, 0, 0}, - /*II_V_F3_0F_5B*/ {{0x126, 3382}, 0x41, 0, 0, 0, 0}, - /*II_V_0F_5C*/ {{0x13c, 3422}, 0x1, 90, 0, 0, 0}, - /*II_V_66_0F_5C*/ {{0x13c, 3430}, 0x1, 90, 0, 0, 0}, - /*II_V_F3_0F_5C*/ {{0x135, 3438}, 0x0, 71, 0, 0, 0}, - /*II_V_F2_0F_5C*/ {{0x135, 3446}, 0x0, 72, 0, 0, 0}, - /*II_V_0F_5D*/ {{0x13c, 3482}, 0x1, 90, 0, 0, 0}, - /*II_V_66_0F_5D*/ {{0x13c, 3490}, 0x1, 90, 0, 0, 0}, - /*II_V_F3_0F_5D*/ {{0x135, 3498}, 0x0, 71, 0, 0, 0}, - /*II_V_F2_0F_5D*/ {{0x135, 3506}, 0x0, 72, 0, 0, 0}, - /*II_V_0F_5E*/ {{0x13c, 3542}, 0x1, 90, 0, 0, 0}, - /*II_V_66_0F_5E*/ {{0x13c, 3550}, 0x1, 90, 0, 0, 0}, - /*II_V_F3_0F_5E*/ {{0x135, 3558}, 0x0, 71, 0, 0, 0}, - /*II_V_F2_0F_5E*/ {{0x135, 3566}, 0x0, 72, 0, 0, 0}, - /*II_V_0F_5F*/ {{0x13c, 3602}, 0x1, 90, 0, 0, 0}, - /*II_V_66_0F_5F*/ {{0x13c, 3610}, 0x1, 90, 0, 0, 0}, - /*II_V_F3_0F_5F*/ {{0x135, 3618}, 0x0, 71, 0, 0, 0}, - /*II_V_F2_0F_5F*/ {{0x135, 3626}, 0x0, 72, 0, 0, 0}, - /*II_V_66_0F_60*/ {{0x135, 3645}, 0x0, 73, 0, 0, 0}, - /*II_V_66_0F_61*/ {{0x135, 3668}, 0x0, 73, 0, 0, 0}, - /*II_V_66_0F_62*/ {{0x135, 3691}, 0x0, 73, 0, 0, 0}, - /*II_V_66_0F_63*/ {{0x135, 3713}, 0x0, 73, 0, 0, 0}, - /*II_V_66_0F_64*/ {{0x135, 3733}, 0x0, 73, 0, 0, 0}, - /*II_V_66_0F_65*/ {{0x135, 3752}, 0x0, 73, 0, 0, 0}, - /*II_V_66_0F_66*/ {{0x135, 3771}, 0x0, 73, 0, 0, 0}, - /*II_V_66_0F_67*/ {{0x135, 3791}, 0x0, 73, 0, 0, 0}, - /*II_V_66_0F_68*/ {{0x135, 3813}, 0x0, 73, 0, 0, 0}, - /*II_V_66_0F_69*/ {{0x135, 3836}, 0x0, 73, 0, 0, 0}, - /*II_V_66_0F_6A*/ {{0x135, 3859}, 0x0, 73, 0, 0, 0}, - /*II_V_66_0F_6B*/ {{0x135, 3881}, 0x0, 73, 0, 0, 0}, - /*II_V_66_0F_6C*/ {{0x135, 3904}, 0x0, 73, 0, 0, 0}, - /*II_V_66_0F_6D*/ {{0x135, 3929}, 0x0, 73, 0, 0, 0}, - /*II_0F_6E*/ {{0x15a, 3942}, 0x0, 0, 0, 0, 3948}, - /*II_66_0F_6E*/ {{0x15b, 3942}, 0x0, 0, 0, 0, 3948}, - /*II_V_66_0F_6E*/ {{0x15c, 3954}, 0x46, 0, 0, 3961, 0}, - /*II_V_66_0F_6F*/ {{0x126, 3984}, 0x41, 0, 0, 0, 0}, - /*II_V_F3_0F_6F*/ {{0x126, 3993}, 0x41, 0, 0, 0, 0}, - /*II_0F_70*/ {{0x15e, 4002}, 0x0, 1, 0, 0, 0}, - /*II_66_0F_70*/ {{0x15f, 4010}, 0x0, 1, 0, 0, 0}, - /*II_F3_0F_70*/ {{0x15f, 4018}, 0x0, 1, 0, 0, 0}, - /*II_F2_0F_70*/ {{0x15f, 4027}, 0x0, 1, 0, 0, 0}, - /*II_V_66_0F_70*/ {{0x160, 4036}, 0x40, 1, 0, 0, 0}, - /*II_V_F3_0F_70*/ {{0x160, 4045}, 0x40, 1, 0, 0, 0}, - /*II_V_F2_0F_70*/ {{0x160, 4055}, 0x40, 1, 0, 0, 0}, - /*II_V_66_0F_74*/ {{0x135, 4074}, 0x0, 73, 0, 0, 0}, - /*II_V_66_0F_75*/ {{0x135, 4093}, 0x0, 73, 0, 0, 0}, - /*II_V_66_0F_76*/ {{0x135, 4112}, 0x0, 73, 0, 0, 0}, - /*II_V_0F_77*/ {{0x162, 4128}, 0x49, 0, 0, 4140, 0}, - /*II_66_0F_78*/ {{0x164, 4158}, 0x0, 8, 0, 0, 0}, - /*II_F2_0F_78*/ {{0x165, 4165}, 0x0, 7, 8, 0, 0}, - /*II_V_66_0F_7C*/ {{0x13c, 4219}, 0x1, 90, 0, 0, 0}, - /*II_V_F2_0F_7C*/ {{0x13c, 4228}, 0x1, 90, 0, 0, 0}, - /*II_V_66_0F_7D*/ {{0x13c, 4253}, 0x1, 90, 0, 0, 0}, - /*II_V_F2_0F_7D*/ {{0x13c, 4262}, 0x1, 90, 0, 0, 0}, - /*II_0F_7E*/ {{0x16c, 3942}, 0x0, 0, 0, 0, 3948}, - /*II_66_0F_7E*/ {{0x16d, 3942}, 0x0, 0, 0, 0, 3948}, - /*II_V_66_0F_7E*/ {{0x16e, 3954}, 0x46, 0, 0, 3961, 0}, - /*II_V_F3_0F_7E*/ {{0x150, 3961}, 0x40, 0, 0, 0, 0}, - /*II_V_66_0F_7F*/ {{0x12e, 3984}, 0x41, 0, 0, 0, 0}, - /*II_V_F3_0F_7F*/ {{0x12e, 3993}, 0x41, 0, 0, 0, 0}, - /*II_0F_AE_04*/ {{0x170, 4271}, 0x0, 0, 0, 0, 4278}, - /*II_0F_AE_05*/ {{0x171, 4287}, 0x0, 0, 0, 4295, 4303}, - /*II_0F_AE_06*/ {{0x171, 4313}, 0x0, 0, 0, 4321, 4331}, - /*II_0F_AE_07*/ {{0x172, 4343}, 0x0, 0, 0, 4351, 0}, - /*II_0F_C2*/ {{0x179, 4392}, 0x0, 0, 0, 4401, 4410}, - /*II_66_0F_C2*/ {{0x17a, 4471}, 0x0, 0, 0, 4480, 4489}, - /*II_F3_0F_C2*/ {{0x17b, 4550}, 0x0, 0, 0, 4559, 4568}, - /*II_F2_0F_C2*/ {{0x17c, 4629}, 0x0, 0, 0, 4638, 4647}, - /*II_V_0F_C2*/ {{0x17d, 4708}, 0x1, 90, 0, 4718, 4728}, - /*II_V_66_0F_C2*/ {{0x17d, 5110}, 0x1, 90, 0, 5120, 5130}, - /*II_V_F3_0F_C2*/ {{0x17e, 5512}, 0x0, 71, 0, 5522, 5532}, - /*II_V_F2_0F_C2*/ {{0x17e, 5914}, 0x0, 72, 0, 5924, 5934}, - /*II_0F_C4*/ {{0x17f, 6316}, 0x0, 1, 0, 0, 0}, - /*II_66_0F_C4*/ {{0x180, 6316}, 0x0, 1, 0, 0, 0}, - /*II_V_66_0F_C4*/ {{0x181, 6324}, 0x0, 25, 1, 0, 0}, - /*II_0F_C5*/ {{0x182, 6333}, 0x0, 1, 0, 0, 0}, - /*II_66_0F_C5*/ {{0x183, 6333}, 0x0, 1, 0, 0, 0}, - /*II_V_66_0F_C5*/ {{0x184, 6341}, 0x40, 1, 0, 0, 0}, - /*II_0F_C6*/ {{0x185, 6350}, 0x0, 1, 0, 0, 0}, - /*II_66_0F_C6*/ {{0x15f, 6358}, 0x0, 1, 0, 0, 0}, - /*II_V_0F_C6*/ {{0x186, 6366}, 0x1, 90, 1, 0, 0}, - /*II_V_66_0F_C6*/ {{0x186, 6375}, 0x1, 90, 1, 0, 0}, - /*II_0F_C7_01*/ {{0x187, 6384}, 0x0, 0, 0, 0, 6395}, - /*II_V_66_0F_D0*/ {{0x13c, 6436}, 0x1, 90, 0, 0, 0}, - /*II_V_F2_0F_D0*/ {{0x13c, 6447}, 0x1, 90, 0, 0, 0}, - /*II_V_66_0F_D1*/ {{0x135, 6465}, 0x0, 73, 0, 0, 0}, - /*II_V_66_0F_D2*/ {{0x135, 6480}, 0x0, 73, 0, 0, 0}, - /*II_V_66_0F_D3*/ {{0x135, 6495}, 0x0, 73, 0, 0, 0}, - /*II_V_66_0F_D4*/ {{0x135, 6510}, 0x0, 73, 0, 0, 0}, - /*II_V_66_0F_D5*/ {{0x135, 6526}, 0x0, 73, 0, 0, 0}, - /*II_V_66_0F_D6*/ {{0x18b, 3961}, 0x40, 0, 0, 0, 0}, - /*II_V_66_0F_D7*/ {{0x18e, 6563}, 0x40, 0, 0, 0, 0}, - /*II_V_66_0F_D8*/ {{0x135, 6583}, 0x0, 73, 0, 0, 0}, - /*II_V_66_0F_D9*/ {{0x135, 6602}, 0x0, 73, 0, 0, 0}, - /*II_V_66_0F_DA*/ {{0x135, 6620}, 0x0, 73, 0, 0, 0}, - /*II_V_66_0F_DB*/ {{0x135, 6635}, 0x0, 73, 0, 0, 0}, - /*II_V_66_0F_DC*/ {{0x135, 6651}, 0x0, 73, 0, 0, 0}, - /*II_V_66_0F_DD*/ {{0x135, 6651}, 0x0, 73, 0, 0, 0}, - /*II_V_66_0F_DE*/ {{0x135, 6678}, 0x0, 73, 0, 0, 0}, - /*II_V_66_0F_DF*/ {{0x135, 6694}, 0x0, 73, 0, 0, 0}, - /*II_V_66_0F_E0*/ {{0x135, 6709}, 0x0, 73, 0, 0, 0}, - /*II_V_66_0F_E1*/ {{0x135, 6724}, 0x0, 73, 0, 0, 0}, - /*II_V_66_0F_E2*/ {{0x135, 6739}, 0x0, 73, 0, 0, 0}, - /*II_V_66_0F_E3*/ {{0x135, 6754}, 0x0, 73, 0, 0, 0}, - /*II_V_66_0F_E4*/ {{0x135, 6771}, 0x0, 73, 0, 0, 0}, - /*II_V_66_0F_E5*/ {{0x135, 6789}, 0x0, 73, 0, 0, 0}, - /*II_V_66_0F_E6*/ {{0x157, 6829}, 0x41, 0, 0, 0, 0}, - /*II_V_F3_0F_E6*/ {{0x156, 6841}, 0x41, 0, 0, 0, 0}, - /*II_V_F2_0F_E6*/ {{0x157, 6852}, 0x41, 0, 0, 0, 0}, - /*II_V_66_0F_E7*/ {{0x147, 6880}, 0x41, 0, 0, 0, 0}, - /*II_V_66_0F_E8*/ {{0x135, 6898}, 0x0, 73, 0, 0, 0}, - /*II_V_66_0F_E9*/ {{0x135, 6915}, 0x0, 73, 0, 0, 0}, - /*II_V_66_0F_EA*/ {{0x135, 6932}, 0x0, 73, 0, 0, 0}, - /*II_V_66_0F_EB*/ {{0x135, 6946}, 0x0, 73, 0, 0, 0}, - /*II_V_66_0F_EC*/ {{0x135, 6960}, 0x0, 73, 0, 0, 0}, - /*II_V_66_0F_ED*/ {{0x135, 6977}, 0x0, 73, 0, 0, 0}, - /*II_V_66_0F_EE*/ {{0x135, 6994}, 0x0, 73, 0, 0, 0}, - /*II_V_66_0F_EF*/ {{0x135, 7009}, 0x0, 73, 0, 0, 0}, - /*II_V_F2_0F_F0*/ {{0x192, 7023}, 0x41, 0, 0, 0, 0}, - /*II_V_66_0F_F1*/ {{0x135, 7038}, 0x0, 73, 0, 0, 0}, - /*II_V_66_0F_F2*/ {{0x135, 7053}, 0x0, 73, 0, 0, 0}, - /*II_V_66_0F_F3*/ {{0x135, 7068}, 0x0, 73, 0, 0, 0}, - /*II_V_66_0F_F4*/ {{0x135, 7085}, 0x0, 73, 0, 0, 0}, - /*II_V_66_0F_F5*/ {{0x135, 7104}, 0x0, 73, 0, 0, 0}, - /*II_V_66_0F_F6*/ {{0x135, 7122}, 0x0, 73, 0, 0, 0}, - /*II_V_66_0F_F7*/ {{0x196, 7153}, 0x40, 0, 0, 0, 0}, - /*II_V_66_0F_F8*/ {{0x135, 7173}, 0x0, 73, 0, 0, 0}, - /*II_V_66_0F_F9*/ {{0x135, 7188}, 0x0, 73, 0, 0, 0}, - /*II_V_66_0F_FA*/ {{0x135, 7203}, 0x0, 73, 0, 0, 0}, - /*II_V_66_0F_FB*/ {{0x135, 7218}, 0x0, 73, 0, 0, 0}, - /*II_V_66_0F_FC*/ {{0x135, 7233}, 0x0, 73, 0, 0, 0}, - /*II_V_66_0F_FD*/ {{0x135, 7248}, 0x0, 73, 0, 0, 0}, - /*II_V_66_0F_FE*/ {{0x135, 7263}, 0x0, 73, 0, 0, 0}, - /*II_V_66_0F_38_00*/ {{0x135, 7371}, 0x0, 73, 0, 0, 0}, - /*II_V_66_0F_38_01*/ {{0x135, 7388}, 0x0, 73, 0, 0, 0}, - /*II_V_66_0F_38_02*/ {{0x135, 7405}, 0x0, 73, 0, 0, 0}, - /*II_V_66_0F_38_03*/ {{0x135, 7423}, 0x0, 73, 0, 0, 0}, - /*II_V_66_0F_38_04*/ {{0x135, 7444}, 0x0, 73, 0, 0, 0}, - /*II_V_66_0F_38_05*/ {{0x135, 7464}, 0x0, 73, 0, 0, 0}, - /*II_V_66_0F_38_06*/ {{0x135, 7481}, 0x0, 73, 0, 0, 0}, - /*II_V_66_0F_38_07*/ {{0x135, 7499}, 0x0, 73, 0, 0, 0}, - /*II_V_66_0F_38_08*/ {{0x135, 7517}, 0x0, 73, 0, 0, 0}, - /*II_V_66_0F_38_09*/ {{0x135, 7534}, 0x0, 73, 0, 0, 0}, - /*II_V_66_0F_38_0A*/ {{0x135, 7551}, 0x0, 73, 0, 0, 0}, - /*II_V_66_0F_38_0B*/ {{0x135, 7570}, 0x0, 73, 0, 0, 0}, - /*II_V_66_0F_38_0C*/ {{0x13c, 7581}, 0x1, 90, 0, 0, 0}, - /*II_V_66_0F_38_0D*/ {{0x13c, 7592}, 0x1, 90, 0, 0, 0}, - /*II_V_66_0F_38_0E*/ {{0x126, 7603}, 0x41, 0, 0, 0, 0}, - /*II_V_66_0F_38_0F*/ {{0x126, 7612}, 0x41, 0, 0, 0, 0}, - /*II_66_0F_38_10*/ {{0x19f, 7621}, 0x0, 74, 0, 0, 0}, - /*II_66_0F_38_14*/ {{0x19f, 7631}, 0x0, 74, 0, 0, 0}, - /*II_66_0F_38_15*/ {{0x19f, 7641}, 0x0, 74, 0, 0, 0}, - /*II_V_66_0F_38_17*/ {{0x126, 7658}, 0x41, 0, 0, 0, 0}, - /*II_V_66_0F_38_18*/ {{0x1a1, 7666}, 0x41, 0, 0, 0, 0}, - /*II_V_66_0F_38_19*/ {{0x1a2, 7680}, 0x50, 0, 0, 0, 0}, - /*II_V_66_0F_38_1A*/ {{0x1a3, 7694}, 0x50, 0, 0, 0, 0}, - /*II_V_66_0F_38_1C*/ {{0x1a4, 7717}, 0x40, 0, 0, 0, 0}, - /*II_V_66_0F_38_1D*/ {{0x1a4, 7732}, 0x40, 0, 0, 0, 0}, - /*II_V_66_0F_38_1E*/ {{0x1a4, 7747}, 0x40, 0, 0, 0, 0}, - /*II_V_66_0F_38_20*/ {{0x150, 7765}, 0x40, 0, 0, 0, 0}, - /*II_V_66_0F_38_21*/ {{0x14f, 7786}, 0x40, 0, 0, 0, 0}, - /*II_V_66_0F_38_22*/ {{0x1a8, 7807}, 0x40, 0, 0, 0, 0}, - /*II_V_66_0F_38_23*/ {{0x150, 7828}, 0x40, 0, 0, 0, 0}, - /*II_V_66_0F_38_24*/ {{0x14f, 7849}, 0x40, 0, 0, 0, 0}, - /*II_V_66_0F_38_25*/ {{0x150, 7870}, 0x40, 0, 0, 0, 0}, - /*II_V_66_0F_38_28*/ {{0x135, 7889}, 0x0, 73, 0, 0, 0}, - /*II_V_66_0F_38_29*/ {{0x135, 7907}, 0x0, 73, 0, 0, 0}, - /*II_V_66_0F_38_2A*/ {{0x1ab, 7927}, 0x40, 0, 0, 0, 0}, - /*II_V_66_0F_38_2B*/ {{0x135, 7948}, 0x0, 73, 0, 0, 0}, - /*II_V_66_0F_38_2C*/ {{0x13c, 7959}, 0x1, 92, 0, 0, 0}, - /*II_V_66_0F_38_2D*/ {{0x13c, 7971}, 0x1, 92, 0, 0, 0}, - /*II_V_66_0F_38_2E*/ {{0x1ac, 7959}, 0x1, 83, 0, 0, 0}, - /*II_V_66_0F_38_2F*/ {{0x1ac, 7971}, 0x1, 83, 0, 0, 0}, - /*II_V_66_0F_38_30*/ {{0x150, 7993}, 0x40, 0, 0, 0, 0}, - /*II_V_66_0F_38_31*/ {{0x14f, 8014}, 0x40, 0, 0, 0, 0}, - /*II_V_66_0F_38_32*/ {{0x1a8, 8035}, 0x40, 0, 0, 0, 0}, - /*II_V_66_0F_38_33*/ {{0x150, 8056}, 0x40, 0, 0, 0, 0}, - /*II_V_66_0F_38_34*/ {{0x14f, 8077}, 0x40, 0, 0, 0, 0}, - /*II_V_66_0F_38_35*/ {{0x150, 8098}, 0x40, 0, 0, 0, 0}, - /*II_V_66_0F_38_37*/ {{0x135, 8118}, 0x0, 73, 0, 0, 0}, - /*II_V_66_0F_38_38*/ {{0x135, 8136}, 0x0, 73, 0, 0, 0}, - /*II_V_66_0F_38_39*/ {{0x135, 8153}, 0x0, 73, 0, 0, 0}, - /*II_V_66_0F_38_3A*/ {{0x135, 8170}, 0x0, 73, 0, 0, 0}, - /*II_V_66_0F_38_3B*/ {{0x135, 8187}, 0x0, 73, 0, 0, 0}, - /*II_V_66_0F_38_3C*/ {{0x135, 8204}, 0x0, 73, 0, 0, 0}, - /*II_V_66_0F_38_3D*/ {{0x135, 8221}, 0x0, 73, 0, 0, 0}, - /*II_V_66_0F_38_3E*/ {{0x135, 8238}, 0x0, 73, 0, 0, 0}, - /*II_V_66_0F_38_3F*/ {{0x135, 8255}, 0x0, 73, 0, 0, 0}, - /*II_V_66_0F_38_40*/ {{0x135, 8272}, 0x0, 73, 0, 0, 0}, - /*II_V_66_0F_38_41*/ {{0x1a4, 8293}, 0x40, 0, 0, 0, 0}, - /*II_V_66_0F_38_96*/ {{0x1ae, 8332}, 0x7, 90, 0, 8348, 0}, - /*II_V_66_0F_38_97*/ {{0x1ae, 8364}, 0x7, 90, 0, 8380, 0}, - /*II_V_66_0F_38_98*/ {{0x1ae, 8396}, 0x7, 90, 0, 8409, 0}, - /*II_V_66_0F_38_99*/ {{0x1af, 8422}, 0x6, 80, 0, 8435, 0}, - /*II_V_66_0F_38_9A*/ {{0x1ae, 8448}, 0x7, 90, 0, 8461, 0}, - /*II_V_66_0F_38_9B*/ {{0x1af, 8474}, 0x6, 80, 0, 8487, 0}, - /*II_V_66_0F_38_9C*/ {{0x1ae, 8500}, 0x7, 90, 0, 8514, 0}, - /*II_V_66_0F_38_9D*/ {{0x1af, 8528}, 0x6, 80, 0, 8542, 0}, - /*II_V_66_0F_38_9E*/ {{0x1ae, 8556}, 0x7, 90, 0, 8570, 0}, - /*II_V_66_0F_38_9F*/ {{0x1af, 8584}, 0x6, 80, 0, 8598, 0}, - /*II_V_66_0F_38_A6*/ {{0x1ae, 8612}, 0x7, 90, 0, 8628, 0}, - /*II_V_66_0F_38_A7*/ {{0x1ae, 8644}, 0x7, 90, 0, 8660, 0}, - /*II_V_66_0F_38_A8*/ {{0x1ae, 8676}, 0x7, 90, 0, 8689, 0}, - /*II_V_66_0F_38_A9*/ {{0x1af, 8702}, 0x6, 80, 0, 8715, 0}, - /*II_V_66_0F_38_AA*/ {{0x1ae, 8728}, 0x7, 90, 0, 8741, 0}, - /*II_V_66_0F_38_AB*/ {{0x1af, 8754}, 0x6, 80, 0, 8767, 0}, - /*II_V_66_0F_38_AC*/ {{0x1ae, 8780}, 0x7, 90, 0, 8794, 0}, - /*II_V_66_0F_38_AD*/ {{0x1af, 8808}, 0x6, 80, 0, 8822, 0}, - /*II_V_66_0F_38_AE*/ {{0x1ae, 8836}, 0x7, 90, 0, 8850, 0}, - /*II_V_66_0F_38_AF*/ {{0x1af, 8864}, 0x6, 80, 0, 8878, 0}, - /*II_V_66_0F_38_B6*/ {{0x1ae, 8892}, 0x7, 90, 0, 8908, 0}, - /*II_V_66_0F_38_B7*/ {{0x1ae, 8924}, 0x7, 90, 0, 8940, 0}, - /*II_V_66_0F_38_B8*/ {{0x1ae, 8956}, 0x7, 90, 0, 8969, 0}, - /*II_V_66_0F_38_B9*/ {{0x1af, 8982}, 0x6, 80, 0, 8995, 0}, - /*II_V_66_0F_38_BA*/ {{0x1ae, 9008}, 0x7, 90, 0, 9021, 0}, - /*II_V_66_0F_38_BB*/ {{0x1af, 9034}, 0x6, 80, 0, 9047, 0}, - /*II_V_66_0F_38_BC*/ {{0x1ae, 9060}, 0x7, 90, 0, 9074, 0}, - /*II_V_66_0F_38_BD*/ {{0x1af, 9088}, 0x6, 80, 0, 9102, 0}, - /*II_V_66_0F_38_BE*/ {{0x1ae, 9116}, 0x7, 90, 0, 9130, 0}, - /*II_V_66_0F_38_BF*/ {{0x1af, 9144}, 0x6, 80, 0, 9158, 0}, - /*II_V_66_0F_38_DB*/ {{0x1b1, 9180}, 0x40, 0, 0, 0, 0}, - /*II_V_66_0F_38_DC*/ {{0x1b2, 9197}, 0x0, 73, 0, 0, 0}, - /*II_V_66_0F_38_DD*/ {{0x1b2, 9218}, 0x0, 73, 0, 0, 0}, - /*II_V_66_0F_38_DE*/ {{0x1b2, 9239}, 0x0, 73, 0, 0, 0}, - /*II_V_66_0F_38_DF*/ {{0x1b2, 9260}, 0x0, 73, 0, 0, 0}, - /*II_V_66_0F_3A_04*/ {{0x1b7, 7581}, 0x41, 1, 0, 0, 0}, - /*II_V_66_0F_3A_05*/ {{0x1b7, 7592}, 0x41, 1, 0, 0, 0}, - /*II_V_66_0F_3A_06*/ {{0x1b8, 9287}, 0x10, 86, 1, 0, 0}, - /*II_66_0F_3A_08*/ {{0x19f, 9299}, 0x0, 1, 0, 0, 0}, - /*II_V_66_0F_3A_08*/ {{0x1b7, 9308}, 0x41, 1, 0, 0, 0}, - /*II_66_0F_3A_09*/ {{0x19f, 9318}, 0x0, 1, 0, 0, 0}, - /*II_V_66_0F_3A_09*/ {{0x1b7, 9327}, 0x41, 1, 0, 0, 0}, - /*II_66_0F_3A_0A*/ {{0x1b9, 9337}, 0x0, 1, 0, 0, 0}, - /*II_V_66_0F_3A_0A*/ {{0x181, 9346}, 0x0, 71, 1, 0, 0}, - /*II_66_0F_3A_0B*/ {{0x1ba, 9356}, 0x0, 1, 0, 0, 0}, - /*II_V_66_0F_3A_0B*/ {{0x181, 9365}, 0x0, 72, 1, 0, 0}, - /*II_66_0F_3A_0C*/ {{0x19f, 9375}, 0x0, 1, 0, 0, 0}, - /*II_V_66_0F_3A_0C*/ {{0x186, 9384}, 0x1, 90, 1, 0, 0}, - /*II_66_0F_3A_0D*/ {{0x19f, 9394}, 0x0, 1, 0, 0, 0}, - /*II_V_66_0F_3A_0D*/ {{0x186, 9403}, 0x1, 90, 1, 0, 0}, - /*II_66_0F_3A_0E*/ {{0x19f, 9413}, 0x0, 1, 0, 0, 0}, - /*II_V_66_0F_3A_0E*/ {{0x181, 9422}, 0x0, 73, 1, 0, 0}, - /*II_0F_3A_0F*/ {{0x1bb, 9432}, 0x0, 1, 0, 0, 0}, - /*II_66_0F_3A_0F*/ {{0x1bc, 9432}, 0x0, 1, 0, 0, 0}, - /*II_V_66_0F_3A_0F*/ {{0x181, 9441}, 0x0, 73, 1, 0, 0}, - /*II_66_0F_3A_14*/ {{0x1bd, 9451}, 0x0, 1, 0, 0, 0}, - /*II_V_66_0F_3A_14*/ {{0x1be, 9459}, 0x40, 1, 0, 0, 0}, - /*II_66_0F_3A_15*/ {{0x1bf, 6333}, 0x0, 1, 0, 0, 0}, - /*II_V_66_0F_3A_15*/ {{0x1c0, 6341}, 0x40, 1, 0, 0, 0}, - /*II_66_0F_3A_16*/ {{0x1c1, 9468}, 0x0, 1, 0, 0, 9476}, - /*II_V_66_0F_3A_16*/ {{0x1c2, 9484}, 0x46, 1, 0, 9493, 0}, - /*II_66_0F_3A_17*/ {{0x1c3, 9502}, 0x0, 1, 0, 0, 0}, - /*II_V_66_0F_3A_17*/ {{0x1c4, 9513}, 0x40, 1, 0, 0, 0}, - /*II_V_66_0F_3A_18*/ {{0x1b8, 9525}, 0x10, 73, 1, 0, 0}, - /*II_V_66_0F_3A_19*/ {{0x1c5, 9538}, 0x50, 1, 0, 0, 0}, - /*II_66_0F_3A_20*/ {{0x1c6, 9552}, 0x0, 1, 0, 0, 0}, - /*II_V_66_0F_3A_20*/ {{0x181, 9560}, 0x0, 76, 1, 0, 0}, - /*II_66_0F_3A_21*/ {{0x1b9, 9569}, 0x0, 1, 0, 0, 0}, - /*II_V_66_0F_3A_21*/ {{0x181, 9579}, 0x0, 71, 1, 0, 0}, - /*II_66_0F_3A_22*/ {{0x1c7, 9590}, 0x0, 1, 0, 0, 9598}, - /*II_V_66_0F_3A_22*/ {{0x181, 9606}, 0x6, 79, 1, 9615, 0}, - /*II_66_0F_3A_40*/ {{0x19f, 9624}, 0x0, 1, 0, 0, 0}, - /*II_V_66_0F_3A_40*/ {{0x186, 9630}, 0x1, 90, 1, 0, 0}, - /*II_66_0F_3A_41*/ {{0x19f, 9637}, 0x0, 1, 0, 0, 0}, - /*II_V_66_0F_3A_41*/ {{0x181, 9643}, 0x0, 73, 1, 0, 0}, - /*II_66_0F_3A_42*/ {{0x19f, 9650}, 0x0, 1, 0, 0, 0}, - /*II_V_66_0F_3A_42*/ {{0x181, 9659}, 0x0, 73, 1, 0, 0}, - /*II_66_0F_3A_44*/ {{0x1c8, 9669}, 0x0, 1, 0, 0, 0}, - /*II_V_66_0F_3A_44*/ {{0x1c9, 9680}, 0x0, 73, 1, 0, 0}, - /*II_V_66_0F_3A_4A*/ {{0x186, 9692}, 0x1, 90, 84, 0, 0}, - /*II_V_66_0F_3A_4B*/ {{0x186, 9703}, 0x1, 90, 84, 0, 0}, - /*II_V_66_0F_3A_4C*/ {{0x181, 9714}, 0x0, 73, 82, 0, 0}, - /*II_66_0F_3A_60*/ {{0x1ca, 9725}, 0x0, 1, 0, 0, 0}, - /*II_V_66_0F_3A_60*/ {{0x160, 9736}, 0x40, 1, 0, 0, 0}, - /*II_66_0F_3A_61*/ {{0x1ca, 9748}, 0x0, 1, 0, 0, 0}, - /*II_V_66_0F_3A_61*/ {{0x160, 9759}, 0x40, 1, 0, 0, 0}, - /*II_66_0F_3A_62*/ {{0x1ca, 9771}, 0x0, 1, 0, 0, 0}, - /*II_V_66_0F_3A_62*/ {{0x160, 9782}, 0x40, 1, 0, 0, 0}, - /*II_66_0F_3A_63*/ {{0x1ca, 9794}, 0x0, 1, 0, 0, 0}, - /*II_V_66_0F_3A_63*/ {{0x160, 9805}, 0x40, 1, 0, 0, 0}, - /*II_66_0F_3A_DF*/ {{0x1cb, 9817}, 0x0, 1, 0, 0, 0}, - /*II_V_66_0F_3A_DF*/ {{0x1cc, 9834}, 0x40, 1, 0, 0, 0}, - /*II_V_66_0F_71_02*/ {{0x1cf, 6465}, 0x0, 1, 0, 0, 0}, - /*II_V_66_0F_71_04*/ {{0x1cf, 6724}, 0x0, 1, 0, 0, 0}, - /*II_V_66_0F_71_06*/ {{0x1cf, 7038}, 0x0, 1, 0, 0, 0}, - /*II_V_66_0F_72_02*/ {{0x1cf, 6480}, 0x0, 1, 0, 0, 0}, - /*II_V_66_0F_72_04*/ {{0x1cf, 6739}, 0x0, 1, 0, 0, 0}, - /*II_V_66_0F_72_06*/ {{0x1cf, 7053}, 0x0, 1, 0, 0, 0}, - /*II_V_66_0F_73_02*/ {{0x1cf, 6495}, 0x0, 1, 0, 0, 0}, - /*II_V_66_0F_73_03*/ {{0x1cf, 9860}, 0x0, 1, 0, 0, 0}, - /*II_V_66_0F_73_06*/ {{0x1cf, 7068}, 0x0, 1, 0, 0, 0}, - /*II_V_66_0F_73_07*/ {{0x1cf, 9877}, 0x0, 1, 0, 0, 0}, - /*II_0F_AE_00*/ {{0x170, 9886}, 0x0, 0, 0, 0, 9894}, - /*II_0F_AE_01*/ {{0x170, 9914}, 0x0, 0, 0, 0, 9923}, - /*II_V_0F_AE_02*/ {{0x1d2, 9963}, 0x40, 0, 0, 0, 0}, - /*II_V_0F_AE_03*/ {{0x1d2, 9992}, 0x40, 0, 0, 0, 0} + /*II_0F_A4*/ {{0xad, 876}, 0x0, 1, 0, 0, 0}, + /*II_0F_A5*/ {{0xad, 876}, 0x0, 42, 0, 0, 0}, + /*II_0F_AC*/ {{0xad, 892}, 0x0, 1, 0, 0, 0}, + /*II_0F_AD*/ {{0xad, 892}, 0x0, 42, 0, 0, 0}, + /*II_V_0F_10*/ {{0x129, 2151}, 0x41, 0, 0, 0, 0}, + /*II_V_66_0F_10*/ {{0x129, 2160}, 0x41, 0, 0, 0, 0}, + /*II_V_F3_0F_10*/ {{0x12a, 2169}, 0x20, 31, 0, 0, 0}, + /*II_V_F2_0F_10*/ {{0x12a, 2177}, 0x20, 31, 0, 0, 0}, + /*II_VRR_F3_0F_10*/ {{0x12b, 2169}, 0x60, 0, 0, 0, 0}, + /*II_VRR_F2_0F_10*/ {{0x12c, 2177}, 0x60, 0, 0, 0, 0}, + /*II_V_0F_11*/ {{0x131, 2151}, 0x41, 0, 0, 0, 0}, + /*II_V_66_0F_11*/ {{0x131, 2160}, 0x41, 0, 0, 0, 0}, + /*II_V_F3_0F_11*/ {{0x12a, 2169}, 0x20, 31, 0, 0, 0}, + /*II_V_F2_0F_11*/ {{0x12a, 2177}, 0x20, 31, 0, 0, 0}, + /*II_VRR_F3_0F_11*/ {{0x132, 2169}, 0x60, 0, 0, 0, 0}, + /*II_VRR_F2_0F_11*/ {{0x133, 2177}, 0x60, 0, 0, 0, 0}, + /*II_0F_12*/ {{0x134, 2185}, 0x0, 0, 0, 2194, 0}, + /*II_V_0F_12*/ {{0x137, 2229}, 0x0, 86, 0, 2239, 0}, + /*II_V_66_0F_12*/ {{0x138, 2248}, 0x0, 57, 0, 0, 0}, + /*II_V_F3_0F_12*/ {{0x129, 2257}, 0x41, 0, 0, 0, 0}, + /*II_V_F2_0F_12*/ {{0x139, 2268}, 0x41, 0, 0, 0, 0}, + /*II_V_0F_13*/ {{0x13c, 2239}, 0x40, 0, 0, 0, 0}, + /*II_V_66_0F_13*/ {{0x13c, 2248}, 0x40, 0, 0, 0, 0}, + /*II_V_0F_14*/ {{0x13f, 2298}, 0x1, 91, 0, 0, 0}, + /*II_V_66_0F_14*/ {{0x13f, 2309}, 0x1, 91, 0, 0, 0}, + /*II_V_0F_15*/ {{0x13f, 2340}, 0x1, 91, 0, 0, 0}, + /*II_V_66_0F_15*/ {{0x13f, 2351}, 0x1, 91, 0, 0, 0}, + /*II_0F_16*/ {{0x134, 2362}, 0x0, 0, 0, 2371, 0}, + /*II_V_0F_16*/ {{0x137, 2397}, 0x0, 86, 0, 2407, 0}, + /*II_V_66_0F_16*/ {{0x138, 2416}, 0x0, 57, 0, 0, 0}, + /*II_V_F3_0F_16*/ {{0x129, 2425}, 0x41, 0, 0, 0, 0}, + /*II_V_0F_17*/ {{0x13c, 2407}, 0x40, 0, 0, 0, 0}, + /*II_V_66_0F_17*/ {{0x13c, 2416}, 0x40, 0, 0, 0, 0}, + /*II_V_0F_28*/ {{0x129, 2501}, 0x41, 0, 0, 0, 0}, + /*II_V_66_0F_28*/ {{0x129, 2510}, 0x41, 0, 0, 0, 0}, + /*II_V_0F_29*/ {{0x131, 2501}, 0x41, 0, 0, 0, 0}, + /*II_V_66_0F_29*/ {{0x131, 2510}, 0x41, 0, 0, 0, 0}, + /*II_V_F3_0F_2A*/ {{0x138, 2559}, 0x2, 73, 0, 0, 0}, + /*II_V_F2_0F_2A*/ {{0x138, 2570}, 0x2, 73, 0, 0, 0}, + /*II_V_0F_2B*/ {{0x14a, 2617}, 0x41, 0, 0, 0, 0}, + /*II_V_66_0F_2B*/ {{0x14a, 2627}, 0x41, 0, 0, 0, 0}, + /*II_V_F3_0F_2C*/ {{0x14f, 2681}, 0x42, 0, 0, 0, 0}, + /*II_V_F2_0F_2C*/ {{0x14f, 2693}, 0x42, 0, 0, 0, 0}, + /*II_V_F3_0F_2D*/ {{0x14f, 2745}, 0x42, 0, 0, 0, 0}, + /*II_V_F2_0F_2D*/ {{0x14f, 2756}, 0x42, 0, 0, 0, 0}, + /*II_V_0F_2E*/ {{0x152, 2785}, 0x40, 0, 0, 0, 0}, + /*II_V_66_0F_2E*/ {{0x153, 2795}, 0x40, 0, 0, 0, 0}, + /*II_V_0F_2F*/ {{0x152, 2821}, 0x40, 0, 0, 0, 0}, + /*II_V_66_0F_2F*/ {{0x153, 2830}, 0x40, 0, 0, 0, 0}, + /*II_V_0F_50*/ {{0x156, 2859}, 0x41, 0, 0, 0, 0}, + /*II_V_66_0F_50*/ {{0x156, 2870}, 0x41, 0, 0, 0, 0}, + /*II_V_0F_51*/ {{0x129, 2913}, 0x41, 0, 0, 0, 0}, + /*II_V_66_0F_51*/ {{0x129, 2922}, 0x41, 0, 0, 0, 0}, + /*II_V_F3_0F_51*/ {{0x138, 2931}, 0x0, 85, 0, 0, 0}, + /*II_V_F2_0F_51*/ {{0x138, 2940}, 0x0, 86, 0, 0, 0}, + /*II_V_0F_52*/ {{0x129, 2967}, 0x41, 0, 0, 0, 0}, + /*II_V_F3_0F_52*/ {{0x138, 2977}, 0x0, 85, 0, 0, 0}, + /*II_V_0F_53*/ {{0x129, 3001}, 0x41, 0, 0, 0, 0}, + /*II_V_F3_0F_53*/ {{0x138, 3009}, 0x0, 85, 0, 0, 0}, + /*II_V_0F_54*/ {{0x13f, 3031}, 0x1, 91, 0, 0, 0}, + /*II_V_66_0F_54*/ {{0x13f, 3039}, 0x1, 91, 0, 0, 0}, + /*II_V_0F_55*/ {{0x13f, 3063}, 0x1, 91, 0, 0, 0}, + /*II_V_66_0F_55*/ {{0x13f, 3072}, 0x1, 91, 0, 0, 0}, + /*II_V_0F_56*/ {{0x13f, 3093}, 0x1, 91, 0, 0, 0}, + /*II_V_66_0F_56*/ {{0x13f, 3100}, 0x1, 91, 0, 0, 0}, + /*II_V_0F_57*/ {{0x13f, 3121}, 0x1, 91, 0, 0, 0}, + /*II_V_66_0F_57*/ {{0x13f, 3129}, 0x1, 91, 0, 0, 0}, + /*II_V_0F_58*/ {{0x13f, 3165}, 0x1, 91, 0, 0, 0}, + /*II_V_66_0F_58*/ {{0x13f, 3173}, 0x1, 91, 0, 0, 0}, + /*II_V_F3_0F_58*/ {{0x138, 3181}, 0x0, 85, 0, 0, 0}, + /*II_V_F2_0F_58*/ {{0x138, 3189}, 0x0, 86, 0, 0, 0}, + /*II_V_0F_59*/ {{0x13f, 3225}, 0x1, 91, 0, 0, 0}, + /*II_V_66_0F_59*/ {{0x13f, 3233}, 0x1, 91, 0, 0, 0}, + /*II_V_F3_0F_59*/ {{0x138, 3241}, 0x0, 85, 0, 0, 0}, + /*II_V_F2_0F_59*/ {{0x138, 3249}, 0x0, 86, 0, 0, 0}, + /*II_V_0F_5A*/ {{0x159, 3297}, 0x41, 0, 0, 0, 0}, + /*II_V_66_0F_5A*/ {{0x15a, 3308}, 0x41, 0, 0, 0, 0}, + /*II_V_F3_0F_5A*/ {{0x138, 3319}, 0x0, 85, 0, 0, 0}, + /*II_V_F2_0F_5A*/ {{0x138, 3330}, 0x0, 86, 0, 0, 0}, + /*II_V_0F_5B*/ {{0x129, 3372}, 0x41, 0, 0, 0, 0}, + /*II_V_66_0F_5B*/ {{0x129, 3383}, 0x41, 0, 0, 0, 0}, + /*II_V_F3_0F_5B*/ {{0x129, 3394}, 0x41, 0, 0, 0, 0}, + /*II_V_0F_5C*/ {{0x13f, 3434}, 0x1, 91, 0, 0, 0}, + /*II_V_66_0F_5C*/ {{0x13f, 3442}, 0x1, 91, 0, 0, 0}, + /*II_V_F3_0F_5C*/ {{0x138, 3450}, 0x0, 85, 0, 0, 0}, + /*II_V_F2_0F_5C*/ {{0x138, 3458}, 0x0, 86, 0, 0, 0}, + /*II_V_0F_5D*/ {{0x13f, 3494}, 0x1, 91, 0, 0, 0}, + /*II_V_66_0F_5D*/ {{0x13f, 3502}, 0x1, 91, 0, 0, 0}, + /*II_V_F3_0F_5D*/ {{0x138, 3510}, 0x0, 85, 0, 0, 0}, + /*II_V_F2_0F_5D*/ {{0x138, 3518}, 0x0, 86, 0, 0, 0}, + /*II_V_0F_5E*/ {{0x13f, 3554}, 0x1, 91, 0, 0, 0}, + /*II_V_66_0F_5E*/ {{0x13f, 3562}, 0x1, 91, 0, 0, 0}, + /*II_V_F3_0F_5E*/ {{0x138, 3570}, 0x0, 85, 0, 0, 0}, + /*II_V_F2_0F_5E*/ {{0x138, 3578}, 0x0, 86, 0, 0, 0}, + /*II_V_0F_5F*/ {{0x13f, 3614}, 0x1, 91, 0, 0, 0}, + /*II_V_66_0F_5F*/ {{0x13f, 3622}, 0x1, 91, 0, 0, 0}, + /*II_V_F3_0F_5F*/ {{0x138, 3630}, 0x0, 85, 0, 0, 0}, + /*II_V_F2_0F_5F*/ {{0x138, 3638}, 0x0, 86, 0, 0, 0}, + /*II_V_66_0F_60*/ {{0x138, 3657}, 0x0, 87, 0, 0, 0}, + /*II_V_66_0F_61*/ {{0x138, 3680}, 0x0, 87, 0, 0, 0}, + /*II_V_66_0F_62*/ {{0x138, 3703}, 0x0, 87, 0, 0, 0}, + /*II_V_66_0F_63*/ {{0x138, 3725}, 0x0, 87, 0, 0, 0}, + /*II_V_66_0F_64*/ {{0x138, 3745}, 0x0, 87, 0, 0, 0}, + /*II_V_66_0F_65*/ {{0x138, 3764}, 0x0, 87, 0, 0, 0}, + /*II_V_66_0F_66*/ {{0x138, 3783}, 0x0, 87, 0, 0, 0}, + /*II_V_66_0F_67*/ {{0x138, 3803}, 0x0, 87, 0, 0, 0}, + /*II_V_66_0F_68*/ {{0x138, 3825}, 0x0, 87, 0, 0, 0}, + /*II_V_66_0F_69*/ {{0x138, 3848}, 0x0, 87, 0, 0, 0}, + /*II_V_66_0F_6A*/ {{0x138, 3871}, 0x0, 87, 0, 0, 0}, + /*II_V_66_0F_6B*/ {{0x138, 3893}, 0x0, 87, 0, 0, 0}, + /*II_V_66_0F_6C*/ {{0x138, 3916}, 0x0, 87, 0, 0, 0}, + /*II_V_66_0F_6D*/ {{0x138, 3941}, 0x0, 87, 0, 0, 0}, + /*II_0F_6E*/ {{0x15d, 3954}, 0x0, 0, 0, 0, 3960}, + /*II_66_0F_6E*/ {{0x15e, 3954}, 0x0, 0, 0, 0, 3960}, + /*II_V_66_0F_6E*/ {{0x15f, 3966}, 0x46, 0, 0, 3973, 0}, + /*II_V_66_0F_6F*/ {{0x129, 3996}, 0x41, 0, 0, 0, 0}, + /*II_V_F3_0F_6F*/ {{0x129, 4005}, 0x41, 0, 0, 0, 0}, + /*II_0F_70*/ {{0x161, 4014}, 0x0, 1, 0, 0, 0}, + /*II_66_0F_70*/ {{0x162, 4022}, 0x0, 1, 0, 0, 0}, + /*II_F3_0F_70*/ {{0x162, 4030}, 0x0, 1, 0, 0, 0}, + /*II_F2_0F_70*/ {{0x162, 4039}, 0x0, 1, 0, 0, 0}, + /*II_V_66_0F_70*/ {{0x163, 4048}, 0x40, 1, 0, 0, 0}, + /*II_V_F3_0F_70*/ {{0x163, 4057}, 0x40, 1, 0, 0, 0}, + /*II_V_F2_0F_70*/ {{0x163, 4067}, 0x40, 1, 0, 0, 0}, + /*II_V_66_0F_74*/ {{0x138, 4086}, 0x0, 87, 0, 0, 0}, + /*II_V_66_0F_75*/ {{0x138, 4105}, 0x0, 87, 0, 0, 0}, + /*II_V_66_0F_76*/ {{0x138, 4124}, 0x0, 87, 0, 0, 0}, + /*II_V_0F_77*/ {{0x165, 4140}, 0x49, 0, 0, 4152, 0}, + /*II_66_0F_78*/ {{0x167, 4170}, 0x0, 49, 0, 0, 0}, + /*II_F2_0F_78*/ {{0x168, 4177}, 0x0, 48, 49, 0, 0}, + /*II_V_66_0F_7C*/ {{0x13f, 4231}, 0x1, 91, 0, 0, 0}, + /*II_V_F2_0F_7C*/ {{0x13f, 4240}, 0x1, 91, 0, 0, 0}, + /*II_V_66_0F_7D*/ {{0x13f, 4265}, 0x1, 91, 0, 0, 0}, + /*II_V_F2_0F_7D*/ {{0x13f, 4274}, 0x1, 91, 0, 0, 0}, + /*II_0F_7E*/ {{0x16f, 3954}, 0x0, 0, 0, 0, 3960}, + /*II_66_0F_7E*/ {{0x170, 3954}, 0x0, 0, 0, 0, 3960}, + /*II_V_66_0F_7E*/ {{0x171, 3966}, 0x46, 0, 0, 3973, 0}, + /*II_V_F3_0F_7E*/ {{0x153, 3973}, 0x40, 0, 0, 0, 0}, + /*II_V_66_0F_7F*/ {{0x131, 3996}, 0x41, 0, 0, 0, 0}, + /*II_V_F3_0F_7F*/ {{0x131, 4005}, 0x41, 0, 0, 0, 0}, + /*II_0F_AE_04*/ {{0x173, 4283}, 0x0, 0, 0, 0, 4290}, + /*II_0F_AE_05*/ {{0x174, 4299}, 0x0, 0, 0, 4307, 4315}, + /*II_0F_AE_06*/ {{0x174, 4325}, 0x0, 0, 0, 4333, 4343}, + /*II_0F_AE_07*/ {{0x175, 4355}, 0x0, 0, 0, 4363, 0}, + /*II_0F_C2*/ {{0x17c, 4404}, 0x0, 0, 0, 4413, 4422}, + /*II_66_0F_C2*/ {{0x17d, 4483}, 0x0, 0, 0, 4492, 4501}, + /*II_F3_0F_C2*/ {{0x17e, 4562}, 0x0, 0, 0, 4571, 4580}, + /*II_F2_0F_C2*/ {{0x17f, 4641}, 0x0, 0, 0, 4650, 4659}, + /*II_V_0F_C2*/ {{0x180, 4720}, 0x1, 91, 0, 4730, 4740}, + /*II_V_66_0F_C2*/ {{0x180, 5122}, 0x1, 91, 0, 5132, 5142}, + /*II_V_F3_0F_C2*/ {{0x181, 5524}, 0x0, 85, 0, 5534, 5544}, + /*II_V_F2_0F_C2*/ {{0x181, 5926}, 0x0, 86, 0, 5936, 5946}, + /*II_0F_C4*/ {{0x182, 6328}, 0x0, 1, 0, 0, 0}, + /*II_66_0F_C4*/ {{0x183, 6328}, 0x0, 1, 0, 0, 0}, + /*II_V_66_0F_C4*/ {{0x184, 6336}, 0x0, 79, 1, 0, 0}, + /*II_0F_C5*/ {{0x185, 6345}, 0x0, 1, 0, 0, 0}, + /*II_66_0F_C5*/ {{0x186, 6345}, 0x0, 1, 0, 0, 0}, + /*II_V_66_0F_C5*/ {{0x187, 6353}, 0x40, 1, 0, 0, 0}, + /*II_0F_C6*/ {{0x188, 6362}, 0x0, 1, 0, 0, 0}, + /*II_66_0F_C6*/ {{0x162, 6370}, 0x0, 1, 0, 0, 0}, + /*II_V_0F_C6*/ {{0x189, 6378}, 0x1, 91, 1, 0, 0}, + /*II_V_66_0F_C6*/ {{0x189, 6387}, 0x1, 91, 1, 0, 0}, + /*II_0F_C7_01*/ {{0x18a, 6396}, 0x0, 0, 0, 0, 6407}, + /*II_V_66_0F_D0*/ {{0x13f, 6448}, 0x1, 91, 0, 0, 0}, + /*II_V_F2_0F_D0*/ {{0x13f, 6459}, 0x1, 91, 0, 0, 0}, + /*II_V_66_0F_D1*/ {{0x138, 6477}, 0x0, 87, 0, 0, 0}, + /*II_V_66_0F_D2*/ {{0x138, 6492}, 0x0, 87, 0, 0, 0}, + /*II_V_66_0F_D3*/ {{0x138, 6507}, 0x0, 87, 0, 0, 0}, + /*II_V_66_0F_D4*/ {{0x138, 6522}, 0x0, 87, 0, 0, 0}, + /*II_V_66_0F_D5*/ {{0x138, 6538}, 0x0, 87, 0, 0, 0}, + /*II_V_66_0F_D6*/ {{0x18e, 3973}, 0x40, 0, 0, 0, 0}, + /*II_V_66_0F_D7*/ {{0x191, 6575}, 0x40, 0, 0, 0, 0}, + /*II_V_66_0F_D8*/ {{0x138, 6595}, 0x0, 87, 0, 0, 0}, + /*II_V_66_0F_D9*/ {{0x138, 6614}, 0x0, 87, 0, 0, 0}, + /*II_V_66_0F_DA*/ {{0x138, 6632}, 0x0, 87, 0, 0, 0}, + /*II_V_66_0F_DB*/ {{0x138, 6647}, 0x0, 87, 0, 0, 0}, + /*II_V_66_0F_DC*/ {{0x138, 6663}, 0x0, 87, 0, 0, 0}, + /*II_V_66_0F_DD*/ {{0x138, 6663}, 0x0, 87, 0, 0, 0}, + /*II_V_66_0F_DE*/ {{0x138, 6690}, 0x0, 87, 0, 0, 0}, + /*II_V_66_0F_DF*/ {{0x138, 6706}, 0x0, 87, 0, 0, 0}, + /*II_V_66_0F_E0*/ {{0x138, 6721}, 0x0, 87, 0, 0, 0}, + /*II_V_66_0F_E1*/ {{0x138, 6736}, 0x0, 87, 0, 0, 0}, + /*II_V_66_0F_E2*/ {{0x138, 6751}, 0x0, 87, 0, 0, 0}, + /*II_V_66_0F_E3*/ {{0x138, 6766}, 0x0, 87, 0, 0, 0}, + /*II_V_66_0F_E4*/ {{0x138, 6783}, 0x0, 87, 0, 0, 0}, + /*II_V_66_0F_E5*/ {{0x138, 6801}, 0x0, 87, 0, 0, 0}, + /*II_V_66_0F_E6*/ {{0x15a, 6841}, 0x41, 0, 0, 0, 0}, + /*II_V_F3_0F_E6*/ {{0x159, 6853}, 0x41, 0, 0, 0, 0}, + /*II_V_F2_0F_E6*/ {{0x15a, 6864}, 0x41, 0, 0, 0, 0}, + /*II_V_66_0F_E7*/ {{0x14a, 6892}, 0x41, 0, 0, 0, 0}, + /*II_V_66_0F_E8*/ {{0x138, 6910}, 0x0, 87, 0, 0, 0}, + /*II_V_66_0F_E9*/ {{0x138, 6927}, 0x0, 87, 0, 0, 0}, + /*II_V_66_0F_EA*/ {{0x138, 6944}, 0x0, 87, 0, 0, 0}, + /*II_V_66_0F_EB*/ {{0x138, 6958}, 0x0, 87, 0, 0, 0}, + /*II_V_66_0F_EC*/ {{0x138, 6972}, 0x0, 87, 0, 0, 0}, + /*II_V_66_0F_ED*/ {{0x138, 6989}, 0x0, 87, 0, 0, 0}, + /*II_V_66_0F_EE*/ {{0x138, 7006}, 0x0, 87, 0, 0, 0}, + /*II_V_66_0F_EF*/ {{0x138, 7021}, 0x0, 87, 0, 0, 0}, + /*II_V_F2_0F_F0*/ {{0x195, 7035}, 0x41, 0, 0, 0, 0}, + /*II_V_66_0F_F1*/ {{0x138, 7050}, 0x0, 87, 0, 0, 0}, + /*II_V_66_0F_F2*/ {{0x138, 7065}, 0x0, 87, 0, 0, 0}, + /*II_V_66_0F_F3*/ {{0x138, 7080}, 0x0, 87, 0, 0, 0}, + /*II_V_66_0F_F4*/ {{0x138, 7097}, 0x0, 87, 0, 0, 0}, + /*II_V_66_0F_F5*/ {{0x138, 7116}, 0x0, 87, 0, 0, 0}, + /*II_V_66_0F_F6*/ {{0x138, 7134}, 0x0, 87, 0, 0, 0}, + /*II_V_66_0F_F7*/ {{0x199, 7165}, 0x40, 0, 0, 0, 0}, + /*II_V_66_0F_F8*/ {{0x138, 7185}, 0x0, 87, 0, 0, 0}, + /*II_V_66_0F_F9*/ {{0x138, 7200}, 0x0, 87, 0, 0, 0}, + /*II_V_66_0F_FA*/ {{0x138, 7215}, 0x0, 87, 0, 0, 0}, + /*II_V_66_0F_FB*/ {{0x138, 7230}, 0x0, 87, 0, 0, 0}, + /*II_V_66_0F_FC*/ {{0x138, 7245}, 0x0, 87, 0, 0, 0}, + /*II_V_66_0F_FD*/ {{0x138, 7260}, 0x0, 87, 0, 0, 0}, + /*II_V_66_0F_FE*/ {{0x138, 7275}, 0x0, 87, 0, 0, 0}, + /*II_V_66_0F_38_00*/ {{0x138, 7383}, 0x0, 87, 0, 0, 0}, + /*II_V_66_0F_38_01*/ {{0x138, 7400}, 0x0, 87, 0, 0, 0}, + /*II_V_66_0F_38_02*/ {{0x138, 7417}, 0x0, 87, 0, 0, 0}, + /*II_V_66_0F_38_03*/ {{0x138, 7435}, 0x0, 87, 0, 0, 0}, + /*II_V_66_0F_38_04*/ {{0x138, 7456}, 0x0, 87, 0, 0, 0}, + /*II_V_66_0F_38_05*/ {{0x138, 7476}, 0x0, 87, 0, 0, 0}, + /*II_V_66_0F_38_06*/ {{0x138, 7493}, 0x0, 87, 0, 0, 0}, + /*II_V_66_0F_38_07*/ {{0x138, 7511}, 0x0, 87, 0, 0, 0}, + /*II_V_66_0F_38_08*/ {{0x138, 7529}, 0x0, 87, 0, 0, 0}, + /*II_V_66_0F_38_09*/ {{0x138, 7546}, 0x0, 87, 0, 0, 0}, + /*II_V_66_0F_38_0A*/ {{0x138, 7563}, 0x0, 87, 0, 0, 0}, + /*II_V_66_0F_38_0B*/ {{0x138, 7582}, 0x0, 87, 0, 0, 0}, + /*II_V_66_0F_38_0C*/ {{0x13f, 7593}, 0x1, 91, 0, 0, 0}, + /*II_V_66_0F_38_0D*/ {{0x13f, 7604}, 0x1, 91, 0, 0, 0}, + /*II_V_66_0F_38_0E*/ {{0x129, 7615}, 0x41, 0, 0, 0, 0}, + /*II_V_66_0F_38_0F*/ {{0x129, 7624}, 0x41, 0, 0, 0, 0}, + /*II_66_0F_38_10*/ {{0x1a2, 7633}, 0x0, 32, 0, 0, 0}, + /*II_66_0F_38_14*/ {{0x1a2, 7643}, 0x0, 32, 0, 0, 0}, + /*II_66_0F_38_15*/ {{0x1a2, 7653}, 0x0, 32, 0, 0, 0}, + /*II_V_66_0F_38_17*/ {{0x129, 7670}, 0x41, 0, 0, 0, 0}, + /*II_V_66_0F_38_18*/ {{0x1a4, 7678}, 0x41, 0, 0, 0, 0}, + /*II_V_66_0F_38_19*/ {{0x1a5, 7692}, 0x50, 0, 0, 0, 0}, + /*II_V_66_0F_38_1A*/ {{0x1a6, 7706}, 0x50, 0, 0, 0, 0}, + /*II_V_66_0F_38_1C*/ {{0x1a7, 7729}, 0x40, 0, 0, 0, 0}, + /*II_V_66_0F_38_1D*/ {{0x1a7, 7744}, 0x40, 0, 0, 0, 0}, + /*II_V_66_0F_38_1E*/ {{0x1a7, 7759}, 0x40, 0, 0, 0, 0}, + /*II_V_66_0F_38_20*/ {{0x153, 7777}, 0x40, 0, 0, 0, 0}, + /*II_V_66_0F_38_21*/ {{0x152, 7798}, 0x40, 0, 0, 0, 0}, + /*II_V_66_0F_38_22*/ {{0x1ab, 7819}, 0x40, 0, 0, 0, 0}, + /*II_V_66_0F_38_23*/ {{0x153, 7840}, 0x40, 0, 0, 0, 0}, + /*II_V_66_0F_38_24*/ {{0x152, 7861}, 0x40, 0, 0, 0, 0}, + /*II_V_66_0F_38_25*/ {{0x153, 7882}, 0x40, 0, 0, 0, 0}, + /*II_V_66_0F_38_28*/ {{0x138, 7901}, 0x0, 87, 0, 0, 0}, + /*II_V_66_0F_38_29*/ {{0x138, 7919}, 0x0, 87, 0, 0, 0}, + /*II_V_66_0F_38_2A*/ {{0x1ae, 7939}, 0x40, 0, 0, 0, 0}, + /*II_V_66_0F_38_2B*/ {{0x138, 7960}, 0x0, 87, 0, 0, 0}, + /*II_V_66_0F_38_2C*/ {{0x13f, 7971}, 0x1, 67, 0, 0, 0}, + /*II_V_66_0F_38_2D*/ {{0x13f, 7983}, 0x1, 67, 0, 0, 0}, + /*II_V_66_0F_38_2E*/ {{0x1af, 7971}, 0x1, 36, 0, 0, 0}, + /*II_V_66_0F_38_2F*/ {{0x1af, 7983}, 0x1, 36, 0, 0, 0}, + /*II_V_66_0F_38_30*/ {{0x153, 8005}, 0x40, 0, 0, 0, 0}, + /*II_V_66_0F_38_31*/ {{0x152, 8026}, 0x40, 0, 0, 0, 0}, + /*II_V_66_0F_38_32*/ {{0x1ab, 8047}, 0x40, 0, 0, 0, 0}, + /*II_V_66_0F_38_33*/ {{0x153, 8068}, 0x40, 0, 0, 0, 0}, + /*II_V_66_0F_38_34*/ {{0x152, 8089}, 0x40, 0, 0, 0, 0}, + /*II_V_66_0F_38_35*/ {{0x153, 8110}, 0x40, 0, 0, 0, 0}, + /*II_V_66_0F_38_37*/ {{0x138, 8130}, 0x0, 87, 0, 0, 0}, + /*II_V_66_0F_38_38*/ {{0x138, 8148}, 0x0, 87, 0, 0, 0}, + /*II_V_66_0F_38_39*/ {{0x138, 8165}, 0x0, 87, 0, 0, 0}, + /*II_V_66_0F_38_3A*/ {{0x138, 8182}, 0x0, 87, 0, 0, 0}, + /*II_V_66_0F_38_3B*/ {{0x138, 8199}, 0x0, 87, 0, 0, 0}, + /*II_V_66_0F_38_3C*/ {{0x138, 8216}, 0x0, 87, 0, 0, 0}, + /*II_V_66_0F_38_3D*/ {{0x138, 8233}, 0x0, 87, 0, 0, 0}, + /*II_V_66_0F_38_3E*/ {{0x138, 8250}, 0x0, 87, 0, 0, 0}, + /*II_V_66_0F_38_3F*/ {{0x138, 8267}, 0x0, 87, 0, 0, 0}, + /*II_V_66_0F_38_40*/ {{0x138, 8284}, 0x0, 87, 0, 0, 0}, + /*II_V_66_0F_38_41*/ {{0x1a7, 8305}, 0x40, 0, 0, 0, 0}, + /*II_V_66_0F_38_96*/ {{0x1b1, 8344}, 0x7, 91, 0, 8360, 0}, + /*II_V_66_0F_38_97*/ {{0x1b1, 8376}, 0x7, 91, 0, 8392, 0}, + /*II_V_66_0F_38_98*/ {{0x1b1, 8408}, 0x7, 91, 0, 8421, 0}, + /*II_V_66_0F_38_99*/ {{0x1b2, 8434}, 0x6, 88, 0, 8447, 0}, + /*II_V_66_0F_38_9A*/ {{0x1b1, 8460}, 0x7, 91, 0, 8473, 0}, + /*II_V_66_0F_38_9B*/ {{0x1b2, 8486}, 0x6, 88, 0, 8499, 0}, + /*II_V_66_0F_38_9C*/ {{0x1b1, 8512}, 0x7, 91, 0, 8526, 0}, + /*II_V_66_0F_38_9D*/ {{0x1b2, 8540}, 0x6, 88, 0, 8554, 0}, + /*II_V_66_0F_38_9E*/ {{0x1b1, 8568}, 0x7, 91, 0, 8582, 0}, + /*II_V_66_0F_38_9F*/ {{0x1b2, 8596}, 0x6, 88, 0, 8610, 0}, + /*II_V_66_0F_38_A6*/ {{0x1b1, 8624}, 0x7, 91, 0, 8640, 0}, + /*II_V_66_0F_38_A7*/ {{0x1b1, 8656}, 0x7, 91, 0, 8672, 0}, + /*II_V_66_0F_38_A8*/ {{0x1b1, 8688}, 0x7, 91, 0, 8701, 0}, + /*II_V_66_0F_38_A9*/ {{0x1b2, 8714}, 0x6, 88, 0, 8727, 0}, + /*II_V_66_0F_38_AA*/ {{0x1b1, 8740}, 0x7, 91, 0, 8753, 0}, + /*II_V_66_0F_38_AB*/ {{0x1b2, 8766}, 0x6, 88, 0, 8779, 0}, + /*II_V_66_0F_38_AC*/ {{0x1b1, 8792}, 0x7, 91, 0, 8806, 0}, + /*II_V_66_0F_38_AD*/ {{0x1b2, 8820}, 0x6, 88, 0, 8834, 0}, + /*II_V_66_0F_38_AE*/ {{0x1b1, 8848}, 0x7, 91, 0, 8862, 0}, + /*II_V_66_0F_38_AF*/ {{0x1b2, 8876}, 0x6, 88, 0, 8890, 0}, + /*II_V_66_0F_38_B6*/ {{0x1b1, 8904}, 0x7, 91, 0, 8920, 0}, + /*II_V_66_0F_38_B7*/ {{0x1b1, 8936}, 0x7, 91, 0, 8952, 0}, + /*II_V_66_0F_38_B8*/ {{0x1b1, 8968}, 0x7, 91, 0, 8981, 0}, + /*II_V_66_0F_38_B9*/ {{0x1b2, 8994}, 0x6, 88, 0, 9007, 0}, + /*II_V_66_0F_38_BA*/ {{0x1b1, 9020}, 0x7, 91, 0, 9033, 0}, + /*II_V_66_0F_38_BB*/ {{0x1b2, 9046}, 0x6, 88, 0, 9059, 0}, + /*II_V_66_0F_38_BC*/ {{0x1b1, 9072}, 0x7, 91, 0, 9086, 0}, + /*II_V_66_0F_38_BD*/ {{0x1b2, 9100}, 0x6, 88, 0, 9114, 0}, + /*II_V_66_0F_38_BE*/ {{0x1b1, 9128}, 0x7, 91, 0, 9142, 0}, + /*II_V_66_0F_38_BF*/ {{0x1b2, 9156}, 0x6, 88, 0, 9170, 0}, + /*II_V_66_0F_38_DB*/ {{0x1b4, 9192}, 0x40, 0, 0, 0, 0}, + /*II_V_66_0F_38_DC*/ {{0x1b5, 9209}, 0x0, 87, 0, 0, 0}, + /*II_V_66_0F_38_DD*/ {{0x1b5, 9230}, 0x0, 87, 0, 0, 0}, + /*II_V_66_0F_38_DE*/ {{0x1b5, 9251}, 0x0, 87, 0, 0, 0}, + /*II_V_66_0F_38_DF*/ {{0x1b5, 9272}, 0x0, 87, 0, 0, 0}, + /*II_V_66_0F_3A_04*/ {{0x1ba, 7593}, 0x41, 1, 0, 0, 0}, + /*II_V_66_0F_3A_05*/ {{0x1ba, 7604}, 0x41, 1, 0, 0, 0}, + /*II_V_66_0F_3A_06*/ {{0x1bb, 9299}, 0x10, 89, 1, 0, 0}, + /*II_66_0F_3A_08*/ {{0x1a2, 9311}, 0x0, 1, 0, 0, 0}, + /*II_V_66_0F_3A_08*/ {{0x1ba, 9320}, 0x41, 1, 0, 0, 0}, + /*II_66_0F_3A_09*/ {{0x1a2, 9330}, 0x0, 1, 0, 0, 0}, + /*II_V_66_0F_3A_09*/ {{0x1ba, 9339}, 0x41, 1, 0, 0, 0}, + /*II_66_0F_3A_0A*/ {{0x1bc, 9349}, 0x0, 1, 0, 0, 0}, + /*II_V_66_0F_3A_0A*/ {{0x184, 9358}, 0x0, 85, 1, 0, 0}, + /*II_66_0F_3A_0B*/ {{0x1bd, 9368}, 0x0, 1, 0, 0, 0}, + /*II_V_66_0F_3A_0B*/ {{0x184, 9377}, 0x0, 86, 1, 0, 0}, + /*II_66_0F_3A_0C*/ {{0x1a2, 9387}, 0x0, 1, 0, 0, 0}, + /*II_V_66_0F_3A_0C*/ {{0x189, 9396}, 0x1, 91, 1, 0, 0}, + /*II_66_0F_3A_0D*/ {{0x1a2, 9406}, 0x0, 1, 0, 0, 0}, + /*II_V_66_0F_3A_0D*/ {{0x189, 9415}, 0x1, 91, 1, 0, 0}, + /*II_66_0F_3A_0E*/ {{0x1a2, 9425}, 0x0, 1, 0, 0, 0}, + /*II_V_66_0F_3A_0E*/ {{0x184, 9434}, 0x0, 87, 1, 0, 0}, + /*II_0F_3A_0F*/ {{0x1be, 9444}, 0x0, 1, 0, 0, 0}, + /*II_66_0F_3A_0F*/ {{0x1bf, 9444}, 0x0, 1, 0, 0, 0}, + /*II_V_66_0F_3A_0F*/ {{0x184, 9453}, 0x0, 87, 1, 0, 0}, + /*II_66_0F_3A_14*/ {{0x1c0, 9463}, 0x0, 1, 0, 0, 0}, + /*II_V_66_0F_3A_14*/ {{0x1c1, 9471}, 0x40, 1, 0, 0, 0}, + /*II_66_0F_3A_15*/ {{0x1c2, 6345}, 0x0, 1, 0, 0, 0}, + /*II_V_66_0F_3A_15*/ {{0x1c3, 6353}, 0x40, 1, 0, 0, 0}, + /*II_66_0F_3A_16*/ {{0x1c4, 9480}, 0x0, 1, 0, 0, 9488}, + /*II_V_66_0F_3A_16*/ {{0x1c5, 9496}, 0x46, 1, 0, 9505, 0}, + /*II_66_0F_3A_17*/ {{0x1c6, 9514}, 0x0, 1, 0, 0, 0}, + /*II_V_66_0F_3A_17*/ {{0x1c7, 9525}, 0x40, 1, 0, 0, 0}, + /*II_V_66_0F_3A_18*/ {{0x1bb, 9537}, 0x10, 87, 1, 0, 0}, + /*II_V_66_0F_3A_19*/ {{0x1c8, 9550}, 0x50, 1, 0, 0, 0}, + /*II_66_0F_3A_20*/ {{0x1c9, 9564}, 0x0, 1, 0, 0, 0}, + /*II_V_66_0F_3A_20*/ {{0x184, 9572}, 0x0, 80, 1, 0, 0}, + /*II_66_0F_3A_21*/ {{0x1bc, 9581}, 0x0, 1, 0, 0, 0}, + /*II_V_66_0F_3A_21*/ {{0x184, 9591}, 0x0, 85, 1, 0, 0}, + /*II_66_0F_3A_22*/ {{0x1ca, 9602}, 0x0, 1, 0, 0, 9610}, + /*II_V_66_0F_3A_22*/ {{0x184, 9618}, 0x6, 73, 1, 9627, 0}, + /*II_66_0F_3A_40*/ {{0x1a2, 9636}, 0x0, 1, 0, 0, 0}, + /*II_V_66_0F_3A_40*/ {{0x189, 9642}, 0x1, 91, 1, 0, 0}, + /*II_66_0F_3A_41*/ {{0x1a2, 9649}, 0x0, 1, 0, 0, 0}, + /*II_V_66_0F_3A_41*/ {{0x184, 9655}, 0x0, 87, 1, 0, 0}, + /*II_66_0F_3A_42*/ {{0x1a2, 9662}, 0x0, 1, 0, 0, 0}, + /*II_V_66_0F_3A_42*/ {{0x184, 9671}, 0x0, 87, 1, 0, 0}, + /*II_66_0F_3A_44*/ {{0x1cb, 9681}, 0x0, 1, 0, 0, 0}, + /*II_V_66_0F_3A_44*/ {{0x1cc, 9692}, 0x0, 87, 1, 0, 0}, + /*II_V_66_0F_3A_4A*/ {{0x189, 9704}, 0x1, 91, 37, 0, 0}, + /*II_V_66_0F_3A_4B*/ {{0x189, 9715}, 0x1, 91, 37, 0, 0}, + /*II_V_66_0F_3A_4C*/ {{0x184, 9726}, 0x0, 87, 35, 0, 0}, + /*II_66_0F_3A_60*/ {{0x1cd, 9737}, 0x0, 1, 0, 0, 0}, + /*II_V_66_0F_3A_60*/ {{0x163, 9748}, 0x40, 1, 0, 0, 0}, + /*II_66_0F_3A_61*/ {{0x1cd, 9760}, 0x0, 1, 0, 0, 0}, + /*II_V_66_0F_3A_61*/ {{0x163, 9771}, 0x40, 1, 0, 0, 0}, + /*II_66_0F_3A_62*/ {{0x1cd, 9783}, 0x0, 1, 0, 0, 0}, + /*II_V_66_0F_3A_62*/ {{0x163, 9794}, 0x40, 1, 0, 0, 0}, + /*II_66_0F_3A_63*/ {{0x1cd, 9806}, 0x0, 1, 0, 0, 0}, + /*II_V_66_0F_3A_63*/ {{0x163, 9817}, 0x40, 1, 0, 0, 0}, + /*II_66_0F_3A_DF*/ {{0x1ce, 9829}, 0x0, 1, 0, 0, 0}, + /*II_V_66_0F_3A_DF*/ {{0x1cf, 9846}, 0x40, 1, 0, 0, 0}, + /*II_V_66_0F_71_02*/ {{0x1d2, 6477}, 0x0, 1, 0, 0, 0}, + /*II_V_66_0F_71_04*/ {{0x1d2, 6736}, 0x0, 1, 0, 0, 0}, + /*II_V_66_0F_71_06*/ {{0x1d2, 7050}, 0x0, 1, 0, 0, 0}, + /*II_V_66_0F_72_02*/ {{0x1d2, 6492}, 0x0, 1, 0, 0, 0}, + /*II_V_66_0F_72_04*/ {{0x1d2, 6751}, 0x0, 1, 0, 0, 0}, + /*II_V_66_0F_72_06*/ {{0x1d2, 7065}, 0x0, 1, 0, 0, 0}, + /*II_V_66_0F_73_02*/ {{0x1d2, 6507}, 0x0, 1, 0, 0, 0}, + /*II_V_66_0F_73_03*/ {{0x1d2, 9872}, 0x0, 1, 0, 0, 0}, + /*II_V_66_0F_73_06*/ {{0x1d2, 7080}, 0x0, 1, 0, 0, 0}, + /*II_V_66_0F_73_07*/ {{0x1d2, 9889}, 0x0, 1, 0, 0, 0}, + /*II_0F_AE_00*/ {{0x173, 9898}, 0x0, 0, 0, 0, 9906}, + /*II_0F_AE_01*/ {{0x173, 9926}, 0x0, 0, 0, 0, 9935}, + /*II_V_0F_AE_02*/ {{0x1d5, 9975}, 0x40, 0, 0, 0, 0}, + /*II_V_0F_AE_03*/ {{0x1d5, 10004}, 0x40, 0, 0, 0, 0} }; _InstNode InstructionsTree[5688] = { @@ -1783,7 +1785,7 @@ _InstNode InstructionsTree[5688] = { /* c - _0C */ 0x200c, /* d - _0D */ 0x200d, /* e - _0E */ 0x200e, -/* f - _0F */ 0x8100, +/* f - _0F */ 0xa100, /* 10 - _10 */ 0x200f, /* 11 - _11 */ 0x2010, /* 12 - _12 */ 0x2011, @@ -1867,7 +1869,7 @@ _InstNode InstructionsTree[5688] = { /* 60 - _60 */ 0x205b, /* 61 - _61 */ 0x205c, /* 62 - _62 */ 0x205d, -/* 63 - _63 */ 0x205e, +/* 63 - _63 */ 0x605e, /* 64 - */ 0, /* 65 - */ 0, /* 66 - */ 0, @@ -1896,10 +1898,10 @@ _InstNode InstructionsTree[5688] = { /* 7d - _7D */ 0x2072, /* 7e - _7E */ 0x2073, /* 7f - _7F */ 0x2074, -/* 80 - _80 */ 0x6200, -/* 81 - _81 */ 0x6208, -/* 82 - _82 */ 0x6210, -/* 83 - _83 */ 0x6218, +/* 80 - _80 */ 0x8200, +/* 81 - _81 */ 0x8208, +/* 82 - _82 */ 0x8210, +/* 83 - _83 */ 0x8218, /* 84 - _84 */ 0x2075, /* 85 - _85 */ 0x2076, /* 86 - _86 */ 0x2077, @@ -1909,10 +1911,10 @@ _InstNode InstructionsTree[5688] = { /* 8a - _8A */ 0x207b, /* 8b - _8B */ 0x207c, /* 8c - _8C */ 0x207d, -/* 8d - _8D */ 0x207e, +/* 8d - _8D */ 0x607e, /* 8e - _8E */ 0x207f, -/* 8f - _8F */ 0x6220, -/* 90 - _90 */ 0x2080, +/* 8f - _8F */ 0x8220, +/* 90 - _90 */ 0x6080, /* 91 - _91 */ 0x2081, /* 92 - _92 */ 0x2082, /* 93 - _93 */ 0x2083, @@ -1960,14 +1962,14 @@ _InstNode InstructionsTree[5688] = { /* bd - _B8 */ 0x20aa, /* be - _B8 */ 0x20ab, /* bf - _B8 */ 0x20ac, -/* c0 - _C0 */ 0x6228, -/* c1 - _C1 */ 0x6230, +/* c0 - _C0 */ 0x8228, +/* c1 - _C1 */ 0x8230, /* c2 - _C2 */ 0x20ad, /* c3 - _C3 */ 0x20ae, /* c4 - _C4 */ 0x20af, /* c5 - _C5 */ 0x20b0, -/* c6 - _C6 */ 0xa238, -/* c7 - _C7 */ 0xa280, +/* c6 - _C6 */ 0xc238, +/* c7 - _C7 */ 0xc280, /* c8 - _C8 */ 0x20b1, /* c9 - _C9 */ 0x20b2, /* ca - _CA */ 0x20b3, @@ -1976,22 +1978,22 @@ _InstNode InstructionsTree[5688] = { /* cd - _CD */ 0x20b6, /* ce - _CE */ 0x20b7, /* cf - _CF */ 0x20b8, -/* d0 - _D0 */ 0x62c8, -/* d1 - _D1 */ 0x62d0, -/* d2 - _D2 */ 0x62d8, -/* d3 - _D3 */ 0x62e0, +/* d0 - _D0 */ 0x82c8, +/* d1 - _D1 */ 0x82d0, +/* d2 - _D2 */ 0x82d8, +/* d3 - _D3 */ 0x82e0, /* d4 - _D4 */ 0x20b9, /* d5 - _D5 */ 0x20ba, /* d6 - _D6 */ 0x20bb, /* d7 - _D7 */ 0x20bc, -/* d8 - _D8 */ 0xa2e8, -/* d9 - _D9 */ 0xa330, -/* da - _DA */ 0xa378, -/* db - _DB */ 0xa3c0, -/* dc - _DC */ 0xa408, -/* dd - _DD */ 0xa450, -/* de - _DE */ 0xa498, -/* df - _DF */ 0xa4e0, +/* d8 - _D8 */ 0xc2e8, +/* d9 - _D9 */ 0xc330, +/* da - _DA */ 0xc378, +/* db - _DB */ 0xc3c0, +/* dc - _DC */ 0xc408, +/* dd - _DD */ 0xc450, +/* de - _DE */ 0xc498, +/* df - _DF */ 0xc4e0, /* e0 - _E0 */ 0x20bd, /* e1 - _E1 */ 0x20be, /* e2 - _E2 */ 0x20bf, @@ -2014,18 +2016,18 @@ _InstNode InstructionsTree[5688] = { /* f3 - */ 0, /* f4 - _F4 */ 0x20cd, /* f5 - _F5 */ 0x20ce, -/* f6 - _F6 */ 0x6528, -/* f7 - _F7 */ 0x6530, +/* f6 - _F6 */ 0x8528, +/* f7 - _F7 */ 0x8530, /* f8 - _F8 */ 0x20cf, /* f9 - _F9 */ 0x20d0, /* fa - _FA */ 0x20d1, /* fb - _FB */ 0x20d2, /* fc - _FC */ 0x20d3, /* fd - _FD */ 0x20d4, -/* fe - _FE */ 0x6538, -/* ff - _FF */ 0x6540, -/* 100 - _0F_00 */ 0x6548, -/* 101 - _0F_01 */ 0xa550, +/* fe - _FE */ 0x8538, +/* ff - _FF */ 0x8540, +/* 100 - _0F_00 */ 0x8548, +/* 101 - _0F_01 */ 0xc550, /* 102 - _0F_02 */ 0x20d5, /* 103 - _0F_03 */ 0x20d6, /* 104 - */ 0, @@ -2037,18 +2039,18 @@ _InstNode InstructionsTree[5688] = { /* 10a - */ 0, /* 10b - _0F_0B */ 0x20dc, /* 10c - */ 0, -/* 10d - _0F_0D */ 0x6598, +/* 10d - _0F_0D */ 0x8598, /* 10e - _0F_0E */ 0x20dd, -/* 10f - _0F_0F */ 0x85a0, -/* 110 - _0F_10 */ 0xc6a0, -/* 111 - _0F_11 */ 0xc6ac, -/* 112 - _0F_12 */ 0xc6b8, -/* 113 - _0F_13 */ 0xc6c4, -/* 114 - _0F_14 */ 0xc6d0, -/* 115 - _0F_15 */ 0xc6dc, -/* 116 - _0F_16 */ 0xc6e8, -/* 117 - _0F_17 */ 0xc6f4, -/* 118 - _0F_18 */ 0x6700, +/* 10f - _0F_0F */ 0xa5a0, +/* 110 - _0F_10 */ 0xe6a0, +/* 111 - _0F_11 */ 0xe6ac, +/* 112 - _0F_12 */ 0xe6b8, +/* 113 - _0F_13 */ 0xe6c4, +/* 114 - _0F_14 */ 0xe6d0, +/* 115 - _0F_15 */ 0xe6dc, +/* 116 - _0F_16 */ 0xe6e8, +/* 117 - _0F_17 */ 0xe6f4, +/* 118 - _0F_18 */ 0x8700, /* 119 - */ 0, /* 11a - */ 0, /* 11b - */ 0, @@ -2064,14 +2066,14 @@ _InstNode InstructionsTree[5688] = { /* 125 - */ 0, /* 126 - */ 0, /* 127 - */ 0, -/* 128 - _0F_28 */ 0xc708, -/* 129 - _0F_29 */ 0xc714, -/* 12a - _0F_2A */ 0xc720, -/* 12b - _0F_2B */ 0xc72c, -/* 12c - _0F_2C */ 0xc738, -/* 12d - _0F_2D */ 0xc744, -/* 12e - _0F_2E */ 0xc750, -/* 12f - _0F_2F */ 0xc75c, +/* 128 - _0F_28 */ 0xe708, +/* 129 - _0F_29 */ 0xe714, +/* 12a - _0F_2A */ 0xe720, +/* 12b - _0F_2B */ 0xe72c, +/* 12c - _0F_2C */ 0xe738, +/* 12d - _0F_2D */ 0xe744, +/* 12e - _0F_2E */ 0xe750, +/* 12f - _0F_2F */ 0xe75c, /* 130 - _0F_30 */ 0x20e3, /* 131 - _0F_31 */ 0x20e4, /* 132 - _0F_32 */ 0x20e5, @@ -2080,9 +2082,9 @@ _InstNode InstructionsTree[5688] = { /* 135 - _0F_35 */ 0x20e8, /* 136 - */ 0, /* 137 - _0F_37 */ 0x20e9, -/* 138 - _0F_38 */ 0x8768, +/* 138 - _0F_38 */ 0xa768, /* 139 - */ 0, -/* 13a - _0F_3A */ 0x8868, +/* 13a - _0F_3A */ 0xa868, /* 13b - */ 0, /* 13c - */ 0, /* 13d - */ 0, @@ -2104,54 +2106,54 @@ _InstNode InstructionsTree[5688] = { /* 14d - _0F_4D */ 0x20f7, /* 14e - _0F_4E */ 0x20f8, /* 14f - _0F_4F */ 0x20f9, -/* 150 - _0F_50 */ 0xc968, -/* 151 - _0F_51 */ 0xc974, -/* 152 - _0F_52 */ 0xc980, -/* 153 - _0F_53 */ 0xc98c, -/* 154 - _0F_54 */ 0xc998, -/* 155 - _0F_55 */ 0xc9a4, -/* 156 - _0F_56 */ 0xc9b0, -/* 157 - _0F_57 */ 0xc9bc, -/* 158 - _0F_58 */ 0xc9c8, -/* 159 - _0F_59 */ 0xc9d4, -/* 15a - _0F_5A */ 0xc9e0, -/* 15b - _0F_5B */ 0xc9ec, -/* 15c - _0F_5C */ 0xc9f8, -/* 15d - _0F_5D */ 0xca04, -/* 15e - _0F_5E */ 0xca10, -/* 15f - _0F_5F */ 0xca1c, -/* 160 - _0F_60 */ 0xca28, -/* 161 - _0F_61 */ 0xca34, -/* 162 - _0F_62 */ 0xca40, -/* 163 - _0F_63 */ 0xca4c, -/* 164 - _0F_64 */ 0xca58, -/* 165 - _0F_65 */ 0xca64, -/* 166 - _0F_66 */ 0xca70, -/* 167 - _0F_67 */ 0xca7c, -/* 168 - _0F_68 */ 0xca88, -/* 169 - _0F_69 */ 0xca94, -/* 16a - _0F_6A */ 0xcaa0, -/* 16b - _0F_6B */ 0xcaac, -/* 16c - _0F_6C */ 0xcab8, -/* 16d - _0F_6D */ 0xcac4, -/* 16e - _0F_6E */ 0xcad0, -/* 16f - _0F_6F */ 0xcadc, -/* 170 - _0F_70 */ 0xcae8, -/* 171 - _0F_71 */ 0x6af4, -/* 172 - _0F_72 */ 0x6afc, -/* 173 - _0F_73 */ 0x6b04, -/* 174 - _0F_74 */ 0xcb0c, -/* 175 - _0F_75 */ 0xcb18, -/* 176 - _0F_76 */ 0xcb24, -/* 177 - _0F_77 */ 0xcb30, -/* 178 - _0F_78 */ 0xcb3c, -/* 179 - _0F_79 */ 0xcb48, -/* 17a - _0F_7A */ 0x8b54, +/* 150 - _0F_50 */ 0xe968, +/* 151 - _0F_51 */ 0xe974, +/* 152 - _0F_52 */ 0xe980, +/* 153 - _0F_53 */ 0xe98c, +/* 154 - _0F_54 */ 0xe998, +/* 155 - _0F_55 */ 0xe9a4, +/* 156 - _0F_56 */ 0xe9b0, +/* 157 - _0F_57 */ 0xe9bc, +/* 158 - _0F_58 */ 0xe9c8, +/* 159 - _0F_59 */ 0xe9d4, +/* 15a - _0F_5A */ 0xe9e0, +/* 15b - _0F_5B */ 0xe9ec, +/* 15c - _0F_5C */ 0xe9f8, +/* 15d - _0F_5D */ 0xea04, +/* 15e - _0F_5E */ 0xea10, +/* 15f - _0F_5F */ 0xea1c, +/* 160 - _0F_60 */ 0xea28, +/* 161 - _0F_61 */ 0xea34, +/* 162 - _0F_62 */ 0xea40, +/* 163 - _0F_63 */ 0xea4c, +/* 164 - _0F_64 */ 0xea58, +/* 165 - _0F_65 */ 0xea64, +/* 166 - _0F_66 */ 0xea70, +/* 167 - _0F_67 */ 0xea7c, +/* 168 - _0F_68 */ 0xea88, +/* 169 - _0F_69 */ 0xea94, +/* 16a - _0F_6A */ 0xeaa0, +/* 16b - _0F_6B */ 0xeaac, +/* 16c - _0F_6C */ 0xeab8, +/* 16d - _0F_6D */ 0xeac4, +/* 16e - _0F_6E */ 0xead0, +/* 16f - _0F_6F */ 0xeadc, +/* 170 - _0F_70 */ 0xeae8, +/* 171 - _0F_71 */ 0x8af4, +/* 172 - _0F_72 */ 0x8afc, +/* 173 - _0F_73 */ 0x8b04, +/* 174 - _0F_74 */ 0xeb0c, +/* 175 - _0F_75 */ 0xeb18, +/* 176 - _0F_76 */ 0xeb24, +/* 177 - _0F_77 */ 0xeb30, +/* 178 - _0F_78 */ 0xeb3c, +/* 179 - _0F_79 */ 0xeb48, +/* 17a - _0F_7A */ 0xab54, /* 17b - */ 0, -/* 17c - _0F_7C */ 0xcc54, -/* 17d - _0F_7D */ 0xcc60, -/* 17e - _0F_7E */ 0xcc6c, -/* 17f - _0F_7F */ 0xcc78, +/* 17c - _0F_7C */ 0xec54, +/* 17d - _0F_7D */ 0xec60, +/* 17e - _0F_7E */ 0xec6c, +/* 17f - _0F_7F */ 0xec78, /* 180 - _0F_80 */ 0x20fa, /* 181 - _0F_81 */ 0x20fb, /* 182 - _0F_82 */ 0x20fc, @@ -2198,7 +2200,7 @@ _InstNode InstructionsTree[5688] = { /* 1ab - _0F_AB */ 0x2121, /* 1ac - _0F_AC */ 0x4007, /* 1ad - _0F_AD */ 0x4008, -/* 1ae - _0F_AE */ 0x6c84, +/* 1ae - _0F_AE */ 0x8c84, /* 1af - _0F_AF */ 0x2122, /* 1b0 - _0F_B0 */ 0x2123, /* 1b1 - _0F_B1 */ 0x2124, @@ -2208,22 +2210,22 @@ _InstNode InstructionsTree[5688] = { /* 1b5 - _0F_B5 */ 0x2128, /* 1b6 - _0F_B6 */ 0x2129, /* 1b7 - _0F_B7 */ 0x212a, -/* 1b8 - _0F_B8 */ 0xcc8c, +/* 1b8 - _0F_B8 */ 0xec8c, /* 1b9 - _0F_B9 */ 0x212b, -/* 1ba - _0F_BA */ 0x6c98, +/* 1ba - _0F_BA */ 0x8c98, /* 1bb - _0F_BB */ 0x212c, -/* 1bc - _0F_BC */ 0xcca0, -/* 1bd - _0F_BD */ 0xccac, +/* 1bc - _0F_BC */ 0xeca0, +/* 1bd - _0F_BD */ 0xecac, /* 1be - _0F_BE */ 0x212d, /* 1bf - _0F_BF */ 0x212e, /* 1c0 - _0F_C0 */ 0x212f, /* 1c1 - _0F_C1 */ 0x2130, -/* 1c2 - _0F_C2 */ 0xccb8, +/* 1c2 - _0F_C2 */ 0xecb8, /* 1c3 - _0F_C3 */ 0x2131, -/* 1c4 - _0F_C4 */ 0xccc4, -/* 1c5 - _0F_C5 */ 0xccd0, -/* 1c6 - _0F_C6 */ 0xccdc, -/* 1c7 - _0F_C7 */ 0x6ce8, +/* 1c4 - _0F_C4 */ 0xecc4, +/* 1c5 - _0F_C5 */ 0xecd0, +/* 1c6 - _0F_C6 */ 0xecdc, +/* 1c7 - _0F_C7 */ 0x8ce8, /* 1c8 - _0F_C8 */ 0x2132, /* 1c9 - _0F_C8 */ 0x2133, /* 1ca - _0F_C8 */ 0x2134, @@ -2232,53 +2234,53 @@ _InstNode InstructionsTree[5688] = { /* 1cd - _0F_C8 */ 0x2137, /* 1ce - _0F_C8 */ 0x2138, /* 1cf - _0F_C8 */ 0x2139, -/* 1d0 - _0F_D0 */ 0xccf0, -/* 1d1 - _0F_D1 */ 0xccfc, -/* 1d2 - _0F_D2 */ 0xcd08, -/* 1d3 - _0F_D3 */ 0xcd14, -/* 1d4 - _0F_D4 */ 0xcd20, -/* 1d5 - _0F_D5 */ 0xcd2c, -/* 1d6 - _0F_D6 */ 0xcd38, -/* 1d7 - _0F_D7 */ 0xcd44, -/* 1d8 - _0F_D8 */ 0xcd50, -/* 1d9 - _0F_D9 */ 0xcd5c, -/* 1da - _0F_DA */ 0xcd68, -/* 1db - _0F_DB */ 0xcd74, -/* 1dc - _0F_DC */ 0xcd80, -/* 1dd - _0F_DD */ 0xcd8c, -/* 1de - _0F_DE */ 0xcd98, -/* 1df - _0F_DF */ 0xcda4, -/* 1e0 - _0F_E0 */ 0xcdb0, -/* 1e1 - _0F_E1 */ 0xcdbc, -/* 1e2 - _0F_E2 */ 0xcdc8, -/* 1e3 - _0F_E3 */ 0xcdd4, -/* 1e4 - _0F_E4 */ 0xcde0, -/* 1e5 - _0F_E5 */ 0xcdec, -/* 1e6 - _0F_E6 */ 0xcdf8, -/* 1e7 - _0F_E7 */ 0xce04, -/* 1e8 - _0F_E8 */ 0xce10, -/* 1e9 - _0F_E9 */ 0xce1c, -/* 1ea - _0F_EA */ 0xce28, -/* 1eb - _0F_EB */ 0xce34, -/* 1ec - _0F_EC */ 0xce40, -/* 1ed - _0F_ED */ 0xce4c, -/* 1ee - _0F_EE */ 0xce58, -/* 1ef - _0F_EF */ 0xce64, -/* 1f0 - _0F_F0 */ 0xce70, -/* 1f1 - _0F_F1 */ 0xce7c, -/* 1f2 - _0F_F2 */ 0xce88, -/* 1f3 - _0F_F3 */ 0xce94, -/* 1f4 - _0F_F4 */ 0xcea0, -/* 1f5 - _0F_F5 */ 0xceac, -/* 1f6 - _0F_F6 */ 0xceb8, -/* 1f7 - _0F_F7 */ 0xcec4, -/* 1f8 - _0F_F8 */ 0xced0, -/* 1f9 - _0F_F9 */ 0xcedc, -/* 1fa - _0F_FA */ 0xcee8, -/* 1fb - _0F_FB */ 0xcef4, -/* 1fc - _0F_FC */ 0xcf00, -/* 1fd - _0F_FD */ 0xcf0c, -/* 1fe - _0F_FE */ 0xcf18, +/* 1d0 - _0F_D0 */ 0xecf0, +/* 1d1 - _0F_D1 */ 0xecfc, +/* 1d2 - _0F_D2 */ 0xed08, +/* 1d3 - _0F_D3 */ 0xed14, +/* 1d4 - _0F_D4 */ 0xed20, +/* 1d5 - _0F_D5 */ 0xed2c, +/* 1d6 - _0F_D6 */ 0xed38, +/* 1d7 - _0F_D7 */ 0xed44, +/* 1d8 - _0F_D8 */ 0xed50, +/* 1d9 - _0F_D9 */ 0xed5c, +/* 1da - _0F_DA */ 0xed68, +/* 1db - _0F_DB */ 0xed74, +/* 1dc - _0F_DC */ 0xed80, +/* 1dd - _0F_DD */ 0xed8c, +/* 1de - _0F_DE */ 0xed98, +/* 1df - _0F_DF */ 0xeda4, +/* 1e0 - _0F_E0 */ 0xedb0, +/* 1e1 - _0F_E1 */ 0xedbc, +/* 1e2 - _0F_E2 */ 0xedc8, +/* 1e3 - _0F_E3 */ 0xedd4, +/* 1e4 - _0F_E4 */ 0xede0, +/* 1e5 - _0F_E5 */ 0xedec, +/* 1e6 - _0F_E6 */ 0xedf8, +/* 1e7 - _0F_E7 */ 0xee04, +/* 1e8 - _0F_E8 */ 0xee10, +/* 1e9 - _0F_E9 */ 0xee1c, +/* 1ea - _0F_EA */ 0xee28, +/* 1eb - _0F_EB */ 0xee34, +/* 1ec - _0F_EC */ 0xee40, +/* 1ed - _0F_ED */ 0xee4c, +/* 1ee - _0F_EE */ 0xee58, +/* 1ef - _0F_EF */ 0xee64, +/* 1f0 - _0F_F0 */ 0xee70, +/* 1f1 - _0F_F1 */ 0xee7c, +/* 1f2 - _0F_F2 */ 0xee88, +/* 1f3 - _0F_F3 */ 0xee94, +/* 1f4 - _0F_F4 */ 0xeea0, +/* 1f5 - _0F_F5 */ 0xeeac, +/* 1f6 - _0F_F6 */ 0xeeb8, +/* 1f7 - _0F_F7 */ 0xeec4, +/* 1f8 - _0F_F8 */ 0xeed0, +/* 1f9 - _0F_F9 */ 0xeedc, +/* 1fa - _0F_FA */ 0xeee8, +/* 1fb - _0F_FB */ 0xeef4, +/* 1fc - _0F_FC */ 0xef00, +/* 1fd - _0F_FD */ 0xef0c, +/* 1fe - _0F_FE */ 0xef18, /* 1ff - */ 0, /* 200 - _80_00 */ 0x213a, /* 201 - _80_01 */ 0x213b, @@ -2590,8 +2592,8 @@ _InstNode InstructionsTree[5688] = { /* 333 - _D9_03 */ 0x21d9, /* 334 - _D9_04 */ 0x21da, /* 335 - _D9_05 */ 0x21db, -/* 336 - _D9_06 */ 0xcf24, -/* 337 - _D9_07 */ 0xcf30, +/* 336 - _D9_06 */ 0xef24, +/* 337 - _D9_07 */ 0xef30, /* 338 - _D9_C0 */ 0x21dc, /* 339 - _D9_C0 */ 0x21dd, /* 33a - _D9_C0 */ 0x21de, @@ -2770,8 +2772,8 @@ _InstNode InstructionsTree[5688] = { /* 3e7 - _DB_D8 */ 0x2256, /* 3e8 - _DB_E0 */ 0x2257, /* 3e9 - _DB_E1 */ 0x2258, -/* 3ea - _DB_E2 */ 0xcf3c, -/* 3eb - _DB_E3 */ 0xcf48, +/* 3ea - _DB_E2 */ 0xef3c, +/* 3eb - _DB_E3 */ 0xef48, /* 3ec - _DB_E4 */ 0x2259, /* 3ed - */ 0, /* 3ee - */ 0, @@ -2878,8 +2880,8 @@ _InstNode InstructionsTree[5688] = { /* 453 - _DD_03 */ 0x22a5, /* 454 - _DD_04 */ 0x22a6, /* 455 - */ 0, -/* 456 - _DD_06 */ 0xcf54, -/* 457 - _DD_07 */ 0xcf60, +/* 456 - _DD_06 */ 0xef54, +/* 457 - _DD_07 */ 0xef60, /* 458 - _DD_C0 */ 0x22a7, /* 459 - _DD_C0 */ 0x22a8, /* 45a - _DD_C0 */ 0x22a9, @@ -3056,7 +3058,7 @@ _InstNode InstructionsTree[5688] = { /* 505 - */ 0, /* 506 - */ 0, /* 507 - */ 0, -/* 508 - _DF_E0 */ 0xcf6c, +/* 508 - _DF_E0 */ 0xef6c, /* 509 - */ 0, /* 50a - */ 0, /* 50b - */ 0, @@ -3146,28 +3148,28 @@ _InstNode InstructionsTree[5688] = { /* 55f - */ 0, /* 560 - _0F_01_C8 */ 0x2348, /* 561 - _0F_01_C9 */ 0x2349, -/* 562 - */ 0, -/* 563 - */ 0, +/* 562 - _0F_01_CA */ 0x234a, +/* 563 - _0F_01_CB */ 0x234b, /* 564 - */ 0, /* 565 - */ 0, /* 566 - */ 0, /* 567 - */ 0, -/* 568 - _0F_01_D0 */ 0x234a, -/* 569 - _0F_01_D1 */ 0x234b, +/* 568 - _0F_01_D0 */ 0x234c, +/* 569 - _0F_01_D1 */ 0x234d, /* 56a - */ 0, /* 56b - */ 0, -/* 56c - _0F_01_D4 */ 0x234c, -/* 56d - _0F_01_D5 */ 0x234d, +/* 56c - _0F_01_D4 */ 0x234e, +/* 56d - _0F_01_D5 */ 0x234f, /* 56e - */ 0, /* 56f - */ 0, -/* 570 - _0F_01_D8 */ 0x234e, -/* 571 - _0F_01_D9 */ 0x234f, -/* 572 - _0F_01_DA */ 0x2350, -/* 573 - _0F_01_DB */ 0x2351, -/* 574 - _0F_01_DC */ 0x2352, -/* 575 - _0F_01_DD */ 0x2353, -/* 576 - _0F_01_DE */ 0x2354, -/* 577 - _0F_01_DF */ 0x2355, +/* 570 - _0F_01_D8 */ 0x2350, +/* 571 - _0F_01_D9 */ 0x2351, +/* 572 - _0F_01_DA */ 0x2352, +/* 573 - _0F_01_DB */ 0x2353, +/* 574 - _0F_01_DC */ 0x2354, +/* 575 - _0F_01_DD */ 0x2355, +/* 576 - _0F_01_DE */ 0x2356, +/* 577 - _0F_01_DF */ 0x2357, /* 578 - */ 0, /* 579 - */ 0, /* 57a - */ 0, @@ -3192,16 +3194,16 @@ _InstNode InstructionsTree[5688] = { /* 58d - */ 0, /* 58e - */ 0, /* 58f - */ 0, -/* 590 - _0F_01_F8 */ 0x2356, -/* 591 - _0F_01_F9 */ 0x2357, +/* 590 - _0F_01_F8 */ 0x2358, +/* 591 - _0F_01_F9 */ 0x2359, /* 592 - */ 0, /* 593 - */ 0, /* 594 - */ 0, /* 595 - */ 0, /* 596 - */ 0, /* 597 - */ 0, -/* 598 - _0F_0D_00 */ 0x2358, -/* 599 - _0F_0D_01 */ 0x2359, +/* 598 - _0F_0D_00 */ 0x235a, +/* 599 - _0F_0D_01 */ 0x235b, /* 59a - */ 0, /* 59b - */ 0, /* 59c - */ 0, @@ -3220,8 +3222,8 @@ _InstNode InstructionsTree[5688] = { /* 5a9 - */ 0, /* 5aa - */ 0, /* 5ab - */ 0, -/* 5ac - _0F_0F_0C */ 0x235a, -/* 5ad - _0F_0F_0D */ 0x235b, +/* 5ac - _0F_0F_0C */ 0x235c, +/* 5ad - _0F_0F_0D */ 0x235d, /* 5ae - */ 0, /* 5af - */ 0, /* 5b0 - */ 0, @@ -3236,8 +3238,8 @@ _InstNode InstructionsTree[5688] = { /* 5b9 - */ 0, /* 5ba - */ 0, /* 5bb - */ 0, -/* 5bc - _0F_0F_1C */ 0x235c, -/* 5bd - _0F_0F_1D */ 0x235d, +/* 5bc - _0F_0F_1C */ 0x235e, +/* 5bd - _0F_0F_1D */ 0x235f, /* 5be - */ 0, /* 5bf - */ 0, /* 5c0 - */ 0, @@ -3346,60 +3348,60 @@ _InstNode InstructionsTree[5688] = { /* 627 - */ 0, /* 628 - */ 0, /* 629 - */ 0, -/* 62a - _0F_0F_8A */ 0x235e, +/* 62a - _0F_0F_8A */ 0x2360, /* 62b - */ 0, /* 62c - */ 0, /* 62d - */ 0, -/* 62e - _0F_0F_8E */ 0x235f, +/* 62e - _0F_0F_8E */ 0x2361, /* 62f - */ 0, -/* 630 - _0F_0F_90 */ 0x2360, +/* 630 - _0F_0F_90 */ 0x2362, /* 631 - */ 0, /* 632 - */ 0, /* 633 - */ 0, -/* 634 - _0F_0F_94 */ 0x2361, +/* 634 - _0F_0F_94 */ 0x2363, /* 635 - */ 0, -/* 636 - _0F_0F_96 */ 0x2362, -/* 637 - _0F_0F_97 */ 0x2363, +/* 636 - _0F_0F_96 */ 0x2364, +/* 637 - _0F_0F_97 */ 0x2365, /* 638 - */ 0, /* 639 - */ 0, -/* 63a - _0F_0F_9A */ 0x2364, +/* 63a - _0F_0F_9A */ 0x2366, /* 63b - */ 0, /* 63c - */ 0, /* 63d - */ 0, -/* 63e - _0F_0F_9E */ 0x2365, +/* 63e - _0F_0F_9E */ 0x2367, /* 63f - */ 0, -/* 640 - _0F_0F_A0 */ 0x2366, +/* 640 - _0F_0F_A0 */ 0x2368, /* 641 - */ 0, /* 642 - */ 0, /* 643 - */ 0, -/* 644 - _0F_0F_A4 */ 0x2367, +/* 644 - _0F_0F_A4 */ 0x2369, /* 645 - */ 0, -/* 646 - _0F_0F_A6 */ 0x2368, -/* 647 - _0F_0F_A7 */ 0x2369, +/* 646 - _0F_0F_A6 */ 0x236a, +/* 647 - _0F_0F_A7 */ 0x236b, /* 648 - */ 0, /* 649 - */ 0, -/* 64a - _0F_0F_AA */ 0x236a, +/* 64a - _0F_0F_AA */ 0x236c, /* 64b - */ 0, /* 64c - */ 0, /* 64d - */ 0, -/* 64e - _0F_0F_AE */ 0x236b, +/* 64e - _0F_0F_AE */ 0x236d, /* 64f - */ 0, -/* 650 - _0F_0F_B0 */ 0x236c, +/* 650 - _0F_0F_B0 */ 0x236e, /* 651 - */ 0, /* 652 - */ 0, /* 653 - */ 0, -/* 654 - _0F_0F_B4 */ 0x236d, +/* 654 - _0F_0F_B4 */ 0x236f, /* 655 - */ 0, -/* 656 - _0F_0F_B6 */ 0x236e, -/* 657 - _0F_0F_B7 */ 0x236f, +/* 656 - _0F_0F_B6 */ 0x2370, +/* 657 - _0F_0F_B7 */ 0x2371, /* 658 - */ 0, /* 659 - */ 0, /* 65a - */ 0, -/* 65b - _0F_0F_BB */ 0x2370, +/* 65b - _0F_0F_BB */ 0x2372, /* 65c - */ 0, /* 65d - */ 0, /* 65e - */ 0, -/* 65f - _0F_0F_BF */ 0x2371, +/* 65f - _0F_0F_BF */ 0x2373, /* 660 - */ 0, /* 661 - */ 0, /* 662 - */ 0, @@ -3464,10 +3466,10 @@ _InstNode InstructionsTree[5688] = { /* 69d - */ 0, /* 69e - */ 0, /* 69f - */ 0, -/* 6a0 - _0F_10 */ 0x2372, -/* 6a1 - _66_0F_10 */ 0x2373, -/* 6a2 - _F3_0F_10 */ 0x2374, -/* 6a3 - _F2_0F_10 */ 0x2375, +/* 6a0 - _0F_10 */ 0x2374, +/* 6a1 - _66_0F_10 */ 0x2375, +/* 6a2 - _F3_0F_10 */ 0x2376, +/* 6a3 - _F2_0F_10 */ 0x2377, /* 6a4 - _V_0F_10 */ 0x4009, /* 6a5 - _V_66_0F_10 */ 0x400a, /* 6a6 - _V_F3_0F_10 */ 0x400b, @@ -3476,10 +3478,10 @@ _InstNode InstructionsTree[5688] = { /* 6a9 - */ 0, /* 6aa - _VRR_F3_0F_10 */ 0x400d, /* 6ab - _VRR_F2_0F_10 */ 0x400e, -/* 6ac - _0F_11 */ 0x2376, -/* 6ad - _66_0F_11 */ 0x2377, -/* 6ae - _F3_0F_11 */ 0x2378, -/* 6af - _F2_0F_11 */ 0x2379, +/* 6ac - _0F_11 */ 0x2378, +/* 6ad - _66_0F_11 */ 0x2379, +/* 6ae - _F3_0F_11 */ 0x237a, +/* 6af - _F2_0F_11 */ 0x237b, /* 6b0 - _V_0F_11 */ 0x400f, /* 6b1 - _V_66_0F_11 */ 0x4010, /* 6b2 - _V_F3_0F_11 */ 0x4011, @@ -3489,9 +3491,9 @@ _InstNode InstructionsTree[5688] = { /* 6b6 - _VRR_F3_0F_11 */ 0x4013, /* 6b7 - _VRR_F2_0F_11 */ 0x4014, /* 6b8 - _0F_12 */ 0x4015, -/* 6b9 - _66_0F_12 */ 0x237a, -/* 6ba - _F3_0F_12 */ 0x237b, -/* 6bb - _F2_0F_12 */ 0x237c, +/* 6b9 - _66_0F_12 */ 0x237c, +/* 6ba - _F3_0F_12 */ 0x237d, +/* 6bb - _F2_0F_12 */ 0x237e, /* 6bc - _V_0F_12 */ 0x4016, /* 6bd - _V_66_0F_12 */ 0x4017, /* 6be - _V_F3_0F_12 */ 0x4018, @@ -3500,8 +3502,8 @@ _InstNode InstructionsTree[5688] = { /* 6c1 - */ 0, /* 6c2 - */ 0, /* 6c3 - */ 0, -/* 6c4 - _0F_13 */ 0x237d, -/* 6c5 - _66_0F_13 */ 0x237e, +/* 6c4 - _0F_13 */ 0x237f, +/* 6c5 - _66_0F_13 */ 0x2380, /* 6c6 - */ 0, /* 6c7 - */ 0, /* 6c8 - _V_0F_13 */ 0x401a, @@ -3512,8 +3514,8 @@ _InstNode InstructionsTree[5688] = { /* 6cd - */ 0, /* 6ce - */ 0, /* 6cf - */ 0, -/* 6d0 - _0F_14 */ 0x237f, -/* 6d1 - _66_0F_14 */ 0x2380, +/* 6d0 - _0F_14 */ 0x2381, +/* 6d1 - _66_0F_14 */ 0x2382, /* 6d2 - */ 0, /* 6d3 - */ 0, /* 6d4 - _V_0F_14 */ 0x401c, @@ -3524,8 +3526,8 @@ _InstNode InstructionsTree[5688] = { /* 6d9 - */ 0, /* 6da - */ 0, /* 6db - */ 0, -/* 6dc - _0F_15 */ 0x2381, -/* 6dd - _66_0F_15 */ 0x2382, +/* 6dc - _0F_15 */ 0x2383, +/* 6dd - _66_0F_15 */ 0x2384, /* 6de - */ 0, /* 6df - */ 0, /* 6e0 - _V_0F_15 */ 0x401e, @@ -3537,8 +3539,8 @@ _InstNode InstructionsTree[5688] = { /* 6e6 - */ 0, /* 6e7 - */ 0, /* 6e8 - _0F_16 */ 0x4020, -/* 6e9 - _66_0F_16 */ 0x2383, -/* 6ea - _F3_0F_16 */ 0x2384, +/* 6e9 - _66_0F_16 */ 0x2385, +/* 6ea - _F3_0F_16 */ 0x2386, /* 6eb - */ 0, /* 6ec - _V_0F_16 */ 0x4021, /* 6ed - _V_66_0F_16 */ 0x4022, @@ -3548,8 +3550,8 @@ _InstNode InstructionsTree[5688] = { /* 6f1 - */ 0, /* 6f2 - */ 0, /* 6f3 - */ 0, -/* 6f4 - _0F_17 */ 0x2385, -/* 6f5 - _66_0F_17 */ 0x2386, +/* 6f4 - _0F_17 */ 0x2387, +/* 6f5 - _66_0F_17 */ 0x2388, /* 6f6 - */ 0, /* 6f7 - */ 0, /* 6f8 - _V_0F_17 */ 0x4024, @@ -3560,16 +3562,16 @@ _InstNode InstructionsTree[5688] = { /* 6fd - */ 0, /* 6fe - */ 0, /* 6ff - */ 0, -/* 700 - _0F_18_00 */ 0x2387, -/* 701 - _0F_18_01 */ 0x2388, -/* 702 - _0F_18_02 */ 0x2389, -/* 703 - _0F_18_03 */ 0x238a, +/* 700 - _0F_18_00 */ 0x2389, +/* 701 - _0F_18_01 */ 0x238a, +/* 702 - _0F_18_02 */ 0x238b, +/* 703 - _0F_18_03 */ 0x238c, /* 704 - */ 0, /* 705 - */ 0, /* 706 - */ 0, /* 707 - */ 0, -/* 708 - _0F_28 */ 0x238b, -/* 709 - _66_0F_28 */ 0x238c, +/* 708 - _0F_28 */ 0x238d, +/* 709 - _66_0F_28 */ 0x238e, /* 70a - */ 0, /* 70b - */ 0, /* 70c - _V_0F_28 */ 0x4026, @@ -3580,8 +3582,8 @@ _InstNode InstructionsTree[5688] = { /* 711 - */ 0, /* 712 - */ 0, /* 713 - */ 0, -/* 714 - _0F_29 */ 0x238d, -/* 715 - _66_0F_29 */ 0x238e, +/* 714 - _0F_29 */ 0x238f, +/* 715 - _66_0F_29 */ 0x2390, /* 716 - */ 0, /* 717 - */ 0, /* 718 - _V_0F_29 */ 0x4028, @@ -3592,10 +3594,10 @@ _InstNode InstructionsTree[5688] = { /* 71d - */ 0, /* 71e - */ 0, /* 71f - */ 0, -/* 720 - _0F_2A */ 0x238f, -/* 721 - _66_0F_2A */ 0x2390, -/* 722 - _F3_0F_2A */ 0x2391, -/* 723 - _F2_0F_2A */ 0x2392, +/* 720 - _0F_2A */ 0x2391, +/* 721 - _66_0F_2A */ 0x2392, +/* 722 - _F3_0F_2A */ 0x2393, +/* 723 - _F2_0F_2A */ 0x2394, /* 724 - */ 0, /* 725 - */ 0, /* 726 - _V_F3_0F_2A */ 0x402a, @@ -3604,10 +3606,10 @@ _InstNode InstructionsTree[5688] = { /* 729 - */ 0, /* 72a - */ 0, /* 72b - */ 0, -/* 72c - _0F_2B */ 0x2393, -/* 72d - _66_0F_2B */ 0x2394, -/* 72e - _F3_0F_2B */ 0x2395, -/* 72f - _F2_0F_2B */ 0x2396, +/* 72c - _0F_2B */ 0x2395, +/* 72d - _66_0F_2B */ 0x2396, +/* 72e - _F3_0F_2B */ 0x2397, +/* 72f - _F2_0F_2B */ 0x2398, /* 730 - _V_0F_2B */ 0x402c, /* 731 - _V_66_0F_2B */ 0x402d, /* 732 - */ 0, @@ -3616,10 +3618,10 @@ _InstNode InstructionsTree[5688] = { /* 735 - */ 0, /* 736 - */ 0, /* 737 - */ 0, -/* 738 - _0F_2C */ 0x2397, -/* 739 - _66_0F_2C */ 0x2398, -/* 73a - _F3_0F_2C */ 0x2399, -/* 73b - _F2_0F_2C */ 0x239a, +/* 738 - _0F_2C */ 0x2399, +/* 739 - _66_0F_2C */ 0x239a, +/* 73a - _F3_0F_2C */ 0x239b, +/* 73b - _F2_0F_2C */ 0x239c, /* 73c - */ 0, /* 73d - */ 0, /* 73e - _V_F3_0F_2C */ 0x402e, @@ -3628,10 +3630,10 @@ _InstNode InstructionsTree[5688] = { /* 741 - */ 0, /* 742 - */ 0, /* 743 - */ 0, -/* 744 - _0F_2D */ 0x239b, -/* 745 - _66_0F_2D */ 0x239c, -/* 746 - _F3_0F_2D */ 0x239d, -/* 747 - _F2_0F_2D */ 0x239e, +/* 744 - _0F_2D */ 0x239d, +/* 745 - _66_0F_2D */ 0x239e, +/* 746 - _F3_0F_2D */ 0x239f, +/* 747 - _F2_0F_2D */ 0x23a0, /* 748 - */ 0, /* 749 - */ 0, /* 74a - _V_F3_0F_2D */ 0x4030, @@ -3640,8 +3642,8 @@ _InstNode InstructionsTree[5688] = { /* 74d - */ 0, /* 74e - */ 0, /* 74f - */ 0, -/* 750 - _0F_2E */ 0x239f, -/* 751 - _66_0F_2E */ 0x23a0, +/* 750 - _0F_2E */ 0x23a1, +/* 751 - _66_0F_2E */ 0x23a2, /* 752 - */ 0, /* 753 - */ 0, /* 754 - _V_0F_2E */ 0x4032, @@ -3652,8 +3654,8 @@ _InstNode InstructionsTree[5688] = { /* 759 - */ 0, /* 75a - */ 0, /* 75b - */ 0, -/* 75c - _0F_2F */ 0x23a1, -/* 75d - _66_0F_2F */ 0x23a2, +/* 75c - _0F_2F */ 0x23a3, +/* 75d - _66_0F_2F */ 0x23a4, /* 75e - */ 0, /* 75f - */ 0, /* 760 - _V_0F_2F */ 0x4034, @@ -3664,72 +3666,72 @@ _InstNode InstructionsTree[5688] = { /* 765 - */ 0, /* 766 - */ 0, /* 767 - */ 0, -/* 768 - _0F_38_00 */ 0xcf78, -/* 769 - _0F_38_01 */ 0xcf84, -/* 76a - _0F_38_02 */ 0xcf90, -/* 76b - _0F_38_03 */ 0xcf9c, -/* 76c - _0F_38_04 */ 0xcfa8, -/* 76d - _0F_38_05 */ 0xcfb4, -/* 76e - _0F_38_06 */ 0xcfc0, -/* 76f - _0F_38_07 */ 0xcfcc, -/* 770 - _0F_38_08 */ 0xcfd8, -/* 771 - _0F_38_09 */ 0xcfe4, -/* 772 - _0F_38_0A */ 0xcff0, -/* 773 - _0F_38_0B */ 0xcffc, -/* 774 - _0F_38_0C */ 0xd008, -/* 775 - _0F_38_0D */ 0xd014, -/* 776 - _0F_38_0E */ 0xd020, -/* 777 - _0F_38_0F */ 0xd02c, -/* 778 - _0F_38_10 */ 0xd038, +/* 768 - _0F_38_00 */ 0xef78, +/* 769 - _0F_38_01 */ 0xef84, +/* 76a - _0F_38_02 */ 0xef90, +/* 76b - _0F_38_03 */ 0xef9c, +/* 76c - _0F_38_04 */ 0xefa8, +/* 76d - _0F_38_05 */ 0xefb4, +/* 76e - _0F_38_06 */ 0xefc0, +/* 76f - _0F_38_07 */ 0xefcc, +/* 770 - _0F_38_08 */ 0xefd8, +/* 771 - _0F_38_09 */ 0xefe4, +/* 772 - _0F_38_0A */ 0xeff0, +/* 773 - _0F_38_0B */ 0xeffc, +/* 774 - _0F_38_0C */ 0xf008, +/* 775 - _0F_38_0D */ 0xf014, +/* 776 - _0F_38_0E */ 0xf020, +/* 777 - _0F_38_0F */ 0xf02c, +/* 778 - _0F_38_10 */ 0xf038, /* 779 - */ 0, /* 77a - */ 0, /* 77b - */ 0, -/* 77c - _0F_38_14 */ 0xd044, -/* 77d - _0F_38_15 */ 0xd050, +/* 77c - _0F_38_14 */ 0xf044, +/* 77d - _0F_38_15 */ 0xf050, /* 77e - */ 0, -/* 77f - _0F_38_17 */ 0xd05c, -/* 780 - _0F_38_18 */ 0xd068, -/* 781 - _0F_38_19 */ 0xd074, -/* 782 - _0F_38_1A */ 0xd080, +/* 77f - _0F_38_17 */ 0xf05c, +/* 780 - _0F_38_18 */ 0xf068, +/* 781 - _0F_38_19 */ 0xf074, +/* 782 - _0F_38_1A */ 0xf080, /* 783 - */ 0, -/* 784 - _0F_38_1C */ 0xd08c, -/* 785 - _0F_38_1D */ 0xd098, -/* 786 - _0F_38_1E */ 0xd0a4, +/* 784 - _0F_38_1C */ 0xf08c, +/* 785 - _0F_38_1D */ 0xf098, +/* 786 - _0F_38_1E */ 0xf0a4, /* 787 - */ 0, -/* 788 - _0F_38_20 */ 0xd0b0, -/* 789 - _0F_38_21 */ 0xd0bc, -/* 78a - _0F_38_22 */ 0xd0c8, -/* 78b - _0F_38_23 */ 0xd0d4, -/* 78c - _0F_38_24 */ 0xd0e0, -/* 78d - _0F_38_25 */ 0xd0ec, +/* 788 - _0F_38_20 */ 0xf0b0, +/* 789 - _0F_38_21 */ 0xf0bc, +/* 78a - _0F_38_22 */ 0xf0c8, +/* 78b - _0F_38_23 */ 0xf0d4, +/* 78c - _0F_38_24 */ 0xf0e0, +/* 78d - _0F_38_25 */ 0xf0ec, /* 78e - */ 0, /* 78f - */ 0, -/* 790 - _0F_38_28 */ 0xd0f8, -/* 791 - _0F_38_29 */ 0xd104, -/* 792 - _0F_38_2A */ 0xd110, -/* 793 - _0F_38_2B */ 0xd11c, -/* 794 - _0F_38_2C */ 0xd128, -/* 795 - _0F_38_2D */ 0xd134, -/* 796 - _0F_38_2E */ 0xd140, -/* 797 - _0F_38_2F */ 0xd14c, -/* 798 - _0F_38_30 */ 0xd158, -/* 799 - _0F_38_31 */ 0xd164, -/* 79a - _0F_38_32 */ 0xd170, -/* 79b - _0F_38_33 */ 0xd17c, -/* 79c - _0F_38_34 */ 0xd188, -/* 79d - _0F_38_35 */ 0xd194, +/* 790 - _0F_38_28 */ 0xf0f8, +/* 791 - _0F_38_29 */ 0xf104, +/* 792 - _0F_38_2A */ 0xf110, +/* 793 - _0F_38_2B */ 0xf11c, +/* 794 - _0F_38_2C */ 0xf128, +/* 795 - _0F_38_2D */ 0xf134, +/* 796 - _0F_38_2E */ 0xf140, +/* 797 - _0F_38_2F */ 0xf14c, +/* 798 - _0F_38_30 */ 0xf158, +/* 799 - _0F_38_31 */ 0xf164, +/* 79a - _0F_38_32 */ 0xf170, +/* 79b - _0F_38_33 */ 0xf17c, +/* 79c - _0F_38_34 */ 0xf188, +/* 79d - _0F_38_35 */ 0xf194, /* 79e - */ 0, -/* 79f - _0F_38_37 */ 0xd1a0, -/* 7a0 - _0F_38_38 */ 0xd1ac, -/* 7a1 - _0F_38_39 */ 0xd1b8, -/* 7a2 - _0F_38_3A */ 0xd1c4, -/* 7a3 - _0F_38_3B */ 0xd1d0, -/* 7a4 - _0F_38_3C */ 0xd1dc, -/* 7a5 - _0F_38_3D */ 0xd1e8, -/* 7a6 - _0F_38_3E */ 0xd1f4, -/* 7a7 - _0F_38_3F */ 0xd200, -/* 7a8 - _0F_38_40 */ 0xd20c, -/* 7a9 - _0F_38_41 */ 0xd218, +/* 79f - _0F_38_37 */ 0xf1a0, +/* 7a0 - _0F_38_38 */ 0xf1ac, +/* 7a1 - _0F_38_39 */ 0xf1b8, +/* 7a2 - _0F_38_3A */ 0xf1c4, +/* 7a3 - _0F_38_3B */ 0xf1d0, +/* 7a4 - _0F_38_3C */ 0xf1dc, +/* 7a5 - _0F_38_3D */ 0xf1e8, +/* 7a6 - _0F_38_3E */ 0xf1f4, +/* 7a7 - _0F_38_3F */ 0xf200, +/* 7a8 - _0F_38_40 */ 0xf20c, +/* 7a9 - _0F_38_41 */ 0xf218, /* 7aa - */ 0, /* 7ab - */ 0, /* 7ac - */ 0, @@ -3792,9 +3794,9 @@ _InstNode InstructionsTree[5688] = { /* 7e5 - */ 0, /* 7e6 - */ 0, /* 7e7 - */ 0, -/* 7e8 - _0F_38_80 */ 0xd224, -/* 7e9 - _0F_38_81 */ 0xd230, -/* 7ea - _0F_38_82 */ 0xd23c, +/* 7e8 - _0F_38_80 */ 0xf224, +/* 7e9 - _0F_38_81 */ 0xf230, +/* 7ea - _0F_38_82 */ 0xf23c, /* 7eb - */ 0, /* 7ec - */ 0, /* 7ed - */ 0, @@ -3814,48 +3816,48 @@ _InstNode InstructionsTree[5688] = { /* 7fb - */ 0, /* 7fc - */ 0, /* 7fd - */ 0, -/* 7fe - _0F_38_96 */ 0xd248, -/* 7ff - _0F_38_97 */ 0xd254, -/* 800 - _0F_38_98 */ 0xd260, -/* 801 - _0F_38_99 */ 0xd26c, -/* 802 - _0F_38_9A */ 0xd278, -/* 803 - _0F_38_9B */ 0xd284, -/* 804 - _0F_38_9C */ 0xd290, -/* 805 - _0F_38_9D */ 0xd29c, -/* 806 - _0F_38_9E */ 0xd2a8, -/* 807 - _0F_38_9F */ 0xd2b4, +/* 7fe - _0F_38_96 */ 0xf248, +/* 7ff - _0F_38_97 */ 0xf254, +/* 800 - _0F_38_98 */ 0xf260, +/* 801 - _0F_38_99 */ 0xf26c, +/* 802 - _0F_38_9A */ 0xf278, +/* 803 - _0F_38_9B */ 0xf284, +/* 804 - _0F_38_9C */ 0xf290, +/* 805 - _0F_38_9D */ 0xf29c, +/* 806 - _0F_38_9E */ 0xf2a8, +/* 807 - _0F_38_9F */ 0xf2b4, /* 808 - */ 0, /* 809 - */ 0, /* 80a - */ 0, /* 80b - */ 0, /* 80c - */ 0, /* 80d - */ 0, -/* 80e - _0F_38_A6 */ 0xd2c0, -/* 80f - _0F_38_A7 */ 0xd2cc, -/* 810 - _0F_38_A8 */ 0xd2d8, -/* 811 - _0F_38_A9 */ 0xd2e4, -/* 812 - _0F_38_AA */ 0xd2f0, -/* 813 - _0F_38_AB */ 0xd2fc, -/* 814 - _0F_38_AC */ 0xd308, -/* 815 - _0F_38_AD */ 0xd314, -/* 816 - _0F_38_AE */ 0xd320, -/* 817 - _0F_38_AF */ 0xd32c, +/* 80e - _0F_38_A6 */ 0xf2c0, +/* 80f - _0F_38_A7 */ 0xf2cc, +/* 810 - _0F_38_A8 */ 0xf2d8, +/* 811 - _0F_38_A9 */ 0xf2e4, +/* 812 - _0F_38_AA */ 0xf2f0, +/* 813 - _0F_38_AB */ 0xf2fc, +/* 814 - _0F_38_AC */ 0xf308, +/* 815 - _0F_38_AD */ 0xf314, +/* 816 - _0F_38_AE */ 0xf320, +/* 817 - _0F_38_AF */ 0xf32c, /* 818 - */ 0, /* 819 - */ 0, /* 81a - */ 0, /* 81b - */ 0, /* 81c - */ 0, /* 81d - */ 0, -/* 81e - _0F_38_B6 */ 0xd338, -/* 81f - _0F_38_B7 */ 0xd344, -/* 820 - _0F_38_B8 */ 0xd350, -/* 821 - _0F_38_B9 */ 0xd35c, -/* 822 - _0F_38_BA */ 0xd368, -/* 823 - _0F_38_BB */ 0xd374, -/* 824 - _0F_38_BC */ 0xd380, -/* 825 - _0F_38_BD */ 0xd38c, -/* 826 - _0F_38_BE */ 0xd398, -/* 827 - _0F_38_BF */ 0xd3a4, +/* 81e - _0F_38_B6 */ 0xf338, +/* 81f - _0F_38_B7 */ 0xf344, +/* 820 - _0F_38_B8 */ 0xf350, +/* 821 - _0F_38_B9 */ 0xf35c, +/* 822 - _0F_38_BA */ 0xf368, +/* 823 - _0F_38_BB */ 0xf374, +/* 824 - _0F_38_BC */ 0xf380, +/* 825 - _0F_38_BD */ 0xf38c, +/* 826 - _0F_38_BE */ 0xf398, +/* 827 - _0F_38_BF */ 0xf3a4, /* 828 - */ 0, /* 829 - */ 0, /* 82a - */ 0, @@ -3883,11 +3885,11 @@ _InstNode InstructionsTree[5688] = { /* 840 - */ 0, /* 841 - */ 0, /* 842 - */ 0, -/* 843 - _0F_38_DB */ 0xd3b0, -/* 844 - _0F_38_DC */ 0xd3bc, -/* 845 - _0F_38_DD */ 0xd3c8, -/* 846 - _0F_38_DE */ 0xd3d4, -/* 847 - _0F_38_DF */ 0xd3e0, +/* 843 - _0F_38_DB */ 0xf3b0, +/* 844 - _0F_38_DC */ 0xf3bc, +/* 845 - _0F_38_DD */ 0xf3c8, +/* 846 - _0F_38_DE */ 0xf3d4, +/* 847 - _0F_38_DF */ 0xf3e0, /* 848 - */ 0, /* 849 - */ 0, /* 84a - */ 0, @@ -3904,8 +3906,8 @@ _InstNode InstructionsTree[5688] = { /* 855 - */ 0, /* 856 - */ 0, /* 857 - */ 0, -/* 858 - _0F_38_F0 */ 0xd3ec, -/* 859 - _0F_38_F1 */ 0xd3f8, +/* 858 - _0F_38_F0 */ 0xf3ec, +/* 859 - _0F_38_F1 */ 0xf3f8, /* 85a - */ 0, /* 85b - */ 0, /* 85c - */ 0, @@ -3924,37 +3926,37 @@ _InstNode InstructionsTree[5688] = { /* 869 - */ 0, /* 86a - */ 0, /* 86b - */ 0, -/* 86c - _0F_3A_04 */ 0xd404, -/* 86d - _0F_3A_05 */ 0xd410, -/* 86e - _0F_3A_06 */ 0xd41c, +/* 86c - _0F_3A_04 */ 0xf404, +/* 86d - _0F_3A_05 */ 0xf410, +/* 86e - _0F_3A_06 */ 0xf41c, /* 86f - */ 0, -/* 870 - _0F_3A_08 */ 0xd428, -/* 871 - _0F_3A_09 */ 0xd434, -/* 872 - _0F_3A_0A */ 0xd440, -/* 873 - _0F_3A_0B */ 0xd44c, -/* 874 - _0F_3A_0C */ 0xd458, -/* 875 - _0F_3A_0D */ 0xd464, -/* 876 - _0F_3A_0E */ 0xd470, -/* 877 - _0F_3A_0F */ 0xd47c, +/* 870 - _0F_3A_08 */ 0xf428, +/* 871 - _0F_3A_09 */ 0xf434, +/* 872 - _0F_3A_0A */ 0xf440, +/* 873 - _0F_3A_0B */ 0xf44c, +/* 874 - _0F_3A_0C */ 0xf458, +/* 875 - _0F_3A_0D */ 0xf464, +/* 876 - _0F_3A_0E */ 0xf470, +/* 877 - _0F_3A_0F */ 0xf47c, /* 878 - */ 0, /* 879 - */ 0, /* 87a - */ 0, /* 87b - */ 0, -/* 87c - _0F_3A_14 */ 0xd488, -/* 87d - _0F_3A_15 */ 0xd494, -/* 87e - _0F_3A_16 */ 0xd4a0, -/* 87f - _0F_3A_17 */ 0xd4ac, -/* 880 - _0F_3A_18 */ 0xd4b8, -/* 881 - _0F_3A_19 */ 0xd4c4, +/* 87c - _0F_3A_14 */ 0xf488, +/* 87d - _0F_3A_15 */ 0xf494, +/* 87e - _0F_3A_16 */ 0xf4a0, +/* 87f - _0F_3A_17 */ 0xf4ac, +/* 880 - _0F_3A_18 */ 0xf4b8, +/* 881 - _0F_3A_19 */ 0xf4c4, /* 882 - */ 0, /* 883 - */ 0, /* 884 - */ 0, /* 885 - */ 0, /* 886 - */ 0, /* 887 - */ 0, -/* 888 - _0F_3A_20 */ 0xd4d0, -/* 889 - _0F_3A_21 */ 0xd4dc, -/* 88a - _0F_3A_22 */ 0xd4e8, +/* 888 - _0F_3A_20 */ 0xf4d0, +/* 889 - _0F_3A_21 */ 0xf4dc, +/* 88a - _0F_3A_22 */ 0xf4e8, /* 88b - */ 0, /* 88c - */ 0, /* 88d - */ 0, @@ -3984,19 +3986,19 @@ _InstNode InstructionsTree[5688] = { /* 8a5 - */ 0, /* 8a6 - */ 0, /* 8a7 - */ 0, -/* 8a8 - _0F_3A_40 */ 0xd4f4, -/* 8a9 - _0F_3A_41 */ 0xd500, -/* 8aa - _0F_3A_42 */ 0xd50c, +/* 8a8 - _0F_3A_40 */ 0xf4f4, +/* 8a9 - _0F_3A_41 */ 0xf500, +/* 8aa - _0F_3A_42 */ 0xf50c, /* 8ab - */ 0, -/* 8ac - _0F_3A_44 */ 0xd518, +/* 8ac - _0F_3A_44 */ 0xf518, /* 8ad - */ 0, /* 8ae - */ 0, /* 8af - */ 0, /* 8b0 - */ 0, /* 8b1 - */ 0, -/* 8b2 - _0F_3A_4A */ 0xd524, -/* 8b3 - _0F_3A_4B */ 0xd530, -/* 8b4 - _0F_3A_4C */ 0xd53c, +/* 8b2 - _0F_3A_4A */ 0xf524, +/* 8b3 - _0F_3A_4B */ 0xf530, +/* 8b4 - _0F_3A_4C */ 0xf53c, /* 8b5 - */ 0, /* 8b6 - */ 0, /* 8b7 - */ 0, @@ -4016,10 +4018,10 @@ _InstNode InstructionsTree[5688] = { /* 8c5 - */ 0, /* 8c6 - */ 0, /* 8c7 - */ 0, -/* 8c8 - _0F_3A_60 */ 0xd548, -/* 8c9 - _0F_3A_61 */ 0xd554, -/* 8ca - _0F_3A_62 */ 0xd560, -/* 8cb - _0F_3A_63 */ 0xd56c, +/* 8c8 - _0F_3A_60 */ 0xf548, +/* 8c9 - _0F_3A_61 */ 0xf554, +/* 8ca - _0F_3A_62 */ 0xf560, +/* 8cb - _0F_3A_63 */ 0xf56c, /* 8cc - */ 0, /* 8cd - */ 0, /* 8ce - */ 0, @@ -4143,7 +4145,7 @@ _InstNode InstructionsTree[5688] = { /* 944 - */ 0, /* 945 - */ 0, /* 946 - */ 0, -/* 947 - _0F_3A_DF */ 0xd578, +/* 947 - _0F_3A_DF */ 0xf578, /* 948 - */ 0, /* 949 - */ 0, /* 94a - */ 0, @@ -4176,8 +4178,8 @@ _InstNode InstructionsTree[5688] = { /* 965 - */ 0, /* 966 - */ 0, /* 967 - */ 0, -/* 968 - _0F_50 */ 0x23a3, -/* 969 - _66_0F_50 */ 0x23a4, +/* 968 - _0F_50 */ 0x23a5, +/* 969 - _66_0F_50 */ 0x23a6, /* 96a - */ 0, /* 96b - */ 0, /* 96c - _V_0F_50 */ 0x4036, @@ -4188,10 +4190,10 @@ _InstNode InstructionsTree[5688] = { /* 971 - */ 0, /* 972 - */ 0, /* 973 - */ 0, -/* 974 - _0F_51 */ 0x23a5, -/* 975 - _66_0F_51 */ 0x23a6, -/* 976 - _F3_0F_51 */ 0x23a7, -/* 977 - _F2_0F_51 */ 0x23a8, +/* 974 - _0F_51 */ 0x23a7, +/* 975 - _66_0F_51 */ 0x23a8, +/* 976 - _F3_0F_51 */ 0x23a9, +/* 977 - _F2_0F_51 */ 0x23aa, /* 978 - _V_0F_51 */ 0x4038, /* 979 - _V_66_0F_51 */ 0x4039, /* 97a - _V_F3_0F_51 */ 0x403a, @@ -4200,9 +4202,9 @@ _InstNode InstructionsTree[5688] = { /* 97d - */ 0, /* 97e - */ 0, /* 97f - */ 0, -/* 980 - _0F_52 */ 0x23a9, +/* 980 - _0F_52 */ 0x23ab, /* 981 - */ 0, -/* 982 - _F3_0F_52 */ 0x23aa, +/* 982 - _F3_0F_52 */ 0x23ac, /* 983 - */ 0, /* 984 - _V_0F_52 */ 0x403c, /* 985 - */ 0, @@ -4212,9 +4214,9 @@ _InstNode InstructionsTree[5688] = { /* 989 - */ 0, /* 98a - */ 0, /* 98b - */ 0, -/* 98c - _0F_53 */ 0x23ab, +/* 98c - _0F_53 */ 0x23ad, /* 98d - */ 0, -/* 98e - _F3_0F_53 */ 0x23ac, +/* 98e - _F3_0F_53 */ 0x23ae, /* 98f - */ 0, /* 990 - _V_0F_53 */ 0x403e, /* 991 - */ 0, @@ -4224,8 +4226,8 @@ _InstNode InstructionsTree[5688] = { /* 995 - */ 0, /* 996 - */ 0, /* 997 - */ 0, -/* 998 - _0F_54 */ 0x23ad, -/* 999 - _66_0F_54 */ 0x23ae, +/* 998 - _0F_54 */ 0x23af, +/* 999 - _66_0F_54 */ 0x23b0, /* 99a - */ 0, /* 99b - */ 0, /* 99c - _V_0F_54 */ 0x4040, @@ -4236,8 +4238,8 @@ _InstNode InstructionsTree[5688] = { /* 9a1 - */ 0, /* 9a2 - */ 0, /* 9a3 - */ 0, -/* 9a4 - _0F_55 */ 0x23af, -/* 9a5 - _66_0F_55 */ 0x23b0, +/* 9a4 - _0F_55 */ 0x23b1, +/* 9a5 - _66_0F_55 */ 0x23b2, /* 9a6 - */ 0, /* 9a7 - */ 0, /* 9a8 - _V_0F_55 */ 0x4042, @@ -4248,8 +4250,8 @@ _InstNode InstructionsTree[5688] = { /* 9ad - */ 0, /* 9ae - */ 0, /* 9af - */ 0, -/* 9b0 - _0F_56 */ 0x23b1, -/* 9b1 - _66_0F_56 */ 0x23b2, +/* 9b0 - _0F_56 */ 0x23b3, +/* 9b1 - _66_0F_56 */ 0x23b4, /* 9b2 - */ 0, /* 9b3 - */ 0, /* 9b4 - _V_0F_56 */ 0x4044, @@ -4260,8 +4262,8 @@ _InstNode InstructionsTree[5688] = { /* 9b9 - */ 0, /* 9ba - */ 0, /* 9bb - */ 0, -/* 9bc - _0F_57 */ 0x23b3, -/* 9bd - _66_0F_57 */ 0x23b4, +/* 9bc - _0F_57 */ 0x23b5, +/* 9bd - _66_0F_57 */ 0x23b6, /* 9be - */ 0, /* 9bf - */ 0, /* 9c0 - _V_0F_57 */ 0x4046, @@ -4272,10 +4274,10 @@ _InstNode InstructionsTree[5688] = { /* 9c5 - */ 0, /* 9c6 - */ 0, /* 9c7 - */ 0, -/* 9c8 - _0F_58 */ 0x23b5, -/* 9c9 - _66_0F_58 */ 0x23b6, -/* 9ca - _F3_0F_58 */ 0x23b7, -/* 9cb - _F2_0F_58 */ 0x23b8, +/* 9c8 - _0F_58 */ 0x23b7, +/* 9c9 - _66_0F_58 */ 0x23b8, +/* 9ca - _F3_0F_58 */ 0x23b9, +/* 9cb - _F2_0F_58 */ 0x23ba, /* 9cc - _V_0F_58 */ 0x4048, /* 9cd - _V_66_0F_58 */ 0x4049, /* 9ce - _V_F3_0F_58 */ 0x404a, @@ -4284,10 +4286,10 @@ _InstNode InstructionsTree[5688] = { /* 9d1 - */ 0, /* 9d2 - */ 0, /* 9d3 - */ 0, -/* 9d4 - _0F_59 */ 0x23b9, -/* 9d5 - _66_0F_59 */ 0x23ba, -/* 9d6 - _F3_0F_59 */ 0x23bb, -/* 9d7 - _F2_0F_59 */ 0x23bc, +/* 9d4 - _0F_59 */ 0x23bb, +/* 9d5 - _66_0F_59 */ 0x23bc, +/* 9d6 - _F3_0F_59 */ 0x23bd, +/* 9d7 - _F2_0F_59 */ 0x23be, /* 9d8 - _V_0F_59 */ 0x404c, /* 9d9 - _V_66_0F_59 */ 0x404d, /* 9da - _V_F3_0F_59 */ 0x404e, @@ -4296,10 +4298,10 @@ _InstNode InstructionsTree[5688] = { /* 9dd - */ 0, /* 9de - */ 0, /* 9df - */ 0, -/* 9e0 - _0F_5A */ 0x23bd, -/* 9e1 - _66_0F_5A */ 0x23be, -/* 9e2 - _F3_0F_5A */ 0x23bf, -/* 9e3 - _F2_0F_5A */ 0x23c0, +/* 9e0 - _0F_5A */ 0x23bf, +/* 9e1 - _66_0F_5A */ 0x23c0, +/* 9e2 - _F3_0F_5A */ 0x23c1, +/* 9e3 - _F2_0F_5A */ 0x23c2, /* 9e4 - _V_0F_5A */ 0x4050, /* 9e5 - _V_66_0F_5A */ 0x4051, /* 9e6 - _V_F3_0F_5A */ 0x4052, @@ -4308,9 +4310,9 @@ _InstNode InstructionsTree[5688] = { /* 9e9 - */ 0, /* 9ea - */ 0, /* 9eb - */ 0, -/* 9ec - _0F_5B */ 0x23c1, -/* 9ed - _66_0F_5B */ 0x23c2, -/* 9ee - _F3_0F_5B */ 0x23c3, +/* 9ec - _0F_5B */ 0x23c3, +/* 9ed - _66_0F_5B */ 0x23c4, +/* 9ee - _F3_0F_5B */ 0x23c5, /* 9ef - */ 0, /* 9f0 - _V_0F_5B */ 0x4054, /* 9f1 - _V_66_0F_5B */ 0x4055, @@ -4320,10 +4322,10 @@ _InstNode InstructionsTree[5688] = { /* 9f5 - */ 0, /* 9f6 - */ 0, /* 9f7 - */ 0, -/* 9f8 - _0F_5C */ 0x23c4, -/* 9f9 - _66_0F_5C */ 0x23c5, -/* 9fa - _F3_0F_5C */ 0x23c6, -/* 9fb - _F2_0F_5C */ 0x23c7, +/* 9f8 - _0F_5C */ 0x23c6, +/* 9f9 - _66_0F_5C */ 0x23c7, +/* 9fa - _F3_0F_5C */ 0x23c8, +/* 9fb - _F2_0F_5C */ 0x23c9, /* 9fc - _V_0F_5C */ 0x4057, /* 9fd - _V_66_0F_5C */ 0x4058, /* 9fe - _V_F3_0F_5C */ 0x4059, @@ -4332,10 +4334,10 @@ _InstNode InstructionsTree[5688] = { /* a01 - */ 0, /* a02 - */ 0, /* a03 - */ 0, -/* a04 - _0F_5D */ 0x23c8, -/* a05 - _66_0F_5D */ 0x23c9, -/* a06 - _F3_0F_5D */ 0x23ca, -/* a07 - _F2_0F_5D */ 0x23cb, +/* a04 - _0F_5D */ 0x23ca, +/* a05 - _66_0F_5D */ 0x23cb, +/* a06 - _F3_0F_5D */ 0x23cc, +/* a07 - _F2_0F_5D */ 0x23cd, /* a08 - _V_0F_5D */ 0x405b, /* a09 - _V_66_0F_5D */ 0x405c, /* a0a - _V_F3_0F_5D */ 0x405d, @@ -4344,10 +4346,10 @@ _InstNode InstructionsTree[5688] = { /* a0d - */ 0, /* a0e - */ 0, /* a0f - */ 0, -/* a10 - _0F_5E */ 0x23cc, -/* a11 - _66_0F_5E */ 0x23cd, -/* a12 - _F3_0F_5E */ 0x23ce, -/* a13 - _F2_0F_5E */ 0x23cf, +/* a10 - _0F_5E */ 0x23ce, +/* a11 - _66_0F_5E */ 0x23cf, +/* a12 - _F3_0F_5E */ 0x23d0, +/* a13 - _F2_0F_5E */ 0x23d1, /* a14 - _V_0F_5E */ 0x405f, /* a15 - _V_66_0F_5E */ 0x4060, /* a16 - _V_F3_0F_5E */ 0x4061, @@ -4356,10 +4358,10 @@ _InstNode InstructionsTree[5688] = { /* a19 - */ 0, /* a1a - */ 0, /* a1b - */ 0, -/* a1c - _0F_5F */ 0x23d0, -/* a1d - _66_0F_5F */ 0x23d1, -/* a1e - _F3_0F_5F */ 0x23d2, -/* a1f - _F2_0F_5F */ 0x23d3, +/* a1c - _0F_5F */ 0x23d2, +/* a1d - _66_0F_5F */ 0x23d3, +/* a1e - _F3_0F_5F */ 0x23d4, +/* a1f - _F2_0F_5F */ 0x23d5, /* a20 - _V_0F_5F */ 0x4063, /* a21 - _V_66_0F_5F */ 0x4064, /* a22 - _V_F3_0F_5F */ 0x4065, @@ -4368,8 +4370,8 @@ _InstNode InstructionsTree[5688] = { /* a25 - */ 0, /* a26 - */ 0, /* a27 - */ 0, -/* a28 - _0F_60 */ 0x23d4, -/* a29 - _66_0F_60 */ 0x23d5, +/* a28 - _0F_60 */ 0x23d6, +/* a29 - _66_0F_60 */ 0x23d7, /* a2a - */ 0, /* a2b - */ 0, /* a2c - */ 0, @@ -4380,8 +4382,8 @@ _InstNode InstructionsTree[5688] = { /* a31 - */ 0, /* a32 - */ 0, /* a33 - */ 0, -/* a34 - _0F_61 */ 0x23d6, -/* a35 - _66_0F_61 */ 0x23d7, +/* a34 - _0F_61 */ 0x23d8, +/* a35 - _66_0F_61 */ 0x23d9, /* a36 - */ 0, /* a37 - */ 0, /* a38 - */ 0, @@ -4392,8 +4394,8 @@ _InstNode InstructionsTree[5688] = { /* a3d - */ 0, /* a3e - */ 0, /* a3f - */ 0, -/* a40 - _0F_62 */ 0x23d8, -/* a41 - _66_0F_62 */ 0x23d9, +/* a40 - _0F_62 */ 0x23da, +/* a41 - _66_0F_62 */ 0x23db, /* a42 - */ 0, /* a43 - */ 0, /* a44 - */ 0, @@ -4404,8 +4406,8 @@ _InstNode InstructionsTree[5688] = { /* a49 - */ 0, /* a4a - */ 0, /* a4b - */ 0, -/* a4c - _0F_63 */ 0x23da, -/* a4d - _66_0F_63 */ 0x23db, +/* a4c - _0F_63 */ 0x23dc, +/* a4d - _66_0F_63 */ 0x23dd, /* a4e - */ 0, /* a4f - */ 0, /* a50 - */ 0, @@ -4416,8 +4418,8 @@ _InstNode InstructionsTree[5688] = { /* a55 - */ 0, /* a56 - */ 0, /* a57 - */ 0, -/* a58 - _0F_64 */ 0x23dc, -/* a59 - _66_0F_64 */ 0x23dd, +/* a58 - _0F_64 */ 0x23de, +/* a59 - _66_0F_64 */ 0x23df, /* a5a - */ 0, /* a5b - */ 0, /* a5c - */ 0, @@ -4428,8 +4430,8 @@ _InstNode InstructionsTree[5688] = { /* a61 - */ 0, /* a62 - */ 0, /* a63 - */ 0, -/* a64 - _0F_65 */ 0x23de, -/* a65 - _66_0F_65 */ 0x23df, +/* a64 - _0F_65 */ 0x23e0, +/* a65 - _66_0F_65 */ 0x23e1, /* a66 - */ 0, /* a67 - */ 0, /* a68 - */ 0, @@ -4440,8 +4442,8 @@ _InstNode InstructionsTree[5688] = { /* a6d - */ 0, /* a6e - */ 0, /* a6f - */ 0, -/* a70 - _0F_66 */ 0x23e0, -/* a71 - _66_0F_66 */ 0x23e1, +/* a70 - _0F_66 */ 0x23e2, +/* a71 - _66_0F_66 */ 0x23e3, /* a72 - */ 0, /* a73 - */ 0, /* a74 - */ 0, @@ -4452,8 +4454,8 @@ _InstNode InstructionsTree[5688] = { /* a79 - */ 0, /* a7a - */ 0, /* a7b - */ 0, -/* a7c - _0F_67 */ 0x23e2, -/* a7d - _66_0F_67 */ 0x23e3, +/* a7c - _0F_67 */ 0x23e4, +/* a7d - _66_0F_67 */ 0x23e5, /* a7e - */ 0, /* a7f - */ 0, /* a80 - */ 0, @@ -4464,8 +4466,8 @@ _InstNode InstructionsTree[5688] = { /* a85 - */ 0, /* a86 - */ 0, /* a87 - */ 0, -/* a88 - _0F_68 */ 0x23e4, -/* a89 - _66_0F_68 */ 0x23e5, +/* a88 - _0F_68 */ 0x23e6, +/* a89 - _66_0F_68 */ 0x23e7, /* a8a - */ 0, /* a8b - */ 0, /* a8c - */ 0, @@ -4476,8 +4478,8 @@ _InstNode InstructionsTree[5688] = { /* a91 - */ 0, /* a92 - */ 0, /* a93 - */ 0, -/* a94 - _0F_69 */ 0x23e6, -/* a95 - _66_0F_69 */ 0x23e7, +/* a94 - _0F_69 */ 0x23e8, +/* a95 - _66_0F_69 */ 0x23e9, /* a96 - */ 0, /* a97 - */ 0, /* a98 - */ 0, @@ -4488,8 +4490,8 @@ _InstNode InstructionsTree[5688] = { /* a9d - */ 0, /* a9e - */ 0, /* a9f - */ 0, -/* aa0 - _0F_6A */ 0x23e8, -/* aa1 - _66_0F_6A */ 0x23e9, +/* aa0 - _0F_6A */ 0x23ea, +/* aa1 - _66_0F_6A */ 0x23eb, /* aa2 - */ 0, /* aa3 - */ 0, /* aa4 - */ 0, @@ -4500,8 +4502,8 @@ _InstNode InstructionsTree[5688] = { /* aa9 - */ 0, /* aaa - */ 0, /* aab - */ 0, -/* aac - _0F_6B */ 0x23ea, -/* aad - _66_0F_6B */ 0x23eb, +/* aac - _0F_6B */ 0x23ec, +/* aad - _66_0F_6B */ 0x23ed, /* aae - */ 0, /* aaf - */ 0, /* ab0 - */ 0, @@ -4513,7 +4515,7 @@ _InstNode InstructionsTree[5688] = { /* ab6 - */ 0, /* ab7 - */ 0, /* ab8 - */ 0, -/* ab9 - _66_0F_6C */ 0x23ec, +/* ab9 - _66_0F_6C */ 0x23ee, /* aba - */ 0, /* abb - */ 0, /* abc - */ 0, @@ -4525,7 +4527,7 @@ _InstNode InstructionsTree[5688] = { /* ac2 - */ 0, /* ac3 - */ 0, /* ac4 - */ 0, -/* ac5 - _66_0F_6D */ 0x23ed, +/* ac5 - _66_0F_6D */ 0x23ef, /* ac6 - */ 0, /* ac7 - */ 0, /* ac8 - */ 0, @@ -4548,9 +4550,9 @@ _InstNode InstructionsTree[5688] = { /* ad9 - */ 0, /* ada - */ 0, /* adb - */ 0, -/* adc - _0F_6F */ 0x23ee, -/* add - _66_0F_6F */ 0x23ef, -/* ade - _F3_0F_6F */ 0x23f0, +/* adc - _0F_6F */ 0x23f0, +/* add - _66_0F_6F */ 0x23f1, +/* ade - _F3_0F_6F */ 0x23f2, /* adf - */ 0, /* ae0 - */ 0, /* ae1 - _V_66_0F_6F */ 0x4078, @@ -4574,30 +4576,30 @@ _InstNode InstructionsTree[5688] = { /* af3 - */ 0, /* af4 - */ 0, /* af5 - */ 0, -/* af6 - _0F_71_02 */ 0xd584, +/* af6 - _0F_71_02 */ 0xf584, /* af7 - */ 0, -/* af8 - _0F_71_04 */ 0xd590, +/* af8 - _0F_71_04 */ 0xf590, /* af9 - */ 0, -/* afa - _0F_71_06 */ 0xd59c, +/* afa - _0F_71_06 */ 0xf59c, /* afb - */ 0, /* afc - */ 0, /* afd - */ 0, -/* afe - _0F_72_02 */ 0xd5a8, +/* afe - _0F_72_02 */ 0xf5a8, /* aff - */ 0, -/* b00 - _0F_72_04 */ 0xd5b4, +/* b00 - _0F_72_04 */ 0xf5b4, /* b01 - */ 0, -/* b02 - _0F_72_06 */ 0xd5c0, +/* b02 - _0F_72_06 */ 0xf5c0, /* b03 - */ 0, /* b04 - */ 0, /* b05 - */ 0, -/* b06 - _0F_73_02 */ 0xd5cc, -/* b07 - _0F_73_03 */ 0xd5d8, +/* b06 - _0F_73_02 */ 0xf5cc, +/* b07 - _0F_73_03 */ 0xf5d8, /* b08 - */ 0, /* b09 - */ 0, -/* b0a - _0F_73_06 */ 0xd5e4, -/* b0b - _0F_73_07 */ 0xd5f0, -/* b0c - _0F_74 */ 0x23f1, -/* b0d - _66_0F_74 */ 0x23f2, +/* b0a - _0F_73_06 */ 0xf5e4, +/* b0b - _0F_73_07 */ 0xf5f0, +/* b0c - _0F_74 */ 0x23f3, +/* b0d - _66_0F_74 */ 0x23f4, /* b0e - */ 0, /* b0f - */ 0, /* b10 - */ 0, @@ -4608,8 +4610,8 @@ _InstNode InstructionsTree[5688] = { /* b15 - */ 0, /* b16 - */ 0, /* b17 - */ 0, -/* b18 - _0F_75 */ 0x23f3, -/* b19 - _66_0F_75 */ 0x23f4, +/* b18 - _0F_75 */ 0x23f5, +/* b19 - _66_0F_75 */ 0x23f6, /* b1a - */ 0, /* b1b - */ 0, /* b1c - */ 0, @@ -4620,8 +4622,8 @@ _InstNode InstructionsTree[5688] = { /* b21 - */ 0, /* b22 - */ 0, /* b23 - */ 0, -/* b24 - _0F_76 */ 0x23f5, -/* b25 - _66_0F_76 */ 0x23f6, +/* b24 - _0F_76 */ 0x23f7, +/* b25 - _66_0F_76 */ 0x23f8, /* b26 - */ 0, /* b27 - */ 0, /* b28 - */ 0, @@ -4632,7 +4634,7 @@ _InstNode InstructionsTree[5688] = { /* b2d - */ 0, /* b2e - */ 0, /* b2f - */ 0, -/* b30 - _0F_77 */ 0x23f7, +/* b30 - _0F_77 */ 0x23f9, /* b31 - */ 0, /* b32 - */ 0, /* b33 - */ 0, @@ -4644,7 +4646,7 @@ _InstNode InstructionsTree[5688] = { /* b39 - */ 0, /* b3a - */ 0, /* b3b - */ 0, -/* b3c - _0F_78 */ 0x23f8, +/* b3c - _0F_78 */ 0x23fa, /* b3d - _66_0F_78 */ 0x4085, /* b3e - */ 0, /* b3f - _F2_0F_78 */ 0x4086, @@ -4656,10 +4658,10 @@ _InstNode InstructionsTree[5688] = { /* b45 - */ 0, /* b46 - */ 0, /* b47 - */ 0, -/* b48 - _0F_79 */ 0x23f9, -/* b49 - _66_0F_79 */ 0x23fa, +/* b48 - _0F_79 */ 0x23fb, +/* b49 - _66_0F_79 */ 0x23fc, /* b4a - */ 0, -/* b4b - _F2_0F_79 */ 0x23fb, +/* b4b - _F2_0F_79 */ 0x23fd, /* b4c - */ 0, /* b4d - */ 0, /* b4e - */ 0, @@ -4716,8 +4718,8 @@ _InstNode InstructionsTree[5688] = { /* b81 - */ 0, /* b82 - */ 0, /* b83 - */ 0, -/* b84 - _0F_7A_30 */ 0x23fc, -/* b85 - _0F_7A_31 */ 0x23fd, +/* b84 - _0F_7A_30 */ 0x23fe, +/* b85 - _0F_7A_31 */ 0x23ff, /* b86 - */ 0, /* b87 - */ 0, /* b88 - */ 0, @@ -4925,9 +4927,9 @@ _InstNode InstructionsTree[5688] = { /* c52 - */ 0, /* c53 - */ 0, /* c54 - */ 0, -/* c55 - _66_0F_7C */ 0x23fe, +/* c55 - _66_0F_7C */ 0x2400, /* c56 - */ 0, -/* c57 - _F2_0F_7C */ 0x23ff, +/* c57 - _F2_0F_7C */ 0x2401, /* c58 - */ 0, /* c59 - _V_66_0F_7C */ 0x4087, /* c5a - */ 0, @@ -4937,9 +4939,9 @@ _InstNode InstructionsTree[5688] = { /* c5e - */ 0, /* c5f - */ 0, /* c60 - */ 0, -/* c61 - _66_0F_7D */ 0x2400, +/* c61 - _66_0F_7D */ 0x2402, /* c62 - */ 0, -/* c63 - _F2_0F_7D */ 0x2401, +/* c63 - _F2_0F_7D */ 0x2403, /* c64 - */ 0, /* c65 - _V_66_0F_7D */ 0x4089, /* c66 - */ 0, @@ -4950,7 +4952,7 @@ _InstNode InstructionsTree[5688] = { /* c6b - */ 0, /* c6c - _0F_7E */ 0x408b, /* c6d - _66_0F_7E */ 0x408c, -/* c6e - _F3_0F_7E */ 0x2402, +/* c6e - _F3_0F_7E */ 0x2404, /* c6f - */ 0, /* c70 - */ 0, /* c71 - _V_66_0F_7E */ 0x408d, @@ -4960,9 +4962,9 @@ _InstNode InstructionsTree[5688] = { /* c75 - */ 0, /* c76 - */ 0, /* c77 - */ 0, -/* c78 - _0F_7F */ 0x2403, -/* c79 - _66_0F_7F */ 0x2404, -/* c7a - _F3_0F_7F */ 0x2405, +/* c78 - _0F_7F */ 0x2405, +/* c79 - _66_0F_7F */ 0x2406, +/* c7a - _F3_0F_7F */ 0x2407, /* c7b - */ 0, /* c7c - */ 0, /* c7d - _V_66_0F_7F */ 0x408f, @@ -4972,17 +4974,17 @@ _InstNode InstructionsTree[5688] = { /* c81 - */ 0, /* c82 - */ 0, /* c83 - */ 0, -/* c84 - _0F_AE_00 */ 0xd5fc, -/* c85 - _0F_AE_01 */ 0xd608, -/* c86 - _0F_AE_02 */ 0xd614, -/* c87 - _0F_AE_03 */ 0xd620, +/* c84 - _0F_AE_00 */ 0xf5fc, +/* c85 - _0F_AE_01 */ 0xf608, +/* c86 - _0F_AE_02 */ 0xf614, +/* c87 - _0F_AE_03 */ 0xf620, /* c88 - _0F_AE_04 */ 0x4091, /* c89 - _0F_AE_05 */ 0x4092, /* c8a - _0F_AE_06 */ 0x4093, /* c8b - _0F_AE_07 */ 0x4094, /* c8c - */ 0, /* c8d - */ 0, -/* c8e - _F3_0F_B8 */ 0x2406, +/* c8e - _F3_0F_B8 */ 0x2408, /* c8f - */ 0, /* c90 - */ 0, /* c91 - */ 0, @@ -4996,13 +4998,13 @@ _InstNode InstructionsTree[5688] = { /* c99 - */ 0, /* c9a - */ 0, /* c9b - */ 0, -/* c9c - _0F_BA_04 */ 0x2407, -/* c9d - _0F_BA_05 */ 0x2408, -/* c9e - _0F_BA_06 */ 0x2409, -/* c9f - _0F_BA_07 */ 0x240a, -/* ca0 - _0F_BC */ 0x240b, +/* c9c - _0F_BA_04 */ 0x2409, +/* c9d - _0F_BA_05 */ 0x240a, +/* c9e - _0F_BA_06 */ 0x240b, +/* c9f - _0F_BA_07 */ 0x240c, +/* ca0 - _0F_BC */ 0x240d, /* ca1 - */ 0, -/* ca2 - _F3_0F_BC */ 0x240c, +/* ca2 - _F3_0F_BC */ 0x240e, /* ca3 - */ 0, /* ca4 - */ 0, /* ca5 - */ 0, @@ -5012,9 +5014,9 @@ _InstNode InstructionsTree[5688] = { /* ca9 - */ 0, /* caa - */ 0, /* cab - */ 0, -/* cac - _0F_BD */ 0x240d, +/* cac - _0F_BD */ 0x240f, /* cad - */ 0, -/* cae - _F3_0F_BD */ 0x240e, +/* cae - _F3_0F_BD */ 0x2410, /* caf - */ 0, /* cb0 - */ 0, /* cb1 - */ 0, @@ -5078,12 +5080,12 @@ _InstNode InstructionsTree[5688] = { /* ceb - */ 0, /* cec - */ 0, /* ced - */ 0, -/* cee - _0F_C7_06 */ 0xd62c, -/* cef - _0F_C7_07 */ 0x240f, +/* cee - _0F_C7_06 */ 0xf62c, +/* cef - _0F_C7_07 */ 0x2411, /* cf0 - */ 0, -/* cf1 - _66_0F_D0 */ 0x2410, +/* cf1 - _66_0F_D0 */ 0x2412, /* cf2 - */ 0, -/* cf3 - _F2_0F_D0 */ 0x2411, +/* cf3 - _F2_0F_D0 */ 0x2413, /* cf4 - */ 0, /* cf5 - _V_66_0F_D0 */ 0x40a8, /* cf6 - */ 0, @@ -5092,8 +5094,8 @@ _InstNode InstructionsTree[5688] = { /* cf9 - */ 0, /* cfa - */ 0, /* cfb - */ 0, -/* cfc - _0F_D1 */ 0x2412, -/* cfd - _66_0F_D1 */ 0x2413, +/* cfc - _0F_D1 */ 0x2414, +/* cfd - _66_0F_D1 */ 0x2415, /* cfe - */ 0, /* cff - */ 0, /* d00 - */ 0, @@ -5104,8 +5106,8 @@ _InstNode InstructionsTree[5688] = { /* d05 - */ 0, /* d06 - */ 0, /* d07 - */ 0, -/* d08 - _0F_D2 */ 0x2414, -/* d09 - _66_0F_D2 */ 0x2415, +/* d08 - _0F_D2 */ 0x2416, +/* d09 - _66_0F_D2 */ 0x2417, /* d0a - */ 0, /* d0b - */ 0, /* d0c - */ 0, @@ -5116,8 +5118,8 @@ _InstNode InstructionsTree[5688] = { /* d11 - */ 0, /* d12 - */ 0, /* d13 - */ 0, -/* d14 - _0F_D3 */ 0x2416, -/* d15 - _66_0F_D3 */ 0x2417, +/* d14 - _0F_D3 */ 0x2418, +/* d15 - _66_0F_D3 */ 0x2419, /* d16 - */ 0, /* d17 - */ 0, /* d18 - */ 0, @@ -5128,8 +5130,8 @@ _InstNode InstructionsTree[5688] = { /* d1d - */ 0, /* d1e - */ 0, /* d1f - */ 0, -/* d20 - _0F_D4 */ 0x2418, -/* d21 - _66_0F_D4 */ 0x2419, +/* d20 - _0F_D4 */ 0x241a, +/* d21 - _66_0F_D4 */ 0x241b, /* d22 - */ 0, /* d23 - */ 0, /* d24 - */ 0, @@ -5140,8 +5142,8 @@ _InstNode InstructionsTree[5688] = { /* d29 - */ 0, /* d2a - */ 0, /* d2b - */ 0, -/* d2c - _0F_D5 */ 0x241a, -/* d2d - _66_0F_D5 */ 0x241b, +/* d2c - _0F_D5 */ 0x241c, +/* d2d - _66_0F_D5 */ 0x241d, /* d2e - */ 0, /* d2f - */ 0, /* d30 - */ 0, @@ -5153,9 +5155,9 @@ _InstNode InstructionsTree[5688] = { /* d36 - */ 0, /* d37 - */ 0, /* d38 - */ 0, -/* d39 - _66_0F_D6 */ 0x241c, -/* d3a - _F3_0F_D6 */ 0x241d, -/* d3b - _F2_0F_D6 */ 0x241e, +/* d39 - _66_0F_D6 */ 0x241e, +/* d3a - _F3_0F_D6 */ 0x241f, +/* d3b - _F2_0F_D6 */ 0x2420, /* d3c - */ 0, /* d3d - _V_66_0F_D6 */ 0x40af, /* d3e - */ 0, @@ -5164,8 +5166,8 @@ _InstNode InstructionsTree[5688] = { /* d41 - */ 0, /* d42 - */ 0, /* d43 - */ 0, -/* d44 - _0F_D7 */ 0x241f, -/* d45 - _66_0F_D7 */ 0x2420, +/* d44 - _0F_D7 */ 0x2421, +/* d45 - _66_0F_D7 */ 0x2422, /* d46 - */ 0, /* d47 - */ 0, /* d48 - */ 0, @@ -5176,8 +5178,8 @@ _InstNode InstructionsTree[5688] = { /* d4d - */ 0, /* d4e - */ 0, /* d4f - */ 0, -/* d50 - _0F_D8 */ 0x2421, -/* d51 - _66_0F_D8 */ 0x2422, +/* d50 - _0F_D8 */ 0x2423, +/* d51 - _66_0F_D8 */ 0x2424, /* d52 - */ 0, /* d53 - */ 0, /* d54 - */ 0, @@ -5188,8 +5190,8 @@ _InstNode InstructionsTree[5688] = { /* d59 - */ 0, /* d5a - */ 0, /* d5b - */ 0, -/* d5c - _0F_D9 */ 0x2423, -/* d5d - _66_0F_D9 */ 0x2424, +/* d5c - _0F_D9 */ 0x2425, +/* d5d - _66_0F_D9 */ 0x2426, /* d5e - */ 0, /* d5f - */ 0, /* d60 - */ 0, @@ -5200,8 +5202,8 @@ _InstNode InstructionsTree[5688] = { /* d65 - */ 0, /* d66 - */ 0, /* d67 - */ 0, -/* d68 - _0F_DA */ 0x2425, -/* d69 - _66_0F_DA */ 0x2426, +/* d68 - _0F_DA */ 0x2427, +/* d69 - _66_0F_DA */ 0x2428, /* d6a - */ 0, /* d6b - */ 0, /* d6c - */ 0, @@ -5212,8 +5214,8 @@ _InstNode InstructionsTree[5688] = { /* d71 - */ 0, /* d72 - */ 0, /* d73 - */ 0, -/* d74 - _0F_DB */ 0x2427, -/* d75 - _66_0F_DB */ 0x2428, +/* d74 - _0F_DB */ 0x2429, +/* d75 - _66_0F_DB */ 0x242a, /* d76 - */ 0, /* d77 - */ 0, /* d78 - */ 0, @@ -5224,8 +5226,8 @@ _InstNode InstructionsTree[5688] = { /* d7d - */ 0, /* d7e - */ 0, /* d7f - */ 0, -/* d80 - _0F_DC */ 0x2429, -/* d81 - _66_0F_DC */ 0x242a, +/* d80 - _0F_DC */ 0x242b, +/* d81 - _66_0F_DC */ 0x242c, /* d82 - */ 0, /* d83 - */ 0, /* d84 - */ 0, @@ -5236,8 +5238,8 @@ _InstNode InstructionsTree[5688] = { /* d89 - */ 0, /* d8a - */ 0, /* d8b - */ 0, -/* d8c - _0F_DD */ 0x242b, -/* d8d - _66_0F_DD */ 0x242c, +/* d8c - _0F_DD */ 0x242d, +/* d8d - _66_0F_DD */ 0x242e, /* d8e - */ 0, /* d8f - */ 0, /* d90 - */ 0, @@ -5248,8 +5250,8 @@ _InstNode InstructionsTree[5688] = { /* d95 - */ 0, /* d96 - */ 0, /* d97 - */ 0, -/* d98 - _0F_DE */ 0x242d, -/* d99 - _66_0F_DE */ 0x242e, +/* d98 - _0F_DE */ 0x242f, +/* d99 - _66_0F_DE */ 0x2430, /* d9a - */ 0, /* d9b - */ 0, /* d9c - */ 0, @@ -5260,8 +5262,8 @@ _InstNode InstructionsTree[5688] = { /* da1 - */ 0, /* da2 - */ 0, /* da3 - */ 0, -/* da4 - _0F_DF */ 0x242f, -/* da5 - _66_0F_DF */ 0x2430, +/* da4 - _0F_DF */ 0x2431, +/* da5 - _66_0F_DF */ 0x2432, /* da6 - */ 0, /* da7 - */ 0, /* da8 - */ 0, @@ -5272,8 +5274,8 @@ _InstNode InstructionsTree[5688] = { /* dad - */ 0, /* dae - */ 0, /* daf - */ 0, -/* db0 - _0F_E0 */ 0x2431, -/* db1 - _66_0F_E0 */ 0x2432, +/* db0 - _0F_E0 */ 0x2433, +/* db1 - _66_0F_E0 */ 0x2434, /* db2 - */ 0, /* db3 - */ 0, /* db4 - */ 0, @@ -5284,8 +5286,8 @@ _InstNode InstructionsTree[5688] = { /* db9 - */ 0, /* dba - */ 0, /* dbb - */ 0, -/* dbc - _0F_E1 */ 0x2433, -/* dbd - _66_0F_E1 */ 0x2434, +/* dbc - _0F_E1 */ 0x2435, +/* dbd - _66_0F_E1 */ 0x2436, /* dbe - */ 0, /* dbf - */ 0, /* dc0 - */ 0, @@ -5296,8 +5298,8 @@ _InstNode InstructionsTree[5688] = { /* dc5 - */ 0, /* dc6 - */ 0, /* dc7 - */ 0, -/* dc8 - _0F_E2 */ 0x2435, -/* dc9 - _66_0F_E2 */ 0x2436, +/* dc8 - _0F_E2 */ 0x2437, +/* dc9 - _66_0F_E2 */ 0x2438, /* dca - */ 0, /* dcb - */ 0, /* dcc - */ 0, @@ -5308,8 +5310,8 @@ _InstNode InstructionsTree[5688] = { /* dd1 - */ 0, /* dd2 - */ 0, /* dd3 - */ 0, -/* dd4 - _0F_E3 */ 0x2437, -/* dd5 - _66_0F_E3 */ 0x2438, +/* dd4 - _0F_E3 */ 0x2439, +/* dd5 - _66_0F_E3 */ 0x243a, /* dd6 - */ 0, /* dd7 - */ 0, /* dd8 - */ 0, @@ -5320,8 +5322,8 @@ _InstNode InstructionsTree[5688] = { /* ddd - */ 0, /* dde - */ 0, /* ddf - */ 0, -/* de0 - _0F_E4 */ 0x2439, -/* de1 - _66_0F_E4 */ 0x243a, +/* de0 - _0F_E4 */ 0x243b, +/* de1 - _66_0F_E4 */ 0x243c, /* de2 - */ 0, /* de3 - */ 0, /* de4 - */ 0, @@ -5332,8 +5334,8 @@ _InstNode InstructionsTree[5688] = { /* de9 - */ 0, /* dea - */ 0, /* deb - */ 0, -/* dec - _0F_E5 */ 0x243b, -/* ded - _66_0F_E5 */ 0x243c, +/* dec - _0F_E5 */ 0x243d, +/* ded - _66_0F_E5 */ 0x243e, /* dee - */ 0, /* def - */ 0, /* df0 - */ 0, @@ -5345,9 +5347,9 @@ _InstNode InstructionsTree[5688] = { /* df6 - */ 0, /* df7 - */ 0, /* df8 - */ 0, -/* df9 - _66_0F_E6 */ 0x243d, -/* dfa - _F3_0F_E6 */ 0x243e, -/* dfb - _F2_0F_E6 */ 0x243f, +/* df9 - _66_0F_E6 */ 0x243f, +/* dfa - _F3_0F_E6 */ 0x2440, +/* dfb - _F2_0F_E6 */ 0x2441, /* dfc - */ 0, /* dfd - _V_66_0F_E6 */ 0x40bf, /* dfe - _V_F3_0F_E6 */ 0x40c0, @@ -5356,8 +5358,8 @@ _InstNode InstructionsTree[5688] = { /* e01 - */ 0, /* e02 - */ 0, /* e03 - */ 0, -/* e04 - _0F_E7 */ 0x2440, -/* e05 - _66_0F_E7 */ 0x2441, +/* e04 - _0F_E7 */ 0x2442, +/* e05 - _66_0F_E7 */ 0x2443, /* e06 - */ 0, /* e07 - */ 0, /* e08 - */ 0, @@ -5368,8 +5370,8 @@ _InstNode InstructionsTree[5688] = { /* e0d - */ 0, /* e0e - */ 0, /* e0f - */ 0, -/* e10 - _0F_E8 */ 0x2442, -/* e11 - _66_0F_E8 */ 0x2443, +/* e10 - _0F_E8 */ 0x2444, +/* e11 - _66_0F_E8 */ 0x2445, /* e12 - */ 0, /* e13 - */ 0, /* e14 - */ 0, @@ -5380,8 +5382,8 @@ _InstNode InstructionsTree[5688] = { /* e19 - */ 0, /* e1a - */ 0, /* e1b - */ 0, -/* e1c - _0F_E9 */ 0x2444, -/* e1d - _66_0F_E9 */ 0x2445, +/* e1c - _0F_E9 */ 0x2446, +/* e1d - _66_0F_E9 */ 0x2447, /* e1e - */ 0, /* e1f - */ 0, /* e20 - */ 0, @@ -5392,8 +5394,8 @@ _InstNode InstructionsTree[5688] = { /* e25 - */ 0, /* e26 - */ 0, /* e27 - */ 0, -/* e28 - _0F_EA */ 0x2446, -/* e29 - _66_0F_EA */ 0x2447, +/* e28 - _0F_EA */ 0x2448, +/* e29 - _66_0F_EA */ 0x2449, /* e2a - */ 0, /* e2b - */ 0, /* e2c - */ 0, @@ -5404,8 +5406,8 @@ _InstNode InstructionsTree[5688] = { /* e31 - */ 0, /* e32 - */ 0, /* e33 - */ 0, -/* e34 - _0F_EB */ 0x2448, -/* e35 - _66_0F_EB */ 0x2449, +/* e34 - _0F_EB */ 0x244a, +/* e35 - _66_0F_EB */ 0x244b, /* e36 - */ 0, /* e37 - */ 0, /* e38 - */ 0, @@ -5416,8 +5418,8 @@ _InstNode InstructionsTree[5688] = { /* e3d - */ 0, /* e3e - */ 0, /* e3f - */ 0, -/* e40 - _0F_EC */ 0x244a, -/* e41 - _66_0F_EC */ 0x244b, +/* e40 - _0F_EC */ 0x244c, +/* e41 - _66_0F_EC */ 0x244d, /* e42 - */ 0, /* e43 - */ 0, /* e44 - */ 0, @@ -5428,8 +5430,8 @@ _InstNode InstructionsTree[5688] = { /* e49 - */ 0, /* e4a - */ 0, /* e4b - */ 0, -/* e4c - _0F_ED */ 0x244c, -/* e4d - _66_0F_ED */ 0x244d, +/* e4c - _0F_ED */ 0x244e, +/* e4d - _66_0F_ED */ 0x244f, /* e4e - */ 0, /* e4f - */ 0, /* e50 - */ 0, @@ -5440,8 +5442,8 @@ _InstNode InstructionsTree[5688] = { /* e55 - */ 0, /* e56 - */ 0, /* e57 - */ 0, -/* e58 - _0F_EE */ 0x244e, -/* e59 - _66_0F_EE */ 0x244f, +/* e58 - _0F_EE */ 0x2450, +/* e59 - _66_0F_EE */ 0x2451, /* e5a - */ 0, /* e5b - */ 0, /* e5c - */ 0, @@ -5452,8 +5454,8 @@ _InstNode InstructionsTree[5688] = { /* e61 - */ 0, /* e62 - */ 0, /* e63 - */ 0, -/* e64 - _0F_EF */ 0x2450, -/* e65 - _66_0F_EF */ 0x2451, +/* e64 - _0F_EF */ 0x2452, +/* e65 - _66_0F_EF */ 0x2453, /* e66 - */ 0, /* e67 - */ 0, /* e68 - */ 0, @@ -5467,7 +5469,7 @@ _InstNode InstructionsTree[5688] = { /* e70 - */ 0, /* e71 - */ 0, /* e72 - */ 0, -/* e73 - _F2_0F_F0 */ 0x2452, +/* e73 - _F2_0F_F0 */ 0x2454, /* e74 - */ 0, /* e75 - */ 0, /* e76 - */ 0, @@ -5476,8 +5478,8 @@ _InstNode InstructionsTree[5688] = { /* e79 - */ 0, /* e7a - */ 0, /* e7b - */ 0, -/* e7c - _0F_F1 */ 0x2453, -/* e7d - _66_0F_F1 */ 0x2454, +/* e7c - _0F_F1 */ 0x2455, +/* e7d - _66_0F_F1 */ 0x2456, /* e7e - */ 0, /* e7f - */ 0, /* e80 - */ 0, @@ -5488,8 +5490,8 @@ _InstNode InstructionsTree[5688] = { /* e85 - */ 0, /* e86 - */ 0, /* e87 - */ 0, -/* e88 - _0F_F2 */ 0x2455, -/* e89 - _66_0F_F2 */ 0x2456, +/* e88 - _0F_F2 */ 0x2457, +/* e89 - _66_0F_F2 */ 0x2458, /* e8a - */ 0, /* e8b - */ 0, /* e8c - */ 0, @@ -5500,8 +5502,8 @@ _InstNode InstructionsTree[5688] = { /* e91 - */ 0, /* e92 - */ 0, /* e93 - */ 0, -/* e94 - _0F_F3 */ 0x2457, -/* e95 - _66_0F_F3 */ 0x2458, +/* e94 - _0F_F3 */ 0x2459, +/* e95 - _66_0F_F3 */ 0x245a, /* e96 - */ 0, /* e97 - */ 0, /* e98 - */ 0, @@ -5512,8 +5514,8 @@ _InstNode InstructionsTree[5688] = { /* e9d - */ 0, /* e9e - */ 0, /* e9f - */ 0, -/* ea0 - _0F_F4 */ 0x2459, -/* ea1 - _66_0F_F4 */ 0x245a, +/* ea0 - _0F_F4 */ 0x245b, +/* ea1 - _66_0F_F4 */ 0x245c, /* ea2 - */ 0, /* ea3 - */ 0, /* ea4 - */ 0, @@ -5524,8 +5526,8 @@ _InstNode InstructionsTree[5688] = { /* ea9 - */ 0, /* eaa - */ 0, /* eab - */ 0, -/* eac - _0F_F5 */ 0x245b, -/* ead - _66_0F_F5 */ 0x245c, +/* eac - _0F_F5 */ 0x245d, +/* ead - _66_0F_F5 */ 0x245e, /* eae - */ 0, /* eaf - */ 0, /* eb0 - */ 0, @@ -5536,8 +5538,8 @@ _InstNode InstructionsTree[5688] = { /* eb5 - */ 0, /* eb6 - */ 0, /* eb7 - */ 0, -/* eb8 - _0F_F6 */ 0x245d, -/* eb9 - _66_0F_F6 */ 0x245e, +/* eb8 - _0F_F6 */ 0x245f, +/* eb9 - _66_0F_F6 */ 0x2460, /* eba - */ 0, /* ebb - */ 0, /* ebc - */ 0, @@ -5548,8 +5550,8 @@ _InstNode InstructionsTree[5688] = { /* ec1 - */ 0, /* ec2 - */ 0, /* ec3 - */ 0, -/* ec4 - _0F_F7 */ 0x245f, -/* ec5 - _66_0F_F7 */ 0x2460, +/* ec4 - _0F_F7 */ 0x2461, +/* ec5 - _66_0F_F7 */ 0x2462, /* ec6 - */ 0, /* ec7 - */ 0, /* ec8 - */ 0, @@ -5560,8 +5562,8 @@ _InstNode InstructionsTree[5688] = { /* ecd - */ 0, /* ece - */ 0, /* ecf - */ 0, -/* ed0 - _0F_F8 */ 0x2461, -/* ed1 - _66_0F_F8 */ 0x2462, +/* ed0 - _0F_F8 */ 0x2463, +/* ed1 - _66_0F_F8 */ 0x2464, /* ed2 - */ 0, /* ed3 - */ 0, /* ed4 - */ 0, @@ -5572,8 +5574,8 @@ _InstNode InstructionsTree[5688] = { /* ed9 - */ 0, /* eda - */ 0, /* edb - */ 0, -/* edc - _0F_F9 */ 0x2463, -/* edd - _66_0F_F9 */ 0x2464, +/* edc - _0F_F9 */ 0x2465, +/* edd - _66_0F_F9 */ 0x2466, /* ede - */ 0, /* edf - */ 0, /* ee0 - */ 0, @@ -5584,8 +5586,8 @@ _InstNode InstructionsTree[5688] = { /* ee5 - */ 0, /* ee6 - */ 0, /* ee7 - */ 0, -/* ee8 - _0F_FA */ 0x2465, -/* ee9 - _66_0F_FA */ 0x2466, +/* ee8 - _0F_FA */ 0x2467, +/* ee9 - _66_0F_FA */ 0x2468, /* eea - */ 0, /* eeb - */ 0, /* eec - */ 0, @@ -5596,8 +5598,8 @@ _InstNode InstructionsTree[5688] = { /* ef1 - */ 0, /* ef2 - */ 0, /* ef3 - */ 0, -/* ef4 - _0F_FB */ 0x2467, -/* ef5 - _66_0F_FB */ 0x2468, +/* ef4 - _0F_FB */ 0x2469, +/* ef5 - _66_0F_FB */ 0x246a, /* ef6 - */ 0, /* ef7 - */ 0, /* ef8 - */ 0, @@ -5608,8 +5610,8 @@ _InstNode InstructionsTree[5688] = { /* efd - */ 0, /* efe - */ 0, /* eff - */ 0, -/* f00 - _0F_FC */ 0x2469, -/* f01 - _66_0F_FC */ 0x246a, +/* f00 - _0F_FC */ 0x246b, +/* f01 - _66_0F_FC */ 0x246c, /* f02 - */ 0, /* f03 - */ 0, /* f04 - */ 0, @@ -5620,8 +5622,8 @@ _InstNode InstructionsTree[5688] = { /* f09 - */ 0, /* f0a - */ 0, /* f0b - */ 0, -/* f0c - _0F_FD */ 0x246b, -/* f0d - _66_0F_FD */ 0x246c, +/* f0c - _0F_FD */ 0x246d, +/* f0d - _66_0F_FD */ 0x246e, /* f0e - */ 0, /* f0f - */ 0, /* f10 - */ 0, @@ -5632,8 +5634,8 @@ _InstNode InstructionsTree[5688] = { /* f15 - */ 0, /* f16 - */ 0, /* f17 - */ 0, -/* f18 - _0F_FE */ 0x246d, -/* f19 - _66_0F_FE */ 0x246e, +/* f18 - _0F_FE */ 0x246f, +/* f19 - _66_0F_FE */ 0x2470, /* f1a - */ 0, /* f1b - */ 0, /* f1c - */ 0, @@ -5644,8 +5646,8 @@ _InstNode InstructionsTree[5688] = { /* f21 - */ 0, /* f22 - */ 0, /* f23 - */ 0, -/* f24 - _D9_06 */ 0x246f, -/* f25 - _9B_D9_06 */ 0x2470, +/* f24 - _D9_06 */ 0x2471, +/* f25 - _9B_D9_06 */ 0x2472, /* f26 - */ 0, /* f27 - */ 0, /* f28 - */ 0, @@ -5656,8 +5658,8 @@ _InstNode InstructionsTree[5688] = { /* f2d - */ 0, /* f2e - */ 0, /* f2f - */ 0, -/* f30 - _D9_07 */ 0x2471, -/* f31 - _9B_D9_07 */ 0x2472, +/* f30 - _D9_07 */ 0x2473, +/* f31 - _9B_D9_07 */ 0x2474, /* f32 - */ 0, /* f33 - */ 0, /* f34 - */ 0, @@ -5668,8 +5670,8 @@ _InstNode InstructionsTree[5688] = { /* f39 - */ 0, /* f3a - */ 0, /* f3b - */ 0, -/* f3c - _DB_E2 */ 0x2473, -/* f3d - _9B_DB_E2 */ 0x2474, +/* f3c - _DB_E2 */ 0x2475, +/* f3d - _9B_DB_E2 */ 0x2476, /* f3e - */ 0, /* f3f - */ 0, /* f40 - */ 0, @@ -5680,8 +5682,8 @@ _InstNode InstructionsTree[5688] = { /* f45 - */ 0, /* f46 - */ 0, /* f47 - */ 0, -/* f48 - _DB_E3 */ 0x2475, -/* f49 - _9B_DB_E3 */ 0x2476, +/* f48 - _DB_E3 */ 0x2477, +/* f49 - _9B_DB_E3 */ 0x2478, /* f4a - */ 0, /* f4b - */ 0, /* f4c - */ 0, @@ -5692,8 +5694,8 @@ _InstNode InstructionsTree[5688] = { /* f51 - */ 0, /* f52 - */ 0, /* f53 - */ 0, -/* f54 - _DD_06 */ 0x2477, -/* f55 - _9B_DD_06 */ 0x2478, +/* f54 - _DD_06 */ 0x2479, +/* f55 - _9B_DD_06 */ 0x247a, /* f56 - */ 0, /* f57 - */ 0, /* f58 - */ 0, @@ -5704,8 +5706,8 @@ _InstNode InstructionsTree[5688] = { /* f5d - */ 0, /* f5e - */ 0, /* f5f - */ 0, -/* f60 - _DD_07 */ 0x2479, -/* f61 - _9B_DD_07 */ 0x247a, +/* f60 - _DD_07 */ 0x247b, +/* f61 - _9B_DD_07 */ 0x247c, /* f62 - */ 0, /* f63 - */ 0, /* f64 - */ 0, @@ -5716,8 +5718,8 @@ _InstNode InstructionsTree[5688] = { /* f69 - */ 0, /* f6a - */ 0, /* f6b - */ 0, -/* f6c - _DF_E0 */ 0x247b, -/* f6d - _9B_DF_E0 */ 0x247c, +/* f6c - _DF_E0 */ 0x247d, +/* f6d - _9B_DF_E0 */ 0x247e, /* f6e - */ 0, /* f6f - */ 0, /* f70 - */ 0, @@ -5728,8 +5730,8 @@ _InstNode InstructionsTree[5688] = { /* f75 - */ 0, /* f76 - */ 0, /* f77 - */ 0, -/* f78 - _0F_38_00 */ 0x247d, -/* f79 - _66_0F_38_00 */ 0x247e, +/* f78 - _0F_38_00 */ 0x247f, +/* f79 - _66_0F_38_00 */ 0x2480, /* f7a - */ 0, /* f7b - */ 0, /* f7c - */ 0, @@ -5740,8 +5742,8 @@ _InstNode InstructionsTree[5688] = { /* f81 - */ 0, /* f82 - */ 0, /* f83 - */ 0, -/* f84 - _0F_38_01 */ 0x247f, -/* f85 - _66_0F_38_01 */ 0x2480, +/* f84 - _0F_38_01 */ 0x2481, +/* f85 - _66_0F_38_01 */ 0x2482, /* f86 - */ 0, /* f87 - */ 0, /* f88 - */ 0, @@ -5752,8 +5754,8 @@ _InstNode InstructionsTree[5688] = { /* f8d - */ 0, /* f8e - */ 0, /* f8f - */ 0, -/* f90 - _0F_38_02 */ 0x2481, -/* f91 - _66_0F_38_02 */ 0x2482, +/* f90 - _0F_38_02 */ 0x2483, +/* f91 - _66_0F_38_02 */ 0x2484, /* f92 - */ 0, /* f93 - */ 0, /* f94 - */ 0, @@ -5764,8 +5766,8 @@ _InstNode InstructionsTree[5688] = { /* f99 - */ 0, /* f9a - */ 0, /* f9b - */ 0, -/* f9c - _0F_38_03 */ 0x2483, -/* f9d - _66_0F_38_03 */ 0x2484, +/* f9c - _0F_38_03 */ 0x2485, +/* f9d - _66_0F_38_03 */ 0x2486, /* f9e - */ 0, /* f9f - */ 0, /* fa0 - */ 0, @@ -5776,8 +5778,8 @@ _InstNode InstructionsTree[5688] = { /* fa5 - */ 0, /* fa6 - */ 0, /* fa7 - */ 0, -/* fa8 - _0F_38_04 */ 0x2485, -/* fa9 - _66_0F_38_04 */ 0x2486, +/* fa8 - _0F_38_04 */ 0x2487, +/* fa9 - _66_0F_38_04 */ 0x2488, /* faa - */ 0, /* fab - */ 0, /* fac - */ 0, @@ -5788,8 +5790,8 @@ _InstNode InstructionsTree[5688] = { /* fb1 - */ 0, /* fb2 - */ 0, /* fb3 - */ 0, -/* fb4 - _0F_38_05 */ 0x2487, -/* fb5 - _66_0F_38_05 */ 0x2488, +/* fb4 - _0F_38_05 */ 0x2489, +/* fb5 - _66_0F_38_05 */ 0x248a, /* fb6 - */ 0, /* fb7 - */ 0, /* fb8 - */ 0, @@ -5800,8 +5802,8 @@ _InstNode InstructionsTree[5688] = { /* fbd - */ 0, /* fbe - */ 0, /* fbf - */ 0, -/* fc0 - _0F_38_06 */ 0x2489, -/* fc1 - _66_0F_38_06 */ 0x248a, +/* fc0 - _0F_38_06 */ 0x248b, +/* fc1 - _66_0F_38_06 */ 0x248c, /* fc2 - */ 0, /* fc3 - */ 0, /* fc4 - */ 0, @@ -5812,8 +5814,8 @@ _InstNode InstructionsTree[5688] = { /* fc9 - */ 0, /* fca - */ 0, /* fcb - */ 0, -/* fcc - _0F_38_07 */ 0x248b, -/* fcd - _66_0F_38_07 */ 0x248c, +/* fcc - _0F_38_07 */ 0x248d, +/* fcd - _66_0F_38_07 */ 0x248e, /* fce - */ 0, /* fcf - */ 0, /* fd0 - */ 0, @@ -5824,8 +5826,8 @@ _InstNode InstructionsTree[5688] = { /* fd5 - */ 0, /* fd6 - */ 0, /* fd7 - */ 0, -/* fd8 - _0F_38_08 */ 0x248d, -/* fd9 - _66_0F_38_08 */ 0x248e, +/* fd8 - _0F_38_08 */ 0x248f, +/* fd9 - _66_0F_38_08 */ 0x2490, /* fda - */ 0, /* fdb - */ 0, /* fdc - */ 0, @@ -5836,8 +5838,8 @@ _InstNode InstructionsTree[5688] = { /* fe1 - */ 0, /* fe2 - */ 0, /* fe3 - */ 0, -/* fe4 - _0F_38_09 */ 0x248f, -/* fe5 - _66_0F_38_09 */ 0x2490, +/* fe4 - _0F_38_09 */ 0x2491, +/* fe5 - _66_0F_38_09 */ 0x2492, /* fe6 - */ 0, /* fe7 - */ 0, /* fe8 - */ 0, @@ -5848,8 +5850,8 @@ _InstNode InstructionsTree[5688] = { /* fed - */ 0, /* fee - */ 0, /* fef - */ 0, -/* ff0 - _0F_38_0A */ 0x2491, -/* ff1 - _66_0F_38_0A */ 0x2492, +/* ff0 - _0F_38_0A */ 0x2493, +/* ff1 - _66_0F_38_0A */ 0x2494, /* ff2 - */ 0, /* ff3 - */ 0, /* ff4 - */ 0, @@ -5860,8 +5862,8 @@ _InstNode InstructionsTree[5688] = { /* ff9 - */ 0, /* ffa - */ 0, /* ffb - */ 0, -/* ffc - _0F_38_0B */ 0x2493, -/* ffd - _66_0F_38_0B */ 0x2494, +/* ffc - _0F_38_0B */ 0x2495, +/* ffd - _66_0F_38_0B */ 0x2496, /* ffe - */ 0, /* fff - */ 0, /* 1000 - */ 0, @@ -5957,7 +5959,7 @@ _InstNode InstructionsTree[5688] = { /* 105a - */ 0, /* 105b - */ 0, /* 105c - */ 0, -/* 105d - _66_0F_38_17 */ 0x2495, +/* 105d - _66_0F_38_17 */ 0x2497, /* 105e - */ 0, /* 105f - */ 0, /* 1060 - */ 0, @@ -6004,8 +6006,8 @@ _InstNode InstructionsTree[5688] = { /* 1089 - */ 0, /* 108a - */ 0, /* 108b - */ 0, -/* 108c - _0F_38_1C */ 0x2496, -/* 108d - _66_0F_38_1C */ 0x2497, +/* 108c - _0F_38_1C */ 0x2498, +/* 108d - _66_0F_38_1C */ 0x2499, /* 108e - */ 0, /* 108f - */ 0, /* 1090 - */ 0, @@ -6016,8 +6018,8 @@ _InstNode InstructionsTree[5688] = { /* 1095 - */ 0, /* 1096 - */ 0, /* 1097 - */ 0, -/* 1098 - _0F_38_1D */ 0x2498, -/* 1099 - _66_0F_38_1D */ 0x2499, +/* 1098 - _0F_38_1D */ 0x249a, +/* 1099 - _66_0F_38_1D */ 0x249b, /* 109a - */ 0, /* 109b - */ 0, /* 109c - */ 0, @@ -6028,8 +6030,8 @@ _InstNode InstructionsTree[5688] = { /* 10a1 - */ 0, /* 10a2 - */ 0, /* 10a3 - */ 0, -/* 10a4 - _0F_38_1E */ 0x249a, -/* 10a5 - _66_0F_38_1E */ 0x249b, +/* 10a4 - _0F_38_1E */ 0x249c, +/* 10a5 - _66_0F_38_1E */ 0x249d, /* 10a6 - */ 0, /* 10a7 - */ 0, /* 10a8 - */ 0, @@ -6041,7 +6043,7 @@ _InstNode InstructionsTree[5688] = { /* 10ae - */ 0, /* 10af - */ 0, /* 10b0 - */ 0, -/* 10b1 - _66_0F_38_20 */ 0x249c, +/* 10b1 - _66_0F_38_20 */ 0x249e, /* 10b2 - */ 0, /* 10b3 - */ 0, /* 10b4 - */ 0, @@ -6053,7 +6055,7 @@ _InstNode InstructionsTree[5688] = { /* 10ba - */ 0, /* 10bb - */ 0, /* 10bc - */ 0, -/* 10bd - _66_0F_38_21 */ 0x249d, +/* 10bd - _66_0F_38_21 */ 0x249f, /* 10be - */ 0, /* 10bf - */ 0, /* 10c0 - */ 0, @@ -6065,7 +6067,7 @@ _InstNode InstructionsTree[5688] = { /* 10c6 - */ 0, /* 10c7 - */ 0, /* 10c8 - */ 0, -/* 10c9 - _66_0F_38_22 */ 0x249e, +/* 10c9 - _66_0F_38_22 */ 0x24a0, /* 10ca - */ 0, /* 10cb - */ 0, /* 10cc - */ 0, @@ -6077,7 +6079,7 @@ _InstNode InstructionsTree[5688] = { /* 10d2 - */ 0, /* 10d3 - */ 0, /* 10d4 - */ 0, -/* 10d5 - _66_0F_38_23 */ 0x249f, +/* 10d5 - _66_0F_38_23 */ 0x24a1, /* 10d6 - */ 0, /* 10d7 - */ 0, /* 10d8 - */ 0, @@ -6089,7 +6091,7 @@ _InstNode InstructionsTree[5688] = { /* 10de - */ 0, /* 10df - */ 0, /* 10e0 - */ 0, -/* 10e1 - _66_0F_38_24 */ 0x24a0, +/* 10e1 - _66_0F_38_24 */ 0x24a2, /* 10e2 - */ 0, /* 10e3 - */ 0, /* 10e4 - */ 0, @@ -6101,7 +6103,7 @@ _InstNode InstructionsTree[5688] = { /* 10ea - */ 0, /* 10eb - */ 0, /* 10ec - */ 0, -/* 10ed - _66_0F_38_25 */ 0x24a1, +/* 10ed - _66_0F_38_25 */ 0x24a3, /* 10ee - */ 0, /* 10ef - */ 0, /* 10f0 - */ 0, @@ -6113,7 +6115,7 @@ _InstNode InstructionsTree[5688] = { /* 10f6 - */ 0, /* 10f7 - */ 0, /* 10f8 - */ 0, -/* 10f9 - _66_0F_38_28 */ 0x24a2, +/* 10f9 - _66_0F_38_28 */ 0x24a4, /* 10fa - */ 0, /* 10fb - */ 0, /* 10fc - */ 0, @@ -6125,7 +6127,7 @@ _InstNode InstructionsTree[5688] = { /* 1102 - */ 0, /* 1103 - */ 0, /* 1104 - */ 0, -/* 1105 - _66_0F_38_29 */ 0x24a3, +/* 1105 - _66_0F_38_29 */ 0x24a5, /* 1106 - */ 0, /* 1107 - */ 0, /* 1108 - */ 0, @@ -6137,7 +6139,7 @@ _InstNode InstructionsTree[5688] = { /* 110e - */ 0, /* 110f - */ 0, /* 1110 - */ 0, -/* 1111 - _66_0F_38_2A */ 0x24a4, +/* 1111 - _66_0F_38_2A */ 0x24a6, /* 1112 - */ 0, /* 1113 - */ 0, /* 1114 - */ 0, @@ -6149,7 +6151,7 @@ _InstNode InstructionsTree[5688] = { /* 111a - */ 0, /* 111b - */ 0, /* 111c - */ 0, -/* 111d - _66_0F_38_2B */ 0x24a5, +/* 111d - _66_0F_38_2B */ 0x24a7, /* 111e - */ 0, /* 111f - */ 0, /* 1120 - */ 0, @@ -6209,7 +6211,7 @@ _InstNode InstructionsTree[5688] = { /* 1156 - */ 0, /* 1157 - */ 0, /* 1158 - */ 0, -/* 1159 - _66_0F_38_30 */ 0x24a6, +/* 1159 - _66_0F_38_30 */ 0x24a8, /* 115a - */ 0, /* 115b - */ 0, /* 115c - */ 0, @@ -6221,7 +6223,7 @@ _InstNode InstructionsTree[5688] = { /* 1162 - */ 0, /* 1163 - */ 0, /* 1164 - */ 0, -/* 1165 - _66_0F_38_31 */ 0x24a7, +/* 1165 - _66_0F_38_31 */ 0x24a9, /* 1166 - */ 0, /* 1167 - */ 0, /* 1168 - */ 0, @@ -6233,7 +6235,7 @@ _InstNode InstructionsTree[5688] = { /* 116e - */ 0, /* 116f - */ 0, /* 1170 - */ 0, -/* 1171 - _66_0F_38_32 */ 0x24a8, +/* 1171 - _66_0F_38_32 */ 0x24aa, /* 1172 - */ 0, /* 1173 - */ 0, /* 1174 - */ 0, @@ -6245,7 +6247,7 @@ _InstNode InstructionsTree[5688] = { /* 117a - */ 0, /* 117b - */ 0, /* 117c - */ 0, -/* 117d - _66_0F_38_33 */ 0x24a9, +/* 117d - _66_0F_38_33 */ 0x24ab, /* 117e - */ 0, /* 117f - */ 0, /* 1180 - */ 0, @@ -6257,7 +6259,7 @@ _InstNode InstructionsTree[5688] = { /* 1186 - */ 0, /* 1187 - */ 0, /* 1188 - */ 0, -/* 1189 - _66_0F_38_34 */ 0x24aa, +/* 1189 - _66_0F_38_34 */ 0x24ac, /* 118a - */ 0, /* 118b - */ 0, /* 118c - */ 0, @@ -6269,7 +6271,7 @@ _InstNode InstructionsTree[5688] = { /* 1192 - */ 0, /* 1193 - */ 0, /* 1194 - */ 0, -/* 1195 - _66_0F_38_35 */ 0x24ab, +/* 1195 - _66_0F_38_35 */ 0x24ad, /* 1196 - */ 0, /* 1197 - */ 0, /* 1198 - */ 0, @@ -6281,7 +6283,7 @@ _InstNode InstructionsTree[5688] = { /* 119e - */ 0, /* 119f - */ 0, /* 11a0 - */ 0, -/* 11a1 - _66_0F_38_37 */ 0x24ac, +/* 11a1 - _66_0F_38_37 */ 0x24ae, /* 11a2 - */ 0, /* 11a3 - */ 0, /* 11a4 - */ 0, @@ -6293,7 +6295,7 @@ _InstNode InstructionsTree[5688] = { /* 11aa - */ 0, /* 11ab - */ 0, /* 11ac - */ 0, -/* 11ad - _66_0F_38_38 */ 0x24ad, +/* 11ad - _66_0F_38_38 */ 0x24af, /* 11ae - */ 0, /* 11af - */ 0, /* 11b0 - */ 0, @@ -6305,7 +6307,7 @@ _InstNode InstructionsTree[5688] = { /* 11b6 - */ 0, /* 11b7 - */ 0, /* 11b8 - */ 0, -/* 11b9 - _66_0F_38_39 */ 0x24ae, +/* 11b9 - _66_0F_38_39 */ 0x24b0, /* 11ba - */ 0, /* 11bb - */ 0, /* 11bc - */ 0, @@ -6317,7 +6319,7 @@ _InstNode InstructionsTree[5688] = { /* 11c2 - */ 0, /* 11c3 - */ 0, /* 11c4 - */ 0, -/* 11c5 - _66_0F_38_3A */ 0x24af, +/* 11c5 - _66_0F_38_3A */ 0x24b1, /* 11c6 - */ 0, /* 11c7 - */ 0, /* 11c8 - */ 0, @@ -6329,7 +6331,7 @@ _InstNode InstructionsTree[5688] = { /* 11ce - */ 0, /* 11cf - */ 0, /* 11d0 - */ 0, -/* 11d1 - _66_0F_38_3B */ 0x24b0, +/* 11d1 - _66_0F_38_3B */ 0x24b2, /* 11d2 - */ 0, /* 11d3 - */ 0, /* 11d4 - */ 0, @@ -6341,7 +6343,7 @@ _InstNode InstructionsTree[5688] = { /* 11da - */ 0, /* 11db - */ 0, /* 11dc - */ 0, -/* 11dd - _66_0F_38_3C */ 0x24b1, +/* 11dd - _66_0F_38_3C */ 0x24b3, /* 11de - */ 0, /* 11df - */ 0, /* 11e0 - */ 0, @@ -6353,7 +6355,7 @@ _InstNode InstructionsTree[5688] = { /* 11e6 - */ 0, /* 11e7 - */ 0, /* 11e8 - */ 0, -/* 11e9 - _66_0F_38_3D */ 0x24b2, +/* 11e9 - _66_0F_38_3D */ 0x24b4, /* 11ea - */ 0, /* 11eb - */ 0, /* 11ec - */ 0, @@ -6365,7 +6367,7 @@ _InstNode InstructionsTree[5688] = { /* 11f2 - */ 0, /* 11f3 - */ 0, /* 11f4 - */ 0, -/* 11f5 - _66_0F_38_3E */ 0x24b3, +/* 11f5 - _66_0F_38_3E */ 0x24b5, /* 11f6 - */ 0, /* 11f7 - */ 0, /* 11f8 - */ 0, @@ -6377,7 +6379,7 @@ _InstNode InstructionsTree[5688] = { /* 11fe - */ 0, /* 11ff - */ 0, /* 1200 - */ 0, -/* 1201 - _66_0F_38_3F */ 0x24b4, +/* 1201 - _66_0F_38_3F */ 0x24b6, /* 1202 - */ 0, /* 1203 - */ 0, /* 1204 - */ 0, @@ -6389,7 +6391,7 @@ _InstNode InstructionsTree[5688] = { /* 120a - */ 0, /* 120b - */ 0, /* 120c - */ 0, -/* 120d - _66_0F_38_40 */ 0x24b5, +/* 120d - _66_0F_38_40 */ 0x24b7, /* 120e - */ 0, /* 120f - */ 0, /* 1210 - */ 0, @@ -6401,7 +6403,7 @@ _InstNode InstructionsTree[5688] = { /* 1216 - */ 0, /* 1217 - */ 0, /* 1218 - */ 0, -/* 1219 - _66_0F_38_41 */ 0x24b6, +/* 1219 - _66_0F_38_41 */ 0x24b8, /* 121a - */ 0, /* 121b - */ 0, /* 121c - */ 0, @@ -6413,7 +6415,7 @@ _InstNode InstructionsTree[5688] = { /* 1222 - */ 0, /* 1223 - */ 0, /* 1224 - */ 0, -/* 1225 - _66_0F_38_80 */ 0x24b7, +/* 1225 - _66_0F_38_80 */ 0x24b9, /* 1226 - */ 0, /* 1227 - */ 0, /* 1228 - */ 0, @@ -6425,7 +6427,7 @@ _InstNode InstructionsTree[5688] = { /* 122e - */ 0, /* 122f - */ 0, /* 1230 - */ 0, -/* 1231 - _66_0F_38_81 */ 0x24b8, +/* 1231 - _66_0F_38_81 */ 0x24ba, /* 1232 - */ 0, /* 1233 - */ 0, /* 1234 - */ 0, @@ -6437,7 +6439,7 @@ _InstNode InstructionsTree[5688] = { /* 123a - */ 0, /* 123b - */ 0, /* 123c - */ 0, -/* 123d - _66_0F_38_82 */ 0x24b9, +/* 123d - _66_0F_38_82 */ 0x24bb, /* 123e - */ 0, /* 123f - */ 0, /* 1240 - */ 0, @@ -6809,7 +6811,7 @@ _InstNode InstructionsTree[5688] = { /* 13ae - */ 0, /* 13af - */ 0, /* 13b0 - */ 0, -/* 13b1 - _66_0F_38_DB */ 0x24ba, +/* 13b1 - _66_0F_38_DB */ 0x24bc, /* 13b2 - */ 0, /* 13b3 - */ 0, /* 13b4 - */ 0, @@ -6821,7 +6823,7 @@ _InstNode InstructionsTree[5688] = { /* 13ba - */ 0, /* 13bb - */ 0, /* 13bc - */ 0, -/* 13bd - _66_0F_38_DC */ 0x24bb, +/* 13bd - _66_0F_38_DC */ 0x24bd, /* 13be - */ 0, /* 13bf - */ 0, /* 13c0 - */ 0, @@ -6833,7 +6835,7 @@ _InstNode InstructionsTree[5688] = { /* 13c6 - */ 0, /* 13c7 - */ 0, /* 13c8 - */ 0, -/* 13c9 - _66_0F_38_DD */ 0x24bc, +/* 13c9 - _66_0F_38_DD */ 0x24be, /* 13ca - */ 0, /* 13cb - */ 0, /* 13cc - */ 0, @@ -6845,7 +6847,7 @@ _InstNode InstructionsTree[5688] = { /* 13d2 - */ 0, /* 13d3 - */ 0, /* 13d4 - */ 0, -/* 13d5 - _66_0F_38_DE */ 0x24bd, +/* 13d5 - _66_0F_38_DE */ 0x24bf, /* 13d6 - */ 0, /* 13d7 - */ 0, /* 13d8 - */ 0, @@ -6857,7 +6859,7 @@ _InstNode InstructionsTree[5688] = { /* 13de - */ 0, /* 13df - */ 0, /* 13e0 - */ 0, -/* 13e1 - _66_0F_38_DF */ 0x24be, +/* 13e1 - _66_0F_38_DF */ 0x24c0, /* 13e2 - */ 0, /* 13e3 - */ 0, /* 13e4 - */ 0, @@ -6868,10 +6870,10 @@ _InstNode InstructionsTree[5688] = { /* 13e9 - */ 0, /* 13ea - */ 0, /* 13eb - */ 0, -/* 13ec - _0F_38_F0 */ 0x24bf, +/* 13ec - _0F_38_F0 */ 0x24c1, /* 13ed - */ 0, /* 13ee - */ 0, -/* 13ef - _F2_0F_38_F0 */ 0x24c0, +/* 13ef - _F2_0F_38_F0 */ 0x24c2, /* 13f0 - */ 0, /* 13f1 - */ 0, /* 13f2 - */ 0, @@ -6880,10 +6882,10 @@ _InstNode InstructionsTree[5688] = { /* 13f5 - */ 0, /* 13f6 - */ 0, /* 13f7 - */ 0, -/* 13f8 - _0F_38_F1 */ 0x24c1, +/* 13f8 - _0F_38_F1 */ 0x24c3, /* 13f9 - */ 0, /* 13fa - */ 0, -/* 13fb - _F2_0F_38_F1 */ 0x24c2, +/* 13fb - _F2_0F_38_F1 */ 0x24c4, /* 13fc - */ 0, /* 13fd - */ 0, /* 13fe - */ 0, @@ -7276,8 +7278,8 @@ _InstNode InstructionsTree[5688] = { /* 1581 - */ 0, /* 1582 - */ 0, /* 1583 - */ 0, -/* 1584 - _0F_71_02 */ 0x24c3, -/* 1585 - _66_0F_71_02 */ 0x24c4, +/* 1584 - _0F_71_02 */ 0x24c5, +/* 1585 - _66_0F_71_02 */ 0x24c6, /* 1586 - */ 0, /* 1587 - */ 0, /* 1588 - */ 0, @@ -7288,8 +7290,8 @@ _InstNode InstructionsTree[5688] = { /* 158d - */ 0, /* 158e - */ 0, /* 158f - */ 0, -/* 1590 - _0F_71_04 */ 0x24c5, -/* 1591 - _66_0F_71_04 */ 0x24c6, +/* 1590 - _0F_71_04 */ 0x24c7, +/* 1591 - _66_0F_71_04 */ 0x24c8, /* 1592 - */ 0, /* 1593 - */ 0, /* 1594 - */ 0, @@ -7300,8 +7302,8 @@ _InstNode InstructionsTree[5688] = { /* 1599 - */ 0, /* 159a - */ 0, /* 159b - */ 0, -/* 159c - _0F_71_06 */ 0x24c7, -/* 159d - _66_0F_71_06 */ 0x24c8, +/* 159c - _0F_71_06 */ 0x24c9, +/* 159d - _66_0F_71_06 */ 0x24ca, /* 159e - */ 0, /* 159f - */ 0, /* 15a0 - */ 0, @@ -7312,8 +7314,8 @@ _InstNode InstructionsTree[5688] = { /* 15a5 - */ 0, /* 15a6 - */ 0, /* 15a7 - */ 0, -/* 15a8 - _0F_72_02 */ 0x24c9, -/* 15a9 - _66_0F_72_02 */ 0x24ca, +/* 15a8 - _0F_72_02 */ 0x24cb, +/* 15a9 - _66_0F_72_02 */ 0x24cc, /* 15aa - */ 0, /* 15ab - */ 0, /* 15ac - */ 0, @@ -7324,8 +7326,8 @@ _InstNode InstructionsTree[5688] = { /* 15b1 - */ 0, /* 15b2 - */ 0, /* 15b3 - */ 0, -/* 15b4 - _0F_72_04 */ 0x24cb, -/* 15b5 - _66_0F_72_04 */ 0x24cc, +/* 15b4 - _0F_72_04 */ 0x24cd, +/* 15b5 - _66_0F_72_04 */ 0x24ce, /* 15b6 - */ 0, /* 15b7 - */ 0, /* 15b8 - */ 0, @@ -7336,8 +7338,8 @@ _InstNode InstructionsTree[5688] = { /* 15bd - */ 0, /* 15be - */ 0, /* 15bf - */ 0, -/* 15c0 - _0F_72_06 */ 0x24cd, -/* 15c1 - _66_0F_72_06 */ 0x24ce, +/* 15c0 - _0F_72_06 */ 0x24cf, +/* 15c1 - _66_0F_72_06 */ 0x24d0, /* 15c2 - */ 0, /* 15c3 - */ 0, /* 15c4 - */ 0, @@ -7348,8 +7350,8 @@ _InstNode InstructionsTree[5688] = { /* 15c9 - */ 0, /* 15ca - */ 0, /* 15cb - */ 0, -/* 15cc - _0F_73_02 */ 0x24cf, -/* 15cd - _66_0F_73_02 */ 0x24d0, +/* 15cc - _0F_73_02 */ 0x24d1, +/* 15cd - _66_0F_73_02 */ 0x24d2, /* 15ce - */ 0, /* 15cf - */ 0, /* 15d0 - */ 0, @@ -7361,7 +7363,7 @@ _InstNode InstructionsTree[5688] = { /* 15d6 - */ 0, /* 15d7 - */ 0, /* 15d8 - */ 0, -/* 15d9 - _66_0F_73_03 */ 0x24d1, +/* 15d9 - _66_0F_73_03 */ 0x24d3, /* 15da - */ 0, /* 15db - */ 0, /* 15dc - */ 0, @@ -7372,8 +7374,8 @@ _InstNode InstructionsTree[5688] = { /* 15e1 - */ 0, /* 15e2 - */ 0, /* 15e3 - */ 0, -/* 15e4 - _0F_73_06 */ 0x24d2, -/* 15e5 - _66_0F_73_06 */ 0x24d3, +/* 15e4 - _0F_73_06 */ 0x24d4, +/* 15e5 - _66_0F_73_06 */ 0x24d5, /* 15e6 - */ 0, /* 15e7 - */ 0, /* 15e8 - */ 0, @@ -7385,7 +7387,7 @@ _InstNode InstructionsTree[5688] = { /* 15ee - */ 0, /* 15ef - */ 0, /* 15f0 - */ 0, -/* 15f1 - _66_0F_73_07 */ 0x24d4, +/* 15f1 - _66_0F_73_07 */ 0x24d6, /* 15f2 - */ 0, /* 15f3 - */ 0, /* 15f4 - */ 0, @@ -7398,7 +7400,7 @@ _InstNode InstructionsTree[5688] = { /* 15fb - */ 0, /* 15fc - _0F_AE_00 */ 0x4179, /* 15fd - */ 0, -/* 15fe - _F3_0F_AE_00 */ 0x24d5, +/* 15fe - _F3_0F_AE_00 */ 0x24d7, /* 15ff - */ 0, /* 1600 - */ 0, /* 1601 - */ 0, @@ -7410,7 +7412,7 @@ _InstNode InstructionsTree[5688] = { /* 1607 - */ 0, /* 1608 - _0F_AE_01 */ 0x417a, /* 1609 - */ 0, -/* 160a - _F3_0F_AE_01 */ 0x24d6, +/* 160a - _F3_0F_AE_01 */ 0x24d8, /* 160b - */ 0, /* 160c - */ 0, /* 160d - */ 0, @@ -7420,9 +7422,9 @@ _InstNode InstructionsTree[5688] = { /* 1611 - */ 0, /* 1612 - */ 0, /* 1613 - */ 0, -/* 1614 - _0F_AE_02 */ 0x24d7, +/* 1614 - _0F_AE_02 */ 0x24d9, /* 1615 - */ 0, -/* 1616 - _F3_0F_AE_02 */ 0x24d8, +/* 1616 - _F3_0F_AE_02 */ 0x24da, /* 1617 - */ 0, /* 1618 - _V_0F_AE_02 */ 0x417b, /* 1619 - */ 0, @@ -7432,9 +7434,9 @@ _InstNode InstructionsTree[5688] = { /* 161d - */ 0, /* 161e - */ 0, /* 161f - */ 0, -/* 1620 - _0F_AE_03 */ 0x24d9, +/* 1620 - _0F_AE_03 */ 0x24db, /* 1621 - */ 0, -/* 1622 - _F3_0F_AE_03 */ 0x24da, +/* 1622 - _F3_0F_AE_03 */ 0x24dc, /* 1623 - */ 0, /* 1624 - _V_0F_AE_03 */ 0x417c, /* 1625 - */ 0, @@ -7444,9 +7446,9 @@ _InstNode InstructionsTree[5688] = { /* 1629 - */ 0, /* 162a - */ 0, /* 162b - */ 0, -/* 162c - _0F_C7_06 */ 0x24db, -/* 162d - _66_0F_C7_06 */ 0x24dc, -/* 162e - _F3_0F_C7_06 */ 0x24dd, +/* 162c - _0F_C7_06 */ 0x24dd, +/* 162d - _66_0F_C7_06 */ 0x24de, +/* 162e - _F3_0F_C7_06 */ 0x24df, /* 162f - */ 0, /* 1630 - */ 0, /* 1631 - */ 0, @@ -7458,478 +7460,481 @@ _InstNode InstructionsTree[5688] = { /* 1637 - */ 0 }; -_InstSharedInfo InstSharedInfoTable[471] = { -{0, 9, 15, 8, 245, 0, 0}, -{0, 11, 17, 8, 245, 0, 0}, -{0, 15, 9, 8, 245, 0, 0}, -{0, 17, 11, 8, 245, 0, 0}, -{1, 1, 33, 8, 245, 0, 0}, -{1, 3, 35, 8, 245, 0, 0}, -{2, 0, 32, 8, 0, 0, 0}, -{3, 0, 32, 8, 0, 0, 0}, -{0, 9, 15, 8, 196, 16, 0}, -{0, 11, 17, 8, 196, 16, 0}, -{0, 15, 9, 8, 196, 16, 0}, -{0, 17, 11, 8, 196, 16, 0}, -{1, 1, 33, 8, 196, 16, 0}, -{1, 3, 35, 8, 196, 16, 0}, -{4, 0, 32, 8, 0, 0, 0}, -{0, 9, 15, 8, 245, 1, 0}, -{0, 11, 17, 8, 245, 1, 0}, -{0, 15, 9, 8, 245, 1, 0}, -{0, 17, 11, 8, 245, 1, 0}, -{1, 1, 33, 8, 245, 1, 0}, -{1, 3, 35, 8, 245, 1, 0}, -{5, 0, 32, 8, 0, 0, 0}, -{6, 0, 32, 8, 0, 0, 0}, -{7, 0, 32, 8, 0, 0, 0}, -{8, 0, 32, 8, 0, 0, 0}, -{0, 9, 15, 8, 229, 0, 16}, -{0, 11, 17, 8, 229, 0, 16}, -{0, 15, 9, 8, 229, 0, 16}, -{0, 17, 11, 8, 229, 0, 16}, -{1, 1, 33, 8, 229, 0, 16}, -{1, 3, 35, 8, 229, 0, 16}, -{9, 0, 0, 8, 213, 17, 32}, -{0, 9, 15, 8, 196, 0, 16}, -{0, 11, 17, 8, 196, 0, 16}, -{0, 15, 9, 8, 196, 0, 16}, -{0, 17, 11, 8, 196, 0, 16}, -{1, 1, 33, 8, 196, 0, 16}, -{1, 3, 35, 8, 196, 0, 16}, -{9, 0, 0, 8, 17, 16, 228}, -{10, 9, 15, 8, 245, 0, 0}, -{10, 11, 17, 8, 245, 0, 0}, -{10, 15, 9, 8, 245, 0, 0}, -{10, 17, 11, 8, 245, 0, 0}, -{11, 1, 33, 8, 245, 0, 0}, -{11, 3, 35, 8, 245, 0, 0}, -{12, 0, 54, 8, 244, 0, 0}, -{13, 0, 54, 8, 0, 0, 0}, -{14, 0, 54, 8, 0, 0, 0}, -{15, 0, 0, 8, 0, 0, 0}, -{16, 42, 11, 8, 0, 0, 0}, -{10, 10, 16, 8, 64, 0, 0}, -{13, 0, 3, 8, 0, 0, 0}, -{17, 17, 11, 8, 33, 0, 212}, -{18, 0, 5, 8, 0, 0, 0}, -{19, 59, 56, 8, 0, 8, 0}, -{20, 59, 56, 8, 0, 8, 0}, -{19, 55, 59, 8, 0, 8, 0}, -{20, 55, 59, 8, 0, 8, 0}, -{13, 0, 40, 13, 0, 32, 0}, -{13, 0, 40, 13, 0, 1, 0}, -{13, 0, 40, 13, 0, 64, 0}, -{13, 0, 40, 13, 0, 65, 0}, -{13, 0, 40, 13, 0, 128, 0}, -{13, 0, 40, 13, 0, 4, 0}, -{13, 0, 40, 13, 0, 160, 0}, -{13, 0, 40, 13, 0, 224, 0}, -{10, 9, 15, 8, 196, 0, 16}, -{10, 11, 17, 8, 196, 0, 16}, -{0, 9, 15, 8, 0, 0, 0}, -{0, 11, 17, 8, 0, 0, 0}, -{21, 9, 15, 8, 0, 0, 0}, -{21, 11, 17, 8, 0, 0, 0}, -{21, 15, 9, 8, 0, 0, 0}, -{21, 17, 11, 8, 0, 0, 0}, -{21, 31, 28, 8, 0, 0, 0}, -{21, 42, 11, 8, 0, 0, 0}, -{21, 28, 31, 8, 0, 0, 0}, -{1, 35, 54, 8, 0, 0, 0}, -{22, 0, 0, 8, 0, 0, 0}, -{9, 0, 38, 9, 0, 0, 0}, -{23, 0, 0, 8, 0, 0, 0}, -{23, 0, 0, 8, 255, 0, 0}, -{11, 0, 0, 8, 213, 0, 0}, -{11, 0, 0, 8, 0, 0, 0}, -{1, 49, 33, 8, 0, 0, 0}, -{1, 50, 35, 8, 0, 0, 0}, -{1, 33, 49, 8, 0, 0, 0}, -{1, 35, 50, 8, 0, 0, 0}, -{24, 55, 56, 8, 0, 8, 0}, -{25, 55, 56, 8, 0, 8, 0}, -{19, 56, 55, 8, 245, 8, 0}, -{26, 56, 55, 8, 245, 8, 0}, -{11, 1, 33, 8, 196, 0, 16}, -{11, 3, 35, 8, 196, 0, 16}, -{19, 33, 56, 8, 0, 8, 0}, -{26, 35, 56, 8, 0, 8, 0}, -{19, 55, 33, 8, 0, 8, 0}, -{26, 55, 35, 8, 0, 8, 0}, -{19, 33, 56, 8, 245, 8, 0}, -{26, 35, 56, 8, 245, 8, 0}, -{1, 1, 53, 8, 0, 0, 0}, -{27, 3, 54, 8, 0, 0, 0}, -{13, 0, 2, 10, 0, 0, 0}, -{13, 0, 0, 10, 0, 0, 0}, -{16, 37, 11, 8, 0, 0, 0}, -{13, 8, 6, 8, 0, 0, 0}, -{13, 0, 0, 8, 0, 0, 0}, -{28, 0, 2, 10, 0, 0, 0}, -{28, 0, 0, 10, 0, 0, 0}, -{11, 0, 0, 14, 0, 0, 0}, -{11, 0, 1, 14, 0, 0, 0}, -{9, 0, 0, 14, 0, 0, 0}, -{28, 0, 0, 10, 255, 0, 0}, -{9, 0, 1, 8, 196, 0, 49}, -{9, 0, 0, 8, 0, 0, 0}, -{29, 0, 57, 8, 0, 0, 0}, -{30, 0, 40, 13, 0, 64, 0}, -{30, 0, 40, 13, 0, 0, 0}, -{31, 0, 40, 13, 0, 0, 0}, -{1, 1, 33, 8, 0, 0, 0}, -{1, 1, 36, 8, 0, 0, 0}, -{11, 33, 1, 8, 0, 0, 0}, -{11, 36, 1, 8, 0, 0, 0}, -{13, 0, 41, 9, 0, 0, 0}, -{13, 0, 41, 12, 0, 0, 0}, -{9, 0, 38, 12, 0, 0, 0}, -{13, 0, 40, 12, 0, 0, 0}, -{1, 59, 33, 8, 0, 0, 0}, -{1, 59, 36, 8, 0, 0, 0}, -{11, 33, 59, 8, 0, 0, 0}, -{11, 36, 59, 8, 0, 0, 0}, -{11, 0, 0, 8, 1, 0, 0}, -{11, 0, 0, 8, 2, 0, 0}, -{11, 0, 0, 8, 8, 0, 0}, -{10, 16, 11, 8, 64, 0, 0}, -{32, 0, 0, 27, 0, 0, 0}, -{32, 0, 0, 8, 0, 0, 0}, -{32, 0, 0, 14, 0, 0, 0}, -{11, 0, 0, 96, 0, 0, 0}, -{10, 0, 17, 8, 0, 0, 0}, -{33, 29, 14, 8, 0, 0, 0}, -{33, 30, 14, 8, 0, 0, 0}, -{33, 14, 29, 8, 0, 0, 0}, -{33, 14, 30, 8, 0, 0, 0}, -{34, 0, 0, 8, 0, 0, 0}, -{35, 17, 11, 31, 0, 32, 0}, -{35, 17, 11, 31, 0, 1, 0}, -{35, 17, 11, 31, 0, 64, 0}, -{35, 17, 11, 31, 0, 65, 0}, -{35, 17, 11, 31, 0, 128, 0}, -{35, 17, 11, 31, 0, 4, 0}, -{35, 17, 11, 31, 0, 160, 0}, -{35, 17, 11, 31, 0, 224, 0}, -{32, 0, 41, 13, 0, 32, 0}, -{32, 0, 41, 13, 0, 1, 0}, -{32, 0, 41, 13, 0, 64, 0}, -{32, 0, 41, 13, 0, 65, 0}, -{32, 0, 41, 13, 0, 128, 0}, -{32, 0, 41, 13, 0, 4, 0}, -{32, 0, 41, 13, 0, 160, 0}, -{32, 0, 41, 13, 0, 224, 0}, -{35, 0, 15, 8, 0, 32, 0}, -{35, 0, 15, 8, 0, 1, 0}, -{35, 0, 15, 8, 0, 64, 0}, -{35, 0, 15, 8, 0, 65, 0}, -{35, 0, 15, 8, 0, 128, 0}, -{35, 0, 15, 8, 0, 4, 0}, -{35, 0, 15, 8, 0, 160, 0}, -{35, 0, 15, 8, 0, 224, 0}, -{36, 0, 32, 8, 0, 0, 0}, -{37, 0, 32, 8, 0, 0, 0}, -{35, 11, 17, 8, 1, 0, 244}, -{38, 11, 17, 8, 197, 0, 48}, -{39, 0, 32, 8, 0, 0, 0}, -{40, 0, 32, 8, 0, 0, 0}, -{32, 0, 0, 8, 255, 0, 0}, -{41, 11, 17, 8, 1, 0, 244}, -{35, 17, 11, 8, 33, 0, 212}, -{41, 9, 15, 8, 245, 0, 0}, -{41, 11, 17, 8, 245, 0, 0}, -{42, 37, 11, 8, 0, 0, 0}, -{35, 15, 11, 8, 0, 0, 0}, -{43, 16, 11, 8, 0, 0, 0}, -{43, 13, 45, 48, 0, 0, 0}, -{44, 0, 54, 8, 0, 0, 0}, -{45, 1, 15, 8, 245, 0, 0}, -{45, 1, 15, 8, 196, 16, 0}, -{45, 1, 15, 8, 245, 1, 0}, -{45, 1, 15, 8, 229, 0, 16}, -{45, 1, 15, 8, 196, 0, 16}, -{46, 1, 15, 8, 245, 0, 0}, -{45, 3, 17, 8, 245, 0, 0}, -{45, 3, 17, 8, 196, 16, 0}, -{45, 3, 17, 8, 245, 1, 0}, -{45, 3, 17, 8, 229, 0, 16}, -{45, 3, 17, 8, 196, 0, 16}, -{46, 3, 17, 8, 245, 0, 0}, -{47, 1, 15, 8, 245, 0, 0}, -{47, 1, 15, 8, 196, 16, 0}, -{47, 1, 15, 8, 245, 1, 0}, -{47, 1, 15, 8, 229, 0, 16}, -{47, 1, 15, 8, 196, 0, 16}, -{48, 1, 15, 8, 245, 0, 0}, -{45, 5, 17, 8, 245, 0, 0}, -{49, 5, 17, 8, 196, 16, 0}, -{45, 5, 17, 8, 245, 1, 0}, -{49, 5, 17, 8, 229, 0, 16}, -{49, 5, 17, 8, 196, 0, 16}, -{46, 5, 17, 8, 245, 0, 0}, -{50, 0, 17, 8, 0, 0, 0}, -{51, 1, 15, 8, 1, 0, 32}, -{51, 1, 15, 8, 1, 1, 32}, -{51, 1, 15, 8, 197, 0, 48}, -{51, 1, 17, 8, 1, 0, 32}, -{51, 1, 17, 8, 1, 1, 32}, -{51, 1, 17, 8, 197, 0, 48}, -{52, 1, 15, 8, 0, 0, 0}, -{53, 0, 1, 24, 0, 0, 0}, -{52, 3, 17, 8, 0, 0, 0}, -{53, 0, 41, 24, 0, 0, 0}, -{51, 51, 15, 8, 33, 0, 0}, -{51, 51, 15, 8, 33, 1, 0}, -{51, 51, 15, 8, 229, 0, 16}, -{51, 51, 17, 8, 33, 0, 0}, -{51, 51, 17, 8, 33, 1, 0}, -{51, 51, 17, 8, 229, 0, 16}, -{51, 52, 15, 8, 1, 0, 32}, -{51, 52, 15, 8, 1, 1, 32}, -{51, 52, 15, 8, 197, 0, 48}, -{51, 52, 17, 8, 1, 0, 32}, -{51, 52, 17, 8, 1, 1, 32}, -{51, 52, 17, 8, 197, 0, 48}, -{46, 0, 21, 16, 0, 0, 0}, -{54, 0, 62, 16, 0, 0, 0}, -{54, 0, 61, 16, 0, 0, 0}, -{54, 0, 0, 16, 0, 0, 0}, -{51, 0, 21, 16, 0, 0, 0}, -{46, 0, 42, 16, 0, 0, 0}, -{46, 0, 20, 16, 0, 0, 0}, -{55, 0, 62, 24, 0, 1, 0}, -{55, 0, 62, 24, 0, 64, 0}, -{55, 0, 62, 24, 0, 65, 0}, -{55, 0, 62, 24, 0, 4, 0}, -{56, 0, 21, 56, 0, 0, 0}, -{46, 0, 23, 16, 0, 0, 0}, -{51, 0, 23, 16, 0, 0, 0}, -{55, 0, 62, 16, 69, 0, 0}, -{55, 0, 62, 24, 69, 0, 0}, -{46, 0, 22, 16, 0, 0, 0}, -{54, 0, 63, 16, 0, 0, 0}, -{56, 0, 22, 56, 0, 0, 0}, -{51, 0, 22, 16, 0, 0, 0}, -{56, 0, 20, 56, 0, 0, 0}, -{51, 0, 20, 16, 0, 0, 0}, -{46, 1, 15, 8, 196, 0, 16}, -{45, 0, 15, 8, 0, 0, 0}, -{45, 0, 15, 8, 245, 0, 0}, -{51, 0, 15, 8, 33, 0, 212}, -{51, 0, 15, 8, 0, 0, 245}, -{46, 3, 17, 8, 196, 0, 16}, -{45, 0, 17, 8, 0, 0, 0}, -{45, 0, 17, 8, 245, 0, 0}, -{51, 0, 17, 8, 33, 0, 212}, -{51, 0, 17, 8, 0, 0, 245}, -{45, 0, 15, 8, 244, 0, 0}, -{45, 0, 17, 8, 244, 0, 0}, -{57, 0, 17, 9, 0, 0, 0}, -{58, 0, 37, 9, 0, 0, 0}, -{57, 0, 17, 12, 0, 0, 0}, -{58, 0, 37, 12, 0, 0, 0}, -{57, 0, 17, 8, 0, 0, 0}, -{46, 0, 17, 8, 0, 0, 0}, -{46, 0, 16, 8, 0, 0, 0}, -{56, 0, 16, 8, 0, 0, 0}, -{46, 0, 16, 8, 64, 0, 0}, -{57, 0, 39, 8, 0, 0, 0}, -{52, 0, 28, 8, 0, 0, 0}, -{59, 0, 16, 8, 0, 0, 0}, -{56, 0, 42, 8, 0, 0, 0}, -{55, 0, 0, 112, 0, 0, 0}, -{55, 0, 0, 8, 0, 0, 0}, -{13, 0, 0, 24, 0, 0, 0}, -{56, 0, 58, 120, 0, 0, 0}, -{55, 0, 0, 120, 0, 0, 0}, -{55, 0, 58, 120, 0, 0, 0}, -{55, 60, 58, 120, 0, 0, 0}, -{60, 0, 0, 8, 0, 0, 0}, -{56, 0, 42, 96, 0, 0, 0}, -{61, 67, 64, 104, 0, 0, 0}, -{61, 67, 64, 96, 0, 0, 0}, -{35, 73, 68, 40, 0, 0, 0}, -{35, 73, 68, 48, 0, 0, 0}, -{35, 71, 68, 40, 0, 0, 0}, -{35, 72, 68, 48, 0, 0, 0}, -{62, 90, 83, 128, 0, 0, 0}, -{63, 81, 68, 128, 0, 0, 0}, -{64, 44, 68, 128, 0, 0, 0}, -{64, 46, 68, 128, 0, 0, 0}, -{35, 68, 73, 40, 0, 0, 0}, -{35, 68, 73, 48, 0, 0, 0}, -{35, 68, 71, 40, 0, 0, 0}, -{35, 68, 72, 48, 0, 0, 0}, -{62, 83, 90, 128, 0, 0, 0}, -{64, 68, 44, 128, 0, 0, 0}, -{64, 68, 46, 128, 0, 0, 0}, -{65, 72, 68, 40, 0, 0, 0}, -{35, 46, 68, 48, 0, 0, 0}, -{35, 72, 68, 56, 0, 0, 0}, -{66, 81, 68, 128, 0, 0, 0}, -{67, 81, 68, 128, 0, 0, 0}, -{62, 89, 83, 128, 0, 0, 0}, -{35, 68, 46, 40, 0, 0, 0}, -{35, 68, 46, 48, 0, 0, 0}, -{62, 68, 46, 128, 0, 0, 0}, -{34, 73, 68, 40, 0, 0, 0}, -{34, 73, 68, 48, 0, 0, 0}, -{67, 88, 83, 128, 0, 0, 0}, -{35, 73, 68, 56, 0, 0, 0}, -{56, 0, 42, 40, 0, 0, 0}, -{34, 67, 68, 40, 0, 0, 0}, -{34, 67, 68, 48, 0, 0, 0}, -{42, 18, 68, 40, 0, 0, 0}, -{42, 18, 68, 48, 0, 0, 0}, -{35, 68, 47, 40, 0, 0, 0}, -{35, 68, 47, 48, 0, 0, 0}, -{35, 68, 44, 88, 0, 0, 0}, -{35, 68, 46, 88, 0, 0, 0}, -{62, 83, 92, 128, 0, 0, 0}, -{34, 72, 64, 40, 0, 0, 0}, -{34, 73, 64, 48, 0, 0, 0}, -{42, 71, 13, 40, 0, 0, 0}, -{42, 72, 13, 48, 0, 0, 0}, -{62, 80, 78, 128, 0, 0, 0}, -{34, 71, 68, 40, 69, 0, 0}, -{34, 72, 68, 48, 0, 0, 0}, -{62, 71, 68, 128, 0, 0, 0}, -{62, 72, 68, 128, 0, 0, 0}, -{68, 69, 12, 40, 0, 0, 0}, -{68, 69, 12, 48, 0, 0, 0}, -{69, 83, 13, 128, 0, 0, 0}, -{34, 71, 68, 40, 0, 0, 0}, -{34, 71, 68, 48, 0, 0, 0}, -{62, 91, 83, 128, 0, 0, 0}, -{62, 90, 68, 128, 0, 0, 0}, -{34, 66, 64, 32, 0, 0, 0}, -{34, 67, 64, 32, 0, 0, 0}, -{70, 18, 64, 32, 0, 0, 0}, -{70, 18, 68, 48, 0, 0, 0}, -{62, 79, 68, 128, 0, 0, 0}, -{35, 67, 64, 32, 0, 0, 0}, -{71, 67, 64, 40, 0, 0, 0}, -{71, 73, 68, 48, 0, 0, 0}, -{67, 73, 68, 128, 0, 0, 0}, -{32, 0, 0, 32, 0, 0, 0}, -{72, 0, 0, 128, 0, 0, 0}, -{73, 13, 18, 112, 0, 0, 0}, -{74, 7, 69, 88, 0, 0, 0}, -{75, 69, 68, 88, 0, 0, 0}, -{73, 18, 13, 112, 0, 0, 0}, -{34, 69, 68, 88, 0, 0, 0}, -{76, 69, 68, 88, 0, 0, 0}, -{32, 72, 68, 112, 0, 0, 0}, -{32, 68, 72, 112, 0, 0, 0}, -{34, 73, 68, 56, 0, 0, 0}, -{70, 64, 18, 32, 0, 0, 0}, -{70, 68, 18, 48, 0, 0, 0}, -{62, 68, 79, 128, 0, 0, 0}, -{35, 64, 67, 32, 0, 0, 0}, -{77, 0, 42, 8, 0, 0, 0}, -{78, 0, 43, 8, 0, 0, 0}, -{79, 0, 43, 8, 0, 0, 0}, -{80, 17, 11, 80, 64, 0, 0}, -{81, 1, 17, 8, 1, 0, 244}, -{49, 1, 17, 8, 1, 0, 244}, -{34, 17, 11, 8, 64, 0, 245}, -{82, 17, 11, 112, 0, 0, 0}, -{83, 17, 11, 8, 65, 0, 180}, -{84, 73, 68, 40, 0, 0, 0}, -{84, 73, 68, 48, 0, 0, 0}, -{84, 71, 68, 40, 0, 0, 0}, -{84, 72, 68, 48, 0, 0, 0}, -{85, 88, 83, 128, 0, 0, 0}, -{85, 81, 68, 128, 0, 0, 0}, -{71, 25, 64, 40, 0, 0, 0}, -{71, 25, 68, 48, 0, 0, 0}, -{86, 81, 68, 128, 0, 0, 0}, -{87, 65, 12, 40, 0, 0, 0}, -{71, 69, 12, 48, 0, 0, 0}, -{88, 68, 13, 128, 0, 0, 0}, -{71, 73, 68, 40, 0, 0, 0}, -{86, 88, 83, 128, 0, 0, 0}, -{89, 0, 48, 8, 64, 0, 0}, -{56, 0, 46, 112, 0, 0, 0}, -{68, 65, 68, 48, 0, 0, 0}, -{68, 69, 64, 48, 0, 0, 0}, -{62, 68, 72, 128, 0, 0, 0}, -{76, 65, 12, 40, 0, 0, 0}, -{76, 69, 12, 48, 0, 0, 0}, -{69, 68, 13, 128, 0, 0, 0}, -{34, 67, 64, 40, 0, 0, 0}, -{35, 64, 46, 40, 0, 0, 0}, -{34, 42, 68, 56, 0, 0, 0}, -{62, 92, 83, 128, 0, 0, 0}, -{34, 67, 64, 48, 0, 0, 0}, -{76, 65, 64, 40, 0, 0, 0}, -{76, 69, 68, 48, 0, 0, 0}, -{90, 69, 68, 128, 0, 0, 0}, -{51, 0, 42, 16, 0, 0, 0}, -{91, 0, 42, 16, 0, 0, 0}, -{91, 0, 20, 16, 0, 0, 0}, -{92, 0, 0, 16, 0, 0, 0}, -{93, 0, 34, 16, 0, 0, 0}, -{94, 0, 34, 16, 0, 0, 0}, -{34, 67, 64, 64, 0, 0, 0}, -{34, 73, 68, 64, 0, 0, 0}, -{71, 73, 68, 72, 0, 0, 0}, -{34, 73, 68, 80, 0, 0, 0}, -{62, 44, 83, 128, 0, 0, 0}, -{62, 46, 85, 128, 0, 0, 0}, -{62, 47, 85, 128, 0, 0, 0}, -{62, 73, 68, 128, 0, 0, 0}, -{34, 72, 68, 72, 0, 0, 0}, -{34, 71, 68, 72, 0, 0, 0}, -{34, 70, 68, 72, 0, 0, 0}, -{62, 70, 68, 128, 0, 0, 0}, -{34, 73, 68, 72, 0, 0, 0}, -{35, 47, 68, 72, 0, 0, 0}, -{62, 47, 68, 128, 0, 0, 0}, -{67, 88, 92, 128, 0, 0, 0}, -{73, 47, 13, 112, 0, 0, 0}, -{67, 88, 83, 136, 0, 0, 0}, -{67, 81, 68, 136, 0, 0, 0}, -{34, 73, 68, 152, 0, 0, 0}, -{62, 73, 68, 152, 0, 0, 0}, -{67, 81, 68, 152, 0, 0, 0}, -{35, 17, 11, 8, 0, 0, 0}, -{35, 15, 13, 80, 0, 0, 0}, -{35, 11, 17, 8, 0, 0, 0}, -{35, 17, 13, 80, 0, 0, 0}, -{67, 90, 83, 128, 0, 0, 0}, -{86, 87, 85, 128, 0, 0, 0}, -{71, 71, 68, 72, 0, 0, 0}, -{71, 72, 68, 72, 0, 0, 0}, -{71, 67, 64, 64, 0, 0, 0}, -{71, 73, 68, 64, 0, 0, 0}, -{71, 68, 26, 72, 0, 0, 0}, -{88, 68, 76, 128, 0, 0, 0}, -{71, 68, 27, 72, 0, 0, 0}, -{88, 68, 77, 128, 0, 0, 0}, -{95, 68, 18, 72, 0, 0, 0}, -{67, 68, 79, 128, 0, 0, 0}, -{71, 68, 18, 72, 0, 0, 0}, -{67, 68, 75, 128, 0, 0, 0}, -{67, 85, 73, 128, 0, 0, 0}, -{71, 24, 68, 72, 0, 0, 0}, -{95, 18, 68, 72, 0, 0, 0}, -{71, 73, 68, 144, 0, 0, 0}, -{86, 81, 68, 144, 0, 0, 0}, -{71, 73, 68, 80, 0, 0, 0}, -{71, 73, 68, 152, 0, 0, 0}, -{67, 73, 68, 152, 0, 0, 0}, -{96, 1, 65, 32, 0, 0, 0}, -{56, 1, 69, 48, 0, 0, 0}, -{97, 69, 81, 128, 0, 0, 0}, -{98, 0, 13, 112, 0, 0, 0}, -{56, 0, 44, 8, 0, 0, 0}, -{64, 0, 44, 128, 0, 0, 0}, -{56, 0, 42, 112, 0, 0, 0}, -{99, 75, 13, 8, 0, 0, 0}, -{98, 0, 17, 8, 0, 0, 0}, -{100, 67, 64, 96, 0, 0, 0} +_InstSharedInfo InstSharedInfoTable[474] = { +{0, 6, 68, 245, 0, 0, 256}, +{0, 8, 72, 245, 0, 0, 256}, +{0, 68, 6, 245, 0, 0, 256}, +{0, 72, 8, 245, 0, 0, 256}, +{1, 1, 11, 245, 0, 0, 256}, +{1, 3, 13, 245, 0, 0, 256}, +{2, 0, 46, 0, 0, 0, 256}, +{3, 0, 46, 0, 0, 0, 256}, +{0, 6, 68, 196, 16, 0, 256}, +{0, 8, 72, 196, 16, 0, 256}, +{0, 68, 6, 196, 16, 0, 256}, +{0, 72, 8, 196, 16, 0, 256}, +{1, 1, 11, 196, 16, 0, 256}, +{1, 3, 13, 196, 16, 0, 256}, +{4, 0, 46, 0, 0, 0, 256}, +{0, 6, 68, 245, 1, 0, 256}, +{0, 8, 72, 245, 1, 0, 256}, +{0, 68, 6, 245, 1, 0, 256}, +{0, 72, 8, 245, 1, 0, 256}, +{1, 1, 11, 245, 1, 0, 256}, +{1, 3, 13, 245, 1, 0, 256}, +{5, 0, 46, 0, 0, 0, 256}, +{6, 0, 46, 0, 0, 0, 256}, +{7, 0, 46, 0, 0, 0, 256}, +{8, 0, 46, 0, 0, 0, 256}, +{0, 6, 68, 229, 0, 16, 256}, +{0, 8, 72, 229, 0, 16, 256}, +{0, 68, 6, 229, 0, 16, 256}, +{0, 72, 8, 229, 0, 16, 256}, +{1, 1, 11, 229, 0, 16, 256}, +{1, 3, 13, 229, 0, 16, 256}, +{9, 0, 0, 213, 17, 32, 256}, +{0, 6, 68, 196, 0, 16, 256}, +{0, 8, 72, 196, 0, 16, 256}, +{0, 68, 6, 196, 0, 16, 256}, +{0, 72, 8, 196, 0, 16, 256}, +{1, 1, 11, 196, 0, 16, 256}, +{1, 3, 13, 196, 0, 16, 256}, +{9, 0, 0, 17, 16, 228, 256}, +{10, 6, 68, 245, 0, 0, 256}, +{10, 8, 72, 245, 0, 0, 256}, +{10, 68, 6, 245, 0, 0, 256}, +{10, 72, 8, 245, 0, 0, 256}, +{11, 1, 11, 245, 0, 0, 256}, +{11, 3, 13, 245, 0, 0, 256}, +{12, 0, 18, 244, 0, 0, 256}, +{13, 0, 18, 0, 0, 0, 256}, +{14, 0, 18, 0, 0, 0, 256}, +{15, 0, 0, 0, 0, 0, 256}, +{16, 54, 8, 0, 0, 0, 256}, +{10, 7, 69, 64, 0, 0, 256}, +{13, 0, 3, 0, 0, 0, 256}, +{17, 72, 8, 33, 0, 212, 256}, +{18, 0, 5, 0, 0, 0, 256}, +{19, 25, 22, 0, 8, 0, 33024}, +{20, 25, 22, 0, 8, 0, 33024}, +{19, 21, 25, 0, 8, 0, 33024}, +{20, 21, 25, 0, 8, 0, 33024}, +{13, 0, 15, 0, 32, 0, 261}, +{13, 0, 15, 0, 1, 0, 261}, +{13, 0, 15, 0, 64, 0, 261}, +{13, 0, 15, 0, 65, 0, 261}, +{13, 0, 15, 0, 128, 0, 261}, +{13, 0, 15, 0, 4, 0, 261}, +{13, 0, 15, 0, 160, 0, 261}, +{13, 0, 15, 0, 224, 0, 261}, +{10, 6, 68, 196, 0, 16, 256}, +{10, 8, 72, 196, 0, 16, 256}, +{0, 6, 68, 0, 0, 0, 256}, +{0, 8, 72, 0, 0, 0, 256}, +{21, 6, 68, 0, 0, 0, 256}, +{21, 8, 72, 0, 0, 0, 256}, +{21, 68, 6, 0, 0, 0, 256}, +{21, 72, 8, 0, 0, 0, 256}, +{21, 45, 71, 0, 0, 0, 256}, +{21, 54, 8, 0, 0, 0, 256}, +{21, 71, 45, 0, 0, 0, 256}, +{1, 13, 18, 0, 0, 0, 256}, +{22, 0, 0, 0, 0, 0, 256}, +{9, 0, 50, 0, 0, 0, 257}, +{23, 0, 0, 0, 0, 0, 256}, +{23, 0, 0, 255, 0, 0, 256}, +{11, 0, 0, 213, 0, 0, 256}, +{11, 0, 0, 0, 0, 0, 256}, +{1, 19, 11, 0, 0, 0, 256}, +{1, 20, 13, 0, 0, 0, 256}, +{1, 11, 19, 0, 0, 0, 256}, +{1, 13, 20, 0, 0, 0, 256}, +{24, 21, 22, 0, 8, 0, 256}, +{25, 21, 22, 0, 8, 0, 256}, +{19, 22, 21, 245, 8, 0, 256}, +{26, 22, 21, 245, 8, 0, 256}, +{11, 1, 11, 196, 0, 16, 256}, +{11, 3, 13, 196, 0, 16, 256}, +{19, 11, 22, 0, 8, 0, 256}, +{26, 13, 22, 0, 8, 0, 256}, +{19, 21, 11, 0, 8, 0, 256}, +{26, 21, 13, 0, 8, 0, 256}, +{19, 11, 22, 245, 8, 0, 256}, +{26, 13, 22, 245, 8, 0, 256}, +{1, 1, 17, 0, 0, 0, 256}, +{27, 3, 18, 0, 0, 0, 256}, +{13, 0, 2, 0, 0, 0, 258}, +{13, 0, 0, 0, 0, 0, 258}, +{16, 60, 8, 0, 0, 0, 256}, +{13, 49, 47, 0, 0, 0, 256}, +{13, 0, 0, 0, 0, 0, 256}, +{28, 0, 2, 0, 0, 0, 258}, +{28, 0, 0, 0, 0, 0, 258}, +{11, 0, 0, 0, 0, 0, 262}, +{11, 0, 1, 0, 0, 0, 262}, +{9, 0, 0, 0, 0, 0, 262}, +{28, 0, 0, 255, 0, 0, 33026}, +{9, 0, 1, 196, 0, 49, 256}, +{9, 0, 0, 0, 0, 0, 256}, +{29, 0, 23, 0, 0, 0, 256}, +{30, 0, 15, 0, 64, 0, 261}, +{30, 0, 15, 0, 0, 0, 261}, +{31, 0, 15, 0, 0, 0, 261}, +{1, 1, 11, 0, 0, 0, 33024}, +{1, 1, 14, 0, 0, 0, 33024}, +{11, 11, 1, 0, 0, 0, 33024}, +{11, 14, 1, 0, 0, 0, 33024}, +{13, 0, 16, 0, 0, 0, 257}, +{13, 0, 16, 0, 0, 0, 260}, +{9, 0, 50, 0, 0, 0, 260}, +{13, 0, 15, 0, 0, 0, 260}, +{1, 25, 11, 0, 0, 0, 33024}, +{1, 25, 14, 0, 0, 0, 33024}, +{11, 11, 25, 0, 0, 0, 33024}, +{11, 14, 25, 0, 0, 0, 33024}, +{11, 0, 0, 0, 0, 0, 33032}, +{11, 0, 0, 1, 0, 0, 256}, +{11, 0, 0, 2, 0, 0, 33024}, +{11, 0, 0, 8, 0, 0, 256}, +{10, 69, 8, 64, 0, 0, 256}, +{32, 0, 0, 0, 0, 0, 771}, +{32, 0, 0, 0, 0, 0, 33024}, +{32, 0, 0, 0, 0, 0, 262}, +{11, 0, 0, 0, 0, 0, 3072}, +{10, 0, 72, 0, 0, 0, 256}, +{33, 43, 51, 0, 0, 0, 33024}, +{33, 44, 51, 0, 0, 0, 33024}, +{33, 51, 43, 0, 0, 0, 33024}, +{33, 51, 44, 0, 0, 0, 33024}, +{32, 0, 0, 0, 0, 0, 256}, +{34, 72, 8, 0, 32, 0, 775}, +{34, 72, 8, 0, 1, 0, 775}, +{34, 72, 8, 0, 64, 0, 775}, +{34, 72, 8, 0, 65, 0, 775}, +{34, 72, 8, 0, 128, 0, 775}, +{34, 72, 8, 0, 4, 0, 775}, +{34, 72, 8, 0, 160, 0, 775}, +{34, 72, 8, 0, 224, 0, 775}, +{32, 0, 16, 0, 32, 0, 261}, +{32, 0, 16, 0, 1, 0, 261}, +{32, 0, 16, 0, 64, 0, 261}, +{32, 0, 16, 0, 65, 0, 261}, +{32, 0, 16, 0, 128, 0, 261}, +{32, 0, 16, 0, 4, 0, 261}, +{32, 0, 16, 0, 160, 0, 261}, +{32, 0, 16, 0, 224, 0, 261}, +{34, 0, 68, 0, 32, 0, 256}, +{34, 0, 68, 0, 1, 0, 256}, +{34, 0, 68, 0, 64, 0, 256}, +{34, 0, 68, 0, 65, 0, 256}, +{34, 0, 68, 0, 128, 0, 256}, +{34, 0, 68, 0, 4, 0, 256}, +{34, 0, 68, 0, 160, 0, 256}, +{34, 0, 68, 0, 224, 0, 256}, +{35, 0, 46, 0, 0, 0, 256}, +{36, 0, 46, 0, 0, 0, 256}, +{34, 8, 72, 1, 0, 244, 256}, +{37, 8, 72, 197, 0, 48, 256}, +{38, 0, 46, 0, 0, 0, 256}, +{39, 0, 46, 0, 0, 0, 256}, +{32, 0, 0, 255, 0, 0, 256}, +{40, 8, 72, 1, 0, 244, 256}, +{34, 72, 8, 33, 0, 212, 256}, +{40, 6, 68, 245, 0, 0, 256}, +{40, 8, 72, 245, 0, 0, 256}, +{41, 60, 8, 0, 0, 0, 256}, +{34, 68, 8, 0, 0, 0, 256}, +{42, 69, 8, 0, 0, 0, 256}, +{42, 10, 56, 0, 0, 0, 1536}, +{43, 0, 18, 0, 0, 0, 256}, +{44, 1, 68, 245, 0, 0, 256}, +{44, 1, 68, 196, 16, 0, 256}, +{44, 1, 68, 245, 1, 0, 256}, +{44, 1, 68, 229, 0, 16, 256}, +{44, 1, 68, 196, 0, 16, 256}, +{45, 1, 68, 245, 0, 0, 256}, +{44, 3, 72, 245, 0, 0, 256}, +{44, 3, 72, 196, 16, 0, 256}, +{44, 3, 72, 245, 1, 0, 256}, +{44, 3, 72, 229, 0, 16, 256}, +{44, 3, 72, 196, 0, 16, 256}, +{45, 3, 72, 245, 0, 0, 256}, +{46, 1, 68, 245, 0, 0, 256}, +{46, 1, 68, 196, 16, 0, 256}, +{46, 1, 68, 245, 1, 0, 256}, +{46, 1, 68, 229, 0, 16, 256}, +{46, 1, 68, 196, 0, 16, 256}, +{47, 1, 68, 245, 0, 0, 256}, +{44, 5, 72, 245, 0, 0, 256}, +{48, 5, 72, 196, 16, 0, 256}, +{44, 5, 72, 245, 1, 0, 256}, +{48, 5, 72, 229, 0, 16, 256}, +{48, 5, 72, 196, 0, 16, 256}, +{45, 5, 72, 245, 0, 0, 256}, +{49, 0, 72, 0, 0, 0, 256}, +{50, 1, 68, 1, 0, 32, 256}, +{50, 1, 68, 1, 1, 32, 256}, +{50, 1, 68, 197, 0, 48, 256}, +{50, 1, 72, 1, 0, 32, 256}, +{50, 1, 72, 1, 1, 32, 256}, +{50, 1, 72, 197, 0, 48, 256}, +{51, 1, 68, 0, 0, 0, 256}, +{52, 0, 1, 0, 0, 0, 768}, +{51, 3, 72, 0, 0, 0, 256}, +{52, 0, 16, 0, 0, 0, 768}, +{50, 41, 68, 33, 0, 0, 256}, +{50, 41, 68, 33, 1, 0, 256}, +{50, 41, 68, 229, 0, 16, 256}, +{50, 41, 72, 33, 0, 0, 256}, +{50, 41, 72, 33, 1, 0, 256}, +{50, 41, 72, 229, 0, 16, 256}, +{50, 42, 68, 1, 0, 32, 256}, +{50, 42, 68, 1, 1, 32, 256}, +{50, 42, 68, 197, 0, 48, 256}, +{50, 42, 72, 1, 0, 32, 256}, +{50, 42, 72, 1, 1, 32, 256}, +{50, 42, 72, 197, 0, 48, 256}, +{45, 0, 64, 0, 0, 0, 512}, +{53, 0, 28, 0, 0, 0, 512}, +{53, 0, 27, 0, 0, 0, 512}, +{53, 0, 0, 0, 0, 0, 512}, +{50, 0, 64, 0, 0, 0, 512}, +{45, 0, 54, 0, 0, 0, 512}, +{45, 0, 63, 0, 0, 0, 512}, +{54, 0, 28, 0, 1, 0, 768}, +{54, 0, 28, 0, 64, 0, 768}, +{54, 0, 28, 0, 65, 0, 768}, +{54, 0, 28, 0, 4, 0, 768}, +{55, 0, 64, 0, 0, 0, 1792}, +{45, 0, 66, 0, 0, 0, 512}, +{50, 0, 66, 0, 0, 0, 512}, +{54, 0, 28, 69, 0, 0, 512}, +{54, 0, 28, 69, 0, 0, 768}, +{45, 0, 65, 0, 0, 0, 512}, +{53, 0, 29, 0, 0, 0, 512}, +{55, 0, 65, 0, 0, 0, 1792}, +{50, 0, 65, 0, 0, 0, 512}, +{55, 0, 63, 0, 0, 0, 1792}, +{50, 0, 63, 0, 0, 0, 512}, +{45, 1, 68, 196, 0, 16, 256}, +{44, 0, 68, 0, 0, 0, 256}, +{44, 0, 68, 245, 0, 0, 256}, +{50, 0, 68, 33, 0, 212, 256}, +{50, 0, 68, 0, 0, 245, 256}, +{45, 3, 72, 196, 0, 16, 256}, +{44, 0, 72, 0, 0, 0, 256}, +{44, 0, 72, 245, 0, 0, 256}, +{50, 0, 72, 33, 0, 212, 256}, +{50, 0, 72, 0, 0, 245, 256}, +{44, 0, 68, 244, 0, 0, 256}, +{44, 0, 72, 244, 0, 0, 256}, +{56, 0, 72, 0, 0, 0, 257}, +{57, 0, 60, 0, 0, 0, 257}, +{56, 0, 72, 0, 0, 0, 260}, +{57, 0, 60, 0, 0, 0, 260}, +{56, 0, 72, 0, 0, 0, 256}, +{45, 0, 72, 0, 0, 0, 256}, +{45, 0, 69, 0, 0, 0, 256}, +{45, 0, 69, 0, 0, 0, 33024}, +{55, 0, 69, 0, 0, 0, 33024}, +{45, 0, 69, 64, 0, 0, 256}, +{56, 0, 61, 0, 0, 0, 256}, +{56, 0, 61, 0, 0, 0, 33024}, +{51, 0, 71, 0, 0, 0, 256}, +{58, 0, 69, 0, 0, 0, 33024}, +{55, 0, 54, 0, 0, 0, 33024}, +{54, 0, 0, 0, 0, 0, 3584}, +{54, 0, 0, 0, 0, 0, 256}, +{13, 0, 0, 0, 0, 0, 768}, +{55, 0, 24, 0, 0, 0, 3840}, +{54, 0, 0, 0, 0, 0, 3840}, +{54, 0, 24, 0, 0, 0, 3840}, +{54, 26, 24, 0, 0, 0, 3840}, +{59, 0, 0, 0, 0, 0, 256}, +{55, 0, 54, 0, 0, 0, 3072}, +{60, 83, 52, 0, 0, 0, 3328}, +{60, 83, 52, 0, 0, 0, 3072}, +{34, 87, 30, 0, 0, 0, 1280}, +{34, 87, 30, 0, 0, 0, 1536}, +{34, 85, 30, 0, 0, 0, 1280}, +{34, 86, 30, 0, 0, 0, 1536}, +{61, 91, 36, 0, 0, 0, 4096}, +{62, 34, 30, 0, 0, 0, 4096}, +{63, 55, 30, 0, 0, 0, 4096}, +{63, 57, 30, 0, 0, 0, 4096}, +{34, 30, 87, 0, 0, 0, 1280}, +{34, 30, 87, 0, 0, 0, 1536}, +{34, 30, 85, 0, 0, 0, 1280}, +{34, 30, 86, 0, 0, 0, 1536}, +{61, 36, 91, 0, 0, 0, 4096}, +{63, 30, 55, 0, 0, 0, 4096}, +{63, 30, 57, 0, 0, 0, 4096}, +{64, 86, 30, 0, 0, 0, 1280}, +{34, 57, 30, 0, 0, 0, 1536}, +{34, 86, 30, 0, 0, 0, 1792}, +{65, 34, 30, 0, 0, 0, 4096}, +{66, 34, 30, 0, 0, 0, 4096}, +{61, 90, 36, 0, 0, 0, 4096}, +{34, 30, 57, 0, 0, 0, 1280}, +{34, 30, 57, 0, 0, 0, 1536}, +{61, 30, 57, 0, 0, 0, 4096}, +{67, 87, 30, 0, 0, 0, 1280}, +{67, 87, 30, 0, 0, 0, 1536}, +{66, 40, 36, 0, 0, 0, 4096}, +{34, 87, 30, 0, 0, 0, 1792}, +{55, 0, 54, 0, 0, 0, 1280}, +{67, 83, 30, 0, 0, 0, 1280}, +{67, 83, 30, 0, 0, 0, 1536}, +{41, 76, 30, 0, 0, 0, 1280}, +{41, 76, 30, 0, 0, 0, 1536}, +{34, 30, 59, 0, 0, 0, 1280}, +{34, 30, 59, 0, 0, 0, 1536}, +{34, 30, 55, 0, 0, 0, 2816}, +{34, 30, 57, 0, 0, 0, 2816}, +{61, 36, 67, 0, 0, 0, 4096}, +{67, 86, 52, 0, 0, 0, 1280}, +{67, 87, 52, 0, 0, 0, 1536}, +{41, 85, 10, 0, 0, 0, 1280}, +{41, 86, 10, 0, 0, 0, 1536}, +{61, 88, 33, 0, 0, 0, 4096}, +{67, 85, 30, 69, 0, 0, 1280}, +{67, 86, 30, 0, 0, 0, 1536}, +{61, 85, 30, 0, 0, 0, 4096}, +{61, 86, 30, 0, 0, 0, 4096}, +{68, 31, 9, 0, 0, 0, 1280}, +{68, 31, 9, 0, 0, 0, 1536}, +{69, 36, 10, 0, 0, 0, 4096}, +{67, 85, 30, 0, 0, 0, 1280}, +{67, 85, 30, 0, 0, 0, 1536}, +{61, 92, 36, 0, 0, 0, 4096}, +{61, 91, 30, 0, 0, 0, 4096}, +{67, 82, 52, 0, 0, 0, 1024}, +{67, 83, 52, 0, 0, 0, 1024}, +{70, 76, 52, 0, 0, 0, 1024}, +{70, 76, 30, 0, 0, 0, 1536}, +{61, 73, 30, 0, 0, 0, 4096}, +{34, 83, 52, 0, 0, 0, 1024}, +{71, 83, 52, 0, 0, 0, 1280}, +{71, 87, 30, 0, 0, 0, 1536}, +{66, 87, 30, 0, 0, 0, 4096}, +{32, 0, 0, 0, 0, 0, 1024}, +{72, 0, 0, 0, 0, 0, 4096}, +{73, 10, 76, 0, 0, 0, 3584}, +{74, 48, 31, 0, 0, 0, 2816}, +{75, 31, 30, 0, 0, 0, 2816}, +{73, 76, 10, 0, 0, 0, 3584}, +{67, 31, 30, 0, 0, 0, 2816}, +{76, 31, 30, 0, 0, 0, 2816}, +{32, 86, 30, 0, 0, 0, 3584}, +{32, 30, 86, 0, 0, 0, 3584}, +{67, 87, 30, 0, 0, 0, 1792}, +{70, 52, 76, 0, 0, 0, 1024}, +{70, 30, 76, 0, 0, 0, 1536}, +{61, 30, 73, 0, 0, 0, 4096}, +{34, 52, 83, 0, 0, 0, 1024}, +{77, 0, 54, 0, 0, 0, 256}, +{78, 0, 62, 0, 0, 0, 256}, +{79, 0, 62, 0, 0, 0, 256}, +{80, 72, 8, 64, 0, 0, 2560}, +{81, 1, 72, 1, 0, 244, 256}, +{48, 1, 72, 1, 0, 244, 256}, +{67, 72, 8, 64, 0, 245, 256}, +{82, 72, 8, 0, 0, 0, 3584}, +{83, 72, 8, 65, 0, 180, 256}, +{84, 87, 30, 0, 0, 0, 1280}, +{84, 87, 30, 0, 0, 0, 1536}, +{84, 85, 30, 0, 0, 0, 1280}, +{84, 86, 30, 0, 0, 0, 1536}, +{85, 40, 36, 0, 0, 0, 4096}, +{85, 34, 30, 0, 0, 0, 4096}, +{71, 79, 52, 0, 0, 0, 1280}, +{71, 79, 30, 0, 0, 0, 1536}, +{86, 34, 30, 0, 0, 0, 4096}, +{87, 53, 9, 0, 0, 0, 1280}, +{71, 31, 9, 0, 0, 0, 1536}, +{88, 30, 10, 0, 0, 0, 4096}, +{71, 87, 30, 0, 0, 0, 1280}, +{86, 40, 36, 0, 0, 0, 4096}, +{89, 0, 58, 64, 0, 0, 256}, +{55, 0, 57, 0, 0, 0, 3584}, +{68, 53, 30, 0, 0, 0, 1536}, +{68, 31, 52, 0, 0, 0, 1536}, +{61, 30, 86, 0, 0, 0, 4096}, +{76, 53, 9, 0, 0, 0, 1280}, +{76, 31, 9, 0, 0, 0, 1536}, +{69, 30, 10, 0, 0, 0, 4096}, +{67, 83, 52, 0, 0, 0, 1280}, +{34, 52, 57, 0, 0, 0, 1280}, +{67, 54, 30, 0, 0, 0, 1792}, +{61, 67, 36, 0, 0, 0, 4096}, +{67, 83, 52, 0, 0, 0, 1536}, +{76, 53, 52, 0, 0, 0, 1280}, +{76, 31, 30, 0, 0, 0, 1536}, +{90, 31, 30, 0, 0, 0, 4096}, +{50, 0, 54, 0, 0, 0, 512}, +{91, 0, 54, 0, 0, 0, 512}, +{91, 0, 63, 0, 0, 0, 512}, +{92, 0, 0, 0, 0, 0, 512}, +{93, 0, 12, 0, 0, 0, 512}, +{94, 0, 12, 0, 0, 0, 512}, +{67, 83, 52, 0, 0, 0, 2048}, +{67, 87, 30, 0, 0, 0, 2048}, +{71, 87, 30, 0, 0, 0, 2304}, +{67, 87, 30, 0, 0, 0, 2560}, +{61, 55, 36, 0, 0, 0, 4096}, +{61, 57, 38, 0, 0, 0, 4096}, +{61, 59, 38, 0, 0, 0, 4096}, +{61, 87, 30, 0, 0, 0, 4096}, +{67, 86, 30, 0, 0, 0, 2304}, +{67, 85, 30, 0, 0, 0, 2304}, +{67, 84, 30, 0, 0, 0, 2304}, +{61, 84, 30, 0, 0, 0, 4096}, +{67, 87, 30, 0, 0, 0, 2304}, +{34, 59, 30, 0, 0, 0, 2304}, +{61, 59, 30, 0, 0, 0, 4096}, +{66, 40, 67, 0, 0, 0, 4096}, +{73, 59, 10, 0, 0, 0, 3584}, +{66, 40, 36, 0, 0, 0, 4352}, +{66, 34, 30, 0, 0, 0, 4352}, +{67, 87, 30, 0, 0, 0, 4864}, +{61, 87, 30, 0, 0, 0, 4864}, +{66, 34, 30, 0, 0, 0, 4864}, +{34, 72, 8, 0, 0, 0, 256}, +{34, 68, 10, 0, 0, 0, 2560}, +{34, 8, 72, 0, 0, 0, 256}, +{34, 72, 10, 0, 0, 0, 2560}, +{66, 91, 36, 0, 0, 0, 4096}, +{86, 39, 38, 0, 0, 0, 4096}, +{71, 85, 30, 0, 0, 0, 2304}, +{71, 86, 30, 0, 0, 0, 2304}, +{71, 83, 52, 0, 0, 0, 2048}, +{71, 87, 30, 0, 0, 0, 2048}, +{71, 30, 74, 0, 0, 0, 2304}, +{88, 30, 80, 0, 0, 0, 4096}, +{71, 30, 75, 0, 0, 0, 2304}, +{88, 30, 81, 0, 0, 0, 4096}, +{95, 30, 76, 0, 0, 0, 2304}, +{66, 30, 73, 0, 0, 0, 4096}, +{71, 30, 76, 0, 0, 0, 2304}, +{66, 30, 70, 0, 0, 0, 4096}, +{66, 38, 87, 0, 0, 0, 4096}, +{71, 78, 30, 0, 0, 0, 2304}, +{95, 76, 30, 0, 0, 0, 2304}, +{71, 87, 30, 0, 0, 0, 4608}, +{86, 34, 30, 0, 0, 0, 4608}, +{71, 87, 30, 0, 0, 0, 2560}, +{71, 87, 30, 0, 0, 0, 4864}, +{66, 87, 30, 0, 0, 0, 4864}, +{96, 1, 53, 0, 0, 0, 1024}, +{55, 1, 31, 0, 0, 0, 1536}, +{97, 31, 34, 0, 0, 0, 4096}, +{98, 0, 10, 0, 0, 0, 3584}, +{55, 0, 55, 0, 0, 0, 256}, +{63, 0, 55, 0, 0, 0, 4096}, +{55, 0, 54, 0, 0, 0, 3584}, +{99, 70, 10, 0, 0, 0, 256}, +{98, 0, 72, 0, 0, 0, 256}, +{100, 83, 52, 0, 0, 0, 3072} }; uint16_t CmpMnemonicOffsets[8] = { diff --git a/NativeCore/Dependencies/distorm/src/insts.h b/NativeCore/Dependencies/distorm/src/insts.h index 77db087b..675ecf96 100644 --- a/NativeCore/Dependencies/distorm/src/insts.h +++ b/NativeCore/Dependencies/distorm/src/insts.h @@ -4,7 +4,7 @@ insts.h diStorm3 - Powerful disassembler for X86/AMD64 http://ragestorm.net/distorm/ distorm at gmail dot com -Copyright (C) 2003-2018 Gil Dabah +Copyright (C) 2003-2021 Gil Dabah This library is licensed under the BSD license. See the file COPYING. */ diff --git a/NativeCore/Dependencies/distorm/src/mnemonics.c b/NativeCore/Dependencies/distorm/src/mnemonics.c index 7df13601..f306a258 100644 --- a/NativeCore/Dependencies/distorm/src/mnemonics.c +++ b/NativeCore/Dependencies/distorm/src/mnemonics.c @@ -4,7 +4,7 @@ mnemonics.c diStorm3 - Powerful disassembler for X86/AMD64 http://ragestorm.net/distorm/ distorm at gmail dot com -Copyright (C) 2003-2018 Gil Dabah +Copyright (C) 2003-2021 Gil Dabah This library is licensed under the BSD license. See the file COPYING. */ @@ -75,238 +75,241 @@ const unsigned char _MNEMONICS[] = "\x04" "verw\0" "\x04" "sgdt\0" "\x04" "sidt\0" "\x04" "lgdt\0" "\x04" "lidt\0" \ "\x04" "smsw\0" "\x04" "lmsw\0" "\x06" "invlpg\0" "\x06" "vmcall\0" \ "\x08" "vmlaunch\0" "\x08" "vmresume\0" "\x06" "vmxoff\0" "\x07" "monitor\0" \ -"\x05" "mwait\0" "\x06" "xgetbv\0" "\x06" "xsetbv\0" "\x06" "vmfunc\0" \ -"\x04" "xend\0" "\x05" "vmrun\0" "\x07" "vmmcall\0" "\x06" "vmload\0" \ -"\x06" "vmsave\0" "\x04" "stgi\0" "\x04" "clgi\0" "\x06" "skinit\0" \ -"\x07" "invlpga\0" "\x06" "swapgs\0" "\x06" "rdtscp\0" "\x08" "prefetch\0" \ -"\x09" "prefetchw\0" "\x05" "pi2fw\0" "\x05" "pi2fd\0" "\x05" "pf2iw\0" \ -"\x05" "pf2id\0" "\x06" "pfnacc\0" "\x07" "pfpnacc\0" "\x07" "pfcmpge\0" \ -"\x05" "pfmin\0" "\x05" "pfrcp\0" "\x07" "pfrsqrt\0" "\x05" "pfsub\0" \ -"\x05" "pfadd\0" "\x07" "pfcmpgt\0" "\x05" "pfmax\0" "\x08" "pfrcpit1\0" \ -"\x08" "pfrsqit1\0" "\x06" "pfsubr\0" "\x05" "pfacc\0" "\x07" "pfcmpeq\0" \ -"\x05" "pfmul\0" "\x08" "pfrcpit2\0" "\x07" "pmulhrw\0" "\x06" "pswapd\0" \ -"\x07" "pavgusb\0" "\x06" "movups\0" "\x06" "movupd\0" "\x05" "movss\0" \ -"\x05" "movsd\0" "\x07" "vmovups\0" "\x07" "vmovupd\0" "\x06" "vmovss\0" \ -"\x06" "vmovsd\0" "\x07" "movhlps\0" "\x06" "movlps\0" "\x06" "movlpd\0" \ -"\x08" "movsldup\0" "\x07" "movddup\0" "\x08" "vmovhlps\0" "\x07" "vmovlps\0" \ -"\x07" "vmovlpd\0" "\x09" "vmovsldup\0" "\x08" "vmovddup\0" "\x08" "unpcklps\0" \ -"\x08" "unpcklpd\0" "\x09" "vunpcklps\0" "\x09" "vunpcklpd\0" "\x08" "unpckhps\0" \ -"\x08" "unpckhpd\0" "\x09" "vunpckhps\0" "\x09" "vunpckhpd\0" "\x07" "movlhps\0" \ -"\x06" "movhps\0" "\x06" "movhpd\0" "\x08" "movshdup\0" "\x08" "vmovlhps\0" \ -"\x07" "vmovhps\0" "\x07" "vmovhpd\0" "\x09" "vmovshdup\0" "\x0b" "prefetchnta\0" \ -"\x0a" "prefetcht0\0" "\x0a" "prefetcht1\0" "\x0a" "prefetcht2\0" "\x06" "movaps\0" \ -"\x06" "movapd\0" "\x07" "vmovaps\0" "\x07" "vmovapd\0" "\x08" "cvtpi2ps\0" \ -"\x08" "cvtpi2pd\0" "\x08" "cvtsi2ss\0" "\x08" "cvtsi2sd\0" "\x09" "vcvtsi2ss\0" \ -"\x09" "vcvtsi2sd\0" "\x07" "movntps\0" "\x07" "movntpd\0" "\x07" "movntss\0" \ -"\x07" "movntsd\0" "\x08" "vmovntps\0" "\x08" "vmovntpd\0" "\x09" "cvttps2pi\0" \ -"\x09" "cvttpd2pi\0" "\x09" "cvttss2si\0" "\x09" "cvttsd2si\0" "\x0a" "vcvttss2si\0" \ -"\x0a" "vcvttsd2si\0" "\x08" "cvtps2pi\0" "\x08" "cvtpd2pi\0" "\x08" "cvtss2si\0" \ -"\x08" "cvtsd2si\0" "\x09" "vcvtss2si\0" "\x09" "vcvtsd2si\0" "\x07" "ucomiss\0" \ -"\x07" "ucomisd\0" "\x08" "vucomiss\0" "\x08" "vucomisd\0" "\x06" "comiss\0" \ -"\x06" "comisd\0" "\x07" "vcomiss\0" "\x07" "vcomisd\0" "\x08" "movmskps\0" \ -"\x08" "movmskpd\0" "\x09" "vmovmskps\0" "\x09" "vmovmskpd\0" "\x06" "sqrtps\0" \ -"\x06" "sqrtpd\0" "\x06" "sqrtss\0" "\x06" "sqrtsd\0" "\x07" "vsqrtps\0" \ -"\x07" "vsqrtpd\0" "\x07" "vsqrtss\0" "\x07" "vsqrtsd\0" "\x07" "rsqrtps\0" \ -"\x07" "rsqrtss\0" "\x08" "vrsqrtps\0" "\x08" "vrsqrtss\0" "\x05" "rcpps\0" \ -"\x05" "rcpss\0" "\x06" "vrcpps\0" "\x06" "vrcpss\0" "\x05" "andps\0" \ -"\x05" "andpd\0" "\x06" "vandps\0" "\x06" "vandpd\0" "\x06" "andnps\0" \ -"\x06" "andnpd\0" "\x07" "vandnps\0" "\x07" "vandnpd\0" "\x04" "orps\0" \ -"\x04" "orpd\0" "\x05" "vorps\0" "\x05" "vorpd\0" "\x05" "xorps\0" \ -"\x05" "xorpd\0" "\x06" "vxorps\0" "\x06" "vxorpd\0" "\x05" "addps\0" \ -"\x05" "addpd\0" "\x05" "addss\0" "\x05" "addsd\0" "\x06" "vaddps\0" \ -"\x06" "vaddpd\0" "\x06" "vaddss\0" "\x06" "vaddsd\0" "\x05" "mulps\0" \ -"\x05" "mulpd\0" "\x05" "mulss\0" "\x05" "mulsd\0" "\x06" "vmulps\0" \ -"\x06" "vmulpd\0" "\x06" "vmulss\0" "\x06" "vmulsd\0" "\x08" "cvtps2pd\0" \ -"\x08" "cvtpd2ps\0" "\x08" "cvtss2sd\0" "\x08" "cvtsd2ss\0" "\x09" "vcvtps2pd\0" \ -"\x09" "vcvtpd2ps\0" "\x09" "vcvtss2sd\0" "\x09" "vcvtsd2ss\0" "\x08" "cvtdq2ps\0" \ -"\x08" "cvtps2dq\0" "\x09" "cvttps2dq\0" "\x09" "vcvtdq2ps\0" "\x09" "vcvtps2dq\0" \ -"\x0a" "vcvttps2dq\0" "\x05" "subps\0" "\x05" "subpd\0" "\x05" "subss\0" \ -"\x05" "subsd\0" "\x06" "vsubps\0" "\x06" "vsubpd\0" "\x06" "vsubss\0" \ -"\x06" "vsubsd\0" "\x05" "minps\0" "\x05" "minpd\0" "\x05" "minss\0" \ -"\x05" "minsd\0" "\x06" "vminps\0" "\x06" "vminpd\0" "\x06" "vminss\0" \ -"\x06" "vminsd\0" "\x05" "divps\0" "\x05" "divpd\0" "\x05" "divss\0" \ -"\x05" "divsd\0" "\x06" "vdivps\0" "\x06" "vdivpd\0" "\x06" "vdivss\0" \ -"\x06" "vdivsd\0" "\x05" "maxps\0" "\x05" "maxpd\0" "\x05" "maxss\0" \ -"\x05" "maxsd\0" "\x06" "vmaxps\0" "\x06" "vmaxpd\0" "\x06" "vmaxss\0" \ -"\x06" "vmaxsd\0" "\x09" "punpcklbw\0" "\x0a" "vpunpcklbw\0" "\x09" "punpcklwd\0" \ -"\x0a" "vpunpcklwd\0" "\x09" "punpckldq\0" "\x0a" "vpunpckldq\0" "\x08" "packsswb\0" \ -"\x09" "vpacksswb\0" "\x07" "pcmpgtb\0" "\x08" "vpcmpgtb\0" "\x07" "pcmpgtw\0" \ -"\x08" "vpcmpgtw\0" "\x07" "pcmpgtd\0" "\x08" "vpcmpgtd\0" "\x08" "packuswb\0" \ -"\x09" "vpackuswb\0" "\x09" "punpckhbw\0" "\x0a" "vpunpckhbw\0" "\x09" "punpckhwd\0" \ -"\x0a" "vpunpckhwd\0" "\x09" "punpckhdq\0" "\x0a" "vpunpckhdq\0" "\x08" "packssdw\0" \ -"\x09" "vpackssdw\0" "\x0a" "punpcklqdq\0" "\x0b" "vpunpcklqdq\0" "\x0a" "punpckhqdq\0" \ -"\x0b" "vpunpckhqdq\0" "\x04" "movd\0" "\x04" "movq\0" "\x05" "vmovd\0" \ -"\x05" "vmovq\0" "\x06" "movdqa\0" "\x06" "movdqu\0" "\x07" "vmovdqa\0" \ -"\x07" "vmovdqu\0" "\x06" "pshufw\0" "\x06" "pshufd\0" "\x07" "pshufhw\0" \ -"\x07" "pshuflw\0" "\x07" "vpshufd\0" "\x08" "vpshufhw\0" "\x08" "vpshuflw\0" \ -"\x07" "pcmpeqb\0" "\x08" "vpcmpeqb\0" "\x07" "pcmpeqw\0" "\x08" "vpcmpeqw\0" \ -"\x07" "pcmpeqd\0" "\x08" "vpcmpeqd\0" "\x04" "emms\0" "\x0a" "vzeroupper\0" \ -"\x08" "vzeroall\0" "\x06" "vmread\0" "\x05" "extrq\0" "\x07" "insertq\0" \ -"\x07" "vmwrite\0" "\x08" "cvtph2ps\0" "\x08" "cvtps2ph\0" "\x06" "haddpd\0" \ -"\x06" "haddps\0" "\x07" "vhaddpd\0" "\x07" "vhaddps\0" "\x06" "hsubpd\0" \ -"\x06" "hsubps\0" "\x07" "vhsubpd\0" "\x07" "vhsubps\0" "\x05" "xsave\0" \ -"\x07" "xsave64\0" "\x06" "lfence\0" "\x06" "xrstor\0" "\x08" "xrstor64\0" \ -"\x06" "mfence\0" "\x08" "xsaveopt\0" "\x0a" "xsaveopt64\0" "\x06" "sfence\0" \ -"\x07" "clflush\0" "\x06" "popcnt\0" "\x03" "bsf\0" "\x05" "tzcnt\0" \ -"\x03" "bsr\0" "\x05" "lzcnt\0" "\x07" "cmpeqps\0" "\x07" "cmpltps\0" \ -"\x07" "cmpleps\0" "\x0a" "cmpunordps\0" "\x08" "cmpneqps\0" "\x08" "cmpnltps\0" \ -"\x08" "cmpnleps\0" "\x08" "cmpordps\0" "\x07" "cmpeqpd\0" "\x07" "cmpltpd\0" \ -"\x07" "cmplepd\0" "\x0a" "cmpunordpd\0" "\x08" "cmpneqpd\0" "\x08" "cmpnltpd\0" \ -"\x08" "cmpnlepd\0" "\x08" "cmpordpd\0" "\x07" "cmpeqss\0" "\x07" "cmpltss\0" \ -"\x07" "cmpless\0" "\x0a" "cmpunordss\0" "\x08" "cmpneqss\0" "\x08" "cmpnltss\0" \ -"\x08" "cmpnless\0" "\x08" "cmpordss\0" "\x07" "cmpeqsd\0" "\x07" "cmpltsd\0" \ -"\x07" "cmplesd\0" "\x0a" "cmpunordsd\0" "\x08" "cmpneqsd\0" "\x08" "cmpnltsd\0" \ -"\x08" "cmpnlesd\0" "\x08" "cmpordsd\0" "\x08" "vcmpeqps\0" "\x08" "vcmpltps\0" \ -"\x08" "vcmpleps\0" "\x0b" "vcmpunordps\0" "\x09" "vcmpneqps\0" "\x09" "vcmpnltps\0" \ -"\x09" "vcmpnleps\0" "\x09" "vcmpordps\0" "\x0b" "vcmpeq_uqps\0" "\x09" "vcmpngeps\0" \ -"\x09" "vcmpngtps\0" "\x0b" "vcmpfalseps\0" "\x0c" "vcmpneq_oqps\0" "\x08" "vcmpgeps\0" \ -"\x08" "vcmpgtps\0" "\x0a" "vcmptrueps\0" "\x0b" "vcmpeq_osps\0" "\x0b" "vcmplt_oqps\0" \ -"\x0b" "vcmple_oqps\0" "\x0d" "vcmpunord_sps\0" "\x0c" "vcmpneq_usps\0" \ -"\x0c" "vcmpnlt_uqps\0" "\x0c" "vcmpnle_uqps\0" "\x0b" "vcmpord_sps\0" \ -"\x0b" "vcmpeq_usps\0" "\x0c" "vcmpnge_uqps\0" "\x0c" "vcmpngt_uqps\0" \ -"\x0e" "vcmpfalse_osps\0" "\x0c" "vcmpneq_osps\0" "\x0b" "vcmpge_oqps\0" \ -"\x0b" "vcmpgt_oqps\0" "\x0d" "vcmptrue_usps\0" "\x08" "vcmpeqpd\0" "\x08" "vcmpltpd\0" \ -"\x08" "vcmplepd\0" "\x0b" "vcmpunordpd\0" "\x09" "vcmpneqpd\0" "\x09" "vcmpnltpd\0" \ -"\x09" "vcmpnlepd\0" "\x09" "vcmpordpd\0" "\x0b" "vcmpeq_uqpd\0" "\x09" "vcmpngepd\0" \ -"\x09" "vcmpngtpd\0" "\x0b" "vcmpfalsepd\0" "\x0c" "vcmpneq_oqpd\0" "\x08" "vcmpgepd\0" \ -"\x08" "vcmpgtpd\0" "\x0a" "vcmptruepd\0" "\x0b" "vcmpeq_ospd\0" "\x0b" "vcmplt_oqpd\0" \ -"\x0b" "vcmple_oqpd\0" "\x0d" "vcmpunord_spd\0" "\x0c" "vcmpneq_uspd\0" \ -"\x0c" "vcmpnlt_uqpd\0" "\x0c" "vcmpnle_uqpd\0" "\x0b" "vcmpord_spd\0" \ -"\x0b" "vcmpeq_uspd\0" "\x0c" "vcmpnge_uqpd\0" "\x0c" "vcmpngt_uqpd\0" \ -"\x0e" "vcmpfalse_ospd\0" "\x0c" "vcmpneq_ospd\0" "\x0b" "vcmpge_oqpd\0" \ -"\x0b" "vcmpgt_oqpd\0" "\x0d" "vcmptrue_uspd\0" "\x08" "vcmpeqss\0" "\x08" "vcmpltss\0" \ -"\x08" "vcmpless\0" "\x0b" "vcmpunordss\0" "\x09" "vcmpneqss\0" "\x09" "vcmpnltss\0" \ -"\x09" "vcmpnless\0" "\x09" "vcmpordss\0" "\x0b" "vcmpeq_uqss\0" "\x09" "vcmpngess\0" \ -"\x09" "vcmpngtss\0" "\x0b" "vcmpfalsess\0" "\x0c" "vcmpneq_oqss\0" "\x08" "vcmpgess\0" \ -"\x08" "vcmpgtss\0" "\x0a" "vcmptruess\0" "\x0b" "vcmpeq_osss\0" "\x0b" "vcmplt_oqss\0" \ -"\x0b" "vcmple_oqss\0" "\x0d" "vcmpunord_sss\0" "\x0c" "vcmpneq_usss\0" \ -"\x0c" "vcmpnlt_uqss\0" "\x0c" "vcmpnle_uqss\0" "\x0b" "vcmpord_sss\0" \ -"\x0b" "vcmpeq_usss\0" "\x0c" "vcmpnge_uqss\0" "\x0c" "vcmpngt_uqss\0" \ -"\x0e" "vcmpfalse_osss\0" "\x0c" "vcmpneq_osss\0" "\x0b" "vcmpge_oqss\0" \ -"\x0b" "vcmpgt_oqss\0" "\x0d" "vcmptrue_usss\0" "\x08" "vcmpeqsd\0" "\x08" "vcmpltsd\0" \ -"\x08" "vcmplesd\0" "\x0b" "vcmpunordsd\0" "\x09" "vcmpneqsd\0" "\x09" "vcmpnltsd\0" \ -"\x09" "vcmpnlesd\0" "\x09" "vcmpordsd\0" "\x0b" "vcmpeq_uqsd\0" "\x09" "vcmpngesd\0" \ -"\x09" "vcmpngtsd\0" "\x0b" "vcmpfalsesd\0" "\x0c" "vcmpneq_oqsd\0" "\x08" "vcmpgesd\0" \ -"\x08" "vcmpgtsd\0" "\x0a" "vcmptruesd\0" "\x0b" "vcmpeq_ossd\0" "\x0b" "vcmplt_oqsd\0" \ -"\x0b" "vcmple_oqsd\0" "\x0d" "vcmpunord_ssd\0" "\x0c" "vcmpneq_ussd\0" \ -"\x0c" "vcmpnlt_uqsd\0" "\x0c" "vcmpnle_uqsd\0" "\x0b" "vcmpord_ssd\0" \ -"\x0b" "vcmpeq_ussd\0" "\x0c" "vcmpnge_uqsd\0" "\x0c" "vcmpngt_uqsd\0" \ -"\x0e" "vcmpfalse_ossd\0" "\x0c" "vcmpneq_ossd\0" "\x0b" "vcmpge_oqsd\0" \ -"\x0b" "vcmpgt_oqsd\0" "\x0d" "vcmptrue_ussd\0" "\x06" "pinsrw\0" "\x07" "vpinsrw\0" \ -"\x06" "pextrw\0" "\x07" "vpextrw\0" "\x06" "shufps\0" "\x06" "shufpd\0" \ -"\x07" "vshufps\0" "\x07" "vshufpd\0" "\x09" "cmpxchg8b\0" "\x0a" "cmpxchg16b\0" \ -"\x07" "vmptrst\0" "\x08" "addsubpd\0" "\x08" "addsubps\0" "\x09" "vaddsubpd\0" \ -"\x09" "vaddsubps\0" "\x05" "psrlw\0" "\x06" "vpsrlw\0" "\x05" "psrld\0" \ -"\x06" "vpsrld\0" "\x05" "psrlq\0" "\x06" "vpsrlq\0" "\x05" "paddq\0" \ -"\x06" "vpaddq\0" "\x06" "pmullw\0" "\x07" "vpmullw\0" "\x07" "movq2dq\0" \ -"\x07" "movdq2q\0" "\x08" "pmovmskb\0" "\x09" "vpmovmskb\0" "\x07" "psubusb\0" \ -"\x08" "vpsubusb\0" "\x07" "psubusw\0" "\x08" "vpsubusw\0" "\x06" "pminub\0" \ -"\x07" "vpminub\0" "\x04" "pand\0" "\x05" "vpand\0" "\x07" "paddusb\0" \ -"\x08" "vpaddusw\0" "\x07" "paddusw\0" "\x06" "pmaxub\0" "\x07" "vpmaxub\0" \ -"\x05" "pandn\0" "\x06" "vpandn\0" "\x05" "pavgb\0" "\x06" "vpavgb\0" \ -"\x05" "psraw\0" "\x06" "vpsraw\0" "\x05" "psrad\0" "\x06" "vpsrad\0" \ -"\x05" "pavgw\0" "\x06" "vpavgw\0" "\x07" "pmulhuw\0" "\x08" "vpmulhuw\0" \ -"\x06" "pmulhw\0" "\x07" "vpmulhw\0" "\x09" "cvttpd2dq\0" "\x08" "cvtdq2pd\0" \ -"\x08" "cvtpd2dq\0" "\x0a" "vcvttpd2dq\0" "\x09" "vcvtdq2pd\0" "\x09" "vcvtpd2dq\0" \ -"\x06" "movntq\0" "\x07" "movntdq\0" "\x08" "vmovntdq\0" "\x06" "psubsb\0" \ -"\x07" "vpsubsb\0" "\x06" "psubsw\0" "\x07" "vpsubsw\0" "\x06" "pminsw\0" \ -"\x07" "vpminsw\0" "\x03" "por\0" "\x04" "vpor\0" "\x06" "paddsb\0" \ -"\x07" "vpaddsb\0" "\x06" "paddsw\0" "\x07" "vpaddsw\0" "\x06" "pmaxsw\0" \ -"\x07" "vpmaxsw\0" "\x04" "pxor\0" "\x05" "vpxor\0" "\x05" "lddqu\0" \ -"\x06" "vlddqu\0" "\x05" "psllw\0" "\x06" "vpsllw\0" "\x05" "pslld\0" \ -"\x06" "vpslld\0" "\x05" "psllq\0" "\x06" "vpsllq\0" "\x07" "pmuludq\0" \ -"\x08" "vpmuludq\0" "\x07" "pmaddwd\0" "\x08" "vpmaddwd\0" "\x06" "psadbw\0" \ -"\x07" "vpsadbw\0" "\x08" "maskmovq\0" "\x0a" "maskmovdqu\0" "\x0b" "vmaskmovdqu\0" \ -"\x05" "psubb\0" "\x06" "vpsubb\0" "\x05" "psubw\0" "\x06" "vpsubw\0" \ -"\x05" "psubd\0" "\x06" "vpsubd\0" "\x05" "psubq\0" "\x06" "vpsubq\0" \ -"\x05" "paddb\0" "\x06" "vpaddb\0" "\x05" "paddw\0" "\x06" "vpaddw\0" \ -"\x05" "paddd\0" "\x06" "vpaddd\0" "\x07" "fnstenv\0" "\x06" "fstenv\0" \ -"\x06" "fnstcw\0" "\x05" "fstcw\0" "\x06" "fnclex\0" "\x05" "fclex\0" \ -"\x06" "fninit\0" "\x05" "finit\0" "\x06" "fnsave\0" "\x05" "fsave\0" \ -"\x06" "fnstsw\0" "\x05" "fstsw\0" "\x06" "pshufb\0" "\x07" "vpshufb\0" \ -"\x06" "phaddw\0" "\x07" "vphaddw\0" "\x06" "phaddd\0" "\x07" "vphaddd\0" \ -"\x07" "phaddsw\0" "\x08" "vphaddsw\0" "\x09" "pmaddubsw\0" "\x0a" "vpmaddubsw\0" \ -"\x06" "phsubw\0" "\x07" "vphsubw\0" "\x06" "phsubd\0" "\x07" "vphsubd\0" \ -"\x07" "phsubsw\0" "\x08" "vphsubsw\0" "\x06" "psignb\0" "\x07" "vpsignb\0" \ -"\x06" "psignw\0" "\x07" "vpsignw\0" "\x06" "psignd\0" "\x07" "vpsignd\0" \ -"\x08" "pmulhrsw\0" "\x09" "vpmulhrsw\0" "\x09" "vpermilps\0" "\x09" "vpermilpd\0" \ -"\x07" "vtestps\0" "\x07" "vtestpd\0" "\x08" "pblendvb\0" "\x08" "blendvps\0" \ -"\x08" "blendvpd\0" "\x05" "ptest\0" "\x06" "vptest\0" "\x0c" "vbroadcastss\0" \ -"\x0c" "vbroadcastsd\0" "\x0e" "vbroadcastf128\0" "\x05" "pabsb\0" "\x06" "vpabsb\0" \ -"\x05" "pabsw\0" "\x06" "vpabsw\0" "\x05" "pabsd\0" "\x06" "vpabsd\0" \ -"\x08" "pmovsxbw\0" "\x09" "vpmovsxbw\0" "\x08" "pmovsxbd\0" "\x09" "vpmovsxbd\0" \ -"\x08" "pmovsxbq\0" "\x09" "vpmovsxbq\0" "\x08" "pmovsxwd\0" "\x09" "vpmovsxwd\0" \ -"\x08" "pmovsxwq\0" "\x09" "vpmovsxwq\0" "\x08" "pmovsxdq\0" "\x09" "vpmovsxdq\0" \ -"\x06" "pmuldq\0" "\x07" "vpmuldq\0" "\x07" "pcmpeqq\0" "\x08" "vpcmpeqq\0" \ -"\x08" "movntdqa\0" "\x09" "vmovntdqa\0" "\x08" "packusdw\0" "\x09" "vpackusdw\0" \ -"\x0a" "vmaskmovps\0" "\x0a" "vmaskmovpd\0" "\x08" "pmovzxbw\0" "\x09" "vpmovzxbw\0" \ -"\x08" "pmovzxbd\0" "\x09" "vpmovzxbd\0" "\x08" "pmovzxbq\0" "\x09" "vpmovzxbq\0" \ -"\x08" "pmovzxwd\0" "\x09" "vpmovzxwd\0" "\x08" "pmovzxwq\0" "\x09" "vpmovzxwq\0" \ -"\x08" "pmovzxdq\0" "\x09" "vpmovzxdq\0" "\x07" "pcmpgtq\0" "\x08" "vpcmpgtq\0" \ -"\x06" "pminsb\0" "\x07" "vpminsb\0" "\x06" "pminsd\0" "\x07" "vpminsd\0" \ -"\x06" "pminuw\0" "\x07" "vpminuw\0" "\x06" "pminud\0" "\x07" "vpminud\0" \ -"\x06" "pmaxsb\0" "\x07" "vpmaxsb\0" "\x06" "pmaxsd\0" "\x07" "vpmaxsd\0" \ -"\x06" "pmaxuw\0" "\x07" "vpmaxuw\0" "\x06" "pmaxud\0" "\x07" "vpmaxud\0" \ -"\x06" "pmulld\0" "\x07" "vpmulld\0" "\x0a" "phminposuw\0" "\x0b" "vphminposuw\0" \ -"\x06" "invept\0" "\x07" "invvpid\0" "\x07" "invpcid\0" "\x0e" "vfmaddsub132ps\0" \ -"\x0e" "vfmaddsub132pd\0" "\x0e" "vfmsubadd132ps\0" "\x0e" "vfmsubadd132pd\0" \ -"\x0b" "vfmadd132ps\0" "\x0b" "vfmadd132pd\0" "\x0b" "vfmadd132ss\0" \ -"\x0b" "vfmadd132sd\0" "\x0b" "vfmsub132ps\0" "\x0b" "vfmsub132pd\0" \ -"\x0b" "vfmsub132ss\0" "\x0b" "vfmsub132sd\0" "\x0c" "vfnmadd132ps\0" \ -"\x0c" "vfnmadd132pd\0" "\x0c" "vfnmadd132ss\0" "\x0c" "vfnmadd132sd\0" \ -"\x0c" "vfnmsub132ps\0" "\x0c" "vfnmsub132pd\0" "\x0c" "vfnmsub132ss\0" \ -"\x0c" "vfnmsub132sd\0" "\x0e" "vfmaddsub213ps\0" "\x0e" "vfmaddsub213pd\0" \ -"\x0e" "vfmsubadd213ps\0" "\x0e" "vfmsubadd213pd\0" "\x0b" "vfmadd213ps\0" \ -"\x0b" "vfmadd213pd\0" "\x0b" "vfmadd213ss\0" "\x0b" "vfmadd213sd\0" \ -"\x0b" "vfmsub213ps\0" "\x0b" "vfmsub213pd\0" "\x0b" "vfmsub213ss\0" \ -"\x0b" "vfmsub213sd\0" "\x0c" "vfnmadd213ps\0" "\x0c" "vfnmadd213pd\0" \ -"\x0c" "vfnmadd213ss\0" "\x0c" "vfnmadd213sd\0" "\x0c" "vfnmsub213ps\0" \ -"\x0c" "vfnmsub213pd\0" "\x0c" "vfnmsub213ss\0" "\x0c" "vfnmsub213sd\0" \ -"\x0e" "vfmaddsub231ps\0" "\x0e" "vfmaddsub231pd\0" "\x0e" "vfmsubadd231ps\0" \ -"\x0e" "vfmsubadd231pd\0" "\x0b" "vfmadd231ps\0" "\x0b" "vfmadd231pd\0" \ -"\x0b" "vfmadd231ss\0" "\x0b" "vfmadd231sd\0" "\x0b" "vfmsub231ps\0" \ -"\x0b" "vfmsub231pd\0" "\x0b" "vfmsub231ss\0" "\x0b" "vfmsub231sd\0" \ -"\x0c" "vfnmadd231ps\0" "\x0c" "vfnmadd231pd\0" "\x0c" "vfnmadd231ss\0" \ -"\x0c" "vfnmadd231sd\0" "\x0c" "vfnmsub231ps\0" "\x0c" "vfnmsub231pd\0" \ -"\x0c" "vfnmsub231ss\0" "\x0c" "vfnmsub231sd\0" "\x06" "aesimc\0" "\x07" "vaesimc\0" \ -"\x06" "aesenc\0" "\x07" "vaesenc\0" "\x0a" "aesenclast\0" "\x0b" "vaesenclast\0" \ -"\x06" "aesdec\0" "\x07" "vaesdec\0" "\x0a" "aesdeclast\0" "\x0b" "vaesdeclast\0" \ -"\x05" "movbe\0" "\x05" "crc32\0" "\x0a" "vperm2f128\0" "\x07" "roundps\0" \ -"\x08" "vroundps\0" "\x07" "roundpd\0" "\x08" "vroundpd\0" "\x07" "roundss\0" \ -"\x08" "vroundss\0" "\x07" "roundsd\0" "\x08" "vroundsd\0" "\x07" "blendps\0" \ -"\x08" "vblendps\0" "\x07" "blendpd\0" "\x08" "vblendpd\0" "\x07" "pblendw\0" \ -"\x08" "vpblendw\0" "\x07" "palignr\0" "\x08" "vpalignr\0" "\x06" "pextrb\0" \ -"\x07" "vpextrb\0" "\x06" "pextrd\0" "\x06" "pextrq\0" "\x07" "vpextrd\0" \ -"\x07" "vpextrq\0" "\x09" "extractps\0" "\x0a" "vextractps\0" "\x0b" "vinsertf128\0" \ -"\x0c" "vextractf128\0" "\x06" "pinsrb\0" "\x07" "vpinsrb\0" "\x08" "insertps\0" \ -"\x09" "vinsertps\0" "\x06" "pinsrd\0" "\x06" "pinsrq\0" "\x07" "vpinsrd\0" \ -"\x07" "vpinsrq\0" "\x04" "dpps\0" "\x05" "vdpps\0" "\x04" "dppd\0" \ -"\x05" "vdppd\0" "\x07" "mpsadbw\0" "\x08" "vmpsadbw\0" "\x09" "pclmulqdq\0" \ -"\x0a" "vpclmulqdq\0" "\x09" "vblendvps\0" "\x09" "vblendvpd\0" "\x09" "vpblendvb\0" \ -"\x09" "pcmpestrm\0" "\x0a" "vpcmpestrm\0" "\x09" "pcmpestri\0" "\x0a" "vpcmpestri\0" \ -"\x09" "pcmpistrm\0" "\x0a" "vpcmpistrm\0" "\x09" "pcmpistri\0" "\x0a" "vpcmpistri\0" \ -"\x0f" "aeskeygenassist\0" "\x10" "vaeskeygenassist\0" "\x06" "psrldq\0" \ -"\x07" "vpsrldq\0" "\x06" "pslldq\0" "\x07" "vpslldq\0" "\x06" "fxsave\0" \ -"\x08" "fxsave64\0" "\x08" "rdfsbase\0" "\x07" "fxrstor\0" "\x09" "fxrstor64\0" \ -"\x08" "rdgsbase\0" "\x07" "ldmxcsr\0" "\x08" "wrfsbase\0" "\x08" "vldmxcsr\0" \ -"\x07" "stmxcsr\0" "\x08" "wrgsbase\0" "\x08" "vstmxcsr\0" "\x07" "vmptrld\0" \ -"\x07" "vmclear\0" "\x05" "vmxon\0" "\x06" "movsxd\0" "\x05" "pause\0" \ -"\x04" "wait\0" "\x06" "rdrand\0" "\x06" "_3dnow\0"; +"\x05" "mwait\0" "\x04" "clac\0" "\x04" "stac\0" "\x06" "xgetbv\0" \ +"\x06" "xsetbv\0" "\x06" "vmfunc\0" "\x04" "xend\0" "\x05" "vmrun\0" \ +"\x07" "vmmcall\0" "\x06" "vmload\0" "\x06" "vmsave\0" "\x04" "stgi\0" \ +"\x04" "clgi\0" "\x06" "skinit\0" "\x07" "invlpga\0" "\x06" "swapgs\0" \ +"\x06" "rdtscp\0" "\x08" "prefetch\0" "\x09" "prefetchw\0" "\x05" "pi2fw\0" \ +"\x05" "pi2fd\0" "\x05" "pf2iw\0" "\x05" "pf2id\0" "\x06" "pfnacc\0" \ +"\x07" "pfpnacc\0" "\x07" "pfcmpge\0" "\x05" "pfmin\0" "\x05" "pfrcp\0" \ +"\x07" "pfrsqrt\0" "\x05" "pfsub\0" "\x05" "pfadd\0" "\x07" "pfcmpgt\0" \ +"\x05" "pfmax\0" "\x08" "pfrcpit1\0" "\x08" "pfrsqit1\0" "\x06" "pfsubr\0" \ +"\x05" "pfacc\0" "\x07" "pfcmpeq\0" "\x05" "pfmul\0" "\x08" "pfrcpit2\0" \ +"\x07" "pmulhrw\0" "\x06" "pswapd\0" "\x07" "pavgusb\0" "\x06" "movups\0" \ +"\x06" "movupd\0" "\x05" "movss\0" "\x05" "movsd\0" "\x07" "vmovups\0" \ +"\x07" "vmovupd\0" "\x06" "vmovss\0" "\x06" "vmovsd\0" "\x07" "movhlps\0" \ +"\x06" "movlps\0" "\x06" "movlpd\0" "\x08" "movsldup\0" "\x07" "movddup\0" \ +"\x08" "vmovhlps\0" "\x07" "vmovlps\0" "\x07" "vmovlpd\0" "\x09" "vmovsldup\0" \ +"\x08" "vmovddup\0" "\x08" "unpcklps\0" "\x08" "unpcklpd\0" "\x09" "vunpcklps\0" \ +"\x09" "vunpcklpd\0" "\x08" "unpckhps\0" "\x08" "unpckhpd\0" "\x09" "vunpckhps\0" \ +"\x09" "vunpckhpd\0" "\x07" "movlhps\0" "\x06" "movhps\0" "\x06" "movhpd\0" \ +"\x08" "movshdup\0" "\x08" "vmovlhps\0" "\x07" "vmovhps\0" "\x07" "vmovhpd\0" \ +"\x09" "vmovshdup\0" "\x0b" "prefetchnta\0" "\x0a" "prefetcht0\0" "\x0a" "prefetcht1\0" \ +"\x0a" "prefetcht2\0" "\x06" "movaps\0" "\x06" "movapd\0" "\x07" "vmovaps\0" \ +"\x07" "vmovapd\0" "\x08" "cvtpi2ps\0" "\x08" "cvtpi2pd\0" "\x08" "cvtsi2ss\0" \ +"\x08" "cvtsi2sd\0" "\x09" "vcvtsi2ss\0" "\x09" "vcvtsi2sd\0" "\x07" "movntps\0" \ +"\x07" "movntpd\0" "\x07" "movntss\0" "\x07" "movntsd\0" "\x08" "vmovntps\0" \ +"\x08" "vmovntpd\0" "\x09" "cvttps2pi\0" "\x09" "cvttpd2pi\0" "\x09" "cvttss2si\0" \ +"\x09" "cvttsd2si\0" "\x0a" "vcvttss2si\0" "\x0a" "vcvttsd2si\0" "\x08" "cvtps2pi\0" \ +"\x08" "cvtpd2pi\0" "\x08" "cvtss2si\0" "\x08" "cvtsd2si\0" "\x09" "vcvtss2si\0" \ +"\x09" "vcvtsd2si\0" "\x07" "ucomiss\0" "\x07" "ucomisd\0" "\x08" "vucomiss\0" \ +"\x08" "vucomisd\0" "\x06" "comiss\0" "\x06" "comisd\0" "\x07" "vcomiss\0" \ +"\x07" "vcomisd\0" "\x08" "movmskps\0" "\x08" "movmskpd\0" "\x09" "vmovmskps\0" \ +"\x09" "vmovmskpd\0" "\x06" "sqrtps\0" "\x06" "sqrtpd\0" "\x06" "sqrtss\0" \ +"\x06" "sqrtsd\0" "\x07" "vsqrtps\0" "\x07" "vsqrtpd\0" "\x07" "vsqrtss\0" \ +"\x07" "vsqrtsd\0" "\x07" "rsqrtps\0" "\x07" "rsqrtss\0" "\x08" "vrsqrtps\0" \ +"\x08" "vrsqrtss\0" "\x05" "rcpps\0" "\x05" "rcpss\0" "\x06" "vrcpps\0" \ +"\x06" "vrcpss\0" "\x05" "andps\0" "\x05" "andpd\0" "\x06" "vandps\0" \ +"\x06" "vandpd\0" "\x06" "andnps\0" "\x06" "andnpd\0" "\x07" "vandnps\0" \ +"\x07" "vandnpd\0" "\x04" "orps\0" "\x04" "orpd\0" "\x05" "vorps\0" \ +"\x05" "vorpd\0" "\x05" "xorps\0" "\x05" "xorpd\0" "\x06" "vxorps\0" \ +"\x06" "vxorpd\0" "\x05" "addps\0" "\x05" "addpd\0" "\x05" "addss\0" \ +"\x05" "addsd\0" "\x06" "vaddps\0" "\x06" "vaddpd\0" "\x06" "vaddss\0" \ +"\x06" "vaddsd\0" "\x05" "mulps\0" "\x05" "mulpd\0" "\x05" "mulss\0" \ +"\x05" "mulsd\0" "\x06" "vmulps\0" "\x06" "vmulpd\0" "\x06" "vmulss\0" \ +"\x06" "vmulsd\0" "\x08" "cvtps2pd\0" "\x08" "cvtpd2ps\0" "\x08" "cvtss2sd\0" \ +"\x08" "cvtsd2ss\0" "\x09" "vcvtps2pd\0" "\x09" "vcvtpd2ps\0" "\x09" "vcvtss2sd\0" \ +"\x09" "vcvtsd2ss\0" "\x08" "cvtdq2ps\0" "\x08" "cvtps2dq\0" "\x09" "cvttps2dq\0" \ +"\x09" "vcvtdq2ps\0" "\x09" "vcvtps2dq\0" "\x0a" "vcvttps2dq\0" "\x05" "subps\0" \ +"\x05" "subpd\0" "\x05" "subss\0" "\x05" "subsd\0" "\x06" "vsubps\0" \ +"\x06" "vsubpd\0" "\x06" "vsubss\0" "\x06" "vsubsd\0" "\x05" "minps\0" \ +"\x05" "minpd\0" "\x05" "minss\0" "\x05" "minsd\0" "\x06" "vminps\0" \ +"\x06" "vminpd\0" "\x06" "vminss\0" "\x06" "vminsd\0" "\x05" "divps\0" \ +"\x05" "divpd\0" "\x05" "divss\0" "\x05" "divsd\0" "\x06" "vdivps\0" \ +"\x06" "vdivpd\0" "\x06" "vdivss\0" "\x06" "vdivsd\0" "\x05" "maxps\0" \ +"\x05" "maxpd\0" "\x05" "maxss\0" "\x05" "maxsd\0" "\x06" "vmaxps\0" \ +"\x06" "vmaxpd\0" "\x06" "vmaxss\0" "\x06" "vmaxsd\0" "\x09" "punpcklbw\0" \ +"\x0a" "vpunpcklbw\0" "\x09" "punpcklwd\0" "\x0a" "vpunpcklwd\0" "\x09" "punpckldq\0" \ +"\x0a" "vpunpckldq\0" "\x08" "packsswb\0" "\x09" "vpacksswb\0" "\x07" "pcmpgtb\0" \ +"\x08" "vpcmpgtb\0" "\x07" "pcmpgtw\0" "\x08" "vpcmpgtw\0" "\x07" "pcmpgtd\0" \ +"\x08" "vpcmpgtd\0" "\x08" "packuswb\0" "\x09" "vpackuswb\0" "\x09" "punpckhbw\0" \ +"\x0a" "vpunpckhbw\0" "\x09" "punpckhwd\0" "\x0a" "vpunpckhwd\0" "\x09" "punpckhdq\0" \ +"\x0a" "vpunpckhdq\0" "\x08" "packssdw\0" "\x09" "vpackssdw\0" "\x0a" "punpcklqdq\0" \ +"\x0b" "vpunpcklqdq\0" "\x0a" "punpckhqdq\0" "\x0b" "vpunpckhqdq\0" "\x04" "movd\0" \ +"\x04" "movq\0" "\x05" "vmovd\0" "\x05" "vmovq\0" "\x06" "movdqa\0" \ +"\x06" "movdqu\0" "\x07" "vmovdqa\0" "\x07" "vmovdqu\0" "\x06" "pshufw\0" \ +"\x06" "pshufd\0" "\x07" "pshufhw\0" "\x07" "pshuflw\0" "\x07" "vpshufd\0" \ +"\x08" "vpshufhw\0" "\x08" "vpshuflw\0" "\x07" "pcmpeqb\0" "\x08" "vpcmpeqb\0" \ +"\x07" "pcmpeqw\0" "\x08" "vpcmpeqw\0" "\x07" "pcmpeqd\0" "\x08" "vpcmpeqd\0" \ +"\x04" "emms\0" "\x0a" "vzeroupper\0" "\x08" "vzeroall\0" "\x06" "vmread\0" \ +"\x05" "extrq\0" "\x07" "insertq\0" "\x07" "vmwrite\0" "\x08" "cvtph2ps\0" \ +"\x08" "cvtps2ph\0" "\x06" "haddpd\0" "\x06" "haddps\0" "\x07" "vhaddpd\0" \ +"\x07" "vhaddps\0" "\x06" "hsubpd\0" "\x06" "hsubps\0" "\x07" "vhsubpd\0" \ +"\x07" "vhsubps\0" "\x05" "xsave\0" "\x07" "xsave64\0" "\x06" "lfence\0" \ +"\x06" "xrstor\0" "\x08" "xrstor64\0" "\x06" "mfence\0" "\x08" "xsaveopt\0" \ +"\x0a" "xsaveopt64\0" "\x06" "sfence\0" "\x07" "clflush\0" "\x06" "popcnt\0" \ +"\x03" "bsf\0" "\x05" "tzcnt\0" "\x03" "bsr\0" "\x05" "lzcnt\0" "\x07" "cmpeqps\0" \ +"\x07" "cmpltps\0" "\x07" "cmpleps\0" "\x0a" "cmpunordps\0" "\x08" "cmpneqps\0" \ +"\x08" "cmpnltps\0" "\x08" "cmpnleps\0" "\x08" "cmpordps\0" "\x07" "cmpeqpd\0" \ +"\x07" "cmpltpd\0" "\x07" "cmplepd\0" "\x0a" "cmpunordpd\0" "\x08" "cmpneqpd\0" \ +"\x08" "cmpnltpd\0" "\x08" "cmpnlepd\0" "\x08" "cmpordpd\0" "\x07" "cmpeqss\0" \ +"\x07" "cmpltss\0" "\x07" "cmpless\0" "\x0a" "cmpunordss\0" "\x08" "cmpneqss\0" \ +"\x08" "cmpnltss\0" "\x08" "cmpnless\0" "\x08" "cmpordss\0" "\x07" "cmpeqsd\0" \ +"\x07" "cmpltsd\0" "\x07" "cmplesd\0" "\x0a" "cmpunordsd\0" "\x08" "cmpneqsd\0" \ +"\x08" "cmpnltsd\0" "\x08" "cmpnlesd\0" "\x08" "cmpordsd\0" "\x08" "vcmpeqps\0" \ +"\x08" "vcmpltps\0" "\x08" "vcmpleps\0" "\x0b" "vcmpunordps\0" "\x09" "vcmpneqps\0" \ +"\x09" "vcmpnltps\0" "\x09" "vcmpnleps\0" "\x09" "vcmpordps\0" "\x0b" "vcmpeq_uqps\0" \ +"\x09" "vcmpngeps\0" "\x09" "vcmpngtps\0" "\x0b" "vcmpfalseps\0" "\x0c" "vcmpneq_oqps\0" \ +"\x08" "vcmpgeps\0" "\x08" "vcmpgtps\0" "\x0a" "vcmptrueps\0" "\x0b" "vcmpeq_osps\0" \ +"\x0b" "vcmplt_oqps\0" "\x0b" "vcmple_oqps\0" "\x0d" "vcmpunord_sps\0" \ +"\x0c" "vcmpneq_usps\0" "\x0c" "vcmpnlt_uqps\0" "\x0c" "vcmpnle_uqps\0" \ +"\x0b" "vcmpord_sps\0" "\x0b" "vcmpeq_usps\0" "\x0c" "vcmpnge_uqps\0" \ +"\x0c" "vcmpngt_uqps\0" "\x0e" "vcmpfalse_osps\0" "\x0c" "vcmpneq_osps\0" \ +"\x0b" "vcmpge_oqps\0" "\x0b" "vcmpgt_oqps\0" "\x0d" "vcmptrue_usps\0" \ +"\x08" "vcmpeqpd\0" "\x08" "vcmpltpd\0" "\x08" "vcmplepd\0" "\x0b" "vcmpunordpd\0" \ +"\x09" "vcmpneqpd\0" "\x09" "vcmpnltpd\0" "\x09" "vcmpnlepd\0" "\x09" "vcmpordpd\0" \ +"\x0b" "vcmpeq_uqpd\0" "\x09" "vcmpngepd\0" "\x09" "vcmpngtpd\0" "\x0b" "vcmpfalsepd\0" \ +"\x0c" "vcmpneq_oqpd\0" "\x08" "vcmpgepd\0" "\x08" "vcmpgtpd\0" "\x0a" "vcmptruepd\0" \ +"\x0b" "vcmpeq_ospd\0" "\x0b" "vcmplt_oqpd\0" "\x0b" "vcmple_oqpd\0" \ +"\x0d" "vcmpunord_spd\0" "\x0c" "vcmpneq_uspd\0" "\x0c" "vcmpnlt_uqpd\0" \ +"\x0c" "vcmpnle_uqpd\0" "\x0b" "vcmpord_spd\0" "\x0b" "vcmpeq_uspd\0" \ +"\x0c" "vcmpnge_uqpd\0" "\x0c" "vcmpngt_uqpd\0" "\x0e" "vcmpfalse_ospd\0" \ +"\x0c" "vcmpneq_ospd\0" "\x0b" "vcmpge_oqpd\0" "\x0b" "vcmpgt_oqpd\0" \ +"\x0d" "vcmptrue_uspd\0" "\x08" "vcmpeqss\0" "\x08" "vcmpltss\0" "\x08" "vcmpless\0" \ +"\x0b" "vcmpunordss\0" "\x09" "vcmpneqss\0" "\x09" "vcmpnltss\0" "\x09" "vcmpnless\0" \ +"\x09" "vcmpordss\0" "\x0b" "vcmpeq_uqss\0" "\x09" "vcmpngess\0" "\x09" "vcmpngtss\0" \ +"\x0b" "vcmpfalsess\0" "\x0c" "vcmpneq_oqss\0" "\x08" "vcmpgess\0" "\x08" "vcmpgtss\0" \ +"\x0a" "vcmptruess\0" "\x0b" "vcmpeq_osss\0" "\x0b" "vcmplt_oqss\0" "\x0b" "vcmple_oqss\0" \ +"\x0d" "vcmpunord_sss\0" "\x0c" "vcmpneq_usss\0" "\x0c" "vcmpnlt_uqss\0" \ +"\x0c" "vcmpnle_uqss\0" "\x0b" "vcmpord_sss\0" "\x0b" "vcmpeq_usss\0" \ +"\x0c" "vcmpnge_uqss\0" "\x0c" "vcmpngt_uqss\0" "\x0e" "vcmpfalse_osss\0" \ +"\x0c" "vcmpneq_osss\0" "\x0b" "vcmpge_oqss\0" "\x0b" "vcmpgt_oqss\0" \ +"\x0d" "vcmptrue_usss\0" "\x08" "vcmpeqsd\0" "\x08" "vcmpltsd\0" "\x08" "vcmplesd\0" \ +"\x0b" "vcmpunordsd\0" "\x09" "vcmpneqsd\0" "\x09" "vcmpnltsd\0" "\x09" "vcmpnlesd\0" \ +"\x09" "vcmpordsd\0" "\x0b" "vcmpeq_uqsd\0" "\x09" "vcmpngesd\0" "\x09" "vcmpngtsd\0" \ +"\x0b" "vcmpfalsesd\0" "\x0c" "vcmpneq_oqsd\0" "\x08" "vcmpgesd\0" "\x08" "vcmpgtsd\0" \ +"\x0a" "vcmptruesd\0" "\x0b" "vcmpeq_ossd\0" "\x0b" "vcmplt_oqsd\0" "\x0b" "vcmple_oqsd\0" \ +"\x0d" "vcmpunord_ssd\0" "\x0c" "vcmpneq_ussd\0" "\x0c" "vcmpnlt_uqsd\0" \ +"\x0c" "vcmpnle_uqsd\0" "\x0b" "vcmpord_ssd\0" "\x0b" "vcmpeq_ussd\0" \ +"\x0c" "vcmpnge_uqsd\0" "\x0c" "vcmpngt_uqsd\0" "\x0e" "vcmpfalse_ossd\0" \ +"\x0c" "vcmpneq_ossd\0" "\x0b" "vcmpge_oqsd\0" "\x0b" "vcmpgt_oqsd\0" \ +"\x0d" "vcmptrue_ussd\0" "\x06" "pinsrw\0" "\x07" "vpinsrw\0" "\x06" "pextrw\0" \ +"\x07" "vpextrw\0" "\x06" "shufps\0" "\x06" "shufpd\0" "\x07" "vshufps\0" \ +"\x07" "vshufpd\0" "\x09" "cmpxchg8b\0" "\x0a" "cmpxchg16b\0" "\x07" "vmptrst\0" \ +"\x08" "addsubpd\0" "\x08" "addsubps\0" "\x09" "vaddsubpd\0" "\x09" "vaddsubps\0" \ +"\x05" "psrlw\0" "\x06" "vpsrlw\0" "\x05" "psrld\0" "\x06" "vpsrld\0" \ +"\x05" "psrlq\0" "\x06" "vpsrlq\0" "\x05" "paddq\0" "\x06" "vpaddq\0" \ +"\x06" "pmullw\0" "\x07" "vpmullw\0" "\x07" "movq2dq\0" "\x07" "movdq2q\0" \ +"\x08" "pmovmskb\0" "\x09" "vpmovmskb\0" "\x07" "psubusb\0" "\x08" "vpsubusb\0" \ +"\x07" "psubusw\0" "\x08" "vpsubusw\0" "\x06" "pminub\0" "\x07" "vpminub\0" \ +"\x04" "pand\0" "\x05" "vpand\0" "\x07" "paddusb\0" "\x08" "vpaddusw\0" \ +"\x07" "paddusw\0" "\x06" "pmaxub\0" "\x07" "vpmaxub\0" "\x05" "pandn\0" \ +"\x06" "vpandn\0" "\x05" "pavgb\0" "\x06" "vpavgb\0" "\x05" "psraw\0" \ +"\x06" "vpsraw\0" "\x05" "psrad\0" "\x06" "vpsrad\0" "\x05" "pavgw\0" \ +"\x06" "vpavgw\0" "\x07" "pmulhuw\0" "\x08" "vpmulhuw\0" "\x06" "pmulhw\0" \ +"\x07" "vpmulhw\0" "\x09" "cvttpd2dq\0" "\x08" "cvtdq2pd\0" "\x08" "cvtpd2dq\0" \ +"\x0a" "vcvttpd2dq\0" "\x09" "vcvtdq2pd\0" "\x09" "vcvtpd2dq\0" "\x06" "movntq\0" \ +"\x07" "movntdq\0" "\x08" "vmovntdq\0" "\x06" "psubsb\0" "\x07" "vpsubsb\0" \ +"\x06" "psubsw\0" "\x07" "vpsubsw\0" "\x06" "pminsw\0" "\x07" "vpminsw\0" \ +"\x03" "por\0" "\x04" "vpor\0" "\x06" "paddsb\0" "\x07" "vpaddsb\0" \ +"\x06" "paddsw\0" "\x07" "vpaddsw\0" "\x06" "pmaxsw\0" "\x07" "vpmaxsw\0" \ +"\x04" "pxor\0" "\x05" "vpxor\0" "\x05" "lddqu\0" "\x06" "vlddqu\0" \ +"\x05" "psllw\0" "\x06" "vpsllw\0" "\x05" "pslld\0" "\x06" "vpslld\0" \ +"\x05" "psllq\0" "\x06" "vpsllq\0" "\x07" "pmuludq\0" "\x08" "vpmuludq\0" \ +"\x07" "pmaddwd\0" "\x08" "vpmaddwd\0" "\x06" "psadbw\0" "\x07" "vpsadbw\0" \ +"\x08" "maskmovq\0" "\x0a" "maskmovdqu\0" "\x0b" "vmaskmovdqu\0" "\x05" "psubb\0" \ +"\x06" "vpsubb\0" "\x05" "psubw\0" "\x06" "vpsubw\0" "\x05" "psubd\0" \ +"\x06" "vpsubd\0" "\x05" "psubq\0" "\x06" "vpsubq\0" "\x05" "paddb\0" \ +"\x06" "vpaddb\0" "\x05" "paddw\0" "\x06" "vpaddw\0" "\x05" "paddd\0" \ +"\x06" "vpaddd\0" "\x07" "fnstenv\0" "\x06" "fstenv\0" "\x06" "fnstcw\0" \ +"\x05" "fstcw\0" "\x06" "fnclex\0" "\x05" "fclex\0" "\x06" "fninit\0" \ +"\x05" "finit\0" "\x06" "fnsave\0" "\x05" "fsave\0" "\x06" "fnstsw\0" \ +"\x05" "fstsw\0" "\x06" "pshufb\0" "\x07" "vpshufb\0" "\x06" "phaddw\0" \ +"\x07" "vphaddw\0" "\x06" "phaddd\0" "\x07" "vphaddd\0" "\x07" "phaddsw\0" \ +"\x08" "vphaddsw\0" "\x09" "pmaddubsw\0" "\x0a" "vpmaddubsw\0" "\x06" "phsubw\0" \ +"\x07" "vphsubw\0" "\x06" "phsubd\0" "\x07" "vphsubd\0" "\x07" "phsubsw\0" \ +"\x08" "vphsubsw\0" "\x06" "psignb\0" "\x07" "vpsignb\0" "\x06" "psignw\0" \ +"\x07" "vpsignw\0" "\x06" "psignd\0" "\x07" "vpsignd\0" "\x08" "pmulhrsw\0" \ +"\x09" "vpmulhrsw\0" "\x09" "vpermilps\0" "\x09" "vpermilpd\0" "\x07" "vtestps\0" \ +"\x07" "vtestpd\0" "\x08" "pblendvb\0" "\x08" "blendvps\0" "\x08" "blendvpd\0" \ +"\x05" "ptest\0" "\x06" "vptest\0" "\x0c" "vbroadcastss\0" "\x0c" "vbroadcastsd\0" \ +"\x0e" "vbroadcastf128\0" "\x05" "pabsb\0" "\x06" "vpabsb\0" "\x05" "pabsw\0" \ +"\x06" "vpabsw\0" "\x05" "pabsd\0" "\x06" "vpabsd\0" "\x08" "pmovsxbw\0" \ +"\x09" "vpmovsxbw\0" "\x08" "pmovsxbd\0" "\x09" "vpmovsxbd\0" "\x08" "pmovsxbq\0" \ +"\x09" "vpmovsxbq\0" "\x08" "pmovsxwd\0" "\x09" "vpmovsxwd\0" "\x08" "pmovsxwq\0" \ +"\x09" "vpmovsxwq\0" "\x08" "pmovsxdq\0" "\x09" "vpmovsxdq\0" "\x06" "pmuldq\0" \ +"\x07" "vpmuldq\0" "\x07" "pcmpeqq\0" "\x08" "vpcmpeqq\0" "\x08" "movntdqa\0" \ +"\x09" "vmovntdqa\0" "\x08" "packusdw\0" "\x09" "vpackusdw\0" "\x0a" "vmaskmovps\0" \ +"\x0a" "vmaskmovpd\0" "\x08" "pmovzxbw\0" "\x09" "vpmovzxbw\0" "\x08" "pmovzxbd\0" \ +"\x09" "vpmovzxbd\0" "\x08" "pmovzxbq\0" "\x09" "vpmovzxbq\0" "\x08" "pmovzxwd\0" \ +"\x09" "vpmovzxwd\0" "\x08" "pmovzxwq\0" "\x09" "vpmovzxwq\0" "\x08" "pmovzxdq\0" \ +"\x09" "vpmovzxdq\0" "\x07" "pcmpgtq\0" "\x08" "vpcmpgtq\0" "\x06" "pminsb\0" \ +"\x07" "vpminsb\0" "\x06" "pminsd\0" "\x07" "vpminsd\0" "\x06" "pminuw\0" \ +"\x07" "vpminuw\0" "\x06" "pminud\0" "\x07" "vpminud\0" "\x06" "pmaxsb\0" \ +"\x07" "vpmaxsb\0" "\x06" "pmaxsd\0" "\x07" "vpmaxsd\0" "\x06" "pmaxuw\0" \ +"\x07" "vpmaxuw\0" "\x06" "pmaxud\0" "\x07" "vpmaxud\0" "\x06" "pmulld\0" \ +"\x07" "vpmulld\0" "\x0a" "phminposuw\0" "\x0b" "vphminposuw\0" "\x06" "invept\0" \ +"\x07" "invvpid\0" "\x07" "invpcid\0" "\x0e" "vfmaddsub132ps\0" "\x0e" "vfmaddsub132pd\0" \ +"\x0e" "vfmsubadd132ps\0" "\x0e" "vfmsubadd132pd\0" "\x0b" "vfmadd132ps\0" \ +"\x0b" "vfmadd132pd\0" "\x0b" "vfmadd132ss\0" "\x0b" "vfmadd132sd\0" \ +"\x0b" "vfmsub132ps\0" "\x0b" "vfmsub132pd\0" "\x0b" "vfmsub132ss\0" \ +"\x0b" "vfmsub132sd\0" "\x0c" "vfnmadd132ps\0" "\x0c" "vfnmadd132pd\0" \ +"\x0c" "vfnmadd132ss\0" "\x0c" "vfnmadd132sd\0" "\x0c" "vfnmsub132ps\0" \ +"\x0c" "vfnmsub132pd\0" "\x0c" "vfnmsub132ss\0" "\x0c" "vfnmsub132sd\0" \ +"\x0e" "vfmaddsub213ps\0" "\x0e" "vfmaddsub213pd\0" "\x0e" "vfmsubadd213ps\0" \ +"\x0e" "vfmsubadd213pd\0" "\x0b" "vfmadd213ps\0" "\x0b" "vfmadd213pd\0" \ +"\x0b" "vfmadd213ss\0" "\x0b" "vfmadd213sd\0" "\x0b" "vfmsub213ps\0" \ +"\x0b" "vfmsub213pd\0" "\x0b" "vfmsub213ss\0" "\x0b" "vfmsub213sd\0" \ +"\x0c" "vfnmadd213ps\0" "\x0c" "vfnmadd213pd\0" "\x0c" "vfnmadd213ss\0" \ +"\x0c" "vfnmadd213sd\0" "\x0c" "vfnmsub213ps\0" "\x0c" "vfnmsub213pd\0" \ +"\x0c" "vfnmsub213ss\0" "\x0c" "vfnmsub213sd\0" "\x0e" "vfmaddsub231ps\0" \ +"\x0e" "vfmaddsub231pd\0" "\x0e" "vfmsubadd231ps\0" "\x0e" "vfmsubadd231pd\0" \ +"\x0b" "vfmadd231ps\0" "\x0b" "vfmadd231pd\0" "\x0b" "vfmadd231ss\0" \ +"\x0b" "vfmadd231sd\0" "\x0b" "vfmsub231ps\0" "\x0b" "vfmsub231pd\0" \ +"\x0b" "vfmsub231ss\0" "\x0b" "vfmsub231sd\0" "\x0c" "vfnmadd231ps\0" \ +"\x0c" "vfnmadd231pd\0" "\x0c" "vfnmadd231ss\0" "\x0c" "vfnmadd231sd\0" \ +"\x0c" "vfnmsub231ps\0" "\x0c" "vfnmsub231pd\0" "\x0c" "vfnmsub231ss\0" \ +"\x0c" "vfnmsub231sd\0" "\x06" "aesimc\0" "\x07" "vaesimc\0" "\x06" "aesenc\0" \ +"\x07" "vaesenc\0" "\x0a" "aesenclast\0" "\x0b" "vaesenclast\0" "\x06" "aesdec\0" \ +"\x07" "vaesdec\0" "\x0a" "aesdeclast\0" "\x0b" "vaesdeclast\0" "\x05" "movbe\0" \ +"\x05" "crc32\0" "\x0a" "vperm2f128\0" "\x07" "roundps\0" "\x08" "vroundps\0" \ +"\x07" "roundpd\0" "\x08" "vroundpd\0" "\x07" "roundss\0" "\x08" "vroundss\0" \ +"\x07" "roundsd\0" "\x08" "vroundsd\0" "\x07" "blendps\0" "\x08" "vblendps\0" \ +"\x07" "blendpd\0" "\x08" "vblendpd\0" "\x07" "pblendw\0" "\x08" "vpblendw\0" \ +"\x07" "palignr\0" "\x08" "vpalignr\0" "\x06" "pextrb\0" "\x07" "vpextrb\0" \ +"\x06" "pextrd\0" "\x06" "pextrq\0" "\x07" "vpextrd\0" "\x07" "vpextrq\0" \ +"\x09" "extractps\0" "\x0a" "vextractps\0" "\x0b" "vinsertf128\0" "\x0c" "vextractf128\0" \ +"\x06" "pinsrb\0" "\x07" "vpinsrb\0" "\x08" "insertps\0" "\x09" "vinsertps\0" \ +"\x06" "pinsrd\0" "\x06" "pinsrq\0" "\x07" "vpinsrd\0" "\x07" "vpinsrq\0" \ +"\x04" "dpps\0" "\x05" "vdpps\0" "\x04" "dppd\0" "\x05" "vdppd\0" "\x07" "mpsadbw\0" \ +"\x08" "vmpsadbw\0" "\x09" "pclmulqdq\0" "\x0a" "vpclmulqdq\0" "\x09" "vblendvps\0" \ +"\x09" "vblendvpd\0" "\x09" "vpblendvb\0" "\x09" "pcmpestrm\0" "\x0a" "vpcmpestrm\0" \ +"\x09" "pcmpestri\0" "\x0a" "vpcmpestri\0" "\x09" "pcmpistrm\0" "\x0a" "vpcmpistrm\0" \ +"\x09" "pcmpistri\0" "\x0a" "vpcmpistri\0" "\x0f" "aeskeygenassist\0" \ +"\x10" "vaeskeygenassist\0" "\x06" "psrldq\0" "\x07" "vpsrldq\0" "\x06" "pslldq\0" \ +"\x07" "vpslldq\0" "\x06" "fxsave\0" "\x08" "fxsave64\0" "\x08" "rdfsbase\0" \ +"\x07" "fxrstor\0" "\x09" "fxrstor64\0" "\x08" "rdgsbase\0" "\x07" "ldmxcsr\0" \ +"\x08" "wrfsbase\0" "\x08" "vldmxcsr\0" "\x07" "stmxcsr\0" "\x08" "wrgsbase\0" \ +"\x08" "vstmxcsr\0" "\x07" "vmptrld\0" "\x07" "vmclear\0" "\x05" "vmxon\0" \ +"\x06" "movsxd\0" "\x05" "pause\0" "\x04" "wait\0" "\x06" "rdrand\0" \ +"\x06" "_3dnow\0" \ +"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"; /* Sentinel mnemonic. */ const _WRegister _REGISTERS[] = { - { 3, "rax" }, { 3, "rcx" }, { 3, "rdx" }, { 3, "rbx" }, { 3, "rsp" }, { 3, "rbp" }, { 3, "rsi" }, { 3, "rdi" }, { 2, "r8" }, { 2, "r9" }, { 3, "r10" }, { 3, "r11" }, { 3, "r12" }, { 3, "r13" }, { 3, "r14" }, { 3, "r15" }, - { 3, "eax" }, { 3, "ecx" }, { 3, "edx" }, { 3, "ebx" }, { 3, "esp" }, { 3, "ebp" }, { 3, "esi" }, { 3, "edi" }, { 3, "r8d" }, { 3, "r9d" }, { 4, "r10d" }, { 4, "r11d" }, { 4, "r12d" }, { 4, "r13d" }, { 4, "r14d" }, { 4, "r15d" }, - { 2, "ax" }, { 2, "cx" }, { 2, "dx" }, { 2, "bx" }, { 2, "sp" }, { 2, "bp" }, { 2, "si" }, { 2, "di" }, { 3, "r8w" }, { 3, "r9w" }, { 4, "r10w" }, { 4, "r11w" }, { 4, "r12w" }, { 4, "r13w" }, { 4, "r14w" }, { 4, "r15w" }, - { 2, "al" }, { 2, "cl" }, { 2, "dl" }, { 2, "bl" }, { 2, "ah" }, { 2, "ch" }, { 2, "dh" }, { 2, "bh" }, { 3, "r8b" }, { 3, "r9b" }, { 4, "r10b" }, { 4, "r11b" }, { 4, "r12b" }, { 4, "r13b" }, { 4, "r14b" }, { 4, "r15b" }, - { 3, "spl" }, { 3, "bpl" }, { 3, "sil" }, { 3, "dil" }, - { 2, "es" }, { 2, "cs" }, { 2, "ss" }, { 2, "ds" }, { 2, "fs" }, { 2, "gs" }, - { 3, "rip" }, - { 3, "st0" }, { 3, "st1" }, { 3, "st2" }, { 3, "st3" }, { 3, "st4" }, { 3, "st5" }, { 3, "st6" }, { 3, "st7" }, - { 3, "mm0" }, { 3, "mm1" }, { 3, "mm2" }, { 3, "mm3" }, { 3, "mm4" }, { 3, "mm5" }, { 3, "mm6" }, { 3, "mm7" }, - { 4, "xmm0" }, { 4, "xmm1" }, { 4, "xmm2" }, { 4, "xmm3" }, { 4, "xmm4" }, { 4, "xmm5" }, { 4, "xmm6" }, { 4, "xmm7" }, { 4, "xmm8" }, { 4, "xmm9" }, { 5, "xmm10" }, { 5, "xmm11" }, { 5, "xmm12" }, { 5, "xmm13" }, { 5, "xmm14" }, { 5, "xmm15" }, - { 4, "ymm0" }, { 4, "ymm1" }, { 4, "ymm2" }, { 4, "ymm3" }, { 4, "ymm4" }, { 4, "ymm5" }, { 4, "ymm6" }, { 4, "ymm7" }, { 4, "ymm8" }, { 4, "ymm9" }, { 5, "ymm10" }, { 5, "ymm11" }, { 5, "ymm12" }, { 5, "ymm13" }, { 5, "ymm14" }, { 5, "ymm15" }, - { 3, "cr0" }, { 0, "" }, { 3, "cr2" }, { 3, "cr3" }, { 3, "cr4" }, { 0, "" }, { 0, "" }, { 0, "" }, { 3, "cr8" }, - { 3, "dr0" }, { 3, "dr1" }, { 3, "dr2" }, { 3, "dr3" }, { 0, "" }, { 0, "" }, { 3, "dr6" }, { 3, "dr7" } + {3, "rax"}, {3, "rcx"}, {3, "rdx"}, {3, "rbx"}, {3, "rsp"}, {3, "rbp"}, {3, "rsi"}, {3, "rdi"}, {2, "r8"}, {2, "r9"}, {3, "r10"}, {3, "r11"}, {3, "r12"}, {3, "r13"}, {3, "r14"}, {3, "r15"}, + {3, "eax"}, {3, "ecx"}, {3, "edx"}, {3, "ebx"}, {3, "esp"}, {3, "ebp"}, {3, "esi"}, {3, "edi"}, {3, "r8d"}, {3, "r9d"}, {4, "r10d"}, {4, "r11d"}, {4, "r12d"}, {4, "r13d"}, {4, "r14d"}, {4, "r15d"}, + {2, "ax"}, {2, "cx"}, {2, "dx"}, {2, "bx"}, {2, "sp"}, {2, "bp"}, {2, "si"}, {2, "di"}, {3, "r8w"}, {3, "r9w"}, {4, "r10w"}, {4, "r11w"}, {4, "r12w"}, {4, "r13w"}, {4, "r14w"}, {4, "r15w"}, + {2, "al"}, {2, "cl"}, {2, "dl"}, {2, "bl"}, {2, "ah"}, {2, "ch"}, {2, "dh"}, {2, "bh"}, {3, "r8b"}, {3, "r9b"}, {4, "r10b"}, {4, "r11b"}, {4, "r12b"}, {4, "r13b"}, {4, "r14b"}, {4, "r15b"}, + {3, "spl"}, {3, "bpl"}, {3, "sil"}, {3, "dil"}, + {2, "es"}, {2, "cs"}, {2, "ss"}, {2, "ds"}, {2, "fs"}, {2, "gs"}, + {3, "rip"}, + {3, "st0"}, {3, "st1"}, {3, "st2"}, {3, "st3"}, {3, "st4"}, {3, "st5"}, {3, "st6"}, {3, "st7"}, + {3, "mm0"}, {3, "mm1"}, {3, "mm2"}, {3, "mm3"}, {3, "mm4"}, {3, "mm5"}, {3, "mm6"}, {3, "mm7"}, + {4, "xmm0"}, {4, "xmm1"}, {4, "xmm2"}, {4, "xmm3"}, {4, "xmm4"}, {4, "xmm5"}, {4, "xmm6"}, {4, "xmm7"}, {4, "xmm8"}, {4, "xmm9"}, {5, "xmm10"}, {5, "xmm11"}, {5, "xmm12"}, {5, "xmm13"}, {5, "xmm14"}, {5, "xmm15"}, + {4, "ymm0"}, {4, "ymm1"}, {4, "ymm2"}, {4, "ymm3"}, {4, "ymm4"}, {4, "ymm5"}, {4, "ymm6"}, {4, "ymm7"}, {4, "ymm8"}, {4, "ymm9"}, {5, "ymm10"}, {5, "ymm11"}, {5, "ymm12"}, {5, "ymm13"}, {5, "ymm14"}, {5, "ymm15"}, + {3, "cr0"}, {0, ""}, {3, "cr2"}, {3, "cr3"}, {3, "cr4"}, {0, ""}, {0, ""}, {0, ""}, {3, "cr8"}, + {3, "dr0"}, {3, "dr1"}, {3, "dr2"}, {3, "dr3"}, {0, ""}, {0, ""}, {3, "dr6"}, {3, "dr7"}, + {0, ""} /* There must be an empty last reg, see strcat_WSR. */ }; #endif /* DISTORM_LIGHT */ diff --git a/NativeCore/Dependencies/distorm/src/operands.c b/NativeCore/Dependencies/distorm/src/operands.c index 506780c4..b5da260b 100644 --- a/NativeCore/Dependencies/distorm/src/operands.c +++ b/NativeCore/Dependencies/distorm/src/operands.c @@ -4,7 +4,7 @@ operands.c diStorm3 - Powerful disassembler for X86/AMD64 http://ragestorm.net/distorm/ distorm at gmail dot com -Copyright (C) 2003-2018 Gil Dabah +Copyright (C) 2003-2021 Gil Dabah This library is licensed under the BSD license. See the file COPYING. */ @@ -23,7 +23,7 @@ uint32_t _REGISTERTORCLASS[] = /* Based on _RegisterType enumeration! */ RM_AX, RM_CX, RM_DX, RM_BX, RM_SP, RM_BP, RM_SI, RM_DI, RM_R8, RM_R9, RM_R10, RM_R11, RM_R12, RM_R13, RM_R14, RM_R15, RM_AX, RM_CX, RM_DX, RM_BX, RM_AX, RM_CX, RM_DX, RM_BX, RM_R8, RM_R9, RM_R10, RM_R11, RM_R12, RM_R13, RM_R14, RM_R15, RM_SP, RM_BP, RM_SI, RM_DI, - 0, 0, 0, 0, 0, 0, + RM_SEG, RM_SEG, RM_SEG, RM_SEG, RM_SEG, RM_SEG, 0, RM_FPU, RM_FPU, RM_FPU, RM_FPU, RM_FPU, RM_FPU, RM_FPU, RM_FPU, RM_MMX, RM_MMX, RM_MMX, RM_MMX, RM_MMX, RM_MMX, RM_MMX, RM_MMX, @@ -33,60 +33,96 @@ uint32_t _REGISTERTORCLASS[] = /* Based on _RegisterType enumeration! */ RM_DR, RM_DR, RM_DR, RM_DR, 0, 0, RM_DR, RM_DR }; -typedef enum {OPERAND_SIZE_NONE = 0, OPERAND_SIZE8, OPERAND_SIZE16, OPERAND_SIZE32, OPERAND_SIZE64, OPERAND_SIZE80, OPERAND_SIZE128, OPERAND_SIZE256} _OperandSizeType; -static uint16_t _OPSIZETOINT[] = {0, 8, 16, 32, 64, 80, 128, 256}; - /* A helper function to fix the 8 bits register if REX is used (to support SIL, DIL, etc). */ -static unsigned int _FASTCALL_ operands_fix_8bit_rex_base(unsigned int reg) +_INLINE_ unsigned int _FASTCALL_ operands_fix_8bit_rex_base(unsigned int reg) { if ((reg >= 4) && (reg < 8)) return reg + REGS8_REX_BASE - 4; return reg + REGS8_BASE; } /* A helper function to set operand's type and size. */ -static void _FASTCALL_ operands_set_ts(_Operand* op, _OperandType type, uint16_t size) +_INLINE_ void operands_set_ts(_Operand* op, _OperandType type, uint16_t size) { op->type = type; op->size = size; } /* A helper function to set operand's type, size and index. */ -static void _FASTCALL_ operands_set_tsi(_Operand* op, _OperandType type, uint16_t size, unsigned int index) +_INLINE_ void operands_set_tsi(_DInst* di, _Operand* op, _OperandType type, uint16_t size, unsigned int index) { op->type = type; op->index = (uint8_t)index; op->size = size; + di->usedRegistersMask |= _REGISTERTORCLASS[index]; } /* A helper function to read an unsigned integer from the stream safely. */ -static int _FASTCALL_ read_stream_safe_uint(_CodeInfo* ci, void* result, unsigned int size) +_INLINE_ int read_stream_safe_uint8(_CodeInfo* ci, void* result) { - ci->codeLen -= size; + ci->codeLen -= 1; if (ci->codeLen < 0) return FALSE; - switch (size) - { - case 1: *(uint8_t*)result = *(uint8_t*)ci->code; break; - case 2: *(uint16_t*)result = RUSHORT(ci->code); break; - case 4: *(uint32_t*)result = RULONG(ci->code); break; - case 8: *(uint64_t*)result = RULLONG(ci->code); break; - } - ci->code += size; + *(uint8_t*)result = *(uint8_t*)ci->code; + ci->code += 1; + return TRUE; +} + +/* A helper function to read an unsigned integer from the stream safely. */ +_INLINE_ int read_stream_safe_uint16(_CodeInfo* ci, void* result) +{ + ci->codeLen -= 2; + if (ci->codeLen < 0) return FALSE; + *(uint16_t*)result = RUSHORT(ci->code); + ci->code += 2; + return TRUE; +} + +/* A helper function to read an unsigned integer from the stream safely. */ +_INLINE_ int read_stream_safe_uint32(_CodeInfo* ci, void* result) +{ + ci->codeLen -= 4; + if (ci->codeLen < 0) return FALSE; + *(uint32_t*)result = RULONG(ci->code); + ci->code += 4; + return TRUE; +} + +/* A helper function to read an unsigned integer from the stream safely. */ +_INLINE_ int read_stream_safe_uint64(_CodeInfo* ci, void* result) +{ + ci->codeLen -= 8; + if (ci->codeLen < 0) return FALSE; + *(uint64_t*)result = RULLONG(ci->code); + ci->code += 8; return TRUE; } /* A helper function to read a signed integer from the stream safely. */ -static int _FASTCALL_ read_stream_safe_sint(_CodeInfo* ci, int64_t* result, unsigned int size) +_INLINE_ int read_stream_safe_sint8(_CodeInfo* ci, int64_t* result) { - ci->codeLen -= size; + ci->codeLen -= 1; if (ci->codeLen < 0) return FALSE; - switch (size) - { - case 1: *result = *(int8_t*)ci->code; break; - case 2: *result = RSHORT(ci->code); break; - case 4: *result = RLONG(ci->code); break; - case 8: *result = RLLONG(ci->code); break; - } - ci->code += size; + *result = *(int8_t*)ci->code; + ci->code += 1; + return TRUE; +} + +/* A helper function to read a signed integer from the stream safely. */ +_INLINE_ int read_stream_safe_sint16(_CodeInfo* ci, int64_t* result) +{ + ci->codeLen -= 2; + if (ci->codeLen < 0) return FALSE; + *result = RSHORT(ci->code); + ci->code += 2; + return TRUE; +} + +/* A helper function to read a signed integer from the stream safely. */ +_INLINE_ int read_stream_safe_sint32(_CodeInfo* ci, int64_t* result) +{ + ci->codeLen -= 4; + if (ci->codeLen < 0) return FALSE; + *result = RLONG(ci->code); + ci->code += 4; return TRUE; } @@ -108,23 +144,20 @@ static int _FASTCALL_ read_stream_safe_sint(_CodeInfo* ci, int64_t* result, unsi * NOTE: base could specify None (no base register) if base==5 and mod==0, but then you also need DISP32. * } */ -static void operands_extract_sib(_DInst* di, _OperandNumberType opNum, +static void operands_extract_sib(_DInst* di, _PrefixState* ps, _DecodeType effAdrSz, - unsigned int sib, unsigned int mod) + unsigned int sib, unsigned int mod, _Operand* op) { - unsigned int scale = 0, index = 0, base = 0; + unsigned char scale, index, base; unsigned int vrex = ps->vrex; uint8_t* pIndex = NULL; - _Operand* op = &di->ops[opNum]; - /* * SIB bits: * |7---6-5----3-2---0| * |SCALE| INDEX| BASE| * |------------------| */ - scale = (sib >> 6) & 3; index = (sib >> 3) & 7; base = sib & 7; @@ -154,6 +187,8 @@ static void operands_extract_sib(_DInst* di, _OperandNumberType opNum, if (vrex & PREFIX_EX_B) ps->usedPrefixes |= INST_PRE_REX; *pIndex = effAdrSz == Decode64Bits ? REGS64_BASE : REGS32_BASE; *pIndex += (uint8_t)(base + ((vrex & PREFIX_EX_B) ? EX_GPR_BASE : 0)); + + if (di->base != R_NONE) di->usedRegistersMask |= _REGISTERTORCLASS[di->base]; } else if (mod != 0) { /* * if base == 5 then you have to decode according to MOD. @@ -166,6 +201,8 @@ static void operands_extract_sib(_DInst* di, _OperandNumberType opNum, if (vrex & PREFIX_EX_B) ps->usedPrefixes |= INST_PRE_REX; if (effAdrSz == Decode64Bits) *pIndex = REGS64_BASE + 5 + ((vrex & PREFIX_EX_B) ? EX_GPR_BASE : 0); else *pIndex = REGS32_BASE + 5 + ((vrex & PREFIX_EX_B) ? EX_GPR_BASE : 0); + + if (di->base != R_NONE) di->usedRegistersMask |= _REGISTERTORCLASS[di->base]; } else if (index == 4) { /* 32bits displacement only. */ op->type = O_DISP; @@ -173,6 +210,7 @@ static void operands_extract_sib(_DInst* di, _OperandNumberType opNum, } if (index != 4) { /* In 64 bits decoding mode, if index == R12, it's valid! */ + scale = (sib >> 6) & 3; if (effAdrSz == Decode64Bits) op->index = (uint8_t)(REGS64_BASE + index); else op->index = (uint8_t)(REGS32_BASE + index); di->scale = scale != 0 ? (1 << scale) : 0; @@ -191,70 +229,393 @@ static void operands_extract_sib(_DInst* di, _OperandNumberType opNum, * Some instructions force the use of RM16 or other specific types, so take it into account. */ -static int operands_extract_modrm(_CodeInfo* ci, - _DInst* di, _OpType type, - _OperandNumberType opNum, _PrefixState* ps, - _DecodeType effOpSz, _DecodeType effAdrSz, - int* lockableInstruction, unsigned int mod, unsigned int rm, - _iflags instFlags) +static int operands_extract_modrm(_CodeInfo* ci, _PrefixState* ps, _DInst* di, + _DecodeType effAdrSz, unsigned int mod, unsigned int rm, + _iflags instFlags, _Operand* op) { - unsigned int vrex = ps->vrex, sib = 0, base = 0; - _Operand* op = &di->ops[opNum]; - uint16_t size = 0; + unsigned char sib = 0, base = 0; - if (mod == 3) { - /* - * General-purpose register is handled the same way in 16/32/64 bits decoding modes. - * NOTE!! that we have to override the size of the register, since it was set earlier as Memory and not Register! - */ - op->type = O_REG; - /* Start with original size which was set earlier, some registers have same size of memory and depend on it. */ - size = op->size; - switch(type) + /* Memory indirection decoding ahead:) */ + + ps->usedPrefixes |= INST_PRE_ADDR_SIZE; + if ((instFlags & INST_PRE_LOCK) && (ps->decodedPrefixes & INST_PRE_LOCK)) { + ps->usedPrefixes |= INST_PRE_LOCK; + di->flags |= FLAG_LOCK; + } + + if (effAdrSz != Decode16Bits) { /* Decode32Bits or Decode64Bits! */ + /* Remember that from a 32/64 bits ModR/M byte a SIB byte could follow! */ + if ((rm == 5) && (mod == 0)) { + /* 5 is a special case - only 32 bits displacement, or RIP relative. */ + di->dispSize = 32; + if (!read_stream_safe_sint32(ci, (int64_t*)&di->disp)) return FALSE; + + /* Absolute address: */ + op->type = O_DISP; + + if (ci->dt == Decode64Bits) { + /* In 64 bits decoding mode depsite of the address size, a RIP-relative address it is. */ + op->type = O_SMEM; + op->index = R_RIP; + di->flags |= FLAG_RIP_RELATIVE; + } + + prefixes_use_segment(INST_PRE_DS, ps, ci->dt, di); + } + else { + if (rm == 4) { + /* 4 is a special case - SIB byte + disp8/32 follows! */ + /* Read SIB byte. */ + if (!read_stream_safe_uint8(ci, &sib)) return FALSE; + operands_extract_sib(di, ps, effAdrSz, sib, mod, op); + } + else { + op->type = O_SMEM; + if (ps->vrex & PREFIX_EX_B) { + ps->usedPrefixes |= INST_PRE_REX; + rm += EX_GPR_BASE; + } + + if (effAdrSz == Decode64Bits) op->index = (uint8_t)(REGS64_BASE + rm); + else op->index = (uint8_t)(REGS32_BASE + rm); + } + + if (mod == 1) { + di->dispSize = 8; + if (!read_stream_safe_sint8(ci, (int64_t*)&di->disp)) return FALSE; + } + else if ((mod == 2) || ((sib & 7) == 5)) { /* If there is no BASE, read DISP32! */ + di->dispSize = 32; + if (!read_stream_safe_sint32(ci, (int64_t*)&di->disp)) return FALSE; + } + + /* Get the base register. */ + base = op->index; + if (di->base != R_NONE) base = di->base; + else if (di->scale >= 2) base = 0; /* If it's only an index but got scale, it's still DS. */ + /* Default for EBP/ESP is SS segment. 64 bits mode ignores DS anyway. */ + if ((base == R_EBP) || (base == R_ESP)) prefixes_use_segment(INST_PRE_SS, ps, ci->dt, di); + else prefixes_use_segment(INST_PRE_DS, ps, ci->dt, di); + } + } + else { /* Decode16Bits */ + /* Decoding according to Table 2-1. (16 bits) */ + if ((mod == 0) && (rm == 6)) { + /* 6 is a special case - only 16 bits displacement. */ + op->type = O_DISP; + di->dispSize = 16; + if (!read_stream_safe_sint16(ci, (int64_t*)&di->disp)) return FALSE; + } + else { + /* + * Create the O_MEM for 16 bits indirection that requires 2 registers, E.G: [BS+SI]. + * or create O_SMEM for a single register indirection, E.G: [BP]. + */ + static uint8_t MODS[] = { R_BX, R_BX, R_BP, R_BP, R_SI, R_DI, R_BP, R_BX }; + static uint8_t MODS2[] = { R_SI, R_DI, R_SI, R_DI }; + if (rm < 4) { + op->type = O_MEM; + di->base = MODS[rm]; + di->usedRegistersMask |= _REGISTERTORCLASS[MODS[rm]]; + op->index = MODS2[rm]; + } + else { + op->type = O_SMEM; + op->index = MODS[rm]; + } + + if (mod == 1) { /* 8 bits displacement + indirection */ + di->dispSize = 8; + if (!read_stream_safe_sint8(ci, (int64_t*)&di->disp)) return FALSE; + } + else if (mod == 2) { /* 16 bits displacement + indirection */ + di->dispSize = 16; + if (!read_stream_safe_sint16(ci, (int64_t*)&di->disp)) return FALSE; + } + } + + if ((rm == 2) || (rm == 3) || ((rm == 6) && (mod != 0))) { + /* BP's default segment is SS, so ignore it. */ + prefixes_use_segment(INST_PRE_SS, ps, ci->dt, di); + } + else { + /* Ignore default DS segment. */ + prefixes_use_segment(INST_PRE_DS, ps, ci->dt, di); + } + } + + return TRUE; +} + + +/* + * This function is reponsible to textually format a required operand according to its type. + * It is vital to understand that there are other operands than what the ModR/M byte specifies. + + * Only by decoding the operands of an instruction which got a LOCK prefix, we could tell whether it may use the LOCK prefix. + * According to Intel, LOCK prefix must precede some specific instructions AND in their memory destination operand form (which means first operand). + * LOCK INC EAX, would generate an exception, but LOCK INC [EAX] is alright. + * Also LOCK ADD BX, [BP] would generate an exception. + + * Return code: + * TRUE - continue parsing the instruction and its operands, everything went right 'till now. + * FALSE - not enough bytes, or invalid operands. + */ + +int operands_extract(_CodeInfo* ci, _DInst* di, _InstInfo* ii, + _iflags instFlags, _OpType type, + unsigned int modrm, _PrefixState* ps, _DecodeType effOpSz, + _DecodeType effAdrSz, _Operand* op) +{ + int ret = 0; + unsigned int mod, reg, rm; + unsigned int size = 0; + + /* + * ModRM bits: + * |7-6-5--------3-2-0| + * |MOD|REG/OPCODE|RM | + * |------------------| + */ + /* mod = (modrm >> 6) & 3; */ /* Mode(register-indirection, disp8+reg+indirection, disp16+reg+indirection, general-purpose register) */ + /* reg = (modrm >> 3) & 7; */ /* Register(could be part of the opcode itself or general-purpose register) */ + /* rm = modrm & 7; */ /* Specifies which general-purpose register or disp+reg to use. */ + + /* -- Memory Indirection Operands (that cannot be a general purpose register) -- */ + if ((type >= OT_MEM) && (type <= OT_LMEM128_256)) { + /* All of the above types can't use a general-purpose register (a MOD of 3)!. */ + mod = (modrm >> 6) & 3; + + if (mod == 3) { + if (type == OT_MEM_OPT) { + /* Since the MEM is optional, only when mod != 3, then return true as if the operand was alright. */ + return TRUE; + } + return FALSE; + } + + switch (type) { - case OT_RFULL_M16: - case OT_RM_FULL: + case OT_MEM64_128: /* Used only by CMPXCHG8/16B. */ + if (effOpSz == Decode64Bits) { + ps->usedPrefixes |= INST_PRE_REX; + size = 128; + } + else size = 64; + break; + case OT_MEM32: size = 32; break; + case OT_MEM32_64: + /* Used by MOVNTI. Default size is 32bits, 64bits with REX. */ + if (effOpSz == Decode64Bits) { + ps->usedPrefixes |= INST_PRE_REX; + size = 64; + } + else size = 32; + break; + case OT_MEM64: size = 64; break; + case OT_MEM128: size = 128; break; + case OT_MEM16_FULL: /* The size indicates about the second item of the pair. */ switch (effOpSz) { case Decode16Bits: ps->usedPrefixes |= INST_PRE_OP_SIZE; - if (vrex & PREFIX_EX_B) { - ps->usedPrefixes |= INST_PRE_REX; - rm += EX_GPR_BASE; - } size = 16; - rm += REGS16_BASE; break; case Decode32Bits: ps->usedPrefixes |= INST_PRE_OP_SIZE; - if (vrex & PREFIX_EX_B) { - ps->usedPrefixes |= INST_PRE_REX; - rm += EX_GPR_BASE; - } size = 32; - rm += REGS32_BASE; break; case Decode64Bits: - /* A fix for SMSW RAX which use the REX prefix. */ - if (type == OT_RFULL_M16) ps->usedPrefixes |= INST_PRE_REX; - /* CALL NEAR/PUSH/POP defaults to 64 bits. --> INST_64BITS, REX isn't required, thus ignored anyways. */ - if (instFlags & INST_PRE_REX) ps->usedPrefixes |= INST_PRE_REX; - /* Include REX if used for REX.B. */ - if (vrex & PREFIX_EX_B) { - ps->usedPrefixes |= INST_PRE_REX; - rm += EX_GPR_BASE; - } + /* Mark usage of REX only if it was required. */ + if ((instFlags & (INST_64BITS | INST_PRE_REX)) == (INST_64BITS | INST_PRE_REX)) ps->usedPrefixes |= INST_PRE_REX; size = 64; - rm += REGS64_BASE; break; } break; + case OT_MEM16_3264: /* The size indicates about the second item of the pair. */ + if (ci->dt == Decode64Bits) size = 64; + else size = 32; + break; + case OT_FPUM16: size = 16; break; + case OT_FPUM32: size = 32; break; + case OT_FPUM64: size = 64; break; + case OT_FPUM80: size = 80; break; + case OT_LMEM128_256: + if (ps->vrex & PREFIX_EX_L) size = 256; + else size = 128; + break; + case OT_MEM_OPT: /* Here we know it's not optional. */ + case OT_MEM: size = 0; /* Size is unknown, but still handled. */ break; + default: return FALSE; + } + rm = modrm & 7; + ret = operands_extract_modrm(ci, ps, di, effAdrSz, mod, rm, instFlags, op); + op->size = (uint16_t)size; + if ((op->type == O_SMEM) || (op->type == O_MEM)) { + di->usedRegistersMask |= _REGISTERTORCLASS[op->index]; + } + return ret; + } + + /* -- Memory Indirection Operands (that can be a register) -- */ + if ((type >= OT_RM8) && (type <= OT_LXMM64_128)) { + mod = (modrm >> 6) & 3; + if (mod != 3) { + switch (type) + { + case OT_RM_FULL: + ps->usedPrefixes |= INST_PRE_OP_SIZE; + /* PUSH/JMP/CALL are automatically promoted to 64 bits! */ + if (effOpSz == Decode32Bits) { + size = 32; + break; + } + else if (effOpSz == Decode64Bits) { + /* Mark usage of REX only if it was required. */ + if ((instFlags & INST_64BITS) == 0) ps->usedPrefixes |= INST_PRE_REX; + size = 64; + break; + } + /* FALL THROUGH BECAUSE dt==Decoded16Bits @-<----*/ + case OT_RM16: + /* If we got here not from OT_RM16, then the prefix was used. */ + if (type != OT_RM16) ps->usedPrefixes |= INST_PRE_OP_SIZE; + size = 16; + break; + case OT_RM32_64: + /* The default size is 32, which can be 64 with a REX only. */ + if (effOpSz == Decode64Bits) { + size = 64; + /* Mark REX prefix as used if non-promoted instruction. */ + if ((instFlags & (INST_64BITS | INST_PRE_REX)) == (INST_64BITS | INST_PRE_REX)) { + ps->usedPrefixes |= INST_PRE_REX; + } + } + else size = 32; + break; + case OT_RM16_32: + /* Ignore REX, it's either 32 or 16 bits RM. */ + if (ps->decodedPrefixes & INST_PRE_OP_SIZE) { + ps->usedPrefixes |= INST_PRE_OP_SIZE; + /* Assume: We are in 64bits when we have this operand used. */ + size = 16; + } + else size = 32; + break; + case OT_WXMM32_64: + case OT_WRM32_64: + if (ps->vrex & PREFIX_EX_W) size = 64; + else size = 32; + break; + case OT_YXMM64_256: + if (ps->vrex & PREFIX_EX_L) size = 256; + else size = 64; + break; + case OT_YXMM128_256: + if (ps->vrex & PREFIX_EX_L) size = 256; + else size = 128; + break; + case OT_LXMM64_128: + if (ps->vrex & PREFIX_EX_L) size = 128; + else size = 64; + break; + case OT_RFULL_M16: + ps->usedPrefixes |= INST_PRE_OP_SIZE; + size = 16; + break; + + case OT_RM8: + case OT_R32_M8: + case OT_R32_64_M8: + case OT_REG32_64_M8: + size = 8; + break; + + case OT_XMM16: + case OT_R32_M16: + case OT_R32_64_M16: + case OT_REG32_64_M16: + size = 16; + break; + + case OT_RM32: + case OT_MM32: + case OT_XMM32: + size = 32; + break; + + case OT_MM64: + case OT_XMM64: + size = 64; + break; + + case OT_XMM128: size = 128; break; + case OT_YMM256: size = 256; break; + default: return FALSE; + } + /* Fill size of memory dereference for operand. */ + rm = modrm & 7; + ret = operands_extract_modrm(ci, ps, di, effAdrSz, mod, rm, instFlags, op); + op->size = (uint16_t)size; + if ((op->type == O_SMEM) || (op->type == O_MEM)) { + di->usedRegistersMask |= _REGISTERTORCLASS[op->index]; + } + return ret; + } + else { + /* + * General-purpose register is handled the same way in 16/32/64 bits decoding modes. + * NOTE!! that we have to override the size of the register, since it was set earlier as Memory and not Register! + */ + rm = modrm & 7; + size = 0; + switch (type) + { + case OT_RFULL_M16: + case OT_RM_FULL: + switch (effOpSz) + { + case Decode16Bits: + ps->usedPrefixes |= INST_PRE_OP_SIZE; + if (ps->vrex & PREFIX_EX_B) { + ps->usedPrefixes |= INST_PRE_REX; + rm += EX_GPR_BASE; + } + size = 16; + rm += REGS16_BASE; + break; + case Decode32Bits: + ps->usedPrefixes |= INST_PRE_OP_SIZE; + if (ps->vrex & PREFIX_EX_B) { + ps->usedPrefixes |= INST_PRE_REX; + rm += EX_GPR_BASE; + } + size = 32; + rm += REGS32_BASE; + break; + case Decode64Bits: + /* A fix for SMSW RAX which use the REX prefix. */ + if (type == OT_RFULL_M16) ps->usedPrefixes |= INST_PRE_REX; + /* CALL NEAR/PUSH/POP defaults to 64 bits. --> INST_64BITS, REX isn't required, thus ignored anyways. */ + if (instFlags & INST_PRE_REX) ps->usedPrefixes |= INST_PRE_REX; + /* Mark usage of REX only if it was required. */ + if ((instFlags & INST_64BITS) == 0) ps->usedPrefixes |= INST_PRE_REX; + /* Include REX if used for REX.B. */ + if (ps->vrex & PREFIX_EX_B) { + ps->usedPrefixes |= INST_PRE_REX; + rm += EX_GPR_BASE; + } + size = 64; + rm += REGS64_BASE; + break; + } + break; case OT_R32_64_M8: - /* FALL THROUGH, decode 32 or 64 bits register. */ + /* FALL THROUGH, decode 32 or 64 bits register. */ case OT_R32_64_M16: - /* FALL THROUGH, decode 32 or 64 bits register. */ + /* FALL THROUGH, decode 32 or 64 bits register. */ case OT_RM32_64: /* Take care specifically in MOVNTI/MOVD/CVT's instructions, making it _REG64 with REX or if they are promoted. */ - if (vrex & PREFIX_EX_B) { + if (ps->vrex & PREFIX_EX_B) { ps->usedPrefixes |= INST_PRE_REX; rm += EX_GPR_BASE; } @@ -265,17 +626,18 @@ static int operands_extract_modrm(_CodeInfo* ci, break; } /* Give a chance to REX.W. Because if it was a promoted instruction we don't care about REX.W anyways. */ - if (vrex & PREFIX_EX_W) { + if (ps->vrex & PREFIX_EX_W) { ps->usedPrefixes |= INST_PRE_REX; size = 64; rm += REGS64_BASE; - } else { + } + else { size = 32; rm += REGS32_BASE; } - break; + break; case OT_RM16_32: /* Used only with MOVZXD instruction to support 16 bits operand. */ - if (vrex & PREFIX_EX_B) { + if (ps->vrex & PREFIX_EX_B) { ps->usedPrefixes |= INST_PRE_REX; rm += EX_GPR_BASE; } @@ -284,412 +646,113 @@ static int operands_extract_modrm(_CodeInfo* ci, ps->usedPrefixes |= INST_PRE_OP_SIZE; size = 16; rm += REGS16_BASE; - } else { + } + else { size = 32; rm += REGS32_BASE; } - break; + break; case OT_RM16: - if (vrex & PREFIX_EX_B) { + if (ps->vrex & PREFIX_EX_B) { ps->usedPrefixes |= INST_PRE_REX; rm += EX_GPR_BASE; } rm += REGS16_BASE; - break; + size = 16; + break; case OT_RM8: if (ps->prefixExtType == PET_REX) { ps->usedPrefixes |= INST_PRE_REX; - rm = operands_fix_8bit_rex_base(rm + ((vrex & PREFIX_EX_B) ? EX_GPR_BASE : 0)); - } else rm += REGS8_BASE; - break; + rm = operands_fix_8bit_rex_base(rm + ((ps->vrex & PREFIX_EX_B) ? EX_GPR_BASE : 0)); + } + else rm += REGS8_BASE; + size = 8; + break; case OT_MM32: case OT_MM64: /* MMX doesn't support extended registers. */ size = 64; rm += MMXREGS_BASE; - break; + break; case OT_XMM16: case OT_XMM32: case OT_XMM64: case OT_XMM128: - if (vrex & PREFIX_EX_B) { + if (ps->vrex & PREFIX_EX_B) { ps->usedPrefixes |= INST_PRE_REX; rm += EX_GPR_BASE; } size = 128; rm += SSEREGS_BASE; - break; + break; case OT_RM32: case OT_R32_M8: case OT_R32_M16: - if (vrex & PREFIX_EX_B) { + if (ps->vrex & PREFIX_EX_B) { ps->usedPrefixes |= INST_PRE_REX; rm += EX_GPR_BASE; } size = 32; rm += REGS32_BASE; - break; + break; case OT_YMM256: - if (vrex & PREFIX_EX_B) rm += EX_GPR_BASE; + if (ps->vrex & PREFIX_EX_B) rm += EX_GPR_BASE; rm += AVXREGS_BASE; - break; + size = 256; + break; case OT_YXMM64_256: case OT_YXMM128_256: - if (vrex & PREFIX_EX_B) rm += EX_GPR_BASE; - if (vrex & PREFIX_EX_L) { + if (ps->vrex & PREFIX_EX_B) rm += EX_GPR_BASE; + if (ps->vrex & PREFIX_EX_L) { size = 256; rm += AVXREGS_BASE; - } else { + } + else { size = 128; rm += SSEREGS_BASE; } - break; + break; case OT_WXMM32_64: case OT_LXMM64_128: - if (vrex & PREFIX_EX_B) rm += EX_GPR_BASE; + if (ps->vrex & PREFIX_EX_B) rm += EX_GPR_BASE; size = 128; rm += SSEREGS_BASE; - break; + break; case OT_WRM32_64: case OT_REG32_64_M8: case OT_REG32_64_M16: - if (vrex & PREFIX_EX_B) rm += EX_GPR_BASE; - if (vrex & PREFIX_EX_W) { + if (ps->vrex & PREFIX_EX_B) rm += EX_GPR_BASE; + if (ps->vrex & PREFIX_EX_W) { size = 64; rm += REGS64_BASE; - } else { + } + else { size = 32; rm += REGS32_BASE; } - break; - - default: return FALSE; - } - op->size = size; - op->index = (uint8_t)rm; - return TRUE; - } - - /* Memory indirection decoding ahead:) */ - - ps->usedPrefixes |= INST_PRE_ADDR_SIZE; - if (lockableInstruction && (ps->decodedPrefixes & INST_PRE_LOCK)) *lockableInstruction = TRUE; - - if (effAdrSz == Decode16Bits) { - /* Decoding according to Table 2-1. (16 bits) */ - if ((mod == 0) && (rm == 6)) { - /* 6 is a special case - only 16 bits displacement. */ - op->type = O_DISP; - di->dispSize = 16; - if (!read_stream_safe_sint(ci, (int64_t*)&di->disp, sizeof(int16_t))) return FALSE; - } else { - /* - * Create the O_MEM for 16 bits indirection that requires 2 registers, E.G: [BS+SI]. - * or create O_SMEM for a single register indirection, E.G: [BP]. - */ - static uint8_t MODS[] = {R_BX, R_BX, R_BP, R_BP, R_SI, R_DI, R_BP, R_BX}; - static uint8_t MODS2[] = {R_SI, R_DI, R_SI, R_DI}; - if (rm < 4) { - op->type = O_MEM; - di->base = MODS[rm]; - op->index = MODS2[rm]; - } else { - op->type = O_SMEM; - op->index = MODS[rm]; - } - - if (mod == 1) { /* 8 bits displacement + indirection */ - di->dispSize = 8; - if (!read_stream_safe_sint(ci, (int64_t*)&di->disp, sizeof(int8_t))) return FALSE; - } else if (mod == 2) { /* 16 bits displacement + indirection */ - di->dispSize = 16; - if (!read_stream_safe_sint(ci, (int64_t*)&di->disp, sizeof(int16_t))) return FALSE; - } - } - - if ((rm == 2) || (rm == 3) || ((rm == 6) && (mod != 0))) { - /* BP's default segment is SS, so ignore it. */ - prefixes_use_segment(INST_PRE_SS, ps, ci->dt, di); - } else { - /* Ignore default DS segment. */ - prefixes_use_segment(INST_PRE_DS, ps, ci->dt, di); - } - } else { /* Decode32Bits or Decode64Bits! */ - /* Remember that from a 32/64 bits ModR/M byte a SIB byte could follow! */ - if ((mod == 0) && (rm == 5)) { - - /* 5 is a special case - only 32 bits displacement, or RIP relative. */ - di->dispSize = 32; - if (!read_stream_safe_sint(ci, (int64_t*)&di->disp, sizeof(int32_t))) return FALSE; - - if (ci->dt == Decode64Bits) { - /* In 64 bits decoding mode depsite of the address size, a RIP-relative address it is. */ - op->type = O_SMEM; - op->index = R_RIP; - di->flags |= FLAG_RIP_RELATIVE; - } else { - /* Absolute address: */ - op->type = O_DISP; - } - } else { - if (rm == 4) { - /* 4 is a special case - SIB byte + disp8/32 follows! */ - /* Read SIB byte. */ - if (!read_stream_safe_uint(ci, &sib, sizeof(int8_t))) return FALSE; - operands_extract_sib(di, opNum, ps, effAdrSz, sib, mod); - } else { - op->type = O_SMEM; - if (vrex & PREFIX_EX_B) { - ps->usedPrefixes |= INST_PRE_REX; - rm += EX_GPR_BASE; - } - - if (effAdrSz == Decode64Bits) op->index = (uint8_t)(REGS64_BASE + rm); - else op->index = (uint8_t)(REGS32_BASE + rm); - } - - if (mod == 1) { - di->dispSize = 8; - if (!read_stream_safe_sint(ci, (int64_t*)&di->disp, sizeof(int8_t))) return FALSE; - } else if ((mod == 2) || ((sib & 7) == 5)) { /* If there is no BASE, read DISP32! */ - di->dispSize = 32; - if (!read_stream_safe_sint(ci, (int64_t*)&di->disp, sizeof(int32_t))) return FALSE; - } - } - - /* Get the base register. */ - base = op->index; - if (di->base != R_NONE) base = di->base; - else if (di->scale >= 2) base = 0; /* If it's only an index but got scale, it's still DS. */ - /* Default for EBP/ESP is SS segment. 64 bits mode ignores DS anyway. */ - if ((base == R_EBP) || (base == R_ESP)) prefixes_use_segment(INST_PRE_SS, ps, ci->dt, di); - else prefixes_use_segment(INST_PRE_DS, ps, ci->dt, di); - } - - return TRUE; -} - - -/* - * This function is reponsible to textually format a required operand according to its type. - * It is vital to understand that there are other operands than what the ModR/M byte specifies. - - * Only by decoding the operands of an instruction which got a LOCK prefix, we could tell whether it may use the LOCK prefix. - * According to Intel, LOCK prefix must precede some specific instructions AND in their memory destination operand form (which means first operand). - * LOCK INC EAX, would generate an exception, but LOCK INC [EAX] is alright. - * Also LOCK ADD BX, [BP] would generate an exception. - - * Return code: - * TRUE - continue parsing the instruction and its operands, everything went right 'till now. - * FALSE - not enough bytes, or invalid operands. - */ - -int operands_extract(_CodeInfo* ci, _DInst* di, _InstInfo* ii, - _iflags instFlags, _OpType type, _OperandNumberType opNum, - unsigned int modrm, _PrefixState* ps, _DecodeType effOpSz, - _DecodeType effAdrSz, int* lockableInstruction) -{ - int ret = 0; - unsigned int mod = 0, reg = 0, rm = 0, vexV = ps->vexV; - unsigned int vrex = ps->vrex, typeHandled = TRUE; - _Operand* op = &di->ops[opNum]; - - /* Used to indicate the size of the MEMORY INDIRECTION only. */ - _OperandSizeType opSize = OPERAND_SIZE_NONE; - - /* - * ModRM bits: - * |7-6-5--------3-2-0| - * |MOD|REG/OPCODE|RM | - * |------------------| - */ - mod = (modrm >> 6) & 3; /* Mode(register-indirection, disp8+reg+indirection, disp16+reg+indirection, general-purpose register) */ - reg = (modrm >> 3) & 7; /* Register(could be part of the opcode itself or general-purpose register) */ - rm = modrm & 7; /* Specifies which general-purpose register or disp+reg to use. */ - - /* -- Memory Indirection Operands (that cannot be a general purpose register) -- */ - switch (type) - { - case OT_MEM64_128: /* Used only by CMPXCHG8/16B. */ - /* Make a specific check when the type is OT_MEM64_128 since the lockable CMPXCHG8B uses this one... */ - if (lockableInstruction && (ps->decodedPrefixes & INST_PRE_LOCK)) *lockableInstruction = TRUE; - if (effOpSz == Decode64Bits) { - ps->usedPrefixes |= INST_PRE_REX; - opSize = OPERAND_SIZE128; - } else opSize = OPERAND_SIZE64; - break; - case OT_MEM32: opSize = OPERAND_SIZE32; break; - case OT_MEM32_64: - /* Used by MOVNTI. Default size is 32bits, 64bits with REX. */ - if (effOpSz == Decode64Bits) { - ps->usedPrefixes |= INST_PRE_REX; - opSize = OPERAND_SIZE64; - } else opSize = OPERAND_SIZE32; - break; - case OT_MEM64: opSize = OPERAND_SIZE64; break; - case OT_MEM128: opSize = OPERAND_SIZE128; break; - case OT_MEM16_FULL: /* The size indicates about the second item of the pair. */ - switch (effOpSz) - { - case Decode16Bits: - ps->usedPrefixes |= INST_PRE_OP_SIZE; - opSize = OPERAND_SIZE16; - break; - case Decode32Bits: - ps->usedPrefixes |= INST_PRE_OP_SIZE; - opSize = OPERAND_SIZE32; - break; - case Decode64Bits: - /* Mark usage of REX only if it was required. */ - if ((instFlags & (INST_64BITS | INST_PRE_REX)) == (INST_64BITS | INST_PRE_REX)) ps->usedPrefixes |= INST_PRE_REX; - opSize = OPERAND_SIZE64; break; - } - break; - case OT_MEM16_3264: /* The size indicates about the second item of the pair. */ - if (ci->dt == Decode64Bits) opSize = OPERAND_SIZE64; - else opSize = OPERAND_SIZE32; - break; - case OT_MEM_OPT: - /* Since the MEM is optional, only when mod != 3, then return true as if the operand was alright. */ - if (mod == 0x3) return TRUE; - break; - case OT_FPUM16: opSize = OPERAND_SIZE16; break; - case OT_FPUM32: opSize = OPERAND_SIZE32; break; - case OT_FPUM64: opSize = OPERAND_SIZE64; break; - case OT_FPUM80: opSize = OPERAND_SIZE80; break; - case OT_LMEM128_256: - if (vrex & PREFIX_EX_L) opSize = OPERAND_SIZE256; - else opSize = OPERAND_SIZE128; - break; - case OT_MEM: /* Size is unknown, but still handled. */ break; - default: typeHandled = FALSE; break; - } - if (typeHandled) { - /* All of the above types can't use a general-purpose register (a MOD of 3)!. */ - if (mod == 0x3) { - if (lockableInstruction) *lockableInstruction = FALSE; - return FALSE; - } - op->size = _OPSIZETOINT[opSize]; - ret = operands_extract_modrm(ci, di, type, opNum, ps, effOpSz, effAdrSz, lockableInstruction, mod, rm, instFlags); - if ((op->type == O_REG) || (op->type == O_SMEM) || (op->type == O_MEM)) { - di->usedRegistersMask |= _REGISTERTORCLASS[op->index]; - } - return ret; - } - /* -- Memory Indirection Operands (that can be a register) -- */ - typeHandled = TRUE; - switch (type) - { - case OT_RM_FULL: - ps->usedPrefixes |= INST_PRE_OP_SIZE; - /* PUSH/JMP/CALL are automatically promoted to 64 bits! */ - if (effOpSz == Decode32Bits) { - opSize = OPERAND_SIZE32; - break; - } else if (effOpSz == Decode64Bits) { - /* Mark usage of REX only if it was required. */ - if ((instFlags & INST_64BITS) == 0) ps->usedPrefixes |= INST_PRE_REX; - opSize = OPERAND_SIZE64; - break; + default: return FALSE; } - /* FALL THROUGH BECAUSE dt==Decoded16Bits @-<----*/ - case OT_RM16: - /* If we got here not from OT_RM16, then the prefix was used. */ - if (type != OT_RM16) ps->usedPrefixes |= INST_PRE_OP_SIZE; - opSize = OPERAND_SIZE16; - break; - case OT_RM32_64: - /* The default size is 32, which can be 64 with a REX only. */ - if (effOpSz == Decode64Bits) { - opSize = OPERAND_SIZE64; - /* Mark REX prefix as used if non-promoted instruction. */ - if ((instFlags & (INST_64BITS | INST_PRE_REX)) == (INST_64BITS | INST_PRE_REX)) { - ps->usedPrefixes |= INST_PRE_REX; - } - } else opSize = OPERAND_SIZE32; - break; - case OT_RM16_32: - /* Ignore REX, it's either 32 or 16 bits RM. */ - if (ps->decodedPrefixes & INST_PRE_OP_SIZE) { - ps->usedPrefixes |= INST_PRE_OP_SIZE; - /* Assume: We are in 64bits when we have this operand used. */ - opSize = OPERAND_SIZE16; - } else opSize = OPERAND_SIZE32; - break; - case OT_WXMM32_64: - case OT_WRM32_64: - if (vrex & PREFIX_EX_W) opSize = OPERAND_SIZE64; - else opSize = OPERAND_SIZE32; - break; - case OT_YXMM64_256: - if (vrex & PREFIX_EX_L) opSize = OPERAND_SIZE256; - else opSize = OPERAND_SIZE64; - break; - case OT_YXMM128_256: - if (vrex & PREFIX_EX_L) opSize = OPERAND_SIZE256; - else opSize = OPERAND_SIZE128; - break; - case OT_LXMM64_128: - if (vrex & PREFIX_EX_L) opSize = OPERAND_SIZE128; - else opSize = OPERAND_SIZE64; - break; - case OT_RFULL_M16: - ps->usedPrefixes |= INST_PRE_OP_SIZE; - opSize = OPERAND_SIZE16; - break; - - case OT_RM8: - case OT_R32_M8: - case OT_R32_64_M8: - case OT_REG32_64_M8: - opSize = OPERAND_SIZE8; - break; - - case OT_XMM16: - case OT_R32_M16: - case OT_R32_64_M16: - case OT_REG32_64_M16: - opSize = OPERAND_SIZE16; - break; - - case OT_RM32: - case OT_MM32: - case OT_XMM32: - opSize = OPERAND_SIZE32; - break; - - case OT_MM64: - case OT_XMM64: - opSize = OPERAND_SIZE64; - break; - - case OT_XMM128: opSize = OPERAND_SIZE128; break; - case OT_YMM256: opSize = OPERAND_SIZE256; break; - default: typeHandled = FALSE; break; - } - if (typeHandled) { - /* Fill size of memory dereference for operand. */ - op->size = _OPSIZETOINT[opSize]; - ret = operands_extract_modrm(ci, di, type, opNum, ps, effOpSz, effAdrSz, lockableInstruction, mod, rm, instFlags); - if ((op->type == O_REG) || (op->type == O_SMEM) || (op->type == O_MEM)) { - di->usedRegistersMask |= _REGISTERTORCLASS[op->index]; + op->size = (uint16_t)size; + op->index = (uint8_t)rm; + op->type = O_REG; + di->usedRegistersMask |= _REGISTERTORCLASS[rm]; + return TRUE; } - return ret; } - /* Simple operand type (no ModRM byte). */ + /* Simple operand type (ModRM reg). */ + reg = (modrm >> 3) & 7; switch (type) { case OT_IMM8: operands_set_ts(op, O_IMM, 8); - if (!read_stream_safe_uint(ci, &di->imm.byte, sizeof(int8_t))) return FALSE; + if (!read_stream_safe_uint8(ci, &di->imm.byte)) return FALSE; break; case OT_IMM_FULL: /* 16, 32 or 64, depends on prefixes. */ if (effOpSz == Decode16Bits) { @@ -697,7 +760,7 @@ int operands_extract(_CodeInfo* ci, _DInst* di, _InstInfo* ii, /* FALL THROUGH */ case OT_IMM16: /* Force 16 bits imm. */ operands_set_ts(op, O_IMM, 16); - if (!read_stream_safe_uint(ci, &di->imm.word, sizeof(int16_t))) return FALSE; + if (!read_stream_safe_uint16(ci, &di->imm.word)) return FALSE; break; /* * Extension: MOV imm64, requires REX. @@ -709,7 +772,7 @@ int operands_extract(_CodeInfo* ci, _DInst* di, _InstInfo* ii, ps->usedPrefixes |= INST_PRE_REX; operands_set_ts(op, O_IMM, 64); - if (!read_stream_safe_uint(ci, &di->imm.qword, sizeof(int64_t))) return FALSE; + if (!read_stream_safe_uint64(ci, &di->imm.qword)) return FALSE; break; } else ps->usedPrefixes |= INST_PRE_OP_SIZE; /* FALL THROUGH BECAUSE dt==Decoded32Bits @-<----*/ @@ -723,10 +786,10 @@ int operands_extract(_CodeInfo* ci, _DInst* di, _InstInfo* ii, op->size = 32; /* Use this as an indicator that it should be signed extended. */ di->flags |= FLAG_IMM_SIGNED; - if (!read_stream_safe_sint(ci, &di->imm.sqword, sizeof(int32_t))) return FALSE; + if (!read_stream_safe_sint32(ci, &di->imm.sqword)) return FALSE; } else { op->size = 32; - if (!read_stream_safe_uint(ci, &di->imm.dword, sizeof(int32_t))) return FALSE; + if (!read_stream_safe_uint32(ci, &di->imm.dword)) return FALSE; } break; case OT_SEIMM8: /* Sign extended immediate. */ @@ -752,19 +815,19 @@ int operands_extract(_CodeInfo* ci, _DInst* di, _InstInfo* ii, } } else op->size = 8; di->flags |= FLAG_IMM_SIGNED; - if (!read_stream_safe_sint(ci, &di->imm.sqword, sizeof(int8_t))) return FALSE; + if (!read_stream_safe_sint8(ci, &di->imm.sqword)) return FALSE; break; case OT_IMM16_1: operands_set_ts(op, O_IMM1, 16); - if (!read_stream_safe_uint(ci, &di->imm.ex.i1, sizeof(int16_t))) return FALSE; + if (!read_stream_safe_uint16(ci, &di->imm.ex.i1)) return FALSE; break; case OT_IMM8_1: operands_set_ts(op, O_IMM1, 8); - if (!read_stream_safe_uint(ci, &di->imm.ex.i1, sizeof(int8_t))) return FALSE; + if (!read_stream_safe_uint8(ci, &di->imm.ex.i1)) return FALSE; break; case OT_IMM8_2: operands_set_ts(op, O_IMM2, 8); - if (!read_stream_safe_uint(ci, &di->imm.ex.i2, sizeof(int8_t))) return FALSE; + if (!read_stream_safe_uint8(ci, &di->imm.ex.i2)) return FALSE; break; case OT_REG8: operands_set_ts(op, O_REG, 8); @@ -774,99 +837,102 @@ int operands_extract(_CodeInfo* ci, _DInst* di, _InstInfo* ii, * This is a PASSIVE behavior changer of REX prefix, it affects operands even if its value is 0x40 ! */ ps->usedPrefixes |= INST_PRE_REX; - op->index = (uint8_t)operands_fix_8bit_rex_base(reg + ((vrex & PREFIX_EX_R) ? EX_GPR_BASE : 0)); + op->index = (uint8_t)operands_fix_8bit_rex_base(reg + ((ps->vrex & PREFIX_EX_R) ? EX_GPR_BASE : 0)); } else op->index = (uint8_t)(REGS8_BASE + reg); + di->usedRegistersMask |= _REGISTERTORCLASS[op->index]; break; case OT_REG16: - operands_set_tsi(op, O_REG, 16, REGS16_BASE + reg); + operands_set_tsi(di, op, O_REG, 16, REGS16_BASE + reg); break; case OT_REG_FULL: switch (effOpSz) { case Decode16Bits: ps->usedPrefixes |= INST_PRE_OP_SIZE; - if (vrex & PREFIX_EX_R) { + if (ps->vrex & PREFIX_EX_R) { ps->usedPrefixes |= INST_PRE_REX; reg += EX_GPR_BASE; } - operands_set_tsi(op, O_REG, 16, REGS16_BASE + reg); + operands_set_tsi(di, op, O_REG, 16, REGS16_BASE + reg); break; case Decode32Bits: - if (vrex & PREFIX_EX_R) { + if (ps->vrex & PREFIX_EX_R) { ps->usedPrefixes |= INST_PRE_REX; reg += EX_GPR_BASE; } else ps->usedPrefixes |= INST_PRE_OP_SIZE; - operands_set_tsi(op, O_REG, 32, REGS32_BASE + reg); + operands_set_tsi(di, op, O_REG, 32, REGS32_BASE + reg); break; case Decode64Bits: /* rex must be presented. */ ps->usedPrefixes |= INST_PRE_REX; - operands_set_tsi(op, O_REG, 64, REGS64_BASE + reg + ((vrex & PREFIX_EX_R) ? EX_GPR_BASE : 0)); + operands_set_tsi(di, op, O_REG, 64, REGS64_BASE + reg + ((ps->vrex & PREFIX_EX_R) ? EX_GPR_BASE : 0)); break; } break; case OT_REG32: - if (vrex & PREFIX_EX_R) { + if (ps->vrex & PREFIX_EX_R) { ps->usedPrefixes |= INST_PRE_REX; reg += EX_GPR_BASE; } - operands_set_tsi(op, O_REG, 32, REGS32_BASE + reg); + operands_set_tsi(di, op, O_REG, 32, REGS32_BASE + reg); break; case OT_REG32_64: /* Handle CVT's, MOVxX and MOVNTI instructions which could be extended to 64 bits registers with REX. */ - if (vrex & PREFIX_EX_R) { + if (ps->vrex & PREFIX_EX_R) { ps->usedPrefixes |= INST_PRE_REX; reg += EX_GPR_BASE; } /* Is it a promoted instruction? (only INST_64BITS is set and REX isn't required.) */ if ((ci->dt == Decode64Bits) && ((instFlags & (INST_64BITS | INST_PRE_REX)) == INST_64BITS)) { - operands_set_tsi(op, O_REG, 64, REGS64_BASE + reg); + operands_set_tsi(di, op, O_REG, 64, REGS64_BASE + reg); break; } /* Give a chance to REX.W. Because if it was a promoted instruction we don't care about REX.W anyways. */ - if (vrex & PREFIX_EX_W) { + if (ps->vrex & PREFIX_EX_W) { ps->usedPrefixes |= INST_PRE_REX; - operands_set_tsi(op, O_REG, 64, REGS64_BASE + reg); - } else operands_set_tsi(op, O_REG, 32, REGS32_BASE + reg); + operands_set_tsi(di, op, O_REG, 64, REGS64_BASE + reg); + } else operands_set_tsi(di, op, O_REG, 32, REGS32_BASE + reg); break; case OT_FREG32_64_RM: /* Force decoding mode. Used for MOV CR(n)/DR(n) which defaults to 64 bits operand size in 64 bits. */ - if (vrex & PREFIX_EX_B) { + rm = modrm & 7; + if (ps->vrex & PREFIX_EX_B) { ps->usedPrefixes |= INST_PRE_REX; rm += EX_GPR_BASE; } - if (ci->dt == Decode64Bits) operands_set_tsi(op, O_REG, 64, REGS64_BASE + rm); - else operands_set_tsi(op, O_REG, 32, REGS32_BASE + rm); + if (ci->dt == Decode64Bits) operands_set_tsi(di, op, O_REG, 64, REGS64_BASE + rm); + else operands_set_tsi(di, op, O_REG, 32, REGS32_BASE + rm); break; case OT_MM: /* MMX register */ - operands_set_tsi(op, O_REG, 64, MMXREGS_BASE + reg); + operands_set_tsi(di, op, O_REG, 64, MMXREGS_BASE + reg); break; case OT_MM_RM: /* MMX register, this time from the RM field */ - operands_set_tsi(op, O_REG, 64, MMXREGS_BASE + rm); + rm = modrm & 7; + operands_set_tsi(di, op, O_REG, 64, MMXREGS_BASE + rm); break; case OT_REGXMM0: /* Implicit XMM0 operand. */ - reg = 0; - vrex = 0; - /* FALL THROUGH */ + operands_set_tsi(di, op, O_REG, 128, SSEREGS_BASE + 0); + break; case OT_XMM: /* SSE register */ - if (vrex & PREFIX_EX_R) { + if (ps->vrex & PREFIX_EX_R) { ps->usedPrefixes |= INST_PRE_REX; reg += EX_GPR_BASE; } - operands_set_tsi(op, O_REG, 128, SSEREGS_BASE + reg); + operands_set_tsi(di, op, O_REG, 128, SSEREGS_BASE + reg); break; case OT_XMM_RM: /* SSE register, this time from the RM field */ - if (vrex & PREFIX_EX_B) { + rm = modrm & 7; + if (ps->vrex & PREFIX_EX_B) { ps->usedPrefixes |= INST_PRE_REX; rm += EX_GPR_BASE; } - operands_set_tsi(op, O_REG, 128, SSEREGS_BASE + rm); + operands_set_tsi(di, op, O_REG, 128, SSEREGS_BASE + rm); break; case OT_CREG: /* * Don't parse if the reg exceeds the bounds of the array. * Most of the CR's are not implemented, so if there's no matching string, the operand is invalid. */ - if (vrex & PREFIX_EX_R) { + if (ps->vrex & PREFIX_EX_R) { ps->usedPrefixes |= INST_PRE_REX; reg += EX_GPR_BASE; } else if ((ci->dt == Decode32Bits) && (ps->decodedPrefixes & INST_PRE_LOCK)) { @@ -884,24 +950,25 @@ int operands_extract(_CodeInfo* ci, _DInst* di, _InstInfo* ii, if (ci->dt == Decode64Bits) op->size = 64; else op->size = 32; op->index = (uint8_t)(CREGS_BASE + reg); + di->usedRegistersMask |= _REGISTERTORCLASS[op->index]; break; case OT_DREG: /* * In 64 bits there are 16 debug registers. * but accessing any of dr8-15 which aren't implemented will cause an #ud. */ - if ((reg == 4) || (reg == 5) || (vrex & PREFIX_EX_R)) return FALSE; + if ((reg == 4) || (reg == 5) || (ps->vrex & PREFIX_EX_R)) return FALSE; op->type = O_REG; if (ci->dt == Decode64Bits) op->size = 64; else op->size = 32; op->index = (uint8_t)(DREGS_BASE + reg); + di->usedRegistersMask |= _REGISTERTORCLASS[op->index]; break; case OT_SREG: /* Works with REG16 only! */ - /* If lockableInstruction pointer is non-null we know it's the first operand. */ - if (lockableInstruction && (reg == 1)) return FALSE; /* Can't MOV CS, . */ + if ((&di->ops[0] == op) && (reg == 1)) return FALSE; /* Can't MOV CS, . */ /*Don't parse if the reg exceeds the bounds of the array. */ - if (reg <= SEG_REGS_MAX - 1) operands_set_tsi(op, O_REG, 16, SREGS_BASE + reg); + if (reg <= SEG_REGS_MAX - 1) operands_set_tsi(di, op, O_REG, 16, SREGS_BASE + reg); else return FALSE; break; case OT_SEG: @@ -922,29 +989,31 @@ int operands_extract(_CodeInfo* ci, _DInst* di, _InstInfo* ii, case INST_PRE_FS: op->index = R_FS; break; case INST_PRE_GS: op->index = R_GS; break; } + di->usedRegistersMask |= _REGISTERTORCLASS[op->index]; break; case OT_ACC8: - operands_set_tsi(op, O_REG, 8, R_AL); + operands_set_tsi(di, op, O_REG, 8, R_AL); break; case OT_ACC16: - operands_set_tsi(op, O_REG, 16, R_AX); + operands_set_tsi(di, op, O_REG, 16, R_AX); break; - case OT_ACC_FULL_NOT64: /* No REX.W support for IN/OUT. */ - vrex &= ~PREFIX_EX_W; + case OT_ACC_FULL_NOT64: + /* No REX.W support for IN/OUT. */ + /* FALL THROUGH */ case OT_ACC_FULL: if (effOpSz == Decode16Bits) { ps->usedPrefixes |= INST_PRE_OP_SIZE; - operands_set_tsi(op, O_REG, 16, R_AX); - } else if (effOpSz == Decode32Bits) { + operands_set_tsi(di, op, O_REG, 16, R_AX); + } else if ((effOpSz == Decode32Bits) || (type == OT_ACC_FULL_NOT64)) { ps->usedPrefixes |= INST_PRE_OP_SIZE; - operands_set_tsi(op, O_REG, 32, R_EAX); + operands_set_tsi(di, op, O_REG, 32, R_EAX); } else { /* Decode64Bits */ /* Only non-promoted instructions need REX in order to decode in 64 bits. */ /* MEM-OFFSET MOV's are NOT automatically promoted to 64 bits. */ - if (~instFlags & INST_64BITS) { + if (!(instFlags & INST_64BITS)) { ps->usedPrefixes |= INST_PRE_REX; } - operands_set_tsi(op, O_REG, 64, R_RAX); + operands_set_tsi(di, op, O_REG, 64, R_RAX); } break; case OT_PTR16_FULL: @@ -976,17 +1045,17 @@ int operands_extract(_CodeInfo* ci, _DInst* di, _InstInfo* ii, if (type == OT_RELCB) { operands_set_ts(op, O_PC, 8); - if (!read_stream_safe_sint(ci, &di->imm.sqword, sizeof(int8_t))) return FALSE; + if (!read_stream_safe_sint8(ci, &di->imm.sqword)) return FALSE; } else { /* OT_RELC_FULL */ /* Yep, operand size prefix affects relc also. */ ps->usedPrefixes |= INST_PRE_OP_SIZE; if (effOpSz == Decode16Bits) { operands_set_ts(op, O_PC, 16); - if (!read_stream_safe_sint(ci, &di->imm.sqword, sizeof(int16_t))) return FALSE; + if (!read_stream_safe_sint16(ci, &di->imm.sqword)) return FALSE; } else { /* Decode32Bits or Decode64Bits = for now they are the same */ operands_set_ts(op, O_PC, 32); - if (!read_stream_safe_sint(ci, &di->imm.sqword, sizeof(int32_t))) return FALSE; + if (!read_stream_safe_sint32(ci, &di->imm.sqword)) return FALSE; } } @@ -1026,15 +1095,15 @@ int operands_extract(_CodeInfo* ci, _DInst* di, _InstInfo* ii, ps->usedPrefixes |= INST_PRE_ADDR_SIZE; di->dispSize = 16; - if (!read_stream_safe_uint(ci, &di->disp, sizeof(int16_t))) return FALSE; + if (!read_stream_safe_uint16(ci, &di->disp)) return FALSE; } else if (effAdrSz == Decode32Bits) { ps->usedPrefixes |= INST_PRE_ADDR_SIZE; di->dispSize = 32; - if (!read_stream_safe_uint(ci, &di->disp, sizeof(int32_t))) return FALSE; + if (!read_stream_safe_uint32(ci, &di->disp)) return FALSE; } else { /* Decode64Bits */ di->dispSize = 64; - if (!read_stream_safe_uint(ci, &di->disp, sizeof(int64_t))) return FALSE; + if (!read_stream_safe_uint64(ci, &di->disp)) return FALSE; } break; case OT_CONST1: @@ -1042,20 +1111,22 @@ int operands_extract(_CodeInfo* ci, _DInst* di, _InstInfo* ii, di->imm.byte = 1; break; case OT_REGCL: - operands_set_tsi(op, O_REG, 8, R_CL); + operands_set_tsi(di, op, O_REG, 8, R_CL); break; case OT_FPU_SI: /* Low 3 bits specify the REG, similar to the MODR/M byte reg. */ - operands_set_tsi(op, O_REG, 32, FPUREGS_BASE + (*(ci->code-1) & 7)); + operands_set_tsi(di, op, O_REG, 32, FPUREGS_BASE + (*(ci->code-1) & 7)); break; case OT_FPU_SSI: - operands_set_tsi(op, O_REG, 32, R_ST0); - operands_set_tsi(op + 1, O_REG, 32, FPUREGS_BASE + (*(ci->code-1) & 7)); + operands_set_tsi(di, op, O_REG, 32, R_ST0); + operands_set_tsi(di, op + 1, O_REG, 32, FPUREGS_BASE + (*(ci->code-1) & 7)); + di->opsNo++; break; case OT_FPU_SIS: - operands_set_tsi(op, O_REG, 32, FPUREGS_BASE + (*(ci->code-1) & 7)); - operands_set_tsi(op + 1, O_REG, 32, R_ST0); + operands_set_tsi(di, op, O_REG, 32, FPUREGS_BASE + (*(ci->code-1) & 7)); + operands_set_tsi(di, op + 1, O_REG, 32, R_ST0); + di->opsNo++; break; /* @@ -1070,13 +1141,15 @@ int operands_extract(_CodeInfo* ci, _DInst* di, _InstInfo* ii, /* Low 3 bits specify the REG, similar to the MODR/M byte reg. */ operands_set_ts(op, O_REG, 8); reg = *(ci->code-1) & 7; - if (vrex & PREFIX_EX_B) { + if (ps->vrex & PREFIX_EX_B) { ps->usedPrefixes |= INST_PRE_REX; op->index = (uint8_t)operands_fix_8bit_rex_base(reg + EX_GPR_BASE); } else if (ps->prefixExtType == PET_REX) { ps->usedPrefixes |= INST_PRE_REX; op->index = (uint8_t)operands_fix_8bit_rex_base(reg); } else op->index = (uint8_t)(REGS8_BASE + reg); + + di->usedRegistersMask |= _REGISTERTORCLASS[op->index]; break; case OT_IB_R_FULL: reg = *(ci->code-1) & 7; @@ -1084,18 +1157,18 @@ int operands_extract(_CodeInfo* ci, _DInst* di, _InstInfo* ii, { case Decode16Bits: ps->usedPrefixes |= INST_PRE_OP_SIZE; - if (vrex & PREFIX_EX_B) { + if (ps->vrex & PREFIX_EX_B) { ps->usedPrefixes |= INST_PRE_REX; reg += EX_GPR_BASE; } - operands_set_tsi(op, O_REG, 16, REGS16_BASE + reg); + operands_set_tsi(di, op, O_REG, 16, REGS16_BASE + reg); break; case Decode32Bits: - if (vrex & PREFIX_EX_B) { + if (ps->vrex & PREFIX_EX_B) { ps->usedPrefixes |= INST_PRE_REX; reg += EX_GPR_BASE; } else ps->usedPrefixes |= INST_PRE_OP_SIZE; - operands_set_tsi(op, O_REG, 32, REGS32_BASE + reg); + operands_set_tsi(di, op, O_REG, 32, REGS32_BASE + reg); break; case Decode64Bits: /* @@ -1104,15 +1177,15 @@ int operands_extract(_CodeInfo* ci, _DInst* di, _InstInfo* ii, * MOV imm64 / BSWAP requires REX.W to be 64 bits --> INST_64BITS | INST_PRE_REX */ if ((instFlags & INST_64BITS) && ((instFlags & INST_PRE_REX) == 0)) { - if (vrex & PREFIX_EX_B) { + if (ps->vrex & PREFIX_EX_B) { ps->usedPrefixes |= INST_PRE_REX; reg += EX_GPR_BASE; } } else { ps->usedPrefixes |= INST_PRE_REX; - reg += (vrex & PREFIX_EX_B) ? EX_GPR_BASE : 0; + reg += (ps->vrex & PREFIX_EX_B) ? EX_GPR_BASE : 0; } - operands_set_tsi(op, O_REG, 64, REGS64_BASE + reg); + operands_set_tsi(di, op, O_REG, 64, REGS64_BASE + reg); break; } break; @@ -1161,12 +1234,14 @@ int operands_extract(_CodeInfo* ci, _DInst* di, _InstInfo* ii, * Clear segment in case OT_REGI_EDI was parsed earlier, * DS can be overridden and therefore has precedence. */ - di->segment = 0; + di->segment = R_NONE; prefixes_use_segment(INST_PRE_DS, ps, ci->dt, di); if (effAdrSz == Decode16Bits) op->index = R_SI; else if (effAdrSz == Decode32Bits) op->index = R_ESI; else op->index = R_RSI; + + di->usedRegistersMask |= _REGISTERTORCLASS[R_RSI]; /* Maps to RM_SI. */ break; case OT_REGI_EDI: ps->usedPrefixes |= INST_PRE_ADDR_SIZE; @@ -1185,22 +1260,24 @@ int operands_extract(_CodeInfo* ci, _DInst* di, _InstInfo* ii, } else op->size = 8; /* Note: The [rDI] operand can't be prefixed by a segment override, therefore we don't set usedPrefixes. */ - if ((opNum == ONT_1) && (ci->dt != Decode64Bits)) di->segment = R_ES | SEGMENT_DEFAULT; /* No ES in 64 bits mode. */ + if ((di->segment == R_NONE) && (ci->dt != Decode64Bits)) di->segment = R_ES | SEGMENT_DEFAULT; /* No ES in 64 bits mode. */ if (effAdrSz == Decode16Bits) op->index = R_DI; else if (effAdrSz == Decode32Bits) op->index = R_EDI; else op->index = R_RDI; + + di->usedRegistersMask |= _REGISTERTORCLASS[R_RDI]; /* Maps to RM_DI. */ break; /* Used for In/Out instructions varying forms. */ case OT_REGDX: /* Simple single IN/OUT instruction. */ - operands_set_tsi(op, O_REG, 16, R_DX); + operands_set_tsi(di, op, O_REG, 16, R_DX); break; - /* Used for INVLPGA instruction. */ + /* Used for INVLPGA instruction. */ case OT_REGECX: - operands_set_tsi(op, O_REG, 32, R_ECX); + operands_set_tsi(di, op, O_REG, 32, R_ECX); break; case OT_REGI_EBXAL: /* XLAT BYTE [rBX + AL] */ @@ -1209,7 +1286,7 @@ int operands_extract(_CodeInfo* ci, _DInst* di, _InstInfo* ii, prefixes_use_segment(INST_PRE_DS, ps, ci->dt, di); /* Size of deref is always 8 for xlat. */ - operands_set_tsi(op, O_MEM, 8, R_AL); + operands_set_tsi(di, op, O_MEM, 8, R_AL); if (effAdrSz == Decode16Bits) di->base = R_BX; else if (effAdrSz == Decode32Bits) di->base = R_EBX; @@ -1217,6 +1294,8 @@ int operands_extract(_CodeInfo* ci, _DInst* di, _InstInfo* ii, ps->usedPrefixes |= INST_PRE_REX; di->base = R_RBX; } + + di->usedRegistersMask |= _REGISTERTORCLASS[di->base]; break; case OT_REGI_EAX: /* @@ -1224,17 +1303,18 @@ int operands_extract(_CodeInfo* ci, _DInst* di, _InstInfo* ii, * Since this is a memory indirection, the default address size in 64bits decoding mode is 64. */ - if (effAdrSz == Decode64Bits) operands_set_tsi(op, O_SMEM, 64, R_RAX); + if (effAdrSz == Decode64Bits) operands_set_tsi(di, op, O_SMEM, 64, R_RAX); else if (effAdrSz == Decode32Bits) { ps->usedPrefixes |= INST_PRE_ADDR_SIZE; - operands_set_tsi(op, O_SMEM, 32, R_EAX); - } else { + operands_set_tsi(di, op, O_SMEM, 32, R_EAX); + } + else { ps->usedPrefixes |= INST_PRE_ADDR_SIZE; - operands_set_tsi(op, O_SMEM, 16, R_AX); + operands_set_tsi(di, op, O_SMEM, 16, R_AX); } break; case OT_VXMM: - operands_set_tsi(op, O_REG, 128, SSEREGS_BASE + vexV); + operands_set_tsi(di, op, O_REG, 128, SSEREGS_BASE + ps->vexV); break; case OT_XMM_IMM: ci->codeLen -= sizeof(int8_t); @@ -1242,14 +1322,14 @@ int operands_extract(_CodeInfo* ci, _DInst* di, _InstInfo* ii, if (ci->dt == Decode32Bits) reg = (*ci->code >> 4) & 0x7; else reg = (*ci->code >> 4) & 0xf; - operands_set_tsi(op, O_REG, 128, SSEREGS_BASE + reg); + operands_set_tsi(di, op, O_REG, 128, SSEREGS_BASE + reg); ci->code += sizeof(int8_t); break; case OT_YXMM: - if (vrex & PREFIX_EX_R) reg += EX_GPR_BASE; - if (ps->vrex & PREFIX_EX_L) operands_set_tsi(op, O_REG, 256, AVXREGS_BASE + reg); - else operands_set_tsi(op, O_REG, 128, SSEREGS_BASE + reg); + if (ps->vrex & PREFIX_EX_R) reg += EX_GPR_BASE; + if (ps->vrex & PREFIX_EX_L) operands_set_tsi(di, op, O_REG, 256, AVXREGS_BASE + reg); + else operands_set_tsi(di, op, O_REG, 128, SSEREGS_BASE + reg); break; case OT_YXMM_IMM: ci->codeLen -= sizeof(int8_t); @@ -1258,33 +1338,28 @@ int operands_extract(_CodeInfo* ci, _DInst* di, _InstInfo* ii, if (ci->dt == Decode32Bits) reg = (*ci->code >> 4) & 0x7; else reg = (*ci->code >> 4) & 0xf; - if (ps->vrex & PREFIX_EX_L) operands_set_tsi(op, O_REG, 256, AVXREGS_BASE + reg); - else operands_set_tsi(op, O_REG, 128, SSEREGS_BASE + reg); + if (ps->vrex & PREFIX_EX_L) operands_set_tsi(di, op, O_REG, 256, AVXREGS_BASE + reg); + else operands_set_tsi(di, op, O_REG, 128, SSEREGS_BASE + reg); ci->code += sizeof(int8_t); break; case OT_YMM: - if (vrex & PREFIX_EX_R) reg += EX_GPR_BASE; - operands_set_tsi(op, O_REG, 256, AVXREGS_BASE + reg); + if (ps->vrex & PREFIX_EX_R) reg += EX_GPR_BASE; + operands_set_tsi(di, op, O_REG, 256, AVXREGS_BASE + reg); break; case OT_VYMM: - operands_set_tsi(op, O_REG, 256, AVXREGS_BASE + vexV); + operands_set_tsi(di, op, O_REG, 256, AVXREGS_BASE + ps->vexV); break; case OT_VYXMM: - if (ps->vrex & PREFIX_EX_L) operands_set_tsi(op, O_REG, 256, AVXREGS_BASE + vexV); - else operands_set_tsi(op, O_REG, 128, SSEREGS_BASE + vexV); + if (ps->vrex & PREFIX_EX_L) operands_set_tsi(di, op, O_REG, 256, AVXREGS_BASE + ps->vexV); + else operands_set_tsi(di, op, O_REG, 128, SSEREGS_BASE + ps->vexV); break; case OT_WREG32_64: - if (vrex & PREFIX_EX_R) reg += EX_GPR_BASE; - if (ps->vrex & PREFIX_EX_W) operands_set_tsi(op, O_REG, 64, REGS64_BASE + reg); - else operands_set_tsi(op, O_REG, 32, REGS32_BASE + reg); + if (ps->vrex & PREFIX_EX_R) reg += EX_GPR_BASE; + if (ps->vrex & PREFIX_EX_W) operands_set_tsi(di, op, O_REG, 64, REGS64_BASE + reg); + else operands_set_tsi(di, op, O_REG, 32, REGS32_BASE + reg); break; default: return FALSE; } - - if ((op->type == O_REG) || (op->type == O_SMEM) || (op->type == O_MEM)) { - di->usedRegistersMask |= _REGISTERTORCLASS[op->index]; - } - return TRUE; } diff --git a/NativeCore/Dependencies/distorm/src/operands.h b/NativeCore/Dependencies/distorm/src/operands.h index 2d916474..c4e48224 100644 --- a/NativeCore/Dependencies/distorm/src/operands.h +++ b/NativeCore/Dependencies/distorm/src/operands.h @@ -4,7 +4,7 @@ operands.h diStorm3 - Powerful disassembler for X86/AMD64 http://ragestorm.net/distorm/ distorm at gmail dot com -Copyright (C) 2003-2018 Gil Dabah +Copyright (C) 2003-2021 Gil Dabah This library is licensed under the BSD license. See the file COPYING. */ @@ -17,12 +17,9 @@ This library is licensed under the BSD license. See the file COPYING. #include "prefix.h" #include "instructions.h" - -extern uint32_t _REGISTERTORCLASS[]; - int operands_extract(_CodeInfo* ci, _DInst* di, _InstInfo* ii, - _iflags instFlags, _OpType type, _OperandNumberType opNum, + _iflags instFlags, _OpType type, unsigned int modrm, _PrefixState* ps, _DecodeType effOpSz, - _DecodeType effAdrSz, int* lockableInstruction); + _DecodeType effAdrSz, _Operand* op); #endif /* OPERANDS_H */ diff --git a/NativeCore/Dependencies/distorm/src/prefix.c b/NativeCore/Dependencies/distorm/src/prefix.c index b1c26954..40b0ac2b 100644 --- a/NativeCore/Dependencies/distorm/src/prefix.c +++ b/NativeCore/Dependencies/distorm/src/prefix.c @@ -4,7 +4,7 @@ prefix.c diStorm3 - Powerful disassembler for X86/AMD64 http://ragestorm.net/distorm/ distorm at gmail dot com -Copyright (C) 2003-2018 Gil Dabah +Copyright (C) 2003-2021 Gil Dabah This library is licensed under the BSD license. See the file COPYING. */ @@ -22,53 +22,43 @@ This library is licensed under the BSD license. See the file COPYING. * That's why I have to detect such cases and drop those excess prefixes. */ -int prefixes_is_valid(unsigned int ch, _DecodeType dt) -{ - switch (ch) { - /* for i in xrange(0x40, 0x50): print "case 0x%2x:" % i */ - case 0x40: /* REX: */ - case 0x41: - case 0x42: - case 0x43: - case 0x44: - case 0x45: - case 0x46: - case 0x47: - case 0x48: - case 0x49: - case 0x4a: - case 0x4b: - case 0x4c: - case 0x4d: - case 0x4e: - case 0x4f: return (dt == Decode64Bits); - case PREFIX_LOCK: return TRUE; - case PREFIX_REPNZ: return TRUE; - case PREFIX_REP: return TRUE; - case PREFIX_CS: return TRUE; - case PREFIX_SS: return TRUE; - case PREFIX_DS: return TRUE; - case PREFIX_ES: return TRUE; - case PREFIX_FS: return TRUE; - case PREFIX_GS: return TRUE; - case PREFIX_OP_SIZE: return TRUE; - case PREFIX_ADDR_SIZE: return TRUE; - /* The VEXs might be false positives, the decode_perfixes will determine for sure. */ - case PREFIX_VEX2b: /* VEX is supported for all modes, because 16 bits Pmode is included. */ - case PREFIX_VEX3b: return TRUE; - } - return FALSE; -} -/* Ignore a specific prefix type. */ -void prefixes_ignore(_PrefixState* ps, _PrefixIndexer pi) -{ - /* - * If that type of prefix appeared already, set the bit of that *former* prefix. - * Anyway, set the new index of that prefix type to the current index, so next time we know its position. - */ - if (ps->pfxIndexer[pi] != PFXIDX_NONE) ps->unusedPrefixesMask |= (1 << ps->pfxIndexer[pi]); -} +int PrefixTables[256 * 2] = { + /* Decode 16/32 Bits */ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, /* ES (0x26) CS (0x2e) */ + 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, /* DS (0x3e) SS (0x36) */ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, /* FS(0x64) GS(0x65) OP_SIZE(0x66) ADDR_SIZE(0x67) */ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* VEX2b (0xc5) VEX3b (0xc4) */ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* LOCK (0xf0) REPNZ (0xf2) REP (0xf3) */ + /* Decode64Bits */ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, + 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* REX: 0x40 - 0x4f */ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 +}; /* Ignore all prefix. */ void prefixes_ignore_all(_PrefixState* ps) @@ -93,6 +83,7 @@ uint16_t prefixes_set_unused_mask(_PrefixState* ps) * So now we know which bits we need to set exactly in the mask. */ _iflags unusedPrefixesDiff = ps->decodedPrefixes ^ ps->usedPrefixes; + uint16_t unusedPrefixesMask = ps->unusedPrefixesMask; /* Examine unused prefixes by type: */ /* @@ -102,14 +93,16 @@ uint16_t prefixes_set_unused_mask(_PrefixState* ps) * It's not a big problem, because the prefixes_ignore func will ignore it anyway, * since it wasn't seen earlier. But it's important to know this. */ - if (unusedPrefixesDiff & INST_PRE_REX) prefixes_ignore(ps, PFXIDX_REX); - if (unusedPrefixesDiff & INST_PRE_SEGOVRD_MASK) prefixes_ignore(ps, PFXIDX_SEG); - if (unusedPrefixesDiff & INST_PRE_LOKREP_MASK) prefixes_ignore(ps, PFXIDX_LOREP); - if (unusedPrefixesDiff & INST_PRE_OP_SIZE) prefixes_ignore(ps, PFXIDX_OP_SIZE); - if (unusedPrefixesDiff & INST_PRE_ADDR_SIZE) prefixes_ignore(ps, PFXIDX_ADRS); - /* If a VEX instruction was found, its prefix is considered as used, therefore no point for checking for it. */ - - return ps->unusedPrefixesMask; + if (unusedPrefixesDiff) { + if (unusedPrefixesDiff & INST_PRE_REX) unusedPrefixesMask |= ps->pfxIndexer[PFXIDX_REX]; + if (unusedPrefixesDiff & INST_PRE_SEGOVRD_MASK) unusedPrefixesMask |= ps->pfxIndexer[PFXIDX_SEG]; + if (unusedPrefixesDiff & INST_PRE_LOKREP_MASK) unusedPrefixesMask |= ps->pfxIndexer[PFXIDX_LOREP]; + if (unusedPrefixesDiff & INST_PRE_OP_SIZE) unusedPrefixesMask |= ps->pfxIndexer[PFXIDX_OP_SIZE]; + if (unusedPrefixesDiff & INST_PRE_ADDR_SIZE) unusedPrefixesMask |= ps->pfxIndexer[PFXIDX_ADRS]; + /* If a VEX instruction was found, its prefix is considered as used, therefore no point for checking for it. */ + } + + return unusedPrefixesMask; } /* @@ -118,9 +111,10 @@ uint16_t prefixes_set_unused_mask(_PrefixState* ps) */ _INLINE_ void prefixes_track_unused(_PrefixState* ps, int index, _PrefixIndexer pi) { + /* Mark the previously used prefix (if exists) in the unused mask. */ prefixes_ignore(ps, pi); /* Book-keep the current index for this type. */ - ps->pfxIndexer[pi] = index; + ps->pfxIndexer[pi] = 1 << index; } /* @@ -129,11 +123,12 @@ _INLINE_ void prefixes_track_unused(_PrefixState* ps, int index, _PrefixIndexer * The tiny complexity is that we want to know when a prefix was superfluous and mark any copy of it as unused. * Note that the last prefix of its type will be considered as used, and all the others (of same type) before it as unused. */ -void prefixes_decode(const uint8_t* code, int codeLen, _PrefixState* ps, _DecodeType dt) +void prefixes_decode(_CodeInfo* ci, _PrefixState* ps) { - int index, done; - uint8_t vex; - + const uint8_t* rexPos = NULL; + const uint8_t* start = ci->code; + uint8_t byte, vex; + unsigned int index; /* * First thing to do, scan for prefixes, there are six types of prefixes. * There may be up to six prefixes before a single instruction, not the same type, no special order, @@ -145,9 +140,9 @@ void prefixes_decode(const uint8_t* code, int codeLen, _PrefixState* ps, _Decode * We attach all prefixes to the next instruction, there might be two or more occurrences from the same prefix. * Also, since VEX can be allowed only once we will test it separately. */ - for (index = 0, done = FALSE; - (codeLen > 0) && (code - ps->start < INST_MAXIMUM_SIZE); - code++, codeLen--, index++) { + for (index = 0; + (ci->codeLen > 0) && (index < INST_MAXIMUM_SIZE); + ci->code++, ci->codeLen--, index++) { /* NOTE: AMD treat lock/rep as two different groups... But I am based on Intel. @@ -175,102 +170,90 @@ void prefixes_decode(const uint8_t* code, int codeLen, _PrefixState* ps, _Decode */ /* Examine what type of prefix we got. */ - switch (*code) + byte = *ci->code; + switch (byte) { - /* REX type, 64 bits decoding mode only: */ - case 0x40: - case 0x41: - case 0x42: - case 0x43: - case 0x44: - case 0x45: - case 0x46: - case 0x47: - case 0x48: - case 0x49: - case 0x4a: - case 0x4b: - case 0x4c: - case 0x4d: - case 0x4e: - case 0x4f: - if (dt == Decode64Bits) { - ps->decodedPrefixes |= INST_PRE_REX; - ps->vrex = *code & 0xf; /* Keep only BXRW. */ - ps->rexPos = code; - ps->prefixExtType = PET_REX; - prefixes_track_unused(ps, index, PFXIDX_REX); - } else done = TRUE; /* If we are not in 64 bits mode, it's an instruction, then halt. */ - break; - + case PREFIX_OP_SIZE: {/* Op Size type: */ + ps->decodedPrefixes |= INST_PRE_OP_SIZE; + prefixes_track_unused(ps, index, PFXIDX_OP_SIZE); + } break; + /* Look for both common arch prefixes. */ + case PREFIX_LOCK: { /* LOCK and REPx type: */ - case PREFIX_LOCK: - ps->decodedPrefixes |= INST_PRE_LOCK; - prefixes_track_unused(ps, index, PFXIDX_LOREP); - break; - case PREFIX_REPNZ: - ps->decodedPrefixes |= INST_PRE_REPNZ; - prefixes_track_unused(ps, index, PFXIDX_LOREP); - break; - case PREFIX_REP: - ps->decodedPrefixes |= INST_PRE_REP; - prefixes_track_unused(ps, index, PFXIDX_LOREP); - break; - + ps->decodedPrefixes |= INST_PRE_LOCK; + prefixes_track_unused(ps, index, PFXIDX_LOREP); + } break; + case PREFIX_REPNZ: { + ps->decodedPrefixes |= INST_PRE_REPNZ; + prefixes_track_unused(ps, index, PFXIDX_LOREP); + } break; + case PREFIX_REP: { + ps->decodedPrefixes |= INST_PRE_REP; + prefixes_track_unused(ps, index, PFXIDX_LOREP); + } break; + case PREFIX_CS: { /* Seg Overide type: */ - case PREFIX_CS: - ps->decodedPrefixes |= INST_PRE_CS; - prefixes_track_unused(ps, index, PFXIDX_SEG); - break; - case PREFIX_SS: - ps->decodedPrefixes |= INST_PRE_SS; - prefixes_track_unused(ps, index, PFXIDX_SEG); - break; - case PREFIX_DS: - ps->decodedPrefixes |= INST_PRE_DS; - prefixes_track_unused(ps, index, PFXIDX_SEG); - break; - case PREFIX_ES: - ps->decodedPrefixes |= INST_PRE_ES; - prefixes_track_unused(ps, index, PFXIDX_SEG); - break; - case PREFIX_FS: - ps->decodedPrefixes |= INST_PRE_FS; - prefixes_track_unused(ps, index, PFXIDX_SEG); - break; - case PREFIX_GS: - ps->decodedPrefixes |= INST_PRE_GS; - prefixes_track_unused(ps, index, PFXIDX_SEG); - break; - - /* Op Size type: */ - case PREFIX_OP_SIZE: - ps->decodedPrefixes |= INST_PRE_OP_SIZE; - prefixes_track_unused(ps, index, PFXIDX_OP_SIZE); - break; - + ps->decodedPrefixes &= ~INST_PRE_SEGOVRD_MASK; + ps->decodedPrefixes |= INST_PRE_CS; + prefixes_track_unused(ps, index, PFXIDX_SEG); + } break; + case PREFIX_SS: { + ps->decodedPrefixes &= ~INST_PRE_SEGOVRD_MASK; + ps->decodedPrefixes |= INST_PRE_SS; + prefixes_track_unused(ps, index, PFXIDX_SEG); + } break; + case PREFIX_DS: { + ps->decodedPrefixes &= ~INST_PRE_SEGOVRD_MASK; + ps->decodedPrefixes |= INST_PRE_DS; + prefixes_track_unused(ps, index, PFXIDX_SEG); + } break; + case PREFIX_ES: { + ps->decodedPrefixes &= ~INST_PRE_SEGOVRD_MASK; + ps->decodedPrefixes |= INST_PRE_ES; + prefixes_track_unused(ps, index, PFXIDX_SEG); + } break; + case PREFIX_FS: { + ps->decodedPrefixes &= ~INST_PRE_SEGOVRD_MASK; + ps->decodedPrefixes |= INST_PRE_FS; + prefixes_track_unused(ps, index, PFXIDX_SEG); + } break; + case PREFIX_GS: { + ps->decodedPrefixes &= ~INST_PRE_SEGOVRD_MASK; + ps->decodedPrefixes |= INST_PRE_GS; + prefixes_track_unused(ps, index, PFXIDX_SEG); + } break; + case PREFIX_ADDR_SIZE: { /* Addr Size type: */ - case PREFIX_ADDR_SIZE: - ps->decodedPrefixes |= INST_PRE_ADDR_SIZE; - prefixes_track_unused(ps, index, PFXIDX_ADRS); - break; - - /* Non-prefix byte now, so break 2. */ - default: done = TRUE; break; + ps->decodedPrefixes |= INST_PRE_ADDR_SIZE; + prefixes_track_unused(ps, index, PFXIDX_ADRS); + } break; + default: + if (ci->dt == Decode64Bits) { + /* REX type, 64 bits decoding mode only: */ + if ((byte & 0xf0) == 0x40) { + ps->decodedPrefixes |= INST_PRE_REX; + rexPos = ci->code; + ps->vrex = byte & 0xf; /* Keep only BXRW. */ + ps->prefixExtType = PET_REX; + prefixes_track_unused(ps, index, PFXIDX_REX); + continue; + } + } + goto _Break2; } - if (done) break; } +_Break2: /* 2 Bytes VEX: */ - if ((codeLen >= 2) && - (*code == PREFIX_VEX2b) && - ((code - ps->start) <= INST_MAXIMUM_SIZE - 2)) { + if ((ci->codeLen >= 2) && + (*ci->code == PREFIX_VEX2b) && + ((ci->code - start) <= INST_MAXIMUM_SIZE - 2)) { /* * In 32 bits the second byte has to be in the special range of Mod=11. * Otherwise it might be a normal LDS instruction. */ - if ((dt == Decode64Bits) || (*(code + 1) >= INST_DIVIDED_MODRM)) { - ps->vexPos = code + 1; + if ((ci->dt == Decode64Bits) || (*(ci->code + 1) >= INST_DIVIDED_MODRM)) { + ps->vexPos = ci->code + 1; ps->decodedPrefixes |= INST_PRE_VEX; ps->prefixExtType = PET_VEX2BYTES; @@ -283,25 +266,26 @@ void prefixes_decode(const uint8_t* code, int codeLen, _PrefixState* ps, _Decode /* -- Convert from VEX prefix to VREX flags -- */ vex = *ps->vexPos; - if (~vex & 0x80 && dt == Decode64Bits) ps->vrex |= PREFIX_EX_R; /* Convert VEX.R. */ + if (!(vex & 0x80) && (ci->dt == Decode64Bits)) ps->vrex |= PREFIX_EX_R; /* Convert VEX.R. */ if (vex & 4) ps->vrex |= PREFIX_EX_L; /* Convert VEX.L. */ - code += 2; + ci->code += 2; + ci->codeLen -= 2; } } /* 3 Bytes VEX: */ - if ((codeLen >= 3) && - (*code == PREFIX_VEX3b) && - ((code - ps->start) <= INST_MAXIMUM_SIZE - 3) && - (~ps->decodedPrefixes & INST_PRE_VEX)) { + if ((ci->codeLen >= 3) && + (*ci->code == PREFIX_VEX3b) && + ((ci->code - start) <= INST_MAXIMUM_SIZE - 3) && + (!(ps->decodedPrefixes & INST_PRE_VEX))) { /* * In 32 bits the second byte has to be in the special range of Mod=11. * Otherwise it might be a normal LES instruction. * And we don't care now about the 3rd byte. */ - if ((dt == Decode64Bits) || (*(code + 1) >= INST_DIVIDED_MODRM)) { - ps->vexPos = code + 1; + if ((ci->dt == Decode64Bits) || (*(ci->code + 1) >= INST_DIVIDED_MODRM)) { + ps->vexPos = ci->code + 1; ps->decodedPrefixes |= INST_PRE_VEX; ps->prefixExtType = PET_VEX3BYTES; @@ -320,49 +304,78 @@ void prefixes_decode(const uint8_t* code, int codeLen, _PrefixState* ps, _Decode if (vex & 0x80) ps->vrex |= PREFIX_EX_W; /* Convert VEX.W. */ /* Clear some flags if the mode isn't 64 bits. */ - if (dt != Decode64Bits) ps->vrex &= ~(PREFIX_EX_B | PREFIX_EX_X | PREFIX_EX_R | PREFIX_EX_W); + if (ci->dt != Decode64Bits) ps->vrex &= ~(PREFIX_EX_B | PREFIX_EX_X | PREFIX_EX_R | PREFIX_EX_W); - code += 3; + ci->code += 3; + ci->codeLen -= 3; } } - /* - * Save last byte scanned address, so the decoder could keep on scanning from this point and on and on and on. - * In addition the decoder is able to know that the last byte could lead to MMX/SSE instructions (preceding REX if exists). - */ - ps->last = code; /* ps->last points to an opcode byte. */ + if (ci->dt == Decode64Bits) { + if (ps->decodedPrefixes & INST_PRE_REX) { + /* REX prefix must precede first byte of instruction. */ + if (rexPos != (ci->code - 1)) { + ps->decodedPrefixes &= ~INST_PRE_REX; + if (ps->prefixExtType == PET_REX) ps->prefixExtType = PET_NONE; /* It might be a VEX by now, keep it that way. */ + prefixes_ignore(ps, PFXIDX_REX); + } + /* + * We will disable operand size prefix, + * if it exists only after decoding the instruction, since it might be a mandatory prefix. + * This will be done after calling inst_lookup in decode_inst. + */ + } + /* In 64 bits, segment overrides of CS, DS, ES and SS are ignored. So don't take'em into account. */ + if (ps->decodedPrefixes & INST_PRE_SEGOVRD_MASK32) { + ps->decodedPrefixes &= ~INST_PRE_SEGOVRD_MASK32; + prefixes_ignore(ps, PFXIDX_SEG); + } + } + + /* Store number of prefixes scanned. */ + ps->count = (uint8_t)(ci->code - start); } /* - * For every memory-indirection operand we want to set its corresponding default segment. - * If the segment is being overrided, we need to see whether we use it or not. - * We will use it only if it's not the default one already. + * For every memory-indirection operand we want to set a used segment. + * If the segment is being overrided with a prefix, we will need to check if it's a default. + * Defaults don't use their prefix, e.g "mov [rsp]" can ignore a given SS: prefix, + * but still set the used segment as SS. + * This function is called only with SS and DS as defaults. + * If there's a segment prefix used, it will override the default one. + * And If the prefix is a default seg in 64 bits, it will be ignored. */ void prefixes_use_segment(_iflags defaultSeg, _PrefixState* ps, _DecodeType dt, _DInst* di) { - _iflags flags = 0; - if (dt == Decode64Bits) flags = ps->decodedPrefixes & INST_PRE_SEGOVRD_MASK64; - else flags = ps->decodedPrefixes & INST_PRE_SEGOVRD_MASK; - - if ((flags == 0) || (flags == defaultSeg)) { - flags = defaultSeg; - di->segment |= SEGMENT_DEFAULT; - } else if (flags != defaultSeg) { - /* Use it only if it's non-default segment. */ - ps->usedPrefixes |= flags; - } + /* Extract given segment prefix from the decoded prefixes. */ + _iflags flags; - /* ASSERT: R_XX must be below 128. */ - switch (flags) - { - case INST_PRE_ES: di->segment |= R_ES; break; - case INST_PRE_CS: di->segment |= R_CS; break; - case INST_PRE_SS: di->segment |= R_SS; break; - case INST_PRE_DS: di->segment |= R_DS; break; - case INST_PRE_FS: di->segment |= R_FS; break; - case INST_PRE_GS: di->segment |= R_GS; break; + if (dt == Decode64Bits) { + if (ps->decodedPrefixes & INST_PRE_SEGOVRD_MASK64) { /* Either GS or FS. */ + di->segment = ps->decodedPrefixes & INST_PRE_GS ? R_GS : R_FS; + } + + return; } - /* If it's one of the CS,SS,DS,ES and the mode is 64 bits, set segment it to none, since it's ignored. */ - if ((dt == Decode64Bits) && (flags & INST_PRE_SEGOVRD_MASK32)) di->segment = R_NONE; + flags = ps->decodedPrefixes & INST_PRE_SEGOVRD_MASK; + + /* Use the given prefix only if it's not the default. */ + if (flags && (flags != defaultSeg)) { + ps->usedPrefixes |= flags; + + switch (flags >> 7) /* INST_PRE_CS is 1 << 7. And the rest of the prefixes follow as bit fields. */ + { + case 1: di->segment = R_CS; break; + case 2: di->segment = R_SS; break; + case 4: di->segment = R_DS; break; + case 8: di->segment = R_ES; break; + case 0x10: di->segment = R_FS; break; + case 0x20: di->segment = R_GS; break; + } + } + else { + if (defaultSeg == INST_PRE_SS) di->segment = SEGMENT_DEFAULT | R_SS; + else di->segment = SEGMENT_DEFAULT | R_DS; + } } diff --git a/NativeCore/Dependencies/distorm/src/prefix.h b/NativeCore/Dependencies/distorm/src/prefix.h index f205e697..bc9b6e7d 100644 --- a/NativeCore/Dependencies/distorm/src/prefix.h +++ b/NativeCore/Dependencies/distorm/src/prefix.h @@ -4,7 +4,7 @@ prefix.h diStorm3 - Powerful disassembler for X86/AMD64 http://ragestorm.net/distorm/ distorm at gmail dot com -Copyright (C) 2003-2018 Gil Dabah +Copyright (C) 2003-2021 Gil Dabah This library is licensed under the BSD license. See the file COPYING. */ @@ -31,20 +31,19 @@ typedef enum {PFXIDX_NONE = -1, PFXIDX_REX, PFXIDX_LOREP, PFXIDX_SEG, PFXIDX_OP_ */ typedef struct { _iflags decodedPrefixes, usedPrefixes; - const uint8_t *start, *last, *vexPos, *rexPos; - _PrefixExtType prefixExtType; + /* Number of prefixes scanned for current instruction, including VEX! */ + unsigned int count; uint16_t unusedPrefixesMask; + /* Holds the offset to the prefix byte by its type. */ + uint16_t pfxIndexer[PFXIDX_MAX]; + _PrefixExtType prefixExtType; /* Indicates whether the operand size prefix (0x66) was used as a mandatory prefix. */ int isOpSizeMandatory; /* If VEX prefix is used, store the VEX.vvvv field. */ unsigned int vexV; /* The fields B/X/R/W/L of REX and VEX are stored together in this byte. */ unsigned int vrex; - - /* !! Make sure pfxIndexer is LAST! Otherwise memset won't work well with it. !! */ - - /* Holds the offset to the prefix byte by its type. */ - int pfxIndexer[PFXIDX_MAX]; + const uint8_t* vexPos; } _PrefixState; /* @@ -54,11 +53,27 @@ typedef struct { */ #define MAX_PREFIXES (5) -int prefixes_is_valid(unsigned int ch, _DecodeType dt); -void prefixes_ignore(_PrefixState* ps, _PrefixIndexer pi); +extern int PrefixTables[256 * 2]; + +_INLINE_ int prefixes_is_valid(unsigned char ch, _DecodeType dt) +{ + /* The predicate selects (branchlessly) second half table for 64 bits otherwise selects first half. */ + return PrefixTables[ch + ((dt >> 1) << 8)]; +} + +/* Ignore a specific prefix type. */ +_INLINE_ void prefixes_ignore(_PrefixState* ps, _PrefixIndexer pi) +{ + /* + * If that type of prefix appeared already, set the bit of that *former* prefix. + * Anyway, set the new index of that prefix type to the current index, so next time we know its position. + */ + ps->unusedPrefixesMask |= ps->pfxIndexer[pi]; +} + void prefixes_ignore_all(_PrefixState* ps); uint16_t prefixes_set_unused_mask(_PrefixState* ps); -void prefixes_decode(const uint8_t* code, int codeLen, _PrefixState* ps, _DecodeType dt); +void prefixes_decode(_CodeInfo* ci, _PrefixState* ps); void prefixes_use_segment(_iflags defaultSeg, _PrefixState* ps, _DecodeType dt, _DInst* di); #endif /* PREFIX_H */ diff --git a/NativeCore/Dependencies/distorm/src/textdefs.c b/NativeCore/Dependencies/distorm/src/textdefs.c index 48419d91..cf56a8f6 100644 --- a/NativeCore/Dependencies/distorm/src/textdefs.c +++ b/NativeCore/Dependencies/distorm/src/textdefs.c @@ -4,7 +4,7 @@ textdefs.c diStorm3 - Powerful disassembler for X86/AMD64 http://ragestorm.net/distorm/ distorm at gmail dot com -Copyright (C) 2003-2018 Gil Dabah +Copyright (C) 2003-2021 Gil Dabah This library is licensed under the BSD license. See the file COPYING. */ @@ -13,116 +13,84 @@ This library is licensed under the BSD license. See the file COPYING. #ifndef DISTORM_LIGHT -static uint8_t Nibble2ChrTable[16] = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F'}; +static uint8_t Nibble2ChrTable[16] = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'}; #define NIBBLE_TO_CHR Nibble2ChrTable[t] -void _FASTCALL_ str_hex_b(_WString* s, unsigned int x) +void str_hex(_WString* s, const uint8_t* buf, unsigned int len) { - /* - * def prebuilt(): - * s = "" - * for i in xrange(256): - * if ((i % 0x10) == 0): - * s += "\r\n" - * s += "\"%02X\", " % (i) - * return s - */ - static int8_t TextBTable[256][3] = { - "00", "01", "02", "03", "04", "05", "06", "07", "08", "09", "0A", "0B", "0C", "0D", "0E", "0F", - "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "1A", "1B", "1C", "1D", "1E", "1F", - "20", "21", "22", "23", "24", "25", "26", "27", "28", "29", "2A", "2B", "2C", "2D", "2E", "2F", - "30", "31", "32", "33", "34", "35", "36", "37", "38", "39", "3A", "3B", "3C", "3D", "3E", "3F", - "40", "41", "42", "43", "44", "45", "46", "47", "48", "49", "4A", "4B", "4C", "4D", "4E", "4F", - "50", "51", "52", "53", "54", "55", "56", "57", "58", "59", "5A", "5B", "5C", "5D", "5E", "5F", - "60", "61", "62", "63", "64", "65", "66", "67", "68", "69", "6A", "6B", "6C", "6D", "6E", "6F", - "70", "71", "72", "73", "74", "75", "76", "77", "78", "79", "7A", "7B", "7C", "7D", "7E", "7F", - "80", "81", "82", "83", "84", "85", "86", "87", "88", "89", "8A", "8B", "8C", "8D", "8E", "8F", - "90", "91", "92", "93", "94", "95", "96", "97", "98", "99", "9A", "9B", "9C", "9D", "9E", "9F", - "A0", "A1", "A2", "A3", "A4", "A5", "A6", "A7", "A8", "A9", "AA", "AB", "AC", "AD", "AE", "AF", - "B0", "B1", "B2", "B3", "B4", "B5", "B6", "B7", "B8", "B9", "BA", "BB", "BC", "BD", "BE", "BF", - "C0", "C1", "C2", "C3", "C4", "C5", "C6", "C7", "C8", "C9", "CA", "CB", "CC", "CD", "CE", "CF", - "D0", "D1", "D2", "D3", "D4", "D5", "D6", "D7", "D8", "D9", "DA", "DB", "DC", "DD", "DE", "DF", - "E0", "E1", "E2", "E3", "E4", "E5", "E6", "E7", "E8", "E9", "EA", "EB", "EC", "ED", "EE", "EF", - "F0", "F1", "F2", "F3", "F4", "F5", "F6", "F7", "F8", "F9", "FA", "FB", "FC", "FD", "FE", "FF" - }; - - /* - * Fixed length of 3 including null terminate character. - */ - memcpy(&s->p[s->length], TextBTable[x & 255], 3); - s->length += 2; + /* 256 * 2 : 2 chars per byte value. */ + static const char* TextBTable = + "000102030405060708090a0b0c0d0e0f" \ + "101112131415161718191a1b1c1d1e1f" \ + "202122232425262728292a2b2c2d2e2f" \ + "303132333435363738393a3b3c3d3e3f" \ + "404142434445464748494a4b4c4d4e4f" \ + "505152535455565758595a5b5c5d5e5f" \ + "606162636465666768696a6b6c6d6e6f" \ + "707172737475767778797a7b7c7d7e7f" \ + "808182838485868788898a8b8c8d8e8f" \ + "909192939495969798999a9b9c9d9e9f" \ + "a0a1a2a3a4a5a6a7a8a9aaabacadaeaf" \ + "b0b1b2b3b4b5b6b7b8b9babbbcbdbebf" \ + "c0c1c2c3c4c5c6c7c8c9cacbcccdcecf" \ + "d0d1d2d3d4d5d6d7d8d9dadbdcdddedf" \ + "e0e1e2e3e4e5e6e7e8e9eaebecedeeef" \ + "f0f1f2f3f4f5f6f7f8f9fafbfcfdfeff"; + + unsigned int i = 0; + /* Length is at least 1, enter loop. */ + s->length = len * 2; + s->p[len * 2] = 0; + do { + RSHORT(&s->p[i]) = RSHORT(&TextBTable[(*buf) * 2]); + buf++; + i += 2; + } while (i < len * 2); } -void _FASTCALL_ str_code_hb(_WString* s, unsigned int x) -{ - static int8_t TextHBTable[256][5] = { - /* - * def prebuilt(): - * s = "" - * for i in xrange(256): - * if ((i % 0x10) == 0): - * s += "\r\n" - * s += "\"0x%X\", " % (i) - * return s - */ - "0x0", "0x1", "0x2", "0x3", "0x4", "0x5", "0x6", "0x7", "0x8", "0x9", "0xA", "0xB", "0xC", "0xD", "0xE", "0xF", - "0x10", "0x11", "0x12", "0x13", "0x14", "0x15", "0x16", "0x17", "0x18", "0x19", "0x1A", "0x1B", "0x1C", "0x1D", "0x1E", "0x1F", - "0x20", "0x21", "0x22", "0x23", "0x24", "0x25", "0x26", "0x27", "0x28", "0x29", "0x2A", "0x2B", "0x2C", "0x2D", "0x2E", "0x2F", - "0x30", "0x31", "0x32", "0x33", "0x34", "0x35", "0x36", "0x37", "0x38", "0x39", "0x3A", "0x3B", "0x3C", "0x3D", "0x3E", "0x3F", - "0x40", "0x41", "0x42", "0x43", "0x44", "0x45", "0x46", "0x47", "0x48", "0x49", "0x4A", "0x4B", "0x4C", "0x4D", "0x4E", "0x4F", - "0x50", "0x51", "0x52", "0x53", "0x54", "0x55", "0x56", "0x57", "0x58", "0x59", "0x5A", "0x5B", "0x5C", "0x5D", "0x5E", "0x5F", - "0x60", "0x61", "0x62", "0x63", "0x64", "0x65", "0x66", "0x67", "0x68", "0x69", "0x6A", "0x6B", "0x6C", "0x6D", "0x6E", "0x6F", - "0x70", "0x71", "0x72", "0x73", "0x74", "0x75", "0x76", "0x77", "0x78", "0x79", "0x7A", "0x7B", "0x7C", "0x7D", "0x7E", "0x7F", - "0x80", "0x81", "0x82", "0x83", "0x84", "0x85", "0x86", "0x87", "0x88", "0x89", "0x8A", "0x8B", "0x8C", "0x8D", "0x8E", "0x8F", - "0x90", "0x91", "0x92", "0x93", "0x94", "0x95", "0x96", "0x97", "0x98", "0x99", "0x9A", "0x9B", "0x9C", "0x9D", "0x9E", "0x9F", - "0xA0", "0xA1", "0xA2", "0xA3", "0xA4", "0xA5", "0xA6", "0xA7", "0xA8", "0xA9", "0xAA", "0xAB", "0xAC", "0xAD", "0xAE", "0xAF", - "0xB0", "0xB1", "0xB2", "0xB3", "0xB4", "0xB5", "0xB6", "0xB7", "0xB8", "0xB9", "0xBA", "0xBB", "0xBC", "0xBD", "0xBE", "0xBF", - "0xC0", "0xC1", "0xC2", "0xC3", "0xC4", "0xC5", "0xC6", "0xC7", "0xC8", "0xC9", "0xCA", "0xCB", "0xCC", "0xCD", "0xCE", "0xCF", - "0xD0", "0xD1", "0xD2", "0xD3", "0xD4", "0xD5", "0xD6", "0xD7", "0xD8", "0xD9", "0xDA", "0xDB", "0xDC", "0xDD", "0xDE", "0xDF", - "0xE0", "0xE1", "0xE2", "0xE3", "0xE4", "0xE5", "0xE6", "0xE7", "0xE8", "0xE9", "0xEA", "0xEB", "0xEC", "0xED", "0xEE", "0xEF", - "0xF0", "0xF1", "0xF2", "0xF3", "0xF4", "0xF5", "0xF6", "0xF7", "0xF8", "0xF9", "0xFA", "0xFB", "0xFC", "0xFD", "0xFE", "0xFF" - }; - - if (x < 0x10) { /* < 0x10 has a fixed length of 4 including null terminate. */ - memcpy(&s->p[s->length], TextHBTable[x & 255], 4); - s->length += 3; - } else { /* >= 0x10 has a fixed length of 5 including null terminate. */ - memcpy(&s->p[s->length], TextHBTable[x & 255], 5); - s->length += 4; - } -} +#ifdef SUPPORT_64BIT_OFFSET -void _FASTCALL_ str_code_hdw(_WString* s, uint32_t x) +void str_int_impl(unsigned char** s, uint64_t x) { int8_t* buf; - int i = 0, shift = 0; - unsigned int t = 0; + int shift = 0; + OFFSET_INTEGER t = x; - buf = (int8_t*)&s->p[s->length]; + buf = (int8_t*)*s; - buf[0] = '0'; - buf[1] = 'x'; - buf += 2; + *buf++ = '0'; + *buf++ = 'x'; - for (shift = 28; shift != 0; shift -= 4) { - t = (x >> shift) & 0xf; - if (i | t) buf[i++] = NIBBLE_TO_CHR; + if (x == 0) { + *buf = '0'; + *s += 3; + return; } - t = x & 0xf; - buf[i++] = NIBBLE_TO_CHR; - s->length += i + 2; - buf[i] = '\0'; + do { + t >>= 4; + shift += 4; + } while (t); + + do { + shift -= 4; + t = (x >> shift) & 0xf; + *buf++ = NIBBLE_TO_CHR; + } while (shift > 0); + + *s = (unsigned char*)buf; } -void _FASTCALL_ str_code_hqw(_WString* s, uint8_t src[8]) +#else + +void str_int_impl(unsigned char** s, uint8_t src[8]) { int8_t* buf; int i = 0, shift = 0; uint32_t x = RULONG(&src[sizeof(int32_t)]); int t; - buf = (int8_t*)&s->p[s->length]; + buf = (int8_t*)*s; buf[0] = '0'; buf[1] = 'x'; buf += 2; @@ -140,33 +108,9 @@ void _FASTCALL_ str_code_hqw(_WString* s, uint8_t src[8]) t = x & 0xf; buf[i++] = NIBBLE_TO_CHR; - s->length += i + 2; - buf[i] = '\0'; + *s += (size_t)(i + 2); } -#ifdef SUPPORT_64BIT_OFFSET -void _FASTCALL_ str_off64(_WString* s, OFFSET_INTEGER x) -{ - int8_t* buf; - int i = 0, shift = 0; - OFFSET_INTEGER t = 0; - - buf = (int8_t*)&s->p[s->length]; - - buf[0] = '0'; - buf[1] = 'x'; - buf += 2; - - for (shift = 60; shift != 0; shift -= 4) { - t = (x >> shift) & 0xf; - if (i | t) buf[i++] = NIBBLE_TO_CHR; - } - t = x & 0xf; - buf[i++] = NIBBLE_TO_CHR; - - s->length += i + 2; - buf[i] = '\0'; -} #endif /* SUPPORT_64BIT_OFFSET */ #endif /* DISTORM_LIGHT */ diff --git a/NativeCore/Dependencies/distorm/src/textdefs.h b/NativeCore/Dependencies/distorm/src/textdefs.h index a923626f..27170bb3 100644 --- a/NativeCore/Dependencies/distorm/src/textdefs.h +++ b/NativeCore/Dependencies/distorm/src/textdefs.h @@ -4,7 +4,7 @@ textdefs.h diStorm3 - Powerful disassembler for X86/AMD64 http://ragestorm.net/distorm/ distorm at gmail dot com -Copyright (C) 2003-2018 Gil Dabah +Copyright (C) 2003-2021 Gil Dabah This library is licensed under the BSD license. See the file COPYING. */ @@ -43,13 +43,14 @@ Naming Convention: * all numbers are in HEX. */ -void _FASTCALL_ str_hex_b(_WString* s, unsigned int x); -void _FASTCALL_ str_code_hb(_WString* s, unsigned int x); -void _FASTCALL_ str_code_hdw(_WString* s, uint32_t x); -void _FASTCALL_ str_code_hqw(_WString* s, uint8_t src[8]); +void str_hex(_WString* s, const uint8_t* buf, unsigned int len); #ifdef SUPPORT_64BIT_OFFSET -void _FASTCALL_ str_off64(_WString* s, OFFSET_INTEGER x); +#define str_int(s, x) str_int_impl((s), (x)) +void str_int_impl(unsigned char** s, uint64_t x); +#else +#define str_int(s, x) str_int_impl((s), (uint8_t*)&(x)) +void str_int_impl(unsigned char** s, uint8_t src[8]); #endif #endif /* DISTORM_LIGHT */ diff --git a/NativeCore/Dependencies/distorm/src/wstring.h b/NativeCore/Dependencies/distorm/src/wstring.h index 6b3a2a3f..6303f90d 100644 --- a/NativeCore/Dependencies/distorm/src/wstring.h +++ b/NativeCore/Dependencies/distorm/src/wstring.h @@ -4,7 +4,7 @@ wstring.h diStorm3 - Powerful disassembler for X86/AMD64 http://ragestorm.net/distorm/ distorm at gmail dot com -Copyright (C) 2003-2018 Gil Dabah +Copyright (C) 2003-2021 Gil Dabah This library is licensed under the BSD license. See the file COPYING. */ @@ -13,22 +13,25 @@ This library is licensed under the BSD license. See the file COPYING. #define WSTRING_H #include "config.h" +#include "../include/mnemonics.h" #ifndef DISTORM_LIGHT -void strclear_WS(_WString* s); -void chrcat_WS(_WString* s, uint8_t ch); -void strcpylen_WS(_WString* s, const int8_t* buf, unsigned int len); -void strcatlen_WS(_WString* s, const int8_t* buf, unsigned int len); -void strcat_WS(_WString* s, const _WString* s2); - -/* -* Warning, this macro should be used only when the compiler knows the size of string in advance! -* This macro is used in order to spare the call to strlen when the strings are known already. -* Note: sizeof includes NULL terminated character. -*/ -#define strcat_WSN(s, t) strcatlen_WS((s), ((const int8_t*)t), sizeof((t))-1) -#define strcpy_WSN(s, t) strcpylen_WS((s), ((const int8_t*)t), sizeof((t))-1) +_INLINE_ void strcat_WSR(unsigned char** str, const _WRegister* reg) +{ + /* + * Longest register name is YMM15 - 5 characters, + * Copy 8 so compiler can do a QWORD move. + * We copy nul termination and fix the length, so it's okay to copy more to the output buffer. + * There's a sentinel register to make sure we don't read past the end of the registers table. + */ + memcpy((int8_t*)*str, (const int8_t*)reg->p, 8); + *str += reg->length; +} + +#define strfinalize_WS(s, end) do { *end = 0; s.length = (unsigned int)((size_t)end - (size_t)s.p); } while (0) +#define chrcat_WS(s, ch) do { *s = ch; s += 1; } while (0) +#define strcat_WS(s, buf, copylen, advancelen) do { memcpy((int8_t*)s, buf, copylen); s += advancelen; } while(0) #endif /* DISTORM_LIGHT */ diff --git a/NativeCore/Dependencies/distorm/src/x86defs.h b/NativeCore/Dependencies/distorm/src/x86defs.h index ca3a3adf..8b7b5414 100644 --- a/NativeCore/Dependencies/distorm/src/x86defs.h +++ b/NativeCore/Dependencies/distorm/src/x86defs.h @@ -4,7 +4,7 @@ x86defs.h diStorm3 - Powerful disassembler for X86/AMD64 http://ragestorm.net/distorm/ distorm at gmail dot com -Copyright (C) 2003-2018 Gil Dabah +Copyright (C) 2003-2021 Gil Dabah This library is licensed under the BSD license. See the file COPYING. */ diff --git a/NativeCore/Unix/Makefile b/NativeCore/Unix/Makefile index 1a99feff..12c8b33b 100644 --- a/NativeCore/Unix/Makefile +++ b/NativeCore/Unix/Makefile @@ -35,9 +35,9 @@ OBJDIR_RELEASE = obj/release DEP_RELEASE = OUT_RELEASE = build/release/NativeCore.so -OBJ_DEBUG = $(OBJDIR_DEBUG)/WriteRemoteMemory.o $(OBJDIR_DEBUG)/ReadRemoteMemory.o $(OBJDIR_DEBUG)/OpenRemoteProcess.o $(OBJDIR_DEBUG)/IsProcessValid.o $(OBJDIR_DEBUG)/Input.o $(OBJDIR_DEBUG)/EnumerateRemoteSectionsAndModules.o $(OBJDIR_DEBUG)/EnumerateProcesses.o $(OBJDIR_DEBUG)/DisassembleCode.o $(OBJDIR_DEBUG)/DistormHelper.o $(OBJDIR_DEBUG)/Debugger.o $(OBJDIR_DEBUG)/ControlRemoteProcess.o $(OBJDIR_DEBUG)/CloseRemoteProcess.o $(OBJDIR_DEBUG)/decoder.o $(OBJDIR_DEBUG)/distorm.o $(OBJDIR_DEBUG)/instructions.o $(OBJDIR_DEBUG)/insts.o $(OBJDIR_DEBUG)/mnemonics.o $(OBJDIR_DEBUG)/operands.o $(OBJDIR_DEBUG)/prefix.o $(OBJDIR_DEBUG)/textdefs.o $(OBJDIR_DEBUG)/wstring.o +OBJ_DEBUG = $(OBJDIR_DEBUG)/WriteRemoteMemory.o $(OBJDIR_DEBUG)/ReadRemoteMemory.o $(OBJDIR_DEBUG)/OpenRemoteProcess.o $(OBJDIR_DEBUG)/IsProcessValid.o $(OBJDIR_DEBUG)/Input.o $(OBJDIR_DEBUG)/EnumerateRemoteSectionsAndModules.o $(OBJDIR_DEBUG)/EnumerateProcesses.o $(OBJDIR_DEBUG)/DisassembleCode.o $(OBJDIR_DEBUG)/DistormHelper.o $(OBJDIR_DEBUG)/Debugger.o $(OBJDIR_DEBUG)/ControlRemoteProcess.o $(OBJDIR_DEBUG)/CloseRemoteProcess.o $(OBJDIR_DEBUG)/decoder.o $(OBJDIR_DEBUG)/distorm.o $(OBJDIR_DEBUG)/instructions.o $(OBJDIR_DEBUG)/insts.o $(OBJDIR_DEBUG)/mnemonics.o $(OBJDIR_DEBUG)/operands.o $(OBJDIR_DEBUG)/prefix.o $(OBJDIR_DEBUG)/textdefs.o -OBJ_RELEASE = $(OBJDIR_RELEASE)/WriteRemoteMemory.o $(OBJDIR_RELEASE)/ReadRemoteMemory.o $(OBJDIR_RELEASE)/OpenRemoteProcess.o $(OBJDIR_RELEASE)/IsProcessValid.o $(OBJDIR_RELEASE)/Input.o $(OBJDIR_RELEASE)/EnumerateRemoteSectionsAndModules.o $(OBJDIR_RELEASE)/EnumerateProcesses.o $(OBJDIR_RELEASE)/DisassembleCode.o $(OBJDIR_RELEASE)/DistormHelper.o $(OBJDIR_RELEASE)/Debugger.o $(OBJDIR_RELEASE)/ControlRemoteProcess.o $(OBJDIR_RELEASE)/CloseRemoteProcess.o $(OBJDIR_RELEASE)/decoder.o $(OBJDIR_RELEASE)/distorm.o $(OBJDIR_RELEASE)/instructions.o $(OBJDIR_RELEASE)/insts.o $(OBJDIR_RELEASE)/mnemonics.o $(OBJDIR_RELEASE)/operands.o $(OBJDIR_RELEASE)/prefix.o $(OBJDIR_RELEASE)/textdefs.o $(OBJDIR_RELEASE)/wstring.o +OBJ_RELEASE = $(OBJDIR_RELEASE)/WriteRemoteMemory.o $(OBJDIR_RELEASE)/ReadRemoteMemory.o $(OBJDIR_RELEASE)/OpenRemoteProcess.o $(OBJDIR_RELEASE)/IsProcessValid.o $(OBJDIR_RELEASE)/Input.o $(OBJDIR_RELEASE)/EnumerateRemoteSectionsAndModules.o $(OBJDIR_RELEASE)/EnumerateProcesses.o $(OBJDIR_RELEASE)/DisassembleCode.o $(OBJDIR_RELEASE)/DistormHelper.o $(OBJDIR_RELEASE)/Debugger.o $(OBJDIR_RELEASE)/ControlRemoteProcess.o $(OBJDIR_RELEASE)/CloseRemoteProcess.o $(OBJDIR_RELEASE)/decoder.o $(OBJDIR_RELEASE)/distorm.o $(OBJDIR_RELEASE)/instructions.o $(OBJDIR_RELEASE)/insts.o $(OBJDIR_RELEASE)/mnemonics.o $(OBJDIR_RELEASE)/operands.o $(OBJDIR_RELEASE)/prefix.o $(OBJDIR_RELEASE)/textdefs.o all: debug release @@ -114,9 +114,6 @@ $(OBJDIR_DEBUG)/prefix.o: ../Dependencies/distorm/src/prefix.c $(OBJDIR_DEBUG)/textdefs.o: ../Dependencies/distorm/src/textdefs.c $(CXX) $(CFLAGS_DEBUG) $(INC_DEBUG) -c ../Dependencies/distorm/src/textdefs.c -o $(OBJDIR_DEBUG)/textdefs.o -$(OBJDIR_DEBUG)/wstring.o: ../Dependencies/distorm/src/wstring.c - $(CXX) $(CFLAGS_DEBUG) $(INC_DEBUG) -c ../Dependencies/distorm/src/wstring.c -o $(OBJDIR_DEBUG)/wstring.o - clean_debug: rm -f $(OBJ_DEBUG) $(OUT_DEBUG) rm -rf build/debug @@ -193,9 +190,6 @@ $(OBJDIR_RELEASE)/prefix.o: ../Dependencies/distorm/src/prefix.c $(OBJDIR_RELEASE)/textdefs.o: ../Dependencies/distorm/src/textdefs.c $(CXX) $(CFLAGS_RELEASE) $(INC_RELEASE) -c ../Dependencies/distorm/src/textdefs.c -o $(OBJDIR_RELEASE)/textdefs.o -$(OBJDIR_RELEASE)/wstring.o: ../Dependencies/distorm/src/wstring.c - $(CXX) $(CFLAGS_RELEASE) $(INC_RELEASE) -c ../Dependencies/distorm/src/wstring.c -o $(OBJDIR_RELEASE)/wstring.o - clean_release: rm -f $(OBJ_RELEASE) $(OUT_RELEASE) rm -rf build/release diff --git a/NativeCore/Unix/NativeCore.Unix.vcxproj b/NativeCore/Unix/NativeCore.Unix.vcxproj index 539434ad..c1f08598 100644 --- a/NativeCore/Unix/NativeCore.Unix.vcxproj +++ b/NativeCore/Unix/NativeCore.Unix.vcxproj @@ -84,7 +84,6 @@ - diff --git a/NativeCore/Unix/NativeCore.Unix.vcxproj.filters b/NativeCore/Unix/NativeCore.Unix.vcxproj.filters index bbefa0a1..3076be6b 100644 --- a/NativeCore/Unix/NativeCore.Unix.vcxproj.filters +++ b/NativeCore/Unix/NativeCore.Unix.vcxproj.filters @@ -72,9 +72,6 @@ Dependencies\distorm - - Dependencies\distorm - Shared @@ -115,9 +112,6 @@ Dependencies\distorm - - Dependencies\distorm - Dependencies\distorm diff --git a/NativeCore/Windows/NativeCore.vcxproj b/NativeCore/Windows/NativeCore.vcxproj index 520adc23..565980de 100644 --- a/NativeCore/Windows/NativeCore.vcxproj +++ b/NativeCore/Windows/NativeCore.vcxproj @@ -178,7 +178,6 @@ - diff --git a/NativeCore/Windows/NativeCore.vcxproj.filters b/NativeCore/Windows/NativeCore.vcxproj.filters index a8eb2be9..eb42b939 100644 --- a/NativeCore/Windows/NativeCore.vcxproj.filters +++ b/NativeCore/Windows/NativeCore.vcxproj.filters @@ -58,9 +58,6 @@ Dependencies\distorm - - Dependencies\distorm - Shared From d95a424ffdd1d0b8183e4f1c3f4f18968393040b Mon Sep 17 00:00:00 2001 From: KN4CK3R Date: Thu, 13 May 2021 21:34:09 +0200 Subject: [PATCH 208/223] Handle not decodable instructions. --- NativeCore/Shared/DistormHelper.cpp | 121 +++++++++++++--------------- 1 file changed, 54 insertions(+), 67 deletions(-) diff --git a/NativeCore/Shared/DistormHelper.cpp b/NativeCore/Shared/DistormHelper.cpp index dbc08ad8..9d8d9e85 100644 --- a/NativeCore/Shared/DistormHelper.cpp +++ b/NativeCore/Shared/DistormHelper.cpp @@ -58,99 +58,87 @@ bool AreOperandsStatic(const _DInst &instruction, const int prefixLength) return true; } -int GetStaticInstructionBytes(const _DInst &instruction, const uint8_t *data) +_CodeInfo CreateCodeInfo(const uint8_t* address, int length, const _OffsetType virtualAddress) { _CodeInfo info = {}; - info.codeOffset = reinterpret_cast<_OffsetType>(data); - info.code = data; - info.codeLen = instruction.size; + info.codeOffset = virtualAddress; + info.code = address; + info.codeLen = length; info.features = DF_NONE; + #ifdef RECLASSNET32 info.dt = Decode32Bits; #else info.dt = Decode64Bits; #endif - _PrefixState ps = {}; - memset(ps.pfxIndexer, PFXIDX_NONE, sizeof(int) * PFXIDX_MAX); - ps.start = data; - ps.last = data; - - prefixes_decode(data, info.codeLen, &ps, info.dt); + return info; +} - info.codeOffset = reinterpret_cast<_OffsetType>(ps.last); - info.code = ps.last; - const auto prefixLength = static_cast(ps.start - ps.last); - info.codeLen -= prefixLength; +int GetStaticInstructionBytes(const _DInst &instruction, const uint8_t *data) +{ + auto info = CreateCodeInfo(data, instruction.size, reinterpret_cast<_OffsetType>(data)); - inst_lookup(&info, &ps); + _PrefixState ps = {}; + int isPrefixed; + inst_lookup(&info, &ps, &isPrefixed); - if (AreOperandsStatic(instruction, prefixLength)) + if (AreOperandsStatic(instruction, ps.count)) { return instruction.size; } - return instruction.size - info.codeLen; + return instruction.size - info.codeLen - ps.count; } -_CodeInfo CreateCodeInfo(const RC_Pointer address, const RC_Size length, const RC_Pointer virtualAddress) -{ - _CodeInfo info = {}; - info.codeOffset = reinterpret_cast<_OffsetType>(virtualAddress); - info.code = reinterpret_cast(address); - info.codeLen = static_cast(length); - info.features = DF_NONE; - -#ifdef RECLASSNET32 - info.dt = Decode32Bits; -#else - info.dt = Decode64Bits; -#endif - - return info; -} - -void FillInstructionData(const RC_Pointer address, const _DInst& instruction, const _DecodedInst& instructionInfo, const bool determineStaticInstructionBytes, InstructionData* data) +void FillInstructionData(const _CodeInfo& info, const RC_Pointer address, const _DInst& instruction, const bool determineStaticInstructionBytes, InstructionData* data) { data->Address = reinterpret_cast(instruction.addr); - data->Length = instructionInfo.size; - std::memcpy(data->Data, address, instructionInfo.size); - - MultiByteToUnicode( - reinterpret_cast(instructionInfo.mnemonic.p), - data->Instruction, - instructionInfo.mnemonic.length - ); - if (instructionInfo.operands.length != 0) - { - data->Instruction[instructionInfo.mnemonic.length] = ' '; - - MultiByteToUnicode( - reinterpret_cast(instructionInfo.operands.p), - 0, - data->Instruction, - instructionInfo.mnemonic.length + 1, - std::min(64 - 1 - instructionInfo.mnemonic.length, instructionInfo.operands.length) - ); - } + data->Length = instruction.size; + std::memcpy(data->Data, address, instruction.size); + data->StaticInstructionBytes = -1; - if (determineStaticInstructionBytes) + if (instruction.flags == FLAG_NOT_DECODABLE) { - data->StaticInstructionBytes = GetStaticInstructionBytes( - instruction, - reinterpret_cast(address) - ); + std::memcpy(data->Instruction, L"???", sizeof(RC_UnicodeChar) * 3); } else { - data->StaticInstructionBytes = -1; + _DecodedInst instructionInfo = {}; + distorm_format(&info, &instruction, &instructionInfo); + + MultiByteToUnicode( + reinterpret_cast(instructionInfo.mnemonic.p), + data->Instruction, + instructionInfo.mnemonic.length + ); + if (instructionInfo.operands.length != 0) + { + data->Instruction[instructionInfo.mnemonic.length] = ' '; + + MultiByteToUnicode( + reinterpret_cast(instructionInfo.operands.p), + 0, + data->Instruction, + instructionInfo.mnemonic.length + 1, + std::min(64 - 1 - instructionInfo.mnemonic.length, instructionInfo.operands.length) + ); + } + + if (determineStaticInstructionBytes) + { + data->StaticInstructionBytes = GetStaticInstructionBytes( + instruction, + reinterpret_cast(address) + ); + } } } bool DisassembleInstructionsImpl(const RC_Pointer address, const RC_Size length, const RC_Pointer virtualAddress, const bool determineStaticInstructionBytes, EnumerateInstructionCallback callback) { - auto info = CreateCodeInfo(address, length, virtualAddress); + auto info = CreateCodeInfo(static_cast(address), static_cast(length), reinterpret_cast<_OffsetType>(virtualAddress)); const unsigned MaxInstructions = 50; @@ -169,18 +157,17 @@ bool DisassembleInstructionsImpl(const RC_Pointer address, const RC_Size length, for (auto i = 0u; i < count; ++i) { - _DecodedInst instructionInfo = {}; - distorm_format(&info, &decodedInstructions[i], &instructionInfo); + const auto& instruction = decodedInstructions[i]; InstructionData data = {}; - FillInstructionData(instructionAddress, decodedInstructions[i], instructionInfo, determineStaticInstructionBytes, &data); + FillInstructionData(info, instructionAddress, instruction, determineStaticInstructionBytes, &data); if (callback(&data) == false) { return true; } - instructionAddress += decodedInstructions[i].size; + instructionAddress += instruction.size; } if (res == DECRES_SUCCESS || count == 0) @@ -188,7 +175,7 @@ bool DisassembleInstructionsImpl(const RC_Pointer address, const RC_Size length, return true; } - const auto offset = static_cast(decodedInstructions[count - 1].addr - info.codeOffset); + const auto offset = static_cast(decodedInstructions[count - 1].addr + decodedInstructions[count - 1].size - info.codeOffset); info.codeOffset += offset; info.code += offset; From 0ee8a4cd6a00e2664f2ef3250a81089c32d69392 Mon Sep 17 00:00:00 2001 From: KN4CK3R Date: Fri, 18 Jun 2021 08:18:39 +0200 Subject: [PATCH 209/223] Fixed button anchor. (fixes #200) --- ReClass.NET/Forms/ScannerForm.Designer.cs | 67 ++++++++++++----------- 1 file changed, 34 insertions(+), 33 deletions(-) diff --git a/ReClass.NET/Forms/ScannerForm.Designer.cs b/ReClass.NET/Forms/ScannerForm.Designer.cs index 58d867ea..d6fd02ac 100644 --- a/ReClass.NET/Forms/ScannerForm.Designer.cs +++ b/ReClass.NET/Forms/ScannerForm.Designer.cs @@ -31,14 +31,14 @@ protected override void Dispose(bool disposing) private void InitializeComponent() { this.components = new System.ComponentModel.Container(); - this.bannerBox = new BannerBox(); + this.bannerBox = new ReClassNET.Controls.BannerBox(); this.filterGroupBox = new System.Windows.Forms.GroupBox(); this.valueTypeComboBox = new ReClassNET.Forms.ScannerForm.ScanValueTypeComboBox(); this.label3 = new System.Windows.Forms.Label(); this.compareTypeComboBox = new ReClassNET.Forms.ScannerForm.ScanCompareTypeComboBox(); this.label1 = new System.Windows.Forms.Label(); this.isHexCheckBox = new System.Windows.Forms.CheckBox(); - this.dualValueBox = new DualValueBox(); + this.dualValueBox = new ReClassNET.Controls.DualValueBox(); this.scanOptionsGroupBox = new System.Windows.Forms.GroupBox(); this.fastScanAlignmentTextBox = new System.Windows.Forms.TextBox(); this.fastScanCheckBox = new System.Windows.Forms.CheckBox(); @@ -67,7 +67,7 @@ private void InitializeComponent() this.scanProgressBar = new System.Windows.Forms.ProgressBar(); this.resultCountLabel = new System.Windows.Forms.Label(); this.updateValuesTimer = new System.Windows.Forms.Timer(this.components); - this.resultMemoryRecordList = new MemoryRecordList(); + this.resultMemoryRecordList = new ReClassNET.Controls.MemoryRecordList(); this.resultListContextMenuStrip = new System.Windows.Forms.ContextMenuStrip(this.components); this.addSelectedResultsToAddressListToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.removeSelectedRecordsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); @@ -84,7 +84,7 @@ private void InitializeComponent() this.findOutWhatWritesToThisAddressToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.toolStripSeparator4 = new System.Windows.Forms.ToolStripSeparator(); this.copyAddressToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.addressListMemoryRecordList = new MemoryRecordList(); + this.addressListMemoryRecordList = new ReClassNET.Controls.MemoryRecordList(); this.toolStripPanel = new System.Windows.Forms.ToolStripPanel(); this.menuToolStrip = new System.Windows.Forms.ToolStrip(); this.openAddressFileToolStripButton = new System.Windows.Forms.ToolStripButton(); @@ -93,9 +93,9 @@ private void InitializeComponent() this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator(); this.clearAddressListToolStripButton = new System.Windows.Forms.ToolStripButton(); this.infoToolTip = new System.Windows.Forms.ToolTip(this.components); - this.undoIconButton = new IconButton(); - this.showInputCorrelatorIconButton = new IconButton(); - this.cancelScanIconButton = new IconButton(); + this.undoIconButton = new ReClassNET.Controls.IconButton(); + this.showInputCorrelatorIconButton = new ReClassNET.Controls.IconButton(); + this.cancelScanIconButton = new ReClassNET.Controls.IconButton(); ((System.ComponentModel.ISupportInitialize)(this.bannerBox)).BeginInit(); this.filterGroupBox.SuspendLayout(); this.scanOptionsGroupBox.SuspendLayout(); @@ -503,8 +503,8 @@ private void InitializeComponent() // // resultMemoryRecordList // - this.resultMemoryRecordList.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); + this.resultMemoryRecordList.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); this.resultMemoryRecordList.ContextMenuStrip = this.resultListContextMenuStrip; this.resultMemoryRecordList.Location = new System.Drawing.Point(11, 80); this.resultMemoryRecordList.Name = "resultMemoryRecordList"; @@ -515,22 +515,22 @@ private void InitializeComponent() this.resultMemoryRecordList.ShowValueTypeColumn = false; this.resultMemoryRecordList.Size = new System.Drawing.Size(268, 314); this.resultMemoryRecordList.TabIndex = 16; - this.resultMemoryRecordList.RecordDoubleClick += new MemorySearchResultControlResultDoubleClickEventHandler(this.memorySearchResultControl_ResultDoubleClick); + this.resultMemoryRecordList.RecordDoubleClick += new ReClassNET.Controls.MemorySearchResultControlResultDoubleClickEventHandler(this.memorySearchResultControl_ResultDoubleClick); // // resultListContextMenuStrip // this.resultListContextMenuStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.addSelectedResultsToAddressListToolStripMenuItem, - this.removeSelectedRecordsToolStripMenuItem, - this.changeToolStripMenuItem, - this.toolStripSeparator2, - this.setCurrentClassAddressToolStripMenuItem, - this.createClassAtAddressToolStripMenuItem, - this.toolStripSeparator3, - this.findOutWhatAccessesThisAddressToolStripMenuItem, - this.findOutWhatWritesToThisAddressToolStripMenuItem, - this.toolStripSeparator4, - this.copyAddressToolStripMenuItem}); + this.addSelectedResultsToAddressListToolStripMenuItem, + this.removeSelectedRecordsToolStripMenuItem, + this.changeToolStripMenuItem, + this.toolStripSeparator2, + this.setCurrentClassAddressToolStripMenuItem, + this.createClassAtAddressToolStripMenuItem, + this.toolStripSeparator3, + this.findOutWhatAccessesThisAddressToolStripMenuItem, + this.findOutWhatWritesToThisAddressToolStripMenuItem, + this.toolStripSeparator4, + this.copyAddressToolStripMenuItem}); this.resultListContextMenuStrip.Name = "resultListContextMenuStrip"; this.resultListContextMenuStrip.Size = new System.Drawing.Size(270, 198); this.resultListContextMenuStrip.Opening += new System.ComponentModel.CancelEventHandler(this.resultListContextMenuStrip_Opening); @@ -554,10 +554,10 @@ private void InitializeComponent() // changeToolStripMenuItem // this.changeToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.descriptionToolStripMenuItem, - this.addressToolStripMenuItem, - this.valueTypeToolStripMenuItem, - this.valueToolStripMenuItem}); + this.descriptionToolStripMenuItem, + this.addressToolStripMenuItem, + this.valueTypeToolStripMenuItem, + this.valueToolStripMenuItem}); this.changeToolStripMenuItem.Enabled = false; this.changeToolStripMenuItem.Image = global::ReClassNET.Properties.Resources.B16x16_Textfield_Rename; this.changeToolStripMenuItem.Name = "changeToolStripMenuItem"; @@ -645,9 +645,9 @@ private void InitializeComponent() // // addressListMemoryRecordList // - this.addressListMemoryRecordList.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); + this.addressListMemoryRecordList.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); this.addressListMemoryRecordList.ContextMenuStrip = this.resultListContextMenuStrip; this.addressListMemoryRecordList.Location = new System.Drawing.Point(11, 425); this.addressListMemoryRecordList.Name = "addressListMemoryRecordList"; @@ -674,11 +674,11 @@ private void InitializeComponent() this.menuToolStrip.Dock = System.Windows.Forms.DockStyle.None; this.menuToolStrip.GripStyle = System.Windows.Forms.ToolStripGripStyle.Hidden; this.menuToolStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.openAddressFileToolStripButton, - this.saveAddressFileToolStripButton, - this.saveAddressFileAsToolStripButton, - this.toolStripSeparator1, - this.clearAddressListToolStripButton}); + this.openAddressFileToolStripButton, + this.saveAddressFileToolStripButton, + this.saveAddressFileAsToolStripButton, + this.toolStripSeparator1, + this.clearAddressListToolStripButton}); this.menuToolStrip.Location = new System.Drawing.Point(0, 0); this.menuToolStrip.Name = "menuToolStrip"; this.menuToolStrip.Size = new System.Drawing.Size(101, 25); @@ -759,6 +759,7 @@ private void InitializeComponent() // // cancelScanIconButton // + this.cancelScanIconButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.cancelScanIconButton.Image = global::ReClassNET.Properties.Resources.B16x16_Button_Delete; this.cancelScanIconButton.Location = new System.Drawing.Point(517, 54); this.cancelScanIconButton.Name = "cancelScanIconButton"; From 378ad2994201197732572fb5064d39ce6605c3e0 Mon Sep 17 00:00:00 2001 From: KN4CK3R Date: Sun, 12 Sep 2021 10:45:31 +0200 Subject: [PATCH 210/223] Fixed writing two bytes instead of one. --- ReClass.NET/Extensions/IRemoteMemoryWriterExtension.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ReClass.NET/Extensions/IRemoteMemoryWriterExtension.cs b/ReClass.NET/Extensions/IRemoteMemoryWriterExtension.cs index c587a2d1..d39dace9 100644 --- a/ReClass.NET/Extensions/IRemoteMemoryWriterExtension.cs +++ b/ReClass.NET/Extensions/IRemoteMemoryWriterExtension.cs @@ -6,9 +6,9 @@ namespace ReClassNET.Extensions { public static class IRemoteMemoryWriterExtension { - public static void WriteRemoteMemory(this IRemoteMemoryWriter writer, IntPtr address, sbyte value) => writer.WriteRemoteMemory(address, writer.BitConverter.GetBytes(value)); + public static void WriteRemoteMemory(this IRemoteMemoryWriter writer, IntPtr address, sbyte value) => writer.WriteRemoteMemory(address, new[] { (byte)value }); - public static void WriteRemoteMemory(this IRemoteMemoryWriter writer, IntPtr address, byte value) => writer.WriteRemoteMemory(address, writer.BitConverter.GetBytes(value)); + public static void WriteRemoteMemory(this IRemoteMemoryWriter writer, IntPtr address, byte value) => writer.WriteRemoteMemory(address, new[] { value }); public static void WriteRemoteMemory(this IRemoteMemoryWriter writer, IntPtr address, short value) => writer.WriteRemoteMemory(address, writer.BitConverter.GetBytes(value)); From e4d420d3355098fee4b2a7b8ebbf0dc02a3da281 Mon Sep 17 00:00:00 2001 From: ko1N Date: Fri, 8 Oct 2021 11:03:14 +0200 Subject: [PATCH 211/223] Fixed a crash where using the 'Insert Bytes' menu on the topmost class would throw an Exception --- ReClass.NET/Nodes/BaseContainerNode.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ReClass.NET/Nodes/BaseContainerNode.cs b/ReClass.NET/Nodes/BaseContainerNode.cs index 6926111f..d7c53571 100644 --- a/ReClass.NET/Nodes/BaseContainerNode.cs +++ b/ReClass.NET/Nodes/BaseContainerNode.cs @@ -243,8 +243,9 @@ public void AddBytes(int size) public void InsertBytes(BaseNode position, int size) { + int index = FindNodeIndex(position); List dummy = null; - InsertBytes(FindNodeIndex(position), size, ref dummy); + InsertBytes(index >= 0 ? index : 0, size, ref dummy); } /// Inserts bytes at the specified position. From 22d6f30d37c9f62c8e040b069b71e118e532e807 Mon Sep 17 00:00:00 2001 From: ko1N Date: Fri, 8 Oct 2021 14:20:04 +0200 Subject: [PATCH 212/223] Disabled 'Insert Bytes' menu when selecting a class --- ReClass.NET/Forms/MainForm.cs | 9 +++++---- ReClass.NET/Nodes/BaseContainerNode.cs | 3 +-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/ReClass.NET/Forms/MainForm.cs b/ReClass.NET/Forms/MainForm.cs index e9a18b38..010eea25 100644 --- a/ReClass.NET/Forms/MainForm.cs +++ b/ReClass.NET/Forms/MainForm.cs @@ -495,7 +495,7 @@ private void selectedNodeContextMenuStrip_Opening(object sender, CancelEventArgs }; addBytesToolStripMenuItem.Enabled = parentNode != null || nodeIsClass; - insertBytesToolStripMenuItem.Enabled = count == 1 && parentNode != null; + insertBytesToolStripMenuItem.Enabled = count == 1 && parentNode != null && !nodeIsClass; changeTypeToolStripMenuItem.Enabled = count > 0 && !nodeIsClass; @@ -829,11 +829,12 @@ private void memoryViewControl_SelectionChanged(object sender, EventArgs e) var node = selectedNodes.FirstOrDefault()?.Node; var parentContainer = node?.GetParentContainer(); + var nodeIsClass = node is ClassNode; - addBytesToolStripDropDownButton.Enabled = parentContainer != null || node is ClassNode; - insertBytesToolStripDropDownButton.Enabled = selectedNodes.Count == 1 && parentContainer != null; + addBytesToolStripDropDownButton.Enabled = parentContainer != null || nodeIsClass; + insertBytesToolStripDropDownButton.Enabled = selectedNodes.Count == 1 && parentContainer != null && !nodeIsClass; - var enabled = selectedNodes.Count > 0 && !(node is ClassNode); + var enabled = selectedNodes.Count > 0 && !nodeIsClass; toolStrip.Items.OfType().ForEach(b => b.Enabled = enabled); } diff --git a/ReClass.NET/Nodes/BaseContainerNode.cs b/ReClass.NET/Nodes/BaseContainerNode.cs index d7c53571..6926111f 100644 --- a/ReClass.NET/Nodes/BaseContainerNode.cs +++ b/ReClass.NET/Nodes/BaseContainerNode.cs @@ -243,9 +243,8 @@ public void AddBytes(int size) public void InsertBytes(BaseNode position, int size) { - int index = FindNodeIndex(position); List dummy = null; - InsertBytes(index >= 0 ? index : 0, size, ref dummy); + InsertBytes(FindNodeIndex(position), size, ref dummy); } /// Inserts bytes at the specified position. From f4dc7614054a138a4a21712442ba7b8f61951038 Mon Sep 17 00:00:00 2001 From: ko1N Date: Thu, 31 Mar 2022 14:53:00 +0200 Subject: [PATCH 213/223] Fixed compilation on gcc 11 and fixed new import paths for dlopen/dlsym/dlcose (#220) --- NativeCore/Unix/EnumerateRemoteSectionsAndModules.cpp | 2 +- ReClass.NET/Native/NativeMethods.Unix.cs | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/NativeCore/Unix/EnumerateRemoteSectionsAndModules.cpp b/NativeCore/Unix/EnumerateRemoteSectionsAndModules.cpp index a3ef6d8b..e983ee77 100644 --- a/NativeCore/Unix/EnumerateRemoteSectionsAndModules.cpp +++ b/NativeCore/Unix/EnumerateRemoteSectionsAndModules.cpp @@ -50,7 +50,7 @@ extern "C" void RC_CallConv EnumerateRemoteSectionsAndModules(RC_Pointer handle, RC_UnicodeChar Path[PATH_MAXIMUM_LENGTH] = {}; }; - std::ifstream input(static_cast(std::stringstream() << "/proc/" << reinterpret_cast(handle) << "/maps").str()); + std::ifstream input((std::stringstream() << "/proc/" << reinterpret_cast(handle) << "/maps").str()); std::unordered_map modules; diff --git a/ReClass.NET/Native/NativeMethods.Unix.cs b/ReClass.NET/Native/NativeMethods.Unix.cs index 50be47b3..c1b2e6c4 100644 --- a/ReClass.NET/Native/NativeMethods.Unix.cs +++ b/ReClass.NET/Native/NativeMethods.Unix.cs @@ -10,13 +10,13 @@ internal class NativeMethodsUnix : INativeMethods private const int RTLD_NOW = 2; - [DllImport("libdl.so")] + [DllImport("__Internal")] private static extern IntPtr dlopen(string fileName, int flags); - [DllImport("libdl.so")] + [DllImport("__Internal")] private static extern IntPtr dlsym(IntPtr handle, string symbol); - [DllImport("libdl.so")] + [DllImport("__Internal")] private static extern int dlclose(IntPtr handle); #endregion From 18d6a63e32b05df6a18e15cc20bcd3dffa4b7d96 Mon Sep 17 00:00:00 2001 From: Mstik Date: Tue, 31 May 2022 20:06:33 -1200 Subject: [PATCH 214/223] Filter By PID --- NativeCore/Windows/NativeCore.vcxproj | 8 ++++---- ReClass.NET/Forms/ProcessBrowserForm.cs | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/NativeCore/Windows/NativeCore.vcxproj b/NativeCore/Windows/NativeCore.vcxproj index 565980de..5715bcb4 100644 --- a/NativeCore/Windows/NativeCore.vcxproj +++ b/NativeCore/Windows/NativeCore.vcxproj @@ -28,26 +28,26 @@ DynamicLibrary true - v142 + v143 Unicode DynamicLibrary false - v142 + v143 true MultiByte DynamicLibrary true - v142 + v143 MultiByte DynamicLibrary false - v142 + v143 true MultiByte diff --git a/ReClass.NET/Forms/ProcessBrowserForm.cs b/ReClass.NET/Forms/ProcessBrowserForm.cs index 9478a06f..d4ed7cb3 100644 --- a/ReClass.NET/Forms/ProcessBrowserForm.cs +++ b/ReClass.NET/Forms/ProcessBrowserForm.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Data; using System.Drawing; using System.Linq; @@ -131,7 +131,7 @@ private void ApplyFilter() var filter = filterTextBox.Text; if (!string.IsNullOrEmpty(filter)) { - filter = $"name like '%{filter}%' or path like '%{filter}%'"; + filter = $"name like '%{filter}%' or path like '%{filter}%' or CONVERT(id, System.String) like '%{filter}%'"; } ((DataTable)processDataGridView.DataSource).DefaultView.RowFilter = filter; } From 45696a717258efbf82872306168950a0055f5c1d Mon Sep 17 00:00:00 2001 From: KN4CK3R Date: Mon, 8 Aug 2022 21:09:52 +0200 Subject: [PATCH 215/223] Use inner nodes for hierarchy calculation. --- ReClass.NET/CodeGenerator/CppCodeGenerator.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ReClass.NET/CodeGenerator/CppCodeGenerator.cs b/ReClass.NET/CodeGenerator/CppCodeGenerator.cs index 4cefbf8f..b6495aab 100644 --- a/ReClass.NET/CodeGenerator/CppCodeGenerator.cs +++ b/ReClass.NET/CodeGenerator/CppCodeGenerator.cs @@ -192,6 +192,9 @@ IEnumerable GetReversedClassHierarchy(ClassNode node) } var classNodes = node.Nodes + .OfType() + .SelectMany(c => c.Nodes) + .Concat(node.Nodes) .OfType() .Where(w => !w.IsNodePresentInChain()) // Pointers are forward declared .Select(w => w.ResolveMostInnerNode() as ClassNode) From fde15991a5fe7b6a309053ca2b71f557b820c260 Mon Sep 17 00:00:00 2001 From: KN4CK3R Date: Wed, 10 Aug 2022 09:24:58 +0200 Subject: [PATCH 216/223] Limit index when changing size. --- ReClass.NET/Nodes/BaseWrapperArrayNode.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ReClass.NET/Nodes/BaseWrapperArrayNode.cs b/ReClass.NET/Nodes/BaseWrapperArrayNode.cs index 52d5d948..ee042751 100644 --- a/ReClass.NET/Nodes/BaseWrapperArrayNode.cs +++ b/ReClass.NET/Nodes/BaseWrapperArrayNode.cs @@ -116,6 +116,11 @@ public override void Update(HotSpot spot) { Count = value; + if (CurrentIndex >= value) + { + CurrentIndex = value - 1; + } + GetParentContainer()?.ChildHasChanged(this); } } From 28d69d8c8967417ca6db1043ff43788966d182c1 Mon Sep 17 00:00:00 2001 From: KN4CK3R Date: Sun, 25 Sep 2022 17:59:54 +0200 Subject: [PATCH 217/223] Fix tab escaping. --- ReClass.NET/Util/Rtf/RtfBuilder.cs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/ReClass.NET/Util/Rtf/RtfBuilder.cs b/ReClass.NET/Util/Rtf/RtfBuilder.cs index 4015722d..76bd7b95 100644 --- a/ReClass.NET/Util/Rtf/RtfBuilder.cs +++ b/ReClass.NET/Util/Rtf/RtfBuilder.cs @@ -247,22 +247,22 @@ private static string EscapeString(string value) { if (value.IndexOfAny(slashable) >= 0) { - value = value.Replace("\\", "\\\\").Replace("{", @"\{").Replace("}", @"\}"); + value = value.Replace(@"\", @"\\").Replace("{", @"\{").Replace("}", @"\}"); } - if (value.Any(c => c > 255)) + if (value.Any(c => c > 255 || c == '\t')) { var sb = new StringBuilder(); foreach (var c in value) { - if (c <= 255) + if (c == '\t') { - sb.Append(c); + sb.Append(@"\tab"); } - else if (c == '\t') + else if (c <= 255) { - sb.Append(@"\tab"); + sb.Append(c); } else { From e1289162e22aa99c55a0d75fdb8bd2e095f8c488 Mon Sep 17 00:00:00 2001 From: KN4CK3R Date: Sun, 25 Sep 2022 20:12:45 +0200 Subject: [PATCH 218/223] Use WSL to compile linux native core library. --- NativeCore/Unix/EnumerateRemoteSectionsAndModules.cpp | 5 +++-- NativeCore/Unix/NativeCore.Unix.vcxproj | 4 ++++ README.md | 2 ++ 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/NativeCore/Unix/EnumerateRemoteSectionsAndModules.cpp b/NativeCore/Unix/EnumerateRemoteSectionsAndModules.cpp index e983ee77..079cba54 100644 --- a/NativeCore/Unix/EnumerateRemoteSectionsAndModules.cpp +++ b/NativeCore/Unix/EnumerateRemoteSectionsAndModules.cpp @@ -50,12 +50,13 @@ extern "C" void RC_CallConv EnumerateRemoteSectionsAndModules(RC_Pointer handle, RC_UnicodeChar Path[PATH_MAXIMUM_LENGTH] = {}; }; - std::ifstream input((std::stringstream() << "/proc/" << reinterpret_cast(handle) << "/maps").str()); + auto path = std::stringstream(); + path << "/proc/" << reinterpret_cast(handle) << "/maps"; std::unordered_map modules; std::string line; - while (std::getline(input, line)) + while (std::getline(std::ifstream(path.str()), line)) { std::stringstream ss(line); diff --git a/NativeCore/Unix/NativeCore.Unix.vcxproj b/NativeCore/Unix/NativeCore.Unix.vcxproj index c1f08598..9ce274fd 100644 --- a/NativeCore/Unix/NativeCore.Unix.vcxproj +++ b/NativeCore/Unix/NativeCore.Unix.vcxproj @@ -33,18 +33,22 @@ true DynamicLibrary + WSL2_1_0 false DynamicLibrary + WSL2_1_0 true DynamicLibrary + WSL2_1_0 false DynamicLibrary + WSL2_1_0 diff --git a/README.md b/README.md index 6a83bf03..6f424ced 100644 --- a/README.md +++ b/README.md @@ -77,6 +77,8 @@ Just download the [latest version](https://github.com/ReClassNET/ReClass.NET/rel If you want to compile ReClass.NET just fork the repository and open the ReClass.NET.sln file with Visual Studio 2019. Compile the project and copy the dependencies to the output folder. +To compile the linux native core library, you need WSL [installed and configured](https://learn.microsoft.com/en-us/cpp/build/walkthrough-build-debug-wsl2). If you do not need linux support, simply unload the project in the Solution Explorer. + ## Videos [Youtube Playlist](https://www.youtube.com/playlist?list=PLO246BmtoITanq3ygMCL8_w0eov4D8hjk) From eea41dab4e092a5af2f3c2960d44ecc0da789dd1 Mon Sep 17 00:00:00 2001 From: KN4CK3R Date: Sun, 25 Sep 2022 20:18:49 +0200 Subject: [PATCH 219/223] Bump distorm to 3.5.3. --- NativeCore/Dependencies/distorm/COPYING.txt | 2 +- .../Dependencies/distorm/include/distorm.h | 2 +- .../Dependencies/distorm/include/mnemonics.h | 476 +-- NativeCore/Dependencies/distorm/src/config.h | 2 +- NativeCore/Dependencies/distorm/src/insts.c | 2764 ++++++++--------- .../Dependencies/distorm/src/mnemonics.c | 52 +- NativeCore/Dependencies/distorm/src/wstring.c | 47 - 7 files changed, 1649 insertions(+), 1696 deletions(-) delete mode 100644 NativeCore/Dependencies/distorm/src/wstring.c diff --git a/NativeCore/Dependencies/distorm/COPYING.txt b/NativeCore/Dependencies/distorm/COPYING.txt index 4f365ddc..9046eba5 100644 --- a/NativeCore/Dependencies/distorm/COPYING.txt +++ b/NativeCore/Dependencies/distorm/COPYING.txt @@ -1,6 +1,6 @@ :[diStorm3}: The ultimate disassembler library. -Copyright (c) 2003-2016, Gil Dabah +Copyright (c) 2003-2021, Gil Dabah All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/NativeCore/Dependencies/distorm/include/distorm.h b/NativeCore/Dependencies/distorm/include/distorm.h index 2e09c4a6..b0467bae 100644 --- a/NativeCore/Dependencies/distorm/include/distorm.h +++ b/NativeCore/Dependencies/distorm/include/distorm.h @@ -1,4 +1,4 @@ -/* diStorm 3.5.2 */ +/* diStorm 3.5.3 */ /* distorm.h diff --git a/NativeCore/Dependencies/distorm/include/mnemonics.h b/NativeCore/Dependencies/distorm/include/mnemonics.h index 3a784cca..3f982705 100644 --- a/NativeCore/Dependencies/distorm/include/mnemonics.h +++ b/NativeCore/Dependencies/distorm/include/mnemonics.h @@ -41,245 +41,245 @@ extern const _WRegister _REGISTERS[]; #define GET_MNEMONIC_NAME(m) ((_WMnemonic*)&_MNEMONICS[(m)])->p typedef enum { - I_UNDEFINED = 0, I_AAA = 66, I_AAD = 389, I_AAM = 384, I_AAS = 76, I_ADC = 31, I_ADD = 11, I_ADDPD = 3144, - I_ADDPS = 3137, I_ADDSD = 3158, I_ADDSS = 3151, I_ADDSUBPD = 6428, I_ADDSUBPS = 6438, - I_AESDEC = 9243, I_AESDECLAST = 9260, I_AESENC = 9201, I_AESENCLAST = 9218, - I_AESIMC = 9184, I_AESKEYGENASSIST = 9829, I_AND = 41, I_ANDNPD = 3055, I_ANDNPS = 3047, - I_ANDPD = 3024, I_ANDPS = 3017, I_ARPL = 111, I_BLENDPD = 9406, I_BLENDPS = 9387, - I_BLENDVPD = 7653, I_BLENDVPS = 7643, I_BOUND = 104, I_BSF = 4380, I_BSR = 4392, - I_BSWAP = 960, I_BT = 872, I_BTC = 934, I_BTR = 912, I_BTS = 887, I_CALL = 456, - I_CALL_FAR = 260, I_CBW = 228, I_CDQ = 250, I_CDQE = 239, I_CLAC = 1787, I_CLC = 492, - I_CLD = 512, I_CLFLUSH = 4363, I_CLGI = 1867, I_CLI = 502, I_CLTS = 541, I_CMC = 487, - I_CMOVA = 694, I_CMOVAE = 663, I_CMOVB = 656, I_CMOVBE = 686, I_CMOVG = 754, - I_CMOVGE = 738, I_CMOVL = 731, I_CMOVLE = 746, I_CMOVNO = 648, I_CMOVNP = 723, - I_CMOVNS = 708, I_CMOVNZ = 678, I_CMOVO = 641, I_CMOVP = 716, I_CMOVS = 701, - I_CMOVZ = 671, I_CMP = 71, I_CMPEQPD = 4483, I_CMPEQPS = 4404, I_CMPEQSD = 4641, - I_CMPEQSS = 4562, I_CMPLEPD = 4501, I_CMPLEPS = 4422, I_CMPLESD = 4659, I_CMPLESS = 4580, - I_CMPLTPD = 4492, I_CMPLTPS = 4413, I_CMPLTSD = 4650, I_CMPLTSS = 4571, I_CMPNEQPD = 4522, - I_CMPNEQPS = 4443, I_CMPNEQSD = 4680, I_CMPNEQSS = 4601, I_CMPNLEPD = 4542, - I_CMPNLEPS = 4463, I_CMPNLESD = 4700, I_CMPNLESS = 4621, I_CMPNLTPD = 4532, - I_CMPNLTPS = 4453, I_CMPNLTSD = 4690, I_CMPNLTSS = 4611, I_CMPORDPD = 4552, - I_CMPORDPS = 4473, I_CMPORDSD = 4710, I_CMPORDSS = 4631, I_CMPS = 301, I_CMPUNORDPD = 4510, - I_CMPUNORDPS = 4431, I_CMPUNORDSD = 4668, I_CMPUNORDSS = 4589, I_CMPXCHG = 898, - I_CMPXCHG16B = 6407, I_CMPXCHG8B = 6396, I_COMISD = 2813, I_COMISS = 2805, - I_CPUID = 865, I_CQO = 255, I_CRC32 = 9292, I_CVTDQ2PD = 6821, I_CVTDQ2PS = 3341, - I_CVTPD2DQ = 6831, I_CVTPD2PI = 2715, I_CVTPD2PS = 3267, I_CVTPH2PS = 4195, - I_CVTPI2PD = 2529, I_CVTPI2PS = 2519, I_CVTPS2DQ = 3351, I_CVTPS2PD = 3257, - I_CVTPS2PH = 4205, I_CVTPS2PI = 2705, I_CVTSD2SI = 2735, I_CVTSD2SS = 3287, - I_CVTSI2SD = 2549, I_CVTSI2SS = 2539, I_CVTSS2SD = 3277, I_CVTSS2SI = 2725, - I_CVTTPD2DQ = 6810, I_CVTTPD2PI = 2648, I_CVTTPS2DQ = 3361, I_CVTTPS2PI = 2637, - I_CVTTSD2SI = 2670, I_CVTTSS2SI = 2659, I_CWD = 245, I_CWDE = 233, I_DAA = 46, - I_DAS = 56, I_DEC = 86, I_DIV = 1646, I_DIVPD = 3533, I_DIVPS = 3526, I_DIVSD = 3547, - I_DIVSS = 3540, I_DPPD = 9649, I_DPPS = 9636, I_EMMS = 4134, I_ENTER = 340, - I_EXTRACTPS = 9514, I_EXTRQ = 4170, I_F2XM1 = 1192, I_FABS = 1123, I_FADD = 1023, - I_FADDP = 1549, I_FBLD = 1601, I_FBSTP = 1607, I_FCHS = 1117, I_FCLEX = 7323, - I_FCMOVB = 1376, I_FCMOVBE = 1392, I_FCMOVE = 1384, I_FCMOVNB = 1445, I_FCMOVNBE = 1463, - I_FCMOVNE = 1454, I_FCMOVNU = 1473, I_FCMOVU = 1401, I_FCOM = 1035, I_FCOMI = 1512, - I_FCOMIP = 1623, I_FCOMP = 1041, I_FCOMPP = 1563, I_FCOS = 1311, I_FDECSTP = 1238, - I_FDIV = 1061, I_FDIVP = 1594, I_FDIVR = 1067, I_FDIVRP = 1586, I_FEDISI = 1488, - I_FEMMS = 574, I_FENI = 1482, I_FFREE = 1527, I_FIADD = 1317, I_FICOM = 1331, - I_FICOMP = 1338, I_FIDIV = 1361, I_FIDIVR = 1368, I_FILD = 1418, I_FIMUL = 1324, - I_FINCSTP = 1247, I_FINIT = 7338, I_FIST = 1432, I_FISTP = 1438, I_FISTTP = 1424, - I_FISUB = 1346, I_FISUBR = 1353, I_FLD = 1074, I_FLD1 = 1141, I_FLDCW = 1098, - I_FLDENV = 1090, I_FLDL2E = 1155, I_FLDL2T = 1147, I_FLDLG2 = 1170, I_FLDLN2 = 1178, - I_FLDPI = 1163, I_FLDZ = 1186, I_FMUL = 1029, I_FMULP = 1556, I_FNCLEX = 7315, - I_FNINIT = 7330, I_FNOP = 1111, I_FNSAVE = 7345, I_FNSTCW = 7300, I_FNSTENV = 7283, - I_FNSTSW = 7360, I_FPATAN = 1213, I_FPREM = 1256, I_FPREM1 = 1230, I_FPTAN = 1206, - I_FRNDINT = 1288, I_FRSTOR = 1519, I_FSAVE = 7353, I_FSCALE = 1297, I_FSETPM = 1496, - I_FSIN = 1305, I_FSINCOS = 1279, I_FSQRT = 1272, I_FST = 1079, I_FSTCW = 7308, - I_FSTENV = 7292, I_FSTP = 1084, I_FSTSW = 7368, I_FSUB = 1048, I_FSUBP = 1579, - I_FSUBR = 1054, I_FSUBRP = 1571, I_FTST = 1129, I_FUCOM = 1534, I_FUCOMI = 1504, - I_FUCOMIP = 1614, I_FUCOMP = 1541, I_FUCOMPP = 1409, I_FXAM = 1135, I_FXCH = 1105, - I_FXRSTOR = 9926, I_FXRSTOR64 = 9935, I_FXSAVE = 9898, I_FXSAVE64 = 9906, - I_FXTRACT = 1221, I_FYL2X = 1199, I_FYL2XP1 = 1263, I_GETSEC = 633, I_HADDPD = 4215, - I_HADDPS = 4223, I_HLT = 482, I_HSUBPD = 4249, I_HSUBPS = 4257, I_IDIV = 1651, - I_IMUL = 117, I_IN = 447, I_INC = 81, I_INS = 123, I_INSERTPS = 9581, I_INSERTQ = 4177, - I_INT = 367, I_INT_3 = 360, I_INT1 = 476, I_INTO = 372, I_INVD = 555, I_INVEPT = 8318, - I_INVLPG = 1727, I_INVLPGA = 1881, I_INVPCID = 8335, I_INVVPID = 8326, I_IRET = 378, - I_JA = 166, I_JAE = 147, I_JB = 143, I_JBE = 161, I_JCXZ = 427, I_JECXZ = 433, - I_JG = 202, I_JGE = 192, I_JL = 188, I_JLE = 197, I_JMP = 462, I_JMP_FAR = 467, + I_UNDEFINED = 0, I_AAA = 66, I_AAD = 388, I_AAM = 383, I_AAS = 76, I_ADC = 31, I_ADD = 11, I_ADDPD = 3143, + I_ADDPS = 3136, I_ADDSD = 3157, I_ADDSS = 3150, I_ADDSUBPD = 6427, I_ADDSUBPS = 6437, + I_AESDEC = 9242, I_AESDECLAST = 9259, I_AESENC = 9200, I_AESENCLAST = 9217, + I_AESIMC = 9183, I_AESKEYGENASSIST = 9828, I_AND = 41, I_ANDNPD = 3054, I_ANDNPS = 3046, + I_ANDPD = 3023, I_ANDPS = 3016, I_ARPL = 111, I_BLENDPD = 9405, I_BLENDPS = 9386, + I_BLENDVPD = 7652, I_BLENDVPS = 7642, I_BOUND = 104, I_BSF = 4379, I_BSR = 4391, + I_BSWAP = 959, I_BT = 871, I_BTC = 933, I_BTR = 911, I_BTS = 886, I_CALL = 455, + I_CALL_FAR = 260, I_CBW = 228, I_CDQ = 250, I_CDQE = 239, I_CLAC = 1786, I_CLC = 491, + I_CLD = 511, I_CLFLUSH = 4362, I_CLGI = 1866, I_CLI = 501, I_CLTS = 540, I_CMC = 486, + I_CMOVA = 693, I_CMOVAE = 662, I_CMOVB = 655, I_CMOVBE = 685, I_CMOVG = 753, + I_CMOVGE = 737, I_CMOVL = 730, I_CMOVLE = 745, I_CMOVNO = 647, I_CMOVNP = 722, + I_CMOVNS = 707, I_CMOVNZ = 677, I_CMOVO = 640, I_CMOVP = 715, I_CMOVS = 700, + I_CMOVZ = 670, I_CMP = 71, I_CMPEQPD = 4482, I_CMPEQPS = 4403, I_CMPEQSD = 4640, + I_CMPEQSS = 4561, I_CMPLEPD = 4500, I_CMPLEPS = 4421, I_CMPLESD = 4658, I_CMPLESS = 4579, + I_CMPLTPD = 4491, I_CMPLTPS = 4412, I_CMPLTSD = 4649, I_CMPLTSS = 4570, I_CMPNEQPD = 4521, + I_CMPNEQPS = 4442, I_CMPNEQSD = 4679, I_CMPNEQSS = 4600, I_CMPNLEPD = 4541, + I_CMPNLEPS = 4462, I_CMPNLESD = 4699, I_CMPNLESS = 4620, I_CMPNLTPD = 4531, + I_CMPNLTPS = 4452, I_CMPNLTSD = 4689, I_CMPNLTSS = 4610, I_CMPORDPD = 4551, + I_CMPORDPS = 4472, I_CMPORDSD = 4709, I_CMPORDSS = 4630, I_CMPS = 301, I_CMPUNORDPD = 4509, + I_CMPUNORDPS = 4430, I_CMPUNORDSD = 4667, I_CMPUNORDSS = 4588, I_CMPXCHG = 897, + I_CMPXCHG16B = 6406, I_CMPXCHG8B = 6395, I_COMISD = 2812, I_COMISS = 2804, + I_CPUID = 864, I_CQO = 255, I_CRC32 = 9291, I_CVTDQ2PD = 6820, I_CVTDQ2PS = 3340, + I_CVTPD2DQ = 6830, I_CVTPD2PI = 2714, I_CVTPD2PS = 3266, I_CVTPH2PS = 4194, + I_CVTPI2PD = 2528, I_CVTPI2PS = 2518, I_CVTPS2DQ = 3350, I_CVTPS2PD = 3256, + I_CVTPS2PH = 4204, I_CVTPS2PI = 2704, I_CVTSD2SI = 2734, I_CVTSD2SS = 3286, + I_CVTSI2SD = 2548, I_CVTSI2SS = 2538, I_CVTSS2SD = 3276, I_CVTSS2SI = 2724, + I_CVTTPD2DQ = 6809, I_CVTTPD2PI = 2647, I_CVTTPS2DQ = 3360, I_CVTTPS2PI = 2636, + I_CVTTSD2SI = 2669, I_CVTTSS2SI = 2658, I_CWD = 245, I_CWDE = 233, I_DAA = 46, + I_DAS = 56, I_DEC = 86, I_DIV = 1645, I_DIVPD = 3532, I_DIVPS = 3525, I_DIVSD = 3546, + I_DIVSS = 3539, I_DPPD = 9648, I_DPPS = 9635, I_EMMS = 4133, I_ENTER = 340, + I_EXTRACTPS = 9513, I_EXTRQ = 4169, I_F2XM1 = 1191, I_FABS = 1122, I_FADD = 1022, + I_FADDP = 1548, I_FBLD = 1600, I_FBSTP = 1606, I_FCHS = 1116, I_FCLEX = 7322, + I_FCMOVB = 1375, I_FCMOVBE = 1391, I_FCMOVE = 1383, I_FCMOVNB = 1444, I_FCMOVNBE = 1462, + I_FCMOVNE = 1453, I_FCMOVNU = 1472, I_FCMOVU = 1400, I_FCOM = 1034, I_FCOMI = 1511, + I_FCOMIP = 1622, I_FCOMP = 1040, I_FCOMPP = 1562, I_FCOS = 1310, I_FDECSTP = 1237, + I_FDIV = 1060, I_FDIVP = 1593, I_FDIVR = 1066, I_FDIVRP = 1585, I_FEDISI = 1487, + I_FEMMS = 573, I_FENI = 1481, I_FFREE = 1526, I_FIADD = 1316, I_FICOM = 1330, + I_FICOMP = 1337, I_FIDIV = 1360, I_FIDIVR = 1367, I_FILD = 1417, I_FIMUL = 1323, + I_FINCSTP = 1246, I_FINIT = 7337, I_FIST = 1431, I_FISTP = 1437, I_FISTTP = 1423, + I_FISUB = 1345, I_FISUBR = 1352, I_FLD = 1073, I_FLD1 = 1140, I_FLDCW = 1097, + I_FLDENV = 1089, I_FLDL2E = 1154, I_FLDL2T = 1146, I_FLDLG2 = 1169, I_FLDLN2 = 1177, + I_FLDPI = 1162, I_FLDZ = 1185, I_FMUL = 1028, I_FMULP = 1555, I_FNCLEX = 7314, + I_FNINIT = 7329, I_FNOP = 1110, I_FNSAVE = 7344, I_FNSTCW = 7299, I_FNSTENV = 7282, + I_FNSTSW = 7359, I_FPATAN = 1212, I_FPREM = 1255, I_FPREM1 = 1229, I_FPTAN = 1205, + I_FRNDINT = 1287, I_FRSTOR = 1518, I_FSAVE = 7352, I_FSCALE = 1296, I_FSETPM = 1495, + I_FSIN = 1304, I_FSINCOS = 1278, I_FSQRT = 1271, I_FST = 1078, I_FSTCW = 7307, + I_FSTENV = 7291, I_FSTP = 1083, I_FSTSW = 7367, I_FSUB = 1047, I_FSUBP = 1578, + I_FSUBR = 1053, I_FSUBRP = 1570, I_FTST = 1128, I_FUCOM = 1533, I_FUCOMI = 1503, + I_FUCOMIP = 1613, I_FUCOMP = 1540, I_FUCOMPP = 1408, I_FXAM = 1134, I_FXCH = 1104, + I_FXRSTOR = 9925, I_FXRSTOR64 = 9934, I_FXSAVE = 9897, I_FXSAVE64 = 9905, + I_FXTRACT = 1220, I_FYL2X = 1198, I_FYL2XP1 = 1262, I_GETSEC = 632, I_HADDPD = 4214, + I_HADDPS = 4222, I_HLT = 481, I_HSUBPD = 4248, I_HSUBPS = 4256, I_IDIV = 1650, + I_IMUL = 117, I_IN = 446, I_INC = 81, I_INS = 123, I_INSERTPS = 9580, I_INSERTQ = 4176, + I_INT = 366, I_INT1 = 475, I_INT3 = 360, I_INTO = 371, I_INVD = 554, I_INVEPT = 8317, + I_INVLPG = 1726, I_INVLPGA = 1880, I_INVPCID = 8334, I_INVVPID = 8325, I_IRET = 377, + I_JA = 166, I_JAE = 147, I_JB = 143, I_JBE = 161, I_JCXZ = 426, I_JECXZ = 432, + I_JG = 202, I_JGE = 192, I_JL = 188, I_JLE = 197, I_JMP = 461, I_JMP_FAR = 466, I_JNO = 138, I_JNP = 183, I_JNS = 174, I_JNZ = 156, I_JO = 134, I_JP = 179, - I_JRCXZ = 440, I_JS = 170, I_JZ = 152, I_LAHF = 289, I_LAR = 522, I_LDDQU = 7028, - I_LDMXCSR = 9956, I_LDS = 335, I_LEA = 223, I_LEAVE = 347, I_LES = 330, I_LFENCE = 4299, - I_LFS = 917, I_LGDT = 1703, I_LGS = 922, I_LIDT = 1709, I_LLDT = 1668, I_LMSW = 1721, - I_LODS = 313, I_LOOP = 421, I_LOOPNZ = 406, I_LOOPZ = 414, I_LSL = 527, I_LSS = 907, - I_LTR = 1674, I_LZCNT = 4397, I_MASKMOVDQU = 7153, I_MASKMOVQ = 7143, I_MAXPD = 3593, - I_MAXPS = 3586, I_MAXSD = 3607, I_MAXSS = 3600, I_MFENCE = 4325, I_MINPD = 3473, - I_MINPS = 3466, I_MINSD = 3487, I_MINSS = 3480, I_MONITOR = 1771, I_MOV = 218, - I_MOVAPD = 2493, I_MOVAPS = 2485, I_MOVBE = 9285, I_MOVD = 3954, I_MOVDDUP = 2220, - I_MOVDQ2Q = 6556, I_MOVDQA = 3980, I_MOVDQU = 3988, I_MOVHLPS = 2185, I_MOVHPD = 2379, - I_MOVHPS = 2371, I_MOVLHPS = 2362, I_MOVLPD = 2202, I_MOVLPS = 2194, I_MOVMSKPD = 2849, - I_MOVMSKPS = 2839, I_MOVNTDQ = 6883, I_MOVNTDQA = 7929, I_MOVNTI = 952, I_MOVNTPD = 2590, - I_MOVNTPS = 2581, I_MOVNTQ = 6875, I_MOVNTSD = 2608, I_MOVNTSS = 2599, I_MOVQ = 3960, - I_MOVQ2DQ = 6547, I_MOVS = 295, I_MOVSD = 2144, I_MOVSHDUP = 2387, I_MOVSLDUP = 2210, - I_MOVSS = 2137, I_MOVSX = 939, I_MOVSXD = 10039, I_MOVUPD = 2129, I_MOVUPS = 2121, - I_MOVZX = 927, I_MPSADBW = 9662, I_MUL = 1641, I_MULPD = 3204, I_MULPS = 3197, - I_MULSD = 3218, I_MULSS = 3211, I_MWAIT = 1780, I_NEG = 1636, I_NOP = 581, - I_NOT = 1631, I_OR = 27, I_ORPD = 3087, I_ORPS = 3081, I_OUT = 451, I_OUTS = 128, - I_PABSB = 7722, I_PABSD = 7752, I_PABSW = 7737, I_PACKSSDW = 3883, I_PACKSSWB = 3715, - I_PACKUSDW = 7950, I_PACKUSWB = 3793, I_PADDB = 7238, I_PADDD = 7268, I_PADDQ = 6515, - I_PADDSB = 6964, I_PADDSW = 6981, I_PADDUSB = 6654, I_PADDUSW = 6673, I_PADDW = 7253, - I_PALIGNR = 9444, I_PAND = 6641, I_PANDN = 6699, I_PAUSE = 10047, I_PAVGB = 6714, - I_PAVGUSB = 2112, I_PAVGW = 6759, I_PBLENDVB = 7633, I_PBLENDW = 9425, I_PCLMULQDQ = 9681, - I_PCMPEQB = 4077, I_PCMPEQD = 4115, I_PCMPEQQ = 7910, I_PCMPEQW = 4096, I_PCMPESTRI = 9760, - I_PCMPESTRM = 9737, I_PCMPGTB = 3736, I_PCMPGTD = 3774, I_PCMPGTQ = 8121, - I_PCMPGTW = 3755, I_PCMPISTRI = 9806, I_PCMPISTRM = 9783, I_PEXTRB = 9463, - I_PEXTRD = 9480, I_PEXTRQ = 9488, I_PEXTRW = 6345, I_PF2ID = 1948, I_PF2IW = 1941, - I_PFACC = 2062, I_PFADD = 2011, I_PFCMPEQ = 2069, I_PFCMPGE = 1972, I_PFCMPGT = 2018, - I_PFMAX = 2027, I_PFMIN = 1981, I_PFMUL = 2078, I_PFNACC = 1955, I_PFPNACC = 1963, - I_PFRCP = 1988, I_PFRCPIT1 = 2034, I_PFRCPIT2 = 2085, I_PFRSQIT1 = 2044, I_PFRSQRT = 1995, - I_PFSUB = 2004, I_PFSUBR = 2054, I_PHADDD = 7409, I_PHADDSW = 7426, I_PHADDW = 7392, - I_PHMINPOSUW = 8293, I_PHSUBD = 7485, I_PHSUBSW = 7502, I_PHSUBW = 7468, I_PI2FD = 1934, - I_PI2FW = 1927, I_PINSRB = 9564, I_PINSRD = 9602, I_PINSRQ = 9610, I_PINSRW = 6328, - I_PMADDUBSW = 7445, I_PMADDWD = 7107, I_PMAXSB = 8208, I_PMAXSD = 8225, I_PMAXSW = 6998, - I_PMAXUB = 6682, I_PMAXUD = 8259, I_PMAXUW = 8242, I_PMINSB = 8140, I_PMINSD = 8157, - I_PMINSW = 6936, I_PMINUB = 6624, I_PMINUD = 8191, I_PMINUW = 8174, I_PMOVMSKB = 6565, - I_PMOVSXBD = 7788, I_PMOVSXBQ = 7809, I_PMOVSXBW = 7767, I_PMOVSXDQ = 7872, - I_PMOVSXWD = 7830, I_PMOVSXWQ = 7851, I_PMOVZXBD = 8016, I_PMOVZXBQ = 8037, - I_PMOVZXBW = 7995, I_PMOVZXDQ = 8100, I_PMOVZXWD = 8058, I_PMOVZXWQ = 8079, - I_PMULDQ = 7893, I_PMULHRSW = 7572, I_PMULHRW = 2095, I_PMULHUW = 6774, I_PMULHW = 6793, - I_PMULLD = 8276, I_PMULLW = 6530, I_PMULUDQ = 7088, I_POP = 22, I_POPA = 98, - I_POPCNT = 4372, I_POPF = 277, I_POR = 6953, I_PREFETCH = 1906, I_PREFETCHNTA = 2436, - I_PREFETCHT0 = 2449, I_PREFETCHT1 = 2461, I_PREFETCHT2 = 2473, I_PREFETCHW = 1916, - I_PSADBW = 7126, I_PSHUFB = 7375, I_PSHUFD = 4022, I_PSHUFHW = 4030, I_PSHUFLW = 4039, - I_PSHUFW = 4014, I_PSIGNB = 7521, I_PSIGND = 7555, I_PSIGNW = 7538, I_PSLLD = 7058, - I_PSLLDQ = 9881, I_PSLLQ = 7073, I_PSLLW = 7043, I_PSRAD = 6744, I_PSRAW = 6729, - I_PSRLD = 6485, I_PSRLDQ = 9864, I_PSRLQ = 6500, I_PSRLW = 6470, I_PSUBB = 7178, - I_PSUBD = 7208, I_PSUBQ = 7223, I_PSUBSB = 6902, I_PSUBSW = 6919, I_PSUBUSB = 6586, - I_PSUBUSW = 6605, I_PSUBW = 7193, I_PSWAPD = 2104, I_PTEST = 7663, I_PUNPCKHBW = 3814, - I_PUNPCKHDQ = 3860, I_PUNPCKHQDQ = 3929, I_PUNPCKHWD = 3837, I_PUNPCKLBW = 3646, - I_PUNPCKLDQ = 3692, I_PUNPCKLQDQ = 3904, I_PUNPCKLWD = 3669, I_PUSH = 16, - I_PUSHA = 91, I_PUSHF = 270, I_PXOR = 7015, I_RCL = 977, I_RCPPS = 2987, I_RCPSS = 2994, - I_RCR = 982, I_RDFSBASE = 9916, I_RDGSBASE = 9946, I_RDMSR = 600, I_RDPMC = 607, - I_RDRAND = 10060, I_RDTSC = 593, I_RDTSCP = 1898, I_RET = 325, I_RETF = 354, - I_ROL = 967, I_ROR = 972, I_ROUNDPD = 9330, I_ROUNDPS = 9311, I_ROUNDSD = 9368, - I_ROUNDSS = 9349, I_RSM = 882, I_RSQRTPS = 2949, I_RSQRTSS = 2958, I_SAHF = 283, - I_SAL = 997, I_SALC = 394, I_SAR = 1002, I_SBB = 36, I_SCAS = 319, I_SETA = 807, - I_SETAE = 780, I_SETB = 774, I_SETBE = 800, I_SETG = 859, I_SETGE = 845, I_SETL = 839, - I_SETLE = 852, I_SETNO = 767, I_SETNP = 832, I_SETNS = 819, I_SETNZ = 793, - I_SETO = 761, I_SETP = 826, I_SETS = 813, I_SETZ = 787, I_SFENCE = 4355, I_SGDT = 1691, - I_SHL = 987, I_SHLD = 876, I_SHR = 992, I_SHRD = 892, I_SHUFPD = 6370, I_SHUFPS = 6362, - I_SIDT = 1697, I_SKINIT = 1873, I_SLDT = 1657, I_SMSW = 1715, I_SQRTPD = 2889, - I_SQRTPS = 2881, I_SQRTSD = 2905, I_SQRTSS = 2897, I_STAC = 1793, I_STC = 497, - I_STD = 517, I_STGI = 1861, I_STI = 507, I_STMXCSR = 9985, I_STOS = 307, I_STR = 1663, - I_SUB = 51, I_SUBPD = 3413, I_SUBPS = 3406, I_SUBSD = 3427, I_SUBSS = 3420, - I_SWAPGS = 1890, I_SYSCALL = 532, I_SYSENTER = 614, I_SYSEXIT = 624, I_SYSRET = 547, - I_TEST = 206, I_TZCNT = 4385, I_UCOMISD = 2776, I_UCOMISS = 2767, I_UD2 = 569, - I_UNPCKHPD = 2330, I_UNPCKHPS = 2320, I_UNPCKLPD = 2288, I_UNPCKLPS = 2278, - I_VADDPD = 3173, I_VADDPS = 3165, I_VADDSD = 3189, I_VADDSS = 3181, I_VADDSUBPD = 6448, - I_VADDSUBPS = 6459, I_VAESDEC = 9251, I_VAESDECLAST = 9272, I_VAESENC = 9209, - I_VAESENCLAST = 9230, I_VAESIMC = 9192, I_VAESKEYGENASSIST = 9846, I_VANDNPD = 3072, - I_VANDNPS = 3063, I_VANDPD = 3039, I_VANDPS = 3031, I_VBLENDPD = 9415, I_VBLENDPS = 9396, - I_VBLENDVPD = 9715, I_VBLENDVPS = 9704, I_VBROADCASTF128 = 7706, I_VBROADCASTSD = 7692, - I_VBROADCASTSS = 7678, I_VCMPEQPD = 5122, I_VCMPEQPS = 4720, I_VCMPEQSD = 5926, - I_VCMPEQSS = 5524, I_VCMPEQ_OSPD = 5303, I_VCMPEQ_OSPS = 4901, I_VCMPEQ_OSSD = 6107, - I_VCMPEQ_OSSS = 5705, I_VCMPEQ_UQPD = 5209, I_VCMPEQ_UQPS = 4807, I_VCMPEQ_UQSD = 6013, - I_VCMPEQ_UQSS = 5611, I_VCMPEQ_USPD = 5412, I_VCMPEQ_USPS = 5010, I_VCMPEQ_USSD = 6216, - I_VCMPEQ_USSS = 5814, I_VCMPFALSEPD = 5244, I_VCMPFALSEPS = 4842, I_VCMPFALSESD = 6048, - I_VCMPFALSESS = 5646, I_VCMPFALSE_OSPD = 5453, I_VCMPFALSE_OSPS = 5051, I_VCMPFALSE_OSSD = 6257, - I_VCMPFALSE_OSSS = 5855, I_VCMPGEPD = 5271, I_VCMPGEPS = 4869, I_VCMPGESD = 6075, - I_VCMPGESS = 5673, I_VCMPGE_OQPD = 5483, I_VCMPGE_OQPS = 5081, I_VCMPGE_OQSD = 6287, - I_VCMPGE_OQSS = 5885, I_VCMPGTPD = 5281, I_VCMPGTPS = 4879, I_VCMPGTSD = 6085, - I_VCMPGTSS = 5683, I_VCMPGT_OQPD = 5496, I_VCMPGT_OQPS = 5094, I_VCMPGT_OQSD = 6300, - I_VCMPGT_OQSS = 5898, I_VCMPLEPD = 5142, I_VCMPLEPS = 4740, I_VCMPLESD = 5946, - I_VCMPLESS = 5544, I_VCMPLE_OQPD = 5329, I_VCMPLE_OQPS = 4927, I_VCMPLE_OQSD = 6133, - I_VCMPLE_OQSS = 5731, I_VCMPLTPD = 5132, I_VCMPLTPS = 4730, I_VCMPLTSD = 5936, - I_VCMPLTSS = 5534, I_VCMPLT_OQPD = 5316, I_VCMPLT_OQPS = 4914, I_VCMPLT_OQSD = 6120, - I_VCMPLT_OQSS = 5718, I_VCMPNEQPD = 5165, I_VCMPNEQPS = 4763, I_VCMPNEQSD = 5969, - I_VCMPNEQSS = 5567, I_VCMPNEQ_OQPD = 5257, I_VCMPNEQ_OQPS = 4855, I_VCMPNEQ_OQSD = 6061, - I_VCMPNEQ_OQSS = 5659, I_VCMPNEQ_OSPD = 5469, I_VCMPNEQ_OSPS = 5067, I_VCMPNEQ_OSSD = 6273, - I_VCMPNEQ_OSSS = 5871, I_VCMPNEQ_USPD = 5357, I_VCMPNEQ_USPS = 4955, I_VCMPNEQ_USSD = 6161, - I_VCMPNEQ_USSS = 5759, I_VCMPNGEPD = 5222, I_VCMPNGEPS = 4820, I_VCMPNGESD = 6026, - I_VCMPNGESS = 5624, I_VCMPNGE_UQPD = 5425, I_VCMPNGE_UQPS = 5023, I_VCMPNGE_UQSD = 6229, - I_VCMPNGE_UQSS = 5827, I_VCMPNGTPD = 5233, I_VCMPNGTPS = 4831, I_VCMPNGTSD = 6037, - I_VCMPNGTSS = 5635, I_VCMPNGT_UQPD = 5439, I_VCMPNGT_UQPS = 5037, I_VCMPNGT_UQSD = 6243, - I_VCMPNGT_UQSS = 5841, I_VCMPNLEPD = 5187, I_VCMPNLEPS = 4785, I_VCMPNLESD = 5991, - I_VCMPNLESS = 5589, I_VCMPNLE_UQPD = 5385, I_VCMPNLE_UQPS = 4983, I_VCMPNLE_UQSD = 6189, - I_VCMPNLE_UQSS = 5787, I_VCMPNLTPD = 5176, I_VCMPNLTPS = 4774, I_VCMPNLTSD = 5980, - I_VCMPNLTSS = 5578, I_VCMPNLT_UQPD = 5371, I_VCMPNLT_UQPS = 4969, I_VCMPNLT_UQSD = 6175, - I_VCMPNLT_UQSS = 5773, I_VCMPORDPD = 5198, I_VCMPORDPS = 4796, I_VCMPORDSD = 6002, - I_VCMPORDSS = 5600, I_VCMPORD_SPD = 5399, I_VCMPORD_SPS = 4997, I_VCMPORD_SSD = 6203, - I_VCMPORD_SSS = 5801, I_VCMPTRUEPD = 5291, I_VCMPTRUEPS = 4889, I_VCMPTRUESD = 6095, - I_VCMPTRUESS = 5693, I_VCMPTRUE_USPD = 5509, I_VCMPTRUE_USPS = 5107, I_VCMPTRUE_USSD = 6313, - I_VCMPTRUE_USSS = 5911, I_VCMPUNORDPD = 5152, I_VCMPUNORDPS = 4750, I_VCMPUNORDSD = 5956, - I_VCMPUNORDSS = 5554, I_VCMPUNORD_SPD = 5342, I_VCMPUNORD_SPS = 4940, I_VCMPUNORD_SSD = 6146, - I_VCMPUNORD_SSS = 5744, I_VCOMISD = 2830, I_VCOMISS = 2821, I_VCVTDQ2PD = 6853, - I_VCVTDQ2PS = 3372, I_VCVTPD2DQ = 6864, I_VCVTPD2PS = 3308, I_VCVTPS2DQ = 3383, - I_VCVTPS2PD = 3297, I_VCVTSD2SI = 2756, I_VCVTSD2SS = 3330, I_VCVTSI2SD = 2570, - I_VCVTSI2SS = 2559, I_VCVTSS2SD = 3319, I_VCVTSS2SI = 2745, I_VCVTTPD2DQ = 6841, - I_VCVTTPS2DQ = 3394, I_VCVTTSD2SI = 2693, I_VCVTTSS2SI = 2681, I_VDIVPD = 3562, - I_VDIVPS = 3554, I_VDIVSD = 3578, I_VDIVSS = 3570, I_VDPPD = 9655, I_VDPPS = 9642, - I_VERR = 1679, I_VERW = 1685, I_VEXTRACTF128 = 9550, I_VEXTRACTPS = 9525, - I_VFMADD132PD = 8421, I_VFMADD132PS = 8408, I_VFMADD132SD = 8447, I_VFMADD132SS = 8434, - I_VFMADD213PD = 8701, I_VFMADD213PS = 8688, I_VFMADD213SD = 8727, I_VFMADD213SS = 8714, - I_VFMADD231PD = 8981, I_VFMADD231PS = 8968, I_VFMADD231SD = 9007, I_VFMADD231SS = 8994, - I_VFMADDSUB132PD = 8360, I_VFMADDSUB132PS = 8344, I_VFMADDSUB213PD = 8640, - I_VFMADDSUB213PS = 8624, I_VFMADDSUB231PD = 8920, I_VFMADDSUB231PS = 8904, - I_VFMSUB132PD = 8473, I_VFMSUB132PS = 8460, I_VFMSUB132SD = 8499, I_VFMSUB132SS = 8486, - I_VFMSUB213PD = 8753, I_VFMSUB213PS = 8740, I_VFMSUB213SD = 8779, I_VFMSUB213SS = 8766, - I_VFMSUB231PD = 9033, I_VFMSUB231PS = 9020, I_VFMSUB231SD = 9059, I_VFMSUB231SS = 9046, - I_VFMSUBADD132PD = 8392, I_VFMSUBADD132PS = 8376, I_VFMSUBADD213PD = 8672, - I_VFMSUBADD213PS = 8656, I_VFMSUBADD231PD = 8952, I_VFMSUBADD231PS = 8936, - I_VFNMADD132PD = 8526, I_VFNMADD132PS = 8512, I_VFNMADD132SD = 8554, I_VFNMADD132SS = 8540, - I_VFNMADD213PD = 8806, I_VFNMADD213PS = 8792, I_VFNMADD213SD = 8834, I_VFNMADD213SS = 8820, - I_VFNMADD231PD = 9086, I_VFNMADD231PS = 9072, I_VFNMADD231SD = 9114, I_VFNMADD231SS = 9100, - I_VFNMSUB132PD = 8582, I_VFNMSUB132PS = 8568, I_VFNMSUB132SD = 8610, I_VFNMSUB132SS = 8596, - I_VFNMSUB213PD = 8862, I_VFNMSUB213PS = 8848, I_VFNMSUB213SD = 8890, I_VFNMSUB213SS = 8876, - I_VFNMSUB231PD = 9142, I_VFNMSUB231PS = 9128, I_VFNMSUB231SD = 9170, I_VFNMSUB231SS = 9156, - I_VHADDPD = 4231, I_VHADDPS = 4240, I_VHSUBPD = 4265, I_VHSUBPS = 4274, I_VINSERTF128 = 9537, - I_VINSERTPS = 9591, I_VLDDQU = 7035, I_VLDMXCSR = 9975, I_VMASKMOVDQU = 7165, - I_VMASKMOVPD = 7983, I_VMASKMOVPS = 7971, I_VMAXPD = 3622, I_VMAXPS = 3614, - I_VMAXSD = 3638, I_VMAXSS = 3630, I_VMCALL = 1735, I_VMCLEAR = 10023, I_VMFUNC = 1815, - I_VMINPD = 3502, I_VMINPS = 3494, I_VMINSD = 3518, I_VMINSS = 3510, I_VMLAUNCH = 1743, - I_VMLOAD = 1845, I_VMMCALL = 1836, I_VMOVAPD = 2510, I_VMOVAPS = 2501, I_VMOVD = 3966, - I_VMOVDDUP = 2268, I_VMOVDQA = 3996, I_VMOVDQU = 4005, I_VMOVHLPS = 2229, - I_VMOVHPD = 2416, I_VMOVHPS = 2407, I_VMOVLHPS = 2397, I_VMOVLPD = 2248, I_VMOVLPS = 2239, - I_VMOVMSKPD = 2870, I_VMOVMSKPS = 2859, I_VMOVNTDQ = 6892, I_VMOVNTDQA = 7939, - I_VMOVNTPD = 2627, I_VMOVNTPS = 2617, I_VMOVQ = 3973, I_VMOVSD = 2177, I_VMOVSHDUP = 2425, - I_VMOVSLDUP = 2257, I_VMOVSS = 2169, I_VMOVUPD = 2160, I_VMOVUPS = 2151, I_VMPSADBW = 9671, - I_VMPTRLD = 10014, I_VMPTRST = 6419, I_VMREAD = 4162, I_VMRESUME = 1753, I_VMRUN = 1829, - I_VMSAVE = 1853, I_VMULPD = 3233, I_VMULPS = 3225, I_VMULSD = 3249, I_VMULSS = 3241, - I_VMWRITE = 4186, I_VMXOFF = 1763, I_VMXON = 10032, I_VORPD = 3100, I_VORPS = 3093, - I_VPABSB = 7729, I_VPABSD = 7759, I_VPABSW = 7744, I_VPACKSSDW = 3893, I_VPACKSSWB = 3725, - I_VPACKUSDW = 7960, I_VPACKUSWB = 3803, I_VPADDB = 7245, I_VPADDD = 7275, - I_VPADDQ = 6522, I_VPADDSB = 6972, I_VPADDSW = 6989, I_VPADDUSW = 6663, I_VPADDW = 7260, - I_VPALIGNR = 9453, I_VPAND = 6647, I_VPANDN = 6706, I_VPAVGB = 6721, I_VPAVGW = 6766, - I_VPBLENDVB = 9726, I_VPBLENDW = 9434, I_VPCLMULQDQ = 9692, I_VPCMPEQB = 4086, - I_VPCMPEQD = 4124, I_VPCMPEQQ = 7919, I_VPCMPEQW = 4105, I_VPCMPESTRI = 9771, - I_VPCMPESTRM = 9748, I_VPCMPGTB = 3745, I_VPCMPGTD = 3783, I_VPCMPGTQ = 8130, - I_VPCMPGTW = 3764, I_VPCMPISTRI = 9817, I_VPCMPISTRM = 9794, I_VPERM2F128 = 9299, - I_VPERMILPD = 7604, I_VPERMILPS = 7593, I_VPEXTRB = 9471, I_VPEXTRD = 9496, - I_VPEXTRQ = 9505, I_VPEXTRW = 6353, I_VPHADDD = 7417, I_VPHADDSW = 7435, I_VPHADDW = 7400, - I_VPHMINPOSUW = 8305, I_VPHSUBD = 7493, I_VPHSUBSW = 7511, I_VPHSUBW = 7476, - I_VPINSRB = 9572, I_VPINSRD = 9618, I_VPINSRQ = 9627, I_VPINSRW = 6336, I_VPMADDUBSW = 7456, - I_VPMADDWD = 7116, I_VPMAXSB = 8216, I_VPMAXSD = 8233, I_VPMAXSW = 7006, I_VPMAXUB = 6690, - I_VPMAXUD = 8267, I_VPMAXUW = 8250, I_VPMINSB = 8148, I_VPMINSD = 8165, I_VPMINSW = 6944, - I_VPMINUB = 6632, I_VPMINUD = 8199, I_VPMINUW = 8182, I_VPMOVMSKB = 6575, - I_VPMOVSXBD = 7798, I_VPMOVSXBQ = 7819, I_VPMOVSXBW = 7777, I_VPMOVSXDQ = 7882, - I_VPMOVSXWD = 7840, I_VPMOVSXWQ = 7861, I_VPMOVZXBD = 8026, I_VPMOVZXBQ = 8047, - I_VPMOVZXBW = 8005, I_VPMOVZXDQ = 8110, I_VPMOVZXWD = 8068, I_VPMOVZXWQ = 8089, - I_VPMULDQ = 7901, I_VPMULHRSW = 7582, I_VPMULHUW = 6783, I_VPMULHW = 6801, - I_VPMULLD = 8284, I_VPMULLW = 6538, I_VPMULUDQ = 7097, I_VPOR = 6958, I_VPSADBW = 7134, - I_VPSHUFB = 7383, I_VPSHUFD = 4048, I_VPSHUFHW = 4057, I_VPSHUFLW = 4067, - I_VPSIGNB = 7529, I_VPSIGND = 7563, I_VPSIGNW = 7546, I_VPSLLD = 7065, I_VPSLLDQ = 9889, - I_VPSLLQ = 7080, I_VPSLLW = 7050, I_VPSRAD = 6751, I_VPSRAW = 6736, I_VPSRLD = 6492, - I_VPSRLDQ = 9872, I_VPSRLQ = 6507, I_VPSRLW = 6477, I_VPSUBB = 7185, I_VPSUBD = 7215, - I_VPSUBQ = 7230, I_VPSUBSB = 6910, I_VPSUBSW = 6927, I_VPSUBUSB = 6595, I_VPSUBUSW = 6614, - I_VPSUBW = 7200, I_VPTEST = 7670, I_VPUNPCKHBW = 3825, I_VPUNPCKHDQ = 3871, - I_VPUNPCKHQDQ = 3941, I_VPUNPCKHWD = 3848, I_VPUNPCKLBW = 3657, I_VPUNPCKLDQ = 3703, - I_VPUNPCKLQDQ = 3916, I_VPUNPCKLWD = 3680, I_VPXOR = 7021, I_VRCPPS = 3001, - I_VRCPSS = 3009, I_VROUNDPD = 9339, I_VROUNDPS = 9320, I_VROUNDSD = 9377, - I_VROUNDSS = 9358, I_VRSQRTPS = 2967, I_VRSQRTSS = 2977, I_VSHUFPD = 6387, - I_VSHUFPS = 6378, I_VSQRTPD = 2922, I_VSQRTPS = 2913, I_VSQRTSD = 2940, I_VSQRTSS = 2931, - I_VSTMXCSR = 10004, I_VSUBPD = 3442, I_VSUBPS = 3434, I_VSUBSD = 3458, I_VSUBSS = 3450, - I_VTESTPD = 7624, I_VTESTPS = 7615, I_VUCOMISD = 2795, I_VUCOMISS = 2785, - I_VUNPCKHPD = 2351, I_VUNPCKHPS = 2340, I_VUNPCKLPD = 2309, I_VUNPCKLPS = 2298, - I_VXORPD = 3129, I_VXORPS = 3121, I_VZEROALL = 4152, I_VZEROUPPER = 4140, - I_WAIT = 10054, I_WBINVD = 561, I_WRFSBASE = 9965, I_WRGSBASE = 9994, I_WRMSR = 586, - I_XABORT = 1007, I_XADD = 946, I_XBEGIN = 1015, I_XCHG = 212, I_XEND = 1823, - I_XGETBV = 1799, I_XLAT = 400, I_XOR = 61, I_XORPD = 3114, I_XORPS = 3107, - I_XRSTOR = 4307, I_XRSTOR64 = 4315, I_XSAVE = 4283, I_XSAVE64 = 4290, I_XSAVEOPT = 4333, - I_XSAVEOPT64 = 4343, I_XSETBV = 1807, I__3DNOW = 10068 + I_JRCXZ = 439, I_JS = 170, I_JZ = 152, I_LAHF = 289, I_LAR = 521, I_LDDQU = 7027, + I_LDMXCSR = 9955, I_LDS = 335, I_LEA = 223, I_LEAVE = 347, I_LES = 330, I_LFENCE = 4298, + I_LFS = 916, I_LGDT = 1702, I_LGS = 921, I_LIDT = 1708, I_LLDT = 1667, I_LMSW = 1720, + I_LODS = 313, I_LOOP = 420, I_LOOPNZ = 405, I_LOOPZ = 413, I_LSL = 526, I_LSS = 906, + I_LTR = 1673, I_LZCNT = 4396, I_MASKMOVDQU = 7152, I_MASKMOVQ = 7142, I_MAXPD = 3592, + I_MAXPS = 3585, I_MAXSD = 3606, I_MAXSS = 3599, I_MFENCE = 4324, I_MINPD = 3472, + I_MINPS = 3465, I_MINSD = 3486, I_MINSS = 3479, I_MONITOR = 1770, I_MOV = 218, + I_MOVAPD = 2492, I_MOVAPS = 2484, I_MOVBE = 9284, I_MOVD = 3953, I_MOVDDUP = 2219, + I_MOVDQ2Q = 6555, I_MOVDQA = 3979, I_MOVDQU = 3987, I_MOVHLPS = 2184, I_MOVHPD = 2378, + I_MOVHPS = 2370, I_MOVLHPS = 2361, I_MOVLPD = 2201, I_MOVLPS = 2193, I_MOVMSKPD = 2848, + I_MOVMSKPS = 2838, I_MOVNTDQ = 6882, I_MOVNTDQA = 7928, I_MOVNTI = 951, I_MOVNTPD = 2589, + I_MOVNTPS = 2580, I_MOVNTQ = 6874, I_MOVNTSD = 2607, I_MOVNTSS = 2598, I_MOVQ = 3959, + I_MOVQ2DQ = 6546, I_MOVS = 295, I_MOVSD = 2143, I_MOVSHDUP = 2386, I_MOVSLDUP = 2209, + I_MOVSS = 2136, I_MOVSX = 938, I_MOVSXD = 10038, I_MOVUPD = 2128, I_MOVUPS = 2120, + I_MOVZX = 926, I_MPSADBW = 9661, I_MUL = 1640, I_MULPD = 3203, I_MULPS = 3196, + I_MULSD = 3217, I_MULSS = 3210, I_MWAIT = 1779, I_NEG = 1635, I_NOP = 580, + I_NOT = 1630, I_OR = 27, I_ORPD = 3086, I_ORPS = 3080, I_OUT = 450, I_OUTS = 128, + I_PABSB = 7721, I_PABSD = 7751, I_PABSW = 7736, I_PACKSSDW = 3882, I_PACKSSWB = 3714, + I_PACKUSDW = 7949, I_PACKUSWB = 3792, I_PADDB = 7237, I_PADDD = 7267, I_PADDQ = 6514, + I_PADDSB = 6963, I_PADDSW = 6980, I_PADDUSB = 6653, I_PADDUSW = 6672, I_PADDW = 7252, + I_PALIGNR = 9443, I_PAND = 6640, I_PANDN = 6698, I_PAUSE = 10046, I_PAVGB = 6713, + I_PAVGUSB = 2111, I_PAVGW = 6758, I_PBLENDVB = 7632, I_PBLENDW = 9424, I_PCLMULQDQ = 9680, + I_PCMPEQB = 4076, I_PCMPEQD = 4114, I_PCMPEQQ = 7909, I_PCMPEQW = 4095, I_PCMPESTRI = 9759, + I_PCMPESTRM = 9736, I_PCMPGTB = 3735, I_PCMPGTD = 3773, I_PCMPGTQ = 8120, + I_PCMPGTW = 3754, I_PCMPISTRI = 9805, I_PCMPISTRM = 9782, I_PEXTRB = 9462, + I_PEXTRD = 9479, I_PEXTRQ = 9487, I_PEXTRW = 6344, I_PF2ID = 1947, I_PF2IW = 1940, + I_PFACC = 2061, I_PFADD = 2010, I_PFCMPEQ = 2068, I_PFCMPGE = 1971, I_PFCMPGT = 2017, + I_PFMAX = 2026, I_PFMIN = 1980, I_PFMUL = 2077, I_PFNACC = 1954, I_PFPNACC = 1962, + I_PFRCP = 1987, I_PFRCPIT1 = 2033, I_PFRCPIT2 = 2084, I_PFRSQIT1 = 2043, I_PFRSQRT = 1994, + I_PFSUB = 2003, I_PFSUBR = 2053, I_PHADDD = 7408, I_PHADDSW = 7425, I_PHADDW = 7391, + I_PHMINPOSUW = 8292, I_PHSUBD = 7484, I_PHSUBSW = 7501, I_PHSUBW = 7467, I_PI2FD = 1933, + I_PI2FW = 1926, I_PINSRB = 9563, I_PINSRD = 9601, I_PINSRQ = 9609, I_PINSRW = 6327, + I_PMADDUBSW = 7444, I_PMADDWD = 7106, I_PMAXSB = 8207, I_PMAXSD = 8224, I_PMAXSW = 6997, + I_PMAXUB = 6681, I_PMAXUD = 8258, I_PMAXUW = 8241, I_PMINSB = 8139, I_PMINSD = 8156, + I_PMINSW = 6935, I_PMINUB = 6623, I_PMINUD = 8190, I_PMINUW = 8173, I_PMOVMSKB = 6564, + I_PMOVSXBD = 7787, I_PMOVSXBQ = 7808, I_PMOVSXBW = 7766, I_PMOVSXDQ = 7871, + I_PMOVSXWD = 7829, I_PMOVSXWQ = 7850, I_PMOVZXBD = 8015, I_PMOVZXBQ = 8036, + I_PMOVZXBW = 7994, I_PMOVZXDQ = 8099, I_PMOVZXWD = 8057, I_PMOVZXWQ = 8078, + I_PMULDQ = 7892, I_PMULHRSW = 7571, I_PMULHRW = 2094, I_PMULHUW = 6773, I_PMULHW = 6792, + I_PMULLD = 8275, I_PMULLW = 6529, I_PMULUDQ = 7087, I_POP = 22, I_POPA = 98, + I_POPCNT = 4371, I_POPF = 277, I_POR = 6952, I_PREFETCH = 1905, I_PREFETCHNTA = 2435, + I_PREFETCHT0 = 2448, I_PREFETCHT1 = 2460, I_PREFETCHT2 = 2472, I_PREFETCHW = 1915, + I_PSADBW = 7125, I_PSHUFB = 7374, I_PSHUFD = 4021, I_PSHUFHW = 4029, I_PSHUFLW = 4038, + I_PSHUFW = 4013, I_PSIGNB = 7520, I_PSIGND = 7554, I_PSIGNW = 7537, I_PSLLD = 7057, + I_PSLLDQ = 9880, I_PSLLQ = 7072, I_PSLLW = 7042, I_PSRAD = 6743, I_PSRAW = 6728, + I_PSRLD = 6484, I_PSRLDQ = 9863, I_PSRLQ = 6499, I_PSRLW = 6469, I_PSUBB = 7177, + I_PSUBD = 7207, I_PSUBQ = 7222, I_PSUBSB = 6901, I_PSUBSW = 6918, I_PSUBUSB = 6585, + I_PSUBUSW = 6604, I_PSUBW = 7192, I_PSWAPD = 2103, I_PTEST = 7662, I_PUNPCKHBW = 3813, + I_PUNPCKHDQ = 3859, I_PUNPCKHQDQ = 3928, I_PUNPCKHWD = 3836, I_PUNPCKLBW = 3645, + I_PUNPCKLDQ = 3691, I_PUNPCKLQDQ = 3903, I_PUNPCKLWD = 3668, I_PUSH = 16, + I_PUSHA = 91, I_PUSHF = 270, I_PXOR = 7014, I_RCL = 976, I_RCPPS = 2986, I_RCPSS = 2993, + I_RCR = 981, I_RDFSBASE = 9915, I_RDGSBASE = 9945, I_RDMSR = 599, I_RDPMC = 606, + I_RDRAND = 10059, I_RDTSC = 592, I_RDTSCP = 1897, I_RET = 325, I_RETF = 354, + I_ROL = 966, I_ROR = 971, I_ROUNDPD = 9329, I_ROUNDPS = 9310, I_ROUNDSD = 9367, + I_ROUNDSS = 9348, I_RSM = 881, I_RSQRTPS = 2948, I_RSQRTSS = 2957, I_SAHF = 283, + I_SAL = 996, I_SALC = 393, I_SAR = 1001, I_SBB = 36, I_SCAS = 319, I_SETA = 806, + I_SETAE = 779, I_SETB = 773, I_SETBE = 799, I_SETG = 858, I_SETGE = 844, I_SETL = 838, + I_SETLE = 851, I_SETNO = 766, I_SETNP = 831, I_SETNS = 818, I_SETNZ = 792, + I_SETO = 760, I_SETP = 825, I_SETS = 812, I_SETZ = 786, I_SFENCE = 4354, I_SGDT = 1690, + I_SHL = 986, I_SHLD = 875, I_SHR = 991, I_SHRD = 891, I_SHUFPD = 6369, I_SHUFPS = 6361, + I_SIDT = 1696, I_SKINIT = 1872, I_SLDT = 1656, I_SMSW = 1714, I_SQRTPD = 2888, + I_SQRTPS = 2880, I_SQRTSD = 2904, I_SQRTSS = 2896, I_STAC = 1792, I_STC = 496, + I_STD = 516, I_STGI = 1860, I_STI = 506, I_STMXCSR = 9984, I_STOS = 307, I_STR = 1662, + I_SUB = 51, I_SUBPD = 3412, I_SUBPS = 3405, I_SUBSD = 3426, I_SUBSS = 3419, + I_SWAPGS = 1889, I_SYSCALL = 531, I_SYSENTER = 613, I_SYSEXIT = 623, I_SYSRET = 546, + I_TEST = 206, I_TZCNT = 4384, I_UCOMISD = 2775, I_UCOMISS = 2766, I_UD2 = 568, + I_UNPCKHPD = 2329, I_UNPCKHPS = 2319, I_UNPCKLPD = 2287, I_UNPCKLPS = 2277, + I_VADDPD = 3172, I_VADDPS = 3164, I_VADDSD = 3188, I_VADDSS = 3180, I_VADDSUBPD = 6447, + I_VADDSUBPS = 6458, I_VAESDEC = 9250, I_VAESDECLAST = 9271, I_VAESENC = 9208, + I_VAESENCLAST = 9229, I_VAESIMC = 9191, I_VAESKEYGENASSIST = 9845, I_VANDNPD = 3071, + I_VANDNPS = 3062, I_VANDPD = 3038, I_VANDPS = 3030, I_VBLENDPD = 9414, I_VBLENDPS = 9395, + I_VBLENDVPD = 9714, I_VBLENDVPS = 9703, I_VBROADCASTF128 = 7705, I_VBROADCASTSD = 7691, + I_VBROADCASTSS = 7677, I_VCMPEQPD = 5121, I_VCMPEQPS = 4719, I_VCMPEQSD = 5925, + I_VCMPEQSS = 5523, I_VCMPEQ_OSPD = 5302, I_VCMPEQ_OSPS = 4900, I_VCMPEQ_OSSD = 6106, + I_VCMPEQ_OSSS = 5704, I_VCMPEQ_UQPD = 5208, I_VCMPEQ_UQPS = 4806, I_VCMPEQ_UQSD = 6012, + I_VCMPEQ_UQSS = 5610, I_VCMPEQ_USPD = 5411, I_VCMPEQ_USPS = 5009, I_VCMPEQ_USSD = 6215, + I_VCMPEQ_USSS = 5813, I_VCMPFALSEPD = 5243, I_VCMPFALSEPS = 4841, I_VCMPFALSESD = 6047, + I_VCMPFALSESS = 5645, I_VCMPFALSE_OSPD = 5452, I_VCMPFALSE_OSPS = 5050, I_VCMPFALSE_OSSD = 6256, + I_VCMPFALSE_OSSS = 5854, I_VCMPGEPD = 5270, I_VCMPGEPS = 4868, I_VCMPGESD = 6074, + I_VCMPGESS = 5672, I_VCMPGE_OQPD = 5482, I_VCMPGE_OQPS = 5080, I_VCMPGE_OQSD = 6286, + I_VCMPGE_OQSS = 5884, I_VCMPGTPD = 5280, I_VCMPGTPS = 4878, I_VCMPGTSD = 6084, + I_VCMPGTSS = 5682, I_VCMPGT_OQPD = 5495, I_VCMPGT_OQPS = 5093, I_VCMPGT_OQSD = 6299, + I_VCMPGT_OQSS = 5897, I_VCMPLEPD = 5141, I_VCMPLEPS = 4739, I_VCMPLESD = 5945, + I_VCMPLESS = 5543, I_VCMPLE_OQPD = 5328, I_VCMPLE_OQPS = 4926, I_VCMPLE_OQSD = 6132, + I_VCMPLE_OQSS = 5730, I_VCMPLTPD = 5131, I_VCMPLTPS = 4729, I_VCMPLTSD = 5935, + I_VCMPLTSS = 5533, I_VCMPLT_OQPD = 5315, I_VCMPLT_OQPS = 4913, I_VCMPLT_OQSD = 6119, + I_VCMPLT_OQSS = 5717, I_VCMPNEQPD = 5164, I_VCMPNEQPS = 4762, I_VCMPNEQSD = 5968, + I_VCMPNEQSS = 5566, I_VCMPNEQ_OQPD = 5256, I_VCMPNEQ_OQPS = 4854, I_VCMPNEQ_OQSD = 6060, + I_VCMPNEQ_OQSS = 5658, I_VCMPNEQ_OSPD = 5468, I_VCMPNEQ_OSPS = 5066, I_VCMPNEQ_OSSD = 6272, + I_VCMPNEQ_OSSS = 5870, I_VCMPNEQ_USPD = 5356, I_VCMPNEQ_USPS = 4954, I_VCMPNEQ_USSD = 6160, + I_VCMPNEQ_USSS = 5758, I_VCMPNGEPD = 5221, I_VCMPNGEPS = 4819, I_VCMPNGESD = 6025, + I_VCMPNGESS = 5623, I_VCMPNGE_UQPD = 5424, I_VCMPNGE_UQPS = 5022, I_VCMPNGE_UQSD = 6228, + I_VCMPNGE_UQSS = 5826, I_VCMPNGTPD = 5232, I_VCMPNGTPS = 4830, I_VCMPNGTSD = 6036, + I_VCMPNGTSS = 5634, I_VCMPNGT_UQPD = 5438, I_VCMPNGT_UQPS = 5036, I_VCMPNGT_UQSD = 6242, + I_VCMPNGT_UQSS = 5840, I_VCMPNLEPD = 5186, I_VCMPNLEPS = 4784, I_VCMPNLESD = 5990, + I_VCMPNLESS = 5588, I_VCMPNLE_UQPD = 5384, I_VCMPNLE_UQPS = 4982, I_VCMPNLE_UQSD = 6188, + I_VCMPNLE_UQSS = 5786, I_VCMPNLTPD = 5175, I_VCMPNLTPS = 4773, I_VCMPNLTSD = 5979, + I_VCMPNLTSS = 5577, I_VCMPNLT_UQPD = 5370, I_VCMPNLT_UQPS = 4968, I_VCMPNLT_UQSD = 6174, + I_VCMPNLT_UQSS = 5772, I_VCMPORDPD = 5197, I_VCMPORDPS = 4795, I_VCMPORDSD = 6001, + I_VCMPORDSS = 5599, I_VCMPORD_SPD = 5398, I_VCMPORD_SPS = 4996, I_VCMPORD_SSD = 6202, + I_VCMPORD_SSS = 5800, I_VCMPTRUEPD = 5290, I_VCMPTRUEPS = 4888, I_VCMPTRUESD = 6094, + I_VCMPTRUESS = 5692, I_VCMPTRUE_USPD = 5508, I_VCMPTRUE_USPS = 5106, I_VCMPTRUE_USSD = 6312, + I_VCMPTRUE_USSS = 5910, I_VCMPUNORDPD = 5151, I_VCMPUNORDPS = 4749, I_VCMPUNORDSD = 5955, + I_VCMPUNORDSS = 5553, I_VCMPUNORD_SPD = 5341, I_VCMPUNORD_SPS = 4939, I_VCMPUNORD_SSD = 6145, + I_VCMPUNORD_SSS = 5743, I_VCOMISD = 2829, I_VCOMISS = 2820, I_VCVTDQ2PD = 6852, + I_VCVTDQ2PS = 3371, I_VCVTPD2DQ = 6863, I_VCVTPD2PS = 3307, I_VCVTPS2DQ = 3382, + I_VCVTPS2PD = 3296, I_VCVTSD2SI = 2755, I_VCVTSD2SS = 3329, I_VCVTSI2SD = 2569, + I_VCVTSI2SS = 2558, I_VCVTSS2SD = 3318, I_VCVTSS2SI = 2744, I_VCVTTPD2DQ = 6840, + I_VCVTTPS2DQ = 3393, I_VCVTTSD2SI = 2692, I_VCVTTSS2SI = 2680, I_VDIVPD = 3561, + I_VDIVPS = 3553, I_VDIVSD = 3577, I_VDIVSS = 3569, I_VDPPD = 9654, I_VDPPS = 9641, + I_VERR = 1678, I_VERW = 1684, I_VEXTRACTF128 = 9549, I_VEXTRACTPS = 9524, + I_VFMADD132PD = 8420, I_VFMADD132PS = 8407, I_VFMADD132SD = 8446, I_VFMADD132SS = 8433, + I_VFMADD213PD = 8700, I_VFMADD213PS = 8687, I_VFMADD213SD = 8726, I_VFMADD213SS = 8713, + I_VFMADD231PD = 8980, I_VFMADD231PS = 8967, I_VFMADD231SD = 9006, I_VFMADD231SS = 8993, + I_VFMADDSUB132PD = 8359, I_VFMADDSUB132PS = 8343, I_VFMADDSUB213PD = 8639, + I_VFMADDSUB213PS = 8623, I_VFMADDSUB231PD = 8919, I_VFMADDSUB231PS = 8903, + I_VFMSUB132PD = 8472, I_VFMSUB132PS = 8459, I_VFMSUB132SD = 8498, I_VFMSUB132SS = 8485, + I_VFMSUB213PD = 8752, I_VFMSUB213PS = 8739, I_VFMSUB213SD = 8778, I_VFMSUB213SS = 8765, + I_VFMSUB231PD = 9032, I_VFMSUB231PS = 9019, I_VFMSUB231SD = 9058, I_VFMSUB231SS = 9045, + I_VFMSUBADD132PD = 8391, I_VFMSUBADD132PS = 8375, I_VFMSUBADD213PD = 8671, + I_VFMSUBADD213PS = 8655, I_VFMSUBADD231PD = 8951, I_VFMSUBADD231PS = 8935, + I_VFNMADD132PD = 8525, I_VFNMADD132PS = 8511, I_VFNMADD132SD = 8553, I_VFNMADD132SS = 8539, + I_VFNMADD213PD = 8805, I_VFNMADD213PS = 8791, I_VFNMADD213SD = 8833, I_VFNMADD213SS = 8819, + I_VFNMADD231PD = 9085, I_VFNMADD231PS = 9071, I_VFNMADD231SD = 9113, I_VFNMADD231SS = 9099, + I_VFNMSUB132PD = 8581, I_VFNMSUB132PS = 8567, I_VFNMSUB132SD = 8609, I_VFNMSUB132SS = 8595, + I_VFNMSUB213PD = 8861, I_VFNMSUB213PS = 8847, I_VFNMSUB213SD = 8889, I_VFNMSUB213SS = 8875, + I_VFNMSUB231PD = 9141, I_VFNMSUB231PS = 9127, I_VFNMSUB231SD = 9169, I_VFNMSUB231SS = 9155, + I_VHADDPD = 4230, I_VHADDPS = 4239, I_VHSUBPD = 4264, I_VHSUBPS = 4273, I_VINSERTF128 = 9536, + I_VINSERTPS = 9590, I_VLDDQU = 7034, I_VLDMXCSR = 9974, I_VMASKMOVDQU = 7164, + I_VMASKMOVPD = 7982, I_VMASKMOVPS = 7970, I_VMAXPD = 3621, I_VMAXPS = 3613, + I_VMAXSD = 3637, I_VMAXSS = 3629, I_VMCALL = 1734, I_VMCLEAR = 10022, I_VMFUNC = 1814, + I_VMINPD = 3501, I_VMINPS = 3493, I_VMINSD = 3517, I_VMINSS = 3509, I_VMLAUNCH = 1742, + I_VMLOAD = 1844, I_VMMCALL = 1835, I_VMOVAPD = 2509, I_VMOVAPS = 2500, I_VMOVD = 3965, + I_VMOVDDUP = 2267, I_VMOVDQA = 3995, I_VMOVDQU = 4004, I_VMOVHLPS = 2228, + I_VMOVHPD = 2415, I_VMOVHPS = 2406, I_VMOVLHPS = 2396, I_VMOVLPD = 2247, I_VMOVLPS = 2238, + I_VMOVMSKPD = 2869, I_VMOVMSKPS = 2858, I_VMOVNTDQ = 6891, I_VMOVNTDQA = 7938, + I_VMOVNTPD = 2626, I_VMOVNTPS = 2616, I_VMOVQ = 3972, I_VMOVSD = 2176, I_VMOVSHDUP = 2424, + I_VMOVSLDUP = 2256, I_VMOVSS = 2168, I_VMOVUPD = 2159, I_VMOVUPS = 2150, I_VMPSADBW = 9670, + I_VMPTRLD = 10013, I_VMPTRST = 6418, I_VMREAD = 4161, I_VMRESUME = 1752, I_VMRUN = 1828, + I_VMSAVE = 1852, I_VMULPD = 3232, I_VMULPS = 3224, I_VMULSD = 3248, I_VMULSS = 3240, + I_VMWRITE = 4185, I_VMXOFF = 1762, I_VMXON = 10031, I_VORPD = 3099, I_VORPS = 3092, + I_VPABSB = 7728, I_VPABSD = 7758, I_VPABSW = 7743, I_VPACKSSDW = 3892, I_VPACKSSWB = 3724, + I_VPACKUSDW = 7959, I_VPACKUSWB = 3802, I_VPADDB = 7244, I_VPADDD = 7274, + I_VPADDQ = 6521, I_VPADDSB = 6971, I_VPADDSW = 6988, I_VPADDUSW = 6662, I_VPADDW = 7259, + I_VPALIGNR = 9452, I_VPAND = 6646, I_VPANDN = 6705, I_VPAVGB = 6720, I_VPAVGW = 6765, + I_VPBLENDVB = 9725, I_VPBLENDW = 9433, I_VPCLMULQDQ = 9691, I_VPCMPEQB = 4085, + I_VPCMPEQD = 4123, I_VPCMPEQQ = 7918, I_VPCMPEQW = 4104, I_VPCMPESTRI = 9770, + I_VPCMPESTRM = 9747, I_VPCMPGTB = 3744, I_VPCMPGTD = 3782, I_VPCMPGTQ = 8129, + I_VPCMPGTW = 3763, I_VPCMPISTRI = 9816, I_VPCMPISTRM = 9793, I_VPERM2F128 = 9298, + I_VPERMILPD = 7603, I_VPERMILPS = 7592, I_VPEXTRB = 9470, I_VPEXTRD = 9495, + I_VPEXTRQ = 9504, I_VPEXTRW = 6352, I_VPHADDD = 7416, I_VPHADDSW = 7434, I_VPHADDW = 7399, + I_VPHMINPOSUW = 8304, I_VPHSUBD = 7492, I_VPHSUBSW = 7510, I_VPHSUBW = 7475, + I_VPINSRB = 9571, I_VPINSRD = 9617, I_VPINSRQ = 9626, I_VPINSRW = 6335, I_VPMADDUBSW = 7455, + I_VPMADDWD = 7115, I_VPMAXSB = 8215, I_VPMAXSD = 8232, I_VPMAXSW = 7005, I_VPMAXUB = 6689, + I_VPMAXUD = 8266, I_VPMAXUW = 8249, I_VPMINSB = 8147, I_VPMINSD = 8164, I_VPMINSW = 6943, + I_VPMINUB = 6631, I_VPMINUD = 8198, I_VPMINUW = 8181, I_VPMOVMSKB = 6574, + I_VPMOVSXBD = 7797, I_VPMOVSXBQ = 7818, I_VPMOVSXBW = 7776, I_VPMOVSXDQ = 7881, + I_VPMOVSXWD = 7839, I_VPMOVSXWQ = 7860, I_VPMOVZXBD = 8025, I_VPMOVZXBQ = 8046, + I_VPMOVZXBW = 8004, I_VPMOVZXDQ = 8109, I_VPMOVZXWD = 8067, I_VPMOVZXWQ = 8088, + I_VPMULDQ = 7900, I_VPMULHRSW = 7581, I_VPMULHUW = 6782, I_VPMULHW = 6800, + I_VPMULLD = 8283, I_VPMULLW = 6537, I_VPMULUDQ = 7096, I_VPOR = 6957, I_VPSADBW = 7133, + I_VPSHUFB = 7382, I_VPSHUFD = 4047, I_VPSHUFHW = 4056, I_VPSHUFLW = 4066, + I_VPSIGNB = 7528, I_VPSIGND = 7562, I_VPSIGNW = 7545, I_VPSLLD = 7064, I_VPSLLDQ = 9888, + I_VPSLLQ = 7079, I_VPSLLW = 7049, I_VPSRAD = 6750, I_VPSRAW = 6735, I_VPSRLD = 6491, + I_VPSRLDQ = 9871, I_VPSRLQ = 6506, I_VPSRLW = 6476, I_VPSUBB = 7184, I_VPSUBD = 7214, + I_VPSUBQ = 7229, I_VPSUBSB = 6909, I_VPSUBSW = 6926, I_VPSUBUSB = 6594, I_VPSUBUSW = 6613, + I_VPSUBW = 7199, I_VPTEST = 7669, I_VPUNPCKHBW = 3824, I_VPUNPCKHDQ = 3870, + I_VPUNPCKHQDQ = 3940, I_VPUNPCKHWD = 3847, I_VPUNPCKLBW = 3656, I_VPUNPCKLDQ = 3702, + I_VPUNPCKLQDQ = 3915, I_VPUNPCKLWD = 3679, I_VPXOR = 7020, I_VRCPPS = 3000, + I_VRCPSS = 3008, I_VROUNDPD = 9338, I_VROUNDPS = 9319, I_VROUNDSD = 9376, + I_VROUNDSS = 9357, I_VRSQRTPS = 2966, I_VRSQRTSS = 2976, I_VSHUFPD = 6386, + I_VSHUFPS = 6377, I_VSQRTPD = 2921, I_VSQRTPS = 2912, I_VSQRTSD = 2939, I_VSQRTSS = 2930, + I_VSTMXCSR = 10003, I_VSUBPD = 3441, I_VSUBPS = 3433, I_VSUBSD = 3457, I_VSUBSS = 3449, + I_VTESTPD = 7623, I_VTESTPS = 7614, I_VUCOMISD = 2794, I_VUCOMISS = 2784, + I_VUNPCKHPD = 2350, I_VUNPCKHPS = 2339, I_VUNPCKLPD = 2308, I_VUNPCKLPS = 2297, + I_VXORPD = 3128, I_VXORPS = 3120, I_VZEROALL = 4151, I_VZEROUPPER = 4139, + I_WAIT = 10053, I_WBINVD = 560, I_WRFSBASE = 9964, I_WRGSBASE = 9993, I_WRMSR = 585, + I_XABORT = 1006, I_XADD = 945, I_XBEGIN = 1014, I_XCHG = 212, I_XEND = 1822, + I_XGETBV = 1798, I_XLAT = 399, I_XOR = 61, I_XORPD = 3113, I_XORPS = 3106, + I_XRSTOR = 4306, I_XRSTOR64 = 4314, I_XSAVE = 4282, I_XSAVE64 = 4289, I_XSAVEOPT = 4332, + I_XSAVEOPT64 = 4342, I_XSETBV = 1806, I__3DNOW = 10067 } _InstructionType; typedef enum { diff --git a/NativeCore/Dependencies/distorm/src/config.h b/NativeCore/Dependencies/distorm/src/config.h index e78dba36..6febad67 100644 --- a/NativeCore/Dependencies/distorm/src/config.h +++ b/NativeCore/Dependencies/distorm/src/config.h @@ -13,7 +13,7 @@ This library is licensed under the BSD license. See the file COPYING. #define CONFIG_H /* diStorm version number. */ -#define __DISTORMV__ 0x030502 +#define __DISTORMV__ 0x030503 #include /* memset, memcpy - can be easily self implemented for libc independency. */ diff --git a/NativeCore/Dependencies/distorm/src/insts.c b/NativeCore/Dependencies/distorm/src/insts.c index 7aab70dc..688558c1 100644 --- a/NativeCore/Dependencies/distorm/src/insts.c +++ b/NativeCore/Dependencies/distorm/src/insts.c @@ -15,15 +15,15 @@ This library is licensed under the BSD license. See the file COPYING. /* - * GENERATED BY disOps at Sat Apr 3 17:52:58 2021 + * GENERATED BY disOps at Fri Dec 17 10:22:38 2021 */ -_InstInfo II_MOVSXD = /*II*/ {0x1d7, 10039}; -_InstInfo II_NOP = /*II*/ {0x53, 581}; -_InstInfo II_PAUSE = /*II*/ {0x91, 10047}; -_InstInfo II_WAIT = /*II*/ {0x53, 10054}; -_InstInfo II_RDRAND = /*II*/ {0x1d8, 10060}; -_InstInfo II_3DNOW = /*II*/ {0x1d9, 10068}; +_InstInfo II_MOVSXD = /*II*/ {0x1d7, 10038}; +_InstInfo II_NOP = /*II*/ {0x53, 580}; +_InstInfo II_PAUSE = /*II*/ {0x91, 10046}; +_InstInfo II_WAIT = /*II*/ {0x53, 10053}; +_InstInfo II_RDRAND = /*II*/ {0x1d8, 10059}; +_InstInfo II_3DNOW = /*II*/ {0x1d9, 10067}; _iflags FlagsTable[101] = { 0x80000011, @@ -316,75 +316,75 @@ _InstInfo InstInfos[1248] = { /*II_C9*/ {0x6a, 347}, /*II_CA*/ {0x6b, 354}, /*II_CB*/ {0x6c, 354}, - /*II_CC*/ {0x6d, 360}, - /*II_CD*/ {0x6e, 367}, - /*II_CE*/ {0x6f, 372}, - /*II_CF*/ {0x70, 378}, - /*II_D4*/ {0x71, 384}, - /*II_D5*/ {0x71, 389}, - /*II_D6*/ {0x72, 394}, - /*II_D7*/ {0x73, 400}, - /*II_E0*/ {0x74, 406}, - /*II_E1*/ {0x74, 414}, - /*II_E2*/ {0x75, 421}, - /*II_E4*/ {0x77, 447}, - /*II_E5*/ {0x78, 447}, - /*II_E6*/ {0x79, 451}, - /*II_E7*/ {0x7a, 451}, - /*II_E8*/ {0x7b, 456}, - /*II_E9*/ {0x7c, 462}, - /*II_EA*/ {0x7d, 467}, - /*II_EB*/ {0x7e, 462}, - /*II_EC*/ {0x7f, 447}, - /*II_ED*/ {0x80, 447}, - /*II_EE*/ {0x81, 451}, - /*II_EF*/ {0x82, 451}, - /*II_F1*/ {0x6d, 476}, - /*II_F4*/ {0x83, 482}, - /*II_F5*/ {0x84, 487}, - /*II_F8*/ {0x84, 492}, - /*II_F9*/ {0x84, 497}, - /*II_FA*/ {0x85, 502}, - /*II_FB*/ {0x85, 507}, - /*II_FC*/ {0x86, 512}, - /*II_FD*/ {0x86, 517}, - /*II_0F_02*/ {0x87, 522}, - /*II_0F_03*/ {0x87, 527}, - /*II_0F_05*/ {0x88, 532}, - /*II_0F_06*/ {0x89, 541}, - /*II_0F_07*/ {0x88, 547}, - /*II_0F_08*/ {0x89, 555}, - /*II_0F_09*/ {0x89, 561}, - /*II_0F_0B*/ {0x8a, 569}, - /*II_0F_0E*/ {0x8b, 574}, - /*II_0F_1F*/ {0x8c, 581}, + /*II_CC*/ {0x53, 360}, + /*II_CD*/ {0x6d, 366}, + /*II_CE*/ {0x6e, 371}, + /*II_CF*/ {0x6f, 377}, + /*II_D4*/ {0x70, 383}, + /*II_D5*/ {0x70, 388}, + /*II_D6*/ {0x71, 393}, + /*II_D7*/ {0x72, 399}, + /*II_E0*/ {0x73, 405}, + /*II_E1*/ {0x73, 413}, + /*II_E2*/ {0x74, 420}, + /*II_E4*/ {0x76, 446}, + /*II_E5*/ {0x77, 446}, + /*II_E6*/ {0x78, 450}, + /*II_E7*/ {0x79, 450}, + /*II_E8*/ {0x7a, 455}, + /*II_E9*/ {0x7b, 461}, + /*II_EA*/ {0x7c, 466}, + /*II_EB*/ {0x7d, 461}, + /*II_EC*/ {0x7e, 446}, + /*II_ED*/ {0x7f, 446}, + /*II_EE*/ {0x80, 450}, + /*II_EF*/ {0x81, 450}, + /*II_F1*/ {0x82, 475}, + /*II_F4*/ {0x83, 481}, + /*II_F5*/ {0x84, 486}, + /*II_F8*/ {0x84, 491}, + /*II_F9*/ {0x84, 496}, + /*II_FA*/ {0x85, 501}, + /*II_FB*/ {0x85, 506}, + /*II_FC*/ {0x86, 511}, + /*II_FD*/ {0x86, 516}, + /*II_0F_02*/ {0x87, 521}, + /*II_0F_03*/ {0x87, 526}, + /*II_0F_05*/ {0x88, 531}, + /*II_0F_06*/ {0x89, 540}, + /*II_0F_07*/ {0x88, 546}, + /*II_0F_08*/ {0x89, 554}, + /*II_0F_09*/ {0x89, 560}, + /*II_0F_0B*/ {0x8a, 568}, + /*II_0F_0E*/ {0x8b, 573}, + /*II_0F_1F*/ {0x8c, 580}, /*II_0F_20*/ {0x8d, 218}, /*II_0F_21*/ {0x8e, 218}, /*II_0F_22*/ {0x8f, 218}, /*II_0F_23*/ {0x90, 218}, - /*II_0F_30*/ {0x89, 586}, - /*II_0F_31*/ {0x89, 593}, - /*II_0F_32*/ {0x89, 600}, - /*II_0F_33*/ {0x89, 607}, - /*II_0F_34*/ {0x88, 614}, - /*II_0F_35*/ {0x88, 624}, - /*II_0F_37*/ {0x91, 633}, - /*II_0F_40*/ {0x92, 641}, - /*II_0F_41*/ {0x92, 648}, - /*II_0F_42*/ {0x93, 656}, - /*II_0F_43*/ {0x93, 663}, - /*II_0F_44*/ {0x94, 671}, - /*II_0F_45*/ {0x94, 678}, - /*II_0F_46*/ {0x95, 686}, - /*II_0F_47*/ {0x95, 694}, - /*II_0F_48*/ {0x96, 701}, - /*II_0F_49*/ {0x96, 708}, - /*II_0F_4A*/ {0x97, 716}, - /*II_0F_4B*/ {0x97, 723}, - /*II_0F_4C*/ {0x98, 731}, - /*II_0F_4D*/ {0x98, 738}, - /*II_0F_4E*/ {0x99, 746}, - /*II_0F_4F*/ {0x99, 754}, + /*II_0F_30*/ {0x89, 585}, + /*II_0F_31*/ {0x89, 592}, + /*II_0F_32*/ {0x89, 599}, + /*II_0F_33*/ {0x89, 606}, + /*II_0F_34*/ {0x88, 613}, + /*II_0F_35*/ {0x88, 623}, + /*II_0F_37*/ {0x91, 632}, + /*II_0F_40*/ {0x92, 640}, + /*II_0F_41*/ {0x92, 647}, + /*II_0F_42*/ {0x93, 655}, + /*II_0F_43*/ {0x93, 662}, + /*II_0F_44*/ {0x94, 670}, + /*II_0F_45*/ {0x94, 677}, + /*II_0F_46*/ {0x95, 685}, + /*II_0F_47*/ {0x95, 693}, + /*II_0F_48*/ {0x96, 700}, + /*II_0F_49*/ {0x96, 707}, + /*II_0F_4A*/ {0x97, 715}, + /*II_0F_4B*/ {0x97, 722}, + /*II_0F_4C*/ {0x98, 730}, + /*II_0F_4D*/ {0x98, 737}, + /*II_0F_4E*/ {0x99, 745}, + /*II_0F_4F*/ {0x99, 753}, /*II_0F_80*/ {0x9a, 134}, /*II_0F_81*/ {0x9a, 138}, /*II_0F_82*/ {0x9b, 143}, @@ -401,54 +401,54 @@ _InstInfo InstInfos[1248] = { /*II_0F_8D*/ {0xa0, 192}, /*II_0F_8E*/ {0xa1, 197}, /*II_0F_8F*/ {0xa1, 202}, - /*II_0F_90*/ {0xa2, 761}, - /*II_0F_91*/ {0xa2, 767}, - /*II_0F_92*/ {0xa3, 774}, - /*II_0F_93*/ {0xa3, 780}, - /*II_0F_94*/ {0xa4, 787}, - /*II_0F_95*/ {0xa4, 793}, - /*II_0F_96*/ {0xa5, 800}, - /*II_0F_97*/ {0xa5, 807}, - /*II_0F_98*/ {0xa6, 813}, - /*II_0F_99*/ {0xa6, 819}, - /*II_0F_9A*/ {0xa7, 826}, - /*II_0F_9B*/ {0xa7, 832}, - /*II_0F_9C*/ {0xa8, 839}, - /*II_0F_9D*/ {0xa8, 845}, - /*II_0F_9E*/ {0xa9, 852}, - /*II_0F_9F*/ {0xa9, 859}, + /*II_0F_90*/ {0xa2, 760}, + /*II_0F_91*/ {0xa2, 766}, + /*II_0F_92*/ {0xa3, 773}, + /*II_0F_93*/ {0xa3, 779}, + /*II_0F_94*/ {0xa4, 786}, + /*II_0F_95*/ {0xa4, 792}, + /*II_0F_96*/ {0xa5, 799}, + /*II_0F_97*/ {0xa5, 806}, + /*II_0F_98*/ {0xa6, 812}, + /*II_0F_99*/ {0xa6, 818}, + /*II_0F_9A*/ {0xa7, 825}, + /*II_0F_9B*/ {0xa7, 831}, + /*II_0F_9C*/ {0xa8, 838}, + /*II_0F_9D*/ {0xa8, 844}, + /*II_0F_9E*/ {0xa9, 851}, + /*II_0F_9F*/ {0xa9, 858}, /*II_0F_A0*/ {0xaa, 16}, /*II_0F_A1*/ {0xab, 22}, - /*II_0F_A2*/ {0x91, 865}, - /*II_0F_A3*/ {0xac, 872}, + /*II_0F_A2*/ {0x91, 864}, + /*II_0F_A3*/ {0xac, 871}, /*II_0F_A8*/ {0xae, 16}, /*II_0F_A9*/ {0xaf, 22}, - /*II_0F_AA*/ {0xb0, 882}, - /*II_0F_AB*/ {0xb1, 887}, + /*II_0F_AA*/ {0xb0, 881}, + /*II_0F_AB*/ {0xb1, 886}, /*II_0F_AF*/ {0xb2, 117}, - /*II_0F_B0*/ {0xb3, 898}, - /*II_0F_B1*/ {0xb4, 898}, - /*II_0F_B2*/ {0xb5, 907}, - /*II_0F_B3*/ {0xb1, 912}, - /*II_0F_B4*/ {0xb5, 917}, - /*II_0F_B5*/ {0xb5, 922}, - /*II_0F_B6*/ {0xb6, 927}, - /*II_0F_B7*/ {0xb7, 927}, - /*II_0F_B9*/ {0x8a, 569}, - /*II_0F_BB*/ {0xb1, 934}, - /*II_0F_BE*/ {0xb6, 939}, - /*II_0F_BF*/ {0xb7, 939}, - /*II_0F_C0*/ {0xb3, 946}, - /*II_0F_C1*/ {0xb4, 946}, - /*II_0F_C3*/ {0xb8, 952}, - /*II_0F_C8*/ {0xb9, 960}, - /*II_0F_C8*/ {0xb9, 960}, - /*II_0F_C8*/ {0xb9, 960}, - /*II_0F_C8*/ {0xb9, 960}, - /*II_0F_C8*/ {0xb9, 960}, - /*II_0F_C8*/ {0xb9, 960}, - /*II_0F_C8*/ {0xb9, 960}, - /*II_0F_C8*/ {0xb9, 960}, + /*II_0F_B0*/ {0xb3, 897}, + /*II_0F_B1*/ {0xb4, 897}, + /*II_0F_B2*/ {0xb5, 906}, + /*II_0F_B3*/ {0xb1, 911}, + /*II_0F_B4*/ {0xb5, 916}, + /*II_0F_B5*/ {0xb5, 921}, + /*II_0F_B6*/ {0xb6, 926}, + /*II_0F_B7*/ {0xb7, 926}, + /*II_0F_B9*/ {0x8a, 568}, + /*II_0F_BB*/ {0xb1, 933}, + /*II_0F_BE*/ {0xb6, 938}, + /*II_0F_BF*/ {0xb7, 938}, + /*II_0F_C0*/ {0xb3, 945}, + /*II_0F_C1*/ {0xb4, 945}, + /*II_0F_C3*/ {0xb8, 951}, + /*II_0F_C8*/ {0xb9, 959}, + /*II_0F_C8*/ {0xb9, 959}, + /*II_0F_C8*/ {0xb9, 959}, + /*II_0F_C8*/ {0xb9, 959}, + /*II_0F_C8*/ {0xb9, 959}, + /*II_0F_C8*/ {0xb9, 959}, + /*II_0F_C8*/ {0xb9, 959}, + /*II_0F_C8*/ {0xb9, 959}, /*II_80_00*/ {0xba, 11}, /*II_80_01*/ {0xbb, 27}, /*II_80_02*/ {0xbc, 31}, @@ -482,907 +482,907 @@ _InstInfo InstInfos[1248] = { /*II_83_06*/ {0xd0, 61}, /*II_83_07*/ {0xd1, 71}, /*II_8F_00*/ {0xd2, 22}, - /*II_C0_00*/ {0xd3, 967}, - /*II_C0_01*/ {0xd3, 972}, - /*II_C0_02*/ {0xd4, 977}, - /*II_C0_03*/ {0xd4, 982}, - /*II_C0_04*/ {0xd5, 987}, - /*II_C0_05*/ {0xd5, 992}, - /*II_C0_06*/ {0xd5, 997}, - /*II_C0_07*/ {0xd5, 1002}, - /*II_C1_00*/ {0xd6, 967}, - /*II_C1_01*/ {0xd6, 972}, - /*II_C1_02*/ {0xd7, 977}, - /*II_C1_03*/ {0xd7, 982}, - /*II_C1_04*/ {0xd8, 987}, - /*II_C1_05*/ {0xd8, 992}, - /*II_C1_06*/ {0xd8, 997}, - /*II_C1_07*/ {0xd8, 1002}, + /*II_C0_00*/ {0xd3, 966}, + /*II_C0_01*/ {0xd3, 971}, + /*II_C0_02*/ {0xd4, 976}, + /*II_C0_03*/ {0xd4, 981}, + /*II_C0_04*/ {0xd5, 986}, + /*II_C0_05*/ {0xd5, 991}, + /*II_C0_06*/ {0xd5, 996}, + /*II_C0_07*/ {0xd5, 1001}, + /*II_C1_00*/ {0xd6, 966}, + /*II_C1_01*/ {0xd6, 971}, + /*II_C1_02*/ {0xd7, 976}, + /*II_C1_03*/ {0xd7, 981}, + /*II_C1_04*/ {0xd8, 986}, + /*II_C1_05*/ {0xd8, 991}, + /*II_C1_06*/ {0xd8, 996}, + /*II_C1_07*/ {0xd8, 1001}, /*II_C6_00*/ {0xd9, 218}, - /*II_C6_F8*/ {0xda, 1007}, + /*II_C6_F8*/ {0xda, 1006}, /*II_C7_00*/ {0xdb, 218}, - /*II_C7_F8*/ {0xdc, 1015}, - /*II_D0_00*/ {0xdd, 967}, - /*II_D0_01*/ {0xdd, 972}, - /*II_D0_02*/ {0xde, 977}, - /*II_D0_03*/ {0xde, 982}, - /*II_D0_04*/ {0xdf, 987}, - /*II_D0_05*/ {0xdf, 992}, - /*II_D0_06*/ {0xdf, 997}, - /*II_D0_07*/ {0xdf, 1002}, - /*II_D1_00*/ {0xe0, 967}, - /*II_D1_01*/ {0xe0, 972}, - /*II_D1_02*/ {0xe1, 977}, - /*II_D1_03*/ {0xe1, 982}, - /*II_D1_04*/ {0xe2, 987}, - /*II_D1_05*/ {0xe2, 992}, - /*II_D1_06*/ {0xe2, 997}, - /*II_D1_07*/ {0xe2, 1002}, - /*II_D2_00*/ {0xe3, 967}, - /*II_D2_01*/ {0xe3, 972}, - /*II_D2_02*/ {0xe4, 977}, - /*II_D2_03*/ {0xe4, 982}, - /*II_D2_04*/ {0xe5, 987}, - /*II_D2_05*/ {0xe5, 992}, - /*II_D2_06*/ {0xe5, 997}, - /*II_D2_07*/ {0xe5, 1002}, - /*II_D3_00*/ {0xe6, 967}, - /*II_D3_01*/ {0xe6, 972}, - /*II_D3_02*/ {0xe7, 977}, - /*II_D3_03*/ {0xe7, 982}, - /*II_D3_04*/ {0xe8, 987}, - /*II_D3_05*/ {0xe8, 992}, - /*II_D3_06*/ {0xe8, 997}, - /*II_D3_07*/ {0xe8, 1002}, - /*II_D8_00*/ {0xe9, 1023}, - /*II_D8_01*/ {0xe9, 1029}, - /*II_D8_02*/ {0xe9, 1035}, - /*II_D8_03*/ {0xe9, 1041}, - /*II_D8_04*/ {0xe9, 1048}, - /*II_D8_05*/ {0xe9, 1054}, - /*II_D8_06*/ {0xe9, 1061}, - /*II_D8_07*/ {0xe9, 1067}, - /*II_D8_C0*/ {0xea, 1023}, - /*II_D8_C0*/ {0xea, 1023}, - /*II_D8_C0*/ {0xea, 1023}, - /*II_D8_C0*/ {0xea, 1023}, - /*II_D8_C0*/ {0xea, 1023}, - /*II_D8_C0*/ {0xea, 1023}, - /*II_D8_C0*/ {0xea, 1023}, - /*II_D8_C0*/ {0xea, 1023}, - /*II_D8_C8*/ {0xea, 1029}, - /*II_D8_C8*/ {0xea, 1029}, - /*II_D8_C8*/ {0xea, 1029}, - /*II_D8_C8*/ {0xea, 1029}, - /*II_D8_C8*/ {0xea, 1029}, - /*II_D8_C8*/ {0xea, 1029}, - /*II_D8_C8*/ {0xea, 1029}, - /*II_D8_C8*/ {0xea, 1029}, - /*II_D8_D0*/ {0xeb, 1035}, - /*II_D8_D0*/ {0xeb, 1035}, - /*II_D8_D0*/ {0xeb, 1035}, - /*II_D8_D0*/ {0xeb, 1035}, - /*II_D8_D0*/ {0xeb, 1035}, - /*II_D8_D0*/ {0xeb, 1035}, - /*II_D8_D0*/ {0xeb, 1035}, - /*II_D8_D0*/ {0xeb, 1035}, - /*II_D8_D8*/ {0xeb, 1041}, - /*II_D8_D9*/ {0xec, 1041}, - /*II_D8_D8*/ {0xeb, 1041}, - /*II_D8_D8*/ {0xeb, 1041}, - /*II_D8_D8*/ {0xeb, 1041}, - /*II_D8_D8*/ {0xeb, 1041}, - /*II_D8_D8*/ {0xeb, 1041}, - /*II_D8_D8*/ {0xeb, 1041}, - /*II_D8_E0*/ {0xea, 1048}, - /*II_D8_E0*/ {0xea, 1048}, - /*II_D8_E0*/ {0xea, 1048}, - /*II_D8_E0*/ {0xea, 1048}, - /*II_D8_E0*/ {0xea, 1048}, - /*II_D8_E0*/ {0xea, 1048}, - /*II_D8_E0*/ {0xea, 1048}, - /*II_D8_E0*/ {0xea, 1048}, - /*II_D8_E8*/ {0xea, 1054}, - /*II_D8_E8*/ {0xea, 1054}, - /*II_D8_E8*/ {0xea, 1054}, - /*II_D8_E8*/ {0xea, 1054}, - /*II_D8_E8*/ {0xea, 1054}, - /*II_D8_E8*/ {0xea, 1054}, - /*II_D8_E8*/ {0xea, 1054}, - /*II_D8_E8*/ {0xea, 1054}, - /*II_D8_F0*/ {0xea, 1061}, - /*II_D8_F0*/ {0xea, 1061}, - /*II_D8_F0*/ {0xea, 1061}, - /*II_D8_F0*/ {0xea, 1061}, - /*II_D8_F0*/ {0xea, 1061}, - /*II_D8_F0*/ {0xea, 1061}, - /*II_D8_F0*/ {0xea, 1061}, - /*II_D8_F0*/ {0xea, 1061}, - /*II_D8_F8*/ {0xea, 1067}, - /*II_D8_F8*/ {0xea, 1067}, - /*II_D8_F8*/ {0xea, 1067}, - /*II_D8_F8*/ {0xea, 1067}, - /*II_D8_F8*/ {0xea, 1067}, - /*II_D8_F8*/ {0xea, 1067}, - /*II_D8_F8*/ {0xea, 1067}, - /*II_D8_F8*/ {0xea, 1067}, - /*II_D9_00*/ {0xe9, 1074}, - /*II_D9_02*/ {0xed, 1079}, - /*II_D9_03*/ {0xed, 1084}, - /*II_D9_04*/ {0xee, 1090}, - /*II_D9_05*/ {0xef, 1098}, - /*II_D9_C0*/ {0xeb, 1074}, - /*II_D9_C0*/ {0xeb, 1074}, - /*II_D9_C0*/ {0xeb, 1074}, - /*II_D9_C0*/ {0xeb, 1074}, - /*II_D9_C0*/ {0xeb, 1074}, - /*II_D9_C0*/ {0xeb, 1074}, - /*II_D9_C0*/ {0xeb, 1074}, - /*II_D9_C0*/ {0xeb, 1074}, - /*II_D9_C8*/ {0xeb, 1105}, - /*II_D9_C9*/ {0xec, 1105}, - /*II_D9_C8*/ {0xeb, 1105}, - /*II_D9_C8*/ {0xeb, 1105}, - /*II_D9_C8*/ {0xeb, 1105}, - /*II_D9_C8*/ {0xeb, 1105}, - /*II_D9_C8*/ {0xeb, 1105}, - /*II_D9_C8*/ {0xeb, 1105}, - /*II_D9_D0*/ {0xec, 1111}, - /*II_D9_E0*/ {0xec, 1117}, - /*II_D9_E1*/ {0xec, 1123}, - /*II_D9_E4*/ {0xec, 1129}, - /*II_D9_E5*/ {0xec, 1135}, - /*II_D9_E8*/ {0xec, 1141}, - /*II_D9_E9*/ {0xec, 1147}, - /*II_D9_EA*/ {0xec, 1155}, - /*II_D9_EB*/ {0xec, 1163}, - /*II_D9_EC*/ {0xec, 1170}, - /*II_D9_ED*/ {0xec, 1178}, - /*II_D9_EE*/ {0xec, 1186}, - /*II_D9_F0*/ {0xec, 1192}, - /*II_D9_F1*/ {0xec, 1199}, - /*II_D9_F2*/ {0xec, 1206}, - /*II_D9_F3*/ {0xec, 1213}, - /*II_D9_F4*/ {0xec, 1221}, - /*II_D9_F5*/ {0xec, 1230}, - /*II_D9_F6*/ {0xec, 1238}, - /*II_D9_F7*/ {0xec, 1247}, - /*II_D9_F8*/ {0xec, 1256}, - /*II_D9_F9*/ {0xec, 1263}, - /*II_D9_FA*/ {0xec, 1272}, - /*II_D9_FB*/ {0xec, 1279}, - /*II_D9_FC*/ {0xec, 1288}, - /*II_D9_FD*/ {0xec, 1297}, - /*II_D9_FE*/ {0xec, 1305}, - /*II_D9_FF*/ {0xec, 1311}, - /*II_DA_00*/ {0xe9, 1317}, - /*II_DA_01*/ {0xe9, 1324}, - /*II_DA_02*/ {0xe9, 1331}, - /*II_DA_03*/ {0xe9, 1338}, - /*II_DA_04*/ {0xe9, 1346}, - /*II_DA_05*/ {0xe9, 1353}, - /*II_DA_06*/ {0xe9, 1361}, - /*II_DA_07*/ {0xe9, 1368}, - /*II_DA_C0*/ {0xf0, 1376}, - /*II_DA_C0*/ {0xf0, 1376}, - /*II_DA_C0*/ {0xf0, 1376}, - /*II_DA_C0*/ {0xf0, 1376}, - /*II_DA_C0*/ {0xf0, 1376}, - /*II_DA_C0*/ {0xf0, 1376}, - /*II_DA_C0*/ {0xf0, 1376}, - /*II_DA_C0*/ {0xf0, 1376}, - /*II_DA_C8*/ {0xf1, 1384}, - /*II_DA_C8*/ {0xf1, 1384}, - /*II_DA_C8*/ {0xf1, 1384}, - /*II_DA_C8*/ {0xf1, 1384}, - /*II_DA_C8*/ {0xf1, 1384}, - /*II_DA_C8*/ {0xf1, 1384}, - /*II_DA_C8*/ {0xf1, 1384}, - /*II_DA_C8*/ {0xf1, 1384}, - /*II_DA_D0*/ {0xf2, 1392}, - /*II_DA_D0*/ {0xf2, 1392}, - /*II_DA_D0*/ {0xf2, 1392}, - /*II_DA_D0*/ {0xf2, 1392}, - /*II_DA_D0*/ {0xf2, 1392}, - /*II_DA_D0*/ {0xf2, 1392}, - /*II_DA_D0*/ {0xf2, 1392}, - /*II_DA_D0*/ {0xf2, 1392}, - /*II_DA_D8*/ {0xf3, 1401}, - /*II_DA_D8*/ {0xf3, 1401}, - /*II_DA_D8*/ {0xf3, 1401}, - /*II_DA_D8*/ {0xf3, 1401}, - /*II_DA_D8*/ {0xf3, 1401}, - /*II_DA_D8*/ {0xf3, 1401}, - /*II_DA_D8*/ {0xf3, 1401}, - /*II_DA_D8*/ {0xf3, 1401}, - /*II_DA_E9*/ {0xec, 1409}, - /*II_DB_00*/ {0xe9, 1418}, - /*II_DB_01*/ {0xf4, 1424}, - /*II_DB_02*/ {0xed, 1432}, - /*II_DB_03*/ {0xed, 1438}, - /*II_DB_05*/ {0xf5, 1074}, - /*II_DB_07*/ {0xf6, 1084}, - /*II_DB_C0*/ {0xf0, 1445}, - /*II_DB_C0*/ {0xf0, 1445}, - /*II_DB_C0*/ {0xf0, 1445}, - /*II_DB_C0*/ {0xf0, 1445}, - /*II_DB_C0*/ {0xf0, 1445}, - /*II_DB_C0*/ {0xf0, 1445}, - /*II_DB_C0*/ {0xf0, 1445}, - /*II_DB_C0*/ {0xf0, 1445}, - /*II_DB_C8*/ {0xf1, 1454}, - /*II_DB_C8*/ {0xf1, 1454}, - /*II_DB_C8*/ {0xf1, 1454}, - /*II_DB_C8*/ {0xf1, 1454}, - /*II_DB_C8*/ {0xf1, 1454}, - /*II_DB_C8*/ {0xf1, 1454}, - /*II_DB_C8*/ {0xf1, 1454}, - /*II_DB_C8*/ {0xf1, 1454}, - /*II_DB_D0*/ {0xf2, 1463}, - /*II_DB_D0*/ {0xf2, 1463}, - /*II_DB_D0*/ {0xf2, 1463}, - /*II_DB_D0*/ {0xf2, 1463}, - /*II_DB_D0*/ {0xf2, 1463}, - /*II_DB_D0*/ {0xf2, 1463}, - /*II_DB_D0*/ {0xf2, 1463}, - /*II_DB_D0*/ {0xf2, 1463}, - /*II_DB_D8*/ {0xf3, 1473}, - /*II_DB_D8*/ {0xf3, 1473}, - /*II_DB_D8*/ {0xf3, 1473}, - /*II_DB_D8*/ {0xf3, 1473}, - /*II_DB_D8*/ {0xf3, 1473}, - /*II_DB_D8*/ {0xf3, 1473}, - /*II_DB_D8*/ {0xf3, 1473}, - /*II_DB_D8*/ {0xf3, 1473}, - /*II_DB_E0*/ {0xec, 1482}, - /*II_DB_E1*/ {0xec, 1488}, - /*II_DB_E4*/ {0xec, 1496}, - /*II_DB_E8*/ {0xf7, 1504}, - /*II_DB_E8*/ {0xf7, 1504}, - /*II_DB_E8*/ {0xf7, 1504}, - /*II_DB_E8*/ {0xf7, 1504}, - /*II_DB_E8*/ {0xf7, 1504}, - /*II_DB_E8*/ {0xf7, 1504}, - /*II_DB_E8*/ {0xf7, 1504}, - /*II_DB_E8*/ {0xf7, 1504}, - /*II_DB_F0*/ {0xf8, 1512}, - /*II_DB_F0*/ {0xf8, 1512}, - /*II_DB_F0*/ {0xf8, 1512}, - /*II_DB_F0*/ {0xf8, 1512}, - /*II_DB_F0*/ {0xf8, 1512}, - /*II_DB_F0*/ {0xf8, 1512}, - /*II_DB_F0*/ {0xf8, 1512}, - /*II_DB_F0*/ {0xf8, 1512}, - /*II_DC_00*/ {0xf9, 1023}, - /*II_DC_01*/ {0xf9, 1029}, - /*II_DC_02*/ {0xf9, 1035}, - /*II_DC_03*/ {0xf9, 1041}, - /*II_DC_04*/ {0xf9, 1048}, - /*II_DC_05*/ {0xf9, 1054}, - /*II_DC_06*/ {0xf9, 1061}, - /*II_DC_07*/ {0xf9, 1067}, - /*II_DC_C0*/ {0xfa, 1023}, - /*II_DC_C0*/ {0xfa, 1023}, - /*II_DC_C0*/ {0xfa, 1023}, - /*II_DC_C0*/ {0xfa, 1023}, - /*II_DC_C0*/ {0xfa, 1023}, - /*II_DC_C0*/ {0xfa, 1023}, - /*II_DC_C0*/ {0xfa, 1023}, - /*II_DC_C0*/ {0xfa, 1023}, - /*II_DC_C8*/ {0xfa, 1029}, - /*II_DC_C8*/ {0xfa, 1029}, - /*II_DC_C8*/ {0xfa, 1029}, - /*II_DC_C8*/ {0xfa, 1029}, - /*II_DC_C8*/ {0xfa, 1029}, - /*II_DC_C8*/ {0xfa, 1029}, - /*II_DC_C8*/ {0xfa, 1029}, - /*II_DC_C8*/ {0xfa, 1029}, - /*II_DC_E0*/ {0xfa, 1054}, - /*II_DC_E0*/ {0xfa, 1054}, - /*II_DC_E0*/ {0xfa, 1054}, - /*II_DC_E0*/ {0xfa, 1054}, - /*II_DC_E0*/ {0xfa, 1054}, - /*II_DC_E0*/ {0xfa, 1054}, - /*II_DC_E0*/ {0xfa, 1054}, - /*II_DC_E0*/ {0xfa, 1054}, - /*II_DC_E8*/ {0xfa, 1048}, - /*II_DC_E8*/ {0xfa, 1048}, - /*II_DC_E8*/ {0xfa, 1048}, - /*II_DC_E8*/ {0xfa, 1048}, - /*II_DC_E8*/ {0xfa, 1048}, - /*II_DC_E8*/ {0xfa, 1048}, - /*II_DC_E8*/ {0xfa, 1048}, - /*II_DC_E8*/ {0xfa, 1048}, - /*II_DC_F0*/ {0xfa, 1067}, - /*II_DC_F0*/ {0xfa, 1067}, - /*II_DC_F0*/ {0xfa, 1067}, - /*II_DC_F0*/ {0xfa, 1067}, - /*II_DC_F0*/ {0xfa, 1067}, - /*II_DC_F0*/ {0xfa, 1067}, - /*II_DC_F0*/ {0xfa, 1067}, - /*II_DC_F0*/ {0xfa, 1067}, - /*II_DC_F8*/ {0xfa, 1061}, - /*II_DC_F8*/ {0xfa, 1061}, - /*II_DC_F8*/ {0xfa, 1061}, - /*II_DC_F8*/ {0xfa, 1061}, - /*II_DC_F8*/ {0xfa, 1061}, - /*II_DC_F8*/ {0xfa, 1061}, - /*II_DC_F8*/ {0xfa, 1061}, - /*II_DC_F8*/ {0xfa, 1061}, - /*II_DD_00*/ {0xf9, 1074}, - /*II_DD_01*/ {0xfb, 1424}, - /*II_DD_02*/ {0xfc, 1079}, - /*II_DD_03*/ {0xfc, 1084}, - /*II_DD_04*/ {0xee, 1519}, - /*II_DD_C0*/ {0xeb, 1527}, - /*II_DD_C0*/ {0xeb, 1527}, - /*II_DD_C0*/ {0xeb, 1527}, - /*II_DD_C0*/ {0xeb, 1527}, - /*II_DD_C0*/ {0xeb, 1527}, - /*II_DD_C0*/ {0xeb, 1527}, - /*II_DD_C0*/ {0xeb, 1527}, - /*II_DD_C0*/ {0xeb, 1527}, - /*II_DD_D0*/ {0xeb, 1079}, - /*II_DD_D0*/ {0xeb, 1079}, - /*II_DD_D0*/ {0xeb, 1079}, - /*II_DD_D0*/ {0xeb, 1079}, - /*II_DD_D0*/ {0xeb, 1079}, - /*II_DD_D0*/ {0xeb, 1079}, - /*II_DD_D0*/ {0xeb, 1079}, - /*II_DD_D0*/ {0xeb, 1079}, - /*II_DD_D8*/ {0xeb, 1084}, - /*II_DD_D8*/ {0xeb, 1084}, - /*II_DD_D8*/ {0xeb, 1084}, - /*II_DD_D8*/ {0xeb, 1084}, - /*II_DD_D8*/ {0xeb, 1084}, - /*II_DD_D8*/ {0xeb, 1084}, - /*II_DD_D8*/ {0xeb, 1084}, - /*II_DD_D8*/ {0xeb, 1084}, - /*II_DD_E0*/ {0xfa, 1534}, - /*II_DD_E1*/ {0xec, 1534}, - /*II_DD_E0*/ {0xfa, 1534}, - /*II_DD_E0*/ {0xfa, 1534}, - /*II_DD_E0*/ {0xfa, 1534}, - /*II_DD_E0*/ {0xfa, 1534}, - /*II_DD_E0*/ {0xfa, 1534}, - /*II_DD_E0*/ {0xfa, 1534}, - /*II_DD_E8*/ {0xeb, 1541}, - /*II_DD_E9*/ {0xec, 1541}, - /*II_DD_E8*/ {0xeb, 1541}, - /*II_DD_E8*/ {0xeb, 1541}, - /*II_DD_E8*/ {0xeb, 1541}, - /*II_DD_E8*/ {0xeb, 1541}, - /*II_DD_E8*/ {0xeb, 1541}, - /*II_DD_E8*/ {0xeb, 1541}, - /*II_DE_00*/ {0xef, 1317}, - /*II_DE_01*/ {0xef, 1324}, - /*II_DE_02*/ {0xef, 1331}, - /*II_DE_03*/ {0xef, 1338}, - /*II_DE_04*/ {0xef, 1346}, - /*II_DE_05*/ {0xef, 1353}, - /*II_DE_06*/ {0xef, 1361}, - /*II_DE_07*/ {0xef, 1368}, - /*II_DE_C0*/ {0xfa, 1549}, - /*II_DE_C1*/ {0xec, 1549}, - /*II_DE_C0*/ {0xfa, 1549}, - /*II_DE_C0*/ {0xfa, 1549}, - /*II_DE_C0*/ {0xfa, 1549}, - /*II_DE_C0*/ {0xfa, 1549}, - /*II_DE_C0*/ {0xfa, 1549}, - /*II_DE_C0*/ {0xfa, 1549}, - /*II_DE_C8*/ {0xfa, 1556}, - /*II_DE_C9*/ {0xec, 1556}, - /*II_DE_C8*/ {0xfa, 1556}, - /*II_DE_C8*/ {0xfa, 1556}, - /*II_DE_C8*/ {0xfa, 1556}, - /*II_DE_C8*/ {0xfa, 1556}, - /*II_DE_C8*/ {0xfa, 1556}, - /*II_DE_C8*/ {0xfa, 1556}, - /*II_DE_D9*/ {0xec, 1563}, - /*II_DE_E0*/ {0xfa, 1571}, - /*II_DE_E1*/ {0xec, 1571}, - /*II_DE_E0*/ {0xfa, 1571}, - /*II_DE_E0*/ {0xfa, 1571}, - /*II_DE_E0*/ {0xfa, 1571}, - /*II_DE_E0*/ {0xfa, 1571}, - /*II_DE_E0*/ {0xfa, 1571}, - /*II_DE_E0*/ {0xfa, 1571}, - /*II_DE_E8*/ {0xfa, 1579}, - /*II_DE_E9*/ {0xec, 1579}, - /*II_DE_E8*/ {0xfa, 1579}, - /*II_DE_E8*/ {0xfa, 1579}, - /*II_DE_E8*/ {0xfa, 1579}, - /*II_DE_E8*/ {0xfa, 1579}, - /*II_DE_E8*/ {0xfa, 1579}, - /*II_DE_E8*/ {0xfa, 1579}, - /*II_DE_F0*/ {0xfa, 1586}, - /*II_DE_F1*/ {0xec, 1586}, - /*II_DE_F0*/ {0xfa, 1586}, - /*II_DE_F0*/ {0xfa, 1586}, - /*II_DE_F0*/ {0xfa, 1586}, - /*II_DE_F0*/ {0xfa, 1586}, - /*II_DE_F0*/ {0xfa, 1586}, - /*II_DE_F0*/ {0xfa, 1586}, - /*II_DE_F8*/ {0xfa, 1594}, - /*II_DE_F9*/ {0xec, 1594}, - /*II_DE_F8*/ {0xfa, 1594}, - /*II_DE_F8*/ {0xfa, 1594}, - /*II_DE_F8*/ {0xfa, 1594}, - /*II_DE_F8*/ {0xfa, 1594}, - /*II_DE_F8*/ {0xfa, 1594}, - /*II_DE_F8*/ {0xfa, 1594}, - /*II_DF_00*/ {0xef, 1418}, - /*II_DF_01*/ {0xfd, 1424}, - /*II_DF_02*/ {0xfe, 1432}, - /*II_DF_03*/ {0xfe, 1438}, - /*II_DF_04*/ {0xf5, 1601}, - /*II_DF_05*/ {0xf9, 1418}, - /*II_DF_06*/ {0xf6, 1607}, - /*II_DF_07*/ {0xfc, 1438}, - /*II_DF_E8*/ {0xf7, 1614}, - /*II_DF_E8*/ {0xf7, 1614}, - /*II_DF_E8*/ {0xf7, 1614}, - /*II_DF_E8*/ {0xf7, 1614}, - /*II_DF_E8*/ {0xf7, 1614}, - /*II_DF_E8*/ {0xf7, 1614}, - /*II_DF_E8*/ {0xf7, 1614}, - /*II_DF_E8*/ {0xf7, 1614}, - /*II_DF_F0*/ {0xf7, 1623}, - /*II_DF_F0*/ {0xf7, 1623}, - /*II_DF_F0*/ {0xf7, 1623}, - /*II_DF_F0*/ {0xf7, 1623}, - /*II_DF_F0*/ {0xf7, 1623}, - /*II_DF_F0*/ {0xf7, 1623}, - /*II_DF_F0*/ {0xf7, 1623}, - /*II_DF_F0*/ {0xf7, 1623}, + /*II_C7_F8*/ {0xdc, 1014}, + /*II_D0_00*/ {0xdd, 966}, + /*II_D0_01*/ {0xdd, 971}, + /*II_D0_02*/ {0xde, 976}, + /*II_D0_03*/ {0xde, 981}, + /*II_D0_04*/ {0xdf, 986}, + /*II_D0_05*/ {0xdf, 991}, + /*II_D0_06*/ {0xdf, 996}, + /*II_D0_07*/ {0xdf, 1001}, + /*II_D1_00*/ {0xe0, 966}, + /*II_D1_01*/ {0xe0, 971}, + /*II_D1_02*/ {0xe1, 976}, + /*II_D1_03*/ {0xe1, 981}, + /*II_D1_04*/ {0xe2, 986}, + /*II_D1_05*/ {0xe2, 991}, + /*II_D1_06*/ {0xe2, 996}, + /*II_D1_07*/ {0xe2, 1001}, + /*II_D2_00*/ {0xe3, 966}, + /*II_D2_01*/ {0xe3, 971}, + /*II_D2_02*/ {0xe4, 976}, + /*II_D2_03*/ {0xe4, 981}, + /*II_D2_04*/ {0xe5, 986}, + /*II_D2_05*/ {0xe5, 991}, + /*II_D2_06*/ {0xe5, 996}, + /*II_D2_07*/ {0xe5, 1001}, + /*II_D3_00*/ {0xe6, 966}, + /*II_D3_01*/ {0xe6, 971}, + /*II_D3_02*/ {0xe7, 976}, + /*II_D3_03*/ {0xe7, 981}, + /*II_D3_04*/ {0xe8, 986}, + /*II_D3_05*/ {0xe8, 991}, + /*II_D3_06*/ {0xe8, 996}, + /*II_D3_07*/ {0xe8, 1001}, + /*II_D8_00*/ {0xe9, 1022}, + /*II_D8_01*/ {0xe9, 1028}, + /*II_D8_02*/ {0xe9, 1034}, + /*II_D8_03*/ {0xe9, 1040}, + /*II_D8_04*/ {0xe9, 1047}, + /*II_D8_05*/ {0xe9, 1053}, + /*II_D8_06*/ {0xe9, 1060}, + /*II_D8_07*/ {0xe9, 1066}, + /*II_D8_C0*/ {0xea, 1022}, + /*II_D8_C0*/ {0xea, 1022}, + /*II_D8_C0*/ {0xea, 1022}, + /*II_D8_C0*/ {0xea, 1022}, + /*II_D8_C0*/ {0xea, 1022}, + /*II_D8_C0*/ {0xea, 1022}, + /*II_D8_C0*/ {0xea, 1022}, + /*II_D8_C0*/ {0xea, 1022}, + /*II_D8_C8*/ {0xea, 1028}, + /*II_D8_C8*/ {0xea, 1028}, + /*II_D8_C8*/ {0xea, 1028}, + /*II_D8_C8*/ {0xea, 1028}, + /*II_D8_C8*/ {0xea, 1028}, + /*II_D8_C8*/ {0xea, 1028}, + /*II_D8_C8*/ {0xea, 1028}, + /*II_D8_C8*/ {0xea, 1028}, + /*II_D8_D0*/ {0xeb, 1034}, + /*II_D8_D0*/ {0xeb, 1034}, + /*II_D8_D0*/ {0xeb, 1034}, + /*II_D8_D0*/ {0xeb, 1034}, + /*II_D8_D0*/ {0xeb, 1034}, + /*II_D8_D0*/ {0xeb, 1034}, + /*II_D8_D0*/ {0xeb, 1034}, + /*II_D8_D0*/ {0xeb, 1034}, + /*II_D8_D8*/ {0xeb, 1040}, + /*II_D8_D9*/ {0xec, 1040}, + /*II_D8_D8*/ {0xeb, 1040}, + /*II_D8_D8*/ {0xeb, 1040}, + /*II_D8_D8*/ {0xeb, 1040}, + /*II_D8_D8*/ {0xeb, 1040}, + /*II_D8_D8*/ {0xeb, 1040}, + /*II_D8_D8*/ {0xeb, 1040}, + /*II_D8_E0*/ {0xea, 1047}, + /*II_D8_E0*/ {0xea, 1047}, + /*II_D8_E0*/ {0xea, 1047}, + /*II_D8_E0*/ {0xea, 1047}, + /*II_D8_E0*/ {0xea, 1047}, + /*II_D8_E0*/ {0xea, 1047}, + /*II_D8_E0*/ {0xea, 1047}, + /*II_D8_E0*/ {0xea, 1047}, + /*II_D8_E8*/ {0xea, 1053}, + /*II_D8_E8*/ {0xea, 1053}, + /*II_D8_E8*/ {0xea, 1053}, + /*II_D8_E8*/ {0xea, 1053}, + /*II_D8_E8*/ {0xea, 1053}, + /*II_D8_E8*/ {0xea, 1053}, + /*II_D8_E8*/ {0xea, 1053}, + /*II_D8_E8*/ {0xea, 1053}, + /*II_D8_F0*/ {0xea, 1060}, + /*II_D8_F0*/ {0xea, 1060}, + /*II_D8_F0*/ {0xea, 1060}, + /*II_D8_F0*/ {0xea, 1060}, + /*II_D8_F0*/ {0xea, 1060}, + /*II_D8_F0*/ {0xea, 1060}, + /*II_D8_F0*/ {0xea, 1060}, + /*II_D8_F0*/ {0xea, 1060}, + /*II_D8_F8*/ {0xea, 1066}, + /*II_D8_F8*/ {0xea, 1066}, + /*II_D8_F8*/ {0xea, 1066}, + /*II_D8_F8*/ {0xea, 1066}, + /*II_D8_F8*/ {0xea, 1066}, + /*II_D8_F8*/ {0xea, 1066}, + /*II_D8_F8*/ {0xea, 1066}, + /*II_D8_F8*/ {0xea, 1066}, + /*II_D9_00*/ {0xe9, 1073}, + /*II_D9_02*/ {0xed, 1078}, + /*II_D9_03*/ {0xed, 1083}, + /*II_D9_04*/ {0xee, 1089}, + /*II_D9_05*/ {0xef, 1097}, + /*II_D9_C0*/ {0xeb, 1073}, + /*II_D9_C0*/ {0xeb, 1073}, + /*II_D9_C0*/ {0xeb, 1073}, + /*II_D9_C0*/ {0xeb, 1073}, + /*II_D9_C0*/ {0xeb, 1073}, + /*II_D9_C0*/ {0xeb, 1073}, + /*II_D9_C0*/ {0xeb, 1073}, + /*II_D9_C0*/ {0xeb, 1073}, + /*II_D9_C8*/ {0xeb, 1104}, + /*II_D9_C9*/ {0xec, 1104}, + /*II_D9_C8*/ {0xeb, 1104}, + /*II_D9_C8*/ {0xeb, 1104}, + /*II_D9_C8*/ {0xeb, 1104}, + /*II_D9_C8*/ {0xeb, 1104}, + /*II_D9_C8*/ {0xeb, 1104}, + /*II_D9_C8*/ {0xeb, 1104}, + /*II_D9_D0*/ {0xec, 1110}, + /*II_D9_E0*/ {0xec, 1116}, + /*II_D9_E1*/ {0xec, 1122}, + /*II_D9_E4*/ {0xec, 1128}, + /*II_D9_E5*/ {0xec, 1134}, + /*II_D9_E8*/ {0xec, 1140}, + /*II_D9_E9*/ {0xec, 1146}, + /*II_D9_EA*/ {0xec, 1154}, + /*II_D9_EB*/ {0xec, 1162}, + /*II_D9_EC*/ {0xec, 1169}, + /*II_D9_ED*/ {0xec, 1177}, + /*II_D9_EE*/ {0xec, 1185}, + /*II_D9_F0*/ {0xec, 1191}, + /*II_D9_F1*/ {0xec, 1198}, + /*II_D9_F2*/ {0xec, 1205}, + /*II_D9_F3*/ {0xec, 1212}, + /*II_D9_F4*/ {0xec, 1220}, + /*II_D9_F5*/ {0xec, 1229}, + /*II_D9_F6*/ {0xec, 1237}, + /*II_D9_F7*/ {0xec, 1246}, + /*II_D9_F8*/ {0xec, 1255}, + /*II_D9_F9*/ {0xec, 1262}, + /*II_D9_FA*/ {0xec, 1271}, + /*II_D9_FB*/ {0xec, 1278}, + /*II_D9_FC*/ {0xec, 1287}, + /*II_D9_FD*/ {0xec, 1296}, + /*II_D9_FE*/ {0xec, 1304}, + /*II_D9_FF*/ {0xec, 1310}, + /*II_DA_00*/ {0xe9, 1316}, + /*II_DA_01*/ {0xe9, 1323}, + /*II_DA_02*/ {0xe9, 1330}, + /*II_DA_03*/ {0xe9, 1337}, + /*II_DA_04*/ {0xe9, 1345}, + /*II_DA_05*/ {0xe9, 1352}, + /*II_DA_06*/ {0xe9, 1360}, + /*II_DA_07*/ {0xe9, 1367}, + /*II_DA_C0*/ {0xf0, 1375}, + /*II_DA_C0*/ {0xf0, 1375}, + /*II_DA_C0*/ {0xf0, 1375}, + /*II_DA_C0*/ {0xf0, 1375}, + /*II_DA_C0*/ {0xf0, 1375}, + /*II_DA_C0*/ {0xf0, 1375}, + /*II_DA_C0*/ {0xf0, 1375}, + /*II_DA_C0*/ {0xf0, 1375}, + /*II_DA_C8*/ {0xf1, 1383}, + /*II_DA_C8*/ {0xf1, 1383}, + /*II_DA_C8*/ {0xf1, 1383}, + /*II_DA_C8*/ {0xf1, 1383}, + /*II_DA_C8*/ {0xf1, 1383}, + /*II_DA_C8*/ {0xf1, 1383}, + /*II_DA_C8*/ {0xf1, 1383}, + /*II_DA_C8*/ {0xf1, 1383}, + /*II_DA_D0*/ {0xf2, 1391}, + /*II_DA_D0*/ {0xf2, 1391}, + /*II_DA_D0*/ {0xf2, 1391}, + /*II_DA_D0*/ {0xf2, 1391}, + /*II_DA_D0*/ {0xf2, 1391}, + /*II_DA_D0*/ {0xf2, 1391}, + /*II_DA_D0*/ {0xf2, 1391}, + /*II_DA_D0*/ {0xf2, 1391}, + /*II_DA_D8*/ {0xf3, 1400}, + /*II_DA_D8*/ {0xf3, 1400}, + /*II_DA_D8*/ {0xf3, 1400}, + /*II_DA_D8*/ {0xf3, 1400}, + /*II_DA_D8*/ {0xf3, 1400}, + /*II_DA_D8*/ {0xf3, 1400}, + /*II_DA_D8*/ {0xf3, 1400}, + /*II_DA_D8*/ {0xf3, 1400}, + /*II_DA_E9*/ {0xec, 1408}, + /*II_DB_00*/ {0xe9, 1417}, + /*II_DB_01*/ {0xf4, 1423}, + /*II_DB_02*/ {0xed, 1431}, + /*II_DB_03*/ {0xed, 1437}, + /*II_DB_05*/ {0xf5, 1073}, + /*II_DB_07*/ {0xf6, 1083}, + /*II_DB_C0*/ {0xf0, 1444}, + /*II_DB_C0*/ {0xf0, 1444}, + /*II_DB_C0*/ {0xf0, 1444}, + /*II_DB_C0*/ {0xf0, 1444}, + /*II_DB_C0*/ {0xf0, 1444}, + /*II_DB_C0*/ {0xf0, 1444}, + /*II_DB_C0*/ {0xf0, 1444}, + /*II_DB_C0*/ {0xf0, 1444}, + /*II_DB_C8*/ {0xf1, 1453}, + /*II_DB_C8*/ {0xf1, 1453}, + /*II_DB_C8*/ {0xf1, 1453}, + /*II_DB_C8*/ {0xf1, 1453}, + /*II_DB_C8*/ {0xf1, 1453}, + /*II_DB_C8*/ {0xf1, 1453}, + /*II_DB_C8*/ {0xf1, 1453}, + /*II_DB_C8*/ {0xf1, 1453}, + /*II_DB_D0*/ {0xf2, 1462}, + /*II_DB_D0*/ {0xf2, 1462}, + /*II_DB_D0*/ {0xf2, 1462}, + /*II_DB_D0*/ {0xf2, 1462}, + /*II_DB_D0*/ {0xf2, 1462}, + /*II_DB_D0*/ {0xf2, 1462}, + /*II_DB_D0*/ {0xf2, 1462}, + /*II_DB_D0*/ {0xf2, 1462}, + /*II_DB_D8*/ {0xf3, 1472}, + /*II_DB_D8*/ {0xf3, 1472}, + /*II_DB_D8*/ {0xf3, 1472}, + /*II_DB_D8*/ {0xf3, 1472}, + /*II_DB_D8*/ {0xf3, 1472}, + /*II_DB_D8*/ {0xf3, 1472}, + /*II_DB_D8*/ {0xf3, 1472}, + /*II_DB_D8*/ {0xf3, 1472}, + /*II_DB_E0*/ {0xec, 1481}, + /*II_DB_E1*/ {0xec, 1487}, + /*II_DB_E4*/ {0xec, 1495}, + /*II_DB_E8*/ {0xf7, 1503}, + /*II_DB_E8*/ {0xf7, 1503}, + /*II_DB_E8*/ {0xf7, 1503}, + /*II_DB_E8*/ {0xf7, 1503}, + /*II_DB_E8*/ {0xf7, 1503}, + /*II_DB_E8*/ {0xf7, 1503}, + /*II_DB_E8*/ {0xf7, 1503}, + /*II_DB_E8*/ {0xf7, 1503}, + /*II_DB_F0*/ {0xf8, 1511}, + /*II_DB_F0*/ {0xf8, 1511}, + /*II_DB_F0*/ {0xf8, 1511}, + /*II_DB_F0*/ {0xf8, 1511}, + /*II_DB_F0*/ {0xf8, 1511}, + /*II_DB_F0*/ {0xf8, 1511}, + /*II_DB_F0*/ {0xf8, 1511}, + /*II_DB_F0*/ {0xf8, 1511}, + /*II_DC_00*/ {0xf9, 1022}, + /*II_DC_01*/ {0xf9, 1028}, + /*II_DC_02*/ {0xf9, 1034}, + /*II_DC_03*/ {0xf9, 1040}, + /*II_DC_04*/ {0xf9, 1047}, + /*II_DC_05*/ {0xf9, 1053}, + /*II_DC_06*/ {0xf9, 1060}, + /*II_DC_07*/ {0xf9, 1066}, + /*II_DC_C0*/ {0xfa, 1022}, + /*II_DC_C0*/ {0xfa, 1022}, + /*II_DC_C0*/ {0xfa, 1022}, + /*II_DC_C0*/ {0xfa, 1022}, + /*II_DC_C0*/ {0xfa, 1022}, + /*II_DC_C0*/ {0xfa, 1022}, + /*II_DC_C0*/ {0xfa, 1022}, + /*II_DC_C0*/ {0xfa, 1022}, + /*II_DC_C8*/ {0xfa, 1028}, + /*II_DC_C8*/ {0xfa, 1028}, + /*II_DC_C8*/ {0xfa, 1028}, + /*II_DC_C8*/ {0xfa, 1028}, + /*II_DC_C8*/ {0xfa, 1028}, + /*II_DC_C8*/ {0xfa, 1028}, + /*II_DC_C8*/ {0xfa, 1028}, + /*II_DC_C8*/ {0xfa, 1028}, + /*II_DC_E0*/ {0xfa, 1053}, + /*II_DC_E0*/ {0xfa, 1053}, + /*II_DC_E0*/ {0xfa, 1053}, + /*II_DC_E0*/ {0xfa, 1053}, + /*II_DC_E0*/ {0xfa, 1053}, + /*II_DC_E0*/ {0xfa, 1053}, + /*II_DC_E0*/ {0xfa, 1053}, + /*II_DC_E0*/ {0xfa, 1053}, + /*II_DC_E8*/ {0xfa, 1047}, + /*II_DC_E8*/ {0xfa, 1047}, + /*II_DC_E8*/ {0xfa, 1047}, + /*II_DC_E8*/ {0xfa, 1047}, + /*II_DC_E8*/ {0xfa, 1047}, + /*II_DC_E8*/ {0xfa, 1047}, + /*II_DC_E8*/ {0xfa, 1047}, + /*II_DC_E8*/ {0xfa, 1047}, + /*II_DC_F0*/ {0xfa, 1066}, + /*II_DC_F0*/ {0xfa, 1066}, + /*II_DC_F0*/ {0xfa, 1066}, + /*II_DC_F0*/ {0xfa, 1066}, + /*II_DC_F0*/ {0xfa, 1066}, + /*II_DC_F0*/ {0xfa, 1066}, + /*II_DC_F0*/ {0xfa, 1066}, + /*II_DC_F0*/ {0xfa, 1066}, + /*II_DC_F8*/ {0xfa, 1060}, + /*II_DC_F8*/ {0xfa, 1060}, + /*II_DC_F8*/ {0xfa, 1060}, + /*II_DC_F8*/ {0xfa, 1060}, + /*II_DC_F8*/ {0xfa, 1060}, + /*II_DC_F8*/ {0xfa, 1060}, + /*II_DC_F8*/ {0xfa, 1060}, + /*II_DC_F8*/ {0xfa, 1060}, + /*II_DD_00*/ {0xf9, 1073}, + /*II_DD_01*/ {0xfb, 1423}, + /*II_DD_02*/ {0xfc, 1078}, + /*II_DD_03*/ {0xfc, 1083}, + /*II_DD_04*/ {0xee, 1518}, + /*II_DD_C0*/ {0xeb, 1526}, + /*II_DD_C0*/ {0xeb, 1526}, + /*II_DD_C0*/ {0xeb, 1526}, + /*II_DD_C0*/ {0xeb, 1526}, + /*II_DD_C0*/ {0xeb, 1526}, + /*II_DD_C0*/ {0xeb, 1526}, + /*II_DD_C0*/ {0xeb, 1526}, + /*II_DD_C0*/ {0xeb, 1526}, + /*II_DD_D0*/ {0xeb, 1078}, + /*II_DD_D0*/ {0xeb, 1078}, + /*II_DD_D0*/ {0xeb, 1078}, + /*II_DD_D0*/ {0xeb, 1078}, + /*II_DD_D0*/ {0xeb, 1078}, + /*II_DD_D0*/ {0xeb, 1078}, + /*II_DD_D0*/ {0xeb, 1078}, + /*II_DD_D0*/ {0xeb, 1078}, + /*II_DD_D8*/ {0xeb, 1083}, + /*II_DD_D8*/ {0xeb, 1083}, + /*II_DD_D8*/ {0xeb, 1083}, + /*II_DD_D8*/ {0xeb, 1083}, + /*II_DD_D8*/ {0xeb, 1083}, + /*II_DD_D8*/ {0xeb, 1083}, + /*II_DD_D8*/ {0xeb, 1083}, + /*II_DD_D8*/ {0xeb, 1083}, + /*II_DD_E0*/ {0xfa, 1533}, + /*II_DD_E1*/ {0xec, 1533}, + /*II_DD_E0*/ {0xfa, 1533}, + /*II_DD_E0*/ {0xfa, 1533}, + /*II_DD_E0*/ {0xfa, 1533}, + /*II_DD_E0*/ {0xfa, 1533}, + /*II_DD_E0*/ {0xfa, 1533}, + /*II_DD_E0*/ {0xfa, 1533}, + /*II_DD_E8*/ {0xeb, 1540}, + /*II_DD_E9*/ {0xec, 1540}, + /*II_DD_E8*/ {0xeb, 1540}, + /*II_DD_E8*/ {0xeb, 1540}, + /*II_DD_E8*/ {0xeb, 1540}, + /*II_DD_E8*/ {0xeb, 1540}, + /*II_DD_E8*/ {0xeb, 1540}, + /*II_DD_E8*/ {0xeb, 1540}, + /*II_DE_00*/ {0xef, 1316}, + /*II_DE_01*/ {0xef, 1323}, + /*II_DE_02*/ {0xef, 1330}, + /*II_DE_03*/ {0xef, 1337}, + /*II_DE_04*/ {0xef, 1345}, + /*II_DE_05*/ {0xef, 1352}, + /*II_DE_06*/ {0xef, 1360}, + /*II_DE_07*/ {0xef, 1367}, + /*II_DE_C0*/ {0xfa, 1548}, + /*II_DE_C1*/ {0xec, 1548}, + /*II_DE_C0*/ {0xfa, 1548}, + /*II_DE_C0*/ {0xfa, 1548}, + /*II_DE_C0*/ {0xfa, 1548}, + /*II_DE_C0*/ {0xfa, 1548}, + /*II_DE_C0*/ {0xfa, 1548}, + /*II_DE_C0*/ {0xfa, 1548}, + /*II_DE_C8*/ {0xfa, 1555}, + /*II_DE_C9*/ {0xec, 1555}, + /*II_DE_C8*/ {0xfa, 1555}, + /*II_DE_C8*/ {0xfa, 1555}, + /*II_DE_C8*/ {0xfa, 1555}, + /*II_DE_C8*/ {0xfa, 1555}, + /*II_DE_C8*/ {0xfa, 1555}, + /*II_DE_C8*/ {0xfa, 1555}, + /*II_DE_D9*/ {0xec, 1562}, + /*II_DE_E0*/ {0xfa, 1570}, + /*II_DE_E1*/ {0xec, 1570}, + /*II_DE_E0*/ {0xfa, 1570}, + /*II_DE_E0*/ {0xfa, 1570}, + /*II_DE_E0*/ {0xfa, 1570}, + /*II_DE_E0*/ {0xfa, 1570}, + /*II_DE_E0*/ {0xfa, 1570}, + /*II_DE_E0*/ {0xfa, 1570}, + /*II_DE_E8*/ {0xfa, 1578}, + /*II_DE_E9*/ {0xec, 1578}, + /*II_DE_E8*/ {0xfa, 1578}, + /*II_DE_E8*/ {0xfa, 1578}, + /*II_DE_E8*/ {0xfa, 1578}, + /*II_DE_E8*/ {0xfa, 1578}, + /*II_DE_E8*/ {0xfa, 1578}, + /*II_DE_E8*/ {0xfa, 1578}, + /*II_DE_F0*/ {0xfa, 1585}, + /*II_DE_F1*/ {0xec, 1585}, + /*II_DE_F0*/ {0xfa, 1585}, + /*II_DE_F0*/ {0xfa, 1585}, + /*II_DE_F0*/ {0xfa, 1585}, + /*II_DE_F0*/ {0xfa, 1585}, + /*II_DE_F0*/ {0xfa, 1585}, + /*II_DE_F0*/ {0xfa, 1585}, + /*II_DE_F8*/ {0xfa, 1593}, + /*II_DE_F9*/ {0xec, 1593}, + /*II_DE_F8*/ {0xfa, 1593}, + /*II_DE_F8*/ {0xfa, 1593}, + /*II_DE_F8*/ {0xfa, 1593}, + /*II_DE_F8*/ {0xfa, 1593}, + /*II_DE_F8*/ {0xfa, 1593}, + /*II_DE_F8*/ {0xfa, 1593}, + /*II_DF_00*/ {0xef, 1417}, + /*II_DF_01*/ {0xfd, 1423}, + /*II_DF_02*/ {0xfe, 1431}, + /*II_DF_03*/ {0xfe, 1437}, + /*II_DF_04*/ {0xf5, 1600}, + /*II_DF_05*/ {0xf9, 1417}, + /*II_DF_06*/ {0xf6, 1606}, + /*II_DF_07*/ {0xfc, 1437}, + /*II_DF_E8*/ {0xf7, 1613}, + /*II_DF_E8*/ {0xf7, 1613}, + /*II_DF_E8*/ {0xf7, 1613}, + /*II_DF_E8*/ {0xf7, 1613}, + /*II_DF_E8*/ {0xf7, 1613}, + /*II_DF_E8*/ {0xf7, 1613}, + /*II_DF_E8*/ {0xf7, 1613}, + /*II_DF_E8*/ {0xf7, 1613}, + /*II_DF_F0*/ {0xf7, 1622}, + /*II_DF_F0*/ {0xf7, 1622}, + /*II_DF_F0*/ {0xf7, 1622}, + /*II_DF_F0*/ {0xf7, 1622}, + /*II_DF_F0*/ {0xf7, 1622}, + /*II_DF_F0*/ {0xf7, 1622}, + /*II_DF_F0*/ {0xf7, 1622}, + /*II_DF_F0*/ {0xf7, 1622}, /*II_F6_00*/ {0xff, 206}, - /*II_F6_02*/ {0x100, 1631}, - /*II_F6_03*/ {0x101, 1636}, - /*II_F6_04*/ {0x102, 1641}, + /*II_F6_02*/ {0x100, 1630}, + /*II_F6_03*/ {0x101, 1635}, + /*II_F6_04*/ {0x102, 1640}, /*II_F6_05*/ {0x102, 117}, - /*II_F6_06*/ {0x103, 1646}, - /*II_F6_07*/ {0x103, 1651}, + /*II_F6_06*/ {0x103, 1645}, + /*II_F6_07*/ {0x103, 1650}, /*II_F7_00*/ {0x104, 206}, - /*II_F7_02*/ {0x105, 1631}, - /*II_F7_03*/ {0x106, 1636}, - /*II_F7_04*/ {0x107, 1641}, + /*II_F7_02*/ {0x105, 1630}, + /*II_F7_03*/ {0x106, 1635}, + /*II_F7_04*/ {0x107, 1640}, /*II_F7_05*/ {0x107, 117}, - /*II_F7_06*/ {0x108, 1646}, - /*II_F7_07*/ {0x108, 1651}, + /*II_F7_06*/ {0x108, 1645}, + /*II_F7_07*/ {0x108, 1650}, /*II_FE_00*/ {0x109, 81}, /*II_FE_01*/ {0x109, 86}, /*II_FF_00*/ {0x10a, 81}, /*II_FF_01*/ {0x10a, 86}, - /*II_FF_02*/ {0x10b, 456}, + /*II_FF_02*/ {0x10b, 455}, /*II_FF_03*/ {0x10c, 260}, - /*II_FF_04*/ {0x10d, 462}, - /*II_FF_05*/ {0x10e, 467}, + /*II_FF_04*/ {0x10d, 461}, + /*II_FF_05*/ {0x10e, 466}, /*II_FF_06*/ {0x10f, 16}, - /*II_0F_00_00*/ {0x110, 1657}, - /*II_0F_00_01*/ {0x111, 1663}, - /*II_0F_00_02*/ {0x112, 1668}, - /*II_0F_00_03*/ {0x113, 1674}, - /*II_0F_00_04*/ {0x114, 1679}, - /*II_0F_00_05*/ {0x114, 1685}, - /*II_0F_01_00*/ {0x115, 1691}, - /*II_0F_01_01*/ {0x115, 1697}, - /*II_0F_01_02*/ {0x116, 1703}, - /*II_0F_01_03*/ {0x116, 1709}, - /*II_0F_01_04*/ {0x117, 1715}, - /*II_0F_01_06*/ {0x118, 1721}, - /*II_0F_01_07*/ {0x119, 1727}, - /*II_0F_01_C1*/ {0x11a, 1735}, - /*II_0F_01_C2*/ {0x11a, 1743}, - /*II_0F_01_C3*/ {0x11a, 1753}, - /*II_0F_01_C4*/ {0x11a, 1763}, - /*II_0F_01_C8*/ {0x11b, 1771}, - /*II_0F_01_C9*/ {0x11b, 1780}, - /*II_0F_01_CA*/ {0x11b, 1787}, - /*II_0F_01_CB*/ {0x11b, 1793}, - /*II_0F_01_D0*/ {0x91, 1799}, - /*II_0F_01_D1*/ {0x91, 1807}, - /*II_0F_01_D4*/ {0x11a, 1815}, - /*II_0F_01_D5*/ {0x11c, 1823}, - /*II_0F_01_D8*/ {0x11d, 1829}, - /*II_0F_01_D9*/ {0x11e, 1836}, - /*II_0F_01_DA*/ {0x11f, 1845}, - /*II_0F_01_DB*/ {0x11f, 1853}, - /*II_0F_01_DC*/ {0x11e, 1861}, - /*II_0F_01_DD*/ {0x11e, 1867}, - /*II_0F_01_DE*/ {0x11f, 1873}, - /*II_0F_01_DF*/ {0x120, 1881}, - /*II_0F_01_F8*/ {0x121, 1890}, - /*II_0F_01_F9*/ {0x121, 1898}, - /*II_0F_0D_00*/ {0x122, 1906}, - /*II_0F_0D_01*/ {0x122, 1916}, - /*II_0F_0F_0C*/ {0x123, 1927}, - /*II_0F_0F_0D*/ {0x124, 1934}, - /*II_0F_0F_1C*/ {0x123, 1941}, - /*II_0F_0F_1D*/ {0x124, 1948}, - /*II_0F_0F_8A*/ {0x123, 1955}, - /*II_0F_0F_8E*/ {0x123, 1963}, - /*II_0F_0F_90*/ {0x124, 1972}, - /*II_0F_0F_94*/ {0x124, 1981}, - /*II_0F_0F_96*/ {0x124, 1988}, - /*II_0F_0F_97*/ {0x124, 1995}, - /*II_0F_0F_9A*/ {0x124, 2004}, - /*II_0F_0F_9E*/ {0x124, 2011}, - /*II_0F_0F_A0*/ {0x124, 2018}, - /*II_0F_0F_A4*/ {0x124, 2027}, - /*II_0F_0F_A6*/ {0x124, 2034}, - /*II_0F_0F_A7*/ {0x124, 2044}, - /*II_0F_0F_AA*/ {0x124, 2054}, - /*II_0F_0F_AE*/ {0x124, 2062}, - /*II_0F_0F_B0*/ {0x124, 2069}, - /*II_0F_0F_B4*/ {0x124, 2078}, - /*II_0F_0F_B6*/ {0x124, 2085}, - /*II_0F_0F_B7*/ {0x124, 2095}, - /*II_0F_0F_BB*/ {0x123, 2104}, - /*II_0F_0F_BF*/ {0x124, 2112}, - /*II_0F_10*/ {0x125, 2121}, - /*II_66_0F_10*/ {0x126, 2129}, - /*II_F3_0F_10*/ {0x127, 2137}, - /*II_F2_0F_10*/ {0x128, 2144}, - /*II_0F_11*/ {0x12d, 2121}, - /*II_66_0F_11*/ {0x12e, 2129}, - /*II_F3_0F_11*/ {0x12f, 2137}, - /*II_F2_0F_11*/ {0x130, 2144}, - /*II_66_0F_12*/ {0x135, 2202}, - /*II_F3_0F_12*/ {0x136, 2210}, - /*II_F2_0F_12*/ {0x136, 2220}, - /*II_0F_13*/ {0x13a, 2194}, - /*II_66_0F_13*/ {0x13b, 2202}, - /*II_0F_14*/ {0x13d, 2278}, - /*II_66_0F_14*/ {0x13e, 2288}, - /*II_0F_15*/ {0x13d, 2320}, - /*II_66_0F_15*/ {0x13e, 2330}, - /*II_66_0F_16*/ {0x135, 2379}, - /*II_F3_0F_16*/ {0x140, 2387}, - /*II_0F_17*/ {0x13a, 2371}, - /*II_66_0F_17*/ {0x13b, 2379}, - /*II_0F_18_00*/ {0x141, 2436}, - /*II_0F_18_01*/ {0x141, 2449}, - /*II_0F_18_02*/ {0x141, 2461}, - /*II_0F_18_03*/ {0x141, 2473}, - /*II_0F_28*/ {0x125, 2485}, - /*II_66_0F_28*/ {0x126, 2493}, - /*II_0F_29*/ {0x12d, 2485}, - /*II_66_0F_29*/ {0x12e, 2493}, - /*II_0F_2A*/ {0x142, 2519}, - /*II_66_0F_2A*/ {0x143, 2529}, - /*II_F3_0F_2A*/ {0x144, 2539}, - /*II_F2_0F_2A*/ {0x145, 2549}, - /*II_0F_2B*/ {0x146, 2581}, - /*II_66_0F_2B*/ {0x147, 2590}, - /*II_F3_0F_2B*/ {0x148, 2599}, - /*II_F2_0F_2B*/ {0x149, 2608}, - /*II_0F_2C*/ {0x14b, 2637}, - /*II_66_0F_2C*/ {0x14c, 2648}, - /*II_F3_0F_2C*/ {0x14d, 2659}, - /*II_F2_0F_2C*/ {0x14e, 2670}, - /*II_0F_2D*/ {0x14b, 2705}, - /*II_66_0F_2D*/ {0x13e, 2715}, - /*II_F3_0F_2D*/ {0x14d, 2725}, - /*II_F2_0F_2D*/ {0x14e, 2735}, - /*II_0F_2E*/ {0x150, 2767}, - /*II_66_0F_2E*/ {0x151, 2776}, - /*II_0F_2F*/ {0x150, 2805}, - /*II_66_0F_2F*/ {0x151, 2813}, - /*II_0F_50*/ {0x154, 2839}, - /*II_66_0F_50*/ {0x155, 2849}, - /*II_0F_51*/ {0x13d, 2881}, - /*II_66_0F_51*/ {0x13e, 2889}, - /*II_F3_0F_51*/ {0x157, 2897}, - /*II_F2_0F_51*/ {0x151, 2905}, - /*II_0F_52*/ {0x13d, 2949}, - /*II_F3_0F_52*/ {0x157, 2958}, - /*II_0F_53*/ {0x13d, 2987}, - /*II_F3_0F_53*/ {0x157, 2994}, - /*II_0F_54*/ {0x13d, 3017}, - /*II_66_0F_54*/ {0x13e, 3024}, - /*II_0F_55*/ {0x13d, 3047}, - /*II_66_0F_55*/ {0x13e, 3055}, - /*II_0F_56*/ {0x13d, 3081}, - /*II_66_0F_56*/ {0x13e, 3087}, - /*II_0F_57*/ {0x13d, 3107}, - /*II_66_0F_57*/ {0x13e, 3114}, - /*II_0F_58*/ {0x13d, 3137}, - /*II_66_0F_58*/ {0x13e, 3144}, - /*II_F3_0F_58*/ {0x157, 3151}, - /*II_F2_0F_58*/ {0x151, 3158}, - /*II_0F_59*/ {0x13d, 3197}, - /*II_66_0F_59*/ {0x13e, 3204}, - /*II_F3_0F_59*/ {0x157, 3211}, - /*II_F2_0F_59*/ {0x151, 3218}, - /*II_0F_5A*/ {0x151, 3257}, - /*II_66_0F_5A*/ {0x13e, 3267}, - /*II_F3_0F_5A*/ {0x158, 3277}, - /*II_F2_0F_5A*/ {0x151, 3287}, - /*II_0F_5B*/ {0x13e, 3341}, - /*II_66_0F_5B*/ {0x13e, 3351}, - /*II_F3_0F_5B*/ {0x13e, 3361}, - /*II_0F_5C*/ {0x13d, 3406}, - /*II_66_0F_5C*/ {0x13e, 3413}, - /*II_F3_0F_5C*/ {0x157, 3420}, - /*II_F2_0F_5C*/ {0x151, 3427}, - /*II_0F_5D*/ {0x13d, 3466}, - /*II_66_0F_5D*/ {0x13e, 3473}, - /*II_F3_0F_5D*/ {0x157, 3480}, - /*II_F2_0F_5D*/ {0x151, 3487}, - /*II_0F_5E*/ {0x13d, 3526}, - /*II_66_0F_5E*/ {0x13e, 3533}, - /*II_F3_0F_5E*/ {0x157, 3540}, - /*II_F2_0F_5E*/ {0x151, 3547}, - /*II_0F_5F*/ {0x13d, 3586}, - /*II_66_0F_5F*/ {0x13e, 3593}, - /*II_F3_0F_5F*/ {0x157, 3600}, - /*II_F2_0F_5F*/ {0x151, 3607}, - /*II_0F_60*/ {0x15b, 3646}, - /*II_66_0F_60*/ {0x13e, 3646}, - /*II_0F_61*/ {0x15b, 3669}, - /*II_66_0F_61*/ {0x13e, 3669}, - /*II_0F_62*/ {0x15b, 3692}, - /*II_66_0F_62*/ {0x13e, 3692}, - /*II_0F_63*/ {0x15c, 3715}, - /*II_66_0F_63*/ {0x13e, 3715}, - /*II_0F_64*/ {0x15c, 3736}, - /*II_66_0F_64*/ {0x13e, 3736}, - /*II_0F_65*/ {0x15c, 3755}, - /*II_66_0F_65*/ {0x13e, 3755}, - /*II_0F_66*/ {0x15c, 3774}, - /*II_66_0F_66*/ {0x13e, 3774}, - /*II_0F_67*/ {0x15c, 3793}, - /*II_66_0F_67*/ {0x13e, 3793}, - /*II_0F_68*/ {0x15c, 3814}, - /*II_66_0F_68*/ {0x13e, 3814}, - /*II_0F_69*/ {0x15c, 3837}, - /*II_66_0F_69*/ {0x13e, 3837}, - /*II_0F_6A*/ {0x15c, 3860}, - /*II_66_0F_6A*/ {0x13e, 3860}, - /*II_0F_6B*/ {0x15c, 3883}, - /*II_66_0F_6B*/ {0x13e, 3883}, - /*II_66_0F_6C*/ {0x13e, 3904}, - /*II_66_0F_6D*/ {0x13e, 3929}, - /*II_0F_6F*/ {0x160, 3960}, - /*II_66_0F_6F*/ {0x126, 3980}, - /*II_F3_0F_6F*/ {0x126, 3988}, - /*II_0F_74*/ {0x15c, 4077}, - /*II_66_0F_74*/ {0x13e, 4077}, - /*II_0F_75*/ {0x15c, 4096}, - /*II_66_0F_75*/ {0x13e, 4096}, - /*II_0F_76*/ {0x15c, 4115}, - /*II_66_0F_76*/ {0x13e, 4115}, - /*II_0F_77*/ {0x164, 4134}, - /*II_0F_78*/ {0x166, 4162}, - /*II_0F_79*/ {0x169, 4186}, - /*II_66_0F_79*/ {0x16a, 4170}, - /*II_F2_0F_79*/ {0x16b, 4177}, - /*II_0F_7A_30*/ {0x16c, 4195}, - /*II_0F_7A_31*/ {0x16d, 4205}, - /*II_66_0F_7C*/ {0x16e, 4215}, - /*II_F2_0F_7C*/ {0x16e, 4223}, - /*II_66_0F_7D*/ {0x16e, 4249}, - /*II_F2_0F_7D*/ {0x16e, 4257}, - /*II_F3_0F_7E*/ {0x128, 3960}, - /*II_0F_7F*/ {0x172, 3960}, - /*II_66_0F_7F*/ {0x12e, 3980}, - /*II_F3_0F_7F*/ {0x12e, 3988}, - /*II_F3_0F_B8*/ {0x176, 4372}, - /*II_0F_BA_04*/ {0x177, 872}, - /*II_0F_BA_05*/ {0x178, 887}, - /*II_0F_BA_06*/ {0x178, 912}, - /*II_0F_BA_07*/ {0x178, 934}, - /*II_0F_BC*/ {0x179, 4380}, - /*II_F3_0F_BC*/ {0x17a, 4385}, - /*II_0F_BD*/ {0x179, 4392}, - /*II_F3_0F_BD*/ {0x17b, 4397}, - /*II_0F_C7_07*/ {0x18b, 6419}, - /*II_66_0F_D0*/ {0x16e, 6428}, - /*II_F2_0F_D0*/ {0x16e, 6438}, - /*II_0F_D1*/ {0x15c, 6470}, - /*II_66_0F_D1*/ {0x13e, 6470}, - /*II_0F_D2*/ {0x15c, 6485}, - /*II_66_0F_D2*/ {0x13e, 6485}, - /*II_0F_D3*/ {0x15c, 6500}, - /*II_66_0F_D3*/ {0x13e, 6500}, - /*II_0F_D4*/ {0x151, 6515}, - /*II_66_0F_D4*/ {0x13e, 6515}, - /*II_0F_D5*/ {0x15c, 6530}, - /*II_66_0F_D5*/ {0x13e, 6530}, - /*II_66_0F_D6*/ {0x130, 3960}, - /*II_F3_0F_D6*/ {0x18c, 6547}, - /*II_F2_0F_D6*/ {0x18d, 6556}, - /*II_0F_D7*/ {0x18f, 6565}, - /*II_66_0F_D7*/ {0x190, 6565}, - /*II_0F_D8*/ {0x15c, 6586}, - /*II_66_0F_D8*/ {0x13e, 6586}, - /*II_0F_D9*/ {0x15c, 6605}, - /*II_66_0F_D9*/ {0x13e, 6605}, - /*II_0F_DA*/ {0x192, 6624}, - /*II_66_0F_DA*/ {0x13e, 6624}, - /*II_0F_DB*/ {0x15c, 6641}, - /*II_66_0F_DB*/ {0x13e, 6641}, - /*II_0F_DC*/ {0x15c, 6654}, - /*II_66_0F_DC*/ {0x13e, 6654}, - /*II_0F_DD*/ {0x15c, 6673}, - /*II_66_0F_DD*/ {0x13e, 6673}, - /*II_0F_DE*/ {0x192, 6682}, - /*II_66_0F_DE*/ {0x13e, 6682}, - /*II_0F_DF*/ {0x15c, 6699}, - /*II_66_0F_DF*/ {0x13e, 6699}, - /*II_0F_E0*/ {0x192, 6714}, - /*II_66_0F_E0*/ {0x13e, 6714}, - /*II_0F_E1*/ {0x15c, 6729}, - /*II_66_0F_E1*/ {0x13e, 6729}, - /*II_0F_E2*/ {0x15c, 6744}, - /*II_66_0F_E2*/ {0x13e, 6744}, - /*II_0F_E3*/ {0x192, 6759}, - /*II_66_0F_E3*/ {0x13e, 6759}, - /*II_0F_E4*/ {0x192, 6774}, - /*II_66_0F_E4*/ {0x13e, 6774}, - /*II_0F_E5*/ {0x15c, 6793}, - /*II_66_0F_E5*/ {0x13e, 6793}, - /*II_66_0F_E6*/ {0x13e, 6810}, - /*II_F3_0F_E6*/ {0x151, 6821}, - /*II_F2_0F_E6*/ {0x13e, 6831}, - /*II_0F_E7*/ {0x193, 6875}, - /*II_66_0F_E7*/ {0x147, 6883}, - /*II_0F_E8*/ {0x15c, 6902}, - /*II_66_0F_E8*/ {0x13e, 6902}, - /*II_0F_E9*/ {0x15c, 6919}, - /*II_66_0F_E9*/ {0x13e, 6919}, - /*II_0F_EA*/ {0x192, 6936}, - /*II_66_0F_EA*/ {0x13e, 6936}, - /*II_0F_EB*/ {0x15c, 6953}, - /*II_66_0F_EB*/ {0x13e, 6953}, - /*II_0F_EC*/ {0x15c, 6964}, - /*II_66_0F_EC*/ {0x13e, 6964}, - /*II_0F_ED*/ {0x15c, 6981}, - /*II_66_0F_ED*/ {0x13e, 6981}, - /*II_0F_EE*/ {0x192, 6998}, - /*II_66_0F_EE*/ {0x13e, 6998}, - /*II_0F_EF*/ {0x15c, 7015}, - /*II_66_0F_EF*/ {0x13e, 7015}, - /*II_F2_0F_F0*/ {0x194, 7028}, - /*II_0F_F1*/ {0x15c, 7043}, - /*II_66_0F_F1*/ {0x13e, 7043}, - /*II_0F_F2*/ {0x15c, 7058}, - /*II_66_0F_F2*/ {0x13e, 7058}, - /*II_0F_F3*/ {0x15c, 7073}, - /*II_66_0F_F3*/ {0x13e, 7073}, - /*II_0F_F4*/ {0x196, 7088}, - /*II_66_0F_F4*/ {0x13e, 7088}, - /*II_0F_F5*/ {0x15c, 7107}, - /*II_66_0F_F5*/ {0x13e, 7107}, - /*II_0F_F6*/ {0x192, 7126}, - /*II_66_0F_F6*/ {0x13e, 7126}, - /*II_0F_F7*/ {0x197, 7143}, - /*II_66_0F_F7*/ {0x198, 7153}, - /*II_0F_F8*/ {0x15c, 7178}, - /*II_66_0F_F8*/ {0x13e, 7178}, - /*II_0F_F9*/ {0x15c, 7193}, - /*II_66_0F_F9*/ {0x13e, 7193}, - /*II_0F_FA*/ {0x15c, 7208}, - /*II_66_0F_FA*/ {0x13e, 7208}, - /*II_0F_FB*/ {0x196, 7223}, - /*II_66_0F_FB*/ {0x13e, 7223}, - /*II_0F_FC*/ {0x15c, 7238}, - /*II_66_0F_FC*/ {0x13e, 7238}, - /*II_0F_FD*/ {0x15c, 7253}, - /*II_66_0F_FD*/ {0x13e, 7253}, - /*II_0F_FE*/ {0x15c, 7268}, - /*II_66_0F_FE*/ {0x13e, 7268}, - /*II_D9_06*/ {0x19a, 7283}, - /*II_9B_D9_06*/ {0x19b, 7292}, - /*II_D9_07*/ {0xfe, 7300}, - /*II_9B_D9_07*/ {0x19c, 7308}, - /*II_DB_E2*/ {0xec, 7315}, - /*II_9B_DB_E2*/ {0x19d, 7323}, - /*II_DB_E3*/ {0xec, 7330}, - /*II_9B_DB_E3*/ {0x19d, 7338}, - /*II_DD_06*/ {0x19a, 7345}, - /*II_9B_DD_06*/ {0x19b, 7353}, - /*II_DD_07*/ {0xfe, 7360}, - /*II_9B_DD_07*/ {0x19c, 7368}, - /*II_DF_E0*/ {0x19e, 7360}, - /*II_9B_DF_E0*/ {0x19f, 7368}, - /*II_0F_38_00*/ {0x1a0, 7375}, - /*II_66_0F_38_00*/ {0x1a1, 7375}, - /*II_0F_38_01*/ {0x1a0, 7392}, - /*II_66_0F_38_01*/ {0x1a1, 7392}, - /*II_0F_38_02*/ {0x1a0, 7409}, - /*II_66_0F_38_02*/ {0x1a1, 7409}, - /*II_0F_38_03*/ {0x1a0, 7426}, - /*II_66_0F_38_03*/ {0x1a1, 7426}, - /*II_0F_38_04*/ {0x1a0, 7445}, - /*II_66_0F_38_04*/ {0x1a1, 7445}, - /*II_0F_38_05*/ {0x1a0, 7468}, - /*II_66_0F_38_05*/ {0x1a1, 7468}, - /*II_0F_38_06*/ {0x1a0, 7485}, - /*II_66_0F_38_06*/ {0x1a1, 7485}, - /*II_0F_38_07*/ {0x1a0, 7502}, - /*II_66_0F_38_07*/ {0x1a1, 7502}, - /*II_0F_38_08*/ {0x1a0, 7521}, - /*II_66_0F_38_08*/ {0x1a1, 7521}, - /*II_0F_38_09*/ {0x1a0, 7538}, - /*II_66_0F_38_09*/ {0x1a1, 7538}, - /*II_0F_38_0A*/ {0x1a0, 7555}, - /*II_66_0F_38_0A*/ {0x1a1, 7555}, - /*II_0F_38_0B*/ {0x1a0, 7572}, - /*II_66_0F_38_0B*/ {0x1a1, 7572}, - /*II_66_0F_38_17*/ {0x1a3, 7663}, - /*II_0F_38_1C*/ {0x1a0, 7722}, - /*II_66_0F_38_1C*/ {0x1a1, 7722}, - /*II_0F_38_1D*/ {0x1a0, 7737}, - /*II_66_0F_38_1D*/ {0x1a1, 7737}, - /*II_0F_38_1E*/ {0x1a0, 7752}, - /*II_66_0F_38_1E*/ {0x1a1, 7752}, - /*II_66_0F_38_20*/ {0x1a8, 7767}, - /*II_66_0F_38_21*/ {0x1a9, 7788}, - /*II_66_0F_38_22*/ {0x1aa, 7809}, - /*II_66_0F_38_23*/ {0x1a8, 7830}, - /*II_66_0F_38_24*/ {0x1a9, 7851}, - /*II_66_0F_38_25*/ {0x1a8, 7872}, - /*II_66_0F_38_28*/ {0x1ac, 7893}, - /*II_66_0F_38_29*/ {0x1ac, 7910}, - /*II_66_0F_38_2A*/ {0x1ad, 7929}, - /*II_66_0F_38_2B*/ {0x1ac, 7950}, - /*II_66_0F_38_30*/ {0x1a8, 7995}, - /*II_66_0F_38_31*/ {0x1a9, 8016}, - /*II_66_0F_38_32*/ {0x1aa, 8037}, - /*II_66_0F_38_33*/ {0x1a8, 8058}, - /*II_66_0F_38_34*/ {0x1a9, 8079}, - /*II_66_0F_38_35*/ {0x1a8, 8100}, - /*II_66_0F_38_37*/ {0x1a3, 8121}, - /*II_66_0F_38_38*/ {0x1ac, 8140}, - /*II_66_0F_38_39*/ {0x1ac, 8157}, - /*II_66_0F_38_3A*/ {0x1ac, 8174}, - /*II_66_0F_38_3B*/ {0x1ac, 8191}, - /*II_66_0F_38_3C*/ {0x1ac, 8208}, - /*II_66_0F_38_3D*/ {0x1ac, 8225}, - /*II_66_0F_38_3E*/ {0x1ac, 8242}, - /*II_66_0F_38_3F*/ {0x1ac, 8259}, - /*II_66_0F_38_40*/ {0x1ac, 8276}, - /*II_66_0F_38_41*/ {0x1ac, 8293}, - /*II_66_0F_38_80*/ {0x1b0, 8318}, - /*II_66_0F_38_81*/ {0x1b0, 8326}, - /*II_66_0F_38_82*/ {0x1b0, 8335}, - /*II_66_0F_38_DB*/ {0x1b3, 9184}, - /*II_66_0F_38_DC*/ {0x1b3, 9201}, - /*II_66_0F_38_DD*/ {0x1b3, 9218}, - /*II_66_0F_38_DE*/ {0x1b3, 9243}, - /*II_66_0F_38_DF*/ {0x1b3, 9260}, - /*II_0F_38_F0*/ {0x1b6, 9285}, - /*II_F2_0F_38_F0*/ {0x1b7, 9292}, - /*II_0F_38_F1*/ {0x1b8, 9285}, - /*II_F2_0F_38_F1*/ {0x1b9, 9292}, - /*II_0F_71_02*/ {0x1d0, 6470}, - /*II_66_0F_71_02*/ {0x1d1, 6470}, - /*II_0F_71_04*/ {0x1d0, 6729}, - /*II_66_0F_71_04*/ {0x1d1, 6729}, - /*II_0F_71_06*/ {0x1d0, 7043}, - /*II_66_0F_71_06*/ {0x1d1, 7043}, - /*II_0F_72_02*/ {0x1d0, 6485}, - /*II_66_0F_72_02*/ {0x1d1, 6485}, - /*II_0F_72_04*/ {0x1d0, 6744}, - /*II_66_0F_72_04*/ {0x1d1, 6744}, - /*II_0F_72_06*/ {0x1d0, 7058}, - /*II_66_0F_72_06*/ {0x1d1, 7058}, - /*II_0F_73_02*/ {0x1d0, 6500}, - /*II_66_0F_73_02*/ {0x1d1, 6500}, - /*II_66_0F_73_03*/ {0x1d1, 9864}, - /*II_0F_73_06*/ {0x1d0, 7073}, - /*II_66_0F_73_06*/ {0x1d1, 7073}, - /*II_66_0F_73_07*/ {0x1d1, 9881}, - /*II_F3_0F_AE_00*/ {0x1d3, 9916}, - /*II_F3_0F_AE_01*/ {0x1d3, 9946}, - /*II_0F_AE_02*/ {0x1d4, 9956}, - /*II_F3_0F_AE_02*/ {0x1d3, 9965}, - /*II_0F_AE_03*/ {0x1d4, 9985}, - /*II_F3_0F_AE_03*/ {0x1d3, 9994}, - /*II_0F_C7_06*/ {0x1d6, 10014}, - /*II_66_0F_C7_06*/ {0x18b, 10023}, - /*II_F3_0F_C7_06*/ {0x18b, 10032} + /*II_0F_00_00*/ {0x110, 1656}, + /*II_0F_00_01*/ {0x111, 1662}, + /*II_0F_00_02*/ {0x112, 1667}, + /*II_0F_00_03*/ {0x113, 1673}, + /*II_0F_00_04*/ {0x114, 1678}, + /*II_0F_00_05*/ {0x114, 1684}, + /*II_0F_01_00*/ {0x115, 1690}, + /*II_0F_01_01*/ {0x115, 1696}, + /*II_0F_01_02*/ {0x116, 1702}, + /*II_0F_01_03*/ {0x116, 1708}, + /*II_0F_01_04*/ {0x117, 1714}, + /*II_0F_01_06*/ {0x118, 1720}, + /*II_0F_01_07*/ {0x119, 1726}, + /*II_0F_01_C1*/ {0x11a, 1734}, + /*II_0F_01_C2*/ {0x11a, 1742}, + /*II_0F_01_C3*/ {0x11a, 1752}, + /*II_0F_01_C4*/ {0x11a, 1762}, + /*II_0F_01_C8*/ {0x11b, 1770}, + /*II_0F_01_C9*/ {0x11b, 1779}, + /*II_0F_01_CA*/ {0x11b, 1786}, + /*II_0F_01_CB*/ {0x11b, 1792}, + /*II_0F_01_D0*/ {0x91, 1798}, + /*II_0F_01_D1*/ {0x91, 1806}, + /*II_0F_01_D4*/ {0x11a, 1814}, + /*II_0F_01_D5*/ {0x11c, 1822}, + /*II_0F_01_D8*/ {0x11d, 1828}, + /*II_0F_01_D9*/ {0x11e, 1835}, + /*II_0F_01_DA*/ {0x11f, 1844}, + /*II_0F_01_DB*/ {0x11f, 1852}, + /*II_0F_01_DC*/ {0x11e, 1860}, + /*II_0F_01_DD*/ {0x11e, 1866}, + /*II_0F_01_DE*/ {0x11f, 1872}, + /*II_0F_01_DF*/ {0x120, 1880}, + /*II_0F_01_F8*/ {0x121, 1889}, + /*II_0F_01_F9*/ {0x121, 1897}, + /*II_0F_0D_00*/ {0x122, 1905}, + /*II_0F_0D_01*/ {0x122, 1915}, + /*II_0F_0F_0C*/ {0x123, 1926}, + /*II_0F_0F_0D*/ {0x124, 1933}, + /*II_0F_0F_1C*/ {0x123, 1940}, + /*II_0F_0F_1D*/ {0x124, 1947}, + /*II_0F_0F_8A*/ {0x123, 1954}, + /*II_0F_0F_8E*/ {0x123, 1962}, + /*II_0F_0F_90*/ {0x124, 1971}, + /*II_0F_0F_94*/ {0x124, 1980}, + /*II_0F_0F_96*/ {0x124, 1987}, + /*II_0F_0F_97*/ {0x124, 1994}, + /*II_0F_0F_9A*/ {0x124, 2003}, + /*II_0F_0F_9E*/ {0x124, 2010}, + /*II_0F_0F_A0*/ {0x124, 2017}, + /*II_0F_0F_A4*/ {0x124, 2026}, + /*II_0F_0F_A6*/ {0x124, 2033}, + /*II_0F_0F_A7*/ {0x124, 2043}, + /*II_0F_0F_AA*/ {0x124, 2053}, + /*II_0F_0F_AE*/ {0x124, 2061}, + /*II_0F_0F_B0*/ {0x124, 2068}, + /*II_0F_0F_B4*/ {0x124, 2077}, + /*II_0F_0F_B6*/ {0x124, 2084}, + /*II_0F_0F_B7*/ {0x124, 2094}, + /*II_0F_0F_BB*/ {0x123, 2103}, + /*II_0F_0F_BF*/ {0x124, 2111}, + /*II_0F_10*/ {0x125, 2120}, + /*II_66_0F_10*/ {0x126, 2128}, + /*II_F3_0F_10*/ {0x127, 2136}, + /*II_F2_0F_10*/ {0x128, 2143}, + /*II_0F_11*/ {0x12d, 2120}, + /*II_66_0F_11*/ {0x12e, 2128}, + /*II_F3_0F_11*/ {0x12f, 2136}, + /*II_F2_0F_11*/ {0x130, 2143}, + /*II_66_0F_12*/ {0x135, 2201}, + /*II_F3_0F_12*/ {0x136, 2209}, + /*II_F2_0F_12*/ {0x136, 2219}, + /*II_0F_13*/ {0x13a, 2193}, + /*II_66_0F_13*/ {0x13b, 2201}, + /*II_0F_14*/ {0x13d, 2277}, + /*II_66_0F_14*/ {0x13e, 2287}, + /*II_0F_15*/ {0x13d, 2319}, + /*II_66_0F_15*/ {0x13e, 2329}, + /*II_66_0F_16*/ {0x135, 2378}, + /*II_F3_0F_16*/ {0x140, 2386}, + /*II_0F_17*/ {0x13a, 2370}, + /*II_66_0F_17*/ {0x13b, 2378}, + /*II_0F_18_00*/ {0x141, 2435}, + /*II_0F_18_01*/ {0x141, 2448}, + /*II_0F_18_02*/ {0x141, 2460}, + /*II_0F_18_03*/ {0x141, 2472}, + /*II_0F_28*/ {0x125, 2484}, + /*II_66_0F_28*/ {0x126, 2492}, + /*II_0F_29*/ {0x12d, 2484}, + /*II_66_0F_29*/ {0x12e, 2492}, + /*II_0F_2A*/ {0x142, 2518}, + /*II_66_0F_2A*/ {0x143, 2528}, + /*II_F3_0F_2A*/ {0x144, 2538}, + /*II_F2_0F_2A*/ {0x145, 2548}, + /*II_0F_2B*/ {0x146, 2580}, + /*II_66_0F_2B*/ {0x147, 2589}, + /*II_F3_0F_2B*/ {0x148, 2598}, + /*II_F2_0F_2B*/ {0x149, 2607}, + /*II_0F_2C*/ {0x14b, 2636}, + /*II_66_0F_2C*/ {0x14c, 2647}, + /*II_F3_0F_2C*/ {0x14d, 2658}, + /*II_F2_0F_2C*/ {0x14e, 2669}, + /*II_0F_2D*/ {0x14b, 2704}, + /*II_66_0F_2D*/ {0x13e, 2714}, + /*II_F3_0F_2D*/ {0x14d, 2724}, + /*II_F2_0F_2D*/ {0x14e, 2734}, + /*II_0F_2E*/ {0x150, 2766}, + /*II_66_0F_2E*/ {0x151, 2775}, + /*II_0F_2F*/ {0x150, 2804}, + /*II_66_0F_2F*/ {0x151, 2812}, + /*II_0F_50*/ {0x154, 2838}, + /*II_66_0F_50*/ {0x155, 2848}, + /*II_0F_51*/ {0x13d, 2880}, + /*II_66_0F_51*/ {0x13e, 2888}, + /*II_F3_0F_51*/ {0x157, 2896}, + /*II_F2_0F_51*/ {0x151, 2904}, + /*II_0F_52*/ {0x13d, 2948}, + /*II_F3_0F_52*/ {0x157, 2957}, + /*II_0F_53*/ {0x13d, 2986}, + /*II_F3_0F_53*/ {0x157, 2993}, + /*II_0F_54*/ {0x13d, 3016}, + /*II_66_0F_54*/ {0x13e, 3023}, + /*II_0F_55*/ {0x13d, 3046}, + /*II_66_0F_55*/ {0x13e, 3054}, + /*II_0F_56*/ {0x13d, 3080}, + /*II_66_0F_56*/ {0x13e, 3086}, + /*II_0F_57*/ {0x13d, 3106}, + /*II_66_0F_57*/ {0x13e, 3113}, + /*II_0F_58*/ {0x13d, 3136}, + /*II_66_0F_58*/ {0x13e, 3143}, + /*II_F3_0F_58*/ {0x157, 3150}, + /*II_F2_0F_58*/ {0x151, 3157}, + /*II_0F_59*/ {0x13d, 3196}, + /*II_66_0F_59*/ {0x13e, 3203}, + /*II_F3_0F_59*/ {0x157, 3210}, + /*II_F2_0F_59*/ {0x151, 3217}, + /*II_0F_5A*/ {0x151, 3256}, + /*II_66_0F_5A*/ {0x13e, 3266}, + /*II_F3_0F_5A*/ {0x158, 3276}, + /*II_F2_0F_5A*/ {0x151, 3286}, + /*II_0F_5B*/ {0x13e, 3340}, + /*II_66_0F_5B*/ {0x13e, 3350}, + /*II_F3_0F_5B*/ {0x13e, 3360}, + /*II_0F_5C*/ {0x13d, 3405}, + /*II_66_0F_5C*/ {0x13e, 3412}, + /*II_F3_0F_5C*/ {0x157, 3419}, + /*II_F2_0F_5C*/ {0x151, 3426}, + /*II_0F_5D*/ {0x13d, 3465}, + /*II_66_0F_5D*/ {0x13e, 3472}, + /*II_F3_0F_5D*/ {0x157, 3479}, + /*II_F2_0F_5D*/ {0x151, 3486}, + /*II_0F_5E*/ {0x13d, 3525}, + /*II_66_0F_5E*/ {0x13e, 3532}, + /*II_F3_0F_5E*/ {0x157, 3539}, + /*II_F2_0F_5E*/ {0x151, 3546}, + /*II_0F_5F*/ {0x13d, 3585}, + /*II_66_0F_5F*/ {0x13e, 3592}, + /*II_F3_0F_5F*/ {0x157, 3599}, + /*II_F2_0F_5F*/ {0x151, 3606}, + /*II_0F_60*/ {0x15b, 3645}, + /*II_66_0F_60*/ {0x13e, 3645}, + /*II_0F_61*/ {0x15b, 3668}, + /*II_66_0F_61*/ {0x13e, 3668}, + /*II_0F_62*/ {0x15b, 3691}, + /*II_66_0F_62*/ {0x13e, 3691}, + /*II_0F_63*/ {0x15c, 3714}, + /*II_66_0F_63*/ {0x13e, 3714}, + /*II_0F_64*/ {0x15c, 3735}, + /*II_66_0F_64*/ {0x13e, 3735}, + /*II_0F_65*/ {0x15c, 3754}, + /*II_66_0F_65*/ {0x13e, 3754}, + /*II_0F_66*/ {0x15c, 3773}, + /*II_66_0F_66*/ {0x13e, 3773}, + /*II_0F_67*/ {0x15c, 3792}, + /*II_66_0F_67*/ {0x13e, 3792}, + /*II_0F_68*/ {0x15c, 3813}, + /*II_66_0F_68*/ {0x13e, 3813}, + /*II_0F_69*/ {0x15c, 3836}, + /*II_66_0F_69*/ {0x13e, 3836}, + /*II_0F_6A*/ {0x15c, 3859}, + /*II_66_0F_6A*/ {0x13e, 3859}, + /*II_0F_6B*/ {0x15c, 3882}, + /*II_66_0F_6B*/ {0x13e, 3882}, + /*II_66_0F_6C*/ {0x13e, 3903}, + /*II_66_0F_6D*/ {0x13e, 3928}, + /*II_0F_6F*/ {0x160, 3959}, + /*II_66_0F_6F*/ {0x126, 3979}, + /*II_F3_0F_6F*/ {0x126, 3987}, + /*II_0F_74*/ {0x15c, 4076}, + /*II_66_0F_74*/ {0x13e, 4076}, + /*II_0F_75*/ {0x15c, 4095}, + /*II_66_0F_75*/ {0x13e, 4095}, + /*II_0F_76*/ {0x15c, 4114}, + /*II_66_0F_76*/ {0x13e, 4114}, + /*II_0F_77*/ {0x164, 4133}, + /*II_0F_78*/ {0x166, 4161}, + /*II_0F_79*/ {0x169, 4185}, + /*II_66_0F_79*/ {0x16a, 4169}, + /*II_F2_0F_79*/ {0x16b, 4176}, + /*II_0F_7A_30*/ {0x16c, 4194}, + /*II_0F_7A_31*/ {0x16d, 4204}, + /*II_66_0F_7C*/ {0x16e, 4214}, + /*II_F2_0F_7C*/ {0x16e, 4222}, + /*II_66_0F_7D*/ {0x16e, 4248}, + /*II_F2_0F_7D*/ {0x16e, 4256}, + /*II_F3_0F_7E*/ {0x128, 3959}, + /*II_0F_7F*/ {0x172, 3959}, + /*II_66_0F_7F*/ {0x12e, 3979}, + /*II_F3_0F_7F*/ {0x12e, 3987}, + /*II_F3_0F_B8*/ {0x176, 4371}, + /*II_0F_BA_04*/ {0x177, 871}, + /*II_0F_BA_05*/ {0x178, 886}, + /*II_0F_BA_06*/ {0x178, 911}, + /*II_0F_BA_07*/ {0x178, 933}, + /*II_0F_BC*/ {0x179, 4379}, + /*II_F3_0F_BC*/ {0x17a, 4384}, + /*II_0F_BD*/ {0x179, 4391}, + /*II_F3_0F_BD*/ {0x17b, 4396}, + /*II_0F_C7_07*/ {0x18b, 6418}, + /*II_66_0F_D0*/ {0x16e, 6427}, + /*II_F2_0F_D0*/ {0x16e, 6437}, + /*II_0F_D1*/ {0x15c, 6469}, + /*II_66_0F_D1*/ {0x13e, 6469}, + /*II_0F_D2*/ {0x15c, 6484}, + /*II_66_0F_D2*/ {0x13e, 6484}, + /*II_0F_D3*/ {0x15c, 6499}, + /*II_66_0F_D3*/ {0x13e, 6499}, + /*II_0F_D4*/ {0x151, 6514}, + /*II_66_0F_D4*/ {0x13e, 6514}, + /*II_0F_D5*/ {0x15c, 6529}, + /*II_66_0F_D5*/ {0x13e, 6529}, + /*II_66_0F_D6*/ {0x130, 3959}, + /*II_F3_0F_D6*/ {0x18c, 6546}, + /*II_F2_0F_D6*/ {0x18d, 6555}, + /*II_0F_D7*/ {0x18f, 6564}, + /*II_66_0F_D7*/ {0x190, 6564}, + /*II_0F_D8*/ {0x15c, 6585}, + /*II_66_0F_D8*/ {0x13e, 6585}, + /*II_0F_D9*/ {0x15c, 6604}, + /*II_66_0F_D9*/ {0x13e, 6604}, + /*II_0F_DA*/ {0x192, 6623}, + /*II_66_0F_DA*/ {0x13e, 6623}, + /*II_0F_DB*/ {0x15c, 6640}, + /*II_66_0F_DB*/ {0x13e, 6640}, + /*II_0F_DC*/ {0x15c, 6653}, + /*II_66_0F_DC*/ {0x13e, 6653}, + /*II_0F_DD*/ {0x15c, 6672}, + /*II_66_0F_DD*/ {0x13e, 6672}, + /*II_0F_DE*/ {0x192, 6681}, + /*II_66_0F_DE*/ {0x13e, 6681}, + /*II_0F_DF*/ {0x15c, 6698}, + /*II_66_0F_DF*/ {0x13e, 6698}, + /*II_0F_E0*/ {0x192, 6713}, + /*II_66_0F_E0*/ {0x13e, 6713}, + /*II_0F_E1*/ {0x15c, 6728}, + /*II_66_0F_E1*/ {0x13e, 6728}, + /*II_0F_E2*/ {0x15c, 6743}, + /*II_66_0F_E2*/ {0x13e, 6743}, + /*II_0F_E3*/ {0x192, 6758}, + /*II_66_0F_E3*/ {0x13e, 6758}, + /*II_0F_E4*/ {0x192, 6773}, + /*II_66_0F_E4*/ {0x13e, 6773}, + /*II_0F_E5*/ {0x15c, 6792}, + /*II_66_0F_E5*/ {0x13e, 6792}, + /*II_66_0F_E6*/ {0x13e, 6809}, + /*II_F3_0F_E6*/ {0x151, 6820}, + /*II_F2_0F_E6*/ {0x13e, 6830}, + /*II_0F_E7*/ {0x193, 6874}, + /*II_66_0F_E7*/ {0x147, 6882}, + /*II_0F_E8*/ {0x15c, 6901}, + /*II_66_0F_E8*/ {0x13e, 6901}, + /*II_0F_E9*/ {0x15c, 6918}, + /*II_66_0F_E9*/ {0x13e, 6918}, + /*II_0F_EA*/ {0x192, 6935}, + /*II_66_0F_EA*/ {0x13e, 6935}, + /*II_0F_EB*/ {0x15c, 6952}, + /*II_66_0F_EB*/ {0x13e, 6952}, + /*II_0F_EC*/ {0x15c, 6963}, + /*II_66_0F_EC*/ {0x13e, 6963}, + /*II_0F_ED*/ {0x15c, 6980}, + /*II_66_0F_ED*/ {0x13e, 6980}, + /*II_0F_EE*/ {0x192, 6997}, + /*II_66_0F_EE*/ {0x13e, 6997}, + /*II_0F_EF*/ {0x15c, 7014}, + /*II_66_0F_EF*/ {0x13e, 7014}, + /*II_F2_0F_F0*/ {0x194, 7027}, + /*II_0F_F1*/ {0x15c, 7042}, + /*II_66_0F_F1*/ {0x13e, 7042}, + /*II_0F_F2*/ {0x15c, 7057}, + /*II_66_0F_F2*/ {0x13e, 7057}, + /*II_0F_F3*/ {0x15c, 7072}, + /*II_66_0F_F3*/ {0x13e, 7072}, + /*II_0F_F4*/ {0x196, 7087}, + /*II_66_0F_F4*/ {0x13e, 7087}, + /*II_0F_F5*/ {0x15c, 7106}, + /*II_66_0F_F5*/ {0x13e, 7106}, + /*II_0F_F6*/ {0x192, 7125}, + /*II_66_0F_F6*/ {0x13e, 7125}, + /*II_0F_F7*/ {0x197, 7142}, + /*II_66_0F_F7*/ {0x198, 7152}, + /*II_0F_F8*/ {0x15c, 7177}, + /*II_66_0F_F8*/ {0x13e, 7177}, + /*II_0F_F9*/ {0x15c, 7192}, + /*II_66_0F_F9*/ {0x13e, 7192}, + /*II_0F_FA*/ {0x15c, 7207}, + /*II_66_0F_FA*/ {0x13e, 7207}, + /*II_0F_FB*/ {0x196, 7222}, + /*II_66_0F_FB*/ {0x13e, 7222}, + /*II_0F_FC*/ {0x15c, 7237}, + /*II_66_0F_FC*/ {0x13e, 7237}, + /*II_0F_FD*/ {0x15c, 7252}, + /*II_66_0F_FD*/ {0x13e, 7252}, + /*II_0F_FE*/ {0x15c, 7267}, + /*II_66_0F_FE*/ {0x13e, 7267}, + /*II_D9_06*/ {0x19a, 7282}, + /*II_9B_D9_06*/ {0x19b, 7291}, + /*II_D9_07*/ {0xfe, 7299}, + /*II_9B_D9_07*/ {0x19c, 7307}, + /*II_DB_E2*/ {0xec, 7314}, + /*II_9B_DB_E2*/ {0x19d, 7322}, + /*II_DB_E3*/ {0xec, 7329}, + /*II_9B_DB_E3*/ {0x19d, 7337}, + /*II_DD_06*/ {0x19a, 7344}, + /*II_9B_DD_06*/ {0x19b, 7352}, + /*II_DD_07*/ {0xfe, 7359}, + /*II_9B_DD_07*/ {0x19c, 7367}, + /*II_DF_E0*/ {0x19e, 7359}, + /*II_9B_DF_E0*/ {0x19f, 7367}, + /*II_0F_38_00*/ {0x1a0, 7374}, + /*II_66_0F_38_00*/ {0x1a1, 7374}, + /*II_0F_38_01*/ {0x1a0, 7391}, + /*II_66_0F_38_01*/ {0x1a1, 7391}, + /*II_0F_38_02*/ {0x1a0, 7408}, + /*II_66_0F_38_02*/ {0x1a1, 7408}, + /*II_0F_38_03*/ {0x1a0, 7425}, + /*II_66_0F_38_03*/ {0x1a1, 7425}, + /*II_0F_38_04*/ {0x1a0, 7444}, + /*II_66_0F_38_04*/ {0x1a1, 7444}, + /*II_0F_38_05*/ {0x1a0, 7467}, + /*II_66_0F_38_05*/ {0x1a1, 7467}, + /*II_0F_38_06*/ {0x1a0, 7484}, + /*II_66_0F_38_06*/ {0x1a1, 7484}, + /*II_0F_38_07*/ {0x1a0, 7501}, + /*II_66_0F_38_07*/ {0x1a1, 7501}, + /*II_0F_38_08*/ {0x1a0, 7520}, + /*II_66_0F_38_08*/ {0x1a1, 7520}, + /*II_0F_38_09*/ {0x1a0, 7537}, + /*II_66_0F_38_09*/ {0x1a1, 7537}, + /*II_0F_38_0A*/ {0x1a0, 7554}, + /*II_66_0F_38_0A*/ {0x1a1, 7554}, + /*II_0F_38_0B*/ {0x1a0, 7571}, + /*II_66_0F_38_0B*/ {0x1a1, 7571}, + /*II_66_0F_38_17*/ {0x1a3, 7662}, + /*II_0F_38_1C*/ {0x1a0, 7721}, + /*II_66_0F_38_1C*/ {0x1a1, 7721}, + /*II_0F_38_1D*/ {0x1a0, 7736}, + /*II_66_0F_38_1D*/ {0x1a1, 7736}, + /*II_0F_38_1E*/ {0x1a0, 7751}, + /*II_66_0F_38_1E*/ {0x1a1, 7751}, + /*II_66_0F_38_20*/ {0x1a8, 7766}, + /*II_66_0F_38_21*/ {0x1a9, 7787}, + /*II_66_0F_38_22*/ {0x1aa, 7808}, + /*II_66_0F_38_23*/ {0x1a8, 7829}, + /*II_66_0F_38_24*/ {0x1a9, 7850}, + /*II_66_0F_38_25*/ {0x1a8, 7871}, + /*II_66_0F_38_28*/ {0x1ac, 7892}, + /*II_66_0F_38_29*/ {0x1ac, 7909}, + /*II_66_0F_38_2A*/ {0x1ad, 7928}, + /*II_66_0F_38_2B*/ {0x1ac, 7949}, + /*II_66_0F_38_30*/ {0x1a8, 7994}, + /*II_66_0F_38_31*/ {0x1a9, 8015}, + /*II_66_0F_38_32*/ {0x1aa, 8036}, + /*II_66_0F_38_33*/ {0x1a8, 8057}, + /*II_66_0F_38_34*/ {0x1a9, 8078}, + /*II_66_0F_38_35*/ {0x1a8, 8099}, + /*II_66_0F_38_37*/ {0x1a3, 8120}, + /*II_66_0F_38_38*/ {0x1ac, 8139}, + /*II_66_0F_38_39*/ {0x1ac, 8156}, + /*II_66_0F_38_3A*/ {0x1ac, 8173}, + /*II_66_0F_38_3B*/ {0x1ac, 8190}, + /*II_66_0F_38_3C*/ {0x1ac, 8207}, + /*II_66_0F_38_3D*/ {0x1ac, 8224}, + /*II_66_0F_38_3E*/ {0x1ac, 8241}, + /*II_66_0F_38_3F*/ {0x1ac, 8258}, + /*II_66_0F_38_40*/ {0x1ac, 8275}, + /*II_66_0F_38_41*/ {0x1ac, 8292}, + /*II_66_0F_38_80*/ {0x1b0, 8317}, + /*II_66_0F_38_81*/ {0x1b0, 8325}, + /*II_66_0F_38_82*/ {0x1b0, 8334}, + /*II_66_0F_38_DB*/ {0x1b3, 9183}, + /*II_66_0F_38_DC*/ {0x1b3, 9200}, + /*II_66_0F_38_DD*/ {0x1b3, 9217}, + /*II_66_0F_38_DE*/ {0x1b3, 9242}, + /*II_66_0F_38_DF*/ {0x1b3, 9259}, + /*II_0F_38_F0*/ {0x1b6, 9284}, + /*II_F2_0F_38_F0*/ {0x1b7, 9291}, + /*II_0F_38_F1*/ {0x1b8, 9284}, + /*II_F2_0F_38_F1*/ {0x1b9, 9291}, + /*II_0F_71_02*/ {0x1d0, 6469}, + /*II_66_0F_71_02*/ {0x1d1, 6469}, + /*II_0F_71_04*/ {0x1d0, 6728}, + /*II_66_0F_71_04*/ {0x1d1, 6728}, + /*II_0F_71_06*/ {0x1d0, 7042}, + /*II_66_0F_71_06*/ {0x1d1, 7042}, + /*II_0F_72_02*/ {0x1d0, 6484}, + /*II_66_0F_72_02*/ {0x1d1, 6484}, + /*II_0F_72_04*/ {0x1d0, 6743}, + /*II_66_0F_72_04*/ {0x1d1, 6743}, + /*II_0F_72_06*/ {0x1d0, 7057}, + /*II_66_0F_72_06*/ {0x1d1, 7057}, + /*II_0F_73_02*/ {0x1d0, 6499}, + /*II_66_0F_73_02*/ {0x1d1, 6499}, + /*II_66_0F_73_03*/ {0x1d1, 9863}, + /*II_0F_73_06*/ {0x1d0, 7072}, + /*II_66_0F_73_06*/ {0x1d1, 7072}, + /*II_66_0F_73_07*/ {0x1d1, 9880}, + /*II_F3_0F_AE_00*/ {0x1d3, 9915}, + /*II_F3_0F_AE_01*/ {0x1d3, 9945}, + /*II_0F_AE_02*/ {0x1d4, 9955}, + /*II_F3_0F_AE_02*/ {0x1d3, 9964}, + /*II_0F_AE_03*/ {0x1d4, 9984}, + /*II_F3_0F_AE_03*/ {0x1d3, 9993}, + /*II_0F_C7_06*/ {0x1d6, 10013}, + /*II_66_0F_C7_06*/ {0x18b, 10022}, + /*II_F3_0F_C7_06*/ {0x18b, 10031} }; _InstInfoEx InstInfosEx[381] = { @@ -1390,383 +1390,383 @@ _InstInfoEx InstInfosEx[381] = { /*II_6B*/ {{0x34, 117}, 0x0, 5, 0, 0, 0}, /*II_98*/ {{0x4e, 228}, 0x0, 0, 0, 233, 239}, /*II_99*/ {{0x4e, 245}, 0x0, 0, 0, 250, 255}, - /*II_E3*/ {{0x76, 427}, 0x0, 0, 0, 433, 440}, - /*II_0F_A4*/ {{0xad, 876}, 0x0, 1, 0, 0, 0}, - /*II_0F_A5*/ {{0xad, 876}, 0x0, 42, 0, 0, 0}, - /*II_0F_AC*/ {{0xad, 892}, 0x0, 1, 0, 0, 0}, - /*II_0F_AD*/ {{0xad, 892}, 0x0, 42, 0, 0, 0}, - /*II_V_0F_10*/ {{0x129, 2151}, 0x41, 0, 0, 0, 0}, - /*II_V_66_0F_10*/ {{0x129, 2160}, 0x41, 0, 0, 0, 0}, - /*II_V_F3_0F_10*/ {{0x12a, 2169}, 0x20, 31, 0, 0, 0}, - /*II_V_F2_0F_10*/ {{0x12a, 2177}, 0x20, 31, 0, 0, 0}, - /*II_VRR_F3_0F_10*/ {{0x12b, 2169}, 0x60, 0, 0, 0, 0}, - /*II_VRR_F2_0F_10*/ {{0x12c, 2177}, 0x60, 0, 0, 0, 0}, - /*II_V_0F_11*/ {{0x131, 2151}, 0x41, 0, 0, 0, 0}, - /*II_V_66_0F_11*/ {{0x131, 2160}, 0x41, 0, 0, 0, 0}, - /*II_V_F3_0F_11*/ {{0x12a, 2169}, 0x20, 31, 0, 0, 0}, - /*II_V_F2_0F_11*/ {{0x12a, 2177}, 0x20, 31, 0, 0, 0}, - /*II_VRR_F3_0F_11*/ {{0x132, 2169}, 0x60, 0, 0, 0, 0}, - /*II_VRR_F2_0F_11*/ {{0x133, 2177}, 0x60, 0, 0, 0, 0}, - /*II_0F_12*/ {{0x134, 2185}, 0x0, 0, 0, 2194, 0}, - /*II_V_0F_12*/ {{0x137, 2229}, 0x0, 86, 0, 2239, 0}, - /*II_V_66_0F_12*/ {{0x138, 2248}, 0x0, 57, 0, 0, 0}, - /*II_V_F3_0F_12*/ {{0x129, 2257}, 0x41, 0, 0, 0, 0}, - /*II_V_F2_0F_12*/ {{0x139, 2268}, 0x41, 0, 0, 0, 0}, - /*II_V_0F_13*/ {{0x13c, 2239}, 0x40, 0, 0, 0, 0}, - /*II_V_66_0F_13*/ {{0x13c, 2248}, 0x40, 0, 0, 0, 0}, - /*II_V_0F_14*/ {{0x13f, 2298}, 0x1, 91, 0, 0, 0}, - /*II_V_66_0F_14*/ {{0x13f, 2309}, 0x1, 91, 0, 0, 0}, - /*II_V_0F_15*/ {{0x13f, 2340}, 0x1, 91, 0, 0, 0}, - /*II_V_66_0F_15*/ {{0x13f, 2351}, 0x1, 91, 0, 0, 0}, - /*II_0F_16*/ {{0x134, 2362}, 0x0, 0, 0, 2371, 0}, - /*II_V_0F_16*/ {{0x137, 2397}, 0x0, 86, 0, 2407, 0}, - /*II_V_66_0F_16*/ {{0x138, 2416}, 0x0, 57, 0, 0, 0}, - /*II_V_F3_0F_16*/ {{0x129, 2425}, 0x41, 0, 0, 0, 0}, - /*II_V_0F_17*/ {{0x13c, 2407}, 0x40, 0, 0, 0, 0}, - /*II_V_66_0F_17*/ {{0x13c, 2416}, 0x40, 0, 0, 0, 0}, - /*II_V_0F_28*/ {{0x129, 2501}, 0x41, 0, 0, 0, 0}, - /*II_V_66_0F_28*/ {{0x129, 2510}, 0x41, 0, 0, 0, 0}, - /*II_V_0F_29*/ {{0x131, 2501}, 0x41, 0, 0, 0, 0}, - /*II_V_66_0F_29*/ {{0x131, 2510}, 0x41, 0, 0, 0, 0}, - /*II_V_F3_0F_2A*/ {{0x138, 2559}, 0x2, 73, 0, 0, 0}, - /*II_V_F2_0F_2A*/ {{0x138, 2570}, 0x2, 73, 0, 0, 0}, - /*II_V_0F_2B*/ {{0x14a, 2617}, 0x41, 0, 0, 0, 0}, - /*II_V_66_0F_2B*/ {{0x14a, 2627}, 0x41, 0, 0, 0, 0}, - /*II_V_F3_0F_2C*/ {{0x14f, 2681}, 0x42, 0, 0, 0, 0}, - /*II_V_F2_0F_2C*/ {{0x14f, 2693}, 0x42, 0, 0, 0, 0}, - /*II_V_F3_0F_2D*/ {{0x14f, 2745}, 0x42, 0, 0, 0, 0}, - /*II_V_F2_0F_2D*/ {{0x14f, 2756}, 0x42, 0, 0, 0, 0}, - /*II_V_0F_2E*/ {{0x152, 2785}, 0x40, 0, 0, 0, 0}, - /*II_V_66_0F_2E*/ {{0x153, 2795}, 0x40, 0, 0, 0, 0}, - /*II_V_0F_2F*/ {{0x152, 2821}, 0x40, 0, 0, 0, 0}, - /*II_V_66_0F_2F*/ {{0x153, 2830}, 0x40, 0, 0, 0, 0}, - /*II_V_0F_50*/ {{0x156, 2859}, 0x41, 0, 0, 0, 0}, - /*II_V_66_0F_50*/ {{0x156, 2870}, 0x41, 0, 0, 0, 0}, - /*II_V_0F_51*/ {{0x129, 2913}, 0x41, 0, 0, 0, 0}, - /*II_V_66_0F_51*/ {{0x129, 2922}, 0x41, 0, 0, 0, 0}, - /*II_V_F3_0F_51*/ {{0x138, 2931}, 0x0, 85, 0, 0, 0}, - /*II_V_F2_0F_51*/ {{0x138, 2940}, 0x0, 86, 0, 0, 0}, - /*II_V_0F_52*/ {{0x129, 2967}, 0x41, 0, 0, 0, 0}, - /*II_V_F3_0F_52*/ {{0x138, 2977}, 0x0, 85, 0, 0, 0}, - /*II_V_0F_53*/ {{0x129, 3001}, 0x41, 0, 0, 0, 0}, - /*II_V_F3_0F_53*/ {{0x138, 3009}, 0x0, 85, 0, 0, 0}, - /*II_V_0F_54*/ {{0x13f, 3031}, 0x1, 91, 0, 0, 0}, - /*II_V_66_0F_54*/ {{0x13f, 3039}, 0x1, 91, 0, 0, 0}, - /*II_V_0F_55*/ {{0x13f, 3063}, 0x1, 91, 0, 0, 0}, - /*II_V_66_0F_55*/ {{0x13f, 3072}, 0x1, 91, 0, 0, 0}, - /*II_V_0F_56*/ {{0x13f, 3093}, 0x1, 91, 0, 0, 0}, - /*II_V_66_0F_56*/ {{0x13f, 3100}, 0x1, 91, 0, 0, 0}, - /*II_V_0F_57*/ {{0x13f, 3121}, 0x1, 91, 0, 0, 0}, - /*II_V_66_0F_57*/ {{0x13f, 3129}, 0x1, 91, 0, 0, 0}, - /*II_V_0F_58*/ {{0x13f, 3165}, 0x1, 91, 0, 0, 0}, - /*II_V_66_0F_58*/ {{0x13f, 3173}, 0x1, 91, 0, 0, 0}, - /*II_V_F3_0F_58*/ {{0x138, 3181}, 0x0, 85, 0, 0, 0}, - /*II_V_F2_0F_58*/ {{0x138, 3189}, 0x0, 86, 0, 0, 0}, - /*II_V_0F_59*/ {{0x13f, 3225}, 0x1, 91, 0, 0, 0}, - /*II_V_66_0F_59*/ {{0x13f, 3233}, 0x1, 91, 0, 0, 0}, - /*II_V_F3_0F_59*/ {{0x138, 3241}, 0x0, 85, 0, 0, 0}, - /*II_V_F2_0F_59*/ {{0x138, 3249}, 0x0, 86, 0, 0, 0}, - /*II_V_0F_5A*/ {{0x159, 3297}, 0x41, 0, 0, 0, 0}, - /*II_V_66_0F_5A*/ {{0x15a, 3308}, 0x41, 0, 0, 0, 0}, - /*II_V_F3_0F_5A*/ {{0x138, 3319}, 0x0, 85, 0, 0, 0}, - /*II_V_F2_0F_5A*/ {{0x138, 3330}, 0x0, 86, 0, 0, 0}, - /*II_V_0F_5B*/ {{0x129, 3372}, 0x41, 0, 0, 0, 0}, - /*II_V_66_0F_5B*/ {{0x129, 3383}, 0x41, 0, 0, 0, 0}, - /*II_V_F3_0F_5B*/ {{0x129, 3394}, 0x41, 0, 0, 0, 0}, - /*II_V_0F_5C*/ {{0x13f, 3434}, 0x1, 91, 0, 0, 0}, - /*II_V_66_0F_5C*/ {{0x13f, 3442}, 0x1, 91, 0, 0, 0}, - /*II_V_F3_0F_5C*/ {{0x138, 3450}, 0x0, 85, 0, 0, 0}, - /*II_V_F2_0F_5C*/ {{0x138, 3458}, 0x0, 86, 0, 0, 0}, - /*II_V_0F_5D*/ {{0x13f, 3494}, 0x1, 91, 0, 0, 0}, - /*II_V_66_0F_5D*/ {{0x13f, 3502}, 0x1, 91, 0, 0, 0}, - /*II_V_F3_0F_5D*/ {{0x138, 3510}, 0x0, 85, 0, 0, 0}, - /*II_V_F2_0F_5D*/ {{0x138, 3518}, 0x0, 86, 0, 0, 0}, - /*II_V_0F_5E*/ {{0x13f, 3554}, 0x1, 91, 0, 0, 0}, - /*II_V_66_0F_5E*/ {{0x13f, 3562}, 0x1, 91, 0, 0, 0}, - /*II_V_F3_0F_5E*/ {{0x138, 3570}, 0x0, 85, 0, 0, 0}, - /*II_V_F2_0F_5E*/ {{0x138, 3578}, 0x0, 86, 0, 0, 0}, - /*II_V_0F_5F*/ {{0x13f, 3614}, 0x1, 91, 0, 0, 0}, - /*II_V_66_0F_5F*/ {{0x13f, 3622}, 0x1, 91, 0, 0, 0}, - /*II_V_F3_0F_5F*/ {{0x138, 3630}, 0x0, 85, 0, 0, 0}, - /*II_V_F2_0F_5F*/ {{0x138, 3638}, 0x0, 86, 0, 0, 0}, - /*II_V_66_0F_60*/ {{0x138, 3657}, 0x0, 87, 0, 0, 0}, - /*II_V_66_0F_61*/ {{0x138, 3680}, 0x0, 87, 0, 0, 0}, - /*II_V_66_0F_62*/ {{0x138, 3703}, 0x0, 87, 0, 0, 0}, - /*II_V_66_0F_63*/ {{0x138, 3725}, 0x0, 87, 0, 0, 0}, - /*II_V_66_0F_64*/ {{0x138, 3745}, 0x0, 87, 0, 0, 0}, - /*II_V_66_0F_65*/ {{0x138, 3764}, 0x0, 87, 0, 0, 0}, - /*II_V_66_0F_66*/ {{0x138, 3783}, 0x0, 87, 0, 0, 0}, - /*II_V_66_0F_67*/ {{0x138, 3803}, 0x0, 87, 0, 0, 0}, - /*II_V_66_0F_68*/ {{0x138, 3825}, 0x0, 87, 0, 0, 0}, - /*II_V_66_0F_69*/ {{0x138, 3848}, 0x0, 87, 0, 0, 0}, - /*II_V_66_0F_6A*/ {{0x138, 3871}, 0x0, 87, 0, 0, 0}, - /*II_V_66_0F_6B*/ {{0x138, 3893}, 0x0, 87, 0, 0, 0}, - /*II_V_66_0F_6C*/ {{0x138, 3916}, 0x0, 87, 0, 0, 0}, - /*II_V_66_0F_6D*/ {{0x138, 3941}, 0x0, 87, 0, 0, 0}, - /*II_0F_6E*/ {{0x15d, 3954}, 0x0, 0, 0, 0, 3960}, - /*II_66_0F_6E*/ {{0x15e, 3954}, 0x0, 0, 0, 0, 3960}, - /*II_V_66_0F_6E*/ {{0x15f, 3966}, 0x46, 0, 0, 3973, 0}, - /*II_V_66_0F_6F*/ {{0x129, 3996}, 0x41, 0, 0, 0, 0}, - /*II_V_F3_0F_6F*/ {{0x129, 4005}, 0x41, 0, 0, 0, 0}, - /*II_0F_70*/ {{0x161, 4014}, 0x0, 1, 0, 0, 0}, - /*II_66_0F_70*/ {{0x162, 4022}, 0x0, 1, 0, 0, 0}, - /*II_F3_0F_70*/ {{0x162, 4030}, 0x0, 1, 0, 0, 0}, - /*II_F2_0F_70*/ {{0x162, 4039}, 0x0, 1, 0, 0, 0}, - /*II_V_66_0F_70*/ {{0x163, 4048}, 0x40, 1, 0, 0, 0}, - /*II_V_F3_0F_70*/ {{0x163, 4057}, 0x40, 1, 0, 0, 0}, - /*II_V_F2_0F_70*/ {{0x163, 4067}, 0x40, 1, 0, 0, 0}, - /*II_V_66_0F_74*/ {{0x138, 4086}, 0x0, 87, 0, 0, 0}, - /*II_V_66_0F_75*/ {{0x138, 4105}, 0x0, 87, 0, 0, 0}, - /*II_V_66_0F_76*/ {{0x138, 4124}, 0x0, 87, 0, 0, 0}, - /*II_V_0F_77*/ {{0x165, 4140}, 0x49, 0, 0, 4152, 0}, - /*II_66_0F_78*/ {{0x167, 4170}, 0x0, 49, 0, 0, 0}, - /*II_F2_0F_78*/ {{0x168, 4177}, 0x0, 48, 49, 0, 0}, - /*II_V_66_0F_7C*/ {{0x13f, 4231}, 0x1, 91, 0, 0, 0}, - /*II_V_F2_0F_7C*/ {{0x13f, 4240}, 0x1, 91, 0, 0, 0}, - /*II_V_66_0F_7D*/ {{0x13f, 4265}, 0x1, 91, 0, 0, 0}, - /*II_V_F2_0F_7D*/ {{0x13f, 4274}, 0x1, 91, 0, 0, 0}, - /*II_0F_7E*/ {{0x16f, 3954}, 0x0, 0, 0, 0, 3960}, - /*II_66_0F_7E*/ {{0x170, 3954}, 0x0, 0, 0, 0, 3960}, - /*II_V_66_0F_7E*/ {{0x171, 3966}, 0x46, 0, 0, 3973, 0}, - /*II_V_F3_0F_7E*/ {{0x153, 3973}, 0x40, 0, 0, 0, 0}, - /*II_V_66_0F_7F*/ {{0x131, 3996}, 0x41, 0, 0, 0, 0}, - /*II_V_F3_0F_7F*/ {{0x131, 4005}, 0x41, 0, 0, 0, 0}, - /*II_0F_AE_04*/ {{0x173, 4283}, 0x0, 0, 0, 0, 4290}, - /*II_0F_AE_05*/ {{0x174, 4299}, 0x0, 0, 0, 4307, 4315}, - /*II_0F_AE_06*/ {{0x174, 4325}, 0x0, 0, 0, 4333, 4343}, - /*II_0F_AE_07*/ {{0x175, 4355}, 0x0, 0, 0, 4363, 0}, - /*II_0F_C2*/ {{0x17c, 4404}, 0x0, 0, 0, 4413, 4422}, - /*II_66_0F_C2*/ {{0x17d, 4483}, 0x0, 0, 0, 4492, 4501}, - /*II_F3_0F_C2*/ {{0x17e, 4562}, 0x0, 0, 0, 4571, 4580}, - /*II_F2_0F_C2*/ {{0x17f, 4641}, 0x0, 0, 0, 4650, 4659}, - /*II_V_0F_C2*/ {{0x180, 4720}, 0x1, 91, 0, 4730, 4740}, - /*II_V_66_0F_C2*/ {{0x180, 5122}, 0x1, 91, 0, 5132, 5142}, - /*II_V_F3_0F_C2*/ {{0x181, 5524}, 0x0, 85, 0, 5534, 5544}, - /*II_V_F2_0F_C2*/ {{0x181, 5926}, 0x0, 86, 0, 5936, 5946}, - /*II_0F_C4*/ {{0x182, 6328}, 0x0, 1, 0, 0, 0}, - /*II_66_0F_C4*/ {{0x183, 6328}, 0x0, 1, 0, 0, 0}, - /*II_V_66_0F_C4*/ {{0x184, 6336}, 0x0, 79, 1, 0, 0}, - /*II_0F_C5*/ {{0x185, 6345}, 0x0, 1, 0, 0, 0}, - /*II_66_0F_C5*/ {{0x186, 6345}, 0x0, 1, 0, 0, 0}, - /*II_V_66_0F_C5*/ {{0x187, 6353}, 0x40, 1, 0, 0, 0}, - /*II_0F_C6*/ {{0x188, 6362}, 0x0, 1, 0, 0, 0}, - /*II_66_0F_C6*/ {{0x162, 6370}, 0x0, 1, 0, 0, 0}, - /*II_V_0F_C6*/ {{0x189, 6378}, 0x1, 91, 1, 0, 0}, - /*II_V_66_0F_C6*/ {{0x189, 6387}, 0x1, 91, 1, 0, 0}, - /*II_0F_C7_01*/ {{0x18a, 6396}, 0x0, 0, 0, 0, 6407}, - /*II_V_66_0F_D0*/ {{0x13f, 6448}, 0x1, 91, 0, 0, 0}, - /*II_V_F2_0F_D0*/ {{0x13f, 6459}, 0x1, 91, 0, 0, 0}, - /*II_V_66_0F_D1*/ {{0x138, 6477}, 0x0, 87, 0, 0, 0}, - /*II_V_66_0F_D2*/ {{0x138, 6492}, 0x0, 87, 0, 0, 0}, - /*II_V_66_0F_D3*/ {{0x138, 6507}, 0x0, 87, 0, 0, 0}, - /*II_V_66_0F_D4*/ {{0x138, 6522}, 0x0, 87, 0, 0, 0}, - /*II_V_66_0F_D5*/ {{0x138, 6538}, 0x0, 87, 0, 0, 0}, - /*II_V_66_0F_D6*/ {{0x18e, 3973}, 0x40, 0, 0, 0, 0}, - /*II_V_66_0F_D7*/ {{0x191, 6575}, 0x40, 0, 0, 0, 0}, - /*II_V_66_0F_D8*/ {{0x138, 6595}, 0x0, 87, 0, 0, 0}, - /*II_V_66_0F_D9*/ {{0x138, 6614}, 0x0, 87, 0, 0, 0}, - /*II_V_66_0F_DA*/ {{0x138, 6632}, 0x0, 87, 0, 0, 0}, - /*II_V_66_0F_DB*/ {{0x138, 6647}, 0x0, 87, 0, 0, 0}, - /*II_V_66_0F_DC*/ {{0x138, 6663}, 0x0, 87, 0, 0, 0}, - /*II_V_66_0F_DD*/ {{0x138, 6663}, 0x0, 87, 0, 0, 0}, - /*II_V_66_0F_DE*/ {{0x138, 6690}, 0x0, 87, 0, 0, 0}, - /*II_V_66_0F_DF*/ {{0x138, 6706}, 0x0, 87, 0, 0, 0}, - /*II_V_66_0F_E0*/ {{0x138, 6721}, 0x0, 87, 0, 0, 0}, - /*II_V_66_0F_E1*/ {{0x138, 6736}, 0x0, 87, 0, 0, 0}, - /*II_V_66_0F_E2*/ {{0x138, 6751}, 0x0, 87, 0, 0, 0}, - /*II_V_66_0F_E3*/ {{0x138, 6766}, 0x0, 87, 0, 0, 0}, - /*II_V_66_0F_E4*/ {{0x138, 6783}, 0x0, 87, 0, 0, 0}, - /*II_V_66_0F_E5*/ {{0x138, 6801}, 0x0, 87, 0, 0, 0}, - /*II_V_66_0F_E6*/ {{0x15a, 6841}, 0x41, 0, 0, 0, 0}, - /*II_V_F3_0F_E6*/ {{0x159, 6853}, 0x41, 0, 0, 0, 0}, - /*II_V_F2_0F_E6*/ {{0x15a, 6864}, 0x41, 0, 0, 0, 0}, - /*II_V_66_0F_E7*/ {{0x14a, 6892}, 0x41, 0, 0, 0, 0}, - /*II_V_66_0F_E8*/ {{0x138, 6910}, 0x0, 87, 0, 0, 0}, - /*II_V_66_0F_E9*/ {{0x138, 6927}, 0x0, 87, 0, 0, 0}, - /*II_V_66_0F_EA*/ {{0x138, 6944}, 0x0, 87, 0, 0, 0}, - /*II_V_66_0F_EB*/ {{0x138, 6958}, 0x0, 87, 0, 0, 0}, - /*II_V_66_0F_EC*/ {{0x138, 6972}, 0x0, 87, 0, 0, 0}, - /*II_V_66_0F_ED*/ {{0x138, 6989}, 0x0, 87, 0, 0, 0}, - /*II_V_66_0F_EE*/ {{0x138, 7006}, 0x0, 87, 0, 0, 0}, - /*II_V_66_0F_EF*/ {{0x138, 7021}, 0x0, 87, 0, 0, 0}, - /*II_V_F2_0F_F0*/ {{0x195, 7035}, 0x41, 0, 0, 0, 0}, - /*II_V_66_0F_F1*/ {{0x138, 7050}, 0x0, 87, 0, 0, 0}, - /*II_V_66_0F_F2*/ {{0x138, 7065}, 0x0, 87, 0, 0, 0}, - /*II_V_66_0F_F3*/ {{0x138, 7080}, 0x0, 87, 0, 0, 0}, - /*II_V_66_0F_F4*/ {{0x138, 7097}, 0x0, 87, 0, 0, 0}, - /*II_V_66_0F_F5*/ {{0x138, 7116}, 0x0, 87, 0, 0, 0}, - /*II_V_66_0F_F6*/ {{0x138, 7134}, 0x0, 87, 0, 0, 0}, - /*II_V_66_0F_F7*/ {{0x199, 7165}, 0x40, 0, 0, 0, 0}, - /*II_V_66_0F_F8*/ {{0x138, 7185}, 0x0, 87, 0, 0, 0}, - /*II_V_66_0F_F9*/ {{0x138, 7200}, 0x0, 87, 0, 0, 0}, - /*II_V_66_0F_FA*/ {{0x138, 7215}, 0x0, 87, 0, 0, 0}, - /*II_V_66_0F_FB*/ {{0x138, 7230}, 0x0, 87, 0, 0, 0}, - /*II_V_66_0F_FC*/ {{0x138, 7245}, 0x0, 87, 0, 0, 0}, - /*II_V_66_0F_FD*/ {{0x138, 7260}, 0x0, 87, 0, 0, 0}, - /*II_V_66_0F_FE*/ {{0x138, 7275}, 0x0, 87, 0, 0, 0}, - /*II_V_66_0F_38_00*/ {{0x138, 7383}, 0x0, 87, 0, 0, 0}, - /*II_V_66_0F_38_01*/ {{0x138, 7400}, 0x0, 87, 0, 0, 0}, - /*II_V_66_0F_38_02*/ {{0x138, 7417}, 0x0, 87, 0, 0, 0}, - /*II_V_66_0F_38_03*/ {{0x138, 7435}, 0x0, 87, 0, 0, 0}, - /*II_V_66_0F_38_04*/ {{0x138, 7456}, 0x0, 87, 0, 0, 0}, - /*II_V_66_0F_38_05*/ {{0x138, 7476}, 0x0, 87, 0, 0, 0}, - /*II_V_66_0F_38_06*/ {{0x138, 7493}, 0x0, 87, 0, 0, 0}, - /*II_V_66_0F_38_07*/ {{0x138, 7511}, 0x0, 87, 0, 0, 0}, - /*II_V_66_0F_38_08*/ {{0x138, 7529}, 0x0, 87, 0, 0, 0}, - /*II_V_66_0F_38_09*/ {{0x138, 7546}, 0x0, 87, 0, 0, 0}, - /*II_V_66_0F_38_0A*/ {{0x138, 7563}, 0x0, 87, 0, 0, 0}, - /*II_V_66_0F_38_0B*/ {{0x138, 7582}, 0x0, 87, 0, 0, 0}, - /*II_V_66_0F_38_0C*/ {{0x13f, 7593}, 0x1, 91, 0, 0, 0}, - /*II_V_66_0F_38_0D*/ {{0x13f, 7604}, 0x1, 91, 0, 0, 0}, - /*II_V_66_0F_38_0E*/ {{0x129, 7615}, 0x41, 0, 0, 0, 0}, - /*II_V_66_0F_38_0F*/ {{0x129, 7624}, 0x41, 0, 0, 0, 0}, - /*II_66_0F_38_10*/ {{0x1a2, 7633}, 0x0, 32, 0, 0, 0}, - /*II_66_0F_38_14*/ {{0x1a2, 7643}, 0x0, 32, 0, 0, 0}, - /*II_66_0F_38_15*/ {{0x1a2, 7653}, 0x0, 32, 0, 0, 0}, - /*II_V_66_0F_38_17*/ {{0x129, 7670}, 0x41, 0, 0, 0, 0}, - /*II_V_66_0F_38_18*/ {{0x1a4, 7678}, 0x41, 0, 0, 0, 0}, - /*II_V_66_0F_38_19*/ {{0x1a5, 7692}, 0x50, 0, 0, 0, 0}, - /*II_V_66_0F_38_1A*/ {{0x1a6, 7706}, 0x50, 0, 0, 0, 0}, - /*II_V_66_0F_38_1C*/ {{0x1a7, 7729}, 0x40, 0, 0, 0, 0}, - /*II_V_66_0F_38_1D*/ {{0x1a7, 7744}, 0x40, 0, 0, 0, 0}, - /*II_V_66_0F_38_1E*/ {{0x1a7, 7759}, 0x40, 0, 0, 0, 0}, - /*II_V_66_0F_38_20*/ {{0x153, 7777}, 0x40, 0, 0, 0, 0}, - /*II_V_66_0F_38_21*/ {{0x152, 7798}, 0x40, 0, 0, 0, 0}, - /*II_V_66_0F_38_22*/ {{0x1ab, 7819}, 0x40, 0, 0, 0, 0}, - /*II_V_66_0F_38_23*/ {{0x153, 7840}, 0x40, 0, 0, 0, 0}, - /*II_V_66_0F_38_24*/ {{0x152, 7861}, 0x40, 0, 0, 0, 0}, - /*II_V_66_0F_38_25*/ {{0x153, 7882}, 0x40, 0, 0, 0, 0}, - /*II_V_66_0F_38_28*/ {{0x138, 7901}, 0x0, 87, 0, 0, 0}, - /*II_V_66_0F_38_29*/ {{0x138, 7919}, 0x0, 87, 0, 0, 0}, - /*II_V_66_0F_38_2A*/ {{0x1ae, 7939}, 0x40, 0, 0, 0, 0}, - /*II_V_66_0F_38_2B*/ {{0x138, 7960}, 0x0, 87, 0, 0, 0}, - /*II_V_66_0F_38_2C*/ {{0x13f, 7971}, 0x1, 67, 0, 0, 0}, - /*II_V_66_0F_38_2D*/ {{0x13f, 7983}, 0x1, 67, 0, 0, 0}, - /*II_V_66_0F_38_2E*/ {{0x1af, 7971}, 0x1, 36, 0, 0, 0}, - /*II_V_66_0F_38_2F*/ {{0x1af, 7983}, 0x1, 36, 0, 0, 0}, - /*II_V_66_0F_38_30*/ {{0x153, 8005}, 0x40, 0, 0, 0, 0}, - /*II_V_66_0F_38_31*/ {{0x152, 8026}, 0x40, 0, 0, 0, 0}, - /*II_V_66_0F_38_32*/ {{0x1ab, 8047}, 0x40, 0, 0, 0, 0}, - /*II_V_66_0F_38_33*/ {{0x153, 8068}, 0x40, 0, 0, 0, 0}, - /*II_V_66_0F_38_34*/ {{0x152, 8089}, 0x40, 0, 0, 0, 0}, - /*II_V_66_0F_38_35*/ {{0x153, 8110}, 0x40, 0, 0, 0, 0}, - /*II_V_66_0F_38_37*/ {{0x138, 8130}, 0x0, 87, 0, 0, 0}, - /*II_V_66_0F_38_38*/ {{0x138, 8148}, 0x0, 87, 0, 0, 0}, - /*II_V_66_0F_38_39*/ {{0x138, 8165}, 0x0, 87, 0, 0, 0}, - /*II_V_66_0F_38_3A*/ {{0x138, 8182}, 0x0, 87, 0, 0, 0}, - /*II_V_66_0F_38_3B*/ {{0x138, 8199}, 0x0, 87, 0, 0, 0}, - /*II_V_66_0F_38_3C*/ {{0x138, 8216}, 0x0, 87, 0, 0, 0}, - /*II_V_66_0F_38_3D*/ {{0x138, 8233}, 0x0, 87, 0, 0, 0}, - /*II_V_66_0F_38_3E*/ {{0x138, 8250}, 0x0, 87, 0, 0, 0}, - /*II_V_66_0F_38_3F*/ {{0x138, 8267}, 0x0, 87, 0, 0, 0}, - /*II_V_66_0F_38_40*/ {{0x138, 8284}, 0x0, 87, 0, 0, 0}, - /*II_V_66_0F_38_41*/ {{0x1a7, 8305}, 0x40, 0, 0, 0, 0}, - /*II_V_66_0F_38_96*/ {{0x1b1, 8344}, 0x7, 91, 0, 8360, 0}, - /*II_V_66_0F_38_97*/ {{0x1b1, 8376}, 0x7, 91, 0, 8392, 0}, - /*II_V_66_0F_38_98*/ {{0x1b1, 8408}, 0x7, 91, 0, 8421, 0}, - /*II_V_66_0F_38_99*/ {{0x1b2, 8434}, 0x6, 88, 0, 8447, 0}, - /*II_V_66_0F_38_9A*/ {{0x1b1, 8460}, 0x7, 91, 0, 8473, 0}, - /*II_V_66_0F_38_9B*/ {{0x1b2, 8486}, 0x6, 88, 0, 8499, 0}, - /*II_V_66_0F_38_9C*/ {{0x1b1, 8512}, 0x7, 91, 0, 8526, 0}, - /*II_V_66_0F_38_9D*/ {{0x1b2, 8540}, 0x6, 88, 0, 8554, 0}, - /*II_V_66_0F_38_9E*/ {{0x1b1, 8568}, 0x7, 91, 0, 8582, 0}, - /*II_V_66_0F_38_9F*/ {{0x1b2, 8596}, 0x6, 88, 0, 8610, 0}, - /*II_V_66_0F_38_A6*/ {{0x1b1, 8624}, 0x7, 91, 0, 8640, 0}, - /*II_V_66_0F_38_A7*/ {{0x1b1, 8656}, 0x7, 91, 0, 8672, 0}, - /*II_V_66_0F_38_A8*/ {{0x1b1, 8688}, 0x7, 91, 0, 8701, 0}, - /*II_V_66_0F_38_A9*/ {{0x1b2, 8714}, 0x6, 88, 0, 8727, 0}, - /*II_V_66_0F_38_AA*/ {{0x1b1, 8740}, 0x7, 91, 0, 8753, 0}, - /*II_V_66_0F_38_AB*/ {{0x1b2, 8766}, 0x6, 88, 0, 8779, 0}, - /*II_V_66_0F_38_AC*/ {{0x1b1, 8792}, 0x7, 91, 0, 8806, 0}, - /*II_V_66_0F_38_AD*/ {{0x1b2, 8820}, 0x6, 88, 0, 8834, 0}, - /*II_V_66_0F_38_AE*/ {{0x1b1, 8848}, 0x7, 91, 0, 8862, 0}, - /*II_V_66_0F_38_AF*/ {{0x1b2, 8876}, 0x6, 88, 0, 8890, 0}, - /*II_V_66_0F_38_B6*/ {{0x1b1, 8904}, 0x7, 91, 0, 8920, 0}, - /*II_V_66_0F_38_B7*/ {{0x1b1, 8936}, 0x7, 91, 0, 8952, 0}, - /*II_V_66_0F_38_B8*/ {{0x1b1, 8968}, 0x7, 91, 0, 8981, 0}, - /*II_V_66_0F_38_B9*/ {{0x1b2, 8994}, 0x6, 88, 0, 9007, 0}, - /*II_V_66_0F_38_BA*/ {{0x1b1, 9020}, 0x7, 91, 0, 9033, 0}, - /*II_V_66_0F_38_BB*/ {{0x1b2, 9046}, 0x6, 88, 0, 9059, 0}, - /*II_V_66_0F_38_BC*/ {{0x1b1, 9072}, 0x7, 91, 0, 9086, 0}, - /*II_V_66_0F_38_BD*/ {{0x1b2, 9100}, 0x6, 88, 0, 9114, 0}, - /*II_V_66_0F_38_BE*/ {{0x1b1, 9128}, 0x7, 91, 0, 9142, 0}, - /*II_V_66_0F_38_BF*/ {{0x1b2, 9156}, 0x6, 88, 0, 9170, 0}, - /*II_V_66_0F_38_DB*/ {{0x1b4, 9192}, 0x40, 0, 0, 0, 0}, - /*II_V_66_0F_38_DC*/ {{0x1b5, 9209}, 0x0, 87, 0, 0, 0}, - /*II_V_66_0F_38_DD*/ {{0x1b5, 9230}, 0x0, 87, 0, 0, 0}, - /*II_V_66_0F_38_DE*/ {{0x1b5, 9251}, 0x0, 87, 0, 0, 0}, - /*II_V_66_0F_38_DF*/ {{0x1b5, 9272}, 0x0, 87, 0, 0, 0}, - /*II_V_66_0F_3A_04*/ {{0x1ba, 7593}, 0x41, 1, 0, 0, 0}, - /*II_V_66_0F_3A_05*/ {{0x1ba, 7604}, 0x41, 1, 0, 0, 0}, - /*II_V_66_0F_3A_06*/ {{0x1bb, 9299}, 0x10, 89, 1, 0, 0}, - /*II_66_0F_3A_08*/ {{0x1a2, 9311}, 0x0, 1, 0, 0, 0}, - /*II_V_66_0F_3A_08*/ {{0x1ba, 9320}, 0x41, 1, 0, 0, 0}, - /*II_66_0F_3A_09*/ {{0x1a2, 9330}, 0x0, 1, 0, 0, 0}, - /*II_V_66_0F_3A_09*/ {{0x1ba, 9339}, 0x41, 1, 0, 0, 0}, - /*II_66_0F_3A_0A*/ {{0x1bc, 9349}, 0x0, 1, 0, 0, 0}, - /*II_V_66_0F_3A_0A*/ {{0x184, 9358}, 0x0, 85, 1, 0, 0}, - /*II_66_0F_3A_0B*/ {{0x1bd, 9368}, 0x0, 1, 0, 0, 0}, - /*II_V_66_0F_3A_0B*/ {{0x184, 9377}, 0x0, 86, 1, 0, 0}, - /*II_66_0F_3A_0C*/ {{0x1a2, 9387}, 0x0, 1, 0, 0, 0}, - /*II_V_66_0F_3A_0C*/ {{0x189, 9396}, 0x1, 91, 1, 0, 0}, - /*II_66_0F_3A_0D*/ {{0x1a2, 9406}, 0x0, 1, 0, 0, 0}, - /*II_V_66_0F_3A_0D*/ {{0x189, 9415}, 0x1, 91, 1, 0, 0}, - /*II_66_0F_3A_0E*/ {{0x1a2, 9425}, 0x0, 1, 0, 0, 0}, - /*II_V_66_0F_3A_0E*/ {{0x184, 9434}, 0x0, 87, 1, 0, 0}, - /*II_0F_3A_0F*/ {{0x1be, 9444}, 0x0, 1, 0, 0, 0}, - /*II_66_0F_3A_0F*/ {{0x1bf, 9444}, 0x0, 1, 0, 0, 0}, - /*II_V_66_0F_3A_0F*/ {{0x184, 9453}, 0x0, 87, 1, 0, 0}, - /*II_66_0F_3A_14*/ {{0x1c0, 9463}, 0x0, 1, 0, 0, 0}, - /*II_V_66_0F_3A_14*/ {{0x1c1, 9471}, 0x40, 1, 0, 0, 0}, - /*II_66_0F_3A_15*/ {{0x1c2, 6345}, 0x0, 1, 0, 0, 0}, - /*II_V_66_0F_3A_15*/ {{0x1c3, 6353}, 0x40, 1, 0, 0, 0}, - /*II_66_0F_3A_16*/ {{0x1c4, 9480}, 0x0, 1, 0, 0, 9488}, - /*II_V_66_0F_3A_16*/ {{0x1c5, 9496}, 0x46, 1, 0, 9505, 0}, - /*II_66_0F_3A_17*/ {{0x1c6, 9514}, 0x0, 1, 0, 0, 0}, - /*II_V_66_0F_3A_17*/ {{0x1c7, 9525}, 0x40, 1, 0, 0, 0}, - /*II_V_66_0F_3A_18*/ {{0x1bb, 9537}, 0x10, 87, 1, 0, 0}, - /*II_V_66_0F_3A_19*/ {{0x1c8, 9550}, 0x50, 1, 0, 0, 0}, - /*II_66_0F_3A_20*/ {{0x1c9, 9564}, 0x0, 1, 0, 0, 0}, - /*II_V_66_0F_3A_20*/ {{0x184, 9572}, 0x0, 80, 1, 0, 0}, - /*II_66_0F_3A_21*/ {{0x1bc, 9581}, 0x0, 1, 0, 0, 0}, - /*II_V_66_0F_3A_21*/ {{0x184, 9591}, 0x0, 85, 1, 0, 0}, - /*II_66_0F_3A_22*/ {{0x1ca, 9602}, 0x0, 1, 0, 0, 9610}, - /*II_V_66_0F_3A_22*/ {{0x184, 9618}, 0x6, 73, 1, 9627, 0}, - /*II_66_0F_3A_40*/ {{0x1a2, 9636}, 0x0, 1, 0, 0, 0}, - /*II_V_66_0F_3A_40*/ {{0x189, 9642}, 0x1, 91, 1, 0, 0}, - /*II_66_0F_3A_41*/ {{0x1a2, 9649}, 0x0, 1, 0, 0, 0}, - /*II_V_66_0F_3A_41*/ {{0x184, 9655}, 0x0, 87, 1, 0, 0}, - /*II_66_0F_3A_42*/ {{0x1a2, 9662}, 0x0, 1, 0, 0, 0}, - /*II_V_66_0F_3A_42*/ {{0x184, 9671}, 0x0, 87, 1, 0, 0}, - /*II_66_0F_3A_44*/ {{0x1cb, 9681}, 0x0, 1, 0, 0, 0}, - /*II_V_66_0F_3A_44*/ {{0x1cc, 9692}, 0x0, 87, 1, 0, 0}, - /*II_V_66_0F_3A_4A*/ {{0x189, 9704}, 0x1, 91, 37, 0, 0}, - /*II_V_66_0F_3A_4B*/ {{0x189, 9715}, 0x1, 91, 37, 0, 0}, - /*II_V_66_0F_3A_4C*/ {{0x184, 9726}, 0x0, 87, 35, 0, 0}, - /*II_66_0F_3A_60*/ {{0x1cd, 9737}, 0x0, 1, 0, 0, 0}, - /*II_V_66_0F_3A_60*/ {{0x163, 9748}, 0x40, 1, 0, 0, 0}, - /*II_66_0F_3A_61*/ {{0x1cd, 9760}, 0x0, 1, 0, 0, 0}, - /*II_V_66_0F_3A_61*/ {{0x163, 9771}, 0x40, 1, 0, 0, 0}, - /*II_66_0F_3A_62*/ {{0x1cd, 9783}, 0x0, 1, 0, 0, 0}, - /*II_V_66_0F_3A_62*/ {{0x163, 9794}, 0x40, 1, 0, 0, 0}, - /*II_66_0F_3A_63*/ {{0x1cd, 9806}, 0x0, 1, 0, 0, 0}, - /*II_V_66_0F_3A_63*/ {{0x163, 9817}, 0x40, 1, 0, 0, 0}, - /*II_66_0F_3A_DF*/ {{0x1ce, 9829}, 0x0, 1, 0, 0, 0}, - /*II_V_66_0F_3A_DF*/ {{0x1cf, 9846}, 0x40, 1, 0, 0, 0}, - /*II_V_66_0F_71_02*/ {{0x1d2, 6477}, 0x0, 1, 0, 0, 0}, - /*II_V_66_0F_71_04*/ {{0x1d2, 6736}, 0x0, 1, 0, 0, 0}, - /*II_V_66_0F_71_06*/ {{0x1d2, 7050}, 0x0, 1, 0, 0, 0}, - /*II_V_66_0F_72_02*/ {{0x1d2, 6492}, 0x0, 1, 0, 0, 0}, - /*II_V_66_0F_72_04*/ {{0x1d2, 6751}, 0x0, 1, 0, 0, 0}, - /*II_V_66_0F_72_06*/ {{0x1d2, 7065}, 0x0, 1, 0, 0, 0}, - /*II_V_66_0F_73_02*/ {{0x1d2, 6507}, 0x0, 1, 0, 0, 0}, - /*II_V_66_0F_73_03*/ {{0x1d2, 9872}, 0x0, 1, 0, 0, 0}, - /*II_V_66_0F_73_06*/ {{0x1d2, 7080}, 0x0, 1, 0, 0, 0}, - /*II_V_66_0F_73_07*/ {{0x1d2, 9889}, 0x0, 1, 0, 0, 0}, - /*II_0F_AE_00*/ {{0x173, 9898}, 0x0, 0, 0, 0, 9906}, - /*II_0F_AE_01*/ {{0x173, 9926}, 0x0, 0, 0, 0, 9935}, - /*II_V_0F_AE_02*/ {{0x1d5, 9975}, 0x40, 0, 0, 0, 0}, - /*II_V_0F_AE_03*/ {{0x1d5, 10004}, 0x40, 0, 0, 0, 0} + /*II_E3*/ {{0x75, 426}, 0x0, 0, 0, 432, 439}, + /*II_0F_A4*/ {{0xad, 875}, 0x0, 1, 0, 0, 0}, + /*II_0F_A5*/ {{0xad, 875}, 0x0, 42, 0, 0, 0}, + /*II_0F_AC*/ {{0xad, 891}, 0x0, 1, 0, 0, 0}, + /*II_0F_AD*/ {{0xad, 891}, 0x0, 42, 0, 0, 0}, + /*II_V_0F_10*/ {{0x129, 2150}, 0x41, 0, 0, 0, 0}, + /*II_V_66_0F_10*/ {{0x129, 2159}, 0x41, 0, 0, 0, 0}, + /*II_V_F3_0F_10*/ {{0x12a, 2168}, 0x20, 31, 0, 0, 0}, + /*II_V_F2_0F_10*/ {{0x12a, 2176}, 0x20, 31, 0, 0, 0}, + /*II_VRR_F3_0F_10*/ {{0x12b, 2168}, 0x60, 0, 0, 0, 0}, + /*II_VRR_F2_0F_10*/ {{0x12c, 2176}, 0x60, 0, 0, 0, 0}, + /*II_V_0F_11*/ {{0x131, 2150}, 0x41, 0, 0, 0, 0}, + /*II_V_66_0F_11*/ {{0x131, 2159}, 0x41, 0, 0, 0, 0}, + /*II_V_F3_0F_11*/ {{0x12a, 2168}, 0x20, 31, 0, 0, 0}, + /*II_V_F2_0F_11*/ {{0x12a, 2176}, 0x20, 31, 0, 0, 0}, + /*II_VRR_F3_0F_11*/ {{0x132, 2168}, 0x60, 0, 0, 0, 0}, + /*II_VRR_F2_0F_11*/ {{0x133, 2176}, 0x60, 0, 0, 0, 0}, + /*II_0F_12*/ {{0x134, 2184}, 0x0, 0, 0, 2193, 0}, + /*II_V_0F_12*/ {{0x137, 2228}, 0x0, 86, 0, 2238, 0}, + /*II_V_66_0F_12*/ {{0x138, 2247}, 0x0, 57, 0, 0, 0}, + /*II_V_F3_0F_12*/ {{0x129, 2256}, 0x41, 0, 0, 0, 0}, + /*II_V_F2_0F_12*/ {{0x139, 2267}, 0x41, 0, 0, 0, 0}, + /*II_V_0F_13*/ {{0x13c, 2238}, 0x40, 0, 0, 0, 0}, + /*II_V_66_0F_13*/ {{0x13c, 2247}, 0x40, 0, 0, 0, 0}, + /*II_V_0F_14*/ {{0x13f, 2297}, 0x1, 91, 0, 0, 0}, + /*II_V_66_0F_14*/ {{0x13f, 2308}, 0x1, 91, 0, 0, 0}, + /*II_V_0F_15*/ {{0x13f, 2339}, 0x1, 91, 0, 0, 0}, + /*II_V_66_0F_15*/ {{0x13f, 2350}, 0x1, 91, 0, 0, 0}, + /*II_0F_16*/ {{0x134, 2361}, 0x0, 0, 0, 2370, 0}, + /*II_V_0F_16*/ {{0x137, 2396}, 0x0, 86, 0, 2406, 0}, + /*II_V_66_0F_16*/ {{0x138, 2415}, 0x0, 57, 0, 0, 0}, + /*II_V_F3_0F_16*/ {{0x129, 2424}, 0x41, 0, 0, 0, 0}, + /*II_V_0F_17*/ {{0x13c, 2406}, 0x40, 0, 0, 0, 0}, + /*II_V_66_0F_17*/ {{0x13c, 2415}, 0x40, 0, 0, 0, 0}, + /*II_V_0F_28*/ {{0x129, 2500}, 0x41, 0, 0, 0, 0}, + /*II_V_66_0F_28*/ {{0x129, 2509}, 0x41, 0, 0, 0, 0}, + /*II_V_0F_29*/ {{0x131, 2500}, 0x41, 0, 0, 0, 0}, + /*II_V_66_0F_29*/ {{0x131, 2509}, 0x41, 0, 0, 0, 0}, + /*II_V_F3_0F_2A*/ {{0x138, 2558}, 0x2, 73, 0, 0, 0}, + /*II_V_F2_0F_2A*/ {{0x138, 2569}, 0x2, 73, 0, 0, 0}, + /*II_V_0F_2B*/ {{0x14a, 2616}, 0x41, 0, 0, 0, 0}, + /*II_V_66_0F_2B*/ {{0x14a, 2626}, 0x41, 0, 0, 0, 0}, + /*II_V_F3_0F_2C*/ {{0x14f, 2680}, 0x42, 0, 0, 0, 0}, + /*II_V_F2_0F_2C*/ {{0x14f, 2692}, 0x42, 0, 0, 0, 0}, + /*II_V_F3_0F_2D*/ {{0x14f, 2744}, 0x42, 0, 0, 0, 0}, + /*II_V_F2_0F_2D*/ {{0x14f, 2755}, 0x42, 0, 0, 0, 0}, + /*II_V_0F_2E*/ {{0x152, 2784}, 0x40, 0, 0, 0, 0}, + /*II_V_66_0F_2E*/ {{0x153, 2794}, 0x40, 0, 0, 0, 0}, + /*II_V_0F_2F*/ {{0x152, 2820}, 0x40, 0, 0, 0, 0}, + /*II_V_66_0F_2F*/ {{0x153, 2829}, 0x40, 0, 0, 0, 0}, + /*II_V_0F_50*/ {{0x156, 2858}, 0x41, 0, 0, 0, 0}, + /*II_V_66_0F_50*/ {{0x156, 2869}, 0x41, 0, 0, 0, 0}, + /*II_V_0F_51*/ {{0x129, 2912}, 0x41, 0, 0, 0, 0}, + /*II_V_66_0F_51*/ {{0x129, 2921}, 0x41, 0, 0, 0, 0}, + /*II_V_F3_0F_51*/ {{0x138, 2930}, 0x0, 85, 0, 0, 0}, + /*II_V_F2_0F_51*/ {{0x138, 2939}, 0x0, 86, 0, 0, 0}, + /*II_V_0F_52*/ {{0x129, 2966}, 0x41, 0, 0, 0, 0}, + /*II_V_F3_0F_52*/ {{0x138, 2976}, 0x0, 85, 0, 0, 0}, + /*II_V_0F_53*/ {{0x129, 3000}, 0x41, 0, 0, 0, 0}, + /*II_V_F3_0F_53*/ {{0x138, 3008}, 0x0, 85, 0, 0, 0}, + /*II_V_0F_54*/ {{0x13f, 3030}, 0x1, 91, 0, 0, 0}, + /*II_V_66_0F_54*/ {{0x13f, 3038}, 0x1, 91, 0, 0, 0}, + /*II_V_0F_55*/ {{0x13f, 3062}, 0x1, 91, 0, 0, 0}, + /*II_V_66_0F_55*/ {{0x13f, 3071}, 0x1, 91, 0, 0, 0}, + /*II_V_0F_56*/ {{0x13f, 3092}, 0x1, 91, 0, 0, 0}, + /*II_V_66_0F_56*/ {{0x13f, 3099}, 0x1, 91, 0, 0, 0}, + /*II_V_0F_57*/ {{0x13f, 3120}, 0x1, 91, 0, 0, 0}, + /*II_V_66_0F_57*/ {{0x13f, 3128}, 0x1, 91, 0, 0, 0}, + /*II_V_0F_58*/ {{0x13f, 3164}, 0x1, 91, 0, 0, 0}, + /*II_V_66_0F_58*/ {{0x13f, 3172}, 0x1, 91, 0, 0, 0}, + /*II_V_F3_0F_58*/ {{0x138, 3180}, 0x0, 85, 0, 0, 0}, + /*II_V_F2_0F_58*/ {{0x138, 3188}, 0x0, 86, 0, 0, 0}, + /*II_V_0F_59*/ {{0x13f, 3224}, 0x1, 91, 0, 0, 0}, + /*II_V_66_0F_59*/ {{0x13f, 3232}, 0x1, 91, 0, 0, 0}, + /*II_V_F3_0F_59*/ {{0x138, 3240}, 0x0, 85, 0, 0, 0}, + /*II_V_F2_0F_59*/ {{0x138, 3248}, 0x0, 86, 0, 0, 0}, + /*II_V_0F_5A*/ {{0x159, 3296}, 0x41, 0, 0, 0, 0}, + /*II_V_66_0F_5A*/ {{0x15a, 3307}, 0x41, 0, 0, 0, 0}, + /*II_V_F3_0F_5A*/ {{0x138, 3318}, 0x0, 85, 0, 0, 0}, + /*II_V_F2_0F_5A*/ {{0x138, 3329}, 0x0, 86, 0, 0, 0}, + /*II_V_0F_5B*/ {{0x129, 3371}, 0x41, 0, 0, 0, 0}, + /*II_V_66_0F_5B*/ {{0x129, 3382}, 0x41, 0, 0, 0, 0}, + /*II_V_F3_0F_5B*/ {{0x129, 3393}, 0x41, 0, 0, 0, 0}, + /*II_V_0F_5C*/ {{0x13f, 3433}, 0x1, 91, 0, 0, 0}, + /*II_V_66_0F_5C*/ {{0x13f, 3441}, 0x1, 91, 0, 0, 0}, + /*II_V_F3_0F_5C*/ {{0x138, 3449}, 0x0, 85, 0, 0, 0}, + /*II_V_F2_0F_5C*/ {{0x138, 3457}, 0x0, 86, 0, 0, 0}, + /*II_V_0F_5D*/ {{0x13f, 3493}, 0x1, 91, 0, 0, 0}, + /*II_V_66_0F_5D*/ {{0x13f, 3501}, 0x1, 91, 0, 0, 0}, + /*II_V_F3_0F_5D*/ {{0x138, 3509}, 0x0, 85, 0, 0, 0}, + /*II_V_F2_0F_5D*/ {{0x138, 3517}, 0x0, 86, 0, 0, 0}, + /*II_V_0F_5E*/ {{0x13f, 3553}, 0x1, 91, 0, 0, 0}, + /*II_V_66_0F_5E*/ {{0x13f, 3561}, 0x1, 91, 0, 0, 0}, + /*II_V_F3_0F_5E*/ {{0x138, 3569}, 0x0, 85, 0, 0, 0}, + /*II_V_F2_0F_5E*/ {{0x138, 3577}, 0x0, 86, 0, 0, 0}, + /*II_V_0F_5F*/ {{0x13f, 3613}, 0x1, 91, 0, 0, 0}, + /*II_V_66_0F_5F*/ {{0x13f, 3621}, 0x1, 91, 0, 0, 0}, + /*II_V_F3_0F_5F*/ {{0x138, 3629}, 0x0, 85, 0, 0, 0}, + /*II_V_F2_0F_5F*/ {{0x138, 3637}, 0x0, 86, 0, 0, 0}, + /*II_V_66_0F_60*/ {{0x138, 3656}, 0x0, 87, 0, 0, 0}, + /*II_V_66_0F_61*/ {{0x138, 3679}, 0x0, 87, 0, 0, 0}, + /*II_V_66_0F_62*/ {{0x138, 3702}, 0x0, 87, 0, 0, 0}, + /*II_V_66_0F_63*/ {{0x138, 3724}, 0x0, 87, 0, 0, 0}, + /*II_V_66_0F_64*/ {{0x138, 3744}, 0x0, 87, 0, 0, 0}, + /*II_V_66_0F_65*/ {{0x138, 3763}, 0x0, 87, 0, 0, 0}, + /*II_V_66_0F_66*/ {{0x138, 3782}, 0x0, 87, 0, 0, 0}, + /*II_V_66_0F_67*/ {{0x138, 3802}, 0x0, 87, 0, 0, 0}, + /*II_V_66_0F_68*/ {{0x138, 3824}, 0x0, 87, 0, 0, 0}, + /*II_V_66_0F_69*/ {{0x138, 3847}, 0x0, 87, 0, 0, 0}, + /*II_V_66_0F_6A*/ {{0x138, 3870}, 0x0, 87, 0, 0, 0}, + /*II_V_66_0F_6B*/ {{0x138, 3892}, 0x0, 87, 0, 0, 0}, + /*II_V_66_0F_6C*/ {{0x138, 3915}, 0x0, 87, 0, 0, 0}, + /*II_V_66_0F_6D*/ {{0x138, 3940}, 0x0, 87, 0, 0, 0}, + /*II_0F_6E*/ {{0x15d, 3953}, 0x0, 0, 0, 0, 3959}, + /*II_66_0F_6E*/ {{0x15e, 3953}, 0x0, 0, 0, 0, 3959}, + /*II_V_66_0F_6E*/ {{0x15f, 3965}, 0x46, 0, 0, 3972, 0}, + /*II_V_66_0F_6F*/ {{0x129, 3995}, 0x41, 0, 0, 0, 0}, + /*II_V_F3_0F_6F*/ {{0x129, 4004}, 0x41, 0, 0, 0, 0}, + /*II_0F_70*/ {{0x161, 4013}, 0x0, 1, 0, 0, 0}, + /*II_66_0F_70*/ {{0x162, 4021}, 0x0, 1, 0, 0, 0}, + /*II_F3_0F_70*/ {{0x162, 4029}, 0x0, 1, 0, 0, 0}, + /*II_F2_0F_70*/ {{0x162, 4038}, 0x0, 1, 0, 0, 0}, + /*II_V_66_0F_70*/ {{0x163, 4047}, 0x40, 1, 0, 0, 0}, + /*II_V_F3_0F_70*/ {{0x163, 4056}, 0x40, 1, 0, 0, 0}, + /*II_V_F2_0F_70*/ {{0x163, 4066}, 0x40, 1, 0, 0, 0}, + /*II_V_66_0F_74*/ {{0x138, 4085}, 0x0, 87, 0, 0, 0}, + /*II_V_66_0F_75*/ {{0x138, 4104}, 0x0, 87, 0, 0, 0}, + /*II_V_66_0F_76*/ {{0x138, 4123}, 0x0, 87, 0, 0, 0}, + /*II_V_0F_77*/ {{0x165, 4139}, 0x49, 0, 0, 4151, 0}, + /*II_66_0F_78*/ {{0x167, 4169}, 0x0, 49, 0, 0, 0}, + /*II_F2_0F_78*/ {{0x168, 4176}, 0x0, 48, 49, 0, 0}, + /*II_V_66_0F_7C*/ {{0x13f, 4230}, 0x1, 91, 0, 0, 0}, + /*II_V_F2_0F_7C*/ {{0x13f, 4239}, 0x1, 91, 0, 0, 0}, + /*II_V_66_0F_7D*/ {{0x13f, 4264}, 0x1, 91, 0, 0, 0}, + /*II_V_F2_0F_7D*/ {{0x13f, 4273}, 0x1, 91, 0, 0, 0}, + /*II_0F_7E*/ {{0x16f, 3953}, 0x0, 0, 0, 0, 3959}, + /*II_66_0F_7E*/ {{0x170, 3953}, 0x0, 0, 0, 0, 3959}, + /*II_V_66_0F_7E*/ {{0x171, 3965}, 0x46, 0, 0, 3972, 0}, + /*II_V_F3_0F_7E*/ {{0x153, 3972}, 0x40, 0, 0, 0, 0}, + /*II_V_66_0F_7F*/ {{0x131, 3995}, 0x41, 0, 0, 0, 0}, + /*II_V_F3_0F_7F*/ {{0x131, 4004}, 0x41, 0, 0, 0, 0}, + /*II_0F_AE_04*/ {{0x173, 4282}, 0x0, 0, 0, 0, 4289}, + /*II_0F_AE_05*/ {{0x174, 4298}, 0x0, 0, 0, 4306, 4314}, + /*II_0F_AE_06*/ {{0x174, 4324}, 0x0, 0, 0, 4332, 4342}, + /*II_0F_AE_07*/ {{0x175, 4354}, 0x0, 0, 0, 4362, 0}, + /*II_0F_C2*/ {{0x17c, 4403}, 0x0, 0, 0, 4412, 4421}, + /*II_66_0F_C2*/ {{0x17d, 4482}, 0x0, 0, 0, 4491, 4500}, + /*II_F3_0F_C2*/ {{0x17e, 4561}, 0x0, 0, 0, 4570, 4579}, + /*II_F2_0F_C2*/ {{0x17f, 4640}, 0x0, 0, 0, 4649, 4658}, + /*II_V_0F_C2*/ {{0x180, 4719}, 0x1, 91, 0, 4729, 4739}, + /*II_V_66_0F_C2*/ {{0x180, 5121}, 0x1, 91, 0, 5131, 5141}, + /*II_V_F3_0F_C2*/ {{0x181, 5523}, 0x0, 85, 0, 5533, 5543}, + /*II_V_F2_0F_C2*/ {{0x181, 5925}, 0x0, 86, 0, 5935, 5945}, + /*II_0F_C4*/ {{0x182, 6327}, 0x0, 1, 0, 0, 0}, + /*II_66_0F_C4*/ {{0x183, 6327}, 0x0, 1, 0, 0, 0}, + /*II_V_66_0F_C4*/ {{0x184, 6335}, 0x0, 79, 1, 0, 0}, + /*II_0F_C5*/ {{0x185, 6344}, 0x0, 1, 0, 0, 0}, + /*II_66_0F_C5*/ {{0x186, 6344}, 0x0, 1, 0, 0, 0}, + /*II_V_66_0F_C5*/ {{0x187, 6352}, 0x40, 1, 0, 0, 0}, + /*II_0F_C6*/ {{0x188, 6361}, 0x0, 1, 0, 0, 0}, + /*II_66_0F_C6*/ {{0x162, 6369}, 0x0, 1, 0, 0, 0}, + /*II_V_0F_C6*/ {{0x189, 6377}, 0x1, 91, 1, 0, 0}, + /*II_V_66_0F_C6*/ {{0x189, 6386}, 0x1, 91, 1, 0, 0}, + /*II_0F_C7_01*/ {{0x18a, 6395}, 0x0, 0, 0, 0, 6406}, + /*II_V_66_0F_D0*/ {{0x13f, 6447}, 0x1, 91, 0, 0, 0}, + /*II_V_F2_0F_D0*/ {{0x13f, 6458}, 0x1, 91, 0, 0, 0}, + /*II_V_66_0F_D1*/ {{0x138, 6476}, 0x0, 87, 0, 0, 0}, + /*II_V_66_0F_D2*/ {{0x138, 6491}, 0x0, 87, 0, 0, 0}, + /*II_V_66_0F_D3*/ {{0x138, 6506}, 0x0, 87, 0, 0, 0}, + /*II_V_66_0F_D4*/ {{0x138, 6521}, 0x0, 87, 0, 0, 0}, + /*II_V_66_0F_D5*/ {{0x138, 6537}, 0x0, 87, 0, 0, 0}, + /*II_V_66_0F_D6*/ {{0x18e, 3972}, 0x40, 0, 0, 0, 0}, + /*II_V_66_0F_D7*/ {{0x191, 6574}, 0x40, 0, 0, 0, 0}, + /*II_V_66_0F_D8*/ {{0x138, 6594}, 0x0, 87, 0, 0, 0}, + /*II_V_66_0F_D9*/ {{0x138, 6613}, 0x0, 87, 0, 0, 0}, + /*II_V_66_0F_DA*/ {{0x138, 6631}, 0x0, 87, 0, 0, 0}, + /*II_V_66_0F_DB*/ {{0x138, 6646}, 0x0, 87, 0, 0, 0}, + /*II_V_66_0F_DC*/ {{0x138, 6662}, 0x0, 87, 0, 0, 0}, + /*II_V_66_0F_DD*/ {{0x138, 6662}, 0x0, 87, 0, 0, 0}, + /*II_V_66_0F_DE*/ {{0x138, 6689}, 0x0, 87, 0, 0, 0}, + /*II_V_66_0F_DF*/ {{0x138, 6705}, 0x0, 87, 0, 0, 0}, + /*II_V_66_0F_E0*/ {{0x138, 6720}, 0x0, 87, 0, 0, 0}, + /*II_V_66_0F_E1*/ {{0x138, 6735}, 0x0, 87, 0, 0, 0}, + /*II_V_66_0F_E2*/ {{0x138, 6750}, 0x0, 87, 0, 0, 0}, + /*II_V_66_0F_E3*/ {{0x138, 6765}, 0x0, 87, 0, 0, 0}, + /*II_V_66_0F_E4*/ {{0x138, 6782}, 0x0, 87, 0, 0, 0}, + /*II_V_66_0F_E5*/ {{0x138, 6800}, 0x0, 87, 0, 0, 0}, + /*II_V_66_0F_E6*/ {{0x15a, 6840}, 0x41, 0, 0, 0, 0}, + /*II_V_F3_0F_E6*/ {{0x159, 6852}, 0x41, 0, 0, 0, 0}, + /*II_V_F2_0F_E6*/ {{0x15a, 6863}, 0x41, 0, 0, 0, 0}, + /*II_V_66_0F_E7*/ {{0x14a, 6891}, 0x41, 0, 0, 0, 0}, + /*II_V_66_0F_E8*/ {{0x138, 6909}, 0x0, 87, 0, 0, 0}, + /*II_V_66_0F_E9*/ {{0x138, 6926}, 0x0, 87, 0, 0, 0}, + /*II_V_66_0F_EA*/ {{0x138, 6943}, 0x0, 87, 0, 0, 0}, + /*II_V_66_0F_EB*/ {{0x138, 6957}, 0x0, 87, 0, 0, 0}, + /*II_V_66_0F_EC*/ {{0x138, 6971}, 0x0, 87, 0, 0, 0}, + /*II_V_66_0F_ED*/ {{0x138, 6988}, 0x0, 87, 0, 0, 0}, + /*II_V_66_0F_EE*/ {{0x138, 7005}, 0x0, 87, 0, 0, 0}, + /*II_V_66_0F_EF*/ {{0x138, 7020}, 0x0, 87, 0, 0, 0}, + /*II_V_F2_0F_F0*/ {{0x195, 7034}, 0x41, 0, 0, 0, 0}, + /*II_V_66_0F_F1*/ {{0x138, 7049}, 0x0, 87, 0, 0, 0}, + /*II_V_66_0F_F2*/ {{0x138, 7064}, 0x0, 87, 0, 0, 0}, + /*II_V_66_0F_F3*/ {{0x138, 7079}, 0x0, 87, 0, 0, 0}, + /*II_V_66_0F_F4*/ {{0x138, 7096}, 0x0, 87, 0, 0, 0}, + /*II_V_66_0F_F5*/ {{0x138, 7115}, 0x0, 87, 0, 0, 0}, + /*II_V_66_0F_F6*/ {{0x138, 7133}, 0x0, 87, 0, 0, 0}, + /*II_V_66_0F_F7*/ {{0x199, 7164}, 0x40, 0, 0, 0, 0}, + /*II_V_66_0F_F8*/ {{0x138, 7184}, 0x0, 87, 0, 0, 0}, + /*II_V_66_0F_F9*/ {{0x138, 7199}, 0x0, 87, 0, 0, 0}, + /*II_V_66_0F_FA*/ {{0x138, 7214}, 0x0, 87, 0, 0, 0}, + /*II_V_66_0F_FB*/ {{0x138, 7229}, 0x0, 87, 0, 0, 0}, + /*II_V_66_0F_FC*/ {{0x138, 7244}, 0x0, 87, 0, 0, 0}, + /*II_V_66_0F_FD*/ {{0x138, 7259}, 0x0, 87, 0, 0, 0}, + /*II_V_66_0F_FE*/ {{0x138, 7274}, 0x0, 87, 0, 0, 0}, + /*II_V_66_0F_38_00*/ {{0x138, 7382}, 0x0, 87, 0, 0, 0}, + /*II_V_66_0F_38_01*/ {{0x138, 7399}, 0x0, 87, 0, 0, 0}, + /*II_V_66_0F_38_02*/ {{0x138, 7416}, 0x0, 87, 0, 0, 0}, + /*II_V_66_0F_38_03*/ {{0x138, 7434}, 0x0, 87, 0, 0, 0}, + /*II_V_66_0F_38_04*/ {{0x138, 7455}, 0x0, 87, 0, 0, 0}, + /*II_V_66_0F_38_05*/ {{0x138, 7475}, 0x0, 87, 0, 0, 0}, + /*II_V_66_0F_38_06*/ {{0x138, 7492}, 0x0, 87, 0, 0, 0}, + /*II_V_66_0F_38_07*/ {{0x138, 7510}, 0x0, 87, 0, 0, 0}, + /*II_V_66_0F_38_08*/ {{0x138, 7528}, 0x0, 87, 0, 0, 0}, + /*II_V_66_0F_38_09*/ {{0x138, 7545}, 0x0, 87, 0, 0, 0}, + /*II_V_66_0F_38_0A*/ {{0x138, 7562}, 0x0, 87, 0, 0, 0}, + /*II_V_66_0F_38_0B*/ {{0x138, 7581}, 0x0, 87, 0, 0, 0}, + /*II_V_66_0F_38_0C*/ {{0x13f, 7592}, 0x1, 91, 0, 0, 0}, + /*II_V_66_0F_38_0D*/ {{0x13f, 7603}, 0x1, 91, 0, 0, 0}, + /*II_V_66_0F_38_0E*/ {{0x129, 7614}, 0x41, 0, 0, 0, 0}, + /*II_V_66_0F_38_0F*/ {{0x129, 7623}, 0x41, 0, 0, 0, 0}, + /*II_66_0F_38_10*/ {{0x1a2, 7632}, 0x0, 32, 0, 0, 0}, + /*II_66_0F_38_14*/ {{0x1a2, 7642}, 0x0, 32, 0, 0, 0}, + /*II_66_0F_38_15*/ {{0x1a2, 7652}, 0x0, 32, 0, 0, 0}, + /*II_V_66_0F_38_17*/ {{0x129, 7669}, 0x41, 0, 0, 0, 0}, + /*II_V_66_0F_38_18*/ {{0x1a4, 7677}, 0x41, 0, 0, 0, 0}, + /*II_V_66_0F_38_19*/ {{0x1a5, 7691}, 0x50, 0, 0, 0, 0}, + /*II_V_66_0F_38_1A*/ {{0x1a6, 7705}, 0x50, 0, 0, 0, 0}, + /*II_V_66_0F_38_1C*/ {{0x1a7, 7728}, 0x40, 0, 0, 0, 0}, + /*II_V_66_0F_38_1D*/ {{0x1a7, 7743}, 0x40, 0, 0, 0, 0}, + /*II_V_66_0F_38_1E*/ {{0x1a7, 7758}, 0x40, 0, 0, 0, 0}, + /*II_V_66_0F_38_20*/ {{0x153, 7776}, 0x40, 0, 0, 0, 0}, + /*II_V_66_0F_38_21*/ {{0x152, 7797}, 0x40, 0, 0, 0, 0}, + /*II_V_66_0F_38_22*/ {{0x1ab, 7818}, 0x40, 0, 0, 0, 0}, + /*II_V_66_0F_38_23*/ {{0x153, 7839}, 0x40, 0, 0, 0, 0}, + /*II_V_66_0F_38_24*/ {{0x152, 7860}, 0x40, 0, 0, 0, 0}, + /*II_V_66_0F_38_25*/ {{0x153, 7881}, 0x40, 0, 0, 0, 0}, + /*II_V_66_0F_38_28*/ {{0x138, 7900}, 0x0, 87, 0, 0, 0}, + /*II_V_66_0F_38_29*/ {{0x138, 7918}, 0x0, 87, 0, 0, 0}, + /*II_V_66_0F_38_2A*/ {{0x1ae, 7938}, 0x40, 0, 0, 0, 0}, + /*II_V_66_0F_38_2B*/ {{0x138, 7959}, 0x0, 87, 0, 0, 0}, + /*II_V_66_0F_38_2C*/ {{0x13f, 7970}, 0x1, 67, 0, 0, 0}, + /*II_V_66_0F_38_2D*/ {{0x13f, 7982}, 0x1, 67, 0, 0, 0}, + /*II_V_66_0F_38_2E*/ {{0x1af, 7970}, 0x1, 36, 0, 0, 0}, + /*II_V_66_0F_38_2F*/ {{0x1af, 7982}, 0x1, 36, 0, 0, 0}, + /*II_V_66_0F_38_30*/ {{0x153, 8004}, 0x40, 0, 0, 0, 0}, + /*II_V_66_0F_38_31*/ {{0x152, 8025}, 0x40, 0, 0, 0, 0}, + /*II_V_66_0F_38_32*/ {{0x1ab, 8046}, 0x40, 0, 0, 0, 0}, + /*II_V_66_0F_38_33*/ {{0x153, 8067}, 0x40, 0, 0, 0, 0}, + /*II_V_66_0F_38_34*/ {{0x152, 8088}, 0x40, 0, 0, 0, 0}, + /*II_V_66_0F_38_35*/ {{0x153, 8109}, 0x40, 0, 0, 0, 0}, + /*II_V_66_0F_38_37*/ {{0x138, 8129}, 0x0, 87, 0, 0, 0}, + /*II_V_66_0F_38_38*/ {{0x138, 8147}, 0x0, 87, 0, 0, 0}, + /*II_V_66_0F_38_39*/ {{0x138, 8164}, 0x0, 87, 0, 0, 0}, + /*II_V_66_0F_38_3A*/ {{0x138, 8181}, 0x0, 87, 0, 0, 0}, + /*II_V_66_0F_38_3B*/ {{0x138, 8198}, 0x0, 87, 0, 0, 0}, + /*II_V_66_0F_38_3C*/ {{0x138, 8215}, 0x0, 87, 0, 0, 0}, + /*II_V_66_0F_38_3D*/ {{0x138, 8232}, 0x0, 87, 0, 0, 0}, + /*II_V_66_0F_38_3E*/ {{0x138, 8249}, 0x0, 87, 0, 0, 0}, + /*II_V_66_0F_38_3F*/ {{0x138, 8266}, 0x0, 87, 0, 0, 0}, + /*II_V_66_0F_38_40*/ {{0x138, 8283}, 0x0, 87, 0, 0, 0}, + /*II_V_66_0F_38_41*/ {{0x1a7, 8304}, 0x40, 0, 0, 0, 0}, + /*II_V_66_0F_38_96*/ {{0x1b1, 8343}, 0x7, 91, 0, 8359, 0}, + /*II_V_66_0F_38_97*/ {{0x1b1, 8375}, 0x7, 91, 0, 8391, 0}, + /*II_V_66_0F_38_98*/ {{0x1b1, 8407}, 0x7, 91, 0, 8420, 0}, + /*II_V_66_0F_38_99*/ {{0x1b2, 8433}, 0x6, 88, 0, 8446, 0}, + /*II_V_66_0F_38_9A*/ {{0x1b1, 8459}, 0x7, 91, 0, 8472, 0}, + /*II_V_66_0F_38_9B*/ {{0x1b2, 8485}, 0x6, 88, 0, 8498, 0}, + /*II_V_66_0F_38_9C*/ {{0x1b1, 8511}, 0x7, 91, 0, 8525, 0}, + /*II_V_66_0F_38_9D*/ {{0x1b2, 8539}, 0x6, 88, 0, 8553, 0}, + /*II_V_66_0F_38_9E*/ {{0x1b1, 8567}, 0x7, 91, 0, 8581, 0}, + /*II_V_66_0F_38_9F*/ {{0x1b2, 8595}, 0x6, 88, 0, 8609, 0}, + /*II_V_66_0F_38_A6*/ {{0x1b1, 8623}, 0x7, 91, 0, 8639, 0}, + /*II_V_66_0F_38_A7*/ {{0x1b1, 8655}, 0x7, 91, 0, 8671, 0}, + /*II_V_66_0F_38_A8*/ {{0x1b1, 8687}, 0x7, 91, 0, 8700, 0}, + /*II_V_66_0F_38_A9*/ {{0x1b2, 8713}, 0x6, 88, 0, 8726, 0}, + /*II_V_66_0F_38_AA*/ {{0x1b1, 8739}, 0x7, 91, 0, 8752, 0}, + /*II_V_66_0F_38_AB*/ {{0x1b2, 8765}, 0x6, 88, 0, 8778, 0}, + /*II_V_66_0F_38_AC*/ {{0x1b1, 8791}, 0x7, 91, 0, 8805, 0}, + /*II_V_66_0F_38_AD*/ {{0x1b2, 8819}, 0x6, 88, 0, 8833, 0}, + /*II_V_66_0F_38_AE*/ {{0x1b1, 8847}, 0x7, 91, 0, 8861, 0}, + /*II_V_66_0F_38_AF*/ {{0x1b2, 8875}, 0x6, 88, 0, 8889, 0}, + /*II_V_66_0F_38_B6*/ {{0x1b1, 8903}, 0x7, 91, 0, 8919, 0}, + /*II_V_66_0F_38_B7*/ {{0x1b1, 8935}, 0x7, 91, 0, 8951, 0}, + /*II_V_66_0F_38_B8*/ {{0x1b1, 8967}, 0x7, 91, 0, 8980, 0}, + /*II_V_66_0F_38_B9*/ {{0x1b2, 8993}, 0x6, 88, 0, 9006, 0}, + /*II_V_66_0F_38_BA*/ {{0x1b1, 9019}, 0x7, 91, 0, 9032, 0}, + /*II_V_66_0F_38_BB*/ {{0x1b2, 9045}, 0x6, 88, 0, 9058, 0}, + /*II_V_66_0F_38_BC*/ {{0x1b1, 9071}, 0x7, 91, 0, 9085, 0}, + /*II_V_66_0F_38_BD*/ {{0x1b2, 9099}, 0x6, 88, 0, 9113, 0}, + /*II_V_66_0F_38_BE*/ {{0x1b1, 9127}, 0x7, 91, 0, 9141, 0}, + /*II_V_66_0F_38_BF*/ {{0x1b2, 9155}, 0x6, 88, 0, 9169, 0}, + /*II_V_66_0F_38_DB*/ {{0x1b4, 9191}, 0x40, 0, 0, 0, 0}, + /*II_V_66_0F_38_DC*/ {{0x1b5, 9208}, 0x0, 87, 0, 0, 0}, + /*II_V_66_0F_38_DD*/ {{0x1b5, 9229}, 0x0, 87, 0, 0, 0}, + /*II_V_66_0F_38_DE*/ {{0x1b5, 9250}, 0x0, 87, 0, 0, 0}, + /*II_V_66_0F_38_DF*/ {{0x1b5, 9271}, 0x0, 87, 0, 0, 0}, + /*II_V_66_0F_3A_04*/ {{0x1ba, 7592}, 0x41, 1, 0, 0, 0}, + /*II_V_66_0F_3A_05*/ {{0x1ba, 7603}, 0x41, 1, 0, 0, 0}, + /*II_V_66_0F_3A_06*/ {{0x1bb, 9298}, 0x10, 89, 1, 0, 0}, + /*II_66_0F_3A_08*/ {{0x1a2, 9310}, 0x0, 1, 0, 0, 0}, + /*II_V_66_0F_3A_08*/ {{0x1ba, 9319}, 0x41, 1, 0, 0, 0}, + /*II_66_0F_3A_09*/ {{0x1a2, 9329}, 0x0, 1, 0, 0, 0}, + /*II_V_66_0F_3A_09*/ {{0x1ba, 9338}, 0x41, 1, 0, 0, 0}, + /*II_66_0F_3A_0A*/ {{0x1bc, 9348}, 0x0, 1, 0, 0, 0}, + /*II_V_66_0F_3A_0A*/ {{0x184, 9357}, 0x0, 85, 1, 0, 0}, + /*II_66_0F_3A_0B*/ {{0x1bd, 9367}, 0x0, 1, 0, 0, 0}, + /*II_V_66_0F_3A_0B*/ {{0x184, 9376}, 0x0, 86, 1, 0, 0}, + /*II_66_0F_3A_0C*/ {{0x1a2, 9386}, 0x0, 1, 0, 0, 0}, + /*II_V_66_0F_3A_0C*/ {{0x189, 9395}, 0x1, 91, 1, 0, 0}, + /*II_66_0F_3A_0D*/ {{0x1a2, 9405}, 0x0, 1, 0, 0, 0}, + /*II_V_66_0F_3A_0D*/ {{0x189, 9414}, 0x1, 91, 1, 0, 0}, + /*II_66_0F_3A_0E*/ {{0x1a2, 9424}, 0x0, 1, 0, 0, 0}, + /*II_V_66_0F_3A_0E*/ {{0x184, 9433}, 0x0, 87, 1, 0, 0}, + /*II_0F_3A_0F*/ {{0x1be, 9443}, 0x0, 1, 0, 0, 0}, + /*II_66_0F_3A_0F*/ {{0x1bf, 9443}, 0x0, 1, 0, 0, 0}, + /*II_V_66_0F_3A_0F*/ {{0x184, 9452}, 0x0, 87, 1, 0, 0}, + /*II_66_0F_3A_14*/ {{0x1c0, 9462}, 0x0, 1, 0, 0, 0}, + /*II_V_66_0F_3A_14*/ {{0x1c1, 9470}, 0x40, 1, 0, 0, 0}, + /*II_66_0F_3A_15*/ {{0x1c2, 6344}, 0x0, 1, 0, 0, 0}, + /*II_V_66_0F_3A_15*/ {{0x1c3, 6352}, 0x40, 1, 0, 0, 0}, + /*II_66_0F_3A_16*/ {{0x1c4, 9479}, 0x0, 1, 0, 0, 9487}, + /*II_V_66_0F_3A_16*/ {{0x1c5, 9495}, 0x46, 1, 0, 9504, 0}, + /*II_66_0F_3A_17*/ {{0x1c6, 9513}, 0x0, 1, 0, 0, 0}, + /*II_V_66_0F_3A_17*/ {{0x1c7, 9524}, 0x40, 1, 0, 0, 0}, + /*II_V_66_0F_3A_18*/ {{0x1bb, 9536}, 0x10, 87, 1, 0, 0}, + /*II_V_66_0F_3A_19*/ {{0x1c8, 9549}, 0x50, 1, 0, 0, 0}, + /*II_66_0F_3A_20*/ {{0x1c9, 9563}, 0x0, 1, 0, 0, 0}, + /*II_V_66_0F_3A_20*/ {{0x184, 9571}, 0x0, 80, 1, 0, 0}, + /*II_66_0F_3A_21*/ {{0x1bc, 9580}, 0x0, 1, 0, 0, 0}, + /*II_V_66_0F_3A_21*/ {{0x184, 9590}, 0x0, 85, 1, 0, 0}, + /*II_66_0F_3A_22*/ {{0x1ca, 9601}, 0x0, 1, 0, 0, 9609}, + /*II_V_66_0F_3A_22*/ {{0x184, 9617}, 0x6, 73, 1, 9626, 0}, + /*II_66_0F_3A_40*/ {{0x1a2, 9635}, 0x0, 1, 0, 0, 0}, + /*II_V_66_0F_3A_40*/ {{0x189, 9641}, 0x1, 91, 1, 0, 0}, + /*II_66_0F_3A_41*/ {{0x1a2, 9648}, 0x0, 1, 0, 0, 0}, + /*II_V_66_0F_3A_41*/ {{0x184, 9654}, 0x0, 87, 1, 0, 0}, + /*II_66_0F_3A_42*/ {{0x1a2, 9661}, 0x0, 1, 0, 0, 0}, + /*II_V_66_0F_3A_42*/ {{0x184, 9670}, 0x0, 87, 1, 0, 0}, + /*II_66_0F_3A_44*/ {{0x1cb, 9680}, 0x0, 1, 0, 0, 0}, + /*II_V_66_0F_3A_44*/ {{0x1cc, 9691}, 0x0, 87, 1, 0, 0}, + /*II_V_66_0F_3A_4A*/ {{0x189, 9703}, 0x1, 91, 37, 0, 0}, + /*II_V_66_0F_3A_4B*/ {{0x189, 9714}, 0x1, 91, 37, 0, 0}, + /*II_V_66_0F_3A_4C*/ {{0x184, 9725}, 0x0, 87, 35, 0, 0}, + /*II_66_0F_3A_60*/ {{0x1cd, 9736}, 0x0, 1, 0, 0, 0}, + /*II_V_66_0F_3A_60*/ {{0x163, 9747}, 0x40, 1, 0, 0, 0}, + /*II_66_0F_3A_61*/ {{0x1cd, 9759}, 0x0, 1, 0, 0, 0}, + /*II_V_66_0F_3A_61*/ {{0x163, 9770}, 0x40, 1, 0, 0, 0}, + /*II_66_0F_3A_62*/ {{0x1cd, 9782}, 0x0, 1, 0, 0, 0}, + /*II_V_66_0F_3A_62*/ {{0x163, 9793}, 0x40, 1, 0, 0, 0}, + /*II_66_0F_3A_63*/ {{0x1cd, 9805}, 0x0, 1, 0, 0, 0}, + /*II_V_66_0F_3A_63*/ {{0x163, 9816}, 0x40, 1, 0, 0, 0}, + /*II_66_0F_3A_DF*/ {{0x1ce, 9828}, 0x0, 1, 0, 0, 0}, + /*II_V_66_0F_3A_DF*/ {{0x1cf, 9845}, 0x40, 1, 0, 0, 0}, + /*II_V_66_0F_71_02*/ {{0x1d2, 6476}, 0x0, 1, 0, 0, 0}, + /*II_V_66_0F_71_04*/ {{0x1d2, 6735}, 0x0, 1, 0, 0, 0}, + /*II_V_66_0F_71_06*/ {{0x1d2, 7049}, 0x0, 1, 0, 0, 0}, + /*II_V_66_0F_72_02*/ {{0x1d2, 6491}, 0x0, 1, 0, 0, 0}, + /*II_V_66_0F_72_04*/ {{0x1d2, 6750}, 0x0, 1, 0, 0, 0}, + /*II_V_66_0F_72_06*/ {{0x1d2, 7064}, 0x0, 1, 0, 0, 0}, + /*II_V_66_0F_73_02*/ {{0x1d2, 6506}, 0x0, 1, 0, 0, 0}, + /*II_V_66_0F_73_03*/ {{0x1d2, 9871}, 0x0, 1, 0, 0, 0}, + /*II_V_66_0F_73_06*/ {{0x1d2, 7079}, 0x0, 1, 0, 0, 0}, + /*II_V_66_0F_73_07*/ {{0x1d2, 9888}, 0x0, 1, 0, 0, 0}, + /*II_0F_AE_00*/ {{0x173, 9897}, 0x0, 0, 0, 0, 9905}, + /*II_0F_AE_01*/ {{0x173, 9925}, 0x0, 0, 0, 0, 9934}, + /*II_V_0F_AE_02*/ {{0x1d5, 9974}, 0x40, 0, 0, 0, 0}, + /*II_V_0F_AE_03*/ {{0x1d5, 10003}, 0x40, 0, 0, 0, 0} }; _InstNode InstructionsTree[5688] = { @@ -7570,7 +7570,6 @@ _InstSharedInfo InstSharedInfoTable[474] = { {13, 0, 0, 0, 0, 0, 256}, {28, 0, 2, 0, 0, 0, 258}, {28, 0, 0, 0, 0, 0, 258}, -{11, 0, 0, 0, 0, 0, 262}, {11, 0, 1, 0, 0, 0, 262}, {9, 0, 0, 0, 0, 0, 262}, {28, 0, 0, 255, 0, 0, 33026}, @@ -7592,6 +7591,7 @@ _InstSharedInfo InstSharedInfoTable[474] = { {1, 25, 14, 0, 0, 0, 33024}, {11, 11, 25, 0, 0, 0, 33024}, {11, 14, 25, 0, 0, 0, 33024}, +{11, 0, 0, 0, 0, 0, 262}, {11, 0, 0, 0, 0, 0, 33032}, {11, 0, 0, 1, 0, 0, 256}, {11, 0, 0, 2, 0, 0, 33024}, diff --git a/NativeCore/Dependencies/distorm/src/mnemonics.c b/NativeCore/Dependencies/distorm/src/mnemonics.c index f306a258..91be7a8e 100644 --- a/NativeCore/Dependencies/distorm/src/mnemonics.c +++ b/NativeCore/Dependencies/distorm/src/mnemonics.c @@ -27,32 +27,32 @@ const unsigned char _MNEMONICS[] = "\x03" "cqo\0" "\x08" "call far\0" "\x05" "pushf\0" "\x04" "popf\0" \ "\x04" "sahf\0" "\x04" "lahf\0" "\x04" "movs\0" "\x04" "cmps\0" "\x04" "stos\0" \ "\x04" "lods\0" "\x04" "scas\0" "\x03" "ret\0" "\x03" "les\0" "\x03" "lds\0" \ -"\x05" "enter\0" "\x05" "leave\0" "\x04" "retf\0" "\x05" "int 3\0" \ -"\x03" "int\0" "\x04" "into\0" "\x04" "iret\0" "\x03" "aam\0" "\x03" "aad\0" \ -"\x04" "salc\0" "\x04" "xlat\0" "\x06" "loopnz\0" "\x05" "loopz\0" \ -"\x04" "loop\0" "\x04" "jcxz\0" "\x05" "jecxz\0" "\x05" "jrcxz\0" "\x02" "in\0" \ -"\x03" "out\0" "\x04" "call\0" "\x03" "jmp\0" "\x07" "jmp far\0" "\x04" "int1\0" \ -"\x03" "hlt\0" "\x03" "cmc\0" "\x03" "clc\0" "\x03" "stc\0" "\x03" "cli\0" \ -"\x03" "sti\0" "\x03" "cld\0" "\x03" "std\0" "\x03" "lar\0" "\x03" "lsl\0" \ -"\x07" "syscall\0" "\x04" "clts\0" "\x06" "sysret\0" "\x04" "invd\0" \ -"\x06" "wbinvd\0" "\x03" "ud2\0" "\x05" "femms\0" "\x03" "nop\0" "\x05" "wrmsr\0" \ -"\x05" "rdtsc\0" "\x05" "rdmsr\0" "\x05" "rdpmc\0" "\x08" "sysenter\0" \ -"\x07" "sysexit\0" "\x06" "getsec\0" "\x05" "cmovo\0" "\x06" "cmovno\0" \ -"\x05" "cmovb\0" "\x06" "cmovae\0" "\x05" "cmovz\0" "\x06" "cmovnz\0" \ -"\x06" "cmovbe\0" "\x05" "cmova\0" "\x05" "cmovs\0" "\x06" "cmovns\0" \ -"\x05" "cmovp\0" "\x06" "cmovnp\0" "\x05" "cmovl\0" "\x06" "cmovge\0" \ -"\x06" "cmovle\0" "\x05" "cmovg\0" "\x04" "seto\0" "\x05" "setno\0" \ -"\x04" "setb\0" "\x05" "setae\0" "\x04" "setz\0" "\x05" "setnz\0" "\x05" "setbe\0" \ -"\x04" "seta\0" "\x04" "sets\0" "\x05" "setns\0" "\x04" "setp\0" "\x05" "setnp\0" \ -"\x04" "setl\0" "\x05" "setge\0" "\x05" "setle\0" "\x04" "setg\0" "\x05" "cpuid\0" \ -"\x02" "bt\0" "\x04" "shld\0" "\x03" "rsm\0" "\x03" "bts\0" "\x04" "shrd\0" \ -"\x07" "cmpxchg\0" "\x03" "lss\0" "\x03" "btr\0" "\x03" "lfs\0" "\x03" "lgs\0" \ -"\x05" "movzx\0" "\x03" "btc\0" "\x05" "movsx\0" "\x04" "xadd\0" "\x06" "movnti\0" \ -"\x05" "bswap\0" "\x03" "rol\0" "\x03" "ror\0" "\x03" "rcl\0" "\x03" "rcr\0" \ -"\x03" "shl\0" "\x03" "shr\0" "\x03" "sal\0" "\x03" "sar\0" "\x06" "xabort\0" \ -"\x06" "xbegin\0" "\x04" "fadd\0" "\x04" "fmul\0" "\x04" "fcom\0" "\x05" "fcomp\0" \ -"\x04" "fsub\0" "\x05" "fsubr\0" "\x04" "fdiv\0" "\x05" "fdivr\0" "\x03" "fld\0" \ -"\x03" "fst\0" "\x04" "fstp\0" "\x06" "fldenv\0" "\x05" "fldcw\0" "\x04" "fxch\0" \ +"\x05" "enter\0" "\x05" "leave\0" "\x04" "retf\0" "\x04" "int3\0" "\x03" "int\0" \ +"\x04" "into\0" "\x04" "iret\0" "\x03" "aam\0" "\x03" "aad\0" "\x04" "salc\0" \ +"\x04" "xlat\0" "\x06" "loopnz\0" "\x05" "loopz\0" "\x04" "loop\0" \ +"\x04" "jcxz\0" "\x05" "jecxz\0" "\x05" "jrcxz\0" "\x02" "in\0" "\x03" "out\0" \ +"\x04" "call\0" "\x03" "jmp\0" "\x07" "jmp far\0" "\x04" "int1\0" "\x03" "hlt\0" \ +"\x03" "cmc\0" "\x03" "clc\0" "\x03" "stc\0" "\x03" "cli\0" "\x03" "sti\0" \ +"\x03" "cld\0" "\x03" "std\0" "\x03" "lar\0" "\x03" "lsl\0" "\x07" "syscall\0" \ +"\x04" "clts\0" "\x06" "sysret\0" "\x04" "invd\0" "\x06" "wbinvd\0" \ +"\x03" "ud2\0" "\x05" "femms\0" "\x03" "nop\0" "\x05" "wrmsr\0" "\x05" "rdtsc\0" \ +"\x05" "rdmsr\0" "\x05" "rdpmc\0" "\x08" "sysenter\0" "\x07" "sysexit\0" \ +"\x06" "getsec\0" "\x05" "cmovo\0" "\x06" "cmovno\0" "\x05" "cmovb\0" \ +"\x06" "cmovae\0" "\x05" "cmovz\0" "\x06" "cmovnz\0" "\x06" "cmovbe\0" \ +"\x05" "cmova\0" "\x05" "cmovs\0" "\x06" "cmovns\0" "\x05" "cmovp\0" \ +"\x06" "cmovnp\0" "\x05" "cmovl\0" "\x06" "cmovge\0" "\x06" "cmovle\0" \ +"\x05" "cmovg\0" "\x04" "seto\0" "\x05" "setno\0" "\x04" "setb\0" "\x05" "setae\0" \ +"\x04" "setz\0" "\x05" "setnz\0" "\x05" "setbe\0" "\x04" "seta\0" "\x04" "sets\0" \ +"\x05" "setns\0" "\x04" "setp\0" "\x05" "setnp\0" "\x04" "setl\0" "\x05" "setge\0" \ +"\x05" "setle\0" "\x04" "setg\0" "\x05" "cpuid\0" "\x02" "bt\0" "\x04" "shld\0" \ +"\x03" "rsm\0" "\x03" "bts\0" "\x04" "shrd\0" "\x07" "cmpxchg\0" "\x03" "lss\0" \ +"\x03" "btr\0" "\x03" "lfs\0" "\x03" "lgs\0" "\x05" "movzx\0" "\x03" "btc\0" \ +"\x05" "movsx\0" "\x04" "xadd\0" "\x06" "movnti\0" "\x05" "bswap\0" \ +"\x03" "rol\0" "\x03" "ror\0" "\x03" "rcl\0" "\x03" "rcr\0" "\x03" "shl\0" \ +"\x03" "shr\0" "\x03" "sal\0" "\x03" "sar\0" "\x06" "xabort\0" "\x06" "xbegin\0" \ +"\x04" "fadd\0" "\x04" "fmul\0" "\x04" "fcom\0" "\x05" "fcomp\0" "\x04" "fsub\0" \ +"\x05" "fsubr\0" "\x04" "fdiv\0" "\x05" "fdivr\0" "\x03" "fld\0" "\x03" "fst\0" \ +"\x04" "fstp\0" "\x06" "fldenv\0" "\x05" "fldcw\0" "\x04" "fxch\0" \ "\x04" "fnop\0" "\x04" "fchs\0" "\x04" "fabs\0" "\x04" "ftst\0" "\x04" "fxam\0" \ "\x04" "fld1\0" "\x06" "fldl2t\0" "\x06" "fldl2e\0" "\x05" "fldpi\0" \ "\x06" "fldlg2\0" "\x06" "fldln2\0" "\x04" "fldz\0" "\x05" "f2xm1\0" \ diff --git a/NativeCore/Dependencies/distorm/src/wstring.c b/NativeCore/Dependencies/distorm/src/wstring.c deleted file mode 100644 index 083200b4..00000000 --- a/NativeCore/Dependencies/distorm/src/wstring.c +++ /dev/null @@ -1,47 +0,0 @@ -/* -wstring.c - -diStorm3 - Powerful disassembler for X86/AMD64 -http://ragestorm.net/distorm/ -distorm at gmail dot com -Copyright (C) 2003-2018 Gil Dabah -This library is licensed under the BSD license. See the file COPYING. -*/ - - -#include "wstring.h" - -#ifndef DISTORM_LIGHT - -void strclear_WS(_WString* s) -{ - s->p[0] = '\0'; - s->length = 0; -} - -void chrcat_WS(_WString* s, uint8_t ch) -{ - s->p[s->length] = ch; - s->p[s->length + 1] = '\0'; - s->length += 1; -} - -void strcpylen_WS(_WString* s, const int8_t* buf, unsigned int len) -{ - s->length = len; - memcpy((int8_t*)s->p, buf, len + 1); -} - -void strcatlen_WS(_WString* s, const int8_t* buf, unsigned int len) -{ - memcpy((int8_t*)&s->p[s->length], buf, len + 1); - s->length += len; -} - -void strcat_WS(_WString* s, const _WString* s2) -{ - memcpy((int8_t*)&s->p[s->length], s2->p, s2->length + 1); - s->length += s2->length; -} - -#endif /* DISTORM_LIGHT */ From 2e48bce5e75a7f7ae26eeab50899b94c6dd39251 Mon Sep 17 00:00:00 2001 From: KN4CK3R Date: Fri, 7 Oct 2022 00:33:42 +0200 Subject: [PATCH 220/223] Add support for x86 and x64 in Makefiles. --- Makefile | 14 +- NativeCore/Shared/DistormHelper.cpp | 6 +- NativeCore/Unix/Makefile | 358 +++++++++++++++++------- NativeCore/Unix/NativeCore.Unix.vcxproj | 2 - NativeCore/Windows/NativeCore.vcxproj | 4 +- README.md | 15 +- ReClass.NET/Memory/UnionDataType.cs | 12 +- 7 files changed, 285 insertions(+), 126 deletions(-) diff --git a/Makefile b/Makefile index 10ab0620..750027d5 100644 --- a/Makefile +++ b/Makefile @@ -37,12 +37,12 @@ docker_all: docker_debug: cd ReClass.NET_Launcher && make docker_debug cd ReClass.NET && make docker_debug - docker container run --rm -v ${PWD}:/build:z -w /build -u $(shell id -u ${USER}):$(shell id -g ${USER}) gcc:latest bash -c "cd NativeCore/Unix && make debug" + docker container run --rm -v ${PWD}:/build:z -w /build -u $(shell id -u ${USER}):$(shell id -g ${USER}) gcc_multilib:latest bash -c "cd NativeCore/Unix && make debug" docker_release: cd ReClass.NET_Launcher && make docker_release cd ReClass.NET && make docker_release - docker container run --rm -v ${PWD}:/build:z -w /build -u $(shell id -u ${USER}):$(shell id -g ${USER}) gcc:latest bash -c "cd NativeCore/Unix && make release" + docker container run --rm -v ${PWD}:/build:z -w /build -u $(shell id -u ${USER}):$(shell id -g ${USER}) gcc_multilib:latest bash -c "cd NativeCore/Unix && make release" podman_all: make podman_debug @@ -52,19 +52,21 @@ podman_all: podman_debug: cd ReClass.NET_Launcher && make podman_debug cd ReClass.NET && make podman_debug - podman container run --rm -v ${PWD}:/build:z -w /build gcc:latest bash -c "cd NativeCore/Unix && make debug" + podman container run --rm -v ${PWD}:/build:z -w /build gcc_multilib:latest bash -c "cd NativeCore/Unix && make debug" podman_release: cd ReClass.NET_Launcher && make podman_release cd ReClass.NET && make podman_release - podman container run --rm -v ${PWD}:/build:z -w /build gcc:latest bash -c "cd NativeCore/Unix && make release" + podman container run --rm -v ${PWD}:/build:z -w /build gcc_multilib:latest bash -c "cd NativeCore/Unix && make release" dist: test -d build || mkdir -p build cp -r ReClass.NET/bin/* build/ cp -r ReClass.NET_Launcher/bin/* build/ - cp NativeCore/Unix/build/debug/NativeCore.so build/Debug/x64 - cp NativeCore/Unix/build/release/NativeCore.so build/Release/x64 + cp NativeCore/Unix/build/debug/x86/NativeCore.so build/Debug/x86 + cp NativeCore/Unix/build/debug/x64/NativeCore.so build/Debug/x64 + cp NativeCore/Unix/build/release/x86/NativeCore.so build/Release/x86 + cp NativeCore/Unix/build/release/x64/NativeCore.so build/Release/x64 test -d build/Debug/x86/Plugins || mkdir build/Debug/x86/Plugins test -d build/Debug/x64/Plugins || mkdir build/Debug/x64/Plugins test -d build/Release/x86/Plugins || mkdir build/Release/x86/Plugins diff --git a/NativeCore/Shared/DistormHelper.cpp b/NativeCore/Shared/DistormHelper.cpp index 9d8d9e85..092b1670 100644 --- a/NativeCore/Shared/DistormHelper.cpp +++ b/NativeCore/Shared/DistormHelper.cpp @@ -66,10 +66,10 @@ _CodeInfo CreateCodeInfo(const uint8_t* address, int length, const _OffsetType v info.codeLen = length; info.features = DF_NONE; -#ifdef RECLASSNET32 - info.dt = Decode32Bits; -#else +#ifdef RECLASSNET64 info.dt = Decode64Bits; +#else + info.dt = Decode32Bits; #endif return info; diff --git a/NativeCore/Unix/Makefile b/NativeCore/Unix/Makefile index 12c8b33b..f18ff1fb 100644 --- a/NativeCore/Unix/Makefile +++ b/NativeCore/Unix/Makefile @@ -7,192 +7,338 @@ LD = g++ WINDRES = windres INC = -I../Dependencies/distorm/include -CFLAGS = -Wall -fPIC -DRECLASSNET64=1 +CFLAGS32 = -Wall -fPIC -m32 +CFLAGS64 = -Wall -fPIC -m64 -DRECLASSNET64=1 RESINC = LIBDIR = LIB = -lstdc++fs -lstdc++ -LDFLAGS = -shared -Wl,--no-undefined +LDFLAGS32 = -m32 -shared -Wl,--no-undefined +LDFLAGS64 = -m64 -shared -Wl,--no-undefined INC_DEBUG = $(INC) -CFLAGS_DEBUG = $(CFLAGS) -g +CFLAGS32_DEBUG = $(CFLAGS32) -g +CFLAGS64_DEBUG = $(CFLAGS64) -g RESINC_DEBUG = $(RESINC) RCFLAGS_DEBUG = $(RCFLAGS) LIBDIR_DEBUG = $(LIBDIR) LIB_DEBUG = $(LIB) -LDFLAGS_DEBUG = $(LDFLAGS) -OBJDIR_DEBUG = obj/debug +LDFLAGS32_DEBUG = $(LDFLAGS32) +LDFLAGS64_DEBUG = $(LDFLAGS64) +OBJDIR32_DEBUG = obj/debug/x86 +OBJDIR64_DEBUG = obj/debug/x64 DEP_DEBUG = -OUT_DEBUG = build/debug/NativeCore.so +OUT32_DEBUG = build/debug/x86/NativeCore.so +OUT64_DEBUG = build/debug/x64/NativeCore.so INC_RELEASE = $(INC) -CFLAGS_RELEASE = $(CFLAGS) -O2 +CFLAGS32_RELEASE = $(CFLAGS32) -O2 +CFLAGS64_RELEASE = $(CFLAGS64) -O2 RESINC_RELEASE = $(RESINC) RCFLAGS_RELEASE = $(RCFLAGS) LIBDIR_RELEASE = $(LIBDIR) LIB_RELEASE = $(LIB) -LDFLAGS_RELEASE = $(LDFLAGS) -s -OBJDIR_RELEASE = obj/release +LDFLAGS32_RELEASE = $(LDFLAGS32) -s +LDFLAGS64_RELEASE = $(LDFLAGS64) -s +OBJDIR32_RELEASE = obj/release/x86 +OBJDIR64_RELEASE = obj/release/x64 DEP_RELEASE = -OUT_RELEASE = build/release/NativeCore.so +OUT32_RELEASE = build/release/x86/NativeCore.so +OUT64_RELEASE = build/release/x64/NativeCore.so -OBJ_DEBUG = $(OBJDIR_DEBUG)/WriteRemoteMemory.o $(OBJDIR_DEBUG)/ReadRemoteMemory.o $(OBJDIR_DEBUG)/OpenRemoteProcess.o $(OBJDIR_DEBUG)/IsProcessValid.o $(OBJDIR_DEBUG)/Input.o $(OBJDIR_DEBUG)/EnumerateRemoteSectionsAndModules.o $(OBJDIR_DEBUG)/EnumerateProcesses.o $(OBJDIR_DEBUG)/DisassembleCode.o $(OBJDIR_DEBUG)/DistormHelper.o $(OBJDIR_DEBUG)/Debugger.o $(OBJDIR_DEBUG)/ControlRemoteProcess.o $(OBJDIR_DEBUG)/CloseRemoteProcess.o $(OBJDIR_DEBUG)/decoder.o $(OBJDIR_DEBUG)/distorm.o $(OBJDIR_DEBUG)/instructions.o $(OBJDIR_DEBUG)/insts.o $(OBJDIR_DEBUG)/mnemonics.o $(OBJDIR_DEBUG)/operands.o $(OBJDIR_DEBUG)/prefix.o $(OBJDIR_DEBUG)/textdefs.o +OBJ32_DEBUG = $(OBJDIR32_DEBUG)/WriteRemoteMemory.o $(OBJDIR32_DEBUG)/ReadRemoteMemory.o $(OBJDIR32_DEBUG)/OpenRemoteProcess.o $(OBJDIR32_DEBUG)/IsProcessValid.o $(OBJDIR32_DEBUG)/Input.o $(OBJDIR32_DEBUG)/EnumerateRemoteSectionsAndModules.o $(OBJDIR32_DEBUG)/EnumerateProcesses.o $(OBJDIR32_DEBUG)/DisassembleCode.o $(OBJDIR32_DEBUG)/DistormHelper.o $(OBJDIR32_DEBUG)/Debugger.o $(OBJDIR32_DEBUG)/ControlRemoteProcess.o $(OBJDIR32_DEBUG)/CloseRemoteProcess.o $(OBJDIR32_DEBUG)/decoder.o $(OBJDIR32_DEBUG)/distorm.o $(OBJDIR32_DEBUG)/instructions.o $(OBJDIR32_DEBUG)/insts.o $(OBJDIR32_DEBUG)/mnemonics.o $(OBJDIR32_DEBUG)/operands.o $(OBJDIR32_DEBUG)/prefix.o $(OBJDIR32_DEBUG)/textdefs.o +OBJ64_DEBUG = $(OBJDIR64_DEBUG)/WriteRemoteMemory.o $(OBJDIR64_DEBUG)/ReadRemoteMemory.o $(OBJDIR64_DEBUG)/OpenRemoteProcess.o $(OBJDIR64_DEBUG)/IsProcessValid.o $(OBJDIR64_DEBUG)/Input.o $(OBJDIR64_DEBUG)/EnumerateRemoteSectionsAndModules.o $(OBJDIR64_DEBUG)/EnumerateProcesses.o $(OBJDIR64_DEBUG)/DisassembleCode.o $(OBJDIR64_DEBUG)/DistormHelper.o $(OBJDIR64_DEBUG)/Debugger.o $(OBJDIR64_DEBUG)/ControlRemoteProcess.o $(OBJDIR64_DEBUG)/CloseRemoteProcess.o $(OBJDIR64_DEBUG)/decoder.o $(OBJDIR64_DEBUG)/distorm.o $(OBJDIR64_DEBUG)/instructions.o $(OBJDIR64_DEBUG)/insts.o $(OBJDIR64_DEBUG)/mnemonics.o $(OBJDIR64_DEBUG)/operands.o $(OBJDIR64_DEBUG)/prefix.o $(OBJDIR64_DEBUG)/textdefs.o -OBJ_RELEASE = $(OBJDIR_RELEASE)/WriteRemoteMemory.o $(OBJDIR_RELEASE)/ReadRemoteMemory.o $(OBJDIR_RELEASE)/OpenRemoteProcess.o $(OBJDIR_RELEASE)/IsProcessValid.o $(OBJDIR_RELEASE)/Input.o $(OBJDIR_RELEASE)/EnumerateRemoteSectionsAndModules.o $(OBJDIR_RELEASE)/EnumerateProcesses.o $(OBJDIR_RELEASE)/DisassembleCode.o $(OBJDIR_RELEASE)/DistormHelper.o $(OBJDIR_RELEASE)/Debugger.o $(OBJDIR_RELEASE)/ControlRemoteProcess.o $(OBJDIR_RELEASE)/CloseRemoteProcess.o $(OBJDIR_RELEASE)/decoder.o $(OBJDIR_RELEASE)/distorm.o $(OBJDIR_RELEASE)/instructions.o $(OBJDIR_RELEASE)/insts.o $(OBJDIR_RELEASE)/mnemonics.o $(OBJDIR_RELEASE)/operands.o $(OBJDIR_RELEASE)/prefix.o $(OBJDIR_RELEASE)/textdefs.o +OBJ32_RELEASE = $(OBJDIR32_RELEASE)/WriteRemoteMemory.o $(OBJDIR32_RELEASE)/ReadRemoteMemory.o $(OBJDIR32_RELEASE)/OpenRemoteProcess.o $(OBJDIR32_RELEASE)/IsProcessValid.o $(OBJDIR32_RELEASE)/Input.o $(OBJDIR32_RELEASE)/EnumerateRemoteSectionsAndModules.o $(OBJDIR32_RELEASE)/EnumerateProcesses.o $(OBJDIR32_RELEASE)/DisassembleCode.o $(OBJDIR32_RELEASE)/DistormHelper.o $(OBJDIR32_RELEASE)/Debugger.o $(OBJDIR32_RELEASE)/ControlRemoteProcess.o $(OBJDIR32_RELEASE)/CloseRemoteProcess.o $(OBJDIR32_RELEASE)/decoder.o $(OBJDIR32_RELEASE)/distorm.o $(OBJDIR32_RELEASE)/instructions.o $(OBJDIR32_RELEASE)/insts.o $(OBJDIR32_RELEASE)/mnemonics.o $(OBJDIR32_RELEASE)/operands.o $(OBJDIR32_RELEASE)/prefix.o $(OBJDIR32_RELEASE)/textdefs.o +OBJ64_RELEASE = $(OBJDIR64_RELEASE)/WriteRemoteMemory.o $(OBJDIR64_RELEASE)/ReadRemoteMemory.o $(OBJDIR64_RELEASE)/OpenRemoteProcess.o $(OBJDIR64_RELEASE)/IsProcessValid.o $(OBJDIR64_RELEASE)/Input.o $(OBJDIR64_RELEASE)/EnumerateRemoteSectionsAndModules.o $(OBJDIR64_RELEASE)/EnumerateProcesses.o $(OBJDIR64_RELEASE)/DisassembleCode.o $(OBJDIR64_RELEASE)/DistormHelper.o $(OBJDIR64_RELEASE)/Debugger.o $(OBJDIR64_RELEASE)/ControlRemoteProcess.o $(OBJDIR64_RELEASE)/CloseRemoteProcess.o $(OBJDIR64_RELEASE)/decoder.o $(OBJDIR64_RELEASE)/distorm.o $(OBJDIR64_RELEASE)/instructions.o $(OBJDIR64_RELEASE)/insts.o $(OBJDIR64_RELEASE)/mnemonics.o $(OBJDIR64_RELEASE)/operands.o $(OBJDIR64_RELEASE)/prefix.o $(OBJDIR64_RELEASE)/textdefs.o all: debug release clean: clean_debug clean_release before_debug: - test -d build/debug || mkdir -p build/debug - test -d $(OBJDIR_DEBUG) || mkdir -p $(OBJDIR_DEBUG) + test -d build/debug/x86 || mkdir -p build/debug/x86 + test -d build/debug/x64 || mkdir -p build/debug/x64 + test -d $(OBJDIR32_DEBUG) || mkdir -p $(OBJDIR32_DEBUG) + test -d $(OBJDIR64_DEBUG) || mkdir -p $(OBJDIR64_DEBUG) after_debug: -debug: before_debug out_debug after_debug +debug: before_debug out_debug32 out_debug64 after_debug -out_debug: before_debug $(OBJ_DEBUG) $(DEP_DEBUG) - $(CXX) $(LIBDIR_DEBUG) -o $(OUT_DEBUG) $(OBJ_DEBUG) $(LDFLAGS_DEBUG) $(LIB_DEBUG) +out_debug32: before_debug $(OBJ32_DEBUG) $(DEP_DEBUG) + $(CXX) $(LIBDIR_DEBUG) -o $(OUT32_DEBUG) $(OBJ32_DEBUG) $(LDFLAGS32_DEBUG) $(LIB_DEBUG) -$(OBJDIR_DEBUG)/WriteRemoteMemory.o: WriteRemoteMemory.cpp - $(CXX) $(CFLAGS_DEBUG) $(INC_DEBUG) -c WriteRemoteMemory.cpp -o $(OBJDIR_DEBUG)/WriteRemoteMemory.o +$(OBJDIR32_DEBUG)/WriteRemoteMemory.o: WriteRemoteMemory.cpp + $(CXX) $(CFLAGS32_DEBUG) $(INC_DEBUG) -c WriteRemoteMemory.cpp -o $(OBJDIR32_DEBUG)/WriteRemoteMemory.o -$(OBJDIR_DEBUG)/ReadRemoteMemory.o: ReadRemoteMemory.cpp - $(CXX) $(CFLAGS_DEBUG) $(INC_DEBUG) -c ReadRemoteMemory.cpp -o $(OBJDIR_DEBUG)/ReadRemoteMemory.o +$(OBJDIR32_DEBUG)/ReadRemoteMemory.o: ReadRemoteMemory.cpp + $(CXX) $(CFLAGS32_DEBUG) $(INC_DEBUG) -c ReadRemoteMemory.cpp -o $(OBJDIR32_DEBUG)/ReadRemoteMemory.o -$(OBJDIR_DEBUG)/OpenRemoteProcess.o: OpenRemoteProcess.cpp - $(CXX) $(CFLAGS_DEBUG) $(INC_DEBUG) -c OpenRemoteProcess.cpp -o $(OBJDIR_DEBUG)/OpenRemoteProcess.o +$(OBJDIR32_DEBUG)/OpenRemoteProcess.o: OpenRemoteProcess.cpp + $(CXX) $(CFLAGS32_DEBUG) $(INC_DEBUG) -c OpenRemoteProcess.cpp -o $(OBJDIR32_DEBUG)/OpenRemoteProcess.o -$(OBJDIR_DEBUG)/IsProcessValid.o: IsProcessValid.cpp - $(CXX) $(CFLAGS_DEBUG) $(INC_DEBUG) -c IsProcessValid.cpp -o $(OBJDIR_DEBUG)/IsProcessValid.o +$(OBJDIR32_DEBUG)/IsProcessValid.o: IsProcessValid.cpp + $(CXX) $(CFLAGS32_DEBUG) $(INC_DEBUG) -c IsProcessValid.cpp -o $(OBJDIR32_DEBUG)/IsProcessValid.o -$(OBJDIR_DEBUG)/Input.o: Input.cpp - $(CXX) $(CFLAGS_DEBUG) $(INC_DEBUG) -c Input.cpp -o $(OBJDIR_DEBUG)/Input.o +$(OBJDIR32_DEBUG)/Input.o: Input.cpp + $(CXX) $(CFLAGS32_DEBUG) $(INC_DEBUG) -c Input.cpp -o $(OBJDIR32_DEBUG)/Input.o -$(OBJDIR_DEBUG)/EnumerateRemoteSectionsAndModules.o: EnumerateRemoteSectionsAndModules.cpp - $(CXX) $(CFLAGS_DEBUG) $(INC_DEBUG) -c EnumerateRemoteSectionsAndModules.cpp -o $(OBJDIR_DEBUG)/EnumerateRemoteSectionsAndModules.o +$(OBJDIR32_DEBUG)/EnumerateRemoteSectionsAndModules.o: EnumerateRemoteSectionsAndModules.cpp + $(CXX) $(CFLAGS32_DEBUG) $(INC_DEBUG) -c EnumerateRemoteSectionsAndModules.cpp -o $(OBJDIR32_DEBUG)/EnumerateRemoteSectionsAndModules.o -$(OBJDIR_DEBUG)/EnumerateProcesses.o: EnumerateProcesses.cpp - $(CXX) $(CFLAGS_DEBUG) $(INC_DEBUG) -c EnumerateProcesses.cpp -o $(OBJDIR_DEBUG)/EnumerateProcesses.o +$(OBJDIR32_DEBUG)/EnumerateProcesses.o: EnumerateProcesses.cpp + $(CXX) $(CFLAGS32_DEBUG) $(INC_DEBUG) -c EnumerateProcesses.cpp -o $(OBJDIR32_DEBUG)/EnumerateProcesses.o -$(OBJDIR_DEBUG)/DisassembleCode.o: DisassembleCode.cpp - $(CXX) $(CFLAGS_DEBUG) $(INC_DEBUG) -c DisassembleCode.cpp -o $(OBJDIR_DEBUG)/DisassembleCode.o +$(OBJDIR32_DEBUG)/DisassembleCode.o: DisassembleCode.cpp + $(CXX) $(CFLAGS32_DEBUG) $(INC_DEBUG) -c DisassembleCode.cpp -o $(OBJDIR32_DEBUG)/DisassembleCode.o -$(OBJDIR_DEBUG)/DistormHelper.o: ../Shared/DistormHelper.cpp - $(CXX) $(CFLAGS_DEBUG) $(INC_DEBUG) -c ../Shared/DistormHelper.cpp -o $(OBJDIR_DEBUG)/DistormHelper.o +$(OBJDIR32_DEBUG)/DistormHelper.o: ../Shared/DistormHelper.cpp + $(CXX) $(CFLAGS32_DEBUG) $(INC_DEBUG) -c ../Shared/DistormHelper.cpp -o $(OBJDIR32_DEBUG)/DistormHelper.o -$(OBJDIR_DEBUG)/Debugger.o: Debugger.cpp - $(CXX) $(CFLAGS_DEBUG) $(INC_DEBUG) -c Debugger.cpp -o $(OBJDIR_DEBUG)/Debugger.o +$(OBJDIR32_DEBUG)/Debugger.o: Debugger.cpp + $(CXX) $(CFLAGS32_DEBUG) $(INC_DEBUG) -c Debugger.cpp -o $(OBJDIR32_DEBUG)/Debugger.o -$(OBJDIR_DEBUG)/ControlRemoteProcess.o: ControlRemoteProcess.cpp - $(CXX) $(CFLAGS_DEBUG) $(INC_DEBUG) -c ControlRemoteProcess.cpp -o $(OBJDIR_DEBUG)/ControlRemoteProcess.o +$(OBJDIR32_DEBUG)/ControlRemoteProcess.o: ControlRemoteProcess.cpp + $(CXX) $(CFLAGS32_DEBUG) $(INC_DEBUG) -c ControlRemoteProcess.cpp -o $(OBJDIR32_DEBUG)/ControlRemoteProcess.o -$(OBJDIR_DEBUG)/CloseRemoteProcess.o: CloseRemoteProcess.cpp - $(CXX) $(CFLAGS_DEBUG) $(INC_DEBUG) -c CloseRemoteProcess.cpp -o $(OBJDIR_DEBUG)/CloseRemoteProcess.o +$(OBJDIR32_DEBUG)/CloseRemoteProcess.o: CloseRemoteProcess.cpp + $(CXX) $(CFLAGS32_DEBUG) $(INC_DEBUG) -c CloseRemoteProcess.cpp -o $(OBJDIR32_DEBUG)/CloseRemoteProcess.o -$(OBJDIR_DEBUG)/decoder.o: ../Dependencies/distorm/src/decoder.c - $(CXX) $(CFLAGS_DEBUG) $(INC_DEBUG) -c ../Dependencies/distorm/src/decoder.c -o $(OBJDIR_DEBUG)/decoder.o +$(OBJDIR32_DEBUG)/decoder.o: ../Dependencies/distorm/src/decoder.c + $(CXX) $(CFLAGS32_DEBUG) $(INC_DEBUG) -c ../Dependencies/distorm/src/decoder.c -o $(OBJDIR32_DEBUG)/decoder.o -$(OBJDIR_DEBUG)/distorm.o: ../Dependencies/distorm/src/distorm.c - $(CXX) $(CFLAGS_DEBUG) $(INC_DEBUG) -c ../Dependencies/distorm/src/distorm.c -o $(OBJDIR_DEBUG)/distorm.o +$(OBJDIR32_DEBUG)/distorm.o: ../Dependencies/distorm/src/distorm.c + $(CXX) $(CFLAGS32_DEBUG) $(INC_DEBUG) -c ../Dependencies/distorm/src/distorm.c -o $(OBJDIR32_DEBUG)/distorm.o -$(OBJDIR_DEBUG)/instructions.o: ../Dependencies/distorm/src/instructions.c - $(CXX) $(CFLAGS_DEBUG) $(INC_DEBUG) -c ../Dependencies/distorm/src/instructions.c -o $(OBJDIR_DEBUG)/instructions.o +$(OBJDIR32_DEBUG)/instructions.o: ../Dependencies/distorm/src/instructions.c + $(CXX) $(CFLAGS32_DEBUG) $(INC_DEBUG) -c ../Dependencies/distorm/src/instructions.c -o $(OBJDIR32_DEBUG)/instructions.o -$(OBJDIR_DEBUG)/insts.o: ../Dependencies/distorm/src/insts.c - $(CXX) $(CFLAGS_DEBUG) $(INC_DEBUG) -c ../Dependencies/distorm/src/insts.c -o $(OBJDIR_DEBUG)/insts.o +$(OBJDIR32_DEBUG)/insts.o: ../Dependencies/distorm/src/insts.c + $(CXX) $(CFLAGS32_DEBUG) $(INC_DEBUG) -c ../Dependencies/distorm/src/insts.c -o $(OBJDIR32_DEBUG)/insts.o -$(OBJDIR_DEBUG)/mnemonics.o: ../Dependencies/distorm/src/mnemonics.c - $(CXX) $(CFLAGS_DEBUG) $(INC_DEBUG) -c ../Dependencies/distorm/src/mnemonics.c -o $(OBJDIR_DEBUG)/mnemonics.o +$(OBJDIR32_DEBUG)/mnemonics.o: ../Dependencies/distorm/src/mnemonics.c + $(CXX) $(CFLAGS32_DEBUG) $(INC_DEBUG) -c ../Dependencies/distorm/src/mnemonics.c -o $(OBJDIR32_DEBUG)/mnemonics.o -$(OBJDIR_DEBUG)/operands.o: ../Dependencies/distorm/src/operands.c - $(CXX) $(CFLAGS_DEBUG) $(INC_DEBUG) -c ../Dependencies/distorm/src/operands.c -o $(OBJDIR_DEBUG)/operands.o +$(OBJDIR32_DEBUG)/operands.o: ../Dependencies/distorm/src/operands.c + $(CXX) $(CFLAGS32_DEBUG) $(INC_DEBUG) -c ../Dependencies/distorm/src/operands.c -o $(OBJDIR32_DEBUG)/operands.o -$(OBJDIR_DEBUG)/prefix.o: ../Dependencies/distorm/src/prefix.c - $(CXX) $(CFLAGS_DEBUG) $(INC_DEBUG) -c ../Dependencies/distorm/src/prefix.c -o $(OBJDIR_DEBUG)/prefix.o +$(OBJDIR32_DEBUG)/prefix.o: ../Dependencies/distorm/src/prefix.c + $(CXX) $(CFLAGS32_DEBUG) $(INC_DEBUG) -c ../Dependencies/distorm/src/prefix.c -o $(OBJDIR32_DEBUG)/prefix.o -$(OBJDIR_DEBUG)/textdefs.o: ../Dependencies/distorm/src/textdefs.c - $(CXX) $(CFLAGS_DEBUG) $(INC_DEBUG) -c ../Dependencies/distorm/src/textdefs.c -o $(OBJDIR_DEBUG)/textdefs.o +$(OBJDIR32_DEBUG)/textdefs.o: ../Dependencies/distorm/src/textdefs.c + $(CXX) $(CFLAGS32_DEBUG) $(INC_DEBUG) -c ../Dependencies/distorm/src/textdefs.c -o $(OBJDIR32_DEBUG)/textdefs.o + +out_debug64: before_debug $(OBJ64_DEBUG) $(DEP_DEBUG) + $(CXX) $(LIBDIR_DEBUG) -o $(OUT64_DEBUG) $(OBJ64_DEBUG) $(LDFLAGS64_DEBUG) $(LIB_DEBUG) + +$(OBJDIR64_DEBUG)/WriteRemoteMemory.o: WriteRemoteMemory.cpp + $(CXX) $(CFLAGS64_DEBUG) $(INC_DEBUG) -c WriteRemoteMemory.cpp -o $(OBJDIR64_DEBUG)/WriteRemoteMemory.o + +$(OBJDIR64_DEBUG)/ReadRemoteMemory.o: ReadRemoteMemory.cpp + $(CXX) $(CFLAGS64_DEBUG) $(INC_DEBUG) -c ReadRemoteMemory.cpp -o $(OBJDIR64_DEBUG)/ReadRemoteMemory.o + +$(OBJDIR64_DEBUG)/OpenRemoteProcess.o: OpenRemoteProcess.cpp + $(CXX) $(CFLAGS64_DEBUG) $(INC_DEBUG) -c OpenRemoteProcess.cpp -o $(OBJDIR64_DEBUG)/OpenRemoteProcess.o + +$(OBJDIR64_DEBUG)/IsProcessValid.o: IsProcessValid.cpp + $(CXX) $(CFLAGS64_DEBUG) $(INC_DEBUG) -c IsProcessValid.cpp -o $(OBJDIR64_DEBUG)/IsProcessValid.o + +$(OBJDIR64_DEBUG)/Input.o: Input.cpp + $(CXX) $(CFLAGS64_DEBUG) $(INC_DEBUG) -c Input.cpp -o $(OBJDIR64_DEBUG)/Input.o + +$(OBJDIR64_DEBUG)/EnumerateRemoteSectionsAndModules.o: EnumerateRemoteSectionsAndModules.cpp + $(CXX) $(CFLAGS64_DEBUG) $(INC_DEBUG) -c EnumerateRemoteSectionsAndModules.cpp -o $(OBJDIR64_DEBUG)/EnumerateRemoteSectionsAndModules.o + +$(OBJDIR64_DEBUG)/EnumerateProcesses.o: EnumerateProcesses.cpp + $(CXX) $(CFLAGS64_DEBUG) $(INC_DEBUG) -c EnumerateProcesses.cpp -o $(OBJDIR64_DEBUG)/EnumerateProcesses.o + +$(OBJDIR64_DEBUG)/DisassembleCode.o: DisassembleCode.cpp + $(CXX) $(CFLAGS64_DEBUG) $(INC_DEBUG) -c DisassembleCode.cpp -o $(OBJDIR64_DEBUG)/DisassembleCode.o + +$(OBJDIR64_DEBUG)/DistormHelper.o: ../Shared/DistormHelper.cpp + $(CXX) $(CFLAGS64_DEBUG) $(INC_DEBUG) -c ../Shared/DistormHelper.cpp -o $(OBJDIR64_DEBUG)/DistormHelper.o + +$(OBJDIR64_DEBUG)/Debugger.o: Debugger.cpp + $(CXX) $(CFLAGS64_DEBUG) $(INC_DEBUG) -c Debugger.cpp -o $(OBJDIR64_DEBUG)/Debugger.o + +$(OBJDIR64_DEBUG)/ControlRemoteProcess.o: ControlRemoteProcess.cpp + $(CXX) $(CFLAGS64_DEBUG) $(INC_DEBUG) -c ControlRemoteProcess.cpp -o $(OBJDIR64_DEBUG)/ControlRemoteProcess.o + +$(OBJDIR64_DEBUG)/CloseRemoteProcess.o: CloseRemoteProcess.cpp + $(CXX) $(CFLAGS64_DEBUG) $(INC_DEBUG) -c CloseRemoteProcess.cpp -o $(OBJDIR64_DEBUG)/CloseRemoteProcess.o + +$(OBJDIR64_DEBUG)/decoder.o: ../Dependencies/distorm/src/decoder.c + $(CXX) $(CFLAGS64_DEBUG) $(INC_DEBUG) -c ../Dependencies/distorm/src/decoder.c -o $(OBJDIR64_DEBUG)/decoder.o + +$(OBJDIR64_DEBUG)/distorm.o: ../Dependencies/distorm/src/distorm.c + $(CXX) $(CFLAGS64_DEBUG) $(INC_DEBUG) -c ../Dependencies/distorm/src/distorm.c -o $(OBJDIR64_DEBUG)/distorm.o + +$(OBJDIR64_DEBUG)/instructions.o: ../Dependencies/distorm/src/instructions.c + $(CXX) $(CFLAGS64_DEBUG) $(INC_DEBUG) -c ../Dependencies/distorm/src/instructions.c -o $(OBJDIR64_DEBUG)/instructions.o + +$(OBJDIR64_DEBUG)/insts.o: ../Dependencies/distorm/src/insts.c + $(CXX) $(CFLAGS64_DEBUG) $(INC_DEBUG) -c ../Dependencies/distorm/src/insts.c -o $(OBJDIR64_DEBUG)/insts.o + +$(OBJDIR64_DEBUG)/mnemonics.o: ../Dependencies/distorm/src/mnemonics.c + $(CXX) $(CFLAGS64_DEBUG) $(INC_DEBUG) -c ../Dependencies/distorm/src/mnemonics.c -o $(OBJDIR64_DEBUG)/mnemonics.o + +$(OBJDIR64_DEBUG)/operands.o: ../Dependencies/distorm/src/operands.c + $(CXX) $(CFLAGS64_DEBUG) $(INC_DEBUG) -c ../Dependencies/distorm/src/operands.c -o $(OBJDIR64_DEBUG)/operands.o + +$(OBJDIR64_DEBUG)/prefix.o: ../Dependencies/distorm/src/prefix.c + $(CXX) $(CFLAGS64_DEBUG) $(INC_DEBUG) -c ../Dependencies/distorm/src/prefix.c -o $(OBJDIR64_DEBUG)/prefix.o + +$(OBJDIR64_DEBUG)/textdefs.o: ../Dependencies/distorm/src/textdefs.c + $(CXX) $(CFLAGS64_DEBUG) $(INC_DEBUG) -c ../Dependencies/distorm/src/textdefs.c -o $(OBJDIR64_DEBUG)/textdefs.o clean_debug: - rm -f $(OBJ_DEBUG) $(OUT_DEBUG) + rm -f $(OBJ32_DEBUG) $(OUT32_DEBUG) + rm -f $(OBJ64_DEBUG) $(OUT64_DEBUG) rm -rf build/debug - rm -rf $(OBJDIR_DEBUG) + rm -rf $(OBJDIR32_DEBUG) + rm -rf $(OBJDIR64_DEBUG) before_release: - test -d build/release || mkdir -p build/release - test -d $(OBJDIR_RELEASE) || mkdir -p $(OBJDIR_RELEASE) + test -d build/release/x86 || mkdir -p build/release/x86 + test -d build/release/x64 || mkdir -p build/release/x64 + test -d $(OBJDIR32_RELEASE) || mkdir -p $(OBJDIR32_RELEASE) + test -d $(OBJDIR64_RELEASE) || mkdir -p $(OBJDIR64_RELEASE) after_release: -release: before_release out_release after_release +release: before_release out_release32 out_release64 after_release + +out_release32: before_release $(OBJ32_RELEASE) $(DEP_RELEASE) + $(CXX) $(LIBDIR_RELEASE) -o $(OUT32_RELEASE) $(OBJ32_RELEASE) $(LDFLAGS32_RELEASE) $(LIB_RELEASE) + +$(OBJDIR32_RELEASE)/WriteRemoteMemory.o: WriteRemoteMemory.cpp + $(CXX) $(CFLAGS32_RELEASE) $(INC_RELEASE) -c WriteRemoteMemory.cpp -o $(OBJDIR32_RELEASE)/WriteRemoteMemory.o + +$(OBJDIR32_RELEASE)/ReadRemoteMemory.o: ReadRemoteMemory.cpp + $(CXX) $(CFLAGS32_RELEASE) $(INC_RELEASE) -c ReadRemoteMemory.cpp -o $(OBJDIR32_RELEASE)/ReadRemoteMemory.o + +$(OBJDIR32_RELEASE)/OpenRemoteProcess.o: OpenRemoteProcess.cpp + $(CXX) $(CFLAGS32_RELEASE) $(INC_RELEASE) -c OpenRemoteProcess.cpp -o $(OBJDIR32_RELEASE)/OpenRemoteProcess.o + +$(OBJDIR32_RELEASE)/IsProcessValid.o: IsProcessValid.cpp + $(CXX) $(CFLAGS32_RELEASE) $(INC_RELEASE) -c IsProcessValid.cpp -o $(OBJDIR32_RELEASE)/IsProcessValid.o + +$(OBJDIR32_RELEASE)/Input.o: Input.cpp + $(CXX) $(CFLAGS32_RELEASE) $(INC_RELEASE) -c Input.cpp -o $(OBJDIR32_RELEASE)/Input.o + +$(OBJDIR32_RELEASE)/EnumerateRemoteSectionsAndModules.o: EnumerateRemoteSectionsAndModules.cpp + $(CXX) $(CFLAGS32_RELEASE) $(INC_RELEASE) -c EnumerateRemoteSectionsAndModules.cpp -o $(OBJDIR32_RELEASE)/EnumerateRemoteSectionsAndModules.o + +$(OBJDIR32_RELEASE)/EnumerateProcesses.o: EnumerateProcesses.cpp + $(CXX) $(CFLAGS32_RELEASE) $(INC_RELEASE) -c EnumerateProcesses.cpp -o $(OBJDIR32_RELEASE)/EnumerateProcesses.o + +$(OBJDIR32_RELEASE)/DisassembleCode.o: DisassembleCode.cpp + $(CXX) $(CFLAGS32_RELEASE) $(INC_RELEASE) -c DisassembleCode.cpp -o $(OBJDIR32_RELEASE)/DisassembleCode.o + +$(OBJDIR32_RELEASE)/DistormHelper.o: ../Shared/DistormHelper.cpp + $(CXX) $(CFLAGS32_RELEASE) $(INC_RELEASE) -c ../Shared/DistormHelper.cpp -o $(OBJDIR32_RELEASE)/DistormHelper.o + +$(OBJDIR32_RELEASE)/Debugger.o: Debugger.cpp + $(CXX) $(CFLAGS32_RELEASE) $(INC_RELEASE) -c Debugger.cpp -o $(OBJDIR32_RELEASE)/Debugger.o + +$(OBJDIR32_RELEASE)/ControlRemoteProcess.o: ControlRemoteProcess.cpp + $(CXX) $(CFLAGS32_RELEASE) $(INC_RELEASE) -c ControlRemoteProcess.cpp -o $(OBJDIR32_RELEASE)/ControlRemoteProcess.o + +$(OBJDIR32_RELEASE)/CloseRemoteProcess.o: CloseRemoteProcess.cpp + $(CXX) $(CFLAGS32_RELEASE) $(INC_RELEASE) -c CloseRemoteProcess.cpp -o $(OBJDIR32_RELEASE)/CloseRemoteProcess.o + +$(OBJDIR32_RELEASE)/decoder.o: ../Dependencies/distorm/src/decoder.c + $(CXX) $(CFLAGS32_RELEASE) $(INC_RELEASE) -c ../Dependencies/distorm/src/decoder.c -o $(OBJDIR32_RELEASE)/decoder.o + +$(OBJDIR32_RELEASE)/distorm.o: ../Dependencies/distorm/src/distorm.c + $(CXX) $(CFLAGS32_RELEASE) $(INC_RELEASE) -c ../Dependencies/distorm/src/distorm.c -o $(OBJDIR32_RELEASE)/distorm.o + +$(OBJDIR32_RELEASE)/instructions.o: ../Dependencies/distorm/src/instructions.c + $(CXX) $(CFLAGS32_RELEASE) $(INC_RELEASE) -c ../Dependencies/distorm/src/instructions.c -o $(OBJDIR32_RELEASE)/instructions.o + +$(OBJDIR32_RELEASE)/insts.o: ../Dependencies/distorm/src/insts.c + $(CXX) $(CFLAGS32_RELEASE) $(INC_RELEASE) -c ../Dependencies/distorm/src/insts.c -o $(OBJDIR32_RELEASE)/insts.o + +$(OBJDIR32_RELEASE)/mnemonics.o: ../Dependencies/distorm/src/mnemonics.c + $(CXX) $(CFLAGS32_RELEASE) $(INC_RELEASE) -c ../Dependencies/distorm/src/mnemonics.c -o $(OBJDIR32_RELEASE)/mnemonics.o + +$(OBJDIR32_RELEASE)/operands.o: ../Dependencies/distorm/src/operands.c + $(CXX) $(CFLAGS32_RELEASE) $(INC_RELEASE) -c ../Dependencies/distorm/src/operands.c -o $(OBJDIR32_RELEASE)/operands.o + +$(OBJDIR32_RELEASE)/prefix.o: ../Dependencies/distorm/src/prefix.c + $(CXX) $(CFLAGS32_RELEASE) $(INC_RELEASE) -c ../Dependencies/distorm/src/prefix.c -o $(OBJDIR32_RELEASE)/prefix.o + +$(OBJDIR32_RELEASE)/textdefs.o: ../Dependencies/distorm/src/textdefs.c + $(CXX) $(CFLAGS32_RELEASE) $(INC_RELEASE) -c ../Dependencies/distorm/src/textdefs.c -o $(OBJDIR32_RELEASE)/textdefs.o -out_release: before_release $(OBJ_RELEASE) $(DEP_RELEASE) - $(LD) $(LIBDIR_RELEASE) -o $(OUT_RELEASE) $(OBJ_RELEASE) $(LDFLAGS_RELEASE) $(LIB_RELEASE) +out_release64: before_release $(OBJ64_RELEASE) $(DEP_RELEASE) + $(CXX) $(LIBDIR_RELEASE) -o $(OUT64_RELEASE) $(OBJ64_RELEASE) $(LDFLAGS64_RELEASE) $(LIB_RELEASE) -$(OBJDIR_RELEASE)/WriteRemoteMemory.o: WriteRemoteMemory.cpp - $(CXX) $(CFLAGS_RELEASE) $(INC_RELEASE) -c WriteRemoteMemory.cpp -o $(OBJDIR_RELEASE)/WriteRemoteMemory.o +$(OBJDIR64_RELEASE)/WriteRemoteMemory.o: WriteRemoteMemory.cpp + $(CXX) $(CFLAGS64_RELEASE) $(INC_RELEASE) -c WriteRemoteMemory.cpp -o $(OBJDIR64_RELEASE)/WriteRemoteMemory.o -$(OBJDIR_RELEASE)/ReadRemoteMemory.o: ReadRemoteMemory.cpp - $(CXX) $(CFLAGS_RELEASE) $(INC_RELEASE) -c ReadRemoteMemory.cpp -o $(OBJDIR_RELEASE)/ReadRemoteMemory.o +$(OBJDIR64_RELEASE)/ReadRemoteMemory.o: ReadRemoteMemory.cpp + $(CXX) $(CFLAGS64_RELEASE) $(INC_RELEASE) -c ReadRemoteMemory.cpp -o $(OBJDIR64_RELEASE)/ReadRemoteMemory.o -$(OBJDIR_RELEASE)/OpenRemoteProcess.o: OpenRemoteProcess.cpp - $(CXX) $(CFLAGS_RELEASE) $(INC_RELEASE) -c OpenRemoteProcess.cpp -o $(OBJDIR_RELEASE)/OpenRemoteProcess.o +$(OBJDIR64_RELEASE)/OpenRemoteProcess.o: OpenRemoteProcess.cpp + $(CXX) $(CFLAGS64_RELEASE) $(INC_RELEASE) -c OpenRemoteProcess.cpp -o $(OBJDIR64_RELEASE)/OpenRemoteProcess.o -$(OBJDIR_RELEASE)/IsProcessValid.o: IsProcessValid.cpp - $(CXX) $(CFLAGS_RELEASE) $(INC_RELEASE) -c IsProcessValid.cpp -o $(OBJDIR_RELEASE)/IsProcessValid.o +$(OBJDIR64_RELEASE)/IsProcessValid.o: IsProcessValid.cpp + $(CXX) $(CFLAGS64_RELEASE) $(INC_RELEASE) -c IsProcessValid.cpp -o $(OBJDIR64_RELEASE)/IsProcessValid.o -$(OBJDIR_RELEASE)/Input.o: Input.cpp - $(CXX) $(CFLAGS_RELEASE) $(INC_RELEASE) -c Input.cpp -o $(OBJDIR_RELEASE)/Input.o +$(OBJDIR64_RELEASE)/Input.o: Input.cpp + $(CXX) $(CFLAGS64_RELEASE) $(INC_RELEASE) -c Input.cpp -o $(OBJDIR64_RELEASE)/Input.o -$(OBJDIR_RELEASE)/EnumerateRemoteSectionsAndModules.o: EnumerateRemoteSectionsAndModules.cpp - $(CXX) $(CFLAGS_RELEASE) $(INC_RELEASE) -c EnumerateRemoteSectionsAndModules.cpp -o $(OBJDIR_RELEASE)/EnumerateRemoteSectionsAndModules.o +$(OBJDIR64_RELEASE)/EnumerateRemoteSectionsAndModules.o: EnumerateRemoteSectionsAndModules.cpp + $(CXX) $(CFLAGS64_RELEASE) $(INC_RELEASE) -c EnumerateRemoteSectionsAndModules.cpp -o $(OBJDIR64_RELEASE)/EnumerateRemoteSectionsAndModules.o -$(OBJDIR_RELEASE)/EnumerateProcesses.o: EnumerateProcesses.cpp - $(CXX) $(CFLAGS_RELEASE) $(INC_RELEASE) -c EnumerateProcesses.cpp -o $(OBJDIR_RELEASE)/EnumerateProcesses.o +$(OBJDIR64_RELEASE)/EnumerateProcesses.o: EnumerateProcesses.cpp + $(CXX) $(CFLAGS64_RELEASE) $(INC_RELEASE) -c EnumerateProcesses.cpp -o $(OBJDIR64_RELEASE)/EnumerateProcesses.o -$(OBJDIR_RELEASE)/DisassembleCode.o: DisassembleCode.cpp - $(CXX) $(CFLAGS_RELEASE) $(INC_RELEASE) -c DisassembleCode.cpp -o $(OBJDIR_RELEASE)/DisassembleCode.o +$(OBJDIR64_RELEASE)/DisassembleCode.o: DisassembleCode.cpp + $(CXX) $(CFLAGS64_RELEASE) $(INC_RELEASE) -c DisassembleCode.cpp -o $(OBJDIR64_RELEASE)/DisassembleCode.o -$(OBJDIR_RELEASE)/DistormHelper.o: ../Shared/DistormHelper.cpp - $(CXX) $(CFLAGS_RELEASE) $(INC_RELEASE) -c ../Shared/DistormHelper.cpp -o $(OBJDIR_RELEASE)/DistormHelper.o +$(OBJDIR64_RELEASE)/DistormHelper.o: ../Shared/DistormHelper.cpp + $(CXX) $(CFLAGS64_RELEASE) $(INC_RELEASE) -c ../Shared/DistormHelper.cpp -o $(OBJDIR64_RELEASE)/DistormHelper.o -$(OBJDIR_RELEASE)/Debugger.o: Debugger.cpp - $(CXX) $(CFLAGS_RELEASE) $(INC_RELEASE) -c Debugger.cpp -o $(OBJDIR_RELEASE)/Debugger.o +$(OBJDIR64_RELEASE)/Debugger.o: Debugger.cpp + $(CXX) $(CFLAGS64_RELEASE) $(INC_RELEASE) -c Debugger.cpp -o $(OBJDIR64_RELEASE)/Debugger.o -$(OBJDIR_RELEASE)/ControlRemoteProcess.o: ControlRemoteProcess.cpp - $(CXX) $(CFLAGS_RELEASE) $(INC_RELEASE) -c ControlRemoteProcess.cpp -o $(OBJDIR_RELEASE)/ControlRemoteProcess.o +$(OBJDIR64_RELEASE)/ControlRemoteProcess.o: ControlRemoteProcess.cpp + $(CXX) $(CFLAGS64_RELEASE) $(INC_RELEASE) -c ControlRemoteProcess.cpp -o $(OBJDIR64_RELEASE)/ControlRemoteProcess.o -$(OBJDIR_RELEASE)/CloseRemoteProcess.o: CloseRemoteProcess.cpp - $(CXX) $(CFLAGS_RELEASE) $(INC_RELEASE) -c CloseRemoteProcess.cpp -o $(OBJDIR_RELEASE)/CloseRemoteProcess.o +$(OBJDIR64_RELEASE)/CloseRemoteProcess.o: CloseRemoteProcess.cpp + $(CXX) $(CFLAGS64_RELEASE) $(INC_RELEASE) -c CloseRemoteProcess.cpp -o $(OBJDIR64_RELEASE)/CloseRemoteProcess.o -$(OBJDIR_RELEASE)/decoder.o: ../Dependencies/distorm/src/decoder.c - $(CXX) $(CFLAGS_RELEASE) $(INC_RELEASE) -c ../Dependencies/distorm/src/decoder.c -o $(OBJDIR_RELEASE)/decoder.o +$(OBJDIR64_RELEASE)/decoder.o: ../Dependencies/distorm/src/decoder.c + $(CXX) $(CFLAGS64_RELEASE) $(INC_RELEASE) -c ../Dependencies/distorm/src/decoder.c -o $(OBJDIR64_RELEASE)/decoder.o -$(OBJDIR_RELEASE)/distorm.o: ../Dependencies/distorm/src/distorm.c - $(CXX) $(CFLAGS_RELEASE) $(INC_RELEASE) -c ../Dependencies/distorm/src/distorm.c -o $(OBJDIR_RELEASE)/distorm.o +$(OBJDIR64_RELEASE)/distorm.o: ../Dependencies/distorm/src/distorm.c + $(CXX) $(CFLAGS64_RELEASE) $(INC_RELEASE) -c ../Dependencies/distorm/src/distorm.c -o $(OBJDIR64_RELEASE)/distorm.o -$(OBJDIR_RELEASE)/instructions.o: ../Dependencies/distorm/src/instructions.c - $(CXX) $(CFLAGS_RELEASE) $(INC_RELEASE) -c ../Dependencies/distorm/src/instructions.c -o $(OBJDIR_RELEASE)/instructions.o +$(OBJDIR64_RELEASE)/instructions.o: ../Dependencies/distorm/src/instructions.c + $(CXX) $(CFLAGS64_RELEASE) $(INC_RELEASE) -c ../Dependencies/distorm/src/instructions.c -o $(OBJDIR64_RELEASE)/instructions.o -$(OBJDIR_RELEASE)/insts.o: ../Dependencies/distorm/src/insts.c - $(CXX) $(CFLAGS_RELEASE) $(INC_RELEASE) -c ../Dependencies/distorm/src/insts.c -o $(OBJDIR_RELEASE)/insts.o +$(OBJDIR64_RELEASE)/insts.o: ../Dependencies/distorm/src/insts.c + $(CXX) $(CFLAGS64_RELEASE) $(INC_RELEASE) -c ../Dependencies/distorm/src/insts.c -o $(OBJDIR64_RELEASE)/insts.o -$(OBJDIR_RELEASE)/mnemonics.o: ../Dependencies/distorm/src/mnemonics.c - $(CXX) $(CFLAGS_RELEASE) $(INC_RELEASE) -c ../Dependencies/distorm/src/mnemonics.c -o $(OBJDIR_RELEASE)/mnemonics.o +$(OBJDIR64_RELEASE)/mnemonics.o: ../Dependencies/distorm/src/mnemonics.c + $(CXX) $(CFLAGS64_RELEASE) $(INC_RELEASE) -c ../Dependencies/distorm/src/mnemonics.c -o $(OBJDIR64_RELEASE)/mnemonics.o -$(OBJDIR_RELEASE)/operands.o: ../Dependencies/distorm/src/operands.c - $(CXX) $(CFLAGS_RELEASE) $(INC_RELEASE) -c ../Dependencies/distorm/src/operands.c -o $(OBJDIR_RELEASE)/operands.o +$(OBJDIR64_RELEASE)/operands.o: ../Dependencies/distorm/src/operands.c + $(CXX) $(CFLAGS64_RELEASE) $(INC_RELEASE) -c ../Dependencies/distorm/src/operands.c -o $(OBJDIR64_RELEASE)/operands.o -$(OBJDIR_RELEASE)/prefix.o: ../Dependencies/distorm/src/prefix.c - $(CXX) $(CFLAGS_RELEASE) $(INC_RELEASE) -c ../Dependencies/distorm/src/prefix.c -o $(OBJDIR_RELEASE)/prefix.o +$(OBJDIR64_RELEASE)/prefix.o: ../Dependencies/distorm/src/prefix.c + $(CXX) $(CFLAGS64_RELEASE) $(INC_RELEASE) -c ../Dependencies/distorm/src/prefix.c -o $(OBJDIR64_RELEASE)/prefix.o -$(OBJDIR_RELEASE)/textdefs.o: ../Dependencies/distorm/src/textdefs.c - $(CXX) $(CFLAGS_RELEASE) $(INC_RELEASE) -c ../Dependencies/distorm/src/textdefs.c -o $(OBJDIR_RELEASE)/textdefs.o +$(OBJDIR64_RELEASE)/textdefs.o: ../Dependencies/distorm/src/textdefs.c + $(CXX) $(CFLAGS64_RELEASE) $(INC_RELEASE) -c ../Dependencies/distorm/src/textdefs.c -o $(OBJDIR64_RELEASE)/textdefs.o clean_release: - rm -f $(OBJ_RELEASE) $(OUT_RELEASE) + rm -f $(OBJ32_RELEASE) $(OUT32_RELEASE) + rm -f $(OBJ64_RELEASE) $(OUT64_RELEASE) rm -rf build/release - rm -rf $(OBJDIR_RELEASE) + rm -rf $(OBJDIR32_RELEASE) + rm -rf $(OBJDIR64_RELEASE) .PHONY: before_debug after_debug clean_debug before_release after_release clean_release diff --git a/NativeCore/Unix/NativeCore.Unix.vcxproj b/NativeCore/Unix/NativeCore.Unix.vcxproj index 9ce274fd..83bff48a 100644 --- a/NativeCore/Unix/NativeCore.Unix.vcxproj +++ b/NativeCore/Unix/NativeCore.Unix.vcxproj @@ -155,7 +155,6 @@ c++1y ../Dependencies/distorm/include;$(Sysroot)\usr\include;$(StlIncludeDirectories);%(AdditionalIncludeDirectories) -m32 %(AdditionalOptions) - RECLASSNET32 -m32 %(AdditionalOptions) @@ -168,7 +167,6 @@ c++1y ../Dependencies/distorm/include;$(Sysroot)\usr\include;$(StlIncludeDirectories);%(AdditionalIncludeDirectories) -m32 %(AdditionalOptions) - RECLASSNET32;%(PreprocessorDefinitions) None true false diff --git a/NativeCore/Windows/NativeCore.vcxproj b/NativeCore/Windows/NativeCore.vcxproj index 5715bcb4..5600a51a 100644 --- a/NativeCore/Windows/NativeCore.vcxproj +++ b/NativeCore/Windows/NativeCore.vcxproj @@ -103,7 +103,7 @@ Level3 Disabled - WIN32;_DEBUG;_WINDOWS;_USRDLL;NATIVECORE_EXPORTS;_CRT_SECURE_NO_WARNINGS;NOMINMAX;RECLASSNET32;_SILENCE_CXX17_CODECVT_HEADER_DEPRECATION_WARNING;%(PreprocessorDefinitions) + WIN32;_DEBUG;_WINDOWS;_USRDLL;NATIVECORE_EXPORTS;_CRT_SECURE_NO_WARNINGS;NOMINMAX;_SILENCE_CXX17_CODECVT_HEADER_DEPRECATION_WARNING;%(PreprocessorDefinitions) stdcpp17 @@ -137,7 +137,7 @@ MaxSpeed true true - WIN32;NDEBUG;_WINDOWS;_USRDLL;NATIVECORE_EXPORTS;_CRT_SECURE_NO_WARNINGS;NOMINMAX;RECLASSNET32;_SILENCE_CXX17_CODECVT_HEADER_DEPRECATION_WARNING;%(PreprocessorDefinitions) + WIN32;NDEBUG;_WINDOWS;_USRDLL;NATIVECORE_EXPORTS;_CRT_SECURE_NO_WARNINGS;NOMINMAX;_SILENCE_CXX17_CODECVT_HEADER_DEPRECATION_WARNING;%(PreprocessorDefinitions) stdcpp17 diff --git a/README.md b/README.md index 6f424ced..82a8a53d 100644 --- a/README.md +++ b/README.md @@ -77,7 +77,20 @@ Just download the [latest version](https://github.com/ReClassNET/ReClass.NET/rel If you want to compile ReClass.NET just fork the repository and open the ReClass.NET.sln file with Visual Studio 2019. Compile the project and copy the dependencies to the output folder. -To compile the linux native core library, you need WSL [installed and configured](https://learn.microsoft.com/en-us/cpp/build/walkthrough-build-debug-wsl2). If you do not need linux support, simply unload the project in the Solution Explorer. +To compile the linux native core library, you need WSL [installed and configured](https://learn.microsoft.com/en-us/cpp/build/walkthrough-build-debug-wsl2). If you do not need linux support, simply unload the project in the Solution Explorer. If you want to build cross-platform (x86/x64) you have to install `g++-multilib` too. + +If you use the `Makefile` with `docker` or `podman` you have to build the needed image `gcc_multilib` from the following `Dockerfile` (`docker build -t gcc_multi .`): + +``` +FROM ubuntu:latest + +RUN apt-get update \ + && apt-get install --assume-yes --no-install-recommends --quiet \ + make \ + g++ \ + g++-multilib \ + && apt-get clean all +``` ## Videos diff --git a/ReClass.NET/Memory/UnionDataType.cs b/ReClass.NET/Memory/UnionDataType.cs index 36a47a7e..0cea977a 100644 --- a/ReClass.NET/Memory/UnionDataType.cs +++ b/ReClass.NET/Memory/UnionDataType.cs @@ -56,20 +56,20 @@ public struct UInt64FloatDoubleData public long LongValue; public IntPtr IntPtr => -#if RECLASSNET32 - unchecked((IntPtr)(int)LongValue); -#else +#if RECLASSNET64 (IntPtr)LongValue; +#else + unchecked((IntPtr)(int)LongValue); #endif [FieldOffset(0)] public ulong ULongValue; public UIntPtr UIntPtr => -#if RECLASSNET32 - unchecked((UIntPtr)(uint)ULongValue); -#else +#if RECLASSNET64 (UIntPtr)ULongValue; +#else + unchecked((UIntPtr)(uint)ULongValue); #endif [FieldOffset(0)] From a895421d2e8aa20a02d25696ec305b09a7f37a6d Mon Sep 17 00:00:00 2001 From: KN4CK3R Date: Sat, 29 Apr 2023 10:57:16 +0200 Subject: [PATCH 221/223] Prevent inserting bytes in ContainerNodes. --- ReClass.NET/Forms/MainForm.cs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/ReClass.NET/Forms/MainForm.cs b/ReClass.NET/Forms/MainForm.cs index 010eea25..e771a10d 100644 --- a/ReClass.NET/Forms/MainForm.cs +++ b/ReClass.NET/Forms/MainForm.cs @@ -473,6 +473,7 @@ private void selectedNodeContextMenuStrip_Opening(object sender, CancelEventArgs var parentNode = node?.GetParentContainer(); var nodeIsClass = node is ClassNode; + var nodeIsContainer = node is BaseContainerNode; var nodeIsSearchableValueNode = node switch { BaseHexNode _ => true, @@ -494,8 +495,8 @@ private void selectedNodeContextMenuStrip_Opening(object sender, CancelEventArgs _ => false }; - addBytesToolStripMenuItem.Enabled = parentNode != null || nodeIsClass; - insertBytesToolStripMenuItem.Enabled = count == 1 && parentNode != null && !nodeIsClass; + addBytesToolStripMenuItem.Enabled = parentNode != null || nodeIsContainer; + insertBytesToolStripMenuItem.Enabled = count == 1 && parentNode != null && !nodeIsContainer; changeTypeToolStripMenuItem.Enabled = count > 0 && !nodeIsClass; @@ -830,9 +831,10 @@ private void memoryViewControl_SelectionChanged(object sender, EventArgs e) var node = selectedNodes.FirstOrDefault()?.Node; var parentContainer = node?.GetParentContainer(); var nodeIsClass = node is ClassNode; + var isContainerNode = node is BaseContainerNode; - addBytesToolStripDropDownButton.Enabled = parentContainer != null || nodeIsClass; - insertBytesToolStripDropDownButton.Enabled = selectedNodes.Count == 1 && parentContainer != null && !nodeIsClass; + addBytesToolStripDropDownButton.Enabled = parentContainer != null || isContainerNode; + insertBytesToolStripDropDownButton.Enabled = selectedNodes.Count == 1 && parentContainer != null && !isContainerNode; var enabled = selectedNodes.Count > 0 && !nodeIsClass; toolStrip.Items.OfType().ForEach(b => b.Enabled = enabled); From 8dc64c8ce5563fab12d8fc360d1acc1de8d4a57d Mon Sep 17 00:00:00 2001 From: KN4CK3R Date: Mon, 5 Jun 2023 20:31:34 +0200 Subject: [PATCH 222/223] Fix rtf \tab keyword. --- ReClass.NET/Util/Rtf/RtfBuilder.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ReClass.NET/Util/Rtf/RtfBuilder.cs b/ReClass.NET/Util/Rtf/RtfBuilder.cs index 76bd7b95..5f83c837 100644 --- a/ReClass.NET/Util/Rtf/RtfBuilder.cs +++ b/ReClass.NET/Util/Rtf/RtfBuilder.cs @@ -258,7 +258,7 @@ private static string EscapeString(string value) { if (c == '\t') { - sb.Append(@"\tab"); + sb.Append(@"\tab "); } else if (c <= 255) { From b6c17dcd75f439666b2aa1e40a2b99932949e2e2 Mon Sep 17 00:00:00 2001 From: descear <47546329+descear@users.noreply.github.com> Date: Sat, 24 Jun 2023 12:12:40 +0100 Subject: [PATCH 223/223] Fix infinite loop in iteration of memory mapping lines; fixes #242 --- NativeCore/Unix/EnumerateRemoteSectionsAndModules.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/NativeCore/Unix/EnumerateRemoteSectionsAndModules.cpp b/NativeCore/Unix/EnumerateRemoteSectionsAndModules.cpp index 079cba54..9d821cfe 100644 --- a/NativeCore/Unix/EnumerateRemoteSectionsAndModules.cpp +++ b/NativeCore/Unix/EnumerateRemoteSectionsAndModules.cpp @@ -52,11 +52,12 @@ extern "C" void RC_CallConv EnumerateRemoteSectionsAndModules(RC_Pointer handle, auto path = std::stringstream(); path << "/proc/" << reinterpret_cast(handle) << "/maps"; + std::ifstream input(path.str()); std::unordered_map modules; std::string line; - while (std::getline(std::ifstream(path.str()), line)) + while (std::getline(input, line)) { std::stringstream ss(line);