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

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x48083d
mov eax, dword fs:[0]
push eax
sub esp, 0x50
push ebx
push esi
push edi
mov eax, dword [0x496004]
xor eax, ebp
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov ebx, ecx
mov dword [ebp - 0x18], ebx
mov esi, dword [ebp + 8]
movzx eax, word [esi]
mov ecx, eax
cmp eax, 0x61
jb 0x40f0af
cmp ecx, 0x7a
jbe 0x40f0b9
cmp ecx, 0x41
jb 0x40f0c7
cmp ecx, 0x5a
ja 0x40f0c7
cmp word [esi + 2], 0x3a
lea edx, [esi + 2]
jne 0x40f0c7
mov al, 1
jmp 0x40f0cc
lea edx, [esi + 2]
xor al, al
movzx ecx, al
or edi, 0xffffffff
add ecx, ecx
movzx eax, word [esi + ecx*2]
test ax, ax
je 0x40f10e
nop dword [eax]
mov edx, edi
cmp ax, 0x3a
jne 0x40f0f1
test edx, edx
mov edi, ecx
cmovns edi, edx
jmp 0x40f100
cmp ax, 0x5c
je 0x40f0fd
cmp ax, 0x2f
jne 0x40f100
or edi, 0xffffffff
movzx eax, word [esi + ecx*2 + 2]
inc ecx
test ax, ax
jne 0x40f0e0
lea edx, [esi + 2]
test edi, edi
js 0x40f53d
lea ecx, [edi + edi]
add ecx, esi
lea edx, [esi + 2]
cmp word [ecx + 2], 0
je 0x40f53d
xor eax, eax
mov dword [ebp - 0x10], eax
cmp word [ecx], ax
je 0x40f13e
inc eax
cmp word [ecx + eax*2], 0
jne 0x40f133
mov dword [ebp - 0x10], eax
xor ecx, ecx
inc eax
mov edx, 2
mul edx
seto cl
neg ecx
or ecx, eax
push ecx
call fcn.00436ba1
mov edx, eax
mov eax, dword [ebp - 0x10]
mov dword [ebp - 0x28], edx
mov dword [ebp - 0x24], eax
mov dword [ebp - 0x20], eax
lea ecx, [eax*2 + 2]
push ecx
lea ecx, [edi + edi]
add ecx, esi
push ecx
push edx
call fcn.00441fd0
add esp, 0x10
xor eax, eax
mov dword [ebp - 4], 0
mov dword [ebp + 8], eax
cmp word [esi], ax
je 0x40f19b
nop dword [eax + eax]
inc eax
cmp word [esi + eax*2], 0
jne 0x40f190
mov dword [ebp + 8], eax
xor ecx, ecx
inc eax
mov edx, 2
mul edx
seto cl
neg ecx
or ecx, eax
push ecx
call fcn.00436ba1
mov edx, eax
mov eax, dword [ebp + 8]
mov dword [ebp - 0x34], edx
mov dword [ebp - 0x30], eax
mov dword [ebp - 0x2c], eax
lea ecx, [eax*2 + 2]
push ecx
push esi
push edx
call fcn.00441fd0
add esp, 0x10
mov byte [ebp - 4], 1
cmp edi, dword [ebp + 8]
jae 0x40f1ef
mov ecx, dword [ebp - 0x34]
mov eax, edi
mov dword [ebp + 8], eax
xor edx, edx
mov dword [ebp - 0x30], eax
lea eax, [edi + edi]
mov word [eax + ecx], dx
mov eax, dword [ebp - 0x10]
cmp eax, 6
jbe 0x40f20e
mov ecx, dword [ebp - 0x28]
mov edx, str.:_DATA
lea ecx, [ecx + eax*2]
add ecx, 0xfffffff4
call fcn.00409730
test al, al
jne 0x40f21b
push str.:_DATA
lea ecx, [ebp - 0x28]
call fcn.0040a490
mov ecx, dword [ebp - 0x34]
movzx eax, word [ecx]
mov edx, eax
cmp eax, 0x61
jb 0x40f22d
cmp edx, 0x7a
jbe 0x40f23f
cmp edx, 0x41
jb 0x40f314
cmp edx, 0x5a
ja 0x40f314
cmp word [ecx + 2], 0x3a
jne 0x40f314
cmp edi, 2
je 0x40f263
cmp edi, 3
jne 0x40f314
cmp word [ecx + 4], 0x5c
jne 0x40f314
mov dword [ebx], 0
lea ecx, [ebx + 0x28]
mov dword [ebx + 4], 0
xor edx, edx
mov dword [ebx + 0xc], 0
cmp edi, 2
mov edi, dword [ebp + 8]
mov dword [ebx + 8], 0
mov dword [ebx + 0x14], 0
mov dword [ebx + 0x10], 0
mov dword [ebx + 0x1c], 0
mov dword [ebx + 0x18], 0
mov dword [ebx + 0x20], 0
mov word [ebx + 0x24], 0
mov eax, dword [ecx]
mov dword [ecx + 4], 0
mov word [eax], dx
jne 0x40f327
lea eax, [ebp - 0x34]
cmp eax, ecx
je 0x40f327
cmp edi, dword [ecx + 8]
jbe 0x40f2fa
xor ecx, ecx
lea eax, [edi + 1]
mov edx, 2
mul edx
seto cl
neg ecx
or ecx, eax
push ecx
call fcn.00436ba1
push dword [ebx + 0x28]
mov esi, eax
call fcn.00436a37
lea ecx, [ebx + 0x28]
add esp, 8
mov dword [ecx], esi
mov dword [ecx + 8], edi
lea eax, [edi*2 + 2]
mov dword [ecx + 4], edi
push eax
push dword [ebp - 0x34]
push dword [ecx]
call fcn.00441fd0
add esp, 0xc
jmp 0x40f327
push ecx
mov ecx, ebx
call fcn.0040f070
test al, al
je 0x40f523
mov edi, dword [ebp + 8]
and dword [ebx + 0x20], 0xfffffbef
mov dword [ebx], 0
mov dword [ebx + 4], 0
mov dword [ebp - 0x44], 0xffffffff
xor ecx, ecx
mov byte [ebp - 4], 2
lea esi, [edi + 1]
mov dword [ebp - 0x40], 0
mov eax, esi
mov edx, 2
mul edx
seto cl
neg ecx
or ecx, eax
push ecx
call fcn.00436ba1
lea ecx, [esi + esi]
mov dword [ebp - 0x40], eax
push ecx
mov ecx, dword [ebp - 0x34]
push ecx
push eax
mov dword [ebp - 0x3c], edi
mov dword [ebp - 0x38], edi
call fcn.00441fd0
push 8
mov byte [ebp - 4], 3
call fcn.00436ba1
xor ecx, ecx
mov dword [ebp - 0x5c], eax
add esp, 0x14
mov dword [ebp - 0x58], 0
mov dword [ebp - 0x54], 3
mov word [eax], cx
lea eax, [ebp + 0xb]
mov byte [ebp - 4], 4
push eax
lea eax, [ebp - 0x5c]
push eax
lea ecx, [ebp - 0x44]
call fcn.0040ee60
test al, al
je 0x40f4d2
nop
cmp byte [ebp + 0xb], 0
je 0x40f4ca
mov eax, dword [ebp - 0x5c]
mov edi, dword [ebp - 0x28]
sub eax, edi
mov dword [ebp - 0x1c], eax
movzx ebx, word [eax + edi]
lea edi, [edi + 2]
movzx ecx, word [edi - 2]
cmp bx, cx
je 0x40f400
call fcn.00409350
mov ecx, ebx
mov si, ax
call fcn.00409350
cmp ax, si
jne 0x40f480
mov eax, dword [ebp - 0x1c]
test bx, bx
jne 0x40f3d5
mov edi, dword [ebp - 0x58]
mov ebx, dword [ebp - 0x5c]
cmp edi, 7
jbe 0x40f422
lea eax, [edi - 6]
cmp eax, edi
jae 0x40f422
mov edi, eax
xor ecx, ecx
mov dword [ebp - 0x58], edi
mov word [ebx + eax*2], cx
mov esi, dword [ebp - 0x18]
mov eax, dword [esi + 0x30]
lea edx, [esi + 0x28]
mov ecx, dword [edx + 4]
sub eax, ecx
cmp edi, eax
jbe 0x40f44e
add ecx, edi
mov eax, ecx
add ecx, 0x10
shr eax, 1
add eax, ecx
mov ecx, edx
and eax, 0xfffffff0
dec eax
push eax
call fcn.00409aa0
lea edx, [esi + 0x28]
mov ecx, dword [edx + 4]
lea eax, [edi*2 + 2]
push eax
mov eax, dword [edx]
push ebx
lea eax, [eax + ecx*2]
push eax
call fcn.00441fd0
mov eax, dword [ebp - 0x4c]
add esp, 0xc
add dword [esi + 0x2c], edi
mov ecx, dword [ebp - 0x48]
mov dword [esi], eax
mov dword [esi + 4], ecx
mov byte [esi + 0x24], 1
mov byte [ebp + 0xb], 1
jmp 0x40f4d9
mov byte [ebp - 4], 3
push dword [ebp - 0x5c]
call fcn.00436a37
push 8
call fcn.00436ba1
xor ecx, ecx
mov dword [ebp - 0x5c], eax
add esp, 8
mov dword [ebp - 0x58], 0
mov dword [ebp - 0x54], 3
mov word [eax], cx
lea eax, [ebp + 0xb]
mov byte [ebp - 4], 4
push eax
lea eax, [ebp - 0x5c]
push eax
lea ecx, [ebp - 0x44]
call fcn.0040ee60
test al, al
jne 0x40f3c0
jmp 0x40f4d2
push 2
call dword [sym.imp.KERNEL32.dll_SetLastError]
mov ebx, dword [ebp - 0x5c]
mov byte [ebp + 0xb], 0
push ebx
call fcn.00436a37
push dword [ebp - 0x40]
call fcn.00436a37
mov eax, dword [ebp - 0x44]
add esp, 8
cmp eax, 0xffffffff
je 0x40f4f9
push eax
call dword [sym.imp.KERNEL32.dll_FindClose]
push dword [ebp - 0x34]
call fcn.00436a37
push dword [ebp - 0x28]
call fcn.00436a37
mov al, byte [ebp + 0xb]
add esp, 8
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 4
push dword [ebp - 0x34]
call fcn.00436a37
push dword [ebp - 0x28]
call fcn.00436a37
lea edi, [esi + 2]
add esp, 8
mov edx, edi
jmp 0x40f540
lea edi, [esi + 2]
mov dword [ebp - 0x14], 0xffffffff
mov dword [ebp - 4], 5
movzx eax, word [esi]
mov ecx, eax
mov dword [ebp - 0x1c], ecx
cmp eax, 0x5c
je 0x40f562
mov edx, edi
cmp ecx, 0x2f
jne 0x40f58c
movzx eax, word [edx]
mov ecx, eax
cmp eax, 0x5c
je 0x40f571
cmp ecx, 0x2f
jne 0x40f58c
cmp word [esi + 4], 0x3f
jne 0x40f58c
movzx eax, word [esi + 6]
mov ecx, eax
cmp eax, 0x5c
je 0x40f588
cmp ecx, 0x2f
jne 0x40f58c
mov al, 1
jmp 0x40f58e
xor al, al
movzx edx, al
shl edx, 2
movzx eax, word [esi + edx*2]
lea ecx, [esi + edx*2]
mov dword [ebp - 0x10], ecx
mov ebx, eax
mov dword [ebp + 8], ebx
mov ebx, dword [ebp - 0x18]
cmp eax, 0x61
jb 0x40f5b1
cmp ax, 0x7a
jbe 0x40f5c5
cmp ax, 0x41
jb 0x40f6f4
cmp ax, 0x5a
ja 0x40f6f4
cmp word [ecx + 2], 0x3a
jne 0x40f6f4
movzx eax, word [ecx + 4]
mov ecx, eax
cmp eax, 0x5c
je 0x40f5e4
cmp ecx, 0x2f
jne 0x40f6f4
cmp word [esi + edx*2 + 6], 0
jne 0x40f6f4
cmp byte [0x498871], 0
jne 0x40f61e
mov edx, esi
lea ecx, [ebp - 0x28]
call fcn.0040a910
push dword [eax]
call dword [sym.imp.KERNEL32.dll_GetFileAttributesA]
push dword [ebp - 0x28]
mov dword [ebp + 8], eax
call fcn.00436a37
mov eax, dword [ebp + 8]
add esp, 4
jmp 0x40f625
push esi
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
cmp eax, 0xffffffff
je 0x40f9c6
test al, 0x10
je 0x40f9c6
mov dword [ebx + 0x20], eax
xor edi, edi
mov eax, dword [ebp - 0x10]
mov dword [ebx], 0
mov dword [ebx + 4], 0
mov dword [ebx + 0xc], 0
mov dword [ebx + 8], 0
mov dword [ebx + 0x14], 0
mov dword [ebx + 0x10], 0
mov dword [ebx + 0x1c], 0
mov dword [ebx + 0x18], 0
mov word [ebx + 0x24], 0
cmp word [eax], di
je 0x40f688
inc edi
cmp word [eax + edi*2], 0
jne 0x40f680
cmp edi, dword [ebx + 0x30]
jbe 0x40f6b9
xor ecx, ecx
lea eax, [edi + 1]
mov edx, 2
mul edx
seto cl
neg ecx
or ecx, eax
push ecx
call fcn.00436ba1
push dword [ebx + 0x28]
mov esi, eax
call fcn.00436a37
add esp, 8
mov dword [ebx + 0x28], esi
mov dword [ebx + 0x30], edi
mov ecx, dword [ebp - 0x10]
lea eax, [edi*2 + 2]
push eax
push ecx
push dword [ebx + 0x28]
mov dword [ebx + 0x2c], edi
call fcn.00441fd0
add esp, 0xc
cmp dword [ebx + 0x2c], 2
jbe 0x40f7a9
mov eax, dword [ebx + 0x28]
xor ecx, ecx
mov dword [ebx + 0x2c], 2
mov bl, 1
mov word [eax + 4], cx
jmp 0x40f9e1
mov eax, dword [ebp - 0x1c]
cmp ax, 0x5c
je 0x40f707
cmp ax, 0x2f
jne 0x40f9c6
cmp word [edi], 0
jne 0x40f7b0
cmp byte [0x498871], 0
jne 0x40f73f
mov edx, esi
lea ecx, [ebp - 0x28]
call fcn.0040a910
push dword [eax]
call dword [sym.imp.KERNEL32.dll_GetFileAttributesA]
push dword [ebp - 0x28]
mov dword [ebp + 8], eax
call fcn.00436a37
mov ecx, dword [ebp + 8]
add esp, 4
jmp 0x40f748
push esi
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
mov ecx, eax
cmp ecx, 0xffffffff
je 0x40f9c6
test cl, 0x10
je 0x40f9c6
mov dword [ebx], 0
xor edx, edx
mov dword [ebx + 4], 0
mov dword [ebx + 0xc], 0
mov dword [ebx + 8], 0
mov dword [ebx + 0x14], 0
mov dword [ebx + 0x10], 0
mov dword [ebx + 0x1c], 0
mov dword [ebx + 0x18], 0
mov word [ebx + 0x24], 0
mov eax, dword [ebx + 0x28]
mov dword [ebx + 0x2c], 0
mov word [eax], dx
mov dword [ebx + 0x20], ecx
mov bl, 1
jmp 0x40f9e1
mov ecx, esi
call fcn.00410520
test eax, eax
je 0x40f9c6
lea edx, [esi + eax*2]
movzx eax, word [edx]
mov dword [ebp - 0x10], edx
mov edi, eax
test ax, ax
je 0x40f9c6
mov ecx, edx
cmp ax, 0x5c
je 0x40f7ef
cmp ax, 0x2f
je 0x40f7ef
movzx eax, word [ecx + 2]
add ecx, 2
test ax, ax
jne 0x40f7d5
jmp 0x40f7f9
sub ecx, edx
sar ecx, 1
jns 0x40f9c6
xor edi, edi
cmp word [ebp - 0x1c], di
je 0x40f809
inc edi
cmp word [esi + edi*2], 0
jne 0x40f801
xor ecx, ecx
lea eax, [edi + 1]
mov edx, 2
mul edx
seto cl
neg ecx
or ecx, eax
push ecx
call fcn.00436ba1
lea ecx, [edi*2 + 2]
mov dword [ebp - 0x28], eax
push ecx
push esi
push eax
mov dword [ebp - 0x24], edi
mov dword [ebp - 0x20], edi
call fcn.00441fd0
add esp, 0x10
mov eax, edi
mov byte [ebp - 4], 6
shr eax, 1
lea ecx, [ebp - 0x28]
add edi, 0x10
add eax, edi
and eax, 0xfffffff0
dec eax
push eax
call fcn.00409aa0
mov eax, dword [ebp - 0x24]
mov ecx, 0x5c
mov edi, dword [ebp - 0x28]
mov dword [ebp - 0x1c], edi
mov word [edi + eax*2], cx
lea ecx, [eax + 1]
xor eax, eax
mov dword [ebp - 0x24], ecx
mov word [edi + ecx*2], ax
cmp dword [ebp - 0x20], ecx
jne 0x40f899
mov eax, ecx
add ecx, 0x10
shr eax, 1
add eax, ecx
lea ecx, [ebp - 0x28]
and eax, 0xfffffff0
dec eax
push eax
call fcn.00409aa0
mov edi, dword [ebp - 0x28]
mov ecx, dword [ebp - 0x24]
mov dword [ebp - 0x1c], edi
mov eax, 0x2a
mov word [edi + ecx*2], ax
lea eax, [ecx + 1]
xor ecx, ecx
mov dword [ebp - 0x24], eax
push ebx
mov word [edi + eax*2], cx
mov byte [ebp + 0xb], cl
lea ecx, [ebp - 0x14]
push edi
call fcn.0040ea30
test al, al
je 0x40f96b
mov eax, dword [ebx + 0x28]
mov ecx, 0x48bb68
mov dword [ebp + 8], eax
nop
mov dx, word [eax]
cmp dx, word [ecx]
jne 0x40f8f6
test dx, dx
je 0x40f8f2
mov dx, word [eax + 2]
cmp dx, word [ecx + 2]
jne 0x40f8f6
add eax, 4
add ecx, 4
test dx, dx
jne 0x40f8d0
xor eax, eax
jmp 0x40f8fb
sbb eax, eax
or eax, 1
test eax, eax
jne 0x40f967
mov edi, dword [ebp - 0x10]
xor esi, esi
cmp word [edi], si
je 0x40f91d
nop dword [eax]
inc esi
cmp word [edi + esi*2], 0
jne 0x40f910
mov ecx, dword [ebx + 0x28]
jmp 0x40f920
mov ecx, dword [ebp + 8]
cmp esi, dword [ebx + 0x30]
jbe 0x40f955
xor ecx, ecx
lea eax, [esi + 1]
mov edx, 2
mul edx
seto cl
neg ecx
or ecx, eax
push ecx
call fcn.00436ba1
push dword [ebx + 0x28]
mov dword [ebp + 8], eax
call fcn.00436a37
mov ecx, dword [ebp + 8]
add esp, 8
mov dword [ebx + 0x28], ecx
mov dword [ebx + 0x30], esi
lea eax, [esi*2 + 2]
mov dword [ebx + 0x2c], esi
push eax
push edi
push ecx
jmp 0x40fa9b
mov byte [ebp + 0xb], 1
cmp byte [0x498871], 0
jne 0x40f999
mov edx, esi
lea ecx, [ebp - 0x40]
call fcn.0040a910
push dword [eax]
call dword [sym.imp.KERNEL32.dll_GetFileAttributesA]
push dword [ebp - 0x40]
mov dword [ebp - 0x18], eax
call fcn.00436a37
mov ecx, dword [ebp - 0x18]
add esp, 4
jmp 0x40f9a9
push esi
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
or ecx, 0xffffffff
cmp eax, 0xffffffff
cmovne ecx, eax
cmp byte [ebp + 0xb], 0
jne 0x40f9f7
cmp ecx, 0xffffffff
je 0x40f9b9
test cl, 0x10
jne 0x40f9f7
push edi
mov byte [ebp - 4], 5
call fcn.00436a37
add esp, 4
push ebx
push esi
lea ecx, [ebp - 0x14]
call fcn.0040ea30
mov bl, al
mov ecx, dword [ebp - 0x14]
cmp ecx, 0xffffffff
je 0x40f9e1
push ecx
call dword [sym.imp.KERNEL32.dll_FindClose]
mov al, bl
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 4
cmp ecx, 0xffffffff
mov dword [ebx], 0
mov eax, 0x10
mov dword [ebx + 4], 0
cmovne eax, ecx
mov dword [ebx + 0xc], 0
mov dword [ebx + 8], 0
xor edi, edi
mov dword [ebx + 0x14], 0
mov dword [ebx + 0x10], 0
mov dword [ebx + 0x1c], 0
mov dword [ebx + 0x18], 0
mov word [ebx + 0x24], 0
mov dword [ebx + 0x20], eax
mov eax, dword [ebp - 0x10]
cmp word [eax], di
je 0x40fa58
nop dword [eax]
inc edi
cmp word [eax + edi*2], 0
jne 0x40fa50
cmp edi, dword [ebx + 0x30]
jbe 0x40fa89
xor ecx, ecx
lea eax, [edi + 1]
mov edx, 2
mul edx
seto cl
neg ecx
or ecx, eax
push ecx
call fcn.00436ba1
push dword [ebx + 0x28]
mov esi, eax
call fcn.00436a37
add esp, 8
mov dword [ebx + 0x28], esi
mov dword [ebx + 0x30], edi
mov edx, dword [ebp - 0x10]
lea eax, [edi*2 + 2]
push eax
push edx
push dword [ebx + 0x28]
mov dword [ebx + 0x2c], edi
call fcn.00441fd0
add esp, 0xc
push dword [ebp - 0x1c]
call fcn.00436a37
add esp, 4
mov bl, 1
jmp 0x40f9d2