I'm reading about buffer overflow and there's this part i didn't understand , it says :
Eliminating Data Segments
That assembly code works completely. However, it is useless. You can compile it with nasm, execute it, and view the binary file in hex form with hexdump, which is itself a shellcode. The problem is that both programs use their own data segments, which means that they cannot execute inside another application. This means in chain that an exploit will not be able to inject the required code into the stack and execute it.
why can't we use a data segment in our shellcode ? thanks !