Function at 0x40f2f0
Capabilities:
Extract resource via kernel32 functions
Get common file path
Get file size
Read file on windows

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x4b309b
mov eax, dword fs:[0]
push eax
sub esp, 0x3c8
mov eax, dword [0x4d897c]
xor eax, ebp
mov dword [ebp - 0x14], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov eax, dword [ebp + 0xc]
xor ebx, ebx
cmp eax, ebx
jne 0x40f73c
xor ecx, ecx
mov word [ebp - 0xc8], cx
mov ecx, dword [0x4da280]
lea eax, [ebp - 0xc8]
mov dword [ebp - 0xcc], eax
mov edi, ecx
cmp ecx, ebx
jne 0x40f351
mov edi, 0x4be374
mov ecx, edi
lea esi, [ecx + 2]
mov dx, word [ecx]
add ecx, 2
cmp dx, bx
jne 0x40f356
sub ecx, esi
sar ecx, 1
mov esi, ecx
cmp esi, 0x3f
jl 0x40f386
lea edx, [esi + esi + 2]
push edx
push ebx
mov dword [ebp - 0xcc], ebx
call fcn.0049d66f
add esp, 8
mov dword [ebp - 0xcc], eax
push esi
push edi
push eax
call fcn.00495d52
mov ecx, dword [ebp - 0xcc]
xor eax, eax
add esp, 0xc
mov word [ecx + esi*2], ax
mov dword [ebp - 4], ebx
mov eax, dword [0x4da308]
cmp word [eax], bx
jne 0x40f4ae
mov eax, dword [ebp + 8]
cmp eax, ebx
je 0x40f3c1
push eax
lea ebx, [ebp - 0xcc]
call fcn.0041a110
mov edx, dword [ebp - 0xcc]
push 0
push 0x80
push 3
push 0
push 1
push SysReAllocStringLen
push edx
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov esi, eax
or ebx, 0xffffffff
cmp esi, ebx
jne 0x40f40e
mov dword [ebp - 4], ebx
mov eax, dword [ebp - 0xcc]
lea ecx, [ebp - 0xc8]
cmp eax, ecx
je 0x40f7b7
push eax
call fcn.004964ad
add esp, 4
jmp 0x40f7b7
push 0
push esi
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov edi, eax
test edi, edi
jne 0x40f442
mov dword [ebp - 4], ebx
mov eax, dword [ebp - 0xcc]
lea edx, [ebp - 0xc8]
cmp eax, edx
je 0x40f7b7
push eax
call fcn.004964ad
add esp, 4
jmp 0x40f7b7
push edi
mov dword [ebp - 0x3c0], 0
call fcn.0045bc5f
add esp, 4
push 0
mov ebx, eax
lea eax, [ebp - 0x3c0]
push eax
push edi
push ebx
push esi
call dword [sym.imp.KERNEL32.dll_ReadFile]
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
cmp dword [ebp - 0x3c0], edi
je 0x40f71a
push ebx
call fcn.00495ac5
add esp, 4
mov dword [ebp - 4], 0xffffffff
mov eax, dword [ebp - 0xcc]
lea ecx, [ebp - 0xc8]
cmp eax, ecx
je 0x40f7b7
push eax
call fcn.004964ad
add esp, 4
jmp 0x40f7b7
push eax
lea ebx, [ebp - 0xcc]
call fcn.0041a110
cmp byte [0x4dead0], 0
je 0x40f4d4
mov esi, dword [0x4dead4]
mov dword [ebp - 0x3c0], esi
jmp 0x40f60a
mov ebx, dword [ebp - 0xcc]
push 0x340
call fcn.0045c9b6
add esp, 4
test eax, eax
je 0x40f501
or ecx, 0xffffffff
mov dword [eax], 0
mov dword [eax + 4], ecx
mov dword [eax + 0x134], ecx
mov esi, eax
jmp 0x40f503
xor esi, esi
cmp dword [esi], 0
jne 0x40f5d6
cmp dword [esi + 4], 0xffffffff
jne 0x40f5d6
lea edi, [esi + 0x138]
push edi
push 0x104
call dword [sym.imp.KERNEL32.dll_GetCurrentDirectoryW]
add edi, 0xfffffffe
jmp 0x40f530
mov ax, word [edi + 2]
add edi, 2
test ax, ax
jne 0x40f530
mov edx, dword [0x4be818]
push 0
push 0x80
push 3
push 0
push 1
push SysReAllocStringLen
push ebx
mov dword [edi], edx
mov dword [ebp - 0x3c0], 0
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov dword [ebp - 0x3c0], eax
cmp eax, 0xffffffff
je 0x40f5cf
push eax
call dword [sym.imp.KERNEL32.dll_GetFileType]
cmp eax, 1
push 0x1c
sete bl
call fcn.0045c9b6
mov edi, eax
mov byte [edi], 1
mov byte [edi + 1], bl
mov eax, dword [ebp - 0x3c0]
add esp, 4
mov dword [edi + 4], eax
mov byte [edi + 8], 0
mov dword [edi + 0xc], 0
test bl, bl
je 0x40f5bf
mov ecx, dword [ebp - 0x3c0]
push 1
push 0
push 0
push ecx
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov dword [edi + 0xc], eax
mov eax, edi
call fcn.00425f50
mov dword [esi], eax
mov eax, dword [0x4deb08]
jmp 0x40f5db
mov eax, 0x200
jmp 0x40f5db
mov eax, 0x1000000
mov dword [0x4deb0c], eax
test eax, eax
je 0x40f5ef
push esi
call fcn.0045c9e1
add esp, 4
jmp 0x40f60e
push 8
call fcn.0045c9b6
mov dword [eax + 4], esi
add esp, 4
mov dword [eax], 1
mov dword [ebp - 0x3c0], eax
mov esi, eax
test esi, esi
jne 0x40f637
mov dword [ebp - 4], 0xffffffff
mov eax, dword [ebp - 0xcc]
lea edx, [ebp - 0xc8]
cmp eax, edx
je 0x40f7b7
push eax
call fcn.004964ad
add esp, 4
jmp 0x40f7b7
mov ecx, dword [ebp + 8]
lea eax, [ebp - 0x3b4]
push eax
push esi
lea edx, [ebp - 0x3c4]
call fcn.00427820
add esp, 8
test eax, eax
jne 0x40f485
mov edi, dword [ebp - 0x188]
test edi, edi
jne 0x40f67c
mov dword [ebp - 4], 0xffffffff
mov eax, dword [ebp - 0xcc]
lea edx, [ebp - 0xc8]
cmp eax, edx
jmp 0x40f49a
push edi
call fcn.0045bc5f
add esp, 4
cmp dword [esi], 1
mov ebx, eax
je 0x40f698
mov dword [0x4deb0c], 0x80000
jmp 0x40f6b9
mov eax, dword [ebp - 0x3c4]
mov ecx, dword [esi + 4]
push edi
push ebx
push eax
call fcn.00427610
mov dword [0x4deb0c], eax
test eax, eax
je 0x40f6db
cmp eax, 0x600
je 0x40f6db
push ebx
call fcn.00495ac5
add esp, 4
cmp byte [0x4dead0], 0
jne 0x40f485
mov edi, esi
call fcn.00427980
jmp 0x40f485
cmp byte [0x4dead0], 0
jne 0x40f71a
cmp dword [esi], 1
je 0x40f6f5
mov dword [0x4deb0c], 0x80000
jmp 0x40f71a
mov esi, dword [esi + 4]
call fcn.00427750
push esi
mov dword [0x4deb0c], eax
call fcn.0045c9e1
mov edx, dword [ebp - 0x3c0]
add esp, 4
push edx
call fcn.0045c9e1
add esp, 4
mov dword [ebp - 4], 0xffffffff
mov eax, dword [ebp - 0xcc]
lea ecx, [ebp - 0xc8]
cmp eax, ecx
je 0x40f7af
push eax
call fcn.004964ad
add esp, 4
jmp 0x40f7af
mov edx, dword [ebp + 8]
push eax
push edx
call fcn.004152d0
push eax
call dword [sym.imp.KERNEL32.dll_FindResourceW]
mov esi, eax
cmp esi, ebx
je 0x40f7b7
push esi
call fcn.004152d0
push eax
call dword [sym.imp.KERNEL32.dll_LoadResource]
mov dword [ebp - 0x3c4], eax
push esi
cmp eax, ebx
jne 0x40f773
call dword [sym.imp.KERNEL32.dll_FreeResource]
jmp 0x40f7b7
call fcn.004152d0
push eax
call dword [sym.imp.KERNEL32.dll_SizeofResource]
mov edi, eax
cmp edi, ebx
je 0x40f7b7
push edi
call fcn.0045bc5f
add esp, 4
mov ebx, eax
mov eax, dword [ebp - 0x3c4]
push edi
push eax
call dword [sym.imp.KERNEL32.dll_LockResource]
push eax
push ebx
call fcn.00498220
add esp, 0xc
push esi
call dword [sym.imp.KERNEL32.dll_FreeResource]
test ebx, ebx
jne 0x40f83a
mov ecx, dword [ebp + 8]
push 0
push 0x80
push 3
push 0
push 1
push SysReAllocStringLen
push ecx
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov esi, eax
cmp esi, 0xffffffff
je 0x40f833
push 0
push esi
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov edi, eax
test edi, edi
je 0x40f833
push edi
mov dword [ebp - 0x3c8], 0
call fcn.0045bc5f
add esp, 4
push 0
lea edx, [ebp - 0x3c8]
push edx
push edi
mov ebx, eax
push ebx
push esi
call dword [sym.imp.KERNEL32.dll_ReadFile]
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
cmp dword [ebp - 0x3c8], edi
je 0x40f82f
push ebx
call fcn.00495ac5
add esp, 4
xor eax, eax
jmp 0x40fa52
test ebx, ebx
jne 0x40f83a
xor eax, eax
jmp 0x40fa52
xor eax, eax
mov dword [ebp - 0x174], eax
mov dword [ebp - 0x164], eax
lea eax, [ebp - 0x3c4]
push eax
lea ecx, [ebp - 0x3cc]
push ecx
add edi, ebx
lea eax, [ebp - 0x3d0]
lea ecx, [ebp - 0x184]
mov dword [ebp - 0xd4], ebx
mov dword [ebp - 0xdc], ebx
mov dword [ebp - 0xd8], edi
call fcn.004279d0
push ebx
mov esi, eax
call fcn.00495ac5
add esp, 0xc
test esi, esi
je 0x40f833
push 0x2c
lea edx, [ebp - 0x40]
push 0
push edx
call fcn.0049ac70
mov edi, dword [ebp - 0x3cc]
mov eax, dword [ebp - 0x3c4]
add esp, 0xc
push 0
mov ebx, edi
imul ebx, eax
push 0
mov ecx, eax
neg ecx
lea eax, [ebp - 0x3bc]
push eax
mov dword [ebp - 0x38], ecx
push 0
lea ecx, [ebp - 0x40]
push ecx
lea edx, [ebx*4]
push 0
mov dword [ebp - 0x40], 0x28
mov dword [ebp - 0x3c], edi
mov dword [ebp - 0x34], 0x200001
mov dword [ebp - 0x30], 0
mov dword [ebp - 0x2c], edx
mov byte [ebp - 0x3b5], 0
mov dword [ebp - 0x3bc], 0
call dword [sym.imp.GDI32.dll_CreateDIBSection]
mov dword [ebp - 0x3c8], eax
test eax, eax
je 0x40f833
xor ecx, ecx
test ebx, ebx
jle 0x40fa0c
mov eax, dword [ebp - 0x3bc]
lea esp, [esp]
mov dl, byte [esi + ecx*4 + 3]
mov byte [eax + ecx*4 + 3], dl
mov edi, dword [ebp - 0x3bc]
cmp byte [edi + ecx*4 + 3], 0xff
jae 0x40f999
movzx eax, byte [esi + ecx*4 + 3]
movzx edx, byte [esi + ecx*4 + 2]
imul edx, eax
mov eax, 0x80808081
mul edx
shr edx, 7
mov byte [edi + ecx*4], dl
movzx eax, byte [esi + ecx*4 + 3]
movzx edx, byte [esi + ecx*4 + 1]
imul edx, eax
mov eax, 0x80808081
mul edx
mov eax, dword [ebp - 0x3bc]
shr edx, 7
mov byte [eax + ecx*4 + 1], dl
movzx eax, byte [esi + ecx*4 + 3]
movzx edx, byte [esi + ecx*4]
imul edx, eax
mov eax, 0x80808081
mul edx
mov eax, dword [ebp - 0x3bc]
shr edx, 7
mov byte [eax + ecx*4 + 2], dl
mov byte [ebp - 0x3b5], 1
jmp 0x40f9bd
mov dl, byte [esi + ecx*4 + 2]
mov byte [edi + ecx*4], dl
movzx eax, byte [esi + ecx*4 + 1]
mov edx, dword [ebp - 0x3bc]
mov byte [edx + ecx*4 + 1], al
movzx eax, byte [esi + ecx*4]
mov edx, dword [ebp - 0x3bc]
mov byte [edx + ecx*4 + 2], al
mov eax, dword [ebp - 0x3bc]
mov edx, dword [ebp + 0x10]
cmp dword [eax + ecx*4], edx
jne 0x40f9fd
mov byte [eax + ecx*4], 0
mov eax, dword [ebp - 0x3bc]
mov byte [eax + ecx*4 + 1], 0
mov edx, dword [ebp - 0x3bc]
mov byte [edx + ecx*4 + 2], 0
mov eax, dword [ebp - 0x3bc]
mov byte [eax + ecx*4 + 3], 0
mov eax, dword [ebp - 0x3bc]
mov byte [ebp - 0x3b5], 1
inc ecx
cmp ecx, ebx
jl 0x40f920
mov edi, dword [ebp - 0x3cc]
push esi
call fcn.004964ad
add esp, 4
push 0x9c
call fcn.0045c9b6
add esp, 4
test eax, eax
je 0x40fa33
lea ecx, [eax + 0x18]
xor edx, edx
mov dword [eax + 0x14], ecx
mov word [ecx], dx
jmp 0x40fa35
xor eax, eax
mov ecx, dword [ebp - 0x3c8]
mov edx, dword [ebp - 0x3c4]
mov dword [eax], ecx
mov cl, byte [ebp - 0x3b5]
mov dword [eax + 4], edi
mov dword [eax + 8], edx
mov byte [eax + 0x10], cl
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x14]
xor ecx, ebp
call fcn.00494bb0
mov esp, ebp
pop ebp
ret