Cleaned up the Linux C stub loaders by putting more stuff into linux.hh.

committer: mfx <mfx> 962045590 +0000
This commit is contained in:
Markus F.X.J. Oberhumer
2000-06-26 18:53:10 +00:00
parent 957ef351c4
commit 51b162f069
10 changed files with 150 additions and 116 deletions
+17 -2
View File
@@ -55,9 +55,15 @@
// !!! must be the same as in p_unix.h !!!
#define OVERHEAD 2048
#define UPX_MAGIC_LE32 0x21585055 // "UPX!"
// patch constants for our loader (le32 format)
#define UPX1 0x31585055 // "UPX1"
#define UPX2 0x32585055 // "UPX2"
#define UPX3 0x33585055 // "UPX4"
#define UPX4 0x34585055 // "UPX4"
#define UPX5 0x35585055 // "UPX5"
#undef int32_t
#undef uint32_t
@@ -74,13 +80,15 @@ typedef unsigned int nrv_uint32;
// From ../p_unix.h
struct l_info { // 12-byte trailer in header for loader
struct l_info // 12-byte trailer in header for loader (offset 116)
{
uint32_t l_checksum;
uint32_t l_magic;
uint16_t l_lsize;
uint8_t l_version;
uint8_t l_format;
};
struct p_info // 12-byte packed program header follows stub loader
{
uint32_t p_progid;
@@ -89,6 +97,13 @@ struct p_info // 12-byte packed program header follows stub loader
};
#define SEEK_SET 0
#define SEEK_CUR 1
#define PAGE_MASK (~0u<<12) // discards the offset, keeps the page
#define PAGE_SIZE ( 1u<<12)
/*************************************************************************
// syscalls
//