... | ... |
@@ -41,6 +41,7 @@ |
41 | 41 |
#include "others.h" |
42 | 42 |
#include "pe.h" |
43 | 43 |
#include "disasm.h" |
44 |
+#include "scanners.h" |
|
44 | 45 |
|
45 | 46 |
uint32_t cli_bcapi_test1(struct cli_bc_ctx *ctx, uint32_t a, uint32_t b) |
46 | 47 |
{ |
... | ... |
@@ -432,7 +433,7 @@ int32_t cli_bcapi_read_number(struct cli_bc_ctx *ctx, uint32_t radix) |
432 | 432 |
char *p; |
433 | 433 |
int32_t result; |
434 | 434 |
|
435 |
- if (radix != 10 && radix != 16 || !ctx->fmap) |
|
435 |
+ if ((radix != 10 && radix != 16) || !ctx->fmap) |
|
436 | 436 |
return -1; |
437 | 437 |
while ((p = fmap_need_off_once(ctx->fmap, ctx->off, BUF))) { |
438 | 438 |
for (i=0;i<BUF;i++) { |
... | ... |
@@ -485,6 +486,7 @@ int32_t cli_bcapi_hashset_remove(struct cli_bc_ctx *ctx , int32_t id, uint32_t k |
485 | 485 |
if (!s) |
486 | 486 |
return -1; |
487 | 487 |
// return cli_hashset_removekey(s, key); |
488 |
+ return -1; |
|
488 | 489 |
} |
489 | 490 |
|
490 | 491 |
int32_t cli_bcapi_hashset_contains(struct cli_bc_ctx *ctx , int32_t id, uint32_t key) |
... | ... |
@@ -504,6 +506,7 @@ int32_t cli_bcapi_hashset_empty(struct cli_bc_ctx *ctx, int32_t id) |
504 | 504 |
int32_t cli_bcapi_hashset_done(struct cli_bc_ctx *ctx , int32_t id) |
505 | 505 |
{ |
506 | 506 |
/* TODO */ |
507 |
+ return -1; |
|
507 | 508 |
} |
508 | 509 |
|
509 | 510 |
int32_t cli_bcapi_buffer_pipe_new(struct cli_bc_ctx *ctx, uint32_t size) |
... | ... |
@@ -648,6 +651,7 @@ int32_t cli_bcapi_buffer_pipe_write_stopped(struct cli_bc_ctx *ctx , int32_t id, |
648 | 648 |
int32_t cli_bcapi_buffer_pipe_done(struct cli_bc_ctx *ctx , int32_t id) |
649 | 649 |
{ |
650 | 650 |
/* TODO */ |
651 |
+ return -1; |
|
651 | 652 |
} |
652 | 653 |
|
653 | 654 |
int32_t cli_bcapi_inflate_init(struct cli_bc_ctx *ctx, int32_t from, int32_t to, int32_t windowBits) |
... | ... |
@@ -729,7 +733,7 @@ int32_t cli_bcapi_inflate_process(struct cli_bc_ctx *ctx , int32_t id) |
729 | 729 |
if (!b->needSync) { |
730 | 730 |
ret = inflate(&b->stream, Z_NO_FLUSH); |
731 | 731 |
if (ret == Z_DATA_ERROR) { |
732 |
- cli_dbgmsg("bytecode api: inflate at %u: %s, trying to recover\n", b->stream.total_in, |
|
732 |
+ cli_dbgmsg("bytecode api: inflate at %lu: %s, trying to recover\n", b->stream.total_in, |
|
733 | 733 |
b->stream.msg); |
734 | 734 |
b->needSync = 1; |
735 | 735 |
} |
... | ... |
@@ -53,7 +53,7 @@ static int never_inline bcfail(const char *msg, long a, long b, |
53 | 53 |
#define CHECK_GT(a, b) do {if ((a) <= (b)) return \ |
54 | 54 |
bcfail("Condition failed "#a" > "#b,(a),(b), __FILE__, __LINE__); } while(0) |
55 | 55 |
#define TRACE_R(x) cli_dbgmsg("bytecode trace: %u, read %llx\n", pc, (long long)x); |
56 |
-#define TRACE_W(x, w, p) cli_dbgmsg("bytecode trace: %u, write%d @%u %llx\n", pc, p, w, (long long)x); |
|
56 |
+#define TRACE_W(x, w, p) cli_dbgmsg("bytecode trace: %u, write%d @%u %llx\n", pc, p, w, (long long)(x)); |
|
57 | 57 |
#define TRACE_EXEC(id, dest, ty, stack) cli_dbgmsg("bytecode trace: executing %d, -> %u (%u); %u\n", id, dest, ty, stack) |
58 | 58 |
#else |
59 | 59 |
static inline int bcfail(const char *msg, long a, long b, |