Function at 0x409d51
Capabilities:
Create process on windows
Get common file path
Write and execute a file
Write file on windows

Disassembly:
sub esp, 0x3a8
mov eax, dword [0x518450]
xor eax, esp
mov dword [esp + 0x3a4], eax
push ebx
push ebp
push esi
push edi
lea eax, [esp + 0x1ac]
mov ebp, 0x104
push eax
push ebp
call dword [sym.imp.KERNEL32.dll_GetTempPathA]
push 0x5f52208
mov edx, 0x744d3314
mov ecx, 0x25090553
call fcn.0040145b
mov edx, eax
pop ecx
mov esi, edx
mov al, byte [edx]
inc edx
test al, al
jne 0x409d96
lea edi, [esp + 0x1ac]
sub edx, esi
dec edi
mov al, byte [edi + 1]
inc edi
test al, al
jne 0x409da7
mov ecx, edx
lea eax, [esp + 0x1ac]
shr ecx, 2
xor ebx, ebx
rep movsd dword es:[edi], dword [esi]
push ebx
push 0x80000080
push 2
push ebx
push ebx
mov ecx, edx
and ecx, 3
push 0x40000000
rep movsb byte es:[edi], byte [esi]
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov esi, dword [sym.imp.KERNEL32.dll_CloseHandle]
mov edi, eax
cmp edi, 0xffffffff
je 0x409f3d
push ebp
lea eax, [esp + 0x2b4]
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameA]
push 0x255f09ac
mov edx, 0x54e718b0
mov ecx, 0x5a32eeb
call fcn.0040145b
push eax
lea eax, [esp + 0x70]
push eax
call fcn.004bad3c
add esp, 0xc
lea ecx, [esp + 0x10]
push ebx
mov ebx, dword [sym.imp.KERNEL32.dll_WriteFile]
push ecx
push eax
lea eax, [esp + 0x74]
push eax
push edi
call ebx
lea eax, [esp + 0x2b0]
mov edx, 0x15307560
push eax
push 0x6488647d
mov ecx, 0x447443cf
call fcn.0040145b
pop ecx
push eax
lea eax, [esp + 0x70]
push eax
call fcn.004bad3c
add esp, 0xc
lea ecx, [esp + 0x10]
push 0
push ecx
push eax
lea eax, [esp + 0x74]
push eax
push edi
call ebx
lea eax, [esp + 0x2b0]
mov edx, 0x9adb96bb
push eax
push 0xeb6387b1
mov ecx, 0xcb9fa01a
call fcn.0040145b
pop ecx
push eax
lea eax, [esp + 0x70]
push eax
call fcn.004bad3c
add esp, 0xc
lea ecx, [esp + 0x10]
push 0
push ecx
push eax
lea eax, [esp + 0x74]
push eax
push edi
call ebx
lea eax, [esp + 0x2b0]
push 0x5c
push eax
call fcn.004bade0
pop ecx
pop ecx
test eax, eax
je 0x409ec2
mov byte [eax], 0
lea eax, [esp + 0x2b0]
mov edx, 0xe7a44985
push eax
push 0x961c589e
mov ecx, 0xb6e07f06
call fcn.0040145b
pop ecx
push eax
lea eax, [esp + 0x70]
push eax
call fcn.004bad3c
add esp, 0xc
lea ecx, [esp + 0x10]
push 0
push ecx
push eax
lea eax, [esp + 0x74]
push eax
push edi
call ebx
lea eax, [esp + 0x1ac]
mov edx, 0x138e770f
push eax
push 0x62366612
mov ecx, 0x42ca419c
call fcn.0040145b
pop ecx
push eax
lea eax, [esp + 0x70]
push eax
call fcn.004bad3c
add esp, 0xc
lea ecx, [esp + 0x10]
push 0
push ecx
push eax
lea eax, [esp + 0x74]
push eax
push edi
call ebx
push edi
call esi
xor ebx, ebx
push 0x40
lea eax, [esp + 0x2c]
push ebx
push eax
call fcn.004bf040
add esp, 0xc
mov dword [esp + 0x24], 0x44
xor eax, eax
mov dword [esp + 0x50], 1
mov word [esp + 0x54], ax
lea eax, [esp + 0x14]
push eax
lea eax, [esp + 0x28]
push eax
push ebx
push ebx
push 0x8000040
push ebx
push ebx
push ebx
lea eax, [esp + 0x1cc]
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_CreateProcessA]
test eax, eax
je 0x409f97
push dword [esp + 0x14]
call esi
push dword [esp + 0x18]
call esi
mov ecx, dword [esp + 0x3b4]
pop edi
pop esi
pop ebp
pop ebx
xor ecx, esp
call fcn.004b9a6c
add esp, 0x3a8
ret