Function at 0x479900
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
push ebx
mov ebx, dword [esp + 0x68]
push ebp
push esi
mov esi, dword [esp + 0x7c]
mov dword [esp + 0x18], edx
mov dword [esp + 0x14], 0
mov dword [ebx], 0xffffffff
push edi
mov edi, ecx
test esi, esi
je 0x47992a
mov byte [esi], 0
cmp word [edi], 0
je 0x479abd
push 6
push str.hicon:
push edi
mov byte [esp + 0x23], 0
mov byte [esp + 0x80], 0
call fcn.00495d63
add esp, 0xc
test eax, eax
je 0x479969
push 8
push str.hbitmap:
push edi
call fcn.00495d63
add esp, 0xc
test eax, eax
jne 0x4799d8
cmp word [edi + 0xa], 0x3a
jne 0x47997d
mov dword [ebx], 1
mov eax, 0xc
jmp 0x479988
mov dword [ebx], 0
mov eax, 0x10
add edi, eax
mov byte [esp + 0x17], 1
movzx eax, word [edi]
cmp eax, 0x2a
sete byte [esp + 0x74]
cmp eax, 0x2a
jne 0x4799a9
add edi, 2
test esi, esi
je 0x4799a9
mov byte [esi], 1
mov ecx, edi
call fcn.00403e00
test al, al
je 0x4799c3
push 0x10
push 0
push edi
call fcn.00495b7d
add esp, 0xc
jmp 0x4799cc
push edi
call fcn.00495cf4
add esp, 4
mov dword [esp + 0x18], eax
test eax, eax
je 0x479abd
push 0x2e
push edi
call fcn.00492647
mov esi, eax
add esp, 8
test esi, esi
je 0x4799ec
add esi, 2
mov eax, dword [esp + 0x18]
test eax, eax
jne 0x479a61
cmp dword [esp + 0x78], 1
ja 0x479a8b
test esi, esi
je 0x479a61
push 0x4d01a4
push esi
call fcn.0049466a
add esp, 8
test eax, eax
je 0x479a8b
push 0x4d01ac
push esi
call fcn.0049466a
add esp, 8
test eax, eax
je 0x479a8b
push 0x4d2bd0
push esi
call fcn.0049466a
add esp, 8
test eax, eax
je 0x479a8b
push 0x4d2bd8
push esi
call fcn.0049466a
add esp, 8
test eax, eax
je 0x479a8b
push 0x4d2be0
push esi
call fcn.0049466a
add esp, 8
test eax, eax
je 0x479a8b
mov eax, dword [esp + 0x18]
mov byte [esp + 0x16], 0
test esi, esi
je 0x479b17
push 0x4d019c
push esi
call fcn.0049466a
add esp, 8
test eax, eax
jne 0x479ac7
mov dword [ebx], 1
jmp 0x479b13
push dword [esp + 0x84]
mov ebp, dword [esp + 0x74]
mov ecx, edi
mov edx, dword [esp + 0x7c]
push ebp
push dword [esp + 0x24]
mov byte [esp + 0x22], 1
mov dword [ebx], 1
call fcn.0047a0b0
add esp, 0xc
mov dword [esp + 0x18], eax
cmp eax, 2
jae 0x479b1b
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x5c
ret
push 0x4d2be8
push esi
call fcn.0049466a
add esp, 8
test eax, eax
je 0x479b0d
push 0x4d2bf0
push esi
call fcn.0049466a
add esp, 8
test eax, eax
je 0x479b0d
push 0x4d2bf8
push esi
call fcn.0049466a
mov ebp, dword [esp + 0x78]
add esp, 8
test eax, eax
mov eax, dword [esp + 0x18]
jne 0x479b1b
mov dword [ebx], 0
jmp 0x479b1b
mov dword [ebx], 2
mov eax, dword [esp + 0x18]
mov ebp, dword [esp + 0x70]
mov ecx, dword [esp + 0x1c]
cmp ecx, 0xffffffff
je 0x479b29
cmp ebp, 0xffffffff
jne 0x479b31
test ecx, ecx
je 0x479b42
test ebp, ebp
je 0x479b42
cmp ecx, 0xffffffff
je 0x479b3b
cmp ebp, 0xffffffff
jne 0x479b4c
mov byte [esp + 0x15], 1
jmp 0x479b51
xor ebp, ebp
mov dword [esp + 0x70], ebp
mov dword [esp + 0x1c], ebp
mov byte [esp + 0x15], 0
mov dl, byte [esp + 0x7c]
xor ecx, ecx
mov dword [esp + 0x24], ecx
mov dword [esp + 0x28], edx
test dl, dl
je 0x479b8a
push str.gdiplus
call dword [sym.imp.KERNEL32.dll_LoadLibraryW]
mov edx, dword [esp + 0x28]
mov ecx, eax
mov dword [esp + 0x24], eax
xor eax, eax
test ecx, ecx
movzx edx, dl
cmove edx, eax
mov eax, dword [esp + 0x18]
mov dword [esp + 0x28], edx
test eax, eax
jne 0x479c31
cmp dword [ebx], 0xffffffff
jle 0x479c31
test dl, dl
jne 0x479c31
cmp byte [esp + 0x15], dl
je 0x479bad
xor ecx, ecx
jmp 0x479bb3
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_LoadImageW]
mov dword [esp + 0x18], eax
test eax, eax
je 0x479be3
cmp byte [esp + 0x15], 0
jne 0x479c31
cmp dword [esp + 0x78], 0
jne 0x479c31
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x5c
ret
push edi
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
cmp eax, 0xffffffff
je 0x479abd
mov eax, dword [esp + 0x78]
test eax, eax
jle 0x479c2d
push dword [esp + 0x84]
mov edx, eax
mov ecx, edi
push ebp
push dword [esp + 0x24]
call fcn.0047a0b0
add esp, 0xc
mov dword [esp + 0x18], eax
cmp eax, 2
jb 0x479abd
mov byte [esp + 0x16], 1
mov dword [ebx], 1
jmp 0x479c31
mov eax, dword [esp + 0x18]
mov dword [esp + 0x20], 0
test eax, eax
jne 0x479e80
mov dword [ebx], eax
cmp byte [esp + 0x28], al
jne 0x479c83
test esi, esi
je 0x479c83
push 0x4d2c10
push esi
call fcn.0049466a
add esp, 8
test eax, eax
je 0x479c9e
push str.jpeg
push esi
call fcn.0049466a
add esp, 8
test eax, eax
je 0x479c9e
push 0x4d2c24
push esi
call fcn.0049466a
add esp, 8
test eax, eax
je 0x479c9e
mov ebp, dword [esp + 0x24]
test ebp, ebp
jne 0x479dbe
push str.gdiplus
call dword [sym.imp.KERNEL32.dll_LoadLibraryW]
mov ebp, eax
jmp 0x479ca2
mov ebp, dword [esp + 0x24]
test ebp, ebp
jne 0x479dbe
push ebp
push ebp
push 3
push ebp
push ebp
push closesocket
push edi
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov ebp, eax
cmp ebp, 0xffffffff
je 0x479abd
push 0
push ebp
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 0x479cf4
push ebp
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 0x479d17
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, 0x5c
ret
push 0
lea ecx, [esp + 0x2c]
push ecx
push dword [esp + 0x30]
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 + 0x24]
push eax
push 0
push esi
call dword [sym.imp.ole32.dll_CreateStreamOnHGlobal]
test eax, eax
js 0x479d06
mov eax, dword [esp + 0x24]
test eax, eax
je 0x479d06
lea ecx, [esp + 0x20]
push ecx
push 0x4ae880
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 0x479abd
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 0x479e80
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 ebp
call esi
push str.GdiplusShutdown
push ebp
mov dword [esp + 0x2c], eax
call esi
push str.GdipCreateBitmapFromFile
push ebp
mov dword [esp + 0x40], eax
call esi
push str.GdipCreateHBITMAPFromBitmap
push ebp
mov dword [esp + 0x34], eax
call esi
push str.GdipDisposeImage
push ebp
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 0x479e75
push 0
lea ecx, [esp + 0x40]
push ecx
lea ecx, [esp + 0x3c]
push ecx
call eax
test eax, eax
jne 0x479e75
lea eax, [esp + 0x28]
push eax
push edi
call dword [esp + 0x34]
test eax, eax
jne 0x479e6d
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 ebp
call dword [sym.imp.KERNEL32.dll_FreeLibrary]
mov eax, dword [esp + 0x18]
cmp byte [esp + 0x15], 0
je 0x479f9d
cmp dword [ebx], 0
je 0x479ea8
lea ecx, [esp + 0x3c]
push ecx
push eax
call dword [sym.imp.USER32.dll_GetIconInfo]
test eax, eax
je 0x479f89
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 0x479efb
mov eax, dword [esp + 0x54]
mov ebp, dword [esp + 0x1c]
test eax, eax
je 0x479f3b
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 [0x4d30c8]
cvttsd2si esi, xmm1
jmp 0x479f3b
mov eax, dword [esp + 0x58]
test eax, eax
je 0x479f37
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 [0x4d30c8]
cvttsd2si ebp, xmm1
mov dword [esp + 0x1c], ebp
jmp 0x479f3b
mov ebp, dword [esp + 0x1c]
cmp dword [ebx], 0
je 0x479f83
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 0x479f83
cmp byte [esp + 0x17], 0
jne 0x479f83
push dword [esp + 0x18]
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_LoadImageW]
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x5c
ret
mov eax, dword [esp + 0x18]
jmp 0x479fa1
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
mov esi, dword [esp + 0x70]
cmp dword [esp + 0x20], 0
je 0x479fdc
mov ecx, dword [esp + 0x1c]
test ecx, ecx
jne 0x479fb9
test esi, esi
jne 0x479fb9
lea edx, [ecx + 4]
jmp 0x479fbb
xor edx, edx
push edx
push esi
push ecx
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]
mov ebp, dword [esp + 0x80]
jmp 0x47a029
mov edx, dword [esp + 0x1c]
mov cl, byte [esp + 0x74]
mov ebp, dword [esp + 0x80]
test edx, edx
jne 0x47a007
test esi, esi
jne 0x47a007
test cl, cl
je 0x479ffb
test ebp, ebp
je 0x47a007
cmp dword [esp + 0x78], 1
jl 0x47a078
cmp dword [ebx], 1
je 0x47a078
test cl, cl
je 0x47a016
mov ecx, ebp
neg ecx
sbb ecx, ecx
and ecx, 4
jmp 0x47a01b
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 + 0x78], 0
jle 0x47a068
cmp dword [ebx], 0
jne 0x47a068
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 + 0x74], 0
mov edi, eax
jne 0x47a060
push esi
call dword [sym.imp.GDI32.dll_DeleteObject]
mov esi, edi
mov dword [ebx], 1
cmp dword [esp + 0x18], esi
je 0x47a076
test ebp, ebp
je 0x47a076
mov byte [ebp], 0
mov eax, esi
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x5c
ret