diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 00000000..e7f5fa79 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,211 @@ +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 #### + +# 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/Makefile b/Makefile index f169682b..750027d5 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,12 +29,44 @@ 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 -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_multilib: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_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_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/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 10071646..b0467bae 100644 --- a/NativeCore/Dependencies/distorm/include/distorm.h +++ b/NativeCore/Dependencies/distorm/include/distorm.h @@ -1,4 +1,4 @@ -/* diStorm 3.3.3 */ +/* diStorm 3.5.3 */ /* 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-2016 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. * @@ -471,7 +488,7 @@ typedef enum { DECRES_NONE, DECRES_SUCCESS, DECRES_MEMORYERR, DECRES_INPUTERR, D * * Output: unsigned int - version of compiled library. */ -unsigned int distorm_version(); +unsigned int distorm_version(void); #endif /* DISTORM_STATIC */ diff --git a/NativeCore/Dependencies/distorm/include/mnemonics.h b/NativeCore/Dependencies/distorm/include/mnemonics.h index ef9889c8..3f982705 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-2016 Gil Dabah +Copyright (C) 2003-2021 Gil Dabah This library is licensed under the BSD license. See the file COPYING. */ @@ -41,246 +41,246 @@ 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_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_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 - } _InstructionType; + 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 = 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 { R_RAX, R_RCX, R_RDX, R_RBX, R_RSP, R_RBP, R_RSI, R_RDI, R_R8, R_R9, R_R10, R_R11, R_R12, R_R13, R_R14, R_R15, diff --git a/NativeCore/Dependencies/distorm/src/config.h b/NativeCore/Dependencies/distorm/src/config.h index 164536f2..6febad67 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-2016 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__ 0x030304 +#define __DISTORMV__ 0x030503 #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__ */ @@ -128,34 +129,45 @@ This library is licensed under the BSD license. See the file COPYING. /* Define stream read functions for big endian systems. */ #ifdef BE_SYSTEM + +/* Avoid defining 'static static' for GCC. */ +#ifndef __GNUC__ +#define STATIC_INLINE static _INLINE_ +#else +#define STATIC_INLINE static +#endif + /* - * These functions can read from the stream safely! + * Assumption: These functions can read from the stream safely! * Swap endianity of input to little endian. */ -static _INLINE_ int16_t RSHORT(const uint8_t *s) +STATIC_INLINE int16_t RSHORT(const uint8_t *s) { return s[0] | (s[1] << 8); } -static _INLINE_ uint16_t RUSHORT(const uint8_t *s) +STATIC_INLINE uint16_t RUSHORT(const uint8_t *s) { return s[0] | (s[1] << 8); } -static _INLINE_ int32_t RLONG(const uint8_t *s) +STATIC_INLINE int32_t RLONG(const uint8_t *s) { return s[0] | (s[1] << 8) | (s[2] << 16) | (s[3] << 24); } -static _INLINE_ uint32_t RULONG(const uint8_t *s) +STATIC_INLINE uint32_t RULONG(const uint8_t *s) { return s[0] | (s[1] << 8) | (s[2] << 16) | (s[3] << 24); } -static _INLINE_ int64_t RLLONG(const uint8_t *s) +STATIC_INLINE int64_t RLLONG(const uint8_t *s) { return s[0] | (s[1] << 8) | (s[2] << 16) | (s[3] << 24) | ((uint64_t)s[4] << 32) | ((uint64_t)s[5] << 40) | ((uint64_t)s[6] << 48) | ((uint64_t)s[7] << 56); } -static _INLINE_ uint64_t RULLONG(const uint8_t *s) +STATIC_INLINE uint64_t RULLONG(const uint8_t *s) { return s[0] | (s[1] << 8) | (s[2] << 16) | (s[3] << 24) | ((uint64_t)s[4] << 32) | ((uint64_t)s[5] << 40) | ((uint64_t)s[6] << 48) | ((uint64_t)s[7] << 56); } + +#undef STATIC_INLINE + #else /* Little endian macro's will just make the cast. */ #define RSHORT(x) *(int16_t *)x diff --git a/NativeCore/Dependencies/distorm/src/decoder.c b/NativeCore/Dependencies/distorm/src/decoder.c index b76f7105..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-2016 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 351b38a1..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-2016 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,30 +392,28 @@ 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; } #endif /* DISTORM_LIGHT */ -_DLLEXPORT_ unsigned int distorm_version() +_DLLEXPORT_ unsigned int distorm_version(void) { return __DISTORMV__; } diff --git a/NativeCore/Dependencies/distorm/src/instructions.c b/NativeCore/Dependencies/distorm/src/instructions.c index 0f120de6..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-2016 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 b8d8a64a..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-2016 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 a081a2d4..688558c1 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-2016 Gil Dabah +Copyright (C) 2003-2021 Gil Dabah This library is licensed under the BSD license. See the file COPYING. */ @@ -15,118 +15,118 @@ This library is licensed under the BSD license. See the file COPYING. /* -* GENERATED BY disOps at Sun Jul 09 21:22:14 2017 -*/ + * GENERATED BY disOps at Fri Dec 17 10:22:38 2021 + */ -_InstInfo II_MOVSXD = /*II*/{ 0x1d3, 10027 }; -_InstInfo II_NOP = /*II*/{ 0x53, 581 }; -_InstInfo II_PAUSE = /*II*/{ 0x88, 10035 }; -_InstInfo II_WAIT = /*II*/{ 0x53, 10042 }; -_InstInfo II_RDRAND = /*II*/{ 0x1d4, 10048 }; -_InstInfo II_3DNOW = /*II*/{ 0x1d5, 10056 }; +_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, - 0x80000000, - 0x800400, - 0x80800400, - 0x800080, - 0x800100, - 0x80800100, - 0x800200, - 0x80800200, - 0x800000, - 0x1, - 0x0, - 0x80800000, - 0x1000000, - 0x81000000, - 0x808000, - 0x800001, - 0x80020001, - 0x1002000, - 0x60, - 0x64, - 0x80000001, - 0x4010000, - 0x1008000, - 0x80000060, - 0x83000064, - 0x3000064, - 0x83000000, - 0x3008000, - 0x200, - 0xc000, - 0x4014000, - 0x8, - 0x81000009, - 0x9, - 0x80000009, - 0x1000808, - 0x81000808, - 0x80020009, - 0x1001008, - 0x81001008, - 0x80000019, - 0x3000009, - 0x83000009, - 0x83000008, - 0xc0000011, - 0x40000001, - 0xc0800011, - 0x40800001, - 0xc0000019, - 0xc1000001, - 0xc0000001, - 0xc0000003, - 0x41000000, - 0x40000000, - 0x40000008, - 0x40000009, - 0x41000001, - 0x43000001, - 0x40000003, - 0x48000000, - 0x200009, - 0x20000009, - 0x60020009, - 0x60000009, - 0x80090009, - 0x200b0009, - 0x20020009, - 0x80100009, - 0x21100009, - 0x87000009, - 0x20009, - 0x20000008, - 0x1000009, - 0x10020009, - 0x160009, - 0x100009, - 0x47000009, - 0x47090009, - 0x40090009, - 0x80002009, - 0xc0000009, - 0x2001, - 0x80002001, - 0x410009, - 0x20420009, - 0x20060009, - 0x120009, - 0x21020009, - 0xc7000019, - 0x20100009, - 0xc0002009, - 0x40002008, - 0xc0000000, - 0xc0002008, - 0x4020009, - 0x40100009, - 0x60120009, - 0x41000009, - 0x83000001, - 0x200001 +0x80000011, +0x80000000, +0x800400, +0x80800400, +0x800080, +0x800100, +0x80800100, +0x800200, +0x80800200, +0x800000, +0x1, +0x0, +0x80800000, +0x1000000, +0x81000000, +0x808000, +0x800001, +0x80020001, +0x1002000, +0x60, +0x64, +0x80000001, +0x4010000, +0x1008000, +0x80000060, +0x83000064, +0x3000064, +0x83000000, +0x3008000, +0x200, +0xc000, +0x4014000, +0x8, +0x81000009, +0x80000009, +0x1000808, +0x81000808, +0x80020009, +0x1001008, +0x81001008, +0x80000019, +0x3000009, +0x83000009, +0x83000008, +0xc0000011, +0x40000001, +0xc0800011, +0x40800001, +0xc0000019, +0xc1000001, +0xc0000001, +0xc0000003, +0x41000000, +0x40000000, +0x40000008, +0x40000009, +0x41000001, +0x43000001, +0x40000003, +0x48000000, +0x200009, +0x20000009, +0x60020009, +0x60000009, +0x80090009, +0x200b0009, +0x20020009, +0x9, +0x80100009, +0x21100009, +0x87000009, +0x20009, +0x20000008, +0x1000009, +0x10020009, +0x160009, +0x100009, +0x47000009, +0x47090009, +0x40090009, +0x80002009, +0xc0000009, +0x2001, +0x80002001, +0x410009, +0x20420009, +0x20060009, +0x120009, +0x21020009, +0xc7000019, +0x20100009, +0xc0002009, +0x40002008, +0xc0000000, +0xc0002008, +0x4020009, +0x40100009, +0x60120009, +0x41000009, +0x83000001, +0x200001 }; _InstNode Table_0F = 256; @@ -134,7806 +134,7812 @@ _InstNode Table_0F_0F = 1440; _InstNode Table_0F_38 = 1896; _InstNode Table_0F_3A = 2152; -_InstInfo InstInfos[1246] = { - /*II_00*/{ 0x0, 11 }, - /*II_01*/{ 0x1, 11 }, - /*II_02*/{ 0x2, 11 }, - /*II_03*/{ 0x3, 11 }, - /*II_04*/{ 0x4, 11 }, - /*II_05*/{ 0x5, 11 }, - /*II_06*/{ 0x6, 16 }, - /*II_07*/{ 0x7, 22 }, - /*II_08*/{ 0x8, 27 }, - /*II_09*/{ 0x9, 27 }, - /*II_0A*/{ 0xa, 27 }, - /*II_0B*/{ 0xb, 27 }, - /*II_0C*/{ 0xc, 27 }, - /*II_0D*/{ 0xd, 27 }, - /*II_0E*/{ 0xe, 16 }, - /*II_10*/{ 0xf, 31 }, - /*II_11*/{ 0x10, 31 }, - /*II_12*/{ 0x11, 31 }, - /*II_13*/{ 0x12, 31 }, - /*II_14*/{ 0x13, 31 }, - /*II_15*/{ 0x14, 31 }, - /*II_16*/{ 0x15, 16 }, - /*II_17*/{ 0x16, 22 }, - /*II_18*/{ 0xf, 36 }, - /*II_19*/{ 0x10, 36 }, - /*II_1A*/{ 0x11, 36 }, - /*II_1B*/{ 0x12, 36 }, - /*II_1C*/{ 0x13, 36 }, - /*II_1D*/{ 0x14, 36 }, - /*II_1E*/{ 0x17, 16 }, - /*II_1F*/{ 0x18, 22 }, - /*II_20*/{ 0x19, 41 }, - /*II_21*/{ 0x1a, 41 }, - /*II_22*/{ 0x1b, 41 }, - /*II_23*/{ 0x1c, 41 }, - /*II_24*/{ 0x1d, 41 }, - /*II_25*/{ 0x1e, 41 }, - /*II_27*/{ 0x1f, 46 }, - /*II_28*/{ 0x0, 51 }, - /*II_29*/{ 0x1, 51 }, - /*II_2A*/{ 0x2, 51 }, - /*II_2B*/{ 0x3, 51 }, - /*II_2C*/{ 0x4, 51 }, - /*II_2D*/{ 0x5, 51 }, - /*II_2F*/{ 0x1f, 56 }, - /*II_30*/{ 0x20, 61 }, - /*II_31*/{ 0x21, 61 }, - /*II_32*/{ 0x22, 61 }, - /*II_33*/{ 0x23, 61 }, - /*II_34*/{ 0x24, 61 }, - /*II_35*/{ 0x25, 61 }, - /*II_37*/{ 0x26, 66 }, - /*II_38*/{ 0x27, 71 }, - /*II_39*/{ 0x28, 71 }, - /*II_3A*/{ 0x29, 71 }, - /*II_3B*/{ 0x2a, 71 }, - /*II_3C*/{ 0x2b, 71 }, - /*II_3D*/{ 0x2c, 71 }, - /*II_3F*/{ 0x26, 76 }, - /*II_40*/{ 0x2d, 81 }, - /*II_40*/{ 0x2d, 81 }, - /*II_40*/{ 0x2d, 81 }, - /*II_40*/{ 0x2d, 81 }, - /*II_40*/{ 0x2d, 81 }, - /*II_40*/{ 0x2d, 81 }, - /*II_40*/{ 0x2d, 81 }, - /*II_40*/{ 0x2d, 81 }, - /*II_48*/{ 0x2d, 86 }, - /*II_48*/{ 0x2d, 86 }, - /*II_48*/{ 0x2d, 86 }, - /*II_48*/{ 0x2d, 86 }, - /*II_48*/{ 0x2d, 86 }, - /*II_48*/{ 0x2d, 86 }, - /*II_48*/{ 0x2d, 86 }, - /*II_48*/{ 0x2d, 86 }, - /*II_50*/{ 0x2e, 16 }, - /*II_50*/{ 0x2e, 16 }, - /*II_50*/{ 0x2e, 16 }, - /*II_50*/{ 0x2e, 16 }, - /*II_50*/{ 0x2e, 16 }, - /*II_50*/{ 0x2e, 16 }, - /*II_50*/{ 0x2e, 16 }, - /*II_50*/{ 0x2e, 16 }, - /*II_58*/{ 0x2f, 22 }, - /*II_58*/{ 0x2f, 22 }, - /*II_58*/{ 0x2f, 22 }, - /*II_58*/{ 0x2f, 22 }, - /*II_58*/{ 0x2f, 22 }, - /*II_58*/{ 0x2f, 22 }, - /*II_58*/{ 0x2f, 22 }, - /*II_58*/{ 0x2f, 22 }, - /*II_60*/{ 0x30, 91 }, - /*II_61*/{ 0x30, 98 }, - /*II_62*/{ 0x31, 104 }, - /*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_70*/{ 0x3a, 134 }, - /*II_71*/{ 0x3a, 138 }, - /*II_72*/{ 0x3b, 143 }, - /*II_73*/{ 0x3b, 147 }, - /*II_74*/{ 0x3c, 152 }, - /*II_75*/{ 0x3c, 156 }, - /*II_76*/{ 0x3d, 161 }, - /*II_77*/{ 0x3d, 166 }, - /*II_78*/{ 0x3e, 170 }, - /*II_79*/{ 0x3e, 174 }, - /*II_7A*/{ 0x3f, 179 }, - /*II_7B*/{ 0x3f, 183 }, - /*II_7C*/{ 0x40, 188 }, - /*II_7D*/{ 0x40, 192 }, - /*II_7E*/{ 0x41, 197 }, - /*II_7F*/{ 0x41, 202 }, - /*II_84*/{ 0x42, 206 }, - /*II_85*/{ 0x43, 206 }, - /*II_86*/{ 0x44, 212 }, - /*II_87*/{ 0x45, 212 }, - /*II_88*/{ 0x46, 218 }, - /*II_89*/{ 0x47, 218 }, - /*II_8A*/{ 0x48, 218 }, - /*II_8B*/{ 0x49, 218 }, - /*II_8C*/{ 0x4a, 218 }, - /*II_8D*/{ 0x4b, 223 }, - /*II_8E*/{ 0x4c, 218 }, - /*II_90*/{ 0x4d, 212 }, - /*II_91*/{ 0x4d, 212 }, - /*II_92*/{ 0x4d, 212 }, - /*II_93*/{ 0x4d, 212 }, - /*II_94*/{ 0x4d, 212 }, - /*II_95*/{ 0x4d, 212 }, - /*II_96*/{ 0x4d, 212 }, - /*II_97*/{ 0x4d, 212 }, - /*II_9A*/{ 0x4f, 260 }, - /*II_9C*/{ 0x50, 270 }, - /*II_9D*/{ 0x51, 277 }, - /*II_9E*/{ 0x52, 283 }, - /*II_9F*/{ 0x53, 289 }, - /*II_A0*/{ 0x54, 218 }, - /*II_A1*/{ 0x55, 218 }, - /*II_A2*/{ 0x56, 218 }, - /*II_A3*/{ 0x57, 218 }, - /*II_A4*/{ 0x58, 295 }, - /*II_A5*/{ 0x59, 295 }, - /*II_A6*/{ 0x5a, 301 }, - /*II_A7*/{ 0x5b, 301 }, - /*II_A8*/{ 0x5c, 206 }, - /*II_A9*/{ 0x5d, 206 }, - /*II_AA*/{ 0x5e, 307 }, - /*II_AB*/{ 0x5f, 307 }, - /*II_AC*/{ 0x60, 313 }, - /*II_AD*/{ 0x61, 313 }, - /*II_AE*/{ 0x62, 319 }, - /*II_AF*/{ 0x63, 319 }, - /*II_B0*/{ 0x64, 218 }, - /*II_B0*/{ 0x64, 218 }, - /*II_B0*/{ 0x64, 218 }, - /*II_B0*/{ 0x64, 218 }, - /*II_B0*/{ 0x64, 218 }, - /*II_B0*/{ 0x64, 218 }, - /*II_B0*/{ 0x64, 218 }, - /*II_B0*/{ 0x64, 218 }, - /*II_B8*/{ 0x65, 218 }, - /*II_B8*/{ 0x65, 218 }, - /*II_B8*/{ 0x65, 218 }, - /*II_B8*/{ 0x65, 218 }, - /*II_B8*/{ 0x65, 218 }, - /*II_B8*/{ 0x65, 218 }, - /*II_B8*/{ 0x65, 218 }, - /*II_B8*/{ 0x65, 218 }, - /*II_C2*/{ 0x66, 325 }, - /*II_C3*/{ 0x67, 325 }, - /*II_C4*/{ 0x68, 330 }, - /*II_C5*/{ 0x68, 335 }, - /*II_C8*/{ 0x69, 340 }, - /*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, 33146 }, - /*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, 33215 }, - /*II_E5*/{ 0x78, 33215 }, - /*II_E6*/{ 0x79, 33219 }, - /*II_E7*/{ 0x7a, 33219 }, - /*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_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*/{ 0x116, 9944 }, - /*II_F3_0F_AE_02*/{ 0x1d0, 9953 }, - /*II_0F_AE_03*/{ 0x116, 9973 }, - /*II_F3_0F_AE_03*/{ 0x1d0, 9982 }, - /*II_0F_C7_06*/{ 0x1d2, 10002 }, - /*II_66_0F_C7_06*/{ 0x188, 10011 }, - /*II_F3_0F_C7_06*/{ 0x188, 10020 } +_InstInfo InstInfos[1248] = { + /*II_00*/ {0x0, 11}, + /*II_01*/ {0x1, 11}, + /*II_02*/ {0x2, 11}, + /*II_03*/ {0x3, 11}, + /*II_04*/ {0x4, 11}, + /*II_05*/ {0x5, 11}, + /*II_06*/ {0x6, 16}, + /*II_07*/ {0x7, 22}, + /*II_08*/ {0x8, 27}, + /*II_09*/ {0x9, 27}, + /*II_0A*/ {0xa, 27}, + /*II_0B*/ {0xb, 27}, + /*II_0C*/ {0xc, 27}, + /*II_0D*/ {0xd, 27}, + /*II_0E*/ {0xe, 16}, + /*II_10*/ {0xf, 31}, + /*II_11*/ {0x10, 31}, + /*II_12*/ {0x11, 31}, + /*II_13*/ {0x12, 31}, + /*II_14*/ {0x13, 31}, + /*II_15*/ {0x14, 31}, + /*II_16*/ {0x15, 16}, + /*II_17*/ {0x16, 22}, + /*II_18*/ {0xf, 36}, + /*II_19*/ {0x10, 36}, + /*II_1A*/ {0x11, 36}, + /*II_1B*/ {0x12, 36}, + /*II_1C*/ {0x13, 36}, + /*II_1D*/ {0x14, 36}, + /*II_1E*/ {0x17, 16}, + /*II_1F*/ {0x18, 22}, + /*II_20*/ {0x19, 41}, + /*II_21*/ {0x1a, 41}, + /*II_22*/ {0x1b, 41}, + /*II_23*/ {0x1c, 41}, + /*II_24*/ {0x1d, 41}, + /*II_25*/ {0x1e, 41}, + /*II_27*/ {0x1f, 46}, + /*II_28*/ {0x0, 51}, + /*II_29*/ {0x1, 51}, + /*II_2A*/ {0x2, 51}, + /*II_2B*/ {0x3, 51}, + /*II_2C*/ {0x4, 51}, + /*II_2D*/ {0x5, 51}, + /*II_2F*/ {0x1f, 56}, + /*II_30*/ {0x20, 61}, + /*II_31*/ {0x21, 61}, + /*II_32*/ {0x22, 61}, + /*II_33*/ {0x23, 61}, + /*II_34*/ {0x24, 61}, + /*II_35*/ {0x25, 61}, + /*II_37*/ {0x26, 66}, + /*II_38*/ {0x27, 71}, + /*II_39*/ {0x28, 71}, + /*II_3A*/ {0x29, 71}, + /*II_3B*/ {0x2a, 71}, + /*II_3C*/ {0x2b, 71}, + /*II_3D*/ {0x2c, 71}, + /*II_3F*/ {0x26, 76}, + /*II_40*/ {0x2d, 81}, + /*II_40*/ {0x2d, 81}, + /*II_40*/ {0x2d, 81}, + /*II_40*/ {0x2d, 81}, + /*II_40*/ {0x2d, 81}, + /*II_40*/ {0x2d, 81}, + /*II_40*/ {0x2d, 81}, + /*II_40*/ {0x2d, 81}, + /*II_48*/ {0x2d, 86}, + /*II_48*/ {0x2d, 86}, + /*II_48*/ {0x2d, 86}, + /*II_48*/ {0x2d, 86}, + /*II_48*/ {0x2d, 86}, + /*II_48*/ {0x2d, 86}, + /*II_48*/ {0x2d, 86}, + /*II_48*/ {0x2d, 86}, + /*II_50*/ {0x2e, 16}, + /*II_50*/ {0x2e, 16}, + /*II_50*/ {0x2e, 16}, + /*II_50*/ {0x2e, 16}, + /*II_50*/ {0x2e, 16}, + /*II_50*/ {0x2e, 16}, + /*II_50*/ {0x2e, 16}, + /*II_50*/ {0x2e, 16}, + /*II_58*/ {0x2f, 22}, + /*II_58*/ {0x2f, 22}, + /*II_58*/ {0x2f, 22}, + /*II_58*/ {0x2f, 22}, + /*II_58*/ {0x2f, 22}, + /*II_58*/ {0x2f, 22}, + /*II_58*/ {0x2f, 22}, + /*II_58*/ {0x2f, 22}, + /*II_60*/ {0x30, 91}, + /*II_61*/ {0x30, 98}, + /*II_62*/ {0x31, 104}, + /*II_63*/ {0x32, 111}, + /*II_68*/ {0x33, 16}, + /*II_6A*/ {0x35, 16}, + /*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}, + /*II_73*/ {0x3b, 147}, + /*II_74*/ {0x3c, 152}, + /*II_75*/ {0x3c, 156}, + /*II_76*/ {0x3d, 161}, + /*II_77*/ {0x3d, 166}, + /*II_78*/ {0x3e, 170}, + /*II_79*/ {0x3e, 174}, + /*II_7A*/ {0x3f, 179}, + /*II_7B*/ {0x3f, 183}, + /*II_7C*/ {0x40, 188}, + /*II_7D*/ {0x40, 192}, + /*II_7E*/ {0x41, 197}, + /*II_7F*/ {0x41, 202}, + /*II_84*/ {0x42, 206}, + /*II_85*/ {0x43, 206}, + /*II_86*/ {0x44, 212}, + /*II_87*/ {0x45, 212}, + /*II_88*/ {0x46, 218}, + /*II_89*/ {0x47, 218}, + /*II_8A*/ {0x48, 218}, + /*II_8B*/ {0x49, 218}, + /*II_8C*/ {0x4a, 218}, + /*II_8D*/ {0x4b, 223}, + /*II_8E*/ {0x4c, 218}, + /*II_90*/ {0x4d, 212}, + /*II_91*/ {0x4d, 212}, + /*II_92*/ {0x4d, 212}, + /*II_93*/ {0x4d, 212}, + /*II_94*/ {0x4d, 212}, + /*II_95*/ {0x4d, 212}, + /*II_96*/ {0x4d, 212}, + /*II_97*/ {0x4d, 212}, + /*II_9A*/ {0x4f, 260}, + /*II_9C*/ {0x50, 270}, + /*II_9D*/ {0x51, 277}, + /*II_9E*/ {0x52, 283}, + /*II_9F*/ {0x53, 289}, + /*II_A0*/ {0x54, 218}, + /*II_A1*/ {0x55, 218}, + /*II_A2*/ {0x56, 218}, + /*II_A3*/ {0x57, 218}, + /*II_A4*/ {0x58, 295}, + /*II_A5*/ {0x59, 295}, + /*II_A6*/ {0x5a, 301}, + /*II_A7*/ {0x5b, 301}, + /*II_A8*/ {0x5c, 206}, + /*II_A9*/ {0x5d, 206}, + /*II_AA*/ {0x5e, 307}, + /*II_AB*/ {0x5f, 307}, + /*II_AC*/ {0x60, 313}, + /*II_AD*/ {0x61, 313}, + /*II_AE*/ {0x62, 319}, + /*II_AF*/ {0x63, 319}, + /*II_B0*/ {0x64, 218}, + /*II_B0*/ {0x64, 218}, + /*II_B0*/ {0x64, 218}, + /*II_B0*/ {0x64, 218}, + /*II_B0*/ {0x64, 218}, + /*II_B0*/ {0x64, 218}, + /*II_B0*/ {0x64, 218}, + /*II_B0*/ {0x64, 218}, + /*II_B8*/ {0x65, 218}, + /*II_B8*/ {0x65, 218}, + /*II_B8*/ {0x65, 218}, + /*II_B8*/ {0x65, 218}, + /*II_B8*/ {0x65, 218}, + /*II_B8*/ {0x65, 218}, + /*II_B8*/ {0x65, 218}, + /*II_B8*/ {0x65, 218}, + /*II_C2*/ {0x66, 325}, + /*II_C3*/ {0x67, 325}, + /*II_C4*/ {0x68, 330}, + /*II_C5*/ {0x68, 335}, + /*II_C8*/ {0x69, 340}, + /*II_C9*/ {0x6a, 347}, + /*II_CA*/ {0x6b, 354}, + /*II_CB*/ {0x6c, 354}, + /*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, 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}, + /*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, 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, 864}, + /*II_0F_A3*/ {0xac, 871}, + /*II_0F_A8*/ {0xae, 16}, + /*II_0F_A9*/ {0xaf, 22}, + /*II_0F_AA*/ {0xb0, 881}, + /*II_0F_AB*/ {0xb1, 886}, + /*II_0F_AF*/ {0xb2, 117}, + /*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}, + /*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, 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, 1006}, + /*II_C7_00*/ {0xdb, 218}, + /*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, 1630}, + /*II_F6_03*/ {0x101, 1635}, + /*II_F6_04*/ {0x102, 1640}, + /*II_F6_05*/ {0x102, 117}, + /*II_F6_06*/ {0x103, 1645}, + /*II_F6_07*/ {0x103, 1650}, + /*II_F7_00*/ {0x104, 206}, + /*II_F7_02*/ {0x105, 1630}, + /*II_F7_03*/ {0x106, 1635}, + /*II_F7_04*/ {0x107, 1640}, + /*II_F7_05*/ {0x107, 117}, + /*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, 455}, + /*II_FF_03*/ {0x10c, 260}, + /*II_FF_04*/ {0x10d, 461}, + /*II_FF_05*/ {0x10e, 466}, + /*II_FF_06*/ {0x10f, 16}, + /*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] = { - /*II_69*/{ { 0x34, 117 }, 0x0, 3, 0, 0, 0 }, - /*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*/{ { 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*/{ { 0x1d1, 9963 }, 0x40, 0, 0, 0, 0 }, - /*II_V_0F_AE_03*/{ { 0x1d1, 9992 }, 0x40, 0, 0, 0, 0 } + /*II_69*/ {{0x34, 117}, 0x0, 3, 0, 0, 0}, + /*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*/ {{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] = { - /* 0 - _00 */ 0x2000, - /* 1 - _01 */ 0x2001, - /* 2 - _02 */ 0x2002, - /* 3 - _03 */ 0x2003, - /* 4 - _04 */ 0x2004, - /* 5 - _05 */ 0x2005, - /* 6 - _06 */ 0x2006, - /* 7 - _07 */ 0x2007, - /* 8 - _08 */ 0x2008, - /* 9 - _09 */ 0x2009, - /* a - _0A */ 0x200a, - /* b - _0B */ 0x200b, - /* c - _0C */ 0x200c, - /* d - _0D */ 0x200d, - /* e - _0E */ 0x200e, - /* f - _0F */ 0x8100, - /* 10 - _10 */ 0x200f, - /* 11 - _11 */ 0x2010, - /* 12 - _12 */ 0x2011, - /* 13 - _13 */ 0x2012, - /* 14 - _14 */ 0x2013, - /* 15 - _15 */ 0x2014, - /* 16 - _16 */ 0x2015, - /* 17 - _17 */ 0x2016, - /* 18 - _18 */ 0x2017, - /* 19 - _19 */ 0x2018, - /* 1a - _1A */ 0x2019, - /* 1b - _1B */ 0x201a, - /* 1c - _1C */ 0x201b, - /* 1d - _1D */ 0x201c, - /* 1e - _1E */ 0x201d, - /* 1f - _1F */ 0x201e, - /* 20 - _20 */ 0x201f, - /* 21 - _21 */ 0x2020, - /* 22 - _22 */ 0x2021, - /* 23 - _23 */ 0x2022, - /* 24 - _24 */ 0x2023, - /* 25 - _25 */ 0x2024, - /* 26 - */ 0, - /* 27 - _27 */ 0x2025, - /* 28 - _28 */ 0x2026, - /* 29 - _29 */ 0x2027, - /* 2a - _2A */ 0x2028, - /* 2b - _2B */ 0x2029, - /* 2c - _2C */ 0x202a, - /* 2d - _2D */ 0x202b, - /* 2e - */ 0, - /* 2f - _2F */ 0x202c, - /* 30 - _30 */ 0x202d, - /* 31 - _31 */ 0x202e, - /* 32 - _32 */ 0x202f, - /* 33 - _33 */ 0x2030, - /* 34 - _34 */ 0x2031, - /* 35 - _35 */ 0x2032, - /* 36 - */ 0, - /* 37 - _37 */ 0x2033, - /* 38 - _38 */ 0x2034, - /* 39 - _39 */ 0x2035, - /* 3a - _3A */ 0x2036, - /* 3b - _3B */ 0x2037, - /* 3c - _3C */ 0x2038, - /* 3d - _3D */ 0x2039, - /* 3e - */ 0, - /* 3f - _3F */ 0x203a, - /* 40 - _40 */ 0x203b, - /* 41 - _40 */ 0x203c, - /* 42 - _40 */ 0x203d, - /* 43 - _40 */ 0x203e, - /* 44 - _40 */ 0x203f, - /* 45 - _40 */ 0x2040, - /* 46 - _40 */ 0x2041, - /* 47 - _40 */ 0x2042, - /* 48 - _48 */ 0x2043, - /* 49 - _48 */ 0x2044, - /* 4a - _48 */ 0x2045, - /* 4b - _48 */ 0x2046, - /* 4c - _48 */ 0x2047, - /* 4d - _48 */ 0x2048, - /* 4e - _48 */ 0x2049, - /* 4f - _48 */ 0x204a, - /* 50 - _50 */ 0x204b, - /* 51 - _50 */ 0x204c, - /* 52 - _50 */ 0x204d, - /* 53 - _50 */ 0x204e, - /* 54 - _50 */ 0x204f, - /* 55 - _50 */ 0x2050, - /* 56 - _50 */ 0x2051, - /* 57 - _50 */ 0x2052, - /* 58 - _58 */ 0x2053, - /* 59 - _58 */ 0x2054, - /* 5a - _58 */ 0x2055, - /* 5b - _58 */ 0x2056, - /* 5c - _58 */ 0x2057, - /* 5d - _58 */ 0x2058, - /* 5e - _58 */ 0x2059, - /* 5f - _58 */ 0x205a, - /* 60 - _60 */ 0x205b, - /* 61 - _61 */ 0x205c, - /* 62 - _62 */ 0x205d, - /* 63 - _63 */ 0x205e, - /* 64 - */ 0, - /* 65 - */ 0, - /* 66 - */ 0, - /* 67 - */ 0, - /* 68 - _68 */ 0x205f, - /* 69 - _69 */ 0x4000, - /* 6a - _6A */ 0x2060, - /* 6b - _6B */ 0x4001, - /* 6c - _6C */ 0x2061, - /* 6d - _6D */ 0x2062, - /* 6e - _6E */ 0x2063, - /* 6f - _6F */ 0x2064, - /* 70 - _70 */ 0x2065, - /* 71 - _71 */ 0x2066, - /* 72 - _72 */ 0x2067, - /* 73 - _73 */ 0x2068, - /* 74 - _74 */ 0x2069, - /* 75 - _75 */ 0x206a, - /* 76 - _76 */ 0x206b, - /* 77 - _77 */ 0x206c, - /* 78 - _78 */ 0x206d, - /* 79 - _79 */ 0x206e, - /* 7a - _7A */ 0x206f, - /* 7b - _7B */ 0x2070, - /* 7c - _7C */ 0x2071, - /* 7d - _7D */ 0x2072, - /* 7e - _7E */ 0x2073, - /* 7f - _7F */ 0x2074, - /* 80 - _80 */ 0x6200, - /* 81 - _81 */ 0x6208, - /* 82 - _82 */ 0x6210, - /* 83 - _83 */ 0x6218, - /* 84 - _84 */ 0x2075, - /* 85 - _85 */ 0x2076, - /* 86 - _86 */ 0x2077, - /* 87 - _87 */ 0x2078, - /* 88 - _88 */ 0x2079, - /* 89 - _89 */ 0x207a, - /* 8a - _8A */ 0x207b, - /* 8b - _8B */ 0x207c, - /* 8c - _8C */ 0x207d, - /* 8d - _8D */ 0x207e, - /* 8e - _8E */ 0x207f, - /* 8f - _8F */ 0x6220, - /* 90 - _90 */ 0x2080, - /* 91 - _91 */ 0x2081, - /* 92 - _92 */ 0x2082, - /* 93 - _93 */ 0x2083, - /* 94 - _94 */ 0x2084, - /* 95 - _95 */ 0x2085, - /* 96 - _96 */ 0x2086, - /* 97 - _97 */ 0x2087, - /* 98 - _98 */ 0x4002, - /* 99 - _99 */ 0x4003, - /* 9a - _9A */ 0x2088, - /* 9b - */ 0, - /* 9c - _9C */ 0x2089, - /* 9d - _9D */ 0x208a, - /* 9e - _9E */ 0x208b, - /* 9f - _9F */ 0x208c, - /* a0 - _A0 */ 0x208d, - /* a1 - _A1 */ 0x208e, - /* a2 - _A2 */ 0x208f, - /* a3 - _A3 */ 0x2090, - /* a4 - _A4 */ 0x2091, - /* a5 - _A5 */ 0x2092, - /* a6 - _A6 */ 0x2093, - /* a7 - _A7 */ 0x2094, - /* a8 - _A8 */ 0x2095, - /* a9 - _A9 */ 0x2096, - /* aa - _AA */ 0x2097, - /* ab - _AB */ 0x2098, - /* ac - _AC */ 0x2099, - /* ad - _AD */ 0x209a, - /* ae - _AE */ 0x209b, - /* af - _AF */ 0x209c, - /* b0 - _B0 */ 0x209d, - /* b1 - _B0 */ 0x209e, - /* b2 - _B0 */ 0x209f, - /* b3 - _B0 */ 0x20a0, - /* b4 - _B0 */ 0x20a1, - /* b5 - _B0 */ 0x20a2, - /* b6 - _B0 */ 0x20a3, - /* b7 - _B0 */ 0x20a4, - /* b8 - _B8 */ 0x20a5, - /* b9 - _B8 */ 0x20a6, - /* ba - _B8 */ 0x20a7, - /* bb - _B8 */ 0x20a8, - /* bc - _B8 */ 0x20a9, - /* bd - _B8 */ 0x20aa, - /* be - _B8 */ 0x20ab, - /* bf - _B8 */ 0x20ac, - /* c0 - _C0 */ 0x6228, - /* c1 - _C1 */ 0x6230, - /* c2 - _C2 */ 0x20ad, - /* c3 - _C3 */ 0x20ae, - /* c4 - _C4 */ 0x20af, - /* c5 - _C5 */ 0x20b0, - /* c6 - _C6 */ 0xa238, - /* c7 - _C7 */ 0xa280, - /* c8 - _C8 */ 0x20b1, - /* c9 - _C9 */ 0x20b2, - /* ca - _CA */ 0x20b3, - /* cb - _CB */ 0x20b4, - /* cc - _CC */ 0x20b5, - /* cd - _CD */ 0x20b6, - /* ce - _CE */ 0x20b7, - /* cf - _CF */ 0x20b8, - /* d0 - _D0 */ 0x62c8, - /* d1 - _D1 */ 0x62d0, - /* d2 - _D2 */ 0x62d8, - /* d3 - _D3 */ 0x62e0, - /* 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, - /* e0 - _E0 */ 0x20bd, - /* e1 - _E1 */ 0x20be, - /* e2 - _E2 */ 0x20bf, - /* e3 - _E3 */ 0x4004, - /* e4 - _E4 */ 0x20c0, - /* e5 - _E5 */ 0x20c1, - /* e6 - _E6 */ 0x20c2, - /* e7 - _E7 */ 0x20c3, - /* e8 - _E8 */ 0x20c4, - /* e9 - _E9 */ 0x20c5, - /* ea - _EA */ 0x20c6, - /* eb - _EB */ 0x20c7, - /* ec - _EC */ 0x20c8, - /* ed - _ED */ 0x20c9, - /* ee - _EE */ 0x20ca, - /* ef - _EF */ 0x20cb, - /* f0 - */ 0, - /* f1 - _F1 */ 0x20cc, - /* f2 - */ 0, - /* f3 - */ 0, - /* f4 - _F4 */ 0x20cd, - /* f5 - _F5 */ 0x20ce, - /* f6 - _F6 */ 0x6528, - /* f7 - _F7 */ 0x6530, - /* 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, - /* 102 - _0F_02 */ 0x20d5, - /* 103 - _0F_03 */ 0x20d6, - /* 104 - */ 0, - /* 105 - _0F_05 */ 0x20d7, - /* 106 - _0F_06 */ 0x20d8, - /* 107 - _0F_07 */ 0x20d9, - /* 108 - _0F_08 */ 0x20da, - /* 109 - _0F_09 */ 0x20db, - /* 10a - */ 0, - /* 10b - _0F_0B */ 0x20dc, - /* 10c - */ 0, - /* 10d - _0F_0D */ 0x6598, - /* 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, - /* 119 - */ 0, - /* 11a - */ 0, - /* 11b - */ 0, - /* 11c - */ 0, - /* 11d - */ 0, - /* 11e - */ 0, - /* 11f - _0F_1F */ 0x20de, - /* 120 - _0F_20 */ 0x20df, - /* 121 - _0F_21 */ 0x20e0, - /* 122 - _0F_22 */ 0x20e1, - /* 123 - _0F_23 */ 0x20e2, - /* 124 - */ 0, - /* 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, - /* 130 - _0F_30 */ 0x20e3, - /* 131 - _0F_31 */ 0x20e4, - /* 132 - _0F_32 */ 0x20e5, - /* 133 - _0F_33 */ 0x20e6, - /* 134 - _0F_34 */ 0x20e7, - /* 135 - _0F_35 */ 0x20e8, - /* 136 - */ 0, - /* 137 - _0F_37 */ 0x20e9, - /* 138 - _0F_38 */ 0x8768, - /* 139 - */ 0, - /* 13a - _0F_3A */ 0x8868, - /* 13b - */ 0, - /* 13c - */ 0, - /* 13d - */ 0, - /* 13e - */ 0, - /* 13f - */ 0, - /* 140 - _0F_40 */ 0x20ea, - /* 141 - _0F_41 */ 0x20eb, - /* 142 - _0F_42 */ 0x20ec, - /* 143 - _0F_43 */ 0x20ed, - /* 144 - _0F_44 */ 0x20ee, - /* 145 - _0F_45 */ 0x20ef, - /* 146 - _0F_46 */ 0x20f0, - /* 147 - _0F_47 */ 0x20f1, - /* 148 - _0F_48 */ 0x20f2, - /* 149 - _0F_49 */ 0x20f3, - /* 14a - _0F_4A */ 0x20f4, - /* 14b - _0F_4B */ 0x20f5, - /* 14c - _0F_4C */ 0x20f6, - /* 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, - /* 17b - */ 0, - /* 17c - _0F_7C */ 0xcc54, - /* 17d - _0F_7D */ 0xcc60, - /* 17e - _0F_7E */ 0xcc6c, - /* 17f - _0F_7F */ 0xcc78, - /* 180 - _0F_80 */ 0x20fa, - /* 181 - _0F_81 */ 0x20fb, - /* 182 - _0F_82 */ 0x20fc, - /* 183 - _0F_83 */ 0x20fd, - /* 184 - _0F_84 */ 0x20fe, - /* 185 - _0F_85 */ 0x20ff, - /* 186 - _0F_86 */ 0x2100, - /* 187 - _0F_87 */ 0x2101, - /* 188 - _0F_88 */ 0x2102, - /* 189 - _0F_89 */ 0x2103, - /* 18a - _0F_8A */ 0x2104, - /* 18b - _0F_8B */ 0x2105, - /* 18c - _0F_8C */ 0x2106, - /* 18d - _0F_8D */ 0x2107, - /* 18e - _0F_8E */ 0x2108, - /* 18f - _0F_8F */ 0x2109, - /* 190 - _0F_90 */ 0x210a, - /* 191 - _0F_91 */ 0x210b, - /* 192 - _0F_92 */ 0x210c, - /* 193 - _0F_93 */ 0x210d, - /* 194 - _0F_94 */ 0x210e, - /* 195 - _0F_95 */ 0x210f, - /* 196 - _0F_96 */ 0x2110, - /* 197 - _0F_97 */ 0x2111, - /* 198 - _0F_98 */ 0x2112, - /* 199 - _0F_99 */ 0x2113, - /* 19a - _0F_9A */ 0x2114, - /* 19b - _0F_9B */ 0x2115, - /* 19c - _0F_9C */ 0x2116, - /* 19d - _0F_9D */ 0x2117, - /* 19e - _0F_9E */ 0x2118, - /* 19f - _0F_9F */ 0x2119, - /* 1a0 - _0F_A0 */ 0x211a, - /* 1a1 - _0F_A1 */ 0x211b, - /* 1a2 - _0F_A2 */ 0x211c, - /* 1a3 - _0F_A3 */ 0x211d, - /* 1a4 - _0F_A4 */ 0x4005, - /* 1a5 - _0F_A5 */ 0x4006, - /* 1a6 - */ 0, - /* 1a7 - */ 0, - /* 1a8 - _0F_A8 */ 0x211e, - /* 1a9 - _0F_A9 */ 0x211f, - /* 1aa - _0F_AA */ 0x2120, - /* 1ab - _0F_AB */ 0x2121, - /* 1ac - _0F_AC */ 0x4007, - /* 1ad - _0F_AD */ 0x4008, - /* 1ae - _0F_AE */ 0x6c84, - /* 1af - _0F_AF */ 0x2122, - /* 1b0 - _0F_B0 */ 0x2123, - /* 1b1 - _0F_B1 */ 0x2124, - /* 1b2 - _0F_B2 */ 0x2125, - /* 1b3 - _0F_B3 */ 0x2126, - /* 1b4 - _0F_B4 */ 0x2127, - /* 1b5 - _0F_B5 */ 0x2128, - /* 1b6 - _0F_B6 */ 0x2129, - /* 1b7 - _0F_B7 */ 0x212a, - /* 1b8 - _0F_B8 */ 0xcc8c, - /* 1b9 - _0F_B9 */ 0x212b, - /* 1ba - _0F_BA */ 0x6c98, - /* 1bb - _0F_BB */ 0x212c, - /* 1bc - _0F_BC */ 0xcca0, - /* 1bd - _0F_BD */ 0xccac, - /* 1be - _0F_BE */ 0x212d, - /* 1bf - _0F_BF */ 0x212e, - /* 1c0 - _0F_C0 */ 0x212f, - /* 1c1 - _0F_C1 */ 0x2130, - /* 1c2 - _0F_C2 */ 0xccb8, - /* 1c3 - _0F_C3 */ 0x2131, - /* 1c4 - _0F_C4 */ 0xccc4, - /* 1c5 - _0F_C5 */ 0xccd0, - /* 1c6 - _0F_C6 */ 0xccdc, - /* 1c7 - _0F_C7 */ 0x6ce8, - /* 1c8 - _0F_C8 */ 0x2132, - /* 1c9 - _0F_C8 */ 0x2133, - /* 1ca - _0F_C8 */ 0x2134, - /* 1cb - _0F_C8 */ 0x2135, - /* 1cc - _0F_C8 */ 0x2136, - /* 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, - /* 1ff - */ 0, - /* 200 - _80_00 */ 0x213a, - /* 201 - _80_01 */ 0x213b, - /* 202 - _80_02 */ 0x213c, - /* 203 - _80_03 */ 0x213d, - /* 204 - _80_04 */ 0x213e, - /* 205 - _80_05 */ 0x213f, - /* 206 - _80_06 */ 0x2140, - /* 207 - _80_07 */ 0x2141, - /* 208 - _81_00 */ 0x2142, - /* 209 - _81_01 */ 0x2143, - /* 20a - _81_02 */ 0x2144, - /* 20b - _81_03 */ 0x2145, - /* 20c - _81_04 */ 0x2146, - /* 20d - _81_05 */ 0x2147, - /* 20e - _81_06 */ 0x2148, - /* 20f - _81_07 */ 0x2149, - /* 210 - _82_00 */ 0x214a, - /* 211 - _82_01 */ 0x214b, - /* 212 - _82_02 */ 0x214c, - /* 213 - _82_03 */ 0x214d, - /* 214 - _82_04 */ 0x214e, - /* 215 - _82_05 */ 0x214f, - /* 216 - _82_06 */ 0x2150, - /* 217 - _82_07 */ 0x2151, - /* 218 - _83_00 */ 0x2152, - /* 219 - _83_01 */ 0x2153, - /* 21a - _83_02 */ 0x2154, - /* 21b - _83_03 */ 0x2155, - /* 21c - _83_04 */ 0x2156, - /* 21d - _83_05 */ 0x2157, - /* 21e - _83_06 */ 0x2158, - /* 21f - _83_07 */ 0x2159, - /* 220 - _8F_00 */ 0x215a, - /* 221 - */ 0, - /* 222 - */ 0, - /* 223 - */ 0, - /* 224 - */ 0, - /* 225 - */ 0, - /* 226 - */ 0, - /* 227 - */ 0, - /* 228 - _C0_00 */ 0x215b, - /* 229 - _C0_01 */ 0x215c, - /* 22a - _C0_02 */ 0x215d, - /* 22b - _C0_03 */ 0x215e, - /* 22c - _C0_04 */ 0x215f, - /* 22d - _C0_05 */ 0x2160, - /* 22e - _C0_06 */ 0x2161, - /* 22f - _C0_07 */ 0x2162, - /* 230 - _C1_00 */ 0x2163, - /* 231 - _C1_01 */ 0x2164, - /* 232 - _C1_02 */ 0x2165, - /* 233 - _C1_03 */ 0x2166, - /* 234 - _C1_04 */ 0x2167, - /* 235 - _C1_05 */ 0x2168, - /* 236 - _C1_06 */ 0x2169, - /* 237 - _C1_07 */ 0x216a, - /* 238 - _C6_00 */ 0x216b, - /* 239 - */ 0, - /* 23a - */ 0, - /* 23b - */ 0, - /* 23c - */ 0, - /* 23d - */ 0, - /* 23e - */ 0, - /* 23f - */ 0, - /* 240 - */ 0, - /* 241 - */ 0, - /* 242 - */ 0, - /* 243 - */ 0, - /* 244 - */ 0, - /* 245 - */ 0, - /* 246 - */ 0, - /* 247 - */ 0, - /* 248 - */ 0, - /* 249 - */ 0, - /* 24a - */ 0, - /* 24b - */ 0, - /* 24c - */ 0, - /* 24d - */ 0, - /* 24e - */ 0, - /* 24f - */ 0, - /* 250 - */ 0, - /* 251 - */ 0, - /* 252 - */ 0, - /* 253 - */ 0, - /* 254 - */ 0, - /* 255 - */ 0, - /* 256 - */ 0, - /* 257 - */ 0, - /* 258 - */ 0, - /* 259 - */ 0, - /* 25a - */ 0, - /* 25b - */ 0, - /* 25c - */ 0, - /* 25d - */ 0, - /* 25e - */ 0, - /* 25f - */ 0, - /* 260 - */ 0, - /* 261 - */ 0, - /* 262 - */ 0, - /* 263 - */ 0, - /* 264 - */ 0, - /* 265 - */ 0, - /* 266 - */ 0, - /* 267 - */ 0, - /* 268 - */ 0, - /* 269 - */ 0, - /* 26a - */ 0, - /* 26b - */ 0, - /* 26c - */ 0, - /* 26d - */ 0, - /* 26e - */ 0, - /* 26f - */ 0, - /* 270 - */ 0, - /* 271 - */ 0, - /* 272 - */ 0, - /* 273 - */ 0, - /* 274 - */ 0, - /* 275 - */ 0, - /* 276 - */ 0, - /* 277 - */ 0, - /* 278 - _C6_F8 */ 0x216c, - /* 279 - */ 0, - /* 27a - */ 0, - /* 27b - */ 0, - /* 27c - */ 0, - /* 27d - */ 0, - /* 27e - */ 0, - /* 27f - */ 0, - /* 280 - _C7_00 */ 0x216d, - /* 281 - */ 0, - /* 282 - */ 0, - /* 283 - */ 0, - /* 284 - */ 0, - /* 285 - */ 0, - /* 286 - */ 0, - /* 287 - */ 0, - /* 288 - */ 0, - /* 289 - */ 0, - /* 28a - */ 0, - /* 28b - */ 0, - /* 28c - */ 0, - /* 28d - */ 0, - /* 28e - */ 0, - /* 28f - */ 0, - /* 290 - */ 0, - /* 291 - */ 0, - /* 292 - */ 0, - /* 293 - */ 0, - /* 294 - */ 0, - /* 295 - */ 0, - /* 296 - */ 0, - /* 297 - */ 0, - /* 298 - */ 0, - /* 299 - */ 0, - /* 29a - */ 0, - /* 29b - */ 0, - /* 29c - */ 0, - /* 29d - */ 0, - /* 29e - */ 0, - /* 29f - */ 0, - /* 2a0 - */ 0, - /* 2a1 - */ 0, - /* 2a2 - */ 0, - /* 2a3 - */ 0, - /* 2a4 - */ 0, - /* 2a5 - */ 0, - /* 2a6 - */ 0, - /* 2a7 - */ 0, - /* 2a8 - */ 0, - /* 2a9 - */ 0, - /* 2aa - */ 0, - /* 2ab - */ 0, - /* 2ac - */ 0, - /* 2ad - */ 0, - /* 2ae - */ 0, - /* 2af - */ 0, - /* 2b0 - */ 0, - /* 2b1 - */ 0, - /* 2b2 - */ 0, - /* 2b3 - */ 0, - /* 2b4 - */ 0, - /* 2b5 - */ 0, - /* 2b6 - */ 0, - /* 2b7 - */ 0, - /* 2b8 - */ 0, - /* 2b9 - */ 0, - /* 2ba - */ 0, - /* 2bb - */ 0, - /* 2bc - */ 0, - /* 2bd - */ 0, - /* 2be - */ 0, - /* 2bf - */ 0, - /* 2c0 - _C7_F8 */ 0x216e, - /* 2c1 - */ 0, - /* 2c2 - */ 0, - /* 2c3 - */ 0, - /* 2c4 - */ 0, - /* 2c5 - */ 0, - /* 2c6 - */ 0, - /* 2c7 - */ 0, - /* 2c8 - _D0_00 */ 0x216f, - /* 2c9 - _D0_01 */ 0x2170, - /* 2ca - _D0_02 */ 0x2171, - /* 2cb - _D0_03 */ 0x2172, - /* 2cc - _D0_04 */ 0x2173, - /* 2cd - _D0_05 */ 0x2174, - /* 2ce - _D0_06 */ 0x2175, - /* 2cf - _D0_07 */ 0x2176, - /* 2d0 - _D1_00 */ 0x2177, - /* 2d1 - _D1_01 */ 0x2178, - /* 2d2 - _D1_02 */ 0x2179, - /* 2d3 - _D1_03 */ 0x217a, - /* 2d4 - _D1_04 */ 0x217b, - /* 2d5 - _D1_05 */ 0x217c, - /* 2d6 - _D1_06 */ 0x217d, - /* 2d7 - _D1_07 */ 0x217e, - /* 2d8 - _D2_00 */ 0x217f, - /* 2d9 - _D2_01 */ 0x2180, - /* 2da - _D2_02 */ 0x2181, - /* 2db - _D2_03 */ 0x2182, - /* 2dc - _D2_04 */ 0x2183, - /* 2dd - _D2_05 */ 0x2184, - /* 2de - _D2_06 */ 0x2185, - /* 2df - _D2_07 */ 0x2186, - /* 2e0 - _D3_00 */ 0x2187, - /* 2e1 - _D3_01 */ 0x2188, - /* 2e2 - _D3_02 */ 0x2189, - /* 2e3 - _D3_03 */ 0x218a, - /* 2e4 - _D3_04 */ 0x218b, - /* 2e5 - _D3_05 */ 0x218c, - /* 2e6 - _D3_06 */ 0x218d, - /* 2e7 - _D3_07 */ 0x218e, - /* 2e8 - _D8_00 */ 0x218f, - /* 2e9 - _D8_01 */ 0x2190, - /* 2ea - _D8_02 */ 0x2191, - /* 2eb - _D8_03 */ 0x2192, - /* 2ec - _D8_04 */ 0x2193, - /* 2ed - _D8_05 */ 0x2194, - /* 2ee - _D8_06 */ 0x2195, - /* 2ef - _D8_07 */ 0x2196, - /* 2f0 - _D8_C0 */ 0x2197, - /* 2f1 - _D8_C0 */ 0x2198, - /* 2f2 - _D8_C0 */ 0x2199, - /* 2f3 - _D8_C0 */ 0x219a, - /* 2f4 - _D8_C0 */ 0x219b, - /* 2f5 - _D8_C0 */ 0x219c, - /* 2f6 - _D8_C0 */ 0x219d, - /* 2f7 - _D8_C0 */ 0x219e, - /* 2f8 - _D8_C8 */ 0x219f, - /* 2f9 - _D8_C8 */ 0x21a0, - /* 2fa - _D8_C8 */ 0x21a1, - /* 2fb - _D8_C8 */ 0x21a2, - /* 2fc - _D8_C8 */ 0x21a3, - /* 2fd - _D8_C8 */ 0x21a4, - /* 2fe - _D8_C8 */ 0x21a5, - /* 2ff - _D8_C8 */ 0x21a6, - /* 300 - _D8_D0 */ 0x21a7, - /* 301 - _D8_D0 */ 0x21a8, - /* 302 - _D8_D0 */ 0x21a9, - /* 303 - _D8_D0 */ 0x21aa, - /* 304 - _D8_D0 */ 0x21ab, - /* 305 - _D8_D0 */ 0x21ac, - /* 306 - _D8_D0 */ 0x21ad, - /* 307 - _D8_D0 */ 0x21ae, - /* 308 - _D8_D8 */ 0x21af, - /* 309 - _D8_D9 */ 0x21b0, - /* 30a - _D8_D8 */ 0x21b1, - /* 30b - _D8_D8 */ 0x21b2, - /* 30c - _D8_D8 */ 0x21b3, - /* 30d - _D8_D8 */ 0x21b4, - /* 30e - _D8_D8 */ 0x21b5, - /* 30f - _D8_D8 */ 0x21b6, - /* 310 - _D8_E0 */ 0x21b7, - /* 311 - _D8_E0 */ 0x21b8, - /* 312 - _D8_E0 */ 0x21b9, - /* 313 - _D8_E0 */ 0x21ba, - /* 314 - _D8_E0 */ 0x21bb, - /* 315 - _D8_E0 */ 0x21bc, - /* 316 - _D8_E0 */ 0x21bd, - /* 317 - _D8_E0 */ 0x21be, - /* 318 - _D8_E8 */ 0x21bf, - /* 319 - _D8_E8 */ 0x21c0, - /* 31a - _D8_E8 */ 0x21c1, - /* 31b - _D8_E8 */ 0x21c2, - /* 31c - _D8_E8 */ 0x21c3, - /* 31d - _D8_E8 */ 0x21c4, - /* 31e - _D8_E8 */ 0x21c5, - /* 31f - _D8_E8 */ 0x21c6, - /* 320 - _D8_F0 */ 0x21c7, - /* 321 - _D8_F0 */ 0x21c8, - /* 322 - _D8_F0 */ 0x21c9, - /* 323 - _D8_F0 */ 0x21ca, - /* 324 - _D8_F0 */ 0x21cb, - /* 325 - _D8_F0 */ 0x21cc, - /* 326 - _D8_F0 */ 0x21cd, - /* 327 - _D8_F0 */ 0x21ce, - /* 328 - _D8_F8 */ 0x21cf, - /* 329 - _D8_F8 */ 0x21d0, - /* 32a - _D8_F8 */ 0x21d1, - /* 32b - _D8_F8 */ 0x21d2, - /* 32c - _D8_F8 */ 0x21d3, - /* 32d - _D8_F8 */ 0x21d4, - /* 32e - _D8_F8 */ 0x21d5, - /* 32f - _D8_F8 */ 0x21d6, - /* 330 - _D9_00 */ 0x21d7, - /* 331 - */ 0, - /* 332 - _D9_02 */ 0x21d8, - /* 333 - _D9_03 */ 0x21d9, - /* 334 - _D9_04 */ 0x21da, - /* 335 - _D9_05 */ 0x21db, - /* 336 - _D9_06 */ 0xcf24, - /* 337 - _D9_07 */ 0xcf30, - /* 338 - _D9_C0 */ 0x21dc, - /* 339 - _D9_C0 */ 0x21dd, - /* 33a - _D9_C0 */ 0x21de, - /* 33b - _D9_C0 */ 0x21df, - /* 33c - _D9_C0 */ 0x21e0, - /* 33d - _D9_C0 */ 0x21e1, - /* 33e - _D9_C0 */ 0x21e2, - /* 33f - _D9_C0 */ 0x21e3, - /* 340 - _D9_C8 */ 0x21e4, - /* 341 - _D9_C9 */ 0x21e5, - /* 342 - _D9_C8 */ 0x21e6, - /* 343 - _D9_C8 */ 0x21e7, - /* 344 - _D9_C8 */ 0x21e8, - /* 345 - _D9_C8 */ 0x21e9, - /* 346 - _D9_C8 */ 0x21ea, - /* 347 - _D9_C8 */ 0x21eb, - /* 348 - _D9_D0 */ 0x21ec, - /* 349 - */ 0, - /* 34a - */ 0, - /* 34b - */ 0, - /* 34c - */ 0, - /* 34d - */ 0, - /* 34e - */ 0, - /* 34f - */ 0, - /* 350 - */ 0, - /* 351 - */ 0, - /* 352 - */ 0, - /* 353 - */ 0, - /* 354 - */ 0, - /* 355 - */ 0, - /* 356 - */ 0, - /* 357 - */ 0, - /* 358 - _D9_E0 */ 0x21ed, - /* 359 - _D9_E1 */ 0x21ee, - /* 35a - */ 0, - /* 35b - */ 0, - /* 35c - _D9_E4 */ 0x21ef, - /* 35d - _D9_E5 */ 0x21f0, - /* 35e - */ 0, - /* 35f - */ 0, - /* 360 - _D9_E8 */ 0x21f1, - /* 361 - _D9_E9 */ 0x21f2, - /* 362 - _D9_EA */ 0x21f3, - /* 363 - _D9_EB */ 0x21f4, - /* 364 - _D9_EC */ 0x21f5, - /* 365 - _D9_ED */ 0x21f6, - /* 366 - _D9_EE */ 0x21f7, - /* 367 - */ 0, - /* 368 - _D9_F0 */ 0x21f8, - /* 369 - _D9_F1 */ 0x21f9, - /* 36a - _D9_F2 */ 0x21fa, - /* 36b - _D9_F3 */ 0x21fb, - /* 36c - _D9_F4 */ 0x21fc, - /* 36d - _D9_F5 */ 0x21fd, - /* 36e - _D9_F6 */ 0x21fe, - /* 36f - _D9_F7 */ 0x21ff, - /* 370 - _D9_F8 */ 0x2200, - /* 371 - _D9_F9 */ 0x2201, - /* 372 - _D9_FA */ 0x2202, - /* 373 - _D9_FB */ 0x2203, - /* 374 - _D9_FC */ 0x2204, - /* 375 - _D9_FD */ 0x2205, - /* 376 - _D9_FE */ 0x2206, - /* 377 - _D9_FF */ 0x2207, - /* 378 - _DA_00 */ 0x2208, - /* 379 - _DA_01 */ 0x2209, - /* 37a - _DA_02 */ 0x220a, - /* 37b - _DA_03 */ 0x220b, - /* 37c - _DA_04 */ 0x220c, - /* 37d - _DA_05 */ 0x220d, - /* 37e - _DA_06 */ 0x220e, - /* 37f - _DA_07 */ 0x220f, - /* 380 - _DA_C0 */ 0x2210, - /* 381 - _DA_C0 */ 0x2211, - /* 382 - _DA_C0 */ 0x2212, - /* 383 - _DA_C0 */ 0x2213, - /* 384 - _DA_C0 */ 0x2214, - /* 385 - _DA_C0 */ 0x2215, - /* 386 - _DA_C0 */ 0x2216, - /* 387 - _DA_C0 */ 0x2217, - /* 388 - _DA_C8 */ 0x2218, - /* 389 - _DA_C8 */ 0x2219, - /* 38a - _DA_C8 */ 0x221a, - /* 38b - _DA_C8 */ 0x221b, - /* 38c - _DA_C8 */ 0x221c, - /* 38d - _DA_C8 */ 0x221d, - /* 38e - _DA_C8 */ 0x221e, - /* 38f - _DA_C8 */ 0x221f, - /* 390 - _DA_D0 */ 0x2220, - /* 391 - _DA_D0 */ 0x2221, - /* 392 - _DA_D0 */ 0x2222, - /* 393 - _DA_D0 */ 0x2223, - /* 394 - _DA_D0 */ 0x2224, - /* 395 - _DA_D0 */ 0x2225, - /* 396 - _DA_D0 */ 0x2226, - /* 397 - _DA_D0 */ 0x2227, - /* 398 - _DA_D8 */ 0x2228, - /* 399 - _DA_D8 */ 0x2229, - /* 39a - _DA_D8 */ 0x222a, - /* 39b - _DA_D8 */ 0x222b, - /* 39c - _DA_D8 */ 0x222c, - /* 39d - _DA_D8 */ 0x222d, - /* 39e - _DA_D8 */ 0x222e, - /* 39f - _DA_D8 */ 0x222f, - /* 3a0 - */ 0, - /* 3a1 - */ 0, - /* 3a2 - */ 0, - /* 3a3 - */ 0, - /* 3a4 - */ 0, - /* 3a5 - */ 0, - /* 3a6 - */ 0, - /* 3a7 - */ 0, - /* 3a8 - */ 0, - /* 3a9 - _DA_E9 */ 0x2230, - /* 3aa - */ 0, - /* 3ab - */ 0, - /* 3ac - */ 0, - /* 3ad - */ 0, - /* 3ae - */ 0, - /* 3af - */ 0, - /* 3b0 - */ 0, - /* 3b1 - */ 0, - /* 3b2 - */ 0, - /* 3b3 - */ 0, - /* 3b4 - */ 0, - /* 3b5 - */ 0, - /* 3b6 - */ 0, - /* 3b7 - */ 0, - /* 3b8 - */ 0, - /* 3b9 - */ 0, - /* 3ba - */ 0, - /* 3bb - */ 0, - /* 3bc - */ 0, - /* 3bd - */ 0, - /* 3be - */ 0, - /* 3bf - */ 0, - /* 3c0 - _DB_00 */ 0x2231, - /* 3c1 - _DB_01 */ 0x2232, - /* 3c2 - _DB_02 */ 0x2233, - /* 3c3 - _DB_03 */ 0x2234, - /* 3c4 - */ 0, - /* 3c5 - _DB_05 */ 0x2235, - /* 3c6 - */ 0, - /* 3c7 - _DB_07 */ 0x2236, - /* 3c8 - _DB_C0 */ 0x2237, - /* 3c9 - _DB_C0 */ 0x2238, - /* 3ca - _DB_C0 */ 0x2239, - /* 3cb - _DB_C0 */ 0x223a, - /* 3cc - _DB_C0 */ 0x223b, - /* 3cd - _DB_C0 */ 0x223c, - /* 3ce - _DB_C0 */ 0x223d, - /* 3cf - _DB_C0 */ 0x223e, - /* 3d0 - _DB_C8 */ 0x223f, - /* 3d1 - _DB_C8 */ 0x2240, - /* 3d2 - _DB_C8 */ 0x2241, - /* 3d3 - _DB_C8 */ 0x2242, - /* 3d4 - _DB_C8 */ 0x2243, - /* 3d5 - _DB_C8 */ 0x2244, - /* 3d6 - _DB_C8 */ 0x2245, - /* 3d7 - _DB_C8 */ 0x2246, - /* 3d8 - _DB_D0 */ 0x2247, - /* 3d9 - _DB_D0 */ 0x2248, - /* 3da - _DB_D0 */ 0x2249, - /* 3db - _DB_D0 */ 0x224a, - /* 3dc - _DB_D0 */ 0x224b, - /* 3dd - _DB_D0 */ 0x224c, - /* 3de - _DB_D0 */ 0x224d, - /* 3df - _DB_D0 */ 0x224e, - /* 3e0 - _DB_D8 */ 0x224f, - /* 3e1 - _DB_D8 */ 0x2250, - /* 3e2 - _DB_D8 */ 0x2251, - /* 3e3 - _DB_D8 */ 0x2252, - /* 3e4 - _DB_D8 */ 0x2253, - /* 3e5 - _DB_D8 */ 0x2254, - /* 3e6 - _DB_D8 */ 0x2255, - /* 3e7 - _DB_D8 */ 0x2256, - /* 3e8 - _DB_E0 */ 0x2257, - /* 3e9 - _DB_E1 */ 0x2258, - /* 3ea - _DB_E2 */ 0xcf3c, - /* 3eb - _DB_E3 */ 0xcf48, - /* 3ec - _DB_E4 */ 0x2259, - /* 3ed - */ 0, - /* 3ee - */ 0, - /* 3ef - */ 0, - /* 3f0 - _DB_E8 */ 0x225a, - /* 3f1 - _DB_E8 */ 0x225b, - /* 3f2 - _DB_E8 */ 0x225c, - /* 3f3 - _DB_E8 */ 0x225d, - /* 3f4 - _DB_E8 */ 0x225e, - /* 3f5 - _DB_E8 */ 0x225f, - /* 3f6 - _DB_E8 */ 0x2260, - /* 3f7 - _DB_E8 */ 0x2261, - /* 3f8 - _DB_F0 */ 0x2262, - /* 3f9 - _DB_F0 */ 0x2263, - /* 3fa - _DB_F0 */ 0x2264, - /* 3fb - _DB_F0 */ 0x2265, - /* 3fc - _DB_F0 */ 0x2266, - /* 3fd - _DB_F0 */ 0x2267, - /* 3fe - _DB_F0 */ 0x2268, - /* 3ff - _DB_F0 */ 0x2269, - /* 400 - */ 0, - /* 401 - */ 0, - /* 402 - */ 0, - /* 403 - */ 0, - /* 404 - */ 0, - /* 405 - */ 0, - /* 406 - */ 0, - /* 407 - */ 0, - /* 408 - _DC_00 */ 0x226a, - /* 409 - _DC_01 */ 0x226b, - /* 40a - _DC_02 */ 0x226c, - /* 40b - _DC_03 */ 0x226d, - /* 40c - _DC_04 */ 0x226e, - /* 40d - _DC_05 */ 0x226f, - /* 40e - _DC_06 */ 0x2270, - /* 40f - _DC_07 */ 0x2271, - /* 410 - _DC_C0 */ 0x2272, - /* 411 - _DC_C0 */ 0x2273, - /* 412 - _DC_C0 */ 0x2274, - /* 413 - _DC_C0 */ 0x2275, - /* 414 - _DC_C0 */ 0x2276, - /* 415 - _DC_C0 */ 0x2277, - /* 416 - _DC_C0 */ 0x2278, - /* 417 - _DC_C0 */ 0x2279, - /* 418 - _DC_C8 */ 0x227a, - /* 419 - _DC_C8 */ 0x227b, - /* 41a - _DC_C8 */ 0x227c, - /* 41b - _DC_C8 */ 0x227d, - /* 41c - _DC_C8 */ 0x227e, - /* 41d - _DC_C8 */ 0x227f, - /* 41e - _DC_C8 */ 0x2280, - /* 41f - _DC_C8 */ 0x2281, - /* 420 - */ 0, - /* 421 - */ 0, - /* 422 - */ 0, - /* 423 - */ 0, - /* 424 - */ 0, - /* 425 - */ 0, - /* 426 - */ 0, - /* 427 - */ 0, - /* 428 - */ 0, - /* 429 - */ 0, - /* 42a - */ 0, - /* 42b - */ 0, - /* 42c - */ 0, - /* 42d - */ 0, - /* 42e - */ 0, - /* 42f - */ 0, - /* 430 - _DC_E0 */ 0x2282, - /* 431 - _DC_E0 */ 0x2283, - /* 432 - _DC_E0 */ 0x2284, - /* 433 - _DC_E0 */ 0x2285, - /* 434 - _DC_E0 */ 0x2286, - /* 435 - _DC_E0 */ 0x2287, - /* 436 - _DC_E0 */ 0x2288, - /* 437 - _DC_E0 */ 0x2289, - /* 438 - _DC_E8 */ 0x228a, - /* 439 - _DC_E8 */ 0x228b, - /* 43a - _DC_E8 */ 0x228c, - /* 43b - _DC_E8 */ 0x228d, - /* 43c - _DC_E8 */ 0x228e, - /* 43d - _DC_E8 */ 0x228f, - /* 43e - _DC_E8 */ 0x2290, - /* 43f - _DC_E8 */ 0x2291, - /* 440 - _DC_F0 */ 0x2292, - /* 441 - _DC_F0 */ 0x2293, - /* 442 - _DC_F0 */ 0x2294, - /* 443 - _DC_F0 */ 0x2295, - /* 444 - _DC_F0 */ 0x2296, - /* 445 - _DC_F0 */ 0x2297, - /* 446 - _DC_F0 */ 0x2298, - /* 447 - _DC_F0 */ 0x2299, - /* 448 - _DC_F8 */ 0x229a, - /* 449 - _DC_F8 */ 0x229b, - /* 44a - _DC_F8 */ 0x229c, - /* 44b - _DC_F8 */ 0x229d, - /* 44c - _DC_F8 */ 0x229e, - /* 44d - _DC_F8 */ 0x229f, - /* 44e - _DC_F8 */ 0x22a0, - /* 44f - _DC_F8 */ 0x22a1, - /* 450 - _DD_00 */ 0x22a2, - /* 451 - _DD_01 */ 0x22a3, - /* 452 - _DD_02 */ 0x22a4, - /* 453 - _DD_03 */ 0x22a5, - /* 454 - _DD_04 */ 0x22a6, - /* 455 - */ 0, - /* 456 - _DD_06 */ 0xcf54, - /* 457 - _DD_07 */ 0xcf60, - /* 458 - _DD_C0 */ 0x22a7, - /* 459 - _DD_C0 */ 0x22a8, - /* 45a - _DD_C0 */ 0x22a9, - /* 45b - _DD_C0 */ 0x22aa, - /* 45c - _DD_C0 */ 0x22ab, - /* 45d - _DD_C0 */ 0x22ac, - /* 45e - _DD_C0 */ 0x22ad, - /* 45f - _DD_C0 */ 0x22ae, - /* 460 - */ 0, - /* 461 - */ 0, - /* 462 - */ 0, - /* 463 - */ 0, - /* 464 - */ 0, - /* 465 - */ 0, - /* 466 - */ 0, - /* 467 - */ 0, - /* 468 - _DD_D0 */ 0x22af, - /* 469 - _DD_D0 */ 0x22b0, - /* 46a - _DD_D0 */ 0x22b1, - /* 46b - _DD_D0 */ 0x22b2, - /* 46c - _DD_D0 */ 0x22b3, - /* 46d - _DD_D0 */ 0x22b4, - /* 46e - _DD_D0 */ 0x22b5, - /* 46f - _DD_D0 */ 0x22b6, - /* 470 - _DD_D8 */ 0x22b7, - /* 471 - _DD_D8 */ 0x22b8, - /* 472 - _DD_D8 */ 0x22b9, - /* 473 - _DD_D8 */ 0x22ba, - /* 474 - _DD_D8 */ 0x22bb, - /* 475 - _DD_D8 */ 0x22bc, - /* 476 - _DD_D8 */ 0x22bd, - /* 477 - _DD_D8 */ 0x22be, - /* 478 - _DD_E0 */ 0x22bf, - /* 479 - _DD_E1 */ 0x22c0, - /* 47a - _DD_E0 */ 0x22c1, - /* 47b - _DD_E0 */ 0x22c2, - /* 47c - _DD_E0 */ 0x22c3, - /* 47d - _DD_E0 */ 0x22c4, - /* 47e - _DD_E0 */ 0x22c5, - /* 47f - _DD_E0 */ 0x22c6, - /* 480 - _DD_E8 */ 0x22c7, - /* 481 - _DD_E9 */ 0x22c8, - /* 482 - _DD_E8 */ 0x22c9, - /* 483 - _DD_E8 */ 0x22ca, - /* 484 - _DD_E8 */ 0x22cb, - /* 485 - _DD_E8 */ 0x22cc, - /* 486 - _DD_E8 */ 0x22cd, - /* 487 - _DD_E8 */ 0x22ce, - /* 488 - */ 0, - /* 489 - */ 0, - /* 48a - */ 0, - /* 48b - */ 0, - /* 48c - */ 0, - /* 48d - */ 0, - /* 48e - */ 0, - /* 48f - */ 0, - /* 490 - */ 0, - /* 491 - */ 0, - /* 492 - */ 0, - /* 493 - */ 0, - /* 494 - */ 0, - /* 495 - */ 0, - /* 496 - */ 0, - /* 497 - */ 0, - /* 498 - _DE_00 */ 0x22cf, - /* 499 - _DE_01 */ 0x22d0, - /* 49a - _DE_02 */ 0x22d1, - /* 49b - _DE_03 */ 0x22d2, - /* 49c - _DE_04 */ 0x22d3, - /* 49d - _DE_05 */ 0x22d4, - /* 49e - _DE_06 */ 0x22d5, - /* 49f - _DE_07 */ 0x22d6, - /* 4a0 - _DE_C0 */ 0x22d7, - /* 4a1 - _DE_C1 */ 0x22d8, - /* 4a2 - _DE_C0 */ 0x22d9, - /* 4a3 - _DE_C0 */ 0x22da, - /* 4a4 - _DE_C0 */ 0x22db, - /* 4a5 - _DE_C0 */ 0x22dc, - /* 4a6 - _DE_C0 */ 0x22dd, - /* 4a7 - _DE_C0 */ 0x22de, - /* 4a8 - _DE_C8 */ 0x22df, - /* 4a9 - _DE_C9 */ 0x22e0, - /* 4aa - _DE_C8 */ 0x22e1, - /* 4ab - _DE_C8 */ 0x22e2, - /* 4ac - _DE_C8 */ 0x22e3, - /* 4ad - _DE_C8 */ 0x22e4, - /* 4ae - _DE_C8 */ 0x22e5, - /* 4af - _DE_C8 */ 0x22e6, - /* 4b0 - */ 0, - /* 4b1 - */ 0, - /* 4b2 - */ 0, - /* 4b3 - */ 0, - /* 4b4 - */ 0, - /* 4b5 - */ 0, - /* 4b6 - */ 0, - /* 4b7 - */ 0, - /* 4b8 - */ 0, - /* 4b9 - _DE_D9 */ 0x22e7, - /* 4ba - */ 0, - /* 4bb - */ 0, - /* 4bc - */ 0, - /* 4bd - */ 0, - /* 4be - */ 0, - /* 4bf - */ 0, - /* 4c0 - _DE_E0 */ 0x22e8, - /* 4c1 - _DE_E1 */ 0x22e9, - /* 4c2 - _DE_E0 */ 0x22ea, - /* 4c3 - _DE_E0 */ 0x22eb, - /* 4c4 - _DE_E0 */ 0x22ec, - /* 4c5 - _DE_E0 */ 0x22ed, - /* 4c6 - _DE_E0 */ 0x22ee, - /* 4c7 - _DE_E0 */ 0x22ef, - /* 4c8 - _DE_E8 */ 0x22f0, - /* 4c9 - _DE_E9 */ 0x22f1, - /* 4ca - _DE_E8 */ 0x22f2, - /* 4cb - _DE_E8 */ 0x22f3, - /* 4cc - _DE_E8 */ 0x22f4, - /* 4cd - _DE_E8 */ 0x22f5, - /* 4ce - _DE_E8 */ 0x22f6, - /* 4cf - _DE_E8 */ 0x22f7, - /* 4d0 - _DE_F0 */ 0x22f8, - /* 4d1 - _DE_F1 */ 0x22f9, - /* 4d2 - _DE_F0 */ 0x22fa, - /* 4d3 - _DE_F0 */ 0x22fb, - /* 4d4 - _DE_F0 */ 0x22fc, - /* 4d5 - _DE_F0 */ 0x22fd, - /* 4d6 - _DE_F0 */ 0x22fe, - /* 4d7 - _DE_F0 */ 0x22ff, - /* 4d8 - _DE_F8 */ 0x2300, - /* 4d9 - _DE_F9 */ 0x2301, - /* 4da - _DE_F8 */ 0x2302, - /* 4db - _DE_F8 */ 0x2303, - /* 4dc - _DE_F8 */ 0x2304, - /* 4dd - _DE_F8 */ 0x2305, - /* 4de - _DE_F8 */ 0x2306, - /* 4df - _DE_F8 */ 0x2307, - /* 4e0 - _DF_00 */ 0x2308, - /* 4e1 - _DF_01 */ 0x2309, - /* 4e2 - _DF_02 */ 0x230a, - /* 4e3 - _DF_03 */ 0x230b, - /* 4e4 - _DF_04 */ 0x230c, - /* 4e5 - _DF_05 */ 0x230d, - /* 4e6 - _DF_06 */ 0x230e, - /* 4e7 - _DF_07 */ 0x230f, - /* 4e8 - */ 0, - /* 4e9 - */ 0, - /* 4ea - */ 0, - /* 4eb - */ 0, - /* 4ec - */ 0, - /* 4ed - */ 0, - /* 4ee - */ 0, - /* 4ef - */ 0, - /* 4f0 - */ 0, - /* 4f1 - */ 0, - /* 4f2 - */ 0, - /* 4f3 - */ 0, - /* 4f4 - */ 0, - /* 4f5 - */ 0, - /* 4f6 - */ 0, - /* 4f7 - */ 0, - /* 4f8 - */ 0, - /* 4f9 - */ 0, - /* 4fa - */ 0, - /* 4fb - */ 0, - /* 4fc - */ 0, - /* 4fd - */ 0, - /* 4fe - */ 0, - /* 4ff - */ 0, - /* 500 - */ 0, - /* 501 - */ 0, - /* 502 - */ 0, - /* 503 - */ 0, - /* 504 - */ 0, - /* 505 - */ 0, - /* 506 - */ 0, - /* 507 - */ 0, - /* 508 - _DF_E0 */ 0xcf6c, - /* 509 - */ 0, - /* 50a - */ 0, - /* 50b - */ 0, - /* 50c - */ 0, - /* 50d - */ 0, - /* 50e - */ 0, - /* 50f - */ 0, - /* 510 - _DF_E8 */ 0x2310, - /* 511 - _DF_E8 */ 0x2311, - /* 512 - _DF_E8 */ 0x2312, - /* 513 - _DF_E8 */ 0x2313, - /* 514 - _DF_E8 */ 0x2314, - /* 515 - _DF_E8 */ 0x2315, - /* 516 - _DF_E8 */ 0x2316, - /* 517 - _DF_E8 */ 0x2317, - /* 518 - _DF_F0 */ 0x2318, - /* 519 - _DF_F0 */ 0x2319, - /* 51a - _DF_F0 */ 0x231a, - /* 51b - _DF_F0 */ 0x231b, - /* 51c - _DF_F0 */ 0x231c, - /* 51d - _DF_F0 */ 0x231d, - /* 51e - _DF_F0 */ 0x231e, - /* 51f - _DF_F0 */ 0x231f, - /* 520 - */ 0, - /* 521 - */ 0, - /* 522 - */ 0, - /* 523 - */ 0, - /* 524 - */ 0, - /* 525 - */ 0, - /* 526 - */ 0, - /* 527 - */ 0, - /* 528 - _F6_00 */ 0x2320, - /* 529 - */ 0, - /* 52a - _F6_02 */ 0x2321, - /* 52b - _F6_03 */ 0x2322, - /* 52c - _F6_04 */ 0x2323, - /* 52d - _F6_05 */ 0x2324, - /* 52e - _F6_06 */ 0x2325, - /* 52f - _F6_07 */ 0x2326, - /* 530 - _F7_00 */ 0x2327, - /* 531 - */ 0, - /* 532 - _F7_02 */ 0x2328, - /* 533 - _F7_03 */ 0x2329, - /* 534 - _F7_04 */ 0x232a, - /* 535 - _F7_05 */ 0x232b, - /* 536 - _F7_06 */ 0x232c, - /* 537 - _F7_07 */ 0x232d, - /* 538 - _FE_00 */ 0x232e, - /* 539 - _FE_01 */ 0x232f, - /* 53a - */ 0, - /* 53b - */ 0, - /* 53c - */ 0, - /* 53d - */ 0, - /* 53e - */ 0, - /* 53f - */ 0, - /* 540 - _FF_00 */ 0x2330, - /* 541 - _FF_01 */ 0x2331, - /* 542 - _FF_02 */ 0x2332, - /* 543 - _FF_03 */ 0x2333, - /* 544 - _FF_04 */ 0x2334, - /* 545 - _FF_05 */ 0x2335, - /* 546 - _FF_06 */ 0x2336, - /* 547 - */ 0, - /* 548 - _0F_00_00 */ 0x2337, - /* 549 - _0F_00_01 */ 0x2338, - /* 54a - _0F_00_02 */ 0x2339, - /* 54b - _0F_00_03 */ 0x233a, - /* 54c - _0F_00_04 */ 0x233b, - /* 54d - _0F_00_05 */ 0x233c, - /* 54e - */ 0, - /* 54f - */ 0, - /* 550 - _0F_01_00 */ 0x233d, - /* 551 - _0F_01_01 */ 0x233e, - /* 552 - _0F_01_02 */ 0x233f, - /* 553 - _0F_01_03 */ 0x2340, - /* 554 - _0F_01_04 */ 0x2341, - /* 555 - */ 0, - /* 556 - _0F_01_06 */ 0x2342, - /* 557 - _0F_01_07 */ 0x2343, - /* 558 - */ 0, - /* 559 - _0F_01_C1 */ 0x2344, - /* 55a - _0F_01_C2 */ 0x2345, - /* 55b - _0F_01_C3 */ 0x2346, - /* 55c - _0F_01_C4 */ 0x2347, - /* 55d - */ 0, - /* 55e - */ 0, - /* 55f - */ 0, - /* 560 - _0F_01_C8 */ 0x2348, - /* 561 - _0F_01_C9 */ 0x2349, - /* 562 - */ 0, - /* 563 - */ 0, - /* 564 - */ 0, - /* 565 - */ 0, - /* 566 - */ 0, - /* 567 - */ 0, - /* 568 - _0F_01_D0 */ 0x234a, - /* 569 - _0F_01_D1 */ 0x234b, - /* 56a - */ 0, - /* 56b - */ 0, - /* 56c - _0F_01_D4 */ 0x234c, - /* 56d - _0F_01_D5 */ 0x234d, - /* 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, - /* 578 - */ 0, - /* 579 - */ 0, - /* 57a - */ 0, - /* 57b - */ 0, - /* 57c - */ 0, - /* 57d - */ 0, - /* 57e - */ 0, - /* 57f - */ 0, - /* 580 - */ 0, - /* 581 - */ 0, - /* 582 - */ 0, - /* 583 - */ 0, - /* 584 - */ 0, - /* 585 - */ 0, - /* 586 - */ 0, - /* 587 - */ 0, - /* 588 - */ 0, - /* 589 - */ 0, - /* 58a - */ 0, - /* 58b - */ 0, - /* 58c - */ 0, - /* 58d - */ 0, - /* 58e - */ 0, - /* 58f - */ 0, - /* 590 - _0F_01_F8 */ 0x2356, - /* 591 - _0F_01_F9 */ 0x2357, - /* 592 - */ 0, - /* 593 - */ 0, - /* 594 - */ 0, - /* 595 - */ 0, - /* 596 - */ 0, - /* 597 - */ 0, - /* 598 - _0F_0D_00 */ 0x2358, - /* 599 - _0F_0D_01 */ 0x2359, - /* 59a - */ 0, - /* 59b - */ 0, - /* 59c - */ 0, - /* 59d - */ 0, - /* 59e - */ 0, - /* 59f - */ 0, - /* 5a0 - */ 0, - /* 5a1 - */ 0, - /* 5a2 - */ 0, - /* 5a3 - */ 0, - /* 5a4 - */ 0, - /* 5a5 - */ 0, - /* 5a6 - */ 0, - /* 5a7 - */ 0, - /* 5a8 - */ 0, - /* 5a9 - */ 0, - /* 5aa - */ 0, - /* 5ab - */ 0, - /* 5ac - _0F_0F_0C */ 0x235a, - /* 5ad - _0F_0F_0D */ 0x235b, - /* 5ae - */ 0, - /* 5af - */ 0, - /* 5b0 - */ 0, - /* 5b1 - */ 0, - /* 5b2 - */ 0, - /* 5b3 - */ 0, - /* 5b4 - */ 0, - /* 5b5 - */ 0, - /* 5b6 - */ 0, - /* 5b7 - */ 0, - /* 5b8 - */ 0, - /* 5b9 - */ 0, - /* 5ba - */ 0, - /* 5bb - */ 0, - /* 5bc - _0F_0F_1C */ 0x235c, - /* 5bd - _0F_0F_1D */ 0x235d, - /* 5be - */ 0, - /* 5bf - */ 0, - /* 5c0 - */ 0, - /* 5c1 - */ 0, - /* 5c2 - */ 0, - /* 5c3 - */ 0, - /* 5c4 - */ 0, - /* 5c5 - */ 0, - /* 5c6 - */ 0, - /* 5c7 - */ 0, - /* 5c8 - */ 0, - /* 5c9 - */ 0, - /* 5ca - */ 0, - /* 5cb - */ 0, - /* 5cc - */ 0, - /* 5cd - */ 0, - /* 5ce - */ 0, - /* 5cf - */ 0, - /* 5d0 - */ 0, - /* 5d1 - */ 0, - /* 5d2 - */ 0, - /* 5d3 - */ 0, - /* 5d4 - */ 0, - /* 5d5 - */ 0, - /* 5d6 - */ 0, - /* 5d7 - */ 0, - /* 5d8 - */ 0, - /* 5d9 - */ 0, - /* 5da - */ 0, - /* 5db - */ 0, - /* 5dc - */ 0, - /* 5dd - */ 0, - /* 5de - */ 0, - /* 5df - */ 0, - /* 5e0 - */ 0, - /* 5e1 - */ 0, - /* 5e2 - */ 0, - /* 5e3 - */ 0, - /* 5e4 - */ 0, - /* 5e5 - */ 0, - /* 5e6 - */ 0, - /* 5e7 - */ 0, - /* 5e8 - */ 0, - /* 5e9 - */ 0, - /* 5ea - */ 0, - /* 5eb - */ 0, - /* 5ec - */ 0, - /* 5ed - */ 0, - /* 5ee - */ 0, - /* 5ef - */ 0, - /* 5f0 - */ 0, - /* 5f1 - */ 0, - /* 5f2 - */ 0, - /* 5f3 - */ 0, - /* 5f4 - */ 0, - /* 5f5 - */ 0, - /* 5f6 - */ 0, - /* 5f7 - */ 0, - /* 5f8 - */ 0, - /* 5f9 - */ 0, - /* 5fa - */ 0, - /* 5fb - */ 0, - /* 5fc - */ 0, - /* 5fd - */ 0, - /* 5fe - */ 0, - /* 5ff - */ 0, - /* 600 - */ 0, - /* 601 - */ 0, - /* 602 - */ 0, - /* 603 - */ 0, - /* 604 - */ 0, - /* 605 - */ 0, - /* 606 - */ 0, - /* 607 - */ 0, - /* 608 - */ 0, - /* 609 - */ 0, - /* 60a - */ 0, - /* 60b - */ 0, - /* 60c - */ 0, - /* 60d - */ 0, - /* 60e - */ 0, - /* 60f - */ 0, - /* 610 - */ 0, - /* 611 - */ 0, - /* 612 - */ 0, - /* 613 - */ 0, - /* 614 - */ 0, - /* 615 - */ 0, - /* 616 - */ 0, - /* 617 - */ 0, - /* 618 - */ 0, - /* 619 - */ 0, - /* 61a - */ 0, - /* 61b - */ 0, - /* 61c - */ 0, - /* 61d - */ 0, - /* 61e - */ 0, - /* 61f - */ 0, - /* 620 - */ 0, - /* 621 - */ 0, - /* 622 - */ 0, - /* 623 - */ 0, - /* 624 - */ 0, - /* 625 - */ 0, - /* 626 - */ 0, - /* 627 - */ 0, - /* 628 - */ 0, - /* 629 - */ 0, - /* 62a - _0F_0F_8A */ 0x235e, - /* 62b - */ 0, - /* 62c - */ 0, - /* 62d - */ 0, - /* 62e - _0F_0F_8E */ 0x235f, - /* 62f - */ 0, - /* 630 - _0F_0F_90 */ 0x2360, - /* 631 - */ 0, - /* 632 - */ 0, - /* 633 - */ 0, - /* 634 - _0F_0F_94 */ 0x2361, - /* 635 - */ 0, - /* 636 - _0F_0F_96 */ 0x2362, - /* 637 - _0F_0F_97 */ 0x2363, - /* 638 - */ 0, - /* 639 - */ 0, - /* 63a - _0F_0F_9A */ 0x2364, - /* 63b - */ 0, - /* 63c - */ 0, - /* 63d - */ 0, - /* 63e - _0F_0F_9E */ 0x2365, - /* 63f - */ 0, - /* 640 - _0F_0F_A0 */ 0x2366, - /* 641 - */ 0, - /* 642 - */ 0, - /* 643 - */ 0, - /* 644 - _0F_0F_A4 */ 0x2367, - /* 645 - */ 0, - /* 646 - _0F_0F_A6 */ 0x2368, - /* 647 - _0F_0F_A7 */ 0x2369, - /* 648 - */ 0, - /* 649 - */ 0, - /* 64a - _0F_0F_AA */ 0x236a, - /* 64b - */ 0, - /* 64c - */ 0, - /* 64d - */ 0, - /* 64e - _0F_0F_AE */ 0x236b, - /* 64f - */ 0, - /* 650 - _0F_0F_B0 */ 0x236c, - /* 651 - */ 0, - /* 652 - */ 0, - /* 653 - */ 0, - /* 654 - _0F_0F_B4 */ 0x236d, - /* 655 - */ 0, - /* 656 - _0F_0F_B6 */ 0x236e, - /* 657 - _0F_0F_B7 */ 0x236f, - /* 658 - */ 0, - /* 659 - */ 0, - /* 65a - */ 0, - /* 65b - _0F_0F_BB */ 0x2370, - /* 65c - */ 0, - /* 65d - */ 0, - /* 65e - */ 0, - /* 65f - _0F_0F_BF */ 0x2371, - /* 660 - */ 0, - /* 661 - */ 0, - /* 662 - */ 0, - /* 663 - */ 0, - /* 664 - */ 0, - /* 665 - */ 0, - /* 666 - */ 0, - /* 667 - */ 0, - /* 668 - */ 0, - /* 669 - */ 0, - /* 66a - */ 0, - /* 66b - */ 0, - /* 66c - */ 0, - /* 66d - */ 0, - /* 66e - */ 0, - /* 66f - */ 0, - /* 670 - */ 0, - /* 671 - */ 0, - /* 672 - */ 0, - /* 673 - */ 0, - /* 674 - */ 0, - /* 675 - */ 0, - /* 676 - */ 0, - /* 677 - */ 0, - /* 678 - */ 0, - /* 679 - */ 0, - /* 67a - */ 0, - /* 67b - */ 0, - /* 67c - */ 0, - /* 67d - */ 0, - /* 67e - */ 0, - /* 67f - */ 0, - /* 680 - */ 0, - /* 681 - */ 0, - /* 682 - */ 0, - /* 683 - */ 0, - /* 684 - */ 0, - /* 685 - */ 0, - /* 686 - */ 0, - /* 687 - */ 0, - /* 688 - */ 0, - /* 689 - */ 0, - /* 68a - */ 0, - /* 68b - */ 0, - /* 68c - */ 0, - /* 68d - */ 0, - /* 68e - */ 0, - /* 68f - */ 0, - /* 690 - */ 0, - /* 691 - */ 0, - /* 692 - */ 0, - /* 693 - */ 0, - /* 694 - */ 0, - /* 695 - */ 0, - /* 696 - */ 0, - /* 697 - */ 0, - /* 698 - */ 0, - /* 699 - */ 0, - /* 69a - */ 0, - /* 69b - */ 0, - /* 69c - */ 0, - /* 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, - /* 6a4 - _V_0F_10 */ 0x4009, - /* 6a5 - _V_66_0F_10 */ 0x400a, - /* 6a6 - _V_F3_0F_10 */ 0x400b, - /* 6a7 - _V_F2_0F_10 */ 0x400c, - /* 6a8 - */ 0, - /* 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, - /* 6b0 - _V_0F_11 */ 0x400f, - /* 6b1 - _V_66_0F_11 */ 0x4010, - /* 6b2 - _V_F3_0F_11 */ 0x4011, - /* 6b3 - _V_F2_0F_11 */ 0x4012, - /* 6b4 - */ 0, - /* 6b5 - */ 0, - /* 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, - /* 6bc - _V_0F_12 */ 0x4016, - /* 6bd - _V_66_0F_12 */ 0x4017, - /* 6be - _V_F3_0F_12 */ 0x4018, - /* 6bf - _V_F2_0F_12 */ 0x4019, - /* 6c0 - */ 0, - /* 6c1 - */ 0, - /* 6c2 - */ 0, - /* 6c3 - */ 0, - /* 6c4 - _0F_13 */ 0x237d, - /* 6c5 - _66_0F_13 */ 0x237e, - /* 6c6 - */ 0, - /* 6c7 - */ 0, - /* 6c8 - _V_0F_13 */ 0x401a, - /* 6c9 - _V_66_0F_13 */ 0x401b, - /* 6ca - */ 0, - /* 6cb - */ 0, - /* 6cc - */ 0, - /* 6cd - */ 0, - /* 6ce - */ 0, - /* 6cf - */ 0, - /* 6d0 - _0F_14 */ 0x237f, - /* 6d1 - _66_0F_14 */ 0x2380, - /* 6d2 - */ 0, - /* 6d3 - */ 0, - /* 6d4 - _V_0F_14 */ 0x401c, - /* 6d5 - _V_66_0F_14 */ 0x401d, - /* 6d6 - */ 0, - /* 6d7 - */ 0, - /* 6d8 - */ 0, - /* 6d9 - */ 0, - /* 6da - */ 0, - /* 6db - */ 0, - /* 6dc - _0F_15 */ 0x2381, - /* 6dd - _66_0F_15 */ 0x2382, - /* 6de - */ 0, - /* 6df - */ 0, - /* 6e0 - _V_0F_15 */ 0x401e, - /* 6e1 - _V_66_0F_15 */ 0x401f, - /* 6e2 - */ 0, - /* 6e3 - */ 0, - /* 6e4 - */ 0, - /* 6e5 - */ 0, - /* 6e6 - */ 0, - /* 6e7 - */ 0, - /* 6e8 - _0F_16 */ 0x4020, - /* 6e9 - _66_0F_16 */ 0x2383, - /* 6ea - _F3_0F_16 */ 0x2384, - /* 6eb - */ 0, - /* 6ec - _V_0F_16 */ 0x4021, - /* 6ed - _V_66_0F_16 */ 0x4022, - /* 6ee - _V_F3_0F_16 */ 0x4023, - /* 6ef - */ 0, - /* 6f0 - */ 0, - /* 6f1 - */ 0, - /* 6f2 - */ 0, - /* 6f3 - */ 0, - /* 6f4 - _0F_17 */ 0x2385, - /* 6f5 - _66_0F_17 */ 0x2386, - /* 6f6 - */ 0, - /* 6f7 - */ 0, - /* 6f8 - _V_0F_17 */ 0x4024, - /* 6f9 - _V_66_0F_17 */ 0x4025, - /* 6fa - */ 0, - /* 6fb - */ 0, - /* 6fc - */ 0, - /* 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, - /* 704 - */ 0, - /* 705 - */ 0, - /* 706 - */ 0, - /* 707 - */ 0, - /* 708 - _0F_28 */ 0x238b, - /* 709 - _66_0F_28 */ 0x238c, - /* 70a - */ 0, - /* 70b - */ 0, - /* 70c - _V_0F_28 */ 0x4026, - /* 70d - _V_66_0F_28 */ 0x4027, - /* 70e - */ 0, - /* 70f - */ 0, - /* 710 - */ 0, - /* 711 - */ 0, - /* 712 - */ 0, - /* 713 - */ 0, - /* 714 - _0F_29 */ 0x238d, - /* 715 - _66_0F_29 */ 0x238e, - /* 716 - */ 0, - /* 717 - */ 0, - /* 718 - _V_0F_29 */ 0x4028, - /* 719 - _V_66_0F_29 */ 0x4029, - /* 71a - */ 0, - /* 71b - */ 0, - /* 71c - */ 0, - /* 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, - /* 724 - */ 0, - /* 725 - */ 0, - /* 726 - _V_F3_0F_2A */ 0x402a, - /* 727 - _V_F2_0F_2A */ 0x402b, - /* 728 - */ 0, - /* 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, - /* 730 - _V_0F_2B */ 0x402c, - /* 731 - _V_66_0F_2B */ 0x402d, - /* 732 - */ 0, - /* 733 - */ 0, - /* 734 - */ 0, - /* 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, - /* 73c - */ 0, - /* 73d - */ 0, - /* 73e - _V_F3_0F_2C */ 0x402e, - /* 73f - _V_F2_0F_2C */ 0x402f, - /* 740 - */ 0, - /* 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, - /* 748 - */ 0, - /* 749 - */ 0, - /* 74a - _V_F3_0F_2D */ 0x4030, - /* 74b - _V_F2_0F_2D */ 0x4031, - /* 74c - */ 0, - /* 74d - */ 0, - /* 74e - */ 0, - /* 74f - */ 0, - /* 750 - _0F_2E */ 0x239f, - /* 751 - _66_0F_2E */ 0x23a0, - /* 752 - */ 0, - /* 753 - */ 0, - /* 754 - _V_0F_2E */ 0x4032, - /* 755 - _V_66_0F_2E */ 0x4033, - /* 756 - */ 0, - /* 757 - */ 0, - /* 758 - */ 0, - /* 759 - */ 0, - /* 75a - */ 0, - /* 75b - */ 0, - /* 75c - _0F_2F */ 0x23a1, - /* 75d - _66_0F_2F */ 0x23a2, - /* 75e - */ 0, - /* 75f - */ 0, - /* 760 - _V_0F_2F */ 0x4034, - /* 761 - _V_66_0F_2F */ 0x4035, - /* 762 - */ 0, - /* 763 - */ 0, - /* 764 - */ 0, - /* 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, - /* 779 - */ 0, - /* 77a - */ 0, - /* 77b - */ 0, - /* 77c - _0F_38_14 */ 0xd044, - /* 77d - _0F_38_15 */ 0xd050, - /* 77e - */ 0, - /* 77f - _0F_38_17 */ 0xd05c, - /* 780 - _0F_38_18 */ 0xd068, - /* 781 - _0F_38_19 */ 0xd074, - /* 782 - _0F_38_1A */ 0xd080, - /* 783 - */ 0, - /* 784 - _0F_38_1C */ 0xd08c, - /* 785 - _0F_38_1D */ 0xd098, - /* 786 - _0F_38_1E */ 0xd0a4, - /* 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, - /* 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, - /* 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, - /* 7aa - */ 0, - /* 7ab - */ 0, - /* 7ac - */ 0, - /* 7ad - */ 0, - /* 7ae - */ 0, - /* 7af - */ 0, - /* 7b0 - */ 0, - /* 7b1 - */ 0, - /* 7b2 - */ 0, - /* 7b3 - */ 0, - /* 7b4 - */ 0, - /* 7b5 - */ 0, - /* 7b6 - */ 0, - /* 7b7 - */ 0, - /* 7b8 - */ 0, - /* 7b9 - */ 0, - /* 7ba - */ 0, - /* 7bb - */ 0, - /* 7bc - */ 0, - /* 7bd - */ 0, - /* 7be - */ 0, - /* 7bf - */ 0, - /* 7c0 - */ 0, - /* 7c1 - */ 0, - /* 7c2 - */ 0, - /* 7c3 - */ 0, - /* 7c4 - */ 0, - /* 7c5 - */ 0, - /* 7c6 - */ 0, - /* 7c7 - */ 0, - /* 7c8 - */ 0, - /* 7c9 - */ 0, - /* 7ca - */ 0, - /* 7cb - */ 0, - /* 7cc - */ 0, - /* 7cd - */ 0, - /* 7ce - */ 0, - /* 7cf - */ 0, - /* 7d0 - */ 0, - /* 7d1 - */ 0, - /* 7d2 - */ 0, - /* 7d3 - */ 0, - /* 7d4 - */ 0, - /* 7d5 - */ 0, - /* 7d6 - */ 0, - /* 7d7 - */ 0, - /* 7d8 - */ 0, - /* 7d9 - */ 0, - /* 7da - */ 0, - /* 7db - */ 0, - /* 7dc - */ 0, - /* 7dd - */ 0, - /* 7de - */ 0, - /* 7df - */ 0, - /* 7e0 - */ 0, - /* 7e1 - */ 0, - /* 7e2 - */ 0, - /* 7e3 - */ 0, - /* 7e4 - */ 0, - /* 7e5 - */ 0, - /* 7e6 - */ 0, - /* 7e7 - */ 0, - /* 7e8 - _0F_38_80 */ 0xd224, - /* 7e9 - _0F_38_81 */ 0xd230, - /* 7ea - _0F_38_82 */ 0xd23c, - /* 7eb - */ 0, - /* 7ec - */ 0, - /* 7ed - */ 0, - /* 7ee - */ 0, - /* 7ef - */ 0, - /* 7f0 - */ 0, - /* 7f1 - */ 0, - /* 7f2 - */ 0, - /* 7f3 - */ 0, - /* 7f4 - */ 0, - /* 7f5 - */ 0, - /* 7f6 - */ 0, - /* 7f7 - */ 0, - /* 7f8 - */ 0, - /* 7f9 - */ 0, - /* 7fa - */ 0, - /* 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, - /* 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, - /* 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, - /* 828 - */ 0, - /* 829 - */ 0, - /* 82a - */ 0, - /* 82b - */ 0, - /* 82c - */ 0, - /* 82d - */ 0, - /* 82e - */ 0, - /* 82f - */ 0, - /* 830 - */ 0, - /* 831 - */ 0, - /* 832 - */ 0, - /* 833 - */ 0, - /* 834 - */ 0, - /* 835 - */ 0, - /* 836 - */ 0, - /* 837 - */ 0, - /* 838 - */ 0, - /* 839 - */ 0, - /* 83a - */ 0, - /* 83b - */ 0, - /* 83c - */ 0, - /* 83d - */ 0, - /* 83e - */ 0, - /* 83f - */ 0, - /* 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, - /* 848 - */ 0, - /* 849 - */ 0, - /* 84a - */ 0, - /* 84b - */ 0, - /* 84c - */ 0, - /* 84d - */ 0, - /* 84e - */ 0, - /* 84f - */ 0, - /* 850 - */ 0, - /* 851 - */ 0, - /* 852 - */ 0, - /* 853 - */ 0, - /* 854 - */ 0, - /* 855 - */ 0, - /* 856 - */ 0, - /* 857 - */ 0, - /* 858 - _0F_38_F0 */ 0xd3ec, - /* 859 - _0F_38_F1 */ 0xd3f8, - /* 85a - */ 0, - /* 85b - */ 0, - /* 85c - */ 0, - /* 85d - */ 0, - /* 85e - */ 0, - /* 85f - */ 0, - /* 860 - */ 0, - /* 861 - */ 0, - /* 862 - */ 0, - /* 863 - */ 0, - /* 864 - */ 0, - /* 865 - */ 0, - /* 866 - */ 0, - /* 867 - */ 0, - /* 868 - */ 0, - /* 869 - */ 0, - /* 86a - */ 0, - /* 86b - */ 0, - /* 86c - _0F_3A_04 */ 0xd404, - /* 86d - _0F_3A_05 */ 0xd410, - /* 86e - _0F_3A_06 */ 0xd41c, - /* 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, - /* 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, - /* 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, - /* 88b - */ 0, - /* 88c - */ 0, - /* 88d - */ 0, - /* 88e - */ 0, - /* 88f - */ 0, - /* 890 - */ 0, - /* 891 - */ 0, - /* 892 - */ 0, - /* 893 - */ 0, - /* 894 - */ 0, - /* 895 - */ 0, - /* 896 - */ 0, - /* 897 - */ 0, - /* 898 - */ 0, - /* 899 - */ 0, - /* 89a - */ 0, - /* 89b - */ 0, - /* 89c - */ 0, - /* 89d - */ 0, - /* 89e - */ 0, - /* 89f - */ 0, - /* 8a0 - */ 0, - /* 8a1 - */ 0, - /* 8a2 - */ 0, - /* 8a3 - */ 0, - /* 8a4 - */ 0, - /* 8a5 - */ 0, - /* 8a6 - */ 0, - /* 8a7 - */ 0, - /* 8a8 - _0F_3A_40 */ 0xd4f4, - /* 8a9 - _0F_3A_41 */ 0xd500, - /* 8aa - _0F_3A_42 */ 0xd50c, - /* 8ab - */ 0, - /* 8ac - _0F_3A_44 */ 0xd518, - /* 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, - /* 8b5 - */ 0, - /* 8b6 - */ 0, - /* 8b7 - */ 0, - /* 8b8 - */ 0, - /* 8b9 - */ 0, - /* 8ba - */ 0, - /* 8bb - */ 0, - /* 8bc - */ 0, - /* 8bd - */ 0, - /* 8be - */ 0, - /* 8bf - */ 0, - /* 8c0 - */ 0, - /* 8c1 - */ 0, - /* 8c2 - */ 0, - /* 8c3 - */ 0, - /* 8c4 - */ 0, - /* 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, - /* 8cc - */ 0, - /* 8cd - */ 0, - /* 8ce - */ 0, - /* 8cf - */ 0, - /* 8d0 - */ 0, - /* 8d1 - */ 0, - /* 8d2 - */ 0, - /* 8d3 - */ 0, - /* 8d4 - */ 0, - /* 8d5 - */ 0, - /* 8d6 - */ 0, - /* 8d7 - */ 0, - /* 8d8 - */ 0, - /* 8d9 - */ 0, - /* 8da - */ 0, - /* 8db - */ 0, - /* 8dc - */ 0, - /* 8dd - */ 0, - /* 8de - */ 0, - /* 8df - */ 0, - /* 8e0 - */ 0, - /* 8e1 - */ 0, - /* 8e2 - */ 0, - /* 8e3 - */ 0, - /* 8e4 - */ 0, - /* 8e5 - */ 0, - /* 8e6 - */ 0, - /* 8e7 - */ 0, - /* 8e8 - */ 0, - /* 8e9 - */ 0, - /* 8ea - */ 0, - /* 8eb - */ 0, - /* 8ec - */ 0, - /* 8ed - */ 0, - /* 8ee - */ 0, - /* 8ef - */ 0, - /* 8f0 - */ 0, - /* 8f1 - */ 0, - /* 8f2 - */ 0, - /* 8f3 - */ 0, - /* 8f4 - */ 0, - /* 8f5 - */ 0, - /* 8f6 - */ 0, - /* 8f7 - */ 0, - /* 8f8 - */ 0, - /* 8f9 - */ 0, - /* 8fa - */ 0, - /* 8fb - */ 0, - /* 8fc - */ 0, - /* 8fd - */ 0, - /* 8fe - */ 0, - /* 8ff - */ 0, - /* 900 - */ 0, - /* 901 - */ 0, - /* 902 - */ 0, - /* 903 - */ 0, - /* 904 - */ 0, - /* 905 - */ 0, - /* 906 - */ 0, - /* 907 - */ 0, - /* 908 - */ 0, - /* 909 - */ 0, - /* 90a - */ 0, - /* 90b - */ 0, - /* 90c - */ 0, - /* 90d - */ 0, - /* 90e - */ 0, - /* 90f - */ 0, - /* 910 - */ 0, - /* 911 - */ 0, - /* 912 - */ 0, - /* 913 - */ 0, - /* 914 - */ 0, - /* 915 - */ 0, - /* 916 - */ 0, - /* 917 - */ 0, - /* 918 - */ 0, - /* 919 - */ 0, - /* 91a - */ 0, - /* 91b - */ 0, - /* 91c - */ 0, - /* 91d - */ 0, - /* 91e - */ 0, - /* 91f - */ 0, - /* 920 - */ 0, - /* 921 - */ 0, - /* 922 - */ 0, - /* 923 - */ 0, - /* 924 - */ 0, - /* 925 - */ 0, - /* 926 - */ 0, - /* 927 - */ 0, - /* 928 - */ 0, - /* 929 - */ 0, - /* 92a - */ 0, - /* 92b - */ 0, - /* 92c - */ 0, - /* 92d - */ 0, - /* 92e - */ 0, - /* 92f - */ 0, - /* 930 - */ 0, - /* 931 - */ 0, - /* 932 - */ 0, - /* 933 - */ 0, - /* 934 - */ 0, - /* 935 - */ 0, - /* 936 - */ 0, - /* 937 - */ 0, - /* 938 - */ 0, - /* 939 - */ 0, - /* 93a - */ 0, - /* 93b - */ 0, - /* 93c - */ 0, - /* 93d - */ 0, - /* 93e - */ 0, - /* 93f - */ 0, - /* 940 - */ 0, - /* 941 - */ 0, - /* 942 - */ 0, - /* 943 - */ 0, - /* 944 - */ 0, - /* 945 - */ 0, - /* 946 - */ 0, - /* 947 - _0F_3A_DF */ 0xd578, - /* 948 - */ 0, - /* 949 - */ 0, - /* 94a - */ 0, - /* 94b - */ 0, - /* 94c - */ 0, - /* 94d - */ 0, - /* 94e - */ 0, - /* 94f - */ 0, - /* 950 - */ 0, - /* 951 - */ 0, - /* 952 - */ 0, - /* 953 - */ 0, - /* 954 - */ 0, - /* 955 - */ 0, - /* 956 - */ 0, - /* 957 - */ 0, - /* 958 - */ 0, - /* 959 - */ 0, - /* 95a - */ 0, - /* 95b - */ 0, - /* 95c - */ 0, - /* 95d - */ 0, - /* 95e - */ 0, - /* 95f - */ 0, - /* 960 - */ 0, - /* 961 - */ 0, - /* 962 - */ 0, - /* 963 - */ 0, - /* 964 - */ 0, - /* 965 - */ 0, - /* 966 - */ 0, - /* 967 - */ 0, - /* 968 - _0F_50 */ 0x23a3, - /* 969 - _66_0F_50 */ 0x23a4, - /* 96a - */ 0, - /* 96b - */ 0, - /* 96c - _V_0F_50 */ 0x4036, - /* 96d - _V_66_0F_50 */ 0x4037, - /* 96e - */ 0, - /* 96f - */ 0, - /* 970 - */ 0, - /* 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, - /* 978 - _V_0F_51 */ 0x4038, - /* 979 - _V_66_0F_51 */ 0x4039, - /* 97a - _V_F3_0F_51 */ 0x403a, - /* 97b - _V_F2_0F_51 */ 0x403b, - /* 97c - */ 0, - /* 97d - */ 0, - /* 97e - */ 0, - /* 97f - */ 0, - /* 980 - _0F_52 */ 0x23a9, - /* 981 - */ 0, - /* 982 - _F3_0F_52 */ 0x23aa, - /* 983 - */ 0, - /* 984 - _V_0F_52 */ 0x403c, - /* 985 - */ 0, - /* 986 - _V_F3_0F_52 */ 0x403d, - /* 987 - */ 0, - /* 988 - */ 0, - /* 989 - */ 0, - /* 98a - */ 0, - /* 98b - */ 0, - /* 98c - _0F_53 */ 0x23ab, - /* 98d - */ 0, - /* 98e - _F3_0F_53 */ 0x23ac, - /* 98f - */ 0, - /* 990 - _V_0F_53 */ 0x403e, - /* 991 - */ 0, - /* 992 - _V_F3_0F_53 */ 0x403f, - /* 993 - */ 0, - /* 994 - */ 0, - /* 995 - */ 0, - /* 996 - */ 0, - /* 997 - */ 0, - /* 998 - _0F_54 */ 0x23ad, - /* 999 - _66_0F_54 */ 0x23ae, - /* 99a - */ 0, - /* 99b - */ 0, - /* 99c - _V_0F_54 */ 0x4040, - /* 99d - _V_66_0F_54 */ 0x4041, - /* 99e - */ 0, - /* 99f - */ 0, - /* 9a0 - */ 0, - /* 9a1 - */ 0, - /* 9a2 - */ 0, - /* 9a3 - */ 0, - /* 9a4 - _0F_55 */ 0x23af, - /* 9a5 - _66_0F_55 */ 0x23b0, - /* 9a6 - */ 0, - /* 9a7 - */ 0, - /* 9a8 - _V_0F_55 */ 0x4042, - /* 9a9 - _V_66_0F_55 */ 0x4043, - /* 9aa - */ 0, - /* 9ab - */ 0, - /* 9ac - */ 0, - /* 9ad - */ 0, - /* 9ae - */ 0, - /* 9af - */ 0, - /* 9b0 - _0F_56 */ 0x23b1, - /* 9b1 - _66_0F_56 */ 0x23b2, - /* 9b2 - */ 0, - /* 9b3 - */ 0, - /* 9b4 - _V_0F_56 */ 0x4044, - /* 9b5 - _V_66_0F_56 */ 0x4045, - /* 9b6 - */ 0, - /* 9b7 - */ 0, - /* 9b8 - */ 0, - /* 9b9 - */ 0, - /* 9ba - */ 0, - /* 9bb - */ 0, - /* 9bc - _0F_57 */ 0x23b3, - /* 9bd - _66_0F_57 */ 0x23b4, - /* 9be - */ 0, - /* 9bf - */ 0, - /* 9c0 - _V_0F_57 */ 0x4046, - /* 9c1 - _V_66_0F_57 */ 0x4047, - /* 9c2 - */ 0, - /* 9c3 - */ 0, - /* 9c4 - */ 0, - /* 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, - /* 9cc - _V_0F_58 */ 0x4048, - /* 9cd - _V_66_0F_58 */ 0x4049, - /* 9ce - _V_F3_0F_58 */ 0x404a, - /* 9cf - _V_F2_0F_58 */ 0x404b, - /* 9d0 - */ 0, - /* 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, - /* 9d8 - _V_0F_59 */ 0x404c, - /* 9d9 - _V_66_0F_59 */ 0x404d, - /* 9da - _V_F3_0F_59 */ 0x404e, - /* 9db - _V_F2_0F_59 */ 0x404f, - /* 9dc - */ 0, - /* 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, - /* 9e4 - _V_0F_5A */ 0x4050, - /* 9e5 - _V_66_0F_5A */ 0x4051, - /* 9e6 - _V_F3_0F_5A */ 0x4052, - /* 9e7 - _V_F2_0F_5A */ 0x4053, - /* 9e8 - */ 0, - /* 9e9 - */ 0, - /* 9ea - */ 0, - /* 9eb - */ 0, - /* 9ec - _0F_5B */ 0x23c1, - /* 9ed - _66_0F_5B */ 0x23c2, - /* 9ee - _F3_0F_5B */ 0x23c3, - /* 9ef - */ 0, - /* 9f0 - _V_0F_5B */ 0x4054, - /* 9f1 - _V_66_0F_5B */ 0x4055, - /* 9f2 - _V_F3_0F_5B */ 0x4056, - /* 9f3 - */ 0, - /* 9f4 - */ 0, - /* 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, - /* 9fc - _V_0F_5C */ 0x4057, - /* 9fd - _V_66_0F_5C */ 0x4058, - /* 9fe - _V_F3_0F_5C */ 0x4059, - /* 9ff - _V_F2_0F_5C */ 0x405a, - /* a00 - */ 0, - /* 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, - /* a08 - _V_0F_5D */ 0x405b, - /* a09 - _V_66_0F_5D */ 0x405c, - /* a0a - _V_F3_0F_5D */ 0x405d, - /* a0b - _V_F2_0F_5D */ 0x405e, - /* a0c - */ 0, - /* 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, - /* a14 - _V_0F_5E */ 0x405f, - /* a15 - _V_66_0F_5E */ 0x4060, - /* a16 - _V_F3_0F_5E */ 0x4061, - /* a17 - _V_F2_0F_5E */ 0x4062, - /* a18 - */ 0, - /* 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, - /* a20 - _V_0F_5F */ 0x4063, - /* a21 - _V_66_0F_5F */ 0x4064, - /* a22 - _V_F3_0F_5F */ 0x4065, - /* a23 - _V_F2_0F_5F */ 0x4066, - /* a24 - */ 0, - /* a25 - */ 0, - /* a26 - */ 0, - /* a27 - */ 0, - /* a28 - _0F_60 */ 0x23d4, - /* a29 - _66_0F_60 */ 0x23d5, - /* a2a - */ 0, - /* a2b - */ 0, - /* a2c - */ 0, - /* a2d - _V_66_0F_60 */ 0x4067, - /* a2e - */ 0, - /* a2f - */ 0, - /* a30 - */ 0, - /* a31 - */ 0, - /* a32 - */ 0, - /* a33 - */ 0, - /* a34 - _0F_61 */ 0x23d6, - /* a35 - _66_0F_61 */ 0x23d7, - /* a36 - */ 0, - /* a37 - */ 0, - /* a38 - */ 0, - /* a39 - _V_66_0F_61 */ 0x4068, - /* a3a - */ 0, - /* a3b - */ 0, - /* a3c - */ 0, - /* a3d - */ 0, - /* a3e - */ 0, - /* a3f - */ 0, - /* a40 - _0F_62 */ 0x23d8, - /* a41 - _66_0F_62 */ 0x23d9, - /* a42 - */ 0, - /* a43 - */ 0, - /* a44 - */ 0, - /* a45 - _V_66_0F_62 */ 0x4069, - /* a46 - */ 0, - /* a47 - */ 0, - /* a48 - */ 0, - /* a49 - */ 0, - /* a4a - */ 0, - /* a4b - */ 0, - /* a4c - _0F_63 */ 0x23da, - /* a4d - _66_0F_63 */ 0x23db, - /* a4e - */ 0, - /* a4f - */ 0, - /* a50 - */ 0, - /* a51 - _V_66_0F_63 */ 0x406a, - /* a52 - */ 0, - /* a53 - */ 0, - /* a54 - */ 0, - /* a55 - */ 0, - /* a56 - */ 0, - /* a57 - */ 0, - /* a58 - _0F_64 */ 0x23dc, - /* a59 - _66_0F_64 */ 0x23dd, - /* a5a - */ 0, - /* a5b - */ 0, - /* a5c - */ 0, - /* a5d - _V_66_0F_64 */ 0x406b, - /* a5e - */ 0, - /* a5f - */ 0, - /* a60 - */ 0, - /* a61 - */ 0, - /* a62 - */ 0, - /* a63 - */ 0, - /* a64 - _0F_65 */ 0x23de, - /* a65 - _66_0F_65 */ 0x23df, - /* a66 - */ 0, - /* a67 - */ 0, - /* a68 - */ 0, - /* a69 - _V_66_0F_65 */ 0x406c, - /* a6a - */ 0, - /* a6b - */ 0, - /* a6c - */ 0, - /* a6d - */ 0, - /* a6e - */ 0, - /* a6f - */ 0, - /* a70 - _0F_66 */ 0x23e0, - /* a71 - _66_0F_66 */ 0x23e1, - /* a72 - */ 0, - /* a73 - */ 0, - /* a74 - */ 0, - /* a75 - _V_66_0F_66 */ 0x406d, - /* a76 - */ 0, - /* a77 - */ 0, - /* a78 - */ 0, - /* a79 - */ 0, - /* a7a - */ 0, - /* a7b - */ 0, - /* a7c - _0F_67 */ 0x23e2, - /* a7d - _66_0F_67 */ 0x23e3, - /* a7e - */ 0, - /* a7f - */ 0, - /* a80 - */ 0, - /* a81 - _V_66_0F_67 */ 0x406e, - /* a82 - */ 0, - /* a83 - */ 0, - /* a84 - */ 0, - /* a85 - */ 0, - /* a86 - */ 0, - /* a87 - */ 0, - /* a88 - _0F_68 */ 0x23e4, - /* a89 - _66_0F_68 */ 0x23e5, - /* a8a - */ 0, - /* a8b - */ 0, - /* a8c - */ 0, - /* a8d - _V_66_0F_68 */ 0x406f, - /* a8e - */ 0, - /* a8f - */ 0, - /* a90 - */ 0, - /* a91 - */ 0, - /* a92 - */ 0, - /* a93 - */ 0, - /* a94 - _0F_69 */ 0x23e6, - /* a95 - _66_0F_69 */ 0x23e7, - /* a96 - */ 0, - /* a97 - */ 0, - /* a98 - */ 0, - /* a99 - _V_66_0F_69 */ 0x4070, - /* a9a - */ 0, - /* a9b - */ 0, - /* a9c - */ 0, - /* a9d - */ 0, - /* a9e - */ 0, - /* a9f - */ 0, - /* aa0 - _0F_6A */ 0x23e8, - /* aa1 - _66_0F_6A */ 0x23e9, - /* aa2 - */ 0, - /* aa3 - */ 0, - /* aa4 - */ 0, - /* aa5 - _V_66_0F_6A */ 0x4071, - /* aa6 - */ 0, - /* aa7 - */ 0, - /* aa8 - */ 0, - /* aa9 - */ 0, - /* aaa - */ 0, - /* aab - */ 0, - /* aac - _0F_6B */ 0x23ea, - /* aad - _66_0F_6B */ 0x23eb, - /* aae - */ 0, - /* aaf - */ 0, - /* ab0 - */ 0, - /* ab1 - _V_66_0F_6B */ 0x4072, - /* ab2 - */ 0, - /* ab3 - */ 0, - /* ab4 - */ 0, - /* ab5 - */ 0, - /* ab6 - */ 0, - /* ab7 - */ 0, - /* ab8 - */ 0, - /* ab9 - _66_0F_6C */ 0x23ec, - /* aba - */ 0, - /* abb - */ 0, - /* abc - */ 0, - /* abd - _V_66_0F_6C */ 0x4073, - /* abe - */ 0, - /* abf - */ 0, - /* ac0 - */ 0, - /* ac1 - */ 0, - /* ac2 - */ 0, - /* ac3 - */ 0, - /* ac4 - */ 0, - /* ac5 - _66_0F_6D */ 0x23ed, - /* ac6 - */ 0, - /* ac7 - */ 0, - /* ac8 - */ 0, - /* ac9 - _V_66_0F_6D */ 0x4074, - /* aca - */ 0, - /* acb - */ 0, - /* acc - */ 0, - /* acd - */ 0, - /* ace - */ 0, - /* acf - */ 0, - /* ad0 - _0F_6E */ 0x4075, - /* ad1 - _66_0F_6E */ 0x4076, - /* ad2 - */ 0, - /* ad3 - */ 0, - /* ad4 - */ 0, - /* ad5 - _V_66_0F_6E */ 0x4077, - /* ad6 - */ 0, - /* ad7 - */ 0, - /* ad8 - */ 0, - /* ad9 - */ 0, - /* ada - */ 0, - /* adb - */ 0, - /* adc - _0F_6F */ 0x23ee, - /* add - _66_0F_6F */ 0x23ef, - /* ade - _F3_0F_6F */ 0x23f0, - /* adf - */ 0, - /* ae0 - */ 0, - /* ae1 - _V_66_0F_6F */ 0x4078, - /* ae2 - _V_F3_0F_6F */ 0x4079, - /* ae3 - */ 0, - /* ae4 - */ 0, - /* ae5 - */ 0, - /* ae6 - */ 0, - /* ae7 - */ 0, - /* ae8 - _0F_70 */ 0x407a, - /* ae9 - _66_0F_70 */ 0x407b, - /* aea - _F3_0F_70 */ 0x407c, - /* aeb - _F2_0F_70 */ 0x407d, - /* aec - */ 0, - /* aed - _V_66_0F_70 */ 0x407e, - /* aee - _V_F3_0F_70 */ 0x407f, - /* aef - _V_F2_0F_70 */ 0x4080, - /* af0 - */ 0, - /* af1 - */ 0, - /* af2 - */ 0, - /* af3 - */ 0, - /* af4 - */ 0, - /* af5 - */ 0, - /* af6 - _0F_71_02 */ 0xd584, - /* af7 - */ 0, - /* af8 - _0F_71_04 */ 0xd590, - /* af9 - */ 0, - /* afa - _0F_71_06 */ 0xd59c, - /* afb - */ 0, - /* afc - */ 0, - /* afd - */ 0, - /* afe - _0F_72_02 */ 0xd5a8, - /* aff - */ 0, - /* b00 - _0F_72_04 */ 0xd5b4, - /* b01 - */ 0, - /* b02 - _0F_72_06 */ 0xd5c0, - /* b03 - */ 0, - /* b04 - */ 0, - /* b05 - */ 0, - /* b06 - _0F_73_02 */ 0xd5cc, - /* b07 - _0F_73_03 */ 0xd5d8, - /* b08 - */ 0, - /* b09 - */ 0, - /* b0a - _0F_73_06 */ 0xd5e4, - /* b0b - _0F_73_07 */ 0xd5f0, - /* b0c - _0F_74 */ 0x23f1, - /* b0d - _66_0F_74 */ 0x23f2, - /* b0e - */ 0, - /* b0f - */ 0, - /* b10 - */ 0, - /* b11 - _V_66_0F_74 */ 0x4081, - /* b12 - */ 0, - /* b13 - */ 0, - /* b14 - */ 0, - /* b15 - */ 0, - /* b16 - */ 0, - /* b17 - */ 0, - /* b18 - _0F_75 */ 0x23f3, - /* b19 - _66_0F_75 */ 0x23f4, - /* b1a - */ 0, - /* b1b - */ 0, - /* b1c - */ 0, - /* b1d - _V_66_0F_75 */ 0x4082, - /* b1e - */ 0, - /* b1f - */ 0, - /* b20 - */ 0, - /* b21 - */ 0, - /* b22 - */ 0, - /* b23 - */ 0, - /* b24 - _0F_76 */ 0x23f5, - /* b25 - _66_0F_76 */ 0x23f6, - /* b26 - */ 0, - /* b27 - */ 0, - /* b28 - */ 0, - /* b29 - _V_66_0F_76 */ 0x4083, - /* b2a - */ 0, - /* b2b - */ 0, - /* b2c - */ 0, - /* b2d - */ 0, - /* b2e - */ 0, - /* b2f - */ 0, - /* b30 - _0F_77 */ 0x23f7, - /* b31 - */ 0, - /* b32 - */ 0, - /* b33 - */ 0, - /* b34 - _V_0F_77 */ 0x4084, - /* b35 - */ 0, - /* b36 - */ 0, - /* b37 - */ 0, - /* b38 - */ 0, - /* b39 - */ 0, - /* b3a - */ 0, - /* b3b - */ 0, - /* b3c - _0F_78 */ 0x23f8, - /* b3d - _66_0F_78 */ 0x4085, - /* b3e - */ 0, - /* b3f - _F2_0F_78 */ 0x4086, - /* b40 - */ 0, - /* b41 - */ 0, - /* b42 - */ 0, - /* b43 - */ 0, - /* b44 - */ 0, - /* b45 - */ 0, - /* b46 - */ 0, - /* b47 - */ 0, - /* b48 - _0F_79 */ 0x23f9, - /* b49 - _66_0F_79 */ 0x23fa, - /* b4a - */ 0, - /* b4b - _F2_0F_79 */ 0x23fb, - /* b4c - */ 0, - /* b4d - */ 0, - /* b4e - */ 0, - /* b4f - */ 0, - /* b50 - */ 0, - /* b51 - */ 0, - /* b52 - */ 0, - /* b53 - */ 0, - /* b54 - */ 0, - /* b55 - */ 0, - /* b56 - */ 0, - /* b57 - */ 0, - /* b58 - */ 0, - /* b59 - */ 0, - /* b5a - */ 0, - /* b5b - */ 0, - /* b5c - */ 0, - /* b5d - */ 0, - /* b5e - */ 0, - /* b5f - */ 0, - /* b60 - */ 0, - /* b61 - */ 0, - /* b62 - */ 0, - /* b63 - */ 0, - /* b64 - */ 0, - /* b65 - */ 0, - /* b66 - */ 0, - /* b67 - */ 0, - /* b68 - */ 0, - /* b69 - */ 0, - /* b6a - */ 0, - /* b6b - */ 0, - /* b6c - */ 0, - /* b6d - */ 0, - /* b6e - */ 0, - /* b6f - */ 0, - /* b70 - */ 0, - /* b71 - */ 0, - /* b72 - */ 0, - /* b73 - */ 0, - /* b74 - */ 0, - /* b75 - */ 0, - /* b76 - */ 0, - /* b77 - */ 0, - /* b78 - */ 0, - /* b79 - */ 0, - /* b7a - */ 0, - /* b7b - */ 0, - /* b7c - */ 0, - /* b7d - */ 0, - /* b7e - */ 0, - /* b7f - */ 0, - /* b80 - */ 0, - /* b81 - */ 0, - /* b82 - */ 0, - /* b83 - */ 0, - /* b84 - _0F_7A_30 */ 0x23fc, - /* b85 - _0F_7A_31 */ 0x23fd, - /* b86 - */ 0, - /* b87 - */ 0, - /* b88 - */ 0, - /* b89 - */ 0, - /* b8a - */ 0, - /* b8b - */ 0, - /* b8c - */ 0, - /* b8d - */ 0, - /* b8e - */ 0, - /* b8f - */ 0, - /* b90 - */ 0, - /* b91 - */ 0, - /* b92 - */ 0, - /* b93 - */ 0, - /* b94 - */ 0, - /* b95 - */ 0, - /* b96 - */ 0, - /* b97 - */ 0, - /* b98 - */ 0, - /* b99 - */ 0, - /* b9a - */ 0, - /* b9b - */ 0, - /* b9c - */ 0, - /* b9d - */ 0, - /* b9e - */ 0, - /* b9f - */ 0, - /* ba0 - */ 0, - /* ba1 - */ 0, - /* ba2 - */ 0, - /* ba3 - */ 0, - /* ba4 - */ 0, - /* ba5 - */ 0, - /* ba6 - */ 0, - /* ba7 - */ 0, - /* ba8 - */ 0, - /* ba9 - */ 0, - /* baa - */ 0, - /* bab - */ 0, - /* bac - */ 0, - /* bad - */ 0, - /* bae - */ 0, - /* baf - */ 0, - /* bb0 - */ 0, - /* bb1 - */ 0, - /* bb2 - */ 0, - /* bb3 - */ 0, - /* bb4 - */ 0, - /* bb5 - */ 0, - /* bb6 - */ 0, - /* bb7 - */ 0, - /* bb8 - */ 0, - /* bb9 - */ 0, - /* bba - */ 0, - /* bbb - */ 0, - /* bbc - */ 0, - /* bbd - */ 0, - /* bbe - */ 0, - /* bbf - */ 0, - /* bc0 - */ 0, - /* bc1 - */ 0, - /* bc2 - */ 0, - /* bc3 - */ 0, - /* bc4 - */ 0, - /* bc5 - */ 0, - /* bc6 - */ 0, - /* bc7 - */ 0, - /* bc8 - */ 0, - /* bc9 - */ 0, - /* bca - */ 0, - /* bcb - */ 0, - /* bcc - */ 0, - /* bcd - */ 0, - /* bce - */ 0, - /* bcf - */ 0, - /* bd0 - */ 0, - /* bd1 - */ 0, - /* bd2 - */ 0, - /* bd3 - */ 0, - /* bd4 - */ 0, - /* bd5 - */ 0, - /* bd6 - */ 0, - /* bd7 - */ 0, - /* bd8 - */ 0, - /* bd9 - */ 0, - /* bda - */ 0, - /* bdb - */ 0, - /* bdc - */ 0, - /* bdd - */ 0, - /* bde - */ 0, - /* bdf - */ 0, - /* be0 - */ 0, - /* be1 - */ 0, - /* be2 - */ 0, - /* be3 - */ 0, - /* be4 - */ 0, - /* be5 - */ 0, - /* be6 - */ 0, - /* be7 - */ 0, - /* be8 - */ 0, - /* be9 - */ 0, - /* bea - */ 0, - /* beb - */ 0, - /* bec - */ 0, - /* bed - */ 0, - /* bee - */ 0, - /* bef - */ 0, - /* bf0 - */ 0, - /* bf1 - */ 0, - /* bf2 - */ 0, - /* bf3 - */ 0, - /* bf4 - */ 0, - /* bf5 - */ 0, - /* bf6 - */ 0, - /* bf7 - */ 0, - /* bf8 - */ 0, - /* bf9 - */ 0, - /* bfa - */ 0, - /* bfb - */ 0, - /* bfc - */ 0, - /* bfd - */ 0, - /* bfe - */ 0, - /* bff - */ 0, - /* c00 - */ 0, - /* c01 - */ 0, - /* c02 - */ 0, - /* c03 - */ 0, - /* c04 - */ 0, - /* c05 - */ 0, - /* c06 - */ 0, - /* c07 - */ 0, - /* c08 - */ 0, - /* c09 - */ 0, - /* c0a - */ 0, - /* c0b - */ 0, - /* c0c - */ 0, - /* c0d - */ 0, - /* c0e - */ 0, - /* c0f - */ 0, - /* c10 - */ 0, - /* c11 - */ 0, - /* c12 - */ 0, - /* c13 - */ 0, - /* c14 - */ 0, - /* c15 - */ 0, - /* c16 - */ 0, - /* c17 - */ 0, - /* c18 - */ 0, - /* c19 - */ 0, - /* c1a - */ 0, - /* c1b - */ 0, - /* c1c - */ 0, - /* c1d - */ 0, - /* c1e - */ 0, - /* c1f - */ 0, - /* c20 - */ 0, - /* c21 - */ 0, - /* c22 - */ 0, - /* c23 - */ 0, - /* c24 - */ 0, - /* c25 - */ 0, - /* c26 - */ 0, - /* c27 - */ 0, - /* c28 - */ 0, - /* c29 - */ 0, - /* c2a - */ 0, - /* c2b - */ 0, - /* c2c - */ 0, - /* c2d - */ 0, - /* c2e - */ 0, - /* c2f - */ 0, - /* c30 - */ 0, - /* c31 - */ 0, - /* c32 - */ 0, - /* c33 - */ 0, - /* c34 - */ 0, - /* c35 - */ 0, - /* c36 - */ 0, - /* c37 - */ 0, - /* c38 - */ 0, - /* c39 - */ 0, - /* c3a - */ 0, - /* c3b - */ 0, - /* c3c - */ 0, - /* c3d - */ 0, - /* c3e - */ 0, - /* c3f - */ 0, - /* c40 - */ 0, - /* c41 - */ 0, - /* c42 - */ 0, - /* c43 - */ 0, - /* c44 - */ 0, - /* c45 - */ 0, - /* c46 - */ 0, - /* c47 - */ 0, - /* c48 - */ 0, - /* c49 - */ 0, - /* c4a - */ 0, - /* c4b - */ 0, - /* c4c - */ 0, - /* c4d - */ 0, - /* c4e - */ 0, - /* c4f - */ 0, - /* c50 - */ 0, - /* c51 - */ 0, - /* c52 - */ 0, - /* c53 - */ 0, - /* c54 - */ 0, - /* c55 - _66_0F_7C */ 0x23fe, - /* c56 - */ 0, - /* c57 - _F2_0F_7C */ 0x23ff, - /* c58 - */ 0, - /* c59 - _V_66_0F_7C */ 0x4087, - /* c5a - */ 0, - /* c5b - _V_F2_0F_7C */ 0x4088, - /* c5c - */ 0, - /* c5d - */ 0, - /* c5e - */ 0, - /* c5f - */ 0, - /* c60 - */ 0, - /* c61 - _66_0F_7D */ 0x2400, - /* c62 - */ 0, - /* c63 - _F2_0F_7D */ 0x2401, - /* c64 - */ 0, - /* c65 - _V_66_0F_7D */ 0x4089, - /* c66 - */ 0, - /* c67 - _V_F2_0F_7D */ 0x408a, - /* c68 - */ 0, - /* c69 - */ 0, - /* c6a - */ 0, - /* c6b - */ 0, - /* c6c - _0F_7E */ 0x408b, - /* c6d - _66_0F_7E */ 0x408c, - /* c6e - _F3_0F_7E */ 0x2402, - /* c6f - */ 0, - /* c70 - */ 0, - /* c71 - _V_66_0F_7E */ 0x408d, - /* c72 - _V_F3_0F_7E */ 0x408e, - /* c73 - */ 0, - /* c74 - */ 0, - /* c75 - */ 0, - /* c76 - */ 0, - /* c77 - */ 0, - /* c78 - _0F_7F */ 0x2403, - /* c79 - _66_0F_7F */ 0x2404, - /* c7a - _F3_0F_7F */ 0x2405, - /* c7b - */ 0, - /* c7c - */ 0, - /* c7d - _V_66_0F_7F */ 0x408f, - /* c7e - _V_F3_0F_7F */ 0x4090, - /* c7f - */ 0, - /* c80 - */ 0, - /* 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, - /* 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, - /* c8f - */ 0, - /* c90 - */ 0, - /* c91 - */ 0, - /* c92 - */ 0, - /* c93 - */ 0, - /* c94 - */ 0, - /* c95 - */ 0, - /* c96 - */ 0, - /* c97 - */ 0, - /* c98 - */ 0, - /* 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, - /* ca1 - */ 0, - /* ca2 - _F3_0F_BC */ 0x240c, - /* ca3 - */ 0, - /* ca4 - */ 0, - /* ca5 - */ 0, - /* ca6 - */ 0, - /* ca7 - */ 0, - /* ca8 - */ 0, - /* ca9 - */ 0, - /* caa - */ 0, - /* cab - */ 0, - /* cac - _0F_BD */ 0x240d, - /* cad - */ 0, - /* cae - _F3_0F_BD */ 0x240e, - /* caf - */ 0, - /* cb0 - */ 0, - /* cb1 - */ 0, - /* cb2 - */ 0, - /* cb3 - */ 0, - /* cb4 - */ 0, - /* cb5 - */ 0, - /* cb6 - */ 0, - /* cb7 - */ 0, - /* cb8 - _0F_C2 */ 0x4095, - /* cb9 - _66_0F_C2 */ 0x4096, - /* cba - _F3_0F_C2 */ 0x4097, - /* cbb - _F2_0F_C2 */ 0x4098, - /* cbc - _V_0F_C2 */ 0x4099, - /* cbd - _V_66_0F_C2 */ 0x409a, - /* cbe - _V_F3_0F_C2 */ 0x409b, - /* cbf - _V_F2_0F_C2 */ 0x409c, - /* cc0 - */ 0, - /* cc1 - */ 0, - /* cc2 - */ 0, - /* cc3 - */ 0, - /* cc4 - _0F_C4 */ 0x409d, - /* cc5 - _66_0F_C4 */ 0x409e, - /* cc6 - */ 0, - /* cc7 - */ 0, - /* cc8 - */ 0, - /* cc9 - _V_66_0F_C4 */ 0x409f, - /* cca - */ 0, - /* ccb - */ 0, - /* ccc - */ 0, - /* ccd - */ 0, - /* cce - */ 0, - /* ccf - */ 0, - /* cd0 - _0F_C5 */ 0x40a0, - /* cd1 - _66_0F_C5 */ 0x40a1, - /* cd2 - */ 0, - /* cd3 - */ 0, - /* cd4 - */ 0, - /* cd5 - _V_66_0F_C5 */ 0x40a2, - /* cd6 - */ 0, - /* cd7 - */ 0, - /* cd8 - */ 0, - /* cd9 - */ 0, - /* cda - */ 0, - /* cdb - */ 0, - /* cdc - _0F_C6 */ 0x40a3, - /* cdd - _66_0F_C6 */ 0x40a4, - /* cde - */ 0, - /* cdf - */ 0, - /* ce0 - _V_0F_C6 */ 0x40a5, - /* ce1 - _V_66_0F_C6 */ 0x40a6, - /* ce2 - */ 0, - /* ce3 - */ 0, - /* ce4 - */ 0, - /* ce5 - */ 0, - /* ce6 - */ 0, - /* ce7 - */ 0, - /* ce8 - */ 0, - /* ce9 - _0F_C7_01 */ 0x40a7, - /* cea - */ 0, - /* ceb - */ 0, - /* cec - */ 0, - /* ced - */ 0, - /* cee - _0F_C7_06 */ 0xd62c, - /* cef - _0F_C7_07 */ 0x240f, - /* cf0 - */ 0, - /* cf1 - _66_0F_D0 */ 0x2410, - /* cf2 - */ 0, - /* cf3 - _F2_0F_D0 */ 0x2411, - /* cf4 - */ 0, - /* cf5 - _V_66_0F_D0 */ 0x40a8, - /* cf6 - */ 0, - /* cf7 - _V_F2_0F_D0 */ 0x40a9, - /* cf8 - */ 0, - /* cf9 - */ 0, - /* cfa - */ 0, - /* cfb - */ 0, - /* cfc - _0F_D1 */ 0x2412, - /* cfd - _66_0F_D1 */ 0x2413, - /* cfe - */ 0, - /* cff - */ 0, - /* d00 - */ 0, - /* d01 - _V_66_0F_D1 */ 0x40aa, - /* d02 - */ 0, - /* d03 - */ 0, - /* d04 - */ 0, - /* d05 - */ 0, - /* d06 - */ 0, - /* d07 - */ 0, - /* d08 - _0F_D2 */ 0x2414, - /* d09 - _66_0F_D2 */ 0x2415, - /* d0a - */ 0, - /* d0b - */ 0, - /* d0c - */ 0, - /* d0d - _V_66_0F_D2 */ 0x40ab, - /* d0e - */ 0, - /* d0f - */ 0, - /* d10 - */ 0, - /* d11 - */ 0, - /* d12 - */ 0, - /* d13 - */ 0, - /* d14 - _0F_D3 */ 0x2416, - /* d15 - _66_0F_D3 */ 0x2417, - /* d16 - */ 0, - /* d17 - */ 0, - /* d18 - */ 0, - /* d19 - _V_66_0F_D3 */ 0x40ac, - /* d1a - */ 0, - /* d1b - */ 0, - /* d1c - */ 0, - /* d1d - */ 0, - /* d1e - */ 0, - /* d1f - */ 0, - /* d20 - _0F_D4 */ 0x2418, - /* d21 - _66_0F_D4 */ 0x2419, - /* d22 - */ 0, - /* d23 - */ 0, - /* d24 - */ 0, - /* d25 - _V_66_0F_D4 */ 0x40ad, - /* d26 - */ 0, - /* d27 - */ 0, - /* d28 - */ 0, - /* d29 - */ 0, - /* d2a - */ 0, - /* d2b - */ 0, - /* d2c - _0F_D5 */ 0x241a, - /* d2d - _66_0F_D5 */ 0x241b, - /* d2e - */ 0, - /* d2f - */ 0, - /* d30 - */ 0, - /* d31 - _V_66_0F_D5 */ 0x40ae, - /* d32 - */ 0, - /* d33 - */ 0, - /* d34 - */ 0, - /* d35 - */ 0, - /* d36 - */ 0, - /* d37 - */ 0, - /* d38 - */ 0, - /* d39 - _66_0F_D6 */ 0x241c, - /* d3a - _F3_0F_D6 */ 0x241d, - /* d3b - _F2_0F_D6 */ 0x241e, - /* d3c - */ 0, - /* d3d - _V_66_0F_D6 */ 0x40af, - /* d3e - */ 0, - /* d3f - */ 0, - /* d40 - */ 0, - /* d41 - */ 0, - /* d42 - */ 0, - /* d43 - */ 0, - /* d44 - _0F_D7 */ 0x241f, - /* d45 - _66_0F_D7 */ 0x2420, - /* d46 - */ 0, - /* d47 - */ 0, - /* d48 - */ 0, - /* d49 - _V_66_0F_D7 */ 0x40b0, - /* d4a - */ 0, - /* d4b - */ 0, - /* d4c - */ 0, - /* d4d - */ 0, - /* d4e - */ 0, - /* d4f - */ 0, - /* d50 - _0F_D8 */ 0x2421, - /* d51 - _66_0F_D8 */ 0x2422, - /* d52 - */ 0, - /* d53 - */ 0, - /* d54 - */ 0, - /* d55 - _V_66_0F_D8 */ 0x40b1, - /* d56 - */ 0, - /* d57 - */ 0, - /* d58 - */ 0, - /* d59 - */ 0, - /* d5a - */ 0, - /* d5b - */ 0, - /* d5c - _0F_D9 */ 0x2423, - /* d5d - _66_0F_D9 */ 0x2424, - /* d5e - */ 0, - /* d5f - */ 0, - /* d60 - */ 0, - /* d61 - _V_66_0F_D9 */ 0x40b2, - /* d62 - */ 0, - /* d63 - */ 0, - /* d64 - */ 0, - /* d65 - */ 0, - /* d66 - */ 0, - /* d67 - */ 0, - /* d68 - _0F_DA */ 0x2425, - /* d69 - _66_0F_DA */ 0x2426, - /* d6a - */ 0, - /* d6b - */ 0, - /* d6c - */ 0, - /* d6d - _V_66_0F_DA */ 0x40b3, - /* d6e - */ 0, - /* d6f - */ 0, - /* d70 - */ 0, - /* d71 - */ 0, - /* d72 - */ 0, - /* d73 - */ 0, - /* d74 - _0F_DB */ 0x2427, - /* d75 - _66_0F_DB */ 0x2428, - /* d76 - */ 0, - /* d77 - */ 0, - /* d78 - */ 0, - /* d79 - _V_66_0F_DB */ 0x40b4, - /* d7a - */ 0, - /* d7b - */ 0, - /* d7c - */ 0, - /* d7d - */ 0, - /* d7e - */ 0, - /* d7f - */ 0, - /* d80 - _0F_DC */ 0x2429, - /* d81 - _66_0F_DC */ 0x242a, - /* d82 - */ 0, - /* d83 - */ 0, - /* d84 - */ 0, - /* d85 - _V_66_0F_DC */ 0x40b5, - /* d86 - */ 0, - /* d87 - */ 0, - /* d88 - */ 0, - /* d89 - */ 0, - /* d8a - */ 0, - /* d8b - */ 0, - /* d8c - _0F_DD */ 0x242b, - /* d8d - _66_0F_DD */ 0x242c, - /* d8e - */ 0, - /* d8f - */ 0, - /* d90 - */ 0, - /* d91 - _V_66_0F_DD */ 0x40b6, - /* d92 - */ 0, - /* d93 - */ 0, - /* d94 - */ 0, - /* d95 - */ 0, - /* d96 - */ 0, - /* d97 - */ 0, - /* d98 - _0F_DE */ 0x242d, - /* d99 - _66_0F_DE */ 0x242e, - /* d9a - */ 0, - /* d9b - */ 0, - /* d9c - */ 0, - /* d9d - _V_66_0F_DE */ 0x40b7, - /* d9e - */ 0, - /* d9f - */ 0, - /* da0 - */ 0, - /* da1 - */ 0, - /* da2 - */ 0, - /* da3 - */ 0, - /* da4 - _0F_DF */ 0x242f, - /* da5 - _66_0F_DF */ 0x2430, - /* da6 - */ 0, - /* da7 - */ 0, - /* da8 - */ 0, - /* da9 - _V_66_0F_DF */ 0x40b8, - /* daa - */ 0, - /* dab - */ 0, - /* dac - */ 0, - /* dad - */ 0, - /* dae - */ 0, - /* daf - */ 0, - /* db0 - _0F_E0 */ 0x2431, - /* db1 - _66_0F_E0 */ 0x2432, - /* db2 - */ 0, - /* db3 - */ 0, - /* db4 - */ 0, - /* db5 - _V_66_0F_E0 */ 0x40b9, - /* db6 - */ 0, - /* db7 - */ 0, - /* db8 - */ 0, - /* db9 - */ 0, - /* dba - */ 0, - /* dbb - */ 0, - /* dbc - _0F_E1 */ 0x2433, - /* dbd - _66_0F_E1 */ 0x2434, - /* dbe - */ 0, - /* dbf - */ 0, - /* dc0 - */ 0, - /* dc1 - _V_66_0F_E1 */ 0x40ba, - /* dc2 - */ 0, - /* dc3 - */ 0, - /* dc4 - */ 0, - /* dc5 - */ 0, - /* dc6 - */ 0, - /* dc7 - */ 0, - /* dc8 - _0F_E2 */ 0x2435, - /* dc9 - _66_0F_E2 */ 0x2436, - /* dca - */ 0, - /* dcb - */ 0, - /* dcc - */ 0, - /* dcd - _V_66_0F_E2 */ 0x40bb, - /* dce - */ 0, - /* dcf - */ 0, - /* dd0 - */ 0, - /* dd1 - */ 0, - /* dd2 - */ 0, - /* dd3 - */ 0, - /* dd4 - _0F_E3 */ 0x2437, - /* dd5 - _66_0F_E3 */ 0x2438, - /* dd6 - */ 0, - /* dd7 - */ 0, - /* dd8 - */ 0, - /* dd9 - _V_66_0F_E3 */ 0x40bc, - /* dda - */ 0, - /* ddb - */ 0, - /* ddc - */ 0, - /* ddd - */ 0, - /* dde - */ 0, - /* ddf - */ 0, - /* de0 - _0F_E4 */ 0x2439, - /* de1 - _66_0F_E4 */ 0x243a, - /* de2 - */ 0, - /* de3 - */ 0, - /* de4 - */ 0, - /* de5 - _V_66_0F_E4 */ 0x40bd, - /* de6 - */ 0, - /* de7 - */ 0, - /* de8 - */ 0, - /* de9 - */ 0, - /* dea - */ 0, - /* deb - */ 0, - /* dec - _0F_E5 */ 0x243b, - /* ded - _66_0F_E5 */ 0x243c, - /* dee - */ 0, - /* def - */ 0, - /* df0 - */ 0, - /* df1 - _V_66_0F_E5 */ 0x40be, - /* df2 - */ 0, - /* df3 - */ 0, - /* df4 - */ 0, - /* df5 - */ 0, - /* df6 - */ 0, - /* df7 - */ 0, - /* df8 - */ 0, - /* df9 - _66_0F_E6 */ 0x243d, - /* dfa - _F3_0F_E6 */ 0x243e, - /* dfb - _F2_0F_E6 */ 0x243f, - /* dfc - */ 0, - /* dfd - _V_66_0F_E6 */ 0x40bf, - /* dfe - _V_F3_0F_E6 */ 0x40c0, - /* dff - _V_F2_0F_E6 */ 0x40c1, - /* e00 - */ 0, - /* e01 - */ 0, - /* e02 - */ 0, - /* e03 - */ 0, - /* e04 - _0F_E7 */ 0x2440, - /* e05 - _66_0F_E7 */ 0x2441, - /* e06 - */ 0, - /* e07 - */ 0, - /* e08 - */ 0, - /* e09 - _V_66_0F_E7 */ 0x40c2, - /* e0a - */ 0, - /* e0b - */ 0, - /* e0c - */ 0, - /* e0d - */ 0, - /* e0e - */ 0, - /* e0f - */ 0, - /* e10 - _0F_E8 */ 0x2442, - /* e11 - _66_0F_E8 */ 0x2443, - /* e12 - */ 0, - /* e13 - */ 0, - /* e14 - */ 0, - /* e15 - _V_66_0F_E8 */ 0x40c3, - /* e16 - */ 0, - /* e17 - */ 0, - /* e18 - */ 0, - /* e19 - */ 0, - /* e1a - */ 0, - /* e1b - */ 0, - /* e1c - _0F_E9 */ 0x2444, - /* e1d - _66_0F_E9 */ 0x2445, - /* e1e - */ 0, - /* e1f - */ 0, - /* e20 - */ 0, - /* e21 - _V_66_0F_E9 */ 0x40c4, - /* e22 - */ 0, - /* e23 - */ 0, - /* e24 - */ 0, - /* e25 - */ 0, - /* e26 - */ 0, - /* e27 - */ 0, - /* e28 - _0F_EA */ 0x2446, - /* e29 - _66_0F_EA */ 0x2447, - /* e2a - */ 0, - /* e2b - */ 0, - /* e2c - */ 0, - /* e2d - _V_66_0F_EA */ 0x40c5, - /* e2e - */ 0, - /* e2f - */ 0, - /* e30 - */ 0, - /* e31 - */ 0, - /* e32 - */ 0, - /* e33 - */ 0, - /* e34 - _0F_EB */ 0x2448, - /* e35 - _66_0F_EB */ 0x2449, - /* e36 - */ 0, - /* e37 - */ 0, - /* e38 - */ 0, - /* e39 - _V_66_0F_EB */ 0x40c6, - /* e3a - */ 0, - /* e3b - */ 0, - /* e3c - */ 0, - /* e3d - */ 0, - /* e3e - */ 0, - /* e3f - */ 0, - /* e40 - _0F_EC */ 0x244a, - /* e41 - _66_0F_EC */ 0x244b, - /* e42 - */ 0, - /* e43 - */ 0, - /* e44 - */ 0, - /* e45 - _V_66_0F_EC */ 0x40c7, - /* e46 - */ 0, - /* e47 - */ 0, - /* e48 - */ 0, - /* e49 - */ 0, - /* e4a - */ 0, - /* e4b - */ 0, - /* e4c - _0F_ED */ 0x244c, - /* e4d - _66_0F_ED */ 0x244d, - /* e4e - */ 0, - /* e4f - */ 0, - /* e50 - */ 0, - /* e51 - _V_66_0F_ED */ 0x40c8, - /* e52 - */ 0, - /* e53 - */ 0, - /* e54 - */ 0, - /* e55 - */ 0, - /* e56 - */ 0, - /* e57 - */ 0, - /* e58 - _0F_EE */ 0x244e, - /* e59 - _66_0F_EE */ 0x244f, - /* e5a - */ 0, - /* e5b - */ 0, - /* e5c - */ 0, - /* e5d - _V_66_0F_EE */ 0x40c9, - /* e5e - */ 0, - /* e5f - */ 0, - /* e60 - */ 0, - /* e61 - */ 0, - /* e62 - */ 0, - /* e63 - */ 0, - /* e64 - _0F_EF */ 0x2450, - /* e65 - _66_0F_EF */ 0x2451, - /* e66 - */ 0, - /* e67 - */ 0, - /* e68 - */ 0, - /* e69 - _V_66_0F_EF */ 0x40ca, - /* e6a - */ 0, - /* e6b - */ 0, - /* e6c - */ 0, - /* e6d - */ 0, - /* e6e - */ 0, - /* e6f - */ 0, - /* e70 - */ 0, - /* e71 - */ 0, - /* e72 - */ 0, - /* e73 - _F2_0F_F0 */ 0x2452, - /* e74 - */ 0, - /* e75 - */ 0, - /* e76 - */ 0, - /* e77 - _V_F2_0F_F0 */ 0x40cb, - /* e78 - */ 0, - /* e79 - */ 0, - /* e7a - */ 0, - /* e7b - */ 0, - /* e7c - _0F_F1 */ 0x2453, - /* e7d - _66_0F_F1 */ 0x2454, - /* e7e - */ 0, - /* e7f - */ 0, - /* e80 - */ 0, - /* e81 - _V_66_0F_F1 */ 0x40cc, - /* e82 - */ 0, - /* e83 - */ 0, - /* e84 - */ 0, - /* e85 - */ 0, - /* e86 - */ 0, - /* e87 - */ 0, - /* e88 - _0F_F2 */ 0x2455, - /* e89 - _66_0F_F2 */ 0x2456, - /* e8a - */ 0, - /* e8b - */ 0, - /* e8c - */ 0, - /* e8d - _V_66_0F_F2 */ 0x40cd, - /* e8e - */ 0, - /* e8f - */ 0, - /* e90 - */ 0, - /* e91 - */ 0, - /* e92 - */ 0, - /* e93 - */ 0, - /* e94 - _0F_F3 */ 0x2457, - /* e95 - _66_0F_F3 */ 0x2458, - /* e96 - */ 0, - /* e97 - */ 0, - /* e98 - */ 0, - /* e99 - _V_66_0F_F3 */ 0x40ce, - /* e9a - */ 0, - /* e9b - */ 0, - /* e9c - */ 0, - /* e9d - */ 0, - /* e9e - */ 0, - /* e9f - */ 0, - /* ea0 - _0F_F4 */ 0x2459, - /* ea1 - _66_0F_F4 */ 0x245a, - /* ea2 - */ 0, - /* ea3 - */ 0, - /* ea4 - */ 0, - /* ea5 - _V_66_0F_F4 */ 0x40cf, - /* ea6 - */ 0, - /* ea7 - */ 0, - /* ea8 - */ 0, - /* ea9 - */ 0, - /* eaa - */ 0, - /* eab - */ 0, - /* eac - _0F_F5 */ 0x245b, - /* ead - _66_0F_F5 */ 0x245c, - /* eae - */ 0, - /* eaf - */ 0, - /* eb0 - */ 0, - /* eb1 - _V_66_0F_F5 */ 0x40d0, - /* eb2 - */ 0, - /* eb3 - */ 0, - /* eb4 - */ 0, - /* eb5 - */ 0, - /* eb6 - */ 0, - /* eb7 - */ 0, - /* eb8 - _0F_F6 */ 0x245d, - /* eb9 - _66_0F_F6 */ 0x245e, - /* eba - */ 0, - /* ebb - */ 0, - /* ebc - */ 0, - /* ebd - _V_66_0F_F6 */ 0x40d1, - /* ebe - */ 0, - /* ebf - */ 0, - /* ec0 - */ 0, - /* ec1 - */ 0, - /* ec2 - */ 0, - /* ec3 - */ 0, - /* ec4 - _0F_F7 */ 0x245f, - /* ec5 - _66_0F_F7 */ 0x2460, - /* ec6 - */ 0, - /* ec7 - */ 0, - /* ec8 - */ 0, - /* ec9 - _V_66_0F_F7 */ 0x40d2, - /* eca - */ 0, - /* ecb - */ 0, - /* ecc - */ 0, - /* ecd - */ 0, - /* ece - */ 0, - /* ecf - */ 0, - /* ed0 - _0F_F8 */ 0x2461, - /* ed1 - _66_0F_F8 */ 0x2462, - /* ed2 - */ 0, - /* ed3 - */ 0, - /* ed4 - */ 0, - /* ed5 - _V_66_0F_F8 */ 0x40d3, - /* ed6 - */ 0, - /* ed7 - */ 0, - /* ed8 - */ 0, - /* ed9 - */ 0, - /* eda - */ 0, - /* edb - */ 0, - /* edc - _0F_F9 */ 0x2463, - /* edd - _66_0F_F9 */ 0x2464, - /* ede - */ 0, - /* edf - */ 0, - /* ee0 - */ 0, - /* ee1 - _V_66_0F_F9 */ 0x40d4, - /* ee2 - */ 0, - /* ee3 - */ 0, - /* ee4 - */ 0, - /* ee5 - */ 0, - /* ee6 - */ 0, - /* ee7 - */ 0, - /* ee8 - _0F_FA */ 0x2465, - /* ee9 - _66_0F_FA */ 0x2466, - /* eea - */ 0, - /* eeb - */ 0, - /* eec - */ 0, - /* eed - _V_66_0F_FA */ 0x40d5, - /* eee - */ 0, - /* eef - */ 0, - /* ef0 - */ 0, - /* ef1 - */ 0, - /* ef2 - */ 0, - /* ef3 - */ 0, - /* ef4 - _0F_FB */ 0x2467, - /* ef5 - _66_0F_FB */ 0x2468, - /* ef6 - */ 0, - /* ef7 - */ 0, - /* ef8 - */ 0, - /* ef9 - _V_66_0F_FB */ 0x40d6, - /* efa - */ 0, - /* efb - */ 0, - /* efc - */ 0, - /* efd - */ 0, - /* efe - */ 0, - /* eff - */ 0, - /* f00 - _0F_FC */ 0x2469, - /* f01 - _66_0F_FC */ 0x246a, - /* f02 - */ 0, - /* f03 - */ 0, - /* f04 - */ 0, - /* f05 - _V_66_0F_FC */ 0x40d7, - /* f06 - */ 0, - /* f07 - */ 0, - /* f08 - */ 0, - /* f09 - */ 0, - /* f0a - */ 0, - /* f0b - */ 0, - /* f0c - _0F_FD */ 0x246b, - /* f0d - _66_0F_FD */ 0x246c, - /* f0e - */ 0, - /* f0f - */ 0, - /* f10 - */ 0, - /* f11 - _V_66_0F_FD */ 0x40d8, - /* f12 - */ 0, - /* f13 - */ 0, - /* f14 - */ 0, - /* f15 - */ 0, - /* f16 - */ 0, - /* f17 - */ 0, - /* f18 - _0F_FE */ 0x246d, - /* f19 - _66_0F_FE */ 0x246e, - /* f1a - */ 0, - /* f1b - */ 0, - /* f1c - */ 0, - /* f1d - _V_66_0F_FE */ 0x40d9, - /* f1e - */ 0, - /* f1f - */ 0, - /* f20 - */ 0, - /* f21 - */ 0, - /* f22 - */ 0, - /* f23 - */ 0, - /* f24 - _D9_06 */ 0x246f, - /* f25 - _9B_D9_06 */ 0x2470, - /* f26 - */ 0, - /* f27 - */ 0, - /* f28 - */ 0, - /* f29 - */ 0, - /* f2a - */ 0, - /* f2b - */ 0, - /* f2c - */ 0, - /* f2d - */ 0, - /* f2e - */ 0, - /* f2f - */ 0, - /* f30 - _D9_07 */ 0x2471, - /* f31 - _9B_D9_07 */ 0x2472, - /* f32 - */ 0, - /* f33 - */ 0, - /* f34 - */ 0, - /* f35 - */ 0, - /* f36 - */ 0, - /* f37 - */ 0, - /* f38 - */ 0, - /* f39 - */ 0, - /* f3a - */ 0, - /* f3b - */ 0, - /* f3c - _DB_E2 */ 0x2473, - /* f3d - _9B_DB_E2 */ 0x2474, - /* f3e - */ 0, - /* f3f - */ 0, - /* f40 - */ 0, - /* f41 - */ 0, - /* f42 - */ 0, - /* f43 - */ 0, - /* f44 - */ 0, - /* f45 - */ 0, - /* f46 - */ 0, - /* f47 - */ 0, - /* f48 - _DB_E3 */ 0x2475, - /* f49 - _9B_DB_E3 */ 0x2476, - /* f4a - */ 0, - /* f4b - */ 0, - /* f4c - */ 0, - /* f4d - */ 0, - /* f4e - */ 0, - /* f4f - */ 0, - /* f50 - */ 0, - /* f51 - */ 0, - /* f52 - */ 0, - /* f53 - */ 0, - /* f54 - _DD_06 */ 0x2477, - /* f55 - _9B_DD_06 */ 0x2478, - /* f56 - */ 0, - /* f57 - */ 0, - /* f58 - */ 0, - /* f59 - */ 0, - /* f5a - */ 0, - /* f5b - */ 0, - /* f5c - */ 0, - /* f5d - */ 0, - /* f5e - */ 0, - /* f5f - */ 0, - /* f60 - _DD_07 */ 0x2479, - /* f61 - _9B_DD_07 */ 0x247a, - /* f62 - */ 0, - /* f63 - */ 0, - /* f64 - */ 0, - /* f65 - */ 0, - /* f66 - */ 0, - /* f67 - */ 0, - /* f68 - */ 0, - /* f69 - */ 0, - /* f6a - */ 0, - /* f6b - */ 0, - /* f6c - _DF_E0 */ 0x247b, - /* f6d - _9B_DF_E0 */ 0x247c, - /* f6e - */ 0, - /* f6f - */ 0, - /* f70 - */ 0, - /* f71 - */ 0, - /* f72 - */ 0, - /* f73 - */ 0, - /* f74 - */ 0, - /* f75 - */ 0, - /* f76 - */ 0, - /* f77 - */ 0, - /* f78 - _0F_38_00 */ 0x247d, - /* f79 - _66_0F_38_00 */ 0x247e, - /* f7a - */ 0, - /* f7b - */ 0, - /* f7c - */ 0, - /* f7d - _V_66_0F_38_00 */ 0x40da, - /* f7e - */ 0, - /* f7f - */ 0, - /* f80 - */ 0, - /* f81 - */ 0, - /* f82 - */ 0, - /* f83 - */ 0, - /* f84 - _0F_38_01 */ 0x247f, - /* f85 - _66_0F_38_01 */ 0x2480, - /* f86 - */ 0, - /* f87 - */ 0, - /* f88 - */ 0, - /* f89 - _V_66_0F_38_01 */ 0x40db, - /* f8a - */ 0, - /* f8b - */ 0, - /* f8c - */ 0, - /* f8d - */ 0, - /* f8e - */ 0, - /* f8f - */ 0, - /* f90 - _0F_38_02 */ 0x2481, - /* f91 - _66_0F_38_02 */ 0x2482, - /* f92 - */ 0, - /* f93 - */ 0, - /* f94 - */ 0, - /* f95 - _V_66_0F_38_02 */ 0x40dc, - /* f96 - */ 0, - /* f97 - */ 0, - /* f98 - */ 0, - /* f99 - */ 0, - /* f9a - */ 0, - /* f9b - */ 0, - /* f9c - _0F_38_03 */ 0x2483, - /* f9d - _66_0F_38_03 */ 0x2484, - /* f9e - */ 0, - /* f9f - */ 0, - /* fa0 - */ 0, - /* fa1 - _V_66_0F_38_03 */ 0x40dd, - /* fa2 - */ 0, - /* fa3 - */ 0, - /* fa4 - */ 0, - /* fa5 - */ 0, - /* fa6 - */ 0, - /* fa7 - */ 0, - /* fa8 - _0F_38_04 */ 0x2485, - /* fa9 - _66_0F_38_04 */ 0x2486, - /* faa - */ 0, - /* fab - */ 0, - /* fac - */ 0, - /* fad - _V_66_0F_38_04 */ 0x40de, - /* fae - */ 0, - /* faf - */ 0, - /* fb0 - */ 0, - /* fb1 - */ 0, - /* fb2 - */ 0, - /* fb3 - */ 0, - /* fb4 - _0F_38_05 */ 0x2487, - /* fb5 - _66_0F_38_05 */ 0x2488, - /* fb6 - */ 0, - /* fb7 - */ 0, - /* fb8 - */ 0, - /* fb9 - _V_66_0F_38_05 */ 0x40df, - /* fba - */ 0, - /* fbb - */ 0, - /* fbc - */ 0, - /* fbd - */ 0, - /* fbe - */ 0, - /* fbf - */ 0, - /* fc0 - _0F_38_06 */ 0x2489, - /* fc1 - _66_0F_38_06 */ 0x248a, - /* fc2 - */ 0, - /* fc3 - */ 0, - /* fc4 - */ 0, - /* fc5 - _V_66_0F_38_06 */ 0x40e0, - /* fc6 - */ 0, - /* fc7 - */ 0, - /* fc8 - */ 0, - /* fc9 - */ 0, - /* fca - */ 0, - /* fcb - */ 0, - /* fcc - _0F_38_07 */ 0x248b, - /* fcd - _66_0F_38_07 */ 0x248c, - /* fce - */ 0, - /* fcf - */ 0, - /* fd0 - */ 0, - /* fd1 - _V_66_0F_38_07 */ 0x40e1, - /* fd2 - */ 0, - /* fd3 - */ 0, - /* fd4 - */ 0, - /* fd5 - */ 0, - /* fd6 - */ 0, - /* fd7 - */ 0, - /* fd8 - _0F_38_08 */ 0x248d, - /* fd9 - _66_0F_38_08 */ 0x248e, - /* fda - */ 0, - /* fdb - */ 0, - /* fdc - */ 0, - /* fdd - _V_66_0F_38_08 */ 0x40e2, - /* fde - */ 0, - /* fdf - */ 0, - /* fe0 - */ 0, - /* fe1 - */ 0, - /* fe2 - */ 0, - /* fe3 - */ 0, - /* fe4 - _0F_38_09 */ 0x248f, - /* fe5 - _66_0F_38_09 */ 0x2490, - /* fe6 - */ 0, - /* fe7 - */ 0, - /* fe8 - */ 0, - /* fe9 - _V_66_0F_38_09 */ 0x40e3, - /* fea - */ 0, - /* feb - */ 0, - /* fec - */ 0, - /* fed - */ 0, - /* fee - */ 0, - /* fef - */ 0, - /* ff0 - _0F_38_0A */ 0x2491, - /* ff1 - _66_0F_38_0A */ 0x2492, - /* ff2 - */ 0, - /* ff3 - */ 0, - /* ff4 - */ 0, - /* ff5 - _V_66_0F_38_0A */ 0x40e4, - /* ff6 - */ 0, - /* ff7 - */ 0, - /* ff8 - */ 0, - /* ff9 - */ 0, - /* ffa - */ 0, - /* ffb - */ 0, - /* ffc - _0F_38_0B */ 0x2493, - /* ffd - _66_0F_38_0B */ 0x2494, - /* ffe - */ 0, - /* fff - */ 0, - /* 1000 - */ 0, - /* 1001 - _V_66_0F_38_0B */ 0x40e5, - /* 1002 - */ 0, - /* 1003 - */ 0, - /* 1004 - */ 0, - /* 1005 - */ 0, - /* 1006 - */ 0, - /* 1007 - */ 0, - /* 1008 - */ 0, - /* 1009 - */ 0, - /* 100a - */ 0, - /* 100b - */ 0, - /* 100c - */ 0, - /* 100d - _V_66_0F_38_0C */ 0x40e6, - /* 100e - */ 0, - /* 100f - */ 0, - /* 1010 - */ 0, - /* 1011 - */ 0, - /* 1012 - */ 0, - /* 1013 - */ 0, - /* 1014 - */ 0, - /* 1015 - */ 0, - /* 1016 - */ 0, - /* 1017 - */ 0, - /* 1018 - */ 0, - /* 1019 - _V_66_0F_38_0D */ 0x40e7, - /* 101a - */ 0, - /* 101b - */ 0, - /* 101c - */ 0, - /* 101d - */ 0, - /* 101e - */ 0, - /* 101f - */ 0, - /* 1020 - */ 0, - /* 1021 - */ 0, - /* 1022 - */ 0, - /* 1023 - */ 0, - /* 1024 - */ 0, - /* 1025 - _V_66_0F_38_0E */ 0x40e8, - /* 1026 - */ 0, - /* 1027 - */ 0, - /* 1028 - */ 0, - /* 1029 - */ 0, - /* 102a - */ 0, - /* 102b - */ 0, - /* 102c - */ 0, - /* 102d - */ 0, - /* 102e - */ 0, - /* 102f - */ 0, - /* 1030 - */ 0, - /* 1031 - _V_66_0F_38_0F */ 0x40e9, - /* 1032 - */ 0, - /* 1033 - */ 0, - /* 1034 - */ 0, - /* 1035 - */ 0, - /* 1036 - */ 0, - /* 1037 - */ 0, - /* 1038 - */ 0, - /* 1039 - _66_0F_38_10 */ 0x40ea, - /* 103a - */ 0, - /* 103b - */ 0, - /* 103c - */ 0, - /* 103d - */ 0, - /* 103e - */ 0, - /* 103f - */ 0, - /* 1040 - */ 0, - /* 1041 - */ 0, - /* 1042 - */ 0, - /* 1043 - */ 0, - /* 1044 - */ 0, - /* 1045 - _66_0F_38_14 */ 0x40eb, - /* 1046 - */ 0, - /* 1047 - */ 0, - /* 1048 - */ 0, - /* 1049 - */ 0, - /* 104a - */ 0, - /* 104b - */ 0, - /* 104c - */ 0, - /* 104d - */ 0, - /* 104e - */ 0, - /* 104f - */ 0, - /* 1050 - */ 0, - /* 1051 - _66_0F_38_15 */ 0x40ec, - /* 1052 - */ 0, - /* 1053 - */ 0, - /* 1054 - */ 0, - /* 1055 - */ 0, - /* 1056 - */ 0, - /* 1057 - */ 0, - /* 1058 - */ 0, - /* 1059 - */ 0, - /* 105a - */ 0, - /* 105b - */ 0, - /* 105c - */ 0, - /* 105d - _66_0F_38_17 */ 0x2495, - /* 105e - */ 0, - /* 105f - */ 0, - /* 1060 - */ 0, - /* 1061 - _V_66_0F_38_17 */ 0x40ed, - /* 1062 - */ 0, - /* 1063 - */ 0, - /* 1064 - */ 0, - /* 1065 - */ 0, - /* 1066 - */ 0, - /* 1067 - */ 0, - /* 1068 - */ 0, - /* 1069 - */ 0, - /* 106a - */ 0, - /* 106b - */ 0, - /* 106c - */ 0, - /* 106d - _V_66_0F_38_18 */ 0x40ee, - /* 106e - */ 0, - /* 106f - */ 0, - /* 1070 - */ 0, - /* 1071 - */ 0, - /* 1072 - */ 0, - /* 1073 - */ 0, - /* 1074 - */ 0, - /* 1075 - */ 0, - /* 1076 - */ 0, - /* 1077 - */ 0, - /* 1078 - */ 0, - /* 1079 - _V_66_0F_38_19 */ 0x40ef, - /* 107a - */ 0, - /* 107b - */ 0, - /* 107c - */ 0, - /* 107d - */ 0, - /* 107e - */ 0, - /* 107f - */ 0, - /* 1080 - */ 0, - /* 1081 - */ 0, - /* 1082 - */ 0, - /* 1083 - */ 0, - /* 1084 - */ 0, - /* 1085 - _V_66_0F_38_1A */ 0x40f0, - /* 1086 - */ 0, - /* 1087 - */ 0, - /* 1088 - */ 0, - /* 1089 - */ 0, - /* 108a - */ 0, - /* 108b - */ 0, - /* 108c - _0F_38_1C */ 0x2496, - /* 108d - _66_0F_38_1C */ 0x2497, - /* 108e - */ 0, - /* 108f - */ 0, - /* 1090 - */ 0, - /* 1091 - _V_66_0F_38_1C */ 0x40f1, - /* 1092 - */ 0, - /* 1093 - */ 0, - /* 1094 - */ 0, - /* 1095 - */ 0, - /* 1096 - */ 0, - /* 1097 - */ 0, - /* 1098 - _0F_38_1D */ 0x2498, - /* 1099 - _66_0F_38_1D */ 0x2499, - /* 109a - */ 0, - /* 109b - */ 0, - /* 109c - */ 0, - /* 109d - _V_66_0F_38_1D */ 0x40f2, - /* 109e - */ 0, - /* 109f - */ 0, - /* 10a0 - */ 0, - /* 10a1 - */ 0, - /* 10a2 - */ 0, - /* 10a3 - */ 0, - /* 10a4 - _0F_38_1E */ 0x249a, - /* 10a5 - _66_0F_38_1E */ 0x249b, - /* 10a6 - */ 0, - /* 10a7 - */ 0, - /* 10a8 - */ 0, - /* 10a9 - _V_66_0F_38_1E */ 0x40f3, - /* 10aa - */ 0, - /* 10ab - */ 0, - /* 10ac - */ 0, - /* 10ad - */ 0, - /* 10ae - */ 0, - /* 10af - */ 0, - /* 10b0 - */ 0, - /* 10b1 - _66_0F_38_20 */ 0x249c, - /* 10b2 - */ 0, - /* 10b3 - */ 0, - /* 10b4 - */ 0, - /* 10b5 - _V_66_0F_38_20 */ 0x40f4, - /* 10b6 - */ 0, - /* 10b7 - */ 0, - /* 10b8 - */ 0, - /* 10b9 - */ 0, - /* 10ba - */ 0, - /* 10bb - */ 0, - /* 10bc - */ 0, - /* 10bd - _66_0F_38_21 */ 0x249d, - /* 10be - */ 0, - /* 10bf - */ 0, - /* 10c0 - */ 0, - /* 10c1 - _V_66_0F_38_21 */ 0x40f5, - /* 10c2 - */ 0, - /* 10c3 - */ 0, - /* 10c4 - */ 0, - /* 10c5 - */ 0, - /* 10c6 - */ 0, - /* 10c7 - */ 0, - /* 10c8 - */ 0, - /* 10c9 - _66_0F_38_22 */ 0x249e, - /* 10ca - */ 0, - /* 10cb - */ 0, - /* 10cc - */ 0, - /* 10cd - _V_66_0F_38_22 */ 0x40f6, - /* 10ce - */ 0, - /* 10cf - */ 0, - /* 10d0 - */ 0, - /* 10d1 - */ 0, - /* 10d2 - */ 0, - /* 10d3 - */ 0, - /* 10d4 - */ 0, - /* 10d5 - _66_0F_38_23 */ 0x249f, - /* 10d6 - */ 0, - /* 10d7 - */ 0, - /* 10d8 - */ 0, - /* 10d9 - _V_66_0F_38_23 */ 0x40f7, - /* 10da - */ 0, - /* 10db - */ 0, - /* 10dc - */ 0, - /* 10dd - */ 0, - /* 10de - */ 0, - /* 10df - */ 0, - /* 10e0 - */ 0, - /* 10e1 - _66_0F_38_24 */ 0x24a0, - /* 10e2 - */ 0, - /* 10e3 - */ 0, - /* 10e4 - */ 0, - /* 10e5 - _V_66_0F_38_24 */ 0x40f8, - /* 10e6 - */ 0, - /* 10e7 - */ 0, - /* 10e8 - */ 0, - /* 10e9 - */ 0, - /* 10ea - */ 0, - /* 10eb - */ 0, - /* 10ec - */ 0, - /* 10ed - _66_0F_38_25 */ 0x24a1, - /* 10ee - */ 0, - /* 10ef - */ 0, - /* 10f0 - */ 0, - /* 10f1 - _V_66_0F_38_25 */ 0x40f9, - /* 10f2 - */ 0, - /* 10f3 - */ 0, - /* 10f4 - */ 0, - /* 10f5 - */ 0, - /* 10f6 - */ 0, - /* 10f7 - */ 0, - /* 10f8 - */ 0, - /* 10f9 - _66_0F_38_28 */ 0x24a2, - /* 10fa - */ 0, - /* 10fb - */ 0, - /* 10fc - */ 0, - /* 10fd - _V_66_0F_38_28 */ 0x40fa, - /* 10fe - */ 0, - /* 10ff - */ 0, - /* 1100 - */ 0, - /* 1101 - */ 0, - /* 1102 - */ 0, - /* 1103 - */ 0, - /* 1104 - */ 0, - /* 1105 - _66_0F_38_29 */ 0x24a3, - /* 1106 - */ 0, - /* 1107 - */ 0, - /* 1108 - */ 0, - /* 1109 - _V_66_0F_38_29 */ 0x40fb, - /* 110a - */ 0, - /* 110b - */ 0, - /* 110c - */ 0, - /* 110d - */ 0, - /* 110e - */ 0, - /* 110f - */ 0, - /* 1110 - */ 0, - /* 1111 - _66_0F_38_2A */ 0x24a4, - /* 1112 - */ 0, - /* 1113 - */ 0, - /* 1114 - */ 0, - /* 1115 - _V_66_0F_38_2A */ 0x40fc, - /* 1116 - */ 0, - /* 1117 - */ 0, - /* 1118 - */ 0, - /* 1119 - */ 0, - /* 111a - */ 0, - /* 111b - */ 0, - /* 111c - */ 0, - /* 111d - _66_0F_38_2B */ 0x24a5, - /* 111e - */ 0, - /* 111f - */ 0, - /* 1120 - */ 0, - /* 1121 - _V_66_0F_38_2B */ 0x40fd, - /* 1122 - */ 0, - /* 1123 - */ 0, - /* 1124 - */ 0, - /* 1125 - */ 0, - /* 1126 - */ 0, - /* 1127 - */ 0, - /* 1128 - */ 0, - /* 1129 - */ 0, - /* 112a - */ 0, - /* 112b - */ 0, - /* 112c - */ 0, - /* 112d - _V_66_0F_38_2C */ 0x40fe, - /* 112e - */ 0, - /* 112f - */ 0, - /* 1130 - */ 0, - /* 1131 - */ 0, - /* 1132 - */ 0, - /* 1133 - */ 0, - /* 1134 - */ 0, - /* 1135 - */ 0, - /* 1136 - */ 0, - /* 1137 - */ 0, - /* 1138 - */ 0, - /* 1139 - _V_66_0F_38_2D */ 0x40ff, - /* 113a - */ 0, - /* 113b - */ 0, - /* 113c - */ 0, - /* 113d - */ 0, - /* 113e - */ 0, - /* 113f - */ 0, - /* 1140 - */ 0, - /* 1141 - */ 0, - /* 1142 - */ 0, - /* 1143 - */ 0, - /* 1144 - */ 0, - /* 1145 - _V_66_0F_38_2E */ 0x4100, - /* 1146 - */ 0, - /* 1147 - */ 0, - /* 1148 - */ 0, - /* 1149 - */ 0, - /* 114a - */ 0, - /* 114b - */ 0, - /* 114c - */ 0, - /* 114d - */ 0, - /* 114e - */ 0, - /* 114f - */ 0, - /* 1150 - */ 0, - /* 1151 - _V_66_0F_38_2F */ 0x4101, - /* 1152 - */ 0, - /* 1153 - */ 0, - /* 1154 - */ 0, - /* 1155 - */ 0, - /* 1156 - */ 0, - /* 1157 - */ 0, - /* 1158 - */ 0, - /* 1159 - _66_0F_38_30 */ 0x24a6, - /* 115a - */ 0, - /* 115b - */ 0, - /* 115c - */ 0, - /* 115d - _V_66_0F_38_30 */ 0x4102, - /* 115e - */ 0, - /* 115f - */ 0, - /* 1160 - */ 0, - /* 1161 - */ 0, - /* 1162 - */ 0, - /* 1163 - */ 0, - /* 1164 - */ 0, - /* 1165 - _66_0F_38_31 */ 0x24a7, - /* 1166 - */ 0, - /* 1167 - */ 0, - /* 1168 - */ 0, - /* 1169 - _V_66_0F_38_31 */ 0x4103, - /* 116a - */ 0, - /* 116b - */ 0, - /* 116c - */ 0, - /* 116d - */ 0, - /* 116e - */ 0, - /* 116f - */ 0, - /* 1170 - */ 0, - /* 1171 - _66_0F_38_32 */ 0x24a8, - /* 1172 - */ 0, - /* 1173 - */ 0, - /* 1174 - */ 0, - /* 1175 - _V_66_0F_38_32 */ 0x4104, - /* 1176 - */ 0, - /* 1177 - */ 0, - /* 1178 - */ 0, - /* 1179 - */ 0, - /* 117a - */ 0, - /* 117b - */ 0, - /* 117c - */ 0, - /* 117d - _66_0F_38_33 */ 0x24a9, - /* 117e - */ 0, - /* 117f - */ 0, - /* 1180 - */ 0, - /* 1181 - _V_66_0F_38_33 */ 0x4105, - /* 1182 - */ 0, - /* 1183 - */ 0, - /* 1184 - */ 0, - /* 1185 - */ 0, - /* 1186 - */ 0, - /* 1187 - */ 0, - /* 1188 - */ 0, - /* 1189 - _66_0F_38_34 */ 0x24aa, - /* 118a - */ 0, - /* 118b - */ 0, - /* 118c - */ 0, - /* 118d - _V_66_0F_38_34 */ 0x4106, - /* 118e - */ 0, - /* 118f - */ 0, - /* 1190 - */ 0, - /* 1191 - */ 0, - /* 1192 - */ 0, - /* 1193 - */ 0, - /* 1194 - */ 0, - /* 1195 - _66_0F_38_35 */ 0x24ab, - /* 1196 - */ 0, - /* 1197 - */ 0, - /* 1198 - */ 0, - /* 1199 - _V_66_0F_38_35 */ 0x4107, - /* 119a - */ 0, - /* 119b - */ 0, - /* 119c - */ 0, - /* 119d - */ 0, - /* 119e - */ 0, - /* 119f - */ 0, - /* 11a0 - */ 0, - /* 11a1 - _66_0F_38_37 */ 0x24ac, - /* 11a2 - */ 0, - /* 11a3 - */ 0, - /* 11a4 - */ 0, - /* 11a5 - _V_66_0F_38_37 */ 0x4108, - /* 11a6 - */ 0, - /* 11a7 - */ 0, - /* 11a8 - */ 0, - /* 11a9 - */ 0, - /* 11aa - */ 0, - /* 11ab - */ 0, - /* 11ac - */ 0, - /* 11ad - _66_0F_38_38 */ 0x24ad, - /* 11ae - */ 0, - /* 11af - */ 0, - /* 11b0 - */ 0, - /* 11b1 - _V_66_0F_38_38 */ 0x4109, - /* 11b2 - */ 0, - /* 11b3 - */ 0, - /* 11b4 - */ 0, - /* 11b5 - */ 0, - /* 11b6 - */ 0, - /* 11b7 - */ 0, - /* 11b8 - */ 0, - /* 11b9 - _66_0F_38_39 */ 0x24ae, - /* 11ba - */ 0, - /* 11bb - */ 0, - /* 11bc - */ 0, - /* 11bd - _V_66_0F_38_39 */ 0x410a, - /* 11be - */ 0, - /* 11bf - */ 0, - /* 11c0 - */ 0, - /* 11c1 - */ 0, - /* 11c2 - */ 0, - /* 11c3 - */ 0, - /* 11c4 - */ 0, - /* 11c5 - _66_0F_38_3A */ 0x24af, - /* 11c6 - */ 0, - /* 11c7 - */ 0, - /* 11c8 - */ 0, - /* 11c9 - _V_66_0F_38_3A */ 0x410b, - /* 11ca - */ 0, - /* 11cb - */ 0, - /* 11cc - */ 0, - /* 11cd - */ 0, - /* 11ce - */ 0, - /* 11cf - */ 0, - /* 11d0 - */ 0, - /* 11d1 - _66_0F_38_3B */ 0x24b0, - /* 11d2 - */ 0, - /* 11d3 - */ 0, - /* 11d4 - */ 0, - /* 11d5 - _V_66_0F_38_3B */ 0x410c, - /* 11d6 - */ 0, - /* 11d7 - */ 0, - /* 11d8 - */ 0, - /* 11d9 - */ 0, - /* 11da - */ 0, - /* 11db - */ 0, - /* 11dc - */ 0, - /* 11dd - _66_0F_38_3C */ 0x24b1, - /* 11de - */ 0, - /* 11df - */ 0, - /* 11e0 - */ 0, - /* 11e1 - _V_66_0F_38_3C */ 0x410d, - /* 11e2 - */ 0, - /* 11e3 - */ 0, - /* 11e4 - */ 0, - /* 11e5 - */ 0, - /* 11e6 - */ 0, - /* 11e7 - */ 0, - /* 11e8 - */ 0, - /* 11e9 - _66_0F_38_3D */ 0x24b2, - /* 11ea - */ 0, - /* 11eb - */ 0, - /* 11ec - */ 0, - /* 11ed - _V_66_0F_38_3D */ 0x410e, - /* 11ee - */ 0, - /* 11ef - */ 0, - /* 11f0 - */ 0, - /* 11f1 - */ 0, - /* 11f2 - */ 0, - /* 11f3 - */ 0, - /* 11f4 - */ 0, - /* 11f5 - _66_0F_38_3E */ 0x24b3, - /* 11f6 - */ 0, - /* 11f7 - */ 0, - /* 11f8 - */ 0, - /* 11f9 - _V_66_0F_38_3E */ 0x410f, - /* 11fa - */ 0, - /* 11fb - */ 0, - /* 11fc - */ 0, - /* 11fd - */ 0, - /* 11fe - */ 0, - /* 11ff - */ 0, - /* 1200 - */ 0, - /* 1201 - _66_0F_38_3F */ 0x24b4, - /* 1202 - */ 0, - /* 1203 - */ 0, - /* 1204 - */ 0, - /* 1205 - _V_66_0F_38_3F */ 0x4110, - /* 1206 - */ 0, - /* 1207 - */ 0, - /* 1208 - */ 0, - /* 1209 - */ 0, - /* 120a - */ 0, - /* 120b - */ 0, - /* 120c - */ 0, - /* 120d - _66_0F_38_40 */ 0x24b5, - /* 120e - */ 0, - /* 120f - */ 0, - /* 1210 - */ 0, - /* 1211 - _V_66_0F_38_40 */ 0x4111, - /* 1212 - */ 0, - /* 1213 - */ 0, - /* 1214 - */ 0, - /* 1215 - */ 0, - /* 1216 - */ 0, - /* 1217 - */ 0, - /* 1218 - */ 0, - /* 1219 - _66_0F_38_41 */ 0x24b6, - /* 121a - */ 0, - /* 121b - */ 0, - /* 121c - */ 0, - /* 121d - _V_66_0F_38_41 */ 0x4112, - /* 121e - */ 0, - /* 121f - */ 0, - /* 1220 - */ 0, - /* 1221 - */ 0, - /* 1222 - */ 0, - /* 1223 - */ 0, - /* 1224 - */ 0, - /* 1225 - _66_0F_38_80 */ 0x24b7, - /* 1226 - */ 0, - /* 1227 - */ 0, - /* 1228 - */ 0, - /* 1229 - */ 0, - /* 122a - */ 0, - /* 122b - */ 0, - /* 122c - */ 0, - /* 122d - */ 0, - /* 122e - */ 0, - /* 122f - */ 0, - /* 1230 - */ 0, - /* 1231 - _66_0F_38_81 */ 0x24b8, - /* 1232 - */ 0, - /* 1233 - */ 0, - /* 1234 - */ 0, - /* 1235 - */ 0, - /* 1236 - */ 0, - /* 1237 - */ 0, - /* 1238 - */ 0, - /* 1239 - */ 0, - /* 123a - */ 0, - /* 123b - */ 0, - /* 123c - */ 0, - /* 123d - _66_0F_38_82 */ 0x24b9, - /* 123e - */ 0, - /* 123f - */ 0, - /* 1240 - */ 0, - /* 1241 - */ 0, - /* 1242 - */ 0, - /* 1243 - */ 0, - /* 1244 - */ 0, - /* 1245 - */ 0, - /* 1246 - */ 0, - /* 1247 - */ 0, - /* 1248 - */ 0, - /* 1249 - */ 0, - /* 124a - */ 0, - /* 124b - */ 0, - /* 124c - */ 0, - /* 124d - _V_66_0F_38_96 */ 0x4113, - /* 124e - */ 0, - /* 124f - */ 0, - /* 1250 - */ 0, - /* 1251 - */ 0, - /* 1252 - */ 0, - /* 1253 - */ 0, - /* 1254 - */ 0, - /* 1255 - */ 0, - /* 1256 - */ 0, - /* 1257 - */ 0, - /* 1258 - */ 0, - /* 1259 - _V_66_0F_38_97 */ 0x4114, - /* 125a - */ 0, - /* 125b - */ 0, - /* 125c - */ 0, - /* 125d - */ 0, - /* 125e - */ 0, - /* 125f - */ 0, - /* 1260 - */ 0, - /* 1261 - */ 0, - /* 1262 - */ 0, - /* 1263 - */ 0, - /* 1264 - */ 0, - /* 1265 - _V_66_0F_38_98 */ 0x4115, - /* 1266 - */ 0, - /* 1267 - */ 0, - /* 1268 - */ 0, - /* 1269 - */ 0, - /* 126a - */ 0, - /* 126b - */ 0, - /* 126c - */ 0, - /* 126d - */ 0, - /* 126e - */ 0, - /* 126f - */ 0, - /* 1270 - */ 0, - /* 1271 - _V_66_0F_38_99 */ 0x4116, - /* 1272 - */ 0, - /* 1273 - */ 0, - /* 1274 - */ 0, - /* 1275 - */ 0, - /* 1276 - */ 0, - /* 1277 - */ 0, - /* 1278 - */ 0, - /* 1279 - */ 0, - /* 127a - */ 0, - /* 127b - */ 0, - /* 127c - */ 0, - /* 127d - _V_66_0F_38_9A */ 0x4117, - /* 127e - */ 0, - /* 127f - */ 0, - /* 1280 - */ 0, - /* 1281 - */ 0, - /* 1282 - */ 0, - /* 1283 - */ 0, - /* 1284 - */ 0, - /* 1285 - */ 0, - /* 1286 - */ 0, - /* 1287 - */ 0, - /* 1288 - */ 0, - /* 1289 - _V_66_0F_38_9B */ 0x4118, - /* 128a - */ 0, - /* 128b - */ 0, - /* 128c - */ 0, - /* 128d - */ 0, - /* 128e - */ 0, - /* 128f - */ 0, - /* 1290 - */ 0, - /* 1291 - */ 0, - /* 1292 - */ 0, - /* 1293 - */ 0, - /* 1294 - */ 0, - /* 1295 - _V_66_0F_38_9C */ 0x4119, - /* 1296 - */ 0, - /* 1297 - */ 0, - /* 1298 - */ 0, - /* 1299 - */ 0, - /* 129a - */ 0, - /* 129b - */ 0, - /* 129c - */ 0, - /* 129d - */ 0, - /* 129e - */ 0, - /* 129f - */ 0, - /* 12a0 - */ 0, - /* 12a1 - _V_66_0F_38_9D */ 0x411a, - /* 12a2 - */ 0, - /* 12a3 - */ 0, - /* 12a4 - */ 0, - /* 12a5 - */ 0, - /* 12a6 - */ 0, - /* 12a7 - */ 0, - /* 12a8 - */ 0, - /* 12a9 - */ 0, - /* 12aa - */ 0, - /* 12ab - */ 0, - /* 12ac - */ 0, - /* 12ad - _V_66_0F_38_9E */ 0x411b, - /* 12ae - */ 0, - /* 12af - */ 0, - /* 12b0 - */ 0, - /* 12b1 - */ 0, - /* 12b2 - */ 0, - /* 12b3 - */ 0, - /* 12b4 - */ 0, - /* 12b5 - */ 0, - /* 12b6 - */ 0, - /* 12b7 - */ 0, - /* 12b8 - */ 0, - /* 12b9 - _V_66_0F_38_9F */ 0x411c, - /* 12ba - */ 0, - /* 12bb - */ 0, - /* 12bc - */ 0, - /* 12bd - */ 0, - /* 12be - */ 0, - /* 12bf - */ 0, - /* 12c0 - */ 0, - /* 12c1 - */ 0, - /* 12c2 - */ 0, - /* 12c3 - */ 0, - /* 12c4 - */ 0, - /* 12c5 - _V_66_0F_38_A6 */ 0x411d, - /* 12c6 - */ 0, - /* 12c7 - */ 0, - /* 12c8 - */ 0, - /* 12c9 - */ 0, - /* 12ca - */ 0, - /* 12cb - */ 0, - /* 12cc - */ 0, - /* 12cd - */ 0, - /* 12ce - */ 0, - /* 12cf - */ 0, - /* 12d0 - */ 0, - /* 12d1 - _V_66_0F_38_A7 */ 0x411e, - /* 12d2 - */ 0, - /* 12d3 - */ 0, - /* 12d4 - */ 0, - /* 12d5 - */ 0, - /* 12d6 - */ 0, - /* 12d7 - */ 0, - /* 12d8 - */ 0, - /* 12d9 - */ 0, - /* 12da - */ 0, - /* 12db - */ 0, - /* 12dc - */ 0, - /* 12dd - _V_66_0F_38_A8 */ 0x411f, - /* 12de - */ 0, - /* 12df - */ 0, - /* 12e0 - */ 0, - /* 12e1 - */ 0, - /* 12e2 - */ 0, - /* 12e3 - */ 0, - /* 12e4 - */ 0, - /* 12e5 - */ 0, - /* 12e6 - */ 0, - /* 12e7 - */ 0, - /* 12e8 - */ 0, - /* 12e9 - _V_66_0F_38_A9 */ 0x4120, - /* 12ea - */ 0, - /* 12eb - */ 0, - /* 12ec - */ 0, - /* 12ed - */ 0, - /* 12ee - */ 0, - /* 12ef - */ 0, - /* 12f0 - */ 0, - /* 12f1 - */ 0, - /* 12f2 - */ 0, - /* 12f3 - */ 0, - /* 12f4 - */ 0, - /* 12f5 - _V_66_0F_38_AA */ 0x4121, - /* 12f6 - */ 0, - /* 12f7 - */ 0, - /* 12f8 - */ 0, - /* 12f9 - */ 0, - /* 12fa - */ 0, - /* 12fb - */ 0, - /* 12fc - */ 0, - /* 12fd - */ 0, - /* 12fe - */ 0, - /* 12ff - */ 0, - /* 1300 - */ 0, - /* 1301 - _V_66_0F_38_AB */ 0x4122, - /* 1302 - */ 0, - /* 1303 - */ 0, - /* 1304 - */ 0, - /* 1305 - */ 0, - /* 1306 - */ 0, - /* 1307 - */ 0, - /* 1308 - */ 0, - /* 1309 - */ 0, - /* 130a - */ 0, - /* 130b - */ 0, - /* 130c - */ 0, - /* 130d - _V_66_0F_38_AC */ 0x4123, - /* 130e - */ 0, - /* 130f - */ 0, - /* 1310 - */ 0, - /* 1311 - */ 0, - /* 1312 - */ 0, - /* 1313 - */ 0, - /* 1314 - */ 0, - /* 1315 - */ 0, - /* 1316 - */ 0, - /* 1317 - */ 0, - /* 1318 - */ 0, - /* 1319 - _V_66_0F_38_AD */ 0x4124, - /* 131a - */ 0, - /* 131b - */ 0, - /* 131c - */ 0, - /* 131d - */ 0, - /* 131e - */ 0, - /* 131f - */ 0, - /* 1320 - */ 0, - /* 1321 - */ 0, - /* 1322 - */ 0, - /* 1323 - */ 0, - /* 1324 - */ 0, - /* 1325 - _V_66_0F_38_AE */ 0x4125, - /* 1326 - */ 0, - /* 1327 - */ 0, - /* 1328 - */ 0, - /* 1329 - */ 0, - /* 132a - */ 0, - /* 132b - */ 0, - /* 132c - */ 0, - /* 132d - */ 0, - /* 132e - */ 0, - /* 132f - */ 0, - /* 1330 - */ 0, - /* 1331 - _V_66_0F_38_AF */ 0x4126, - /* 1332 - */ 0, - /* 1333 - */ 0, - /* 1334 - */ 0, - /* 1335 - */ 0, - /* 1336 - */ 0, - /* 1337 - */ 0, - /* 1338 - */ 0, - /* 1339 - */ 0, - /* 133a - */ 0, - /* 133b - */ 0, - /* 133c - */ 0, - /* 133d - _V_66_0F_38_B6 */ 0x4127, - /* 133e - */ 0, - /* 133f - */ 0, - /* 1340 - */ 0, - /* 1341 - */ 0, - /* 1342 - */ 0, - /* 1343 - */ 0, - /* 1344 - */ 0, - /* 1345 - */ 0, - /* 1346 - */ 0, - /* 1347 - */ 0, - /* 1348 - */ 0, - /* 1349 - _V_66_0F_38_B7 */ 0x4128, - /* 134a - */ 0, - /* 134b - */ 0, - /* 134c - */ 0, - /* 134d - */ 0, - /* 134e - */ 0, - /* 134f - */ 0, - /* 1350 - */ 0, - /* 1351 - */ 0, - /* 1352 - */ 0, - /* 1353 - */ 0, - /* 1354 - */ 0, - /* 1355 - _V_66_0F_38_B8 */ 0x4129, - /* 1356 - */ 0, - /* 1357 - */ 0, - /* 1358 - */ 0, - /* 1359 - */ 0, - /* 135a - */ 0, - /* 135b - */ 0, - /* 135c - */ 0, - /* 135d - */ 0, - /* 135e - */ 0, - /* 135f - */ 0, - /* 1360 - */ 0, - /* 1361 - _V_66_0F_38_B9 */ 0x412a, - /* 1362 - */ 0, - /* 1363 - */ 0, - /* 1364 - */ 0, - /* 1365 - */ 0, - /* 1366 - */ 0, - /* 1367 - */ 0, - /* 1368 - */ 0, - /* 1369 - */ 0, - /* 136a - */ 0, - /* 136b - */ 0, - /* 136c - */ 0, - /* 136d - _V_66_0F_38_BA */ 0x412b, - /* 136e - */ 0, - /* 136f - */ 0, - /* 1370 - */ 0, - /* 1371 - */ 0, - /* 1372 - */ 0, - /* 1373 - */ 0, - /* 1374 - */ 0, - /* 1375 - */ 0, - /* 1376 - */ 0, - /* 1377 - */ 0, - /* 1378 - */ 0, - /* 1379 - _V_66_0F_38_BB */ 0x412c, - /* 137a - */ 0, - /* 137b - */ 0, - /* 137c - */ 0, - /* 137d - */ 0, - /* 137e - */ 0, - /* 137f - */ 0, - /* 1380 - */ 0, - /* 1381 - */ 0, - /* 1382 - */ 0, - /* 1383 - */ 0, - /* 1384 - */ 0, - /* 1385 - _V_66_0F_38_BC */ 0x412d, - /* 1386 - */ 0, - /* 1387 - */ 0, - /* 1388 - */ 0, - /* 1389 - */ 0, - /* 138a - */ 0, - /* 138b - */ 0, - /* 138c - */ 0, - /* 138d - */ 0, - /* 138e - */ 0, - /* 138f - */ 0, - /* 1390 - */ 0, - /* 1391 - _V_66_0F_38_BD */ 0x412e, - /* 1392 - */ 0, - /* 1393 - */ 0, - /* 1394 - */ 0, - /* 1395 - */ 0, - /* 1396 - */ 0, - /* 1397 - */ 0, - /* 1398 - */ 0, - /* 1399 - */ 0, - /* 139a - */ 0, - /* 139b - */ 0, - /* 139c - */ 0, - /* 139d - _V_66_0F_38_BE */ 0x412f, - /* 139e - */ 0, - /* 139f - */ 0, - /* 13a0 - */ 0, - /* 13a1 - */ 0, - /* 13a2 - */ 0, - /* 13a3 - */ 0, - /* 13a4 - */ 0, - /* 13a5 - */ 0, - /* 13a6 - */ 0, - /* 13a7 - */ 0, - /* 13a8 - */ 0, - /* 13a9 - _V_66_0F_38_BF */ 0x4130, - /* 13aa - */ 0, - /* 13ab - */ 0, - /* 13ac - */ 0, - /* 13ad - */ 0, - /* 13ae - */ 0, - /* 13af - */ 0, - /* 13b0 - */ 0, - /* 13b1 - _66_0F_38_DB */ 0x24ba, - /* 13b2 - */ 0, - /* 13b3 - */ 0, - /* 13b4 - */ 0, - /* 13b5 - _V_66_0F_38_DB */ 0x4131, - /* 13b6 - */ 0, - /* 13b7 - */ 0, - /* 13b8 - */ 0, - /* 13b9 - */ 0, - /* 13ba - */ 0, - /* 13bb - */ 0, - /* 13bc - */ 0, - /* 13bd - _66_0F_38_DC */ 0x24bb, - /* 13be - */ 0, - /* 13bf - */ 0, - /* 13c0 - */ 0, - /* 13c1 - _V_66_0F_38_DC */ 0x4132, - /* 13c2 - */ 0, - /* 13c3 - */ 0, - /* 13c4 - */ 0, - /* 13c5 - */ 0, - /* 13c6 - */ 0, - /* 13c7 - */ 0, - /* 13c8 - */ 0, - /* 13c9 - _66_0F_38_DD */ 0x24bc, - /* 13ca - */ 0, - /* 13cb - */ 0, - /* 13cc - */ 0, - /* 13cd - _V_66_0F_38_DD */ 0x4133, - /* 13ce - */ 0, - /* 13cf - */ 0, - /* 13d0 - */ 0, - /* 13d1 - */ 0, - /* 13d2 - */ 0, - /* 13d3 - */ 0, - /* 13d4 - */ 0, - /* 13d5 - _66_0F_38_DE */ 0x24bd, - /* 13d6 - */ 0, - /* 13d7 - */ 0, - /* 13d8 - */ 0, - /* 13d9 - _V_66_0F_38_DE */ 0x4134, - /* 13da - */ 0, - /* 13db - */ 0, - /* 13dc - */ 0, - /* 13dd - */ 0, - /* 13de - */ 0, - /* 13df - */ 0, - /* 13e0 - */ 0, - /* 13e1 - _66_0F_38_DF */ 0x24be, - /* 13e2 - */ 0, - /* 13e3 - */ 0, - /* 13e4 - */ 0, - /* 13e5 - _V_66_0F_38_DF */ 0x4135, - /* 13e6 - */ 0, - /* 13e7 - */ 0, - /* 13e8 - */ 0, - /* 13e9 - */ 0, - /* 13ea - */ 0, - /* 13eb - */ 0, - /* 13ec - _0F_38_F0 */ 0x24bf, - /* 13ed - */ 0, - /* 13ee - */ 0, - /* 13ef - _F2_0F_38_F0 */ 0x24c0, - /* 13f0 - */ 0, - /* 13f1 - */ 0, - /* 13f2 - */ 0, - /* 13f3 - */ 0, - /* 13f4 - */ 0, - /* 13f5 - */ 0, - /* 13f6 - */ 0, - /* 13f7 - */ 0, - /* 13f8 - _0F_38_F1 */ 0x24c1, - /* 13f9 - */ 0, - /* 13fa - */ 0, - /* 13fb - _F2_0F_38_F1 */ 0x24c2, - /* 13fc - */ 0, - /* 13fd - */ 0, - /* 13fe - */ 0, - /* 13ff - */ 0, - /* 1400 - */ 0, - /* 1401 - */ 0, - /* 1402 - */ 0, - /* 1403 - */ 0, - /* 1404 - */ 0, - /* 1405 - */ 0, - /* 1406 - */ 0, - /* 1407 - */ 0, - /* 1408 - */ 0, - /* 1409 - _V_66_0F_3A_04 */ 0x4136, - /* 140a - */ 0, - /* 140b - */ 0, - /* 140c - */ 0, - /* 140d - */ 0, - /* 140e - */ 0, - /* 140f - */ 0, - /* 1410 - */ 0, - /* 1411 - */ 0, - /* 1412 - */ 0, - /* 1413 - */ 0, - /* 1414 - */ 0, - /* 1415 - _V_66_0F_3A_05 */ 0x4137, - /* 1416 - */ 0, - /* 1417 - */ 0, - /* 1418 - */ 0, - /* 1419 - */ 0, - /* 141a - */ 0, - /* 141b - */ 0, - /* 141c - */ 0, - /* 141d - */ 0, - /* 141e - */ 0, - /* 141f - */ 0, - /* 1420 - */ 0, - /* 1421 - _V_66_0F_3A_06 */ 0x4138, - /* 1422 - */ 0, - /* 1423 - */ 0, - /* 1424 - */ 0, - /* 1425 - */ 0, - /* 1426 - */ 0, - /* 1427 - */ 0, - /* 1428 - */ 0, - /* 1429 - _66_0F_3A_08 */ 0x4139, - /* 142a - */ 0, - /* 142b - */ 0, - /* 142c - */ 0, - /* 142d - _V_66_0F_3A_08 */ 0x413a, - /* 142e - */ 0, - /* 142f - */ 0, - /* 1430 - */ 0, - /* 1431 - */ 0, - /* 1432 - */ 0, - /* 1433 - */ 0, - /* 1434 - */ 0, - /* 1435 - _66_0F_3A_09 */ 0x413b, - /* 1436 - */ 0, - /* 1437 - */ 0, - /* 1438 - */ 0, - /* 1439 - _V_66_0F_3A_09 */ 0x413c, - /* 143a - */ 0, - /* 143b - */ 0, - /* 143c - */ 0, - /* 143d - */ 0, - /* 143e - */ 0, - /* 143f - */ 0, - /* 1440 - */ 0, - /* 1441 - _66_0F_3A_0A */ 0x413d, - /* 1442 - */ 0, - /* 1443 - */ 0, - /* 1444 - */ 0, - /* 1445 - _V_66_0F_3A_0A */ 0x413e, - /* 1446 - */ 0, - /* 1447 - */ 0, - /* 1448 - */ 0, - /* 1449 - */ 0, - /* 144a - */ 0, - /* 144b - */ 0, - /* 144c - */ 0, - /* 144d - _66_0F_3A_0B */ 0x413f, - /* 144e - */ 0, - /* 144f - */ 0, - /* 1450 - */ 0, - /* 1451 - _V_66_0F_3A_0B */ 0x4140, - /* 1452 - */ 0, - /* 1453 - */ 0, - /* 1454 - */ 0, - /* 1455 - */ 0, - /* 1456 - */ 0, - /* 1457 - */ 0, - /* 1458 - */ 0, - /* 1459 - _66_0F_3A_0C */ 0x4141, - /* 145a - */ 0, - /* 145b - */ 0, - /* 145c - */ 0, - /* 145d - _V_66_0F_3A_0C */ 0x4142, - /* 145e - */ 0, - /* 145f - */ 0, - /* 1460 - */ 0, - /* 1461 - */ 0, - /* 1462 - */ 0, - /* 1463 - */ 0, - /* 1464 - */ 0, - /* 1465 - _66_0F_3A_0D */ 0x4143, - /* 1466 - */ 0, - /* 1467 - */ 0, - /* 1468 - */ 0, - /* 1469 - _V_66_0F_3A_0D */ 0x4144, - /* 146a - */ 0, - /* 146b - */ 0, - /* 146c - */ 0, - /* 146d - */ 0, - /* 146e - */ 0, - /* 146f - */ 0, - /* 1470 - */ 0, - /* 1471 - _66_0F_3A_0E */ 0x4145, - /* 1472 - */ 0, - /* 1473 - */ 0, - /* 1474 - */ 0, - /* 1475 - _V_66_0F_3A_0E */ 0x4146, - /* 1476 - */ 0, - /* 1477 - */ 0, - /* 1478 - */ 0, - /* 1479 - */ 0, - /* 147a - */ 0, - /* 147b - */ 0, - /* 147c - _0F_3A_0F */ 0x4147, - /* 147d - _66_0F_3A_0F */ 0x4148, - /* 147e - */ 0, - /* 147f - */ 0, - /* 1480 - */ 0, - /* 1481 - _V_66_0F_3A_0F */ 0x4149, - /* 1482 - */ 0, - /* 1483 - */ 0, - /* 1484 - */ 0, - /* 1485 - */ 0, - /* 1486 - */ 0, - /* 1487 - */ 0, - /* 1488 - */ 0, - /* 1489 - _66_0F_3A_14 */ 0x414a, - /* 148a - */ 0, - /* 148b - */ 0, - /* 148c - */ 0, - /* 148d - _V_66_0F_3A_14 */ 0x414b, - /* 148e - */ 0, - /* 148f - */ 0, - /* 1490 - */ 0, - /* 1491 - */ 0, - /* 1492 - */ 0, - /* 1493 - */ 0, - /* 1494 - */ 0, - /* 1495 - _66_0F_3A_15 */ 0x414c, - /* 1496 - */ 0, - /* 1497 - */ 0, - /* 1498 - */ 0, - /* 1499 - _V_66_0F_3A_15 */ 0x414d, - /* 149a - */ 0, - /* 149b - */ 0, - /* 149c - */ 0, - /* 149d - */ 0, - /* 149e - */ 0, - /* 149f - */ 0, - /* 14a0 - */ 0, - /* 14a1 - _66_0F_3A_16 */ 0x414e, - /* 14a2 - */ 0, - /* 14a3 - */ 0, - /* 14a4 - */ 0, - /* 14a5 - _V_66_0F_3A_16 */ 0x414f, - /* 14a6 - */ 0, - /* 14a7 - */ 0, - /* 14a8 - */ 0, - /* 14a9 - */ 0, - /* 14aa - */ 0, - /* 14ab - */ 0, - /* 14ac - */ 0, - /* 14ad - _66_0F_3A_17 */ 0x4150, - /* 14ae - */ 0, - /* 14af - */ 0, - /* 14b0 - */ 0, - /* 14b1 - _V_66_0F_3A_17 */ 0x4151, - /* 14b2 - */ 0, - /* 14b3 - */ 0, - /* 14b4 - */ 0, - /* 14b5 - */ 0, - /* 14b6 - */ 0, - /* 14b7 - */ 0, - /* 14b8 - */ 0, - /* 14b9 - */ 0, - /* 14ba - */ 0, - /* 14bb - */ 0, - /* 14bc - */ 0, - /* 14bd - _V_66_0F_3A_18 */ 0x4152, - /* 14be - */ 0, - /* 14bf - */ 0, - /* 14c0 - */ 0, - /* 14c1 - */ 0, - /* 14c2 - */ 0, - /* 14c3 - */ 0, - /* 14c4 - */ 0, - /* 14c5 - */ 0, - /* 14c6 - */ 0, - /* 14c7 - */ 0, - /* 14c8 - */ 0, - /* 14c9 - _V_66_0F_3A_19 */ 0x4153, - /* 14ca - */ 0, - /* 14cb - */ 0, - /* 14cc - */ 0, - /* 14cd - */ 0, - /* 14ce - */ 0, - /* 14cf - */ 0, - /* 14d0 - */ 0, - /* 14d1 - _66_0F_3A_20 */ 0x4154, - /* 14d2 - */ 0, - /* 14d3 - */ 0, - /* 14d4 - */ 0, - /* 14d5 - _V_66_0F_3A_20 */ 0x4155, - /* 14d6 - */ 0, - /* 14d7 - */ 0, - /* 14d8 - */ 0, - /* 14d9 - */ 0, - /* 14da - */ 0, - /* 14db - */ 0, - /* 14dc - */ 0, - /* 14dd - _66_0F_3A_21 */ 0x4156, - /* 14de - */ 0, - /* 14df - */ 0, - /* 14e0 - */ 0, - /* 14e1 - _V_66_0F_3A_21 */ 0x4157, - /* 14e2 - */ 0, - /* 14e3 - */ 0, - /* 14e4 - */ 0, - /* 14e5 - */ 0, - /* 14e6 - */ 0, - /* 14e7 - */ 0, - /* 14e8 - */ 0, - /* 14e9 - _66_0F_3A_22 */ 0x4158, - /* 14ea - */ 0, - /* 14eb - */ 0, - /* 14ec - */ 0, - /* 14ed - _V_66_0F_3A_22 */ 0x4159, - /* 14ee - */ 0, - /* 14ef - */ 0, - /* 14f0 - */ 0, - /* 14f1 - */ 0, - /* 14f2 - */ 0, - /* 14f3 - */ 0, - /* 14f4 - */ 0, - /* 14f5 - _66_0F_3A_40 */ 0x415a, - /* 14f6 - */ 0, - /* 14f7 - */ 0, - /* 14f8 - */ 0, - /* 14f9 - _V_66_0F_3A_40 */ 0x415b, - /* 14fa - */ 0, - /* 14fb - */ 0, - /* 14fc - */ 0, - /* 14fd - */ 0, - /* 14fe - */ 0, - /* 14ff - */ 0, - /* 1500 - */ 0, - /* 1501 - _66_0F_3A_41 */ 0x415c, - /* 1502 - */ 0, - /* 1503 - */ 0, - /* 1504 - */ 0, - /* 1505 - _V_66_0F_3A_41 */ 0x415d, - /* 1506 - */ 0, - /* 1507 - */ 0, - /* 1508 - */ 0, - /* 1509 - */ 0, - /* 150a - */ 0, - /* 150b - */ 0, - /* 150c - */ 0, - /* 150d - _66_0F_3A_42 */ 0x415e, - /* 150e - */ 0, - /* 150f - */ 0, - /* 1510 - */ 0, - /* 1511 - _V_66_0F_3A_42 */ 0x415f, - /* 1512 - */ 0, - /* 1513 - */ 0, - /* 1514 - */ 0, - /* 1515 - */ 0, - /* 1516 - */ 0, - /* 1517 - */ 0, - /* 1518 - */ 0, - /* 1519 - _66_0F_3A_44 */ 0x4160, - /* 151a - */ 0, - /* 151b - */ 0, - /* 151c - */ 0, - /* 151d - _V_66_0F_3A_44 */ 0x4161, - /* 151e - */ 0, - /* 151f - */ 0, - /* 1520 - */ 0, - /* 1521 - */ 0, - /* 1522 - */ 0, - /* 1523 - */ 0, - /* 1524 - */ 0, - /* 1525 - */ 0, - /* 1526 - */ 0, - /* 1527 - */ 0, - /* 1528 - */ 0, - /* 1529 - _V_66_0F_3A_4A */ 0x4162, - /* 152a - */ 0, - /* 152b - */ 0, - /* 152c - */ 0, - /* 152d - */ 0, - /* 152e - */ 0, - /* 152f - */ 0, - /* 1530 - */ 0, - /* 1531 - */ 0, - /* 1532 - */ 0, - /* 1533 - */ 0, - /* 1534 - */ 0, - /* 1535 - _V_66_0F_3A_4B */ 0x4163, - /* 1536 - */ 0, - /* 1537 - */ 0, - /* 1538 - */ 0, - /* 1539 - */ 0, - /* 153a - */ 0, - /* 153b - */ 0, - /* 153c - */ 0, - /* 153d - */ 0, - /* 153e - */ 0, - /* 153f - */ 0, - /* 1540 - */ 0, - /* 1541 - _V_66_0F_3A_4C */ 0x4164, - /* 1542 - */ 0, - /* 1543 - */ 0, - /* 1544 - */ 0, - /* 1545 - */ 0, - /* 1546 - */ 0, - /* 1547 - */ 0, - /* 1548 - */ 0, - /* 1549 - _66_0F_3A_60 */ 0x4165, - /* 154a - */ 0, - /* 154b - */ 0, - /* 154c - */ 0, - /* 154d - _V_66_0F_3A_60 */ 0x4166, - /* 154e - */ 0, - /* 154f - */ 0, - /* 1550 - */ 0, - /* 1551 - */ 0, - /* 1552 - */ 0, - /* 1553 - */ 0, - /* 1554 - */ 0, - /* 1555 - _66_0F_3A_61 */ 0x4167, - /* 1556 - */ 0, - /* 1557 - */ 0, - /* 1558 - */ 0, - /* 1559 - _V_66_0F_3A_61 */ 0x4168, - /* 155a - */ 0, - /* 155b - */ 0, - /* 155c - */ 0, - /* 155d - */ 0, - /* 155e - */ 0, - /* 155f - */ 0, - /* 1560 - */ 0, - /* 1561 - _66_0F_3A_62 */ 0x4169, - /* 1562 - */ 0, - /* 1563 - */ 0, - /* 1564 - */ 0, - /* 1565 - _V_66_0F_3A_62 */ 0x416a, - /* 1566 - */ 0, - /* 1567 - */ 0, - /* 1568 - */ 0, - /* 1569 - */ 0, - /* 156a - */ 0, - /* 156b - */ 0, - /* 156c - */ 0, - /* 156d - _66_0F_3A_63 */ 0x416b, - /* 156e - */ 0, - /* 156f - */ 0, - /* 1570 - */ 0, - /* 1571 - _V_66_0F_3A_63 */ 0x416c, - /* 1572 - */ 0, - /* 1573 - */ 0, - /* 1574 - */ 0, - /* 1575 - */ 0, - /* 1576 - */ 0, - /* 1577 - */ 0, - /* 1578 - */ 0, - /* 1579 - _66_0F_3A_DF */ 0x416d, - /* 157a - */ 0, - /* 157b - */ 0, - /* 157c - */ 0, - /* 157d - _V_66_0F_3A_DF */ 0x416e, - /* 157e - */ 0, - /* 157f - */ 0, - /* 1580 - */ 0, - /* 1581 - */ 0, - /* 1582 - */ 0, - /* 1583 - */ 0, - /* 1584 - _0F_71_02 */ 0x24c3, - /* 1585 - _66_0F_71_02 */ 0x24c4, - /* 1586 - */ 0, - /* 1587 - */ 0, - /* 1588 - */ 0, - /* 1589 - _V_66_0F_71_02 */ 0x416f, - /* 158a - */ 0, - /* 158b - */ 0, - /* 158c - */ 0, - /* 158d - */ 0, - /* 158e - */ 0, - /* 158f - */ 0, - /* 1590 - _0F_71_04 */ 0x24c5, - /* 1591 - _66_0F_71_04 */ 0x24c6, - /* 1592 - */ 0, - /* 1593 - */ 0, - /* 1594 - */ 0, - /* 1595 - _V_66_0F_71_04 */ 0x4170, - /* 1596 - */ 0, - /* 1597 - */ 0, - /* 1598 - */ 0, - /* 1599 - */ 0, - /* 159a - */ 0, - /* 159b - */ 0, - /* 159c - _0F_71_06 */ 0x24c7, - /* 159d - _66_0F_71_06 */ 0x24c8, - /* 159e - */ 0, - /* 159f - */ 0, - /* 15a0 - */ 0, - /* 15a1 - _V_66_0F_71_06 */ 0x4171, - /* 15a2 - */ 0, - /* 15a3 - */ 0, - /* 15a4 - */ 0, - /* 15a5 - */ 0, - /* 15a6 - */ 0, - /* 15a7 - */ 0, - /* 15a8 - _0F_72_02 */ 0x24c9, - /* 15a9 - _66_0F_72_02 */ 0x24ca, - /* 15aa - */ 0, - /* 15ab - */ 0, - /* 15ac - */ 0, - /* 15ad - _V_66_0F_72_02 */ 0x4172, - /* 15ae - */ 0, - /* 15af - */ 0, - /* 15b0 - */ 0, - /* 15b1 - */ 0, - /* 15b2 - */ 0, - /* 15b3 - */ 0, - /* 15b4 - _0F_72_04 */ 0x24cb, - /* 15b5 - _66_0F_72_04 */ 0x24cc, - /* 15b6 - */ 0, - /* 15b7 - */ 0, - /* 15b8 - */ 0, - /* 15b9 - _V_66_0F_72_04 */ 0x4173, - /* 15ba - */ 0, - /* 15bb - */ 0, - /* 15bc - */ 0, - /* 15bd - */ 0, - /* 15be - */ 0, - /* 15bf - */ 0, - /* 15c0 - _0F_72_06 */ 0x24cd, - /* 15c1 - _66_0F_72_06 */ 0x24ce, - /* 15c2 - */ 0, - /* 15c3 - */ 0, - /* 15c4 - */ 0, - /* 15c5 - _V_66_0F_72_06 */ 0x4174, - /* 15c6 - */ 0, - /* 15c7 - */ 0, - /* 15c8 - */ 0, - /* 15c9 - */ 0, - /* 15ca - */ 0, - /* 15cb - */ 0, - /* 15cc - _0F_73_02 */ 0x24cf, - /* 15cd - _66_0F_73_02 */ 0x24d0, - /* 15ce - */ 0, - /* 15cf - */ 0, - /* 15d0 - */ 0, - /* 15d1 - _V_66_0F_73_02 */ 0x4175, - /* 15d2 - */ 0, - /* 15d3 - */ 0, - /* 15d4 - */ 0, - /* 15d5 - */ 0, - /* 15d6 - */ 0, - /* 15d7 - */ 0, - /* 15d8 - */ 0, - /* 15d9 - _66_0F_73_03 */ 0x24d1, - /* 15da - */ 0, - /* 15db - */ 0, - /* 15dc - */ 0, - /* 15dd - _V_66_0F_73_03 */ 0x4176, - /* 15de - */ 0, - /* 15df - */ 0, - /* 15e0 - */ 0, - /* 15e1 - */ 0, - /* 15e2 - */ 0, - /* 15e3 - */ 0, - /* 15e4 - _0F_73_06 */ 0x24d2, - /* 15e5 - _66_0F_73_06 */ 0x24d3, - /* 15e6 - */ 0, - /* 15e7 - */ 0, - /* 15e8 - */ 0, - /* 15e9 - _V_66_0F_73_06 */ 0x4177, - /* 15ea - */ 0, - /* 15eb - */ 0, - /* 15ec - */ 0, - /* 15ed - */ 0, - /* 15ee - */ 0, - /* 15ef - */ 0, - /* 15f0 - */ 0, - /* 15f1 - _66_0F_73_07 */ 0x24d4, - /* 15f2 - */ 0, - /* 15f3 - */ 0, - /* 15f4 - */ 0, - /* 15f5 - _V_66_0F_73_07 */ 0x4178, - /* 15f6 - */ 0, - /* 15f7 - */ 0, - /* 15f8 - */ 0, - /* 15f9 - */ 0, - /* 15fa - */ 0, - /* 15fb - */ 0, - /* 15fc - _0F_AE_00 */ 0x4179, - /* 15fd - */ 0, - /* 15fe - _F3_0F_AE_00 */ 0x24d5, - /* 15ff - */ 0, - /* 1600 - */ 0, - /* 1601 - */ 0, - /* 1602 - */ 0, - /* 1603 - */ 0, - /* 1604 - */ 0, - /* 1605 - */ 0, - /* 1606 - */ 0, - /* 1607 - */ 0, - /* 1608 - _0F_AE_01 */ 0x417a, - /* 1609 - */ 0, - /* 160a - _F3_0F_AE_01 */ 0x24d6, - /* 160b - */ 0, - /* 160c - */ 0, - /* 160d - */ 0, - /* 160e - */ 0, - /* 160f - */ 0, - /* 1610 - */ 0, - /* 1611 - */ 0, - /* 1612 - */ 0, - /* 1613 - */ 0, - /* 1614 - _0F_AE_02 */ 0x24d7, - /* 1615 - */ 0, - /* 1616 - _F3_0F_AE_02 */ 0x24d8, - /* 1617 - */ 0, - /* 1618 - _V_0F_AE_02 */ 0x417b, - /* 1619 - */ 0, - /* 161a - */ 0, - /* 161b - */ 0, - /* 161c - */ 0, - /* 161d - */ 0, - /* 161e - */ 0, - /* 161f - */ 0, - /* 1620 - _0F_AE_03 */ 0x24d9, - /* 1621 - */ 0, - /* 1622 - _F3_0F_AE_03 */ 0x24da, - /* 1623 - */ 0, - /* 1624 - _V_0F_AE_03 */ 0x417c, - /* 1625 - */ 0, - /* 1626 - */ 0, - /* 1627 - */ 0, - /* 1628 - */ 0, - /* 1629 - */ 0, - /* 162a - */ 0, - /* 162b - */ 0, - /* 162c - _0F_C7_06 */ 0x24db, - /* 162d - _66_0F_C7_06 */ 0x24dc, - /* 162e - _F3_0F_C7_06 */ 0x24dd, - /* 162f - */ 0, - /* 1630 - */ 0, - /* 1631 - */ 0, - /* 1632 - */ 0, - /* 1633 - */ 0, - /* 1634 - */ 0, - /* 1635 - */ 0, - /* 1636 - */ 0, - /* 1637 - */ 0 +/* 0 - _00 */ 0x2000, +/* 1 - _01 */ 0x2001, +/* 2 - _02 */ 0x2002, +/* 3 - _03 */ 0x2003, +/* 4 - _04 */ 0x2004, +/* 5 - _05 */ 0x2005, +/* 6 - _06 */ 0x2006, +/* 7 - _07 */ 0x2007, +/* 8 - _08 */ 0x2008, +/* 9 - _09 */ 0x2009, +/* a - _0A */ 0x200a, +/* b - _0B */ 0x200b, +/* c - _0C */ 0x200c, +/* d - _0D */ 0x200d, +/* e - _0E */ 0x200e, +/* f - _0F */ 0xa100, +/* 10 - _10 */ 0x200f, +/* 11 - _11 */ 0x2010, +/* 12 - _12 */ 0x2011, +/* 13 - _13 */ 0x2012, +/* 14 - _14 */ 0x2013, +/* 15 - _15 */ 0x2014, +/* 16 - _16 */ 0x2015, +/* 17 - _17 */ 0x2016, +/* 18 - _18 */ 0x2017, +/* 19 - _19 */ 0x2018, +/* 1a - _1A */ 0x2019, +/* 1b - _1B */ 0x201a, +/* 1c - _1C */ 0x201b, +/* 1d - _1D */ 0x201c, +/* 1e - _1E */ 0x201d, +/* 1f - _1F */ 0x201e, +/* 20 - _20 */ 0x201f, +/* 21 - _21 */ 0x2020, +/* 22 - _22 */ 0x2021, +/* 23 - _23 */ 0x2022, +/* 24 - _24 */ 0x2023, +/* 25 - _25 */ 0x2024, +/* 26 - */ 0, +/* 27 - _27 */ 0x2025, +/* 28 - _28 */ 0x2026, +/* 29 - _29 */ 0x2027, +/* 2a - _2A */ 0x2028, +/* 2b - _2B */ 0x2029, +/* 2c - _2C */ 0x202a, +/* 2d - _2D */ 0x202b, +/* 2e - */ 0, +/* 2f - _2F */ 0x202c, +/* 30 - _30 */ 0x202d, +/* 31 - _31 */ 0x202e, +/* 32 - _32 */ 0x202f, +/* 33 - _33 */ 0x2030, +/* 34 - _34 */ 0x2031, +/* 35 - _35 */ 0x2032, +/* 36 - */ 0, +/* 37 - _37 */ 0x2033, +/* 38 - _38 */ 0x2034, +/* 39 - _39 */ 0x2035, +/* 3a - _3A */ 0x2036, +/* 3b - _3B */ 0x2037, +/* 3c - _3C */ 0x2038, +/* 3d - _3D */ 0x2039, +/* 3e - */ 0, +/* 3f - _3F */ 0x203a, +/* 40 - _40 */ 0x203b, +/* 41 - _40 */ 0x203c, +/* 42 - _40 */ 0x203d, +/* 43 - _40 */ 0x203e, +/* 44 - _40 */ 0x203f, +/* 45 - _40 */ 0x2040, +/* 46 - _40 */ 0x2041, +/* 47 - _40 */ 0x2042, +/* 48 - _48 */ 0x2043, +/* 49 - _48 */ 0x2044, +/* 4a - _48 */ 0x2045, +/* 4b - _48 */ 0x2046, +/* 4c - _48 */ 0x2047, +/* 4d - _48 */ 0x2048, +/* 4e - _48 */ 0x2049, +/* 4f - _48 */ 0x204a, +/* 50 - _50 */ 0x204b, +/* 51 - _50 */ 0x204c, +/* 52 - _50 */ 0x204d, +/* 53 - _50 */ 0x204e, +/* 54 - _50 */ 0x204f, +/* 55 - _50 */ 0x2050, +/* 56 - _50 */ 0x2051, +/* 57 - _50 */ 0x2052, +/* 58 - _58 */ 0x2053, +/* 59 - _58 */ 0x2054, +/* 5a - _58 */ 0x2055, +/* 5b - _58 */ 0x2056, +/* 5c - _58 */ 0x2057, +/* 5d - _58 */ 0x2058, +/* 5e - _58 */ 0x2059, +/* 5f - _58 */ 0x205a, +/* 60 - _60 */ 0x205b, +/* 61 - _61 */ 0x205c, +/* 62 - _62 */ 0x205d, +/* 63 - _63 */ 0x605e, +/* 64 - */ 0, +/* 65 - */ 0, +/* 66 - */ 0, +/* 67 - */ 0, +/* 68 - _68 */ 0x205f, +/* 69 - _69 */ 0x4000, +/* 6a - _6A */ 0x2060, +/* 6b - _6B */ 0x4001, +/* 6c - _6C */ 0x2061, +/* 6d - _6D */ 0x2062, +/* 6e - _6E */ 0x2063, +/* 6f - _6F */ 0x2064, +/* 70 - _70 */ 0x2065, +/* 71 - _71 */ 0x2066, +/* 72 - _72 */ 0x2067, +/* 73 - _73 */ 0x2068, +/* 74 - _74 */ 0x2069, +/* 75 - _75 */ 0x206a, +/* 76 - _76 */ 0x206b, +/* 77 - _77 */ 0x206c, +/* 78 - _78 */ 0x206d, +/* 79 - _79 */ 0x206e, +/* 7a - _7A */ 0x206f, +/* 7b - _7B */ 0x2070, +/* 7c - _7C */ 0x2071, +/* 7d - _7D */ 0x2072, +/* 7e - _7E */ 0x2073, +/* 7f - _7F */ 0x2074, +/* 80 - _80 */ 0x8200, +/* 81 - _81 */ 0x8208, +/* 82 - _82 */ 0x8210, +/* 83 - _83 */ 0x8218, +/* 84 - _84 */ 0x2075, +/* 85 - _85 */ 0x2076, +/* 86 - _86 */ 0x2077, +/* 87 - _87 */ 0x2078, +/* 88 - _88 */ 0x2079, +/* 89 - _89 */ 0x207a, +/* 8a - _8A */ 0x207b, +/* 8b - _8B */ 0x207c, +/* 8c - _8C */ 0x207d, +/* 8d - _8D */ 0x607e, +/* 8e - _8E */ 0x207f, +/* 8f - _8F */ 0x8220, +/* 90 - _90 */ 0x6080, +/* 91 - _91 */ 0x2081, +/* 92 - _92 */ 0x2082, +/* 93 - _93 */ 0x2083, +/* 94 - _94 */ 0x2084, +/* 95 - _95 */ 0x2085, +/* 96 - _96 */ 0x2086, +/* 97 - _97 */ 0x2087, +/* 98 - _98 */ 0x4002, +/* 99 - _99 */ 0x4003, +/* 9a - _9A */ 0x2088, +/* 9b - */ 0, +/* 9c - _9C */ 0x2089, +/* 9d - _9D */ 0x208a, +/* 9e - _9E */ 0x208b, +/* 9f - _9F */ 0x208c, +/* a0 - _A0 */ 0x208d, +/* a1 - _A1 */ 0x208e, +/* a2 - _A2 */ 0x208f, +/* a3 - _A3 */ 0x2090, +/* a4 - _A4 */ 0x2091, +/* a5 - _A5 */ 0x2092, +/* a6 - _A6 */ 0x2093, +/* a7 - _A7 */ 0x2094, +/* a8 - _A8 */ 0x2095, +/* a9 - _A9 */ 0x2096, +/* aa - _AA */ 0x2097, +/* ab - _AB */ 0x2098, +/* ac - _AC */ 0x2099, +/* ad - _AD */ 0x209a, +/* ae - _AE */ 0x209b, +/* af - _AF */ 0x209c, +/* b0 - _B0 */ 0x209d, +/* b1 - _B0 */ 0x209e, +/* b2 - _B0 */ 0x209f, +/* b3 - _B0 */ 0x20a0, +/* b4 - _B0 */ 0x20a1, +/* b5 - _B0 */ 0x20a2, +/* b6 - _B0 */ 0x20a3, +/* b7 - _B0 */ 0x20a4, +/* b8 - _B8 */ 0x20a5, +/* b9 - _B8 */ 0x20a6, +/* ba - _B8 */ 0x20a7, +/* bb - _B8 */ 0x20a8, +/* bc - _B8 */ 0x20a9, +/* bd - _B8 */ 0x20aa, +/* be - _B8 */ 0x20ab, +/* bf - _B8 */ 0x20ac, +/* c0 - _C0 */ 0x8228, +/* c1 - _C1 */ 0x8230, +/* c2 - _C2 */ 0x20ad, +/* c3 - _C3 */ 0x20ae, +/* c4 - _C4 */ 0x20af, +/* c5 - _C5 */ 0x20b0, +/* c6 - _C6 */ 0xc238, +/* c7 - _C7 */ 0xc280, +/* c8 - _C8 */ 0x20b1, +/* c9 - _C9 */ 0x20b2, +/* ca - _CA */ 0x20b3, +/* cb - _CB */ 0x20b4, +/* cc - _CC */ 0x20b5, +/* cd - _CD */ 0x20b6, +/* ce - _CE */ 0x20b7, +/* cf - _CF */ 0x20b8, +/* 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 */ 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, +/* e3 - _E3 */ 0x4004, +/* e4 - _E4 */ 0x20c0, +/* e5 - _E5 */ 0x20c1, +/* e6 - _E6 */ 0x20c2, +/* e7 - _E7 */ 0x20c3, +/* e8 - _E8 */ 0x20c4, +/* e9 - _E9 */ 0x20c5, +/* ea - _EA */ 0x20c6, +/* eb - _EB */ 0x20c7, +/* ec - _EC */ 0x20c8, +/* ed - _ED */ 0x20c9, +/* ee - _EE */ 0x20ca, +/* ef - _EF */ 0x20cb, +/* f0 - */ 0, +/* f1 - _F1 */ 0x20cc, +/* f2 - */ 0, +/* f3 - */ 0, +/* f4 - _F4 */ 0x20cd, +/* f5 - _F5 */ 0x20ce, +/* 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 */ 0x8538, +/* ff - _FF */ 0x8540, +/* 100 - _0F_00 */ 0x8548, +/* 101 - _0F_01 */ 0xc550, +/* 102 - _0F_02 */ 0x20d5, +/* 103 - _0F_03 */ 0x20d6, +/* 104 - */ 0, +/* 105 - _0F_05 */ 0x20d7, +/* 106 - _0F_06 */ 0x20d8, +/* 107 - _0F_07 */ 0x20d9, +/* 108 - _0F_08 */ 0x20da, +/* 109 - _0F_09 */ 0x20db, +/* 10a - */ 0, +/* 10b - _0F_0B */ 0x20dc, +/* 10c - */ 0, +/* 10d - _0F_0D */ 0x8598, +/* 10e - _0F_0E */ 0x20dd, +/* 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, +/* 11c - */ 0, +/* 11d - */ 0, +/* 11e - */ 0, +/* 11f - _0F_1F */ 0x20de, +/* 120 - _0F_20 */ 0x20df, +/* 121 - _0F_21 */ 0x20e0, +/* 122 - _0F_22 */ 0x20e1, +/* 123 - _0F_23 */ 0x20e2, +/* 124 - */ 0, +/* 125 - */ 0, +/* 126 - */ 0, +/* 127 - */ 0, +/* 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, +/* 133 - _0F_33 */ 0x20e6, +/* 134 - _0F_34 */ 0x20e7, +/* 135 - _0F_35 */ 0x20e8, +/* 136 - */ 0, +/* 137 - _0F_37 */ 0x20e9, +/* 138 - _0F_38 */ 0xa768, +/* 139 - */ 0, +/* 13a - _0F_3A */ 0xa868, +/* 13b - */ 0, +/* 13c - */ 0, +/* 13d - */ 0, +/* 13e - */ 0, +/* 13f - */ 0, +/* 140 - _0F_40 */ 0x20ea, +/* 141 - _0F_41 */ 0x20eb, +/* 142 - _0F_42 */ 0x20ec, +/* 143 - _0F_43 */ 0x20ed, +/* 144 - _0F_44 */ 0x20ee, +/* 145 - _0F_45 */ 0x20ef, +/* 146 - _0F_46 */ 0x20f0, +/* 147 - _0F_47 */ 0x20f1, +/* 148 - _0F_48 */ 0x20f2, +/* 149 - _0F_49 */ 0x20f3, +/* 14a - _0F_4A */ 0x20f4, +/* 14b - _0F_4B */ 0x20f5, +/* 14c - _0F_4C */ 0x20f6, +/* 14d - _0F_4D */ 0x20f7, +/* 14e - _0F_4E */ 0x20f8, +/* 14f - _0F_4F */ 0x20f9, +/* 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 */ 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, +/* 183 - _0F_83 */ 0x20fd, +/* 184 - _0F_84 */ 0x20fe, +/* 185 - _0F_85 */ 0x20ff, +/* 186 - _0F_86 */ 0x2100, +/* 187 - _0F_87 */ 0x2101, +/* 188 - _0F_88 */ 0x2102, +/* 189 - _0F_89 */ 0x2103, +/* 18a - _0F_8A */ 0x2104, +/* 18b - _0F_8B */ 0x2105, +/* 18c - _0F_8C */ 0x2106, +/* 18d - _0F_8D */ 0x2107, +/* 18e - _0F_8E */ 0x2108, +/* 18f - _0F_8F */ 0x2109, +/* 190 - _0F_90 */ 0x210a, +/* 191 - _0F_91 */ 0x210b, +/* 192 - _0F_92 */ 0x210c, +/* 193 - _0F_93 */ 0x210d, +/* 194 - _0F_94 */ 0x210e, +/* 195 - _0F_95 */ 0x210f, +/* 196 - _0F_96 */ 0x2110, +/* 197 - _0F_97 */ 0x2111, +/* 198 - _0F_98 */ 0x2112, +/* 199 - _0F_99 */ 0x2113, +/* 19a - _0F_9A */ 0x2114, +/* 19b - _0F_9B */ 0x2115, +/* 19c - _0F_9C */ 0x2116, +/* 19d - _0F_9D */ 0x2117, +/* 19e - _0F_9E */ 0x2118, +/* 19f - _0F_9F */ 0x2119, +/* 1a0 - _0F_A0 */ 0x211a, +/* 1a1 - _0F_A1 */ 0x211b, +/* 1a2 - _0F_A2 */ 0x211c, +/* 1a3 - _0F_A3 */ 0x211d, +/* 1a4 - _0F_A4 */ 0x4005, +/* 1a5 - _0F_A5 */ 0x4006, +/* 1a6 - */ 0, +/* 1a7 - */ 0, +/* 1a8 - _0F_A8 */ 0x211e, +/* 1a9 - _0F_A9 */ 0x211f, +/* 1aa - _0F_AA */ 0x2120, +/* 1ab - _0F_AB */ 0x2121, +/* 1ac - _0F_AC */ 0x4007, +/* 1ad - _0F_AD */ 0x4008, +/* 1ae - _0F_AE */ 0x8c84, +/* 1af - _0F_AF */ 0x2122, +/* 1b0 - _0F_B0 */ 0x2123, +/* 1b1 - _0F_B1 */ 0x2124, +/* 1b2 - _0F_B2 */ 0x2125, +/* 1b3 - _0F_B3 */ 0x2126, +/* 1b4 - _0F_B4 */ 0x2127, +/* 1b5 - _0F_B5 */ 0x2128, +/* 1b6 - _0F_B6 */ 0x2129, +/* 1b7 - _0F_B7 */ 0x212a, +/* 1b8 - _0F_B8 */ 0xec8c, +/* 1b9 - _0F_B9 */ 0x212b, +/* 1ba - _0F_BA */ 0x8c98, +/* 1bb - _0F_BB */ 0x212c, +/* 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 */ 0xecb8, +/* 1c3 - _0F_C3 */ 0x2131, +/* 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, +/* 1cb - _0F_C8 */ 0x2135, +/* 1cc - _0F_C8 */ 0x2136, +/* 1cd - _0F_C8 */ 0x2137, +/* 1ce - _0F_C8 */ 0x2138, +/* 1cf - _0F_C8 */ 0x2139, +/* 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, +/* 202 - _80_02 */ 0x213c, +/* 203 - _80_03 */ 0x213d, +/* 204 - _80_04 */ 0x213e, +/* 205 - _80_05 */ 0x213f, +/* 206 - _80_06 */ 0x2140, +/* 207 - _80_07 */ 0x2141, +/* 208 - _81_00 */ 0x2142, +/* 209 - _81_01 */ 0x2143, +/* 20a - _81_02 */ 0x2144, +/* 20b - _81_03 */ 0x2145, +/* 20c - _81_04 */ 0x2146, +/* 20d - _81_05 */ 0x2147, +/* 20e - _81_06 */ 0x2148, +/* 20f - _81_07 */ 0x2149, +/* 210 - _82_00 */ 0x214a, +/* 211 - _82_01 */ 0x214b, +/* 212 - _82_02 */ 0x214c, +/* 213 - _82_03 */ 0x214d, +/* 214 - _82_04 */ 0x214e, +/* 215 - _82_05 */ 0x214f, +/* 216 - _82_06 */ 0x2150, +/* 217 - _82_07 */ 0x2151, +/* 218 - _83_00 */ 0x2152, +/* 219 - _83_01 */ 0x2153, +/* 21a - _83_02 */ 0x2154, +/* 21b - _83_03 */ 0x2155, +/* 21c - _83_04 */ 0x2156, +/* 21d - _83_05 */ 0x2157, +/* 21e - _83_06 */ 0x2158, +/* 21f - _83_07 */ 0x2159, +/* 220 - _8F_00 */ 0x215a, +/* 221 - */ 0, +/* 222 - */ 0, +/* 223 - */ 0, +/* 224 - */ 0, +/* 225 - */ 0, +/* 226 - */ 0, +/* 227 - */ 0, +/* 228 - _C0_00 */ 0x215b, +/* 229 - _C0_01 */ 0x215c, +/* 22a - _C0_02 */ 0x215d, +/* 22b - _C0_03 */ 0x215e, +/* 22c - _C0_04 */ 0x215f, +/* 22d - _C0_05 */ 0x2160, +/* 22e - _C0_06 */ 0x2161, +/* 22f - _C0_07 */ 0x2162, +/* 230 - _C1_00 */ 0x2163, +/* 231 - _C1_01 */ 0x2164, +/* 232 - _C1_02 */ 0x2165, +/* 233 - _C1_03 */ 0x2166, +/* 234 - _C1_04 */ 0x2167, +/* 235 - _C1_05 */ 0x2168, +/* 236 - _C1_06 */ 0x2169, +/* 237 - _C1_07 */ 0x216a, +/* 238 - _C6_00 */ 0x216b, +/* 239 - */ 0, +/* 23a - */ 0, +/* 23b - */ 0, +/* 23c - */ 0, +/* 23d - */ 0, +/* 23e - */ 0, +/* 23f - */ 0, +/* 240 - */ 0, +/* 241 - */ 0, +/* 242 - */ 0, +/* 243 - */ 0, +/* 244 - */ 0, +/* 245 - */ 0, +/* 246 - */ 0, +/* 247 - */ 0, +/* 248 - */ 0, +/* 249 - */ 0, +/* 24a - */ 0, +/* 24b - */ 0, +/* 24c - */ 0, +/* 24d - */ 0, +/* 24e - */ 0, +/* 24f - */ 0, +/* 250 - */ 0, +/* 251 - */ 0, +/* 252 - */ 0, +/* 253 - */ 0, +/* 254 - */ 0, +/* 255 - */ 0, +/* 256 - */ 0, +/* 257 - */ 0, +/* 258 - */ 0, +/* 259 - */ 0, +/* 25a - */ 0, +/* 25b - */ 0, +/* 25c - */ 0, +/* 25d - */ 0, +/* 25e - */ 0, +/* 25f - */ 0, +/* 260 - */ 0, +/* 261 - */ 0, +/* 262 - */ 0, +/* 263 - */ 0, +/* 264 - */ 0, +/* 265 - */ 0, +/* 266 - */ 0, +/* 267 - */ 0, +/* 268 - */ 0, +/* 269 - */ 0, +/* 26a - */ 0, +/* 26b - */ 0, +/* 26c - */ 0, +/* 26d - */ 0, +/* 26e - */ 0, +/* 26f - */ 0, +/* 270 - */ 0, +/* 271 - */ 0, +/* 272 - */ 0, +/* 273 - */ 0, +/* 274 - */ 0, +/* 275 - */ 0, +/* 276 - */ 0, +/* 277 - */ 0, +/* 278 - _C6_F8 */ 0x216c, +/* 279 - */ 0, +/* 27a - */ 0, +/* 27b - */ 0, +/* 27c - */ 0, +/* 27d - */ 0, +/* 27e - */ 0, +/* 27f - */ 0, +/* 280 - _C7_00 */ 0x216d, +/* 281 - */ 0, +/* 282 - */ 0, +/* 283 - */ 0, +/* 284 - */ 0, +/* 285 - */ 0, +/* 286 - */ 0, +/* 287 - */ 0, +/* 288 - */ 0, +/* 289 - */ 0, +/* 28a - */ 0, +/* 28b - */ 0, +/* 28c - */ 0, +/* 28d - */ 0, +/* 28e - */ 0, +/* 28f - */ 0, +/* 290 - */ 0, +/* 291 - */ 0, +/* 292 - */ 0, +/* 293 - */ 0, +/* 294 - */ 0, +/* 295 - */ 0, +/* 296 - */ 0, +/* 297 - */ 0, +/* 298 - */ 0, +/* 299 - */ 0, +/* 29a - */ 0, +/* 29b - */ 0, +/* 29c - */ 0, +/* 29d - */ 0, +/* 29e - */ 0, +/* 29f - */ 0, +/* 2a0 - */ 0, +/* 2a1 - */ 0, +/* 2a2 - */ 0, +/* 2a3 - */ 0, +/* 2a4 - */ 0, +/* 2a5 - */ 0, +/* 2a6 - */ 0, +/* 2a7 - */ 0, +/* 2a8 - */ 0, +/* 2a9 - */ 0, +/* 2aa - */ 0, +/* 2ab - */ 0, +/* 2ac - */ 0, +/* 2ad - */ 0, +/* 2ae - */ 0, +/* 2af - */ 0, +/* 2b0 - */ 0, +/* 2b1 - */ 0, +/* 2b2 - */ 0, +/* 2b3 - */ 0, +/* 2b4 - */ 0, +/* 2b5 - */ 0, +/* 2b6 - */ 0, +/* 2b7 - */ 0, +/* 2b8 - */ 0, +/* 2b9 - */ 0, +/* 2ba - */ 0, +/* 2bb - */ 0, +/* 2bc - */ 0, +/* 2bd - */ 0, +/* 2be - */ 0, +/* 2bf - */ 0, +/* 2c0 - _C7_F8 */ 0x216e, +/* 2c1 - */ 0, +/* 2c2 - */ 0, +/* 2c3 - */ 0, +/* 2c4 - */ 0, +/* 2c5 - */ 0, +/* 2c6 - */ 0, +/* 2c7 - */ 0, +/* 2c8 - _D0_00 */ 0x216f, +/* 2c9 - _D0_01 */ 0x2170, +/* 2ca - _D0_02 */ 0x2171, +/* 2cb - _D0_03 */ 0x2172, +/* 2cc - _D0_04 */ 0x2173, +/* 2cd - _D0_05 */ 0x2174, +/* 2ce - _D0_06 */ 0x2175, +/* 2cf - _D0_07 */ 0x2176, +/* 2d0 - _D1_00 */ 0x2177, +/* 2d1 - _D1_01 */ 0x2178, +/* 2d2 - _D1_02 */ 0x2179, +/* 2d3 - _D1_03 */ 0x217a, +/* 2d4 - _D1_04 */ 0x217b, +/* 2d5 - _D1_05 */ 0x217c, +/* 2d6 - _D1_06 */ 0x217d, +/* 2d7 - _D1_07 */ 0x217e, +/* 2d8 - _D2_00 */ 0x217f, +/* 2d9 - _D2_01 */ 0x2180, +/* 2da - _D2_02 */ 0x2181, +/* 2db - _D2_03 */ 0x2182, +/* 2dc - _D2_04 */ 0x2183, +/* 2dd - _D2_05 */ 0x2184, +/* 2de - _D2_06 */ 0x2185, +/* 2df - _D2_07 */ 0x2186, +/* 2e0 - _D3_00 */ 0x2187, +/* 2e1 - _D3_01 */ 0x2188, +/* 2e2 - _D3_02 */ 0x2189, +/* 2e3 - _D3_03 */ 0x218a, +/* 2e4 - _D3_04 */ 0x218b, +/* 2e5 - _D3_05 */ 0x218c, +/* 2e6 - _D3_06 */ 0x218d, +/* 2e7 - _D3_07 */ 0x218e, +/* 2e8 - _D8_00 */ 0x218f, +/* 2e9 - _D8_01 */ 0x2190, +/* 2ea - _D8_02 */ 0x2191, +/* 2eb - _D8_03 */ 0x2192, +/* 2ec - _D8_04 */ 0x2193, +/* 2ed - _D8_05 */ 0x2194, +/* 2ee - _D8_06 */ 0x2195, +/* 2ef - _D8_07 */ 0x2196, +/* 2f0 - _D8_C0 */ 0x2197, +/* 2f1 - _D8_C0 */ 0x2198, +/* 2f2 - _D8_C0 */ 0x2199, +/* 2f3 - _D8_C0 */ 0x219a, +/* 2f4 - _D8_C0 */ 0x219b, +/* 2f5 - _D8_C0 */ 0x219c, +/* 2f6 - _D8_C0 */ 0x219d, +/* 2f7 - _D8_C0 */ 0x219e, +/* 2f8 - _D8_C8 */ 0x219f, +/* 2f9 - _D8_C8 */ 0x21a0, +/* 2fa - _D8_C8 */ 0x21a1, +/* 2fb - _D8_C8 */ 0x21a2, +/* 2fc - _D8_C8 */ 0x21a3, +/* 2fd - _D8_C8 */ 0x21a4, +/* 2fe - _D8_C8 */ 0x21a5, +/* 2ff - _D8_C8 */ 0x21a6, +/* 300 - _D8_D0 */ 0x21a7, +/* 301 - _D8_D0 */ 0x21a8, +/* 302 - _D8_D0 */ 0x21a9, +/* 303 - _D8_D0 */ 0x21aa, +/* 304 - _D8_D0 */ 0x21ab, +/* 305 - _D8_D0 */ 0x21ac, +/* 306 - _D8_D0 */ 0x21ad, +/* 307 - _D8_D0 */ 0x21ae, +/* 308 - _D8_D8 */ 0x21af, +/* 309 - _D8_D9 */ 0x21b0, +/* 30a - _D8_D8 */ 0x21b1, +/* 30b - _D8_D8 */ 0x21b2, +/* 30c - _D8_D8 */ 0x21b3, +/* 30d - _D8_D8 */ 0x21b4, +/* 30e - _D8_D8 */ 0x21b5, +/* 30f - _D8_D8 */ 0x21b6, +/* 310 - _D8_E0 */ 0x21b7, +/* 311 - _D8_E0 */ 0x21b8, +/* 312 - _D8_E0 */ 0x21b9, +/* 313 - _D8_E0 */ 0x21ba, +/* 314 - _D8_E0 */ 0x21bb, +/* 315 - _D8_E0 */ 0x21bc, +/* 316 - _D8_E0 */ 0x21bd, +/* 317 - _D8_E0 */ 0x21be, +/* 318 - _D8_E8 */ 0x21bf, +/* 319 - _D8_E8 */ 0x21c0, +/* 31a - _D8_E8 */ 0x21c1, +/* 31b - _D8_E8 */ 0x21c2, +/* 31c - _D8_E8 */ 0x21c3, +/* 31d - _D8_E8 */ 0x21c4, +/* 31e - _D8_E8 */ 0x21c5, +/* 31f - _D8_E8 */ 0x21c6, +/* 320 - _D8_F0 */ 0x21c7, +/* 321 - _D8_F0 */ 0x21c8, +/* 322 - _D8_F0 */ 0x21c9, +/* 323 - _D8_F0 */ 0x21ca, +/* 324 - _D8_F0 */ 0x21cb, +/* 325 - _D8_F0 */ 0x21cc, +/* 326 - _D8_F0 */ 0x21cd, +/* 327 - _D8_F0 */ 0x21ce, +/* 328 - _D8_F8 */ 0x21cf, +/* 329 - _D8_F8 */ 0x21d0, +/* 32a - _D8_F8 */ 0x21d1, +/* 32b - _D8_F8 */ 0x21d2, +/* 32c - _D8_F8 */ 0x21d3, +/* 32d - _D8_F8 */ 0x21d4, +/* 32e - _D8_F8 */ 0x21d5, +/* 32f - _D8_F8 */ 0x21d6, +/* 330 - _D9_00 */ 0x21d7, +/* 331 - */ 0, +/* 332 - _D9_02 */ 0x21d8, +/* 333 - _D9_03 */ 0x21d9, +/* 334 - _D9_04 */ 0x21da, +/* 335 - _D9_05 */ 0x21db, +/* 336 - _D9_06 */ 0xef24, +/* 337 - _D9_07 */ 0xef30, +/* 338 - _D9_C0 */ 0x21dc, +/* 339 - _D9_C0 */ 0x21dd, +/* 33a - _D9_C0 */ 0x21de, +/* 33b - _D9_C0 */ 0x21df, +/* 33c - _D9_C0 */ 0x21e0, +/* 33d - _D9_C0 */ 0x21e1, +/* 33e - _D9_C0 */ 0x21e2, +/* 33f - _D9_C0 */ 0x21e3, +/* 340 - _D9_C8 */ 0x21e4, +/* 341 - _D9_C9 */ 0x21e5, +/* 342 - _D9_C8 */ 0x21e6, +/* 343 - _D9_C8 */ 0x21e7, +/* 344 - _D9_C8 */ 0x21e8, +/* 345 - _D9_C8 */ 0x21e9, +/* 346 - _D9_C8 */ 0x21ea, +/* 347 - _D9_C8 */ 0x21eb, +/* 348 - _D9_D0 */ 0x21ec, +/* 349 - */ 0, +/* 34a - */ 0, +/* 34b - */ 0, +/* 34c - */ 0, +/* 34d - */ 0, +/* 34e - */ 0, +/* 34f - */ 0, +/* 350 - */ 0, +/* 351 - */ 0, +/* 352 - */ 0, +/* 353 - */ 0, +/* 354 - */ 0, +/* 355 - */ 0, +/* 356 - */ 0, +/* 357 - */ 0, +/* 358 - _D9_E0 */ 0x21ed, +/* 359 - _D9_E1 */ 0x21ee, +/* 35a - */ 0, +/* 35b - */ 0, +/* 35c - _D9_E4 */ 0x21ef, +/* 35d - _D9_E5 */ 0x21f0, +/* 35e - */ 0, +/* 35f - */ 0, +/* 360 - _D9_E8 */ 0x21f1, +/* 361 - _D9_E9 */ 0x21f2, +/* 362 - _D9_EA */ 0x21f3, +/* 363 - _D9_EB */ 0x21f4, +/* 364 - _D9_EC */ 0x21f5, +/* 365 - _D9_ED */ 0x21f6, +/* 366 - _D9_EE */ 0x21f7, +/* 367 - */ 0, +/* 368 - _D9_F0 */ 0x21f8, +/* 369 - _D9_F1 */ 0x21f9, +/* 36a - _D9_F2 */ 0x21fa, +/* 36b - _D9_F3 */ 0x21fb, +/* 36c - _D9_F4 */ 0x21fc, +/* 36d - _D9_F5 */ 0x21fd, +/* 36e - _D9_F6 */ 0x21fe, +/* 36f - _D9_F7 */ 0x21ff, +/* 370 - _D9_F8 */ 0x2200, +/* 371 - _D9_F9 */ 0x2201, +/* 372 - _D9_FA */ 0x2202, +/* 373 - _D9_FB */ 0x2203, +/* 374 - _D9_FC */ 0x2204, +/* 375 - _D9_FD */ 0x2205, +/* 376 - _D9_FE */ 0x2206, +/* 377 - _D9_FF */ 0x2207, +/* 378 - _DA_00 */ 0x2208, +/* 379 - _DA_01 */ 0x2209, +/* 37a - _DA_02 */ 0x220a, +/* 37b - _DA_03 */ 0x220b, +/* 37c - _DA_04 */ 0x220c, +/* 37d - _DA_05 */ 0x220d, +/* 37e - _DA_06 */ 0x220e, +/* 37f - _DA_07 */ 0x220f, +/* 380 - _DA_C0 */ 0x2210, +/* 381 - _DA_C0 */ 0x2211, +/* 382 - _DA_C0 */ 0x2212, +/* 383 - _DA_C0 */ 0x2213, +/* 384 - _DA_C0 */ 0x2214, +/* 385 - _DA_C0 */ 0x2215, +/* 386 - _DA_C0 */ 0x2216, +/* 387 - _DA_C0 */ 0x2217, +/* 388 - _DA_C8 */ 0x2218, +/* 389 - _DA_C8 */ 0x2219, +/* 38a - _DA_C8 */ 0x221a, +/* 38b - _DA_C8 */ 0x221b, +/* 38c - _DA_C8 */ 0x221c, +/* 38d - _DA_C8 */ 0x221d, +/* 38e - _DA_C8 */ 0x221e, +/* 38f - _DA_C8 */ 0x221f, +/* 390 - _DA_D0 */ 0x2220, +/* 391 - _DA_D0 */ 0x2221, +/* 392 - _DA_D0 */ 0x2222, +/* 393 - _DA_D0 */ 0x2223, +/* 394 - _DA_D0 */ 0x2224, +/* 395 - _DA_D0 */ 0x2225, +/* 396 - _DA_D0 */ 0x2226, +/* 397 - _DA_D0 */ 0x2227, +/* 398 - _DA_D8 */ 0x2228, +/* 399 - _DA_D8 */ 0x2229, +/* 39a - _DA_D8 */ 0x222a, +/* 39b - _DA_D8 */ 0x222b, +/* 39c - _DA_D8 */ 0x222c, +/* 39d - _DA_D8 */ 0x222d, +/* 39e - _DA_D8 */ 0x222e, +/* 39f - _DA_D8 */ 0x222f, +/* 3a0 - */ 0, +/* 3a1 - */ 0, +/* 3a2 - */ 0, +/* 3a3 - */ 0, +/* 3a4 - */ 0, +/* 3a5 - */ 0, +/* 3a6 - */ 0, +/* 3a7 - */ 0, +/* 3a8 - */ 0, +/* 3a9 - _DA_E9 */ 0x2230, +/* 3aa - */ 0, +/* 3ab - */ 0, +/* 3ac - */ 0, +/* 3ad - */ 0, +/* 3ae - */ 0, +/* 3af - */ 0, +/* 3b0 - */ 0, +/* 3b1 - */ 0, +/* 3b2 - */ 0, +/* 3b3 - */ 0, +/* 3b4 - */ 0, +/* 3b5 - */ 0, +/* 3b6 - */ 0, +/* 3b7 - */ 0, +/* 3b8 - */ 0, +/* 3b9 - */ 0, +/* 3ba - */ 0, +/* 3bb - */ 0, +/* 3bc - */ 0, +/* 3bd - */ 0, +/* 3be - */ 0, +/* 3bf - */ 0, +/* 3c0 - _DB_00 */ 0x2231, +/* 3c1 - _DB_01 */ 0x2232, +/* 3c2 - _DB_02 */ 0x2233, +/* 3c3 - _DB_03 */ 0x2234, +/* 3c4 - */ 0, +/* 3c5 - _DB_05 */ 0x2235, +/* 3c6 - */ 0, +/* 3c7 - _DB_07 */ 0x2236, +/* 3c8 - _DB_C0 */ 0x2237, +/* 3c9 - _DB_C0 */ 0x2238, +/* 3ca - _DB_C0 */ 0x2239, +/* 3cb - _DB_C0 */ 0x223a, +/* 3cc - _DB_C0 */ 0x223b, +/* 3cd - _DB_C0 */ 0x223c, +/* 3ce - _DB_C0 */ 0x223d, +/* 3cf - _DB_C0 */ 0x223e, +/* 3d0 - _DB_C8 */ 0x223f, +/* 3d1 - _DB_C8 */ 0x2240, +/* 3d2 - _DB_C8 */ 0x2241, +/* 3d3 - _DB_C8 */ 0x2242, +/* 3d4 - _DB_C8 */ 0x2243, +/* 3d5 - _DB_C8 */ 0x2244, +/* 3d6 - _DB_C8 */ 0x2245, +/* 3d7 - _DB_C8 */ 0x2246, +/* 3d8 - _DB_D0 */ 0x2247, +/* 3d9 - _DB_D0 */ 0x2248, +/* 3da - _DB_D0 */ 0x2249, +/* 3db - _DB_D0 */ 0x224a, +/* 3dc - _DB_D0 */ 0x224b, +/* 3dd - _DB_D0 */ 0x224c, +/* 3de - _DB_D0 */ 0x224d, +/* 3df - _DB_D0 */ 0x224e, +/* 3e0 - _DB_D8 */ 0x224f, +/* 3e1 - _DB_D8 */ 0x2250, +/* 3e2 - _DB_D8 */ 0x2251, +/* 3e3 - _DB_D8 */ 0x2252, +/* 3e4 - _DB_D8 */ 0x2253, +/* 3e5 - _DB_D8 */ 0x2254, +/* 3e6 - _DB_D8 */ 0x2255, +/* 3e7 - _DB_D8 */ 0x2256, +/* 3e8 - _DB_E0 */ 0x2257, +/* 3e9 - _DB_E1 */ 0x2258, +/* 3ea - _DB_E2 */ 0xef3c, +/* 3eb - _DB_E3 */ 0xef48, +/* 3ec - _DB_E4 */ 0x2259, +/* 3ed - */ 0, +/* 3ee - */ 0, +/* 3ef - */ 0, +/* 3f0 - _DB_E8 */ 0x225a, +/* 3f1 - _DB_E8 */ 0x225b, +/* 3f2 - _DB_E8 */ 0x225c, +/* 3f3 - _DB_E8 */ 0x225d, +/* 3f4 - _DB_E8 */ 0x225e, +/* 3f5 - _DB_E8 */ 0x225f, +/* 3f6 - _DB_E8 */ 0x2260, +/* 3f7 - _DB_E8 */ 0x2261, +/* 3f8 - _DB_F0 */ 0x2262, +/* 3f9 - _DB_F0 */ 0x2263, +/* 3fa - _DB_F0 */ 0x2264, +/* 3fb - _DB_F0 */ 0x2265, +/* 3fc - _DB_F0 */ 0x2266, +/* 3fd - _DB_F0 */ 0x2267, +/* 3fe - _DB_F0 */ 0x2268, +/* 3ff - _DB_F0 */ 0x2269, +/* 400 - */ 0, +/* 401 - */ 0, +/* 402 - */ 0, +/* 403 - */ 0, +/* 404 - */ 0, +/* 405 - */ 0, +/* 406 - */ 0, +/* 407 - */ 0, +/* 408 - _DC_00 */ 0x226a, +/* 409 - _DC_01 */ 0x226b, +/* 40a - _DC_02 */ 0x226c, +/* 40b - _DC_03 */ 0x226d, +/* 40c - _DC_04 */ 0x226e, +/* 40d - _DC_05 */ 0x226f, +/* 40e - _DC_06 */ 0x2270, +/* 40f - _DC_07 */ 0x2271, +/* 410 - _DC_C0 */ 0x2272, +/* 411 - _DC_C0 */ 0x2273, +/* 412 - _DC_C0 */ 0x2274, +/* 413 - _DC_C0 */ 0x2275, +/* 414 - _DC_C0 */ 0x2276, +/* 415 - _DC_C0 */ 0x2277, +/* 416 - _DC_C0 */ 0x2278, +/* 417 - _DC_C0 */ 0x2279, +/* 418 - _DC_C8 */ 0x227a, +/* 419 - _DC_C8 */ 0x227b, +/* 41a - _DC_C8 */ 0x227c, +/* 41b - _DC_C8 */ 0x227d, +/* 41c - _DC_C8 */ 0x227e, +/* 41d - _DC_C8 */ 0x227f, +/* 41e - _DC_C8 */ 0x2280, +/* 41f - _DC_C8 */ 0x2281, +/* 420 - */ 0, +/* 421 - */ 0, +/* 422 - */ 0, +/* 423 - */ 0, +/* 424 - */ 0, +/* 425 - */ 0, +/* 426 - */ 0, +/* 427 - */ 0, +/* 428 - */ 0, +/* 429 - */ 0, +/* 42a - */ 0, +/* 42b - */ 0, +/* 42c - */ 0, +/* 42d - */ 0, +/* 42e - */ 0, +/* 42f - */ 0, +/* 430 - _DC_E0 */ 0x2282, +/* 431 - _DC_E0 */ 0x2283, +/* 432 - _DC_E0 */ 0x2284, +/* 433 - _DC_E0 */ 0x2285, +/* 434 - _DC_E0 */ 0x2286, +/* 435 - _DC_E0 */ 0x2287, +/* 436 - _DC_E0 */ 0x2288, +/* 437 - _DC_E0 */ 0x2289, +/* 438 - _DC_E8 */ 0x228a, +/* 439 - _DC_E8 */ 0x228b, +/* 43a - _DC_E8 */ 0x228c, +/* 43b - _DC_E8 */ 0x228d, +/* 43c - _DC_E8 */ 0x228e, +/* 43d - _DC_E8 */ 0x228f, +/* 43e - _DC_E8 */ 0x2290, +/* 43f - _DC_E8 */ 0x2291, +/* 440 - _DC_F0 */ 0x2292, +/* 441 - _DC_F0 */ 0x2293, +/* 442 - _DC_F0 */ 0x2294, +/* 443 - _DC_F0 */ 0x2295, +/* 444 - _DC_F0 */ 0x2296, +/* 445 - _DC_F0 */ 0x2297, +/* 446 - _DC_F0 */ 0x2298, +/* 447 - _DC_F0 */ 0x2299, +/* 448 - _DC_F8 */ 0x229a, +/* 449 - _DC_F8 */ 0x229b, +/* 44a - _DC_F8 */ 0x229c, +/* 44b - _DC_F8 */ 0x229d, +/* 44c - _DC_F8 */ 0x229e, +/* 44d - _DC_F8 */ 0x229f, +/* 44e - _DC_F8 */ 0x22a0, +/* 44f - _DC_F8 */ 0x22a1, +/* 450 - _DD_00 */ 0x22a2, +/* 451 - _DD_01 */ 0x22a3, +/* 452 - _DD_02 */ 0x22a4, +/* 453 - _DD_03 */ 0x22a5, +/* 454 - _DD_04 */ 0x22a6, +/* 455 - */ 0, +/* 456 - _DD_06 */ 0xef54, +/* 457 - _DD_07 */ 0xef60, +/* 458 - _DD_C0 */ 0x22a7, +/* 459 - _DD_C0 */ 0x22a8, +/* 45a - _DD_C0 */ 0x22a9, +/* 45b - _DD_C0 */ 0x22aa, +/* 45c - _DD_C0 */ 0x22ab, +/* 45d - _DD_C0 */ 0x22ac, +/* 45e - _DD_C0 */ 0x22ad, +/* 45f - _DD_C0 */ 0x22ae, +/* 460 - */ 0, +/* 461 - */ 0, +/* 462 - */ 0, +/* 463 - */ 0, +/* 464 - */ 0, +/* 465 - */ 0, +/* 466 - */ 0, +/* 467 - */ 0, +/* 468 - _DD_D0 */ 0x22af, +/* 469 - _DD_D0 */ 0x22b0, +/* 46a - _DD_D0 */ 0x22b1, +/* 46b - _DD_D0 */ 0x22b2, +/* 46c - _DD_D0 */ 0x22b3, +/* 46d - _DD_D0 */ 0x22b4, +/* 46e - _DD_D0 */ 0x22b5, +/* 46f - _DD_D0 */ 0x22b6, +/* 470 - _DD_D8 */ 0x22b7, +/* 471 - _DD_D8 */ 0x22b8, +/* 472 - _DD_D8 */ 0x22b9, +/* 473 - _DD_D8 */ 0x22ba, +/* 474 - _DD_D8 */ 0x22bb, +/* 475 - _DD_D8 */ 0x22bc, +/* 476 - _DD_D8 */ 0x22bd, +/* 477 - _DD_D8 */ 0x22be, +/* 478 - _DD_E0 */ 0x22bf, +/* 479 - _DD_E1 */ 0x22c0, +/* 47a - _DD_E0 */ 0x22c1, +/* 47b - _DD_E0 */ 0x22c2, +/* 47c - _DD_E0 */ 0x22c3, +/* 47d - _DD_E0 */ 0x22c4, +/* 47e - _DD_E0 */ 0x22c5, +/* 47f - _DD_E0 */ 0x22c6, +/* 480 - _DD_E8 */ 0x22c7, +/* 481 - _DD_E9 */ 0x22c8, +/* 482 - _DD_E8 */ 0x22c9, +/* 483 - _DD_E8 */ 0x22ca, +/* 484 - _DD_E8 */ 0x22cb, +/* 485 - _DD_E8 */ 0x22cc, +/* 486 - _DD_E8 */ 0x22cd, +/* 487 - _DD_E8 */ 0x22ce, +/* 488 - */ 0, +/* 489 - */ 0, +/* 48a - */ 0, +/* 48b - */ 0, +/* 48c - */ 0, +/* 48d - */ 0, +/* 48e - */ 0, +/* 48f - */ 0, +/* 490 - */ 0, +/* 491 - */ 0, +/* 492 - */ 0, +/* 493 - */ 0, +/* 494 - */ 0, +/* 495 - */ 0, +/* 496 - */ 0, +/* 497 - */ 0, +/* 498 - _DE_00 */ 0x22cf, +/* 499 - _DE_01 */ 0x22d0, +/* 49a - _DE_02 */ 0x22d1, +/* 49b - _DE_03 */ 0x22d2, +/* 49c - _DE_04 */ 0x22d3, +/* 49d - _DE_05 */ 0x22d4, +/* 49e - _DE_06 */ 0x22d5, +/* 49f - _DE_07 */ 0x22d6, +/* 4a0 - _DE_C0 */ 0x22d7, +/* 4a1 - _DE_C1 */ 0x22d8, +/* 4a2 - _DE_C0 */ 0x22d9, +/* 4a3 - _DE_C0 */ 0x22da, +/* 4a4 - _DE_C0 */ 0x22db, +/* 4a5 - _DE_C0 */ 0x22dc, +/* 4a6 - _DE_C0 */ 0x22dd, +/* 4a7 - _DE_C0 */ 0x22de, +/* 4a8 - _DE_C8 */ 0x22df, +/* 4a9 - _DE_C9 */ 0x22e0, +/* 4aa - _DE_C8 */ 0x22e1, +/* 4ab - _DE_C8 */ 0x22e2, +/* 4ac - _DE_C8 */ 0x22e3, +/* 4ad - _DE_C8 */ 0x22e4, +/* 4ae - _DE_C8 */ 0x22e5, +/* 4af - _DE_C8 */ 0x22e6, +/* 4b0 - */ 0, +/* 4b1 - */ 0, +/* 4b2 - */ 0, +/* 4b3 - */ 0, +/* 4b4 - */ 0, +/* 4b5 - */ 0, +/* 4b6 - */ 0, +/* 4b7 - */ 0, +/* 4b8 - */ 0, +/* 4b9 - _DE_D9 */ 0x22e7, +/* 4ba - */ 0, +/* 4bb - */ 0, +/* 4bc - */ 0, +/* 4bd - */ 0, +/* 4be - */ 0, +/* 4bf - */ 0, +/* 4c0 - _DE_E0 */ 0x22e8, +/* 4c1 - _DE_E1 */ 0x22e9, +/* 4c2 - _DE_E0 */ 0x22ea, +/* 4c3 - _DE_E0 */ 0x22eb, +/* 4c4 - _DE_E0 */ 0x22ec, +/* 4c5 - _DE_E0 */ 0x22ed, +/* 4c6 - _DE_E0 */ 0x22ee, +/* 4c7 - _DE_E0 */ 0x22ef, +/* 4c8 - _DE_E8 */ 0x22f0, +/* 4c9 - _DE_E9 */ 0x22f1, +/* 4ca - _DE_E8 */ 0x22f2, +/* 4cb - _DE_E8 */ 0x22f3, +/* 4cc - _DE_E8 */ 0x22f4, +/* 4cd - _DE_E8 */ 0x22f5, +/* 4ce - _DE_E8 */ 0x22f6, +/* 4cf - _DE_E8 */ 0x22f7, +/* 4d0 - _DE_F0 */ 0x22f8, +/* 4d1 - _DE_F1 */ 0x22f9, +/* 4d2 - _DE_F0 */ 0x22fa, +/* 4d3 - _DE_F0 */ 0x22fb, +/* 4d4 - _DE_F0 */ 0x22fc, +/* 4d5 - _DE_F0 */ 0x22fd, +/* 4d6 - _DE_F0 */ 0x22fe, +/* 4d7 - _DE_F0 */ 0x22ff, +/* 4d8 - _DE_F8 */ 0x2300, +/* 4d9 - _DE_F9 */ 0x2301, +/* 4da - _DE_F8 */ 0x2302, +/* 4db - _DE_F8 */ 0x2303, +/* 4dc - _DE_F8 */ 0x2304, +/* 4dd - _DE_F8 */ 0x2305, +/* 4de - _DE_F8 */ 0x2306, +/* 4df - _DE_F8 */ 0x2307, +/* 4e0 - _DF_00 */ 0x2308, +/* 4e1 - _DF_01 */ 0x2309, +/* 4e2 - _DF_02 */ 0x230a, +/* 4e3 - _DF_03 */ 0x230b, +/* 4e4 - _DF_04 */ 0x230c, +/* 4e5 - _DF_05 */ 0x230d, +/* 4e6 - _DF_06 */ 0x230e, +/* 4e7 - _DF_07 */ 0x230f, +/* 4e8 - */ 0, +/* 4e9 - */ 0, +/* 4ea - */ 0, +/* 4eb - */ 0, +/* 4ec - */ 0, +/* 4ed - */ 0, +/* 4ee - */ 0, +/* 4ef - */ 0, +/* 4f0 - */ 0, +/* 4f1 - */ 0, +/* 4f2 - */ 0, +/* 4f3 - */ 0, +/* 4f4 - */ 0, +/* 4f5 - */ 0, +/* 4f6 - */ 0, +/* 4f7 - */ 0, +/* 4f8 - */ 0, +/* 4f9 - */ 0, +/* 4fa - */ 0, +/* 4fb - */ 0, +/* 4fc - */ 0, +/* 4fd - */ 0, +/* 4fe - */ 0, +/* 4ff - */ 0, +/* 500 - */ 0, +/* 501 - */ 0, +/* 502 - */ 0, +/* 503 - */ 0, +/* 504 - */ 0, +/* 505 - */ 0, +/* 506 - */ 0, +/* 507 - */ 0, +/* 508 - _DF_E0 */ 0xef6c, +/* 509 - */ 0, +/* 50a - */ 0, +/* 50b - */ 0, +/* 50c - */ 0, +/* 50d - */ 0, +/* 50e - */ 0, +/* 50f - */ 0, +/* 510 - _DF_E8 */ 0x2310, +/* 511 - _DF_E8 */ 0x2311, +/* 512 - _DF_E8 */ 0x2312, +/* 513 - _DF_E8 */ 0x2313, +/* 514 - _DF_E8 */ 0x2314, +/* 515 - _DF_E8 */ 0x2315, +/* 516 - _DF_E8 */ 0x2316, +/* 517 - _DF_E8 */ 0x2317, +/* 518 - _DF_F0 */ 0x2318, +/* 519 - _DF_F0 */ 0x2319, +/* 51a - _DF_F0 */ 0x231a, +/* 51b - _DF_F0 */ 0x231b, +/* 51c - _DF_F0 */ 0x231c, +/* 51d - _DF_F0 */ 0x231d, +/* 51e - _DF_F0 */ 0x231e, +/* 51f - _DF_F0 */ 0x231f, +/* 520 - */ 0, +/* 521 - */ 0, +/* 522 - */ 0, +/* 523 - */ 0, +/* 524 - */ 0, +/* 525 - */ 0, +/* 526 - */ 0, +/* 527 - */ 0, +/* 528 - _F6_00 */ 0x2320, +/* 529 - */ 0, +/* 52a - _F6_02 */ 0x2321, +/* 52b - _F6_03 */ 0x2322, +/* 52c - _F6_04 */ 0x2323, +/* 52d - _F6_05 */ 0x2324, +/* 52e - _F6_06 */ 0x2325, +/* 52f - _F6_07 */ 0x2326, +/* 530 - _F7_00 */ 0x2327, +/* 531 - */ 0, +/* 532 - _F7_02 */ 0x2328, +/* 533 - _F7_03 */ 0x2329, +/* 534 - _F7_04 */ 0x232a, +/* 535 - _F7_05 */ 0x232b, +/* 536 - _F7_06 */ 0x232c, +/* 537 - _F7_07 */ 0x232d, +/* 538 - _FE_00 */ 0x232e, +/* 539 - _FE_01 */ 0x232f, +/* 53a - */ 0, +/* 53b - */ 0, +/* 53c - */ 0, +/* 53d - */ 0, +/* 53e - */ 0, +/* 53f - */ 0, +/* 540 - _FF_00 */ 0x2330, +/* 541 - _FF_01 */ 0x2331, +/* 542 - _FF_02 */ 0x2332, +/* 543 - _FF_03 */ 0x2333, +/* 544 - _FF_04 */ 0x2334, +/* 545 - _FF_05 */ 0x2335, +/* 546 - _FF_06 */ 0x2336, +/* 547 - */ 0, +/* 548 - _0F_00_00 */ 0x2337, +/* 549 - _0F_00_01 */ 0x2338, +/* 54a - _0F_00_02 */ 0x2339, +/* 54b - _0F_00_03 */ 0x233a, +/* 54c - _0F_00_04 */ 0x233b, +/* 54d - _0F_00_05 */ 0x233c, +/* 54e - */ 0, +/* 54f - */ 0, +/* 550 - _0F_01_00 */ 0x233d, +/* 551 - _0F_01_01 */ 0x233e, +/* 552 - _0F_01_02 */ 0x233f, +/* 553 - _0F_01_03 */ 0x2340, +/* 554 - _0F_01_04 */ 0x2341, +/* 555 - */ 0, +/* 556 - _0F_01_06 */ 0x2342, +/* 557 - _0F_01_07 */ 0x2343, +/* 558 - */ 0, +/* 559 - _0F_01_C1 */ 0x2344, +/* 55a - _0F_01_C2 */ 0x2345, +/* 55b - _0F_01_C3 */ 0x2346, +/* 55c - _0F_01_C4 */ 0x2347, +/* 55d - */ 0, +/* 55e - */ 0, +/* 55f - */ 0, +/* 560 - _0F_01_C8 */ 0x2348, +/* 561 - _0F_01_C9 */ 0x2349, +/* 562 - _0F_01_CA */ 0x234a, +/* 563 - _0F_01_CB */ 0x234b, +/* 564 - */ 0, +/* 565 - */ 0, +/* 566 - */ 0, +/* 567 - */ 0, +/* 568 - _0F_01_D0 */ 0x234c, +/* 569 - _0F_01_D1 */ 0x234d, +/* 56a - */ 0, +/* 56b - */ 0, +/* 56c - _0F_01_D4 */ 0x234e, +/* 56d - _0F_01_D5 */ 0x234f, +/* 56e - */ 0, +/* 56f - */ 0, +/* 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, +/* 57b - */ 0, +/* 57c - */ 0, +/* 57d - */ 0, +/* 57e - */ 0, +/* 57f - */ 0, +/* 580 - */ 0, +/* 581 - */ 0, +/* 582 - */ 0, +/* 583 - */ 0, +/* 584 - */ 0, +/* 585 - */ 0, +/* 586 - */ 0, +/* 587 - */ 0, +/* 588 - */ 0, +/* 589 - */ 0, +/* 58a - */ 0, +/* 58b - */ 0, +/* 58c - */ 0, +/* 58d - */ 0, +/* 58e - */ 0, +/* 58f - */ 0, +/* 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 */ 0x235a, +/* 599 - _0F_0D_01 */ 0x235b, +/* 59a - */ 0, +/* 59b - */ 0, +/* 59c - */ 0, +/* 59d - */ 0, +/* 59e - */ 0, +/* 59f - */ 0, +/* 5a0 - */ 0, +/* 5a1 - */ 0, +/* 5a2 - */ 0, +/* 5a3 - */ 0, +/* 5a4 - */ 0, +/* 5a5 - */ 0, +/* 5a6 - */ 0, +/* 5a7 - */ 0, +/* 5a8 - */ 0, +/* 5a9 - */ 0, +/* 5aa - */ 0, +/* 5ab - */ 0, +/* 5ac - _0F_0F_0C */ 0x235c, +/* 5ad - _0F_0F_0D */ 0x235d, +/* 5ae - */ 0, +/* 5af - */ 0, +/* 5b0 - */ 0, +/* 5b1 - */ 0, +/* 5b2 - */ 0, +/* 5b3 - */ 0, +/* 5b4 - */ 0, +/* 5b5 - */ 0, +/* 5b6 - */ 0, +/* 5b7 - */ 0, +/* 5b8 - */ 0, +/* 5b9 - */ 0, +/* 5ba - */ 0, +/* 5bb - */ 0, +/* 5bc - _0F_0F_1C */ 0x235e, +/* 5bd - _0F_0F_1D */ 0x235f, +/* 5be - */ 0, +/* 5bf - */ 0, +/* 5c0 - */ 0, +/* 5c1 - */ 0, +/* 5c2 - */ 0, +/* 5c3 - */ 0, +/* 5c4 - */ 0, +/* 5c5 - */ 0, +/* 5c6 - */ 0, +/* 5c7 - */ 0, +/* 5c8 - */ 0, +/* 5c9 - */ 0, +/* 5ca - */ 0, +/* 5cb - */ 0, +/* 5cc - */ 0, +/* 5cd - */ 0, +/* 5ce - */ 0, +/* 5cf - */ 0, +/* 5d0 - */ 0, +/* 5d1 - */ 0, +/* 5d2 - */ 0, +/* 5d3 - */ 0, +/* 5d4 - */ 0, +/* 5d5 - */ 0, +/* 5d6 - */ 0, +/* 5d7 - */ 0, +/* 5d8 - */ 0, +/* 5d9 - */ 0, +/* 5da - */ 0, +/* 5db - */ 0, +/* 5dc - */ 0, +/* 5dd - */ 0, +/* 5de - */ 0, +/* 5df - */ 0, +/* 5e0 - */ 0, +/* 5e1 - */ 0, +/* 5e2 - */ 0, +/* 5e3 - */ 0, +/* 5e4 - */ 0, +/* 5e5 - */ 0, +/* 5e6 - */ 0, +/* 5e7 - */ 0, +/* 5e8 - */ 0, +/* 5e9 - */ 0, +/* 5ea - */ 0, +/* 5eb - */ 0, +/* 5ec - */ 0, +/* 5ed - */ 0, +/* 5ee - */ 0, +/* 5ef - */ 0, +/* 5f0 - */ 0, +/* 5f1 - */ 0, +/* 5f2 - */ 0, +/* 5f3 - */ 0, +/* 5f4 - */ 0, +/* 5f5 - */ 0, +/* 5f6 - */ 0, +/* 5f7 - */ 0, +/* 5f8 - */ 0, +/* 5f9 - */ 0, +/* 5fa - */ 0, +/* 5fb - */ 0, +/* 5fc - */ 0, +/* 5fd - */ 0, +/* 5fe - */ 0, +/* 5ff - */ 0, +/* 600 - */ 0, +/* 601 - */ 0, +/* 602 - */ 0, +/* 603 - */ 0, +/* 604 - */ 0, +/* 605 - */ 0, +/* 606 - */ 0, +/* 607 - */ 0, +/* 608 - */ 0, +/* 609 - */ 0, +/* 60a - */ 0, +/* 60b - */ 0, +/* 60c - */ 0, +/* 60d - */ 0, +/* 60e - */ 0, +/* 60f - */ 0, +/* 610 - */ 0, +/* 611 - */ 0, +/* 612 - */ 0, +/* 613 - */ 0, +/* 614 - */ 0, +/* 615 - */ 0, +/* 616 - */ 0, +/* 617 - */ 0, +/* 618 - */ 0, +/* 619 - */ 0, +/* 61a - */ 0, +/* 61b - */ 0, +/* 61c - */ 0, +/* 61d - */ 0, +/* 61e - */ 0, +/* 61f - */ 0, +/* 620 - */ 0, +/* 621 - */ 0, +/* 622 - */ 0, +/* 623 - */ 0, +/* 624 - */ 0, +/* 625 - */ 0, +/* 626 - */ 0, +/* 627 - */ 0, +/* 628 - */ 0, +/* 629 - */ 0, +/* 62a - _0F_0F_8A */ 0x2360, +/* 62b - */ 0, +/* 62c - */ 0, +/* 62d - */ 0, +/* 62e - _0F_0F_8E */ 0x2361, +/* 62f - */ 0, +/* 630 - _0F_0F_90 */ 0x2362, +/* 631 - */ 0, +/* 632 - */ 0, +/* 633 - */ 0, +/* 634 - _0F_0F_94 */ 0x2363, +/* 635 - */ 0, +/* 636 - _0F_0F_96 */ 0x2364, +/* 637 - _0F_0F_97 */ 0x2365, +/* 638 - */ 0, +/* 639 - */ 0, +/* 63a - _0F_0F_9A */ 0x2366, +/* 63b - */ 0, +/* 63c - */ 0, +/* 63d - */ 0, +/* 63e - _0F_0F_9E */ 0x2367, +/* 63f - */ 0, +/* 640 - _0F_0F_A0 */ 0x2368, +/* 641 - */ 0, +/* 642 - */ 0, +/* 643 - */ 0, +/* 644 - _0F_0F_A4 */ 0x2369, +/* 645 - */ 0, +/* 646 - _0F_0F_A6 */ 0x236a, +/* 647 - _0F_0F_A7 */ 0x236b, +/* 648 - */ 0, +/* 649 - */ 0, +/* 64a - _0F_0F_AA */ 0x236c, +/* 64b - */ 0, +/* 64c - */ 0, +/* 64d - */ 0, +/* 64e - _0F_0F_AE */ 0x236d, +/* 64f - */ 0, +/* 650 - _0F_0F_B0 */ 0x236e, +/* 651 - */ 0, +/* 652 - */ 0, +/* 653 - */ 0, +/* 654 - _0F_0F_B4 */ 0x236f, +/* 655 - */ 0, +/* 656 - _0F_0F_B6 */ 0x2370, +/* 657 - _0F_0F_B7 */ 0x2371, +/* 658 - */ 0, +/* 659 - */ 0, +/* 65a - */ 0, +/* 65b - _0F_0F_BB */ 0x2372, +/* 65c - */ 0, +/* 65d - */ 0, +/* 65e - */ 0, +/* 65f - _0F_0F_BF */ 0x2373, +/* 660 - */ 0, +/* 661 - */ 0, +/* 662 - */ 0, +/* 663 - */ 0, +/* 664 - */ 0, +/* 665 - */ 0, +/* 666 - */ 0, +/* 667 - */ 0, +/* 668 - */ 0, +/* 669 - */ 0, +/* 66a - */ 0, +/* 66b - */ 0, +/* 66c - */ 0, +/* 66d - */ 0, +/* 66e - */ 0, +/* 66f - */ 0, +/* 670 - */ 0, +/* 671 - */ 0, +/* 672 - */ 0, +/* 673 - */ 0, +/* 674 - */ 0, +/* 675 - */ 0, +/* 676 - */ 0, +/* 677 - */ 0, +/* 678 - */ 0, +/* 679 - */ 0, +/* 67a - */ 0, +/* 67b - */ 0, +/* 67c - */ 0, +/* 67d - */ 0, +/* 67e - */ 0, +/* 67f - */ 0, +/* 680 - */ 0, +/* 681 - */ 0, +/* 682 - */ 0, +/* 683 - */ 0, +/* 684 - */ 0, +/* 685 - */ 0, +/* 686 - */ 0, +/* 687 - */ 0, +/* 688 - */ 0, +/* 689 - */ 0, +/* 68a - */ 0, +/* 68b - */ 0, +/* 68c - */ 0, +/* 68d - */ 0, +/* 68e - */ 0, +/* 68f - */ 0, +/* 690 - */ 0, +/* 691 - */ 0, +/* 692 - */ 0, +/* 693 - */ 0, +/* 694 - */ 0, +/* 695 - */ 0, +/* 696 - */ 0, +/* 697 - */ 0, +/* 698 - */ 0, +/* 699 - */ 0, +/* 69a - */ 0, +/* 69b - */ 0, +/* 69c - */ 0, +/* 69d - */ 0, +/* 69e - */ 0, +/* 69f - */ 0, +/* 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, +/* 6a7 - _V_F2_0F_10 */ 0x400c, +/* 6a8 - */ 0, +/* 6a9 - */ 0, +/* 6aa - _VRR_F3_0F_10 */ 0x400d, +/* 6ab - _VRR_F2_0F_10 */ 0x400e, +/* 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, +/* 6b3 - _V_F2_0F_11 */ 0x4012, +/* 6b4 - */ 0, +/* 6b5 - */ 0, +/* 6b6 - _VRR_F3_0F_11 */ 0x4013, +/* 6b7 - _VRR_F2_0F_11 */ 0x4014, +/* 6b8 - _0F_12 */ 0x4015, +/* 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, +/* 6bf - _V_F2_0F_12 */ 0x4019, +/* 6c0 - */ 0, +/* 6c1 - */ 0, +/* 6c2 - */ 0, +/* 6c3 - */ 0, +/* 6c4 - _0F_13 */ 0x237f, +/* 6c5 - _66_0F_13 */ 0x2380, +/* 6c6 - */ 0, +/* 6c7 - */ 0, +/* 6c8 - _V_0F_13 */ 0x401a, +/* 6c9 - _V_66_0F_13 */ 0x401b, +/* 6ca - */ 0, +/* 6cb - */ 0, +/* 6cc - */ 0, +/* 6cd - */ 0, +/* 6ce - */ 0, +/* 6cf - */ 0, +/* 6d0 - _0F_14 */ 0x2381, +/* 6d1 - _66_0F_14 */ 0x2382, +/* 6d2 - */ 0, +/* 6d3 - */ 0, +/* 6d4 - _V_0F_14 */ 0x401c, +/* 6d5 - _V_66_0F_14 */ 0x401d, +/* 6d6 - */ 0, +/* 6d7 - */ 0, +/* 6d8 - */ 0, +/* 6d9 - */ 0, +/* 6da - */ 0, +/* 6db - */ 0, +/* 6dc - _0F_15 */ 0x2383, +/* 6dd - _66_0F_15 */ 0x2384, +/* 6de - */ 0, +/* 6df - */ 0, +/* 6e0 - _V_0F_15 */ 0x401e, +/* 6e1 - _V_66_0F_15 */ 0x401f, +/* 6e2 - */ 0, +/* 6e3 - */ 0, +/* 6e4 - */ 0, +/* 6e5 - */ 0, +/* 6e6 - */ 0, +/* 6e7 - */ 0, +/* 6e8 - _0F_16 */ 0x4020, +/* 6e9 - _66_0F_16 */ 0x2385, +/* 6ea - _F3_0F_16 */ 0x2386, +/* 6eb - */ 0, +/* 6ec - _V_0F_16 */ 0x4021, +/* 6ed - _V_66_0F_16 */ 0x4022, +/* 6ee - _V_F3_0F_16 */ 0x4023, +/* 6ef - */ 0, +/* 6f0 - */ 0, +/* 6f1 - */ 0, +/* 6f2 - */ 0, +/* 6f3 - */ 0, +/* 6f4 - _0F_17 */ 0x2387, +/* 6f5 - _66_0F_17 */ 0x2388, +/* 6f6 - */ 0, +/* 6f7 - */ 0, +/* 6f8 - _V_0F_17 */ 0x4024, +/* 6f9 - _V_66_0F_17 */ 0x4025, +/* 6fa - */ 0, +/* 6fb - */ 0, +/* 6fc - */ 0, +/* 6fd - */ 0, +/* 6fe - */ 0, +/* 6ff - */ 0, +/* 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 */ 0x238d, +/* 709 - _66_0F_28 */ 0x238e, +/* 70a - */ 0, +/* 70b - */ 0, +/* 70c - _V_0F_28 */ 0x4026, +/* 70d - _V_66_0F_28 */ 0x4027, +/* 70e - */ 0, +/* 70f - */ 0, +/* 710 - */ 0, +/* 711 - */ 0, +/* 712 - */ 0, +/* 713 - */ 0, +/* 714 - _0F_29 */ 0x238f, +/* 715 - _66_0F_29 */ 0x2390, +/* 716 - */ 0, +/* 717 - */ 0, +/* 718 - _V_0F_29 */ 0x4028, +/* 719 - _V_66_0F_29 */ 0x4029, +/* 71a - */ 0, +/* 71b - */ 0, +/* 71c - */ 0, +/* 71d - */ 0, +/* 71e - */ 0, +/* 71f - */ 0, +/* 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, +/* 727 - _V_F2_0F_2A */ 0x402b, +/* 728 - */ 0, +/* 729 - */ 0, +/* 72a - */ 0, +/* 72b - */ 0, +/* 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, +/* 733 - */ 0, +/* 734 - */ 0, +/* 735 - */ 0, +/* 736 - */ 0, +/* 737 - */ 0, +/* 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, +/* 73f - _V_F2_0F_2C */ 0x402f, +/* 740 - */ 0, +/* 741 - */ 0, +/* 742 - */ 0, +/* 743 - */ 0, +/* 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, +/* 74b - _V_F2_0F_2D */ 0x4031, +/* 74c - */ 0, +/* 74d - */ 0, +/* 74e - */ 0, +/* 74f - */ 0, +/* 750 - _0F_2E */ 0x23a1, +/* 751 - _66_0F_2E */ 0x23a2, +/* 752 - */ 0, +/* 753 - */ 0, +/* 754 - _V_0F_2E */ 0x4032, +/* 755 - _V_66_0F_2E */ 0x4033, +/* 756 - */ 0, +/* 757 - */ 0, +/* 758 - */ 0, +/* 759 - */ 0, +/* 75a - */ 0, +/* 75b - */ 0, +/* 75c - _0F_2F */ 0x23a3, +/* 75d - _66_0F_2F */ 0x23a4, +/* 75e - */ 0, +/* 75f - */ 0, +/* 760 - _V_0F_2F */ 0x4034, +/* 761 - _V_66_0F_2F */ 0x4035, +/* 762 - */ 0, +/* 763 - */ 0, +/* 764 - */ 0, +/* 765 - */ 0, +/* 766 - */ 0, +/* 767 - */ 0, +/* 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 */ 0xf044, +/* 77d - _0F_38_15 */ 0xf050, +/* 77e - */ 0, +/* 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 */ 0xf08c, +/* 785 - _0F_38_1D */ 0xf098, +/* 786 - _0F_38_1E */ 0xf0a4, +/* 787 - */ 0, +/* 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 */ 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 */ 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, +/* 7ad - */ 0, +/* 7ae - */ 0, +/* 7af - */ 0, +/* 7b0 - */ 0, +/* 7b1 - */ 0, +/* 7b2 - */ 0, +/* 7b3 - */ 0, +/* 7b4 - */ 0, +/* 7b5 - */ 0, +/* 7b6 - */ 0, +/* 7b7 - */ 0, +/* 7b8 - */ 0, +/* 7b9 - */ 0, +/* 7ba - */ 0, +/* 7bb - */ 0, +/* 7bc - */ 0, +/* 7bd - */ 0, +/* 7be - */ 0, +/* 7bf - */ 0, +/* 7c0 - */ 0, +/* 7c1 - */ 0, +/* 7c2 - */ 0, +/* 7c3 - */ 0, +/* 7c4 - */ 0, +/* 7c5 - */ 0, +/* 7c6 - */ 0, +/* 7c7 - */ 0, +/* 7c8 - */ 0, +/* 7c9 - */ 0, +/* 7ca - */ 0, +/* 7cb - */ 0, +/* 7cc - */ 0, +/* 7cd - */ 0, +/* 7ce - */ 0, +/* 7cf - */ 0, +/* 7d0 - */ 0, +/* 7d1 - */ 0, +/* 7d2 - */ 0, +/* 7d3 - */ 0, +/* 7d4 - */ 0, +/* 7d5 - */ 0, +/* 7d6 - */ 0, +/* 7d7 - */ 0, +/* 7d8 - */ 0, +/* 7d9 - */ 0, +/* 7da - */ 0, +/* 7db - */ 0, +/* 7dc - */ 0, +/* 7dd - */ 0, +/* 7de - */ 0, +/* 7df - */ 0, +/* 7e0 - */ 0, +/* 7e1 - */ 0, +/* 7e2 - */ 0, +/* 7e3 - */ 0, +/* 7e4 - */ 0, +/* 7e5 - */ 0, +/* 7e6 - */ 0, +/* 7e7 - */ 0, +/* 7e8 - _0F_38_80 */ 0xf224, +/* 7e9 - _0F_38_81 */ 0xf230, +/* 7ea - _0F_38_82 */ 0xf23c, +/* 7eb - */ 0, +/* 7ec - */ 0, +/* 7ed - */ 0, +/* 7ee - */ 0, +/* 7ef - */ 0, +/* 7f0 - */ 0, +/* 7f1 - */ 0, +/* 7f2 - */ 0, +/* 7f3 - */ 0, +/* 7f4 - */ 0, +/* 7f5 - */ 0, +/* 7f6 - */ 0, +/* 7f7 - */ 0, +/* 7f8 - */ 0, +/* 7f9 - */ 0, +/* 7fa - */ 0, +/* 7fb - */ 0, +/* 7fc - */ 0, +/* 7fd - */ 0, +/* 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 */ 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 */ 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, +/* 82b - */ 0, +/* 82c - */ 0, +/* 82d - */ 0, +/* 82e - */ 0, +/* 82f - */ 0, +/* 830 - */ 0, +/* 831 - */ 0, +/* 832 - */ 0, +/* 833 - */ 0, +/* 834 - */ 0, +/* 835 - */ 0, +/* 836 - */ 0, +/* 837 - */ 0, +/* 838 - */ 0, +/* 839 - */ 0, +/* 83a - */ 0, +/* 83b - */ 0, +/* 83c - */ 0, +/* 83d - */ 0, +/* 83e - */ 0, +/* 83f - */ 0, +/* 840 - */ 0, +/* 841 - */ 0, +/* 842 - */ 0, +/* 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, +/* 84b - */ 0, +/* 84c - */ 0, +/* 84d - */ 0, +/* 84e - */ 0, +/* 84f - */ 0, +/* 850 - */ 0, +/* 851 - */ 0, +/* 852 - */ 0, +/* 853 - */ 0, +/* 854 - */ 0, +/* 855 - */ 0, +/* 856 - */ 0, +/* 857 - */ 0, +/* 858 - _0F_38_F0 */ 0xf3ec, +/* 859 - _0F_38_F1 */ 0xf3f8, +/* 85a - */ 0, +/* 85b - */ 0, +/* 85c - */ 0, +/* 85d - */ 0, +/* 85e - */ 0, +/* 85f - */ 0, +/* 860 - */ 0, +/* 861 - */ 0, +/* 862 - */ 0, +/* 863 - */ 0, +/* 864 - */ 0, +/* 865 - */ 0, +/* 866 - */ 0, +/* 867 - */ 0, +/* 868 - */ 0, +/* 869 - */ 0, +/* 86a - */ 0, +/* 86b - */ 0, +/* 86c - _0F_3A_04 */ 0xf404, +/* 86d - _0F_3A_05 */ 0xf410, +/* 86e - _0F_3A_06 */ 0xf41c, +/* 86f - */ 0, +/* 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 */ 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 */ 0xf4d0, +/* 889 - _0F_3A_21 */ 0xf4dc, +/* 88a - _0F_3A_22 */ 0xf4e8, +/* 88b - */ 0, +/* 88c - */ 0, +/* 88d - */ 0, +/* 88e - */ 0, +/* 88f - */ 0, +/* 890 - */ 0, +/* 891 - */ 0, +/* 892 - */ 0, +/* 893 - */ 0, +/* 894 - */ 0, +/* 895 - */ 0, +/* 896 - */ 0, +/* 897 - */ 0, +/* 898 - */ 0, +/* 899 - */ 0, +/* 89a - */ 0, +/* 89b - */ 0, +/* 89c - */ 0, +/* 89d - */ 0, +/* 89e - */ 0, +/* 89f - */ 0, +/* 8a0 - */ 0, +/* 8a1 - */ 0, +/* 8a2 - */ 0, +/* 8a3 - */ 0, +/* 8a4 - */ 0, +/* 8a5 - */ 0, +/* 8a6 - */ 0, +/* 8a7 - */ 0, +/* 8a8 - _0F_3A_40 */ 0xf4f4, +/* 8a9 - _0F_3A_41 */ 0xf500, +/* 8aa - _0F_3A_42 */ 0xf50c, +/* 8ab - */ 0, +/* 8ac - _0F_3A_44 */ 0xf518, +/* 8ad - */ 0, +/* 8ae - */ 0, +/* 8af - */ 0, +/* 8b0 - */ 0, +/* 8b1 - */ 0, +/* 8b2 - _0F_3A_4A */ 0xf524, +/* 8b3 - _0F_3A_4B */ 0xf530, +/* 8b4 - _0F_3A_4C */ 0xf53c, +/* 8b5 - */ 0, +/* 8b6 - */ 0, +/* 8b7 - */ 0, +/* 8b8 - */ 0, +/* 8b9 - */ 0, +/* 8ba - */ 0, +/* 8bb - */ 0, +/* 8bc - */ 0, +/* 8bd - */ 0, +/* 8be - */ 0, +/* 8bf - */ 0, +/* 8c0 - */ 0, +/* 8c1 - */ 0, +/* 8c2 - */ 0, +/* 8c3 - */ 0, +/* 8c4 - */ 0, +/* 8c5 - */ 0, +/* 8c6 - */ 0, +/* 8c7 - */ 0, +/* 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, +/* 8cf - */ 0, +/* 8d0 - */ 0, +/* 8d1 - */ 0, +/* 8d2 - */ 0, +/* 8d3 - */ 0, +/* 8d4 - */ 0, +/* 8d5 - */ 0, +/* 8d6 - */ 0, +/* 8d7 - */ 0, +/* 8d8 - */ 0, +/* 8d9 - */ 0, +/* 8da - */ 0, +/* 8db - */ 0, +/* 8dc - */ 0, +/* 8dd - */ 0, +/* 8de - */ 0, +/* 8df - */ 0, +/* 8e0 - */ 0, +/* 8e1 - */ 0, +/* 8e2 - */ 0, +/* 8e3 - */ 0, +/* 8e4 - */ 0, +/* 8e5 - */ 0, +/* 8e6 - */ 0, +/* 8e7 - */ 0, +/* 8e8 - */ 0, +/* 8e9 - */ 0, +/* 8ea - */ 0, +/* 8eb - */ 0, +/* 8ec - */ 0, +/* 8ed - */ 0, +/* 8ee - */ 0, +/* 8ef - */ 0, +/* 8f0 - */ 0, +/* 8f1 - */ 0, +/* 8f2 - */ 0, +/* 8f3 - */ 0, +/* 8f4 - */ 0, +/* 8f5 - */ 0, +/* 8f6 - */ 0, +/* 8f7 - */ 0, +/* 8f8 - */ 0, +/* 8f9 - */ 0, +/* 8fa - */ 0, +/* 8fb - */ 0, +/* 8fc - */ 0, +/* 8fd - */ 0, +/* 8fe - */ 0, +/* 8ff - */ 0, +/* 900 - */ 0, +/* 901 - */ 0, +/* 902 - */ 0, +/* 903 - */ 0, +/* 904 - */ 0, +/* 905 - */ 0, +/* 906 - */ 0, +/* 907 - */ 0, +/* 908 - */ 0, +/* 909 - */ 0, +/* 90a - */ 0, +/* 90b - */ 0, +/* 90c - */ 0, +/* 90d - */ 0, +/* 90e - */ 0, +/* 90f - */ 0, +/* 910 - */ 0, +/* 911 - */ 0, +/* 912 - */ 0, +/* 913 - */ 0, +/* 914 - */ 0, +/* 915 - */ 0, +/* 916 - */ 0, +/* 917 - */ 0, +/* 918 - */ 0, +/* 919 - */ 0, +/* 91a - */ 0, +/* 91b - */ 0, +/* 91c - */ 0, +/* 91d - */ 0, +/* 91e - */ 0, +/* 91f - */ 0, +/* 920 - */ 0, +/* 921 - */ 0, +/* 922 - */ 0, +/* 923 - */ 0, +/* 924 - */ 0, +/* 925 - */ 0, +/* 926 - */ 0, +/* 927 - */ 0, +/* 928 - */ 0, +/* 929 - */ 0, +/* 92a - */ 0, +/* 92b - */ 0, +/* 92c - */ 0, +/* 92d - */ 0, +/* 92e - */ 0, +/* 92f - */ 0, +/* 930 - */ 0, +/* 931 - */ 0, +/* 932 - */ 0, +/* 933 - */ 0, +/* 934 - */ 0, +/* 935 - */ 0, +/* 936 - */ 0, +/* 937 - */ 0, +/* 938 - */ 0, +/* 939 - */ 0, +/* 93a - */ 0, +/* 93b - */ 0, +/* 93c - */ 0, +/* 93d - */ 0, +/* 93e - */ 0, +/* 93f - */ 0, +/* 940 - */ 0, +/* 941 - */ 0, +/* 942 - */ 0, +/* 943 - */ 0, +/* 944 - */ 0, +/* 945 - */ 0, +/* 946 - */ 0, +/* 947 - _0F_3A_DF */ 0xf578, +/* 948 - */ 0, +/* 949 - */ 0, +/* 94a - */ 0, +/* 94b - */ 0, +/* 94c - */ 0, +/* 94d - */ 0, +/* 94e - */ 0, +/* 94f - */ 0, +/* 950 - */ 0, +/* 951 - */ 0, +/* 952 - */ 0, +/* 953 - */ 0, +/* 954 - */ 0, +/* 955 - */ 0, +/* 956 - */ 0, +/* 957 - */ 0, +/* 958 - */ 0, +/* 959 - */ 0, +/* 95a - */ 0, +/* 95b - */ 0, +/* 95c - */ 0, +/* 95d - */ 0, +/* 95e - */ 0, +/* 95f - */ 0, +/* 960 - */ 0, +/* 961 - */ 0, +/* 962 - */ 0, +/* 963 - */ 0, +/* 964 - */ 0, +/* 965 - */ 0, +/* 966 - */ 0, +/* 967 - */ 0, +/* 968 - _0F_50 */ 0x23a5, +/* 969 - _66_0F_50 */ 0x23a6, +/* 96a - */ 0, +/* 96b - */ 0, +/* 96c - _V_0F_50 */ 0x4036, +/* 96d - _V_66_0F_50 */ 0x4037, +/* 96e - */ 0, +/* 96f - */ 0, +/* 970 - */ 0, +/* 971 - */ 0, +/* 972 - */ 0, +/* 973 - */ 0, +/* 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, +/* 97b - _V_F2_0F_51 */ 0x403b, +/* 97c - */ 0, +/* 97d - */ 0, +/* 97e - */ 0, +/* 97f - */ 0, +/* 980 - _0F_52 */ 0x23ab, +/* 981 - */ 0, +/* 982 - _F3_0F_52 */ 0x23ac, +/* 983 - */ 0, +/* 984 - _V_0F_52 */ 0x403c, +/* 985 - */ 0, +/* 986 - _V_F3_0F_52 */ 0x403d, +/* 987 - */ 0, +/* 988 - */ 0, +/* 989 - */ 0, +/* 98a - */ 0, +/* 98b - */ 0, +/* 98c - _0F_53 */ 0x23ad, +/* 98d - */ 0, +/* 98e - _F3_0F_53 */ 0x23ae, +/* 98f - */ 0, +/* 990 - _V_0F_53 */ 0x403e, +/* 991 - */ 0, +/* 992 - _V_F3_0F_53 */ 0x403f, +/* 993 - */ 0, +/* 994 - */ 0, +/* 995 - */ 0, +/* 996 - */ 0, +/* 997 - */ 0, +/* 998 - _0F_54 */ 0x23af, +/* 999 - _66_0F_54 */ 0x23b0, +/* 99a - */ 0, +/* 99b - */ 0, +/* 99c - _V_0F_54 */ 0x4040, +/* 99d - _V_66_0F_54 */ 0x4041, +/* 99e - */ 0, +/* 99f - */ 0, +/* 9a0 - */ 0, +/* 9a1 - */ 0, +/* 9a2 - */ 0, +/* 9a3 - */ 0, +/* 9a4 - _0F_55 */ 0x23b1, +/* 9a5 - _66_0F_55 */ 0x23b2, +/* 9a6 - */ 0, +/* 9a7 - */ 0, +/* 9a8 - _V_0F_55 */ 0x4042, +/* 9a9 - _V_66_0F_55 */ 0x4043, +/* 9aa - */ 0, +/* 9ab - */ 0, +/* 9ac - */ 0, +/* 9ad - */ 0, +/* 9ae - */ 0, +/* 9af - */ 0, +/* 9b0 - _0F_56 */ 0x23b3, +/* 9b1 - _66_0F_56 */ 0x23b4, +/* 9b2 - */ 0, +/* 9b3 - */ 0, +/* 9b4 - _V_0F_56 */ 0x4044, +/* 9b5 - _V_66_0F_56 */ 0x4045, +/* 9b6 - */ 0, +/* 9b7 - */ 0, +/* 9b8 - */ 0, +/* 9b9 - */ 0, +/* 9ba - */ 0, +/* 9bb - */ 0, +/* 9bc - _0F_57 */ 0x23b5, +/* 9bd - _66_0F_57 */ 0x23b6, +/* 9be - */ 0, +/* 9bf - */ 0, +/* 9c0 - _V_0F_57 */ 0x4046, +/* 9c1 - _V_66_0F_57 */ 0x4047, +/* 9c2 - */ 0, +/* 9c3 - */ 0, +/* 9c4 - */ 0, +/* 9c5 - */ 0, +/* 9c6 - */ 0, +/* 9c7 - */ 0, +/* 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, +/* 9cf - _V_F2_0F_58 */ 0x404b, +/* 9d0 - */ 0, +/* 9d1 - */ 0, +/* 9d2 - */ 0, +/* 9d3 - */ 0, +/* 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, +/* 9db - _V_F2_0F_59 */ 0x404f, +/* 9dc - */ 0, +/* 9dd - */ 0, +/* 9de - */ 0, +/* 9df - */ 0, +/* 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, +/* 9e7 - _V_F2_0F_5A */ 0x4053, +/* 9e8 - */ 0, +/* 9e9 - */ 0, +/* 9ea - */ 0, +/* 9eb - */ 0, +/* 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, +/* 9f2 - _V_F3_0F_5B */ 0x4056, +/* 9f3 - */ 0, +/* 9f4 - */ 0, +/* 9f5 - */ 0, +/* 9f6 - */ 0, +/* 9f7 - */ 0, +/* 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, +/* 9ff - _V_F2_0F_5C */ 0x405a, +/* a00 - */ 0, +/* a01 - */ 0, +/* a02 - */ 0, +/* a03 - */ 0, +/* 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, +/* a0b - _V_F2_0F_5D */ 0x405e, +/* a0c - */ 0, +/* a0d - */ 0, +/* a0e - */ 0, +/* a0f - */ 0, +/* 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, +/* a17 - _V_F2_0F_5E */ 0x4062, +/* a18 - */ 0, +/* a19 - */ 0, +/* a1a - */ 0, +/* a1b - */ 0, +/* 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, +/* a23 - _V_F2_0F_5F */ 0x4066, +/* a24 - */ 0, +/* a25 - */ 0, +/* a26 - */ 0, +/* a27 - */ 0, +/* a28 - _0F_60 */ 0x23d6, +/* a29 - _66_0F_60 */ 0x23d7, +/* a2a - */ 0, +/* a2b - */ 0, +/* a2c - */ 0, +/* a2d - _V_66_0F_60 */ 0x4067, +/* a2e - */ 0, +/* a2f - */ 0, +/* a30 - */ 0, +/* a31 - */ 0, +/* a32 - */ 0, +/* a33 - */ 0, +/* a34 - _0F_61 */ 0x23d8, +/* a35 - _66_0F_61 */ 0x23d9, +/* a36 - */ 0, +/* a37 - */ 0, +/* a38 - */ 0, +/* a39 - _V_66_0F_61 */ 0x4068, +/* a3a - */ 0, +/* a3b - */ 0, +/* a3c - */ 0, +/* a3d - */ 0, +/* a3e - */ 0, +/* a3f - */ 0, +/* a40 - _0F_62 */ 0x23da, +/* a41 - _66_0F_62 */ 0x23db, +/* a42 - */ 0, +/* a43 - */ 0, +/* a44 - */ 0, +/* a45 - _V_66_0F_62 */ 0x4069, +/* a46 - */ 0, +/* a47 - */ 0, +/* a48 - */ 0, +/* a49 - */ 0, +/* a4a - */ 0, +/* a4b - */ 0, +/* a4c - _0F_63 */ 0x23dc, +/* a4d - _66_0F_63 */ 0x23dd, +/* a4e - */ 0, +/* a4f - */ 0, +/* a50 - */ 0, +/* a51 - _V_66_0F_63 */ 0x406a, +/* a52 - */ 0, +/* a53 - */ 0, +/* a54 - */ 0, +/* a55 - */ 0, +/* a56 - */ 0, +/* a57 - */ 0, +/* a58 - _0F_64 */ 0x23de, +/* a59 - _66_0F_64 */ 0x23df, +/* a5a - */ 0, +/* a5b - */ 0, +/* a5c - */ 0, +/* a5d - _V_66_0F_64 */ 0x406b, +/* a5e - */ 0, +/* a5f - */ 0, +/* a60 - */ 0, +/* a61 - */ 0, +/* a62 - */ 0, +/* a63 - */ 0, +/* a64 - _0F_65 */ 0x23e0, +/* a65 - _66_0F_65 */ 0x23e1, +/* a66 - */ 0, +/* a67 - */ 0, +/* a68 - */ 0, +/* a69 - _V_66_0F_65 */ 0x406c, +/* a6a - */ 0, +/* a6b - */ 0, +/* a6c - */ 0, +/* a6d - */ 0, +/* a6e - */ 0, +/* a6f - */ 0, +/* a70 - _0F_66 */ 0x23e2, +/* a71 - _66_0F_66 */ 0x23e3, +/* a72 - */ 0, +/* a73 - */ 0, +/* a74 - */ 0, +/* a75 - _V_66_0F_66 */ 0x406d, +/* a76 - */ 0, +/* a77 - */ 0, +/* a78 - */ 0, +/* a79 - */ 0, +/* a7a - */ 0, +/* a7b - */ 0, +/* a7c - _0F_67 */ 0x23e4, +/* a7d - _66_0F_67 */ 0x23e5, +/* a7e - */ 0, +/* a7f - */ 0, +/* a80 - */ 0, +/* a81 - _V_66_0F_67 */ 0x406e, +/* a82 - */ 0, +/* a83 - */ 0, +/* a84 - */ 0, +/* a85 - */ 0, +/* a86 - */ 0, +/* a87 - */ 0, +/* a88 - _0F_68 */ 0x23e6, +/* a89 - _66_0F_68 */ 0x23e7, +/* a8a - */ 0, +/* a8b - */ 0, +/* a8c - */ 0, +/* a8d - _V_66_0F_68 */ 0x406f, +/* a8e - */ 0, +/* a8f - */ 0, +/* a90 - */ 0, +/* a91 - */ 0, +/* a92 - */ 0, +/* a93 - */ 0, +/* a94 - _0F_69 */ 0x23e8, +/* a95 - _66_0F_69 */ 0x23e9, +/* a96 - */ 0, +/* a97 - */ 0, +/* a98 - */ 0, +/* a99 - _V_66_0F_69 */ 0x4070, +/* a9a - */ 0, +/* a9b - */ 0, +/* a9c - */ 0, +/* a9d - */ 0, +/* a9e - */ 0, +/* a9f - */ 0, +/* aa0 - _0F_6A */ 0x23ea, +/* aa1 - _66_0F_6A */ 0x23eb, +/* aa2 - */ 0, +/* aa3 - */ 0, +/* aa4 - */ 0, +/* aa5 - _V_66_0F_6A */ 0x4071, +/* aa6 - */ 0, +/* aa7 - */ 0, +/* aa8 - */ 0, +/* aa9 - */ 0, +/* aaa - */ 0, +/* aab - */ 0, +/* aac - _0F_6B */ 0x23ec, +/* aad - _66_0F_6B */ 0x23ed, +/* aae - */ 0, +/* aaf - */ 0, +/* ab0 - */ 0, +/* ab1 - _V_66_0F_6B */ 0x4072, +/* ab2 - */ 0, +/* ab3 - */ 0, +/* ab4 - */ 0, +/* ab5 - */ 0, +/* ab6 - */ 0, +/* ab7 - */ 0, +/* ab8 - */ 0, +/* ab9 - _66_0F_6C */ 0x23ee, +/* aba - */ 0, +/* abb - */ 0, +/* abc - */ 0, +/* abd - _V_66_0F_6C */ 0x4073, +/* abe - */ 0, +/* abf - */ 0, +/* ac0 - */ 0, +/* ac1 - */ 0, +/* ac2 - */ 0, +/* ac3 - */ 0, +/* ac4 - */ 0, +/* ac5 - _66_0F_6D */ 0x23ef, +/* ac6 - */ 0, +/* ac7 - */ 0, +/* ac8 - */ 0, +/* ac9 - _V_66_0F_6D */ 0x4074, +/* aca - */ 0, +/* acb - */ 0, +/* acc - */ 0, +/* acd - */ 0, +/* ace - */ 0, +/* acf - */ 0, +/* ad0 - _0F_6E */ 0x4075, +/* ad1 - _66_0F_6E */ 0x4076, +/* ad2 - */ 0, +/* ad3 - */ 0, +/* ad4 - */ 0, +/* ad5 - _V_66_0F_6E */ 0x4077, +/* ad6 - */ 0, +/* ad7 - */ 0, +/* ad8 - */ 0, +/* ad9 - */ 0, +/* ada - */ 0, +/* adb - */ 0, +/* adc - _0F_6F */ 0x23f0, +/* add - _66_0F_6F */ 0x23f1, +/* ade - _F3_0F_6F */ 0x23f2, +/* adf - */ 0, +/* ae0 - */ 0, +/* ae1 - _V_66_0F_6F */ 0x4078, +/* ae2 - _V_F3_0F_6F */ 0x4079, +/* ae3 - */ 0, +/* ae4 - */ 0, +/* ae5 - */ 0, +/* ae6 - */ 0, +/* ae7 - */ 0, +/* ae8 - _0F_70 */ 0x407a, +/* ae9 - _66_0F_70 */ 0x407b, +/* aea - _F3_0F_70 */ 0x407c, +/* aeb - _F2_0F_70 */ 0x407d, +/* aec - */ 0, +/* aed - _V_66_0F_70 */ 0x407e, +/* aee - _V_F3_0F_70 */ 0x407f, +/* aef - _V_F2_0F_70 */ 0x4080, +/* af0 - */ 0, +/* af1 - */ 0, +/* af2 - */ 0, +/* af3 - */ 0, +/* af4 - */ 0, +/* af5 - */ 0, +/* af6 - _0F_71_02 */ 0xf584, +/* af7 - */ 0, +/* af8 - _0F_71_04 */ 0xf590, +/* af9 - */ 0, +/* afa - _0F_71_06 */ 0xf59c, +/* afb - */ 0, +/* afc - */ 0, +/* afd - */ 0, +/* afe - _0F_72_02 */ 0xf5a8, +/* aff - */ 0, +/* b00 - _0F_72_04 */ 0xf5b4, +/* b01 - */ 0, +/* b02 - _0F_72_06 */ 0xf5c0, +/* b03 - */ 0, +/* b04 - */ 0, +/* b05 - */ 0, +/* b06 - _0F_73_02 */ 0xf5cc, +/* b07 - _0F_73_03 */ 0xf5d8, +/* b08 - */ 0, +/* b09 - */ 0, +/* 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, +/* b11 - _V_66_0F_74 */ 0x4081, +/* b12 - */ 0, +/* b13 - */ 0, +/* b14 - */ 0, +/* b15 - */ 0, +/* b16 - */ 0, +/* b17 - */ 0, +/* b18 - _0F_75 */ 0x23f5, +/* b19 - _66_0F_75 */ 0x23f6, +/* b1a - */ 0, +/* b1b - */ 0, +/* b1c - */ 0, +/* b1d - _V_66_0F_75 */ 0x4082, +/* b1e - */ 0, +/* b1f - */ 0, +/* b20 - */ 0, +/* b21 - */ 0, +/* b22 - */ 0, +/* b23 - */ 0, +/* b24 - _0F_76 */ 0x23f7, +/* b25 - _66_0F_76 */ 0x23f8, +/* b26 - */ 0, +/* b27 - */ 0, +/* b28 - */ 0, +/* b29 - _V_66_0F_76 */ 0x4083, +/* b2a - */ 0, +/* b2b - */ 0, +/* b2c - */ 0, +/* b2d - */ 0, +/* b2e - */ 0, +/* b2f - */ 0, +/* b30 - _0F_77 */ 0x23f9, +/* b31 - */ 0, +/* b32 - */ 0, +/* b33 - */ 0, +/* b34 - _V_0F_77 */ 0x4084, +/* b35 - */ 0, +/* b36 - */ 0, +/* b37 - */ 0, +/* b38 - */ 0, +/* b39 - */ 0, +/* b3a - */ 0, +/* b3b - */ 0, +/* b3c - _0F_78 */ 0x23fa, +/* b3d - _66_0F_78 */ 0x4085, +/* b3e - */ 0, +/* b3f - _F2_0F_78 */ 0x4086, +/* b40 - */ 0, +/* b41 - */ 0, +/* b42 - */ 0, +/* b43 - */ 0, +/* b44 - */ 0, +/* b45 - */ 0, +/* b46 - */ 0, +/* b47 - */ 0, +/* b48 - _0F_79 */ 0x23fb, +/* b49 - _66_0F_79 */ 0x23fc, +/* b4a - */ 0, +/* b4b - _F2_0F_79 */ 0x23fd, +/* b4c - */ 0, +/* b4d - */ 0, +/* b4e - */ 0, +/* b4f - */ 0, +/* b50 - */ 0, +/* b51 - */ 0, +/* b52 - */ 0, +/* b53 - */ 0, +/* b54 - */ 0, +/* b55 - */ 0, +/* b56 - */ 0, +/* b57 - */ 0, +/* b58 - */ 0, +/* b59 - */ 0, +/* b5a - */ 0, +/* b5b - */ 0, +/* b5c - */ 0, +/* b5d - */ 0, +/* b5e - */ 0, +/* b5f - */ 0, +/* b60 - */ 0, +/* b61 - */ 0, +/* b62 - */ 0, +/* b63 - */ 0, +/* b64 - */ 0, +/* b65 - */ 0, +/* b66 - */ 0, +/* b67 - */ 0, +/* b68 - */ 0, +/* b69 - */ 0, +/* b6a - */ 0, +/* b6b - */ 0, +/* b6c - */ 0, +/* b6d - */ 0, +/* b6e - */ 0, +/* b6f - */ 0, +/* b70 - */ 0, +/* b71 - */ 0, +/* b72 - */ 0, +/* b73 - */ 0, +/* b74 - */ 0, +/* b75 - */ 0, +/* b76 - */ 0, +/* b77 - */ 0, +/* b78 - */ 0, +/* b79 - */ 0, +/* b7a - */ 0, +/* b7b - */ 0, +/* b7c - */ 0, +/* b7d - */ 0, +/* b7e - */ 0, +/* b7f - */ 0, +/* b80 - */ 0, +/* b81 - */ 0, +/* b82 - */ 0, +/* b83 - */ 0, +/* b84 - _0F_7A_30 */ 0x23fe, +/* b85 - _0F_7A_31 */ 0x23ff, +/* b86 - */ 0, +/* b87 - */ 0, +/* b88 - */ 0, +/* b89 - */ 0, +/* b8a - */ 0, +/* b8b - */ 0, +/* b8c - */ 0, +/* b8d - */ 0, +/* b8e - */ 0, +/* b8f - */ 0, +/* b90 - */ 0, +/* b91 - */ 0, +/* b92 - */ 0, +/* b93 - */ 0, +/* b94 - */ 0, +/* b95 - */ 0, +/* b96 - */ 0, +/* b97 - */ 0, +/* b98 - */ 0, +/* b99 - */ 0, +/* b9a - */ 0, +/* b9b - */ 0, +/* b9c - */ 0, +/* b9d - */ 0, +/* b9e - */ 0, +/* b9f - */ 0, +/* ba0 - */ 0, +/* ba1 - */ 0, +/* ba2 - */ 0, +/* ba3 - */ 0, +/* ba4 - */ 0, +/* ba5 - */ 0, +/* ba6 - */ 0, +/* ba7 - */ 0, +/* ba8 - */ 0, +/* ba9 - */ 0, +/* baa - */ 0, +/* bab - */ 0, +/* bac - */ 0, +/* bad - */ 0, +/* bae - */ 0, +/* baf - */ 0, +/* bb0 - */ 0, +/* bb1 - */ 0, +/* bb2 - */ 0, +/* bb3 - */ 0, +/* bb4 - */ 0, +/* bb5 - */ 0, +/* bb6 - */ 0, +/* bb7 - */ 0, +/* bb8 - */ 0, +/* bb9 - */ 0, +/* bba - */ 0, +/* bbb - */ 0, +/* bbc - */ 0, +/* bbd - */ 0, +/* bbe - */ 0, +/* bbf - */ 0, +/* bc0 - */ 0, +/* bc1 - */ 0, +/* bc2 - */ 0, +/* bc3 - */ 0, +/* bc4 - */ 0, +/* bc5 - */ 0, +/* bc6 - */ 0, +/* bc7 - */ 0, +/* bc8 - */ 0, +/* bc9 - */ 0, +/* bca - */ 0, +/* bcb - */ 0, +/* bcc - */ 0, +/* bcd - */ 0, +/* bce - */ 0, +/* bcf - */ 0, +/* bd0 - */ 0, +/* bd1 - */ 0, +/* bd2 - */ 0, +/* bd3 - */ 0, +/* bd4 - */ 0, +/* bd5 - */ 0, +/* bd6 - */ 0, +/* bd7 - */ 0, +/* bd8 - */ 0, +/* bd9 - */ 0, +/* bda - */ 0, +/* bdb - */ 0, +/* bdc - */ 0, +/* bdd - */ 0, +/* bde - */ 0, +/* bdf - */ 0, +/* be0 - */ 0, +/* be1 - */ 0, +/* be2 - */ 0, +/* be3 - */ 0, +/* be4 - */ 0, +/* be5 - */ 0, +/* be6 - */ 0, +/* be7 - */ 0, +/* be8 - */ 0, +/* be9 - */ 0, +/* bea - */ 0, +/* beb - */ 0, +/* bec - */ 0, +/* bed - */ 0, +/* bee - */ 0, +/* bef - */ 0, +/* bf0 - */ 0, +/* bf1 - */ 0, +/* bf2 - */ 0, +/* bf3 - */ 0, +/* bf4 - */ 0, +/* bf5 - */ 0, +/* bf6 - */ 0, +/* bf7 - */ 0, +/* bf8 - */ 0, +/* bf9 - */ 0, +/* bfa - */ 0, +/* bfb - */ 0, +/* bfc - */ 0, +/* bfd - */ 0, +/* bfe - */ 0, +/* bff - */ 0, +/* c00 - */ 0, +/* c01 - */ 0, +/* c02 - */ 0, +/* c03 - */ 0, +/* c04 - */ 0, +/* c05 - */ 0, +/* c06 - */ 0, +/* c07 - */ 0, +/* c08 - */ 0, +/* c09 - */ 0, +/* c0a - */ 0, +/* c0b - */ 0, +/* c0c - */ 0, +/* c0d - */ 0, +/* c0e - */ 0, +/* c0f - */ 0, +/* c10 - */ 0, +/* c11 - */ 0, +/* c12 - */ 0, +/* c13 - */ 0, +/* c14 - */ 0, +/* c15 - */ 0, +/* c16 - */ 0, +/* c17 - */ 0, +/* c18 - */ 0, +/* c19 - */ 0, +/* c1a - */ 0, +/* c1b - */ 0, +/* c1c - */ 0, +/* c1d - */ 0, +/* c1e - */ 0, +/* c1f - */ 0, +/* c20 - */ 0, +/* c21 - */ 0, +/* c22 - */ 0, +/* c23 - */ 0, +/* c24 - */ 0, +/* c25 - */ 0, +/* c26 - */ 0, +/* c27 - */ 0, +/* c28 - */ 0, +/* c29 - */ 0, +/* c2a - */ 0, +/* c2b - */ 0, +/* c2c - */ 0, +/* c2d - */ 0, +/* c2e - */ 0, +/* c2f - */ 0, +/* c30 - */ 0, +/* c31 - */ 0, +/* c32 - */ 0, +/* c33 - */ 0, +/* c34 - */ 0, +/* c35 - */ 0, +/* c36 - */ 0, +/* c37 - */ 0, +/* c38 - */ 0, +/* c39 - */ 0, +/* c3a - */ 0, +/* c3b - */ 0, +/* c3c - */ 0, +/* c3d - */ 0, +/* c3e - */ 0, +/* c3f - */ 0, +/* c40 - */ 0, +/* c41 - */ 0, +/* c42 - */ 0, +/* c43 - */ 0, +/* c44 - */ 0, +/* c45 - */ 0, +/* c46 - */ 0, +/* c47 - */ 0, +/* c48 - */ 0, +/* c49 - */ 0, +/* c4a - */ 0, +/* c4b - */ 0, +/* c4c - */ 0, +/* c4d - */ 0, +/* c4e - */ 0, +/* c4f - */ 0, +/* c50 - */ 0, +/* c51 - */ 0, +/* c52 - */ 0, +/* c53 - */ 0, +/* c54 - */ 0, +/* c55 - _66_0F_7C */ 0x2400, +/* c56 - */ 0, +/* c57 - _F2_0F_7C */ 0x2401, +/* c58 - */ 0, +/* c59 - _V_66_0F_7C */ 0x4087, +/* c5a - */ 0, +/* c5b - _V_F2_0F_7C */ 0x4088, +/* c5c - */ 0, +/* c5d - */ 0, +/* c5e - */ 0, +/* c5f - */ 0, +/* c60 - */ 0, +/* c61 - _66_0F_7D */ 0x2402, +/* c62 - */ 0, +/* c63 - _F2_0F_7D */ 0x2403, +/* c64 - */ 0, +/* c65 - _V_66_0F_7D */ 0x4089, +/* c66 - */ 0, +/* c67 - _V_F2_0F_7D */ 0x408a, +/* c68 - */ 0, +/* c69 - */ 0, +/* c6a - */ 0, +/* c6b - */ 0, +/* c6c - _0F_7E */ 0x408b, +/* c6d - _66_0F_7E */ 0x408c, +/* c6e - _F3_0F_7E */ 0x2404, +/* c6f - */ 0, +/* c70 - */ 0, +/* c71 - _V_66_0F_7E */ 0x408d, +/* c72 - _V_F3_0F_7E */ 0x408e, +/* c73 - */ 0, +/* c74 - */ 0, +/* c75 - */ 0, +/* c76 - */ 0, +/* c77 - */ 0, +/* c78 - _0F_7F */ 0x2405, +/* c79 - _66_0F_7F */ 0x2406, +/* c7a - _F3_0F_7F */ 0x2407, +/* c7b - */ 0, +/* c7c - */ 0, +/* c7d - _V_66_0F_7F */ 0x408f, +/* c7e - _V_F3_0F_7F */ 0x4090, +/* c7f - */ 0, +/* c80 - */ 0, +/* c81 - */ 0, +/* c82 - */ 0, +/* c83 - */ 0, +/* 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 */ 0x2408, +/* c8f - */ 0, +/* c90 - */ 0, +/* c91 - */ 0, +/* c92 - */ 0, +/* c93 - */ 0, +/* c94 - */ 0, +/* c95 - */ 0, +/* c96 - */ 0, +/* c97 - */ 0, +/* c98 - */ 0, +/* c99 - */ 0, +/* c9a - */ 0, +/* c9b - */ 0, +/* 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 */ 0x240e, +/* ca3 - */ 0, +/* ca4 - */ 0, +/* ca5 - */ 0, +/* ca6 - */ 0, +/* ca7 - */ 0, +/* ca8 - */ 0, +/* ca9 - */ 0, +/* caa - */ 0, +/* cab - */ 0, +/* cac - _0F_BD */ 0x240f, +/* cad - */ 0, +/* cae - _F3_0F_BD */ 0x2410, +/* caf - */ 0, +/* cb0 - */ 0, +/* cb1 - */ 0, +/* cb2 - */ 0, +/* cb3 - */ 0, +/* cb4 - */ 0, +/* cb5 - */ 0, +/* cb6 - */ 0, +/* cb7 - */ 0, +/* cb8 - _0F_C2 */ 0x4095, +/* cb9 - _66_0F_C2 */ 0x4096, +/* cba - _F3_0F_C2 */ 0x4097, +/* cbb - _F2_0F_C2 */ 0x4098, +/* cbc - _V_0F_C2 */ 0x4099, +/* cbd - _V_66_0F_C2 */ 0x409a, +/* cbe - _V_F3_0F_C2 */ 0x409b, +/* cbf - _V_F2_0F_C2 */ 0x409c, +/* cc0 - */ 0, +/* cc1 - */ 0, +/* cc2 - */ 0, +/* cc3 - */ 0, +/* cc4 - _0F_C4 */ 0x409d, +/* cc5 - _66_0F_C4 */ 0x409e, +/* cc6 - */ 0, +/* cc7 - */ 0, +/* cc8 - */ 0, +/* cc9 - _V_66_0F_C4 */ 0x409f, +/* cca - */ 0, +/* ccb - */ 0, +/* ccc - */ 0, +/* ccd - */ 0, +/* cce - */ 0, +/* ccf - */ 0, +/* cd0 - _0F_C5 */ 0x40a0, +/* cd1 - _66_0F_C5 */ 0x40a1, +/* cd2 - */ 0, +/* cd3 - */ 0, +/* cd4 - */ 0, +/* cd5 - _V_66_0F_C5 */ 0x40a2, +/* cd6 - */ 0, +/* cd7 - */ 0, +/* cd8 - */ 0, +/* cd9 - */ 0, +/* cda - */ 0, +/* cdb - */ 0, +/* cdc - _0F_C6 */ 0x40a3, +/* cdd - _66_0F_C6 */ 0x40a4, +/* cde - */ 0, +/* cdf - */ 0, +/* ce0 - _V_0F_C6 */ 0x40a5, +/* ce1 - _V_66_0F_C6 */ 0x40a6, +/* ce2 - */ 0, +/* ce3 - */ 0, +/* ce4 - */ 0, +/* ce5 - */ 0, +/* ce6 - */ 0, +/* ce7 - */ 0, +/* ce8 - */ 0, +/* ce9 - _0F_C7_01 */ 0x40a7, +/* cea - */ 0, +/* ceb - */ 0, +/* cec - */ 0, +/* ced - */ 0, +/* cee - _0F_C7_06 */ 0xf62c, +/* cef - _0F_C7_07 */ 0x2411, +/* cf0 - */ 0, +/* cf1 - _66_0F_D0 */ 0x2412, +/* cf2 - */ 0, +/* cf3 - _F2_0F_D0 */ 0x2413, +/* cf4 - */ 0, +/* cf5 - _V_66_0F_D0 */ 0x40a8, +/* cf6 - */ 0, +/* cf7 - _V_F2_0F_D0 */ 0x40a9, +/* cf8 - */ 0, +/* cf9 - */ 0, +/* cfa - */ 0, +/* cfb - */ 0, +/* cfc - _0F_D1 */ 0x2414, +/* cfd - _66_0F_D1 */ 0x2415, +/* cfe - */ 0, +/* cff - */ 0, +/* d00 - */ 0, +/* d01 - _V_66_0F_D1 */ 0x40aa, +/* d02 - */ 0, +/* d03 - */ 0, +/* d04 - */ 0, +/* d05 - */ 0, +/* d06 - */ 0, +/* d07 - */ 0, +/* d08 - _0F_D2 */ 0x2416, +/* d09 - _66_0F_D2 */ 0x2417, +/* d0a - */ 0, +/* d0b - */ 0, +/* d0c - */ 0, +/* d0d - _V_66_0F_D2 */ 0x40ab, +/* d0e - */ 0, +/* d0f - */ 0, +/* d10 - */ 0, +/* d11 - */ 0, +/* d12 - */ 0, +/* d13 - */ 0, +/* d14 - _0F_D3 */ 0x2418, +/* d15 - _66_0F_D3 */ 0x2419, +/* d16 - */ 0, +/* d17 - */ 0, +/* d18 - */ 0, +/* d19 - _V_66_0F_D3 */ 0x40ac, +/* d1a - */ 0, +/* d1b - */ 0, +/* d1c - */ 0, +/* d1d - */ 0, +/* d1e - */ 0, +/* d1f - */ 0, +/* d20 - _0F_D4 */ 0x241a, +/* d21 - _66_0F_D4 */ 0x241b, +/* d22 - */ 0, +/* d23 - */ 0, +/* d24 - */ 0, +/* d25 - _V_66_0F_D4 */ 0x40ad, +/* d26 - */ 0, +/* d27 - */ 0, +/* d28 - */ 0, +/* d29 - */ 0, +/* d2a - */ 0, +/* d2b - */ 0, +/* d2c - _0F_D5 */ 0x241c, +/* d2d - _66_0F_D5 */ 0x241d, +/* d2e - */ 0, +/* d2f - */ 0, +/* d30 - */ 0, +/* d31 - _V_66_0F_D5 */ 0x40ae, +/* d32 - */ 0, +/* d33 - */ 0, +/* d34 - */ 0, +/* d35 - */ 0, +/* d36 - */ 0, +/* d37 - */ 0, +/* d38 - */ 0, +/* 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, +/* d3f - */ 0, +/* d40 - */ 0, +/* d41 - */ 0, +/* d42 - */ 0, +/* d43 - */ 0, +/* d44 - _0F_D7 */ 0x2421, +/* d45 - _66_0F_D7 */ 0x2422, +/* d46 - */ 0, +/* d47 - */ 0, +/* d48 - */ 0, +/* d49 - _V_66_0F_D7 */ 0x40b0, +/* d4a - */ 0, +/* d4b - */ 0, +/* d4c - */ 0, +/* d4d - */ 0, +/* d4e - */ 0, +/* d4f - */ 0, +/* d50 - _0F_D8 */ 0x2423, +/* d51 - _66_0F_D8 */ 0x2424, +/* d52 - */ 0, +/* d53 - */ 0, +/* d54 - */ 0, +/* d55 - _V_66_0F_D8 */ 0x40b1, +/* d56 - */ 0, +/* d57 - */ 0, +/* d58 - */ 0, +/* d59 - */ 0, +/* d5a - */ 0, +/* d5b - */ 0, +/* d5c - _0F_D9 */ 0x2425, +/* d5d - _66_0F_D9 */ 0x2426, +/* d5e - */ 0, +/* d5f - */ 0, +/* d60 - */ 0, +/* d61 - _V_66_0F_D9 */ 0x40b2, +/* d62 - */ 0, +/* d63 - */ 0, +/* d64 - */ 0, +/* d65 - */ 0, +/* d66 - */ 0, +/* d67 - */ 0, +/* d68 - _0F_DA */ 0x2427, +/* d69 - _66_0F_DA */ 0x2428, +/* d6a - */ 0, +/* d6b - */ 0, +/* d6c - */ 0, +/* d6d - _V_66_0F_DA */ 0x40b3, +/* d6e - */ 0, +/* d6f - */ 0, +/* d70 - */ 0, +/* d71 - */ 0, +/* d72 - */ 0, +/* d73 - */ 0, +/* d74 - _0F_DB */ 0x2429, +/* d75 - _66_0F_DB */ 0x242a, +/* d76 - */ 0, +/* d77 - */ 0, +/* d78 - */ 0, +/* d79 - _V_66_0F_DB */ 0x40b4, +/* d7a - */ 0, +/* d7b - */ 0, +/* d7c - */ 0, +/* d7d - */ 0, +/* d7e - */ 0, +/* d7f - */ 0, +/* d80 - _0F_DC */ 0x242b, +/* d81 - _66_0F_DC */ 0x242c, +/* d82 - */ 0, +/* d83 - */ 0, +/* d84 - */ 0, +/* d85 - _V_66_0F_DC */ 0x40b5, +/* d86 - */ 0, +/* d87 - */ 0, +/* d88 - */ 0, +/* d89 - */ 0, +/* d8a - */ 0, +/* d8b - */ 0, +/* d8c - _0F_DD */ 0x242d, +/* d8d - _66_0F_DD */ 0x242e, +/* d8e - */ 0, +/* d8f - */ 0, +/* d90 - */ 0, +/* d91 - _V_66_0F_DD */ 0x40b6, +/* d92 - */ 0, +/* d93 - */ 0, +/* d94 - */ 0, +/* d95 - */ 0, +/* d96 - */ 0, +/* d97 - */ 0, +/* d98 - _0F_DE */ 0x242f, +/* d99 - _66_0F_DE */ 0x2430, +/* d9a - */ 0, +/* d9b - */ 0, +/* d9c - */ 0, +/* d9d - _V_66_0F_DE */ 0x40b7, +/* d9e - */ 0, +/* d9f - */ 0, +/* da0 - */ 0, +/* da1 - */ 0, +/* da2 - */ 0, +/* da3 - */ 0, +/* da4 - _0F_DF */ 0x2431, +/* da5 - _66_0F_DF */ 0x2432, +/* da6 - */ 0, +/* da7 - */ 0, +/* da8 - */ 0, +/* da9 - _V_66_0F_DF */ 0x40b8, +/* daa - */ 0, +/* dab - */ 0, +/* dac - */ 0, +/* dad - */ 0, +/* dae - */ 0, +/* daf - */ 0, +/* db0 - _0F_E0 */ 0x2433, +/* db1 - _66_0F_E0 */ 0x2434, +/* db2 - */ 0, +/* db3 - */ 0, +/* db4 - */ 0, +/* db5 - _V_66_0F_E0 */ 0x40b9, +/* db6 - */ 0, +/* db7 - */ 0, +/* db8 - */ 0, +/* db9 - */ 0, +/* dba - */ 0, +/* dbb - */ 0, +/* dbc - _0F_E1 */ 0x2435, +/* dbd - _66_0F_E1 */ 0x2436, +/* dbe - */ 0, +/* dbf - */ 0, +/* dc0 - */ 0, +/* dc1 - _V_66_0F_E1 */ 0x40ba, +/* dc2 - */ 0, +/* dc3 - */ 0, +/* dc4 - */ 0, +/* dc5 - */ 0, +/* dc6 - */ 0, +/* dc7 - */ 0, +/* dc8 - _0F_E2 */ 0x2437, +/* dc9 - _66_0F_E2 */ 0x2438, +/* dca - */ 0, +/* dcb - */ 0, +/* dcc - */ 0, +/* dcd - _V_66_0F_E2 */ 0x40bb, +/* dce - */ 0, +/* dcf - */ 0, +/* dd0 - */ 0, +/* dd1 - */ 0, +/* dd2 - */ 0, +/* dd3 - */ 0, +/* dd4 - _0F_E3 */ 0x2439, +/* dd5 - _66_0F_E3 */ 0x243a, +/* dd6 - */ 0, +/* dd7 - */ 0, +/* dd8 - */ 0, +/* dd9 - _V_66_0F_E3 */ 0x40bc, +/* dda - */ 0, +/* ddb - */ 0, +/* ddc - */ 0, +/* ddd - */ 0, +/* dde - */ 0, +/* ddf - */ 0, +/* de0 - _0F_E4 */ 0x243b, +/* de1 - _66_0F_E4 */ 0x243c, +/* de2 - */ 0, +/* de3 - */ 0, +/* de4 - */ 0, +/* de5 - _V_66_0F_E4 */ 0x40bd, +/* de6 - */ 0, +/* de7 - */ 0, +/* de8 - */ 0, +/* de9 - */ 0, +/* dea - */ 0, +/* deb - */ 0, +/* dec - _0F_E5 */ 0x243d, +/* ded - _66_0F_E5 */ 0x243e, +/* dee - */ 0, +/* def - */ 0, +/* df0 - */ 0, +/* df1 - _V_66_0F_E5 */ 0x40be, +/* df2 - */ 0, +/* df3 - */ 0, +/* df4 - */ 0, +/* df5 - */ 0, +/* df6 - */ 0, +/* df7 - */ 0, +/* df8 - */ 0, +/* 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, +/* dff - _V_F2_0F_E6 */ 0x40c1, +/* e00 - */ 0, +/* e01 - */ 0, +/* e02 - */ 0, +/* e03 - */ 0, +/* e04 - _0F_E7 */ 0x2442, +/* e05 - _66_0F_E7 */ 0x2443, +/* e06 - */ 0, +/* e07 - */ 0, +/* e08 - */ 0, +/* e09 - _V_66_0F_E7 */ 0x40c2, +/* e0a - */ 0, +/* e0b - */ 0, +/* e0c - */ 0, +/* e0d - */ 0, +/* e0e - */ 0, +/* e0f - */ 0, +/* e10 - _0F_E8 */ 0x2444, +/* e11 - _66_0F_E8 */ 0x2445, +/* e12 - */ 0, +/* e13 - */ 0, +/* e14 - */ 0, +/* e15 - _V_66_0F_E8 */ 0x40c3, +/* e16 - */ 0, +/* e17 - */ 0, +/* e18 - */ 0, +/* e19 - */ 0, +/* e1a - */ 0, +/* e1b - */ 0, +/* e1c - _0F_E9 */ 0x2446, +/* e1d - _66_0F_E9 */ 0x2447, +/* e1e - */ 0, +/* e1f - */ 0, +/* e20 - */ 0, +/* e21 - _V_66_0F_E9 */ 0x40c4, +/* e22 - */ 0, +/* e23 - */ 0, +/* e24 - */ 0, +/* e25 - */ 0, +/* e26 - */ 0, +/* e27 - */ 0, +/* e28 - _0F_EA */ 0x2448, +/* e29 - _66_0F_EA */ 0x2449, +/* e2a - */ 0, +/* e2b - */ 0, +/* e2c - */ 0, +/* e2d - _V_66_0F_EA */ 0x40c5, +/* e2e - */ 0, +/* e2f - */ 0, +/* e30 - */ 0, +/* e31 - */ 0, +/* e32 - */ 0, +/* e33 - */ 0, +/* e34 - _0F_EB */ 0x244a, +/* e35 - _66_0F_EB */ 0x244b, +/* e36 - */ 0, +/* e37 - */ 0, +/* e38 - */ 0, +/* e39 - _V_66_0F_EB */ 0x40c6, +/* e3a - */ 0, +/* e3b - */ 0, +/* e3c - */ 0, +/* e3d - */ 0, +/* e3e - */ 0, +/* e3f - */ 0, +/* e40 - _0F_EC */ 0x244c, +/* e41 - _66_0F_EC */ 0x244d, +/* e42 - */ 0, +/* e43 - */ 0, +/* e44 - */ 0, +/* e45 - _V_66_0F_EC */ 0x40c7, +/* e46 - */ 0, +/* e47 - */ 0, +/* e48 - */ 0, +/* e49 - */ 0, +/* e4a - */ 0, +/* e4b - */ 0, +/* e4c - _0F_ED */ 0x244e, +/* e4d - _66_0F_ED */ 0x244f, +/* e4e - */ 0, +/* e4f - */ 0, +/* e50 - */ 0, +/* e51 - _V_66_0F_ED */ 0x40c8, +/* e52 - */ 0, +/* e53 - */ 0, +/* e54 - */ 0, +/* e55 - */ 0, +/* e56 - */ 0, +/* e57 - */ 0, +/* e58 - _0F_EE */ 0x2450, +/* e59 - _66_0F_EE */ 0x2451, +/* e5a - */ 0, +/* e5b - */ 0, +/* e5c - */ 0, +/* e5d - _V_66_0F_EE */ 0x40c9, +/* e5e - */ 0, +/* e5f - */ 0, +/* e60 - */ 0, +/* e61 - */ 0, +/* e62 - */ 0, +/* e63 - */ 0, +/* e64 - _0F_EF */ 0x2452, +/* e65 - _66_0F_EF */ 0x2453, +/* e66 - */ 0, +/* e67 - */ 0, +/* e68 - */ 0, +/* e69 - _V_66_0F_EF */ 0x40ca, +/* e6a - */ 0, +/* e6b - */ 0, +/* e6c - */ 0, +/* e6d - */ 0, +/* e6e - */ 0, +/* e6f - */ 0, +/* e70 - */ 0, +/* e71 - */ 0, +/* e72 - */ 0, +/* e73 - _F2_0F_F0 */ 0x2454, +/* e74 - */ 0, +/* e75 - */ 0, +/* e76 - */ 0, +/* e77 - _V_F2_0F_F0 */ 0x40cb, +/* e78 - */ 0, +/* e79 - */ 0, +/* e7a - */ 0, +/* e7b - */ 0, +/* e7c - _0F_F1 */ 0x2455, +/* e7d - _66_0F_F1 */ 0x2456, +/* e7e - */ 0, +/* e7f - */ 0, +/* e80 - */ 0, +/* e81 - _V_66_0F_F1 */ 0x40cc, +/* e82 - */ 0, +/* e83 - */ 0, +/* e84 - */ 0, +/* e85 - */ 0, +/* e86 - */ 0, +/* e87 - */ 0, +/* e88 - _0F_F2 */ 0x2457, +/* e89 - _66_0F_F2 */ 0x2458, +/* e8a - */ 0, +/* e8b - */ 0, +/* e8c - */ 0, +/* e8d - _V_66_0F_F2 */ 0x40cd, +/* e8e - */ 0, +/* e8f - */ 0, +/* e90 - */ 0, +/* e91 - */ 0, +/* e92 - */ 0, +/* e93 - */ 0, +/* e94 - _0F_F3 */ 0x2459, +/* e95 - _66_0F_F3 */ 0x245a, +/* e96 - */ 0, +/* e97 - */ 0, +/* e98 - */ 0, +/* e99 - _V_66_0F_F3 */ 0x40ce, +/* e9a - */ 0, +/* e9b - */ 0, +/* e9c - */ 0, +/* e9d - */ 0, +/* e9e - */ 0, +/* e9f - */ 0, +/* ea0 - _0F_F4 */ 0x245b, +/* ea1 - _66_0F_F4 */ 0x245c, +/* ea2 - */ 0, +/* ea3 - */ 0, +/* ea4 - */ 0, +/* ea5 - _V_66_0F_F4 */ 0x40cf, +/* ea6 - */ 0, +/* ea7 - */ 0, +/* ea8 - */ 0, +/* ea9 - */ 0, +/* eaa - */ 0, +/* eab - */ 0, +/* eac - _0F_F5 */ 0x245d, +/* ead - _66_0F_F5 */ 0x245e, +/* eae - */ 0, +/* eaf - */ 0, +/* eb0 - */ 0, +/* eb1 - _V_66_0F_F5 */ 0x40d0, +/* eb2 - */ 0, +/* eb3 - */ 0, +/* eb4 - */ 0, +/* eb5 - */ 0, +/* eb6 - */ 0, +/* eb7 - */ 0, +/* eb8 - _0F_F6 */ 0x245f, +/* eb9 - _66_0F_F6 */ 0x2460, +/* eba - */ 0, +/* ebb - */ 0, +/* ebc - */ 0, +/* ebd - _V_66_0F_F6 */ 0x40d1, +/* ebe - */ 0, +/* ebf - */ 0, +/* ec0 - */ 0, +/* ec1 - */ 0, +/* ec2 - */ 0, +/* ec3 - */ 0, +/* ec4 - _0F_F7 */ 0x2461, +/* ec5 - _66_0F_F7 */ 0x2462, +/* ec6 - */ 0, +/* ec7 - */ 0, +/* ec8 - */ 0, +/* ec9 - _V_66_0F_F7 */ 0x40d2, +/* eca - */ 0, +/* ecb - */ 0, +/* ecc - */ 0, +/* ecd - */ 0, +/* ece - */ 0, +/* ecf - */ 0, +/* ed0 - _0F_F8 */ 0x2463, +/* ed1 - _66_0F_F8 */ 0x2464, +/* ed2 - */ 0, +/* ed3 - */ 0, +/* ed4 - */ 0, +/* ed5 - _V_66_0F_F8 */ 0x40d3, +/* ed6 - */ 0, +/* ed7 - */ 0, +/* ed8 - */ 0, +/* ed9 - */ 0, +/* eda - */ 0, +/* edb - */ 0, +/* edc - _0F_F9 */ 0x2465, +/* edd - _66_0F_F9 */ 0x2466, +/* ede - */ 0, +/* edf - */ 0, +/* ee0 - */ 0, +/* ee1 - _V_66_0F_F9 */ 0x40d4, +/* ee2 - */ 0, +/* ee3 - */ 0, +/* ee4 - */ 0, +/* ee5 - */ 0, +/* ee6 - */ 0, +/* ee7 - */ 0, +/* ee8 - _0F_FA */ 0x2467, +/* ee9 - _66_0F_FA */ 0x2468, +/* eea - */ 0, +/* eeb - */ 0, +/* eec - */ 0, +/* eed - _V_66_0F_FA */ 0x40d5, +/* eee - */ 0, +/* eef - */ 0, +/* ef0 - */ 0, +/* ef1 - */ 0, +/* ef2 - */ 0, +/* ef3 - */ 0, +/* ef4 - _0F_FB */ 0x2469, +/* ef5 - _66_0F_FB */ 0x246a, +/* ef6 - */ 0, +/* ef7 - */ 0, +/* ef8 - */ 0, +/* ef9 - _V_66_0F_FB */ 0x40d6, +/* efa - */ 0, +/* efb - */ 0, +/* efc - */ 0, +/* efd - */ 0, +/* efe - */ 0, +/* eff - */ 0, +/* f00 - _0F_FC */ 0x246b, +/* f01 - _66_0F_FC */ 0x246c, +/* f02 - */ 0, +/* f03 - */ 0, +/* f04 - */ 0, +/* f05 - _V_66_0F_FC */ 0x40d7, +/* f06 - */ 0, +/* f07 - */ 0, +/* f08 - */ 0, +/* f09 - */ 0, +/* f0a - */ 0, +/* f0b - */ 0, +/* f0c - _0F_FD */ 0x246d, +/* f0d - _66_0F_FD */ 0x246e, +/* f0e - */ 0, +/* f0f - */ 0, +/* f10 - */ 0, +/* f11 - _V_66_0F_FD */ 0x40d8, +/* f12 - */ 0, +/* f13 - */ 0, +/* f14 - */ 0, +/* f15 - */ 0, +/* f16 - */ 0, +/* f17 - */ 0, +/* f18 - _0F_FE */ 0x246f, +/* f19 - _66_0F_FE */ 0x2470, +/* f1a - */ 0, +/* f1b - */ 0, +/* f1c - */ 0, +/* f1d - _V_66_0F_FE */ 0x40d9, +/* f1e - */ 0, +/* f1f - */ 0, +/* f20 - */ 0, +/* f21 - */ 0, +/* f22 - */ 0, +/* f23 - */ 0, +/* f24 - _D9_06 */ 0x2471, +/* f25 - _9B_D9_06 */ 0x2472, +/* f26 - */ 0, +/* f27 - */ 0, +/* f28 - */ 0, +/* f29 - */ 0, +/* f2a - */ 0, +/* f2b - */ 0, +/* f2c - */ 0, +/* f2d - */ 0, +/* f2e - */ 0, +/* f2f - */ 0, +/* f30 - _D9_07 */ 0x2473, +/* f31 - _9B_D9_07 */ 0x2474, +/* f32 - */ 0, +/* f33 - */ 0, +/* f34 - */ 0, +/* f35 - */ 0, +/* f36 - */ 0, +/* f37 - */ 0, +/* f38 - */ 0, +/* f39 - */ 0, +/* f3a - */ 0, +/* f3b - */ 0, +/* f3c - _DB_E2 */ 0x2475, +/* f3d - _9B_DB_E2 */ 0x2476, +/* f3e - */ 0, +/* f3f - */ 0, +/* f40 - */ 0, +/* f41 - */ 0, +/* f42 - */ 0, +/* f43 - */ 0, +/* f44 - */ 0, +/* f45 - */ 0, +/* f46 - */ 0, +/* f47 - */ 0, +/* f48 - _DB_E3 */ 0x2477, +/* f49 - _9B_DB_E3 */ 0x2478, +/* f4a - */ 0, +/* f4b - */ 0, +/* f4c - */ 0, +/* f4d - */ 0, +/* f4e - */ 0, +/* f4f - */ 0, +/* f50 - */ 0, +/* f51 - */ 0, +/* f52 - */ 0, +/* f53 - */ 0, +/* f54 - _DD_06 */ 0x2479, +/* f55 - _9B_DD_06 */ 0x247a, +/* f56 - */ 0, +/* f57 - */ 0, +/* f58 - */ 0, +/* f59 - */ 0, +/* f5a - */ 0, +/* f5b - */ 0, +/* f5c - */ 0, +/* f5d - */ 0, +/* f5e - */ 0, +/* f5f - */ 0, +/* f60 - _DD_07 */ 0x247b, +/* f61 - _9B_DD_07 */ 0x247c, +/* f62 - */ 0, +/* f63 - */ 0, +/* f64 - */ 0, +/* f65 - */ 0, +/* f66 - */ 0, +/* f67 - */ 0, +/* f68 - */ 0, +/* f69 - */ 0, +/* f6a - */ 0, +/* f6b - */ 0, +/* f6c - _DF_E0 */ 0x247d, +/* f6d - _9B_DF_E0 */ 0x247e, +/* f6e - */ 0, +/* f6f - */ 0, +/* f70 - */ 0, +/* f71 - */ 0, +/* f72 - */ 0, +/* f73 - */ 0, +/* f74 - */ 0, +/* f75 - */ 0, +/* f76 - */ 0, +/* f77 - */ 0, +/* f78 - _0F_38_00 */ 0x247f, +/* f79 - _66_0F_38_00 */ 0x2480, +/* f7a - */ 0, +/* f7b - */ 0, +/* f7c - */ 0, +/* f7d - _V_66_0F_38_00 */ 0x40da, +/* f7e - */ 0, +/* f7f - */ 0, +/* f80 - */ 0, +/* f81 - */ 0, +/* f82 - */ 0, +/* f83 - */ 0, +/* f84 - _0F_38_01 */ 0x2481, +/* f85 - _66_0F_38_01 */ 0x2482, +/* f86 - */ 0, +/* f87 - */ 0, +/* f88 - */ 0, +/* f89 - _V_66_0F_38_01 */ 0x40db, +/* f8a - */ 0, +/* f8b - */ 0, +/* f8c - */ 0, +/* f8d - */ 0, +/* f8e - */ 0, +/* f8f - */ 0, +/* f90 - _0F_38_02 */ 0x2483, +/* f91 - _66_0F_38_02 */ 0x2484, +/* f92 - */ 0, +/* f93 - */ 0, +/* f94 - */ 0, +/* f95 - _V_66_0F_38_02 */ 0x40dc, +/* f96 - */ 0, +/* f97 - */ 0, +/* f98 - */ 0, +/* f99 - */ 0, +/* f9a - */ 0, +/* f9b - */ 0, +/* f9c - _0F_38_03 */ 0x2485, +/* f9d - _66_0F_38_03 */ 0x2486, +/* f9e - */ 0, +/* f9f - */ 0, +/* fa0 - */ 0, +/* fa1 - _V_66_0F_38_03 */ 0x40dd, +/* fa2 - */ 0, +/* fa3 - */ 0, +/* fa4 - */ 0, +/* fa5 - */ 0, +/* fa6 - */ 0, +/* fa7 - */ 0, +/* fa8 - _0F_38_04 */ 0x2487, +/* fa9 - _66_0F_38_04 */ 0x2488, +/* faa - */ 0, +/* fab - */ 0, +/* fac - */ 0, +/* fad - _V_66_0F_38_04 */ 0x40de, +/* fae - */ 0, +/* faf - */ 0, +/* fb0 - */ 0, +/* fb1 - */ 0, +/* fb2 - */ 0, +/* fb3 - */ 0, +/* fb4 - _0F_38_05 */ 0x2489, +/* fb5 - _66_0F_38_05 */ 0x248a, +/* fb6 - */ 0, +/* fb7 - */ 0, +/* fb8 - */ 0, +/* fb9 - _V_66_0F_38_05 */ 0x40df, +/* fba - */ 0, +/* fbb - */ 0, +/* fbc - */ 0, +/* fbd - */ 0, +/* fbe - */ 0, +/* fbf - */ 0, +/* fc0 - _0F_38_06 */ 0x248b, +/* fc1 - _66_0F_38_06 */ 0x248c, +/* fc2 - */ 0, +/* fc3 - */ 0, +/* fc4 - */ 0, +/* fc5 - _V_66_0F_38_06 */ 0x40e0, +/* fc6 - */ 0, +/* fc7 - */ 0, +/* fc8 - */ 0, +/* fc9 - */ 0, +/* fca - */ 0, +/* fcb - */ 0, +/* fcc - _0F_38_07 */ 0x248d, +/* fcd - _66_0F_38_07 */ 0x248e, +/* fce - */ 0, +/* fcf - */ 0, +/* fd0 - */ 0, +/* fd1 - _V_66_0F_38_07 */ 0x40e1, +/* fd2 - */ 0, +/* fd3 - */ 0, +/* fd4 - */ 0, +/* fd5 - */ 0, +/* fd6 - */ 0, +/* fd7 - */ 0, +/* fd8 - _0F_38_08 */ 0x248f, +/* fd9 - _66_0F_38_08 */ 0x2490, +/* fda - */ 0, +/* fdb - */ 0, +/* fdc - */ 0, +/* fdd - _V_66_0F_38_08 */ 0x40e2, +/* fde - */ 0, +/* fdf - */ 0, +/* fe0 - */ 0, +/* fe1 - */ 0, +/* fe2 - */ 0, +/* fe3 - */ 0, +/* fe4 - _0F_38_09 */ 0x2491, +/* fe5 - _66_0F_38_09 */ 0x2492, +/* fe6 - */ 0, +/* fe7 - */ 0, +/* fe8 - */ 0, +/* fe9 - _V_66_0F_38_09 */ 0x40e3, +/* fea - */ 0, +/* feb - */ 0, +/* fec - */ 0, +/* fed - */ 0, +/* fee - */ 0, +/* fef - */ 0, +/* ff0 - _0F_38_0A */ 0x2493, +/* ff1 - _66_0F_38_0A */ 0x2494, +/* ff2 - */ 0, +/* ff3 - */ 0, +/* ff4 - */ 0, +/* ff5 - _V_66_0F_38_0A */ 0x40e4, +/* ff6 - */ 0, +/* ff7 - */ 0, +/* ff8 - */ 0, +/* ff9 - */ 0, +/* ffa - */ 0, +/* ffb - */ 0, +/* ffc - _0F_38_0B */ 0x2495, +/* ffd - _66_0F_38_0B */ 0x2496, +/* ffe - */ 0, +/* fff - */ 0, +/* 1000 - */ 0, +/* 1001 - _V_66_0F_38_0B */ 0x40e5, +/* 1002 - */ 0, +/* 1003 - */ 0, +/* 1004 - */ 0, +/* 1005 - */ 0, +/* 1006 - */ 0, +/* 1007 - */ 0, +/* 1008 - */ 0, +/* 1009 - */ 0, +/* 100a - */ 0, +/* 100b - */ 0, +/* 100c - */ 0, +/* 100d - _V_66_0F_38_0C */ 0x40e6, +/* 100e - */ 0, +/* 100f - */ 0, +/* 1010 - */ 0, +/* 1011 - */ 0, +/* 1012 - */ 0, +/* 1013 - */ 0, +/* 1014 - */ 0, +/* 1015 - */ 0, +/* 1016 - */ 0, +/* 1017 - */ 0, +/* 1018 - */ 0, +/* 1019 - _V_66_0F_38_0D */ 0x40e7, +/* 101a - */ 0, +/* 101b - */ 0, +/* 101c - */ 0, +/* 101d - */ 0, +/* 101e - */ 0, +/* 101f - */ 0, +/* 1020 - */ 0, +/* 1021 - */ 0, +/* 1022 - */ 0, +/* 1023 - */ 0, +/* 1024 - */ 0, +/* 1025 - _V_66_0F_38_0E */ 0x40e8, +/* 1026 - */ 0, +/* 1027 - */ 0, +/* 1028 - */ 0, +/* 1029 - */ 0, +/* 102a - */ 0, +/* 102b - */ 0, +/* 102c - */ 0, +/* 102d - */ 0, +/* 102e - */ 0, +/* 102f - */ 0, +/* 1030 - */ 0, +/* 1031 - _V_66_0F_38_0F */ 0x40e9, +/* 1032 - */ 0, +/* 1033 - */ 0, +/* 1034 - */ 0, +/* 1035 - */ 0, +/* 1036 - */ 0, +/* 1037 - */ 0, +/* 1038 - */ 0, +/* 1039 - _66_0F_38_10 */ 0x40ea, +/* 103a - */ 0, +/* 103b - */ 0, +/* 103c - */ 0, +/* 103d - */ 0, +/* 103e - */ 0, +/* 103f - */ 0, +/* 1040 - */ 0, +/* 1041 - */ 0, +/* 1042 - */ 0, +/* 1043 - */ 0, +/* 1044 - */ 0, +/* 1045 - _66_0F_38_14 */ 0x40eb, +/* 1046 - */ 0, +/* 1047 - */ 0, +/* 1048 - */ 0, +/* 1049 - */ 0, +/* 104a - */ 0, +/* 104b - */ 0, +/* 104c - */ 0, +/* 104d - */ 0, +/* 104e - */ 0, +/* 104f - */ 0, +/* 1050 - */ 0, +/* 1051 - _66_0F_38_15 */ 0x40ec, +/* 1052 - */ 0, +/* 1053 - */ 0, +/* 1054 - */ 0, +/* 1055 - */ 0, +/* 1056 - */ 0, +/* 1057 - */ 0, +/* 1058 - */ 0, +/* 1059 - */ 0, +/* 105a - */ 0, +/* 105b - */ 0, +/* 105c - */ 0, +/* 105d - _66_0F_38_17 */ 0x2497, +/* 105e - */ 0, +/* 105f - */ 0, +/* 1060 - */ 0, +/* 1061 - _V_66_0F_38_17 */ 0x40ed, +/* 1062 - */ 0, +/* 1063 - */ 0, +/* 1064 - */ 0, +/* 1065 - */ 0, +/* 1066 - */ 0, +/* 1067 - */ 0, +/* 1068 - */ 0, +/* 1069 - */ 0, +/* 106a - */ 0, +/* 106b - */ 0, +/* 106c - */ 0, +/* 106d - _V_66_0F_38_18 */ 0x40ee, +/* 106e - */ 0, +/* 106f - */ 0, +/* 1070 - */ 0, +/* 1071 - */ 0, +/* 1072 - */ 0, +/* 1073 - */ 0, +/* 1074 - */ 0, +/* 1075 - */ 0, +/* 1076 - */ 0, +/* 1077 - */ 0, +/* 1078 - */ 0, +/* 1079 - _V_66_0F_38_19 */ 0x40ef, +/* 107a - */ 0, +/* 107b - */ 0, +/* 107c - */ 0, +/* 107d - */ 0, +/* 107e - */ 0, +/* 107f - */ 0, +/* 1080 - */ 0, +/* 1081 - */ 0, +/* 1082 - */ 0, +/* 1083 - */ 0, +/* 1084 - */ 0, +/* 1085 - _V_66_0F_38_1A */ 0x40f0, +/* 1086 - */ 0, +/* 1087 - */ 0, +/* 1088 - */ 0, +/* 1089 - */ 0, +/* 108a - */ 0, +/* 108b - */ 0, +/* 108c - _0F_38_1C */ 0x2498, +/* 108d - _66_0F_38_1C */ 0x2499, +/* 108e - */ 0, +/* 108f - */ 0, +/* 1090 - */ 0, +/* 1091 - _V_66_0F_38_1C */ 0x40f1, +/* 1092 - */ 0, +/* 1093 - */ 0, +/* 1094 - */ 0, +/* 1095 - */ 0, +/* 1096 - */ 0, +/* 1097 - */ 0, +/* 1098 - _0F_38_1D */ 0x249a, +/* 1099 - _66_0F_38_1D */ 0x249b, +/* 109a - */ 0, +/* 109b - */ 0, +/* 109c - */ 0, +/* 109d - _V_66_0F_38_1D */ 0x40f2, +/* 109e - */ 0, +/* 109f - */ 0, +/* 10a0 - */ 0, +/* 10a1 - */ 0, +/* 10a2 - */ 0, +/* 10a3 - */ 0, +/* 10a4 - _0F_38_1E */ 0x249c, +/* 10a5 - _66_0F_38_1E */ 0x249d, +/* 10a6 - */ 0, +/* 10a7 - */ 0, +/* 10a8 - */ 0, +/* 10a9 - _V_66_0F_38_1E */ 0x40f3, +/* 10aa - */ 0, +/* 10ab - */ 0, +/* 10ac - */ 0, +/* 10ad - */ 0, +/* 10ae - */ 0, +/* 10af - */ 0, +/* 10b0 - */ 0, +/* 10b1 - _66_0F_38_20 */ 0x249e, +/* 10b2 - */ 0, +/* 10b3 - */ 0, +/* 10b4 - */ 0, +/* 10b5 - _V_66_0F_38_20 */ 0x40f4, +/* 10b6 - */ 0, +/* 10b7 - */ 0, +/* 10b8 - */ 0, +/* 10b9 - */ 0, +/* 10ba - */ 0, +/* 10bb - */ 0, +/* 10bc - */ 0, +/* 10bd - _66_0F_38_21 */ 0x249f, +/* 10be - */ 0, +/* 10bf - */ 0, +/* 10c0 - */ 0, +/* 10c1 - _V_66_0F_38_21 */ 0x40f5, +/* 10c2 - */ 0, +/* 10c3 - */ 0, +/* 10c4 - */ 0, +/* 10c5 - */ 0, +/* 10c6 - */ 0, +/* 10c7 - */ 0, +/* 10c8 - */ 0, +/* 10c9 - _66_0F_38_22 */ 0x24a0, +/* 10ca - */ 0, +/* 10cb - */ 0, +/* 10cc - */ 0, +/* 10cd - _V_66_0F_38_22 */ 0x40f6, +/* 10ce - */ 0, +/* 10cf - */ 0, +/* 10d0 - */ 0, +/* 10d1 - */ 0, +/* 10d2 - */ 0, +/* 10d3 - */ 0, +/* 10d4 - */ 0, +/* 10d5 - _66_0F_38_23 */ 0x24a1, +/* 10d6 - */ 0, +/* 10d7 - */ 0, +/* 10d8 - */ 0, +/* 10d9 - _V_66_0F_38_23 */ 0x40f7, +/* 10da - */ 0, +/* 10db - */ 0, +/* 10dc - */ 0, +/* 10dd - */ 0, +/* 10de - */ 0, +/* 10df - */ 0, +/* 10e0 - */ 0, +/* 10e1 - _66_0F_38_24 */ 0x24a2, +/* 10e2 - */ 0, +/* 10e3 - */ 0, +/* 10e4 - */ 0, +/* 10e5 - _V_66_0F_38_24 */ 0x40f8, +/* 10e6 - */ 0, +/* 10e7 - */ 0, +/* 10e8 - */ 0, +/* 10e9 - */ 0, +/* 10ea - */ 0, +/* 10eb - */ 0, +/* 10ec - */ 0, +/* 10ed - _66_0F_38_25 */ 0x24a3, +/* 10ee - */ 0, +/* 10ef - */ 0, +/* 10f0 - */ 0, +/* 10f1 - _V_66_0F_38_25 */ 0x40f9, +/* 10f2 - */ 0, +/* 10f3 - */ 0, +/* 10f4 - */ 0, +/* 10f5 - */ 0, +/* 10f6 - */ 0, +/* 10f7 - */ 0, +/* 10f8 - */ 0, +/* 10f9 - _66_0F_38_28 */ 0x24a4, +/* 10fa - */ 0, +/* 10fb - */ 0, +/* 10fc - */ 0, +/* 10fd - _V_66_0F_38_28 */ 0x40fa, +/* 10fe - */ 0, +/* 10ff - */ 0, +/* 1100 - */ 0, +/* 1101 - */ 0, +/* 1102 - */ 0, +/* 1103 - */ 0, +/* 1104 - */ 0, +/* 1105 - _66_0F_38_29 */ 0x24a5, +/* 1106 - */ 0, +/* 1107 - */ 0, +/* 1108 - */ 0, +/* 1109 - _V_66_0F_38_29 */ 0x40fb, +/* 110a - */ 0, +/* 110b - */ 0, +/* 110c - */ 0, +/* 110d - */ 0, +/* 110e - */ 0, +/* 110f - */ 0, +/* 1110 - */ 0, +/* 1111 - _66_0F_38_2A */ 0x24a6, +/* 1112 - */ 0, +/* 1113 - */ 0, +/* 1114 - */ 0, +/* 1115 - _V_66_0F_38_2A */ 0x40fc, +/* 1116 - */ 0, +/* 1117 - */ 0, +/* 1118 - */ 0, +/* 1119 - */ 0, +/* 111a - */ 0, +/* 111b - */ 0, +/* 111c - */ 0, +/* 111d - _66_0F_38_2B */ 0x24a7, +/* 111e - */ 0, +/* 111f - */ 0, +/* 1120 - */ 0, +/* 1121 - _V_66_0F_38_2B */ 0x40fd, +/* 1122 - */ 0, +/* 1123 - */ 0, +/* 1124 - */ 0, +/* 1125 - */ 0, +/* 1126 - */ 0, +/* 1127 - */ 0, +/* 1128 - */ 0, +/* 1129 - */ 0, +/* 112a - */ 0, +/* 112b - */ 0, +/* 112c - */ 0, +/* 112d - _V_66_0F_38_2C */ 0x40fe, +/* 112e - */ 0, +/* 112f - */ 0, +/* 1130 - */ 0, +/* 1131 - */ 0, +/* 1132 - */ 0, +/* 1133 - */ 0, +/* 1134 - */ 0, +/* 1135 - */ 0, +/* 1136 - */ 0, +/* 1137 - */ 0, +/* 1138 - */ 0, +/* 1139 - _V_66_0F_38_2D */ 0x40ff, +/* 113a - */ 0, +/* 113b - */ 0, +/* 113c - */ 0, +/* 113d - */ 0, +/* 113e - */ 0, +/* 113f - */ 0, +/* 1140 - */ 0, +/* 1141 - */ 0, +/* 1142 - */ 0, +/* 1143 - */ 0, +/* 1144 - */ 0, +/* 1145 - _V_66_0F_38_2E */ 0x4100, +/* 1146 - */ 0, +/* 1147 - */ 0, +/* 1148 - */ 0, +/* 1149 - */ 0, +/* 114a - */ 0, +/* 114b - */ 0, +/* 114c - */ 0, +/* 114d - */ 0, +/* 114e - */ 0, +/* 114f - */ 0, +/* 1150 - */ 0, +/* 1151 - _V_66_0F_38_2F */ 0x4101, +/* 1152 - */ 0, +/* 1153 - */ 0, +/* 1154 - */ 0, +/* 1155 - */ 0, +/* 1156 - */ 0, +/* 1157 - */ 0, +/* 1158 - */ 0, +/* 1159 - _66_0F_38_30 */ 0x24a8, +/* 115a - */ 0, +/* 115b - */ 0, +/* 115c - */ 0, +/* 115d - _V_66_0F_38_30 */ 0x4102, +/* 115e - */ 0, +/* 115f - */ 0, +/* 1160 - */ 0, +/* 1161 - */ 0, +/* 1162 - */ 0, +/* 1163 - */ 0, +/* 1164 - */ 0, +/* 1165 - _66_0F_38_31 */ 0x24a9, +/* 1166 - */ 0, +/* 1167 - */ 0, +/* 1168 - */ 0, +/* 1169 - _V_66_0F_38_31 */ 0x4103, +/* 116a - */ 0, +/* 116b - */ 0, +/* 116c - */ 0, +/* 116d - */ 0, +/* 116e - */ 0, +/* 116f - */ 0, +/* 1170 - */ 0, +/* 1171 - _66_0F_38_32 */ 0x24aa, +/* 1172 - */ 0, +/* 1173 - */ 0, +/* 1174 - */ 0, +/* 1175 - _V_66_0F_38_32 */ 0x4104, +/* 1176 - */ 0, +/* 1177 - */ 0, +/* 1178 - */ 0, +/* 1179 - */ 0, +/* 117a - */ 0, +/* 117b - */ 0, +/* 117c - */ 0, +/* 117d - _66_0F_38_33 */ 0x24ab, +/* 117e - */ 0, +/* 117f - */ 0, +/* 1180 - */ 0, +/* 1181 - _V_66_0F_38_33 */ 0x4105, +/* 1182 - */ 0, +/* 1183 - */ 0, +/* 1184 - */ 0, +/* 1185 - */ 0, +/* 1186 - */ 0, +/* 1187 - */ 0, +/* 1188 - */ 0, +/* 1189 - _66_0F_38_34 */ 0x24ac, +/* 118a - */ 0, +/* 118b - */ 0, +/* 118c - */ 0, +/* 118d - _V_66_0F_38_34 */ 0x4106, +/* 118e - */ 0, +/* 118f - */ 0, +/* 1190 - */ 0, +/* 1191 - */ 0, +/* 1192 - */ 0, +/* 1193 - */ 0, +/* 1194 - */ 0, +/* 1195 - _66_0F_38_35 */ 0x24ad, +/* 1196 - */ 0, +/* 1197 - */ 0, +/* 1198 - */ 0, +/* 1199 - _V_66_0F_38_35 */ 0x4107, +/* 119a - */ 0, +/* 119b - */ 0, +/* 119c - */ 0, +/* 119d - */ 0, +/* 119e - */ 0, +/* 119f - */ 0, +/* 11a0 - */ 0, +/* 11a1 - _66_0F_38_37 */ 0x24ae, +/* 11a2 - */ 0, +/* 11a3 - */ 0, +/* 11a4 - */ 0, +/* 11a5 - _V_66_0F_38_37 */ 0x4108, +/* 11a6 - */ 0, +/* 11a7 - */ 0, +/* 11a8 - */ 0, +/* 11a9 - */ 0, +/* 11aa - */ 0, +/* 11ab - */ 0, +/* 11ac - */ 0, +/* 11ad - _66_0F_38_38 */ 0x24af, +/* 11ae - */ 0, +/* 11af - */ 0, +/* 11b0 - */ 0, +/* 11b1 - _V_66_0F_38_38 */ 0x4109, +/* 11b2 - */ 0, +/* 11b3 - */ 0, +/* 11b4 - */ 0, +/* 11b5 - */ 0, +/* 11b6 - */ 0, +/* 11b7 - */ 0, +/* 11b8 - */ 0, +/* 11b9 - _66_0F_38_39 */ 0x24b0, +/* 11ba - */ 0, +/* 11bb - */ 0, +/* 11bc - */ 0, +/* 11bd - _V_66_0F_38_39 */ 0x410a, +/* 11be - */ 0, +/* 11bf - */ 0, +/* 11c0 - */ 0, +/* 11c1 - */ 0, +/* 11c2 - */ 0, +/* 11c3 - */ 0, +/* 11c4 - */ 0, +/* 11c5 - _66_0F_38_3A */ 0x24b1, +/* 11c6 - */ 0, +/* 11c7 - */ 0, +/* 11c8 - */ 0, +/* 11c9 - _V_66_0F_38_3A */ 0x410b, +/* 11ca - */ 0, +/* 11cb - */ 0, +/* 11cc - */ 0, +/* 11cd - */ 0, +/* 11ce - */ 0, +/* 11cf - */ 0, +/* 11d0 - */ 0, +/* 11d1 - _66_0F_38_3B */ 0x24b2, +/* 11d2 - */ 0, +/* 11d3 - */ 0, +/* 11d4 - */ 0, +/* 11d5 - _V_66_0F_38_3B */ 0x410c, +/* 11d6 - */ 0, +/* 11d7 - */ 0, +/* 11d8 - */ 0, +/* 11d9 - */ 0, +/* 11da - */ 0, +/* 11db - */ 0, +/* 11dc - */ 0, +/* 11dd - _66_0F_38_3C */ 0x24b3, +/* 11de - */ 0, +/* 11df - */ 0, +/* 11e0 - */ 0, +/* 11e1 - _V_66_0F_38_3C */ 0x410d, +/* 11e2 - */ 0, +/* 11e3 - */ 0, +/* 11e4 - */ 0, +/* 11e5 - */ 0, +/* 11e6 - */ 0, +/* 11e7 - */ 0, +/* 11e8 - */ 0, +/* 11e9 - _66_0F_38_3D */ 0x24b4, +/* 11ea - */ 0, +/* 11eb - */ 0, +/* 11ec - */ 0, +/* 11ed - _V_66_0F_38_3D */ 0x410e, +/* 11ee - */ 0, +/* 11ef - */ 0, +/* 11f0 - */ 0, +/* 11f1 - */ 0, +/* 11f2 - */ 0, +/* 11f3 - */ 0, +/* 11f4 - */ 0, +/* 11f5 - _66_0F_38_3E */ 0x24b5, +/* 11f6 - */ 0, +/* 11f7 - */ 0, +/* 11f8 - */ 0, +/* 11f9 - _V_66_0F_38_3E */ 0x410f, +/* 11fa - */ 0, +/* 11fb - */ 0, +/* 11fc - */ 0, +/* 11fd - */ 0, +/* 11fe - */ 0, +/* 11ff - */ 0, +/* 1200 - */ 0, +/* 1201 - _66_0F_38_3F */ 0x24b6, +/* 1202 - */ 0, +/* 1203 - */ 0, +/* 1204 - */ 0, +/* 1205 - _V_66_0F_38_3F */ 0x4110, +/* 1206 - */ 0, +/* 1207 - */ 0, +/* 1208 - */ 0, +/* 1209 - */ 0, +/* 120a - */ 0, +/* 120b - */ 0, +/* 120c - */ 0, +/* 120d - _66_0F_38_40 */ 0x24b7, +/* 120e - */ 0, +/* 120f - */ 0, +/* 1210 - */ 0, +/* 1211 - _V_66_0F_38_40 */ 0x4111, +/* 1212 - */ 0, +/* 1213 - */ 0, +/* 1214 - */ 0, +/* 1215 - */ 0, +/* 1216 - */ 0, +/* 1217 - */ 0, +/* 1218 - */ 0, +/* 1219 - _66_0F_38_41 */ 0x24b8, +/* 121a - */ 0, +/* 121b - */ 0, +/* 121c - */ 0, +/* 121d - _V_66_0F_38_41 */ 0x4112, +/* 121e - */ 0, +/* 121f - */ 0, +/* 1220 - */ 0, +/* 1221 - */ 0, +/* 1222 - */ 0, +/* 1223 - */ 0, +/* 1224 - */ 0, +/* 1225 - _66_0F_38_80 */ 0x24b9, +/* 1226 - */ 0, +/* 1227 - */ 0, +/* 1228 - */ 0, +/* 1229 - */ 0, +/* 122a - */ 0, +/* 122b - */ 0, +/* 122c - */ 0, +/* 122d - */ 0, +/* 122e - */ 0, +/* 122f - */ 0, +/* 1230 - */ 0, +/* 1231 - _66_0F_38_81 */ 0x24ba, +/* 1232 - */ 0, +/* 1233 - */ 0, +/* 1234 - */ 0, +/* 1235 - */ 0, +/* 1236 - */ 0, +/* 1237 - */ 0, +/* 1238 - */ 0, +/* 1239 - */ 0, +/* 123a - */ 0, +/* 123b - */ 0, +/* 123c - */ 0, +/* 123d - _66_0F_38_82 */ 0x24bb, +/* 123e - */ 0, +/* 123f - */ 0, +/* 1240 - */ 0, +/* 1241 - */ 0, +/* 1242 - */ 0, +/* 1243 - */ 0, +/* 1244 - */ 0, +/* 1245 - */ 0, +/* 1246 - */ 0, +/* 1247 - */ 0, +/* 1248 - */ 0, +/* 1249 - */ 0, +/* 124a - */ 0, +/* 124b - */ 0, +/* 124c - */ 0, +/* 124d - _V_66_0F_38_96 */ 0x4113, +/* 124e - */ 0, +/* 124f - */ 0, +/* 1250 - */ 0, +/* 1251 - */ 0, +/* 1252 - */ 0, +/* 1253 - */ 0, +/* 1254 - */ 0, +/* 1255 - */ 0, +/* 1256 - */ 0, +/* 1257 - */ 0, +/* 1258 - */ 0, +/* 1259 - _V_66_0F_38_97 */ 0x4114, +/* 125a - */ 0, +/* 125b - */ 0, +/* 125c - */ 0, +/* 125d - */ 0, +/* 125e - */ 0, +/* 125f - */ 0, +/* 1260 - */ 0, +/* 1261 - */ 0, +/* 1262 - */ 0, +/* 1263 - */ 0, +/* 1264 - */ 0, +/* 1265 - _V_66_0F_38_98 */ 0x4115, +/* 1266 - */ 0, +/* 1267 - */ 0, +/* 1268 - */ 0, +/* 1269 - */ 0, +/* 126a - */ 0, +/* 126b - */ 0, +/* 126c - */ 0, +/* 126d - */ 0, +/* 126e - */ 0, +/* 126f - */ 0, +/* 1270 - */ 0, +/* 1271 - _V_66_0F_38_99 */ 0x4116, +/* 1272 - */ 0, +/* 1273 - */ 0, +/* 1274 - */ 0, +/* 1275 - */ 0, +/* 1276 - */ 0, +/* 1277 - */ 0, +/* 1278 - */ 0, +/* 1279 - */ 0, +/* 127a - */ 0, +/* 127b - */ 0, +/* 127c - */ 0, +/* 127d - _V_66_0F_38_9A */ 0x4117, +/* 127e - */ 0, +/* 127f - */ 0, +/* 1280 - */ 0, +/* 1281 - */ 0, +/* 1282 - */ 0, +/* 1283 - */ 0, +/* 1284 - */ 0, +/* 1285 - */ 0, +/* 1286 - */ 0, +/* 1287 - */ 0, +/* 1288 - */ 0, +/* 1289 - _V_66_0F_38_9B */ 0x4118, +/* 128a - */ 0, +/* 128b - */ 0, +/* 128c - */ 0, +/* 128d - */ 0, +/* 128e - */ 0, +/* 128f - */ 0, +/* 1290 - */ 0, +/* 1291 - */ 0, +/* 1292 - */ 0, +/* 1293 - */ 0, +/* 1294 - */ 0, +/* 1295 - _V_66_0F_38_9C */ 0x4119, +/* 1296 - */ 0, +/* 1297 - */ 0, +/* 1298 - */ 0, +/* 1299 - */ 0, +/* 129a - */ 0, +/* 129b - */ 0, +/* 129c - */ 0, +/* 129d - */ 0, +/* 129e - */ 0, +/* 129f - */ 0, +/* 12a0 - */ 0, +/* 12a1 - _V_66_0F_38_9D */ 0x411a, +/* 12a2 - */ 0, +/* 12a3 - */ 0, +/* 12a4 - */ 0, +/* 12a5 - */ 0, +/* 12a6 - */ 0, +/* 12a7 - */ 0, +/* 12a8 - */ 0, +/* 12a9 - */ 0, +/* 12aa - */ 0, +/* 12ab - */ 0, +/* 12ac - */ 0, +/* 12ad - _V_66_0F_38_9E */ 0x411b, +/* 12ae - */ 0, +/* 12af - */ 0, +/* 12b0 - */ 0, +/* 12b1 - */ 0, +/* 12b2 - */ 0, +/* 12b3 - */ 0, +/* 12b4 - */ 0, +/* 12b5 - */ 0, +/* 12b6 - */ 0, +/* 12b7 - */ 0, +/* 12b8 - */ 0, +/* 12b9 - _V_66_0F_38_9F */ 0x411c, +/* 12ba - */ 0, +/* 12bb - */ 0, +/* 12bc - */ 0, +/* 12bd - */ 0, +/* 12be - */ 0, +/* 12bf - */ 0, +/* 12c0 - */ 0, +/* 12c1 - */ 0, +/* 12c2 - */ 0, +/* 12c3 - */ 0, +/* 12c4 - */ 0, +/* 12c5 - _V_66_0F_38_A6 */ 0x411d, +/* 12c6 - */ 0, +/* 12c7 - */ 0, +/* 12c8 - */ 0, +/* 12c9 - */ 0, +/* 12ca - */ 0, +/* 12cb - */ 0, +/* 12cc - */ 0, +/* 12cd - */ 0, +/* 12ce - */ 0, +/* 12cf - */ 0, +/* 12d0 - */ 0, +/* 12d1 - _V_66_0F_38_A7 */ 0x411e, +/* 12d2 - */ 0, +/* 12d3 - */ 0, +/* 12d4 - */ 0, +/* 12d5 - */ 0, +/* 12d6 - */ 0, +/* 12d7 - */ 0, +/* 12d8 - */ 0, +/* 12d9 - */ 0, +/* 12da - */ 0, +/* 12db - */ 0, +/* 12dc - */ 0, +/* 12dd - _V_66_0F_38_A8 */ 0x411f, +/* 12de - */ 0, +/* 12df - */ 0, +/* 12e0 - */ 0, +/* 12e1 - */ 0, +/* 12e2 - */ 0, +/* 12e3 - */ 0, +/* 12e4 - */ 0, +/* 12e5 - */ 0, +/* 12e6 - */ 0, +/* 12e7 - */ 0, +/* 12e8 - */ 0, +/* 12e9 - _V_66_0F_38_A9 */ 0x4120, +/* 12ea - */ 0, +/* 12eb - */ 0, +/* 12ec - */ 0, +/* 12ed - */ 0, +/* 12ee - */ 0, +/* 12ef - */ 0, +/* 12f0 - */ 0, +/* 12f1 - */ 0, +/* 12f2 - */ 0, +/* 12f3 - */ 0, +/* 12f4 - */ 0, +/* 12f5 - _V_66_0F_38_AA */ 0x4121, +/* 12f6 - */ 0, +/* 12f7 - */ 0, +/* 12f8 - */ 0, +/* 12f9 - */ 0, +/* 12fa - */ 0, +/* 12fb - */ 0, +/* 12fc - */ 0, +/* 12fd - */ 0, +/* 12fe - */ 0, +/* 12ff - */ 0, +/* 1300 - */ 0, +/* 1301 - _V_66_0F_38_AB */ 0x4122, +/* 1302 - */ 0, +/* 1303 - */ 0, +/* 1304 - */ 0, +/* 1305 - */ 0, +/* 1306 - */ 0, +/* 1307 - */ 0, +/* 1308 - */ 0, +/* 1309 - */ 0, +/* 130a - */ 0, +/* 130b - */ 0, +/* 130c - */ 0, +/* 130d - _V_66_0F_38_AC */ 0x4123, +/* 130e - */ 0, +/* 130f - */ 0, +/* 1310 - */ 0, +/* 1311 - */ 0, +/* 1312 - */ 0, +/* 1313 - */ 0, +/* 1314 - */ 0, +/* 1315 - */ 0, +/* 1316 - */ 0, +/* 1317 - */ 0, +/* 1318 - */ 0, +/* 1319 - _V_66_0F_38_AD */ 0x4124, +/* 131a - */ 0, +/* 131b - */ 0, +/* 131c - */ 0, +/* 131d - */ 0, +/* 131e - */ 0, +/* 131f - */ 0, +/* 1320 - */ 0, +/* 1321 - */ 0, +/* 1322 - */ 0, +/* 1323 - */ 0, +/* 1324 - */ 0, +/* 1325 - _V_66_0F_38_AE */ 0x4125, +/* 1326 - */ 0, +/* 1327 - */ 0, +/* 1328 - */ 0, +/* 1329 - */ 0, +/* 132a - */ 0, +/* 132b - */ 0, +/* 132c - */ 0, +/* 132d - */ 0, +/* 132e - */ 0, +/* 132f - */ 0, +/* 1330 - */ 0, +/* 1331 - _V_66_0F_38_AF */ 0x4126, +/* 1332 - */ 0, +/* 1333 - */ 0, +/* 1334 - */ 0, +/* 1335 - */ 0, +/* 1336 - */ 0, +/* 1337 - */ 0, +/* 1338 - */ 0, +/* 1339 - */ 0, +/* 133a - */ 0, +/* 133b - */ 0, +/* 133c - */ 0, +/* 133d - _V_66_0F_38_B6 */ 0x4127, +/* 133e - */ 0, +/* 133f - */ 0, +/* 1340 - */ 0, +/* 1341 - */ 0, +/* 1342 - */ 0, +/* 1343 - */ 0, +/* 1344 - */ 0, +/* 1345 - */ 0, +/* 1346 - */ 0, +/* 1347 - */ 0, +/* 1348 - */ 0, +/* 1349 - _V_66_0F_38_B7 */ 0x4128, +/* 134a - */ 0, +/* 134b - */ 0, +/* 134c - */ 0, +/* 134d - */ 0, +/* 134e - */ 0, +/* 134f - */ 0, +/* 1350 - */ 0, +/* 1351 - */ 0, +/* 1352 - */ 0, +/* 1353 - */ 0, +/* 1354 - */ 0, +/* 1355 - _V_66_0F_38_B8 */ 0x4129, +/* 1356 - */ 0, +/* 1357 - */ 0, +/* 1358 - */ 0, +/* 1359 - */ 0, +/* 135a - */ 0, +/* 135b - */ 0, +/* 135c - */ 0, +/* 135d - */ 0, +/* 135e - */ 0, +/* 135f - */ 0, +/* 1360 - */ 0, +/* 1361 - _V_66_0F_38_B9 */ 0x412a, +/* 1362 - */ 0, +/* 1363 - */ 0, +/* 1364 - */ 0, +/* 1365 - */ 0, +/* 1366 - */ 0, +/* 1367 - */ 0, +/* 1368 - */ 0, +/* 1369 - */ 0, +/* 136a - */ 0, +/* 136b - */ 0, +/* 136c - */ 0, +/* 136d - _V_66_0F_38_BA */ 0x412b, +/* 136e - */ 0, +/* 136f - */ 0, +/* 1370 - */ 0, +/* 1371 - */ 0, +/* 1372 - */ 0, +/* 1373 - */ 0, +/* 1374 - */ 0, +/* 1375 - */ 0, +/* 1376 - */ 0, +/* 1377 - */ 0, +/* 1378 - */ 0, +/* 1379 - _V_66_0F_38_BB */ 0x412c, +/* 137a - */ 0, +/* 137b - */ 0, +/* 137c - */ 0, +/* 137d - */ 0, +/* 137e - */ 0, +/* 137f - */ 0, +/* 1380 - */ 0, +/* 1381 - */ 0, +/* 1382 - */ 0, +/* 1383 - */ 0, +/* 1384 - */ 0, +/* 1385 - _V_66_0F_38_BC */ 0x412d, +/* 1386 - */ 0, +/* 1387 - */ 0, +/* 1388 - */ 0, +/* 1389 - */ 0, +/* 138a - */ 0, +/* 138b - */ 0, +/* 138c - */ 0, +/* 138d - */ 0, +/* 138e - */ 0, +/* 138f - */ 0, +/* 1390 - */ 0, +/* 1391 - _V_66_0F_38_BD */ 0x412e, +/* 1392 - */ 0, +/* 1393 - */ 0, +/* 1394 - */ 0, +/* 1395 - */ 0, +/* 1396 - */ 0, +/* 1397 - */ 0, +/* 1398 - */ 0, +/* 1399 - */ 0, +/* 139a - */ 0, +/* 139b - */ 0, +/* 139c - */ 0, +/* 139d - _V_66_0F_38_BE */ 0x412f, +/* 139e - */ 0, +/* 139f - */ 0, +/* 13a0 - */ 0, +/* 13a1 - */ 0, +/* 13a2 - */ 0, +/* 13a3 - */ 0, +/* 13a4 - */ 0, +/* 13a5 - */ 0, +/* 13a6 - */ 0, +/* 13a7 - */ 0, +/* 13a8 - */ 0, +/* 13a9 - _V_66_0F_38_BF */ 0x4130, +/* 13aa - */ 0, +/* 13ab - */ 0, +/* 13ac - */ 0, +/* 13ad - */ 0, +/* 13ae - */ 0, +/* 13af - */ 0, +/* 13b0 - */ 0, +/* 13b1 - _66_0F_38_DB */ 0x24bc, +/* 13b2 - */ 0, +/* 13b3 - */ 0, +/* 13b4 - */ 0, +/* 13b5 - _V_66_0F_38_DB */ 0x4131, +/* 13b6 - */ 0, +/* 13b7 - */ 0, +/* 13b8 - */ 0, +/* 13b9 - */ 0, +/* 13ba - */ 0, +/* 13bb - */ 0, +/* 13bc - */ 0, +/* 13bd - _66_0F_38_DC */ 0x24bd, +/* 13be - */ 0, +/* 13bf - */ 0, +/* 13c0 - */ 0, +/* 13c1 - _V_66_0F_38_DC */ 0x4132, +/* 13c2 - */ 0, +/* 13c3 - */ 0, +/* 13c4 - */ 0, +/* 13c5 - */ 0, +/* 13c6 - */ 0, +/* 13c7 - */ 0, +/* 13c8 - */ 0, +/* 13c9 - _66_0F_38_DD */ 0x24be, +/* 13ca - */ 0, +/* 13cb - */ 0, +/* 13cc - */ 0, +/* 13cd - _V_66_0F_38_DD */ 0x4133, +/* 13ce - */ 0, +/* 13cf - */ 0, +/* 13d0 - */ 0, +/* 13d1 - */ 0, +/* 13d2 - */ 0, +/* 13d3 - */ 0, +/* 13d4 - */ 0, +/* 13d5 - _66_0F_38_DE */ 0x24bf, +/* 13d6 - */ 0, +/* 13d7 - */ 0, +/* 13d8 - */ 0, +/* 13d9 - _V_66_0F_38_DE */ 0x4134, +/* 13da - */ 0, +/* 13db - */ 0, +/* 13dc - */ 0, +/* 13dd - */ 0, +/* 13de - */ 0, +/* 13df - */ 0, +/* 13e0 - */ 0, +/* 13e1 - _66_0F_38_DF */ 0x24c0, +/* 13e2 - */ 0, +/* 13e3 - */ 0, +/* 13e4 - */ 0, +/* 13e5 - _V_66_0F_38_DF */ 0x4135, +/* 13e6 - */ 0, +/* 13e7 - */ 0, +/* 13e8 - */ 0, +/* 13e9 - */ 0, +/* 13ea - */ 0, +/* 13eb - */ 0, +/* 13ec - _0F_38_F0 */ 0x24c1, +/* 13ed - */ 0, +/* 13ee - */ 0, +/* 13ef - _F2_0F_38_F0 */ 0x24c2, +/* 13f0 - */ 0, +/* 13f1 - */ 0, +/* 13f2 - */ 0, +/* 13f3 - */ 0, +/* 13f4 - */ 0, +/* 13f5 - */ 0, +/* 13f6 - */ 0, +/* 13f7 - */ 0, +/* 13f8 - _0F_38_F1 */ 0x24c3, +/* 13f9 - */ 0, +/* 13fa - */ 0, +/* 13fb - _F2_0F_38_F1 */ 0x24c4, +/* 13fc - */ 0, +/* 13fd - */ 0, +/* 13fe - */ 0, +/* 13ff - */ 0, +/* 1400 - */ 0, +/* 1401 - */ 0, +/* 1402 - */ 0, +/* 1403 - */ 0, +/* 1404 - */ 0, +/* 1405 - */ 0, +/* 1406 - */ 0, +/* 1407 - */ 0, +/* 1408 - */ 0, +/* 1409 - _V_66_0F_3A_04 */ 0x4136, +/* 140a - */ 0, +/* 140b - */ 0, +/* 140c - */ 0, +/* 140d - */ 0, +/* 140e - */ 0, +/* 140f - */ 0, +/* 1410 - */ 0, +/* 1411 - */ 0, +/* 1412 - */ 0, +/* 1413 - */ 0, +/* 1414 - */ 0, +/* 1415 - _V_66_0F_3A_05 */ 0x4137, +/* 1416 - */ 0, +/* 1417 - */ 0, +/* 1418 - */ 0, +/* 1419 - */ 0, +/* 141a - */ 0, +/* 141b - */ 0, +/* 141c - */ 0, +/* 141d - */ 0, +/* 141e - */ 0, +/* 141f - */ 0, +/* 1420 - */ 0, +/* 1421 - _V_66_0F_3A_06 */ 0x4138, +/* 1422 - */ 0, +/* 1423 - */ 0, +/* 1424 - */ 0, +/* 1425 - */ 0, +/* 1426 - */ 0, +/* 1427 - */ 0, +/* 1428 - */ 0, +/* 1429 - _66_0F_3A_08 */ 0x4139, +/* 142a - */ 0, +/* 142b - */ 0, +/* 142c - */ 0, +/* 142d - _V_66_0F_3A_08 */ 0x413a, +/* 142e - */ 0, +/* 142f - */ 0, +/* 1430 - */ 0, +/* 1431 - */ 0, +/* 1432 - */ 0, +/* 1433 - */ 0, +/* 1434 - */ 0, +/* 1435 - _66_0F_3A_09 */ 0x413b, +/* 1436 - */ 0, +/* 1437 - */ 0, +/* 1438 - */ 0, +/* 1439 - _V_66_0F_3A_09 */ 0x413c, +/* 143a - */ 0, +/* 143b - */ 0, +/* 143c - */ 0, +/* 143d - */ 0, +/* 143e - */ 0, +/* 143f - */ 0, +/* 1440 - */ 0, +/* 1441 - _66_0F_3A_0A */ 0x413d, +/* 1442 - */ 0, +/* 1443 - */ 0, +/* 1444 - */ 0, +/* 1445 - _V_66_0F_3A_0A */ 0x413e, +/* 1446 - */ 0, +/* 1447 - */ 0, +/* 1448 - */ 0, +/* 1449 - */ 0, +/* 144a - */ 0, +/* 144b - */ 0, +/* 144c - */ 0, +/* 144d - _66_0F_3A_0B */ 0x413f, +/* 144e - */ 0, +/* 144f - */ 0, +/* 1450 - */ 0, +/* 1451 - _V_66_0F_3A_0B */ 0x4140, +/* 1452 - */ 0, +/* 1453 - */ 0, +/* 1454 - */ 0, +/* 1455 - */ 0, +/* 1456 - */ 0, +/* 1457 - */ 0, +/* 1458 - */ 0, +/* 1459 - _66_0F_3A_0C */ 0x4141, +/* 145a - */ 0, +/* 145b - */ 0, +/* 145c - */ 0, +/* 145d - _V_66_0F_3A_0C */ 0x4142, +/* 145e - */ 0, +/* 145f - */ 0, +/* 1460 - */ 0, +/* 1461 - */ 0, +/* 1462 - */ 0, +/* 1463 - */ 0, +/* 1464 - */ 0, +/* 1465 - _66_0F_3A_0D */ 0x4143, +/* 1466 - */ 0, +/* 1467 - */ 0, +/* 1468 - */ 0, +/* 1469 - _V_66_0F_3A_0D */ 0x4144, +/* 146a - */ 0, +/* 146b - */ 0, +/* 146c - */ 0, +/* 146d - */ 0, +/* 146e - */ 0, +/* 146f - */ 0, +/* 1470 - */ 0, +/* 1471 - _66_0F_3A_0E */ 0x4145, +/* 1472 - */ 0, +/* 1473 - */ 0, +/* 1474 - */ 0, +/* 1475 - _V_66_0F_3A_0E */ 0x4146, +/* 1476 - */ 0, +/* 1477 - */ 0, +/* 1478 - */ 0, +/* 1479 - */ 0, +/* 147a - */ 0, +/* 147b - */ 0, +/* 147c - _0F_3A_0F */ 0x4147, +/* 147d - _66_0F_3A_0F */ 0x4148, +/* 147e - */ 0, +/* 147f - */ 0, +/* 1480 - */ 0, +/* 1481 - _V_66_0F_3A_0F */ 0x4149, +/* 1482 - */ 0, +/* 1483 - */ 0, +/* 1484 - */ 0, +/* 1485 - */ 0, +/* 1486 - */ 0, +/* 1487 - */ 0, +/* 1488 - */ 0, +/* 1489 - _66_0F_3A_14 */ 0x414a, +/* 148a - */ 0, +/* 148b - */ 0, +/* 148c - */ 0, +/* 148d - _V_66_0F_3A_14 */ 0x414b, +/* 148e - */ 0, +/* 148f - */ 0, +/* 1490 - */ 0, +/* 1491 - */ 0, +/* 1492 - */ 0, +/* 1493 - */ 0, +/* 1494 - */ 0, +/* 1495 - _66_0F_3A_15 */ 0x414c, +/* 1496 - */ 0, +/* 1497 - */ 0, +/* 1498 - */ 0, +/* 1499 - _V_66_0F_3A_15 */ 0x414d, +/* 149a - */ 0, +/* 149b - */ 0, +/* 149c - */ 0, +/* 149d - */ 0, +/* 149e - */ 0, +/* 149f - */ 0, +/* 14a0 - */ 0, +/* 14a1 - _66_0F_3A_16 */ 0x414e, +/* 14a2 - */ 0, +/* 14a3 - */ 0, +/* 14a4 - */ 0, +/* 14a5 - _V_66_0F_3A_16 */ 0x414f, +/* 14a6 - */ 0, +/* 14a7 - */ 0, +/* 14a8 - */ 0, +/* 14a9 - */ 0, +/* 14aa - */ 0, +/* 14ab - */ 0, +/* 14ac - */ 0, +/* 14ad - _66_0F_3A_17 */ 0x4150, +/* 14ae - */ 0, +/* 14af - */ 0, +/* 14b0 - */ 0, +/* 14b1 - _V_66_0F_3A_17 */ 0x4151, +/* 14b2 - */ 0, +/* 14b3 - */ 0, +/* 14b4 - */ 0, +/* 14b5 - */ 0, +/* 14b6 - */ 0, +/* 14b7 - */ 0, +/* 14b8 - */ 0, +/* 14b9 - */ 0, +/* 14ba - */ 0, +/* 14bb - */ 0, +/* 14bc - */ 0, +/* 14bd - _V_66_0F_3A_18 */ 0x4152, +/* 14be - */ 0, +/* 14bf - */ 0, +/* 14c0 - */ 0, +/* 14c1 - */ 0, +/* 14c2 - */ 0, +/* 14c3 - */ 0, +/* 14c4 - */ 0, +/* 14c5 - */ 0, +/* 14c6 - */ 0, +/* 14c7 - */ 0, +/* 14c8 - */ 0, +/* 14c9 - _V_66_0F_3A_19 */ 0x4153, +/* 14ca - */ 0, +/* 14cb - */ 0, +/* 14cc - */ 0, +/* 14cd - */ 0, +/* 14ce - */ 0, +/* 14cf - */ 0, +/* 14d0 - */ 0, +/* 14d1 - _66_0F_3A_20 */ 0x4154, +/* 14d2 - */ 0, +/* 14d3 - */ 0, +/* 14d4 - */ 0, +/* 14d5 - _V_66_0F_3A_20 */ 0x4155, +/* 14d6 - */ 0, +/* 14d7 - */ 0, +/* 14d8 - */ 0, +/* 14d9 - */ 0, +/* 14da - */ 0, +/* 14db - */ 0, +/* 14dc - */ 0, +/* 14dd - _66_0F_3A_21 */ 0x4156, +/* 14de - */ 0, +/* 14df - */ 0, +/* 14e0 - */ 0, +/* 14e1 - _V_66_0F_3A_21 */ 0x4157, +/* 14e2 - */ 0, +/* 14e3 - */ 0, +/* 14e4 - */ 0, +/* 14e5 - */ 0, +/* 14e6 - */ 0, +/* 14e7 - */ 0, +/* 14e8 - */ 0, +/* 14e9 - _66_0F_3A_22 */ 0x4158, +/* 14ea - */ 0, +/* 14eb - */ 0, +/* 14ec - */ 0, +/* 14ed - _V_66_0F_3A_22 */ 0x4159, +/* 14ee - */ 0, +/* 14ef - */ 0, +/* 14f0 - */ 0, +/* 14f1 - */ 0, +/* 14f2 - */ 0, +/* 14f3 - */ 0, +/* 14f4 - */ 0, +/* 14f5 - _66_0F_3A_40 */ 0x415a, +/* 14f6 - */ 0, +/* 14f7 - */ 0, +/* 14f8 - */ 0, +/* 14f9 - _V_66_0F_3A_40 */ 0x415b, +/* 14fa - */ 0, +/* 14fb - */ 0, +/* 14fc - */ 0, +/* 14fd - */ 0, +/* 14fe - */ 0, +/* 14ff - */ 0, +/* 1500 - */ 0, +/* 1501 - _66_0F_3A_41 */ 0x415c, +/* 1502 - */ 0, +/* 1503 - */ 0, +/* 1504 - */ 0, +/* 1505 - _V_66_0F_3A_41 */ 0x415d, +/* 1506 - */ 0, +/* 1507 - */ 0, +/* 1508 - */ 0, +/* 1509 - */ 0, +/* 150a - */ 0, +/* 150b - */ 0, +/* 150c - */ 0, +/* 150d - _66_0F_3A_42 */ 0x415e, +/* 150e - */ 0, +/* 150f - */ 0, +/* 1510 - */ 0, +/* 1511 - _V_66_0F_3A_42 */ 0x415f, +/* 1512 - */ 0, +/* 1513 - */ 0, +/* 1514 - */ 0, +/* 1515 - */ 0, +/* 1516 - */ 0, +/* 1517 - */ 0, +/* 1518 - */ 0, +/* 1519 - _66_0F_3A_44 */ 0x4160, +/* 151a - */ 0, +/* 151b - */ 0, +/* 151c - */ 0, +/* 151d - _V_66_0F_3A_44 */ 0x4161, +/* 151e - */ 0, +/* 151f - */ 0, +/* 1520 - */ 0, +/* 1521 - */ 0, +/* 1522 - */ 0, +/* 1523 - */ 0, +/* 1524 - */ 0, +/* 1525 - */ 0, +/* 1526 - */ 0, +/* 1527 - */ 0, +/* 1528 - */ 0, +/* 1529 - _V_66_0F_3A_4A */ 0x4162, +/* 152a - */ 0, +/* 152b - */ 0, +/* 152c - */ 0, +/* 152d - */ 0, +/* 152e - */ 0, +/* 152f - */ 0, +/* 1530 - */ 0, +/* 1531 - */ 0, +/* 1532 - */ 0, +/* 1533 - */ 0, +/* 1534 - */ 0, +/* 1535 - _V_66_0F_3A_4B */ 0x4163, +/* 1536 - */ 0, +/* 1537 - */ 0, +/* 1538 - */ 0, +/* 1539 - */ 0, +/* 153a - */ 0, +/* 153b - */ 0, +/* 153c - */ 0, +/* 153d - */ 0, +/* 153e - */ 0, +/* 153f - */ 0, +/* 1540 - */ 0, +/* 1541 - _V_66_0F_3A_4C */ 0x4164, +/* 1542 - */ 0, +/* 1543 - */ 0, +/* 1544 - */ 0, +/* 1545 - */ 0, +/* 1546 - */ 0, +/* 1547 - */ 0, +/* 1548 - */ 0, +/* 1549 - _66_0F_3A_60 */ 0x4165, +/* 154a - */ 0, +/* 154b - */ 0, +/* 154c - */ 0, +/* 154d - _V_66_0F_3A_60 */ 0x4166, +/* 154e - */ 0, +/* 154f - */ 0, +/* 1550 - */ 0, +/* 1551 - */ 0, +/* 1552 - */ 0, +/* 1553 - */ 0, +/* 1554 - */ 0, +/* 1555 - _66_0F_3A_61 */ 0x4167, +/* 1556 - */ 0, +/* 1557 - */ 0, +/* 1558 - */ 0, +/* 1559 - _V_66_0F_3A_61 */ 0x4168, +/* 155a - */ 0, +/* 155b - */ 0, +/* 155c - */ 0, +/* 155d - */ 0, +/* 155e - */ 0, +/* 155f - */ 0, +/* 1560 - */ 0, +/* 1561 - _66_0F_3A_62 */ 0x4169, +/* 1562 - */ 0, +/* 1563 - */ 0, +/* 1564 - */ 0, +/* 1565 - _V_66_0F_3A_62 */ 0x416a, +/* 1566 - */ 0, +/* 1567 - */ 0, +/* 1568 - */ 0, +/* 1569 - */ 0, +/* 156a - */ 0, +/* 156b - */ 0, +/* 156c - */ 0, +/* 156d - _66_0F_3A_63 */ 0x416b, +/* 156e - */ 0, +/* 156f - */ 0, +/* 1570 - */ 0, +/* 1571 - _V_66_0F_3A_63 */ 0x416c, +/* 1572 - */ 0, +/* 1573 - */ 0, +/* 1574 - */ 0, +/* 1575 - */ 0, +/* 1576 - */ 0, +/* 1577 - */ 0, +/* 1578 - */ 0, +/* 1579 - _66_0F_3A_DF */ 0x416d, +/* 157a - */ 0, +/* 157b - */ 0, +/* 157c - */ 0, +/* 157d - _V_66_0F_3A_DF */ 0x416e, +/* 157e - */ 0, +/* 157f - */ 0, +/* 1580 - */ 0, +/* 1581 - */ 0, +/* 1582 - */ 0, +/* 1583 - */ 0, +/* 1584 - _0F_71_02 */ 0x24c5, +/* 1585 - _66_0F_71_02 */ 0x24c6, +/* 1586 - */ 0, +/* 1587 - */ 0, +/* 1588 - */ 0, +/* 1589 - _V_66_0F_71_02 */ 0x416f, +/* 158a - */ 0, +/* 158b - */ 0, +/* 158c - */ 0, +/* 158d - */ 0, +/* 158e - */ 0, +/* 158f - */ 0, +/* 1590 - _0F_71_04 */ 0x24c7, +/* 1591 - _66_0F_71_04 */ 0x24c8, +/* 1592 - */ 0, +/* 1593 - */ 0, +/* 1594 - */ 0, +/* 1595 - _V_66_0F_71_04 */ 0x4170, +/* 1596 - */ 0, +/* 1597 - */ 0, +/* 1598 - */ 0, +/* 1599 - */ 0, +/* 159a - */ 0, +/* 159b - */ 0, +/* 159c - _0F_71_06 */ 0x24c9, +/* 159d - _66_0F_71_06 */ 0x24ca, +/* 159e - */ 0, +/* 159f - */ 0, +/* 15a0 - */ 0, +/* 15a1 - _V_66_0F_71_06 */ 0x4171, +/* 15a2 - */ 0, +/* 15a3 - */ 0, +/* 15a4 - */ 0, +/* 15a5 - */ 0, +/* 15a6 - */ 0, +/* 15a7 - */ 0, +/* 15a8 - _0F_72_02 */ 0x24cb, +/* 15a9 - _66_0F_72_02 */ 0x24cc, +/* 15aa - */ 0, +/* 15ab - */ 0, +/* 15ac - */ 0, +/* 15ad - _V_66_0F_72_02 */ 0x4172, +/* 15ae - */ 0, +/* 15af - */ 0, +/* 15b0 - */ 0, +/* 15b1 - */ 0, +/* 15b2 - */ 0, +/* 15b3 - */ 0, +/* 15b4 - _0F_72_04 */ 0x24cd, +/* 15b5 - _66_0F_72_04 */ 0x24ce, +/* 15b6 - */ 0, +/* 15b7 - */ 0, +/* 15b8 - */ 0, +/* 15b9 - _V_66_0F_72_04 */ 0x4173, +/* 15ba - */ 0, +/* 15bb - */ 0, +/* 15bc - */ 0, +/* 15bd - */ 0, +/* 15be - */ 0, +/* 15bf - */ 0, +/* 15c0 - _0F_72_06 */ 0x24cf, +/* 15c1 - _66_0F_72_06 */ 0x24d0, +/* 15c2 - */ 0, +/* 15c3 - */ 0, +/* 15c4 - */ 0, +/* 15c5 - _V_66_0F_72_06 */ 0x4174, +/* 15c6 - */ 0, +/* 15c7 - */ 0, +/* 15c8 - */ 0, +/* 15c9 - */ 0, +/* 15ca - */ 0, +/* 15cb - */ 0, +/* 15cc - _0F_73_02 */ 0x24d1, +/* 15cd - _66_0F_73_02 */ 0x24d2, +/* 15ce - */ 0, +/* 15cf - */ 0, +/* 15d0 - */ 0, +/* 15d1 - _V_66_0F_73_02 */ 0x4175, +/* 15d2 - */ 0, +/* 15d3 - */ 0, +/* 15d4 - */ 0, +/* 15d5 - */ 0, +/* 15d6 - */ 0, +/* 15d7 - */ 0, +/* 15d8 - */ 0, +/* 15d9 - _66_0F_73_03 */ 0x24d3, +/* 15da - */ 0, +/* 15db - */ 0, +/* 15dc - */ 0, +/* 15dd - _V_66_0F_73_03 */ 0x4176, +/* 15de - */ 0, +/* 15df - */ 0, +/* 15e0 - */ 0, +/* 15e1 - */ 0, +/* 15e2 - */ 0, +/* 15e3 - */ 0, +/* 15e4 - _0F_73_06 */ 0x24d4, +/* 15e5 - _66_0F_73_06 */ 0x24d5, +/* 15e6 - */ 0, +/* 15e7 - */ 0, +/* 15e8 - */ 0, +/* 15e9 - _V_66_0F_73_06 */ 0x4177, +/* 15ea - */ 0, +/* 15eb - */ 0, +/* 15ec - */ 0, +/* 15ed - */ 0, +/* 15ee - */ 0, +/* 15ef - */ 0, +/* 15f0 - */ 0, +/* 15f1 - _66_0F_73_07 */ 0x24d6, +/* 15f2 - */ 0, +/* 15f3 - */ 0, +/* 15f4 - */ 0, +/* 15f5 - _V_66_0F_73_07 */ 0x4178, +/* 15f6 - */ 0, +/* 15f7 - */ 0, +/* 15f8 - */ 0, +/* 15f9 - */ 0, +/* 15fa - */ 0, +/* 15fb - */ 0, +/* 15fc - _0F_AE_00 */ 0x4179, +/* 15fd - */ 0, +/* 15fe - _F3_0F_AE_00 */ 0x24d7, +/* 15ff - */ 0, +/* 1600 - */ 0, +/* 1601 - */ 0, +/* 1602 - */ 0, +/* 1603 - */ 0, +/* 1604 - */ 0, +/* 1605 - */ 0, +/* 1606 - */ 0, +/* 1607 - */ 0, +/* 1608 - _0F_AE_01 */ 0x417a, +/* 1609 - */ 0, +/* 160a - _F3_0F_AE_01 */ 0x24d8, +/* 160b - */ 0, +/* 160c - */ 0, +/* 160d - */ 0, +/* 160e - */ 0, +/* 160f - */ 0, +/* 1610 - */ 0, +/* 1611 - */ 0, +/* 1612 - */ 0, +/* 1613 - */ 0, +/* 1614 - _0F_AE_02 */ 0x24d9, +/* 1615 - */ 0, +/* 1616 - _F3_0F_AE_02 */ 0x24da, +/* 1617 - */ 0, +/* 1618 - _V_0F_AE_02 */ 0x417b, +/* 1619 - */ 0, +/* 161a - */ 0, +/* 161b - */ 0, +/* 161c - */ 0, +/* 161d - */ 0, +/* 161e - */ 0, +/* 161f - */ 0, +/* 1620 - _0F_AE_03 */ 0x24db, +/* 1621 - */ 0, +/* 1622 - _F3_0F_AE_03 */ 0x24dc, +/* 1623 - */ 0, +/* 1624 - _V_0F_AE_03 */ 0x417c, +/* 1625 - */ 0, +/* 1626 - */ 0, +/* 1627 - */ 0, +/* 1628 - */ 0, +/* 1629 - */ 0, +/* 162a - */ 0, +/* 162b - */ 0, +/* 162c - _0F_C7_06 */ 0x24dd, +/* 162d - _66_0F_C7_06 */ 0x24de, +/* 162e - _F3_0F_C7_06 */ 0x24df, +/* 162f - */ 0, +/* 1630 - */ 0, +/* 1631 - */ 0, +/* 1632 - */ 0, +/* 1633 - */ 0, +/* 1634 - */ 0, +/* 1635 - */ 0, +/* 1636 - */ 0, +/* 1637 - */ 0 }; -_InstSharedInfo InstSharedInfoTable[470] = { - { 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 }, - { 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, 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, 262}, +{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] = { - 0, 9, 18, 27, 39, 49, 59, 69 +0, 9, 18, 27, 39, 49, 59, 69 }; uint16_t VCmpMnemonicOffsets[32] = { - 0, 10, 20, 30, 43, 54, 65, 76, 87, 100, 111, 122, 135, 149, 159, 169, 181, 194, 207, 220, 235, 249, 263, 277, 290, 303, 317, 331, 347, 361, 374, 387 -}; +0, 10, 20, 30, 43, 54, 65, 76, 87, 100, 111, 122, 135, 149, 159, 169, 181, 194, 207, 220, 235, 249, 263, 277, 290, 303, 317, 331, 347, 361, 374, 387 +}; \ No newline at end of file diff --git a/NativeCore/Dependencies/distorm/src/insts.h b/NativeCore/Dependencies/distorm/src/insts.h index 946cacde..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-2016 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 fa1c839e..91be7a8e 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-2016 Gil Dabah +Copyright (C) 2003-2021 Gil Dabah This library is licensed under the BSD license. See the file COPYING. */ @@ -14,233 +14,261 @@ This library is licensed under the BSD license. See the file COPYING. #ifndef DISTORM_LIGHT const unsigned char _MNEMONICS[] = -"\x09" "undefined\0" "\x03" "add\0" "\x04" "push\0" "\x03" "pop\0" "\x02" "or\0" \ -"\x03" "adc\0" "\x03" "sbb\0" "\x03" "and\0" "\x03" "daa\0" "\x03" "sub\0" \ -"\x03" "das\0" "\x03" "xor\0" "\x03" "aaa\0" "\x03" "cmp\0" "\x03" "aas\0" \ -"\x03" "inc\0" "\x03" "dec\0" "\x05" "pusha\0" "\x04" "popa\0" "\x05" "bound\0" \ -"\x04" "arpl\0" "\x04" "imul\0" "\x03" "ins\0" "\x04" "outs\0" "\x02" "jo\0" \ -"\x03" "jno\0" "\x02" "jb\0" "\x03" "jae\0" "\x02" "jz\0" "\x03" "jnz\0" "\x03" "jbe\0" \ -"\x02" "ja\0" "\x02" "js\0" "\x03" "jns\0" "\x02" "jp\0" "\x03" "jnp\0" "\x02" "jl\0" \ -"\x03" "jge\0" "\x03" "jle\0" "\x02" "jg\0" "\x04" "test\0" "\x04" "xchg\0" \ -"\x03" "mov\0" "\x03" "lea\0" "\x03" "cbw\0" "\x04" "cwde\0" "\x04" "cdqe\0" \ -"\x03" "cwd\0" "\x03" "cdq\0" "\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" \ +"\x09" "undefined\0" "\x03" "add\0" "\x04" "push\0" "\x03" "pop\0" \ +"\x02" "or\0" "\x03" "adc\0" "\x03" "sbb\0" "\x03" "and\0" "\x03" "daa\0" \ +"\x03" "sub\0" "\x03" "das\0" "\x03" "xor\0" "\x03" "aaa\0" "\x03" "cmp\0" \ +"\x03" "aas\0" "\x03" "inc\0" "\x03" "dec\0" "\x05" "pusha\0" "\x04" "popa\0" \ +"\x05" "bound\0" "\x04" "arpl\0" "\x04" "imul\0" "\x03" "ins\0" "\x04" "outs\0" \ +"\x02" "jo\0" "\x03" "jno\0" "\x02" "jb\0" "\x03" "jae\0" "\x02" "jz\0" \ +"\x03" "jnz\0" "\x03" "jbe\0" "\x02" "ja\0" "\x02" "js\0" "\x03" "jns\0" \ +"\x02" "jp\0" "\x03" "jnp\0" "\x02" "jl\0" "\x03" "jge\0" "\x03" "jle\0" \ +"\x02" "jg\0" "\x04" "test\0" "\x04" "xchg\0" "\x03" "mov\0" "\x03" "lea\0" \ +"\x03" "cbw\0" "\x04" "cwde\0" "\x04" "cdqe\0" "\x03" "cwd\0" "\x03" "cdq\0" \ +"\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" "\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" \ -"\x05" "fyl2x\0" "\x05" "fptan\0" "\x06" "fpatan\0" "\x07" "fxtract\0" "\x06" "fprem1\0" \ -"\x07" "fdecstp\0" "\x07" "fincstp\0" "\x05" "fprem\0" "\x07" "fyl2xp1\0" "\x05" "fsqrt\0" \ -"\x07" "fsincos\0" "\x07" "frndint\0" "\x06" "fscale\0" "\x04" "fsin\0" "\x04" "fcos\0" \ -"\x05" "fiadd\0" "\x05" "fimul\0" "\x05" "ficom\0" "\x06" "ficomp\0" "\x05" "fisub\0" \ -"\x06" "fisubr\0" "\x05" "fidiv\0" "\x06" "fidivr\0" "\x06" "fcmovb\0" "\x06" "fcmove\0" \ -"\x07" "fcmovbe\0" "\x06" "fcmovu\0" "\x07" "fucompp\0" "\x04" "fild\0" "\x06" "fisttp\0" \ -"\x04" "fist\0" "\x05" "fistp\0" "\x07" "fcmovnb\0" "\x07" "fcmovne\0" "\x08" "fcmovnbe\0" \ -"\x07" "fcmovnu\0" "\x04" "feni\0" "\x06" "fedisi\0" "\x06" "fsetpm\0" "\x06" "fucomi\0" \ -"\x05" "fcomi\0" "\x06" "frstor\0" "\x05" "ffree\0" "\x05" "fucom\0" "\x06" "fucomp\0" \ -"\x05" "faddp\0" "\x05" "fmulp\0" "\x06" "fcompp\0" "\x06" "fsubrp\0" "\x05" "fsubp\0" \ -"\x06" "fdivrp\0" "\x05" "fdivp\0" "\x04" "fbld\0" "\x05" "fbstp\0" "\x07" "fucomip\0" \ -"\x06" "fcomip\0" "\x03" "not\0" "\x03" "neg\0" "\x03" "mul\0" "\x03" "div\0" \ -"\x04" "idiv\0" "\x04" "sldt\0" "\x03" "str\0" "\x04" "lldt\0" "\x03" "ltr\0" \ -"\x04" "verr\0" "\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" \ +"\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" \ +"\x05" "fyl2x\0" "\x05" "fptan\0" "\x06" "fpatan\0" "\x07" "fxtract\0" \ +"\x06" "fprem1\0" "\x07" "fdecstp\0" "\x07" "fincstp\0" "\x05" "fprem\0" \ +"\x07" "fyl2xp1\0" "\x05" "fsqrt\0" "\x07" "fsincos\0" "\x07" "frndint\0" \ +"\x06" "fscale\0" "\x04" "fsin\0" "\x04" "fcos\0" "\x05" "fiadd\0" \ +"\x05" "fimul\0" "\x05" "ficom\0" "\x06" "ficomp\0" "\x05" "fisub\0" \ +"\x06" "fisubr\0" "\x05" "fidiv\0" "\x06" "fidivr\0" "\x06" "fcmovb\0" \ +"\x06" "fcmove\0" "\x07" "fcmovbe\0" "\x06" "fcmovu\0" "\x07" "fucompp\0" \ +"\x04" "fild\0" "\x06" "fisttp\0" "\x04" "fist\0" "\x05" "fistp\0" \ +"\x07" "fcmovnb\0" "\x07" "fcmovne\0" "\x08" "fcmovnbe\0" "\x07" "fcmovnu\0" \ +"\x04" "feni\0" "\x06" "fedisi\0" "\x06" "fsetpm\0" "\x06" "fucomi\0" \ +"\x05" "fcomi\0" "\x06" "frstor\0" "\x05" "ffree\0" "\x05" "fucom\0" \ +"\x06" "fucomp\0" "\x05" "faddp\0" "\x05" "fmulp\0" "\x06" "fcompp\0" \ +"\x06" "fsubrp\0" "\x05" "fsubp\0" "\x06" "fdivrp\0" "\x05" "fdivp\0" \ +"\x04" "fbld\0" "\x05" "fbstp\0" "\x07" "fucomip\0" "\x06" "fcomip\0" \ +"\x03" "not\0" "\x03" "neg\0" "\x03" "mul\0" "\x03" "div\0" "\x04" "idiv\0" \ +"\x04" "sldt\0" "\x03" "str\0" "\x04" "lldt\0" "\x03" "ltr\0" "\x04" "verr\0" \ +"\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" \ +"\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" "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" \ +"\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" \ +"\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" \ +"\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" \ +"\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" \ +"\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" \ +"\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" \ @@ -249,36 +277,39 @@ const unsigned char _MNEMONICS[] = "\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"; +"\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 789a6cb8..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-2016 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 883d59b1..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-2016 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 21a67f70..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-2016 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 f1f53c42..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-2016 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 cf628951..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-2016 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 05cf8d77..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-2016 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.c b/NativeCore/Dependencies/distorm/src/wstring.c deleted file mode 100644 index 5edce8fd..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-2016 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 */ diff --git a/NativeCore/Dependencies/distorm/src/wstring.h b/NativeCore/Dependencies/distorm/src/wstring.h index 1dbaa2f3..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-2016 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 36fea6d1..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-2016 Gil Dabah +Copyright (C) 2003-2021 Gil Dabah This library is licensed under the BSD license. See the file COPYING. */ diff --git a/NativeCore/Shared/DistormHelper.cpp b/NativeCore/Shared/DistormHelper.cpp index 1b5bea72..092b1670 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 + +#ifdef RECLASSNET64 info.dt = Decode64Bits; +#else + info.dt = Decode32Bits; #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 = 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] = ' '; + data->Length = instruction.size; + std::memcpy(data->Data, address, instruction.size); + data->StaticInstructionBytes = -1; - 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) + 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; diff --git a/NativeCore/Unix/EnumerateRemoteSectionsAndModules.cpp b/NativeCore/Unix/EnumerateRemoteSectionsAndModules.cpp index a3ef6d8b..9d821cfe 100644 --- a/NativeCore/Unix/EnumerateRemoteSectionsAndModules.cpp +++ b/NativeCore/Unix/EnumerateRemoteSectionsAndModules.cpp @@ -50,7 +50,9 @@ 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()); + auto path = std::stringstream(); + path << "/proc/" << reinterpret_cast(handle) << "/maps"; + std::ifstream input(path.str()); std::unordered_map modules; diff --git a/NativeCore/Unix/Makefile b/NativeCore/Unix/Makefile index e1c21204..f18ff1fb 100644 --- a/NativeCore/Unix/Makefile +++ b/NativeCore/Unix/Makefile @@ -7,198 +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 -LDFLAGS = -shared +LIB = -lstdc++fs -lstdc++ +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 $(OBJDIR_DEBUG)/wstring.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 $(OBJDIR_RELEASE)/wstring.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 -$(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 +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 -out_release: before_release $(OBJ_RELEASE) $(DEP_RELEASE) - $(LD) $(LIBDIR_RELEASE) -o $(OUT_RELEASE) $(OBJ_RELEASE) $(LDFLAGS_RELEASE) $(LIB_RELEASE) +$(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 -$(OBJDIR_RELEASE)/WriteRemoteMemory.o: WriteRemoteMemory.cpp - $(CXX) $(CFLAGS_RELEASE) $(INC_RELEASE) -c WriteRemoteMemory.cpp -o $(OBJDIR_RELEASE)/WriteRemoteMemory.o +out_release64: before_release $(OBJ64_RELEASE) $(DEP_RELEASE) + $(CXX) $(LIBDIR_RELEASE) -o $(OUT64_RELEASE) $(OBJ64_RELEASE) $(LDFLAGS64_RELEASE) $(LIB_RELEASE) -$(OBJDIR_RELEASE)/ReadRemoteMemory.o: ReadRemoteMemory.cpp - $(CXX) $(CFLAGS_RELEASE) $(INC_RELEASE) -c ReadRemoteMemory.cpp -o $(OBJDIR_RELEASE)/ReadRemoteMemory.o +$(OBJDIR64_RELEASE)/WriteRemoteMemory.o: WriteRemoteMemory.cpp + $(CXX) $(CFLAGS64_RELEASE) $(INC_RELEASE) -c WriteRemoteMemory.cpp -o $(OBJDIR64_RELEASE)/WriteRemoteMemory.o -$(OBJDIR_RELEASE)/OpenRemoteProcess.o: OpenRemoteProcess.cpp - $(CXX) $(CFLAGS_RELEASE) $(INC_RELEASE) -c OpenRemoteProcess.cpp -o $(OBJDIR_RELEASE)/OpenRemoteProcess.o +$(OBJDIR64_RELEASE)/ReadRemoteMemory.o: ReadRemoteMemory.cpp + $(CXX) $(CFLAGS64_RELEASE) $(INC_RELEASE) -c ReadRemoteMemory.cpp -o $(OBJDIR64_RELEASE)/ReadRemoteMemory.o -$(OBJDIR_RELEASE)/IsProcessValid.o: IsProcessValid.cpp - $(CXX) $(CFLAGS_RELEASE) $(INC_RELEASE) -c IsProcessValid.cpp -o $(OBJDIR_RELEASE)/IsProcessValid.o +$(OBJDIR64_RELEASE)/OpenRemoteProcess.o: OpenRemoteProcess.cpp + $(CXX) $(CFLAGS64_RELEASE) $(INC_RELEASE) -c OpenRemoteProcess.cpp -o $(OBJDIR64_RELEASE)/OpenRemoteProcess.o -$(OBJDIR_RELEASE)/Input.o: Input.cpp - $(CXX) $(CFLAGS_RELEASE) $(INC_RELEASE) -c Input.cpp -o $(OBJDIR_RELEASE)/Input.o +$(OBJDIR64_RELEASE)/IsProcessValid.o: IsProcessValid.cpp + $(CXX) $(CFLAGS64_RELEASE) $(INC_RELEASE) -c IsProcessValid.cpp -o $(OBJDIR64_RELEASE)/IsProcessValid.o -$(OBJDIR_RELEASE)/EnumerateRemoteSectionsAndModules.o: EnumerateRemoteSectionsAndModules.cpp - $(CXX) $(CFLAGS_RELEASE) $(INC_RELEASE) -c EnumerateRemoteSectionsAndModules.cpp -o $(OBJDIR_RELEASE)/EnumerateRemoteSectionsAndModules.o +$(OBJDIR64_RELEASE)/Input.o: Input.cpp + $(CXX) $(CFLAGS64_RELEASE) $(INC_RELEASE) -c Input.cpp -o $(OBJDIR64_RELEASE)/Input.o -$(OBJDIR_RELEASE)/EnumerateProcesses.o: EnumerateProcesses.cpp - $(CXX) $(CFLAGS_RELEASE) $(INC_RELEASE) -c EnumerateProcesses.cpp -o $(OBJDIR_RELEASE)/EnumerateProcesses.o +$(OBJDIR64_RELEASE)/EnumerateRemoteSectionsAndModules.o: EnumerateRemoteSectionsAndModules.cpp + $(CXX) $(CFLAGS64_RELEASE) $(INC_RELEASE) -c EnumerateRemoteSectionsAndModules.cpp -o $(OBJDIR64_RELEASE)/EnumerateRemoteSectionsAndModules.o -$(OBJDIR_RELEASE)/DisassembleCode.o: DisassembleCode.cpp - $(CXX) $(CFLAGS_RELEASE) $(INC_RELEASE) -c DisassembleCode.cpp -o $(OBJDIR_RELEASE)/DisassembleCode.o +$(OBJDIR64_RELEASE)/EnumerateProcesses.o: EnumerateProcesses.cpp + $(CXX) $(CFLAGS64_RELEASE) $(INC_RELEASE) -c EnumerateProcesses.cpp -o $(OBJDIR64_RELEASE)/EnumerateProcesses.o -$(OBJDIR_RELEASE)/DistormHelper.o: ../Shared/DistormHelper.cpp - $(CXX) $(CFLAGS_RELEASE) $(INC_RELEASE) -c ../Shared/DistormHelper.cpp -o $(OBJDIR_RELEASE)/DistormHelper.o +$(OBJDIR64_RELEASE)/DisassembleCode.o: DisassembleCode.cpp + $(CXX) $(CFLAGS64_RELEASE) $(INC_RELEASE) -c DisassembleCode.cpp -o $(OBJDIR64_RELEASE)/DisassembleCode.o -$(OBJDIR_RELEASE)/Debugger.o: Debugger.cpp - $(CXX) $(CFLAGS_RELEASE) $(INC_RELEASE) -c Debugger.cpp -o $(OBJDIR_RELEASE)/Debugger.o +$(OBJDIR64_RELEASE)/DistormHelper.o: ../Shared/DistormHelper.cpp + $(CXX) $(CFLAGS64_RELEASE) $(INC_RELEASE) -c ../Shared/DistormHelper.cpp -o $(OBJDIR64_RELEASE)/DistormHelper.o -$(OBJDIR_RELEASE)/ControlRemoteProcess.o: ControlRemoteProcess.cpp - $(CXX) $(CFLAGS_RELEASE) $(INC_RELEASE) -c ControlRemoteProcess.cpp -o $(OBJDIR_RELEASE)/ControlRemoteProcess.o +$(OBJDIR64_RELEASE)/Debugger.o: Debugger.cpp + $(CXX) $(CFLAGS64_RELEASE) $(INC_RELEASE) -c Debugger.cpp -o $(OBJDIR64_RELEASE)/Debugger.o -$(OBJDIR_RELEASE)/CloseRemoteProcess.o: CloseRemoteProcess.cpp - $(CXX) $(CFLAGS_RELEASE) $(INC_RELEASE) -c CloseRemoteProcess.cpp -o $(OBJDIR_RELEASE)/CloseRemoteProcess.o +$(OBJDIR64_RELEASE)/ControlRemoteProcess.o: ControlRemoteProcess.cpp + $(CXX) $(CFLAGS64_RELEASE) $(INC_RELEASE) -c ControlRemoteProcess.cpp -o $(OBJDIR64_RELEASE)/ControlRemoteProcess.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)/CloseRemoteProcess.o: CloseRemoteProcess.cpp + $(CXX) $(CFLAGS64_RELEASE) $(INC_RELEASE) -c CloseRemoteProcess.cpp -o $(OBJDIR64_RELEASE)/CloseRemoteProcess.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)/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)/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)/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)/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)/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)/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)/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)/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)/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)/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)/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)/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)/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)/wstring.o: ../Dependencies/distorm/src/wstring.c - $(CXX) $(CFLAGS_RELEASE) $(INC_RELEASE) -c ../Dependencies/distorm/src/wstring.c -o $(OBJDIR_RELEASE)/wstring.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 6d13567a..83bff48a 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 @@ -84,7 +88,6 @@ - @@ -99,7 +102,20 @@ + + + + + + + + + + + + + @@ -139,7 +155,6 @@ c++1y ../Dependencies/distorm/include;$(Sysroot)\usr\include;$(StlIncludeDirectories);%(AdditionalIncludeDirectories) -m32 %(AdditionalOptions) - RECLASSNET32 -m32 %(AdditionalOptions) @@ -152,7 +167,6 @@ c++1y ../Dependencies/distorm/include;$(Sysroot)\usr\include;$(StlIncludeDirectories);%(AdditionalIncludeDirectories) -m32 %(AdditionalOptions) - RECLASSNET32;%(PreprocessorDefinitions) None true false diff --git a/NativeCore/Unix/NativeCore.Unix.vcxproj.filters b/NativeCore/Unix/NativeCore.Unix.vcxproj.filters index 1d75cfb2..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 @@ -82,5 +79,41 @@ + + Dependencies\distorm + + + Dependencies\distorm + + + Shared + + + Shared + + + Dependencies\distorm + + + Dependencies\distorm + + + Dependencies\distorm + + + Dependencies\distorm + + + Dependencies\distorm + + + Dependencies\distorm + + + Dependencies\distorm + + + Dependencies\distorm + \ No newline at end of file diff --git a/NativeCore/Windows/CloseRemoteProcess.cpp b/NativeCore/Windows/CloseRemoteProcess.cpp index 7cdb91cd..413ef8a1 100644 --- a/NativeCore/Windows/CloseRemoteProcess.cpp +++ b/NativeCore/Windows/CloseRemoteProcess.cpp @@ -4,5 +4,10 @@ void RC_CallConv CloseRemoteProcess(RC_Pointer handle) { + if (handle == nullptr) + { + return; + } + CloseHandle(handle); } diff --git a/NativeCore/Windows/EnumerateProcesses.cpp b/NativeCore/Windows/EnumerateProcesses.cpp index ff7f4a71..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,14 +72,16 @@ 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); } - CloseRemoteProcess(process); } + + CloseRemoteProcess(process); + } while (Process32NextW(handle, &pe32)); } diff --git a/NativeCore/Windows/EnumerateRemoteSectionsAndModules.cpp b/NativeCore/Windows/EnumerateRemoteSectionsAndModules.cpp index 789d6363..066b077b 100644 --- a/NativeCore/Windows/EnumerateRemoteSectionsAndModules.cpp +++ b/NativeCore/Windows/EnumerateRemoteSectionsAndModules.cpp @@ -1,10 +1,115 @@ #include +#include #include #include #include +#include #include "NativeCore.hpp" +PPEB GetRemotePeb(const HANDLE process) +{ + static auto* const ntdll = GetModuleHandle(TEXT("ntdll")); + if (!ntdll) + { + 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 nullptr; + } + + PROCESS_BASIC_INFORMATION pbi; + if (!NT_SUCCESS(pNtQueryInformationProcess(process, ProcessBasicInformation, &pbi, sizeof(PROCESS_BASIC_INFORMATION), nullptr))) + { + return nullptr; + } + + return pbi.PebBaseAddress; +} + +using InternalEnumerateRemoteModulesCallback = std::function; + +bool EnumerateRemoteModulesNative(const RC_Pointer process, const InternalEnumerateRemoteModulesCallback& callback) +{ + auto* const ppeb = GetRemotePeb(process); + if (ppeb == nullptr) + { + return false; + } + + PPEB_LDR_DATA ldr; + if (!ReadRemoteMemory(process, &ppeb->Ldr, &ldr, 0, sizeof(PPEB_LDR_DATA))) + { + return false; + } + + auto* const head = &ldr->InMemoryOrderModuleList; + PLIST_ENTRY current; + if (!ReadRemoteMemory(process, &head->Flink, ¤t, 0, sizeof(PLIST_ENTRY))) + { + return false; + } + + while (current != head) + { + 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 = entry.DllBase; + 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)) + { + break; + } + data.Path[length / 2] = 0; + + callback(data); + + current = entry.InMemoryOrderLinks.Flink; + } + + return true; +} + +bool EnumerateRemoteModulesWinapi(const RC_Pointer process, const InternalEnumerateRemoteModulesCallback& callback) +{ + auto* const handle = CreateToolhelp32Snapshot(TH32CS_SNAPMODULE, GetProcessId(process)); + if (handle == INVALID_HANDLE_VALUE) + { + return false; + } + + 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)); + + callback(data); + } while (Module32NextW(handle, &me32)); + } + + CloseHandle(handle); + + return true; +} + void RC_CallConv EnumerateRemoteSectionsAndModules(RC_Pointer process, EnumerateRemoteSectionsCallback callbackSection, EnumerateRemoteModulesCallback callbackModule) { if (callbackSection == nullptr && callbackModule == nullptr) @@ -14,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_READWRITE) 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; @@ -50,87 +155,87 @@ 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; + address = reinterpret_cast(memory.BaseAddress) + memory.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) { - do - { - if (callbackModule != nullptr) - { - 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); + } - 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; + }); - 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 imageDosHeader = {}; + IMAGE_NT_HEADERS imageNtHeaders = {}; - IMAGE_DOS_HEADER DosHdr = {}; - IMAGE_NT_HEADERS NtHdr = {}; + 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; + } - 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(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; - 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) + for (; it != std::end(sections); ++it) + { + 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) { - auto&& sectionHeader = sectionHeaders[i]; + if ((sectionHeader.Characteristics & IMAGE_SCN_CNT_CODE) == IMAGE_SCN_CNT_CODE) + { + section.Category = SectionCategory::CODE; + } + else if (sectionHeader.Characteristics & (IMAGE_SCN_CNT_INITIALIZED_DATA | IMAGE_SCN_CNT_UNINITIALIZED_DATA)) + { + section.Category = SectionCategory::DATA; + } - const auto sectionAddress = reinterpret_cast(me32.modBaseAddr) + sectionHeader.VirtualAddress; - for (auto j = it; j != std::end(sections); ++j) + 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, section.Name, IMAGE_SIZEOF_SHORT_NAME); + } + catch (std::range_error &) { - 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; - } + std::memset(section.Name, 0, sizeof(section.Name)); } + std::memcpy(section.ModulePath, data.Path, std::min(MAX_PATH, PATH_MAXIMUM_LENGTH)); + break; } } - } while (Module32NextW(handle, &me32)); + } } + }; + + if (!EnumerateRemoteModulesNative(process, moduleEnumerator)) + { + EnumerateRemoteModulesWinapi(process, moduleEnumerator); + } - CloseHandle(handle); - - if (callbackSection != nullptr) + if (callbackSection != nullptr) + { + for (auto&& section : sections) { - for (auto&& section : sections) - { - callbackSection(§ion); - } + callbackSection(§ion); } } } diff --git a/NativeCore/Windows/Input.cpp b/NativeCore/Windows/Input.cpp index 054397ed..8216bd07 100644 --- a/NativeCore/Windows/Input.cpp +++ b/NativeCore/Windows/Input.cpp @@ -11,6 +11,13 @@ Keys mapping[]; class DirectInput { public: + DirectInput() = default; + + DirectInput(const DirectInput&) = delete; + DirectInput(const DirectInput&&) = delete; + DirectInput& operator=(DirectInput const&) = delete; + DirectInput& operator=(DirectInput const&&) = delete; + ~DirectInput() { if (keyboardDevice) diff --git a/NativeCore/Windows/IsProcessValid.cpp b/NativeCore/Windows/IsProcessValid.cpp index fccf22cb..7f880dfe 100644 --- a/NativeCore/Windows/IsProcessValid.cpp +++ b/NativeCore/Windows/IsProcessValid.cpp @@ -4,7 +4,7 @@ bool RC_CallConv IsProcessValid(RC_Pointer handle) { - if (!handle || handle == INVALID_HANDLE_VALUE) + if (handle == nullptr) { return false; } diff --git a/NativeCore/Windows/NativeCore.vcxproj b/NativeCore/Windows/NativeCore.vcxproj index fea54b2e..5600a51a 100644 --- a/NativeCore/Windows/NativeCore.vcxproj +++ b/NativeCore/Windows/NativeCore.vcxproj @@ -22,32 +22,32 @@ {22CA6FDB-7622-4F94-8FC2-2E7AB481C86F} Win32Proj NativeCore - 10.0.14393.0 + 10.0 DynamicLibrary true - v141 + v143 Unicode DynamicLibrary false - v141 + v143 true MultiByte DynamicLibrary true - v141 + v143 MultiByte DynamicLibrary false - v141 + v143 true MultiByte @@ -103,7 +103,8 @@ 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;_SILENCE_CXX17_CODECVT_HEADER_DEPRECATION_WARNING;%(PreprocessorDefinitions) + stdcpp17 Windows @@ -118,7 +119,8 @@ 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 Windows @@ -135,7 +137,8 @@ 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;_SILENCE_CXX17_CODECVT_HEADER_DEPRECATION_WARNING;%(PreprocessorDefinitions) + stdcpp17 Windows @@ -154,7 +157,8 @@ 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 Windows @@ -174,7 +178,6 @@ - @@ -192,7 +195,20 @@ + + + + + + + + + + + + + diff --git a/NativeCore/Windows/NativeCore.vcxproj.filters b/NativeCore/Windows/NativeCore.vcxproj.filters index a7d8862a..eb42b939 100644 --- a/NativeCore/Windows/NativeCore.vcxproj.filters +++ b/NativeCore/Windows/NativeCore.vcxproj.filters @@ -58,9 +58,6 @@ Dependencies\distorm - - Dependencies\distorm - Shared @@ -85,5 +82,44 @@ + + Shared + + + Shared + + + Dependencies\distorm + + + Dependencies\distorm + + + Dependencies\distorm + + + Dependencies\distorm + + + Dependencies\distorm + + + Dependencies\distorm + + + Dependencies\distorm + + + Dependencies\distorm + + + Dependencies\distorm + + + Dependencies\distorm + + + Dependencies\distorm + \ No newline at end of file diff --git a/README.md b/README.md index bf3cd1a1..82a8a53d 100644 --- a/README.md +++ b/README.md @@ -7,19 +7,21 @@ This is a port of ReClass to the .NET platform with lots of additional features. - Support for x86 / x64 - File import from ReClass 2007-2016 and ReClass QT - Memory Nodes + - Arrays and Pointers to every other node types - Hex 8 / 16 / 32 / 64 - Int 8 / 16 / 32 / 64 - UInt 8 / 16 / 32 / 64 - Bool - Bits ![](https://abload.de/img/bitsnhlql.jpg) + - Enumerations - Float / Double - Vector 2 / 3 / 4 - Matrix 3x3 / 3x4 / 4x4 - - UTF8/16/32 Text and pointer to text - - Class Arrays and array of pointers to classes - - VTable - - Function Pointer + - UTF8 / UTF16 / UTF32 Text and pointer to text + - Virtual Tables - Function + - Function Pointer + - Unions - Automatic Node Dissection - Highlight changed memory - Pointer Preview @@ -35,7 +37,7 @@ This is a port of ReClass to the .NET platform with lots of additional features. - Class address calculator - Code Generator (C++ / C#) - Module / Section Dumper -- Linux Support (tested on Ubuntu) +- Linux Support (tested on Ubuntu 18.04) - Debugger with "Find out what writes/accesses this address" support - Plugin Support - Plugins can be written in different languages (example: C++, C++/CLI, C#) @@ -45,18 +47,19 @@ This is a port of ReClass to the .NET platform with lots of additional features. - Plugins can implement custom nodes with load/save and code generation support ## Plugins -- [Sample Plugins](https://github.com/KN4CK3R/ReClass.NET-SamplePlugin) -- [Frostbite Plugin](https://github.com/KN4CK3R/ReClass.NET-FrostbitePlugin) -- [MemoryPipe Plugin](https://github.com/KN4CK3R/ReClass.NET-MemoryPipePlugin) -- [LoadBinary Plugin](https://github.com/KN4CK3R/ReClass.NET-LoadBinaryPlugin) -- [Handle Abuser Plugin](https://github.com/KN4CK3R/ReClass.NET-HandleAbuser) -- [Unreal Plugin](https://github.com/DrP3pp3r/ReClass.NET-UnrealPlugin) (by [DrP3pp3r](https://github.com/DrP3pp3r)) +- [Sample Plugins](https://github.com/ReClassNET/ReClass.NET-SamplePlugin) +- [Frostbite Plugin](https://github.com/ReClassNET/ReClass.NET-FrostbitePlugin) +- [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 (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. -If you want to develop your own plugin just learn from the code of the [Sample Plugins](https://github.com/KN4CK3R/ReClass.NET-SamplePlugin) and [Frostbite Plugin](https://github.com/KN4CK3R/ReClass.NET-FrostbitePlugin) repositories. If you have developed a nice plugin, leave me a message and I will add it to the list above. +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. ## Installation -Just download the [latest version](https://github.com/KN4CK3R/ReClass.NET/releases) and start the x86 / x64 version or let the launcher decide. +Just download the [latest version](https://github.com/ReClassNET/ReClass.NET/releases) and start the x86 / x64 version or let the launcher decide. ## Tips - Lots of elements have a context menu. Just right-click it and see what you can do there. @@ -71,9 +74,24 @@ Just download the [latest version](https://github.com/KN4CK3R/ReClass.NET/releas 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. +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 [Youtube Playlist](https://www.youtube.com/playlist?list=PLO246BmtoITanq3ygMCL8_w0eov4D8hjk) @@ -89,7 +107,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) @@ -107,7 +125,7 @@ Settings - DrUnKeN ChEeTaH - P47R!CK - DogMatt -- [Dude719](https://github.com/dude719) +- [ajkhoury](https://github.com/ajkhoury) - [IChooseYou](https://github.com/IChooseYou) - [stevemk14ebr](https://github.com/stevemk14ebr) - [Timboy67678](https://github.com/Timboy67678) @@ -116,4 +134,5 @@ 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) +- [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 diff --git a/ReClass.NET.sln b/ReClass.NET.sln index fed7d3e0..6345bb67 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 @@ -17,49 +17,74 @@ 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 +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|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/AddressParser/AstBuilder.cs b/ReClass.NET/AddressParser/AstBuilder.cs index 2b91d50b..f12ddefc 100644 --- a/ReClass.NET/AddressParser/AstBuilder.cs +++ b/ReClass.NET/AddressParser/AstBuilder.cs @@ -1,13 +1,11 @@ -// Design taken from https://github.com/pieterderycke/Jace - -using System; +using System; using System.Collections.Generic; using System.Diagnostics.Contracts; using System.Linq; namespace ReClassNET.AddressParser { - class AstBuilder + public class AstBuilder { private readonly Dictionary operationPrecedence; diff --git a/ReClass.NET/AddressParser/DynamicCompiler.cs b/ReClass.NET/AddressParser/DynamicCompiler.cs new file mode 100644 index 00000000..2ffd110b --- /dev/null +++ b/ReClass.NET/AddressParser/DynamicCompiler.cs @@ -0,0 +1,120 @@ +using System; +using System.Diagnostics.Contracts; +using System.Linq.Expressions; +using System.Reflection; +using ReClassNET.Extensions; +using ReClassNET.Memory; + +namespace ReClassNET.AddressParser +{ + public class DynamicCompiler : IExecutor + { + public IntPtr Execute(IExpression expression, IProcessReader processReader) + { + Contract.Requires(expression != null); + Contract.Requires(processReader != null); + + return CompileExpression(expression)(processReader); + } + + public static Func CompileExpression(IExpression expression) + { + Contract.Requires(expression != null); + + var processParameter = Expression.Parameter(typeof(IProcessReader)); + + return Expression.Lambda>( + GenerateMethodBody(expression, processParameter), + processParameter + ).Compile(); + } + + private static Expression GenerateMethodBody(IExpression expression, Expression processParameter) + { + Contract.Requires(expression != null); + Contract.Requires(processParameter != null); + + static MethodInfo GetIntPtrExtension(string name) => typeof(IntPtrExtension).GetRuntimeMethod(name, new[] { typeof(IntPtr), typeof(IntPtr) }); + + 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, processParameter); + + 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, 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, 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, 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, processParameter); + var argument2 = GenerateMethodBody(divideExpression.Rhs, processParameter); + + return Expression.Call(null, GetIntPtrExtension(nameof(IntPtrExtension.Div)), argument1, argument2); + } + case ModuleExpression moduleExpression: + { + 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)); + + return Expression.Block( + new[] { moduleVariable }, + assignExpression, + Expression.Condition( + Expression.Equal(moduleVariable, Expression.Constant(null)), + Expression.Constant(IntPtr.Zero), + Expression.MakeMemberAccess(moduleVariable, typeof(Memory.Module).GetProperty(nameof(Memory.Module.Start))!) + ) + ); + } + case ReadMemoryExpression readMemoryExpression: + { + var addressParameter = GenerateMethodBody(readMemoryExpression.Expression, processParameter); + + var functionName = readMemoryExpression.ByteCount == 4 ? nameof(IRemoteMemoryReaderExtension.ReadRemoteInt32) : nameof(IRemoteMemoryReaderExtension.ReadRemoteInt64); + var readRemoteIntPtrFn = typeof(IRemoteMemoryReaderExtension).GetRuntimeMethod(functionName, new[] { typeof(IRemoteMemoryReader), typeof(IntPtr) }); + + 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); + } + } + + throw new ArgumentException($"Unsupported operation '{expression.GetType().FullName}'."); + } + } +} diff --git a/ReClass.NET/AddressParser/Expressions.cs b/ReClass.NET/AddressParser/Expressions.cs new file mode 100644 index 00000000..52388aed --- /dev/null +++ b/ReClass.NET/AddressParser/Expressions.cs @@ -0,0 +1,99 @@ +namespace ReClassNET.AddressParser +{ + public interface IExpression + { + } + + public abstract class BinaryExpression : IExpression + { + public IExpression Lhs { get; } + public IExpression Rhs { get; } + + protected BinaryExpression(IExpression lhs, IExpression rhs) + { + Lhs = lhs; + Rhs = rhs; + } + } + + public class AddExpression : BinaryExpression + { + public AddExpression(IExpression lhs, IExpression rhs) + : base(lhs, rhs) + { + } + } + + public class SubtractExpression : BinaryExpression + { + public SubtractExpression(IExpression lhs, IExpression rhs) + : base(lhs, rhs) + { + } + } + + public class MultiplyExpression : BinaryExpression + { + public MultiplyExpression(IExpression lhs, IExpression rhs) + : base(lhs, rhs) + { + } + } + + public class DivideExpression : BinaryExpression + { + public DivideExpression(IExpression lhs, IExpression rhs) + : base(lhs, rhs) + { + } + } + + public class ConstantExpression : IExpression + { + public long Value { get; } + + public ConstantExpression(long value) + { + Value = value; + } + } + + public abstract class UnaryExpression : IExpression + { + public IExpression Expression { get; } + + protected UnaryExpression(IExpression expression) + { + Expression = expression; + } + } + + public class NegateExpression : UnaryExpression + { + public NegateExpression(IExpression expression) + : base(expression) + { + } + } + + public class ReadMemoryExpression : UnaryExpression + { + public int ByteCount { get; } + + public ReadMemoryExpression(IExpression expression, int byteCount) + : base(expression) + { + ByteCount = byteCount; + } + } + + public class ModuleExpression : IExpression + { + public string Name { get; } + + public ModuleExpression(string name) + { + Name = name; + } + } +} diff --git a/ReClass.NET/AddressParser/IExecutor.cs b/ReClass.NET/AddressParser/IExecutor.cs new file mode 100644 index 00000000..0620d0e4 --- /dev/null +++ b/ReClass.NET/AddressParser/IExecutor.cs @@ -0,0 +1,10 @@ +using System; +using ReClassNET.Memory; + +namespace ReClassNET.AddressParser +{ + public interface IExecutor + { + IntPtr Execute(IExpression expression, IProcessReader processReader); + } +} diff --git a/ReClass.NET/AddressParser/ITokenizer.cs b/ReClass.NET/AddressParser/ITokenizer.cs new file mode 100644 index 00000000..171113a1 --- /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/Interpreter.cs b/ReClass.NET/AddressParser/Interpreter.cs index 83011005..ad7ee372 100644 --- a/ReClass.NET/AddressParser/Interpreter.cs +++ b/ReClass.NET/AddressParser/Interpreter.cs @@ -1,65 +1,54 @@ -// Design taken from https://github.com/pieterderycke/Jace - -using System; +using System; using System.Diagnostics.Contracts; +using ReClassNET.Extensions; using ReClassNET.Memory; -using ReClassNET.Util; namespace ReClassNET.AddressParser { - class Interpreter + public class Interpreter : IExecutor { - public IntPtr Execute(IOperation operation, RemoteProcess process) + public IntPtr Execute(IExpression expression, IProcessReader processReader) { - Contract.Requires(operation != null); - Contract.Requires(process != null); - - if (operation is OffsetOperation offsetOperation) - { - return offsetOperation.Value; - } + Contract.Requires(expression != null); + Contract.Requires(processReader != null); - if (operation is ModuleOffsetOperation moduleOffsetOperation) + switch (expression) { - var module = process.GetModuleByName(moduleOffsetOperation.Name); - if (module != null) + case ConstantExpression constantExpression: + return IntPtrExtension.From(constantExpression.Value); + case NegateExpression negateExpression: + return Execute(negateExpression.Expression, processReader).Negate(); + case ModuleExpression moduleExpression: { - return module.Start; - } - - return IntPtr.Zero; - } - - if (operation is AdditionOperation additionOperation) - { - var addition = additionOperation; - return Execute(addition.Argument1, process).Add(Execute(addition.Argument2, process)); - } - - if (operation is SubtractionOperation subtractionOperation) - { - var addition = subtractionOperation; - return Execute(addition.Argument1, process).Sub(Execute(addition.Argument2, process)); - } - - if (operation is MultiplicationOperation multiplicationOperation) - { - var multiplication = multiplicationOperation; - return Execute(multiplication.Argument1, process).Mul(Execute(multiplication.Argument2, process)); - } + var module = processReader.GetModuleByName(moduleExpression.Name); + if (module != null) + { + return module.Start; + } - if (operation is DivisionOperation divisionOperation) - { - var division = divisionOperation; - return Execute(division.Dividend, process).Div(Execute(division.Divisor, process)); - } - - if (operation is ReadPointerOperation pointerOperation) - { - return process.ReadRemoteIntPtr(Execute(pointerOperation.Argument, process)); + return IntPtr.Zero; + } + case AddExpression addExpression: + return Execute(addExpression.Lhs, processReader).Add(Execute(addExpression.Rhs, processReader)); + case SubtractExpression subtractExpression: + return Execute(subtractExpression.Lhs, processReader).Sub(Execute(subtractExpression.Rhs, processReader)); + case MultiplyExpression multiplyExpression: + return Execute(multiplyExpression.Lhs, processReader).Mul(Execute(multiplyExpression.Rhs, processReader)); + case DivideExpression divideExpression: + return Execute(divideExpression.Lhs, processReader).Div(Execute(divideExpression.Rhs, processReader)); + case ReadMemoryExpression readMemoryExpression: + var readFromAddress = Execute(readMemoryExpression.Expression, processReader); + if (readMemoryExpression.ByteCount == 4) + { + return IntPtrExtension.From(processReader.ReadRemoteInt32(readFromAddress)); + } + else + { + return IntPtrExtension.From(processReader.ReadRemoteInt64(readFromAddress)); + } + default: + throw new ArgumentException($"Unsupported operation '{expression.GetType().FullName}'."); } - - throw new ArgumentException($"Unsupported operation '{operation.GetType().FullName}'."); } } } diff --git a/ReClass.NET/AddressParser/Operations.cs b/ReClass.NET/AddressParser/Operations.cs index a665de82..c51f8df2 100644 --- a/ReClass.NET/AddressParser/Operations.cs +++ b/ReClass.NET/AddressParser/Operations.cs @@ -1,16 +1,14 @@ -// Design taken from https://github.com/pieterderycke/Jace - -using System; +using System; using System.Diagnostics.Contracts; namespace ReClassNET.AddressParser { - internal interface IOperation + public interface IOperation { } - internal class OffsetOperation : IOperation + public class OffsetOperation : IOperation { public OffsetOperation(IntPtr value) { @@ -37,7 +35,7 @@ public override int GetHashCode() } } - internal class ReadPointerOperation : IOperation + public class ReadPointerOperation : IOperation { public ReadPointerOperation(IOperation argument) { @@ -49,7 +47,7 @@ public ReadPointerOperation(IOperation argument) public IOperation Argument { get; } } - internal class AdditionOperation : IOperation + public class AdditionOperation : IOperation { public AdditionOperation(IOperation argument1, IOperation argument2) { @@ -64,7 +62,7 @@ public AdditionOperation(IOperation argument1, IOperation argument2) public IOperation Argument2 { get; } } - internal class SubtractionOperation : IOperation + public class SubtractionOperation : IOperation { public SubtractionOperation(IOperation argument1, IOperation argument2) { @@ -79,7 +77,7 @@ public SubtractionOperation(IOperation argument1, IOperation argument2) public IOperation Argument2 { get; } } - internal class DivisionOperation : IOperation + public class DivisionOperation : IOperation { public DivisionOperation(IOperation dividend, IOperation divisor) { @@ -94,7 +92,7 @@ public DivisionOperation(IOperation dividend, IOperation divisor) public IOperation Divisor { get; } } - internal class MultiplicationOperation : IOperation + public class MultiplicationOperation : IOperation { public MultiplicationOperation(IOperation argument1, IOperation argument2) { @@ -109,7 +107,7 @@ public MultiplicationOperation(IOperation argument1, IOperation argument2) public IOperation Argument2 { get; } } - internal class ModuleOffsetOperation : IOperation + public class ModuleOffsetOperation : IOperation { public ModuleOffsetOperation(string name) { diff --git a/ReClass.NET/AddressParser/ParseException.cs b/ReClass.NET/AddressParser/ParseException.cs index bee79ae4..793746dd 100644 --- a/ReClass.NET/AddressParser/ParseException.cs +++ b/ReClass.NET/AddressParser/ParseException.cs @@ -1,10 +1,8 @@ -// Design taken from https://github.com/pieterderycke/Jace - -using System; +using System; namespace ReClassNET.AddressParser { - class ParseException : Exception + public class ParseException : Exception { public ParseException(string message) : base(message) diff --git a/ReClass.NET/AddressParser/Parser.cs b/ReClass.NET/AddressParser/Parser.cs new file mode 100644 index 00000000..4db14fda --- /dev/null +++ b/ReClass.NET/AddressParser/Parser.cs @@ -0,0 +1,199 @@ +using System; +using System.IO; + +namespace ReClassNET.AddressParser +{ + public class Parser + { + private readonly ITokenizer tokenizer; + + public Parser(ITokenizer tokenizer) + { + this.tokenizer = tokenizer; + } + + public IExpression ParseExpression() + { + var expr = ParseAddSubtract(); + + if (tokenizer.Token != Token.None) + { + throw new ParseException("Unexpected characters at end of expression"); + } + + return expr; + } + + private IExpression ParseAddSubtract() + { + var lhs = ParseMultiplyDivide(); + + while (true) + { + if (tokenizer.Token == Token.Add || tokenizer.Token == Token.Subtract) + { + var token = tokenizer.Token; + + tokenizer.ReadNextToken(); + + var rhs = ParseMultiplyDivide(); + + if (token == Token.Add) + { + lhs = new AddExpression(lhs, rhs); + } + else + { + lhs = new SubtractExpression(lhs, rhs); + } + } + else + { + return lhs; + } + } + } + + private IExpression ParseMultiplyDivide() + { + var lhs = ParseUnary(); + + while (true) + { + if (tokenizer.Token == Token.Multiply || tokenizer.Token == Token.Divide) + { + var token = tokenizer.Token; + + tokenizer.ReadNextToken(); + + var rhs = ParseUnary(); + + if (token == Token.Multiply) + { + lhs = new MultiplyExpression(lhs, rhs); + } + else + { + lhs = new DivideExpression(lhs, rhs); + } + } + else + { + return lhs; + } + } + } + + private IExpression ParseUnary() + { + while (true) + { + if (tokenizer.Token == Token.Add) + { + tokenizer.ReadNextToken(); + + continue; + } + + if (tokenizer.Token == Token.Subtract) + { + tokenizer.ReadNextToken(); + + var rhs = ParseUnary(); + + return new NegateExpression(rhs); + } + + return ParseLeaf(); + } + } + + private IExpression ParseLeaf() + { + switch (tokenizer.Token) + { + case Token.Number: + { + var node = new ConstantExpression(tokenizer.Number); + + tokenizer.ReadNextToken(); + + return node; + } + case Token.OpenParenthesis: + { + tokenizer.ReadNextToken(); + + var node = ParseAddSubtract(); + + if (tokenizer.Token != Token.CloseParenthesis) + { + throw new ParseException("Missing close parenthesis"); + } + + tokenizer.ReadNextToken(); + + return node; + } + case Token.OpenBrackets: + { + tokenizer.ReadNextToken(); + + var node = ParseAddSubtract(); + + var byteCount = IntPtr.Size; + if (tokenizer.Token == Token.Comma) + { + tokenizer.ReadNextToken(); + + if (tokenizer.Token != Token.Number) + { + 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(); + } + + if (tokenizer.Token != Token.CloseBrackets) + { + throw new ParseException("Missing close bracket"); + } + + tokenizer.ReadNextToken(); + + return new ReadMemoryExpression(node, byteCount); + } + case Token.Identifier: + { + var node = new ModuleExpression(tokenizer.Identifier); + + tokenizer.ReadNextToken(); + + return node; + } + default: + throw new ParseException($"Unexpect token: {tokenizer.Token}"); + } + } + + public static IExpression Parse(string str) + { + using var sr = new StringReader(str); + + return Parse(new Tokenizer(sr)); + } + + private static IExpression Parse(ITokenizer tokenizer) + { + var parser = new Parser(tokenizer); + return parser.ParseExpression(); + } + } +} diff --git a/ReClass.NET/AddressParser/Token.cs b/ReClass.NET/AddressParser/Token.cs index 16e4a3e4..b8036b83 100644 --- a/ReClass.NET/AddressParser/Token.cs +++ b/ReClass.NET/AddressParser/Token.cs @@ -1,38 +1,18 @@ -// Design taken from https://github.com/pieterderycke/Jace - -using System.Diagnostics.Contracts; - -namespace ReClassNET.AddressParser +namespace ReClassNET.AddressParser { - internal enum TokenType + public enum Token { - Offset, - ModuleOffset, - Operation, - LeftBracket, - RightBracket, - ReadPointer - } - - internal class Token - { - /// The type of the token. - public TokenType TokenType { get; } - - /// The value of the token. - public object Value { get; } - - public Token(TokenType type, object value) - { - Contract.Requires(value != null); - - TokenType = type; - Value = value; - } - - public override string ToString() - { - return $"{TokenType} {Value}"; - } + None, + Add, + Subtract, + Multiply, + Divide, + OpenParenthesis, + CloseParenthesis, + OpenBrackets, + CloseBrackets, + Comma, + Number, + Identifier } } diff --git a/ReClass.NET/AddressParser/TokenReader.cs b/ReClass.NET/AddressParser/TokenReader.cs deleted file mode 100644 index 963a9fa8..00000000 --- a/ReClass.NET/AddressParser/TokenReader.cs +++ /dev/null @@ -1,130 +0,0 @@ -// Design taken from https://github.com/pieterderycke/Jace - -using System; -using System.Collections.Generic; -using System.Diagnostics.Contracts; -using System.Globalization; -using System.IO; -using System.Linq; - -namespace ReClassNET.AddressParser -{ - class TokenReader - { - /// - /// Read in the provided formula and convert it into a list of takens that can be processed by the - /// Abstract Syntax Tree Builder. - /// - /// The formula that must be converted into a list of tokens. - /// The list of tokens for the provided formula. - public List Read(string formula) - { - Contract.Requires(formula != null); - - var tokens = new List(); - - var isFormulaSubPart = true; - - var characters = formula.ToCharArray(); - for (var i = 0; i < characters.Length; ++i) - { - if (characters[i] == '<') - { - var buffer = string.Empty; - while (++i < characters.Length && IsPartOfModuleName(characters[i])) - { - buffer += characters[i]; - } - - if (i >= characters.Length) - { - throw new ParseException("Unexpected end of input detected."); - } - if (characters[i] != '>') - { - throw new ParseException($"Invalid token '{characters[i]}' detected at position {i}."); - } - ++i; - - tokens.Add(new Token(TokenType.ModuleOffset, buffer)); - isFormulaSubPart = false; - - if (i == characters.Length) - { - continue; - } - } - - if (IsPartOfNumeric(characters[i], true, isFormulaSubPart)) - { - var buffer = characters[i].ToString(); - while (++i < characters.Length && IsPartOfNumeric(characters[i], false, isFormulaSubPart)) - { - buffer += characters[i]; - } - - if (buffer.StartsWith("0x", StringComparison.InvariantCultureIgnoreCase)) - { - buffer = buffer.Substring(2); - } - - if (long.TryParse(buffer, NumberStyles.HexNumber, null, out var offsetValue)) - { -#if RECLASSNET64 - var address = (IntPtr)offsetValue; -#else - var address = (IntPtr)unchecked((int)offsetValue); -#endif - - tokens.Add(new Token(TokenType.Offset, address)); - isFormulaSubPart = false; - } - else - { - throw new ParseException($"'{buffer}' is not a valid number."); - } - - if (i == characters.Length) - { - continue; - } - } - - switch (characters[i]) - { - case ' ': - continue; - case '+': - case '-': - case '*': - case '/': - tokens.Add(new Token(TokenType.Operation, characters[i])); - isFormulaSubPart = true; - break; - case '[': - tokens.Add(new Token(TokenType.LeftBracket, characters[i])); - isFormulaSubPart = true; - break; - case ']': - tokens.Add(new Token(TokenType.RightBracket, characters[i])); - isFormulaSubPart = false; - break; - default: - throw new ParseException($"Invalid token '{characters[i]}' detected at position {i}."); - } - } - - return tokens; - } - - private bool IsPartOfNumeric(char character, bool isFirstCharacter, bool isFormulaSubPart) - { - return (character >= '0' && character <= '9') || (character >= 'a' && character <= 'f') || (character >= 'A' && character <= 'F') || (isFormulaSubPart && !isFirstCharacter && (character == 'x' || character == 'X')); - } - - private bool IsPartOfModuleName(char character) - { - return !Path.GetInvalidFileNameChars().Contains(character); - } - } -} diff --git a/ReClass.NET/AddressParser/Tokenizer.cs b/ReClass.NET/AddressParser/Tokenizer.cs new file mode 100644 index 00000000..a43907ec --- /dev/null +++ b/ReClass.NET/AddressParser/Tokenizer.cs @@ -0,0 +1,189 @@ +using System.Diagnostics.Contracts; +using System.Globalization; +using System.IO; +using System.Text; + +namespace ReClassNET.AddressParser +{ + /// + /// Parses the given text and reads individual tokens from it. + /// + public class Tokenizer : ITokenizer + { + private readonly TextReader reader; + + private char currentCharacter; + + public Token Token { get; private set; } + + public string Identifier { get; private set; } + + public long Number { get; private set; } + + public Tokenizer(TextReader reader) + { + Contract.Requires(reader != null); + + this.reader = reader; + + ReadNextCharacter(); + ReadNextToken(); + } + + public void ReadNextToken() + { + SkipWhitespaces(); + + if (currentCharacter == '\0') + { + Token = Token.None; + Identifier = null; + Number = 0; + + return; + } + + if (TryReadSimpleToken()) + { + ReadNextCharacter(); + + return; + } + + if (TryReadNumberToken()) + { + return; + } + + if (TryReadIdentifierToken()) + { + return; + } + + throw new ParseException($"Invalid character '{currentCharacter}'."); + } + + private void ReadNextCharacter() + { + var c = reader.Read(); + currentCharacter = c < 0 ? '\0' : (char)c; + } + + private void SkipWhitespaces() + { + while (char.IsWhiteSpace(currentCharacter)) + { + ReadNextCharacter(); + } + } + + private bool TryReadSimpleToken() + { + switch (currentCharacter) + { + case '+': + Token = Token.Add; + return true; + case '-': + Token = Token.Subtract; + return true; + case '*': + Token = Token.Multiply; + return true; + case '/': + Token = Token.Divide; + return true; + case '(': + Token = Token.OpenParenthesis; + return true; + case ')': + Token = Token.CloseParenthesis; + return true; + case '[': + Token = Token.OpenBrackets; + return true; + case ']': + Token = Token.CloseBrackets; + return true; + case ',': + Token = Token.Comma; + return true; + } + + return false; + } + + private bool TryReadNumberToken() + { + bool IsHexadecimalDigit(char c) => char.IsDigit(c) || 'a' <= c && c <= 'f' || 'A' <= c && c <= 'F'; + bool IsHexadecimalIdentifier(char c) => c == 'x' || c == 'X'; + + if (IsHexadecimalDigit(currentCharacter)) + { + var sb = new StringBuilder(); + var hasHexadecimalIdentifier = false; + + while (IsHexadecimalDigit(currentCharacter) + || IsHexadecimalIdentifier(currentCharacter) && !hasHexadecimalIdentifier && sb.Length == 1 && sb[0] == '0') + { + sb.Append(currentCharacter); + + if (!hasHexadecimalIdentifier) + { + hasHexadecimalIdentifier = IsHexadecimalIdentifier(currentCharacter); + } + + ReadNextCharacter(); + } + + if (hasHexadecimalIdentifier) + { + sb.Remove(0, 2); + } + + if (!long.TryParse(sb.ToString(), NumberStyles.HexNumber, CultureInfo.InvariantCulture, out var number)) + { + throw new ParseException($"Could not parse '{sb}' as number."); + } + Number = number; + + Token = Token.Number; + + return true; + } + + return false; + } + + private bool TryReadIdentifierToken() + { + if (currentCharacter == '<') + { + ReadNextCharacter(); + + var sb = new StringBuilder(); + + while (currentCharacter != '\0' && currentCharacter != '>') + { + sb.Append(currentCharacter); + + ReadNextCharacter(); + } + + if (currentCharacter != '>') + { + throw new ParseException("Invalid identifier, missing '>'."); + } + + ReadNextCharacter(); + + Identifier = sb.ToString(); + Token = Token.Identifier; + + return true; + } + + return false; + } + } +} \ No newline at end of file diff --git a/ReClass.NET/App.config b/ReClass.NET/App.config index 731f6de6..1b379a17 100644 --- a/ReClass.NET/App.config +++ b/ReClass.NET/App.config @@ -1,6 +1,9 @@ - + - - - + + + + + + \ No newline at end of file diff --git a/ReClass.NET/CodeGenerator/CSharpCodeGenerator.cs b/ReClass.NET/CodeGenerator/CSharpCodeGenerator.cs index 283bf68b..c46bb836 100644 --- a/ReClass.NET/CodeGenerator/CSharpCodeGenerator.cs +++ b/ReClass.NET/CodeGenerator/CSharpCodeGenerator.cs @@ -1,17 +1,19 @@ -using System; +using System; +using System.CodeDom.Compiler; using System.Collections.Generic; using System.Diagnostics.Contracts; +using System.IO; using System.Linq; -using System.Text; +using ReClassNET.Extensions; using ReClassNET.Logger; using ReClassNET.Nodes; -using ReClassNET.Util; +using ReClassNET.Project; namespace ReClassNET.CodeGenerator { - class CSharpCodeGenerator : ICodeGenerator + public class CSharpCodeGenerator : ICodeGenerator { - private readonly Dictionary typeToTypedefMap = new Dictionary + private static readonly Dictionary nodeTypeToTypeDefinationMap = new Dictionary { [typeof(DoubleNode)] = "double", [typeof(FloatNode)] = "float", @@ -20,128 +22,256 @@ 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", [typeof(Utf16TextPtrNode)] = "IntPtr", [typeof(Utf32TextPtrNode)] = "IntPtr", - [typeof(ClassPtrNode)] = "IntPtr", - [typeof(VTableNode)] = "IntPtr" + [typeof(PointerNode)] = "IntPtr", + [typeof(VirtualMethodTableNode)] = "IntPtr", + + [typeof(Vector2Node)] = "Vector2", + [typeof(Vector3Node)] = "Vector3", + [typeof(Vector4Node)] = "Vector4" }; public Language Language => Language.CSharp; - public string GenerateCode(IEnumerable classes, ILogger logger) + public string GenerateCode(IReadOnlyList classes, IReadOnlyList enums, ILogger logger) { - var sb = new StringBuilder(); - sb.AppendLine($"// Created with {Constants.ApplicationName} by {Constants.Author}"); - sb.AppendLine(); - sb.AppendLine("// Warning: The code doesn't contain arrays and instances!"); - sb.AppendLine(); - sb.AppendLine("using System.Runtime.InteropServices;"); - sb.AppendLine(); - - sb.Append( - string.Join( - Environment.NewLine + Environment.NewLine, - classes.Select(c => - { - var csb = new StringBuilder(); - - csb.AppendLine("[StructLayout(LayoutKind.Explicit)]"); - csb.Append($"struct {c.Name}"); - if (!string.IsNullOrEmpty(c.Comment)) - { - csb.Append($" // {c.Comment}"); - } - csb.AppendLine(); - - csb.AppendLine("{"); - - csb.AppendLine( - string.Join( - Environment.NewLine + Environment.NewLine, - YieldMemberDefinitions(c.Nodes, logger) - .Select(m => $"\t{GetFieldDecorator(m)}{Environment.NewLine}\t{GetFieldDefinition(m)}") - ) - ); - csb.Append("}"); - return csb.ToString(); - }) - ) - ); - - return sb.ToString(); - } + using var sw = new StringWriter(); + using var iw = new IndentedTextWriter(sw, "\t"); - private IEnumerable YieldMemberDefinitions(IEnumerable members, ILogger logger) - { - Contract.Requires(members != null); - Contract.Requires(Contract.ForAll(members, m => m != null)); - Contract.Ensures(Contract.Result>() != null); - Contract.Ensures(Contract.ForAll(Contract.Result>(), d => d != null)); + 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(); - foreach (var member in members.WhereNot(n => n is BaseHexNode)) + using (var en = enums.GetEnumerator()) { - if (member is BitFieldNode bitFieldNode) + if (en.MoveNext()) { - string type; - switch (bitFieldNode.Bits) + WriteEnum(iw, en.Current); + + while (en.MoveNext()) { - default: - type = typeToTypedefMap[typeof(UInt8Node)]; - break; - case 16: - type = typeToTypedefMap[typeof(UInt16Node)]; - break; - case 32: - type = typeToTypedefMap[typeof(UInt32Node)]; - break; - case 64: - type = typeToTypedefMap[typeof(UInt64Node)]; - break; + iw.WriteLine(); + + WriteEnum(iw, en.Current); } - yield return new MemberDefinition(member, type); + iw.WriteLine(); } - else + } + + 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 unicodeStringClassLengthsToGenerate = new HashSet(); + + using (var en = classesToWrite.GetEnumerator()) + { + if (en.MoveNext()) { - if (typeToTypedefMap.TryGetValue(member.GetType(), out var type)) + void FindUnicodeStringClasses(IEnumerable nodes) { - yield return new MemberDefinition(member, type); + unicodeStringClassLengthsToGenerate.UnionWith(nodes.OfType().Select(n => n.Length)); } - else + + FindUnicodeStringClasses(en.Current!.Nodes); + + WriteClass(iw, en.Current, logger); + + while (en.MoveNext()) { - var generator = CustomCodeGenerator.GetGenerator(member, Language); - if (generator != null) - { - yield return generator.GetMemberDefinition(member, Language, logger); + iw.WriteLine(); - continue; - } + FindUnicodeStringClasses(en.Current!.Nodes); - logger.Log(LogLevel.Error, $"Skipping node with unhandled type: {member.GetType()}"); + WriteClass(iw, en.Current, logger); } } } + + if (unicodeStringClassLengthsToGenerate.Any()) + { + foreach (var length in unicodeStringClassLengthsToGenerate) + { + iw.WriteLine(); + + WriteUnicodeStringClass(iw, length); + } + } + + return sw.ToString(); } - private string GetFieldDecorator(MemberDefinition member) + /// + /// Outputs the C# code for the given enum to the instance. + /// + /// The writer to output to. + /// The enum to output. + private static void WriteEnum(IndentedTextWriter writer, EnumDescription @enum) { - Contract.Requires(member != null); + Contract.Requires(writer != null); + Contract.Requires(@enum != null); + + writer.Write($"enum {@enum.Name} : "); + switch (@enum.Size) + { + case EnumDescription.UnderlyingTypeSize.OneByte: + writer.WriteLine(nodeTypeToTypeDefinationMap[typeof(Int8Node)]); + break; + case EnumDescription.UnderlyingTypeSize.TwoBytes: + writer.WriteLine(nodeTypeToTypeDefinationMap[typeof(Int16Node)]); + break; + case EnumDescription.UnderlyingTypeSize.FourBytes: + writer.WriteLine(nodeTypeToTypeDefinationMap[typeof(Int32Node)]); + break; + case EnumDescription.UnderlyingTypeSize.EightBytes: + writer.WriteLine(nodeTypeToTypeDefinationMap[typeof(Int64Node)]); + break; + } + writer.WriteLine("{"); + writer.Indent++; + for (var j = 0; j < @enum.Values.Count; ++j) + { + var kv = @enum.Values[j]; - return $"[FieldOffset({member.Offset})]"; + writer.Write(kv.Key); + writer.Write(" = "); + writer.Write(kv.Value); + if (j < @enum.Values.Count - 1) + { + writer.Write(","); + } + writer.WriteLine(); + } + writer.Indent--; + writer.WriteLine("};"); } - private string GetFieldDefinition(MemberDefinition member) + /// + /// Outputs the C# code for the given class to the instance. + /// + /// The writer to output to. + /// The class to output. + /// The logger. + private static void WriteClass(IndentedTextWriter writer, ClassNode @class, ILogger logger) + { + Contract.Requires(writer != null); + Contract.Requires(@class != null); + Contract.Requires(logger != null); + + writer.WriteLine("[StructLayout(LayoutKind.Explicit, CharSet = CharSet.Ansi)]"); + writer.Write("public struct "); + writer.Write(@class.Name); + + if (!string.IsNullOrEmpty(@class.Comment)) + { + writer.Write(" // "); + writer.Write(@class.Comment); + } + + writer.WriteLine(); + + writer.WriteLine("{"); + writer.Indent++; + + var nodes = @class.Nodes + .WhereNot(n => n is FunctionNode || n is BaseHexNode); + foreach (var node in nodes) + { + var (type, attribute) = GetTypeDefinition(node); + if (type != null) + { + 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)) + { + writer.Write(" //"); + writer.Write(node.Comment); + } + writer.WriteLine(); + } + else + { + logger.Log(LogLevel.Warning, $"Skipping node with unhandled type: {node.GetType()}"); + } + } + + writer.Indent--; + writer.WriteLine("}"); + } + + /// + /// 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 as typename if the node is not expressible. + private static (string typeName, string attribute) GetTypeDefinition(BaseNode node) + { + Contract.Requires(node != null); + + if (node is BitFieldNode bitFieldNode) + { + var underlayingNode = bitFieldNode.GetUnderlayingNode(); + underlayingNode.CopyFromNode(node); + node = underlayingNode; + } + + if (nodeTypeToTypeDefinationMap.TryGetValue(node.GetType(), out var type)) + { + return (type, null); + } + + return node switch + { + 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) + }; + } + + private static string GetUnicodeStringClassName(int length) => $"__UnicodeString{length}"; + + /// + /// 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) { - Contract.Requires(member != null); + var className = GetUnicodeStringClassName(length); - return $"public {member.Type} {member.Name}; //0x{member.Offset:X04} {member.Comment}".Trim(); + 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("}"); } } } diff --git a/ReClass.NET/CodeGenerator/CppCodeGenerator.cs b/ReClass.NET/CodeGenerator/CppCodeGenerator.cs index 26b9d231..b6495aab 100644 --- a/ReClass.NET/CodeGenerator/CppCodeGenerator.cs +++ b/ReClass.NET/CodeGenerator/CppCodeGenerator.cs @@ -1,260 +1,651 @@ -using System; +using System; +using System.CodeDom.Compiler; using System.Collections.Generic; using System.Diagnostics.Contracts; +using System.Drawing; +using System.IO; using System.Linq; using System.Text; +using ReClassNET.Controls; +using ReClassNET.Extensions; using ReClassNET.Logger; using ReClassNET.Nodes; -using ReClassNET.Util; +using ReClassNET.Project; namespace ReClassNET.CodeGenerator { - class CppCodeGenerator : ICodeGenerator + public delegate void WriteNodeFunc(IndentedTextWriter writer, BaseNode node, ILogger logger); + + public delegate string GetTypeDefinitionFunc(BaseNode node, ILogger logger); + + public delegate string ResolveWrappedTypeFunc(BaseNode node, bool isAnonymousExpression, ILogger logger); + + /// + /// A C++ code generator for custom nodes. + /// + public abstract class CustomCppCodeGenerator { - private readonly Dictionary typeToTypedefMap = new Dictionary + /// + /// Returns true if the code generator can handle the given node. + /// + /// The node to check. + /// True if the code generator can handle the given node, false otherwise. + public abstract bool CanHandle(BaseNode node); + + /// + /// Outputs the C++ code for the node to the instance. + /// + /// The writer to output to. + /// The node to output. + /// The default implementation of . + /// The logger. + /// True if the code generator has processed the node, false otherwise. If this method returns false, the default implementation is used. + public virtual bool WriteNode(IndentedTextWriter writer, BaseNode node, WriteNodeFunc defaultWriteNodeFunc, ILogger logger) { - [typeof(BoolNode)] = Program.Settings.TypeBool, - [typeof(DoubleNode)] = Program.Settings.TypeDouble, - [typeof(FloatNode)] = Program.Settings.TypeFloat, - [typeof(FunctionPtrNode)] = Program.Settings.TypeFunctionPtr, - [typeof(Int8Node)] = Program.Settings.TypeInt8, - [typeof(Int16Node)] = Program.Settings.TypeInt16, - [typeof(Int32Node)] = Program.Settings.TypeInt32, - [typeof(Int64Node)] = Program.Settings.TypeInt64, - [typeof(Matrix3x3Node)] = Program.Settings.TypeMatrix3x3, - [typeof(Matrix3x4Node)] = Program.Settings.TypeMatrix3x4, - [typeof(Matrix4x4Node)] = Program.Settings.TypeMatrix4x4, - [typeof(UInt8Node)] = Program.Settings.TypeUInt8, - [typeof(UInt16Node)] = Program.Settings.TypeUInt16, - [typeof(UInt32Node)] = Program.Settings.TypeUInt32, - [typeof(UInt64Node)] = Program.Settings.TypeUInt64, - [typeof(Utf8TextNode)] = Program.Settings.TypeUTF8Text, - [typeof(Utf8TextPtrNode)] = Program.Settings.TypeUTF8TextPtr, - [typeof(Utf16TextNode)] = Program.Settings.TypeUTF16Text, - [typeof(Utf16TextPtrNode)] = Program.Settings.TypeUTF16TextPtr, - [typeof(Utf32TextNode)] = Program.Settings.TypeUTF32Text, - [typeof(Utf32TextPtrNode)] = Program.Settings.TypeUTF32TextPtr, - [typeof(Vector2Node)] = Program.Settings.TypeVector2, - [typeof(Vector3Node)] = Program.Settings.TypeVector3, - [typeof(Vector4Node)] = Program.Settings.TypeVector4 - }; + return false; + } + + /// + /// Transforms the given node if necessary. + /// + /// The node to transform. + /// The transformed node. + public virtual BaseNode TransformNode(BaseNode node) + { + return node; + } + + /// + /// Gets the type definition for the node. If the node is not a simple node null is returned. + /// + /// The node. + /// The default implementation of . + /// The default implementation of . + /// The logger. + /// The type definition for the node or null if no simple type is available. + public virtual string GetTypeDefinition(BaseNode node, GetTypeDefinitionFunc defaultGetTypeDefinitionFunc, ResolveWrappedTypeFunc defaultResolveWrappedTypeFunc, ILogger logger) + { + return null; + } + } + + public class CppCodeGenerator : ICodeGenerator + { + #region Custom Code Generators + + private static readonly ISet customGenerators = new HashSet(); + + public static void Add(CustomCppCodeGenerator generator) + { + customGenerators.Add(generator); + } + + public static void Remove(CustomCppCodeGenerator generator) + { + customGenerators.Remove(generator); + } + + private static CustomCppCodeGenerator GetCustomCodeGeneratorForNode(BaseNode node) + { + return customGenerators.FirstOrDefault(g => g.CanHandle(node)); + } + + #endregion + + private readonly Dictionary nodeTypeToTypeDefinationMap; + + #region HelperNodes + + 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 context) => 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(DrawContext context, int x, int y) => throw new NotImplementedException(); + public override int CalculateDrawnHeight(DrawContext context) => 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(DrawContext context, int x, int y) => throw new NotImplementedException(); + public override int CalculateDrawnHeight(DrawContext context) => throw new NotImplementedException(); + } + + #endregion public Language Language => Language.Cpp; - public string GenerateCode(IEnumerable classes, ILogger logger) + public CppCodeGenerator(CppTypeMapping typeMapping) + { + nodeTypeToTypeDefinationMap = new Dictionary + { + [typeof(BoolNode)] = typeMapping.TypeBool, + [typeof(DoubleNode)] = typeMapping.TypeDouble, + [typeof(FloatNode)] = typeMapping.TypeFloat, + [typeof(FunctionPtrNode)] = typeMapping.TypeFunctionPtr, + [typeof(Int8Node)] = typeMapping.TypeInt8, + [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, + [typeof(UInt8Node)] = typeMapping.TypeUInt8, + [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, + [typeof(Vector2Node)] = typeMapping.TypeVector2, + [typeof(Vector3Node)] = typeMapping.TypeVector3, + [typeof(Vector4Node)] = typeMapping.TypeVector4 + }; + } + + public string GenerateCode(IReadOnlyList classes, IReadOnlyList enums, ILogger logger) { - var classNodes = classes as IList ?? classes.ToList(); + using var sw = new StringWriter(); + using var iw = new IndentedTextWriter(sw, "\t"); - var sb = new StringBuilder(); - sb.AppendLine($"// Created with {Constants.ApplicationName} by {Constants.Author}"); - sb.AppendLine(); - sb.AppendLine( - string.Join( - Environment.NewLine + Environment.NewLine, - // Skip class which contains FunctionNodes because these are not data classes. - OrderByInheritance(classNodes.Where(c => c.Nodes.None(n => n is FunctionNode))).Select(c => + iw.WriteLine($"// Created with {Constants.ApplicationName} {Constants.ApplicationVersion} by {Constants.Author}"); + iw.WriteLine(); + + using (var en = enums.GetEnumerator()) + { + if (en.MoveNext()) + { + WriteEnum(iw, en.Current); + + while (en.MoveNext()) { - var csb = new StringBuilder(); - csb.Append($"class {c.Name}"); + iw.WriteLine(); - bool skipFirstMember = false; - if (c.Nodes.FirstOrDefault() is ClassInstanceNode inheritedFromNode) - { - skipFirstMember = true; + WriteEnum(iw, en.Current); + } - csb.Append(" : public "); - csb.Append(inheritedFromNode.InnerNode.Name); - } + iw.WriteLine(); + } + } - if (!string.IsNullOrEmpty(c.Comment)) - { - csb.Append($" // {c.Comment}"); - } - csb.AppendLine(); - - csb.AppendLine("{"); - csb.AppendLine("public:"); - csb.AppendLine( - string.Join( - Environment.NewLine, - YieldMemberDefinitions(c.Nodes.Skip(skipFirstMember ? 1 : 0).WhereNot(n => n is FunctionNode), logger) - .Select(MemberDefinitionToString) - .Select(s => "\t" + s) - ) - ); - - var vTableNodes = c.Nodes.OfType().ToList(); - if (vTableNodes.Any()) - { - csb.AppendLine(); - csb.AppendLine( - string.Join( - Environment.NewLine, - vTableNodes.SelectMany(vt => vt.Nodes).OfType().Select(m => $"\tvirtual void {m.MethodName}();") - ) - ); - } + var alreadySeen = new HashSet(); - var functionNodes = classNodes.SelectMany(c2 => c2.Nodes).OfType().Where(f => f.BelongsToClass == c).ToList(); - if (functionNodes.Any()) - { - csb.AppendLine(); - csb.AppendLine( - string.Join( - Environment.NewLine, - functionNodes.Select(f => $"\t{f.Signature} {{ }}") - ) - ); - } + IEnumerable GetReversedClassHierarchy(ClassNode node) + { + Contract.Requires(node != null); + Contract.Ensures(Contract.Result>() != null); + + if (!alreadySeen.Add(node)) + { + return Enumerable.Empty(); + } - csb.Append($"}}; //Size: 0x{c.MemorySize:X04}"); - return csb.ToString(); - }) - ) - ); + 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) + .Where(n => n != null); + + 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(); + + using (var en = classesToWrite.GetEnumerator()) + { + if (en.MoveNext()) + { + WriteClass(iw, en.Current, classes, logger); + + while (en.MoveNext()) + { + iw.WriteLine(); + + WriteClass(iw, en.Current, classes, logger); + } + } + } - return sb.ToString(); + return sw.ToString(); } - private IEnumerable OrderByInheritance(IEnumerable classes) + /// + /// Outputs the C++ code for the given enum to the instance. + /// + /// The writer to output to. + /// The enum to output. + private void WriteEnum(IndentedTextWriter writer, EnumDescription @enum) { - Contract.Requires(classes != null); - Contract.Requires(Contract.ForAll(classes, c => c != null)); - Contract.Ensures(Contract.Result>() != null); + Contract.Requires(writer != null); + Contract.Requires(@enum != null); - var alreadySeen = new HashSet(); + writer.Write($"enum class {@enum.Name} : "); + switch (@enum.Size) + { + case EnumDescription.UnderlyingTypeSize.OneByte: + writer.WriteLine(nodeTypeToTypeDefinationMap[typeof(Int8Node)]); + break; + case EnumDescription.UnderlyingTypeSize.TwoBytes: + writer.WriteLine(nodeTypeToTypeDefinationMap[typeof(Int16Node)]); + break; + case EnumDescription.UnderlyingTypeSize.FourBytes: + writer.WriteLine(nodeTypeToTypeDefinationMap[typeof(Int32Node)]); + break; + case EnumDescription.UnderlyingTypeSize.EightBytes: + writer.WriteLine(nodeTypeToTypeDefinationMap[typeof(Int64Node)]); + break; + } + writer.WriteLine("{"); + writer.Indent++; + for (var j = 0; j < @enum.Values.Count; ++j) + { + var kv = @enum.Values[j]; - return classes.SelectMany(c => YieldReversedHierarchy(c, alreadySeen)).Distinct(); + writer.Write(kv.Key); + writer.Write(" = "); + writer.Write(kv.Value); + if (j < @enum.Values.Count - 1) + { + writer.Write(","); + } + writer.WriteLine(); + } + writer.Indent--; + writer.WriteLine("};"); } - private IEnumerable YieldReversedHierarchy(ClassNode node, HashSet alreadySeen) + /// + /// Outputs the C++ code for the given class to the instance. + /// + /// The writer to output to. + /// The class to output. + /// The list of all available classes. + /// The logger. + private void WriteClass(IndentedTextWriter writer, ClassNode @class, IEnumerable classes, ILogger logger) { - Contract.Requires(node != null); - Contract.Requires(alreadySeen != null); - Contract.Requires(Contract.ForAll(alreadySeen, c => c != null)); - Contract.Ensures(Contract.Result>() != null); + Contract.Requires(writer != null); + Contract.Requires(@class != null); + Contract.Requires(classes != null); + + writer.Write("class "); + writer.Write(@class.Name); + + var skipFirstMember = false; + if (@class.Nodes.FirstOrDefault() is ClassInstanceNode inheritedFromNode) + { + skipFirstMember = true; - if (!alreadySeen.Add(node)) + writer.Write(" : public "); + writer.Write(inheritedFromNode.InnerNode.Name); + } + + if (!string.IsNullOrEmpty(@class.Comment)) + { + writer.Write(" // "); + writer.Write(@class.Comment); + } + + writer.WriteLine(); + + writer.WriteLine("{"); + writer.WriteLine("public:"); + writer.Indent++; + + var nodes = @class.Nodes + .Skip(skipFirstMember ? 1 : 0) + .WhereNot(n => n is FunctionNode); + WriteNodes(writer, nodes, logger); + + var vTableNodes = @class.Nodes.OfType().ToList(); + if (vTableNodes.Any()) { - yield break; + writer.WriteLine(); + + var virtualMethodNodes = vTableNodes + .SelectMany(vt => vt.Nodes) + .OfType(); + foreach (var node in virtualMethodNodes) + { + writer.Write("virtual void "); + writer.Write(node.MethodName); + writer.WriteLine("();"); + } } - foreach (var referenceNode in node.Nodes.OfType()) + var functionNodes = classes + .SelectMany(c2 => c2.Nodes) + .OfType() + .Where(f => f.BelongsToClass == @class) + .ToList(); + if (functionNodes.Any()) { - foreach (var referencedNode in YieldReversedHierarchy(referenceNode.InnerNode, alreadySeen)) + writer.WriteLine(); + + foreach (var node in functionNodes) { - yield return referencedNode; + writer.Write(node.Signature); + writer.WriteLine("{ }"); } } - yield return node; + writer.Indent--; + writer.Write("}; //Size: 0x"); + writer.WriteLine($"{@class.MemorySize:X04}"); + + writer.WriteLine($"static_assert(sizeof({@class.Name}) == 0x{@class.MemorySize:X});"); } - private IEnumerable YieldMemberDefinitions(IEnumerable members, ILogger logger) + /// + /// Outputs the C++ code for the given nodes to the instance. + /// + /// The writer to output to. + /// The nodes to output. + /// The logger. + private void WriteNodes(IndentedTextWriter writer, IEnumerable nodes, ILogger logger) { - Contract.Requires(members != null); - Contract.Requires(Contract.ForAll(members, m => m != null)); - Contract.Ensures(Contract.Result>() != null); - Contract.Ensures(Contract.ForAll(Contract.Result>(), d => d != null)); + Contract.Requires(writer != null); + Contract.Requires(nodes != null); - int fill = 0; - int fillStart = 0; + var fill = 0; + var fillStart = 0; - foreach (var member in members.WhereNot(m => m is VTableNode)) + static BaseNode CreatePaddingMember(int offset, int count) + { + var node = new ArrayNode + { + Offset = offset, + Count = count, + Name = $"pad_{offset:X04}" + }; + + node.ChangeInnerNode(new Utf8CharacterNode()); + + return node; + } + + foreach (var member in nodes.WhereNot(m => m is VirtualMethodTableNode)) { if (member is BaseHexNode) { if (fill == 0) { - fillStart = member.Offset.ToInt32(); + fillStart = member.Offset; } fill += member.MemorySize; continue; } - + if (fill != 0) { - yield return new MemberDefinition(Program.Settings.TypePadding, fill, $"pad_{fillStart:X04}", fillStart, string.Empty); + WriteNode(writer, CreatePaddingMember(fillStart, fill), logger); fill = 0; } - if (typeToTypedefMap.TryGetValue(member.GetType(), out var type)) + WriteNode(writer, member, logger); + } + + if (fill != 0) + { + WriteNode(writer, CreatePaddingMember(fillStart, fill), logger); + } + } + + /// + /// Outputs the C++ code for the given node to the instance. + /// + /// The writer to output to. + /// The node to output. + /// The logger. + private void WriteNode(IndentedTextWriter writer, BaseNode node, ILogger logger) + { + Contract.Requires(writer != null); + Contract.Requires(node != null); + + var custom = GetCustomCodeGeneratorForNode(node); + if (custom != null) + { + if (custom.WriteNode(writer, node, WriteNode, logger)) { - var count = (member as BaseTextNode)?.Length ?? 0; + return; + } + } + + node = TransformNode(node); - yield return new MemberDefinition(member, type, count); + var simpleType = GetTypeDefinition(node, logger); + if (simpleType != null) + { + //$"{type} {node.Name}; //0x{node.Offset.ToInt32():X04} {node.Comment}".Trim(); + writer.Write(simpleType); + writer.Write(" "); + writer.Write(node.Name); + writer.Write("; //0x"); + writer.Write($"{node.Offset:X04}"); + if (!string.IsNullOrEmpty(node.Comment)) + { + writer.Write(" "); + writer.Write(node.Comment); } - else if (member is BitFieldNode) + writer.WriteLine(); + } + else if (node is BaseWrapperNode) + { + writer.Write(ResolveWrappedType(node, false, logger)); + writer.Write("; //0x"); + writer.Write($"{node.Offset:X04}"); + if (!string.IsNullOrEmpty(node.Comment)) { - switch (((BitFieldNode)member).Bits) - { - case 8: - type = Program.Settings.TypeUInt8; - break; - case 16: - type = Program.Settings.TypeUInt16; - break; - case 32: - type = Program.Settings.TypeUInt32; - break; - case 64: - type = Program.Settings.TypeUInt64; - break; - } - - yield return new MemberDefinition(member, type); + writer.Write(" "); + writer.Write(node.Comment); } - else if (member is ClassInstanceArrayNode) + writer.WriteLine(); + } + else if (node is UnionNode unionNode) + { + writer.Write("union //0x"); + writer.Write($"{node.Offset:X04}"); + if (!string.IsNullOrEmpty(node.Comment)) { - var instanceArray = (ClassInstanceArrayNode)member; - - yield return new MemberDefinition(member, instanceArray.InnerNode.Name, instanceArray.Count); + writer.Write(" "); + writer.Write(node.Comment); } - else if (member is ClassInstanceNode) + writer.WriteLine(); + writer.WriteLine("{"); + writer.Indent++; + + WriteNodes(writer, unionNode.Nodes, logger); + + writer.Indent--; + writer.WriteLine("};"); + } + else + { + logger.Log(LogLevel.Error, $"Skipping node with unhandled type: {node.GetType()}"); + } + } + + /// + /// Transforms the given node into some other node if necessary. + /// + /// The node to transform. + /// The transformed node. + private static BaseNode TransformNode(BaseNode node) + { + var custom = GetCustomCodeGeneratorForNode(node); + if (custom != null) + { + return custom.TransformNode(node); + } + + static BaseNode GetCharacterNodeForEncoding(Encoding encoding) + { + if (encoding.IsSameCodePage(Encoding.Unicode)) { - yield return new MemberDefinition(member, ((ClassInstanceNode)member).InnerNode.Name); + return new Utf16CharacterNode(); } - else if (member is ClassPtrArrayNode) + if (encoding.IsSameCodePage(Encoding.UTF32)) { - var ptrArray = (ClassPtrArrayNode)member; + return new Utf32CharacterNode(); + } + return new Utf8CharacterNode(); + } - yield return new MemberDefinition(member, $"class {ptrArray.InnerNode.Name}*", ptrArray.Count); + switch (node) + { + case BaseTextNode textNode: + { + var arrayNode = new ArrayNode { Count = textNode.Length }; + arrayNode.CopyFromNode(node); + arrayNode.ChangeInnerNode(GetCharacterNodeForEncoding(textNode.Encoding)); + return arrayNode; } - else if (member is ClassPtrNode) + case BaseTextPtrNode textPtrNode: { - yield return new MemberDefinition(member, $"class {((ClassPtrNode)member).InnerNode.Name}*"); + var pointerNode = new PointerNode(); + pointerNode.CopyFromNode(node); + pointerNode.ChangeInnerNode(GetCharacterNodeForEncoding(textPtrNode.Encoding)); + return pointerNode; } - else + case BitFieldNode bitFieldNode: { - var generator = CustomCodeGenerator.GetGenerator(member, Language); - if (generator != null) - { - yield return generator.GetMemberDefinition(member, Language, logger); - } - else - { - logger.Log(LogLevel.Error, $"Skipping node with unhandled type: {member.GetType()}"); - } + 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; } } - if (fill != 0) + return node; + } + + /// + /// Gets the type definition for the given node. If the node is not a simple node null is returned. + /// + /// The target node. + /// The logger. + /// The type definition for the node or null if no simple type is available. + private string GetTypeDefinition(BaseNode node, ILogger logger) + { + Contract.Requires(node != null); + + var custom = GetCustomCodeGeneratorForNode(node); + if (custom != null) { - yield return new MemberDefinition(Program.Settings.TypePadding, fill, $"pad_{fillStart:X04}", fillStart, string.Empty); + return custom.GetTypeDefinition(node, GetTypeDefinition, ResolveWrappedType, logger); } + + if (nodeTypeToTypeDefinationMap.TryGetValue(node.GetType(), out var type)) + { + return type; + } + + switch (node) + { + case ClassInstanceNode classInstanceNode: + return $"class {classInstanceNode.InnerNode.Name}"; + case EnumNode enumNode: + return enumNode.Enum.Name; + } + + return null; } - private string MemberDefinitionToString(MemberDefinition member) + /// + /// Resolves the type of a node ( and ). + /// + /// The node to resolve. + /// Specify if the expression should be anonymous. + /// The logger. + /// The resolved type of the node. + private string ResolveWrappedType(BaseNode node, bool isAnonymousExpression, ILogger logger) { - Contract.Requires(member != null); + Contract.Requires(node != null); + + var sb = new StringBuilder(); + if (!isAnonymousExpression) + { + sb.Append(node.Name); + } - if (member.IsArray) + BaseNode lastWrapperNode = null; + var currentNode = node; + + while (true) { - return $"{member.Type} {member.Name}[{member.ArrayCount}]; //0x{member.Offset:X04} {member.Comment}".Trim(); + currentNode = TransformNode(currentNode); + + if (currentNode is PointerNode pointerNode) + { + sb.Prepend('*'); + + if (pointerNode.InnerNode == null) // void* + { + if (!isAnonymousExpression) + { + sb.Prepend(' '); + } + sb.Prepend("void"); + break; + } + + lastWrapperNode = pointerNode; + currentNode = pointerNode.InnerNode; + } + else if (currentNode is ArrayNode arrayNode) + { + if (lastWrapperNode is PointerNode) + { + sb.Prepend('('); + sb.Append(')'); + } + + sb.Append($"[{arrayNode.Count}]"); + + lastWrapperNode = arrayNode; + currentNode = arrayNode.InnerNode; + } + else + { + var simpleType = GetTypeDefinition(currentNode, logger); + + if (!isAnonymousExpression) + { + sb.Prepend(' '); + } + + sb.Prepend(simpleType); + break; + } } - return $"{member.Type} {member.Name}; //0x{member.Offset:X04} {member.Comment}".Trim(); + + return sb.ToString().Trim(); } } } diff --git a/ReClass.NET/CodeGenerator/CustomCodeGenerator.cs b/ReClass.NET/CodeGenerator/CustomCodeGenerator.cs deleted file mode 100644 index 4bfd1c70..00000000 --- a/ReClass.NET/CodeGenerator/CustomCodeGenerator.cs +++ /dev/null @@ -1,62 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Diagnostics.Contracts; -using System.Linq; -using ReClassNET.Logger; -using ReClassNET.Nodes; - -namespace ReClassNET.CodeGenerator -{ - [ContractClass(typeof(CustomCodeGeneratorContract))] - public interface ICustomCodeGenerator - { - bool CanGenerateCode(BaseNode node, Language language); - - MemberDefinition GetMemberDefinition(BaseNode node, Language language, ILogger logger); - } - - [ContractClassFor(typeof(ICustomCodeGenerator))] - internal abstract class CustomCodeGeneratorContract : ICustomCodeGenerator - { - public bool CanGenerateCode(BaseNode node, Language language) - { - Contract.Requires(node != null); - - throw new NotImplementedException(); - } - - public MemberDefinition GetMemberDefinition(BaseNode node, Language language, ILogger logger) - { - Contract.Requires(node != null); - Contract.Ensures(Contract.Result() != null); - - throw new NotImplementedException(); - } - } - - public class CustomCodeGenerator - { - private static readonly List generators = new List(); - - public static void RegisterCustomType(ICustomCodeGenerator generator) - { - Contract.Requires(generator != null); - - generators.Add(generator); - } - - public static void DeregisterCustomType(ICustomCodeGenerator generator) - { - Contract.Requires(generator != null); - - generators.Remove(generator); - } - - public static ICustomCodeGenerator GetGenerator(BaseNode node, Language language) - { - Contract.Requires(node != null); - - return generators.FirstOrDefault(c => c.CanGenerateCode(node, language)); - } - } -} diff --git a/ReClass.NET/CodeGenerator/ICodeGenerator.cs b/ReClass.NET/CodeGenerator/ICodeGenerator.cs index 525cb744..159a64d4 100644 --- a/ReClass.NET/CodeGenerator/ICodeGenerator.cs +++ b/ReClass.NET/CodeGenerator/ICodeGenerator.cs @@ -3,6 +3,7 @@ using System.Diagnostics.Contracts; using ReClassNET.Logger; using ReClassNET.Nodes; +using ReClassNET.Project; namespace ReClassNET.CodeGenerator { @@ -16,7 +17,7 @@ public interface ICodeGenerator /// The classes to generate code from. /// The logger used to output messages. /// The code for the classes. - string GenerateCode(IEnumerable classes, ILogger logger); + string GenerateCode(IReadOnlyList classes, IReadOnlyList enums, ILogger logger); } [ContractClassFor(typeof(ICodeGenerator))] @@ -24,7 +25,7 @@ internal abstract class CodeGeneratorContract : ICodeGenerator { public Language Language => throw new NotImplementedException(); - public string GenerateCode(IEnumerable classes, ILogger logger) + public string GenerateCode(IReadOnlyList classes, IReadOnlyList enums, ILogger logger) { Contract.Requires(classes != null); Contract.Requires(Contract.ForAll(classes, c => c != null)); diff --git a/ReClass.NET/CodeGenerator/MemberDefinition.cs b/ReClass.NET/CodeGenerator/MemberDefinition.cs deleted file mode 100644 index edf508d8..00000000 --- a/ReClass.NET/CodeGenerator/MemberDefinition.cs +++ /dev/null @@ -1,45 +0,0 @@ -using System.Diagnostics.Contracts; -using ReClassNET.Nodes; - -namespace ReClassNET.CodeGenerator -{ - public class MemberDefinition - { - public bool IsArray => ArrayCount != 0; - public int ArrayCount { get; } - - public int Offset { get; } - - public string Type { get; } - public string Name { get; } - public string Comment { get; } - - public MemberDefinition(BaseNode node, string type) - : this(node, type, 0) - { - - } - - public MemberDefinition(BaseNode node, string type, int arrayCount) - : this(type, arrayCount, node.Name, node.Offset.ToInt32(), node.Comment) - { - Contract.Requires(node != null); - Contract.Requires(type != null); - } - - public MemberDefinition(string type, int arrayCount, string name, int offset, string comment) - { - Contract.Requires(type != null); - Contract.Requires(name != null); - Contract.Requires(comment != null); - - ArrayCount = arrayCount; - - Offset = offset; - - Type = type; - Name = name; - Comment = comment; - } - } -} diff --git a/ReClass.NET/Constants.cs b/ReClass.NET/Constants.cs index 76357fc7..4e54782a 100644 --- a/ReClass.NET/Constants.cs +++ b/ReClass.NET/Constants.cs @@ -1,31 +1,31 @@ namespace ReClassNET { - internal class Constants + public class Constants { public const string ApplicationName = "ReClass.NET"; public const string ApplicationExecutableName = ApplicationName + ".exe"; - public const string ApplicationVersion = "1.1"; + public const string ApplicationVersion = "1.2"; public const string LauncherExecutableName = ApplicationName + "_Launcher.exe"; public const string Author = "KN4CK3R"; - public const string HomepageUrl = "https://github.com/KN4CK3R/ReClass.NET"; + public const string HomepageUrl = "https://github.com/ReClassNET/ReClass.NET"; - public const string HelpUrl = "https://github.com/KN4CK3R/ReClass.NET/issues"; + public const string HelpUrl = "https://github.com/ReClassNET/ReClass.NET/issues"; - public const string PluginUrl = "https://github.com/KN4CK3R/ReClass.NET#plugins"; + public const string PluginUrl = "https://github.com/ReClassNET/ReClass.NET#plugins"; #if RECLASSNET64 public const string Platform = "x64"; - public const string StringHexFormat = "X016"; + public const string AddressHexFormat = "X016"; #else public const string Platform = "x86"; - public const string StringHexFormat = "X08"; + public const string AddressHexFormat = "X08"; #endif public const string SettingsFile = "settings.xml"; diff --git a/ReClass.NET/UI/BannerBox.cs b/ReClass.NET/Controls/BannerBox.cs similarity index 83% rename from ReClass.NET/UI/BannerBox.cs rename to ReClass.NET/Controls/BannerBox.cs index 78bae320..b3cdab8c 100644 --- a/ReClass.NET/UI/BannerBox.cs +++ b/ReClass.NET/Controls/BannerBox.cs @@ -1,8 +1,9 @@ -using System.ComponentModel; +using System.ComponentModel; using System.Drawing; using System.Windows.Forms; +using ReClassNET.UI; -namespace ReClassNET.UI +namespace ReClassNET.Controls { public class BannerBox : Control, ISupportInitialize { @@ -32,7 +33,7 @@ protected override void SetBoundsCore(int x, int y, int width, int height, Bound { int oldWidth = Width; - base.SetBoundsCore(x, y, width, DefaultBannerHeight, specified); + base.SetBoundsCore(x, y, width, DpiUtil.ScaleIntY(DefaultBannerHeight), specified); if (oldWidth != width && width > 0) { @@ -71,7 +72,7 @@ private void UpdateBanner() { var oldImage = image; - image = BannerFactory.CreateBanner(Width, DefaultBannerHeight, icon, title, text, true); + image = BannerFactory.CreateBanner(Width, Height, icon, title, text, true); oldImage?.Dispose(); @@ -79,7 +80,7 @@ private void UpdateBanner() } catch { - + // ignored } } } diff --git a/ReClass.NET/UI/ColorBox.Designer.cs b/ReClass.NET/Controls/ColorBox.Designer.cs similarity index 92% rename from ReClass.NET/UI/ColorBox.Designer.cs rename to ReClass.NET/Controls/ColorBox.Designer.cs index ccc1be6b..0757df19 100644 --- a/ReClass.NET/UI/ColorBox.Designer.cs +++ b/ReClass.NET/Controls/ColorBox.Designer.cs @@ -1,4 +1,4 @@ -namespace ReClassNET.UI +namespace ReClassNET.Controls { partial class ColorBox { @@ -38,7 +38,7 @@ private void InitializeComponent() this.valueTextBox.Name = "valueTextBox"; this.valueTextBox.Size = new System.Drawing.Size(86, 20); this.valueTextBox.TabIndex = 0; - this.valueTextBox.TextChanged += new System.EventHandler(this.valueTextBox_TextChanged); + this.valueTextBox.TextChanged += new System.EventHandler(this.OnTextChanged); // // colorPanel // @@ -46,8 +46,8 @@ private void InitializeComponent() this.colorPanel.Name = "colorPanel"; this.colorPanel.Size = new System.Drawing.Size(30, 20); this.colorPanel.TabIndex = 1; - this.colorPanel.Click += new System.EventHandler(this.colorPanel_Click); - this.colorPanel.Paint += new System.Windows.Forms.PaintEventHandler(this.colorPanel_Paint); + this.colorPanel.Click += new System.EventHandler(this.OnPanelClick); + this.colorPanel.Paint += new System.Windows.Forms.PaintEventHandler(this.OnPanelPaint); // // ColorBox // diff --git a/ReClass.NET/UI/ColorBox.cs b/ReClass.NET/Controls/ColorBox.cs similarity index 50% rename from ReClass.NET/UI/ColorBox.cs rename to ReClass.NET/Controls/ColorBox.cs index a6e80b4a..9325e645 100644 --- a/ReClass.NET/UI/ColorBox.cs +++ b/ReClass.NET/Controls/ColorBox.cs @@ -1,21 +1,22 @@ -using System; +using System; using System.ComponentModel; +using System.Diagnostics.Contracts; using System.Drawing; -using System.Reflection; using System.Windows.Forms; -namespace ReClassNET.UI +namespace ReClassNET.Controls { - public partial class ColorBox : UserControl, ISettingsBindable + [DefaultEvent(nameof(ColorChanged))] + [DefaultBindingProperty(nameof(Color))] + public partial class ColorBox : UserControl { private const int DefaultWidth = 123; private const int DefaultHeight = 20; - private PropertyInfo property; - private Settings source; - private bool updateTextBox = true; + public event EventHandler ColorChanged; + private Color color; public Color Color { @@ -34,25 +35,19 @@ public Color Color valueTextBox.Text = ColorTranslator.ToHtml(value); } - WriteSetting(); + OnColorChanged(EventArgs.Empty); } updateTextBox = true; } } - [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] - public string SettingName + protected virtual void OnColorChanged(EventArgs e) { - get => property?.Name; - set { property = typeof(Settings).GetProperty(value); ReadSetting(); } - } + Contract.Requires(e != null); - [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] - public Settings Source - { - get => source; - set { source = value; ReadSetting(); } + var eh = ColorChanged; + eh?.Invoke(this, e); } public ColorBox() @@ -65,27 +60,7 @@ protected override void SetBoundsCore(int x, int y, int width, int height, Bound base.SetBoundsCore(x, y, DefaultWidth, DefaultHeight, specified); } - private void ReadSetting() - { - if (property != null && source != null) - { - var value = property.GetValue(source); - if (value is Color newColor) - { - Color = newColor; - } - } - } - - private void WriteSetting() - { - if (property != null && source != null) - { - property.SetValue(source, Color); - } - } - - private void valueTextBox_TextChanged(object sender, EventArgs e) + private void OnTextChanged(object sender, EventArgs e) { try { @@ -102,24 +77,25 @@ private void valueTextBox_TextChanged(object sender, EventArgs e) } catch { - + // ignored } } - private void colorPanel_Click(object sender, EventArgs e) + private void OnPanelClick(object sender, EventArgs e) { - using (var cd = new ColorDialog()) + using var cd = new ColorDialog { - cd.Color = Color; + FullOpen = true, + Color = Color + }; - if (cd.ShowDialog() == DialogResult.OK) - { - Color = cd.Color; - } + if (cd.ShowDialog() == DialogResult.OK) + { + Color = cd.Color; } } - private void colorPanel_Paint(object sender, PaintEventArgs e) + private void OnPanelPaint(object sender, PaintEventArgs e) { var rect = colorPanel.ClientRectangle; rect.Width--; 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 66% rename from ReClass.NET/UI/CustomToolStripItems.cs rename to ReClass.NET/Controls/CustomToolStripItems.cs index f10b95ec..ea186f17 100644 --- a/ReClass.NET/UI/CustomToolStripItems.cs +++ b/ReClass.NET/Controls/CustomToolStripItems.cs @@ -1,23 +1,23 @@ -using System; +using System; using System.Windows.Forms; using System.Windows.Forms.Design; -namespace ReClassNET.UI +namespace ReClassNET.Controls { [ToolStripItemDesignerAvailability(ToolStripItemDesignerAvailability.All)] - class IntegerToolStripMenuItem : ToolStripMenuItem + public class IntegerToolStripMenuItem : ToolStripMenuItem { public int Value { get; set; } } [ToolStripItemDesignerAvailability(ToolStripItemDesignerAvailability.All)] - class TypeToolStripMenuItem : ToolStripMenuItem + public class TypeToolStripMenuItem : ToolStripMenuItem { public Type Value { get; set; } } [ToolStripItemDesignerAvailability(ToolStripItemDesignerAvailability.All)] - class TypeToolStripButton : ToolStripButton + public class TypeToolStripButton : ToolStripButton { public Type Value { get; set; } } diff --git a/ReClass.NET/UI/ViewInfo.cs b/ReClass.NET/Controls/DrawContext.cs similarity index 59% rename from ReClass.NET/UI/ViewInfo.cs rename to ReClass.NET/Controls/DrawContext.cs index 64d6ea5a..6d233780 100644 --- a/ReClass.NET/UI/ViewInfo.cs +++ b/ReClass.NET/Controls/DrawContext.cs @@ -1,37 +1,43 @@ -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 + 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; } + public RemoteProcess Process { get; set; } public MemoryBuffer Memory { get; set; } + public DateTime CurrentTime { get; set; } + public Rectangle ClientArea { get; set; } public List HotSpots { get; set; } - public List Classes { get; set; } public IntPtr Address { get; set; } 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, Memory = Memory, + CurrentTime = CurrentTime, ClientArea = ClientArea, HotSpots = HotSpots, - Classes = Classes, Address = Address, Level = Level, MultipleNodesSelected = MultipleNodesSelected diff --git a/ReClass.NET/Controls/DrawContextRequestEventArgs.cs b/ReClass.NET/Controls/DrawContextRequestEventArgs.cs new file mode 100644 index 00000000..13c04d03 --- /dev/null +++ b/ReClass.NET/Controls/DrawContextRequestEventArgs.cs @@ -0,0 +1,26 @@ +using System; +using ReClassNET.Memory; +using ReClassNET.Nodes; +using ReClassNET.UI; + +namespace ReClassNET.Controls +{ + public class DrawContextRequestEventArgs : EventArgs + { + public DateTime CurrentTime { get; set; } = DateTime.UtcNow; + + public Settings Settings { get; set; } + + public IconProvider IconProvider { 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/DualValueBox.Designer.cs b/ReClass.NET/Controls/DualValueBox.Designer.cs similarity index 99% rename from ReClass.NET/UI/DualValueBox.Designer.cs rename to ReClass.NET/Controls/DualValueBox.Designer.cs index f94500f7..dd5a675b 100644 --- a/ReClass.NET/UI/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/UI/DualValueBox.cs b/ReClass.NET/Controls/DualValueBox.cs similarity index 96% rename from ReClass.NET/UI/DualValueBox.cs rename to ReClass.NET/Controls/DualValueBox.cs index a3f473f9..d2b8d264 100644 --- a/ReClass.NET/UI/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/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 94% rename from ReClass.NET/UI/EnumComboBox.cs rename to ReClass.NET/Controls/EnumComboBox.cs index 385b63c3..4875b85d 100644 --- a/ReClass.NET/UI/EnumComboBox.cs +++ b/ReClass.NET/Controls/EnumComboBox.cs @@ -1,11 +1,11 @@ -using System.Collections.Generic; +using System.Collections.Generic; using System.ComponentModel; using System.Diagnostics.Contracts; using System.Linq; using System.Windows.Forms; -using ReClassNET.Util; +using ReClassNET.Extensions; -namespace ReClassNET.UI +namespace ReClassNET.Controls { public class EnumComboBox : ComboBox where TEnum : struct { @@ -51,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)); } @@ -92,7 +92,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) @@ -104,7 +104,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/Controls/EnumDescriptionDisplay.cs similarity index 74% rename from ReClass.NET/UI/EnumDescriptionDisplay.cs rename to ReClass.NET/Controls/EnumDescriptionDisplay.cs index e1d5a863..e2fa4c1b 100644 --- a/ReClass.NET/UI/EnumDescriptionDisplay.cs +++ b/ReClass.NET/Controls/EnumDescriptionDisplay.cs @@ -1,12 +1,11 @@ -using System; +using System; using System.Collections.Generic; using System.ComponentModel; using System.Diagnostics.Contracts; using System.Linq; using System.Reflection; -using ReClassNET.Util; -namespace ReClassNET.UI +namespace ReClassNET.Controls { public class EnumDescriptionDisplay where TEnum : struct { @@ -20,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); @@ -42,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/Controls/HotSpotTextBox.cs b/ReClass.NET/Controls/HotSpotTextBox.cs new file mode 100644 index 00000000..218cdeb7 --- /dev/null +++ b/ReClass.NET/Controls/HotSpotTextBox.cs @@ -0,0 +1,130 @@ +using System; +using System.ComponentModel; +using System.Drawing; +using System.Windows.Forms; +using ReClassNET.UI; + +namespace ReClassNET.Controls +{ + public class HotSpotTextBox : TextBox + { + private HotSpot currentHotSpot; + + private FontEx font; + private int minimumWidth; + + [Browsable(false)] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public new FontEx Font + { + get => font; + set + { + if (font != value) + { + font = value; + + base.Font = font.Font; + } + } + } + + public event HotSpotTextBoxCommitEventHandler Committed; + + public HotSpotTextBox() + { + BorderStyle = BorderStyle.None; + } + + #region Events + + protected override void OnVisibleChanged(EventArgs e) + { + base.OnVisibleChanged(e); + + if (Visible) + { + BackColor = Program.Settings.BackgroundColor; + + if (currentHotSpot != null) + { + Focus(); + Select(0, TextLength); + } + } + } + + protected override void OnKeyDown(KeyEventArgs e) + { + if (e.KeyCode == Keys.Enter) + { + OnCommit(); + + e.Handled = true; + e.SuppressKeyPress = true; + } + + base.OnKeyDown(e); + } + + protected override void OnTextChanged(EventArgs e) + { + base.OnTextChanged(e); + + var w = (TextLength + 1) * font.Width; + if (w > minimumWidth) + { + Width = w; + } + } + + private void OnCommit() + { + Visible = false; + + currentHotSpot.Text = Text.Trim(); + + Committed?.Invoke(this, new HotSpotTextBoxCommitEventArgs(currentHotSpot)); + } + + #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/HotkeyBox.Designer.cs b/ReClass.NET/Controls/HotkeyBox.Designer.cs similarity index 98% rename from ReClass.NET/UI/HotkeyBox.Designer.cs rename to ReClass.NET/Controls/HotkeyBox.Designer.cs index 5654a7d5..c65ead37 100644 --- a/ReClass.NET/UI/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/UI/HotkeyBox.cs b/ReClass.NET/Controls/HotkeyBox.cs similarity index 97% rename from ReClass.NET/UI/HotkeyBox.cs rename to ReClass.NET/Controls/HotkeyBox.cs index 8a5d1747..9a24e7b3 100644 --- a/ReClass.NET/UI/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/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 82% rename from ReClass.NET/UI/IconButton.cs rename to ReClass.NET/Controls/IconButton.cs index d3331c2c..5d45a198 100644 --- a/ReClass.NET/UI/IconButton.cs +++ b/ReClass.NET/Controls/IconButton.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.ComponentModel; using System.Diagnostics.Contracts; using System.Drawing; @@ -6,7 +6,7 @@ using System.Windows.Forms; using System.Windows.Forms.Design; -namespace ReClassNET.UI +namespace ReClassNET.Controls { /// /// Based on . @@ -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/MemoryPreviewPopUp.cs b/ReClass.NET/Controls/MemoryPreviewPopUp.cs similarity index 76% rename from ReClass.NET/UI/MemoryPreviewPopUp.cs rename to ReClass.NET/Controls/MemoryPreviewPopUp.cs index 6c048b9c..c407a40d 100644 --- a/ReClass.NET/UI/MemoryPreviewPopUp.cs +++ b/ReClass.NET/Controls/MemoryPreviewPopUp.cs @@ -1,14 +1,16 @@ -using System; +using System; using System.Collections.Generic; using System.ComponentModel; using System.Diagnostics.Contracts; using System.Drawing; using System.Linq; using System.Windows.Forms; +using ReClassNET.Extensions; using ReClassNET.Memory; using ReClassNET.Nodes; +using ReClassNET.UI; -namespace ReClassNET.UI +namespace ReClassNET.Controls { [ToolboxItem(false)] public class MemoryPreviewPopUp : ToolStripDropDown @@ -21,9 +23,8 @@ private class MemoryPreviewPanel : Panel { private const int MinNodeCount = 10; - public ViewInfo ViewInfo => viewInfo; + public DrawContext DrawContext { get; } - private readonly ViewInfo viewInfo; private readonly List nodes; public MemoryPreviewPanel(FontEx font) @@ -34,14 +35,14 @@ public MemoryPreviewPanel(FontEx font) nodes = new List(); - viewInfo = new ViewInfo + DrawContext = new DrawContext { Font = font, + IconProvider = new IconProvider(), // TODO use single instance Memory = new MemoryBuffer(), - HotSpots = new List(), - Classes = new List() + HotSpots = new List() }; SetNodeCount(MinNodeCount); @@ -55,11 +56,15 @@ private void SetNodeCount(int count) { BaseHexNode CreateNode(int index) { + return new #if RECLASSNET64 - return new Hex64Node { Offset = (IntPtr)(index * 8) }; + Hex64Node #else - return new Hex32Node { Offset = (IntPtr)(index * 4) }; + Hex32Node #endif + { + Offset = index * IntPtr.Size + }; } if (nodes.Count < count) @@ -71,7 +76,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. @@ -96,26 +101,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; - e.Graphics.FillRectangle(Brushes.White, Bounds); - using (var pen = new Pen(Brushes.Black, 1)) + using (var brush = new SolidBrush(DrawContext.Settings.BackgroundColor)) + { + e.Graphics.FillRectangle(brush, ClientRectangle); + } + 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)); } @@ -124,7 +132,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; } } } @@ -206,15 +214,15 @@ public void InitializeMemory(RemoteProcess process, IntPtr address) memoryAddress = address; - var memory = panel.ViewInfo.Memory; - memory.Process = process; - memory.Update(address); + panel.DrawContext.Process = process; + + panel.DrawContext.Memory.UpdateFrom(process, address); } /// Updates the memory buffer to get current data. public void UpdateMemory() { - panel.ViewInfo.Memory.Update(memoryAddress); + panel.DrawContext.Memory.UpdateFrom(panel.DrawContext.Process, memoryAddress); panel.Invalidate(); } diff --git a/ReClass.NET/UI/MemoryRecordList.Designer.cs b/ReClass.NET/Controls/MemoryRecordList.Designer.cs similarity index 99% rename from ReClass.NET/UI/MemoryRecordList.Designer.cs rename to ReClass.NET/Controls/MemoryRecordList.Designer.cs index 34475868..8f3e0379 100644 --- a/ReClass.NET/UI/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/UI/MemoryRecordList.cs b/ReClass.NET/Controls/MemoryRecordList.cs similarity index 94% rename from ReClass.NET/UI/MemoryRecordList.cs rename to ReClass.NET/Controls/MemoryRecordList.cs index 351ddf7f..b3a06672 100644 --- a/ReClass.NET/UI/MemoryRecordList.cs +++ b/ReClass.NET/Controls/MemoryRecordList.cs @@ -1,14 +1,15 @@ -using System.Collections.Generic; +using System.Collections.Generic; using System.ComponentModel; using System.Diagnostics.Contracts; using System.Drawing; using System.Linq; using System.Windows.Forms; +using ReClassNET.Extensions; using ReClassNET.Memory; using ReClassNET.MemoryScanner; -using ReClassNET.Util; +using ReClassNET.UI; -namespace ReClassNET.UI +namespace ReClassNET.Controls { public delegate void MemorySearchResultControlResultDoubleClickEventHandler(object sender, MemoryRecord record); @@ -83,7 +84,11 @@ public MemoryRecordList() }; resultDataGridView.AutoGenerateColumns = false; - resultDataGridView.DefaultCellStyle.Font = Program.MonoSpaceFont.Font; + resultDataGridView.DefaultCellStyle.Font = new Font( + Program.MonoSpaceFont.Font.FontFamily, + DpiUtil.ScaleIntX(11), + GraphicsUnit.Pixel + ); resultDataGridView.DataSource = bindings; } 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/Controls/MemoryViewControl.Designer.cs b/ReClass.NET/Controls/MemoryViewControl.Designer.cs new file mode 100644 index 00000000..942c196d --- /dev/null +++ b/ReClass.NET/Controls/MemoryViewControl.Designer.cs @@ -0,0 +1,74 @@ +namespace ReClassNET.Controls +{ + partial class MemoryViewControl + { + /// + /// Erforderliche Designervariable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Verwendete Ressourcen bereinigen. + /// + /// True, wenn verwaltete Ressourcen gelöscht werden sollen; andernfalls False. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Vom Komponenten-Designer generierter Code + + /// + /// Erforderliche Methode für die Designerunterstützung. + /// Der Inhalt der Methode darf nicht mit dem Code-Editor geändert werden. + /// + private void InitializeComponent() + { + this.components = new System.ComponentModel.Container(); + this.repaintTimer = new System.Windows.Forms.Timer(this.components); + this.hotSpotEditBox = new 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 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 hotSpotEditBox; + private System.Windows.Forms.ToolTip nodeInfoToolTip; + } +} diff --git a/ReClass.NET/Controls/MemoryViewControl.cs b/ReClass.NET/Controls/MemoryViewControl.cs new file mode 100644 index 00000000..64b8dfa4 --- /dev/null +++ b/ReClass.NET/Controls/MemoryViewControl.cs @@ -0,0 +1,708 @@ +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.Memory; +using ReClassNET.Nodes; +using ReClassNET.UI; +using ReClassNET.Util; + +namespace ReClassNET.Controls +{ + public partial class MemoryViewControl : UserControl + { + /// + /// Contains informations about a selected node. + /// + public class SelectedNodeInfo + { + /// + /// The selected node. + /// + public BaseNode Node { get; } + + public RemoteProcess Process { get; } + + /// + /// The memory this node uses. + /// + public MemoryBuffer Memory { get; } + + /// + /// The address of the node in the remote process. + /// + public IntPtr Address { get; } + + public int Level { get; } + + 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; + } + } + + private readonly List hotSpots = new List(); + private readonly List selectedNodes = new List(); + + private HotSpot selectionCaret; + private HotSpot selectionAnchor; + + private readonly FontEx font; + + public ContextMenuStrip NodeContextMenuStrip { get; set; } + + public event DrawContextRequestEventHandler DrawContextRequested; + public event EventHandler SelectionChanged; + public event NodeClickEventHandler ChangeClassTypeClick; + public event NodeClickEventHandler ChangeWrappedTypeClick; + public event NodeClickEventHandler ChangeEnumTypeClick; + + private readonly MemoryPreviewPopUp memoryPreviewPopUp; + + public MemoryViewControl() + { + InitializeComponent(); + + if (Program.DesignMode) + { + return; + } + + AutoScroll = true; + + font = Program.MonoSpaceFont; + + hotSpotEditBox.Font = font; + + memoryPreviewPopUp = new MemoryPreviewPopUp(font); + } + + protected override void OnPaint(PaintEventArgs e) + { + base.OnPaint(e); + + if (DesignMode) + { + e.Graphics.FillRectangle(Brushes.White, ClientRectangle); + + return; + } + + var args = new DrawContextRequestEventArgs(); + + var requestHandler = DrawContextRequested; + requestHandler?.Invoke(this, args); + + hotSpots.Clear(); + + using (var brush = new SolidBrush(Program.Settings.BackgroundColor)) + { + e.Graphics.FillRectangle(brush, ClientRectangle); + } + + if (args.Process == null || args.Memory == null || args.Node == null) + { + return; + } + + if (memoryPreviewPopUp.Visible) + { + memoryPreviewPopUp.UpdateMemory(); + } + + var view = new DrawContext + { + Settings = args.Settings, + Graphics = e.Graphics, + Font = font, + IconProvider = args.IconProvider, + Process = args.Process, + Memory = args.Memory, + CurrentTime = args.CurrentTime, + ClientArea = ClientRectangle, + HotSpots = hotSpots, + Address = args.BaseAddress, + Level = 0, + MultipleNodesSelected = selectedNodes.Count > 1 + }; + + var scrollPosition = AutoScrollPosition; + + var drawnSize = args.Node.Draw( + view, + scrollPosition.X, + scrollPosition.Y + ); + drawnSize.Width += 10; + + /*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); + }*/ + + 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() + { + SelectionChanged?.Invoke(this, EventArgs.Empty); + } + + #region Process Input + + protected override void OnMouseClick(MouseEventArgs e) + { + Contract.Requires(e != null); + + hotSpotEditBox.Hide(); + + var invalidate = false; + + foreach (var hotSpot in hotSpots) + { + if (hotSpot.Rect.Contains(e.Location)) + { + var hitObject = hotSpot.Node; + + if (hotSpot.Type == HotSpotType.OpenClose) + { + hitObject.ToggleLevelOpen(hotSpot.Level); + + invalidate = true; + + break; + } + if (hotSpot.Type == HotSpotType.Click) + { + hitObject.Update(hotSpot); + + invalidate = true; + + break; + } + if (hotSpot.Type == HotSpotType.Select) + { + if (e.Button == MouseButtons.Left) + { + if (ModifierKeys == Keys.None) + { + ClearSelection(); + + hitObject.IsSelected = true; + + selectedNodes.Add(hotSpot); + + OnSelectionChanged(); + + selectionAnchor = selectionCaret = hotSpot; + } + else if (ModifierKeys == Keys.Control) + { + hitObject.IsSelected = !hitObject.IsSelected; + + if (hitObject.IsSelected) + { + selectedNodes.Add(hotSpot); + } + else + { + selectedNodes.Remove(selectedNodes.FirstOrDefault(c => c.Node == hitObject)); + } + + OnSelectionChanged(); + } + else if (ModifierKeys == Keys.Shift) + { + if (selectedNodes.Count > 0) + { + var selectedNode = selectedNodes[0].Node; + if (hitObject.GetParentContainer() != null && selectedNode.GetParentContainer() != hitObject.GetParentContainer()) + { + continue; + } + + if (hotSpot.Node is BaseContainerNode) + { + continue; + } + + var first = Utils.Min(selectedNodes[0], hotSpot, h => h.Node.Offset); + var last = first == hotSpot ? selectedNodes[0] : hotSpot; + + ClearSelection(); + + var containerNode = selectedNode.GetParentContainer(); + foreach (var spot in containerNode.Nodes + .SkipWhile(n => n != first.Node) + .TakeWhileInclusive(n => n != last.Node) + .Select(n => new HotSpot + { + Address = (IntPtr)(containerNode.Offset + n.Offset), + Node = n, + Process = first.Process, + Memory = first.Memory, + Level = first.Level + })) + { + spot.Node.IsSelected = true; + selectedNodes.Add(spot); + } + + OnSelectionChanged(); + + selectionAnchor = first; + selectionCaret = last; + } + } + } + else if (e.Button == MouseButtons.Right) + { + // If there is only one selected node, select the node the user clicked at. + if (selectedNodes.Count <= 1) + { + ClearSelection(); + + hitObject.IsSelected = true; + + selectedNodes.Add(hotSpot); + + OnSelectionChanged(); + + selectionAnchor = selectionCaret = hotSpot; + } + + ShowNodeContextMenu(e.Location); + } + + invalidate = true; + } + else if (hotSpot.Type == HotSpotType.Context) + { + ShowNodeContextMenu(e.Location); + + break; + } + else if (hotSpot.Type == HotSpotType.Delete) + { + hotSpot.Node.GetParentContainer().RemoveNode(hotSpot.Node); + + invalidate = true; + + break; + } + else if (hotSpot.Type == HotSpotType.ChangeClassType || hotSpot.Type == HotSpotType.ChangeWrappedType || hotSpot.Type == HotSpotType.ChangeEnumType) + { + 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)); + + break; + } + } + } + + if (invalidate) + { + Invalidate(); + } + + base.OnMouseClick(e); + } + + protected override void OnMouseDoubleClick(MouseEventArgs e) + { + Contract.Requires(e != null); + + hotSpotEditBox.Hide(); + + var invalidate = false; + + // Order the hotspots: 1. DoubleClick 2. Click 3. Edit 4. Select + var spots = hotSpots.Where(h => h.Type == HotSpotType.DoubleClick) + .Concat(hotSpots.Where(h => h.Type == HotSpotType.Click)) + .Concat(hotSpots.Where(h => h.Type == HotSpotType.Edit)) + .Concat(hotSpots.Where(h => h.Type == HotSpotType.Select)); + + foreach (var hotSpot in spots) + { + if (hotSpot.Rect.Contains(e.Location)) + { + if (hotSpot.Type == HotSpotType.DoubleClick || hotSpot.Type == HotSpotType.Click) + { + hotSpot.Node.Update(hotSpot); + + invalidate = true; + + break; + } + if (hotSpot.Type == HotSpotType.Edit) + { + hotSpotEditBox.ShowOnHotSpot(hotSpot); + + break; + } + if (hotSpot.Type == HotSpotType.Select) + { + hotSpot.Node.ToggleLevelOpen(hotSpot.Level); + + invalidate = true; + + break; + } + } + } + + if (invalidate) + { + Invalidate(); + } + + base.OnMouseDoubleClick(e); + } + + private Point toolTipPosition; + protected override void OnMouseHover(EventArgs e) + { + Contract.Requires(e != null); + + base.OnMouseHover(e); + + if (selectedNodes.Count > 1) + { + var memorySize = selectedNodes.Sum(h => h.Node.MemorySize); + nodeInfoToolTip.Show($"{selectedNodes.Count} Nodes selected, {memorySize} bytes", this, toolTipPosition.Relocate(16, 16)); + } + else + { + foreach (var spot in hotSpots.Where(h => h.Type == HotSpotType.Select)) + { + if (spot.Rect.Contains(toolTipPosition)) + { + if (spot.Node.UseMemoryPreviewToolTip(spot, out var previewAddress)) + { + memoryPreviewPopUp.InitializeMemory(spot.Process, previewAddress); + + memoryPreviewPopUp.Show(this, toolTipPosition.Relocate(16, 16)); + } + else + { + var text = spot.Node.GetToolTipText(spot); + if (!string.IsNullOrEmpty(text)) + { + nodeInfoToolTip.Show(text, this, toolTipPosition.Relocate(16, 16)); + } + } + + return; + } + } + } + } + + protected override void OnMouseMove(MouseEventArgs e) + { + Contract.Requires(e != null); + + base.OnMouseMove(e); + + if (e.Location != toolTipPosition) + { + toolTipPosition = e.Location; + + nodeInfoToolTip.Hide(this); + + if (memoryPreviewPopUp.Visible) + { + memoryPreviewPopUp.Close(); + + Invalidate(); + } + + ResetMouseEventArgs(); + } + } + + protected override void OnMouseWheel(MouseEventArgs e) + { + hotSpotEditBox.Hide(); + + if (memoryPreviewPopUp.Visible) + { + memoryPreviewPopUp.HandleMouseWheelEvent(e); + } + else + { + base.OnMouseWheel(e); + } + } + + protected override bool ProcessCmdKey(ref Message msg, Keys keyData) + { + if (hotSpotEditBox.Visible == false) // Only process keys if the edit field is not visible. + { + var key = keyData & Keys.KeyCode; + var modifier = keyData & Keys.Modifiers; + + if (selectedNodes.Count > 0) + { + if (key == Keys.Menu) + { + ShowNodeContextMenu(new Point(10, 10)); + + return true; + } + if ((key == Keys.Down || key == Keys.Up) && selectionCaret != null && selectionAnchor != null) + { + HotSpot toSelect; + bool isAtEnd; + + var query = hotSpots + .Where(h => h.Type == HotSpotType.Select) + .Where(h => h.Node.GetParentContainer() == selectionCaret.Node.GetParentContainer()); + + if (key == Keys.Down) + { + var temp = query + .SkipWhile(h => h.Node != selectionCaret.Node) + .Skip(1) + .ToList(); + + toSelect = temp.FirstOrDefault(); + isAtEnd = toSelect != null && toSelect == temp.LastOrDefault(); + } + else + { + var temp = query + .TakeWhile(h => h.Node != selectionCaret.Node) + .ToList(); + + toSelect = temp.LastOrDefault(); + isAtEnd = toSelect != null && toSelect == temp.FirstOrDefault(); + } + + if (toSelect != null && !(toSelect.Node is ClassNode)) + { + if (modifier != Keys.Shift) + { + selectionAnchor = selectionCaret = toSelect; + } + else + { + selectionCaret = toSelect; + } + + var first = Utils.Min(selectionAnchor, selectionCaret, h => h.Node.Offset); + var last = first == selectionAnchor ? selectionCaret : selectionAnchor; + + selectedNodes.ForEach(h => h.Node.ClearSelection()); + selectedNodes.Clear(); + + var containerNode = toSelect.Node.GetParentContainer(); + foreach (var spot in containerNode.Nodes + .SkipWhile(n => n != first.Node) + .TakeWhileInclusive(n => n != last.Node) + .Select(n => new HotSpot + { + Address = (IntPtr)(containerNode.Offset + n.Offset), + Node = n, + Process = toSelect.Process, + Memory = toSelect.Memory, + Level = toSelect.Level + })) + { + spot.Node.IsSelected = true; + selectedNodes.Add(spot); + } + + OnSelectionChanged(); + + if (isAtEnd) + { + const int ScrollAmount = 3; + + var position = AutoScrollPosition; + AutoScrollPosition = new Point(-position.X, -position.Y + (key == Keys.Down ? ScrollAmount : -ScrollAmount) * font.Height); + } + + Invalidate(); + + return true; + } + } + else if (key == Keys.Left || key == Keys.Right) + { + if (selectedNodes.Count == 1) + { + var selected = selectedNodes[0]; + + selected.Node.SetLevelOpen(selected.Level, key == Keys.Right); + } + } + } + else if (key == Keys.Down || key == Keys.Up) + { + // If no node is selected, try to select the first one. + var selection = hotSpots + .Where(h => h.Type == HotSpotType.Select) + .WhereNot(h => h.Node is ClassNode) + .FirstOrDefault(); + if (selection != null) + { + selectionAnchor = selectionCaret = selection; + + selection.Node.IsSelected = true; + + selectedNodes.Add(selection); + + OnSelectionChanged(); + + return true; + } + } + } + + return base.ProcessCmdKey(ref msg, keyData); + } + + #endregion + + #region Event Handler + + protected override void OnSizeChanged(EventArgs e) + { + base.OnSizeChanged(e); + + Invalidate(); + } + + private void repaintTimer_Tick(object sender, EventArgs e) + { + if (DesignMode) + { + return; + } + + Invalidate(false); + } + + private void editBox_Committed(object sender, HotSpotTextBoxCommitEventArgs e) + { + var hotSpot = e.HotSpot; + if (hotSpot != null) + { + try + { + hotSpot.Node.Update(hotSpot); + } + catch (Exception ex) + { + Program.Logger.Log(ex); + } + + Invalidate(); + } + + Focus(); + } + + #endregion + + /// + /// Gets informations about all selected nodes. + /// + /// A list with informations about all selected nodes. + public IReadOnlyList GetSelectedNodes() + { + return selectedNodes + .Select(h => new SelectedNodeInfo(h.Node, h.Process, h.Memory, h.Address, h.Level)) + .ToList(); + } + + /// + /// Selects the given nodes. + /// + /// + public void SetSelectedNodes(IEnumerable nodes) + { + selectedNodes.ForEach(h => h.Node.ClearSelection()); + + selectedNodes.Clear(); + + 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(); + } + + /// + /// Shows the context menu at the given point. + /// + /// The location where the context menu should be shown. + 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) + { + hotSpotEditBox.ShowOnHotSpot(hotSpot); + } + } + + /// + /// Resets the selection state of all selected nodes. + /// + public void ClearSelection() + { + selectionAnchor = selectionCaret = null; + + selectedNodes.ForEach(h => h.Node.ClearSelection()); + + selectedNodes.Clear(); + + OnSelectionChanged(); + + //Invalidate(); + } + + /// + /// Resets the control to the initial state. + /// + public void Reset() + { + ClearSelection(); + + hotSpotEditBox.Hide(); + + VerticalScroll.Value = VerticalScroll.Minimum; + } + } +} diff --git a/ReClass.NET/UI/MemoryViewControl.resx b/ReClass.NET/Controls/MemoryViewControl.resx similarity index 96% rename from ReClass.NET/UI/MemoryViewControl.resx rename to ReClass.NET/Controls/MemoryViewControl.resx index 0d4e9955..49dac163 100644 --- a/ReClass.NET/UI/MemoryViewControl.resx +++ b/ReClass.NET/Controls/MemoryViewControl.resx @@ -117,9 +117,6 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - 17, 17 - 243, 17 diff --git a/ReClass.NET/Controls/NodeClickEventArgs.cs b/ReClass.NET/Controls/NodeClickEventArgs.cs new file mode 100644 index 00000000..3d9dd82f --- /dev/null +++ b/ReClass.NET/Controls/NodeClickEventArgs.cs @@ -0,0 +1,36 @@ +using System; +using System.Diagnostics.Contracts; +using System.Drawing; +using System.Windows.Forms; +using ReClassNET.Memory; +using ReClassNET.Nodes; + +namespace ReClassNET.Controls +{ + public class NodeClickEventArgs : EventArgs + { + public BaseNode Node { get; } + + public IntPtr Address { get; } + + public MemoryBuffer Memory { get; } + + public MouseButtons Button { get; } + + public Point Location { get; } + + public NodeClickEventArgs(BaseNode node, IntPtr address, MemoryBuffer memory, MouseButtons button, Point location) + { + Contract.Requires(node != null); + Contract.Requires(memory != null); + + Node = node; + Address = address; + Memory = memory; + Button = button; + Location = location; + } + } + + public delegate void NodeClickEventHandler(object sender, NodeClickEventArgs args); +} diff --git a/ReClass.NET/Controls/PlaceholderTextBox.cs b/ReClass.NET/Controls/PlaceholderTextBox.cs new file mode 100644 index 00000000..59734c10 --- /dev/null +++ b/ReClass.NET/Controls/PlaceholderTextBox.cs @@ -0,0 +1,75 @@ +using System; +using System.ComponentModel; +using System.Drawing; +using System.Windows.Forms; + +namespace ReClassNET.Controls +{ + public class PlaceholderTextBox : TextBox + { + private Font fontBackup; + private Color foreColorBackup; + private Color backColorBackup; + + /// + /// The color of the placeholder text. + /// + [DefaultValue(typeof(Color), "ControlDarkDark")] + public Color PlaceholderColor { get; set; } = SystemColors.ControlDarkDark; + + /// + /// The placeholder text. + /// + [DefaultValue("")] + public string PlaceholderText { get; set; } + + public PlaceholderTextBox() + { + fontBackup = Font; + foreColorBackup = ForeColor; + backColorBackup = BackColor; + + SetStyle(ControlStyles.UserPaint, true); + } + + protected override void OnTextChanged(EventArgs e) + { + base.OnTextChanged(e); + + if (string.IsNullOrEmpty(Text)) + { + if (!GetStyle(ControlStyles.UserPaint)) + { + fontBackup = Font; + foreColorBackup = ForeColor; + backColorBackup = BackColor; + + SetStyle(ControlStyles.UserPaint, true); + } + } + else + { + if (GetStyle(ControlStyles.UserPaint)) + { + SetStyle(ControlStyles.UserPaint, false); + + Font = fontBackup; + ForeColor = foreColorBackup; + BackColor = backColorBackup; + } + } + } + + protected override void OnPaint(PaintEventArgs e) + { + base.OnPaint(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)); + } + } + } +} diff --git a/ReClass.NET/Controls/ProjectView.Designer.cs b/ReClass.NET/Controls/ProjectView.Designer.cs new file mode 100644 index 00000000..25d6422e --- /dev/null +++ b/ReClass.NET/Controls/ProjectView.Designer.cs @@ -0,0 +1,64 @@ +namespace ReClassNET.Controls +{ + partial class ProjectView + { + /// + /// Erforderliche Designervariable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Verwendete Ressourcen bereinigen. + /// + /// True, wenn verwaltete Ressourcen gelöscht werden sollen; andernfalls False. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Vom Komponenten-Designer generierter Code + + /// + /// Erforderliche Methode für die Designerunterstützung. + /// Der Inhalt der Methode darf nicht mit dem Code-Editor geändert werden. + /// + private void InitializeComponent() + { + this.projectTreeView = new System.Windows.Forms.TreeView(); + this.SuspendLayout(); + // + // projectTreeView + // + this.projectTreeView.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.projectTreeView.Dock = System.Windows.Forms.DockStyle.Fill; + this.projectTreeView.HideSelection = false; + this.projectTreeView.LabelEdit = true; + this.projectTreeView.Location = new System.Drawing.Point(0, 0); + this.projectTreeView.Name = "projectTreeView"; + this.projectTreeView.ShowRootLines = false; + this.projectTreeView.Size = new System.Drawing.Size(150, 150); + this.projectTreeView.TabIndex = 0; + this.projectTreeView.BeforeLabelEdit += new System.Windows.Forms.NodeLabelEditEventHandler(this.projectTreeView_BeforeLabelEdit); + this.projectTreeView.AfterLabelEdit += new System.Windows.Forms.NodeLabelEditEventHandler(this.projectTreeView_AfterLabelEdit); + this.projectTreeView.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.projectTreeView_AfterSelect); + this.projectTreeView.MouseUp += new System.Windows.Forms.MouseEventHandler(this.projectTreeView_MouseUp); + // + // ClassNodeView + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.projectTreeView); + this.Name = "ClassNodeView"; + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.TreeView projectTreeView; + } +} diff --git a/ReClass.NET/Controls/ProjectView.cs b/ReClass.NET/Controls/ProjectView.cs new file mode 100644 index 00000000..f1b12261 --- /dev/null +++ b/ReClass.NET/Controls/ProjectView.cs @@ -0,0 +1,538 @@ +using System.Collections; +using System.Collections.Generic; +using System.ComponentModel; +using System.Diagnostics.Contracts; +using System.Linq; +using System.Windows.Forms; +using ReClassNET.Extensions; +using ReClassNET.Nodes; +using ReClassNET.Project; + +namespace ReClassNET.Controls +{ + public partial class ProjectView : UserControl + { + /// A custom tree node for class nodes with hierarchical structure. + private class ClassTreeNode : TreeNode + { + private readonly ProjectView control; + + public ClassNode ClassNode { get; } + + /// Constructor of the class. + /// The class node. + /// The instance this node should belong to. + public ClassTreeNode(ClassNode node, ProjectView control) + : this(node, control, null) + { + Contract.Requires(node != null); + Contract.Requires(control != null); + } + + private ClassTreeNode(ClassNode node, ProjectView control, HashSet seen) + { + Contract.Requires(node != null); + Contract.Requires(control != null); + + ClassNode = node; + + this.control = control; + + Text = node.Name; + + ImageIndex = 1; + SelectedImageIndex = 1; + + RebuildClassHierarchy(seen ?? new HashSet { ClassNode }); + } + + public void Update() + { + Text = ClassNode.Name; + + RebuildClassHierarchy(new HashSet { ClassNode }); + } + + /// Rebuilds the class hierarchy. + /// The already seen classes. + private void RebuildClassHierarchy(HashSet seen) + { + Contract.Requires(seen != null); + + if (!control.EnableClassHierarchyView) + { + return; + } + + var distinctClasses = ClassNode.Nodes + .OfType() + .Select(w => w.ResolveMostInnerNode()) + .OfType() + .Distinct() + .ToList(); + + if (distinctClasses.IsEquivalentTo(Nodes.Cast().Select(t => t.ClassNode))) + { + return; + } + + Nodes.Clear(); + + foreach (var child in distinctClasses) + { + var childSeen = new HashSet(seen); + if (childSeen.Add(child)) + { + Nodes.Add(new ClassTreeNode(child, control, childSeen)); + } + } + + if (control.AutoExpandClassNodes) + { + Expand(); + } + } + } + + public class EnumTreeNode : TreeNode + { + public EnumDescription Enum { get; } + + public EnumTreeNode(EnumDescription @enum) + { + Contract.Requires(@enum != null); + + Enum = @enum; + + ImageIndex = 3; + SelectedImageIndex = 3; + + Update(); + } + + public void Update() + { + Text = Enum.Name; + } + } + + private class NodeSorter : IComparer + { + public int Compare(object x, object y) + { + var compare = Application.CurrentCulture.CompareInfo; + + if (x is ClassTreeNode cn1 && y is ClassTreeNode cn2) + { + return compare.Compare(cn1.Text, cn2.Text); + } + if (x is EnumTreeNode en1 && y is EnumTreeNode en2) + { + return compare.Compare(en1.Text, en2.Text); + } + if (x is TreeNode tn1 && tn1.Parent == null && y is TreeNode tn2 && tn2.Parent == null) + { + return (int)tn1.Tag - (int)tn2.Tag; + } + + return 0; + } + } + + private readonly TreeNode enumsRootNode; + private readonly TreeNode classesRootNode; + + private ClassNode selectedClass; + + private bool autoExpandClassNodes; + private bool enableClassHierarchyView; + + public delegate void SelectionChangedEvent(object sender, ClassNode node); + public event SelectionChangedEvent SelectionChanged; + + [Browsable(false)] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public ClassNode SelectedClass + { + get => selectedClass; + set + { + if (selectedClass != value) + { + selectedClass = value; + if (selectedClass != null) + { + projectTreeView.SelectedNode = FindMainClassTreeNode(selectedClass); + } + + SelectionChanged?.Invoke(this, selectedClass); + } + } + } + + [Browsable(false)] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public EnumDescription SelectedEnum { get; private set; } + + [DefaultValue(false)] + public bool AutoExpandClassNodes + { + get => autoExpandClassNodes; + set + { + if (autoExpandClassNodes != value) + { + autoExpandClassNodes = value; + + if (autoExpandClassNodes) + { + ExpandAllClassNodes(); + } + } + } + } + + [DefaultValue(false)] + public bool EnableClassHierarchyView + { + get => enableClassHierarchyView; + set + { + if (enableClassHierarchyView != value) + { + enableClassHierarchyView = value; + + var classes = classesRootNode.Nodes.Cast().Select(t => t.ClassNode).ToList(); + + classesRootNode.Nodes.Clear(); + + AddClasses(classes); + } + } + } + + public ContextMenuStrip ClassesContextMenuStrip { get; set; } + + public ContextMenuStrip ClassContextMenuStrip { get; set; } + + public ContextMenuStrip EnumsContextMenuStrip { get; set; } + + public ContextMenuStrip EnumContextMenuStrip { get; set; } + + public ProjectView() + { + Contract.Ensures(classesRootNode != null); + Contract.Ensures(enumsRootNode != null); + + InitializeComponent(); + + DoubleBuffered = true; + + projectTreeView.TreeViewNodeSorter = new NodeSorter(); + projectTreeView.ImageList = new ImageList(); + projectTreeView.ImageList.Images.Add(Properties.Resources.B16x16_Text_List_Bullets); + projectTreeView.ImageList.Images.Add(Properties.Resources.B16x16_Class_Type); + projectTreeView.ImageList.Images.Add(Properties.Resources.B16x16_Category); + projectTreeView.ImageList.Images.Add(Properties.Resources.B16x16_Enum_Type); + + classesRootNode = new TreeNode + { + Text = "Classes", + ImageIndex = 0, + SelectedImageIndex = 0, + Tag = 0 + }; + + projectTreeView.Nodes.Add(classesRootNode); + + enumsRootNode = new TreeNode + { + Text = "Enums", + ImageIndex = 2, + SelectedImageIndex = 2, + Tag = 1 + }; + + projectTreeView.Nodes.Add(enumsRootNode); + } + + #region Event Handler + + private void projectTreeView_AfterSelect(object sender, TreeViewEventArgs e) + { + if (e.Node.Level == 0) + { + return; + } + + if (e.Node is ClassTreeNode classTreeNode) + { + if (selectedClass != classTreeNode.ClassNode) + { + SelectedClass = classTreeNode.ClassNode; + } + } + else if (e.Node is EnumTreeNode enumTreeNode) + { + SelectedEnum = enumTreeNode.Enum; + } + } + + private void projectTreeView_MouseUp(object sender, MouseEventArgs e) + { + if (e.Button != MouseButtons.Right) + { + return; + } + + var node = projectTreeView.GetNodeAt(e.X, e.Y); + if (node == null) + { + return; + } + + ContextMenuStrip cms = null; + if (node == classesRootNode) + { + cms = ClassesContextMenuStrip; + } + else if (node is ClassTreeNode) + { + cms = ClassContextMenuStrip; + + projectTreeView.SelectedNode = node; + } + else if (node == enumsRootNode) + { + cms = EnumsContextMenuStrip; + } + else if (node is EnumTreeNode) + { + cms = EnumContextMenuStrip; + + projectTreeView.SelectedNode = node; + } + cms?.Show(projectTreeView, e.Location); + } + + private void projectTreeView_BeforeLabelEdit(object sender, NodeLabelEditEventArgs e) + { + var isClassTreeNode = e.Node is ClassTreeNode; + var isEnumTreeNode = e.Node is EnumTreeNode; + e.CancelEdit = !isClassTreeNode && !isEnumTreeNode; + } + + private void projectTreeView_AfterLabelEdit(object sender, NodeLabelEditEventArgs e) + { + if (!string.IsNullOrEmpty(e.Label)) + { + if (e.Node is ClassTreeNode classTreeNode) + { + classTreeNode.ClassNode.Name = e.Label; + } + else if (e.Node is EnumTreeNode enumTreeNode) + { + enumTreeNode.Enum.Name = e.Label; + } + } + } + + #endregion + + public void ExpandAllClassNodes() + { + classesRootNode.ExpandAll(); + } + + public void CollapseAllClassNodes() + { + foreach (var tn in classesRootNode.Nodes.Cast()) + { + tn.Collapse(); + } + } + + /// + /// Clears all displayed nodes. + /// + public void Clear() + { + Clear(true, true); + } + + /// + /// Clears the selected nodes. + /// + /// Clears the classes if set. + /// Clears the enums if set. + public void Clear(bool clearClasses, bool clearEnums) + { + if (clearClasses) + { + classesRootNode.Nodes.Clear(); + } + + if (clearEnums) + { + enumsRootNode.Nodes.Clear(); + } + } + + /// Adds the class to the view. + /// The class to add. + public void AddClass(ClassNode @class) + { + Contract.Requires(@class != null); + + AddClasses(new[] { @class }); + } + + /// + /// Adds all classes to the view. + /// + /// The classes to add. + public void AddClasses(IEnumerable classes) + { + Contract.Requires(classes != null); + + projectTreeView.BeginUpdate(); + + foreach (var @class in classes) + { + classesRootNode.Nodes.Add(new ClassTreeNode(@class, this)); + } + + classesRootNode.Expand(); + + projectTreeView.Sort(); + + projectTreeView.EndUpdate(); + } + + /// Removes the class from the view. + /// The class to remove. + public void RemoveClass(ClassNode node) + { + Contract.Requires(node != null); + + foreach (var tn in FindClassTreeNodes(node)) + { + tn.Remove(); + } + + if (selectedClass == node) + { + if (classesRootNode.Nodes.Count > 0) + { + projectTreeView.SelectedNode = classesRootNode.Nodes[0]; + } + else + { + SelectedClass = null; + } + } + } + + /// Searches for the which represents the class. + /// The class to search. + /// The found class tree node. + private ClassTreeNode FindMainClassTreeNode(ClassNode node) + { + Contract.Requires(node != null); + + return classesRootNode.Nodes + .Cast() + .FirstOrDefault(t => t.ClassNode == node); + } + + /// Searches for the ClassTreeNode which represents the class. + /// The class to search. + /// The found class tree node. + private IEnumerable FindClassTreeNodes(ClassNode node) + { + Contract.Requires(node != null); + + return classesRootNode.Nodes + .Cast() + .Traverse(t => t.Nodes.Cast()) + .Where(n => n.ClassNode == node); + } + + /// + /// Updates the display for the given class. + /// + /// The class to update. + public void UpdateClassNode(ClassNode @class) + { + Contract.Requires(@class != null); + + projectTreeView.BeginUpdate(); + + foreach (var tn in FindClassTreeNodes(@class)) + { + tn.Update(); + } + + projectTreeView.Sort(); + + projectTreeView.EndUpdate(); + } + + /// Adds the enum to the view. + /// The enum to add. + public void AddEnum(EnumDescription @enum) + { + Contract.Requires(@enum != null); + + AddEnums(new[] { @enum }); + } + + /// Adds the enums to the view. + /// The enums to add. + public void AddEnums(IEnumerable enums) + { + Contract.Requires(enums != null); + + projectTreeView.BeginUpdate(); + + foreach (var @enum in enums) + { + enumsRootNode.Nodes.Add(new EnumTreeNode(@enum)); + } + + enumsRootNode.ExpandAll(); + + projectTreeView.Sort(); + + projectTreeView.EndUpdate(); + } + + /// + /// Updates the display for the given enum. + /// + /// The enum to update. + public void UpdateEnumNode(EnumDescription @enum) + { + Contract.Requires(@enum != null); + + projectTreeView.BeginUpdate(); + + var node = enumsRootNode.Nodes + .Cast() + .FirstOrDefault(n => n.Enum == @enum); + + if (node != null) + { + node.Update(); + } + else + { + AddEnum(@enum); + } + + projectTreeView.Sort(); + + projectTreeView.EndUpdate(); + } + } +} diff --git a/ReClass.NET/UI/ClassNodeView.resx b/ReClass.NET/Controls/ProjectView.resx similarity index 93% rename from ReClass.NET/UI/ClassNodeView.resx rename to ReClass.NET/Controls/ProjectView.resx index a6b10143..1af7de15 100644 --- a/ReClass.NET/UI/ClassNodeView.resx +++ b/ReClass.NET/Controls/ProjectView.resx @@ -117,10 +117,4 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - 17, 17 - - - 193, 17 - \ No newline at end of file diff --git a/ReClass.NET/Core/CoreFunctionsManager.cs b/ReClass.NET/Core/CoreFunctionsManager.cs index 7346b563..92af4d6e 100644 --- a/ReClass.NET/Core/CoreFunctionsManager.cs +++ b/ReClass.NET/Core/CoreFunctionsManager.cs @@ -2,10 +2,11 @@ using System.Collections.Generic; using System.Diagnostics.Contracts; using System.IO; +using System.Linq; using System.Windows.Forms; using ReClassNET.Debugger; +using ReClassNET.Extensions; using ReClassNET.Memory; -using ReClassNET.Util; namespace ReClassNET.Core { @@ -13,12 +14,19 @@ public class CoreFunctionsManager : IDisposable { private readonly Dictionary functionsRegistry = new Dictionary(); - public IEnumerable FunctionProviders => functionsRegistry.Keys; - private readonly InternalCoreFunctions internalCoreFunctions; private ICoreProcessFunctions currentFunctions; + public IEnumerable FunctionProviders => functionsRegistry.Keys; + + public ICoreProcessFunctions CurrentFunctions => currentFunctions; + + public string CurrentFunctionsProvider => functionsRegistry + .Where(kv => kv.Value == currentFunctions) + .Select(kv => kv.Key) + .FirstOrDefault(); + public CoreFunctionsManager() { internalCoreFunctions = InternalCoreFunctions.Create(); diff --git a/ReClass.NET/Core/IInternalCoreFunctions.cs b/ReClass.NET/Core/IInternalCoreFunctions.cs new file mode 100644 index 00000000..e1418f14 --- /dev/null +++ b/ReClass.NET/Core/IInternalCoreFunctions.cs @@ -0,0 +1,16 @@ +using System; +using System.Windows.Forms; + +namespace ReClassNET.Core +{ + public interface IInternalCoreFunctions + { + bool DisassembleCode(IntPtr address, int length, IntPtr virtualAddress, bool determineStaticInstructionBytes, EnumerateInstructionCallback callback); + + IntPtr InitializeInput(); + + Keys[] GetPressedKeys(IntPtr handle); + + void ReleaseInput(IntPtr handle); + } +} diff --git a/ReClass.NET/Core/InternalCoreFunctions.cs b/ReClass.NET/Core/InternalCoreFunctions.cs index 3112fa54..0e1494b3 100644 --- a/ReClass.NET/Core/InternalCoreFunctions.cs +++ b/ReClass.NET/Core/InternalCoreFunctions.cs @@ -2,6 +2,7 @@ using System.IO; using System.Runtime.InteropServices; using System.Windows.Forms; +using ReClassNET.Extensions; using ReClassNET.Native; using ReClassNET.Util; @@ -9,7 +10,7 @@ namespace ReClassNET.Core { public delegate bool EnumerateInstructionCallback(ref InstructionData data); - internal class InternalCoreFunctions : NativeCoreWrapper, IDisposable + internal class InternalCoreFunctions : NativeCoreWrapper, IInternalCoreFunctions, IDisposable { private const string CoreFunctionsModuleWindows = "NativeCore.dll"; private const string CoreFunctionsModuleUnix = "NativeCore.so"; @@ -51,7 +52,7 @@ public static InternalCoreFunctions Create() var handle = NativeMethods.LoadLibrary(libraryPath); if (handle.IsNull()) { - throw new FileNotFoundException(libraryPath); + throw new FileNotFoundException($"Failed to load native core functions! Couldnt find at location {libraryPath}"); } return new InternalCoreFunctions(handle); diff --git a/ReClass.NET/Core/NativeCoreWrapper.cs b/ReClass.NET/Core/NativeCoreWrapper.cs index 17a0acaf..bdca5954 100644 --- a/ReClass.NET/Core/NativeCoreWrapper.cs +++ b/ReClass.NET/Core/NativeCoreWrapper.cs @@ -1,8 +1,8 @@ using System; using System.Runtime.InteropServices; using ReClassNET.Debugger; +using ReClassNET.Extensions; using ReClassNET.Native; -using ReClassNET.Util; namespace ReClassNET.Core { diff --git a/ReClass.NET/DataExchange/ReClass/CustomNodeConverter.cs b/ReClass.NET/DataExchange/ReClass/CustomNodeSerializer.cs similarity index 58% rename from ReClass.NET/DataExchange/ReClass/CustomNodeConverter.cs rename to ReClass.NET/DataExchange/ReClass/CustomNodeSerializer.cs index fe55c58f..53797944 100644 --- a/ReClass.NET/DataExchange/ReClass/CustomNodeConverter.cs +++ b/ReClass.NET/DataExchange/ReClass/CustomNodeSerializer.cs @@ -8,8 +8,11 @@ namespace ReClassNET.DataExchange.ReClass { - [ContractClass(typeof(CustomNodeConverterContract))] - public interface ICustomNodeConverter + public delegate BaseNode CreateNodeFromElementHandler(XElement element, BaseNode parent, ILogger logger); + public delegate XElement CreateElementFromNodeHandler(BaseNode node, ILogger logger); + + [ContractClass(typeof(CustomNodeSerializerContract))] + public interface ICustomNodeSerializer { /// Determine if the instance can handle the xml element. /// The xml element to check. @@ -26,19 +29,20 @@ public interface ICustomNodeConverter /// The parent of the node. /// The list of classes which correspond to the node. /// The logger used to output messages. - /// [out] The node for the xml element. - /// True if a node was created, otherwise false. - bool TryCreateNodeFromElement(XElement element, ClassNode parent, IEnumerable classes, ILogger logger, out BaseNode node); + /// The default method which creates a node from an element. Should be called to resolve nodes for wrapped inner nodes. + /// The node for the xml element. + BaseNode CreateNodeFromElement(XElement element, BaseNode parent, IEnumerable classes, ILogger logger, CreateNodeFromElementHandler defaultHandler); /// Creates a xml element from the node. This method gets only called if returned true. /// The node to create the xml element from. /// The logger used to output messages. + /// The default method which creates an element for a node. Should be called to resolve elements for wrapped inner nodes. /// The xml element for the node. - XElement CreateElementFromNode(BaseNode node, ILogger logger); + XElement CreateElementFromNode(BaseNode node, ILogger logger, CreateElementFromNodeHandler defaultHandler); } - [ContractClassFor(typeof(ICustomNodeConverter))] - internal abstract class CustomNodeConverterContract : ICustomNodeConverter + [ContractClassFor(typeof(ICustomNodeSerializer))] + internal abstract class CustomNodeSerializerContract : ICustomNodeSerializer { public bool CanHandleElement(XElement element) { @@ -54,7 +58,7 @@ public bool CanHandleNode(BaseNode node) throw new NotImplementedException(); } - public bool TryCreateNodeFromElement(XElement element, ClassNode parent, IEnumerable classes, ILogger logger, out BaseNode node) + public BaseNode CreateNodeFromElement(XElement element, BaseNode parent, IEnumerable classes, ILogger logger, CreateNodeFromElementHandler defaultHandler) { Contract.Requires(element != null); Contract.Requires(CanHandleElement(element)); @@ -62,47 +66,49 @@ public bool TryCreateNodeFromElement(XElement element, ClassNode parent, IEnumer Contract.Requires(classes != null); Contract.Requires(Contract.ForAll(classes, c => c != null)); Contract.Requires(logger != null); + Contract.Requires(defaultHandler != null); throw new NotImplementedException(); } - public XElement CreateElementFromNode(BaseNode node, ILogger logger) + public XElement CreateElementFromNode(BaseNode node, ILogger logger, CreateElementFromNodeHandler defaultHandler) { Contract.Requires(node != null); Contract.Requires(CanHandleNode(node)); Contract.Requires(logger != null); + Contract.Requires(defaultHandler != null); Contract.Ensures(Contract.Result() != null); throw new NotImplementedException(); } } - public class CustomNodeConvert + internal class CustomNodeSerializer { - private static readonly List converters = new List(); + private static readonly List converters = new List(); - public static void RegisterCustomType(ICustomNodeConverter converter) + public static void Add(ICustomNodeSerializer serializer) { - Contract.Requires(converter != null); + Contract.Requires(serializer != null); - converters.Add(converter); + converters.Add(serializer); } - public static void DeregisterCustomType(ICustomNodeConverter converter) + public static void Remove(ICustomNodeSerializer serializer) { - Contract.Requires(converter != null); + Contract.Requires(serializer != null); - converters.Remove(converter); + converters.Remove(serializer); } - public static ICustomNodeConverter GetReadConverter(XElement element) + public static ICustomNodeSerializer GetReadConverter(XElement element) { Contract.Requires(element != null); return converters.FirstOrDefault(c => c.CanHandleElement(element)); } - public static ICustomNodeConverter GetWriteConverter(BaseNode node) + public static ICustomNodeSerializer GetWriteConverter(BaseNode node) { Contract.Requires(node != null); diff --git a/ReClass.NET/DataExchange/ReClass/Legacy/BaseClassArrayNode.cs b/ReClass.NET/DataExchange/ReClass/Legacy/BaseClassArrayNode.cs new file mode 100644 index 00000000..0871658d --- /dev/null +++ b/ReClass.NET/DataExchange/ReClass/Legacy/BaseClassArrayNode.cs @@ -0,0 +1,34 @@ +using System; +using System.Drawing; +using ReClassNET.Controls; +using ReClassNET.Nodes; + +namespace ReClassNET.DataExchange.ReClass.Legacy +{ + public abstract class BaseClassArrayNode : BaseWrapperNode + { + public override int MemorySize => throw new NotImplementedException(); + + public override void GetUserInterfaceInfo(out string name, out Image icon) + { + throw new NotImplementedException(); + } + + public override int CalculateDrawnHeight(DrawContext context) + { + throw new NotImplementedException(); + } + + public override Size Draw(DrawContext context, int x, int y) + { + throw new NotImplementedException(); + } + + public override bool CanChangeInnerNodeTo(BaseNode node) + { + return node is ClassNode; + } + + public abstract BaseNode GetEquivalentNode(int count, ClassNode classNode); + } +} diff --git a/ReClass.NET/DataExchange/ReClass/Legacy/ClassInstanceArrayNode.cs b/ReClass.NET/DataExchange/ReClass/Legacy/ClassInstanceArrayNode.cs new file mode 100644 index 00000000..02b75995 --- /dev/null +++ b/ReClass.NET/DataExchange/ReClass/Legacy/ClassInstanceArrayNode.cs @@ -0,0 +1,21 @@ +using ReClassNET.Nodes; + +namespace ReClassNET.DataExchange.ReClass.Legacy +{ + public class ClassInstanceArrayNode : BaseClassArrayNode + { + protected override bool PerformCycleCheck => true; + + public override BaseNode GetEquivalentNode(int count, ClassNode classNode) + { + var classInstanceNode = new ClassInstanceNode(); + classInstanceNode.ChangeInnerNode(classNode); + + var arrayNode = new ArrayNode { Count = count }; + arrayNode.ChangeInnerNode(classInstanceNode); + arrayNode.CopyFromNode(this); + + return arrayNode; + } + } +} diff --git a/ReClass.NET/DataExchange/ReClass/Legacy/ClassPointerArrayNode.cs b/ReClass.NET/DataExchange/ReClass/Legacy/ClassPointerArrayNode.cs new file mode 100644 index 00000000..2e5ee2da --- /dev/null +++ b/ReClass.NET/DataExchange/ReClass/Legacy/ClassPointerArrayNode.cs @@ -0,0 +1,24 @@ +using ReClassNET.Nodes; + +namespace ReClassNET.DataExchange.ReClass.Legacy +{ + public class ClassPointerArrayNode : BaseClassArrayNode + { + protected override bool PerformCycleCheck => false; + + public override BaseNode GetEquivalentNode(int count, ClassNode classNode) + { + var classInstanceNode = new ClassInstanceNode(); + classInstanceNode.ChangeInnerNode(classNode); + + var pointerNode = new PointerNode(); + pointerNode.ChangeInnerNode(classInstanceNode); + + var arrayNode = new ArrayNode { Count = count }; + arrayNode.ChangeInnerNode(pointerNode); + arrayNode.CopyFromNode(this); + + return arrayNode; + } + } +} diff --git a/ReClass.NET/DataExchange/ReClass/Legacy/ClassPointerNode.cs b/ReClass.NET/DataExchange/ReClass/Legacy/ClassPointerNode.cs new file mode 100644 index 00000000..243707e8 --- /dev/null +++ b/ReClass.NET/DataExchange/ReClass/Legacy/ClassPointerNode.cs @@ -0,0 +1,46 @@ +using System; +using System.Drawing; +using ReClassNET.Controls; +using ReClassNET.Nodes; + +namespace ReClassNET.DataExchange.ReClass.Legacy +{ + public class ClassPointerNode : BaseWrapperNode + { + public override int MemorySize => throw new NotImplementedException(); + + public override void GetUserInterfaceInfo(out string name, out Image icon) + { + throw new NotImplementedException(); + } + + public override int CalculateDrawnHeight(DrawContext context) + { + throw new NotImplementedException(); + } + + public override Size Draw(DrawContext context, int x, int y) + { + throw new NotImplementedException(); + } + + protected override bool PerformCycleCheck => false; + + public override bool CanChangeInnerNodeTo(BaseNode node) + { + return node is ClassNode; + } + + public BaseNode GetEquivalentNode(ClassNode classNode) + { + var classInstanceNode = new ClassInstanceNode(); + classInstanceNode.ChangeInnerNode(classNode); + + var pointerNode = new PointerNode(); + pointerNode.ChangeInnerNode(classInstanceNode); + pointerNode.CopyFromNode(this); + + return pointerNode; + } + } +} diff --git a/ReClass.NET/DataExchange/ReClass/Legacy/CustomNode.cs b/ReClass.NET/DataExchange/ReClass/Legacy/CustomNode.cs new file mode 100644 index 00000000..0645f860 --- /dev/null +++ b/ReClass.NET/DataExchange/ReClass/Legacy/CustomNode.cs @@ -0,0 +1,61 @@ +using System; +using System.Collections.Generic; +using System.Drawing; +using ReClassNET.Controls; +using ReClassNET.Nodes; + +namespace ReClassNET.DataExchange.ReClass.Legacy +{ + public class CustomNode : BaseNode + { + public override int MemorySize => throw new NotImplementedException(); + + public override void GetUserInterfaceInfo(out string name, out Image icon) + { + throw new NotImplementedException(); + } + + public override int CalculateDrawnHeight(DrawContext context) + { + throw new NotImplementedException(); + } + + public override Size Draw(DrawContext context, int x, int y) + { + throw new NotImplementedException(); + } + + public IEnumerable GetEquivalentNodes(int size) + { + while (size != 0) + { + BaseNode paddingNode; +#if RECLASSNET64 + if (size >= 8) + { + paddingNode = new Hex64Node(); + } + else +#endif + if (size >= 4) + { + paddingNode = new Hex32Node(); + } + else if (size >= 2) + { + paddingNode = new Hex16Node(); + } + else + { + paddingNode = new Hex8Node(); + } + + paddingNode.Comment = Comment; + + size -= paddingNode.MemorySize; + + yield return paddingNode; + } + } + } +} diff --git a/ReClass.NET/DataExchange/ReClass/ReClass2007File.cs b/ReClass.NET/DataExchange/ReClass/ReClass2007File.cs deleted file mode 100644 index 77ef0c2e..00000000 --- a/ReClass.NET/DataExchange/ReClass/ReClass2007File.cs +++ /dev/null @@ -1,202 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Data; -using System.Data.SQLite; -using System.Diagnostics.Contracts; -using System.Linq; -using ReClassNET.Logger; -using ReClassNET.Nodes; -using ReClassNET.Util; - -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(ClassPtrNode), - 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 VTableNode(); - - Query(connection, $"SELECT variable, comment FROM class{id} WHERE type = 16") - .Select(e => new VMethodNode - { - 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 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 = Activator.CreateInstance(nodeType) as BaseNode; - 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"]); - - if (node is BaseReferenceNode referenceNode) - { - 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 (referenceNode.PerformCycleCheck && !ClassUtil.IsCycleFree(parent, innerClassNode, project.Classes)) - { - logger.Log(LogLevel.Error, $"Skipping node with cycle reference: {parent.Name}->{node.Name}"); - - continue; - } - - referenceNode.ChangeInnerNode(innerClassNode); - } - if (node is BaseTextNode textNode) - { - textNode.Length = Math.Max(IntPtr.Size, Convert.ToInt32(row["length"])); - } - - yield return node; - } - } - - private 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/DataExchange/ReClass/ReClassClipboard.cs b/ReClass.NET/DataExchange/ReClass/ReClassClipboard.cs index 2ac42690..908040c9 100644 --- a/ReClass.NET/DataExchange/ReClass/ReClassClipboard.cs +++ b/ReClass.NET/DataExchange/ReClass/ReClassClipboard.cs @@ -5,6 +5,7 @@ using System.Windows.Forms; using ReClassNET.Logger; using ReClassNET.Nodes; +using ReClassNET.Project; namespace ReClassNET.DataExchange.ReClass { @@ -24,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.WriteNodes(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. @@ -42,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.ReadNodes(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/ReClassFile.cs b/ReClass.NET/DataExchange/ReClass/ReClassFile.cs index 1fc61cdb..9bb01985 100644 --- a/ReClass.NET/DataExchange/ReClass/ReClassFile.cs +++ b/ReClass.NET/DataExchange/ReClass/ReClassFile.cs @@ -1,13 +1,13 @@ using System; using System.Collections.Generic; using System.Diagnostics.Contracts; -using System.Drawing; using System.Linq; using System.Xml.Linq; +using ReClassNET.DataExchange.ReClass.Legacy; +using ReClassNET.Extensions; using ReClassNET.Logger; using ReClassNET.Nodes; -using ReClassNET.UI; -using ReClassNET.Util; +using ReClassNET.Project; namespace ReClassNET.DataExchange.ReClass { @@ -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); } } @@ -154,7 +154,7 @@ private IEnumerable ReadNodeElements(IEnumerable elements, C continue; } - var node = Activator.CreateInstance(nodeType) as BaseNode; + var node = BaseNode.CreateInstanceFromType(nodeType, false); if (node == null) { logger.Log(LogLevel.Error, $"Could not create node of type: {nodeType}"); @@ -163,54 +163,41 @@ private IEnumerable ReadNodeElements(IEnumerable elements, C } node.Name = element.Attribute("Name")?.Value ?? string.Empty; - node.Comment = element.Attribute("Comments")?.Value ?? string.Empty; + node.Comment = element.Attribute("Comment")?.Value ?? string.Empty; + node.IsHidden = element.Attribute("bHidden")?.Value.Equals("1") ?? false; // Convert the Custom node into normal hex nodes. - if (node is CustomNode) + if (node is CustomNode customNode) { int.TryParse(element.Attribute("Size")?.Value, out var size); - while (size != 0) + foreach (var paddingNode in customNode.GetEquivalentNodes(size)) { - BaseNode paddingNode; -#if RECLASSNET64 - if (size >= 8) - { - paddingNode = new Hex64Node(); - } - else -#endif - if (size >= 4) - { - paddingNode = new Hex32Node(); - } - else if (size >= 2) - { - paddingNode = new Hex16Node(); - } - else - { - paddingNode = new Hex8Node(); - } - - paddingNode.Comment = node.Comment; - - size -= paddingNode.MemorySize; - yield return paddingNode; } continue; } - if (node is BaseReferenceNode referenceNode) + // ClassInstanceNode, ClassPointerNode, ClassInstanceArrayNode, ClassPointerArrayNode + if (node is BaseWrapperNode baseWrapperNode) { string reference; - if (referenceNode is ClassInstanceArrayNode) + int arrayCount = 0; + if (node is BaseClassArrayNode) // ClassInstanceArrayNode, ClassPointerArrayNode { reference = element.Element("Array")?.Attribute("Name")?.Value; + + if (node is ClassInstanceArrayNode) + { + TryGetAttributeValue(element, "Total", out arrayCount, logger); + } + else + { + TryGetAttributeValue(element, "Count", out arrayCount, logger); + } } - else + else // ClassInstanceNode, ClassPointerNode { reference = element.Attribute("Pointer")?.Value ?? element.Attribute("Instance")?.Value; } @@ -224,40 +211,41 @@ private IEnumerable ReadNodeElements(IEnumerable elements, C } var innerClassNode = classes[reference]; - if (referenceNode.PerformCycleCheck && !ClassUtil.IsCycleFree(parent, innerClassNode, project.Classes)) + if (baseWrapperNode.ShouldPerformCycleCheckForInnerNode() && !ClassUtil.IsCyclicIfClassIsAccessibleFromParent(parent, innerClassNode, project.Classes)) { logger.Log(LogLevel.Error, $"Skipping node with cycle reference: {parent.Name}->{node.Name}"); continue; } - referenceNode.ChangeInnerNode(innerClassNode); + // ClassPointerNode, ClassInstanceArrayNode and ClassPointerArrayNode need to be converted to supported nodes. + if (node is BaseClassArrayNode classArrayNode) // ClassInstanceArrayNode, ClassPointerArrayNode + { + node = classArrayNode.GetEquivalentNode(arrayCount, innerClassNode); + } + else if (node is ClassPointerNode classPointerNode) // ClassPointerNode + { + node = classPointerNode.GetEquivalentNode(innerClassNode); + } + else // ClassInstanceNode, ClassPointerNode + { + baseWrapperNode.ChangeInnerNode(innerClassNode); + } } switch (node) { - case VTableNode vtableNode: + case VirtualMethodTableNode vtableNode: element .Elements("Function") - .Select(e => new VMethodNode + .Select(e => new VirtualMethodNode { Name = e.Attribute("Name")?.Value ?? string.Empty, - Comment = e.Attribute("Comments")?.Value ?? string.Empty + Comment = e.Attribute("Comment")?.Value ?? string.Empty, + IsHidden = e.Attribute("bHidden")?.Value.Equals("1") ?? false }) .ForEach(vtableNode.AddNode); break; - case ClassInstanceArrayNode classInstanceArrayNode: - { - TryGetAttributeValue(element, "Total", out var count, logger); - classInstanceArrayNode.Count = count; - break; - } - case ClassPtrArrayNode classPtrArrayNode: - { - TryGetAttributeValue(element, "Size", out var count, logger); - classPtrArrayNode.Count = count / IntPtr.Size; - break; - } case BaseTextNode textNode: { TryGetAttributeValue(element, "Size", out var length, logger); @@ -287,25 +275,9 @@ private static void TryGetAttributeValue(XElement element, string attribute, out } } - /// Dummy node to represent the ReClass Custom node. - private class CustomNode : BaseNode - { - public override int MemorySize => throw new NotImplementedException(); - - public override int CalculateDrawnHeight(ViewInfo view) - { - throw new NotImplementedException(); - } - - public override Size Draw(ViewInfo view, int x, int y) - { - throw new NotImplementedException(); - } - } - #region ReClass 2011 / ReClass 2013 - private static readonly Type[] typeMap2013 = new Type[] + private static readonly Type[] typeMap2013 = { null, typeof(ClassInstanceNode), @@ -314,7 +286,7 @@ public override Size Draw(ViewInfo view, int x, int y) typeof(Hex32Node), typeof(Hex16Node), typeof(Hex8Node), - typeof(ClassPtrNode), + typeof(ClassPointerNode), typeof(Int32Node), typeof(Int16Node), typeof(Int8Node), @@ -329,7 +301,7 @@ public override Size Draw(ViewInfo view, int x, int y) typeof(Vector3Node), typeof(Vector4Node), typeof(Matrix4x4Node), - typeof(VTableNode), + typeof(VirtualMethodTableNode), typeof(ClassInstanceArrayNode), null, null, @@ -337,14 +309,14 @@ public override Size Draw(ViewInfo view, int x, int y) typeof(Int64Node), typeof(DoubleNode), typeof(Utf16TextNode), - typeof(ClassPtrArrayNode) + typeof(ClassPointerArrayNode) }; #endregion #region ReClass 2015 / ReClass 2016 - private static readonly Type[] typeMap2016 = new Type[] + private static readonly Type[] typeMap2016 = { null, typeof(ClassInstanceNode), @@ -354,7 +326,7 @@ public override Size Draw(ViewInfo view, int x, int y) typeof(Hex64Node), typeof(Hex16Node), typeof(Hex8Node), - typeof(ClassPtrNode), + typeof(ClassPointerNode), typeof(Int64Node), typeof(Int32Node), typeof(Int16Node), @@ -372,7 +344,7 @@ public override Size Draw(ViewInfo view, int x, int y) typeof(Vector3Node), typeof(Vector4Node), typeof(Matrix4x4Node), - typeof(VTableNode), + typeof(VirtualMethodTableNode), typeof(ClassInstanceArrayNode), null, typeof(Utf8TextPtrNode), diff --git a/ReClass.NET/DataExchange/ReClass/ReClassNetFile.Constants.cs b/ReClass.NET/DataExchange/ReClass/ReClassNetFile.Constants.cs index af43976c..d44c645f 100644 --- a/ReClass.NET/DataExchange/ReClass/ReClassNetFile.Constants.cs +++ b/ReClass.NET/DataExchange/ReClass/ReClassNetFile.Constants.cs @@ -6,14 +6,18 @@ public partial class ReClassNetFile public const string FileExtension = ".rcnet"; public const string FileExtensionId = "rcnetfile"; - private const string Version1 = "1"; + private const uint FileVersion = 0x00010001; + private const uint FileVersionCriticalMask = 0xFFFF0000; private const string DataFileName = "Data.xml"; - private const string SerialisationClassName = "__Serialization_Class__"; + private const string SerializationClassName = "__Serialization_Class__"; public const string XmlRootElement = "reclass"; public const string XmlCustomDataElement = "custom_data"; + public const string XmlTypeMappingElement = "type_mapping"; + public const string XmlEnumsElement = "enums"; + public const string XmlEnumElement = "enum"; public const string XmlClassesElement = "classes"; public const string XmlClassElement = "class"; public const string XmlNodeElement = "node"; @@ -23,12 +27,17 @@ public partial class ReClassNetFile public const string XmlUuidAttribute = "uuid"; public const string XmlNameAttribute = "name"; public const string XmlCommentAttribute = "comment"; + public const string XmlHiddenAttribute = "hidden"; public const string XmlAddressAttribute = "address"; public const string XmlTypeAttribute = "type"; public const string XmlReferenceAttribute = "reference"; public const string XmlCountAttribute = "count"; public const string XmlBitsAttribute = "bits"; public const string XmlLengthAttribute = "length"; + public const string XmlSizeAttribute = "size"; public const string XmlSignatureAttribute = "signature"; + public const string XmlFlagsAttribute = "flags"; + public const string XmlItemElement = "item"; + public const string XmlValueAttribute = "value"; } } diff --git a/ReClass.NET/DataExchange/ReClass/ReClassNetFile.Read.cs b/ReClass.NET/DataExchange/ReClass/ReClassNetFile.Read.cs index f2831c6e..4a3cb65d 100644 --- a/ReClass.NET/DataExchange/ReClass/ReClassNetFile.Read.cs +++ b/ReClass.NET/DataExchange/ReClass/ReClassNetFile.Read.cs @@ -1,13 +1,15 @@ -using System; +using System; using System.Collections.Generic; using System.Diagnostics.Contracts; using System.IO; using System.IO.Compression; using System.Linq; using System.Xml.Linq; +using ReClassNET.DataExchange.ReClass.Legacy; +using ReClassNET.Extensions; using ReClassNET.Logger; using ReClassNET.Nodes; -using ReClassNET.Util; +using ReClassNET.Project; namespace ReClassNET.DataExchange.ReClass { @@ -15,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) @@ -26,91 +27,121 @@ 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()) + 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."); + } + + 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 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) + { + project.TypeMapping.Deserialize(typeMappingElement); + } + + var enumsElement = document.Root.Element(XmlEnumsElement); + if (enumsElement != null) + { + foreach (var enumElement in enumsElement.Elements(XmlEnumElement)) { - var document = XDocument.Load(entryStream); - if (document.Root?.Element(XmlClassesElement) == null) - { - logger.Log(LogLevel.Error, "File has not the correct format."); - return; - } + var name = enumElement.Attribute(XmlNameAttribute)?.Value ?? string.Empty; + var useFlagsMode = (bool?)enumElement.Attribute(XmlFlagsAttribute) ?? false; + var size = enumElement.Attribute(XmlSizeAttribute).GetEnumValue(); - //var version = document.Root.Attribute(XmlVersionAttribute)?.Value; - var platform = document.Root.Attribute(XmlPlatformAttribute)?.Value; - if (platform != Constants.Platform) + var values = new Dictionary(); + foreach (var itemElement in enumElement.Elements(XmlItemElement)) { - logger.Log(LogLevel.Warning, $"The platform of the file ({platform}) doesn't match the program platform ({Constants.Platform})."); - } + var itemName = itemElement.Attribute(XmlNameAttribute)?.Value ?? string.Empty; + var itemValue = (long?)itemElement.Attribute(XmlValueAttribute) ?? 0L; - var customDataElement = document.Root.Element(XmlCustomDataElement); - if (customDataElement != null) - { - foreach (var kv in customDataElement.Elements()) - { - project.CustomData[kv.Name.ToString()] = kv.Value; - } + values.Add(itemName, itemValue); } - var classes = new List>(); - - foreach (var element in document.Root - .Element(XmlClassesElement) - .Elements(XmlClassElement) - .DistinctBy(e => e.Attribute(XmlUuidAttribute)?.Value)) + var @enum = new EnumDescription { - 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 - }; + Name = name + }; + @enum.SetData(useFlagsMode, size, values); - if (!project.ContainsClass(node.Uuid)) - { - project.AddClass(node); + project.AddEnum(@enum); + } + } - classes.Add(Tuple.Create(element, node)); - } - } + var classes = new List<(XElement, ClassNode)>(); - foreach (var t in classes) + 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) + { + 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 + }; + + if (!project.ContainsClass(node.Uuid)) { - ReadNodeElements( - t.Item1.Elements(XmlNodeElement), - t.Item2, - logger - ).ForEach(t.Item2.AddNode); + project.AddClass(node); + + classes.Add((element, node)); } } } + + foreach (var (element, classNode) in classes) + { + var nodes = element.Elements(XmlNodeElement) + .Select(e => CreateNodeFromElement(e, classNode, logger)) + .Where(n => n != null); + + classNode.BeginUpdate(); + classNode.AddNodes(nodes); + classNode.EndUpdate(); + } } - private IEnumerable ReadNodeElements(IEnumerable elements, ClassNode parent, ILogger logger) + private BaseNode CreateNodeFromElement(XElement element, BaseNode parent, ILogger logger) { - Contract.Requires(elements != null); - Contract.Requires(Contract.ForAll(elements, e => e != null)); - Contract.Requires(parent != null); + Contract.Requires(element != null); Contract.Requires(logger != null); - foreach (var element in elements) + BaseNode CreateNode() { - var converter = CustomNodeConvert.GetReadConverter(element); + var converter = CustomNodeSerializer.GetReadConverter(element); if (converter != null) { - if (converter.TryCreateNodeFromElement(element, parent, project.Classes, logger, out var customNode)) - { - yield return customNode; - } - - continue; + return converter.CreateNodeFromElement(element, parent, project.Classes, logger, CreateNodeFromElement); } if (!buildInStringToTypeMap.TryGetValue(element.Attribute(XmlTypeAttribute)?.Value ?? string.Empty, out var nodeType)) @@ -118,138 +149,193 @@ private IEnumerable ReadNodeElements(IEnumerable elements, C logger.Log(LogLevel.Error, $"Skipping node with unknown type: {element.Attribute(XmlTypeAttribute)?.Value}"); logger.Log(LogLevel.Warning, element.ToString()); - continue; + return null; } - var node = Activator.CreateInstance(nodeType) as BaseNode; - if (node == null) - { - logger.Log(LogLevel.Error, $"Could not create node of type: {nodeType}"); + return BaseNode.CreateInstanceFromType(nodeType, false); + } - continue; - } + var node = CreateNode(); + if (node == null) + { + logger.Log(LogLevel.Error, "Could not create node."); - node.Name = element.Attribute(XmlNameAttribute)?.Value ?? string.Empty; - node.Comment = element.Attribute(XmlCommentAttribute)?.Value ?? string.Empty; + return null; + } - if (node is BaseReferenceNode referenceNode) + node.ParentNode = parent; + + node.Name = element.Attribute(XmlNameAttribute)?.Value ?? string.Empty; + node.Comment = element.Attribute(XmlCommentAttribute)?.Value ?? string.Empty; + node.IsHidden = bool.TryParse(element.Attribute(XmlHiddenAttribute)?.Value, out var val) && val; + + if (node is BaseWrapperNode wrapperNode) + { + 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}"); logger.Log(LogLevel.Warning, element.ToString()); - continue; + return null; } - var innerClassNode = project.GetClassByUuid(reference); - if (referenceNode.PerformCycleCheck && !ClassUtil.IsCycleFree(parent, innerClassNode, project.Classes)) - { - logger.Log(LogLevel.Error, $"Skipping node with cycle reference: {parent.Name}->{node.Name}"); - - continue; - } - - referenceNode.ChangeInnerNode(innerClassNode); + return project.GetClassByUuid(reference); } - switch (node) + // Legacy Support + if (node is ClassPointerNode || node is ClassInstanceArrayNode || node is ClassPointerArrayNode) { - case VTableNode vtableNode: + var innerClass = GetClassNodeFromElementReference(); + if (innerClass == null) { - element - .Elements(XmlMethodElement) - .Select(e => new VMethodNode - { - Name = e.Attribute(XmlNameAttribute)?.Value ?? string.Empty, - Comment = e.Attribute(XmlCommentAttribute)?.Value ?? string.Empty - }) - .ForEach(vtableNode.AddNode); - break; + return null; } - case BaseArrayNode arrayNode: + + node = node switch { - TryGetAttributeValue(element, XmlCountAttribute, out var count, logger); - arrayNode.Count = count; - break; - } - case BaseTextNode textNode: + BaseClassArrayNode classArrayNode => classArrayNode.GetEquivalentNode(0, innerClass), + ClassPointerNode classPointerNode => classPointerNode.GetEquivalentNode(innerClass) + }; + } + else + { + BaseNode innerNode = null; + + if (node is BaseClassWrapperNode) { - TryGetAttributeValue(element, XmlLengthAttribute, out var length, logger); - textNode.Length = length; - break; + innerNode = GetClassNodeFromElementReference(); + if (innerNode == null) + { + return null; + } } - case BitFieldNode bitFieldNode: + else { - TryGetAttributeValue(element, XmlBitsAttribute, out var bits, logger); - bitFieldNode.Bits = bits; - break; + var innerElement = element.Elements().FirstOrDefault(); + if (innerElement != null) + { + innerNode = CreateNodeFromElement(innerElement, node, logger); + } } - case FunctionNode functionNode: - { - functionNode.Signature = element.Attribute(XmlSignatureAttribute)?.Value ?? string.Empty; - var reference = NodeUuid.FromBase64String(element.Attribute(XmlReferenceAttribute)?.Value, false); - if (project.ContainsClass(reference)) + if (wrapperNode.CanChangeInnerNodeTo(innerNode)) + { + var rootWrapperNode = node.GetRootWrapperNode(); + if (rootWrapperNode.ShouldPerformCycleCheckForInnerNode() + && innerNode is ClassNode classNode + && ClassUtil.IsCyclicIfClassIsAccessibleFromParent(node.GetParentClass(), classNode, project.Classes)) { - functionNode.BelongsToClass = project.GetClassByUuid(reference); + logger.Log(LogLevel.Error, $"Skipping node with cyclic class reference: {node.GetParentClass().Name}->{rootWrapperNode.Name}"); + + return null; } - break; + + wrapperNode.ChangeInnerNode(innerNode); + } + else + { + logger.Log(LogLevel.Error, $"The node {innerNode} is not a valid child for {node}."); } } - - yield return node; } - } - - private static void TryGetAttributeValue(XElement element, string attribute, out int val, ILogger logger) - { - Contract.Requires(element != null); - Contract.Requires(attribute != null); - Contract.Requires(logger != null); - if (!int.TryParse(element.Attribute(attribute)?.Value, out val)) + switch (node) { - val = 0; + case VirtualMethodTableNode vtableNode: + { + var nodes = element + .Elements(XmlMethodElement) + .Select(e => new VirtualMethodNode + { + Name = e.Attribute(XmlNameAttribute)?.Value ?? string.Empty, + Comment = e.Attribute(XmlCommentAttribute)?.Value ?? string.Empty, + IsHidden = (bool?)e.Attribute(XmlHiddenAttribute) ?? false + }); - logger.Log(LogLevel.Error, $"Node is missing a valid '{attribute}' attribute, defaulting to 0."); - logger.Log(LogLevel.Warning, element.ToString()); + vtableNode.AddNodes(nodes); + break; + } + case UnionNode unionNode: + { + var nodes = element + .Elements() + .Select(e => CreateNodeFromElement(e, unionNode, logger)); + + unionNode.AddNodes(nodes); + break; + } + case BaseWrapperArrayNode arrayNode: + { + arrayNode.Count = (int?)element.Attribute(XmlCountAttribute) ?? 0; + break; + } + case BaseTextNode textNode: + { + textNode.Length = (int?)element.Attribute(XmlLengthAttribute) ?? 0; + break; + } + case BitFieldNode bitFieldNode: + { + bitFieldNode.Bits = (int?)element.Attribute(XmlBitsAttribute) ?? 0; + break; + } + case FunctionNode functionNode: + { + functionNode.Signature = element.Attribute(XmlSignatureAttribute)?.Value ?? string.Empty; + + var reference = ParseUuid(element.Attribute(XmlReferenceAttribute)?.Value); + if (project.ContainsClass(reference)) + { + functionNode.BelongsToClass = project.GetClassByUuid(reference); + } + break; + } + case EnumNode enumNode: + { + var enumName = element.Attribute(XmlReferenceAttribute)?.Value ?? string.Empty; + var @enum = project.Enums.FirstOrDefault(e => e.Name == enumName) ?? EnumDescription.Default; + + enumNode.ChangeEnum(@enum); + break; + } } + + return node; } - public static Tuple, List> ReadNodes(Stream input, ReClassNetProject templateProject, ILogger logger) + 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); Contract.Requires(logger != null); Contract.Ensures(Contract.Result, List>>() != null); - using (var project = new ReClassNetProject()) - { - templateProject?.Classes.ForEach(project.AddClass); - - var file = new ReClassNetFile(project); - file.Load(input, logger); - - var classes = new List(); - - var nodes = new List(); + using var project = new ReClassNetProject(); + templateProject?.Classes.ForEach(project.AddClass); - var serialisationClassNode = project.Classes.FirstOrDefault(c => c.Name == SerialisationClassName); - if (serialisationClassNode != null) - { - if (templateProject != null) - { - classes.AddRange(project.Classes.Where(c => c != serialisationClassNode).Where(classNode => !templateProject.ContainsClass(classNode.Uuid))); - } + var file = new ReClassNetFile(project); + file.Load(input, logger); - nodes.AddRange(serialisationClassNode.Nodes); + var classes = project.Classes + .Where(c => c.Name != SerializationClassName); + if (templateProject != null) + { + classes = classes.Where(c => !templateProject.ContainsClass(c.Uuid)); + } - project.Remove(serialisationClassNode); - } + var nodes = project.Classes + .Where(c => c.Name == SerializationClassName) + .SelectMany(c => c.Nodes); - return Tuple.Create(classes, nodes); - } + return Tuple.Create(classes.ToList(), nodes.ToList()); } } } diff --git a/ReClass.NET/DataExchange/ReClass/ReClassNetFile.Write.cs b/ReClass.NET/DataExchange/ReClass/ReClassNetFile.Write.cs index c04c96db..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; @@ -6,6 +7,7 @@ using System.Xml.Linq; using ReClassNET.Logger; using ReClassNET.Nodes; +using ReClassNET.Project; namespace ReClassNET.DataExchange.ReClass { @@ -13,34 +15,48 @@ 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, Version1), - new XAttribute(XmlPlatformAttribute, Constants.Platform), - new XElement(XmlClassesElement, CreateClassElements(project.Classes, logger)), - new XElement(XmlCustomDataElement, project.CustomData.Select(kv => new XElement(kv.Key, kv.Value))) - ) - ); - - 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) + { + return enums.Select(e => new XElement( + XmlEnumElement, + new XAttribute(XmlNameAttribute, e.Name), + new XAttribute(XmlSizeAttribute, e.Size), + new XAttribute(XmlFlagsAttribute, e.UseFlagsMode), + e.Values.Select(kv => new XElement( + XmlItemElement, + new XAttribute(XmlNameAttribute, kv.Key), + new XAttribute(XmlValueAttribute, kv.Value) + )) + )); } private static IEnumerable CreateClassElements(IEnumerable classes, ILogger logger) @@ -52,29 +68,25 @@ 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), - CreateNodeElements(c.Nodes, logger) + c.Nodes.Select(n => CreateElementFromNode(n, logger)).Where(e => e != null) )); } - private static IEnumerable CreateNodeElements(IEnumerable nodes, ILogger logger) + private static XElement CreateElementFromNode(BaseNode node, ILogger logger) { - Contract.Requires(nodes != null); - Contract.Requires(Contract.ForAll(nodes, n => n != null)); + Contract.Requires(node != null); Contract.Requires(logger != null); - Contract.Ensures(Contract.Result>() != null); - foreach (var node in nodes) + XElement CreateElement() { - var converter = CustomNodeConvert.GetWriteConverter(node); + var converter = CustomNodeSerializer.GetWriteConverter(node); if (converter != null) { - yield return converter.CreateElementFromNode(node, logger); - - continue; + return converter.CreateElementFromNode(node, logger, CreateElementFromNode); } if (!buildInTypeToStringMap.TryGetValue(node.GetType(), out var typeString)) @@ -82,111 +94,149 @@ private static IEnumerable CreateNodeElements(IEnumerable no logger.Log(LogLevel.Error, $"Skipping node with unknown type: {node.Name}"); logger.Log(LogLevel.Warning, node.GetType().ToString()); - continue; + return null; } - var element = new XElement( + return new XElement( XmlNodeElement, - new XAttribute(XmlNameAttribute, node.Name ?? string.Empty), - new XAttribute(XmlCommentAttribute, node.Comment ?? string.Empty), new XAttribute(XmlTypeAttribute, typeString) ); + } + + var element = CreateElement(); + if (element == null) + { + logger.Log(LogLevel.Error, "Could not create element."); + + return null; + } - if (node is BaseReferenceNode referenceNode) + element.SetAttributeValue(XmlNameAttribute, node.Name ?? string.Empty); + element.SetAttributeValue(XmlCommentAttribute, node.Comment ?? string.Empty); + element.SetAttributeValue(XmlHiddenAttribute, node.IsHidden); + + if (node is BaseWrapperNode wrapperNode) + { + if (node is BaseClassWrapperNode classWrapperNode) { - element.SetAttributeValue(XmlReferenceAttribute, referenceNode.InnerNode.Uuid.ToBase64String()); + element.SetAttributeValue(XmlReferenceAttribute, ((ClassNode)classWrapperNode.InnerNode).Uuid); } - - switch (node) + else if (wrapperNode.InnerNode != null) { - case VTableNode vtableNode: - { - element.Add(vtableNode.Nodes.Select(n => new XElement( - XmlMethodElement, - new XAttribute(XmlNameAttribute, n.Name ?? string.Empty), - new XAttribute(XmlCommentAttribute, n.Comment ?? string.Empty) - ))); - break; - } - case BaseArrayNode arrayNode: - { - element.SetAttributeValue(XmlCountAttribute, arrayNode.Count); - break; - } - case BaseTextNode textNode: - { - element.SetAttributeValue(XmlLengthAttribute, textNode.Length); - break; - } - case BitFieldNode bitFieldNode: - { - element.SetAttributeValue(XmlBitsAttribute, bitFieldNode.Bits); - break; - } - case FunctionNode functionNode: - { - var uuid = functionNode.BelongsToClass == null ? NodeUuid.Zero : functionNode.BelongsToClass.Uuid; - element.SetAttributeValue(XmlReferenceAttribute, uuid.ToBase64String()); - element.SetAttributeValue(XmlSignatureAttribute, functionNode.Signature); - break; - } + element.Add(CreateElementFromNode(wrapperNode.InnerNode, logger)); } + } - yield return element; + switch (node) + { + case VirtualMethodTableNode vtableNode: + { + element.Add(vtableNode.Nodes.Select(n => new XElement( + XmlMethodElement, + new XAttribute(XmlNameAttribute, n.Name ?? string.Empty), + new XAttribute(XmlCommentAttribute, n.Comment ?? string.Empty), + new XAttribute(XmlHiddenAttribute, n.IsHidden) + ))); + break; + } + case UnionNode unionNode: + { + element.Add(unionNode.Nodes.Select(n => CreateElementFromNode(n, logger))); + break; + } + case BaseWrapperArrayNode arrayNode: + { + element.SetAttributeValue(XmlCountAttribute, arrayNode.Count); + break; + } + case BaseTextNode textNode: + { + element.SetAttributeValue(XmlLengthAttribute, textNode.Length); + break; + } + case BitFieldNode bitFieldNode: + { + element.SetAttributeValue(XmlBitsAttribute, bitFieldNode.Bits); + break; + } + case FunctionNode functionNode: + { + var uuid = functionNode.BelongsToClass?.Uuid ?? Guid.Empty; + element.SetAttributeValue(XmlReferenceAttribute, uuid); + element.SetAttributeValue(XmlSignatureAttribute, functionNode.Signature); + break; + } + case EnumNode enumNode: + { + element.SetAttributeValue(XmlReferenceAttribute, enumNode.Enum.Name); + break; + } } + + return element; } - public static void WriteNodes(Stream output, IEnumerable nodes, ILogger logger) + public static void SerializeNodesToStream(Stream output, IEnumerable nodes, ILogger logger) { Contract.Requires(output != null); Contract.Requires(nodes != null); 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 RecursiveAddReferences(BaseReferenceNode referenceNode) + ClassNode classNode = null; + switch (node) { - if (project.ContainsClass(referenceNode.InnerNode.Uuid)) - { - return; - } - - project.AddClass(referenceNode.InnerNode); - - foreach (var reference in referenceNode.InnerNode.Nodes.OfType()) - { - RecursiveAddReferences(reference); - } + case ClassNode c1: + classNode = c1; + break; + case BaseWrapperNode wrapperNode when wrapperNode.ResolveMostInnerNode() is ClassNode c2: + classNode = c2; + break; } - var serialisationClass = new ClassNode(false) + if (classNode == null || project.ContainsClass(classNode.Uuid)) { - Name = SerialisationClassName - }; + return; + } - project.AddClass(serialisationClass); + project.AddClass(classNode); - foreach (var node in nodes) + foreach (var wrapperNodeChild in classNode.Nodes.OfType()) { - if (node is ClassNode classNode) - { - project.AddClass(classNode); + RecursiveAddClasses(wrapperNodeChild); + } + } - continue; - } + var serialisationClass = new ClassNode(false) + { + Name = SerializationClassName + }; + + var needsSerialisationClass = true; + + foreach (var node in nodes) + { + RecursiveAddClasses(node); - if (node is BaseReferenceNode referenceNode) + if (!(node is ClassNode)) + { + if (needsSerialisationClass) { - RecursiveAddReferences(referenceNode); + needsSerialisationClass = false; + + project.AddClass(serialisationClass); } serialisationClass.AddNode(node); } - - var file = new ReClassNetFile(project); - file.Save(output, logger); } + + var file = new ReClassNetFile(project); + file.Save(output, logger); } } } diff --git a/ReClass.NET/DataExchange/ReClass/ReClassNetFile.cs b/ReClass.NET/DataExchange/ReClass/ReClassNetFile.cs index 3200764d..af258a04 100644 --- a/ReClass.NET/DataExchange/ReClass/ReClassNetFile.cs +++ b/ReClass.NET/DataExchange/ReClass/ReClassNetFile.cs @@ -1,8 +1,10 @@ -using System; +using System; using System.Collections.Generic; using System.Diagnostics.Contracts; using System.Linq; +using ReClassNET.DataExchange.ReClass.Legacy; using ReClassNET.Nodes; +using ReClassNET.Project; namespace ReClassNET.DataExchange.ReClass { @@ -19,23 +21,27 @@ 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); buildInStringToTypeMap["UTF16TextPtrNode"] = typeof(Utf16TextPtrNode); buildInStringToTypeMap["UTF32TextNode"] = typeof(Utf32TextNode); buildInStringToTypeMap["UTF32TextPtrNode"] = typeof(Utf32TextPtrNode); + buildInStringToTypeMap["VTableNode"] = typeof(VirtualMethodTableNode); + + // Legacy + buildInStringToTypeMap["ClassInstanceArrayNode"] = typeof(ClassInstanceArrayNode); + buildInStringToTypeMap["ClassPtrArrayNode"] = typeof(ClassPointerArrayNode); + buildInStringToTypeMap["ClassPtrNode"] = typeof(ClassPointerNode); } private static readonly Dictionary buildInStringToTypeMap = new[] { typeof(BoolNode), typeof(BitFieldNode), - typeof(ClassInstanceArrayNode), + typeof(EnumNode), typeof(ClassInstanceNode), - typeof(ClassPtrArrayNode), - typeof(ClassPtrNode), typeof(DoubleNode), typeof(FloatNode), typeof(FunctionNode), @@ -48,6 +54,7 @@ static ReClassNetFile() typeof(Int16Node), typeof(Int32Node), typeof(Int64Node), + typeof(NIntNode), typeof(Matrix3x3Node), typeof(Matrix3x4Node), typeof(Matrix4x4Node), @@ -55,6 +62,7 @@ static ReClassNetFile() typeof(UInt16Node), typeof(UInt32Node), typeof(UInt64Node), + typeof(NUIntNode), typeof(Utf8TextNode), typeof(Utf8TextPtrNode), typeof(Utf16TextNode), @@ -64,7 +72,10 @@ static ReClassNetFile() typeof(Vector2Node), typeof(Vector3Node), typeof(Vector4Node), - typeof(VTableNode) + typeof(VirtualMethodTableNode), + typeof(ArrayNode), + typeof(PointerNode), + typeof(UnionNode) }.ToDictionary(t => t.Name, t => t); private static readonly Dictionary buildInTypeToStringMap = buildInStringToTypeMap.ToDictionary(kv => kv.Value, kv => kv.Key); diff --git a/ReClass.NET/DataExchange/ReClass/ReClassQtFile.cs b/ReClass.NET/DataExchange/ReClass/ReClassQtFile.cs index f87e1341..275624c0 100644 --- a/ReClass.NET/DataExchange/ReClass/ReClassQtFile.cs +++ b/ReClass.NET/DataExchange/ReClass/ReClassQtFile.cs @@ -3,17 +3,44 @@ using System.Diagnostics.Contracts; using System.Linq; using System.Xml.Linq; +using ReClassNET.DataExchange.ReClass.Legacy; +using ReClassNET.Extensions; using ReClassNET.Logger; using ReClassNET.Nodes; -using ReClassNET.Util; +using ReClassNET.Project; namespace ReClassNET.DataExchange.ReClass { - class ReClassQtFile : IReClassImport + public class ReClassQtFile : IReClassImport { public const string FormatName = "ReClassQt File"; public const string FileExtension = ".reclassqt"; + private readonly Type[] typeMap = { + null, + null, + typeof(ClassPointerNode), + typeof(ClassInstanceNode), + typeof(Hex64Node), + typeof(Hex32Node), + typeof(Hex16Node), + typeof(Hex8Node), + typeof(Int64Node), + typeof(Int32Node), + typeof(Int16Node), + typeof(Int8Node), + typeof(UInt32Node), + null, + null, + typeof(UInt32Node), //bool + null, + typeof(FloatNode), + typeof(DoubleNode), + typeof(Vector4Node), + typeof(Vector3Node), + typeof(Vector2Node) + }; + private readonly ReClassNetProject project; public ReClassQtFile(ReClassNetProject project) @@ -50,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); } } @@ -82,31 +109,6 @@ private static string ParseAddressString(XElement element) return address; } - private readonly Type[] typeMap = { - null, - null, - typeof(ClassPtrNode), - typeof(ClassInstanceNode), - typeof(Hex64Node), - typeof(Hex32Node), - typeof(Hex16Node), - typeof(Hex8Node), - typeof(Int64Node), - typeof(Int32Node), - typeof(Int16Node), - typeof(Int8Node), - typeof(UInt32Node), - null, - null, - typeof(UInt32Node), //bool - null, - typeof(FloatNode), - typeof(DoubleNode), - typeof(Vector4Node), - typeof(Vector3Node), - typeof(Vector2Node) - }; - private IEnumerable ReadNodeElements(IEnumerable elements, ClassNode parent, IReadOnlyDictionary classes, ILogger logger) { Contract.Requires(elements != null); @@ -134,7 +136,7 @@ private IEnumerable ReadNodeElements(IEnumerable elements, C continue; } - var node = Activator.CreateInstance(nodeType) as BaseNode; + var node = BaseNode.CreateInstanceFromType(nodeType, false); if (node == null) { logger.Log(LogLevel.Error, $"Could not create node of type: {nodeType}"); @@ -145,7 +147,8 @@ private IEnumerable ReadNodeElements(IEnumerable elements, C node.Name = element.Attribute("Name")?.Value ?? string.Empty; node.Comment = element.Attribute("Comments")?.Value ?? string.Empty; - if (node is BaseReferenceNode referenceNode) + // ClassInstanceNode, ClassPointerNode + if (node is BaseWrapperNode wrapperNode) { var pointToClassId = element.Attribute("PointToClass")?.Value; if (pointToClassId == null || !classes.ContainsKey(pointToClassId)) @@ -157,14 +160,21 @@ private IEnumerable ReadNodeElements(IEnumerable elements, C } var innerClassNode = classes[pointToClassId]; - if (referenceNode.PerformCycleCheck && !ClassUtil.IsCycleFree(parent, innerClassNode, project.Classes)) + if (wrapperNode.ShouldPerformCycleCheckForInnerNode() && !ClassUtil.IsCyclicIfClassIsAccessibleFromParent(parent, innerClassNode, project.Classes)) { logger.Log(LogLevel.Error, $"Skipping node with cycle reference: {parent.Name}->{node.Name}"); continue; } - referenceNode.ChangeInnerNode(innerClassNode); + if (node is ClassPointerNode classPointerNode) + { + node = classPointerNode.GetEquivalentNode(innerClassNode); + } + else // ClassInstanceNode + { + wrapperNode.ChangeInnerNode(innerClassNode); + } } yield return node; 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/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/DataExchange/Scanner/ReClassScanFile.cs b/ReClass.NET/DataExchange/Scanner/ReClassScanFile.cs index 821d4b28..8af86952 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; @@ -34,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.StringHexFormat)) - ); - 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 == Encoding.UTF8 ? "UTF8" : r.Encoding == 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 86c4a643..3224293a 100644 --- a/ReClass.NET/Debugger/RemoteDebugger.cs +++ b/ReClass.NET/Debugger/RemoteDebugger.cs @@ -1,10 +1,10 @@ -using System; +using System; using System.Collections.Generic; using System.Diagnostics.Contracts; using System.Linq; +using ReClassNET.Extensions; using ReClassNET.Forms; using ReClassNET.Memory; -using ReClassNET.Util; namespace ReClassNET.Debugger { @@ -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/Util/Extension.BinaryReaderWriter.cs b/ReClass.NET/Extensions/BinaryReaderWriterExtensions.cs similarity index 94% rename from ReClass.NET/Util/Extension.BinaryReaderWriter.cs rename to ReClass.NET/Extensions/BinaryReaderWriterExtensions.cs index 4a36ca94..fdae07f4 100644 --- a/ReClass.NET/Util/Extension.BinaryReaderWriter.cs +++ b/ReClass.NET/Extensions/BinaryReaderWriterExtensions.cs @@ -2,7 +2,7 @@ using System.Diagnostics.Contracts; using System.IO; -namespace ReClassNET.Util +namespace ReClassNET.Extensions { public static class BinaryReaderWriterExtension { 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 new file mode 100644 index 00000000..c28c0937 --- /dev/null +++ b/ReClass.NET/Extensions/ColorExtensions.cs @@ -0,0 +1,23 @@ +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/Util/Extension.DataGridView.cs b/ReClass.NET/Extensions/DataGridViewExtensions.cs similarity index 94% rename from ReClass.NET/Util/Extension.DataGridView.cs rename to ReClass.NET/Extensions/DataGridViewExtensions.cs index da5375c4..848d06c7 100644 --- a/ReClass.NET/Util/Extension.DataGridView.cs +++ b/ReClass.NET/Extensions/DataGridViewExtensions.cs @@ -1,7 +1,7 @@ using System.Collections.Generic; using System.Windows.Forms; -namespace ReClassNET.Util +namespace ReClassNET.Extensions { public static class DataGridViewExtension { diff --git a/ReClass.NET/Util/Extension.Dictionary.cs b/ReClass.NET/Extensions/DictionaryExtensions.cs similarity index 93% rename from ReClass.NET/Util/Extension.Dictionary.cs rename to ReClass.NET/Extensions/DictionaryExtensions.cs index af55d56a..94d3bf9a 100644 --- a/ReClass.NET/Util/Extension.Dictionary.cs +++ b/ReClass.NET/Extensions/DictionaryExtensions.cs @@ -3,7 +3,7 @@ using System.Diagnostics.Contracts; using System.Linq; -namespace ReClassNET.Util +namespace ReClassNET.Extensions { public static class DictionaryExtension { diff --git a/ReClass.NET/Extensions/EncodingExtensions.cs b/ReClass.NET/Extensions/EncodingExtensions.cs new file mode 100644 index 00000000..4a3ed695 --- /dev/null +++ b/ReClass.NET/Extensions/EncodingExtensions.cs @@ -0,0 +1,40 @@ +using System; +using System.Text; + +namespace ReClassNET.Extensions +{ + 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 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; + } + + 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/Util/Extension.Linq.cs b/ReClass.NET/Extensions/EnumerableExtension.cs similarity index 52% rename from ReClass.NET/Util/Extension.Linq.cs rename to ReClass.NET/Extensions/EnumerableExtension.cs index 6fe2d2c3..0619c87f 100644 --- a/ReClass.NET/Util/Extension.Linq.cs +++ b/ReClass.NET/Extensions/EnumerableExtension.cs @@ -4,68 +4,10 @@ using System.Diagnostics.Contracts; using System.Linq; -namespace ReClassNET.Util +namespace ReClassNET.Extensions { - public static class LinqExtension + public static class EnumerableExtension { - 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; - - 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) { @@ -99,14 +41,14 @@ public static int FindIndex(this IEnumerable source, Func() >= -1); - int retVal = 0; + var index = 0; foreach (var item in source) { if (predicate(item)) { - return retVal; + return index; } - ++retVal; + ++index; } return -1; } @@ -123,14 +65,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) { @@ -138,45 +72,22 @@ 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); } } } [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); @@ -186,7 +97,7 @@ public static IEnumerable TakeUntil(this IEnumerable { yield return item; - if (predicate(item)) + if (!predicate(item)) { yield break; } @@ -211,45 +122,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; } /// @@ -278,7 +163,44 @@ public static TSource PredicateOrFirst(this IEnumerable source first = false; } } + + if (first) + { + throw new InvalidOperationException("Sequence contains no elements"); + } + return result; } + + public static IEnumerable> GroupWhile(this IEnumerable source, Func condition) + { + Contract.Requires(source != null); + Contract.Requires(condition != null); + + using var it = source.GetEnumerator(); + if (it.MoveNext()) + { + var previous = it.Current; + var list = new List { previous }; + + while (it.MoveNext()) + { + var item = it.Current; + + if (condition(previous, item) == false) + { + yield return list; + + list = new List(); + } + + list.Add(item); + + previous = item; + } + + yield return list; + } + } } } diff --git a/ReClass.NET/Extensions/FloatingPointExtensions.cs b/ReClass.NET/Extensions/FloatingPointExtensions.cs new file mode 100644 index 00000000..410c56e8 --- /dev/null +++ b/ReClass.NET/Extensions/FloatingPointExtensions.cs @@ -0,0 +1,33 @@ +using System; +using System.Diagnostics; +using System.Diagnostics.Contracts; + +namespace ReClassNET.Extensions +{ + public static class FloatingPointExtension + { + [Pure] + [DebuggerStepThrough] + public static bool IsNearlyEqual(this float val, float other, float epsilon) + { + if (val == other) + { + return true; + } + + return Math.Abs(val - other) <= epsilon; + } + + [Pure] + [DebuggerStepThrough] + public static bool IsNearlyEqual(this double val, double other, double epsilon) + { + if (val == other) + { + return true; + } + + return Math.Abs(val - other) <= epsilon; + } + } +} diff --git a/ReClass.NET/Util/Extension.Graphics.cs b/ReClass.NET/Extensions/GraphicsExtensions.cs similarity index 96% rename from ReClass.NET/Util/Extension.Graphics.cs rename to ReClass.NET/Extensions/GraphicsExtensions.cs index 01a5ced1..fb3d973d 100644 --- a/ReClass.NET/Util/Extension.Graphics.cs +++ b/ReClass.NET/Extensions/GraphicsExtensions.cs @@ -1,7 +1,7 @@ using System.Drawing; using System.Windows.Forms; -namespace ReClassNET.Util +namespace ReClassNET.Extensions { public static class GraphicsExtension { 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/Extensions/IRemoteMemoryWriterExtension.cs b/ReClass.NET/Extensions/IRemoteMemoryWriterExtension.cs new file mode 100644 index 00000000..d39dace9 --- /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, new[] { (byte)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)); + + 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/Util/Extension.IntPtr.cs b/ReClass.NET/Extensions/IntPtrExtensions.cs similarity index 61% rename from ReClass.NET/Util/Extension.IntPtr.cs rename to ReClass.NET/Extensions/IntPtrExtensions.cs index b6f7459b..7f2ff58a 100644 --- a/ReClass.NET/Util/Extension.IntPtr.cs +++ b/ReClass.NET/Extensions/IntPtrExtensions.cs @@ -2,7 +2,7 @@ using System.Diagnostics; using System.Diagnostics.Contracts; -namespace ReClassNET.Util +namespace ReClassNET.Extensions { public static class IntPtrExtension { @@ -18,9 +18,9 @@ public static bool IsNull(this IntPtr ptr) public static bool MayBeValid(this IntPtr ptr) { #if RECLASSNET64 - return ptr.InRange((IntPtr)0x10000, (IntPtr)unchecked((long)0x00FF000000000000)); + return ptr.IsInRange((IntPtr)0x10000, (IntPtr)long.MaxValue); #else - return ptr.InRange((IntPtr)0x10000, (IntPtr)unchecked((int)0xFFFFF000)); + return ptr.IsInRange((IntPtr)0x10000, (IntPtr)int.MaxValue); #endif } @@ -83,7 +83,18 @@ public static int Mod(this IntPtr lhs, int mod) [Pure] [DebuggerStepThrough] - public static bool InRange(this IntPtr address, IntPtr start, IntPtr end) + 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 IsInRange(this IntPtr address, IntPtr start, IntPtr end) { #if RECLASSNET64 var val = (ulong)address.ToInt64(); @@ -109,11 +120,58 @@ 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; } return CompareTo(address, start); } + + /// + /// Changes the behaviour of ToInt64 in x86 mode. + /// IntPtr(int.MaxValue + 1) = (int)0x80000000 (-2147483648) = (long)0xFFFFFFFF80000000 + /// This method converts the value to (long)0x0000000080000000 (2147483648). + /// + /// + /// + [Pure] + [DebuggerStepThrough] + public static long ToInt64Bits(this IntPtr ptr) + { +#if RECLASSNET64 + return ptr.ToInt64(); +#else + var value = ptr.ToInt64(); + + if (value < 0) + { + var intValue = ptr.ToInt32(); + if (value == intValue) + { + value = intValue & 0xFFFFFFFFL; + } + } + + return value; +#endif + } + + [Pure] + [DebuggerStepThrough] + public static IntPtr From(int value) + { + return (IntPtr)value; + } + + [Pure] + [DebuggerStepThrough] + public static IntPtr From(long value) + { +#if RECLASSNET64 + return (IntPtr)value; +#else + return (IntPtr)unchecked((int)value); +#endif + } } } 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/Util/Extension.RichTextBox.cs b/ReClass.NET/Extensions/RichTextBoxExtensions.cs similarity index 85% rename from ReClass.NET/Util/Extension.RichTextBox.cs rename to ReClass.NET/Extensions/RichTextBoxExtensions.cs index 8fcb2998..4c1b49a3 100644 --- a/ReClass.NET/Util/Extension.RichTextBox.cs +++ b/ReClass.NET/Extensions/RichTextBoxExtensions.cs @@ -1,13 +1,13 @@ -using System; +using System; using System.Drawing; using System.Runtime.InteropServices; using System.Windows.Forms; -namespace ReClassNET.Util +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(); @@ -16,7 +16,7 @@ public static void SetInnerPadding(this TextBoxBase textBox, int left, int top, } [StructLayout(LayoutKind.Sequential)] - private struct RECT + private readonly struct RECT { public readonly int Left; public readonly int Top; @@ -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/Extensions/StringBuilderExtensions.cs b/ReClass.NET/Extensions/StringBuilderExtensions.cs new file mode 100644 index 00000000..1bf1d25b --- /dev/null +++ b/ReClass.NET/Extensions/StringBuilderExtensions.cs @@ -0,0 +1,17 @@ +using System.Text; + +namespace ReClassNET.Extensions +{ + public static class StringBuilderExtensions + { + public static StringBuilder Prepend(this StringBuilder sb, char value) + { + return sb.Insert(0, value); + } + + public static StringBuilder Prepend(this StringBuilder sb, string value) + { + return sb.Insert(0, value); + } + } +} diff --git a/ReClass.NET/Util/Extension.String.cs b/ReClass.NET/Extensions/StringExtensions.cs similarity index 52% rename from ReClass.NET/Util/Extension.String.cs rename to ReClass.NET/Extensions/StringExtensions.cs index f87c45e2..51ae20d2 100644 --- a/ReClass.NET/Util/Extension.String.cs +++ b/ReClass.NET/Extensions/StringExtensions.cs @@ -3,8 +3,9 @@ using System.Diagnostics; using System.Diagnostics.Contracts; using System.Linq; +using System.Text.RegularExpressions; -namespace ReClassNET.Util +namespace ReClassNET.Extensions { public static class StringExtension { @@ -12,11 +13,11 @@ public static class StringExtension [DebuggerStepThrough] public static bool IsPrintable(this char c) { - return ' ' <= c && c <= '~'; + return (' ' <= c && c <= '~' || '\xA1' <= c && c <= '\xFF') && c != '\xFFFD' /* Unicode REPLACEMENT CHARACTER � */; } [DebuggerStepThrough] - public static IEnumerable InterpretAsUtf8(this IEnumerable source) + public static IEnumerable InterpretAsSingleByteCharacter(this IEnumerable source) { Contract.Requires(source != null); @@ -24,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); @@ -39,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) { @@ -68,6 +75,11 @@ public static float IsLikelyPrintableData(this IEnumerable source) } } + if (countAll == 0) + { + return 0.0f; + } + return countValid / (float)countAll; } @@ -84,5 +96,16 @@ public static string LimitLength(this string s, int length) } return s.Substring(0, length); } + + 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) + { + 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/Util/Extension.StringReader.cs b/ReClass.NET/Extensions/StringReaderExtensions.cs similarity index 90% rename from ReClass.NET/Util/Extension.StringReader.cs rename to ReClass.NET/Extensions/StringReaderExtensions.cs index 17c3e255..516f8eb6 100644 --- a/ReClass.NET/Util/Extension.StringReader.cs +++ b/ReClass.NET/Extensions/StringReaderExtensions.cs @@ -1,6 +1,6 @@ using System.IO; -namespace ReClassNET.Util +namespace ReClassNET.Extensions { public static class StringReaderExtension { diff --git a/ReClass.NET/Extensions/XAttributeExtensions.cs b/ReClass.NET/Extensions/XAttributeExtensions.cs new file mode 100644 index 00000000..d559e50d --- /dev/null +++ b/ReClass.NET/Extensions/XAttributeExtensions.cs @@ -0,0 +1,18 @@ +using System; +using System.Xml.Linq; + +namespace ReClassNET.Extensions +{ + public static class XAttributeExtensions + { + public static TEnum GetEnumValue(this XAttribute attribute) where TEnum : struct + { + TEnum @enum = default; + if (attribute != null) + { + Enum.TryParse(attribute.Value, out @enum); + } + return @enum; + } + } +} diff --git a/ReClass.NET/Forms/AboutForm.Designer.cs b/ReClass.NET/Forms/AboutForm.Designer.cs index 739bf454..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(); @@ -175,6 +177,9 @@ private void InitializeComponent() this.Controls.Add(this.platformLabel); this.Controls.Add(this.infoLabel); this.Controls.Add(this.bannerBox); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; + this.MaximizeBox = false; + this.MinimizeBox = false; this.Name = "AboutForm"; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; this.Text = "ReClass.NET - Info"; @@ -188,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 new file mode 100644 index 00000000..cc441d54 --- /dev/null +++ b/ReClass.NET/Forms/ClassSelectionForm.Designer.cs @@ -0,0 +1,129 @@ +using ReClassNET.Controls; + +namespace ReClassNET.Forms +{ + partial class ClassSelectionForm + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.bannerBox = new BannerBox(); + this.classesListBox = new System.Windows.Forms.ListBox(); + this.filterNameTextBox = new PlaceholderTextBox(); + this.cancelButton = new System.Windows.Forms.Button(); + this.selectButton = new System.Windows.Forms.Button(); + ((System.ComponentModel.ISupportInitialize)(this.bannerBox)).BeginInit(); + this.SuspendLayout(); + // + // bannerBox + // + this.bannerBox.Dock = System.Windows.Forms.DockStyle.Top; + this.bannerBox.Icon = global::ReClassNET.Properties.Resources.B16x16_Class_Type; + this.bannerBox.Location = new System.Drawing.Point(0, 0); + this.bannerBox.Name = "bannerBox"; + this.bannerBox.Size = new System.Drawing.Size(516, 48); + this.bannerBox.TabIndex = 9; + this.bannerBox.Text = "Select a class of the project."; + this.bannerBox.Title = "Class Selection"; + // + // classesListBox + // + this.classesListBox.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.classesListBox.DisplayMember = "Name"; + this.classesListBox.FormattingEnabled = true; + this.classesListBox.Location = new System.Drawing.Point(12, 80); + this.classesListBox.Name = "classesListBox"; + this.classesListBox.Size = new System.Drawing.Size(492, 186); + this.classesListBox.TabIndex = 2; + this.classesListBox.SelectedIndexChanged += new System.EventHandler(this.classesListBox_SelectedIndexChanged); + this.classesListBox.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.classesListBox_MouseDoubleClick); + // + // filterNameTextBox + // + this.filterNameTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.filterNameTextBox.Location = new System.Drawing.Point(12, 54); + this.filterNameTextBox.Name = "filterNameTextBox"; + this.filterNameTextBox.PlaceholderText = "Filter by Class Name..."; + this.filterNameTextBox.Size = new System.Drawing.Size(492, 20); + this.filterNameTextBox.TabIndex = 1; + this.filterNameTextBox.TextChanged += new System.EventHandler(this.filterNameTextBox_TextChanged); + // + // cancelButton + // + this.cancelButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.cancelButton.DialogResult = System.Windows.Forms.DialogResult.Cancel; + this.cancelButton.Location = new System.Drawing.Point(430, 272); + this.cancelButton.Name = "cancelButton"; + this.cancelButton.Size = new System.Drawing.Size(75, 23); + this.cancelButton.TabIndex = 4; + this.cancelButton.Text = "Cancel"; + this.cancelButton.UseVisualStyleBackColor = true; + // + // selectButton + // + this.selectButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.selectButton.DialogResult = System.Windows.Forms.DialogResult.OK; + this.selectButton.Enabled = false; + this.selectButton.Location = new System.Drawing.Point(328, 272); + this.selectButton.Name = "selectButton"; + this.selectButton.Size = new System.Drawing.Size(95, 23); + this.selectButton.TabIndex = 3; + this.selectButton.Text = "Select Class"; + this.selectButton.UseVisualStyleBackColor = true; + // + // ClassSelectionForm + // + this.AcceptButton = this.selectButton; + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.CancelButton = this.cancelButton; + this.ClientSize = new System.Drawing.Size(516, 306); + this.Controls.Add(this.selectButton); + this.Controls.Add(this.cancelButton); + this.Controls.Add(this.filterNameTextBox); + this.Controls.Add(this.classesListBox); + this.Controls.Add(this.bannerBox); + this.Name = "ClassSelectionForm"; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; + this.Text = "ReClass.NET - Class Selection"; + ((System.ComponentModel.ISupportInitialize)(this.bannerBox)).EndInit(); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private BannerBox bannerBox; + private System.Windows.Forms.ListBox classesListBox; + private PlaceholderTextBox filterNameTextBox; + private System.Windows.Forms.Button cancelButton; + private System.Windows.Forms.Button selectButton; + } +} \ No newline at end of file diff --git a/ReClass.NET/Forms/ClassSelectionForm.cs b/ReClass.NET/Forms/ClassSelectionForm.cs new file mode 100644 index 00000000..e8ed984d --- /dev/null +++ b/ReClass.NET/Forms/ClassSelectionForm.cs @@ -0,0 +1,72 @@ +using System; +using System.Collections.Generic; +using System.Diagnostics.Contracts; +using System.Linq; +using System.Windows.Forms; +using ReClassNET.Nodes; +using ReClassNET.UI; + +namespace ReClassNET.Forms +{ + public partial class ClassSelectionForm : IconForm + { + private readonly List allClasses; + + public ClassNode SelectedClass => classesListBox.SelectedItem as ClassNode; + + public ClassSelectionForm(IEnumerable classes) + { + Contract.Requires(classes != null); + + allClasses = classes.ToList(); + + InitializeComponent(); + + ShowFilteredClasses(); + } + + protected override void OnLoad(EventArgs e) + { + base.OnLoad(e); + + GlobalWindowManager.AddWindow(this); + } + + protected override void OnFormClosed(FormClosedEventArgs e) + { + base.OnFormClosed(e); + + GlobalWindowManager.RemoveWindow(this); + } + + private void filterNameTextBox_TextChanged(object sender, EventArgs e) + { + ShowFilteredClasses(); + } + + private void classesListBox_SelectedIndexChanged(object sender, EventArgs e) + { + selectButton.Enabled = SelectedClass != null; + } + + private void classesListBox_MouseDoubleClick(object sender, MouseEventArgs e) + { + if (SelectedClass != null) + { + selectButton.PerformClick(); + } + } + + private void ShowFilteredClasses() + { + IEnumerable classes = allClasses; + + if (!string.IsNullOrEmpty(filterNameTextBox.Text)) + { + classes = classes.Where(c => c.Name.IndexOf(filterNameTextBox.Text, StringComparison.OrdinalIgnoreCase) >= 0); + } + + classesListBox.DataSource = classes.ToList(); + } + } +} diff --git a/ReClass.NET/Forms/ClassSelectionForm.resx b/ReClass.NET/Forms/ClassSelectionForm.resx new file mode 100644 index 00000000..1af7de15 --- /dev/null +++ b/ReClass.NET/Forms/ClassSelectionForm.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file 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/CodeForm.cs b/ReClass.NET/Forms/CodeForm.cs index 1beb1ce2..f84d3f0e 100644 --- a/ReClass.NET/Forms/CodeForm.cs +++ b/ReClass.NET/Forms/CodeForm.cs @@ -8,26 +8,28 @@ using ColorCode; using ColorCode.Parsing; using ReClassNET.CodeGenerator; +using ReClassNET.Extensions; using ReClassNET.Logger; using ReClassNET.Nodes; +using ReClassNET.Project; using ReClassNET.UI; -using ReClassNET.Util; using ReClassNET.Util.Rtf; namespace ReClassNET.Forms { public partial class CodeForm : IconForm { - public CodeForm(ICodeGenerator generator, IEnumerable classes, ILogger logger) + public CodeForm(ICodeGenerator generator, IReadOnlyList classes, IReadOnlyList enums, ILogger logger) { Contract.Requires(generator != null); Contract.Requires(classes != null); + Contract.Requires(enums != null); InitializeComponent(); - codeRichTextBox.SetInnerPadding(5, 5, 5, 5); + codeRichTextBox.SetInnerMargin(5, 5, 5, 5); - var code = generator.GenerateCode(classes, logger); + var code = generator.GenerateCode(classes, enums, logger); var buffer = new StringBuilder(code.Length * 2); using (var writer = new StringWriter(buffer)) @@ -59,7 +61,7 @@ protected override void OnFormClosed(FormClosedEventArgs e) } } - class RtfFormatter : IFormatter + internal class RtfFormatter : IFormatter { private readonly RtfBuilder builder = new RtfBuilder(RtfFont.Consolas, 20); diff --git a/ReClass.NET/Forms/EnumEditorForm.Designer.cs b/ReClass.NET/Forms/EnumEditorForm.Designer.cs new file mode 100644 index 00000000..c06e2978 --- /dev/null +++ b/ReClass.NET/Forms/EnumEditorForm.Designer.cs @@ -0,0 +1,196 @@ +using ReClassNET.Controls; + +namespace ReClassNET.Forms +{ + partial class EnumEditorForm + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + 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(); + this.enumFlagCheckBox = new System.Windows.Forms.CheckBox(); + this.enumNameTextBox = new System.Windows.Forms.TextBox(); + this.enumDataGridView = new System.Windows.Forms.DataGridView(); + this.enumValueKeyColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.enumValueNameColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.enumUnderlyingTypeSizeLabel = new System.Windows.Forms.Label(); + this.enumUnderlyingTypeSizeComboBox = new ReClassNET.Forms.UnderlyingSizeComboBox(); + ((System.ComponentModel.ISupportInitialize)(this.bannerBox)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.enumDataGridView)).BeginInit(); + this.SuspendLayout(); + // + // bannerBox + // + this.bannerBox.Dock = System.Windows.Forms.DockStyle.Top; + this.bannerBox.Icon = global::ReClassNET.Properties.Resources.B16x16_Class_Type; + this.bannerBox.Location = new System.Drawing.Point(0, 0); + this.bannerBox.Name = "bannerBox"; + this.bannerBox.Size = new System.Drawing.Size(380, 48); + this.bannerBox.TabIndex = 15; + this.bannerBox.Text = "Edit an enum of the project."; + this.bannerBox.Title = "Enum Editor"; + // + // saveButton + // + this.saveButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.saveButton.DialogResult = System.Windows.Forms.DialogResult.OK; + this.saveButton.Location = new System.Drawing.Point(214, 250); + this.saveButton.Name = "saveButton"; + this.saveButton.Size = new System.Drawing.Size(75, 23); + this.saveButton.TabIndex = 22; + this.saveButton.Text = "Save"; + this.saveButton.UseVisualStyleBackColor = true; + this.saveButton.Click += new System.EventHandler(this.saveButton_Click); + // + // enumNameLabel + // + this.enumNameLabel.AutoSize = true; + this.enumNameLabel.Location = new System.Drawing.Point(9, 57); + this.enumNameLabel.Name = "enumNameLabel"; + this.enumNameLabel.Size = new System.Drawing.Size(38, 13); + this.enumNameLabel.TabIndex = 21; + this.enumNameLabel.Text = "Name:"; + // + // cancelButton + // + this.cancelButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.cancelButton.DialogResult = System.Windows.Forms.DialogResult.Cancel; + this.cancelButton.Location = new System.Drawing.Point(295, 250); + this.cancelButton.Name = "cancelButton"; + this.cancelButton.Size = new System.Drawing.Size(75, 23); + this.cancelButton.TabIndex = 19; + this.cancelButton.Text = "Cancel"; + this.cancelButton.UseVisualStyleBackColor = true; + // + // enumFlagCheckBox + // + this.enumFlagCheckBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.enumFlagCheckBox.AutoSize = true; + this.enumFlagCheckBox.Location = new System.Drawing.Point(267, 82); + this.enumFlagCheckBox.Name = "enumFlagCheckBox"; + this.enumFlagCheckBox.Size = new System.Drawing.Size(103, 17); + this.enumFlagCheckBox.TabIndex = 18; + this.enumFlagCheckBox.Text = "Use Flags Mode"; + this.enumFlagCheckBox.UseVisualStyleBackColor = true; + // + // enumNameTextBox + // + this.enumNameTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.enumNameTextBox.Location = new System.Drawing.Point(53, 54); + this.enumNameTextBox.Name = "enumNameTextBox"; + this.enumNameTextBox.Size = new System.Drawing.Size(315, 20); + this.enumNameTextBox.TabIndex = 17; + // + // enumDataGridView + // + this.enumDataGridView.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.enumDataGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; + this.enumDataGridView.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { + this.enumValueKeyColumn, + this.enumValueNameColumn}); + this.enumDataGridView.Location = new System.Drawing.Point(12, 108); + this.enumDataGridView.Name = "enumDataGridView"; + this.enumDataGridView.RowHeadersVisible = false; + this.enumDataGridView.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; + this.enumDataGridView.Size = new System.Drawing.Size(358, 136); + this.enumDataGridView.TabIndex = 16; + this.enumDataGridView.CellValidating += new System.Windows.Forms.DataGridViewCellValidatingEventHandler(this.enumDataGridView_CellValidating); + this.enumDataGridView.DefaultValuesNeeded += new System.Windows.Forms.DataGridViewRowEventHandler(this.enumDataGridView_DefaultValuesNeeded); + // + // enumValueKeyColumn + // + this.enumValueKeyColumn.HeaderText = "Value"; + this.enumValueKeyColumn.Name = "enumValueKeyColumn"; + // + // enumValueNameColumn + // + this.enumValueNameColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; + this.enumValueNameColumn.HeaderText = "Name"; + this.enumValueNameColumn.Name = "enumValueNameColumn"; + // + // enumUnderlyingTypeSizeLabel + // + this.enumUnderlyingTypeSizeLabel.AutoSize = true; + this.enumUnderlyingTypeSizeLabel.Location = new System.Drawing.Point(9, 83); + this.enumUnderlyingTypeSizeLabel.Name = "enumUnderlyingTypeSizeLabel"; + this.enumUnderlyingTypeSizeLabel.Size = new System.Drawing.Size(30, 13); + this.enumUnderlyingTypeSizeLabel.TabIndex = 24; + this.enumUnderlyingTypeSizeLabel.Text = "Size:"; + // + // enumUnderlyingTypeSizeComboBox + // + this.enumUnderlyingTypeSizeComboBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.enumUnderlyingTypeSizeComboBox.Location = new System.Drawing.Point(53, 80); + this.enumUnderlyingTypeSizeComboBox.Name = "enumUnderlyingTypeSizeComboBox"; + this.enumUnderlyingTypeSizeComboBox.Size = new System.Drawing.Size(208, 21); + this.enumUnderlyingTypeSizeComboBox.TabIndex = 25; + // + // EnumEditorForm + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(380, 282); + this.Controls.Add(this.enumUnderlyingTypeSizeComboBox); + this.Controls.Add(this.enumUnderlyingTypeSizeLabel); + this.Controls.Add(this.saveButton); + this.Controls.Add(this.enumNameLabel); + this.Controls.Add(this.cancelButton); + this.Controls.Add(this.enumFlagCheckBox); + this.Controls.Add(this.enumNameTextBox); + this.Controls.Add(this.enumDataGridView); + this.Controls.Add(this.bannerBox); + this.MinimumSize = new System.Drawing.Size(396, 321); + this.Name = "EnumEditorForm"; + this.Text = "ReClass.NET - Enum Editor"; + ((System.ComponentModel.ISupportInitialize)(this.bannerBox)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.enumDataGridView)).EndInit(); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private BannerBox bannerBox; + private System.Windows.Forms.Button saveButton; + private System.Windows.Forms.Label enumNameLabel; + private System.Windows.Forms.Button cancelButton; + private System.Windows.Forms.CheckBox enumFlagCheckBox; + private System.Windows.Forms.TextBox enumNameTextBox; + private System.Windows.Forms.DataGridView enumDataGridView; + private System.Windows.Forms.Label enumUnderlyingTypeSizeLabel; + private System.Windows.Forms.DataGridViewTextBoxColumn enumValueKeyColumn; + private System.Windows.Forms.DataGridViewTextBoxColumn enumValueNameColumn; + private UnderlyingSizeComboBox enumUnderlyingTypeSizeComboBox; + } +} \ No newline at end of file diff --git a/ReClass.NET/Forms/EnumEditorForm.cs b/ReClass.NET/Forms/EnumEditorForm.cs new file mode 100644 index 00000000..cfdc5302 --- /dev/null +++ b/ReClass.NET/Forms/EnumEditorForm.cs @@ -0,0 +1,103 @@ +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; + +namespace ReClassNET.Forms +{ + public partial class EnumEditorForm : IconForm + { + private readonly EnumDescription @enum; + + public EnumEditorForm(EnumDescription @enum) + { + Contract.Requires(@enum != null); + + InitializeComponent(); + + this.@enum = @enum; + + enumNameTextBox.Text = @enum.Name; + enumUnderlyingTypeSizeComboBox.SelectedValue = @enum.Size; + enumFlagCheckBox.Checked = @enum.UseFlagsMode; + + foreach (var kv in @enum.Values) + { + enumDataGridView.Rows.Add(kv.Value, kv.Key); + } + } + + protected override void OnLoad(EventArgs e) + { + base.OnLoad(e); + + GlobalWindowManager.AddWindow(this); + } + + protected override void OnFormClosed(FormClosedEventArgs e) + { + base.OnFormClosed(e); + + GlobalWindowManager.RemoveWindow(this); + } + + private void enumDataGridView_DefaultValuesNeeded(object sender, DataGridViewRowEventArgs e) + { + long value = e.Row.Index; + if (enumFlagCheckBox.Checked) + { + value = (long)Math.Pow(2, e.Row.Index); + } + + e.Row.Cells[0].Value = value; + } + + private void saveButton_Click(object sender, EventArgs e) + { + @enum.Name = enumNameTextBox.Text; + + var values = new Dictionary(); + + foreach (var row in enumDataGridView.Rows.Cast().Where(r => r.IsNewRow == false)) + { + if (!long.TryParse(Convert.ToString(row.Cells[0].Value), out var itemValue)) + { + continue; + } + + var itemName = Convert.ToString(row.Cells[1].Value); + + values.Add(itemName, itemValue); + } + + @enum.SetData(enumFlagCheckBox.Checked, enumUnderlyingTypeSizeComboBox.SelectedValue, values); + } + + private void enumDataGridView_CellValidating(object sender, DataGridViewCellValidatingEventArgs e) + { + void SetErrorText(string text) + { + enumDataGridView.Rows[e.RowIndex].Cells[e.ColumnIndex].ErrorText = text; + } + + SetErrorText(null); + + var formattedValue = Convert.ToString(e.FormattedValue); + + if (e.ColumnIndex == 0 && !long.TryParse(formattedValue, out _)) + { + SetErrorText($"'{formattedValue}' is not a valid value."); + } + else if (e.ColumnIndex == 1 && string.IsNullOrWhiteSpace(formattedValue)) + { + SetErrorText("Empty names are not allowed."); + } + } + } + + internal class UnderlyingSizeComboBox : EnumComboBox { } +} diff --git a/ReClass.NET/Forms/EnumEditorForm.resx b/ReClass.NET/Forms/EnumEditorForm.resx new file mode 100644 index 00000000..8ff01df4 --- /dev/null +++ b/ReClass.NET/Forms/EnumEditorForm.resx @@ -0,0 +1,132 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + True + + + True + + + True + + + True + + \ No newline at end of file diff --git a/ReClass.NET/Forms/EnumListForm.Designer.cs b/ReClass.NET/Forms/EnumListForm.Designer.cs new file mode 100644 index 00000000..44d1f381 --- /dev/null +++ b/ReClass.NET/Forms/EnumListForm.Designer.cs @@ -0,0 +1,142 @@ +using ReClassNET.Controls; + +namespace ReClassNET.Forms +{ + partial class EnumListForm + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.filterNameTextBox = new PlaceholderTextBox(); + this.itemListBox = new System.Windows.Forms.ListBox(); + this.bannerBox = new BannerBox(); + this.addEnumIconButton = new IconButton(); + this.removeEnumIconButton = new IconButton(); + this.editEnumIconButton = new IconButton(); + ((System.ComponentModel.ISupportInitialize)(this.bannerBox)).BeginInit(); + this.SuspendLayout(); + // + // filterNameTextBox + // + this.filterNameTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.filterNameTextBox.Location = new System.Drawing.Point(12, 60); + this.filterNameTextBox.Name = "filterNameTextBox"; + this.filterNameTextBox.PlaceholderText = "Filter by Enum Name..."; + this.filterNameTextBox.Size = new System.Drawing.Size(411, 20); + this.filterNameTextBox.TabIndex = 10; + this.filterNameTextBox.TextChanged += new System.EventHandler(this.filterNameTextBox_TextChanged); + // + // itemListBox + // + this.itemListBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.itemListBox.DisplayMember = "Name"; + this.itemListBox.FormattingEnabled = true; + this.itemListBox.Location = new System.Drawing.Point(12, 86); + this.itemListBox.Name = "itemListBox"; + this.itemListBox.Size = new System.Drawing.Size(492, 212); + this.itemListBox.TabIndex = 11; + this.itemListBox.SelectedIndexChanged += new System.EventHandler(this.itemListBox_SelectedIndexChanged); + // + // bannerBox + // + this.bannerBox.Dock = System.Windows.Forms.DockStyle.Top; + this.bannerBox.Icon = global::ReClassNET.Properties.Resources.B16x16_Class_Type; + this.bannerBox.Location = new System.Drawing.Point(0, 0); + this.bannerBox.Name = "bannerBox"; + this.bannerBox.Size = new System.Drawing.Size(516, 48); + this.bannerBox.TabIndex = 14; + this.bannerBox.Text = "Edit the enums of the project."; + this.bannerBox.Title = "Enums"; + // + // addEnumIconButton + // + this.addEnumIconButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.addEnumIconButton.Image = global::ReClassNET.Properties.Resources.B16x16_Button_Add; + this.addEnumIconButton.Location = new System.Drawing.Point(456, 59); + this.addEnumIconButton.Name = "addEnumIconButton"; + this.addEnumIconButton.Pressed = false; + this.addEnumIconButton.Selected = false; + this.addEnumIconButton.Size = new System.Drawing.Size(23, 22); + this.addEnumIconButton.TabIndex = 15; + this.addEnumIconButton.Click += new System.EventHandler(this.addEnumIconButton_Click); + // + // removeEnumIconButton + // + this.removeEnumIconButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.removeEnumIconButton.Enabled = false; + this.removeEnumIconButton.Image = global::ReClassNET.Properties.Resources.B16x16_Button_Remove; + this.removeEnumIconButton.Location = new System.Drawing.Point(481, 59); + this.removeEnumIconButton.Name = "removeEnumIconButton"; + this.removeEnumIconButton.Pressed = false; + this.removeEnumIconButton.Selected = false; + this.removeEnumIconButton.Size = new System.Drawing.Size(23, 22); + this.removeEnumIconButton.TabIndex = 16; + this.removeEnumIconButton.Click += new System.EventHandler(this.removeEnumIconButton_Click); + // + // editEnumIconButton + // + this.editEnumIconButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.editEnumIconButton.Enabled = false; + this.editEnumIconButton.Image = global::ReClassNET.Properties.Resources.B16x16_Custom_Type; + this.editEnumIconButton.Location = new System.Drawing.Point(431, 59); + this.editEnumIconButton.Name = "editEnumIconButton"; + this.editEnumIconButton.Pressed = false; + this.editEnumIconButton.Selected = false; + this.editEnumIconButton.Size = new System.Drawing.Size(23, 22); + this.editEnumIconButton.TabIndex = 16; + this.editEnumIconButton.Click += new System.EventHandler(this.editEnumIconButton_Click); + // + // EnumListForm + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(516, 308); + this.Controls.Add(this.editEnumIconButton); + this.Controls.Add(this.addEnumIconButton); + this.Controls.Add(this.removeEnumIconButton); + this.Controls.Add(this.filterNameTextBox); + this.Controls.Add(this.itemListBox); + this.Controls.Add(this.bannerBox); + this.Name = "EnumListForm"; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; + this.Text = "ReClass.NET - Enums"; + ((System.ComponentModel.ISupportInitialize)(this.bannerBox)).EndInit(); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + private PlaceholderTextBox filterNameTextBox; + private System.Windows.Forms.ListBox itemListBox; + private BannerBox bannerBox; + private IconButton addEnumIconButton; + private IconButton removeEnumIconButton; + private IconButton editEnumIconButton; + } +} \ No newline at end of file diff --git a/ReClass.NET/Forms/EnumListForm.cs b/ReClass.NET/Forms/EnumListForm.cs new file mode 100644 index 00000000..f8cafe56 --- /dev/null +++ b/ReClass.NET/Forms/EnumListForm.cs @@ -0,0 +1,107 @@ +using System; +using System.Collections.Generic; +using System.Diagnostics.Contracts; +using System.Linq; +using System.Windows.Forms; +using ReClassNET.Project; +using ReClassNET.UI; + +namespace ReClassNET.Forms +{ + public partial class EnumListForm : IconForm + { + private readonly ReClassNetProject project; + + public EnumDescription SelectedItem => itemListBox.SelectedItem as EnumDescription; + + public EnumListForm(ReClassNetProject project) + { + Contract.Requires(project != null); + + this.project = project; + + InitializeComponent(); + + ShowFilteredEnums(); + } + + protected override void OnLoad(EventArgs e) + { + base.OnLoad(e); + + GlobalWindowManager.AddWindow(this); + } + + protected override void OnFormClosed(FormClosedEventArgs e) + { + base.OnFormClosed(e); + + GlobalWindowManager.RemoveWindow(this); + } + + private void filterNameTextBox_TextChanged(object sender, EventArgs e) + { + ShowFilteredEnums(); + } + + private void itemListBox_SelectedIndexChanged(object sender, EventArgs e) + { + editEnumIconButton.Enabled = removeEnumIconButton.Enabled = SelectedItem != null; + } + + private void editEnumIconButton_Click(object sender, EventArgs e) + { + var @enum = SelectedItem; + if (@enum == null) + { + return; + } + + using var eef = new EnumEditorForm(@enum); + + eef.ShowDialog(); + } + + private void addEnumIconButton_Click(object sender, EventArgs e) + { + var @enum = new EnumDescription + { + Name = "Enum" + }; + + using var eef = new EnumEditorForm(@enum); + + if (eef.ShowDialog() == DialogResult.OK) + { + project.AddEnum(@enum); + + ShowFilteredEnums(); + } + } + + private void removeEnumIconButton_Click(object sender, EventArgs e) + { + var @enum = SelectedItem; + if (@enum == null) + { + return; + } + + project.RemoveEnum(@enum); + + ShowFilteredEnums(); + } + + private void ShowFilteredEnums() + { + IEnumerable enums = project.Enums; + + if (!string.IsNullOrEmpty(filterNameTextBox.Text)) + { + enums = enums.Where(c => c.Name.IndexOf(filterNameTextBox.Text, StringComparison.OrdinalIgnoreCase) >= 0); + } + + itemListBox.DataSource = enums.ToList(); + } + } +} diff --git a/ReClass.NET/Forms/EnumListForm.resx b/ReClass.NET/Forms/EnumListForm.resx new file mode 100644 index 00000000..1af7de15 --- /dev/null +++ b/ReClass.NET/Forms/EnumListForm.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/ReClass.NET/Forms/EnumSelectionForm.Designer.cs b/ReClass.NET/Forms/EnumSelectionForm.Designer.cs new file mode 100644 index 00000000..6334244a --- /dev/null +++ b/ReClass.NET/Forms/EnumSelectionForm.Designer.cs @@ -0,0 +1,175 @@ +using ReClassNET.Controls; + +namespace ReClassNET.Forms +{ + partial class EnumSelectionForm + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.selectButton = new System.Windows.Forms.Button(); + this.cancelButton = new System.Windows.Forms.Button(); + this.filterNameTextBox = new PlaceholderTextBox(); + this.itemListBox = new System.Windows.Forms.ListBox(); + this.bannerBox = new BannerBox(); + this.addEnumIconButton = new IconButton(); + this.removeEnumIconButton = new IconButton(); + this.editEnumIconButton = new IconButton(); + ((System.ComponentModel.ISupportInitialize)(this.bannerBox)).BeginInit(); + this.SuspendLayout(); + // + // selectButton + // + this.selectButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.selectButton.DialogResult = System.Windows.Forms.DialogResult.OK; + this.selectButton.Enabled = false; + this.selectButton.Location = new System.Drawing.Point(328, 278); + this.selectButton.Name = "selectButton"; + this.selectButton.Size = new System.Drawing.Size(95, 23); + this.selectButton.TabIndex = 12; + this.selectButton.Text = "Select Enum"; + this.selectButton.UseVisualStyleBackColor = true; + // + // cancelButton + // + this.cancelButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.cancelButton.DialogResult = System.Windows.Forms.DialogResult.Cancel; + this.cancelButton.Location = new System.Drawing.Point(430, 278); + this.cancelButton.Name = "cancelButton"; + this.cancelButton.Size = new System.Drawing.Size(75, 23); + this.cancelButton.TabIndex = 13; + this.cancelButton.Text = "Cancel"; + this.cancelButton.UseVisualStyleBackColor = true; + // + // filterNameTextBox + // + this.filterNameTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.filterNameTextBox.Location = new System.Drawing.Point(12, 60); + this.filterNameTextBox.Name = "filterNameTextBox"; + this.filterNameTextBox.PlaceholderText = "Filter by Enum Name..."; + this.filterNameTextBox.Size = new System.Drawing.Size(411, 20); + this.filterNameTextBox.TabIndex = 10; + this.filterNameTextBox.TextChanged += new System.EventHandler(this.filterNameTextBox_TextChanged); + // + // itemListBox + // + this.itemListBox.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.itemListBox.DisplayMember = "Name"; + this.itemListBox.FormattingEnabled = true; + this.itemListBox.Location = new System.Drawing.Point(12, 86); + this.itemListBox.Name = "itemListBox"; + this.itemListBox.Size = new System.Drawing.Size(492, 186); + this.itemListBox.TabIndex = 11; + this.itemListBox.SelectedIndexChanged += new System.EventHandler(this.itemListBox_SelectedIndexChanged); + // + // bannerBox + // + this.bannerBox.Dock = System.Windows.Forms.DockStyle.Top; + this.bannerBox.Icon = global::ReClassNET.Properties.Resources.B16x16_Class_Type; + this.bannerBox.Location = new System.Drawing.Point(0, 0); + this.bannerBox.Name = "bannerBox"; + this.bannerBox.Size = new System.Drawing.Size(516, 48); + this.bannerBox.TabIndex = 14; + this.bannerBox.Text = "Select an enum of the project."; + this.bannerBox.Title = "Enum Selection"; + // + // addEnumIconButton + // + this.addEnumIconButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.addEnumIconButton.Image = global::ReClassNET.Properties.Resources.B16x16_Button_Add; + this.addEnumIconButton.Location = new System.Drawing.Point(456, 59); + this.addEnumIconButton.Name = "addEnumIconButton"; + this.addEnumIconButton.Pressed = false; + this.addEnumIconButton.Selected = false; + this.addEnumIconButton.Size = new System.Drawing.Size(23, 22); + this.addEnumIconButton.TabIndex = 15; + this.addEnumIconButton.Click += new System.EventHandler(this.addEnumIconButton_Click); + // + // removeEnumIconButton + // + this.removeEnumIconButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.removeEnumIconButton.Enabled = false; + this.removeEnumIconButton.Image = global::ReClassNET.Properties.Resources.B16x16_Button_Remove; + this.removeEnumIconButton.Location = new System.Drawing.Point(481, 59); + this.removeEnumIconButton.Name = "removeEnumIconButton"; + this.removeEnumIconButton.Pressed = false; + this.removeEnumIconButton.Selected = false; + this.removeEnumIconButton.Size = new System.Drawing.Size(23, 22); + this.removeEnumIconButton.TabIndex = 16; + this.removeEnumIconButton.Click += new System.EventHandler(this.removeEnumIconButton_Click); + // + // editEnumIconButton + // + this.editEnumIconButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.editEnumIconButton.Enabled = false; + this.editEnumIconButton.Image = global::ReClassNET.Properties.Resources.B16x16_Custom_Type; + this.editEnumIconButton.Location = new System.Drawing.Point(431, 59); + this.editEnumIconButton.Name = "editEnumIconButton"; + this.editEnumIconButton.Pressed = false; + this.editEnumIconButton.Selected = false; + this.editEnumIconButton.Size = new System.Drawing.Size(23, 22); + this.editEnumIconButton.TabIndex = 16; + this.editEnumIconButton.Click += new System.EventHandler(this.editEnumIconButton_Click); + // + // EnumSelectionForm + // + this.AcceptButton = this.selectButton; + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.CancelButton = this.cancelButton; + this.ClientSize = new System.Drawing.Size(516, 306); + this.Controls.Add(this.editEnumIconButton); + this.Controls.Add(this.addEnumIconButton); + this.Controls.Add(this.removeEnumIconButton); + this.Controls.Add(this.selectButton); + this.Controls.Add(this.cancelButton); + this.Controls.Add(this.filterNameTextBox); + this.Controls.Add(this.itemListBox); + this.Controls.Add(this.bannerBox); + this.Name = "EnumSelectionForm"; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; + this.Text = "ReClass.NET - Enum Selection"; + ((System.ComponentModel.ISupportInitialize)(this.bannerBox)).EndInit(); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.Button selectButton; + private System.Windows.Forms.Button cancelButton; + private PlaceholderTextBox filterNameTextBox; + private System.Windows.Forms.ListBox itemListBox; + 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.cs b/ReClass.NET/Forms/EnumSelectionForm.cs new file mode 100644 index 00000000..6ef69d17 --- /dev/null +++ b/ReClass.NET/Forms/EnumSelectionForm.cs @@ -0,0 +1,107 @@ +using System; +using System.Collections.Generic; +using System.Diagnostics.Contracts; +using System.Linq; +using System.Windows.Forms; +using ReClassNET.Project; +using ReClassNET.UI; + +namespace ReClassNET.Forms +{ + public partial class EnumSelectionForm : IconForm + { + private readonly ReClassNetProject project; + + public EnumDescription SelectedItem => itemListBox.SelectedItem as EnumDescription; + + public EnumSelectionForm(ReClassNetProject project) + { + Contract.Requires(project != null); + + this.project = project; + + InitializeComponent(); + + ShowFilteredEnums(); + } + + protected override void OnLoad(EventArgs e) + { + base.OnLoad(e); + + GlobalWindowManager.AddWindow(this); + } + + protected override void OnFormClosed(FormClosedEventArgs e) + { + base.OnFormClosed(e); + + GlobalWindowManager.RemoveWindow(this); + } + + private void filterNameTextBox_TextChanged(object sender, EventArgs e) + { + ShowFilteredEnums(); + } + + private void itemListBox_SelectedIndexChanged(object sender, EventArgs e) + { + selectButton.Enabled = editEnumIconButton.Enabled = removeEnumIconButton.Enabled = SelectedItem != null; + } + + private void editEnumIconButton_Click(object sender, EventArgs e) + { + var @enum = SelectedItem; + if (@enum == null) + { + return; + } + + using var eef = new EnumEditorForm(@enum); + + eef.ShowDialog(); + } + + private void addEnumIconButton_Click(object sender, EventArgs e) + { + var @enum = new EnumDescription + { + Name = "Enum" + }; + + using var eef = new EnumEditorForm(@enum); + + if (eef.ShowDialog() == DialogResult.OK) + { + project.AddEnum(@enum); + + ShowFilteredEnums(); + } + } + + private void removeEnumIconButton_Click(object sender, EventArgs e) + { + var @enum = SelectedItem; + if (@enum == null) + { + return; + } + + project.RemoveEnum(@enum); + + ShowFilteredEnums(); + } + + private void ShowFilteredEnums() + { + IEnumerable enums = project.Enums; + + if (!string.IsNullOrEmpty(filterNameTextBox.Text)) + { + enums = enums.Where(c => c.Name.IndexOf(filterNameTextBox.Text, StringComparison.OrdinalIgnoreCase) >= 0); + } + + itemListBox.DataSource = enums.ToList(); + } + } +} diff --git a/ReClass.NET/Forms/EnumSelectionForm.resx b/ReClass.NET/Forms/EnumSelectionForm.resx new file mode 100644 index 00000000..1af7de15 --- /dev/null +++ b/ReClass.NET/Forms/EnumSelectionForm.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ 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/FoundCodeForm.cs b/ReClass.NET/Forms/FoundCodeForm.cs index 0652b95d..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; @@ -6,10 +6,10 @@ using System.Text; using System.Windows.Forms; using ReClassNET.Debugger; +using ReClassNET.Extensions; using ReClassNET.Memory; using ReClassNET.Nodes; using ReClassNET.UI; -using ReClassNET.Util; namespace ReClassNET.Forms { @@ -43,11 +43,11 @@ public FoundCodeForm(RemoteProcess process, IntPtr address, HardwareBreakpointTr if (trigger == HardwareBreakpointTrigger.Write) { - Text = "Find out what writes to " + address.ToString(Constants.StringHexFormat); + Text = "Find out what writes to " + address.ToString(Constants.AddressHexFormat); } else { - Text = "Find out what accesses " + address.ToString(Constants.StringHexFormat); + Text = "Find out what accesses " + address.ToString(Constants.AddressHexFormat); } bannerBox.Text = Text; @@ -88,7 +88,7 @@ private void foundCodeDataGridView_SelectionChanged(object sender, EventArgs e) for (var i = 0; i < 5; ++i) { - var code = $"{info.Instructions[i].Address.ToString(Constants.StringHexFormat)} - {info.Instructions[i].Instruction}"; + var code = $"{info.Instructions[i].Address.ToString(Constants.AddressHexFormat)} - {info.Instructions[i].Instruction}"; if (i == 2) { sb.AppendLine(code + " <<<"); @@ -102,34 +102,34 @@ private void foundCodeDataGridView_SelectionChanged(object sender, EventArgs e) sb.AppendLine(); #if RECLASSNET64 - sb.AppendLine($"RAX = {info.DebugInfo.Registers.Rax.ToString(Constants.StringHexFormat)}"); - sb.AppendLine($"RBX = {info.DebugInfo.Registers.Rbx.ToString(Constants.StringHexFormat)}"); - sb.AppendLine($"RCX = {info.DebugInfo.Registers.Rcx.ToString(Constants.StringHexFormat)}"); - sb.AppendLine($"RDX = {info.DebugInfo.Registers.Rdx.ToString(Constants.StringHexFormat)}"); - sb.AppendLine($"RDI = {info.DebugInfo.Registers.Rdi.ToString(Constants.StringHexFormat)}"); - sb.AppendLine($"RSI = {info.DebugInfo.Registers.Rsi.ToString(Constants.StringHexFormat)}"); - sb.AppendLine($"RSP = {info.DebugInfo.Registers.Rsp.ToString(Constants.StringHexFormat)}"); - sb.AppendLine($"RBP = {info.DebugInfo.Registers.Rbp.ToString(Constants.StringHexFormat)}"); - sb.AppendLine($"RIP = {info.DebugInfo.Registers.Rip.ToString(Constants.StringHexFormat)}"); - - sb.AppendLine($"R8 = {info.DebugInfo.Registers.R8.ToString(Constants.StringHexFormat)}"); - sb.AppendLine($"R9 = {info.DebugInfo.Registers.R9.ToString(Constants.StringHexFormat)}"); - sb.AppendLine($"R10 = {info.DebugInfo.Registers.R10.ToString(Constants.StringHexFormat)}"); - sb.AppendLine($"R11 = {info.DebugInfo.Registers.R11.ToString(Constants.StringHexFormat)}"); - sb.AppendLine($"R12 = {info.DebugInfo.Registers.R12.ToString(Constants.StringHexFormat)}"); - sb.AppendLine($"R13 = {info.DebugInfo.Registers.R13.ToString(Constants.StringHexFormat)}"); - sb.AppendLine($"R14 = {info.DebugInfo.Registers.R14.ToString(Constants.StringHexFormat)}"); - sb.Append($"R15 = {info.DebugInfo.Registers.R15.ToString(Constants.StringHexFormat)}"); + sb.AppendLine($"RAX = {info.DebugInfo.Registers.Rax.ToString(Constants.AddressHexFormat)}"); + sb.AppendLine($"RBX = {info.DebugInfo.Registers.Rbx.ToString(Constants.AddressHexFormat)}"); + sb.AppendLine($"RCX = {info.DebugInfo.Registers.Rcx.ToString(Constants.AddressHexFormat)}"); + sb.AppendLine($"RDX = {info.DebugInfo.Registers.Rdx.ToString(Constants.AddressHexFormat)}"); + sb.AppendLine($"RDI = {info.DebugInfo.Registers.Rdi.ToString(Constants.AddressHexFormat)}"); + sb.AppendLine($"RSI = {info.DebugInfo.Registers.Rsi.ToString(Constants.AddressHexFormat)}"); + sb.AppendLine($"RSP = {info.DebugInfo.Registers.Rsp.ToString(Constants.AddressHexFormat)}"); + sb.AppendLine($"RBP = {info.DebugInfo.Registers.Rbp.ToString(Constants.AddressHexFormat)}"); + sb.AppendLine($"RIP = {info.DebugInfo.Registers.Rip.ToString(Constants.AddressHexFormat)}"); + + sb.AppendLine($"R8 = {info.DebugInfo.Registers.R8.ToString(Constants.AddressHexFormat)}"); + sb.AppendLine($"R9 = {info.DebugInfo.Registers.R9.ToString(Constants.AddressHexFormat)}"); + sb.AppendLine($"R10 = {info.DebugInfo.Registers.R10.ToString(Constants.AddressHexFormat)}"); + sb.AppendLine($"R11 = {info.DebugInfo.Registers.R11.ToString(Constants.AddressHexFormat)}"); + sb.AppendLine($"R12 = {info.DebugInfo.Registers.R12.ToString(Constants.AddressHexFormat)}"); + sb.AppendLine($"R13 = {info.DebugInfo.Registers.R13.ToString(Constants.AddressHexFormat)}"); + sb.AppendLine($"R14 = {info.DebugInfo.Registers.R14.ToString(Constants.AddressHexFormat)}"); + sb.Append($"R15 = {info.DebugInfo.Registers.R15.ToString(Constants.AddressHexFormat)}"); #else - sb.AppendLine($"EAX = {info.DebugInfo.Registers.Eax.ToString(Constants.StringHexFormat)}"); - sb.AppendLine($"EBX = {info.DebugInfo.Registers.Ebx.ToString(Constants.StringHexFormat)}"); - sb.AppendLine($"ECX = {info.DebugInfo.Registers.Ecx.ToString(Constants.StringHexFormat)}"); - sb.AppendLine($"EDX = {info.DebugInfo.Registers.Edx.ToString(Constants.StringHexFormat)}"); - sb.AppendLine($"EDI = {info.DebugInfo.Registers.Edi.ToString(Constants.StringHexFormat)}"); - sb.AppendLine($"ESI = {info.DebugInfo.Registers.Esi.ToString(Constants.StringHexFormat)}"); - sb.AppendLine($"ESP = {info.DebugInfo.Registers.Esp.ToString(Constants.StringHexFormat)}"); - sb.AppendLine($"EBP = {info.DebugInfo.Registers.Ebp.ToString(Constants.StringHexFormat)}"); - sb.Append($"EIP = {info.DebugInfo.Registers.Eip.ToString(Constants.StringHexFormat)}"); + sb.AppendLine($"EAX = {info.DebugInfo.Registers.Eax.ToString(Constants.AddressHexFormat)}"); + sb.AppendLine($"EBX = {info.DebugInfo.Registers.Ebx.ToString(Constants.AddressHexFormat)}"); + sb.AppendLine($"ECX = {info.DebugInfo.Registers.Ecx.ToString(Constants.AddressHexFormat)}"); + sb.AppendLine($"EDX = {info.DebugInfo.Registers.Edx.ToString(Constants.AddressHexFormat)}"); + sb.AppendLine($"EDI = {info.DebugInfo.Registers.Edi.ToString(Constants.AddressHexFormat)}"); + sb.AppendLine($"ESI = {info.DebugInfo.Registers.Esi.ToString(Constants.AddressHexFormat)}"); + sb.AppendLine($"ESP = {info.DebugInfo.Registers.Esp.ToString(Constants.AddressHexFormat)}"); + sb.AppendLine($"EBP = {info.DebugInfo.Registers.Ebp.ToString(Constants.AddressHexFormat)}"); + sb.Append($"EIP = {info.DebugInfo.Registers.Eip.ToString(Constants.AddressHexFormat)}"); #endif infoTextBox.Text = sb.ToString(); diff --git a/ReClass.NET/Forms/InputBytesForm.Designer.cs b/ReClass.NET/Forms/InputBytesForm.Designer.cs index 27e6e80d..f00713ba 100644 --- a/ReClass.NET/Forms/InputBytesForm.Designer.cs +++ b/ReClass.NET/Forms/InputBytesForm.Designer.cs @@ -45,19 +45,17 @@ private void InitializeComponent() this.label1.AutoSize = true; this.label1.Location = new System.Drawing.Point(5, 9); this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(88, 13); + this.label1.Size = new System.Drawing.Size(121, 13); this.label1.TabIndex = 1; - this.label1.Text = "Number of Bytes:"; + this.label1.Text = "Number of Bytes to add:"; // // hexRadioButton // this.hexRadioButton.AutoSize = true; - this.hexRadioButton.Checked = true; - this.hexRadioButton.Location = new System.Drawing.Point(8, 51); + this.hexRadioButton.Location = new System.Drawing.Point(77, 51); this.hexRadioButton.Name = "hexRadioButton"; this.hexRadioButton.Size = new System.Drawing.Size(44, 17); this.hexRadioButton.TabIndex = 2; - this.hexRadioButton.TabStop = true; this.hexRadioButton.Text = "Hex"; this.hexRadioButton.UseVisualStyleBackColor = true; this.hexRadioButton.CheckedChanged += new System.EventHandler(this.hexRadioButton_CheckedChanged); @@ -65,10 +63,12 @@ private void InitializeComponent() // decimalRadioButton // this.decimalRadioButton.AutoSize = true; - this.decimalRadioButton.Location = new System.Drawing.Point(58, 51); + this.decimalRadioButton.Checked = true; + this.decimalRadioButton.Location = new System.Drawing.Point(8, 51); this.decimalRadioButton.Name = "decimalRadioButton"; this.decimalRadioButton.Size = new System.Drawing.Size(63, 17); this.decimalRadioButton.TabIndex = 3; + this.decimalRadioButton.TabStop = true; this.decimalRadioButton.Text = "Decimal"; this.decimalRadioButton.UseVisualStyleBackColor = true; // @@ -111,8 +111,7 @@ private void InitializeComponent() // okButton // this.okButton.DialogResult = System.Windows.Forms.DialogResult.OK; - this.okButton.Image = global::ReClassNET.Properties.Resources.B16x16_Accept; - this.okButton.Location = new System.Drawing.Point(102, 121); + this.okButton.Location = new System.Drawing.Point(146, 121); this.okButton.Name = "okButton"; this.okButton.Size = new System.Drawing.Size(75, 23); this.okButton.TabIndex = 8; @@ -122,10 +121,9 @@ private void InitializeComponent() // // bytesNumericUpDown // - this.bytesNumericUpDown.Hexadecimal = true; this.bytesNumericUpDown.Location = new System.Drawing.Point(8, 25); this.bytesNumericUpDown.Name = "bytesNumericUpDown"; - this.bytesNumericUpDown.Size = new System.Drawing.Size(168, 20); + this.bytesNumericUpDown.Size = new System.Drawing.Size(212, 20); this.bytesNumericUpDown.TabIndex = 9; this.bytesNumericUpDown.ValueChanged += new System.EventHandler(this.bytesNumericUpDown_ValueChanged); // @@ -134,7 +132,7 @@ private void InitializeComponent() this.AcceptButton = this.okButton; this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(184, 151); + this.ClientSize = new System.Drawing.Size(228, 151); this.Controls.Add(this.bytesNumericUpDown); this.Controls.Add(this.okButton); this.Controls.Add(this.newSizeLabel); @@ -144,6 +142,7 @@ private void InitializeComponent() this.Controls.Add(this.decimalRadioButton); this.Controls.Add(this.hexRadioButton); this.Controls.Add(this.label1); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; this.MaximizeBox = false; this.MinimizeBox = false; this.Name = "InputBytesForm"; diff --git a/ReClass.NET/Forms/InputCorrelatorForm.Designer.cs b/ReClass.NET/Forms/InputCorrelatorForm.Designer.cs index 09f912cd..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 ScannerForm.ScanValueTypeComboBox(); + 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(); @@ -165,6 +167,8 @@ private void InitializeComponent() this.Controls.Add(this.settingsGroupBox); this.Controls.Add(this.bannerBox); this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; + this.MaximizeBox = false; + this.MinimizeBox = false; this.Name = "InputCorrelatorForm"; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; this.Text = "Input Correlator"; @@ -179,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/InputCorrelatorForm.cs b/ReClass.NET/Forms/InputCorrelatorForm.cs index 887d5e70..79508029 100644 --- a/ReClass.NET/Forms/InputCorrelatorForm.cs +++ b/ReClass.NET/Forms/InputCorrelatorForm.cs @@ -5,7 +5,9 @@ using System.Threading.Tasks; using System.Windows.Forms; using ReClassNET.Input; +using ReClassNET.Memory; using ReClassNET.MemoryScanner; +using ReClassNET.UI; namespace ReClassNET.Forms { @@ -14,17 +16,21 @@ public partial class InputCorrelatorForm : IconForm private static readonly TimeSpan refineInterval = TimeSpan.FromMilliseconds(400); private readonly ScannerForm scannerForm; + private readonly RemoteProcess process; + private readonly KeyboardInput input; private InputCorrelatedScanner scanner; private bool isScanning = false; private DateTime lastRefineTime; - public InputCorrelatorForm(ScannerForm sf) + public InputCorrelatorForm(ScannerForm scannerForm, RemoteProcess process) { - Contract.Requires(sf != null); + Contract.Requires(scannerForm != null); + Contract.Requires(process != null); - scannerForm = sf; + this.scannerForm = scannerForm; + this.process = process; InitializeComponent(); @@ -45,6 +51,20 @@ public InputCorrelatorForm(ScannerForm sf) infoLabel.Text = string.Empty; } + protected override void OnLoad(EventArgs e) + { + base.OnLoad(e); + + GlobalWindowManager.AddWindow(this); + } + + protected override void OnFormClosed(FormClosedEventArgs e) + { + base.OnFormClosed(e); + + GlobalWindowManager.RemoveWindow(this); + } + #region Event Handler private async void InputCorrelatorForm_FormClosing(object sender, FormClosingEventArgs e) @@ -107,7 +127,7 @@ private async void startStopButton_Click(object sender, EventArgs e) } scanner = new InputCorrelatedScanner( - Program.RemoteProcess, + process, input, hotkeyListBox.Items.Cast(), valueTypeComboBox.SelectedValue 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/MainForm.Designer.cs b/ReClass.NET/Forms/MainForm.Designer.cs index 8febcf52..e2b2a199 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,8 +34,71 @@ 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.classesView = new ReClassNET.UI.ClassNodeView(); - this.memoryViewControl = new ReClassNET.UI.MemoryViewControl(); + 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(); + this.removeUnusedClassesToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripSeparator20 = new System.Windows.Forms.ToolStripSeparator(); + this.showCodeOfClassToolStripMenuItem2 = new System.Windows.Forms.ToolStripMenuItem(); + this.projectClassesContextMenuStrip = new System.Windows.Forms.ContextMenuStrip(this.components); + this.enableHierarchyViewToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.autoExpandHierarchyViewToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripSeparator21 = new System.Windows.Forms.ToolStripSeparator(); + this.expandAllClassesToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.collapseAllClassesToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripSeparator22 = new System.Windows.Forms.ToolStripSeparator(); + this.addNewClassToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.projectEnumContextMenuStrip = new System.Windows.Forms.ContextMenuStrip(this.components); + 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.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 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 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(); + this.toolStripSeparator13 = new System.Windows.Forms.ToolStripSeparator(); + this.dissectNodesToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripSeparator9 = new System.Windows.Forms.ToolStripSeparator(); + this.searchForEqualValuesToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripSeparator15 = new System.Windows.Forms.ToolStripSeparator(); + this.findOutWhatAccessesThisAddressToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.findOutWhatWritesToThisAddressToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripSeparator14 = new System.Windows.Forms.ToolStripSeparator(); + this.copyNodeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.pasteNodesToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripSeparator10 = new System.Windows.Forms.ToolStripSeparator(); + this.removeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripSeparator12 = new System.Windows.Forms.ToolStripSeparator(); + this.hideNodesToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.unhideNodesToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.unhideChildNodesToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.unhideNodesAboveToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.unhideNodesBelowToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripSeparator18 = new System.Windows.Forms.ToolStripSeparator(); + this.copyAddressToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripSeparator11 = new System.Windows.Forms.ToolStripSeparator(); + this.showCodeOfClassToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.shrinkClassToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.toolStrip = new System.Windows.Forms.ToolStrip(); this.attachToProcessToolStripSplitButton = new System.Windows.Forms.ToolStripSplitButton(); this.toolStripSeparator6 = new System.Windows.Forms.ToolStripSeparator(); @@ -42,66 +107,24 @@ 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 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 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 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.toolStripSeparator8 = new System.Windows.Forms.ToolStripSeparator(); - this.hex64ToolStripButton = new ReClassNET.UI.TypeToolStripButton(); - this.hex32ToolStripButton = new ReClassNET.UI.TypeToolStripButton(); - this.hex16ToolStripButton = new ReClassNET.UI.TypeToolStripButton(); - this.hex8ToolStripButton = new ReClassNET.UI.TypeToolStripButton(); - this.toolStripSeparator9 = new System.Windows.Forms.ToolStripSeparator(); - this.int64ToolStripButton = new ReClassNET.UI.TypeToolStripButton(); - this.int32ToolStripButton = new ReClassNET.UI.TypeToolStripButton(); - this.int16ToolStripButton = new ReClassNET.UI.TypeToolStripButton(); - this.int8ToolStripButton = new ReClassNET.UI.TypeToolStripButton(); - this.toolStripSeparator10 = new System.Windows.Forms.ToolStripSeparator(); - this.uint64ToolStripButton = new ReClassNET.UI.TypeToolStripButton(); - this.uint32ToolStripButton = new ReClassNET.UI.TypeToolStripButton(); - this.uint16ToolStripButton = new ReClassNET.UI.TypeToolStripButton(); - this.uint8ToolStripButton = new ReClassNET.UI.TypeToolStripButton(); - this.toolStripSeparator11 = new System.Windows.Forms.ToolStripSeparator(); - this.boolToolStripButton = new ReClassNET.UI.TypeToolStripButton(); - this.bitFieldToolStripButton = new ReClassNET.UI.TypeToolStripButton(); - this.toolStripSeparator18 = new System.Windows.Forms.ToolStripSeparator(); - this.floatToolStripButton = new ReClassNET.UI.TypeToolStripButton(); - this.doubleToolStripButton = new ReClassNET.UI.TypeToolStripButton(); - this.toolStripSeparator12 = new System.Windows.Forms.ToolStripSeparator(); - this.vec4ToolStripButton = new ReClassNET.UI.TypeToolStripButton(); - this.vec3ToolStripButton = new ReClassNET.UI.TypeToolStripButton(); - this.vec2ToolStripButton = new ReClassNET.UI.TypeToolStripButton(); - this.mat44ToolStripButton = new ReClassNET.UI.TypeToolStripButton(); - this.mat34ToolStripButton = new ReClassNET.UI.TypeToolStripButton(); - this.mat33ToolStripButton = new ReClassNET.UI.TypeToolStripButton(); - this.toolStripSeparator13 = new System.Windows.Forms.ToolStripSeparator(); - this.utf8TextToolStripButton = new ReClassNET.UI.TypeToolStripButton(); - this.utf8TextPtrToolStripButton = new ReClassNET.UI.TypeToolStripButton(); - this.utf16TextToolStripButton = new ReClassNET.UI.TypeToolStripButton(); - this.utf16TextPtrToolStripButton = new ReClassNET.UI.TypeToolStripButton(); - this.toolStripSeparator14 = new System.Windows.Forms.ToolStripSeparator(); - this.classInstanceToolStripButton6 = new ReClassNET.UI.TypeToolStripButton(); - this.classPtrToolStripButton = new ReClassNET.UI.TypeToolStripButton(); - this.toolStripSeparator15 = new System.Windows.Forms.ToolStripSeparator(); - this.arrayToolStripButton = new ReClassNET.UI.TypeToolStripButton(); - this.ptrArrayToolStripButton = new ReClassNET.UI.TypeToolStripButton(); - this.vtableToolStripButton = new ReClassNET.UI.TypeToolStripButton(); - this.fnPtrToolStripButton = new ReClassNET.UI.TypeToolStripButton(); - this.fnTypeToolStripButton = new ReClassNET.UI.TypeToolStripButton(); - this.toolStripSeparator19 = new System.Windows.Forms.ToolStripSeparator(); + this.nodeTypesToolStripSeparator = new System.Windows.Forms.ToolStripSeparator(); this.statusStrip = new System.Windows.Forms.StatusStrip(); this.processInfoToolStripStatusLabel = new System.Windows.Forms.ToolStripStatusLabel(); this.infoToolStripStatusLabel = new System.Windows.Forms.ToolStripStatusLabel(); @@ -125,6 +148,9 @@ private void InitializeComponent() this.processToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); 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(); @@ -133,7 +159,9 @@ private void InitializeComponent() this.suspendProcessToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.terminateProcessToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); 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(); @@ -143,6 +171,11 @@ private void InitializeComponent() this.splitContainer.Panel1.SuspendLayout(); this.splitContainer.Panel2.SuspendLayout(); this.splitContainer.SuspendLayout(); + this.projectClassContextMenuStrip.SuspendLayout(); + this.projectClassesContextMenuStrip.SuspendLayout(); + this.projectEnumContextMenuStrip.SuspendLayout(); + this.projectEnumsContextMenuStrip.SuspendLayout(); + this.selectedNodeContextMenuStrip.SuspendLayout(); this.toolStrip.SuspendLayout(); this.statusStrip.SuspendLayout(); this.mainMenuStrip.SuspendLayout(); @@ -163,7 +196,7 @@ private void InitializeComponent() // // splitContainer.Panel1 // - this.splitContainer.Panel1.Controls.Add(this.classesView); + this.splitContainer.Panel1.Controls.Add(this.projectView); // // splitContainer.Panel2 // @@ -173,14 +206,156 @@ private void InitializeComponent() this.splitContainer.SplitterDistance = 201; this.splitContainer.TabIndex = 4; // - // classesView + // projectView + // + this.projectView.ClassContextMenuStrip = this.projectClassContextMenuStrip; + this.projectView.ClassesContextMenuStrip = this.projectClassesContextMenuStrip; + this.projectView.Dock = System.Windows.Forms.DockStyle.Fill; + this.projectView.EnumContextMenuStrip = this.projectEnumContextMenuStrip; + this.projectView.EnumsContextMenuStrip = this.projectEnumsContextMenuStrip; + this.projectView.Location = new System.Drawing.Point(0, 0); + this.projectView.Name = "projectView"; + this.projectView.Size = new System.Drawing.Size(201, 524); + this.projectView.TabIndex = 0; + this.projectView.SelectionChanged += new ReClassNET.Controls.ProjectView.SelectionChangedEvent(this.classesView_ClassSelected); + // + // projectClassContextMenuStrip + // + this.projectClassContextMenuStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.deleteClassToolStripMenuItem, + this.toolStripSeparator19, + this.removeUnusedClassesToolStripMenuItem, + this.toolStripSeparator20, + this.showCodeOfClassToolStripMenuItem2}); + this.projectClassContextMenuStrip.Name = "contextMenuStrip"; + this.projectClassContextMenuStrip.Size = new System.Drawing.Size(206, 82); + // + // deleteClassToolStripMenuItem + // + this.deleteClassToolStripMenuItem.Image = global::ReClassNET.Properties.Resources.B16x16_Button_Class_Remove; + this.deleteClassToolStripMenuItem.Name = "deleteClassToolStripMenuItem"; + this.deleteClassToolStripMenuItem.Size = new System.Drawing.Size(205, 22); + this.deleteClassToolStripMenuItem.Text = "Delete class"; + this.deleteClassToolStripMenuItem.Click += new System.EventHandler(this.deleteClassToolStripMenuItem_Click); + // + // toolStripSeparator19 + // + this.toolStripSeparator19.Name = "toolStripSeparator19"; + this.toolStripSeparator19.Size = new System.Drawing.Size(202, 6); + // + // removeUnusedClassesToolStripMenuItem + // + this.removeUnusedClassesToolStripMenuItem.Image = global::ReClassNET.Properties.Resources.B16x16_Chart_Delete; + this.removeUnusedClassesToolStripMenuItem.Name = "removeUnusedClassesToolStripMenuItem"; + this.removeUnusedClassesToolStripMenuItem.Size = new System.Drawing.Size(205, 22); + this.removeUnusedClassesToolStripMenuItem.Text = "Remove unused classes"; + this.removeUnusedClassesToolStripMenuItem.Click += new System.EventHandler(this.removeUnusedClassesToolStripMenuItem_Click); + // + // toolStripSeparator20 + // + this.toolStripSeparator20.Name = "toolStripSeparator20"; + this.toolStripSeparator20.Size = new System.Drawing.Size(202, 6); + // + // showCodeOfClassToolStripMenuItem2 + // + this.showCodeOfClassToolStripMenuItem2.Image = global::ReClassNET.Properties.Resources.B16x16_Page_Code_Cpp; + this.showCodeOfClassToolStripMenuItem2.Name = "showCodeOfClassToolStripMenuItem2"; + this.showCodeOfClassToolStripMenuItem2.Size = new System.Drawing.Size(205, 22); + this.showCodeOfClassToolStripMenuItem2.Text = "Show C++ Code of Class"; + this.showCodeOfClassToolStripMenuItem2.Click += new System.EventHandler(this.showCodeOfClassToolStripMenuItem2_Click); + // + // projectClassesContextMenuStrip + // + this.projectClassesContextMenuStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.enableHierarchyViewToolStripMenuItem, + this.autoExpandHierarchyViewToolStripMenuItem, + this.toolStripSeparator21, + this.expandAllClassesToolStripMenuItem, + this.collapseAllClassesToolStripMenuItem, + this.toolStripSeparator22, + this.addNewClassToolStripMenuItem}); + this.projectClassesContextMenuStrip.Name = "rootContextMenuStrip"; + this.projectClassesContextMenuStrip.Size = new System.Drawing.Size(222, 126); + // + // enableHierarchyViewToolStripMenuItem + // + this.enableHierarchyViewToolStripMenuItem.Name = "enableHierarchyViewToolStripMenuItem"; + 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(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(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(221, 22); + this.expandAllClassesToolStripMenuItem.Text = "Expand all classes"; + this.expandAllClassesToolStripMenuItem.Click += new System.EventHandler(this.expandAllClassesToolStripMenuItem_Click); + // + // collapseAllClassesToolStripMenuItem + // + 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(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(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(221, 22); + this.addNewClassToolStripMenuItem.Text = "Add new class"; + this.addNewClassToolStripMenuItem.Click += new System.EventHandler(this.newClassToolStripButton_Click); + // + // projectEnumContextMenuStrip + // + this.projectEnumContextMenuStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.editEnumToolStripMenuItem}); + this.projectEnumContextMenuStrip.Name = "projectEnumContextMenuStrip"; + this.projectEnumContextMenuStrip.Size = new System.Drawing.Size(138, 26); + // + // editEnumToolStripMenuItem + // + this.editEnumToolStripMenuItem.Image = global::ReClassNET.Properties.Resources.B16x16_Enum_Type; + this.editEnumToolStripMenuItem.Name = "editEnumToolStripMenuItem"; + this.editEnumToolStripMenuItem.Size = new System.Drawing.Size(137, 22); + this.editEnumToolStripMenuItem.Text = "Edit Enum..."; + this.editEnumToolStripMenuItem.Click += new System.EventHandler(this.editEnumToolStripMenuItem_Click); + // + // projectEnumsContextMenuStrip + // + this.projectEnumsContextMenuStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.editEnumsToolStripMenuItem}); + this.projectEnumsContextMenuStrip.Name = "projectEnumsContextMenuStrip"; + this.projectEnumsContextMenuStrip.Size = new System.Drawing.Size(143, 26); // - this.classesView.Dock = System.Windows.Forms.DockStyle.Fill; - this.classesView.Location = new System.Drawing.Point(0, 0); - this.classesView.Name = "classesView"; - this.classesView.Size = new System.Drawing.Size(201, 524); - this.classesView.TabIndex = 0; - this.classesView.SelectionChanged += new ReClassNET.UI.ClassNodeView.SelectionChangedEvent(this.classesView_ClassSelected); + // editEnumsToolStripMenuItem + // + this.editEnumsToolStripMenuItem.Image = global::ReClassNET.Properties.Resources.B16x16_Category; + this.editEnumsToolStripMenuItem.Name = "editEnumsToolStripMenuItem"; + this.editEnumsToolStripMenuItem.Size = new System.Drawing.Size(142, 22); + this.editEnumsToolStripMenuItem.Text = "Edit enums..."; + this.editEnumsToolStripMenuItem.Click += new System.EventHandler(this.editEnumsToolStripMenuItem_Click); // // memoryViewControl // @@ -188,9 +363,404 @@ private void InitializeComponent() this.memoryViewControl.Dock = System.Windows.Forms.DockStyle.Fill; this.memoryViewControl.Location = new System.Drawing.Point(0, 0); this.memoryViewControl.Name = "memoryViewControl"; + this.memoryViewControl.NodeContextMenuStrip = this.selectedNodeContextMenuStrip; this.memoryViewControl.Size = new System.Drawing.Size(936, 524); this.memoryViewControl.TabIndex = 0; + this.memoryViewControl.DrawContextRequested += new ReClassNET.Controls.DrawContextRequestEventHandler(this.memoryViewControl_DrawContextRequested); this.memoryViewControl.SelectionChanged += new System.EventHandler(this.memoryViewControl_SelectionChanged); + 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 + // + this.selectedNodeContextMenuStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.changeTypeToolStripMenuItem, + this.addBytesToolStripMenuItem, + this.insertBytesToolStripMenuItem, + this.toolStripSeparator8, + this.createClassFromNodesToolStripMenuItem, + this.toolStripSeparator13, + this.dissectNodesToolStripMenuItem, + this.toolStripSeparator9, + this.searchForEqualValuesToolStripMenuItem, + this.toolStripSeparator15, + this.findOutWhatAccessesThisAddressToolStripMenuItem, + this.findOutWhatWritesToThisAddressToolStripMenuItem, + this.toolStripSeparator14, + this.copyNodeToolStripMenuItem, + this.pasteNodesToolStripMenuItem, + this.toolStripSeparator10, + this.removeToolStripMenuItem, + this.toolStripSeparator12, + this.hideNodesToolStripMenuItem, + this.unhideNodesToolStripMenuItem, + this.toolStripSeparator18, + this.copyAddressToolStripMenuItem, + this.toolStripSeparator11, + this.showCodeOfClassToolStripMenuItem, + this.shrinkClassToolStripMenuItem}); + this.selectedNodeContextMenuStrip.Name = "selectedNodeContextMenuStrip"; + this.selectedNodeContextMenuStrip.Size = new System.Drawing.Size(270, 410); + this.selectedNodeContextMenuStrip.Opening += new System.ComponentModel.CancelEventHandler(this.selectedNodeContextMenuStrip_Opening); + // + // changeTypeToolStripMenuItem + // + this.changeTypeToolStripMenuItem.Image = global::ReClassNET.Properties.Resources.B16x16_Exchange_Button; + this.changeTypeToolStripMenuItem.Name = "changeTypeToolStripMenuItem"; + this.changeTypeToolStripMenuItem.Size = new System.Drawing.Size(269, 22); + this.changeTypeToolStripMenuItem.Text = "Change Type"; + // + // addBytesToolStripMenuItem + // + this.addBytesToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.integerToolStripMenuItem1, + this.integerToolStripMenuItem2, + this.integerToolStripMenuItem3, + this.integerToolStripMenuItem4, + this.integerToolStripMenuItem5, + this.integerToolStripMenuItem6, + this.integerToolStripMenuItem7, + this.toolStripMenuItem1}); + this.addBytesToolStripMenuItem.Image = global::ReClassNET.Properties.Resources.B16x16_Button_Add_Bytes_X; + this.addBytesToolStripMenuItem.Name = "addBytesToolStripMenuItem"; + this.addBytesToolStripMenuItem.Size = new System.Drawing.Size(269, 22); + this.addBytesToolStripMenuItem.Text = "Add Bytes"; + // + // integerToolStripMenuItem1 + // + this.integerToolStripMenuItem1.Image = global::ReClassNET.Properties.Resources.B16x16_Button_Add_Bytes_4; + this.integerToolStripMenuItem1.Name = "integerToolStripMenuItem1"; + this.integerToolStripMenuItem1.Size = new System.Drawing.Size(154, 22); + this.integerToolStripMenuItem1.Text = "Add 4 Bytes"; + this.integerToolStripMenuItem1.Value = 4; + this.integerToolStripMenuItem1.Click += new System.EventHandler(this.addBytesToolStripMenuItem_Click); + // + // integerToolStripMenuItem2 + // + this.integerToolStripMenuItem2.Image = global::ReClassNET.Properties.Resources.B16x16_Button_Add_Bytes_8; + this.integerToolStripMenuItem2.Name = "integerToolStripMenuItem2"; + this.integerToolStripMenuItem2.Size = new System.Drawing.Size(154, 22); + this.integerToolStripMenuItem2.Text = "Add 8 Bytes"; + this.integerToolStripMenuItem2.Value = 8; + this.integerToolStripMenuItem2.Click += new System.EventHandler(this.addBytesToolStripMenuItem_Click); + // + // integerToolStripMenuItem3 + // + this.integerToolStripMenuItem3.Image = global::ReClassNET.Properties.Resources.B16x16_Button_Add_Bytes_64; + this.integerToolStripMenuItem3.Name = "integerToolStripMenuItem3"; + this.integerToolStripMenuItem3.Size = new System.Drawing.Size(154, 22); + this.integerToolStripMenuItem3.Text = "Add 64 Bytes"; + this.integerToolStripMenuItem3.Value = 64; + this.integerToolStripMenuItem3.Click += new System.EventHandler(this.addBytesToolStripMenuItem_Click); + // + // integerToolStripMenuItem4 + // + this.integerToolStripMenuItem4.Image = global::ReClassNET.Properties.Resources.B16x16_Button_Add_Bytes_256; + this.integerToolStripMenuItem4.Name = "integerToolStripMenuItem4"; + this.integerToolStripMenuItem4.Size = new System.Drawing.Size(154, 22); + this.integerToolStripMenuItem4.Text = "Add 256 Bytes"; + this.integerToolStripMenuItem4.Value = 256; + this.integerToolStripMenuItem4.Click += new System.EventHandler(this.addBytesToolStripMenuItem_Click); + // + // integerToolStripMenuItem5 + // + this.integerToolStripMenuItem5.Image = global::ReClassNET.Properties.Resources.B16x16_Button_Add_Bytes_1024; + this.integerToolStripMenuItem5.Name = "integerToolStripMenuItem5"; + this.integerToolStripMenuItem5.Size = new System.Drawing.Size(154, 22); + this.integerToolStripMenuItem5.Text = "Add 1024 Bytes"; + this.integerToolStripMenuItem5.Value = 1024; + this.integerToolStripMenuItem5.Click += new System.EventHandler(this.addBytesToolStripMenuItem_Click); + // + // integerToolStripMenuItem6 + // + this.integerToolStripMenuItem6.Image = global::ReClassNET.Properties.Resources.B16x16_Button_Add_Bytes_2048; + this.integerToolStripMenuItem6.Name = "integerToolStripMenuItem6"; + this.integerToolStripMenuItem6.Size = new System.Drawing.Size(154, 22); + this.integerToolStripMenuItem6.Text = "Add 2048 Bytes"; + this.integerToolStripMenuItem6.Value = 2048; + this.integerToolStripMenuItem6.Click += new System.EventHandler(this.addBytesToolStripMenuItem_Click); + // + // integerToolStripMenuItem7 + // + this.integerToolStripMenuItem7.Image = global::ReClassNET.Properties.Resources.B16x16_Button_Add_Bytes_4096; + this.integerToolStripMenuItem7.Name = "integerToolStripMenuItem7"; + this.integerToolStripMenuItem7.Size = new System.Drawing.Size(154, 22); + this.integerToolStripMenuItem7.Text = "Add 4096 Bytes"; + this.integerToolStripMenuItem7.Value = 4096; + this.integerToolStripMenuItem7.Click += new System.EventHandler(this.addBytesToolStripMenuItem_Click); + // + // toolStripMenuItem1 + // + this.toolStripMenuItem1.Image = global::ReClassNET.Properties.Resources.B16x16_Button_Add_Bytes_X; + this.toolStripMenuItem1.Name = "toolStripMenuItem1"; + this.toolStripMenuItem1.Size = new System.Drawing.Size(154, 22); + this.toolStripMenuItem1.Text = "Add ... Bytes"; + this.toolStripMenuItem1.Click += new System.EventHandler(this.addXBytesToolStripMenuItem_Click); + // + // insertBytesToolStripMenuItem + // + this.insertBytesToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.integerToolStripMenuItem8, + this.integerToolStripMenuItem9, + this.integerToolStripMenuItem10, + this.integerToolStripMenuItem11, + this.integerToolStripMenuItem12, + this.integerToolStripMenuItem13, + this.integerToolStripMenuItem14, + this.toolStripMenuItem2}); + this.insertBytesToolStripMenuItem.Image = global::ReClassNET.Properties.Resources.B16x16_Button_Insert_Bytes_X; + this.insertBytesToolStripMenuItem.Name = "insertBytesToolStripMenuItem"; + this.insertBytesToolStripMenuItem.Size = new System.Drawing.Size(269, 22); + this.insertBytesToolStripMenuItem.Text = "Insert Bytes"; + // + // integerToolStripMenuItem8 + // + this.integerToolStripMenuItem8.Image = global::ReClassNET.Properties.Resources.B16x16_Button_Insert_Bytes_4; + this.integerToolStripMenuItem8.Name = "integerToolStripMenuItem8"; + this.integerToolStripMenuItem8.Size = new System.Drawing.Size(161, 22); + this.integerToolStripMenuItem8.Text = "Insert 4 Bytes"; + this.integerToolStripMenuItem8.Value = 4; + this.integerToolStripMenuItem8.Click += new System.EventHandler(this.insertBytesToolStripMenuItem_Click); + // + // integerToolStripMenuItem9 + // + this.integerToolStripMenuItem9.Image = global::ReClassNET.Properties.Resources.B16x16_Button_Insert_Bytes_8; + this.integerToolStripMenuItem9.Name = "integerToolStripMenuItem9"; + this.integerToolStripMenuItem9.Size = new System.Drawing.Size(161, 22); + this.integerToolStripMenuItem9.Text = "Insert 8 Bytes"; + this.integerToolStripMenuItem9.Value = 8; + this.integerToolStripMenuItem9.Click += new System.EventHandler(this.insertBytesToolStripMenuItem_Click); + // + // integerToolStripMenuItem10 + // + this.integerToolStripMenuItem10.Image = global::ReClassNET.Properties.Resources.B16x16_Button_Insert_Bytes_64; + this.integerToolStripMenuItem10.Name = "integerToolStripMenuItem10"; + this.integerToolStripMenuItem10.Size = new System.Drawing.Size(161, 22); + this.integerToolStripMenuItem10.Text = "Insert 64 Bytes"; + this.integerToolStripMenuItem10.Value = 64; + this.integerToolStripMenuItem10.Click += new System.EventHandler(this.insertBytesToolStripMenuItem_Click); + // + // integerToolStripMenuItem11 + // + this.integerToolStripMenuItem11.Image = global::ReClassNET.Properties.Resources.B16x16_Button_Insert_Bytes_256; + this.integerToolStripMenuItem11.Name = "integerToolStripMenuItem11"; + this.integerToolStripMenuItem11.Size = new System.Drawing.Size(161, 22); + this.integerToolStripMenuItem11.Text = "Insert 256 Bytes"; + this.integerToolStripMenuItem11.Value = 256; + this.integerToolStripMenuItem11.Click += new System.EventHandler(this.insertBytesToolStripMenuItem_Click); + // + // integerToolStripMenuItem12 + // + this.integerToolStripMenuItem12.Image = global::ReClassNET.Properties.Resources.B16x16_Button_Insert_Bytes_1024; + this.integerToolStripMenuItem12.Name = "integerToolStripMenuItem12"; + this.integerToolStripMenuItem12.Size = new System.Drawing.Size(161, 22); + this.integerToolStripMenuItem12.Text = "Insert 1024 Bytes"; + this.integerToolStripMenuItem12.Value = 1024; + this.integerToolStripMenuItem12.Click += new System.EventHandler(this.insertBytesToolStripMenuItem_Click); + // + // integerToolStripMenuItem13 + // + this.integerToolStripMenuItem13.Image = global::ReClassNET.Properties.Resources.B16x16_Button_Insert_Bytes_2048; + this.integerToolStripMenuItem13.Name = "integerToolStripMenuItem13"; + this.integerToolStripMenuItem13.Size = new System.Drawing.Size(161, 22); + this.integerToolStripMenuItem13.Text = "Insert 2048 Bytes"; + this.integerToolStripMenuItem13.Value = 2048; + this.integerToolStripMenuItem13.Click += new System.EventHandler(this.insertBytesToolStripMenuItem_Click); + // + // integerToolStripMenuItem14 + // + this.integerToolStripMenuItem14.Image = global::ReClassNET.Properties.Resources.B16x16_Button_Insert_Bytes_4096; + this.integerToolStripMenuItem14.Name = "integerToolStripMenuItem14"; + this.integerToolStripMenuItem14.Size = new System.Drawing.Size(161, 22); + this.integerToolStripMenuItem14.Text = "Insert 4096 Bytes"; + this.integerToolStripMenuItem14.Value = 4096; + this.integerToolStripMenuItem14.Click += new System.EventHandler(this.insertBytesToolStripMenuItem_Click); + // + // toolStripMenuItem2 + // + this.toolStripMenuItem2.Image = global::ReClassNET.Properties.Resources.B16x16_Button_Insert_Bytes_X; + this.toolStripMenuItem2.Name = "toolStripMenuItem2"; + this.toolStripMenuItem2.Size = new System.Drawing.Size(161, 22); + this.toolStripMenuItem2.Text = "Insert ... Bytes"; + this.toolStripMenuItem2.Click += new System.EventHandler(this.insertXBytesToolStripMenuItem_Click); + // + // toolStripSeparator8 + // + this.toolStripSeparator8.Name = "toolStripSeparator8"; + this.toolStripSeparator8.Size = new System.Drawing.Size(266, 6); + // + // createClassFromNodesToolStripMenuItem + // + this.createClassFromNodesToolStripMenuItem.Image = global::ReClassNET.Properties.Resources.B16x16_Button_Class_Add; + this.createClassFromNodesToolStripMenuItem.Name = "createClassFromNodesToolStripMenuItem"; + this.createClassFromNodesToolStripMenuItem.Size = new System.Drawing.Size(269, 22); + this.createClassFromNodesToolStripMenuItem.Text = "Create Class from Nodes"; + this.createClassFromNodesToolStripMenuItem.Click += new System.EventHandler(this.createClassFromNodesToolStripMenuItem_Click); + // + // toolStripSeparator13 + // + this.toolStripSeparator13.Name = "toolStripSeparator13"; + this.toolStripSeparator13.Size = new System.Drawing.Size(266, 6); + // + // dissectNodesToolStripMenuItem + // + this.dissectNodesToolStripMenuItem.Image = global::ReClassNET.Properties.Resources.B16x16_Camera; + this.dissectNodesToolStripMenuItem.Name = "dissectNodesToolStripMenuItem"; + this.dissectNodesToolStripMenuItem.Size = new System.Drawing.Size(269, 22); + this.dissectNodesToolStripMenuItem.Text = "Dissect Node(s)"; + this.dissectNodesToolStripMenuItem.Click += new System.EventHandler(this.dissectNodesToolStripMenuItem_Click); + // + // toolStripSeparator9 + // + this.toolStripSeparator9.Name = "toolStripSeparator9"; + this.toolStripSeparator9.Size = new System.Drawing.Size(266, 6); + // + // searchForEqualValuesToolStripMenuItem + // + this.searchForEqualValuesToolStripMenuItem.Image = global::ReClassNET.Properties.Resources.B16x16_Eye; + this.searchForEqualValuesToolStripMenuItem.Name = "searchForEqualValuesToolStripMenuItem"; + this.searchForEqualValuesToolStripMenuItem.Size = new System.Drawing.Size(269, 22); + this.searchForEqualValuesToolStripMenuItem.Text = "Search for equal values..."; + this.searchForEqualValuesToolStripMenuItem.Click += new System.EventHandler(this.searchForEqualValuesToolStripMenuItem_Click); + // + // toolStripSeparator15 + // + this.toolStripSeparator15.Name = "toolStripSeparator15"; + this.toolStripSeparator15.Size = new System.Drawing.Size(266, 6); + // + // findOutWhatAccessesThisAddressToolStripMenuItem + // + this.findOutWhatAccessesThisAddressToolStripMenuItem.Image = global::ReClassNET.Properties.Resources.B16x16_Find_Access; + this.findOutWhatAccessesThisAddressToolStripMenuItem.Name = "findOutWhatAccessesThisAddressToolStripMenuItem"; + this.findOutWhatAccessesThisAddressToolStripMenuItem.Size = new System.Drawing.Size(269, 22); + this.findOutWhatAccessesThisAddressToolStripMenuItem.Text = "Find out what accesses this address..."; + this.findOutWhatAccessesThisAddressToolStripMenuItem.Click += new System.EventHandler(this.findOutWhatAccessesThisAddressToolStripMenuItem_Click); + // + // findOutWhatWritesToThisAddressToolStripMenuItem + // + this.findOutWhatWritesToThisAddressToolStripMenuItem.Image = global::ReClassNET.Properties.Resources.B16x16_Find_Write; + this.findOutWhatWritesToThisAddressToolStripMenuItem.Name = "findOutWhatWritesToThisAddressToolStripMenuItem"; + this.findOutWhatWritesToThisAddressToolStripMenuItem.Size = new System.Drawing.Size(269, 22); + this.findOutWhatWritesToThisAddressToolStripMenuItem.Text = "Find out what writes to this address..."; + this.findOutWhatWritesToThisAddressToolStripMenuItem.Click += new System.EventHandler(this.findOutWhatWritesToThisAddressToolStripMenuItem_Click); + // + // toolStripSeparator14 + // + this.toolStripSeparator14.Name = "toolStripSeparator14"; + this.toolStripSeparator14.Size = new System.Drawing.Size(266, 6); + // + // copyNodeToolStripMenuItem + // + this.copyNodeToolStripMenuItem.Image = global::ReClassNET.Properties.Resources.B16x16_Page_Copy; + this.copyNodeToolStripMenuItem.Name = "copyNodeToolStripMenuItem"; + this.copyNodeToolStripMenuItem.Size = new System.Drawing.Size(269, 22); + this.copyNodeToolStripMenuItem.Text = "Copy Node(s)"; + this.copyNodeToolStripMenuItem.Click += new System.EventHandler(this.copyNodeToolStripMenuItem_Click); + // + // pasteNodesToolStripMenuItem + // + this.pasteNodesToolStripMenuItem.Image = global::ReClassNET.Properties.Resources.B16x16_Page_Paste; + this.pasteNodesToolStripMenuItem.Name = "pasteNodesToolStripMenuItem"; + this.pasteNodesToolStripMenuItem.Size = new System.Drawing.Size(269, 22); + this.pasteNodesToolStripMenuItem.Text = "Paste Node(s)"; + this.pasteNodesToolStripMenuItem.Click += new System.EventHandler(this.pasteNodesToolStripMenuItem_Click); + // + // toolStripSeparator10 + // + this.toolStripSeparator10.Name = "toolStripSeparator10"; + this.toolStripSeparator10.Size = new System.Drawing.Size(266, 6); + // + // removeToolStripMenuItem + // + this.removeToolStripMenuItem.Image = global::ReClassNET.Properties.Resources.B16x16_Button_Delete; + this.removeToolStripMenuItem.Name = "removeToolStripMenuItem"; + this.removeToolStripMenuItem.Size = new System.Drawing.Size(269, 22); + this.removeToolStripMenuItem.Text = "Remove Node(s)"; + this.removeToolStripMenuItem.Click += new System.EventHandler(this.removeToolStripMenuItem_Click); + // + // toolStripSeparator12 + // + this.toolStripSeparator12.Name = "toolStripSeparator12"; + this.toolStripSeparator12.Size = new System.Drawing.Size(266, 6); + // + // hideNodesToolStripMenuItem + // + this.hideNodesToolStripMenuItem.Image = global::ReClassNET.Properties.Resources.B16x16_Eye; + this.hideNodesToolStripMenuItem.Name = "hideNodesToolStripMenuItem"; + this.hideNodesToolStripMenuItem.Size = new System.Drawing.Size(269, 22); + this.hideNodesToolStripMenuItem.Text = "Hide selected Node(s)"; + this.hideNodesToolStripMenuItem.Click += new System.EventHandler(this.hideNodesToolStripMenuItem_Click); + // + // unhideNodesToolStripMenuItem + // + this.unhideNodesToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.unhideChildNodesToolStripMenuItem, + this.unhideNodesAboveToolStripMenuItem, + this.unhideNodesBelowToolStripMenuItem}); + this.unhideNodesToolStripMenuItem.Image = global::ReClassNET.Properties.Resources.B16x16_Eye; + this.unhideNodesToolStripMenuItem.Name = "unhideNodesToolStripMenuItem"; + this.unhideNodesToolStripMenuItem.Size = new System.Drawing.Size(269, 22); + this.unhideNodesToolStripMenuItem.Text = "Unhide..."; + // + // unhideChildNodesToolStripMenuItem + // + this.unhideChildNodesToolStripMenuItem.Image = global::ReClassNET.Properties.Resources.B16x16_Eye; + this.unhideChildNodesToolStripMenuItem.Name = "unhideChildNodesToolStripMenuItem"; + this.unhideChildNodesToolStripMenuItem.Size = new System.Drawing.Size(163, 22); + this.unhideChildNodesToolStripMenuItem.Text = "... Child Node(s)"; + this.unhideChildNodesToolStripMenuItem.Click += new System.EventHandler(this.unhideChildNodesToolStripMenuItem_Click); + // + // unhideNodesAboveToolStripMenuItem + // + this.unhideNodesAboveToolStripMenuItem.Image = global::ReClassNET.Properties.Resources.B16x16_Eye; + this.unhideNodesAboveToolStripMenuItem.Name = "unhideNodesAboveToolStripMenuItem"; + this.unhideNodesAboveToolStripMenuItem.Size = new System.Drawing.Size(163, 22); + this.unhideNodesAboveToolStripMenuItem.Text = "... Node(s) above"; + this.unhideNodesAboveToolStripMenuItem.Click += new System.EventHandler(this.unhideNodesAboveToolStripMenuItem_Click); + // + // unhideNodesBelowToolStripMenuItem + // + this.unhideNodesBelowToolStripMenuItem.Image = global::ReClassNET.Properties.Resources.B16x16_Eye; + this.unhideNodesBelowToolStripMenuItem.Name = "unhideNodesBelowToolStripMenuItem"; + this.unhideNodesBelowToolStripMenuItem.Size = new System.Drawing.Size(163, 22); + this.unhideNodesBelowToolStripMenuItem.Text = "... Node(s) below"; + this.unhideNodesBelowToolStripMenuItem.Click += new System.EventHandler(this.unhideNodesBelowToolStripMenuItem_Click); + // + // toolStripSeparator18 + // + this.toolStripSeparator18.Name = "toolStripSeparator18"; + this.toolStripSeparator18.Size = new System.Drawing.Size(266, 6); + // + // copyAddressToolStripMenuItem + // + this.copyAddressToolStripMenuItem.Image = global::ReClassNET.Properties.Resources.B16x16_Page_Copy; + this.copyAddressToolStripMenuItem.Name = "copyAddressToolStripMenuItem"; + this.copyAddressToolStripMenuItem.Size = new System.Drawing.Size(269, 22); + this.copyAddressToolStripMenuItem.Text = "Copy Address"; + this.copyAddressToolStripMenuItem.Click += new System.EventHandler(this.copyAddressToolStripMenuItem_Click); + // + // toolStripSeparator11 + // + this.toolStripSeparator11.Name = "toolStripSeparator11"; + this.toolStripSeparator11.Size = new System.Drawing.Size(266, 6); + // + // showCodeOfClassToolStripMenuItem + // + this.showCodeOfClassToolStripMenuItem.Image = global::ReClassNET.Properties.Resources.B16x16_Page_Code_Cpp; + this.showCodeOfClassToolStripMenuItem.Name = "showCodeOfClassToolStripMenuItem"; + this.showCodeOfClassToolStripMenuItem.Size = new System.Drawing.Size(269, 22); + this.showCodeOfClassToolStripMenuItem.Text = "Show C++ Code of Class"; + this.showCodeOfClassToolStripMenuItem.Click += new System.EventHandler(this.showCodeOfClassToolStripMenuItem_Click); + // + // shrinkClassToolStripMenuItem + // + this.shrinkClassToolStripMenuItem.Image = global::ReClassNET.Properties.Resources.B16x16_Chart_Delete; + this.shrinkClassToolStripMenuItem.Name = "shrinkClassToolStripMenuItem"; + this.shrinkClassToolStripMenuItem.Size = new System.Drawing.Size(269, 22); + this.shrinkClassToolStripMenuItem.Text = "Shrink Class"; + this.shrinkClassToolStripMenuItem.Click += new System.EventHandler(this.shrinkClassToolStripMenuItem_Click); // // toolStrip // @@ -203,49 +773,7 @@ private void InitializeComponent() this.newClassToolStripButton, this.addBytesToolStripDropDownButton, this.insertBytesToolStripDropDownButton, - this.toolStripSeparator8, - this.hex64ToolStripButton, - this.hex32ToolStripButton, - this.hex16ToolStripButton, - this.hex8ToolStripButton, - this.toolStripSeparator9, - this.int64ToolStripButton, - this.int32ToolStripButton, - this.int16ToolStripButton, - this.int8ToolStripButton, - this.toolStripSeparator10, - this.uint64ToolStripButton, - this.uint32ToolStripButton, - this.uint16ToolStripButton, - this.uint8ToolStripButton, - this.toolStripSeparator11, - this.boolToolStripButton, - this.bitFieldToolStripButton, - this.toolStripSeparator18, - this.floatToolStripButton, - this.doubleToolStripButton, - this.toolStripSeparator12, - this.vec4ToolStripButton, - this.vec3ToolStripButton, - this.vec2ToolStripButton, - this.mat44ToolStripButton, - this.mat34ToolStripButton, - this.mat33ToolStripButton, - this.toolStripSeparator13, - this.utf8TextToolStripButton, - this.utf8TextPtrToolStripButton, - this.utf16TextToolStripButton, - this.utf16TextPtrToolStripButton, - this.toolStripSeparator14, - this.classInstanceToolStripButton6, - this.classPtrToolStripButton, - this.toolStripSeparator15, - this.arrayToolStripButton, - this.ptrArrayToolStripButton, - this.vtableToolStripButton, - this.fnPtrToolStripButton, - this.fnTypeToolStripButton, - this.toolStripSeparator19}); + this.nodeTypesToolStripSeparator}); this.toolStrip.Location = new System.Drawing.Point(0, 24); this.toolStrip.Name = "toolStrip"; this.toolStrip.Size = new System.Drawing.Size(1141, 25); @@ -483,418 +1011,10 @@ private void InitializeComponent() this.insertXBytesToolStripMenuItem.Text = "Insert ... Bytes"; this.insertXBytesToolStripMenuItem.Click += new System.EventHandler(this.insertXBytesToolStripMenuItem_Click); // - // toolStripSeparator8 - // - this.toolStripSeparator8.Name = "toolStripSeparator8"; - this.toolStripSeparator8.Size = new System.Drawing.Size(6, 25); - // - // hex64ToolStripButton - // - this.hex64ToolStripButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; - this.hex64ToolStripButton.Image = global::ReClassNET.Properties.Resources.B16x16_Button_Hex_64; - this.hex64ToolStripButton.ImageTransparentColor = System.Drawing.Color.Magenta; - this.hex64ToolStripButton.Name = "hex64ToolStripButton"; - this.hex64ToolStripButton.Size = new System.Drawing.Size(23, 22); - this.hex64ToolStripButton.ToolTipText = "Hex64"; - this.hex64ToolStripButton.Value = typeof(ReClassNET.Nodes.Hex64Node); - this.hex64ToolStripButton.Click += new System.EventHandler(this.memoryTypeToolStripButton_Click); - // - // hex32ToolStripButton - // - this.hex32ToolStripButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; - this.hex32ToolStripButton.Image = global::ReClassNET.Properties.Resources.B16x16_Button_Hex_32; - this.hex32ToolStripButton.ImageTransparentColor = System.Drawing.Color.Magenta; - this.hex32ToolStripButton.Name = "hex32ToolStripButton"; - this.hex32ToolStripButton.Size = new System.Drawing.Size(23, 22); - this.hex32ToolStripButton.ToolTipText = "Hex32"; - this.hex32ToolStripButton.Value = typeof(ReClassNET.Nodes.Hex32Node); - this.hex32ToolStripButton.Click += new System.EventHandler(this.memoryTypeToolStripButton_Click); - // - // hex16ToolStripButton - // - this.hex16ToolStripButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; - this.hex16ToolStripButton.Image = global::ReClassNET.Properties.Resources.B16x16_Button_Hex_16; - this.hex16ToolStripButton.ImageTransparentColor = System.Drawing.Color.Magenta; - this.hex16ToolStripButton.Name = "hex16ToolStripButton"; - this.hex16ToolStripButton.Size = new System.Drawing.Size(23, 22); - this.hex16ToolStripButton.ToolTipText = "Hex16"; - this.hex16ToolStripButton.Value = typeof(ReClassNET.Nodes.Hex16Node); - this.hex16ToolStripButton.Click += new System.EventHandler(this.memoryTypeToolStripButton_Click); - // - // hex8ToolStripButton - // - this.hex8ToolStripButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; - this.hex8ToolStripButton.Image = global::ReClassNET.Properties.Resources.B16x16_Button_Hex_8; - this.hex8ToolStripButton.ImageTransparentColor = System.Drawing.Color.Magenta; - this.hex8ToolStripButton.Name = "hex8ToolStripButton"; - this.hex8ToolStripButton.Size = new System.Drawing.Size(23, 22); - this.hex8ToolStripButton.ToolTipText = "Hex8"; - this.hex8ToolStripButton.Value = typeof(ReClassNET.Nodes.Hex8Node); - this.hex8ToolStripButton.Click += new System.EventHandler(this.memoryTypeToolStripButton_Click); - // - // toolStripSeparator9 - // - this.toolStripSeparator9.Name = "toolStripSeparator9"; - this.toolStripSeparator9.Size = new System.Drawing.Size(6, 25); - // - // int64ToolStripButton - // - this.int64ToolStripButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; - this.int64ToolStripButton.Image = global::ReClassNET.Properties.Resources.B16x16_Button_Int_64; - this.int64ToolStripButton.ImageTransparentColor = System.Drawing.Color.Magenta; - this.int64ToolStripButton.Name = "int64ToolStripButton"; - this.int64ToolStripButton.Size = new System.Drawing.Size(23, 22); - this.int64ToolStripButton.ToolTipText = "Int64"; - this.int64ToolStripButton.Value = typeof(ReClassNET.Nodes.Int64Node); - this.int64ToolStripButton.Click += new System.EventHandler(this.memoryTypeToolStripButton_Click); - // - // int32ToolStripButton - // - this.int32ToolStripButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; - this.int32ToolStripButton.Image = global::ReClassNET.Properties.Resources.B16x16_Button_Int_32; - this.int32ToolStripButton.ImageTransparentColor = System.Drawing.Color.Magenta; - this.int32ToolStripButton.Name = "int32ToolStripButton"; - this.int32ToolStripButton.Size = new System.Drawing.Size(23, 22); - this.int32ToolStripButton.ToolTipText = "Int32"; - this.int32ToolStripButton.Value = typeof(ReClassNET.Nodes.Int32Node); - this.int32ToolStripButton.Click += new System.EventHandler(this.memoryTypeToolStripButton_Click); - // - // int16ToolStripButton - // - this.int16ToolStripButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; - this.int16ToolStripButton.Image = global::ReClassNET.Properties.Resources.B16x16_Button_Int_16; - this.int16ToolStripButton.ImageTransparentColor = System.Drawing.Color.Magenta; - this.int16ToolStripButton.Name = "int16ToolStripButton"; - this.int16ToolStripButton.Size = new System.Drawing.Size(23, 22); - this.int16ToolStripButton.ToolTipText = "Int16"; - this.int16ToolStripButton.Value = typeof(ReClassNET.Nodes.Int16Node); - this.int16ToolStripButton.Click += new System.EventHandler(this.memoryTypeToolStripButton_Click); - // - // int8ToolStripButton - // - this.int8ToolStripButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; - this.int8ToolStripButton.Image = global::ReClassNET.Properties.Resources.B16x16_Button_Int_8; - this.int8ToolStripButton.ImageTransparentColor = System.Drawing.Color.Magenta; - this.int8ToolStripButton.Name = "int8ToolStripButton"; - this.int8ToolStripButton.Size = new System.Drawing.Size(23, 22); - this.int8ToolStripButton.ToolTipText = "Int8"; - this.int8ToolStripButton.Value = typeof(ReClassNET.Nodes.Int8Node); - this.int8ToolStripButton.Click += new System.EventHandler(this.memoryTypeToolStripButton_Click); + // nodeTypesToolStripSeparator // - // toolStripSeparator10 - // - this.toolStripSeparator10.Name = "toolStripSeparator10"; - this.toolStripSeparator10.Size = new System.Drawing.Size(6, 25); - // - // uint64ToolStripButton - // - this.uint64ToolStripButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; - this.uint64ToolStripButton.Image = global::ReClassNET.Properties.Resources.B16x16_Button_UInt_64; - this.uint64ToolStripButton.ImageTransparentColor = System.Drawing.Color.Magenta; - this.uint64ToolStripButton.Name = "uint64ToolStripButton"; - this.uint64ToolStripButton.Size = new System.Drawing.Size(23, 22); - this.uint64ToolStripButton.ToolTipText = "UInt64 / QWORD"; - this.uint64ToolStripButton.Value = typeof(ReClassNET.Nodes.UInt64Node); - this.uint64ToolStripButton.Click += new System.EventHandler(this.memoryTypeToolStripButton_Click); - // - // uint32ToolStripButton - // - this.uint32ToolStripButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; - this.uint32ToolStripButton.Image = global::ReClassNET.Properties.Resources.B16x16_Button_UInt_32; - this.uint32ToolStripButton.ImageTransparentColor = System.Drawing.Color.Magenta; - this.uint32ToolStripButton.Name = "uint32ToolStripButton"; - this.uint32ToolStripButton.Size = new System.Drawing.Size(23, 22); - this.uint32ToolStripButton.ToolTipText = "UInt32 / DWORD"; - this.uint32ToolStripButton.Value = typeof(ReClassNET.Nodes.UInt32Node); - this.uint32ToolStripButton.Click += new System.EventHandler(this.memoryTypeToolStripButton_Click); - // - // uint16ToolStripButton - // - this.uint16ToolStripButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; - this.uint16ToolStripButton.Image = global::ReClassNET.Properties.Resources.B16x16_Button_UInt_16; - this.uint16ToolStripButton.ImageTransparentColor = System.Drawing.Color.Magenta; - this.uint16ToolStripButton.Name = "uint16ToolStripButton"; - this.uint16ToolStripButton.Size = new System.Drawing.Size(23, 22); - this.uint16ToolStripButton.ToolTipText = "UInt16 / WORD"; - this.uint16ToolStripButton.Value = typeof(ReClassNET.Nodes.UInt16Node); - this.uint16ToolStripButton.Click += new System.EventHandler(this.memoryTypeToolStripButton_Click); - // - // uint8ToolStripButton - // - this.uint8ToolStripButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; - this.uint8ToolStripButton.Image = global::ReClassNET.Properties.Resources.B16x16_Button_UInt_8; - this.uint8ToolStripButton.ImageTransparentColor = System.Drawing.Color.Magenta; - this.uint8ToolStripButton.Name = "uint8ToolStripButton"; - this.uint8ToolStripButton.Size = new System.Drawing.Size(23, 22); - this.uint8ToolStripButton.ToolTipText = "UInt8 / BYTE"; - this.uint8ToolStripButton.Value = typeof(ReClassNET.Nodes.UInt8Node); - this.uint8ToolStripButton.Click += new System.EventHandler(this.memoryTypeToolStripButton_Click); - // - // toolStripSeparator11 - // - this.toolStripSeparator11.Name = "toolStripSeparator11"; - this.toolStripSeparator11.Size = new System.Drawing.Size(6, 25); - // - // boolToolStripButton - // - this.boolToolStripButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; - this.boolToolStripButton.Image = global::ReClassNET.Properties.Resources.B16x16_Button_Bool; - this.boolToolStripButton.ImageTransparentColor = System.Drawing.Color.Magenta; - this.boolToolStripButton.Name = "boolToolStripButton"; - this.boolToolStripButton.Size = new System.Drawing.Size(23, 22); - this.boolToolStripButton.ToolTipText = "Bool"; - this.boolToolStripButton.Value = typeof(ReClassNET.Nodes.BoolNode); - this.boolToolStripButton.Click += new System.EventHandler(this.memoryTypeToolStripButton_Click); - // - // bitFieldToolStripButton - // - this.bitFieldToolStripButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; - this.bitFieldToolStripButton.Image = global::ReClassNET.Properties.Resources.B16x16_Button_Bits; - this.bitFieldToolStripButton.ImageTransparentColor = System.Drawing.Color.Magenta; - this.bitFieldToolStripButton.Name = "bitFieldToolStripButton"; - this.bitFieldToolStripButton.Size = new System.Drawing.Size(23, 22); - this.bitFieldToolStripButton.ToolTipText = "Bit Field"; - this.bitFieldToolStripButton.Value = typeof(ReClassNET.Nodes.BitFieldNode); - this.bitFieldToolStripButton.Click += new System.EventHandler(this.memoryTypeToolStripButton_Click); - // - // toolStripSeparator18 - // - this.toolStripSeparator18.Name = "toolStripSeparator18"; - this.toolStripSeparator18.Size = new System.Drawing.Size(6, 25); - // - // floatToolStripButton - // - this.floatToolStripButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; - this.floatToolStripButton.Image = global::ReClassNET.Properties.Resources.B16x16_Button_Float; - this.floatToolStripButton.ImageTransparentColor = System.Drawing.Color.Magenta; - this.floatToolStripButton.Name = "floatToolStripButton"; - this.floatToolStripButton.Size = new System.Drawing.Size(23, 22); - this.floatToolStripButton.ToolTipText = "Float"; - this.floatToolStripButton.Value = typeof(ReClassNET.Nodes.FloatNode); - this.floatToolStripButton.Click += new System.EventHandler(this.memoryTypeToolStripButton_Click); - // - // doubleToolStripButton - // - this.doubleToolStripButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; - this.doubleToolStripButton.Image = global::ReClassNET.Properties.Resources.B16x16_Button_Double; - this.doubleToolStripButton.ImageTransparentColor = System.Drawing.Color.Magenta; - this.doubleToolStripButton.Name = "doubleToolStripButton"; - this.doubleToolStripButton.Size = new System.Drawing.Size(23, 22); - this.doubleToolStripButton.ToolTipText = "Double"; - this.doubleToolStripButton.Value = typeof(ReClassNET.Nodes.DoubleNode); - this.doubleToolStripButton.Click += new System.EventHandler(this.memoryTypeToolStripButton_Click); - // - // toolStripSeparator12 - // - this.toolStripSeparator12.Name = "toolStripSeparator12"; - this.toolStripSeparator12.Size = new System.Drawing.Size(6, 25); - // - // vec4ToolStripButton - // - this.vec4ToolStripButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; - this.vec4ToolStripButton.Image = global::ReClassNET.Properties.Resources.B16x16_Button_Vector_4; - this.vec4ToolStripButton.ImageTransparentColor = System.Drawing.Color.Magenta; - this.vec4ToolStripButton.Name = "vec4ToolStripButton"; - this.vec4ToolStripButton.Size = new System.Drawing.Size(23, 22); - this.vec4ToolStripButton.ToolTipText = "Vector4"; - this.vec4ToolStripButton.Value = typeof(ReClassNET.Nodes.Vector4Node); - this.vec4ToolStripButton.Click += new System.EventHandler(this.memoryTypeToolStripButton_Click); - // - // vec3ToolStripButton - // - this.vec3ToolStripButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; - this.vec3ToolStripButton.Image = global::ReClassNET.Properties.Resources.B16x16_Button_Vector_3; - this.vec3ToolStripButton.ImageTransparentColor = System.Drawing.Color.Magenta; - this.vec3ToolStripButton.Name = "vec3ToolStripButton"; - this.vec3ToolStripButton.Size = new System.Drawing.Size(23, 22); - this.vec3ToolStripButton.ToolTipText = "Vector3"; - this.vec3ToolStripButton.Value = typeof(ReClassNET.Nodes.Vector3Node); - this.vec3ToolStripButton.Click += new System.EventHandler(this.memoryTypeToolStripButton_Click); - // - // vec2ToolStripButton - // - this.vec2ToolStripButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; - this.vec2ToolStripButton.Image = global::ReClassNET.Properties.Resources.B16x16_Button_Vector_2; - this.vec2ToolStripButton.ImageTransparentColor = System.Drawing.Color.Magenta; - this.vec2ToolStripButton.Name = "vec2ToolStripButton"; - this.vec2ToolStripButton.Size = new System.Drawing.Size(23, 22); - this.vec2ToolStripButton.ToolTipText = "Vector2"; - this.vec2ToolStripButton.Value = typeof(ReClassNET.Nodes.Vector2Node); - this.vec2ToolStripButton.Click += new System.EventHandler(this.memoryTypeToolStripButton_Click); - // - // mat44ToolStripButton - // - this.mat44ToolStripButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; - this.mat44ToolStripButton.Image = global::ReClassNET.Properties.Resources.B16x16_Button_Matrix_4x4; - this.mat44ToolStripButton.ImageTransparentColor = System.Drawing.Color.Magenta; - this.mat44ToolStripButton.Name = "mat44ToolStripButton"; - this.mat44ToolStripButton.Size = new System.Drawing.Size(23, 22); - this.mat44ToolStripButton.ToolTipText = "4x4 Matrix"; - this.mat44ToolStripButton.Value = typeof(ReClassNET.Nodes.Matrix4x4Node); - this.mat44ToolStripButton.Click += new System.EventHandler(this.memoryTypeToolStripButton_Click); - // - // mat34ToolStripButton - // - this.mat34ToolStripButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; - this.mat34ToolStripButton.Image = global::ReClassNET.Properties.Resources.B16x16_Button_Matrix_3x4; - this.mat34ToolStripButton.ImageTransparentColor = System.Drawing.Color.Magenta; - this.mat34ToolStripButton.Name = "mat34ToolStripButton"; - this.mat34ToolStripButton.Size = new System.Drawing.Size(23, 22); - this.mat34ToolStripButton.ToolTipText = "3x4 Matrix"; - this.mat34ToolStripButton.Value = typeof(ReClassNET.Nodes.Matrix3x4Node); - this.mat34ToolStripButton.Click += new System.EventHandler(this.memoryTypeToolStripButton_Click); - // - // mat33ToolStripButton - // - this.mat33ToolStripButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; - this.mat33ToolStripButton.Image = global::ReClassNET.Properties.Resources.B16x16_Button_Matrix_3x3; - this.mat33ToolStripButton.ImageTransparentColor = System.Drawing.Color.Magenta; - this.mat33ToolStripButton.Name = "mat33ToolStripButton"; - this.mat33ToolStripButton.Size = new System.Drawing.Size(23, 22); - this.mat33ToolStripButton.ToolTipText = "3x3 Matrix"; - this.mat33ToolStripButton.Value = typeof(ReClassNET.Nodes.Matrix3x3Node); - this.mat33ToolStripButton.Click += new System.EventHandler(this.memoryTypeToolStripButton_Click); - // - // toolStripSeparator13 - // - this.toolStripSeparator13.Name = "toolStripSeparator13"; - this.toolStripSeparator13.Size = new System.Drawing.Size(6, 25); - // - // utf8TextToolStripButton - // - this.utf8TextToolStripButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; - this.utf8TextToolStripButton.Image = global::ReClassNET.Properties.Resources.B16x16_Button_Text; - this.utf8TextToolStripButton.ImageTransparentColor = System.Drawing.Color.Magenta; - this.utf8TextToolStripButton.Name = "utf8TextToolStripButton"; - this.utf8TextToolStripButton.Size = new System.Drawing.Size(23, 22); - this.utf8TextToolStripButton.ToolTipText = "UTF8 Text"; - this.utf8TextToolStripButton.Value = typeof(ReClassNET.Nodes.Utf8TextNode); - this.utf8TextToolStripButton.Click += new System.EventHandler(this.memoryTypeToolStripButton_Click); - // - // utf8TextPtrToolStripButton - // - this.utf8TextPtrToolStripButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; - this.utf8TextPtrToolStripButton.Image = global::ReClassNET.Properties.Resources.B16x16_Button_Text_Pointer; - this.utf8TextPtrToolStripButton.ImageTransparentColor = System.Drawing.Color.Magenta; - this.utf8TextPtrToolStripButton.Name = "utf8TextPtrToolStripButton"; - this.utf8TextPtrToolStripButton.Size = new System.Drawing.Size(23, 22); - this.utf8TextPtrToolStripButton.ToolTipText = "Pointer to UTF8 text"; - this.utf8TextPtrToolStripButton.Value = typeof(ReClassNET.Nodes.Utf8TextPtrNode); - this.utf8TextPtrToolStripButton.Click += new System.EventHandler(this.memoryTypeToolStripButton_Click); - // - // utf16TextToolStripButton - // - this.utf16TextToolStripButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; - this.utf16TextToolStripButton.Image = global::ReClassNET.Properties.Resources.B16x16_Button_UText; - this.utf16TextToolStripButton.ImageTransparentColor = System.Drawing.Color.Magenta; - this.utf16TextToolStripButton.Name = "utf16TextToolStripButton"; - this.utf16TextToolStripButton.Size = new System.Drawing.Size(23, 22); - this.utf16TextToolStripButton.ToolTipText = "UTF16 / Unicode Text"; - this.utf16TextToolStripButton.Value = typeof(ReClassNET.Nodes.Utf16TextNode); - this.utf16TextToolStripButton.Click += new System.EventHandler(this.memoryTypeToolStripButton_Click); - // - // utf16TextPtrToolStripButton - // - this.utf16TextPtrToolStripButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; - this.utf16TextPtrToolStripButton.Image = global::ReClassNET.Properties.Resources.B16x16_Button_UText_Pointer; - this.utf16TextPtrToolStripButton.ImageTransparentColor = System.Drawing.Color.Magenta; - this.utf16TextPtrToolStripButton.Name = "utf16TextPtrToolStripButton"; - this.utf16TextPtrToolStripButton.Size = new System.Drawing.Size(23, 22); - this.utf16TextPtrToolStripButton.ToolTipText = "Pointer to UTF16 / Unicode text"; - this.utf16TextPtrToolStripButton.Value = typeof(ReClassNET.Nodes.Utf16TextPtrNode); - this.utf16TextPtrToolStripButton.Click += new System.EventHandler(this.memoryTypeToolStripButton_Click); - // - // toolStripSeparator14 - // - this.toolStripSeparator14.Name = "toolStripSeparator14"; - this.toolStripSeparator14.Size = new System.Drawing.Size(6, 25); - // - // classInstanceToolStripButton6 - // - this.classInstanceToolStripButton6.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; - this.classInstanceToolStripButton6.Image = global::ReClassNET.Properties.Resources.B16x16_Button_Class_Instance; - this.classInstanceToolStripButton6.ImageTransparentColor = System.Drawing.Color.Magenta; - this.classInstanceToolStripButton6.Name = "classInstanceToolStripButton6"; - this.classInstanceToolStripButton6.Size = new System.Drawing.Size(23, 22); - this.classInstanceToolStripButton6.ToolTipText = "Class instance"; - this.classInstanceToolStripButton6.Value = typeof(ReClassNET.Nodes.ClassInstanceNode); - this.classInstanceToolStripButton6.Click += new System.EventHandler(this.memoryTypeToolStripButton_Click); - // - // classPtrToolStripButton - // - this.classPtrToolStripButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; - this.classPtrToolStripButton.Image = global::ReClassNET.Properties.Resources.B16x16_Button_Class_Pointer; - this.classPtrToolStripButton.ImageTransparentColor = System.Drawing.Color.Magenta; - this.classPtrToolStripButton.Name = "classPtrToolStripButton"; - this.classPtrToolStripButton.Size = new System.Drawing.Size(23, 22); - this.classPtrToolStripButton.ToolTipText = "Pointer to class instance"; - this.classPtrToolStripButton.Value = typeof(ReClassNET.Nodes.ClassPtrNode); - this.classPtrToolStripButton.Click += new System.EventHandler(this.memoryTypeToolStripButton_Click); - // - // toolStripSeparator15 - // - this.toolStripSeparator15.Name = "toolStripSeparator15"; - this.toolStripSeparator15.Size = new System.Drawing.Size(6, 25); - // - // arrayToolStripButton - // - this.arrayToolStripButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; - this.arrayToolStripButton.Image = global::ReClassNET.Properties.Resources.B16x16_Button_Array; - this.arrayToolStripButton.ImageTransparentColor = System.Drawing.Color.Magenta; - this.arrayToolStripButton.Name = "arrayToolStripButton"; - this.arrayToolStripButton.Size = new System.Drawing.Size(23, 22); - this.arrayToolStripButton.ToolTipText = "Array of Classes"; - this.arrayToolStripButton.Value = typeof(ReClassNET.Nodes.ClassInstanceArrayNode); - this.arrayToolStripButton.Click += new System.EventHandler(this.memoryTypeToolStripButton_Click); - // - // ptrArrayToolStripButton - // - this.ptrArrayToolStripButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; - this.ptrArrayToolStripButton.Image = global::ReClassNET.Properties.Resources.B16x16_Button_Pointer_Array; - this.ptrArrayToolStripButton.ImageTransparentColor = System.Drawing.Color.Magenta; - this.ptrArrayToolStripButton.Name = "ptrArrayToolStripButton"; - this.ptrArrayToolStripButton.Size = new System.Drawing.Size(23, 22); - this.ptrArrayToolStripButton.ToolTipText = "Array of Pointers"; - this.ptrArrayToolStripButton.Value = typeof(ReClassNET.Nodes.ClassPtrArrayNode); - this.ptrArrayToolStripButton.Click += new System.EventHandler(this.memoryTypeToolStripButton_Click); - // - // vtableToolStripButton - // - this.vtableToolStripButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; - this.vtableToolStripButton.Image = global::ReClassNET.Properties.Resources.B16x16_Button_VTable; - this.vtableToolStripButton.ImageTransparentColor = System.Drawing.Color.Magenta; - this.vtableToolStripButton.Name = "vtableToolStripButton"; - this.vtableToolStripButton.Size = new System.Drawing.Size(23, 22); - this.vtableToolStripButton.ToolTipText = "Pointer to VTable"; - this.vtableToolStripButton.Value = typeof(ReClassNET.Nodes.VTableNode); - this.vtableToolStripButton.Click += new System.EventHandler(this.memoryTypeToolStripButton_Click); - // - // fnPtrToolStripButton - // - this.fnPtrToolStripButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; - this.fnPtrToolStripButton.Image = global::ReClassNET.Properties.Resources.B16x16_Button_Function_Pointer; - this.fnPtrToolStripButton.ImageTransparentColor = System.Drawing.Color.Magenta; - this.fnPtrToolStripButton.Name = "fnPtrToolStripButton"; - this.fnPtrToolStripButton.Size = new System.Drawing.Size(23, 22); - this.fnPtrToolStripButton.ToolTipText = "Pointer to a function"; - this.fnPtrToolStripButton.Value = typeof(ReClassNET.Nodes.FunctionPtrNode); - this.fnPtrToolStripButton.Click += new System.EventHandler(this.memoryTypeToolStripButton_Click); - // - // fnTypeToolStripButton - // - this.fnTypeToolStripButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; - this.fnTypeToolStripButton.Image = global::ReClassNET.Properties.Resources.B16x16_Button_Function; - this.fnTypeToolStripButton.ImageTransparentColor = System.Drawing.Color.Magenta; - this.fnTypeToolStripButton.Name = "fnTypeToolStripButton"; - this.fnTypeToolStripButton.Size = new System.Drawing.Size(23, 22); - this.fnTypeToolStripButton.ToolTipText = "Function"; - this.fnTypeToolStripButton.Value = typeof(ReClassNET.Nodes.FunctionNode); - this.fnTypeToolStripButton.Click += new System.EventHandler(this.memoryTypeToolStripButton_Click); - // - // toolStripSeparator19 - // - this.toolStripSeparator19.Name = "toolStripSeparator19"; - this.toolStripSeparator19.Size = new System.Drawing.Size(6, 25); + this.nodeTypesToolStripSeparator.Name = "nodeTypesToolStripSeparator"; + this.nodeTypesToolStripSeparator.Size = new System.Drawing.Size(6, 25); // // statusStrip // @@ -958,7 +1078,7 @@ private void InitializeComponent() // this.attachToProcessToolStripMenuItem.Image = global::ReClassNET.Properties.Resources.B16x16_Magnifier; this.attachToProcessToolStripMenuItem.Name = "attachToProcessToolStripMenuItem"; - this.attachToProcessToolStripMenuItem.Size = new System.Drawing.Size(246, 22); + this.attachToProcessToolStripMenuItem.Size = new System.Drawing.Size(195, 22); this.attachToProcessToolStripMenuItem.Text = "Attach to Process..."; this.attachToProcessToolStripMenuItem.Click += new System.EventHandler(this.attachToProcessToolStripSplitButton_ButtonClick); // @@ -966,7 +1086,7 @@ private void InitializeComponent() // this.reattachToProcessToolStripMenuItem.Image = global::ReClassNET.Properties.Resources.B16x16_Magnifier_Arrow; this.reattachToProcessToolStripMenuItem.Name = "reattachToProcessToolStripMenuItem"; - this.reattachToProcessToolStripMenuItem.Size = new System.Drawing.Size(246, 22); + this.reattachToProcessToolStripMenuItem.Size = new System.Drawing.Size(195, 22); this.reattachToProcessToolStripMenuItem.Text = "<>"; this.reattachToProcessToolStripMenuItem.Click += new System.EventHandler(this.reattachToProcessToolStripMenuItem_Click); // @@ -974,21 +1094,21 @@ private void InitializeComponent() // this.detachToolStripMenuItem.Image = global::ReClassNET.Properties.Resources.B16x16_Magnifier_Remove; this.detachToolStripMenuItem.Name = "detachToolStripMenuItem"; - this.detachToolStripMenuItem.Size = new System.Drawing.Size(246, 22); + this.detachToolStripMenuItem.Size = new System.Drawing.Size(195, 22); this.detachToolStripMenuItem.Text = "Detach"; this.detachToolStripMenuItem.Click += new System.EventHandler(this.detachToolStripMenuItem_Click); // // toolStripSeparator1 // this.toolStripSeparator1.Name = "toolStripSeparator1"; - this.toolStripSeparator1.Size = new System.Drawing.Size(243, 6); + this.toolStripSeparator1.Size = new System.Drawing.Size(192, 6); // // openProjectToolStripMenuItem // this.openProjectToolStripMenuItem.Image = global::ReClassNET.Properties.Resources.B16x16_Folder; this.openProjectToolStripMenuItem.Name = "openProjectToolStripMenuItem"; this.openProjectToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.O))); - this.openProjectToolStripMenuItem.Size = new System.Drawing.Size(246, 22); + this.openProjectToolStripMenuItem.Size = new System.Drawing.Size(195, 22); this.openProjectToolStripMenuItem.Text = "Open Project..."; this.openProjectToolStripMenuItem.Click += new System.EventHandler(this.openProjectToolStripMenuItem_Click); // @@ -996,7 +1116,7 @@ private void InitializeComponent() // this.mergeWithProjectToolStripMenuItem.Image = global::ReClassNET.Properties.Resources.B16x16_Folder_Add; this.mergeWithProjectToolStripMenuItem.Name = "mergeWithProjectToolStripMenuItem"; - this.mergeWithProjectToolStripMenuItem.Size = new System.Drawing.Size(246, 22); + this.mergeWithProjectToolStripMenuItem.Size = new System.Drawing.Size(195, 22); this.mergeWithProjectToolStripMenuItem.Text = "Merge with Project..."; this.mergeWithProjectToolStripMenuItem.Click += new System.EventHandler(this.mergeWithProjectToolStripMenuItem_Click); // @@ -1004,21 +1124,21 @@ private void InitializeComponent() // this.clearProjectToolStripMenuItem.Image = global::ReClassNET.Properties.Resources.B16x16_Arrow_Refresh; this.clearProjectToolStripMenuItem.Name = "clearProjectToolStripMenuItem"; - this.clearProjectToolStripMenuItem.Size = new System.Drawing.Size(246, 22); + this.clearProjectToolStripMenuItem.Size = new System.Drawing.Size(195, 22); this.clearProjectToolStripMenuItem.Text = "Clear Project"; this.clearProjectToolStripMenuItem.Click += new System.EventHandler(this.clearProjectToolStripMenuItem_Click); // // toolStripSeparator2 // this.toolStripSeparator2.Name = "toolStripSeparator2"; - this.toolStripSeparator2.Size = new System.Drawing.Size(243, 6); + this.toolStripSeparator2.Size = new System.Drawing.Size(192, 6); // // saveToolStripMenuItem // this.saveToolStripMenuItem.Image = global::ReClassNET.Properties.Resources.B16x16_Save; this.saveToolStripMenuItem.Name = "saveToolStripMenuItem"; this.saveToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.S))); - this.saveToolStripMenuItem.Size = new System.Drawing.Size(246, 22); + this.saveToolStripMenuItem.Size = new System.Drawing.Size(195, 22); this.saveToolStripMenuItem.Text = "Save"; this.saveToolStripMenuItem.Click += new System.EventHandler(this.saveToolStripMenuItem_Click); // @@ -1028,20 +1148,20 @@ private void InitializeComponent() this.saveAsToolStripMenuItem.Name = "saveAsToolStripMenuItem"; this.saveAsToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)(((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Shift) | System.Windows.Forms.Keys.S))); - this.saveAsToolStripMenuItem.Size = new System.Drawing.Size(246, 22); + this.saveAsToolStripMenuItem.Size = new System.Drawing.Size(195, 22); this.saveAsToolStripMenuItem.Text = "Save as..."; this.saveAsToolStripMenuItem.Click += new System.EventHandler(this.saveAsToolStripMenuItem_Click); // // toolStripSeparator3 // this.toolStripSeparator3.Name = "toolStripSeparator3"; - this.toolStripSeparator3.Size = new System.Drawing.Size(243, 6); + this.toolStripSeparator3.Size = new System.Drawing.Size(192, 6); // // settingsToolStripMenuItem // this.settingsToolStripMenuItem.Image = global::ReClassNET.Properties.Resources.B16x16_Cogs; this.settingsToolStripMenuItem.Name = "settingsToolStripMenuItem"; - this.settingsToolStripMenuItem.Size = new System.Drawing.Size(246, 22); + this.settingsToolStripMenuItem.Size = new System.Drawing.Size(195, 22); this.settingsToolStripMenuItem.Text = "Settings..."; this.settingsToolStripMenuItem.Click += new System.EventHandler(this.settingsToolStripMenuItem_Click); // @@ -1049,20 +1169,20 @@ private void InitializeComponent() // this.pluginsToolStripMenuItem.Image = global::ReClassNET.Properties.Resources.B16x16_Plugin; this.pluginsToolStripMenuItem.Name = "pluginsToolStripMenuItem"; - this.pluginsToolStripMenuItem.Size = new System.Drawing.Size(246, 22); + this.pluginsToolStripMenuItem.Size = new System.Drawing.Size(195, 22); this.pluginsToolStripMenuItem.Text = "Plugins..."; this.pluginsToolStripMenuItem.Click += new System.EventHandler(this.pluginsToolStripButton_Click); // // toolStripSeparator5 // this.toolStripSeparator5.Name = "toolStripSeparator5"; - this.toolStripSeparator5.Size = new System.Drawing.Size(243, 6); + this.toolStripSeparator5.Size = new System.Drawing.Size(192, 6); // // quitToolStripMenuItem // this.quitToolStripMenuItem.Image = global::ReClassNET.Properties.Resources.B16x16_Quit; this.quitToolStripMenuItem.Name = "quitToolStripMenuItem"; - this.quitToolStripMenuItem.Size = new System.Drawing.Size(246, 22); + this.quitToolStripMenuItem.Size = new System.Drawing.Size(195, 22); this.quitToolStripMenuItem.Text = "Quit"; this.quitToolStripMenuItem.Click += new System.EventHandler(this.quitToolStripMenuItem_Click); // @@ -1071,6 +1191,9 @@ private void InitializeComponent() this.processToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.processInformationsToolStripMenuItem, this.memorySearcherToolStripMenuItem, + this.namedAddressesToolStripMenuItem, + this.toolStripSeparator23, + this.isLittleEndianToolStripMenuItem, this.toolStripSeparator17, this.loadSymbolToolStripMenuItem, this.loadSymbolsToolStripMenuItem, @@ -1086,28 +1209,49 @@ private void InitializeComponent() // this.processInformationsToolStripMenuItem.Image = global::ReClassNET.Properties.Resources.B16x16_Category; this.processInformationsToolStripMenuItem.Name = "processInformationsToolStripMenuItem"; - this.processInformationsToolStripMenuItem.Size = new System.Drawing.Size(185, 22); - this.processInformationsToolStripMenuItem.Text = "Process Informations"; + this.processInformationsToolStripMenuItem.Size = new System.Drawing.Size(194, 22); + this.processInformationsToolStripMenuItem.Text = "Process Informations..."; this.processInformationsToolStripMenuItem.Click += new System.EventHandler(this.memoryViewerToolStripMenuItem_Click); // // memorySearcherToolStripMenuItem // this.memorySearcherToolStripMenuItem.Image = global::ReClassNET.Properties.Resources.B16x16_Eye; this.memorySearcherToolStripMenuItem.Name = "memorySearcherToolStripMenuItem"; - this.memorySearcherToolStripMenuItem.Size = new System.Drawing.Size(185, 22); - this.memorySearcherToolStripMenuItem.Text = "Memory Searcher"; + this.memorySearcherToolStripMenuItem.Size = new System.Drawing.Size(194, 22); + this.memorySearcherToolStripMenuItem.Text = "Memory Searcher..."; this.memorySearcherToolStripMenuItem.Click += new System.EventHandler(this.memorySearcherToolStripMenuItem_Click); // + // namedAddressesToolStripMenuItem + // + this.namedAddressesToolStripMenuItem.Image = global::ReClassNET.Properties.Resources.B16x16_Custom_Type; + this.namedAddressesToolStripMenuItem.Name = "namedAddressesToolStripMenuItem"; + this.namedAddressesToolStripMenuItem.Size = new System.Drawing.Size(194, 22); + 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"; - this.toolStripSeparator17.Size = new System.Drawing.Size(182, 6); + this.toolStripSeparator17.Size = new System.Drawing.Size(191, 6); // // loadSymbolToolStripMenuItem // this.loadSymbolToolStripMenuItem.Image = global::ReClassNET.Properties.Resources.B16x16_Pdb; this.loadSymbolToolStripMenuItem.Name = "loadSymbolToolStripMenuItem"; - this.loadSymbolToolStripMenuItem.Size = new System.Drawing.Size(185, 22); + this.loadSymbolToolStripMenuItem.Size = new System.Drawing.Size(194, 22); this.loadSymbolToolStripMenuItem.Text = "Load Symbol..."; this.loadSymbolToolStripMenuItem.Click += new System.EventHandler(this.loadSymbolToolStripMenuItem_Click); // @@ -1115,20 +1259,20 @@ private void InitializeComponent() // this.loadSymbolsToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject("loadSymbolsToolStripMenuItem.Image"))); this.loadSymbolsToolStripMenuItem.Name = "loadSymbolsToolStripMenuItem"; - this.loadSymbolsToolStripMenuItem.Size = new System.Drawing.Size(185, 22); + this.loadSymbolsToolStripMenuItem.Size = new System.Drawing.Size(194, 22); this.loadSymbolsToolStripMenuItem.Text = "Load all Symbols"; this.loadSymbolsToolStripMenuItem.Click += new System.EventHandler(this.loadSymbolsToolStripMenuItem_Click); // // toolStripSeparator4 // this.toolStripSeparator4.Name = "toolStripSeparator4"; - this.toolStripSeparator4.Size = new System.Drawing.Size(182, 6); + this.toolStripSeparator4.Size = new System.Drawing.Size(191, 6); // // resumeProcessToolStripMenuItem // this.resumeProcessToolStripMenuItem.Image = global::ReClassNET.Properties.Resources.B16x16_Control_Play; this.resumeProcessToolStripMenuItem.Name = "resumeProcessToolStripMenuItem"; - this.resumeProcessToolStripMenuItem.Size = new System.Drawing.Size(185, 22); + this.resumeProcessToolStripMenuItem.Size = new System.Drawing.Size(194, 22); this.resumeProcessToolStripMenuItem.Text = "Resume"; this.resumeProcessToolStripMenuItem.Click += new System.EventHandler(this.ControlRemoteProcessToolStripMenuItem_Click); // @@ -1136,7 +1280,7 @@ private void InitializeComponent() // this.suspendProcessToolStripMenuItem.Image = global::ReClassNET.Properties.Resources.B16x16_Control_Pause; this.suspendProcessToolStripMenuItem.Name = "suspendProcessToolStripMenuItem"; - this.suspendProcessToolStripMenuItem.Size = new System.Drawing.Size(185, 22); + this.suspendProcessToolStripMenuItem.Size = new System.Drawing.Size(194, 22); this.suspendProcessToolStripMenuItem.Text = "Suspend"; this.suspendProcessToolStripMenuItem.Click += new System.EventHandler(this.ControlRemoteProcessToolStripMenuItem_Click); // @@ -1144,14 +1288,16 @@ private void InitializeComponent() // this.terminateProcessToolStripMenuItem.Image = global::ReClassNET.Properties.Resources.B16x16_Control_Stop; this.terminateProcessToolStripMenuItem.Name = "terminateProcessToolStripMenuItem"; - this.terminateProcessToolStripMenuItem.Size = new System.Drawing.Size(185, 22); + this.terminateProcessToolStripMenuItem.Size = new System.Drawing.Size(194, 22); this.terminateProcessToolStripMenuItem.Text = "Kill"; this.terminateProcessToolStripMenuItem.Click += new System.EventHandler(this.ControlRemoteProcessToolStripMenuItem_Click); // // projectToolStripMenuItem // this.projectToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.goToClassToolStripMenuItem, this.cleanUnusedClassesToolStripMenuItem, + this.showEnumsToolStripMenuItem, this.toolStripSeparator16, this.generateCppCodeToolStripMenuItem, this.generateCSharpCodeToolStripMenuItem}); @@ -1159,6 +1305,15 @@ private void InitializeComponent() this.projectToolStripMenuItem.Size = new System.Drawing.Size(56, 20); this.projectToolStripMenuItem.Text = "Project"; // + // goToClassToolStripMenuItem + // + 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); + // // cleanUnusedClassesToolStripMenuItem // this.cleanUnusedClassesToolStripMenuItem.Image = global::ReClassNET.Properties.Resources.B16x16_Chart_Delete; @@ -1167,6 +1322,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"; @@ -1177,7 +1340,7 @@ private void InitializeComponent() this.generateCppCodeToolStripMenuItem.Image = global::ReClassNET.Properties.Resources.B16x16_Page_Code_Cpp; this.generateCppCodeToolStripMenuItem.Name = "generateCppCodeToolStripMenuItem"; this.generateCppCodeToolStripMenuItem.Size = new System.Drawing.Size(198, 22); - this.generateCppCodeToolStripMenuItem.Text = "Generate C++ Code"; + this.generateCppCodeToolStripMenuItem.Text = "Generate C++ Code..."; this.generateCppCodeToolStripMenuItem.Click += new System.EventHandler(this.generateCppCodeToolStripMenuItem_Click); // // generateCSharpCodeToolStripMenuItem @@ -1185,7 +1348,7 @@ private void InitializeComponent() this.generateCSharpCodeToolStripMenuItem.Image = global::ReClassNET.Properties.Resources.B16x16_Page_Code_Csharp; this.generateCSharpCodeToolStripMenuItem.Name = "generateCSharpCodeToolStripMenuItem"; this.generateCSharpCodeToolStripMenuItem.Size = new System.Drawing.Size(198, 22); - this.generateCSharpCodeToolStripMenuItem.Text = "Generate C# Code"; + this.generateCSharpCodeToolStripMenuItem.Text = "Generate C# Code..."; this.generateCSharpCodeToolStripMenuItem.Click += new System.EventHandler(this.generateCSharpCodeToolStripMenuItem_Click); // // helpToolStripMenuItem @@ -1225,6 +1388,11 @@ private void InitializeComponent() this.splitContainer.Panel2.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)(this.splitContainer)).EndInit(); this.splitContainer.ResumeLayout(false); + this.projectClassContextMenuStrip.ResumeLayout(false); + this.projectClassesContextMenuStrip.ResumeLayout(false); + this.projectEnumContextMenuStrip.ResumeLayout(false); + this.projectEnumsContextMenuStrip.ResumeLayout(false); + this.selectedNodeContextMenuStrip.ResumeLayout(false); this.toolStrip.ResumeLayout(false); this.toolStrip.PerformLayout(); this.statusStrip.ResumeLayout(false); @@ -1239,7 +1407,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; @@ -1272,64 +1440,27 @@ 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 toolStripSeparator8; - private UI.TypeToolStripButton hex64ToolStripButton; - private UI.TypeToolStripButton hex32ToolStripButton; - private UI.TypeToolStripButton hex16ToolStripButton; - private UI.TypeToolStripButton hex8ToolStripButton; - private System.Windows.Forms.ToolStripSeparator toolStripSeparator9; - private UI.TypeToolStripButton int64ToolStripButton; - private UI.TypeToolStripButton int32ToolStripButton; - private UI.TypeToolStripButton int16ToolStripButton; - private UI.TypeToolStripButton int8ToolStripButton; - private System.Windows.Forms.ToolStripSeparator toolStripSeparator10; - private UI.TypeToolStripButton uint64ToolStripButton; - private UI.TypeToolStripButton uint32ToolStripButton; - private UI.TypeToolStripButton uint16ToolStripButton; - private UI.TypeToolStripButton uint8ToolStripButton; - private System.Windows.Forms.ToolStripSeparator toolStripSeparator11; - private UI.TypeToolStripButton floatToolStripButton; - private UI.TypeToolStripButton doubleToolStripButton; - private System.Windows.Forms.ToolStripSeparator toolStripSeparator12; - private UI.TypeToolStripButton vec4ToolStripButton; - private UI.TypeToolStripButton vec3ToolStripButton; - private UI.TypeToolStripButton vec2ToolStripButton; - private UI.TypeToolStripButton mat44ToolStripButton; - private UI.TypeToolStripButton mat34ToolStripButton; - private UI.TypeToolStripButton mat33ToolStripButton; - private System.Windows.Forms.ToolStripSeparator toolStripSeparator13; - private UI.TypeToolStripButton utf8TextToolStripButton; - private UI.TypeToolStripButton utf8TextPtrToolStripButton; - private UI.TypeToolStripButton utf16TextToolStripButton; - private UI.TypeToolStripButton utf16TextPtrToolStripButton; - private System.Windows.Forms.ToolStripSeparator toolStripSeparator14; - private UI.TypeToolStripButton classInstanceToolStripButton6; - private UI.TypeToolStripButton classPtrToolStripButton; - private UI.TypeToolStripButton arrayToolStripButton; - private UI.TypeToolStripButton vtableToolStripButton; - private System.Windows.Forms.ToolStripSeparator toolStripSeparator15; - private UI.TypeToolStripButton fnPtrToolStripButton; - private UI.ClassNodeView classesView; + private System.Windows.Forms.ToolStripSeparator nodeTypesToolStripSeparator; + private ProjectView projectView; private System.Windows.Forms.ToolStripMenuItem projectToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem cleanUnusedClassesToolStripMenuItem; - private UI.TypeToolStripButton ptrArrayToolStripButton; private System.Windows.Forms.ToolStripSeparator toolStripSeparator16; private System.Windows.Forms.ToolStripMenuItem generateCppCodeToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem generateCSharpCodeToolStripMenuItem; @@ -1337,17 +1468,80 @@ private void InitializeComponent() private System.Windows.Forms.ToolStripSeparator toolStripSeparator17; private System.Windows.Forms.ToolStripMenuItem loadSymbolToolStripMenuItem; private System.Windows.Forms.ToolStripButton openProjectToolStripButton; - private UI.TypeToolStripButton bitFieldToolStripButton; - private System.Windows.Forms.ToolStripSeparator toolStripSeparator18; private System.Windows.Forms.ToolStripStatusLabel infoToolStripStatusLabel; - private System.Windows.Forms.ToolStripSeparator toolStripSeparator19; private System.Windows.Forms.ToolStripMenuItem mergeWithProjectToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem detachToolStripMenuItem; - private UI.TypeToolStripButton boolToolStripButton; - private UI.TypeToolStripButton fnTypeToolStripButton; private System.Windows.Forms.ToolStripMenuItem memorySearcherToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem reattachToProcessToolStripMenuItem; private System.Windows.Forms.ToolStripSplitButton attachToProcessToolStripSplitButton; + private System.Windows.Forms.ToolStripMenuItem namedAddressesToolStripMenuItem; + private System.Windows.Forms.ContextMenuStrip selectedNodeContextMenuStrip; + private System.Windows.Forms.ToolStripMenuItem changeTypeToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem addBytesToolStripMenuItem; + 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 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; + private System.Windows.Forms.ToolStripMenuItem dissectNodesToolStripMenuItem; + private System.Windows.Forms.ToolStripSeparator toolStripSeparator9; + private System.Windows.Forms.ToolStripMenuItem searchForEqualValuesToolStripMenuItem; + private System.Windows.Forms.ToolStripSeparator toolStripSeparator15; + private System.Windows.Forms.ToolStripMenuItem findOutWhatAccessesThisAddressToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem findOutWhatWritesToThisAddressToolStripMenuItem; + private System.Windows.Forms.ToolStripSeparator toolStripSeparator14; + private System.Windows.Forms.ToolStripMenuItem copyNodeToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem pasteNodesToolStripMenuItem; + private System.Windows.Forms.ToolStripSeparator toolStripSeparator10; + private System.Windows.Forms.ToolStripMenuItem removeToolStripMenuItem; + private System.Windows.Forms.ToolStripSeparator toolStripSeparator12; + private System.Windows.Forms.ToolStripMenuItem hideNodesToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem unhideNodesToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem unhideChildNodesToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem unhideNodesAboveToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem unhideNodesBelowToolStripMenuItem; + private System.Windows.Forms.ToolStripSeparator toolStripSeparator18; + private System.Windows.Forms.ToolStripMenuItem copyAddressToolStripMenuItem; + private System.Windows.Forms.ToolStripSeparator toolStripSeparator11; + private System.Windows.Forms.ToolStripMenuItem showCodeOfClassToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem shrinkClassToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem1; + private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem2; + private System.Windows.Forms.ToolStripMenuItem goToClassToolStripMenuItem; + private System.Windows.Forms.ContextMenuStrip projectClassContextMenuStrip; + private System.Windows.Forms.ToolStripMenuItem deleteClassToolStripMenuItem; + private System.Windows.Forms.ToolStripSeparator toolStripSeparator19; + private System.Windows.Forms.ToolStripMenuItem removeUnusedClassesToolStripMenuItem; + private System.Windows.Forms.ToolStripSeparator toolStripSeparator20; + private System.Windows.Forms.ToolStripMenuItem showCodeOfClassToolStripMenuItem2; + private System.Windows.Forms.ContextMenuStrip projectClassesContextMenuStrip; + private System.Windows.Forms.ToolStripMenuItem enableHierarchyViewToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem autoExpandHierarchyViewToolStripMenuItem; + private System.Windows.Forms.ToolStripSeparator toolStripSeparator21; + private System.Windows.Forms.ToolStripMenuItem expandAllClassesToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem collapseAllClassesToolStripMenuItem; + private System.Windows.Forms.ToolStripSeparator toolStripSeparator22; + private System.Windows.Forms.ToolStripMenuItem addNewClassToolStripMenuItem; + private System.Windows.Forms.ContextMenuStrip projectEnumContextMenuStrip; + private System.Windows.Forms.ToolStripMenuItem editEnumToolStripMenuItem; + 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.Functions.cs b/ReClass.NET/Forms/MainForm.Functions.cs new file mode 100644 index 00000000..84f1b53a --- /dev/null +++ b/ReClass.NET/Forms/MainForm.Functions.cs @@ -0,0 +1,560 @@ +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Diagnostics.Contracts; +using System.IO; +using System.Linq; +using System.Threading; +using System.Threading.Tasks; +using System.Windows.Forms; +using ReClassNET.CodeGenerator; +using ReClassNET.Controls; +using ReClassNET.DataExchange.ReClass; +using ReClassNET.Extensions; +using ReClassNET.Logger; +using ReClassNET.Memory; +using ReClassNET.Nodes; +using ReClassNET.Project; +using ReClassNET.UI; + +namespace ReClassNET.Forms +{ + public partial class MainForm + { + public void ShowPartialCodeGeneratorForm(IReadOnlyList partialClasses) + { + Contract.Requires(partialClasses != null); + + ShowCodeGeneratorForm(partialClasses, new EnumDescription[0], new CppCodeGenerator(currentProject.TypeMapping)); + } + + public void ShowCodeGeneratorForm(ICodeGenerator generator) + { + Contract.Requires(generator != null); + + ShowCodeGeneratorForm(currentProject.Classes, currentProject.Enums, generator); + } + + public void ShowCodeGeneratorForm(IReadOnlyList classes, IReadOnlyList enums, ICodeGenerator generator) + { + Contract.Requires(classes != null); + Contract.Requires(generator != null); + Contract.Requires(enums != null); + + new CodeForm(generator, classes, enums, Program.Logger).Show(); + } + + public void AttachToProcess(string processName) + { + var info = Program.CoreFunctions.EnumerateProcesses().FirstOrDefault(p => string.Equals(p.Name, processName, StringComparison.OrdinalIgnoreCase)); + if (info == null) + { + MessageBox.Show($"Process '{processName}' could not be found.", Constants.ApplicationName, MessageBoxButtons.OK, MessageBoxIcon.Error); + + Program.Settings.LastProcess = string.Empty; + } + else + { + AttachToProcess(info); + } + } + + public void AttachToProcess(ProcessInfo info) + { + Contract.Requires(info != null); + + Program.RemoteProcess.Close(); + + Program.RemoteProcess.Open(info); + Program.RemoteProcess.UpdateProcessInformations(); + + Program.Settings.LastProcess = Program.RemoteProcess.UnderlayingProcess.Name; + } + + /// Sets the current project. + /// The new project. + public void SetProject(ReClassNetProject newProject) + { + Contract.Requires(newProject != null); + + if (currentProject == newProject) + { + return; + } + + if (currentProject != null) + { + ClassNode.ClassCreated -= currentProject.AddClass; + } + + void UpdateClassNodes(BaseNode node) + { + projectView.UpdateClassNode((ClassNode)node); + } + + currentProject = newProject; + currentProject.ClassAdded += c => + { + projectView.AddClass(c); + c.NodesChanged += UpdateClassNodes; + c.NameChanged += UpdateClassNodes; + }; + currentProject.ClassRemoved += c => + { + projectView.RemoveClass(c); + c.NodesChanged -= UpdateClassNodes; + c.NameChanged -= UpdateClassNodes; + }; + currentProject.EnumAdded += e => { projectView.AddEnum(e); }; + + ClassNode.ClassCreated += currentProject.AddClass; + + projectView.Clear(); + projectView.AddEnums(currentProject.Enums); + projectView.AddClasses(currentProject.Classes); + CurrentClassNode = currentProject.Classes.FirstOrDefault(); + } + + /// Opens the and calls with the result. + /// The title of the input form. + /// The function to call afterwards. + private void AskAddOrInsertBytes(string title, Action callback) + { + Contract.Requires(title != null); + Contract.Requires(callback != null); + + var classNode = CurrentClassNode; + if (classNode == null) + { + return; + } + + using var ib = new InputBytesForm(classNode.MemorySize) + { + Text = title + }; + + if (ib.ShowDialog() == DialogResult.OK) + { + callback(ib.Bytes); + } + } + + /// + /// Adds bytes at the end of the current class. + /// + /// Amount of bytes + public void AddBytesToClass(int bytes) + { + Contract.Requires(bytes >= 0); + + var node = memoryViewControl.GetSelectedNodes().Select(h => h.Node).FirstOrDefault(); + if (node == null) + { + return; + } + + (node as BaseContainerNode ?? node.GetParentContainer())?.AddBytes(bytes); + + Invalidate(); + } + + /// + /// Inserts bytes at the first selected node to the current class. + /// + /// Amount of bytes + public void InsertBytesInClass(int bytes) + { + Contract.Requires(bytes >= 0); + + var node = memoryViewControl.GetSelectedNodes().Select(h => h.Node).FirstOrDefault(); + if (node == null) + { + return; + } + + (node as BaseContainerNode ?? node.GetParentContainer())?.InsertBytes(node, bytes); + + Invalidate(); + } + + /// + /// Unselects all selected nodes. + /// + public void ClearSelection() + { + memoryViewControl.ClearSelection(); + } + + /// Shows an with all valid file extensions. + /// The path to the selected file or null if no file was selected. + public static string ShowOpenProjectFileDialog() + { + using var ofd = new OpenFileDialog + { + 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; + } + + return null; + } + + /// Loads the file as a new project. + /// Full pathname of the file. + public void LoadProjectFromPath(string path) + { + Contract.Requires(path != null); + + var project = new ReClassNetProject(); + + LoadProjectFromPath(path, ref project); + + // If the file is a ReClass.NET file remember the path. + if (Path.GetExtension(path) == ReClassNetFile.FileExtension) + { + project.Path = path; + } + + SetProject(project); + } + + /// Loads the file into the given project. + /// Full pathname of the file. + /// [in,out] The project. + private static void LoadProjectFromPath(string path, ref ReClassNetProject project) + { + Contract.Requires(path != null); + Contract.Requires(project != null); + Contract.Ensures(Contract.ValueAtReturn(out project) != null); + + IReClassImport import; + switch (Path.GetExtension(path)?.ToLower()) + { + case ReClassNetFile.FileExtension: + import = new ReClassNetFile(project); + break; + case ReClassQtFile.FileExtension: + import = new ReClassQtFile(project); + break; + case ReClassFile.FileExtension: + import = new ReClassFile(project); + break; + default: + Program.Logger.Log(LogLevel.Error, $"The file '{path}' has an unknown type."); + return; + } + import.Load(path, Program.Logger); + } + + /// Loads all symbols for the current process and displays the progress status. + private void LoadAllSymbolsForCurrentProcess() + { + if (loadSymbolsTask != null && !loadSymbolsTask.IsCompleted) + { + return; + } + + infoToolStripStatusLabel.Visible = true; + + var index = 0; + + var progress = new Progress>>( + report => + { + infoToolStripStatusLabel.Text = $"[{++index}/{report.Item2.Count}] Loading symbols for module: {report.Item1.Name}"; + } + ); + + loadSymbolsTaskToken = new CancellationTokenSource(); + + loadSymbolsTask = Program.RemoteProcess + .LoadAllSymbolsAsync(progress, loadSymbolsTaskToken.Token) + .ContinueWith(_ => infoToolStripStatusLabel.Visible = false, TaskScheduler.FromCurrentSynchronizationContext()); + } + + public void ReplaceSelectedNodesWithType(Type type) + { + Contract.Requires(type != null); + Contract.Requires(type.IsSubclassOf(typeof(BaseNode))); + + var selectedNodes = memoryViewControl.GetSelectedNodes(); + + var newSelected = new List(selectedNodes.Count); + + var hotSpotPartitions = selectedNodes + .WhereNot(s => s.Node is ClassNode) + .GroupBy(s => s.Node.GetParentContainer()) + .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 containerPartitions in hotSpotPartitions) + { + containerPartitions.Container.BeginUpdate(); + + foreach (var partition in containerPartitions.Partitions) + { + var hotSpotsToReplace = new Queue(partition); + while (hotSpotsToReplace.Count > 0) + { + var selected = hotSpotsToReplace.Dequeue(); + + var node = BaseNode.CreateInstanceFromType(type); + + var createdNodes = new List(); + containerPartitions.Container.ReplaceChildNode(selected.Node, node, ref createdNodes); + + node.IsSelected = true; + + var info = new MemoryViewControl.SelectedNodeInfo(node, selected.Process, selected.Memory, selected.Address, selected.Level); + + 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) + { + hotSpotsToReplace.Enqueue(new MemoryViewControl.SelectedNodeInfo(createdNode, selected.Process, selected.Memory, selected.Address + createdNode.Offset - node.Offset, selected.Level)); + } + } + } + } + + containerPartitions.Container.EndUpdate(); + } + + memoryViewControl.ClearSelection(); + + if (newSelected.Count > 0) + { + memoryViewControl.SetSelectedNodes(newSelected); + } + } + + private void FindWhatInteractsWithSelectedNode(bool writeOnly) + { + var selectedNode = memoryViewControl.GetSelectedNodes().FirstOrDefault(); + if (selectedNode == null) + { + return; + } + + LinkedWindowFeatures.FindWhatInteractsWithAddress(selectedNode.Address, selectedNode.Node.MemorySize, writeOnly); + } + + private void CopySelectedNodesToClipboard() + { + var selectedNodes = memoryViewControl.GetSelectedNodes(); + if (selectedNodes.Count > 0) + { + ReClassClipboard.Copy(selectedNodes.Select(h => h.Node), Program.Logger); + } + } + + private void PasteNodeFromClipboardToSelection() + { + var (classNodes, nodes) = ReClassClipboard.Paste(CurrentProject, Program.Logger); + foreach (var pastedClassNode in classNodes) + { + if (!CurrentProject.ContainsClass(pastedClassNode.Uuid)) + { + CurrentProject.AddClass(pastedClassNode); + } + } + + var selectedNodes = memoryViewControl.GetSelectedNodes(); + if (selectedNodes.Count == 1) + { + var selectedNode = selectedNodes[0].Node; + var containerNode = selectedNode.GetParentContainer(); + var classNode = selectedNode.GetParentClass(); + if (containerNode != null && classNode != null) + { + containerNode.BeginUpdate(); + + foreach (var node in nodes) + { + if (node is BaseWrapperNode) + { + var rootWrapper = node.GetRootWrapperNode(); + Debug.Assert(rootWrapper == node); + + if (rootWrapper.ShouldPerformCycleCheckForInnerNode()) + { + if (rootWrapper.ResolveMostInnerNode() is ClassNode innerNode) + { + if (!IsCycleFree(classNode, innerNode)) + { + continue; + } + } + } + } + + containerNode.InsertNode(selectedNode, node); + } + + containerNode.EndUpdate(); + } + } + } + + private void EditSelectedNodeName() + { + var selectedNodes = memoryViewControl.GetSelectedNodes(); + if (selectedNodes.Count == 1) + { + memoryViewControl.ShowNodeNameEditBox(selectedNodes[0].Node); + } + } + + private void RemoveSelectedNodes() + { + memoryViewControl.GetSelectedNodes() + .WhereNot(h => h.Node is ClassNode) + .ForEach(h => h.Node.GetParentContainer().RemoveNode(h.Node)); + + ClearSelection(); + } + + private void HideSelectedNodes() + { + foreach (var hotSpot in memoryViewControl.GetSelectedNodes()) + { + hotSpot.Node.IsHidden = true; + } + + ClearSelection(); + } + + private void UnhideChildNodes() + { + var selectedNodes = memoryViewControl.GetSelectedNodes(); + if (selectedNodes.Count != 1) + { + return; + } + + if (!(selectedNodes[0].Node is BaseContainerNode containerNode)) + { + return; + } + + foreach (var bn in containerNode.Nodes) + { + bn.IsHidden = false; + bn.IsSelected = false; + } + + containerNode.IsSelected = false; + + ClearSelection(); + } + + private void UnhideNodesBelow() + { + var selectedNodes = memoryViewControl.GetSelectedNodes(); + if (selectedNodes.Count != 1) + { + return; + } + + var selectedNode = selectedNodes[0].Node; + + var parentNode = selectedNode.GetParentContainer(); + if (parentNode == null) + { + return; + } + + var hiddenNodeStartIndex = parentNode.FindNodeIndex(selectedNode) + 1; + if (hiddenNodeStartIndex >= parentNode.Nodes.Count) + { + return; + } + + for (var i = hiddenNodeStartIndex; i < parentNode.Nodes.Count; i++) + { + var indexNode = parentNode.Nodes[i]; + if (indexNode.IsHidden) + { + indexNode.IsHidden = false; + indexNode.IsSelected = false; + } + else + { + break; + } + } + + selectedNode.IsSelected = false; + + ClearSelection(); + } + + private void UnhideNodesAbove() + { + var selectedNodes = memoryViewControl.GetSelectedNodes(); + if (selectedNodes.Count != 1) + { + return; + } + + var selectedNode = selectedNodes[0].Node; + + var parentNode = selectedNode.GetParentContainer(); + if (parentNode == null) + { + return; + } + + var hiddenNodeStartIndex = parentNode.FindNodeIndex(selectedNode) - 1; + if (hiddenNodeStartIndex < 0) + { + return; + } + + for (var i = hiddenNodeStartIndex; i > -1; i--) + { + var indexNode = parentNode.Nodes[i]; + if (indexNode.IsHidden) + { + indexNode.IsHidden = false; + indexNode.IsSelected = false; + } + else + { + break; + } + } + + selectedNode.IsSelected = false; + + ClearSelection(); + } + + private bool IsCycleFree(ClassNode parent, ClassNode node) + { + if (ClassUtil.IsCyclicIfClassIsAccessibleFromParent(parent, node, CurrentProject.Classes)) + { + MessageBox.Show("Invalid operation because this would create a class cycle.", "Cycle Detected", MessageBoxButtons.OK, MessageBoxIcon.Error); + + return false; + } + + return true; + } + } +} diff --git a/ReClass.NET/Forms/MainForm.cs b/ReClass.NET/Forms/MainForm.cs index 8085e282..e771a10d 100644 --- a/ReClass.NET/Forms/MainForm.cs +++ b/ReClass.NET/Forms/MainForm.cs @@ -1,69 +1,99 @@ -using System; -using System.Collections.Generic; +using System; +using System.ComponentModel; using System.Diagnostics.Contracts; -using System.Drawing; using System.IO; using System.Linq; +using System.Text; using System.Threading; using System.Threading.Tasks; using System.Windows.Forms; +using ReClassNET.AddressParser; using ReClassNET.CodeGenerator; +using ReClassNET.Controls; using ReClassNET.Core; using ReClassNET.DataExchange.ReClass; -using ReClassNET.Logger; +using ReClassNET.Extensions; using ReClassNET.Memory; +using ReClassNET.MemoryScanner; +using ReClassNET.MemoryScanner.Comparer; using ReClassNET.Nodes; using ReClassNET.Plugins; +using ReClassNET.Project; using ReClassNET.UI; using ReClassNET.Util; +using ReClassNET.Util.Conversion; 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; + private ClassNode currentClassNode; + + private readonly MemoryBuffer memoryViewBuffer = new MemoryBuffer(); + private Task updateProcessInformationsTask; private Task loadSymbolsTask; private CancellationTokenSource loadSymbolsTaskToken; - public ClassNodeView ClassView => classesView; + public ProjectView ProjectView => projectView; public MenuStrip MainMenu => mainMenuStrip; + public ClassNode CurrentClassNode + { + get => currentClassNode; + set + { + currentClassNode = value; + + projectView.SelectedClass = value; + + memoryViewControl.Reset(); + memoryViewControl.Invalidate(); + } + } + + 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(); - - Text = $"{Constants.ApplicationName} ({Constants.Platform})"; + UpdateWindowTitle(); mainMenuStrip.Renderer = new CustomToolStripProfessionalRenderer(true, true); toolStrip.Renderer = new CustomToolStripProfessionalRenderer(true, false); + isLittleEndianToolStripMenuItem.Checked = BitConverter.IsLittleEndian; Program.RemoteProcess.ProcessAttached += sender => { var text = $"{sender.UnderlayingProcess.Name} (ID: {sender.UnderlayingProcess.Id.ToString()})"; - - Text = $"{Constants.ApplicationName} ({Constants.Platform}) - {text}"; processInfoToolStripStatusLabel.Text = text; + UpdateWindowTitle(text); + }; Program.RemoteProcess.ProcessClosed += sender => { - Text = $"{Constants.ApplicationName} ({Constants.Platform})"; + UpdateWindowTitle(); processInfoToolStripStatusLabel.Text = "No process selected"; }; - memoryViewControl.Memory = new MemoryBuffer - { - Process = Program.RemoteProcess - }; - pluginManager = new PluginManager(new DefaultPluginHost(this, Program.RemoteProcess, Program.Logger)); } @@ -75,6 +105,9 @@ protected override void OnLoad(EventArgs e) pluginManager.LoadAllPlugins(Path.Combine(Application.StartupPath, Constants.PluginsFolder), Program.Logger); + toolStrip.Items.AddRange(NodeTypesBuilder.CreateToolStripButtons(ReplaceSelectedNodesWithType).ToArray()); + changeTypeToolStripMenuItem.DropDownItems.AddRange(NodeTypesBuilder.CreateToolStripMenuItems(ReplaceSelectedNodesWithType, false).ToArray()); + var createDefaultProject = true; if (Program.CommandLineArgs.FileName != null) @@ -113,8 +146,6 @@ protected override void OnFormClosed(FormClosedEventArgs e) base.OnFormClosed(e); } - #region Event Handler - private async void MainForm_FormClosing(object sender, FormClosingEventArgs e) { // Stop the update timer @@ -137,7 +168,7 @@ private async void MainForm_FormClosing(object sender, FormClosingEventArgs e) } catch { - + // ignored } loadSymbolsTask = null; @@ -151,7 +182,7 @@ private async void MainForm_FormClosing(object sender, FormClosingEventArgs e) } catch { - + // ignored } updateProcessInformationsTask = null; @@ -230,11 +261,23 @@ 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)); + + if (csf.ShowDialog() == DialogResult.OK) + { + var selectedClassNode = csf.SelectedClass; + if (selectedClassNode != null) + { + projectView.SelectedClass = selectedClassNode; + } + } + } + private void clearProjectToolStripMenuItem_Click(object sender, EventArgs e) { SetProject(new ReClassNetProject()); - - memoryViewControl.ClassNode = null; } private void saveToolStripMenuItem_Click(object sender, EventArgs e) @@ -262,34 +305,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)) - { - 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) @@ -299,30 +340,41 @@ private void quitToolStripMenuItem_Click(object sender, EventArgs e) private void memoryViewerToolStripMenuItem_Click(object sender, EventArgs e) { - new ProcessInfoForm().Show(); + new ProcessInfoForm(Program.RemoteProcess).Show(); } private void memorySearcherToolStripMenuItem_Click(object sender, EventArgs e) { - new ScannerForm().Show(); + new ScannerForm(Program.RemoteProcess).Show(); + } + + 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()) + 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); } } } @@ -359,20 +411,19 @@ private void cleanUnusedClassesToolStripMenuItem_Click(object sender, EventArgs private void generateCppCodeToolStripMenuItem_Click(object sender, EventArgs e) { - ShowCodeForm(new CppCodeGenerator()); + ShowCodeGeneratorForm(new CppCodeGenerator(currentProject.TypeMapping)); } private void generateCSharpCodeToolStripMenuItem_Click(object sender, EventArgs e) { - ShowCodeForm(new CSharpCodeGenerator()); + ShowCodeGeneratorForm(new CSharpCodeGenerator()); } private void aboutToolStripMenuItem_Click(object sender, EventArgs e) { - using (var af = new AboutForm()) - { - af.ShowDialog(); - } + using var af = new AboutForm(); + + af.ShowDialog(); } #endregion @@ -381,18 +432,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(); } } } @@ -409,10 +459,66 @@ private void attachToProcessToolStripSplitButton_DropDownOpening(object sender, Program.CoreFunctions.EnumerateProcesses() .OrderBy(p => p.Name).ThenBy(p => p.Id, IntPtrComparer.Instance) .Select(p => new ToolStripMenuItem($"[{p.Id}] {p.Name}", p.Icon, (sender2, e2) => AttachToProcess(p))) + .Cast() .ToArray() ); } + private void selectedNodeContextMenuStrip_Opening(object sender, CancelEventArgs e) + { + var selectedNodes = memoryViewControl.GetSelectedNodes(); + + var count = selectedNodes.Count; + var node = selectedNodes.Select(s => s.Node).FirstOrDefault(); + var parentNode = node?.GetParentContainer(); + + var nodeIsClass = node is ClassNode; + var nodeIsContainer = node is BaseContainerNode; + var nodeIsSearchableValueNode = node switch + { + 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 || nodeIsContainer; + insertBytesToolStripMenuItem.Enabled = count == 1 && parentNode != null && !nodeIsContainer; + + changeTypeToolStripMenuItem.Enabled = count > 0 && !nodeIsClass; + + createClassFromNodesToolStripMenuItem.Enabled = count > 0 && !nodeIsClass; + dissectNodesToolStripMenuItem.Enabled = count > 0 && !nodeIsClass; + searchForEqualValuesToolStripMenuItem.Enabled = count == 1 && nodeIsSearchableValueNode; + + pasteNodesToolStripMenuItem.Enabled = count == 1 && ReClassClipboard.ContainsNodes; + removeToolStripMenuItem.Enabled = !nodeIsClass; + + copyAddressToolStripMenuItem.Enabled = !nodeIsClass; + + showCodeOfClassToolStripMenuItem.Enabled = nodeIsClass; + shrinkClassToolStripMenuItem.Enabled = nodeIsClass; + + hideNodesToolStripMenuItem.Enabled = selectedNodes.All(h => !(h.Node is ClassNode)); + + unhideChildNodesToolStripMenuItem.Enabled = count == 1 && node is BaseContainerNode bcn && bcn.Nodes.Any(n => n.IsHidden); + unhideNodesAboveToolStripMenuItem.Enabled = count == 1 && parentNode != null && parentNode.TryGetPredecessor(node, out var predecessor) && predecessor.IsHidden; + unhideNodesBelowToolStripMenuItem.Enabled = count == 1 && parentNode != null && parentNode.TryGetSuccessor(node, out var successor) && successor.IsHidden; + } + private void addBytesToolStripMenuItem_Click(object sender, EventArgs e) { if (!(sender is IntegerToolStripMenuItem item)) @@ -420,12 +526,12 @@ private void addBytesToolStripMenuItem_Click(object sender, EventArgs e) return; } - memoryViewControl.AddBytes(item.Value); + AddBytesToClass(item.Value); } private void addXBytesToolStripMenuItem_Click(object sender, EventArgs e) { - AskAddOrInsertBytes("Add Bytes", memoryViewControl.AddBytes); + AskAddOrInsertBytes("Add Bytes", AddBytesToClass); } private void insertBytesToolStripMenuItem_Click(object sender, EventArgs e) @@ -435,25 +541,212 @@ private void insertBytesToolStripMenuItem_Click(object sender, EventArgs e) return; } - memoryViewControl.InsertBytes(item.Value); + InsertBytesInClass(item.Value); } private void insertXBytesToolStripMenuItem_Click(object sender, EventArgs e) { - AskAddOrInsertBytes("Insert Bytes", memoryViewControl.InsertBytes); + AskAddOrInsertBytes("Insert Bytes", InsertBytesInClass); + } + + private void createClassFromNodesToolStripMenuItem_Click(object sender, EventArgs e) + { + var selectedNodes = memoryViewControl.GetSelectedNodes(); + + if (selectedNodes.Count > 0 && !(selectedNodes[0].Node is ClassNode)) + { + if (selectedNodes[0].Node.GetParentContainer() is ClassNode parentNode) + { + var newClassNode = ClassNode.Create(); + selectedNodes.Select(h => h.Node).ForEach(newClassNode.AddNode); + + var classInstanceNode = new ClassInstanceNode(); + classInstanceNode.ChangeInnerNode(newClassNode); + + parentNode.InsertNode(selectedNodes[0].Node, classInstanceNode); + + selectedNodes.Select(h => h.Node).ForEach(c => parentNode.RemoveNode(c)); + + ClearSelection(); + } + } } - private void memoryTypeToolStripButton_Click(object sender, EventArgs e) + private void dissectNodesToolStripMenuItem_Click(object sender, EventArgs e) { - if (!(sender is TypeToolStripButton item)) + var hexNodes = memoryViewControl.GetSelectedNodes().Where(h => h.Node is BaseHexNode).ToList(); + if (!hexNodes.Any()) { return; } - memoryViewControl.ReplaceSelectedNodesWithType(item.Value); + foreach (var g in hexNodes.GroupBy(n => n.Node.GetParentContainer())) + { + NodeDissector.DissectNodes(g.Select(h => (BaseHexNode)h.Node), Program.RemoteProcess, g.First().Memory); + } + + ClearSelection(); } - #endregion + private void searchForEqualValuesToolStripMenuItem_Click(object sender, EventArgs e) + { + var selectedNode = memoryViewControl.GetSelectedNodes().FirstOrDefault(); + if (selectedNode == null) + { + return; + } + + var bitConverter = Program.RemoteProcess.BitConverter; + + IScanComparer comparer; + switch (selectedNode.Node) + { + case BaseHexNode node: + 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, bitConverter); + break; + case DoubleNode node: + 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); + break; + case UInt8Node node: + comparer = new ByteMemoryComparer(ScanCompareType.Equal, node.ReadValueFromMemory(selectedNode.Memory), 0); + break; + case Int16Node node: + 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, bitConverter); + break; + case Int32Node node: + 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, bitConverter); + break; + case Int64Node node: + 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, bitConverter); + break; + case NIntNode node: + { + var value = node.ReadValueFromMemory(selectedNode.Memory); +#if RECLASSNET64 + comparer = new LongMemoryComparer(ScanCompareType.Equal, value.ToInt64(), 0L, bitConverter); +#else + comparer = new IntegerMemoryComparer(ScanCompareType.Equal, value.ToInt32(), 0, bitConverter); +#endif + break; + } + case NUIntNode node: + { + var value = node.ReadValueFromMemory(selectedNode.Memory); +#if RECLASSNET64 + comparer = new LongMemoryComparer(ScanCompareType.Equal, (long)value.ToUInt64(), 0L, bitConverter); +#else + comparer = new IntegerMemoryComparer(ScanCompareType.Equal, (int)value.ToUInt32(), 0, bitConverter); +#endif + break; + } + case Utf8TextNode node: + comparer = new StringMemoryComparer(node.ReadValueFromMemory(selectedNode.Memory), Encoding.UTF8, true); + break; + case Utf16TextNode node: + comparer = new StringMemoryComparer(node.ReadValueFromMemory(selectedNode.Memory), Encoding.Unicode, true); + break; + case Utf32TextNode node: + comparer = new StringMemoryComparer(node.ReadValueFromMemory(selectedNode.Memory), Encoding.UTF32, true); + break; + default: + return; + } + + LinkedWindowFeatures.StartMemoryScan(comparer); + } + + private void findOutWhatAccessesThisAddressToolStripMenuItem_Click(object sender, EventArgs e) + { + FindWhatInteractsWithSelectedNode(false); + } + + private void findOutWhatWritesToThisAddressToolStripMenuItem_Click(object sender, EventArgs e) + { + FindWhatInteractsWithSelectedNode(true); + } + + private void copyNodeToolStripMenuItem_Click(object sender, EventArgs e) + { + CopySelectedNodesToClipboard(); + } + + private void pasteNodesToolStripMenuItem_Click(object sender, EventArgs e) + { + PasteNodeFromClipboardToSelection(); + } + + private void removeToolStripMenuItem_Click(object sender, EventArgs e) + { + RemoveSelectedNodes(); + } + + private void hideNodesToolStripMenuItem_Click(object sender, EventArgs e) + { + HideSelectedNodes(); + } + + private void unhideChildNodesToolStripMenuItem_Click(object sender, EventArgs e) + { + UnhideChildNodes(); + } + + private void unhideNodesAboveToolStripMenuItem_Click(object sender, EventArgs e) + { + UnhideNodesAbove(); + } + + private void unhideNodesBelowToolStripMenuItem_Click(object sender, EventArgs e) + { + UnhideNodesBelow(); + } + + private void copyAddressToolStripMenuItem_Click(object sender, EventArgs e) + { + var selectedNodes = memoryViewControl.GetSelectedNodes(); + if (selectedNodes.Count > 0) + { + Clipboard.SetText(selectedNodes.First().Address.ToString("X")); + } + } + + private void showCodeOfClassToolStripMenuItem_Click(object sender, EventArgs e) + { + if (memoryViewControl.GetSelectedNodes().FirstOrDefault()?.Node is ClassNode node) + { + ShowPartialCodeGeneratorForm(new[] { node }); + } + } + + private void shrinkClassToolStripMenuItem_Click(object sender, EventArgs e) + { + var node = memoryViewControl.GetSelectedNodes().Select(s => s.Node).FirstOrDefault(); + if (!(node is ClassNode classNode)) + { + return; + } + + foreach (var nodeToDelete in classNode.Nodes.Reverse().TakeWhile(n => n is BaseHexNode)) + { + classNode.RemoveNode(nodeToDelete); + } + } + +#endregion private void MainForm_DragEnter(object sender, DragEventArgs e) { @@ -466,7 +759,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; } @@ -503,9 +795,28 @@ private void processUpdateTimer_Tick(object sender, EventArgs e) private void classesView_ClassSelected(object sender, ClassNode node) { - memoryViewControl.ClassNode = node; + CurrentClassNode = node; + } + + private void memoryViewControl_KeyDown(object sender, KeyEventArgs args) + { + switch (args.KeyCode) + { + case Keys.C when args.Control: + CopySelectedNodesToClipboard(); + break; + case Keys.V when args.Control: + PasteNodeFromClipboardToSelection(); + break; + + case Keys.Delete: + RemoveSelectedNodes(); + break; - memoryViewControl.Invalidate(); + case Keys.F2: + EditSelectedNodeName(); + break; + } } private void memoryViewControl_SelectionChanged(object sender, EventArgs e) @@ -515,241 +826,230 @@ private void memoryViewControl_SelectionChanged(object sender, EventArgs e) return; } - var count = memoryView.SelectedNodes.Count(); - var node = memoryView.SelectedNodes.FirstOrDefault(); + var selectedNodes = memoryView.GetSelectedNodes(); - addBytesToolStripDropDownButton.Enabled = node?.ParentNode != null || node is ClassNode; - insertBytesToolStripDropDownButton.Enabled = count == 1 && node?.ParentNode != null; + var node = selectedNodes.FirstOrDefault()?.Node; + var parentContainer = node?.GetParentContainer(); + var nodeIsClass = node is ClassNode; + var isContainerNode = node is BaseContainerNode; - var enabled = count > 0 && !(node is ClassNode); + 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); } - #endregion - - public void AttachToProcess(string processName) + private void memoryViewControl_ChangeClassTypeClick(object sender, NodeClickEventArgs e) { - var info = Program.CoreFunctions.EnumerateProcesses().FirstOrDefault(p => string.Equals(p.Name, processName, StringComparison.OrdinalIgnoreCase)); - if (info == null) + var classes = CurrentProject.Classes.OrderBy(c => c.Name); + + if (e.Node is FunctionNode functionNode) { - MessageBox.Show($"Process '{processName}' could not be found.", Constants.ApplicationName, MessageBoxButtons.OK, MessageBoxIcon.Error); + var noneClass = new ClassNode(false) + { + Name = "None" + }; + + using var csf = new ClassSelectionForm(classes.Prepend(noneClass)); - Program.Settings.LastProcess = string.Empty; + if (csf.ShowDialog() == DialogResult.OK) + { + var selectedClassNode = csf.SelectedClass; + if (selectedClassNode != null) + { + if (selectedClassNode == noneClass) + { + selectedClassNode = null; + } + + functionNode.BelongsToClass = selectedClassNode; + } + } } - else + else if (e.Node is BaseWrapperNode refNode) { - AttachToProcess(info); + using var csf = new ClassSelectionForm(classes); + + if (csf.ShowDialog() == DialogResult.OK) + { + var selectedClassNode = csf.SelectedClass; + if (refNode.CanChangeInnerNodeTo(selectedClassNode)) + { + if (!refNode.GetRootWrapperNode().ShouldPerformCycleCheckForInnerNode() || IsCycleFree(e.Node.GetParentClass(), selectedClassNode)) + { + refNode.ChangeInnerNode(selectedClassNode); + } + } + } } } - public void AttachToProcess(ProcessInfo info) + private void memoryViewControl_ChangeWrappedTypeClick(object sender, NodeClickEventArgs e) { - Contract.Requires(info != null); - - Program.RemoteProcess.Close(); - - Program.RemoteProcess.Open(info); - Program.RemoteProcess.UpdateProcessInformations(); + if (e.Node is BaseWrapperNode wrapperNode) + { + var items = NodeTypesBuilder.CreateToolStripMenuItems(t => + { + var node = BaseNode.CreateInstanceFromType(t); + if (wrapperNode.CanChangeInnerNodeTo(node)) + { + wrapperNode.ChangeInnerNode(node); + } + }, wrapperNode.CanChangeInnerNodeTo(null)); - Program.Settings.LastProcess = Program.RemoteProcess.UnderlayingProcess.Name; + var menu = new ContextMenuStrip(); + menu.Items.AddRange(items.ToArray()); + menu.Show(this, e.Location); + } } - /// Sets the current project. - /// The new project. - public void SetProject(ReClassNetProject newProject) + private void memoryViewControl_ChangeEnumTypeClick(object sender, NodeClickEventArgs e) { - Contract.Requires(newProject != null); - - if (currentProject == newProject) + if (e.Node is EnumNode enumNode) { - return; - } + using var csf = new EnumSelectionForm(CurrentProject); - if (currentProject != null) - { - ClassNode.ClassCreated -= currentProject.AddClass; - } + var size = enumNode.Enum.Size; - currentProject = newProject; + if (csf.ShowDialog() == DialogResult.OK) + { + var @enum = csf.SelectedItem; + if (@enum != null) + { + enumNode.ChangeEnum(@enum); + } + } - ClassUtil.Classes = currentProject.Classes; + if (size != enumNode.Enum.Size) + { + // Update the parent container because the enum size has changed. + enumNode.GetParentContainer()?.ChildHasChanged(enumNode); + } - ClassNode.ClassCreated += currentProject.AddClass; + foreach (var @enum in CurrentProject.Enums) + { + projectView.UpdateEnumNode(@enum); + } + } + } - classesView.Project = currentProject; - memoryViewControl.Project = currentProject; + private void showCodeOfClassToolStripMenuItem2_Click(object sender, EventArgs e) + { + var classNode = projectView.SelectedClass; + if (classNode == null) + { + return; + } - memoryViewControl.ClassNode = currentProject.Classes.FirstOrDefault(); + ShowPartialCodeGeneratorForm(new[] { classNode }); } - /// Registers the node type which will create the ToolStrip and MenuStrip entries. - /// The node type. - /// The name of the node type. - /// The icon of the node type. - internal void RegisterNodeType(Type type, string name, Image icon) + private void enableHierarchyViewToolStripMenuItem_Click(object sender, EventArgs e) { - Contract.Requires(type != null); - Contract.Requires(name != null); - Contract.Requires(icon != null); + var isChecked = !enableHierarchyViewToolStripMenuItem.Checked; - var item = new TypeToolStripButton - { - Image = icon, - ToolTipText = name, - Value = type - }; - item.Click += memoryTypeToolStripButton_Click; + enableHierarchyViewToolStripMenuItem.Checked = isChecked; - toolStrip.Items.Add(item); + expandAllClassesToolStripMenuItem.Enabled = collapseAllClassesToolStripMenuItem.Enabled = isChecked; - memoryViewControl.RegisterNodeType(type, name, icon); + projectView.EnableClassHierarchyView = isChecked; } - /// Deregisters the node type. - /// The node type. - internal void DeregisterNodeType(Type type) + private void autoExpandHierarchyViewToolStripMenuItem_Click(object sender, EventArgs e) { - Contract.Requires(type != null); + var isChecked = !autoExpandHierarchyViewToolStripMenuItem.Checked; - var item = toolStrip.Items.OfType().FirstOrDefault(i => i.Value == type); - if (item != null) - { - item.Click -= memoryTypeToolStripButton_Click; - toolStrip.Items.Remove(item); - } + autoExpandHierarchyViewToolStripMenuItem.Checked = isChecked; - memoryViewControl.DeregisterNodeType(type); + projectView.AutoExpandClassNodes = isChecked; } - /// Shows the code form with the given . - /// The generator. - private void ShowCodeForm(ICodeGenerator generator) + private void expandAllClassesToolStripMenuItem_Click(object sender, EventArgs e) { - Contract.Requires(generator != null); + projectView.ExpandAllClassNodes(); + } - LinkedWindowFeatures.ShowCodeGeneratorForm(currentProject.Classes, generator); + private void collapseAllClassesToolStripMenuItem_Click(object sender, EventArgs e) + { + projectView.CollapseAllClassNodes(); } - /// Opens the and calls with the result. - /// The title of the input form. - /// The function to call afterwards. - private void AskAddOrInsertBytes(string title, Action callback) + private void removeUnusedClassesToolStripMenuItem_Click(object sender, EventArgs e) { - Contract.Requires(title != null); - Contract.Requires(callback != null); + CurrentProject.RemoveUnusedClasses(); + } - if (memoryViewControl.ClassNode == null) + private void deleteClassToolStripMenuItem_Click(object sender, EventArgs e) + { + var classNode = projectView.SelectedClass; + if (classNode == null) { return; } - using (var ib = new InputBytesForm(memoryViewControl.ClassNode.MemorySize)) + try { - ib.Text = title; - - if (ib.ShowDialog() == DialogResult.OK) - { - callback(ib.Bytes); - } + CurrentProject.Remove(classNode); } - } - - /// Shows an with all valid file extensions. - /// The path to the selected file or null if no file was selected. - public static string ShowOpenProjectFileDialog() - { - using (var ofd = new OpenFileDialog()) + catch (ClassReferencedException ex) { - ofd.CheckFileExists = true; - ofd.Filter = $"All ReClass Types |*{ReClassNetFile.FileExtension};*{ReClassFile.FileExtension};*{ReClassQtFile.FileExtension};*{ReClass2007File.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}"; - - if (ofd.ShowDialog() == DialogResult.OK) - { - return ofd.FileName; - } + Program.Logger.Log(ex); } - - return null; } - /// Loads the file as a new project. - /// Full pathname of the file. - public void LoadProjectFromPath(string path) + private void editEnumsToolStripMenuItem_Click(object sender, EventArgs e) { - Contract.Requires(path != null); - - var project = new ReClassNetProject(); + using var elf = new EnumListForm(currentProject); - LoadProjectFromPath(path, ref project); + elf.ShowDialog(); + } - // If the file is a ReClass.NET file remember the path. - if (Path.GetExtension(path) == ReClassNetFile.FileExtension) + private void editEnumToolStripMenuItem_Click(object sender, EventArgs e) + { + var @enum = projectView.SelectedEnum; + if (@enum != null) { - project.Path = path; - } + using var eef = new EnumEditorForm(@enum); - SetProject(project); + eef.ShowDialog(); + } } - /// Loads the file into the given project. - /// Full pathname of the file. - /// [in,out] The project. - private static void LoadProjectFromPath(string path, ref ReClassNetProject project) + private void showEnumsToolStripMenuItem_Click(object sender, EventArgs e) { - Contract.Requires(path != null); - Contract.Requires(project != null); - Contract.Ensures(Contract.ValueAtReturn(out project) != null); + using var elf = new EnumListForm(currentProject); - IReClassImport import; - switch (Path.GetExtension(path)?.ToLower()) - { - case ReClassNetFile.FileExtension: - import = new ReClassNetFile(project); - break; - case ReClassQtFile.FileExtension: - import = new ReClassQtFile(project); - break; - 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; - } - import.Load(path, Program.Logger); + elf.ShowDialog(); } - /// Loads all symbols for the current process and displays the progress status. - private void LoadAllSymbolsForCurrentProcess() + private void memoryViewControl_DrawContextRequested(object sender, DrawContextRequestEventArgs args) { - if (loadSymbolsTask != null && !loadSymbolsTask.IsCompleted) - { - return; - } - - infoToolStripStatusLabel.Visible = true; + var process = Program.RemoteProcess; - int index = 0; + var classNode = CurrentClassNode; + if (classNode != null) + { + memoryViewBuffer.Size = classNode.MemorySize; - var progress = new Progress>>( - report => + IntPtr address; + try { - infoToolStripStatusLabel.Text = $"[{++index}/{report.Item2.Count()}] Loading symbols for module: {report.Item1.Name}"; + address = process.ParseAddress(classNode.AddressFormula); } - ); - - loadSymbolsTaskToken = new CancellationTokenSource(); - - loadSymbolsTask = Program.RemoteProcess - .LoadAllSymbolsAsync(progress, loadSymbolsTaskToken.Token) - .ContinueWith(_ => infoToolStripStatusLabel.Visible = false, TaskScheduler.FromCurrentSynchronizationContext()); + catch (ParseException) + { + address = IntPtr.Zero; + } + memoryViewBuffer.UpdateFrom(process, address); + + args.Settings = Program.Settings; + args.IconProvider = iconProvider; + args.Process = process; + args.Memory = memoryViewBuffer; + args.Node = classNode; + args.BaseAddress = address; + } } } } diff --git a/ReClass.NET/Forms/MainForm.resx b/ReClass.NET/Forms/MainForm.resx index 8fe54edd..c430dab3 100644 --- a/ReClass.NET/Forms/MainForm.resx +++ b/ReClass.NET/Forms/MainForm.resx @@ -120,6 +120,21 @@ 366, 17 + + 756, 17 + + + 986, 17 + + + 1214, 17 + + + 1434, 17 + + + 530, 17 + 268, 17 diff --git a/ReClass.NET/Forms/NamedAddressesForm.Designer.cs b/ReClass.NET/Forms/NamedAddressesForm.Designer.cs new file mode 100644 index 00000000..a6a8a6e3 --- /dev/null +++ b/ReClass.NET/Forms/NamedAddressesForm.Designer.cs @@ -0,0 +1,140 @@ +using ReClassNET.Controls; + +namespace ReClassNET.Forms +{ + partial class NamedAddressesForm + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.bannerBox = new BannerBox(); + this.addressTextBox = new PlaceholderTextBox(); + this.nameTextBox = new PlaceholderTextBox(); + this.namedAddressesListBox = new System.Windows.Forms.ListBox(); + this.removeAddressIconButton = new IconButton(); + this.addAddressIconButton = new IconButton(); + ((System.ComponentModel.ISupportInitialize)(this.bannerBox)).BeginInit(); + this.SuspendLayout(); + // + // bannerBox + // + this.bannerBox.Dock = System.Windows.Forms.DockStyle.Top; + this.bannerBox.Icon = global::ReClassNET.Properties.Resources.B16x16_Custom_Type; + this.bannerBox.Location = new System.Drawing.Point(0, 0); + this.bannerBox.Name = "bannerBox"; + this.bannerBox.Size = new System.Drawing.Size(429, 48); + this.bannerBox.TabIndex = 10; + this.bannerBox.Text = "Give special memory addresses meaningfull names."; + this.bannerBox.Title = "Named Addresses"; + // + // addressTextBox + // + this.addressTextBox.Location = new System.Drawing.Point(13, 55); + this.addressTextBox.Name = "addressTextBox"; + this.addressTextBox.PlaceholderText = "Address"; + this.addressTextBox.Size = new System.Drawing.Size(154, 20); + this.addressTextBox.TabIndex = 1; + this.addressTextBox.TextChanged += new System.EventHandler(this.InputTextBox_TextChanged); + // + // nameTextBox + // + this.nameTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.nameTextBox.Location = new System.Drawing.Point(173, 55); + this.nameTextBox.Name = "nameTextBox"; + this.nameTextBox.PlaceholderText = "Name"; + this.nameTextBox.Size = new System.Drawing.Size(190, 20); + this.nameTextBox.TabIndex = 2; + this.nameTextBox.TextChanged += new System.EventHandler(this.InputTextBox_TextChanged); + // + // namedAddressesListBox + // + this.namedAddressesListBox.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.namedAddressesListBox.FormattingEnabled = true; + this.namedAddressesListBox.Location = new System.Drawing.Point(13, 81); + this.namedAddressesListBox.Name = "namedAddressesListBox"; + this.namedAddressesListBox.Size = new System.Drawing.Size(404, 186); + this.namedAddressesListBox.TabIndex = 0; + this.namedAddressesListBox.SelectedIndexChanged += new System.EventHandler(this.namedAddressesListBox_SelectedIndexChanged); + // + // removeAddressIconButton + // + this.removeAddressIconButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.removeAddressIconButton.Enabled = false; + this.removeAddressIconButton.Image = global::ReClassNET.Properties.Resources.B16x16_Button_Remove; + this.removeAddressIconButton.Location = new System.Drawing.Point(394, 54); + this.removeAddressIconButton.Name = "removeAddressIconButton"; + this.removeAddressIconButton.Pressed = false; + this.removeAddressIconButton.Selected = false; + this.removeAddressIconButton.Size = new System.Drawing.Size(23, 22); + this.removeAddressIconButton.TabIndex = 4; + this.removeAddressIconButton.Click += new System.EventHandler(this.removeAddressIconButton_Click); + // + // addAddressIconButton + // + this.addAddressIconButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.addAddressIconButton.Enabled = false; + this.addAddressIconButton.Image = global::ReClassNET.Properties.Resources.B16x16_Button_Add; + this.addAddressIconButton.Location = new System.Drawing.Point(369, 54); + this.addAddressIconButton.Name = "addAddressIconButton"; + this.addAddressIconButton.Pressed = false; + this.addAddressIconButton.Selected = false; + this.addAddressIconButton.Size = new System.Drawing.Size(23, 22); + this.addAddressIconButton.TabIndex = 3; + this.addAddressIconButton.Click += new System.EventHandler(this.addAddressIconButton_Click); + // + // NamedAddressesForm + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(429, 279); + this.Controls.Add(this.addAddressIconButton); + this.Controls.Add(this.removeAddressIconButton); + this.Controls.Add(this.namedAddressesListBox); + this.Controls.Add(this.nameTextBox); + this.Controls.Add(this.addressTextBox); + this.Controls.Add(this.bannerBox); + this.MinimumSize = new System.Drawing.Size(445, 317); + this.Name = "NamedAddressesForm"; + this.Text = "ReClass.NET - Named Addresses"; + ((System.ComponentModel.ISupportInitialize)(this.bannerBox)).EndInit(); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private BannerBox bannerBox; + private PlaceholderTextBox addressTextBox; + private PlaceholderTextBox nameTextBox; + private System.Windows.Forms.ListBox namedAddressesListBox; + private IconButton removeAddressIconButton; + private IconButton addAddressIconButton; + } +} \ No newline at end of file diff --git a/ReClass.NET/Forms/NamedAddressesForm.cs b/ReClass.NET/Forms/NamedAddressesForm.cs new file mode 100644 index 00000000..ffdc8011 --- /dev/null +++ b/ReClass.NET/Forms/NamedAddressesForm.cs @@ -0,0 +1,106 @@ +using System; +using System.Collections.Generic; +using System.Diagnostics.Contracts; +using System.Linq; +using System.Windows.Forms; +using ReClassNET.Extensions; +using ReClassNET.Memory; +using ReClassNET.UI; + +namespace ReClassNET.Forms +{ + public partial class NamedAddressesForm : IconForm + { + private readonly RemoteProcess process; + + public NamedAddressesForm(RemoteProcess process) + { + Contract.Requires(process != null); + + this.process = process; + + InitializeComponent(); + + DisplayNamedAddresses(); + } + + protected override void OnLoad(EventArgs e) + { + base.OnLoad(e); + + GlobalWindowManager.AddWindow(this); + } + + protected override void OnFormClosed(FormClosedEventArgs e) + { + base.OnFormClosed(e); + + GlobalWindowManager.RemoveWindow(this); + } + + #region Event Handler + + private void InputTextBox_TextChanged(object sender, EventArgs e) + { + addAddressIconButton.Enabled = IsValidInput(); + } + + private void namedAddressesListBox_SelectedIndexChanged(object sender, EventArgs e) + { + removeAddressIconButton.Enabled = namedAddressesListBox.SelectedIndex != -1; + } + + private void addAddressIconButton_Click(object sender, EventArgs e) + { + if (!IsValidInput()) + { + return; + } + + var address = process.ParseAddress(addressTextBox.Text.Trim()); + var name = nameTextBox.Text.Trim(); + + process.NamedAddresses[address] = name; + + addressTextBox.Text = nameTextBox.Text = null; + + DisplayNamedAddresses(); + } + + private void removeAddressIconButton_Click(object sender, EventArgs e) + { + if (namedAddressesListBox.SelectedItem is BindingDisplayWrapper> namedAddress) + { + process.NamedAddresses.Remove(namedAddress.Value.Key); + + DisplayNamedAddresses(); + } + } + + #endregion + + private void DisplayNamedAddresses() + { + namedAddressesListBox.DataSource = process.NamedAddresses + .Select(kv => new BindingDisplayWrapper>(kv, v => $"0x{v.Key.ToString(Constants.AddressHexFormat)}: {v.Value}")) + .ToList(); + + namedAddressesListBox_SelectedIndexChanged(null, null); + } + + private bool IsValidInput() + { + try + { + var address = process.ParseAddress(addressTextBox.Text.Trim()); + var name = nameTextBox.Text.Trim(); + + return !address.IsNull() && !string.IsNullOrEmpty(name); + } + catch + { + return false; + } + } + } +} diff --git a/ReClass.NET/Forms/NamedAddressesForm.resx b/ReClass.NET/Forms/NamedAddressesForm.resx new file mode 100644 index 00000000..1af7de15 --- /dev/null +++ b/ReClass.NET/Forms/NamedAddressesForm.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/ReClass.NET/Forms/PluginForm.Designer.cs b/ReClass.NET/Forms/PluginForm.Designer.cs index 62389847..c1df5042 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 { @@ -33,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 ReClassNET.UI.BannerBox(); - this.label2 = new System.Windows.Forms.Label(); + 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(); @@ -117,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); @@ -167,6 +132,15 @@ private void InitializeComponent() this.nativesTabPage.Text = "Native Helper"; this.nativesTabPage.UseVisualStyleBackColor = true; // + // label2 + // + this.label2.AutoSize = true; + this.label2.Location = new System.Drawing.Point(6, 66); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(98, 13); + this.label2.TabIndex = 21; + this.label2.Text = "Functions Provider:"; + // // functionsProvidersComboBox // this.functionsProvidersComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; @@ -222,14 +196,43 @@ private void InitializeComponent() this.bannerBox.Text = "Here you can configure all loaded ReClass.NET plugins."; this.bannerBox.Title = "Plugins"; // - // label2 + // iconColumn // - this.label2.AutoSize = true; - this.label2.Location = new System.Drawing.Point(6, 66); - this.label2.Name = "label2"; - this.label2.Size = new System.Drawing.Size(98, 13); - this.label2.TabIndex = 21; - this.label2.Text = "Functions Provider:"; + 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 // @@ -242,6 +245,8 @@ private void InitializeComponent() this.Controls.Add(this.getMoreLinkLabel); this.Controls.Add(this.tabControl); this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; + this.MaximizeBox = false; + this.MinimizeBox = false; this.Name = "PluginForm"; this.ShowInTaskbar = false; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; @@ -269,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 UI.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 2711cd67..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; @@ -45,7 +45,9 @@ internal PluginForm(PluginManager pluginManager) // Native Methods Tab - functionsProvidersComboBox.Items.AddRange(Program.CoreFunctions.FunctionProviders.ToArray()); + var providers = Program.CoreFunctions.FunctionProviders.ToArray(); + functionsProvidersComboBox.Items.AddRange(providers); + functionsProvidersComboBox.SelectedIndex = Array.IndexOf(providers, Program.CoreFunctions.CurrentFunctionsProvider); } protected override void OnLoad(EventArgs e) 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/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; } diff --git a/ReClass.NET/Forms/ProcessInfoForm.Designer.cs b/ReClass.NET/Forms/ProcessInfoForm.Designer.cs index c4d9e46b..90fa7959 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 ReClassNET.Controls.BannerBox(); this.tabControl = new System.Windows.Forms.TabControl(); this.modulesTabPage = new System.Windows.Forms.TabPage(); this.modulesDataGridView = new System.Windows.Forms.DataGridView(); @@ -69,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 // @@ -113,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; @@ -227,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; @@ -325,7 +328,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/ProcessInfoForm.cs b/ReClass.NET/Forms/ProcessInfoForm.cs index d405f05e..fc56d3eb 100644 --- a/ReClass.NET/Forms/ProcessInfoForm.cs +++ b/ReClass.NET/Forms/ProcessInfoForm.cs @@ -1,5 +1,7 @@ -using System; +using System; +using System.ComponentModel; using System.Data; +using System.Diagnostics.Contracts; using System.Drawing; using System.IO; using System.Linq; @@ -13,11 +15,17 @@ namespace ReClassNET.Forms { public partial class ProcessInfoForm : IconForm { + private readonly IProcessReader process; + /// The context menu of the sections grid view. public ContextMenuStrip GridContextMenu => contextMenuStrip; - public ProcessInfoForm() + public ProcessInfoForm(IProcessReader process) { + Contract.Requires(process != null); + + this.process = process; + InitializeComponent(); tabControl.ImageList = new ImageList(); @@ -54,59 +62,55 @@ protected override void OnFormClosed(FormClosedEventArgs e) private async void ProcessInfoForm_Load(object sender, EventArgs e) { - if (!Program.RemoteProcess.IsValid) - { - 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(() => { - Program.RemoteProcess.EnumerateRemoteSectionsAndModules( - delegate (Section section) + if (process.EnumerateRemoteSectionsAndModules(out var sections, out var modules)) + { + foreach (var section in sections) { - var row = sections.NewRow(); - row["address"] = section.Start.ToString(Constants.StringHexFormat); - row["size"] = section.Size.ToString(Constants.StringHexFormat); + var row = sectionsTable.NewRow(); + row["address"] = section.Start.ToString(Constants.AddressHexFormat); + row["size"] = section.Size.ToString(Constants.AddressHexFormat); row["name"] = section.Name; row["protection"] = section.Protection.ToString(); 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.StringHexFormat); - row["size"] = module.Size.ToString(Constants.StringHexFormat); + 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) @@ -126,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)); @@ -138,11 +149,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) { @@ -152,11 +160,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 = (reader, stream) => + { + Dumper.DumpModule(reader, module, stream); + + MessageBox.Show("Module successfully dumped.", Constants.ApplicationName, MessageBoxButtons.OK, MessageBoxIcon.Information); + }; } else { @@ -166,43 +181,36 @@ 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 = (reader, stream) => + { + Dumper.DumpSection(reader, section, stream); + + MessageBox.Show("Section successfully dumped.", Constants.ApplicationName, MessageBoxButtons.OK, MessageBoxIcon.Information); + }; } - using (var sfd = new SaveFileDialog()) + using var sfd = createDialogFn(); + sfd.Filter = "All|*.*"; + + if (sfd.ShowDialog() != DialogResult.OK) { - sfd.FileName = fileName; - sfd.Filter = "All|*.*"; - sfd.InitialDirectory = initialDirectory; + return; + } - if (sfd.ShowDialog() == DialogResult.OK) - { - var dumper = new Dumper(Program.RemoteProcess); + try + { + using var stream = sfd.OpenFile(); - 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) - { - Program.ShowException(ex); - } - } + dumpFn(process, stream); + } + catch (Exception ex) + { + Program.ShowException(ex); } } @@ -221,13 +229,10 @@ private IntPtr GetSelectedAddress(object sender) { return GetSelectedModule()?.Start ?? IntPtr.Zero; } - else - { - return GetSelectedSection()?.Start ?? IntPtr.Zero; - } + return GetSelectedSection()?.Start ?? IntPtr.Zero; } - private Control GetToolStripSourceControl(object sender) + private static Control GetToolStripSourceControl(object sender) { return ((sender as ToolStripMenuItem)?.GetCurrentParent() as ContextMenuStrip)?.SourceControl; } diff --git a/ReClass.NET/Forms/ScannerForm.Designer.cs b/ReClass.NET/Forms/ScannerForm.Designer.cs index a5bf45de..d6fd02ac 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,20 +31,23 @@ protected override void Dispose(bool disposing) private void InitializeComponent() { this.components = new System.ComponentModel.Container(); - this.bannerBox = new ReClassNET.UI.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 ReClassNET.UI.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(); 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(); @@ -62,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 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(); @@ -79,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 ReClassNET.Controls.MemoryRecordList(); this.toolStripPanel = new System.Windows.Forms.ToolStripPanel(); this.menuToolStrip = new System.Windows.Forms.ToolStrip(); this.openAddressFileToolStripButton = new System.Windows.Forms.ToolStripButton(); @@ -88,8 +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.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(); @@ -190,6 +196,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); @@ -197,37 +206,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; @@ -237,10 +246,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; @@ -250,14 +259,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); @@ -301,7 +344,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; // @@ -470,9 +513,9 @@ 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); + this.resultMemoryRecordList.RecordDoubleClick += new ReClassNET.Controls.MemorySearchResultControlResultDoubleClickEventHandler(this.memorySearchResultControl_ResultDoubleClick); // // resultListContextMenuStrip // @@ -524,25 +567,25 @@ private void InitializeComponent() // descriptionToolStripMenuItem // this.descriptionToolStripMenuItem.Name = "descriptionToolStripMenuItem"; - this.descriptionToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.descriptionToolStripMenuItem.Size = new System.Drawing.Size(134, 22); this.descriptionToolStripMenuItem.Text = "Description"; // // addressToolStripMenuItem // this.addressToolStripMenuItem.Name = "addressToolStripMenuItem"; - this.addressToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.addressToolStripMenuItem.Size = new System.Drawing.Size(134, 22); this.addressToolStripMenuItem.Text = "Address"; // // valueTypeToolStripMenuItem // this.valueTypeToolStripMenuItem.Name = "valueTypeToolStripMenuItem"; - this.valueTypeToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.valueTypeToolStripMenuItem.Size = new System.Drawing.Size(134, 22); this.valueTypeToolStripMenuItem.Text = "Value Type"; // // valueToolStripMenuItem // this.valueToolStripMenuItem.Name = "valueToolStripMenuItem"; - this.valueToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.valueToolStripMenuItem.Size = new System.Drawing.Size(134, 22); this.valueToolStripMenuItem.Text = "Value"; // // toolStripSeparator2 @@ -606,7 +649,7 @@ private void InitializeComponent() | 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; @@ -619,7 +662,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; @@ -692,6 +735,7 @@ private void InitializeComponent() // // undoIconButton // + this.undoIconButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.undoIconButton.Image = global::ReClassNET.Properties.Resources.B16x16_Undo; this.undoIconButton.Location = new System.Drawing.Point(256, 54); this.undoIconButton.Name = "undoIconButton"; @@ -703,8 +747,9 @@ private void InitializeComponent() // // showInputCorrelatorIconButton // + 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; @@ -712,11 +757,25 @@ private void InitializeComponent() this.showInputCorrelatorIconButton.TabIndex = 19; this.showInputCorrelatorIconButton.Click += new System.EventHandler(this.showInputCorrelatorIconButton_Click); // + // 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"; + this.cancelScanIconButton.Pressed = false; + this.cancelScanIconButton.Selected = false; + this.cancelScanIconButton.Size = new System.Drawing.Size(23, 22); + this.cancelScanIconButton.TabIndex = 21; + this.cancelScanIconButton.Visible = false; + this.cancelScanIconButton.Click += new System.EventHandler(this.cancelScanIconButton_Click); + // // ScannerForm // 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); this.Controls.Add(this.toolStripPanel); @@ -755,9 +814,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; @@ -769,6 +828,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; @@ -788,8 +850,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; @@ -814,7 +876,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 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 8289afb2..0fb4d430 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; @@ -8,7 +8,9 @@ using System.Threading; using System.Threading.Tasks; using System.Windows.Forms; +using ReClassNET.Controls; using ReClassNET.DataExchange.Scanner; +using ReClassNET.Extensions; using ReClassNET.Logger; using ReClassNET.Memory; using ReClassNET.MemoryScanner; @@ -26,15 +28,21 @@ internal class ScanValueTypeComboBox : EnumComboBox { } private const int MaxVisibleResults = 10000; + private readonly RemoteProcess process; + private bool isFirstScan; private Scanner scanner; - + private CancellationTokenSource cts; private string addressFilePath; - public ScannerForm() + public ScannerForm(RemoteProcess process) { + Contract.Requires(process != null); + + this.process = process; + InitializeComponent(); toolStripPanel.Renderer = new CustomToolStripProfessionalRenderer(true, false); @@ -46,10 +54,10 @@ public ScannerForm() Reset(); - firstScanButton.Enabled = flowLayoutPanel.Enabled = Program.RemoteProcess.IsValid; + firstScanButton.Enabled = flowLayoutPanel.Enabled = process.IsValid; - Program.RemoteProcess.ProcessAttached += RemoteProcessOnProcessAttached; - Program.RemoteProcess.ProcessClosing += RemoteProcessOnProcessClosing; + process.ProcessAttached += RemoteProcessOnProcessAttached; + process.ProcessClosing += RemoteProcessOnProcessClosing; } protected override void OnLoad(EventArgs e) @@ -84,8 +92,8 @@ private void RemoteProcessOnProcessAttached(RemoteProcess remoteProcess) { foreach (var record in addressListMemoryRecordList.Records) { - record.ResolveAddress(Program.RemoteProcess); - record.RefreshValue(Program.RemoteProcess); + record.ResolveAddress(process); + record.RefreshValue(process); } } } @@ -102,14 +110,14 @@ private void MemorySearchForm_FormClosing(object sender, FormClosingEventArgs e) { scanner?.Dispose(); - Program.RemoteProcess.ProcessAttached -= RemoteProcessOnProcessAttached; - Program.RemoteProcess.ProcessClosing -= RemoteProcessOnProcessClosing; + process.ProcessAttached -= RemoteProcessOnProcessAttached; + process.ProcessClosing -= RemoteProcessOnProcessClosing; } private void updateValuesTimer_Tick(object sender, EventArgs e) { - resultMemoryRecordList.RefreshValues(Program.RemoteProcess); - addressListMemoryRecordList.RefreshValues(Program.RemoteProcess); + resultMemoryRecordList.RefreshValues(process); + addressListMemoryRecordList.RefreshValues(process); } private void scanTypeComboBox_SelectionChangeCommitted(object sender, EventArgs e) @@ -146,7 +154,7 @@ private async void firstScanButton_Click(object sender, EventArgs e) private async void nextScanButton_Click(object sender, EventArgs e) { - if (!Program.RemoteProcess.IsValid) + if (!process.IsValid) { return; } @@ -155,6 +163,7 @@ private async void nextScanButton_Click(object sender, EventArgs e) { firstScanButton.Enabled = false; nextScanButton.Enabled = false; + cancelScanIconButton.Visible = true; try { @@ -165,14 +174,13 @@ private async void nextScanButton_Click(object sender, EventArgs e) scanProgressBar.Value = i; SetResultCount(scanner.TotalResultCount); }); - var completed = await scanner.Search(comparer, CancellationToken.None, report); + cts = new CancellationTokenSource(); - if (completed) - { - ShowScannerResults(scanner); + await scanner.Search(comparer, report, cts.Token); - undoIconButton.Enabled = scanner.CanUndoLastScan; - } + ShowScannerResults(scanner); + + undoIconButton.Enabled = scanner.CanUndoLastScan; } catch (Exception ex) { @@ -181,11 +189,17 @@ private async void nextScanButton_Click(object sender, EventArgs e) firstScanButton.Enabled = true; nextScanButton.Enabled = true; + cancelScanIconButton.Visible = false; scanProgressBar.Value = 0; } } + private void cancelScanIconButton_Click(object sender, EventArgs e) + { + cts?.Cancel(); + } + private void memorySearchResultControl_ResultDoubleClick(object sender, MemoryRecord record) { addressListMemoryRecordList.Records.Add(record); @@ -193,58 +207,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 + { + 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) { - 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}"; + 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) + { + return; + } - if (ofd.ShowDialog() == DialogResult.OK) + if (addressListMemoryRecordList.Records.Any()) { - IScannerImport import = null; - switch (Path.GetExtension(ofd.FileName)?.ToLower()) + 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(Program.RemoteProcess); - r.RefreshValue(Program.RemoteProcess); - 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; + }) + ); } } @@ -273,17 +289,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); } } @@ -294,7 +310,7 @@ private void clearAddressListToolStripButton_Click(object sender, EventArgs e) private void showInputCorrelatorIconButton_Click(object sender, EventArgs e) { - new InputCorrelatorForm(this).Show(); + new InputCorrelatorForm(this, process).Show(); } private void resultListContextMenuStrip_Opening(object sender, CancelEventArgs e) @@ -408,7 +424,7 @@ public void ShowScannerResults(Scanner scanner) .Select(r => { var record = new MemoryRecord(r); - record.ResolveAddress(Program.RemoteProcess); + record.ResolveAddress(process); return record; }) ); @@ -441,6 +457,7 @@ private void OnCompareTypeChanged() case ScanValueType.Double: case ScanValueType.ArrayOfBytes: case ScanValueType.String: + case ScanValueType.Regex: isHexCheckBox.Checked = false; enableHexCheckBox = false; break; @@ -472,6 +489,7 @@ private void OnValueTypeChanged() case ScanValueType.Double: case ScanValueType.ArrayOfBytes: case ScanValueType.String: + case ScanValueType.Regex: isHexCheckBox.Checked = false; isHexCheckBox.Enabled = false; break; @@ -493,7 +511,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; } /// @@ -503,7 +521,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); } @@ -539,7 +557,7 @@ private void Reset() nextScanButton.Enabled = false; isHexCheckBox.Enabled = true; - isHexCheckBox.Checked = false; + //isHexCheckBox.Checked = false; valueTypeComboBox.Enabled = true; //valueTypeComboBox.SelectedItem = valueTypeComboBox.Items.Cast>().PredicateOrFirst(e => e.Value == ScanValueType.Integer); @@ -579,40 +597,41 @@ public void ExcuteScan(ScanSettings settings, IScanComparer comparer) /// The comparer. private async Task StartFirstScanEx(ScanSettings settings, IScanComparer comparer) { - if (!Program.RemoteProcess.IsValid) + if (!process.IsValid) { return; } firstScanButton.Enabled = false; + cancelScanIconButton.Visible = true; try { - scanner = new Scanner(Program.RemoteProcess, settings); + scanner = new Scanner(process, settings); var report = new Progress(i => { scanProgressBar.Value = i; SetResultCount(scanner.TotalResultCount); }); - var completed = await scanner.Search(comparer, CancellationToken.None, report); + cts = new CancellationTokenSource(); - if (completed) - { - ShowScannerResults(scanner); + await scanner.Search(comparer, report, cts.Token); + + ShowScannerResults(scanner); - nextScanButton.Enabled = true; - valueTypeComboBox.Enabled = false; + cancelScanIconButton.Visible = false; + nextScanButton.Enabled = true; + valueTypeComboBox.Enabled = false; - floatingOptionsGroupBox.Enabled = false; - stringOptionsGroupBox.Enabled = false; - scanOptionsGroupBox.Enabled = false; + floatingOptionsGroupBox.Enabled = false; + stringOptionsGroupBox.Enabled = false; + scanOptionsGroupBox.Enabled = false; - isFirstScan = false; + isFirstScan = false; - SetValidCompareTypes(); - OnCompareTypeChanged(); - } + SetValidCompareTypes(); + OnCompareTypeChanged(); } finally { @@ -638,8 +657,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); @@ -648,7 +667,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) { @@ -661,6 +680,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); @@ -678,13 +700,13 @@ private void SetGuiFromSettings(ScanSettings settings) valueTypeComboBox.SelectedValue = settings.ValueType; - startAddressTextBox.Text = settings.StartAddress.ToString(Constants.StringHexFormat); - stopAddressTextBox.Text = settings.StopAddress.ToString(Constants.StringHexFormat); + startAddressTextBox.Text = settings.StartAddress.ToString(Constants.AddressHexFormat); + stopAddressTextBox.Text = settings.StopAddress.ToString(Constants.AddressHexFormat); fastScanCheckBox.Checked = settings.EnableFastScan; fastScanAlignmentTextBox.Text = Math.Max(1, settings.FastScanAlignment).ToString(); - - CheckState SettingStateToCheckState(SettingState state) + + static CheckState SettingStateToCheckState(SettingState state) { switch (state) { @@ -697,6 +719,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); @@ -720,16 +745,24 @@ 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: 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) @@ -750,11 +783,19 @@ 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); + 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) @@ -765,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) @@ -776,7 +817,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)) { @@ -784,8 +825,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(); @@ -820,6 +867,7 @@ private static void FindWhatInteractsWithSelectedRecord(MemoryRecord record, boo size = record.ValueLength; break; case ScanValueType.String: + case ScanValueType.Regex: size = record.ValueLength; break; default: @@ -835,7 +883,7 @@ internal class InvalidInputException : Exception public InvalidInputException(string input) : base($"'{input}' is not a valid input.") { - + } } } diff --git a/ReClass.NET/Forms/SettingsForm.Designer.cs b/ReClass.NET/Forms/SettingsForm.Designer.cs index efefb7c1..82e4efd9 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 { @@ -28,1094 +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 ReClassNET.UI.SettingsCheckBox(); - this.showStringCheckBox = new ReClassNET.UI.SettingsCheckBox(); - this.showSymbolsCheckBox = new ReClassNET.UI.SettingsCheckBox(); - this.showRttiCheckBox = new ReClassNET.UI.SettingsCheckBox(); - this.showPointerCheckBox = new ReClassNET.UI.SettingsCheckBox(); - this.showIntegerCheckBox = new ReClassNET.UI.SettingsCheckBox(); - this.showFloatCheckBox = new ReClassNET.UI.SettingsCheckBox(); - this.displayGroupBox = new System.Windows.Forms.GroupBox(); - this.highlightChangedValuesCheckBox = new ReClassNET.UI.SettingsCheckBox(); - this.showTextCheckBox = new ReClassNET.UI.SettingsCheckBox(); - this.showNodeOffsetCheckBox = new ReClassNET.UI.SettingsCheckBox(); - this.showNodeAddressCheckBox = new ReClassNET.UI.SettingsCheckBox(); - this.stayOnTopCheckBox = new ReClassNET.UI.SettingsCheckBox(); - 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.UI.ColorBox(); - this.nodePluginColorBox = new ReClassNET.UI.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.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.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.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.nodeSelectedLabel = new System.Windows.Forms.Label(); - this.nodeTypeColorBox = new ReClassNET.UI.ColorBox(); - this.nodeValueColorBox = new ReClassNET.UI.ColorBox(); - this.nodeTypeLabel = new System.Windows.Forms.Label(); - this.nodeNameLabel = new System.Windows.Forms.Label(); - this.nodeNameColorBox = new ReClassNET.UI.ColorBox(); - this.backgroundLabel = new System.Windows.Forms.Label(); - this.backgroundColorBox = new ReClassNET.UI.ColorBox(); - this.typeDefinitionsSettingsTabPage = new System.Windows.Forms.TabPage(); - this.boolSettingsLabel = new System.Windows.Forms.Label(); - this.boolSettingsTextBox = new ReClassNET.UI.SettingsTextBox(); - this.label1 = new System.Windows.Forms.Label(); - this.functionPtrSettingsLabel = new System.Windows.Forms.Label(); - this.functionPtrSettingsTextBox = new ReClassNET.UI.SettingsTextBox(); - this.utf16TextPtrSettingsLabel = new System.Windows.Forms.Label(); - this.utf16TextPtrSettingsTextBox = new ReClassNET.UI.SettingsTextBox(); - this.utf16TextSettingsLabel = new System.Windows.Forms.Label(); - this.utf16TextSettingsTextBox = new ReClassNET.UI.SettingsTextBox(); - this.utf8TextPtrSettingsLabel = new System.Windows.Forms.Label(); - this.utf8TextPtrSettingsTextBox = new ReClassNET.UI.SettingsTextBox(); - this.utf8TextSettingsLabel = new System.Windows.Forms.Label(); - this.utf8TextSettingsTextBox = new ReClassNET.UI.SettingsTextBox(); - this.matrix3x3SettingsLabel = new System.Windows.Forms.Label(); - this.matrix3x3SettingsTextBox = new ReClassNET.UI.SettingsTextBox(); - this.matrix3x4SettingsLabel = new System.Windows.Forms.Label(); - this.matrix3x4SettingsTextBox = new ReClassNET.UI.SettingsTextBox(); - this.matrix4x4SettingsLabel = new System.Windows.Forms.Label(); - this.matrix4x4SettingsTextBox = new ReClassNET.UI.SettingsTextBox(); - this.vector2SettingsLabel = new System.Windows.Forms.Label(); - this.vector2SettingsTextBox = new ReClassNET.UI.SettingsTextBox(); - this.vector3SettingsLabel = new System.Windows.Forms.Label(); - this.vector3SettingsTextBox = new ReClassNET.UI.SettingsTextBox(); - this.vector4SettingsLabel = new System.Windows.Forms.Label(); - this.vector4SettingsTextBox = new ReClassNET.UI.SettingsTextBox(); - this.doubleSettingsLabel = new System.Windows.Forms.Label(); - this.doubleSettingsTextBox = new ReClassNET.UI.SettingsTextBox(); - this.floatSettingsLabel = new System.Windows.Forms.Label(); - this.floatSettingsTextBox = new ReClassNET.UI.SettingsTextBox(); - this.uint64SettingsLabel = new System.Windows.Forms.Label(); - this.uint64SettingsTextBox = new ReClassNET.UI.SettingsTextBox(); - this.uint32SettingsLabel = new System.Windows.Forms.Label(); - this.uint32SettingsTextBox = new ReClassNET.UI.SettingsTextBox(); - this.uint16SettingsLabel = new System.Windows.Forms.Label(); - this.uint16SettingsTextBox = new ReClassNET.UI.SettingsTextBox(); - this.uint8SettingsLabel = new System.Windows.Forms.Label(); - this.uint8SettingsTextBox = new ReClassNET.UI.SettingsTextBox(); - this.int64SettingsLabel = new System.Windows.Forms.Label(); - this.int64SettingsTextBox = new ReClassNET.UI.SettingsTextBox(); - this.int32SettingsLabel = new System.Windows.Forms.Label(); - this.int32SettingsTextBox = new ReClassNET.UI.SettingsTextBox(); - this.int16SettingsLabel = new System.Windows.Forms.Label(); - this.int16SettingsTextBox = new ReClassNET.UI.SettingsTextBox(); - this.int8SettingsLabel = new System.Windows.Forms.Label(); - this.int8SettingsTextBox = new ReClassNET.UI.SettingsTextBox(); - this.paddingSettingsLabel = new System.Windows.Forms.Label(); - this.paddingSettingsTextBox = new ReClassNET.UI.SettingsTextBox(); - this.bannerBox = new ReClassNET.UI.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.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.TabIndex = 2; - this.displayGroupBox.TabStop = false; - this.displayGroupBox.Text = "Display"; - // - // 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.boolSettingsTextBox); - this.typeDefinitionsSettingsTabPage.Controls.Add(this.label1); - this.typeDefinitionsSettingsTabPage.Controls.Add(this.functionPtrSettingsLabel); - this.typeDefinitionsSettingsTabPage.Controls.Add(this.functionPtrSettingsTextBox); - this.typeDefinitionsSettingsTabPage.Controls.Add(this.utf16TextPtrSettingsLabel); - this.typeDefinitionsSettingsTabPage.Controls.Add(this.utf16TextPtrSettingsTextBox); - this.typeDefinitionsSettingsTabPage.Controls.Add(this.utf16TextSettingsLabel); - this.typeDefinitionsSettingsTabPage.Controls.Add(this.utf16TextSettingsTextBox); - this.typeDefinitionsSettingsTabPage.Controls.Add(this.utf8TextPtrSettingsLabel); - this.typeDefinitionsSettingsTabPage.Controls.Add(this.utf8TextPtrSettingsTextBox); - this.typeDefinitionsSettingsTabPage.Controls.Add(this.utf8TextSettingsLabel); - this.typeDefinitionsSettingsTabPage.Controls.Add(this.utf8TextSettingsTextBox); - this.typeDefinitionsSettingsTabPage.Controls.Add(this.matrix3x3SettingsLabel); - this.typeDefinitionsSettingsTabPage.Controls.Add(this.matrix3x3SettingsTextBox); - this.typeDefinitionsSettingsTabPage.Controls.Add(this.matrix3x4SettingsLabel); - this.typeDefinitionsSettingsTabPage.Controls.Add(this.matrix3x4SettingsTextBox); - this.typeDefinitionsSettingsTabPage.Controls.Add(this.matrix4x4SettingsLabel); - this.typeDefinitionsSettingsTabPage.Controls.Add(this.matrix4x4SettingsTextBox); - this.typeDefinitionsSettingsTabPage.Controls.Add(this.vector2SettingsLabel); - this.typeDefinitionsSettingsTabPage.Controls.Add(this.vector2SettingsTextBox); - this.typeDefinitionsSettingsTabPage.Controls.Add(this.vector3SettingsLabel); - this.typeDefinitionsSettingsTabPage.Controls.Add(this.vector3SettingsTextBox); - this.typeDefinitionsSettingsTabPage.Controls.Add(this.vector4SettingsLabel); - this.typeDefinitionsSettingsTabPage.Controls.Add(this.vector4SettingsTextBox); - this.typeDefinitionsSettingsTabPage.Controls.Add(this.doubleSettingsLabel); - this.typeDefinitionsSettingsTabPage.Controls.Add(this.doubleSettingsTextBox); - this.typeDefinitionsSettingsTabPage.Controls.Add(this.floatSettingsLabel); - this.typeDefinitionsSettingsTabPage.Controls.Add(this.floatSettingsTextBox); - this.typeDefinitionsSettingsTabPage.Controls.Add(this.uint64SettingsLabel); - this.typeDefinitionsSettingsTabPage.Controls.Add(this.uint64SettingsTextBox); - this.typeDefinitionsSettingsTabPage.Controls.Add(this.uint32SettingsLabel); - this.typeDefinitionsSettingsTabPage.Controls.Add(this.uint32SettingsTextBox); - this.typeDefinitionsSettingsTabPage.Controls.Add(this.uint16SettingsLabel); - this.typeDefinitionsSettingsTabPage.Controls.Add(this.uint16SettingsTextBox); - this.typeDefinitionsSettingsTabPage.Controls.Add(this.uint8SettingsLabel); - this.typeDefinitionsSettingsTabPage.Controls.Add(this.uint8SettingsTextBox); - this.typeDefinitionsSettingsTabPage.Controls.Add(this.int64SettingsLabel); - this.typeDefinitionsSettingsTabPage.Controls.Add(this.int64SettingsTextBox); - this.typeDefinitionsSettingsTabPage.Controls.Add(this.int32SettingsLabel); - this.typeDefinitionsSettingsTabPage.Controls.Add(this.int32SettingsTextBox); - this.typeDefinitionsSettingsTabPage.Controls.Add(this.int16SettingsLabel); - this.typeDefinitionsSettingsTabPage.Controls.Add(this.int16SettingsTextBox); - this.typeDefinitionsSettingsTabPage.Controls.Add(this.int8SettingsLabel); - this.typeDefinitionsSettingsTabPage.Controls.Add(this.int8SettingsTextBox); - this.typeDefinitionsSettingsTabPage.Controls.Add(this.paddingSettingsLabel); - this.typeDefinitionsSettingsTabPage.Controls.Add(this.paddingSettingsTextBox); - 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(6, 57); - this.boolSettingsLabel.Name = "boolSettingsLabel"; - this.boolSettingsLabel.Size = new System.Drawing.Size(31, 13); - this.boolSettingsLabel.TabIndex = 46; - this.boolSettingsLabel.Text = "Bool:"; - // - // boolSettingsTextBox - // - this.boolSettingsTextBox.Location = new System.Drawing.Point(98, 54); - this.boolSettingsTextBox.Name = "boolSettingsTextBox"; - this.boolSettingsTextBox.Size = new System.Drawing.Size(120, 20); - this.boolSettingsTextBox.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, 277); - this.functionPtrSettingsLabel.Name = "functionPtrSettingsLabel"; - this.functionPtrSettingsLabel.Size = new System.Drawing.Size(87, 13); - this.functionPtrSettingsLabel.TabIndex = 43; - this.functionPtrSettingsLabel.Text = "Function Pointer:"; - // - // functionPtrSettingsTextBox - // - this.functionPtrSettingsTextBox.Location = new System.Drawing.Point(346, 274); - this.functionPtrSettingsTextBox.Name = "functionPtrSettingsTextBox"; - this.functionPtrSettingsTextBox.Size = new System.Drawing.Size(120, 20); - this.functionPtrSettingsTextBox.TabIndex = 42; - // - // utf16TextPtrSettingsLabel - // - this.utf16TextPtrSettingsLabel.AutoSize = true; - this.utf16TextPtrSettingsLabel.Location = new System.Drawing.Point(254, 255); - this.utf16TextPtrSettingsLabel.Name = "utf16TextPtrSettingsLabel"; - this.utf16TextPtrSettingsLabel.Size = new System.Drawing.Size(79, 13); - this.utf16TextPtrSettingsLabel.TabIndex = 41; - this.utf16TextPtrSettingsLabel.Text = "UTF16 Pointer:"; - // - // utf16TextPtrSettingsTextBox - // - this.utf16TextPtrSettingsTextBox.Location = new System.Drawing.Point(346, 252); - this.utf16TextPtrSettingsTextBox.Name = "utf16TextPtrSettingsTextBox"; - this.utf16TextPtrSettingsTextBox.Size = new System.Drawing.Size(120, 20); - this.utf16TextPtrSettingsTextBox.TabIndex = 40; - // - // utf16TextSettingsLabel - // - this.utf16TextSettingsLabel.AutoSize = true; - this.utf16TextSettingsLabel.Location = new System.Drawing.Point(254, 233); - this.utf16TextSettingsLabel.Name = "utf16TextSettingsLabel"; - this.utf16TextSettingsLabel.Size = new System.Drawing.Size(43, 13); - this.utf16TextSettingsLabel.TabIndex = 39; - this.utf16TextSettingsLabel.Text = "UTF16:"; - // - // utf16TextSettingsTextBox - // - this.utf16TextSettingsTextBox.Location = new System.Drawing.Point(346, 230); - this.utf16TextSettingsTextBox.Name = "utf16TextSettingsTextBox"; - this.utf16TextSettingsTextBox.Size = new System.Drawing.Size(120, 20); - this.utf16TextSettingsTextBox.TabIndex = 38; - // - // utf8TextPtrSettingsLabel - // - this.utf8TextPtrSettingsLabel.AutoSize = true; - this.utf8TextPtrSettingsLabel.Location = new System.Drawing.Point(254, 211); - this.utf8TextPtrSettingsLabel.Name = "utf8TextPtrSettingsLabel"; - this.utf8TextPtrSettingsLabel.Size = new System.Drawing.Size(73, 13); - this.utf8TextPtrSettingsLabel.TabIndex = 37; - this.utf8TextPtrSettingsLabel.Text = "UTF8 Pointer:"; - // - // utf8TextPtrSettingsTextBox - // - this.utf8TextPtrSettingsTextBox.Location = new System.Drawing.Point(346, 208); - this.utf8TextPtrSettingsTextBox.Name = "utf8TextPtrSettingsTextBox"; - this.utf8TextPtrSettingsTextBox.Size = new System.Drawing.Size(120, 20); - this.utf8TextPtrSettingsTextBox.TabIndex = 36; - // - // 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:"; - // - // utf8TextSettingsTextBox - // - this.utf8TextSettingsTextBox.Location = new System.Drawing.Point(346, 186); - this.utf8TextSettingsTextBox.Name = "utf8TextSettingsTextBox"; - this.utf8TextSettingsTextBox.Size = new System.Drawing.Size(120, 20); - this.utf8TextSettingsTextBox.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):"; - // - // matrix3x3SettingsTextBox - // - this.matrix3x3SettingsTextBox.Location = new System.Drawing.Point(346, 120); - this.matrix3x3SettingsTextBox.Name = "matrix3x3SettingsTextBox"; - this.matrix3x3SettingsTextBox.Size = new System.Drawing.Size(120, 20); - this.matrix3x3SettingsTextBox.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):"; - // - // matrix3x4SettingsTextBox - // - this.matrix3x4SettingsTextBox.Location = new System.Drawing.Point(346, 142); - this.matrix3x4SettingsTextBox.Name = "matrix3x4SettingsTextBox"; - this.matrix3x4SettingsTextBox.Size = new System.Drawing.Size(120, 20); - this.matrix3x4SettingsTextBox.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):"; - // - // matrix4x4SettingsTextBox - // - this.matrix4x4SettingsTextBox.Location = new System.Drawing.Point(346, 164); - this.matrix4x4SettingsTextBox.Name = "matrix4x4SettingsTextBox"; - this.matrix4x4SettingsTextBox.Size = new System.Drawing.Size(120, 20); - this.matrix4x4SettingsTextBox.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:"; - // - // vector2SettingsTextBox - // - this.vector2SettingsTextBox.Location = new System.Drawing.Point(346, 54); - this.vector2SettingsTextBox.Name = "vector2SettingsTextBox"; - this.vector2SettingsTextBox.Size = new System.Drawing.Size(120, 20); - this.vector2SettingsTextBox.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:"; - // - // vector3SettingsTextBox - // - this.vector3SettingsTextBox.Location = new System.Drawing.Point(346, 76); - this.vector3SettingsTextBox.Name = "vector3SettingsTextBox"; - this.vector3SettingsTextBox.Size = new System.Drawing.Size(120, 20); - this.vector3SettingsTextBox.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:"; - // - // vector4SettingsTextBox - // - this.vector4SettingsTextBox.Location = new System.Drawing.Point(346, 98); - this.vector4SettingsTextBox.Name = "vector4SettingsTextBox"; - this.vector4SettingsTextBox.Size = new System.Drawing.Size(120, 20); - this.vector4SettingsTextBox.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:"; - // - // doubleSettingsTextBox - // - this.doubleSettingsTextBox.Location = new System.Drawing.Point(98, 274); - this.doubleSettingsTextBox.Name = "doubleSettingsTextBox"; - this.doubleSettingsTextBox.Size = new System.Drawing.Size(120, 20); - this.doubleSettingsTextBox.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:"; - // - // floatSettingsTextBox - // - this.floatSettingsTextBox.Location = new System.Drawing.Point(98, 252); - this.floatSettingsTextBox.Name = "floatSettingsTextBox"; - this.floatSettingsTextBox.Size = new System.Drawing.Size(120, 20); - this.floatSettingsTextBox.TabIndex = 18; - // - // uint64SettingsLabel - // - this.uint64SettingsLabel.AutoSize = true; - this.uint64SettingsLabel.Location = new System.Drawing.Point(6, 233); - this.uint64SettingsLabel.Name = "uint64SettingsLabel"; - this.uint64SettingsLabel.Size = new System.Drawing.Size(42, 13); - this.uint64SettingsLabel.TabIndex = 17; - this.uint64SettingsLabel.Text = "UInt64:"; - // - // uint64SettingsTextBox - // - this.uint64SettingsTextBox.Location = new System.Drawing.Point(98, 230); - this.uint64SettingsTextBox.Name = "uint64SettingsTextBox"; - this.uint64SettingsTextBox.Size = new System.Drawing.Size(120, 20); - this.uint64SettingsTextBox.TabIndex = 16; - // - // uint32SettingsLabel - // - this.uint32SettingsLabel.AutoSize = true; - this.uint32SettingsLabel.Location = new System.Drawing.Point(6, 211); - this.uint32SettingsLabel.Name = "uint32SettingsLabel"; - this.uint32SettingsLabel.Size = new System.Drawing.Size(42, 13); - this.uint32SettingsLabel.TabIndex = 15; - this.uint32SettingsLabel.Text = "UInt32:"; - // - // uint32SettingsTextBox - // - this.uint32SettingsTextBox.Location = new System.Drawing.Point(98, 208); - this.uint32SettingsTextBox.Name = "uint32SettingsTextBox"; - this.uint32SettingsTextBox.Size = new System.Drawing.Size(120, 20); - this.uint32SettingsTextBox.TabIndex = 14; - // - // uint16SettingsLabel - // - this.uint16SettingsLabel.AutoSize = true; - this.uint16SettingsLabel.Location = new System.Drawing.Point(6, 189); - this.uint16SettingsLabel.Name = "uint16SettingsLabel"; - this.uint16SettingsLabel.Size = new System.Drawing.Size(42, 13); - this.uint16SettingsLabel.TabIndex = 13; - this.uint16SettingsLabel.Text = "UInt16:"; - // - // uint16SettingsTextBox - // - this.uint16SettingsTextBox.Location = new System.Drawing.Point(98, 186); - this.uint16SettingsTextBox.Name = "uint16SettingsTextBox"; - this.uint16SettingsTextBox.Size = new System.Drawing.Size(120, 20); - this.uint16SettingsTextBox.TabIndex = 12; - // - // uint8SettingsLabel - // - this.uint8SettingsLabel.AutoSize = true; - this.uint8SettingsLabel.Location = new System.Drawing.Point(6, 167); - this.uint8SettingsLabel.Name = "uint8SettingsLabel"; - this.uint8SettingsLabel.Size = new System.Drawing.Size(36, 13); - this.uint8SettingsLabel.TabIndex = 11; - this.uint8SettingsLabel.Text = "UInt8:"; - // - // uint8SettingsTextBox - // - this.uint8SettingsTextBox.Location = new System.Drawing.Point(98, 164); - this.uint8SettingsTextBox.Name = "uint8SettingsTextBox"; - this.uint8SettingsTextBox.Size = new System.Drawing.Size(120, 20); - this.uint8SettingsTextBox.TabIndex = 10; - // - // int64SettingsLabel - // - this.int64SettingsLabel.AutoSize = true; - this.int64SettingsLabel.Location = new System.Drawing.Point(6, 145); - this.int64SettingsLabel.Name = "int64SettingsLabel"; - this.int64SettingsLabel.Size = new System.Drawing.Size(34, 13); - this.int64SettingsLabel.TabIndex = 9; - this.int64SettingsLabel.Text = "Int64:"; - // - // int64SettingsTextBox - // - this.int64SettingsTextBox.Location = new System.Drawing.Point(98, 142); - this.int64SettingsTextBox.Name = "int64SettingsTextBox"; - this.int64SettingsTextBox.Size = new System.Drawing.Size(120, 20); - this.int64SettingsTextBox.TabIndex = 8; - // - // int32SettingsLabel - // - this.int32SettingsLabel.AutoSize = true; - this.int32SettingsLabel.Location = new System.Drawing.Point(6, 123); - this.int32SettingsLabel.Name = "int32SettingsLabel"; - this.int32SettingsLabel.Size = new System.Drawing.Size(34, 13); - this.int32SettingsLabel.TabIndex = 7; - this.int32SettingsLabel.Text = "Int32:"; - // - // int32SettingsTextBox - // - this.int32SettingsTextBox.Location = new System.Drawing.Point(98, 120); - this.int32SettingsTextBox.Name = "int32SettingsTextBox"; - this.int32SettingsTextBox.Size = new System.Drawing.Size(120, 20); - this.int32SettingsTextBox.TabIndex = 6; - // - // int16SettingsLabel - // - this.int16SettingsLabel.AutoSize = true; - this.int16SettingsLabel.Location = new System.Drawing.Point(6, 101); - this.int16SettingsLabel.Name = "int16SettingsLabel"; - this.int16SettingsLabel.Size = new System.Drawing.Size(34, 13); - this.int16SettingsLabel.TabIndex = 5; - this.int16SettingsLabel.Text = "Int16:"; - // - // int16SettingsTextBox - // - this.int16SettingsTextBox.Location = new System.Drawing.Point(98, 98); - this.int16SettingsTextBox.Name = "int16SettingsTextBox"; - this.int16SettingsTextBox.Size = new System.Drawing.Size(120, 20); - this.int16SettingsTextBox.TabIndex = 4; - // - // int8SettingsLabel - // - this.int8SettingsLabel.AutoSize = true; - this.int8SettingsLabel.Location = new System.Drawing.Point(6, 79); - this.int8SettingsLabel.Name = "int8SettingsLabel"; - this.int8SettingsLabel.Size = new System.Drawing.Size(28, 13); - this.int8SettingsLabel.TabIndex = 3; - this.int8SettingsLabel.Text = "Int8:"; - // - // int8SettingsTextBox - // - this.int8SettingsTextBox.Location = new System.Drawing.Point(98, 76); - this.int8SettingsTextBox.Name = "int8SettingsTextBox"; - this.int8SettingsTextBox.Size = new System.Drawing.Size(120, 20); - this.int8SettingsTextBox.TabIndex = 2; - // - // paddingSettingsLabel - // - this.paddingSettingsLabel.AutoSize = true; - this.paddingSettingsLabel.Location = new System.Drawing.Point(6, 35); - this.paddingSettingsLabel.Name = "paddingSettingsLabel"; - this.paddingSettingsLabel.Size = new System.Drawing.Size(49, 13); - this.paddingSettingsLabel.TabIndex = 1; - this.paddingSettingsLabel.Text = "Padding:"; - // - // paddingSettingsTextBox - // - this.paddingSettingsTextBox.Location = new System.Drawing.Point(98, 32); - this.paddingSettingsTextBox.Name = "paddingSettingsTextBox"; - this.paddingSettingsTextBox.Size = new System.Drawing.Size(120, 20); - this.paddingSettingsTextBox.TabIndex = 0; - // - // 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); } @@ -1124,100 +1150,102 @@ private void InitializeComponent() private System.Windows.Forms.TabPage generalSettingsTabPage; private System.Windows.Forms.TabPage colorsSettingTabPage; private System.Windows.Forms.TabPage typeDefinitionsSettingsTabPage; - private ReClassNET.UI.SettingsCheckBox stayOnTopCheckBox; + private System.Windows.Forms.CheckBox stayOnTopCheckBox; private System.Windows.Forms.GroupBox displayGroupBox; - private ReClassNET.UI.SettingsCheckBox showNodeAddressCheckBox; - private ReClassNET.UI.SettingsCheckBox showTextCheckBox; - private ReClassNET.UI.SettingsCheckBox showNodeOffsetCheckBox; - private ReClassNET.UI.SettingsCheckBox highlightChangedValuesCheckBox; + private System.Windows.Forms.CheckBox showNodeAddressCheckBox; + private System.Windows.Forms.CheckBox showTextCheckBox; + private System.Windows.Forms.CheckBox showNodeOffsetCheckBox; + private System.Windows.Forms.CheckBox highlightChangedValuesCheckBox; private System.Windows.Forms.GroupBox commentsGroupBox; - private ReClassNET.UI.SettingsCheckBox showRttiCheckBox; - private ReClassNET.UI.SettingsCheckBox showPointerCheckBox; - private ReClassNET.UI.SettingsCheckBox showIntegerCheckBox; - private ReClassNET.UI.SettingsCheckBox showFloatCheckBox; - private ReClassNET.UI.SettingsCheckBox showPluginInfoCheckBox; - private ReClassNET.UI.SettingsCheckBox showStringCheckBox; - private ReClassNET.UI.SettingsCheckBox showSymbolsCheckBox; - private UI.ColorBox backgroundColorBox; + private System.Windows.Forms.CheckBox showRttiCheckBox; + private System.Windows.Forms.CheckBox showPointerCheckBox; + private System.Windows.Forms.CheckBox showIntegerCheckBox; + private System.Windows.Forms.CheckBox showFloatCheckBox; + private System.Windows.Forms.CheckBox showPluginInfoCheckBox; + private System.Windows.Forms.CheckBox showStringCheckBox; + private System.Windows.Forms.CheckBox showSymbolsCheckBox; + 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 UI.SettingsTextBox floatSettingsTextBox; + private System.Windows.Forms.TextBox floatTypeTextBox; private System.Windows.Forms.Label uint64SettingsLabel; - private UI.SettingsTextBox uint64SettingsTextBox; + private System.Windows.Forms.TextBox uint64TypeTextBox; private System.Windows.Forms.Label uint32SettingsLabel; - private UI.SettingsTextBox uint32SettingsTextBox; + private System.Windows.Forms.TextBox uint32TypeTextBox; private System.Windows.Forms.Label uint16SettingsLabel; - private UI.SettingsTextBox uint16SettingsTextBox; + private System.Windows.Forms.TextBox uint16TypeTextBox; private System.Windows.Forms.Label uint8SettingsLabel; - private UI.SettingsTextBox uint8SettingsTextBox; + private System.Windows.Forms.TextBox uint8TypeTextBox; private System.Windows.Forms.Label int64SettingsLabel; - private UI.SettingsTextBox int64SettingsTextBox; + private System.Windows.Forms.TextBox int64TypeTextBox; private System.Windows.Forms.Label int32SettingsLabel; - private UI.SettingsTextBox int32SettingsTextBox; + private System.Windows.Forms.TextBox int32TypeTextBox; private System.Windows.Forms.Label int16SettingsLabel; - private UI.SettingsTextBox int16SettingsTextBox; + private System.Windows.Forms.TextBox int16TypeTextBox; private System.Windows.Forms.Label int8SettingsLabel; - private UI.SettingsTextBox int8SettingsTextBox; - private System.Windows.Forms.Label paddingSettingsLabel; - private UI.SettingsTextBox paddingSettingsTextBox; + private System.Windows.Forms.TextBox int8TypeTextBox; private System.Windows.Forms.Label functionPtrSettingsLabel; - private UI.SettingsTextBox functionPtrSettingsTextBox; - private System.Windows.Forms.Label utf16TextPtrSettingsLabel; - private UI.SettingsTextBox utf16TextPtrSettingsTextBox; + private System.Windows.Forms.TextBox functionPtrTypeTextBox; private System.Windows.Forms.Label utf16TextSettingsLabel; - private UI.SettingsTextBox utf16TextSettingsTextBox; - private System.Windows.Forms.Label utf8TextPtrSettingsLabel; - private UI.SettingsTextBox utf8TextPtrSettingsTextBox; + private System.Windows.Forms.TextBox utf16TextTypeTextBox; private System.Windows.Forms.Label utf8TextSettingsLabel; - private UI.SettingsTextBox utf8TextSettingsTextBox; + private System.Windows.Forms.TextBox utf8TextTypeTextBox; private System.Windows.Forms.Label matrix3x3SettingsLabel; - private UI.SettingsTextBox matrix3x3SettingsTextBox; + private System.Windows.Forms.TextBox matrix3x3TypeTextBox; private System.Windows.Forms.Label matrix3x4SettingsLabel; - private UI.SettingsTextBox matrix3x4SettingsTextBox; + private System.Windows.Forms.TextBox matrix3x4TypeTextBox; private System.Windows.Forms.Label matrix4x4SettingsLabel; - private UI.SettingsTextBox matrix4x4SettingsTextBox; + private System.Windows.Forms.TextBox matrix4x4TypeTextBox; private System.Windows.Forms.Label vector2SettingsLabel; - private UI.SettingsTextBox vector2SettingsTextBox; + private System.Windows.Forms.TextBox vector2TypeTextBox; private System.Windows.Forms.Label vector3SettingsLabel; - private UI.SettingsTextBox vector3SettingsTextBox; + private System.Windows.Forms.TextBox vector3TypeTextBox; private System.Windows.Forms.Label vector4SettingsLabel; - private UI.SettingsTextBox vector4SettingsTextBox; + private System.Windows.Forms.TextBox vector4TypeTextBox; private System.Windows.Forms.Label doubleSettingsLabel; - private UI.SettingsTextBox doubleSettingsTextBox; + private System.Windows.Forms.TextBox doubleTypeTextBox; private System.Windows.Forms.GroupBox nodeColorGroupBox; - private System.Windows.Forms.Label label1; - private UI.BannerBox bannerBox; + private System.Windows.Forms.Label generatorInfoLabel; + private BannerBox bannerBox; private System.Windows.Forms.Label boolSettingsLabel; - private UI.SettingsTextBox boolSettingsTextBox; + private System.Windows.Forms.TextBox boolTypeTextBox; private System.Windows.Forms.GroupBox fileAssociationGroupBox; 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; + 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 b69a0091..fcc4121e 100644 --- a/ReClass.NET/Forms/SettingsForm.cs +++ b/ReClass.NET/Forms/SettingsForm.cs @@ -1,7 +1,10 @@ -using System; +using System; using System.Diagnostics.Contracts; using System.Windows.Forms; +using ReClassNET.Controls; +using ReClassNET.Extensions; using ReClassNET.Native; +using ReClassNET.Project; using ReClassNET.UI; using ReClassNET.Util; @@ -10,14 +13,17 @@ namespace ReClassNET.Forms public partial class SettingsForm : IconForm { private readonly Settings settings; + private readonly CppTypeMapping typeMapping; public TabControl SettingsTabControl => settingsTabControl; - public SettingsForm(Settings settings) + public SettingsForm(Settings settings, CppTypeMapping typeMapping) { Contract.Requires(settings != null); + Contract.Requires(typeMapping != null); this.settings = settings; + this.typeMapping = typeMapping; InitializeComponent(); @@ -31,13 +37,14 @@ public SettingsForm(Settings settings) colorsSettingTabPage.ImageIndex = 1; typeDefinitionsSettingsTabPage.ImageIndex = 2; - backgroundColorBox.Color = System.Drawing.Color.Red; - - SetBindings(); + SetGeneralBindings(); + SetColorBindings(); + SetTypeDefinitionBindings(); if (NativeMethods.IsUnix()) { fileAssociationGroupBox.Enabled = false; + runAsAdminCheckBox.Enabled = false; } else { @@ -70,128 +77,81 @@ private void removeAssociationButton_Click(object sender, EventArgs e) WinUtil.RunElevated(PathUtil.LauncherExecutablePath, $"-{Constants.CommandLineOptions.FileExtUnregister}"); } - private void SetBindings() + private static void SetBinding(IBindableComponent control, string propertyName, object dataSource, string dataMember) { - SetGeneralBindings(); - SetColorBindings(); - SetTypedefinitionBindings(); + Contract.Requires(control != null); + Contract.Requires(propertyName != null); + Contract.Requires(dataSource != null); + Contract.Requires(dataMember != null); + + control.DataBindings.Add(propertyName, dataSource, dataMember, true, DataSourceUpdateMode.OnPropertyChanged); } private void SetGeneralBindings() { - stayOnTopCheckBox.Source = settings; - stayOnTopCheckBox.SettingName = nameof(Settings.StayOnTop); - stayOnTopCheckBox.CheckedChanged += (sender, e) => - { - GlobalWindowManager.Windows.ForEach(w => w.TopMost = stayOnTopCheckBox.Checked); - }; - - showNodeAddressCheckBox.Source = settings; - showNodeAddressCheckBox.SettingName = nameof(Settings.ShowNodeAddress); - showNodeOffsetCheckBox.Source = settings; - showNodeOffsetCheckBox.SettingName = nameof(Settings.ShowNodeOffset); - showTextCheckBox.Source = settings; - showTextCheckBox.SettingName = nameof(Settings.ShowNodeText); - highlightChangedValuesCheckBox.Source = settings; - highlightChangedValuesCheckBox.SettingName = nameof(Settings.HighlightChangedValues); - - showFloatCheckBox.Source = settings; - showFloatCheckBox.SettingName = nameof(Settings.ShowCommentFloat); - showIntegerCheckBox.Source = settings; - showIntegerCheckBox.SettingName = nameof(Settings.ShowCommentInteger); - showPointerCheckBox.Source = settings; - showPointerCheckBox.SettingName = nameof(Settings.ShowCommentPointer); - showRttiCheckBox.Source = settings; - showRttiCheckBox.SettingName = nameof(Settings.ShowCommentRtti); - showSymbolsCheckBox.Source = settings; - showSymbolsCheckBox.SettingName = nameof(Settings.ShowCommentSymbol); - showStringCheckBox.Source = settings; - showStringCheckBox.SettingName = nameof(Settings.ShowCommentString); - showPluginInfoCheckBox.Source = settings; - showPluginInfoCheckBox.SettingName = nameof(Settings.ShowCommentPluginInfo); + SetBinding(stayOnTopCheckBox, nameof(CheckBox.Checked), settings, nameof(Settings.StayOnTop)); + 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)); + SetBinding(showTextCheckBox, nameof(CheckBox.Checked), settings, nameof(Settings.ShowNodeText)); + SetBinding(highlightChangedValuesCheckBox, nameof(CheckBox.Checked), settings, nameof(Settings.HighlightChangedValues)); + + SetBinding(showFloatCheckBox, nameof(CheckBox.Checked), settings, nameof(Settings.ShowCommentFloat)); + SetBinding(showIntegerCheckBox, nameof(CheckBox.Checked), settings, nameof(Settings.ShowCommentInteger)); + SetBinding(showPointerCheckBox, nameof(CheckBox.Checked), settings, nameof(Settings.ShowCommentPointer)); + SetBinding(showRttiCheckBox, nameof(CheckBox.Checked), settings, nameof(Settings.ShowCommentRtti)); + 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() { - backgroundColorBox.Source = settings; - backgroundColorBox.SettingName = nameof(Settings.BackgroundColor); - - nodeSelectedColorBox.Source = settings; - nodeSelectedColorBox.SettingName = nameof(Settings.SelectedColor); - nodeHiddenColorBox.Source = settings; - nodeHiddenColorBox.SettingName = nameof(Settings.HiddenColor); - nodeAddressColorBox.Source = settings; - nodeAddressColorBox.SettingName = nameof(Settings.AddressColor); - nodeOffsetColorBox.Source = settings; - nodeOffsetColorBox.SettingName = nameof(Settings.OffsetColor); - nodeHexValueColorBox.Source = settings; - nodeHexValueColorBox.SettingName = nameof(Settings.HexColor); - nodeTypeColorBox.Source = settings; - nodeTypeColorBox.SettingName = nameof(Settings.TypeColor); - nodeNameColorBox.Source = settings; - nodeNameColorBox.SettingName = nameof(Settings.NameColor); - nodeValueColorBox.Source = settings; - nodeValueColorBox.SettingName = nameof(Settings.ValueColor); - nodeIndexColorBox.Source = settings; - nodeIndexColorBox.SettingName = nameof(Settings.IndexColor); - nodeVTableColorBox.Source = settings; - nodeVTableColorBox.SettingName = nameof(Settings.VTableColor); - nodeCommentColorBox.Source = settings; - nodeCommentColorBox.SettingName = nameof(Settings.CommentColor); - nodeTextColorBox.Source = settings; - nodeTextColorBox.SettingName = nameof(Settings.TextColor); - nodePluginColorBox.Source = settings; - nodePluginColorBox.SettingName = nameof(Settings.PluginColor); + SetBinding(backgroundColorBox, nameof(ColorBox.Color), settings, nameof(Settings.BackgroundColor)); + + SetBinding(nodeSelectedColorBox, nameof(ColorBox.Color), settings, nameof(Settings.SelectedColor)); + SetBinding(nodeHiddenColorBox, nameof(ColorBox.Color), settings, nameof(Settings.HiddenColor)); + SetBinding(nodeAddressColorBox, nameof(ColorBox.Color), settings, nameof(Settings.AddressColor)); + SetBinding(nodeOffsetColorBox, nameof(ColorBox.Color), settings, nameof(Settings.OffsetColor)); + SetBinding(nodeHexValueColorBox, nameof(ColorBox.Color), settings, nameof(Settings.HexColor)); + SetBinding(nodeTypeColorBox, nameof(ColorBox.Color), settings, nameof(Settings.TypeColor)); + SetBinding(nodeNameColorBox, nameof(ColorBox.Color), settings, nameof(Settings.NameColor)); + SetBinding(nodeValueColorBox, nameof(ColorBox.Color), settings, nameof(Settings.ValueColor)); + SetBinding(nodeIndexColorBox, nameof(ColorBox.Color), settings, nameof(Settings.IndexColor)); + SetBinding(nodeVTableColorBox, nameof(ColorBox.Color), settings, nameof(Settings.VTableColor)); + SetBinding(nodeCommentColorBox, nameof(ColorBox.Color), settings, nameof(Settings.CommentColor)); + SetBinding(nodeTextColorBox, nameof(ColorBox.Color), settings, nameof(Settings.TextColor)); + SetBinding(nodePluginColorBox, nameof(ColorBox.Color), settings, nameof(Settings.PluginColor)); } - private void SetTypedefinitionBindings() + private void SetTypeDefinitionBindings() { - paddingSettingsTextBox.Source = settings; - paddingSettingsTextBox.SettingName = nameof(Settings.TypePadding); - boolSettingsTextBox.Source = settings; - boolSettingsTextBox.SettingName = nameof(Settings.TypeBool); - int8SettingsTextBox.Source = settings; - int8SettingsTextBox.SettingName = nameof(Settings.TypeInt8); - int16SettingsTextBox.Source = settings; - int16SettingsTextBox.SettingName = nameof(Settings.TypeInt16); - int32SettingsTextBox.Source = settings; - int32SettingsTextBox.SettingName = nameof(Settings.TypeInt32); - int64SettingsTextBox.Source = settings; - int64SettingsTextBox.SettingName = nameof(Settings.TypeInt64); - uint8SettingsTextBox.Source = settings; - uint8SettingsTextBox.SettingName = nameof(Settings.TypeUInt8); - uint16SettingsTextBox.Source = settings; - uint16SettingsTextBox.SettingName = nameof(Settings.TypeUInt16); - uint32SettingsTextBox.Source = settings; - uint32SettingsTextBox.SettingName = nameof(Settings.TypeUInt32); - uint64SettingsTextBox.Source = settings; - uint64SettingsTextBox.SettingName = nameof(Settings.TypeUInt64); - floatSettingsTextBox.Source = settings; - floatSettingsTextBox.SettingName = nameof(Settings.TypeFloat); - doubleSettingsTextBox.Source = settings; - doubleSettingsTextBox.SettingName = nameof(Settings.TypeDouble); - vector2SettingsTextBox.Source = settings; - vector2SettingsTextBox.SettingName = nameof(Settings.TypeVector2); - vector3SettingsTextBox.Source = settings; - vector3SettingsTextBox.SettingName = nameof(Settings.TypeVector3); - vector4SettingsTextBox.Source = settings; - vector4SettingsTextBox.SettingName = nameof(Settings.TypeVector4); - matrix3x3SettingsTextBox.Source = settings; - matrix3x3SettingsTextBox.SettingName = nameof(Settings.TypeMatrix3x3); - matrix3x4SettingsTextBox.Source = settings; - matrix3x4SettingsTextBox.SettingName = nameof(Settings.TypeMatrix3x4); - matrix4x4SettingsTextBox.Source = settings; - matrix4x4SettingsTextBox.SettingName = nameof(Settings.TypeMatrix4x4); - utf8TextSettingsTextBox.Source = settings; - utf8TextSettingsTextBox.SettingName = nameof(Settings.TypeUTF8Text); - utf8TextPtrSettingsTextBox.Source = settings; - utf8TextPtrSettingsTextBox.SettingName = nameof(Settings.TypeUTF8TextPtr); - utf16TextSettingsTextBox.Source = settings; - utf16TextSettingsTextBox.SettingName = nameof(Settings.TypeUTF16Text); - utf16TextPtrSettingsTextBox.Source = settings; - utf16TextPtrSettingsTextBox.SettingName = nameof(Settings.TypeUTF16TextPtr); - functionPtrSettingsTextBox.Source = settings; - functionPtrSettingsTextBox.SettingName = nameof(Settings.TypeFunctionPtr); + 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)); + SetBinding(vector3TypeTextBox, nameof(TextBox.Text), typeMapping, nameof(CppTypeMapping.TypeVector3)); + SetBinding(vector4TypeTextBox, nameof(TextBox.Text), typeMapping, nameof(CppTypeMapping.TypeVector4)); + SetBinding(matrix3x3TypeTextBox, nameof(TextBox.Text), typeMapping, nameof(CppTypeMapping.TypeMatrix3x3)); + SetBinding(matrix3x4TypeTextBox, nameof(TextBox.Text), typeMapping, nameof(CppTypeMapping.TypeMatrix3x4)); + 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)); } } } 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/Makefile b/ReClass.NET/Makefile index 52bcae5b..d66fd569 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: + 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: + 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" + 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/Memory/Disassembler.cs b/ReClass.NET/Memory/Disassembler.cs index 89b018e9..d83dfc97 100644 --- a/ReClass.NET/Memory/Disassembler.cs +++ b/ReClass.NET/Memory/Disassembler.cs @@ -1,9 +1,10 @@ using System; using System.Collections.Generic; using System.Diagnostics.Contracts; +using System.Linq; using System.Runtime.InteropServices; using ReClassNET.Core; -using ReClassNET.Util; +using ReClassNET.Extensions; namespace ReClassNET.Memory { @@ -26,7 +27,7 @@ public Disassembler(CoreFunctionsManager coreFunctions) /// The address of the code. /// The length of the code in bytes. /// A list of . - public IList 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); @@ -40,7 +41,7 @@ public IList RemoteDisassembleCode(RemoteProcess proces /// 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 IList 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); @@ -55,7 +56,7 @@ public IList RemoteDisassembleCode(RemoteProcess proces /// The virtual address of the code. This allows to decode instructions located anywhere in memory even if they are not at their original place. /// The maximum number of instructions to disassemble. If is -1, all available instructions get returned. /// A list of . - public IList DisassembleCode(byte[] data, IntPtr virtualAddress, int maxInstructions) + public IReadOnlyList DisassembleCode(byte[] data, IntPtr virtualAddress, int maxInstructions) { Contract.Requires(data != null); Contract.Ensures(Contract.Result>() != null); @@ -88,7 +89,7 @@ public IList DisassembleCode(byte[] data, IntPtr virtua /// The address of the code. /// The maximum maxLength of the code. /// A list of which belong to the function. - public IList 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); @@ -102,7 +103,7 @@ public IList RemoteDisassembleFunction(RemoteProcess pr /// The data to disassemble. /// The virtual address of the code. This allows to decode instructions located anywhere in memory even if they are not at their original place. /// A list of which belong to the function. - public IList DisassembleFunction(byte[] data, IntPtr virtualAddress) + public IReadOnlyList DisassembleFunction(byte[] data, IntPtr virtualAddress) { Contract.Requires(data != null); Contract.Ensures(Contract.Result>() != null); @@ -140,14 +141,18 @@ public IList DisassembleFunction(byte[] data, IntPtr vi /// 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) { - var buffer = process.ReadRemoteMemory(address - 6 * MaximumInstructionLength, 7 * MaximumInstructionLength); + const int TotalBufferSize = 7 * MaximumInstructionLength; + const int BufferShiftSize = 6 * MaximumInstructionLength; + + var buffer = process.ReadRemoteMemory(address - BufferShiftSize, TotalBufferSize); var handle = GCHandle.Alloc(buffer, GCHandleType.Pinned); try { var bufferAddress = handle.AddrOfPinnedObject(); + var targetBufferAddress = bufferAddress + BufferShiftSize; var instruction = default(InstructionData); @@ -156,16 +161,16 @@ public DisassembledInstruction RemoteGetPreviousInstruction(RemoteProcess proces 6 * MaximumInstructionLength, 4 * MaximumInstructionLength, 2 * MaximumInstructionLength, - MaximumInstructionLength, + 1 * MaximumInstructionLength, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1 }) { - var currentAddress = bufferAddress - offset; + var currentAddress = targetBufferAddress - offset; coreFunctions.DisassembleCode(currentAddress, offset + 1, address - offset, false, (ref InstructionData data) => { var nextAddress = currentAddress + data.Length; - if (nextAddress.CompareTo(address) > -1) + if (nextAddress.CompareTo(targetBufferAddress) > 0) { return false; } @@ -177,7 +182,7 @@ public DisassembledInstruction RemoteGetPreviousInstruction(RemoteProcess proces return true; }); - if (currentAddress == address) + if (currentAddress == targetBufferAddress) { return new DisassembledInstruction(ref instruction); } @@ -198,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; @@ -226,19 +231,9 @@ public IntPtr RemoteGetFunctionStartAddress(RemoteProcess process, IntPtr addres if (prevInstruction.Length == 1 && prevInstruction.Data[0] == 0xCC) { // Disassemble the code from the start and check if the instructions sum up to address. - var length = 0; - var res = coreFunctions.DisassembleCode(start, address.Sub(start).ToInt32(), IntPtr.Zero, false, (ref InstructionData data) => - { - length += data.Length; - - return true; - }); - if (!res) - { - continue; - } - - if (start + length == address) + var totalInstructionLength = RemoteDisassembleCode(process, start, address.Sub(start).ToInt32()) + .Sum(ins => ins.Length); + if (start + totalInstructionLength == address) { return start; } @@ -277,6 +272,6 @@ public DisassembledInstruction(ref InstructionData data) Instruction = data.Instruction; } - public override string ToString() => $"{Address.ToString(Constants.StringHexFormat)} - {Instruction}"; + public override string ToString() => $"{Address.ToString(Constants.AddressHexFormat)} - {Instruction}"; } } diff --git a/ReClass.NET/Memory/Dumper.cs b/ReClass.NET/Memory/Dumper.cs index a5cc926a..ba434ae0 100644 --- a/ReClass.NET/Memory/Dumper.cs +++ b/ReClass.NET/Memory/Dumper.cs @@ -4,80 +4,49 @@ namespace ReClassNET.Memory { - public class Dumper + public static class Dumper { - private readonly RemoteProcess process; - - public Dumper(RemoteProcess process) - { - Contract.Requires(process != null); - Contract.Ensures(this.process != null); - - 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 memory reader to use. + /// 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 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 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 memory reader to use. + /// The section to dump. /// The stream to dump to. - public void DumpModule(IntPtr address, int size, Stream stream) + public static void DumpSection(IRemoteMemoryReader reader, 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(reader, 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 memory reader to use. + /// The module to dump. + /// The stream to dump to. + public static void DumpModule(IRemoteMemoryReader reader, 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 = reader.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/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..f60a4aaf --- /dev/null +++ b/ReClass.NET/Memory/IRemoteMemoryReader.cs @@ -0,0 +1,33 @@ +using System; +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. + 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 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..fc895b3a --- /dev/null +++ b/ReClass.NET/Memory/IRemoteMemoryWriter.cs @@ -0,0 +1,17 @@ +using System; +using System.Text; +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. + /// True if it succeeds, false if it fails. + bool WriteRemoteMemory(IntPtr address, byte[] data); + } +} diff --git a/ReClass.NET/Memory/MemoryBuffer.cs b/ReClass.NET/Memory/MemoryBuffer.cs index e9bc7f7a..e1b515a4 100644 --- a/ReClass.NET/Memory/MemoryBuffer.cs +++ b/ReClass.NET/Memory/MemoryBuffer.cs @@ -1,8 +1,8 @@ -using System; +using System; using System.Diagnostics.Contracts; -using System.Runtime.InteropServices; using System.Text; -using ReClassNET.Util; +using ReClassNET.Extensions; +using ReClassNET.Util.Conversion; namespace ReClassNET.Memory { @@ -13,16 +13,16 @@ public class MemoryBuffer private bool hasHistory; - public RemoteProcess Process { get; set; } - public byte[] RawData => data; + public EndianBitConverter BitConverter { get; set; } = EndianBitConverter.System; + 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]; @@ -46,54 +46,33 @@ 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]; - } - - 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; + data = Array.Empty(); + historyData = Array.Empty(); } public MemoryBuffer Clone() { Contract.Ensures(Contract.Result() != null); - return new MemoryBuffer(this) + return new MemoryBuffer { - Offset = Offset, - Process = Process - }; - } + data = data, + historyData = historyData, + hasHistory = hasHistory, - public void Update(IntPtr address) - { - Update(address, true); + BitConverter = BitConverter, + ContainsValidData = ContainsValidData, + Offset = Offset + }; } - public void Update(IntPtr address, bool setHistory) + public void UpdateFrom(IRemoteMemoryReader reader, IntPtr address) { - if (Process == null) + if (reader == null) { data.FillWithZero(); @@ -102,14 +81,13 @@ 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; + + BitConverter = reader.BitConverter; - ContainsValidData = Process.ReadRemoteMemoryIntoBuffer(address, ref data); + ContainsValidData = reader.ReadRemoteMemoryIntoBuffer(address, ref data); if (!ContainsValidData) { data.FillWithZero(); @@ -118,11 +96,6 @@ public void Update(IntPtr address, bool setHistory) } } - public byte[] ReadBytes(IntPtr offset, int length) - { - return ReadBytes(offset.ToInt32(), length); - } - public byte[] ReadBytes(int offset, int length) { Contract.Requires(offset >= 0); @@ -135,13 +108,6 @@ public byte[] ReadBytes(int offset, int length) return buffer; } - public void ReadBytes(IntPtr offset, byte[] buffer) - { - Contract.Requires(buffer != null); - - ReadBytes(offset.ToInt32(), buffer); - } - public void ReadBytes(int offset, byte[] buffer) { Contract.Requires(offset >= 0); @@ -156,42 +122,8 @@ public void ReadBytes(int offset, byte[] buffer) Array.Copy(data, offset, buffer, 0, buffer.Length); } - public T ReadObject(IntPtr offset) where T : struct - { - Contract.Requires(offset.ToInt32() >= 0); - - return ReadObject(offset.ToInt32()); - } - - 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(T); - } - - 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. - /// The offset into the data. - /// The data read as or 0 if the offset is outside the data. - public sbyte ReadInt8(IntPtr offset) - { - Contract.Requires(offset.ToInt32() >= 0); - - return ReadInt8(offset.ToInt32()); - } - /// Reads a from the specific offset. /// The offset into the data. /// The data read as or 0 if the offset is outside the data. @@ -202,22 +134,12 @@ public sbyte ReadInt8(int offset) offset = Offset + offset; if (offset + sizeof(sbyte) > data.Length) { - return default(sbyte); + return default; } return (sbyte)data[offset]; } - /// 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 byte ReadUInt8(IntPtr offset) - { - Contract.Requires(offset.ToInt32() >= 0); - - return ReadUInt8(offset.ToInt32()); - } - /// Reads a from the specific offset. /// The offset into the data. /// The data read as or 0 if the offset is outside the data. @@ -228,22 +150,12 @@ public byte ReadUInt8(int offset) offset = Offset + offset; if (offset + sizeof(byte) > data.Length) { - return default(byte); + return default; } return data[offset]; } - /// 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 short ReadInt16(IntPtr offset) - { - Contract.Requires(offset.ToInt32() >= 0); - - return ReadInt16(offset.ToInt32()); - } - /// Reads a from the specific offset. /// The offset into the data. /// The data read as or 0 if the offset is outside the data. @@ -254,22 +166,12 @@ public short ReadInt16(int offset) offset = Offset + offset; if (offset + sizeof(short) > data.Length) { - return default(short); + return default; } return BitConverter.ToInt16(data, offset); } - /// 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 ushort ReadUInt16(IntPtr offset) - { - Contract.Requires(offset.ToInt32() >= 0); - - return ReadUInt16(offset.ToInt32()); - } - /// Reads a from the specific offset. /// The offset into the data. /// The data read as or 0 if the offset is outside the data. @@ -280,22 +182,12 @@ public ushort ReadUInt16(int offset) offset = Offset + offset; if (offset + sizeof(ushort) > data.Length) { - return default(ushort); + return default; } return BitConverter.ToUInt16(data, offset); } - /// 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 int ReadInt32(IntPtr offset) - { - Contract.Requires(offset.ToInt32() >= 0); - - return ReadInt32(offset.ToInt32()); - } - /// Reads a from the specific offset. /// The offset into the data. /// The data read as or 0 if the offset is outside the data. @@ -306,22 +198,12 @@ public int ReadInt32(int offset) offset = Offset + offset; if (offset + sizeof(int) > data.Length) { - return default(int); + return default; } return BitConverter.ToInt32(data, offset); } - /// 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 uint ReadUInt32(IntPtr offset) - { - Contract.Requires(offset.ToInt32() >= 0); - - return ReadUInt32(offset.ToInt32()); - } - /// Reads a from the specific offset. /// The offset into the data. /// The data read as or 0 if the offset is outside the data. @@ -332,22 +214,12 @@ public uint ReadUInt32(int offset) offset = Offset + offset; if (offset + sizeof(uint) > data.Length) { - return default(uint); + return default; } return BitConverter.ToUInt32(data, offset); } - /// 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 long ReadInt64(IntPtr offset) - { - Contract.Requires(offset.ToInt32() >= 0); - - return ReadInt64(offset.ToInt32()); - } - /// Reads a from the specific offset. /// The offset into the data. /// The data read as or 0 if the offset is outside the data. @@ -358,22 +230,12 @@ public long ReadInt64(int offset) offset = Offset + offset; if (offset + sizeof(long) > data.Length) { - return default(long); + return default; } return BitConverter.ToInt64(data, offset); } - /// 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 ulong ReadUInt64(IntPtr offset) - { - Contract.Requires(offset.ToInt32() >= 0); - - return ReadUInt64(offset.ToInt32()); - } - /// Reads a from the specific offset. /// The offset into the data. /// The data read as or 0 if the offset is outside the data. @@ -384,22 +246,12 @@ public ulong ReadUInt64(int offset) offset = Offset + offset; if (offset + sizeof(ulong) > data.Length) { - return default(ulong); + return default; } return BitConverter.ToUInt64(data, offset); } - /// 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 float ReadFloat(IntPtr offset) - { - Contract.Requires(offset.ToInt32() >= 0); - - return ReadFloat(offset.ToInt32()); - } - /// Reads a from the specific offset. /// The offset into the data. /// The data read as or 0 if the offset is outside the data. @@ -410,22 +262,12 @@ public float ReadFloat(int offset) offset = Offset + offset; if (offset + sizeof(float) > data.Length) { - return default(float); + return default; } return BitConverter.ToSingle(data, offset); } - /// 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 double ReadDouble(IntPtr offset) - { - Contract.Requires(offset.ToInt32() >= 0); - - return ReadDouble(offset.ToInt32()); - } - /// Reads a from the specific offset. /// The offset into the data. /// The data read as or 0 if the offset is outside the data. @@ -436,22 +278,12 @@ public double ReadDouble(int offset) offset = Offset + offset; if (offset + sizeof(double) > data.Length) { - return default(double); + return default; } return BitConverter.ToDouble(data, offset); } - /// 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 IntPtr ReadIntPtr(IntPtr offset) - { - Contract.Requires(offset.ToInt32() >= 0); - - return ReadIntPtr(offset.ToInt32()); - } - /// Reads a from the specific offset. /// The offset into the data. /// The data read as or 0 if the offset is outside the data. @@ -466,19 +298,25 @@ public IntPtr ReadIntPtr(int offset) #endif } - #endregion - - public string ReadPrintableAsciiString(IntPtr offset, int length) + /// 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.ToInt32() >= 0); - Contract.Requires(length >= 0); - Contract.Ensures(Contract.Result() != null); + Contract.Requires(offset >= 0); - return ReadPrintableAsciiString(offset.ToInt32(), length); +#if RECLASSNET64 + return (UIntPtr)ReadUInt64(offset); +#else + return (UIntPtr)ReadUInt32(offset); +#endif } - public string ReadPrintableAsciiString(int offset, int length) + #endregion + + public string ReadString(Encoding encoding, int offset, int length) { + Contract.Requires(encoding != null); Contract.Requires(offset >= 0); Contract.Requires(length >= 0); Contract.Ensures(Contract.Result() != null); @@ -493,27 +331,6 @@ public string ReadPrintableAsciiString(int offset, int length) 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(); - } - - private string ReadString(Encoding encoding, int offset, int length) - { - Contract.Requires(encoding != null); - Contract.Requires(offset >= 0); - Contract.Requires(length >= 0); - Contract.Ensures(Contract.Result() != null); - - if (Offset + offset + length > data.Length) - { - length = data.Length - Offset - offset; - } - var sb = new StringBuilder(encoding.GetString(data, Offset + offset, length)); for (var i = 0; i < sb.Length; ++i) { @@ -525,38 +342,6 @@ private string ReadString(Encoding encoding, int offset, int length) return sb.ToString(); } - public string ReadUtf8String(IntPtr offset, int length) - { - Contract.Requires(offset.ToInt32() >= 0); - Contract.Requires(length >= 0); - Contract.Ensures(Contract.Result() != null); - - return ReadString(Encoding.UTF8, offset.ToInt32(), length); - } - - public string ReadUtf16String(IntPtr offset, int length) - { - Contract.Requires(offset.ToInt32() >= 0); - Contract.Requires(length >= 0); - Contract.Ensures(Contract.Result() != null); - - return ReadString(Encoding.Unicode, offset.ToInt32(), length); - } - - public string ReadUtf32String(IntPtr offset, int length) - { - Contract.Requires(offset.ToInt32() >= 0); - Contract.Requires(length >= 0); - Contract.Ensures(Contract.Result() != null); - - return ReadString(Encoding.UTF32, offset.ToInt32(), length); - } - - public bool HasChanged(IntPtr offset, int length) - { - return HasChanged(offset.ToInt32(), length); - } - public bool HasChanged(int offset, int length) { if (!hasHistory) diff --git a/ReClass.NET/Memory/NodeDissector.cs b/ReClass.NET/Memory/NodeDissector.cs index 30b60ed9..e03b92e9 100644 --- a/ReClass.NET/Memory/NodeDissector.cs +++ b/ReClass.NET/Memory/NodeDissector.cs @@ -1,15 +1,15 @@ -using System; +using System; using System.Collections.Generic; using System.Diagnostics.Contracts; using System.Linq; +using ReClassNET.Extensions; using ReClassNET.Nodes; -using ReClassNET.Util; 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,75 +17,85 @@ public static void DissectNodes(IEnumerable nodes, MemoryBuffer mem foreach (var node in nodes) { - var type = GuessType(node, memory); - if (type != null) + if (GuessNode(node, reader, memory, out var guessedNode)) { - node.ParentNode.ReplaceChildNode(node, type); + node.GetParentContainer()?.ReplaceChildNode(node, guessedNode); } } } - public static Type GuessType(BaseHexNode node, MemoryBuffer memory) + public static bool GuessNode(BaseHexNode node, IProcessReader reader, MemoryBuffer memory, out BaseNode guessedNode) { Contract.Requires(node != null); Contract.Requires(memory != null); - var offset = node.Offset.ToInt32(); + guessedNode = null; + + var offset = node.Offset; var is4ByteAligned = offset % 4 == 0; var is8ByteAligned = offset % 8 == 0; // The node is not aligned, skip it. if (!is4ByteAligned) { - return null; + 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.InterpretAsUtf8().IsLikelyPrintableData() >= 0.75f) + if (raw.InterpretAsSingleByteCharacter().IsLikelyPrintableData()) { - return typeof(Utf8TextNode); + guessedNode = new Utf8TextNode(); + + return true; } - if (raw.InterpretAsUtf16().IsLikelyPrintableData() >= 0.75f) + if (raw.InterpretAsDoubleByteCharacter().IsLikelyPrintableData()) { - return typeof(Utf16TextNode); + guessedNode = new Utf16TextNode(); + + return true; } +#if RECLASSNET64 if (is8ByteAligned) { -#if RECLASSNET64 - var pointerType = GuessPointerType(data64.IntPtr, memory); - if (pointerType != null) + if (GuessPointerNode(data64.IntPtr, reader, out guessedNode)) { - return pointerType; + return true; } -#endif } +#else + if (GuessPointerNode(data32.IntPtr, reader, out guessedNode)) + { + return true; + } +#endif + // 0 could be anything. + if (data32.IntValue != 0) { -#if RECLASSNET32 - var pointerType = GuessPointerType(data32.IntPtr, memory); - if (pointerType != 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 pointerType; + 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 (-99999.0f <= data32.FloatValue && data32.FloatValue <= 99999.0f && !data32.FloatValue.IsNearlyEqual(0.0f, 0.001f)) - { - return typeof(FloatNode); - } + guessedNode = new Int32Node(); - if (-99999 <= data32.IntValue && data32.IntValue <= 99999) - { - return typeof(Int32Node); - } + return true; } } @@ -94,67 +104,75 @@ public static Type GuessType(BaseHexNode node, MemoryBuffer memory) if (data64.LongValue != 0) { // If the data represents a reasonable range, it could be a double. - if (-99999.0 <= data64.DoubleValue && data64.DoubleValue <= 99999.0 && !data64.DoubleValue.IsNearlyEqual(0.0, 0.001)) + if (-999999.0 <= data64.DoubleValue && data64.DoubleValue <= 999999.0 && !data64.DoubleValue.IsNearlyEqual(0.0, 0.001)) { - return typeof(DoubleNode); + guessedNode = new DoubleNode(); + + return true; } } } - return null; + return false; } - private static Type GuessPointerType(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); - if (section != null) // If the address points to a section it's valid memory. + var section = process.GetSectionToPointer(address); + if (section == null) { - if (section.Category == SectionCategory.CODE) // If the section contains code, it should be a function pointer. + return false; + } + + if (section.Category == SectionCategory.CODE) // If the section contains code, it should be a function pointer. + { + 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. + 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) { - return typeof(FunctionPtrNode); + node = new VirtualMethodTableNode(); + + 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 string. + var data = process.ReadRemoteMemory(address, IntPtr.Size * 2); + if (data.Take(IntPtr.Size).InterpretAsSingleByteCharacter().IsLikelyPrintableData()) { - // Check if it is a vtable. Check if the first 3 values are pointers to a code section. - bool valid = true; - for (var i = 0; i < 3; ++i) - { - var pointee = memory.Process.ReadRemoteIntPtr(address); - if (memory.Process.GetSectionToPointer(pointee)?.Category != SectionCategory.CODE) - { - valid = false; - break; - } - } - if (valid) - { - return typeof(VTableNode); - } + node = new Utf8TextPtrNode(); - // Check if it is a string. - var data = memory.Process.ReadRemoteMemory(address, IntPtr.Size * 2); - if (data.Take(IntPtr.Size).InterpretAsUtf8().IsLikelyPrintableData() >= 07.5f) - { - return typeof(Utf8TextPtrNode); - } - if (data.InterpretAsUtf16().IsLikelyPrintableData() >= 0.75f) - { - return typeof(Utf16TextPtrNode); - } + return true; + } + if (data.InterpretAsDoubleByteCharacter().IsLikelyPrintableData()) + { + node = new Utf16TextPtrNode(); - // Now it could be a pointer to something else but we can't tell. :( - //return typeof(ClassPtrNode); + return true; } + + // Now it could be a pointer to something else but we can't tell. :( + node = new PointerNode(); + + return true; } - return null; + return false; } } } 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/RemoteProcess.cs b/ReClass.NET/Memory/RemoteProcess.cs index 3b089e23..0f994e20 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; @@ -9,15 +9,16 @@ using ReClassNET.AddressParser; using ReClassNET.Core; using ReClassNET.Debugger; +using ReClassNET.Extensions; using ReClassNET.Native; using ReClassNET.Symbols; -using ReClassNET.Util; +using ReClassNET.Util.Conversion; 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(); @@ -25,6 +26,8 @@ public class RemoteProcess : IDisposable private readonly RemoteDebugger debugger; + private readonly Dictionary> formulaCache = new Dictionary>(); + private readonly Dictionary rttiCache = new Dictionary(); private readonly List modules = new List(); @@ -53,17 +56,17 @@ public class RemoteProcess : IDisposable 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 { get { - List cpy; lock (modules) { - cpy = modules.ToList(); + return new List(modules); } - return cpy; } } @@ -72,15 +75,16 @@ public IEnumerable
Sections { get { - List
cpy; lock (sections) { - cpy = sections.ToList(); + return new List
(sections); } - return cpy; } } + /// A map of named addresses. + public Dictionary NamedAddresses { get; } = new Dictionary(); + public bool IsValid => process != null && coreFunctions.IsProcessValid(handle); public RemoteProcess(CoreFunctionsManager coreFunctions) @@ -144,9 +148,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); @@ -155,11 +156,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); @@ -181,10 +177,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); @@ -195,213 +187,13 @@ 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()); - - 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 - - /// 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)); - - 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)); - - 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)); - - 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)); - - 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)); - - 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)); - - 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)); - - 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)); - - 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)); - - 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)); - - 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 - return (IntPtr)ReadRemoteInt64(address); -#else - return (IntPtr)ReadRemoteInt32(address); -#endif - } - - #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); - Contract.Requires(length >= 0); - Contract.Ensures(Contract.Result() != null); - - var data = ReadRemoteMemory(address, length); - - 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; - } - } - - /// Reads a string from the address in the remote process with the given length using UTF8 encoding. The string gets truncated at the first zero character. - /// The address of the string. - /// The length of the string. - /// The string. - public string ReadRemoteUTF8StringUntilFirstNullCharacter(IntPtr address, int length) - { - Contract.Requires(length >= 0); - Contract.Ensures(Contract.Result() != null); - - var data = ReadRemoteMemory(address, length); - - int index = 0; - for (; index < data.Length; ++index) - { - if (data[index] == 0) - { - break; - } - } - - try - { - return Encoding.UTF8.GetString(data, 0, Math.Min(index, data.Length)); - } - catch - { - return string.Empty; - } - } - - /// 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()) { if (!rttiCache.TryGetValue(address, out var rtti)) { - var objectLocatorPtr = ReadRemoteIntPtr(address - IntPtr.Size); + var objectLocatorPtr = this.ReadRemoteIntPtr(address - IntPtr.Size); if (objectLocatorPtr.MayBeValid()) { @@ -422,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 = ReadRemoteUTF8StringUntilFirstNullCharacter(typeDescriptorPtr + 0x0C, 60); + var name = this.ReadRemoteStringUntilFirstNullCharacter(typeDescriptorPtr + 0x0C, Encoding.UTF8, 60); if (name.EndsWith("@@")) { name = NativeMethods.UndecorateSymbolName("?" + name); @@ -471,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; @@ -492,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 = ReadRemoteUTF8StringUntilFirstNullCharacter(typeDescriptorPtr + 0x14, 60); + var name = this.ReadRemoteStringUntilFirstNullCharacter(typeDescriptorPtr + 0x14, Encoding.UTF8, 60); if (string.IsNullOrEmpty(name)) { break; @@ -541,10 +333,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); @@ -557,29 +345,14 @@ 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()]; - - 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) { 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]; } } @@ -587,7 +360,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]; } } @@ -605,6 +379,11 @@ public Module GetModuleByName(string name) /// The named address or null if no mapping exists. public string GetNamedAddress(IntPtr address) { + if (NamedAddresses.TryGetValue(address, out var namedAddress)) + { + return namedAddress; + } + var section = GetSectionToPointer(address); if (section != null) { @@ -613,7 +392,7 @@ public string GetNamedAddress(IntPtr address) // Code and Data sections belong to a module. return $"<{section.Category}>{section.ModuleName}.{address.ToString("X")}"; } - else if (section.Category == SectionCategory.HEAP) + if (section.Category == SectionCategory.HEAP) { return $"{address.ToString("X")}"; } @@ -626,27 +405,20 @@ public string GetNamedAddress(IntPtr address) return null; } - public void EnumerateRemoteSectionsAndModules(Action
callbackSection, Action callbackModule) + public bool EnumerateRemoteSectionsAndModules(out List
_sections, out List _modules) { if (!IsValid) { - return; - } - - coreFunctions.EnumerateRemoteSectionsAndModules(handle, callbackSection, callbackModule); - } - - public bool EnumerateRemoteSectionsAndModules(out List
sections, out List modules) - { - if (!IsValid) - { - sections = null; - modules = null; + _sections = null; + _modules = null; return false; } - coreFunctions.EnumerateRemoteSectionsAndModules(handle, out sections, out modules); + _sections = new List
(); + _modules = new List(); + + coreFunctions.EnumerateRemoteSectionsAndModules(handle, _sections.Add, _modules.Add); return true; } @@ -665,11 +437,11 @@ public Task UpdateProcessInformationsAsync() if (!IsValid) { - lock(modules) + lock (modules) { modules.Clear(); } - lock(sections) + lock (sections) { sections.Clear(); } @@ -706,26 +478,23 @@ public IntPtr ParseAddress(string addressFormula) { Contract.Requires(addressFormula != null); - var reader = new TokenReader(); - var tokens = reader.Read(addressFormula); + if (!formulaCache.TryGetValue(addressFormula, out var func)) + { + var expression = Parser.Parse(addressFormula); - var astBuilder = new AstBuilder(); - var operation = astBuilder.Build(tokens); + func = DynamicCompiler.CompileExpression(expression); - if (operation == null) - { - return IntPtr.Zero; + formulaCache.Add(addressFormula, func); } - var interpreter = new Interpreter(); - return interpreter.Execute(operation, this); + return func(this); } /// Loads all symbols asynchronous. /// The progress reporter is called for every module. Can be null. /// The token used to cancel the task. /// The task. - public Task LoadAllSymbolsAsync(IProgress>> progress, CancellationToken token) + public Task LoadAllSymbolsAsync(IProgress>> progress, CancellationToken token) { List copy; lock (modules) @@ -743,7 +512,7 @@ public Task LoadAllSymbolsAsync(IProgress>> pr { token.ThrowIfCancellationRequested(); - progress?.Report(Tuple.Create>(module, copy)); + progress?.Report(Tuple.Create>(module, copy)); Symbols.TryResolveSymbolsForModule(module); } diff --git a/ReClass.NET/Memory/SimplePeHeader.cs b/ReClass.NET/Memory/SimplePeHeader.cs new file mode 100644 index 00000000..89f0e804 --- /dev/null +++ b/ReClass.NET/Memory/SimplePeHeader.cs @@ -0,0 +1,46 @@ +using System; +using System.IO; + +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/Memory/UnionDataType.cs b/ReClass.NET/Memory/UnionDataType.cs index ad6cf98e..0cea977a 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,24 +46,30 @@ public struct UInt32FloatData [StructLayout(LayoutKind.Explicit)] public struct UInt64FloatDoubleData { + [FieldOffset(0)] + public int Raw1; + + [FieldOffset(4)] + public int Raw2; + [FieldOffset(0)] 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)] diff --git a/ReClass.NET/MemoryScanner/BytePattern.cs b/ReClass.NET/MemoryScanner/BytePattern.cs index ef0ca18b..3bbca9ed 100644 --- a/ReClass.NET/MemoryScanner/BytePattern.cs +++ b/ReClass.NET/MemoryScanner/BytePattern.cs @@ -4,11 +4,11 @@ using System.IO; using System.Linq; using System.Text; -using ReClassNET.Util; +using ReClassNET.Extensions; namespace ReClassNET.MemoryScanner { - public enum PatternFormat + public enum PatternMaskFormat { /// /// Example: AA BB ?? D? ?E FF @@ -17,12 +17,35 @@ public enum PatternFormat /// /// Example: \xAA\xBB\x00\x00\x00\xFF xx???x /// - PatternAndMask + Separated } public class BytePattern { - private struct PatternByte + private interface IPatternByte + { + /// + /// Gets the byte value of the pattern byte if possible. + /// + /// + byte ToByte(); + + /// + /// Compares the pattern byte with the given byte. + /// + /// + /// + bool Equals(byte b); + + /// + /// Formats the pattern byte as string. + /// + /// + /// + Tuple ToString(PatternMaskFormat format); + } + + private class PatternByte : IPatternByte { private struct Nibble { @@ -35,19 +58,9 @@ private struct Nibble public bool HasWildcard => nibble1.IsWildcard || nibble2.IsWildcard; - public byte ByteValue => !HasWildcard ? (byte)((nibble1.Value << 4) + nibble2.Value) : throw new InvalidOperationException(); - - public static PatternByte AsByte(byte b) - { - var pb = new PatternByte - { - nibble1 = { Value = (b >> 4) & 0xF }, - nibble2 = { Value = b & 0xF } - }; - return pb; - } + public byte ToByte() => !HasWildcard ? (byte)((nibble1.Value << 4) + nibble2.Value) : throw new InvalidOperationException(); - public static PatternByte AsWildcard() + public static PatternByte NewWildcardByte() { var pb = new PatternByte { @@ -104,40 +117,66 @@ public bool TryRead(StringReader sr) public bool Equals(byte b) { - var matched = 0; if (nibble1.IsWildcard || ((b >> 4) & 0xF) == nibble1.Value) { - ++matched; - } - if (nibble2.IsWildcard || (b & 0xF) == nibble2.Value) - { - ++matched; + if (nibble2.IsWildcard || (b & 0xF) == nibble2.Value) + { + return true; + } } - return matched == 2; + + return false; } - public Tuple ToString(PatternFormat format) + public Tuple ToString(PatternMaskFormat format) { switch (format) { - case PatternFormat.PatternAndMask: - return HasWildcard ? Tuple.Create("\\x00", "?") : Tuple.Create($"\\x{ByteValue:X02}", "x"); - case PatternFormat.Combined: + case PatternMaskFormat.Separated: + return HasWildcard ? Tuple.Create("\\x00", "?") : Tuple.Create($"\\x{ToByte():X02}", "x"); + case PatternMaskFormat.Combined: var sb = new StringBuilder(); if (nibble1.IsWildcard) sb.Append('?'); else sb.AppendFormat("{0:X}", nibble1.Value); if (nibble2.IsWildcard) sb.Append('?'); else sb.AppendFormat("{0:X}", nibble2.Value); - return Tuple.Create(sb.ToString(), null); + return Tuple.Create(sb.ToString(), (string)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; + } + + private class SimplePatternByte : IPatternByte + { + private readonly byte value; + + public SimplePatternByte(byte value) + { + this.value = value; + } + + public byte ToByte() => value; + + public bool Equals(byte b) => value == b; + + public Tuple ToString(PatternMaskFormat format) + { + switch (format) + { + case PatternMaskFormat.Separated: + return Tuple.Create($"\\x{ToByte():X02}", "x"); + case PatternMaskFormat.Combined: + return Tuple.Create($"{ToByte():X02}", (string)null); + default: + throw new ArgumentOutOfRangeException(nameof(format), format, null); + } + } } - private readonly List pattern = new List(); + private readonly List pattern = new List(); /// /// Gets the length of the pattern in byte. @@ -147,7 +186,12 @@ public Tuple ToString(PatternFormat format) /// /// Gets if the pattern contains wildcards. /// - public bool HasWildcards => pattern.Any(pb => pb.HasWildcard); + public bool HasWildcards => pattern.Any(pb => pb is PatternByte pb2 && pb2.HasWildcard); + + private BytePattern() + { + + } /// /// Parses the provided string for a byte pattern. Wildcards are supported by nibble. @@ -169,31 +213,60 @@ public static BytePattern Parse(string value) var pattern = new BytePattern(); - using (var sr = new StringReader(value)) + using var sr = new StringReader(value); + while (true) { var pb = new PatternByte(); - while (pb.TryRead(sr)) + if (pb.TryRead(sr)) { - pattern.pattern.Add(pb); + if (!pb.HasWildcard) + { + pattern.pattern.Add(new SimplePatternByte(pb.ToByte())); + } + else + { + 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; } + /// + /// Creates a byte pattern from the provided bytes. + /// + /// The bytes to match. + /// + public static BytePattern From(IEnumerable data) + { + var pattern = new BytePattern(); + pattern.pattern.AddRange(data.Select(b => new SimplePatternByte(b))); + return pattern; + } + + /// + /// Creates a byte pattern with wildcard support from the provided bytes. The boolean tuple item signals a wildcard. + /// + /// The byte data or the wildcard flag. + /// 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 ? PatternByte.AsWildcard() : PatternByte.AsByte(i.Item1); + var pb = isWildcard ? (IPatternByte)PatternByte.NewWildcardByte() : new SimplePatternByte(value); pattern.pattern.Add(pb); } @@ -237,36 +310,36 @@ public byte[] ToByteArray() throw new InvalidOperationException(); } - return pattern.Select(pb => pb.ByteValue).ToArray(); + return pattern.Select(pb => pb.ToByte()).ToArray(); } /// - /// 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/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 4d175d9f..10efe5cc 100644 --- a/ReClass.NET/MemoryScanner/Comparer/ByteMemoryComparer.cs +++ b/ReClass.NET/MemoryScanner/Comparer/ByteMemoryComparer.cs @@ -1,9 +1,9 @@ -using System.Diagnostics; -using ReClassNET.Util; +using System; +using System.Diagnostics; namespace ReClassNET.MemoryScanner.Comparer { - public class ByteMemoryComparer : IScanComparer + public class ByteMemoryComparer : ISimpleScanComparer { public ScanCompareType CompareType { get; } public byte Value1 { get; } @@ -14,59 +14,30 @@ 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; } 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 => CompareType switch { - 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; + 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 + ); } public bool Compare(byte[] data, int index, ScanResult previous, out ScanResult result) @@ -80,48 +51,51 @@ 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 => CompareType switch + { + 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 + ); + } - 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/DoubleMemoryComparer.cs b/ReClass.NET/MemoryScanner/Comparer/DoubleMemoryComparer.cs index e4646e9c..5e866608 100644 --- a/ReClass.NET/MemoryScanner/Comparer/DoubleMemoryComparer.cs +++ b/ReClass.NET/MemoryScanner/Comparer/DoubleMemoryComparer.cs @@ -1,10 +1,11 @@ -using System; +using System; using System.Diagnostics; -using ReClassNET.Util; +using ReClassNET.Extensions; +using ReClassNET.Util.Conversion; namespace ReClassNET.MemoryScanner.Comparer { - public class DoubleMemoryComparer : IScanComparer + public class DoubleMemoryComparer : ISimpleScanComparer { public ScanCompareType CompareType { get; } public ScanRoundMode RoundType { get; } @@ -16,18 +17,12 @@ public class DoubleMemoryComparer : IScanComparer 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; - 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); @@ -37,64 +32,39 @@ public DoubleMemoryComparer(ScanCompareType compareType, ScanRoundMode roundType minValue = value1 - 1.0 / factor; maxValue = value1 + 1.0 / factor; + + this.bitConverter = bitConverter; } - private bool CheckRoundedEquality(double value) - { - switch (RoundType) + private bool CheckRoundedEquality(double value) => + RoundType switch { - case ScanRoundMode.Strict: - return Value1.IsNearlyEqual(Math.Round(value, significantDigits, MidpointRounding.AwayFromZero)); - 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) { - result = null; - - var value = BitConverter.ToDouble(data, index); - - bool IsMatch() - { - switch (CompareType) + return CompareInternal( + data, + index, + value => CompareType switch { - 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); - } - } - - if (!IsMatch()) - { - return false; - } - - result = new DoubleScanResult(value); - - return true; + 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) + }, + out result + ); } public bool Compare(byte[] data, int index, ScanResult previous, out ScanResult result) @@ -108,48 +78,38 @@ 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; + return CompareInternal( + data, + index, + value => CompareType switch + { + 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) + }, + out result + ); + } - var value = BitConverter.ToDouble(data, index); + private bool CompareInternal(byte[] data, int index, Func matcher, out ScanResult result) + { + result = null; - bool IsMatch() - { - 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); - } - } + 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 8f7f22ba..60a3acdf 100644 --- a/ReClass.NET/MemoryScanner/Comparer/FloatMemoryComparer.cs +++ b/ReClass.NET/MemoryScanner/Comparer/FloatMemoryComparer.cs @@ -1,10 +1,11 @@ -using System; +using System; using System.Diagnostics; -using ReClassNET.Util; +using ReClassNET.Extensions; +using ReClassNET.Util.Conversion; namespace ReClassNET.MemoryScanner.Comparer { - public class FloatMemoryComparer : IScanComparer + public class FloatMemoryComparer : ISimpleScanComparer { public ScanCompareType CompareType { get; } public ScanRoundMode RoundType { get; } @@ -16,18 +17,12 @@ public class FloatMemoryComparer : IScanComparer 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; - 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); @@ -37,64 +32,39 @@ public FloatMemoryComparer(ScanCompareType compareType, ScanRoundMode roundType, minValue = value1 - 1.0f / factor; maxValue = value1 + 1.0f / factor; + + this.bitConverter = bitConverter; } - private bool CheckRoundedEquality(float value) - { - switch (RoundType) + private bool CheckRoundedEquality(float value) => + RoundType switch { - case ScanRoundMode.Strict: - return Value1.IsNearlyEqual((float)Math.Round(value, significantDigits, MidpointRounding.AwayFromZero)); - 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) { - result = null; - - var value = BitConverter.ToSingle(data, index); - - bool IsMatch() - { - switch (CompareType) + return CompareInternal( + data, + index, + value => CompareType switch { - 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); - } - } - - if (!IsMatch()) - { - return false; - } - - result = new FloatScanResult(value); - - return true; + 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) + }, + out result + ); } public bool Compare(byte[] data, int index, ScanResult previous, out ScanResult result) @@ -108,48 +78,38 @@ 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; + return CompareInternal( + data, + index, + value => CompareType switch + { + 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) + }, + out result + ); + } - var value = BitConverter.ToSingle(data, index); + private bool CompareInternal(byte[] data, int index, Func matcher, out ScanResult result) + { + result = null; - bool IsMatch() - { - 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); - } - } + var value = bitConverter.ToSingle(data, index); - if (!IsMatch()) + if (!matcher(value)) { return false; } 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/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 3a8b97ba..44b372af 100644 --- a/ReClass.NET/MemoryScanner/Comparer/IntegerMemoryComparer.cs +++ b/ReClass.NET/MemoryScanner/Comparer/IntegerMemoryComparer.cs @@ -1,73 +1,48 @@ -using System; +using System; using System.Diagnostics; -using ReClassNET.Util; +using ReClassNET.Util.Conversion; namespace ReClassNET.MemoryScanner.Comparer { - public class IntegerMemoryComparer : IScanComparer + public class IntegerMemoryComparer : ISimpleScanComparer { public ScanCompareType CompareType { get; } public int Value1 { get; } 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; - if (compareType == ScanCompareType.Between || compareType == ScanCompareType.BetweenOrEqual) - { - if (value1 > value2) - { - Utils.Swap(ref value1, ref value2); - } - } - Value1 = value1; Value2 = value2; + + this.bitConverter = bitConverter; } 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 => CompareType switch { - 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; + 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 + ); } public bool Compare(byte[] data, int index, ScanResult previous, out ScanResult result) @@ -81,48 +56,38 @@ public bool Compare(byte[] data, int index, ScanResult previous, out ScanResult public bool Compare(byte[] data, int index, IntegerScanResult previous, out ScanResult result) { - result = null; + return CompareInternal( + data, + index, + value => CompareType switch + { + 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 + ); + } - var value = BitConverter.ToInt32(data, index); + private bool CompareInternal(byte[] data, int index, Func matcher, out ScanResult result) + { + result = null; - 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); - } - } + var value = bitConverter.ToInt32(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..f95051ad 100644 --- a/ReClass.NET/MemoryScanner/Comparer/LongMemoryComparer.cs +++ b/ReClass.NET/MemoryScanner/Comparer/LongMemoryComparer.cs @@ -1,73 +1,48 @@ -using System; +using System; using System.Diagnostics; -using ReClassNET.Util; +using ReClassNET.Util.Conversion; namespace ReClassNET.MemoryScanner.Comparer { - public class LongMemoryComparer : IScanComparer + public class LongMemoryComparer : ISimpleScanComparer { public ScanCompareType CompareType { get; } public long Value1 { get; } 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; - if (compareType == ScanCompareType.Between || compareType == ScanCompareType.BetweenOrEqual) - { - if (value1 > value2) - { - Utils.Swap(ref value1, ref value2); - } - } - Value1 = value1; Value2 = value2; + + this.bitConverter = bitConverter; } 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 => CompareType switch { - 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; + 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 + ); } public bool Compare(byte[] data, int index, ScanResult previous, out ScanResult result) @@ -81,48 +56,38 @@ public bool Compare(byte[] data, int index, ScanResult previous, out ScanResult public bool Compare(byte[] data, int index, LongScanResult previous, out ScanResult result) { - result = null; + return CompareInternal( + data, + index, + value => CompareType switch + { + 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 + ); + } - var value = BitConverter.ToInt64(data, index); + private bool CompareInternal(byte[] data, int index, Func matcher, out ScanResult result) + { + result = null; - 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); - } - } + var value = bitConverter.ToInt64(data, index); - if (!IsMatch()) + if (!matcher(value)) { return false; } diff --git a/ReClass.NET/MemoryScanner/Comparer/RegexStringMemoryComparer.cs b/ReClass.NET/MemoryScanner/Comparer/RegexStringMemoryComparer.cs new file mode 100644 index 00000000..efd9d448 --- /dev/null +++ b/ReClass.NET/MemoryScanner/Comparer/RegexStringMemoryComparer.cs @@ -0,0 +1,80 @@ +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, bool caseSensitive) + { + var options = RegexOptions.Singleline | RegexOptions.Compiled; + if (!caseSensitive) + { + options |= RegexOptions.IgnoreCase; + } + + Pattern = new Regex(pattern, options); + + 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 - lastIndex) + 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/Comparer/ShortMemoryComparer.cs b/ReClass.NET/MemoryScanner/Comparer/ShortMemoryComparer.cs index 8e541704..6d8ba6a3 100644 --- a/ReClass.NET/MemoryScanner/Comparer/ShortMemoryComparer.cs +++ b/ReClass.NET/MemoryScanner/Comparer/ShortMemoryComparer.cs @@ -1,73 +1,48 @@ -using System; +using System; using System.Diagnostics; -using ReClassNET.Util; +using ReClassNET.Util.Conversion; namespace ReClassNET.MemoryScanner.Comparer { - public class ShortMemoryComparer : IScanComparer + public class ShortMemoryComparer : ISimpleScanComparer { public ScanCompareType CompareType { get; } public short Value1 { get; } 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; - if (compareType == ScanCompareType.Between || compareType == ScanCompareType.BetweenOrEqual) - { - if (value1 > value2) - { - Utils.Swap(ref value1, ref value2); - } - } - Value1 = value1; Value2 = value2; + + this.bitConverter = bitConverter; } 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 => CompareType switch { - 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; + 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 + ); } public bool Compare(byte[] data, int index, ScanResult previous, out ScanResult result) @@ -81,48 +56,38 @@ public bool Compare(byte[] data, int index, ScanResult previous, out ScanResult public bool Compare(byte[] data, int index, ShortScanResult previous, out ScanResult result) { - result = null; + return CompareInternal( + data, + index, + value => CompareType switch + { + 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 + ); + } - var value = BitConverter.ToInt16(data, index); + private bool CompareInternal(byte[] data, int index, Func matcher, out ScanResult result) + { + result = null; - 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); - } - } + var value = bitConverter.ToInt16(data, index); - if (!IsMatch()) + if (!matcher(value)) { return false; } diff --git a/ReClass.NET/MemoryScanner/Comparer/StringMemoryComparer.cs b/ReClass.NET/MemoryScanner/Comparer/StringMemoryComparer.cs index 09c6c828..c6875aba 100644 --- a/ReClass.NET/MemoryScanner/Comparer/StringMemoryComparer.cs +++ b/ReClass.NET/MemoryScanner/Comparer/StringMemoryComparer.cs @@ -1,11 +1,11 @@ -using System; +using System; using System.Diagnostics; using System.Text; -using ReClassNET.Util; +using ReClassNET.Extensions; namespace ReClassNET.MemoryScanner.Comparer { - public class StringMemoryComparer : IScanComparer + public class StringMemoryComparer : ISimpleScanComparer { public ScanCompareType CompareType => ScanCompareType.Equal; public bool CaseSensitive { get; } @@ -18,14 +18,14 @@ 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) { 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)) { diff --git a/ReClass.NET/MemoryScanner/ComplexScannerWorker.cs b/ReClass.NET/MemoryScanner/ComplexScannerWorker.cs new file mode 100644 index 00000000..fab1b22c --- /dev/null +++ b/ReClass.NET/MemoryScanner/ComplexScannerWorker.cs @@ -0,0 +1,55 @@ +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)) + { + results.Add(result); + } + } + + return results; + } + } +} 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/InputCorrelatedScanner.cs b/ReClass.NET/MemoryScanner/InputCorrelatedScanner.cs index b173fdd7..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(); } @@ -56,23 +58,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, 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(), + }; } /// @@ -81,7 +76,7 @@ private IScanComparer CreateScanComparer(ScanCompareType compareType) /// A task that represents the asynchronous operation. public Task Initialize() { - return Search(CreateScanComparer(ScanCompareType.Unknown), CancellationToken.None, null); + return Search(CreateScanComparer(ScanCompareType.Unknown), null, CancellationToken.None); } private bool shouldHaveChangedSinceLastScan = false; @@ -120,7 +115,7 @@ public async Task RefineResults(CancellationToken ct, IProgress progress) await Task.Delay(TimeSpan.FromMilliseconds(200), ct); } - await Search(CreateScanComparer(compareType), ct, progress); + await Search(CreateScanComparer(compareType), progress, ct); shouldHaveChangedSinceLastScan = false; diff --git a/ReClass.NET/MemoryScanner/MemoryRecord.cs b/ReClass.NET/MemoryScanner/MemoryRecord.cs index 5047887f..e40e3ff9 100644 --- a/ReClass.NET/MemoryScanner/MemoryRecord.cs +++ b/ReClass.NET/MemoryScanner/MemoryRecord.cs @@ -1,8 +1,9 @@ -using System; +using System; using System.ComponentModel; using System.Diagnostics.Contracts; using System.Globalization; using System.Text; +using ReClassNET.Extensions; using ReClassNET.Memory; using ReClassNET.Util; @@ -34,7 +35,7 @@ public IntPtr AddressOrOffset public IntPtr RealAddress { get; private set; } - public string AddressStr => RealAddress.ToString(Constants.StringHexFormat); + public string AddressStr => RealAddress.ToString(Constants.AddressHexFormat); public string ModuleName { @@ -101,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; @@ -176,7 +178,8 @@ public void RefreshValue(RemoteProcess process) buffer = new byte[ValueLength]; break; case ScanValueType.String: - buffer = new byte[ValueLength * Encoding.GetSimpleByteCountPerChar()]; + case ScanValueType.Regex: + buffer = new byte[ValueLength * Encoding.GuessByteCountPerChar()]; break; default: throw new InvalidOperationException(); @@ -190,24 +193,25 @@ 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); break; case ScanValueType.String: + case ScanValueType.Regex: ValueStr = FormatValue(Encoding.GetString(buffer)); break; } @@ -237,31 +241,31 @@ 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; } } 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) { 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; } } @@ -280,7 +284,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/MemoryScanner/PatternScanner.cs b/ReClass.NET/MemoryScanner/PatternScanner.cs index 33adb8dd..48e901d2 100644 --- a/ReClass.NET/MemoryScanner/PatternScanner.cs +++ b/ReClass.NET/MemoryScanner/PatternScanner.cs @@ -71,7 +71,7 @@ public static IntPtr FindPattern(BytePattern pattern, RemoteProcess process, Int /// The pattern to search. /// The data to scan. /// The index in data where the pattern was found or -1 otherwise. - private static int FindPattern(BytePattern pattern, byte[] data) + public static int FindPattern(BytePattern pattern, byte[] data) { Contract.Requires(pattern != null); Contract.Requires(data != null); diff --git a/ReClass.NET/MemoryScanner/ScanResult.cs b/ReClass.NET/MemoryScanner/ScanResult.cs index cad1b337..d46ff437 100644 --- a/ReClass.NET/MemoryScanner/ScanResult.cs +++ b/ReClass.NET/MemoryScanner/ScanResult.cs @@ -1,6 +1,8 @@ -using System; +using System; using System.Diagnostics.Contracts; +using System.Linq; using System.Text; +using ReClassNET.Extensions; namespace ReClassNET.MemoryScanner { @@ -10,13 +12,17 @@ public abstract class ScanResult public IntPtr Address { get; set; } + public abstract int ValueSize { get; } + public abstract ScanResult Clone(); } - public class ByteScanResult : ScanResult + 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) @@ -28,12 +34,29 @@ 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; + public override int ValueSize => sizeof(short); + public short Value { get; } public ShortScanResult(short value) @@ -45,12 +68,29 @@ 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; + public override int ValueSize => sizeof(int); + public int Value { get; } public IntegerScanResult(int value) @@ -62,12 +102,29 @@ 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; + public override int ValueSize => sizeof(long); + public long Value { get; } public LongScanResult(long value) @@ -79,12 +136,29 @@ 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; + public override int ValueSize => sizeof(float); + public float Value { get; } public FloatScanResult(float value) @@ -96,12 +170,29 @@ 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; + public override int ValueSize => sizeof(double); + public double Value { get; } public DoubleScanResult(double value) @@ -113,12 +204,29 @@ 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; + public override int ValueSize => Value.Length; + public byte[] Value { get; } public ArrayOfBytesScanResult(byte[] value) @@ -132,12 +240,29 @@ 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 && Value.SequenceEqual(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; + public override int ValueSize => Value.Length * Encoding.GuessByteCountPerChar(); + public string Value { get; } public Encoding Encoding { get; } @@ -155,5 +280,36 @@ 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(); + } + } + + public class RegexStringScanResult : StringScanResult + { + public override ScanValueType ValueType => ScanValueType.Regex; + + 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/ScanResultBlock.cs b/ReClass.NET/MemoryScanner/ScanResultBlock.cs index fec2991a..ab657c15 100644 --- a/ReClass.NET/MemoryScanner/ScanResultBlock.cs +++ b/ReClass.NET/MemoryScanner/ScanResultBlock.cs @@ -1,7 +1,7 @@ using System; using System.Collections.Generic; using System.Diagnostics.Contracts; -using ReClassNET.Util; +using ReClassNET.Extensions; namespace ReClassNET.MemoryScanner { diff --git a/ReClass.NET/MemoryScanner/ScanResultStore.cs b/ReClass.NET/MemoryScanner/ScanResultStore.cs index 62aee95e..e88033b8 100644 --- a/ReClass.NET/MemoryScanner/ScanResultStore.cs +++ b/ReClass.NET/MemoryScanner/ScanResultStore.cs @@ -1,9 +1,9 @@ -using System; +using System; using System.Collections.Generic; using System.Diagnostics.Contracts; using System.IO; using System.Text; -using ReClassNET.Util; +using ReClassNET.Extensions; namespace ReClassNET.MemoryScanner { @@ -129,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); } } @@ -149,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); } } @@ -211,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(); @@ -260,7 +263,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/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 } } diff --git a/ReClass.NET/MemoryScanner/Scanner.cs b/ReClass.NET/MemoryScanner/Scanner.cs index a865895c..acf8532b 100644 --- a/ReClass.NET/MemoryScanner/Scanner.cs +++ b/ReClass.NET/MemoryScanner/Scanner.cs @@ -1,10 +1,11 @@ -using System; +using System; using System.Collections.Generic; using System.Diagnostics.Contracts; using System.IO; using System.Linq; using System.Threading; using System.Threading.Tasks; +using ReClassNET.Extensions; using ReClassNET.Memory; using ReClassNET.MemoryScanner.Comparer; using ReClassNET.Util; @@ -13,6 +14,15 @@ namespace ReClassNET.MemoryScanner { public class Scanner : IDisposable { + /// + /// Helper class for consolidated memory regions. + /// + private class ConsolidatedMemoryRegion + { + public IntPtr Address { get; set; } + public int Size { get; set; } + } + private readonly RemoteProcess process; private readonly CircularBuffer stores; @@ -72,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; })); } @@ -112,48 +122,45 @@ 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 => + .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 => 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(); } @@ -163,22 +170,22 @@ private IList
GetSearchableSections() /// The results are stored in the store. ///
/// The comparer to scan for values. - /// The to stop the scan. /// The object to report the current progress. + /// The to stop the scan. /// The asynchronous result indicating if the scan completed. - public Task Search(IScanComparer comparer, CancellationToken ct, IProgress progress) + public Task Search(IScanComparer comparer, IProgress progress, CancellationToken ct) { - return isFirstScan ? FirstScan(comparer, ct, progress) : NextScan(comparer, ct, progress); + return isFirstScan ? FirstScan(comparer, progress, ct) : NextScan(comparer, progress, ct); } /// /// Starts an async first scan with the provided . /// /// The comparer to scan for values. - /// The to stop the scan. /// The object to report the current progress. + /// The to stop the scan. /// The asynchronous result indicating if the scan completed. - private Task FirstScan(IScanComparer comparer, CancellationToken ct, IProgress progress) + private Task FirstScan(IScanComparer comparer, IProgress progress, CancellationToken ct) { Contract.Requires(comparer != null); Contract.Ensures(Contract.Result>() != null); @@ -191,12 +198,14 @@ private Task FirstScan(IScanComparer comparer, CancellationToken ct, IProg return Task.FromResult(true); } - var initialBufferSize = (int)sections.Average(s => s.Size.ToInt32()); + var regions = ConsolidateSections(sections); + + var initialBufferSize = (int)(regions.Average(s => s.Size) + 1); progress?.Report(0); var counter = 0; - var totalSectionCount = (float)sections.Count; + var totalSectionCount = (float)regions.Count; return Task.Run(() => { @@ -206,40 +215,46 @@ private Task FirstScan(IScanComparer comparer, CancellationToken ct, IProg // 3. n Worker -> m Sections: Read data, search results, store results var result = Parallel.ForEach( - sections, // Sections get grouped by the framework to balance the workers. - new ParallelOptions { CancellationToken = ct}, - () => new ScannerContext(Settings, comparer, initialBufferSize), // Create a new context for every worker (thread). + regions, // Sections get grouped by the framework to balance the workers. + () => new ScannerContext(CreateWorker(Settings, comparer), initialBufferSize), // Create a new context for every worker (thread). (s, state, _, context) => { - var start = s.Start; - var size = s.Size.ToInt32(); - - if (Settings.StartAddress.InRange(s.Start, s.End)) + if (!ct.IsCancellationRequested) { - start = Settings.StartAddress; - size = size - Settings.StartAddress.Sub(s.Start).ToInt32(); - } - if (Settings.StopAddress.InRange(s.Start, s.End)) - { - size = size - s.End.Sub(Settings.StopAddress).ToInt32(); - } + var start = s.Address; + var end = s.Address + s.Size; + var size = s.Size; - context.EnsureBufferSize(size); - var buffer = context.Buffer; - if (process.ReadRemoteMemoryIntoBuffer(start, ref buffer, 0, size)) // Fill the buffer. - { - var results = context.Worker.Search(buffer, size) // Search for results. - .OrderBy(r => r.Address, IntPtrComparer.Instance) - .ToList(); - if (results.Count > 0) + if (Settings.StartAddress.IsInRange(start, end)) { - var block = CreateResultBlock(results, start, comparer.ValueSize); - store.AddBlock(block); // Store the result block. + size -= Settings.StartAddress.Sub(start).ToInt32(); + start = Settings.StartAddress; + } + if (Settings.StopAddress.IsInRange(start, end)) + { + size -= end.Sub(Settings.StopAddress).ToInt32(); } - } - progress?.Report((int)(Interlocked.Increment(ref counter) / totalSectionCount * 100)); + context.EnsureBufferSize(size); + var buffer = context.Buffer; + if (process.ReadRemoteMemoryIntoBuffer(start, ref buffer, 0, size)) // Fill the buffer. + { + var results = context.Worker.Search(buffer, size, ct) // Search for results. + .OrderBy(r => r.Address, IntPtrComparer.Instance) + .ToList(); + if (results.Count > 0) + { + var block = CreateResultBlock(results, start); + store.AddBlock(block); // Store the result block. + } + } + progress?.Report((int)(Interlocked.Increment(ref counter) / totalSectionCount * 100)); + } + else + { + state.Stop(); + } return context; }, w => { } @@ -250,14 +265,9 @@ private Task FirstScan(IScanComparer comparer, CancellationToken ct, IProg var previousStore = stores.Enqueue(store); previousStore?.Dispose(); - if (result.IsCompleted) - { - isFirstScan = false; - - return true; - } + isFirstScan = false; - return false; + return result.IsCompleted; }, ct); } @@ -266,10 +276,10 @@ private Task FirstScan(IScanComparer comparer, CancellationToken ct, IProg /// The next scan uses the previous results to refine the results. ///
/// The comparer to scan for values. - /// The to stop the scan. /// The object to report the current progress. + /// The to stop the scan. /// The asynchronous result indicating if the scan completed. - private Task NextScan(IScanComparer comparer, CancellationToken ct, IProgress progress) + private Task NextScan(IScanComparer comparer, IProgress progress, CancellationToken ct) { Contract.Requires(comparer != null); Contract.Ensures(Contract.Result>() != null); @@ -285,26 +295,31 @@ private Task NextScan(IScanComparer comparer, CancellationToken ct, IProgr { var result = Parallel.ForEach( CurrentStore.GetResultBlocks(), - new ParallelOptions { CancellationToken = ct }, - () => new ScannerContext(Settings, comparer, 0), + () => new ScannerContext(CreateWorker(Settings, comparer), 0), (b, state, _, context) => { - context.EnsureBufferSize(b.Size); - var buffer = context.Buffer; - if (process.ReadRemoteMemoryIntoBuffer(b.Start, ref buffer, 0, b.Size)) + if (!ct.IsCancellationRequested) { - var results = context.Worker.Search(buffer, buffer.Length, b.Results) - .OrderBy(r => r.Address, IntPtrComparer.Instance) - .ToList(); - if (results.Count > 0) + context.EnsureBufferSize(b.Size); + var buffer = context.Buffer; + if (process.ReadRemoteMemoryIntoBuffer(b.Start, ref buffer, 0, b.Size)) { - var block = CreateResultBlock(results, b.Start, comparer.ValueSize); - store.AddBlock(block); + var results = context.Worker.Search(buffer, buffer.Length, b.Results, ct) + .OrderBy(r => r.Address, IntPtrComparer.Instance) + .ToList(); + if (results.Count > 0) + { + var block = CreateResultBlock(results, b.Start); + store.AddBlock(block); + } } - } - - progress?.Report((int)(Interlocked.Add(ref counter, b.Results.Count) / totalResultCount * 100)); + progress?.Report((int)(Interlocked.Add(ref counter, b.Results.Count) / totalResultCount * 100)); + } + else + { + state.Stop(); + } return context; }, w => { } @@ -319,21 +334,59 @@ private Task NextScan(IScanComparer comparer, CancellationToken ct, IProgr }, ct); } + /// + /// Consolidate memory sections which are direct neighbours to reduce the number of work items. + /// + /// A list of sections. + /// A list of consolidated memory regions. + private static List ConsolidateSections(IList
sections) + { + var regions = new List(); + + if (sections.Count > 0) + { + var address = sections[0].Start; + var size = sections[0].Size.ToInt32(); + + for (var i = 1; i < sections.Count; ++i) + { + var section = sections[i]; + if (address + size != section.Start) + { + regions.Add(new ConsolidatedMemoryRegion { Address = address, Size = size }); + + address = section.Start; + size = section.Size.ToInt32(); + } + else + { + size += section.Size.ToInt32(); + } + } + + regions.Add(new ConsolidatedMemoryRegion { Address = address, Size = size }); + } + + return regions; + } + /// /// Creates a result block from the scan results and adjusts the result offset. /// /// 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); @@ -346,5 +399,19 @@ private static ScanResultBlock CreateResultBlock(IReadOnlyList resul ); return block; } + + private static IScannerWorker CreateWorker(ScanSettings settings, IScanComparer comparer) + { + if (comparer is ISimpleScanComparer simpleScanComparer) + { + return new SimpleScannerWorker(settings, simpleScanComparer); + } + if (comparer is IComplexScanComparer complexScanComparer) + { + return new ComplexScannerWorker(settings, complexScanComparer); + } + + 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 deleted file mode 100644 index 16aebabc..00000000 --- a/ReClass.NET/MemoryScanner/ScannerWorker.cs +++ /dev/null @@ -1,75 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Diagnostics.Contracts; -using ReClassNET.MemoryScanner.Comparer; - -namespace ReClassNET.MemoryScanner -{ - internal class ScannerWorker - { - private readonly ScanSettings settings; - private readonly IScanComparer comparer; - - public ScannerWorker(ScanSettings settings, IScanComparer comparer) - { - Contract.Requires(settings != null); - Contract.Requires(comparer != null); - - this.settings = settings; - this.comparer = comparer; - } - - /// - /// Uses the to scan the byte array for results. - /// - /// The data to scan. - /// The length of the parameter. - /// An enumeration of all s. - public IEnumerable Search(byte[] data, int count) - { - Contract.Requires(data != null); - - var endIndex = count - comparer.ValueSize; - - for (var i = 0; i < endIndex; i += settings.FastScanAlignment) - { - if (comparer.Compare(data, i, out var result)) - { - result.Address = (IntPtr)i; - - yield return result; - } - } - } - - /// - /// 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. - /// An enumeration of all s. - public IEnumerable Search(byte[] data, int count, IEnumerable results) - { - Contract.Requires(data != null); - Contract.Requires(results != null); - - var endIndex = count - comparer.ValueSize; - - foreach (var previous in results) - { - var offset = previous.Address.ToInt32(); - if (offset <= endIndex) - { - if (comparer.Compare(data, offset, previous, out var result)) - { - result.Address = previous.Address; - - yield return result; - } - } - } - } - } -} diff --git a/ReClass.NET/MemoryScanner/SimpleScannerWorker.cs b/ReClass.NET/MemoryScanner/SimpleScannerWorker.cs new file mode 100644 index 00000000..3c384f5d --- /dev/null +++ b/ReClass.NET/MemoryScanner/SimpleScannerWorker.cs @@ -0,0 +1,80 @@ +using System; +using System.Collections.Generic; +using System.Diagnostics.Contracts; +using System.Threading; +using ReClassNET.MemoryScanner.Comparer; + +namespace ReClassNET.MemoryScanner +{ + internal class SimpleScannerWorker : IScannerWorker + { + private readonly ScanSettings settings; + private readonly ISimpleScanComparer comparer; + + public SimpleScannerWorker(ScanSettings settings, ISimpleScanComparer comparer) + { + Contract.Requires(settings != null); + Contract.Requires(comparer != null); + + this.settings = settings; + this.comparer = comparer; + } + + public IList Search(byte[] data, int count, CancellationToken ct) + { + Contract.Requires(data != null); + + var results = new List(); + + var endIndex = count - comparer.ValueSize; + + for (var i = 0; i < endIndex; i += settings.FastScanAlignment) + { + if (ct.IsCancellationRequested) + { + break; + } + + if (comparer.Compare(data, i, out var result)) + { + result.Address = (IntPtr)i; + + results.Add(result); + } + } + + return results; + } + + public IList Search(byte[] data, int count, IEnumerable previousResults, CancellationToken ct) + { + Contract.Requires(data != null); + Contract.Requires(previousResults != null); + + var results = new List(); + + var endIndex = count - comparer.ValueSize; + + foreach (var previousResult in previousResults) + { + if (ct.IsCancellationRequested) + { + break; + } + + var offset = previousResult.Address.ToInt32(); + if (offset <= endIndex) + { + if (comparer.Compare(data, offset, previousResult, out var result)) + { + result.Address = previousResult.Address; + + results.Add(result); + } + } + } + + return results; + } + } +} 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 diff --git a/ReClass.NET/Native/NativeMethods.Windows.cs b/ReClass.NET/Native/NativeMethods.Windows.cs index ac4e15ca..f27f9184 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; @@ -6,6 +6,7 @@ using System.Text; using System.Windows.Forms; using Microsoft.Win32; +using ReClassNET.Extensions; using ReClassNET.Util; namespace ReClassNET.Native @@ -176,85 +177,27 @@ 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 + using (var icon = extensionInfoKey?.CreateSubKey("DefaultIcon")) { - extensionInfoKey?.CreateSubKey("DefaultIcon"); + icon?.SetValue(string.Empty, "\"" + applicationPath + "\",0", RegistryValueKind.String); } - catch (Exception) - { - } - - using (var icon = extensionInfoKey?.OpenSubKey("DefaultIcon", true)) - { - if (applicationPath.IndexOfAny(new[] { ' ', '\t' }) < 0) - { - icon?.SetValue(string.Empty, applicationPath + ",0", RegistryValueKind.String); - } - else - { - icon?.SetValue(string.Empty, "\"" + applicationPath + "\",0", RegistryValueKind.String); - } - } - - try - { - extensionInfoKey?.CreateSubKey("shell"); - } - catch (Exception) - { - } - using (var shellKey = extensionInfoKey?.OpenSubKey("shell", true)) + using (var shellKey = extensionInfoKey?.CreateSubKey("shell")) { - try - { - shellKey?.CreateSubKey("open"); - } - catch (Exception) + using (var openKey = shellKey?.CreateSubKey("open")) { - - } - - using (var openKey = shellKey?.OpenSubKey("open", true)) - { - 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); } @@ -283,9 +226,9 @@ public void UnregisterExtension(string fileExtension, string extensionId) ShChangeNotify(); } - catch (Exception) + catch { - + // ignored } } @@ -295,9 +238,9 @@ private static void ShChangeNotify() { SHChangeNotify(SHCNE_ASSOCCHANGED, SHCNF_IDLIST, IntPtr.Zero, IntPtr.Zero); } - catch (Exception) + catch { - + // ignored } } @@ -320,9 +263,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/ArrayNode.cs b/ReClass.NET/Nodes/ArrayNode.cs new file mode 100644 index 00000000..4a0fbec3 --- /dev/null +++ b/ReClass.NET/Nodes/ArrayNode.cs @@ -0,0 +1,40 @@ +using System; +using System.Drawing; +using ReClassNET.Controls; + +namespace ReClassNET.Nodes +{ + public class ArrayNode : BaseWrapperArrayNode + { + public ArrayNode() + { + IsReadOnly = false; + } + + public override void GetUserInterfaceInfo(out string name, out Image icon) + { + name = "Array"; + icon = Properties.Resources.B16x16_Button_Array; + } + + public override void Initialize() + { + ChangeInnerNode(IntPtr.Size == 4 ? (BaseNode)new Hex32Node() : new Hex64Node()); + } + + public override Size Draw(DrawContext context, int x, int y) + { + return Draw(context, x, y, "Array"); + } + + protected override Size DrawChild(DrawContext context, int x, int y) + { + 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(innerContext, x, y); + } + } +} diff --git a/ReClass.NET/Nodes/BaseArrayNode.cs b/ReClass.NET/Nodes/BaseArrayNode.cs deleted file mode 100644 index 2c82fb93..00000000 --- a/ReClass.NET/Nodes/BaseArrayNode.cs +++ /dev/null @@ -1,143 +0,0 @@ -using System; -using System.Diagnostics.Contracts; -using System.Drawing; -using ReClassNET.UI; - -namespace ReClassNET.Nodes -{ - [ContractClass(typeof(BaseArrayNodeContract))] - public abstract class BaseArrayNode : BaseReferenceNode - { - public int CurrentIndex { get; set; } - public int Count { get; set; } = 1; - - protected Size Draw(ViewInfo view, int x, int y, string type, HotSpotType exchange) - { - Contract.Requires(view != null); - Contract.Requires(type != null); - - if (IsHidden) - { - return DrawHidden(view, x, y); - } - - DrawInvalidMemoryIndicator(view, y); - - var origX = x; - var origY = y; - - AddSelection(view, x, y, view.Font.Height); - - x = AddOpenClose(view, x, y); - x = AddIcon(view, x, y, Icons.Array, -1, HotSpotType.None); - - var tx = x; - x = AddAddressOffset(view, x, y); - - x = AddText(view, x, y, view.Settings.TypeColor, HotSpot.NoneId, type) + view.Font.Width; - x = AddText(view, x, y, view.Settings.NameColor, HotSpot.NameId, Name); - x = AddText(view, x, y, view.Settings.IndexColor, HotSpot.NoneId, "["); - x = AddText(view, x, y, view.Settings.IndexColor, 0, Count.ToString()); - x = AddText(view, x, y, view.Settings.IndexColor, HotSpot.NoneId, "]"); - - x = AddIcon(view, x, y, Icons.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 = AddText(view, x, y, view.Settings.ValueColor, HotSpot.NoneId, $"<{InnerNode.Name} Size={MemorySize}>") + view.Font.Width; - x = AddIcon(view, x + 2, y, Icons.Change, 4, exchange); - - x += view.Font.Width; - x = AddComment(view, x, y); - - y += view.Font.Height; - - var size = new Size(x - origX, y - origY); - - if (levelsOpen[view.Level]) - { - var childSize = DrawChild(view, tx, y); - - size.Width = Math.Max(size.Width, childSize.Width + tx - origX); - size.Height += childSize.Height; - } - - AddTypeDrop(view, y); - AddDelete(view, y); - - return size; - } - - protected abstract Size DrawChild(ViewInfo view, int x, int y); - - public override int CalculateDrawnHeight(ViewInfo view) - { - if (IsHidden) - { - return HiddenHeight; - } - - var height = view.Font.Height; - if (levelsOpen[view.Level]) - { - height += InnerNode.CalculateDrawnHeight(view); - } - return height; - } - - public override void Update(HotSpot spot) - { - base.Update(spot); - - if (spot.Id == 0 || spot.Id == 1) - { - if (int.TryParse(spot.Text, out var value)) - { - if (spot.Id == 0) - { - if (value != 0) - { - Count = value; - - ParentNode.ChildHasChanged(this); - } - } - else - { - if (value < Count) - { - CurrentIndex = value; - } - } - } - } - else if (spot.Id == 2) - { - if (CurrentIndex > 0) - { - --CurrentIndex; - } - } - else if (spot.Id == 3) - { - if (CurrentIndex < Count - 1) - { - ++CurrentIndex; - } - } - } - } - - [ContractClassFor(typeof(BaseArrayNode))] - internal abstract class BaseArrayNodeContract : BaseArrayNode - { - protected override Size DrawChild(ViewInfo view, int x, int y) - { - Contract.Requires(view != null); - - throw new NotImplementedException(); - } - } -} diff --git a/ReClass.NET/Nodes/BaseClassWrapperNode.cs b/ReClass.NET/Nodes/BaseClassWrapperNode.cs new file mode 100644 index 00000000..aa50aaba --- /dev/null +++ b/ReClass.NET/Nodes/BaseClassWrapperNode.cs @@ -0,0 +1,18 @@ +namespace ReClassNET.Nodes +{ + public abstract class BaseClassWrapperNode : BaseWrapperNode + { + public override void Initialize() + { + var node = ClassNode.Create(); + node.Initialize(); + + ChangeInnerNode(node); + } + + public override bool CanChangeInnerNodeTo(BaseNode node) + { + return node is ClassNode; + } + } +} diff --git a/ReClass.NET/Nodes/BaseContainerNode.cs b/ReClass.NET/Nodes/BaseContainerNode.cs index 3c0287f4..6926111f 100644 --- a/ReClass.NET/Nodes/BaseContainerNode.cs +++ b/ReClass.NET/Nodes/BaseContainerNode.cs @@ -1,27 +1,52 @@ using System; using System.Collections.Generic; using System.Diagnostics.Contracts; -using ReClassNET.Util; namespace ReClassNET.Nodes { public abstract class BaseContainerNode : BaseNode { - [ContractInvariantMethod] - private void ObjectInvariants() + private readonly List nodes = new List(); + + private int updateCount; + + /// The child nodes of the container. + public IReadOnlyList Nodes => nodes; + + /// + /// If true and the size of replaced nodes differs, the gap will be padded with default nodes (see ). + /// + protected abstract bool ShouldCompensateSizeChanges { get; } + + /// + /// Should be called before adding a child to test if the container can handle the node type. + /// + /// The new child node. + /// True if the container can handle the child node or false otherwise. + public abstract bool CanHandleChildNode(BaseNode node); + + private void CheckCanHandleChildNode(BaseNode node) { - Contract.Invariant(nodes != null); + if (!CanHandleChildNode(node)) + { + throw new ArgumentException(); + } } - protected readonly List nodes = new List(); + public override void ClearSelection() + { + base.ClearSelection(); - /// The child nodes of the node. - public IEnumerable Nodes => nodes; + foreach (var node in Nodes) + { + node.ClearSelection(); + } + } /// Calculates the offset of every child node. - public void UpdateOffsets() + public virtual void UpdateOffsets() { - var offset = IntPtr.Zero; + var offset = 0; foreach (var node in Nodes) { node.Offset = offset; @@ -29,200 +54,312 @@ public void UpdateOffsets() } } - /// Searches for the node index. + /// Searches for the node and returns the zero based index. /// The node to search. /// The found node index or -1 if the node was not found. public int FindNodeIndex(BaseNode node) { Contract.Requires(node != null); - Contract.Ensures(Contract.Result() >= -1); + Contract.Ensures(Contract.Result() >= -1 && Contract.Result() < nodes.Count); - return Nodes.FindIndex(n => n == node); + return nodes.FindIndex(n => n == node); } - public bool ReplaceChildNode(BaseNode child, Type nodeType) + /// + /// Checks if the node exists in the container. + /// + /// The node to search. + /// True if the node exists in the container, false otherwise. + public bool ContainsNode(BaseNode node) { - Contract.Requires(nodeType != null); - Contract.Requires(nodeType.IsSubclassOf(typeof(BaseNode))); + return FindNodeIndex(node) != -1; + } - List dummy = null; - return ReplaceChildNode(child, nodeType, ref dummy); + /// + /// Tries to get the predecessor of the given node in the container. + /// + /// The root node. + /// The predecessor of the given node. + /// True if a predecessor exists, otherwise false. + public bool TryGetPredecessor(BaseNode node, out BaseNode predecessor) + { + Contract.Requires(node != null); + + return TryGetNeighbour(node, -1, out predecessor); } - public bool ReplaceChildNode(BaseNode child, Type nodeType, ref List createdNodes) + /// + /// Tries to get the successor of the given node in the container. + /// + /// The root node. + /// The successor of the given node. + /// True if a successor exists, otherwise false. + public bool TryGetSuccessor(BaseNode node, out BaseNode successor) { - Contract.Requires(child != null); - Contract.Requires(nodeType != null); - Contract.Requires(nodeType.IsSubclassOf(typeof(BaseNode))); + Contract.Requires(node != null); - return ReplaceChildNode(FindNodeIndex(child), nodeType, ref createdNodes); + return TryGetNeighbour(node, 1, out successor); } - /// Replaces the child at the specific position with the provided node. - /// Zero-based position. - /// The type of the node. - /// [in,out] A list with the created nodes. - /// True if it succeeds, false if it fails. - public virtual bool ReplaceChildNode(int index, Type nodeType, ref List createdNodes) + private bool TryGetNeighbour(BaseNode node, int offset, out BaseNode neighbour) { - Contract.Requires(nodeType != null); - Contract.Requires(nodeType.IsSubclassOf(typeof(BaseNode))); + Contract.Requires(node != null); + + neighbour = null; - if (index < 0 || index >= nodes.Count) + var index = FindNodeIndex(node); + if (index == -1) { return false; } - var oldNode = nodes[index]; - - if (!(Activator.CreateInstance(nodeType) is BaseNode node)) + var neighbourIndex = index + offset; + if (neighbourIndex < 0 || neighbourIndex >= nodes.Count) { return false; } - node.Intialize(); - node.CopyFromNode(oldNode); + neighbour = nodes[neighbourIndex]; - createdNodes?.Add(node); + return true; + } - node.ParentNode = this; + /// + /// 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. + public void ReplaceChildNode(BaseNode oldNode, BaseNode newNode) + { + Contract.Requires(oldNode != null); + Contract.Requires(newNode != null); - nodes[index] = node; + List dummy = null; + ReplaceChildNode(oldNode, newNode, ref dummy); + } + + /// Replaces the old node with the new node. + /// The old node to replacce. + /// The new node. + /// [out] A list for additional created nodes (see ) or null if not needed. + public void ReplaceChildNode(BaseNode oldNode, BaseNode newNode, ref List additionalCreatedNodes) + { + Contract.Requires(oldNode != null); + Contract.Requires(newNode != null); - var oldSize = oldNode.MemorySize; - var newSize = node.MemorySize; + CheckCanHandleChildNode(newNode); - if (newSize < oldSize) + var index = FindNodeIndex(oldNode); + if (index == -1) { - InsertBytes(index + 1, oldSize - newSize, ref createdNodes); + throw new ArgumentException($"Node {oldNode} is not a child of {this}."); } - /*else if (newSize > oldSize) + + newNode.CopyFromNode(oldNode); + + newNode.ParentNode = this; + + nodes[index] = newNode; + + if (ShouldCompensateSizeChanges) { - RemoveNodes(index + 1, newSize - oldSize); - }*/ + var oldSize = oldNode.MemorySize; + var newSize = newNode.MemorySize; - return true; + if (newSize < oldSize) + { + InsertBytes(index + 1, oldSize - newSize, ref additionalCreatedNodes); + } + /*else if (newSize > oldSize) + { + RemoveNodes(index + 1, newSize - oldSize); + }*/ + } + + OnNodesUpdated(); + } + + /// + /// Creates the default container node which takes up to bytes. + /// + /// The maximum size in bytes. + /// A new node or null if no node is available for this size. + protected virtual BaseNode CreateDefaultNodeForSize(int size) + { + Contract.Requires(size > 0); + +#if RECLASSNET64 + if (size >= 8) + { + return new Hex64Node(); + } +#endif + if (size >= 4) + { + return new Hex32Node(); + } + if (size >= 2) + { + return new Hex16Node(); + } + + return new Hex8Node(); } /// Adds the specific amount of bytes at the end of the node. /// The number of bytes to insert. public void AddBytes(int size) { - InsertBytes(nodes.Count, size); + List dummy = null; + InsertBytes(nodes.Count, size, ref dummy); } public void InsertBytes(BaseNode position, int size) - { - InsertBytes(FindNodeIndex(position), size); - } - - /// Inserts bytes at the specified position. - /// Zero-based position. - /// The number of bytes to insert. - public void InsertBytes(int index, int size) { List dummy = null; - InsertBytes(index, size, ref dummy); + InsertBytes(FindNodeIndex(position), size, ref dummy); } /// Inserts bytes at the specified position. /// Zero-based position. /// The number of bytes to insert. - /// [in,out] A list with the created nodes. - public virtual void InsertBytes(int index, int size, ref List createdNodes) + /// [out] A list with the created nodes. + protected void InsertBytes(int index, int size, ref List createdNodes) { - if (index < 0 || index > nodes.Count || size == 0) + if (index < 0 || index > nodes.Count) { - return; + throw new ArgumentOutOfRangeException($"The index {index} is not in the range [0, {nodes.Count}]."); } - var offset = IntPtr.Zero; - if (index > 0) + if (size == 0) { - var node = nodes[index - 1]; - offset = node.Offset + node.MemorySize; + return; } - while (size != 0) + while (size > 0) { - BaseNode node; -#if RECLASSNET64 - if (size >= 8) - { - node = new Hex64Node(); - } - else -#endif - if (size >= 4) - { - node = new Hex32Node(); - } - else if (size >= 2) - { - node = new Hex16Node(); - } - else + var node = CreateDefaultNodeForSize(size); + if (node == null) { - node = new Hex8Node(); + break; } node.ParentNode = this; - node.Offset = offset; nodes.Insert(index, node); createdNodes?.Add(node); - offset += node.MemorySize; size -= node.MemorySize; index++; } + + OnNodesUpdated(); + } + + /// + /// Adds all nodes at the end of the container. + /// + /// The nodes to add. + public void AddNodes(IEnumerable nodes) + { + Contract.Requires(nodes != null); + + foreach (var node in nodes) + { + AddNode(node); + } } + /// + /// Adds the node at the end of the container. + /// + /// The node to add. public void AddNode(BaseNode node) { Contract.Requires(node != null); - InsertNode(nodes.Count, node); + CheckCanHandleChildNode(node); + + node.ParentNode = this; + + nodes.Add(node); + + OnNodesUpdated(); } - public virtual void InsertNode(BaseNode position, BaseNode node) + /// + /// Inserts the node infront of the node. + /// + /// The target node. + /// The node to insert. + public void InsertNode(BaseNode position, BaseNode node) { + Contract.Requires(node != null); + + CheckCanHandleChildNode(node); + var index = FindNodeIndex(position); if (index == -1) { throw new ArgumentException(); } - InsertNode(index, node); - } - - public virtual void InsertNode(int index, BaseNode node) - { - Contract.Requires(index >= 0); - Contract.Requires(node != null); - node.ParentNode = this; nodes.Insert(index, node); + + OnNodesUpdated(); } /// Removes the specified node. /// The node to remove. /// True if it succeeds, false if it fails. - public virtual bool RemoveNode(BaseNode node) + public bool RemoveNode(BaseNode node) { Contract.Requires(node != null); - return nodes.Remove(node); + var result = nodes.Remove(node); + if (result) + { + OnNodesUpdated(); + } + return result; } /// Called by a child if it has changed. /// The child. protected internal virtual void ChildHasChanged(BaseNode child) { - + // TODO Add BaseNode.GetParentContainer } } } diff --git a/ReClass.NET/Nodes/BaseFunctionNode.cs b/ReClass.NET/Nodes/BaseFunctionNode.cs index 0da3f282..8e143585 100644 --- a/ReClass.NET/Nodes/BaseFunctionNode.cs +++ b/ReClass.NET/Nodes/BaseFunctionNode.cs @@ -1,8 +1,9 @@ -using System; +using System; using System.Collections.Generic; using System.Diagnostics.Contracts; using System.Drawing; using System.Linq; +using ReClassNET.Controls; using ReClassNET.Memory; using ReClassNET.UI; @@ -17,10 +18,10 @@ 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) + protected Size DrawInstructions(DrawContext view, int tx, int y) { Contract.Requires(view != null); @@ -31,18 +32,18 @@ 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; 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); @@ -54,20 +55,20 @@ 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; - instructions.Add(new FunctionNodeInstruction + Instructions.Add(new FunctionNodeInstruction { - Address = instruction.Address.ToString(Constants.StringHexFormat), + Address = instruction.Address.ToString(Constants.AddressHexFormat), Data = string.Join(" ", instruction.Data.Take(instruction.Length).Select(b => $"{b:X2}")), Instruction = instruction.Instruction }); diff --git a/ReClass.NET/Nodes/BaseFunctionPtrNode.cs b/ReClass.NET/Nodes/BaseFunctionPtrNode.cs index 87c632be..4fd73a2c 100644 --- a/ReClass.NET/Nodes/BaseFunctionPtrNode.cs +++ b/ReClass.NET/Nodes/BaseFunctionPtrNode.cs @@ -1,10 +1,11 @@ -using System; +using System; using System.Diagnostics.Contracts; using System.Drawing; using System.Linq; +using ReClassNET.Controls; +using ReClassNET.Extensions; using ReClassNET.Memory; using ReClassNET.UI; -using ReClassNET.Util; namespace ReClassNET.Nodes { @@ -12,111 +13,113 @@ 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)); + 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 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) + if (IsHidden && !IsWrapped) { - return DrawHidden(view, x, y); + return DrawHidden(context, x, y); } - DrawInvalidMemoryIndicator(view, y); - var origX = x; - AddSelection(view, x, y, view.Font.Height); + AddSelection(context, x, y, context.Font.Height); - x += TextPadding; + x = AddIconPadding(context, x); - x = AddIcon(view, x, y, Icons.Function, -1, 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(view, x, y, view.Settings.NameColor, HotSpot.NameId, name) + view.Font.Width; + x = AddText(context, x, y, context.Settings.TypeColor, HotSpot.NoneId, type) + context.Font.Width; + if (!IsWrapped) + { + x = AddText(context, x, y, context.Settings.NameColor, HotSpot.NameId, name) + context.Font.Width; + } - x = AddOpenClose(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.Memory.Process.GetModuleToPointer(value); + var module = context.Process.GetModuleToPointer(value); if (module != null) { - var symbols = view.Memory.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); } } } - var size = new Size(x - origX, view.Font.Height); + DrawInvalidMemoryIndicatorIcon(context, y); + AddContextDropDownIcon(context, y); + AddDeleteIcon(context, y); + + 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.Memory, 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; } - AddTypeDrop(view, y); - AddDelete(view, y); - return size; } - public override int CalculateDrawnHeight(ViewInfo 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; } - 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) + if (this.Address != address) { - instructions.Clear(); + Instructions.Clear(); - this.address = 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 5b7d97ae..f2a4053f 100644 --- a/ReClass.NET/Nodes/BaseHexCommentNode.cs +++ b/ReClass.NET/Nodes/BaseHexCommentNode.cs @@ -1,88 +1,108 @@ -using System; +using System; using System.Diagnostics.Contracts; using System.Linq; using System.Text; +using ReClassNET.Controls; +using ReClassNET.Extensions; using ReClassNET.UI; -using ReClassNET.Util; 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); if (view.Settings.ShowCommentFloat) { - x = AddText(view, x, y, view.Settings.ValueColor, HotSpot.ReadOnlyId, $"({(fvalue > -99999.0f && fvalue < 99999.0f ? fvalue : 0.0f):0.000})"); + x = AddText(view, x, y, view.Settings.ValueColor, HotSpot.ReadOnlyId, fvalue > -999999.0f && fvalue < 999999.0f ? fvalue.ToString("0.000") : "#####") + view.Font.Width; } if (view.Settings.ShowCommentInteger) { - x = AddText(view, x, y, view.Settings.ValueColor, HotSpot.ReadOnlyId, ivalue == IntPtr.Zero ? "(0)" : $"({ivalue.ToInt64()}|0x{uvalue.ToUInt64():X})"); - } - - var namedAddress = view.Memory.Process.GetNamedAddress(ivalue); - if (!string.IsNullOrEmpty(namedAddress)) - { - x += view.Font.Width; - - if (view.Settings.ShowCommentPointer) + if (ivalue == IntPtr.Zero) { - 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; + x = AddText(view, x, y, view.Settings.ValueColor, HotSpot.ReadOnlyId, "0") + view.Font.Width; } + else + { + x = AddText(view, x, y, view.Settings.ValueColor, HotSpot.ReadOnlyId, ivalue.ToInt64().ToString()) + view.Font.Width; + x = AddText(view, x, y, view.Settings.ValueColor, HotSpot.ReadOnlyId, $"0x{uvalue.ToUInt64():X}") + view.Font.Width; + } + } - if (view.Settings.ShowCommentRtti) + if (ivalue != IntPtr.Zero) + { + var namedAddress = view.Process.GetNamedAddress(ivalue); + if (!string.IsNullOrEmpty(namedAddress)) { - var rtti = view.Memory.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.Memory.Process.GetModuleToPointer(ivalue); - if (module != null) + if (view.Settings.ShowCommentRtti) { - var symbols = view.Memory.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.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 (view.Settings.ShowCommentSymbol) { - 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; + 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).InterpretAsUtf16().IsPrintableData()) + + if (view.Settings.ShowCommentString) { - 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; - } - } + var data = view.Process.ReadRemoteMemory(ivalue, 64); - if (view.Settings.ShowCommentPluginInfo) - { - var nodeAddress = view.Address.Add(Offset); + 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()) + { + text = new string(Encoding.UTF8.GetChars(data).TakeWhile(c => c != 0).ToArray()); + } + else if (data.Take(IntPtr.Size * 2).InterpretAsDoubleByteCharacter().IsPrintableData()) + { + isWideString = true; - foreach (var reader in NodeInfoReader) + 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; + } + } + + if (view.Settings.ShowCommentPluginInfo) { - var info = reader.ReadNodeInfo(this, nodeAddress, ivalue, view.Memory); - 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; + } } } } diff --git a/ReClass.NET/Nodes/BaseHexNode.cs b/ReClass.NET/Nodes/BaseHexNode.cs index 63af0014..060db7da 100644 --- a/ReClass.NET/Nodes/BaseHexNode.cs +++ b/ReClass.NET/Nodes/BaseHexNode.cs @@ -1,8 +1,10 @@ -using System; +using System; using System.Collections.Generic; using System.Diagnostics.Contracts; using System.Drawing; using System.Globalization; +using ReClassNET.Controls; +using ReClassNET.Extensions; using ReClassNET.Memory; using ReClassNET.UI; using ReClassNET.Util; @@ -11,8 +13,13 @@ namespace ReClassNET.Nodes { public abstract class BaseHexNode : BaseNode { - public static DateTime CurrentHighlightTime; - public static readonly TimeSpan HightlightDuration = TimeSpan.FromSeconds(1); + private static readonly Random highlightRandom = new Random(); + private static readonly Color[] highlightColors = { + Color.Aqua, Color.Aquamarine, Color.Blue, Color.BlueViolet, Color.Chartreuse, Color.Crimson, Color.LawnGreen, Color.Magenta + }; + private static Color GetRandomHighlightColor() => highlightColors[highlightRandom.Next(highlightColors.Length)]; + + private static readonly TimeSpan hightlightDuration = TimeSpan.FromSeconds(1); private static readonly Dictionary> highlightTimer = new Dictionary>(); @@ -25,74 +32,75 @@ protected BaseHexNode() buffer = new byte[MemorySize]; } - protected Size Draw(ViewInfo 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) + if (IsHidden && !IsWrapped) { - return DrawHidden(view, x, y); + return DrawHidden(context, x, y); } - DrawInvalidMemoryIndicator(view, y); - var origX = x; - AddSelection(view, x, y, view.Font.Height); + AddSelection(context, x, y, context.Font.Height); + + x = AddIconPadding(context, x); + x = AddIconPadding(context, x); - x += TextPadding + 16; - 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.Add(Offset); + var address = context.Address + Offset; - highlightTimer.RemoveWhere(kv => kv.Value.Value < CurrentHighlightTime); + highlightTimer.RemoveWhere(kv => kv.Value.Value < context.CurrentTime); if (highlightTimer.TryGetValue(address, out var until)) { - if (until.Value >= CurrentHighlightTime) + if (until.Value >= context.CurrentTime) { - color = view.Settings.HighlightColor; + color = GetRandomHighlightColor(); - if (view.Memory.HasChanged(Offset, MemorySize)) + if (context.Memory.HasChanged(Offset, MemorySize)) { - until.Value = CurrentHighlightTime.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, CurrentHighlightTime.Add(HightlightDuration)); + highlightTimer.Add(address, context.CurrentTime.Add(hightlightDuration)); - color = view.Settings.HighlightColor; + color = GetRandomHighlightColor(); } } 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); - AddTypeDrop(view, y); - AddDelete(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 context) { - return IsHidden ? 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. @@ -108,7 +116,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 d289b286..84929c5e 100644 --- a/ReClass.NET/Nodes/BaseMatrixNode.cs +++ b/ReClass.NET/Nodes/BaseMatrixNode.cs @@ -1,5 +1,8 @@ -using System.Diagnostics.Contracts; +using System; +using System.Diagnostics.Contracts; using System.Drawing; +using ReClassNET.Controls; +using ReClassNET.Extensions; using ReClassNET.UI; namespace ReClassNET.Nodes @@ -11,115 +14,149 @@ public abstract class BaseMatrixNode : BaseNode protected BaseMatrixNode() { - levelsOpen.DefaultValue = true; + LevelsOpen.DefaultValue = true; } 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 context, int x, int y, string type, int rows, int columns) { - Contract.Requires(view != null); + Contract.Requires(context != null); Contract.Requires(type != null); - Contract.Requires(drawValues != null); - if (IsHidden) + if (IsHidden && !IsWrapped) { - return DrawHidden(view, x, y); + return DrawHidden(context, x, y); } - DrawInvalidMemoryIndicator(view, y); - var origX = x; var origY = y; - AddSelection(view, x, y, view.Font.Height); + AddSelection(context, x, y, context.Font.Height); - x += TextPadding; + x = AddIconPadding(context, x); - x = AddIcon(view, x, y, Icons.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(view, x, y, view.Settings.NameColor, HotSpot.NameId, Name); - x = AddOpenClose(view, x, y); + x = AddText(context, x, y, context.Settings.TypeColor, HotSpot.NoneId, type) + context.Font.Width; + if (!IsWrapped) + { + x = AddText(context, x, y, context.Settings.NameColor, HotSpot.NameId, Name); + } + x = AddOpenCloseIcon(context, x, y); - x += view.Font.Width; + x += context.Font.Width; - x = AddComment(view, x, y); + x = AddComment(context, x, y); - if (levelsOpen[view.Level]) + DrawInvalidMemoryIndicatorIcon(context, y); + AddContextDropDownIcon(context, y); + AddDeleteIcon(context, y); + + 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++; + } - AddTypeDrop(view, y); - AddDelete(view, y); + x2 = AddText(context, x2, y, context.Settings.NameColor, HotSpot.NoneId, "|"); - return new Size(x - origX, y - origY + view.Font.Height); + 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(ViewInfo view, int x, int y, string type, DrawVectorValues drawValues) + protected Size DrawVectorType(DrawContext context, int x, int y, string type, int columns) { - Contract.Requires(view != null); + Contract.Requires(context != null); Contract.Requires(type != null); - Contract.Requires(drawValues != null); - if (IsHidden) + if (IsHidden && !IsWrapped) { - return DrawHidden(view, x, y); + return DrawHidden(context, x, y); } - DrawInvalidMemoryIndicator(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 += TextPadding; + x = AddIconPadding(context, x); - x = AddIcon(view, x, y, Icons.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(view, x, y, view.Settings.NameColor, HotSpot.NameId, Name); - x = AddOpenClose(view, x, y); + x = AddText(context, x, y, context.Settings.TypeColor, HotSpot.NoneId, type) + context.Font.Width; + if (!IsWrapped) + { + x = AddText(context, x, y, context.Settings.NameColor, HotSpot.NameId, Name); + } + x = AddOpenCloseIcon(context, x, y); - if (levelsOpen[view.Level]) + 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 += view.Font.Width; + x += context.Font.Width; - x = AddComment(view, x, y); + x = AddComment(context, x, y); - AddTypeDrop(view, y); - AddDelete(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(ViewInfo view) + public override int CalculateDrawnHeight(DrawContext context) { - if (IsHidden) + 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(ViewInfo view); + protected abstract int CalculateValuesHeight(DrawContext context); public void Update(HotSpot spot, int max) { @@ -131,7 +168,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 ef246ffc..adef39e5 100644 --- a/ReClass.NET/Nodes/BaseNode.cs +++ b/ReClass.NET/Nodes/BaseNode.cs @@ -1,9 +1,10 @@ -using System; +using System; using System.Collections.Generic; using System.Diagnostics; using System.Diagnostics.Contracts; using System.Drawing; -using ReClassNET.Memory; +using ReClassNET.Controls; +using ReClassNET.Extensions; using ReClassNET.UI; using ReClassNET.Util; @@ -15,12 +16,11 @@ 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(); - protected static readonly int TextPadding = Icons.Dimensions; - protected static readonly int HiddenHeight = 1; + protected static readonly int HiddenHeight = 0; private static int nodeIndex = 0; @@ -28,7 +28,7 @@ public abstract class BaseNode private string comment = string.Empty; /// Gets or sets the offset of the node. - public IntPtr Offset { get; set; } + public int Offset { get; set; } /// Gets or sets the name of the node. If a new name was set the property changed event gets fired. public virtual string Name { get => name; set { if (value != null && name != value) { name = value; NameChanged?.Invoke(this); } } } @@ -37,12 +37,15 @@ public abstract class BaseNode public string Comment { get => comment; set { if (value != null && comment != value) { comment = value; CommentChanged?.Invoke(this); } } } /// Gets or sets the parent node. - public BaseContainerNode ParentNode { get; internal set; } + public BaseNode ParentNode { get; internal set; } - /// Gets or sets a value indicating whether this object is hidden. - public bool IsHidden { get; protected set; } + /// Gets a value indicating whether this node is wrapped into an other node. + public bool IsWrapped => ParentNode is BaseWrapperNode; - /// Gets or sets a value indicating whether this object is selected. + /// Gets or sets a value indicating whether this node is hidden. + public bool IsHidden { get; set; } + + /// Gets or sets a value indicating whether this node is selected. public bool IsSelected { get; set; } /// Size of the node in bytes. @@ -51,15 +54,41 @@ public abstract class BaseNode public event NodeEventHandler NameChanged; public event NodeEventHandler CommentChanged; - protected readonly GrowingList levelsOpen = new GrowingList(false); + protected GrowingList LevelsOpen { get; } = new GrowingList(false); [ContractInvariantMethod] private void ObjectInvariants() { Contract.Invariant(name != null); Contract.Invariant(comment != null); - Contract.Invariant(Offset.ToInt32() >= 0); - Contract.Invariant(levelsOpen != null); + Contract.Invariant(Offset >= 0); + Contract.Invariant(LevelsOpen != null); + } + + /// + /// Creates an instance of the specific node type. + /// + /// The of the node. + /// An instance of the node type or null if the type is not a valid node type. + public static BaseNode CreateInstanceFromType(Type nodeType) + { + return CreateInstanceFromType(nodeType, true); + } + + /// + /// Creates an instance of the specific node type. + /// + /// The of the node. + /// If true gets called for the new node. + /// An instance of the node type or null if the type is not a valid node type. + public static BaseNode CreateInstanceFromType(Type nodeType, bool callInitialize) + { + var node = Activator.CreateInstance(nodeType) as BaseNode; + if (callInitialize) + { + node?.Initialize(); + } + return node; } /// Constructor which sets a unique . @@ -71,13 +100,34 @@ protected BaseNode() Name = $"N{nodeIndex++:X08}"; Comment = string.Empty; - levelsOpen[0] = true; + LevelsOpen[0] = true; } - /// Clears the selection of the node. - public virtual void ClearSelection() + public abstract void GetUserInterfaceInfo(out string name, out Image icon); + + public virtual bool UseMemoryPreviewToolTip(HotSpot spot, out IntPtr address) { - IsSelected = false; + Contract.Requires(spot != null); + + address = IntPtr.Zero; + + return false; + } + + /// Gets informations about this node to show in a tool tip. + /// The spot. + /// The information to show in a tool tip or null if no information should be shown. + public virtual string GetToolTipText(HotSpot spot) + { + Contract.Requires(spot != null); + + return null; + } + + /// Called when the node was created. Does not get called after loading a project. + public virtual void Initialize() + { + } /// Initializes this object from the given node. It copies the name and the comment. @@ -88,52 +138,103 @@ public virtual void CopyFromNode(BaseNode node) Name = node.Name; Comment = node.Comment; + Offset = node.Offset; } - - /// Called when the node was created. Does not get called after loading a project. - public virtual void Intialize() + /// + /// Gets the parent container of the node. + /// + /// + public BaseContainerNode GetParentContainer() { + var parentNode = ParentNode; + while (parentNode != null) + { + if (parentNode is BaseContainerNode containerNode) + { + return containerNode; + } + + parentNode = parentNode.ParentNode; + } + + if (this is BaseContainerNode containerNode2) + { + return containerNode2; + } + return null; } - public virtual bool UseMemoryPreviewToolTip(HotSpot spot, MemoryBuffer memory, out IntPtr address) + /// + /// Gets the parent class of the node. + /// + /// + public ClassNode GetParentClass() { - Contract.Requires(spot != null); - Contract.Requires(memory != null); + var parentNode = ParentNode; + while (parentNode != null) + { + if (parentNode is ClassNode classNode) + { + return classNode; + } - address = IntPtr.Zero; + parentNode = parentNode.ParentNode; + } - return false; + return null; } - /// 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) + /// + /// Gets the root wrapper node if this node is the inner node of a wrapper chain. + /// + /// The root or null if this node is not wrapped or isn't itself a wrapper node. + public BaseWrapperNode GetRootWrapperNode() { - Contract.Requires(spot != null); - Contract.Requires(memory != null); + BaseWrapperNode rootWrapperNode = null; - return null; + var parentNode = ParentNode; + while (parentNode is BaseWrapperNode wrapperNode) + { + rootWrapperNode = wrapperNode; + + parentNode = parentNode.ParentNode; + } + + // Test if this node is the root wrapper node. + if (rootWrapperNode == null) + { + if (this is BaseWrapperNode wrapperNode) + { + return wrapperNode; + } + } + + return rootWrapperNode; + } + + /// Clears the selection of the node. + public virtual void ClearSelection() + { + IsSelected = false; } /// 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 context); /// Updates the node from the given . Sets the and of the node. /// The spot. @@ -155,7 +256,7 @@ public virtual void Update(HotSpot spot) /// The level to toggle. internal void ToggleLevelOpen(int level) { - levelsOpen[level] = !levelsOpen[level]; + LevelsOpen[level] = !LevelsOpen[level]; } /// Sets the specific level. @@ -163,68 +264,69 @@ internal void ToggleLevelOpen(int level) /// True to open. internal void SetLevelOpen(int level, bool open) { - levelsOpen[level] = open; + LevelsOpen[level] = 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 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.Add(Offset), + Address = context.Address + Offset, Id = id, Type = type, Node = this, - Level = view.Level, - Memory = view.Memory + Level = context.Level, + Process = context.Process, + Memory = context.Memory }); } /// 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 context, int x, int y, Color color, int hitId, string text) { - Contract.Requires(view != null); - Contract.Requires(view.Context != 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.Context.DrawStringEx(text, view.Font.Font, color, x, y); + context.Graphics.DrawStringEx(text, context.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); }*/ } @@ -232,183 +334,190 @@ 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 context, int x, int y) { - Contract.Requires(view != null); - Contract.Requires(view.Context != 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.ToInt32():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.Add(Offset).ToString(Constants.StringHexFormat)) + 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 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 context, int x, int y, int height) { - Contract.Requires(view != null); - Contract.Requires(view.Context != null); + Contract.Requires(context != null); + Contract.Requires(context.Graphics != null); - if (y > view.ClientArea.Bottom || y + height < 0) + if (y > context.ClientArea.Bottom || y + height < 0 || IsWrapped) { return; } 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(context.Settings.SelectedColor); + + 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, -1, 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) + { + 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 context, int x, int y, Image icon, int id, HotSpotType type) { - Contract.Requires(view != null); - Contract.Requires(view.Context != null); + Contract.Requires(context != null); + Contract.Requires(context.Graphics != null); Contract.Requires(icon != null); - if (y > view.ClientArea.Bottom || y + Icons.Dimensions < 0) + var size = context.IconProvider.Dimensions; + + if (y > context.ClientArea.Bottom || y + size < 0) { - return x + Icons.Dimensions; + return x + size; } - view.Context.DrawImage(icon, x + 2, y, Icons.Dimensions, Icons.Dimensions); + context.Graphics.DrawImage(icon, x + 2, y, size, size); - if (id != -1) + if (id != HotSpot.NoneId) { - AddHotSpot(view, new Rectangle(x, y, Icons.Dimensions, Icons.Dimensions), string.Empty, id, type); + AddHotSpot(context, new Rectangle(x, y, size, size), string.Empty, id, type); } - return x + Icons.Dimensions; + return x + size; } /// 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 AddOpenClose(ViewInfo view, int x, int y) + protected int AddOpenCloseIcon(DrawContext context, int x, int y) { - Contract.Requires(view != null); - Contract.Requires(view.Context != null); + Contract.Requires(context != null); + Contract.Requires(context.Graphics != null); - if (y > view.ClientArea.Bottom || y + Icons.Dimensions < 0) + if (y > context.ClientArea.Bottom || y + context.IconProvider.Dimensions < 0) { - return x + Icons.Dimensions; + return x + context.IconProvider.Dimensions; } - return AddIcon(view, x, y, levelsOpen[view.Level] ? Icons.OpenCloseOpen : Icons.OpenCloseClosed, 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 type drop icon if the node is selected. - /// The view information. + /// Draws a context drop icon if the node is selected. + /// The drawing context. /// The y coordinate. - protected void AddTypeDrop(ViewInfo view, int y) + protected void AddContextDropDownIcon(DrawContext context, int y) { - Contract.Requires(view != null); - Contract.Requires(view.Context != null); + Contract.Requires(context != null); + Contract.Requires(context.Graphics != null); - if (view.MultipleNodesSelected || (y > view.ClientArea.Bottom || y + Icons.Dimensions < 0)) + if (context.MultipleNodesSelected || y > context.ClientArea.Bottom || y + context.IconProvider.Dimensions < 0 || IsWrapped) { return; } if (IsSelected) { - AddIcon(view, 0, y, Icons.DropArrow, 0, HotSpotType.Drop); + AddIcon(context, 0, y, context.IconProvider.DropArrow, 0, HotSpotType.Context); } } /// Draws a delete icon if the node is selected. - /// The view information. + /// The drawing context. /// The y coordinate. - protected void AddDelete(ViewInfo view, int y) + protected void AddDeleteIcon(DrawContext context, int y) { - Contract.Requires(view != null); - Contract.Requires(view.Context != null); + Contract.Requires(context != null); + Contract.Requires(context.Graphics != null); - if (y > view.ClientArea.Bottom || y + Icons.Dimensions < 0) + if (y > context.ClientArea.Bottom || y + context.IconProvider.Dimensions < 0 || IsWrapped) { return; } if (IsSelected) { - AddIcon(view, view.ClientArea.Right - Icons.Dimensions, y, Icons.Delete, 0, HotSpotType.Delete); + AddIcon(context, context.ClientArea.Right - context.IconProvider.Dimensions, y, context.IconProvider.Delete, 0, HotSpotType.Delete); } } /// 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 context, int x, int y) { - Contract.Requires(view != null); - Contract.Requires(view.Context != 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 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 context, int x, int y) { - Contract.Requires(view != null); - Contract.Requires(view.Context != 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.Context.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 view information. + /// The drawing context. /// The y coordinate. - protected void DrawInvalidMemoryIndicator(ViewInfo view, int y) + protected void DrawInvalidMemoryIndicatorIcon(DrawContext context, int y) { - if (!view.Memory.ContainsValidData) + if (!context.Memory.ContainsValidData) { - view.Context.DrawImage(Properties.Resources.B16x16_Error, 2, y); + AddIcon(context, 0, y, Properties.Resources.B16x16_Error, HotSpot.NoneId, HotSpotType.None); } } } @@ -426,16 +535,16 @@ 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 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 1bdb0dfe..61782ca6 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 @@ -7,52 +8,59 @@ 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. /// The type of the node. /// 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) + 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) + if (IsHidden && !IsWrapped) { - return DrawHidden(view, x, y); + return DrawHidden(context, x, y); } - DrawInvalidMemoryIndicator(view, y); - var origX = x; - AddSelection(view, x, y, view.Font.Height); + AddSelection(context, x, y, context.Font.Height); - x += TextPadding; + 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(view, x, y, view.Settings.NameColor, HotSpot.NameId, Name) + view.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.TypeColor, HotSpot.NoneId, type) + context.Font.Width; + if (!IsWrapped) + { + x = AddText(context, x, y, context.Settings.NameColor, HotSpot.NameId, Name) + context.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(context, x, y, context.Settings.ValueColor, 1, alternativeValue) + context.Font.Width; + } - x = AddComment(view, x, y); + x = AddComment(context, x, y); - AddTypeDrop(view, y); - AddDelete(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 context) { - return IsHidden ? HiddenHeight : view.Font.Height; + return IsHidden && !IsWrapped ? HiddenHeight : context.Font.Height; } } } diff --git a/ReClass.NET/Nodes/BaseReferenceNode.cs b/ReClass.NET/Nodes/BaseReferenceNode.cs deleted file mode 100644 index 096ba1a8..00000000 --- a/ReClass.NET/Nodes/BaseReferenceNode.cs +++ /dev/null @@ -1,32 +0,0 @@ -using System.Diagnostics.Contracts; - -namespace ReClassNET.Nodes -{ - public abstract class BaseReferenceNode : BaseNode - { - /// Gets or sets the inner node. - public ClassNode InnerNode { get; protected set; } - - /// Gets signaled if the inner node was changed. - public event NodeEventHandler InnerNodeChanged; - - /// True to perform class cycle checks when changing the inner node. - public abstract bool PerformCycleCheck { get; } - - /// Changes the inner node. - /// The new node. - public void ChangeInnerNode(ClassNode node) - { - Contract.Requires(node != null); - - if (InnerNode != node) - { - InnerNode = node; - - InnerNodeChanged?.Invoke(this); - - ParentNode?.ChildHasChanged(this); - } - } - } -} diff --git a/ReClass.NET/Nodes/BaseTextNode.cs b/ReClass.NET/Nodes/BaseTextNode.cs index 015e75e0..d395b24d 100644 --- a/ReClass.NET/Nodes/BaseTextNode.cs +++ b/ReClass.NET/Nodes/BaseTextNode.cs @@ -1,69 +1,77 @@ -using System; using System.Diagnostics.Contracts; using System.Drawing; +using System.Text; +using ReClassNET.Controls; +using ReClassNET.Extensions; +using ReClassNET.Memory; using ReClassNET.UI; -using ReClassNET.Util; namespace ReClassNET.Nodes { - [ContractClass(typeof(BaseTextNodeContract))] public abstract class BaseTextNode : BaseNode { public int Length { get; set; } - /// Size of the node in bytes. public override int MemorySize => Length * CharacterSize; + /// The encoding of the string. + public abstract Encoding Encoding { get; } + /// Size of one character in bytes. - public abstract int CharacterSize { get; } + private int CharacterSize => Encoding.GuessByteCountPerChar(); public override void CopyFromNode(BaseNode node) { Length = node.MemorySize / CharacterSize; } - protected Size DrawText(ViewInfo view, int x, int y, string type, int length, string text) + protected Size DrawText(DrawContext context, int x, int y, string type) { - Contract.Requires(view != null); + Contract.Requires(context != null); Contract.Requires(type != null); - Contract.Requires(text != null); - if (IsHidden) + if (IsHidden && !IsWrapped) { - return DrawHidden(view, x, y); + return DrawHidden(context, x, y); } - DrawInvalidMemoryIndicator(view, y); + var length = MemorySize / CharacterSize; + var text = ReadValueFromMemory(context.Memory); var origX = x; - AddSelection(view, x, y, view.Font.Height); + AddSelection(context, x, y, context.Font.Height); + + x = AddIconPadding(context, x); - x += TextPadding; - x = AddIcon(view, x, y, Icons.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(view, x, y, view.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.TypeColor, HotSpot.NoneId, type) + context.Font.Width; + if (!IsWrapped) + { + x = AddText(context, x, y, context.Settings.NameColor, HotSpot.NameId, Name); + } + 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, HotSpot.NoneId, 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); - AddTypeDrop(view, y); - AddDelete(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 context) { - return IsHidden ? HiddenHeight : view.Font.Height; + return IsHidden && !IsWrapped ? HiddenHeight : context.Font.Height; } public override void Update(HotSpot spot) @@ -76,23 +84,19 @@ public override void Update(HotSpot spot) { Length = val; - ParentNode.ChildHasChanged(this); + GetParentContainer()?.ChildHasChanged(this); } } + else if (spot.Id == 1) + { + var data = Encoding.GetBytes(spot.Text); + spot.Process.WriteRemoteMemory(spot.Address, data); + } } - } - [ContractClassFor(typeof(BaseTextNode))] - internal abstract class BaseTextNodeContract : BaseTextNode - { - public override int CharacterSize + public string ReadValueFromMemory(MemoryBuffer memory) { - get - { - Contract.Ensures(Contract.Result() > 0); - - throw new NotImplementedException(); - } + return memory.ReadString(Encoding, Offset, MemorySize); } } } diff --git a/ReClass.NET/Nodes/BaseTextPtrNode.cs b/ReClass.NET/Nodes/BaseTextPtrNode.cs index 2cd003b6..d7b00238 100644 --- a/ReClass.NET/Nodes/BaseTextPtrNode.cs +++ b/ReClass.NET/Nodes/BaseTextPtrNode.cs @@ -1,60 +1,72 @@ -using System; +using System; using System.Diagnostics.Contracts; using System.Drawing; +using System.Text; +using ReClassNET.Controls; +using ReClassNET.Extensions; using ReClassNET.UI; namespace ReClassNET.Nodes { public abstract class BaseTextPtrNode : BaseNode { + private const int MaxStringCharacterCount = 256; + public override int MemorySize => IntPtr.Size; + /// The encoding of the string. + 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 text. /// The pixel size the node occupies. - public Size DrawText(ViewInfo view, int x, int y, string type, string text) + public Size DrawText(DrawContext context, int x, int y, string type) { - Contract.Requires(view != null); + Contract.Requires(context != null); Contract.Requires(type != null); - Contract.Requires(text != null); - if (IsHidden) + if (IsHidden && !IsWrapped) { - return DrawHidden(view, x, y); + return DrawHidden(context, x, y); } - DrawInvalidMemoryIndicator(view, y); + var ptr = context.Memory.ReadIntPtr(Offset); + var text = context.Process.ReadRemoteString(ptr, Encoding, MaxStringCharacterCount); var origX = x; - AddSelection(view, x, y, view.Font.Height); + AddSelection(context, x, y, context.Font.Height); + + x = AddIconPadding(context, x); - x += TextPadding; - x = AddIcon(view, x, y, Icons.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(view, x, y, view.Settings.NameColor, HotSpot.NameId, Name) + view.Font.Width; + x = AddText(context, x, y, context.Settings.TypeColor, HotSpot.NoneId, type) + context.Font.Width; + if (!IsWrapped) + { + 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.NoneId, 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); - AddTypeDrop(view, y); - AddDelete(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 context) { - return IsHidden ? 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 new file mode 100644 index 00000000..ee042751 --- /dev/null +++ b/ReClass.NET/Nodes/BaseWrapperArrayNode.cs @@ -0,0 +1,152 @@ +using System; +using System.Drawing; +using ReClassNET.Controls; +using ReClassNET.UI; + +namespace ReClassNET.Nodes +{ + public abstract class BaseWrapperArrayNode : BaseWrapperNode + { + public override int MemorySize => InnerNode.MemorySize * Count; + + public int CurrentIndex { get; set; } + public int Count { get; set; } = 1; + public bool IsReadOnly { get; protected set; } + + protected override bool PerformCycleCheck => true; + + public override bool CanChangeInnerNodeTo(BaseNode node) + { + switch (node) + { + case null: + case ClassNode _: + case VirtualMethodNode _: + return false; + } + + return true; + } + + protected Size Draw(DrawContext context, int x, int y, string type) + { + if (IsHidden && !IsWrapped) + { + return DrawHidden(context, x, y); + } + + var origX = x; + + AddSelection(context, x, y, context.Font.Height); + + x = AddOpenCloseIcon(context, x, y); + x = AddIcon(context, x, y, context.IconProvider.Array, HotSpot.NoneId, HotSpotType.None); + + var tx = x; + x = AddAddressOffset(context, x, y); + + x = AddText(context, x, y, context.Settings.TypeColor, HotSpot.NoneId, type) + context.Font.Width; + if (!IsWrapped) + { + x = AddText(context, x, y, context.Settings.NameColor, HotSpot.NameId, Name); + } + 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(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(context, x, y, context.Settings.ValueColor, HotSpot.NoneId, $"") + context.Font.Width; + x = AddIcon(context, x + 2, y, context.IconProvider.Change, 4, HotSpotType.ChangeWrappedType); + + x += context.Font.Width; + x = AddComment(context, x, y); + + DrawInvalidMemoryIndicatorIcon(context, y); + AddContextDropDownIcon(context, y); + AddDeleteIcon(context, y); + + y += context.Font.Height; + + var size = new Size(x - origX, context.Font.Height); + + if (LevelsOpen[context.Level]) + { + var childSize = DrawChild(context, tx, y); + + size.Width = Math.Max(size.Width, childSize.Width + tx - origX); + size.Height += childSize.Height; + } + + return size; + } + + protected abstract Size DrawChild(DrawContext context, int x, int y); + + public override int CalculateDrawnHeight(DrawContext context) + { + if (IsHidden && !IsWrapped) + { + return HiddenHeight; + } + + var height = context.Font.Height; + if (LevelsOpen[context.Level]) + { + height += InnerNode.CalculateDrawnHeight(context); + } + return height; + } + + public override void Update(HotSpot spot) + { + base.Update(spot); + + if (spot.Id == 0 || spot.Id == 1) + { + if (int.TryParse(spot.Text, out var value)) + { + if (spot.Id == 0 && !IsReadOnly) + { + if (value != 0) + { + Count = value; + + if (CurrentIndex >= value) + { + CurrentIndex = value - 1; + } + + GetParentContainer()?.ChildHasChanged(this); + } + } + else + { + if (value < Count) + { + CurrentIndex = value; + } + } + } + } + else if (spot.Id == 2) + { + if (CurrentIndex > 0) + { + --CurrentIndex; + } + } + else if (spot.Id == 3) + { + if (CurrentIndex < Count - 1) + { + ++CurrentIndex; + } + } + } + } +} diff --git a/ReClass.NET/Nodes/BaseWrapperNode.cs b/ReClass.NET/Nodes/BaseWrapperNode.cs new file mode 100644 index 00000000..b499f0ce --- /dev/null +++ b/ReClass.NET/Nodes/BaseWrapperNode.cs @@ -0,0 +1,112 @@ +using System; + +namespace ReClassNET.Nodes +{ + public abstract class BaseWrapperNode : BaseNode + { + /// Gets or sets the inner node. + public BaseNode InnerNode { get; private set; } + + /// Gets signaled if the inner node was changed. + public event NodeEventHandler InnerNodeChanged; + + /// True to perform class cycle checks when changing the inner node. + protected abstract bool PerformCycleCheck { get; } + + /// + /// Should be called before to test if the node can handle the inner node type. + /// + /// The new inner node type. + /// True if the class can handle the inner node type or false otherwise. + public abstract bool CanChangeInnerNodeTo(BaseNode node); + + /// Changes the inner node. + /// The new node. + public void ChangeInnerNode(BaseNode node) + { + if (!CanChangeInnerNodeTo(node)) + { + throw new InvalidOperationException($"Can't change inner node to '{node?.GetType().ToString() ?? "null"}'"); + } + + if (InnerNode != node) + { + InnerNode = node; + + if (node != null) + { + node.ParentNode = this; + } + + InnerNodeChanged?.Invoke(this); + + GetParentContainer()?.ChildHasChanged(this); + } + } + + /// + /// Resolve the most inner node of a chain. + /// + /// The most inner node or null. + public BaseNode ResolveMostInnerNode() + { + if (InnerNode == null) + { + return null; + } + if (InnerNode is BaseWrapperNode baseWrapperNode) + { + return baseWrapperNode.ResolveMostInnerNode(); + } + return InnerNode; + } + + /// + /// Tests if the cycle check is really needed in a chain. + /// + /// + public bool ShouldPerformCycleCheckForInnerNode() + { + // TODO Should there be a "is ClassNode" for the last inner node? + + if (!PerformCycleCheck) + { + return false; + } + + var wrapperNode = this; + while (wrapperNode.InnerNode is BaseWrapperNode wrappedNode) + { + if (!wrappedNode.PerformCycleCheck) + { + return false; + } + + wrapperNode = wrappedNode; + } + + return true; + } + + /// + /// Tests if the given node type is present in the chain of wrapped nodes. + /// + /// The node type to check. + /// True if the given node type is present in the chain of wrapped nodes, false otherwise. + public bool IsNodePresentInChain() where TNode : BaseNode + { + BaseNode node = this; + while (node is BaseWrapperNode wrapperNode) + { + if (node is TNode) + { + return true; + } + + node = wrapperNode.InnerNode; + } + + return false; + } + } +} diff --git a/ReClass.NET/Nodes/BitFieldNode.cs b/ReClass.NET/Nodes/BitFieldNode.cs index a8f512d4..22461c37 100644 --- a/ReClass.NET/Nodes/BitFieldNode.cs +++ b/ReClass.NET/Nodes/BitFieldNode.cs @@ -1,8 +1,11 @@ -using System; +using System; using System.Diagnostics.Contracts; using System.Drawing; +using ReClassNET.Controls; +using ReClassNET.Extensions; using ReClassNET.Memory; using ReClassNET.UI; +using ReClassNET.Util; namespace ReClassNET.Nodes { @@ -48,7 +51,13 @@ public BitFieldNode() { Bits = IntPtr.Size * 8; - levelsOpen.DefaultValue = true; + LevelsOpen.DefaultValue = true; + } + + public override void GetUserInterfaceInfo(out string name, out Image icon) + { + name = "Bitfield"; + icon = Properties.Resources.B16x16_Button_Bits; } public override void CopyFromNode(BaseNode node) @@ -58,6 +67,27 @@ public override void CopyFromNode(BaseNode node) Bits = node.MemorySize * 8; } + /// + /// Gets the underlaying node for the bit field. + /// + /// + public BaseNumericNode GetUnderlayingNode() + { + switch (Bits) + { + case 8: + return new UInt8Node(); + case 16: + return new UInt16Node(); + case 32: + return new UInt32Node(); + case 64: + return new UInt64Node(); + } + + throw new Exception(); // TODO + } + /// Converts the memory value to a bit string. /// The process memory. /// The value converted to a bit string. @@ -66,97 +96,99 @@ private string ConvertValueToBitString(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)); } - return str.PadLeft(bits, '0'); } - public override Size Draw(ViewInfo view, int x, int y) + public override Size Draw(DrawContext context, int x, int y) { - if (IsHidden) + const int BitsPerBlock = 4; + + if (IsHidden && !IsWrapped) { - return DrawHidden(view, x, y); + return DrawHidden(context, x, y); } - DrawInvalidMemoryIndicator(view, y); - var origX = x; var origY = y; - AddSelection(view, x, y, view.Font.Height); + AddSelection(context, x, y, context.Font.Height); - x += TextPadding + Icons.Dimensions; + 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(view, x, y, view.Settings.NameColor, HotSpot.NameId, Name) + view.Font.Width; + x = AddText(context, x, y, context.Settings.TypeColor, HotSpot.NoneId, "Bits") + context.Font.Width; + if (!IsWrapped) + { + x = AddText(context, x, y, context.Settings.NameColor, HotSpot.NameId, Name) + context.Font.Width; + } - x = AddOpenClose(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 * 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); } - x = AddText(view, x, y, view.Settings.ValueColor, HotSpot.NoneId, ConvertValueToBitString(view.Memory)) + view.Font.Width; - x += view.Font.Width; + var value = ConvertValueToBitString(context.Memory); + + x = AddText(context, x, y, context.Settings.ValueColor, HotSpot.NoneId, value) + context.Font.Width; + + x += context.Font.Width; - x = AddComment(view, x, y); + x = AddComment(context, x, y); - if (levelsOpen[view.Level]) + DrawInvalidMemoryIndicatorIcon(context, y); + AddContextDropDownIcon(context, y); + AddDeleteIcon(context, y); + + 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)) { - view.Context.DrawString("1", view.Font.Font, brush, tx + (bits - 1) * view.Font.Width + 1, y, format); + var maxCharCount = bits + (bits / 4 - 1) - 1; - for (var i = 8; i <= bits; i += 8) + for (int bitCount = 0, padding = 0; bitCount < bits; bitCount += 4, padding += 5) { - view.Context.DrawString(i.ToString(), view.Font.Font, brush, tx + (bits - i) * view.Font.Width, y, format); + context.Graphics.DrawString(bitCount.ToString(), context.Font.Font, brush, tx + (maxCharCount - padding) * context.Font.Width, y, format); } } - y += 2; + y += 8; } - AddTypeDrop(view, y); - AddDelete(view, 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(ViewInfo view) + public override int CalculateDrawnHeight(DrawContext context) { - if (IsHidden) + 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 + 8; } return height; } @@ -182,7 +214,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 845a8e78..89e164dd 100644 --- a/ReClass.NET/Nodes/BoolNode.cs +++ b/ReClass.NET/Nodes/BoolNode.cs @@ -1,53 +1,58 @@ -using System.Drawing; +using System.Drawing; +using ReClassNET.Controls; +using ReClassNET.Extensions; using ReClassNET.UI; namespace ReClassNET.Nodes { public class BoolNode : BaseNumericNode { - /// Size of the node in bytes. public override int MemorySize => 1; - /// Draws this node. - /// The view information. - /// The x coordinate. - /// The y coordinate. - /// The pixel size the node occupies. - public override Size Draw(ViewInfo view, int x, int y) + public override void GetUserInterfaceInfo(out string name, out Image icon) { - if (IsHidden) + name = "Bool"; + icon = Properties.Resources.B16x16_Button_Bool; + } + + public override Size Draw(DrawContext context, int x, int y) + { + if (IsHidden && !IsWrapped) { - return DrawHidden(view, x, y); + return DrawHidden(context, x, y); } - DrawInvalidMemoryIndicator(view, y); - var origX = x; - AddSelection(view, x, y, view.Font.Height); + AddSelection(context, x, y, context.Font.Height); - x += TextPadding + Icons.Dimensions; + 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(view, x, y, view.Settings.NameColor, HotSpot.NameId, Name) + view.Font.Width; - x = AddText(view, x, y, view.Settings.NameColor, HotSpot.NoneId, "=") + view.Font.Width; + x = AddText(context, x, y, context.Settings.TypeColor, HotSpot.NoneId, "Bool") + context.Font.Width; + if (!IsWrapped) + { + x = AddText(context, x, y, context.Settings.NameColor, HotSpot.NameId, Name) + context.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); - AddTypeDrop(view, y); - AddDelete(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 context) { - return IsHidden ? HiddenHeight : view.Font.Height; + return IsHidden && !IsWrapped ? HiddenHeight : context.Font.Height; } /// Updates the node from the given spot and sets the value. @@ -60,7 +65,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/ClassInstanceArrayNode.cs b/ReClass.NET/Nodes/ClassInstanceArrayNode.cs index 50c7472d..8faf5657 100644 --- a/ReClass.NET/Nodes/ClassInstanceArrayNode.cs +++ b/ReClass.NET/Nodes/ClassInstanceArrayNode.cs @@ -1,30 +1,30 @@ using System.Drawing; +using ReClassNET.Extensions; using ReClassNET.UI; -using ReClassNET.Util; namespace ReClassNET.Nodes { public class ClassInstanceArrayNode : BaseArrayNode { - /// Size of the node in bytes. public override int MemorySize => InnerNode.MemorySize * Count; public override bool PerformCycleCheck => true; + public override void GetUserInterfaceInfo(out string name, out Image icon) + { + name = "Class Instance Array"; + icon = Properties.Resources.B16x16_Button_Array; + } + public override void Intialize() { InnerNode = ClassNode.Create(); InnerNode.Intialize(); } - /// Draws this node. - /// The view information. - /// The x coordinate. - /// The y coordinate. - /// The pixel size the node occupies. public override Size Draw(ViewInfo view, int x, int y) { - return Draw(view, x, y, "Array", HotSpotType.ChangeType); + return Draw(view, x, y, "Array", HotSpotType.ChangeClassType); } protected override Size DrawChild(ViewInfo view, int x, int y) diff --git a/ReClass.NET/Nodes/ClassInstanceNode.cs b/ReClass.NET/Nodes/ClassInstanceNode.cs index a92e3ec4..0a52b51a 100644 --- a/ReClass.NET/Nodes/ClassInstanceNode.cs +++ b/ReClass.NET/Nodes/ClassInstanceNode.cs @@ -1,70 +1,66 @@ -using System; +using System; using System.Drawing; +using ReClassNET.Controls; using ReClassNET.UI; -using ReClassNET.Util; namespace ReClassNET.Nodes { - public class ClassInstanceNode : BaseReferenceNode + public class ClassInstanceNode : BaseClassWrapperNode { - /// Size of the node in bytes. public override int MemorySize => InnerNode.MemorySize; - public override bool PerformCycleCheck => true; + protected override bool PerformCycleCheck => true; - public override void Intialize() + public override void GetUserInterfaceInfo(out string name, out Image icon) { - InnerNode = ClassNode.Create(); - InnerNode.Intialize(); + name = "Class Instance"; + icon = Properties.Resources.B16x16_Button_Class_Instance; } - /// Draws this node. - /// The view information. - /// The x coordinate. - /// The y coordinate. - /// The pixel size the node occupies. - public override Size Draw(ViewInfo view, int x, int y) + public override Size Draw(DrawContext context, int x, int y) { - if (IsHidden) + if (IsHidden && !IsWrapped) { - return DrawHidden(view, x, y); + return DrawHidden(context, x, y); } - DrawInvalidMemoryIndicator(view, y); - var origX = x; var origY = y; - AddSelection(view, x, y, view.Font.Height); + AddSelection(context, x, y, context.Font.Height); - x = AddOpenClose(view, x, y); - x = AddIcon(view, x, y, Icons.Class, -1, 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(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.ChangeType) + view.Font.Width; + x = AddText(context, x, y, context.Settings.TypeColor, HotSpot.NoneId, "Instance") + context.Font.Width; + if (!IsWrapped) + { + x = AddText(context, x, y, context.Settings.NameColor, HotSpot.NameId, Name) + context.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); - AddTypeDrop(view, y); - AddDelete(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.Add(Offset); - v.Memory = view.Memory.Clone(); - v.Memory.Offset += Offset.ToInt32(); + 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; } @@ -72,17 +68,17 @@ public override Size Draw(ViewInfo view, int x, int y) return size; } - public override int CalculateDrawnHeight(ViewInfo view) + public override int CalculateDrawnHeight(DrawContext context) { - if (IsHidden) + 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 a6b6c468..9b144061 100644 --- a/ReClass.NET/Nodes/ClassNode.cs +++ b/ReClass.NET/Nodes/ClassNode.cs @@ -1,12 +1,9 @@ -using System; -using System.Collections.Generic; +using System; using System.Diagnostics.Contracts; using System.Drawing; using System.Linq; -using ReClassNET.AddressParser; -using ReClassNET.Memory; +using ReClassNET.Controls; using ReClassNET.UI; -using ReClassNET.Util; namespace ReClassNET.Nodes { @@ -18,36 +15,19 @@ 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 - /// Size of the node in bytes. public override int MemorySize => Nodes.Sum(n => n.MemorySize); - private NodeUuid uuid; - public NodeUuid Uuid - { - get => uuid; - set - { - Contract.Requires(value != null); - - uuid = value; - } - } - - public IntPtr Address - { - set - { - Contract.Ensures(AddressFormula != null); + protected override bool ShouldCompensateSizeChanges => true; - AddressFormula = value.ToString("X"); - } - } + public Guid Uuid { get; set; } - public string AddressFormula { get; set; } + public string AddressFormula { get; set; } = DefaultAddressFormula; public event NodeEventHandler NodesChanged; @@ -55,9 +35,9 @@ internal ClassNode(bool notifyClassCreated) { Contract.Ensures(AddressFormula != null); - Uuid = new NodeUuid(true); + LevelsOpen.DefaultValue = true; - Address = DefaultAddress; + Uuid = Guid.NewGuid(); if (notifyClassCreated) { @@ -72,85 +52,98 @@ public static ClassNode Create() return new ClassNode(true); } - public override void Intialize() + public override void GetUserInterfaceInfo(out string name, out Image icon) { - AddBytes(IntPtr.Size); + throw new InvalidOperationException($"The '{nameof(ClassNode)}' node should not be accessible from the ui."); } - public override void ClearSelection() + public override bool CanHandleChildNode(BaseNode node) { - base.ClearSelection(); - - foreach (var node in Nodes) + switch (node) { - node.ClearSelection(); + case null: + case ClassNode _: + case VirtualMethodNode _: + return false; } + + return true; + } + + public override void Initialize() + { + AddBytes(IntPtr.Size); } - /// Draws this node. - /// The view information. - /// The x coordinate. - /// The y coordinate. - /// The pixel size the node occupies. - 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 = AddOpenClose(view, x, y); + x = AddOpenCloseIcon(context, x, y); var tx = x; - x = AddIcon(view, x, y, Icons.Class, -1, 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(); - nv.Level++; + var innerContext = context.Clone(); + innerContext.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); + } + + 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)) + if (context.ClientArea.Contains(tx, y)) { - var innerSize = node.Draw(nv, tx, y); + var innerSize = node.Draw(innerContext, tx, y); - size = Utils.AggregateNodeSizes(size, innerSize.Extend(childOffset, 0)); + size = AggregateNodeSizes(size, ExtendWidth(innerSize, childOffset)); y += innerSize.Height; } 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(view.ClientArea)) + 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 = Utils.AggregateNodeSizes(size, innerSize.Extend(childOffset, 0)); + size = AggregateNodeSizes(size, ExtendWidth(innerSize, childOffset)); 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; } @@ -161,17 +154,17 @@ public override Size Draw(ViewInfo view, int x, int y) return size; } - public override int CalculateDrawnHeight(ViewInfo 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)); } @@ -184,67 +177,10 @@ public override void Update(HotSpot spot) if (spot.Id == 0) { - Offset = spot.Memory.Process.ParseAddress(spot.Text); - AddressFormula = spot.Text; } } - public void UpdateAddress(RemoteProcess process) - { - Contract.Requires(process != null); - - try - { - Offset = process.ParseAddress(AddressFormula); - } - catch (ParseException) - { - Offset = IntPtr.Zero; - } - } - - public override void InsertBytes(int index, int size, ref List createdNodes) - { - base.InsertBytes(index, size, ref createdNodes); - - ChildHasChanged(null); - } - - public override void InsertNode(int index, BaseNode node) - { - if (node is ClassNode || node is VMethodNode) - { - return; - } - - base.InsertNode(index, node); - - ChildHasChanged(node); - } - - public override bool RemoveNode(BaseNode node) - { - var removed = base.RemoveNode(node); - if (removed) - { - UpdateOffsets(); - - ChildHasChanged(node); - } - return removed; - } - - public override bool ReplaceChildNode(int index, Type nodeType, ref List createdNodes) - { - var replaced = base.ReplaceChildNode(index, nodeType, ref createdNodes); - if (replaced) - { - ChildHasChanged(null); //TODO - } - return replaced; - } - protected internal override void ChildHasChanged(BaseNode child) { NodesChanged?.Invoke(this); diff --git a/ReClass.NET/Nodes/ClassPtrArrayNode.cs b/ReClass.NET/Nodes/ClassPtrArrayNode.cs deleted file mode 100644 index e87c6e3a..00000000 --- a/ReClass.NET/Nodes/ClassPtrArrayNode.cs +++ /dev/null @@ -1,44 +0,0 @@ -using System; -using System.Drawing; -using ReClassNET.Memory; -using ReClassNET.UI; - -namespace ReClassNET.Nodes -{ - public class ClassPtrArrayNode : BaseArrayNode - { - private readonly MemoryBuffer memory = new MemoryBuffer(); - - public override int MemorySize => IntPtr.Size * Count; - - public override bool PerformCycleCheck => false; - - public override void Intialize() - { - var node = ClassNode.Create(); - node.Intialize(); - node.AddBytes(64); - InnerNode = node; - } - - public override Size Draw(ViewInfo view, int x, int y) - { - return Draw(view, x, y, "PtrArray", HotSpotType.ChangeType); - } - - protected override Size DrawChild(ViewInfo view, int x, int y) - { - var ptr = view.Memory.ReadIntPtr(Offset + IntPtr.Size * CurrentIndex); - - memory.Size = InnerNode.MemorySize; - memory.Process = view.Memory.Process; - memory.Update(ptr); - - var v = view.Clone(); - v.Address = ptr; - v.Memory = memory; - - return InnerNode.Draw(v, x, y); - } - } -} diff --git a/ReClass.NET/Nodes/ClassPtrNode.cs b/ReClass.NET/Nodes/ClassPtrNode.cs deleted file mode 100644 index e48c777d..00000000 --- a/ReClass.NET/Nodes/ClassPtrNode.cs +++ /dev/null @@ -1,94 +0,0 @@ -using System; -using System.Drawing; -using ReClassNET.Memory; -using ReClassNET.UI; - -namespace ReClassNET.Nodes -{ - public class ClassPtrNode : BaseReferenceNode - { - private readonly MemoryBuffer memory = new MemoryBuffer(); - - public override int MemorySize => IntPtr.Size; - - public override bool PerformCycleCheck => false; - - public override void Intialize() - { - var node = ClassNode.Create(); - node.Intialize(); - node.AddBytes(64); - InnerNode = node; - } - - public override Size Draw(ViewInfo view, int x, int y) - { - if (IsHidden) - { - return DrawHidden(view, x, y); - } - - DrawInvalidMemoryIndicator(view, y); - - var origX = x; - var origY = y; - - AddSelection(view, x, y, view.Font.Height); - - x = AddOpenClose(view, x, y); - x = AddIcon(view, x, y, Icons.Pointer, -1, HotSpotType.None); - - var tx = x; - x = AddAddressOffset(view, x, y); - - x = AddText(view, x, y, view.Settings.TypeColor, HotSpot.NoneId, "Ptr") + 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, $"<{InnerNode.Name}>") + view.Font.Width; - x = AddIcon(view, x, y, Icons.Change, 4, HotSpotType.ChangeType) + view.Font.Width; - - x = AddComment(view, x, y); - - AddTypeDrop(view, y); - AddDelete(view, y); - - y += view.Font.Height; - - var size = new Size(x - origX, y - origY); - - if (levelsOpen[view.Level]) - { - var ptr = view.Memory.ReadIntPtr(Offset); - - memory.Size = InnerNode.MemorySize; - memory.Process = view.Memory.Process; - memory.Update(ptr); - - var v = view.Clone(); - v.Address = ptr; - v.Memory = memory; - - var innerSize = InnerNode.Draw(v, tx, y); - - size.Width = Math.Max(size.Width, innerSize.Width + tx - origX); - size.Height += innerSize.Height; - } - - return size; - } - - public override int CalculateDrawnHeight(ViewInfo view) - { - if (IsHidden) - { - return HiddenHeight; - } - - var height = view.Font.Height; - if (levelsOpen[view.Level]) - { - height += InnerNode.CalculateDrawnHeight(view); - } - return height; - } - } -} diff --git a/ReClass.NET/Nodes/ClassUtil.cs b/ReClass.NET/Nodes/ClassUtil.cs index 4ebe3a08..17ea2ce8 100644 --- a/ReClass.NET/Nodes/ClassUtil.cs +++ b/ReClass.NET/Nodes/ClassUtil.cs @@ -7,68 +7,37 @@ namespace ReClassNET.Nodes { public class ClassUtil { - internal static IEnumerable Classes; - - public static bool IsCycleFree(ClassNode parent, ClassNode check) - { - Contract.Requires(parent != null); - Contract.Requires(check != null); - - if (Classes == null) - { - return true; - } - - return IsCycleFree(parent, check, Classes); - } - - public static bool IsCycleFree(ClassNode parent, ClassNode check, IEnumerable classes) + /// + /// Tests if the class to check can be inserted into the parent class without creating a cycle. + /// + /// The class into which + /// The class which should get inserted. + /// An enumeration of all available classes. + /// True if a cycle is detected, false otherwise. + public static bool IsCyclicIfClassIsAccessibleFromParent(ClassNode parent, ClassNode classToCheck, IEnumerable classes) { Contract.Requires(parent != null); - Contract.Requires(check != null); + Contract.Requires(classToCheck != null); Contract.Requires(classes != null); Contract.Requires(Contract.ForAll(classes, c => c != null)); - var toCheck = new HashSet( - check.Yield() - .Traverse( - c => c.Nodes - .Where(n => n is ClassInstanceNode || n is ClassInstanceArrayNode) - .Select(n => ((BaseReferenceNode)n).InnerNode) - ) - ); - - return IsCycleFree(parent, toCheck, classes); - } - - private static bool IsCycleFree(ClassNode root, HashSet seen, IEnumerable classes) - { - Contract.Requires(root != null); - Contract.Requires(seen != null); - Contract.Requires(Contract.ForAll(seen, c => c != null)); - Contract.Requires(Contract.ForAll(classes, c => c != null)); + var graph = new DirectedGraph(); + graph.AddVertices(classes); - if (!seen.Add(root)) - { - return false; - } + graph.AddEdge(parent, classToCheck); - var classNodes = classes as IList ?? classes.ToList(); - foreach (var cls in classNodes/*.Except(seen)*/) + foreach (var c in graph.Vertices) { - if (cls.Nodes - .OfType() - .Where(n => n is ClassInstanceNode || n is ClassInstanceArrayNode) - .Any(n => n.InnerNode == root)) + foreach (var wrapperNode in c.Nodes.OfType()) { - if (!IsCycleFree(cls, seen, classNodes)) + if (wrapperNode.ShouldPerformCycleCheckForInnerNode() && wrapperNode.ResolveMostInnerNode() is ClassNode classNode) { - return false; + graph.AddEdge(c, classNode); } } } - return true; + return graph.ContainsCycle(); } } } diff --git a/ReClass.NET/Nodes/DoubleNode.cs b/ReClass.NET/Nodes/DoubleNode.cs index 21cf4ed6..58df6e15 100644 --- a/ReClass.NET/Nodes/DoubleNode.cs +++ b/ReClass.NET/Nodes/DoubleNode.cs @@ -1,4 +1,6 @@ -using System.Drawing; +using System.Drawing; +using ReClassNET.Controls; +using ReClassNET.Extensions; using ReClassNET.Memory; using ReClassNET.UI; @@ -8,9 +10,15 @@ public class DoubleNode : BaseNumericNode { public override int MemorySize => 8; - public override Size Draw(ViewInfo view, int x, int y) + public override void GetUserInterfaceInfo(out string name, out Image icon) { - return DrawNumeric(view, x, y, Icons.Double, "Double", ReadValueFromMemory(view.Memory).ToString("0.000")); + name = "Double"; + icon = Properties.Resources.B16x16_Button_Double; + } + + public override Size Draw(DrawContext context, int x, int y) + { + return DrawNumeric(context, x, y, context.IconProvider.Double, "Double", ReadValueFromMemory(context.Memory).ToString("0.000"), null); } public override void Update(HotSpot spot) @@ -21,7 +29,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/EnumNode.cs b/ReClass.NET/Nodes/EnumNode.cs new file mode 100644 index 00000000..d2fcf746 --- /dev/null +++ b/ReClass.NET/Nodes/EnumNode.cs @@ -0,0 +1,183 @@ +using System; +using System.Diagnostics.Contracts; +using System.Drawing; +using System.Text; +using ReClassNET.Controls; +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); + } + + private string GetTextRepresentation(MemoryBuffer memory) + { + return Enum.UseFlagsMode ? GetFlagsStringRepresentation(memory) : GetStringRepresentation(memory); + } + + private long ReadSignedValueFromMemory(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); + default: + throw new ArgumentOutOfRangeException(); + } + } + + 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 ReadUnsignedValueFromMemory(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); + default: + throw new ArgumentOutOfRangeException(); + } + } + + private string GetFlagsStringRepresentation(MemoryBuffer memory) + { + var value = ReadUnsignedValueFromMemory(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(DrawContext context, int x, int y) + { + if (IsHidden && !IsWrapped) + { + return DrawHidden(context, x, y); + } + + var origX = x; + + AddSelection(context, x, y, context.Font.Height); + + x = AddIconPadding(context, x); + + x = AddIcon(context, x, y, context.IconProvider.Enum, HotSpot.NoneId, HotSpotType.None); + + x = AddAddressOffset(context, x, y); + + x = AddText(context, x, y, context.Settings.TypeColor, HotSpot.NoneId, "Enum") + context.Font.Width; + if (!IsWrapped) + { + x = AddText(context, x, y, context.Settings.NameColor, HotSpot.NameId, Name) + context.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(context, x, y, context.Settings.TextColor, HotSpot.NoneId, "=") + context.Font.Width; + + var text = GetTextRepresentation(context.Memory); + + x = AddText(context, x, y, context.Settings.TextColor, HotSpot.NoneId, text) + context.Font.Width; + + x = AddComment(context, x, y); + + DrawInvalidMemoryIndicatorIcon(context, y); + AddContextDropDownIcon(context, y); + AddDeleteIcon(context, y); + + return new Size(x - origX, context.Font.Height); + } + + public override int CalculateDrawnHeight(DrawContext context) + { + return IsHidden && !IsWrapped ? HiddenHeight : context.Font.Height; + } + } +} diff --git a/ReClass.NET/Nodes/FloatNode.cs b/ReClass.NET/Nodes/FloatNode.cs index 527e2ce5..b02ebaff 100644 --- a/ReClass.NET/Nodes/FloatNode.cs +++ b/ReClass.NET/Nodes/FloatNode.cs @@ -1,4 +1,6 @@ -using System.Drawing; +using System.Drawing; +using ReClassNET.Controls; +using ReClassNET.Extensions; using ReClassNET.Memory; using ReClassNET.UI; @@ -8,9 +10,15 @@ public class FloatNode : BaseNumericNode { public override int MemorySize => 4; - public override Size Draw(ViewInfo view, int x, int y) + public override void GetUserInterfaceInfo(out string name, out Image icon) { - return DrawNumeric(view, x, y, Icons.Float, "Float", ReadValueFromMemory(view.Memory).ToString("0.000")); + name = "Float"; + icon = Properties.Resources.B16x16_Button_Float; + } + + public override Size Draw(DrawContext context, int x, int y) + { + return DrawNumeric(context, x, y, context.IconProvider.Float, "Float", ReadValueFromMemory(context.Memory).ToString("0.000"), null); } public override void Update(HotSpot spot) @@ -21,7 +29,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 877958d3..8a6c4429 100644 --- a/ReClass.NET/Nodes/FunctionNode.cs +++ b/ReClass.NET/Nodes/FunctionNode.cs @@ -1,10 +1,11 @@ -using System; +using System; using System.Diagnostics.Contracts; using System.Drawing; using System.Linq; +using ReClassNET.Controls; +using ReClassNET.Extensions; using ReClassNET.Memory; using ReClassNET.UI; -using ReClassNET.Util; namespace ReClassNET.Nodes { @@ -15,70 +16,77 @@ public class FunctionNode : BaseFunctionNode public ClassNode BelongsToClass { get; set; } private int memorySize = IntPtr.Size; - /// Size of the node in bytes. public override int MemorySize => memorySize; - public override string GetToolTipText(HotSpot spot, MemoryBuffer memory) + public override void GetUserInterfaceInfo(out string name, out Image icon) { - DisassembleRemoteCode(memory, spot.Address); + name = "Function"; + icon = Properties.Resources.B16x16_Button_Function; + } + + 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) + public override Size Draw(DrawContext context, int x, int y) { - Contract.Requires(view != null); + Contract.Requires(context != null); - if (IsHidden) + if (IsHidden && !IsWrapped) { - return DrawHidden(view, x, y); + return DrawHidden(context, x, y); } - DrawInvalidMemoryIndicator(view, y); - var origX = x; - AddSelection(view, x, y, view.Font.Height); + AddSelection(context, x, y, context.Font.Height); - x += TextPadding; + x = AddIconPadding(context, x); - x = AddIcon(view, x, y, Icons.Function, -1, 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(view, x, y, view.Settings.NameColor, HotSpot.NameId, Name) + view.Font.Width; + x = AddText(context, x, y, context.Settings.TypeColor, HotSpot.NoneId, "Function") + context.Font.Width; + if (!IsWrapped) + { + x = AddText(context, x, y, context.Settings.NameColor, HotSpot.NameId, Name) + context.Font.Width; + } - x = AddOpenClose(view, x, y) + view.Font.Width; + x = AddOpenCloseIcon(context, x, y) + context.Font.Width; - x = AddComment(view, x, y); + x = AddComment(context, x, y); - AddTypeDrop(view, y); - AddDelete(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.Add(Offset); - DisassembleRemoteCode(view.Memory, 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}>"); - x = AddIcon(view, x, y, Icons.Change, 1, HotSpotType.ChangeType); + 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; } @@ -86,17 +94,17 @@ public override Size Draw(ViewInfo view, int x, int y) return size; } - public override int CalculateDrawnHeight(ViewInfo view) + public override int CalculateDrawnHeight(DrawContext context) { - if (IsHidden) + 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; } @@ -111,22 +119,22 @@ 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) + if (this.Address != address) { - instructions.Clear(); + Instructions.Clear(); - this.address = 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); } - ParentNode?.ChildHasChanged(this); + GetParentContainer()?.ChildHasChanged(this); } } } diff --git a/ReClass.NET/Nodes/FunctionPtrNode.cs b/ReClass.NET/Nodes/FunctionPtrNode.cs index 1ab2f3c8..6b7d28e7 100644 --- a/ReClass.NET/Nodes/FunctionPtrNode.cs +++ b/ReClass.NET/Nodes/FunctionPtrNode.cs @@ -1,18 +1,19 @@ -using System.Drawing; -using ReClassNET.UI; +using System.Drawing; +using ReClassNET.Controls; namespace ReClassNET.Nodes { public class FunctionPtrNode : BaseFunctionPtrNode { - /// Draws this node. - /// The view information. - /// The x coordinate. - /// The y coordinate. - /// The pixel size the node occupies. - public override Size Draw(ViewInfo view, int x, int y) + public override void GetUserInterfaceInfo(out string name, out Image icon) { - return Draw(view, x, y, "FunctionPtr", Name); + name = "Function Pointer"; + icon = Properties.Resources.B16x16_Button_Function_Pointer; + } + + public override Size Draw(DrawContext context, int x, int y) + { + return Draw(context, x, y, "FunctionPtr", Name); } } } diff --git a/ReClass.NET/Nodes/Hex16Node.cs b/ReClass.NET/Nodes/Hex16Node.cs index a93d13f5..2e18994a 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; @@ -6,28 +7,24 @@ namespace ReClassNET.Nodes { public class Hex16Node : BaseHexNode { - /// Size of the node in bytes. public override int MemorySize => 2; - /// Gets informations about this node to show in a tool tip. - /// The spot. - /// The process memory. - /// The information to show in a tool tip. - public override string GetToolTipText(HotSpot spot, MemoryBuffer memory) + public override void GetUserInterfaceInfo(out string name, out Image icon) { - var value = memory.ReadObject(Offset); + name = "Hex16"; + icon = Properties.Resources.B16x16_Button_Hex_16; + } + + public override string GetToolTipText(HotSpot spot) + { + var value = new UInt16Data { ShortValue = spot.Memory.ReadInt16(Offset) }; return $"Int16: {value.ShortValue}\nUInt16: 0x{value.UShortValue:X04}"; } - /// Draws this node. - /// The view information. - /// The x coordinate. - /// The y coordinate. - /// The pixel size the node occupies. - 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.ReadPrintableAsciiString(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 8310408d..c7b54027 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; @@ -7,37 +8,33 @@ namespace ReClassNET.Nodes { public class Hex32Node : BaseHexCommentNode { - /// Size of the node in bytes. public override int MemorySize => 4; - public override bool UseMemoryPreviewToolTip(HotSpot spot, MemoryBuffer memory, out IntPtr address) + public override void GetUserInterfaceInfo(out string name, out Image icon) { - var value = memory.ReadObject(Offset); + name = "Hex32"; + icon = Properties.Resources.B16x16_Button_Hex_32; + } + + public override bool UseMemoryPreviewToolTip(HotSpot spot, out IntPtr address) + { + var value = ReadFromBuffer(spot.Memory, Offset); address = value.IntPtr; - return memory.Process?.GetNamedAddress(value.IntPtr) != null; + return spot.Process?.GetNamedAddress(value.IntPtr) != null; } - /// Gets informations about this node to show in a tool tip. - /// The spot. - /// The process memory. - /// The information to show in a tool tip. - public override string GetToolTipText(HotSpot spot, MemoryBuffer memory) + public override string GetToolTipText(HotSpot spot) { - var value = memory.ReadObject(Offset); + var value = ReadFromBuffer(spot.Memory, Offset); return $"Int32: {value.IntValue}\nUInt32: 0x{value.UIntValue:X08}\nFloat: {value.FloatValue:0.000}"; } - /// Draws this node. - /// The view information. - /// The x coordinate. - /// The y coordinate. - /// The pixel size the node occupies. - 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.ReadPrintableAsciiString(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) @@ -45,15 +42,20 @@ public override void Update(HotSpot spot) Update(spot, 4); } - protected override int AddComment(ViewInfo 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 = ReadFromBuffer(context.Memory, 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; } + + 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 ab297773..d54f1e71 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; @@ -7,37 +8,33 @@ namespace ReClassNET.Nodes { public class Hex64Node : BaseHexCommentNode { - /// Size of the node in bytes. public override int MemorySize => 8; - public override bool UseMemoryPreviewToolTip(HotSpot spot, MemoryBuffer memory, out IntPtr address) + public override void GetUserInterfaceInfo(out string name, out Image icon) { - var value = memory.ReadObject(Offset); + name = "Hex64"; + icon = Properties.Resources.B16x16_Button_Hex_64; + } + + public override bool UseMemoryPreviewToolTip(HotSpot spot, out IntPtr address) + { + var value = ReadFromBuffer(spot.Memory, Offset); address = value.IntPtr; - return memory.Process.GetSectionToPointer(value.IntPtr) != null; + return spot.Process.GetSectionToPointer(value.IntPtr) != null; } - /// Gets informations about this node to show in a tool tip. - /// The spot. - /// The process memory. - /// The information to show in a tool tip. - public override string GetToolTipText(HotSpot spot, MemoryBuffer memory) + public override string GetToolTipText(HotSpot spot) { - var value = 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}"; } - /// Draws this node. - /// The view information. - /// The x coordinate. - /// The y coordinate. - /// The pixel size the node occupies. - 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.ReadPrintableAsciiString(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) @@ -45,15 +42,21 @@ public override void Update(HotSpot spot) Update(spot, 8); } - protected override int AddComment(ViewInfo 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 = ReadFromBuffer(context.Memory, 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; } + + 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/Hex8Node.cs b/ReClass.NET/Nodes/Hex8Node.cs index f5ab9465..7c29884e 100644 --- a/ReClass.NET/Nodes/Hex8Node.cs +++ b/ReClass.NET/Nodes/Hex8Node.cs @@ -1,5 +1,5 @@ -using System.Drawing; -using ReClassNET.Memory; +using System.Drawing; +using ReClassNET.Controls; using ReClassNET.UI; namespace ReClassNET.Nodes @@ -8,16 +8,22 @@ public class Hex8Node : BaseHexNode { public override int MemorySize => 1; - public override string GetToolTipText(HotSpot spot, MemoryBuffer memory) + public override void GetUserInterfaceInfo(out string name, out Image icon) { - var b = memory.ReadUInt8(Offset); + name = "Hex8"; + icon = Properties.Resources.B16x16_Button_Hex_8; + } + + public override string GetToolTipText(HotSpot spot) + { + var b = spot.Memory.ReadUInt8(Offset); 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.ReadPrintableAsciiString(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/INodeInfoReader.cs b/ReClass.NET/Nodes/INodeInfoReader.cs index 8851cb76..75289ccf 100644 --- a/ReClass.NET/Nodes/INodeInfoReader.cs +++ b/ReClass.NET/Nodes/INodeInfoReader.cs @@ -8,22 +8,24 @@ namespace ReClassNET.Nodes public interface INodeInfoReader { /// - /// Used to print custom informations about the node. + /// Used to print custom informations about a node. /// - /// The current node. - /// The absolute address of the node. - /// /// The memory value of the node as . + /// The node. + /// 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(BaseNode 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(BaseNode 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(); diff --git a/ReClass.NET/Nodes/Int16Node.cs b/ReClass.NET/Nodes/Int16Node.cs index 0af0e47f..e67b2145 100644 --- a/ReClass.NET/Nodes/Int16Node.cs +++ b/ReClass.NET/Nodes/Int16Node.cs @@ -1,4 +1,7 @@ -using System.Drawing; +using System.Drawing; +using System.Globalization; +using ReClassNET.Controls; +using ReClassNET.Extensions; using ReClassNET.Memory; using ReClassNET.UI; @@ -8,20 +11,27 @@ public class Int16Node : BaseNumericNode { public override int MemorySize => 2; - public override Size Draw(ViewInfo view, int x, int y) + public override void GetUserInterfaceInfo(out string name, out Image icon) { - return DrawNumeric(view, x, y, Icons.Signed, "Int16", ReadValueFromMemory(view.Memory).ToString()); + name = "Int16"; + icon = Properties.Resources.B16x16_Button_Int_16; + } + + public override Size Draw(DrawContext context, int x, int y) + { + 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) { base.Update(spot); - if (spot.Id == 0) + if (spot.Id == 0 || spot.Id == 1) { - if (short.TryParse(spot.Text, out var val)) + 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 7d7d976f..5ba2090e 100644 --- a/ReClass.NET/Nodes/Int32Node.cs +++ b/ReClass.NET/Nodes/Int32Node.cs @@ -1,4 +1,7 @@ -using System.Drawing; +using System.Drawing; +using System.Globalization; +using ReClassNET.Controls; +using ReClassNET.Extensions; using ReClassNET.Memory; using ReClassNET.UI; @@ -8,20 +11,27 @@ public class Int32Node : BaseNumericNode { public override int MemorySize => 4; - public override Size Draw(ViewInfo view, int x, int y) + public override void GetUserInterfaceInfo(out string name, out Image icon) { - return DrawNumeric(view, x, y, Icons.Signed, "Int32", ReadValueFromMemory(view.Memory).ToString()); + name = "Int32"; + icon = Properties.Resources.B16x16_Button_Int_32; + } + + public override Size Draw(DrawContext context, int x, int y) + { + 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) { base.Update(spot); - if (spot.Id == 0) + if (spot.Id == 0 || spot.Id == 1) { - if (int.TryParse(spot.Text, out var val)) + 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 70f02b6a..935e4569 100644 --- a/ReClass.NET/Nodes/Int64Node.cs +++ b/ReClass.NET/Nodes/Int64Node.cs @@ -1,4 +1,7 @@ -using System.Drawing; +using System.Drawing; +using System.Globalization; +using ReClassNET.Controls; +using ReClassNET.Extensions; using ReClassNET.Memory; using ReClassNET.UI; @@ -8,20 +11,27 @@ public class Int64Node : BaseNumericNode { public override int MemorySize => 8; - public override Size Draw(ViewInfo view, int x, int y) + public override void GetUserInterfaceInfo(out string name, out Image icon) { - return DrawNumeric(view, x, y, Icons.Signed, "Int64", ReadValueFromMemory(view.Memory).ToString()); + name = "Int64"; + 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, "Int64", value.ToString(), $"0x{value:X}"); } public override void Update(HotSpot spot) { base.Update(spot); - if (spot.Id == 0) + if (spot.Id == 0 || spot.Id == 1) { - if (long.TryParse(spot.Text, out var val)) + 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 2e06ddb1..fbfe4038 100644 --- a/ReClass.NET/Nodes/Int8Node.cs +++ b/ReClass.NET/Nodes/Int8Node.cs @@ -1,4 +1,7 @@ -using System.Drawing; +using System.Drawing; +using System.Globalization; +using ReClassNET.Controls; +using ReClassNET.Extensions; using ReClassNET.Memory; using ReClassNET.UI; @@ -8,20 +11,27 @@ public class Int8Node : BaseNumericNode { public override int MemorySize => 1; - public override Size Draw(ViewInfo view, int x, int y) + public override void GetUserInterfaceInfo(out string name, out Image icon) { - return DrawNumeric(view, x, y, Icons.Signed, "Int8", ReadValueFromMemory(view.Memory).ToString()); + name = "Int8"; + icon = Properties.Resources.B16x16_Button_Int_8; + } + + public override Size Draw(DrawContext context, int x, int y) + { + 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) { base.Update(spot); - if (spot.Id == 0) + if (spot.Id == 0 || spot.Id == 1) { - if (sbyte.TryParse(spot.Text, out var val)) + 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/Matrix3x3Node.cs b/ReClass.NET/Nodes/Matrix3x3Node.cs index 296a6332..37bc1802 100644 --- a/ReClass.NET/Nodes/Matrix3x3Node.cs +++ b/ReClass.NET/Nodes/Matrix3x3Node.cs @@ -1,88 +1,29 @@ -using System.Drawing; -using System.Runtime.InteropServices; +using System.Drawing; +using ReClassNET.Controls; using ReClassNET.UI; -using System; namespace ReClassNET.Nodes { public class Matrix3x3Node : BaseMatrixNode { - [StructLayout(LayoutKind.Explicit)] - private 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; - /// Draws this node. - /// The view information. - /// The x coordinate. - /// The y coordinate. - /// The pixel size the node occupies. - public override Size Draw(ViewInfo view, int x2, int y2) + public override void GetUserInterfaceInfo(out string name, out Image icon) { - return DrawMatrixType(view, x2, y2, "Matrix (3x3)", (int defaultX, ref int maxX, ref int y) => - { - var value = view.Memory.ReadObject(Offset); - - y += view.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, "|"); - maxX = Math.Max(x, maxX); - - y += view.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, "|"); - maxX = Math.Max(x, maxX); + name = "Matrix 3x3"; + icon = Properties.Resources.B16x16_Button_Matrix_3x3; + } - y += view.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, "|"); - maxX = Math.Max(x, maxX); - }); + public override Size Draw(DrawContext context, int x2, int y2) + { + return DrawMatrixType(context, x2, y2, "Matrix (3x3)", 3, 3); } - protected override int CalculateValuesHeight(ViewInfo 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 b3f3f625..96948064 100644 --- a/ReClass.NET/Nodes/Matrix3x4Node.cs +++ b/ReClass.NET/Nodes/Matrix3x4Node.cs @@ -1,100 +1,29 @@ -using System; using System.Drawing; -using System.Runtime.InteropServices; +using ReClassNET.Controls; using ReClassNET.UI; namespace ReClassNET.Nodes { public class Matrix3x4Node : BaseMatrixNode { - [StructLayout(LayoutKind.Explicit)] - private 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; - /// Draws this node. - /// The view information. - /// The x coordinate. - /// The y coordinate. - /// The pixel size the node occupies. - public override Size Draw(ViewInfo view, int x2, int y2) + public override void GetUserInterfaceInfo(out string name, out Image icon) { - return DrawMatrixType(view, x2, y2, "Matrix (3x4)", (int defaultX, ref int maxX, ref int y) => - { - var value = view.Memory.ReadObject(Offset); - - y += view.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, "|"); - maxX = Math.Max(x, maxX); - - y += view.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, "|"); - maxX = Math.Max(x, maxX); + name = "Matrix 3x4"; + icon = Properties.Resources.B16x16_Button_Matrix_3x4; + } - y += view.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, "|"); - maxX = Math.Max(x, maxX); - }); + public override Size Draw(DrawContext context, int x2, int y2) + { + return DrawMatrixType(context, x2, y2, "Matrix (3x4)", 3, 4); } - protected override int CalculateValuesHeight(ViewInfo 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 deb1e748..69318694 100644 --- a/ReClass.NET/Nodes/Matrix4x4Node.cs +++ b/ReClass.NET/Nodes/Matrix4x4Node.cs @@ -1,121 +1,29 @@ -using System; using System.Drawing; -using System.Runtime.InteropServices; +using ReClassNET.Controls; using ReClassNET.UI; namespace ReClassNET.Nodes { public class Matrix4x4Node : BaseMatrixNode { - [StructLayout(LayoutKind.Explicit)] - private 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; - /// Draws this node. - /// The view information. - /// The x coordinate. - /// The y coordinate. - /// The pixel size the node occupies. - public override Size Draw(ViewInfo view, int x2, int y2) + public override void GetUserInterfaceInfo(out string name, out Image icon) { - return DrawMatrixType(view, x2, y2, "Matrix (4x4)", (int defaultX, ref int maxX, ref int y) => - { - var value = view.Memory.ReadObject(Offset); - - y += view.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, "|"); - maxX = Math.Max(x, maxX); - - y += view.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, "|"); - maxX = Math.Max(x, maxX); - - y += view.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, "|"); - maxX = Math.Max(x, maxX); + name = "Matrix 4x4"; + icon = Properties.Resources.B16x16_Button_Matrix_4x4; + } - y += view.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, "|"); - maxX = Math.Max(x, maxX); - }); + public override Size Draw(DrawContext context, int x2, int y2) + { + return DrawMatrixType(context, x2, y2, "Matrix (4x4)", 4, 4); } - protected override int CalculateValuesHeight(ViewInfo 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/NIntNode.cs b/ReClass.NET/Nodes/NIntNode.cs new file mode 100644 index 00000000..77d021e0 --- /dev/null +++ b/ReClass.NET/Nodes/NIntNode.cs @@ -0,0 +1,57 @@ +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 NIntNode : BaseNumericNode + { + public override int MemorySize => IntPtr.Size; + + public override void GetUserInterfaceInfo(out string name, out Image icon) + { + name = "NInt"; + icon = Properties.Resources.B16x16_Button_NInt; + } + + public override Size Draw(DrawContext context, int x, int y) + { + 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}"); + } + + 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/NUIntNode.cs b/ReClass.NET/Nodes/NUIntNode.cs new file mode 100644 index 00000000..1b502ad0 --- /dev/null +++ b/ReClass.NET/Nodes/NUIntNode.cs @@ -0,0 +1,57 @@ +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 NUIntNode : BaseNumericNode + { + public override int MemorySize => UIntPtr.Size; + + public override void GetUserInterfaceInfo(out string name, out Image icon) + { + name = "NUInt"; + icon = Properties.Resources.B16x16_Button_NUInt; + } + + public override Size Draw(DrawContext context, int x, int y) + { + 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}"); + } + + 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/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/Nodes/PointerNode.cs b/ReClass.NET/Nodes/PointerNode.cs new file mode 100644 index 00000000..027b0d28 --- /dev/null +++ b/ReClass.NET/Nodes/PointerNode.cs @@ -0,0 +1,138 @@ +using System; +using System.Drawing; +using ReClassNET.Controls; +using ReClassNET.Memory; +using ReClassNET.UI; + +namespace ReClassNET.Nodes +{ + public class PointerNode : BaseWrapperNode + { + private readonly MemoryBuffer memory = new MemoryBuffer(); + + public override int MemorySize => IntPtr.Size; + + protected override bool PerformCycleCheck => false; + + 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"; + icon = Properties.Resources.B16x16_Button_Pointer; + } + + public override bool UseMemoryPreviewToolTip(HotSpot spot, out IntPtr address) + { + // TODO Should the preview be disabled if an inner node is set? + + address = spot.Memory.ReadIntPtr(Offset); + + return spot.Process.GetNamedAddress(address) != null; + } + + public override bool CanChangeInnerNodeTo(BaseNode node) => + node switch + { + ClassNode _ => false, + VirtualMethodNode _ => false, + _ => true + }; + + public override Size Draw(DrawContext context, int x, int y) + { + if (IsHidden && !IsWrapped) + { + return DrawHidden(context, x, y); + } + + var origX = x; + var origY = y; + + AddSelection(context, x, y, context.Font.Height); + + if (InnerNode != null) + { + x = AddOpenCloseIcon(context, x, y); + } + else + { + x = AddIconPadding(context, x); + } + x = AddIcon(context, x, y, context.IconProvider.Pointer, HotSpot.NoneId, HotSpotType.None); + + var tx = x; + x = AddAddressOffset(context, x, y); + + x = AddText(context, x, y, context.Settings.TypeColor, HotSpot.NoneId, "Ptr") + context.Font.Width; + if (!IsWrapped) + { + x = AddText(context, x, y, context.Settings.NameColor, HotSpot.NameId, Name) + context.Font.Width; + } + if (InnerNode == null) + { + x = AddText(context, x, y, context.Settings.ValueColor, HotSpot.NoneId, "") + context.Font.Width; + } + x = AddIcon(context, x, y, context.IconProvider.Change, 4, HotSpotType.ChangeWrappedType) + context.Font.Width; + + var ptr = context.Memory.ReadIntPtr(Offset); + + 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(context, x, y); + + DrawInvalidMemoryIndicatorIcon(context, y); + AddContextDropDownIcon(context, y); + AddDeleteIcon(context, y); + + y += context.Font.Height; + + var size = new Size(x - origX, y - origY); + + if (LevelsOpen[context.Level] && InnerNode != null) + { + memory.Size = InnerNode.MemorySize; + memory.UpdateFrom(context.Process, ptr); + + var innerContext = context.Clone(); + innerContext.Address = ptr; + innerContext.Memory = memory; + + var innerSize = InnerNode.Draw(innerContext, tx, y); + + size.Width = Math.Max(size.Width, innerSize.Width + tx - origX); + size.Height += innerSize.Height; + } + + return size; + } + + public override int CalculateDrawnHeight(DrawContext context) + { + if (IsHidden && !IsWrapped) + { + return HiddenHeight; + } + + var height = context.Font.Height; + if (LevelsOpen[context.Level] && InnerNode != null) + { + height += InnerNode.CalculateDrawnHeight(context); + } + return height; + } + } +} diff --git a/ReClass.NET/Nodes/UInt16Node.cs b/ReClass.NET/Nodes/UInt16Node.cs index 6d28deed..47f72602 100644 --- a/ReClass.NET/Nodes/UInt16Node.cs +++ b/ReClass.NET/Nodes/UInt16Node.cs @@ -1,4 +1,7 @@ -using System.Drawing; +using System.Drawing; +using System.Globalization; +using ReClassNET.Controls; +using ReClassNET.Extensions; using ReClassNET.Memory; using ReClassNET.UI; @@ -8,20 +11,27 @@ public class UInt16Node : BaseNumericNode { public override int MemorySize => 2; - public override Size Draw(ViewInfo view, int x, int y) + public override void GetUserInterfaceInfo(out string name, out Image icon) { - return DrawNumeric(view, x, y, Icons.Unsigned, "UInt16", ReadValueFromMemory(view.Memory).ToString()); + name = "UInt16 / WORD"; + icon = Properties.Resources.B16x16_Button_UInt_16; + } + + public override Size Draw(DrawContext context, int x, int y) + { + 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) { base.Update(spot); - if (spot.Id == 0) + if (spot.Id == 0 || spot.Id == 1) { - if (ushort.TryParse(spot.Text, out var val)) + 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 9dd9e8c4..ad97faae 100644 --- a/ReClass.NET/Nodes/UInt32Node.cs +++ b/ReClass.NET/Nodes/UInt32Node.cs @@ -1,4 +1,7 @@ -using System.Drawing; +using System.Drawing; +using System.Globalization; +using ReClassNET.Controls; +using ReClassNET.Extensions; using ReClassNET.Memory; using ReClassNET.UI; @@ -8,20 +11,27 @@ public class UInt32Node : BaseNumericNode { public override int MemorySize => 4; - public override Size Draw(ViewInfo view, int x, int y) + public override void GetUserInterfaceInfo(out string name, out Image icon) { - return DrawNumeric(view, x, y, Icons.Unsigned, "UInt32", ReadValueFromMemory(view.Memory).ToString()); + name = "UInt32 / DWORD"; + icon = Properties.Resources.B16x16_Button_UInt_32; + } + + public override Size Draw(DrawContext context, int x, int y) + { + 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) { base.Update(spot); - if (spot.Id == 0) + if (spot.Id == 0 || spot.Id == 1) { - if (uint.TryParse(spot.Text, out var val)) + 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 77a781e8..603eb784 100644 --- a/ReClass.NET/Nodes/UInt64Node.cs +++ b/ReClass.NET/Nodes/UInt64Node.cs @@ -1,4 +1,7 @@ -using System.Drawing; +using System.Drawing; +using System.Globalization; +using ReClassNET.Controls; +using ReClassNET.Extensions; using ReClassNET.Memory; using ReClassNET.UI; @@ -8,20 +11,27 @@ public class UInt64Node : BaseNumericNode { public override int MemorySize => 8; - public override Size Draw(ViewInfo view, int x, int y) + public override void GetUserInterfaceInfo(out string name, out Image icon) { - return DrawNumeric(view, x, y, Icons.Unsigned, "UInt64", ReadValueFromMemory(view.Memory).ToString()); + name = "UInt64 / QWORD"; + icon = Properties.Resources.B16x16_Button_UInt_64; + } + + public override Size Draw(DrawContext context, int x, int y) + { + 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) { base.Update(spot); - if (spot.Id == 0) + if (spot.Id == 0 || spot.Id == 1) { - if (ulong.TryParse(spot.Text, out var val)) + 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 12091cfe..ce6def15 100644 --- a/ReClass.NET/Nodes/UInt8Node.cs +++ b/ReClass.NET/Nodes/UInt8Node.cs @@ -1,4 +1,7 @@ -using System.Drawing; +using System.Drawing; +using System.Globalization; +using ReClassNET.Controls; +using ReClassNET.Extensions; using ReClassNET.Memory; using ReClassNET.UI; @@ -8,20 +11,27 @@ public class UInt8Node : BaseNumericNode { public override int MemorySize => 1; - public override Size Draw(ViewInfo view, int x, int y) + public override void GetUserInterfaceInfo(out string name, out Image icon) { - return DrawNumeric(view, x, y, Icons.Unsigned, "UInt8", ReadValueFromMemory(view.Memory).ToString()); + name = "UInt8 / BYTE"; + icon = Properties.Resources.B16x16_Button_UInt_8; + } + + public override Size Draw(DrawContext context, int x, int y) + { + 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) { base.Update(spot); - if (spot.Id == 0) + if (spot.Id == 0 || spot.Id == 1) { - if (byte.TryParse(spot.Text, out var val)) + 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/UTF16TextNode.cs b/ReClass.NET/Nodes/UTF16TextNode.cs index ebbc0932..9ea1bc6a 100644 --- a/ReClass.NET/Nodes/UTF16TextNode.cs +++ b/ReClass.NET/Nodes/UTF16TextNode.cs @@ -1,26 +1,22 @@ -using System.Drawing; -using ReClassNET.Memory; -using ReClassNET.UI; +using System.Drawing; +using System.Text; +using ReClassNET.Controls; namespace ReClassNET.Nodes { public class Utf16TextNode : BaseTextNode { - public override int CharacterSize => 2; + public override Encoding Encoding => Encoding.Unicode; - /// Draws this node. - /// The view information. - /// The x coordinate. - /// The y coordinate. - /// The pixel size the node occupies. - public override Size Draw(ViewInfo view, int x, int y) + public override void GetUserInterfaceInfo(out string name, out Image icon) { - return DrawText(view, x, y, "Text16", MemorySize / CharacterSize, view.Memory.ReadUtf16String(Offset, MemorySize)); + name = "UTF16 / Unicode Text"; + icon = Properties.Resources.B16x16_Button_UText; } - public string ReadValueFromMemory(MemoryBuffer memory) + public override Size Draw(DrawContext context, int x, int y) { - return memory.ReadUtf16String(Offset, MemorySize); + return DrawText(context, x, y, "Text16"); } } } diff --git a/ReClass.NET/Nodes/UTF16TextPtrNode.cs b/ReClass.NET/Nodes/UTF16TextPtrNode.cs index b87a4c2a..dc02f3f1 100644 --- a/ReClass.NET/Nodes/UTF16TextPtrNode.cs +++ b/ReClass.NET/Nodes/UTF16TextPtrNode.cs @@ -1,17 +1,22 @@ -using System.Drawing; +using System.Drawing; using System.Text; -using ReClassNET.UI; +using ReClassNET.Controls; namespace ReClassNET.Nodes { public class Utf16TextPtrNode : BaseTextPtrNode { - public override Size Draw(ViewInfo view, int x, int y) + public override Encoding Encoding => Encoding.Unicode; + + public override void GetUserInterfaceInfo(out string name, out Image icon) { - var ptr = view.Memory.ReadIntPtr(Offset); - var str = view.Memory.Process.ReadRemoteString(Encoding.Unicode, ptr, 128); + name = "UTF16 / Unicode Text Pointer"; + icon = Properties.Resources.B16x16_Button_UText_Pointer; + } - return DrawText(view, x, y, "Text16Ptr", str); + public override Size Draw(DrawContext context, int x, int y) + { + return DrawText(context, x, y, "Text16Ptr"); } } } diff --git a/ReClass.NET/Nodes/UTF32TextNode.cs b/ReClass.NET/Nodes/UTF32TextNode.cs index b85576b9..f08d7735 100644 --- a/ReClass.NET/Nodes/UTF32TextNode.cs +++ b/ReClass.NET/Nodes/UTF32TextNode.cs @@ -1,26 +1,22 @@ -using System.Drawing; -using ReClassNET.Memory; -using ReClassNET.UI; +using System.Drawing; +using System.Text; +using ReClassNET.Controls; namespace ReClassNET.Nodes { public class Utf32TextNode : BaseTextNode { - public override int CharacterSize => 4; + public override Encoding Encoding => Encoding.UTF32; - /// Draws this node. - /// The view information. - /// The x coordinate. - /// The y coordinate. - /// The pixel size the node occupies. - public override Size Draw(ViewInfo view, int x, int y) + public override void GetUserInterfaceInfo(out string name, out Image icon) { - return DrawText(view, x, y, "Text32", MemorySize / CharacterSize, view.Memory.ReadUtf32String(Offset, MemorySize)); + name = "UTF32 Text"; + icon = Properties.Resources.B16x16_Button_UText; } - public string ReadValueFromMemory(MemoryBuffer memory) + public override Size Draw(DrawContext context, int x, int y) { - return memory.ReadUtf32String(Offset, MemorySize); + return DrawText(context, x, y, "Text32"); } } } diff --git a/ReClass.NET/Nodes/UTF32TextPtrNode.cs b/ReClass.NET/Nodes/UTF32TextPtrNode.cs index db026d98..3e7b920e 100644 --- a/ReClass.NET/Nodes/UTF32TextPtrNode.cs +++ b/ReClass.NET/Nodes/UTF32TextPtrNode.cs @@ -1,17 +1,22 @@ -using System.Drawing; +using System.Drawing; using System.Text; -using ReClassNET.UI; +using ReClassNET.Controls; namespace ReClassNET.Nodes { public class Utf32TextPtrNode : BaseTextPtrNode { - public override Size Draw(ViewInfo view, int x, int y) + public override Encoding Encoding => Encoding.UTF32; + + public override void GetUserInterfaceInfo(out string name, out Image icon) { - var ptr = view.Memory.ReadIntPtr(Offset); - var str = view.Memory.Process.ReadRemoteString(Encoding.UTF32, ptr, 256); + name = "UTF32 Text Pointer"; + icon = Properties.Resources.B16x16_Button_UText_Pointer; + } - return DrawText(view, x, y, "Text32Ptr", str); + public override Size Draw(DrawContext context, int x, int y) + { + return DrawText(context, x, y, "Text32Ptr"); } } } diff --git a/ReClass.NET/Nodes/UTF8TextNode.cs b/ReClass.NET/Nodes/UTF8TextNode.cs index 43c47ae8..ef9c5ff6 100644 --- a/ReClass.NET/Nodes/UTF8TextNode.cs +++ b/ReClass.NET/Nodes/UTF8TextNode.cs @@ -1,26 +1,22 @@ -using System.Drawing; -using ReClassNET.Memory; -using ReClassNET.UI; +using System.Drawing; +using System.Text; +using ReClassNET.Controls; namespace ReClassNET.Nodes { public class Utf8TextNode : BaseTextNode { - public override int CharacterSize => 1; + public override Encoding Encoding => Encoding.UTF8; - /// Draws this node. - /// The view information. - /// The x coordinate. - /// The y coordinate. - /// The pixel size the node occupies. - public override Size Draw(ViewInfo view, int x, int y) + public override void GetUserInterfaceInfo(out string name, out Image icon) { - return DrawText(view, x, y, "Text8", MemorySize, view.Memory.ReadUtf8String(Offset, MemorySize)); + name = "UTF8 / ASCII Text"; + icon = Properties.Resources.B16x16_Button_Text; } - public string ReadValueFromMemory(MemoryBuffer memory) + public override Size Draw(DrawContext context, int x, int y) { - return memory.ReadUtf8String(Offset, MemorySize); + return DrawText(context, x, y, "Text8"); } } } diff --git a/ReClass.NET/Nodes/UTF8TextPtrNode.cs b/ReClass.NET/Nodes/UTF8TextPtrNode.cs index 27b62611..d1173ff2 100644 --- a/ReClass.NET/Nodes/UTF8TextPtrNode.cs +++ b/ReClass.NET/Nodes/UTF8TextPtrNode.cs @@ -1,17 +1,22 @@ -using System.Drawing; +using System.Drawing; using System.Text; -using ReClassNET.UI; +using ReClassNET.Controls; namespace ReClassNET.Nodes { public class Utf8TextPtrNode : BaseTextPtrNode { - public override Size Draw(ViewInfo view, int x, int y) + public override Encoding Encoding => Encoding.UTF8; + + public override void GetUserInterfaceInfo(out string name, out Image icon) { - var ptr = view.Memory.ReadIntPtr(Offset); - var str = view.Memory.Process.ReadRemoteString(Encoding.UTF8, ptr, 64); + name = "UTF8 / ASCII Text Pointer"; + icon = Properties.Resources.B16x16_Button_Text_Pointer; + } - return DrawText(view, x, y, "Text8Ptr", str); + public override Size Draw(DrawContext context, int x, int y) + { + return DrawText(context, x, y, "Text8Ptr"); } } } diff --git a/ReClass.NET/Nodes/UnionNode.cs b/ReClass.NET/Nodes/UnionNode.cs new file mode 100644 index 00000000..f46108c2 --- /dev/null +++ b/ReClass.NET/Nodes/UnionNode.cs @@ -0,0 +1,117 @@ +using System; +using System.Drawing; +using System.Linq; +using ReClassNET.Controls; +using ReClassNET.UI; + +namespace ReClassNET.Nodes +{ + public class UnionNode : BaseContainerNode + { + public override int MemorySize => Nodes.Max(n => n.MemorySize); + + protected override bool ShouldCompensateSizeChanges => false; + + public override void GetUserInterfaceInfo(out string name, out Image icon) + { + name = "Union"; + icon = Properties.Resources.B16x16_Button_Union; + } + + public override bool CanHandleChildNode(BaseNode node) + { + switch (node) + { + case null: + case ClassNode _: + case VirtualMethodNode _: + return false; + } + + return true; + } + + public override void Initialize() + { + AddNode(CreateDefaultNodeForSize(IntPtr.Size)); + } + + public override void UpdateOffsets() + { + foreach (var node in Nodes) + { + node.Offset = 0; + } + } + + public override Size Draw(DrawContext context, int x, int y) + { + if (IsHidden && !IsWrapped) + { + return DrawHidden(context, x, y); + } + + var origX = x; + var origY = y; + + AddSelection(context, x, y, context.Font.Height); + + x = AddOpenCloseIcon(context, x, y); + x = AddIcon(context, x, y, context.IconProvider.Union, -1, HotSpotType.None); + + var tx = x; + x = AddAddressOffset(context, x, y); + + x = AddText(context, x, y, context.Settings.TypeColor, HotSpot.NoneId, "Union") + context.Font.Width; + + x = AddText(context, x, y, context.Settings.ValueColor, HotSpot.NoneId, $"[Nodes: {Nodes.Count}, Size: {MemorySize}]") + context.Font.Width; + + x = AddComment(context, x, y); + + DrawInvalidMemoryIndicatorIcon(context, y); + AddContextDropDownIcon(context, y); + AddDeleteIcon(context, y); + + y += context.Font.Height; + + var size = new Size(x - origX, y - origY); + + if (LevelsOpen[context.Level]) + { + 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(innerContext, tx, y); + + size.Width = Math.Max(size.Width, innerSize.Width + tx - origX); + size.Height += innerSize.Height; + + y += innerSize.Height; + } + } + + return size; + } + + public override int CalculateDrawnHeight(DrawContext context) + { + if (IsHidden && !IsWrapped) + { + return HiddenHeight; + } + + var height = context.Font.Height; + if (LevelsOpen[context.Level]) + { + height += Nodes.Sum(n => n.CalculateDrawnHeight(context)); + } + return height; + } + } +} diff --git a/ReClass.NET/Nodes/VMethodNode.cs b/ReClass.NET/Nodes/VMethodNode.cs deleted file mode 100644 index aaf17416..00000000 --- a/ReClass.NET/Nodes/VMethodNode.cs +++ /dev/null @@ -1,29 +0,0 @@ -using System; -using System.Diagnostics.Contracts; -using System.Drawing; -using ReClassNET.UI; - -namespace ReClassNET.Nodes -{ - public class VMethodNode : BaseFunctionPtrNode - { - public string MethodName => string.IsNullOrEmpty(Name) ? $"Function{Offset.ToInt32() / IntPtr.Size}" : Name; - - public VMethodNode() - { - Contract.Ensures(Name != null); - - Name = string.Empty; - } - - /// Draws this node. - /// The view information. - /// The x coordinate. - /// The y coordinate. - /// The pixel size the node occupies. - public override Size Draw(ViewInfo view, int x, int y) - { - return Draw(view, x, y, $"({Offset.ToInt32() / IntPtr.Size})", MethodName); - } - } -} diff --git a/ReClass.NET/Nodes/VTableNode.cs b/ReClass.NET/Nodes/VTableNode.cs deleted file mode 100644 index ff06d6f3..00000000 --- a/ReClass.NET/Nodes/VTableNode.cs +++ /dev/null @@ -1,163 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Drawing; -using System.Linq; -using ReClassNET.Memory; -using ReClassNET.UI; - -namespace ReClassNET.Nodes -{ - public class VTableNode : BaseContainerNode - { - private readonly MemoryBuffer memory = new MemoryBuffer(); - - public override int MemorySize => IntPtr.Size; - - public override void Intialize() - { - AddBytes(10 * IntPtr.Size); - } - - public override void ClearSelection() - { - base.ClearSelection(); - - foreach (var node in nodes) - { - node.ClearSelection(); - } - } - - public override Size Draw(ViewInfo view, int x, int y) - { - if (IsHidden) - { - return DrawHidden(view, x, y); - } - - DrawInvalidMemoryIndicator(view, y); - - var origX = x; - var origY = y; - - AddSelection(view, x, y, view.Font.Height); - - x = AddOpenClose(view, x, y); - x = AddIcon(view, x, y, Icons.VTable, -1, HotSpotType.None); - - var tx = x; - x = AddAddressOffset(view, x, y); - - x = AddText(view, x, y, view.Settings.VTableColor, HotSpot.NoneId, $"VTable[{nodes.Count}]") + view.Font.Width; - x = AddText(view, x, y, view.Settings.NameColor, HotSpot.NameId, Name) + view.Font.Width; - - x = AddComment(view, x, y); - - AddTypeDrop(view, y); - AddDelete(view, y); - - y += view.Font.Height; - - var size = new Size(x - origX, y - origY); - - if (levelsOpen[view.Level]) - { - var ptr = view.Memory.ReadIntPtr(Offset); - - memory.Size = nodes.Count * IntPtr.Size; - memory.Process = view.Memory.Process; - memory.Update(ptr); - - var v = view.Clone(); - v.Address = ptr; - v.Memory = memory; - - foreach (var node in nodes) - { - var innerSize = node.Draw(v, tx, y); - - size.Width = Math.Max(size.Width, innerSize.Width + tx - origX); - size.Height += innerSize.Height; - - y += innerSize.Height; - } - } - - return size; - } - - public override int CalculateDrawnHeight(ViewInfo view) - { - if (IsHidden) - { - return HiddenHeight; - } - - var height = view.Font.Height; - if (levelsOpen[view.Level]) - { - height += nodes.Sum(n => n.CalculateDrawnHeight(view)); - } - return height; - } - - public override bool ReplaceChildNode(int index, Type nodeType, ref List createdNodes) => false; - - public override void InsertBytes(int index, int size, ref List createdNodes) - { - if (index < 0 || index > nodes.Count || size == 0) - { - return; - } - - var offset = IntPtr.Zero; - if (index > 0) - { - var node = nodes[index - 1]; - offset = node.Offset + node.MemorySize; - } - - while (size > 0) - { - var node = new VMethodNode - { - Offset = offset, - ParentNode = this - }; - - nodes.Insert(index, node); - - createdNodes?.Add(node); - - offset += node.MemorySize; - size -= node.MemorySize; - - index++; - } - - UpdateOffsets(); - } - - public override void InsertNode(int index, BaseNode node) - { - if (!(node is VMethodNode)) - { - return; - } - - base.InsertNode(index, node); - - UpdateOffsets(); - } - - public override bool RemoveNode(BaseNode node) - { - var removed = base.RemoveNode(node); - if (removed) - { - UpdateOffsets(); - } - return removed; - } - } -} diff --git a/ReClass.NET/Nodes/Vector2Node.cs b/ReClass.NET/Nodes/Vector2Node.cs index 713dca38..a3df104a 100644 --- a/ReClass.NET/Nodes/Vector2Node.cs +++ b/ReClass.NET/Nodes/Vector2Node.cs @@ -1,44 +1,27 @@ -using System.Drawing; -using System.Runtime.InteropServices; +using System.Drawing; +using ReClassNET.Controls; using ReClassNET.UI; namespace ReClassNET.Nodes { public class Vector2Node : BaseMatrixNode { - [StructLayout(LayoutKind.Explicit)] - private 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; - /// Draws this node. - /// The view information. - /// The x coordinate. - /// The y coordinate. - /// The pixel size the node occupies. - public override Size Draw(ViewInfo view, int x2, int y2) + public override void GetUserInterfaceInfo(out string name, out Image icon) { - return DrawVectorType(view, x2, y2, "Vector2", (ref int x, ref int y) => - { - var value = view.Memory.ReadObject(Offset); + name = "Vector2"; + icon = Properties.Resources.B16x16_Button_Vector_2; + } - 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, ")"); - }); + public override Size Draw(DrawContext context, int x2, int y2) + { + return DrawVectorType(context, x2, y2, "Vector2", 2); } - protected override int CalculateValuesHeight(ViewInfo view) + protected override int CalculateValuesHeight(DrawContext context) { return 0; } diff --git a/ReClass.NET/Nodes/Vector3Node.cs b/ReClass.NET/Nodes/Vector3Node.cs index bc5140d9..b2b84b25 100644 --- a/ReClass.NET/Nodes/Vector3Node.cs +++ b/ReClass.NET/Nodes/Vector3Node.cs @@ -1,48 +1,27 @@ -using System.Drawing; -using System.Runtime.InteropServices; +using System.Drawing; +using ReClassNET.Controls; using ReClassNET.UI; namespace ReClassNET.Nodes { public class Vector3Node : BaseMatrixNode { - [StructLayout(LayoutKind.Explicit)] - private 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; - /// Draws this node. - /// The view information. - /// The x coordinate. - /// The y coordinate. - /// The pixel size the node occupies. - public override Size Draw(ViewInfo view, int x2, int y2) + public override void GetUserInterfaceInfo(out string name, out Image icon) { - return DrawVectorType(view, x2, y2, "Vector3", (ref int x, ref int y) => - { - var value = view.Memory.ReadObject(Offset); + name = "Vector3"; + icon = Properties.Resources.B16x16_Button_Vector_3; + } - 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, ")"); - }); + public override Size Draw(DrawContext context, int x2, int y2) + { + return DrawVectorType(context, x2, y2, "Vector3", 3); } - protected override int CalculateValuesHeight(ViewInfo view) + protected override int CalculateValuesHeight(DrawContext context) { return 0; } diff --git a/ReClass.NET/Nodes/Vector4Node.cs b/ReClass.NET/Nodes/Vector4Node.cs index 1db6ce03..54f1a43c 100644 --- a/ReClass.NET/Nodes/Vector4Node.cs +++ b/ReClass.NET/Nodes/Vector4Node.cs @@ -1,52 +1,27 @@ -using System.Drawing; -using System.Runtime.InteropServices; +using System.Drawing; +using ReClassNET.Controls; using ReClassNET.UI; namespace ReClassNET.Nodes { public class Vector4Node : BaseMatrixNode { - [StructLayout(LayoutKind.Explicit)] - private 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; - /// Draws this node. - /// The view information. - /// The x coordinate. - /// The y coordinate. - /// The pixel size the node occupies. - public override Size Draw(ViewInfo view, int x2, int y2) + public override void GetUserInterfaceInfo(out string name, out Image icon) { - return DrawVectorType(view, x2, y2, "Vector4", (ref int x, ref int y) => - { - var value = view.Memory.ReadObject(Offset); + name = "Vector4"; + icon = Properties.Resources.B16x16_Button_Vector_4; + } - 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, ")"); - }); + public override Size Draw(DrawContext context, int x2, int y2) + { + return DrawVectorType(context, x2, y2, "Vector4", 4); } - protected override int CalculateValuesHeight(ViewInfo view) + protected override int CalculateValuesHeight(DrawContext context) { return 0; } diff --git a/ReClass.NET/Nodes/VirtualMethodNode.cs b/ReClass.NET/Nodes/VirtualMethodNode.cs new file mode 100644 index 00000000..22bae685 --- /dev/null +++ b/ReClass.NET/Nodes/VirtualMethodNode.cs @@ -0,0 +1,29 @@ +using System; +using System.Diagnostics.Contracts; +using System.Drawing; +using ReClassNET.Controls; + +namespace ReClassNET.Nodes +{ + public class VirtualMethodNode : BaseFunctionPtrNode + { + public string MethodName => string.IsNullOrEmpty(Name) ? $"Function{Offset / IntPtr.Size}" : Name; + + public override void GetUserInterfaceInfo(out string name, out Image icon) + { + throw new InvalidOperationException($"The '{nameof(VirtualMethodNode)}' node should not be accessible from the ui."); + } + + public VirtualMethodNode() + { + Contract.Ensures(Name != null); + + Name = string.Empty; + } + + public override Size Draw(DrawContext context, int x, int y) + { + return Draw(context, x, y, $"({Offset / IntPtr.Size})", MethodName); + } + } +} diff --git a/ReClass.NET/Nodes/VirtualMethodTableNode.cs b/ReClass.NET/Nodes/VirtualMethodTableNode.cs new file mode 100644 index 00000000..9e82ab40 --- /dev/null +++ b/ReClass.NET/Nodes/VirtualMethodTableNode.cs @@ -0,0 +1,117 @@ +using System; +using System.Drawing; +using System.Linq; +using ReClassNET.Controls; +using ReClassNET.Memory; +using ReClassNET.UI; + +namespace ReClassNET.Nodes +{ + public class VirtualMethodTableNode : BaseContainerNode + { + private readonly MemoryBuffer memory = new MemoryBuffer(); + + public override int MemorySize => IntPtr.Size; + + protected override bool ShouldCompensateSizeChanges => false; + + public override void GetUserInterfaceInfo(out string name, out Image icon) + { + name = "VTable Pointer"; + icon = Properties.Resources.B16x16_Button_VTable; + } + + public override bool CanHandleChildNode(BaseNode node) + { + return node is VirtualMethodNode; + } + + public override void Initialize() + { + for (var i = 0; i < 10; ++i) + { + AddNode(CreateDefaultNodeForSize(IntPtr.Size)); + } + } + + public override Size Draw(DrawContext context, int x, int y) + { + if (IsHidden && !IsWrapped) + { + return DrawHidden(context, x, y); + } + + var origX = x; + var origY = y; + + AddSelection(context, x, y, context.Font.Height); + + x = AddOpenCloseIcon(context, x, y); + x = AddIcon(context, x, y, context.IconProvider.VirtualTable, HotSpot.NoneId, HotSpotType.None); + + var tx = x; + x = AddAddressOffset(context, x, y); + + x = AddText(context, x, y, context.Settings.VTableColor, HotSpot.NoneId, $"VTable[{Nodes.Count}]") + context.Font.Width; + if (!IsWrapped) + { + x = AddText(context, x, y, context.Settings.NameColor, HotSpot.NameId, Name) + context.Font.Width; + } + + x = AddComment(context, x, y); + + DrawInvalidMemoryIndicatorIcon(context, y); + AddContextDropDownIcon(context, y); + AddDeleteIcon(context, y); + + y += context.Font.Height; + + var size = new Size(x - origX, y - origY); + + if (LevelsOpen[context.Level]) + { + var ptr = context.Memory.ReadIntPtr(Offset); + + memory.Size = Nodes.Count * IntPtr.Size; + memory.UpdateFrom(context.Process, ptr); + + var innerContext = context.Clone(); + innerContext.Address = ptr; + innerContext.Memory = memory; + + foreach (var node in Nodes) + { + var innerSize = node.Draw(innerContext, tx, y); + + size.Width = Math.Max(size.Width, innerSize.Width + tx - origX); + size.Height += innerSize.Height; + + y += innerSize.Height; + } + } + + return size; + } + + public override int CalculateDrawnHeight(DrawContext context) + { + if (IsHidden && !IsWrapped) + { + return HiddenHeight; + } + + var height = context.Font.Height; + if (LevelsOpen[context.Level]) + { + height += Nodes.Sum(n => n.CalculateDrawnHeight(context)); + } + return height; + } + + protected override BaseNode CreateDefaultNodeForSize(int size) + { + // ignore the size parameter + return new VirtualMethodNode(); + } + } +} diff --git a/ReClass.NET/Plugins/DefaultPluginHost.cs b/ReClass.NET/Plugins/DefaultPluginHost.cs index aeac6bce..24b3958a 100644 --- a/ReClass.NET/Plugins/DefaultPluginHost.cs +++ b/ReClass.NET/Plugins/DefaultPluginHost.cs @@ -1,13 +1,8 @@ -using System; using System.Diagnostics.Contracts; -using System.Drawing; using System.Resources; -using ReClassNET.CodeGenerator; -using ReClassNET.DataExchange.ReClass; using ReClassNET.Forms; using ReClassNET.Logger; using ReClassNET.Memory; -using ReClassNET.Nodes; namespace ReClassNET.Plugins { @@ -33,31 +28,5 @@ public DefaultPluginHost(MainForm form, RemoteProcess process, ILogger logger) Process = process; Logger = logger; } - - public void RegisterNodeInfoReader(INodeInfoReader reader) - { - BaseNode.NodeInfoReader.Add(reader); - } - - public void DeregisterNodeInfoReader(INodeInfoReader reader) - { - BaseNode.NodeInfoReader.Remove(reader); - } - - public void RegisterNodeType(Type type, string name, Image icon, ICustomNodeConverter converter, ICustomCodeGenerator generator) - { - CustomNodeConvert.RegisterCustomType(converter); - CustomCodeGenerator.RegisterCustomType(generator); - - MainWindow.RegisterNodeType(type, name, icon ?? Properties.Resources.B16x16_Plugin); - } - - public void DeregisterNodeType(Type type, ICustomNodeConverter converter, ICustomCodeGenerator generator) - { - CustomNodeConvert.DeregisterCustomType(converter); - CustomCodeGenerator.DeregisterCustomType(generator); - - MainWindow.DeregisterNodeType(type); - } } } diff --git a/ReClass.NET/Plugins/IPluginHost.cs b/ReClass.NET/Plugins/IPluginHost.cs index 927d044a..7be6bf4d 100644 --- a/ReClass.NET/Plugins/IPluginHost.cs +++ b/ReClass.NET/Plugins/IPluginHost.cs @@ -1,13 +1,9 @@ using System; using System.Diagnostics.Contracts; -using System.Drawing; using System.Resources; -using ReClassNET.CodeGenerator; -using ReClassNET.DataExchange.ReClass; using ReClassNET.Forms; using ReClassNET.Logger; using ReClassNET.Memory; -using ReClassNET.Nodes; namespace ReClassNET.Plugins { @@ -28,28 +24,6 @@ public interface IPluginHost /// Gets the settings ReClass.NET is using. Settings Settings { get; } - - /// Registers a node information reader to display custom data on nodes. - /// The node information reader. - void RegisterNodeInfoReader(INodeInfoReader reader); - - /// Unregisters the node information reader. - /// The node information reader. - void DeregisterNodeInfoReader(INodeInfoReader reader); - - /// Registers a new node type. - /// The type of the node. - /// The name of the type. - /// The icon of the type (may be null). - /// The converter used to serialize the node. - /// The generator used to generate code from the node. - void RegisterNodeType(Type type, string name, Image icon, ICustomNodeConverter converter, ICustomCodeGenerator generator); - - /// Unregisters a node type. - /// The type of the node. - /// The converter used to serialize the node. - /// The generator used to generate code from the node. - void DeregisterNodeType(Type type, ICustomNodeConverter converter, ICustomCodeGenerator generator); } [ContractClassFor(typeof(IPluginHost))] @@ -104,38 +78,5 @@ public Settings Settings throw new NotImplementedException(); } } - - public void RegisterNodeInfoReader(INodeInfoReader reader) - { - Contract.Requires(reader != null); - - throw new NotImplementedException(); - } - - public void RegisterNodeType(Type type, string name, Image icon, ICustomNodeConverter converter, ICustomCodeGenerator generator) - { - Contract.Requires(type != null); - Contract.Requires(name != null); - Contract.Requires(converter != null); - Contract.Requires(generator != null); - - throw new NotImplementedException(); - } - - public void DeregisterNodeInfoReader(INodeInfoReader reader) - { - Contract.Requires(reader != null); - - throw new NotImplementedException(); - } - - public void DeregisterNodeType(Type type, ICustomNodeConverter converter, ICustomCodeGenerator generator) - { - Contract.Requires(type != null); - Contract.Requires(converter != null); - Contract.Requires(generator != null); - - throw new NotImplementedException(); - } } } diff --git a/ReClass.NET/Plugins/Plugin.cs b/ReClass.NET/Plugins/Plugin.cs index b99173f5..2004be7e 100644 --- a/ReClass.NET/Plugins/Plugin.cs +++ b/ReClass.NET/Plugins/Plugin.cs @@ -1,10 +1,36 @@ +using System; +using System.Collections.Generic; using System.Diagnostics.Contracts; using System.Drawing; +using ReClassNET.CodeGenerator; +using ReClassNET.DataExchange.ReClass; +using ReClassNET.Nodes; namespace ReClassNET.Plugins { - public abstract class Plugin + public class Plugin { + public class CustomNodeTypes + { + /// + /// A list with custom node types. + /// + public IReadOnlyList NodeTypes { get; set; } + + /// + /// An instance of a serializer which can process the custom node types. + /// + public ICustomNodeSerializer Serializer { get; set; } + + /// + /// An instance of a code generator which can process the custom node types. + /// + public CustomCppCodeGenerator CodeGenerator { get; set; } + } + + /// + /// The icon of the plugin. + /// public virtual Image Icon => null; public virtual bool Initialize(IPluginHost host) @@ -18,5 +44,23 @@ public virtual void Terminate() { } + + /// + /// Gets called once to receive all node info readers the plugin provides. + /// + /// A list with node info readers or null if the plugin provides none. + public virtual IReadOnlyList GetNodeInfoReaders() + { + return null; + } + + /// + /// Gets called once to receive all custom node types the plugin provides. + /// + /// Informations about the custom nodes or null if the plugin provides none. + public virtual CustomNodeTypes GetCustomNodeTypes() + { + return null; + } } } diff --git a/ReClass.NET/Plugins/PluginInfo.cs b/ReClass.NET/Plugins/PluginInfo.cs index 254ce400..c9c9e72f 100644 --- a/ReClass.NET/Plugins/PluginInfo.cs +++ b/ReClass.NET/Plugins/PluginInfo.cs @@ -1,9 +1,11 @@ using System; +using System.Collections.Generic; using System.Diagnostics; using System.Diagnostics.Contracts; using System.IO; +using ReClassNET.Extensions; using ReClassNET.Native; -using ReClassNET.Util; +using ReClassNET.Nodes; namespace ReClassNET.Plugins { @@ -28,6 +30,10 @@ internal class PluginInfo : IDisposable public IntPtr NativeHandle { get; set; } + public IReadOnlyList NodeInfoReaders { get; set; } + + public Plugin.CustomNodeTypes CustomNodeTypes { get; set; } + public PluginInfo(string filePath, FileVersionInfo versionInfo) { Contract.Requires(filePath != null); @@ -48,8 +54,6 @@ public PluginInfo(string filePath, FileVersionInfo versionInfo) } } - #region IDisposable Support - ~PluginInfo() { ReleaseUnmanagedResources(); @@ -75,7 +79,7 @@ public void Dispose() } catch { - + // ignored } } @@ -83,7 +87,5 @@ public void Dispose() GC.SuppressFinalize(this); } - - #endregion } } diff --git a/ReClass.NET/Plugins/PluginManager.cs b/ReClass.NET/Plugins/PluginManager.cs index 03c12257..d4372fb8 100644 --- a/ReClass.NET/Plugins/PluginManager.cs +++ b/ReClass.NET/Plugins/PluginManager.cs @@ -3,10 +3,14 @@ using System.Diagnostics; using System.Diagnostics.Contracts; using System.IO; +using ReClassNET.CodeGenerator; using ReClassNET.Core; +using ReClassNET.DataExchange.ReClass; +using ReClassNET.Extensions; using ReClassNET.Logger; using ReClassNET.Native; -using ReClassNET.Util; +using ReClassNET.Nodes; +using ReClassNET.UI; namespace ReClassNET.Plugins { @@ -39,11 +43,11 @@ public void LoadAllPlugins(string path, ILogger logger) var directory = new DirectoryInfo(path); - LoadPlugins(directory.GetFiles("*.dll"), logger, true); + LoadPlugins(directory.GetFiles("*.dll", SearchOption.AllDirectories), logger, true); - LoadPlugins(directory.GetFiles("*.exe"), logger, true); + LoadPlugins(directory.GetFiles("*.exe", SearchOption.AllDirectories), logger, true); - LoadPlugins(directory.GetFiles("*.so"), logger, false); + LoadPlugins(directory.GetFiles("*.so", SearchOption.AllDirectories), logger, false); } catch (Exception ex) { @@ -86,6 +90,9 @@ private void LoadPlugins(IEnumerable files, ILogger logger, bool check { continue; } + + RegisterNodeInfoReaders(pi); + RegisterCustomNodeTypes(pi); } else { @@ -108,7 +115,17 @@ private void LoadPlugins(IEnumerable files, ILogger logger, bool check public void UnloadAllPlugins() { - plugins.ForEach(p => p.Dispose()); + foreach (var pi in plugins) + { + if (pi.Interface != null) // Exclude native plugins + { + DeregisterNodeInfoReaders(pi); + DeregisterCustomNodeTypes(pi); + } + + pi.Dispose(); + } + plugins.Clear(); } @@ -135,9 +152,87 @@ private static IntPtr CreateNativePluginInstance(string filePath) var handle = NativeMethods.LoadLibrary(filePath); if (handle.IsNull()) { - throw new FileLoadException(); + throw new FileLoadException($"Failed to load native plugin: {Path.GetFileName(filePath)}"); } return handle; } + + private static void RegisterNodeInfoReaders(PluginInfo pluginInfo) + { + Contract.Requires(pluginInfo != null); + + var nodeInfoReaders = pluginInfo.Interface.GetNodeInfoReaders(); + + if (nodeInfoReaders == null || nodeInfoReaders.Count == 0) + { + return; + } + + pluginInfo.NodeInfoReaders = nodeInfoReaders; + + BaseNode.NodeInfoReader.AddRange(nodeInfoReaders); + } + + private static void DeregisterNodeInfoReaders(PluginInfo pluginInfo) + { + Contract.Requires(pluginInfo != null); + + if (pluginInfo.NodeInfoReaders == null) + { + return; + } + + foreach (var reader in pluginInfo.NodeInfoReaders) + { + BaseNode.NodeInfoReader.Remove(reader); + } + } + + private static void RegisterCustomNodeTypes(PluginInfo pluginInfo) + { + Contract.Requires(pluginInfo != null); + + var customNodeTypes = pluginInfo.Interface.GetCustomNodeTypes(); + + if (customNodeTypes == null) + { + return; + } + + if (customNodeTypes.NodeTypes == null || customNodeTypes.Serializer == null || customNodeTypes.CodeGenerator == null) + { + throw new ArgumentException(); // TODO + } + + foreach (var nodeType in customNodeTypes.NodeTypes) + { + if (!nodeType.IsSubclassOf(typeof(BaseNode))) + { + throw new ArgumentException($"Type '{nodeType}' is not a valid node."); + } + } + + pluginInfo.CustomNodeTypes = customNodeTypes; + + NodeTypesBuilder.AddPluginNodeGroup(pluginInfo.Interface, customNodeTypes.NodeTypes); + + CustomNodeSerializer.Add(customNodeTypes.Serializer); + CppCodeGenerator.Add(customNodeTypes.CodeGenerator); + } + + private static void DeregisterCustomNodeTypes(PluginInfo pluginInfo) + { + Contract.Requires(pluginInfo != null); + + if (pluginInfo.CustomNodeTypes == null) + { + return; + } + + NodeTypesBuilder.RemovePluginNodeGroup(pluginInfo.Interface); + + CustomNodeSerializer.Remove(pluginInfo.CustomNodeTypes.Serializer); + CppCodeGenerator.Remove(pluginInfo.CustomNodeTypes.CodeGenerator); + } } } diff --git a/ReClass.NET/Program.cs b/ReClass.NET/Program.cs index d5e04f87..f28cb0bd 100644 --- a/ReClass.NET/Program.cs +++ b/ReClass.NET/Program.cs @@ -1,4 +1,5 @@ -using System; +using System; +using System.Diagnostics; using System.Drawing; using System.Globalization; using System.Windows.Forms; @@ -43,10 +44,11 @@ static void Main(string[] args) try { DpiUtil.ConfigureProcess(); + DpiUtil.TrySetDpiFromCurrentDesktop(); } catch { - + // ignored } MonoSpaceFont = new FontEx @@ -65,7 +67,17 @@ static void Main(string[] args) Settings = SettingsSerializer.Load(); Logger = new GuiLogger(); -#if DEBUG + + if (!NativeMethods.IsUnix() && Settings.RunAsAdmin && !WinUtil.IsAdministrator) + { + WinUtil.RunElevated(Process.GetCurrentProcess().MainModule?.FileName, args.Length > 0 ? string.Join(" ", args) : null); + return; + } + +#if !DEBUG + try + { +#endif using (var coreFunctions = new CoreFunctionsManager()) { RemoteProcess = new RemoteProcess(coreFunctions); @@ -76,19 +88,7 @@ static void Main(string[] args) RemoteProcess.Dispose(); } -#else - try - { - using (var coreFunctions = new CoreFunctionsManager()) - { - RemoteProcess = new RemoteProcess(coreFunctions); - - MainForm = new MainForm(); - - Application.Run(MainForm); - - RemoteProcess.Dispose(); - } +#if !DEBUG } catch (Exception ex) { @@ -107,6 +107,7 @@ public static void ShowException(Exception ex) var msg = new ExceptionMessageBox(ex) { + Beep = false, ShowToolBar = true, Symbol = ExceptionMessageBoxSymbol.Error }; diff --git a/ReClass.NET/Project/CppTypeMapping.cs b/ReClass.NET/Project/CppTypeMapping.cs new file mode 100644 index 00000000..03e1bc48 --- /dev/null +++ b/ReClass.NET/Project/CppTypeMapping.cs @@ -0,0 +1,96 @@ +using System.Xml.Linq; +using ReClassNET.Util; + +namespace ReClassNET.Project +{ + public class CppTypeMapping + { + public string TypeBool { get; set; } = "bool"; + + public string TypeInt8 { get; set; } = "int8_t"; + 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"; + + public string TypeVector2 { get; set; } = "Vector2"; + public string TypeVector3 { get; set; } = "Vector3"; + public string TypeVector4 { get; set; } = "Vector4"; + + public string TypeMatrix3x3 { get; set; } = "Matrix3x3"; + public string TypeMatrix3x4 { get; set; } = "Matrix3x4"; + public string TypeMatrix4x4 { get; set; } = "Matrix4x4"; + + public string TypeUtf8Text { get; set; } = "char"; + public string TypeUtf16Text { get; set; } = "wchar_t"; // Should be char16_t, but this type isn't well supported at the moment. + public string TypeUtf32Text { get; set; } = "char32_t"; + + public string TypeFunctionPtr { get; set; } = "void*"; + + internal XElement Serialize(string name) + { + return new XElement( + name, + XElementSerializer.ToXml(nameof(TypeBool), TypeBool), + XElementSerializer.ToXml(nameof(TypeInt8), TypeInt8), + 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), + XElementSerializer.ToXml(nameof(TypeVector3), TypeVector3), + XElementSerializer.ToXml(nameof(TypeVector4), TypeVector4), + XElementSerializer.ToXml(nameof(TypeMatrix3x3), TypeMatrix3x3), + XElementSerializer.ToXml(nameof(TypeMatrix3x4), TypeMatrix3x4), + XElementSerializer.ToXml(nameof(TypeMatrix4x4), TypeMatrix4x4), + XElementSerializer.ToXml(nameof(TypeUtf8Text), TypeUtf8Text), + XElementSerializer.ToXml(nameof(TypeUtf16Text), TypeUtf16Text), + XElementSerializer.ToXml(nameof(TypeUtf32Text), TypeUtf32Text), + XElementSerializer.ToXml(nameof(TypeFunctionPtr), TypeFunctionPtr) + ); + } + + internal void Deserialize(XElement element) + { + XElementSerializer.TryRead(element, nameof(TypeBool), e => TypeBool = XElementSerializer.ToString(e)); + XElementSerializer.TryRead(element, nameof(TypeInt8), e => TypeInt8 = XElementSerializer.ToString(e)); + 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)); + XElementSerializer.TryRead(element, nameof(TypeVector3), e => TypeVector3 = XElementSerializer.ToString(e)); + XElementSerializer.TryRead(element, nameof(TypeVector4), e => TypeVector4 = XElementSerializer.ToString(e)); + XElementSerializer.TryRead(element, nameof(TypeMatrix3x3), e => TypeMatrix3x3 = XElementSerializer.ToString(e)); + XElementSerializer.TryRead(element, nameof(TypeMatrix3x4), e => TypeMatrix3x4 = XElementSerializer.ToString(e)); + XElementSerializer.TryRead(element, nameof(TypeMatrix4x4), e => TypeMatrix4x4 = XElementSerializer.ToString(e)); + XElementSerializer.TryRead(element, nameof(TypeUtf8Text), e => TypeUtf8Text = XElementSerializer.ToString(e)); + XElementSerializer.TryRead(element, nameof(TypeUtf16Text), e => TypeUtf16Text = XElementSerializer.ToString(e)); + XElementSerializer.TryRead(element, nameof(TypeUtf32Text), e => TypeUtf32Text = XElementSerializer.ToString(e)); + XElementSerializer.TryRead(element, nameof(TypeFunctionPtr), e => TypeFunctionPtr = XElementSerializer.ToString(e)); + } + } +} diff --git a/ReClass.NET/Project/EnumDescription.cs b/ReClass.NET/Project/EnumDescription.cs new file mode 100644 index 00000000..6c72596b --- /dev/null +++ b/ReClass.NET/Project/EnumDescription.cs @@ -0,0 +1,83 @@ +using System; +using System.Collections.Generic; +using System.Linq; + +namespace ReClassNET.Project +{ + public class EnumDescription + { + public enum UnderlyingTypeSize + { + OneByte = 1, + TwoBytes = 2, + FourBytes = 4, + EightBytes = 8 + } + + public static EnumDescription Default => new EnumDescription { Name = "DummyEnum" }; + + public string Name { get; set; } = string.Empty; + + public bool UseFlagsMode { get; private set; } + + public UnderlyingTypeSize Size { get; private set; } = UnderlyingTypeSize.FourBytes; + + public IReadOnlyList> Values { get; private set; } = new Dictionary().ToList(); + + public void SetData(bool useFlagsMode, UnderlyingTypeSize size, IEnumerable> values) + { + var temp = values.OrderBy(t => t.Value).ToList(); + + if (useFlagsMode) + { + var maxPossibleValue = ulong.MaxValue; + switch (size) + { + case UnderlyingTypeSize.OneByte: + maxPossibleValue = byte.MaxValue; + break; + case UnderlyingTypeSize.TwoBytes: + maxPossibleValue = ushort.MaxValue; + break; + case UnderlyingTypeSize.FourBytes: + maxPossibleValue = uint.MaxValue; + break; + } + + if (temp.Select(kv => (ulong)kv.Value).Max() > maxPossibleValue) + { + throw new ArgumentOutOfRangeException(); + } + } + else + { + var minPossibleValue = long.MinValue; + var maxPossibleValue = long.MaxValue; + switch (size) + { + case UnderlyingTypeSize.OneByte: + minPossibleValue = sbyte.MinValue; + maxPossibleValue = sbyte.MaxValue; + break; + case UnderlyingTypeSize.TwoBytes: + minPossibleValue = short.MinValue; + maxPossibleValue = short.MaxValue; + break; + case UnderlyingTypeSize.FourBytes: + minPossibleValue = int.MinValue; + maxPossibleValue = int.MaxValue; + break; + } + + if (temp.Max(kv => kv.Value) > maxPossibleValue || temp.Min(kv => kv.Value) < minPossibleValue) + { + throw new ArgumentOutOfRangeException(); + } + } + + UseFlagsMode = useFlagsMode; + Size = size; + Values = temp; + } + } +} diff --git a/ReClass.NET/Project/ReClassNetProject.cs b/ReClass.NET/Project/ReClassNetProject.cs new file mode 100644 index 00000000..90f4b5ca --- /dev/null +++ b/ReClass.NET/Project/ReClassNetProject.cs @@ -0,0 +1,215 @@ +using System; +using System.Collections.Generic; +using System.Diagnostics.Contracts; +using System.Linq; +using ReClassNET.Nodes; +using ReClassNET.Util; + +namespace ReClassNET.Project +{ + public class ReClassNetProject : IDisposable + { + public delegate void ClassesChangedEvent(ClassNode sender); + public event ClassesChangedEvent ClassAdded; + public event ClassesChangedEvent ClassRemoved; + + public delegate void EnumsChangedEvent(EnumDescription sender); + public event EnumsChangedEvent EnumAdded; + public event EnumsChangedEvent EnumRemoved; + + private readonly List enums = new List(); + private readonly List classes = new List(); + + public IReadOnlyList Enums => enums; + + public IReadOnlyList Classes => classes; + + public string Path { get; set; } + + /// + /// Key-Value map with custom data for plugins to store project related data. + /// The preferred key format is {Plugin Name}_{Key Name}. + /// + public CustomDataMap CustomData { get; } = new CustomDataMap(); + + /// + /// List of data types to use while generating C++ code for nodes. + /// + public CppTypeMapping TypeMapping { get; } = new CppTypeMapping(); + + public void Dispose() + { + Clear(); + + ClassAdded = null; + ClassRemoved = null; + + EnumAdded = null; + EnumRemoved = null; + } + + public void AddClass(ClassNode node) + { + Contract.Requires(node != null); + + classes.Add(node); + + node.NodesChanged += NodesChanged_Handler; + + ClassAdded?.Invoke(node); + } + + public bool ContainsClass(Guid uuid) + { + Contract.Requires(uuid != null); + + return classes.Any(c => c.Uuid.Equals(uuid)); + } + + public ClassNode GetClassByUuid(Guid uuid) + { + Contract.Requires(uuid != null); + + return classes.First(c => c.Uuid.Equals(uuid)); + } + + private void NodesChanged_Handler(BaseNode sender) + { + classes.ForEach(c => c.UpdateOffsets()); + } + + public void Clear() + { + var temp = classes.ToList(); + + classes.Clear(); + + foreach (var node in temp) + { + node.NodesChanged -= NodesChanged_Handler; + + ClassRemoved?.Invoke(node); + } + + var temp2 = enums.ToList(); + + enums.Clear(); + + foreach (var @enum in temp2) + { + EnumRemoved?.Invoke(@enum); + } + } + + private IEnumerable GetClassReferences(ClassNode node) + { + Contract.Requires(node != null); + + return classes + .Where(c => c != node) + .Where(c => c.Nodes.OfType().Any(w => w.ResolveMostInnerNode() == node)); + } + + public void Remove(ClassNode node) + { + Contract.Requires(node != null); + + var references = GetClassReferences(node).ToList(); + if (references.Any()) + { + throw new ClassReferencedException(node, references); + } + + if (classes.Remove(node)) + { + node.NodesChanged -= NodesChanged_Handler; + + ClassRemoved?.Invoke(node); + } + } + + public void RemoveUnusedClasses() + { + var toRemove = classes + .Except(classes.Where(x => GetClassReferences(x).Any())) // check for references + .Where(c => c.Nodes.All(n => n is BaseHexNode)) // check if only hex nodes are present + .ToList(); + foreach (var node in toRemove) + { + if (classes.Remove(node)) + { + ClassRemoved?.Invoke(node); + } + } + } + + public void AddEnum(EnumDescription @enum) + { + Contract.Requires(@enum != null); + + enums.Add(@enum); + + EnumAdded?.Invoke(@enum); + } + + public void RemoveEnum(EnumDescription @enum) + { + Contract.Requires(@enum != null); + + var refrences = GetEnumReferences(@enum).ToList(); + if (refrences.Any()) + { + throw new EnumReferencedException(@enum, refrences.Select(e => e.GetParentClass()).Distinct()); + } + + if (enums.Remove(@enum)) + { + EnumRemoved?.Invoke(@enum); + } + } + + private IEnumerable GetEnumReferences(EnumDescription @enum) + { + Contract.Requires(@enum != null); + + return classes + .SelectMany(c => c.Nodes.Where(n => n is EnumNode || (n as BaseWrapperNode)?.ResolveMostInnerNode() is EnumNode)) + .Cast() + .Where(e => e.Enum == @enum); + } + } + + public class ClassReferencedException : Exception + { + public ClassNode ClassNode { get; } + public IEnumerable References { get; } + + public ClassReferencedException(ClassNode node, IEnumerable references) + : base($"The class '{node.Name}' is referenced in other classes.") + { + Contract.Requires(node != null); + Contract.Requires(references != null); + Contract.Requires(Contract.ForAll(references, c => c != null)); + + ClassNode = node; + References = references; + } + } + + public class EnumReferencedException : Exception + { + public EnumDescription Enum { get; } + public IEnumerable References { get; } + + public EnumReferencedException(EnumDescription @enum, IEnumerable references) + : base($"The enum '{@enum.Name}' is referenced in other classes.") + { + Contract.Requires(@enum != null); + Contract.Requires(references != null); + Contract.Requires(Contract.ForAll(references, c => c != null)); + + Enum = @enum; + References = references; + } + } +} diff --git a/ReClass.NET/Properties/AssemblyInfo.cs b/ReClass.NET/Properties/AssemblyInfo.cs index 8d5ac55d..77d83991 100644 --- a/ReClass.NET/Properties/AssemblyInfo.cs +++ b/ReClass.NET/Properties/AssemblyInfo.cs @@ -31,5 +31,5 @@ // Sie können alle Werte angeben oder die standardmäßigen Build- und Revisionsnummern // übernehmen, indem Sie "*" eingeben: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.1.0.0")] -[assembly: AssemblyFileVersion("1.1.0.0")] +[assembly: AssemblyVersion("1.2.0.0")] +[assembly: AssemblyFileVersion("1.2.0.0")] diff --git a/ReClass.NET/Properties/Resources.Designer.cs b/ReClass.NET/Properties/Resources.Designer.cs index d1c33bf3..3d412074 100644 --- a/ReClass.NET/Properties/Resources.Designer.cs +++ b/ReClass.NET/Properties/Resources.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. // //------------------------------------------------------------------------------ @@ -13,13 +13,13 @@ namespace ReClassNET.Properties { /// - /// Eine stark typisierte Ressourcenklasse zum Suchen von lokalisierten Zeichenfolgen usw. + /// A strongly-typed resource class, for looking up localized strings, etc. /// - // Diese Klasse wurde von der StronglyTypedResourceBuilder automatisch generiert - // -Klasse über ein Tool wie ResGen oder Visual Studio automatisch generiert. - // Um einen Member hinzuzufügen oder zu entfernen, bearbeiten Sie die .ResX-Datei und führen dann ResGen - // mit der /str-Option erneut aus, oder Sie erstellen Ihr VS-Projekt neu. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0")] + // This class was auto-generated by the StronglyTypedResourceBuilder + // 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", "16.0.0.0")] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] internal class Resources { @@ -33,7 +33,7 @@ internal Resources() { } /// - /// Gibt die zwischengespeicherte ResourceManager-Instanz zurück, die von dieser Klasse verwendet wird. + /// Returns the cached ResourceManager instance used by this class. /// [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] internal static global::System.Resources.ResourceManager ResourceManager { @@ -47,8 +47,8 @@ internal Resources() { } /// - /// Überschreibt die CurrentUICulture-Eigenschaft des aktuellen Threads für alle - /// Ressourcenzuordnungen, die diese stark typisierte Ressourcenklasse verwenden. + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. /// [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] internal static global::System.Globalization.CultureInfo Culture { @@ -61,7 +61,7 @@ internal Resources() { } /// - /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// Looks up a localized resource of type System.Drawing.Bitmap. /// internal static System.Drawing.Bitmap B16x16_Accept { get { @@ -71,7 +71,7 @@ internal static System.Drawing.Bitmap B16x16_Accept { } /// - /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// Looks up a localized resource of type System.Drawing.Bitmap. /// internal static System.Drawing.Bitmap B16x16_Array_Type { get { @@ -81,7 +81,7 @@ internal static System.Drawing.Bitmap B16x16_Array_Type { } /// - /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// Looks up a localized resource of type System.Drawing.Bitmap. /// internal static System.Drawing.Bitmap B16x16_Arrow_Refresh { get { @@ -91,7 +91,7 @@ internal static System.Drawing.Bitmap B16x16_Arrow_Refresh { } /// - /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// Looks up a localized resource of type System.Drawing.Bitmap. /// internal static System.Drawing.Bitmap B16x16_Button_Add { get { @@ -101,7 +101,7 @@ internal static System.Drawing.Bitmap B16x16_Button_Add { } /// - /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// Looks up a localized resource of type System.Drawing.Bitmap. /// internal static System.Drawing.Bitmap B16x16_Button_Add_Bytes_1024 { get { @@ -111,7 +111,7 @@ internal static System.Drawing.Bitmap B16x16_Button_Add_Bytes_1024 { } /// - /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// Looks up a localized resource of type System.Drawing.Bitmap. /// internal static System.Drawing.Bitmap B16x16_Button_Add_Bytes_2048 { get { @@ -121,7 +121,7 @@ internal static System.Drawing.Bitmap B16x16_Button_Add_Bytes_2048 { } /// - /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// Looks up a localized resource of type System.Drawing.Bitmap. /// internal static System.Drawing.Bitmap B16x16_Button_Add_Bytes_256 { get { @@ -131,7 +131,7 @@ internal static System.Drawing.Bitmap B16x16_Button_Add_Bytes_256 { } /// - /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// Looks up a localized resource of type System.Drawing.Bitmap. /// internal static System.Drawing.Bitmap B16x16_Button_Add_Bytes_4 { get { @@ -141,7 +141,7 @@ internal static System.Drawing.Bitmap B16x16_Button_Add_Bytes_4 { } /// - /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// Looks up a localized resource of type System.Drawing.Bitmap. /// internal static System.Drawing.Bitmap B16x16_Button_Add_Bytes_4096 { get { @@ -151,7 +151,7 @@ internal static System.Drawing.Bitmap B16x16_Button_Add_Bytes_4096 { } /// - /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// Looks up a localized resource of type System.Drawing.Bitmap. /// internal static System.Drawing.Bitmap B16x16_Button_Add_Bytes_64 { get { @@ -161,7 +161,7 @@ internal static System.Drawing.Bitmap B16x16_Button_Add_Bytes_64 { } /// - /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// Looks up a localized resource of type System.Drawing.Bitmap. /// internal static System.Drawing.Bitmap B16x16_Button_Add_Bytes_8 { get { @@ -171,7 +171,7 @@ internal static System.Drawing.Bitmap B16x16_Button_Add_Bytes_8 { } /// - /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// Looks up a localized resource of type System.Drawing.Bitmap. /// internal static System.Drawing.Bitmap B16x16_Button_Add_Bytes_X { get { @@ -181,7 +181,7 @@ internal static System.Drawing.Bitmap B16x16_Button_Add_Bytes_X { } /// - /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// Looks up a localized resource of type System.Drawing.Bitmap. /// internal static System.Drawing.Bitmap B16x16_Button_Array { get { @@ -191,7 +191,7 @@ internal static System.Drawing.Bitmap B16x16_Button_Array { } /// - /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// Looks up a localized resource of type System.Drawing.Bitmap. /// internal static System.Drawing.Bitmap B16x16_Button_Bits { get { @@ -201,7 +201,7 @@ internal static System.Drawing.Bitmap B16x16_Button_Bits { } /// - /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// Looks up a localized resource of type System.Drawing.Bitmap. /// internal static System.Drawing.Bitmap B16x16_Button_Bool { get { @@ -211,7 +211,7 @@ internal static System.Drawing.Bitmap B16x16_Button_Bool { } /// - /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// Looks up a localized resource of type System.Drawing.Bitmap. /// internal static System.Drawing.Bitmap B16x16_Button_Class_Add { get { @@ -221,7 +221,7 @@ internal static System.Drawing.Bitmap B16x16_Button_Class_Add { } /// - /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// Looks up a localized resource of type System.Drawing.Bitmap. /// internal static System.Drawing.Bitmap B16x16_Button_Class_Instance { get { @@ -231,7 +231,7 @@ internal static System.Drawing.Bitmap B16x16_Button_Class_Instance { } /// - /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// Looks up a localized resource of type System.Drawing.Bitmap. /// internal static System.Drawing.Bitmap B16x16_Button_Class_Pointer { get { @@ -241,7 +241,7 @@ internal static System.Drawing.Bitmap B16x16_Button_Class_Pointer { } /// - /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// Looks up a localized resource of type System.Drawing.Bitmap. /// internal static System.Drawing.Bitmap B16x16_Button_Class_Remove { get { @@ -251,7 +251,7 @@ internal static System.Drawing.Bitmap B16x16_Button_Class_Remove { } /// - /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// Looks up a localized resource of type System.Drawing.Bitmap. /// internal static System.Drawing.Bitmap B16x16_Button_Delete { get { @@ -261,7 +261,7 @@ internal static System.Drawing.Bitmap B16x16_Button_Delete { } /// - /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// Looks up a localized resource of type System.Drawing.Bitmap. /// internal static System.Drawing.Bitmap B16x16_Button_Double { get { @@ -271,7 +271,7 @@ internal static System.Drawing.Bitmap B16x16_Button_Double { } /// - /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// Looks up a localized resource of type System.Drawing.Bitmap. /// internal static System.Drawing.Bitmap B16x16_Button_Drop_Down { get { @@ -281,7 +281,17 @@ internal static System.Drawing.Bitmap B16x16_Button_Drop_Down { } /// - /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap B16x16_Button_Enum { + get { + object obj = ResourceManager.GetObject("B16x16_Button_Enum", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. /// internal static System.Drawing.Bitmap B16x16_Button_Float { get { @@ -291,7 +301,7 @@ internal static System.Drawing.Bitmap B16x16_Button_Float { } /// - /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// Looks up a localized resource of type System.Drawing.Bitmap. /// internal static System.Drawing.Bitmap B16x16_Button_Function { get { @@ -301,7 +311,7 @@ internal static System.Drawing.Bitmap B16x16_Button_Function { } /// - /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// Looks up a localized resource of type System.Drawing.Bitmap. /// internal static System.Drawing.Bitmap B16x16_Button_Function_Pointer { get { @@ -311,7 +321,7 @@ internal static System.Drawing.Bitmap B16x16_Button_Function_Pointer { } /// - /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// Looks up a localized resource of type System.Drawing.Bitmap. /// internal static System.Drawing.Bitmap B16x16_Button_Hex_16 { get { @@ -321,7 +331,7 @@ internal static System.Drawing.Bitmap B16x16_Button_Hex_16 { } /// - /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// Looks up a localized resource of type System.Drawing.Bitmap. /// internal static System.Drawing.Bitmap B16x16_Button_Hex_32 { get { @@ -331,7 +341,7 @@ internal static System.Drawing.Bitmap B16x16_Button_Hex_32 { } /// - /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// Looks up a localized resource of type System.Drawing.Bitmap. /// internal static System.Drawing.Bitmap B16x16_Button_Hex_64 { get { @@ -341,7 +351,7 @@ internal static System.Drawing.Bitmap B16x16_Button_Hex_64 { } /// - /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// Looks up a localized resource of type System.Drawing.Bitmap. /// internal static System.Drawing.Bitmap B16x16_Button_Hex_8 { get { @@ -351,7 +361,7 @@ internal static System.Drawing.Bitmap B16x16_Button_Hex_8 { } /// - /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// Looks up a localized resource of type System.Drawing.Bitmap. /// internal static System.Drawing.Bitmap B16x16_Button_Insert_Bytes_1024 { get { @@ -361,7 +371,7 @@ internal static System.Drawing.Bitmap B16x16_Button_Insert_Bytes_1024 { } /// - /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// Looks up a localized resource of type System.Drawing.Bitmap. /// internal static System.Drawing.Bitmap B16x16_Button_Insert_Bytes_2048 { get { @@ -371,7 +381,7 @@ internal static System.Drawing.Bitmap B16x16_Button_Insert_Bytes_2048 { } /// - /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// Looks up a localized resource of type System.Drawing.Bitmap. /// internal static System.Drawing.Bitmap B16x16_Button_Insert_Bytes_256 { get { @@ -381,7 +391,7 @@ internal static System.Drawing.Bitmap B16x16_Button_Insert_Bytes_256 { } /// - /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// Looks up a localized resource of type System.Drawing.Bitmap. /// internal static System.Drawing.Bitmap B16x16_Button_Insert_Bytes_4 { get { @@ -391,7 +401,7 @@ internal static System.Drawing.Bitmap B16x16_Button_Insert_Bytes_4 { } /// - /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// Looks up a localized resource of type System.Drawing.Bitmap. /// internal static System.Drawing.Bitmap B16x16_Button_Insert_Bytes_4096 { get { @@ -401,7 +411,7 @@ internal static System.Drawing.Bitmap B16x16_Button_Insert_Bytes_4096 { } /// - /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// Looks up a localized resource of type System.Drawing.Bitmap. /// internal static System.Drawing.Bitmap B16x16_Button_Insert_Bytes_64 { get { @@ -411,7 +421,7 @@ internal static System.Drawing.Bitmap B16x16_Button_Insert_Bytes_64 { } /// - /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// Looks up a localized resource of type System.Drawing.Bitmap. /// internal static System.Drawing.Bitmap B16x16_Button_Insert_Bytes_8 { get { @@ -421,7 +431,7 @@ internal static System.Drawing.Bitmap B16x16_Button_Insert_Bytes_8 { } /// - /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// Looks up a localized resource of type System.Drawing.Bitmap. /// internal static System.Drawing.Bitmap B16x16_Button_Insert_Bytes_X { get { @@ -431,7 +441,7 @@ internal static System.Drawing.Bitmap B16x16_Button_Insert_Bytes_X { } /// - /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// Looks up a localized resource of type System.Drawing.Bitmap. /// internal static System.Drawing.Bitmap B16x16_Button_Int_16 { get { @@ -441,7 +451,7 @@ internal static System.Drawing.Bitmap B16x16_Button_Int_16 { } /// - /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// Looks up a localized resource of type System.Drawing.Bitmap. /// internal static System.Drawing.Bitmap B16x16_Button_Int_32 { get { @@ -451,7 +461,7 @@ internal static System.Drawing.Bitmap B16x16_Button_Int_32 { } /// - /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// Looks up a localized resource of type System.Drawing.Bitmap. /// internal static System.Drawing.Bitmap B16x16_Button_Int_64 { get { @@ -461,7 +471,7 @@ internal static System.Drawing.Bitmap B16x16_Button_Int_64 { } /// - /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// Looks up a localized resource of type System.Drawing.Bitmap. /// internal static System.Drawing.Bitmap B16x16_Button_Int_8 { get { @@ -471,7 +481,7 @@ internal static System.Drawing.Bitmap B16x16_Button_Int_8 { } /// - /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// Looks up a localized resource of type System.Drawing.Bitmap. /// internal static System.Drawing.Bitmap B16x16_Button_Matrix_3x3 { get { @@ -481,7 +491,7 @@ internal static System.Drawing.Bitmap B16x16_Button_Matrix_3x3 { } /// - /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// Looks up a localized resource of type System.Drawing.Bitmap. /// internal static System.Drawing.Bitmap B16x16_Button_Matrix_3x4 { get { @@ -491,7 +501,7 @@ internal static System.Drawing.Bitmap B16x16_Button_Matrix_3x4 { } /// - /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// Looks up a localized resource of type System.Drawing.Bitmap. /// internal static System.Drawing.Bitmap B16x16_Button_Matrix_4x4 { get { @@ -501,7 +511,37 @@ internal static System.Drawing.Bitmap B16x16_Button_Matrix_4x4 { } /// - /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// 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. + /// + internal static System.Drawing.Bitmap B16x16_Button_Pointer { + get { + object obj = ResourceManager.GetObject("B16x16_Button_Pointer", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. /// internal static System.Drawing.Bitmap B16x16_Button_Pointer_Array { get { @@ -511,7 +551,17 @@ internal static System.Drawing.Bitmap B16x16_Button_Pointer_Array { } /// - /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap B16x16_Button_Remove { + get { + object obj = ResourceManager.GetObject("B16x16_Button_Remove", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. /// internal static System.Drawing.Bitmap B16x16_Button_Text { get { @@ -521,7 +571,7 @@ internal static System.Drawing.Bitmap B16x16_Button_Text { } /// - /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// Looks up a localized resource of type System.Drawing.Bitmap. /// internal static System.Drawing.Bitmap B16x16_Button_Text_Pointer { get { @@ -531,7 +581,7 @@ internal static System.Drawing.Bitmap B16x16_Button_Text_Pointer { } /// - /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// Looks up a localized resource of type System.Drawing.Bitmap. /// internal static System.Drawing.Bitmap B16x16_Button_UInt_16 { get { @@ -541,7 +591,7 @@ internal static System.Drawing.Bitmap B16x16_Button_UInt_16 { } /// - /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// Looks up a localized resource of type System.Drawing.Bitmap. /// internal static System.Drawing.Bitmap B16x16_Button_UInt_32 { get { @@ -551,7 +601,7 @@ internal static System.Drawing.Bitmap B16x16_Button_UInt_32 { } /// - /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// Looks up a localized resource of type System.Drawing.Bitmap. /// internal static System.Drawing.Bitmap B16x16_Button_UInt_64 { get { @@ -561,7 +611,7 @@ internal static System.Drawing.Bitmap B16x16_Button_UInt_64 { } /// - /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// Looks up a localized resource of type System.Drawing.Bitmap. /// internal static System.Drawing.Bitmap B16x16_Button_UInt_8 { get { @@ -571,7 +621,17 @@ internal static System.Drawing.Bitmap B16x16_Button_UInt_8 { } /// - /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap B16x16_Button_Union { + get { + object obj = ResourceManager.GetObject("B16x16_Button_Union", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. /// internal static System.Drawing.Bitmap B16x16_Button_UText { get { @@ -581,7 +641,7 @@ internal static System.Drawing.Bitmap B16x16_Button_UText { } /// - /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// Looks up a localized resource of type System.Drawing.Bitmap. /// internal static System.Drawing.Bitmap B16x16_Button_UText_Pointer { get { @@ -591,7 +651,7 @@ internal static System.Drawing.Bitmap B16x16_Button_UText_Pointer { } /// - /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// Looks up a localized resource of type System.Drawing.Bitmap. /// internal static System.Drawing.Bitmap B16x16_Button_Vector_2 { get { @@ -601,7 +661,7 @@ internal static System.Drawing.Bitmap B16x16_Button_Vector_2 { } /// - /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// Looks up a localized resource of type System.Drawing.Bitmap. /// internal static System.Drawing.Bitmap B16x16_Button_Vector_3 { get { @@ -611,7 +671,7 @@ internal static System.Drawing.Bitmap B16x16_Button_Vector_3 { } /// - /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// Looks up a localized resource of type System.Drawing.Bitmap. /// internal static System.Drawing.Bitmap B16x16_Button_Vector_4 { get { @@ -621,7 +681,7 @@ internal static System.Drawing.Bitmap B16x16_Button_Vector_4 { } /// - /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// Looks up a localized resource of type System.Drawing.Bitmap. /// internal static System.Drawing.Bitmap B16x16_Button_VTable { get { @@ -631,7 +691,7 @@ internal static System.Drawing.Bitmap B16x16_Button_VTable { } /// - /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// Looks up a localized resource of type System.Drawing.Bitmap. /// internal static System.Drawing.Bitmap B16x16_Camera { get { @@ -641,7 +701,7 @@ internal static System.Drawing.Bitmap B16x16_Camera { } /// - /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// Looks up a localized resource of type System.Drawing.Bitmap. /// internal static System.Drawing.Bitmap B16x16_Canvas_Size { get { @@ -651,7 +711,7 @@ internal static System.Drawing.Bitmap B16x16_Canvas_Size { } /// - /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// Looks up a localized resource of type System.Drawing.Bitmap. /// internal static System.Drawing.Bitmap B16x16_Category { get { @@ -661,7 +721,7 @@ internal static System.Drawing.Bitmap B16x16_Category { } /// - /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// Looks up a localized resource of type System.Drawing.Bitmap. /// internal static System.Drawing.Bitmap B16x16_Chart_Delete { get { @@ -671,7 +731,7 @@ internal static System.Drawing.Bitmap B16x16_Chart_Delete { } /// - /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// Looks up a localized resource of type System.Drawing.Bitmap. /// internal static System.Drawing.Bitmap B16x16_Class_Type { get { @@ -681,7 +741,7 @@ internal static System.Drawing.Bitmap B16x16_Class_Type { } /// - /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// Looks up a localized resource of type System.Drawing.Bitmap. /// internal static System.Drawing.Bitmap B16x16_Closed_Icon { get { @@ -691,7 +751,7 @@ internal static System.Drawing.Bitmap B16x16_Closed_Icon { } /// - /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// Looks up a localized resource of type System.Drawing.Bitmap. /// internal static System.Drawing.Bitmap B16x16_Cogs { get { @@ -701,7 +761,7 @@ internal static System.Drawing.Bitmap B16x16_Cogs { } /// - /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// Looks up a localized resource of type System.Drawing.Bitmap. /// internal static System.Drawing.Bitmap B16x16_Color_Wheel { get { @@ -711,7 +771,7 @@ internal static System.Drawing.Bitmap B16x16_Color_Wheel { } /// - /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// Looks up a localized resource of type System.Drawing.Bitmap. /// internal static System.Drawing.Bitmap B16x16_Control_Pause { get { @@ -721,7 +781,7 @@ internal static System.Drawing.Bitmap B16x16_Control_Pause { } /// - /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// Looks up a localized resource of type System.Drawing.Bitmap. /// internal static System.Drawing.Bitmap B16x16_Control_Play { get { @@ -731,7 +791,7 @@ internal static System.Drawing.Bitmap B16x16_Control_Play { } /// - /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// Looks up a localized resource of type System.Drawing.Bitmap. /// internal static System.Drawing.Bitmap B16x16_Control_Stop { get { @@ -741,7 +801,7 @@ internal static System.Drawing.Bitmap B16x16_Control_Stop { } /// - /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// Looks up a localized resource of type System.Drawing.Bitmap. /// internal static System.Drawing.Bitmap B16x16_Custom_Type { get { @@ -751,7 +811,7 @@ internal static System.Drawing.Bitmap B16x16_Custom_Type { } /// - /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// Looks up a localized resource of type System.Drawing.Bitmap. /// internal static System.Drawing.Bitmap B16x16_Double_Type { get { @@ -761,7 +821,7 @@ internal static System.Drawing.Bitmap B16x16_Double_Type { } /// - /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// Looks up a localized resource of type System.Drawing.Bitmap. /// internal static System.Drawing.Bitmap B16x16_Drive_Go { get { @@ -771,7 +831,7 @@ internal static System.Drawing.Bitmap B16x16_Drive_Go { } /// - /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// Looks up a localized resource of type System.Drawing.Bitmap. /// internal static System.Drawing.Bitmap B16x16_Enum_Type { get { @@ -781,7 +841,7 @@ internal static System.Drawing.Bitmap B16x16_Enum_Type { } /// - /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// Looks up a localized resource of type System.Drawing.Bitmap. /// internal static System.Drawing.Bitmap B16x16_Error { get { @@ -791,7 +851,7 @@ internal static System.Drawing.Bitmap B16x16_Error { } /// - /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// Looks up a localized resource of type System.Drawing.Bitmap. /// internal static System.Drawing.Bitmap B16x16_Exchange_Button { get { @@ -801,7 +861,7 @@ internal static System.Drawing.Bitmap B16x16_Exchange_Button { } /// - /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// Looks up a localized resource of type System.Drawing.Bitmap. /// internal static System.Drawing.Bitmap B16x16_Eye { get { @@ -811,7 +871,7 @@ internal static System.Drawing.Bitmap B16x16_Eye { } /// - /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// Looks up a localized resource of type System.Drawing.Bitmap. /// internal static System.Drawing.Bitmap B16x16_Find_Access { get { @@ -821,7 +881,7 @@ internal static System.Drawing.Bitmap B16x16_Find_Access { } /// - /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// Looks up a localized resource of type System.Drawing.Bitmap. /// internal static System.Drawing.Bitmap B16x16_Find_Write { get { @@ -831,7 +891,7 @@ internal static System.Drawing.Bitmap B16x16_Find_Write { } /// - /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// Looks up a localized resource of type System.Drawing.Bitmap. /// internal static System.Drawing.Bitmap B16x16_Float_Type { get { @@ -841,7 +901,7 @@ internal static System.Drawing.Bitmap B16x16_Float_Type { } /// - /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// Looks up a localized resource of type System.Drawing.Bitmap. /// internal static System.Drawing.Bitmap B16x16_Folder { get { @@ -851,7 +911,7 @@ internal static System.Drawing.Bitmap B16x16_Folder { } /// - /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// Looks up a localized resource of type System.Drawing.Bitmap. /// internal static System.Drawing.Bitmap B16x16_Folder_Add { get { @@ -861,7 +921,7 @@ internal static System.Drawing.Bitmap B16x16_Folder_Add { } /// - /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// Looks up a localized resource of type System.Drawing.Bitmap. /// internal static System.Drawing.Bitmap B16x16_Function_Type { get { @@ -871,7 +931,7 @@ internal static System.Drawing.Bitmap B16x16_Function_Type { } /// - /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// Looks up a localized resource of type System.Drawing.Bitmap. /// internal static System.Drawing.Bitmap B16x16_Gear { get { @@ -881,7 +941,7 @@ internal static System.Drawing.Bitmap B16x16_Gear { } /// - /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// Looks up a localized resource of type System.Drawing.Bitmap. /// internal static System.Drawing.Bitmap B16x16_Help { get { @@ -891,7 +951,7 @@ internal static System.Drawing.Bitmap B16x16_Help { } /// - /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// Looks up a localized resource of type System.Drawing.Bitmap. /// internal static System.Drawing.Bitmap B16x16_Information { get { @@ -901,7 +961,7 @@ internal static System.Drawing.Bitmap B16x16_Information { } /// - /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// Looks up a localized resource of type System.Drawing.Bitmap. /// internal static System.Drawing.Bitmap B16x16_Interface_Type { get { @@ -911,7 +971,7 @@ internal static System.Drawing.Bitmap B16x16_Interface_Type { } /// - /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// Looks up a localized resource of type System.Drawing.Bitmap. /// internal static System.Drawing.Bitmap B16x16_Left_Button { get { @@ -921,7 +981,7 @@ internal static System.Drawing.Bitmap B16x16_Left_Button { } /// - /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// Looks up a localized resource of type System.Drawing.Bitmap. /// internal static System.Drawing.Bitmap B16x16_Magnifier { get { @@ -931,7 +991,7 @@ internal static System.Drawing.Bitmap B16x16_Magnifier { } /// - /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// Looks up a localized resource of type System.Drawing.Bitmap. /// internal static System.Drawing.Bitmap B16x16_Magnifier_Arrow { get { @@ -941,7 +1001,7 @@ internal static System.Drawing.Bitmap B16x16_Magnifier_Arrow { } /// - /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// Looks up a localized resource of type System.Drawing.Bitmap. /// internal static System.Drawing.Bitmap B16x16_Magnifier_Remove { get { @@ -951,7 +1011,7 @@ internal static System.Drawing.Bitmap B16x16_Magnifier_Remove { } /// - /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// Looks up a localized resource of type System.Drawing.Bitmap. /// internal static System.Drawing.Bitmap B16x16_Matrix_Type { get { @@ -961,7 +1021,7 @@ internal static System.Drawing.Bitmap B16x16_Matrix_Type { } /// - /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// Looks up a localized resource of type System.Drawing.Bitmap. /// internal static System.Drawing.Bitmap B16x16_Open_Icon { get { @@ -971,7 +1031,7 @@ internal static System.Drawing.Bitmap B16x16_Open_Icon { } /// - /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// Looks up a localized resource of type System.Drawing.Bitmap. /// internal static System.Drawing.Bitmap B16x16_Page_Code { get { @@ -981,7 +1041,7 @@ internal static System.Drawing.Bitmap B16x16_Page_Code { } /// - /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// Looks up a localized resource of type System.Drawing.Bitmap. /// internal static System.Drawing.Bitmap B16x16_Page_Code_Add { get { @@ -991,7 +1051,7 @@ internal static System.Drawing.Bitmap B16x16_Page_Code_Add { } /// - /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// Looks up a localized resource of type System.Drawing.Bitmap. /// internal static System.Drawing.Bitmap B16x16_Page_Code_Cpp { get { @@ -1001,7 +1061,7 @@ internal static System.Drawing.Bitmap B16x16_Page_Code_Cpp { } /// - /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// Looks up a localized resource of type System.Drawing.Bitmap. /// internal static System.Drawing.Bitmap B16x16_Page_Code_Csharp { get { @@ -1011,7 +1071,7 @@ internal static System.Drawing.Bitmap B16x16_Page_Code_Csharp { } /// - /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// Looks up a localized resource of type System.Drawing.Bitmap. /// internal static System.Drawing.Bitmap B16x16_Page_Copy { get { @@ -1021,7 +1081,7 @@ internal static System.Drawing.Bitmap B16x16_Page_Copy { } /// - /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// Looks up a localized resource of type System.Drawing.Bitmap. /// internal static System.Drawing.Bitmap B16x16_Page_Paste { get { @@ -1031,7 +1091,7 @@ internal static System.Drawing.Bitmap B16x16_Page_Paste { } /// - /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// Looks up a localized resource of type System.Drawing.Bitmap. /// internal static System.Drawing.Bitmap B16x16_Page_White_Stack { get { @@ -1041,7 +1101,7 @@ internal static System.Drawing.Bitmap B16x16_Page_White_Stack { } /// - /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// Looks up a localized resource of type System.Drawing.Bitmap. /// internal static System.Drawing.Bitmap B16x16_Pdb { get { @@ -1051,7 +1111,7 @@ internal static System.Drawing.Bitmap B16x16_Pdb { } /// - /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// Looks up a localized resource of type System.Drawing.Bitmap. /// internal static System.Drawing.Bitmap B16x16_Plugin { get { @@ -1061,7 +1121,7 @@ internal static System.Drawing.Bitmap B16x16_Plugin { } /// - /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// Looks up a localized resource of type System.Drawing.Bitmap. /// internal static System.Drawing.Bitmap B16x16_Pointer_Type { get { @@ -1071,7 +1131,7 @@ internal static System.Drawing.Bitmap B16x16_Pointer_Type { } /// - /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// Looks up a localized resource of type System.Drawing.Bitmap. /// internal static System.Drawing.Bitmap B16x16_Quit { get { @@ -1081,7 +1141,7 @@ internal static System.Drawing.Bitmap B16x16_Quit { } /// - /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// Looks up a localized resource of type System.Drawing.Bitmap. /// internal static System.Drawing.Bitmap B16x16_Redo { get { @@ -1091,7 +1151,7 @@ internal static System.Drawing.Bitmap B16x16_Redo { } /// - /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// Looks up a localized resource of type System.Drawing.Bitmap. /// internal static System.Drawing.Bitmap B16x16_Right_Button { get { @@ -1101,7 +1161,7 @@ internal static System.Drawing.Bitmap B16x16_Right_Button { } /// - /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// Looks up a localized resource of type System.Drawing.Bitmap. /// internal static System.Drawing.Bitmap B16x16_Save { get { @@ -1111,7 +1171,7 @@ internal static System.Drawing.Bitmap B16x16_Save { } /// - /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// Looks up a localized resource of type System.Drawing.Bitmap. /// internal static System.Drawing.Bitmap B16x16_Save_As { get { @@ -1121,7 +1181,7 @@ internal static System.Drawing.Bitmap B16x16_Save_As { } /// - /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// Looks up a localized resource of type System.Drawing.Bitmap. /// internal static System.Drawing.Bitmap B16x16_Settings_Edit { get { @@ -1131,7 +1191,7 @@ internal static System.Drawing.Bitmap B16x16_Settings_Edit { } /// - /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// Looks up a localized resource of type System.Drawing.Bitmap. /// internal static System.Drawing.Bitmap B16x16_Signed_Type { get { @@ -1141,7 +1201,7 @@ internal static System.Drawing.Bitmap B16x16_Signed_Type { } /// - /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// Looks up a localized resource of type System.Drawing.Bitmap. /// internal static System.Drawing.Bitmap B16x16_Table_Gear { get { @@ -1151,7 +1211,7 @@ internal static System.Drawing.Bitmap B16x16_Table_Gear { } /// - /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// Looks up a localized resource of type System.Drawing.Bitmap. /// internal static System.Drawing.Bitmap B16x16_Text_List_Bullets { get { @@ -1161,7 +1221,7 @@ internal static System.Drawing.Bitmap B16x16_Text_List_Bullets { } /// - /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// Looks up a localized resource of type System.Drawing.Bitmap. /// internal static System.Drawing.Bitmap B16x16_Text_Type { get { @@ -1171,7 +1231,7 @@ internal static System.Drawing.Bitmap B16x16_Text_Type { } /// - /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// Looks up a localized resource of type System.Drawing.Bitmap. /// internal static System.Drawing.Bitmap B16x16_Textfield_Rename { get { @@ -1181,7 +1241,7 @@ internal static System.Drawing.Bitmap B16x16_Textfield_Rename { } /// - /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// Looks up a localized resource of type System.Drawing.Bitmap. /// internal static System.Drawing.Bitmap B16x16_Tree_Collapse { get { @@ -1191,7 +1251,7 @@ internal static System.Drawing.Bitmap B16x16_Tree_Collapse { } /// - /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// Looks up a localized resource of type System.Drawing.Bitmap. /// internal static System.Drawing.Bitmap B16x16_Tree_Expand { get { @@ -1201,7 +1261,7 @@ internal static System.Drawing.Bitmap B16x16_Tree_Expand { } /// - /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// Looks up a localized resource of type System.Drawing.Bitmap. /// internal static System.Drawing.Bitmap B16x16_Undo { get { @@ -1211,7 +1271,7 @@ internal static System.Drawing.Bitmap B16x16_Undo { } /// - /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// Looks up a localized resource of type System.Drawing.Bitmap. /// internal static System.Drawing.Bitmap B16x16_Unsigned_Type { get { @@ -1221,7 +1281,7 @@ internal static System.Drawing.Bitmap B16x16_Unsigned_Type { } /// - /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// Looks up a localized resource of type System.Drawing.Bitmap. /// internal static System.Drawing.Bitmap B16x16_Vector_Type { get { @@ -1231,7 +1291,7 @@ internal static System.Drawing.Bitmap B16x16_Vector_Type { } /// - /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// Looks up a localized resource of type System.Drawing.Bitmap. /// internal static System.Drawing.Bitmap B16x16_Warning { get { @@ -1241,7 +1301,7 @@ internal static System.Drawing.Bitmap B16x16_Warning { } /// - /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// Looks up a localized resource of type System.Drawing.Bitmap. /// internal static System.Drawing.Bitmap B32x32_3D_Glasses { get { @@ -1251,7 +1311,7 @@ internal static System.Drawing.Bitmap B32x32_3D_Glasses { } /// - /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// Looks up a localized resource of type System.Drawing.Bitmap. /// internal static System.Drawing.Bitmap B32x32_Canvas_Size { get { @@ -1261,7 +1321,7 @@ internal static System.Drawing.Bitmap B32x32_Canvas_Size { } /// - /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// Looks up a localized resource of type System.Drawing.Bitmap. /// internal static System.Drawing.Bitmap B32x32_Cogs { get { @@ -1271,7 +1331,7 @@ internal static System.Drawing.Bitmap B32x32_Cogs { } /// - /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// Looks up a localized resource of type System.Drawing.Bitmap. /// internal static System.Drawing.Bitmap B32x32_Eye { get { @@ -1281,7 +1341,7 @@ internal static System.Drawing.Bitmap B32x32_Eye { } /// - /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// Looks up a localized resource of type System.Drawing.Bitmap. /// internal static System.Drawing.Bitmap B32x32_Magnifier { get { @@ -1291,7 +1351,7 @@ internal static System.Drawing.Bitmap B32x32_Magnifier { } /// - /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// Looks up a localized resource of type System.Drawing.Bitmap. /// internal static System.Drawing.Bitmap B32x32_Page_Code { get { @@ -1301,7 +1361,7 @@ internal static System.Drawing.Bitmap B32x32_Page_Code { } /// - /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// Looks up a localized resource of type System.Drawing.Bitmap. /// internal static System.Drawing.Bitmap B32x32_Plugin { get { @@ -1311,8 +1371,8 @@ internal static System.Drawing.Bitmap B32x32_Plugin { } /// - /// Sucht eine lokalisierte Zeichenfolge, die 2017/11/07 21:15:06 - /// ähnelt. + /// Looks up a localized string similar to 2020/10/17 09:45:04 + ///. /// internal static string BuildDate { get { @@ -1321,7 +1381,7 @@ internal static string BuildDate { } /// - /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Icon ähnlich wie (Symbol). + /// Looks up a localized resource of type System.Drawing.Icon similar to (Icon). /// internal static System.Drawing.Icon ReClassNet { get { diff --git a/ReClass.NET/Properties/Resources.resx b/ReClass.NET/Properties/Resources.resx index bb4f1131..48c2c826 100644 --- a/ReClass.NET/Properties/Resources.resx +++ b/ReClass.NET/Properties/Resources.resx @@ -499,4 +499,22 @@ ..\Resources\Images\B16x16_Button_Add.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Resources\Images\B16x16_Button_Remove.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\Images\B16x16_Button_Pointer.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\Images\B16x16_Button_Enum.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\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/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 fe2f4b16..0c990cc2 100644 --- a/ReClass.NET/ReClass.NET.csproj +++ b/ReClass.NET/ReClass.NET.csproj @@ -9,12 +9,14 @@ Properties ReClassNET ReClass.NET - v4.6.1 + v4.7.2 512 true 0 + + latest x86 @@ -23,7 +25,7 @@ false $(SolutionDir)bin\Debug\x86\ $(SolutionDir)obj\$(Configuration)\x86\$(MSBuildProjectName)\ - TRACE;DEBUG;RECLASSNET32 + TRACE;DEBUG prompt 4 false @@ -77,7 +79,7 @@ true $(SolutionDir)bin\Release\x86\ $(SolutionDir)obj\$(Configuration)\x86\$(MSBuildProjectName)\ - TRACE;RECLASSNET32;RELEASE + TRACE;RELEASE prompt 4 @@ -106,6 +108,7 @@ Resources\Icon\ReClassNet.ico + False @@ -121,40 +124,42 @@ - - ..\packages\System.Data.SQLite.Core.1.0.106.0\lib\net46\System.Data.SQLite.dll - - - - + + - + + + - - + - + + + + + + @@ -167,6 +172,46 @@ + + + + + + + + + Form + + + EnumEditorForm.cs + + + Form + + + EnumListForm.cs + + + Form + + + EnumSelectionForm.cs + + + Form + + + Form + + + NamedAddressesForm.cs + + + Form + + + ClassSelectionForm.cs + Form @@ -199,17 +244,22 @@ + + + + + - + @@ -220,21 +270,35 @@ + + + + + + + + + - - - + + + + + + + + Component @@ -246,10 +310,9 @@ - + - Form @@ -257,13 +320,16 @@ AboutForm.cs + + + - + UserControl - - ClassNodeView.cs + + ProjectView.cs Form @@ -271,13 +337,13 @@ CodeForm.cs - + UserControl - + ColorBox.cs - + Component @@ -289,54 +355,63 @@ LogForm.cs - + UserControl - + DualValueBox.cs - + Component - - + + UserControl - + HotkeyBox.cs - + Component - + - + Component - + UserControl - + MemoryRecordList.cs - + MemoryViewControl.cs + + + Component + + - - - - - - - - - - - - + + + + + + + + + + + + + + + + Form @@ -351,12 +426,10 @@ SettingsForm.cs - - + Component - Form @@ -372,24 +445,20 @@ - + UserControl - - - - @@ -401,7 +470,6 @@ - @@ -432,8 +500,8 @@ ProcessInfoForm.cs - - + + @@ -443,26 +511,18 @@ - - UserControl - - - Component - - - Component - - - + + + + - @@ -473,6 +533,22 @@ AboutForm.cs + + EnumEditorForm.cs + + + EnumListForm.cs + + + EnumSelectionForm.cs + + + NamedAddressesForm.cs + + + ClassSelectionForm.cs + Designer + CodeForm.cs @@ -488,8 +564,8 @@ ScannerForm.cs - - ClassNodeView.cs + + ProjectView.cs Designer @@ -499,19 +575,19 @@ MainForm.cs Designer - + ColorBox.cs - + DualValueBox.cs - + HotkeyBox.cs - + MemoryRecordList.cs - + MemoryViewControl.cs @@ -532,7 +608,6 @@ Resources.Designer.cs - SettingsSingleFileGenerator Settings.Designer.cs @@ -930,17 +1005,29 @@ + + + + + + + + + + + + + + + + + + powershell -Command "((Get-Date).ToUniversalTime()).ToString(\"yyyy\/MM\/dd HH:mm:ss\") | Out-File '$(ProjectDir)Resources\BuildDate.txt'" - date +"%Y/%m/%d %H:%M:%S" > $(ProjectDir)/Resources/BuildDate.txt + date +"%Y/%m/%d %H:%M:%S" > $(ProjectDir)/Resources/BuildDate.txt - - - Missing file: "{0}". - - - - + \ No newline at end of file diff --git a/ReClass.NET/ReClassNetProject.cs b/ReClass.NET/ReClassNetProject.cs deleted file mode 100644 index 0ab0bc03..00000000 --- a/ReClass.NET/ReClassNetProject.cs +++ /dev/null @@ -1,134 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Diagnostics.Contracts; -using System.Linq; -using ReClassNET.Nodes; -using ReClassNET.Util; - -namespace ReClassNET -{ - public class ReClassNetProject : IDisposable - { - public delegate void ClassesChangedEvent(ClassNode sender); - public event ClassesChangedEvent ClassAdded; - public event ClassesChangedEvent ClassRemoved; - - private readonly List classes = new List(); - - public IEnumerable Classes => classes; - - public string Path { get; set; } - - /// - /// Key-Value map with custom data for plugins to store project related data. - /// The preferred key format is {Plugin Name}_{Key Name}. - /// - public Dictionary CustomData { get; } = new Dictionary(); - - public void Dispose() - { - Clear(); - - ClassAdded = null; - ClassRemoved = null; - } - - public void AddClass(ClassNode node) - { - Contract.Requires(node != null); - - classes.Add(node); - - node.NodesChanged += NodesChanged_Handler; - - ClassAdded?.Invoke(node); - } - - public bool ContainsClass(NodeUuid uuid) - { - Contract.Requires(uuid != null); - - return classes.Any(c => c.Uuid.Equals(uuid)); - } - - public ClassNode GetClassByUuid(NodeUuid uuid) - { - Contract.Requires(uuid != null); - - return classes.First(c => c.Uuid.Equals(uuid)); - } - - private void NodesChanged_Handler(BaseNode sender) - { - classes.ForEach(c => c.UpdateOffsets()); - } - - public void Clear() - { - var temp = classes.ToList(); - - classes.Clear(); - - foreach (var node in temp) - { - node.NodesChanged -= NodesChanged_Handler; - - ClassRemoved?.Invoke(node); - } - } - - private IEnumerable GetClassReferences(ClassNode node) - { - Contract.Requires(node != null); - - return classes.Where(c => c != node).Where(c => c.Descendants().Any(n => (n as BaseReferenceNode)?.InnerNode == node)); - } - - public void Remove(ClassNode node) - { - Contract.Requires(node != null); - - var references = GetClassReferences(node).ToList(); - if (references.Any()) - { - throw new ClassReferencedException(references); - } - - if (classes.Remove(node)) - { - node.NodesChanged -= NodesChanged_Handler; - - ClassRemoved?.Invoke(node); - } - } - - public void RemoveUnusedClasses() - { - var toRemove = classes - .Except(classes.Where(x => GetClassReferences(x).Any())) // check for references - .Where(c => c.Nodes.All(n => n is BaseHexNode)) // check if only hex nodes are present - .ToList(); - foreach (var node in toRemove) - { - if (classes.Remove(node)) - { - ClassRemoved?.Invoke(node); - } - } - } - } - - public class ClassReferencedException : Exception - { - public IEnumerable References { get; } - - public ClassReferencedException(IEnumerable references) - : base("This class has references.") - { - Contract.Requires(references != null); - Contract.Requires(Contract.ForAll(references, c => c != null)); - - References = references; - } - } -} diff --git a/ReClass.NET/Resources/Images/B16x16_Button_Enum.png b/ReClass.NET/Resources/Images/B16x16_Button_Enum.png new file mode 100644 index 00000000..a89bc0e0 Binary files /dev/null and b/ReClass.NET/Resources/Images/B16x16_Button_Enum.png differ 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 00000000..0e07b576 Binary files /dev/null and b/ReClass.NET/Resources/Images/B16x16_Button_NInt.png differ diff --git a/ReClass.NET/Resources/Images/B16x16_Button_NUInt.png b/ReClass.NET/Resources/Images/B16x16_Button_NUInt.png new file mode 100644 index 00000000..0c8f5a18 Binary files /dev/null and b/ReClass.NET/Resources/Images/B16x16_Button_NUInt.png differ diff --git a/ReClass.NET/Resources/Images/B16x16_Button_Pointer.png b/ReClass.NET/Resources/Images/B16x16_Button_Pointer.png new file mode 100644 index 00000000..20add53d Binary files /dev/null and b/ReClass.NET/Resources/Images/B16x16_Button_Pointer.png differ diff --git a/ReClass.NET/Resources/Images/B16x16_Button_Remove.png b/ReClass.NET/Resources/Images/B16x16_Button_Remove.png new file mode 100644 index 00000000..1fc50e83 Binary files /dev/null and b/ReClass.NET/Resources/Images/B16x16_Button_Remove.png differ diff --git a/ReClass.NET/Resources/Images/B16x16_Button_Union.png b/ReClass.NET/Resources/Images/B16x16_Button_Union.png new file mode 100644 index 00000000..6d842042 Binary files /dev/null and b/ReClass.NET/Resources/Images/B16x16_Button_Union.png differ diff --git a/ReClass.NET/Settings.cs b/ReClass.NET/Settings.cs index 7aa0e137..b5d9268b 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 @@ -11,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; @@ -21,6 +26,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; @@ -67,48 +74,7 @@ public class Settings public Color PluginColor { get; set; } = Color.FromArgb(255, 0, 255); - private static readonly Color[] highlightColors = { - Color.Aqua, Color.Aquamarine, Color.Blue, Color.BlueViolet, Color.Chartreuse, Color.Crimson, Color.LawnGreen, Color.Magenta - }; - public Color HighlightColor => highlightColors[Program.GlobalRandom.Next(highlightColors.Length)]; - - // Type Definitions - - public string TypePadding { get; set; } = "char"; - - public string TypeBool { get; set; } = "bool"; - - public string TypeInt8 { get; set; } = "int8_t"; - public string TypeInt16 { get; set; } = "int16_t"; - public string TypeInt32 { get; set; } = "int32_t"; - public string TypeInt64 { get; set; } = "int64_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 TypeFloat { get; set; } = "float"; - public string TypeDouble { get; set; } = "double"; - - public string TypeVector2 { get; set; } = "Vector2"; - public string TypeVector3 { get; set; } = "Vector3"; - public string TypeVector4 { get; set; } = "Vector4"; - - public string TypeMatrix3x3 { get; set; } = "Matrix3x3"; - public string TypeMatrix3x4 { get; set; } = "Matrix3x4"; - public string TypeMatrix4x4 { get; set; } = "Matrix4x4"; - - public string TypeUTF8Text { get; set; } = "char"; - public string TypeUTF8TextPtr { get; set; } = "char*"; - public string TypeUTF16Text { get; set; } = "wchar_t"; // Should be char16_t, but this type isn't well supported at the moment. - public string TypeUTF16TextPtr { get; set; } = "wchar_t*"; - public string TypeUTF32Text { get; set; } = "char32_t"; - public string TypeUTF32TextPtr { get; set; } = "char32_t*"; - - public string TypeFunctionPtr { get; set; } = "void*"; - - public CustomConfig CustomData { get; } = new CustomConfig(); + public CustomDataMap CustomData { get; } = new CustomDataMap(); public Settings Clone() => MemberwiseClone() as Settings; } 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/SymbolReader.cs b/ReClass.NET/Symbols/SymbolReader.cs index 002a0230..230880b2 100644 --- a/ReClass.NET/Symbols/SymbolReader.cs +++ b/ReClass.NET/Symbols/SymbolReader.cs @@ -2,9 +2,9 @@ using System.Diagnostics.Contracts; using System.Text; using Dia2Lib; +using ReClassNET.Extensions; using ReClassNET.Memory; using ReClassNET.Native; -using ReClassNET.Util; namespace ReClassNET.Symbols { @@ -48,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) @@ -92,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; } @@ -133,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 48fde96c..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; @@ -6,24 +6,24 @@ using System.Runtime.InteropServices; using Dia2Lib; using Microsoft.Win32; +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; @@ -32,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; } @@ -88,25 +88,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; } } } 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/BindingDisplayWrapper.cs b/ReClass.NET/UI/BindingDisplayWrapper.cs new file mode 100644 index 00000000..4b00997b --- /dev/null +++ b/ReClass.NET/UI/BindingDisplayWrapper.cs @@ -0,0 +1,21 @@ +using System; +using System.Diagnostics.Contracts; + +namespace ReClassNET.UI +{ + public class BindingDisplayWrapper + { + public T Value { get; } + private readonly Func toString; + + public BindingDisplayWrapper(T value, Func toString) + { + Contract.Requires(toString != null); + + Value = value; + this.toString = toString; + } + + public override string ToString() => toString(Value); + } +} diff --git a/ReClass.NET/UI/ClassNodeView.Designer.cs b/ReClass.NET/UI/ClassNodeView.Designer.cs deleted file mode 100644 index 9290e5ad..00000000 --- a/ReClass.NET/UI/ClassNodeView.Designer.cs +++ /dev/null @@ -1,215 +0,0 @@ -namespace ReClassNET.UI -{ - partial class ClassNodeView - { - /// - /// Erforderliche Designervariable. - /// - private System.ComponentModel.IContainer components = null; - - /// - /// Verwendete Ressourcen bereinigen. - /// - /// True, wenn verwaltete Ressourcen gelöscht werden sollen; andernfalls False. - protected override void Dispose(bool disposing) - { - if (disposing && (components != null)) - { - components.Dispose(); - } - base.Dispose(disposing); - } - - #region Vom Komponenten-Designer generierter Code - - /// - /// Erforderliche Methode für die Designerunterstützung. - /// Der Inhalt der Methode darf nicht mit dem Code-Editor geändert werden. - /// - private void InitializeComponent() - { - this.components = new System.ComponentModel.Container(); - this.classesTreeView = new System.Windows.Forms.TreeView(); - this.classContextMenuStrip = new System.Windows.Forms.ContextMenuStrip(this.components); - this.renameClassToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.deleteClassToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator(); - this.removeUnusedClassesToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.toolStripSeparator4 = new System.Windows.Forms.ToolStripSeparator(); - this.showCodeOfClassToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.rootContextMenuStrip = new System.Windows.Forms.ContextMenuStrip(this.components); - this.enableHierarchyViewToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.autoExpandHierarchyViewToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator(); - this.expandAllClassesToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.collapseAllClassesToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.toolStripSeparator3 = new System.Windows.Forms.ToolStripSeparator(); - this.addNewClassToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.classContextMenuStrip.SuspendLayout(); - this.rootContextMenuStrip.SuspendLayout(); - this.SuspendLayout(); - // - // classesTreeView - // - this.classesTreeView.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; - this.classesTreeView.Dock = System.Windows.Forms.DockStyle.Fill; - this.classesTreeView.HideSelection = false; - this.classesTreeView.LabelEdit = true; - this.classesTreeView.Location = new System.Drawing.Point(0, 0); - this.classesTreeView.Name = "classesTreeView"; - this.classesTreeView.ShowRootLines = false; - this.classesTreeView.Size = new System.Drawing.Size(150, 150); - this.classesTreeView.TabIndex = 0; - this.classesTreeView.AfterLabelEdit += new System.Windows.Forms.NodeLabelEditEventHandler(this.classesTreeView_AfterLabelEdit); - this.classesTreeView.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.classesTreeView_AfterSelect); - this.classesTreeView.MouseUp += new System.Windows.Forms.MouseEventHandler(this.classesTreeView_MouseUp); - // - // classContextMenuStrip - // - this.classContextMenuStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.renameClassToolStripMenuItem, - this.deleteClassToolStripMenuItem, - this.toolStripSeparator1, - this.removeUnusedClassesToolStripMenuItem, - this.toolStripSeparator4, - this.showCodeOfClassToolStripMenuItem}); - this.classContextMenuStrip.Name = "contextMenuStrip"; - this.classContextMenuStrip.Size = new System.Drawing.Size(206, 104); - // - // renameClassToolStripMenuItem - // - this.renameClassToolStripMenuItem.Image = global::ReClassNET.Properties.Resources.B16x16_Textfield_Rename; - this.renameClassToolStripMenuItem.Name = "renameClassToolStripMenuItem"; - this.renameClassToolStripMenuItem.Size = new System.Drawing.Size(205, 22); - this.renameClassToolStripMenuItem.Text = "Rename class"; - this.renameClassToolStripMenuItem.Click += new System.EventHandler(this.renameClassToolStripMenuItem_Click); - // - // deleteClassToolStripMenuItem - // - this.deleteClassToolStripMenuItem.Image = global::ReClassNET.Properties.Resources.B16x16_Button_Class_Remove; - this.deleteClassToolStripMenuItem.Name = "deleteClassToolStripMenuItem"; - this.deleteClassToolStripMenuItem.Size = new System.Drawing.Size(205, 22); - this.deleteClassToolStripMenuItem.Text = "Delete class"; - this.deleteClassToolStripMenuItem.Click += new System.EventHandler(this.deleteClassToolStripMenuItem_Click); - // - // toolStripSeparator1 - // - this.toolStripSeparator1.Name = "toolStripSeparator1"; - this.toolStripSeparator1.Size = new System.Drawing.Size(202, 6); - // - // removeUnusedClassesToolStripMenuItem - // - this.removeUnusedClassesToolStripMenuItem.Image = global::ReClassNET.Properties.Resources.B16x16_Chart_Delete; - this.removeUnusedClassesToolStripMenuItem.Name = "removeUnusedClassesToolStripMenuItem"; - this.removeUnusedClassesToolStripMenuItem.Size = new System.Drawing.Size(205, 22); - this.removeUnusedClassesToolStripMenuItem.Text = "Remove unused classes"; - this.removeUnusedClassesToolStripMenuItem.Click += new System.EventHandler(this.removeUnusedClassesToolStripMenuItem_Click); - // - // toolStripSeparator4 - // - this.toolStripSeparator4.Name = "toolStripSeparator4"; - this.toolStripSeparator4.Size = new System.Drawing.Size(202, 6); - // - // showCodeOfClassToolStripMenuItem - // - this.showCodeOfClassToolStripMenuItem.Image = global::ReClassNET.Properties.Resources.B16x16_Page_Code_Cpp; - this.showCodeOfClassToolStripMenuItem.Name = "showCodeOfClassToolStripMenuItem"; - this.showCodeOfClassToolStripMenuItem.Size = new System.Drawing.Size(205, 22); - this.showCodeOfClassToolStripMenuItem.Text = "Show C++ Code of Class"; - this.showCodeOfClassToolStripMenuItem.Click += new System.EventHandler(this.showCodeOfClassToolStripMenuItem_Click); - // - // rootContextMenuStrip - // - this.rootContextMenuStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.enableHierarchyViewToolStripMenuItem, - this.autoExpandHierarchyViewToolStripMenuItem, - this.toolStripSeparator2, - this.expandAllClassesToolStripMenuItem, - this.collapseAllClassesToolStripMenuItem, - this.toolStripSeparator3, - this.addNewClassToolStripMenuItem}); - this.rootContextMenuStrip.Name = "rootContextMenuStrip"; - this.rootContextMenuStrip.Size = new System.Drawing.Size(221, 126); - // - // enableHierarchyViewToolStripMenuItem - // - this.enableHierarchyViewToolStripMenuItem.Checked = true; - this.enableHierarchyViewToolStripMenuItem.CheckState = System.Windows.Forms.CheckState.Checked; - this.enableHierarchyViewToolStripMenuItem.Name = "enableHierarchyViewToolStripMenuItem"; - this.enableHierarchyViewToolStripMenuItem.Size = new System.Drawing.Size(220, 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.Text = "Auto expand hierarchy view"; - this.autoExpandHierarchyViewToolStripMenuItem.Click += new System.EventHandler(this.autoExpandHierarchyViewToolStripMenuItem_Click); - // - // toolStripSeparator2 - // - this.toolStripSeparator2.Name = "toolStripSeparator2"; - this.toolStripSeparator2.Size = new System.Drawing.Size(217, 6); - // - // expandAllClassesToolStripMenuItem - // - 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.Text = "Expand all classes"; - this.expandAllClassesToolStripMenuItem.Click += new System.EventHandler(this.expandAllClassesToolStripMenuItem_Click); - // - // collapseAllClassesToolStripMenuItem - // - 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.Text = "Collapse all classes"; - this.collapseAllClassesToolStripMenuItem.Click += new System.EventHandler(this.collapseAllClassesToolStripMenuItem_Click); - // - // toolStripSeparator3 - // - this.toolStripSeparator3.Name = "toolStripSeparator3"; - this.toolStripSeparator3.Size = new System.Drawing.Size(217, 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.Text = "Add new class"; - this.addNewClassToolStripMenuItem.Click += new System.EventHandler(this.addNewClassToolStripMenuItem_Click); - // - // ClassNodeView - // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.Controls.Add(this.classesTreeView); - this.Name = "ClassNodeView"; - this.classContextMenuStrip.ResumeLayout(false); - this.rootContextMenuStrip.ResumeLayout(false); - this.ResumeLayout(false); - - } - - #endregion - - private System.Windows.Forms.TreeView classesTreeView; - private System.Windows.Forms.ContextMenuStrip classContextMenuStrip; - private System.Windows.Forms.ToolStripMenuItem renameClassToolStripMenuItem; - private System.Windows.Forms.ToolStripMenuItem deleteClassToolStripMenuItem; - private System.Windows.Forms.ToolStripSeparator toolStripSeparator1; - private System.Windows.Forms.ToolStripMenuItem removeUnusedClassesToolStripMenuItem; - private System.Windows.Forms.ContextMenuStrip rootContextMenuStrip; - private System.Windows.Forms.ToolStripMenuItem autoExpandHierarchyViewToolStripMenuItem; - private System.Windows.Forms.ToolStripSeparator toolStripSeparator2; - private System.Windows.Forms.ToolStripMenuItem expandAllClassesToolStripMenuItem; - private System.Windows.Forms.ToolStripMenuItem collapseAllClassesToolStripMenuItem; - private System.Windows.Forms.ToolStripMenuItem enableHierarchyViewToolStripMenuItem; - private System.Windows.Forms.ToolStripSeparator toolStripSeparator3; - private System.Windows.Forms.ToolStripMenuItem addNewClassToolStripMenuItem; - private System.Windows.Forms.ToolStripSeparator toolStripSeparator4; - private System.Windows.Forms.ToolStripMenuItem showCodeOfClassToolStripMenuItem; - } -} diff --git a/ReClass.NET/UI/ClassNodeView.cs b/ReClass.NET/UI/ClassNodeView.cs deleted file mode 100644 index fbb71de3..00000000 --- a/ReClass.NET/UI/ClassNodeView.cs +++ /dev/null @@ -1,389 +0,0 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Diagnostics.Contracts; -using System.Linq; -using System.Windows.Forms; -using ReClassNET.Nodes; -using ReClassNET.Util; - -namespace ReClassNET.UI -{ - public partial class ClassNodeView : UserControl - { - /// A custom tree node for class nodes with hierarchical structure. - private class ClassTreeNode : TreeNode, IDisposable - { - public ClassNode ClassNode { get; } - - private readonly ValueTypeWrapper enableHierarchyView; - private readonly ValueTypeWrapper autoExpand; - - /// Constructor of the class. - /// The class node. - /// The value if the hierarchy view is enabled. - /// The value if nodes should get expanded. - public ClassTreeNode(ClassNode node, ValueTypeWrapper enableHierarchyView, ValueTypeWrapper autoExpand) - : this(node, enableHierarchyView, autoExpand, null) - { - Contract.Requires(node != null); - Contract.Requires(enableHierarchyView != null); - Contract.Requires(autoExpand != null); - } - - private ClassTreeNode(ClassNode node, ValueTypeWrapper enableHierarchyView, ValueTypeWrapper autoExpand, HashSet seen) - { - Contract.Requires(node != null); - Contract.Requires(enableHierarchyView != null); - Contract.Requires(autoExpand != null); - - this.enableHierarchyView = enableHierarchyView; - this.autoExpand = autoExpand; - - ClassNode = node; - - node.NameChanged += NameChanged_Handler; - node.NodesChanged += NodesChanged_Handler; - - Text = node.Name; - - ImageIndex = 1; - SelectedImageIndex = 1; - - RebuildClassHierarchy(seen ?? new HashSet { ClassNode }); - } - - public void Dispose() - { - ClassNode.NameChanged -= NameChanged_Handler; - ClassNode.NodesChanged -= NodesChanged_Handler; - - Nodes.OfType().ForEach(t => t.Dispose()); - Nodes.Clear(); - } - - private void NameChanged_Handler(BaseNode sender) - { - Text = sender.Name; - } - - private void NodesChanged_Handler(BaseNode sender) - { - RebuildClassHierarchy(new HashSet { ClassNode }); - } - - /// Rebuilds the class hierarchy. - /// The already seen classes. - private void RebuildClassHierarchy(HashSet seen) - { - Contract.Requires(seen != null); - - if (!enableHierarchyView.Value) - { - return; - } - - var distinctClasses = ClassNode.Nodes - .OfType() - .Select(r => r.InnerNode) - .Distinct() - .ToList(); - - if (distinctClasses.SequenceEqualsEx(Nodes.OfType().Select(t => t.ClassNode))) - { - return; - } - - Nodes.OfType().ForEach(t => t.Dispose()); - Nodes.Clear(); - - foreach (var child in distinctClasses) - { - var childSeen = new HashSet(seen); - if (childSeen.Add(child)) - { - Nodes.Add(new ClassTreeNode(child, enableHierarchyView, autoExpand, childSeen)); - } - } - - if (autoExpand.Value) - { - Expand(); - } - } - } - - private readonly TreeNode root; - private readonly ValueTypeWrapper enableHierarchyView; - private readonly ValueTypeWrapper autoExpand; - - private ReClassNetProject project; - - private ClassNode selectedClass; - - public delegate void SelectionChangedEvent(object sender, ClassNode node); - public event SelectionChangedEvent SelectionChanged; - - [Browsable(false)] - [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] - public ReClassNetProject Project - { - get => project; - set - { - Contract.Requires(value != null); - - if (project != value) - { - root.Nodes.OfType().ForEach(t => t.Dispose()); - root.Nodes.Clear(); - - if (project != null) - { - project.ClassAdded -= AddClass; - project.ClassRemoved -= RemoveClass; - } - - project = value; - - project.ClassAdded += AddClass; - project.ClassRemoved += RemoveClass; - - classesTreeView.BeginUpdate(); - - project.Classes.ForEach(AddClass); - - classesTreeView.EndUpdate(); - } - } - } - - [Browsable(false)] - [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] - public ClassNode SelectedClass - { - get => selectedClass; - set - { - if (selectedClass != value) - { - selectedClass = value; - if (selectedClass != null) - { - classesTreeView.SelectedNode = root.Nodes.Cast().FirstOrDefault(n => n.ClassNode == selectedClass); - } - - SelectionChanged?.Invoke(this, selectedClass); - } - } - } - - public ClassNodeView() - { - Contract.Ensures(root != null); - - InitializeComponent(); - - DoubleBuffered = true; - - enableHierarchyView = new ValueTypeWrapper(true); - autoExpand = new ValueTypeWrapper(false); - - classesTreeView.ImageList = new ImageList(); - classesTreeView.ImageList.Images.Add(Properties.Resources.B16x16_Text_List_Bullets); - classesTreeView.ImageList.Images.Add(Properties.Resources.B16x16_Class_Type); - - root = new TreeNode - { - Text = "Classes", - ImageIndex = 0, - SelectedImageIndex = 0 - }; - - classesTreeView.Nodes.Add(root); - } - - #region Event Handler - - private void classesTreeView_AfterSelect(object sender, TreeViewEventArgs e) - { - if (e.Node.Level == 0) - { - return; - } - - if (!(e.Node is ClassTreeNode node)) - { - return; - } - - if (selectedClass != node.ClassNode) - { - SelectedClass = node.ClassNode; - } - } - - private void classesTreeView_MouseUp(object sender, MouseEventArgs e) - { - if (e.Button == MouseButtons.Right) - { - var node = classesTreeView.GetNodeAt(e.X, e.Y); - - if (node != null) - { - if (node != root) - { - classesTreeView.SelectedNode = node; - - classContextMenuStrip.Show(classesTreeView, e.Location); - } - else - { - rootContextMenuStrip.Show(classesTreeView, e.Location); - } - } - } - } - - private void removeUnusedClassesToolStripMenuItem_Click(object sender, EventArgs e) - { - project.RemoveUnusedClasses(); - } - - private void deleteClassToolStripMenuItem_Click(object sender, EventArgs e) - { - if (classesTreeView.SelectedNode is ClassTreeNode treeNode) - { - try - { - project.Remove(treeNode.ClassNode); - } - catch (ClassReferencedException ex) - { - Program.Logger.Log(ex); - } - } - } - - private void renameClassToolStripMenuItem_Click(object sender, EventArgs e) - { - var treeNode = classesTreeView.SelectedNode; - treeNode?.BeginEdit(); - } - - private void classesTreeView_AfterLabelEdit(object sender, NodeLabelEditEventArgs e) - { - if (!string.IsNullOrEmpty(e.Label)) - { - if (e.Node is ClassTreeNode node) - { - node.ClassNode.Name = e.Label; - - // Cancel the edit if the class refused the name. - // This prevents the tree node from using the wrong name. - if (node.ClassNode.Name != e.Label) - { - e.CancelEdit = true; - } - } - } - } - - private void enableHierarchyViewToolStripMenuItem_Click(object sender, EventArgs e) - { - enableHierarchyViewToolStripMenuItem.Checked = !enableHierarchyViewToolStripMenuItem.Checked; - - enableHierarchyView.Value = enableHierarchyViewToolStripMenuItem.Checked; - - var classes = root.Nodes.OfType().Select(t => t.ClassNode).ToList(); - - root.Nodes.OfType().ForEach(t => t.Dispose()); - root.Nodes.Clear(); - - classes.ForEach(AddClass); - } - - private void autoExpandHierarchyViewToolStripMenuItem_Click(object sender, EventArgs e) - { - autoExpandHierarchyViewToolStripMenuItem.Checked = !autoExpandHierarchyViewToolStripMenuItem.Checked; - - autoExpand.Value = autoExpandHierarchyViewToolStripMenuItem.Checked; - - if (autoExpand.Value) - { - root.ExpandAll(); - } - } - - private void expandAllClassesToolStripMenuItem_Click(object sender, EventArgs e) - { - root.ExpandAll(); - } - - private void collapseAllClassesToolStripMenuItem_Click(object sender, EventArgs e) - { - root.Nodes.Cast().ForEach(n => n.Collapse()); - } - - private void addNewClassToolStripMenuItem_Click(object sender, EventArgs e) - { - LinkedWindowFeatures.CreateDefaultClass(); - } - - private void showCodeOfClassToolStripMenuItem_Click(object sender, EventArgs e) - { - if (classesTreeView.SelectedNode is ClassTreeNode node) - { - LinkedWindowFeatures.ShowCodeGeneratorForm(node.ClassNode.Yield()); - } - } - - #endregion - - /// Adds the class to the view. - /// The class to add. - public void AddClass(ClassNode node) - { - Contract.Requires(node != null); - - root.Nodes.Add(new ClassTreeNode(node, enableHierarchyView, autoExpand)); - - classesTreeView.Sort(); - - root.Expand(); - } - - /// Removes the class from the view. - /// The class to remove. - public void RemoveClass(ClassNode node) - { - var tn = FindClassTreeNode(node); - if (tn != null) - { - root.Nodes.Remove(tn); - - tn.Dispose(); - - if (selectedClass == node) - { - if (root.Nodes.Count > 0) - { - classesTreeView.SelectedNode = root.Nodes[0]; - } - else - { - SelectedClass = null; - } - } - } - } - - /// Searches for the ClassTreeNode which represents the class. - /// The class to search. - /// The found class tree node. - private ClassTreeNode FindClassTreeNode(ClassNode node) - { - return root.Nodes.OfType().FirstOrDefault(t => t.ClassNode == node); - } - } -} diff --git a/ReClass.NET/UI/DpiUtil.cs b/ReClass.NET/UI/DpiUtil.cs index 398a090f..58b8b7e0 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; @@ -9,151 +9,126 @@ 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; - } - } + using var g = Graphics.FromHwnd(IntPtr.Zero); + + 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); } - 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 (Graphics g = Graphics.FromImage(bmp)) - { - g.Clear(Color.Transparent); + 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; + g.SmoothingMode = SmoothingMode.HighQuality; + g.CompositingQuality = CompositingQuality.HighQuality; - var wSrc = img.Width; - var hSrc = img.Height; + var sourceWidth = sourceImage.Width; + var sourceHeight = sourceImage.Height; - InterpolationMode im = InterpolationMode.HighQualityBicubic; - if (wSrc > 0 && hSrc > 0) + var interpolationMode = InterpolationMode.HighQualityBicubic; + if (sourceWidth > 0 && sourceHeight > 0) + { + if ((width % sourceWidth) == 0 && (height % sourceHeight) == 0) { - if ((w % wSrc) == 0 && (h % hSrc) == 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; } } } diff --git a/ReClass.NET/UI/HotSpot.cs b/ReClass.NET/UI/HotSpot.cs index dc26a761..3a0d4bc0 100644 --- a/ReClass.NET/UI/HotSpot.cs +++ b/ReClass.NET/UI/HotSpot.cs @@ -11,11 +11,13 @@ public enum HotSpotType Edit, OpenClose, Select, - Drop, Click, - ChangeType, + DoubleClick, + ChangeClassType, + ChangeWrappedType, + ChangeEnumType, + Context, Delete, - RTTI, Address, Name, Comment @@ -40,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/HotSpotTextBox.cs b/ReClass.NET/UI/HotSpotTextBox.cs deleted file mode 100644 index b1002892..00000000 --- a/ReClass.NET/UI/HotSpotTextBox.cs +++ /dev/null @@ -1,115 +0,0 @@ -using System; -using System.ComponentModel; -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; - - Left = hotSpot.Rect.Left + 2; - Top = hotSpot.Rect.Top; - Width = hotSpot.Rect.Width; - Height = hotSpot.Rect.Height; - - MinimumWidth = Width; - - Text = hotSpot.Text.Trim(); - } - } - } - - public int MinimumWidth { get; set; } - - private FontEx font; - - [Browsable(false)] - [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] - public new FontEx Font - { - get => font; - set - { - if (font != value) - { - font = value; - - base.Font = font.Font; - } - } - } - - public event EventHandler Committed; - - public HotSpotTextBox() - { - BorderStyle = BorderStyle.None; - } - - protected override void OnVisibleChanged(EventArgs e) - { - base.OnVisibleChanged(e); - - if (Visible) - { - if (HotSpot != null) - { - Focus(); - Select(0, TextLength); - } - } - } - - protected override void OnKeyDown(KeyEventArgs e) - { - if (e.KeyCode == Keys.Enter) - { - OnCommit(); - - e.Handled = true; - e.SuppressKeyPress = true; - } - - base.OnKeyDown(e); - } - - /*protected override void OnLeave(EventArgs e) - { - base.OnLeave(e); - - OnCommit(); - }*/ - - protected override void OnTextChanged(EventArgs e) - { - base.OnTextChanged(e); - - var w = (TextLength + 1) * font.Width; - if (w > MinimumWidth) - { - Width = w; - } - } - - private void OnCommit() - { - hotSpot.Text = Text.Trim(); - - Committed?.Invoke(this, EventArgs.Empty); - - Visible = false; - } - } -} diff --git a/ReClass.NET/UI/ISettingsBindable.cs b/ReClass.NET/UI/ISettingsBindable.cs deleted file mode 100644 index bc88ed77..00000000 --- a/ReClass.NET/UI/ISettingsBindable.cs +++ /dev/null @@ -1,9 +0,0 @@ -namespace ReClassNET.UI -{ - interface ISettingsBindable - { - string SettingName { get; set; } - - Settings Source { get; set; } - } -} 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 0dea2223..00000000 --- a/ReClass.NET/UI/Icons.cs +++ /dev/null @@ -1,29 +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 Array { get; } = DpiUtil.ScaleImage(Properties.Resources.B16x16_Array_Type); - 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); - } -} diff --git a/ReClass.NET/UI/LinkedWindowFeatures.cs b/ReClass.NET/UI/LinkedWindowFeatures.cs index 8d4c26d8..36dab03e 100644 --- a/ReClass.NET/UI/LinkedWindowFeatures.cs +++ b/ReClass.NET/UI/LinkedWindowFeatures.cs @@ -1,9 +1,7 @@ -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; @@ -18,13 +16,13 @@ public static ClassNode CreateClassAtAddress(IntPtr address, bool addDefaultByte { Contract.Ensures(Contract.Result() != null); - var classView = Program.MainForm.ClassView; + 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; @@ -49,13 +47,13 @@ public static ClassNode CreateDefaultClass() public static void SetCurrentClassAddress(IntPtr address) { - var classNode = Program.MainForm.ClassView.SelectedClass; + var classNode = Program.MainForm.ProjectView.SelectedClass; if (classNode == null) { return; } - classNode.Address = address; + classNode.AddressFormula = address.ToString("X"); } public static void FindWhatInteractsWithAddress(IntPtr address, int size, bool writeOnly) @@ -91,7 +89,7 @@ public static void StartMemoryScan(IScanComparer comparer) } if (sf == null) { - sf = new ScannerForm(); + sf = new ScannerForm(Program.RemoteProcess); sf.Show(); } @@ -131,20 +129,5 @@ public static void StartMemoryScan(IScanComparer comparer) sf.ExcuteScan(settings, comparer); } - - public static void ShowCodeGeneratorForm(IEnumerable classes) - { - Contract.Requires(classes != null); - - ShowCodeGeneratorForm(classes, new CppCodeGenerator()); - } - - public static void ShowCodeGeneratorForm(IEnumerable classes, ICodeGenerator generator) - { - Contract.Requires(classes != null); - Contract.Requires(generator != null); - - new CodeForm(generator, classes, Program.Logger).Show(); - } } } diff --git a/ReClass.NET/UI/MemoryViewControl.Designer.cs b/ReClass.NET/UI/MemoryViewControl.Designer.cs deleted file mode 100644 index 87c87199..00000000 --- a/ReClass.NET/UI/MemoryViewControl.Designer.cs +++ /dev/null @@ -1,922 +0,0 @@ -namespace ReClassNET.UI -{ - partial class MemoryViewControl - { - /// - /// Erforderliche Designervariable. - /// - private System.ComponentModel.IContainer components = null; - - /// - /// Verwendete Ressourcen bereinigen. - /// - /// True, wenn verwaltete Ressourcen gelöscht werden sollen; andernfalls False. - protected override void Dispose(bool disposing) - { - if (disposing && (components != null)) - { - components.Dispose(); - } - base.Dispose(disposing); - } - - #region Vom Komponenten-Designer generierter Code - - /// - /// Erforderliche Methode für die Designerunterstützung. - /// Der Inhalt der Methode darf nicht mit dem Code-Editor geändert werden. - /// - private void InitializeComponent() - { - this.components = new System.ComponentModel.Container(); - this.selectedNodeContextMenuStrip = new System.Windows.Forms.ContextMenuStrip(this.components); - this.changeTypeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.hex64ToolStripMenuItem = new ReClassNET.UI.TypeToolStripMenuItem(); - this.hex32ToolStripMenuItem = new ReClassNET.UI.TypeToolStripMenuItem(); - this.hex16ToolStripMenuItem = new ReClassNET.UI.TypeToolStripMenuItem(); - this.hex8ToolStripMenuItem = new ReClassNET.UI.TypeToolStripMenuItem(); - this.toolStripSeparator3 = new System.Windows.Forms.ToolStripSeparator(); - this.int64ToolStripMenuItem = new ReClassNET.UI.TypeToolStripMenuItem(); - this.int32ToolStripMenuItem = new ReClassNET.UI.TypeToolStripMenuItem(); - this.int16ToolStripMenuItem = new ReClassNET.UI.TypeToolStripMenuItem(); - this.int8ToolStripMenuItem = new ReClassNET.UI.TypeToolStripMenuItem(); - this.toolStripSeparator4 = new System.Windows.Forms.ToolStripSeparator(); - this.uInt64ToolStripMenuItem = new ReClassNET.UI.TypeToolStripMenuItem(); - this.uInt32ToolStripMenuItem = new ReClassNET.UI.TypeToolStripMenuItem(); - this.uInt16ToolStripMenuItem = new ReClassNET.UI.TypeToolStripMenuItem(); - this.uInt8ToolStripMenuItem = new ReClassNET.UI.TypeToolStripMenuItem(); - this.toolStripSeparator5 = new System.Windows.Forms.ToolStripSeparator(); - this.boolToolStripMenuItem = new ReClassNET.UI.TypeToolStripMenuItem(); - this.bitsToolStripMenuItem = new ReClassNET.UI.TypeToolStripMenuItem(); - this.toolStripSeparator11 = new System.Windows.Forms.ToolStripSeparator(); - this.floatToolStripMenuItem = new ReClassNET.UI.TypeToolStripMenuItem(); - this.doubleToolStripMenuItem = new ReClassNET.UI.TypeToolStripMenuItem(); - this.toolStripSeparator6 = new System.Windows.Forms.ToolStripSeparator(); - this.vector4ToolStripMenuItem = new ReClassNET.UI.TypeToolStripMenuItem(); - this.vector3ToolStripMenuItem = new ReClassNET.UI.TypeToolStripMenuItem(); - this.vector2ToolStripMenuItem = new ReClassNET.UI.TypeToolStripMenuItem(); - this.toolStripSeparator7 = new System.Windows.Forms.ToolStripSeparator(); - this.matrix4x4ToolStripMenuItem = new ReClassNET.UI.TypeToolStripMenuItem(); - this.matrix3x4ToolStripMenuItem = new ReClassNET.UI.TypeToolStripMenuItem(); - this.matrix3x3ToolStripMenuItem = new ReClassNET.UI.TypeToolStripMenuItem(); - this.toolStripSeparator8 = new System.Windows.Forms.ToolStripSeparator(); - this.uTF8TextToolStripMenuItem = new ReClassNET.UI.TypeToolStripMenuItem(); - this.uTF8TextPointerToolStripMenuItem = new ReClassNET.UI.TypeToolStripMenuItem(); - this.uTF16TextToolStripMenuItem = new ReClassNET.UI.TypeToolStripMenuItem(); - this.uTF16TextPointerToolStripMenuItem = new ReClassNET.UI.TypeToolStripMenuItem(); - this.toolStripSeparator9 = new System.Windows.Forms.ToolStripSeparator(); - this.classInstanceToolStripMenuItem = new ReClassNET.UI.TypeToolStripMenuItem(); - this.classPointerToolStripMenuItem = new ReClassNET.UI.TypeToolStripMenuItem(); - this.toolStripSeparator10 = new System.Windows.Forms.ToolStripSeparator(); - this.arrayToolStripMenuItem = new ReClassNET.UI.TypeToolStripMenuItem(); - this.arrayOfPointersToolStripMenuItem = new ReClassNET.UI.TypeToolStripMenuItem(); - this.vTablePointerToolStripMenuItem = new ReClassNET.UI.TypeToolStripMenuItem(); - this.functionPointerToolStripMenuItem = new ReClassNET.UI.TypeToolStripMenuItem(); - this.functionToolStripMenuItem = new ReClassNET.UI.TypeToolStripMenuItem(); - this.addBytesToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - 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.insertBytesToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - 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.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator(); - this.createClassFromNodesToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.toolStripSeparator13 = new System.Windows.Forms.ToolStripSeparator(); - this.dissectNodesToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator(); - this.searchForEqualValuesToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.toolStripSeparator15 = new System.Windows.Forms.ToolStripSeparator(); - this.findOutWhatAccessesThisAddressToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.findOutWhatWritesToThisAddressToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.toolStripSeparator14 = new System.Windows.Forms.ToolStripSeparator(); - this.copyNodeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.pasteNodesToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.removeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.toolStripSeparator12 = new System.Windows.Forms.ToolStripSeparator(); - this.copyAddressToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.showCodeOfClassToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - 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.toolStripSeparator16 = new System.Windows.Forms.ToolStripSeparator(); - this.selectedNodeContextMenuStrip.SuspendLayout(); - this.SuspendLayout(); - // - // selectedNodeContextMenuStrip - // - this.selectedNodeContextMenuStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.changeTypeToolStripMenuItem, - this.addBytesToolStripMenuItem, - this.insertBytesToolStripMenuItem, - this.toolStripSeparator1, - this.createClassFromNodesToolStripMenuItem, - this.toolStripSeparator13, - this.dissectNodesToolStripMenuItem, - this.toolStripSeparator2, - this.searchForEqualValuesToolStripMenuItem, - this.toolStripSeparator15, - this.findOutWhatAccessesThisAddressToolStripMenuItem, - this.findOutWhatWritesToThisAddressToolStripMenuItem, - this.toolStripSeparator14, - this.copyNodeToolStripMenuItem, - this.pasteNodesToolStripMenuItem, - this.removeToolStripMenuItem, - this.toolStripSeparator12, - this.copyAddressToolStripMenuItem, - this.toolStripSeparator16, - this.showCodeOfClassToolStripMenuItem}); - this.selectedNodeContextMenuStrip.Name = "selectedNodeContextMenuStrip"; - this.selectedNodeContextMenuStrip.Size = new System.Drawing.Size(270, 354); - this.selectedNodeContextMenuStrip.Opening += new System.ComponentModel.CancelEventHandler(this.selectedNodeContextMenuStrip_Opening); - // - // changeTypeToolStripMenuItem - // - this.changeTypeToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.hex64ToolStripMenuItem, - this.hex32ToolStripMenuItem, - this.hex16ToolStripMenuItem, - this.hex8ToolStripMenuItem, - this.toolStripSeparator3, - this.int64ToolStripMenuItem, - this.int32ToolStripMenuItem, - this.int16ToolStripMenuItem, - this.int8ToolStripMenuItem, - this.toolStripSeparator4, - this.uInt64ToolStripMenuItem, - this.uInt32ToolStripMenuItem, - this.uInt16ToolStripMenuItem, - this.uInt8ToolStripMenuItem, - this.toolStripSeparator5, - this.boolToolStripMenuItem, - this.bitsToolStripMenuItem, - this.toolStripSeparator11, - this.floatToolStripMenuItem, - this.doubleToolStripMenuItem, - this.toolStripSeparator6, - this.vector4ToolStripMenuItem, - this.vector3ToolStripMenuItem, - this.vector2ToolStripMenuItem, - this.toolStripSeparator7, - this.matrix4x4ToolStripMenuItem, - this.matrix3x4ToolStripMenuItem, - this.matrix3x3ToolStripMenuItem, - this.toolStripSeparator8, - this.uTF8TextToolStripMenuItem, - this.uTF8TextPointerToolStripMenuItem, - this.uTF16TextToolStripMenuItem, - this.uTF16TextPointerToolStripMenuItem, - this.toolStripSeparator9, - this.classInstanceToolStripMenuItem, - this.classPointerToolStripMenuItem, - this.toolStripSeparator10, - this.arrayToolStripMenuItem, - this.arrayOfPointersToolStripMenuItem, - this.vTablePointerToolStripMenuItem, - this.functionPointerToolStripMenuItem, - this.functionToolStripMenuItem}); - this.changeTypeToolStripMenuItem.Image = global::ReClassNET.Properties.Resources.B16x16_Exchange_Button; - this.changeTypeToolStripMenuItem.Name = "changeTypeToolStripMenuItem"; - this.changeTypeToolStripMenuItem.Size = new System.Drawing.Size(269, 22); - this.changeTypeToolStripMenuItem.Text = "Change Type"; - // - // hex64ToolStripMenuItem - // - this.hex64ToolStripMenuItem.Image = global::ReClassNET.Properties.Resources.B16x16_Button_Hex_64; - this.hex64ToolStripMenuItem.Name = "hex64ToolStripMenuItem"; - this.hex64ToolStripMenuItem.Size = new System.Drawing.Size(172, 22); - this.hex64ToolStripMenuItem.Text = "Hex 64"; - this.hex64ToolStripMenuItem.Value = typeof(ReClassNET.Nodes.Hex64Node); - this.hex64ToolStripMenuItem.Click += new System.EventHandler(this.memoryTypeToolStripMenuItem_Click); - // - // hex32ToolStripMenuItem - // - this.hex32ToolStripMenuItem.Image = global::ReClassNET.Properties.Resources.B16x16_Button_Hex_32; - this.hex32ToolStripMenuItem.Name = "hex32ToolStripMenuItem"; - this.hex32ToolStripMenuItem.Size = new System.Drawing.Size(172, 22); - this.hex32ToolStripMenuItem.Text = "Hex 32"; - this.hex32ToolStripMenuItem.Value = typeof(ReClassNET.Nodes.Hex32Node); - this.hex32ToolStripMenuItem.Click += new System.EventHandler(this.memoryTypeToolStripMenuItem_Click); - // - // hex16ToolStripMenuItem - // - this.hex16ToolStripMenuItem.Image = global::ReClassNET.Properties.Resources.B16x16_Button_Hex_16; - this.hex16ToolStripMenuItem.Name = "hex16ToolStripMenuItem"; - this.hex16ToolStripMenuItem.Size = new System.Drawing.Size(172, 22); - this.hex16ToolStripMenuItem.Text = "Hex 16"; - this.hex16ToolStripMenuItem.Value = typeof(ReClassNET.Nodes.Hex16Node); - this.hex16ToolStripMenuItem.Click += new System.EventHandler(this.memoryTypeToolStripMenuItem_Click); - // - // hex8ToolStripMenuItem - // - this.hex8ToolStripMenuItem.Image = global::ReClassNET.Properties.Resources.B16x16_Button_Hex_8; - this.hex8ToolStripMenuItem.Name = "hex8ToolStripMenuItem"; - this.hex8ToolStripMenuItem.Size = new System.Drawing.Size(172, 22); - this.hex8ToolStripMenuItem.Text = "Hex 8"; - this.hex8ToolStripMenuItem.Value = typeof(ReClassNET.Nodes.Hex8Node); - this.hex8ToolStripMenuItem.Click += new System.EventHandler(this.memoryTypeToolStripMenuItem_Click); - // - // toolStripSeparator3 - // - this.toolStripSeparator3.Name = "toolStripSeparator3"; - this.toolStripSeparator3.Size = new System.Drawing.Size(169, 6); - // - // int64ToolStripMenuItem - // - this.int64ToolStripMenuItem.Image = global::ReClassNET.Properties.Resources.B16x16_Button_Int_64; - this.int64ToolStripMenuItem.Name = "int64ToolStripMenuItem"; - this.int64ToolStripMenuItem.Size = new System.Drawing.Size(172, 22); - this.int64ToolStripMenuItem.Text = "Int 64"; - this.int64ToolStripMenuItem.Value = typeof(ReClassNET.Nodes.Int64Node); - this.int64ToolStripMenuItem.Click += new System.EventHandler(this.memoryTypeToolStripMenuItem_Click); - // - // int32ToolStripMenuItem - // - this.int32ToolStripMenuItem.Image = global::ReClassNET.Properties.Resources.B16x16_Button_Int_32; - this.int32ToolStripMenuItem.Name = "int32ToolStripMenuItem"; - this.int32ToolStripMenuItem.Size = new System.Drawing.Size(172, 22); - this.int32ToolStripMenuItem.Text = "Int 32"; - this.int32ToolStripMenuItem.Value = typeof(ReClassNET.Nodes.Int32Node); - this.int32ToolStripMenuItem.Click += new System.EventHandler(this.memoryTypeToolStripMenuItem_Click); - // - // int16ToolStripMenuItem - // - this.int16ToolStripMenuItem.Image = global::ReClassNET.Properties.Resources.B16x16_Button_Int_16; - this.int16ToolStripMenuItem.Name = "int16ToolStripMenuItem"; - this.int16ToolStripMenuItem.Size = new System.Drawing.Size(172, 22); - this.int16ToolStripMenuItem.Text = "Int 16"; - this.int16ToolStripMenuItem.Value = typeof(ReClassNET.Nodes.Int16Node); - this.int16ToolStripMenuItem.Click += new System.EventHandler(this.memoryTypeToolStripMenuItem_Click); - // - // int8ToolStripMenuItem - // - this.int8ToolStripMenuItem.Image = global::ReClassNET.Properties.Resources.B16x16_Button_Int_8; - this.int8ToolStripMenuItem.Name = "int8ToolStripMenuItem"; - this.int8ToolStripMenuItem.Size = new System.Drawing.Size(172, 22); - this.int8ToolStripMenuItem.Text = "Int 8"; - this.int8ToolStripMenuItem.Value = typeof(ReClassNET.Nodes.Int8Node); - this.int8ToolStripMenuItem.Click += new System.EventHandler(this.memoryTypeToolStripMenuItem_Click); - // - // toolStripSeparator4 - // - this.toolStripSeparator4.Name = "toolStripSeparator4"; - this.toolStripSeparator4.Size = new System.Drawing.Size(169, 6); - // - // uInt64ToolStripMenuItem - // - this.uInt64ToolStripMenuItem.Image = global::ReClassNET.Properties.Resources.B16x16_Button_UInt_64; - this.uInt64ToolStripMenuItem.Name = "uInt64ToolStripMenuItem"; - this.uInt64ToolStripMenuItem.Size = new System.Drawing.Size(172, 22); - this.uInt64ToolStripMenuItem.Text = "UInt 64"; - this.uInt64ToolStripMenuItem.Value = typeof(ReClassNET.Nodes.UInt64Node); - this.uInt64ToolStripMenuItem.Click += new System.EventHandler(this.memoryTypeToolStripMenuItem_Click); - // - // uInt32ToolStripMenuItem - // - this.uInt32ToolStripMenuItem.Image = global::ReClassNET.Properties.Resources.B16x16_Button_UInt_32; - this.uInt32ToolStripMenuItem.Name = "uInt32ToolStripMenuItem"; - this.uInt32ToolStripMenuItem.Size = new System.Drawing.Size(172, 22); - this.uInt32ToolStripMenuItem.Text = "UInt 32"; - this.uInt32ToolStripMenuItem.Value = typeof(ReClassNET.Nodes.UInt32Node); - this.uInt32ToolStripMenuItem.Click += new System.EventHandler(this.memoryTypeToolStripMenuItem_Click); - // - // uInt16ToolStripMenuItem - // - this.uInt16ToolStripMenuItem.Image = global::ReClassNET.Properties.Resources.B16x16_Button_UInt_16; - this.uInt16ToolStripMenuItem.Name = "uInt16ToolStripMenuItem"; - this.uInt16ToolStripMenuItem.Size = new System.Drawing.Size(172, 22); - this.uInt16ToolStripMenuItem.Text = "UInt 16"; - this.uInt16ToolStripMenuItem.Value = typeof(ReClassNET.Nodes.UInt16Node); - this.uInt16ToolStripMenuItem.Click += new System.EventHandler(this.memoryTypeToolStripMenuItem_Click); - // - // uInt8ToolStripMenuItem - // - this.uInt8ToolStripMenuItem.Image = global::ReClassNET.Properties.Resources.B16x16_Button_UInt_8; - this.uInt8ToolStripMenuItem.Name = "uInt8ToolStripMenuItem"; - this.uInt8ToolStripMenuItem.Size = new System.Drawing.Size(172, 22); - this.uInt8ToolStripMenuItem.Text = "UInt 8"; - this.uInt8ToolStripMenuItem.Value = typeof(ReClassNET.Nodes.UInt8Node); - this.uInt8ToolStripMenuItem.Click += new System.EventHandler(this.memoryTypeToolStripMenuItem_Click); - // - // toolStripSeparator5 - // - this.toolStripSeparator5.Name = "toolStripSeparator5"; - this.toolStripSeparator5.Size = new System.Drawing.Size(169, 6); - // - // boolToolStripMenuItem - // - this.boolToolStripMenuItem.Image = global::ReClassNET.Properties.Resources.B16x16_Button_Bool; - this.boolToolStripMenuItem.Name = "boolToolStripMenuItem"; - this.boolToolStripMenuItem.Size = new System.Drawing.Size(172, 22); - this.boolToolStripMenuItem.Text = "Bool"; - this.boolToolStripMenuItem.Value = typeof(ReClassNET.Nodes.BoolNode); - this.boolToolStripMenuItem.Click += new System.EventHandler(this.memoryTypeToolStripMenuItem_Click); - // - // bitsToolStripMenuItem - // - this.bitsToolStripMenuItem.Image = global::ReClassNET.Properties.Resources.B16x16_Button_Bits; - this.bitsToolStripMenuItem.Name = "bitsToolStripMenuItem"; - this.bitsToolStripMenuItem.Size = new System.Drawing.Size(172, 22); - this.bitsToolStripMenuItem.Text = "Bits"; - this.bitsToolStripMenuItem.Value = typeof(ReClassNET.Nodes.BitFieldNode); - this.bitsToolStripMenuItem.Click += new System.EventHandler(this.memoryTypeToolStripMenuItem_Click); - // - // toolStripSeparator11 - // - this.toolStripSeparator11.Name = "toolStripSeparator11"; - this.toolStripSeparator11.Size = new System.Drawing.Size(169, 6); - // - // floatToolStripMenuItem - // - this.floatToolStripMenuItem.Image = global::ReClassNET.Properties.Resources.B16x16_Button_Float; - this.floatToolStripMenuItem.Name = "floatToolStripMenuItem"; - this.floatToolStripMenuItem.Size = new System.Drawing.Size(172, 22); - this.floatToolStripMenuItem.Text = "Float"; - this.floatToolStripMenuItem.Value = typeof(ReClassNET.Nodes.FloatNode); - this.floatToolStripMenuItem.Click += new System.EventHandler(this.memoryTypeToolStripMenuItem_Click); - // - // doubleToolStripMenuItem - // - this.doubleToolStripMenuItem.Image = global::ReClassNET.Properties.Resources.B16x16_Button_Double; - this.doubleToolStripMenuItem.Name = "doubleToolStripMenuItem"; - this.doubleToolStripMenuItem.Size = new System.Drawing.Size(172, 22); - this.doubleToolStripMenuItem.Text = "Double"; - this.doubleToolStripMenuItem.Value = typeof(ReClassNET.Nodes.DoubleNode); - this.doubleToolStripMenuItem.Click += new System.EventHandler(this.memoryTypeToolStripMenuItem_Click); - // - // toolStripSeparator6 - // - this.toolStripSeparator6.Name = "toolStripSeparator6"; - this.toolStripSeparator6.Size = new System.Drawing.Size(169, 6); - // - // vector4ToolStripMenuItem - // - this.vector4ToolStripMenuItem.Image = global::ReClassNET.Properties.Resources.B16x16_Button_Vector_4; - this.vector4ToolStripMenuItem.Name = "vector4ToolStripMenuItem"; - this.vector4ToolStripMenuItem.Size = new System.Drawing.Size(172, 22); - this.vector4ToolStripMenuItem.Text = "Vector 4"; - this.vector4ToolStripMenuItem.Value = typeof(ReClassNET.Nodes.Vector4Node); - this.vector4ToolStripMenuItem.Click += new System.EventHandler(this.memoryTypeToolStripMenuItem_Click); - // - // vector3ToolStripMenuItem - // - this.vector3ToolStripMenuItem.Image = global::ReClassNET.Properties.Resources.B16x16_Button_Vector_3; - this.vector3ToolStripMenuItem.Name = "vector3ToolStripMenuItem"; - this.vector3ToolStripMenuItem.Size = new System.Drawing.Size(172, 22); - this.vector3ToolStripMenuItem.Text = "Vector 3"; - this.vector3ToolStripMenuItem.Value = typeof(ReClassNET.Nodes.Vector3Node); - this.vector3ToolStripMenuItem.Click += new System.EventHandler(this.memoryTypeToolStripMenuItem_Click); - // - // vector2ToolStripMenuItem - // - this.vector2ToolStripMenuItem.Image = global::ReClassNET.Properties.Resources.B16x16_Button_Vector_2; - this.vector2ToolStripMenuItem.Name = "vector2ToolStripMenuItem"; - this.vector2ToolStripMenuItem.Size = new System.Drawing.Size(172, 22); - this.vector2ToolStripMenuItem.Text = "Vector 2"; - this.vector2ToolStripMenuItem.Value = typeof(ReClassNET.Nodes.Vector2Node); - this.vector2ToolStripMenuItem.Click += new System.EventHandler(this.memoryTypeToolStripMenuItem_Click); - // - // toolStripSeparator7 - // - this.toolStripSeparator7.Name = "toolStripSeparator7"; - this.toolStripSeparator7.Size = new System.Drawing.Size(169, 6); - // - // matrix4x4ToolStripMenuItem - // - this.matrix4x4ToolStripMenuItem.Image = global::ReClassNET.Properties.Resources.B16x16_Button_Matrix_4x4; - this.matrix4x4ToolStripMenuItem.Name = "matrix4x4ToolStripMenuItem"; - this.matrix4x4ToolStripMenuItem.Size = new System.Drawing.Size(172, 22); - this.matrix4x4ToolStripMenuItem.Text = "Matrix 4x4"; - this.matrix4x4ToolStripMenuItem.Value = typeof(ReClassNET.Nodes.Matrix4x4Node); - this.matrix4x4ToolStripMenuItem.Click += new System.EventHandler(this.memoryTypeToolStripMenuItem_Click); - // - // matrix3x4ToolStripMenuItem - // - this.matrix3x4ToolStripMenuItem.Image = global::ReClassNET.Properties.Resources.B16x16_Button_Matrix_3x4; - this.matrix3x4ToolStripMenuItem.Name = "matrix3x4ToolStripMenuItem"; - this.matrix3x4ToolStripMenuItem.Size = new System.Drawing.Size(172, 22); - this.matrix3x4ToolStripMenuItem.Text = "Matrix 3x4"; - this.matrix3x4ToolStripMenuItem.Value = typeof(ReClassNET.Nodes.Matrix3x4Node); - this.matrix3x4ToolStripMenuItem.Click += new System.EventHandler(this.memoryTypeToolStripMenuItem_Click); - // - // matrix3x3ToolStripMenuItem - // - this.matrix3x3ToolStripMenuItem.Image = global::ReClassNET.Properties.Resources.B16x16_Button_Matrix_3x3; - this.matrix3x3ToolStripMenuItem.Name = "matrix3x3ToolStripMenuItem"; - this.matrix3x3ToolStripMenuItem.Size = new System.Drawing.Size(172, 22); - this.matrix3x3ToolStripMenuItem.Text = "Matrix 3x3"; - this.matrix3x3ToolStripMenuItem.Value = typeof(ReClassNET.Nodes.Matrix3x3Node); - this.matrix3x3ToolStripMenuItem.Click += new System.EventHandler(this.memoryTypeToolStripMenuItem_Click); - // - // toolStripSeparator8 - // - this.toolStripSeparator8.Name = "toolStripSeparator8"; - this.toolStripSeparator8.Size = new System.Drawing.Size(169, 6); - // - // uTF8TextToolStripMenuItem - // - this.uTF8TextToolStripMenuItem.Image = global::ReClassNET.Properties.Resources.B16x16_Button_Text; - this.uTF8TextToolStripMenuItem.Name = "uTF8TextToolStripMenuItem"; - this.uTF8TextToolStripMenuItem.Size = new System.Drawing.Size(172, 22); - this.uTF8TextToolStripMenuItem.Text = "UTF8 Text"; - this.uTF8TextToolStripMenuItem.Value = typeof(ReClassNET.Nodes.Utf8TextNode); - this.uTF8TextToolStripMenuItem.Click += new System.EventHandler(this.memoryTypeToolStripMenuItem_Click); - // - // uTF8TextPointerToolStripMenuItem - // - this.uTF8TextPointerToolStripMenuItem.Image = global::ReClassNET.Properties.Resources.B16x16_Button_Text_Pointer; - this.uTF8TextPointerToolStripMenuItem.Name = "uTF8TextPointerToolStripMenuItem"; - this.uTF8TextPointerToolStripMenuItem.Size = new System.Drawing.Size(172, 22); - this.uTF8TextPointerToolStripMenuItem.Text = "UTF8 Text Pointer"; - this.uTF8TextPointerToolStripMenuItem.Value = typeof(ReClassNET.Nodes.Utf8TextPtrNode); - this.uTF8TextPointerToolStripMenuItem.Click += new System.EventHandler(this.memoryTypeToolStripMenuItem_Click); - // - // uTF16TextToolStripMenuItem - // - this.uTF16TextToolStripMenuItem.Image = global::ReClassNET.Properties.Resources.B16x16_Button_UText; - this.uTF16TextToolStripMenuItem.Name = "uTF16TextToolStripMenuItem"; - this.uTF16TextToolStripMenuItem.Size = new System.Drawing.Size(172, 22); - this.uTF16TextToolStripMenuItem.Text = "UTF16 Text"; - this.uTF16TextToolStripMenuItem.Value = typeof(ReClassNET.Nodes.Utf16TextNode); - this.uTF16TextToolStripMenuItem.Click += new System.EventHandler(this.memoryTypeToolStripMenuItem_Click); - // - // uTF16TextPointerToolStripMenuItem - // - this.uTF16TextPointerToolStripMenuItem.Image = global::ReClassNET.Properties.Resources.B16x16_Button_UText_Pointer; - this.uTF16TextPointerToolStripMenuItem.Name = "uTF16TextPointerToolStripMenuItem"; - this.uTF16TextPointerToolStripMenuItem.Size = new System.Drawing.Size(172, 22); - this.uTF16TextPointerToolStripMenuItem.Text = "UTF16 Text Pointer"; - this.uTF16TextPointerToolStripMenuItem.Value = typeof(ReClassNET.Nodes.Utf16TextPtrNode); - this.uTF16TextPointerToolStripMenuItem.Click += new System.EventHandler(this.memoryTypeToolStripMenuItem_Click); - // - // toolStripSeparator9 - // - this.toolStripSeparator9.Name = "toolStripSeparator9"; - this.toolStripSeparator9.Size = new System.Drawing.Size(169, 6); - // - // classInstanceToolStripMenuItem - // - this.classInstanceToolStripMenuItem.Image = global::ReClassNET.Properties.Resources.B16x16_Button_Class_Instance; - this.classInstanceToolStripMenuItem.Name = "classInstanceToolStripMenuItem"; - this.classInstanceToolStripMenuItem.Size = new System.Drawing.Size(172, 22); - this.classInstanceToolStripMenuItem.Text = "Class Instance"; - this.classInstanceToolStripMenuItem.Value = typeof(ReClassNET.Nodes.ClassInstanceNode); - this.classInstanceToolStripMenuItem.Click += new System.EventHandler(this.memoryTypeToolStripMenuItem_Click); - // - // classPointerToolStripMenuItem - // - this.classPointerToolStripMenuItem.Image = global::ReClassNET.Properties.Resources.B16x16_Button_Class_Pointer; - this.classPointerToolStripMenuItem.Name = "classPointerToolStripMenuItem"; - this.classPointerToolStripMenuItem.Size = new System.Drawing.Size(172, 22); - this.classPointerToolStripMenuItem.Text = "Class Pointer"; - this.classPointerToolStripMenuItem.Value = typeof(ReClassNET.Nodes.ClassPtrNode); - this.classPointerToolStripMenuItem.Click += new System.EventHandler(this.memoryTypeToolStripMenuItem_Click); - // - // toolStripSeparator10 - // - this.toolStripSeparator10.Name = "toolStripSeparator10"; - this.toolStripSeparator10.Size = new System.Drawing.Size(169, 6); - // - // arrayToolStripMenuItem - // - this.arrayToolStripMenuItem.Image = global::ReClassNET.Properties.Resources.B16x16_Button_Array; - this.arrayToolStripMenuItem.Name = "arrayToolStripMenuItem"; - this.arrayToolStripMenuItem.Size = new System.Drawing.Size(172, 22); - this.arrayToolStripMenuItem.Text = "Array of Classes"; - this.arrayToolStripMenuItem.Value = typeof(ReClassNET.Nodes.ClassInstanceArrayNode); - this.arrayToolStripMenuItem.Click += new System.EventHandler(this.memoryTypeToolStripMenuItem_Click); - // - // arrayOfPointersToolStripMenuItem - // - this.arrayOfPointersToolStripMenuItem.Image = global::ReClassNET.Properties.Resources.B16x16_Button_Pointer_Array; - this.arrayOfPointersToolStripMenuItem.Name = "arrayOfPointersToolStripMenuItem"; - this.arrayOfPointersToolStripMenuItem.Size = new System.Drawing.Size(172, 22); - this.arrayOfPointersToolStripMenuItem.Text = "Array of Pointers"; - this.arrayOfPointersToolStripMenuItem.Value = typeof(ReClassNET.Nodes.ClassPtrArrayNode); - this.arrayOfPointersToolStripMenuItem.Click += new System.EventHandler(this.memoryTypeToolStripMenuItem_Click); - // - // vTablePointerToolStripMenuItem - // - this.vTablePointerToolStripMenuItem.Image = global::ReClassNET.Properties.Resources.B16x16_Button_VTable; - this.vTablePointerToolStripMenuItem.Name = "vTablePointerToolStripMenuItem"; - this.vTablePointerToolStripMenuItem.Size = new System.Drawing.Size(172, 22); - this.vTablePointerToolStripMenuItem.Text = "VTable Pointer"; - this.vTablePointerToolStripMenuItem.Value = typeof(ReClassNET.Nodes.VTableNode); - this.vTablePointerToolStripMenuItem.Click += new System.EventHandler(this.memoryTypeToolStripMenuItem_Click); - // - // functionPointerToolStripMenuItem - // - this.functionPointerToolStripMenuItem.Image = global::ReClassNET.Properties.Resources.B16x16_Button_Function_Pointer; - this.functionPointerToolStripMenuItem.Name = "functionPointerToolStripMenuItem"; - this.functionPointerToolStripMenuItem.Size = new System.Drawing.Size(172, 22); - this.functionPointerToolStripMenuItem.Text = "Function Pointer"; - this.functionPointerToolStripMenuItem.Value = typeof(ReClassNET.Nodes.FunctionPtrNode); - this.functionPointerToolStripMenuItem.Click += new System.EventHandler(this.memoryTypeToolStripMenuItem_Click); - // - // functionToolStripMenuItem - // - this.functionToolStripMenuItem.Image = global::ReClassNET.Properties.Resources.B16x16_Button_Function; - this.functionToolStripMenuItem.Name = "functionToolStripMenuItem"; - this.functionToolStripMenuItem.Size = new System.Drawing.Size(172, 22); - this.functionToolStripMenuItem.Text = "Function"; - this.functionToolStripMenuItem.Value = typeof(ReClassNET.Nodes.FunctionNode); - this.functionToolStripMenuItem.Click += new System.EventHandler(this.memoryTypeToolStripMenuItem_Click); - // - // addBytesToolStripMenuItem - // - this.addBytesToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.add4BytesToolStripMenuItem, - this.add8BytesToolStripMenuItem, - this.add64BytesToolStripMenuItem, - this.add256BytesToolStripMenuItem, - this.add1024BytesToolStripMenuItem, - this.add2048BytesToolStripMenuItem, - this.add4096BytesToolStripMenuItem}); - this.addBytesToolStripMenuItem.Image = global::ReClassNET.Properties.Resources.B16x16_Button_Add_Bytes_X; - this.addBytesToolStripMenuItem.Name = "addBytesToolStripMenuItem"; - this.addBytesToolStripMenuItem.Size = new System.Drawing.Size(269, 22); - this.addBytesToolStripMenuItem.Text = "Add Bytes"; - // - // add4BytesToolStripMenuItem - // - this.add4BytesToolStripMenuItem.Image = global::ReClassNET.Properties.Resources.B16x16_Button_Add_Bytes_4; - this.add4BytesToolStripMenuItem.Name = "add4BytesToolStripMenuItem"; - this.add4BytesToolStripMenuItem.Size = new System.Drawing.Size(154, 22); - this.add4BytesToolStripMenuItem.Text = "Add 4 Bytes"; - this.add4BytesToolStripMenuItem.Value = 4; - this.add4BytesToolStripMenuItem.Click += new System.EventHandler(this.addBytesToolStripMenuItem_Click); - // - // add8BytesToolStripMenuItem - // - this.add8BytesToolStripMenuItem.Image = global::ReClassNET.Properties.Resources.B16x16_Button_Add_Bytes_8; - this.add8BytesToolStripMenuItem.Name = "add8BytesToolStripMenuItem"; - this.add8BytesToolStripMenuItem.Size = new System.Drawing.Size(154, 22); - this.add8BytesToolStripMenuItem.Text = "Add 8 Bytes"; - this.add8BytesToolStripMenuItem.Value = 8; - this.add8BytesToolStripMenuItem.Click += new System.EventHandler(this.addBytesToolStripMenuItem_Click); - // - // add64BytesToolStripMenuItem - // - this.add64BytesToolStripMenuItem.Image = global::ReClassNET.Properties.Resources.B16x16_Button_Add_Bytes_64; - this.add64BytesToolStripMenuItem.Name = "add64BytesToolStripMenuItem"; - this.add64BytesToolStripMenuItem.Size = new System.Drawing.Size(154, 22); - this.add64BytesToolStripMenuItem.Text = "Add 64 Bytes"; - this.add64BytesToolStripMenuItem.Value = 64; - this.add64BytesToolStripMenuItem.Click += new System.EventHandler(this.addBytesToolStripMenuItem_Click); - // - // add256BytesToolStripMenuItem - // - this.add256BytesToolStripMenuItem.Image = global::ReClassNET.Properties.Resources.B16x16_Button_Add_Bytes_256; - this.add256BytesToolStripMenuItem.Name = "add256BytesToolStripMenuItem"; - this.add256BytesToolStripMenuItem.Size = new System.Drawing.Size(154, 22); - this.add256BytesToolStripMenuItem.Text = "Add 256 Bytes"; - this.add256BytesToolStripMenuItem.Value = 256; - this.add256BytesToolStripMenuItem.Click += new System.EventHandler(this.addBytesToolStripMenuItem_Click); - // - // add1024BytesToolStripMenuItem - // - this.add1024BytesToolStripMenuItem.Image = global::ReClassNET.Properties.Resources.B16x16_Button_Add_Bytes_1024; - this.add1024BytesToolStripMenuItem.Name = "add1024BytesToolStripMenuItem"; - this.add1024BytesToolStripMenuItem.Size = new System.Drawing.Size(154, 22); - this.add1024BytesToolStripMenuItem.Text = "Add 1024 Bytes"; - this.add1024BytesToolStripMenuItem.Value = 1024; - this.add1024BytesToolStripMenuItem.Click += new System.EventHandler(this.addBytesToolStripMenuItem_Click); - // - // add2048BytesToolStripMenuItem - // - this.add2048BytesToolStripMenuItem.Image = global::ReClassNET.Properties.Resources.B16x16_Button_Add_Bytes_2048; - this.add2048BytesToolStripMenuItem.Name = "add2048BytesToolStripMenuItem"; - this.add2048BytesToolStripMenuItem.Size = new System.Drawing.Size(154, 22); - this.add2048BytesToolStripMenuItem.Text = "Add 2048 Bytes"; - this.add2048BytesToolStripMenuItem.Value = 2048; - this.add2048BytesToolStripMenuItem.Click += new System.EventHandler(this.addBytesToolStripMenuItem_Click); - // - // add4096BytesToolStripMenuItem - // - this.add4096BytesToolStripMenuItem.Image = global::ReClassNET.Properties.Resources.B16x16_Button_Add_Bytes_4096; - this.add4096BytesToolStripMenuItem.Name = "add4096BytesToolStripMenuItem"; - this.add4096BytesToolStripMenuItem.Size = new System.Drawing.Size(154, 22); - this.add4096BytesToolStripMenuItem.Text = "Add 4096 Bytes"; - this.add4096BytesToolStripMenuItem.Value = 4096; - this.add4096BytesToolStripMenuItem.Click += new System.EventHandler(this.addBytesToolStripMenuItem_Click); - // - // insertBytesToolStripMenuItem - // - this.insertBytesToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.insert4BytesToolStripMenuItem, - this.insert8BytesToolStripMenuItem, - this.insert64BytesToolStripMenuItem, - this.insert256BytesToolStripMenuItem, - this.insert1024BytesToolStripMenuItem, - this.insert2048BytesToolStripMenuItem, - this.insert4096BytesToolStripMenuItem}); - this.insertBytesToolStripMenuItem.Image = global::ReClassNET.Properties.Resources.B16x16_Button_Insert_Bytes_X; - this.insertBytesToolStripMenuItem.Name = "insertBytesToolStripMenuItem"; - this.insertBytesToolStripMenuItem.Size = new System.Drawing.Size(269, 22); - this.insertBytesToolStripMenuItem.Text = "Insert Bytes"; - // - // insert4BytesToolStripMenuItem - // - this.insert4BytesToolStripMenuItem.Image = global::ReClassNET.Properties.Resources.B16x16_Button_Insert_Bytes_4; - this.insert4BytesToolStripMenuItem.Name = "insert4BytesToolStripMenuItem"; - this.insert4BytesToolStripMenuItem.Size = new System.Drawing.Size(161, 22); - this.insert4BytesToolStripMenuItem.Text = "Insert 4 Bytes"; - this.insert4BytesToolStripMenuItem.Value = 4; - this.insert4BytesToolStripMenuItem.Click += new System.EventHandler(this.insertBytesToolStripMenuItem_Click); - // - // insert8BytesToolStripMenuItem - // - this.insert8BytesToolStripMenuItem.Image = global::ReClassNET.Properties.Resources.B16x16_Button_Insert_Bytes_8; - this.insert8BytesToolStripMenuItem.Name = "insert8BytesToolStripMenuItem"; - this.insert8BytesToolStripMenuItem.Size = new System.Drawing.Size(161, 22); - this.insert8BytesToolStripMenuItem.Text = "Insert 8 Bytes"; - this.insert8BytesToolStripMenuItem.Value = 8; - this.insert8BytesToolStripMenuItem.Click += new System.EventHandler(this.insertBytesToolStripMenuItem_Click); - // - // insert64BytesToolStripMenuItem - // - this.insert64BytesToolStripMenuItem.Image = global::ReClassNET.Properties.Resources.B16x16_Button_Insert_Bytes_64; - this.insert64BytesToolStripMenuItem.Name = "insert64BytesToolStripMenuItem"; - this.insert64BytesToolStripMenuItem.Size = new System.Drawing.Size(161, 22); - this.insert64BytesToolStripMenuItem.Text = "Insert 64 Bytes"; - this.insert64BytesToolStripMenuItem.Value = 64; - this.insert64BytesToolStripMenuItem.Click += new System.EventHandler(this.insertBytesToolStripMenuItem_Click); - // - // insert256BytesToolStripMenuItem - // - this.insert256BytesToolStripMenuItem.Image = global::ReClassNET.Properties.Resources.B16x16_Button_Insert_Bytes_256; - this.insert256BytesToolStripMenuItem.Name = "insert256BytesToolStripMenuItem"; - this.insert256BytesToolStripMenuItem.Size = new System.Drawing.Size(161, 22); - this.insert256BytesToolStripMenuItem.Text = "Insert 256 Bytes"; - this.insert256BytesToolStripMenuItem.Value = 256; - this.insert256BytesToolStripMenuItem.Click += new System.EventHandler(this.insertBytesToolStripMenuItem_Click); - // - // insert1024BytesToolStripMenuItem - // - this.insert1024BytesToolStripMenuItem.Image = global::ReClassNET.Properties.Resources.B16x16_Button_Insert_Bytes_1024; - this.insert1024BytesToolStripMenuItem.Name = "insert1024BytesToolStripMenuItem"; - this.insert1024BytesToolStripMenuItem.Size = new System.Drawing.Size(161, 22); - this.insert1024BytesToolStripMenuItem.Text = "Insert 1024 Bytes"; - this.insert1024BytesToolStripMenuItem.Value = 1024; - this.insert1024BytesToolStripMenuItem.Click += new System.EventHandler(this.insertBytesToolStripMenuItem_Click); - // - // insert2048BytesToolStripMenuItem - // - this.insert2048BytesToolStripMenuItem.Image = global::ReClassNET.Properties.Resources.B16x16_Button_Insert_Bytes_2048; - this.insert2048BytesToolStripMenuItem.Name = "insert2048BytesToolStripMenuItem"; - this.insert2048BytesToolStripMenuItem.Size = new System.Drawing.Size(161, 22); - this.insert2048BytesToolStripMenuItem.Text = "Insert 2048 Bytes"; - this.insert2048BytesToolStripMenuItem.Value = 2048; - this.insert2048BytesToolStripMenuItem.Click += new System.EventHandler(this.insertBytesToolStripMenuItem_Click); - // - // insert4096BytesToolStripMenuItem - // - this.insert4096BytesToolStripMenuItem.Image = global::ReClassNET.Properties.Resources.B16x16_Button_Insert_Bytes_4096; - this.insert4096BytesToolStripMenuItem.Name = "insert4096BytesToolStripMenuItem"; - this.insert4096BytesToolStripMenuItem.Size = new System.Drawing.Size(161, 22); - this.insert4096BytesToolStripMenuItem.Text = "Insert 4096 Bytes"; - this.insert4096BytesToolStripMenuItem.Value = 4096; - this.insert4096BytesToolStripMenuItem.Click += new System.EventHandler(this.insertBytesToolStripMenuItem_Click); - // - // toolStripSeparator1 - // - this.toolStripSeparator1.Name = "toolStripSeparator1"; - this.toolStripSeparator1.Size = new System.Drawing.Size(266, 6); - // - // createClassFromNodesToolStripMenuItem - // - this.createClassFromNodesToolStripMenuItem.Image = global::ReClassNET.Properties.Resources.B16x16_Button_Class_Add; - this.createClassFromNodesToolStripMenuItem.Name = "createClassFromNodesToolStripMenuItem"; - this.createClassFromNodesToolStripMenuItem.Size = new System.Drawing.Size(269, 22); - this.createClassFromNodesToolStripMenuItem.Text = "Create Class from Nodes"; - this.createClassFromNodesToolStripMenuItem.Click += new System.EventHandler(this.createClassFromNodesToolStripMenuItem_Click); - // - // toolStripSeparator13 - // - this.toolStripSeparator13.Name = "toolStripSeparator13"; - this.toolStripSeparator13.Size = new System.Drawing.Size(266, 6); - // - // dissectNodesToolStripMenuItem - // - this.dissectNodesToolStripMenuItem.Image = global::ReClassNET.Properties.Resources.B16x16_Camera; - this.dissectNodesToolStripMenuItem.Name = "dissectNodesToolStripMenuItem"; - this.dissectNodesToolStripMenuItem.Size = new System.Drawing.Size(269, 22); - this.dissectNodesToolStripMenuItem.Text = "Dissect Node(s)"; - this.dissectNodesToolStripMenuItem.Click += new System.EventHandler(this.dissectNodesToolStripMenuItem_Click); - // - // toolStripSeparator2 - // - this.toolStripSeparator2.Name = "toolStripSeparator2"; - this.toolStripSeparator2.Size = new System.Drawing.Size(266, 6); - // - // searchForEqualValuesToolStripMenuItem - // - this.searchForEqualValuesToolStripMenuItem.Image = global::ReClassNET.Properties.Resources.B16x16_Eye; - this.searchForEqualValuesToolStripMenuItem.Name = "searchForEqualValuesToolStripMenuItem"; - this.searchForEqualValuesToolStripMenuItem.Size = new System.Drawing.Size(269, 22); - this.searchForEqualValuesToolStripMenuItem.Text = "Search for equal values..."; - this.searchForEqualValuesToolStripMenuItem.Click += new System.EventHandler(this.searchForEqualValuesToolStripMenuItem_Click); - // - // toolStripSeparator15 - // - this.toolStripSeparator15.Name = "toolStripSeparator15"; - this.toolStripSeparator15.Size = new System.Drawing.Size(266, 6); - // - // findOutWhatAccessesThisAddressToolStripMenuItem - // - this.findOutWhatAccessesThisAddressToolStripMenuItem.Image = global::ReClassNET.Properties.Resources.B16x16_Find_Access; - this.findOutWhatAccessesThisAddressToolStripMenuItem.Name = "findOutWhatAccessesThisAddressToolStripMenuItem"; - this.findOutWhatAccessesThisAddressToolStripMenuItem.Size = new System.Drawing.Size(269, 22); - this.findOutWhatAccessesThisAddressToolStripMenuItem.Text = "Find out what accesses this address..."; - this.findOutWhatAccessesThisAddressToolStripMenuItem.Click += new System.EventHandler(this.findOutWhatAccessesThisAddressToolStripMenuItem_Click); - // - // findOutWhatWritesToThisAddressToolStripMenuItem - // - this.findOutWhatWritesToThisAddressToolStripMenuItem.Image = global::ReClassNET.Properties.Resources.B16x16_Find_Write; - this.findOutWhatWritesToThisAddressToolStripMenuItem.Name = "findOutWhatWritesToThisAddressToolStripMenuItem"; - this.findOutWhatWritesToThisAddressToolStripMenuItem.Size = new System.Drawing.Size(269, 22); - this.findOutWhatWritesToThisAddressToolStripMenuItem.Text = "Find out what writes to this address..."; - this.findOutWhatWritesToThisAddressToolStripMenuItem.Click += new System.EventHandler(this.findOutWhatWritesToThisAddressToolStripMenuItem_Click); - // - // toolStripSeparator14 - // - this.toolStripSeparator14.Name = "toolStripSeparator14"; - this.toolStripSeparator14.Size = new System.Drawing.Size(266, 6); - // - // copyNodeToolStripMenuItem - // - this.copyNodeToolStripMenuItem.Image = global::ReClassNET.Properties.Resources.B16x16_Page_Copy; - this.copyNodeToolStripMenuItem.Name = "copyNodeToolStripMenuItem"; - this.copyNodeToolStripMenuItem.Size = new System.Drawing.Size(269, 22); - this.copyNodeToolStripMenuItem.Text = "Copy Node(s)"; - this.copyNodeToolStripMenuItem.Click += new System.EventHandler(this.copyNodeToolStripMenuItem_Click); - // - // pasteNodesToolStripMenuItem - // - this.pasteNodesToolStripMenuItem.Image = global::ReClassNET.Properties.Resources.B16x16_Page_Paste; - this.pasteNodesToolStripMenuItem.Name = "pasteNodesToolStripMenuItem"; - this.pasteNodesToolStripMenuItem.Size = new System.Drawing.Size(269, 22); - this.pasteNodesToolStripMenuItem.Text = "Paste Node(s)"; - this.pasteNodesToolStripMenuItem.Click += new System.EventHandler(this.pasteNodesToolStripMenuItem_Click); - // - // removeToolStripMenuItem - // - this.removeToolStripMenuItem.Image = global::ReClassNET.Properties.Resources.B16x16_Button_Delete; - this.removeToolStripMenuItem.Name = "removeToolStripMenuItem"; - this.removeToolStripMenuItem.Size = new System.Drawing.Size(269, 22); - this.removeToolStripMenuItem.Text = "Remove Node(s)"; - this.removeToolStripMenuItem.Click += new System.EventHandler(this.removeToolStripMenuItem_Click); - // - // toolStripSeparator12 - // - this.toolStripSeparator12.Name = "toolStripSeparator12"; - this.toolStripSeparator12.Size = new System.Drawing.Size(266, 6); - // - // copyAddressToolStripMenuItem - // - this.copyAddressToolStripMenuItem.Image = global::ReClassNET.Properties.Resources.B16x16_Page_Copy; - this.copyAddressToolStripMenuItem.Name = "copyAddressToolStripMenuItem"; - this.copyAddressToolStripMenuItem.Size = new System.Drawing.Size(269, 22); - this.copyAddressToolStripMenuItem.Text = "Copy Address"; - this.copyAddressToolStripMenuItem.Click += new System.EventHandler(this.copyAddressToolStripMenuItem_Click); - // - // showCodeOfClassToolStripMenuItem - // - this.showCodeOfClassToolStripMenuItem.Image = global::ReClassNET.Properties.Resources.B16x16_Page_Code_Cpp; - this.showCodeOfClassToolStripMenuItem.Name = "showCodeOfClassToolStripMenuItem"; - this.showCodeOfClassToolStripMenuItem.Size = new System.Drawing.Size(269, 22); - this.showCodeOfClassToolStripMenuItem.Text = "Show C++ Code of Class"; - this.showCodeOfClassToolStripMenuItem.Click += new System.EventHandler(this.showCodeOfClassToolStripMenuItem_Click); - // - // 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(36, 81); - this.editBox.MinimumWidth = 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; - // - // toolStripSeparator16 - // - this.toolStripSeparator16.Name = "toolStripSeparator16"; - this.toolStripSeparator16.Size = new System.Drawing.Size(266, 6); - // - // MemoryViewControl - // - this.Controls.Add(this.editBox); - this.DoubleBuffered = true; - this.Name = "MemoryViewControl"; - this.Size = new System.Drawing.Size(150, 162); - this.selectedNodeContextMenuStrip.ResumeLayout(false); - this.ResumeLayout(false); - this.PerformLayout(); - - } - - #endregion - - private System.Windows.Forms.ContextMenuStrip selectedNodeContextMenuStrip; - private System.Windows.Forms.ToolStripMenuItem changeTypeToolStripMenuItem; - private System.Windows.Forms.ToolStripMenuItem addBytesToolStripMenuItem; - 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 System.Windows.Forms.ToolStripMenuItem insertBytesToolStripMenuItem; - 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 System.Windows.Forms.ToolStripSeparator toolStripSeparator1; - private System.Windows.Forms.ToolStripMenuItem removeToolStripMenuItem; - private System.Windows.Forms.ToolStripMenuItem copyAddressToolStripMenuItem; - private System.Windows.Forms.Timer repaintTimer; - private HotSpotTextBox editBox; - private System.Windows.Forms.ToolTip nodeInfoToolTip; - private UI.TypeToolStripMenuItem hex64ToolStripMenuItem; - private UI.TypeToolStripMenuItem hex32ToolStripMenuItem; - private UI.TypeToolStripMenuItem hex16ToolStripMenuItem; - private UI.TypeToolStripMenuItem hex8ToolStripMenuItem; - private System.Windows.Forms.ToolStripSeparator toolStripSeparator3; - private UI.TypeToolStripMenuItem int64ToolStripMenuItem; - private UI.TypeToolStripMenuItem int32ToolStripMenuItem; - private UI.TypeToolStripMenuItem int16ToolStripMenuItem; - private UI.TypeToolStripMenuItem int8ToolStripMenuItem; - private System.Windows.Forms.ToolStripSeparator toolStripSeparator4; - private UI.TypeToolStripMenuItem uInt64ToolStripMenuItem; - private UI.TypeToolStripMenuItem uInt32ToolStripMenuItem; - private UI.TypeToolStripMenuItem uInt16ToolStripMenuItem; - private UI.TypeToolStripMenuItem uInt8ToolStripMenuItem; - private System.Windows.Forms.ToolStripSeparator toolStripSeparator5; - private UI.TypeToolStripMenuItem floatToolStripMenuItem; - private UI.TypeToolStripMenuItem doubleToolStripMenuItem; - private System.Windows.Forms.ToolStripSeparator toolStripSeparator6; - private UI.TypeToolStripMenuItem vector4ToolStripMenuItem; - private UI.TypeToolStripMenuItem vector3ToolStripMenuItem; - private UI.TypeToolStripMenuItem vector2ToolStripMenuItem; - private System.Windows.Forms.ToolStripSeparator toolStripSeparator7; - private UI.TypeToolStripMenuItem matrix4x4ToolStripMenuItem; - private UI.TypeToolStripMenuItem matrix3x4ToolStripMenuItem; - private UI.TypeToolStripMenuItem matrix3x3ToolStripMenuItem; - private System.Windows.Forms.ToolStripSeparator toolStripSeparator8; - private UI.TypeToolStripMenuItem uTF8TextToolStripMenuItem; - private UI.TypeToolStripMenuItem uTF8TextPointerToolStripMenuItem; - private UI.TypeToolStripMenuItem uTF16TextToolStripMenuItem; - private UI.TypeToolStripMenuItem uTF16TextPointerToolStripMenuItem; - private System.Windows.Forms.ToolStripSeparator toolStripSeparator9; - private UI.TypeToolStripMenuItem classInstanceToolStripMenuItem; - private UI.TypeToolStripMenuItem classPointerToolStripMenuItem; - private System.Windows.Forms.ToolStripSeparator toolStripSeparator10; - private UI.TypeToolStripMenuItem arrayToolStripMenuItem; - private UI.TypeToolStripMenuItem vTablePointerToolStripMenuItem; - private UI.TypeToolStripMenuItem functionPointerToolStripMenuItem; - private UI.TypeToolStripMenuItem arrayOfPointersToolStripMenuItem; - private UI.TypeToolStripMenuItem bitsToolStripMenuItem; - private System.Windows.Forms.ToolStripSeparator toolStripSeparator11; - private System.Windows.Forms.ToolStripMenuItem copyNodeToolStripMenuItem; - private System.Windows.Forms.ToolStripMenuItem pasteNodesToolStripMenuItem; - private System.Windows.Forms.ToolStripSeparator toolStripSeparator12; - private System.Windows.Forms.ToolStripMenuItem dissectNodesToolStripMenuItem; - private System.Windows.Forms.ToolStripSeparator toolStripSeparator2; - private System.Windows.Forms.ToolStripMenuItem createClassFromNodesToolStripMenuItem; - private System.Windows.Forms.ToolStripSeparator toolStripSeparator13; - private UI.TypeToolStripMenuItem boolToolStripMenuItem; - private UI.TypeToolStripMenuItem functionToolStripMenuItem; - private System.Windows.Forms.ToolStripMenuItem findOutWhatAccessesThisAddressToolStripMenuItem; - private System.Windows.Forms.ToolStripMenuItem findOutWhatWritesToThisAddressToolStripMenuItem; - private System.Windows.Forms.ToolStripSeparator toolStripSeparator14; - private System.Windows.Forms.ToolStripMenuItem searchForEqualValuesToolStripMenuItem; - private System.Windows.Forms.ToolStripSeparator toolStripSeparator15; - private System.Windows.Forms.ToolStripMenuItem showCodeOfClassToolStripMenuItem; - private System.Windows.Forms.ToolStripSeparator toolStripSeparator16; - } -} diff --git a/ReClass.NET/UI/MemoryViewControl.cs b/ReClass.NET/UI/MemoryViewControl.cs deleted file mode 100644 index 63713843..00000000 --- a/ReClass.NET/UI/MemoryViewControl.cs +++ /dev/null @@ -1,1234 +0,0 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Diagnostics; -using System.Diagnostics.Contracts; -using System.Drawing; -using System.Linq; -using System.Text; -using System.Windows.Forms; -using ReClassNET.DataExchange.ReClass; -using ReClassNET.Memory; -using ReClassNET.MemoryScanner; -using ReClassNET.MemoryScanner.Comparer; -using ReClassNET.Nodes; -using ReClassNET.Util; - -namespace ReClassNET.UI -{ - public partial class MemoryViewControl : ScrollableCustomControl - { - private ReClassNetProject project; - - private ClassNode classNode; - - private readonly List hotSpots = new List(); - private readonly List selectedNodes = new List(); - - private HotSpot selectionCaret; - private HotSpot selectionAnchor; - - private readonly FontEx font; - - [Browsable(false)] - [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] - public ReClassNetProject Project - { - get => project; - set - { - Contract.Requires(value != null); - - project = value; - } - } - - [Browsable(false)] - [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] - public ClassNode ClassNode - { - get => classNode; - set - { - editBox.Visible = false; - - ClearSelection(); - - OnSelectionChanged(); - - classNode = value; - - VerticalScroll.Value = 0; - if (classNode != null && Memory?.Process != null) - { - classNode.UpdateAddress(Memory.Process); - } - Invalidate(); - } - } - - [Browsable(false)] - [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] - public MemoryBuffer Memory { get; set; } - - public IEnumerable SelectedNodes => selectedNodes.Select(s => s.Node); - - public event EventHandler SelectionChanged; - - /// The context menu of a node. - public ContextMenuStrip NodeContextMenu => selectedNodeContextMenuStrip; - - private readonly MemoryPreviewPopUp memoryPreviewPopUp; - - public MemoryViewControl() - { - InitializeComponent(); - - if (Program.DesignMode) - { - return; - } - - font = Program.MonoSpaceFont; - - editBox.Font = font; - - 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; - } - - internal void RegisterNodeType(Type type, string name, Image icon) - { - Contract.Requires(type != null); - Contract.Requires(name != null); - Contract.Requires(icon != null); - - var item = new TypeToolStripMenuItem - { - Image = icon, - Text = name, - Value = type - }; - item.Click += memoryTypeToolStripMenuItem_Click; - - changeTypeToolStripMenuItem.DropDownItems.Add(item); - } - - internal void DeregisterNodeType(Type type) - { - Contract.Requires(type != null); - - var item = changeTypeToolStripMenuItem.DropDownItems.OfType().FirstOrDefault(i => i.Value == type); - if (item != null) - { - item.Click -= memoryTypeToolStripMenuItem_Click; - changeTypeToolStripMenuItem.DropDownItems.Remove(item); - } - } - - protected override void OnPaint(PaintEventArgs e) - { - base.OnPaint(e); - - if (DesignMode) - { - e.Graphics.FillRectangle(Brushes.White, ClientRectangle); - - return; - } - - hotSpots.Clear(); - - using (var brush = new SolidBrush(Program.Settings.BackgroundColor)) - { - e.Graphics.FillRectangle(brush, ClientRectangle); - } - - if (ClassNode == null) - { - return; - } - - if (Memory.Process != null) - { - ClassNode.UpdateAddress(Memory.Process); - } - - if (memoryPreviewPopUp.Visible) - { - memoryPreviewPopUp.UpdateMemory(); - } - - Memory.Size = ClassNode.MemorySize; - Memory.Update(ClassNode.Offset); - - BaseHexNode.CurrentHighlightTime = DateTime.Now; - - var view = new ViewInfo - { - Settings = Program.Settings, - Context = e.Graphics, - Font = font, - Address = ClassNode.Offset, - ClientArea = ClientRectangle, - Level = 0, - Memory = Memory, - MultipleNodesSelected = selectedNodes.Count > 1, - HotSpots = hotSpots - }; - - 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); - }*/ - - 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 = 0; - } - - 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 = 0; - } - } - catch (Exception) - { - Debug.Assert(false); - } - } - - private void OnSelectionChanged() - { - SelectionChanged?.Invoke(this, EventArgs.Empty); - } - - #region Process Input - - protected override void OnMouseClick(MouseEventArgs e) - { - Contract.Requires(e != null); - - bool invalidate = false; - - editBox.Visible = false; - - foreach (var hotSpot in hotSpots) - { - if (hotSpot.Rect.Contains(e.Location)) - { - try - { - var hitObject = hotSpot.Node; - - if (hotSpot.Type == HotSpotType.OpenClose) - { - hitObject.ToggleLevelOpen(hotSpot.Level); - - invalidate = true; - - break; - } - if (hotSpot.Type == HotSpotType.Click) - { - hitObject.Update(hotSpot); - - invalidate = true; - - break; - } - if (hotSpot.Type == HotSpotType.Select) - { - if (e.Button == MouseButtons.Left) - { - if (ModifierKeys == Keys.None) - { - ClearSelection(); - - hitObject.IsSelected = true; - - selectedNodes.Add(hotSpot); - - OnSelectionChanged(); - - selectionAnchor = selectionCaret = hotSpot; - } - else if (ModifierKeys == Keys.Control) - { - hitObject.IsSelected = !hitObject.IsSelected; - - if (hitObject.IsSelected) - { - selectedNodes.Add(hotSpot); - } - else - { - selectedNodes.Remove(selectedNodes.FirstOrDefault(c => c.Node == hitObject)); - } - - OnSelectionChanged(); - } - else if (ModifierKeys == Keys.Shift) - { - if (selectedNodes.Count > 0) - { - var selectedNode = selectedNodes[0].Node; - if (hitObject.ParentNode != null && selectedNode.ParentNode != hitObject.ParentNode) - { - continue; - } - - var first = Utils.Min(selectedNodes[0], hotSpot, h => h.Node.Offset.ToInt32()); - var last = first == hotSpot ? selectedNodes[0] : hotSpot; - - ClearSelection(); - - var containerNode = selectedNode.ParentNode; - foreach (var spot in containerNode.Nodes - .SkipWhile(n => n != first.Node) - .TakeUntil(n => n == last.Node) - .Select(n => new HotSpot - { - Address = containerNode.Offset.Add(n.Offset), - Node = n, - Memory = first.Memory, - Level = first.Level - })) - { - spot.Node.IsSelected = true; - selectedNodes.Add(spot); - } - - OnSelectionChanged(); - - selectionAnchor = first; - selectionCaret = last; - } - } - } - else if (e.Button == MouseButtons.Right) - { - // If there is only one selected node, select the node the user clicked at. - if (selectedNodes.Count <= 1) - { - ClearSelection(); - - hitObject.IsSelected = true; - - selectedNodes.Add(hotSpot); - - OnSelectionChanged(); - - selectionAnchor = selectionCaret = hotSpot; - } - - selectedNodeContextMenuStrip.Show(this, e.Location); - } - - invalidate = true; - } - else if (hotSpot.Type == HotSpotType.Drop) - { - selectedNodeContextMenuStrip.Show(this, e.Location); - - break; - } - else if (hotSpot.Type == HotSpotType.Delete) - { - RemoveSelectedNodes(); - - invalidate = true; - - break; - } - else if (hotSpot.Type == HotSpotType.ChangeType) - { - IEnumerable items = null; - - if (hitObject is FunctionNode functionNode) - { - var noneClass = new ClassNode(false) - { - Name = "None" - }; - - void ChangeTypeHandler(object sender2, EventArgs e2) - { - if (!((sender2 as TypeToolStripMenuItem)?.Tag is ClassNode selectedClassNode)) - { - return; - } - - if (selectedClassNode == noneClass) - { - selectedClassNode = null; - } - - functionNode.BelongsToClass = selectedClassNode; - } - - items = noneClass.Yield() - .Concat(project.Classes.OrderBy(c => c.Name)) - .Select(c => - { - var b = new TypeToolStripMenuItem - { - Text = c.Name, - Tag = c - }; - b.Click += ChangeTypeHandler; - return b; - }); - } - - if (hitObject is BaseReferenceNode refNode) - { - void ChangeInnerNodeHandler(object sender2, EventArgs e2) - { - if (!((sender2 as TypeToolStripMenuItem)?.Tag is ClassNode selectedClassNode)) - { - return; - } - - if (!refNode.PerformCycleCheck || IsCycleFree(refNode.ParentNode as ClassNode, selectedClassNode)) - { - refNode.ChangeInnerNode(selectedClassNode); - } - } - - items = project.Classes - .OrderBy(c => c.Name) - .Select(c => - { - var b = new TypeToolStripMenuItem - { - Text = c.Name, - Tag = c - }; - b.Click += ChangeInnerNodeHandler; - return b; - }); - } - - if (items != null) - { - var menu = new ContextMenuStrip(); - menu.Items.AddRange(items.ToArray()); - menu.Show(this, e.Location); - } - - break; - } - } - catch (Exception ex) - { - Program.Logger.Log(ex); - } - } - } - - if (invalidate) - { - Invalidate(); - } - - base.OnMouseClick(e); - } - - protected override void OnMouseDoubleClick(MouseEventArgs e) - { - Contract.Requires(e != null); - - base.OnMouseDoubleClick(e); - - editBox.Visible = false; - - foreach (var hotSpot in hotSpots.Where(h => h.Type == HotSpotType.Edit)) - { - if (hotSpot.Rect.Contains(e.Location)) - { - editBox.BackColor = Program.Settings.SelectedColor; - editBox.HotSpot = hotSpot; - editBox.Visible = true; - - editBox.ReadOnly = hotSpot.Id == HotSpot.ReadOnlyId; - - break; - } - } - } - - private Point toolTipPosition; - protected override void OnMouseHover(EventArgs e) - { - Contract.Requires(e != null); - - base.OnMouseHover(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)); - } - else - { - foreach (var spot in hotSpots.Where(h => h.Type == HotSpotType.Select)) - { - if (spot.Rect.Contains(toolTipPosition)) - { - if (spot.Node.UseMemoryPreviewToolTip(spot, spot.Memory, out var previewAddress)) - { - memoryPreviewPopUp.InitializeMemory(spot.Memory.Process, previewAddress); - - memoryPreviewPopUp.Show(this, toolTipPosition.OffsetEx(16, 16)); - } - else - { - var text = spot.Node.GetToolTipText(spot, spot.Memory); - if (!string.IsNullOrEmpty(text)) - { - nodeInfoToolTip.Show(text, this, toolTipPosition.OffsetEx(16, 16)); - } - } - - return; - } - } - } - } - - protected override void OnMouseMove(MouseEventArgs e) - { - Contract.Requires(e != null); - - base.OnMouseMove(e); - - if (e.Location != toolTipPosition) - { - toolTipPosition = e.Location; - - nodeInfoToolTip.Hide(this); - - if (memoryPreviewPopUp.Visible) - { - memoryPreviewPopUp.Close(); - - Invalidate(); - } - - ResetMouseEventArgs(); - } - } - - protected override void OnMouseWheel(MouseEventArgs e) - { - if (memoryPreviewPopUp.Visible) - { - memoryPreviewPopUp.HandleMouseWheelEvent(e); - } - else - { - base.OnMouseWheel(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. - { - var key = keyData & Keys.KeyCode; - var modifier = keyData & Keys.Modifiers; - - if (selectedNodes.Count > 0) - { - if (key == Keys.Delete) - { - RemoveSelectedNodes(); - - return true; - } - if (key == Keys.Menu) - { - selectedNodeContextMenuStrip.Show(this, 10, 10); - - return true; - } - if (modifier == Keys.Control && (key == Keys.C || key == Keys.V)) - { - if (key == Keys.C) - { - CopySelectedNodesToClipboard(); - } - else if (key == Keys.V) - { - PasteNodeFromClipboardToSelection(); - } - - return true; - } - if (key == Keys.Down || key == Keys.Up) - { - HotSpot toSelect; - bool isAtEnd; - - var query = hotSpots - .Where(h => h.Type == HotSpotType.Select) - .Where(h => h.Node.ParentNode == selectionCaret.Node.ParentNode); - - if (key == Keys.Down) - { - var temp = query - .SkipUntil(h => h.Node == selectionCaret.Node) - .ToList(); - - toSelect = temp.FirstOrDefault(); - isAtEnd = toSelect != null && toSelect == temp.LastOrDefault(); - } - else - { - var temp = query - .TakeWhile(h => h.Node != selectionCaret.Node) - .ToList(); - - toSelect = temp.LastOrDefault(); - isAtEnd = toSelect != null && toSelect == temp.FirstOrDefault(); - } - - if (toSelect != null && !(toSelect.Node is ClassNode)) - { - if (modifier != Keys.Shift) - { - selectionAnchor = selectionCaret = toSelect; - } - else - { - selectionCaret = toSelect; - } - - var first = Utils.Min(selectionAnchor, selectionCaret, h => h.Node.Offset.ToInt32()); - var last = first == selectionAnchor ? selectionCaret : selectionAnchor; - - ClearSelection(); - - var containerNode = toSelect.Node.ParentNode; - foreach (var spot in containerNode.Nodes - .SkipWhile(n => n != first.Node) - .TakeUntil(n => n == last.Node) - .Select(n => new HotSpot - { - Address = containerNode.Offset.Add(n.Offset), - Node = n, - Memory = toSelect.Memory, - Level = toSelect.Level - })) - { - spot.Node.IsSelected = true; - selectedNodes.Add(spot); - } - - OnSelectionChanged(); - - if (isAtEnd) - { - DoScroll(ScrollOrientation.VerticalScroll, key == Keys.Down ? 1 : - 1); - } - - Invalidate(); - - return true; - } - } - else if (key == Keys.Left || key == Keys.Right) - { - if (selectedNodes.Count == 1) - { - var selected = selectedNodes[0]; - - selected.Node.SetLevelOpen(selected.Level, key == Keys.Right); - } - } - } - else if (key == Keys.Down || key == Keys.Up) - { - // If no node is selected, try to select the first one. - var selection = hotSpots - .Where(h => h.Type == HotSpotType.Select) - .WhereNot(h => h.Node is ClassNode) - .FirstOrDefault(); - if (selection != null) - { - selectionAnchor = selectionCaret = selection; - - selection.Node.IsSelected = true; - - selectedNodes.Add(selection); - - OnSelectionChanged(); - - return true; - } - } - } - - return base.ProcessCmdKey(ref msg, keyData); - } - - #endregion - - #region Event Handler - - protected override void OnSizeChanged(EventArgs e) - { - base.OnSizeChanged(e); - - Invalidate(); - } - - private void repaintTimer_Tick(object sender, EventArgs e) - { - if (DesignMode) - { - return; - } - - Invalidate(false); - } - - private void editBox_Committed(object sender, EventArgs e) - { - var hotspotTextBox = sender as HotSpotTextBox; - - var hotSpot = hotspotTextBox?.HotSpot; - if (hotSpot != null) - { - try - { - hotSpot.Node.Update(hotSpot); - } - catch (Exception ex) - { - Program.Logger.Log(ex); - } - - Invalidate(); - } - } - - private void selectedNodeContextMenuStrip_Opening(object sender, CancelEventArgs e) - { - var count = selectedNodes.Count; - var node = selectedNodes.Select(s => s.Node).FirstOrDefault(); - - var nodeIsClass = node is ClassNode; - var nodeIsValueNode = false; - switch (node) - { - 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 _: - nodeIsValueNode = true; - break; - } - - addBytesToolStripMenuItem.Enabled = node?.ParentNode != null || nodeIsClass; - insertBytesToolStripMenuItem.Enabled = count == 1 && node?.ParentNode != null; - - changeTypeToolStripMenuItem.Enabled = count > 0 && !nodeIsClass; - - createClassFromNodesToolStripMenuItem.Enabled = count > 0 && !nodeIsClass; - dissectNodesToolStripMenuItem.Enabled = count > 0 && !nodeIsClass; - searchForEqualValuesToolStripMenuItem.Enabled = count == 1 && nodeIsValueNode; - - pasteNodesToolStripMenuItem.Enabled = count == 1 && ReClassClipboard.ContainsNodes; - removeToolStripMenuItem.Enabled = !nodeIsClass; - - copyAddressToolStripMenuItem.Enabled = !nodeIsClass; - - showCodeOfClassToolStripMenuItem.Enabled = nodeIsClass; - } - - private void addBytesToolStripMenuItem_Click(object sender, EventArgs e) - { - if (!(sender is IntegerToolStripMenuItem item)) - { - return; - } - - AddBytes(item.Value); - } - - private void insertBytesToolStripMenuItem_Click(object sender, EventArgs e) - { - if (!(sender is IntegerToolStripMenuItem item)) - { - return; - } - - InsertBytes(item.Value); - } - - private void memoryTypeToolStripMenuItem_Click(object sender, EventArgs e) - { - if (!(sender is TypeToolStripMenuItem item)) - { - return; - } - - ReplaceSelectedNodesWithType(item.Value); - } - - private void createClassFromNodesToolStripMenuItem_Click(object sender, EventArgs e) - { - if (selectedNodes.Count > 0 && !(selectedNodes[0].Node is ClassNode)) - { - if (selectedNodes[0].Node.ParentNode is ClassNode parentNode) - { - var newClassNode = ClassNode.Create(); - selectedNodes.Select(h => h.Node).ForEach(newClassNode.AddNode); - - var classInstanceNode = new ClassInstanceNode(); - classInstanceNode.ChangeInnerNode(newClassNode); - - parentNode.InsertNode(selectedNodes[0].Node, classInstanceNode); - - selectedNodes.Select(h => h.Node).ForEach(c => parentNode.RemoveNode(c)); - - ClearSelection(); - } - } - } - - private void dissectNodesToolStripMenuItem_Click(object sender, EventArgs e) - { - var hexNodes = selectedNodes.Where(h => h.Node is BaseHexNode).ToList(); - if (hexNodes.Any()) - { - foreach (var g in hexNodes.GroupBy(n => n.Node.ParentNode)) - { - NodeDissector.DissectNodes(g.Select(h => (BaseHexNode)h.Node), g.First().Memory); - } - - ClearSelection(); - } - } - - private void searchForEqualValuesToolStripMenuItem_Click(object sender, EventArgs e) - { - var selectedNode = selectedNodes.FirstOrDefault(); - if (selectedNode == null) - { - return; - } - - IScanComparer comparer; - switch (selectedNode.Node) - { - case BaseHexNode node: - comparer = new ArrayOfBytesMemoryComparer(node.ReadValueFromMemory(selectedNode.Memory)); - break; - case FloatNode node: - comparer = new FloatMemoryComparer(ScanCompareType.Equal, ScanRoundMode.Normal, 2, node.ReadValueFromMemory(selectedNode.Memory), 0); - break; - case DoubleNode node: - comparer = new DoubleMemoryComparer(ScanCompareType.Equal, ScanRoundMode.Normal, 2, node.ReadValueFromMemory(selectedNode.Memory), 0); - break; - case Int8Node node: - comparer = new ByteMemoryComparer(ScanCompareType.Equal, (byte)node.ReadValueFromMemory(selectedNode.Memory), 0); - break; - case UInt8Node node: - comparer = new ByteMemoryComparer(ScanCompareType.Equal, node.ReadValueFromMemory(selectedNode.Memory), 0); - break; - case Int16Node node: - comparer = new ShortMemoryComparer(ScanCompareType.Equal, node.ReadValueFromMemory(selectedNode.Memory), 0); - break; - case UInt16Node node: - comparer = new ShortMemoryComparer(ScanCompareType.Equal, (short)node.ReadValueFromMemory(selectedNode.Memory), 0); - break; - case Int32Node node: - comparer = new IntegerMemoryComparer(ScanCompareType.Equal, node.ReadValueFromMemory(selectedNode.Memory), 0); - break; - case UInt32Node node: - 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); - break; - case UInt64Node node: - comparer = new LongMemoryComparer(ScanCompareType.Equal, (long)node.ReadValueFromMemory(selectedNode.Memory), 0); - break; - case Utf8TextNode node: - comparer = new StringMemoryComparer(node.ReadValueFromMemory(selectedNode.Memory), Encoding.UTF8, true); - break; - case Utf16TextNode node: - comparer = new StringMemoryComparer(node.ReadValueFromMemory(selectedNode.Memory), Encoding.Unicode, true); - break; - case Utf32TextNode node: - comparer = new StringMemoryComparer(node.ReadValueFromMemory(selectedNode.Memory), Encoding.UTF32, true); - break; - default: - return; - } - - LinkedWindowFeatures.StartMemoryScan(comparer); - } - - private void findOutWhatAccessesThisAddressToolStripMenuItem_Click(object sender, EventArgs e) - { - FindWhatInteractsWithSelectedNode(false); - } - - private void findOutWhatWritesToThisAddressToolStripMenuItem_Click(object sender, EventArgs e) - { - FindWhatInteractsWithSelectedNode(true); - } - - private void copyNodeToolStripMenuItem_Click(object sender, EventArgs e) - { - CopySelectedNodesToClipboard(); - } - - private void pasteNodesToolStripMenuItem_Click(object sender, EventArgs e) - { - PasteNodeFromClipboardToSelection(); - } - - private void removeToolStripMenuItem_Click(object sender, EventArgs e) - { - RemoveSelectedNodes(); - } - - private void copyAddressToolStripMenuItem_Click(object sender, EventArgs e) - { - if (selectedNodes.Count > 0) - { - Clipboard.SetText(selectedNodes.First().Address.ToString("X")); - } - } - - #endregion - - public void AddBytes(int length) - { - Contract.Requires(length >= 0); - - var hotspot = selectedNodes.FirstOrDefault(); - if (hotspot != null) - { - (hotspot.Node.ParentNode ?? hotspot.Node as ClassNode)?.AddBytes(length); - } - - Invalidate(); - } - - public void InsertBytes(int length) - { - Contract.Requires(length >= 0); - - var hotspot = selectedNodes.FirstOrDefault(); - if (hotspot != null) - { - (hotspot.Node.ParentNode ?? hotspot.Node as ClassNode)?.InsertBytes(hotspot.Node, length); - - Invalidate(); - } - } - - /// Groups the selected nodes in blocks if the nodes are continues. - /// The selection to partition. - /// An enumeration with blocks of continues nodes. - private static IEnumerable> PartitionSelectedNodes(IEnumerable selection) - { - Contract.Requires(selection != null); - - List partition; - using (var it = selection.GetEnumerator()) - { - if (!it.MoveNext()) - { - yield break; - } - - partition = new List { it.Current }; - - var last = it.Current; - - while (it.MoveNext()) - { - if (it.Current.Address != last.Address + last.Node.MemorySize) - { - yield return partition; - - partition = new List(); - } - - partition.Add(it.Current); - - last = it.Current; - } - } - - if (partition.Count != 0) - { - yield return partition; - } - } - - /// Recursive replace all splitted nodes. - /// The parent node. - /// The node type. - /// The nodes to replace. - /// The new nodes. - private static IEnumerable RecursiveReplaceNodes(BaseContainerNode parentNode, Type type, IEnumerable nodesToReplace) - { - Contract.Requires(parentNode != null); - Contract.Requires(type != null); - Contract.Requires(nodesToReplace != null); - Contract.Ensures(Contract.Result>() != null); - - foreach (var nodeToReplace in nodesToReplace) - { - var temp = new List(); - if (parentNode.ReplaceChildNode(nodeToReplace, type, ref temp)) - { - var node = temp.First(); - - node.IsSelected = true; - - yield return node; - - if (temp.Count > 1) - { - foreach (var n in RecursiveReplaceNodes(parentNode, type, temp.Skip(1))) - { - yield return n; - } - } - } - } - } - - public void ReplaceSelectedNodesWithType(Type type) - { - Contract.Requires(type != null); - Contract.Requires(type.IsSubclassOf(typeof(BaseNode))); - - var newSelected = new List(selectedNodes.Count); - - // Group the selected nodes in continues selected blocks. - foreach (var selectedPartition in PartitionSelectedNodes(selectedNodes.WhereNot(s => s.Node is ClassNode))) - { - foreach (var selected in selectedPartition) - { - var createdNodes = new List(); - if (selected.Node.ParentNode.ReplaceChildNode(selected.Node, type, ref createdNodes)) - { - var node = createdNodes.First(); - - node.IsSelected = true; - - var hotspot = new HotSpot - { - Memory = selected.Memory, - Address = node.ParentNode.Offset.Add(node.Offset), - Node = node - }; - - newSelected.Add(hotspot); - - if (selectionAnchor.Node == selected.Node) - { - selectionAnchor = hotspot; - } - if (selectionCaret.Node == selected.Node) - { - selectionCaret = hotspot; - } - - // If the block contains more than one node and the replaced node decomposed to more than one node replace the new nodes to. - if (selectedPartition.Count > 1 && createdNodes.Count > 1) - { - newSelected.AddRange( - RecursiveReplaceNodes(selected.Node.ParentNode, type, createdNodes.Skip(1)) - .Select(n => new HotSpot - { - Memory = selected.Memory, - Address = n.ParentNode.Offset.Add(n.Offset), - Node = n, - Level = selected.Level - }) - ); - } - } - } - } - - if (newSelected.Count > 0) - { - selectedNodes.Clear(); - - selectedNodes.AddRange(newSelected); - - OnSelectionChanged(); - } - - Invalidate(); - } - - private void ClearSelection() - { - selectedNodes.ForEach(h => h.Node.ClearSelection()); - - selectedNodes.Clear(); - } - - private void RemoveSelectedNodes() - { - selectedNodes.WhereNot(h => h.Node is ClassNode).ForEach(h => h.Node.ParentNode.RemoveNode(h.Node)); - - selectedNodes.Clear(); - - OnSelectionChanged(); - - Invalidate(); - } - - private void CopySelectedNodesToClipboard() - { - if (selectedNodes.Count > 0) - { - ReClassClipboard.Copy(selectedNodes.Select(h => h.Node), Program.Logger); - } - } - - private void PasteNodeFromClipboardToSelection() - { - var result = ReClassClipboard.Paste(project, Program.Logger); - foreach (var pastedClassNode in result.Item1) - { - if (!project.ContainsClass(pastedClassNode.Uuid)) - { - project.AddClass(pastedClassNode); - } - } - - if (selectedNodes.Count == 1) - { - var selectedNode = selectedNodes.First().Node; - if (selectedNode.ParentNode is ClassNode parent) - { - foreach (var node in result.Item2) - { - if (IsCycleFree(parent, node)) - { - parent.InsertNode(selectedNode, node); - } - } - } - } - } - - private bool IsCycleFree(ClassNode parent, BaseNode node) - { - if (!(node is BaseReferenceNode referenceNode)) - { - return true; - } - - if (referenceNode.PerformCycleCheck == false) - { - return true; - } - - return IsCycleFree(parent, referenceNode.InnerNode); - } - - private bool IsCycleFree(ClassNode parent, ClassNode node) - { - if (!ClassUtil.IsCycleFree(parent, node, project.Classes)) - { - MessageBox.Show("Invalid operation because this would create a class cycle.", "Cycle Detected", MessageBoxButtons.OK, MessageBoxIcon.Error); - - return false; - } - - return true; - } - - private void FindWhatInteractsWithSelectedNode(bool writeOnly) - { - var selectedNode = selectedNodes.FirstOrDefault(); - if (selectedNode == null) - { - return; - } - - LinkedWindowFeatures.FindWhatInteractsWithAddress(selectedNode.Address, selectedNode.Node.MemorySize, writeOnly); - } - - private void showCodeOfClassToolStripMenuItem_Click(object sender, EventArgs e) - { - if (selectedNodes.FirstOrDefault()?.Node is ClassNode node) - { - LinkedWindowFeatures.ShowCodeGeneratorForm(node.Yield()); - } - } - } -} diff --git a/ReClass.NET/UI/NodeTypesBuilder.cs b/ReClass.NET/UI/NodeTypesBuilder.cs new file mode 100644 index 00000000..8d519022 --- /dev/null +++ b/ReClass.NET/UI/NodeTypesBuilder.cs @@ -0,0 +1,182 @@ +using System; +using System.Collections.Generic; +using System.Diagnostics.Contracts; +using System.Drawing; +using System.Linq; +using System.Windows.Forms; +using ReClassNET.Controls; +using ReClassNET.Nodes; +using ReClassNET.Plugins; + +namespace ReClassNET.UI +{ + internal static class NodeTypesBuilder + { + private static readonly List defaultNodeTypeGroupList = new List(); + private static readonly Dictionary> pluginNodeTypes = new Dictionary>(); + + static NodeTypesBuilder() + { + defaultNodeTypeGroupList.Add(new[] { typeof(Hex64Node), typeof(Hex32Node), typeof(Hex16Node), typeof(Hex8Node) }); + 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) }); + defaultNodeTypeGroupList.Add(new[] { typeof(Utf8TextNode), typeof(Utf8TextPtrNode), typeof(Utf16TextNode), typeof(Utf16TextPtrNode) }); + defaultNodeTypeGroupList.Add(new[] { typeof(PointerNode), typeof(ArrayNode), typeof(UnionNode) }); + defaultNodeTypeGroupList.Add(new[] { typeof(ClassInstanceNode) }); + defaultNodeTypeGroupList.Add(new[] { typeof(VirtualMethodTableNode), typeof(FunctionNode), typeof(FunctionPtrNode) }); + } + + public static void AddPluginNodeGroup(Plugin plugin, IReadOnlyList nodeTypes) + { + Contract.Requires(plugin != null); + Contract.Requires(nodeTypes != null); + + if (pluginNodeTypes.ContainsKey(plugin)) + { + throw new InvalidOperationException(); // TODO + } + + pluginNodeTypes.Add(plugin, nodeTypes); + } + + public static void RemovePluginNodeGroup(Plugin plugin) + { + Contract.Requires(plugin != null); + + pluginNodeTypes.Remove(plugin); + } + + public static IEnumerable CreateToolStripButtons(Action handler) + { + Contract.Requires(handler != null); + + var clickHandler = new EventHandler((sender, e) => handler((sender as TypeToolStripButton)?.Value ?? ((TypeToolStripMenuItem)sender).Value)); + + return CreateToolStripItems(t => + { + GetNodeInfoFromType(t, out var label, out var icon); + + var item = new TypeToolStripButton + { + Value = t, + ToolTipText = label, + DisplayStyle = ToolStripItemDisplayStyle.Image, + Image = icon + }; + item.Click += clickHandler; + return item; + }, p => new ToolStripDropDownButton + { + ToolTipText = "", + Image = p.Icon + }, t => + { + GetNodeInfoFromType(t, out var label, out var icon); + + var item = new TypeToolStripMenuItem + { + Value = t, + Text = label, + Image = icon + }; + item.Click += clickHandler; + return item; + }); + } + + public static IEnumerable CreateToolStripMenuItems(Action handler, bool addNoneType) + { + Contract.Requires(handler != null); + + var clickHandler = new EventHandler((sender, e) => handler(((TypeToolStripMenuItem)sender).Value)); + + var items = CreateToolStripItems(t => + { + GetNodeInfoFromType(t, out var label, out var icon); + + var item = new TypeToolStripMenuItem + { + Value = t, + Text = label, + Image = icon + }; + item.Click += clickHandler; + return item; + }, p => new ToolStripMenuItem + { + Text = p.GetType().ToString(), + Image = p.Icon + }); + + if (addNoneType) + { + ToolStripItem noneItem = new TypeToolStripMenuItem + { + Value = null, + Text = "None" + }; + + items = items.Prepend(new ToolStripSeparator()).Prepend(noneItem); + } + + return items; + } + + private static IEnumerable CreateToolStripItems(Func createItem, Func createPluginContainerItem) + { + Contract.Requires(createItem != null); + Contract.Requires(createPluginContainerItem != null); + + return CreateToolStripItems(createItem, createPluginContainerItem, createItem); + } + + private static IEnumerable CreateToolStripItems(Func createItem, Func createPluginContainerItem, Func createPluginItem) + { + Contract.Requires(createItem != null); + Contract.Requires(createPluginContainerItem != null); + Contract.Requires(createPluginItem != null); + + if (!defaultNodeTypeGroupList.Any()) + { + return Enumerable.Empty(); + } + + var items = defaultNodeTypeGroupList + .Select(t => t.Select(createItem)) + .Aggregate((l1, l2) => l1.Append(new ToolStripSeparator()).Concat(l2)); + + if (pluginNodeTypes.Any()) + { + foreach (var kv in pluginNodeTypes) + { + var pluginContainerItem = createPluginContainerItem(kv.Key); + pluginContainerItem.Tag = kv.Key; + pluginContainerItem.DropDownItems.AddRange( + kv.Value + .Select(createPluginItem) + .ToArray() + ); + items = items.Append(new ToolStripSeparator()).Append(pluginContainerItem); + } + } + + return items; + } + + private static void GetNodeInfoFromType(Type nodeType, out string label, out Image icon) + { + Contract.Requires(nodeType != null); + + var node = BaseNode.CreateInstanceFromType(nodeType, false); + if (node == null) + { + throw new InvalidOperationException($"'{nodeType}' is not a valid node type."); + } + + node.GetUserInterfaceInfo(out label, out icon); + } + } +} diff --git a/ReClass.NET/UI/ScrollableCustomControl.cs b/ReClass.NET/UI/ScrollableCustomControl.cs deleted file mode 100644 index 4fa500e1..00000000 --- a/ReClass.NET/UI/ScrollableCustomControl.cs +++ /dev/null @@ -1,209 +0,0 @@ -using System; -using System.Diagnostics.Contracts; -using System.Windows.Forms; - -namespace ReClassNET.UI -{ - public class ScrollableCustomControl : UserControl - { - 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 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 const int WM_HSCROLL = 0x114; - private const int WM_VSCROLL = 0x115; - - private void SetValue(ScrollEventType type, ScrollProperties scrollProperties, int newValue) - { - Contract.Requires(scrollProperties != null); - - 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) - { - Contract.Requires(scrollProperties != null); - - 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: - SetValue(type, scrollProperties, HiWord((int)msg.WParam)); - 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, msg.Msg == WM_VSCROLL ? VerticalScroll : (ScrollProperties)HorizontalScroll); - - return; - } - } - - base.WndProc(ref msg); - } - - static int HiWord(int number) => (number >> 16) & 0xffff; - - static int LoWord(int number) => number & 0xffff; - } -} diff --git a/ReClass.NET/UI/SettingsCheckBox.cs b/ReClass.NET/UI/SettingsCheckBox.cs deleted file mode 100644 index c758b7e2..00000000 --- a/ReClass.NET/UI/SettingsCheckBox.cs +++ /dev/null @@ -1,54 +0,0 @@ -using System; -using System.ComponentModel; -using System.Reflection; -using System.Windows.Forms; - -namespace ReClassNET.UI -{ - public class SettingsCheckBox : CheckBox, ISettingsBindable - { - private PropertyInfo property; - private Settings source; - - [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] - public string SettingName - { - get => property?.Name; - set { property = typeof(Settings).GetProperty(value); ReadSetting(); } - } - - [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] - public Settings Source - { - get => source; - set { source = value; ReadSetting(); } - } - - private void ReadSetting() - { - if (property != null && source != null) - { - var value = property.GetValue(source); - if (value is bool b) - { - Checked = b; - } - } - } - - private void WriteSetting() - { - if (property != null && source != null) - { - property.SetValue(source, Checked); - } - } - - protected override void OnCheckedChanged(EventArgs e) - { - base.OnCheckedChanged(e); - - WriteSetting(); - } - } -} diff --git a/ReClass.NET/UI/SettingsTextBox.cs b/ReClass.NET/UI/SettingsTextBox.cs deleted file mode 100644 index 7ec480d0..00000000 --- a/ReClass.NET/UI/SettingsTextBox.cs +++ /dev/null @@ -1,54 +0,0 @@ -using System; -using System.ComponentModel; -using System.Reflection; -using System.Windows.Forms; - -namespace ReClassNET.UI -{ - class SettingsTextBox : TextBox, ISettingsBindable - { - private PropertyInfo property; - private Settings source; - - [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] - public string SettingName - { - get => property?.Name; - set { property = typeof(Settings).GetProperty(value); ReadSetting(); } - } - - [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] - public Settings Source - { - get => source; - set { source = value; ReadSetting(); } - } - - private void ReadSetting() - { - if (property != null && source != null) - { - var value = property.GetValue(source); - if (value is string s) - { - Text = s; - } - } - } - - private void WriteSetting() - { - if (property != null && source != null) - { - property.SetValue(source, Text); - } - } - - protected override void OnTextChanged(EventArgs e) - { - base.OnTextChanged(e); - - WriteSetting(); - } - } -} diff --git a/ReClass.NET/Util/BitString.cs b/ReClass.NET/Util/BitString.cs new file mode 100644 index 00000000..ba3cd1f8 --- /dev/null +++ b/ReClass.NET/Util/BitString.cs @@ -0,0 +1,98 @@ +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) + { + const int BitsPerBlock = 4; + + var sb = new StringBuilder(bits); + + var padding = bits - value.Length; + + // Add full padding blocks. + while (padding > BitsPerBlock) + { + sb.Append("0000 "); + padding -= BitsPerBlock; + } + + // 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, BitsPerBlock - padding); + + if (value.Length > padding) + { + sb.Append(' '); + } + } + + // Add all remaining blocks. + for (var i = padding == 0 ? 0 : BitsPerBlock - padding; i < value.Length; i += BitsPerBlock) + { + sb.Append(value, i, BitsPerBlock); + if (i < value.Length - BitsPerBlock) + { + sb.Append(' '); + } + } + + return sb.ToString(); + } + } +} 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/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/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/Util/CustomConfig.cs b/ReClass.NET/Util/CustomConfig.cs deleted file mode 100644 index 0613d7bc..00000000 --- a/ReClass.NET/Util/CustomConfig.cs +++ /dev/null @@ -1,207 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Globalization; -using System.Xml.Linq; - -namespace ReClassNET.Util -{ - /// - /// A class which stores custom config items from plugins. - /// The id of an item should consist of "a-zA-z0-9.,;_-+". - /// The naming convention is "Plugin.[ConfigGroup.]ConfigItem". - /// - public class CustomConfig - { - private readonly Dictionary data = new Dictionary(); - - internal XElement Serialize(string name) - { - return XElementSerializer.ToXml(name, data); - } - - internal void Deserialize(XElement element) - { - foreach (var kv in XElementSerializer.ToDictionary(element)) - { - data[kv.Key] = kv.Value; - } - } - - /// - /// Sets a configuration item. - /// - /// The id of the item. - /// - /// The value of the item. - /// If the value is null the item gets removed. - /// - public void SetString(string id, string value) - { - if (id == null) - { - throw new ArgumentNullException(nameof(id)); - } - if (id.Length == 0) - { - throw new ArgumentException(); - } - - if (value == null) - { - data.Remove(id); - } - else - { - data[id] = value; - } - } - - /// - /// Sets a configuration item. - /// - /// The id of the item. - /// The value of the item. - public void SetBool(string id, bool value) - { - SetString(id, Convert.ToString(value)); - } - - /// - /// Sets a configuration item. - /// - /// The id of the item. - /// The value of the item. - public void SetLong(string id, long value) - { - SetString(id, value.ToString(NumberFormatInfo.InvariantInfo)); - } - - /// - /// Sets a configuration item. - /// - /// The id of the item. - /// The value of the item. - public void SetULong(string id, ulong value) - { - SetString(id, value.ToString(NumberFormatInfo.InvariantInfo)); - } - - public void SetXElement(string id, XElement value) - { - SetString(id, value.ToString()); - } - - /// - /// Gets the value of the config item. - /// - /// The id of the item. - /// The value of the config item or null if the id does not exists. - public string GetString(string id) - { - return GetString(id, null); - } - - /// - /// Gets the value of the config item. - /// - /// The id of the item. - /// The default value if the id does not exists. - /// The value of the config item or if the id does not exists. - public string GetString(string id, string def) - { - if (id == null) - { - throw new ArgumentNullException(nameof(id)); - } - if (id.Length == 0) - { - throw new ArgumentException(); - } - - if (data.TryGetValue(id, out var value)) - { - return value; - } - - return def; - } - - /// - /// Gets the value of the config item. - /// - /// The id of the item. - /// The default value if the id does not exists. - /// The value of the config item or if the id does not exists. - public bool GetBool(string id, bool def) - { - var value = GetString(id, null); - if (string.IsNullOrEmpty(value)) - { - return def; - } - - return Convert.ToBoolean(value); - } - - /// - /// Gets the value of the config item. - /// - /// The id of the item. - /// The default value if the id does not exists. - /// The value of the config item or if the id does not exists. - public long GetLong(string id, long def) - { - var str = GetString(id, null); - if (string.IsNullOrEmpty(str)) - { - return def; - } - - if (long.TryParse(str, NumberStyles.Integer, NumberFormatInfo.InvariantInfo, out var value)) - { - return value; - } - - return def; - } - - /// - /// Gets the value of the config item. - /// - /// The id of the item. - /// The default value if the id does not exists. - /// The value of the config item or if the id does not exists. - public ulong GetULong(string id, ulong def) - { - var str = GetString(id, null); - if (string.IsNullOrEmpty(str)) - { - return def; - } - - if (ulong.TryParse(str, NumberStyles.Integer, NumberFormatInfo.InvariantInfo, out var value)) - { - return value; - } - - return def; - } - - /// - /// Gets the value of the config item. - /// - /// The id of the item. - /// The default value if the id does not exists. - /// The value of the config item or if the id does not exists. - public XElement GetXElement(string id, XElement def) - { - var str = GetString(id, null); - if (string.IsNullOrEmpty(str)) - { - return def; - } - - return XElement.Parse(str); - } - } -} diff --git a/ReClass.NET/Util/CustomDataMap.cs b/ReClass.NET/Util/CustomDataMap.cs new file mode 100644 index 00000000..6a077486 --- /dev/null +++ b/ReClass.NET/Util/CustomDataMap.cs @@ -0,0 +1,230 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.Xml.Linq; + +namespace ReClassNET.Util +{ + /// + /// A class which stores custom data items from plugins. + /// The key to an item should consist of "a-zA-z0-9.,;_-+". + /// The naming convention for keys is "PluginName.[Group.]Item". + /// + public class CustomDataMap : IEnumerable> + { + private readonly Dictionary data = new Dictionary(); + + internal XElement Serialize(string name) + { + return XElementSerializer.ToXml(name, data); + } + + internal void Deserialize(XElement element) + { + data.Clear(); + + foreach (var kv in XElementSerializer.ToDictionary(element)) + { + data[kv.Key] = kv.Value; + } + } + + public IEnumerator> GetEnumerator() + { + return data.GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetEnumerator(); + } + + public string this[string key] + { + get => GetString(key); + set => SetString(key, value); + } + + /// + /// Removes an item. + /// + /// The key of the item. + 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) + { + ValidateKey(key); + + data[key] = value; + } + + /// + /// Sets the boolean value of an item. + /// + /// The key of the item. + /// The value of the item. + public void SetBool(string key, bool value) + { + SetString(key, Convert.ToString(value)); + } + + /// + /// Sets the long value of an item. + /// + /// The key of the item. + /// The value of the item. + public void SetLong(string key, long value) + { + SetString(key, value.ToString(NumberFormatInfo.InvariantInfo)); + } + + /// + /// Sets the ulong value of an item. + /// + /// The key of the item. + /// The value of the item. + 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()); + } + + /// + /// 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. + public string GetString(string key) + { + return GetString(key, null); + } + + /// + /// 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) + { + ValidateKey(key); + + if (data.TryGetValue(key, out var value)) + { + return value; + } + + return def; + } + + /// + /// Gets the boolean 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 bool GetBool(string key, bool def) + { + var value = GetString(key, null); + if (string.IsNullOrEmpty(value)) + { + return def; + } + + return Convert.ToBoolean(value); + } + + /// + /// Gets the long 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 long GetLong(string key, long def) + { + var str = GetString(key, null); + if (string.IsNullOrEmpty(str)) + { + return def; + } + + if (long.TryParse(str, NumberStyles.Integer, NumberFormatInfo.InvariantInfo, out var value)) + { + return value; + } + + return def; + } + + /// + /// Gets the ulong 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 ulong GetULong(string key, ulong def) + { + var str = GetString(key, null); + if (string.IsNullOrEmpty(str)) + { + return def; + } + + if (ulong.TryParse(str, NumberStyles.Integer, NumberFormatInfo.InvariantInfo, out var value)) + { + return value; + } + + return def; + } + + /// + /// Gets the XElement 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 XElement GetXElement(string key, XElement def) + { + var str = GetString(key, null); + if (string.IsNullOrEmpty(str)) + { + return 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/DirectedGraph.cs b/ReClass.NET/Util/DirectedGraph.cs new file mode 100644 index 00000000..51968b92 --- /dev/null +++ b/ReClass.NET/Util/DirectedGraph.cs @@ -0,0 +1,139 @@ +using System; +using System.Collections.Generic; +using System.Linq; + +namespace ReClassNET.Util +{ + public class DirectedGraph + { + private readonly IDictionary> adjacencyList = new Dictionary>(); + + /// + /// Gets an enumeration of all vertices in the graph. + /// + public IEnumerable Vertices => adjacencyList.Keys; + + /// + /// Adds the vertex to the graph. + /// + /// + /// + public bool AddVertex(T vertex) + { + if (adjacencyList.ContainsKey(vertex)) + { + return false; + } + + adjacencyList.Add(vertex, new HashSet()); + + return true; + } + + /// + /// Adds the vertices to the graph. + /// + /// + public void AddVertices(IEnumerable vertices) + { + foreach (var vertex in vertices) + { + AddVertex(vertex); + } + } + + /// + /// Tests if the graph contains the given vertex. + /// + /// + /// + public bool ContainsVertex(T vertex) + { + return adjacencyList.ContainsKey(vertex); + } + + /// + /// Adds an edge between both vertices to the graph. + /// + /// + /// + /// True if a new edge was added, false otherwise. + public bool AddEdge(T from, T to) + { + if (!ContainsVertex(to) || !adjacencyList.TryGetValue(from, out var edges)) + { + throw new ArgumentException("Vertex does not exist in graph."); + } + + return edges.Add(to); + } + + /// + /// Tests if the graph contains an edge between both vertices. + /// + /// + /// + /// + public bool ContainsEdge(T from, T to) + { + if (!ContainsVertex(to) || !adjacencyList.TryGetValue(from, out var edges)) + { + throw new ArgumentException("Vertex does not exist in graph."); + } + + return edges.Contains(to); + } + + /// + /// Gets all neighbours of the given vertex. + /// + /// The vertex to check. + /// An enumeration of all neighbours of the given vertex. + public IEnumerable GetNeighbours(T vertex) + { + if (!adjacencyList.TryGetValue(vertex, out var edges)) + { + throw new ArgumentException("Vertex does not exist in graph."); + } + + return edges; + } + + /// + /// Tests with a depth first search if the graph contains a cycle. + /// + /// True if a cycle exists, false otherwise. + public bool ContainsCycle() + { + var visited = new HashSet(); + var recursionStack = new HashSet(); + + bool IsCyclic(T source) + { + if (visited.Add(source)) + { + recursionStack.Add(source); + + foreach (var adjacent in GetNeighbours(source)) + { + if (!visited.Contains(adjacent) && IsCyclic(adjacent)) + { + return true; + } + + if (recursionStack.Contains(adjacent)) + { + return true; + } + } + } + + recursionStack.Remove(source); + + return false; + } + + return adjacencyList.Keys.Any(IsCyclic); + } + } +} diff --git a/ReClass.NET/Util/Extension.Encoding.cs b/ReClass.NET/Util/Extension.Encoding.cs deleted file mode 100644 index 75d61acd..00000000 --- a/ReClass.NET/Util/Extension.Encoding.cs +++ /dev/null @@ -1,20 +0,0 @@ -using System; -using System.Text; - -namespace ReClassNET.Util -{ - public static class EncodingExtension - { - /// Gets the (wrong) byte count per character. Special chars may need more bytes per character. - /// The encoding. - /// The byte count per character. - public static int GetSimpleByteCountPerChar(this Encoding encoding) - { - if (encoding == Encoding.UTF8 || encoding == Encoding.ASCII) return 1; - if (encoding == Encoding.Unicode) return 2; - if (encoding == Encoding.UTF32) return 4; - - throw new NotImplementedException(); - } - } -} diff --git a/ReClass.NET/Util/Extension.FloatingPoint.cs b/ReClass.NET/Util/Extension.FloatingPoint.cs deleted file mode 100644 index 9cd86f2c..00000000 --- a/ReClass.NET/Util/Extension.FloatingPoint.cs +++ /dev/null @@ -1,59 +0,0 @@ -using System; -using System.Diagnostics; -using System.Diagnostics.Contracts; - -namespace ReClassNET.Util -{ - 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) - { - if (val == other) - { - 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); - } - - [Pure] - [DebuggerStepThrough] - public static bool IsNearlyEqual(this double val, double other, double epsilon) - { - if (val == other) - { - 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; - } - } -} diff --git a/ReClass.NET/Util/Extension.Size.cs b/ReClass.NET/Util/Extension.Size.cs deleted file mode 100644 index 1adc1d21..00000000 --- a/ReClass.NET/Util/Extension.Size.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System.Drawing; - -namespace ReClassNET.Util -{ - 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/Util/Extensions.cs b/ReClass.NET/Util/Extensions.cs deleted file mode 100644 index 32553f49..00000000 --- a/ReClass.NET/Util/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.Util -{ - 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/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/Util/HexadecimalFormatter.cs b/ReClass.NET/Util/HexadecimalFormatter.cs new file mode 100644 index 00000000..18f6e907 --- /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] = 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/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/Util/NumberFormat.cs b/ReClass.NET/Util/NumberFormat.cs new file mode 100644 index 00000000..6c4e91be --- /dev/null +++ b/ReClass.NET/Util/NumberFormat.cs @@ -0,0 +1,32 @@ +using System.Diagnostics.Contracts; +using System.Globalization; + +namespace ReClassNET.Util +{ + public static class NumberFormat + { + public static NumberFormatInfo GuessNumberFormat(string input) + { + Contract.Requires(input != null); + Contract.Ensures(Contract.Result() != null); + + var commaIndex = input.IndexOf(','); + var dotIndex = input.IndexOf('.'); + + if (commaIndex > dotIndex) + { + return new NumberFormatInfo + { + NumberDecimalSeparator = ",", + NumberGroupSeparator = "." + }; + } + + return new NumberFormatInfo + { + NumberDecimalSeparator = ".", + NumberGroupSeparator = "," + }; + } + } +} diff --git a/ReClass.NET/Util/PathUtil.cs b/ReClass.NET/Util/PathUtil.cs index 977da60d..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)) @@ -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/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 3a368e17..5f83c837 100644 --- a/ReClass.NET/Util/Rtf/RtfBuilder.cs +++ b/ReClass.NET/Util/Rtf/RtfBuilder.cs @@ -1,6 +1,5 @@ -using System; +using System; using System.Collections.Generic; -using System.Diagnostics; using System.Drawing; using System.Linq; using System.Text; @@ -27,8 +26,6 @@ public partial class RtfBuilder private float fontSize; private FontStyle fontStyle; - protected bool isLocked; - public RtfBuilder() : this(RtfFont.Calibri, 22.0f) { @@ -59,30 +56,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() @@ -94,12 +107,11 @@ public RtfBuilder AppendParagraph() public RtfBuilder AppendPage() { - AppendPageInternal(); + buffer.AppendLine(@"\page"); return this; } - [DebuggerStepThrough] public RtfBuilder SetForeColor(Color color) { foreColor = color; @@ -107,7 +119,6 @@ public RtfBuilder SetForeColor(Color color) return this; } - [DebuggerStepThrough] public RtfBuilder SetBackColor(Color color) { backColor = color; @@ -115,7 +126,6 @@ public RtfBuilder SetBackColor(Color color) return this; } - [DebuggerStepThrough] public RtfBuilder SetFont(RtfFont font) { fontIndex = IndexOfFont(font); @@ -123,7 +133,6 @@ public RtfBuilder SetFont(RtfFont font) return this; } - [DebuggerStepThrough] public RtfBuilder SetFontSize(float size) { fontSize = size; @@ -131,10 +140,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; } @@ -197,64 +205,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(); @@ -262,11 +217,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"); @@ -286,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 { diff --git a/ReClass.NET/Util/SettingsSerializer.cs b/ReClass.NET/Util/SettingsSerializer.cs index 10842210..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; @@ -11,7 +10,6 @@ internal sealed class SettingsSerializer private const string XmlGeneralElement = "General"; private const string XmlDisplayElement = "Display"; private const string XmlColorsElement = "Colors"; - private const string XmlTypeDefinitionsElement = "TypeDefinitions"; private const string XmlCustomDataElement = "CustomData"; #region Read Settings @@ -26,88 +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)); - } - 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 typeDefinitions = root?.Element(XmlTypeDefinitionsElement); - if (typeDefinitions != null) - { - XElementSerializer.TryRead(typeDefinitions, nameof(settings.TypePadding), e => settings.TypePadding = XElementSerializer.ToString(e)); - XElementSerializer.TryRead(typeDefinitions, nameof(settings.TypeBool), e => settings.TypeBool = XElementSerializer.ToString(e)); - XElementSerializer.TryRead(typeDefinitions, nameof(settings.TypeInt8), e => settings.TypeInt8 = XElementSerializer.ToString(e)); - XElementSerializer.TryRead(typeDefinitions, nameof(settings.TypeInt16), e => settings.TypeInt16 = XElementSerializer.ToString(e)); - XElementSerializer.TryRead(typeDefinitions, nameof(settings.TypeInt32), e => settings.TypeInt32 = XElementSerializer.ToString(e)); - XElementSerializer.TryRead(typeDefinitions, nameof(settings.TypeInt64), e => settings.TypeInt64 = XElementSerializer.ToString(e)); - XElementSerializer.TryRead(typeDefinitions, nameof(settings.TypeUInt8), e => settings.TypeUInt8 = XElementSerializer.ToString(e)); - XElementSerializer.TryRead(typeDefinitions, nameof(settings.TypeUInt16), e => settings.TypeUInt16 = XElementSerializer.ToString(e)); - XElementSerializer.TryRead(typeDefinitions, nameof(settings.TypeUInt32), e => settings.TypeUInt32 = XElementSerializer.ToString(e)); - XElementSerializer.TryRead(typeDefinitions, nameof(settings.TypeUInt64), e => settings.TypeUInt64 = XElementSerializer.ToString(e)); - XElementSerializer.TryRead(typeDefinitions, nameof(settings.TypeFloat), e => settings.TypeFloat = XElementSerializer.ToString(e)); - XElementSerializer.TryRead(typeDefinitions, nameof(settings.TypeDouble), e => settings.TypeDouble = XElementSerializer.ToString(e)); - XElementSerializer.TryRead(typeDefinitions, nameof(settings.TypeVector2), e => settings.TypeVector2 = XElementSerializer.ToString(e)); - XElementSerializer.TryRead(typeDefinitions, nameof(settings.TypeVector3), e => settings.TypeVector3 = XElementSerializer.ToString(e)); - XElementSerializer.TryRead(typeDefinitions, nameof(settings.TypeVector4), e => settings.TypeVector4 = XElementSerializer.ToString(e)); - XElementSerializer.TryRead(typeDefinitions, nameof(settings.TypeMatrix3x3), e => settings.TypeMatrix3x3 = XElementSerializer.ToString(e)); - XElementSerializer.TryRead(typeDefinitions, nameof(settings.TypeMatrix3x4), e => settings.TypeMatrix3x4 = XElementSerializer.ToString(e)); - XElementSerializer.TryRead(typeDefinitions, nameof(settings.TypeMatrix4x4), e => settings.TypeMatrix4x4 = XElementSerializer.ToString(e)); - XElementSerializer.TryRead(typeDefinitions, nameof(settings.TypeUTF8Text), e => settings.TypeUTF8Text = XElementSerializer.ToString(e)); - XElementSerializer.TryRead(typeDefinitions, nameof(settings.TypeUTF8TextPtr), e => settings.TypeUTF8TextPtr = XElementSerializer.ToString(e)); - XElementSerializer.TryRead(typeDefinitions, nameof(settings.TypeUTF16Text), e => settings.TypeUTF16Text = XElementSerializer.ToString(e)); - XElementSerializer.TryRead(typeDefinitions, nameof(settings.TypeUTF16TextPtr), e => settings.TypeUTF16TextPtr = XElementSerializer.ToString(e)); - XElementSerializer.TryRead(typeDefinitions, nameof(settings.TypeUTF32Text), e => settings.TypeUTF32Text = XElementSerializer.ToString(e)); - XElementSerializer.TryRead(typeDefinitions, nameof(settings.TypeUTF32TextPtr), e => settings.TypeUTF32TextPtr = XElementSerializer.ToString(e)); - XElementSerializer.TryRead(typeDefinitions, nameof(settings.TypeFunctionPtr), e => settings.TypeFunctionPtr = XElementSerializer.ToString(e)); - } - var customData = root?.Element(XmlCustomDataElement); - if (customData != null) - { - settings.CustomData.Deserialize(customData); - } + settings.CustomData.Deserialize(customData); } } catch { - + // ignored } return settings; @@ -125,82 +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) - ), - 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) - ), - new XElement( - XmlTypeDefinitionsElement, - XElementSerializer.ToXml(nameof(settings.TypePadding), settings.TypePadding), - XElementSerializer.ToXml(nameof(settings.TypeBool), settings.TypeBool), - XElementSerializer.ToXml(nameof(settings.TypeInt8), settings.TypeInt8), - XElementSerializer.ToXml(nameof(settings.TypeInt16), settings.TypeInt16), - XElementSerializer.ToXml(nameof(settings.TypeInt32), settings.TypeInt32), - XElementSerializer.ToXml(nameof(settings.TypeInt64), settings.TypeInt64), - XElementSerializer.ToXml(nameof(settings.TypeUInt8), settings.TypeUInt8), - XElementSerializer.ToXml(nameof(settings.TypeUInt16), settings.TypeUInt16), - XElementSerializer.ToXml(nameof(settings.TypeUInt32), settings.TypeUInt32), - XElementSerializer.ToXml(nameof(settings.TypeUInt64), settings.TypeUInt64), - XElementSerializer.ToXml(nameof(settings.TypeFloat), settings.TypeFloat), - XElementSerializer.ToXml(nameof(settings.TypeDouble), settings.TypeDouble), - XElementSerializer.ToXml(nameof(settings.TypeVector2), settings.TypeVector2), - XElementSerializer.ToXml(nameof(settings.TypeVector3), settings.TypeVector3), - XElementSerializer.ToXml(nameof(settings.TypeVector4), settings.TypeVector4), - XElementSerializer.ToXml(nameof(settings.TypeMatrix3x3), settings.TypeMatrix3x3), - XElementSerializer.ToXml(nameof(settings.TypeMatrix3x4), settings.TypeMatrix3x4), - XElementSerializer.ToXml(nameof(settings.TypeMatrix4x4), settings.TypeMatrix4x4), - XElementSerializer.ToXml(nameof(settings.TypeUTF8Text), settings.TypeUTF8Text), - XElementSerializer.ToXml(nameof(settings.TypeUTF8TextPtr), settings.TypeUTF8TextPtr), - XElementSerializer.ToXml(nameof(settings.TypeUTF16Text), settings.TypeUTF16Text), - XElementSerializer.ToXml(nameof(settings.TypeUTF16TextPtr), settings.TypeUTF16TextPtr), - XElementSerializer.ToXml(nameof(settings.TypeUTF32Text), settings.TypeUTF32Text), - XElementSerializer.ToXml(nameof(settings.TypeUTF32TextPtr), settings.TypeUTF32TextPtr), - XElementSerializer.ToXml(nameof(settings.TypeFunctionPtr), settings.TypeFunctionPtr) - ), - 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 @@ -214,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 b756199f..a2f79378 100644 --- a/ReClass.NET/Util/Util.cs +++ b/ReClass.NET/Util/Util.cs @@ -1,8 +1,7 @@ -using System; +using System; using System.Collections.Generic; using System.Diagnostics.Contracts; -using System.Drawing; -using System.Globalization; +using System.Linq; namespace ReClassNET.Util { @@ -34,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); @@ -53,68 +52,12 @@ public static void Swap(ref T lhs, ref T rhs) rhs = temp; } - public static Size AggregateNodeSizes(Size baseSize, Size newSize) + //thx again stack overflow https://stackoverflow.com/a/1344242 + public static string RandomString(int length) { - 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); + 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..8173c315 100644 --- a/ReClass.NET/Util/WinUtil.cs +++ b/ReClass.NET/Util/WinUtil.cs @@ -1,6 +1,7 @@ -using System; +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; @@ -39,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 } } diff --git a/ReClass.NET/Util/XElementSerializer.cs b/ReClass.NET/Util/XElementSerializer.cs index 03ceff88..bc96f697 100644 --- a/ReClass.NET/Util/XElementSerializer.cs +++ b/ReClass.NET/Util/XElementSerializer.cs @@ -5,6 +5,7 @@ using System.Globalization; using System.Linq; using System.Xml.Linq; +using ReClassNET.Extensions; namespace ReClassNET.Util { @@ -27,8 +28,8 @@ public static bool TryRead(XContainer element, string name, Action iff return false; } - public static bool ToBool(XElement value) => bool.Parse(value.Value); - public static int ToInt(XElement value) => int.Parse(value.Value); + public static bool ToBool(XElement value) => (bool?)value ?? false; + public static int ToInt(XElement value) => (int?)value ?? 0; public static string ToString(XElement value) => value.Value; public static Color ToColor(XElement value) => Color.FromArgb((int)(0xFF000000 | int.Parse(value.Value, NumberStyles.HexNumber))); public static Dictionary ToDictionary(XContainer value) => value.Elements().ToDictionary(e => e.Name.ToString(), e => e.Value); diff --git a/ReClass.NET/packages.config b/ReClass.NET/packages.config deleted file mode 100644 index efb2da7c..00000000 --- a/ReClass.NET/packages.config +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file 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/Makefile b/ReClass.NET_Launcher/Makefile index eb8e3c4d..bc9ddd11 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 -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 -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" + +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" diff --git a/ReClass.NET_Launcher/ReClass.NET_Launcher.csproj b/ReClass.NET_Launcher/ReClass.NET_Launcher.csproj index 89d7a2ce..87001366 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 @@ -23,6 +24,7 @@ prompt 4 false + latest AnyCPU @@ -34,6 +36,7 @@ prompt 4 false + latest ReClassNet.ico @@ -67,8 +70,8 @@ Native\NativeMethods.Windows.cs - - Util\Extension.IntPtr.cs + + Extensions\IntPtrExtensions.cs Util\PathUtil.cs diff --git a/ReClass.NET_Tests/AddressParser/DynamicCompilerTest.cs b/ReClass.NET_Tests/AddressParser/DynamicCompilerTest.cs new file mode 100644 index 00000000..cada902a --- /dev/null +++ b/ReClass.NET_Tests/AddressParser/DynamicCompilerTest.cs @@ -0,0 +1,12 @@ +using ReClassNET.AddressParser; + +namespace ReClass.NET_Tests.AddressParser +{ + public class DynamicCompilerTest : ExecutorTest + { + protected override IExecutor 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..75de668e --- /dev/null +++ b/ReClass.NET_Tests/AddressParser/ExecutorTest.cs @@ -0,0 +1,142 @@ +using System; +using System.Collections.Generic; +using Moq; +using NFluent; +using ReClassNET.AddressParser; +using ReClassNET.Memory; +using ReClassNET.Util.Conversion; +using Xunit; + +namespace ReClass.NET_Tests.AddressParser +{ + public abstract class ExecutorTest + { + protected abstract IExecutor 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 }, + new object[] { "4 / 0x2", (IntPtr)0x2 } + }; + + [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 }, + new object[] { "", (IntPtr)0x0 }, + }; + + [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); + } + + public static IEnumerable GetReadMemoryExpressionTestData(int bytesToRead) => new List + { + 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), 4)] + public void ReadMemoryExpression32Test(string expression, IntPtr expected) + { + var converter = EndianBitConverter.System; + + var mock = new Mock(); + 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(); + + Check.That(executor.Execute(Parser.Parse(expression), mock.Object)).IsEqualTo(expected); + } + + [Theory] + [MemberData(nameof(GetReadMemoryExpressionTestData), 8)] + public void ReadMemoryExpression64Test(string expression, IntPtr expected) + { + var converter = EndianBitConverter.System; + + var mock = new Mock(); + 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(); + + Check.That(executor.Execute(Parser.Parse(expression), mock.Object)).IsEqualTo(expected); + } + + [Fact] + public void ReadMemoryExpressionInvariantTest() + { + var converter = EndianBitConverter.System; + + var mock = new Mock(); + 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(); + + Check.That(executor.Execute(Parser.Parse("[10]"), mock.Object)).IsEqualTo((IntPtr)0x10); + } + } +} diff --git a/ReClass.NET_Tests/AddressParser/InterpreterTest.cs b/ReClass.NET_Tests/AddressParser/InterpreterTest.cs new file mode 100644 index 00000000..b7ee2295 --- /dev/null +++ b/ReClass.NET_Tests/AddressParser/InterpreterTest.cs @@ -0,0 +1,12 @@ +using ReClassNET.AddressParser; + +namespace ReClass.NET_Tests.AddressParser +{ + public class InterpreterTest : ExecutorTest + { + protected override IExecutor CreateExecutor() + { + return new Interpreter(); + } + } +} diff --git a/ReClass.NET_Tests/AddressParser/ParserTest.cs b/ReClass.NET_Tests/AddressParser/ParserTest.cs new file mode 100644 index 00000000..40a2bfd3 --- /dev/null +++ b/ReClass.NET_Tests/AddressParser/ParserTest.cs @@ -0,0 +1,74 @@ +using System; +using NFluent; +using ReClassNET.AddressParser; +using Xunit; + +namespace ReClass.NET_Tests.AddressParser +{ + public class ParserTest + { + [Theory] + [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,2]")] + [InlineData("1,")] + [InlineData("1,2")] + public void InvalidExpressionTests(string expression) + { + Check.ThatCode(() => Parser.Parse(expression)).Throws(); + } + + [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); + } + } +} diff --git a/ReClass.NET_Tests/AddressParser/TokenizerTest.cs b/ReClass.NET_Tests/AddressParser/TokenizerTest.cs new file mode 100644 index 00000000..a3cd9a6e --- /dev/null +++ b/ReClass.NET_Tests/AddressParser/TokenizerTest.cs @@ -0,0 +1,102 @@ +using System.IO; +using NFluent; +using ReClassNET.AddressParser; +using Xunit; + +namespace ReClass.NET_Tests.AddressParser +{ + public class TokenizerTest + { + [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)] + [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 TestTokenType(string expression, Token type) + { + 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); + } + + [Theory] + [InlineData("<")] + [InlineData(">")] + [InlineData("10000000000000000")] + [InlineData("0x")] + [InlineData("x")] + 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/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/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/EncodingExtensionTest.cs b/ReClass.NET_Tests/Extensions/EncodingExtensionTest.cs new file mode 100644 index 00000000..fa563b9c --- /dev/null +++ b/ReClass.NET_Tests/Extensions/EncodingExtensionTest.cs @@ -0,0 +1,63 @@ +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.GetEncoding(1252), 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.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] + [MemberData(nameof(GetTestSimpleByteCountNotImplementedData))] + 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); + } + } +} diff --git a/ReClass.NET_Tests/Extensions/EnumerableExtensionTests.cs b/ReClass.NET_Tests/Extensions/EnumerableExtensionTests.cs new file mode 100644 index 00000000..90bb3573 --- /dev/null +++ b/ReClass.NET_Tests/Extensions/EnumerableExtensionTests.cs @@ -0,0 +1,225 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using NFluent; +using ReClassNET.Extensions; +using Xunit; + +namespace ReClass.NET_Tests.Extensions +{ + public class EnumerableExtensionTest + { + 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); + } + + [Theory] + [InlineData(0)] + [InlineData(1)] + [InlineData(10)] + public void TestForEach(int expected) + { + var counter = 0; + Enumerable.Repeat(0, expected).ForEach(_ => ++counter); + + Check.That(counter).IsEqualTo(expected); + } + + 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); + } + + 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(); + } + + 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); + } + } +} diff --git a/ReClass.NET_Tests/Extensions/FloatingPointExtensionTest.cs b/ReClass.NET_Tests/Extensions/FloatingPointExtensionTest.cs new file mode 100644 index 00000000..844f8229 --- /dev/null +++ b/ReClass.NET_Tests/Extensions/FloatingPointExtensionTest.cs @@ -0,0 +1,51 @@ +using NFluent; +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/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/Extensions/ListExtensionTest.cs b/ReClass.NET_Tests/Extensions/ListExtensionTest.cs new file mode 100644 index 00000000..6cf535db --- /dev/null +++ b/ReClass.NET_Tests/Extensions/ListExtensionTest.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +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> + { + { 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); + } + } +} 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/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/StringExtensionTest.cs b/ReClass.NET_Tests/Extensions/StringExtensionTest.cs new file mode 100644 index 00000000..f1a0fcde --- /dev/null +++ b/ReClass.NET_Tests/Extensions/StringExtensionTest.cs @@ -0,0 +1,169 @@ +using System; +using System.Collections.Generic; +using NFluent; +using ReClassNET.Extensions; +using Xunit; + +namespace ReClass.NET_Tests.Extensions +{ + public class StringExtensionTest + { + public static TheoryData GetTestIsPrintableData() => new TheoryData + { + '0', '9', ' ', '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> GetTestInterpretAsSingleByteCharacterData() => new TheoryData, IEnumerable> + { + { new byte[0], string.Empty }, + { new [] { (byte)'t', (byte)'e', (byte)'s', (byte)'t' }, "test" } + }; + + [Theory] + [MemberData(nameof(GetTestInterpretAsSingleByteCharacterData))] + public void TestInterpretAsSingleByteCharacter(IEnumerable sut, IEnumerable expected) + { + Check.That(sut.InterpretAsSingleByteCharacter()).ContainsExactly(expected); + } + + 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(GetTestInterpretAsDoubleByteCharacterData))] + public void TestInterpretAsDoubleByteCharacter(IEnumerable sut, IEnumerable expected) + { + Check.That(sut.InterpretAsDoubleByteCharacter()).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(); + } + + [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); + } + } +} 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/Memory/MemoryBufferTest.cs b/ReClass.NET_Tests/Memory/MemoryBufferTest.cs new file mode 100644 index 00000000..d9fb45a1 --- /dev/null +++ b/ReClass.NET_Tests/Memory/MemoryBufferTest.cs @@ -0,0 +1,171 @@ +using System; +using System.Text; +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 + { + Size = 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 }, + { 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); + } + + 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); + } + } +} diff --git a/ReClass.NET_Tests/MemoryScanner/BytePatternTest.cs b/ReClass.NET_Tests/MemoryScanner/BytePatternTest.cs new file mode 100644 index 00000000..957863a4 --- /dev/null +++ b/ReClass.NET_Tests/MemoryScanner/BytePatternTest.cs @@ -0,0 +1,122 @@ +using System; +using System.Collections.Generic; +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/MemoryScanner/Comparer/ByteMemoryComparerTest.cs b/ReClass.NET_Tests/MemoryScanner/Comparer/ByteMemoryComparerTest.cs new file mode 100644 index 00000000..bdb74875 --- /dev/null +++ b/ReClass.NET_Tests/MemoryScanner/Comparer/ByteMemoryComparerTest.cs @@ -0,0 +1,160 @@ +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); + } + + 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/FloatMemoryComparerTest.cs b/ReClass.NET_Tests/MemoryScanner/Comparer/FloatMemoryComparerTest.cs new file mode 100644 index 00000000..b9824d4d --- /dev/null +++ b/ReClass.NET_Tests/MemoryScanner/Comparer/FloatMemoryComparerTest.cs @@ -0,0 +1,173 @@ +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)] + [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, BitConverter); + + 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, 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)); + } + + 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, BitConverter); + + 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, BitConverter); + + 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, BitConverter); + + 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, BitConverter); + + 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, BitConverter); + + Check.ThatCode(() => 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 new file mode 100644 index 00000000..0d6b8e1d --- /dev/null +++ b/ReClass.NET_Tests/MemoryScanner/Comparer/IntegerMemoryComparerTest.cs @@ -0,0 +1,165 @@ +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)] + [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, BitConverter); + + 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); + } + + 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, BitConverter); + + 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, BitConverter); + + 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, BitConverter); + + 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, BitConverter); + + 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, BitConverter); + + Check.ThatCode(() => 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 new file mode 100644 index 00000000..a298ebb3 --- /dev/null +++ b/ReClass.NET_Tests/MemoryScanner/Comparer/LongMemoryComparerTest.cs @@ -0,0 +1,165 @@ +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)] + [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, BitConverter); + + 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); + } + + 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, BitConverter); + + 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, BitConverter); + + 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, BitConverter); + + 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, BitConverter); + + 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, BitConverter); + + 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..b87f37ef --- /dev/null +++ b/ReClass.NET_Tests/MemoryScanner/Comparer/ShortMemoryComparerTest.cs @@ -0,0 +1,165 @@ +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)] + [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, BitConverter); + + 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); + } + + 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, BitConverter); + + 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, BitConverter); + + 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, BitConverter); + + 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, BitConverter); + + 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, BitConverter); + + Check.ThatCode(() => sut.Compare(BitConverter.GetBytes((short)0), 0, new ShortScanResult(0), out _)).Throws(); + } + } +} 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..02c7ae25 --- /dev/null +++ b/ReClass.NET_Tests/ReClass.NET_Tests.csproj @@ -0,0 +1,130 @@ + + + + + Debug + x86 + {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} + UnitTest + + + latest + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + x86 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + x86 + + + true + full + false + bin\Debug\ + TRACE;DEBUG;RECLASSNET64 + prompt + 4 + x64 + + + pdbonly + true + bin\Release\ + TRACE;RECLASSNET64 + prompt + 4 + x64 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {bfb8917d-e9b4-463f-a6e8-612c35728c78} + ReClass.NET + + + + + 4.10.1 + + + 2.5.0 + + + 2.4.1 + + + 2.4.1 + runtime; build; native; contentfiles; analyzers + 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); + } + } +} diff --git a/ReClass.NET_Tests/Util/BitStringTest.cs b/ReClass.NET_Tests/Util/BitStringTest.cs new file mode 100644 index 00000000..7a6a0b79 --- /dev/null +++ b/ReClass.NET_Tests/Util/BitStringTest.cs @@ -0,0 +1,69 @@ +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); + } + } +} 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/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/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); + } + } +} 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/DirectedGraphTest.cs b/ReClass.NET_Tests/Util/DirectedGraphTest.cs new file mode 100644 index 00000000..feea18af --- /dev/null +++ b/ReClass.NET_Tests/Util/DirectedGraphTest.cs @@ -0,0 +1,192 @@ +using System; +using System.Collections.Generic; +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); + } + } +} 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); + } + } +} 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/IntPtrComparerTest.cs b/ReClass.NET_Tests/Util/IntPtrComparerTest.cs new file mode 100644 index 00000000..ec47827b --- /dev/null +++ b/ReClass.NET_Tests/Util/IntPtrComparerTest.cs @@ -0,0 +1,29 @@ +using System; +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); + } + } +} 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..5e28a654 --- /dev/null +++ b/ReClass.NET_Tests/Util/PathUtilTest.cs @@ -0,0 +1,27 @@ +using System.Collections.Generic; +using System.IO; +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..d81a7a4f --- /dev/null +++ b/ReClass.NET_Tests/Util/XElementSerializerTest.cs @@ -0,0 +1,97 @@ +using System.Collections.Generic; +using System.Drawing; +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); + } + } +}