Function at 0x40a420
Capabilities:
Check if file exists
Extract resource via kernel32 functions
Write file on windows

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x508602
mov eax, dword fs:[0]
push eax
sub esp, 0x28c
mov eax, dword [0x5635bc]
xor eax, ebp
mov dword [ebp - 0x10], eax
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov dword [ebp - 0x298], ecx
mov ecx, dword [ebp - 0x298]
call fcn.00409af0
mov dword [ebp - 0x284], eax
lea eax, [ebp - 0x2c]
push eax
mov ecx, dword [ebp - 0x298]
call fcn.00409f40
mov dword [ebp - 4], 0
push 0x511e84
lea ecx, [ebp - 0x2c]
push ecx
lea edx, [ebp - 0x25c]
push edx
call fcn.004042c0
add esp, 0xc
mov byte [ebp - 4], 1
lea ecx, [ebp - 0x25c]
call fcn.00401cf0
push eax
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
jne 0x40a4be
lea ecx, [ebp - 0x25c]
call fcn.00401cf0
push eax
call fcn.004369c0
add esp, 4
push 0x511e90
lea ecx, [ebp - 0x25c]
call fcn.00403ab0
mov word [ebp - 0x23c], 0
push 0x206
push 0
lea eax, [ebp - 0x23a]
push eax
call fcn.00462710
add esp, 0xc
push 0x104
lea ecx, [ebp - 0x23c]
push ecx
push 0
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
push 0x5c
lea edx, [ebp - 0x23c]
push edx
call fcn.0040c580
add esp, 8
mov word [eax + 2], 0
lea eax, [ebp - 0x23c]
push eax
lea ecx, [ebp - 0x27c]
call fcn.00401c80
mov byte [ebp - 4], 2
push 0x511ea4
push 0x6c06
mov ecx, dword [ebp - 0x284]
push ecx
call dword [sym.imp.KERNEL32.dll_FindResourceW]
mov dword [ebp - 0x288], eax
cmp dword [ebp - 0x288], 0
jne 0x40a5aa
push 0
push 0x511eb0
push str.27654
push 0
call dword [sym.imp.USER32.dll_MessageBoxW]
mov dword [ebp - 0x290], 0
mov byte [ebp - 4], 1
lea ecx, [ebp - 0x27c]
call fcn.00401cc0
mov byte [ebp - 4], 0
lea ecx, [ebp - 0x25c]
call fcn.00401cc0
mov dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x2c]
call fcn.00401cc0
mov eax, dword [ebp - 0x290]
jmp 0x40a6c0
mov edx, dword [ebp - 0x288]
push edx
mov eax, dword [ebp - 0x284]
push eax
call dword [sym.imp.KERNEL32.dll_LoadResource]
mov dword [ebp - 0x280], eax
mov ecx, dword [ebp - 0x280]
push ecx
call dword [sym.imp.KERNEL32.dll_LockResource]
mov dword [ebp - 0x240], eax
mov edx, dword [ebp - 0x288]
push edx
mov eax, dword [ebp - 0x284]
push eax
call dword [sym.imp.KERNEL32.dll_SizeofResource]
mov dword [ebp - 0x30], eax
lea ecx, [ebp - 0x25c]
call fcn.00401cf0
push eax
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
je 0x40a618
lea ecx, [ebp - 0x25c]
call fcn.00401cf0
push eax
call fcn.00439fa0
add esp, 4
push 0
push 0x80
push 1
push 0
push 1
push 0x40000000
lea ecx, [ebp - 0x25c]
call fcn.00401cf0
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov dword [ebp - 0x260], eax
cmp dword [ebp - 0x260], 0xffffffff
je 0x40a683
mov dword [ebp - 0x28c], 0
push 0
lea ecx, [ebp - 0x28c]
push ecx
mov edx, dword [ebp - 0x30]
push edx
mov eax, dword [ebp - 0x240]
push eax
mov ecx, dword [ebp - 0x260]
push ecx
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov edx, dword [ebp - 0x260]
push edx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov dword [ebp - 0x294], 1
mov byte [ebp - 4], 1
lea ecx, [ebp - 0x27c]
call fcn.00401cc0
mov byte [ebp - 4], 0
lea ecx, [ebp - 0x25c]
call fcn.00401cc0
mov dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x2c]
call fcn.00401cc0
mov eax, dword [ebp - 0x294]
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.004626fa
mov esp, ebp
pop ebp
ret