Function at 0x402d35
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, 0x415270
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 [0x40a77c], eax
cmp dword [esi + 0x2c], eax
jne 0x402db1
cmp dword [0x415094], eax
jne 0x402db1
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 0x402db7
push 0x415290
lea eax, [ebp - 0x420]
push eax
call dword [sym.imp.KERNEL32.dll_lstrcatA]
jmp 0x402db7
mov ebx, dword [sym.imp.KERNEL32.dll_lstrlenA]
cmp dword [0x4150b8], 0
mov edi, 0x2f
jne 0x402de8
lea eax, [ebp - 0x770]
mov dword [esi + 0xc], eax
cmp dword [0x4150b8], 0
jne 0x402de8
push esi
call fcn.00402140
add esp, 4
test eax, eax
jne 0x40357e
lea eax, [ebp - 0x420]
xor edi, edi
push eax
push 0x412c90
call dword [sym.imp.KERNEL32.dll_lstrcpyA]
mov eax, dword [esi + 0xc]
add eax, 0x26
push eax
call ebx
test eax, eax
jle 0x402e26
mov eax, dword [esi + 0xc]
lea eax, [eax + edi + 0x26]
cmp byte [eax], 0x2f
jne 0x402e18
mov byte [eax], 0x5c
inc edi
mov eax, dword [esi + 0xc]
add eax, 0x26
push eax
call ebx
cmp eax, edi
jg 0x402e09
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 0x402e6a
mov eax, dword [esi + 0xc]
lea ecx, [ebp - 0x524]
add eax, 0x26
push eax
push ecx
call fcn.00401c3b
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 0x412c90
call dword [sym.imp.KERNEL32.dll_lstrcatA]
cmp dword [esi + 0x2c], 0
jne 0x403254
cmp dword [0x415094], 0
jne 0x403254
cmp dword [0x412c84], 0
je 0x402f14
push 0x412c90
lea eax, [ebp - 0x984]
push eax
call dword [sym.imp.KERNEL32.dll_lstrcpyA]
movsx eax, word [0x40a74e]
movsx ecx, word [0x40a74c]
mov edx, dword [esi + 0xc]
mov dword [ebp - 0x880], eax
push dword [0x40a884]
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 [0x412c84]
lea ecx, [ebp - 0x984]
push ecx
push 0x412c90
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 0x412c90
call fcn.004059e2
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.00405f8b
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.00405f64
add esp, 8
test eax, eax
je 0x402f8d
mov byte [eax], 0
lea eax, [ebp - 0x218]
push eax
call dword [sym.imp.KERNEL32.dll_SetCurrentDirectoryA]
test eax, eax
je 0x402fa6
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 0x402f64
push 0x415290
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 - 0x114]
push ecx
call ebx
mov edi, eax
lea ecx, [ebp - 0x218]
push ecx
call ebx
cmp edi, eax
jge 0x40305c
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 0x40301c
mov al, byte [ecx]
cmp al, 0x5c
je 0x40301c
inc ecx
mov byte [edi], al
inc edi
cmp byte [ecx], 0
jne 0x40300d
push 0
lea eax, [ebp - 0x114]
push eax
mov byte [edi], 0
call dword [sym.imp.KERNEL32.dll_CreateDirectoryA]
test eax, eax
je 0x403081
push 0x415290
lea eax, [ebp - 0x114]
push eax
call dword [sym.imp.KERNEL32.dll_lstrcatA]
lea eax, [ebp - 0x114]
push eax
call ebx
mov edi, eax
lea eax, [ebp - 0x218]
push eax
call ebx
cmp edi, eax
jl 0x402fe8
push 0x412c90
push 0x40a8f0
call dword [sym.imp.KERNEL32.dll_lstrcmpiA]
test eax, eax
jne 0x403092
mov dword [esi + 0xc], 0
mov eax, 0x31
jmp 0x403607
mov dword [esi + 0xc], 0
mov eax, 0x1c
jmp 0x403607
push 0x412c90
push 0x412ec0
call dword [sym.imp.KERNEL32.dll_lstrcpyA]
push 0
push pe_nt_image_headers32
push 3
push 0
push 3
push 0x80000000
push 0x412c90
call dword [sym.imp.KERNEL32.dll_CreateFileA]
cmp eax, 0xffffffff
je 0x403254
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
cmp dword [0x41507c], 0
jne 0x403254
cmp dword [esi + 0x28], 0
jne 0x403243
push 0x7f00
push 0
call dword [sym.imp.USER32.dll_LoadCursorA]
push eax
call dword [sym.imp.USER32.dll_SetCursor]
push 0x412c90
mov dword [ebp - 0x10], eax
call dword [sym.imp.KERNEL32.dll_GetFileAttributesA]
mov dword [ebp - 0xc], eax
cmp eax, 0xffffffff
je 0x4031fa
test al, 0x10
jne 0x4031fa
push 0x412c90
test al, 1
lea eax, [ebp - 0x984]
push eax
je 0x4031a3
call dword [sym.imp.KERNEL32.dll_lstrcpyA]
lea eax, [ebp - 0x984]
push eax
push 0
push pe_nt_image_headers32
call fcn.00404723
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.00403993
add esp, 0x14
mov edi, eax
cmp edi, 0x64
je 0x40317c
cmp edi, 5
jne 0x40318b
mov dword [0x41507c], 1
mov edi, 6
cmp edi, 6
jne 0x4031ff
mov eax, dword [ebp - 0xc]
and al, 0xfe
push eax
push 0x412c90
call dword [sym.imp.KERNEL32.dll_SetFileAttributesA]
jmp 0x4031ff
call dword [sym.imp.KERNEL32.dll_lstrcpyA]
lea eax, [ebp - 0x984]
push eax
push 0
push 0x44
call fcn.00404723
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.00403993
add esp, 0x14
mov edi, eax
cmp edi, 0x64
je 0x4031f0
cmp edi, 5
jne 0x4031ff
mov dword [0x41507c], 1
mov edi, 6
push dword [ebp - 0x10]
call dword [sym.imp.USER32.dll_SetCursor]
cmp edi, 2
jne 0x40321e
mov dword [esi + 0xc], 0
mov eax, 0x30
jmp 0x403607
cmp edi, 7
jne 0x403234
mov dword [esi + 0xc], 0
mov eax, 0x31
jmp 0x403607
cmp edi, 0x65
jne 0x403254
mov eax, 0x31
jmp 0x403607
mov dword [esi + 0xc], 0
mov eax, 0x31
jmp 0x403607
push 0x40a8f0
call fcn.0040360e
add esp, 4
test eax, eax
je 0x403271
mov dword [esi + 0xc], 0
jmp 0x403607
mov eax, dword [esi + 0x2c]
xor edi, edi
mov dword [0x4150dc], eax
call fcn.00401985
cmp eax, 0xffffffff
jne 0x40328f
mov eax, 0x1d
jmp 0x403607
cmp dword [0x4150b8], 0
jne 0x403309
push 0
call fcn.00403760
add esp, 4
mov dword [0x412b3c], eax
test eax, eax
je 0x4032ad
mov edi, eax
movsx eax, word [0x412b26]
dec eax
cmp eax, dword [esi + 0x14]
jge 0x4032bf
mov edi, 0x19
test edi, edi
jne 0x4032fb
cmp dword [0x413004], 0
jne 0x4032e0
mov dword [0x40a88c], 0
call fcn.00401cae
mov dword [0x412b3c], eax
cmp dword [0x412b3c], 0
jne 0x4032fb
mov eax, dword [esi + 0x14]
mov dword [0x40a88c], eax
call fcn.00401cae
mov dword [0x412b3c], eax
cmp edi, dword [0x412b3c]
jge 0x403309
mov edi, dword [0x412b3c]
mov dword [0x4151f4], 0
test byte [0x40a748], 1
je 0x403326
mov dword [0x4151f4], 1
cmp word [0x40a74a], 8
jle 0x403335
mov edi, 0x2a
test edi, edi
jne 0x403579
push 0
mov eax, dword [0x40a76a]
push 0
push eax
push dword [0x412b44]
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
push 0
lea ecx, [ebp - 8]
push ecx
push 0x1e
push 0x412c60
push dword [0x412b44]
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x403376
cmp dword [ebp - 8], 0
jne 0x40337b
mov edi, 3
cmp dword [0x412c60], 0x4034b50
je 0x40338c
mov edi, 3
test edi, edi
jne 0x4033a0
movsx eax, word [0x412c7a]
push eax
call fcn.00401903
add esp, 4
call fcn.00401969
test edi, edi
jne 0x4035e2
push 0x40a8f0
call fcn.004026c4
add esp, 4
mov dword [0x412b3c], eax
test eax, eax
je 0x4033f0
mov dword [esi + 0xc], 0
mov eax, dword [0x412b18]
push eax
call fcn.00405e82
add esp, 4
mov eax, dword [0x412ff8]
push eax
call fcn.00405e82
add esp, 4
mov eax, dword [0x412b3c]
jmp 0x403607
cmp dword [0x4150dc], 0
jne 0x40342a
cmp dword [0x415094], 0
push 0x412c90
je 0x403410
push 0
push 0x84
jmp 0x403447
lea eax, [ebp - 0x984]
push eax
call dword [sym.imp.KERNEL32.dll_lstrcpyA]
lea eax, [ebp - 0x984]
push eax
push 0
push 0x48
jmp 0x403447
push 0x412c90
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.00404723
add esp, 8
push eax
push 0x412da0
call dword [sym.imp.USER32.dll_wsprintfA]
add esp, 0xc
push 0x412c90
call ebx
cmp byte [eax + 0x412c8f], 0x5c
je 0x403579
mov eax, dword [esi + 0xc]
mov eax, dword [eax + 0x12a]
and eax, 7
cmp dword [0x412c84], 0
mov dword [0x413014], eax
je 0x4034a5
mov eax, dword [ebp - 0x880]
mov ecx, dword [ebp - 0x87c]
mov word [0x412c6c], ax
mov word [0x412c6a], cx
push 0x412ec0
call fcn.0040251d
add esp, 4
mov dword [0x412b3c], eax
cmp edi, eax
jge 0x403573
cmp dword [0x4151f4], 0
je 0x403573
cmp eax, 0x2c
jne 0x403573
cmp dword [esi + 0x28], 0
jne 0x403565
push 0x7f00
push 0
call dword [sym.imp.USER32.dll_LoadCursorA]
push eax
call dword [sym.imp.USER32.dll_SetCursor]
mov edi, eax
push 0x412c90
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.00404723
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.00403993
add esp, 0x14
mov ebx, eax
push edi
call dword [sym.imp.USER32.dll_SetCursor]
mov dword [esi + 0xc], 0
cmp ebx, 2
jne 0x40355e
mov edi, 0x2c
jmp 0x403579
mov edi, 0x31
jmp 0x403579
mov dword [esi + 0xc], 0
mov edi, 0x31
jmp 0x403579
mov edi, dword [0x412b3c]
call fcn.004026ef
test edi, edi
jne 0x4035e2
cmp dword [0x412b40], 0
je 0x4035e2
push 0x412ec0
lea eax, [ebp - 0x638]
push eax
call dword [sym.imp.KERNEL32.dll_lstrcpyA]
movsx eax, word [0x40a74e]
movsx ecx, word [0x40a74c]
mov edx, dword [esi + 0xc]
mov dword [ebp - 0x534], eax
push dword [0x40a890]
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 [0x412b40]
mov dword [esi + 0xc], 0
mov eax, dword [0x412b18]
push eax
call fcn.00405e82
add esp, 4
mov eax, dword [0x412ff8]
push eax
call fcn.00405e82
add esp, 4
mov eax, edi
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret