From 90106b0f5e748f1e67e108800ee0463bae5755e3 Mon Sep 17 00:00:00 2001 From: _xeroxz Date: Thu, 19 Aug 2021 19:18:40 -0700 Subject: [PATCH] small bug fix v3 lol --- src/vminstrs.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/vminstrs.cpp b/src/vminstrs.cpp index cfeb235..c86e486 100644 --- a/src/vminstrs.cpp +++ b/src/vminstrs.cpp @@ -117,7 +117,9 @@ namespace vm::instrs if ( generic_decrypt_0.mnemonic != ZYDIS_MNEMONIC_INVALID ) { operand = transform::apply( - generic_decrypt_0.operands[ 0 ].size, generic_decrypt_0.mnemonic, operand, + /* this is a hot patch for generic0 transformations which bswap 16bit operands... (they xchg)... */ + generic_decrypt_0.mnemonic == ZYDIS_MNEMONIC_XCHG ? 16 : generic_decrypt_0.operands[ 0 ].size, + generic_decrypt_0.mnemonic, operand, // check to see if this instruction has an IMM... transform::has_imm( &generic_decrypt_0 ) ? generic_decrypt_0.operands[ 1 ].imm.value.u : 0 ); }