Function at 0x402f13
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, 0x415290
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 0x402f8f
cmp dword [0x4150b0], eax
jne 0x402f8f
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 0x402f95
push 0x4152c8
lea eax, [ebp - 0x420]
push eax
call dword [sym.imp.KERNEL32.dll_lstrcatA]
jmp 0x402f95
mov ebx, dword [sym.imp.KERNEL32.dll_lstrlenA]
cmp dword [0x4150d4], 0
mov edi, 0x2f
jne 0x402fc6
lea eax, [ebp - 0x770]
mov dword [esi + 0xc], eax
cmp dword [0x4150d4], 0
jne 0x402fc6
push esi
call fcn.004022b6
add esp, 4
test eax, eax
jne 0x40375e
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 0x403004
mov eax, dword [esi + 0xc]
lea eax, [eax + edi + 0x26]
cmp byte [eax], 0x2f
jne 0x402ff6
mov byte [eax], 0x5c
inc edi
mov eax, dword [esi + 0xc]
add eax, 0x26
push eax
call ebx
cmp eax, edi
jg 0x402fe7
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 0x403048
mov eax, dword [esi + 0xc]
lea ecx, [ebp - 0x524]
add eax, 0x26
push eax
push ecx
call fcn.00401da6
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 0x403432
cmp dword [0x4150b0], 0
jne 0x403432
cmp dword [0x412ca4], 0
je 0x4030f2
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.00405bf2
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.0040619b
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.00406174
add esp, 8
test eax, eax
je 0x40316b
mov byte [eax], 0
lea eax, [ebp - 0x218]
push eax
call dword [sym.imp.KERNEL32.dll_SetCurrentDirectoryA]
test eax, eax
je 0x403184
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 0x403142
push 0x4152c8
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 0x40323a
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 0x4031fa
mov al, byte [ecx]
cmp al, 0x5c
je 0x4031fa
inc ecx
mov byte [edi], al
inc edi
cmp byte [ecx], 0
jne 0x4031eb
push 0
lea eax, [ebp - 0x114]
push eax
mov byte [edi], 0
call dword [sym.imp.KERNEL32.dll_CreateDirectoryA]
test eax, eax
je 0x40325f
push 0x4152c8
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 0x4031c6
push 0x412cb0
push 0x40a910
call dword [sym.imp.KERNEL32.dll_lstrcmpiA]
test eax, eax
jne 0x403270
mov dword [esi + 0xc], 0
mov eax, 0x31
jmp 0x4037e7
mov dword [esi + 0xc], 0
mov eax, 0x1c
jmp 0x4037e7
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 0x403432
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
cmp dword [0x415094], 0
jne 0x403432
cmp dword [esi + 0x28], 0
jne 0x403421
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 0x4033d8
test al, 0x10
jne 0x4033d8
push 0x412cb0
test al, 1
lea eax, [ebp - 0x984]
push eax
je 0x403381
call dword [sym.imp.KERNEL32.dll_lstrcpyA]
lea eax, [ebp - 0x984]
push eax
push 0
push pe_nt_image_headers32
call fcn.00404916
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.00403b85
add esp, 0x14
mov edi, eax
cmp edi, 0x64
je 0x40335a
cmp edi, 5
jne 0x403369
mov dword [0x415094], 1
mov edi, 6
cmp edi, 6
jne 0x4033dd
mov eax, dword [ebp - 0xc]
and al, 0xfe
push eax
push 0x412cb0
call dword [sym.imp.KERNEL32.dll_SetFileAttributesA]
jmp 0x4033dd
call dword [sym.imp.KERNEL32.dll_lstrcpyA]
lea eax, [ebp - 0x984]
push eax
push 0
push 0x44
call fcn.00404916
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.00403b85
add esp, 0x14
mov edi, eax
cmp edi, 0x64
je 0x4033ce
cmp edi, 5
jne 0x4033dd
mov dword [0x415094], 1
mov edi, 6
push dword [ebp - 0x10]
call dword [sym.imp.USER32.dll_SetCursor]
cmp edi, 2
jne 0x4033fc
mov dword [esi + 0xc], 0
mov eax, 0x30
jmp 0x4037e7
cmp edi, 7
jne 0x403412
mov dword [esi + 0xc], 0
mov eax, 0x31
jmp 0x4037e7
cmp edi, 0x65
jne 0x403432
mov eax, 0x31
jmp 0x4037e7
mov dword [esi + 0xc], 0
mov eax, 0x31
jmp 0x4037e7
push 1
push 0x40a910
call fcn.004037ee
add esp, 8
test eax, eax
je 0x403451
mov dword [esi + 0xc], 0
jmp 0x4037e7
mov eax, dword [esi + 0x2c]
xor edi, edi
mov dword [0x4150f8], eax
call fcn.00401b1d
cmp eax, 0xffffffff
jne 0x40346f
mov eax, 0x1d
jmp 0x4037e7
cmp dword [0x4150d4], 0
jne 0x4034e9
push 0
call fcn.00403952
add esp, 4
mov dword [0x412b5c], eax
test eax, eax
je 0x40348d
mov edi, eax
movsx eax, word [0x412b46]
dec eax
cmp eax, dword [esi + 0x14]
jge 0x40349f
mov edi, 0x19
test edi, edi
jne 0x4034db
cmp dword [0x413024], 0
jne 0x4034c0
mov dword [0x40a8b0], 0
call fcn.00401e19
mov dword [0x412b5c], eax
cmp dword [0x412b5c], 0
jne 0x4034db
mov eax, dword [esi + 0x14]
mov dword [0x40a8b0], eax
call fcn.00401e19
mov dword [0x412b5c], eax
cmp dword [0x412b5c], edi
jle 0x4034e9
mov edi, dword [0x412b5c]
mov dword [0x415214], 0
test byte [0x40a768], 1
je 0x403506
mov dword [0x415214], 1
cmp word [0x40a76a], 8
jle 0x403515
mov edi, 0x2a
test edi, edi
jne 0x403759
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 0x403556
cmp dword [ebp - 8], 0
jne 0x40355b
mov edi, 3
cmp dword [0x412c80], 0x4034b50
je 0x40356c
mov edi, 3
test edi, edi
jne 0x403580
movsx eax, word [0x412c9a]
push eax
call fcn.00401a8b
add esp, 4
call fcn.00401b01
test edi, edi
jne 0x4037c2
push 0x40a910
call fcn.0040283a
add esp, 4
mov dword [0x412b5c], eax
test eax, eax
je 0x4035d0
mov dword [esi + 0xc], 0
mov eax, dword [0x412b38]
push eax
call fcn.00406109
add esp, 4
mov eax, dword [0x413018]
push eax
call fcn.00406109
add esp, 4
mov eax, dword [0x412b5c]
jmp 0x4037e7
cmp dword [0x4150f8], 0
jne 0x40360a
cmp dword [0x4150b0], 0
push 0x412cb0
je 0x4035f0
push 0
push 0x84
jmp 0x403627
lea eax, [ebp - 0x984]
push eax
call dword [sym.imp.KERNEL32.dll_lstrcpyA]
lea eax, [ebp - 0x984]
push eax
push 0
push 0x48
jmp 0x403627
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.00404916
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 0x403759
mov eax, dword [esi + 0xc]
mov eax, dword [eax + 0x12a]
and eax, 7
cmp dword [0x412ca4], 0
mov dword [0x413034], eax
je 0x403685
mov eax, dword [ebp - 0x880]
mov ecx, dword [ebp - 0x87c]
mov word [0x412c8c], ax
mov word [0x412c8a], cx
push 0x412ee0
call fcn.00402681
add esp, 4
mov dword [0x412b5c], eax
cmp eax, edi
jle 0x403753
cmp dword [0x415214], 0
je 0x403753
cmp eax, 0x2c
jne 0x403753
cmp dword [esi + 0x28], 0
jne 0x403745
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.00404916
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.00403b85
add esp, 0x14
mov ebx, eax
push edi
call dword [sym.imp.USER32.dll_SetCursor]
mov dword [esi + 0xc], 0
cmp ebx, 2
jne 0x40373e
mov edi, 0x2c
jmp 0x403759
mov edi, 0x31
jmp 0x403759
mov dword [esi + 0xc], 0
mov edi, 0x31
jmp 0x403759
mov edi, dword [0x412b5c]
call fcn.00402865
test edi, edi
jne 0x4037c2
cmp dword [0x412b60], 0
je 0x4037c2
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.00406109
add esp, 4
mov eax, dword [0x413018]
push eax
call fcn.00406109
add esp, 4
mov eax, edi
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret