longest asm instructioj 4096->32.

remotes/push_mirror/0.96
Török Edvin 16 years ago
parent acba3cf51b
commit 242bc10b0e
  1. 5
      libclamav/bytecode_api.c

@ -109,8 +109,9 @@ uint32_t cli_bcapi_disasm_x86(struct cli_bc_ctx *ctx, struct DISASM_RESULT *res,
const char* next;
if (!res || !ctx->fmap || ctx->off >= ctx->fmap->len)
return -1;
/* FIXME: 4096 is an overestimate, how long is the longest instruction? */
n = MIN(4096, ctx->fmap->len - ctx->off);
/* 32 should be longest instr we support decoding.
* When we'll support mmx/sse instructions this should be updated! */
n = MIN(32, ctx->fmap->len - ctx->off);
buf = fmap_need_off_once(ctx->fmap, ctx->off, n);
next = cli_disasm_one(buf, n, res, 0);
if (!next)

Loading…
Cancel
Save