int __bea_callspec__ Disasm (PDISASM pMyDisasm) { if (InitVariables(pMyDisasm)) { (void) AnalyzeOpcode(pMyDisasm); if (!GV.OutOfBlock) { FixArgSizeForMemoryOperand(pMyDisasm); FixREXPrefixes(pMyDisasm); FillSegmentsRegisters(pMyDisasm); CompleteInstructionFields(pMyDisasm); #ifndef BEA_LIGHT_DISASSEMBLY if (GV.SYNTAX_ == ATSyntax) { BuildCompleteInstructionATSyntax(pMyDisasm); } else { BuildCompleteInstruction(pMyDisasm); } #endif if (GV.ERROR_OPCODE) { return -1; } else { return (int) (GV.EIP_-(*pMyDisasm).EIP); } } else { return 0; } } else { return -1; } }
/* ==================================================================== * * ==================================================================== */ int __bea_callspec__ Disasm (PDISASM pMyDisasm) { InitVariables(pMyDisasm); AnalyzeOpcode(pMyDisasm); if (GV.ERROR_OPCODE) { return -1; } if (!GV.OutOfBlock) { //CompleteInstructionFields(pMyDisasm); return (int) (GV.EIP_-(*pMyDisasm).EIP); } // if all 15 bytes is used, it should be opcode error. not out of block if ((*pMyDisasm).SecurityBlock == 0 || (*pMyDisasm).SecurityBlock >= MAX_INSTR_LENGTH) return -1; return 0; }