;进程创建过程开始 CreateProcessA call kernel32!CreateProcessA ;10个参数 ; BOOL WINAPI CreateProcess( ; __in_opt LPCTSTR lpApplicationName, ; __inout_opt LPTSTR lpCommandLine, ; __in_opt LPSECURITY_ATTRIBUTES lpProcessAttributes, ; __in_opt LPSECURITY_ATTRIBUTES lpThreadAttributes, ; __in BOOL bInheritHandles, ; __in DWORD dwCreationFlags, NORMAL_PRIORITY_CLASS ; __in_opt LPVOID lpEnvironment, ; __in_opt LPCTSTR lpCurrentDirectory, ; __in LPSTARTUPINFO lpStartupInfo, ; __out LPPROCESS_INFORMATION lpProcessInformation ; ); ; 直接调用kernel32!CreateProcessInternalA call kernel32!CreateProcessInternalA ; 12个参数,第一个与最后一个为零,中间10个延接了上面传入的10个参数 ; 主要任务是将ANSI字符转换成Unicode字符,很多代码用于了转换与检查,所以,直接用Unicode编程将大大增加执行效率 call kernel32!CreateProcessInternalW ; 12个参数 ; 基本延续上面的 ; 第6个参数 and 0F7FFFFFFh
以下为kernel32!CreateProcessInternalW中的流程:
call ntdll!ZwQueryInformationJobObject ; ZwQueryInformationJobObjectretrieves information about a job object. ; NTSYSAPI ; NTSTATUS ; NTAPI ; ZwQueryInformationJobObject( ; IN HANDLE JobHandle, == 0 ; IN JOBOBJECTINFOCLASS JobInformationClass, == 4 ; OUT PVOID JobInformation, == Address ; IN ULONG JobInformationLength, == 4 ; OUT PULONG ReturnLengthOPTIONAL == 0 ; ); ; 判断返回值是否为C0000022h (拒绝访问) call kernel32!SearchPathW ; 进行路径搜索 call kernel32!GetFileAttributesW ; 获取文件属性 call kernel32!BasepIsSetupInvokedByWinLogon ; 判断是否WinLogon进程 call ntdll!RtlDosPathNameToNtPathName_U call ntdll!RtlDetermineDosPathNameType_U ; 路径转换 call ntdll!Nt
进程创建流程
最新推荐文章于 2022-03-27 20:59:03 发布