From 4854c0309639095d88a7947fa6284de36e6dbb4d Mon Sep 17 00:00:00 2001 From: John Reiser Date: Sat, 6 Jan 2018 09:33:04 -0800 Subject: [PATCH] uint64_t ==> upx_uint64_t MSVC error C2065: 'uint64_t' : undeclared identifier modified: p_lx_elf.cpp modified: p_lx_elf.h modified: p_mach.cpp --- src/p_lx_elf.cpp | 6 +++--- src/p_lx_elf.h | 2 +- src/p_mach.cpp | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/p_lx_elf.cpp b/src/p_lx_elf.cpp index 18ea008d..2b73823d 100644 --- a/src/p_lx_elf.cpp +++ b/src/p_lx_elf.cpp @@ -3838,11 +3838,11 @@ PackLinuxElf64::elf_has_dynamic(unsigned int key) const return 0; } -uint64_t // checked .p_offset; sz_dynseg set +upx_uint64_t // checked .p_offset; sz_dynseg set PackLinuxElf64::check_pt_dynamic(Elf64_Phdr const *const phdr) { - uint64_t t = get_te64(&phdr->p_offset), s = sizeof(Elf64_Dyn) + t; - uint64_t filesz = get_te64(&phdr->p_filesz), memsz = get_te64(&phdr->p_memsz); + upx_uint64_t t = get_te64(&phdr->p_offset), s = sizeof(Elf64_Dyn) + t; + upx_uint64_t filesz = get_te64(&phdr->p_filesz), memsz = get_te64(&phdr->p_memsz); if (s < t || (uint64_t)file_size < s || (7 & t) || (0xf & (filesz | memsz)) // .balign 8; 16==sizeof(Elf64_Dyn) || filesz < sizeof(Elf64_Dyn) diff --git a/src/p_lx_elf.h b/src/p_lx_elf.h index 326efcb9..9d31b560 100644 --- a/src/p_lx_elf.h +++ b/src/p_lx_elf.h @@ -274,7 +274,7 @@ 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; - uint64_t check_pt_dynamic(Elf64_Phdr const *); + upx_uint64_t check_pt_dynamic(Elf64_Phdr const *); void const *elf_find_dynamic(unsigned) const; Elf64_Dyn const *elf_has_dynamic(unsigned) const; virtual upx_uint64_t elf_unsigned_dynamic(unsigned) const; diff --git a/src/p_mach.cpp b/src/p_mach.cpp index a41a2e27..010fa74d 100644 --- a/src/p_mach.cpp +++ b/src/p_mach.cpp @@ -1320,10 +1320,10 @@ void PackMachBase::pack1(OutputFile *const fo, Filter &/*ft*/) // generate e segLINK.nsects = 0; segLINK.initprot = Mach_command::VM_PROT_READ; // Adjust later: .vmaddr .vmsize .fileoff .filesize - uint64_t up(0); + upx_uint64_t up(0); unsigned const ncmds = mhdri.ncmds; for (unsigned j= 0; j < ncmds; ++j) if (lc_seg == msegcmd[j].cmd) { - uint64_t sup = msegcmd[j].vmsize + msegcmd[j].vmaddr; + upx_uint64_t sup = msegcmd[j].vmsize + msegcmd[j].vmaddr; if (up < sup) { up = sup; segLINK.vmsize = sup - segLINK.vmaddr;