nt!KiAttachProcess:
804f99f8 8bff mov edi,edi
804f99fa 55 push ebp
804f99fb 8bec mov ebp,esp
804f99fd 53 push ebx
804f99fe 56 push esi
804f99ff 8b7508 mov esi,dword ptr [ebp+8]
804f9a02 57 push edi
804f9a03 ff7514 push dword ptr [ebp+14h]
804f9a06 8b7d0c mov edi,dword ptr [ebp+0Ch]
804f9a09 66ff4760 inc word ptr [edi+60h]
804f9a0d 8d5e34 lea ebx,[esi+34h]
804f9a10 53 push ebx
804f9a11 e85afbffff
call nt!KiMoveApcState (804f9570) //位置A804f9a16 895b04 mov dword ptr [ebx+4],ebx
804f9a19 891b mov dword ptr [ebx],ebx
804f9a1b 8d463c lea eax,[esi+3Ch]
804f9a1e 894004 mov dword ptr [eax+4],eax
804f9a21 8900 mov dword ptr [eax],eax
804f9a23 8d864c010000 lea eax,[esi+14Ch]
804f9a29 394514 cmp dword ptr [ebp+14h],eax
804f9a2c 897e44 mov dword ptr [esi+44h],edi
804f9a2f c6464800 mov byte ptr [esi+48h],0
804f9a33 c6464900 mov byte ptr [esi+49h],0
804f9a37 c6464a00 mov byte ptr [esi+4Ah],0
804f9a3b 7513 jne nt!KiAttachProcess+0x58 (804f9a50)
nt!KiAttachProcess+0x45:
804f9a3d 898638010000 mov dword ptr [esi+138h],eax
804f9a43 899e3c010000 mov dword ptr [esi+13Ch],ebx
804f9a49 c6866501000001 mov byte ptr [esi+165h],1
nt!KiAttachProcess+0x58:
804f9a50 807f6500 cmp byte ptr [edi+65h],0
804f9a54 753d jne nt!KiAttachProcess+0x9b (804f9a93)
nt!KiAttachProcess+0x5e:
804f9a56 8d7740 lea esi,[edi+40h]
804f9a59 eb19 jmp nt!KiAttachProcess+0x7c (804f9a74)
nt!KiAttachProcess+0x63:
804f9a5b 8b10 mov edx,dword ptr [eax]
804f9a5d 8d48a0 lea ecx,[eax-60h]
804f9a60 8b4004 mov eax,dword ptr [eax+4]
804f9a63 8910 mov dword ptr [eax],edx
804f9a65 894204 mov dword ptr [edx+4],eax
804f9a68 c6812901000000 mov byte ptr [ecx+129h],0
804f9a6f e8a0a60000
call nt!KiReadyThread (80504114)位置B
nt!KiAttachProcess+0xbf:
804f9ab7 c6476502 mov byte ptr [edi+65h],2
804f9abb a100d55580
mov eax,dword ptr [nt!KiProcessInSwapListHead (8055d500)] 这个地方该如何写 804f9ac0 8d4f48 lea ecx,[edi+48h]
nt!KiAttachProcess+0xcb:
804f9ac3 8901 mov dword ptr [ecx],eax
804f9ac5 89450c mov dword ptr [ebp+0Ch],eax
804f9ac8 8bd1 mov edx,ecx
804f9aca bb00d55580
mov ebx,offset nt!KiProcessInSwapListHead (8055d500)这里C804f9acf f00fb113 lock cmpxchg dword ptr [ebx],edx
804f9ad3 3b450c cmp eax,dword ptr [ebp+0Ch]
804f9ad6 75eb jne nt!KiAttachProcess+0xcb (804f9ac3)
nt!KiAttachProcess+0xe0:
804f9ad8 e8f1faffff call nt!KiSetSwapEvent (804f95ce)
nt!KiAttachProcess+0xe5:
804f9add 33c9 xor ecx,ecx
804f9adf 41 inc ecx
804f9ae0 ff1588904d80
call dword ptr [nt!_imp_KeAcquireQueuedSpinLockRaiseToSynch (804d9088)]这里D804f9ae6 8ad0 mov dl,al
804f9ae8 64a120000000 mov eax,dword ptr fs:[00000020h]
804f9aee 8b4814 mov ecx,dword ptr [eax+14h]
804f9af1 8b4514 mov eax,dword ptr [ebp+14h]
804f9af4 8b4010 mov eax,dword ptr [eax+10h]
804f9af7 8bd9 mov ebx,ecx
804f9af9 f7d3 not ebx
804f9afb 215834 and dword ptr [eax+34h],ebx
804f9afe 094f34 or dword ptr [edi+34h],ecx
804f9b01 33c9 xor ecx,ecx
804f9b03 41 inc ecx
804f9b04 ff1530914d80
call dword ptr [nt!_imp_KeReleaseQueuedSpinLock (804d9130)]这里E804f9b0a 8a4510 mov al,byte ptr [ebp+10h]
我想重新写个kiattachprocess 照着汇编抄 结果A B C D E几处不知道怎么处理 A B处我是通过查找e8来定位的 可以正确的弄出来(用windbg 看的话那里的代码自动变成了类似这样的 如A处的call nt!KiMoveApcState (804f9570)变成了f7798762 ff156ca079f7 call dword ptr [word!KiMoveApcStateA (f779a06c)] //KiMoveApcStateA是我通过e8定位得到的值 *(int*)Addr+addr +4 windbg下查看f779a06c里面的值的确是804f9570 ) 但是C D E 3处的我也按照这个来弄就怎么都不正确 请大虾指点12 到底那里该怎么写。。。
[招生]科锐逆向工程师培训(2024年11月15日实地,远程教学同时开班, 第51期)