Function at 0x4050ac
Capabilities:
Delete file
Extract resource via kernel32 functions
Write file on windows

Disassembly:
push ebp
mov ebp, esp
mov ecx, 6
push 0
push 0
dec ecx
jne 0x4050b4
push ebx
push esi
push edi
mov eax, 0x4047f8
call fcn.004042b0
xor eax, eax
push ebp
push 0x405386
push dword fs:[eax]
mov dword fs:[eax], esp
mov byte [0x409974], 0
mov eax, dword [0x406790]
xor edx, edx
mov dword [eax], edx
mov edx, 0x409978
mov eax, 0x4046fc
call fcn.0040412c
lea eax, [ebp - 0x14]
call fcn.00404584
mov edx, dword [ebp - 0x14]
mov eax, 0x409978
call fcn.0040389c
push 0xa
lea edx, [ebp - 0x18]
mov eax, 0x4046e4
call fcn.0040412c
mov eax, dword [ebp - 0x18]
call fcn.00403afc
push eax
mov eax, dword [0x4097e0]
push eax
call sub.kernel32.dll_FindResourceA
mov ebx, eax
push ebx
mov eax, dword [0x4097e0]
push eax
call sub.kernel32.dll_LoadResource
mov esi, eax
test esi, esi
je 0x405170
mov byte [0x409974], 1
push esi
call sub.kernel32.dll_LockResource
mov edi, eax
push ebx
mov eax, dword [0x4097e0]
push eax
call sub.kernel32.dll_SizeofResource
mov ecx, eax
mov edx, 0x4097f0
mov eax, edi
call fcn.00402cfc
push esi
call sub.kernel32.dll_FreeResource
lea eax, [ebp - 0x1c]
mov edx, 0x4097f0
call fcn.0040396c
mov ecx, dword [ebp - 0x1c]
mov eax, 0x40997c
mov edx, dword [0x409978]
call fcn.004039dc
push 0xa
lea edx, [ebp - 0x20]
mov eax, 0x4046dc
call fcn.0040412c
mov eax, dword [ebp - 0x20]
call fcn.00403afc
push eax
mov eax, dword [0x4097e0]
push eax
call sub.kernel32.dll_FindResourceA
mov ebx, eax
push ebx
mov eax, dword [0x4097e0]
push eax
call sub.kernel32.dll_LoadResource
mov esi, eax
test esi, esi
je 0x4052c1
cmp byte [0x409974], 0
jne 0x4051d8
xor eax, eax
jmp 0x4051da
mov al, 1
mov byte [0x409974], al
push esi
call sub.kernel32.dll_LockResource
mov edi, eax
push 0
push 0x80
push 2
push 0
push 0
push 0xc0000000
mov eax, dword [0x40997c]
call fcn.00403afc
push eax
call sub.kernel32.dll_CreateFileA
mov dword [0x409994], eax
mov dword [0x409984], 0
mov dword [0x409988], 0
push ebx
mov eax, dword [0x4097e0]
push eax
call sub.kernel32.dll_SizeofResource
xor edx, edx
mov dword [0x40998c], eax
mov dword [0x409990], edx
jmp 0x40526d
push 0
push 0x409998
push 0x4000
push edi
mov eax, dword [0x409994]
push eax
call sub.kernel32.dll_WriteFile_1
add dword [0x409984], 0x4000
adc dword [0x409988], 0
add edi, 0x4000
mov eax, dword [0x40998c]
mov edx, dword [0x409990]
sub eax, dword [0x409984]
sbb edx, dword [0x409988]
cmp edx, 0
jne 0x405293
cmp eax, 0x4000
jae 0x40523e
jmp 0x405295
jge 0x40523e
push 0
push 0x409998
mov eax, dword [0x40998c]
sub eax, dword [0x409984]
push eax
push edi
mov ebx, dword [0x409994]
push ebx
call sub.kernel32.dll_WriteFile_1
push ebx
call sub.kernel32.dll_CloseHandle
push esi
call sub.kernel32.dll_FreeResource
cmp byte [0x409974], 0
je 0x40536b
cmp dword [0x409970], 0x8000
jne 0x40530f
push 0x30
lea edx, [ebp - 0x24]
mov eax, 0x4046f4
call fcn.0040412c
mov eax, dword [ebp - 0x24]
call fcn.00403afc
push eax
lea edx, [ebp - 0x28]
mov eax, 0x4046ec
call fcn.0040412c
mov eax, dword [ebp - 0x28]
call fcn.00403afc
push eax
push 0
call sub.user32.dll_MessageBoxA_1
lea edx, [ebp - 0x2c]
mov eax, 0x4046d4
call fcn.0040412c
push dword [ebp - 0x2c]
lea eax, [ebp - 0x30]
call fcn.00404694
push dword [ebp - 0x30]
push 0x4053a0
push dword [0x40997c]
push 0x4053b0
mov eax, 0x409980
mov edx, 5
call fcn.00403a58
mov eax, dword [0x409980]
call fcn.00404704
mov edx, dword [0x406790]
mov dword [edx], eax
mov eax, dword [0x40997c]
call fcn.00403afc
push eax
call sub.kernel32.dll_DeleteFileA
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
push 0x40538d
lea eax, [ebp - 0x30]
mov edx, 8
call fcn.0040386c
ret