Function at 0x402f8f
Capabilities:
Check if file exists
Create directory
Get file attributes
Read file on windows
Set current directory
Set file attributes

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x984
mov al, byte [0x4100cc]
push ebx
push esi
push edi
push 0x40
mov byte [ebp - 0x634], al
pop ecx
xor eax, eax
lea edi, [ebp - 0x633]
mov ebx, dword [sym.imp.KERNEL32.dll_lstrcpyA]
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
mov edi, dword [ebp + 8]
xor esi, esi
mov dword [0x410bcc], esi
cmp dword [edi + 0x2c], esi
jne 0x403009
cmp dword [0x40ff1c], esi
jne 0x403009
push dword [edi + 0x18]
lea eax, [ebp - 0x634]
push eax
call ebx
lea eax, [ebp - 0x634]
push eax
call dword [sym.imp.KERNEL32.dll_lstrlenA]
cmp byte [ebp + eax - 0x635], 0x5c
je 0x403009
lea eax, [ebp - 0x634]
push 0x40d118
push eax
call dword [sym.imp.KERNEL32.dll_lstrcatA]
cmp dword [0x40ff40], esi
mov dword [ebp - 4], 0x2f
jne 0x403038
lea eax, [ebp - 0x984]
mov dword [edi + 0xc], eax
cmp dword [0x40ff40], esi
jne 0x403038
push edi
call fcn.004025b7
test eax, eax
pop ecx
jne 0x4037a5
lea eax, [ebp - 0x634]
mov esi, 0x419100
push eax
push esi
call ebx
mov eax, dword [edi + 0xc]
and dword [ebp - 4], 0
add eax, 0x26
push eax
call dword [sym.imp.KERNEL32.dll_lstrlenA]
test eax, eax
jle 0x403085
mov eax, dword [edi + 0xc]
mov ecx, dword [ebp - 4]
cmp byte [eax + ecx + 0x26], 0x2f
lea eax, [eax + ecx + 0x26]
jne 0x403070
mov byte [eax], 0x5c
mov eax, dword [edi + 0xc]
inc dword [ebp - 4]
add eax, 0x26
push eax
call dword [sym.imp.KERNEL32.dll_lstrlenA]
cmp dword [ebp - 4], eax
jl 0x40305c
mov eax, dword [edi + 0xc]
add eax, 0x26
push eax
lea eax, [ebp - 0x420]
push eax
call ebx
cmp dword [edi + 0x30], 0
je 0x4030c0
mov eax, dword [edi + 0xc]
add eax, 0x26
push eax
lea eax, [ebp - 0x84c]
push eax
call fcn.00402144
pop ecx
lea eax, [ebp - 0x84c]
pop ecx
push eax
mov eax, dword [edi + 0xc]
add eax, 0x26
push eax
call ebx
mov eax, dword [edi + 0xc]
add eax, 0x26
push eax
push esi
call dword [sym.imp.KERNEL32.dll_lstrcatA]
cmp dword [edi + 0x2c], 0
jne 0x403450
cmp dword [0x40ff1c], 0
jne 0x403450
cmp dword [0x41932c], 0
je 0x403159
lea eax, [ebp - 0x530]
push esi
push eax
call ebx
movsx eax, word [0x41908e]
mov dword [ebp - 0x42c], eax
push dword [0x4190e4]
movsx eax, word [0x41908c]
mov dword [ebp - 0x428], eax
mov eax, dword [edi + 0xc]
mov eax, dword [eax + 0x12a]
mov dword [ebp - 0x424], eax
mov dword [ebp - 8], eax
lea eax, [ebp - 0x530]
push eax
call dword [0x41932c]
lea eax, [ebp - 0x530]
push eax
push esi
call ebx
mov eax, dword [ebp - 8]
mov ecx, dword [edi + 0xc]
xor eax, dword [ebp - 0x424]
and eax, 0x27
xor eax, dword [ebp - 8]
mov dword [ecx + 0x12a], eax
push 0
lea eax, [ebp - 0x218]
push 0
push eax
lea eax, [ebp + 8]
push eax
push esi
call fcn.00405868
push 0
lea eax, [ebp - 0x218]
push 0
push eax
lea eax, [ebp + 8]
push eax
lea eax, [ebp - 0x114]
push eax
call fcn.004063f7
add esp, 0x28
lea eax, [ebp - 0x114]
push eax
lea eax, [ebp - 0x218]
push eax
call ebx
and dword [ebp - 4], 0
lea eax, [ebp - 0x114]
push 0x5c
push eax
call fcn.004063d0
pop ecx
test eax, eax
pop ecx
je 0x4031c8
and byte [eax], 0
lea eax, [ebp - 0x114]
push eax
call dword [sym.imp.KERNEL32.dll_SetCurrentDirectoryA]
test eax, eax
je 0x4031df
lea eax, [ebp - 0x114]
push eax
lea eax, [ebp - 0x31c]
push eax
call ebx
mov dword [ebp - 4], 1
cmp dword [ebp - 4], 0
je 0x4031a0
lea eax, [ebp - 0x31c]
push 0x40d118
push eax
call dword [sym.imp.KERNEL32.dll_lstrcatA]
lea eax, [ebp - 0x218]
push eax
lea eax, [ebp - 0x114]
push eax
call ebx
mov ebx, dword [sym.imp.KERNEL32.dll_lstrlenA]
lea eax, [ebp - 0x31c]
push eax
call ebx
mov edx, eax
lea eax, [ebp - 0x114]
push eax
mov dword [ebp - 8], edx
call ebx
mov ecx, dword [ebp - 8]
cmp ecx, eax
jge 0x4032bf
mov ebx, dword [sym.imp.KERNEL32.dll_lstrlenA]
lea eax, [ebp - 0x31c]
push eax
call ebx
lea eax, [ebp + eax - 0x31c]
mov dword [ebp - 4], eax
lea eax, [ebp - 0x31c]
push eax
call ebx
lea ecx, [ebp + eax - 0x114]
mov al, byte [ecx]
test al, al
je 0x40326d
cmp al, 0x5c
je 0x40326d
mov edx, dword [ebp - 4]
inc dword [ebp - 4]
inc ecx
mov byte [edx], al
jmp 0x403258
mov eax, dword [ebp - 4]
push 0
and byte [eax], 0
lea eax, [ebp - 0x31c]
push eax
call dword [sym.imp.KERNEL32.dll_CreateDirectoryA]
test eax, eax
je 0x4032b7
lea eax, [ebp - 0x31c]
push 0x40d118
push eax
call dword [sym.imp.KERNEL32.dll_lstrcatA]
lea eax, [ebp - 0x31c]
push eax
call ebx
mov edx, eax
lea eax, [ebp - 0x114]
push eax
mov dword [ebp - 8], edx
call ebx
mov ecx, dword [ebp - 8]
jmp 0x403227
push 0x1c
pop eax
jmp 0x403462
push esi
push 0x410be0
call dword [sym.imp.KERNEL32.dll_lstrcmpiA]
test eax, eax
je 0x403449
mov ebx, dword [sym.imp.KERNEL32.dll_lstrcpyA]
push esi
push 0x419220
call ebx
push 0
push 0x8000080
push 3
push 0
push 3
push 0x80000000
push esi
call dword [sym.imp.KERNEL32.dll_CreateFileA]
cmp eax, 0xffffffff
je 0x403450
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
cmp dword [0x40ff04], 0
jne 0x403450
cmp dword [edi + 0x28], 0
jne 0x403449
push 0x7f00
push 0
call dword [sym.imp.USER32.dll_LoadCursorA]
push eax
call dword [sym.imp.USER32.dll_SetCursor]
push esi
mov dword [ebp - 8], eax
call dword [sym.imp.KERNEL32.dll_GetFileAttributesA]
cmp eax, 0xffffffff
mov dword [ebp - 0xc], eax
je 0x40341c
test al, 0x10
jne 0x40341c
test al, 1
lea eax, [ebp - 0x530]
push esi
push eax
je 0x4033cc
call ebx
lea eax, [ebp - 0x530]
push eax
push 0
push 0x80
call fcn.0040462e
pop ecx
pop ecx
push eax
lea eax, [ebp - 0x218]
push eax
call dword [sym.imp.USER32.dll_wsprintfA]
lea eax, [ebp - 0x218]
push eax
push 0
push 1
push 3
push 8
call fcn.00403af1
add esp, 0x20
cmp eax, 0x64
mov dword [ebp - 4], eax
push 6
pop ecx
je 0x4033ab
cmp eax, 5
jne 0x4033b8
mov dword [0x40ff04], 1
mov dword [ebp - 4], ecx
cmp dword [ebp - 4], ecx
jne 0x403423
mov eax, dword [ebp - 0xc]
and al, 0xfe
push eax
push esi
call dword [sym.imp.KERNEL32.dll_SetFileAttributesA]
jmp 0x403423
call ebx
lea eax, [ebp - 0x530]
push eax
push 0
push 0x44
call fcn.0040462e
pop ecx
pop ecx
push eax
lea eax, [ebp - 0x218]
push eax
call dword [sym.imp.USER32.dll_wsprintfA]
lea eax, [ebp - 0x218]
push eax
push 0
push 0
push 3
push 8
call fcn.00403af1
add esp, 0x20
cmp eax, 0x64
mov dword [ebp - 4], eax
je 0x403412
cmp eax, 5
jne 0x403423
mov dword [0x40ff04], 1
mov dword [ebp - 4], 6
push dword [ebp - 8]
call dword [sym.imp.USER32.dll_SetCursor]
cmp dword [ebp - 4], 2
jne 0x403439
push 0x30
jmp 0x4032b9
cmp dword [ebp - 4], 7
je 0x403449
cmp dword [ebp - 4], 0x65
jne 0x403450
push 0x31
jmp 0x403483
push 0x31
jmp 0x4032b9
push 1
push 0x410be0
call fcn.004037c9
pop ecx
test eax, eax
pop ecx
je 0x40346b
and dword [edi + 0xc], 0
jmp 0x4037c4
mov eax, dword [edi + 0x2c]
and dword [ebp - 4], 0
mov dword [0x40ff64], eax
call fcn.00401f05
cmp eax, 0xffffffff
jne 0x403489
push 0x1d
pop eax
jmp 0x4037c4
cmp dword [0x40ff40], 0
jne 0x4034f8
push 0
call fcn.00403920
test eax, eax
pop ecx
mov dword [0x410bc0], eax
je 0x4034a6
mov dword [ebp - 4], eax
movsx ecx, word [0x410ba6]
dec ecx
cmp dword [edi + 0x14], ecx
jle 0x4034ba
mov dword [ebp - 4], 0x19
cmp dword [ebp - 4], 0
jne 0x4034f0
cmp dword [0x410b48], 0
jne 0x4034da
and dword [0x419204], 0
call fcn.004021b2
mov dword [0x410bc0], eax
test eax, eax
jne 0x4034f0
mov eax, dword [edi + 0x14]
mov dword [0x419204], eax
call fcn.004021b2
mov dword [0x410bc0], eax
cmp eax, dword [ebp - 4]
jle 0x4034f8
mov dword [ebp - 4], eax
and dword [0x41007c], 0
test byte [0x419088], 1
je 0x403512
mov dword [0x41007c], 1
cmp word [0x41908a], 8
jle 0x403523
mov dword [ebp - 4], 0x2a
cmp dword [ebp - 4], 0
jne 0x40373e
push 0
push 0
push dword [0x4190aa]
push dword [0x410bc8]
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
lea eax, [ebp - 0x10]
push 0
push eax
push 0x1e
push 0x410b20
push dword [0x410bc8]
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x403566
cmp dword [ebp - 0x10], 0
jne 0x40356d
mov dword [ebp - 4], 3
cmp dword [0x410b20], 0x4034b50
je 0x403580
mov dword [ebp - 4], 3
cmp dword [ebp - 4], 0
jne 0x403594
movsx eax, word [0x410b3a]
push eax
call fcn.00401e8a
pop ecx
call fcn.00401eec
cmp dword [ebp - 4], 0
jne 0x4037a5
push 0x410be0
call fcn.00402a64
test eax, eax
pop ecx
mov dword [0x410bc0], eax
je 0x4035dd
and dword [edi + 0xc], 0
push dword [0x4109e8]
call fcn.0040635b
push dword [0x410ce8]
call fcn.0040635b
mov eax, dword [0x410bc0]
pop ecx
pop ecx
jmp 0x4037c4
cmp dword [0x40ff64], 0
jne 0x40360f
cmp dword [0x40ff1c], 0
push esi
je 0x4035f9
push 0
push 0x84
jmp 0x403624
lea eax, [ebp - 0x530]
push eax
call ebx
lea eax, [ebp - 0x530]
push eax
push 0
push 0x48
jmp 0x403624
lea eax, [ebp - 0x530]
push esi
push eax
call ebx
lea eax, [ebp - 0x530]
push eax
push 0
push 0x49
call fcn.0040462e
pop ecx
pop ecx
push eax
push 0x419360
call dword [sym.imp.USER32.dll_wsprintfA]
add esp, 0xc
push esi
call dword [sym.imp.KERNEL32.dll_lstrlenA]
cmp byte [eax + 0x4190ff], 0x5c
je 0x40373e
mov eax, dword [edi + 0xc]
mov eax, dword [eax + 0x12a]
and eax, 7
cmp dword [0x41932c], 0
mov dword [0x4109c8], eax
je 0x403682
mov ax, word [ebp - 0x42c]
mov word [0x410b2c], ax
mov ax, word [ebp - 0x428]
mov word [0x410b2a], ax
push 0x419220
call fcn.00402893
test eax, eax
pop ecx
mov dword [0x410bc0], eax
jle 0x40373b
xor ecx, ecx
cmp dword [0x41007c], ecx
je 0x40373b
cmp eax, 0x2c
jne 0x40373b
cmp dword [edi + 0x28], ecx
jne 0x40372f
push 0x7f00
push ecx
call dword [sym.imp.USER32.dll_LoadCursorA]
push eax
call dword [sym.imp.USER32.dll_SetCursor]
mov dword [ebp - 8], eax
lea eax, [ebp - 0x530]
push esi
push eax
call ebx
lea eax, [ebp - 0x530]
xor esi, esi
push eax
push esi
push 0x46
call fcn.0040462e
pop ecx
pop ecx
push eax
lea eax, [ebp - 0x218]
push eax
call dword [sym.imp.USER32.dll_wsprintfA]
lea eax, [ebp - 0x218]
push eax
push esi
push esi
push 1
push 9
call fcn.00403af1
add esp, 0x20
mov esi, eax
push dword [ebp - 8]
call dword [sym.imp.USER32.dll_SetCursor]
cmp esi, 2
jne 0x403729
and dword [edi + 0xc], 0
mov dword [ebp - 4], 0x2c
jmp 0x40373e
and dword [edi + 0xc], 0
jmp 0x403732
mov dword [edi + 0xc], ecx
mov dword [ebp - 4], 0x31
jmp 0x40373e
mov dword [ebp - 4], eax
call fcn.00402a91
cmp dword [ebp - 4], 0
jne 0x4037a5
cmp dword [0x4109e4], 0
je 0x4037a5
lea eax, [ebp - 0x748]
push 0x419220
push eax
call ebx
movsx eax, word [0x41908e]
mov dword [ebp - 0x644], eax
push dword [0x410b40]
movsx eax, word [0x41908c]
mov dword [ebp - 0x640], eax
mov eax, dword [edi + 0xc]
mov eax, dword [eax + 0x12a]
mov dword [ebp - 0x63c], eax
mov eax, dword [edi + 0x14]
mov dword [ebp - 0x638], eax
lea eax, [ebp - 0x748]
push eax
call dword [0x4109e4]
and dword [edi + 0xc], 0
push dword [0x4109e8]
call fcn.0040635b
push dword [0x410ce8]
call fcn.0040635b
mov eax, dword [ebp - 4]
pop ecx
pop ecx
pop edi
pop esi
pop ebx
leave
ret