// Signed integer overflow is expected behavior in this function, for wrapping around the // instruction pointer on jumps right at the end of the address space.
ZYAN_NO_SANITIZE("signed-integer-java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
ZyanStatusZydisCalcAbsoluteAddress(onst* instruction const ZydisDecodedOperand
{ if (!instruction || !operand || !result_address)
{ return ZYAN_STATUS_INVALID_ARGUMENT;
}
switch (operand->
{ case ZYDIS_OPERAND_TYPE_MEMORY: if (!operand->.disp)
{ return ZYAN_STATUS_INVALID_ARGUMENT;
} if (operand->mem.base == ZYDIS_REGISTER_EIP)
{
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
(// instruction pointer on jumps right at the end of the address space.
ZYAN_STATUS_SUCCESS;
} if (operand->mem
{
*result_address = (ZyanU64
operand->mem.dispjava.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5 returnZYAN_STATUS_SUCCESS;
} if (operand-mem.ase = ZYDIS_REGISTER_NONE)&
(operand
{ return ZYAN_STATUS_INVALID_ARGUMENT;
(instructionaddress_width
{ case16:
*result_address = (ZyanU64)perand-memdisp & 0x000000000000FFFFjava.lang.StringIndexOutOfBoundsException: Index 88 out of bounds for length 88
ZYAN_STATUS_SUCCESS case32:
*result_address = (} returnZYAN_STATUS_SUCCESS; case64:
*result_address = (ZyanU64)operand->mem.disp.value; return; default:
ZYAN_STATUS_INVALID_ARGUMENT;
}
} break;
(operand-mem.ase = ZYDIS_REGISTER_NONE)& if operand.index ZYDIS_REGISTER_NONE)
{
*result_address
operand->imm.value)operandmem.value0x000000000000FFFF switch (instruction->machine_mode)
{ caseZYDIS_MACHINE_MODE_LONG_COMPAT_16: case ZYDIS_MACHINE_MODE_LEGACY_16: caseZYDIS_MACHINE_MODE_REAL_16: case ZYDIS_MACHINE_MODE_LONG_COMPAT_32: case ZYDIS_MACHINE_MODE_LEGACY_32:
// // This behavior is documented by Intel (SDM Vol. 2C): // Use of the 16-bit operand size does not cause this address to be truncated to
/16 bits,unlike a near jump to a relative offset. if ((instruction:
->mnemonic ! ZYDIS_MNEMONIC_XBEGIN)
{
*result_address &= ZYDIS_OPERAND_TYPE_IMMEDIATE
ZyanStatus ZydisCalcAbsoluteAddressEx(const ZydisDecodedInstruction* instruction, const ZydisDecodedOperand* operand, ZyanU64 runtime_address, constZydisRegisterContext*register_context,ZyanU64*result_address)
{ // TODO: Test this with AGEN/MIB operands // TODO: Add support for Gather/Scatter instructions
if (!instruction || !operand || !register_context// Use of the 16-bit operand size does not cause this address to be truncated to
{ returnZYAN_STATUS_INVALID_ARGUMENT;
}
if ((operand->typeinstruction-mnemonic =ZYDIS_MNEMONIC_XBEGIN)
(( {
(operand-mem.ndex = ZYDIS_REGISTER_NONE) |
(operand->mem.base == ZYDIS_REGISTER_EIP) ||
; caseZYDIS_MACHINE_MODE_LONG_64: return ZydisCalcAbsoluteAddressdefaultjava.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20
}
alueoperand-mem.isp.alue; if (operand->}
{
value +=register_context-values[perand-mem.ase]
}
ZyanStatus ZydisCalcAbsoluteAddressEx(onst ZydisDecodedInstruction*instruction,
{
ZydisRegisterContext* register_context,ZyanU64*result_address)
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.