Function at 0x401350
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 0x401690
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 [0x404108], eax
sub esp, 0x10
test eax, eax
je 0x401679
mov dword [esp + 8], 1
mov dword [esp + 4], 0
mov dword [esp], 0
call dword [sym.imp.advapi32.dll_OpenSCManagerW]
mov dword [0x4040e0], eax
sub esp, 0xc
test eax, eax
je 0x401679
mov dword [esp + 8], edi
mov dword [esp + 4], sym._service_handler_16
mov dword [esp], str.winedevice
call dword [sym.imp.advapi32.dll_RegisterServiceCtrlHandlerExW]
mov dword [0x404104], eax
sub esp, 0xc
test eax, eax
je 0x401679
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 0x4016a0
inc ebx
cmp ebx, 3
je 0x401468
mov esi, dword [ebx*4 + 0x405380]
jmp 0x40143f
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 0x401556
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 [0x404030], 8
jne 0x401948
lea eax, [ebp - 0x34c]
mov dword [ebp - 0x34c], 0x30
mov ebx, dword [sym.imp.advapi32.dll_SetServiceStatus]
mov dword [esp + 4], eax
mov eax, dword [0x404104]
mov dword [ebp - 0x348], 4
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
mov dword [esp], eax
call ebx
mov eax, dword [0x404108]
sub esp, 8
mov dword [esp], eax
call sym._wine_ntoskrnl_main_loop
test byte [0x404030], 8
jne 0x401800
mov dword [ebp - 0x34c], 0x30
lea eax, [ebp - 0x34c]
mov dword [esp + 4], eax
mov eax, dword [0x404104]
mov dword [ebp - 0x348], 1
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
mov dword [esp], eax
call ebx
mov eax, dword [0x4040e0]
sub esp, 8
mov dword [esp], eax
call dword [sym.imp.advapi32.dll_CloseServiceHandle]
mov eax, dword [0x404108]
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 0x401376
test byte [0x404030], 2
je 0x401453
test esi, esi
je 0x401d40
mov eax, esi
shr eax, 0x10
je 0x401cd0
mov dword [esp + 4], 0xffffffff
mov dword [esp], esi
call dword [sym.imp.kernel32.dll_IsBadStringPtrW]
mov edx, str._invalid_
sub esp, 8
test eax, eax
jne 0x4017d2
cmp word [esi], 0
je 0x401d8c
lea esi, [esi]
nop
mov edx, eax
lea eax, [eax + 1]
cmp word [esi + edx*2 + 2], 0
jne 0x4016f0
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 0x401761
cmp ax, 9
je 0x401c78
cmp ax, 0xa
jne 0x401c06
mov eax, 0x6e5c
add ecx, 2
mov word [ecx - 2], ax
lea eax, [edx - 1]
cmp ecx, dword [ebp - 0x35c]
ja 0x401798
test edx, edx
jle 0x401798
mov edx, eax
movzx eax, word [esi]
add esi, 2
cmp ax, 0xd
je 0x401be8
jbe 0x401730
cmp ax, 0x22
je 0x401c60
cmp ax, 0x5c
jne 0x401bf9
mov ebx, 0x5c5c
add ecx, 2
mov word [ecx - 2], bx
jmp 0x401750
mov edi, dword [ebp - 0x360]
mov ebx, dword [ebp - 0x364]
mov byte [ecx], 0x22
test eax, eax
jle 0x401da5
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.___wine_dbg_strdup
mov edx, eax
mov dword [esp + 0x10], edx
mov dword [esp + 0xc], str.Failed_to_load__s_n
mov dword [esp + 8], str.ServiceMain
mov dword [esp + 4], 0x404030
mov dword [esp], 1
call sym._wine_dbg_log.constprop.0
jmp 0x401453
test edi, edi
je 0x401d30
mov eax, edi
shr eax, 0x10
je 0x401c90
mov dword [esp + 4], 0xffffffff
mov dword [esp], edi
call dword [sym.imp.kernel32.dll_IsBadStringPtrW]
mov edx, str._invalid_
sub esp, 8
test eax, eax
jne 0x401914
cmp word [edi], 0
je 0x401d4a
nop
mov edx, eax
lea eax, [eax + 1]
cmp word [edi + edx*2 + 2], 0
jne 0x401840
mov eax, 0x224c
mov dword [ebp - 0x35c], ebx
lea ecx, [ebp - 0x34a]
mov word [ebp - 0x34c], ax
jmp 0x4018a3
cmp ax, 9
je 0x401ac0
cmp ax, 0xa
jne 0x401b7e
mov eax, 0x6e5c
add ecx, 2
mov word [ecx - 2], ax
lea eax, [edx - 1]
test edx, edx
jle 0x4018e0
lea esi, [ebp - 0x22a]
cmp ecx, esi
ja 0x4018e0
mov edx, eax
movzx eax, word [edi]
add edi, 2
cmp ax, 0xd
je 0x401aa8
jbe 0x401870
cmp ax, 0x22
je 0x401bd0
cmp ax, 0x5c
jne 0x401b71
mov ebx, 0x5c5c
add ecx, 2
mov word [ecx - 2], bx
jmp 0x401890
mov byte [ecx], 0x22
mov ebx, dword [ebp - 0x35c]
test eax, eax
jle 0x401d63
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.___wine_dbg_strdup
mov edx, eax
mov dword [esp + 0x10], edx
mov dword [esp + 0xc], str.service_group__s_stopped_n
mov dword [esp + 8], str.ServiceMain
mov dword [esp + 4], 0x404030
mov dword [esp], 3
call sym._wine_dbg_log.constprop.0
jmp 0x4015fa
test edi, edi
je 0x401d20
mov eax, edi
shr eax, 0x10
je 0x401cb0
mov dword [esp + 4], 0xffffffff
mov dword [esp], edi
call dword [sym.imp.kernel32.dll_IsBadStringPtrW]
mov edx, str._invalid_
sub esp, 8
test eax, eax
jne 0x401a74
cmp word [edi], 0
je 0x401d6b
lea esi, [esi]
lea esi, [esi]
mov edx, eax
lea eax, [eax + 1]
cmp word [edi + edx*2 + 2], 0
jne 0x401990
mov ebx, 0x224c
lea eax, [ebp - 0x22a]
mov dword [ebp - 0x360], edi
lea ecx, [ebp - 0x34a]
mov dword [ebp - 0x35c], edi
mov edi, eax
mov word [ebp - 0x34c], bx
jmp 0x4019fd
cmp ax, 9
je 0x401ad8
cmp ax, 0xa
jne 0x401b0e
mov eax, 0x6e5c
add ecx, 2
mov word [ecx - 2], ax
lea esi, [esi]
nop
lea eax, [edx - 1]
cmp ecx, edi
ja 0x401a40
test edx, edx
jle 0x401a40
mov edx, eax
add dword [ebp - 0x35c], 2
mov eax, dword [ebp - 0x35c]
movzx eax, word [eax - 2]
cmp ax, 0xd
je 0x401af0
jbe 0x4019c8
cmp ax, 0x22
je 0x401b60
cmp ax, 0x5c
jne 0x401b01
mov ebx, 0x5c5c
add ecx, 2
mov word [ecx - 2], bx
jmp 0x4019f0
mov byte [ecx], 0x22
mov edi, dword [ebp - 0x360]
test eax, eax
jle 0x401d84
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.___wine_dbg_strdup
mov edx, eax
mov dword [esp + 0x10], edx
mov dword [esp + 0xc], str.starting_service_group__s_n
mov dword [esp + 8], str.ServiceMain
mov dword [esp + 4], 0x404030
mov dword [esp], 3
call sym._wine_dbg_log.constprop.0
jmp 0x40157d
mov eax, 0x725c
add ecx, 2
mov word [ecx - 2], ax
jmp 0x401890
mov eax, ZwLoadDriver
add ecx, 2
mov word [ecx - 2], ax
jmp 0x401890
mov eax, ZwLoadDriver
add ecx, 2
mov word [ecx - 2], ax
jmp 0x4019f0
mov eax, 0x725c
add ecx, 2
mov word [ecx - 2], ax
jmp 0x4019f0
lea esi, [eax - 0x20]
cmp si, 0x5e
jbe 0x401d00
mov esi, eax
mov byte [ecx], 0x5c
add ecx, 5
shr si, 0xc
movzx esi, si
movzx ebx, byte [esi + str.0123456789abcdef]
mov esi, eax
shr si, 8
and esi, 0xf
mov byte [ecx - 4], bl
movzx ebx, byte [esi + str.0123456789abcdef]
mov esi, eax
and eax, 0xf
shr si, 4
movzx eax, byte [eax + str.0123456789abcdef]
and esi, 0xf
mov byte [ecx - 3], bl
movzx ebx, byte [esi + str.0123456789abcdef]
mov byte [ecx - 1], al
mov byte [ecx - 2], bl
jmp 0x4019f0
mov esi, 0x225c
add ecx, 2
mov word [ecx - 2], si
jmp 0x4019f0
lea esi, [eax - 0x20]
cmp si, 0x5e
jbe 0x401cf0
mov esi, eax
mov byte [ecx], 0x5c
add ecx, 5
shr si, 0xc
movzx esi, si
movzx ebx, byte [esi + str.0123456789abcdef]
mov esi, eax
shr si, 8
and esi, 0xf
mov byte [ecx - 4], bl
movzx ebx, byte [esi + str.0123456789abcdef]
mov esi, eax
and eax, 0xf
shr si, 4
movzx eax, byte [eax + str.0123456789abcdef]
and esi, 0xf
mov byte [ecx - 3], bl
movzx ebx, byte [esi + str.0123456789abcdef]
mov byte [ecx - 1], al
mov byte [ecx - 2], bl
jmp 0x401890
mov esi, 0x225c
add ecx, 2
mov word [ecx - 2], si
jmp 0x401890
mov eax, 0x725c
add ecx, 2
mov word [ecx - 2], ax
jmp 0x401750
lea edi, [eax - 0x20]
cmp di, 0x5e
jbe 0x401d10
mov edi, eax
mov byte [ecx], 0x5c
add ecx, 5
shr di, 0xc
movzx edi, di
movzx ebx, byte [edi + str.0123456789abcdef]
mov edi, eax
shr di, 8
and edi, 0xf
mov byte [ecx - 4], bl
movzx ebx, byte [edi + str.0123456789abcdef]
mov edi, eax
and eax, 0xf
shr di, 4
movzx eax, byte [eax + str.0123456789abcdef]
and edi, 0xf
mov byte [ecx - 3], bl
movzx ebx, byte [edi + str.0123456789abcdef]
mov byte [ecx - 1], al
mov byte [ecx - 2], bl
jmp 0x401750
mov edi, 0x225c
add ecx, 2
mov word [ecx - 2], di
jmp 0x401750
mov eax, ZwLoadDriver
add ecx, 2
mov word [ecx - 2], ax
jmp 0x401750
movzx eax, di
mov dword [esp], str._04x
mov dword [esp + 4], eax
call sym._wine_dbg_sprintf.constprop.0
mov edx, eax
jmp 0x401914
movzx eax, di
mov dword [esp], str._04x
mov dword [esp + 4], eax
call sym._wine_dbg_sprintf.constprop.0
mov edx, eax
jmp 0x401a74
movzx esi, si
mov dword [esp], str._04x
mov dword [esp + 4], esi
call sym._wine_dbg_sprintf.constprop.0
mov edx, eax
jmp 0x4017d2
mov byte [ecx], al
inc ecx
jmp 0x401890
mov byte [ecx], al
inc ecx
jmp 0x4019f0
mov byte [ecx], al
inc ecx
jmp 0x401750
mov edx, str._null_
jmp 0x401a74
mov edx, str._null_
jmp 0x401914
mov edx, str._null_
jmp 0x4017d2
mov esi, 0x224c
mov byte [ebp - 0x34a], 0x22
lea ecx, [ebp - 0x34a]
mov word [ebp - 0x34c], si
lea eax, [ecx + 1]
jmp 0x401901
mov byte [ebp - 0x34a], 0x22
mov ecx, 0x224c
mov word [ebp - 0x34c], cx
lea ecx, [ebp - 0x34a]
lea eax, [ecx + 1]
jmp 0x401a61
mov edx, 0x224c
mov byte [ebp - 0x34a], 0x22
lea ecx, [ebp - 0x34a]
mov word [ebp - 0x34c], dx
lea eax, [ecx + 1]
jmp 0x4017bf