In position independent shellcode for 32-Bit windows what are the most commonly used techniques for storing string variables. I've been using stack based strings:
- Adjust the ESP register
- Store the ESP value in EBP
- Push the required DWORD strings onto the stack.
- Use EQU to for the offsets names of the strings within the stack space to make life easier when using the variables later on.
My understanding is that I can't use variable definitions in the .data section as the offsets are unknown. I've tried disassembling a number of metasploit payloads to see how they work, but there don't seem to use any other techniques.
Any information about other options and their pro's and con's would be great.