Function at 0x49db60
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
mov eax, dword [esp + 0x70]
mov dword [esp + 0xc], edx
mov dword [esp + 8], 0
push ebx
mov ebx, ecx
push ebp
mov ebp, dword [esp + 0x6c]
push esi
push edi
mov edi, ebx
mov dword [ebp], 0xffffffff
test eax, eax
je 0x49db8d
mov byte [eax], 0
cmp word [ebx], 0
je 0x49dd11
mov esi, dword [sym.imp.api_ms_win_crt_string_l1_1_0.dll__wcsnicmp]
push 6
push str.hicon:
push ebx
mov byte [esp + 0x23], 0
mov byte [esp + 0x21], 0
call esi
add esp, 0xc
test eax, eax
je 0x49dbc9
push 8
push str.hbitmap:
push ebx
call esi
add esp, 0xc
test eax, eax
jne 0x49dc3d
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, edi
cmp ecx, 0x3a
sete al
mov dword [ebp], eax
movzx eax, word [ebx]
cmp eax, 0x2a
sete byte [esp + 0x15]
jne 0x49dc0c
mov eax, dword [esp + 0x80]
add ebx, 2
test eax, eax
je 0x49dc0c
mov byte [eax], 1
mov ecx, ebx
call fcn.00404af0
test al, al
je 0x49dc27
push 0x10
push 0
push ebx
call dword [sym.imp.api_ms_win_crt_convert_l1_1_0.dll__wcstoi64]
add esp, 0xc
jmp 0x49dc31
push ebx
call dword [sym.imp.api_ms_win_crt_convert_l1_1_0.dll__wtoi64]
add esp, 4
mov dword [esp + 0x18], eax
test eax, eax
je 0x49dd11
push 0x2e
push ebx
call dword [sym.imp.VCRUNTIME140.dll_wcsrchr]
mov esi, eax
add esp, 8
test esi, esi
je 0x49dc52
add esi, 2
mov eax, dword [esp + 0x18]
mov edi, dword [sym.imp.api_ms_win_crt_string_l1_1_0.dll__wcsicmp]
test eax, eax
jne 0x49dcba
cmp dword [esp + 0x78], 1
ja 0x49dcdf
test esi, esi
je 0x49dcba
push 0x4d7f98
push esi
call edi
add esp, 8
test eax, eax
je 0x49dcdf
push 0x4d7fa0
push esi
call edi
add esp, 8
test eax, eax
je 0x49dcdf
push 0x4db62c
push esi
call edi
add esp, 8
test eax, eax
je 0x49dcdf
push 0x4db634
push esi
call edi
add esp, 8
test eax, eax
je 0x49dcdf
push 0x4db63c
push esi
call edi
add esp, 8
test eax, eax
je 0x49dcdf
mov eax, dword [esp + 0x18]
mov byte [esp + 0x16], 0
test esi, esi
je 0x49dd60
push 0x4d7f90
push esi
call edi
add esp, 8
test eax, eax
jne 0x49dd1b
mov dword [ebp], 1
jmp 0x49dd5c
push dword [esp + 0x84]
mov edx, dword [esp + 0x7c]
mov ecx, ebx
push dword [esp + 0x74]
mov byte [esp + 0x1e], 1
push dword [esp + 0x24]
mov dword [ebp], 1
call fcn.0049e320
add esp, 0xc
mov dword [esp + 0x18], eax
cmp eax, 2
jae 0x49dd60
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x5c
ret
push 0x4db644
push esi
call edi
add esp, 8
test eax, eax
je 0x49dd55
push 0x4db64c
push esi
call edi
add esp, 8
test eax, eax
je 0x49dd55
push 0x4db654
push esi
call edi
add esp, 8
test eax, eax
mov eax, dword [esp + 0x18]
jne 0x49dd60
mov dword [ebp], 0
jmp 0x49dd60
mov dword [ebp], 2
mov eax, dword [esp + 0x18]
mov edx, dword [esp + 0x1c]
mov ecx, dword [esp + 0x70]
cmp edx, 0xffffffff
je 0x49dd72
cmp ecx, 0xffffffff
jne 0x49dd86
test edx, edx
je 0x49dd7a
test ecx, ecx
jne 0x49dd86
xor ecx, ecx
xor edx, edx
mov dword [esp + 0x70], ecx
mov dword [esp + 0x1c], edx
cmp edx, 0xffffffff
je 0x49dd95
mov byte [esp + 0x74], 0
cmp ecx, 0xffffffff
jne 0x49dd9a
mov byte [esp + 0x74], 1
xor ecx, ecx
mov dword [esp + 0x28], ecx
mov cl, byte [esp + 0x7c]
mov dword [esp + 0x24], ecx
test cl, cl
je 0x49dddf
push str.gdiplus
call dword [sym.imp.KERNEL32.dll_LoadLibraryW]
mov edx, dword [esp + 0x1c]
mov ecx, eax
mov dword [esp + 0x28], eax
mov eax, dword [esp + 0x24]
movzx eax, al
mov dword [esp + 0x24], eax
xor eax, eax
test ecx, ecx
mov ecx, dword [esp + 0x24]
cmove ecx, eax
mov eax, dword [esp + 0x18]
mov dword [esp + 0x24], ecx
test eax, eax
jne 0x49de8e
cmp dword [ebp], 0xffffffff
jle 0x49de8e
test cl, cl
jne 0x49de8e
mov cl, byte [esp + 0x74]
push 0x2010
test cl, cl
cmove eax, dword [esp + 0x74]
push eax
xor eax, eax
test cl, cl
cmove eax, edx
push eax
push dword [ebp]
push ebx
push 0
call dword [sym.imp.USER32.dll_LoadImageW]
mov dword [esp + 0x18], eax
test eax, eax
je 0x49de3c
cmp byte [esp + 0x74], 0
jne 0x49de8e
cmp dword [esp + 0x78], 0
jne 0x49de8e
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 0x49dd11
mov eax, dword [esp + 0x78]
test eax, eax
jle 0x49de8a
push dword [esp + 0x84]
mov edx, eax
mov ecx, ebx
push dword [esp + 0x74]
push dword [esp + 0x24]
call fcn.0049e320
add esp, 0xc
mov dword [esp + 0x18], eax
cmp eax, 2
jb 0x49dd11
mov byte [esp + 0x16], 1
mov dword [ebp], 1
jmp 0x49de8e
mov eax, dword [esp + 0x18]
mov dword [esp + 0x20], 0
test eax, eax
jne 0x49e0d5
mov dword [ebp], eax
cmp byte [esp + 0x24], al
jne 0x49ded8
test esi, esi
je 0x49ded8
push 0x4db66c
push esi
call edi
add esp, 8
test eax, eax
je 0x49def3
push str.jpeg
push esi
call edi
add esp, 8
test eax, eax
je 0x49def3
push 0x4db680
push esi
call edi
add esp, 8
test eax, eax
je 0x49def3
mov edi, dword [esp + 0x28]
test edi, edi
jne 0x49e013
push str.gdiplus
call dword [sym.imp.KERNEL32.dll_LoadLibraryW]
mov edi, eax
jmp 0x49def7
mov edi, dword [esp + 0x28]
test edi, edi
jne 0x49e013
push edi
push edi
push 3
push edi
push edi
push connect
push ebx
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov edi, eax
cmp edi, 0xffffffff
je 0x49dd11
push 0
push edi
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 0x49df49
push edi
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 0x49df6c
push edi
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 edi
call dword [sym.imp.KERNEL32.dll_ReadFile]
push esi
call dword [sym.imp.KERNEL32.dll_GlobalUnlock]
push edi
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 0x49df5b
mov eax, dword [esp + 0x24]
test eax, eax
je 0x49df5b
lea ecx, [esp + 0x20]
push ecx
push 0x4b9af0
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 0x49dd11
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 0x49e0d5
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 edi
call esi
push str.GdiplusShutdown
push edi
mov dword [esp + 0x2c], eax
call esi
push str.GdipCreateBitmapFromFile
push edi
mov dword [esp + 0x40], eax
call esi
push str.GdipCreateHBITMAPFromBitmap
push edi
mov dword [esp + 0x34], eax
call esi
push str.GdipDisposeImage
push edi
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 0x49e0ca
push 0
lea ecx, [esp + 0x40]
push ecx
lea ecx, [esp + 0x3c]
push ecx
call eax
test eax, eax
jne 0x49e0ca
lea eax, [esp + 0x28]
push eax
push ebx
call dword [esp + 0x34]
test eax, eax
jne 0x49e0c2
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 edi
call dword [sym.imp.KERNEL32.dll_FreeLibrary]
mov eax, dword [esp + 0x18]
cmp byte [esp + 0x74], 0
je 0x49e1e3
cmp dword [ebp], 0
je 0x49e0fe
lea ecx, [esp + 0x3c]
push ecx
push eax
call dword [sym.imp.USER32.dll_GetIconInfo]
test eax, eax
je 0x49e1ff
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 0x49e155
mov eax, dword [esp + 0x54]
mov edi, dword [esp + 0x1c]
test eax, eax
je 0x49e195
movd xmm1, dword [esp + 0x58]
cvtdq2pd xmm1, xmm1
movd xmm0, eax
cvtdq2pd xmm0, xmm0
divsd xmm1, xmm0
movd xmm0, edi
cvtdq2pd xmm0, xmm0
mulsd xmm1, xmm0
addsd xmm1, qword [0x4dca98]
cvttsd2si esi, xmm1
mov dword [esp + 0x70], esi
jmp 0x49e195
mov eax, dword [esp + 0x58]
test eax, eax
je 0x49e191
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 [0x4dca98]
cvttsd2si edi, xmm1
mov dword [esp + 0x1c], edi
jmp 0x49e195
mov edi, dword [esp + 0x1c]
cmp dword [ebp], 0
je 0x49e1df
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 0x49e1df
cmp byte [esp + 0x17], 0
jne 0x49e1df
push dword [esp + 0x18]
call dword [sym.imp.USER32.dll_DestroyIcon]
push 0x10
push esi
push edi
push dword [ebp]
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]
cmp dword [esp + 0x20], 0
je 0x49e22f
mov edx, dword [esp + 0x1c]
mov ecx, dword [esp + 0x70]
test edx, edx
jne 0x49e213
test ecx, ecx
jne 0x49e213
lea esi, [edx + 4]
jmp 0x49e215
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
xor esi, esi
push esi
push ecx
push edx
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]
jmp 0x49e289
mov ebx, dword [esp + 0x1c]
mov edx, dword [esp + 0x70]
mov ecx, dword [esp + 0x80]
test ebx, ebx
jne 0x49e265
test edx, edx
jne 0x49e265
cmp byte [esp + 0x15], dl
je 0x49e250
test ecx, ecx
je 0x49e265
cmp dword [esp + 0x78], 1
jl 0x49dd13
cmp dword [ebp], 1
je 0x49dd13
cmp byte [esp + 0x15], 0
je 0x49e275
neg ecx
sbb ecx, ecx
and ecx, 4
jmp 0x49e27a
mov ecx, 0xc
push ecx
push edx
push ebx
push dword [ebp]
push eax
call dword [sym.imp.USER32.dll_CopyImage]
mov esi, eax
cmp dword [esp + 0x78], 0
jle 0x49e2ca
cmp dword [ebp], 0
jne 0x49e2ca
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 + 0x15], 0
mov edi, eax
jne 0x49e2c1
push esi
call dword [sym.imp.GDI32.dll_DeleteObject]
mov esi, edi
mov dword [ebp], 1
cmp dword [esp + 0x18], esi
je 0x49e2de
mov eax, dword [esp + 0x80]
test eax, eax
je 0x49e2de
mov byte [eax], 0
pop edi
mov eax, esi
pop esi
pop ebp
pop ebx
add esp, 0x5c
ret