Function at 0x401310
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, 0x58
mov ebx, dword [ecx]
mov esi, dword [ecx + 8]
mov eax, dword [ecx + 0xc]
test ebx, ebx
js 0x401428
mov ecx, ebx
movzx edx, byte [global___dbch]
and ecx, 0xfffffffb
cmp ecx, 1
je 0x4013b0
and edx, 1
jne 0x4015c0
lea eax, [ebp - 0x34]
mov dword [ebp - 0x34], 0x30
xor edi, edi
mov dword [esp + 4], eax
mov eax, dword [0x406008]
mov dword [ebp - 0x30], 4
mov dword [esp], eax
mov dword [ebp - 0x2c], 5
mov dword [ebp - 0x28], 0
mov dword [ebp - 0x24], 0
mov dword [ebp - 0x20], 0
mov dword [ebp - 0x1c], 0
call sym._SetServiceStatus_8
sub esp, 8
lea esp, [ebp - 0x10]
mov eax, edi
pop ecx
pop ebx
pop esi
pop edi
pop ebp
lea esp, [ecx - 4]
ret 0x10
and edx, 8
jne 0x401588
lea eax, [ebp - 0x34]
mov dword [ebp - 0x34], 0x30
xor edi, edi
mov dword [esp + 4], eax
mov eax, dword [0x406008]
mov dword [ebp - 0x30], 3
mov dword [esp], eax
mov dword [ebp - 0x2c], 0
mov dword [ebp - 0x28], 0
mov dword [ebp - 0x24], 0
mov dword [ebp - 0x20], 0
mov dword [ebp - 0x1c], 0
call sym._SetServiceStatus_8
mov eax, dword [section..bss]
sub esp, 8
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_SetEvent]
mov eax, edi
sub esp, 4
lea esp, [ebp - 0x10]
pop ecx
pop ebx
pop esi
pop edi
pop ebp
lea esp, [ecx - 4]
ret 0x10
mov edi, 0x57
test esi, esi
je 0x401398
and ebx, 0x7fffffff
cmp word [esi], 0
mov dword [ebp - 0x3c], ebx
je 0x401610
mov eax, esi
lea esi, [esi]
add eax, 2
cmp word [eax], 0
jne 0x401450
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
mov ecx, eax
test eax, eax
je 0x401620
xor eax, eax
mov edx, 0x5c
jmp 0x4014a7
movzx edx, word [eax + str.RegistryMachineSystemCurrentControlSetServices_]
mov word [ecx + eax], dx
add eax, 2
test dx, dx
jne 0x4014a0
cmp word [ecx], 0
mov edx, ecx
je 0x4014c9
lea esi, [esi]
nop
add edx, 2
cmp word [edx], 0
jne 0x4014c0
xor eax, eax
lea esi, [esi]
nop
movzx edi, word [esi + eax]
mov word [edx + eax], di
add eax, 2
test di, di
jne 0x4014d0
lea ebx, [ebp - 0x34]
mov dword [esp + 4], ecx
mov dword [esp], ebx
call dword [sym.imp.ntoskrnl.exe_RtlInitUnicodeString]
mov eax, dword [ebp - 0x3c]
sub esp, 8
test eax, eax
je 0x401600
cmp eax, 1
jne 0x401540
mov dword [esp], ebx
call sym._ZwUnloadDriver_4
sub esp, 4
mov dword [esp], eax
call dword [sym.imp.ntoskrnl.exe_RtlNtStatusToDosError]
sub esp, 4
mov edi, eax
mov dword [esp], ebx
call dword [sym.imp.ntoskrnl.exe_RtlFreeUnicodeString]
mov eax, edi
sub esp, 4
lea esp, [ebp - 0x10]
pop ecx
pop ebx
pop esi
pop edi
pop ebp
lea esp, [ecx - 4]
ret 0x10
xor edi, edi
test byte [0x403018], 1
je 0x40151c
mov eax, esi
call sym._wine_dbgstr_wn.constprop.0
mov dword [esp + 0xc], str.got_driver_ctrl__x_for__s_n
mov dword [esp + 0x14], eax
mov eax, dword [ebp - 0x3c]
mov dword [esp + 8], 0x4040a8
mov dword [esp + 0x10], eax
mov dword [esp + 4], global___dbch
mov dword [esp], 0
call sym._wine_dbg_log.constprop.0
jmp 0x40151c
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], global___dbch
mov dword [esp], 3
call sym._wine_dbg_log.constprop.0
jmp 0x4013b9
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__x_for__s_n
mov dword [esp + 8], str.service_handler
mov dword [esp + 4], global___dbch
mov dword [esp], 0
call sym._wine_dbg_log.constprop.0
jmp 0x40134e
mov dword [esp], ebx
call sym._ZwLoadDriver_4
jmp 0x40150b
mov eax, 0x6a
jmp 0x40145e
mov edi, 0xc0000017
jmp 0x401398