Function at 0x40aec0
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 0x551ebd
mov eax, dword fs:[0]
push eax
sub esp, 0x448
mov eax, dword [0x5a0800]
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 0x55c478
mov edi, eax
push 0x6f
push edi
call dword [sym.imp.KERNEL32.dll_FindResourceW]
mov dword [ebp - 0x440], eax
test eax, eax
je 0x40b1b9
push eax
push edi
call dword [sym.imp.KERNEL32.dll_LoadResource]
mov dword [ebp - 0x450], eax
test eax, eax
je 0x40b1b9
push eax
call dword [sym.imp.KERNEL32.dll_LockResource]
mov dword [ebp - 0x44c], eax
test eax, eax
je 0x40b1ad
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.004ea040
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 0x40b035
lea ecx, [ebp - 0x218]
lea edx, [ecx + 2]
nop dword [eax]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x40afe0
sub ecx, edx
lea eax, [ebp - 0x218]
sar ecx, 1
push ecx
push eax
mov ecx, esi
call fcn.0040f0f0
push 6
push 0x55c488
mov ecx, esi
call fcn.0040f080
call dword [sym.imp.KERNEL32.dll_GetCurrentProcessId]
push eax
lea eax, [ebp - 0x438]
push eax
call fcn.00408480
add esp, 8
mov dword [ebp - 0x444], 3
mov dword [ebp - 4], 1
jmp 0x40b0b3
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 0x40b060
sub ecx, edx
lea eax, [ebp - 0x218]
sar ecx, 1
push ecx
push eax
mov ecx, esi
call fcn.0040f0f0
push 4
push 0x55c498
mov ecx, esi
call fcn.0040f080
call dword [sym.imp.KERNEL32.dll_GetCurrentProcessId]
push eax
lea eax, [ebp - 0x438]
push eax
call fcn.00408480
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.0040f080
lea ecx, [ebp - 0x438]
mov byte [ebp - 4], 0
call fcn.00409100
cmp dword [esi + 0x14], 7
mov eax, esi
jbe 0x40b0ee
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.00411760
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 0x40b120
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 0x40b194
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 0x40b184
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 0x40b1ad
push str._XIMAO__7z__SaveToFile_error__r_n
call dword [sym.imp.KERNEL32.dll_OutputDebugStringW]
push 0
push 0x55c520
mov ecx, esi
call fcn.0040f0f0
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.004e6d11
mov esp, ebp
pop ebp
ret 4