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

Disassembly:
push 0x200
mov eax, 0x414372
call fcn.0041380a
xor edi, edi
mov dword [ebp - 4], edi
mov dword [ebp - 0x28], edi
mov dword [ebp - 0x24], edi
mov dword [ebp - 0x20], edi
xor ebx, ebx
lea eax, [ebp - 0x1c]
inc ebx
mov byte [ebp - 4], bl
push 0x4174f4
push dword [ebp + 8]
mov dword [ebp - 0x1c], edi
push eax
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll__wfopen_s]
add esp, 0xc
cmp dword [ebp - 0x1c], edi
je 0x406b5f
push ecx
push ecx
lea ecx, [ebp - 0x20c]
call fcn.00410060
mov byte [ebp - 4], 2
push dword [ebp - 0x1c]
call fcn.00410560
test eax, eax
jne 0x406b54
push 0x4174fc
lea ecx, [ebp - 0x20c]
call fcn.00404599
lea ecx, [ebp - 0x14]
mov dword [ebp - 0x14], eax
call fcn.00404623
test eax, eax
jne 0x40670b
push dword [ebp - 0x1c]
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fclose]
jmp 0x406b53
push 0x417508
lea eax, [ebp - 0x10]
push eax
lea ecx, [ebp - 0x14]
call fcn.004045fb
lea ecx, [ebp - 0x10]
call fcn.00404623
test eax, eax
je 0x40677d
mov esi, dword [ebp - 0x10]
test esi, esi
je 0x406734
mov eax, dword [esi + 0x1c]
jmp 0x406736
mov eax, edi
lea ecx, [ebp - 0x10]
mov dword [ebp - 0x10], eax
call fcn.00404643
test eax, eax
je 0x40677d
test esi, esi
je 0x40674e
mov eax, dword [esi + 0x1c]
jmp 0x406750
mov eax, edi
lea ecx, [ebp - 0x10]
mov dword [ebp - 0x10], eax
call fcn.00404643
mov ecx, eax
call fcn.0040ea80
test eax, eax
je 0x40677d
push eax
lea ecx, [ebp - 0x28]
call fcn.004046a9
mov esi, dword [ebp + 0x10]
push eax
lea ecx, [esi + 0xc]
call fcn.00401a67
jmp 0x406780
mov esi, dword [ebp + 0x10]
push 0x417514
lea eax, [ebp - 0x10]
push eax
lea ecx, [ebp - 0x14]
call fcn.004045fb
lea ecx, [ebp - 0x10]
call fcn.00404623
test eax, eax
je 0x4067d3
mov eax, dword [ebp - 0x10]
test eax, eax
je 0x4067a9
mov eax, dword [eax + 0x1c]
jmp 0x4067ab
mov eax, edi
lea ecx, [ebp - 0x10]
mov dword [ebp - 0x10], eax
call fcn.00404643
mov ecx, eax
call fcn.0040ea80
test eax, eax
je 0x4067d3
push eax
lea ecx, [ebp - 0x28]
call fcn.004046a9
push eax
lea ecx, [esi + 0x10]
call fcn.00401a67
push 0x41751c
lea eax, [ebp - 0x10]
push eax
lea ecx, [ebp - 0x14]
call fcn.004045fb
lea ecx, [ebp - 0x10]
call fcn.00404623
test eax, eax
je 0x40682a
mov eax, dword [ebp - 0x10]
test eax, eax
je 0x4067fc
mov eax, dword [eax + 0x1c]
jmp 0x4067fe
mov eax, edi
lea ecx, [ebp - 0x10]
mov dword [ebp - 0x10], eax
call fcn.00404643
test eax, eax
je 0x40682a
mov ecx, eax
call fcn.0040ea80
test eax, eax
je 0x40682a
push eax
lea ecx, [ebp - 0x28]
call fcn.004046a9
push eax
lea ecx, [esi + 0x14]
call fcn.00401a67
push 0x417528
lea eax, [ebp - 0x10]
push eax
lea ecx, [ebp - 0x14]
call fcn.004045fb
lea ecx, [ebp - 0x10]
call fcn.00404623
test eax, eax
je 0x406881
mov eax, dword [ebp - 0x10]
test eax, eax
je 0x406853
mov eax, dword [eax + 0x1c]
jmp 0x406855
mov eax, edi
lea ecx, [ebp - 0x10]
mov dword [ebp - 0x10], eax
call fcn.00404643
test eax, eax
je 0x406881
mov ecx, eax
call fcn.0040ea80
test eax, eax
je 0x406881
push eax
lea ecx, [ebp - 0x28]
call fcn.004046a9
push eax
lea ecx, [esi + 0x18]
call fcn.00401a67
push 0x417534
lea eax, [ebp - 0x10]
push eax
lea ecx, [ebp - 0x14]
call fcn.004045fb
lea ecx, [ebp - 0x10]
call fcn.00404623
test eax, eax
je 0x4068d8
mov eax, dword [ebp - 0x10]
test eax, eax
je 0x4068aa
mov eax, dword [eax + 0x1c]
jmp 0x4068ac
mov eax, edi
lea ecx, [ebp - 0x10]
mov dword [ebp - 0x10], eax
call fcn.00404643
test eax, eax
je 0x4068d8
mov ecx, eax
call fcn.0040ea80
test eax, eax
je 0x4068d8
push eax
lea ecx, [ebp - 0x28]
call fcn.004046a9
push eax
lea ecx, [esi + 0x28]
call fcn.00401a67
cmp dword [ebp + 0xc], 0
je 0x406b48
mov ecx, dword [ebp + 8]
lea ecx, [ecx - 0x10]
call fcn.00401bcc
lea esi, [eax + 0x10]
mov dword [ebp - 0x18], esi
mov byte [ebp - 4], 3
push 0x5c
push dword [ebp + 8]
call dword [sym.imp.VCRUNTIME140.dll_wcsrchr]
pop ecx
pop ecx
test eax, eax
je 0x40693b
sub eax, dword [ebp + 8]
sar eax, 1
js 0x40693b
push eax
lea eax, [ebp - 0x10]
push eax
lea ecx, [ebp + 8]
call fcn.004034bd
push eax
lea ecx, [ebp - 0x18]
mov byte [ebp - 4], 4
call fcn.00403895
mov byte [ebp - 4], 3
mov ecx, dword [ebp - 0x10]
lea ecx, [ecx - 0x10]
call fcn.00401582
mov esi, dword [ebp - 0x18]
mov edi, dword [esi - 0xc]
cmp edi, ebx
jg 0x406952
lea ecx, [esi - 0x10]
call fcn.00401bcc
lea edi, [eax + 0x10]
mov dword [ebp - 0x10], edi
jmp 0x40696c
lea ecx, [ebp - 0x18]
call fcn.004039a2
dec edi
push eax
push ebx
lea ecx, [esi + edi*2]
push ecx
lea ecx, [ebp - 0x10]
call fcn.00403ade
mov edi, dword [ebp - 0x10]
push 0x416c08
lea ecx, [ebp - 0x10]
mov byte [ebp - 4], 5
call fcn.004037bc
lea ecx, [edi - 0x10]
mov byte [ebp - 4], 3
mov ebx, eax
call fcn.00401582
test ebx, ebx
je 0x40699f
push 0x416c08
lea ecx, [ebp - 0x18]
call fcn.00403802
mov esi, dword [ebp - 0x18]
push str.FileList
lea eax, [ebp - 0x10]
push eax
lea ecx, [ebp - 0x14]
call fcn.004045fb
lea ecx, [ebp - 0x10]
call fcn.00404623
test eax, eax
jne 0x4069d6
push dword [ebp - 0x1c]
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fclose]
pop ecx
lea ecx, [esi - 0x10]
call fcn.00401582
xor ebx, ebx
inc ebx
jmp 0x406b54
push str.FileItem
lea eax, [ebp - 0x14]
push eax
lea ecx, [ebp - 0x10]
call fcn.004045fb
lea ecx, [ebp - 0x14]
call fcn.00404623
test eax, eax
je 0x406b3e
mov edi, dword [ebp + 0x10]
push ecx
push str.name
lea ecx, [ebp - 0x14]
call fcn.00404623
mov ecx, eax
call fcn.0040f830
push ecx
push str.description
lea ecx, [ebp - 0x14]
mov dword [ebp - 0x2c], eax
call fcn.00404623
mov ecx, eax
call fcn.0040f830
push ecx
push str.optional
lea ecx, [ebp - 0x14]
mov dword [ebp - 0x34], eax
call fcn.00404623
mov ecx, eax
call fcn.0040f830
mov ebx, eax
mov eax, dword [ebp - 0x2c]
test eax, eax
je 0x406b1b
push eax
lea ecx, [ebp - 0x28]
call fcn.004046a9
push eax
lea ecx, [ebp - 0x10]
call fcn.00403932
lea ecx, [ebp - 0x4c]
call fcn.00404663
lea eax, [ebp - 0x10]
mov byte [ebp - 4], 7
push eax
lea ecx, [ebp - 0x4c]
call fcn.00403895
lea eax, [ebp - 0x10]
push eax
lea edx, [ebp - 0x18]
lea ecx, [ebp - 0x30]
call fcn.00406f7c
pop ecx
push eax
lea ecx, [ebp - 0x48]
mov byte [ebp - 4], 8
call fcn.00403895
mov byte [ebp - 4], 7
mov ecx, dword [ebp - 0x30]
lea ecx, [ecx - 0x10]
call fcn.00401582
mov eax, dword [ebp - 0x34]
test eax, eax
je 0x406abb
push eax
lea ecx, [ebp - 0x28]
call fcn.004046a9
push eax
lea ecx, [ebp - 0x44]
call fcn.00401a67
and dword [ebp - 0x40], 0
test ebx, ebx
je 0x406adb
cmp byte [ebx], 0x31
jne 0x406ad5
movzx eax, byte [ebx + 1]
test al, al
jne 0x406ad5
xor eax, eax
inc eax
jmp 0x406ad8
mov eax, dword [ebp - 0x3c]
mov dword [ebp - 0x3c], eax
push dword [ebp - 0x48]
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
cmp eax, 0xffffffff
je 0x406b04
test al, 0x10
jne 0x406b04
lea eax, [ebp - 0x4c]
push eax
lea eax, [ebp - 0x10]
push eax
lea ecx, [edi + 0x78]
call fcn.00406eef
mov ecx, eax
call fcn.00404b19
lea ecx, [ebp - 0x4c]
call fcn.0040628d
mov byte [ebp - 4], 3
mov ecx, dword [ebp - 0x10]
add ecx, 0xfffffff0
call fcn.00401582
push ecx
lea ecx, [ebp - 0x14]
call fcn.00404623
mov ecx, eax
call fcn.004045cb
lea ecx, [ebp - 0x14]
mov dword [ebp - 0x14], eax
call fcn.00404623
test eax, eax
jne 0x4069fa
lea ecx, [esi - 0x10]
call fcn.00401582
xor edi, edi
push dword [ebp - 0x1c]
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fclose]
mov ebx, edi
pop ecx
lea ecx, [ebp - 0x20c]
call fcn.004102c0
lea ecx, [ebp - 0x28]
call fcn.004026cd
mov ecx, dword [ebp + 8]
add ecx, 0xfffffff0
call fcn.00401582
mov eax, ebx
call fcn.004137d8
ret 0xc