From a6d9cd3db4a634e0dac67abe81e0ae7671344051 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Thu, 25 Nov 2021 17:40:16 +0200 Subject: [PATCH] Refactor register code --- src/Bindings/Decoder.Converter.hpp | 536 +-- src/Bindings/Encoder.Converter.hpp | 434 +- src/Bindings/Instruction.Decoder.cpp | 396 +- src/Bindings/Instruction.Operand.hpp | 97 +- src/Bindings/Instruction.Operands.hpp | 716 ++-- src/Bindings/Register.hpp | 3671 +++++++++-------- src/Bindings/Thread.cpp | 1164 +++--- .../Tests/Tests.Generator.cs | 26 +- .../Tests/Tests.Operands.cs | 28 +- .../Tests/Tests.RegisterMaskGp.cs | 126 +- .../Tests/Tests.Registers.cs | 364 +- .../API/Analysis/RegisterMask.cs | 51 +- src/Dotx64Managed/API/Thread.Register.cs | 626 +-- 13 files changed, 4164 insertions(+), 4071 deletions(-) diff --git a/src/Bindings/Decoder.Converter.hpp b/src/Bindings/Decoder.Converter.hpp index 3b3e93f..00922c9 100644 --- a/src/Bindings/Decoder.Converter.hpp +++ b/src/Bindings/Decoder.Converter.hpp @@ -8,542 +8,542 @@ namespace Dotx64Dbg { - constexpr RegisterId convertZydisRegister(ZydisRegister reg) + constexpr Registers::Id convertZydisRegister(ZydisRegister reg) { switch (reg) { case ZYDIS_REGISTER_NONE: - return RegisterId::None; + return Registers::Id::None; case ZYDIS_REGISTER_AL: - return RegisterId::Al; + return Registers::Id::Al; case ZYDIS_REGISTER_CL: - return RegisterId::Cl; + return Registers::Id::Cl; case ZYDIS_REGISTER_DL: - return RegisterId::Dl; + return Registers::Id::Dl; case ZYDIS_REGISTER_BL: - return RegisterId::Bl; + return Registers::Id::Bl; case ZYDIS_REGISTER_AH: - return RegisterId::Ah; + return Registers::Id::Ah; case ZYDIS_REGISTER_CH: - return RegisterId::Ch; + return Registers::Id::Ch; case ZYDIS_REGISTER_DH: - return RegisterId::Dh; + return Registers::Id::Dh; case ZYDIS_REGISTER_BH: - return RegisterId::Bh; + return Registers::Id::Bh; case ZYDIS_REGISTER_SPL: - return RegisterId::Spl; + return Registers::Id::Spl; case ZYDIS_REGISTER_BPL: - return RegisterId::Bpl; + return Registers::Id::Bpl; case ZYDIS_REGISTER_SIL: - return RegisterId::Sil; + return Registers::Id::Sil; case ZYDIS_REGISTER_DIL: - return RegisterId::Dil; + return Registers::Id::Dil; case ZYDIS_REGISTER_R8B: - return RegisterId::R8b; + return Registers::Id::R8b; case ZYDIS_REGISTER_R9B: - return RegisterId::R9b; + return Registers::Id::R9b; case ZYDIS_REGISTER_R10B: - return RegisterId::R10b; + return Registers::Id::R10b; case ZYDIS_REGISTER_R11B: - return RegisterId::R11b; + return Registers::Id::R11b; case ZYDIS_REGISTER_R12B: - return RegisterId::R12b; + return Registers::Id::R12b; case ZYDIS_REGISTER_R13B: - return RegisterId::R13b; + return Registers::Id::R13b; case ZYDIS_REGISTER_R14B: - return RegisterId::R14b; + return Registers::Id::R14b; case ZYDIS_REGISTER_R15B: - return RegisterId::R15b; + return Registers::Id::R15b; case ZYDIS_REGISTER_AX: - return RegisterId::Ax; + return Registers::Id::Ax; case ZYDIS_REGISTER_CX: - return RegisterId::Cx; + return Registers::Id::Cx; case ZYDIS_REGISTER_DX: - return RegisterId::Dx; + return Registers::Id::Dx; case ZYDIS_REGISTER_BX: - return RegisterId::Bx; + return Registers::Id::Bx; case ZYDIS_REGISTER_SP: - return RegisterId::Sp; + return Registers::Id::Sp; case ZYDIS_REGISTER_BP: - return RegisterId::Bp; + return Registers::Id::Bp; case ZYDIS_REGISTER_SI: - return RegisterId::Si; + return Registers::Id::Si; case ZYDIS_REGISTER_DI: - return RegisterId::Di; + return Registers::Id::Di; case ZYDIS_REGISTER_R8W: - return RegisterId::R8w; + return Registers::Id::R8w; case ZYDIS_REGISTER_R9W: - return RegisterId::R9w; + return Registers::Id::R9w; case ZYDIS_REGISTER_R10W: - return RegisterId::R10w; + return Registers::Id::R10w; case ZYDIS_REGISTER_R11W: - return RegisterId::R11w; + return Registers::Id::R11w; case ZYDIS_REGISTER_R12W: - return RegisterId::R12w; + return Registers::Id::R12w; case ZYDIS_REGISTER_R13W: - return RegisterId::R13w; + return Registers::Id::R13w; case ZYDIS_REGISTER_R14W: - return RegisterId::R14w; + return Registers::Id::R14w; case ZYDIS_REGISTER_R15W: - return RegisterId::R15w; + return Registers::Id::R15w; case ZYDIS_REGISTER_EAX: - return RegisterId::Eax; + return Registers::Id::Eax; case ZYDIS_REGISTER_ECX: - return RegisterId::Ecx; + return Registers::Id::Ecx; case ZYDIS_REGISTER_EDX: - return RegisterId::Edx; + return Registers::Id::Edx; case ZYDIS_REGISTER_EBX: - return RegisterId::Ebx; + return Registers::Id::Ebx; case ZYDIS_REGISTER_ESP: - return RegisterId::Esp; + return Registers::Id::Esp; case ZYDIS_REGISTER_EBP: - return RegisterId::Ebp; + return Registers::Id::Ebp; case ZYDIS_REGISTER_ESI: - return RegisterId::Esi; + return Registers::Id::Esi; case ZYDIS_REGISTER_EDI: - return RegisterId::Edi; + return Registers::Id::Edi; case ZYDIS_REGISTER_R8D: - return RegisterId::R8d; + return Registers::Id::R8d; case ZYDIS_REGISTER_R9D: - return RegisterId::R9d; + return Registers::Id::R9d; case ZYDIS_REGISTER_R10D: - return RegisterId::R10d; + return Registers::Id::R10d; case ZYDIS_REGISTER_R11D: - return RegisterId::R11d; + return Registers::Id::R11d; case ZYDIS_REGISTER_R12D: - return RegisterId::R12d; + return Registers::Id::R12d; case ZYDIS_REGISTER_R13D: - return RegisterId::R13d; + return Registers::Id::R13d; case ZYDIS_REGISTER_R14D: - return RegisterId::R14d; + return Registers::Id::R14d; case ZYDIS_REGISTER_R15D: - return RegisterId::R15d; + return Registers::Id::R15d; case ZYDIS_REGISTER_RAX: - return RegisterId::Rax; + return Registers::Id::Rax; case ZYDIS_REGISTER_RCX: - return RegisterId::Rcx; + return Registers::Id::Rcx; case ZYDIS_REGISTER_RDX: - return RegisterId::Rdx; + return Registers::Id::Rdx; case ZYDIS_REGISTER_RBX: - return RegisterId::Rbx; + return Registers::Id::Rbx; case ZYDIS_REGISTER_RSP: - return RegisterId::Rsp; + return Registers::Id::Rsp; case ZYDIS_REGISTER_RBP: - return RegisterId::Rbp; + return Registers::Id::Rbp; case ZYDIS_REGISTER_RSI: - return RegisterId::Rsi; + return Registers::Id::Rsi; case ZYDIS_REGISTER_RDI: - return RegisterId::Rdi; + return Registers::Id::Rdi; case ZYDIS_REGISTER_R8: - return RegisterId::R8; + return Registers::Id::R8; case ZYDIS_REGISTER_R9: - return RegisterId::R9; + return Registers::Id::R9; case ZYDIS_REGISTER_R10: - return RegisterId::R10; + return Registers::Id::R10; case ZYDIS_REGISTER_R11: - return RegisterId::R11; + return Registers::Id::R11; case ZYDIS_REGISTER_R12: - return RegisterId::R12; + return Registers::Id::R12; case ZYDIS_REGISTER_R13: - return RegisterId::R13; + return Registers::Id::R13; case ZYDIS_REGISTER_R14: - return RegisterId::R14; + return Registers::Id::R14; case ZYDIS_REGISTER_R15: - return RegisterId::R15; + return Registers::Id::R15; case ZYDIS_REGISTER_ST0: - return RegisterId::St0; + return Registers::Id::St0; case ZYDIS_REGISTER_ST1: - return RegisterId::St1; + return Registers::Id::St1; case ZYDIS_REGISTER_ST2: - return RegisterId::St2; + return Registers::Id::St2; case ZYDIS_REGISTER_ST3: - return RegisterId::St3; + return Registers::Id::St3; case ZYDIS_REGISTER_ST4: - return RegisterId::St4; + return Registers::Id::St4; case ZYDIS_REGISTER_ST5: - return RegisterId::St5; + return Registers::Id::St5; case ZYDIS_REGISTER_ST6: - return RegisterId::St6; + return Registers::Id::St6; case ZYDIS_REGISTER_ST7: - return RegisterId::St7; + return Registers::Id::St7; case ZYDIS_REGISTER_X87CONTROL: - return RegisterId::X87Control; + return Registers::Id::X87Control; case ZYDIS_REGISTER_X87STATUS: - return RegisterId::X87Status; + return Registers::Id::X87Status; case ZYDIS_REGISTER_X87TAG: - return RegisterId::X87Tag; + return Registers::Id::X87Tag; case ZYDIS_REGISTER_MM0: - return RegisterId::Mm0; + return Registers::Id::Mm0; case ZYDIS_REGISTER_MM1: - return RegisterId::Mm1; + return Registers::Id::Mm1; case ZYDIS_REGISTER_MM2: - return RegisterId::Mm2; + return Registers::Id::Mm2; case ZYDIS_REGISTER_MM3: - return RegisterId::Mm3; + return Registers::Id::Mm3; case ZYDIS_REGISTER_MM4: - return RegisterId::Mm4; + return Registers::Id::Mm4; case ZYDIS_REGISTER_MM5: - return RegisterId::Mm5; + return Registers::Id::Mm5; case ZYDIS_REGISTER_MM6: - return RegisterId::Mm6; + return Registers::Id::Mm6; case ZYDIS_REGISTER_MM7: - return RegisterId::Mm7; + return Registers::Id::Mm7; case ZYDIS_REGISTER_XMM0: - return RegisterId::Xmm0; + return Registers::Id::Xmm0; case ZYDIS_REGISTER_XMM1: - return RegisterId::Xmm1; + return Registers::Id::Xmm1; case ZYDIS_REGISTER_XMM2: - return RegisterId::Xmm2; + return Registers::Id::Xmm2; case ZYDIS_REGISTER_XMM3: - return RegisterId::Xmm3; + return Registers::Id::Xmm3; case ZYDIS_REGISTER_XMM4: - return RegisterId::Xmm4; + return Registers::Id::Xmm4; case ZYDIS_REGISTER_XMM5: - return RegisterId::Xmm5; + return Registers::Id::Xmm5; case ZYDIS_REGISTER_XMM6: - return RegisterId::Xmm6; + return Registers::Id::Xmm6; case ZYDIS_REGISTER_XMM7: - return RegisterId::Xmm7; + return Registers::Id::Xmm7; case ZYDIS_REGISTER_XMM8: - return RegisterId::Xmm8; + return Registers::Id::Xmm8; case ZYDIS_REGISTER_XMM9: - return RegisterId::Xmm9; + return Registers::Id::Xmm9; case ZYDIS_REGISTER_XMM10: - return RegisterId::Xmm10; + return Registers::Id::Xmm10; case ZYDIS_REGISTER_XMM11: - return RegisterId::Xmm11; + return Registers::Id::Xmm11; case ZYDIS_REGISTER_XMM12: - return RegisterId::Xmm12; + return Registers::Id::Xmm12; case ZYDIS_REGISTER_XMM13: - return RegisterId::Xmm13; + return Registers::Id::Xmm13; case ZYDIS_REGISTER_XMM14: - return RegisterId::Xmm14; + return Registers::Id::Xmm14; case ZYDIS_REGISTER_XMM15: - return RegisterId::Xmm15; + return Registers::Id::Xmm15; case ZYDIS_REGISTER_XMM16: - return RegisterId::Xmm16; + return Registers::Id::Xmm16; case ZYDIS_REGISTER_XMM17: - return RegisterId::Xmm17; + return Registers::Id::Xmm17; case ZYDIS_REGISTER_XMM18: - return RegisterId::Xmm18; + return Registers::Id::Xmm18; case ZYDIS_REGISTER_XMM19: - return RegisterId::Xmm19; + return Registers::Id::Xmm19; case ZYDIS_REGISTER_XMM20: - return RegisterId::Xmm20; + return Registers::Id::Xmm20; case ZYDIS_REGISTER_XMM21: - return RegisterId::Xmm21; + return Registers::Id::Xmm21; case ZYDIS_REGISTER_XMM22: - return RegisterId::Xmm22; + return Registers::Id::Xmm22; case ZYDIS_REGISTER_XMM23: - return RegisterId::Xmm23; + return Registers::Id::Xmm23; case ZYDIS_REGISTER_XMM24: - return RegisterId::Xmm24; + return Registers::Id::Xmm24; case ZYDIS_REGISTER_XMM25: - return RegisterId::Xmm25; + return Registers::Id::Xmm25; case ZYDIS_REGISTER_XMM26: - return RegisterId::Xmm26; + return Registers::Id::Xmm26; case ZYDIS_REGISTER_XMM27: - return RegisterId::Xmm27; + return Registers::Id::Xmm27; case ZYDIS_REGISTER_XMM28: - return RegisterId::Xmm28; + return Registers::Id::Xmm28; case ZYDIS_REGISTER_XMM29: - return RegisterId::Xmm29; + return Registers::Id::Xmm29; case ZYDIS_REGISTER_XMM30: - return RegisterId::Xmm30; + return Registers::Id::Xmm30; case ZYDIS_REGISTER_XMM31: - return RegisterId::Xmm31; + return Registers::Id::Xmm31; case ZYDIS_REGISTER_YMM0: - return RegisterId::Ymm0; + return Registers::Id::Ymm0; case ZYDIS_REGISTER_YMM1: - return RegisterId::Ymm1; + return Registers::Id::Ymm1; case ZYDIS_REGISTER_YMM2: - return RegisterId::Ymm2; + return Registers::Id::Ymm2; case ZYDIS_REGISTER_YMM3: - return RegisterId::Ymm3; + return Registers::Id::Ymm3; case ZYDIS_REGISTER_YMM4: - return RegisterId::Ymm4; + return Registers::Id::Ymm4; case ZYDIS_REGISTER_YMM5: - return RegisterId::Ymm5; + return Registers::Id::Ymm5; case ZYDIS_REGISTER_YMM6: - return RegisterId::Ymm6; + return Registers::Id::Ymm6; case ZYDIS_REGISTER_YMM7: - return RegisterId::Ymm7; + return Registers::Id::Ymm7; case ZYDIS_REGISTER_YMM8: - return RegisterId::Ymm8; + return Registers::Id::Ymm8; case ZYDIS_REGISTER_YMM9: - return RegisterId::Ymm9; + return Registers::Id::Ymm9; case ZYDIS_REGISTER_YMM10: - return RegisterId::Ymm10; + return Registers::Id::Ymm10; case ZYDIS_REGISTER_YMM11: - return RegisterId::Ymm11; + return Registers::Id::Ymm11; case ZYDIS_REGISTER_YMM12: - return RegisterId::Ymm12; + return Registers::Id::Ymm12; case ZYDIS_REGISTER_YMM13: - return RegisterId::Ymm13; + return Registers::Id::Ymm13; case ZYDIS_REGISTER_YMM14: - return RegisterId::Ymm14; + return Registers::Id::Ymm14; case ZYDIS_REGISTER_YMM15: - return RegisterId::Ymm15; + return Registers::Id::Ymm15; case ZYDIS_REGISTER_YMM16: - return RegisterId::Ymm16; + return Registers::Id::Ymm16; case ZYDIS_REGISTER_YMM17: - return RegisterId::Ymm17; + return Registers::Id::Ymm17; case ZYDIS_REGISTER_YMM18: - return RegisterId::Ymm18; + return Registers::Id::Ymm18; case ZYDIS_REGISTER_YMM19: - return RegisterId::Ymm19; + return Registers::Id::Ymm19; case ZYDIS_REGISTER_YMM20: - return RegisterId::Ymm20; + return Registers::Id::Ymm20; case ZYDIS_REGISTER_YMM21: - return RegisterId::Ymm21; + return Registers::Id::Ymm21; case ZYDIS_REGISTER_YMM22: - return RegisterId::Ymm22; + return Registers::Id::Ymm22; case ZYDIS_REGISTER_YMM23: - return RegisterId::Ymm23; + return Registers::Id::Ymm23; case ZYDIS_REGISTER_YMM24: - return RegisterId::Ymm24; + return Registers::Id::Ymm24; case ZYDIS_REGISTER_YMM25: - return RegisterId::Ymm25; + return Registers::Id::Ymm25; case ZYDIS_REGISTER_YMM26: - return RegisterId::Ymm26; + return Registers::Id::Ymm26; case ZYDIS_REGISTER_YMM27: - return RegisterId::Ymm27; + return Registers::Id::Ymm27; case ZYDIS_REGISTER_YMM28: - return RegisterId::Ymm28; + return Registers::Id::Ymm28; case ZYDIS_REGISTER_YMM29: - return RegisterId::Ymm29; + return Registers::Id::Ymm29; case ZYDIS_REGISTER_YMM30: - return RegisterId::Ymm30; + return Registers::Id::Ymm30; case ZYDIS_REGISTER_YMM31: - return RegisterId::Ymm31; + return Registers::Id::Ymm31; case ZYDIS_REGISTER_ZMM0: - return RegisterId::Zmm0; + return Registers::Id::Zmm0; case ZYDIS_REGISTER_ZMM1: - return RegisterId::Zmm1; + return Registers::Id::Zmm1; case ZYDIS_REGISTER_ZMM2: - return RegisterId::Zmm2; + return Registers::Id::Zmm2; case ZYDIS_REGISTER_ZMM3: - return RegisterId::Zmm3; + return Registers::Id::Zmm3; case ZYDIS_REGISTER_ZMM4: - return RegisterId::Zmm4; + return Registers::Id::Zmm4; case ZYDIS_REGISTER_ZMM5: - return RegisterId::Zmm5; + return Registers::Id::Zmm5; case ZYDIS_REGISTER_ZMM6: - return RegisterId::Zmm6; + return Registers::Id::Zmm6; case ZYDIS_REGISTER_ZMM7: - return RegisterId::Zmm7; + return Registers::Id::Zmm7; case ZYDIS_REGISTER_ZMM8: - return RegisterId::Zmm8; + return Registers::Id::Zmm8; case ZYDIS_REGISTER_ZMM9: - return RegisterId::Zmm9; + return Registers::Id::Zmm9; case ZYDIS_REGISTER_ZMM10: - return RegisterId::Zmm10; + return Registers::Id::Zmm10; case ZYDIS_REGISTER_ZMM11: - return RegisterId::Zmm11; + return Registers::Id::Zmm11; case ZYDIS_REGISTER_ZMM12: - return RegisterId::Zmm12; + return Registers::Id::Zmm12; case ZYDIS_REGISTER_ZMM13: - return RegisterId::Zmm13; + return Registers::Id::Zmm13; case ZYDIS_REGISTER_ZMM14: - return RegisterId::Zmm14; + return Registers::Id::Zmm14; case ZYDIS_REGISTER_ZMM15: - return RegisterId::Zmm15; + return Registers::Id::Zmm15; case ZYDIS_REGISTER_ZMM16: - return RegisterId::Zmm16; + return Registers::Id::Zmm16; case ZYDIS_REGISTER_ZMM17: - return RegisterId::Zmm17; + return Registers::Id::Zmm17; case ZYDIS_REGISTER_ZMM18: - return RegisterId::Zmm18; + return Registers::Id::Zmm18; case ZYDIS_REGISTER_ZMM19: - return RegisterId::Zmm19; + return Registers::Id::Zmm19; case ZYDIS_REGISTER_ZMM20: - return RegisterId::Zmm20; + return Registers::Id::Zmm20; case ZYDIS_REGISTER_ZMM21: - return RegisterId::Zmm21; + return Registers::Id::Zmm21; case ZYDIS_REGISTER_ZMM22: - return RegisterId::Zmm22; + return Registers::Id::Zmm22; case ZYDIS_REGISTER_ZMM23: - return RegisterId::Zmm23; + return Registers::Id::Zmm23; case ZYDIS_REGISTER_ZMM24: - return RegisterId::Zmm24; + return Registers::Id::Zmm24; case ZYDIS_REGISTER_ZMM25: - return RegisterId::Zmm25; + return Registers::Id::Zmm25; case ZYDIS_REGISTER_ZMM26: - return RegisterId::Zmm26; + return Registers::Id::Zmm26; case ZYDIS_REGISTER_ZMM27: - return RegisterId::Zmm27; + return Registers::Id::Zmm27; case ZYDIS_REGISTER_ZMM28: - return RegisterId::Zmm28; + return Registers::Id::Zmm28; case ZYDIS_REGISTER_ZMM29: - return RegisterId::Zmm29; + return Registers::Id::Zmm29; case ZYDIS_REGISTER_ZMM30: - return RegisterId::Zmm30; + return Registers::Id::Zmm30; case ZYDIS_REGISTER_ZMM31: - return RegisterId::Zmm31; + return Registers::Id::Zmm31; case ZYDIS_REGISTER_TMM0: - return RegisterId::Tmm0; + return Registers::Id::Tmm0; case ZYDIS_REGISTER_TMM1: - return RegisterId::Tmm1; + return Registers::Id::Tmm1; case ZYDIS_REGISTER_TMM2: - return RegisterId::Tmm2; + return Registers::Id::Tmm2; case ZYDIS_REGISTER_TMM3: - return RegisterId::Tmm3; + return Registers::Id::Tmm3; case ZYDIS_REGISTER_TMM4: - return RegisterId::Tmm4; + return Registers::Id::Tmm4; case ZYDIS_REGISTER_TMM5: - return RegisterId::Tmm5; + return Registers::Id::Tmm5; case ZYDIS_REGISTER_TMM6: - return RegisterId::Tmm6; + return Registers::Id::Tmm6; case ZYDIS_REGISTER_TMM7: - return RegisterId::Tmm7; + return Registers::Id::Tmm7; case ZYDIS_REGISTER_FLAGS: - return RegisterId::Flags; + return Registers::Id::Flags; case ZYDIS_REGISTER_EFLAGS: - return RegisterId::EFlags; + return Registers::Id::EFlags; case ZYDIS_REGISTER_RFLAGS: - return RegisterId::RFlags; + return Registers::Id::RFlags; case ZYDIS_REGISTER_IP: - return RegisterId::Ip; + return Registers::Id::Ip; case ZYDIS_REGISTER_EIP: - return RegisterId::Eip; + return Registers::Id::Eip; case ZYDIS_REGISTER_RIP: - return RegisterId::Rip; + return Registers::Id::Rip; case ZYDIS_REGISTER_ES: - return RegisterId::Es; + return Registers::Id::Es; case ZYDIS_REGISTER_CS: - return RegisterId::Cs; + return Registers::Id::Cs; case ZYDIS_REGISTER_SS: - return RegisterId::Ss; + return Registers::Id::Ss; case ZYDIS_REGISTER_DS: - return RegisterId::Ds; + return Registers::Id::Ds; case ZYDIS_REGISTER_FS: - return RegisterId::Fs; + return Registers::Id::Fs; case ZYDIS_REGISTER_GS: - return RegisterId::Gs; + return Registers::Id::Gs; case ZYDIS_REGISTER_GDTR: - return RegisterId::Gdtr; + return Registers::Id::Gdtr; case ZYDIS_REGISTER_LDTR: - return RegisterId::Ldtr; + return Registers::Id::Ldtr; case ZYDIS_REGISTER_IDTR: - return RegisterId::Idtr; + return Registers::Id::Idtr; case ZYDIS_REGISTER_TR: - return RegisterId::Tr; + return Registers::Id::Tr; case ZYDIS_REGISTER_TR0: - return RegisterId::Tr0; + return Registers::Id::Tr0; case ZYDIS_REGISTER_TR1: - return RegisterId::Tr1; + return Registers::Id::Tr1; case ZYDIS_REGISTER_TR2: - return RegisterId::Tr2; + return Registers::Id::Tr2; case ZYDIS_REGISTER_TR3: - return RegisterId::Tr3; + return Registers::Id::Tr3; case ZYDIS_REGISTER_TR4: - return RegisterId::Tr4; + return Registers::Id::Tr4; case ZYDIS_REGISTER_TR5: - return RegisterId::Tr5; + return Registers::Id::Tr5; case ZYDIS_REGISTER_TR6: - return RegisterId::Tr6; + return Registers::Id::Tr6; case ZYDIS_REGISTER_TR7: - return RegisterId::Tr7; + return Registers::Id::Tr7; case ZYDIS_REGISTER_CR0: - return RegisterId::Cr0; + return Registers::Id::Cr0; case ZYDIS_REGISTER_CR1: - return RegisterId::Cr1; + return Registers::Id::Cr1; case ZYDIS_REGISTER_CR2: - return RegisterId::Cr2; + return Registers::Id::Cr2; case ZYDIS_REGISTER_CR3: - return RegisterId::Cr3; + return Registers::Id::Cr3; case ZYDIS_REGISTER_CR4: - return RegisterId::Cr4; + return Registers::Id::Cr4; case ZYDIS_REGISTER_CR5: - return RegisterId::Cr5; + return Registers::Id::Cr5; case ZYDIS_REGISTER_CR6: - return RegisterId::Cr6; + return Registers::Id::Cr6; case ZYDIS_REGISTER_CR7: - return RegisterId::Cr7; + return Registers::Id::Cr7; case ZYDIS_REGISTER_CR8: - return RegisterId::Cr8; + return Registers::Id::Cr8; case ZYDIS_REGISTER_CR9: - return RegisterId::Cr9; + return Registers::Id::Cr9; case ZYDIS_REGISTER_CR10: - return RegisterId::Cr10; + return Registers::Id::Cr10; case ZYDIS_REGISTER_CR11: - return RegisterId::Cr11; + return Registers::Id::Cr11; case ZYDIS_REGISTER_CR12: - return RegisterId::Cr12; + return Registers::Id::Cr12; case ZYDIS_REGISTER_CR13: - return RegisterId::Cr13; + return Registers::Id::Cr13; case ZYDIS_REGISTER_CR14: - return RegisterId::Cr14; + return Registers::Id::Cr14; case ZYDIS_REGISTER_CR15: - return RegisterId::Cr15; + return Registers::Id::Cr15; case ZYDIS_REGISTER_DR0: - return RegisterId::Dr0; + return Registers::Id::Dr0; case ZYDIS_REGISTER_DR1: - return RegisterId::Dr1; + return Registers::Id::Dr1; case ZYDIS_REGISTER_DR2: - return RegisterId::Dr2; + return Registers::Id::Dr2; case ZYDIS_REGISTER_DR3: - return RegisterId::Dr3; + return Registers::Id::Dr3; case ZYDIS_REGISTER_DR4: - return RegisterId::Dr4; + return Registers::Id::Dr4; case ZYDIS_REGISTER_DR5: - return RegisterId::Dr5; + return Registers::Id::Dr5; case ZYDIS_REGISTER_DR6: - return RegisterId::Dr6; + return Registers::Id::Dr6; case ZYDIS_REGISTER_DR7: - return RegisterId::Dr7; + return Registers::Id::Dr7; case ZYDIS_REGISTER_DR8: - return RegisterId::Dr8; + return Registers::Id::Dr8; case ZYDIS_REGISTER_DR9: - return RegisterId::Dr9; + return Registers::Id::Dr9; case ZYDIS_REGISTER_DR10: - return RegisterId::Dr10; + return Registers::Id::Dr10; case ZYDIS_REGISTER_DR11: - return RegisterId::Dr11; + return Registers::Id::Dr11; case ZYDIS_REGISTER_DR12: - return RegisterId::Dr12; + return Registers::Id::Dr12; case ZYDIS_REGISTER_DR13: - return RegisterId::Dr13; + return Registers::Id::Dr13; case ZYDIS_REGISTER_DR14: - return RegisterId::Dr14; + return Registers::Id::Dr14; case ZYDIS_REGISTER_DR15: - return RegisterId::Dr15; + return Registers::Id::Dr15; case ZYDIS_REGISTER_K0: - return RegisterId::K0; + return Registers::Id::K0; case ZYDIS_REGISTER_K1: - return RegisterId::K1; + return Registers::Id::K1; case ZYDIS_REGISTER_K2: - return RegisterId::K2; + return Registers::Id::K2; case ZYDIS_REGISTER_K3: - return RegisterId::K3; + return Registers::Id::K3; case ZYDIS_REGISTER_K4: - return RegisterId::K4; + return Registers::Id::K4; case ZYDIS_REGISTER_K5: - return RegisterId::K5; + return Registers::Id::K5; case ZYDIS_REGISTER_K6: - return RegisterId::K6; + return Registers::Id::K6; case ZYDIS_REGISTER_K7: - return RegisterId::K7; + return Registers::Id::K7; case ZYDIS_REGISTER_BND0: - return RegisterId::Bnd0; + return Registers::Id::Bnd0; case ZYDIS_REGISTER_BND1: - return RegisterId::Bnd1; + return Registers::Id::Bnd1; case ZYDIS_REGISTER_BND2: - return RegisterId::Bnd2; + return Registers::Id::Bnd2; case ZYDIS_REGISTER_BND3: - return RegisterId::Bnd3; + return Registers::Id::Bnd3; case ZYDIS_REGISTER_BNDCFG: - return RegisterId::BndCfg; + return Registers::Id::BndCfg; case ZYDIS_REGISTER_BNDSTATUS: - return RegisterId::BndStatus; + return Registers::Id::BndStatus; case ZYDIS_REGISTER_MXCSR: - return RegisterId::Mxcsr; + return Registers::Id::Mxcsr; case ZYDIS_REGISTER_PKRU: - return RegisterId::Pkru; + return Registers::Id::Pkru; case ZYDIS_REGISTER_XCR0: - return RegisterId::Xcr0; + return Registers::Id::Xcr0; } - return RegisterId::Invalid; + return Registers::Id::Invalid; } inline Mnemonic convertZydisMnemonic(ZydisMnemonic mnemonic) @@ -4064,4 +4064,4 @@ namespace Dotx64Dbg return Mnemonic::Invalid; } -} // namespace Dotx64Dbg \ No newline at end of file +} // namespace Dotx64Dbg diff --git a/src/Bindings/Encoder.Converter.hpp b/src/Bindings/Encoder.Converter.hpp index 52ff8a9..d3c7070 100644 --- a/src/Bindings/Encoder.Converter.hpp +++ b/src/Bindings/Encoder.Converter.hpp @@ -2802,443 +2802,443 @@ namespace Dotx64Dbg return 0; } - inline asmjit::x86::Reg convertAsmJitRegister(const RegisterId reg) + inline asmjit::x86::Reg convertAsmJitRegister(const Registers::Id reg) { switch (reg) { - case RegisterId::None: + case Registers::Id::None: return {}; // Segment registers - case RegisterId::Es: + case Registers::Id::Es: return asmjit::x86::es; - case RegisterId::Cs: + case Registers::Id::Cs: return asmjit::x86::cs; - case RegisterId::Ss: + case Registers::Id::Ss: return asmjit::x86::ss; - case RegisterId::Ds: + case Registers::Id::Ds: return asmjit::x86::ds; - case RegisterId::Fs: + case Registers::Id::Fs: return asmjit::x86::fs; - case RegisterId::Gs: + case Registers::Id::Gs: return asmjit::x86::gs; // General purpose registers 8-bit - case RegisterId::Al: + case Registers::Id::Al: return asmjit::x86::al; - case RegisterId::Cl: + case Registers::Id::Cl: return asmjit::x86::cl; - case RegisterId::Dl: + case Registers::Id::Dl: return asmjit::x86::dl; - case RegisterId::Bl: + case Registers::Id::Bl: return asmjit::x86::bl; - case RegisterId::Ah: + case Registers::Id::Ah: return asmjit::x86::ah; - case RegisterId::Ch: + case Registers::Id::Ch: return asmjit::x86::ch; - case RegisterId::Dh: + case Registers::Id::Dh: return asmjit::x86::dh; - case RegisterId::Bh: + case Registers::Id::Bh: return asmjit::x86::bh; - case RegisterId::Spl: + case Registers::Id::Spl: return asmjit::x86::spl; - case RegisterId::Bpl: + case Registers::Id::Bpl: return asmjit::x86::bpl; - case RegisterId::Sil: + case Registers::Id::Sil: return asmjit::x86::sil; - case RegisterId::Dil: + case Registers::Id::Dil: return asmjit::x86::dil; - case RegisterId::R8b: + case Registers::Id::R8b: return asmjit::x86::r8b; - case RegisterId::R9b: + case Registers::Id::R9b: return asmjit::x86::r9b; - case RegisterId::R10b: + case Registers::Id::R10b: return asmjit::x86::r10b; - case RegisterId::R11b: + case Registers::Id::R11b: return asmjit::x86::r11b; - case RegisterId::R12b: + case Registers::Id::R12b: return asmjit::x86::r12b; - case RegisterId::R13b: + case Registers::Id::R13b: return asmjit::x86::r13b; - case RegisterId::R14b: + case Registers::Id::R14b: return asmjit::x86::r14b; - case RegisterId::R15b: + case Registers::Id::R15b: return asmjit::x86::r15b; // General purpose registers 16-bit - case RegisterId::Ax: + case Registers::Id::Ax: return asmjit::x86::ax; - case RegisterId::Cx: + case Registers::Id::Cx: return asmjit::x86::cx; - case RegisterId::Dx: + case Registers::Id::Dx: return asmjit::x86::dx; - case RegisterId::Bx: + case Registers::Id::Bx: return asmjit::x86::bx; - case RegisterId::Sp: + case Registers::Id::Sp: return asmjit::x86::sp; - case RegisterId::Bp: + case Registers::Id::Bp: return asmjit::x86::bp; - case RegisterId::Si: + case Registers::Id::Si: return asmjit::x86::si; - case RegisterId::Di: + case Registers::Id::Di: return asmjit::x86::di; - case RegisterId::R8w: + case Registers::Id::R8w: return asmjit::x86::r8w; - case RegisterId::R9w: + case Registers::Id::R9w: return asmjit::x86::r9w; - case RegisterId::R10w: + case Registers::Id::R10w: return asmjit::x86::r10w; - case RegisterId::R11w: + case Registers::Id::R11w: return asmjit::x86::r11w; - case RegisterId::R12w: + case Registers::Id::R12w: return asmjit::x86::r12w; - case RegisterId::R13w: + case Registers::Id::R13w: return asmjit::x86::r13w; - case RegisterId::R14w: + case Registers::Id::R14w: return asmjit::x86::r14w; - case RegisterId::R15w: + case Registers::Id::R15w: return asmjit::x86::r15w; // General purpose registers 32-bit - case RegisterId::Eax: + case Registers::Id::Eax: return asmjit::x86::eax; - case RegisterId::Ecx: + case Registers::Id::Ecx: return asmjit::x86::ecx; - case RegisterId::Edx: + case Registers::Id::Edx: return asmjit::x86::edx; - case RegisterId::Ebx: + case Registers::Id::Ebx: return asmjit::x86::ebx; - case RegisterId::Esp: + case Registers::Id::Esp: return asmjit::x86::esp; - case RegisterId::Ebp: + case Registers::Id::Ebp: return asmjit::x86::ebp; - case RegisterId::Esi: + case Registers::Id::Esi: return asmjit::x86::esi; - case RegisterId::Edi: + case Registers::Id::Edi: return asmjit::x86::edi; - case RegisterId::R8d: + case Registers::Id::R8d: return asmjit::x86::r8d; - case RegisterId::R9d: + case Registers::Id::R9d: return asmjit::x86::r9d; - case RegisterId::R10d: + case Registers::Id::R10d: return asmjit::x86::r10d; - case RegisterId::R11d: + case Registers::Id::R11d: return asmjit::x86::r11d; - case RegisterId::R12d: + case Registers::Id::R12d: return asmjit::x86::r12d; - case RegisterId::R13d: + case Registers::Id::R13d: return asmjit::x86::r13d; - case RegisterId::R14d: + case Registers::Id::R14d: return asmjit::x86::r14d; - case RegisterId::R15d: + case Registers::Id::R15d: return asmjit::x86::r15d; // General purpose registers 64-bit - case RegisterId::Rax: + case Registers::Id::Rax: return asmjit::x86::rax; - case RegisterId::Rcx: + case Registers::Id::Rcx: return asmjit::x86::rcx; - case RegisterId::Rdx: + case Registers::Id::Rdx: return asmjit::x86::rdx; - case RegisterId::Rbx: + case Registers::Id::Rbx: return asmjit::x86::rbx; - case RegisterId::Rsp: + case Registers::Id::Rsp: return asmjit::x86::rsp; - case RegisterId::Rbp: + case Registers::Id::Rbp: return asmjit::x86::rbp; - case RegisterId::Rsi: + case Registers::Id::Rsi: return asmjit::x86::rsi; - case RegisterId::Rdi: + case Registers::Id::Rdi: return asmjit::x86::rdi; - case RegisterId::R8: + case Registers::Id::R8: return asmjit::x86::r8; - case RegisterId::R9: + case Registers::Id::R9: return asmjit::x86::r9; - case RegisterId::R10: + case Registers::Id::R10: return asmjit::x86::r10; - case RegisterId::R11: + case Registers::Id::R11: return asmjit::x86::r11; - case RegisterId::R12: + case Registers::Id::R12: return asmjit::x86::r12; - case RegisterId::R13: + case Registers::Id::R13: return asmjit::x86::r13; - case RegisterId::R14: + case Registers::Id::R14: return asmjit::x86::r14; - case RegisterId::R15: + case Registers::Id::R15: return asmjit::x86::r15; // Floating point legacy registers - case RegisterId::St0: + case Registers::Id::St0: return asmjit::x86::st0; - case RegisterId::St1: + case Registers::Id::St1: return asmjit::x86::st1; - case RegisterId::St2: + case Registers::Id::St2: return asmjit::x86::st2; - case RegisterId::St3: + case Registers::Id::St3: return asmjit::x86::st3; - case RegisterId::St4: + case Registers::Id::St4: return asmjit::x86::st4; - case RegisterId::St5: + case Registers::Id::St5: return asmjit::x86::st5; - case RegisterId::St6: + case Registers::Id::St6: return asmjit::x86::st6; - case RegisterId::St7: + case Registers::Id::St7: return asmjit::x86::st7; // Floating point multimedia registers - case RegisterId::Mm0: + case Registers::Id::Mm0: return asmjit::x86::mm0; - case RegisterId::Mm1: + case Registers::Id::Mm1: return asmjit::x86::mm1; - case RegisterId::Mm2: + case Registers::Id::Mm2: return asmjit::x86::mm2; - case RegisterId::Mm3: + case Registers::Id::Mm3: return asmjit::x86::mm3; - case RegisterId::Mm4: + case Registers::Id::Mm4: return asmjit::x86::mm4; - case RegisterId::Mm5: + case Registers::Id::Mm5: return asmjit::x86::mm5; - case RegisterId::Mm6: + case Registers::Id::Mm6: return asmjit::x86::mm6; - case RegisterId::Mm7: + case Registers::Id::Mm7: return asmjit::x86::mm7; // Floating point vector registers 128-bit - case RegisterId::Xmm0: + case Registers::Id::Xmm0: return asmjit::x86::xmm0; - case RegisterId::Xmm1: + case Registers::Id::Xmm1: return asmjit::x86::xmm1; - case RegisterId::Xmm2: + case Registers::Id::Xmm2: return asmjit::x86::xmm2; - case RegisterId::Xmm3: + case Registers::Id::Xmm3: return asmjit::x86::xmm3; - case RegisterId::Xmm4: + case Registers::Id::Xmm4: return asmjit::x86::xmm4; - case RegisterId::Xmm5: + case Registers::Id::Xmm5: return asmjit::x86::xmm5; - case RegisterId::Xmm6: + case Registers::Id::Xmm6: return asmjit::x86::xmm6; - case RegisterId::Xmm7: + case Registers::Id::Xmm7: return asmjit::x86::xmm7; - case RegisterId::Xmm8: + case Registers::Id::Xmm8: return asmjit::x86::xmm8; - case RegisterId::Xmm9: + case Registers::Id::Xmm9: return asmjit::x86::xmm9; - case RegisterId::Xmm10: + case Registers::Id::Xmm10: return asmjit::x86::xmm10; - case RegisterId::Xmm11: + case Registers::Id::Xmm11: return asmjit::x86::xmm11; - case RegisterId::Xmm12: + case Registers::Id::Xmm12: return asmjit::x86::xmm12; - case RegisterId::Xmm13: + case Registers::Id::Xmm13: return asmjit::x86::xmm13; - case RegisterId::Xmm14: + case Registers::Id::Xmm14: return asmjit::x86::xmm14; - case RegisterId::Xmm15: + case Registers::Id::Xmm15: return asmjit::x86::xmm15; - case RegisterId::Xmm16: + case Registers::Id::Xmm16: return asmjit::x86::xmm16; - case RegisterId::Xmm17: + case Registers::Id::Xmm17: return asmjit::x86::xmm17; - case RegisterId::Xmm18: + case Registers::Id::Xmm18: return asmjit::x86::xmm18; - case RegisterId::Xmm19: + case Registers::Id::Xmm19: return asmjit::x86::xmm19; - case RegisterId::Xmm20: + case Registers::Id::Xmm20: return asmjit::x86::xmm20; - case RegisterId::Xmm21: + case Registers::Id::Xmm21: return asmjit::x86::xmm21; - case RegisterId::Xmm22: + case Registers::Id::Xmm22: return asmjit::x86::xmm22; - case RegisterId::Xmm23: + case Registers::Id::Xmm23: return asmjit::x86::xmm23; - case RegisterId::Xmm24: + case Registers::Id::Xmm24: return asmjit::x86::xmm24; - case RegisterId::Xmm25: + case Registers::Id::Xmm25: return asmjit::x86::xmm25; - case RegisterId::Xmm26: + case Registers::Id::Xmm26: return asmjit::x86::xmm26; - case RegisterId::Xmm27: + case Registers::Id::Xmm27: return asmjit::x86::xmm27; - case RegisterId::Xmm28: + case Registers::Id::Xmm28: return asmjit::x86::xmm28; - case RegisterId::Xmm29: + case Registers::Id::Xmm29: return asmjit::x86::xmm29; - case RegisterId::Xmm30: + case Registers::Id::Xmm30: return asmjit::x86::xmm30; - case RegisterId::Xmm31: + case Registers::Id::Xmm31: return asmjit::x86::xmm31; // Floating point vector registers 256-bit - case RegisterId::Ymm0: + case Registers::Id::Ymm0: return asmjit::x86::ymm0; - case RegisterId::Ymm1: + case Registers::Id::Ymm1: return asmjit::x86::ymm1; - case RegisterId::Ymm2: + case Registers::Id::Ymm2: return asmjit::x86::ymm2; - case RegisterId::Ymm3: + case Registers::Id::Ymm3: return asmjit::x86::ymm3; - case RegisterId::Ymm4: + case Registers::Id::Ymm4: return asmjit::x86::ymm4; - case RegisterId::Ymm5: + case Registers::Id::Ymm5: return asmjit::x86::ymm5; - case RegisterId::Ymm6: + case Registers::Id::Ymm6: return asmjit::x86::ymm6; - case RegisterId::Ymm7: + case Registers::Id::Ymm7: return asmjit::x86::ymm7; - case RegisterId::Ymm8: + case Registers::Id::Ymm8: return asmjit::x86::ymm8; - case RegisterId::Ymm9: + case Registers::Id::Ymm9: return asmjit::x86::ymm9; - case RegisterId::Ymm10: + case Registers::Id::Ymm10: return asmjit::x86::ymm10; - case RegisterId::Ymm11: + case Registers::Id::Ymm11: return asmjit::x86::ymm11; - case RegisterId::Ymm12: + case Registers::Id::Ymm12: return asmjit::x86::ymm12; - case RegisterId::Ymm13: + case Registers::Id::Ymm13: return asmjit::x86::ymm13; - case RegisterId::Ymm14: + case Registers::Id::Ymm14: return asmjit::x86::ymm14; - case RegisterId::Ymm15: + case Registers::Id::Ymm15: return asmjit::x86::ymm15; - case RegisterId::Ymm16: + case Registers::Id::Ymm16: return asmjit::x86::ymm16; - case RegisterId::Ymm17: + case Registers::Id::Ymm17: return asmjit::x86::ymm17; - case RegisterId::Ymm18: + case Registers::Id::Ymm18: return asmjit::x86::ymm18; - case RegisterId::Ymm19: + case Registers::Id::Ymm19: return asmjit::x86::ymm19; - case RegisterId::Ymm20: + case Registers::Id::Ymm20: return asmjit::x86::ymm20; - case RegisterId::Ymm21: + case Registers::Id::Ymm21: return asmjit::x86::ymm21; - case RegisterId::Ymm22: + case Registers::Id::Ymm22: return asmjit::x86::ymm22; - case RegisterId::Ymm23: + case Registers::Id::Ymm23: return asmjit::x86::ymm23; - case RegisterId::Ymm24: + case Registers::Id::Ymm24: return asmjit::x86::ymm24; - case RegisterId::Ymm25: + case Registers::Id::Ymm25: return asmjit::x86::ymm25; - case RegisterId::Ymm26: + case Registers::Id::Ymm26: return asmjit::x86::ymm26; - case RegisterId::Ymm27: + case Registers::Id::Ymm27: return asmjit::x86::ymm27; - case RegisterId::Ymm28: + case Registers::Id::Ymm28: return asmjit::x86::ymm28; - case RegisterId::Ymm29: + case Registers::Id::Ymm29: return asmjit::x86::ymm29; - case RegisterId::Ymm30: + case Registers::Id::Ymm30: return asmjit::x86::ymm30; - case RegisterId::Ymm31: + case Registers::Id::Ymm31: return asmjit::x86::ymm31; // Floating point vector registers 512-bit - case RegisterId::Zmm0: + case Registers::Id::Zmm0: return asmjit::x86::zmm0; - case RegisterId::Zmm1: + case Registers::Id::Zmm1: return asmjit::x86::zmm1; - case RegisterId::Zmm2: + case Registers::Id::Zmm2: return asmjit::x86::zmm2; - case RegisterId::Zmm3: + case Registers::Id::Zmm3: return asmjit::x86::zmm3; - case RegisterId::Zmm4: + case Registers::Id::Zmm4: return asmjit::x86::zmm4; - case RegisterId::Zmm5: + case Registers::Id::Zmm5: return asmjit::x86::zmm5; - case RegisterId::Zmm6: + case Registers::Id::Zmm6: return asmjit::x86::zmm6; - case RegisterId::Zmm7: + case Registers::Id::Zmm7: return asmjit::x86::zmm7; - case RegisterId::Zmm8: + case Registers::Id::Zmm8: return asmjit::x86::zmm8; - case RegisterId::Zmm9: + case Registers::Id::Zmm9: return asmjit::x86::zmm9; - case RegisterId::Zmm10: + case Registers::Id::Zmm10: return asmjit::x86::zmm10; - case RegisterId::Zmm11: + case Registers::Id::Zmm11: return asmjit::x86::zmm11; - case RegisterId::Zmm12: + case Registers::Id::Zmm12: return asmjit::x86::zmm12; - case RegisterId::Zmm13: + case Registers::Id::Zmm13: return asmjit::x86::zmm13; - case RegisterId::Zmm14: + case Registers::Id::Zmm14: return asmjit::x86::zmm14; - case RegisterId::Zmm15: + case Registers::Id::Zmm15: return asmjit::x86::zmm15; - case RegisterId::Zmm16: + case Registers::Id::Zmm16: return asmjit::x86::zmm16; - case RegisterId::Zmm17: + case Registers::Id::Zmm17: return asmjit::x86::zmm17; - case RegisterId::Zmm18: + case Registers::Id::Zmm18: return asmjit::x86::zmm18; - case RegisterId::Zmm19: + case Registers::Id::Zmm19: return asmjit::x86::zmm19; - case RegisterId::Zmm20: + case Registers::Id::Zmm20: return asmjit::x86::zmm20; - case RegisterId::Zmm21: + case Registers::Id::Zmm21: return asmjit::x86::zmm21; - case RegisterId::Zmm22: + case Registers::Id::Zmm22: return asmjit::x86::zmm22; - case RegisterId::Zmm23: + case Registers::Id::Zmm23: return asmjit::x86::zmm23; - case RegisterId::Zmm24: + case Registers::Id::Zmm24: return asmjit::x86::zmm24; - case RegisterId::Zmm25: + case Registers::Id::Zmm25: return asmjit::x86::zmm25; - case RegisterId::Zmm26: + case Registers::Id::Zmm26: return asmjit::x86::zmm26; - case RegisterId::Zmm27: + case Registers::Id::Zmm27: return asmjit::x86::zmm27; - case RegisterId::Zmm28: + case Registers::Id::Zmm28: return asmjit::x86::zmm28; - case RegisterId::Zmm29: + case Registers::Id::Zmm29: return asmjit::x86::zmm29; - case RegisterId::Zmm30: + case Registers::Id::Zmm30: return asmjit::x86::zmm30; - case RegisterId::Zmm31: + case Registers::Id::Zmm31: return asmjit::x86::zmm31; - case RegisterId::Cr0: + case Registers::Id::Cr0: return asmjit::x86::cr0; - case RegisterId::Cr1: + case Registers::Id::Cr1: return asmjit::x86::cr1; - case RegisterId::Cr2: + case Registers::Id::Cr2: return asmjit::x86::cr2; - case RegisterId::Cr3: + case Registers::Id::Cr3: return asmjit::x86::cr3; - case RegisterId::Cr4: + case Registers::Id::Cr4: return asmjit::x86::cr4; - case RegisterId::Cr5: + case Registers::Id::Cr5: return asmjit::x86::cr5; - case RegisterId::Cr6: + case Registers::Id::Cr6: return asmjit::x86::cr6; - case RegisterId::Cr7: + case Registers::Id::Cr7: return asmjit::x86::cr7; - case RegisterId::Cr8: + case Registers::Id::Cr8: return asmjit::x86::cr8; - case RegisterId::Cr9: + case Registers::Id::Cr9: return asmjit::x86::cr9; - case RegisterId::Cr10: + case Registers::Id::Cr10: return asmjit::x86::cr10; - case RegisterId::Cr11: + case Registers::Id::Cr11: return asmjit::x86::cr11; - case RegisterId::Cr12: + case Registers::Id::Cr12: return asmjit::x86::cr12; - case RegisterId::Cr13: + case Registers::Id::Cr13: return asmjit::x86::cr13; - case RegisterId::Cr14: + case Registers::Id::Cr14: return asmjit::x86::cr14; - case RegisterId::Cr15: + case Registers::Id::Cr15: return asmjit::x86::cr15; - case RegisterId::Idtr: + case Registers::Id::Idtr: // Not mappable. return {}; // NOTE: AsmJit might handle this differently. - case RegisterId::Ip: - case RegisterId::Eip: - case RegisterId::Rip: + case Registers::Id::Ip: + case Registers::Id::Eip: + case Registers::Id::Rip: return asmjit::x86::rip; - case RegisterId::Tr: - case RegisterId::Tr0: - case RegisterId::Tr1: - case RegisterId::Tr2: - case RegisterId::Tr3: - case RegisterId::Tr4: - case RegisterId::Tr5: - case RegisterId::Tr6: - case RegisterId::Tr7: + case Registers::Id::Tr: + case Registers::Id::Tr0: + case Registers::Id::Tr1: + case Registers::Id::Tr2: + case Registers::Id::Tr3: + case Registers::Id::Tr4: + case Registers::Id::Tr5: + case Registers::Id::Tr6: + case Registers::Id::Tr7: return {}; } diff --git a/src/Bindings/Instruction.Decoder.cpp b/src/Bindings/Instruction.Decoder.cpp index db11212..6679560 100644 --- a/src/Bindings/Instruction.Decoder.cpp +++ b/src/Bindings/Instruction.Decoder.cpp @@ -12,150 +12,150 @@ namespace Dotx64Dbg { - struct EFlagsData - { - uint32_t read; - uint32_t write; - }; - - static IOperand^ ConvertOperandImm(const ZydisDecodedInstruction& instr, const ZydisDecodedOperand& op, uint64_t addr) - { - Operand::Immediate^ res = gcnew Operand::Immediate(); - res->Value = op.imm.value.s; - if (op.imm.is_relative) - { - res->Value += instr.length + addr; - } - return res; - } - - static IOperand^ ConvertOperandReg(const ZydisDecodedInstruction& instr, const ZydisDecodedOperand& op, uint64_t addr) - { - const auto reg = convertZydisRegister(op.reg.value); - return gcnew Operand::Register(reg); - } - - static IOperand^ ConvertOperandMem(const ZydisDecodedInstruction& instr, const ZydisDecodedOperand& op, uint64_t addr) - { - const auto& mem = op.mem; - - Operand::Memory^ res = gcnew Operand::Memory(); - - res->Size = op.size; - res->Segment = static_cast(mem.segment); - res->Base = static_cast(mem.base); - res->Index = static_cast(mem.index); - res->Scale = mem.scale; - res->Displacement = mem.disp.value; - - if (res->Base == RegisterId::Rip || res->Base == RegisterId::Eip) - { - res->Displacement += instr.length + addr; - res->Base = RegisterId::None; - } - - return res; - } - - static IOperand^ ConvertOperand(const ZydisDecodedInstruction& instr, const ZydisDecodedOperand& op, uint64_t addr) - { - if (op.type == ZYDIS_OPERAND_TYPE_IMMEDIATE) - { - return ConvertOperandImm(instr, op, addr); - } - else if (op.type == ZYDIS_OPERAND_TYPE_REGISTER) - { - return ConvertOperandReg(instr, op, addr); - } - else if (op.type == ZYDIS_OPERAND_TYPE_MEMORY) - { - return ConvertOperandMem(instr, op, addr); - } - else if (op.type == ZYDIS_OPERAND_TYPE_UNUSED) - { - return Operand::None; - } - // ?? - return Operand::None; - } - - static Instruction^ Convert(ZydisDecodedInstruction& instr, uint64_t addr) - { - const auto id = convertZydisMnemonic(instr.mnemonic); - - auto attribs = Instruction::Attributes::None; - - auto addAttribute = [&](Instruction::Attributes a, Instruction::Attributes b) - { - return static_cast(static_cast(a) | static_cast(b)); - }; - - if (instr.attributes & ZYDIS_ATTRIB_HAS_LOCK) - { - attribs = addAttribute(attribs, Instruction::Attributes::Lock); - } - - if (instr.attributes & ZYDIS_ATTRIB_HAS_REP) - { - attribs = addAttribute(attribs, Instruction::Attributes::Rep); - } - - if (instr.attributes & ZYDIS_ATTRIB_HAS_REPE) - { - attribs = addAttribute(attribs, Instruction::Attributes::RepEq); - } - - if (instr.attributes & ZYDIS_ATTRIB_HAS_REPNE) - { - attribs = addAttribute(attribs, Instruction::Attributes::RepNe); - } - - if (instr.attributes & ZYDIS_ATTRIB_HAS_REPNZ) - { - attribs = addAttribute(attribs, Instruction::Attributes::RepNz); - } - - auto res = gcnew Instruction(attribs, id); - res->_Size = instr.length; - res->_Address = addr; - res->_FlagsModified = (EFlags)instr.cpu_flags_written; - res->_FlagsRead = (EFlags)instr.cpu_flags_read; - - int opIndex = 0; - for (int i = 0; i < instr.operand_count; i++) - { - auto& op = instr.operands[i]; - - IOperand^ newOp = ConvertOperand(instr, op, addr); - OperandVisibility vis = OperandVisibility::Invalid; - if (op.visibility == ZYDIS_OPERAND_VISIBILITY_EXPLICIT) - vis = OperandVisibility::Explicit; - else if (op.visibility == ZYDIS_OPERAND_VISIBILITY_HIDDEN) - vis = OperandVisibility::Hidden; - else if (op.visibility == ZYDIS_OPERAND_VISIBILITY_IMPLICIT) - vis = OperandVisibility::Implicit; - else - vis = OperandVisibility::Invalid; - - OperandAccess access = OperandAccess::None; - if (op.actions & ZYDIS_OPERAND_ACTION_MASK_READ) - { - access = static_cast( - static_cast(access) | static_cast(OperandAccess::Read)); - } - - if (op.actions & ZYDIS_OPERAND_ACTION_MASK_WRITE) - { - access = static_cast( - static_cast(access) | static_cast(OperandAccess::Write)); - } - - res->SetOperand(opIndex, newOp, access, vis); - opIndex++; - } - - return res; - } + struct EFlagsData + { + uint32_t read; + uint32_t write; + }; + + static IOperand^ ConvertOperandImm(const ZydisDecodedInstruction& instr, const ZydisDecodedOperand& op, uint64_t addr) + { + Operand::Immediate^ res = gcnew Operand::Immediate(); + res->Value = op.imm.value.s; + if (op.imm.is_relative) + { + res->Value += instr.length + addr; + } + return res; + } + + static IOperand^ ConvertOperandReg(const ZydisDecodedInstruction& instr, const ZydisDecodedOperand& op, uint64_t addr) + { + const auto reg = convertZydisRegister(op.reg.value); + return gcnew Operand::Register(reg); + } + + static IOperand^ ConvertOperandMem(const ZydisDecodedInstruction& instr, const ZydisDecodedOperand& op, uint64_t addr) + { + const auto& mem = op.mem; + + Operand::Memory^ res = gcnew Operand::Memory(); + + res->Size = op.size; + res->Segment = static_cast(mem.segment); + res->Base = static_cast(mem.base); + res->Index = static_cast(mem.index); + res->Scale = mem.scale; + res->Displacement = mem.disp.value; + + if (res->Base == Registers::Id::Rip || res->Base == Registers::Id::Eip) + { + res->Displacement += instr.length + addr; + res->Base = Registers::Id::None; + } + + return res; + } + + static IOperand^ ConvertOperand(const ZydisDecodedInstruction& instr, const ZydisDecodedOperand& op, uint64_t addr) + { + if (op.type == ZYDIS_OPERAND_TYPE_IMMEDIATE) + { + return ConvertOperandImm(instr, op, addr); + } + else if (op.type == ZYDIS_OPERAND_TYPE_REGISTER) + { + return ConvertOperandReg(instr, op, addr); + } + else if (op.type == ZYDIS_OPERAND_TYPE_MEMORY) + { + return ConvertOperandMem(instr, op, addr); + } + else if (op.type == ZYDIS_OPERAND_TYPE_UNUSED) + { + return Operand::None; + } + // ?? + return Operand::None; + } + + static Instruction^ Convert(ZydisDecodedInstruction& instr, uint64_t addr) + { + const auto id = convertZydisMnemonic(instr.mnemonic); + + auto attribs = Instruction::Attributes::None; + + auto addAttribute = [&](Instruction::Attributes a, Instruction::Attributes b) + { + return static_cast(static_cast(a) | static_cast(b)); + }; + + if (instr.attributes & ZYDIS_ATTRIB_HAS_LOCK) + { + attribs = addAttribute(attribs, Instruction::Attributes::Lock); + } + + if (instr.attributes & ZYDIS_ATTRIB_HAS_REP) + { + attribs = addAttribute(attribs, Instruction::Attributes::Rep); + } + + if (instr.attributes & ZYDIS_ATTRIB_HAS_REPE) + { + attribs = addAttribute(attribs, Instruction::Attributes::RepEq); + } + + if (instr.attributes & ZYDIS_ATTRIB_HAS_REPNE) + { + attribs = addAttribute(attribs, Instruction::Attributes::RepNe); + } + + if (instr.attributes & ZYDIS_ATTRIB_HAS_REPNZ) + { + attribs = addAttribute(attribs, Instruction::Attributes::RepNz); + } + + auto res = gcnew Instruction(attribs, id); + res->_Size = instr.length; + res->_Address = addr; + res->_FlagsModified = (EFlags)instr.cpu_flags_written; + res->_FlagsRead = (EFlags)instr.cpu_flags_read; + + int opIndex = 0; + for (int i = 0; i < instr.operand_count; i++) + { + auto& op = instr.operands[i]; + + IOperand^ newOp = ConvertOperand(instr, op, addr); + OperandVisibility vis = OperandVisibility::Invalid; + if (op.visibility == ZYDIS_OPERAND_VISIBILITY_EXPLICIT) + vis = OperandVisibility::Explicit; + else if (op.visibility == ZYDIS_OPERAND_VISIBILITY_HIDDEN) + vis = OperandVisibility::Hidden; + else if (op.visibility == ZYDIS_OPERAND_VISIBILITY_IMPLICIT) + vis = OperandVisibility::Implicit; + else + vis = OperandVisibility::Invalid; + + OperandAccess access = OperandAccess::None; + if (op.actions & ZYDIS_OPERAND_ACTION_MASK_READ) + { + access = static_cast( + static_cast(access) | static_cast(OperandAccess::Read)); + } + + if (op.actions & ZYDIS_OPERAND_ACTION_MASK_WRITE) + { + access = static_cast( + static_cast(access) | static_cast(OperandAccess::Write)); + } + + res->SetOperand(opIndex, newOp, access, vis); + opIndex++; + } + + return res; + } namespace Internal { @@ -172,62 +172,62 @@ namespace Dotx64Dbg } - public ref class Decoder - { - ZydisDecoder* _decoder; + public ref class Decoder + { + ZydisDecoder* _decoder; - private: - Decoder() - { - _decoder = new ZydisDecoder(); + private: + Decoder() + { + _decoder = new ZydisDecoder(); #ifdef _M_AMD64 - auto mode = ZYDIS_MACHINE_MODE_LONG_64; - auto addrSize = ZYDIS_ADDRESS_WIDTH_64; + auto mode = ZYDIS_MACHINE_MODE_LONG_64; + auto addrSize = ZYDIS_ADDRESS_WIDTH_64; #else - auto mode = ZYDIS_MACHINE_MODE_LEGACY_32; - auto addrSize = ZYDIS_ADDRESS_WIDTH_32; + auto mode = ZYDIS_MACHINE_MODE_LEGACY_32; + auto addrSize = ZYDIS_ADDRESS_WIDTH_32; #endif - if (auto status = ZydisDecoderInit(_decoder, mode, addrSize); - status != ZYAN_STATUS_SUCCESS) - { - char msg[64]{}; - sprintf_s(msg, "ZydisDecoderInit failed: %u\n", status); - _plugin_logprint(msg); - } - } - - public: - ~Decoder() - { - delete _decoder; - } - - static Decoder^ Create() - { - return gcnew Decoder(); - } - - Instruction^ Decode(array^ data, uint64_t address) - { - pin_ptr ptr = &data[0]; - const uint8_t* buf = ptr; - - return Internal::decodeInstruction(_decoder, buf, data->Length, address); - } - - Instruction^ Decode(System::UIntPtr address) - { - auto va = static_cast(address.ToUInt64()); - duint readSize = 0; - - uint8_t buf[15]; - if (!Script::Memory::Read(static_cast(va), buf, sizeof(buf), &readSize)) - return nullptr; - - return Internal::decodeInstruction(_decoder, buf, readSize, va); - } - - private: - - }; + if (auto status = ZydisDecoderInit(_decoder, mode, addrSize); + status != ZYAN_STATUS_SUCCESS) + { + char msg[64]{}; + sprintf_s(msg, "ZydisDecoderInit failed: %u\n", status); + _plugin_logprint(msg); + } + } + + public: + ~Decoder() + { + delete _decoder; + } + + static Decoder^ Create() + { + return gcnew Decoder(); + } + + Instruction^ Decode(array^ data, uint64_t address) + { + pin_ptr ptr = &data[0]; + const uint8_t* buf = ptr; + + return Internal::decodeInstruction(_decoder, buf, data->Length, address); + } + + Instruction^ Decode(System::UIntPtr address) + { + auto va = static_cast(address.ToUInt64()); + duint readSize = 0; + + uint8_t buf[15]; + if (!Script::Memory::Read(static_cast(va), buf, sizeof(buf), &readSize)) + return nullptr; + + return Internal::decodeInstruction(_decoder, buf, readSize, va); + } + + private: + + }; } // namespace Dotx64Dbg diff --git a/src/Bindings/Instruction.Operand.hpp b/src/Bindings/Instruction.Operand.hpp index 2991b14..baae338 100644 --- a/src/Bindings/Instruction.Operand.hpp +++ b/src/Bindings/Instruction.Operand.hpp @@ -172,15 +172,15 @@ namespace Dotx64Dbg { // Register ref class Register : public IOperand { - RegisterId _Value; + Registers::Id _Value; public: Register() { - _Value = RegisterId::None; + _Value = Registers::Id::None; } - Register(RegisterId reg) + Register(Registers::Id reg) { _Value = reg; } @@ -200,7 +200,7 @@ namespace Dotx64Dbg { { int get() { - return RegisterGetSize(_Value); + return Registers::GetSize(_Value); } } @@ -211,26 +211,26 @@ namespace Dotx64Dbg { { bool get() { - return _Value != RegisterId::None; + return _Value != Registers::Id::None; } } /// /// The register id. /// - property RegisterId Value + property Registers::Id Value { - RegisterId get() + Registers::Id get() { return _Value; } } - property RegisterClass Class + property Registers::Class Class { - RegisterClass get() + Registers::Class get() { - return RegisterGetClass(_Value); + return Registers::GetClass(_Value); } } @@ -243,10 +243,10 @@ namespace Dotx64Dbg { { switch (Class) { - case RegisterClass::Gp8: - case RegisterClass::Gp16: - case RegisterClass::Gp32: - case RegisterClass::Gp64: + case Registers::Class::Gp8: + case Registers::Class::Gp16: + case Registers::Class::Gp32: + case Registers::Class::Gp64: return true; } return false; @@ -257,11 +257,11 @@ namespace Dotx64Dbg { /// Retrieves the root register id, will be Register.None if none. /// If the register is ax it would result eax on 32 bit and rax on 64 bit. /// - property RegisterId RootId + property Registers::Id RootId { - RegisterId get() + Registers::Id get() { - return RegisterGetRoot(_Value); + return Registers::GetRoot(_Value); } } @@ -272,7 +272,7 @@ namespace Dotx64Dbg { { bool get() { - return RegisterGetRoot(_Value) != RegisterId::None; + return Registers::GetRoot(_Value) != Registers::Id::None; } } @@ -291,17 +291,17 @@ namespace Dotx64Dbg { /// Register^ GetRoot() { - return gcnew Register(RegisterGetRoot(_Value)); + return gcnew Register(Registers::GetRoot(_Value)); } /// /// Retrieves the parent register id, will be Register.None if none. /// - property RegisterId ParentId + property Registers::Id ParentId { - RegisterId get() + Registers::Id get() { - return RegisterGetParent(_Value); + return Registers::GetParent(_Value); } } @@ -312,7 +312,7 @@ namespace Dotx64Dbg { { bool get() { - return RegisterGetParent(_Value) != RegisterId::None; + return Registers::GetParent(_Value) != Registers::Id::None; } } @@ -332,7 +332,7 @@ namespace Dotx64Dbg { /// Register^ GetParent() { - return gcnew Register(RegisterGetParent(_Value)); + return gcnew Register(Registers::GetParent(_Value)); } /// @@ -351,7 +351,16 @@ namespace Dotx64Dbg { /// int GetPosition() { - return RegisterGetOffsetForRoot(_Value); + return Registers::GetOffsetForRoot(_Value); + } + + /// + /// Gets the index of the register within its category so for Gp it would be 0 to 15, Xmm 0 to 31 + /// + /// Index of register + int GetIndex() + { + return Registers::GetIndex(_Value); } /// @@ -374,7 +383,7 @@ namespace Dotx64Dbg { System::String^ ToString() override { - return gcnew System::String(RegisterGetName(_Value)); + return gcnew System::String(Registers::GetName(_Value)); } }; @@ -388,7 +397,7 @@ namespace Dotx64Dbg { { } - Memory(int size, RegisterId seg, RegisterId base, RegisterId index, int32_t scale, int64_t disp) + Memory(int size, Registers::Id seg, Registers::Id base, Registers::Id index, int32_t scale, int64_t disp) { Size = size; Segment = seg; @@ -398,10 +407,10 @@ namespace Dotx64Dbg { Displacement = disp; } - Memory(int size, RegisterId base, RegisterId index, int32_t scale, int64_t disp) + Memory(int size, Registers::Id base, Registers::Id index, int32_t scale, int64_t disp) { Size = size; - Segment = RegisterId::Ds; + Segment = Registers::Id::Ds; Base = base; Index = index; Scale = scale; @@ -428,13 +437,13 @@ namespace Dotx64Dbg { } } - property RegisterId Segment; - property RegisterId Base; - property RegisterId Index; + property Registers::Id Segment; + property Registers::Id Base; + property Registers::Id Index; property int32_t Scale; property int64_t Displacement; - Memory^ WithSegment(RegisterId reg) + Memory^ WithSegment(Registers::Id reg) { Segment = reg; return this; @@ -446,7 +455,7 @@ namespace Dotx64Dbg { return this; } - Memory^ WithBase(RegisterId reg) + Memory^ WithBase(Registers::Id reg) { Base = reg; return this; @@ -457,7 +466,7 @@ namespace Dotx64Dbg { return this; } - Memory^ WithIndex(RegisterId reg) + Memory^ WithIndex(Registers::Id reg) { Index = reg; return this; @@ -513,29 +522,29 @@ namespace Dotx64Dbg { break; } - if (Segment != RegisterId::Ds && Segment != RegisterId::Cs) + if (Segment != Registers::Id::Ds && Segment != Registers::Id::Cs) { - p += snprintf(temp + p, sizeof(temp) - p, "%s:", RegisterGetName(Segment)); + p += snprintf(temp + p, sizeof(temp) - p, "%s:", Registers::GetName(Segment)); } p += snprintf(temp + p, sizeof(temp) - p, "["); - if (Base != RegisterId::None) + if (Base != Registers::Id::None) { - p += snprintf(temp + p, sizeof(temp) - p, "%s", RegisterGetName(Base)); + p += snprintf(temp + p, sizeof(temp) - p, "%s", Registers::GetName(Base)); } - if (Index != RegisterId::None) + if (Index != Registers::Id::None) { - if (Base != RegisterId::None) + if (Base != Registers::Id::None) p += snprintf(temp + p, sizeof(temp) - p, "+"); - p += snprintf(temp + p, sizeof(temp) - p, "%s", RegisterGetName(Index)); + p += snprintf(temp + p, sizeof(temp) - p, "%s", Registers::GetName(Index)); } if (Scale > 0) { - if (Index != RegisterId::None) + if (Index != Registers::Id::None) p += snprintf(temp + p, sizeof(temp) - p, "*"); p += snprintf(temp + p, sizeof(temp) - p, "%d", Scale); @@ -544,7 +553,7 @@ namespace Dotx64Dbg { if (Displacement > 0) { auto val = Displacement; - if (Base != RegisterId::None || Index != RegisterId::None) + if (Base != Registers::Id::None || Index != Registers::Id::None) { if (val < 0) { diff --git a/src/Bindings/Instruction.Operands.hpp b/src/Bindings/Instruction.Operands.hpp index 53a7e24..ef3964e 100644 --- a/src/Bindings/Instruction.Operands.hpp +++ b/src/Bindings/Instruction.Operands.hpp @@ -27,28 +27,28 @@ namespace Dotx64Dbg { ////////////////////////////////////////////////////////////////////////// static Operand::Memory^ BytePtr(Int64 disp) { - return gcnew Operand::Memory(8, RegisterId::None, RegisterId::None, 0, disp); + return gcnew Operand::Memory(8, Registers::Id::None, Registers::Id::None, 0, disp); } - static Operand::Memory^ BytePtr(RegisterId baseReg) + static Operand::Memory^ BytePtr(Registers::Id baseReg) { - return gcnew Operand::Memory(8, baseReg, RegisterId::None, 0, 0); + return gcnew Operand::Memory(8, baseReg, Registers::Id::None, 0, 0); } static Operand::Memory^ BytePtr(Operand::Register^ baseReg) { - return gcnew Operand::Memory(8, baseReg->Value, RegisterId::None, 0, 0); + return gcnew Operand::Memory(8, baseReg->Value, Registers::Id::None, 0, 0); } - static Operand::Memory^ BytePtr(RegisterId baseReg, Int64 disp) + static Operand::Memory^ BytePtr(Registers::Id baseReg, Int64 disp) { - return gcnew Operand::Memory(8, baseReg, RegisterId::None, 0, disp); + return gcnew Operand::Memory(8, baseReg, Registers::Id::None, 0, disp); } static Operand::Memory^ BytePtr(Operand::Register^ baseReg, Int64 disp) { - return gcnew Operand::Memory(8, baseReg->Value, RegisterId::None, 0, disp); + return gcnew Operand::Memory(8, baseReg->Value, Registers::Id::None, 0, disp); } - static Operand::Memory^ BytePtr(RegisterId baseReg, RegisterId index) + static Operand::Memory^ BytePtr(Registers::Id baseReg, Registers::Id index) { return gcnew Operand::Memory(8, baseReg, index, 0, 0); } @@ -57,7 +57,7 @@ namespace Dotx64Dbg { return gcnew Operand::Memory(8, baseReg->Value, index->Value, 0, 0); } - static Operand::Memory^ BytePtr(RegisterId baseReg, RegisterId index, Int64 disp) + static Operand::Memory^ BytePtr(Registers::Id baseReg, Registers::Id index, Int64 disp) { return gcnew Operand::Memory(8, baseReg, index, 0, disp); } @@ -66,7 +66,7 @@ namespace Dotx64Dbg { return gcnew Operand::Memory(8, baseReg->Value, index->Value, 0, disp); } - static Operand::Memory^ BytePtr(RegisterId baseReg, RegisterId index, Int32 scale, Int64 disp) + static Operand::Memory^ BytePtr(Registers::Id baseReg, Registers::Id index, Int32 scale, Int64 disp) { return gcnew Operand::Memory(8, baseReg, index, scale, disp); } @@ -79,28 +79,28 @@ namespace Dotx64Dbg { ////////////////////////////////////////////////////////////////////////// static Operand::Memory^ WordPtr(Int64 disp) { - return gcnew Operand::Memory(16, RegisterId::None, RegisterId::None, 0, disp); + return gcnew Operand::Memory(16, Registers::Id::None, Registers::Id::None, 0, disp); } - static Operand::Memory^ WordPtr(RegisterId baseReg) + static Operand::Memory^ WordPtr(Registers::Id baseReg) { - return gcnew Operand::Memory(16, baseReg, RegisterId::None, 0, 0); + return gcnew Operand::Memory(16, baseReg, Registers::Id::None, 0, 0); } static Operand::Memory^ WordPtr(Operand::Register^ baseReg) { - return gcnew Operand::Memory(16, baseReg->Value, RegisterId::None, 0, 0); + return gcnew Operand::Memory(16, baseReg->Value, Registers::Id::None, 0, 0); } - static Operand::Memory^ WordPtr(RegisterId baseReg, Int64 disp) + static Operand::Memory^ WordPtr(Registers::Id baseReg, Int64 disp) { - return gcnew Operand::Memory(16, baseReg, RegisterId::None, 0, disp); + return gcnew Operand::Memory(16, baseReg, Registers::Id::None, 0, disp); } static Operand::Memory^ WordPtr(Operand::Register^ baseReg, Int64 disp) { - return gcnew Operand::Memory(16, baseReg->Value, RegisterId::None, 0, disp); + return gcnew Operand::Memory(16, baseReg->Value, Registers::Id::None, 0, disp); } - static Operand::Memory^ WordPtr(RegisterId baseReg, RegisterId index) + static Operand::Memory^ WordPtr(Registers::Id baseReg, Registers::Id index) { return gcnew Operand::Memory(16, baseReg, index, 0, 0); } @@ -109,7 +109,7 @@ namespace Dotx64Dbg { return gcnew Operand::Memory(16, baseReg->Value, index->Value, 0, 0); } - static Operand::Memory^ WordPtr(RegisterId baseReg, RegisterId index, Int64 disp) + static Operand::Memory^ WordPtr(Registers::Id baseReg, Registers::Id index, Int64 disp) { return gcnew Operand::Memory(16, baseReg, index, 0, disp); } @@ -118,7 +118,7 @@ namespace Dotx64Dbg { return gcnew Operand::Memory(16, baseReg->Value, index->Value, 0, disp); } - static Operand::Memory^ WordPtr(RegisterId baseReg, RegisterId index, Int32 scale, Int64 disp) + static Operand::Memory^ WordPtr(Registers::Id baseReg, Registers::Id index, Int32 scale, Int64 disp) { return gcnew Operand::Memory(16, baseReg, index, scale, disp); } @@ -131,28 +131,28 @@ namespace Dotx64Dbg { ////////////////////////////////////////////////////////////////////////// static Operand::Memory^ DwordPtr(Int64 disp) { - return gcnew Operand::Memory(32, RegisterId::None, RegisterId::None, 0, disp); + return gcnew Operand::Memory(32, Registers::Id::None, Registers::Id::None, 0, disp); } - static Operand::Memory^ DwordPtr(RegisterId baseReg) + static Operand::Memory^ DwordPtr(Registers::Id baseReg) { - return gcnew Operand::Memory(32, baseReg, RegisterId::None, 0, 0); + return gcnew Operand::Memory(32, baseReg, Registers::Id::None, 0, 0); } static Operand::Memory^ DwordPtr(Operand::Register^ baseReg) { - return gcnew Operand::Memory(32, baseReg->Value, RegisterId::None, 0, 0); + return gcnew Operand::Memory(32, baseReg->Value, Registers::Id::None, 0, 0); } - static Operand::Memory^ DwordPtr(RegisterId baseReg, Int64 disp) + static Operand::Memory^ DwordPtr(Registers::Id baseReg, Int64 disp) { - return gcnew Operand::Memory(32, baseReg, RegisterId::None, 0, disp); + return gcnew Operand::Memory(32, baseReg, Registers::Id::None, 0, disp); } static Operand::Memory^ DwordPtr(Operand::Register^ baseReg, Int64 disp) { - return gcnew Operand::Memory(32, baseReg->Value, RegisterId::None, 0, disp); + return gcnew Operand::Memory(32, baseReg->Value, Registers::Id::None, 0, disp); } - static Operand::Memory^ DwordPtr(RegisterId baseReg, RegisterId index) + static Operand::Memory^ DwordPtr(Registers::Id baseReg, Registers::Id index) { return gcnew Operand::Memory(32, baseReg, index, 0, 0); } @@ -161,7 +161,7 @@ namespace Dotx64Dbg { return gcnew Operand::Memory(32, baseReg->Value, index->Value, 0, 0); } - static Operand::Memory^ DwordPtr(RegisterId baseReg, RegisterId index, Int64 disp) + static Operand::Memory^ DwordPtr(Registers::Id baseReg, Registers::Id index, Int64 disp) { return gcnew Operand::Memory(32, baseReg, index, 0, disp); } @@ -170,7 +170,7 @@ namespace Dotx64Dbg { return gcnew Operand::Memory(32, baseReg->Value, index->Value, 0, disp); } - static Operand::Memory^ DwordPtr(RegisterId baseReg, RegisterId index, Int32 scale, Int64 disp) + static Operand::Memory^ DwordPtr(Registers::Id baseReg, Registers::Id index, Int32 scale, Int64 disp) { return gcnew Operand::Memory(32, baseReg, index, scale, disp); } @@ -183,27 +183,27 @@ namespace Dotx64Dbg { ////////////////////////////////////////////////////////////////////////// static Operand::Memory^ QwordPtr(Int64 disp) { - return gcnew Operand::Memory(64, RegisterId::None, RegisterId::None, 0, disp); + return gcnew Operand::Memory(64, Registers::Id::None, Registers::Id::None, 0, disp); } - static Operand::Memory^ QwordPtr(RegisterId baseReg) + static Operand::Memory^ QwordPtr(Registers::Id baseReg) { - return gcnew Operand::Memory(64, baseReg, RegisterId::None, 0, 0); + return gcnew Operand::Memory(64, baseReg, Registers::Id::None, 0, 0); } static Operand::Memory^ QwordPtr(Operand::Register^ baseReg) { - return gcnew Operand::Memory(64, baseReg->Value, RegisterId::None, 0, 0); + return gcnew Operand::Memory(64, baseReg->Value, Registers::Id::None, 0, 0); } - static Operand::Memory^ QwordPtr(RegisterId baseReg, Int64 disp) + static Operand::Memory^ QwordPtr(Registers::Id baseReg, Int64 disp) { - return gcnew Operand::Memory(64, baseReg, RegisterId::None, 0, disp); + return gcnew Operand::Memory(64, baseReg, Registers::Id::None, 0, disp); } static Operand::Memory^ QwordPtr(Operand::Register^ baseReg, Int64 disp) { - return gcnew Operand::Memory(64, baseReg->Value, RegisterId::None, 0, disp); + return gcnew Operand::Memory(64, baseReg->Value, Registers::Id::None, 0, disp); } - static Operand::Memory^ QwordPtr(RegisterId baseReg, RegisterId index) + static Operand::Memory^ QwordPtr(Registers::Id baseReg, Registers::Id index) { return gcnew Operand::Memory(64, baseReg, index, 0, 0); } @@ -212,7 +212,7 @@ namespace Dotx64Dbg { return gcnew Operand::Memory(64, baseReg->Value, index->Value, 0, 0); } - static Operand::Memory^ QwordPtr(RegisterId baseReg, RegisterId index, Int64 disp) + static Operand::Memory^ QwordPtr(Registers::Id baseReg, Registers::Id index, Int64 disp) { return gcnew Operand::Memory(64, baseReg, index, 0, disp); } @@ -221,7 +221,7 @@ namespace Dotx64Dbg { return gcnew Operand::Memory(64, baseReg->Value, index->Value, 0, disp); } - static Operand::Memory^ QwordPtr(RegisterId baseReg, RegisterId index, Int32 scale, Int64 disp) + static Operand::Memory^ QwordPtr(Registers::Id baseReg, Registers::Id index, Int32 scale, Int64 disp) { return gcnew Operand::Memory(64, baseReg, index, scale, disp); } @@ -234,27 +234,27 @@ namespace Dotx64Dbg { ////////////////////////////////////////////////////////////////////////// static Operand::Memory^ TwordPtr(Int64 disp) { - return gcnew Operand::Memory(80, RegisterId::None, RegisterId::None, 0, disp); + return gcnew Operand::Memory(80, Registers::Id::None, Registers::Id::None, 0, disp); } - static Operand::Memory^ TwordPtr(RegisterId baseReg) + static Operand::Memory^ TwordPtr(Registers::Id baseReg) { - return gcnew Operand::Memory(80, baseReg, RegisterId::None, 0, 0); + return gcnew Operand::Memory(80, baseReg, Registers::Id::None, 0, 0); } static Operand::Memory^ TwordPtr(Operand::Register^ baseReg) { - return gcnew Operand::Memory(80, baseReg->Value, RegisterId::None, 0, 0); + return gcnew Operand::Memory(80, baseReg->Value, Registers::Id::None, 0, 0); } - static Operand::Memory^ TwordPtr(RegisterId baseReg, Int64 disp) + static Operand::Memory^ TwordPtr(Registers::Id baseReg, Int64 disp) { - return gcnew Operand::Memory(80, baseReg, RegisterId::None, 0, disp); + return gcnew Operand::Memory(80, baseReg, Registers::Id::None, 0, disp); } static Operand::Memory^ TwordPtr(Operand::Register^ baseReg, Int64 disp) { - return gcnew Operand::Memory(80, baseReg->Value, RegisterId::None, 0, disp); + return gcnew Operand::Memory(80, baseReg->Value, Registers::Id::None, 0, disp); } - static Operand::Memory^ TwordPtr(RegisterId baseReg, RegisterId index) + static Operand::Memory^ TwordPtr(Registers::Id baseReg, Registers::Id index) { return gcnew Operand::Memory(80, baseReg, index, 0, 0); } @@ -263,7 +263,7 @@ namespace Dotx64Dbg { return gcnew Operand::Memory(80, baseReg->Value, index->Value, 0, 0); } - static Operand::Memory^ TwordPtr(RegisterId baseReg, RegisterId index, Int64 disp) + static Operand::Memory^ TwordPtr(Registers::Id baseReg, Registers::Id index, Int64 disp) { return gcnew Operand::Memory(80, baseReg, index, 0, disp); } @@ -272,7 +272,7 @@ namespace Dotx64Dbg { return gcnew Operand::Memory(80, baseReg->Value, index->Value, 0, disp); } - static Operand::Memory^ TwordPtr(RegisterId baseReg, RegisterId index, Int32 scale, Int64 disp) + static Operand::Memory^ TwordPtr(Registers::Id baseReg, Registers::Id index, Int32 scale, Int64 disp) { return gcnew Operand::Memory(80, baseReg, index, scale, disp); } @@ -285,27 +285,27 @@ namespace Dotx64Dbg { ////////////////////////////////////////////////////////////////////////// static Operand::Memory^ XmmwordPtr(Int64 disp) { - return gcnew Operand::Memory(128, RegisterId::None, RegisterId::None, 0, disp); + return gcnew Operand::Memory(128, Registers::Id::None, Registers::Id::None, 0, disp); } - static Operand::Memory^ XmmwordPtr(RegisterId baseReg) + static Operand::Memory^ XmmwordPtr(Registers::Id baseReg) { - return gcnew Operand::Memory(128, baseReg, RegisterId::None, 0, 0); + return gcnew Operand::Memory(128, baseReg, Registers::Id::None, 0, 0); } static Operand::Memory^ XmmwordPtr(Operand::Register^ baseReg) { - return gcnew Operand::Memory(128, baseReg->Value, RegisterId::None, 0, 0); + return gcnew Operand::Memory(128, baseReg->Value, Registers::Id::None, 0, 0); } - static Operand::Memory^ XmmwordPtr(RegisterId baseReg, Int64 disp) + static Operand::Memory^ XmmwordPtr(Registers::Id baseReg, Int64 disp) { - return gcnew Operand::Memory(128, baseReg, RegisterId::None, 0, disp); + return gcnew Operand::Memory(128, baseReg, Registers::Id::None, 0, disp); } static Operand::Memory^ XmmwordPtr(Operand::Register^ baseReg, Int64 disp) { - return gcnew Operand::Memory(128, baseReg->Value, RegisterId::None, 0, disp); + return gcnew Operand::Memory(128, baseReg->Value, Registers::Id::None, 0, disp); } - static Operand::Memory^ XmmwordPtr(RegisterId baseReg, RegisterId index) + static Operand::Memory^ XmmwordPtr(Registers::Id baseReg, Registers::Id index) { return gcnew Operand::Memory(128, baseReg, index, 0, 0); } @@ -314,7 +314,7 @@ namespace Dotx64Dbg { return gcnew Operand::Memory(128, baseReg->Value, index->Value, 0, 0); } - static Operand::Memory^ XmmwordPtr(RegisterId baseReg, RegisterId index, Int64 disp) + static Operand::Memory^ XmmwordPtr(Registers::Id baseReg, Registers::Id index, Int64 disp) { return gcnew Operand::Memory(128, baseReg, index, 0, disp); } @@ -323,7 +323,7 @@ namespace Dotx64Dbg { return gcnew Operand::Memory(128, baseReg->Value, index->Value, 0, disp); } - static Operand::Memory^ XmmwordPtr(RegisterId baseReg, RegisterId index, Int32 scale, Int64 disp) + static Operand::Memory^ XmmwordPtr(Registers::Id baseReg, Registers::Id index, Int32 scale, Int64 disp) { return gcnew Operand::Memory(128, baseReg, index, scale, disp); } @@ -336,27 +336,27 @@ namespace Dotx64Dbg { ////////////////////////////////////////////////////////////////////////// static Operand::Memory^ YmmwordPtr(Int64 disp) { - return gcnew Operand::Memory(256, RegisterId::None, RegisterId::None, 0, disp); + return gcnew Operand::Memory(256, Registers::Id::None, Registers::Id::None, 0, disp); } - static Operand::Memory^ YmmwordPtr(RegisterId baseReg) + static Operand::Memory^ YmmwordPtr(Registers::Id baseReg) { - return gcnew Operand::Memory(256, baseReg, RegisterId::None, 0, 0); + return gcnew Operand::Memory(256, baseReg, Registers::Id::None, 0, 0); } static Operand::Memory^ YmmwordPtr(Operand::Register^ baseReg) { - return gcnew Operand::Memory(256, baseReg->Value, RegisterId::None, 0, 0); + return gcnew Operand::Memory(256, baseReg->Value, Registers::Id::None, 0, 0); } - static Operand::Memory^ YmmwordPtr(RegisterId baseReg, Int64 disp) + static Operand::Memory^ YmmwordPtr(Registers::Id baseReg, Int64 disp) { - return gcnew Operand::Memory(256, baseReg, RegisterId::None, 0, disp); + return gcnew Operand::Memory(256, baseReg, Registers::Id::None, 0, disp); } static Operand::Memory^ YmmwordPtr(Operand::Register^ baseReg, Int64 disp) { - return gcnew Operand::Memory(256, baseReg->Value, RegisterId::None, 0, disp); + return gcnew Operand::Memory(256, baseReg->Value, Registers::Id::None, 0, disp); } - static Operand::Memory^ YmmwordPtr(RegisterId baseReg, RegisterId index) + static Operand::Memory^ YmmwordPtr(Registers::Id baseReg, Registers::Id index) { return gcnew Operand::Memory(256, baseReg, index, 0, 0); } @@ -365,7 +365,7 @@ namespace Dotx64Dbg { return gcnew Operand::Memory(256, baseReg->Value, index->Value, 0, 0); } - static Operand::Memory^ YmmwordPtr(RegisterId baseReg, RegisterId index, Int64 disp) + static Operand::Memory^ YmmwordPtr(Registers::Id baseReg, Registers::Id index, Int64 disp) { return gcnew Operand::Memory(256, baseReg, index, 0, disp); } @@ -374,7 +374,7 @@ namespace Dotx64Dbg { return gcnew Operand::Memory(256, baseReg->Value, index->Value, 0, disp); } - static Operand::Memory^ YmmwordPtr(RegisterId baseReg, RegisterId index, Int32 scale, Int64 disp) + static Operand::Memory^ YmmwordPtr(Registers::Id baseReg, Registers::Id index, Int32 scale, Int64 disp) { return gcnew Operand::Memory(256, baseReg, index, scale, disp); } @@ -387,27 +387,27 @@ namespace Dotx64Dbg { ////////////////////////////////////////////////////////////////////////// static Operand::Memory^ ZmmwordPtr(Int64 disp) { - return gcnew Operand::Memory(512, RegisterId::None, RegisterId::None, 0, disp); + return gcnew Operand::Memory(512, Registers::Id::None, Registers::Id::None, 0, disp); } - static Operand::Memory^ ZmmwordPtr(RegisterId baseReg) + static Operand::Memory^ ZmmwordPtr(Registers::Id baseReg) { - return gcnew Operand::Memory(512, baseReg, RegisterId::None, 0, 0); + return gcnew Operand::Memory(512, baseReg, Registers::Id::None, 0, 0); } static Operand::Memory^ ZmmwordPtr(Operand::Register^ baseReg) { - return gcnew Operand::Memory(512, baseReg->Value, RegisterId::None, 0, 0); + return gcnew Operand::Memory(512, baseReg->Value, Registers::Id::None, 0, 0); } - static Operand::Memory^ ZmmwordPtr(RegisterId baseReg, Int64 disp) + static Operand::Memory^ ZmmwordPtr(Registers::Id baseReg, Int64 disp) { - return gcnew Operand::Memory(512, baseReg, RegisterId::None, 0, disp); + return gcnew Operand::Memory(512, baseReg, Registers::Id::None, 0, disp); } static Operand::Memory^ ZmmwordPtr(Operand::Register^ baseReg, Int64 disp) { - return gcnew Operand::Memory(512, baseReg->Value, RegisterId::None, 0, disp); + return gcnew Operand::Memory(512, baseReg->Value, Registers::Id::None, 0, disp); } - static Operand::Memory^ ZmmwordPtr(RegisterId baseReg, RegisterId index) + static Operand::Memory^ ZmmwordPtr(Registers::Id baseReg, Registers::Id index) { return gcnew Operand::Memory(512, baseReg, index, 0, 0); } @@ -416,7 +416,7 @@ namespace Dotx64Dbg { return gcnew Operand::Memory(512, baseReg->Value, index->Value, 0, 0); } - static Operand::Memory^ ZmmwordPtr(RegisterId baseReg, RegisterId index, Int64 disp) + static Operand::Memory^ ZmmwordPtr(Registers::Id baseReg, Registers::Id index, Int64 disp) { return gcnew Operand::Memory(512, baseReg, index, 0, disp); } @@ -425,7 +425,7 @@ namespace Dotx64Dbg { return gcnew Operand::Memory(512, baseReg->Value, index->Value, 0, disp); } - static Operand::Memory^ ZmmwordPtr(RegisterId baseReg, RegisterId index, Int32 scale, Int64 disp) + static Operand::Memory^ ZmmwordPtr(Registers::Id baseReg, Registers::Id index, Int32 scale, Int64 disp) { return gcnew Operand::Memory(512, baseReg, index, scale, disp); } @@ -438,27 +438,27 @@ namespace Dotx64Dbg { ////////////////////////////////////////////////////////////////////////// static Operand::Memory^ Ptr(Int64 disp) { - return gcnew Operand::Memory(AddressSize(), RegisterId::None, RegisterId::None, 0, disp); + return gcnew Operand::Memory(AddressSize(), Registers::Id::None, Registers::Id::None, 0, disp); } - static Operand::Memory^ Ptr(RegisterId baseReg) + static Operand::Memory^ Ptr(Registers::Id baseReg) { - return gcnew Operand::Memory(AddressSize(), baseReg, RegisterId::None, 0, 0); + return gcnew Operand::Memory(AddressSize(), baseReg, Registers::Id::None, 0, 0); } static Operand::Memory^ Ptr(Operand::Register^ baseReg) { - return gcnew Operand::Memory(AddressSize(), baseReg->Value, RegisterId::None, 0, 0); + return gcnew Operand::Memory(AddressSize(), baseReg->Value, Registers::Id::None, 0, 0); } - static Operand::Memory^ Ptr(RegisterId baseReg, Int64 disp) + static Operand::Memory^ Ptr(Registers::Id baseReg, Int64 disp) { - return gcnew Operand::Memory(AddressSize(), baseReg, RegisterId::None, 0, disp); + return gcnew Operand::Memory(AddressSize(), baseReg, Registers::Id::None, 0, disp); } static Operand::Memory^ Ptr(Operand::Register^ baseReg, Int64 disp) { - return gcnew Operand::Memory(AddressSize(), baseReg->Value, RegisterId::None, 0, disp); + return gcnew Operand::Memory(AddressSize(), baseReg->Value, Registers::Id::None, 0, disp); } - static Operand::Memory^ Ptr(RegisterId baseReg, RegisterId index) + static Operand::Memory^ Ptr(Registers::Id baseReg, Registers::Id index) { return gcnew Operand::Memory(AddressSize(), baseReg, index, 0, 0); } @@ -467,7 +467,7 @@ namespace Dotx64Dbg { return gcnew Operand::Memory(AddressSize(), baseReg->Value, index->Value, 0, 0); } - static Operand::Memory^ Ptr(RegisterId baseReg, RegisterId index, Int64 disp) + static Operand::Memory^ Ptr(Registers::Id baseReg, Registers::Id index, Int64 disp) { return gcnew Operand::Memory(AddressSize(), baseReg, index, 0, disp); } @@ -476,7 +476,7 @@ namespace Dotx64Dbg { return gcnew Operand::Memory(AddressSize(), baseReg->Value, index->Value, 0, disp); } - static Operand::Memory^ Ptr(RegisterId baseReg, RegisterId index, Int32 scale, Int64 disp) + static Operand::Memory^ Ptr(Registers::Id baseReg, Registers::Id index, Int32 scale, Int64 disp) { return gcnew Operand::Memory(AddressSize(), baseReg, index, scale, disp); } @@ -487,300 +487,300 @@ namespace Dotx64Dbg { public: // General purpose registers 8-bit - static initonly Operand::Register^ Al = gcnew Operand::Register(RegisterId::Al); - static initonly Operand::Register^ Cl = gcnew Operand::Register(RegisterId::Cl); - static initonly Operand::Register^ Dl = gcnew Operand::Register(RegisterId::Dl); - static initonly Operand::Register^ Bl = gcnew Operand::Register(RegisterId::Bl); - static initonly Operand::Register^ Ah = gcnew Operand::Register(RegisterId::Ah); - static initonly Operand::Register^ Ch = gcnew Operand::Register(RegisterId::Ch); - static initonly Operand::Register^ Dh = gcnew Operand::Register(RegisterId::Dh); - static initonly Operand::Register^ Bh = gcnew Operand::Register(RegisterId::Bh); - static initonly Operand::Register^ Spl = gcnew Operand::Register(RegisterId::Spl); - static initonly Operand::Register^ Bpl = gcnew Operand::Register(RegisterId::Bpl); - static initonly Operand::Register^ Sil = gcnew Operand::Register(RegisterId::Sil); - static initonly Operand::Register^ Dil = gcnew Operand::Register(RegisterId::Dil); + static initonly Operand::Register^ Al = gcnew Operand::Register(Registers::Id::Al); + static initonly Operand::Register^ Cl = gcnew Operand::Register(Registers::Id::Cl); + static initonly Operand::Register^ Dl = gcnew Operand::Register(Registers::Id::Dl); + static initonly Operand::Register^ Bl = gcnew Operand::Register(Registers::Id::Bl); + static initonly Operand::Register^ Ah = gcnew Operand::Register(Registers::Id::Ah); + static initonly Operand::Register^ Ch = gcnew Operand::Register(Registers::Id::Ch); + static initonly Operand::Register^ Dh = gcnew Operand::Register(Registers::Id::Dh); + static initonly Operand::Register^ Bh = gcnew Operand::Register(Registers::Id::Bh); + static initonly Operand::Register^ Spl = gcnew Operand::Register(Registers::Id::Spl); + static initonly Operand::Register^ Bpl = gcnew Operand::Register(Registers::Id::Bpl); + static initonly Operand::Register^ Sil = gcnew Operand::Register(Registers::Id::Sil); + static initonly Operand::Register^ Dil = gcnew Operand::Register(Registers::Id::Dil); #if _M_X64 - static initonly Operand::Register^ R8b = gcnew Operand::Register(RegisterId::R8b); - static initonly Operand::Register^ R9b = gcnew Operand::Register(RegisterId::R9b); - static initonly Operand::Register^ R10b = gcnew Operand::Register(RegisterId::R10b); - static initonly Operand::Register^ R11b = gcnew Operand::Register(RegisterId::R11b); - static initonly Operand::Register^ R12b = gcnew Operand::Register(RegisterId::R12b); - static initonly Operand::Register^ R13b = gcnew Operand::Register(RegisterId::R13b); - static initonly Operand::Register^ R14b = gcnew Operand::Register(RegisterId::R14b); - static initonly Operand::Register^ R15b = gcnew Operand::Register(RegisterId::R15b); + static initonly Operand::Register^ R8b = gcnew Operand::Register(Registers::Id::R8b); + static initonly Operand::Register^ R9b = gcnew Operand::Register(Registers::Id::R9b); + static initonly Operand::Register^ R10b = gcnew Operand::Register(Registers::Id::R10b); + static initonly Operand::Register^ R11b = gcnew Operand::Register(Registers::Id::R11b); + static initonly Operand::Register^ R12b = gcnew Operand::Register(Registers::Id::R12b); + static initonly Operand::Register^ R13b = gcnew Operand::Register(Registers::Id::R13b); + static initonly Operand::Register^ R14b = gcnew Operand::Register(Registers::Id::R14b); + static initonly Operand::Register^ R15b = gcnew Operand::Register(Registers::Id::R15b); #endif // General purpose registers 16-bit - static initonly Operand::Register^ Ax = gcnew Operand::Register(RegisterId::Ax); - static initonly Operand::Register^ Cx = gcnew Operand::Register(RegisterId::Cx); - static initonly Operand::Register^ Dx = gcnew Operand::Register(RegisterId::Dx); - static initonly Operand::Register^ Bx = gcnew Operand::Register(RegisterId::Bx); - static initonly Operand::Register^ Sp = gcnew Operand::Register(RegisterId::Sp); - static initonly Operand::Register^ Bp = gcnew Operand::Register(RegisterId::Bp); - static initonly Operand::Register^ Si = gcnew Operand::Register(RegisterId::Si); - static initonly Operand::Register^ Di = gcnew Operand::Register(RegisterId::Di); + static initonly Operand::Register^ Ax = gcnew Operand::Register(Registers::Id::Ax); + static initonly Operand::Register^ Cx = gcnew Operand::Register(Registers::Id::Cx); + static initonly Operand::Register^ Dx = gcnew Operand::Register(Registers::Id::Dx); + static initonly Operand::Register^ Bx = gcnew Operand::Register(Registers::Id::Bx); + static initonly Operand::Register^ Sp = gcnew Operand::Register(Registers::Id::Sp); + static initonly Operand::Register^ Bp = gcnew Operand::Register(Registers::Id::Bp); + static initonly Operand::Register^ Si = gcnew Operand::Register(Registers::Id::Si); + static initonly Operand::Register^ Di = gcnew Operand::Register(Registers::Id::Di); #if _M_X64 - static initonly Operand::Register^ R8w = gcnew Operand::Register(RegisterId::R8w); - static initonly Operand::Register^ R9w = gcnew Operand::Register(RegisterId::R9w); - static initonly Operand::Register^ R10w = gcnew Operand::Register(RegisterId::R10w); - static initonly Operand::Register^ R11w = gcnew Operand::Register(RegisterId::R11w); - static initonly Operand::Register^ R12w = gcnew Operand::Register(RegisterId::R12w); - static initonly Operand::Register^ R13w = gcnew Operand::Register(RegisterId::R13w); - static initonly Operand::Register^ R14w = gcnew Operand::Register(RegisterId::R14w); - static initonly Operand::Register^ R15w = gcnew Operand::Register(RegisterId::R15w); + static initonly Operand::Register^ R8w = gcnew Operand::Register(Registers::Id::R8w); + static initonly Operand::Register^ R9w = gcnew Operand::Register(Registers::Id::R9w); + static initonly Operand::Register^ R10w = gcnew Operand::Register(Registers::Id::R10w); + static initonly Operand::Register^ R11w = gcnew Operand::Register(Registers::Id::R11w); + static initonly Operand::Register^ R12w = gcnew Operand::Register(Registers::Id::R12w); + static initonly Operand::Register^ R13w = gcnew Operand::Register(Registers::Id::R13w); + static initonly Operand::Register^ R14w = gcnew Operand::Register(Registers::Id::R14w); + static initonly Operand::Register^ R15w = gcnew Operand::Register(Registers::Id::R15w); #endif // General purpose registers 32-bit - static initonly Operand::Register^ Eax = gcnew Operand::Register(RegisterId::Eax); - static initonly Operand::Register^ Ecx = gcnew Operand::Register(RegisterId::Ecx); - static initonly Operand::Register^ Edx = gcnew Operand::Register(RegisterId::Edx); - static initonly Operand::Register^ Ebx = gcnew Operand::Register(RegisterId::Ebx); - static initonly Operand::Register^ Esp = gcnew Operand::Register(RegisterId::Esp); - static initonly Operand::Register^ Ebp = gcnew Operand::Register(RegisterId::Ebp); - static initonly Operand::Register^ Esi = gcnew Operand::Register(RegisterId::Esi); - static initonly Operand::Register^ Edi = gcnew Operand::Register(RegisterId::Edi); - static initonly Operand::Register^ R8d = gcnew Operand::Register(RegisterId::R8d); - static initonly Operand::Register^ R9d = gcnew Operand::Register(RegisterId::R9d); - static initonly Operand::Register^ R10d = gcnew Operand::Register(RegisterId::R10d); - static initonly Operand::Register^ R11d = gcnew Operand::Register(RegisterId::R11d); - static initonly Operand::Register^ R12d = gcnew Operand::Register(RegisterId::R12d); - static initonly Operand::Register^ R13d = gcnew Operand::Register(RegisterId::R13d); - static initonly Operand::Register^ R14d = gcnew Operand::Register(RegisterId::R14d); - static initonly Operand::Register^ R15d = gcnew Operand::Register(RegisterId::R15d); + static initonly Operand::Register^ Eax = gcnew Operand::Register(Registers::Id::Eax); + static initonly Operand::Register^ Ecx = gcnew Operand::Register(Registers::Id::Ecx); + static initonly Operand::Register^ Edx = gcnew Operand::Register(Registers::Id::Edx); + static initonly Operand::Register^ Ebx = gcnew Operand::Register(Registers::Id::Ebx); + static initonly Operand::Register^ Esp = gcnew Operand::Register(Registers::Id::Esp); + static initonly Operand::Register^ Ebp = gcnew Operand::Register(Registers::Id::Ebp); + static initonly Operand::Register^ Esi = gcnew Operand::Register(Registers::Id::Esi); + static initonly Operand::Register^ Edi = gcnew Operand::Register(Registers::Id::Edi); + static initonly Operand::Register^ R8d = gcnew Operand::Register(Registers::Id::R8d); + static initonly Operand::Register^ R9d = gcnew Operand::Register(Registers::Id::R9d); + static initonly Operand::Register^ R10d = gcnew Operand::Register(Registers::Id::R10d); + static initonly Operand::Register^ R11d = gcnew Operand::Register(Registers::Id::R11d); + static initonly Operand::Register^ R12d = gcnew Operand::Register(Registers::Id::R12d); + static initonly Operand::Register^ R13d = gcnew Operand::Register(Registers::Id::R13d); + static initonly Operand::Register^ R14d = gcnew Operand::Register(Registers::Id::R14d); + static initonly Operand::Register^ R15d = gcnew Operand::Register(Registers::Id::R15d); #if _M_X64 // General purpose registers 64-bit - static initonly Operand::Register^ Rax = gcnew Operand::Register(RegisterId::Rax); - static initonly Operand::Register^ Rcx = gcnew Operand::Register(RegisterId::Rcx); - static initonly Operand::Register^ Rdx = gcnew Operand::Register(RegisterId::Rdx); - static initonly Operand::Register^ Rbx = gcnew Operand::Register(RegisterId::Rbx); - static initonly Operand::Register^ Rsp = gcnew Operand::Register(RegisterId::Rsp); - static initonly Operand::Register^ Rbp = gcnew Operand::Register(RegisterId::Rbp); - static initonly Operand::Register^ Rsi = gcnew Operand::Register(RegisterId::Rsi); - static initonly Operand::Register^ Rdi = gcnew Operand::Register(RegisterId::Rdi); - static initonly Operand::Register^ R8 = gcnew Operand::Register(RegisterId::R8); - static initonly Operand::Register^ R9 = gcnew Operand::Register(RegisterId::R9); - static initonly Operand::Register^ R10 = gcnew Operand::Register(RegisterId::R10); - static initonly Operand::Register^ R11 = gcnew Operand::Register(RegisterId::R11); - static initonly Operand::Register^ R12 = gcnew Operand::Register(RegisterId::R12); - static initonly Operand::Register^ R13 = gcnew Operand::Register(RegisterId::R13); - static initonly Operand::Register^ R14 = gcnew Operand::Register(RegisterId::R14); - static initonly Operand::Register^ R15 = gcnew Operand::Register(RegisterId::R15); + static initonly Operand::Register^ Rax = gcnew Operand::Register(Registers::Id::Rax); + static initonly Operand::Register^ Rcx = gcnew Operand::Register(Registers::Id::Rcx); + static initonly Operand::Register^ Rdx = gcnew Operand::Register(Registers::Id::Rdx); + static initonly Operand::Register^ Rbx = gcnew Operand::Register(Registers::Id::Rbx); + static initonly Operand::Register^ Rsp = gcnew Operand::Register(Registers::Id::Rsp); + static initonly Operand::Register^ Rbp = gcnew Operand::Register(Registers::Id::Rbp); + static initonly Operand::Register^ Rsi = gcnew Operand::Register(Registers::Id::Rsi); + static initonly Operand::Register^ Rdi = gcnew Operand::Register(Registers::Id::Rdi); + static initonly Operand::Register^ R8 = gcnew Operand::Register(Registers::Id::R8); + static initonly Operand::Register^ R9 = gcnew Operand::Register(Registers::Id::R9); + static initonly Operand::Register^ R10 = gcnew Operand::Register(Registers::Id::R10); + static initonly Operand::Register^ R11 = gcnew Operand::Register(Registers::Id::R11); + static initonly Operand::Register^ R12 = gcnew Operand::Register(Registers::Id::R12); + static initonly Operand::Register^ R13 = gcnew Operand::Register(Registers::Id::R13); + static initonly Operand::Register^ R14 = gcnew Operand::Register(Registers::Id::R14); + static initonly Operand::Register^ R15 = gcnew Operand::Register(Registers::Id::R15); #endif // Floating point legacy registers - static initonly Operand::Register^ St0 = gcnew Operand::Register(RegisterId::St0); - static initonly Operand::Register^ St1 = gcnew Operand::Register(RegisterId::St1); - static initonly Operand::Register^ St2 = gcnew Operand::Register(RegisterId::St2); - static initonly Operand::Register^ St3 = gcnew Operand::Register(RegisterId::St3); - static initonly Operand::Register^ St4 = gcnew Operand::Register(RegisterId::St4); - static initonly Operand::Register^ St5 = gcnew Operand::Register(RegisterId::St5); - static initonly Operand::Register^ St6 = gcnew Operand::Register(RegisterId::St6); - static initonly Operand::Register^ St7 = gcnew Operand::Register(RegisterId::St7); - static initonly Operand::Register^ X87Control = gcnew Operand::Register(RegisterId::X87Control); - static initonly Operand::Register^ X87Status = gcnew Operand::Register(RegisterId::X87Status); - static initonly Operand::Register^ X87Tag = gcnew Operand::Register(RegisterId::X87Tag); + static initonly Operand::Register^ St0 = gcnew Operand::Register(Registers::Id::St0); + static initonly Operand::Register^ St1 = gcnew Operand::Register(Registers::Id::St1); + static initonly Operand::Register^ St2 = gcnew Operand::Register(Registers::Id::St2); + static initonly Operand::Register^ St3 = gcnew Operand::Register(Registers::Id::St3); + static initonly Operand::Register^ St4 = gcnew Operand::Register(Registers::Id::St4); + static initonly Operand::Register^ St5 = gcnew Operand::Register(Registers::Id::St5); + static initonly Operand::Register^ St6 = gcnew Operand::Register(Registers::Id::St6); + static initonly Operand::Register^ St7 = gcnew Operand::Register(Registers::Id::St7); + static initonly Operand::Register^ X87Control = gcnew Operand::Register(Registers::Id::X87Control); + static initonly Operand::Register^ X87Status = gcnew Operand::Register(Registers::Id::X87Status); + static initonly Operand::Register^ X87Tag = gcnew Operand::Register(Registers::Id::X87Tag); // Floating point multimedia registers - static initonly Operand::Register^ Mm0 = gcnew Operand::Register(RegisterId::Mm0); - static initonly Operand::Register^ Mm1 = gcnew Operand::Register(RegisterId::Mm1); - static initonly Operand::Register^ Mm2 = gcnew Operand::Register(RegisterId::Mm2); - static initonly Operand::Register^ Mm3 = gcnew Operand::Register(RegisterId::Mm3); - static initonly Operand::Register^ Mm4 = gcnew Operand::Register(RegisterId::Mm4); - static initonly Operand::Register^ Mm5 = gcnew Operand::Register(RegisterId::Mm5); - static initonly Operand::Register^ Mm6 = gcnew Operand::Register(RegisterId::Mm6); - static initonly Operand::Register^ Mm7 = gcnew Operand::Register(RegisterId::Mm7); + static initonly Operand::Register^ Mm0 = gcnew Operand::Register(Registers::Id::Mm0); + static initonly Operand::Register^ Mm1 = gcnew Operand::Register(Registers::Id::Mm1); + static initonly Operand::Register^ Mm2 = gcnew Operand::Register(Registers::Id::Mm2); + static initonly Operand::Register^ Mm3 = gcnew Operand::Register(Registers::Id::Mm3); + static initonly Operand::Register^ Mm4 = gcnew Operand::Register(Registers::Id::Mm4); + static initonly Operand::Register^ Mm5 = gcnew Operand::Register(Registers::Id::Mm5); + static initonly Operand::Register^ Mm6 = gcnew Operand::Register(Registers::Id::Mm6); + static initonly Operand::Register^ Mm7 = gcnew Operand::Register(Registers::Id::Mm7); // Floating point vector registers 128-bit - static initonly Operand::Register^ Xmm0 = gcnew Operand::Register(RegisterId::Xmm0); - static initonly Operand::Register^ Xmm1 = gcnew Operand::Register(RegisterId::Xmm1); - static initonly Operand::Register^ Xmm2 = gcnew Operand::Register(RegisterId::Xmm2); - static initonly Operand::Register^ Xmm3 = gcnew Operand::Register(RegisterId::Xmm3); - static initonly Operand::Register^ Xmm4 = gcnew Operand::Register(RegisterId::Xmm4); - static initonly Operand::Register^ Xmm5 = gcnew Operand::Register(RegisterId::Xmm5); - static initonly Operand::Register^ Xmm6 = gcnew Operand::Register(RegisterId::Xmm6); - static initonly Operand::Register^ Xmm7 = gcnew Operand::Register(RegisterId::Xmm7); - static initonly Operand::Register^ Xmm8 = gcnew Operand::Register(RegisterId::Xmm8); - static initonly Operand::Register^ Xmm9 = gcnew Operand::Register(RegisterId::Xmm9); - static initonly Operand::Register^ Xmm10 = gcnew Operand::Register(RegisterId::Xmm10); - static initonly Operand::Register^ Xmm11 = gcnew Operand::Register(RegisterId::Xmm11); - static initonly Operand::Register^ Xmm12 = gcnew Operand::Register(RegisterId::Xmm12); - static initonly Operand::Register^ Xmm13 = gcnew Operand::Register(RegisterId::Xmm13); - static initonly Operand::Register^ Xmm14 = gcnew Operand::Register(RegisterId::Xmm14); - static initonly Operand::Register^ Xmm15 = gcnew Operand::Register(RegisterId::Xmm15); - static initonly Operand::Register^ Xmm16 = gcnew Operand::Register(RegisterId::Xmm16); - static initonly Operand::Register^ Xmm17 = gcnew Operand::Register(RegisterId::Xmm17); - static initonly Operand::Register^ Xmm18 = gcnew Operand::Register(RegisterId::Xmm18); - static initonly Operand::Register^ Xmm19 = gcnew Operand::Register(RegisterId::Xmm19); - static initonly Operand::Register^ Xmm20 = gcnew Operand::Register(RegisterId::Xmm20); - static initonly Operand::Register^ Xmm21 = gcnew Operand::Register(RegisterId::Xmm21); - static initonly Operand::Register^ Xmm22 = gcnew Operand::Register(RegisterId::Xmm22); - static initonly Operand::Register^ Xmm23 = gcnew Operand::Register(RegisterId::Xmm23); - static initonly Operand::Register^ Xmm24 = gcnew Operand::Register(RegisterId::Xmm24); - static initonly Operand::Register^ Xmm25 = gcnew Operand::Register(RegisterId::Xmm25); - static initonly Operand::Register^ Xmm26 = gcnew Operand::Register(RegisterId::Xmm26); - static initonly Operand::Register^ Xmm27 = gcnew Operand::Register(RegisterId::Xmm27); - static initonly Operand::Register^ Xmm28 = gcnew Operand::Register(RegisterId::Xmm28); - static initonly Operand::Register^ Xmm29 = gcnew Operand::Register(RegisterId::Xmm29); - static initonly Operand::Register^ Xmm30 = gcnew Operand::Register(RegisterId::Xmm30); - static initonly Operand::Register^ Xmm31 = gcnew Operand::Register(RegisterId::Xmm31); + static initonly Operand::Register^ Xmm0 = gcnew Operand::Register(Registers::Id::Xmm0); + static initonly Operand::Register^ Xmm1 = gcnew Operand::Register(Registers::Id::Xmm1); + static initonly Operand::Register^ Xmm2 = gcnew Operand::Register(Registers::Id::Xmm2); + static initonly Operand::Register^ Xmm3 = gcnew Operand::Register(Registers::Id::Xmm3); + static initonly Operand::Register^ Xmm4 = gcnew Operand::Register(Registers::Id::Xmm4); + static initonly Operand::Register^ Xmm5 = gcnew Operand::Register(Registers::Id::Xmm5); + static initonly Operand::Register^ Xmm6 = gcnew Operand::Register(Registers::Id::Xmm6); + static initonly Operand::Register^ Xmm7 = gcnew Operand::Register(Registers::Id::Xmm7); + static initonly Operand::Register^ Xmm8 = gcnew Operand::Register(Registers::Id::Xmm8); + static initonly Operand::Register^ Xmm9 = gcnew Operand::Register(Registers::Id::Xmm9); + static initonly Operand::Register^ Xmm10 = gcnew Operand::Register(Registers::Id::Xmm10); + static initonly Operand::Register^ Xmm11 = gcnew Operand::Register(Registers::Id::Xmm11); + static initonly Operand::Register^ Xmm12 = gcnew Operand::Register(Registers::Id::Xmm12); + static initonly Operand::Register^ Xmm13 = gcnew Operand::Register(Registers::Id::Xmm13); + static initonly Operand::Register^ Xmm14 = gcnew Operand::Register(Registers::Id::Xmm14); + static initonly Operand::Register^ Xmm15 = gcnew Operand::Register(Registers::Id::Xmm15); + static initonly Operand::Register^ Xmm16 = gcnew Operand::Register(Registers::Id::Xmm16); + static initonly Operand::Register^ Xmm17 = gcnew Operand::Register(Registers::Id::Xmm17); + static initonly Operand::Register^ Xmm18 = gcnew Operand::Register(Registers::Id::Xmm18); + static initonly Operand::Register^ Xmm19 = gcnew Operand::Register(Registers::Id::Xmm19); + static initonly Operand::Register^ Xmm20 = gcnew Operand::Register(Registers::Id::Xmm20); + static initonly Operand::Register^ Xmm21 = gcnew Operand::Register(Registers::Id::Xmm21); + static initonly Operand::Register^ Xmm22 = gcnew Operand::Register(Registers::Id::Xmm22); + static initonly Operand::Register^ Xmm23 = gcnew Operand::Register(Registers::Id::Xmm23); + static initonly Operand::Register^ Xmm24 = gcnew Operand::Register(Registers::Id::Xmm24); + static initonly Operand::Register^ Xmm25 = gcnew Operand::Register(Registers::Id::Xmm25); + static initonly Operand::Register^ Xmm26 = gcnew Operand::Register(Registers::Id::Xmm26); + static initonly Operand::Register^ Xmm27 = gcnew Operand::Register(Registers::Id::Xmm27); + static initonly Operand::Register^ Xmm28 = gcnew Operand::Register(Registers::Id::Xmm28); + static initonly Operand::Register^ Xmm29 = gcnew Operand::Register(Registers::Id::Xmm29); + static initonly Operand::Register^ Xmm30 = gcnew Operand::Register(Registers::Id::Xmm30); + static initonly Operand::Register^ Xmm31 = gcnew Operand::Register(Registers::Id::Xmm31); // Floating point vector registers 256-bit - static initonly Operand::Register^ Ymm0 = gcnew Operand::Register(RegisterId::Ymm0); - static initonly Operand::Register^ Ymm1 = gcnew Operand::Register(RegisterId::Ymm1); - static initonly Operand::Register^ Ymm2 = gcnew Operand::Register(RegisterId::Ymm2); - static initonly Operand::Register^ Ymm3 = gcnew Operand::Register(RegisterId::Ymm3); - static initonly Operand::Register^ Ymm4 = gcnew Operand::Register(RegisterId::Ymm4); - static initonly Operand::Register^ Ymm5 = gcnew Operand::Register(RegisterId::Ymm5); - static initonly Operand::Register^ Ymm6 = gcnew Operand::Register(RegisterId::Ymm6); - static initonly Operand::Register^ Ymm7 = gcnew Operand::Register(RegisterId::Ymm7); - static initonly Operand::Register^ Ymm8 = gcnew Operand::Register(RegisterId::Ymm8); - static initonly Operand::Register^ Ymm9 = gcnew Operand::Register(RegisterId::Ymm9); - static initonly Operand::Register^ Ymm10 = gcnew Operand::Register(RegisterId::Ymm10); - static initonly Operand::Register^ Ymm11 = gcnew Operand::Register(RegisterId::Ymm11); - static initonly Operand::Register^ Ymm12 = gcnew Operand::Register(RegisterId::Ymm12); - static initonly Operand::Register^ Ymm13 = gcnew Operand::Register(RegisterId::Ymm13); - static initonly Operand::Register^ Ymm14 = gcnew Operand::Register(RegisterId::Ymm14); - static initonly Operand::Register^ Ymm15 = gcnew Operand::Register(RegisterId::Ymm15); - static initonly Operand::Register^ Ymm16 = gcnew Operand::Register(RegisterId::Ymm16); - static initonly Operand::Register^ Ymm17 = gcnew Operand::Register(RegisterId::Ymm17); - static initonly Operand::Register^ Ymm18 = gcnew Operand::Register(RegisterId::Ymm18); - static initonly Operand::Register^ Ymm19 = gcnew Operand::Register(RegisterId::Ymm19); - static initonly Operand::Register^ Ymm20 = gcnew Operand::Register(RegisterId::Ymm20); - static initonly Operand::Register^ Ymm21 = gcnew Operand::Register(RegisterId::Ymm21); - static initonly Operand::Register^ Ymm22 = gcnew Operand::Register(RegisterId::Ymm22); - static initonly Operand::Register^ Ymm23 = gcnew Operand::Register(RegisterId::Ymm23); - static initonly Operand::Register^ Ymm24 = gcnew Operand::Register(RegisterId::Ymm24); - static initonly Operand::Register^ Ymm25 = gcnew Operand::Register(RegisterId::Ymm25); - static initonly Operand::Register^ Ymm26 = gcnew Operand::Register(RegisterId::Ymm26); - static initonly Operand::Register^ Ymm27 = gcnew Operand::Register(RegisterId::Ymm27); - static initonly Operand::Register^ Ymm28 = gcnew Operand::Register(RegisterId::Ymm28); - static initonly Operand::Register^ Ymm29 = gcnew Operand::Register(RegisterId::Ymm29); - static initonly Operand::Register^ Ymm30 = gcnew Operand::Register(RegisterId::Ymm30); - static initonly Operand::Register^ Ymm31 = gcnew Operand::Register(RegisterId::Ymm31); + static initonly Operand::Register^ Ymm0 = gcnew Operand::Register(Registers::Id::Ymm0); + static initonly Operand::Register^ Ymm1 = gcnew Operand::Register(Registers::Id::Ymm1); + static initonly Operand::Register^ Ymm2 = gcnew Operand::Register(Registers::Id::Ymm2); + static initonly Operand::Register^ Ymm3 = gcnew Operand::Register(Registers::Id::Ymm3); + static initonly Operand::Register^ Ymm4 = gcnew Operand::Register(Registers::Id::Ymm4); + static initonly Operand::Register^ Ymm5 = gcnew Operand::Register(Registers::Id::Ymm5); + static initonly Operand::Register^ Ymm6 = gcnew Operand::Register(Registers::Id::Ymm6); + static initonly Operand::Register^ Ymm7 = gcnew Operand::Register(Registers::Id::Ymm7); + static initonly Operand::Register^ Ymm8 = gcnew Operand::Register(Registers::Id::Ymm8); + static initonly Operand::Register^ Ymm9 = gcnew Operand::Register(Registers::Id::Ymm9); + static initonly Operand::Register^ Ymm10 = gcnew Operand::Register(Registers::Id::Ymm10); + static initonly Operand::Register^ Ymm11 = gcnew Operand::Register(Registers::Id::Ymm11); + static initonly Operand::Register^ Ymm12 = gcnew Operand::Register(Registers::Id::Ymm12); + static initonly Operand::Register^ Ymm13 = gcnew Operand::Register(Registers::Id::Ymm13); + static initonly Operand::Register^ Ymm14 = gcnew Operand::Register(Registers::Id::Ymm14); + static initonly Operand::Register^ Ymm15 = gcnew Operand::Register(Registers::Id::Ymm15); + static initonly Operand::Register^ Ymm16 = gcnew Operand::Register(Registers::Id::Ymm16); + static initonly Operand::Register^ Ymm17 = gcnew Operand::Register(Registers::Id::Ymm17); + static initonly Operand::Register^ Ymm18 = gcnew Operand::Register(Registers::Id::Ymm18); + static initonly Operand::Register^ Ymm19 = gcnew Operand::Register(Registers::Id::Ymm19); + static initonly Operand::Register^ Ymm20 = gcnew Operand::Register(Registers::Id::Ymm20); + static initonly Operand::Register^ Ymm21 = gcnew Operand::Register(Registers::Id::Ymm21); + static initonly Operand::Register^ Ymm22 = gcnew Operand::Register(Registers::Id::Ymm22); + static initonly Operand::Register^ Ymm23 = gcnew Operand::Register(Registers::Id::Ymm23); + static initonly Operand::Register^ Ymm24 = gcnew Operand::Register(Registers::Id::Ymm24); + static initonly Operand::Register^ Ymm25 = gcnew Operand::Register(Registers::Id::Ymm25); + static initonly Operand::Register^ Ymm26 = gcnew Operand::Register(Registers::Id::Ymm26); + static initonly Operand::Register^ Ymm27 = gcnew Operand::Register(Registers::Id::Ymm27); + static initonly Operand::Register^ Ymm28 = gcnew Operand::Register(Registers::Id::Ymm28); + static initonly Operand::Register^ Ymm29 = gcnew Operand::Register(Registers::Id::Ymm29); + static initonly Operand::Register^ Ymm30 = gcnew Operand::Register(Registers::Id::Ymm30); + static initonly Operand::Register^ Ymm31 = gcnew Operand::Register(Registers::Id::Ymm31); // Floating point vector registers 512-bit - static initonly Operand::Register^ Zmm0 = gcnew Operand::Register(RegisterId::Zmm0); - static initonly Operand::Register^ Zmm1 = gcnew Operand::Register(RegisterId::Zmm1); - static initonly Operand::Register^ Zmm2 = gcnew Operand::Register(RegisterId::Zmm2); - static initonly Operand::Register^ Zmm3 = gcnew Operand::Register(RegisterId::Zmm3); - static initonly Operand::Register^ Zmm4 = gcnew Operand::Register(RegisterId::Zmm4); - static initonly Operand::Register^ Zmm5 = gcnew Operand::Register(RegisterId::Zmm5); - static initonly Operand::Register^ Zmm6 = gcnew Operand::Register(RegisterId::Zmm6); - static initonly Operand::Register^ Zmm7 = gcnew Operand::Register(RegisterId::Zmm7); - static initonly Operand::Register^ Zmm8 = gcnew Operand::Register(RegisterId::Zmm8); - static initonly Operand::Register^ Zmm9 = gcnew Operand::Register(RegisterId::Zmm9); - static initonly Operand::Register^ Zmm10 = gcnew Operand::Register(RegisterId::Zmm10); - static initonly Operand::Register^ Zmm11 = gcnew Operand::Register(RegisterId::Zmm11); - static initonly Operand::Register^ Zmm12 = gcnew Operand::Register(RegisterId::Zmm12); - static initonly Operand::Register^ Zmm13 = gcnew Operand::Register(RegisterId::Zmm13); - static initonly Operand::Register^ Zmm14 = gcnew Operand::Register(RegisterId::Zmm14); - static initonly Operand::Register^ Zmm15 = gcnew Operand::Register(RegisterId::Zmm15); - static initonly Operand::Register^ Zmm16 = gcnew Operand::Register(RegisterId::Zmm16); - static initonly Operand::Register^ Zmm17 = gcnew Operand::Register(RegisterId::Zmm17); - static initonly Operand::Register^ Zmm18 = gcnew Operand::Register(RegisterId::Zmm18); - static initonly Operand::Register^ Zmm19 = gcnew Operand::Register(RegisterId::Zmm19); - static initonly Operand::Register^ Zmm20 = gcnew Operand::Register(RegisterId::Zmm20); - static initonly Operand::Register^ Zmm21 = gcnew Operand::Register(RegisterId::Zmm21); - static initonly Operand::Register^ Zmm22 = gcnew Operand::Register(RegisterId::Zmm22); - static initonly Operand::Register^ Zmm23 = gcnew Operand::Register(RegisterId::Zmm23); - static initonly Operand::Register^ Zmm24 = gcnew Operand::Register(RegisterId::Zmm24); - static initonly Operand::Register^ Zmm25 = gcnew Operand::Register(RegisterId::Zmm25); - static initonly Operand::Register^ Zmm26 = gcnew Operand::Register(RegisterId::Zmm26); - static initonly Operand::Register^ Zmm27 = gcnew Operand::Register(RegisterId::Zmm27); - static initonly Operand::Register^ Zmm28 = gcnew Operand::Register(RegisterId::Zmm28); - static initonly Operand::Register^ Zmm29 = gcnew Operand::Register(RegisterId::Zmm29); - static initonly Operand::Register^ Zmm30 = gcnew Operand::Register(RegisterId::Zmm30); - static initonly Operand::Register^ Zmm31 = gcnew Operand::Register(RegisterId::Zmm31); + static initonly Operand::Register^ Zmm0 = gcnew Operand::Register(Registers::Id::Zmm0); + static initonly Operand::Register^ Zmm1 = gcnew Operand::Register(Registers::Id::Zmm1); + static initonly Operand::Register^ Zmm2 = gcnew Operand::Register(Registers::Id::Zmm2); + static initonly Operand::Register^ Zmm3 = gcnew Operand::Register(Registers::Id::Zmm3); + static initonly Operand::Register^ Zmm4 = gcnew Operand::Register(Registers::Id::Zmm4); + static initonly Operand::Register^ Zmm5 = gcnew Operand::Register(Registers::Id::Zmm5); + static initonly Operand::Register^ Zmm6 = gcnew Operand::Register(Registers::Id::Zmm6); + static initonly Operand::Register^ Zmm7 = gcnew Operand::Register(Registers::Id::Zmm7); + static initonly Operand::Register^ Zmm8 = gcnew Operand::Register(Registers::Id::Zmm8); + static initonly Operand::Register^ Zmm9 = gcnew Operand::Register(Registers::Id::Zmm9); + static initonly Operand::Register^ Zmm10 = gcnew Operand::Register(Registers::Id::Zmm10); + static initonly Operand::Register^ Zmm11 = gcnew Operand::Register(Registers::Id::Zmm11); + static initonly Operand::Register^ Zmm12 = gcnew Operand::Register(Registers::Id::Zmm12); + static initonly Operand::Register^ Zmm13 = gcnew Operand::Register(Registers::Id::Zmm13); + static initonly Operand::Register^ Zmm14 = gcnew Operand::Register(Registers::Id::Zmm14); + static initonly Operand::Register^ Zmm15 = gcnew Operand::Register(Registers::Id::Zmm15); + static initonly Operand::Register^ Zmm16 = gcnew Operand::Register(Registers::Id::Zmm16); + static initonly Operand::Register^ Zmm17 = gcnew Operand::Register(Registers::Id::Zmm17); + static initonly Operand::Register^ Zmm18 = gcnew Operand::Register(Registers::Id::Zmm18); + static initonly Operand::Register^ Zmm19 = gcnew Operand::Register(Registers::Id::Zmm19); + static initonly Operand::Register^ Zmm20 = gcnew Operand::Register(Registers::Id::Zmm20); + static initonly Operand::Register^ Zmm21 = gcnew Operand::Register(Registers::Id::Zmm21); + static initonly Operand::Register^ Zmm22 = gcnew Operand::Register(Registers::Id::Zmm22); + static initonly Operand::Register^ Zmm23 = gcnew Operand::Register(Registers::Id::Zmm23); + static initonly Operand::Register^ Zmm24 = gcnew Operand::Register(Registers::Id::Zmm24); + static initonly Operand::Register^ Zmm25 = gcnew Operand::Register(Registers::Id::Zmm25); + static initonly Operand::Register^ Zmm26 = gcnew Operand::Register(Registers::Id::Zmm26); + static initonly Operand::Register^ Zmm27 = gcnew Operand::Register(Registers::Id::Zmm27); + static initonly Operand::Register^ Zmm28 = gcnew Operand::Register(Registers::Id::Zmm28); + static initonly Operand::Register^ Zmm29 = gcnew Operand::Register(Registers::Id::Zmm29); + static initonly Operand::Register^ Zmm30 = gcnew Operand::Register(Registers::Id::Zmm30); + static initonly Operand::Register^ Zmm31 = gcnew Operand::Register(Registers::Id::Zmm31); // Flags registers - static initonly Operand::Register^ Flags = gcnew Operand::Register(RegisterId::Flags); - static initonly Operand::Register^ EFlags = gcnew Operand::Register(RegisterId::EFlags); - static initonly Operand::Register^ RFlags = gcnew Operand::Register(RegisterId::RFlags); + static initonly Operand::Register^ Flags = gcnew Operand::Register(Registers::Id::Flags); + static initonly Operand::Register^ EFlags = gcnew Operand::Register(Registers::Id::EFlags); + static initonly Operand::Register^ RFlags = gcnew Operand::Register(Registers::Id::RFlags); // Instruction-pointer registers - static initonly Operand::Register^ Ip = gcnew Operand::Register(RegisterId::Ip); - static initonly Operand::Register^ Eip = gcnew Operand::Register(RegisterId::Eip); - static initonly Operand::Register^ Rip = gcnew Operand::Register(RegisterId::Rip); + static initonly Operand::Register^ Ip = gcnew Operand::Register(Registers::Id::Ip); + static initonly Operand::Register^ Eip = gcnew Operand::Register(Registers::Id::Eip); + static initonly Operand::Register^ Rip = gcnew Operand::Register(Registers::Id::Rip); // Segment registers - static initonly Operand::Register^ Es = gcnew Operand::Register(RegisterId::Es); - static initonly Operand::Register^ Cs = gcnew Operand::Register(RegisterId::Cs); - static initonly Operand::Register^ Ss = gcnew Operand::Register(RegisterId::Ss); - static initonly Operand::Register^ Ds = gcnew Operand::Register(RegisterId::Ds); - static initonly Operand::Register^ Fs = gcnew Operand::Register(RegisterId::Fs); - static initonly Operand::Register^ Gs = gcnew Operand::Register(RegisterId::Gs); + static initonly Operand::Register^ Es = gcnew Operand::Register(Registers::Id::Es); + static initonly Operand::Register^ Cs = gcnew Operand::Register(Registers::Id::Cs); + static initonly Operand::Register^ Ss = gcnew Operand::Register(Registers::Id::Ss); + static initonly Operand::Register^ Ds = gcnew Operand::Register(Registers::Id::Ds); + static initonly Operand::Register^ Fs = gcnew Operand::Register(Registers::Id::Fs); + static initonly Operand::Register^ Gs = gcnew Operand::Register(Registers::Id::Gs); // Table registers - static initonly Operand::Register^ Gdtr = gcnew Operand::Register(RegisterId::Gdtr); - static initonly Operand::Register^ Ldtr = gcnew Operand::Register(RegisterId::Ldtr); - static initonly Operand::Register^ Idtr = gcnew Operand::Register(RegisterId::Idtr); - static initonly Operand::Register^ Tr = gcnew Operand::Register(RegisterId::Tr); + static initonly Operand::Register^ Gdtr = gcnew Operand::Register(Registers::Id::Gdtr); + static initonly Operand::Register^ Ldtr = gcnew Operand::Register(Registers::Id::Ldtr); + static initonly Operand::Register^ Idtr = gcnew Operand::Register(Registers::Id::Idtr); + static initonly Operand::Register^ Tr = gcnew Operand::Register(Registers::Id::Tr); // Test registers - static initonly Operand::Register^ Tr0 = gcnew Operand::Register(RegisterId::Tr0); - static initonly Operand::Register^ Tr1 = gcnew Operand::Register(RegisterId::Tr1); - static initonly Operand::Register^ Tr2 = gcnew Operand::Register(RegisterId::Tr2); - static initonly Operand::Register^ Tr3 = gcnew Operand::Register(RegisterId::Tr3); - static initonly Operand::Register^ Tr4 = gcnew Operand::Register(RegisterId::Tr4); - static initonly Operand::Register^ Tr5 = gcnew Operand::Register(RegisterId::Tr5); - static initonly Operand::Register^ Tr6 = gcnew Operand::Register(RegisterId::Tr6); - static initonly Operand::Register^ Tr7 = gcnew Operand::Register(RegisterId::Tr7); + static initonly Operand::Register^ Tr0 = gcnew Operand::Register(Registers::Id::Tr0); + static initonly Operand::Register^ Tr1 = gcnew Operand::Register(Registers::Id::Tr1); + static initonly Operand::Register^ Tr2 = gcnew Operand::Register(Registers::Id::Tr2); + static initonly Operand::Register^ Tr3 = gcnew Operand::Register(Registers::Id::Tr3); + static initonly Operand::Register^ Tr4 = gcnew Operand::Register(Registers::Id::Tr4); + static initonly Operand::Register^ Tr5 = gcnew Operand::Register(Registers::Id::Tr5); + static initonly Operand::Register^ Tr6 = gcnew Operand::Register(Registers::Id::Tr6); + static initonly Operand::Register^ Tr7 = gcnew Operand::Register(Registers::Id::Tr7); // Control registers - static initonly Operand::Register^ Cr0 = gcnew Operand::Register(RegisterId::Cr0); - static initonly Operand::Register^ Cr1 = gcnew Operand::Register(RegisterId::Cr1); - static initonly Operand::Register^ Cr2 = gcnew Operand::Register(RegisterId::Cr2); - static initonly Operand::Register^ Cr3 = gcnew Operand::Register(RegisterId::Cr3); - static initonly Operand::Register^ Cr4 = gcnew Operand::Register(RegisterId::Cr4); - static initonly Operand::Register^ Cr5 = gcnew Operand::Register(RegisterId::Cr5); - static initonly Operand::Register^ Cr6 = gcnew Operand::Register(RegisterId::Cr6); - static initonly Operand::Register^ Cr7 = gcnew Operand::Register(RegisterId::Cr7); - static initonly Operand::Register^ Cr8 = gcnew Operand::Register(RegisterId::Cr8); - static initonly Operand::Register^ Cr9 = gcnew Operand::Register(RegisterId::Cr9); - static initonly Operand::Register^ Cr10 = gcnew Operand::Register(RegisterId::Cr10); - static initonly Operand::Register^ Cr11 = gcnew Operand::Register(RegisterId::Cr11); - static initonly Operand::Register^ Cr12 = gcnew Operand::Register(RegisterId::Cr12); - static initonly Operand::Register^ Cr13 = gcnew Operand::Register(RegisterId::Cr13); - static initonly Operand::Register^ Cr14 = gcnew Operand::Register(RegisterId::Cr14); - static initonly Operand::Register^ Cr15 = gcnew Operand::Register(RegisterId::Cr15); + static initonly Operand::Register^ Cr0 = gcnew Operand::Register(Registers::Id::Cr0); + static initonly Operand::Register^ Cr1 = gcnew Operand::Register(Registers::Id::Cr1); + static initonly Operand::Register^ Cr2 = gcnew Operand::Register(Registers::Id::Cr2); + static initonly Operand::Register^ Cr3 = gcnew Operand::Register(Registers::Id::Cr3); + static initonly Operand::Register^ Cr4 = gcnew Operand::Register(Registers::Id::Cr4); + static initonly Operand::Register^ Cr5 = gcnew Operand::Register(Registers::Id::Cr5); + static initonly Operand::Register^ Cr6 = gcnew Operand::Register(Registers::Id::Cr6); + static initonly Operand::Register^ Cr7 = gcnew Operand::Register(Registers::Id::Cr7); + static initonly Operand::Register^ Cr8 = gcnew Operand::Register(Registers::Id::Cr8); + static initonly Operand::Register^ Cr9 = gcnew Operand::Register(Registers::Id::Cr9); + static initonly Operand::Register^ Cr10 = gcnew Operand::Register(Registers::Id::Cr10); + static initonly Operand::Register^ Cr11 = gcnew Operand::Register(Registers::Id::Cr11); + static initonly Operand::Register^ Cr12 = gcnew Operand::Register(Registers::Id::Cr12); + static initonly Operand::Register^ Cr13 = gcnew Operand::Register(Registers::Id::Cr13); + static initonly Operand::Register^ Cr14 = gcnew Operand::Register(Registers::Id::Cr14); + static initonly Operand::Register^ Cr15 = gcnew Operand::Register(Registers::Id::Cr15); // Debug registers - static initonly Operand::Register^ Dr0 = gcnew Operand::Register(RegisterId::Dr0); - static initonly Operand::Register^ Dr1 = gcnew Operand::Register(RegisterId::Dr1); - static initonly Operand::Register^ Dr2 = gcnew Operand::Register(RegisterId::Dr2); - static initonly Operand::Register^ Dr3 = gcnew Operand::Register(RegisterId::Dr3); - static initonly Operand::Register^ Dr4 = gcnew Operand::Register(RegisterId::Dr4); - static initonly Operand::Register^ Dr5 = gcnew Operand::Register(RegisterId::Dr5); - static initonly Operand::Register^ Dr6 = gcnew Operand::Register(RegisterId::Dr6); - static initonly Operand::Register^ Dr7 = gcnew Operand::Register(RegisterId::Dr7); - static initonly Operand::Register^ Dr8 = gcnew Operand::Register(RegisterId::Dr8); - static initonly Operand::Register^ Dr9 = gcnew Operand::Register(RegisterId::Dr9); - static initonly Operand::Register^ Dr10 = gcnew Operand::Register(RegisterId::Dr10); - static initonly Operand::Register^ Dr11 = gcnew Operand::Register(RegisterId::Dr11); - static initonly Operand::Register^ Dr12 = gcnew Operand::Register(RegisterId::Dr12); - static initonly Operand::Register^ Dr13 = gcnew Operand::Register(RegisterId::Dr13); - static initonly Operand::Register^ Dr14 = gcnew Operand::Register(RegisterId::Dr14); - static initonly Operand::Register^ Dr15 = gcnew Operand::Register(RegisterId::Dr15); + static initonly Operand::Register^ Dr0 = gcnew Operand::Register(Registers::Id::Dr0); + static initonly Operand::Register^ Dr1 = gcnew Operand::Register(Registers::Id::Dr1); + static initonly Operand::Register^ Dr2 = gcnew Operand::Register(Registers::Id::Dr2); + static initonly Operand::Register^ Dr3 = gcnew Operand::Register(Registers::Id::Dr3); + static initonly Operand::Register^ Dr4 = gcnew Operand::Register(Registers::Id::Dr4); + static initonly Operand::Register^ Dr5 = gcnew Operand::Register(Registers::Id::Dr5); + static initonly Operand::Register^ Dr6 = gcnew Operand::Register(Registers::Id::Dr6); + static initonly Operand::Register^ Dr7 = gcnew Operand::Register(Registers::Id::Dr7); + static initonly Operand::Register^ Dr8 = gcnew Operand::Register(Registers::Id::Dr8); + static initonly Operand::Register^ Dr9 = gcnew Operand::Register(Registers::Id::Dr9); + static initonly Operand::Register^ Dr10 = gcnew Operand::Register(Registers::Id::Dr10); + static initonly Operand::Register^ Dr11 = gcnew Operand::Register(Registers::Id::Dr11); + static initonly Operand::Register^ Dr12 = gcnew Operand::Register(Registers::Id::Dr12); + static initonly Operand::Register^ Dr13 = gcnew Operand::Register(Registers::Id::Dr13); + static initonly Operand::Register^ Dr14 = gcnew Operand::Register(Registers::Id::Dr14); + static initonly Operand::Register^ Dr15 = gcnew Operand::Register(Registers::Id::Dr15); // Mask registers - static initonly Operand::Register^ K0 = gcnew Operand::Register(RegisterId::K0); - static initonly Operand::Register^ K1 = gcnew Operand::Register(RegisterId::K1); - static initonly Operand::Register^ K2 = gcnew Operand::Register(RegisterId::K2); - static initonly Operand::Register^ K3 = gcnew Operand::Register(RegisterId::K3); - static initonly Operand::Register^ K4 = gcnew Operand::Register(RegisterId::K4); - static initonly Operand::Register^ K5 = gcnew Operand::Register(RegisterId::K5); - static initonly Operand::Register^ K6 = gcnew Operand::Register(RegisterId::K6); - static initonly Operand::Register^ K7 = gcnew Operand::Register(RegisterId::K7); + static initonly Operand::Register^ K0 = gcnew Operand::Register(Registers::Id::K0); + static initonly Operand::Register^ K1 = gcnew Operand::Register(Registers::Id::K1); + static initonly Operand::Register^ K2 = gcnew Operand::Register(Registers::Id::K2); + static initonly Operand::Register^ K3 = gcnew Operand::Register(Registers::Id::K3); + static initonly Operand::Register^ K4 = gcnew Operand::Register(Registers::Id::K4); + static initonly Operand::Register^ K5 = gcnew Operand::Register(Registers::Id::K5); + static initonly Operand::Register^ K6 = gcnew Operand::Register(Registers::Id::K6); + static initonly Operand::Register^ K7 = gcnew Operand::Register(Registers::Id::K7); // Bound registers - static initonly Operand::Register^ Bnd0 = gcnew Operand::Register(RegisterId::Bnd0); - static initonly Operand::Register^ Bnd1 = gcnew Operand::Register(RegisterId::Bnd1); - static initonly Operand::Register^ Bnd2 = gcnew Operand::Register(RegisterId::Bnd2); - static initonly Operand::Register^ Bnd3 = gcnew Operand::Register(RegisterId::Bnd3); - static initonly Operand::Register^ BndCfg = gcnew Operand::Register(RegisterId::BndCfg); - static initonly Operand::Register^ BndStatus = gcnew Operand::Register(RegisterId::BndStatus); + static initonly Operand::Register^ Bnd0 = gcnew Operand::Register(Registers::Id::Bnd0); + static initonly Operand::Register^ Bnd1 = gcnew Operand::Register(Registers::Id::Bnd1); + static initonly Operand::Register^ Bnd2 = gcnew Operand::Register(Registers::Id::Bnd2); + static initonly Operand::Register^ Bnd3 = gcnew Operand::Register(Registers::Id::Bnd3); + static initonly Operand::Register^ BndCfg = gcnew Operand::Register(Registers::Id::BndCfg); + static initonly Operand::Register^ BndStatus = gcnew Operand::Register(Registers::Id::BndStatus); // Uncategorized - static initonly Operand::Register^ Mxcsr = gcnew Operand::Register(RegisterId::Mxcsr); - static initonly Operand::Register^ Pkru = gcnew Operand::Register(RegisterId::Pkru); - static initonly Operand::Register^ Xcr0 = gcnew Operand::Register(RegisterId::Xcr0); + static initonly Operand::Register^ Mxcsr = gcnew Operand::Register(Registers::Id::Mxcsr); + static initonly Operand::Register^ Pkru = gcnew Operand::Register(Registers::Id::Pkru); + static initonly Operand::Register^ Xcr0 = gcnew Operand::Register(Registers::Id::Xcr0); // Host specific - static initonly Operand::Register^ Nax = gcnew Operand::Register(RegisterId::Nax); - static initonly Operand::Register^ Ncx = gcnew Operand::Register(RegisterId::Ncx); - static initonly Operand::Register^ Ndx = gcnew Operand::Register(RegisterId::Ndx); - static initonly Operand::Register^ Nbx = gcnew Operand::Register(RegisterId::Nbx); - static initonly Operand::Register^ Nsp = gcnew Operand::Register(RegisterId::Nsp); - static initonly Operand::Register^ Nbp = gcnew Operand::Register(RegisterId::Nbp); - static initonly Operand::Register^ Nsi = gcnew Operand::Register(RegisterId::Nsi); - static initonly Operand::Register^ Ndi = gcnew Operand::Register(RegisterId::Ndi); - static initonly Operand::Register^ Nip = gcnew Operand::Register(RegisterId::Nip); - static initonly Operand::Register^ NFlags = gcnew Operand::Register(RegisterId::NFlags); - - static Operand::Register^ Reg(RegisterId reg) + static initonly Operand::Register^ Nax = gcnew Operand::Register(Registers::Id::Nax); + static initonly Operand::Register^ Ncx = gcnew Operand::Register(Registers::Id::Ncx); + static initonly Operand::Register^ Ndx = gcnew Operand::Register(Registers::Id::Ndx); + static initonly Operand::Register^ Nbx = gcnew Operand::Register(Registers::Id::Nbx); + static initonly Operand::Register^ Nsp = gcnew Operand::Register(Registers::Id::Nsp); + static initonly Operand::Register^ Nbp = gcnew Operand::Register(Registers::Id::Nbp); + static initonly Operand::Register^ Nsi = gcnew Operand::Register(Registers::Id::Nsi); + static initonly Operand::Register^ Ndi = gcnew Operand::Register(Registers::Id::Ndi); + static initonly Operand::Register^ Nip = gcnew Operand::Register(Registers::Id::Nip); + static initonly Operand::Register^ NFlags = gcnew Operand::Register(Registers::Id::NFlags); + + static Operand::Register^ Reg(Registers::Id reg) { return gcnew Operand::Register(reg); } diff --git a/src/Bindings/Register.hpp b/src/Bindings/Register.hpp index 5d4e7c9..da3f0f7 100644 --- a/src/Bindings/Register.hpp +++ b/src/Bindings/Register.hpp @@ -1,1951 +1,2060 @@ -#pragma once +#pragma once namespace Dotx64Dbg { - - public enum class RegisterClass + public ref class Registers { - Invalid, - /** - * @brief 8-bit general-purpose registers. - */ - Gp8, - /** - * @brief 16-bit general-purpose registers. - */ - Gp16, - /** - * @brief 32-bit general-purpose registers. - */ - Gp32, - /** - * @brief 64-bit general-purpose registers. - */ - Gp64, - /** - * @brief Floating point legacy registers. - */ - X87, - /** - * @brief Floating point multimedia registers. - */ - Mmx, - /** - * @brief 128-bit vector registers. - */ - Xmm, - /** - * @brief 256-bit vector registers. - */ - Ymm, - /** - * @brief 512-bit vector registers. - */ - Zmm, - /** - * @brief Flags registers. - */ - Flags, - /** - * @brief Instruction-pointer registers. - */ - IP, - /** - * @brief Segment registers. - */ - Segment, - /** - * @brief Test registers. - */ - Test, - /** - * @brief Control registers. - */ - Control, - /** - * @brief Debug registers. - */ - Debug, - /** - * @brief Mask registers. - */ - Mask, - /** - * @brief Bound registers. - */ - Bound, - }; - - public enum class RegisterCategory - { - Gp, - X87, - Simd, - }; - - public enum class RegisterId - { - None, - // General purpose registers 8-bit - Al, - Cl, - Dl, - Bl, - Ah, - Ch, - Dh, - Bh, - Spl, - Bpl, - Sil, - Dil, - R8b, - R9b, - R10b, - R11b, - R12b, - R13b, - R14b, - R15b, - // General purpose registers 16-bit - Ax, - Cx, - Dx, - Bx, - Sp, - Bp, - Si, - Di, - R8w, - R9w, - R10w, - R11w, - R12w, - R13w, - R14w, - R15w, - // General purpose registers 32-bit - Eax, - Ecx, - Edx, - Ebx, - Esp, - Ebp, - Esi, - Edi, - R8d, - R9d, - R10d, - R11d, - R12d, - R13d, - R14d, - R15d, - // General purpose registers 64-bit - Rax, - Rcx, - Rdx, - Rbx, - Rsp, - Rbp, - Rsi, - Rdi, - R8, - R9, - R10, - R11, - R12, - R13, - R14, - R15, - // Floating point legacy registers - St0, - St1, - St2, - St3, - St4, - St5, - St6, - St7, - X87Control, - X87Status, - X87Tag, - // Floating point multimedia registers - Mm0, - Mm1, - Mm2, - Mm3, - Mm4, - Mm5, - Mm6, - Mm7, - // Floating point vector registers 128-bit - Xmm0, - Xmm1, - Xmm2, - Xmm3, - Xmm4, - Xmm5, - Xmm6, - Xmm7, - Xmm8, - Xmm9, - Xmm10, - Xmm11, - Xmm12, - Xmm13, - Xmm14, - Xmm15, - Xmm16, - Xmm17, - Xmm18, - Xmm19, - Xmm20, - Xmm21, - Xmm22, - Xmm23, - Xmm24, - Xmm25, - Xmm26, - Xmm27, - Xmm28, - Xmm29, - Xmm30, - Xmm31, - // Floating point vector registers 256-bit - Ymm0, - Ymm1, - Ymm2, - Ymm3, - Ymm4, - Ymm5, - Ymm6, - Ymm7, - Ymm8, - Ymm9, - Ymm10, - Ymm11, - Ymm12, - Ymm13, - Ymm14, - Ymm15, - Ymm16, - Ymm17, - Ymm18, - Ymm19, - Ymm20, - Ymm21, - Ymm22, - Ymm23, - Ymm24, - Ymm25, - Ymm26, - Ymm27, - Ymm28, - Ymm29, - Ymm30, - Ymm31, - // Floating point vector registers 512-bit - Zmm0, - Zmm1, - Zmm2, - Zmm3, - Zmm4, - Zmm5, - Zmm6, - Zmm7, - Zmm8, - Zmm9, - Zmm10, - Zmm11, - Zmm12, - Zmm13, - Zmm14, - Zmm15, - Zmm16, - Zmm17, - Zmm18, - Zmm19, - Zmm20, - Zmm21, - Zmm22, - Zmm23, - Zmm24, - Zmm25, - Zmm26, - Zmm27, - Zmm28, - Zmm29, - Zmm30, - Zmm31, - // Matrix registers - Tmm0, - Tmm1, - Tmm2, - Tmm3, - Tmm4, - Tmm5, - Tmm6, - Tmm7, - // Flags registers - Flags, - EFlags, - RFlags, - // Instruction-pointer registers - Ip, - Eip, - Rip, - // Segment registers - Es, - Cs, - Ss, - Ds, - Fs, - Gs, - // Table registers - Gdtr, - Ldtr, - Idtr, - Tr, - // Test registers - Tr0, - Tr1, - Tr2, - Tr3, - Tr4, - Tr5, - Tr6, - Tr7, - // Control registers - Cr0, - Cr1, - Cr2, - Cr3, - Cr4, - Cr5, - Cr6, - Cr7, - Cr8, - Cr9, - Cr10, - Cr11, - Cr12, - Cr13, - Cr14, - Cr15, - // Debug registers - Dr0, - Dr1, - Dr2, - Dr3, - Dr4, - Dr5, - Dr6, - Dr7, - Dr8, - Dr9, - Dr10, - Dr11, - Dr12, - Dr13, - Dr14, - Dr15, - // Mask registers - K0, - K1, - K2, - K3, - K4, - K5, - K6, - K7, - // Bound registers - Bnd0, - Bnd1, - Bnd2, - Bnd3, - BndCfg, - BndStatus, - // Uncategorized - Mxcsr, - Pkru, - Xcr0, + public: + enum class Class + { + Invalid, + /** + * @brief 8-bit general-purpose registers. + */ + Gp8, + /** + * @brief 16-bit general-purpose registers. + */ + Gp16, + /** + * @brief 32-bit general-purpose registers. + */ + Gp32, + /** + * @brief 64-bit general-purpose registers. + */ + Gp64, + /** + * @brief Floating point legacy registers. + */ + X87, + /** + * @brief Floating point multimedia registers. + */ + Mmx, + /** + * @brief 128-bit vector registers. + */ + Xmm, + /** + * @brief 256-bit vector registers. + */ + Ymm, + /** + * @brief 512-bit vector registers. + */ + Zmm, + /** + * @brief Flags registers. + */ + Flags, + /** + * @brief Instruction-pointer registers. + */ + IP, + /** + * @brief Segment registers. + */ + Segment, + /** + * @brief Test registers. + */ + Test, + /** + * @brief Control registers. + */ + Control, + /** + * @brief Debug registers. + */ + Debug, + /** + * @brief Mask registers. + */ + Mask, + /** + * @brief Bound registers. + */ + Bound, + }; - // Host Aliases -#ifdef _M_AMD64 - Nax = Rax, - Ncx = Rcx, - Ndx = Rdx, - Nbx = Rbx, - Nsp = Rsp, - Nbp = Rbp, - Nsi = Rsi, - Ndi = Rdi, - N8 = R8, - N9 = R9, - N10 = R10, - N11 = R11, - N12 = R12, - N13 = R13, - N14 = R14, - N15 = R15, - Nip = Rip, - NFlags = RFlags, -#else - Nax = Eax, - Ncx = Ecx, - Ndx = Edx, - Nbx = Ebx, - Nsp = Esp, - Nbp = Ebp, - Nsi = Esi, - Ndi = Edi, - N8 = R8d, - N9 = R9d, - N10 = R10d, - N11 = R11d, - N12 = R12d, - N13 = R13d, - N14 = R14d, - N15 = R15d, - Nip = Eip, - NFlags = EFlags, -#endif - Invalid = 0xFFFF, - }; + enum class Category + { + Invalid = -1, + Gp = 0, + X87, + Simd, + Flags, + Debug, + Segment, + Mask, + Control, + }; - inline const char* RegisterGetName(RegisterId id) - { - switch (id) + enum class Id { - case RegisterId::None: - return "none"; - case RegisterId::Al: - return "al"; - case RegisterId::Cl: - return "cl"; - case RegisterId::Dl: - return "dl"; - case RegisterId::Bl: - return "bl"; - case RegisterId::Ah: - return "ah"; - case RegisterId::Ch: - return "ch"; - case RegisterId::Dh: - return "dh"; - case RegisterId::Bh: - return "bh"; - case RegisterId::Spl: - return "spl"; - case RegisterId::Bpl: - return "bpl"; - case RegisterId::Sil: - return "sil"; - case RegisterId::Dil: - return "dil"; - case RegisterId::R8b: - return "r8b"; - case RegisterId::R9b: - return "r9b"; - case RegisterId::R10b: - return "r10b"; - case RegisterId::R11b: - return "r11b"; - case RegisterId::R12b: - return "r12b"; - case RegisterId::R13b: - return "r13b"; - case RegisterId::R14b: - return "r14b"; - case RegisterId::R15b: - return "r15b"; - case RegisterId::Ax: - return "ax"; - case RegisterId::Cx: - return "cx"; - case RegisterId::Dx: - return "dx"; - case RegisterId::Bx: - return "bx"; - case RegisterId::Sp: - return "sp"; - case RegisterId::Bp: - return "bp"; - case RegisterId::Si: - return "si"; - case RegisterId::Di: - return "di"; - case RegisterId::R8w: - return "r8w"; - case RegisterId::R9w: - return "r9w"; - case RegisterId::R10w: - return "r10w"; - case RegisterId::R11w: - return "r11w"; - case RegisterId::R12w: - return "r12w"; - case RegisterId::R13w: - return "r13w"; - case RegisterId::R14w: - return "r14w"; - case RegisterId::R15w: - return "r15w"; - case RegisterId::Eax: - return "eax"; - case RegisterId::Ecx: - return "ecx"; - case RegisterId::Edx: - return "edx"; - case RegisterId::Ebx: - return "ebx"; - case RegisterId::Esp: - return "esp"; - case RegisterId::Ebp: - return "ebp"; - case RegisterId::Esi: - return "esi"; - case RegisterId::Edi: - return "edi"; - case RegisterId::R8d: - return "r8d"; - case RegisterId::R9d: - return "r9d"; - case RegisterId::R10d: - return "r10d"; - case RegisterId::R11d: - return "r11d"; - case RegisterId::R12d: - return "r12d"; - case RegisterId::R13d: - return "r13d"; - case RegisterId::R14d: - return "r14d"; - case RegisterId::R15d: - return "r15d"; - case RegisterId::Rax: - return "rax"; - case RegisterId::Rcx: - return "rcx"; - case RegisterId::Rdx: - return "rdx"; - case RegisterId::Rbx: - return "rbx"; - case RegisterId::Rsp: - return "rsp"; - case RegisterId::Rbp: - return "rbp"; - case RegisterId::Rsi: - return "rsi"; - case RegisterId::Rdi: - return "rdi"; - case RegisterId::R8: - return "r8"; - case RegisterId::R9: - return "r9"; - case RegisterId::R10: - return "r10"; - case RegisterId::R11: - return "r11"; - case RegisterId::R12: - return "r12"; - case RegisterId::R13: - return "r13"; - case RegisterId::R14: - return "r14"; - case RegisterId::R15: - return "r15"; - case RegisterId::St0: - return "st0"; - case RegisterId::St1: - return "st1"; - case RegisterId::St2: - return "st2"; - case RegisterId::St3: - return "st3"; - case RegisterId::St4: - return "st4"; - case RegisterId::St5: - return "st5"; - case RegisterId::St6: - return "st6"; - case RegisterId::St7: - return "st7"; - case RegisterId::X87Control: - return "x87control"; - case RegisterId::X87Status: - return "x87status"; - case RegisterId::X87Tag: - return "x87tag"; - case RegisterId::Mm0: - return "mm0"; - case RegisterId::Mm1: - return "mm1"; - case RegisterId::Mm2: - return "mm2"; - case RegisterId::Mm3: - return "mm3"; - case RegisterId::Mm4: - return "mm4"; - case RegisterId::Mm5: - return "mm5"; - case RegisterId::Mm6: - return "mm6"; - case RegisterId::Mm7: - return "mm7"; + None, + // General purpose registers 8-bit + Al, + Cl, + Dl, + Bl, + Ah, + Ch, + Dh, + Bh, + Spl, + Bpl, + Sil, + Dil, + R8b, + R9b, + R10b, + R11b, + R12b, + R13b, + R14b, + R15b, + // General purpose registers 16-bit + Ax, + Cx, + Dx, + Bx, + Sp, + Bp, + Si, + Di, + R8w, + R9w, + R10w, + R11w, + R12w, + R13w, + R14w, + R15w, + // General purpose registers 32-bit + Eax, + Ecx, + Edx, + Ebx, + Esp, + Ebp, + Esi, + Edi, + R8d, + R9d, + R10d, + R11d, + R12d, + R13d, + R14d, + R15d, + // General purpose registers 64-bit + Rax, + Rcx, + Rdx, + Rbx, + Rsp, + Rbp, + Rsi, + Rdi, + R8, + R9, + R10, + R11, + R12, + R13, + R14, + R15, + // Floating point legacy registers + St0, + St1, + St2, + St3, + St4, + St5, + St6, + St7, + X87Control, + X87Status, + X87Tag, + // Floating point multimedia registers + Mm0, + Mm1, + Mm2, + Mm3, + Mm4, + Mm5, + Mm6, + Mm7, // Floating point vector registers 128-bit - case RegisterId::Xmm0: - return "xmm0"; - case RegisterId::Xmm1: - return "xmm1"; - case RegisterId::Xmm2: - return "xmm2"; - case RegisterId::Xmm3: - return "xmm3"; - case RegisterId::Xmm4: - return "xmm4"; - case RegisterId::Xmm5: - return "xmm5"; - case RegisterId::Xmm6: - return "xmm6"; - case RegisterId::Xmm7: - return "xmm7"; - case RegisterId::Xmm8: - return "xmm8"; - case RegisterId::Xmm9: - return "xmm9"; - case RegisterId::Xmm10: - return "xmm10"; - case RegisterId::Xmm11: - return "xmm11"; - case RegisterId::Xmm12: - return "xmm12"; - case RegisterId::Xmm13: - return "xmm13"; - case RegisterId::Xmm14: - return "xmm14"; - case RegisterId::Xmm15: - return "xmm15"; - case RegisterId::Xmm16: - return "xmm16"; - case RegisterId::Xmm17: - return "xmm17"; - case RegisterId::Xmm18: - return "xmm18"; - case RegisterId::Xmm19: - return "xmm19"; - case RegisterId::Xmm20: - return "xmm20"; - case RegisterId::Xmm21: - return "xmm21"; - case RegisterId::Xmm22: - return "xmm22"; - case RegisterId::Xmm23: - return "xmm23"; - case RegisterId::Xmm24: - return "xmm24"; - case RegisterId::Xmm25: - return "xmm25"; - case RegisterId::Xmm26: - return "xmm26"; - case RegisterId::Xmm27: - return "xmm27"; - case RegisterId::Xmm28: - return "xmm28"; - case RegisterId::Xmm29: - return "xmm29"; - case RegisterId::Xmm30: - return "xmm30"; - case RegisterId::Xmm31: - return "xmm31"; + Xmm0, + Xmm1, + Xmm2, + Xmm3, + Xmm4, + Xmm5, + Xmm6, + Xmm7, + Xmm8, + Xmm9, + Xmm10, + Xmm11, + Xmm12, + Xmm13, + Xmm14, + Xmm15, + Xmm16, + Xmm17, + Xmm18, + Xmm19, + Xmm20, + Xmm21, + Xmm22, + Xmm23, + Xmm24, + Xmm25, + Xmm26, + Xmm27, + Xmm28, + Xmm29, + Xmm30, + Xmm31, // Floating point vector registers 256-bit - case RegisterId::Ymm0: - return "ymm0"; - case RegisterId::Ymm1: - return "ymm1"; - case RegisterId::Ymm2: - return "ymm2"; - case RegisterId::Ymm3: - return "ymm3"; - case RegisterId::Ymm4: - return "ymm4"; - case RegisterId::Ymm5: - return "ymm5"; - case RegisterId::Ymm6: - return "ymm6"; - case RegisterId::Ymm7: - return "ymm7"; - case RegisterId::Ymm8: - return "ymm8"; - case RegisterId::Ymm9: - return "ymm9"; - case RegisterId::Ymm10: - return "ymm10"; - case RegisterId::Ymm11: - return "ymm11"; - case RegisterId::Ymm12: - return "ymm12"; - case RegisterId::Ymm13: - return "ymm13"; - case RegisterId::Ymm14: - return "ymm14"; - case RegisterId::Ymm15: - return "ymm15"; - case RegisterId::Ymm16: - return "ymm16"; - case RegisterId::Ymm17: - return "ymm17"; - case RegisterId::Ymm18: - return "ymm18"; - case RegisterId::Ymm19: - return "ymm19"; - case RegisterId::Ymm20: - return "ymm20"; - case RegisterId::Ymm21: - return "ymm21"; - case RegisterId::Ymm22: - return "ymm22"; - case RegisterId::Ymm23: - return "ymm23"; - case RegisterId::Ymm24: - return "ymm24"; - case RegisterId::Ymm25: - return "ymm25"; - case RegisterId::Ymm26: - return "ymm26"; - case RegisterId::Ymm27: - return "ymm27"; - case RegisterId::Ymm28: - return "ymm28"; - case RegisterId::Ymm29: - return "ymm29"; - case RegisterId::Ymm30: - return "ymm30"; - case RegisterId::Ymm31: - return "ymm31"; + Ymm0, + Ymm1, + Ymm2, + Ymm3, + Ymm4, + Ymm5, + Ymm6, + Ymm7, + Ymm8, + Ymm9, + Ymm10, + Ymm11, + Ymm12, + Ymm13, + Ymm14, + Ymm15, + Ymm16, + Ymm17, + Ymm18, + Ymm19, + Ymm20, + Ymm21, + Ymm22, + Ymm23, + Ymm24, + Ymm25, + Ymm26, + Ymm27, + Ymm28, + Ymm29, + Ymm30, + Ymm31, // Floating point vector registers 512-bit - case RegisterId::Zmm0: - return "zmm0"; - case RegisterId::Zmm1: - return "zmm1"; - case RegisterId::Zmm2: - return "zmm2"; - case RegisterId::Zmm3: - return "zmm3"; - case RegisterId::Zmm4: - return "zmm4"; - case RegisterId::Zmm5: - return "zmm5"; - case RegisterId::Zmm6: - return "zmm6"; - case RegisterId::Zmm7: - return "zmm7"; - case RegisterId::Zmm8: - return "zmm8"; - case RegisterId::Zmm9: - return "zmm9"; - case RegisterId::Zmm10: - return "zmm10"; - case RegisterId::Zmm11: - return "zmm11"; - case RegisterId::Zmm12: - return "zmm12"; - case RegisterId::Zmm13: - return "zmm13"; - case RegisterId::Zmm14: - return "zmm14"; - case RegisterId::Zmm15: - return "zmm15"; - case RegisterId::Zmm16: - return "zmm16"; - case RegisterId::Zmm17: - return "zmm17"; - case RegisterId::Zmm18: - return "zmm18"; - case RegisterId::Zmm19: - return "zmm19"; - case RegisterId::Zmm20: - return "zmm20"; - case RegisterId::Zmm21: - return "zmm21"; - case RegisterId::Zmm22: - return "zmm22"; - case RegisterId::Zmm23: - return "zmm23"; - case RegisterId::Zmm24: - return "zmm24"; - case RegisterId::Zmm25: - return "zmm25"; - case RegisterId::Zmm26: - return "zmm26"; - case RegisterId::Zmm27: - return "zmm27"; - case RegisterId::Zmm28: - return "zmm28"; - case RegisterId::Zmm29: - return "zmm29"; - case RegisterId::Zmm30: - return "zmm30"; - case RegisterId::Zmm31: - return "zmm31"; + Zmm0, + Zmm1, + Zmm2, + Zmm3, + Zmm4, + Zmm5, + Zmm6, + Zmm7, + Zmm8, + Zmm9, + Zmm10, + Zmm11, + Zmm12, + Zmm13, + Zmm14, + Zmm15, + Zmm16, + Zmm17, + Zmm18, + Zmm19, + Zmm20, + Zmm21, + Zmm22, + Zmm23, + Zmm24, + Zmm25, + Zmm26, + Zmm27, + Zmm28, + Zmm29, + Zmm30, + Zmm31, // Matrix registers - case RegisterId::Tmm0: - return "tmm0"; - case RegisterId::Tmm1: - return "tmm1"; - case RegisterId::Tmm2: - return "tmm2"; - case RegisterId::Tmm3: - return "tmm3"; - case RegisterId::Tmm4: - return "tmm4"; - case RegisterId::Tmm5: - return "tmm5"; - case RegisterId::Tmm6: - return "tmm6"; - case RegisterId::Tmm7: - return "tmm7"; - case RegisterId::Flags: - return "flags"; - case RegisterId::EFlags: - return "eflags"; - case RegisterId::RFlags: - return "rflags"; - case RegisterId::Ip: - return "ip"; - case RegisterId::Eip: - return "eip"; - case RegisterId::Rip: - return "rip"; - case RegisterId::Es: - return "es"; - case RegisterId::Cs: - return "cs"; - case RegisterId::Ss: - return "ss"; - case RegisterId::Ds: - return "ds"; - case RegisterId::Fs: - return "fs"; - case RegisterId::Gs: - return "gs"; - case RegisterId::Gdtr: - return "gdtr"; - case RegisterId::Ldtr: - return "ldtr"; - case RegisterId::Idtr: - return "idtr"; - case RegisterId::Tr: - return "tr"; - case RegisterId::Tr0: - return "tr0"; - case RegisterId::Tr1: - return "tr1"; - case RegisterId::Tr2: - return "tr2"; - case RegisterId::Tr3: - return "tr3"; - case RegisterId::Tr4: - return "tr4"; - case RegisterId::Tr5: - return "tr5"; - case RegisterId::Tr6: - return "tr6"; - case RegisterId::Tr7: - return "tr7"; + Tmm0, + Tmm1, + Tmm2, + Tmm3, + Tmm4, + Tmm5, + Tmm6, + Tmm7, + // Flags registers + Flags, + EFlags, + RFlags, + // Instruction-pointer registers + Ip, + Eip, + Rip, + // Segment registers + Es, + Cs, + Ss, + Ds, + Fs, + Gs, + // Table registers + Gdtr, + Ldtr, + Idtr, + Tr, + // Test registers + Tr0, + Tr1, + Tr2, + Tr3, + Tr4, + Tr5, + Tr6, + Tr7, // Control registers - case RegisterId::Cr0: - return "cr0"; - case RegisterId::Cr1: - return "cr1"; - case RegisterId::Cr2: - return "cr2"; - case RegisterId::Cr3: - return "cr3"; - case RegisterId::Cr4: - return "cr4"; - case RegisterId::Cr5: - return "cr5"; - case RegisterId::Cr6: - return "cr6"; - case RegisterId::Cr7: - return "cr7"; - case RegisterId::Cr8: - return "cr8"; - case RegisterId::Cr9: - return "cr9"; - case RegisterId::Cr10: - return "cr10"; - case RegisterId::Cr11: - return "cr11"; - case RegisterId::Cr12: - return "cr12"; - case RegisterId::Cr13: - return "cr13"; - case RegisterId::Cr14: - return "cr14"; - case RegisterId::Cr15: - return "cr15"; + Cr0, + Cr1, + Cr2, + Cr3, + Cr4, + Cr5, + Cr6, + Cr7, + Cr8, + Cr9, + Cr10, + Cr11, + Cr12, + Cr13, + Cr14, + Cr15, // Debug registers - case RegisterId::Dr0: - return "dr0"; - case RegisterId::Dr1: - return "dr1"; - case RegisterId::Dr2: - return "dr2"; - case RegisterId::Dr3: - return "dr3"; - case RegisterId::Dr4: - return "dr4"; - case RegisterId::Dr5: - return "dr5"; - case RegisterId::Dr6: - return "dr6"; - case RegisterId::Dr7: - return "dr7"; - case RegisterId::Dr8: - return "dr8"; - case RegisterId::Dr9: - return "dr9"; - case RegisterId::Dr10: - return "dr10"; - case RegisterId::Dr11: - return "dr11"; - case RegisterId::Dr12: - return "dr12"; - case RegisterId::Dr13: - return "dr13"; - case RegisterId::Dr14: - return "dr14"; - case RegisterId::Dr15: - return "dr15"; - case RegisterId::K0: - return "k0"; - case RegisterId::K1: - return "k1"; - case RegisterId::K2: - return "k2"; - case RegisterId::K3: - return "k3"; - case RegisterId::K4: - return "k4"; - case RegisterId::K5: - return "k5"; - case RegisterId::K6: - return "k6"; - case RegisterId::K7: - return "k7"; - case RegisterId::Bnd0: - return "bnd0"; - case RegisterId::Bnd1: - return "bnd1"; - case RegisterId::Bnd2: - return "bnd2"; - case RegisterId::Bnd3: - return "bnd3"; - case RegisterId::BndCfg: - return "bndcfg"; - case RegisterId::BndStatus: - return "bndstatus"; - case RegisterId::Mxcsr: - return "mxcsr"; - case RegisterId::Pkru: - return "pkru"; - case RegisterId::Xcr0: - return "xcr0"; + Dr0, + Dr1, + Dr2, + Dr3, + Dr4, + Dr5, + Dr6, + Dr7, + Dr8, + Dr9, + Dr10, + Dr11, + Dr12, + Dr13, + Dr14, + Dr15, + // Mask registers + K0, + K1, + K2, + K3, + K4, + K5, + K6, + K7, + // Bound registers + Bnd0, + Bnd1, + Bnd2, + Bnd3, + BndCfg, + BndStatus, + // Uncategorized + Mxcsr, + Pkru, + Xcr0, + + // Host Aliases +#ifdef _M_AMD64 + Nax = Rax, + Ncx = Rcx, + Ndx = Rdx, + Nbx = Rbx, + Nsp = Rsp, + Nbp = Rbp, + Nsi = Rsi, + Ndi = Rdi, + N8 = R8, + N9 = R9, + N10 = R10, + N11 = R11, + N12 = R12, + N13 = R13, + N14 = R14, + N15 = R15, + Nip = Rip, + NFlags = RFlags, +#else + Nax = Eax, + Ncx = Ecx, + Ndx = Edx, + Nbx = Ebx, + Nsp = Esp, + Nbp = Ebp, + Nsi = Esi, + Ndi = Edi, + N8 = R8d, + N9 = R9d, + N10 = R10d, + N11 = R11d, + N12 = R12d, + N13 = R13d, + N14 = R14d, + N15 = R15d, + Nip = Eip, + NFlags = EFlags, +#endif + Invalid = 0xFFFF, + }; + + static const char* GetName(Id id) + { + switch (id) + { + case Id::None: + return "none"; + case Id::Al: + return "al"; + case Id::Cl: + return "cl"; + case Id::Dl: + return "dl"; + case Id::Bl: + return "bl"; + case Id::Ah: + return "ah"; + case Id::Ch: + return "ch"; + case Id::Dh: + return "dh"; + case Id::Bh: + return "bh"; + case Id::Spl: + return "spl"; + case Id::Bpl: + return "bpl"; + case Id::Sil: + return "sil"; + case Id::Dil: + return "dil"; + case Id::R8b: + return "r8b"; + case Id::R9b: + return "r9b"; + case Id::R10b: + return "r10b"; + case Id::R11b: + return "r11b"; + case Id::R12b: + return "r12b"; + case Id::R13b: + return "r13b"; + case Id::R14b: + return "r14b"; + case Id::R15b: + return "r15b"; + case Id::Ax: + return "ax"; + case Id::Cx: + return "cx"; + case Id::Dx: + return "dx"; + case Id::Bx: + return "bx"; + case Id::Sp: + return "sp"; + case Id::Bp: + return "bp"; + case Id::Si: + return "si"; + case Id::Di: + return "di"; + case Id::R8w: + return "r8w"; + case Id::R9w: + return "r9w"; + case Id::R10w: + return "r10w"; + case Id::R11w: + return "r11w"; + case Id::R12w: + return "r12w"; + case Id::R13w: + return "r13w"; + case Id::R14w: + return "r14w"; + case Id::R15w: + return "r15w"; + case Id::Eax: + return "eax"; + case Id::Ecx: + return "ecx"; + case Id::Edx: + return "edx"; + case Id::Ebx: + return "ebx"; + case Id::Esp: + return "esp"; + case Id::Ebp: + return "ebp"; + case Id::Esi: + return "esi"; + case Id::Edi: + return "edi"; + case Id::R8d: + return "r8d"; + case Id::R9d: + return "r9d"; + case Id::R10d: + return "r10d"; + case Id::R11d: + return "r11d"; + case Id::R12d: + return "r12d"; + case Id::R13d: + return "r13d"; + case Id::R14d: + return "r14d"; + case Id::R15d: + return "r15d"; + case Id::Rax: + return "rax"; + case Id::Rcx: + return "rcx"; + case Id::Rdx: + return "rdx"; + case Id::Rbx: + return "rbx"; + case Id::Rsp: + return "rsp"; + case Id::Rbp: + return "rbp"; + case Id::Rsi: + return "rsi"; + case Id::Rdi: + return "rdi"; + case Id::R8: + return "r8"; + case Id::R9: + return "r9"; + case Id::R10: + return "r10"; + case Id::R11: + return "r11"; + case Id::R12: + return "r12"; + case Id::R13: + return "r13"; + case Id::R14: + return "r14"; + case Id::R15: + return "r15"; + case Id::St0: + return "st0"; + case Id::St1: + return "st1"; + case Id::St2: + return "st2"; + case Id::St3: + return "st3"; + case Id::St4: + return "st4"; + case Id::St5: + return "st5"; + case Id::St6: + return "st6"; + case Id::St7: + return "st7"; + case Id::X87Control: + return "x87control"; + case Id::X87Status: + return "x87status"; + case Id::X87Tag: + return "x87tag"; + case Id::Mm0: + return "mm0"; + case Id::Mm1: + return "mm1"; + case Id::Mm2: + return "mm2"; + case Id::Mm3: + return "mm3"; + case Id::Mm4: + return "mm4"; + case Id::Mm5: + return "mm5"; + case Id::Mm6: + return "mm6"; + case Id::Mm7: + return "mm7"; + // Floating point vector registers 128-bit + case Id::Xmm0: + return "xmm0"; + case Id::Xmm1: + return "xmm1"; + case Id::Xmm2: + return "xmm2"; + case Id::Xmm3: + return "xmm3"; + case Id::Xmm4: + return "xmm4"; + case Id::Xmm5: + return "xmm5"; + case Id::Xmm6: + return "xmm6"; + case Id::Xmm7: + return "xmm7"; + case Id::Xmm8: + return "xmm8"; + case Id::Xmm9: + return "xmm9"; + case Id::Xmm10: + return "xmm10"; + case Id::Xmm11: + return "xmm11"; + case Id::Xmm12: + return "xmm12"; + case Id::Xmm13: + return "xmm13"; + case Id::Xmm14: + return "xmm14"; + case Id::Xmm15: + return "xmm15"; + case Id::Xmm16: + return "xmm16"; + case Id::Xmm17: + return "xmm17"; + case Id::Xmm18: + return "xmm18"; + case Id::Xmm19: + return "xmm19"; + case Id::Xmm20: + return "xmm20"; + case Id::Xmm21: + return "xmm21"; + case Id::Xmm22: + return "xmm22"; + case Id::Xmm23: + return "xmm23"; + case Id::Xmm24: + return "xmm24"; + case Id::Xmm25: + return "xmm25"; + case Id::Xmm26: + return "xmm26"; + case Id::Xmm27: + return "xmm27"; + case Id::Xmm28: + return "xmm28"; + case Id::Xmm29: + return "xmm29"; + case Id::Xmm30: + return "xmm30"; + case Id::Xmm31: + return "xmm31"; + // Floating point vector registers 256-bit + case Id::Ymm0: + return "ymm0"; + case Id::Ymm1: + return "ymm1"; + case Id::Ymm2: + return "ymm2"; + case Id::Ymm3: + return "ymm3"; + case Id::Ymm4: + return "ymm4"; + case Id::Ymm5: + return "ymm5"; + case Id::Ymm6: + return "ymm6"; + case Id::Ymm7: + return "ymm7"; + case Id::Ymm8: + return "ymm8"; + case Id::Ymm9: + return "ymm9"; + case Id::Ymm10: + return "ymm10"; + case Id::Ymm11: + return "ymm11"; + case Id::Ymm12: + return "ymm12"; + case Id::Ymm13: + return "ymm13"; + case Id::Ymm14: + return "ymm14"; + case Id::Ymm15: + return "ymm15"; + case Id::Ymm16: + return "ymm16"; + case Id::Ymm17: + return "ymm17"; + case Id::Ymm18: + return "ymm18"; + case Id::Ymm19: + return "ymm19"; + case Id::Ymm20: + return "ymm20"; + case Id::Ymm21: + return "ymm21"; + case Id::Ymm22: + return "ymm22"; + case Id::Ymm23: + return "ymm23"; + case Id::Ymm24: + return "ymm24"; + case Id::Ymm25: + return "ymm25"; + case Id::Ymm26: + return "ymm26"; + case Id::Ymm27: + return "ymm27"; + case Id::Ymm28: + return "ymm28"; + case Id::Ymm29: + return "ymm29"; + case Id::Ymm30: + return "ymm30"; + case Id::Ymm31: + return "ymm31"; + // Floating point vector registers 512-bit + case Id::Zmm0: + return "zmm0"; + case Id::Zmm1: + return "zmm1"; + case Id::Zmm2: + return "zmm2"; + case Id::Zmm3: + return "zmm3"; + case Id::Zmm4: + return "zmm4"; + case Id::Zmm5: + return "zmm5"; + case Id::Zmm6: + return "zmm6"; + case Id::Zmm7: + return "zmm7"; + case Id::Zmm8: + return "zmm8"; + case Id::Zmm9: + return "zmm9"; + case Id::Zmm10: + return "zmm10"; + case Id::Zmm11: + return "zmm11"; + case Id::Zmm12: + return "zmm12"; + case Id::Zmm13: + return "zmm13"; + case Id::Zmm14: + return "zmm14"; + case Id::Zmm15: + return "zmm15"; + case Id::Zmm16: + return "zmm16"; + case Id::Zmm17: + return "zmm17"; + case Id::Zmm18: + return "zmm18"; + case Id::Zmm19: + return "zmm19"; + case Id::Zmm20: + return "zmm20"; + case Id::Zmm21: + return "zmm21"; + case Id::Zmm22: + return "zmm22"; + case Id::Zmm23: + return "zmm23"; + case Id::Zmm24: + return "zmm24"; + case Id::Zmm25: + return "zmm25"; + case Id::Zmm26: + return "zmm26"; + case Id::Zmm27: + return "zmm27"; + case Id::Zmm28: + return "zmm28"; + case Id::Zmm29: + return "zmm29"; + case Id::Zmm30: + return "zmm30"; + case Id::Zmm31: + return "zmm31"; + // Matrix registers + case Id::Tmm0: + return "tmm0"; + case Id::Tmm1: + return "tmm1"; + case Id::Tmm2: + return "tmm2"; + case Id::Tmm3: + return "tmm3"; + case Id::Tmm4: + return "tmm4"; + case Id::Tmm5: + return "tmm5"; + case Id::Tmm6: + return "tmm6"; + case Id::Tmm7: + return "tmm7"; + case Id::Flags: + return "flags"; + case Id::EFlags: + return "eflags"; + case Id::RFlags: + return "rflags"; + case Id::Ip: + return "ip"; + case Id::Eip: + return "eip"; + case Id::Rip: + return "rip"; + case Id::Es: + return "es"; + case Id::Cs: + return "cs"; + case Id::Ss: + return "ss"; + case Id::Ds: + return "ds"; + case Id::Fs: + return "fs"; + case Id::Gs: + return "gs"; + case Id::Gdtr: + return "gdtr"; + case Id::Ldtr: + return "ldtr"; + case Id::Idtr: + return "idtr"; + case Id::Tr: + return "tr"; + case Id::Tr0: + return "tr0"; + case Id::Tr1: + return "tr1"; + case Id::Tr2: + return "tr2"; + case Id::Tr3: + return "tr3"; + case Id::Tr4: + return "tr4"; + case Id::Tr5: + return "tr5"; + case Id::Tr6: + return "tr6"; + case Id::Tr7: + return "tr7"; + // Control registers + case Id::Cr0: + return "cr0"; + case Id::Cr1: + return "cr1"; + case Id::Cr2: + return "cr2"; + case Id::Cr3: + return "cr3"; + case Id::Cr4: + return "cr4"; + case Id::Cr5: + return "cr5"; + case Id::Cr6: + return "cr6"; + case Id::Cr7: + return "cr7"; + case Id::Cr8: + return "cr8"; + case Id::Cr9: + return "cr9"; + case Id::Cr10: + return "cr10"; + case Id::Cr11: + return "cr11"; + case Id::Cr12: + return "cr12"; + case Id::Cr13: + return "cr13"; + case Id::Cr14: + return "cr14"; + case Id::Cr15: + return "cr15"; + // Debug registers + case Id::Dr0: + return "dr0"; + case Id::Dr1: + return "dr1"; + case Id::Dr2: + return "dr2"; + case Id::Dr3: + return "dr3"; + case Id::Dr4: + return "dr4"; + case Id::Dr5: + return "dr5"; + case Id::Dr6: + return "dr6"; + case Id::Dr7: + return "dr7"; + case Id::Dr8: + return "dr8"; + case Id::Dr9: + return "dr9"; + case Id::Dr10: + return "dr10"; + case Id::Dr11: + return "dr11"; + case Id::Dr12: + return "dr12"; + case Id::Dr13: + return "dr13"; + case Id::Dr14: + return "dr14"; + case Id::Dr15: + return "dr15"; + case Id::K0: + return "k0"; + case Id::K1: + return "k1"; + case Id::K2: + return "k2"; + case Id::K3: + return "k3"; + case Id::K4: + return "k4"; + case Id::K5: + return "k5"; + case Id::K6: + return "k6"; + case Id::K7: + return "k7"; + case Id::Bnd0: + return "bnd0"; + case Id::Bnd1: + return "bnd1"; + case Id::Bnd2: + return "bnd2"; + case Id::Bnd3: + return "bnd3"; + case Id::BndCfg: + return "bndcfg"; + case Id::BndStatus: + return "bndstatus"; + case Id::Mxcsr: + return "mxcsr"; + case Id::Pkru: + return "pkru"; + case Id::Xcr0: + return "xcr0"; + } + return "invalid"; } - return "invalid"; - } - inline int RegisterGetSize(RegisterId id) - { - switch (id) + static int GetSize(Id id) { - case RegisterId::None: - return 0; - case RegisterId::Al: - case RegisterId::Cl: - case RegisterId::Dl: - case RegisterId::Bl: - case RegisterId::Ah: - case RegisterId::Ch: - case RegisterId::Dh: - case RegisterId::Bh: - case RegisterId::Spl: - case RegisterId::Bpl: - case RegisterId::Sil: - case RegisterId::Dil: - case RegisterId::R8b: - case RegisterId::R9b: - case RegisterId::R10b: - case RegisterId::R11b: - case RegisterId::R12b: - case RegisterId::R13b: - case RegisterId::R14b: - case RegisterId::R15b: - return 8; - case RegisterId::Ax: - case RegisterId::Cx: - case RegisterId::Dx: - case RegisterId::Bx: - case RegisterId::Sp: - case RegisterId::Bp: - case RegisterId::Si: - case RegisterId::Di: - case RegisterId::R8w: - case RegisterId::R9w: - case RegisterId::R10w: - case RegisterId::R11w: - case RegisterId::R12w: - case RegisterId::R13w: - case RegisterId::R14w: - case RegisterId::R15w: - return 16; - case RegisterId::Eax: - case RegisterId::Ecx: - case RegisterId::Edx: - case RegisterId::Ebx: - case RegisterId::Esp: - case RegisterId::Ebp: - case RegisterId::Esi: - case RegisterId::Edi: - case RegisterId::R8d: - case RegisterId::R9d: - case RegisterId::R10d: - case RegisterId::R11d: - case RegisterId::R12d: - case RegisterId::R13d: - case RegisterId::R14d: - case RegisterId::R15d: - return 32; - case RegisterId::Rax: - case RegisterId::Rcx: - case RegisterId::Rdx: - case RegisterId::Rbx: - case RegisterId::Rsp: - case RegisterId::Rbp: - case RegisterId::Rsi: - case RegisterId::Rdi: - case RegisterId::R8: - case RegisterId::R9: - case RegisterId::R10: - case RegisterId::R11: - case RegisterId::R12: - case RegisterId::R13: - case RegisterId::R14: - case RegisterId::R15: - return 64; - case RegisterId::St0: - case RegisterId::St1: - case RegisterId::St2: - case RegisterId::St3: - case RegisterId::St4: - case RegisterId::St5: - case RegisterId::St6: - case RegisterId::St7: - return 80; - case RegisterId::X87Control: - case RegisterId::X87Status: - case RegisterId::X87Tag: - return 16; - case RegisterId::Mm0: - case RegisterId::Mm1: - case RegisterId::Mm2: - case RegisterId::Mm3: - case RegisterId::Mm4: - case RegisterId::Mm5: - case RegisterId::Mm6: - case RegisterId::Mm7: - return 64; - case RegisterId::Xmm0: - case RegisterId::Xmm1: - case RegisterId::Xmm2: - case RegisterId::Xmm3: - case RegisterId::Xmm4: - case RegisterId::Xmm5: - case RegisterId::Xmm6: - case RegisterId::Xmm7: - case RegisterId::Xmm8: - case RegisterId::Xmm9: - case RegisterId::Xmm10: - case RegisterId::Xmm11: - case RegisterId::Xmm12: - case RegisterId::Xmm13: - case RegisterId::Xmm14: - case RegisterId::Xmm15: - case RegisterId::Xmm16: - case RegisterId::Xmm17: - case RegisterId::Xmm18: - case RegisterId::Xmm19: - case RegisterId::Xmm20: - case RegisterId::Xmm21: - case RegisterId::Xmm22: - case RegisterId::Xmm23: - case RegisterId::Xmm24: - case RegisterId::Xmm25: - case RegisterId::Xmm26: - case RegisterId::Xmm27: - case RegisterId::Xmm28: - case RegisterId::Xmm29: - case RegisterId::Xmm30: - case RegisterId::Xmm31: - return 128; - case RegisterId::Ymm0: - case RegisterId::Ymm1: - case RegisterId::Ymm2: - case RegisterId::Ymm3: - case RegisterId::Ymm4: - case RegisterId::Ymm5: - case RegisterId::Ymm6: - case RegisterId::Ymm7: - case RegisterId::Ymm8: - case RegisterId::Ymm9: - case RegisterId::Ymm10: - case RegisterId::Ymm11: - case RegisterId::Ymm12: - case RegisterId::Ymm13: - case RegisterId::Ymm14: - case RegisterId::Ymm15: - case RegisterId::Ymm16: - case RegisterId::Ymm17: - case RegisterId::Ymm18: - case RegisterId::Ymm19: - case RegisterId::Ymm20: - case RegisterId::Ymm21: - case RegisterId::Ymm22: - case RegisterId::Ymm23: - case RegisterId::Ymm24: - case RegisterId::Ymm25: - case RegisterId::Ymm26: - case RegisterId::Ymm27: - case RegisterId::Ymm28: - case RegisterId::Ymm29: - case RegisterId::Ymm30: - case RegisterId::Ymm31: - return 256; - case RegisterId::Zmm0: - case RegisterId::Zmm1: - case RegisterId::Zmm2: - case RegisterId::Zmm3: - case RegisterId::Zmm4: - case RegisterId::Zmm5: - case RegisterId::Zmm6: - case RegisterId::Zmm7: - case RegisterId::Zmm8: - case RegisterId::Zmm9: - case RegisterId::Zmm10: - case RegisterId::Zmm11: - case RegisterId::Zmm12: - case RegisterId::Zmm13: - case RegisterId::Zmm14: - case RegisterId::Zmm15: - case RegisterId::Zmm16: - case RegisterId::Zmm17: - case RegisterId::Zmm18: - case RegisterId::Zmm19: - case RegisterId::Zmm20: - case RegisterId::Zmm21: - case RegisterId::Zmm22: - case RegisterId::Zmm23: - case RegisterId::Zmm24: - case RegisterId::Zmm25: - case RegisterId::Zmm26: - case RegisterId::Zmm27: - case RegisterId::Zmm28: - case RegisterId::Zmm29: - case RegisterId::Zmm30: - case RegisterId::Zmm31: - return 512; - case RegisterId::Tmm0: - case RegisterId::Tmm1: - case RegisterId::Tmm2: - case RegisterId::Tmm3: - case RegisterId::Tmm4: - case RegisterId::Tmm5: - case RegisterId::Tmm6: - case RegisterId::Tmm7: - return 8192; - case RegisterId::Flags: - return 16; - case RegisterId::EFlags: - return 32; - case RegisterId::RFlags: - return 64; - case RegisterId::Ip: - return 16; - case RegisterId::Eip: - return 32; - case RegisterId::Rip: - return 64; - case RegisterId::Es: - case RegisterId::Cs: - case RegisterId::Ss: - case RegisterId::Ds: - case RegisterId::Fs: - case RegisterId::Gs: - return 16; - case RegisterId::Gdtr: - case RegisterId::Ldtr: - case RegisterId::Idtr: - case RegisterId::Tr: - return 16; - case RegisterId::Tr0: - case RegisterId::Tr1: - case RegisterId::Tr2: - case RegisterId::Tr3: - case RegisterId::Tr4: - case RegisterId::Tr5: - case RegisterId::Tr6: - case RegisterId::Tr7: - return 64; - case RegisterId::Cr0: - case RegisterId::Cr1: - case RegisterId::Cr2: - case RegisterId::Cr3: - case RegisterId::Cr4: - case RegisterId::Cr5: - case RegisterId::Cr6: - case RegisterId::Cr7: - case RegisterId::Cr8: - case RegisterId::Cr9: - case RegisterId::Cr10: - case RegisterId::Cr11: - case RegisterId::Cr12: - case RegisterId::Cr13: - case RegisterId::Cr14: - case RegisterId::Cr15: - return 64; - case RegisterId::Dr0: - case RegisterId::Dr1: - case RegisterId::Dr2: - case RegisterId::Dr3: - case RegisterId::Dr4: - case RegisterId::Dr5: - case RegisterId::Dr6: - case RegisterId::Dr7: - case RegisterId::Dr8: - case RegisterId::Dr9: - case RegisterId::Dr10: - case RegisterId::Dr11: - case RegisterId::Dr12: - case RegisterId::Dr13: - case RegisterId::Dr14: - case RegisterId::Dr15: + switch (id) + { + case Id::None: + return 0; + case Id::Al: + case Id::Cl: + case Id::Dl: + case Id::Bl: + case Id::Ah: + case Id::Ch: + case Id::Dh: + case Id::Bh: + case Id::Spl: + case Id::Bpl: + case Id::Sil: + case Id::Dil: + case Id::R8b: + case Id::R9b: + case Id::R10b: + case Id::R11b: + case Id::R12b: + case Id::R13b: + case Id::R14b: + case Id::R15b: + return 8; + case Id::Ax: + case Id::Cx: + case Id::Dx: + case Id::Bx: + case Id::Sp: + case Id::Bp: + case Id::Si: + case Id::Di: + case Id::R8w: + case Id::R9w: + case Id::R10w: + case Id::R11w: + case Id::R12w: + case Id::R13w: + case Id::R14w: + case Id::R15w: + return 16; + case Id::Eax: + case Id::Ecx: + case Id::Edx: + case Id::Ebx: + case Id::Esp: + case Id::Ebp: + case Id::Esi: + case Id::Edi: + case Id::R8d: + case Id::R9d: + case Id::R10d: + case Id::R11d: + case Id::R12d: + case Id::R13d: + case Id::R14d: + case Id::R15d: + return 32; + case Id::Rax: + case Id::Rcx: + case Id::Rdx: + case Id::Rbx: + case Id::Rsp: + case Id::Rbp: + case Id::Rsi: + case Id::Rdi: + case Id::R8: + case Id::R9: + case Id::R10: + case Id::R11: + case Id::R12: + case Id::R13: + case Id::R14: + case Id::R15: + return 64; + case Id::St0: + case Id::St1: + case Id::St2: + case Id::St3: + case Id::St4: + case Id::St5: + case Id::St6: + case Id::St7: + return 80; + case Id::X87Control: + case Id::X87Status: + case Id::X87Tag: + return 16; + case Id::Mm0: + case Id::Mm1: + case Id::Mm2: + case Id::Mm3: + case Id::Mm4: + case Id::Mm5: + case Id::Mm6: + case Id::Mm7: + return 64; + case Id::Xmm0: + case Id::Xmm1: + case Id::Xmm2: + case Id::Xmm3: + case Id::Xmm4: + case Id::Xmm5: + case Id::Xmm6: + case Id::Xmm7: + case Id::Xmm8: + case Id::Xmm9: + case Id::Xmm10: + case Id::Xmm11: + case Id::Xmm12: + case Id::Xmm13: + case Id::Xmm14: + case Id::Xmm15: + case Id::Xmm16: + case Id::Xmm17: + case Id::Xmm18: + case Id::Xmm19: + case Id::Xmm20: + case Id::Xmm21: + case Id::Xmm22: + case Id::Xmm23: + case Id::Xmm24: + case Id::Xmm25: + case Id::Xmm26: + case Id::Xmm27: + case Id::Xmm28: + case Id::Xmm29: + case Id::Xmm30: + case Id::Xmm31: + return 128; + case Id::Ymm0: + case Id::Ymm1: + case Id::Ymm2: + case Id::Ymm3: + case Id::Ymm4: + case Id::Ymm5: + case Id::Ymm6: + case Id::Ymm7: + case Id::Ymm8: + case Id::Ymm9: + case Id::Ymm10: + case Id::Ymm11: + case Id::Ymm12: + case Id::Ymm13: + case Id::Ymm14: + case Id::Ymm15: + case Id::Ymm16: + case Id::Ymm17: + case Id::Ymm18: + case Id::Ymm19: + case Id::Ymm20: + case Id::Ymm21: + case Id::Ymm22: + case Id::Ymm23: + case Id::Ymm24: + case Id::Ymm25: + case Id::Ymm26: + case Id::Ymm27: + case Id::Ymm28: + case Id::Ymm29: + case Id::Ymm30: + case Id::Ymm31: + return 256; + case Id::Zmm0: + case Id::Zmm1: + case Id::Zmm2: + case Id::Zmm3: + case Id::Zmm4: + case Id::Zmm5: + case Id::Zmm6: + case Id::Zmm7: + case Id::Zmm8: + case Id::Zmm9: + case Id::Zmm10: + case Id::Zmm11: + case Id::Zmm12: + case Id::Zmm13: + case Id::Zmm14: + case Id::Zmm15: + case Id::Zmm16: + case Id::Zmm17: + case Id::Zmm18: + case Id::Zmm19: + case Id::Zmm20: + case Id::Zmm21: + case Id::Zmm22: + case Id::Zmm23: + case Id::Zmm24: + case Id::Zmm25: + case Id::Zmm26: + case Id::Zmm27: + case Id::Zmm28: + case Id::Zmm29: + case Id::Zmm30: + case Id::Zmm31: + return 512; + case Id::Tmm0: + case Id::Tmm1: + case Id::Tmm2: + case Id::Tmm3: + case Id::Tmm4: + case Id::Tmm5: + case Id::Tmm6: + case Id::Tmm7: + return 8192; + case Id::Flags: + return 16; + case Id::EFlags: + return 32; + case Id::RFlags: + return 64; + case Id::Ip: + return 16; + case Id::Eip: + return 32; + case Id::Rip: + return 64; + case Id::Es: + case Id::Cs: + case Id::Ss: + case Id::Ds: + case Id::Fs: + case Id::Gs: + return 16; + case Id::Gdtr: + case Id::Ldtr: + case Id::Idtr: + case Id::Tr: + return 16; + case Id::Tr0: + case Id::Tr1: + case Id::Tr2: + case Id::Tr3: + case Id::Tr4: + case Id::Tr5: + case Id::Tr6: + case Id::Tr7: + return 64; + case Id::Cr0: + case Id::Cr1: + case Id::Cr2: + case Id::Cr3: + case Id::Cr4: + case Id::Cr5: + case Id::Cr6: + case Id::Cr7: + case Id::Cr8: + case Id::Cr9: + case Id::Cr10: + case Id::Cr11: + case Id::Cr12: + case Id::Cr13: + case Id::Cr14: + case Id::Cr15: + return 64; + case Id::Dr0: + case Id::Dr1: + case Id::Dr2: + case Id::Dr3: + case Id::Dr4: + case Id::Dr5: + case Id::Dr6: + case Id::Dr7: + case Id::Dr8: + case Id::Dr9: + case Id::Dr10: + case Id::Dr11: + case Id::Dr12: + case Id::Dr13: + case Id::Dr14: + case Id::Dr15: #ifdef _M_AMD64 - return 64; + return 64; #else - return 32; + return 32; #endif - case RegisterId::K0: - case RegisterId::K1: - case RegisterId::K2: - case RegisterId::K3: - case RegisterId::K4: - case RegisterId::K5: - case RegisterId::K6: - case RegisterId::K7: - return 64; - case RegisterId::Bnd0: - case RegisterId::Bnd1: - case RegisterId::Bnd2: - case RegisterId::Bnd3: - return 128; - case RegisterId::BndCfg: - case RegisterId::BndStatus: - return 16; - case RegisterId::Mxcsr: - return 32; - case RegisterId::Pkru: - case RegisterId::Xcr0: + case Id::K0: + case Id::K1: + case Id::K2: + case Id::K3: + case Id::K4: + case Id::K5: + case Id::K6: + case Id::K7: + return 64; + case Id::Bnd0: + case Id::Bnd1: + case Id::Bnd2: + case Id::Bnd3: + return 128; + case Id::BndCfg: + case Id::BndStatus: + return 16; + case Id::Mxcsr: + return 32; + case Id::Pkru: + case Id::Xcr0: + return 0; + } return 0; } - return 0; - } - inline RegisterId RegisterGetRoot(RegisterId id) - { - switch (id) + static Id GetRoot(Id id) { - case RegisterId::Al: - case RegisterId::Ax: - case RegisterId::Ah: + switch (id) + { + case Id::Al: + case Id::Ax: + case Id::Ah: #ifdef _M_AMD64 - return RegisterId::Rax; + return Id::Rax; #else - return RegisterId::Eax; + return Id::Eax; #endif - case RegisterId::Cl: - case RegisterId::Cx: - case RegisterId::Ch: + case Id::Cl: + case Id::Cx: + case Id::Ch: #ifdef _M_AMD64 - return RegisterId::Rcx; + return Id::Rcx; #else - return RegisterId::Ecx; + return Id::Ecx; #endif - case RegisterId::Dl: - case RegisterId::Dx: - case RegisterId::Dh: + case Id::Dl: + case Id::Dx: + case Id::Dh: #ifdef _M_AMD64 - return RegisterId::Rdx; + return Id::Rdx; #else - return RegisterId::Edx; + return Id::Edx; #endif - case RegisterId::Bl: - case RegisterId::Bx: - case RegisterId::Bh: + case Id::Bl: + case Id::Bx: + case Id::Bh: #ifdef _M_AMD64 - return RegisterId::Rbx; + return Id::Rbx; #else - return RegisterId::Ebx; + return Id::Ebx; #endif - case RegisterId::Sp: - case RegisterId::Spl: + case Id::Sp: + case Id::Spl: #ifdef _M_AMD64 - return RegisterId::Rsp; + return Id::Rsp; #else - return RegisterId::Esp; + return Id::Esp; #endif - case RegisterId::Bpl: - case RegisterId::Bp: + case Id::Bpl: + case Id::Bp: #ifdef _M_AMD64 - return RegisterId::Rbp; + return Id::Rbp; #else - return RegisterId::Ebp; + return Id::Ebp; #endif - case RegisterId::Si: - case RegisterId::Sil: + case Id::Si: + case Id::Sil: #ifdef _M_AMD64 - return RegisterId::Rsi; + return Id::Rsi; #else - return RegisterId::Esi; + return Id::Esi; #endif - case RegisterId::Di: - case RegisterId::Dil: + case Id::Di: + case Id::Dil: #ifdef _M_AMD64 - return RegisterId::Rdi; + return Id::Rdi; #else - return RegisterId::Edi; + return Id::Edi; #endif #ifdef _M_AMD64 - case RegisterId::R8b: - case RegisterId::R8w: - return RegisterId::R8; - case RegisterId::R9b: - case RegisterId::R9w: - return RegisterId::R9; - case RegisterId::R10b: - case RegisterId::R10w: - return RegisterId::R10; - case RegisterId::R11b: - case RegisterId::R11w: - return RegisterId::R11; - case RegisterId::R12b: - case RegisterId::R12w: - return RegisterId::R12; - case RegisterId::R13b: - case RegisterId::R13w: - return RegisterId::R13; - case RegisterId::R14b: - case RegisterId::R14w: - return RegisterId::R14; - case RegisterId::R15b: - case RegisterId::R15w: - return RegisterId::R15; + case Id::R8b: + case Id::R8w: + return Id::R8; + case Id::R9b: + case Id::R9w: + return Id::R9; + case Id::R10b: + case Id::R10w: + return Id::R10; + case Id::R11b: + case Id::R11w: + return Id::R11; + case Id::R12b: + case Id::R12w: + return Id::R12; + case Id::R13b: + case Id::R13w: + return Id::R13; + case Id::R14b: + case Id::R14w: + return Id::R14; + case Id::R15b: + case Id::R15w: + return Id::R15; #endif - case RegisterId::Eax: + case Id::Eax: #ifdef _M_AMD64 - return RegisterId::Rax; + return Id::Rax; #endif - case RegisterId::Ecx: + case Id::Ecx: #ifdef _M_AMD64 - return RegisterId::Rcx; + return Id::Rcx; #endif - case RegisterId::Edx: + case Id::Edx: #ifdef _M_AMD64 - return RegisterId::Rdx; + return Id::Rdx; #endif - case RegisterId::Ebx: + case Id::Ebx: #ifdef _M_AMD64 - return RegisterId::Rbx; + return Id::Rbx; #endif - case RegisterId::Esp: + case Id::Esp: #ifdef _M_AMD64 - return RegisterId::Rsp; + return Id::Rsp; #endif - case RegisterId::Ebp: + case Id::Ebp: #ifdef _M_AMD64 - return RegisterId::Rbp; + return Id::Rbp; #endif - case RegisterId::Esi: + case Id::Esi: #ifdef _M_AMD64 - return RegisterId::Rsi; + return Id::Rsi; #endif - case RegisterId::Edi: + case Id::Edi: #ifdef _M_AMD64 - return RegisterId::Rdi; + return Id::Rdi; #endif - break; + break; #ifdef _M_AMD64 - case RegisterId::R8d: + case Id::R8d: # ifdef _M_AMD64 - return RegisterId::R8; + return Id::R8; # endif - case RegisterId::R9d: + case Id::R9d: # ifdef _M_AMD64 - return RegisterId::R9; + return Id::R9; # endif - case RegisterId::R10d: + case Id::R10d: # ifdef _M_AMD64 - return RegisterId::R10; + return Id::R10; # endif - case RegisterId::R11d: + case Id::R11d: # ifdef _M_AMD64 - return RegisterId::R11; + return Id::R11; # endif - case RegisterId::R12d: + case Id::R12d: # ifdef _M_AMD64 - return RegisterId::R12; + return Id::R12; # endif - case RegisterId::R13d: + case Id::R13d: # ifdef _M_AMD64 - return RegisterId::R13; + return Id::R13; # endif - case RegisterId::R14d: + case Id::R14d: # ifdef _M_AMD64 - return RegisterId::R14; + return Id::R14; # endif - case RegisterId::R15d: + case Id::R15d: # ifdef _M_AMD64 - return RegisterId::R15; + return Id::R15; # endif - break; + break; #endif - case RegisterId::Flags: + case Id::Flags: #ifdef _M_AMD64 - return RegisterId::RFlags; + return Id::RFlags; #else - return RegisterId::EFlags; + return Id::EFlags; #endif - case RegisterId::EFlags: + case Id::EFlags: #ifdef _M_AMD64 - return RegisterId::RFlags; + return Id::RFlags; #endif - case RegisterId::RFlags: - case RegisterId::Ip: + case Id::RFlags: + case Id::Ip: #ifdef _M_AMD64 - return RegisterId::Rip; + return Id::Rip; #else - return RegisterId::Eip; + return Id::Eip; #endif - case RegisterId::Eip: + case Id::Eip: #ifdef _M_AMD64 - return RegisterId::Rip; + return Id::Rip; #endif - case RegisterId::Rip: - break; + case Id::Rip: + break; + } + return Id::None; } - return RegisterId::None; - } - inline RegisterId RegisterGetParent(RegisterId id) - { - switch (id) + static Id GetParent(Id id) { - case RegisterId::Al: - return RegisterId::Ax; - case RegisterId::Ax: - return RegisterId::Eax; - case RegisterId::Ah: - return RegisterId::Ax; - case RegisterId::Cl: - return RegisterId::Cx; - case RegisterId::Cx: - return RegisterId::Ecx; - case RegisterId::Ch: - return RegisterId::Cx; - case RegisterId::Dl: - return RegisterId::Dx; - case RegisterId::Dx: - return RegisterId::Edx; - case RegisterId::Dh: - return RegisterId::Dx; - case RegisterId::Bl: - return RegisterId::Bx; - case RegisterId::Bx: - return RegisterId::Ebx; - case RegisterId::Bh: - return RegisterId::Bx; - case RegisterId::Sp: - return RegisterId::Esp; - case RegisterId::Spl: - return RegisterId::Sp; - case RegisterId::Bpl: - return RegisterId::Bp; - case RegisterId::Bp: - return RegisterId::Ebp; - case RegisterId::Si: - return RegisterId::Esi; - case RegisterId::Sil: - return RegisterId::Si; - case RegisterId::Di: - return RegisterId::Edi; - case RegisterId::Dil: - return RegisterId::Di; + switch (id) + { + case Id::Al: + return Id::Ax; + case Id::Ax: + return Id::Eax; + case Id::Ah: + return Id::Ax; + case Id::Cl: + return Id::Cx; + case Id::Cx: + return Id::Ecx; + case Id::Ch: + return Id::Cx; + case Id::Dl: + return Id::Dx; + case Id::Dx: + return Id::Edx; + case Id::Dh: + return Id::Dx; + case Id::Bl: + return Id::Bx; + case Id::Bx: + return Id::Ebx; + case Id::Bh: + return Id::Bx; + case Id::Sp: + return Id::Esp; + case Id::Spl: + return Id::Sp; + case Id::Bpl: + return Id::Bp; + case Id::Bp: + return Id::Ebp; + case Id::Si: + return Id::Esi; + case Id::Sil: + return Id::Si; + case Id::Di: + return Id::Edi; + case Id::Dil: + return Id::Di; #ifdef _M_AMD64 - case RegisterId::R8b: - return RegisterId::R8w; - case RegisterId::R8w: - return RegisterId::R8d; - case RegisterId::R9b: - return RegisterId::R9w; - case RegisterId::R9w: - return RegisterId::R9d; - case RegisterId::R10b: - return RegisterId::R10w; - case RegisterId::R10w: - return RegisterId::R10d; - case RegisterId::R11b: - return RegisterId::R11w; - case RegisterId::R11w: - return RegisterId::R11d; - case RegisterId::R12b: - return RegisterId::R12w; - case RegisterId::R12w: - return RegisterId::R12d; - case RegisterId::R13b: - return RegisterId::R13w; - case RegisterId::R13w: - return RegisterId::R13d; - case RegisterId::R14b: - return RegisterId::R14w; - case RegisterId::R14w: - return RegisterId::R14d; - case RegisterId::R15b: - return RegisterId::R15w; - case RegisterId::R15w: - return RegisterId::R15d; + case Id::R8b: + return Id::R8w; + case Id::R8w: + return Id::R8d; + case Id::R9b: + return Id::R9w; + case Id::R9w: + return Id::R9d; + case Id::R10b: + return Id::R10w; + case Id::R10w: + return Id::R10d; + case Id::R11b: + return Id::R11w; + case Id::R11w: + return Id::R11d; + case Id::R12b: + return Id::R12w; + case Id::R12w: + return Id::R12d; + case Id::R13b: + return Id::R13w; + case Id::R13w: + return Id::R13d; + case Id::R14b: + return Id::R14w; + case Id::R14w: + return Id::R14d; + case Id::R15b: + return Id::R15w; + case Id::R15w: + return Id::R15d; #endif - case RegisterId::Eax: + case Id::Eax: #ifdef _M_AMD64 - return RegisterId::Rax; + return Id::Rax; #else - return RegisterId::None; + return Id::None; #endif - case RegisterId::Ecx: + case Id::Ecx: #ifdef _M_AMD64 - return RegisterId::Rcx; + return Id::Rcx; #else - return RegisterId::None; + return Id::None; #endif - case RegisterId::Edx: + case Id::Edx: #ifdef _M_AMD64 - return RegisterId::Rdx; + return Id::Rdx; #else - return RegisterId::None; + return Id::None; #endif - case RegisterId::Ebx: + case Id::Ebx: #ifdef _M_AMD64 - return RegisterId::Rbx; + return Id::Rbx; #endif - case RegisterId::Esp: + case Id::Esp: #ifdef _M_AMD64 - return RegisterId::Rsp; + return Id::Rsp; #else - return RegisterId::None; + return Id::None; #endif - case RegisterId::Ebp: + case Id::Ebp: #ifdef _M_AMD64 - return RegisterId::Rbp; + return Id::Rbp; #else - return RegisterId::None; + return Id::None; #endif - case RegisterId::Esi: + case Id::Esi: #ifdef _M_AMD64 - return RegisterId::Rsi; + return Id::Rsi; #else - return RegisterId::None; + return Id::None; #endif - case RegisterId::Edi: + case Id::Edi: #ifdef _M_AMD64 - return RegisterId::Rdi; + return Id::Rdi; #else - return RegisterId::None; + return Id::None; #endif #ifdef _M_AMD64 - case RegisterId::R8d: + case Id::R8d: # ifdef _M_AMD64 - return RegisterId::R8; + return Id::R8; # else - return RegisterId::None; + return Id::None; # endif - case RegisterId::R9d: + case Id::R9d: # ifdef _M_AMD64 - return RegisterId::R9; + return Id::R9; # else - return RegisterId::None; + return Id::None; # endif - case RegisterId::R10d: + case Id::R10d: # ifdef _M_AMD64 - return RegisterId::R10; + return Id::R10; # else - return RegisterId::None; + return Id::None; # endif - case RegisterId::R11d: + case Id::R11d: # ifdef _M_AMD64 - return RegisterId::R11; + return Id::R11; # else - return RegisterId::None; + return Id::None; # endif - case RegisterId::R12d: + case Id::R12d: # ifdef _M_AMD64 - return RegisterId::R12; + return Id::R12; # else - return RegisterId::None; + return Id::None; # endif - case RegisterId::R13d: + case Id::R13d: # ifdef _M_AMD64 - return RegisterId::R13; + return Id::R13; # else - return RegisterId::None; + return Id::None; # endif - case RegisterId::R14d: + case Id::R14d: # ifdef _M_AMD64 - return RegisterId::R14; + return Id::R14; # else - return RegisterId::None; + return Id::None; # endif - case RegisterId::R15d: + case Id::R15d: # ifdef _M_AMD64 - return RegisterId::R15; + return Id::R15; # else - return RegisterId::None; + return Id::None; # endif #endif - case RegisterId::Flags: + case Id::Flags: #ifdef _M_AMD64 - return RegisterId::RFlags; + return Id::RFlags; #else - return RegisterId::EFlags; + return Id::EFlags; #endif - case RegisterId::EFlags: + case Id::EFlags: #ifdef _M_AMD64 - return RegisterId::RFlags; + return Id::RFlags; #endif - case RegisterId::RFlags: - case RegisterId::Ip: + case Id::RFlags: + case Id::Ip: #ifdef _M_AMD64 - return RegisterId::Rip; + return Id::Rip; #else - return RegisterId::Eip; + return Id::Eip; #endif - case RegisterId::Eip: + case Id::Eip: #ifdef _M_AMD64 - return RegisterId::Rip; + return Id::Rip; #else - return RegisterId::None; + return Id::None; #endif - case RegisterId::Rip: - break; + case Id::Rip: + break; + } + + return Id::None; + } + + static int32_t GetOffsetForRoot(Id id) + { + switch (id) + { + case Id::Ah: + case Id::Bh: + case Id::Ch: + case Id::Dh: + return 8; + } + return 0; } - return RegisterId::None; - } + static Class GetClass(Id id) + { + switch (id) + { + case Id::None: + return Class::Invalid; + case Id::Al: + case Id::Cl: + case Id::Dl: + case Id::Bl: + case Id::Ah: + case Id::Ch: + case Id::Dh: + case Id::Bh: + case Id::Spl: + case Id::Bpl: + case Id::Sil: + case Id::Dil: + case Id::R8b: + case Id::R9b: + case Id::R10b: + case Id::R11b: + case Id::R12b: + case Id::R13b: + case Id::R14b: + case Id::R15b: + return Class::Gp8; + case Id::Ax: + case Id::Cx: + case Id::Dx: + case Id::Bx: + case Id::Sp: + case Id::Bp: + case Id::Si: + case Id::Di: + case Id::R8w: + case Id::R9w: + case Id::R10w: + case Id::R11w: + case Id::R12w: + case Id::R13w: + case Id::R14w: + case Id::R15w: + return Class::Gp16; + case Id::Eax: + case Id::Ecx: + case Id::Edx: + case Id::Ebx: + case Id::Esp: + case Id::Ebp: + case Id::Esi: + case Id::Edi: + case Id::R8d: + case Id::R9d: + case Id::R10d: + case Id::R11d: + case Id::R12d: + case Id::R13d: + case Id::R14d: + case Id::R15d: + return Class::Gp32; + case Id::Rax: + case Id::Rcx: + case Id::Rdx: + case Id::Rbx: + case Id::Rsp: + case Id::Rbp: + case Id::Rsi: + case Id::Rdi: + case Id::R8: + case Id::R9: + case Id::R10: + case Id::R11: + case Id::R12: + case Id::R13: + case Id::R14: + case Id::R15: + return Class::Gp64; + case Id::St0: + case Id::St1: + case Id::St2: + case Id::St3: + case Id::St4: + case Id::St5: + case Id::St6: + case Id::St7: + return Class::X87; + case Id::X87Control: + case Id::X87Status: + case Id::X87Tag: + return Class::Control; + case Id::Mm0: + case Id::Mm1: + case Id::Mm2: + case Id::Mm3: + case Id::Mm4: + case Id::Mm5: + case Id::Mm6: + case Id::Mm7: + return Class::Mmx; + case Id::Xmm0: + case Id::Xmm1: + case Id::Xmm2: + case Id::Xmm3: + case Id::Xmm4: + case Id::Xmm5: + case Id::Xmm6: + case Id::Xmm7: + case Id::Xmm8: + case Id::Xmm9: + case Id::Xmm10: + case Id::Xmm11: + case Id::Xmm12: + case Id::Xmm13: + case Id::Xmm14: + case Id::Xmm15: + case Id::Xmm16: + case Id::Xmm17: + case Id::Xmm18: + case Id::Xmm19: + case Id::Xmm20: + case Id::Xmm21: + case Id::Xmm22: + case Id::Xmm23: + case Id::Xmm24: + case Id::Xmm25: + case Id::Xmm26: + case Id::Xmm27: + case Id::Xmm28: + case Id::Xmm29: + case Id::Xmm30: + case Id::Xmm31: + return Class::Xmm; + case Id::Ymm0: + case Id::Ymm1: + case Id::Ymm2: + case Id::Ymm3: + case Id::Ymm4: + case Id::Ymm5: + case Id::Ymm6: + case Id::Ymm7: + case Id::Ymm8: + case Id::Ymm9: + case Id::Ymm10: + case Id::Ymm11: + case Id::Ymm12: + case Id::Ymm13: + case Id::Ymm14: + case Id::Ymm15: + case Id::Ymm16: + case Id::Ymm17: + case Id::Ymm18: + case Id::Ymm19: + case Id::Ymm20: + case Id::Ymm21: + case Id::Ymm22: + case Id::Ymm23: + case Id::Ymm24: + case Id::Ymm25: + case Id::Ymm26: + case Id::Ymm27: + case Id::Ymm28: + case Id::Ymm29: + case Id::Ymm30: + case Id::Ymm31: + return Class::Ymm; + case Id::Zmm0: + case Id::Zmm1: + case Id::Zmm2: + case Id::Zmm3: + case Id::Zmm4: + case Id::Zmm5: + case Id::Zmm6: + case Id::Zmm7: + case Id::Zmm8: + case Id::Zmm9: + case Id::Zmm10: + case Id::Zmm11: + case Id::Zmm12: + case Id::Zmm13: + case Id::Zmm14: + case Id::Zmm15: + case Id::Zmm16: + case Id::Zmm17: + case Id::Zmm18: + case Id::Zmm19: + case Id::Zmm20: + case Id::Zmm21: + case Id::Zmm22: + case Id::Zmm23: + case Id::Zmm24: + case Id::Zmm25: + case Id::Zmm26: + case Id::Zmm27: + case Id::Zmm28: + case Id::Zmm29: + case Id::Zmm30: + case Id::Zmm31: + return Class::Zmm; + case Id::Flags: + case Id::EFlags: + case Id::RFlags: + return Class::Flags; + case Id::Ip: + case Id::Eip: + case Id::Rip: + return Class::IP; + case Id::Es: + case Id::Cs: + case Id::Ss: + case Id::Ds: + case Id::Fs: + case Id::Gs: + case Id::Gdtr: + case Id::Ldtr: + case Id::Idtr: + return Class::Segment; + case Id::Tr: + case Id::Tr0: + case Id::Tr1: + case Id::Tr2: + case Id::Tr3: + case Id::Tr4: + case Id::Tr5: + case Id::Tr6: + case Id::Tr7: + return Class::Test; + case Id::Cr0: + case Id::Cr1: + case Id::Cr2: + case Id::Cr3: + case Id::Cr4: + case Id::Cr5: + case Id::Cr6: + case Id::Cr7: + case Id::Cr8: + case Id::Cr9: + case Id::Cr10: + case Id::Cr11: + case Id::Cr12: + case Id::Cr13: + case Id::Cr14: + case Id::Cr15: + return Class::Control; + case Id::Dr0: + case Id::Dr1: + case Id::Dr2: + case Id::Dr3: + case Id::Dr4: + case Id::Dr5: + case Id::Dr6: + case Id::Dr7: + case Id::Dr8: + case Id::Dr9: + case Id::Dr10: + case Id::Dr11: + case Id::Dr12: + case Id::Dr13: + case Id::Dr14: + case Id::Dr15: + return Class::Debug; + case Id::K0: + case Id::K1: + case Id::K2: + case Id::K3: + case Id::K4: + case Id::K5: + case Id::K6: + case Id::K7: + return Class::Mask; + case Id::Bnd0: + case Id::Bnd1: + case Id::Bnd2: + case Id::Bnd3: + case Id::BndCfg: + case Id::BndStatus: + return Class::Bound; + } + return Class::Invalid; + } - inline int32_t RegisterGetOffsetForRoot(RegisterId id) - { - switch (id) + static Category GetCategory(Id reg) { - case RegisterId::Ah: - case RegisterId::Bh: - case RegisterId::Ch: - case RegisterId::Dh: - return 8; + switch (GetClass(reg)) + { + case Class::Gp8: + case Class::Gp16: + case Class::Gp32: + case Class::Gp64: + case Class::IP: + return Category::Gp; + case Class::X87: + return Category::X87; + case Class::Mmx: + break; + case Class::Xmm: + case Class::Ymm: + case Class::Zmm: + return Category::Simd; + case Class::Flags: + return Category::Flags; + case Class::Segment: + return Category::Segment; + case Class::Control: + return Category::Control; + case Class::Debug: + return Category::Debug; + case Class::Mask: + return Category::Mask; + default: + break; + } + return Category::Invalid; } - return 0; - } - inline RegisterClass RegisterGetClass(RegisterId id) - { - switch (id) + static int GetIndex(Id reg) { - case RegisterId::None: - return RegisterClass::Invalid; - case RegisterId::Al: - case RegisterId::Cl: - case RegisterId::Dl: - case RegisterId::Bl: - case RegisterId::Ah: - case RegisterId::Ch: - case RegisterId::Dh: - case RegisterId::Bh: - case RegisterId::Spl: - case RegisterId::Bpl: - case RegisterId::Sil: - case RegisterId::Dil: - case RegisterId::R8b: - case RegisterId::R9b: - case RegisterId::R10b: - case RegisterId::R11b: - case RegisterId::R12b: - case RegisterId::R13b: - case RegisterId::R14b: - case RegisterId::R15b: - return RegisterClass::Gp8; - case RegisterId::Ax: - case RegisterId::Cx: - case RegisterId::Dx: - case RegisterId::Bx: - case RegisterId::Sp: - case RegisterId::Bp: - case RegisterId::Si: - case RegisterId::Di: - case RegisterId::R8w: - case RegisterId::R9w: - case RegisterId::R10w: - case RegisterId::R11w: - case RegisterId::R12w: - case RegisterId::R13w: - case RegisterId::R14w: - case RegisterId::R15w: - return RegisterClass::Gp16; - case RegisterId::Eax: - case RegisterId::Ecx: - case RegisterId::Edx: - case RegisterId::Ebx: - case RegisterId::Esp: - case RegisterId::Ebp: - case RegisterId::Esi: - case RegisterId::Edi: - case RegisterId::R8d: - case RegisterId::R9d: - case RegisterId::R10d: - case RegisterId::R11d: - case RegisterId::R12d: - case RegisterId::R13d: - case RegisterId::R14d: - case RegisterId::R15d: - return RegisterClass::Gp32; - case RegisterId::Rax: - case RegisterId::Rcx: - case RegisterId::Rdx: - case RegisterId::Rbx: - case RegisterId::Rsp: - case RegisterId::Rbp: - case RegisterId::Rsi: - case RegisterId::Rdi: - case RegisterId::R8: - case RegisterId::R9: - case RegisterId::R10: - case RegisterId::R11: - case RegisterId::R12: - case RegisterId::R13: - case RegisterId::R14: - case RegisterId::R15: - return RegisterClass::Gp64; - case RegisterId::St0: - case RegisterId::St1: - case RegisterId::St2: - case RegisterId::St3: - case RegisterId::St4: - case RegisterId::St5: - case RegisterId::St6: - case RegisterId::St7: - return RegisterClass::X87; - case RegisterId::X87Control: - case RegisterId::X87Status: - case RegisterId::X87Tag: - return RegisterClass::Control; - case RegisterId::Mm0: - case RegisterId::Mm1: - case RegisterId::Mm2: - case RegisterId::Mm3: - case RegisterId::Mm4: - case RegisterId::Mm5: - case RegisterId::Mm6: - case RegisterId::Mm7: - return RegisterClass::Mmx; - case RegisterId::Xmm0: - case RegisterId::Xmm1: - case RegisterId::Xmm2: - case RegisterId::Xmm3: - case RegisterId::Xmm4: - case RegisterId::Xmm5: - case RegisterId::Xmm6: - case RegisterId::Xmm7: - case RegisterId::Xmm8: - case RegisterId::Xmm9: - case RegisterId::Xmm10: - case RegisterId::Xmm11: - case RegisterId::Xmm12: - case RegisterId::Xmm13: - case RegisterId::Xmm14: - case RegisterId::Xmm15: - case RegisterId::Xmm16: - case RegisterId::Xmm17: - case RegisterId::Xmm18: - case RegisterId::Xmm19: - case RegisterId::Xmm20: - case RegisterId::Xmm21: - case RegisterId::Xmm22: - case RegisterId::Xmm23: - case RegisterId::Xmm24: - case RegisterId::Xmm25: - case RegisterId::Xmm26: - case RegisterId::Xmm27: - case RegisterId::Xmm28: - case RegisterId::Xmm29: - case RegisterId::Xmm30: - case RegisterId::Xmm31: - return RegisterClass::Xmm; - case RegisterId::Ymm0: - case RegisterId::Ymm1: - case RegisterId::Ymm2: - case RegisterId::Ymm3: - case RegisterId::Ymm4: - case RegisterId::Ymm5: - case RegisterId::Ymm6: - case RegisterId::Ymm7: - case RegisterId::Ymm8: - case RegisterId::Ymm9: - case RegisterId::Ymm10: - case RegisterId::Ymm11: - case RegisterId::Ymm12: - case RegisterId::Ymm13: - case RegisterId::Ymm14: - case RegisterId::Ymm15: - case RegisterId::Ymm16: - case RegisterId::Ymm17: - case RegisterId::Ymm18: - case RegisterId::Ymm19: - case RegisterId::Ymm20: - case RegisterId::Ymm21: - case RegisterId::Ymm22: - case RegisterId::Ymm23: - case RegisterId::Ymm24: - case RegisterId::Ymm25: - case RegisterId::Ymm26: - case RegisterId::Ymm27: - case RegisterId::Ymm28: - case RegisterId::Ymm29: - case RegisterId::Ymm30: - case RegisterId::Ymm31: - return RegisterClass::Ymm; - case RegisterId::Zmm0: - case RegisterId::Zmm1: - case RegisterId::Zmm2: - case RegisterId::Zmm3: - case RegisterId::Zmm4: - case RegisterId::Zmm5: - case RegisterId::Zmm6: - case RegisterId::Zmm7: - case RegisterId::Zmm8: - case RegisterId::Zmm9: - case RegisterId::Zmm10: - case RegisterId::Zmm11: - case RegisterId::Zmm12: - case RegisterId::Zmm13: - case RegisterId::Zmm14: - case RegisterId::Zmm15: - case RegisterId::Zmm16: - case RegisterId::Zmm17: - case RegisterId::Zmm18: - case RegisterId::Zmm19: - case RegisterId::Zmm20: - case RegisterId::Zmm21: - case RegisterId::Zmm22: - case RegisterId::Zmm23: - case RegisterId::Zmm24: - case RegisterId::Zmm25: - case RegisterId::Zmm26: - case RegisterId::Zmm27: - case RegisterId::Zmm28: - case RegisterId::Zmm29: - case RegisterId::Zmm30: - case RegisterId::Zmm31: - return RegisterClass::Zmm; - case RegisterId::Flags: - case RegisterId::EFlags: - case RegisterId::RFlags: - return RegisterClass::Flags; - case RegisterId::Ip: - case RegisterId::Eip: - case RegisterId::Rip: - return RegisterClass::IP; - case RegisterId::Es: - case RegisterId::Cs: - case RegisterId::Ss: - case RegisterId::Ds: - case RegisterId::Fs: - case RegisterId::Gs: - case RegisterId::Gdtr: - case RegisterId::Ldtr: - case RegisterId::Idtr: - return RegisterClass::Segment; - case RegisterId::Tr: - case RegisterId::Tr0: - case RegisterId::Tr1: - case RegisterId::Tr2: - case RegisterId::Tr3: - case RegisterId::Tr4: - case RegisterId::Tr5: - case RegisterId::Tr6: - case RegisterId::Tr7: - return RegisterClass::Test; - case RegisterId::Cr0: - case RegisterId::Cr1: - case RegisterId::Cr2: - case RegisterId::Cr3: - case RegisterId::Cr4: - case RegisterId::Cr5: - case RegisterId::Cr6: - case RegisterId::Cr7: - case RegisterId::Cr8: - case RegisterId::Cr9: - case RegisterId::Cr10: - case RegisterId::Cr11: - case RegisterId::Cr12: - case RegisterId::Cr13: - case RegisterId::Cr14: - case RegisterId::Cr15: - return RegisterClass::Control; - case RegisterId::Dr0: - case RegisterId::Dr1: - case RegisterId::Dr2: - case RegisterId::Dr3: - case RegisterId::Dr4: - case RegisterId::Dr5: - case RegisterId::Dr6: - case RegisterId::Dr7: - case RegisterId::Dr8: - case RegisterId::Dr9: - case RegisterId::Dr10: - case RegisterId::Dr11: - case RegisterId::Dr12: - case RegisterId::Dr13: - case RegisterId::Dr14: - case RegisterId::Dr15: - return RegisterClass::Debug; - case RegisterId::K0: - case RegisterId::K1: - case RegisterId::K2: - case RegisterId::K3: - case RegisterId::K4: - case RegisterId::K5: - case RegisterId::K6: - case RegisterId::K7: - return RegisterClass::Mask; - case RegisterId::Bnd0: - case RegisterId::Bnd1: - case RegisterId::Bnd2: - case RegisterId::Bnd3: - case RegisterId::BndCfg: - case RegisterId::BndStatus: - return RegisterClass::Bound; + if (reg == Id::None) + return -1; + + if (reg >= Id::Al && reg <= Id::R15) + { + // Gp. + if (reg >= Id::Al && reg <= Id::R15b) + { + auto index = (int)reg - (int)Id::Al; + if (reg >= Id::Ah && reg <= Id::Bh) + { + index -= 4; + } + return index; + } + else if (reg >= Id::Ax && reg <= Id::R15w) + { + return (int)reg - (int)Id::Ax; + } + else if (reg >= Id::Eax && reg <= Id::R15d) + { + return (int)reg - (int)Id::Eax; + } + else if (reg >= Id::Rax && reg <= Id::R15) + { + return (int)reg - (int)Id::Rax; + } + } + else if (reg >= Id::St0 && reg <= Id::St1) + { + return (int)reg - (int)Id::St0; + } + else if (reg >= Id::X87Control && reg <= Id::X87Tag) + { + return (int)reg - (int)Id::X87Control; + } + else if (reg >= Id::Mm0 && reg <= Id::Mm7) + { + return (int)reg - (int)Id::Mm0; + } + else if (reg >= Id::Xmm0 && reg <= Id::Xmm31) + { + return (int)reg - (int)Id::Xmm0; + } + else if (reg >= Id::Ymm0 && reg <= Id::Ymm31) + { + return (int)reg - (int)Id::Ymm0; + } + else if (reg >= Id::Zmm0 && reg <= Id::Zmm31) + { + return (int)reg - (int)Id::Zmm0; + } + else if (reg >= Id::Flags && reg <= Id::RFlags) + { + return (int)reg - (int)Id::Flags; + } + else if (reg >= Id::Ip && reg <= Id::Rip) + { + return (int)reg - (int)Id::Ip; + } + return -1; } - return RegisterClass::Invalid; - } + + }; } // namespace Dotx64Dbg diff --git a/src/Bindings/Thread.cpp b/src/Bindings/Thread.cpp index 95f1096..7afd880 100644 --- a/src/Bindings/Thread.cpp +++ b/src/Bindings/Thread.cpp @@ -1,4 +1,4 @@ -#include +#include #include #include "pluginsdk/bridgemain.h" @@ -153,599 +153,599 @@ namespace Dotx64Dbg::Native return ReadRegister(hThread, reg, size, 0); } - static array^ GetRegisterData(System::UIntPtr hThread, RegisterId reg) + static array^ GetRegisterData(System::UIntPtr hThread, Registers::Id reg) { switch (reg) { - case RegisterId::None: + case Registers::Id::None: return gcnew array(0); #ifdef _M_X64 - case RegisterId::Al: + case Registers::Id::Al: return ReadRegister(hThread, UE_RAX, 1); - case RegisterId::Cl: + case Registers::Id::Cl: return ReadRegister(hThread, UE_RCX, 1); - case RegisterId::Dl: + case Registers::Id::Dl: return ReadRegister(hThread, UE_RDX, 1); - case RegisterId::Bl: + case Registers::Id::Bl: return ReadRegister(hThread, UE_RBX, 1); - case RegisterId::Ah: + case Registers::Id::Ah: return ReadRegister(hThread, UE_RAX, 1, 1); - case RegisterId::Ch: + case Registers::Id::Ch: return ReadRegister(hThread, UE_RCX, 1, 1); - case RegisterId::Dh: + case Registers::Id::Dh: return ReadRegister(hThread, UE_RDX, 1, 1); - case RegisterId::Bh: + case Registers::Id::Bh: return ReadRegister(hThread, UE_RBX, 1, 1); - case RegisterId::Spl: + case Registers::Id::Spl: return ReadRegister(hThread, UE_RSP, 1); - case RegisterId::Bpl: + case Registers::Id::Bpl: return ReadRegister(hThread, UE_RBP, 1); - case RegisterId::Sil: + case Registers::Id::Sil: return ReadRegister(hThread, UE_RSI, 1); - case RegisterId::Dil: + case Registers::Id::Dil: return ReadRegister(hThread, UE_RDI, 1); - case RegisterId::R8b: + case Registers::Id::R8b: return ReadRegister(hThread, UE_R8, 1); - case RegisterId::R9b: + case Registers::Id::R9b: return ReadRegister(hThread, UE_R9, 1); - case RegisterId::R10b: + case Registers::Id::R10b: return ReadRegister(hThread, UE_R10, 1); - case RegisterId::R11b: + case Registers::Id::R11b: return ReadRegister(hThread, UE_R11, 1); - case RegisterId::R12b: + case Registers::Id::R12b: return ReadRegister(hThread, UE_R12, 1); - case RegisterId::R13b: + case Registers::Id::R13b: return ReadRegister(hThread, UE_R13, 1); - case RegisterId::R14b: + case Registers::Id::R14b: return ReadRegister(hThread, UE_R14, 1); - case RegisterId::R15b: + case Registers::Id::R15b: return ReadRegister(hThread, UE_R15, 1); - case RegisterId::Ax: + case Registers::Id::Ax: return ReadRegister(hThread, UE_RAX, 2); - case RegisterId::Cx: + case Registers::Id::Cx: return ReadRegister(hThread, UE_RCX, 2); - case RegisterId::Dx: + case Registers::Id::Dx: return ReadRegister(hThread, UE_RDX, 2); - case RegisterId::Bx: + case Registers::Id::Bx: return ReadRegister(hThread, UE_RBX, 2); - case RegisterId::Sp: + case Registers::Id::Sp: return ReadRegister(hThread, UE_RSP, 2); - case RegisterId::Bp: + case Registers::Id::Bp: return ReadRegister(hThread, UE_RBP, 2); - case RegisterId::Si: + case Registers::Id::Si: return ReadRegister(hThread, UE_RSI, 2); - case RegisterId::Di: + case Registers::Id::Di: return ReadRegister(hThread, UE_RDI, 2); - case RegisterId::R8w: + case Registers::Id::R8w: return ReadRegister(hThread, UE_R8, 2); - case RegisterId::R9w: + case Registers::Id::R9w: return ReadRegister(hThread, UE_R9, 2); - case RegisterId::R10w: + case Registers::Id::R10w: return ReadRegister(hThread, UE_R10, 2); - case RegisterId::R11w: + case Registers::Id::R11w: return ReadRegister(hThread, UE_R11, 2); - case RegisterId::R12w: + case Registers::Id::R12w: return ReadRegister(hThread, UE_R12, 2); - case RegisterId::R13w: + case Registers::Id::R13w: return ReadRegister(hThread, UE_R13, 2); - case RegisterId::R14w: + case Registers::Id::R14w: return ReadRegister(hThread, UE_R14, 2); - case RegisterId::R15w: + case Registers::Id::R15w: return ReadRegister(hThread, UE_R15, 2); - case RegisterId::Eax: + case Registers::Id::Eax: return ReadRegister(hThread, UE_RAX, 4); - case RegisterId::Ecx: + case Registers::Id::Ecx: return ReadRegister(hThread, UE_RCX, 4); - case RegisterId::Edx: + case Registers::Id::Edx: return ReadRegister(hThread, UE_RDX, 4); - case RegisterId::Ebx: + case Registers::Id::Ebx: return ReadRegister(hThread, UE_RBX, 4); - case RegisterId::Esp: + case Registers::Id::Esp: return ReadRegister(hThread, UE_RSP, 4); - case RegisterId::Ebp: + case Registers::Id::Ebp: return ReadRegister(hThread, UE_RBP, 4); - case RegisterId::Esi: + case Registers::Id::Esi: return ReadRegister(hThread, UE_RSI, 4); - case RegisterId::Edi: + case Registers::Id::Edi: return ReadRegister(hThread, UE_RDI, 4); - case RegisterId::R8d: + case Registers::Id::R8d: return ReadRegister(hThread, UE_R8, 4); - case RegisterId::R9d: + case Registers::Id::R9d: return ReadRegister(hThread, UE_R9, 4); - case RegisterId::R10d: + case Registers::Id::R10d: return ReadRegister(hThread, UE_R10, 4); - case RegisterId::R11d: + case Registers::Id::R11d: return ReadRegister(hThread, UE_R11, 4); - case RegisterId::R12d: + case Registers::Id::R12d: return ReadRegister(hThread, UE_R12, 4); - case RegisterId::R13d: + case Registers::Id::R13d: return ReadRegister(hThread, UE_R13, 4); - case RegisterId::R14d: + case Registers::Id::R14d: return ReadRegister(hThread, UE_R14, 4); - case RegisterId::R15d: + case Registers::Id::R15d: return ReadRegister(hThread, UE_R15, 4); - case RegisterId::Rax: + case Registers::Id::Rax: return ReadRegister(hThread, UE_RAX, 8); - case RegisterId::Rcx: + case Registers::Id::Rcx: return ReadRegister(hThread, UE_RCX, 8); - case RegisterId::Rdx: + case Registers::Id::Rdx: return ReadRegister(hThread, UE_RDX, 8); - case RegisterId::Rbx: + case Registers::Id::Rbx: return ReadRegister(hThread, UE_RBP, 8); - case RegisterId::Rsp: + case Registers::Id::Rsp: return ReadRegister(hThread, UE_RSP, 8); - case RegisterId::Rbp: + case Registers::Id::Rbp: return ReadRegister(hThread, UE_RBP, 8); - case RegisterId::Rsi: + case Registers::Id::Rsi: return ReadRegister(hThread, UE_RSI, 8); - case RegisterId::Rdi: + case Registers::Id::Rdi: return ReadRegister(hThread, UE_RDI, 8); - case RegisterId::R8: + case Registers::Id::R8: return ReadRegister(hThread, UE_R8, 8); - case RegisterId::R9: + case Registers::Id::R9: return ReadRegister(hThread, UE_R9, 8); - case RegisterId::R10: + case Registers::Id::R10: return ReadRegister(hThread, UE_R10, 8); - case RegisterId::R11: + case Registers::Id::R11: return ReadRegister(hThread, UE_R11, 8); - case RegisterId::R12: + case Registers::Id::R12: return ReadRegister(hThread, UE_R12, 8); - case RegisterId::R13: + case Registers::Id::R13: return ReadRegister(hThread, UE_R13, 8); - case RegisterId::R14: + case Registers::Id::R14: return ReadRegister(hThread, UE_R14, 8); - case RegisterId::R15: + case Registers::Id::R15: return ReadRegister(hThread, UE_R15, 8); #else - case RegisterId::Al: + case Registers::Id::Al: return ReadRegister(hThread, UE_EAX, 1); - case RegisterId::Cl: + case Registers::Id::Cl: return ReadRegister(hThread, UE_ECX, 1); - case RegisterId::Dl: + case Registers::Id::Dl: return ReadRegister(hThread, UE_EDX, 1); - case RegisterId::Bl: + case Registers::Id::Bl: return ReadRegister(hThread, UE_EBX, 1); - case RegisterId::Ah: + case Registers::Id::Ah: return ReadRegister(hThread, UE_EAX, 1, 1); - case RegisterId::Ch: + case Registers::Id::Ch: return ReadRegister(hThread, UE_ECX, 1, 1); - case RegisterId::Dh: + case Registers::Id::Dh: return ReadRegister(hThread, UE_EDX, 1, 1); - case RegisterId::Bh: + case Registers::Id::Bh: return ReadRegister(hThread, UE_EBX, 1, 1); - case RegisterId::Spl: + case Registers::Id::Spl: return ReadRegister(hThread, UE_ESP, 1); - case RegisterId::Bpl: + case Registers::Id::Bpl: return ReadRegister(hThread, UE_EBP, 1); - case RegisterId::Sil: + case Registers::Id::Sil: return ReadRegister(hThread, UE_ESI, 1); - case RegisterId::Dil: + case Registers::Id::Dil: return ReadRegister(hThread, UE_EDI, 1); - case RegisterId::Ax: + case Registers::Id::Ax: return ReadRegister(hThread, UE_EAX, 2); - case RegisterId::Cx: + case Registers::Id::Cx: return ReadRegister(hThread, UE_ECX, 2); - case RegisterId::Dx: + case Registers::Id::Dx: return ReadRegister(hThread, UE_EDX, 2); - case RegisterId::Bx: + case Registers::Id::Bx: return ReadRegister(hThread, UE_EBX, 2); - case RegisterId::Sp: + case Registers::Id::Sp: return ReadRegister(hThread, UE_ESP, 2); - case RegisterId::Bp: + case Registers::Id::Bp: return ReadRegister(hThread, UE_EBP, 2); - case RegisterId::Si: + case Registers::Id::Si: return ReadRegister(hThread, UE_ESI, 2); - case RegisterId::Di: + case Registers::Id::Di: return ReadRegister(hThread, UE_EDI, 2); - case RegisterId::Eax: + case Registers::Id::Eax: return ReadRegister(hThread, UE_EAX, 4); - case RegisterId::Ecx: + case Registers::Id::Ecx: return ReadRegister(hThread, UE_ECX, 4); - case RegisterId::Edx: + case Registers::Id::Edx: return ReadRegister(hThread, UE_EDX, 4); - case RegisterId::Ebx: + case Registers::Id::Ebx: return ReadRegister(hThread, UE_EBX, 4); - case RegisterId::Esp: + case Registers::Id::Esp: return ReadRegister(hThread, UE_ESP, 4); - case RegisterId::Ebp: + case Registers::Id::Ebp: return ReadRegister(hThread, UE_EBP, 4); - case RegisterId::Esi: + case Registers::Id::Esi: return ReadRegister(hThread, UE_ESI, 4); - case RegisterId::Edi: + case Registers::Id::Edi: return ReadRegister(hThread, UE_EDI, 4); - case RegisterId::Rax: + case Registers::Id::Rax: return ReadRegister(hThread, UE_EAX, 8); #endif - case RegisterId::St0: + case Registers::Id::St0: break; - case RegisterId::St1: + case Registers::Id::St1: break; - case RegisterId::St2: + case Registers::Id::St2: break; - case RegisterId::St3: + case Registers::Id::St3: break; - case RegisterId::St4: + case Registers::Id::St4: break; - case RegisterId::St5: + case Registers::Id::St5: break; - case RegisterId::St6: + case Registers::Id::St6: break; - case RegisterId::St7: + case Registers::Id::St7: break; - case RegisterId::X87Control: + case Registers::Id::X87Control: break; - case RegisterId::X87Status: + case Registers::Id::X87Status: break; - case RegisterId::X87Tag: + case Registers::Id::X87Tag: break; - case RegisterId::Mm0: + case Registers::Id::Mm0: break; - case RegisterId::Mm1: + case Registers::Id::Mm1: break; - case RegisterId::Mm2: + case Registers::Id::Mm2: break; - case RegisterId::Mm3: + case Registers::Id::Mm3: break; - case RegisterId::Mm4: + case Registers::Id::Mm4: break; - case RegisterId::Mm5: + case Registers::Id::Mm5: break; - case RegisterId::Mm6: + case Registers::Id::Mm6: break; - case RegisterId::Mm7: + case Registers::Id::Mm7: break; - case RegisterId::Xmm0: + case Registers::Id::Xmm0: break; - case RegisterId::Xmm1: + case Registers::Id::Xmm1: break; - case RegisterId::Xmm2: + case Registers::Id::Xmm2: break; - case RegisterId::Xmm3: + case Registers::Id::Xmm3: break; - case RegisterId::Xmm4: + case Registers::Id::Xmm4: break; - case RegisterId::Xmm5: + case Registers::Id::Xmm5: break; - case RegisterId::Xmm6: + case Registers::Id::Xmm6: break; - case RegisterId::Xmm7: + case Registers::Id::Xmm7: break; - case RegisterId::Xmm8: + case Registers::Id::Xmm8: break; - case RegisterId::Xmm9: + case Registers::Id::Xmm9: break; - case RegisterId::Xmm10: + case Registers::Id::Xmm10: break; - case RegisterId::Xmm11: + case Registers::Id::Xmm11: break; - case RegisterId::Xmm12: + case Registers::Id::Xmm12: break; - case RegisterId::Xmm13: + case Registers::Id::Xmm13: break; - case RegisterId::Xmm14: + case Registers::Id::Xmm14: break; - case RegisterId::Xmm15: + case Registers::Id::Xmm15: break; - case RegisterId::Xmm16: + case Registers::Id::Xmm16: break; - case RegisterId::Xmm17: + case Registers::Id::Xmm17: break; - case RegisterId::Xmm18: + case Registers::Id::Xmm18: break; - case RegisterId::Xmm19: + case Registers::Id::Xmm19: break; - case RegisterId::Xmm20: + case Registers::Id::Xmm20: break; - case RegisterId::Xmm21: + case Registers::Id::Xmm21: break; - case RegisterId::Xmm22: + case Registers::Id::Xmm22: break; - case RegisterId::Xmm23: + case Registers::Id::Xmm23: break; - case RegisterId::Xmm24: + case Registers::Id::Xmm24: break; - case RegisterId::Xmm25: + case Registers::Id::Xmm25: break; - case RegisterId::Xmm26: + case Registers::Id::Xmm26: break; - case RegisterId::Xmm27: + case Registers::Id::Xmm27: break; - case RegisterId::Xmm28: + case Registers::Id::Xmm28: break; - case RegisterId::Xmm29: + case Registers::Id::Xmm29: break; - case RegisterId::Xmm30: + case Registers::Id::Xmm30: break; - case RegisterId::Xmm31: + case Registers::Id::Xmm31: break; - case RegisterId::Ymm0: + case Registers::Id::Ymm0: break; - case RegisterId::Ymm1: + case Registers::Id::Ymm1: break; - case RegisterId::Ymm2: + case Registers::Id::Ymm2: break; - case RegisterId::Ymm3: + case Registers::Id::Ymm3: break; - case RegisterId::Ymm4: + case Registers::Id::Ymm4: break; - case RegisterId::Ymm5: + case Registers::Id::Ymm5: break; - case RegisterId::Ymm6: + case Registers::Id::Ymm6: break; - case RegisterId::Ymm7: + case Registers::Id::Ymm7: break; - case RegisterId::Ymm8: + case Registers::Id::Ymm8: break; - case RegisterId::Ymm9: + case Registers::Id::Ymm9: break; - case RegisterId::Ymm10: + case Registers::Id::Ymm10: break; - case RegisterId::Ymm11: + case Registers::Id::Ymm11: break; - case RegisterId::Ymm12: + case Registers::Id::Ymm12: break; - case RegisterId::Ymm13: + case Registers::Id::Ymm13: break; - case RegisterId::Ymm14: + case Registers::Id::Ymm14: break; - case RegisterId::Ymm15: + case Registers::Id::Ymm15: break; - case RegisterId::Ymm16: + case Registers::Id::Ymm16: break; - case RegisterId::Ymm17: + case Registers::Id::Ymm17: break; - case RegisterId::Ymm18: + case Registers::Id::Ymm18: break; - case RegisterId::Ymm19: + case Registers::Id::Ymm19: break; - case RegisterId::Ymm20: + case Registers::Id::Ymm20: break; - case RegisterId::Ymm21: + case Registers::Id::Ymm21: break; - case RegisterId::Ymm22: + case Registers::Id::Ymm22: break; - case RegisterId::Ymm23: + case Registers::Id::Ymm23: break; - case RegisterId::Ymm24: + case Registers::Id::Ymm24: break; - case RegisterId::Ymm25: + case Registers::Id::Ymm25: break; - case RegisterId::Ymm26: + case Registers::Id::Ymm26: break; - case RegisterId::Ymm27: + case Registers::Id::Ymm27: break; - case RegisterId::Ymm28: + case Registers::Id::Ymm28: break; - case RegisterId::Ymm29: + case Registers::Id::Ymm29: break; - case RegisterId::Ymm30: + case Registers::Id::Ymm30: break; - case RegisterId::Ymm31: + case Registers::Id::Ymm31: break; - case RegisterId::Zmm0: + case Registers::Id::Zmm0: break; - case RegisterId::Zmm1: + case Registers::Id::Zmm1: break; - case RegisterId::Zmm2: + case Registers::Id::Zmm2: break; - case RegisterId::Zmm3: + case Registers::Id::Zmm3: break; - case RegisterId::Zmm4: + case Registers::Id::Zmm4: break; - case RegisterId::Zmm5: + case Registers::Id::Zmm5: break; - case RegisterId::Zmm6: + case Registers::Id::Zmm6: break; - case RegisterId::Zmm7: + case Registers::Id::Zmm7: break; - case RegisterId::Zmm8: + case Registers::Id::Zmm8: break; - case RegisterId::Zmm9: + case Registers::Id::Zmm9: break; - case RegisterId::Zmm10: + case Registers::Id::Zmm10: break; - case RegisterId::Zmm11: + case Registers::Id::Zmm11: break; - case RegisterId::Zmm12: + case Registers::Id::Zmm12: break; - case RegisterId::Zmm13: + case Registers::Id::Zmm13: break; - case RegisterId::Zmm14: + case Registers::Id::Zmm14: break; - case RegisterId::Zmm15: + case Registers::Id::Zmm15: break; - case RegisterId::Zmm16: + case Registers::Id::Zmm16: break; - case RegisterId::Zmm17: + case Registers::Id::Zmm17: break; - case RegisterId::Zmm18: + case Registers::Id::Zmm18: break; - case RegisterId::Zmm19: + case Registers::Id::Zmm19: break; - case RegisterId::Zmm20: + case Registers::Id::Zmm20: break; - case RegisterId::Zmm21: + case Registers::Id::Zmm21: break; - case RegisterId::Zmm22: + case Registers::Id::Zmm22: break; - case RegisterId::Zmm23: + case Registers::Id::Zmm23: break; - case RegisterId::Zmm24: + case Registers::Id::Zmm24: break; - case RegisterId::Zmm25: + case Registers::Id::Zmm25: break; - case RegisterId::Zmm26: + case Registers::Id::Zmm26: break; - case RegisterId::Zmm27: + case Registers::Id::Zmm27: break; - case RegisterId::Zmm28: + case Registers::Id::Zmm28: break; - case RegisterId::Zmm29: + case Registers::Id::Zmm29: break; - case RegisterId::Zmm30: + case Registers::Id::Zmm30: break; - case RegisterId::Zmm31: + case Registers::Id::Zmm31: break; #ifdef _M_X64 - case RegisterId::Flags: + case Registers::Id::Flags: return ReadRegister(hThread, UE_RFLAGS, 2); - case RegisterId::EFlags: + case Registers::Id::EFlags: return ReadRegister(hThread, UE_RFLAGS, 4); - case RegisterId::RFlags: + case Registers::Id::RFlags: return ReadRegister(hThread, UE_RFLAGS, 8); #else - case RegisterId::Flags: + case Registers::Id::Flags: return ReadRegister(hThread, UE_EFLAGS, 2); - case RegisterId::EFlags: + case Registers::Id::EFlags: return ReadRegister(hThread, UE_EFLAGS, 4); #endif #ifdef _M_X64 - case RegisterId::Ip: + case Registers::Id::Ip: return ReadRegister(hThread, UE_RIP, 2); - case RegisterId::Eip: + case Registers::Id::Eip: return ReadRegister(hThread, UE_RIP, 4); - case RegisterId::Rip: + case Registers::Id::Rip: return ReadRegister(hThread, UE_RIP, 8); #else - case RegisterId::Ip: + case Registers::Id::Ip: return ReadRegister(hThread, UE_EIP, 2); - case RegisterId::Eip: + case Registers::Id::Eip: return ReadRegister(hThread, UE_EIP, 4); #endif - case RegisterId::Es: + case Registers::Id::Es: return ReadRegister(hThread, UE_SEG_ES, 2); - case RegisterId::Cs: + case Registers::Id::Cs: return ReadRegister(hThread, UE_SEG_CS, 2); - case RegisterId::Ss: + case Registers::Id::Ss: return ReadRegister(hThread, UE_SEG_SS, 2); - case RegisterId::Ds: + case Registers::Id::Ds: return ReadRegister(hThread, UE_SEG_DS, 2); - case RegisterId::Fs: + case Registers::Id::Fs: return ReadRegister(hThread, UE_SEG_FS, 2); - case RegisterId::Gs: + case Registers::Id::Gs: return ReadRegister(hThread, UE_SEG_GS, 2); - case RegisterId::Gdtr: + case Registers::Id::Gdtr: break; - case RegisterId::Ldtr: + case Registers::Id::Ldtr: break; - case RegisterId::Idtr: + case Registers::Id::Idtr: break; - case RegisterId::Tr: + case Registers::Id::Tr: break; - case RegisterId::Tr0: + case Registers::Id::Tr0: break; - case RegisterId::Tr1: + case Registers::Id::Tr1: break; - case RegisterId::Tr2: + case Registers::Id::Tr2: break; - case RegisterId::Tr3: + case Registers::Id::Tr3: break; - case RegisterId::Tr4: + case Registers::Id::Tr4: break; - case RegisterId::Tr5: + case Registers::Id::Tr5: break; - case RegisterId::Tr6: + case Registers::Id::Tr6: break; - case RegisterId::Tr7: + case Registers::Id::Tr7: break; - case RegisterId::Cr0: + case Registers::Id::Cr0: break; - case RegisterId::Cr1: + case Registers::Id::Cr1: break; - case RegisterId::Cr2: + case Registers::Id::Cr2: break; - case RegisterId::Cr3: + case Registers::Id::Cr3: break; - case RegisterId::Cr4: + case Registers::Id::Cr4: break; - case RegisterId::Cr5: + case Registers::Id::Cr5: break; - case RegisterId::Cr6: + case Registers::Id::Cr6: break; - case RegisterId::Cr7: + case Registers::Id::Cr7: break; - case RegisterId::Cr8: + case Registers::Id::Cr8: break; - case RegisterId::Cr9: + case Registers::Id::Cr9: break; - case RegisterId::Cr10: + case Registers::Id::Cr10: break; - case RegisterId::Cr11: + case Registers::Id::Cr11: break; - case RegisterId::Cr12: + case Registers::Id::Cr12: break; - case RegisterId::Cr13: + case Registers::Id::Cr13: break; - case RegisterId::Cr14: + case Registers::Id::Cr14: break; - case RegisterId::Cr15: + case Registers::Id::Cr15: break; - case RegisterId::Dr0: + case Registers::Id::Dr0: break; - case RegisterId::Dr1: + case Registers::Id::Dr1: break; - case RegisterId::Dr2: + case Registers::Id::Dr2: break; - case RegisterId::Dr3: + case Registers::Id::Dr3: break; - case RegisterId::Dr4: + case Registers::Id::Dr4: break; - case RegisterId::Dr5: + case Registers::Id::Dr5: break; - case RegisterId::Dr6: + case Registers::Id::Dr6: break; - case RegisterId::Dr7: + case Registers::Id::Dr7: break; - case RegisterId::Dr8: + case Registers::Id::Dr8: break; - case RegisterId::Dr9: + case Registers::Id::Dr9: break; - case RegisterId::Dr10: + case Registers::Id::Dr10: break; - case RegisterId::Dr11: + case Registers::Id::Dr11: break; - case RegisterId::Dr12: + case Registers::Id::Dr12: break; - case RegisterId::Dr13: + case Registers::Id::Dr13: break; - case RegisterId::Dr14: + case Registers::Id::Dr14: break; - case RegisterId::Dr15: + case Registers::Id::Dr15: break; - case RegisterId::K0: + case Registers::Id::K0: break; - case RegisterId::K1: + case Registers::Id::K1: break; - case RegisterId::K2: + case Registers::Id::K2: break; - case RegisterId::K3: + case Registers::Id::K3: break; - case RegisterId::K4: + case Registers::Id::K4: break; - case RegisterId::K5: + case Registers::Id::K5: break; - case RegisterId::K6: + case Registers::Id::K6: break; - case RegisterId::K7: + case Registers::Id::K7: break; - case RegisterId::Bnd0: + case Registers::Id::Bnd0: break; - case RegisterId::Bnd1: + case Registers::Id::Bnd1: break; - case RegisterId::Bnd2: + case Registers::Id::Bnd2: break; - case RegisterId::Bnd3: + case Registers::Id::Bnd3: break; - case RegisterId::BndCfg: + case Registers::Id::BndCfg: break; - case RegisterId::BndStatus: + case Registers::Id::BndStatus: break; - case RegisterId::Mxcsr: + case Registers::Id::Mxcsr: break; - case RegisterId::Pkru: + case Registers::Id::Pkru: break; - case RegisterId::Xcr0: + case Registers::Id::Xcr0: break; default: break; @@ -780,593 +780,593 @@ namespace Dotx64Dbg::Native GuiUpdateRegisterView(); } - static void SetRegisterData(System::UIntPtr hThread, RegisterId reg, array^ data) + static void SetRegisterData(System::UIntPtr hThread, Registers::Id reg, array^ data) { switch (reg) { - case RegisterId::None: + case Registers::Id::None: return; #ifdef _M_X64 - case RegisterId::Al: + case Registers::Id::Al: return WriteRegister(hThread, data, UE_RAX, 1); - case RegisterId::Cl: + case Registers::Id::Cl: return WriteRegister(hThread, data, UE_RCX, 1); - case RegisterId::Dl: + case Registers::Id::Dl: return WriteRegister(hThread, data, UE_RDX, 1); - case RegisterId::Bl: + case Registers::Id::Bl: return WriteRegister(hThread, data, UE_RBX, 1); - case RegisterId::Ah: + case Registers::Id::Ah: return WriteRegister(hThread, data, UE_RAX, 1, 1); - case RegisterId::Ch: + case Registers::Id::Ch: return WriteRegister(hThread, data, UE_RCX, 1, 1); - case RegisterId::Dh: + case Registers::Id::Dh: return WriteRegister(hThread, data, UE_RDX, 1, 1); - case RegisterId::Bh: + case Registers::Id::Bh: return WriteRegister(hThread, data, UE_RBX, 1, 1); - case RegisterId::Spl: + case Registers::Id::Spl: return WriteRegister(hThread, data, UE_RSP, 1); - case RegisterId::Bpl: + case Registers::Id::Bpl: return WriteRegister(hThread, data, UE_RBP, 1); - case RegisterId::Sil: + case Registers::Id::Sil: return WriteRegister(hThread, data, UE_RSI, 1); - case RegisterId::Dil: + case Registers::Id::Dil: return WriteRegister(hThread, data, UE_RDI, 1); - case RegisterId::R8b: + case Registers::Id::R8b: return WriteRegister(hThread, data, UE_R8, 1); - case RegisterId::R9b: + case Registers::Id::R9b: return WriteRegister(hThread, data, UE_R9, 1); - case RegisterId::R10b: + case Registers::Id::R10b: return WriteRegister(hThread, data, UE_R10, 1); - case RegisterId::R11b: + case Registers::Id::R11b: return WriteRegister(hThread, data, UE_R11, 1); - case RegisterId::R12b: + case Registers::Id::R12b: return WriteRegister(hThread, data, UE_R12, 1); - case RegisterId::R13b: + case Registers::Id::R13b: return WriteRegister(hThread, data, UE_R13, 1); - case RegisterId::R14b: + case Registers::Id::R14b: return WriteRegister(hThread, data, UE_R14, 1); - case RegisterId::R15b: + case Registers::Id::R15b: return WriteRegister(hThread, data, UE_R15, 1); - case RegisterId::Ax: + case Registers::Id::Ax: return WriteRegister(hThread, data, UE_RAX, 2); - case RegisterId::Cx: + case Registers::Id::Cx: return WriteRegister(hThread, data, UE_RCX, 2); - case RegisterId::Dx: + case Registers::Id::Dx: return WriteRegister(hThread, data, UE_RDX, 2); - case RegisterId::Bx: + case Registers::Id::Bx: return WriteRegister(hThread, data, UE_RBX, 2); - case RegisterId::Sp: + case Registers::Id::Sp: return WriteRegister(hThread, data, UE_RSP, 2); - case RegisterId::Bp: + case Registers::Id::Bp: return WriteRegister(hThread, data, UE_RBP, 2); - case RegisterId::Si: + case Registers::Id::Si: return WriteRegister(hThread, data, UE_RSI, 2); - case RegisterId::Di: + case Registers::Id::Di: return WriteRegister(hThread, data, UE_RDI, 2); - case RegisterId::R8w: + case Registers::Id::R8w: return WriteRegister(hThread, data, UE_R8, 2); - case RegisterId::R9w: + case Registers::Id::R9w: return WriteRegister(hThread, data, UE_R9, 2); - case RegisterId::R10w: + case Registers::Id::R10w: return WriteRegister(hThread, data, UE_R10, 2); - case RegisterId::R11w: + case Registers::Id::R11w: return WriteRegister(hThread, data, UE_R11, 2); - case RegisterId::R12w: + case Registers::Id::R12w: return WriteRegister(hThread, data, UE_R12, 2); - case RegisterId::R13w: + case Registers::Id::R13w: return WriteRegister(hThread, data, UE_R13, 2); - case RegisterId::R14w: + case Registers::Id::R14w: return WriteRegister(hThread, data, UE_R14, 2); - case RegisterId::R15w: + case Registers::Id::R15w: return WriteRegister(hThread, data, UE_R15, 2); - case RegisterId::Eax: + case Registers::Id::Eax: return WriteRegister(hThread, data, UE_RAX, 4); - case RegisterId::Ecx: + case Registers::Id::Ecx: return WriteRegister(hThread, data, UE_RCX, 4); - case RegisterId::Edx: + case Registers::Id::Edx: return WriteRegister(hThread, data, UE_RDX, 4); - case RegisterId::Ebx: + case Registers::Id::Ebx: return WriteRegister(hThread, data, UE_RBX, 4); - case RegisterId::Esp: + case Registers::Id::Esp: return WriteRegister(hThread, data, UE_RSP, 4); - case RegisterId::Ebp: + case Registers::Id::Ebp: return WriteRegister(hThread, data, UE_RBP, 4); - case RegisterId::Esi: + case Registers::Id::Esi: return WriteRegister(hThread, data, UE_RSI, 4); - case RegisterId::Edi: + case Registers::Id::Edi: return WriteRegister(hThread, data, UE_RDI, 4); - case RegisterId::R8d: + case Registers::Id::R8d: return WriteRegister(hThread, data, UE_R8, 4); - case RegisterId::R9d: + case Registers::Id::R9d: return WriteRegister(hThread, data, UE_R9, 4); - case RegisterId::R10d: + case Registers::Id::R10d: return WriteRegister(hThread, data, UE_R10, 4); - case RegisterId::R11d: + case Registers::Id::R11d: return WriteRegister(hThread, data, UE_R11, 4); - case RegisterId::R12d: + case Registers::Id::R12d: return WriteRegister(hThread, data, UE_R12, 4); - case RegisterId::R13d: + case Registers::Id::R13d: return WriteRegister(hThread, data, UE_R13, 4); - case RegisterId::R14d: + case Registers::Id::R14d: return WriteRegister(hThread, data, UE_R14, 4); - case RegisterId::R15d: + case Registers::Id::R15d: return WriteRegister(hThread, data, UE_R15, 4); - case RegisterId::Rax: + case Registers::Id::Rax: return WriteRegister(hThread, data, UE_RAX, 8); - case RegisterId::Rcx: + case Registers::Id::Rcx: return WriteRegister(hThread, data, UE_RCX, 8); - case RegisterId::Rdx: + case Registers::Id::Rdx: return WriteRegister(hThread, data, UE_RDX, 8); - case RegisterId::Rbx: + case Registers::Id::Rbx: return WriteRegister(hThread, data, UE_RBP, 8); - case RegisterId::Rsp: + case Registers::Id::Rsp: return WriteRegister(hThread, data, UE_RSP, 8); - case RegisterId::Rbp: + case Registers::Id::Rbp: return WriteRegister(hThread, data, UE_RBP, 8); - case RegisterId::Rsi: + case Registers::Id::Rsi: return WriteRegister(hThread, data, UE_RSI, 8); - case RegisterId::Rdi: + case Registers::Id::Rdi: return WriteRegister(hThread, data, UE_RDI, 8); - case RegisterId::R8: + case Registers::Id::R8: return WriteRegister(hThread, data, UE_R8, 8); - case RegisterId::R9: + case Registers::Id::R9: return WriteRegister(hThread, data, UE_R9, 8); - case RegisterId::R10: + case Registers::Id::R10: return WriteRegister(hThread, data, UE_R10, 8); - case RegisterId::R11: + case Registers::Id::R11: return WriteRegister(hThread, data, UE_R11, 8); - case RegisterId::R12: + case Registers::Id::R12: return WriteRegister(hThread, data, UE_R12, 8); - case RegisterId::R13: + case Registers::Id::R13: return WriteRegister(hThread, data, UE_R13, 8); - case RegisterId::R14: + case Registers::Id::R14: return WriteRegister(hThread, data, UE_R14, 8); - case RegisterId::R15: + case Registers::Id::R15: return WriteRegister(hThread, data, UE_R15, 8); #else - case RegisterId::Al: + case Registers::Id::Al: return WriteRegister(hThread, data, UE_EAX, 1); - case RegisterId::Cl: + case Registers::Id::Cl: return WriteRegister(hThread, data, UE_ECX, 1); - case RegisterId::Dl: + case Registers::Id::Dl: return WriteRegister(hThread, data, UE_EDX, 1); - case RegisterId::Bl: + case Registers::Id::Bl: return WriteRegister(hThread, data, UE_EBX, 1); - case RegisterId::Ah: + case Registers::Id::Ah: return WriteRegister(hThread, data, UE_EAX, 1, 1); - case RegisterId::Ch: + case Registers::Id::Ch: return WriteRegister(hThread, data, UE_ECX, 1, 1); - case RegisterId::Dh: + case Registers::Id::Dh: return WriteRegister(hThread, data, UE_EDX, 1, 1); - case RegisterId::Bh: + case Registers::Id::Bh: return WriteRegister(hThread, data, UE_EBX, 1, 1); - case RegisterId::Spl: + case Registers::Id::Spl: return WriteRegister(hThread, data, UE_ESP, 1); - case RegisterId::Bpl: + case Registers::Id::Bpl: return WriteRegister(hThread, data, UE_EBP, 1); - case RegisterId::Sil: + case Registers::Id::Sil: return WriteRegister(hThread, data, UE_ESI, 1); - case RegisterId::Dil: + case Registers::Id::Dil: return WriteRegister(hThread, data, UE_EDI, 1); - case RegisterId::Ax: + case Registers::Id::Ax: return WriteRegister(hThread, data, UE_EAX, 2); - case RegisterId::Cx: + case Registers::Id::Cx: return WriteRegister(hThread, data, UE_ECX, 2); - case RegisterId::Dx: + case Registers::Id::Dx: return WriteRegister(hThread, data, UE_EDX, 2); - case RegisterId::Bx: + case Registers::Id::Bx: return WriteRegister(hThread, data, UE_EBX, 2); - case RegisterId::Sp: + case Registers::Id::Sp: return WriteRegister(hThread, data, UE_ESP, 2); - case RegisterId::Bp: + case Registers::Id::Bp: return WriteRegister(hThread, data, UE_EBP, 2); - case RegisterId::Si: + case Registers::Id::Si: return WriteRegister(hThread, data, UE_ESI, 2); - case RegisterId::Di: + case Registers::Id::Di: return WriteRegister(hThread, data, UE_EDI, 2); - case RegisterId::Eax: + case Registers::Id::Eax: return WriteRegister(hThread, data, UE_EAX, 4); - case RegisterId::Ecx: + case Registers::Id::Ecx: return WriteRegister(hThread, data, UE_ECX, 4); - case RegisterId::Edx: + case Registers::Id::Edx: return WriteRegister(hThread, data, UE_EDX, 4); - case RegisterId::Ebx: + case Registers::Id::Ebx: return WriteRegister(hThread, data, UE_EBX, 4); - case RegisterId::Esp: + case Registers::Id::Esp: return WriteRegister(hThread, data, UE_ESP, 4); - case RegisterId::Ebp: + case Registers::Id::Ebp: return WriteRegister(hThread, data, UE_EBP, 4); - case RegisterId::Esi: + case Registers::Id::Esi: return WriteRegister(hThread, data, UE_ESI, 4); - case RegisterId::Edi: + case Registers::Id::Edi: return WriteRegister(hThread, data, UE_EDI, 4); #endif - case RegisterId::St0: + case Registers::Id::St0: break; - case RegisterId::St1: + case Registers::Id::St1: break; - case RegisterId::St2: + case Registers::Id::St2: break; - case RegisterId::St3: + case Registers::Id::St3: break; - case RegisterId::St4: + case Registers::Id::St4: break; - case RegisterId::St5: + case Registers::Id::St5: break; - case RegisterId::St6: + case Registers::Id::St6: break; - case RegisterId::St7: + case Registers::Id::St7: break; - case RegisterId::X87Control: + case Registers::Id::X87Control: break; - case RegisterId::X87Status: + case Registers::Id::X87Status: break; - case RegisterId::X87Tag: + case Registers::Id::X87Tag: break; - case RegisterId::Mm0: + case Registers::Id::Mm0: break; - case RegisterId::Mm1: + case Registers::Id::Mm1: break; - case RegisterId::Mm2: + case Registers::Id::Mm2: break; - case RegisterId::Mm3: + case Registers::Id::Mm3: break; - case RegisterId::Mm4: + case Registers::Id::Mm4: break; - case RegisterId::Mm5: + case Registers::Id::Mm5: break; - case RegisterId::Mm6: + case Registers::Id::Mm6: break; - case RegisterId::Mm7: + case Registers::Id::Mm7: break; - case RegisterId::Xmm0: + case Registers::Id::Xmm0: break; - case RegisterId::Xmm1: + case Registers::Id::Xmm1: break; - case RegisterId::Xmm2: + case Registers::Id::Xmm2: break; - case RegisterId::Xmm3: + case Registers::Id::Xmm3: break; - case RegisterId::Xmm4: + case Registers::Id::Xmm4: break; - case RegisterId::Xmm5: + case Registers::Id::Xmm5: break; - case RegisterId::Xmm6: + case Registers::Id::Xmm6: break; - case RegisterId::Xmm7: + case Registers::Id::Xmm7: break; - case RegisterId::Xmm8: + case Registers::Id::Xmm8: break; - case RegisterId::Xmm9: + case Registers::Id::Xmm9: break; - case RegisterId::Xmm10: + case Registers::Id::Xmm10: break; - case RegisterId::Xmm11: + case Registers::Id::Xmm11: break; - case RegisterId::Xmm12: + case Registers::Id::Xmm12: break; - case RegisterId::Xmm13: + case Registers::Id::Xmm13: break; - case RegisterId::Xmm14: + case Registers::Id::Xmm14: break; - case RegisterId::Xmm15: + case Registers::Id::Xmm15: break; - case RegisterId::Xmm16: + case Registers::Id::Xmm16: break; - case RegisterId::Xmm17: + case Registers::Id::Xmm17: break; - case RegisterId::Xmm18: + case Registers::Id::Xmm18: break; - case RegisterId::Xmm19: + case Registers::Id::Xmm19: break; - case RegisterId::Xmm20: + case Registers::Id::Xmm20: break; - case RegisterId::Xmm21: + case Registers::Id::Xmm21: break; - case RegisterId::Xmm22: + case Registers::Id::Xmm22: break; - case RegisterId::Xmm23: + case Registers::Id::Xmm23: break; - case RegisterId::Xmm24: + case Registers::Id::Xmm24: break; - case RegisterId::Xmm25: + case Registers::Id::Xmm25: break; - case RegisterId::Xmm26: + case Registers::Id::Xmm26: break; - case RegisterId::Xmm27: + case Registers::Id::Xmm27: break; - case RegisterId::Xmm28: + case Registers::Id::Xmm28: break; - case RegisterId::Xmm29: + case Registers::Id::Xmm29: break; - case RegisterId::Xmm30: + case Registers::Id::Xmm30: break; - case RegisterId::Xmm31: + case Registers::Id::Xmm31: break; - case RegisterId::Ymm0: + case Registers::Id::Ymm0: break; - case RegisterId::Ymm1: + case Registers::Id::Ymm1: break; - case RegisterId::Ymm2: + case Registers::Id::Ymm2: break; - case RegisterId::Ymm3: + case Registers::Id::Ymm3: break; - case RegisterId::Ymm4: + case Registers::Id::Ymm4: break; - case RegisterId::Ymm5: + case Registers::Id::Ymm5: break; - case RegisterId::Ymm6: + case Registers::Id::Ymm6: break; - case RegisterId::Ymm7: + case Registers::Id::Ymm7: break; - case RegisterId::Ymm8: + case Registers::Id::Ymm8: break; - case RegisterId::Ymm9: + case Registers::Id::Ymm9: break; - case RegisterId::Ymm10: + case Registers::Id::Ymm10: break; - case RegisterId::Ymm11: + case Registers::Id::Ymm11: break; - case RegisterId::Ymm12: + case Registers::Id::Ymm12: break; - case RegisterId::Ymm13: + case Registers::Id::Ymm13: break; - case RegisterId::Ymm14: + case Registers::Id::Ymm14: break; - case RegisterId::Ymm15: + case Registers::Id::Ymm15: break; - case RegisterId::Ymm16: + case Registers::Id::Ymm16: break; - case RegisterId::Ymm17: + case Registers::Id::Ymm17: break; - case RegisterId::Ymm18: + case Registers::Id::Ymm18: break; - case RegisterId::Ymm19: + case Registers::Id::Ymm19: break; - case RegisterId::Ymm20: + case Registers::Id::Ymm20: break; - case RegisterId::Ymm21: + case Registers::Id::Ymm21: break; - case RegisterId::Ymm22: + case Registers::Id::Ymm22: break; - case RegisterId::Ymm23: + case Registers::Id::Ymm23: break; - case RegisterId::Ymm24: + case Registers::Id::Ymm24: break; - case RegisterId::Ymm25: + case Registers::Id::Ymm25: break; - case RegisterId::Ymm26: + case Registers::Id::Ymm26: break; - case RegisterId::Ymm27: + case Registers::Id::Ymm27: break; - case RegisterId::Ymm28: + case Registers::Id::Ymm28: break; - case RegisterId::Ymm29: + case Registers::Id::Ymm29: break; - case RegisterId::Ymm30: + case Registers::Id::Ymm30: break; - case RegisterId::Ymm31: + case Registers::Id::Ymm31: break; - case RegisterId::Zmm0: + case Registers::Id::Zmm0: break; - case RegisterId::Zmm1: + case Registers::Id::Zmm1: break; - case RegisterId::Zmm2: + case Registers::Id::Zmm2: break; - case RegisterId::Zmm3: + case Registers::Id::Zmm3: break; - case RegisterId::Zmm4: + case Registers::Id::Zmm4: break; - case RegisterId::Zmm5: + case Registers::Id::Zmm5: break; - case RegisterId::Zmm6: + case Registers::Id::Zmm6: break; - case RegisterId::Zmm7: + case Registers::Id::Zmm7: break; - case RegisterId::Zmm8: + case Registers::Id::Zmm8: break; - case RegisterId::Zmm9: + case Registers::Id::Zmm9: break; - case RegisterId::Zmm10: + case Registers::Id::Zmm10: break; - case RegisterId::Zmm11: + case Registers::Id::Zmm11: break; - case RegisterId::Zmm12: + case Registers::Id::Zmm12: break; - case RegisterId::Zmm13: + case Registers::Id::Zmm13: break; - case RegisterId::Zmm14: + case Registers::Id::Zmm14: break; - case RegisterId::Zmm15: + case Registers::Id::Zmm15: break; - case RegisterId::Zmm16: + case Registers::Id::Zmm16: break; - case RegisterId::Zmm17: + case Registers::Id::Zmm17: break; - case RegisterId::Zmm18: + case Registers::Id::Zmm18: break; - case RegisterId::Zmm19: + case Registers::Id::Zmm19: break; - case RegisterId::Zmm20: + case Registers::Id::Zmm20: break; - case RegisterId::Zmm21: + case Registers::Id::Zmm21: break; - case RegisterId::Zmm22: + case Registers::Id::Zmm22: break; - case RegisterId::Zmm23: + case Registers::Id::Zmm23: break; - case RegisterId::Zmm24: + case Registers::Id::Zmm24: break; - case RegisterId::Zmm25: + case Registers::Id::Zmm25: break; - case RegisterId::Zmm26: + case Registers::Id::Zmm26: break; - case RegisterId::Zmm27: + case Registers::Id::Zmm27: break; - case RegisterId::Zmm28: + case Registers::Id::Zmm28: break; - case RegisterId::Zmm29: + case Registers::Id::Zmm29: break; - case RegisterId::Zmm30: + case Registers::Id::Zmm30: break; - case RegisterId::Zmm31: + case Registers::Id::Zmm31: break; #ifdef _M_X64 - case RegisterId::Flags: + case Registers::Id::Flags: return WriteRegister(hThread, data, UE_RFLAGS, 2); - case RegisterId::EFlags: + case Registers::Id::EFlags: return WriteRegister(hThread, data, UE_RFLAGS, 4); - case RegisterId::RFlags: + case Registers::Id::RFlags: return WriteRegister(hThread, data, UE_RFLAGS, 8); - case RegisterId::Ip: + case Registers::Id::Ip: return WriteRegister(hThread, data, UE_RIP, 2); - case RegisterId::Eip: + case Registers::Id::Eip: return WriteRegister(hThread, data, UE_RIP, 4); - case RegisterId::Rip: + case Registers::Id::Rip: return WriteRegister(hThread, data, UE_RIP, 8); #else - case RegisterId::Flags: + case Registers::Id::Flags: return WriteRegister(hThread, data, UE_EFLAGS, 2); - case RegisterId::EFlags: + case Registers::Id::EFlags: return WriteRegister(hThread, data, UE_EFLAGS, 4); - case RegisterId::Ip: + case Registers::Id::Ip: return WriteRegister(hThread, data, UE_EIP, 2); - case RegisterId::Eip: + case Registers::Id::Eip: return WriteRegister(hThread, data, UE_EIP, 4); #endif - case RegisterId::Es: + case Registers::Id::Es: return WriteRegister(hThread, data, UE_SEG_ES, 2); - case RegisterId::Cs: + case Registers::Id::Cs: return WriteRegister(hThread, data, UE_SEG_CS, 2); - case RegisterId::Ss: + case Registers::Id::Ss: return WriteRegister(hThread, data, UE_SEG_SS, 2); - case RegisterId::Ds: + case Registers::Id::Ds: return WriteRegister(hThread, data, UE_SEG_DS, 2); - case RegisterId::Fs: + case Registers::Id::Fs: return WriteRegister(hThread, data, UE_SEG_FS, 2); - case RegisterId::Gs: + case Registers::Id::Gs: return WriteRegister(hThread, data, UE_SEG_GS, 2); - case RegisterId::Gdtr: + case Registers::Id::Gdtr: break; - case RegisterId::Ldtr: + case Registers::Id::Ldtr: break; - case RegisterId::Idtr: + case Registers::Id::Idtr: break; - case RegisterId::Tr: + case Registers::Id::Tr: break; - case RegisterId::Tr0: + case Registers::Id::Tr0: break; - case RegisterId::Tr1: + case Registers::Id::Tr1: break; - case RegisterId::Tr2: + case Registers::Id::Tr2: break; - case RegisterId::Tr3: + case Registers::Id::Tr3: break; - case RegisterId::Tr4: + case Registers::Id::Tr4: break; - case RegisterId::Tr5: + case Registers::Id::Tr5: break; - case RegisterId::Tr6: + case Registers::Id::Tr6: break; - case RegisterId::Tr7: + case Registers::Id::Tr7: break; - case RegisterId::Cr0: + case Registers::Id::Cr0: break; - case RegisterId::Cr1: + case Registers::Id::Cr1: break; - case RegisterId::Cr2: + case Registers::Id::Cr2: break; - case RegisterId::Cr3: + case Registers::Id::Cr3: break; - case RegisterId::Cr4: + case Registers::Id::Cr4: break; - case RegisterId::Cr5: + case Registers::Id::Cr5: break; - case RegisterId::Cr6: + case Registers::Id::Cr6: break; - case RegisterId::Cr7: + case Registers::Id::Cr7: break; - case RegisterId::Cr8: + case Registers::Id::Cr8: break; - case RegisterId::Cr9: + case Registers::Id::Cr9: break; - case RegisterId::Cr10: + case Registers::Id::Cr10: break; - case RegisterId::Cr11: + case Registers::Id::Cr11: break; - case RegisterId::Cr12: + case Registers::Id::Cr12: break; - case RegisterId::Cr13: + case Registers::Id::Cr13: break; - case RegisterId::Cr14: + case Registers::Id::Cr14: break; - case RegisterId::Cr15: + case Registers::Id::Cr15: break; - case RegisterId::Dr0: + case Registers::Id::Dr0: break; - case RegisterId::Dr1: + case Registers::Id::Dr1: break; - case RegisterId::Dr2: + case Registers::Id::Dr2: break; - case RegisterId::Dr3: + case Registers::Id::Dr3: break; - case RegisterId::Dr4: + case Registers::Id::Dr4: break; - case RegisterId::Dr5: + case Registers::Id::Dr5: break; - case RegisterId::Dr6: + case Registers::Id::Dr6: break; - case RegisterId::Dr7: + case Registers::Id::Dr7: break; - case RegisterId::Dr8: + case Registers::Id::Dr8: break; - case RegisterId::Dr9: + case Registers::Id::Dr9: break; - case RegisterId::Dr10: + case Registers::Id::Dr10: break; - case RegisterId::Dr11: + case Registers::Id::Dr11: break; - case RegisterId::Dr12: + case Registers::Id::Dr12: break; - case RegisterId::Dr13: + case Registers::Id::Dr13: break; - case RegisterId::Dr14: + case Registers::Id::Dr14: break; - case RegisterId::Dr15: + case Registers::Id::Dr15: break; - case RegisterId::K0: + case Registers::Id::K0: break; - case RegisterId::K1: + case Registers::Id::K1: break; - case RegisterId::K2: + case Registers::Id::K2: break; - case RegisterId::K3: + case Registers::Id::K3: break; - case RegisterId::K4: + case Registers::Id::K4: break; - case RegisterId::K5: + case Registers::Id::K5: break; - case RegisterId::K6: + case Registers::Id::K6: break; - case RegisterId::K7: + case Registers::Id::K7: break; - case RegisterId::Bnd0: + case Registers::Id::Bnd0: break; - case RegisterId::Bnd1: + case Registers::Id::Bnd1: break; - case RegisterId::Bnd2: + case Registers::Id::Bnd2: break; - case RegisterId::Bnd3: + case Registers::Id::Bnd3: break; - case RegisterId::BndCfg: + case Registers::Id::BndCfg: break; - case RegisterId::BndStatus: + case Registers::Id::BndStatus: break; - case RegisterId::Mxcsr: + case Registers::Id::Mxcsr: break; - case RegisterId::Pkru: + case Registers::Id::Pkru: break; - case RegisterId::Xcr0: + case Registers::Id::Xcr0: break; default: break; diff --git a/src/Dotx64DbgManagedTests/Tests/Tests.Generator.cs b/src/Dotx64DbgManagedTests/Tests/Tests.Generator.cs index f9287e4..08c6fd5 100644 --- a/src/Dotx64DbgManagedTests/Tests/Tests.Generator.cs +++ b/src/Dotx64DbgManagedTests/Tests/Tests.Generator.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; using System.Text; @@ -22,18 +22,18 @@ public void TestSubEaxEdx() AssertEq((instr.GetOperand(1) as Operand.Register).Value, Edx.Value); AssertEq(instr.GetOperandAccess(1), OperandAccess.Read); AssertEq(instr.FlagsRead, Dotx64Dbg.EFlags.None); - AssertEq(instr.FlagsWrite, Dotx64Dbg.EFlags.Of | - Dotx64Dbg.EFlags.Sf | - Dotx64Dbg.EFlags.Zf | - Dotx64Dbg.EFlags.Af | - Dotx64Dbg.EFlags.Pf | + AssertEq(instr.FlagsWrite, Dotx64Dbg.EFlags.Of | + Dotx64Dbg.EFlags.Sf | + Dotx64Dbg.EFlags.Zf | + Dotx64Dbg.EFlags.Af | + Dotx64Dbg.EFlags.Pf | Dotx64Dbg.EFlags.Cf); } [Test] public void TestSubEaxEdx100000() { - for(int i = 0; i < 100000; i++) + for (int i = 0; i < 100000; i++) { var instr = InstructionGenerator.Generate(Mnemonic.Sub, Eax, Edx); AssertNeq(instr, null); @@ -61,9 +61,9 @@ public void TestLeaNoDisp() var op1 = instr.GetOperand(1); AssertEq(op1.Type, OperandType.Memory); var mem = op1 as Operand.Memory; - AssertEq(mem.Segment, RegisterId.Ds); - AssertEq(mem.Base, RegisterId.Eax); - AssertEq(mem.Index, RegisterId.Edx); + AssertEq(mem.Segment, Registers.Id.Ds); + AssertEq(mem.Base, Registers.Id.Eax); + AssertEq(mem.Index, Registers.Id.Edx); AssertEq(mem.Displacement, 0); } @@ -77,9 +77,9 @@ public void TestLeaDisp() var op1 = instr.GetOperand(1); AssertEq(op1.Type, OperandType.Memory); var mem = op1 as Operand.Memory; - AssertEq(mem.Segment, RegisterId.Ds); - AssertEq(mem.Base, RegisterId.Eax); - AssertEq(mem.Index, RegisterId.Edx); + AssertEq(mem.Segment, Registers.Id.Ds); + AssertEq(mem.Base, Registers.Id.Eax); + AssertEq(mem.Index, Registers.Id.Edx); AssertEq(mem.Displacement, 0xBADBABE); } } diff --git a/src/Dotx64DbgManagedTests/Tests/Tests.Operands.cs b/src/Dotx64DbgManagedTests/Tests/Tests.Operands.cs index 5a76a0c..7bf7441 100644 --- a/src/Dotx64DbgManagedTests/Tests/Tests.Operands.cs +++ b/src/Dotx64DbgManagedTests/Tests/Tests.Operands.cs @@ -36,33 +36,33 @@ public void TestOperandImm() [Test] public void TestOperandReg() { - var al = Operands.Reg(RegisterId.Al); + var al = Operands.Reg(Registers.Id.Al); AssertEq(al.Size, 8); - var ax = Operands.Reg(RegisterId.Ax); + var ax = Operands.Reg(Registers.Id.Ax); AssertEq(ax.Size, 16); - var eax = Operands.Reg(RegisterId.Eax); + var eax = Operands.Reg(Registers.Id.Eax); AssertEq(eax.Size, 32); - var rax = Operands.Reg(RegisterId.Rax); + var rax = Operands.Reg(Registers.Id.Rax); AssertEq(rax.Size, 64); } [Test] public void TestOperandMemory8() { - var mem1 = Operands.BytePtr(RegisterId.Rax); + var mem1 = Operands.BytePtr(Registers.Id.Rax); AssertEq(mem1.Size, 8); - AssertEq(mem1.Base, RegisterId.Rax); + AssertEq(mem1.Base, Registers.Id.Rax); var str1 = mem1.ToString(); AssertEq(str1, "byte ptr [rax]"); - var mem2 = Operands.BytePtr(RegisterId.Rax, RegisterId.Rdx); + var mem2 = Operands.BytePtr(Registers.Id.Rax, Registers.Id.Rdx); AssertEq(mem2.Size, 8); - AssertEq(mem2.Base, RegisterId.Rax); - AssertEq(mem2.Index, RegisterId.Rdx); + AssertEq(mem2.Base, Registers.Id.Rax); + AssertEq(mem2.Index, Registers.Id.Rdx); var str2 = mem2.ToString(); AssertEq(str2, "byte ptr [rax+rdx]"); @@ -71,17 +71,17 @@ public void TestOperandMemory8() [Test] public void TestOperandMemory16() { - var mem1 = Operands.WordPtr(RegisterId.Rax); + var mem1 = Operands.WordPtr(Registers.Id.Rax); AssertEq(mem1.Size, 16); - AssertEq(mem1.Base, RegisterId.Rax); + AssertEq(mem1.Base, Registers.Id.Rax); var str1 = mem1.ToString(); AssertEq(str1, "word ptr [rax]"); - var mem2 = Operands.WordPtr(RegisterId.Rax, RegisterId.Rdx); + var mem2 = Operands.WordPtr(Registers.Id.Rax, Registers.Id.Rdx); AssertEq(mem2.Size, 16); - AssertEq(mem2.Base, RegisterId.Rax); - AssertEq(mem2.Index, RegisterId.Rdx); + AssertEq(mem2.Base, Registers.Id.Rax); + AssertEq(mem2.Index, Registers.Id.Rdx); var str2 = mem2.ToString(); AssertEq(str2, "word ptr [rax+rdx]"); diff --git a/src/Dotx64DbgManagedTests/Tests/Tests.RegisterMaskGp.cs b/src/Dotx64DbgManagedTests/Tests/Tests.RegisterMaskGp.cs index 37cca63..a2dbc37 100644 --- a/src/Dotx64DbgManagedTests/Tests/Tests.RegisterMaskGp.cs +++ b/src/Dotx64DbgManagedTests/Tests/Tests.RegisterMaskGp.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; using System.Text; @@ -14,9 +14,9 @@ class TestRegisterMaskGp public void TestMask() { var mask = Analysis.RegisterMaskGp.None; - mask.Add(RegisterId.Ah); - mask.Add(RegisterId.Al); - mask.Add(RegisterId.Ecx); + mask.Add(Registers.Id.Ah); + mask.Add(Registers.Id.Al); + mask.Add(Registers.Id.Ecx); AssertEq(mask.Count, 2); @@ -24,11 +24,11 @@ public void TestMask() AssertEq(regs.Length, 2); #if _X64_ - AssertEq(regs[0], RegisterId.Rax); - AssertEq(regs[1], RegisterId.Rcx); + AssertEq(regs[0], Registers.Id.Rax); + AssertEq(regs[1], Registers.Id.Rcx); #else - AssertEq(regs[0], RegisterId.Eax); - AssertEq(regs[1], RegisterId.Ecx); + AssertEq(regs[0], Registers.Id.Eax); + AssertEq(regs[1], Registers.Id.Ecx); #endif Operand.Register[] regs2; @@ -46,9 +46,9 @@ public void TestMask() public void TestMask2() { var mask = Analysis.RegisterMaskGp.None; - mask.Add(RegisterId.Ah); - mask.Add(RegisterId.Al); - mask.Add(RegisterId.R15); + mask.Add(Registers.Id.Ah); + mask.Add(Registers.Id.Al); + mask.Add(Registers.Id.R15); AssertEq(mask.Count, 2); @@ -56,11 +56,11 @@ public void TestMask2() AssertEq(regs.Length, 2); #if _X64_ - AssertEq(regs[0], RegisterId.Rax); - AssertEq(regs[1], RegisterId.R15); + AssertEq(regs[0], Registers.Id.Rax); + AssertEq(regs[1], Registers.Id.R15); #else - AssertEq(regs[0], RegisterId.Eax); - AssertEq(regs[1], RegisterId.R15d); + AssertEq(regs[0], Registers.Id.Eax); + AssertEq(regs[1], Registers.Id.R15d); #endif Operand.Register[] regs2; @@ -77,22 +77,22 @@ public void TestMask2() [Test] public void TestMaskCountForward() { - RegisterId[] regs = new[] { - RegisterId.Eax, - RegisterId.Ebx, - RegisterId.Ecx, - RegisterId.Edx, - RegisterId.Ebp, - RegisterId.Esp, - RegisterId.Edi, - RegisterId.R8d, - RegisterId.R9d, - RegisterId.R10d, - RegisterId.R11d, - RegisterId.R12d, - RegisterId.R13d, - RegisterId.R14d, - RegisterId.R15d + Registers.Id[] regs = new[] { + Registers.Id.Eax, + Registers.Id.Ebx, + Registers.Id.Ecx, + Registers.Id.Edx, + Registers.Id.Ebp, + Registers.Id.Esp, + Registers.Id.Edi, + Registers.Id.R8d, + Registers.Id.R9d, + Registers.Id.R10d, + Registers.Id.R11d, + Registers.Id.R12d, + Registers.Id.R13d, + Registers.Id.R14d, + Registers.Id.R15d }; var mask = Analysis.RegisterMaskGp.None; @@ -110,23 +110,23 @@ public void TestMaskCountForward() [Test] public void TestMaskCountReverse() { - List regs = new() + List regs = new() { - RegisterId.Eax, - RegisterId.Ebx, - RegisterId.Ecx, - RegisterId.Edx, - RegisterId.Ebp, - RegisterId.Esp, - RegisterId.Edi, - RegisterId.R8d, - RegisterId.R9d, - RegisterId.R10d, - RegisterId.R11d, - RegisterId.R12d, - RegisterId.R13d, - RegisterId.R14d, - RegisterId.R15d + Registers.Id.Eax, + Registers.Id.Ebx, + Registers.Id.Ecx, + Registers.Id.Edx, + Registers.Id.Ebp, + Registers.Id.Esp, + Registers.Id.Edi, + Registers.Id.R8d, + Registers.Id.R9d, + Registers.Id.R10d, + Registers.Id.R11d, + Registers.Id.R12d, + Registers.Id.R13d, + Registers.Id.R14d, + Registers.Id.R15d }; var mask = Analysis.RegisterMaskGp.None; @@ -146,23 +146,23 @@ public void TestMaskCountReverse() [Test] public void TestMaskCountRandom() { - List regs = new() + List regs = new() { - RegisterId.Eax, - RegisterId.Ebx, - RegisterId.Ecx, - RegisterId.Edx, - RegisterId.Ebp, - RegisterId.Esp, - RegisterId.Edi, - RegisterId.R8d, - RegisterId.R9d, - RegisterId.R10d, - RegisterId.R11d, - RegisterId.R12d, - RegisterId.R13d, - RegisterId.R14d, - RegisterId.R15d + Registers.Id.Eax, + Registers.Id.Ebx, + Registers.Id.Ecx, + Registers.Id.Edx, + Registers.Id.Ebp, + Registers.Id.Esp, + Registers.Id.Edi, + Registers.Id.R8d, + Registers.Id.R9d, + Registers.Id.R10d, + Registers.Id.R11d, + Registers.Id.R12d, + Registers.Id.R13d, + Registers.Id.R14d, + Registers.Id.R15d }; for (int seed = 0; seed < 100; seed++) diff --git a/src/Dotx64DbgManagedTests/Tests/Tests.Registers.cs b/src/Dotx64DbgManagedTests/Tests/Tests.Registers.cs index 973fe66..f95c55a 100644 --- a/src/Dotx64DbgManagedTests/Tests/Tests.Registers.cs +++ b/src/Dotx64DbgManagedTests/Tests/Tests.Registers.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; using System.Text; @@ -14,204 +14,204 @@ class TestRegisters [Test] public void TestRoot() { - AssertEq(Operands.Reg(RegisterId.None).RootId, RegisterId.None); + AssertEq(Operands.Reg(Registers.Id.None).RootId, Registers.Id.None); #if _X64_ - AssertEq(Operands.Al.RootId, RegisterId.Rax); - AssertEq(Operands.Cl.RootId, RegisterId.Rcx); - AssertEq(Operands.Dl.RootId, RegisterId.Rdx); - AssertEq(Operands.Bl.RootId, RegisterId.Rbx); - AssertEq(Operands.Ah.RootId, RegisterId.Rax); - AssertEq(Operands.Ch.RootId, RegisterId.Rcx); - AssertEq(Operands.Dh.RootId, RegisterId.Rdx); - AssertEq(Operands.Bh.RootId, RegisterId.Rbx); - AssertEq(Operands.Spl.RootId, RegisterId.Rsp); - AssertEq(Operands.Bpl.RootId, RegisterId.Rbp); - AssertEq(Operands.Sil.RootId, RegisterId.Rsi); - AssertEq(Operands.Dil.RootId, RegisterId.Rdi); - AssertEq(Operands.R8b.RootId, RegisterId.R8); - AssertEq(Operands.R9b.RootId, RegisterId.R9); - AssertEq(Operands.R10b.RootId, RegisterId.R10); - AssertEq(Operands.R11b.RootId, RegisterId.R11); - AssertEq(Operands.R12b.RootId, RegisterId.R12); - AssertEq(Operands.R13b.RootId, RegisterId.R13); - AssertEq(Operands.R14b.RootId, RegisterId.R14); - AssertEq(Operands.R15b.RootId, RegisterId.R15); - AssertEq(Operands.Ax.RootId, RegisterId.Rax); - AssertEq(Operands.Cx.RootId, RegisterId.Rcx); - AssertEq(Operands.Dx.RootId, RegisterId.Rdx); - AssertEq(Operands.Bx.RootId, RegisterId.Rbx); - AssertEq(Operands.Sp.RootId, RegisterId.Rsp); - AssertEq(Operands.Bp.RootId, RegisterId.Rbp); - AssertEq(Operands.Si.RootId, RegisterId.Rsi); - AssertEq(Operands.Di.RootId, RegisterId.Rdi); - AssertEq(Operands.R8w.RootId, RegisterId.R8); - AssertEq(Operands.R9w.RootId, RegisterId.R9); - AssertEq(Operands.R10w.RootId, RegisterId.R10); - AssertEq(Operands.R11w.RootId, RegisterId.R11); - AssertEq(Operands.R12w.RootId, RegisterId.R12); - AssertEq(Operands.R13w.RootId, RegisterId.R13); - AssertEq(Operands.R14w.RootId, RegisterId.R14); - AssertEq(Operands.R15w.RootId, RegisterId.R15); - AssertEq(Operands.Eax.RootId, RegisterId.Rax); - AssertEq(Operands.Ecx.RootId, RegisterId.Rcx); - AssertEq(Operands.Edx.RootId, RegisterId.Rdx); - AssertEq(Operands.Ebx.RootId, RegisterId.Rbx); - AssertEq(Operands.Esp.RootId, RegisterId.Rsp); - AssertEq(Operands.Ebp.RootId, RegisterId.Rbp); - AssertEq(Operands.Esi.RootId, RegisterId.Rsi); - AssertEq(Operands.Edi.RootId, RegisterId.Rdi); - AssertEq(Operands.R8d.RootId, RegisterId.R8); - AssertEq(Operands.R9d.RootId, RegisterId.R9); - AssertEq(Operands.R10d.RootId, RegisterId.R10); - AssertEq(Operands.R11d.RootId, RegisterId.R11); - AssertEq(Operands.R12d.RootId, RegisterId.R12); - AssertEq(Operands.R13d.RootId, RegisterId.R13); - AssertEq(Operands.R14d.RootId, RegisterId.R14); - AssertEq(Operands.R15d.RootId, RegisterId.R15); - AssertEq(Operands.Rax.RootId, RegisterId.None); - AssertEq(Operands.Rcx.RootId, RegisterId.None); - AssertEq(Operands.Rdx.RootId, RegisterId.None); - AssertEq(Operands.Rbx.RootId, RegisterId.None); - AssertEq(Operands.Rsp.RootId, RegisterId.None); - AssertEq(Operands.Rbp.RootId, RegisterId.None); - AssertEq(Operands.Rsi.RootId, RegisterId.None); - AssertEq(Operands.Rdi.RootId, RegisterId.None); - AssertEq(Operands.R8.RootId, RegisterId.None); - AssertEq(Operands.R9.RootId, RegisterId.None); - AssertEq(Operands.R10.RootId, RegisterId.None); - AssertEq(Operands.R11.RootId, RegisterId.None); - AssertEq(Operands.R12.RootId, RegisterId.None); - AssertEq(Operands.R13.RootId, RegisterId.None); - AssertEq(Operands.R14.RootId, RegisterId.None); - AssertEq(Operands.R15.RootId, RegisterId.None); + AssertEq(Operands.Al.RootId, Registers.Id.Rax); + AssertEq(Operands.Cl.RootId, Registers.Id.Rcx); + AssertEq(Operands.Dl.RootId, Registers.Id.Rdx); + AssertEq(Operands.Bl.RootId, Registers.Id.Rbx); + AssertEq(Operands.Ah.RootId, Registers.Id.Rax); + AssertEq(Operands.Ch.RootId, Registers.Id.Rcx); + AssertEq(Operands.Dh.RootId, Registers.Id.Rdx); + AssertEq(Operands.Bh.RootId, Registers.Id.Rbx); + AssertEq(Operands.Spl.RootId, Registers.Id.Rsp); + AssertEq(Operands.Bpl.RootId, Registers.Id.Rbp); + AssertEq(Operands.Sil.RootId, Registers.Id.Rsi); + AssertEq(Operands.Dil.RootId, Registers.Id.Rdi); + AssertEq(Operands.R8b.RootId, Registers.Id.R8); + AssertEq(Operands.R9b.RootId, Registers.Id.R9); + AssertEq(Operands.R10b.RootId, Registers.Id.R10); + AssertEq(Operands.R11b.RootId, Registers.Id.R11); + AssertEq(Operands.R12b.RootId, Registers.Id.R12); + AssertEq(Operands.R13b.RootId, Registers.Id.R13); + AssertEq(Operands.R14b.RootId, Registers.Id.R14); + AssertEq(Operands.R15b.RootId, Registers.Id.R15); + AssertEq(Operands.Ax.RootId, Registers.Id.Rax); + AssertEq(Operands.Cx.RootId, Registers.Id.Rcx); + AssertEq(Operands.Dx.RootId, Registers.Id.Rdx); + AssertEq(Operands.Bx.RootId, Registers.Id.Rbx); + AssertEq(Operands.Sp.RootId, Registers.Id.Rsp); + AssertEq(Operands.Bp.RootId, Registers.Id.Rbp); + AssertEq(Operands.Si.RootId, Registers.Id.Rsi); + AssertEq(Operands.Di.RootId, Registers.Id.Rdi); + AssertEq(Operands.R8w.RootId, Registers.Id.R8); + AssertEq(Operands.R9w.RootId, Registers.Id.R9); + AssertEq(Operands.R10w.RootId, Registers.Id.R10); + AssertEq(Operands.R11w.RootId, Registers.Id.R11); + AssertEq(Operands.R12w.RootId, Registers.Id.R12); + AssertEq(Operands.R13w.RootId, Registers.Id.R13); + AssertEq(Operands.R14w.RootId, Registers.Id.R14); + AssertEq(Operands.R15w.RootId, Registers.Id.R15); + AssertEq(Operands.Eax.RootId, Registers.Id.Rax); + AssertEq(Operands.Ecx.RootId, Registers.Id.Rcx); + AssertEq(Operands.Edx.RootId, Registers.Id.Rdx); + AssertEq(Operands.Ebx.RootId, Registers.Id.Rbx); + AssertEq(Operands.Esp.RootId, Registers.Id.Rsp); + AssertEq(Operands.Ebp.RootId, Registers.Id.Rbp); + AssertEq(Operands.Esi.RootId, Registers.Id.Rsi); + AssertEq(Operands.Edi.RootId, Registers.Id.Rdi); + AssertEq(Operands.R8d.RootId, Registers.Id.R8); + AssertEq(Operands.R9d.RootId, Registers.Id.R9); + AssertEq(Operands.R10d.RootId, Registers.Id.R10); + AssertEq(Operands.R11d.RootId, Registers.Id.R11); + AssertEq(Operands.R12d.RootId, Registers.Id.R12); + AssertEq(Operands.R13d.RootId, Registers.Id.R13); + AssertEq(Operands.R14d.RootId, Registers.Id.R14); + AssertEq(Operands.R15d.RootId, Registers.Id.R15); + AssertEq(Operands.Rax.RootId, Registers.Id.None); + AssertEq(Operands.Rcx.RootId, Registers.Id.None); + AssertEq(Operands.Rdx.RootId, Registers.Id.None); + AssertEq(Operands.Rbx.RootId, Registers.Id.None); + AssertEq(Operands.Rsp.RootId, Registers.Id.None); + AssertEq(Operands.Rbp.RootId, Registers.Id.None); + AssertEq(Operands.Rsi.RootId, Registers.Id.None); + AssertEq(Operands.Rdi.RootId, Registers.Id.None); + AssertEq(Operands.R8.RootId, Registers.Id.None); + AssertEq(Operands.R9.RootId, Registers.Id.None); + AssertEq(Operands.R10.RootId, Registers.Id.None); + AssertEq(Operands.R11.RootId, Registers.Id.None); + AssertEq(Operands.R12.RootId, Registers.Id.None); + AssertEq(Operands.R13.RootId, Registers.Id.None); + AssertEq(Operands.R14.RootId, Registers.Id.None); + AssertEq(Operands.R15.RootId, Registers.Id.None); #else - AssertEq(Operands.Al.RootId, RegisterId.Eax); - AssertEq(Operands.Cl.RootId, RegisterId.Ecx); - AssertEq(Operands.Dl.RootId, RegisterId.Edx); - AssertEq(Operands.Bl.RootId, RegisterId.Ebx); - AssertEq(Operands.Ah.RootId, RegisterId.Eax); - AssertEq(Operands.Ch.RootId, RegisterId.Ecx); - AssertEq(Operands.Dh.RootId, RegisterId.Edx); - AssertEq(Operands.Bh.RootId, RegisterId.Ebx); - AssertEq(Operands.Spl.RootId, RegisterId.Esp); - AssertEq(Operands.Bpl.RootId, RegisterId.Ebp); - AssertEq(Operands.Sil.RootId, RegisterId.Esi); - AssertEq(Operands.Dil.RootId, RegisterId.Edi); - AssertEq(Operands.Ax.RootId, RegisterId.Eax); - AssertEq(Operands.Cx.RootId, RegisterId.Ecx); - AssertEq(Operands.Dx.RootId, RegisterId.Edx); - AssertEq(Operands.Bx.RootId, RegisterId.Ebx); - AssertEq(Operands.Sp.RootId, RegisterId.Esp); - AssertEq(Operands.Bp.RootId, RegisterId.Ebp); - AssertEq(Operands.Si.RootId, RegisterId.Esi); - AssertEq(Operands.Di.RootId, RegisterId.Edi); - AssertEq(Operands.Eax.RootId, RegisterId.None); - AssertEq(Operands.Ecx.RootId, RegisterId.None); - AssertEq(Operands.Edx.RootId, RegisterId.None); - AssertEq(Operands.Ebx.RootId, RegisterId.None); - AssertEq(Operands.Esp.RootId, RegisterId.None); - AssertEq(Operands.Ebp.RootId, RegisterId.None); - AssertEq(Operands.Esi.RootId, RegisterId.None); - AssertEq(Operands.Edi.RootId, RegisterId.None); - AssertEq(Operands.R8d.RootId, RegisterId.None); - AssertEq(Operands.R9d.RootId, RegisterId.None); - AssertEq(Operands.R10d.RootId, RegisterId.None); - AssertEq(Operands.R11d.RootId, RegisterId.None); - AssertEq(Operands.R12d.RootId, RegisterId.None); - AssertEq(Operands.R13d.RootId, RegisterId.None); - AssertEq(Operands.R14d.RootId, RegisterId.None); - AssertEq(Operands.R15d.RootId, RegisterId.None); + AssertEq(Operands.Al.RootId, Registers.Id.Eax); + AssertEq(Operands.Cl.RootId, Registers.Id.Ecx); + AssertEq(Operands.Dl.RootId, Registers.Id.Edx); + AssertEq(Operands.Bl.RootId, Registers.Id.Ebx); + AssertEq(Operands.Ah.RootId, Registers.Id.Eax); + AssertEq(Operands.Ch.RootId, Registers.Id.Ecx); + AssertEq(Operands.Dh.RootId, Registers.Id.Edx); + AssertEq(Operands.Bh.RootId, Registers.Id.Ebx); + AssertEq(Operands.Spl.RootId, Registers.Id.Esp); + AssertEq(Operands.Bpl.RootId, Registers.Id.Ebp); + AssertEq(Operands.Sil.RootId, Registers.Id.Esi); + AssertEq(Operands.Dil.RootId, Registers.Id.Edi); + AssertEq(Operands.Ax.RootId, Registers.Id.Eax); + AssertEq(Operands.Cx.RootId, Registers.Id.Ecx); + AssertEq(Operands.Dx.RootId, Registers.Id.Edx); + AssertEq(Operands.Bx.RootId, Registers.Id.Ebx); + AssertEq(Operands.Sp.RootId, Registers.Id.Esp); + AssertEq(Operands.Bp.RootId, Registers.Id.Ebp); + AssertEq(Operands.Si.RootId, Registers.Id.Esi); + AssertEq(Operands.Di.RootId, Registers.Id.Edi); + AssertEq(Operands.Eax.RootId, Registers.Id.None); + AssertEq(Operands.Ecx.RootId, Registers.Id.None); + AssertEq(Operands.Edx.RootId, Registers.Id.None); + AssertEq(Operands.Ebx.RootId, Registers.Id.None); + AssertEq(Operands.Esp.RootId, Registers.Id.None); + AssertEq(Operands.Ebp.RootId, Registers.Id.None); + AssertEq(Operands.Esi.RootId, Registers.Id.None); + AssertEq(Operands.Edi.RootId, Registers.Id.None); + AssertEq(Operands.R8d.RootId, Registers.Id.None); + AssertEq(Operands.R9d.RootId, Registers.Id.None); + AssertEq(Operands.R10d.RootId, Registers.Id.None); + AssertEq(Operands.R11d.RootId, Registers.Id.None); + AssertEq(Operands.R12d.RootId, Registers.Id.None); + AssertEq(Operands.R13d.RootId, Registers.Id.None); + AssertEq(Operands.R14d.RootId, Registers.Id.None); + AssertEq(Operands.R15d.RootId, Registers.Id.None); #endif } [Test] public void TestParent() { - AssertEq(Operands.Al.ParentId, RegisterId.Ax); - AssertEq(Operands.Cl.ParentId, RegisterId.Cx); - AssertEq(Operands.Dl.ParentId, RegisterId.Dx); - AssertEq(Operands.Bl.ParentId, RegisterId.Bx); - AssertEq(Operands.Ah.ParentId, RegisterId.Ax); - AssertEq(Operands.Ch.ParentId, RegisterId.Cx); - AssertEq(Operands.Dh.ParentId, RegisterId.Dx); - AssertEq(Operands.Bh.ParentId, RegisterId.Bx); - AssertEq(Operands.Spl.ParentId, RegisterId.Sp); - AssertEq(Operands.Bpl.ParentId, RegisterId.Bp); - AssertEq(Operands.Sil.ParentId, RegisterId.Si); - AssertEq(Operands.Dil.ParentId, RegisterId.Di); + AssertEq(Operands.Al.ParentId, Registers.Id.Ax); + AssertEq(Operands.Cl.ParentId, Registers.Id.Cx); + AssertEq(Operands.Dl.ParentId, Registers.Id.Dx); + AssertEq(Operands.Bl.ParentId, Registers.Id.Bx); + AssertEq(Operands.Ah.ParentId, Registers.Id.Ax); + AssertEq(Operands.Ch.ParentId, Registers.Id.Cx); + AssertEq(Operands.Dh.ParentId, Registers.Id.Dx); + AssertEq(Operands.Bh.ParentId, Registers.Id.Bx); + AssertEq(Operands.Spl.ParentId, Registers.Id.Sp); + AssertEq(Operands.Bpl.ParentId, Registers.Id.Bp); + AssertEq(Operands.Sil.ParentId, Registers.Id.Si); + AssertEq(Operands.Dil.ParentId, Registers.Id.Di); #if _X64_ - AssertEq(Operands.R8b.ParentId, RegisterId.R8w); - AssertEq(Operands.R9b.ParentId, RegisterId.R9w); - AssertEq(Operands.R10b.ParentId, RegisterId.R10w); - AssertEq(Operands.R11b.ParentId, RegisterId.R11w); - AssertEq(Operands.R12b.ParentId, RegisterId.R12w); - AssertEq(Operands.R13b.ParentId, RegisterId.R13w); - AssertEq(Operands.R14b.ParentId, RegisterId.R14w); - AssertEq(Operands.R15b.ParentId, RegisterId.R15w); + AssertEq(Operands.R8b.ParentId, Registers.Id.R8w); + AssertEq(Operands.R9b.ParentId, Registers.Id.R9w); + AssertEq(Operands.R10b.ParentId, Registers.Id.R10w); + AssertEq(Operands.R11b.ParentId, Registers.Id.R11w); + AssertEq(Operands.R12b.ParentId, Registers.Id.R12w); + AssertEq(Operands.R13b.ParentId, Registers.Id.R13w); + AssertEq(Operands.R14b.ParentId, Registers.Id.R14w); + AssertEq(Operands.R15b.ParentId, Registers.Id.R15w); #endif - AssertEq(Operands.Ax.ParentId, RegisterId.Eax); - AssertEq(Operands.Cx.ParentId, RegisterId.Ecx); - AssertEq(Operands.Dx.ParentId, RegisterId.Edx); - AssertEq(Operands.Bx.ParentId, RegisterId.Ebx); - AssertEq(Operands.Sp.ParentId, RegisterId.Esp); - AssertEq(Operands.Bp.ParentId, RegisterId.Ebp); - AssertEq(Operands.Si.ParentId, RegisterId.Esi); - AssertEq(Operands.Di.ParentId, RegisterId.Edi); + AssertEq(Operands.Ax.ParentId, Registers.Id.Eax); + AssertEq(Operands.Cx.ParentId, Registers.Id.Ecx); + AssertEq(Operands.Dx.ParentId, Registers.Id.Edx); + AssertEq(Operands.Bx.ParentId, Registers.Id.Ebx); + AssertEq(Operands.Sp.ParentId, Registers.Id.Esp); + AssertEq(Operands.Bp.ParentId, Registers.Id.Ebp); + AssertEq(Operands.Si.ParentId, Registers.Id.Esi); + AssertEq(Operands.Di.ParentId, Registers.Id.Edi); #if _X64_ - AssertEq(Operands.R8w.ParentId, RegisterId.R8d); - AssertEq(Operands.R9w.ParentId, RegisterId.R9d); - AssertEq(Operands.R10w.ParentId, RegisterId.R10d); - AssertEq(Operands.R11w.ParentId, RegisterId.R11d); - AssertEq(Operands.R12w.ParentId, RegisterId.R12d); - AssertEq(Operands.R13w.ParentId, RegisterId.R13d); - AssertEq(Operands.R14w.ParentId, RegisterId.R14d); - AssertEq(Operands.R15w.ParentId, RegisterId.R15d); + AssertEq(Operands.R8w.ParentId, Registers.Id.R8d); + AssertEq(Operands.R9w.ParentId, Registers.Id.R9d); + AssertEq(Operands.R10w.ParentId, Registers.Id.R10d); + AssertEq(Operands.R11w.ParentId, Registers.Id.R11d); + AssertEq(Operands.R12w.ParentId, Registers.Id.R12d); + AssertEq(Operands.R13w.ParentId, Registers.Id.R13d); + AssertEq(Operands.R14w.ParentId, Registers.Id.R14d); + AssertEq(Operands.R15w.ParentId, Registers.Id.R15d); #endif #if _X64_ - AssertEq(Operands.Eax.ParentId, RegisterId.Rax); - AssertEq(Operands.Ecx.ParentId, RegisterId.Rcx); - AssertEq(Operands.Edx.ParentId, RegisterId.Rdx); - AssertEq(Operands.Ebx.ParentId, RegisterId.Rbx); - AssertEq(Operands.Esp.ParentId, RegisterId.Rsp); - AssertEq(Operands.Ebp.ParentId, RegisterId.Rbp); - AssertEq(Operands.Esi.ParentId, RegisterId.Rsi); - AssertEq(Operands.Edi.ParentId, RegisterId.Rdi); + AssertEq(Operands.Eax.ParentId, Registers.Id.Rax); + AssertEq(Operands.Ecx.ParentId, Registers.Id.Rcx); + AssertEq(Operands.Edx.ParentId, Registers.Id.Rdx); + AssertEq(Operands.Ebx.ParentId, Registers.Id.Rbx); + AssertEq(Operands.Esp.ParentId, Registers.Id.Rsp); + AssertEq(Operands.Ebp.ParentId, Registers.Id.Rbp); + AssertEq(Operands.Esi.ParentId, Registers.Id.Rsi); + AssertEq(Operands.Edi.ParentId, Registers.Id.Rdi); #else - AssertEq(Operands.Eax.ParentId, RegisterId.None); - AssertEq(Operands.Ecx.ParentId, RegisterId.None); - AssertEq(Operands.Edx.ParentId, RegisterId.None); - AssertEq(Operands.Ebx.ParentId, RegisterId.None); - AssertEq(Operands.Esp.ParentId, RegisterId.None); - AssertEq(Operands.Ebp.ParentId, RegisterId.None); - AssertEq(Operands.Esi.ParentId, RegisterId.None); - AssertEq(Operands.Edi.ParentId, RegisterId.None); + AssertEq(Operands.Eax.ParentId, Registers.Id.None); + AssertEq(Operands.Ecx.ParentId, Registers.Id.None); + AssertEq(Operands.Edx.ParentId, Registers.Id.None); + AssertEq(Operands.Ebx.ParentId, Registers.Id.None); + AssertEq(Operands.Esp.ParentId, Registers.Id.None); + AssertEq(Operands.Ebp.ParentId, Registers.Id.None); + AssertEq(Operands.Esi.ParentId, Registers.Id.None); + AssertEq(Operands.Edi.ParentId, Registers.Id.None); #endif #if _X64_ - AssertEq(Operands.R8d.ParentId, RegisterId.R8); - AssertEq(Operands.R9d.ParentId, RegisterId.R9); - AssertEq(Operands.R10d.ParentId, RegisterId.R10); - AssertEq(Operands.R11d.ParentId, RegisterId.R11); - AssertEq(Operands.R12d.ParentId, RegisterId.R12); - AssertEq(Operands.R13d.ParentId, RegisterId.R13); - AssertEq(Operands.R14d.ParentId, RegisterId.R14); - AssertEq(Operands.R15d.ParentId, RegisterId.R15); - AssertEq(Operands.Rax.ParentId, RegisterId.None); - AssertEq(Operands.Rcx.ParentId, RegisterId.None); - AssertEq(Operands.Rdx.ParentId, RegisterId.None); - AssertEq(Operands.Rbx.ParentId, RegisterId.None); - AssertEq(Operands.Rsp.ParentId, RegisterId.None); - AssertEq(Operands.Rbp.ParentId, RegisterId.None); - AssertEq(Operands.Rsi.ParentId, RegisterId.None); - AssertEq(Operands.Rdi.ParentId, RegisterId.None); - AssertEq(Operands.R8.ParentId, RegisterId.None); - AssertEq(Operands.R9.ParentId, RegisterId.None); - AssertEq(Operands.R10.ParentId, RegisterId.None); - AssertEq(Operands.R11.ParentId, RegisterId.None); - AssertEq(Operands.R12.ParentId, RegisterId.None); - AssertEq(Operands.R13.ParentId, RegisterId.None); - AssertEq(Operands.R14.ParentId, RegisterId.None); - AssertEq(Operands.R15.ParentId, RegisterId.None); + AssertEq(Operands.R8d.ParentId, Registers.Id.R8); + AssertEq(Operands.R9d.ParentId, Registers.Id.R9); + AssertEq(Operands.R10d.ParentId, Registers.Id.R10); + AssertEq(Operands.R11d.ParentId, Registers.Id.R11); + AssertEq(Operands.R12d.ParentId, Registers.Id.R12); + AssertEq(Operands.R13d.ParentId, Registers.Id.R13); + AssertEq(Operands.R14d.ParentId, Registers.Id.R14); + AssertEq(Operands.R15d.ParentId, Registers.Id.R15); + AssertEq(Operands.Rax.ParentId, Registers.Id.None); + AssertEq(Operands.Rcx.ParentId, Registers.Id.None); + AssertEq(Operands.Rdx.ParentId, Registers.Id.None); + AssertEq(Operands.Rbx.ParentId, Registers.Id.None); + AssertEq(Operands.Rsp.ParentId, Registers.Id.None); + AssertEq(Operands.Rbp.ParentId, Registers.Id.None); + AssertEq(Operands.Rsi.ParentId, Registers.Id.None); + AssertEq(Operands.Rdi.ParentId, Registers.Id.None); + AssertEq(Operands.R8.ParentId, Registers.Id.None); + AssertEq(Operands.R9.ParentId, Registers.Id.None); + AssertEq(Operands.R10.ParentId, Registers.Id.None); + AssertEq(Operands.R11.ParentId, Registers.Id.None); + AssertEq(Operands.R12.ParentId, Registers.Id.None); + AssertEq(Operands.R13.ParentId, Registers.Id.None); + AssertEq(Operands.R14.ParentId, Registers.Id.None); + AssertEq(Operands.R15.ParentId, Registers.Id.None); #endif } diff --git a/src/Dotx64Managed/API/Analysis/RegisterMask.cs b/src/Dotx64Managed/API/Analysis/RegisterMask.cs index f7909f8..29c9a5d 100644 --- a/src/Dotx64Managed/API/Analysis/RegisterMask.cs +++ b/src/Dotx64Managed/API/Analysis/RegisterMask.cs @@ -1,4 +1,4 @@ -using System; +using System; namespace Dotx64Dbg.Analysis { @@ -18,39 +18,14 @@ public RegisterMaskGp Add(Dotx64Dbg.Operand.Register reg) return Add(reg.Value); } - public RegisterMaskGp Add(RegisterId reg) + public RegisterMaskGp Add(Registers.Id reg) { - if (reg == RegisterId.None) - return this; - - if (reg >= RegisterId.Al && reg <= RegisterId.R15b) - { - var index = (int)reg - (int)RegisterId.Al; - if (reg >= RegisterId.Ah && reg <= RegisterId.Bh) - { - index -= 4; - } - Mask |= (RegisterMaskType)(1u << index); - } - else if (reg >= RegisterId.Ax && reg <= RegisterId.R15w) - { - var index = (int)reg - (int)RegisterId.Ax; - Mask |= (UInt16)(1u << index); - } - else if (reg >= RegisterId.Eax && reg <= RegisterId.R15d) - { - var index = (int)reg - (int)RegisterId.Eax; - Mask |= (UInt16)(1u << index); - } - else if (reg >= RegisterId.Rax && reg <= RegisterId.R15) - { - var index = (int)reg - (int)RegisterId.Rax; - Mask |= (UInt16)(1u << index); - } - else - { + var index = Registers.GetIndex(reg); + if (index == -1) throw new InvalidOperationException("Invalid register type"); - } + + Mask |= (UInt16)(1u << index); + return this; } @@ -72,9 +47,9 @@ public void GetRegisters(out Operand.Register[] res) if ((Mask & (1u << i)) != 0) { #if _X64_ - var regId = RegisterId.Rax + i; + var regId = Registers.Id.Rax + i; #else - var regId = RegisterId.Eax + i; + var regId = Registers.Id.Eax + i; #endif res[idx] = Operands.Reg(regId); idx++; @@ -82,9 +57,9 @@ public void GetRegisters(out Operand.Register[] res) } } - public RegisterId[] GetRegisters() + public Registers.Id[] GetRegisters() { - var res = new RegisterId[Count]; + var res = new Registers.Id[Count]; var idx = 0; for (int i = 0; i < 32; i++) @@ -92,9 +67,9 @@ public RegisterId[] GetRegisters() if ((Mask & (1u << i)) != 0) { #if _X64_ - var regId = RegisterId.Rax + i; + var regId = Registers.Id.Rax + i; #else - var regId = RegisterId.Eax + i; + var regId = Registers.Id.Eax + i; #endif res[idx] = regId; idx++; diff --git a/src/Dotx64Managed/API/Thread.Register.cs b/src/Dotx64Managed/API/Thread.Register.cs index b2affef..782b6a9 100644 --- a/src/Dotx64Managed/API/Thread.Register.cs +++ b/src/Dotx64Managed/API/Thread.Register.cs @@ -1,49 +1,49 @@ -using System; +using System; using System.Numerics; namespace Dotx64Dbg { public partial class Thread { - private byte GetRegisterU8(RegisterId reg) + private byte GetRegisterU8(Registers.Id reg) { var bytes = Native.Thread.GetRegisterData(Handle, reg); return bytes[0]; } - private void SetRegisterU8(RegisterId reg, byte val) + private void SetRegisterU8(Registers.Id reg, byte val) { Native.Thread.SetRegisterData(Handle, reg, BitConverter.GetBytes(val)); } - private ushort GetRegisterU16(RegisterId reg) + private ushort GetRegisterU16(Registers.Id reg) { var bytes = Native.Thread.GetRegisterData(Handle, reg); return BitConverter.ToUInt16(bytes); } - private void SetRegisterU16(RegisterId reg, ushort val) + private void SetRegisterU16(Registers.Id reg, ushort val) { Native.Thread.SetRegisterData(Handle, reg, BitConverter.GetBytes(val)); } - private uint GetRegisterU32(RegisterId reg) + private uint GetRegisterU32(Registers.Id reg) { var bytes = Native.Thread.GetRegisterData(Handle, reg); return BitConverter.ToUInt32(bytes); } #if _X64_ - private void SetRegisterU32(RegisterId reg, uint val) + private void SetRegisterU32(Registers.Id reg, uint val) #else - private void SetRegisterU32(RegisterId reg, nuint val) + private void SetRegisterU32(Registers.Id reg, nuint val) #endif { Native.Thread.SetRegisterData(Handle, reg, BitConverter.GetBytes(val)); } - private ulong GetRegisterU64(RegisterId reg) + private ulong GetRegisterU64(Registers.Id reg) { var bytes = Native.Thread.GetRegisterData(Handle, reg); return BitConverter.ToUInt64(bytes); @@ -51,353 +51,353 @@ private ulong GetRegisterU64(RegisterId reg) #if _X64_ - private void SetRegisterU64(RegisterId reg, nuint val) + private void SetRegisterU64(Registers.Id reg, nuint val) #else - private void SetRegisterU64(RegisterId reg, ulong val) + private void SetRegisterU64(Registers.Id reg, ulong val) #endif { Native.Thread.SetRegisterData(Handle, reg, BitConverter.GetBytes(val)); } - public BigInteger GetRegister(RegisterId reg) + public BigInteger GetRegister(Registers.Id reg) { var bytes = Native.Thread.GetRegisterData(Handle, reg); return new BigInteger(bytes, true); } - public void SetRegister(RegisterId reg, BigInteger val) + public void SetRegister(Registers.Id reg, BigInteger val) { Native.Thread.SetRegisterData(Handle, reg, val.ToByteArray()); } - public byte Al { get => GetRegisterU8(RegisterId.Al); set => SetRegisterU8(RegisterId.Al, value); } - public byte Cl { get => GetRegisterU8(RegisterId.Cl); set => SetRegisterU8(RegisterId.Cl, value); } - public byte Dl { get => GetRegisterU8(RegisterId.Dl); set => SetRegisterU8(RegisterId.Dl, value); } - public byte Bl { get => GetRegisterU8(RegisterId.Bl); set => SetRegisterU8(RegisterId.Bl, value); } - public byte Ah { get => GetRegisterU8(RegisterId.Ah); set => SetRegisterU8(RegisterId.Ah, value); } - public byte Ch { get => GetRegisterU8(RegisterId.Ch); set => SetRegisterU8(RegisterId.Ch, value); } - public byte Dh { get => GetRegisterU8(RegisterId.Dh); set => SetRegisterU8(RegisterId.Dh, value); } - public byte Bh { get => GetRegisterU8(RegisterId.Bh); set => SetRegisterU8(RegisterId.Bh, value); } - public byte Spl { get => GetRegisterU8(RegisterId.Spl); set => SetRegisterU8(RegisterId.Spl, value); } - public byte Bpl { get => GetRegisterU8(RegisterId.Bpl); set => SetRegisterU8(RegisterId.Bpl, value); } - public byte Sil { get => GetRegisterU8(RegisterId.Sil); set => SetRegisterU8(RegisterId.Sil, value); } - public byte Dil { get => GetRegisterU8(RegisterId.Dil); set => SetRegisterU8(RegisterId.Dil, value); } + public byte Al { get => GetRegisterU8(Registers.Id.Al); set => SetRegisterU8(Registers.Id.Al, value); } + public byte Cl { get => GetRegisterU8(Registers.Id.Cl); set => SetRegisterU8(Registers.Id.Cl, value); } + public byte Dl { get => GetRegisterU8(Registers.Id.Dl); set => SetRegisterU8(Registers.Id.Dl, value); } + public byte Bl { get => GetRegisterU8(Registers.Id.Bl); set => SetRegisterU8(Registers.Id.Bl, value); } + public byte Ah { get => GetRegisterU8(Registers.Id.Ah); set => SetRegisterU8(Registers.Id.Ah, value); } + public byte Ch { get => GetRegisterU8(Registers.Id.Ch); set => SetRegisterU8(Registers.Id.Ch, value); } + public byte Dh { get => GetRegisterU8(Registers.Id.Dh); set => SetRegisterU8(Registers.Id.Dh, value); } + public byte Bh { get => GetRegisterU8(Registers.Id.Bh); set => SetRegisterU8(Registers.Id.Bh, value); } + public byte Spl { get => GetRegisterU8(Registers.Id.Spl); set => SetRegisterU8(Registers.Id.Spl, value); } + public byte Bpl { get => GetRegisterU8(Registers.Id.Bpl); set => SetRegisterU8(Registers.Id.Bpl, value); } + public byte Sil { get => GetRegisterU8(Registers.Id.Sil); set => SetRegisterU8(Registers.Id.Sil, value); } + public byte Dil { get => GetRegisterU8(Registers.Id.Dil); set => SetRegisterU8(Registers.Id.Dil, value); } #if _X64_ - public byte R8b { get => GetRegisterU8(RegisterId.R8b); set => SetRegisterU8(RegisterId.R8b, value); } - public byte R9b { get => GetRegisterU8(RegisterId.R9b); set => SetRegisterU8(RegisterId.R9b, value); } - public byte R10b { get => GetRegisterU8(RegisterId.R10b); set => SetRegisterU8(RegisterId.R10b, value); } - public byte R11b { get => GetRegisterU8(RegisterId.R11b); set => SetRegisterU8(RegisterId.R11b, value); } - public byte R12b { get => GetRegisterU8(RegisterId.R12b); set => SetRegisterU8(RegisterId.R12b, value); } - public byte R13b { get => GetRegisterU8(RegisterId.R13b); set => SetRegisterU8(RegisterId.R13b, value); } - public byte R14b { get => GetRegisterU8(RegisterId.R14b); set => SetRegisterU8(RegisterId.R14b, value); } - public byte R15b { get => GetRegisterU8(RegisterId.R15b); set => SetRegisterU8(RegisterId.R15b, value); } + public byte R8b { get => GetRegisterU8(Registers.Id.R8b); set => SetRegisterU8(Registers.Id.R8b, value); } + public byte R9b { get => GetRegisterU8(Registers.Id.R9b); set => SetRegisterU8(Registers.Id.R9b, value); } + public byte R10b { get => GetRegisterU8(Registers.Id.R10b); set => SetRegisterU8(Registers.Id.R10b, value); } + public byte R11b { get => GetRegisterU8(Registers.Id.R11b); set => SetRegisterU8(Registers.Id.R11b, value); } + public byte R12b { get => GetRegisterU8(Registers.Id.R12b); set => SetRegisterU8(Registers.Id.R12b, value); } + public byte R13b { get => GetRegisterU8(Registers.Id.R13b); set => SetRegisterU8(Registers.Id.R13b, value); } + public byte R14b { get => GetRegisterU8(Registers.Id.R14b); set => SetRegisterU8(Registers.Id.R14b, value); } + public byte R15b { get => GetRegisterU8(Registers.Id.R15b); set => SetRegisterU8(Registers.Id.R15b, value); } #endif - public ushort Ax { get => GetRegisterU16(RegisterId.Ax); set => SetRegisterU16(RegisterId.Ax, value); } - public ushort Cx { get => GetRegisterU16(RegisterId.Cx); set => SetRegisterU16(RegisterId.Cx, value); } - public ushort Dx { get => GetRegisterU16(RegisterId.Dx); set => SetRegisterU16(RegisterId.Dx, value); } - public ushort Bx { get => GetRegisterU16(RegisterId.Bx); set => SetRegisterU16(RegisterId.Bx, value); } - public ushort Sp { get => GetRegisterU16(RegisterId.Sp); set => SetRegisterU16(RegisterId.Sp, value); } - public ushort Bp { get => GetRegisterU16(RegisterId.Bp); set => SetRegisterU16(RegisterId.Bp, value); } - public ushort Si { get => GetRegisterU16(RegisterId.Si); set => SetRegisterU16(RegisterId.Si, value); } - public ushort Di { get => GetRegisterU16(RegisterId.Di); set => SetRegisterU16(RegisterId.Di, value); } + public ushort Ax { get => GetRegisterU16(Registers.Id.Ax); set => SetRegisterU16(Registers.Id.Ax, value); } + public ushort Cx { get => GetRegisterU16(Registers.Id.Cx); set => SetRegisterU16(Registers.Id.Cx, value); } + public ushort Dx { get => GetRegisterU16(Registers.Id.Dx); set => SetRegisterU16(Registers.Id.Dx, value); } + public ushort Bx { get => GetRegisterU16(Registers.Id.Bx); set => SetRegisterU16(Registers.Id.Bx, value); } + public ushort Sp { get => GetRegisterU16(Registers.Id.Sp); set => SetRegisterU16(Registers.Id.Sp, value); } + public ushort Bp { get => GetRegisterU16(Registers.Id.Bp); set => SetRegisterU16(Registers.Id.Bp, value); } + public ushort Si { get => GetRegisterU16(Registers.Id.Si); set => SetRegisterU16(Registers.Id.Si, value); } + public ushort Di { get => GetRegisterU16(Registers.Id.Di); set => SetRegisterU16(Registers.Id.Di, value); } #if _X64_ - public ushort R8w { get => GetRegisterU16(RegisterId.R8w); set => SetRegisterU16(RegisterId.R8w, value); } - public ushort R9w { get => GetRegisterU16(RegisterId.R9w); set => SetRegisterU16(RegisterId.R9w, value); } - public ushort R10w { get => GetRegisterU16(RegisterId.R10w); set => SetRegisterU16(RegisterId.R10w, value); } - public ushort R11w { get => GetRegisterU16(RegisterId.R11w); set => SetRegisterU16(RegisterId.R11w, value); } - public ushort R12w { get => GetRegisterU16(RegisterId.R12w); set => SetRegisterU16(RegisterId.R12w, value); } - public ushort R13w { get => GetRegisterU16(RegisterId.R13w); set => SetRegisterU16(RegisterId.R13w, value); } - public ushort R14w { get => GetRegisterU16(RegisterId.R14w); set => SetRegisterU16(RegisterId.R14w, value); } - public ushort R15w { get => GetRegisterU16(RegisterId.R15w); set => SetRegisterU16(RegisterId.R15w, value); } + public ushort R8w { get => GetRegisterU16(Registers.Id.R8w); set => SetRegisterU16(Registers.Id.R8w, value); } + public ushort R9w { get => GetRegisterU16(Registers.Id.R9w); set => SetRegisterU16(Registers.Id.R9w, value); } + public ushort R10w { get => GetRegisterU16(Registers.Id.R10w); set => SetRegisterU16(Registers.Id.R10w, value); } + public ushort R11w { get => GetRegisterU16(Registers.Id.R11w); set => SetRegisterU16(Registers.Id.R11w, value); } + public ushort R12w { get => GetRegisterU16(Registers.Id.R12w); set => SetRegisterU16(Registers.Id.R12w, value); } + public ushort R13w { get => GetRegisterU16(Registers.Id.R13w); set => SetRegisterU16(Registers.Id.R13w, value); } + public ushort R14w { get => GetRegisterU16(Registers.Id.R14w); set => SetRegisterU16(Registers.Id.R14w, value); } + public ushort R15w { get => GetRegisterU16(Registers.Id.R15w); set => SetRegisterU16(Registers.Id.R15w, value); } #endif #if _X64_ - public uint Eax { get => GetRegisterU32(RegisterId.Eax); set => SetRegisterU32(RegisterId.Eax, value); } - public uint Ecx { get => GetRegisterU32(RegisterId.Ecx); set => SetRegisterU32(RegisterId.Ecx, value); } - public uint Edx { get => GetRegisterU32(RegisterId.Edx); set => SetRegisterU32(RegisterId.Edx, value); } - public uint Ebx { get => GetRegisterU32(RegisterId.Ebx); set => SetRegisterU32(RegisterId.Ebx, value); } - public uint Esp { get => GetRegisterU32(RegisterId.Esp); set => SetRegisterU32(RegisterId.Esp, value); } - public uint Ebp { get => GetRegisterU32(RegisterId.Ebp); set => SetRegisterU32(RegisterId.Ebp, value); } - public uint Esi { get => GetRegisterU32(RegisterId.Esi); set => SetRegisterU32(RegisterId.Esi, value); } - public uint Edi { get => GetRegisterU32(RegisterId.Edi); set => SetRegisterU32(RegisterId.Edi, value); } + public uint Eax { get => GetRegisterU32(Registers.Id.Eax); set => SetRegisterU32(Registers.Id.Eax, value); } + public uint Ecx { get => GetRegisterU32(Registers.Id.Ecx); set => SetRegisterU32(Registers.Id.Ecx, value); } + public uint Edx { get => GetRegisterU32(Registers.Id.Edx); set => SetRegisterU32(Registers.Id.Edx, value); } + public uint Ebx { get => GetRegisterU32(Registers.Id.Ebx); set => SetRegisterU32(Registers.Id.Ebx, value); } + public uint Esp { get => GetRegisterU32(Registers.Id.Esp); set => SetRegisterU32(Registers.Id.Esp, value); } + public uint Ebp { get => GetRegisterU32(Registers.Id.Ebp); set => SetRegisterU32(Registers.Id.Ebp, value); } + public uint Esi { get => GetRegisterU32(Registers.Id.Esi); set => SetRegisterU32(Registers.Id.Esi, value); } + public uint Edi { get => GetRegisterU32(Registers.Id.Edi); set => SetRegisterU32(Registers.Id.Edi, value); } #else - public nuint Eax { get => (nuint)GetRegisterU32(RegisterId.Eax); set => SetRegisterU32(RegisterId.Eax, value); } - public nuint Ecx { get => (nuint)GetRegisterU32(RegisterId.Ecx); set => SetRegisterU32(RegisterId.Ecx, value); } - public nuint Edx { get => (nuint)GetRegisterU32(RegisterId.Edx); set => SetRegisterU32(RegisterId.Edx, value); } - public nuint Ebx { get => (nuint)GetRegisterU32(RegisterId.Ebx); set => SetRegisterU32(RegisterId.Ebx, value); } - public nuint Esp { get => (nuint)GetRegisterU32(RegisterId.Esp); set => SetRegisterU32(RegisterId.Esp, value); } - public nuint Ebp { get => (nuint)GetRegisterU32(RegisterId.Ebp); set => SetRegisterU32(RegisterId.Ebp, value); } - public nuint Esi { get => (nuint)GetRegisterU32(RegisterId.Esi); set => SetRegisterU32(RegisterId.Esi, value); } - public nuint Edi { get => (nuint)GetRegisterU32(RegisterId.Edi); set => SetRegisterU32(RegisterId.Edi, value); } + public nuint Eax { get => (nuint)GetRegisterU32(Registers.Id.Eax); set => SetRegisterU32(Registers.Id.Eax, value); } + public nuint Ecx { get => (nuint)GetRegisterU32(Registers.Id.Ecx); set => SetRegisterU32(Registers.Id.Ecx, value); } + public nuint Edx { get => (nuint)GetRegisterU32(Registers.Id.Edx); set => SetRegisterU32(Registers.Id.Edx, value); } + public nuint Ebx { get => (nuint)GetRegisterU32(Registers.Id.Ebx); set => SetRegisterU32(Registers.Id.Ebx, value); } + public nuint Esp { get => (nuint)GetRegisterU32(Registers.Id.Esp); set => SetRegisterU32(Registers.Id.Esp, value); } + public nuint Ebp { get => (nuint)GetRegisterU32(Registers.Id.Ebp); set => SetRegisterU32(Registers.Id.Ebp, value); } + public nuint Esi { get => (nuint)GetRegisterU32(Registers.Id.Esi); set => SetRegisterU32(Registers.Id.Esi, value); } + public nuint Edi { get => (nuint)GetRegisterU32(Registers.Id.Edi); set => SetRegisterU32(Registers.Id.Edi, value); } #endif #if _X64_ - public uint R8d { get => GetRegisterU32(RegisterId.R8d); set => SetRegisterU32(RegisterId.R8d, value); } - public uint R9d { get => GetRegisterU32(RegisterId.R9d); set => SetRegisterU32(RegisterId.R9d, value); } - public uint R10d { get => GetRegisterU32(RegisterId.R10d); set => SetRegisterU32(RegisterId.R10d, value); } - public uint R11d { get => GetRegisterU32(RegisterId.R11d); set => SetRegisterU32(RegisterId.R11d, value); } - public uint R12d { get => GetRegisterU32(RegisterId.R12d); set => SetRegisterU32(RegisterId.R12d, value); } - public uint R13d { get => GetRegisterU32(RegisterId.R13d); set => SetRegisterU32(RegisterId.R13d, value); } - public uint R14d { get => GetRegisterU32(RegisterId.R14d); set => SetRegisterU32(RegisterId.R14d, value); } - public uint R15d { get => GetRegisterU32(RegisterId.R15d); set => SetRegisterU32(RegisterId.R15d, value); } - public nuint Rax { get => (nuint)GetRegisterU64(RegisterId.Rax); set => SetRegisterU64(RegisterId.Rax, value); } - public nuint Rcx { get => (nuint)GetRegisterU64(RegisterId.Rcx); set => SetRegisterU64(RegisterId.Rcx, value); } - public nuint Rdx { get => (nuint)GetRegisterU64(RegisterId.Rdx); set => SetRegisterU64(RegisterId.Rdx, value); } - public nuint Rbx { get => (nuint)GetRegisterU64(RegisterId.Rbx); set => SetRegisterU64(RegisterId.Rbx, value); } - public nuint Rsp { get => (nuint)GetRegisterU64(RegisterId.Rsp); set => SetRegisterU64(RegisterId.Rsp, value); } - public nuint Rbp { get => (nuint)GetRegisterU64(RegisterId.Rbp); set => SetRegisterU64(RegisterId.Rbp, value); } - public nuint Rsi { get => (nuint)GetRegisterU64(RegisterId.Rsi); set => SetRegisterU64(RegisterId.Rsi, value); } - public nuint Rdi { get => (nuint)GetRegisterU64(RegisterId.Rdi); set => SetRegisterU64(RegisterId.Rdi, value); } - public nuint R8 { get => (nuint)GetRegisterU64(RegisterId.R8); set => SetRegisterU64(RegisterId.R8, value); } - public nuint R9 { get => (nuint)GetRegisterU64(RegisterId.R9); set => SetRegisterU64(RegisterId.R9, value); } - public nuint R10 { get => (nuint)GetRegisterU64(RegisterId.R10); set => SetRegisterU64(RegisterId.R10, value); } - public nuint R11 { get => (nuint)GetRegisterU64(RegisterId.R11); set => SetRegisterU64(RegisterId.R11, value); } - public nuint R12 { get => (nuint)GetRegisterU64(RegisterId.R12); set => SetRegisterU64(RegisterId.R12, value); } - public nuint R13 { get => (nuint)GetRegisterU64(RegisterId.R13); set => SetRegisterU64(RegisterId.R13, value); } - public nuint R14 { get => (nuint)GetRegisterU64(RegisterId.R14); set => SetRegisterU64(RegisterId.R14, value); } - public nuint R15 { get => (nuint)GetRegisterU64(RegisterId.R15); set => SetRegisterU64(RegisterId.R15, value); } + public uint R8d { get => GetRegisterU32(Registers.Id.R8d); set => SetRegisterU32(Registers.Id.R8d, value); } + public uint R9d { get => GetRegisterU32(Registers.Id.R9d); set => SetRegisterU32(Registers.Id.R9d, value); } + public uint R10d { get => GetRegisterU32(Registers.Id.R10d); set => SetRegisterU32(Registers.Id.R10d, value); } + public uint R11d { get => GetRegisterU32(Registers.Id.R11d); set => SetRegisterU32(Registers.Id.R11d, value); } + public uint R12d { get => GetRegisterU32(Registers.Id.R12d); set => SetRegisterU32(Registers.Id.R12d, value); } + public uint R13d { get => GetRegisterU32(Registers.Id.R13d); set => SetRegisterU32(Registers.Id.R13d, value); } + public uint R14d { get => GetRegisterU32(Registers.Id.R14d); set => SetRegisterU32(Registers.Id.R14d, value); } + public uint R15d { get => GetRegisterU32(Registers.Id.R15d); set => SetRegisterU32(Registers.Id.R15d, value); } + public nuint Rax { get => (nuint)GetRegisterU64(Registers.Id.Rax); set => SetRegisterU64(Registers.Id.Rax, value); } + public nuint Rcx { get => (nuint)GetRegisterU64(Registers.Id.Rcx); set => SetRegisterU64(Registers.Id.Rcx, value); } + public nuint Rdx { get => (nuint)GetRegisterU64(Registers.Id.Rdx); set => SetRegisterU64(Registers.Id.Rdx, value); } + public nuint Rbx { get => (nuint)GetRegisterU64(Registers.Id.Rbx); set => SetRegisterU64(Registers.Id.Rbx, value); } + public nuint Rsp { get => (nuint)GetRegisterU64(Registers.Id.Rsp); set => SetRegisterU64(Registers.Id.Rsp, value); } + public nuint Rbp { get => (nuint)GetRegisterU64(Registers.Id.Rbp); set => SetRegisterU64(Registers.Id.Rbp, value); } + public nuint Rsi { get => (nuint)GetRegisterU64(Registers.Id.Rsi); set => SetRegisterU64(Registers.Id.Rsi, value); } + public nuint Rdi { get => (nuint)GetRegisterU64(Registers.Id.Rdi); set => SetRegisterU64(Registers.Id.Rdi, value); } + public nuint R8 { get => (nuint)GetRegisterU64(Registers.Id.R8); set => SetRegisterU64(Registers.Id.R8, value); } + public nuint R9 { get => (nuint)GetRegisterU64(Registers.Id.R9); set => SetRegisterU64(Registers.Id.R9, value); } + public nuint R10 { get => (nuint)GetRegisterU64(Registers.Id.R10); set => SetRegisterU64(Registers.Id.R10, value); } + public nuint R11 { get => (nuint)GetRegisterU64(Registers.Id.R11); set => SetRegisterU64(Registers.Id.R11, value); } + public nuint R12 { get => (nuint)GetRegisterU64(Registers.Id.R12); set => SetRegisterU64(Registers.Id.R12, value); } + public nuint R13 { get => (nuint)GetRegisterU64(Registers.Id.R13); set => SetRegisterU64(Registers.Id.R13, value); } + public nuint R14 { get => (nuint)GetRegisterU64(Registers.Id.R14); set => SetRegisterU64(Registers.Id.R14, value); } + public nuint R15 { get => (nuint)GetRegisterU64(Registers.Id.R15); set => SetRegisterU64(Registers.Id.R15, value); } #endif - public BigInteger St0 { get => GetRegister(RegisterId.St0); set => SetRegister(RegisterId.St0, value); } - public BigInteger St1 { get => GetRegister(RegisterId.St1); set => SetRegister(RegisterId.St1, value); } - public BigInteger St2 { get => GetRegister(RegisterId.St2); set => SetRegister(RegisterId.St2, value); } - public BigInteger St3 { get => GetRegister(RegisterId.St3); set => SetRegister(RegisterId.St3, value); } - public BigInteger St4 { get => GetRegister(RegisterId.St4); set => SetRegister(RegisterId.St4, value); } - public BigInteger St5 { get => GetRegister(RegisterId.St5); set => SetRegister(RegisterId.St5, value); } - public BigInteger St6 { get => GetRegister(RegisterId.St6); set => SetRegister(RegisterId.St6, value); } - public BigInteger St7 { get => GetRegister(RegisterId.St7); set => SetRegister(RegisterId.St7, value); } - public BigInteger X87Control { get => GetRegister(RegisterId.X87Control); set => SetRegister(RegisterId.X87Control, value); } - public BigInteger X87Status { get => GetRegister(RegisterId.X87Status); set => SetRegister(RegisterId.X87Status, value); } - public BigInteger X87Tag { get => GetRegister(RegisterId.X87Tag); set => SetRegister(RegisterId.X87Tag, value); } - public BigInteger Mm0 { get => GetRegister(RegisterId.Mm0); set => SetRegister(RegisterId.Mm0, value); } - public BigInteger Mm1 { get => GetRegister(RegisterId.Mm1); set => SetRegister(RegisterId.Mm1, value); } - public BigInteger Mm2 { get => GetRegister(RegisterId.Mm2); set => SetRegister(RegisterId.Mm2, value); } - public BigInteger Mm3 { get => GetRegister(RegisterId.Mm3); set => SetRegister(RegisterId.Mm3, value); } - public BigInteger Mm4 { get => GetRegister(RegisterId.Mm4); set => SetRegister(RegisterId.Mm4, value); } - public BigInteger Mm5 { get => GetRegister(RegisterId.Mm5); set => SetRegister(RegisterId.Mm5, value); } - public BigInteger Mm6 { get => GetRegister(RegisterId.Mm6); set => SetRegister(RegisterId.Mm6, value); } - public BigInteger Mm7 { get => GetRegister(RegisterId.Mm7); set => SetRegister(RegisterId.Mm7, value); } - public BigInteger Xmm0 { get => GetRegister(RegisterId.Xmm0); set => SetRegister(RegisterId.Xmm0, value); } - public BigInteger Xmm1 { get => GetRegister(RegisterId.Xmm1); set => SetRegister(RegisterId.Xmm1, value); } - public BigInteger Xmm2 { get => GetRegister(RegisterId.Xmm2); set => SetRegister(RegisterId.Xmm2, value); } - public BigInteger Xmm3 { get => GetRegister(RegisterId.Xmm3); set => SetRegister(RegisterId.Xmm3, value); } - public BigInteger Xmm4 { get => GetRegister(RegisterId.Xmm4); set => SetRegister(RegisterId.Xmm4, value); } - public BigInteger Xmm5 { get => GetRegister(RegisterId.Xmm5); set => SetRegister(RegisterId.Xmm5, value); } - public BigInteger Xmm6 { get => GetRegister(RegisterId.Xmm6); set => SetRegister(RegisterId.Xmm6, value); } - public BigInteger Xmm7 { get => GetRegister(RegisterId.Xmm7); set => SetRegister(RegisterId.Xmm7, value); } - public BigInteger Xmm8 { get => GetRegister(RegisterId.Xmm8); set => SetRegister(RegisterId.Xmm8, value); } - public BigInteger Xmm9 { get => GetRegister(RegisterId.Xmm9); set => SetRegister(RegisterId.Xmm9, value); } - public BigInteger Xmm10 { get => GetRegister(RegisterId.Xmm10); set => SetRegister(RegisterId.Xmm10, value); } - public BigInteger Xmm11 { get => GetRegister(RegisterId.Xmm11); set => SetRegister(RegisterId.Xmm11, value); } - public BigInteger Xmm12 { get => GetRegister(RegisterId.Xmm12); set => SetRegister(RegisterId.Xmm12, value); } - public BigInteger Xmm13 { get => GetRegister(RegisterId.Xmm13); set => SetRegister(RegisterId.Xmm13, value); } - public BigInteger Xmm14 { get => GetRegister(RegisterId.Xmm14); set => SetRegister(RegisterId.Xmm14, value); } - public BigInteger Xmm15 { get => GetRegister(RegisterId.Xmm15); set => SetRegister(RegisterId.Xmm15, value); } - public BigInteger Xmm16 { get => GetRegister(RegisterId.Xmm16); set => SetRegister(RegisterId.Xmm16, value); } - public BigInteger Xmm17 { get => GetRegister(RegisterId.Xmm17); set => SetRegister(RegisterId.Xmm17, value); } - public BigInteger Xmm18 { get => GetRegister(RegisterId.Xmm18); set => SetRegister(RegisterId.Xmm18, value); } - public BigInteger Xmm19 { get => GetRegister(RegisterId.Xmm19); set => SetRegister(RegisterId.Xmm19, value); } - public BigInteger Xmm20 { get => GetRegister(RegisterId.Xmm20); set => SetRegister(RegisterId.Xmm20, value); } - public BigInteger Xmm21 { get => GetRegister(RegisterId.Xmm21); set => SetRegister(RegisterId.Xmm21, value); } - public BigInteger Xmm22 { get => GetRegister(RegisterId.Xmm22); set => SetRegister(RegisterId.Xmm22, value); } - public BigInteger Xmm23 { get => GetRegister(RegisterId.Xmm23); set => SetRegister(RegisterId.Xmm23, value); } - public BigInteger Xmm24 { get => GetRegister(RegisterId.Xmm24); set => SetRegister(RegisterId.Xmm24, value); } - public BigInteger Xmm25 { get => GetRegister(RegisterId.Xmm25); set => SetRegister(RegisterId.Xmm25, value); } - public BigInteger Xmm26 { get => GetRegister(RegisterId.Xmm26); set => SetRegister(RegisterId.Xmm26, value); } - public BigInteger Xmm27 { get => GetRegister(RegisterId.Xmm27); set => SetRegister(RegisterId.Xmm27, value); } - public BigInteger Xmm28 { get => GetRegister(RegisterId.Xmm28); set => SetRegister(RegisterId.Xmm28, value); } - public BigInteger Xmm29 { get => GetRegister(RegisterId.Xmm29); set => SetRegister(RegisterId.Xmm29, value); } - public BigInteger Xmm30 { get => GetRegister(RegisterId.Xmm30); set => SetRegister(RegisterId.Xmm30, value); } - public BigInteger Xmm31 { get => GetRegister(RegisterId.Xmm31); set => SetRegister(RegisterId.Xmm31, value); } - public BigInteger Ymm0 { get => GetRegister(RegisterId.Ymm0); set => SetRegister(RegisterId.Ymm0, value); } - public BigInteger Ymm1 { get => GetRegister(RegisterId.Ymm1); set => SetRegister(RegisterId.Ymm1, value); } - public BigInteger Ymm2 { get => GetRegister(RegisterId.Ymm2); set => SetRegister(RegisterId.Ymm2, value); } - public BigInteger Ymm3 { get => GetRegister(RegisterId.Ymm3); set => SetRegister(RegisterId.Ymm3, value); } - public BigInteger Ymm4 { get => GetRegister(RegisterId.Ymm4); set => SetRegister(RegisterId.Ymm4, value); } - public BigInteger Ymm5 { get => GetRegister(RegisterId.Ymm5); set => SetRegister(RegisterId.Ymm5, value); } - public BigInteger Ymm6 { get => GetRegister(RegisterId.Ymm6); set => SetRegister(RegisterId.Ymm6, value); } - public BigInteger Ymm7 { get => GetRegister(RegisterId.Ymm7); set => SetRegister(RegisterId.Ymm7, value); } - public BigInteger Ymm8 { get => GetRegister(RegisterId.Ymm8); set => SetRegister(RegisterId.Ymm8, value); } - public BigInteger Ymm9 { get => GetRegister(RegisterId.Ymm9); set => SetRegister(RegisterId.Ymm9, value); } - public BigInteger Ymm10 { get => GetRegister(RegisterId.Ymm10); set => SetRegister(RegisterId.Ymm10, value); } - public BigInteger Ymm11 { get => GetRegister(RegisterId.Ymm11); set => SetRegister(RegisterId.Ymm11, value); } - public BigInteger Ymm12 { get => GetRegister(RegisterId.Ymm12); set => SetRegister(RegisterId.Ymm12, value); } - public BigInteger Ymm13 { get => GetRegister(RegisterId.Ymm13); set => SetRegister(RegisterId.Ymm13, value); } - public BigInteger Ymm14 { get => GetRegister(RegisterId.Ymm14); set => SetRegister(RegisterId.Ymm14, value); } - public BigInteger Ymm15 { get => GetRegister(RegisterId.Ymm15); set => SetRegister(RegisterId.Ymm15, value); } - public BigInteger Ymm16 { get => GetRegister(RegisterId.Ymm16); set => SetRegister(RegisterId.Ymm16, value); } - public BigInteger Ymm17 { get => GetRegister(RegisterId.Ymm17); set => SetRegister(RegisterId.Ymm17, value); } - public BigInteger Ymm18 { get => GetRegister(RegisterId.Ymm18); set => SetRegister(RegisterId.Ymm18, value); } - public BigInteger Ymm19 { get => GetRegister(RegisterId.Ymm19); set => SetRegister(RegisterId.Ymm19, value); } - public BigInteger Ymm20 { get => GetRegister(RegisterId.Ymm20); set => SetRegister(RegisterId.Ymm20, value); } - public BigInteger Ymm21 { get => GetRegister(RegisterId.Ymm21); set => SetRegister(RegisterId.Ymm21, value); } - public BigInteger Ymm22 { get => GetRegister(RegisterId.Ymm22); set => SetRegister(RegisterId.Ymm22, value); } - public BigInteger Ymm23 { get => GetRegister(RegisterId.Ymm23); set => SetRegister(RegisterId.Ymm23, value); } - public BigInteger Ymm24 { get => GetRegister(RegisterId.Ymm24); set => SetRegister(RegisterId.Ymm24, value); } - public BigInteger Ymm25 { get => GetRegister(RegisterId.Ymm25); set => SetRegister(RegisterId.Ymm25, value); } - public BigInteger Ymm26 { get => GetRegister(RegisterId.Ymm26); set => SetRegister(RegisterId.Ymm26, value); } - public BigInteger Ymm27 { get => GetRegister(RegisterId.Ymm27); set => SetRegister(RegisterId.Ymm27, value); } - public BigInteger Ymm28 { get => GetRegister(RegisterId.Ymm28); set => SetRegister(RegisterId.Ymm28, value); } - public BigInteger Ymm29 { get => GetRegister(RegisterId.Ymm29); set => SetRegister(RegisterId.Ymm29, value); } - public BigInteger Ymm30 { get => GetRegister(RegisterId.Ymm30); set => SetRegister(RegisterId.Ymm30, value); } - public BigInteger Ymm31 { get => GetRegister(RegisterId.Ymm31); set => SetRegister(RegisterId.Ymm31, value); } - public BigInteger Zmm0 { get => GetRegister(RegisterId.Zmm0); set => SetRegister(RegisterId.Zmm0, value); } - public BigInteger Zmm1 { get => GetRegister(RegisterId.Zmm1); set => SetRegister(RegisterId.Zmm1, value); } - public BigInteger Zmm2 { get => GetRegister(RegisterId.Zmm2); set => SetRegister(RegisterId.Zmm2, value); } - public BigInteger Zmm3 { get => GetRegister(RegisterId.Zmm3); set => SetRegister(RegisterId.Zmm3, value); } - public BigInteger Zmm4 { get => GetRegister(RegisterId.Zmm4); set => SetRegister(RegisterId.Zmm4, value); } - public BigInteger Zmm5 { get => GetRegister(RegisterId.Zmm5); set => SetRegister(RegisterId.Zmm5, value); } - public BigInteger Zmm6 { get => GetRegister(RegisterId.Zmm6); set => SetRegister(RegisterId.Zmm6, value); } - public BigInteger Zmm7 { get => GetRegister(RegisterId.Zmm7); set => SetRegister(RegisterId.Zmm7, value); } - public BigInteger Zmm8 { get => GetRegister(RegisterId.Zmm8); set => SetRegister(RegisterId.Zmm8, value); } - public BigInteger Zmm9 { get => GetRegister(RegisterId.Zmm9); set => SetRegister(RegisterId.Zmm9, value); } - public BigInteger Zmm10 { get => GetRegister(RegisterId.Zmm10); set => SetRegister(RegisterId.Zmm10, value); } - public BigInteger Zmm11 { get => GetRegister(RegisterId.Zmm11); set => SetRegister(RegisterId.Zmm11, value); } - public BigInteger Zmm12 { get => GetRegister(RegisterId.Zmm12); set => SetRegister(RegisterId.Zmm12, value); } - public BigInteger Zmm13 { get => GetRegister(RegisterId.Zmm13); set => SetRegister(RegisterId.Zmm13, value); } - public BigInteger Zmm14 { get => GetRegister(RegisterId.Zmm14); set => SetRegister(RegisterId.Zmm14, value); } - public BigInteger Zmm15 { get => GetRegister(RegisterId.Zmm15); set => SetRegister(RegisterId.Zmm15, value); } - public BigInteger Zmm16 { get => GetRegister(RegisterId.Zmm16); set => SetRegister(RegisterId.Zmm16, value); } - public BigInteger Zmm17 { get => GetRegister(RegisterId.Zmm17); set => SetRegister(RegisterId.Zmm17, value); } - public BigInteger Zmm18 { get => GetRegister(RegisterId.Zmm18); set => SetRegister(RegisterId.Zmm18, value); } - public BigInteger Zmm19 { get => GetRegister(RegisterId.Zmm19); set => SetRegister(RegisterId.Zmm19, value); } - public BigInteger Zmm20 { get => GetRegister(RegisterId.Zmm20); set => SetRegister(RegisterId.Zmm20, value); } - public BigInteger Zmm21 { get => GetRegister(RegisterId.Zmm21); set => SetRegister(RegisterId.Zmm21, value); } - public BigInteger Zmm22 { get => GetRegister(RegisterId.Zmm22); set => SetRegister(RegisterId.Zmm22, value); } - public BigInteger Zmm23 { get => GetRegister(RegisterId.Zmm23); set => SetRegister(RegisterId.Zmm23, value); } - public BigInteger Zmm24 { get => GetRegister(RegisterId.Zmm24); set => SetRegister(RegisterId.Zmm24, value); } - public BigInteger Zmm25 { get => GetRegister(RegisterId.Zmm25); set => SetRegister(RegisterId.Zmm25, value); } - public BigInteger Zmm26 { get => GetRegister(RegisterId.Zmm26); set => SetRegister(RegisterId.Zmm26, value); } - public BigInteger Zmm27 { get => GetRegister(RegisterId.Zmm27); set => SetRegister(RegisterId.Zmm27, value); } - public BigInteger Zmm28 { get => GetRegister(RegisterId.Zmm28); set => SetRegister(RegisterId.Zmm28, value); } - public BigInteger Zmm29 { get => GetRegister(RegisterId.Zmm29); set => SetRegister(RegisterId.Zmm29, value); } - public BigInteger Zmm30 { get => GetRegister(RegisterId.Zmm30); set => SetRegister(RegisterId.Zmm30, value); } - public BigInteger Zmm31 { get => GetRegister(RegisterId.Zmm31); set => SetRegister(RegisterId.Zmm31, value); } - public BigInteger Flags { get => GetRegister(RegisterId.Flags); set => SetRegister(RegisterId.Flags, value); } + public BigInteger St0 { get => GetRegister(Registers.Id.St0); set => SetRegister(Registers.Id.St0, value); } + public BigInteger St1 { get => GetRegister(Registers.Id.St1); set => SetRegister(Registers.Id.St1, value); } + public BigInteger St2 { get => GetRegister(Registers.Id.St2); set => SetRegister(Registers.Id.St2, value); } + public BigInteger St3 { get => GetRegister(Registers.Id.St3); set => SetRegister(Registers.Id.St3, value); } + public BigInteger St4 { get => GetRegister(Registers.Id.St4); set => SetRegister(Registers.Id.St4, value); } + public BigInteger St5 { get => GetRegister(Registers.Id.St5); set => SetRegister(Registers.Id.St5, value); } + public BigInteger St6 { get => GetRegister(Registers.Id.St6); set => SetRegister(Registers.Id.St6, value); } + public BigInteger St7 { get => GetRegister(Registers.Id.St7); set => SetRegister(Registers.Id.St7, value); } + public BigInteger X87Control { get => GetRegister(Registers.Id.X87Control); set => SetRegister(Registers.Id.X87Control, value); } + public BigInteger X87Status { get => GetRegister(Registers.Id.X87Status); set => SetRegister(Registers.Id.X87Status, value); } + public BigInteger X87Tag { get => GetRegister(Registers.Id.X87Tag); set => SetRegister(Registers.Id.X87Tag, value); } + public BigInteger Mm0 { get => GetRegister(Registers.Id.Mm0); set => SetRegister(Registers.Id.Mm0, value); } + public BigInteger Mm1 { get => GetRegister(Registers.Id.Mm1); set => SetRegister(Registers.Id.Mm1, value); } + public BigInteger Mm2 { get => GetRegister(Registers.Id.Mm2); set => SetRegister(Registers.Id.Mm2, value); } + public BigInteger Mm3 { get => GetRegister(Registers.Id.Mm3); set => SetRegister(Registers.Id.Mm3, value); } + public BigInteger Mm4 { get => GetRegister(Registers.Id.Mm4); set => SetRegister(Registers.Id.Mm4, value); } + public BigInteger Mm5 { get => GetRegister(Registers.Id.Mm5); set => SetRegister(Registers.Id.Mm5, value); } + public BigInteger Mm6 { get => GetRegister(Registers.Id.Mm6); set => SetRegister(Registers.Id.Mm6, value); } + public BigInteger Mm7 { get => GetRegister(Registers.Id.Mm7); set => SetRegister(Registers.Id.Mm7, value); } + public BigInteger Xmm0 { get => GetRegister(Registers.Id.Xmm0); set => SetRegister(Registers.Id.Xmm0, value); } + public BigInteger Xmm1 { get => GetRegister(Registers.Id.Xmm1); set => SetRegister(Registers.Id.Xmm1, value); } + public BigInteger Xmm2 { get => GetRegister(Registers.Id.Xmm2); set => SetRegister(Registers.Id.Xmm2, value); } + public BigInteger Xmm3 { get => GetRegister(Registers.Id.Xmm3); set => SetRegister(Registers.Id.Xmm3, value); } + public BigInteger Xmm4 { get => GetRegister(Registers.Id.Xmm4); set => SetRegister(Registers.Id.Xmm4, value); } + public BigInteger Xmm5 { get => GetRegister(Registers.Id.Xmm5); set => SetRegister(Registers.Id.Xmm5, value); } + public BigInteger Xmm6 { get => GetRegister(Registers.Id.Xmm6); set => SetRegister(Registers.Id.Xmm6, value); } + public BigInteger Xmm7 { get => GetRegister(Registers.Id.Xmm7); set => SetRegister(Registers.Id.Xmm7, value); } + public BigInteger Xmm8 { get => GetRegister(Registers.Id.Xmm8); set => SetRegister(Registers.Id.Xmm8, value); } + public BigInteger Xmm9 { get => GetRegister(Registers.Id.Xmm9); set => SetRegister(Registers.Id.Xmm9, value); } + public BigInteger Xmm10 { get => GetRegister(Registers.Id.Xmm10); set => SetRegister(Registers.Id.Xmm10, value); } + public BigInteger Xmm11 { get => GetRegister(Registers.Id.Xmm11); set => SetRegister(Registers.Id.Xmm11, value); } + public BigInteger Xmm12 { get => GetRegister(Registers.Id.Xmm12); set => SetRegister(Registers.Id.Xmm12, value); } + public BigInteger Xmm13 { get => GetRegister(Registers.Id.Xmm13); set => SetRegister(Registers.Id.Xmm13, value); } + public BigInteger Xmm14 { get => GetRegister(Registers.Id.Xmm14); set => SetRegister(Registers.Id.Xmm14, value); } + public BigInteger Xmm15 { get => GetRegister(Registers.Id.Xmm15); set => SetRegister(Registers.Id.Xmm15, value); } + public BigInteger Xmm16 { get => GetRegister(Registers.Id.Xmm16); set => SetRegister(Registers.Id.Xmm16, value); } + public BigInteger Xmm17 { get => GetRegister(Registers.Id.Xmm17); set => SetRegister(Registers.Id.Xmm17, value); } + public BigInteger Xmm18 { get => GetRegister(Registers.Id.Xmm18); set => SetRegister(Registers.Id.Xmm18, value); } + public BigInteger Xmm19 { get => GetRegister(Registers.Id.Xmm19); set => SetRegister(Registers.Id.Xmm19, value); } + public BigInteger Xmm20 { get => GetRegister(Registers.Id.Xmm20); set => SetRegister(Registers.Id.Xmm20, value); } + public BigInteger Xmm21 { get => GetRegister(Registers.Id.Xmm21); set => SetRegister(Registers.Id.Xmm21, value); } + public BigInteger Xmm22 { get => GetRegister(Registers.Id.Xmm22); set => SetRegister(Registers.Id.Xmm22, value); } + public BigInteger Xmm23 { get => GetRegister(Registers.Id.Xmm23); set => SetRegister(Registers.Id.Xmm23, value); } + public BigInteger Xmm24 { get => GetRegister(Registers.Id.Xmm24); set => SetRegister(Registers.Id.Xmm24, value); } + public BigInteger Xmm25 { get => GetRegister(Registers.Id.Xmm25); set => SetRegister(Registers.Id.Xmm25, value); } + public BigInteger Xmm26 { get => GetRegister(Registers.Id.Xmm26); set => SetRegister(Registers.Id.Xmm26, value); } + public BigInteger Xmm27 { get => GetRegister(Registers.Id.Xmm27); set => SetRegister(Registers.Id.Xmm27, value); } + public BigInteger Xmm28 { get => GetRegister(Registers.Id.Xmm28); set => SetRegister(Registers.Id.Xmm28, value); } + public BigInteger Xmm29 { get => GetRegister(Registers.Id.Xmm29); set => SetRegister(Registers.Id.Xmm29, value); } + public BigInteger Xmm30 { get => GetRegister(Registers.Id.Xmm30); set => SetRegister(Registers.Id.Xmm30, value); } + public BigInteger Xmm31 { get => GetRegister(Registers.Id.Xmm31); set => SetRegister(Registers.Id.Xmm31, value); } + public BigInteger Ymm0 { get => GetRegister(Registers.Id.Ymm0); set => SetRegister(Registers.Id.Ymm0, value); } + public BigInteger Ymm1 { get => GetRegister(Registers.Id.Ymm1); set => SetRegister(Registers.Id.Ymm1, value); } + public BigInteger Ymm2 { get => GetRegister(Registers.Id.Ymm2); set => SetRegister(Registers.Id.Ymm2, value); } + public BigInteger Ymm3 { get => GetRegister(Registers.Id.Ymm3); set => SetRegister(Registers.Id.Ymm3, value); } + public BigInteger Ymm4 { get => GetRegister(Registers.Id.Ymm4); set => SetRegister(Registers.Id.Ymm4, value); } + public BigInteger Ymm5 { get => GetRegister(Registers.Id.Ymm5); set => SetRegister(Registers.Id.Ymm5, value); } + public BigInteger Ymm6 { get => GetRegister(Registers.Id.Ymm6); set => SetRegister(Registers.Id.Ymm6, value); } + public BigInteger Ymm7 { get => GetRegister(Registers.Id.Ymm7); set => SetRegister(Registers.Id.Ymm7, value); } + public BigInteger Ymm8 { get => GetRegister(Registers.Id.Ymm8); set => SetRegister(Registers.Id.Ymm8, value); } + public BigInteger Ymm9 { get => GetRegister(Registers.Id.Ymm9); set => SetRegister(Registers.Id.Ymm9, value); } + public BigInteger Ymm10 { get => GetRegister(Registers.Id.Ymm10); set => SetRegister(Registers.Id.Ymm10, value); } + public BigInteger Ymm11 { get => GetRegister(Registers.Id.Ymm11); set => SetRegister(Registers.Id.Ymm11, value); } + public BigInteger Ymm12 { get => GetRegister(Registers.Id.Ymm12); set => SetRegister(Registers.Id.Ymm12, value); } + public BigInteger Ymm13 { get => GetRegister(Registers.Id.Ymm13); set => SetRegister(Registers.Id.Ymm13, value); } + public BigInteger Ymm14 { get => GetRegister(Registers.Id.Ymm14); set => SetRegister(Registers.Id.Ymm14, value); } + public BigInteger Ymm15 { get => GetRegister(Registers.Id.Ymm15); set => SetRegister(Registers.Id.Ymm15, value); } + public BigInteger Ymm16 { get => GetRegister(Registers.Id.Ymm16); set => SetRegister(Registers.Id.Ymm16, value); } + public BigInteger Ymm17 { get => GetRegister(Registers.Id.Ymm17); set => SetRegister(Registers.Id.Ymm17, value); } + public BigInteger Ymm18 { get => GetRegister(Registers.Id.Ymm18); set => SetRegister(Registers.Id.Ymm18, value); } + public BigInteger Ymm19 { get => GetRegister(Registers.Id.Ymm19); set => SetRegister(Registers.Id.Ymm19, value); } + public BigInteger Ymm20 { get => GetRegister(Registers.Id.Ymm20); set => SetRegister(Registers.Id.Ymm20, value); } + public BigInteger Ymm21 { get => GetRegister(Registers.Id.Ymm21); set => SetRegister(Registers.Id.Ymm21, value); } + public BigInteger Ymm22 { get => GetRegister(Registers.Id.Ymm22); set => SetRegister(Registers.Id.Ymm22, value); } + public BigInteger Ymm23 { get => GetRegister(Registers.Id.Ymm23); set => SetRegister(Registers.Id.Ymm23, value); } + public BigInteger Ymm24 { get => GetRegister(Registers.Id.Ymm24); set => SetRegister(Registers.Id.Ymm24, value); } + public BigInteger Ymm25 { get => GetRegister(Registers.Id.Ymm25); set => SetRegister(Registers.Id.Ymm25, value); } + public BigInteger Ymm26 { get => GetRegister(Registers.Id.Ymm26); set => SetRegister(Registers.Id.Ymm26, value); } + public BigInteger Ymm27 { get => GetRegister(Registers.Id.Ymm27); set => SetRegister(Registers.Id.Ymm27, value); } + public BigInteger Ymm28 { get => GetRegister(Registers.Id.Ymm28); set => SetRegister(Registers.Id.Ymm28, value); } + public BigInteger Ymm29 { get => GetRegister(Registers.Id.Ymm29); set => SetRegister(Registers.Id.Ymm29, value); } + public BigInteger Ymm30 { get => GetRegister(Registers.Id.Ymm30); set => SetRegister(Registers.Id.Ymm30, value); } + public BigInteger Ymm31 { get => GetRegister(Registers.Id.Ymm31); set => SetRegister(Registers.Id.Ymm31, value); } + public BigInteger Zmm0 { get => GetRegister(Registers.Id.Zmm0); set => SetRegister(Registers.Id.Zmm0, value); } + public BigInteger Zmm1 { get => GetRegister(Registers.Id.Zmm1); set => SetRegister(Registers.Id.Zmm1, value); } + public BigInteger Zmm2 { get => GetRegister(Registers.Id.Zmm2); set => SetRegister(Registers.Id.Zmm2, value); } + public BigInteger Zmm3 { get => GetRegister(Registers.Id.Zmm3); set => SetRegister(Registers.Id.Zmm3, value); } + public BigInteger Zmm4 { get => GetRegister(Registers.Id.Zmm4); set => SetRegister(Registers.Id.Zmm4, value); } + public BigInteger Zmm5 { get => GetRegister(Registers.Id.Zmm5); set => SetRegister(Registers.Id.Zmm5, value); } + public BigInteger Zmm6 { get => GetRegister(Registers.Id.Zmm6); set => SetRegister(Registers.Id.Zmm6, value); } + public BigInteger Zmm7 { get => GetRegister(Registers.Id.Zmm7); set => SetRegister(Registers.Id.Zmm7, value); } + public BigInteger Zmm8 { get => GetRegister(Registers.Id.Zmm8); set => SetRegister(Registers.Id.Zmm8, value); } + public BigInteger Zmm9 { get => GetRegister(Registers.Id.Zmm9); set => SetRegister(Registers.Id.Zmm9, value); } + public BigInteger Zmm10 { get => GetRegister(Registers.Id.Zmm10); set => SetRegister(Registers.Id.Zmm10, value); } + public BigInteger Zmm11 { get => GetRegister(Registers.Id.Zmm11); set => SetRegister(Registers.Id.Zmm11, value); } + public BigInteger Zmm12 { get => GetRegister(Registers.Id.Zmm12); set => SetRegister(Registers.Id.Zmm12, value); } + public BigInteger Zmm13 { get => GetRegister(Registers.Id.Zmm13); set => SetRegister(Registers.Id.Zmm13, value); } + public BigInteger Zmm14 { get => GetRegister(Registers.Id.Zmm14); set => SetRegister(Registers.Id.Zmm14, value); } + public BigInteger Zmm15 { get => GetRegister(Registers.Id.Zmm15); set => SetRegister(Registers.Id.Zmm15, value); } + public BigInteger Zmm16 { get => GetRegister(Registers.Id.Zmm16); set => SetRegister(Registers.Id.Zmm16, value); } + public BigInteger Zmm17 { get => GetRegister(Registers.Id.Zmm17); set => SetRegister(Registers.Id.Zmm17, value); } + public BigInteger Zmm18 { get => GetRegister(Registers.Id.Zmm18); set => SetRegister(Registers.Id.Zmm18, value); } + public BigInteger Zmm19 { get => GetRegister(Registers.Id.Zmm19); set => SetRegister(Registers.Id.Zmm19, value); } + public BigInteger Zmm20 { get => GetRegister(Registers.Id.Zmm20); set => SetRegister(Registers.Id.Zmm20, value); } + public BigInteger Zmm21 { get => GetRegister(Registers.Id.Zmm21); set => SetRegister(Registers.Id.Zmm21, value); } + public BigInteger Zmm22 { get => GetRegister(Registers.Id.Zmm22); set => SetRegister(Registers.Id.Zmm22, value); } + public BigInteger Zmm23 { get => GetRegister(Registers.Id.Zmm23); set => SetRegister(Registers.Id.Zmm23, value); } + public BigInteger Zmm24 { get => GetRegister(Registers.Id.Zmm24); set => SetRegister(Registers.Id.Zmm24, value); } + public BigInteger Zmm25 { get => GetRegister(Registers.Id.Zmm25); set => SetRegister(Registers.Id.Zmm25, value); } + public BigInteger Zmm26 { get => GetRegister(Registers.Id.Zmm26); set => SetRegister(Registers.Id.Zmm26, value); } + public BigInteger Zmm27 { get => GetRegister(Registers.Id.Zmm27); set => SetRegister(Registers.Id.Zmm27, value); } + public BigInteger Zmm28 { get => GetRegister(Registers.Id.Zmm28); set => SetRegister(Registers.Id.Zmm28, value); } + public BigInteger Zmm29 { get => GetRegister(Registers.Id.Zmm29); set => SetRegister(Registers.Id.Zmm29, value); } + public BigInteger Zmm30 { get => GetRegister(Registers.Id.Zmm30); set => SetRegister(Registers.Id.Zmm30, value); } + public BigInteger Zmm31 { get => GetRegister(Registers.Id.Zmm31); set => SetRegister(Registers.Id.Zmm31, value); } + public BigInteger Flags { get => GetRegister(Registers.Id.Flags); set => SetRegister(Registers.Id.Flags, value); } #if _X64_ - public uint EFlags { get => GetRegisterU32(RegisterId.EFlags); set => SetRegisterU32(RegisterId.EFlags, value); } - public nuint RFlags { get => (nuint)GetRegisterU64(RegisterId.RFlags); set => SetRegisterU64(RegisterId.RFlags, value); } + public uint EFlags { get => GetRegisterU32(Registers.Id.EFlags); set => SetRegisterU32(Registers.Id.EFlags, value); } + public nuint RFlags { get => (nuint)GetRegisterU64(Registers.Id.RFlags); set => SetRegisterU64(Registers.Id.RFlags, value); } #else - public nuint EFlags { get => (nuint)GetRegisterU32(RegisterId.EFlags); set => SetRegisterU32(RegisterId.EFlags, value); } + public nuint EFlags { get => (nuint)GetRegisterU32(Registers.Id.EFlags); set => SetRegisterU32(Registers.Id.EFlags, value); } #endif - public ushort Ip { get => GetRegisterU16(RegisterId.Ip); set => SetRegisterU16(RegisterId.Ip, value); } + public ushort Ip { get => GetRegisterU16(Registers.Id.Ip); set => SetRegisterU16(Registers.Id.Ip, value); } #if _X64_ - public uint Eip { get => GetRegisterU32(RegisterId.Eip); set => SetRegisterU32(RegisterId.Eip, value); } - public nuint Rip { get => (nuint)GetRegisterU64(RegisterId.Rip); set => SetRegisterU64(RegisterId.Rip, value); } + public uint Eip { get => GetRegisterU32(Registers.Id.Eip); set => SetRegisterU32(Registers.Id.Eip, value); } + public nuint Rip { get => (nuint)GetRegisterU64(Registers.Id.Rip); set => SetRegisterU64(Registers.Id.Rip, value); } #else - public nuint Eip { get => (nuint)GetRegisterU32(RegisterId.Eip); set => SetRegisterU32(RegisterId.Eip, value); } + public nuint Eip { get => (nuint)GetRegisterU32(Registers.Id.Eip); set => SetRegisterU32(Registers.Id.Eip, value); } #endif - public ushort Es { get => GetRegisterU16(RegisterId.Es); set => SetRegisterU16(RegisterId.Es, value); } - public ushort Cs { get => GetRegisterU16(RegisterId.Cs); set => SetRegisterU16(RegisterId.Cs, value); } - public ushort Ss { get => GetRegisterU16(RegisterId.Ss); set => SetRegisterU16(RegisterId.Ss, value); } - public ushort Ds { get => GetRegisterU16(RegisterId.Ds); set => SetRegisterU16(RegisterId.Ds, value); } - public ushort Fs { get => GetRegisterU16(RegisterId.Fs); set => SetRegisterU16(RegisterId.Fs, value); } - public ushort Gs { get => GetRegisterU16(RegisterId.Gs); set => SetRegisterU16(RegisterId.Gs, value); } - public BigInteger Gdtr { get => GetRegister(RegisterId.Gdtr); set => SetRegister(RegisterId.Gdtr, value); } - public BigInteger Ldtr { get => GetRegister(RegisterId.Ldtr); set => SetRegister(RegisterId.Ldtr, value); } - public BigInteger Idtr { get => GetRegister(RegisterId.Idtr); set => SetRegister(RegisterId.Idtr, value); } - public BigInteger Tr { get => GetRegister(RegisterId.Tr); set => SetRegister(RegisterId.Tr, value); } - public BigInteger Tr0 { get => GetRegister(RegisterId.Tr0); set => SetRegister(RegisterId.Tr0, value); } - public BigInteger Tr1 { get => GetRegister(RegisterId.Tr1); set => SetRegister(RegisterId.Tr1, value); } - public BigInteger Tr2 { get => GetRegister(RegisterId.Tr2); set => SetRegister(RegisterId.Tr2, value); } - public BigInteger Tr3 { get => GetRegister(RegisterId.Tr3); set => SetRegister(RegisterId.Tr3, value); } - public BigInteger Tr4 { get => GetRegister(RegisterId.Tr4); set => SetRegister(RegisterId.Tr4, value); } - public BigInteger Tr5 { get => GetRegister(RegisterId.Tr5); set => SetRegister(RegisterId.Tr5, value); } - public BigInteger Tr6 { get => GetRegister(RegisterId.Tr6); set => SetRegister(RegisterId.Tr6, value); } - public BigInteger Tr7 { get => GetRegister(RegisterId.Tr7); set => SetRegister(RegisterId.Tr7, value); } - public BigInteger Cr0 { get => GetRegister(RegisterId.Cr0); set => SetRegister(RegisterId.Cr0, value); } - public BigInteger Cr1 { get => GetRegister(RegisterId.Cr1); set => SetRegister(RegisterId.Cr1, value); } - public BigInteger Cr2 { get => GetRegister(RegisterId.Cr2); set => SetRegister(RegisterId.Cr2, value); } - public BigInteger Cr3 { get => GetRegister(RegisterId.Cr3); set => SetRegister(RegisterId.Cr3, value); } - public BigInteger Cr4 { get => GetRegister(RegisterId.Cr4); set => SetRegister(RegisterId.Cr4, value); } - public BigInteger Cr5 { get => GetRegister(RegisterId.Cr5); set => SetRegister(RegisterId.Cr5, value); } - public BigInteger Cr6 { get => GetRegister(RegisterId.Cr6); set => SetRegister(RegisterId.Cr6, value); } - public BigInteger Cr7 { get => GetRegister(RegisterId.Cr7); set => SetRegister(RegisterId.Cr7, value); } - public BigInteger Cr8 { get => GetRegister(RegisterId.Cr8); set => SetRegister(RegisterId.Cr8, value); } - public BigInteger Cr9 { get => GetRegister(RegisterId.Cr9); set => SetRegister(RegisterId.Cr9, value); } - public BigInteger Cr10 { get => GetRegister(RegisterId.Cr10); set => SetRegister(RegisterId.Cr10, value); } - public BigInteger Cr11 { get => GetRegister(RegisterId.Cr11); set => SetRegister(RegisterId.Cr11, value); } - public BigInteger Cr12 { get => GetRegister(RegisterId.Cr12); set => SetRegister(RegisterId.Cr12, value); } - public BigInteger Cr13 { get => GetRegister(RegisterId.Cr13); set => SetRegister(RegisterId.Cr13, value); } - public BigInteger Cr14 { get => GetRegister(RegisterId.Cr14); set => SetRegister(RegisterId.Cr14, value); } - public BigInteger Cr15 { get => GetRegister(RegisterId.Cr15); set => SetRegister(RegisterId.Cr15, value); } + public ushort Es { get => GetRegisterU16(Registers.Id.Es); set => SetRegisterU16(Registers.Id.Es, value); } + public ushort Cs { get => GetRegisterU16(Registers.Id.Cs); set => SetRegisterU16(Registers.Id.Cs, value); } + public ushort Ss { get => GetRegisterU16(Registers.Id.Ss); set => SetRegisterU16(Registers.Id.Ss, value); } + public ushort Ds { get => GetRegisterU16(Registers.Id.Ds); set => SetRegisterU16(Registers.Id.Ds, value); } + public ushort Fs { get => GetRegisterU16(Registers.Id.Fs); set => SetRegisterU16(Registers.Id.Fs, value); } + public ushort Gs { get => GetRegisterU16(Registers.Id.Gs); set => SetRegisterU16(Registers.Id.Gs, value); } + public BigInteger Gdtr { get => GetRegister(Registers.Id.Gdtr); set => SetRegister(Registers.Id.Gdtr, value); } + public BigInteger Ldtr { get => GetRegister(Registers.Id.Ldtr); set => SetRegister(Registers.Id.Ldtr, value); } + public BigInteger Idtr { get => GetRegister(Registers.Id.Idtr); set => SetRegister(Registers.Id.Idtr, value); } + public BigInteger Tr { get => GetRegister(Registers.Id.Tr); set => SetRegister(Registers.Id.Tr, value); } + public BigInteger Tr0 { get => GetRegister(Registers.Id.Tr0); set => SetRegister(Registers.Id.Tr0, value); } + public BigInteger Tr1 { get => GetRegister(Registers.Id.Tr1); set => SetRegister(Registers.Id.Tr1, value); } + public BigInteger Tr2 { get => GetRegister(Registers.Id.Tr2); set => SetRegister(Registers.Id.Tr2, value); } + public BigInteger Tr3 { get => GetRegister(Registers.Id.Tr3); set => SetRegister(Registers.Id.Tr3, value); } + public BigInteger Tr4 { get => GetRegister(Registers.Id.Tr4); set => SetRegister(Registers.Id.Tr4, value); } + public BigInteger Tr5 { get => GetRegister(Registers.Id.Tr5); set => SetRegister(Registers.Id.Tr5, value); } + public BigInteger Tr6 { get => GetRegister(Registers.Id.Tr6); set => SetRegister(Registers.Id.Tr6, value); } + public BigInteger Tr7 { get => GetRegister(Registers.Id.Tr7); set => SetRegister(Registers.Id.Tr7, value); } + public BigInteger Cr0 { get => GetRegister(Registers.Id.Cr0); set => SetRegister(Registers.Id.Cr0, value); } + public BigInteger Cr1 { get => GetRegister(Registers.Id.Cr1); set => SetRegister(Registers.Id.Cr1, value); } + public BigInteger Cr2 { get => GetRegister(Registers.Id.Cr2); set => SetRegister(Registers.Id.Cr2, value); } + public BigInteger Cr3 { get => GetRegister(Registers.Id.Cr3); set => SetRegister(Registers.Id.Cr3, value); } + public BigInteger Cr4 { get => GetRegister(Registers.Id.Cr4); set => SetRegister(Registers.Id.Cr4, value); } + public BigInteger Cr5 { get => GetRegister(Registers.Id.Cr5); set => SetRegister(Registers.Id.Cr5, value); } + public BigInteger Cr6 { get => GetRegister(Registers.Id.Cr6); set => SetRegister(Registers.Id.Cr6, value); } + public BigInteger Cr7 { get => GetRegister(Registers.Id.Cr7); set => SetRegister(Registers.Id.Cr7, value); } + public BigInteger Cr8 { get => GetRegister(Registers.Id.Cr8); set => SetRegister(Registers.Id.Cr8, value); } + public BigInteger Cr9 { get => GetRegister(Registers.Id.Cr9); set => SetRegister(Registers.Id.Cr9, value); } + public BigInteger Cr10 { get => GetRegister(Registers.Id.Cr10); set => SetRegister(Registers.Id.Cr10, value); } + public BigInteger Cr11 { get => GetRegister(Registers.Id.Cr11); set => SetRegister(Registers.Id.Cr11, value); } + public BigInteger Cr12 { get => GetRegister(Registers.Id.Cr12); set => SetRegister(Registers.Id.Cr12, value); } + public BigInteger Cr13 { get => GetRegister(Registers.Id.Cr13); set => SetRegister(Registers.Id.Cr13, value); } + public BigInteger Cr14 { get => GetRegister(Registers.Id.Cr14); set => SetRegister(Registers.Id.Cr14, value); } + public BigInteger Cr15 { get => GetRegister(Registers.Id.Cr15); set => SetRegister(Registers.Id.Cr15, value); } #if _X64_ - public nuint Dr0 { get => (nuint)GetRegisterU64(RegisterId.Dr0); set => SetRegisterU64(RegisterId.Dr0, value); } - public nuint Dr1 { get => (nuint)GetRegisterU64(RegisterId.Dr1); set => SetRegisterU64(RegisterId.Dr1, value); } - public nuint Dr2 { get => (nuint)GetRegisterU64(RegisterId.Dr2); set => SetRegisterU64(RegisterId.Dr2, value); } - public nuint Dr3 { get => (nuint)GetRegisterU64(RegisterId.Dr3); set => SetRegisterU64(RegisterId.Dr3, value); } - public nuint Dr4 { get => (nuint)GetRegisterU64(RegisterId.Dr4); set => SetRegisterU64(RegisterId.Dr4, value); } - public nuint Dr5 { get => (nuint)GetRegisterU64(RegisterId.Dr5); set => SetRegisterU64(RegisterId.Dr5, value); } - public nuint Dr6 { get => (nuint)GetRegisterU64(RegisterId.Dr6); set => SetRegisterU64(RegisterId.Dr6, value); } - public nuint Dr7 { get => (nuint)GetRegisterU64(RegisterId.Dr7); set => SetRegisterU64(RegisterId.Dr7, value); } - public nuint Dr8 { get => (nuint)GetRegisterU64(RegisterId.Dr8); set => SetRegisterU64(RegisterId.Dr8, value); } - public nuint Dr9 { get => (nuint)GetRegisterU64(RegisterId.Dr9); set => SetRegisterU64(RegisterId.Dr9, value); } - public nuint Dr10 { get => (nuint)GetRegisterU64(RegisterId.Dr10); set => SetRegisterU64(RegisterId.Dr10, value); } - public nuint Dr11 { get => (nuint)GetRegisterU64(RegisterId.Dr11); set => SetRegisterU64(RegisterId.Dr11, value); } - public nuint Dr12 { get => (nuint)GetRegisterU64(RegisterId.Dr12); set => SetRegisterU64(RegisterId.Dr12, value); } - public nuint Dr13 { get => (nuint)GetRegisterU64(RegisterId.Dr13); set => SetRegisterU64(RegisterId.Dr13, value); } - public nuint Dr14 { get => (nuint)GetRegisterU64(RegisterId.Dr14); set => SetRegisterU64(RegisterId.Dr14, value); } - public nuint Dr15 { get => (nuint)GetRegisterU64(RegisterId.Dr15); set => SetRegisterU64(RegisterId.Dr15, value); } + public nuint Dr0 { get => (nuint)GetRegisterU64(Registers.Id.Dr0); set => SetRegisterU64(Registers.Id.Dr0, value); } + public nuint Dr1 { get => (nuint)GetRegisterU64(Registers.Id.Dr1); set => SetRegisterU64(Registers.Id.Dr1, value); } + public nuint Dr2 { get => (nuint)GetRegisterU64(Registers.Id.Dr2); set => SetRegisterU64(Registers.Id.Dr2, value); } + public nuint Dr3 { get => (nuint)GetRegisterU64(Registers.Id.Dr3); set => SetRegisterU64(Registers.Id.Dr3, value); } + public nuint Dr4 { get => (nuint)GetRegisterU64(Registers.Id.Dr4); set => SetRegisterU64(Registers.Id.Dr4, value); } + public nuint Dr5 { get => (nuint)GetRegisterU64(Registers.Id.Dr5); set => SetRegisterU64(Registers.Id.Dr5, value); } + public nuint Dr6 { get => (nuint)GetRegisterU64(Registers.Id.Dr6); set => SetRegisterU64(Registers.Id.Dr6, value); } + public nuint Dr7 { get => (nuint)GetRegisterU64(Registers.Id.Dr7); set => SetRegisterU64(Registers.Id.Dr7, value); } + public nuint Dr8 { get => (nuint)GetRegisterU64(Registers.Id.Dr8); set => SetRegisterU64(Registers.Id.Dr8, value); } + public nuint Dr9 { get => (nuint)GetRegisterU64(Registers.Id.Dr9); set => SetRegisterU64(Registers.Id.Dr9, value); } + public nuint Dr10 { get => (nuint)GetRegisterU64(Registers.Id.Dr10); set => SetRegisterU64(Registers.Id.Dr10, value); } + public nuint Dr11 { get => (nuint)GetRegisterU64(Registers.Id.Dr11); set => SetRegisterU64(Registers.Id.Dr11, value); } + public nuint Dr12 { get => (nuint)GetRegisterU64(Registers.Id.Dr12); set => SetRegisterU64(Registers.Id.Dr12, value); } + public nuint Dr13 { get => (nuint)GetRegisterU64(Registers.Id.Dr13); set => SetRegisterU64(Registers.Id.Dr13, value); } + public nuint Dr14 { get => (nuint)GetRegisterU64(Registers.Id.Dr14); set => SetRegisterU64(Registers.Id.Dr14, value); } + public nuint Dr15 { get => (nuint)GetRegisterU64(Registers.Id.Dr15); set => SetRegisterU64(Registers.Id.Dr15, value); } #else - public nuint Dr0 { get => (nuint)GetRegisterU32(RegisterId.Dr0); set => SetRegisterU32(RegisterId.Dr0, value); } - public nuint Dr1 { get => (nuint)GetRegisterU32(RegisterId.Dr1); set => SetRegisterU32(RegisterId.Dr1, value); } - public nuint Dr2 { get => (nuint)GetRegisterU32(RegisterId.Dr2); set => SetRegisterU32(RegisterId.Dr2, value); } - public nuint Dr3 { get => (nuint)GetRegisterU32(RegisterId.Dr3); set => SetRegisterU32(RegisterId.Dr3, value); } - public nuint Dr4 { get => (nuint)GetRegisterU32(RegisterId.Dr4); set => SetRegisterU32(RegisterId.Dr4, value); } - public nuint Dr5 { get => (nuint)GetRegisterU32(RegisterId.Dr5); set => SetRegisterU32(RegisterId.Dr5, value); } - public nuint Dr6 { get => (nuint)GetRegisterU32(RegisterId.Dr6); set => SetRegisterU32(RegisterId.Dr6, value); } - public nuint Dr7 { get => (nuint)GetRegisterU32(RegisterId.Dr7); set => SetRegisterU32(RegisterId.Dr7, value); } - public nuint Dr8 { get => (nuint)GetRegisterU32(RegisterId.Dr8); set => SetRegisterU32(RegisterId.Dr8, value); } - public nuint Dr9 { get => (nuint)GetRegisterU32(RegisterId.Dr9); set => SetRegisterU32(RegisterId.Dr9, value); } - public nuint Dr10 { get => (nuint)GetRegisterU32(RegisterId.Dr10); set => SetRegisterU32(RegisterId.Dr10, value); } - public nuint Dr11 { get => (nuint)GetRegisterU32(RegisterId.Dr11); set => SetRegisterU32(RegisterId.Dr11, value); } - public nuint Dr12 { get => (nuint)GetRegisterU32(RegisterId.Dr12); set => SetRegisterU32(RegisterId.Dr12, value); } - public nuint Dr13 { get => (nuint)GetRegisterU32(RegisterId.Dr13); set => SetRegisterU32(RegisterId.Dr13, value); } - public nuint Dr14 { get => (nuint)GetRegisterU32(RegisterId.Dr14); set => SetRegisterU32(RegisterId.Dr14, value); } - public nuint Dr15 { get => (nuint)GetRegisterU32(RegisterId.Dr15); set => SetRegisterU32(RegisterId.Dr15, value); } + public nuint Dr0 { get => (nuint)GetRegisterU32(Registers.Id.Dr0); set => SetRegisterU32(Registers.Id.Dr0, value); } + public nuint Dr1 { get => (nuint)GetRegisterU32(Registers.Id.Dr1); set => SetRegisterU32(Registers.Id.Dr1, value); } + public nuint Dr2 { get => (nuint)GetRegisterU32(Registers.Id.Dr2); set => SetRegisterU32(Registers.Id.Dr2, value); } + public nuint Dr3 { get => (nuint)GetRegisterU32(Registers.Id.Dr3); set => SetRegisterU32(Registers.Id.Dr3, value); } + public nuint Dr4 { get => (nuint)GetRegisterU32(Registers.Id.Dr4); set => SetRegisterU32(Registers.Id.Dr4, value); } + public nuint Dr5 { get => (nuint)GetRegisterU32(Registers.Id.Dr5); set => SetRegisterU32(Registers.Id.Dr5, value); } + public nuint Dr6 { get => (nuint)GetRegisterU32(Registers.Id.Dr6); set => SetRegisterU32(Registers.Id.Dr6, value); } + public nuint Dr7 { get => (nuint)GetRegisterU32(Registers.Id.Dr7); set => SetRegisterU32(Registers.Id.Dr7, value); } + public nuint Dr8 { get => (nuint)GetRegisterU32(Registers.Id.Dr8); set => SetRegisterU32(Registers.Id.Dr8, value); } + public nuint Dr9 { get => (nuint)GetRegisterU32(Registers.Id.Dr9); set => SetRegisterU32(Registers.Id.Dr9, value); } + public nuint Dr10 { get => (nuint)GetRegisterU32(Registers.Id.Dr10); set => SetRegisterU32(Registers.Id.Dr10, value); } + public nuint Dr11 { get => (nuint)GetRegisterU32(Registers.Id.Dr11); set => SetRegisterU32(Registers.Id.Dr11, value); } + public nuint Dr12 { get => (nuint)GetRegisterU32(Registers.Id.Dr12); set => SetRegisterU32(Registers.Id.Dr12, value); } + public nuint Dr13 { get => (nuint)GetRegisterU32(Registers.Id.Dr13); set => SetRegisterU32(Registers.Id.Dr13, value); } + public nuint Dr14 { get => (nuint)GetRegisterU32(Registers.Id.Dr14); set => SetRegisterU32(Registers.Id.Dr14, value); } + public nuint Dr15 { get => (nuint)GetRegisterU32(Registers.Id.Dr15); set => SetRegisterU32(Registers.Id.Dr15, value); } #endif - public BigInteger K0 { get => GetRegister(RegisterId.K0); set => SetRegister(RegisterId.K0, value); } - public BigInteger K1 { get => GetRegister(RegisterId.K1); set => SetRegister(RegisterId.K1, value); } - public BigInteger K2 { get => GetRegister(RegisterId.K2); set => SetRegister(RegisterId.K2, value); } - public BigInteger K3 { get => GetRegister(RegisterId.K3); set => SetRegister(RegisterId.K3, value); } - public BigInteger K4 { get => GetRegister(RegisterId.K4); set => SetRegister(RegisterId.K4, value); } - public BigInteger K5 { get => GetRegister(RegisterId.K5); set => SetRegister(RegisterId.K5, value); } - public BigInteger K6 { get => GetRegister(RegisterId.K6); set => SetRegister(RegisterId.K6, value); } - public BigInteger K7 { get => GetRegister(RegisterId.K7); set => SetRegister(RegisterId.K7, value); } - public BigInteger Bnd0 { get => GetRegister(RegisterId.Bnd0); set => SetRegister(RegisterId.Bnd0, value); } - public BigInteger Bnd1 { get => GetRegister(RegisterId.Bnd1); set => SetRegister(RegisterId.Bnd1, value); } - public BigInteger Bnd2 { get => GetRegister(RegisterId.Bnd2); set => SetRegister(RegisterId.Bnd2, value); } - public BigInteger Bnd3 { get => GetRegister(RegisterId.Bnd3); set => SetRegister(RegisterId.Bnd3, value); } - public BigInteger BndCfg { get => GetRegister(RegisterId.BndCfg); set => SetRegister(RegisterId.BndCfg, value); } - public BigInteger BndStatus { get => GetRegister(RegisterId.BndStatus); set => SetRegister(RegisterId.BndStatus, value); } - public BigInteger Mxcsr { get => GetRegister(RegisterId.Mxcsr); set => SetRegister(RegisterId.Mxcsr, value); } - public BigInteger Pkru { get => GetRegister(RegisterId.Pkru); set => SetRegister(RegisterId.Pkru, value); } - public BigInteger Xcr0 { get => GetRegister(RegisterId.Xcr0); set => SetRegister(RegisterId.Xcr0, value); } + public BigInteger K0 { get => GetRegister(Registers.Id.K0); set => SetRegister(Registers.Id.K0, value); } + public BigInteger K1 { get => GetRegister(Registers.Id.K1); set => SetRegister(Registers.Id.K1, value); } + public BigInteger K2 { get => GetRegister(Registers.Id.K2); set => SetRegister(Registers.Id.K2, value); } + public BigInteger K3 { get => GetRegister(Registers.Id.K3); set => SetRegister(Registers.Id.K3, value); } + public BigInteger K4 { get => GetRegister(Registers.Id.K4); set => SetRegister(Registers.Id.K4, value); } + public BigInteger K5 { get => GetRegister(Registers.Id.K5); set => SetRegister(Registers.Id.K5, value); } + public BigInteger K6 { get => GetRegister(Registers.Id.K6); set => SetRegister(Registers.Id.K6, value); } + public BigInteger K7 { get => GetRegister(Registers.Id.K7); set => SetRegister(Registers.Id.K7, value); } + public BigInteger Bnd0 { get => GetRegister(Registers.Id.Bnd0); set => SetRegister(Registers.Id.Bnd0, value); } + public BigInteger Bnd1 { get => GetRegister(Registers.Id.Bnd1); set => SetRegister(Registers.Id.Bnd1, value); } + public BigInteger Bnd2 { get => GetRegister(Registers.Id.Bnd2); set => SetRegister(Registers.Id.Bnd2, value); } + public BigInteger Bnd3 { get => GetRegister(Registers.Id.Bnd3); set => SetRegister(Registers.Id.Bnd3, value); } + public BigInteger BndCfg { get => GetRegister(Registers.Id.BndCfg); set => SetRegister(Registers.Id.BndCfg, value); } + public BigInteger BndStatus { get => GetRegister(Registers.Id.BndStatus); set => SetRegister(Registers.Id.BndStatus, value); } + public BigInteger Mxcsr { get => GetRegister(Registers.Id.Mxcsr); set => SetRegister(Registers.Id.Mxcsr, value); } + public BigInteger Pkru { get => GetRegister(Registers.Id.Pkru); set => SetRegister(Registers.Id.Pkru, value); } + public BigInteger Xcr0 { get => GetRegister(Registers.Id.Xcr0); set => SetRegister(Registers.Id.Xcr0, value); } // Host Specific #if _X64_ - public nuint Nax { get => (nuint)GetRegisterU64(RegisterId.Rax); set => SetRegisterU64(RegisterId.Rax, value); } - public nuint Ncx { get => (nuint)GetRegisterU64(RegisterId.Rcx); set => SetRegisterU64(RegisterId.Rcx, value); } - public nuint Ndx { get => (nuint)GetRegisterU64(RegisterId.Rdx); set => SetRegisterU64(RegisterId.Rdx, value); } - public nuint Nbx { get => (nuint)GetRegisterU64(RegisterId.Rbx); set => SetRegisterU64(RegisterId.Rbx, value); } - public nuint Nsp { get => (nuint)GetRegisterU64(RegisterId.Rsp); set => SetRegisterU64(RegisterId.Rsp, value); } - public nuint Nbp { get => (nuint)GetRegisterU64(RegisterId.Rbp); set => SetRegisterU64(RegisterId.Rbp, value); } - public nuint Nsi { get => (nuint)GetRegisterU64(RegisterId.Rsi); set => SetRegisterU64(RegisterId.Rsi, value); } - public nuint Ndi { get => (nuint)GetRegisterU64(RegisterId.Rdi); set => SetRegisterU64(RegisterId.Rdi, value); } - public nuint Nip { get => (nuint)GetRegisterU64(RegisterId.Rip); set => SetRegisterU64(RegisterId.Rip, value); } + public nuint Nax { get => (nuint)GetRegisterU64(Registers.Id.Rax); set => SetRegisterU64(Registers.Id.Rax, value); } + public nuint Ncx { get => (nuint)GetRegisterU64(Registers.Id.Rcx); set => SetRegisterU64(Registers.Id.Rcx, value); } + public nuint Ndx { get => (nuint)GetRegisterU64(Registers.Id.Rdx); set => SetRegisterU64(Registers.Id.Rdx, value); } + public nuint Nbx { get => (nuint)GetRegisterU64(Registers.Id.Rbx); set => SetRegisterU64(Registers.Id.Rbx, value); } + public nuint Nsp { get => (nuint)GetRegisterU64(Registers.Id.Rsp); set => SetRegisterU64(Registers.Id.Rsp, value); } + public nuint Nbp { get => (nuint)GetRegisterU64(Registers.Id.Rbp); set => SetRegisterU64(Registers.Id.Rbp, value); } + public nuint Nsi { get => (nuint)GetRegisterU64(Registers.Id.Rsi); set => SetRegisterU64(Registers.Id.Rsi, value); } + public nuint Ndi { get => (nuint)GetRegisterU64(Registers.Id.Rdi); set => SetRegisterU64(Registers.Id.Rdi, value); } + public nuint Nip { get => (nuint)GetRegisterU64(Registers.Id.Rip); set => SetRegisterU64(Registers.Id.Rip, value); } #else - public nuint Nax { get => (nuint)GetRegisterU32(RegisterId.Eax); set => SetRegisterU32(RegisterId.Eax, value); } - public nuint Ncx { get => (nuint)GetRegisterU32(RegisterId.Ecx); set => SetRegisterU32(RegisterId.Ecx, value); } - public nuint Ndx { get => (nuint)GetRegisterU32(RegisterId.Edx); set => SetRegisterU32(RegisterId.Edx, value); } - public nuint Nbx { get => (nuint)GetRegisterU32(RegisterId.Ebx); set => SetRegisterU32(RegisterId.Ebx, value); } - public nuint Nsp { get => (nuint)GetRegisterU32(RegisterId.Esp); set => SetRegisterU32(RegisterId.Esp, value); } - public nuint Nbp { get => (nuint)GetRegisterU32(RegisterId.Ebp); set => SetRegisterU32(RegisterId.Ebp, value); } - public nuint Nsi { get => (nuint)GetRegisterU32(RegisterId.Esi); set => SetRegisterU32(RegisterId.Esi, value); } - public nuint Ndi { get => (nuint)GetRegisterU32(RegisterId.Edi); set => SetRegisterU32(RegisterId.Edi, value); } - public nuint Nip { get => (nuint)GetRegisterU32(RegisterId.Eip); set => SetRegisterU32(RegisterId.Eip, value); } + public nuint Nax { get => (nuint)GetRegisterU32(Registers.Id.Eax); set => SetRegisterU32(Registers.Id.Eax, value); } + public nuint Ncx { get => (nuint)GetRegisterU32(Registers.Id.Ecx); set => SetRegisterU32(Registers.Id.Ecx, value); } + public nuint Ndx { get => (nuint)GetRegisterU32(Registers.Id.Edx); set => SetRegisterU32(Registers.Id.Edx, value); } + public nuint Nbx { get => (nuint)GetRegisterU32(Registers.Id.Ebx); set => SetRegisterU32(Registers.Id.Ebx, value); } + public nuint Nsp { get => (nuint)GetRegisterU32(Registers.Id.Esp); set => SetRegisterU32(Registers.Id.Esp, value); } + public nuint Nbp { get => (nuint)GetRegisterU32(Registers.Id.Ebp); set => SetRegisterU32(Registers.Id.Ebp, value); } + public nuint Nsi { get => (nuint)GetRegisterU32(Registers.Id.Esi); set => SetRegisterU32(Registers.Id.Esi, value); } + public nuint Ndi { get => (nuint)GetRegisterU32(Registers.Id.Edi); set => SetRegisterU32(Registers.Id.Edi, value); } + public nuint Nip { get => (nuint)GetRegisterU32(Registers.Id.Eip); set => SetRegisterU32(Registers.Id.Eip, value); } #endif } }