Implement de-compress of --android-shlib
64-bit (arm64, aarch64) only for now. NYI: 32-bit (armv7). (Also: implied catch-up with all changes by Markus in the meantime.) https://github.com/upx/upx/issues/599 modified: src/p_lx_elf.cpp modified: src/p_lx_elf.h
This commit is contained in:
+7
-6
@@ -84,6 +84,7 @@ protected:
|
||||
unsigned lg2_page; // log2(PAGE_SIZE)
|
||||
unsigned page_size; // 1u<<lg2_page
|
||||
bool is_pie; // is Position-Independent-Executable (ET_DYN main program)
|
||||
unsigned is_asl; // is Android Shared Library
|
||||
unsigned xct_off; // shared library: file offset of SHT_EXECINSTR
|
||||
unsigned hatch_off; // file offset of escape hatch
|
||||
unsigned o_binfo; // offset to first b_info
|
||||
@@ -91,6 +92,7 @@ protected:
|
||||
upx_uint64_t xct_va; // minimum SHT_EXECINSTR virtual address
|
||||
upx_uint64_t jni_onload_va; // runtime &JNI_OnLoad
|
||||
upx_uint64_t user_init_va;
|
||||
upx_uint64_t plt_va, plt_off;
|
||||
unsigned user_init_off; // within file_image
|
||||
unsigned linfo_off;
|
||||
unsigned loader_offset; // during de-compression
|
||||
@@ -106,6 +108,7 @@ protected:
|
||||
|
||||
MemBuffer mb_shstrtab; // via ElfXX_Shdr
|
||||
char const *shstrtab;
|
||||
MemBuffer jump_slots; // is_asl de-compression fixing
|
||||
MemBuffer buildid_data;
|
||||
MemBuffer note_body; // concatenated contents of PT_NOTEs, if any
|
||||
unsigned note_size; // total size of PT_NOTEs
|
||||
@@ -287,12 +290,10 @@ protected:
|
||||
unsigned old_dtinit,
|
||||
Elf64_Phdr const *phdro,
|
||||
Elf64_Phdr const *dynhdr, // in phdri
|
||||
OutputFile *fo,
|
||||
unsigned is_asl
|
||||
OutputFile *fo
|
||||
);
|
||||
virtual void unRela64(upx_uint64_t dt_rela, Elf64_Rela *rela0, unsigned relasz,
|
||||
MemBuffer &membuf, upx_uint64_t const load_off, upx_uint64_t const old_dtinit,
|
||||
OutputFile *fo);
|
||||
upx_uint64_t const old_dtinit, OutputFile *fo);
|
||||
|
||||
virtual void generateElfHdr(
|
||||
OutputFile *,
|
||||
@@ -319,13 +320,14 @@ protected:
|
||||
Elf64_Phdr const *elf_find_ptype(unsigned type, Elf64_Phdr const *phdr0, unsigned phnum);
|
||||
Elf64_Shdr const *elf_find_section_name(char const *) const;
|
||||
Elf64_Shdr const *elf_find_section_type(unsigned) const;
|
||||
int is_LOAD64(Elf64_Phdr const *phdr) const; // beware confusion with (1+ LO_PROC)
|
||||
upx_uint64_t check_pt_load(Elf64_Phdr const *);
|
||||
upx_uint64_t check_pt_dynamic(Elf64_Phdr const *);
|
||||
void invert_pt_dynamic(Elf64_Dyn const *, upx_uint64_t dt_filesz);
|
||||
void const *elf_find_dynamic(unsigned) const;
|
||||
Elf64_Dyn const *elf_has_dynamic(unsigned) const;
|
||||
virtual upx_uint64_t elf_unsigned_dynamic(unsigned) const override;
|
||||
virtual int adjABS(Elf64_Sym *sym, unsigned delta);
|
||||
virtual int adjABS(Elf64_Sym *sym, unsigned long delta);
|
||||
|
||||
char const *get_str_name(unsigned st_name, unsigned symnum) const;
|
||||
char const *get_dynsym_name(unsigned symnum, unsigned relnum) const;
|
||||
@@ -340,7 +342,6 @@ protected:
|
||||
upx_uint64_t sz_dynseg; // PT_DYNAMIC.p_memsz
|
||||
upx_uint64_t so_slide;
|
||||
unsigned n_jmp_slot;
|
||||
upx_uint64_t plt_off;
|
||||
upx_uint64_t page_mask; // AND clears the offset-within-page
|
||||
|
||||
Elf64_Dyn const *dynseg; // from PT_DYNAMIC
|
||||
|
||||
Reference in New Issue
Block a user