From 09eb201b76a8e9c12caeace2c48a53278f4eeca2 Mon Sep 17 00:00:00 2001 From: "Markus F.X.J. Oberhumer" Date: Thu, 21 Dec 2000 19:07:41 +0000 Subject: [PATCH] *** empty log message *** committer: mfx 977425661 +0000 --- src/packmast.cpp | 47 ++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 44 insertions(+), 3 deletions(-) diff --git a/src/packmast.cpp b/src/packmast.cpp index d2ba255f..2747f6c0 100644 --- a/src/packmast.cpp +++ b/src/packmast.cpp @@ -31,11 +31,12 @@ #include "packmast.h" #include "packer.h" #include "lefile.h" +#include "p_elf.h" + #include "p_com.h" #include "p_djgpp2.h" #include "p_exe.h" #include "p_unix.h" -#include "p_elf.h" #include "p_lx_exc.h" #include "p_lx_elf.h" #include "p_lx_sep.h" @@ -173,6 +174,14 @@ static Packer* try_packers(InputFile *f, try_function func) if ((p = func(new PackTos(f),f)) != NULL) return p; + // + // linux kernel + // + if ((p = func(new PackBvmlinuzI386(f),f)) != NULL) + return p; + if ((p = func(new PackVmlinuzI386(f),f)) != NULL) + return p; + // // linux // @@ -187,9 +196,41 @@ static Packer* try_packers(InputFile *f, try_function func) return p; if ((p = func(new PackLinuxI386sh(f),f)) != NULL) return p; - if ((p = func(new PackBvmlinuzI386(f),f)) != NULL) + if ((p = func(new PackLinuxI386(f),f)) != NULL) return p; - if ((p = func(new PackVmlinuzI386(f),f)) != NULL) + + // + // .sys and .com + // + if ((p = func(new PackSys(f),f)) != NULL) + return p; + if ((p = func(new PackCom(f),f)) != NULL) + return p; + return NULL; +} + + +static Packer *getPacker(InputFile *f) +{ + Packer *p = try_packers(f, try_pack); + if (!p) + throwUnknownExecutableFormat(); + return p; +} + + +static Packer *getUnpacker(InputFile *f) +{ +#if 0 + if (opt->unix.script_name) + { + if ((p = func(new PackLinuxI386sep(f),f)) != NULL) + return p; + } +#endif + if ((p = func(new PackLinuxI386elf(f),f)) != NULL) + return p; + if ((p = func(new PackLinuxI386sh(f),f)) != NULL) return p; if ((p = func(new PackLinuxI386(f),f)) != NULL) return p;