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

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
push ebx
sub esp, 0x38
mov ebx, dword [ebp + 8]
mov esi, dword [ebp + 0x10]
test ebx, ebx
js 0x402940
mov edx, ebx
movzx eax, byte [0x404010]
and edx, 0xfffffffb
cmp edx, 1
je 0x4028c8
test al, 1
jne 0x402b10
lea eax, [ebp - 0x28]
mov dword [ebp - 0x28], 0x30
mov dword [esp + 4], eax
mov eax, dword [0x404104]
mov dword [ebp - 0x24], 4
mov dword [ebp - 0x20], 5
mov dword [ebp - 0x1c], 0
mov dword [ebp - 0x18], 0
mov dword [ebp - 0x14], 0
mov dword [ebp - 0x10], 0
mov dword [esp], eax
call dword [sym.imp.advapi32.dll_SetServiceStatus]
xor eax, eax
sub esp, 8
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret 0x10
test al, 8
jne 0x402a98
lea eax, [ebp - 0x28]
mov dword [ebp - 0x28], 0x30
mov dword [esp + 4], eax
mov eax, dword [0x404104]
mov dword [ebp - 0x24], 3
mov dword [ebp - 0x20], 0
mov dword [ebp - 0x1c], 0
mov dword [ebp - 0x18], 0
mov dword [ebp - 0x14], 0
mov dword [ebp - 0x10], 0
mov dword [esp], eax
call dword [sym.imp.advapi32.dll_SetServiceStatus]
mov eax, dword [0x404108]
sub esp, 8
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_SetEvent]
xor eax, eax
sub esp, 4
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret 0x10
mov eax, 0x57
test esi, esi
je 0x4028bb
and ebx, 0x7fffffff
cmp word [esi], 0
je 0x402bf0
mov eax, esi
nop
add eax, 2
cmp word [eax], 0
jne 0x402960
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 0x402c65
xor eax, eax
mov edx, 0x5c
jmp 0x4029b7
movzx edx, word [eax + str.RegistryMachineSystemCurrentControlSetServices_]
mov word [ecx + eax], dx
add eax, 2
test dx, dx
jne 0x4029b0
cmp word [ecx], 0
mov edx, ecx
je 0x4029d9
lea esi, [esi]
nop
add edx, 2
cmp word [edx], 0
jne 0x4029d0
xor eax, eax
lea esi, [esi]
nop
movzx edi, word [esi + eax]
mov word [edx + eax], di
add eax, 2
test di, di
jne 0x4029e0
lea edi, [ebp - 0x28]
mov dword [esp + 4], ecx
mov dword [esp], edi
call dword [sym.imp.ntoskrnl.exe_RtlInitUnicodeString]
sub esp, 8
cmp ebx, 1
je 0x402bd0
cmp ebx, 0x80
je 0x402b88
test ebx, ebx
je 0x402bb0
xor eax, eax
test byte [0x404010], 1
je 0x402b92
mov eax, esi
shr eax, 0x10
je 0x402c4d
mov dword [esp + 4], 0xffffffff
mov dword [esp], esi
call dword [sym.imp.kernel32.dll_IsBadStringPtrW]
mov edx, eax
sub esp, 8
mov eax, str._invalid_
test edx, edx
jne 0x402a60
mov eax, esi
call sym._wine_dbgstr_wn.part.0.constprop.0
mov dword [esp + 0x14], eax
mov dword [esp + 0x10], ebx
mov dword [esp + 0xc], str.got_driver_ctrl__lx_for__s_n
mov dword [esp + 8], str.device_handler
mov dword [esp + 4], 0x404010
mov dword [esp], 0
call sym._wine_dbg_log.constprop.0
xor eax, eax
jmp 0x402b92
mov edx, dword [ebp + 0x14]
test edx, edx
je 0x402c43
mov eax, dword [ebp + 0x14]
shr eax, 0x10
je 0x402c20
mov eax, dword [ebp + 0x14]
mov dword [esp + 4], 0xffffffff
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_IsBadStringPtrW]
mov edx, eax
sub esp, 8
mov eax, str._invalid_
test edx, edx
jne 0x402ad9
mov eax, dword [ebp + 0x14]
call sym._wine_dbgstr_wn.part.0.constprop.0
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], str.shutting_down__s_n
mov dword [esp + 8], str.service_handler
mov dword [esp + 4], 0x404010
mov dword [esp], 3
call sym._wine_dbg_log.constprop.0
jmp 0x4028d0
mov eax, dword [ebp + 0x14]
test eax, eax
je 0x402c39
mov eax, dword [ebp + 0x14]
shr eax, 0x10
je 0x402c00
mov eax, dword [ebp + 0x14]
mov dword [esp + 4], 0xffffffff
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_IsBadStringPtrW]
mov edx, eax
sub esp, 8
mov eax, str._invalid_
test edx, edx
jne 0x402b51
mov eax, dword [ebp + 0x14]
call sym._wine_dbgstr_wn.part.0.constprop.0
mov dword [esp + 0x14], eax
mov dword [esp + 0x10], ebx
mov dword [esp + 0xc], str.got_service_ctrl__lx_for__s_n
mov dword [esp + 8], str.service_handler
mov dword [esp + 4], 0x404010
mov dword [esp], 0
call sym._wine_dbg_log.constprop.0
jmp 0x402870
mov dword [esp], esi
call sym._wine_enumerate_root_devices
xor eax, eax
mov dword [ebp - 0x2c], eax
mov dword [esp], edi
call dword [sym.imp.ntoskrnl.exe_RtlFreeUnicodeString]
mov eax, dword [ebp - 0x2c]
sub esp, 4
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
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
jmp 0x402b92
mov dword [esp], edi
call sym._ZwUnloadDriver_4
sub esp, 4
mov dword [esp], eax
call dword [sym.imp.ntoskrnl.exe_RtlNtStatusToDosError]
sub esp, 4
jmp 0x402b92
mov eax, 0x6a
jmp 0x40296e
movzx eax, word [ebp + 0x14]
mov dword [esp], str._04x
mov dword [esp + 4], eax
call sym._wine_dbg_sprintf.constprop.0
jmp 0x402b51
movzx eax, word [ebp + 0x14]
mov dword [esp], str._04x
mov dword [esp + 4], eax
call sym._wine_dbg_sprintf.constprop.0
jmp 0x402ad9
mov eax, str._null_
jmp 0x402b51
mov eax, str._null_
jmp 0x402ad9
movzx esi, si
mov dword [esp], str._04x
mov dword [esp + 4], esi
call sym._wine_dbg_sprintf.constprop.0
jmp 0x402a60
mov eax, 0xc0000017
jmp 0x4028bb