1
0
mirror of https://github.com/upx/upx synced 2025-09-28 19:06:07 +08:00

Added some constants and options for win32/pe resource types.

committer: mfx <mfx> 981585673 +0000
This commit is contained in:
Markus F.X.J. Oberhumer 2001-02-07 22:41:13 +00:00
parent 79aff4c12d
commit 2c9f6b28f7
2 changed files with 28 additions and 10 deletions

View File

@ -328,7 +328,7 @@ typedef RETSIGTYPE (SIGTYPEENTRY *sig_type)(int);
#undef UNUSED
#if 1
# define UNUSED(var) { typedef int __upx_unused[sizeof(var) ? 2 : 1]; }
# define UNUSED(var) { typedef int __upx_unused[sizeof(var) ? 1 : -1]; }
#elif 1
# define UNUSED(var) do { } while (!sizeof(var))
#elif defined(__BORLANDC__)
@ -432,6 +432,22 @@ inline void operator delete[](void *p)
#include "unupx.h"
// options - command
enum {
CMD_NONE,
CMD_COMPRESS, CMD_DECOMPRESS, CMD_TEST, CMD_LIST, CMD_FILEINFO,
CMD_HELP, CMD_LICENSE, CMD_VERSION
};
// win32/pe resource types
enum {
RT_CURSOR = 1, RT_BITMAP, RT_ICON, RT_MENU, RT_DIALOG, RT_STRING,
RT_FONTDIR, RT_FONT, RT_ACCELERATOR, RT_RCDATA, RT_MESSAGE_TABLE,
RT_GROUP_CURSOR, RT_GROUP_ICON = 14, RT_VERSION = 16, RT_DLGINCLUDE,
RT_PLUGPLAY = 19, RT_VXD, RT_ANICURSOR, RT_ANIICON, RT_HTML,
RT_LAST
};
#if defined(__cplusplus)
@ -441,13 +457,6 @@ inline void operator delete[](void *p)
#include "util.h"
#include "console.h"
// options
enum {
CMD_NONE,
CMD_COMPRESS, CMD_DECOMPRESS, CMD_TEST, CMD_LIST, CMD_FILEINFO,
CMD_HELP, CMD_LICENSE, CMD_VERSION
};
struct options_t {
int cmd;
@ -526,7 +535,8 @@ struct options_t {
struct {
int compress_exports;
int compress_icons;
bool compress_resources;
int compress_resources;
signed char compress_rt[RT_LAST];
int strip_relocs;
} w32pe;
};

View File

@ -33,6 +33,12 @@
#include "packer.h"
#if 1 && defined(__DJGPP__)
#include <crt0.h>
int _crt0_startup_flags = _CRT0_FLAG_UNIX_SBRK;
#endif
/*************************************************************************
// options
**************************************************************************/
@ -60,7 +66,9 @@ void init_options(struct options_t *o)
o->w32pe.compress_exports = 1;
o->w32pe.compress_icons = 2;
o->w32pe.compress_resources = true;
o->w32pe.compress_resources = -1;
for (int i = 0; i < RT_LAST; i++)
opt->w32pe.compress_rt[i] = -1;
o->w32pe.strip_relocs = -1;
}