本文主要是介绍Linux通过0x80进行系统调用,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
系统调用参数传递
Linux
例子:
.data
filename:.fill 256
filecontent:.string "Hello World!"
len:.int 12
fd:.int -1
.text
.global _start
_start:
movl $3 , %eax #
movl $0 , %ebx
movl $filename , %ecx
movl $1024 , %edx
int $0x80
movl $filename , %ebx #
movl %eax , %ecx
xorb %al , %al
movl $filename , %ebx
movb %al , -1(%ebx , %ecx)
movl $5 , %eax #
movl $filename , %ebx
xorl %ecx , %ecx
orl $20 , %ecx
orl $100 , %ecx
orl $10 , %ecx
movl $0x0080, %edx
int $0x80
movl $fd , %ebx #
movl %eax , (%ebx)
movl $4 , %eax #
movl $fd , %ebx
movl (%ebx) , %ebx
movl $filecontent , %ecx
movl $len , %edx
movl (%edx) , %edx
int $0x80
movl $6, %eax #
movl $fd , %ebx
movl (%ebx) , %ebx
int $0x80
movl $1 , %eax
movl $0 , %ebx
int $0x80
这篇关于Linux通过0x80进行系统调用的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!