Skip to content

Commit

Permalink
move the fixes for BeaEngine/beaengine#39 at the right spots
Browse files Browse the repository at this point in the history
  • Loading branch information
0vercl0k committed Jan 17, 2022
1 parent aa5b29d commit 2845020
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/third_party/beaengine/src/Includes/Routines_ModRM.c
Original file line number Diff line number Diff line change
Expand Up @@ -173,9 +173,13 @@ void __bea_callspec__ fillRegister(int index, OPTYPE* pMyOperand, PDISASM pMyDis
OperandSize8Reg(pMyOperand, pMyDisasm, i, index);
break;
case 16:
if (index >= 0 && index < 16) {
#ifndef BEA_LIGHT_DISASSEMBLY
(void) strcpy ((char*) pMyOperand->OpMnemonic+i, Registers16Bits[index]);
#endif
} else {
pMyOperand->OpMnemonic[i] = 0;
}
pMyOperand->OpType = REGISTER_TYPE;
pMyOperand->Registers.type = GENERAL_REG;
pMyOperand->Registers.gpr = REGS[index];
Expand All @@ -191,9 +195,13 @@ void __bea_callspec__ fillRegister(int index, OPTYPE* pMyOperand, PDISASM pMyDis
pMyOperand->OpSize = 32;
break;
case 64:
if (index >= 0 && index < 16) {
#ifndef BEA_LIGHT_DISASSEMBLY
(void) strcpy ((char*) pMyOperand->OpMnemonic+i, Registers64Bits[index]);
#endif
} else {
pMyOperand->OpMnemonic[i] = 0;
}
pMyOperand->OpType = REGISTER_TYPE;
pMyOperand->Registers.type = GENERAL_REG;
pMyOperand->Registers.gpr = REGS[index];
Expand Down Expand Up @@ -1436,13 +1444,9 @@ void __bea_callspec__ fillModrm3Register(OPTYPE* pMyOperand, PDISASM pMyDisasm,
switch (GV.OperandSize) {
case 64:
index_final = (GV.REX.B_ == 1) ? index + 8 : index + 0;
if (index >= 0 && index < 16) {
#ifndef BEA_LIGHT_DISASSEMBLY
(void) strcpy ((char*) pMyOperand->OpMnemonic+i, Registers64Bits[index_final]);
#endif
} else {
pMyOperand->OpMnemonic[i] = 0;
}
pMyOperand->OpType = REGISTER_TYPE;
pMyOperand->Registers.type = GENERAL_REG;
pMyOperand->Registers.gpr = REGS[index_final];
Expand All @@ -1461,13 +1465,9 @@ void __bea_callspec__ fillModrm3Register(OPTYPE* pMyOperand, PDISASM pMyDisasm,

case 16:
index_final = (GV.REX.B_ == 1) ? index + 8 : index + 0;
if (index >= 0 && index < 16) {
#ifndef BEA_LIGHT_DISASSEMBLY
(void) strcpy ((char*) pMyOperand->OpMnemonic+i, Registers16Bits[index_final]);
#endif
} else {
pMyOperand->OpMnemonic[i] = 0;
}
pMyOperand->OpType = REGISTER_TYPE;
pMyOperand->Registers.type = GENERAL_REG;
pMyOperand->Registers.gpr = REGS[index_final];
Expand Down

0 comments on commit 2845020

Please sign in to comment.