[LMH]exploiter on win32

Carl Shapiro cshapiro@panix.com
Tue Jul 2 10:11:01 2002


The exploiter sources can be natively run on Win32 if the exploiter.c
module is swapped out for my Win32 specific version included below.

Enjoy.

/*
 * exploiter_win32.c
 *
 * main file
 */

#include <windows.h>
#include <stdio.h>

#include "types.h"

extern int process_data(u8 *, int);

int main(int argc, char *argv[])
{
    HANDLE hFile, hFileMapping;
    LPVOID *lpFile;
    DWORD dwFileSize;

    if (argc != 2) {
	fprintf(stderr, "usage: %s <file>\n", argv[0]);
	return -1;
    }

    hFile = CreateFile(argv[0], GENERIC_READ, 0, NULL, OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
    hFileMapping = CreateFileMapping(hFile, NULL, PAGE_WRITECOPY, 0, 0, NULL);
    lpFile = MapViewOfFile(hFileMapping, FILE_MAP_COPY, 0, 0, 0);
    dwFileSize = GetFileSize(hFile, NULL);
						  
    return process_data((u8 *)lpFile, (int)dwFileSize);
}

/* EOF */