MCPcopy Create free account
hub / github.com/OFFTKP/felix86 / ZydisEncoderEncodeInstructionInternal

Function ZydisEncoderEncodeInstructionInternal

external/zydis/src/Encoder.c:4311–4324  ·  view source on GitHub ↗

* Encodes instruction with semantics specified in encoder request structure. * * @param request A pointer to the `ZydisEncoderRequest` struct. Must be validated before * calling this function. * @param buffer A pointer to the output buffer receiving encoded instruction. * @param length A pointer to the variable containing length of the output buffer. U

Source from the content-addressed store, hash-verified

4309 * @return A zyan status code.
4310 */
4311static ZyanStatus ZydisEncoderEncodeInstructionInternal(const ZydisEncoderRequest *request,
4312 void *buffer, ZyanUSize *length, ZydisEncoderInstruction *instruction)
4313{
4314 ZydisEncoderInstructionMatch match;
4315 ZYAN_CHECK(ZydisFindMatchingDefinition(request, &match));
4316 ZydisEncoderBuffer output;
4317 output.buffer = (ZyanU8 *)buffer;
4318 output.size = *length;
4319 output.offset = 0;
4320 ZYAN_CHECK(ZydisBuildInstruction(&match, instruction));
4321 ZYAN_CHECK(ZydisEmitInstruction(instruction, &output));
4322 *length = output.offset;
4323 return ZYAN_STATUS_SUCCESS;
4324}
4325
4326/* ============================================================================================== */
4327/* Exported functions */

Calls 3

ZydisBuildInstructionFunction · 0.85
ZydisEmitInstructionFunction · 0.85

Tested by

no test coverage detected