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

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x5c
push ebx
mov ebx, dword [ebp + 0xc]
push esi
mov esi, dword [ebp + 0x18]
mov dword [esp + 0x18], edx
mov dword [esp + 0x10], 0
mov dword [ebx], 0xffffffff
push edi
mov edi, ecx
test esi, esi
je 0x482ccd
mov byte [esi], 0
cmp word [edi], 0
je 0x482e0c
push 6
push str.HICON:
push edi
mov byte [esp + 0x1f], 0
mov byte [esp + 0x1d], 0
call fcn.0049ec62
add esp, 0xc
test eax, eax
je 0x482d09
push 8
push str.HBITMAP:
push edi
call fcn.0049ec62
add esp, 0xc
test eax, eax
jne 0x482d57
movzx ecx, word [edi + 0xa]
xor eax, eax
cmp ecx, 0x3a
mov byte [esp + 0x13], 1
setne al
lea eax, [eax*4 + 0xc]
add edi, eax
xor eax, eax
cmp ecx, 0x3a
sete al
mov dword [ebx], eax
movzx eax, word [edi]
cmp eax, 0x2a
sete byte [esp + 0x11]
jne 0x482d44
add edi, 2
test esi, esi
je 0x482d44
mov byte [esi], 1
mov ecx, edi
call fcn.00481c30
mov dword [esp + 0x14], eax
test eax, eax
je 0x482e0c
push 0x2e
push edi
call fcn.0049c5ce
add esp, 8
test eax, eax
lea esi, [eax + 2]
cmove esi, eax
cmp dword [esp + 0x14], 0
jne 0x482e15
mov eax, dword [ebp + 0x10]
cmp eax, 1
ja 0x482de2
test esi, esi
je 0x482e15
push 0x4d40c4
push esi
call fcn.0049eae1
add esp, 8
test eax, eax
je 0x482ddf
push 0x4d40cc
push esi
call fcn.0049eae1
add esp, 8
test eax, eax
je 0x482ddf
push 0x4db46c
push esi
call fcn.0049eae1
add esp, 8
test eax, eax
je 0x482ddf
push 0x4db474
push esi
call fcn.0049eae1
add esp, 8
test eax, eax
je 0x482ddf
push 0x4db47c
push esi
call fcn.0049eae1
add esp, 8
test eax, eax
jne 0x482e15
mov eax, dword [ebp + 0x10]
push dword [ebp + 0x1c]
mov edx, eax
mov byte [esp + 0x16], 1
push dword [ebp + 8]
mov ecx, edi
mov dword [ebx], 1
push dword [esp + 0x24]
call fcn.00483440
add esp, 0xc
mov dword [esp + 0x14], eax
cmp eax, 2
jae 0x482e78
xor eax, eax
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov byte [esp + 0x12], 0
test esi, esi
je 0x482e78
push 0x4d40bc
push esi
call fcn.0049eae1
add esp, 8
test eax, eax
jne 0x482e38
mov dword [ebx], 1
jmp 0x482e78
push 0x4db484
push esi
call fcn.0049eae1
add esp, 8
test eax, eax
je 0x482e72
push 0x4db48c
push esi
call fcn.0049eae1
add esp, 8
test eax, eax
je 0x482e72
push 0x4db494
push esi
call fcn.0049eae1
add esp, 8
test eax, eax
jne 0x482e78
mov dword [ebx], eax
jmp 0x482e78
mov dword [ebx], 2
mov ecx, dword [esp + 0x1c]
mov eax, dword [ebp + 8]
cmp ecx, 0xffffffff
je 0x482e8d
cmp eax, 0xffffffff
jne 0x482eb1
test ecx, ecx
je 0x482e91
test eax, eax
jne 0x482ea7
mov dword [ebp + 8], 0
mov dword [esp + 0x1c], 0
mov byte [esp + 0x10], 0
jmp 0x482ebd
cmp ecx, 0xffffffff
je 0x482eb8
cmp eax, 0xffffffff
je 0x482eb8
mov byte [esp + 0x10], 0
jmp 0x482ebd
mov byte [esp + 0x10], 1
mov cl, byte [ebp + 0x14]
mov dword [esp + 0x18], 0
mov dword [esp + 0x24], ecx
test cl, cl
je 0x482ef1
push str.gdiplus
call dword [sym.imp.KERNEL32.dll_LoadLibraryW]
mov ecx, dword [esp + 0x24]
xor edx, edx
test eax, eax
movzx ecx, cl
mov dword [esp + 0x18], eax
cmove ecx, edx
mov dword [esp + 0x24], ecx
cmp dword [esp + 0x14], 0
jne 0x482f94
mov edx, dword [ebx]
cmp edx, 0xffffffff
jle 0x482f94
test cl, cl
jne 0x482f94
cmp byte [esp + 0x10], cl
je 0x482f1b
xor eax, eax
xor ecx, ecx
jmp 0x482f22
mov eax, dword [esp + 0x1c]
mov ecx, dword [ebp + 8]
push 0x2010
push ecx
push eax
push edx
push edi
push 0
call dword [sym.imp.USER32.dll_LoadImageW]
mov dword [esp + 0x14], eax
test eax, eax
je 0x482f4f
cmp byte [esp + 0x10], 0
jne 0x482f94
cmp dword [ebp + 0x10], 0
jne 0x482f94
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
push edi
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
cmp eax, 0xffffffff
je 0x482e0c
mov eax, dword [ebp + 0x10]
test eax, eax
jle 0x482f94
push dword [ebp + 0x1c]
mov edx, eax
mov ecx, edi
push dword [ebp + 8]
push dword [esp + 0x24]
call fcn.00483440
add esp, 0xc
mov dword [esp + 0x14], eax
cmp eax, 2
jb 0x482e0c
mov byte [esp + 0x12], 1
mov dword [ebx], 1
cmp dword [esp + 0x14], 0
mov dword [esp + 0x20], 0
jne 0x4831fd
cmp byte [esp + 0x24], 0
mov dword [ebx], 0
jne 0x482fee
test esi, esi
je 0x482fee
push 0x4db4ac
push esi
call fcn.0049eae1
add esp, 8
test eax, eax
je 0x48300b
push str.jpeg
push esi
call fcn.0049eae1
add esp, 8
test eax, eax
je 0x48300b
push 0x4db4c0
push esi
call fcn.0049eae1
add esp, 8
test eax, eax
je 0x48300b
mov eax, dword [esp + 0x18]
test eax, eax
jne 0x483133
push str.gdiplus
call dword [sym.imp.KERNEL32.dll_LoadLibraryW]
mov dword [esp + 0x18], eax
jmp 0x48300f
mov eax, dword [esp + 0x18]
test eax, eax
jne 0x483133
push eax
push eax
push 3
push eax
push 1
push connect
push edi
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov dword [esp + 0x18], eax
cmp eax, 0xffffffff
je 0x482e0c
push 0
push eax
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 0x483066
push dword [esp + 0x18]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
xor eax, eax
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
push esi
call dword [sym.imp.KERNEL32.dll_GlobalLock]
test eax, eax
jne 0x48308b
push dword [esp + 0x18]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push esi
call dword [sym.imp.KERNEL32.dll_GlobalFree]
xor eax, eax
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
push 0
lea ecx, [esp + 0x28]
push ecx
push dword [esp + 0x2c]
push eax
push dword [esp + 0x28]
call dword [sym.imp.KERNEL32.dll_ReadFile]
push esi
call dword [sym.imp.KERNEL32.dll_GlobalUnlock]
push dword [esp + 0x18]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
lea eax, [esp + 0x28]
push eax
push 0
push esi
call dword [sym.imp.ole32.dll_CreateStreamOnHGlobal]
test eax, eax
js 0x48307b
mov eax, dword [esp + 0x28]
test eax, eax
je 0x48307b
lea ecx, [esp + 0x20]
push ecx
push 0x4b7914
push 0
push 0
push eax
call dword [sym.imp.OLEAUT32.dll_OleCreatePictureIndirect]
test eax, eax
jns 0x4830ed
mov dword [esp + 0x20], 0
mov eax, dword [esp + 0x28]
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 0x482e0c
mov eax, dword [ecx]
lea edx, [esp + 0x14]
push edx
push ecx
call dword [eax + 0xc]
cmp dword [esp + 0x14], 0
jne 0x4831fd
mov eax, dword [esp + 0x20]
push eax
mov ecx, dword [eax]
call dword [ecx + 8]
xor eax, eax
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov esi, dword [sym.imp.KERNEL32.dll_GetProcAddress]
push str.GdiplusStartup
push eax
call esi
push str.GdiplusShutdown
push dword [esp + 0x1c]
mov dword [esp + 0x2c], eax
call esi
push str.GdipCreateBitmapFromFile
push dword [esp + 0x1c]
mov dword [esp + 0x40], eax
call esi
push str.GdipCreateHBITMAPFromBitmap
push dword [esp + 0x1c]
mov dword [esp + 0x34], eax
call esi
push str.GdipDisposeImage
push dword [esp + 0x1c]
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 0x4831f3
push 0
lea ecx, [esp + 0x40]
push ecx
lea ecx, [esp + 0x3c]
push ecx
call eax
test eax, eax
jne 0x4831f3
lea eax, [esp + 0x28]
push eax
push edi
call dword [esp + 0x34]
test eax, eax
jne 0x4831eb
push 0xff000000
lea eax, [esp + 0x18]
push eax
push dword [esp + 0x30]
call dword [esp + 0x3c]
test eax, eax
je 0x4831e5
mov dword [esp + 0x14], 0
push dword [esp + 0x28]
call esi
push dword [esp + 0x34]
call dword [esp + 0x3c]
push dword [esp + 0x18]
call dword [sym.imp.KERNEL32.dll_FreeLibrary]
cmp byte [esp + 0x10], 0
je 0x483318
cmp dword [ebx], 0
jne 0x483213
mov eax, dword [esp + 0x14]
jmp 0x48322e
lea eax, [esp + 0x3c]
push eax
push dword [esp + 0x18]
call dword [sym.imp.USER32.dll_GetIconInfo]
test eax, eax
je 0x483305
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 [ebp + 8]
cmp esi, 0xffffffff
jne 0x483281
mov eax, dword [esp + 0x54]
test eax, eax
je 0x4832bb
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 [0x4db9f0]
cvttsd2si esi, xmm1
mov dword [ebp + 8], esi
jmp 0x4832bb
mov eax, dword [esp + 0x58]
test eax, eax
je 0x4832bb
movd xmm1, dword [esp + 0x54]
movd xmm0, eax
cvtdq2pd xmm1, xmm1
cvtdq2pd xmm0, xmm0
divsd xmm1, xmm0
movd xmm0, esi
cvtdq2pd xmm0, xmm0
mulsd xmm1, xmm0
addsd xmm1, qword [0x4db9f0]
cvttsd2si eax, xmm1
mov dword [esp + 0x1c], eax
cmp dword [ebx], 0
je 0x483318
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 + 0x12], 0
jne 0x483318
cmp byte [esp + 0x13], 0
jne 0x483318
push dword [esp + 0x14]
call dword [sym.imp.USER32.dll_DestroyIcon]
push 0x10
push esi
push dword [esp + 0x24]
push dword [ebx]
push edi
push 0
call dword [sym.imp.USER32.dll_LoadImageW]
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
push dword [esp + 0x14]
call dword [sym.imp.USER32.dll_DestroyIcon]
xor eax, eax
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
cmp dword [esp + 0x20], 0
je 0x483352
mov ecx, dword [esp + 0x1c]
mov eax, dword [ebp + 8]
test ecx, ecx
jne 0x483333
test eax, eax
jne 0x483333
lea edx, [ecx + 4]
jmp 0x483335
xor edx, edx
push edx
push eax
push ecx
push 0
push dword [esp + 0x24]
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 0x4833aa
mov edx, dword [esp + 0x1c]
mov ecx, dword [ebp + 8]
mov eax, dword [ebp + 0x18]
test edx, edx
jne 0x483384
test ecx, ecx
jne 0x483384
cmp byte [esp + 0x11], cl
je 0x48336e
test eax, eax
je 0x48338b
cmp dword [ebp + 0x10], 1
jl 0x483379
cmp dword [ebx], 1
jne 0x483384
mov eax, dword [esp + 0x14]
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
cmp byte [esp + 0x11], 0
je 0x483394
neg eax
sbb eax, eax
and eax, 4
jmp 0x483399
mov eax, 0xc
push eax
push ecx
push edx
push dword [ebx]
push dword [esp + 0x24]
call dword [sym.imp.USER32.dll_CopyImage]
mov esi, eax
cmp dword [ebp + 0x10], 0
jle 0x4833e8
cmp dword [ebx], 0
jne 0x4833e8
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 + 0x11], 0
mov edi, eax
jne 0x4833e0
push esi
call dword [sym.imp.GDI32.dll_DeleteObject]
mov esi, edi
mov dword [ebx], 1
cmp dword [esp + 0x14], esi
je 0x4833f8
mov eax, dword [ebp + 0x18]
test eax, eax
je 0x4833f8
mov byte [eax], 0
pop edi
mov eax, esi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret