Function at 0x4a2370
Capabilities:
Check if file exists
Get file attributes

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x240
mov eax, dword [0x57c06c]
xor eax, ebp
mov dword [ebp - 8], eax
push ebx
push esi
push edi
mov edi, dword [ebp + 8]
mov esi, ecx
mov dword [ebp - 0x224], esi
mov dword [ebp - 0x228], edi
test edi, edi
je 0x4a274b
cmp word [edi], 0
je 0x4a274b
lea eax, [esi + 0x5c]
xor ebx, ebx
push eax
mov dword [ebp - 0x22c], eax
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
lea eax, [esi + 0xc]
mov esi, dword [eax]
mov dword [ebp - 0x230], eax
cmp esi, dword [eax + 4]
je 0x4a23f4
nop dword [eax + eax]
mov eax, dword [esi]
push edi
push dword [eax + 0xc]
call fcn.004f89f8
add esp, 8
test eax, eax
je 0x4a23f2
mov eax, dword [ebp - 0x230]
add esi, 4
cmp esi, dword [eax + 4]
jne 0x4a23d0
jmp 0x4a23f4
mov ebx, dword [esi]
push dword [ebp - 0x22c]
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
test ebx, ebx
je 0x4a2419
mov eax, ebx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 8]
xor ecx, ebp
call fcn.004e24d7
mov esp, ebp
pop ebp
ret 4
push 0x30
call fcn.004e24e8
mov esi, eax
add esp, 4
mov ecx, esi
mov dword [ebp - 0x220], esi
call fcn.004a40a0
push 0x2e
push edi
mov dword [esi], vtable.t_cuTextureEx.0
mov dword [ebp - 0x234], esi
call fcn.004e4b65
add esp, 8
mov dword [ebp - 0x21c], eax
test eax, eax
jne 0x4a245c
mov eax, dword [esi]
mov ecx, esi
jmp 0x4a2748
push edi
call fcn.004a2200
mov ebx, eax
test ebx, ebx
jne 0x4a24fa
push 0x5613d8
push dword [ebp - 0x21c]
call fcn.004f89f8
add esp, 8
test eax, eax
jne 0x4a2493
lea ebx, [eax + 1]
xor al, al
mov byte [ebp - 0x215], al
jmp 0x4a2542
push str..png
push dword [ebp - 0x21c]
call fcn.004f89f8
add esp, 8
test eax, eax
jne 0x4a24b8
push edi
push edi
mov ecx, esi
lea ebx, [eax + 2]
call fcn.004a43c0
jmp 0x4a2534
push str..jpg
push dword [ebp - 0x21c]
call fcn.004f89f8
add esp, 8
test eax, eax
jne 0x4a24dd
push edi
push edi
mov ecx, esi
lea ebx, [eax + 3]
call fcn.004a4540
jmp 0x4a2534
push str..gif
push dword [ebp - 0x21c]
call fcn.004f89f8
add esp, 8
mov ecx, 4
test eax, eax
cmove ebx, ecx
mov byte [ebp - 0x215], 0
cmp ebx, 1
je 0x4a2542
cmp ebx, 2
jne 0x4a2516
push edi
push edi
mov ecx, esi
call fcn.004a43c0
jmp 0x4a2534
cmp ebx, 3
jne 0x4a2526
push edi
push edi
mov ecx, esi
call fcn.004a4540
jmp 0x4a2534
cmp ebx, 4
jne 0x4a2542
push edi
push edi
mov ecx, esi
call fcn.004a4180
mov byte [ebp - 0x215], al
test al, al
jne 0x4a2760
mov eax, dword [ebp - 0x224]
mov esi, dword [eax + 0x48]
cmp esi, dword [eax + 0x4c]
je 0x4a2654
mov ecx, dword [esi]
xor edi, edi
mov dword [ebp - 0x23c], ecx
mov eax, dword [ecx + 0x224]
sub eax, dword [ecx + 0x220]
sar eax, 2
mov dword [ebp - 0x238], eax
test eax, eax
jle 0x4a263c
nop dword [eax + eax]
mov eax, dword [ecx + 0x220]
push dword [ebp - 0x228]
mov eax, dword [eax + edi*4]
mov dword [ebp - 0x21c], eax
push dword [eax]
call fcn.004f89f8
add esp, 8
test eax, eax
je 0x4a25b7
mov ecx, dword [ebp - 0x23c]
inc edi
cmp edi, dword [ebp - 0x238]
jl 0x4a2580
jmp 0x4a263c
cmp ebx, 1
je 0x4a262e
cmp ebx, 2
jne 0x4a25e2
mov eax, dword [ebp - 0x21c]
mov ecx, dword [ebp - 0x220]
push dword [eax + 8]
push dword [eax + 4]
push dword [eax]
call fcn.004a4470
mov byte [ebp - 0x215], al
jmp 0x4a2634
cmp ebx, 3
jne 0x4a2608
mov eax, dword [ebp - 0x21c]
mov ecx, dword [ebp - 0x220]
push dword [eax + 8]
push dword [eax + 4]
push dword [eax]
call fcn.004a4610
mov byte [ebp - 0x215], al
jmp 0x4a2634
cmp ebx, 4
jne 0x4a262e
mov eax, dword [ebp - 0x21c]
mov ecx, dword [ebp - 0x220]
push dword [eax + 8]
push dword [eax + 4]
push dword [eax]
call fcn.004a4230
mov byte [ebp - 0x215], al
jmp 0x4a2634
mov al, byte [ebp - 0x215]
test al, al
jne 0x4a2760
mov eax, dword [ebp - 0x224]
add esi, 4
cmp esi, dword [eax + 0x4c]
jne 0x4a2554
mov edi, dword [ebp - 0x228]
push 0x208
lea eax, [ebp - 0x214]
push 0
push eax
call fcn.004e5200
mov eax, dword [ebp - 0x224]
add esp, 0xc
mov esi, dword [eax + 0x30]
cmp esi, dword [eax + 0x34]
je 0x4a2740
nop dword [eax]
push edi
push dword [esi]
lea eax, [ebp - 0x214]
push 0x5613f0
push 0x104
push eax
call fcn.0049c5d0
add esp, 0x14
xor al, al
jne 0x4a272e
lea eax, [ebp - 0x214]
push eax
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
cmp eax, 0xffffffff
je 0x4a272e
shr eax, 4
not al
and al, 1
je 0x4a272e
cmp ebx, 1
je 0x4a2724
cmp ebx, 2
jne 0x4a26e4
mov ecx, dword [ebp - 0x220]
lea eax, [ebp - 0x214]
push eax
push edi
call fcn.004a43c0
mov byte [ebp - 0x215], al
jmp 0x4a272a
cmp ebx, 3
jne 0x4a2704
mov ecx, dword [ebp - 0x220]
lea eax, [ebp - 0x214]
push eax
push edi
call fcn.004a4540
mov byte [ebp - 0x215], al
jmp 0x4a272a
cmp ebx, 4
jne 0x4a2724
mov ecx, dword [ebp - 0x220]
lea eax, [ebp - 0x214]
push eax
push edi
call fcn.004a4180
mov byte [ebp - 0x215], al
jmp 0x4a272a
mov al, byte [ebp - 0x215]
test al, al
jne 0x4a2760
mov eax, dword [ebp - 0x224]
add esi, 4
cmp esi, dword [eax + 0x34]
jne 0x4a2680
mov ecx, dword [ebp - 0x220]
mov eax, dword [ecx]
call dword [eax + 8]
xor eax, eax
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 8]
xor ecx, ebp
call fcn.004e24d7
mov esp, ebp
pop ebp
ret 4
mov ebx, dword [ebp - 0x22c]
push ebx
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov ecx, dword [ebp - 0x230]
lea eax, [ebp - 0x234]
push eax
call fcn.0040b270
push ebx
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov ecx, dword [ebp - 8]
mov eax, dword [ebp - 0x234]
xor ecx, ebp
pop edi
pop esi
pop ebx
call fcn.004e24d7
mov esp, ebp
pop ebp
ret 4