- UID
- 73020
注册时间2012-5-1
阅读权限10
最后登录1970-1-1
周游历练
TA的每日心情 | 无聊 2016-7-20 18:14 |
---|
签到天数: 7 天 [LV.3]偶尔看看II
|
发表于 2014-11-22 11:32:26
|
显示全部楼层
#include <stdio.h>
#include <windows.h>
#include "Shlwapi.h"
HMODULE g_hMSIMG32 = NULL;
DWORD __stdcall ThreadProc(LPVOID lpParam){
return 0;
}
BOOL __stdcall DllMain( HMODULE hModule, DWORD dwReason, LPVOID lpReserved )
{
if( dwReason == DLL_PROCESS_ATTACH ){
HANDLE m_hThread=CreateThread(NULL,0,ThreadProc,NULL,0,NULL);
CloseHandle(m_hThread);
}
else if( dwReason == DLL_PROCESS_DETACH ){
}
return TRUE;
}
#define MSIMG32_DEF_IMPORT(x, y) g_fp##x = GetProcAddress( g_hMSIMG32, y );
#define MSIMG32_BUILD_STUB(x) __declspec(naked) void x ( void ) { \
__asm pushad \
__asm call MSIMG32InitializeImports \
__asm popad \
__asm jmp g_fp##x## \
}
FARPROC g_fpvSetDdrawflag;
FARPROC g_fpAlphaBlend;
FARPROC g_fpDllInitialize;
FARPROC g_fpGradientFill;
FARPROC g_fpTransparentBlt;
void MSIMG32InitializeImports( void )
{
if( g_hMSIMG32 == NULL )
{
char szBuffer[ MAX_PATH ] = "";
GetSystemDirectory( szBuffer, sizeof( szBuffer ) );
strcat( szBuffer, "\\msimg32.dll");
g_hMSIMG32 = LoadLibrary( szBuffer );
MSIMG32_DEF_IMPORT( vSetDdrawflag, "vSetDdrawflag" );
MSIMG32_DEF_IMPORT( AlphaBlend, "AlphaBlend" );
MSIMG32_DEF_IMPORT( DllInitialize, "DllInitialize" );
MSIMG32_DEF_IMPORT( GradientFill, "GradientFill" );
MSIMG32_DEF_IMPORT( TransparentBlt, "TransparentBlt" );
}
}
MSIMG32_BUILD_STUB(vSetDdrawflag)
MSIMG32_BUILD_STUB(AlphaBlend)
MSIMG32_BUILD_STUB(DllInitialize)
MSIMG32_BUILD_STUB(GradientFill)
MSIMG32_BUILD_STUB(TransparentBlt)
|
|