vmlinuz/i386 support.

committer: ml1050 <ml1050> 976714560 +0000
This commit is contained in:
László Molnár
2000-12-13 13:36:00 +00:00
parent c9430123d1
commit de30026bbe
7 changed files with 416 additions and 5 deletions
+7 -1
View File
@@ -33,7 +33,8 @@ STUBS = \
l_w32pe.h \
l_lx_n2b.h l_lx_n2d.h \
l_le_n2b.h l_le_n2d.h \
l_sh_n2b.h l_sh_n2d.h
l_sh_n2b.h l_sh_n2d.h \
l_vmlinz.h
# util var for use in the rules - basename of the current target
@@ -196,6 +197,10 @@ l_w32pe.h: l_w32pe.asx
$(NASM) -f bin -o $T.bin $<
$(BIN2H) $T.bin nrv_loader $@
l_vmlinz.h: l_vmlinz.asx
$(NASM) -f bin -o $T.bin $<
$(BIN2H) $T.bin nrv_loader $@
# /***********************************************************************
# // linux rules (exec, elf, sh, sep)
@@ -299,6 +304,7 @@ l_tmt.h: n2b_d32.asy n2d_d32.asy $(DEPS2)
l_vxd.h: n2b_d32.asy n2d_d32.asy $(DEPS2)
l_wcle.h: n2b_d32.asy n2d_d32.asy $(DEPS2)
l_w32pe.h: n2b_d32.asy n2d_d32.asy $(DEPS2)
l_vmlinz.h: n2b_d32.asy n2d_d32.asy $(DEPS2)
l_xe_n2b.o: n2b_d32.ash $(DEPS1)
l_6e_n2b.o: n2b_d32.ash $(DEPS1)
+111
View File
@@ -0,0 +1,111 @@
; l_vmlinz.asm -- loader & decompressor for the vmlinuz/i386 format
;
; This file is part of the UPX executable compressor.
;
; Copyright (C) 1996-2000 Markus Franz Xaver Johannes Oberhumer
; Copyright (C) 1996-2000 Laszlo Molnar
; All Rights Reserved.
;
; UPX and the UCL library are free software; you can redistribute them
; and/or modify them under the terms of the GNU General Public License as
; published by the Free Software Foundation; either version 2 of
; the License, or (at your option) any later version.
;
; This program is distributed in the hope that it will be useful,
; but WITHOUT ANY WARRANTY; without even the implied warranty of
; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
; GNU General Public License for more details.
;
; You should have received a copy of the GNU General Public License
; along with this program; see the file COPYING.
; If not, write to the Free Software Foundation, Inc.,
; 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
;
; Markus F.X.J. Oberhumer Laszlo Molnar
; markus.oberhumer@jk.uni-linz.ac.at ml1050@cdata.tvnet.hu
;
%define jmps jmp short
%define jmpn jmp near
%include "macros.ash"
BITS 32
SECTION .text
ORG 0
; =============
; ============= ENTRY POINT
; =============
start:
; __LINUZ000__
cli
xor eax, eax
mov al, 0x18
mov ds, eax
mov es, eax
mov ss, eax
mov esp, 'STAK' ; 0x90000
mov eax, 'KEIP' ; 0x100000 - address of startup_32
push eax
push edi
push esi
or ebp, byte -1
%ifdef __LBZIMAGE__
mov esi, 'ESI0'
mov edi, 'EDI0'
mov ecx, 'ECX0'
std
rep
movsd
cld
mov esi, 'ESI1'
xchg eax, edi
jmp .1 + 'JMPD' ; jump to the copied decompressor
.1:
%else; __LZIMAGE0__
cld
mov esi, 'ESI1'
xchg eax, edi
; this checka20 stuff looks very unneccessary to me
checka20:
inc eax
mov [ebp + 1], eax
cmp [edi], eax
je checka20
%endif; __LZCUTPOI__
; =============
; ============= DECOMPRESSION
; =============
%include "n2b_d32.ash"
%include "n2d_d32.ash"
; =============
; __LINUZ990__
pop esi
pop edi
xor ebx, ebx ; booting the 1st cpu
retn
; =============
; ============= CUT HERE
; =============
%include "header.ash"
eof:
; __LITHEEND__
section .data
dd -1
dw eof