Function at 0x405690
Capabilities:
Check if file exists
Create directory
Extract resource via kernel32 functions
Get file attributes
Write file on windows

Disassembly:
sub esp, 0x354
mov eax, dword [0x41c060]
xor eax, esp
mov dword [esp + 0x350], eax
xor eax, eax
push esi
push 0x103
push eax
mov dword [esp + 0x31], eax
mov dword [esp + 0x35], eax
mov dword [esp + 0x39], eax
mov dword [esp + 0x3d], eax
mov dword [esp + 0x41], eax
mov dword [esp + 0x45], eax
mov dword [esp + 0x49], eax
mov word [esp + 0x4d], ax
mov byte [esp + 0x4f], al
mov byte [esp + 0x154], al
lea eax, [esp + 0x155]
push eax
mov esi, 0x80004005
mov byte [esp + 0x34], 0
call fcn.004075f0
push 0x103
lea ecx, [esp + 0x59]
push 0
push ecx
mov byte [esp + 0x60], 0
call fcn.004075f0
xor eax, eax
add esp, 0x18
cmp dword [esp + 0x35c], eax
mov dword [esp + 0x10], 0
mov byte [esp + 0x1c], 0
mov dword [esp + 0x1d], eax
mov dword [esp + 0x21], eax
mov byte [esp + 0x25], al
je 0x405aa6
push ebx
push ebp
mov ebp, dword [esp + 0x368]
push edi
mov dword [esp + 0x10], ebp
jmp 0x405745
mov ebp, dword [esp + 0x10]
push ebp
lea edx, [esp + 0x2c]
push 0x417688
push edx
call fcn.00409727
mov ebx, dword [sym.imp.KERNEL32.dll_FindResourceA]
add esp, 0xc
push 0xa
lea eax, [esp + 0x2c]
push eax
push 0
call ebx
add ebp, 2
lea ecx, [ebp - 1]
push ecx
lea edx, [esp + 0x2c]
push 0x417688
push edx
mov esi, eax
call fcn.00409727
add esp, 0xc
push 0xa
lea eax, [esp + 0x2c]
push eax
push 0
call ebx
push ebp
lea ecx, [esp + 0x2c]
push 0x417688
push ecx
mov edi, eax
call fcn.00409727
add esp, 0xc
push 0xa
lea edx, [esp + 0x2c]
push edx
push 0
call ebx
test esi, esi
mov ebp, eax
je 0x405a2f
test edi, edi
je 0x405a2f
test ebp, ebp
je 0x405a2f
mov ebx, dword [sym.imp.KERNEL32.dll_SizeofResource]
push esi
push 0
call ebx
push edi
push 0
mov dword [esp + 0x1c], eax
call ebx
push ebp
push 0
mov dword [esp + 0x20], eax
call ebx
push esi
push 0
mov ebx, eax
call dword [sym.imp.KERNEL32.dll_LoadResource]
push edi
push 0
mov esi, eax
call dword [sym.imp.KERNEL32.dll_LoadResource]
push ebp
push 0
mov edi, eax
call dword [sym.imp.KERNEL32.dll_LoadResource]
push esi
mov esi, dword [sym.imp.KERNEL32.dll_LockResource]
mov ebp, eax
call esi
push edi
mov dword [esp + 0x28], eax
call esi
mov edi, eax
push ebp
mov dword [esp + 0x24], edi
call esi
mov ebp, dword [esp + 0x24]
test ebp, ebp
mov esi, eax
je 0x405a83
cmp dword [esp + 0x14], 0
jbe 0x405a83
test edi, edi
je 0x405a83
mov eax, dword [esp + 0x18]
test eax, eax
jbe 0x405a83
test esi, esi
je 0x405a83
test ebx, ebx
jbe 0x405a83
push eax
push edi
push 0
call fcn.00405550
push eax
lea eax, [esp + 0x44]
push 0x417e7c
push eax
call fcn.00409727
push ebx
lea ecx, [esp + 0x50]
push ecx
push esi
call fcn.00409710
add esp, 0x24
test eax, eax
jne 0x405a33
mov eax, dword [esp + 0x368]
lea edx, [esp + 0x158]
sub edx, eax
nop
mov cl, byte [eax]
mov byte [edx + eax], cl
add eax, 1
test cl, cl
jne 0x4058a0
lea edi, [esp + 0x158]
add edi, 0xffffffff
mov al, byte [edi + 1]
add edi, 1
test al, al
jne 0x4058b6
mov eax, dword [esp + 0x14]
mov dx, word [0x417710]
push eax
lea ecx, [esp + 0x15c]
push ebp
push ecx
mov word [edi], dx
call fcn.00409590
add esp, 0xc
xor eax, eax
mov cl, byte [esp + eax + 0x158]
mov byte [esp + eax + 0x54], cl
add eax, 1
test cl, cl
jne 0x4058e2
lea edx, [esp + 0x54]
push 0x5c
push edx
call fcn.00407bb8
add esp, 8
test eax, eax
je 0x40590a
mov byte [eax], 0
mov edi, dword [sym.imp.KERNEL32.dll_GetFileAttributesA]
lea eax, [esp + 0x54]
push eax
call edi
cmp eax, 0xffffffff
jne 0x4059b3
push 0x103
lea ecx, [esp + 0x261]
push 0
push ecx
mov byte [esp + 0x268], 0
call fcn.004075f0
add esp, 0xc
mov esi, 3
lea edx, [esp + esi + 0x54]
push 0x417710
push edx
call fcn.00408057
add esp, 8
test eax, eax
je 0x40599a
lea ecx, [esp + 0x54]
sub eax, ecx
mov esi, eax
push esi
mov edx, ecx
push edx
lea eax, [esp + 0x264]
push eax
call fcn.00407ae1
add esp, 0xc
lea ecx, [esp + 0x25c]
push ecx
add esi, 1
call edi
cmp eax, 0xffffffff
jne 0x405944
push 0
lea edx, [esp + 0x260]
push edx
call dword [sym.imp.KERNEL32.dll_CreateDirectoryA]
jmp 0x405944
lea eax, [esp + 0x54]
push eax
call edi
cmp eax, 0xffffffff
jne 0x4059b3
push 0
lea ecx, [esp + 0x58]
push ecx
call dword [sym.imp.KERNEL32.dll_CreateDirectoryA]
push 0
push 0xa0
push 2
push 0
push 1
push 0x40000000
lea edx, [esp + 0x170]
push edx
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov esi, eax
test esi, esi
je 0x405a65
cmp esi, 0xffffffff
je 0x405a9d
mov edi, dword [esp + 0x18]
mov ecx, dword [esp + 0x20]
push 0
lea eax, [esp + 0x20]
push eax
push edi
push ecx
push esi
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x405a99
cmp dword [esp + 0x1c], edi
jne 0x405a99
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [esp + 0x10]
add eax, 3
cmp eax, dword [esp + 0x36c]
mov dword [esp + 0x10], eax
jge 0x405741
xor eax, eax
jmp 0x405a6a
push 0x30
push str.Error
push esi
mov esi, dword [sym.imp.USER32.dll_MessageBoxA]
push 0
call esi
push 0x30
push str.Error
lea edx, [esp + 0x3c]
push edx
push 0
call esi
push 0x30
push str.Error
push str.Check_sum_failed_
push 0
call esi
mov eax, 1
pop edi
pop ebp
pop ebx
pop esi
mov ecx, dword [esp + 0x350]
xor ecx, esp
call fcn.004075d4
add esp, 0x354
ret
push 0x30
push str.Error
push 0x417e50
push 0
call dword [sym.imp.USER32.dll_MessageBoxA]
jmp 0x405a65
test esi, esi
je 0x405a65
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x405a65
mov ecx, dword [esp + 0x354]
mov eax, esi
pop esi
xor ecx, esp
call fcn.004075d4
add esp, 0x354
ret