diff --git a/src/.cvsignore b/src/.cvsignore index a511de0b..5cae640d 100644 --- a/src/.cvsignore +++ b/src/.cvsignore @@ -1,4 +1,6 @@ *.0?? +*.idb +*.pdb *.upx .gdbinit upx diff --git a/src/Makefile b/src/Makefile index 27b1f55a..c887003d 100644 --- a/src/Makefile +++ b/src/Makefile @@ -16,7 +16,7 @@ ifeq ($(strip $(UCLDIR)),) UCLDIR = $(HOME)/local/src/ucl-0.91 endif -DEBUG = 1 +DEBUG = 0 # ------------------------------------------------------- @@ -242,7 +242,7 @@ o = .obj a = .lib CC = cl -nologo CFLAGS = -W4 -CXXFLAGS1 = $(CFLAGS) -GX -GR +CXXFLAGS1 = $(CFLAGS) -GR -GX -EHa CXXFLAGS2 = $(CFLAGS) LDFLAGS = LINK_LDFLAGS = /link /map:$(basename $@).map @@ -253,7 +253,7 @@ endif export LIB ifeq (1,2) - # statically link libc + # statically link libc.lib CC += -ML ##LDLIBS = $(u)_s.lib zlib_s.lib setargv.obj LDLIBS = $(u)_s.lib setargv.obj @@ -267,7 +267,7 @@ ifeq ($(DEBUG),1) CFLAGS += -Od -ZI LINK_LDFLAGS += /debug else - CFLAGS += -O2 -Gs -GF + CFLAGS += -O2 -GF LINK_LDFLAGS += /release endif @@ -321,7 +321,8 @@ CXXFLAGS1 = $(CFLAGS) CXXFLAGS2 = $(CFLAGS) CFLAGS_OUTPUT = -o$@ LDFLAGS = -LDLIBS = $(u).lib zlib.lib +##LDLIBS = $(u).lib zlib.lib +LDLIBS = $(u).lib ifneq ($(strip $(wildcard $(UDIR))),) LIB := $(UDIR);$(LIB) @@ -389,6 +390,7 @@ mostlyclean: clean: mostlyclean -rm -f *.a *.lib *.o *.obj tags TAGS ID + -rm -f *.idb *.pdb -rm -f upx upx.exe upx_nrv upx_nrv.exe upx_ucl upx_ucl.exe distclean: clean diff --git a/src/lefile.h b/src/lefile.h index 82e0954d..28f651a3 100644 --- a/src/lefile.h +++ b/src/lefile.h @@ -211,6 +211,11 @@ protected: unsigned sononres_names; unsigned soimage; unsigned soentries; + +private: + // disable copy and assignment + LeFile(LeFile const &); // {} + LeFile& operator= (LeFile const &); // { return *this; } }; diff --git a/src/mem.cpp b/src/mem.cpp index a7434430..b7fc6363 100644 --- a/src/mem.cpp +++ b/src/mem.cpp @@ -33,7 +33,7 @@ // **************************************************************************/ -MemBuffer::MemBuffer(unsigned size=0) : +MemBuffer::MemBuffer(unsigned size) : ptr(NULL), alloc_ptr(NULL), alloc_size(0) { if (size > 0) diff --git a/src/p_lx_elf.cpp b/src/p_lx_elf.cpp index 39e840d0..cc1343ae 100644 --- a/src/p_lx_elf.cpp +++ b/src/p_lx_elf.cpp @@ -446,7 +446,7 @@ void PackLinuxI386elf::unpack(OutputFile *fo) off_t ptload0hi=0, ptload1lo=0; // decompress PT_LOAD - fi->seek(-(2*4 + ph.c_len), SEEK_CUR); + fi->seek(- (off_t) (2*4 + ph.c_len), SEEK_CUR); for (unsigned j=0; j < ehdr->e_phnum; ++phdr, ++j) { if (PT_LOAD==phdr->p_type) { if (0==ptload0hi) { diff --git a/src/p_unix.cpp b/src/p_unix.cpp index eac09cd8..697910ed 100644 --- a/src/p_unix.cpp +++ b/src/p_unix.cpp @@ -471,7 +471,7 @@ void PackLinuxI386::patchLoaderChecksum() // checksum for loader + p_info lp->l_checksum = 0; // (this checksum is currently unused) lp->l_magic = UPX_ELF_MAGIC; - lp->l_lsize = lsize; + lp->l_lsize = (unsigned short) lsize; lp->l_version = (unsigned char) ph.version; lp->l_format = (unsigned char) ph.format; unsigned adler = upx_adler32(0,NULL,0); diff --git a/src/p_wcle.cpp b/src/p_wcle.cpp index be6c6ab7..0eb9a955 100644 --- a/src/p_wcle.cpp +++ b/src/p_wcle.cpp @@ -434,7 +434,7 @@ void PackWcle::pack(OutputFile *fo) const unsigned calltrickoffset = ft.cto << 24; // attach some useful data at the end of preprocessed fixups - ifixups[sofixups++] = ih.automatic_data_object; + ifixups[sofixups++] = (unsigned char) ih.automatic_data_object; unsigned ic = objects*sizeof(*iobject_table); memcpy(ifixups+sofixups,iobject_desc,ic); iobject_desc.free(); diff --git a/src/packer.h b/src/packer.h index 0e970e4c..62c2116e 100644 --- a/src/packer.h +++ b/src/packer.h @@ -243,6 +243,11 @@ private: // private to checkPatch() void *last_patch; long last_patch_offset; + +private: + // disable copy and assignment + Packer(Packer const &); // {} + Packer& operator= (Packer const &); // { return *this; } }; diff --git a/src/tailor.h b/src/tailor.h index 9fb2500c..73bfef01 100644 --- a/src/tailor.h +++ b/src/tailor.h @@ -154,6 +154,7 @@ # define vsnprintf _vsnprintf //# pragma warning(once: 4097 4710) # pragma warning(disable: 4097 4710) +# pragma warning(disable: 4511 4512) # endif #elif defined(__WATCOMC__) # define __UPX_CDECL __cdecl