Function at 0x49fb70
Capabilities:
Check if file exists
Get file attributes
Get file size
Link many functions at runtime
Read file on windows

Disassembly:
mov eax, 0x1005c
call fcn.004b4520
mov eax, dword [esp + 0x10070]
mov dword [esp + 0xc], edx
mov dword [esp + 4], 0
push ebx
mov ebx, ecx
push ebp
mov ebp, ebx
push esi
mov esi, dword [esp + 0x10070]
push edi
mov dword [esi], 0xffffffff
test eax, eax
je 0x49fba9
mov byte [eax], 0
cmp byte [ebx], 0
je 0x49fd7c
mov edi, dword [sym.imp.api_ms_win_crt_multibyte_l1_1_0.dll__mbsnbicmp]
push 6
push str.hicon:
push ebx
mov byte [esp + 0x27], 0
mov byte [esp + 0x1f], 0
call edi
add esp, 0xc
test eax, eax
je 0x49fbe8
push 8
push str.hbitmap:
push ebx
call edi
add esp, 0xc
test eax, eax
jne 0x49fc8d
mov cl, byte [ebx + 5]
xor ebx, ebx
cmp cl, 0x3a
mov byte [esp + 0x1b], 1
setne bl
xor eax, eax
lea ebx, [ebx*2 + 6]
add ebx, ebp
cmp cl, 0x3a
sete al
mov dword [esi], eax
cmp byte [ebx], 0x2a
sete byte [esp + 0x13]
jne 0x49fc24
mov eax, dword [esp + 0x10080]
inc ebx
test eax, eax
je 0x49fc24
mov byte [eax], 1
mov ecx, ebx
mov al, byte [ecx]
cmp al, 0x20
je 0x49fc30
cmp al, 9
jne 0x49fc33
inc ecx
jmp 0x49fc26
test al, al
je 0x49fc77
cmp al, 0x2d
je 0x49fc3f
cmp al, 0x2b
jne 0x49fc46
lea eax, [ecx + 1]
mov ecx, eax
mov al, byte [eax]
cmp al, 0x30
jne 0x49fc77
mov al, byte [ecx + 1]
cmp al, 0x78
je 0x49fc55
cmp al, 0x58
jne 0x49fc77
movsx eax, byte [ecx + 2]
push eax
call dword [sym.imp.api_ms_win_crt_string_l1_1_0.dll_isxdigit]
add esp, 4
test eax, eax
je 0x49fc77
push 0x10
push 0
push ebx
call dword [sym.imp.api_ms_win_crt_convert_l1_1_0.dll__strtoi64]
add esp, 0xc
jmp 0x49fc81
push ebx
call dword [sym.imp.api_ms_win_crt_convert_l1_1_0.dll__atoi64]
add esp, 4
mov dword [esp + 0x14], eax
test eax, eax
je 0x49fd7c
push 0x2e
push ebx
call dword [sym.imp.api_ms_win_crt_multibyte_l1_1_0.dll__mbsrchr]
mov esi, eax
add esp, 8
test esi, esi
je 0x49fca0
inc esi
mov eax, dword [esp + 0x14]
mov ebp, dword [esp + 0x10070]
mov edi, dword [sym.imp.api_ms_win_crt_multibyte_l1_1_0.dll__mbsicmp]
test eax, eax
jne 0x49fd16
cmp dword [esp + 0x10078], 1
ja 0x49fd44
test esi, esi
je 0x49fd16
push 0x4bbd18
push esi
call edi
add esp, 8
test eax, eax
je 0x49fd44
push 0x4bf3e0
push esi
call edi
add esp, 8
test eax, eax
je 0x49fd44
push 0x4c1718
push esi
call edi
add esp, 8
test eax, eax
je 0x49fd44
push 0x4c171c
push esi
call edi
add esp, 8
test eax, eax
je 0x49fd44
push 0x4c1720
push esi
call edi
add esp, 8
test eax, eax
je 0x49fd44
mov eax, dword [esp + 0x14]
mov byte [esp + 0x1a], 0
test esi, esi
je 0x49fdd6
push 0x4bf3dc
push esi
call edi
add esp, 8
test eax, eax
jne 0x49fd89
mov eax, dword [esp + 0x10074]
mov dword [eax], 1
jmp 0x49fdd2
push dword [esp + 0x10084]
mov eax, dword [esp + 0x10078]
mov ecx, ebx
mov edx, dword [esp + 0x1007c]
push ebp
push dword [esp + 0x24]
mov byte [esp + 0x26], 1
mov dword [eax], 1
call fcn.004a03c0
add esp, 0xc
mov dword [esp + 0x14], eax
cmp eax, 2
jae 0x49fdd6
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x1005c
ret
push 0x4c1724
push esi
call edi
add esp, 8
test eax, eax
je 0x49fdc5
push 0x4c1728
push esi
call edi
add esp, 8
test eax, eax
je 0x49fdc5
push 0x4c172c
push esi
call edi
add esp, 8
test eax, eax
jne 0x49fdd2
mov eax, dword [esp + 0x10074]
mov dword [eax], 0
jmp 0x49fdd2
mov eax, dword [esp + 0x10074]
mov dword [eax], 2
mov eax, dword [esp + 0x14]
mov ecx, dword [esp + 0x1c]
cmp ecx, 0xffffffff
je 0x49fde8
cmp ebp, 0xffffffff
jne 0x49fe03
test ecx, ecx
je 0x49fdec
test ebp, ebp
jne 0x49fdf9
xor ebp, ebp
mov byte [esp + 0x19], 0
mov dword [esp + 0x1c], ebp
jmp 0x49fe0f
cmp ecx, 0xffffffff
je 0x49fe0a
cmp ebp, 0xffffffff
je 0x49fe0a
mov byte [esp + 0x19], 0
jmp 0x49fe0f
mov byte [esp + 0x19], 1
mov dl, byte [esp + 0x1007c]
xor ecx, ecx
mov dword [esp + 0x20], ecx
mov dword [esp + 0x24], edx
test dl, dl
je 0x49fe4b
push str.gdiplus
call dword [sym.imp.KERNEL32.dll_LoadLibraryA]
mov edx, dword [esp + 0x24]
mov ecx, eax
mov dword [esp + 0x20], eax
xor eax, eax
test ecx, ecx
movzx edx, dl
cmove edx, eax
mov eax, dword [esp + 0x14]
mov dword [esp + 0x24], edx
mov ecx, dword [esp + 0x10074]
test eax, eax
jne 0x49ff1e
mov edi, dword [ecx]
cmp edi, 0xffffffff
mov dword [esp + 0x2c], edi
mov edi, dword [sym.imp.api_ms_win_crt_multibyte_l1_1_0.dll__mbsicmp]
jle 0x49ff1e
test dl, dl
jne 0x49ff1e
cmp byte [esp + 0x19], dl
je 0x49fe81
xor ecx, ecx
jmp 0x49fe87
mov eax, dword [esp + 0x1c]
mov ecx, ebp
push 0x2010
push ecx
push eax
push dword [esp + 0x38]
push ebx
push 0
call dword [sym.imp.USER32.dll_LoadImageA]
mov dword [esp + 0x14], eax
test eax, eax
je 0x49febf
cmp byte [esp + 0x19], 0
jne 0x49ff17
cmp dword [esp + 0x10078], 0
jne 0x49ff17
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x1005c
ret
push ebx
call dword [sym.imp.KERNEL32.dll_GetFileAttributesA]
cmp eax, 0xffffffff
je 0x49fd7c
mov eax, dword [esp + 0x10078]
test eax, eax
jle 0x49ff13
push dword [esp + 0x10084]
mov edx, eax
mov ecx, ebx
push ebp
push dword [esp + 0x24]
call fcn.004a03c0
add esp, 0xc
mov dword [esp + 0x14], eax
cmp eax, 2
jb 0x49fd7c
mov ecx, dword [esp + 0x10074]
mov byte [esp + 0x1a], 1
mov dword [ecx], 1
jmp 0x49ff1e
mov eax, dword [esp + 0x14]
mov ecx, dword [esp + 0x10074]
mov dword [esp + 0x28], 0
test eax, eax
jne 0x4a0189
mov dword [ecx], eax
cmp byte [esp + 0x24], al
jne 0x49ff67
test esi, esi
je 0x49ff67
push 0x4c1738
push esi
call edi
add esp, 8
test eax, eax
je 0x49ff82
push str.jpeg
push esi
call edi
add esp, 8
test eax, eax
je 0x49ff82
push 0x4c1744
push esi
call edi
add esp, 8
test eax, eax
je 0x49ff82
mov edi, dword [esp + 0x20]
test edi, edi
jne 0x4a00ac
push str.gdiplus
call dword [sym.imp.KERNEL32.dll_LoadLibraryA]
mov edi, eax
jmp 0x49ff86
mov edi, dword [esp + 0x20]
test edi, edi
jne 0x4a00ac
push edi
push edi
push 3
push edi
push 1
push SysReAllocString
push ebx
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov edi, eax
cmp edi, 0xffffffff
je 0x49fd7c
push 0
push edi
call dword [sym.imp.KERNEL32.dll_GetFileSize]
push eax
push 2
mov dword [esp + 0x2c], eax
call dword [sym.imp.KERNEL32.dll_GlobalAlloc]
mov esi, eax
test esi, esi
jne 0x49ffdc
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x1005c
ret
push esi
call dword [sym.imp.KERNEL32.dll_GlobalLock]
test eax, eax
jne 0x4a0002
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, 0x1005c
ret
push 0
lea ecx, [esp + 0x28]
push ecx
push dword [esp + 0x2c]
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 + 0x20]
push eax
push 0
push esi
call dword [sym.imp.ole32.dll_CreateStreamOnHGlobal]
test eax, eax
js 0x49ffee
mov eax, dword [esp + 0x20]
test eax, eax
je 0x49ffee
lea ecx, [esp + 0x28]
push ecx
push 0x4b6a90
push 0
push 0
push eax
call dword [sym.imp.OLEAUT32.dll_OleCreatePictureIndirect]
mov ecx, dword [esp + 0x28]
xor edx, edx
test eax, eax
mov eax, dword [esp + 0x20]
push eax
cmovs ecx, edx
mov dword [esp + 0x2c], ecx
mov ecx, dword [eax]
call dword [ecx + 8]
push esi
call dword [sym.imp.KERNEL32.dll_GlobalFree]
mov ecx, dword [esp + 0x28]
test ecx, ecx
je 0x49fd7c
mov eax, dword [ecx]
lea edx, [esp + 0x14]
push edx
push ecx
call dword [eax + 0xc]
mov eax, dword [esp + 0x14]
test eax, eax
jne 0x4a0189
mov eax, dword [esp + 0x28]
push eax
mov ecx, dword [eax]
call dword [ecx + 8]
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x1005c
ret
mov esi, dword [sym.imp.KERNEL32.dll_GetProcAddress]
push str.GdiplusStartup
push edi
call esi
push str.GdiplusShutdown
push edi
mov dword [esp + 0x34], eax
call esi
push str.GdipCreateBitmapFromFile
push edi
mov dword [esp + 0x54], eax
call esi
push str.GdipCreateHBITMAPFromBitmap
push edi
mov dword [esp + 0x28], eax
call esi
push str.GdipDisposeImage
push edi
mov dword [esp + 0x4c], eax
call esi
mov esi, eax
mov dword [esp + 0x30], 1
mov eax, dword [esp + 0x2c]
mov dword [esp + 0x34], 0
mov dword [esp + 0x38], 0
mov dword [esp + 0x3c], 0
test eax, eax
je 0x4a017e
push 0
lea ecx, [esp + 0x34]
push ecx
lea ecx, [esp + 0x50]
push ecx
call eax
test eax, eax
jne 0x4a017e
push 0x8000
lea eax, [esp + 0x6c]
push eax
push 0xffffffffffffffff
push ebx
push 0
push 0
call dword [sym.imp.KERNEL32.dll_MultiByteToWideChar]
lea eax, [esp + 0x24]
push eax
lea eax, [esp + 0x6c]
push eax
call dword [esp + 0x28]
test eax, eax
jne 0x4a0176
push 0xff000000
lea eax, [esp + 0x18]
push eax
push dword [esp + 0x2c]
call dword [esp + 0x50]
mov ecx, dword [esp + 0x14]
xor edx, edx
push dword [esp + 0x24]
test eax, eax
cmovne ecx, edx
mov dword [esp + 0x18], ecx
call esi
push dword [esp + 0x48]
call dword [esp + 0x50]
push edi
call dword [sym.imp.KERNEL32.dll_FreeLibrary]
mov eax, dword [esp + 0x14]
cmp byte [esp + 0x19], 0
mov esi, dword [sym.imp.GDI32.dll_DeleteObject]
mov edi, dword [esp + 0x10074]
je 0x4a028f
cmp dword [edi], 0
je 0x4a01be
lea ecx, [esp + 0x30]
push ecx
push eax
call dword [sym.imp.USER32.dll_GetIconInfo]
test eax, eax
je 0x4a02a7
mov eax, dword [esp + 0x3c]
lea ecx, [esp + 0x50]
push ecx
push 0x18
push eax
call dword [sym.imp.GDI32.dll_GetObjectA]
cmp ebp, 0xffffffff
jne 0x4a020b
mov eax, dword [esp + 0x54]
test eax, eax
je 0x4a0245
movd xmm1, dword [esp + 0x58]
cvtdq2pd xmm1, xmm1
movd xmm0, eax
cvtdq2pd xmm0, xmm0
divsd xmm1, xmm0
movd xmm0, dword [esp + 0x1c]
cvtdq2pd xmm0, xmm0
mulsd xmm1, xmm0
addsd xmm1, qword [0x4c2310]
cvttsd2si ebp, xmm1
jmp 0x4a0245
mov eax, dword [esp + 0x58]
test eax, eax
je 0x4a0245
movd xmm1, dword [esp + 0x54]
movd xmm0, eax
cvtdq2pd xmm1, xmm1
cvtdq2pd xmm0, xmm0
divsd xmm1, xmm0
movd xmm0, ebp
cvtdq2pd xmm0, xmm0
mulsd xmm1, xmm0
addsd xmm1, qword [0x4c2310]
cvttsd2si eax, xmm1
mov dword [esp + 0x1c], eax
cmp dword [edi], 0
je 0x4a028b
push dword [esp + 0x40]
call esi
push dword [esp + 0x3c]
call esi
cmp byte [esp + 0x1a], 0
jne 0x4a028b
cmp byte [esp + 0x1b], 0
jne 0x4a028b
push dword [esp + 0x14]
call dword [sym.imp.USER32.dll_DestroyIcon]
push 0x10
push ebp
push dword [esp + 0x24]
push dword [edi]
push ebx
push 0
call dword [sym.imp.USER32.dll_LoadImageA]
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x1005c
ret
mov eax, dword [esp + 0x14]
cmp dword [esp + 0x28], 0
mov edx, dword [esp + 0x1c]
je 0x4a02da
test edx, edx
jne 0x4a02be
test ebp, ebp
jne 0x4a02be
lea ecx, [edx + 4]
jmp 0x4a02c0
push dword [esp + 0x14]
call dword [sym.imp.USER32.dll_DestroyIcon]
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x1005c
ret
xor ecx, ecx
push ecx
push ebp
push edx
push 0
push eax
call dword [sym.imp.USER32.dll_CopyImage]
mov ecx, dword [esp + 0x28]
mov esi, eax
push ecx
mov edx, dword [ecx]
call dword [edx + 8]
jmp 0x4a032c
mov bl, byte [esp + 0x13]
mov ecx, dword [esp + 0x10080]
test edx, edx
jne 0x4a030c
test ebp, ebp
jne 0x4a030c
test bl, bl
je 0x4a02f5
test ecx, ecx
je 0x4a0310
cmp dword [esp + 0x10078], 1
jl 0x49fd7e
cmp dword [edi], 1
je 0x49fd7e
test bl, bl
je 0x4a0319
neg ecx
sbb ecx, ecx
and ecx, 4
jmp 0x4a031e
mov ecx, 0xc
push ecx
push ebp
push edx
push dword [edi]
push eax
call dword [sym.imp.USER32.dll_CopyImage]
mov esi, eax
cmp dword [esp + 0x10078], 0
jle 0x4a036e
cmp dword [edi], 0
jne 0x4a036e
lea eax, [esp + 0x30]
mov dword [esp + 0x30], 1
push eax
mov dword [esp + 0x40], esi
mov dword [esp + 0x44], esi
call dword [sym.imp.USER32.dll_CreateIconIndirect]
cmp byte [esp + 0x13], 0
mov ebx, eax
jne 0x4a0366
push esi
call dword [sym.imp.GDI32.dll_DeleteObject]
mov esi, ebx
mov dword [edi], 1
cmp dword [esp + 0x14], esi
je 0x4a0382
mov eax, dword [esp + 0x10080]
test eax, eax
je 0x4a0382
mov byte [eax], 0
pop edi
mov eax, esi
pop esi
pop ebp
pop ebx
add esp, 0x1005c
ret