阅读:1907回复:6
任意一个用户层的api怎么知道哪个是内核的native api
比如创建进程CreateProcess对应到内核下是NtCreateprocess,
但是很多我都不知道,也不知道去哪里查, 比如我现在为了控制远程进程的创建,想知道createremotethread 等对应的在内核级别的api,就是native api 如何搞呀,或者大牛提供控制远程注入的方法。 谢谢。 |
|
驱动小牛
|
沙发#
发布于:2007-04-03 15:46
NtCreateProcessEX 不过没有导出,自己需要现定位索引.
|
板凳#
发布于:2007-04-03 23:11
远程线程也是NtCreateProcessEX?
|
|
地板#
发布于:2007-04-04 01:16
远线程是NtCreateThread
.text:7C81042C __stdcall CreateRemoteThread(x, x, x, x, x, x, x) proc near .text:7C81042C ; CODE XREF: CreateThread(x,x,x,x,x,x)+19p .text:7C81042C ; BaseCreateThreadPoolThread(x,x,x)+3Fp .text:7C81042C .text:7C81042C var_420 = dword ptr -420h .text:7C81042C var_408 = dword ptr -408h .text:7C81042C var_404 = dword ptr -404h .text:7C81042C var_3EC = dword ptr -3ECh .text:7C81042C var_3E8 = dword ptr -3E8h .text:7C81042C var_3E4 = dword ptr -3E4h .text:7C81042C var_3E0 = dword ptr -3E0h .text:7C81042C var_3D8 = dword ptr -3D8h .text:7C81042C var_3CC = dword ptr -3CCh .text:7C81042C var_3C8 = dword ptr -3C8h .text:7C81042C var_3C4 = dword ptr -3C4h .text:7C81042C var_3C0 = dword ptr -3C0h .text:7C81042C var_3BC = dword ptr -3BCh .text:7C81042C var_3B8 = dword ptr -3B8h .text:7C81042C var_3B4 = dword ptr -3B4h .text:7C81042C var_3B0 = dword ptr -3B0h .text:7C81042C var_3AC = dword ptr -3ACh .text:7C81042C var_3A8 = dword ptr -3A8h .text:7C81042C var_DC = dword ptr -0DCh .text:7C81042C var_BC = dword ptr -0BCh .text:7C81042C var_B4 = dword ptr -0B4h .text:7C81042C var_B0 = dword ptr -0B0h .text:7C81042C var_AC = dword ptr -0ACh .text:7C81042C var_1C = dword ptr -1Ch .text:7C81042C ms_exc = CPPEH_RECORD ptr -18h .text:7C81042C hProcess = dword ptr 8 .text:7C81042C lpThreadAttributes= dword ptr 0Ch .text:7C81042C dwStackSize = dword ptr 10h .text:7C81042C lpStartAddress = dword ptr 14h .text:7C81042C lpParameter = dword ptr 18h .text:7C81042C dwCreationFlags = dword ptr 1Ch .text:7C81042C lpThreadId = dword ptr 20h .text:7C81042C .text:7C81042C ; FUNCTION CHUNK AT .text:7C82B7D2 SIZE 0000000E BYTES .text:7C81042C ; FUNCTION CHUNK AT .text:7C835289 SIZE 0000003A BYTES .text:7C81042C ; FUNCTION CHUNK AT .text:7C83AB3E SIZE 000000A4 BYTES .text:7C81042C .text:7C81042C push 410h .text:7C810431 push offset dword_7C810608 .text:7C810436 call __SEH_prolog .text:7C810436 .text:7C81043B mov eax, ___security_cookie .text:7C810440 mov [ebp+var_1C], eax .text:7C810443 mov ecx, [ebp+hProcess] .text:7C810446 mov [ebp+var_3BC], ecx .text:7C81044C mov esi, [ebp+lpThreadAttributes] .text:7C81044F mov ebx, [ebp+lpStartAddress] .text:7C810452 mov eax, [ebp+lpParameter] .text:7C810455 mov [ebp+var_3CC], eax .text:7C81045B mov eax, [ebp+lpThreadId] .text:7C81045E mov [ebp+var_3C8], eax .text:7C810464 xor edx, edx .text:7C810466 mov [ebp+var_3B8], edx .text:7C81046C xor eax, eax .text:7C81046E lea edi, [ebp+var_3B4] .text:7C810474 stosd .text:7C810475 lea eax, [ebp+var_3E0] .text:7C81047B push eax .text:7C81047C test byte ptr [ebp+dwCreationFlags+2], 1 .text:7C810480 jnz loc_7C83AB3E .text:7C810480 .text:7C810486 push edx .text:7C810487 push [ebp+dwStackSize] .text:7C810487 .text:7C81048A .text:7C81048A loc_7C81048A: ; CODE XREF: CreateRemoteThread(x,x,x,x,x,x,x)+2A716j .text:7C81048A push ecx .text:7C81048B call BaseCreateStack(x,x,x,x) .text:7C81048B .text:7C810490 test eax, eax .text:7C810492 jl loc_7C83AB47 .text:7C810492 .text:7C810498 xor edi, edi .text:7C81049A inc edi .text:7C81049B push edi .text:7C81049C push [ebp+var_3D8] .text:7C8104A2 push ebx .text:7C8104A3 push [ebp+var_3CC] .text:7C8104A9 lea eax, [ebp+var_3A8] .text:7C8104AF push eax .text:7C8104B0 call BaseInitializeContext(x,x,x,x,x) .text:7C8104B0 .text:7C8104B5 xor ebx, ebx .text:7C8104B7 push ebx .text:7C8104B8 push esi .text:7C8104B9 lea eax, [ebp+var_420] .text:7C8104BF push eax .text:7C8104C0 call BaseFormatObjectAttributes(x,x,x) .text:7C8104C0 .text:7C8104C5 push edi .text:7C8104C6 lea ecx, [ebp+var_3E0] .text:7C8104CC push ecx .text:7C8104CD lea ecx, [ebp+var_3A8] .text:7C8104D3 push ecx .text:7C8104D4 lea ecx, [ebp+var_3C4] .text:7C8104DA push ecx .text:7C8104DB mov esi, [ebp+var_3BC] .text:7C8104E1 push esi .text:7C8104E2 push eax .text:7C8104E3 push 1F03FFh .text:7C8104E8 lea eax, [ebp+var_3B0] .text:7C8104EE push eax .text:7C8104EF call ds:NtCreateThread(x,x,x,x,x,x,x,x) .text:7C8104F5 mov [ebp+var_3AC], eax .text:7C8104FB cmp eax, ebx .text:7C8104FD jl loc_7C83AB4A .text:7C8104FD .text:7C810503 mov [ebp+ms_exc.disabled], ebx .text:7C810506 cmp esi, 0FFFFFFFFh .text:7C810509 jnz short loc_7C81055E .text:7C810509 .text:7C81050B push ebx .text:7C81050C push 1Ch .text:7C81050E lea eax, [ebp+var_408] .text:7C810514 push eax .text:7C810515 push ebx .text:7C810516 push [ebp+var_3B0] .text:7C81051C call ds:NtQueryInformationThread(x,x,x,x,x) .text:7C810522 mov [ebp+var_3AC], eax .text:7C810528 cmp eax, ebx .text:7C81052A jl loc_7C83AB6A .text:7C81052A .text:7C810530 push ebx .text:7C810531 push 8 .text:7C810533 lea eax, [ebp+var_3B8] .text:7C810539 push eax .text:7C81053A push edi .text:7C81053B push ebx .text:7C81053C push ebx .text:7C81053D push edi .text:7C81053E call ds:RtlQueryInformationActivationContext(x,x,x,x,x,x,x) .text:7C810544 mov [ebp+var_3AC], eax .text:7C81054A cmp eax, ebx .text:7C81054C jl loc_7C83AB82 .text:7C81054C .text:7C810552 cmp [ebp+var_3B8], ebx .text:7C810558 jnz loc_7C835289 .text:7C810558 .text:7C81055E .text:7C81055E loc_7C81055E: ; CODE XREF: CreateRemoteThread(x,x,x,x,x,x,x)+DDj .text:7C81055E ; CreateRemoteThread(x,x,x,x,x,x,x)+24E64j .text:7C81055E ; CreateRemoteThread(x,x,x,x,x,x,x)+24E8Cj .text:7C81055E cmp _BaseRunningInServerProcess, 0 .text:7C810565 jnz loc_7C82B7D2 .text:7C810565 .text:7C81056B mov eax, [ebp+var_3B0] .text:7C810571 mov [ebp+var_B4], eax .text:7C810577 mov eax, [ebp+var_3C4] .text:7C81057D mov [ebp+var_B0], eax .text:7C810583 mov eax, [ebp+var_3C0] .text:7C810589 mov [ebp+var_AC], eax .text:7C81058F push 0Ch .text:7C810591 push 10001h .text:7C810596 push ebx .text:7C810597 lea eax, [ebp+var_DC] .text:7C81059D push eax .text:7C81059E call ds:CsrClientCallServer(x,x,x,x) .text:7C8105A4 mov eax, [ebp+var_BC] .text:7C8105A4 .text:7C8105AA .text:7C8105AA loc_7C8105AA: ; CODE XREF: CreateRemoteThread(x,x,x,x,x,x,x)+2A7A2j .text:7C8105AA mov [ebp+var_3AC], eax .text:7C8105AA .text:7C8105B0 .text:7C8105B0 loc_7C8105B0: ; CODE XREF: CreateRemoteThread(x,x,x,x,x,x,x)+1B3A9j .text:7C8105B0 ; CreateRemoteThread(x,x,x,x,x,x,x)+2A78Dj .text:7C8105B0 cmp [ebp+var_3AC], ebx .text:7C8105B6 jl loc_7C83ABD3 .text:7C8105B6 .text:7C8105BC mov eax, [ebp+var_3C8] .text:7C8105C2 cmp eax, ebx .text:7C8105C4 jz short loc_7C8105CE .text:7C8105C4 .text:7C8105C6 mov ecx, [ebp+var_3C0] .text:7C8105CC mov [eax], ecx .text:7C8105CC .text:7C8105CE .text:7C8105CE loc_7C8105CE: ; CODE XREF: CreateRemoteThread(x,x,x,x,x,x,x)+198j .text:7C8105CE test byte ptr [ebp+dwCreationFlags], 4 .text:7C8105D2 jnz short loc_7C8105E7 .text:7C8105D2 .text:7C8105D4 lea eax, [ebp+var_3E4] .text:7C8105DA push eax .text:7C8105DB push [ebp+var_3B0] .text:7C8105E1 call ds:NtResumeThread(x,x) .text:7C8105E1 .text:7C8105E7 .text:7C8105E7 loc_7C8105E7: ; CODE XREF: CreateRemoteThread(x,x,x,x,x,x,x)+1A6j .text:7C8105E7 ; CreateRemoteThread(x,x,x,x,x,x,x)+2A751j .text:7C8105E7 ; CreateRemoteThread(x,x,x,x,x,x,x)+2A7B1j .text:7C8105E7 or [ebp+ms_exc.disabled], 0FFFFFFFFh .text:7C8105EB call sub_7C810619 .text:7C8105EB .text:7C8105F0 mov eax, [ebp+var_3B0] .text:7C8105F0 .text:7C8105F6 .text:7C8105F6 loc_7C8105F6: ; CODE XREF: CreateRemoteThread(x,x,x,x,x,x,x)+2A739j .text:7C8105F6 mov ecx, [ebp+var_1C] .text:7C8105F9 call __security_check_cookie(x) .text:7C8105F9 .text:7C8105FE call __SEH_epilog .text:7C8105FE .text:7C810603 retn 1Ch .text:7C810603 .text:7C810603 __stdcall CreateRemoteThread(x, x, x, x, x, x, x) endp .text:7C810603 |
|
|
地下室#
发布于:2007-04-04 23:17
WQXNETQIQI,太佩服你了!
你这个是用ollydgb搞出来的? 是不是其他别的api都可以这么搞出来? 谢谢! 请多多指导! 谢谢 |
|
5楼#
发布于:2007-04-04 23:37
IDA一下就有了呀。。。。
|
|
|
6楼#
发布于:2007-04-05 22:38
是不是自己写个c代码,编译exe,然后ida反汇编?
我调试的时候看不到那种汇编(vc中查看汇编的) 谢谢,大牛。 |
|