mirror of
https://github.com/upx/upx
synced 2025-09-28 19:06:07 +08:00
Win64 updates.
committer: mfx <mfx> 1060086924 +0000
This commit is contained in:
parent
5125f4d4ac
commit
9e154e33c3
|
@ -1,3 +1,4 @@
|
||||||
|
B
|
||||||
ChangeLog.cvs*
|
ChangeLog.cvs*
|
||||||
build
|
build
|
||||||
doxygen
|
doxygen
|
||||||
|
|
2
NEWS
2
NEWS
|
@ -7,7 +7,7 @@ User visible changes for UPX
|
||||||
[ WARNING: there are known bugs in the win32/pe format which cause
|
[ WARNING: there are known bugs in the win32/pe format which cause
|
||||||
crashes on a number of exes ]
|
crashes on a number of exes ]
|
||||||
|
|
||||||
Changes in 1.91 beta (XX Mar 2003):
|
Changes in 1.91 beta (XX Sep 2003):
|
||||||
* UNSTABLE BETA VERSION - DO NOT USE EXCEPT FOR TESTING
|
* UNSTABLE BETA VERSION - DO NOT USE EXCEPT FOR TESTING
|
||||||
* djgpp2/coff: added support for recent binutils versions
|
* djgpp2/coff: added support for recent binutils versions
|
||||||
* watcom/le: don't crash on files without relocations
|
* watcom/le: don't crash on files without relocations
|
||||||
|
|
|
@ -13,6 +13,7 @@ GNUmakefile
|
||||||
.gdbinit
|
.gdbinit
|
||||||
.Attic
|
.Attic
|
||||||
.deps
|
.deps
|
||||||
|
B
|
||||||
compress_nrv.*
|
compress_nrv.*
|
||||||
upx
|
upx
|
||||||
upx_nrv
|
upx_nrv
|
||||||
|
|
101
src/Makefile.bld
101
src/Makefile.bld
|
@ -260,7 +260,7 @@ endif
|
||||||
|
|
||||||
|
|
||||||
###
|
###
|
||||||
### dos32 - djgpp2
|
### dos32 - djgpp2 / emx
|
||||||
###
|
###
|
||||||
|
|
||||||
ifeq ($(target),djgpp2)
|
ifeq ($(target),djgpp2)
|
||||||
|
@ -275,7 +275,16 @@ ifneq ($(strip $(wildcard $(DJDIR)/bin/cwsdstub.ex[eE])),)
|
||||||
STUBIFY_EXE = mfxdjstubify -v -s $(DJDIR)/bin/cwsdstub.exe $@
|
STUBIFY_EXE = mfxdjstubify -v -s $(DJDIR)/bin/cwsdstub.exe $@
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
endif # djgpp2
|
endif
|
||||||
|
|
||||||
|
ifeq ($(target),emx)
|
||||||
|
include $(srcdir)/Makedefs.gcc
|
||||||
|
e = .exe
|
||||||
|
CXX = gcc
|
||||||
|
CFLAGS_O = -O2
|
||||||
|
CCARCH += -mno-probe
|
||||||
|
LDFLAGS = -s
|
||||||
|
endif
|
||||||
|
|
||||||
|
|
||||||
###
|
###
|
||||||
|
@ -284,6 +293,7 @@ endif # djgpp2
|
||||||
|
|
||||||
ifeq ($(target),cygwin)
|
ifeq ($(target),cygwin)
|
||||||
include $(srcdir)/Makedefs.gcc
|
include $(srcdir)/Makedefs.gcc
|
||||||
|
##CXX = g++-2
|
||||||
e = .exe
|
e = .exe
|
||||||
CCARCH += -mcygwin -march=i386 -mcpu=i686
|
CCARCH += -mcygwin -march=i386 -mcpu=i686
|
||||||
endif
|
endif
|
||||||
|
@ -501,7 +511,7 @@ endif # vc
|
||||||
|
|
||||||
|
|
||||||
###
|
###
|
||||||
### win32 - Watcom C++ 11.0c / Open Watcom C++ 1.0
|
### win32 - Watcom C++
|
||||||
###
|
###
|
||||||
|
|
||||||
ifeq ($(target),wc)
|
ifeq ($(target),wc)
|
||||||
|
@ -509,6 +519,7 @@ o = .obj
|
||||||
a = .lib
|
a = .lib
|
||||||
e = .exe
|
e = .exe
|
||||||
CC = wcl386 -zq -bt=nt -mf -5r
|
CC = wcl386 -zq -bt=nt -mf -5r
|
||||||
|
##CC = wcl386 -zq -bt=dos -l=CauseWay -mf -5r
|
||||||
CFLAGS = -zc -w5 -we
|
CFLAGS = -zc -w5 -we
|
||||||
CXXFLAGS = $(CFLAGS) -xs -xr
|
CXXFLAGS = $(CFLAGS) -xs -xr
|
||||||
CFLAGS_OUTPUT = -fo=$@
|
CFLAGS_OUTPUT = -fo=$@
|
||||||
|
@ -538,6 +549,90 @@ endif
|
||||||
endif # wc
|
endif # wc
|
||||||
|
|
||||||
|
|
||||||
|
###
|
||||||
|
### win64 - Intel C++
|
||||||
|
###
|
||||||
|
|
||||||
|
ifeq ($(target),win64-ic)
|
||||||
|
o = .obj
|
||||||
|
a = .lib
|
||||||
|
e = .exe
|
||||||
|
CC = ecl -nologo
|
||||||
|
CFLAGS = -W3
|
||||||
|
CXXFLAGS = $(CFLAGS) -EHac -GR
|
||||||
|
LDFLAGS =
|
||||||
|
LINK_EXE_OUTPUT = -Fe$@
|
||||||
|
LINK_EXE_LDFLAGS = /link /map:$T.map
|
||||||
|
##LINK_EXE_LDFLAGS += /verbose
|
||||||
|
|
||||||
|
ifneq ($(strip $(DOS_LIBDIRS)),)
|
||||||
|
LIB := $(DOS_LIBDIRS);$(LIB)
|
||||||
|
endif
|
||||||
|
export LIB
|
||||||
|
|
||||||
|
ifeq (1,2)
|
||||||
|
# statically link libc.lib
|
||||||
|
CC += -ML
|
||||||
|
LDLIBS = $(DOS_LDLIBS:.lib=_ml.lib) setargv.obj
|
||||||
|
else
|
||||||
|
# link against msvcrt.dll
|
||||||
|
CC += -MD
|
||||||
|
LDLIBS = $(DOS_LDLIBS) setargv.obj
|
||||||
|
endif
|
||||||
|
ifeq ($(DEBUG),1)
|
||||||
|
CFLAGS += -Od -ZI
|
||||||
|
LINK_EXE_LDFLAGS += /debug
|
||||||
|
else
|
||||||
|
CFLAGS += -O1 -GF
|
||||||
|
LINK_EXE_LDFLAGS += /release
|
||||||
|
endif
|
||||||
|
RESOURCES := $(subst .rc,.res,$(notdir $(wildcard $(srcdir)/*.rc)))
|
||||||
|
|
||||||
|
endif # win64-ic
|
||||||
|
|
||||||
|
|
||||||
|
###
|
||||||
|
### win64 - Visual C++
|
||||||
|
###
|
||||||
|
|
||||||
|
ifeq ($(target),win64-vc)
|
||||||
|
o = .obj
|
||||||
|
a = .lib
|
||||||
|
e = .exe
|
||||||
|
CC = cl -nologo
|
||||||
|
CFLAGS = -W4
|
||||||
|
CXXFLAGS = $(CFLAGS) -EHac -GR
|
||||||
|
LDFLAGS =
|
||||||
|
LINK_EXE_OUTPUT = -Fe$@
|
||||||
|
LINK_EXE_LDFLAGS = /link /map:$T.map
|
||||||
|
##LINK_EXE_LDFLAGS += /verbose
|
||||||
|
|
||||||
|
ifneq ($(strip $(DOS_LIBDIRS)),)
|
||||||
|
LIB := $(DOS_LIBDIRS);$(LIB)
|
||||||
|
endif
|
||||||
|
export LIB
|
||||||
|
|
||||||
|
ifeq (1,1)
|
||||||
|
# statically link libc.lib
|
||||||
|
CC += -ML
|
||||||
|
LDLIBS = $(DOS_LDLIBS:.lib=_ml.lib) setargv.obj
|
||||||
|
else
|
||||||
|
# link against msvcrt.dll
|
||||||
|
CC += -MD
|
||||||
|
LDLIBS = $(DOS_LDLIBS) setargv.obj
|
||||||
|
endif
|
||||||
|
ifeq ($(DEBUG),1)
|
||||||
|
CFLAGS += -Od -ZI
|
||||||
|
LINK_EXE_LDFLAGS += /debug
|
||||||
|
else
|
||||||
|
CFLAGS += -O1 -GF
|
||||||
|
LINK_EXE_LDFLAGS += /release
|
||||||
|
endif
|
||||||
|
RESOURCES := $(subst .rc,.res,$(notdir $(wildcard $(srcdir)/*.rc)))
|
||||||
|
|
||||||
|
endif # win64-vc
|
||||||
|
|
||||||
|
|
||||||
# /***********************************************************************
|
# /***********************************************************************
|
||||||
# // malloc debuggers and memory checkers - somewhat obsolete, use valgrind
|
# // malloc debuggers and memory checkers - somewhat obsolete, use valgrind
|
||||||
# ************************************************************************/
|
# ************************************************************************/
|
||||||
|
|
|
@ -43,9 +43,6 @@
|
||||||
#include "acc/acc_incd.h"
|
#include "acc/acc_incd.h"
|
||||||
#include "acc/acc_ince.h"
|
#include "acc/acc_ince.h"
|
||||||
#include "acc/acc_lib.h"
|
#include "acc/acc_lib.h"
|
||||||
#if !defined(acc_int64l_t) || !defined(acc_uint64l_t)
|
|
||||||
# error "need a 64-bit integer type"
|
|
||||||
#endif
|
|
||||||
#if (ACC_OS_WIN32 || ACC_OS_WIN64)
|
#if (ACC_OS_WIN32 || ACC_OS_WIN64)
|
||||||
# if defined(INVALID_HANDLE_VALUE) || defined(MAKEWORD) || defined(RT_CURSOR)
|
# if defined(INVALID_HANDLE_VALUE) || defined(MAKEWORD) || defined(RT_CURSOR)
|
||||||
# error "something pulled in <windows.h>"
|
# error "something pulled in <windows.h>"
|
||||||
|
@ -54,8 +51,8 @@
|
||||||
|
|
||||||
|
|
||||||
#if (ACC_CC_BORLANDC)
|
#if (ACC_CC_BORLANDC)
|
||||||
# if (__BORLANDC__ < 0x0520)
|
# if (__BORLANDC__ < 0x0500)
|
||||||
# error "need Borland C++ 5.02 or newer"
|
# error "need Borland C++ 5.0 or newer"
|
||||||
# endif
|
# endif
|
||||||
# pragma warn -aus // 8004: 'x' is assigned a value that is never used
|
# pragma warn -aus // 8004: 'x' is assigned a value that is never used
|
||||||
# pragma warn -inl // 8026+8027: Function not expanded inline
|
# pragma warn -inl // 8026+8027: Function not expanded inline
|
||||||
|
|
|
@ -1018,7 +1018,6 @@ void upx_sanity_check(void)
|
||||||
COMPILE_TIME_ASSERT(sizeof(int) == 4)
|
COMPILE_TIME_ASSERT(sizeof(int) == 4)
|
||||||
COMPILE_TIME_ASSERT(sizeof(long) >= 4)
|
COMPILE_TIME_ASSERT(sizeof(long) >= 4)
|
||||||
COMPILE_TIME_ASSERT(sizeof(void *) >= 4)
|
COMPILE_TIME_ASSERT(sizeof(void *) >= 4)
|
||||||
COMPILE_TIME_ASSERT(sizeof(long) >= sizeof(void *))
|
|
||||||
|
|
||||||
COMPILE_TIME_ASSERT(sizeof(off_t) >= sizeof(long))
|
COMPILE_TIME_ASSERT(sizeof(off_t) >= sizeof(long))
|
||||||
COMPILE_TIME_ASSERT(((off_t) -1) < 0)
|
COMPILE_TIME_ASSERT(((off_t) -1) < 0)
|
||||||
|
|
|
@ -92,7 +92,7 @@ void PackLinuxI386sh::patchLoader() { }
|
||||||
bool PackLinuxI386sh::getShellName(char *buf)
|
bool PackLinuxI386sh::getShellName(char *buf)
|
||||||
{
|
{
|
||||||
exetype = -1;
|
exetype = -1;
|
||||||
l_shname = strcspn(buf, " \t\n\v\f\r");
|
l_shname = (int) strcspn(buf, " \t\n\v\f\r");
|
||||||
buf[l_shname] = 0;
|
buf[l_shname] = 0;
|
||||||
static char const *const shname[] = { // known shells that accept "-c" arg
|
static char const *const shname[] = { // known shells that accept "-c" arg
|
||||||
"ash", "bash", "bsh", "csh", "ksh", "pdksh", "sh", "tcsh", "zsh",
|
"ash", "bash", "bsh", "csh", "ksh", "pdksh", "sh", "tcsh", "zsh",
|
||||||
|
|
|
@ -910,7 +910,7 @@ unsigned Packer::unoptimizeReloc32(upx_byte **in, upx_byte *image,
|
||||||
}
|
}
|
||||||
//fprintf(stderr,"relocnum=%x\n",relocn);
|
//fprintf(stderr,"relocnum=%x\n",relocn);
|
||||||
*in = p+1;
|
*in = p+1;
|
||||||
return relocs - outp;
|
return (unsigned) (relocs - outp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -710,7 +710,7 @@ static size_t dopr(char *buffer, size_t maxlen, const char *format, va_list args
|
||||||
break;
|
break;
|
||||||
case 'p':
|
case 'p':
|
||||||
strvalue = (const char *) va_arg (args, const void *);
|
strvalue = (const char *) va_arg (args, const void *);
|
||||||
fmtint (buffer, &currlen, maxlen, (long) strvalue, 16, min, max, flags);
|
fmtint (buffer, &currlen, maxlen, (LLONG) (acc_uintptr_t) strvalue, 16, min, max, flags);
|
||||||
break;
|
break;
|
||||||
case 'n':
|
case 'n':
|
||||||
if (cflags == DP_C_SHORT) {
|
if (cflags == DP_C_SHORT) {
|
||||||
|
|
|
@ -538,7 +538,15 @@ unsigned get_ratio(unsigned u_len, unsigned c_len)
|
||||||
const unsigned n = 1000000;
|
const unsigned n = 1000000;
|
||||||
if (u_len <= 0)
|
if (u_len <= 0)
|
||||||
return c_len <= 0 ? 0 : n;
|
return c_len <= 0 ? 0 : n;
|
||||||
|
#if defined(acc_uint64l_t)
|
||||||
return (unsigned) ((c_len * (acc_uint64l_t)n) / u_len);
|
return (unsigned) ((c_len * (acc_uint64l_t)n) / u_len);
|
||||||
|
#else
|
||||||
|
# if 0
|
||||||
|
return (unsigned) acc_umuldiv32(c_len, n, u_len);
|
||||||
|
# else
|
||||||
|
return (unsigned) ((c_len * (double)n) / u_len);
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user