Re-writing a small execve shellcode
Going through http://hackoftheday.securitytube.net/2013/04/demystifying-execve-shellcode-stack.html I understood the nasm program which invokes execve and was trying to re-write it. Some background information: int execve(const char *filename, char *const argv[], char *const envp[]); So, eax = 11 (function call number for execve ), ebx should point to char* filename , ecx should point to argv[] (which will be the same as ebx since the first argument is the *filename itself e.g. "/bin/sh" in this case), and edx will point to envp[] ( null in this case). Original nasm code: global _start section