summaryrefslogtreecommitdiff
path: root/other/shellkit/x86_noptest.c
blob: 3c68ce0091de297f4a8ee96f1f6b9b05b4744f88 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25

#include <stdio.h>
#include <stdlib.h>
#include "shellcode.h"
#include "x86_bsd.h"


typedef void (* func_ptr)(void);

int
main (int argc, char *argv[])
{
	func_ptr	fp;
	unsigned char	nopspace[20480];

	x86_nop (nopspace, sizeof (nopspace), "\x25\x0d\x0a\x00", 4);
	nopspace[sizeof (nopspace) - 1] = '\xcc';

	fp = (func_ptr) nopspace;
	fp ();

	exit (EXIT_SUCCESS);
}