All pastes #57812 Raw Edit

shd

public text v1 · immutable
#57812 ·published 2006-05-22 00:19 UTC
rendered paste body
//file : shddll.c
#include <stdio.h>
int zomg(void){	printf("Zomg\n"); }

// file main.c
#include <stdio.h>
#include <windows.h>
HINSTANCE shddll;
int main(int argc, char **argv)
{
	int ret;
	int (*func)(void);
	shddll = LoadLibraryEx("shd.dll",NULL,0);

	if (shddll == NULL) { puts("unable to load dll"); return 1;}
	func = GetProcAddress(shddll,"zomg");

	if(func == NULL ) { puts("Failed to find function"); return 1;}
	ret = func();

	FreeLibraryAndExitThread(shddll,0);
	return 0;
}