Function at 0x40a13c
Capabilities:
Delete file
Extract resource via kernel32 functions
Set environment variable
Set file attributes
Write file on windows

Disassembly:
push ebp
mov ebp, esp
mov ecx, 5
push 0
push 0
dec ecx
jne 0x40a144
push ebx
push esi
push edi
mov eax, 0x409200
call fcn.00404f54
xor eax, eax
push ebp
push 0x40a57e
push dword fs:[eax]
mov dword fs:[eax], esp
mov eax, dword [0x40b98c]
xor edx, edx
mov dword [eax], edx
lea eax, [ebp - 0x14]
call fcn.00405340
mov edx, dword [ebp - 0x14]
mov eax, 0x4109d4
call fcn.00404084
lea edx, [ebp - 0x18]
mov eax, dword [0x4109d4]
call fcn.00405254
mov edx, dword [ebp - 0x18]
mov eax, 0x4109d4
call fcn.00404084
mov byte [0x4109d0], 1
push 0xa
push 0x40a590
mov eax, dword [0x40e7f0]
push eax
call sub.kernel32.dll_FindResourceA
mov edi, eax
push edi
mov eax, dword [0x40e7f0]
push eax
call sub.kernel32.dll_LoadResource
mov dword [0x4109e0], eax
cmp dword [0x4109e0], 0
je 0x40a2f5
mov byte [0x4109d0], 1
mov eax, dword [0x4109e0]
push eax
call sub.kernel32.dll_LockResource
mov ebx, eax
push edi
mov eax, dword [0x40e7f0]
push eax
call sub.kernel32.dll_SizeofResource
call fcn.00402c84
mov dword [0x4109e4], eax
mov esi, dword [0x4109e4]
mov eax, 0x40a5a0
call fcn.00408da0
call fcn.00408ccc
mov dword [0x4109f8], 0
mov dword [0x4109fc], 0
push edi
mov eax, dword [0x40e7f0]
push eax
call sub.kernel32.dll_SizeofResource
xor edx, edx
mov dword [0x410a00], eax
mov dword [0x410a04], edx
jmp 0x40a286
mov edx, 0x4109e8
mov eax, ebx
mov ecx, 0x10
call fcn.00402dfc
mov eax, 0x4109e8
call fcn.00408e1c
mov edx, esi
mov eax, 0x4109e8
mov ecx, 0x10
call fcn.00402dfc
add dword [0x4109f8], 0x10
adc dword [0x4109fc], 0
add ebx, 0x10
add esi, 0x10
mov eax, dword [0x410a00]
mov edx, dword [0x410a04]
sub eax, dword [0x4109f8]
sbb edx, dword [0x4109fc]
cmp edx, 0
jne 0x40a2aa
cmp eax, 0x10
jae 0x40a246
jmp 0x40a2ac
jge 0x40a246
call fcn.00408e10
mov eax, dword [0x4109e4]
xor edx, edx
add eax, dword [0x410a00]
adc edx, dword [0x410a04]
sub eax, 1
sbb edx, 0
mov ebx, eax
movzx ebx, byte [ebx]
movzx eax, bl
mov ecx, dword [0x410a00]
sub ecx, eax
dec ecx
mov edx, 0x4109c4
mov eax, dword [0x4109e4]
call fcn.00402dfc
mov eax, dword [0x4109e0]
push eax
call sub.kernel32.dll_FreeResource
lea eax, [ebp - 0x20]
mov edx, 0x4109c4
call fcn.00404278
mov edx, dword [ebp - 0x20]
lea ecx, [ebp - 0x1c]
mov eax, dword [0x4109d4]
call fcn.00408f58
mov edx, dword [ebp - 0x1c]
mov eax, 0x4109d8
call fcn.00404084
push 0xa
push 0x40a5bc
mov eax, dword [0x40e7f0]
push eax
call sub.kernel32.dll_FindResourceA
mov edi, eax
push edi
mov eax, dword [0x40e7f0]
push eax
call sub.kernel32.dll_LoadResource
mov dword [0x4109e0], eax
cmp dword [0x4109e0], 0
je 0x40a4c2
cmp byte [0x4109d0], 0
jne 0x40a35e
xor eax, eax
jmp 0x40a360
mov al, 1
mov byte [0x4109d0], al
mov eax, dword [0x4109e0]
push eax
call sub.kernel32.dll_LockResource
mov ebx, eax
push edi
mov eax, dword [0x40e7f0]
push eax
call sub.kernel32.dll_SizeofResource
call fcn.00402c84
mov dword [0x4109e4], eax
mov esi, dword [0x4109e4]
mov eax, 0x40a5a0
call fcn.00408da0
call fcn.00408ccc
mov dword [0x4109f8], 0
mov dword [0x4109fc], 0
push edi
mov eax, dword [0x40e7f0]
push eax
call sub.kernel32.dll_SizeofResource
xor edx, edx
mov dword [0x410a00], eax
mov dword [0x410a04], edx
jmp 0x40a40d
mov edx, 0x4109e8
mov eax, ebx
mov ecx, 0x10
call fcn.00402dfc
mov eax, 0x4109e8
call fcn.00408e1c
mov edx, esi
mov eax, 0x4109e8
mov ecx, 0x10
call fcn.00402dfc
add dword [0x4109f8], 0x10
adc dword [0x4109fc], 0
add ebx, 0x10
add esi, 0x10
mov eax, dword [0x410a00]
mov edx, dword [0x410a04]
sub eax, dword [0x4109f8]
sbb edx, dword [0x4109fc]
cmp edx, 0
jne 0x40a431
cmp eax, 0x10
jae 0x40a3cd
jmp 0x40a433
jge 0x40a3cd
call fcn.00408e10
mov eax, dword [0x4109e4]
xor edx, edx
add eax, dword [0x410a00]
adc edx, dword [0x410a04]
sub eax, 1
sbb edx, 0
mov ebx, eax
movzx ebx, byte [ebx]
push 0
push 0x80
push 2
push 0
push 0
push 0xc0000000
mov eax, dword [0x4109d8]
call fcn.00404428
push eax
call sub.kernel32.dll_CreateFileA
mov esi, eax
push 0
push 0x410a08
movzx eax, bl
mov edx, dword [0x410a00]
sub edx, eax
dec edx
push edx
mov eax, dword [0x4109e4]
push eax
mov edi, esi
push edi
call sub.kernel32.dll_WriteFile_1
push edi
call sub.kernel32.dll_CloseHandle
mov eax, dword [0x4109e0]
push eax
call sub.kernel32.dll_FreeResource
push 0x102
mov eax, dword [0x4109d8]
call fcn.00404428
push eax
call sub.kernel32.dll_SetFileAttributesA
cmp byte [0x4109d0], 0
je 0x40a563
lea eax, [ebp - 0x24]
call fcn.00405450
mov eax, dword [ebp - 0x24]
call fcn.00404428
push eax
push 0x40a5c4
call sub.kernel32.dll_SetEnvironmentVariableA
push 0x40a5d4
push dword [0x4109d8]
push 0x40a5ec
lea eax, [ebp - 0x28]
mov edx, dword [0x40ba70]
mov edx, dword [edx]
call fcn.0040420c
push dword [ebp - 0x28]
push 0x40a5f8
mov eax, 0x4109dc
mov edx, 5
call fcn.00404384
cmp dword [0x4109cc], 0x8000
jne 0x40a540
push 0x30
push 0x40a5fc
push 0x40a614
push 0
call sub.user32.dll_MessageBoxA_1
mov eax, dword [0x4109dc]
call fcn.004090d8
mov ebx, eax
mov eax, dword [0x4109d8]
call fcn.00404428
push eax
call sub.kernel32.dll_DeleteFileA
mov eax, dword [0x40b98c]
mov dword [eax], ebx
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
push 0x40a585
lea eax, [ebp - 0x28]
mov edx, 6
call fcn.00404054
ret