-
-
[求助]帮看一下程序
-
发表于:
2009-7-16 00:04
4012
-
#include <stdio.h>
#include <string.h>
#include <windows.h>
#include<windef.h>
//#include"wei.h"
void main(){
DWORD dw ;
HRSRC hMyRes;
HGLOBAL hgpt;
LPVOID lpBuff;
HANDLE hFile;//file to write
LPDWORD dwByte=0;//byte size had been write
hMyRes=FindResource(NULL,MAKEINTRESOURCE(ID_DRIVER_SYS),MAKEINTRESOURCE(RC_SYS));
if(hMyRes==NULL)
{
dw=GetLastError();
printf("error:%d\n",(int)dw);
}
DWORD size=SizeofResource(NULL,hMyRes);
hgpt=LoadResource(NULL,hMyRes);
if(hgpt==NULL)
{
dw=GetLastError();
printf("error:%d\n",(int)dw);
}
lpBuff=LockResource(hgpt);
hFile=CreateFile("e:\\mywriter.exe",GENERIC_WRITE,0,NULL,CREATE_ALWAYS,FILE_ATTRIBUTE_NORMAL,NULL);
WriteFile(hFile,lpBuff,size-1,NULL,NULL);
CloseHandle(hFile);
}
就是ez.exe作为资源,生成mywriter.exe,可是FindResource()的第2第3个参数不会定义. 各位兄弟帮帮忙呀
[培训]内核驱动高级班,冲击BAT一流互联网大厂工作,每周日13:00-18:00直播授课