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

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x274
mov eax, dword [0x416834]
xor eax, esp
mov dword [esp + 0x270], eax
push ebx
push esi
push edi
push 0x250
lea eax, [esp + 0x2c]
mov dword [esp + 0x20], edx
mov esi, ecx
push 0
push eax
mov dword [esp + 0x1c], esi
call fcn.0040aa30
add esp, 0xc
mov dword [esp + 0x14], 0xffffffff
test esi, esi
je 0x401777
mov ecx, esi
lea edx, [ecx + 2]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x4014c0
sub ecx, edx
sar ecx, 1
je 0x401777
xor ecx, ecx
lea edx, [esi + 2]
xor ebx, ebx
xor edi, edi
nop
mov ax, word [esi]
add esi, 2
test ax, ax
jne 0x4014e0
sub esi, edx
mov edx, 0x5c
sar esi, 1
je 0x401516
mov eax, dword [esp + 0x10]
mov ecx, esi
movzx eax, word [eax + esi*2 - 2]
cmp dx, ax
je 0x401516
mov edx, 0x2f
cmp dx, ax
je 0x401516
lea ebx, [edx - 0x2e]
lea ecx, [esi + 1]
add ecx, 1
je 0x40174b
lea eax, [ecx*2 + 2]
push eax
push 8
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
mov ecx, eax
mov dword [esp + 0x20], ecx
test ecx, ecx
je 0x40174b
test esi, esi
je 0x40155f
lea eax, [esi + esi]
push eax
push dword [esp + 0x14]
push ecx
call fcn.0040a4b0
mov ecx, dword [esp + 0x2c]
add esp, 0xc
mov edi, esi
test ebx, ebx
je 0x40156d
mov eax, 0x5c
mov word [ecx + edi*2], ax
inc edi
mov ax, word [0x413f84]
mov word [ecx + edi*2], ax
lea eax, [esp + 0x28]
push eax
push ecx
call dword [sym.imp.KERNEL32.dll_FindFirstFileW]
mov dword [esp + 0x14], eax
cmp eax, 0xffffffff
je 0x401714
test byte [esp + 0x28], 0x10
je 0x4015cb
lea eax, [esp + 0x54]
push 0x413f88
push eax
call fcn.00402c93
add esp, 8
test eax, eax
je 0x4016fd
lea eax, [esp + 0x54]
push 0x413f8c
push eax
call fcn.00402c93
add esp, 8
test eax, eax
je 0x4016fd
mov ebx, dword [esp + 0x10]
xor ecx, ecx
mov esi, ebx
mov dword [esp + 0x18], ecx
mov dword [esp + 0x24], ecx
lea edx, [esi + 2]
nop
mov ax, word [esi]
add esi, 2
test ax, ax
jne 0x4015e0
sub esi, edx
sar esi, 1
je 0x401617
movzx eax, word [ebx + esi*2 - 2]
mov edx, 0x5c
mov ecx, esi
cmp dx, ax
je 0x401617
mov edx, 0x2f
cmp dx, ax
je 0x401617
mov dword [esp + 0x18], 1
lea ecx, [esi + 1]
lea edi, [esp + 0x54]
lea edx, [edi + 2]
nop
mov ax, word [edi]
add edi, 2
test ax, ax
jne 0x401620
sub edi, edx
sar edi, 1
add ecx, edi
je 0x4016fd
lea eax, [ecx*2 + 2]
push eax
push 8
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
mov ebx, eax
test ebx, ebx
je 0x4016fd
test esi, esi
je 0x401671
lea ecx, [esi + esi]
push ecx
push dword [esp + 0x14]
push ebx
call fcn.0040a4b0
add esp, 0xc
mov ecx, esi
jmp 0x401675
mov ecx, dword [esp + 0x24]
cmp dword [esp + 0x18], 0
je 0x401686
mov eax, 0x5c
mov word [ebx + ecx*2], ax
inc ecx
test edi, edi
je 0x40169f
lea eax, [edi + edi]
push eax
lea eax, [esp + 0x58]
push eax
lea eax, [ebx + ecx*2]
push eax
call fcn.0040a4b0
add esp, 0xc
test byte [esp + 0x28], 0x10
je 0x4016d7
push ebx
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
cmp eax, 0xffffffff
je 0x4016be
and eax, 0x410
cmp eax, 0x410
je 0x4016ce
mov edx, dword [esp + 0x1c]
mov ecx, ebx
push 0
call fcn.00401470
add esp, 4
push ebx
call dword [sym.imp.KERNEL32.dll_RemoveDirectoryW]
jmp 0x4016ed
mov esi, dword [esp + 0x1c]
lea eax, [esp + 0x28]
push 0
push eax
push ebx
mov ecx, esi
call dword [0x40f180]
call esi
push ebx
push 0
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call dword [sym.imp.KERNEL32.dll_HeapFree]
lea eax, [esp + 0x28]
push eax
push dword [esp + 0x18]
call dword [sym.imp.KERNEL32.dll_FindNextFileW]
test eax, eax
jne 0x401590
push dword [esp + 0x20]
push 0
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call dword [sym.imp.KERNEL32.dll_HeapFree]
push dword [esp + 0x14]
call dword [sym.imp.KERNEL32.dll_FindClose]
mov eax, 1
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x270]
xor ecx, esp
call fcn.0040b54e
mov esp, ebp
pop ebp
ret
push 0xe
call dword [sym.imp.KERNEL32.dll_SetLastError]
push dword [esp + 0x14]
call dword [sym.imp.KERNEL32.dll_FindClose]
mov eax, 1
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x270]
xor ecx, esp
call fcn.0040b54e
mov esp, ebp
pop ebp
ret
push 0x57
call dword [sym.imp.KERNEL32.dll_SetLastError]
mov ecx, dword [esp + 0x27c]
xor eax, eax
pop edi
pop esi
pop ebx
xor ecx, esp
call fcn.0040b54e
mov esp, ebp
pop ebp
ret