Function at 0x40a870
Capabilities:
Check if file exists
Extract resource via kernel32 functions
Get file attributes

Disassembly:
push 0xffffffffffffffff
push 0x43b8a8
mov eax, dword fs:[0]
push eax
sub esp, 0x4c
mov eax, dword [0x44a120]
xor eax, esp
mov dword [esp + 0x48], eax
push ebx
push ebp
push esi
push edi
mov eax, dword [0x44a120]
xor eax, esp
push eax
lea eax, [esp + 0x60]
mov dword fs:[0], eax
mov ebp, dword [esp + 0x74]
xor ebx, ebx
mov eax, ecx
mov dword [esp + 0x58], 7
mov dword [esp + 0x54], ebx
mov word [esp + 0x44], bx
lea esi, [eax + 2]
mov edi, edi
mov dx, word [eax]
add eax, 2
cmp dx, bx
jne 0x40a8c0
sub eax, esi
sar eax, 1
push eax
push ecx
lea esi, [esp + 0x48]
call fcn.00408070
push ebx
mov dword [esp + 0x6c], ebx
call dword [sym.imp.KERNEL32.dll_GetModuleHandleW]
mov edi, eax
mov dword [esp + 0x20], ebx
mov dword [esp + 0x18], ebx
push ebp
push str.HTML
mov byte [esp + 0x70], 2
call fcn.0041c694
add esp, 8
test eax, eax
jne 0x40a910
movzx eax, word [esp + 0x70]
push 0x17
push eax
jmp 0x40a917
movzx ecx, word [esp + 0x70]
push ebp
push ecx
push edi
call dword [sym.imp.KERNEL32.dll_FindResourceW]
mov esi, eax
cmp esi, ebx
mov dword [esp + 0x1c], esi
jne 0x40a943
cmp dword [esp + 0x58], 8
jb 0x40a93c
mov edx, dword [esp + 0x44]
push edx
call fcn.0041c4fe
add esp, 4
xor eax, eax
jmp 0x40aa60
lea eax, [esp + 0x40]
push eax
lea ecx, [esp + 0x28]
call fcn.00413e70
mov ebp, 8
cmp dword [eax + 0x18], ebp
jb 0x40a960
mov eax, dword [eax + 4]
jmp 0x40a963
add eax, 4
push eax
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
cmp eax, 0xffffffff
setne al
test al, al
sete byte [esp + 0x17]
cmp dword [esp + 0x3c], ebp
jb 0x40a98a
mov ecx, dword [esp + 0x28]
push ecx
call fcn.0041c4fe
add esp, 4
cmp byte [esp + 0x17], 0
push esi
je 0x40a99e
call dword [sym.imp.GDI32.dll_DeleteObject]
cmp dword [esp + 0x58], ebp
jmp 0x40a92d
push edi
call dword [sym.imp.KERNEL32.dll_LoadResource]
mov ebp, eax
cmp ebp, ebx
push esi
jne 0x40a9cd
call dword [sym.imp.GDI32.dll_DeleteObject]
cmp dword [esp + 0x58], 8
jb 0x40a93c
mov eax, dword [esp + 0x44]
push eax
call fcn.0041c4fe
add esp, 4
xor eax, eax
jmp 0x40aa60
push edi
call dword [sym.imp.KERNEL32.dll_SizeofResource]
mov edi, eax
cmp edi, ebx
push ebp
je 0x40a9e8
call dword [sym.imp.KERNEL32.dll_LockResource]
mov ebx, eax
test ebx, ebx
jne 0x40aa02
push ebp
call dword [sym.imp.KERNEL32.dll_FreeResource]
push esi
call dword [sym.imp.GDI32.dll_DeleteObject]
lea esi, [esp + 0x40]
call fcn.004052b0
xor eax, eax
jmp 0x40aa60
cmp dword [esp + 0x58], 8
mov eax, dword [esp + 0x44]
jae 0x40aa11
lea eax, [esp + 0x44]
lea ecx, [esp + 0x18]
push ecx
call fcn.0040a800
test eax, eax
jl 0x40aa34
lea edx, [esp + 0x18]
push edx
mov ecx, edi
mov edx, ebx
call fcn.0040a840
mov edi, 1
jmp 0x40aa38
mov edi, dword [esp + 0x20]
push ebp
call dword [sym.imp.KERNEL32.dll_FreeResource]
push esi
call dword [sym.imp.GDI32.dll_DeleteObject]
mov eax, dword [esp + 0x18]
test eax, eax
je 0x40aa55
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
lea esi, [esp + 0x40]
call fcn.004052b0
mov eax, edi
mov ecx, dword [esp + 0x60]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebp
pop ebx
mov ecx, dword [esp + 0x48]
xor ecx, esp
call fcn.0041cb94
add esp, 0x58
ret