File: BPFDisassembler.h

package info (click to toggle)
capstone 5.0.6-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 58,188 kB
  • sloc: ansic: 96,086; cpp: 67,489; cs: 29,510; python: 25,829; pascal: 24,412; java: 15,582; ml: 14,473; makefile: 1,275; sh: 479; ruby: 386
file content (27 lines) | stat: -rw-r--r-- 561 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
/* Capstone Disassembly Engine */
/* BPF Backend by david942j <david942j@gmail.com>, 2019 */

#ifndef CS_BPF_DISASSEMBLER_H
#define CS_BPF_DISASSEMBLER_H

#include "../../MCInst.h"

typedef struct bpf_internal {
	uint16_t op;
	uint64_t k;
	/* for cBPF */
	uint8_t jt;
	uint8_t jf;
	/* for eBPF */
	uint8_t dst;
	uint8_t src;
	uint16_t offset;

	/* length of this bpf instruction */
	uint8_t insn_size;
} bpf_internal;

bool BPF_getInstruction(csh ud, const uint8_t *code, size_t code_len,
		MCInst *instr, uint16_t *size, uint64_t address, void *info);

#endif