Coverage Report

Created: 2025-08-26 06:10

/src/upx/src/p_lx_sh.h
Line
Count
Source (jump to first uncovered line)
1
/* p_lx_sh.h --
2
3
   This file is part of the UPX executable compressor.
4
5
   Copyright (C) 1996-2025 Markus Franz Xaver Johannes Oberhumer
6
   Copyright (C) 1996-2025 Laszlo Molnar
7
   Copyright (C) 2000-2025 John F. Reiser
8
   All Rights Reserved.
9
10
   UPX and the UCL library are free software; you can redistribute them
11
   and/or modify them under the terms of the GNU General Public License as
12
   published by the Free Software Foundation; either version 2 of
13
   the License, or (at your option) any later version.
14
15
   This program is distributed in the hope that it will be useful,
16
   but WITHOUT ANY WARRANTY; without even the implied warranty of
17
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18
   GNU General Public License for more details.
19
20
   You should have received a copy of the GNU General Public License
21
   along with this program; see the file COPYING.
22
   If not, write to the Free Software Foundation, Inc.,
23
   59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
24
25
   Markus F.X.J. Oberhumer              Laszlo Molnar
26
   <markus@oberhumer.com>               <ezerotven+github@gmail.com>
27
28
   John F. Reiser
29
   <jreiser@users.sourceforge.net>
30
 */
31
32
33
#pragma once
34
#ifndef __UPX_P_LX_SH_H  //{
35
#define __UPX_P_LX_SH_H 1
36
37
38
/*************************************************************************
39
// linux/sh386
40
**************************************************************************/
41
42
class PackLinuxI386sh : public PackLinuxI386
43
{
44
    typedef PackLinuxI386 super;
45
public:
46
    PackLinuxI386sh(InputFile *f);
47
    virtual ~PackLinuxI386sh();
48
16.3k
    virtual int getVersion() const override { return 13; }
49
16.3k
    virtual int getFormat() const override { return UPX_F_LINUX_SH_i386; }
50
4
    virtual const char *getName() const override { return "linux.sh/i386"; }
51
0
    virtual const char *getFullName(const options_t *) const override { return "i386-linux.elf.shell"; }
52
0
    virtual const int *getFilters() const override { return nullptr; }
53
    virtual void buildLoader(const Filter *) override;
54
55
    virtual void pack1(OutputFile *fo, Filter &ft) override;
56
    virtual off_t pack3(OutputFile *fo, Filter &ft) override;
57
58
    virtual tribool canPack() override;
59
    // virtual void unpack(OutputFile *fo) { super::unpack(fo); }
60
    virtual bool canUnpackVersion(int version) const override
61
3.22k
        { return (version >= 11); }
62
63
protected:
64
    virtual bool getShellName(char *buf);
65
66
    virtual void patchLoader() override;
67
68
    int o_shname;  // offset to name_of_shell
69
    int l_shname;  // length of name_of_shell
70
};
71
72
73
#endif /*} already included */
74
75
/* vim:set ts=4 sw=4 et: */