3 Rollback to Revision 1
source | link

  I have code in C:

int a() {

     char string[100];
}

When I compile this I get code in assembly:

a:
    push    rbp
    mov rbp, rsp
    sub rsp, 112
    mov rax, QWORD PTR fs:40  <----
    mov QWORD PTR [rbp-8], rax <----
    xor eax, eax
    nop
    mov rdx, QWORD PTR [rbp-8]
    xor rdx, QWORD PTR fs:40
    je  .L2
    call    __stack_chk_fail

What make lines that I checked ? What is it "fs:40" ? (always when I make a array in c) and what is in rbp-12 ? nothing ?

  I have code in C:

int a() {

     char string[100];
}

When I compile this I get code in assembly:

a:
    push    rbp
    mov rbp, rsp
    sub rsp, 112
    mov rax, QWORD PTR fs:40  <----
    mov QWORD PTR [rbp-8], rax <----
    xor eax, eax
    nop
    mov rdx, QWORD PTR [rbp-8]
    xor rdx, QWORD PTR fs:40
    je  .L2
    call    __stack_chk_fail

What make lines that I checked ? What is it "fs:40" ? (always when I make a array in c) and what is in rbp-12 ? nothing ?

I have code in C:

int a() {

     char string[100];
}

When I compile this I get code in assembly:

a:
    push    rbp
    mov rbp, rsp
    sub rsp, 112
    mov rax, QWORD PTR fs:40  <----
    mov QWORD PTR [rbp-8], rax <----
    xor eax, eax
    nop
    mov rdx, QWORD PTR [rbp-8]
    xor rdx, QWORD PTR fs:40
    je  .L2
    call    __stack_chk_fail

What make lines that I checked ? What is it "fs:40" ? (always when I make a array in c) and what is in rbp-12 ? nothing ?

2 added 35 characters in body
source | link

  I have code in C:

int a() {

     char string[100];
}

When I compile this I get code in assembly:

a:
    push    rbp
    mov rbp, rsp
    sub rsp, 112
    mov rax, QWORD PTR fs:40  <----
    mov QWORD PTR [rbp-8], rax <----
    xor eax, eax
    nop
    mov rdx, QWORD PTR [rbp-8]
    xor rdx, QWORD PTR fs:40
    je  .L2
    call    __stack_chk_fail

What make lines that I checked ? What is it "fs:40" ? (always when I make a array in c) and what is in rbp-12 ? nothing ?

I have code in C:

int a() {

     char string[100];
}

When I compile this I get code in assembly:

a:
    push    rbp
    mov rbp, rsp
    sub rsp, 112
    mov rax, QWORD PTR fs:40  <----
    mov QWORD PTR [rbp-8], rax <----
    xor eax, eax
    nop
    mov rdx, QWORD PTR [rbp-8]
    xor rdx, QWORD PTR fs:40
    je  .L2
    call    __stack_chk_fail

What make lines that I checked ? What is it "fs:40" ? (always when I make a array in c) and what is in rbp-12 ? nothing ?

  I have code in C:

int a() {

     char string[100];
}

When I compile this I get code in assembly:

a:
    push    rbp
    mov rbp, rsp
    sub rsp, 112
    mov rax, QWORD PTR fs:40  <----
    mov QWORD PTR [rbp-8], rax <----
    xor eax, eax
    nop
    mov rdx, QWORD PTR [rbp-8]
    xor rdx, QWORD PTR fs:40
    je  .L2
    call    __stack_chk_fail

What make lines that I checked ? What is it "fs:40" ? (always when I make a array in c) and what is in rbp-12 ? nothing ?

1
source | link

what means this lines in assembly program (compile from c)?

I have code in C:

int a() {

     char string[100];
}

When I compile this I get code in assembly:

a:
    push    rbp
    mov rbp, rsp
    sub rsp, 112
    mov rax, QWORD PTR fs:40  <----
    mov QWORD PTR [rbp-8], rax <----
    xor eax, eax
    nop
    mov rdx, QWORD PTR [rbp-8]
    xor rdx, QWORD PTR fs:40
    je  .L2
    call    __stack_chk_fail

What make lines that I checked ? What is it "fs:40" ? (always when I make a array in c) and what is in rbp-12 ? nothing ?