Prepared for first GUI version.

committer: mfx <mfx> 968541447 +0000
This commit is contained in:
Markus F.X.J. Oberhumer 2000-09-09 23:17:27 +00:00
parent 679fabef25
commit 4e6fc92d8a
12 changed files with 67 additions and 23 deletions

View File

@ -0,0 +1,3 @@
.cvsignore
.mfxcvsup
maint

6
THANKS
View File

@ -23,6 +23,8 @@ Adam Ierymenko <api@one.net>
for severals ideas for the Linux version
Andi Kleen <ak@muc.de> and Jamie Lokier <nospam@cern.ch>
for the /proc/self/fd/X and other Linux suggestions
Andreas Muegge <andreas.muegge@gmx.de>
for the Win32 GUI
Atli Mar Gudmundsson <amg@complex.is>
for several comments on the win32/pe stub
Charles W. Sandmann <sandmann@clio.rice.edu>
@ -31,6 +33,8 @@ Ice
for debugging the PE headersize problem down
Joergen Ibsen <jibz@hotmail.com> and d'b
for the relocation & address optimization ideas
John F. Reiser <jreiser@BitWagon.com>
for the new Linux executable formats
John S. Fine <johnfine@erols.com>
for the new version of the dos/exe decompressor
Lukundoo <Lukundoo@softhome.net>
@ -45,8 +49,6 @@ Salvador Eduardo Tropea
for beta testing
The WINE project (http://www.winehq.com/)
for lots of useful information found in their PE loader sources
DJ Delorie <dj@delorie.com> for djgpp
Linus for Linux
Natascha
Everybody else who was kind enough to spend time testing UPX, use it in

View File

@ -3,7 +3,7 @@ SHELL = /bin/sh
top_srcdir = ..
PACKAGE = upx
VERSION_DATE = 10 May 2000
VERSION_DATE = 10 Sep 2000
VERSION := $(shell sed -n 's/^.*UPX_VERSION_STRING.*"\(.*\)".*/\1/p' $(top_srcdir)/src/version.h)
TRIMSPACE = cat

View File

@ -15,7 +15,6 @@ B<upx> S<[ I<command> ]> S<[ I<options> ]> I<filename>...
The Ultimate Packer for eXecutables
Copyright (c) 1996-2000 Markus Oberhumer & Laszlo Molnar
http://wildsau.idv.uni-linz.ac.at/mfx/upx.html
http://www.nexus.hu/upx
http://upx.tsx.org
@ -222,7 +221,7 @@ For example:
for csh/tcsh: setenv UPX "-9 --compress-icons=1"
Under DOS/Windows you must use '#' instead of '=' when setting the
environment variable because of a command.com limitation.
environment variable because of a COMMAND.COM limitation.
On Vax/VMS, the name of the environment variable is
UPX_OPT, to avoid a conflict with the symbol set for
@ -345,7 +344,7 @@ How it works:
May 2000), and transfers control to the program interpreter or
the e_entry address of the original executable.
For shell script executables (files beginning with "#!/" or "#! /")
For shell script executables (files beginning with "#!/" or "#! /")
where the shell is known to accept "-c <command>", UPX decompresses
the file into low memory, then maps the shell (and its PT_INTERP),
and passes control to the shell with the entire decompressed file

View File

@ -50,8 +50,10 @@
#endif
// just in case
#undef NDEBUG
#undef dos
#undef linux
#undef small
#undef tos
#undef unix
@ -503,7 +505,7 @@ struct options_t {
bool le;
} wcle;
struct {
bool compress_exports;
int compress_exports;
int compress_icons;
bool compress_resources;
int strip_relocs;
@ -515,6 +517,7 @@ extern struct options_t * volatile opt;
// main.cpp
extern const char *progname;
void init_options(struct options_t *o);
bool set_ec(int ec);
#if defined(__GNUC__)
void e_exit(int ec) __attribute__((noreturn));
@ -527,6 +530,7 @@ void e_exit(int ec);
void printSetNl(int need_nl);
void printClearLine(FILE *f = NULL);
void printErr(const char *iname, const Throwable *e);
void printUnhandledException(const char *iname, const exception *e);
#if defined(__GNUC__)
void printErr(const char *iname, const char *format, ...)
__attribute__((format(printf,2,3)));

View File

@ -37,6 +37,10 @@
#undef USE_SCREEN_CURSES
#undef USE_FRAMES
#if defined(WITH_GUI) && !defined(NO_CONSOLE)
# define NO_CONSOLE
#endif
#if 1 && defined(__linux__)
# define USE_SCREEN
# define USE_SCREEN_VCSA

View File

@ -238,7 +238,6 @@ con_fprintf(f,
con_fprintf(f,
" http://upx.tsx.org\n"
" http://wildsau.idv.uni-linz.ac.at/mfx/upx.html\n"
" http://www.nexus.hu/upx\n"
);
(void)con_fg(f,FG_ORANGE);
con_fprintf(f,
@ -260,10 +259,10 @@ void show_version(int x)
UNUSED(x);
fprintf(f,"upx %s\n",UPX_VERSION_STRING);
#if defined(WITH_UCL)
fprintf(f,"UCL data compression library %s\n", ucl_version_string());
#elif defined(WITH_NRV)
#if defined(WITH_NRV)
fprintf(f,"NRV data compression library %s\n", nrv_version_string());
#elif defined(WITH_UCL)
fprintf(f,"UCL data compression library %s\n", ucl_version_string());
#endif
fprintf(f,"Copyright (C) 1996,1997,1998,1999,2000 Markus Franz Xaver Johannes Oberhumer\n");
fprintf(f,"Copyright (C) 1996,1997,1998,1999,2000 Laszlo Molnar\n");

View File

@ -34,7 +34,7 @@
// options
**************************************************************************/
static void init_options(struct options_t *o)
void init_options(struct options_t *o)
{
memset(o, 0, sizeof(*o));
memset(&o->crp, 0xff, sizeof(o->crp));
@ -51,7 +51,7 @@ static void init_options(struct options_t *o)
o->console = CON_INIT;
o->verbose = 2;
o->w32pe.compress_exports = true;
o->w32pe.compress_exports = 1;
o->w32pe.compress_icons = 2;
o->w32pe.compress_resources = true;
o->w32pe.strip_relocs = -1;
@ -608,9 +608,8 @@ static int do_option(int optc, const char *arg)
opt->wcle.le = true;
break;
case 630:
opt->w32pe.compress_exports = true;
if (mfx_optarg && strcmp(mfx_optarg,"0") == 0)
opt->w32pe.compress_exports = false;
opt->w32pe.compress_exports = 1;
getoptvar(&opt->w32pe.compress_exports, 0, 1);
//printf("compress_exports: %d\n", opt->w32pe.compress_exports);
break;
case 631:
@ -977,6 +976,8 @@ void upx_sanity_check(void)
// main entry point
**************************************************************************/
#if !defined(WITH_GUI)
int main(int argc, char *argv[])
{
int i;
@ -1127,6 +1128,8 @@ int main(int argc, char *argv[])
return exit_code;
}
#endif /* !defined(WITH_GUI) */
/*
vi:ts=4:et:nowrap

View File

@ -145,6 +145,19 @@ void printWarn(const char *iname, const char *format, ...)
}
void printUnhandledException(const char *iname, const exception *e)
{
if (e)
printErr(iname,"unhandled exception: %s\n", prettyName(e->what()));
else
printErr(iname,"internal error: unhandled exception!\n");
if (opt->cmd != CMD_COMPRESS)
{
printErr(iname," this file has possibly been modified/hacked; take care!\n");
}
}
/*************************************************************************
// FIXME: should use colors and a consistent layout here
**************************************************************************/
@ -208,7 +221,10 @@ void info(const char *format, ...)
void infoWarning(const char *format, ...)
{
if (opt->info_mode <= 0)
{
// FIXME - should still print something here
return;
}
va_list args;
char buf[1024];
va_start(args,format);

View File

@ -33,6 +33,10 @@ class OutputFile;
class Packer;
class UiPacker;
#if defined(WITH_GUI)
class CMainDlg;
#endif
/*************************************************************************
//
@ -104,6 +108,10 @@ protected:
static long update_u_len;
static long update_fc_len;
static long update_fu_len;
#if defined(WITH_GUI)
CMainDlg* pMain;
#endif
};

View File

@ -1,2 +1,2 @@
#define UPX_VERSION_STRING "1.09.2"
#define UPX_VERSION_DATE "May 13th 2000"
#define UPX_VERSION_STRING "1.09.3"
#define UPX_VERSION_DATE "Sep 10th 2000"

View File

@ -65,7 +65,7 @@ void do_one_file(const char *iname, char *oname)
if (r == -1)
throw FileNotFoundException(iname);
if (!S_ISREG(st.st_mode))
if (!(S_ISREG(st.st_mode)))
throwIOException("not a regular file -- skipped");
#if defined(__unix__)
// no special bits may be set
@ -124,7 +124,7 @@ void do_one_file(const char *iname, char *oname)
int omode = 0600;
fo.sopen(tname,flags,shmode,omode);
#endif
// open succeeded - set oname
// open succeeded - now set oname[]
strcpy(oname,tname);
}
}
@ -177,6 +177,8 @@ void do_one_file(const char *iname, char *oname)
// make backup
char bakname[PATH_MAX+1];
makebakname(bakname,iname);
if (file_exists(bakname))
maketempname(bakname,iname,".000",1);
File::rename(iname,bakname);
}
File::rename(oname,iname);
@ -213,6 +215,8 @@ void do_one_file(const char *iname, char *oname)
// process all files from the commandline
**************************************************************************/
#if !defined(WITH_GUI)
void do_files(int i, int argc, char *argv[])
{
if (opt->verbose >= 1)
@ -247,19 +251,19 @@ void do_files(int i, int argc, char *argv[])
e_exit(EXIT_ERROR);
//throw;
} catch (const exception &e) {
printErr(iname,"unhandled exception: %s\n", prettyName(e.what()));
printUnhandledException(iname,&e);
if (oname[0])
(void) ::unlink(oname);
e_exit(EXIT_ERROR);
//throw;
} catch (const exception *e) {
printErr(iname,"unhandled exception: %s\n", prettyName(e->what()));
printUnhandledException(iname,e);
if (oname[0])
(void) ::unlink(oname);
e_exit(EXIT_ERROR);
//throw;
} catch (...) {
printErr(iname,"internal error: unhandled exception !\n");
printUnhandledException(iname,NULL);
if (oname[0])
(void) ::unlink(oname);
e_exit(EXIT_ERROR);
@ -284,6 +288,8 @@ void do_files(int i, int argc, char *argv[])
UiPacker::uiFileInfoTotal();
}
#endif /* !defined(WITH_GUI) */
/*
vi:ts=4:et