Function at 0x4058d9
Capabilities:
Check if file exists

Disassembly:
push ebp
mov ebp, esp
add esp, 0xfffffb58
push esi
push edi
xor eax, eax
mov dword [ebp - 4], eax
mov dword [0x416a0e], eax
mov dword [ebp - 8], eax
push 0x4162f6
push dword [0x4169fa]
call fcn.004130ea
push 0x4164fe
push dword [0x4169fe]
call fcn.004130ea
inc dword [0x416996]
push 0
push 0x186
call fcn.0040d931
call fcn.004096f6
test eax, eax
je 0x406541
push dword [0x4169fa]
call fcn.0040ea63
test eax, eax
je 0x405967
inc dword [0x41696e]
test word [0x416928], 0x200
je 0x405962
push 1
push dword [0x4169fa]
push 0x1f7
call fcn.00407f67
jmp 0x4064fe
cmp byte [0x4161d4], 2
je 0x4059c0
push dword [0x4169fe]
push dword [0x4169fa]
call fcn.00411140
cmp eax, 3
je 0x406541
cmp byte [0x4161fb], 0
je 0x4059c0
test word [0x416928], 0x800
je 0x4059c0
push 0x21e
push 0x20b
push 0x2000000
push 0x1ae
call fcn.0040fe51
cmp eax, 3
je 0x406541
mov ax, word [0x41692d]
mov word [0x4161d9], ax
push dword [0x4169fa]
call fcn.00408b96
test eax, eax
jne 0x405a0a
push 0
push dword [0x4169fa]
push 0x21a
push 0x207
push 0x1ab
call fcn.004098f6
cmp eax, 1
je 0x4059cc
cmp eax, 3
je 0x406541
jmp 0x4064fe
mov ax, word [0x41692d]
mov word [0x4161d9], ax
lea eax, [ebp - 0x258]
push eax
push 0x416ef0
call fcn.0041339a
cmp eax, 0xffffffff
jne 0x405a69
call sub.KERNEL32.dll_GetLastError
cmp eax, 2
je 0x40607b
push 0
push dword [0x4169fa]
push 0x21a
push 0x207
push 0x1ab
call fcn.004098f6
cmp eax, 1
je 0x405a16
cmp eax, 2
je 0x4064fe
jmp 0x406541
mov ebx, dword [0x416a0e]
shl ebx, 2
add ebx, dword [0x416a0a]
mov dword [ebx], eax
inc dword [0x416a0e]
test dword [ebp - 0x258], 0x10
je 0x405abe
lea eax, [ebp - 0x22c]
push eax
push 0x416ef8
call fcn.00413094
test eax, eax
je 0x405fe0
lea eax, [ebp - 0x22c]
push eax
push 0x416efc
call fcn.00413094
test eax, eax
je 0x405fe0
lea eax, [ebp - 0x22c]
push eax
call fcn.00406616
test eax, eax
je 0x406541
test dword [ebp - 0x258], 0x10
je 0x405b29
push dword [0x4169fa]
call fcn.0040ea63
test eax, eax
je 0x405b6c
inc dword [0x416996]
push 0
push 0
call fcn.0040d931
inc dword [0x41696e]
test word [0x416928], 0x200
je 0x405b1f
push 1
push dword [0x4169fa]
push 0x1f7
call fcn.00407f67
call fcn.004066c0
jmp 0x405fe0
push dword [0x4169fa]
call fcn.0040e7fb
test eax, eax
je 0x405b6c
inc dword [0x416992]
push 0
push 0
call fcn.0040d931
inc dword [0x416962]
test word [0x416928], 0x200
je 0x405b1f
push 1
push dword [0x4169fa]
push 0x1f6
call fcn.00407f67
jmp 0x405b1f
lea eax, [ebp - 0x22c]
push eax
call fcn.0040666b
test eax, eax
je 0x406541
mov ax, word [0x41692d]
mov word [0x4161d9], ax
lea eax, [ebp - 0x4a8]
push eax
push dword [0x4169fe]
call fcn.00412d98
cmp eax, 0xffffffff
jne 0x405be0
call sub.KERNEL32.dll_GetLastError
cmp eax, 2
je 0x405daa
push 0
push dword [0x4169fe]
push 0x21a
push 0x207
push 0x1ab
call fcn.004098f6
cmp eax, 1
je 0x405b8c
cmp eax, 2
je 0x405fc6
jmp 0x406541
push eax
call sub.KERNEL32.dll_FindClose
test dword [ebp - 0x258], 0x10
jne 0x405cef
test dword [ebp - 0x4a8], 0x10
jne 0x405c39
cmp byte [0x4161d4], 2
je 0x405fc6
lea eax, [ebp - 0x4a8]
push eax
lea eax, [ebp - 0x258]
push eax
call fcn.0040825a
cmp eax, 4
je 0x405fc6
cmp eax, 2
je 0x405fc6
jmp 0x406541
cmp byte [0x4161d4], 1
je 0x405fc6
inc dword [0x416996]
push 0
push 0x18b
call fcn.0040d931
test word [0x416928], 0x400
je 0x405cba
test word [0x416928], 8
je 0x405cba
push 0x416982
push 0x416976
push dword [0x4169fe]
call fcn.0040ebd3
test eax, eax
jne 0x405ccb
cmp byte [0x4161d2], 2
jne 0x406541
test word [0x416928], 8
je 0x406541
push 1
push dword [0x4169fe]
push 0x1ed
call fcn.00407f67
jmp 0x406541
inc dword [0x416982]
test word [0x416928], 8
je 0x405cdd
push 1
push dword [0x4169fe]
push 0x1eb
call fcn.00407f67
cmp byte [0x4161d4], 2
jne 0x405fc6
jmp 0x405eda
test dword [ebp - 0x4a8], 0x10
jne 0x405d4f
cmp byte [0x4161d4], 1
je 0x405fe0
inc dword [0x416992]
push 0
push 0x189
call fcn.0040d931
inc dword [0x416976]
test word [0x416928], 8
je 0x405d3d
push 1
push dword [0x4169fe]
push 0x1ea
call fcn.00407f67
cmp byte [0x4161d4], 2
je 0x405fe0
jmp 0x405f22
mov ecx, dword [0x416a06]
cmp dword [0x416a0e], ecx
jb 0x405da5
add ecx, 4
mov dword [0x416a06], ecx
shl ecx, 2
mov byte [0x4161d1], 0xcb
push 2
push ecx
push dword [0x416a02]
call sub.KERNEL32.dll_GlobalReAlloc
test eax, eax
je 0x406541
mov dword [0x416a02], eax
mov byte [0x4161d1], 0xcc
push eax
call sub.KERNEL32.dll_GlobalLock
test eax, eax
je 0x40653a
mov dword [0x416a0a], eax
jmp 0x405911
cmp byte [0x4161d4], 2
jne 0x405dc0
cmp byte [0x416912], 0
je 0x405fc6
cmp byte [0x4161d4], 1
jne 0x405dd6
cmp byte [0x416912], 1
je 0x405fc6
cmp byte [0x416912], 2
je 0x405fc6
cmp byte [0x416912], 1
jne 0x405ece
cmp byte [0x4161d4], 1
je 0x405fc6
test dword [ebp - 0x258], 0x10
je 0x405ea2
test word [0x416928], 0x400
je 0x405e76
test word [0x416928], 0x10
je 0x405e76
push 0x41696a
push 0x41695a
push dword [0x4169fa]
call fcn.0040ebd3
test eax, eax
jne 0x405e8b
cmp byte [0x4161d2], 2
jne 0x406541
mov dword [ebp - 4], 2
test word [0x416928], 0x10
je 0x406541
push 1
push dword [0x4169fa]
push 0x1ed
call fcn.00407f67
jmp 0x406541
inc dword [0x41696a]
test word [0x416928], 0x10
je 0x405fc6
push 1
push dword [0x4169fa]
push 0x1eb
call fcn.00407f67
jmp 0x405fc6
inc dword [0x41695a]
test word [0x416928], 0x10
je 0x405fc6
push 1
push dword [0x4169fa]
push 0x1ea
call fcn.00407f67
jmp 0x405fc6
test dword [ebp - 0x258], 0x10
jne 0x405f22
inc dword [0x416972]
inc dword [0x416992]
push dword [0x4169fa]
call fcn.0040da1e
push eax
push 0x188
call fcn.0040d931
test word [0x416928], 4
je 0x405fc6
push 1
push dword [0x4169fe]
push 0x1e6
call fcn.00407f67
jmp 0x405fc6
inc dword [0x416996]
push 0
push 0x18a
call fcn.0040d931
test word [0x416928], 0x400
je 0x405fa3
test word [0x416928], 4
je 0x405fa3
push 0x41697e
push 0x416972
push dword [0x4169fe]
push dword [0x4169fa]
call fcn.0040f0f9
test eax, eax
jne 0x405fb4
cmp byte [0x4161d2], 2
je 0x406541
test word [0x416928], 4
je 0x406541
push 1
push dword [0x4169fe]
push 0x1e8
call fcn.00407f67
mov dword [ebp - 4], 2
jmp 0x406541
inc dword [0x41697e]
test word [0x416928], 4
je 0x405fc6
push 1
push dword [0x4169fe]
push 0x1e7
call fcn.00407f67
call fcn.004066c0
test eax, eax
je 0x406541
call fcn.0040670a
test eax, eax
je 0x406541
call fcn.004096f6
test eax, eax
je 0x406541
push 0
push 0x186
call fcn.0040d931
mov ax, word [0x41692d]
mov word [0x4161d9], ax
mov esi, dword [0x416a0e]
dec esi
shl esi, 2
add esi, dword [0x416a0a]
lea eax, [ebp - 0x258]
push eax
push dword [esi]
call fcn.004133c5
test eax, eax
jne 0x405a80
call sub.KERNEL32.dll_GetLastError
cmp eax, 0x12
je 0x40605f
push 0
push dword [0x4169fa]
push 0x21a
push 0x207
push 0x1ab
call fcn.004098f6
cmp eax, 1
je 0x406015
cmp eax, 3
je 0x406541
dec dword [0x416a0e]
mov esi, dword [0x416a0e]
shl esi, 2
add esi, dword [0x416a0a]
push dword [esi]
call sub.KERNEL32.dll_FindClose
mov ax, word [0x41692d]
mov word [0x4161d9], ax
push dword [0x4169fe]
call fcn.00408b96
test eax, eax
jne 0x4060c5
push 0
push dword [0x4169fe]
push 0x21a
push 0x207
push 0x1ab
call fcn.004098f6
cmp eax, 1
je 0x406087
cmp eax, 2
je 0x4064fe
jmp 0x406541
mov ax, word [0x41692d]
mov word [0x4161d9], ax
lea eax, [ebp - 0x4a8]
push eax
push 0x416ef0
call fcn.0041339a
cmp eax, 0xffffffff
jne 0x406124
call sub.KERNEL32.dll_GetLastError
cmp eax, 2
je 0x4064fe
push 0
push dword [0x4169fe]
push 0x21a
push 0x207
push 0x1ab
call fcn.004098f6
cmp eax, 1
je 0x4060d1
cmp eax, 2
je 0x4064fe
jmp 0x406541
mov dword [ebp - 8], eax
test dword [ebp - 0x4a8], 0x10
je 0x406165
lea eax, [ebp - 0x47c]
push eax
push 0x416ef8
call fcn.00413094
test eax, eax
je 0x406483
lea eax, [ebp - 0x47c]
push eax
push 0x416efc
call fcn.00413094
test eax, eax
je 0x406483
mov ax, word [0x41692d]
mov word [0x4161d9], ax
push dword [0x4169fa]
call fcn.00408b96
test eax, eax
jne 0x4061af
push 0
push dword [0x4169fa]
push 0x21a
push 0x207
push 0x1ab
call fcn.004098f6
cmp eax, 1
je 0x406171
cmp eax, 2
je 0x4064fe
jmp 0x406541
mov ax, word [0x41692d]
mov word [0x4161d9], ax
lea eax, [ebp - 0x258]
push eax
lea eax, [ebp - 0x47c]
push eax
call fcn.0041339a
cmp eax, 0xffffffff
je 0x4061de
push eax
call sub.KERNEL32.dll_FindClose
jmp 0x406483
call sub.KERNEL32.dll_GetLastError
cmp eax, 2
je 0x406217
push 0
push dword [0x4169fa]
push 0x21a
push 0x207
push 0x1ab
call fcn.004098f6
cmp eax, 1
je 0x4061bb
cmp eax, 2
je 0x4064fe
jmp 0x406541
cmp byte [0x416916], 2
je 0x406483
cmp byte [0x4161d4], 1
jne 0x40623c
cmp byte [0x416916], 1
je 0x406483
jmp 0x406253
cmp byte [0x4161d4], 2
jne 0x406253
cmp byte [0x416916], 0
jne 0x406253
jmp 0x406483
lea eax, [ebp - 0x47c]
push eax
call fcn.0040666b
test eax, eax
je 0x4064fe
test dword [ebp - 0x4a8], 0x10
jne 0x406323
cmp byte [0x416916], 1
jne 0x4062be
inc dword [0x416992]
push 0
push 0x189
call fcn.0040d931
inc dword [0x416976]
test word [0x416928], 8
je 0x406476
push 1
push dword [0x4169fe]
push 0x1ea
call fcn.00407f67
jmp 0x406476
lea eax, [ebp - 0x47c]
push eax
call fcn.00406616
test eax, eax
je 0x406541
inc dword [0x416956]
inc dword [0x416992]
push dword [0x4169fe]
call fcn.0040da1e
push eax
push 0x188
call fcn.0040d931
test word [0x416928], 0x80
je 0x406311
push 1
push dword [0x4169fa]
push 0x1e6
call fcn.00407f67
call fcn.004066c0
test eax, eax
je 0x406541
jmp 0x406476
cmp byte [0x416916], 0
jne 0x4063ea
lea eax, [ebp - 0x47c]
push eax
call fcn.00406616
test eax, eax
je 0x406541
inc dword [0x416996]
push 0
push 0x18a
call fcn.0040d931
test word [0x416928], 0x400
je 0x4063be
test word [0x416928], 0x80
je 0x4063be
push 0x416966
push 0x416956
push dword [0x4169fa]
push dword [0x4169fe]
call fcn.0040f0f9
test eax, eax
jne 0x4063c4
cmp byte [0x4161d2], 2
je 0x406541
test word [0x416928], 0x80
je 0x406541
push 1
push dword [0x4169fa]
push 0x1e8
call fcn.00407f67
jmp 0x406541
inc dword [0x416966]
test word [0x416928], 0x80
je 0x406311
push 1
push dword [0x4169fa]
push 0x1e7
call fcn.00407f67
jmp 0x406311
test word [0x416928], 0x400
je 0x406453
test word [0x416928], 8
je 0x406453
push 0x416982
push 0x416976
push dword [0x4169fe]
call fcn.0040ebd3
test eax, eax
jne 0x406464
cmp byte [0x4161d2], 2
jne 0x406541
mov dword [ebp - 4], 2
test word [0x416928], 8
je 0x406541
push 1
push dword [0x4169fe]
push 0x1ed
call fcn.00407f67
jmp 0x406541
inc dword [0x416982]
test word [0x416928], 8
je 0x406476
push 1
push dword [0x4169fe]
push 0x1eb
call fcn.00407f67
call fcn.0040670a
test eax, eax
je 0x406541
call fcn.004096f6
test eax, eax
je 0x406541
push 0
push 0x186
call fcn.0040d931
mov ax, word [0x41692d]
mov word [0x4161d9], ax
lea eax, [ebp - 0x4a8]
push eax
push dword [ebp - 8]
call fcn.004133c5
test eax, eax
jne 0x406127
call sub.KERNEL32.dll_GetLastError
cmp eax, 0x12
je 0x4064ef
push 0
push dword [0x4169fe]
push 0x21a
push 0x207
push 0x1ab
call fcn.004098f6
cmp eax, 1
je 0x4064a8
cmp eax, 3
je 0x406541
push dword [ebp - 8]
call sub.KERNEL32.dll_FindClose
mov dword [ebp - 8], 0
cmp dword [0x416a0e], 0
je 0x40651e
call fcn.004066c0
test eax, eax
je 0x406541
call fcn.0040670a
test eax, eax
je 0x406541
jmp 0x405fe0
cmp byte [0x4161d4], 1
jbe 0x406533
mov byte [0x4161d4], 1
jmp 0x405911
mov dword [ebp - 4], 1
mov eax, dword [ebp - 4]
pop edi
pop esi
leave
ret
mov esi, dword [0x416a0e]
mov edi, dword [0x416a0a]
cmp dword [ebp - 8], 0
je 0x40655b
push dword [ebp - 8]
call sub.KERNEL32.dll_FindClose
test esi, esi
je 0x40653a
dec esi
push dword [edi + esi*4]
call sub.KERNEL32.dll_FindClose
jmp 0x40655b