lpk.dll of delphi
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 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. 这个……确实是好东西 轻轻的问一声这是什么东东 怎么用 以前有汇编源码,但 不知道存哪里去了。
哈哈 delphi的更好~ lpk 多开用的? LZ这个代码加的,DELPHI+ASM.
主要还是ASM,没彻底翻译过来.看起来就是替换LPK, 好东西顶一个! Delphi版不知道怎么样~!
那如果要修改401000处的EEEE改为FFFF,该怎么写呢??? 回复 1# Hmily
这个为什么我一加进一点代码,就加载错误呢?
例如:
地址:00401000
原数据:AAAA
新数据:BBBB
能否给个例子???
谢谢
页:
[1]
2