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

dos/com & dos/sys: use the new ElfLinker features

This commit is contained in:
László Molnár 2006-07-01 00:21:06 +02:00
parent c5fb161477
commit f850d36c52
7 changed files with 1186 additions and 1225 deletions

View File

@ -116,10 +116,7 @@ void PackCom::patchLoader(OutputFile *fo,
linker->defineSymbol("bytes_to_copy", ph.c_len + lsize);
linker->defineSymbol("copy_source", ph.c_len + lsize + 0x100);
linker->defineSymbol("copy_destination", upper_end);
// FIXME: Depends on: decompr_start == cutpoint+1 !!!
linker->defineSymbol("decompressor", upper_end - 0xff -
d_len - getLoaderSection("UPX1HEAD"));
linker->defineSymbol("NRV2B160", ph.u_len + ph.overlap_overhead);
linker->relocate();
loader = getLoader();
@ -149,7 +146,7 @@ int PackCom::buildLoader(const Filter *ft)
ft->id ? "NRVDDONE" : "NRVDRETU",
"NRVDECO1",
ph.max_offset_found <= 0xd00 ? "NRVLED00" : "NRVGTD00",
"NRVDECO2,NRV2B169",
"NRVDECO2",
NULL
);
if (ft->id)

View File

@ -82,11 +82,11 @@ void PackSys::patchLoader(OutputFile *fo,
unsigned copy_to = ph.u_len + d_len + ph.overlap_overhead;
linker->defineSymbol("sys_entry", get_le16(ibuf + 6) - copy_to - 1);
linker->defineSymbol("calltrick_calls", calls);
linker->defineSymbol("copy_source", ph.c_len + lsize - 1);
linker->defineSymbol("copy_destination", copy_to);
linker->defineSymbol("decompressor", ph.u_len + ph.overlap_overhead + 2);
linker->defineSymbol("NRV2B160", ph.u_len + ph.overlap_overhead + 1);
linker->defineSymbol("original_strategy", get_le16(ibuf + 6));
linker->relocate();
loader = getLoader();
@ -109,7 +109,7 @@ int PackSys::buildLoader(const Filter *ft)
ft->id ? "SYSCALLT" : "",
"SYSMAIN3,UPX1HEAD,SYSCUTPO,NRV2B160,NRVDDONE,NRVDECO1",
ph.max_offset_found <= 0xd00 ? "NRVLED00" : "NRVGTD00",
"NRVDECO2,NRV2B169",
"NRVDECO2",
NULL
);
if (ft->id)

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -95,8 +95,6 @@ getbit_n2b:
decomp_ret_n2b:
ret
decomp_done_n2b:
section NRV2B169
/*

View File

@ -63,8 +63,7 @@ section COMPSHDI
section COMCALLT
push di
section COMMAIN2
.byte 0xe9
.word decompressor /* FIXME decomp_start_n2b */
jmp decomp_start_n2b
#include "include/header2.ash"

View File

@ -84,7 +84,7 @@ section SYSSBBBP
section SYSCALLT
push di
section SYSMAIN3
jmp decompressor /* FIXME decomp_start_n2b */
jmp decomp_start_n2b
#include "include/header2.ash"
@ -107,8 +107,7 @@ section SYSI0862
pop bx
pop ax
section SYSJUMP1
.byte 0xe9
.word sys_entry /* FIXME */
jmp original_strategy
/*
; vi:ts=8:et:nowrap