/src/upx/src/p_w64pe_arm64.h
Line | Count | Source |
1 | | /* p_w64pe_arm64.h -- |
2 | | |
3 | | This file is part of the UPX executable compressor. |
4 | | |
5 | | Copyright (C) Markus Franz Xaver Johannes Oberhumer |
6 | | Copyright (C) Laszlo Molnar |
7 | | All Rights Reserved. |
8 | | |
9 | | UPX and the UCL library are free software; you can redistribute them |
10 | | and/or modify them under the terms of the GNU General Public License as |
11 | | published by the Free Software Foundation; either version 2 of |
12 | | the License, or (at your option) any later version. |
13 | | |
14 | | This program is distributed in the hope that it will be useful, |
15 | | but WITHOUT ANY WARRANTY; without even the implied warranty of |
16 | | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
17 | | GNU General Public License for more details. |
18 | | |
19 | | You should have received a copy of the GNU General Public License |
20 | | along with this program; see the file COPYING. |
21 | | If not, write to the Free Software Foundation, Inc., |
22 | | 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
23 | | |
24 | | Markus F.X.J. Oberhumer Laszlo Molnar |
25 | | <markus@oberhumer.com> <ezerotven+github@gmail.com> |
26 | | */ |
27 | | |
28 | | #pragma once |
29 | | |
30 | | /************************************************************************* |
31 | | // win64/arm64 |
32 | | **************************************************************************/ |
33 | | |
34 | | class PackW64PeArm64 : public PeFile64 { |
35 | | typedef PeFile64 super; |
36 | | |
37 | | public: |
38 | | explicit PackW64PeArm64(InputFile *f); |
39 | 0 | virtual ~PackW64PeArm64() noexcept {} |
40 | 85.5k | virtual int getFormat() const override { return UPX_F_W64PE_ARM64; } |
41 | 0 | virtual const char *getName() const override { return "win64/arm64"; } |
42 | 0 | virtual const char *getFullName(const Options *) const override { return "arm64-win64.pe"; } |
43 | | virtual const int *getCompressionMethods(int method, int level) const override; |
44 | | virtual const int *getFilters() const override; |
45 | | |
46 | | virtual bool needForceOption() const override; |
47 | | virtual void addStubImports() override; |
48 | | virtual void defineSymbols(unsigned ncsection, unsigned upxsection, unsigned isize_isplit, |
49 | | unsigned s1addr) override; |
50 | 0 | virtual void setOhDataBase(const pe_section_t *) override {} |
51 | | virtual void setOhHeaderSize(const pe_section_t *osection) override; |
52 | | virtual void pack(OutputFile *fo) override; |
53 | | |
54 | | virtual tribool canPack() override; |
55 | | |
56 | | protected: |
57 | | virtual void buildLoader(const Filter *ft) override; |
58 | | virtual Linker *newLinker() const override; |
59 | | }; |
60 | | |
61 | | /************************************************************************* |
62 | | // win64/arm64ec |
63 | | // |
64 | | // TODO: it is unclear yet if this should be made a subclass |
65 | | // or just get merged into the base class using a flag; |
66 | | // maybe the difference between arm64 and arm64ec does not really affect us |
67 | | **************************************************************************/ |
68 | | |
69 | | class PackW64PeArm64EC final : public PackW64PeArm64 { |
70 | | typedef PackW64PeArm64 super; |
71 | | |
72 | | public: |
73 | 0 | explicit PackW64PeArm64EC(InputFile *f) : super(f) {} |
74 | 0 | virtual int getFormat() const override { return UPX_F_W64PE_ARM64EC; } |
75 | 0 | virtual const char *getName() const override { return "win64/arm64ec"; } |
76 | 0 | virtual const char *getFullName(const Options *) const override { return "arm64ec-win64.pe"; } |
77 | | |
78 | | virtual tribool canPack() override; |
79 | | }; |
80 | | |
81 | | /* vim:set ts=4 sw=4 et: */ |