1 /*
2  *  Copyright (C) 2013-2022 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
3  *  Copyright (C) 2007-2013 Sourcefire, Inc.
4  *
5  *  Authors: Luciano Giuseppe 'Pnluck', Alberto Wu
6  *
7  *  This program is free software; you can redistribute it and/or modify
8  *  it under the terms of the GNU General Public License version 2 as
9  *  published by the Free Software Foundation.
10  *
11  *  This program is distributed in the hope that it will be useful,
12  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  *  GNU General Public License for more details.
15  *
16  *  You should have received a copy of the GNU General Public License
17  *  along with this program; if not, write to the Free Software
18  *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
19  *  MA 02110-1301, USA.
20  */
21 
22 #ifndef __ASPACK_H
23 #define __ASPACK_H
24 
25 #include "clamav-types.h"
26 #include "execs.h"
27 
28 #define ASPACK_EP_OFFSET_212 (58 + 0x70e)
29 #define ASPACK_EP_OFFSET_OTHER (58 + 0x76a)
30 #define ASPACK_EP_OFFSET_242 (58 + 0x776)
31 
32 #define ASPACK_EPBUFF_OFFSET_212 (0x3b9)
33 #define ASPACK_EPBUFF_OFFSET_OTHER (0x41f)
34 #define ASPACK_EPBUFF_OFFSET_242 (0x42B)
35 
36 typedef enum aspack_version_tag {
37     ASPACK_VER_NONE = 0,
38     ASPACK_VER_212,
39     ASPACK_VER_OTHER,
40     ASPACK_VER_242
41 } aspack_version_t;
42 
43 int unaspack(uint8_t *image, unsigned int size, struct cli_exe_section *sections, uint16_t sectcount, uint32_t ep, uint32_t base, int f, aspack_version_t version);
44 
45 #endif
46