好友
阅读权限255
听众
最后登录1970-1-1
|
Library lpk;
uses
Windows;
Var
ModHandle: Cardinal = 0;
POldLpkDllInitialize,
POldLpkDrawTextEx,
POldLpkExtTextOut,
POldLpkGetCharacterPlacement,
POldLpkGetTextExtentExPoint,
POldLpkPSMTextOut,
POldLpkUseGDIWidthCache,
POldftsWordBreak,
POldLpkInitialize,
POldLpkTabbedTextOut,
POldLpkEditControl: Pointer;
Procedure LpkDllInitialize; Stdcall;
Asm jmp POldLpkDllInitialize
End;
Procedure LpkDrawTextEx; Stdcall;
Asm jmp POldLpkDrawTextEx
End;
Procedure LpkExtTextOut; Stdcall;
Asm jmp POldLpkExtTextOut
End;
Procedure LpkGetCharacterPlacement; Stdcall;
Asm jmp POldLpkGetCharacterPlacement
End;
Procedure LpkGetTextExtentExPoint; Stdcall;
Asm jmp POldLpkGetTextExtentExPoint
End;
Procedure LpkPSMTextOut; Stdcall;
Asm jmp POldLpkPSMTextOut
End;
Procedure LpkUseGDIWidthCache; Stdcall;
Asm jmp POldLpkUseGDIWidthCache
End;
Procedure ftsWordBreak; Stdcall;
Asm jmp POldftsWordBreak
End;
Procedure LpkInitialize; Stdcall;
Asm jmp POldLpkInitialize
End;
Procedure LpkTabbedTextOut; Stdcall;
Asm jmp POldLpkTabbedTextOut
End;
Procedure LpkEditControl; Stdcall;
Asm
dd 0
dd 0
dd 0
dd 0
dd 0
dd 0
dd 0
dd 0
dd 0
dd 0
dd 0
dd 0
dd 0
dd 0
dd 0
dd 0
End;
Procedure ModMemData();
Var
dwOldProtect: DWORD;
Begin
VirtualProtect(@LpkEditControl, $40, PAGE_READWRITE, @dwOldProtect);
End;
Procedure lpk_DllHandler(Reason: Integer);
Var
SysDir: Array[0..256] Of Char;
LibPath: String;
Begin
Case Reason Of
DLL_PROCESS_ATTACH:
Begin
GetSystemDirectory(SysDir, 256);
LibPath := SysDir + '\LPK.DLL';
ModHandle := LoadLibrary(PChar(LibPath));
If ModHandle > 0 Then
Begin
ModMemData;
POldLpkDllInitialize := GetProcAddress(ModHandle, 'LpkDllInitialize');
POldLpkDrawTextEx := GetProcAddress(ModHandle, 'LpkDrawTextEx');
POldLpkExtTextOut := GetProcAddress(ModHandle, 'LpkExtTextOut');
POldLpkGetCharacterPlacement := GetProcAddress(ModHandle,
'LpkGetCharacterPlacement');
POldLpkGetTextExtentExPoint := GetProcAddress(ModHandle, 'LpkGetTextExtentExPoint');
POldLpkPSMTextOut := GetProcAddress(ModHandle, 'LpkPSMTextOut');
POldLpkUseGDIWidthCache := GetProcAddress(ModHandle, 'LpkUseGDIWidthCache');
POldftsWordBreak := GetProcAddress(ModHandle, 'ftsWordBreak');
POldLpkInitialize := GetProcAddress(ModHandle, 'LpkInitialize');
POldLpkTabbedTextOut := GetProcAddress(ModHandle, 'LpkTabbedTextOut');
POldLpkEditControl := GetProcAddress(ModHandle, 'LpkEditControl');
Asm
pushad
mov esi, eax
lea edi, LpkEditControl
mov ecx, 40h
rep movsb
popad
End;
//此处添加你的代码........
OutputDebugString('aaaaaaaaa');
End Else ExitProcess(0);
End;
DLL_PROCESS_DETACH:
Begin
//此处添加你的代码........
If ModHandle <> 0 Then FreeLibrary(ModHandle);
End;
DLL_THREAD_ATTACH: ;
DLL_THREAD_DETACH: ;
End;
End;
Exports
LpkDllInitialize,
LpkDrawTextEx,
LpkEditControl,
LpkExtTextOut,
LpkGetCharacterPlacement,
LpkGetTextExtentExPoint,
LpkPSMTextOut,
LpkUseGDIWidthCache,
ftsWordBreak,
LpkInitialize,
LpkTabbedTextOut;
Begin
DLLProc := @lpk_DllHandler;
DLLProc(DLL_PROCESS_ATTACH);
End. |
|
发帖前要善用【论坛搜索】功能,那里可能会有你要找的答案或者已经有人发布过相同内容了,请勿重复发帖。 |
|
|
|
|