Function at 0x40f0f9
Capabilities:
Check if file exists

Disassembly:
push ebp
mov ebp, esp
add esp, 0xfffffd70
push esi
push edi
mov dword [ebp - 0x290], 0
mov ax, word [0x41692d]
mov word [0x4161d9], ax
mov dword [ebp - 0x27c], 0
push dword [ebp + 8]
call fcn.00412a16
test eax, eax
jne 0x40f165
push 0
push dword [0x4169fa]
push 0x21a
push 0x207
push 0x1ab
call fcn.004098f6
cmp eax, 1
je 0x40f124
cmp eax, 3
je 0x40f791
inc dword [ebp - 0x290]
jmp 0x40f791
push dword [ebp + 0xc]
call fcn.00413140
shl eax, 1
mov dword [ebp - 0x20], eax
add eax, 0x208
mov dword [ebp - 0xc], eax
mov byte [0x4161d1], 0xcb
push dword [ebp - 0xc]
push 2
call sub.KERNEL32.dll_GlobalAlloc
test eax, eax
je 0x40f791
mov dword [ebp - 4], eax
mov byte [0x4161d1], 0xcc
push eax
call sub.KERNEL32.dll_GlobalLock
test eax, eax
je 0x40f789
mov dword [ebp - 8], eax
push dword [ebp + 8]
call fcn.00413140
shl eax, 1
mov dword [ebp - 0x1c], eax
add eax, 0x208
mov dword [ebp - 0x18], eax
mov byte [0x4161d1], 0xcb
push dword [ebp - 0x18]
push 2
call sub.KERNEL32.dll_GlobalAlloc
test eax, eax
je 0x40f781
mov dword [ebp - 0x10], eax
mov byte [0x4161d1], 0xcc
push eax
call sub.KERNEL32.dll_GlobalLock
test eax, eax
je 0x40f779
mov dword [ebp - 0x14], eax
mov byte [0x4161d1], 0xcb
mov dword [ebp - 0x288], 8
push 0x20
push 2
call sub.KERNEL32.dll_GlobalAlloc
test eax, eax
je 0x40f771
mov dword [ebp - 0x280], eax
mov byte [0x4161d1], 0xcc
push eax
call sub.KERNEL32.dll_GlobalLock
test eax, eax
je 0x40f766
mov dword [ebp - 0x284], eax
mov dword [ebp - 0x27c], 0
push dword [ebp + 0xc]
push dword [ebp - 8]
call fcn.004130ea
mov esi, dword [ebp + 0x14]
inc dword [esi]
push 1
push dword [ebp - 8]
push 0x1e9
call fcn.00407f67
mov ax, word [0x41692d]
mov word [0x4161d9], ax
lea eax, [ebp - 0x278]
push eax
push 0x416ef0
call fcn.0041339a
cmp eax, 0xffffffff
jne 0x40f2d2
call sub.KERNEL32.dll_GetLastError
cmp eax, 2
je 0x40f736
push 0
push dword [ebp - 8]
push 0x21a
push 0x207
push 0x1ab
call fcn.004098f6
cmp eax, 1
je 0x40f26f
cmp eax, 3
je 0x40f82a
cmp dword [ebp - 0x27c], 0
jne 0x40f736
inc dword [ebp - 0x290]
jmp 0x40f736
mov dword [ebp - 0x28], eax
call fcn.004096f6
test eax, eax
je 0x40f822
test dword [ebp - 0x278], 0x10
je 0x40f559
lea eax, [ebp - 0x24c]
push eax
push 0x416efc
call fcn.00413094
test eax, eax
je 0x40f6ca
lea eax, [ebp - 0x24c]
push eax
push 0x416ef8
call fcn.00413094
test eax, eax
je 0x40f6ca
push dword [ebp - 8]
call fcn.00413140
mov esi, eax
lea eax, [ebp - 0x24c]
push eax
call fcn.00413140
add esi, eax
add esi, 2
shl esi, 1
cmp dword [ebp - 0xc], esi
jae 0x40f380
mov dword [ebp - 0xc], esi
mov byte [0x4161d1], 0xcb
push 2
push dword [ebp - 0xc]
push dword [ebp - 4]
call sub.KERNEL32.dll_GlobalReAlloc
test eax, eax
je 0x40f822
mov dword [ebp - 4], eax
mov byte [0x4161d1], 0xcc
push eax
call sub.KERNEL32.dll_GlobalLock
test eax, eax
je 0x40f822
mov dword [ebp - 8], eax
push 0x416eec
push dword [ebp - 8]
call fcn.00413115
lea eax, [ebp - 0x24c]
push eax
push dword [ebp - 8]
call fcn.00413115
inc dword [0x416996]
push 0
push 0
call fcn.0040d931
sub esi, dword [ebp - 0x20]
add esi, dword [ebp - 0x1c]
cmp dword [ebp - 0x18], esi
jae 0x40f3f0
mov dword [ebp - 0x18], esi
mov byte [0x4161d1], 0xcb
push 2
push dword [ebp - 0x18]
push dword [ebp - 0x10]
call sub.KERNEL32.dll_GlobalReAlloc
test eax, eax
je 0x40f822
mov dword [ebp - 0x10], eax
mov byte [0x4161d1], 0xcc
push eax
call sub.KERNEL32.dll_GlobalLock
test eax, eax
je 0x40f822
mov dword [ebp - 0x14], eax
push dword [ebp + 8]
push dword [ebp - 0x14]
call fcn.004130ea
mov edi, dword [ebp - 0x1c]
mov esi, dword [ebp - 0x20]
add edi, dword [ebp - 0x14]
add esi, dword [ebp - 8]
push esi
push edi
call fcn.004130ea
push dword [ebp - 0x14]
call fcn.0040ea63
test eax, eax
je 0x40f463
inc dword [0x41696e]
test word [0x416928], 0x200
je 0x40f43a
push 1
push dword [ebp - 0x14]
push 0x1f7
call fcn.00407f67
push dword [ebp - 8]
call fcn.00413140
mov ecx, eax
pushfd
std
shl eax, 1
mov edi, dword [ebp - 8]
add edi, eax
dec edi
dec edi
mov ax, 0x5c
repne scasw ax, word es:[edi]
popfd
inc edi
inc edi
mov word [edi], 0
jmp 0x40f6ca
mov esi, dword [ebp + 0x14]
inc dword [esi]
push 0
push 0x18a
call fcn.0040d931
push 1
push dword [ebp - 8]
push 0x1e9
call fcn.00407f67
mov ax, word [0x41692d]
mov word [0x4161d9], ax
lea eax, [ebp - 0x24c]
push eax
call fcn.00412a16
test eax, eax
jne 0x40f4de
push 0
push dword [ebp - 8]
push 0x21a
push 0x207
push 0x1ab
call fcn.004098f6
cmp eax, 1
je 0x40f48f
cmp eax, 3
je 0x40f822
cmp dword [ebp - 0x27c], 0
jne 0x40f43a
inc dword [ebp - 0x290]
jmp 0x40f43a
mov eax, dword [ebp - 0x288]
cmp dword [ebp - 0x27c], eax
jb 0x40f53a
mov byte [0x4161d1], 0xcb
add dword [ebp - 0x288], 4
mov ebx, dword [ebp - 0x288]
shl ebx, 2
push 2
push ebx
push dword [ebp - 0x280]
call sub.KERNEL32.dll_GlobalReAlloc
test eax, eax
je 0x40f822
mov dword [ebp - 0x280], eax
mov byte [0x4161d1], 0xcc
push eax
call sub.KERNEL32.dll_GlobalLock
test eax, eax
je 0x40f822
mov dword [ebp - 0x284], eax
mov ebx, dword [ebp - 0x27c]
shl ebx, 2
mov ecx, dword [ebp - 0x28]
add ebx, dword [ebp - 0x284]
mov dword [ebx], ecx
inc dword [ebp - 0x27c]
jmp 0x40f263
inc dword [0x416992]
push 0
push 0x18c
call fcn.0040d931
push dword [ebp - 8]
call fcn.00413140
mov esi, eax
lea eax, [ebp - 0x24c]
push eax
call fcn.00413140
add esi, eax
add esi, 2
shl esi, 1
cmp dword [ebp - 0xc], esi
jae 0x40f5c7
mov dword [ebp - 0xc], esi
mov byte [0x4161d1], 0xcb
push 2
push dword [ebp - 0xc]
push dword [ebp - 4]
call sub.KERNEL32.dll_GlobalReAlloc
test eax, eax
je 0x40f822
mov dword [ebp - 4], eax
mov byte [0x4161d1], 0xcc
push eax
call sub.KERNEL32.dll_GlobalLock
test eax, eax
je 0x40f822
mov dword [ebp - 8], eax
push 0x416eec
push dword [ebp - 8]
call fcn.00413115
lea eax, [ebp - 0x24c]
push eax
push dword [ebp - 8]
call fcn.00413115
sub esi, dword [ebp - 0x20]
add esi, dword [ebp - 0x1c]
cmp dword [ebp - 0x18], esi
jae 0x40f628
mov dword [ebp - 0x18], esi
mov byte [0x4161d1], 0xcb
push 2
push dword [ebp - 0x18]
push dword [ebp - 0x10]
call sub.KERNEL32.dll_GlobalReAlloc
test eax, eax
je 0x40f822
mov dword [ebp - 0x10], eax
mov byte [0x4161d1], 0xcc
push eax
call sub.KERNEL32.dll_GlobalLock
test eax, eax
je 0x40f822
mov dword [ebp - 0x14], eax
push dword [ebp + 8]
push dword [ebp - 0x14]
call fcn.004130ea
mov edi, dword [ebp - 0x1c]
mov esi, dword [ebp - 0x20]
add edi, dword [ebp - 0x14]
add esi, dword [ebp - 8]
push esi
push edi
call fcn.004130ea
push dword [ebp - 0x14]
call fcn.0040da1e
mov dword [ebp - 0x28c], eax
push dword [ebp - 0x14]
call fcn.0040e7fb
test eax, eax
je 0x40f682
inc dword [0x416962]
test word [0x416928], 0x200
je 0x40f6a6
push 1
push dword [ebp - 0x14]
push 0x1f6
call fcn.00407f67
jmp 0x40f6a6
mov esi, dword [ebp + 0x10]
inc dword [esi]
push dword [ebp - 0x28c]
push 0x188
call fcn.0040d931
push 1
push dword [ebp - 8]
push 0x1e6
call fcn.00407f67
push dword [ebp - 8]
call fcn.00413140
mov ecx, eax
pushfd
std
shl eax, 1
mov edi, dword [ebp - 8]
add edi, eax
dec edi
dec edi
mov ax, 0x5c
repne scasw ax, word es:[edi]
popfd
inc edi
inc edi
mov word [edi], 0
call fcn.004096f6
test eax, eax
je 0x40f822
mov ax, word [0x41692d]
mov word [0x4161d9], ax
lea eax, [ebp - 0x278]
push eax
push dword [ebp - 0x28]
call fcn.004133c5
test eax, eax
jne 0x40f2d5
call sub.KERNEL32.dll_GetLastError
cmp eax, 0x12
je 0x40f72e
push 0
push dword [0x4169fe]
push 0x21a
push 0x207
push 0x1ab
call fcn.004098f6
cmp eax, 1
je 0x40f6e3
cmp eax, 3
je 0x40f822
push dword [ebp - 0x28]
call sub.KERNEL32.dll_FindClose
push 0x416efc
call fcn.00412a16
test eax, eax
je 0x40f822
cmp dword [ebp - 0x27c], 0
jne 0x40f79d
mov dword [ebp - 0x290], 1
push dword [ebp - 0x280]
call sub.KERNEL32.dll_GlobalUnlock
push dword [ebp - 0x280]
call sub.KERNEL32.dll_GlobalFree
push dword [ebp - 0x10]
call sub.KERNEL32.dll_GlobalUnlock
push dword [ebp - 0x10]
call sub.KERNEL32.dll_GlobalFree
push dword [ebp - 4]
call sub.KERNEL32.dll_GlobalUnlock
push dword [ebp - 4]
call sub.KERNEL32.dll_GlobalFree
mov eax, dword [ebp - 0x290]
pop edi
pop esi
leave
ret 0x10
dec dword [ebp - 0x27c]
mov ebx, dword [ebp - 0x27c]
shl ebx, 2
add ebx, dword [ebp - 0x284]
mov eax, dword [ebx]
mov dword [ebp - 0x28], eax
push dword [ebp - 8]
call fcn.00413140
mov ecx, eax
pushfd
std
shl eax, 1
mov edi, dword [ebp - 8]
add edi, eax
dec edi
dec edi
mov ax, 0x5c
repne scasw ax, word es:[edi]
popfd
inc edi
inc edi
mov word [edi], 0
mov eax, dword [ebp - 0xc]
sub eax, ecx
sub eax, 0x410
jb 0x40f6ca
sub dword [ebp - 0xc], eax
mov byte [0x4161d1], 0xcb
push 2
push dword [ebp - 0xc]
push dword [ebp - 4]
call sub.KERNEL32.dll_GlobalReAlloc
test eax, eax
je 0x40f822
mov dword [ebp - 4], eax
mov byte [0x4161d1], 0xcc
push eax
call sub.KERNEL32.dll_GlobalLock
test eax, eax
je 0x40f822
mov dword [ebp - 8], eax
jmp 0x40f6ca
push dword [ebp - 0x28]
call sub.KERNEL32.dll_FindClose
mov edi, dword [ebp - 0x27c]
test edi, edi
je 0x40f75b
mov esi, edi
dec edi
shl edi, 2
add edi, dword [ebp - 0x284]
push dword [edi]
call sub.KERNEL32.dll_FindClose
sub edi, 4
dec esi
jne 0x40f844
jmp 0x40f75b