|
2行C代码转delphi 感谢
兄弟,4*4+0x1FE7960,即0x1fe7970就是NtDeviceIoControlFile的起始地址了,这个地址里面存放的就是这个函数内存的业务逻辑了,而不是你所说的函数地址了。所以你要hook NtDeviceIoControlFile这个函数的话,应该在调用这个函数的地方那里,把这个函数的地址替换成你自己的函数地址就行了。比如则才你贴出来的代码应该就是根本索引 号得到函数地址的。暂且把这个函数的名字叫做: GetFunctionAddr(index: Integer); 那么你实际应该做的事儿是:在这个函数返回之后,把它的返回值 保存起来,同时,把自己的函数地址返回给调用者就OK 了。不知道我说明白了没有? 比如你现在的程序可能是这样写的: funAddr := GetFunctionAddr(4); funAddr();//调用NtdeviceIoControlFile 现在要把这个程序写成: funAddr := myHookFunc;//你自己的hook函数的地址 funAddr();//调用你自己的Hook函数 |
|
2行C代码转delphi 感谢
解决了就好,希望我之前的代码和解释帮到你了。 有问题欢迎咨询我哦 |
|
2行C代码转delphi 感谢
你对指针的概念还没理解透。 像这种情况,它是不再需要重新赋值了。所有过滤过程其实操作的都是SystemProcessesInfo所指向的内存空间。 这个函数的算法主要是修改NextEntryDelta的值把同名其他进程屏蔽了而已,实际上这些进程的信息还是连带着返回了去的,只不过在用户层面没有办法准确的拿到这些信息罢了 |
|
2行C代码转delphi 感谢
Hook里面最后的pSystemProcesses就是指向最后一个进程的指针了,你再用它给SystemInformation赋值 ,肯定是遍历不到进程的 |
|
2行C代码转delphi 感谢
搞定没呢? |
|
2行C代码转delphi 感谢
function NewNtQuerySystemInformation( SystemInformationClass : SYSTEM_INFORMATION_CLASS; SystemInformation : PVOID; SystemInformationLength : ULONG; ReturnLength : PULONG) :NTSTATUS; stdcall; type TNewNtQuerySystemInformation= function ( SystemInformationClass : SYSTEM_INFORMATION_CLASS; SystemInformation : PVOID; SystemInformationLength : ULONG; ReturnLength : PULONG) :NTSTATUS; stdcall; var pSystemProcesses : PSYSTEM_PROCESSES; pSystemProcessesy : PSYSTEM_PROCESSES; //pbi : TPROCESS_BASIC_INFORMATION ; //bytesIO : ULONG; fh : cardinal; begin Hook[53].UnHook; fh:=NtQuerySystemInformation(SystemInformationClass,SystemInformation,SystemInformationLength,ReturnLength); if fh=0 then begin if SystemInformationClass = SystemProcessesAndThreadsInformation then begin pSystemProcesses := PSYSTEM_PROCESSES(SystemInformation); pSystemProcessesy := nil; showmessage((pSystemProcesses.ProcessName.Buffer)); while pSystemProcesses.NextEntryDelta<>0 do begin // I suppose you are just want to distinguish the processes with the same name of the current process if (pos('XYClient.exe',pSystemProcesses.ProcessName.Buffer)>0) and ( pSystemProcesses.ProcessId <> GetCurrentProcessId()) then begin if pSystemProcessesy<>nil then begin if pSystemProcesses.NextEntryDelta>0 then begin pSystemProcessesy.NextEntryDelta:= pSystemProcessesy.NextEntryDelta + pSystemProcesses.NextEntryDelta; end else pSystemProcessesy.NextEntryDelta:=0; end else begin if pSystemProcesses.NextEntryDelta>0 then begin Inc(PChar(SystemInformation), pSystemProcesses.NextEntryDelta); end else SystemInformation:=nil; end; end else pSystemProcessesy:= pSystemProcesses; //if the process name is not null, forward pSystemProcesses to // next process, and store the previous process entry address to pSystemProcessesy Inc(PChar(pSystemProcesses), pSystemProcesses.NextEntryDelta); end; end; end; Result:= TNewNtQuerySystemInformation(Hook[53].BaseAddr)(SystemInformationClass,SystemInformation,SystemInformationLength,ReturnLength); Hook[53].Hook; 给你修改了一下代码,在hook之前的逻辑都正确了,只要你的hook功能正确,就可以实现你想要的功能了。 |
|
帮我看下这段delphi HOOK吗,HOOK不到内容
我仔细看了一下,发现你卡在这里主要的问题是你没弄明白pSystemProcesses 这个指针所指向的内存中存储的是什么东西,这导致了你的代码里有一点问题,才会得不到ProcessId. zwQuerySystemInformation这个函数的第二个参数是 pSystemProcesses所指向的一块开辟好的内存区,这里面会存放当前系统中的所有进程信息,它实际上是个数据,因此你想遍历所有进程的话,需要不断的操作pSystemProcesses这个指针,使它每次移动到下个进程结构的起始处,进而得到你想要的进程信息(processid, processname),那么问题来了,怎么知道下个进程结构的起始处呢?这就要用到pSystemProcesses.NextEntryDelta了。这个成员里面存储的就是下个进程结构起始地址相对当前地址的偏移量。所以你的代码中 pSystemProcessesy.NextEntryDelta:=pSystemProcessesy.NextEntryDelta-4 这个语句很无理头.你代码里所有出现对NextEntryDelta进行操作的语句都是无意义的,不知道你想实现什么。。 另外,说明一下,其实你的程序执行到第一次循环的时候,是得到了processid 的,只不过恰好这个值是0,因为它是系统的自举进程,进程号就是0. 后续由于你操作NextEntryDelta不当,导致你没能继续遍历其他进程,所以在你看来,好像是什么信息都没得到一样。。 不知道你明白了没有? |
|
SystemInformation = (UCHAR*)SystemInformation + pCurr->NextEntryOffset;转delphi码感谢
SystemInformation := Inc((PChar)SystemInformation, (PChar)pCurr^NextEntryOffset)) |
|
HOOK的NtQuerySystemInformation逻辑问题
用C写的一段例子,你看看或者就有启发了 int main() { HMODULE hNtDll = GetModuleHandle(L"ntdll.dll"); if(!hNtDll) return -1; ZWQUERYSYSTEMINFORMATION ZwQuerySystemInformation = (ZWQUERYSYSTEMINFORMATION)GetProcAddress(hNtDll,"ZwQuerySystemInformation"); ULONG cbBuffer = 0x1000000; LPVOID pBuffer = NULL; pBuffer = malloc(cbBuffer); if(pBuffer == NULL) return -1; NTSTATUS ret = ZwQuerySystemInformation(SystemProcessesAndThreadsInformation,pBuffer,cbBuffer,NULL); if(ret != STATUS_SUCCESS) { printf("ZwQuerySystemInformation return failed with status %d\n", ret); } PSYSTEM_PROCESS_INFORMATION pInfo = (PSYSTEM_PROCESS_INFORMATION)pBuffer; for(;;) { if(pInfo->ProcessName.Buffer && !wcscmp(pInfo->ProcessName.Buffer, L"EnumProcess.exe")) { pInfo = (PSYSTEM_PROCESS_INFORMATION)(((PUCHAR)pInfo) + pInfo->NextEntryDelta); continue; } printf("PID: %d (%ls) \n",pInfo->ProcessId,pInfo->ProcessName.Buffer); if(pInfo->NextEntryDelta == 0) break; pInfo = (PSYSTEM_PROCESS_INFORMATION)(((PUCHAR)pInfo) + pInfo->NextEntryDelta); } free(pBuffer); getchar(); return 0; } |
|
HOOK的NtQuerySystemInformation逻辑问题
难道现在你调用完NtQuerySystemInformation 之后,还不能成功返回一些有用的进程信息? 如果是这样的话,你需要看看fh的返回值是什么,然后根据对应的返回值进行参数调整。比如说: fh:=NtQuerySystemInformation(SystemProcessesAndThreadsInformation,SystemInformation,SystemInformationLength,ReturnLength); 这个语句的话,里面第一个参数指明你要查询的是进程和线程的信息,第二个参数是用来返回系统当前所有进程信息的一块内存, 第三个参数应该是这块内存的大小,第四个参数是返回据的总大小。一般应该让第二个参数提供的存存空间足够大才行。比如: SystemInformation = malloc(1000000*sizeof(char)) ; //这里是申请了大约一M的内存 然后这样调用: fh:=NtQuerySystemInformation(SystemProcessesAndThreadsInformation,SystemInformation,1000000,ReturnLength); |
|
HOOK的NtQuerySystemInformation逻辑问题
提示你一下:pSystemProcesses->ProcessName.Buffer 是对应的进程的image名字,你可以根据这个名字来区分: if( (GetProcessId() != GetCurrentProcessId()) && (!wcscmp(pSystemProcesses->ProcessName.Buffer,"a.exe")) { //同名的其他进程,此时让它什么也不能做? } |
|
HOOK的NtQuerySystemInformation逻辑问题
这个事儿不难,现在你想做的事儿就是写个HOOK程序,把a.exe里面调用NtQuerySystemInformation的地方修改成你自己的处理代码 ,是这样吗? 还是你自己现在就有a.exe的源代码? |
|
HOOK的NtQuerySystemInformation逻辑问题
我建议你先把你要做的事儿的前因后果描述一下,咱们再说该怎么去做。 |
|
HOOK的NtQuerySystemInformation逻辑问题
我感觉上下文不够全,很难预测你到底想做什么,所以想帮助也无从下手 |
|
HOOK的NtQuerySystemInformation逻辑问题
你昨天贴的汇编的代码是不是就是用这个代码生成的? |
|
一段汇编代码,帮我看下谢谢
先说说我对整体汇编代码的理解: 整体来说,汇编代码是先通过OpenProcess来得到一些进程的Handle之后,再对这些Handle做如下处理:如果这些进程的ModuleBase目录里面包含有"tmp"相关的字样,则直接关闭该Handle,如果没有"TMP"字样,则查看一下是否是标准输入,输出,出错等,如果是,则会调用"10003C5E"处的函数,由于没有更多的上下文信息,无法具体说明它是什么意思.如果该Handle不是标准输入,输出,出错等,且没有TMP字样,而且不是当前进程,则直接CloseHandle. 整个红色字部分总体来说就做这么几个逻辑判断. 比较GetProcessId 和 GetCurrentProcessId的意思就是用于区分当前正在操作的Handle是否是当前进程的Handle,当前进程的Handle是不能在这个过程中Close的. |
|
这段IDA反编译的数据解密代码是否有现成的C算法?
这个真没见过,估计这个反编译的代码也是经过你自己手工加工过的吧,看起来很撞进C代码了 |
|
[求助]求其中的算法
简单读了一下代码,发现该stkey.dll里提供的discryptpassword是比较通用的加密解密算法,时空SCM,CCERP,KSOA,IB等用户密码加密,解密工具都是用之套代码做的,懒得详细说明该算法怎么一步步做的,但是可以给你个代码参考一下,你自己读一下吧,加密解密都有。 unit PassWord; interface uses Windows,Classes,StrUtils,SysUtils; type ary=array[0..5] of PChar; TRoyPass=class(TComponent) private aryA:ary; aryB:ary; aryC:ary; Constructor Create(AOwner:TComponent);Override; function A(paramString:String;var paramArrayOfString:ary):String; function jdMethod_if(paramString:String;var paramArrayOfString:ary):String; public function Encrypt(paramString:string):string; function Decrypt(paramString:string):string; protected end; implementation constructor TRoyPass.Create(AOwner:TComponent); begin Inherited Create(AOwner); randomize; aryA[0] := 'ke3wms'; aryA[1] := 'jnx9i8'; aryA[2] := 'dpqzl6'; aryA[3] := 'vyg1bh'; aryA[4] := '7a4c2f'; aryA[5] := 'u5rto0'; aryB[0] := 'wa6j1c'; aryB[1] := 'fblrk7'; aryB[2] := 'mg9q0s'; aryB[3] := 'vu3zth'; aryB[4] := 'po4xy2'; aryB[5] := 'ni5d8e'; aryC[0] := 'mg9qwc'; aryC[1] := 'vu3zth'; aryC[2] := 'a6j10s'; aryC[3] := 'fbk7lr'; aryC[4] := '5dpoy2'; aryC[5] := '4xni8e'; end; function TRoyPass.Encrypt(paramString:string):String; var str : String; i,j : Integer; begin //randomize; aryA[0] := 'ke3wms'; aryA[1] := 'jnx9i8'; aryA[2] := 'dpqzl6'; aryA[3] := 'vyg1bh'; aryA[4] := '7a4c2f'; aryA[5] := 'u5rto0'; aryB[0] := 'wa6j1c'; aryB[1] := 'fblrk7'; aryB[2] := 'mg9q0s'; aryB[3] := 'vu3zth'; aryB[4] := 'po4xy2'; aryB[5] := 'ni5d8e'; aryC[0] := 'mg9qwc'; aryC[1] := 'vu3zth'; aryC[2] := 'a6j10s'; aryC[3] := 'fbk7lr'; aryC[4] := '5dpoy2'; aryC[5] := '4xni8e'; str := A(LowerCase(paramString), aryA); i := length(str); for j := 1 to 3 do begin str := IntToStr(i mod 6) + str; i := i div 6; end; while (length(str) < 60) do str := str + IntToStr(Random(6)); //Result := str; result:= jdMethod_if(str, aryB); end; function TRoyPass.Decrypt(paramString:string):string; var str : string; i,j : integer; begin aryA[0] := 'ke3wms'; aryA[1] := 'jnx9i8'; aryA[2] := 'dpqzl6'; aryA[3] := 'vyg1bh'; aryA[4] := '7a4c2f'; aryA[5] := 'u5rto0'; aryB[0] := 'wa6j1c'; aryB[1] := 'fblrk7'; aryB[2] := 'mg9q0s'; aryB[3] := 'vu3zth'; aryB[4] := 'po4xy2'; aryB[5] := 'ni5d8e'; aryC[0] := 'mg9qwc'; aryC[1] := 'vu3zth'; aryC[2] := 'a6j10s'; aryC[3] := 'fbk7lr'; aryC[4] := '5dpoy2'; aryC[5] := '4xni8e'; str := ''; str := A(paramString, aryB); i := 0; for j := 1 to 3 do i := i * 6 + StrToInt(MidBStr(str,j,1)); str := MidBStr(str,3+1, i); Result := jdMethod_if(str, aryA); end; function TRoyPass.A(paramString:String;var paramArrayOfString:ary):String; var str1,str2 : String; i,j,k : integer; begin str1 := ''; str2 := ''; for i:=0 to Length(paramString)-1 do for j:=0 to 5 do begin k := Pos(MidBStr(paramString,i+1,1),paramArrayOfString[j]); if (k>0) then begin str1 := str1 + IntToStr(j); str2 := IntToStr(k-1) + str2; break; end; end; Result := str1 + str2; end; function TRoyPass.jdMethod_if(paramString:String;var paramArrayOfString:ary):String; var str1,str2,str3 : string; i,j : Integer; begin str1 := ''; i := Length(paramString); if (i mod 2 =1) then Result :=''; for j := 0 to (i div 2)-1 do begin str2 := ''; str2 := paramArrayOfString[StrToInt(MidBStr(paramString,j+1,1))]; str3 := MidBStr(paramString,i - j ,1); str1 := str1 + MidBStr(str2,StrToInt(str3)+1,1); end; Result:= str1; end; end. |
|
[原创]Bullseye Coverage完美破解
很抱歉,出于对商业软件知识版权的保护目的,我不能把keygen公开共享给你。因为有了这个keygen,就可以用更便宜的价格出售这款软件了,所以不能给你。但是如果你想要个license的话,我倒是可以送你一个授权给单个用户,特定平台的,有效期为三个月的license key. 如果你需要的话,联系我吧。 |
操作理由
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 }}
勋章
兑换勋章
证书
证书查询 >
能力值