|
[求助]APIHOOK的问题
为啥这个可以啊?只是换了个想要HOOK的API就不行了? unit apihook1 ; interface uses SysUtils, Windows, WinSock, Dialogs; type { 要HOOK的API函数定义 } TCreatePW = function (lpApplicationName: PWideChar; lpCommandLine: PWideChar; lpProcessAttributes, lpThreadAttributes: PSecurityAttributes; bInheritHandles: BOOL; dwCreationFlags: DWORD; lpEnvironment: Pointer; lpCurrentDirectory: PWideChar; const lpStartupInfo: TStartupInfo; var lpProcessInformation: TProcessInformation): BOOL; stdcall; procedure HookAPI; procedure UnHookAPI; var ProcessHandle: HWND; BaseAddress: Pointer; OldProc: array [0..7] of Byte; NewPorc: array [0..7] of Byte; implementation { 自定义的函数,用于覆盖系统的CreateProcessW函数 } function MyCreatePW(lpApplicationName: PWideChar; lpCommandLine: PWideChar; lpProcessAttributes, lpThreadAttributes: PSecurityAttributes; bInheritHandles: BOOL; dwCreationFlags: DWORD; lpEnvironment: Pointer; lpCurrentDirectory: PWideChar; const lpStartupInfo: TStartupInfo; var lpProcessInformation: TProcessInformation): BOOL; stdcall; var nSize: Cardinal; begin { 显示打开程序的命令行和文件名} MessageBoxW(0, lpCommandLine ,lpApplicationName , 0); WriteProcessMemory(ProcessHandle, BaseAddress, @OldProc, 8, nSize);//這一句是修改成原來函數的地址,讓程序能正常打開 Result := CreateProcessW(lpApplicationName, lpCommandLine, lpProcessAttributes, lpThreadAttributes, bInheritHandles, dwCreationFlags, lpEnvironment, lpCurrentDirectory, lpStartupInfo, lpProcessInformation); WriteProcessMemory(ProcessHandle, BaseAddress, @NewPorc, 8, nSize);//在程序正常打開後再修改成自定義函數的地址,使所有程序在下次打開時都要先調用自定義函數 end; procedure HookAPI; var DLLModule: THandle; nSize: Cardinal; Dat: DWORD; Tmp : array [0..3] of Byte; begin ProcessHandle := GetCurrentProcess(); DLLModule := LoadLibrary('kernel32.dll'); { 系统函数入口点地址 } BaseAddress := GetProcAddress(DLLModule, 'CreateProcessW'); Dat := DWORD(@MyCreatePW); Move(Dat, Tmp, 4); NewPorc[0] := $B8; NewPorc[1] := Tmp[0]; NewPorc[2] := Tmp[1]; NewPorc[3] := Tmp[2]; NewPorc[4] := Tmp[3]; NewPorc[5] := $FF; NewPorc[6] := $E0; NewPorc[7] := 0; { 读取系统函数内存地址 } ReadProcessMemory(ProcessHandle, BaseAddress, @OldProc, 8, nSize); { 用自己的函数地址覆盖系统的函数地址 } WriteProcessMemory(ProcessHandle, BaseAddress, @NewPorc, 8, nSize); CloseHandle(ProcessHandle); end; procedure UnHookAPI; var nSize: Cardinal; begin { 恢复所修改的地址 } WriteProcessMemory(ProcessHandle, BaseAddress, @OldProc, 8, nSize); end; end. |
|
[求助]为什么APIHOOK对有些程序没用了?
我用的下面链接中的源码钩WIDECHARTOMULTIBYTE为啥只对记事本有效了?其它程序都不行 http://www.pediy.com/bbshtml/bbs7/pediy7-791.htm |
|
[原创]Hook Api lib 0.4 for C
在哪呀?那是什么 |
|
[求助]如何用API实现将程序中的资源释放为文件,看看我写的这个函数
是不是可以把DLL放到资源中,程序运行的时候通过这个函数再释放出来,然后程序就可以使用DLL了? |
|
[求助]请问OD中bp VirutalFree是什么意思?
如何知道程序会调用 这个函数啊?有时候按CTRL+N也不能显示出全部 |
|
[求助]请问OD中bp VirutalFree是什么意思?
我也想知道,帮你顶 |
|
[分享]破解之外--与一位求破解的朋友扯皮实录
还以为是RMB呢,弄了半天才那么点钱 |
|
[求助]当兴趣变成职业,我们怎么面对?
真正变成职业的时候就没那么有兴趣了 |
|
[求助]关于两段关机代码的解读?
好复杂呀,还不如直接调用系统的SHUTDOWN了 |
|
[求助]用CE随便打开了个进程查找到00AC3A52的地址内容是"2368485"
郁闷,白浪费半天时间 |
|
[求助]用CE随便打开了个进程查找到00AC3A52的地址内容是"2368485"
读字符串跟读整形不一样啊? |
|
|
操作理由
RANk
{{ user_info.golds == '' ? 0 : user_info.golds }}
雪币
{{ experience }}
课程经验
{{ score }}
学习收益
{{study_duration_fmt}}
学习时长
基本信息
荣誉称号:
{{ honorary_title }}
能力排名:
No.{{ rank_num }}
等 级:
LV{{ rank_lv-100 }}
活跃值:
在线值:
浏览人数:{{ visits }}
最近活跃:{{ last_active_time }}
注册时间:{{ user_info.create_date_jsonfmt }}
勋章
兑换勋章
证书
证书查询 >
能力值