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

Clean up stub sources.

This commit is contained in:
Markus F.X.J. Oberhumer 2006-11-16 19:36:13 +01:00
parent db7ae4ed5d
commit 99374de340
23 changed files with 260 additions and 41 deletions

View File

@ -29,10 +29,8 @@
* <jreiser@users.sourceforge.net>
*/
//#include "arch/i386/macros2.ash"
#include "arch/amd64/macros.S"
#include "arch/amd64/regs.h"
#define section .section
sz_Ehdr= 64
sz_Phdr= 56

View File

@ -27,7 +27,7 @@
* <jreiser@users.sourceforge.net>
*/
.code64
#include "arch/amd64/macros.S"
#include "arch/amd64/regs.h"
PAGE_SHIFT= 12

View File

@ -0,0 +1,38 @@
/*
; macros.S --
;
; This file is part of the UPX executable compressor.
;
; Copyright (C) 1996-2006 Markus Franz Xaver Johannes Oberhumer
; Copyright (C) 1996-2006 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
; <mfx@users.sourceforge.net> <ml1050@users.sourceforge.net>
;
*/
//.altmacro
.code64
.macro section name
.section \name
.code64
.endm
// vi:ts=8:et:nowrap

View File

@ -0,0 +1,37 @@
/*
; macros.S --
;
; This file is part of the UPX executable compressor.
;
; Copyright (C) 1996-2006 Markus Franz Xaver Johannes Oberhumer
; Copyright (C) 1996-2006 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
; <mfx@users.sourceforge.net> <ml1050@users.sourceforge.net>
;
*/
.altmacro
.arm
.macro section name
.section \name
.endm
// vi:ts=8:et:nowrap

View File

@ -0,0 +1,43 @@
/*
; macros.S --
;
; This file is part of the UPX executable compressor.
;
; Copyright (C) 1996-2006 Markus Franz Xaver Johannes Oberhumer
; Copyright (C) 1996-2006 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
; <mfx@users.sourceforge.net> <ml1050@users.sourceforge.net>
;
*/
.altmacro
.arm
.macro section name
.section \name
.endm
// in thumb mode we need this S() macro hack to export a symbol which
// is used in a ldr statement
#define S(sym) .globl sym; sym: .L##sym
// vi:ts=8:et:nowrap

View File

@ -1,5 +1,5 @@
/*
; macros.ash --
; macros.S --
;
; This file is part of the UPX executable compressor.
;
@ -27,8 +27,9 @@
;
*/
.code16
.altmacro
.intel_syntax noprefix
.code16
.macro section name
.section \name

View File

@ -39,9 +39,6 @@
; ecx - 0
*/
// CPU 386
//
// init
section LZMA_DEC00
@ -140,6 +137,8 @@ section LZMA_ELF00
push ebx // &CLzmaDecoderState
push eax // return address slot (dummy CALL)
//#undef O_OUTS
//#undef O_INS
section LZMA_DEC10

View File

@ -1,5 +1,5 @@
/*
; macros.ash --
; macros.S --
;
; This file is part of the UPX executable compressor.
;
@ -27,8 +27,9 @@
;
*/
.code32
.altmacro
.intel_syntax noprefix
.code32
.macro section name
.section \name
@ -125,6 +126,7 @@
*/
.macro cjt32 addvalue
local calltrickloop
section CALLTR00
mov ecx, offset filter_length
calltrickloop:

View File

@ -40,17 +40,16 @@
; ecx - 0
*/
// CPU 386
.macro getbit_n2b one
local l1
.ifc \one, 1
add ebx, ebx
jnz 1f
jnzs l1
.endif
mov ebx, [esi]
sub esi, -4
adc ebx, ebx
1:
l1:
.endm
#undef getbit

View File

@ -40,18 +40,16 @@
; ecx - 0
*/
// CPU 386
.macro getbit_n2d one
local l1
.ifc \one, 1
add ebx, ebx
jnz 1f
jnzs l1
.endif
mov ebx, [esi]
sub esi, -4
adc ebx, ebx
1:
l1:
.endm
#undef getbit

View File

@ -40,17 +40,16 @@
; ecx - 0
*/
// CPU 386
.macro getbit_n2e one
.ifc \one, 1
local l1
.ifc \one, 1
add ebx, ebx
jnz 1f
.endif
jnzs l1
.endif
mov ebx, [esi]
sub esi, -4
adc ebx, ebx
1:
l1:
.endm
#undef getbit

View File

@ -0,0 +1,36 @@
/*
; macros.S --
;
; This file is part of the UPX executable compressor.
;
; Copyright (C) 1996-2006 Markus Franz Xaver Johannes Oberhumer
; Copyright (C) 1996-2006 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
; <mfx@users.sourceforge.net> <ml1050@users.sourceforge.net>
;
*/
.altmacro
.macro section name
.section \name
.endm
// vi:ts=8:et:nowrap

View File

@ -0,0 +1,36 @@
/*
; macros.S --
;
; This file is part of the UPX executable compressor.
;
; Copyright (C) 1996-2006 Markus Franz Xaver Johannes Oberhumer
; Copyright (C) 1996-2006 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
; <mfx@users.sourceforge.net> <ml1050@users.sourceforge.net>
;
*/
//.altmacro
.macro section name
.section \name
.endm
// vi:ts=8:et:nowrap

View File

@ -28,7 +28,8 @@
* John F. Reiser
* <jreiser@users.sourceforge.net>
*/
#define section .section
#include "arch/arm/v4a/macros.S"
#define bkpt .long 0xe1200070
sz_Elf32_Ehdr = 13*4

View File

@ -27,6 +27,8 @@
@ <jreiser@users.sourceforge.net>
@
#include "arch/arm/v4a/macros.S"
sz_Elf32_Ehdr = 13*4
sz_Elf32_Phdr = 8*4
sz_l_info = 12

View File

@ -29,6 +29,8 @@
<jreiser@users.sourceforge.net>
*/
#include "arch/arm/v4a/macros.S"
// DEBUG == 0 -> none
// DEBUG == 1 -> for armpe_tester
// DEBUG == 2 -> wince - dumps memory
@ -53,8 +55,6 @@
#endif
#endif
#define section .section
// p_armpe.cpp uses the following symbols, so they should be global
.globl SRC0

View File

@ -29,6 +29,8 @@
<jreiser@users.sourceforge.net>
*/
#include "arch/arm/v4t/macros.S"
// p_armpe.cpp uses some symbols, so they should be global
.globl SRC0
@ -36,12 +38,6 @@
.globl IATT
.globl ENTR
// in thumb mode we need this S() macro hack to export a symbol which
// is used in a ldr statement
#define S(sym) .globl sym; sym: .L##sym
#define section .section
.arm
dst0 .req r9 @ global register

View File

@ -223,11 +223,12 @@ section PEMAIN20
// clear the dirty stack
.macro clearstack128 tmp_reg
local loop
lea \tmp_reg, [esp - 128]
c1:
loop:
push 0
cmp esp, \tmp_reg
jnzs c1
jnzs loop
sub esp, -128
.endm

View File

@ -27,7 +27,7 @@
;
*/
.altmacro
#include "arch/m68k/macros.S"
/*
@ -42,7 +42,6 @@
#define macro(name) .macro name
#define endm .endm
#define section .section
// global label for cross-section addressing
#define GL(l) .globl l; l:

View File

@ -26,8 +26,8 @@
*
*/
#include "arch/powerpc/32/macros.S"
#include "arch/powerpc/32/ppc_regs.h"
#define section .section
section MACOS000
_start: .globl _start

View File

@ -28,6 +28,8 @@
* John F. Reiser
* <jreiser@users.sourceforge.net>
*/
#include "arch/powerpc/32/macros.S"
#include "arch/powerpc/32/ppc_regs.h"
sz_b_info= 12

View File

@ -29,8 +29,8 @@
* <jreiser@users.sourceforge.net>
*/
#include "arch/powerpc/32/macros.S"
#include "arch/powerpc/32/ppc_regs.h"
#define section .section
sz_b_info= 12
sz_unc= 0

View File

@ -1,3 +1,35 @@
/* powerpc-linux.elf-fold.S -- linkage to C code to process ELF binary
*
* This file is part of the UPX executable compressor.
*
* Copyright (C) 1996-2006 Markus Franz Xaver Johannes Oberhumer
* Copyright (C) 1996-2006 Laszlo Molnar
* Copyright (C) 2000-2006 John F. Reiser
* 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
* <mfx@users.sourceforge.net> <ml1050@users.sourceforge.net>
*
* John F. Reiser
* <jreiser@users.sourceforge.net>
*/
#include "arch/powerpc/32/macros.S"
#include "arch/powerpc/32/ppc_regs.h"
#define szElf32_Ehdr 0x34