lib/capstone.js
function (insn, arch) {
    this.arch = arch;

    // Convert arch number to string
    var archStr = archs.toString(arch);

    Object.defineProperty(this, "_nativeInsn", {
        "configurable"  : true,
        "value"         : null,
    });

    /**
     * Instruction id
     * @name id
     * @type {Number}
     * @memberOf CsInsn
     */
    this.id = insn.id;

    /**
     * Instruction address
     * @name address
     * @type {Number}
     * @memberOf CsInsn
     */
    this.address = insn.address;

    /**
     * Instruction bytes
     * @name bytes
     * @type {Array}
     * @memberOf CsInsn
     */
    this.bytes = insn.bytes.buffer.toJSON().data.slice(0, insn.size);

    /**
     * Instruction mnemonic string
     * @name mnemonic
     * @type {String}
     * @memberOf CsInsn
     */
    this.mnemonic = insn.mnemonic.buffer.readCString(0);

    /**
     * Instruction operand string
     * @name op_str
     * @type {String}
     * @memberOf CsInsn
     */
    this.op_str = insn.op_str.buffer.readCString(0);

    if (insn.detail.address()) {
        var detail = insn.detail.deref();
        /**
         * Instruction detailed information
         *
         * *NOTE: only valid when detail option is ON (OFF by default)*
         *
         * @name detail
         * @type {Object}
         * @memberOf CsInsn
         */
        this.detail = {
            /**
             * Registers implicitly read by this instruction
             * @name detail.regs_read
             * @type {Array}
             * @memberOf CsInsn
             */
            "regs_read" : detail.regs_read.buffer.toJSON().data.slice(
                0,
                detail.regs_read_count
            ),

            /**
             * Registers implicitly modified by this instruction
             * @name detail.regs_write
             * @type {Array}
             * @memberOf CsInsn
             */
            "regs_write" : detail.regs_write.buffer.toJSON().data.slice(
                0,
                detail.regs_write_count
            ),

            /**
             * Groups this instruction belongs to
             * @name detail.groups
             * @type {Array}
             * @memberOf CsInsn
             */
            "groups" : detail.groups.buffer.toJSON().data.slice(
                0,
                detail.groups_count
            ),
        };

        var ArchDetail = exports[archStr]._Detail;
        this.detail[archStr] = new ArchDetail(detail.arch[archStr]);
    }

    return this;
}
function (insn, arch) {
    this.arch = arch;

    // Convert arch number to string
    var archStr = archs.toString(arch);

    Object.defineProperty(this, "_nativeInsn", {
        "configurable"  : true,
        "value"         : null,
    });

    /**
     * Instruction id
     * @name id
     * @type {Number}
     * @memberOf CsInsn
     */
    this.id = insn.id;

    /**
     * Instruction address
     * @name address
     * @type {Number}
     * @memberOf CsInsn
     */
    this.address = insn.address;

    /**
     * Instruction bytes
     * @name bytes
     * @type {Array}
     * @memberOf CsInsn
     */
    this.bytes = insn.bytes.buffer.toJSON().data.slice(0, insn.size);

    /**
     * Instruction mnemonic string
     * @name mnemonic
     * @type {String}
     * @memberOf CsInsn
     */
    this.mnemonic = insn.mnemonic.buffer.readCString(0);

    /**
     * Instruction operand string
     * @name op_str
     * @type {String}
     * @memberOf CsInsn
     */
    this.op_str = insn.op_str.buffer.readCString(0);

    if (insn.detail.address()) {
        var detail = insn.detail.deref();
        /**
         * Instruction detailed information
         *
         * *NOTE: only valid when detail option is ON (OFF by default)*
         *
         * @name detail
         * @type {Object}
         * @memberOf CsInsn
         */
        this.detail = {
            /**
             * Registers implicitly read by this instruction
             * @name detail.regs_read
             * @type {Array}
             * @memberOf CsInsn
             */
            "regs_read" : detail.regs_read.buffer.toJSON().data.slice(
                0,
                detail.regs_read_count
            ),

            /**
             * Registers implicitly modified by this instruction
             * @name detail.regs_write
             * @type {Array}
             * @memberOf CsInsn
             */
            "regs_write" : detail.regs_write.buffer.toJSON().data.slice(
                0,
                detail.regs_write_count
            ),

            /**
             * Groups this instruction belongs to
             * @name detail.groups
             * @type {Array}
             * @memberOf CsInsn
             */
            "groups" : detail.groups.buffer.toJSON().data.slice(
                0,
                detail.groups_count
            ),
        };

        var ArchDetail = exports[archStr]._Detail;
        this.detail[archStr] = new ArchDetail(detail.arch[archStr]);
    }

    return this;
}
function ( insn , arch ) { this . arch = arch ; // Convert arch number to string var archStr = archs . toString ( arch ) ; Object . defineProperty ( this , "_nativeInsn" , { "configurable" : true , "value" : null , } ) ; /**
     * Instruction id
     * @name id
     * @type {Number}
     * @memberOf CsInsn
     */ this . id = insn . id ; /**
     * Instruction address
     * @name address
     * @type {Number}
     * @memberOf CsInsn
     */ this . address = insn . address ; /**
     * Instruction bytes
     * @name bytes
     * @type {Array}
     * @memberOf CsInsn
     */ this . bytes = insn . bytes . buffer . toJSON ( ) . data . slice ( 0 , insn . size ) ; /**
     * Instruction mnemonic string
     * @name mnemonic
     * @type {String}
     * @memberOf CsInsn
     */ this . mnemonic = insn . mnemonic . buffer . readCString ( 0 ) ; /**
     * Instruction operand string
     * @name op_str
     * @type {String}
     * @memberOf CsInsn
     */ this . op_str = insn . op_str . buffer . readCString ( 0 ) ; if ( insn . detail . address ( ) ) { var detail = insn . detail . deref ( ) ; /**
         * Instruction detailed information
         *
         * *NOTE: only valid when detail option is ON (OFF by default)*
         *
         * @name detail
         * @type {Object}
         * @memberOf CsInsn
         */ this . detail = { /**
             * Registers implicitly read by this instruction
             * @name detail.regs_read
             * @type {Array}
             * @memberOf CsInsn
             */ "regs_read" : detail . regs_read . buffer . toJSON ( ) . data . slice ( 0 , detail . regs_read_count ) , /**
             * Registers implicitly modified by this instruction
             * @name detail.regs_write
             * @type {Array}
             * @memberOf CsInsn
             */ "regs_write" : detail . regs_write . buffer . toJSON ( ) . data . slice ( 0 , detail . regs_write_count ) , /**
             * Groups this instruction belongs to
             * @name detail.groups
             * @type {Array}
             * @memberOf CsInsn
             */ "groups" : detail . groups . buffer . toJSON ( ) . data . slice ( 0 , detail . groups_count ) , } ; var ArchDetail = exports [ archStr ] . _Detail ; this . detail [ archStr ] = new ArchDetail ( detail . arch [ archStr ] ) ; } return this ; }
Disassembled instruction information represented as a JavaScript object.
@name CsInsn
@class
@private
@param {InsnType} insn Native instruction struct.
@param {ARCH} arch Architecture.
Disassembled instruction information represented as a JavaScript object .