[Pkg-clamav-commits] [SCM] Debian repository for ClamAV branch, debian/unstable, updated. debian/0.95+dfsg-1-6156-g094ec9b
aCaB
acab at clamav.net
Sun Apr 4 01:13:48 UTC 2010
The following commit has been merged in the debian/unstable branch:
commit 1e7afd202bc877f016b532e52e62a78b8c4787e7
Author: aCaB <acab at clamav.net>
Date: Tue Jan 5 02:04:14 2010 +0100
fix debug printf
diff --git a/libclamav/matcher-ac.c b/libclamav/matcher-ac.c
index 9423c63..afb63ff 100644
--- a/libclamav/matcher-ac.c
+++ b/libclamav/matcher-ac.c
@@ -1077,11 +1077,11 @@ int cli_ac_scanbuff(const unsigned char *buffer, uint32_t length, const char **v
}
realoff = offset + bp - pt->prefix_length;
if(patt->offdata[0] == CLI_OFF_VERSION) {
- cli_errmsg("CHECK: %x\n", realoff);
if(!cli_hashset_contains_maybe_noalloc(&mdata->vinfo, realoff)) {
pt = pt->next_same;
continue;
}
+ cli_dbgmsg("cli_ac_scanbuff: VI match for offset %x\n", realoff);
} else if(pt->offset_min != CLI_OFF_ANY && (!pt->sigid || pt->partno == 1)) {
if(pt->offset_min == CLI_OFF_NONE) {
pt = pt->next_same;
diff --git a/libclamav/pe.c b/libclamav/pe.c
index 19771b9..79d39f3 100644
--- a/libclamav/pe.c
+++ b/libclamav/pe.c
@@ -201,7 +201,7 @@ struct vinfo_list {
int versioninfo_cb(void *opaque, uint32_t type, uint32_t name, uint32_t lang, uint32_t rva) {
struct vinfo_list *vlist = (struct vinfo_list *)opaque;
- cli_errmsg("versioninfo_cb: type: %x, name: %x, lang: %x, rva: %x\n", type, name, lang, rva);
+ cli_dbgmsg("versioninfo_cb: type: %x, name: %x, lang: %x, rva: %x\n", type, name, lang, rva);
vlist->rvas[vlist->count] = rva;
if(++vlist->count == sizeof(vlist->rvas) / sizeof(vlist->rvas[0]))
return 1;
@@ -2432,7 +2432,7 @@ int cli_peheader(fmap_t *map, struct cli_exe_info *peinfo)
err = 0;
for(i=0; i<vlist.count; i++) { /* enum all version_information res - RESUMABLE */
- cli_dbgmsg("cli_peheader: parsing version info @ rva %x\n", vlist.rvas[i]);
+ cli_dbgmsg("cli_peheader: parsing version info @ rva %x (%u/%u)\n", vlist.rvas[i], i+1, vlist.count);
rva = cli_rawaddr(vlist.rvas[i], peinfo->section, peinfo->nsections, &err, fsize, hdr_size);
if(err)
continue;
@@ -2506,7 +2506,6 @@ int cli_peheader(fmap_t *map, struct cli_exe_info *peinfo)
while(st_sz > 6) { /* enum all strings - RESUMABLE */
uint32_t s_sz, s_key_sz, s_val_sz;
- char *k, *v;
s_sz = s_val_sz = cli_readint32(vptr);
s_sz &= 0xffff;
@@ -2549,16 +2548,21 @@ int cli_peheader(fmap_t *map, struct cli_exe_info *peinfo)
return -1;
}
- cli_errmsg("ADD %x\n", (uint32_t)(vptr - baseptr + 6));
if(cli_debug_flag) {
- /* FIXME: pretty print an usable VI-sig */
+ char *k, *v, *s;
+
+ /* FIXME: skip too long strings */
k = cli_utf16toascii(vptr + 6, s_key_sz);
if(k) {
s_key_sz += 6 + 3;
s_key_sz &= ~3;
v = cli_utf16toascii(vptr + s_key_sz, s_val_sz);
if(v) {
- cli_errmsg("VersionInfo: '%s' = '%s'\n", k, v);
+ s = cli_str2hex(vptr + 6, s_key_sz + s_val_sz - 6);
+ if(s) {
+ cli_dbgmsg("VersionInfo (%x): '%s'='%s' - VI:%s\n", vptr - baseptr + 6, k, v, s);
+ free(s);
+ }
free(v);
}
free(k);
--
Debian repository for ClamAV
More information about the Pkg-clamav-commits
mailing list