File tree Expand file tree Collapse file tree 2 files changed +21
-4
lines changed
Expand file tree Collapse file tree 2 files changed +21
-4
lines changed Original file line number Diff line number Diff line change 11#include <stdio.h>
22#include <string.h>
33
4- unsigned char code [] = "\xb8\x04\x00\x00\x00\xbb\x01\x00\x00\x00\ xb9\xa0\x90\x04\x08\xba\x1c\x00\x00\x00\xcd\x80\xb8\x01\x00\x00\x00 \xcd\x80" ;
4+ char code [] = "\x31\xc0\x31\xdb\x31\xd2\x31\xc9\xb0\x04\xb3\x01\ xb9\xa0\x90\x04\x08\xba\x1c\x00\x00\x00\xcd\x80\x31\xc0\xb0\x01\x31\xdb \xcd\x80" ;
55
66int main (int argc , char * argv [])
77{
88 printf ("Shellcode Length: %d\n" , (int )strlen (code ));
9+
10+ int (* func )();
11+ func = (int (* )()) code ;
12+ (int )(* func )();
913
10- int (* ret )() = (int (* )())code ;
11- ret ();
12- }
14+ // int (*ret)() = (int(*)())code;
15+ // ret();
16+ }
Original file line number Diff line number Diff line change 1+ ; hello.asm
2+ ; x86 architecture
3+ ; Intel specification
4+ section .data
5+
6+
7+ section .text
8+ global _start
9+
10+ _start:
11+
12+
13+
You can’t perform that action at this time.
0 commit comments