2
* ClamAV bytecode definitions.
4
* Copyright (C) 2009-2010 Sourcefire, Inc.
8
* This program is free software; you can redistribute it and/or modify
9
* it under the terms of the GNU General Public License version 2 as
10
* published by the Free Software Foundation.
12
* This program is distributed in the hope that it will be useful,
13
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
* GNU General Public License for more details.
17
* You should have received a copy of the GNU General Public License
18
* along with this program; if not, write to the Free Software
19
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
25
struct bytecode_metadata {
29
unsigned long maxStack, maxMem;
30
unsigned long maxTime;
31
unsigned targetExclude;
34
#define BC_FUNC_LEVEL 6
35
#define BC_HEADER "ClamBC"
90
OP_BC_INVALID /* last */
93
static const unsigned char operand_counts[] = {
96
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
99
/* BRANCH, JMP, RET */
102
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
105
/* CALLs have variable number of operands */
109
/* OP_BC_GEP1, OP_BC_GEPZ, OP_BC_GEPN, OP_BC_STORE, OP_BC_LOAD*/
113
/* OP_BC_ISBIGENDIAN */
115
/* OP_BC_ABORT, OP_BSWAP*, OP_PTRDIFF32 */
120
_FIRST_GLOBAL = 0x8000,
121
GLOBAL_MATCH_COUNTS = 0x8000,
129
#define BC_START_TID 69