吾爱破解 - 52pojie.cn

 找回密码
 注册[Register]

QQ登录

只需一步,快速开始

查看: 9361|回复: 19
收起左侧

[其他转载] lpk.dll of delphi

 关闭 [复制链接]
Hmily 发表于 2009-5-5 10:06
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.

发帖前要善用论坛搜索功能,那里可能会有你要找的答案或者已经有人发布过相同内容了,请勿重复发帖。

lkicesky 发表于 2009-11-24 20:46
这个……确实是好东西
xie83544109 发表于 2009-12-10 11:15
twfy914 发表于 2009-12-10 13:25
Squn 发表于 2009-12-16 18:27
以前有汇编源码,但 不知道存哪里去了。
哈哈 delphi的更好~
574852485 发表于 2009-12-18 10:35
lpk 多开用的?
silly 发表于 2009-12-18 13:16
LZ这个代码加的,DELPHI+ASM.
主要还是ASM,没彻底翻译过来.看起来就是替换LPK,
dalao 发表于 2010-2-8 19:23
好东西顶一个!
zhan1616 发表于 2010-2-22 14:31
Delphi版不知道怎么样~!


那如果要修改401000处的EEEE改为FFFF,该怎么写呢???
zhan1616 发表于 2010-2-22 17:25
回复 1# Hmily


    这个为什么我一加进一点代码,就加载错误呢?

  例如:
   地址:00401000
  原数据:AAAA
  新数据:BBBB

   能否给个例子???

谢谢
您需要登录后才可以回帖 登录 | 注册[Register]

本版积分规则

返回列表

RSS订阅|小黑屋|处罚记录|联系我们|吾爱破解 - LCG - LSG ( 京ICP备16042023号 | 京公网安备 11010502030087号 )

GMT+8, 2024-11-17 00:55

Powered by Discuz!

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表