I have a question regarding the linux assembly code.

Asked 2 years ago, Updated 2 years ago, 102 views

Hello, I'm studying about system call

fork()
{
    movl 57, %eax
     int $0x80
}

How can I find the assembly language code for the function in this way?

The information I received said that the Glibc code is on the Internet, so I can search and write it, but I couldn't find it. First of all, I looked at the libc-2.27.so file called the Glibc code (the lab environment is Glibc 2.27) and only the function name came out.

Of course, I googled

section .bss
 buffer: resb 1
section .text
 global _start
_start:
 mov eax, 3 ; system call number (sys_read)
 mov ebx, 0 ; file descriptor (stdin)
 mov ecx, buffer ; buffer to keep the read data
 mov edx, 1 ; bytes to read
 int 0x80 ;call kernel
 mov eax,1 ;system call number (sys_exit)
 mov ebx, 0 ;exit status
 int 0x80 ;call kernel

I found the source code like this, but did you just compile it and disamble it again?

If I want to find this ASM code, which file should I look at?

linux linux-kernel assembly

2022-09-20 17:21

1 Answers

32bit linux calling convention and You know how to call a syscall.

https://chromium.googlesource.com/chromiumos/docs/+/master/constants/syscalls.md If you go here... Please refer to the call number and source code (c).


2022-09-20 17:21

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.