Function at 0x407173
Capabilities:
Get common file path
Get file attributes
Set current directory
Set file attributes

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x640
push ebx
and dword [ebp - 4], 0
and dword [ebp - 8], 0
push esi
push edi
push 1
mov dword [ebp - 0xc], ecx
pop ebx
mov ecx, dword [ebp + 8]
push ebx
call fcn.00402301
mov ecx, eax
call fcn.004018ad
cmp dword [ebp + 0xc], 3
mov esi, eax
mov edi, ebx
jb 0x4071c1
mov ecx, dword [ebp + 8]
push 2
call fcn.00402301
mov ecx, eax
call fcn.004018d3
cmp eax, ebx
jne 0x4071c1
mov byte [ebp + 0xc], bl
jmp 0x4071c5
and byte [ebp + 0xc], 0
cmp byte [esi], 0
je 0x407257
mov al, byte [esi]
cmp al, 0x2b
jne 0x4071d9
inc esi
mov edi, ebx
jmp 0x4071e0
cmp al, 0x2d
jne 0x4071e0
inc esi
xor edi, edi
mov al, byte [esi]
cmp al, 0x52
je 0x40723c
cmp al, 0x72
je 0x40723c
cmp al, 0x41
je 0x407237
cmp al, 0x61
je 0x407237
cmp al, 0x53
je 0x407233
cmp al, 0x73
je 0x407233
cmp al, 0x48
je 0x40722f
cmp al, 0x68
je 0x40722f
cmp al, 0x4e
je 0x407228
cmp al, 0x6e
je 0x407228
cmp al, 0x4f
je 0x407221
cmp al, 0x6f
je 0x407221
cmp al, 0x54
je 0x40721a
cmp al, 0x74
jne 0x407250
mov eax, 0x100
jmp 0x40723e
mov eax, 0x1000
jmp 0x40723e
mov eax, 0x80
jmp 0x40723e
push 2
jmp 0x407239
push 4
jmp 0x407239
push 0x20
pop eax
jmp 0x40723e
mov eax, ebx
cmp edi, ebx
jne 0x407247
or dword [ebp - 4], eax
jmp 0x40724a
or dword [ebp - 8], eax
inc esi
jmp 0x4071c5
push 0
jmp 0x40735d
mov ecx, dword [ebp + 8]
mov esi, 0x104
xor edi, edi
push esi
push edi
call fcn.00402301
mov ecx, eax
call fcn.004018ad
push eax
lea eax, [ebp - 0x220]
push eax
call fcn.00418210
and byte [ebp - 0x11c], 0
lea eax, [ebp - 0x220]
push eax
call fcn.0041517d
add esp, 0x10
lea eax, [ebp - 0x10]
push eax
lea eax, [ebp - 0x220]
push eax
lea eax, [ebp - 0x220]
push esi
push eax
call dword [sym.imp.KERNEL32.DLL_GetFullPathNameA]
lea eax, [ebp - 0x640]
push eax
lea eax, [ebp - 0x118]
push eax
lea eax, [ebp - 0x538]
push eax
lea eax, [ebp - 0x430]
push eax
lea eax, [ebp - 0x220]
push eax
call fcn.004180be
lea eax, [ebp - 0x538]
push eax
lea eax, [ebp - 0x430]
push eax
call fcn.00417760
lea eax, [ebp - 0x640]
push eax
lea eax, [ebp - 0x118]
push eax
call fcn.00417760
add esp, 0x24
lea eax, [ebp - 0x328]
push eax
push esi
call dword [sym.imp.KERNEL32.DLL_GetCurrentDirectoryA]
mov esi, dword [sym.imp.KERNEL32.DLL_SetCurrentDirectoryA]
lea eax, [ebp - 0x430]
push eax
call esi
lea eax, [ebp - 0x118]
push eax
call fcn.004152f5
test al, al
pop ecx
je 0x407389
lea eax, [ebp - 0x118]
push eax
call dword [sym.imp.KERNEL32.DLL_GetFileAttributesA]
mov ecx, dword [ebp - 8]
or eax, dword [ebp - 4]
not ecx
and eax, ecx
push eax
lea eax, [ebp - 0x118]
push eax
call dword [sym.imp.KERNEL32.DLL_SetFileAttributesA]
test eax, eax
jne 0x407367
lea eax, [ebp - 0x328]
push eax
call esi
push edi
mov ecx, dword [ebp + 0x10]
call fcn.00401aa7
jmp 0x4073b7
cmp byte [ebp + 0xc], 0
je 0x4073b7
lea eax, [ebp - 0x118]
push eax
call esi
lea eax, [ebp - 0x118]
push 0x42651c
push eax
call fcn.00417750
pop ecx
pop ecx
push dword [ebp + 0xc]
mov ecx, dword [ebp - 0xc]
lea eax, [ebp - 0x118]
push dword [ebp - 8]
push dword [ebp - 4]
push eax
call fcn.004073c0
test al, al
jne 0x4073ae
mov ecx, dword [ebp + 0x10]
push edi
call fcn.00401aa7
lea eax, [ebp - 0x328]
push eax
call esi
pop edi
pop esi
xor eax, eax
pop ebx
leave
ret 0xc