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

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x5849af
mov eax, dword fs:[0]
push eax
sub esp, 0x1b8
mov eax, dword [0x5d723c]
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
push 0x1f
mov edx, 0x5bc1a4
lea ecx, [ebp - 0x12c]
call fcn.00404000
add esp, 4
mov edx, eax
mov dword [ebp - 4], 0
cmp dword [edx + 0x14], 0x10
jb 0x4059c6
mov edx, dword [edx]
sub esp, 0x18
mov esi, esp
mov dword [ebp - 0x1bc], esp
mov dword [esi + 0x14], 0xf
mov dword [esi + 0x10], 0
mov byte [esi], 0
cmp byte [edx], 0
jne 0x4059eb
xor ecx, ecx
jmp 0x4059f9
mov ecx, edx
lea ebx, [ecx + 1]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x4059f0
sub ecx, ebx
push ecx
push edx
mov ecx, esi
call fcn.00408750
mov byte [ebp - 4], 1
mov byte [ebp - 4], 0
call fcn.00445c90
mov dword [ebp - 4], 0xffffffff
add esp, 0x18
mov eax, dword [ebp - 0x118]
cmp eax, 0x10
jb 0x405a37
inc eax
lea ecx, [ebp - 0x12c]
push eax
push dword [ebp - 0x12c]
call fcn.00408c70
cmp dword [0x5ef630], 0x10
lea edx, [ebp - 0x1c0]
mov eax, 0x5ef61c
mov dword [ebp - 0x118], 0xf
cmovae eax, dword [0x5ef61c]
lea ecx, [ebp - 0x12c]
mov dword [ebp - 0x1c0], eax
mov eax, dword [0x5ef62c]
push 0
mov dword [ebp - 0x11c], 0
mov byte [ebp - 0x12c], 0
mov dword [ebp - 0x1c4], 0
mov dword [ebp - 0x1bc], eax
call fcn.00416920
lea eax, [ebp - 0x1c4]
mov dword [ebp - 4], 2
mov edx, dword [edi]
lea ecx, [ebp - 0x12c]
push eax
call fcn.00446340
mov dword [ebp - 4], 0xffffffff
add esp, 8
mov ecx, dword [ebp - 0x118]
mov bl, al
cmp ecx, 8
jb 0x405ad8
inc ecx
push ecx
push dword [ebp - 0x12c]
lea ecx, [ebp - 0x12c]
call fcn.00409500
xor eax, eax
mov dword [ebp - 0x118], 7
mov dword [ebp - 0x11c], 0
mov word [ebp - 0x12c], ax
test bl, bl
je 0x405d95
mov dword [ebp - 0x134], eax
mov dword [ebp - 0x130], eax
mov dword [ebp - 0x130], 0xf
mov dword [ebp - 0x134], eax
mov byte [ebp - 0x144], al
mov dword [ebp - 4], 3
lea edx, [ebp - 0x144]
mov ecx, dword [edi]
push 0xffffffffffffffff
call fcn.00410170
cmp dword [ebp - 0x130], 0x10
lea eax, [ebp - 0x144]
cmovae eax, dword [ebp - 0x144]
mov dword [ebp - 0x1c0], eax
mov eax, dword [ebp - 0x134]
mov dword [ebp - 0x1bc], eax
lea eax, [ebp - 0x1c0]
push eax
lea eax, [ebp - 0x12c]
push eax
call fcn.00412440
mov byte [ebp - 4], 4
lea eax, [ebp - 0x12c]
add esp, 4
cmp dword [ebp - 0x118], 0x10
mov ecx, esp
cmovae eax, dword [ebp - 0x12c]
sub esp, 8
mov dword [ecx], eax
mov eax, dword [ebp - 0x11c]
mov dword [ecx + 4], eax
mov ecx, esp
cmp dword [ebp - 0x118], 0x10
lea eax, [ebp - 0x12c]
cmovae eax, dword [ebp - 0x12c]
mov dword [ecx], eax
mov eax, dword [ebp - 0x11c]
mov dword [ecx + 4], eax
call fcn.00418830
add esp, 0x10
test eax, eax
jne 0x405d13
mov eax, dword [edi]
cmp dword [eax + 0x14], 8
jb 0x405bd4
mov eax, dword [eax]
push eax
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
cmp eax, 0xffffffff
je 0x405d13
push 0x19
mov edx, 0x5bc228
lea ecx, [ebp - 0x174]
call fcn.00404000
add esp, 4
mov byte [ebp - 4], 5
cmp dword [eax + 0x14], 0x10
jb 0x405c05
mov eax, dword [eax]
sub esp, 0x18
mov ecx, esp
mov dword [ebp - 0x1bc], esp
push eax
call fcn.00407f10
mov byte [ebp - 4], 6
mov byte [ebp - 4], 5
call fcn.00445c90
add esp, 0x18
mov byte [ebp - 4], 4
lea ecx, [ebp - 0x174]
call fcn.00407e40
lea ecx, [ebp - 0x1b8]
call fcn.00418790
mov byte [ebp - 4], 7
lea ecx, [ebp - 0x15c]
push 0x5bbc64
mov byte [ebp - 0x1b8], 1
mov byte [ebp - 0x19c], 1
call fcn.00407c80
push 0x5bbc68
mov byte [ebp - 4], 8
lea eax, [ebp - 0x174]
push dword [edi]
push eax
call fcn.00409a80
add esp, 0xc
push 0xffffffffffffffff
push 0
push eax
lea ecx, [ebp - 0x15c]
mov byte [ebp - 4], 9
call fcn.004090a0
lea ecx, [ebp - 0x174]
mov byte [ebp - 4], 8
call fcn.00407c40
lea eax, [ebp - 0x1b8]
push eax
lea edx, [ebp - 0x15c]
lea ecx, [ebp - 0x1c0]
call fcn.004162f0
add esp, 4
lea ecx, [ebp - 0x1bc]
call fcn.00412670
lea ecx, [ebp - 0x15c]
mov byte [ebp - 4], 7
call fcn.00407c40
mov byte [ebp - 4], 4
mov eax, dword [ebp - 0x1a0]
cmp eax, 8
jb 0x405cf6
inc eax
lea ecx, [ebp - 0x1b4]
push eax
push dword [ebp - 0x1b4]
call fcn.00409500
xor eax, eax
mov dword [ebp - 0x1a0], 7
mov dword [ebp - 0x1a4], 0
mov word [ebp - 0x1b4], ax
mov byte [ebp - 4], 3
mov eax, dword [ebp - 0x118]
cmp eax, 0x10
jb 0x405d35
inc eax
lea ecx, [ebp - 0x12c]
push eax
push dword [ebp - 0x12c]
call fcn.00408c70
mov dword [ebp - 0x118], 0xf
mov dword [ebp - 0x11c], 0
mov byte [ebp - 0x12c], 0
mov dword [ebp - 4], 0xffffffff
mov eax, dword [ebp - 0x130]
cmp eax, 0x10
jb 0x405d75
inc eax
lea ecx, [ebp - 0x144]
push eax
push dword [ebp - 0x144]
call fcn.00408c70
mov dword [ebp - 0x130], 0xf
mov dword [ebp - 0x134], 0
mov byte [ebp - 0x144], 0
jmp 0x405ec8
push 0x104
lea eax, [ebp - 0x114]
push 0
push eax
call fcn.00518c00
push 0x20
mov edx, 0x5bc204
lea ecx, [ebp - 0x12c]
call fcn.00404000
add esp, 0x10
mov dword [ebp - 4], 0xa
cmp dword [eax + 0x14], 0x10
jb 0x405dcc
mov eax, dword [eax]
push dword [ebp - 0x1c4]
push eax
lea eax, [ebp - 0x114]
push str._s_errcode:_d
push eax
call fcn.00401d20
mov dword [ebp - 4], 0xffffffff
add esp, 0x10
mov eax, dword [ebp - 0x118]
cmp eax, 0x10
jb 0x405e0c
inc eax
lea ecx, [ebp - 0x12c]
push eax
push dword [ebp - 0x12c]
call fcn.00408c70
sub esp, 0x18
mov dword [ebp - 0x118], 0xf
mov edx, esp
mov dword [ebp - 0x11c], 0
mov byte [ebp - 0x12c], 0
mov dword [ebp - 0x1bc], esp
mov dword [edx + 0x14], 0xf
mov dword [edx + 0x10], 0
mov byte [edx], 0
cmp byte [ebp - 0x114], 0
jne 0x405e50
xor ecx, ecx
jmp 0x405e69
lea ecx, [ebp - 0x114]
lea esi, [ecx + 1]
nop dword [eax]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x405e60
sub ecx, esi
push ecx
lea eax, [ebp - 0x114]
mov ecx, edx
push eax
call fcn.00408750
mov dword [ebp - 4], 0xb
mov dword [ebp - 4], 0xffffffff
call fcn.00445c90
mov ecx, esp
mov dword [ebp - 0x1bc], esp
push 0xffffffffffffffff
push 0
push 0x5ef61c
mov dword [ecx + 0x14], 0xf
mov dword [ecx + 0x10], 0
mov byte [ecx], 0
call fcn.00408850
mov dword [ebp - 4], 0xc
mov dword [ebp - 4], 0xffffffff
call fcn.00445c90
add esp, 0x18
mov ecx, dword [edi]
xor dl, dl
call fcn.00414cd0
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.005126ae
mov esp, ebp
pop ebp
ret