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

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
sub esp, 0x548
mov eax, dword [0x1004018]
push ebx
push esi
push edi
mov dword [ebp - 4], eax
xor ebx, ebx
xor eax, eax
mov word [ebp - 0x300], bx
mov ecx, 0x82
lea edi, [ebp - 0x2fe]
push 0x8001
rep stosd dword es:[edi], eax
call dword [sym.imp.KERNEL32.dll_SetErrorMode]
push ebx
call dword [sym.imp.KERNEL32.dll_GetModuleHandleW]
push 0x32
lea ecx, [ebp - 0x68]
push ecx
push 9
push eax
mov dword [0x1004020], eax
call dword [sym.imp.USER32.dll_LoadStringW]
cmp eax, ebx
jle 0x10024c3
cmp eax, 0x31
jae 0x10024c3
lea eax, [ebp - 0x514]
push eax
lea eax, [ebp - 0x510]
push eax
push ebx
push 0xf003f
push ebx
push ebx
push ebx
push 0x10015f0
push 0x80000002
call dword [sym.imp.ADVAPI32.dll_RegCreateKeyExW]
cmp eax, ebx
je 0x1002172
push eax
push 0x10015cc
jmp 0x10024cf
push 0x23
pop ecx
push ebx
lea eax, [ebp - 0x51c]
push eax
push 1
lea eax, [ebp - 0xf4]
mov esi, 0x1001540
lea edi, [ebp - 0xf4]
push eax
rep movsd dword es:[edi], dword [esi]
mov dword [ebp - 0x51c], ebx
call dword [sym.imp.ADVAPI32.dll_ConvertStringSecurityDescriptorToSecurityDescriptorW]
test eax, eax
jne 0x10021b4
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push 0x10014d0
jmp 0x100223a
push dword [ebp - 0x51c]
push 4
pop edi
push edi
push dword [ebp - 0x510]
call dword [sym.imp.ADVAPI32.dll_RegSetKeySecurity]
push dword [ebp - 0x51c]
mov esi, eax
call dword [sym.imp.KERNEL32.dll_LocalFree]
cmp esi, ebx
je 0x10021e4
push esi
push 0x10014a8
jmp 0x100223a
mov esi, dword [sym.imp.ADVAPI32.dll_RegSetValueExW]
push edi
lea eax, [ebp - 0x514]
push eax
push edi
push ebx
push 0x1001484
push dword [ebp - 0x510]
mov dword [ebp - 0x514], 0xf
call esi
cmp eax, ebx
jne 0x1002234
push edi
lea eax, [ebp - 0x514]
push eax
push edi
push ebx
push 0x1001468
push dword [ebp - 0x510]
mov dword [ebp - 0x514], 0x20
call esi
cmp eax, ebx
je 0x1002251
push eax
push 0x100144c
push ebx
call fcn.01001b89
push dword [ebp - 0x510]
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
jmp 0x10024d5
lea eax, [ebp - 0x514]
push eax
lea eax, [ebp - 0x300]
push eax
push ebx
push ebx
push 0x1001434
push dword [ebp - 0x510]
mov dword [ebp - 0x514], 0x208
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExW]
test eax, eax
jne 0x1002289
cmp word [ebp - 0x300], bx
jne 0x100229f
push 0x100140c
push 0x105
lea eax, [ebp - 0x300]
push eax
call fcn.01001a03
push edi
lea eax, [ebp - 0x514]
push eax
push edi
push ebx
push 0x10013f8
push dword [ebp - 0x510]
mov dword [ebp - 0x514], 1
call esi
push dword [ebp - 0x510]
mov esi, eax
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
cmp esi, ebx
je 0x10022dd
push esi
push 0x100144c
jmp 0x10024cf
mov esi, 0x105
push esi
lea eax, [ebp - 0x50c]
push eax
lea eax, [ebp - 0x300]
push eax
call dword [sym.imp.KERNEL32.dll_ExpandEnvironmentStringsW]
cmp eax, ebx
je 0x10024b5
cmp eax, esi
ja 0x10024b0
lea eax, [ebp - 0x50c]
push eax
call fcn.01001c52
cmp eax, ebx
je 0x1002322
push eax
push 0x10013cc
jmp 0x10024cf
mov esi, 0x10013b4
push esi
call dword [sym.imp.KERNEL32.dll_LoadLibraryW]
cmp eax, ebx
jne 0x100233f
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push esi
jmp 0x10024cf
push 0x100139c
push eax
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
cmp eax, ebx
jne 0x1002360
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push 0x100137c
jmp 0x10024cf
call eax
push 2
push ebx
push ebx
call dword [sym.imp.ADVAPI32.dll_OpenSCManagerW]
cmp eax, ebx
mov dword [ebp - 0x518], eax
jne 0x1002387
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push 0x1001360
jmp 0x10024cf
push 0x12
mov esi, 0x100134c
push esi
push eax
call dword [sym.imp.ADVAPI32.dll_OpenServiceW]
mov edi, eax
cmp edi, ebx
lea eax, [ebp - 0x68]
jne 0x10023f0
push ebx
push ebx
push 0x100133c
push ebx
push 0x100131c
push 0x10012c0
push 1
push 2
push 0x20
push 0x12
push eax
push esi
push dword [ebp - 0x518]
call dword [sym.imp.ADVAPI32.dll_CreateServiceW]
mov edi, eax
cmp edi, ebx
jne 0x1002432
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push 0x10012a0
push ebx
call fcn.01001b89
push dword [ebp - 0x518]
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
jmp 0x10024d5
push eax
push 0x100129c
push 0x1001280
push 0x100133c
push ebx
push 0x100131c
push 0x10012c0
xor esi, esi
inc esi
push esi
push 2
push 0x20
push edi
call dword [sym.imp.ADVAPI32.dll_ChangeServiceConfigW]
test eax, eax
jne 0x1002435
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push 0x1001258
push ebx
call fcn.01001b89
jmp 0x100249d
xor esi, esi
inc esi
lea eax, [ebp - 0x548]
mov dword [ebp - 0x520], eax
lea eax, [ebp - 0x530]
push eax
push 2
push edi
mov dword [ebp - 0x548], esi
mov dword [ebp - 0x544], 0x1770
mov dword [ebp - 0x540], esi
mov dword [ebp - 0x53c], 0xea60
mov dword [ebp - 0x538], ebx
mov dword [ebp - 0x534], ebx
mov dword [ebp - 0x530], 0x15180
mov dword [ebp - 0x52c], ebx
mov dword [ebp - 0x528], ebx
mov dword [ebp - 0x524], 3
call dword [sym.imp.ADVAPI32.dll_ChangeServiceConfig2W]
mov esi, dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
push edi
call esi
push dword [ebp - 0x518]
call esi
jmp 0x10024d5
push 0x6f
pop eax
jmp 0x10024bb
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push 0x1001224
jmp 0x10024cf
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push 0x100120c
push ebx
call fcn.01001b89
mov ecx, dword [ebp - 4]
pop edi
pop esi
pop ebx
call fcn.010025d9
leave
ret