Function at 0x49d1b0
Capabilities:
Check if file exists
Get file attributes
Get file size
Link many functions at runtime
Read file on windows
Resolve function by parsing pe exports

Disassembly:
sub esp, 0x5c
push ebx
push ebp
mov ebp, dword [esp + 0x78]
mov ebx, ecx
mov dword [esp + 0x14], edx
mov dword [esp + 0x10], 0
push esi
mov esi, ebx
push edi
mov edi, dword [esp + 0x74]
mov dword [edi], 0xffffffff
test ebp, ebp
je 0x49d1dd
mov byte [ebp], 0
cmp word [ebx], 0
je 0x49d36c
push 6
push str.hicon:
push ebx
mov byte [esp + 0x23], 0
mov byte [esp + 0x80], 0
call fcn.004bb7bb
add esp, 0xc
test eax, eax
je 0x49d21c
push 8
push str.hbitmap:
push ebx
call fcn.004bb7bb
add esp, 0xc
test eax, eax
jne 0x49d287
movzx ecx, word [ebx + 0xa]
xor ebx, ebx
cmp ecx, 0x3a
mov byte [esp + 0x17], 1
setne bl
xor eax, eax
lea ebx, [ebx*4 + 0xc]
add ebx, esi
cmp ecx, 0x3a
sete al
mov dword [edi], eax
movzx eax, word [ebx]
cmp eax, 0x2a
sete byte [esp + 0x74]
jne 0x49d258
add ebx, 2
test ebp, ebp
je 0x49d258
mov byte [ebp], 1
mov ecx, ebx
call fcn.00404cf0
test al, al
je 0x49d272
push 0x10
push 0
push ebx
call fcn.004bb5f0
add esp, 0xc
jmp 0x49d27b
push ebx
call fcn.004bb74c
add esp, 4
mov dword [esp + 0x18], eax
test eax, eax
je 0x49d36c
push 0x2e
push ebx
call fcn.004b7194
mov esi, eax
add esp, 8
test esi, esi
je 0x49d29b
add esi, 2
mov eax, dword [esp + 0x18]
test eax, eax
jne 0x49d310
cmp dword [esp + 0x78], 1
ja 0x49d33a
test esi, esi
je 0x49d310
push 0x4f8af0
push esi
call fcn.004ba0a7
add esp, 8
test eax, eax
je 0x49d33a
push 0x4f8af8
push esi
call fcn.004ba0a7
add esp, 8
test eax, eax
je 0x49d33a
push 0x4fc074
push esi
call fcn.004ba0a7
add esp, 8
test eax, eax
je 0x49d33a
push 0x4fc07c
push esi
call fcn.004ba0a7
add esp, 8
test eax, eax
je 0x49d33a
push 0x4fc084
push esi
call fcn.004ba0a7
add esp, 8
test eax, eax
je 0x49d33a
mov eax, dword [esp + 0x18]
mov byte [esp + 0x16], 0
test esi, esi
je 0x49d3c6
push 0x4f8ae8
push esi
call fcn.004ba0a7
add esp, 8
test eax, eax
jne 0x49d376
mov dword [edi], 1
jmp 0x49d3c2
push dword [esp + 0x84]
mov ebp, dword [esp + 0x74]
mov ecx, ebx
mov edx, dword [esp + 0x7c]
push ebp
push dword [esp + 0x24]
mov byte [esp + 0x22], 1
mov dword [edi], 1
call fcn.0049d980
add esp, 0xc
mov dword [esp + 0x18], eax
cmp eax, 2
jae 0x49d3ca
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x5c
ret
push 0x4fc08c
push esi
call fcn.004ba0a7
add esp, 8
test eax, eax
je 0x49d3bc
push 0x4fc094
push esi
call fcn.004ba0a7
add esp, 8
test eax, eax
je 0x49d3bc
push 0x4fc09c
push esi
call fcn.004ba0a7
mov ebp, dword [esp + 0x78]
add esp, 8
test eax, eax
mov eax, dword [esp + 0x18]
jne 0x49d3ca
mov dword [edi], 0
jmp 0x49d3ca
mov dword [edi], 2
mov eax, dword [esp + 0x18]
mov ebp, dword [esp + 0x70]
mov ecx, dword [esp + 0x1c]
cmp ecx, 0xffffffff
je 0x49d3d8
cmp ebp, 0xffffffff
jne 0x49d3ec
test ecx, ecx
je 0x49d3e0
test ebp, ebp
jne 0x49d3ec
xor ebp, ebp
xor ecx, ecx
mov dword [esp + 0x70], ebp
mov dword [esp + 0x1c], ecx
cmp ecx, 0xffffffff
je 0x49d3fb
mov byte [esp + 0x15], 0
cmp ebp, 0xffffffff
jne 0x49d400
mov byte [esp + 0x15], 1
xor edx, edx
mov dword [esp + 0x28], edx
mov dl, byte [esp + 0x7c]
mov dword [esp + 0x24], edx
test dl, dl
je 0x49d445
push str.gdiplus
call dword [sym.imp.KERNEL32.dll_LoadLibraryW]
mov ecx, dword [esp + 0x1c]
mov edx, eax
mov dword [esp + 0x28], eax
mov eax, dword [esp + 0x24]
movzx eax, al
mov dword [esp + 0x24], eax
xor eax, eax
test edx, edx
mov edx, dword [esp + 0x24]
cmove edx, eax
mov eax, dword [esp + 0x18]
mov dword [esp + 0x24], edx
test eax, eax
jne 0x49d4ec
cmp dword [edi], 0xffffffff
jle 0x49d4ec
test dl, dl
jne 0x49d4ec
mov dl, byte [esp + 0x15]
push 0x2010
test dl, dl
cmove eax, ebp
push eax
xor eax, eax
test dl, dl
cmove eax, ecx
push eax
push dword [edi]
push ebx
push 0
call dword [sym.imp.USER32.dll_LoadImageW]
mov dword [esp + 0x18], eax
test eax, eax
je 0x49d49e
cmp byte [esp + 0x15], 0
jne 0x49d4ec
cmp dword [esp + 0x78], 0
jne 0x49d4ec
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x5c
ret
push ebx
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
cmp eax, 0xffffffff
je 0x49d36c
mov eax, dword [esp + 0x78]
test eax, eax
jle 0x49d4e8
push dword [esp + 0x84]
mov edx, eax
mov ecx, ebx
push ebp
push dword [esp + 0x24]
call fcn.0049d980
add esp, 0xc
mov dword [esp + 0x18], eax
cmp eax, 2
jb 0x49d36c
mov byte [esp + 0x16], 1
mov dword [edi], 1
jmp 0x49d4ec
mov eax, dword [esp + 0x18]
mov dword [esp + 0x20], 0
test eax, eax
jne 0x49d73b
mov dword [edi], eax
cmp byte [esp + 0x24], al
jne 0x49d53e
test esi, esi
je 0x49d53e
push 0x4fc0b4
push esi
call fcn.004ba0a7
add esp, 8
test eax, eax
je 0x49d559
push str.jpeg
push esi
call fcn.004ba0a7
add esp, 8
test eax, eax
je 0x49d559
push 0x4fc0c8
push esi
call fcn.004ba0a7
add esp, 8
test eax, eax
je 0x49d559
mov ebp, dword [esp + 0x28]
test ebp, ebp
jne 0x49d679
push str.gdiplus
call dword [sym.imp.KERNEL32.dll_LoadLibraryW]
mov ebp, eax
jmp 0x49d55d
mov ebp, dword [esp + 0x28]
test ebp, ebp
jne 0x49d679
push ebp
push ebp
push 3
push ebp
push ebp
push connect
push ebx
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov ebp, eax
cmp ebp, 0xffffffff
je 0x49d36c
push 0
push ebp
call dword [sym.imp.KERNEL32.dll_GetFileSize]
push eax
push 2
mov dword [esp + 0x30], eax
call dword [sym.imp.KERNEL32.dll_GlobalAlloc]
mov esi, eax
test esi, esi
jne 0x49d5af
push ebp
call dword [sym.imp.KERNEL32.dll_CloseHandle]
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x5c
ret
push esi
call dword [sym.imp.KERNEL32.dll_GlobalLock]
test eax, eax
jne 0x49d5d2
push ebp
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push esi
call dword [sym.imp.KERNEL32.dll_GlobalFree]
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x5c
ret
push 0
lea ecx, [esp + 0x2c]
push ecx
push dword [esp + 0x30]
push eax
push ebp
call dword [sym.imp.KERNEL32.dll_ReadFile]
push esi
call dword [sym.imp.KERNEL32.dll_GlobalUnlock]
push ebp
call dword [sym.imp.KERNEL32.dll_CloseHandle]
lea eax, [esp + 0x24]
push eax
push 0
push esi
call dword [sym.imp.ole32.dll_CreateStreamOnHGlobal]
test eax, eax
js 0x49d5c1
mov eax, dword [esp + 0x24]
test eax, eax
je 0x49d5c1
lea ecx, [esp + 0x20]
push ecx
push 0x4d49d0
push 0
push 0
push eax
call dword [sym.imp.OLEAUT32.dll_OleCreatePictureIndirect]
mov ecx, dword [esp + 0x20]
xor edx, edx
test eax, eax
mov eax, dword [esp + 0x24]
push eax
cmovs ecx, edx
mov dword [esp + 0x24], ecx
mov ecx, dword [eax]
call dword [ecx + 8]
push esi
call dword [sym.imp.KERNEL32.dll_GlobalFree]
mov ecx, dword [esp + 0x20]
test ecx, ecx
je 0x49d36c
mov eax, dword [ecx]
lea edx, [esp + 0x18]
push edx
push ecx
call dword [eax + 0xc]
mov eax, dword [esp + 0x18]
test eax, eax
jne 0x49d73b
mov eax, dword [esp + 0x20]
push eax
mov ecx, dword [eax]
call dword [ecx + 8]
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x5c
ret
mov esi, dword [sym.imp.KERNEL32.dll_GetProcAddress]
push str.GdiplusStartup
push ebp
call esi
push str.GdiplusShutdown
push ebp
mov dword [esp + 0x2c], eax
call esi
push str.GdipCreateBitmapFromFile
push ebp
mov dword [esp + 0x40], eax
call esi
push str.GdipCreateHBITMAPFromBitmap
push ebp
mov dword [esp + 0x34], eax
call esi
push str.GdipDisposeImage
push ebp
mov dword [esp + 0x38], eax
call esi
mov esi, eax
mov dword [esp + 0x3c], 1
mov eax, dword [esp + 0x24]
mov dword [esp + 0x40], 0
mov dword [esp + 0x44], 0
mov dword [esp + 0x48], 0
test eax, eax
je 0x49d730
push 0
lea ecx, [esp + 0x40]
push ecx
lea ecx, [esp + 0x3c]
push ecx
call eax
test eax, eax
jne 0x49d730
lea eax, [esp + 0x28]
push eax
push ebx
call dword [esp + 0x34]
test eax, eax
jne 0x49d728
push 0xff000000
lea eax, [esp + 0x1c]
push eax
push dword [esp + 0x30]
call dword [esp + 0x3c]
mov ecx, dword [esp + 0x18]
xor edx, edx
push dword [esp + 0x28]
test eax, eax
cmovne ecx, edx
mov dword [esp + 0x1c], ecx
call esi
push dword [esp + 0x34]
call dword [esp + 0x3c]
push ebp
call dword [sym.imp.KERNEL32.dll_FreeLibrary]
mov eax, dword [esp + 0x18]
cmp byte [esp + 0x15], 0
je 0x49d858
cmp dword [edi], 0
je 0x49d763
lea ecx, [esp + 0x3c]
push ecx
push eax
call dword [sym.imp.USER32.dll_GetIconInfo]
test eax, eax
je 0x49d844
mov eax, dword [esp + 0x48]
lea ecx, [esp + 0x50]
push ecx
push 0x18
push eax
call dword [sym.imp.GDI32.dll_GetObjectW]
mov esi, dword [esp + 0x70]
cmp esi, 0xffffffff
jne 0x49d7b6
mov eax, dword [esp + 0x54]
mov ebp, dword [esp + 0x1c]
test eax, eax
je 0x49d7f6
movd xmm1, dword [esp + 0x58]
cvtdq2pd xmm1, xmm1
movd xmm0, eax
cvtdq2pd xmm0, xmm0
divsd xmm1, xmm0
movd xmm0, ebp
cvtdq2pd xmm0, xmm0
mulsd xmm1, xmm0
addsd xmm1, qword [0x4fd520]
cvttsd2si esi, xmm1
jmp 0x49d7f6
mov eax, dword [esp + 0x58]
test eax, eax
je 0x49d7f2
movd xmm1, dword [esp + 0x54]
cvtdq2pd xmm1, xmm1
movd xmm0, eax
cvtdq2pd xmm0, xmm0
divsd xmm1, xmm0
movd xmm0, esi
cvtdq2pd xmm0, xmm0
mulsd xmm1, xmm0
addsd xmm1, qword [0x4fd520]
cvttsd2si ebp, xmm1
mov dword [esp + 0x1c], ebp
jmp 0x49d7f6
mov ebp, dword [esp + 0x1c]
cmp dword [edi], 0
je 0x49d83e
push dword [esp + 0x4c]
call dword [sym.imp.GDI32.dll_DeleteObject]
push dword [esp + 0x48]
call dword [sym.imp.GDI32.dll_DeleteObject]
cmp byte [esp + 0x16], 0
jne 0x49d83e
cmp byte [esp + 0x17], 0
jne 0x49d83e
push dword [esp + 0x18]
call dword [sym.imp.USER32.dll_DestroyIcon]
push 0x10
push esi
push ebp
push dword [edi]
push ebx
push 0
call dword [sym.imp.USER32.dll_LoadImageW]
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x5c
ret
mov eax, dword [esp + 0x18]
jmp 0x49d85c
push dword [esp + 0x18]
call dword [sym.imp.USER32.dll_DestroyIcon]
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x5c
ret
mov esi, dword [esp + 0x70]
cmp dword [esp + 0x20], 0
je 0x49d897
mov ecx, dword [esp + 0x1c]
test ecx, ecx
jne 0x49d874
test esi, esi
jne 0x49d874
lea edx, [ecx + 4]
jmp 0x49d876
xor edx, edx
push edx
push esi
push ecx
push 0
push eax
call dword [sym.imp.USER32.dll_CopyImage]
mov ecx, dword [esp + 0x20]
mov esi, eax
push ecx
mov edx, dword [ecx]
call dword [edx + 8]
mov ebp, dword [esp + 0x80]
jmp 0x49d8ec
mov edx, dword [esp + 0x1c]
mov cl, byte [esp + 0x74]
mov ebp, dword [esp + 0x80]
test edx, edx
jne 0x49d8ca
test esi, esi
jne 0x49d8ca
test cl, cl
je 0x49d8b6
test ebp, ebp
je 0x49d8ca
cmp dword [esp + 0x78], 1
jl 0x49d36e
cmp dword [edi], 1
je 0x49d36e
test cl, cl
je 0x49d8d9
mov ecx, ebp
neg ecx
sbb ecx, ecx
and ecx, 4
jmp 0x49d8de
mov ecx, 0xc
push ecx
push esi
push edx
push dword [edi]
push eax
call dword [sym.imp.USER32.dll_CopyImage]
mov esi, eax
cmp dword [esp + 0x78], 0
jle 0x49d92b
cmp dword [edi], 0
jne 0x49d92b
lea eax, [esp + 0x3c]
mov dword [esp + 0x3c], 1
push eax
mov dword [esp + 0x4c], esi
mov dword [esp + 0x50], esi
call dword [sym.imp.USER32.dll_CreateIconIndirect]
cmp byte [esp + 0x74], 0
mov ebx, eax
jne 0x49d923
push esi
call dword [sym.imp.GDI32.dll_DeleteObject]
mov esi, ebx
mov dword [edi], 1
cmp dword [esp + 0x18], esi
je 0x49d939
test ebp, ebp
je 0x49d939
mov byte [ebp], 0
pop edi
mov eax, esi
pop esi
pop ebp
pop ebx
add esp, 0x5c
ret