Function at 0x483140
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
mov eax, dword [ebp + 0x18]
mov dword [esp + 0x10], edx
mov dword [esp + 8], 0
push ebx
mov ebx, ecx
push esi
mov esi, ebx
push edi
mov edi, dword [ebp + 0xc]
mov dword [edi], 0xffffffff
test eax, eax
je 0x48316f
mov byte [eax], 0
cmp word [ebx], 0
je 0x4832b1
push 6
push 0x4d6e78
push ebx
mov byte [esp + 0x1f], 0
mov byte [esp + 0x1c], 0
call fcn.0049f522
add esp, 0xc
test eax, eax
je 0x4831ab
push 8
push 0x4dc448
push ebx
call fcn.0049f522
add esp, 0xc
test eax, eax
jne 0x4831fc
movzx ecx, word [ebx + 0xa]
xor ebx, ebx
cmp ecx, 0x3a
mov byte [esp + 0x13], 1
setne bl
xor eax, eax
lea ebx, [ebx*4 + 0xc]
add ebx, esi
cmp ecx, 0x3a
sete al
mov dword [edi], eax
movzx eax, word [ebx]
cmp eax, 0x2a
sete byte [esp + 0x10]
jne 0x4831e9
mov eax, dword [ebp + 0x18]
add ebx, 2
test eax, eax
je 0x4831e9
mov byte [eax], 1
mov ecx, ebx
call fcn.004820d0
mov dword [esp + 0x14], eax
test eax, eax
je 0x4832b1
push 0x2e
push ebx
call fcn.0049ce8e
add esp, 8
test eax, eax
lea esi, [eax + 2]
cmove esi, eax
cmp dword [esp + 0x14], 0
jne 0x4832ba
mov eax, dword [ebp + 0x10]
cmp eax, 1
ja 0x483287
test esi, esi
je 0x4832ba
push 0x4d50b4
push esi
call fcn.0049f3a1
add esp, 8
test eax, eax
je 0x483284
push 0x4d50bc
push esi
call fcn.0049f3a1
add esp, 8
test eax, eax
je 0x483284
push 0x4dc45c
push esi
call fcn.0049f3a1
add esp, 8
test eax, eax
je 0x483284
push 0x4dc464
push esi
call fcn.0049f3a1
add esp, 8
test eax, eax
je 0x483284
push 0x4dc46c
push esi
call fcn.0049f3a1
add esp, 8
test eax, eax
jne 0x4832ba
mov eax, dword [ebp + 0x10]
push dword [ebp + 0x1c]
mov edx, eax
mov byte [esp + 0x16], 1
push dword [ebp + 8]
mov ecx, ebx
mov dword [edi], 1
push dword [esp + 0x24]
call fcn.004838e0
add esp, 0xc
mov dword [esp + 0x14], eax
cmp eax, 2
jae 0x48331d
xor eax, eax
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov byte [esp + 0x12], 0
test esi, esi
je 0x48331d
push 0x4d50ac
push esi
call fcn.0049f3a1
add esp, 8
test eax, eax
jne 0x4832dd
mov dword [edi], 1
jmp 0x48331d
push 0x4dc474
push esi
call fcn.0049f3a1
add esp, 8
test eax, eax
je 0x483317
push 0x4dc47c
push esi
call fcn.0049f3a1
add esp, 8
test eax, eax
je 0x483317
push 0x4dc484
push esi
call fcn.0049f3a1
add esp, 8
test eax, eax
jne 0x48331d
mov dword [edi], eax
jmp 0x48331d
mov dword [edi], 2
mov ecx, dword [esp + 0x1c]
mov eax, dword [ebp + 8]
cmp ecx, 0xffffffff
je 0x483332
cmp eax, 0xffffffff
jne 0x483356
test ecx, ecx
je 0x483336
test eax, eax
jne 0x48334c
mov dword [ebp + 8], 0
mov dword [esp + 0x1c], 0
mov byte [esp + 0x11], 0
jmp 0x483362
cmp ecx, 0xffffffff
je 0x48335d
cmp eax, 0xffffffff
je 0x48335d
mov byte [esp + 0x11], 0
jmp 0x483362
mov byte [esp + 0x11], 1
mov cl, byte [ebp + 0x14]
mov dword [esp + 0x18], 0
mov dword [esp + 0x24], ecx
test cl, cl
je 0x483396
push 0x4dc48c
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 0x483439
mov edx, dword [edi]
cmp edx, 0xffffffff
jle 0x483439
test cl, cl
jne 0x483439
cmp byte [esp + 0x11], cl
je 0x4833c0
xor eax, eax
xor ecx, ecx
jmp 0x4833c7
mov eax, dword [esp + 0x1c]
mov ecx, dword [ebp + 8]
push 0x2010
push ecx
push eax
push edx
push ebx
push 0
call dword [sym.imp.USER32.dll_LoadImageW]
mov dword [esp + 0x14], eax
test eax, eax
je 0x4833f4
cmp byte [esp + 0x11], 0
jne 0x483439
cmp dword [ebp + 0x10], 0
jne 0x483439
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
push ebx
call dword [sym.imp.KERNEL32.DLL_GetFileAttributesW]
cmp eax, 0xffffffff
je 0x4832b1
mov eax, dword [ebp + 0x10]
test eax, eax
jle 0x483439
push dword [ebp + 0x1c]
mov edx, eax
mov ecx, ebx
push dword [ebp + 8]
push dword [esp + 0x24]
call fcn.004838e0
add esp, 0xc
mov dword [esp + 0x14], eax
cmp eax, 2
jb 0x4832b1
mov byte [esp + 0x12], 1
mov dword [edi], 1
cmp dword [esp + 0x14], 0
mov dword [esp + 0x20], 0
jne 0x4836a2
cmp byte [esp + 0x24], 0
mov dword [edi], 0
jne 0x483493
test esi, esi
je 0x483493
push 0x4dc49c
push esi
call fcn.0049f3a1
add esp, 8
test eax, eax
je 0x4834b0
push 0x4dc4a4
push esi
call fcn.0049f3a1
add esp, 8
test eax, eax
je 0x4834b0
push 0x4dc4b0
push esi
call fcn.0049f3a1
add esp, 8
test eax, eax
je 0x4834b0
mov eax, dword [esp + 0x18]
test eax, eax
jne 0x4835d8
push 0x4dc48c
call dword [sym.imp.KERNEL32.DLL_LoadLibraryW]
mov dword [esp + 0x18], eax
jmp 0x4834b4
mov eax, dword [esp + 0x18]
test eax, eax
jne 0x4835d8
push eax
push eax
push 3
push eax
push 1
push SysReAllocString
push ebx
call dword [sym.imp.KERNEL32.DLL_CreateFileW]
mov dword [esp + 0x18], eax
cmp eax, 0xffffffff
je 0x4832b1
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 0x48350b
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 0x483530
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 0x483520
mov eax, dword [esp + 0x28]
test eax, eax
je 0x483520
lea ecx, [esp + 0x20]
push ecx
push 0x4b8904
push 0
push 0
push eax
call dword [sym.imp.OLEAUT32.dll_OleCreatePictureIndirect]
test eax, eax
jns 0x483592
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 0x4832b1
mov eax, dword [ecx]
lea edx, [esp + 0x14]
push edx
push ecx
call dword [eax + 0xc]
cmp dword [esp + 0x14], 0
jne 0x4836a2
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 0x4dc4b8
push eax
call esi
push 0x4dc4c8
push dword [esp + 0x1c]
mov dword [esp + 0x2c], eax
call esi
push 0x4dc4d8
push dword [esp + 0x1c]
mov dword [esp + 0x40], eax
call esi
push 0x4dc4f4
push dword [esp + 0x1c]
mov dword [esp + 0x34], eax
call esi
push 0x4dc510
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 0x483698
push 0
lea ecx, [esp + 0x40]
push ecx
lea ecx, [esp + 0x3c]
push ecx
call eax
test eax, eax
jne 0x483698
lea eax, [esp + 0x28]
push eax
push ebx
call dword [esp + 0x34]
test eax, eax
jne 0x483690
push 0xff000000
lea eax, [esp + 0x18]
push eax
push dword [esp + 0x30]
call dword [esp + 0x3c]
test eax, eax
je 0x48368a
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 + 0x11], 0
je 0x4837bd
cmp dword [edi], 0
jne 0x4836b8
mov eax, dword [esp + 0x14]
jmp 0x4836d3
lea eax, [esp + 0x3c]
push eax
push dword [esp + 0x18]
call dword [sym.imp.USER32.dll_GetIconInfo]
test eax, eax
je 0x4837aa
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 0x483726
mov eax, dword [esp + 0x54]
test eax, eax
je 0x483760
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 [0x4dc9e0]
cvttsd2si esi, xmm1
mov dword [ebp + 8], esi
jmp 0x483760
mov eax, dword [esp + 0x58]
test eax, eax
je 0x483760
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 [0x4dc9e0]
cvttsd2si eax, xmm1
mov dword [esp + 0x1c], eax
cmp dword [edi], 0
je 0x4837bd
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 0x4837bd
cmp byte [esp + 0x13], 0
jne 0x4837bd
push dword [esp + 0x14]
call dword [sym.imp.USER32.dll_DestroyIcon]
push 0x10
push esi
push dword [esp + 0x24]
push dword [edi]
push ebx
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 0x4837f7
mov ecx, dword [esp + 0x1c]
mov eax, dword [ebp + 8]
test ecx, ecx
jne 0x4837d8
test eax, eax
jne 0x4837d8
lea edx, [ecx + 4]
jmp 0x4837da
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 0x48384e
mov edx, dword [esp + 0x1c]
mov ecx, dword [ebp + 8]
mov bl, byte [esp + 0x10]
mov eax, dword [ebp + 0x18]
test edx, edx
jne 0x48382b
test ecx, ecx
jne 0x48382b
test bl, bl
je 0x483815
test eax, eax
je 0x48382f
cmp dword [ebp + 0x10], 1
jl 0x483820
cmp dword [edi], 1
jne 0x48382b
mov eax, dword [esp + 0x14]
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
test bl, bl
je 0x483838
neg eax
sbb eax, eax
and eax, 4
jmp 0x48383d
mov eax, 0xc
push eax
push ecx
push edx
push dword [edi]
push dword [esp + 0x24]
call dword [sym.imp.USER32.dll_CopyImage]
mov esi, eax
cmp dword [ebp + 0x10], 0
jle 0x48388c
cmp dword [edi], 0
jne 0x48388c
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 + 0x10], 0
mov ebx, eax
jne 0x483884
push esi
call dword [sym.imp.GDI32.dll_DeleteObject]
mov esi, ebx
mov dword [edi], 1
cmp dword [esp + 0x14], esi
je 0x48389c
mov eax, dword [ebp + 0x18]
test eax, eax
je 0x48389c
mov byte [eax], 0
pop edi
mov eax, esi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret