Function at 0x401340
Capabilities:
Get process heap flags
Install driver
Unload driver

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, 0x50
mov ebx, dword [ecx]
mov esi, dword [ecx + 8]
mov eax, dword [ecx + 0xc]
test ebx, ebx
js 0x401438
mov ecx, ebx
movzx edx, byte [0x403018]
and ecx, 0xfffffffb
cmp ecx, 1
je 0x4013d0
and edx, 1
jne 0x401598
lea eax, [ebp - 0x38]
mov dword [ebp - 0x28], 0
movdqu xmm0, xmmword [0x4042e0]
mov dword [esp + 4], eax
mov eax, dword [0x406008]
mov dword [ebp - 0x24], 0
mov dword [ebp - 0x20], 0
mov dword [esp], eax
movups xmmword [ebp - 0x38], xmm0
call dword [sym.imp.advapi32.dll_SetServiceStatus]
xor edx, edx
sub esp, 8
lea esp, [ebp - 0x10]
mov eax, edx
pop ecx
pop ebx
pop esi
pop edi
pop ebp
lea esp, [ecx - 4]
ret 0x10
and edx, 8
jne 0x401560
lea eax, [ebp - 0x38]
mov dword [ebp - 0x28], 0
movdqu xmm0, xmmword [0x4042d0]
mov dword [esp + 4], eax
mov eax, dword [0x406008]
movups xmmword [ebp - 0x38], xmm0
mov dword [ebp - 0x24], 0
mov dword [ebp - 0x20], 0
mov dword [esp], eax
call dword [sym.imp.advapi32.dll_SetServiceStatus]
mov eax, dword [section..bss]
sub esp, 8
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_SetEvent]
xor edx, edx
sub esp, 4
lea esp, [ebp - 0x10]
mov eax, edx
pop ecx
pop ebx
pop esi
pop edi
pop ebp
lea esp, [ecx - 4]
ret 0x10
mov edx, 0x57
test esi, esi
je 0x4013b9
and ebx, 0x7fffffff
cmp word [esi], 0
je 0x401630
mov eax, esi
mov esi, esi
lea edi, [edi]
add eax, 2
cmp word [eax], 0
jne 0x401460
sub eax, esi
add eax, 0x6a
mov dword [esp + 8], eax
mov dword [esp + 4], 0
mov edx, dword fs:[0x18]
mov eax, dword [edx + 0x30]
mov eax, dword [eax + 0x18]
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_HeapAlloc]
sub esp, 0xc
test eax, eax
je 0x40163a
xor edx, edx
lea esi, [esi]
movzx ecx, word [edx + str.RegistryMachineSystemCurrentControlSetServices_]
mov word [eax + edx], cx
add edx, 2
test cx, cx
jne 0x4014a0
cmp word [eax], 0
mov ecx, eax
je 0x4014c9
nop
lea esi, [esi]
add ecx, 2
cmp word [ecx], 0
jne 0x4014c0
xor edx, edx
nop
lea esi, [esi]
movzx edi, word [esi + edx]
mov word [ecx + edx], di
add edx, 2
test di, di
jne 0x4014d0
lea edi, [ebp - 0x38]
mov dword [esp + 4], eax
mov dword [esp], edi
call dword [sym.imp.ntoskrnl.exe_RtlInitUnicodeString]
sub esp, 8
cmp ebx, 1
je 0x401620
cmp ebx, 0x80
je 0x4015d0
test ebx, ebx
je 0x401600
xor edx, edx
test byte [0x403018], 1
je 0x4015da
mov eax, esi
mov dword [ebp - 0x3c], edx
call sym._wine_dbgstr_wn.constprop.0
mov dword [esp + 0x10], ebx
mov dword [esp + 0x14], eax
mov dword [esp + 0xc], str.got_driver_ctrl__lx_for__s_n
mov dword [esp + 8], 0x4040cc
mov dword [esp + 4], 0x403018
mov dword [esp], 0
call sym._wine_dbg_log.constprop.0
mov edx, dword [ebp - 0x3c]
jmp 0x4015da
call sym._wine_dbgstr_wn.constprop.0
mov dword [esp + 0xc], str.shutting_down__s_n
mov dword [esp + 0x10], eax
mov dword [esp + 8], str.service_handler
mov dword [esp + 4], 0x403018
mov dword [esp], 3
call sym._wine_dbg_log.constprop.0
jmp 0x4013d9
call sym._wine_dbgstr_wn.constprop.0
mov dword [esp + 0x10], ebx
mov dword [esp + 0x14], eax
mov dword [esp + 0xc], str.got_service_ctrl__lx_for__s_n
mov dword [esp + 8], str.service_handler
mov dword [esp + 4], 0x403018
mov dword [esp], 0
call sym._wine_dbg_log.constprop.0
jmp 0x40137e
mov dword [esp], esi
call sym._wine_enumerate_root_devices
xor edx, edx
mov dword [ebp - 0x3c], edx
mov dword [esp], edi
call dword [sym.imp.ntoskrnl.exe_RtlFreeUnicodeString]
mov edx, dword [ebp - 0x3c]
sub esp, 4
lea esp, [ebp - 0x10]
pop ecx
mov eax, edx
pop ebx
pop esi
pop edi
pop ebp
lea esp, [ecx - 4]
ret 0x10
mov dword [esp], edi
call sym._ZwLoadDriver_4
sub esp, 4
mov dword [esp], eax
call dword [sym.imp.ntoskrnl.exe_RtlNtStatusToDosError]
sub esp, 4
mov edx, eax
jmp 0x4015da
mov dword [esp], edi
call sym._ZwUnloadDriver_4
jmp 0x401608
mov eax, 0x6a
jmp 0x40146e
mov edx, 0xc0000017
jmp 0x4013b9