git-svn: trunk@2522
Tomasz Kojm authored on 2006/11/27 19:38:52... | ... |
@@ -1,3 +1,7 @@ |
1 |
+Mon Nov 27 11:37:18 CET 2006 (tk) |
|
2 |
+--------------------------------- |
|
3 |
+ * libclamav/pe.c: use unaligned section's virtual size in Magistr detection |
|
4 |
+ |
|
1 | 5 |
Sun Nov 26 23:28:59 CET 2006 (acab) |
2 | 6 |
----------------------------------- |
3 | 7 |
* libclamav/pe.c: Stuff forgotten in my previous commit |
... | ... |
@@ -631,6 +631,7 @@ int cli_scanpe(int desc, cli_ctx *ctx) |
631 | 631 |
sname[8] = 0; |
632 | 632 |
exe_sections[i].rva = PEALIGN(EC32(section_hdr[i].VirtualAddress), valign); |
633 | 633 |
exe_sections[i].vsz = PESALIGN(EC32(section_hdr[i].VirtualSize), valign); |
634 |
+ exe_sections[i].uvsz = EC32(section_hdr[i].VirtualSize); |
|
634 | 635 |
exe_sections[i].raw = PEALIGN(EC32(section_hdr[i].PointerToRawData), falign); |
635 | 636 |
exe_sections[i].rsz = PESALIGN(EC32(section_hdr[i].SizeOfRawData), falign); |
636 | 637 |
if (exe_sections[i].rsz && fsize>exe_sections[i].raw && !CLI_ISCONTAINED(0, (uint32_t) fsize, exe_sections[i].raw, exe_sections[i].rsz)) |
... | ... |
@@ -856,7 +857,7 @@ int cli_scanpe(int desc, cli_ctx *ctx) |
856 | 856 |
uint32_t rsize, vsize; |
857 | 857 |
|
858 | 858 |
rsize = exe_sections[nsections - 1].rsz; |
859 |
- vsize = exe_sections[nsections - 1].vsz; |
|
859 |
+ vsize = exe_sections[nsections - 1].uvsz; |
|
860 | 860 |
|
861 | 861 |
if(rsize >= 0x612c && vsize >= 0x612c && ((vsize & 0xff) == 0xec)) { |
862 | 862 |
int bw = rsize < 0x7000 ? rsize : 0x7000; |