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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0xa5c
mov eax, dword [0x4f3008]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
mov ebx, ecx
mov dword [ebp - 0xa4c], edx
mov ecx, dword [ebp + 0xc]
mov eax, ecx
mov edx, dword [ebp + 8]
sar eax, 0x1f
push esi
mov dword [ebp - 0xa34], eax
mov esi, ecx
movzx eax, cx
push edi
mov edi, eax
shr esi, 0x10
mov dword [ebp - 0xa58], edi
mov edi, dword [0x4fb114]
mov dword [ebp - 0xa50], ebx
mov dword [ebp - 0xa48], edx
mov dword [ebp - 0xa54], ecx
mov dword [ebp - 0xa38], edx
mov dword [ebp - 0xa44], eax
cmp si, 1
jne 0x407582
mov eax, dword [edi + ebx*4 + 0x510]
jmp 0x40758e
test si, si
jne 0x4075ac
mov eax, dword [edi + ebx*4 + 0x508]
mov eax, dword [eax + 4]
mov esi, dword [eax + 4]
test esi, esi
je 0x4075ac
mov eax, dword [ebp - 0xa44]
cwde
nop
cmp dword [esi + 8], eax
je 0x4075ae
mov esi, dword [esi + 4]
test esi, esi
jne 0x4075a0
xor esi, esi
mov ebx, dword [0x4fb0f4]
test edx, edx
jne 0x4075f4
cmp ecx, 0x20000
je 0x407a4d
test edx, edx
jne 0x4075f4
cmp ecx, 0x30000
je 0x407604
test edx, edx
jne 0x4075f4
cmp ecx, 0x40000
jne 0x4075f4
mov eax, dword [ebx]
mov ecx, ebx
call dword [eax + 0x1c]
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.004954a2
mov esp, ebp
pop ebp
ret
test esi, esi
jne 0x407655
cmp dword [ebp - 0xa50], esi
jne 0x407a4d
mov eax, dword [ebx]
mov ecx, ebx
mov esi, dword [0x4faeb4]
call dword [eax + 0x30]
mov dword [esi + 0x2e4], eax
mov ecx, ebx
mov eax, dword [ebx]
call dword [eax + 0x14]
mov eax, dword [0x4faeb4]
mov dword [esi + 0x2f4], 4
cmp dword [eax + 0x4f1d8], 0
jne 0x407a4d
mov dword [esi + 0x2f4], 2
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.004954a2
mov esp, ebp
pop ebp
ret
mov eax, dword [esi + 0x18]
mov dword [ebp - 0xa44], eax
test eax, eax
je 0x407726
cmp dword [esi + 0x24], 0
mov edi, dword [esi + 0x14]
jne 0x4076b5
mov eax, dword [0x5083f0]
cmp dword [eax + 0x48], 1
jne 0x4076b5
cmp dword [eax + 0xfc], 0
je 0x4076b5
cmp dword [esi + 0x2c], 0
lea eax, [esi + 0x2c]
jne 0x4076b3
mov edx, dword [ebp - 0xa44]
lea ecx, [ebp - 0xa34]
push ecx
push eax
mov ecx, edi
call fcn.004907d0
mov ecx, dword [ebp - 0xa54]
lea eax, [esi + 0x2c]
mov edx, dword [ebp - 0xa48]
add esp, 8
mov edi, dword [eax]
cmp dword [ebp - 0xa50], 0
jne 0x40770e
push ecx
push edx
call fcn.004074d0
add esp, 8
test eax, eax
je 0x4076e3
mov eax, dword [ebx]
mov ecx, ebx
call dword [eax + 0x3c]
cmp eax, 3
jne 0x407a4d
mov eax, dword [ebx]
mov ecx, ebx
call dword [eax + 0x14]
push dword [esi + 0x20]
mov eax, dword [ebx]
mov ecx, ebx
push dword [ebp - 0xa54]
push dword [ebp - 0xa48]
push dword [ebp - 0xa4c]
push dword [esi + 0x10]
push dword [ebp - 0xa44]
push edi
call dword [eax + 0x60]
jmp 0x407a2a
push dword [esi + 0x20]
push dword [ebp - 0xa4c]
push dword [esi + 0x10]
push dword [ebp - 0xa44]
push edi
jmp 0x407a23
mov esi, dword [ebp - 0xa50]
mov eax, dword [edi + esi*4 + 0x508]
test eax, eax
je 0x40775c
mov eax, dword [eax + 4]
mov edi, dword [eax + 4]
test edi, edi
je 0x40775c
mov ecx, dword [ebp - 0xa58]
movzx eax, cx
cwde
nop dword [eax + eax]
cmp dword [edi + 8], eax
je 0x40775e
mov edi, dword [edi + 4]
test edi, edi
jne 0x407750
xor edi, edi
cmp dword [0x508184], 0
jne 0x4077c6
mov eax, dword [0x5083f0]
cmp dword [eax + 0x48], 1
jne 0x4077c6
cmp dword [eax + 0xfc], 0
jne 0x4077c6
mov eax, dword [edi + 0xc]
mov dword [ebp - 0xa38], str.music
mov dword [ebp - 0xa34], str.sound
push dword [ebp + eax*4 - 0xa38]
lea eax, [ebp - 0x420]
push eax
call dword [sym.imp.KERNEL32.dll_lstrcpyW]
lea eax, [ebp - 0x420]
mov edx, str.Audio
push edi
push eax
lea ecx, [ebp - 0x220]
call fcn.00489e60
add esp, 8
jmp 0x4078e8
mov eax, dword [edi + 0x10]
mov ecx, dword [sym.imp.KERNEL32.dll_lstrcpyW]
mov dword [ebp - 0xa40], 0x4da3e8
mov dword [ebp - 0xa3c], 0x4da3f0
mov dword [ebp - 0xa38], 0x4da3f8
mov dword [ebp - 0xa34], 0x4da400
cmp eax, 3
jg 0x40780f
push dword [ebp + eax*4 - 0xa40]
lea eax, [ebp - 0x18]
push eax
call ecx
mov ecx, dword [sym.imp.KERNEL32.dll_lstrcpyW]
mov eax, dword [edi + 0x1c]
mov esi, dword [edi + 0xc]
mov dword [ebp - 0xa44], eax
mov eax, dword [0x4fb114]
add eax, 0x9a0
push eax
lea eax, [ebp - 0x830]
push eax
call ecx
mov dword [ebp - 0xa38], str.music
lea eax, [ebp - 0xa30]
mov dword [ebp - 0xa34], str.sound
push dword [ebp + esi*4 - 0xa38]
push eax
call dword [sym.imp.KERNEL32.dll_lstrcpyW]
mov esi, dword [sym.imp.USER32.dll_wsprintfW]
lea eax, [ebp - 0xa30]
push eax
push str.Audio
lea eax, [ebp - 0x2e8]
push 0x4d4c98
push eax
call esi
lea eax, [ebp - 0x18]
push eax
push dword [ebp - 0xa44]
lea eax, [ebp - 0x628]
push str._s._s
push eax
call esi
add esp, 0x20
lea eax, [ebp - 0x628]
cmp dword [0x4fb100], 0
push eax
lea eax, [ebp - 0x2e8]
je 0x4078c9
push dword [ebp - 0xa44]
push eax
lea eax, [ebp - 0x830]
push eax
lea eax, [ebp - 0x220]
push str._s_s_s_s
push eax
call esi
add esp, 0x18
jmp 0x4078e2
push eax
lea eax, [ebp - 0x830]
push eax
lea eax, [ebp - 0x220]
push 0x4d5148
push eax
call esi
add esp, 0x14
mov esi, dword [ebp - 0xa50]
lea eax, [ebp - 0x220]
push eax
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
cmp eax, 0xffffffff
jne 0x407916
lea ecx, [ebp - 0x220]
call fcn.00488fe0
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.004954a2
mov esp, ebp
pop ebp
ret
cmp dword [0x508184], 0
jne 0x4079cc
mov eax, dword [0x5083f0]
cmp dword [eax + 0x48], 1
jne 0x4079cc
cmp dword [eax + 0xfc], 0
jne 0x4079cc
lea ecx, [ebp - 0xa58]
push ecx
lea edx, [edi + 0x2c]
lea ecx, [ebp - 0x220]
call fcn.00490810
add esp, 4
test eax, eax
je 0x407a4d
mov ecx, dword [edi + 0x2c]
mov edx, dword [ebp - 0xa58]
mov dword [ebp - 0xa34], ecx
mov dword [ebp - 0xa44], edx
test esi, esi
jne 0x4079bd
mov esi, dword [ebp - 0xa54]
push esi
push dword [ebp - 0xa48]
call fcn.004074d0
add esp, 8
test eax, eax
jne 0x407a4d
push dword [edi + 0x20]
mov eax, dword [ebx]
mov ecx, ebx
push esi
push dword [ebp - 0xa48]
push dword [ebp - 0xa4c]
push dword [edi + 0x10]
push dword [ebp - 0xa44]
push dword [ebp - 0xa34]
call dword [eax + 0x60]
jmp 0x407a2a
push dword [edi + 0x20]
push dword [ebp - 0xa4c]
push dword [edi + 0x10]
push edx
jmp 0x407a22
test esi, esi
jne 0x407a0e
mov esi, dword [ebp - 0xa54]
push esi
push dword [ebp - 0xa48]
call fcn.004074d0
add esp, 8
test eax, eax
jne 0x407a4d
push dword [edi + 0x20]
mov eax, dword [ebx]
lea ecx, [ebp - 0x220]
push esi
push dword [ebp - 0xa48]
push dword [ebp - 0xa4c]
push dword [edi + 0x10]
push 0
push ecx
mov ecx, ebx
call dword [eax + 0x60]
jmp 0x407a2a
push dword [edi + 0x20]
lea ecx, [ebp - 0x220]
push dword [ebp - 0xa4c]
push dword [edi + 0x10]
push 0
push ecx
mov eax, dword [ebx]
mov ecx, ebx
call dword [eax + 8]
push dword [ebp - 0xa50]
mov ecx, dword [0x4faeb4]
push dword [ebp - 0xa54]
push dword [ebp - 0xa48]
lea ecx, [ecx + 0x571d0]
call fcn.004073b0
mov ecx, dword [ebp - 4]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.004954a2
mov esp, ebp
pop ebp
ret