|
|
@ -3360,19 +3360,21 @@ int cli_scanpe(cli_ctx *ctx) |
|
|
|
cli_bytecode_context_destroy(bc_ctx); |
|
|
|
cli_bytecode_context_destroy(bc_ctx); |
|
|
|
|
|
|
|
|
|
|
|
/* Attempt to run scans on import table */ |
|
|
|
/* Attempt to run scans on import table */ |
|
|
|
/* TODO: should this be target-tree-only? */ |
|
|
|
/* Run if there are existing signatures and/or preclassing */ |
|
|
|
ret = scan_pe_imptbl(ctx, dirs, exe_sections, nsections, hdr_size, pe_plus); |
|
|
|
if (ctx->dconf->pe & PE_CONF_IMPTBL) { |
|
|
|
switch (ret) { |
|
|
|
ret = scan_pe_imptbl(ctx, dirs, exe_sections, nsections, hdr_size, pe_plus); |
|
|
|
case CL_ENULLARG: |
|
|
|
switch (ret) { |
|
|
|
cli_warnmsg("cli_scanpe: NULL argument supplied\n"); |
|
|
|
case CL_ENULLARG: |
|
|
|
break; |
|
|
|
cli_warnmsg("cli_scanpe: NULL argument supplied\n"); |
|
|
|
case CL_VIRUS: |
|
|
|
|
|
|
|
if (SCAN_ALL) |
|
|
|
|
|
|
|
break; |
|
|
|
break; |
|
|
|
/* intentional fall-through */ |
|
|
|
case CL_VIRUS: |
|
|
|
case CL_BREAK: |
|
|
|
if (SCAN_ALL) |
|
|
|
free(exe_sections); |
|
|
|
break; |
|
|
|
return ret == CL_VIRUS ? CL_VIRUS : CL_CLEAN; |
|
|
|
/* intentional fall-through */ |
|
|
|
|
|
|
|
case CL_BREAK: |
|
|
|
|
|
|
|
free(exe_sections); |
|
|
|
|
|
|
|
return ret == CL_VIRUS ? CL_VIRUS : CL_CLEAN; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
/* Attempt to detect some popular polymorphic viruses */ |
|
|
|
/* Attempt to detect some popular polymorphic viruses */ |
|
|
|
|
|
|
|
|
|
|
|