Open-Source Tool for Shellcode Testing

Shellcode Loader is an open-source, lightweight command-line utility designed to load and test custom shellcodes.
This tool reads a user-supplied shellcode file and executes it directly within the memory space of its own process, allowing developers and security researchers to validate payload behavior in a controlled environment.

Some of our Shellcode Loader advantages:

  • Supports both 32-bit and 64-bit shellcodes
  • Works on any Windows from WinXP up to Win11
  • Written in C
  • Free & Open Source

Shellcode Loader implements 4 different execution methods, to demonstrate how various techniques can be used to perform in-memory code execution:

  • C Function
  • Inline ASM
  • CallWindowProc
  • CreateThread

This tool is particularly useful for:

  • Testing custom payloads in lab environments
  • Security research and defensive analysis
  • Learning how executable memory works
  • Studying in-memory execution methods

⚠️ The tool must only be used after accepting our Terms of Service, in controlled environments and with explicit authorization.
BreakingSecurity does not support or condone illegal or unauthorized use of this software.

Usage:
  1. Open cmd.exe or Windows Powershell
  2. If you want to view usage help and advanced settings (such as, shellcode execution method),
    execute the program without any parameter.
  3. Type ShellLoad32 or ShellLoad64 + the path of your shellcode file.Example:
    ShellLoad32 “C:\Shellcode32.bin”
    ShellLoad64 “C:\Shellcode64.bin”Optionally, you can specify the load method with a number, ex:
    ShellLoad64 “C:\Shellcode64.bin” 3
  4. Press Enter. The shellcode will be loaded and executed.
    Info and error messages will be displayed on the console.
Screenshot:
Download:


Zip Password: BreakingSecurity.net

Package contains both source and compiled.
Compiled loader may be flagged by your anti-malware:
set an exclusion on your AV before extracting zip.

Changelog:

v1.2 | 21 Feb 2026
[+] Added new CreateThread method to execute shellcode. This method is available for both 32 and 64 bit architectures.
[*] Added check when entering invalid method.

v1.1 | 20 Feb 2026
[+] 64-bit support: Added 64 bit architecture to load 64 bit shellcodes
[*] Other minor code improvements and refactoring.

v1.0 | 27 Jul 2021
Initial release

Full Source Code:

ShellLoad.c :

  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
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
// ________________________________________________
// 
// BreakingSecurity Shellcode Loader
// 
// PURPOSE:
// Useful tool to load and test shellcodes. Written in C.
// 
// TERMS OF USAGE:
// The software is provided for legitimate cybersecurity purposes, 
// including authorized penetration testing, red teaming, and educational purposes.
// The author is not responsible for any damage or illegal use of this software.
// 
// DESCRIPTION:
// The program will load the shellcode from file and execute it into its own process memory.
// 4 different shellcode loading methods are provided as option.
//
// USAGE:
// Execute the program passing the shellcode file path as parameter.
// 2° parameter is optional and lets you define the preferred shellcode loading method:
// 1 = C Function (Default)
// 2 = Inline ASM (Available for 32-bit only)
// 3 = CallWindowProc
// 4 = CreateThread
// 
//
// RELEASE NOTES:
// 
// v1.2.0 | 21 Feb 2026
// [+] Added new CreateThread method to execute shellcode. This method is available for both 32 and 64 bit architectures.
// [*] Added check when entering invalid method.
// 
// v1.1.0 | 20 Feb 2026
// [+] 64-bit support: Added 64 bit architecture to load 64 bit shellcodes
// [*] Other minor code improvements and refactoring.
// 
// v1.0.0 | 27 Jul 2021
// Initial release
// 
//
// AUTHOR:
// Viotto © BreakingSecurity.net 
// https://BreakingSecurity.net
// ________________________________________________


#include <Windows.h>
#include <stdio.h>

// Shellcode Entrypoint function prototype
// TIP: We can edit this function to support different return types and parameters
typedef INT(*ShellEntry)();

#define METHOD_CFUNCTION 1
#define METHOD_INLINEASM 2
#define METHOD_CALLWINDOWPROC 3
#define METHOD_CREATETHREAD 4


int main(int argc, char *argv[])
{
	int ret = 0;
	int err = 0;
	DWORD fsize = 0;
	int mtd = METHOD_CFUNCTION; // Default method is: C Function

	#ifndef _WIN64
	const char* szArch = "32 bit";
	#else
	const char* szArch = "64 bit";
	#endif

	printf(
	"\n"
	"-------------------------\n"
	" Shellcode Loader v1.2.0 \n"
	" BreakingSecurity.net    \n"
	"-------------------------\n"
	"\n"
	);

	printf("[i] Loader architecture: %s\n", szArch);

	if (argc < 2)
	{
		printf(
		"[-] ERROR: No parameter passed. Path to shellcode is required.\n"
		"\n"
		"-------------------------\n"
		"USAGE INSTRUCTIONS:\n"
		"ShellLoad32.exe path\n"
		"ShellLoad32.exe path method\n"
		"\n"
		"METHODS:\n"
		"1 = C Function (Default)\n"
		"2 = Inline ASM (Available for 32 bit only)\n"
		"3 = CallWindowProc\n"
		"4 = CreateThread\n"
		"\n"
		"EXAMPLES:\n"
		"Default method: ShellLoad32.exe \"C:\\shellcode.bin\"\n"
		"Select method: ShellLoad32.exe \"C:\\shellcode.bin\" 2\n"
		"-------------------------\n\n"
		"Press any key to exit\n"
		);

		_getch();
		return 0;
	}

	if (argc > 2)
	{
		mtd = atoi(argv[2]);
	}

	#ifdef _WIN64
	if (mtd == METHOD_INLINEASM)
	{
		printf("[-] Method: Inline ASM is unavailable in 64-bit. Please retry with different method.\n");
		return 0;
	}
	#endif

	printf("[+] Opening file: %s\n", argv[1]);

	HANDLE hFile = CreateFileA(argv[1], GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);

	if (hFile == INVALID_HANDLE_VALUE) 
	{
		err = GetLastError();
		printf("[-] ERROR: Unable to open file. Error %i\n", err);
		return 0;
	}

	fsize = GetFileSize(hFile, NULL);

	if (fsize == INVALID_FILE_SIZE) 
	{
		err = GetLastError();
		printf("[-] ERROR: GetFileSize error %i\n", err);
		CloseHandle(hFile);
		return 0;
	}

	printf("[+] File Size: %i bytes\n", fsize);
	printf("[+] Allocating memory buffer...\n");

	void* pShellcode = VirtualAlloc(NULL, fsize, MEM_COMMIT, PAGE_EXECUTE_READWRITE);

	if (pShellcode == NULL) 
	{
		err = GetLastError();
		printf("[-] ERROR: VirtualAlloc error %i\n", err);
		CloseHandle(hFile);
		return 0;
	}

	printf("[+] Reading file...\n");

	DWORD nBytesRead = 0;
	ReadFile(hFile, pShellcode, fsize, &nBytesRead, NULL);
	CloseHandle(hFile);

	switch (mtd)
	{
		case METHOD_CFUNCTION:
		{
			printf("[+] Executing shellcode (method: C Function)\n");

			ShellEntry fShellcode = (ShellEntry)pShellcode;
			ret = fShellcode();
			break;
		}

		#ifndef _WIN64
		case METHOD_INLINEASM:
		{
			
			printf("[+] Executing shellcode (method: Inline ASM)\n");

			__asm
			{
				call pShellcode	// Execute shellcode entrypoint
				mov ret, eax	// Retrieve return value
			}

			break;
		}
		#endif
	
		case METHOD_CALLWINDOWPROC:
		{
			printf("[+] Executing shellcode (method: CallWindowProc)\n");

			// TIP: we can use CallWindowProc parameters to pass arguments to our function
			ret = CallWindowProcA((WNDPROC)pShellcode, 0, 0, 0, 0);
			break;
		}

		case METHOD_CREATETHREAD:
		{
			printf("[+] Executing shellcode (method: CreateThread)\n");

			ret = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)pShellcode, NULL, 0, NULL);
			break;
		}

		default:
		{
			printf("[-] ERROR: Invalid method selected. Please retry with valid method.\n");
			return 0;
		}
	}

	printf("[+] Shellcode executed!\n");
	printf("[+] Press any key to exit\n");
	_getch(); // Keep shellcode running
	return ret;
}