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

Disassembly:
push 0x200
mov eax, 0x4129eb
call fcn.00411e9a
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 0x4154dc
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 0x406c7c
push ecx
push ecx
lea ecx, [ebp - 0x20c]
call fcn.0040f85e
mov byte [ebp - 4], 2
push dword [ebp - 0x1c]
call fcn.0040fbd2
test eax, eax
jne 0x406c71
push 0x4154e4
lea ecx, [ebp - 0x20c]
call fcn.0040452b
lea ecx, [ebp - 0x14]
mov dword [ebp - 0x14], eax
call fcn.0040461d
test eax, eax
jne 0x406828
push dword [ebp - 0x1c]
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fclose]
jmp 0x406c70
push 0x4154f0
lea eax, [ebp - 0x10]
push eax
lea ecx, [ebp - 0x14]
call fcn.004045f5
lea ecx, [ebp - 0x10]
call fcn.0040461d
test eax, eax
je 0x40689a
mov esi, dword [ebp - 0x10]
test esi, esi
je 0x406851
mov eax, dword [esi + 0x1c]
jmp 0x406853
mov eax, edi
lea ecx, [ebp - 0x10]
mov dword [ebp - 0x10], eax
call fcn.0040463d
test eax, eax
je 0x40689a
test esi, esi
je 0x40686b
mov eax, dword [esi + 0x1c]
jmp 0x40686d
mov eax, edi
lea ecx, [ebp - 0x10]
mov dword [ebp - 0x10], eax
call fcn.0040463d
mov ecx, eax
call fcn.0040ea5a
test eax, eax
je 0x40689a
push eax
lea ecx, [ebp - 0x28]
call fcn.004046a3
mov esi, dword [ebp + 0x10]
push eax
lea ecx, [esi + 0xc]
call fcn.00401a57
jmp 0x40689d
mov esi, dword [ebp + 0x10]
push 0x4154fc
lea eax, [ebp - 0x10]
push eax
lea ecx, [ebp - 0x14]
call fcn.004045f5
lea ecx, [ebp - 0x10]
call fcn.0040461d
test eax, eax
je 0x4068f0
mov eax, dword [ebp - 0x10]
test eax, eax
je 0x4068c6
mov eax, dword [eax + 0x1c]
jmp 0x4068c8
mov eax, edi
lea ecx, [ebp - 0x10]
mov dword [ebp - 0x10], eax
call fcn.0040463d
mov ecx, eax
call fcn.0040ea5a
test eax, eax
je 0x4068f0
push eax
lea ecx, [ebp - 0x28]
call fcn.004046a3
push eax
lea ecx, [esi + 0x10]
call fcn.00401a57
push 0x415504
lea eax, [ebp - 0x10]
push eax
lea ecx, [ebp - 0x14]
call fcn.004045f5
lea ecx, [ebp - 0x10]
call fcn.0040461d
test eax, eax
je 0x406947
mov eax, dword [ebp - 0x10]
test eax, eax
je 0x406919
mov eax, dword [eax + 0x1c]
jmp 0x40691b
mov eax, edi
lea ecx, [ebp - 0x10]
mov dword [ebp - 0x10], eax
call fcn.0040463d
test eax, eax
je 0x406947
mov ecx, eax
call fcn.0040ea5a
test eax, eax
je 0x406947
push eax
lea ecx, [ebp - 0x28]
call fcn.004046a3
push eax
lea ecx, [esi + 0x14]
call fcn.00401a57
push 0x415510
lea eax, [ebp - 0x10]
push eax
lea ecx, [ebp - 0x14]
call fcn.004045f5
lea ecx, [ebp - 0x10]
call fcn.0040461d
test eax, eax
je 0x40699e
mov eax, dword [ebp - 0x10]
test eax, eax
je 0x406970
mov eax, dword [eax + 0x1c]
jmp 0x406972
mov eax, edi
lea ecx, [ebp - 0x10]
mov dword [ebp - 0x10], eax
call fcn.0040463d
test eax, eax
je 0x40699e
mov ecx, eax
call fcn.0040ea5a
test eax, eax
je 0x40699e
push eax
lea ecx, [ebp - 0x28]
call fcn.004046a3
push eax
lea ecx, [esi + 0x18]
call fcn.00401a57
push 0x41551c
lea eax, [ebp - 0x10]
push eax
lea ecx, [ebp - 0x14]
call fcn.004045f5
lea ecx, [ebp - 0x10]
call fcn.0040461d
test eax, eax
je 0x4069f5
mov eax, dword [ebp - 0x10]
test eax, eax
je 0x4069c7
mov eax, dword [eax + 0x1c]
jmp 0x4069c9
mov eax, edi
lea ecx, [ebp - 0x10]
mov dword [ebp - 0x10], eax
call fcn.0040463d
test eax, eax
je 0x4069f5
mov ecx, eax
call fcn.0040ea5a
test eax, eax
je 0x4069f5
push eax
lea ecx, [ebp - 0x28]
call fcn.004046a3
push eax
lea ecx, [esi + 0x28]
call fcn.00401a57
cmp dword [ebp + 0xc], 0
je 0x406c65
mov ecx, dword [ebp + 8]
lea ecx, [ecx - 0x10]
call fcn.00401bbc
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 0x406a58
sub eax, dword [ebp + 8]
sar eax, 1
js 0x406a58
push eax
lea eax, [ebp - 0x10]
push eax
lea ecx, [ebp + 8]
call fcn.0040344f
push eax
lea ecx, [ebp - 0x18]
mov byte [ebp - 4], 4
call fcn.00403827
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 0x406a6f
lea ecx, [esi - 0x10]
call fcn.00401bbc
lea edi, [eax + 0x10]
mov dword [ebp - 0x10], edi
jmp 0x406a89
lea ecx, [ebp - 0x18]
call fcn.00403934
dec edi
push eax
push ebx
lea ecx, [esi + edi*2]
push ecx
lea ecx, [ebp - 0x10]
call fcn.00403a70
mov edi, dword [ebp - 0x10]
push 0x414bd8
lea ecx, [ebp - 0x10]
mov byte [ebp - 4], 5
call fcn.0040374e
lea ecx, [edi - 0x10]
mov byte [ebp - 4], 3
mov ebx, eax
call fcn.00401582
test ebx, ebx
je 0x406abc
push 0x414bd8
lea ecx, [ebp - 0x18]
call fcn.00403794
mov esi, dword [ebp - 0x18]
push str.FileList
lea eax, [ebp - 0x10]
push eax
lea ecx, [ebp - 0x14]
call fcn.004045f5
lea ecx, [ebp - 0x10]
call fcn.0040461d
test eax, eax
jne 0x406af3
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 0x406c71
push str.FileItem
lea eax, [ebp - 0x14]
push eax
lea ecx, [ebp - 0x10]
call fcn.004045f5
lea ecx, [ebp - 0x14]
call fcn.0040461d
test eax, eax
je 0x406c5b
mov edi, dword [ebp + 0x10]
push ecx
push str.name
lea ecx, [ebp - 0x14]
call fcn.0040461d
mov ecx, eax
call fcn.0040f478
push ecx
push str.description
lea ecx, [ebp - 0x14]
mov dword [ebp - 0x2c], eax
call fcn.0040461d
mov ecx, eax
call fcn.0040f478
push ecx
push str.optional
lea ecx, [ebp - 0x14]
mov dword [ebp - 0x34], eax
call fcn.0040461d
mov ecx, eax
call fcn.0040f478
mov ebx, eax
mov eax, dword [ebp - 0x2c]
test eax, eax
je 0x406c38
push eax
lea ecx, [ebp - 0x28]
call fcn.004046a3
push eax
lea ecx, [ebp - 0x10]
call fcn.004038c4
lea ecx, [ebp - 0x4c]
call fcn.0040465d
lea eax, [ebp - 0x10]
mov byte [ebp - 4], 7
push eax
lea ecx, [ebp - 0x4c]
call fcn.00403827
lea eax, [ebp - 0x10]
push eax
lea edx, [ebp - 0x18]
lea ecx, [ebp - 0x30]
call fcn.00407099
pop ecx
push eax
lea ecx, [ebp - 0x48]
mov byte [ebp - 4], 8
call fcn.00403827
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 0x406bd8
push eax
lea ecx, [ebp - 0x28]
call fcn.004046a3
push eax
lea ecx, [ebp - 0x44]
call fcn.00401a57
and dword [ebp - 0x40], 0
test ebx, ebx
je 0x406bf8
cmp byte [ebx], 0x31
jne 0x406bf2
movzx eax, byte [ebx + 1]
test al, al
jne 0x406bf2
xor eax, eax
inc eax
jmp 0x406bf5
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 0x406c21
test al, 0x10
jne 0x406c21
lea eax, [ebp - 0x4c]
push eax
lea eax, [ebp - 0x10]
push eax
lea ecx, [edi + 0x78]
call fcn.0040700c
mov ecx, eax
call fcn.00404b13
lea ecx, [ebp - 0x4c]
call fcn.004063aa
mov byte [ebp - 4], 3
mov ecx, dword [ebp - 0x10]
add ecx, 0xfffffff0
call fcn.00401582
push ecx
lea ecx, [ebp - 0x14]
call fcn.0040461d
mov ecx, eax
call fcn.0040455d
lea ecx, [ebp - 0x14]
mov dword [ebp - 0x14], eax
call fcn.0040461d
test eax, eax
jne 0x406b17
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.0040f9d5
lea ecx, [ebp - 0x28]
call fcn.004026ed
mov ecx, dword [ebp + 8]
add ecx, 0xfffffff0
call fcn.00401582
mov eax, ebx
call fcn.00411e68
ret 0xc