首页
社区
课程
招聘
[原创]逆向KiFastCallEntry
发表于: 2013-4-12 16:17 9350

[原创]逆向KiFastCallEntry

2013-4-12 16:17
9350
kd> u 83c55300 L80
nt!KiFastCallEntry:
83c55300 b923000000      mov     ecx,23h
83c55305 6a30            push    30h
83c55307 0fa1            pop     fs
83c55309 8ed9            mov     ds,cx
83c5530b 8ec1            mov     es,cx
83c5530d 648b0d40000000  mov     ecx,dword ptr fs:[40h]
83c55314 8b6104          mov     esp,dword ptr [ecx+4]
83c55317 6a23            push    23h
83c55319 52              push    edx
83c5531a 9c              pushfd
83c5531b 6a02            push    2
83c5531d 83c208          add     edx,8
83c55320 9d              popfd
83c55321 804c240102      or      byte ptr [esp+1],2
83c55326 6a1b            push    1Bh
83c55328 ff350403dfff    push    dword ptr ds:[0FFDF0304h]
83c5532e 6a00            push    0
83c55330 55              push    ebp
83c55331 53              push    ebx
83c55332 56              push    esi
83c55333 57              push    edi
83c55334 648b1d1c000000  mov     ebx,dword ptr fs:[1Ch]
83c5533b 6a3b            push    3Bh
83c5533d 8bb324010000    mov     esi,dword ptr [ebx+124h]
83c55343 ff33            push    dword ptr [ebx]
83c55345 c703ffffffff    mov     dword ptr [ebx],0FFFFFFFFh
83c5534b 8b6e28          mov     ebp,dword ptr [esi+28h]
83c5534e 6a01            push    1
83c55350 83ec48          sub     esp,48h
83c55353 81ed9c020000    sub     ebp,29Ch
83c55359 c6863a01000001  mov     byte ptr [esi+13Ah],1
83c55360 3bec            cmp     ebp,esp
83c55362 7597            jne     nt!KiFastCallEntry2+0x49 (83c552fb)
83c55364 83652c00        and     dword ptr [ebp+2Ch],0
83c55368 f64603df        test    byte ptr [esi+3],0DFh
83c5536c 89ae28010000    mov     dword ptr [esi+128h],ebp
83c55372 0f8538feffff    jne     nt!Dr_FastCallDrSave (83c551b0)
83c55378 8b5d60          mov     ebx,dword ptr [ebp+60h]
83c5537b 8b7d68          mov     edi,dword ptr [ebp+68h]
83c5537e 89550c          mov     dword ptr [ebp+0Ch],edx
83c55381 c74508000ddbba  mov     dword ptr [ebp+8],0BADB0D00h
83c55388 895d00          mov     dword ptr [ebp],ebx
83c5538b 897d04          mov     dword ptr [ebp+4],edi
83c5538e fb              sti
83c5538f 8bf8            mov     edi,eax
83c55391 c1ef08          shr     edi,8
83c55394 83e710          and     edi,10h
83c55397 8bcf            mov     ecx,edi
83c55399 03bebc000000    add     edi,dword ptr [esi+0BCh]
83c5539f 8bd8            mov     ebx,eax
83c553a1 25ff0f0000      and     eax,0FFFh
83c553a6 3b4708          cmp     eax,dword ptr [edi+8]
83c553a9 0f8333fdffff    jae     nt!KiBBTUnexpectedRange (83c550e2)
83c553af 83f910          cmp     ecx,10h
83c553b2 751a            jne     nt!KiFastCallEntry+0xce (83c553ce)
83c553b4 8b8e88000000    mov     ecx,dword ptr [esi+88h]
83c553ba 33f6            xor     esi,esi
83c553bc 0bb1700f0000    or      esi,dword ptr [ecx+0F70h]
83c553c2 740a            je      nt!KiFastCallEntry+0xce (83c553ce)
83c553c4 52              push    edx
83c553c5 50              push    eax
83c553c6 ff154ca9d783    call    dword ptr [nt!KeGdiFlushUserBatch (83d7a94c)]
83c553cc 58              pop     eax
83c553cd 5a              pop     edx
83c553ce 64ff05b0060000  inc     dword ptr fs:[6B0h]
83c553d5 8bf2            mov     esi,edx
83c553d7 33c9            xor     ecx,ecx
83c553d9 8b570c          mov     edx,dword ptr [edi+0Ch]
83c553dc 8b3f            mov     edi,dword ptr [edi]
83c553de 8a0c10          mov     cl,byte ptr [eax+edx]
83c553e1 8b1487          mov     edx,dword ptr [edi+eax*4]
83c553e4 2be1            sub     esp,ecx
83c553e6 c1e902          shr     ecx,2
83c553e9 8bfc            mov     edi,esp
83c553eb 3b351ca7d783    cmp     esi,dword ptr [nt!MmUserProbeAddress (83d7a71c)]
83c553f1 0f832e020000    jae     nt!KiSystemCallExit2+0xa5 (83c55625)
83c553f7 f3a5            rep movs dword ptr es:[edi],dword ptr [esi]
83c553f9 f6456c01        test    byte ptr [ebp+6Ch],1
83c553fd 7416            je      nt!KiFastCallEntry+0x115 (83c55415)
83c553ff 648b0d24010000  mov     ecx,dword ptr fs:[124h]
83c55406 8b3c24          mov     edi,dword ptr [esp]
83c55409 89993c010000    mov     dword ptr [ecx+13Ch],ebx
83c5540f 89b92c010000    mov     dword ptr [ecx+12Ch],edi
83c55415 8bda            mov     ebx,edx
83c55417 f6058878d48340  test    byte ptr [nt!PerfGlobalGroupMask+0x8 (83d47888)],40h
83c5541e 0f954512        setne   byte ptr [ebp+12h]
83c55422 0f858c030000    jne     nt!KiServiceExit2+0x17b (83c557b4)
83c55428 ffd3            call    ebx
83c5542a f6456c01        test    byte ptr [ebp+6Ch],1
83c5542e 7434            je      nt!KiFastCallEntry+0x164 (83c55464)
83c55430 8bf0            mov     esi,eax
83c55432 ff156831c183    call    dword ptr [nt!_imp__KeGetCurrentIrql (83c13168)]
83c55438 0ac0            or      al,al
83c5543a 0f853b030000    jne     nt!KiServiceExit2+0x142 (83c5577b)
83c55440 8bc6            mov     eax,esi
83c55442 648b0d24010000  mov     ecx,dword ptr fs:[124h]
83c55449 f68134010000ff  test    byte ptr [ecx+134h],0FFh
83c55450 0f8543030000    jne     nt!KiServiceExit2+0x160 (83c55799)
83c55456 8b9184000000    mov     edx,dword ptr [ecx+84h]
83c5545c 0bd2            or      edx,edx
83c5545e 0f8535030000    jne     nt!KiServiceExit2+0x160 (83c55799)
83c55464 8be5            mov     esp,ebp
83c55466 807d1200        cmp     byte ptr [ebp+12h],0
83c5546a 0f8550030000    jne     nt!KiServiceExit2+0x187 (83c557c0)
83c55470 648b0d24010000  mov     ecx,dword ptr fs:[124h]
83c55477 8b553c          mov     edx,dword ptr [ebp+3Ch]
83c5547a 899128010000    mov     dword ptr [ecx+128h],edx
nt!KiServiceExit:
83c55480 fa              cli
83c55481 f6457202        test    byte ptr [ebp+72h],2
83c55485 7506            jne     nt!KiServiceExit+0xd (83c5548d)
83c55487 f6456c01        test    byte ptr [ebp+6Ch],1
83c5548b 7467            je      nt!KiServiceExit+0x74 (83c554f4)
83c5548d 648b1d24010000  mov     ebx,dword ptr fs:[124h]
83c55494 f6430202        test    byte ptr [ebx+2],2
83c55498 7408            je      nt!KiServiceExit+0x22 (83c554a2)
83c5549a 50              push    eax
83c5549b 53              push    ebx
83c5549c e8a4dc0900      call    nt!KiCopyCounters (83cf3145)
83c554a1 58              pop     eax
83c554a2 c6433a00        mov     byte ptr [ebx+3Ah],0
83c554a6 807b5600        cmp     byte ptr [ebx+56h],0
83c554aa 7448            je      nt!KiServiceExit+0x74 (83c554f4)
83c554ac 8bdd            mov     ebx,ebp
83c554ae 894344          mov     dword ptr [ebx+44h],eax
83c554b1 c743503b000000  mov     dword ptr [ebx+50h],3Bh
83c554b8 c7433823000000  mov     dword ptr [ebx+38h],23h
83c554bf c7433423000000  mov     dword ptr [ebx+34h],23h
83c554c6 c7433000000000  mov     dword ptr [ebx+30h],0

[课程]Android-CTF解题方法汇总!

收藏
免费 0
支持
分享
最新回复 (21)
雪    币: 221
活跃值: (10)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
2
这个原创创的好哇~
2013-4-12 16:43
0
雪    币: 544
活跃值: (264)
能力值: ( LV12,RANK:210 )
在线值:
发帖
回帖
粉丝
3
灌水贴,鉴定完毕!~
2013-4-12 16:46
0
雪    币: 596
活跃值: (449)
能力值: ( LV12,RANK:320 )
在线值:
发帖
回帖
粉丝
4
逆的不错 学习了
2013-4-12 17:17
0
雪    币: 11
活跃值: (40)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
5
偷偷告诉你……整个Windows的都被我过……
2013-4-12 17:23
0
雪    币: 796
活跃值: (370)
能力值: ( LV9,RANK:380 )
在线值:
发帖
回帖
粉丝
6
太神奇了,建议版主给精华。
2013-4-12 17:31
0
雪    币: 773
活跃值: (442)
能力值: ( LV9,RANK:200 )
在线值:
发帖
回帖
粉丝
7
顶LZ,确实神奇。
2013-4-12 17:34
0
雪    币: 6400
活跃值: (4160)
能力值: ( LV10,RANK:163 )
在线值:
发帖
回帖
粉丝
8
    吓死了,太吓人了,建议版主给10万个精.
2013-4-12 17:35
0
雪    币: 63
活跃值: (433)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
9
楼上都是大神,没看懂啊。
2013-4-12 17:44
0
雪    币: 1361
活跃值: (1052)
能力值: ( LV3,RANK:20 )
在线值:
发帖
回帖
粉丝
10
此贴必火 膜拜阿
2013-4-12 17:44
0
雪    币: 84
活跃值: (25)
能力值: ( LV3,RANK:20 )
在线值:
发帖
回帖
粉丝
11
我擦。。原来windbg可以这样用的。。。必须给精华。。
2013-4-12 18:07
0
雪    币: 95
活跃值: (64)
能力值: ( LV4,RANK:50 )
在线值:
发帖
回帖
粉丝
12
大家都喜欢调侃吗?
2013-4-12 18:33
0
雪    币: 114
活跃值: (180)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
13
我承认我笑了。。
2013-4-12 18:44
0
雪    币: 2120
活跃值: (73)
能力值: ( LV4,RANK:50 )
在线值:
发帖
回帖
粉丝
14
lz是大牛 大家不要黑他
2013-4-12 20:08
0
雪    币: 2177
活跃值: (2045)
能力值: (RANK:400 )
在线值:
发帖
回帖
粉丝
15
逆的不错 学习了.
2013-4-12 20:13
0
雪    币: 81
活跃值: (10)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
16
发错板块了.... 这是娱乐贴吧 哈哈~
2013-4-12 20:17
0
雪    币: 11
活跃值: (40)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
17
说不定是人家自己写了一国windbg呢……此乃真大牛耶……
2013-4-12 20:42
0
雪    币: 230
活跃值: (15)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
18
Save 收藏以后有用。
2013-4-15 02:07
0
雪    币: 100
活跃值: (70)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
19
太强悍了, 学习.
2013-4-15 09:31
0
雪    币: 1042
活跃值: (470)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
20
此贴必须MARK啊.
2013-4-15 15:05
0
雪    币: 43
活跃值: (25)
能力值: ( LV3,RANK:20 )
在线值:
发帖
回帖
粉丝
21
楼主不会是直接拷贝windbg的吧!
以下是我从windbg上拷贝的

nt!KiFastCallEntry:
83e510c0 b923000000      mov     ecx,23h
83e510c5 6a30            push    30h
83e510c7 0fa1            pop     fs
83e510c9 8ed9            mov     ds,cx
83e510cb 8ec1            mov     es,cx
83e510cd 648b0d40000000  mov     ecx,dword ptr fs:[40h]
83e510d4 8b6104          mov     esp,dword ptr [ecx+4]
83e510d7 6a23            push    23h
83e510d9 52              push    edx
83e510da 9c              pushfd
83e510db 6a02            push    2
83e510dd 83c208          add     edx,8
83e510e0 9d              popfd
83e510e1 804c240102      or      byte ptr [esp+1],2
83e510e6 6a1b            push    1Bh
83e510e8 ff350403dfff    push    dword ptr ds:[0FFDF0304h]
83e510ee 6a00            push    0
83e510f0 55              push    ebp
83e510f1 53              push    ebx
83e510f2 56              push    esi
83e510f3 57              push    edi
83e510f4 648b1d1c000000  mov     ebx,dword ptr fs:[1Ch]
83e510fb 6a3b            push    3Bh
83e510fd 8bb324010000    mov     esi,dword ptr [ebx+124h]
83e51103 ff33            push    dword ptr [ebx]
83e51105 c703ffffffff    mov     dword ptr [ebx],0FFFFFFFFh
83e5110b 8b6e28          mov     ebp,dword ptr [esi+28h]
83e5110e 6a01            push    1
83e51110 83ec48          sub     esp,48h
83e51113 81ed9c020000    sub     ebp,29Ch
83e51119 c6863a01000001  mov     byte ptr [esi+13Ah],1
83e51120 3bec            cmp     ebp,esp
83e51122 7597            jne     nt!KiFastCallEntry2+0x49 (83e510bb)

nt!KiFastCallEntry+0x64:
83e51124 83652c00        and     dword ptr [ebp+2Ch],0
83e51128 f64603df        test    byte ptr [esi+3],0DFh
83e5112c 89ae28010000    mov     dword ptr [esi+128h],ebp
83e51132 0f8538feffff    jne     nt!Dr_FastCallDrSave (83e50f70)

nt!KiFastCallEntry+0x78:
83e51138 8b5d60          mov     ebx,dword ptr [ebp+60h]
83e5113b 8b7d68          mov     edi,dword ptr [ebp+68h]
83e5113e 89550c          mov     dword ptr [ebp+0Ch],edx
83e51141 c74508000ddbba  mov     dword ptr [ebp+8],0BADB0D00h
83e51148 895d00          mov     dword ptr [ebp],ebx
83e5114b 897d04          mov     dword ptr [ebp+4],edi
83e5114e fb              sti

nt!KiFastCallEntry+0x8f:
83e5114f 8bf8            mov     edi,eax
83e51151 c1ef08          shr     edi,8
83e51154 83e710          and     edi,10h
83e51157 8bcf            mov     ecx,edi
83e51159 03bebc000000    add     edi,dword ptr [esi+0BCh]
83e5115f 8bd8            mov     ebx,eax
83e51161 25ff0f0000      and     eax,0FFFh
83e51166 3b4708          cmp     eax,dword ptr [edi+8]
83e51169 0f8333fdffff    jae     nt!KiBBTUnexpectedRange (83e50ea2)

nt!KiFastCallEntry+0xaf:
83e5116f 83f910          cmp     ecx,10h
83e51172 751a            jne     nt!KiFastCallEntry+0xce (83e5118e)

nt!KiFastCallEntry+0xb4:
83e51174 8b8e88000000    mov     ecx,dword ptr [esi+88h]
83e5117a 33f6            xor     esi,esi
83e5117c 0bb1700f0000    or      esi,dword ptr [ecx+0F70h]
83e51182 740a            je      nt!KiFastCallEntry+0xce (83e5118e)

nt!KiFastCallEntry+0xc4:
83e51184 52              push    edx
83e51185 50              push    eax
83e51186 ff154cd9f783    call    dword ptr [nt!KeGdiFlushUserBatch (83f7d94c)]
83e5118c 58              pop     eax
83e5118d 5a              pop     edx

nt!KiFastCallEntry+0xce:
83e5118e 64ff05b0060000  inc     dword ptr fs:[6B0h]
83e51195 8bf2            mov     esi,edx
83e51197 33c9            xor     ecx,ecx
83e51199 8b570c          mov     edx,dword ptr [edi+0Ch]
83e5119c 8b3f            mov     edi,dword ptr [edi]
83e5119e 8a0c10          mov     cl,byte ptr [eax+edx]
83e511a1 8b1487          mov     edx,dword ptr [edi+eax*4]
83e511a4 2be1            sub     esp,ecx
83e511a6 c1e902          shr     ecx,2
83e511a9 8bfc            mov     edi,esp
83e511ab 3b351cd7f783    cmp     esi,dword ptr [nt!MmUserProbeAddress (83f7d71c)]
83e511b1 0f832e020000    jae     nt!KiSystemCallExit2+0xa5 (83e513e5)

nt!KiFastCallEntry+0xf7:
83e511b7 f3a5            rep movs dword ptr es:[edi],dword ptr [esi]
83e511b9 f6456c01        test    byte ptr [ebp+6Ch],1
83e511bd 7416            je      nt!KiFastCallEntry+0x115 (83e511d5)

nt!KiFastCallEntry+0xff:
83e511bf 648b0d24010000  mov     ecx,dword ptr fs:[124h]
83e511c6 8b3c24          mov     edi,dword ptr [esp]
83e511c9 89993c010000    mov     dword ptr [ecx+13Ch],ebx
83e511cf 89b92c010000    mov     dword ptr [ecx+12Ch],edi

nt!KiFastCallEntry+0x115:
83e511d5 8bda            mov     ebx,edx
83e511d7 f60508a9f48340  test    byte ptr [nt!PerfGlobalGroupMask+0x8 (83f4a908)],40h
83e511de 0f954512        setne   byte ptr [ebp+12h]
83e511e2 0f858c030000    jne     nt!KiServiceExit2+0x17b (83e51574)

nt!KiFastCallEntry+0x128:
83e511e8 ffd3            call    ebx

nt!KiFastCallEntry+0x12a:
83e511ea f6456c01        test    byte ptr [ebp+6Ch],1
83e511ee 7434            je      nt!KiFastCallEntry+0x164 (83e51224)

     ..........

既然逆向,楼主就把它逆向成高级语言吧!
2013-4-19 14:13
0
雪    币: 240
活跃值: (10)
能力值: ( LV6,RANK:90 )
在线值:
发帖
回帖
粉丝
22
逆的不错,学习了!
2013-4-22 17:55
0
游客
登录 | 注册 方可回帖
返回
//