Function at 0x402f3d
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
push ebx
push esi
push edi
mov esi, 0x415298
lea edi, [ebp - 0x420]
xor eax, eax
movsb byte es:[edi], byte [esi]
lea edi, [ebp - 0x41f]
mov ecx, 0x40
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
mov esi, dword [ebp + 8]
mov dword [0x40a79c], eax
cmp dword [esi + 0x2c], eax
jne 0x402fb9
cmp dword [0x4150b8], eax
jne 0x402fb9
push dword [esi + 0x18]
lea ecx, [ebp - 0x420]
push ecx
call dword [sym.imp.KERNEL32.dll_lstrcpyA]
lea ecx, [ebp - 0x420]
mov ebx, dword [sym.imp.KERNEL32.dll_lstrlenA]
push ecx
call ebx
cmp byte [ebp + eax - 0x421], 0x5c
je 0x402fbf
push 0x4152d0
lea eax, [ebp - 0x420]
push eax
call dword [sym.imp.KERNEL32.dll_lstrcatA]
jmp 0x402fbf
mov ebx, dword [sym.imp.KERNEL32.dll_lstrlenA]
cmp dword [0x4150dc], 0
mov edi, 0x2f
jne 0x402ff0
lea eax, [ebp - 0x770]
mov dword [esi + 0xc], eax
cmp dword [0x4150dc], 0
jne 0x402ff0
push esi
call fcn.004022e0
add esp, 4
test eax, eax
jne 0x403788
lea eax, [ebp - 0x420]
xor edi, edi
push eax
push 0x412cb0
call dword [sym.imp.KERNEL32.dll_lstrcpyA]
mov eax, dword [esi + 0xc]
add eax, 0x26
push eax
call ebx
test eax, eax
jle 0x40302e
mov eax, dword [esi + 0xc]
lea eax, [eax + edi + 0x26]
cmp byte [eax], 0x2f
jne 0x403020
mov byte [eax], 0x5c
inc edi
mov eax, dword [esi + 0xc]
add eax, 0x26
push eax
call ebx
cmp eax, edi
jg 0x403011
mov eax, dword [esi + 0xc]
lea ecx, [ebp - 0x874]
add eax, 0x26
push eax
push ecx
call dword [sym.imp.KERNEL32.dll_lstrcpyA]
cmp dword [esi + 0x30], 0
je 0x403072
mov eax, dword [esi + 0xc]
lea ecx, [ebp - 0x524]
add eax, 0x26
push eax
push ecx
call fcn.00401dd0
add esp, 8
lea ecx, [ebp - 0x524]
mov eax, dword [esi + 0xc]
push ecx
add eax, 0x26
push eax
call dword [sym.imp.KERNEL32.dll_lstrcpyA]
mov eax, dword [esi + 0xc]
add eax, 0x26
push eax
push 0x412cb0
call dword [sym.imp.KERNEL32.dll_lstrcatA]
cmp dword [esi + 0x2c], 0
jne 0x40345c
cmp dword [0x4150b8], 0
jne 0x40345c
cmp dword [0x412ca4], 0
je 0x40311c
push 0x412cb0
lea eax, [ebp - 0x984]
push eax
call dword [sym.imp.KERNEL32.dll_lstrcpyA]
movsx eax, word [0x40a76e]
movsx ecx, word [0x40a76c]
mov edx, dword [esi + 0xc]
mov dword [ebp - 0x880], eax
push dword [0x40a8a4]
mov dword [ebp - 0x87c], ecx
mov eax, dword [edx + 0x12a]
mov edi, eax
mov dword [ebp - 0x878], eax
lea eax, [ebp - 0x984]
push eax
call dword [0x412ca4]
lea ecx, [ebp - 0x984]
push ecx
push 0x412cb0
call dword [sym.imp.KERNEL32.dll_lstrcpyA]
mov ecx, edi
mov eax, dword [esi + 0xc]
xor ecx, dword [ebp - 0x878]
and ecx, 0x27
xor ecx, edi
mov dword [eax + 0x12a], ecx
push 0
lea eax, [ebp - 0x31c]
push 0
lea ecx, [ebp - 4]
push eax
push ecx
push 0x412cb0
call fcn.00405c12
add esp, 0x14
lea ecx, [ebp - 0x31c]
lea edx, [ebp - 4]
lea eax, [ebp - 0x218]
push 0
push 0
push ecx
push edx
push eax
call fcn.004061bb
add esp, 0x14
lea ecx, [ebp - 0x218]
lea edx, [ebp - 0x31c]
xor edi, edi
push ecx
push edx
call dword [sym.imp.KERNEL32.dll_lstrcpyA]
push 0x5c
lea eax, [ebp - 0x218]
push eax
call fcn.00406194
add esp, 8
test eax, eax
je 0x403195
mov byte [eax], 0
lea eax, [ebp - 0x218]
push eax
call dword [sym.imp.KERNEL32.dll_SetCurrentDirectoryA]
test eax, eax
je 0x4031ae
lea eax, [ebp - 0x218]
lea ecx, [ebp - 0x114]
push eax
mov edi, 1
push ecx
call dword [sym.imp.KERNEL32.dll_lstrcpyA]
test edi, edi
je 0x40316c
push 0x4152d0
lea eax, [ebp - 0x114]
push eax
call dword [sym.imp.KERNEL32.dll_lstrcatA]
lea eax, [ebp - 0x31c]
lea ecx, [ebp - 0x218]
push eax
push ecx
call dword [sym.imp.KERNEL32.dll_lstrcpyA]
lea ecx, [ebp - 0x218]
push ecx
call ebx
mov edi, eax
lea ecx, [ebp - 0x114]
push ecx
call ebx
cmp edi, eax
jle 0x403264
lea eax, [ebp - 0x114]
push eax
call ebx
lea edi, [ebp + eax - 0x114]
lea eax, [ebp - 0x114]
push eax
call ebx
lea ecx, [ebp + eax - 0x218]
cmp byte [ecx], 0
je 0x403224
mov al, byte [ecx]
cmp al, 0x5c
je 0x403224
inc ecx
mov byte [edi], al
inc edi
cmp byte [ecx], 0
jne 0x403215
push 0
lea eax, [ebp - 0x114]
push eax
mov byte [edi], 0
call dword [sym.imp.KERNEL32.dll_CreateDirectoryA]
test eax, eax
je 0x403289
push 0x4152d0
lea eax, [ebp - 0x114]
push eax
call dword [sym.imp.KERNEL32.dll_lstrcatA]
lea eax, [ebp - 0x218]
push eax
call ebx
mov edi, eax
lea eax, [ebp - 0x114]
push eax
call ebx
cmp edi, eax
jg 0x4031f0
push 0x412cb0
push 0x40a910
call dword [sym.imp.KERNEL32.dll_lstrcmpiA]
test eax, eax
jne 0x40329a
mov dword [esi + 0xc], 0
mov eax, 0x31
jmp 0x403811
mov dword [esi + 0xc], 0
mov eax, 0x1c
jmp 0x403811
push 0x412cb0
push 0x412ee0
call dword [sym.imp.KERNEL32.dll_lstrcpyA]
push 0
push 0x8000080
push 3
push 0
push 3
push 0x80000000
push 0x412cb0
call dword [sym.imp.KERNEL32.dll_CreateFileA]
cmp eax, 0xffffffff
je 0x40345c
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
cmp dword [0x41509c], 0
jne 0x40345c
cmp dword [esi + 0x28], 0
jne 0x40344b
push 0x7f00
push 0
call dword [sym.imp.USER32.dll_LoadCursorA]
push eax
call dword [sym.imp.USER32.dll_SetCursor]
push 0x412cb0
mov dword [ebp - 0x10], eax
call dword [sym.imp.KERNEL32.dll_GetFileAttributesA]
mov dword [ebp - 0xc], eax
cmp eax, 0xffffffff
je 0x403402
test al, 0x10
jne 0x403402
push 0x412cb0
test al, 1
lea eax, [ebp - 0x984]
push eax
je 0x4033ab
call dword [sym.imp.KERNEL32.dll_lstrcpyA]
lea eax, [ebp - 0x984]
push eax
push 0
push 0x80
call fcn.00404940
add esp, 8
lea ecx, [ebp - 0x31c]
push eax
push ecx
call dword [sym.imp.USER32.dll_wsprintfA]
add esp, 0xc
lea ecx, [ebp - 0x31c]
push ecx
push 0
push 1
push 3
push 8
call fcn.00403baf
add esp, 0x14
mov edi, eax
cmp edi, 0x64
je 0x403384
cmp edi, 5
jne 0x403393
mov dword [0x41509c], 1
mov edi, 6
cmp edi, 6
jne 0x403407
mov eax, dword [ebp - 0xc]
and al, 0xfe
push eax
push 0x412cb0
call dword [sym.imp.KERNEL32.dll_SetFileAttributesA]
jmp 0x403407
call dword [sym.imp.KERNEL32.dll_lstrcpyA]
lea eax, [ebp - 0x984]
push eax
push 0
push 0x44
call fcn.00404940
add esp, 8
lea ecx, [ebp - 0x31c]
push eax
push ecx
call dword [sym.imp.USER32.dll_wsprintfA]
add esp, 0xc
lea ecx, [ebp - 0x31c]
push ecx
push 0
push 0
push 3
push 8
call fcn.00403baf
add esp, 0x14
mov edi, eax
cmp edi, 0x64
je 0x4033f8
cmp edi, 5
jne 0x403407
mov dword [0x41509c], 1
mov edi, 6
push dword [ebp - 0x10]
call dword [sym.imp.USER32.dll_SetCursor]
cmp edi, 2
jne 0x403426
mov dword [esi + 0xc], 0
mov eax, 0x30
jmp 0x403811
cmp edi, 7
jne 0x40343c
mov dword [esi + 0xc], 0
mov eax, 0x31
jmp 0x403811
cmp edi, 0x65
jne 0x40345c
mov eax, 0x31
jmp 0x403811
mov dword [esi + 0xc], 0
mov eax, 0x31
jmp 0x403811
push 1
push 0x40a910
call fcn.00403818
add esp, 8
test eax, eax
je 0x40347b
mov dword [esi + 0xc], 0
jmp 0x403811
mov eax, dword [esi + 0x2c]
xor edi, edi
mov dword [0x415100], eax
call fcn.00401b47
cmp eax, 0xffffffff
jne 0x403499
mov eax, 0x1d
jmp 0x403811
cmp dword [0x4150dc], 0
jne 0x403513
push 0
call fcn.0040397c
add esp, 4
mov dword [0x412b5c], eax
test eax, eax
je 0x4034b7
mov edi, eax
movsx eax, word [0x412b46]
dec eax
cmp eax, dword [esi + 0x14]
jge 0x4034c9
mov edi, 0x19
test edi, edi
jne 0x403505
cmp dword [0x413024], 0
jne 0x4034ea
mov dword [0x40a8b0], 0
call fcn.00401e43
mov dword [0x412b5c], eax
cmp dword [0x412b5c], 0
jne 0x403505
mov eax, dword [esi + 0x14]
mov dword [0x40a8b0], eax
call fcn.00401e43
mov dword [0x412b5c], eax
cmp dword [0x412b5c], edi
jle 0x403513
mov edi, dword [0x412b5c]
mov dword [0x41521c], 0
test byte [0x40a768], 1
je 0x403530
mov dword [0x41521c], 1
cmp word [0x40a76a], 8
jle 0x40353f
mov edi, 0x2a
test edi, edi
jne 0x403783
push 0
mov eax, dword [0x40a78a]
push 0
push eax
push dword [0x412b64]
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
push 0
lea ecx, [ebp - 8]
push ecx
push 0x1e
push 0x412c80
push dword [0x412b64]
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x403580
cmp dword [ebp - 8], 0
jne 0x403585
mov edi, 3
cmp dword [0x412c80], 0x4034b50
je 0x403596
mov edi, 3
test edi, edi
jne 0x4035aa
movsx eax, word [0x412c9a]
push eax
call fcn.00401ab5
add esp, 4
call fcn.00401b2b
test edi, edi
jne 0x4037ec
push 0x40a910
call fcn.00402864
add esp, 4
mov dword [0x412b5c], eax
test eax, eax
je 0x4035fa
mov dword [esi + 0xc], 0
mov eax, dword [0x412b38]
push eax
call fcn.00406129
add esp, 4
mov eax, dword [0x413018]
push eax
call fcn.00406129
add esp, 4
mov eax, dword [0x412b5c]
jmp 0x403811
cmp dword [0x415100], 0
jne 0x403634
cmp dword [0x4150b8], 0
push 0x412cb0
je 0x40361a
push 0
push 0x84
jmp 0x403651
lea eax, [ebp - 0x984]
push eax
call dword [sym.imp.KERNEL32.dll_lstrcpyA]
lea eax, [ebp - 0x984]
push eax
push 0
push 0x48
jmp 0x403651
push 0x412cb0
lea eax, [ebp - 0x984]
push eax
call dword [sym.imp.KERNEL32.dll_lstrcpyA]
lea eax, [ebp - 0x984]
push eax
push 0
push 0x49
call fcn.00404940
add esp, 8
push eax
push 0x412dc0
call dword [sym.imp.USER32.dll_wsprintfA]
add esp, 0xc
push 0x412cb0
call ebx
cmp byte [eax + 0x412caf], 0x5c
je 0x403783
mov eax, dword [esi + 0xc]
mov eax, dword [eax + 0x12a]
and eax, 7
cmp dword [0x412ca4], 0
mov dword [0x413034], eax
je 0x4036af
mov eax, dword [ebp - 0x880]
mov ecx, dword [ebp - 0x87c]
mov word [0x412c8c], ax
mov word [0x412c8a], cx
push 0x412ee0
call fcn.004026ab
add esp, 4
mov dword [0x412b5c], eax
cmp eax, edi
jle 0x40377d
cmp dword [0x41521c], 0
je 0x40377d
cmp eax, 0x2c
jne 0x40377d
cmp dword [esi + 0x28], 0
jne 0x40376f
push 0x7f00
push 0
call dword [sym.imp.USER32.dll_LoadCursorA]
push eax
call dword [sym.imp.USER32.dll_SetCursor]
mov edi, eax
push 0x412cb0
lea eax, [ebp - 0x984]
push eax
call dword [sym.imp.KERNEL32.dll_lstrcpyA]
lea eax, [ebp - 0x984]
push eax
push 0
push 0x46
call fcn.00404940
add esp, 8
lea ecx, [ebp - 0x31c]
push eax
push ecx
call dword [sym.imp.USER32.dll_wsprintfA]
add esp, 0xc
lea ecx, [ebp - 0x31c]
push ecx
push 0
push 0
push 1
push 9
call fcn.00403baf
add esp, 0x14
mov ebx, eax
push edi
call dword [sym.imp.USER32.dll_SetCursor]
mov dword [esi + 0xc], 0
cmp ebx, 2
jne 0x403768
mov edi, 0x2c
jmp 0x403783
mov edi, 0x31
jmp 0x403783
mov dword [esi + 0xc], 0
mov edi, 0x31
jmp 0x403783
mov edi, dword [0x412b5c]
call fcn.0040288f
test edi, edi
jne 0x4037ec
cmp dword [0x412b60], 0
je 0x4037ec
push 0x412ee0
lea eax, [ebp - 0x638]
push eax
call dword [sym.imp.KERNEL32.dll_lstrcpyA]
movsx eax, word [0x40a76e]
movsx ecx, word [0x40a76c]
mov edx, dword [esi + 0xc]
mov dword [ebp - 0x534], eax
push dword [0x40a8b4]
mov dword [ebp - 0x530], ecx
mov ecx, dword [esi + 0x14]
mov eax, dword [edx + 0x12a]
mov dword [ebp - 0x52c], eax
mov dword [ebp - 0x528], ecx
lea eax, [ebp - 0x638]
push eax
call dword [0x412b60]
mov dword [esi + 0xc], 0
mov eax, dword [0x412b38]
push eax
call fcn.00406129
add esp, 4
mov eax, dword [0x413018]
push eax
call fcn.00406129
add esp, 4
mov eax, edi
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret