Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- global _start
- section .text
- _start:
- ; sycall number: socket (359)
- ; int socket(int domain, int type, int protocol);
- mov eax, 0x167
- mov ebx, 2
- mov ecx, 1
- mov edx, 0
- int 0x80
- ; Bind socket bind(3, {sa_family=AF_INET, sin_port=htons(1234), sin_addr=inet_addr("0.0.0.0")}, 16) = 0
- ; 2. #define __NR_bind 361
- ; int bind(int sockfd, const struct sockaddr *addr, socklen_t addrlen);
- mov eax, 361
- mov ebx, 2
- push word 0x3905
- push bx
- mov ecx, esp
- mov edx, 0x10
- int 0x80
- ; result:
- ; socket(AF_INET, SOCK_STREAM, IPPROTO_IP) = 3
- ; bind(2, {sa_family=AF_INET, sin_port=htons(1337), sin_addr=inet_addr("1.0.0.0")}, 16) = -1 ENOTSOCK (Socket operation on ; non-socket)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement