Commit 0e99a24f authored by PoroCYon's avatar PoroCYon
Browse files

Merge branch 'master' into 'master'

Use waitpid instead of waitid because reasons, and shave off 4 bytes

See merge request !1
parents 3a60aa21 20fd772e
......@@ -12,8 +12,8 @@ but even smaller. It doesh't have a 64-bit version, though.**
| mode etc. | vondehi | trident | Fishypack | sh-based unpacker |
|:------------ | -------:| -------:| ---------:| -----------------:|
| gzip, 32-bit | 163 | 172 | 179? (198?) | 48 to 72 |
| xz, 32-bit | 166 (170*) | 179 | 186 | 48 to 72 |
| gzip, 32-bit | 159 | 172 | 179? (198?) | 48 to 72 |
| xz, 32-bit | 162 (166*) | 179 | 186 | 48 to 72 |
| gzip, 64-bit | N/A | 208 | 208? | 48 to 72 |
| xz, 64-bit | N/A | 217 | 217 | 48 to 72 |
| Preserves args | Y | N | tries to | can, but often not |
......
......@@ -12,7 +12,7 @@
%define SYS_memfd_create 356
%define SYS_fork 2
%define SYS_waitid 284
%define SYS_waitpid 7
%define SYS_execve 11
%define SYS_open 5
%define SYS_lseek 19
......@@ -27,14 +27,13 @@ org 0xEBDB0000
ehdr: ;~e_ident
; jg short 0x47 (inc ebp) ; dec esp ; inc esi
db 0x7F,"EL";"F" ;!E_MAGIC
_parent:
inc esi
db 0x7F,"ELF" ;!E_MAGIC
_parent.0:
xor ebx, ebx
mov ax, SYS_waitid
lea esi, [ebx+P_ALL]
xchg eax, edi ;edi is zero now and will be overwritten eventually
mov al, SYS_waitpid
int 0x80
lea esi, [esp+0x18]
db 0x3D ; cmp eax, ...
dw 2 ;!e_type
......@@ -88,7 +87,6 @@ _start.3:
_parent.2:
mov bl, 3
phdr.endm1:
lea esi, [esp+0x18]
phdr.end equ phdr.endm1 + 1
;_parent.3:
......@@ -109,7 +107,7 @@ _start.4:
int 0x80
test eax, eax
jnz short _parent
jnz short _parent.0
;jz short _child
;_parent:
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment