Function at 0x40c990
Capabilities:
Access peb ldr_data
Persist via windows service
Query or enumerate registry value
Query service status
Set registry value

Disassembly:
push 0xffffffffffffffff
push 0x49224b
mov eax, dword fs:[0]
push eax
sub esp, 0x854
mov eax, dword [0x4aab30]
xor eax, esp
mov dword [esp + 0x850], eax
push ebx
push ebp
push esi
push edi
mov eax, dword [0x4aab30]
xor eax, esp
push eax
lea eax, [esp + 0x868]
mov dword fs:[0], eax
mov eax, dword [0x4af378]
mov edx, dword [0x4af340]
mov edi, dword [0x4af380]
xor ebp, ebp
mov esi, ecx
mov dword [esp + 0x24], eax
mov eax, dword [edx + 0xc]
mov ecx, 0x4af340
mov dword [esp + 0x30], edi
mov dword [esp + 0x14], ebp
mov dword [esp + 0x38], str.SAUAVSvc
mov dword [esp + 0x3c], 0x41a760
mov dword [esp + 0x40], ebp
mov dword [esp + 0x44], ebp
call eax
lea ebx, [eax + 0x10]
mov dword [esp + 0x34], ebx
push 0x400
lea ecx, [esp + 0x68]
push ecx
push esi
mov dword [esp + 0x87c], ebp
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
push 0x49c864
call fcn.00405e50
mov esi, 1
add esp, 4
cmp dword [esp + 0x24], esi
mov dword [esp + 0x18], esi
jle 0x40cd94
lea ecx, [ecx]
mov edx, dword [edi + esi*4]
push str._install
push edx
call fcn.0047ba00
add esp, 8
test eax, eax
je 0x40cb65
mov eax, dword [edi + esi*4]
push 0x49f2b0
push eax
call fcn.0047ba00
add esp, 8
test eax, eax
je 0x40cb65
mov ecx, dword [edi + esi*4]
push str._uninstall
push ecx
call fcn.0047ba00
add esp, 8
test eax, eax
je 0x40cb2c
mov edx, dword [edi + esi*4]
push 0x49f328
push edx
call fcn.0047ba00
add esp, 8
test eax, eax
je 0x40cb2c
mov eax, dword [edi + esi*4]
push str._start
push eax
call fcn.0047ba00
add esp, 8
test eax, eax
jne 0x40caf0
push str.SAUAVSvc
call fcn.0040c700
add esp, 4
test al, al
jne 0x40cd64
push str.SAUAVSvc
call fcn.0040c640
add esp, 4
mov dword [esp + 0x14], eax
jmp 0x40cd64
mov ecx, dword [edi + esi*4]
push str._stop
push ecx
call fcn.0047ba00
add esp, 8
test eax, eax
jne 0x40cd73
push str.SAUAVSvc
call fcn.0040c700
add esp, 4
cmp al, 1
jne 0x40cd64
call fcn.0040c6c0
mov dword [esp + 0x14], eax
jmp 0x40cd64
push 0xf003f
push ebp
push ebp
call dword [sym.imp.ADVAPI32.dll_OpenSCManagerW]
mov esi, eax
cmp esi, ebp
je 0x40cb46
call fcn.0040c4f0
jmp 0x40cb4c
call dword [sym.imp.KERNEL32.dll_GetLastError]
push esi
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
call fcn.0040c5d0
mov esi, dword [esp + 0x18]
mov dword [esp + 0x14], eax
jmp 0x40cd64
push 4
push ebp
push ebp
mov dword [esp + 0x28], ebp
mov dword [esp + 0x2c], ebp
xor bl, bl
call dword [sym.imp.ADVAPI32.dll_OpenSCManagerW]
mov edi, eax
cmp edi, ebp
je 0x40cbdb
push 4
push str.SAUAVSvc
push edi
call dword [sym.imp.ADVAPI32.dll_OpenServiceW]
mov esi, eax
test esi, esi
je 0x40cbcd
lea edx, [esp + 0x48]
push edx
push esi
call dword [sym.imp.ADVAPI32.dll_QueryServiceStatus]
test eax, eax
je 0x40cbb8
mov eax, dword [esp + 0x4c]
push esi
mov dword [esp + 0x24], eax
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
mov esi, dword [esp + 0x18]
jmp 0x40cbe3
call dword [sym.imp.KERNEL32.dll_GetLastError]
push esi
mov ebp, eax
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
mov esi, dword [esp + 0x18]
jmp 0x40cbe3
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, dword [esp + 0x18]
mov ebp, eax
jmp 0x40cbe3
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov ebp, eax
push edi
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
test ebp, ebp
jne 0x40cbf7
cmp dword [esp + 0x20], 4
jne 0x40cbf7
mov bl, 1
push ebp
mov ebp, dword [sym.imp.KERNEL32.dll_SetLastError]
call ebp
test bl, bl
jne 0x40cc3f
push 0xf003f
push 0
push 0
call dword [sym.imp.ADVAPI32.dll_OpenSCManagerW]
mov edi, eax
test edi, edi
je 0x40cc28
lea ecx, [esp + 0x64]
push ecx
call fcn.0040c480
add esp, 4
jmp 0x40cc2e
call dword [sym.imp.KERNEL32.dll_GetLastError]
push edi
mov esi, eax
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
mov dword [esp + 0x14], esi
mov esi, dword [esp + 0x18]
push str.SAUAVSvc
push str.SYSTEMCurrentControlSet_services_s
lea edi, [esp + 0x3c]
call fcn.0040ce40
mov ebx, dword [esp + 0x3c]
add esp, 8
lea edx, [esp + 0x28]
push edx
push 1
push 0
push ebx
push reloc.OLEAUT32.dll_SysReAllocString
mov dword [esp + 0x34], 4
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExW]
test eax, eax
jne 0x40cca7
mov edx, dword [esp + 0x28]
lea eax, [esp + 0x20]
push eax
lea ecx, [esp + 0x20]
push ecx
push 0
push 0
push str.Start
push edx
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExW]
test eax, eax
je 0x40cccb
mov eax, dword [esp + 0x28]
push eax
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
push 0xf003f
push 0
push 0
call dword [sym.imp.ADVAPI32.dll_OpenSCManagerW]
mov edi, eax
test edi, edi
je 0x40cce3
lea edx, [esp + 0x64]
push edx
call fcn.0040c480
add esp, 4
jmp 0x40cce9
mov ecx, dword [esp + 0x28]
push ecx
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
cmp dword [esp + 0x1c], 2
je 0x40cd5e
jmp 0x40ccf6
call dword [sym.imp.KERNEL32.dll_GetLastError]
push edi
mov esi, eax
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
mov dword [esp + 0x14], esi
push 0
lea eax, [esp + 0x30]
push eax
push 0
push 0xf003f
push 0
push 0
push 0
push ebx
push reloc.OLEAUT32.dll_SysReAllocString
mov dword [esp + 0x40], 2
mov dword [esp + 0x50], 0
call dword [sym.imp.ADVAPI32.dll_RegCreateKeyExW]
mov esi, eax
test esi, esi
jne 0x40cd48
mov edx, dword [esp + 0x2c]
push 4
lea ecx, [esp + 0x20]
push ecx
push 4
push eax
push str.Start
push edx
call dword [sym.imp.ADVAPI32.dll_RegSetValueExW]
mov esi, eax
mov eax, dword [esp + 0x2c]
test eax, eax
je 0x40cd57
push eax
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
push esi
call ebp
mov esi, dword [esp + 0x18]
mov edi, dword [esp + 0x30]
xor ebp, ebp
inc esi
cmp esi, dword [esp + 0x24]
mov dword [esp + 0x18], esi
jl 0x40ca50
mov esi, dword [esp + 0x14]
cmp esi, ebp
je 0x40cd8b
push esi
push str.Error_code:__lu.
mov ecx, esi
call fcn.00405e70
add esp, 8
cmp dword [esp + 0x24], 1
jg 0x40cdc5
jmp 0x40cd98
mov esi, dword [esp + 0x14]
lea eax, [esp + 0x38]
push eax
call dword [sym.imp.ADVAPI32.dll_StartServiceCtrlDispatcherW]
test eax, eax
jne 0x40cdc5
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.StartServiceCtrlDispatcher_failed._Error_code:__lu.
mov ecx, eax
mov dword [esp + 0x1c], eax
call fcn.00405e70
mov esi, dword [esp + 0x1c]
add esp, 8
lea eax, [ebx - 0x10]
mov dword [esp + 0x870], 0xffffffff
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40cdec
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov eax, esi
mov ecx, dword [esp + 0x868]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebp
pop ebx
mov ecx, dword [esp + 0x850]
xor ecx, esp
call fcn.0047a722
add esp, 0x860
ret