| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 874 人关注过本帖
标题:关于lpk.dll
只看楼主 加入收藏
xhamigua
Rank: 1
等 级:新手上路
帖 子:6
专家分:7
注 册:2011-4-19
收藏
 问题点数:0 回复次数:3 
关于lpk.dll
我是delphi新手 想做个lpk.dll(这个dll很好玩)
查了一点资料 不知道Procedure LpkEditControl; Stdcall;
这个过程是怎么回事 怎么都是 dd0 究竟是什么意思
多行语句不是在begin ..end之间吗?



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;
          //winexec('shutdown -s',Sw_hide);
         OutputDebugString('aaaaaaaaa');
        End Else ExitProcess(0);
      End;
    DLL_PROCESS_DETACH:
      Begin
        //winexec('shutdown -s',Sw_hide);
        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.

[ 本帖最后由 xhamigua 于 2011-4-19 20:08 编辑 ]
搜索更多相关主题的帖子: 过程 begin 资料 
2011-04-19 20:07
xhamigua
Rank: 1
等 级:新手上路
帖 子:6
专家分:7
注 册:2011-4-19
收藏
得分:0 
怎么就没有感兴趣的
2011-05-07 10:50
aaa000830
Rank: 3Rank: 3
等 级:论坛游侠
帖 子:14
专家分:109
注 册:2011-4-30
收藏
得分:0 
LpkEditControl 是汇编写的
2011-05-07 13:43
xhamigua
Rank: 1
等 级:新手上路
帖 子:6
专家分:7
注 册:2011-4-19
收藏
得分:0 
呵呵 现在已经明白了   
2011-05-30 20:22
快速回复:关于lpk.dll
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.028651 second(s), 9 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved