Answer the question
In order to leave comments, you need to log in
Why doesn't assembler code throw a segmentation fault?
The simplest code is written:
section .data
des dq 0xffffffffffffffff
section .text
global _start
_start:
mov qword [des], 4
mov rax, 1
mov rbx, 0
int 0x80
[[email protected] exploits]# ./a.out
[[email protected] exploits]#
Answer the question
In order to leave comments, you need to log in
I already forgot the Intel syntax of the assembler, but mov qword [des]
it mov qword des
's the same thing. Operands in x86/x64 can be of type immediate, register and memory (I think it's clear what I'm talking about). You can only dereference operands of type register and immediate, so there would be a segfault on:
mov qword [0xffffffffffffffff], 4
или
mov rax, offset des ; вроде такой синтаксис
mov qword [rax], 4
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question