... | ... |
@@ -836,7 +836,6 @@ int cli_ac_caloff(const struct cli_matcher *root, struct cli_ac_data *data, stru |
836 | 836 |
unsigned int i; |
837 | 837 |
struct cli_ac_patt *patt; |
838 | 838 |
struct cli_target_info info; |
839 |
- struct stat sb; |
|
840 | 839 |
|
841 | 840 |
if(map) { |
842 | 841 |
memset(&info, 0, sizeof(info)); |
... | ... |
@@ -1487,7 +1486,7 @@ int cli_ac_addsig(struct cli_matcher *root, const char *virname, const char *hex |
1487 | 1487 |
if(new->lsigid[0]) |
1488 | 1488 |
root->ac_lsigtable[new->lsigid[1]]->virname = new->virname; |
1489 | 1489 |
|
1490 |
- ret = cli_caloff(offset, NULL, -1, root->type, new->offdata, &new->offset_min, &new->offset_max); |
|
1490 |
+ ret = cli_caloff(offset, NULL, NULL, root->type, new->offdata, &new->offset_min, &new->offset_max); |
|
1491 | 1491 |
if(ret != CL_SUCCESS) { |
1492 | 1492 |
mpool_free(root->mempool, new->prefix ? new->prefix : new->pattern); |
1493 | 1493 |
mpool_ac_free_alt(root->mempool, new); |
... | ... |
@@ -111,9 +111,6 @@ int cli_caloff(const char *offstr, struct cli_target_info *info, struct F_MAP *m |
111 | 111 |
char offcpy[65]; |
112 | 112 |
unsigned int n, val; |
113 | 113 |
char *pt; |
114 |
- off_t pos; |
|
115 |
- struct stat sb; |
|
116 |
- |
|
117 | 114 |
|
118 | 115 |
if(!info) { /* decode offset string */ |
119 | 116 |
if(!offstr) { |
... | ... |
@@ -904,8 +904,8 @@ int cli_scanpe(cli_ctx *ctx) |
904 | 904 |
for(j = 0; j < md5_sect->soff_len && md5_sect->soff[j] <= exe_sections[i].rsz; j++) { |
905 | 905 |
if(md5_sect->soff[j] == exe_sections[i].rsz) { |
906 | 906 |
unsigned char md5_dig[16]; |
907 |
- if(cli_md5sect(map, &exe_sections[i], md5_dig) && cli_bm_scanbuff(md5_dig, 16, ctx->virname, ctx->engine->md5_mdb, 0, -1) == CL_VIRUS) { |
|
908 |
- if(cli_bm_scanbuff(md5_dig, 16, NULL, ctx->engine->md5_fp, 0, -1) != CL_VIRUS) { |
|
907 |
+ if(cli_md5sect(map, &exe_sections[i], md5_dig) && cli_bm_scanbuff(md5_dig, 16, ctx->virname, ctx->engine->md5_mdb, 0, NULL) == CL_VIRUS) { |
|
908 |
+ if(cli_bm_scanbuff(md5_dig, 16, NULL, ctx->engine->md5_fp, 0, NULL) != CL_VIRUS) { |
|
909 | 909 |
|
910 | 910 |
free(section_hdr); |
911 | 911 |
free(exe_sections); |
... | ... |
@@ -2164,7 +2164,6 @@ int cli_peheader(struct F_MAP *map, struct cli_exe_info *peinfo) |
2164 | 2164 |
struct pe_image_optional_hdr32 opt32; |
2165 | 2165 |
} pe_opt; |
2166 | 2166 |
struct pe_image_section_hdr *section_hdr; |
2167 |
- struct stat sb; |
|
2168 | 2167 |
int i; |
2169 | 2168 |
unsigned int err, pe_plus = 0; |
2170 | 2169 |
uint32_t valign, falign, hdr_size; |
... | ... |
@@ -1198,13 +1198,13 @@ static int hash_match(const struct regex_matcher *rlist, const char *host, size_ |
1198 | 1198 |
h[64]='\0'; |
1199 | 1199 |
cli_dbgmsg("Looking up hash %s for %s(%u)%s(%u)\n", h, host, (unsigned)hlen, path, (unsigned)plen); |
1200 | 1200 |
if (prefix_matched) { |
1201 |
- if (cli_bm_scanbuff(sha256_dig, 4, &virname, &rlist->hostkey_prefix,0,-1) == CL_VIRUS) { |
|
1201 |
+ if (cli_bm_scanbuff(sha256_dig, 4, &virname, &rlist->hostkey_prefix,0,NULL) == CL_VIRUS) { |
|
1202 | 1202 |
cli_dbgmsg("prefix matched\n"); |
1203 | 1203 |
*prefix_matched = 1; |
1204 | 1204 |
} else |
1205 | 1205 |
return CL_SUCCESS; |
1206 | 1206 |
} |
1207 |
- if (cli_bm_scanbuff(sha256_dig, 32, &virname, &rlist->sha256_hashes,0,-1) == CL_VIRUS) { |
|
1207 |
+ if (cli_bm_scanbuff(sha256_dig, 32, &virname, &rlist->sha256_hashes,0,NULL) == CL_VIRUS) { |
|
1208 | 1208 |
cli_dbgmsg("This hash matched: %s\n", h); |
1209 | 1209 |
switch(*virname) { |
1210 | 1210 |
case 'W': |
... | ... |
@@ -455,7 +455,7 @@ static int add_hash(struct regex_matcher *matcher, char* pattern, const char fl, |
455 | 455 |
|
456 | 456 |
if (fl != 'W' && pat->length == 32 && |
457 | 457 |
cli_hashset_contains(&matcher->sha256_pfx_set, cli_readint32(pat->pattern)) && |
458 |
- cli_bm_scanbuff(pat->pattern, 32, &vname, &matcher->sha256_hashes,0,-1) == CL_VIRUS) { |
|
458 |
+ cli_bm_scanbuff(pat->pattern, 32, &vname, &matcher->sha256_hashes,0,NULL) == CL_VIRUS) { |
|
459 | 459 |
if (*vname == 'W') { |
460 | 460 |
/* hash is whitelisted in local.gdb */ |
461 | 461 |
cli_dbgmsg("Skipping hash %s\n", pattern); |