Function at 0x40b7e1
Capabilities:
Copy file
Create service
Delete file
Delete service
Modify service
Query service status
Start service

Disassembly:
push ebp
sub esp, 0x68
lea ebp, [esp - 4]
mov eax, dword [0x448490]
xor eax, ebp
mov dword [ebp + 0x68], eax
push 0x140
mov eax, 0x43364c
call fcn.0041efdd
mov edi, dword [ebp + 0x74]
lea eax, [ebp - 0xac]
push eax
mov dword [ebp], edi
call fcn.00409ddd
mov dword [esp], str....
push edi
xor ebx, ebx
push str.Connecting_to_
mov ecx, eax
mov dword [ebp - 4], ebx
call fcn.00403a8d
mov ecx, eax
call fcn.0040e4c0
mov ecx, eax
call fcn.00403a8d
xor esi, esi
inc esi
lea ecx, [ebp - 0xac]
mov dword [ebp - 4], esi
call fcn.00403cc4
or dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0xa4]
call fcn.0040382d
cmp dword [edi + 0x14], 8
jb 0x40b865
mov eax, dword [edi]
jmp 0x40b867
mov eax, edi
push 7
push str.ServicesActive
push eax
call dword [sym.imp.ADVAPI32.dll_OpenSCManagerW]
mov dword [ebp + 4], eax
cmp eax, ebx
lea eax, [ebp - 0xac]
mov dword [ebp - 4], 2
push eax
jne 0x40b909
call fcn.00403d9a
pop ecx
mov ebx, eax
mov esi, dword [sym.imp.KERNEL32.dll_GetLastError]
mov byte [ebp - 4], 3
call esi
mov dword [ebp + 0x10], eax
lea eax, [ebp + 0x10]
push eax
push 0x435f98
push edi
push str.Cannot_connect_to_the_service_control_manager_on_machine_
mov ecx, ebx
call fcn.00403a8d
mov ecx, eax
call fcn.0040e4c0
mov ecx, eax
call fcn.00403a8d
mov ecx, eax
call fcn.0040e3d4
lea ecx, [ebp - 0xac]
mov byte [ebp - 4], 4
call fcn.00403cc4
lea ecx, [ebp - 0xa4]
mov byte [ebp - 4], 2
call fcn.0040382d
call esi
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp + 0x68]
xor ecx, ebp
call fcn.0041efce
add ebp, 0x6c
leave
ret
call fcn.00409ddd
mov ecx, eax
mov byte [ebp - 4], 5
mov dword [esp], str.Connection_to_service_control_manager_established.
call fcn.00403a8d
lea ecx, [ebp - 0xac]
mov byte [ebp - 4], 6
call fcn.00403cc4
lea ecx, [ebp - 0xa4]
mov byte [ebp - 4], 2
call fcn.0040382d
lea eax, [ebp - 0xac]
push eax
call fcn.00409ddd
mov ecx, eax
mov byte [ebp - 4], 7
mov dword [esp], str.Deploying_service...
call fcn.00403a8d
lea ecx, [ebp - 0xac]
mov byte [ebp - 4], 8
call fcn.00403cc4
lea ecx, [ebp - 0xa4]
mov byte [ebp - 4], 2
call fcn.0040382d
push 0x436328
lea ecx, [ebp + 0x30]
call fcn.0040824d
push edi
push eax
lea eax, [ebp + 0x4c]
push eax
mov byte [ebp - 4], 9
call fcn.00408ec2
push str.ADMIN__snowexec.exe
push eax
lea eax, [ebp + 0x14]
push eax
mov byte [ebp - 4], 0xa
call fcn.00408e97
add esp, 0x18
push ebx
push esi
lea ecx, [ebp + 0x4c]
call fcn.00404a05
push ebx
push esi
lea ecx, [ebp + 0x30]
mov byte [ebp - 4], 0xd
call fcn.00404a05
cmp dword [ebp + 0x28], 8
mov ecx, dword [ebp + 0x14]
jae 0x40b9d0
lea ecx, [ebp + 0x14]
cmp dword [0x449778], 8
mov eax, dword [0x449764]
jae 0x40b9e3
mov eax, 0x449764
push ebx
push ecx
push eax
call dword [sym.imp.KERNEL32.dll_CopyFileW]
test eax, eax
lea eax, [ebp - 0xac]
push eax
jne 0x40ba94
call fcn.00403d9a
pop ecx
mov dword [ebp + 8], eax
mov esi, dword [sym.imp.KERNEL32.dll_GetLastError]
mov byte [ebp - 4], 0xe
call esi
mov ecx, dword [ebp + 8]
mov dword [ebp + 0x10], eax
lea eax, [ebp + 0x10]
push eax
push 0x435f98
push edi
push str._to_administrative_file_share_ADMIN__on_
push 0x449764
push str.Cannot_copy_
call fcn.0040e36e
mov ecx, eax
call fcn.0040e4c0
mov ecx, eax
call fcn.0040e36e
mov ecx, eax
call fcn.0040e4c0
mov ecx, eax
call fcn.00403a8d
mov ecx, eax
call fcn.0040e3d4
lea ecx, [ebp - 0xac]
mov byte [ebp - 4], 0xf
call fcn.00403cc4
lea ecx, [ebp - 0xa4]
mov byte [ebp - 4], 0xd
call fcn.0040382d
call esi
mov esi, eax
push ebx
push 1
lea ecx, [ebp + 0x14]
call fcn.00404a05
push dword [ebp + 4]
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
mov eax, esi
jmp 0x40b8ec
call fcn.00409ddd
mov ecx, eax
mov byte [ebp - 4], 0x10
mov dword [esp], str.Deployed_service.
call fcn.00403a8d
lea ecx, [ebp - 0xac]
mov byte [ebp - 4], 0x11
call fcn.00403cc4
lea ecx, [ebp - 0xa4]
mov byte [ebp - 4], 0xd
call fcn.0040382d
push ebx
push ebx
push ebx
push ebx
push ebx
push str._SYSTEMROOT__snowexec.exe
push ebx
push 3
push 0x10
mov edi, 0xf01ff
push edi
push 0x43620c
mov esi, str.SnowInventoryLauncher
push esi
push dword [ebp + 4]
call dword [sym.imp.ADVAPI32.dll_CreateServiceW]
mov dword [ebp + 8], eax
mov byte [ebp - 4], 0x12
cmp eax, ebx
je 0x40bb11
lea ecx, [ebp + 0x10]
push ecx
push 1
push eax
mov dword [ebp + 0x10], str.Manager_for_the_Snow_Inventory_remoting_solution._This_service_will_uninstall_itself_when_done.
call dword [sym.imp.ADVAPI32.dll_ChangeServiceConfig2W]
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x431
jne 0x40bb38
push edi
push esi
push dword [ebp + 4]
call dword [sym.imp.ADVAPI32.dll_OpenServiceW]
mov dword [ebp + 0x10], eax
lea eax, [ebp + 0x10]
push eax
lea ecx, [ebp + 8]
call fcn.004041e4
mov edi, dword [ebp + 8]
cmp edi, ebx
je 0x40bf2a
mov dword [ebp + 0x3c], ebx
mov dword [ebp + 0x40], ebx
mov dword [ebp + 0x44], ebx
push esi
lea ecx, [ebp + 0x4c]
mov byte [ebp - 4], 0x13
call fcn.0040824d
lea eax, [ebp + 0x4c]
push eax
lea ecx, [ebp + 0x3c]
mov byte [ebp - 4], 0x14
call fcn.0040b2a1
xor edi, edi
push ebx
inc edi
push edi
lea ecx, [ebp + 0x4c]
mov byte [ebp - 4], 0x13
call fcn.00404a05
push 0x436110
lea ecx, [ebp + 0x4c]
call fcn.0040824d
lea eax, [ebp + 0x4c]
push eax
lea ecx, [ebp + 0x3c]
mov byte [ebp - 4], 0x15
call fcn.0040b2a1
push ebx
push edi
lea ecx, [ebp + 0x4c]
mov byte [ebp - 4], 0x13
call fcn.00404a05
cmp byte [0x4497b0], bl
je 0x40bbd8
push 0x436100
lea ecx, [ebp + 0x4c]
call fcn.0040824d
lea eax, [ebp + 0x4c]
push eax
lea ecx, [ebp + 0x3c]
mov byte [ebp - 4], 0x16
call fcn.0040b2a1
push ebx
push edi
lea ecx, [ebp + 0x4c]
mov byte [ebp - 4], 0x13
call fcn.00404a05
cmp byte [0x4497af], bl
je 0x40bc0b
push 0x4360ec
lea ecx, [ebp + 0x4c]
call fcn.0040824d
lea eax, [ebp + 0x4c]
push eax
lea ecx, [ebp + 0x3c]
mov byte [ebp - 4], 0x17
call fcn.0040b2a1
push ebx
push edi
lea ecx, [ebp + 0x4c]
mov byte [ebp - 4], 0x13
call fcn.00404a05
cmp byte [0x4497ac], bl
je 0x40bc3e
push 0x4360d4
lea ecx, [ebp + 0x4c]
call fcn.0040824d
lea eax, [ebp + 0x4c]
push eax
lea ecx, [ebp + 0x3c]
mov byte [ebp - 4], 0x18
call fcn.0040b2a1
push ebx
push edi
lea ecx, [ebp + 0x4c]
mov byte [ebp - 4], 0x13
call fcn.00404a05
cmp byte [0x4497ad], bl
je 0x40bc71
push 0x4360c4
lea ecx, [ebp + 0x4c]
call fcn.0040824d
lea eax, [ebp + 0x4c]
push eax
lea ecx, [ebp + 0x3c]
mov byte [ebp - 4], 0x19
call fcn.0040b2a1
push ebx
push edi
lea ecx, [ebp + 0x4c]
mov byte [ebp - 4], 0x13
call fcn.00404a05
cmp byte [0x4497ae], bl
je 0x40bca4
push 0x4360b4
lea ecx, [ebp + 0x4c]
call fcn.0040824d
lea eax, [ebp + 0x4c]
push eax
lea ecx, [ebp + 0x3c]
mov byte [ebp - 4], 0x1a
call fcn.0040b2a1
push ebx
push edi
lea ecx, [ebp + 0x4c]
mov byte [ebp - 4], 0x13
call fcn.00404a05
cmp dword [0x4497a0], ebx
jbe 0x40bce4
push 0x4360a4
lea ecx, [ebp + 0x4c]
call fcn.0040824d
lea eax, [ebp + 0x4c]
push eax
lea ecx, [ebp + 0x3c]
mov byte [ebp - 4], 0x1b
call fcn.0040b2a1
push ebx
push edi
lea ecx, [ebp + 0x4c]
mov byte [ebp - 4], 0x13
call fcn.00404a05
push 0x449790
lea ecx, [ebp + 0x3c]
call fcn.0040b2a1
mov esi, dword [0x449780]
jmp 0x40bd34
mov eax, dword [ebp + 0x40]
sub eax, dword [ebp + 0x3c]
push 0x1c
cdq
pop ecx
idiv ecx
cmp eax, 0x20
jae 0x40bd3c
push 0x436094
lea ecx, [ebp + 0x4c]
call fcn.0040824d
lea eax, [ebp + 0x4c]
push eax
lea ecx, [ebp + 0x3c]
mov byte [ebp - 4], 0x1c
call fcn.0040b2a1
push ebx
push edi
lea ecx, [ebp + 0x4c]
mov byte [ebp - 4], 0x13
call fcn.00404a05
push esi
lea ecx, [ebp + 0x3c]
call fcn.0040b2a1
add esi, 0x1c
cmp esi, dword [0x449784]
jne 0x40bcec
mov eax, dword [ebp + 0x40]
sub eax, dword [ebp + 0x3c]
push 0x1f
pop esi
cdq
push 0x1c
pop edi
xor ecx, ecx
idiv edi
mov dword [ebp + 0xc], esi
mov dword [ebp + 0x10], eax
mov eax, dword [ebp + 0x3c]
lea edx, [ebp + 0xc]
cmp dword [ebp + 0x10], esi
ja 0x40bd61
lea edx, [ebp + 0x10]
cmp ecx, dword [edx]
jae 0x40bd7e
cmp dword [eax + 0x14], 8
jb 0x40bd6f
mov edx, dword [eax]
jmp 0x40bd71
mov edx, eax
mov dword [ebp + ecx*4 - 0x8c], edx
inc ecx
add eax, 0x1c
jmp 0x40bd56
mov edi, dword [ebp + 8]
lea eax, [ebp - 0x8c]
push eax
push ecx
push edi
mov dword [ebp + ecx*4 - 0x8c], ebx
call dword [sym.imp.ADVAPI32.dll_StartServiceW]
test eax, eax
je 0x40bec8
lea eax, [ebp - 0x14c]
push eax
call fcn.00409ddd
mov ecx, eax
mov byte [ebp - 4], 0x1d
mov dword [esp], str.Service_started_successfully.
call fcn.00403a8d
lea ecx, [ebp - 0x14c]
mov byte [ebp - 4], 0x1e
call fcn.00403cc4
lea ecx, [ebp - 0x144]
mov byte [ebp - 4], 0x13
call fcn.0040382d
push edi
call dword [sym.imp.ADVAPI32.dll_DeleteService]
xor esi, esi
push 0x3e8
call dword [sym.imp.KERNEL32.dll_Sleep]
lea eax, [ebp + 0x4c]
push eax
push edi
call dword [sym.imp.ADVAPI32.dll_QueryServiceStatus]
test eax, eax
je 0x40be04
cmp dword [ebp + 0x50], 1
je 0x40be0a
inc esi
cmp esi, 0x1e
jl 0x40bde4
cmp dword [ebp + 0x28], 8
mov eax, dword [ebp + 0x14]
jae 0x40be16
lea eax, [ebp + 0x14]
push eax
call dword [sym.imp.KERNEL32.dll_DeleteFileW]
cmp dword [ebp + 0x5c], ebx
je 0x40be75
lea eax, [ebp - 0x14c]
push eax
call fcn.00403d9a
mov dword [esp], 0x436070
lea ecx, [ebp + 0x5c]
push ecx
push str.Service_failed_with_an_error_code
mov ecx, eax
mov byte [ebp - 4], 0x1f
call fcn.00403a8d
mov ecx, eax
call fcn.0040735f
mov ecx, eax
call fcn.00403a8d
lea ecx, [ebp - 0x14c]
mov byte [ebp - 4], 0x20
call fcn.00403cc4
lea ecx, [ebp - 0x144]
mov byte [ebp - 4], 0x13
call fcn.0040382d
lea eax, [ebp - 0x14c]
push eax
call fcn.00409ddd
mov ecx, eax
mov byte [ebp - 4], 0x21
mov dword [esp], str.Service_has_stopped.
call fcn.00403a8d
lea ecx, [ebp - 0x14c]
mov byte [ebp - 4], 0x22
call fcn.00403cc4
lea ecx, [ebp - 0x144]
mov byte [ebp - 4], 0x13
call fcn.0040382d
mov esi, dword [ebp + 0x5c]
lea ecx, [ebp + 0x3c]
call fcn.0040a342
push edi
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
jmp 0x40ba79
push edi
call dword [sym.imp.ADVAPI32.dll_DeleteService]
lea eax, [ebp - 0x14c]
push eax
call fcn.00403d9a
pop ecx
mov esi, eax
mov byte [ebp - 4], 0x23
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp + 0xc], eax
lea eax, [ebp + 0xc]
push eax
push str.Service_cannot_start.
mov ecx, esi
call fcn.00403a8d
mov ecx, eax
call fcn.0040e3d4
lea ecx, [ebp - 0x14c]
mov byte [ebp - 4], 0x24
call fcn.00403cc4
lea ecx, [ebp - 0x144]
mov byte [ebp - 4], 0x13
call fcn.0040382d
lea ecx, [ebp + 0x3c]
call fcn.0040a342
jmp 0x40bf91
lea eax, [ebp - 0x14c]
push eax
call fcn.00403d9a
pop ecx
mov esi, eax
mov byte [ebp - 4], 0x25
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp + 0xc], eax
lea eax, [ebp + 0xc]
push eax
push 0x435f98
push dword [ebp]
mov ecx, esi
push str.Cannot_access_service_database_on_machine_
call fcn.00403a8d
mov ecx, eax
call fcn.0040e4c0
mov ecx, eax
call fcn.00403a8d
mov ecx, eax
call fcn.0040e3d4
lea ecx, [ebp - 0x14c]
mov byte [ebp - 4], 0x26
call fcn.00403cc4
lea ecx, [ebp - 0x144]
mov byte [ebp - 4], 0x12
call fcn.0040382d
cmp edi, ebx
je 0x40bf9c
push edi
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
call dword [sym.imp.KERNEL32.dll_GetLastError]
jmp 0x40ba77