Function at 0x401ae0
Capabilities:
Create service
Persist via windows service
Query environment variable
Query or enumerate registry value

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x4020a0
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0x534
push ebx
push esi
push edi
lea eax, [ebp - 0x140]
mov dword [ebp - 0x10], esp
push 0x104
push eax
push 0x4012b6
call dword [sym.imp.KERNEL32.DLL_ExpandEnvironmentStringsA]
lea ecx, [ebp - 0x14]
xor esi, esi
push ecx
mov dword [ebp - 0x14], 0x80000002
mov edx, dword [ebp - 0x14]
push 1
push esi
push 0x401464
push edx
mov dword [ebp - 0x1c], esi
mov dword [ebp - 0x18], esi
mov dword [ebp - 0x20], esi
mov dword [ebp - 4], esi
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExA]
cmp eax, esi
je 0x401b5f
lea eax, [ebp - 0x30]
push 0x402100
push eax
mov dword [ebp - 0x30], 0x402168
call sub.MSVCRT.dll__CxxThrowException
lea ecx, [ebp - 0x34]
lea edx, [ebp - 0x540]
push ecx
mov ecx, dword [ebp - 0x14]
lea eax, [ebp - 0x38]
push edx
push eax
push esi
push 0x40145c
push ecx
mov dword [ebp - 0x34], 0x400
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExA]
mov edx, dword [ebp - 0x14]
mov edi, eax
push edx
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
push edi
call dword [sym.imp.KERNEL32.DLL_SetLastError]
cmp edi, esi
je 0x401bb1
lea eax, [ebp - 0x24]
push 0x402100
push eax
mov dword [ebp - 0x24], 0x401570
call sub.MSVCRT.dll__CxxThrowException
push 0xf003f
push esi
push esi
call dword [sym.imp.ADVAPI32.dll_OpenSCManagerA]
mov ebx, eax
cmp ebx, esi
mov dword [ebp - 0x18], ebx
jne 0x401bdc
lea ecx, [ebp - 0x2c]
push 0x402100
push ecx
mov dword [ebp - 0x2c], 0x401560
call sub.MSVCRT.dll__CxxThrowException
call fcn.004018a0
push esi
mov edx, dword [ebp + 8]
push esi
push esi
push esi
push esi
push 0x401530
push 1
push 2
push 0x10
mov edi, eax
push 0xf01ff
push edx
push edi
push ebx
mov dword [ebp - 0x1c], edi
call dword [sym.imp.ADVAPI32.dll_CreateServiceA]
mov ebx, eax
cmp ebx, esi
mov dword [ebp - 0x20], ebx
jne 0x401c25
lea eax, [ebp - 0x28]
push 0x402100
push eax
mov dword [ebp - 0x28], 0x401514
call sub.MSVCRT.dll__CxxThrowException
mov esi, dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
push ebx
call esi
mov ecx, dword [ebp - 0x18]
push ecx
call esi
push edi
lea edx, [ebp - 0x540]
push 0x4014ec
push edx
mov dword [ebp - 0x14], 0x80000002
call dword [sym.imp.USER32.dll_wsprintfA]
mov eax, dword [ebp + 0xc]
add esp, 0xc
push 0
push eax
call dword [sym.imp.KERNEL32.DLL_lstrlenA]
mov ecx, dword [ebp + 0xc]
push eax
push ecx
push 1
lea edx, [ebp - 0x540]
push 0x4014e0
push edx
push 0x80000002
call fcn.00401660
add esp, 0x1c
lea eax, [ebp - 0x540]
push 0x4014d4
push eax
call dword [sym.imp.KERNEL32.DLL_lstrcatA]
lea ecx, [ebp - 0x140]
push 0
push ecx
call dword [sym.imp.KERNEL32.DLL_lstrlenA]
lea edx, [ebp - 0x140]
push eax
push edx
push 2
lea eax, [ebp - 0x540]
push 0x4014c8
push eax
push 0x80000002
call fcn.00401660
add esp, 0x1c
jmp 0x401ce7
mov ecx, dword [ebp - 0x14]
push ecx
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
push 0
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
push ebx
call esi
mov edx, dword [ebp - 0x18]
push edx
call esi
test edi, edi
je 0x401d1f
lea eax, [ebp - 0x140]
push eax
push 0x4014c4
push 0x4014c0
call fcn.00401820
add esp, 0xc
mov ecx, dword [ebp - 0xc]
mov eax, edi
pop edi
pop esi
mov dword fs:[0], ecx
pop ebx
mov esp, ebp
pop ebp
ret