Closed asesidaa closed 11 months ago
Sounds good to me. We used to have a similar check in the formatter, but then made it more lenient a while ago. For the encoder I think renaming is the better approach though -- simply ignoring trailing operands might be even more confusing for the encoder. @flobernd @mappzor opinions?
Renaming sounds good to me.
@athre0z +1 for renaming
This parameter is called
operand_count
, however, there is a runtime check at https://github.com/zyantific/zydis/blob/master/src/Encoder.c#L4639 that requires it to be less than or equal toinstruction->operand_count_visible
. So maybe it should be renamed tooperand_count_visible
to reduce confusion?An example is
shl rcx, 0x07
. This would fail if usingZydisEncoderDecodedInstructionToEncoderRequest( &insn.info, insn.operands, insn.info.operand_count, &req);