Function at 0x40f628
Capabilities:
Check if file exists
Create directory
Extract resource via kernel32 functions
Get common file path
Get file attributes

Disassembly:
push ebp
mov ebp, esp
add esp, 0xfffffeac
mov eax, 0x4ab99c
push ebx
push esi
push edi
lea esi, [ebp - 0x48]
mov ebx, edx
call fcn.0045a304
mov word [esi + 0x10], 8
xor edx, edx
mov dword [ebp - 4], edx
inc dword [esi + 0x1c]
mov word [esi + 0x10], 0x14
push 0x104
lea ecx, [ebp - 0x154]
push ecx
call sub.KERNEL32.DLL_GetSystemDirectoryA
mov word [esi + 0x10], 0x20
lea edx, [ebp - 0x154]
lea eax, [ebp - 0xc]
call fcn.00477a1c
mov edx, eax
inc dword [esi + 0x1c]
lea eax, [ebp - 4]
call fcn.00477b04
dec dword [esi + 0x1c]
lea eax, [ebp - 0xc]
mov edx, 2
call fcn.00477ad4
mov word [esi + 0x10], 0x2c
mov edx, 0x4ab6dc
lea eax, [ebp - 0x10]
call fcn.00477a1c
inc dword [esi + 0x1c]
xor eax, eax
mov dword [ebp - 0x14], eax
lea eax, [ebp - 4]
inc dword [esi + 0x1c]
lea edx, [ebp - 0x10]
lea ecx, [ebp - 0x14]
call fcn.00477b2c
lea eax, [ebp - 0x14]
mov eax, dword [eax]
call fcn.0044fb2c
dec dword [esi + 0x1c]
lea eax, [ebp - 0x14]
mov edx, 2
call fcn.00477ad4
dec dword [esi + 0x1c]
lea eax, [ebp - 0x10]
mov edx, 2
call fcn.00477ad4
mov word [esi + 0x10], 0x38
mov edx, 0x4ab6e2
lea eax, [ebp - 0x18]
call fcn.00477a1c
inc dword [esi + 0x1c]
xor eax, eax
mov dword [ebp - 8], eax
lea eax, [ebp - 4]
inc dword [esi + 0x1c]
lea edx, [ebp - 0x18]
lea ecx, [ebp - 8]
call fcn.00477b2c
dec dword [esi + 0x1c]
lea eax, [ebp - 0x18]
mov edx, 2
call fcn.00477ad4
mov word [esi + 0x10], 0x14
push 0
cmp dword [ebp - 8], 0
je 0x40f73e
mov ecx, dword [ebp - 8]
jmp 0x40f743
mov ecx, 0x4ab6e8
push ecx
call sub.KERNEL32.DLL_CreateDirectoryA
lea eax, [ebp - 0x154]
push eax
push 0x104
call sub.KERNEL32.DLL_GetTempPathA
lea edx, [ebp - 0x154]
push edx
call fcn.0045a018
pop ecx
movsx eax, byte [ebp + eax - 0x155]
cmp eax, 0x5c
jne 0x40f789
lea edx, [ebp - 0x154]
push edx
call fcn.0045a018
pop ecx
mov byte [ebp + eax - 0x155], 0
lea ecx, [ebp - 0x154]
push ecx
call sub.KERNEL32.DLL_GetFileAttributesA
cmp eax, 0xffffffff
jne 0x40f7df
push 0
lea eax, [ebp - 0x154]
push eax
call sub.KERNEL32.DLL_CreateDirectoryA
jmp 0x40f7df
movzx eax, bx
mov edx, dword [0x4b0960]
push str.LANG
push eax
mov ecx, dword [edx]
push ecx
call sub.KERNEL32.DLL_FindResourceA
mov ebx, eax
test ebx, ebx
jne 0x40f82a
dec dword [esi + 0x1c]
lea eax, [ebp - 8]
mov edx, 2
call fcn.00477ad4
dec dword [esi + 0x1c]
lea eax, [ebp - 4]
mov edx, 2
call fcn.00477ad4
mov ecx, dword [esi]
mov dword fs:[0], ecx
jmp 0x40f937
push ebx
mov eax, dword [0x4b0960]
mov edx, dword [eax]
push edx
call sub.KERNEL32.DLL_SizeofResource
mov edi, eax
mov eax, dword [0x4b0960]
push ebx
mov edx, dword [eax]
push edx
call sub.KERNEL32.DLL_LoadResource
test eax, eax
jne 0x40f87a
dec dword [esi + 0x1c]
lea eax, [ebp - 8]
mov edx, 2
call fcn.00477ad4
dec dword [esi + 0x1c]
lea eax, [ebp - 4]
mov edx, 2
call fcn.00477ad4
mov ecx, dword [esi]
mov dword fs:[0], ecx
jmp 0x40f937
push eax
call sub.KERNEL32.DLL_LockResource
mov dword [ebp - 0x4c], eax
mov dl, 1
mov eax, dword [0x445be8]
call fcn.00408a04
mov ebx, eax
mov ecx, edi
mov edx, dword [ebp - 0x4c]
mov eax, ebx
mov edi, dword [eax]
call dword [edi + 8]
xor edx, edx
mov eax, ebx
call fcn.00448b5c
push 0x4ab6ef
lea ecx, [ebp - 0x154]
push ecx
call sub.KERNEL32.DLL_lstrcatA
mov word [esi + 0x10], 0x44
lea edx, [ebp - 0x154]
lea eax, [ebp - 0x1c]
call fcn.00477a1c
inc dword [esi + 0x1c]
mov edx, dword [eax]
mov eax, ebx
call fcn.00448ecc
dec dword [esi + 0x1c]
lea eax, [ebp - 0x1c]
mov edx, 2
call fcn.00477ad4
mov edi, ebx
mov dword [ebp - 0x24], edi
test edi, edi
je 0x40f90e
mov eax, dword [edi]
mov dword [ebp - 0x20], eax
mov word [esi + 0x10], 0x5c
mov edx, 3
mov eax, dword [ebp - 0x24]
mov ecx, dword [eax]
call dword [ecx - 4]
mov word [esi + 0x10], 0x50
dec dword [esi + 0x1c]
lea eax, [ebp - 8]
mov edx, 2
call fcn.00477ad4
dec dword [esi + 0x1c]
lea eax, [ebp - 4]
mov edx, 2
call fcn.00477ad4
mov ecx, dword [esi]
mov dword fs:[0], ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret