Function at 0x418700
Capabilities:
Create service
Modify service
Persist via windows service
Start service

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x1d8
mov eax, dword [0x459074]
xor eax, ebp
mov dword [ebp - 4], eax
push 0xf003f
push 0
push 0
call dword [sym.imp.ADVAPI32.dll_OpenSCManagerA]
mov dword [ebp - 0x17c], eax
cmp dword [ebp - 0x17c], 0
jne 0x4187ba
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 0x18c], eax
mov dword [ebp - 0x184], 0x4538c8
push 0x5c
mov eax, dword [ebp - 0x184]
push eax
call fcn.00423220
add esp, 8
mov dword [ebp - 0x180], eax
cmp dword [ebp - 0x180], 0
je 0x41877c
mov ecx, dword [ebp - 0x180]
add ecx, 1
mov dword [ebp - 0x188], ecx
jmp 0x418788
mov edx, dword [ebp - 0x184]
mov dword [ebp - 0x188], edx
mov eax, dword [ebp - 0x18c]
push eax
push str.Couldnt_open_service_manager_error:_d
push 0x12f
mov ecx, dword [ebp - 0x188]
push ecx
push 1
call dword [sym.imp.libnac_base.dll_error_output]
add esp, 0x14
xor edx, edx
jne 0x418741
mov eax, dword [ebp - 0x18c]
jmp 0x418c0c
push 0x104
push 0
lea eax, [ebp - 0x108]
push eax
call fcn.00423990
add esp, 0xc
push 0x104
lea ecx, [ebp - 0x108]
push ecx
push 0
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameA]
push 0
push 0
push 0x44eb41
push 0
push 0
lea edx, [ebp - 0x108]
push edx
push 1
push 2
push 0x10
push 0xf01ff
push str.byod_monitor
push str.byod_monitor
mov eax, dword [ebp - 0x17c]
push eax
call dword [sym.imp.ADVAPI32.dll_CreateServiceA]
mov dword [ebp - 0x178], eax
cmp dword [ebp - 0x178], 0
jne 0x4188bf
mov ecx, dword [ebp - 0x17c]
push ecx
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 0x19c], eax
mov dword [ebp - 0x194], 0x453970
push 0x5c
mov edx, dword [ebp - 0x194]
push edx
call fcn.00423220
add esp, 8
mov dword [ebp - 0x190], eax
cmp dword [ebp - 0x190], 0
je 0x418881
mov eax, dword [ebp - 0x190]
add eax, 1
mov dword [ebp - 0x198], eax
jmp 0x41888d
mov ecx, dword [ebp - 0x194]
mov dword [ebp - 0x198], ecx
mov edx, dword [ebp - 0x19c]
push edx
push str.Couldnt_open_service_error:_d
push 0x13e
mov eax, dword [ebp - 0x198]
push eax
push 1
call dword [sym.imp.libnac_base.dll_error_output]
add esp, 0x14
xor ecx, ecx
jne 0x418846
mov eax, dword [ebp - 0x19c]
jmp 0x418c0c
mov dword [ebp - 0x174], 0
mov dword [ebp - 0x174], 0
jmp 0x4188e4
mov edx, dword [ebp - 0x174]
add edx, 1
mov dword [ebp - 0x174], edx
cmp dword [ebp - 0x174], 0xa
jge 0x418911
mov eax, dword [ebp - 0x174]
mov dword [ebp + eax*8 - 0x158], 1
mov ecx, dword [ebp - 0x174]
mov dword [ebp + ecx*8 - 0x154], 0x7d0
jmp 0x4188d5
mov edx, 8
imul eax, edx, 9
mov dword [ebp + eax - 0x158], 0
mov dword [ebp - 0x170], 0
mov dword [ebp - 0x168], 0
mov dword [ebp - 0x16c], 0
mov dword [ebp - 0x164], 0xa
lea ecx, [ebp - 0x158]
mov dword [ebp - 0x160], ecx
lea edx, [ebp - 0x170]
push edx
push 2
mov eax, dword [ebp - 0x178]
push eax
call dword [sym.imp.ADVAPI32.dll_ChangeServiceConfig2A]
test eax, eax
jne 0x4189e0
mov dword [ebp - 0x1a4], 0x453a08
push 0x5c
mov ecx, dword [ebp - 0x1a4]
push ecx
call fcn.00423220
add esp, 8
mov dword [ebp - 0x1a0], eax
cmp dword [ebp - 0x1a0], 0
je 0x4189ad
mov edx, dword [ebp - 0x1a0]
add edx, 1
mov dword [ebp - 0x1a8], edx
jmp 0x4189b9
mov eax, dword [ebp - 0x1a4]
mov dword [ebp - 0x1a8], eax
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push 0x453174
push 0x155
mov ecx, dword [ebp - 0x1a8]
push ecx
push 1
call dword [sym.imp.libnac_base.dll_error_output]
add esp, 0x14
xor edx, edx
jne 0x418972
mov dword [ebp - 0x1b0], 0x453a90
push 0x5c
mov eax, dword [ebp - 0x1b0]
push eax
call fcn.00423220
add esp, 8
mov dword [ebp - 0x1ac], eax
cmp dword [ebp - 0x1ac], 0
je 0x418a1b
mov ecx, dword [ebp - 0x1ac]
add ecx, 1
mov dword [ebp - 0x1b4], ecx
jmp 0x418a27
mov edx, dword [ebp - 0x1b0]
mov dword [ebp - 0x1b4], edx
push str.ChangeServiceConfig2_RESTART_success
push 0x157
mov eax, dword [ebp - 0x1b4]
push eax
push 2
call dword [sym.imp.libnac_base.dll_error_output]
add esp, 0x10
xor ecx, ecx
jne 0x4189e0
xor edx, edx
mov dword [ebp - 0x15c], edx
mov dword [ebp - 0x15c], str.Sangfor_BYOD_Monitor_Service
lea eax, [ebp - 0x15c]
push eax
push 1
mov ecx, dword [ebp - 0x178]
push ecx
call dword [sym.imp.ADVAPI32.dll_ChangeServiceConfig2A]
test eax, eax
jne 0x418ae1
mov dword [ebp - 0x1bc], 0x453b80
push 0x5c
mov edx, dword [ebp - 0x1bc]
push edx
call fcn.00423220
add esp, 8
mov dword [ebp - 0x1b8], eax
cmp dword [ebp - 0x1b8], 0
je 0x418aae
mov eax, dword [ebp - 0x1b8]
add eax, 1
mov dword [ebp - 0x1c0], eax
jmp 0x418aba
mov ecx, dword [ebp - 0x1bc]
mov dword [ebp - 0x1c0], ecx
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.ChangeServiceConfig2_fail_error:_d
push 0x15e
mov edx, dword [ebp - 0x1c0]
push edx
push 1
call dword [sym.imp.libnac_base.dll_error_output]
add esp, 0x14
xor eax, eax
jne 0x418a73
mov dword [ebp - 0x1c8], 0x453c00
push 0x5c
mov ecx, dword [ebp - 0x1c8]
push ecx
call fcn.00423220
add esp, 8
mov dword [ebp - 0x1c4], eax
cmp dword [ebp - 0x1c4], 0
je 0x418b1c
mov edx, dword [ebp - 0x1c4]
add edx, 1
mov dword [ebp - 0x1cc], edx
jmp 0x418b28
mov eax, dword [ebp - 0x1c8]
mov dword [ebp - 0x1cc], eax
push str.ChangeServiceConfig2_Description_success
push 0x160
mov ecx, dword [ebp - 0x1cc]
push ecx
push 2
call dword [sym.imp.libnac_base.dll_error_output]
add esp, 0x10
xor edx, edx
jne 0x418ae1
push 0
push 0
mov eax, dword [ebp - 0x178]
push eax
call dword [sym.imp.ADVAPI32.dll_StartServiceA]
test eax, eax
jne 0x418bed
mov ecx, dword [ebp - 0x178]
push ecx
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
mov edx, dword [ebp - 0x17c]
push edx
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
mov dword [ebp - 0x1d4], 0x453c90
push 0x5c
mov eax, dword [ebp - 0x1d4]
push eax
call fcn.00423220
add esp, 8
mov dword [ebp - 0x1d0], eax
cmp dword [ebp - 0x1d0], 0
je 0x418bb6
mov ecx, dword [ebp - 0x1d0]
add ecx, 1
mov dword [ebp - 0x1d8], ecx
jmp 0x418bc2
mov edx, dword [ebp - 0x1d4]
mov dword [ebp - 0x1d8], edx
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.Couldnt_start_service_error:_d
push 0x165
mov eax, dword [ebp - 0x1d8]
push eax
push 1
call dword [sym.imp.libnac_base.dll_error_output]
add esp, 0x14
xor ecx, ecx
jne 0x418b7b
xor eax, eax
jmp 0x418c0c
mov edx, dword [ebp - 0x178]
push edx
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
mov eax, dword [ebp - 0x17c]
push eax
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
mov eax, 1
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00421720
mov esp, ebp
pop ebp
ret