Skip to content

Instantly share code, notes, and snippets.

@Yeah9782
Yeah9782 / shellcode_createprocess.c
Created July 11, 2022 21:26
CreateProcessA C payload converted into a shellcode payload with the help of http://www.exploit-monday.com/2013/08/writing-optimized-windows-shellcode-in-c.html
#define WIN32_LEAN_AND_MEAN
#pragma warning( disable : 4201 )
#include "GetProcAddressWithHash.h"
#include <windows.h>
#include <intrin.h>
typedef HMODULE(WINAPI * LOADLIBRARYA)(LPCSTR);
typedef FARPROC(WINAPI * GETPROCADDRESS)(HMODULE, LPCSTR);
typedef BOOL(WINAPI * CREATEPROCESSA)(LPCTSTR, LPCTSTR, LPSECURITY_ATTRIBUTES, LPSECURITY_ATTRIBUTES, BOOL, DWORD, LPVOID, LPCTSTR, LPSTARTUPINFO, LPPROCESS_INFORMATION);
@Yeah9782
Yeah9782 / memmem.md
Created June 12, 2022 23:44 — forked from alexx384/memmem.md
Custom implementation of memmem() for Windows and others

The implementation based on the StackExchange question and answers. Also added some improvements.

#include <stdlib.h>

void* memmem(const void* haystack, size_t haystackLen,
             const void* needle, size_t needleLen)
{
	/* The first occurrence of the empty string is deemed to occur at