Function at 0x4b25e0
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 0x4b260d
mov byte [eax], 0
cmp word [ebx], 0
je 0x4b2757
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 + 0x80], 0
call esi
add esp, 0xc
test eax, eax
je 0x4b264c
push 8
push str.hbitmap:
push ebx
call esi
add esp, 0xc
test eax, eax
jne 0x4b26a2
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 + 0x74]
jne 0x4b268f
mov eax, dword [esp + 0x80]
add ebx, 2
test eax, eax
je 0x4b268f
mov byte [eax], 1
mov ecx, ebx
call fcn.004054a0
mov dword [esp + 0x18], eax
test eax, eax
je 0x4b2757
push 0x2e
push ebx
call dword [sym.imp.VCRUNTIME140.dll_wcsrchr]
mov edi, dword [sym.imp.api_ms_win_crt_string_l1_1_0.dll__wcsicmp]
add esp, 8
test eax, eax
lea esi, [eax + 2]
cmove esi, eax
cmp dword [esp + 0x18], 0
jne 0x4b2761
mov eax, dword [esp + 0x78]
cmp eax, 1
ja 0x4b2727
test esi, esi
je 0x4b2761
push 0x4ee544
push esi
call edi
add esp, 8
test eax, eax
je 0x4b2723
push 0x4ee54c
push esi
call edi
add esp, 8
test eax, eax
je 0x4b2723
push 0x4f1ad8
push esi
call edi
add esp, 8
test eax, eax
je 0x4b2723
push 0x4f1ae0
push esi
call edi
add esp, 8
test eax, eax
je 0x4b2723
push 0x4f1ae8
push esi
call edi
add esp, 8
test eax, eax
jne 0x4b2761
mov eax, dword [esp + 0x78]
push dword [esp + 0x84]
mov edx, eax
mov byte [esp + 0x1a], 1
push dword [esp + 0x74]
mov ecx, ebx
mov dword [ebp], 1
push dword [esp + 0x24]
call fcn.004b2d80
add esp, 0xc
mov dword [esp + 0x18], eax
cmp eax, 2
jae 0x4b27bb
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x5c
ret
mov byte [esp + 0x16], 0
test esi, esi
je 0x4b27bb
push 0x4ee53c
push esi
call edi
add esp, 8
test eax, eax
jne 0x4b2782
mov dword [ebp], 1
jmp 0x4b27bb
push 0x4f1af0
push esi
call edi
add esp, 8
test eax, eax
je 0x4b27b4
push 0x4f1af8
push esi
call edi
add esp, 8
test eax, eax
je 0x4b27b4
push 0x4f1b00
push esi
call edi
add esp, 8
test eax, eax
jne 0x4b27bb
mov dword [ebp], eax
jmp 0x4b27bb
mov dword [ebp], 2
mov ecx, dword [esp + 0x1c]
mov eax, dword [esp + 0x70]
cmp ecx, 0xffffffff
je 0x4b27d1
cmp eax, 0xffffffff
jne 0x4b27f6
test ecx, ecx
je 0x4b27d5
test eax, eax
jne 0x4b27ec
mov dword [esp + 0x70], 0
mov dword [esp + 0x1c], 0
mov byte [esp + 0x15], 0
jmp 0x4b2802
cmp ecx, 0xffffffff
je 0x4b27fd
cmp eax, 0xffffffff
je 0x4b27fd
mov byte [esp + 0x15], 0
jmp 0x4b2802
mov byte [esp + 0x15], 1
mov cl, byte [esp + 0x7c]
xor eax, eax
mov dword [esp + 0x24], eax
mov dword [esp + 0x28], ecx
test cl, cl
je 0x4b2835
push str.gdiplus
call dword [sym.imp.KERNEL32.dll_LoadLibraryW]
mov ecx, dword [esp + 0x28]
xor edx, edx
test eax, eax
movzx ecx, cl
mov dword [esp + 0x24], eax
cmove ecx, edx
mov dword [esp + 0x28], ecx
cmp dword [esp + 0x18], 0
jne 0x4b28e3
mov edx, dword [ebp]
cmp edx, 0xffffffff
jle 0x4b28e3
test cl, cl
jne 0x4b28e3
cmp byte [esp + 0x15], cl
je 0x4b2860
xor eax, eax
xor ecx, ecx
jmp 0x4b2868
mov eax, dword [esp + 0x1c]
mov ecx, dword [esp + 0x70]
push 0x2010
push ecx
push eax
push edx
push ebx
push 0
call dword [sym.imp.USER32.dll_LoadImageW]
mov dword [esp + 0x18], eax
test eax, eax
je 0x4b2897
cmp byte [esp + 0x15], 0
jne 0x4b28e3
cmp dword [esp + 0x78], 0
jne 0x4b28e3
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 0x4b2757
mov eax, dword [esp + 0x78]
test eax, eax
jle 0x4b28e3
push dword [esp + 0x84]
mov edx, eax
mov ecx, ebx
push dword [esp + 0x74]
push dword [esp + 0x24]
call fcn.004b2d80
add esp, 0xc
mov dword [esp + 0x18], eax
cmp eax, 2
jb 0x4b2757
mov byte [esp + 0x16], 1
mov dword [ebp], 1
cmp dword [esp + 0x18], 0
mov dword [esp + 0x20], 0
jne 0x4b2b28
cmp byte [esp + 0x28], 0
mov dword [ebp], 0
jne 0x4b2935
test esi, esi
je 0x4b2935
push 0x4f1b18
push esi
call edi
add esp, 8
test eax, eax
je 0x4b2950
push str.jpeg
push esi
call edi
add esp, 8
test eax, eax
je 0x4b2950
push 0x4f1b2c
push esi
call edi
add esp, 8
test eax, eax
je 0x4b2950
mov edi, dword [esp + 0x24]
test edi, edi
jne 0x4b2a6d
push str.gdiplus
call dword [sym.imp.KERNEL32.dll_LoadLibraryW]
mov edi, eax
jmp 0x4b2954
mov edi, dword [esp + 0x24]
test edi, edi
jne 0x4b2a6d
push edi
push edi
push 3
push edi
push 1
push closesocket
push ebx
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov edi, eax
cmp edi, 0xffffffff
je 0x4b2757
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 0x4b29a7
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 0x4b29ca
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 0x4b29b9
mov eax, dword [esp + 0x24]
test eax, eax
je 0x4b29b9
lea ecx, [esp + 0x20]
push ecx
push 0x4cfb10
push 0
push 0
push eax
call dword [sym.imp.OLEAUT32.dll_OleCreatePictureIndirect]
test eax, eax
jns 0x4b2a26
mov dword [esp + 0x20], 0
mov eax, dword [esp + 0x24]
push eax
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 0x4b2757
mov eax, dword [ecx]
lea edx, [esp + 0x18]
push edx
push ecx
call dword [eax + 0xc]
cmp dword [esp + 0x18], 0
jne 0x4b2b28
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 0x4b2b21
push 0
lea ecx, [esp + 0x40]
push ecx
lea ecx, [esp + 0x3c]
push ecx
call eax
test eax, eax
jne 0x4b2b21
lea eax, [esp + 0x28]
push eax
push ebx
call dword [esp + 0x34]
test eax, eax
jne 0x4b2b19
push 0xff000000
lea eax, [esp + 0x1c]
push eax
push dword [esp + 0x30]
call dword [esp + 0x3c]
test eax, eax
je 0x4b2b13
mov dword [esp + 0x18], 0
push dword [esp + 0x28]
call esi
push dword [esp + 0x34]
call dword [esp + 0x3c]
push edi
call dword [sym.imp.KERNEL32.dll_FreeLibrary]
cmp byte [esp + 0x15], 0
je 0x4b2c4f
cmp dword [ebp], 0
jne 0x4b2b3f
mov eax, dword [esp + 0x18]
jmp 0x4b2b5a
lea eax, [esp + 0x3c]
push eax
push dword [esp + 0x1c]
call dword [sym.imp.USER32.dll_GetIconInfo]
test eax, eax
je 0x4b2c3b
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 0x4b2bb1
mov eax, dword [esp + 0x54]
mov edi, dword [esp + 0x1c]
test eax, eax
je 0x4b2bf1
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 [0x4f2ed8]
cvttsd2si esi, xmm1
mov dword [esp + 0x70], esi
jmp 0x4b2bf1
mov eax, dword [esp + 0x58]
test eax, eax
je 0x4b2bed
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 [0x4f2ed8]
cvttsd2si edi, xmm1
mov dword [esp + 0x1c], edi
jmp 0x4b2bf1
mov edi, dword [esp + 0x1c]
cmp dword [ebp], 0
je 0x4b2c4f
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 0x4b2c4f
cmp byte [esp + 0x17], 0
jne 0x4b2c4f
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
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
cmp dword [esp + 0x20], 0
je 0x4b2c8e
mov ecx, dword [esp + 0x1c]
mov eax, dword [esp + 0x70]
test ecx, ecx
jne 0x4b2c6b
test eax, eax
jne 0x4b2c6b
lea edx, [ecx + 4]
jmp 0x4b2c6d
xor edx, edx
push edx
push eax
push ecx
push 0
push dword [esp + 0x28]
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 bl, byte [esp + 0x74]
jmp 0x4b2cee
mov edx, dword [esp + 0x1c]
mov ecx, dword [esp + 0x70]
mov bl, byte [esp + 0x74]
mov eax, dword [esp + 0x80]
test edx, edx
jne 0x4b2cca
test ecx, ecx
jne 0x4b2cca
test bl, bl
je 0x4b2cb1
test eax, eax
je 0x4b2cce
cmp dword [esp + 0x78], 1
jl 0x4b2cbe
cmp dword [ebp], 1
jne 0x4b2cca
mov eax, dword [esp + 0x18]
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x5c
ret
test bl, bl
je 0x4b2cd7
neg eax
sbb eax, eax
and eax, 4
jmp 0x4b2cdc
mov eax, 0xc
push eax
push ecx
push edx
push dword [ebp]
push dword [esp + 0x28]
call dword [sym.imp.USER32.dll_CopyImage]
mov esi, eax
cmp dword [esp + 0x78], 0
jle 0x4b2d2c
cmp dword [ebp], 0
jne 0x4b2d2c
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]
mov edi, eax
test bl, bl
jne 0x4b2d23
push esi
call dword [sym.imp.GDI32.dll_DeleteObject]
mov esi, edi
mov dword [ebp], 1
cmp dword [esp + 0x18], esi
je 0x4b2d40
mov eax, dword [esp + 0x80]
test eax, eax
je 0x4b2d40
mov byte [eax], 0
pop edi
mov eax, esi
pop esi
pop ebp
pop ebx
add esp, 0x5c
ret