其实就是代理下 ServiceMain 函数 替换了 服务的 dll 后 需要代理下起入口函数
#include "stdafx.h"
#include <Windows.h>
#include <WinSvc.h>
void __stdcall ServiceMain( int argc, wchar_t* argv[] )
{
HMODULE hdll = LoadLibrary(L"dhcpcsvc.dll");
FARPROC p = (FARPROC)GetProcAddress(hdll,"ServiceMain");
OutputDebugStringA(" I am load ");
__asm{
push argc
push argv
call p
}
}