Function at 0x40c040
Capabilities:
Check if file exists
Extract resource via kernel32 functions
Get common file path
Get file attributes
Print debug messages
Write file on windows

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x55acad
mov eax, dword fs:[0]
push eax
sub esp, 0x448
mov eax, dword [0x5a9840]
xor eax, ebp
mov dword [ebp - 0x10], eax
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov esi, dword [ebp + 8]
xorps xmm0, xmm0
mov dword [ebp - 0x454], esi
xor eax, eax
mov dword [ebp - 0x444], 0
movups xmmword [esi], xmm0
mov dword [esi + 0x10], 0
mov dword [esi + 0x14], 0
mov dword [esi + 0x10], 0
mov dword [esi + 0x14], 7
mov word [esi], ax
push eax
mov dword [ebp - 4], eax
mov dword [ebp - 0x444], 1
call dword [sym.imp.KERNEL32.dll_GetModuleHandleW]
push 0x5655b4
mov edi, eax
push 0x6f
push edi
call dword [sym.imp.KERNEL32.dll_FindResourceW]
mov dword [ebp - 0x440], eax
test eax, eax
je 0x40c339
push eax
push edi
call dword [sym.imp.KERNEL32.dll_LoadResource]
mov dword [ebp - 0x450], eax
test eax, eax
je 0x40c339
push eax
call dword [sym.imp.KERNEL32.dll_LockResource]
mov dword [ebp - 0x44c], eax
test eax, eax
je 0x40c32d
push dword [ebp - 0x440]
push edi
call dword [sym.imp.KERNEL32.dll_SizeofResource]
mov edi, eax
lea eax, [ebp - 0x218]
push 0x208
push 0
push eax
mov dword [ebp - 0x448], edi
call fcn.004f26e0
add esp, 0xc
lea eax, [ebp - 0x218]
push eax
push 0x104
call dword [sym.imp.KERNEL32.dll_GetTempPathW]
lea eax, [ebp - 0x218]
push eax
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
cmp eax, 0xffffffff
je 0x40c1b5
lea ecx, [ebp - 0x218]
lea edx, [ecx + 2]
nop dword [eax]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x40c160
sub ecx, edx
lea eax, [ebp - 0x218]
sar ecx, 1
push ecx
push eax
mov ecx, esi
call fcn.00410820
push 6
push 0x5655c4
mov ecx, esi
call fcn.00410690
call dword [sym.imp.KERNEL32.dll_GetCurrentProcessId]
push eax
lea eax, [ebp - 0x438]
push eax
call fcn.00408ab0
add esp, 8
mov dword [ebp - 0x444], 3
mov dword [ebp - 4], 1
jmp 0x40c233
push 0x104
lea eax, [ebp - 0x218]
push eax
push 0
call dword [sym.imp.KERNEL32.dll_GetModuleHandleW]
push eax
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
lea ecx, [ebp - 0x218]
lea edx, [ecx + 2]
nop dword [eax]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x40c1e0
sub ecx, edx
lea eax, [ebp - 0x218]
sar ecx, 1
push ecx
push eax
mov ecx, esi
call fcn.00410820
push 4
push 0x5655d4
mov ecx, esi
call fcn.00410690
call dword [sym.imp.KERNEL32.dll_GetCurrentProcessId]
push eax
lea eax, [ebp - 0x438]
push eax
call fcn.00408ab0
add esp, 8
mov dword [ebp - 0x444], 5
mov dword [ebp - 4], 2
cmp dword [ebp - 0x424], 7
lea eax, [ebp - 0x438]
push dword [ebp - 0x428]
cmova eax, dword [ebp - 0x438]
mov ecx, esi
push eax
call fcn.00410690
lea ecx, [ebp - 0x438]
mov byte [ebp - 4], 0
call fcn.00409960
cmp dword [esi + 0x14], 7
mov eax, esi
jbe 0x40c26e
mov eax, dword [esi]
push edi
push eax
push str._7z_fullPath_s_resSize_u_r_n
lea eax, [ebp - 0x420]
push 0x104
push eax
call fcn.00415ab0
add esp, 0x14
lea eax, [ebp - 0x420]
push eax
call dword [sym.imp.KERNEL32.dll_OutputDebugStringW]
cmp dword [esi + 0x14], 7
mov eax, esi
jbe 0x40c2a0
mov eax, dword [esi]
push 0
push 0x80
push 2
push 0
push 0
push 0x40000000
push eax
mov byte [ebp - 0x439], 0
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov edi, eax
cmp edi, 0xffffffff
je 0x40c314
push 0
lea eax, [ebp - 0x440]
mov dword [ebp - 0x440], 0
push eax
push dword [ebp - 0x448]
push dword [ebp - 0x44c]
push edi
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x40c304
mov eax, dword [ebp - 0x448]
cmp eax, dword [ebp - 0x440]
sete byte [ebp - 0x439]
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
cmp byte [ebp - 0x439], 0
jne 0x40c32d
push str._XIMAO__7z__SaveToFile_error__r_n
call dword [sym.imp.KERNEL32.dll_OutputDebugStringW]
push 0
push 0x565660
mov ecx, esi
call fcn.00410820
push dword [ebp - 0x450]
call dword [sym.imp.KERNEL32.dll_FreeResource]
mov eax, esi
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.004ef253
mov esp, ebp
pop ebp
ret 4