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

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0xab0d52
mov eax, dword fs:[0]
push eax
sub esp, 0x508
mov eax, dword [0xaf408c]
xor eax, ebp
mov dword [ebp - 0x10], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov edi, ecx
mov ebx, dword [ebp + 8]
push ebx
call fcn.0040f200
mov esi, eax
test esi, esi
js 0x40e382
cmp word [ebx + esi*2 + 2], 0
lea eax, [ebx + esi*2]
je 0x40e382
push eax
lea ecx, [ebp - 0x514]
call fcn.0040a790
push ebx
lea ecx, [ebp - 0x4d4]
mov dword [ebp - 4], 0
call fcn.0040a790
mov byte [ebp - 4], 1
cmp esi, dword [ebp - 0x4d0]
jae 0x40e0cf
mov eax, dword [ebp - 0x4d4]
xor ecx, ecx
mov dword [ebp - 0x4d0], esi
mov word [eax + esi*2], cx
mov ecx, dword [ebp - 0x510]
cmp ecx, 6
jbe 0x40e0f5
mov eax, dword [ebp - 0x514]
push str.:_DATA
lea eax, [eax + ecx*2]
add eax, 0xfffffff4
push eax
call fcn.0040b860
test al, al
jne 0x40e105
push str.:_DATA
lea ecx, [ebp - 0x514]
call fcn.0040ab30
push dword [ebp - 0x4d4]
call fcn.0040f8d0
test al, al
mov eax, dword [ebp - 0x4d4]
je 0x40e157
cmp esi, 2
je 0x40e12b
cmp esi, 3
jne 0x40e157
cmp word [eax + 4], 0x5c
jne 0x40e157
mov ecx, edi
call fcn.0040dc50
mov eax, dword [edi + 0x28]
lea ecx, [edi + 0x28]
xor edx, edx
mov dword [ecx + 4], 0
mov word [eax], dx
cmp esi, 2
jne 0x40e16a
lea eax, [ebp - 0x4d4]
push eax
call fcn.0040a820
jmp 0x40e16a
push dword [ebp + 0xc]
mov ecx, edi
push eax
call fcn.0040e040
test al, al
je 0x40e369
and dword [edi + 0x20], 0xfffffbef
mov dword [edi], 0
mov dword [edi + 4], 0
mov dword [ebp - 0x508], 0xffffffff
lea eax, [ebp - 0x4d4]
mov byte [ebp - 4], 2
push eax
lea ecx, [ebp - 0x504]
call fcn.0040a610
mov ebx, dword [sym.imp.KERNEL32.dll_SetLastError]
mov byte [ebp - 4], 3
nop dword [eax + eax]
lea ecx, [ebp - 0x4f8]
call fcn.0040a7f0
mov ecx, dword [ebp - 0x508]
mov byte [ebp - 4], 4
cmp ecx, 0xffffffff
je 0x40e203
mov eax, dword [0xaf7fcc]
test eax, eax
je 0x40e2f5
lea edx, [ebp - 0x268]
push edx
push ecx
call eax
test eax, eax
je 0x40e2f9
mov eax, dword [ebp - 0x268]
mov ecx, dword [ebp - 0x264]
mov dword [ebp - 0x4e8], eax
lea eax, [ebp - 0x260]
jmp 0x40e26b
cmp dword [0xaf7fc8], 0
mov esi, dword [ebp - 0x504]
je 0x40e2f5
push 0
call ebx
push 0
lea eax, [ebp - 0x4c0]
push eax
push 0
push esi
call dword [0xaf7fc8]
mov dword [ebp - 0x508], eax
cmp eax, 0xffffffff
jne 0x40e253
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x26
je 0x40e2f9
cmp dword [ebp - 0x508], 0xffffffff
je 0x40e2f9
mov eax, dword [ebp - 0x4c0]
mov ecx, dword [ebp - 0x4bc]
mov dword [ebp - 0x4e8], eax
lea eax, [ebp - 0x4b8]
mov dword [ebp - 0x4e4], ecx
lea ecx, [ebp - 0x4f8]
push eax
call fcn.0040a9a0
push dword [ebp - 0x514]
push dword [ebp - 0x4f8]
call fcn.0040b7b0
test al, al
jne 0x40e2a9
push dword [ebp - 0x4f8]
mov byte [ebp - 4], 3
call fcn.00a3c1ec
add esp, 4
jmp 0x40e1b0
mov eax, dword [ebp - 0x4f4]
cmp eax, 7
jbe 0x40e2cd
lea ecx, [eax - 6]
cmp ecx, eax
jae 0x40e2cd
mov eax, dword [ebp - 0x4f8]
xor edx, edx
mov dword [ebp - 0x4f4], ecx
mov word [eax + ecx*2], dx
lea eax, [ebp - 0x4f8]
lea ecx, [edi + 0x28]
push eax
call fcn.0040aaf0
mov eax, dword [ebp - 0x4e8]
mov bl, 1
mov ecx, dword [ebp - 0x4e4]
mov dword [edi], eax
mov dword [edi + 4], ecx
mov byte [edi + 0x24], 1
jmp 0x40e30a
push 0x78
call ebx
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x26
jne 0x40e308
push 2
call ebx
xor bl, bl
push dword [ebp - 0x4f8]
call fcn.00a3c1ec
push dword [ebp - 0x504]
call fcn.00a3c1ec
mov eax, dword [ebp - 0x508]
add esp, 8
cmp eax, 0xffffffff
je 0x40e349
push eax
call dword [sym.imp.KERNEL32.dll_FindClose]
mov ecx, dword [ebp - 0x508]
or edx, 0xffffffff
test eax, eax
cmovne ecx, edx
mov dword [ebp - 0x508], ecx
push dword [ebp - 0x4d4]
call fcn.00a3c1ec
push dword [ebp - 0x514]
call fcn.00a3c1ec
add esp, 8
mov al, bl
jmp 0x40e67d
push dword [ebp - 0x4d4]
call fcn.00a3c1ec
push dword [ebp - 0x514]
call fcn.00a3c1ec
add esp, 8
mov dword [ebp - 0x4d8], 0xffffffff
push ebx
mov dword [ebp - 4], 5
xor esi, esi
call fcn.0040fa10
test al, al
mov ecx, 4
cmovne esi, ecx
lea eax, [ebx + esi*2]
push eax
mov dword [ebp - 0x4c8], eax
call fcn.0040f900
test al, al
mov eax, dword [sym.imp.KERNEL32.dll_FindClose]
mov dword [ebp - 0x4e0], eax
je 0x40e42c
cmp word [ebx + esi*2 + 6], 0
jne 0x40e42c
push ebx
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
mov dword [ebp - 0x4dc], eax
cmp eax, 0xffffffff
je 0x40e611
test al, 0x10
je 0x40e611
mov ecx, edi
call fcn.0040dc50
mov eax, dword [ebp - 0x4dc]
lea ecx, [edi + 0x28]
push dword [ebp - 0x4c8]
mov dword [edi + 0x20], eax
call fcn.0040a9a0
cmp dword [edi + 0x2c], 2
jbe 0x40e41d
mov eax, dword [edi + 0x28]
xor ecx, ecx
mov dword [edi + 0x2c], 2
mov word [eax + 4], cx
push ebx
mov ecx, edi
call fcn.0040df60
mov cl, 1
jmp 0x40e67b
movzx eax, word [ebx]
cmp eax, 0x5c
je 0x40e43d
cmp eax, 0x2f
jne 0x40e611
cmp word [ebx + 2], 0
push ebx
jne 0x40e488
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
mov dword [ebp - 0x4c8], eax
cmp eax, 0xffffffff
je 0x40e611
test al, 0x10
je 0x40e611
mov ecx, edi
call fcn.0040dc50
mov eax, dword [edi + 0x28]
xor ecx, ecx
mov dword [edi + 0x2c], 0
mov word [eax], cx
mov cl, 1
mov eax, dword [ebp - 0x4c8]
mov dword [edi + 0x20], eax
jmp 0x40e67b
call fcn.0040f540
test eax, eax
je 0x40e611
cmp word [ebx + eax*2], 0
lea esi, [ebx + eax*2]
mov dword [ebp - 0x4dc], esi
je 0x40e611
push esi
call fcn.0040f270
test eax, eax
jns 0x40e611
push ebx
mov ecx, edi
call fcn.0040df60
test al, al
je 0x40e4d3
lea ecx, [edi + 0x28]
push esi
call fcn.0040a9a0
mov cl, 1
jmp 0x40e67b
push ebx
lea ecx, [ebp - 0x4d4]
call fcn.0040a790
mov ecx, dword [ebp - 0x4d0]
mov byte [ebp - 4], 6
cmp dword [ebp - 0x4cc], ecx
jne 0x40e502
lea ecx, [ebp - 0x4d4]
call fcn.0040ae70
mov ecx, dword [ebp - 0x4d0]
mov eax, dword [ebp - 0x4d4]
mov edx, 0x5c
push 0x2a
mov word [eax + ecx*2], dx
inc ecx
xor edx, edx
mov word [eax + ecx*2], dx
mov dword [ebp - 0x4d0], ecx
lea ecx, [ebp - 0x4d4]
call fcn.0040dc10
push edi
push dword [ebp - 0x4d4]
lea ecx, [ebp - 0x4d8]
call fcn.0040e6a0
test al, al
je 0x40e592
lea eax, [edi + 0x28]
mov ecx, 0xab5860
mov dword [ebp - 0x4c8], eax
mov eax, dword [eax]
mov dx, word [eax]
cmp dx, word [ecx]
jne 0x40e577
test dx, dx
je 0x40e573
mov dx, word [eax + 2]
cmp dx, word [ecx + 2]
jne 0x40e577
add eax, 4
add ecx, 4
test dx, dx
jne 0x40e551
xor eax, eax
jmp 0x40e57c
sbb eax, eax
or eax, 1
test eax, eax
jne 0x40e588
mov ecx, dword [ebp - 0x4c8]
jmp 0x40e5c7
push ebx
call fcn.0040e730
mov esi, eax
jmp 0x40e5a9
push ebx
call fcn.0040e730
mov dword [ebp - 0x4c8], eax
cmp eax, 0xffffffff
je 0x40e5e5
test al, 0x10
je 0x40e5e5
mov esi, eax
mov ecx, edi
call fcn.0040dc50
cmp esi, 0xffffffff
lea ecx, [edi + 0x28]
mov eax, 0x10
cmovne eax, esi
mov esi, dword [ebp - 0x4dc]
mov dword [edi + 0x20], eax
push esi
call fcn.0040a9a0
push dword [ebp - 0x4d4]
call fcn.00a3c1ec
mov esi, dword [ebp - 0x4d8]
add esp, 4
mov cl, 1
jmp 0x40e663
push dword [ebp - 0x4d4]
mov byte [ebp - 4], 5
call fcn.00a3c1ec
mov esi, dword [ebp - 0x4d8]
add esp, 4
cmp esi, 0xffffffff
je 0x40e611
push esi
call dword [ebp - 0x4e0]
test eax, eax
jne 0x40e611
xor cl, cl
jmp 0x40e63f
lea eax, [ebp - 0x260]
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_FindFirstFileW]
mov esi, eax
mov dword [ebp - 0x4d8], esi
cmp esi, 0xffffffff
jne 0x40e630
xor cl, cl
jmp 0x40e63f
push edi
lea eax, [ebp - 0x260]
push eax
call fcn.0040dcd0
mov cl, 1
cmp byte [ebp + 0xc], 0
mov byte [ebp - 0x4c1], cl
je 0x40e669
test cl, cl
je 0x40e669
mov eax, dword [edi + 0x20]
shr eax, 0xa
test al, 1
je 0x40e669
push ebx
mov ecx, edi
call fcn.0040df60
mov cl, al
mov byte [ebp - 0x4c1], cl
cmp esi, 0xffffffff
je 0x40e67b
push esi
call dword [ebp - 0x4e0]
mov cl, byte [ebp - 0x4c1]
mov al, cl
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.00a3bfd6
mov esp, ebp
pop ebp
ret 8