Callback

User-defined callback function type for SKIPDATA mode of operation

The first parameter is the input buffer containing code to be disassembled, while the second one holds the position of the currently-examined byte in this buffer.

alias Callback = size_t delegate(
in ubyte[] code
,
size_t offset
) nothrow @nogc

Return Value

The number of bytes to skip, or 0 to immediately stop disassembling

Examples

size_t callback(in ubyte[] code, size_t offset) {
    return 2; // Always skip 2 bytes when encountering uninterpretable instructions
}

See Capstone.setupSkipdata documentation for full sample code demonstrating this functionality.

Meta