Function at 0x401710
Capabilities:
Access peb ldr_data
Get common file path
Get process heap flags

Disassembly:
lea ecx, [esp + 4]
and esp, 0xfffffff0
push dword [ecx - 4]
push ebp
mov ebp, esp
push edi
push esi
push ebx
push ecx
sub esp, 0x378
cmp dword [ecx], 1
mov eax, dword [ecx + 4]
jbe 0x401a50
mov edi, dword [eax + 4]
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0
mov dword [esp + 4], 1
mov dword [esp], 0
call dword [sym.imp.kernel32.dll_CreateEventW]
mov dword [section..bss], eax
sub esp, 0x10
test eax, eax
je 0x401a38
mov dword [esp + 8], 1
mov dword [esp + 4], 0
mov dword [esp], 0
call sym.unk_34
mov dword [0x406004], eax
sub esp, 0xc
test eax, eax
je 0x401a38
mov dword [esp + 8], edi
mov dword [esp + 4], sym.unk_3
mov dword [esp], section..data
call sym.unk_20
mov dword [0x406008], eax
sub esp, 0xc
test eax, eax
je 0x401a38
lea ebx, [ebp - 0x220]
mov dword [esp + 4], 0x104
mov esi, str.C:windows_system32win32k.sys
mov dword [esp], ebx
call dword [sym.imp.kernel32.dll_GetSystemDirectoryW]
sub esp, 8
mov dword [esp], ebx
mov dword [esp + 4], str.drivers
call dword [sym.imp.ntoskrnl.exe_wcscat]
mov dword [esp], ebx
xor ebx, ebx
call dword [sym.imp.kernel32.dll_AddDllDirectory]
sub esp, 4
mov dword [esp], esi
call dword [sym.imp.kernel32.dll_LoadLibraryW]
sub esp, 4
test eax, eax
je 0x401a60
add ebx, 1
cmp ebx, 3
je 0x401828
mov esi, dword [ebx*4 + 0x404250]
jmp 0x4017fd
lea eax, [ebp - 0x350]
mov dword [esp + 4], 0
mov dword [esp + 8], eax
mov dword [esp], 0
call dword [sym.imp.ntdll.dll_LdrLockLoaderLock]
sub esp, 0xc
mov dword [esp], str.C:windows_system32_ntoskrnl.exe
call dword [sym.imp.kernel32.dll_GetModuleHandleW]
lea edx, [ebp - 0x354]
sub esp, 4
mov dword [esp + 4], edx
mov dword [esp], eax
call dword [sym.imp.ntdll.dll_LdrFindEntryForAddress]
sub esp, 8
test eax, eax
jne 0x401916
mov eax, dword [ebp - 0x354]
mov edx, dword [eax]
mov eax, dword [eax + 4]
mov dword [edx + 4], eax
mov dword [eax], edx
mov eax, dword [ebp - 0x354]
mov edx, dword fs:[0x18]
mov dword [eax], 0
mov dword [eax + 4], 0
mov eax, dword [edx + 0x30]
mov eax, dword [eax + 0xc]
mov ebx, dword [eax + 0xc]
mov eax, dword [ebp - 0x354]
mov dword [eax], ebx
mov ecx, dword [edx + 0x30]
mov eax, dword [ebp - 0x354]
mov ecx, dword [ecx + 0xc]
add ecx, 0xc
mov dword [eax + 4], ecx
mov dword [ebx + 4], eax
mov ecx, dword [edx + 0x30]
mov ecx, dword [ecx + 0xc]
mov dword [ecx + 0xc], eax
mov ecx, dword [eax + 8]
mov eax, dword [eax + 0xc]
mov dword [ecx + 4], eax
mov dword [eax], ecx
mov eax, dword [ebp - 0x354]
mov dword [eax + 8], 0
add eax, 8
mov dword [eax + 4], 0
mov ecx, dword [edx + 0x30]
mov ecx, dword [ecx + 0xc]
mov ebx, dword [ecx + 0x14]
mov dword [eax], ebx
mov ecx, dword [edx + 0x30]
mov ecx, dword [ecx + 0xc]
add ecx, 0x14
mov dword [eax + 4], ecx
mov dword [ebx + 4], eax
mov edx, dword [edx + 0x30]
mov edx, dword [edx + 0xc]
mov dword [edx + 0x14], eax
mov eax, dword [ebp - 0x350]
mov dword [esp], 0
mov dword [esp + 4], eax
call dword [sym.imp.ntdll.dll_LdrUnlockLoaderLock]
sub esp, 8
test byte [0x403018], 8
jne 0x401d00
mov dword [ebp - 0x34c], 0x30
lea eax, [ebp - 0x34c]
mov dword [esp + 4], eax
mov eax, dword [0x406008]
mov dword [ebp - 0x348], 4
mov dword [esp], eax
mov dword [ebp - 0x344], 5
mov dword [ebp - 0x340], 0
mov dword [ebp - 0x33c], 0
mov dword [ebp - 0x338], 0
mov dword [ebp - 0x334], 0
call sym.unk_23
mov eax, dword [section..bss]
sub esp, 8
mov dword [esp], eax
call sym.unk_33
test byte [0x403018], 8
jne 0x401bc0
mov dword [ebp - 0x34c], 0x30
lea eax, [ebp - 0x34c]
mov dword [esp + 4], eax
mov eax, dword [0x406008]
mov dword [ebp - 0x348], 1
mov dword [esp], eax
mov dword [ebp - 0x344], 0
mov dword [ebp - 0x340], 0
mov dword [ebp - 0x33c], 0
mov dword [ebp - 0x338], 0
mov dword [ebp - 0x334], 0
call sym.unk_23
mov eax, dword [0x406004]
sub esp, 8
mov dword [esp], eax
call sym.unk_19
mov eax, dword [section..bss]
sub esp, 4
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_CloseHandle]
sub esp, 4
lea esp, [ebp - 0x10]
pop ecx
pop ebx
pop esi
pop edi
pop ebp
lea esp, [ecx - 4]
ret 8
mov edi, dword [eax]
jmp 0x401736
test byte [0x403018], 2
je 0x401811
test esi, esi
je 0x4020f0
mov eax, esi
shr eax, 0x10
je 0x402080
mov dword [esp + 4], 0xffffffff
mov dword [esp], esi
call dword [sym.imp.kernel32.dll_IsBadStringPtrW]
mov ecx, eax
sub esp, 8
mov eax, str._invalid_
test ecx, ecx
jne 0x401b90
cmp word [esi], 0
je 0x40213c
lea esi, [esi]
mov edx, ecx
lea ecx, [ecx + 1]
cmp word [esi + edx*2 + 2], 0
jne 0x401ab0
mov eax, 0x224c
mov dword [ebp - 0x360], edi
lea ecx, [ebp - 0x34a]
mov word [ebp - 0x34c], ax
lea eax, [ebp - 0x22a]
mov dword [ebp - 0x364], ebx
mov dword [ebp - 0x35c], eax
jmp 0x401b21
cmp ax, 9
je 0x402028
cmp ax, 0xa
jne 0x401fb6
mov eax, 0x6e5c
add ecx, 2
mov word [ecx - 2], ax
lea eax, [edx - 1]
cmp ecx, dword [ebp - 0x35c]
ja 0x401b58
test edx, edx
jle 0x401b58
mov edx, eax
movzx eax, word [esi]
add esi, 2
cmp ax, 0xd
je 0x401f98
jbe 0x401af0
cmp ax, 0x22
je 0x402010
cmp ax, 0x5c
jne 0x401fa9
mov ebx, 0x5c5c
add ecx, 2
mov word [ecx - 2], bx
jmp 0x401b10
mov edi, dword [ebp - 0x360]
mov ebx, dword [ebp - 0x364]
mov byte [ecx], 0x22
test eax, eax
jle 0x402155
mov edx, 0x2e2e
mov byte [ecx + 3], 0x2e
lea eax, [ecx + 4]
mov word [ecx + 1], dx
mov byte [eax], 0
lea eax, [ebp - 0x34c]
mov dword [esp], eax
call sym.unk_13
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], str.Failed_to_load__s_n
mov dword [esp + 8], str.ServiceMain
mov dword [esp + 4], 0x403018
mov dword [esp], 1
call sym.unk_1
jmp 0x401811
test edi, edi
je 0x4020e0
mov eax, edi
shr eax, 0x10
je 0x402040
mov dword [esp + 4], 0xffffffff
mov dword [esp], edi
call dword [sym.imp.kernel32.dll_IsBadStringPtrW]
mov ecx, eax
sub esp, 8
mov eax, str._invalid_
test ecx, ecx
jne 0x401ccc
cmp word [edi], 0
je 0x4020fa
mov edx, ecx
lea ecx, [ecx + 1]
cmp word [edi + edx*2 + 2], 0
jne 0x401c00
mov eax, 0x224c
lea ecx, [ebp - 0x34a]
mov word [ebp - 0x34c], ax
jmp 0x401c63
cmp ax, 9
je 0x401e68
cmp ax, 0xa
jne 0x401f2e
mov eax, 0x6e5c
add ecx, 2
mov word [ecx - 2], ax
lea esi, [esi]
nop
lea eax, [edx - 1]
test edx, edx
jle 0x401ca0
lea esi, [ebp - 0x22a]
cmp ecx, esi
ja 0x401ca0
mov edx, eax
movzx eax, word [edi]
add edi, 2
cmp ax, 0xd
je 0x401e50
jbe 0x401c28
cmp ax, 0x22
je 0x401f80
cmp ax, 0x5c
jne 0x401f21
mov ebx, 0x5c5c
add ecx, 2
mov word [ecx - 2], bx
jmp 0x401c50
mov byte [ecx], 0x22
test eax, eax
jle 0x402113
mov edx, 0x2e2e
mov byte [ecx + 3], 0x2e
lea eax, [ecx + 4]
mov word [ecx + 1], dx
mov byte [eax], 0
lea eax, [ebp - 0x34c]
mov dword [esp], eax
call sym.unk_13
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], str.service_group__s_stopped_n
mov dword [esp + 8], str.ServiceMain
mov dword [esp + 4], 0x403018
mov dword [esp], 3
call sym.unk_1
jmp 0x4019b7
test edi, edi
je 0x4020d0
mov eax, edi
shr eax, 0x10
je 0x402060
mov dword [esp + 4], 0xffffffff
mov dword [esp], edi
call dword [sym.imp.kernel32.dll_IsBadStringPtrW]
mov ecx, eax
sub esp, 8
mov eax, str._invalid_
test ecx, ecx
jne 0x401e22
cmp word [edi], 0
je 0x40211b
mov edx, ecx
lea ecx, [ecx + 1]
cmp word [edi + edx*2 + 2], 0
jne 0x401d40
mov ebx, 0x224c
mov dword [ebp - 0x360], edi
lea ecx, [ebp - 0x34a]
lea esi, [ebp - 0x22a]
mov word [ebp - 0x34c], bx
mov dword [ebp - 0x35c], edi
jmp 0x401dad
cmp ax, 9
je 0x401e80
cmp ax, 0xa
jne 0x401eb6
mov eax, 0x6e5c
add ecx, 2
mov word [ecx - 2], ax
lea esi, [esi]
nop
lea eax, [edx - 1]
cmp ecx, esi
ja 0x401df0
test edx, edx
jle 0x401df0
mov edx, eax
add dword [ebp - 0x35c], 2
mov eax, dword [ebp - 0x35c]
movzx eax, word [eax - 2]
cmp ax, 0xd
je 0x401e98
jbe 0x401d78
cmp ax, 0x22
je 0x401f10
cmp ax, 0x5c
jne 0x401ea9
mov ebx, 0x5c5c
add ecx, 2
mov word [ecx - 2], bx
jmp 0x401da0
mov byte [ecx], 0x22
mov edi, dword [ebp - 0x360]
test eax, eax
jle 0x402134
mov edx, 0x2e2e
mov byte [ecx + 3], 0x2e
lea eax, [ecx + 4]
mov word [ecx + 1], dx
mov byte [eax], 0
lea eax, [ebp - 0x34c]
mov dword [esp], eax
call sym.unk_13
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], str.starting_service_group__s_n
mov dword [esp + 8], str.ServiceMain
mov dword [esp + 4], 0x403018
mov dword [esp], 3
call sym.unk_1
jmp 0x40193d
mov eax, 0x725c
add ecx, 2
mov word [ecx - 2], ax
jmp 0x401c50
mov eax, 0x745c
add ecx, 2
mov word [ecx - 2], ax
jmp 0x401c50
mov eax, 0x745c
add ecx, 2
mov word [ecx - 2], ax
jmp 0x401da0
mov eax, 0x725c
add ecx, 2
mov word [ecx - 2], ax
jmp 0x401da0
lea edi, [eax - 0x20]
cmp di, 0x5e
jbe 0x4020b0
mov edi, eax
mov byte [ecx], 0x5c
add ecx, 5
shr di, 0xc
movzx edi, di
movzx ebx, byte [edi + str.0123456789abcdefdevice_handler]
mov edi, eax
shr di, 8
and edi, 0xf
mov byte [ecx - 4], bl
movzx ebx, byte [edi + str.0123456789abcdefdevice_handler]
mov edi, eax
and eax, 0xf
shr di, 4
movzx eax, byte [eax + str.0123456789abcdefdevice_handler]
and edi, 0xf
mov byte [ecx - 3], bl
movzx ebx, byte [edi + str.0123456789abcdefdevice_handler]
mov byte [ecx - 1], al
mov byte [ecx - 2], bl
jmp 0x401da0
mov edi, 0x225c
add ecx, 2
mov word [ecx - 2], di
jmp 0x401da0
lea esi, [eax - 0x20]
cmp si, 0x5e
jbe 0x4020a0
mov esi, eax
mov byte [ecx], 0x5c
add ecx, 5
shr si, 0xc
movzx esi, si
movzx ebx, byte [esi + str.0123456789abcdefdevice_handler]
mov esi, eax
shr si, 8
and esi, 0xf
mov byte [ecx - 4], bl
movzx ebx, byte [esi + str.0123456789abcdefdevice_handler]
mov esi, eax
and eax, 0xf
shr si, 4
movzx eax, byte [eax + str.0123456789abcdefdevice_handler]
and esi, 0xf
mov byte [ecx - 3], bl
movzx ebx, byte [esi + str.0123456789abcdefdevice_handler]
mov byte [ecx - 1], al
mov byte [ecx - 2], bl
jmp 0x401c50
mov esi, 0x225c
add ecx, 2
mov word [ecx - 2], si
jmp 0x401c50
mov eax, 0x725c
add ecx, 2
mov word [ecx - 2], ax
jmp 0x401b10
lea edi, [eax - 0x20]
cmp di, 0x5e
jbe 0x4020c0
mov edi, eax
mov byte [ecx], 0x5c
add ecx, 5
shr di, 0xc
movzx edi, di
movzx ebx, byte [edi + str.0123456789abcdefdevice_handler]
mov edi, eax
shr di, 8
and edi, 0xf
mov byte [ecx - 4], bl
movzx ebx, byte [edi + str.0123456789abcdefdevice_handler]
mov edi, eax
and eax, 0xf
shr di, 4
movzx eax, byte [eax + str.0123456789abcdefdevice_handler]
and edi, 0xf
mov byte [ecx - 3], bl
movzx ebx, byte [edi + str.0123456789abcdefdevice_handler]
mov byte [ecx - 1], al
mov byte [ecx - 2], bl
jmp 0x401b10
mov edi, 0x225c
add ecx, 2
mov word [ecx - 2], di
jmp 0x401b10
mov eax, 0x745c
add ecx, 2
mov word [ecx - 2], ax
jmp 0x401b10
movzx eax, di
mov dword [esp], str._04x
mov dword [esp + 4], eax
call sym.unk_2
jmp 0x401ccc
movzx eax, di
mov dword [esp], str._04x
mov dword [esp + 4], eax
call sym.unk_2
jmp 0x401e22
movzx esi, si
mov dword [esp], str._04x
mov dword [esp + 4], esi
call sym.unk_2
jmp 0x401b90
mov byte [ecx], al
add ecx, 1
jmp 0x401c50
mov byte [ecx], al
add ecx, 1
jmp 0x401da0
mov byte [ecx], al
add ecx, 1
jmp 0x401b10
mov eax, str._null_
jmp 0x401e22
mov eax, str._null_
jmp 0x401ccc
mov eax, str._null_
jmp 0x401b90
mov esi, 0x224c
mov byte [ebp - 0x34a], 0x22
lea ecx, [ebp - 0x34a]
mov word [ebp - 0x34c], si
lea eax, [ecx + 1]
jmp 0x401cbb
mov byte [ebp - 0x34a], 0x22
mov ecx, 0x224c
mov word [ebp - 0x34c], cx
lea ecx, [ebp - 0x34a]
lea eax, [ecx + 1]
jmp 0x401e11
mov edx, 0x224c
mov byte [ebp - 0x34a], 0x22
lea ecx, [ebp - 0x34a]
mov word [ebp - 0x34c], dx
lea eax, [ecx + 1]
jmp 0x401b7f