Why should global variables be avoided in shellcode, and how does the article address this?
Global variables like function pointers are stored at fixed addresses after compilation, making shellcode non-portable across different systems. The article replaces global variables with local variables inside the `shell_code()` function, initializing them at runtime. This ensures the shellcode dynamically resolves addresses, similar to techniques used in Windows Shellcode Study Notes - Bypassing DEP with VirtualAlloc.
global variablesshellcode portabilitydynamic resolutionlocal variables