1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
|
$NetBSD: patch-ac,v 1.1 2004/09/16 16:12:57 he Exp $
--- hdn_exe.c.orig Wed May 26 21:42:44 2004
+++ hdn_exe.c
@@ -40,7 +40,7 @@ static char _is_valid_exe (uint8_t *bin)
memcpy (&dos_hdr, bin, sizeof (IMAGE_DOS_HEADER));
if (dos_hdr.e_magic != IMAGE_DOS_SIGNATURE)
{
- HDN_WARN ("Host file is not in PE format: DOS sig mismatch");
+ HDN_WARN ("Host file is not in PE format: DOS sig mismatch", "");
return 0;
}
@@ -51,7 +51,7 @@ static char _is_valid_exe (uint8_t *bin)
if (nt_sig != IMAGE_NT_SIGNATURE)
{
- HDN_WARN ("Host file is not in PE format: NT sig mismatch");
+ HDN_WARN ("Host file is not in PE format: NT sig mismatch", "");
return 0;
}
@@ -66,7 +66,7 @@ static int _is_valid_exe (uint8_t *bin)
/* make sure this is in elf format */
if (memcmp (ehdr->e_ident, magic, sizeof magic))
{
- HDN_WARN ("Host file is not in ELF format");
+ HDN_WARN ("Host file is not in ELF format", "");
return 0;
}
@@ -74,32 +74,32 @@ static int _is_valid_exe (uint8_t *bin)
if (ehdr->e_ident[EI_CLASS] != ELFCLASS32 ||
ehdr->e_ident[EI_DATA ] != ELFDATA2LSB)
{
- HDN_WARN ("Host file is not in elf32 lsb format");
+ HDN_WARN ("Host file is not in elf32 lsb format", "");
return 0;
}
/* make sure this is indeed an executable */
if (ehdr->e_type != ET_EXEC)
{
- HDN_WARN ("Host file is not an executable");
+ HDN_WARN ("Host file is not an executable", "");
return 0;
}
if (!ehdr->e_phoff)
{
- HDN_WARN ("Host file has no ELF program header");
+ HDN_WARN ("Host file has no ELF program header", "");
return 0;
}
if (!ehdr->e_shoff)
{
- HDN_WARN ("Host file has no ELF section header");
+ HDN_WARN ("Host file has no ELF section header", "");
return 0;
}
if (ehdr->e_shstrndx == SHN_UNDEF)
{
- HDN_WARN ("Host file has no section name string table");
+ HDN_WARN ("Host file has no section name string table", "");
return 0;
}
@@ -203,7 +203,7 @@ hdn_sections_t *hdn_exe_get_sections (ui
}
if (!sections)
- HDN_WARN ("couldn't find any sections in the PE file!");
+ HDN_WARN ("couldn't find any sections in the PE file!", "");
return sections;
}
|