Function at 0x4050b4
Capabilities:
Create process on windows
Delete file
Extract resource via kernel32 functions
Set environment variable
Set file attributes
Write and execute a file
Write file on windows

Disassembly:
push ebp
mov ebp, esp
mov ecx, 6
push 0
push 0
dec ecx
jne 0x4050bc
push ecx
push ebx
push esi
push edi
mov eax, 0x4048f0
call fcn.00403e5c
mov esi, 0x4098ac
xor eax, eax
push ebp
push 0x4054a1
push dword fs:[eax]
mov dword fs:[eax], esp
mov eax, dword [0x4067a4]
xor edx, edx
mov dword [eax], edx
lea eax, [ebp - 0x14]
call fcn.004041d0
mov edx, dword [ebp - 0x14]
mov eax, 0x4098d0
call fcn.00403890
lea edx, [ebp - 0x18]
mov eax, dword [0x4098d0]
call fcn.004040e4
mov edx, dword [ebp - 0x18]
mov eax, 0x4098d0
call fcn.00403890
mov byte [0x4098cc], 1
push 0xa
push 0x4054b0
mov eax, dword [0x4097e0]
push eax
call sub.kernel32.dll_FindResourceA
mov dword [0x4098dc], eax
mov eax, dword [0x4098dc]
push eax
mov eax, dword [0x4097e0]
push eax
call sub.kernel32.dll_LoadResource
mov dword [0x4098e0], eax
cmp dword [0x4098e0], 0
je 0x40518f
call fcn.00404764
movzx eax, byte [0x409914]
mov ecx, dword [0x40990c]
sub ecx, eax
dec ecx
mov edx, esi
mov eax, dword [0x4098e8]
call fcn.00402cac
mov eax, dword [0x4098e8]
call fcn.00402bd0
mov eax, dword [0x4098e0]
push eax
call sub.kernel32.dll_FreeResource
call sub.kernel32.dll_GetCurrentProcessId
lea edx, [ebp - 0x1c]
call fcn.004046d0
mov edx, dword [ebp - 0x1c]
mov eax, 0x40991c
call fcn.00403890
call fcn.00402dac
mov eax, 0x2b
call fcn.00402dd4
mov ebx, eax
add ebx, 0x2f
mov eax, dword [0x40991c]
mov dword [ebp - 0x20], eax
mov eax, dword [ebp - 0x20]
test eax, eax
je 0x4051d1
sub eax, 4
mov eax, dword [eax]
cmp eax, 8
jne 0x4051ef
lea eax, [ebp - 0x24]
mov edx, esi
call fcn.0040399c
mov edx, dword [ebp - 0x24]
mov eax, 0x40991c
call fcn.004039cc
jmp 0x405214
mov eax, ebx
add al, 0xd0
sub al, 0xa
jb 0x4051fd
add al, 0xf9
sub al, 0x1a
jae 0x405214
lea eax, [ebp - 0x28]
mov edx, ebx
call fcn.0040395c
mov edx, dword [ebp - 0x28]
mov eax, 0x40991c
call fcn.004039cc
mov eax, dword [0x40991c]
call fcn.004039c0
cmp eax, 0xc
jne 0x4051ae
lea eax, [ebp - 0x2c]
mov ecx, dword [0x40991c]
mov edx, dword [0x4098d0]
call fcn.00403a18
mov eax, dword [ebp - 0x2c]
call fcn.00403f9c
test al, al
jne 0x40518f
mov eax, 0x40991c
mov ecx, dword [0x40991c]
mov edx, dword [0x4098d0]
call fcn.00403a18
mov eax, 0x4098d4
mov edx, dword [0x40991c]
call fcn.00403890
push 0xa
push 0x4054b8
mov eax, dword [0x4097e0]
push eax
call sub.kernel32.dll_FindResourceA
mov dword [0x4098dc], eax
mov eax, dword [0x4098dc]
push eax
mov eax, dword [0x4097e0]
push eax
call sub.kernel32.dll_LoadResource
mov dword [0x4098e0], eax
cmp dword [0x4098e0], 0
je 0x405322
call fcn.00404764
push 0
push 0x80
push 2
push 0
push 0
push 0xc0000000
mov eax, dword [0x4098d4]
call fcn.00403b38
push eax
call sub.kernel32.dll_CreateFileA
mov ebx, eax
push 0
push 0x409918
movzx eax, byte [0x409914]
mov edx, dword [0x40990c]
sub edx, eax
dec edx
push edx
mov eax, dword [0x4098e8]
push eax
mov edi, ebx
push edi
call sub.kernel32.dll_WriteFile_1
push edi
call sub.kernel32.dll_CloseHandle
mov eax, dword [0x4098e8]
call fcn.00402bd0
mov eax, dword [0x4098e0]
push eax
call sub.kernel32.dll_FreeResource
push 0x102
mov eax, dword [0x4098d4]
call fcn.00403b38
push eax
call sub.kernel32.dll_SetFileAttributesA
cmp byte [0x4098cc], 0
je 0x405479
lea eax, [ebp - 0x30]
call fcn.004042e0
mov eax, dword [ebp - 0x30]
call fcn.00403b38
push eax
push 0x4054c0
call sub.kernel32.dll_SetEnvironmentVariableA
push 0x4054d0
push dword [0x4098d4]
push 0x4054e8
lea eax, [ebp - 0x34]
mov edx, dword [0x4067a8]
mov edx, dword [edx]
call fcn.0040396c
push dword [ebp - 0x34]
push 0x4054f4
mov eax, 0x4098d8
mov edx, 5
call fcn.00403a94
cmp dword [esi + 8], 0x8000
jne 0x40539d
push 0x30
push 0x4054f8
push 0x405510
push 0
call sub.user32.dll_MessageBoxA_1
mov eax, 0x409930
xor ecx, ecx
mov edx, 0x44
call fcn.00402e48
mov dword [0x409930], 0x44
mov dword [0x40995c], 1
mov word [0x409960], 0
mov eax, 0x409924
xor ecx, ecx
mov edx, 0xc
call fcn.00402e48
mov dword [0x409924], 0xc
mov dword [0x40992c], 0xffffffff
xor eax, eax
mov dword [0x409928], eax
push 0x409974
push 0x409930
push 0
push 0
push 0x20
push 0xffffffffffffffff
push 0x409924
push 0x409924
mov eax, dword [0x4098d8]
call fcn.00403b38
push eax
push 0
call sub.kernel32.dll_CreateProcessA
test eax, eax
je 0x40545c
push 0xffffffffffffffff
mov eax, dword [0x409974]
push eax
call sub.kernel32.dll_WaitForSingleObject
push 0x409920
mov eax, dword [0x409974]
push eax
call sub.kernel32.dll_GetExitCodeProcess
mov eax, dword [0x409974]
push eax
call sub.kernel32.dll_CloseHandle
mov eax, dword [0x409978]
push eax
call sub.kernel32.dll_CloseHandle
mov ebx, dword [0x409920]
mov eax, dword [0x4098d4]
call fcn.00403b38
push eax
call sub.kernel32.dll_DeleteFileA
mov eax, dword [0x4067a4]
mov dword [eax], ebx
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
push 0x4054a8
lea eax, [ebp - 0x34]
mov edx, 5
call fcn.00403860
lea eax, [ebp - 0x1c]
mov edx, 3
call fcn.00403860
ret