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
mov eax, dword [0x4067ac]
mov byte [eax], 1
mov eax, 0x4048e8
call fcn.00403e5c
mov esi, 0x4098ac
xor eax, eax
push ebp
push 0x40545a
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.004041c8
mov edx, dword [ebp - 0x14]
mov eax, 0x4098d0
call fcn.00403890
lea edx, [ebp - 0x18]
mov eax, dword [0x4098d0]
call fcn.004040dc
mov edx, dword [ebp - 0x18]
mov eax, 0x4098d0
call fcn.00403890
mov byte [0x4098cc], 1
push 0xa
push 0x405468
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 0x405196
call fcn.0040475c
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.004046c8
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 0x4051d8
sub eax, 4
mov eax, dword [eax]
cmp eax, 8
jne 0x4051f6
lea eax, [ebp - 0x24]
mov edx, esi
call fcn.0040399c
mov edx, dword [ebp - 0x24]
mov eax, 0x40991c
call fcn.004039cc
jmp 0x40521b
mov eax, ebx
add al, 0xd0
sub al, 0xa
jb 0x405204
add al, 0xf9
sub al, 0x1a
jae 0x40521b
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 0x4051b5
lea eax, [ebp - 0x2c]
mov ecx, dword [0x40991c]
mov edx, dword [0x4098d0]
call fcn.00403a18
mov eax, dword [ebp - 0x2c]
call fcn.00403f94
test al, al
jne 0x405196
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 0x405470
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 0x405329
call fcn.0040475c
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 esi, ebx
push esi
call sub.kernel32.dll_WriteFile_1
push esi
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 0x405432
lea eax, [ebp - 0x30]
call fcn.004042d8
mov eax, dword [ebp - 0x30]
call fcn.00403b38
push eax
push 0x405478
call sub.kernel32.dll_SetEnvironmentVariableA
push 0x405488
push dword [0x4098d4]
push 0x4054a0
lea eax, [ebp - 0x34]
mov edx, dword [0x4067a8]
mov edx, dword [edx]
call fcn.0040396c
push dword [ebp - 0x34]
push 0x4054ac
mov eax, 0x4098d8
mov edx, 5
call fcn.00403a94
mov eax, 0x409924
xor ecx, ecx
mov edx, 0x44
call fcn.00402e48
mov dword [0x409924], 0x44
mov dword [0x409950], 1
mov word [0x409954], 0
push 0x409968
push 0x409924
push 0
push 0
push 0x20
push 0
push 0
push 0
mov eax, dword [0x4098d8]
call fcn.00403b38
push eax
push 0
call sub.kernel32.dll_CreateProcessA
test eax, eax
je 0x405415
push 0xffffffffffffffff
mov eax, dword [0x409968]
push eax
call sub.kernel32.dll_WaitForSingleObject
push 0x409920
mov eax, dword [0x409968]
push eax
call sub.kernel32.dll_GetExitCodeProcess
mov eax, dword [0x409968]
push eax
call sub.kernel32.dll_CloseHandle
mov eax, dword [0x40996c]
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 0x405461
lea eax, [ebp - 0x34]
mov edx, 5
call fcn.00403860
lea eax, [ebp - 0x1c]
mov edx, 3
call fcn.00403860
ret