Function at 0x401d20
Capabilities:
Check if file exists
Delete file
Get file attributes
Read file on windows
Write file on windows

Disassembly:
sub esp, 0x68c
mov dx, word [0x428280]
push ebx
push ebp
push esi
push edi
mov ecx, 0x81
xor eax, eax
lea edi, [esp + 0x28e]
mov word [esp + 0x28c], dx
mov word [esp + 0x84], dx
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
mov ecx, 0x81
xor eax, eax
lea edi, [esp + 0x86]
mov ebx, dword [esp + 0x6a4]
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
mov ecx, 0x81
xor eax, eax
lea edi, [esp + 0x496]
mov word [esp + 0x494], dx
rep stosd dword es:[edi], eax
mov ebp, dword [ebx + 0x10]
mov ecx, dword [0x426030]
stosw word es:[edi], ax
mov eax, dword [esp + 0x6a0]
push 2
add eax, ebp
push 0
neg eax
push eax
push ecx
mov dword [esp + 0x20], 0
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
cmp eax, 0xffffffff
jne 0x401dc6
call dword [sym.imp.KERNEL32.dll_GetLastError]
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x68c
ret 0xc
mov edi, dword [esp + 0x6a8]
mov ebp, dword [sym.imp.MSVCRT.dll_wcsncpy]
push 0x104
cmp word [edi], 0
je 0x401e7e
lea edx, [esp + 0x290]
push edi
push edx
call ebp
mov esi, dword [sym.imp.MSVCRT.dll_wcsrchr]
lea eax, [esp + 0x298]
push 0x5c
push eax
call esi
add esp, 0x14
test eax, eax
jne 0x401e18
pop edi
pop esi
pop ebp
mov eax, 3
pop ebx
add esp, 0x68c
ret 0xc
mov word [eax], 0
add eax, 2
push 0x2e
push eax
call dword [sym.imp.MSVCRT.dll_wcschr]
add esp, 8
test eax, eax
jne 0x401e69
lea ecx, [esp + 0x28c]
push ecx
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
cmp eax, 0xffffffff
jne 0x401ed5
lea edx, [esp + 0x28c]
push edx
call fcn.00402390
test eax, eax
mov dword [esp + 0x10], eax
je 0x401ed5
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x68c
ret 0xc
push 0x104
lea eax, [esp + 0x88]
push edi
push eax
call ebp
add esp, 0xc
jmp 0x401ed5
lea ecx, [esp + 0x290]
push ecx
push 0
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
test eax, eax
jne 0x401ea5
call dword [sym.imp.KERNEL32.dll_GetLastError]
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x68c
ret 0xc
mov esi, dword [sym.imp.MSVCRT.dll_wcsrchr]
lea edx, [esp + 0x28c]
push 0x5c
push edx
call esi
add esp, 8
test eax, eax
jne 0x401ed0
pop edi
pop esi
pop ebp
mov eax, 3
pop ebx
add esp, 0x68c
ret 0xc
mov word [eax], 0
cmp word [esp + 0x84], 0
jne 0x401fc4
add ebx, 0x40
push 0x104
lea eax, [esp + 0x498]
push ebx
push eax
call ebp
mov ebp, dword [sym.imp.MSVCRT.dll__snwprintf]
add esp, 0xc
lea ecx, [esp + 0x494]
lea edx, [esp + 0x28c]
push ecx
push edx
push 0x4260b4
lea eax, [esp + 0x90]
push 0x104
push eax
call ebp
lea ecx, [esp + 0x4a8]
push 0x2e
push ecx
call esi
mov esi, eax
add esp, 0x1c
test esi, esi
je 0x401f41
mov word [esi], 0
add esi, 2
mov edi, 2
lea edx, [esp + 0x84]
push edx
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
cmp eax, 0xffffffff
jne 0x401f64
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 2
je 0x401fc4
test esi, esi
je 0x401f93
push esi
lea eax, [esp + 0x498]
push edi
lea ecx, [esp + 0x294]
push eax
push ecx
push str._s_s__d_._s
lea edx, [esp + 0x98]
push 0x104
push edx
call ebp
add esp, 0x1c
jmp 0x401fbb
lea eax, [esp + 0x494]
push edi
lea ecx, [esp + 0x290]
push eax
push ecx
push str._s_s__d_
lea edx, [esp + 0x94]
push 0x104
push edx
call ebp
add esp, 0x18
inc edi
cmp edi, 0x2710
jb 0x401f46
mov esi, dword [sym.imp.KERNEL32.dll_CreateFileW]
push 0
push 0x80
push 1
push 0
push 1
lea eax, [esp + 0x98]
push 0xc0000000
push eax
call esi
mov edi, eax
cmp edi, 0xffffffff
jne 0x402023
push 0
push 0x80
push 5
push 0
push 1
lea ecx, [esp + 0x98]
push 0xc0000000
push ecx
call esi
mov edi, eax
cmp edi, 0xffffffff
jne 0x402023
call dword [sym.imp.KERNEL32.dll_GetLastError]
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x68c
ret 0xc
xor edx, edx
mov ebx, 0x10000
mov dword [esp + 0x19], edx
push ebx
mov dword [esp + 0x21], edx
push 0x40
mov dword [esp + 0x29], edx
mov byte [esp + 0x20], 0
mov word [esp + 0x2d], dx
xor esi, esi
mov byte [esp + 0x2f], dl
call dword [sym.imp.KERNEL32.dll_GlobalAlloc]
mov ebp, eax
test ebp, ebp
je 0x4021b8
lea eax, [esp + 0x2c]
push eax
call fcn.00409250
mov ecx, dword [esp + 0x6a4]
mov eax, dword [ecx + 0x10]
test eax, eax
jbe 0x4020ee
sub eax, esi
cmp eax, ebx
jae 0x402079
mov ebx, eax
mov eax, dword [0x426030]
lea edx, [esp + 0x14]
push 0
push edx
push ebx
push ebp
push eax
mov dword [esp + 0x28], 0
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x40216e
mov eax, dword [esp + 0x14]
test eax, eax
je 0x402164
lea ecx, [esp + 0x28]
push 0
push ecx
push eax
push ebp
push edi
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x40216e
mov eax, dword [esp + 0x28]
mov ecx, dword [esp + 0x14]
cmp eax, ecx
jne 0x40217d
push eax
lea edx, [esp + 0x30]
push ebp
push edx
add esi, eax
call fcn.00409280
mov eax, dword [esp + 0x6a4]
mov eax, dword [eax + 0x10]
cmp esi, eax
jb 0x402071
mov eax, dword [esp + 0x10]
test eax, eax
jne 0x402116
push 0x20
lea ecx, [esp + 0x30]
push 0x426034
push ecx
call fcn.00409280
lea edx, [esp + 0x18]
lea eax, [esp + 0x2c]
push edx
push eax
call fcn.00409350
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov ecx, 4
lea edi, [esp + 0x18]
mov edx, dword [esp + 0x6a4]
xor eax, eax
lea esi, [edx + 0x14]
repe cmpsd dword [esi], dword es:[edi]
je 0x402187
lea ecx, [esp + 0x84]
mov dword [esp + 0x10], 0x17
push ecx
call dword [sym.imp.KERNEL32.dll_DeleteFileW]
push ebp
call dword [sym.imp.KERNEL32.dll_GlobalFree]
pop edi
pop esi
mov eax, dword [esp + 8]
pop ebp
pop ebx
add esp, 0x68c
ret 0xc
mov dword [esp + 0x10], 0x1e
jmp 0x402116
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [esp + 0x10], eax
jmp 0x4020ee
mov dword [esp + 0x10], 0x1d
jmp 0x402116
mov eax, dword [esp + 0x6a8]
lea edx, [esp + 0x84]
push edx
push eax
call dword [sym.imp.MSVCRT.dll_wcscpy]
add esp, 8
push ebp
call dword [sym.imp.KERNEL32.dll_GlobalFree]
pop edi
pop esi
mov eax, dword [esp + 8]
pop ebp
pop ebx
add esp, 0x68c
ret 0xc
call dword [sym.imp.KERNEL32.dll_GetLastError]
push edi
mov dword [esp + 0x14], eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
pop edi
pop esi
mov eax, dword [esp + 8]
pop ebp
pop ebx
add esp, 0x68c
ret 0xc