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

Disassembly:
sub esp, 0x264
push ebx
mov ebx, dword [esp + 0x270]
push ebp
push esi
mov esi, dword [esp + 0x284]
mov dword [esp + 0x18], edx
mov dword [esp + 0x10], 0
mov dword [ebx], 0xffffffff
push edi
mov edi, ecx
test esi, esi
je 0x474073
mov byte [esi], 0
cmp byte [edi], 0
je 0x4741e2
push 6
push str.hicon:
push edi
mov byte [esp + 0x27], 0
mov byte [esp + 0x1f], 0
call fcn.0048616d
add esp, 0xc
test eax, eax
je 0x4740ae
push 8
push str.hbitmap:
push edi
call fcn.0048616d
add esp, 0xc
test eax, eax
jne 0x4740f6
cmp byte [edi + 5], 0x3a
jne 0x4740bf
mov dword [ebx], 1
add edi, 6
jmp 0x4740c8
mov dword [ebx], 0
add edi, 8
cmp byte [edi], 0x2a
mov byte [esp + 0x1b], 1
sete al
mov byte [esp + 0x13], al
test al, al
je 0x4740e3
inc edi
test esi, esi
je 0x4740e3
mov byte [esi], 1
mov ecx, edi
call fcn.00414540
mov dword [esp + 0x14], eax
test eax, eax
je 0x4741e2
push 0x2e
push edi
call fcn.00487e3e
mov esi, eax
add esp, 8
test esi, esi
je 0x474108
inc esi
mov eax, dword [esp + 0x14]
test eax, eax
jne 0x474180
cmp dword [esp + 0x280], 1
ja 0x4741aa
test esi, esi
je 0x474180
push 0x4a4344
push esi
call fcn.004855c8
add esp, 8
test eax, eax
je 0x4741aa
push 0x4a4348
push esi
call fcn.004855c8
add esp, 8
test eax, eax
je 0x4741aa
push 0x4a6260
push esi
call fcn.004855c8
add esp, 8
test eax, eax
je 0x4741aa
push 0x4a6264
push esi
call fcn.004855c8
add esp, 8
test eax, eax
je 0x4741aa
push 0x4a6268
push esi
call fcn.004855c8
add esp, 8
test eax, eax
je 0x4741aa
mov eax, dword [esp + 0x14]
mov byte [esp + 0x1a], 0
test esi, esi
je 0x474242
push 0x4a4340
push esi
call fcn.004855c8
add esp, 8
test eax, eax
jne 0x4741ef
mov dword [ebx], 1
jmp 0x47423e
push dword [esp + 0x28c]
mov ebp, dword [esp + 0x27c]
mov ecx, edi
mov edx, dword [esp + 0x284]
push ebp
push dword [esp + 0x24]
mov byte [esp + 0x26], 1
mov dword [ebx], 1
call fcn.00474830
add esp, 0xc
mov dword [esp + 0x14], eax
cmp eax, 2
jae 0x474249
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x264
ret
push 0x4a626c
push esi
call fcn.004855c8
add esp, 8
test eax, eax
je 0x474238
push 0x4a6270
push esi
call fcn.004855c8
add esp, 8
test eax, eax
je 0x474238
push 0x4a6274
push esi
call fcn.004855c8
mov ebp, dword [esp + 0x280]
add esp, 8
test eax, eax
mov eax, dword [esp + 0x14]
jne 0x474249
mov dword [ebx], 0
jmp 0x474249
mov dword [ebx], 2
mov eax, dword [esp + 0x14]
mov ebp, dword [esp + 0x278]
mov ecx, dword [esp + 0x1c]
cmp ecx, 0xffffffff
je 0x474257
cmp ebp, 0xffffffff
jne 0x47425f
test ecx, ecx
je 0x474270
test ebp, ebp
je 0x474270
cmp ecx, 0xffffffff
je 0x474269
cmp ebp, 0xffffffff
jne 0x47427d
mov byte [esp + 0x19], 1
jmp 0x474282
xor ebp, ebp
mov dword [esp + 0x278], ebp
mov dword [esp + 0x1c], ebp
mov byte [esp + 0x19], 0
mov dl, byte [esp + 0x284]
xor ecx, ecx
mov dword [esp + 0x20], ecx
mov dword [esp + 0x24], edx
test dl, dl
je 0x4742be
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
test eax, eax
jne 0x47436e
cmp dword [ebx], 0xffffffff
jle 0x47436e
test dl, dl
jne 0x47436e
cmp byte [esp + 0x19], dl
je 0x4742e1
xor ecx, ecx
jmp 0x4742e7
mov eax, dword [esp + 0x1c]
mov ecx, ebp
push 0x2010
push ecx
push eax
push dword [ebx]
push edi
push 0
call dword [sym.imp.USER32.dll_LoadImageA]
mov dword [esp + 0x14], eax
test eax, eax
je 0x47431d
cmp byte [esp + 0x19], 0
jne 0x47436e
cmp dword [esp + 0x280], 0
jne 0x47436e
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x264
ret
push edi
call dword [sym.imp.KERNEL32.dll_GetFileAttributesA]
cmp eax, 0xffffffff
je 0x4741e2
mov eax, dword [esp + 0x280]
test eax, eax
jle 0x47436a
push dword [esp + 0x28c]
mov edx, eax
mov ecx, edi
push ebp
push dword [esp + 0x24]
call fcn.00474830
add esp, 0xc
mov dword [esp + 0x14], eax
cmp eax, 2
jb 0x4741e2
mov byte [esp + 0x1a], 1
mov dword [ebx], 1
jmp 0x47436e
mov eax, dword [esp + 0x14]
mov dword [esp + 0x28], 0
test eax, eax
jne 0x4745e1
mov dword [ebx], eax
cmp byte [esp + 0x24], al
jne 0x4743c0
test esi, esi
je 0x4743c0
push 0x4a6280
push esi
call fcn.004855c8
add esp, 8
test eax, eax
je 0x4743db
push str.jpeg
push esi
call fcn.004855c8
add esp, 8
test eax, eax
je 0x4743db
push 0x4a628c
push esi
call fcn.004855c8
add esp, 8
test eax, eax
je 0x4743db
mov ebp, dword [esp + 0x20]
test ebp, ebp
jne 0x474504
push str.gdiplus
call dword [sym.imp.KERNEL32.dll_LoadLibraryA]
mov ebp, eax
jmp 0x4743df
mov ebp, dword [esp + 0x20]
test ebp, ebp
jne 0x474504
push ebp
push ebp
push 3
push ebp
push ebp
push SysReAllocString
push edi
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov ebp, eax
cmp ebp, 0xffffffff
je 0x4741e2
push 0
push ebp
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 0x474434
push ebp
call dword [sym.imp.KERNEL32.dll_CloseHandle]
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x264
ret
push esi
call dword [sym.imp.KERNEL32.dll_GlobalLock]
test eax, eax
jne 0x47445a
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, 0x264
ret
push 0
lea ecx, [esp + 0x28]
push ecx
push dword [esp + 0x2c]
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 + 0x20]
push eax
push 0
push esi
call dword [sym.imp.ole32.dll_CreateStreamOnHGlobal]
test eax, eax
js 0x474446
mov eax, dword [esp + 0x20]
test eax, eax
je 0x474446
lea ecx, [esp + 0x28]
push ecx
push 0x499880
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 0x4741e2
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 0x4745e1
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, 0x264
ret
mov esi, dword [sym.imp.KERNEL32.dll_GetProcAddress]
push str.GdiplusStartup
push ebp
call esi
push str.GdiplusShutdown
push ebp
mov dword [esp + 0x28], eax
call esi
push str.GdipCreateBitmapFromFile
push ebp
mov dword [esp + 0x54], eax
call esi
push str.GdipCreateHBITMAPFromBitmap
push ebp
mov dword [esp + 0x50], eax
call esi
push str.GdipDisposeImage
push ebp
mov dword [esp + 0x4c], eax
call esi
mov esi, eax
mov dword [esp + 0x2c], 1
mov eax, dword [esp + 0x20]
mov dword [esp + 0x30], 0
mov dword [esp + 0x34], 0
mov dword [esp + 0x38], 0
test eax, eax
je 0x4745d6
push 0
lea ecx, [esp + 0x30]
push ecx
lea ecx, [esp + 0x48]
push ecx
call eax
test eax, eax
jne 0x4745d6
push 0x104
lea eax, [esp + 0x6c]
push eax
push 0xffffffffffffffff
push edi
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 + 0x50]
test eax, eax
jne 0x4745ce
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 + 0x40]
call dword [esp + 0x50]
push ebp
call dword [sym.imp.KERNEL32.dll_FreeLibrary]
mov eax, dword [esp + 0x14]
cmp byte [esp + 0x19], 0
je 0x474707
cmp dword [ebx], 0
je 0x474609
lea ecx, [esp + 0x2c]
push ecx
push eax
call dword [sym.imp.USER32.dll_GetIconInfo]
test eax, eax
je 0x4746f0
mov eax, dword [esp + 0x38]
lea ecx, [esp + 0x50]
push ecx
push 0x18
push eax
call dword [sym.imp.GDI32.dll_GetObjectA]
mov esi, dword [esp + 0x278]
cmp esi, 0xffffffff
jne 0x47465f
mov eax, dword [esp + 0x54]
mov ebp, dword [esp + 0x1c]
test eax, eax
je 0x47469f
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 [0x4a6628]
cvttsd2si esi, xmm1
jmp 0x47469f
mov eax, dword [esp + 0x58]
test eax, eax
je 0x47469b
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 [0x4a6628]
cvttsd2si ebp, xmm1
mov dword [esp + 0x1c], ebp
jmp 0x47469f
mov ebp, dword [esp + 0x1c]
cmp dword [ebx], 0
je 0x4746ea
push dword [esp + 0x3c]
call dword [sym.imp.GDI32.dll_DeleteObject]
push dword [esp + 0x38]
call dword [sym.imp.GDI32.dll_DeleteObject]
cmp byte [esp + 0x1a], 0
jne 0x4746ea
cmp byte [esp + 0x1b], 0
jne 0x4746ea
push dword [esp + 0x14]
call dword [sym.imp.USER32.dll_DestroyIcon]
push 0x10
push esi
push ebp
push dword [ebx]
push edi
push 0
call dword [sym.imp.USER32.dll_LoadImageA]
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x264
ret
mov eax, dword [esp + 0x14]
jmp 0x47470e
push dword [esp + 0x14]
call dword [sym.imp.USER32.dll_DestroyIcon]
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x264
ret
mov esi, dword [esp + 0x278]
cmp dword [esp + 0x28], 0
je 0x474749
mov ecx, dword [esp + 0x1c]
test ecx, ecx
jne 0x474726
test esi, esi
jne 0x474726
lea edx, [ecx + 4]
jmp 0x474728
xor edx, edx
push edx
push esi
push ecx
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]
mov ebp, dword [esp + 0x288]
jmp 0x474799
mov edx, dword [esp + 0x1c]
mov cl, byte [esp + 0x13]
mov ebp, dword [esp + 0x288]
test edx, edx
jne 0x474777
test esi, esi
jne 0x474777
test cl, cl
je 0x474768
test ebp, ebp
je 0x474777
cmp dword [esp + 0x280], 1
jl 0x4747eb
cmp dword [ebx], 1
je 0x4747eb
test cl, cl
je 0x474786
mov ecx, ebp
neg ecx
sbb ecx, ecx
and ecx, 4
jmp 0x47478b
mov ecx, 0xc
push ecx
push esi
push edx
push dword [ebx]
push eax
call dword [sym.imp.USER32.dll_CopyImage]
mov esi, eax
cmp dword [esp + 0x280], 0
jle 0x4747db
cmp dword [ebx], 0
jne 0x4747db
lea eax, [esp + 0x2c]
mov dword [esp + 0x2c], 1
push eax
mov dword [esp + 0x3c], esi
mov dword [esp + 0x40], esi
call dword [sym.imp.USER32.dll_CreateIconIndirect]
cmp byte [esp + 0x13], 0
mov edi, eax
jne 0x4747d3
push esi
call dword [sym.imp.GDI32.dll_DeleteObject]
mov esi, edi
mov dword [ebx], 1
cmp dword [esp + 0x14], esi
je 0x4747e9
test ebp, ebp
je 0x4747e9
mov byte [ebp], 0
mov eax, esi
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x264
ret