I'm trying to call the execve("bin/sh"...)
function using assembly, however in the statement: mov %rsi,0x8(%rsi)
I get a segmentation error. This is the 64bit version of the article code "smash the stack for fun and profit".
void main()
{
__asm__(
"jmp caller \n"
"jumper: \n"
"pop %rsi \n"
"mov %rsi,0x8(%rsi)\n"
"xor %rax,%rax \n"
"mov %rax,0x7(%rsi)\n"
"mov %rax,0xc(%rsi)\n"
"mov 0x3b,%al \n"
"mov %rsi,%rbx \n"
"lea 0x8(%rsi),%rcx\n"
"lea 0xc(%rsi),%rdx\n"
"syscall \n"
"xor %rbx,%rbx \n"
"mov %rbx,%rax \n"
"inc %rax \n"
"syscall \n"
"caller: \n"
"call jumper \n"
".string \"/bin/sh\" \n"
);
}