~ubuntu-branches/ubuntu/feisty/clamav/feisty

« back to all changes in this revision

Viewing changes to libclamav/elf.h

  • Committer: Bazaar Package Importer
  • Author(s): Kees Cook
  • Date: 2007-02-20 10:33:44 UTC
  • mto: This revision was merged to the branch mainline in revision 16.
  • Revision ID: james.westby@ubuntu.com-20070220103344-zgcu2psnx9d98fpa
Tags: upstream-0.90
ImportĀ upstreamĀ versionĀ 0.90

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
 
 *  Copyright (C) 2007-2009 Sourcefire, Inc.
 
2
 *  Copyright (C) 2005 - 2006 Tomasz Kojm <tkojm@clamav.net>
3
3
 *
4
 
 *  Authors: Tomasz Kojm
 
4
 *  Header structures based on ELF: Executable and Linkable Format, Portable
 
5
 *  Formats Specification, Version 1.1
5
6
 *
6
7
 *  This program is free software; you can redistribute it and/or modify
7
 
 *  it under the terms of the GNU General Public License version 2 as
8
 
 *  published by the Free Software Foundation.
 
8
 *  it under the terms of the GNU General Public License as published by
 
9
 *  the Free Software Foundation; either version 2 of the License, or
 
10
 *  (at your option) any later version.
9
11
 *
10
12
 *  This program is distributed in the hope that it will be useful,
11
13
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
25
27
#include "clamav.h"
26
28
#include "execs.h"
27
29
#include "others.h"
28
 
#include "fmap.h"
29
30
 
30
31
struct elf_file_hdr32 {
31
32
    unsigned char e_ident[16];
44
45
    uint16_t e_shstrndx;
45
46
};
46
47
 
47
 
struct elf_file_hdr64 {
48
 
    unsigned char e_ident[16];
49
 
    uint16_t e_type;
50
 
    uint16_t e_machine;
51
 
    uint32_t e_version;
52
 
    uint64_t e_entry;
53
 
    uint64_t e_phoff;
54
 
    uint64_t e_shoff;
55
 
    uint32_t e_flags;
56
 
    uint16_t e_ehsize;
57
 
    uint16_t e_phentsize;
58
 
    uint16_t e_phnum;
59
 
    uint16_t e_shentsize;
60
 
    uint16_t e_shnum;
61
 
    uint16_t e_shstrndx;
62
 
};
63
 
 
64
48
struct elf_program_hdr32 {
65
49
    uint32_t p_type;
66
50
    uint32_t p_offset;
72
56
    uint32_t p_align;
73
57
};
74
58
 
75
 
struct elf_program_hdr64 {
76
 
    uint32_t p_type;
77
 
    uint32_t p_flags;
78
 
    uint64_t p_offset;
79
 
    uint64_t p_vaddr;
80
 
    uint64_t p_paddr;
81
 
    uint64_t p_filesz;
82
 
    uint64_t p_memsz;
83
 
    uint64_t p_align;
84
 
};
85
 
 
86
59
struct elf_section_hdr32 {
87
60
    uint32_t sh_name;
88
61
    uint32_t sh_type;
96
69
    uint32_t sh_entsize;
97
70
};
98
71
 
99
 
struct elf_section_hdr64 {
100
 
    uint32_t sh_name;
101
 
    uint32_t sh_type;
102
 
    uint64_t sh_flags;
103
 
    uint64_t sh_addr;
104
 
    uint64_t sh_offset;
105
 
    uint64_t sh_size;
106
 
    uint32_t sh_link;
107
 
    uint32_t sh_info;
108
 
    uint64_t sh_addralign;
109
 
    uint64_t sh_entsize;
110
 
};
111
 
 
112
 
int cli_scanelf(cli_ctx *ctx);
113
 
 
114
 
int cli_elfheader(fmap_t *map, struct cli_exe_info *elfinfo);
 
72
int cli_scanelf(int desc, cli_ctx *ctx);
 
73
 
 
74
int cli_elfheader(int desc, struct cli_exe_info *elfinfo);
115
75
 
116
76
#endif