Function at 0x401250
Capabilities:
Check if file exists
Create directory
Delete file
Get file attributes
Get file size
Read file on windows
Write file on windows

Disassembly:
push 0xffffffffffffffff
push 0x40e9dc
mov eax, dword fs:[0]
push eax
mov eax, 0x1014
call fcn.0040d6d0
mov eax, dword [0x413090]
xor eax, esp
mov dword [esp + 0x1010], eax
push ebx
push ebp
push esi
push edi
mov eax, dword [0x413090]
xor eax, esp
push eax
lea eax, [esp + 0x1028]
mov dword fs:[0], eax
mov edi, dword [sym.imp.KERNEL32.dll_Sleep]
push 0x3e8
call edi
push 0x206
xor ebx, ebx
lea ecx, [esp + 0x622]
xor eax, eax
push ebx
push ecx
mov word [esp + 0x628], ax
call fcn.00405360
add esp, 0xc
push 0x104
lea edx, [esp + 0x620]
push edx
push ebx
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
push ebx
push 0x80
push 3
push ebx
push 3
push 0x80000000
lea eax, [esp + 0x634]
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov ebp, eax
mov dword [esp + 0x40], ebp
cmp ebp, 0xffffffff
je 0x401994
push 0x20c
lea ecx, [esp + 0x1c4]
push ebx
push ecx
mov dword [esp + 0x1c8], ebx
call fcn.00405360
add esp, 0xc
push ebx
push ebp
mov dword [esp + 0x44], ebx
call dword [sym.imp.KERNEL32.dll_GetFileSize]
push ebx
lea edx, [esp + 0x40]
push edx
mov esi, eax
push 0x40
lea eax, [esp + 0x188]
push eax
push ebp
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x401987
mov ecx, dword [esp + 0x1b8]
push ebx
push ebx
push ecx
push ebp
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
push ebx
lea edx, [esp + 0x40]
push edx
push 0xf8
lea eax, [esp + 0x70]
push eax
push ebp
call dword [sym.imp.KERNEL32.dll_ReadFile]
mov eax, dword [esp + 0xfc]
mov ebp, eax
cmp eax, ebx
jne 0x401380
mov ebp, esi
mov esi, dword [esp + 0x40]
push ebx
push ebx
lea ecx, [ebp - 0x210]
push ecx
push esi
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
push ebx
lea edx, [esp + 0x40]
push edx
push 0x210
lea eax, [esp + 0x1c8]
push eax
push esi
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x401981
cmp dword [esp + 0x1bc], 0xff99ff99
jne 0x401987
sub esp, 0x1c
lea eax, [esp + 0x1e0]
mov ecx, esp
mov dword [esp + 0x54], esp
call fcn.00403e90
lea ecx, [esp + 0x17c]
push ecx
call fcn.004031a0
add esp, 0x20
lea edx, [esp + 0x160]
push edx
lea esi, [esp + 0x48]
mov dword [esp + 0x1034], ebx
call fcn.00403170
mov byte [esp + 0x1030], 1
cmp dword [esp + 0x5c], 8
mov eax, dword [esp + 0x48]
jae 0x40141b
lea eax, [esp + 0x48]
push eax
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
cmp eax, 0xffffffff
je 0x401436
shr eax, 4
not eax
and eax, 1
mov esi, eax
jmp 0x4014fd
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 2
je 0x4014fb
cmp eax, 3
je 0x4014fb
cmp eax, 0x7b
je 0x4014fb
lea ecx, [esp + 0x44]
push ecx
lea esi, [esp + 0x18]
call fcn.00403170
cmp dword [esp + 0x2c], 8
mov eax, dword [esp + 0x18]
jae 0x401474
lea eax, [esp + 0x18]
lea edx, [esp + 0x3cc]
push edx
push eax
call dword [sym.imp.KERNEL32.dll_FindFirstFileW]
cmp eax, 0xffffffff
je 0x4014d4
push eax
call dword [sym.imp.KERNEL32.dll_FindClose]
xor eax, eax
cmp dword [esp + 0x3cc], ebx
setne al
xor ecx, ecx
cmp eax, ebx
sete cl
cmp dword [esp + 0x2c], 8
mov esi, ecx
jb 0x4014b8
mov edx, dword [esp + 0x18]
push edx
call fcn.004045f6
add esp, 4
xor eax, eax
mov dword [esp + 0x2c], 7
mov dword [esp + 0x28], ebx
mov word [esp + 0x18], ax
cmp esi, ebx
je 0x4014fb
lea esi, [eax + 1]
jmp 0x4014fd
cmp dword [esp + 0x2c], 8
jb 0x4014e8
mov ecx, dword [esp + 0x18]
push ecx
call fcn.004045f6
add esp, 4
xor edx, edx
mov dword [esp + 0x2c], 7
mov dword [esp + 0x28], ebx
mov word [esp + 0x18], dx
xor esi, esi
mov byte [esp + 0x1030], bl
cmp dword [esp + 0x5c], 8
jb 0x401518
mov eax, dword [esp + 0x48]
push eax
call fcn.004045f6
add esp, 4
cmp esi, ebx
je 0x401547
push ebx
sub esp, 0x1c
lea ecx, [esp + 0x180]
mov esi, esp
mov dword [esp + 0x58], esp
push ecx
call fcn.00403170
call section..text
add esp, 0x20
push 0x2710
call edi
jmp 0x401707
sub esp, 0x1c
lea edx, [esp + 0x17c]
mov esi, esp
mov dword [esp + 0x54], esp
push edx
call fcn.00403170
lea ecx, [esp + 0x30]
call fcn.00402920
add esp, 0x1c
mov byte [esp + 0x1030], 2
mov eax, dword [esp + 0x28]
cmp eax, ebx
ja 0x401595
mov byte [esp + 0x1030], bl
cmp dword [esp + 0x2c], 8
jb 0x401707
mov eax, dword [esp + 0x18]
push eax
jmp 0x4016ff
lea esi, [eax - 1]
cmp esi, eax
jbe 0x4015a5
call fcn.00404a2b
mov eax, dword [esp + 0x28]
mov ecx, dword [esp + 0x18]
mov edi, 8
cmp dword [esp + 0x2c], edi
jae 0x4015b8
lea ecx, [esp + 0x18]
cmp word [ecx + esi*2], 0x5c
jne 0x40160f
lea esi, [eax - 1]
cmp esi, eax
jbe 0x4015cb
call fcn.00404a2b
mov eax, dword [esp + 0x18]
cmp dword [esp + 0x2c], edi
jae 0x4015d9
lea eax, [esp + 0x18]
xor ecx, ecx
mov word [eax + esi*2], cx
mov eax, dword [esp + 0x18]
cmp dword [esp + 0x2c], edi
jae 0x4015ed
lea eax, [esp + 0x18]
mov ecx, eax
lea esi, [ecx + 2]
mov dx, word [ecx]
add ecx, 2
cmp dx, bx
jne 0x4015f2
sub ecx, esi
sar ecx, 1
push ecx
lea esi, [esp + 0x18]
call fcn.00403de0
mov eax, dword [esp + 0x28]
cmp eax, 3
jb 0x4016ed
push 0xffffffffffffffff
xor edx, edx
mov edi, 7
push ebx
lea eax, [esp + 0x1c]
lea ecx, [esp + 0x4c]
mov dword [esp + 0x64], edi
mov dword [esp + 0x60], ebx
mov word [esp + 0x50], dx
call fcn.00403a70
cmp dword [esp + 0x5c], 8
mov eax, dword [esp + 0x48]
jae 0x40164b
lea eax, [esp + 0x48]
push eax
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
cmp eax, 0xffffffff
je 0x401662
test al, 0x10
je 0x401662
mov esi, 1
jmp 0x401664
xor esi, esi
cmp dword [esp + 0x5c], 8
jb 0x401678
mov eax, dword [esp + 0x48]
push eax
call fcn.004045f6
add esp, 4
cmp esi, ebx
jne 0x4016e8
sub esp, 0x1c
mov dword [esp + 0x54], esp
mov esi, esp
sub esp, 0x1c
mov ecx, esp
mov dword [esp + 0x70], esp
push 0xffffffffffffffff
xor edx, edx
mov dword [ecx + 0x18], edi
mov dword [ecx + 0x14], ebx
push ebx
lea eax, [esp + 0x54]
mov word [ecx + 4], dx
call fcn.00403a70
mov ecx, esi
call fcn.00402a80
add esp, 0x1c
call fcn.00402b00
add esp, 0x1c
cmp eax, ebx
je 0x4016d3
cmp dword [esp + 0x2c], 8
mov eax, dword [esp + 0x18]
jae 0x4016cb
lea eax, [esp + 0x18]
push ebx
push eax
call dword [sym.imp.KERNEL32.dll_CreateDirectoryW]
mov byte [esp + 0x1030], bl
cmp dword [esp + 0x2c], 8
jb 0x401707
mov eax, dword [esp + 0x18]
push eax
jmp 0x4016ff
mov edi, 8
mov byte [esp + 0x1030], bl
cmp dword [esp + 0x2c], edi
jb 0x401707
mov ecx, dword [esp + 0x18]
push ecx
call fcn.004045f6
add esp, 4
sub ebp, dword [esp + 0x1c0]
mov esi, dword [esp + 0x40]
push ebx
push ebx
sub ebp, 0x210
push ebp
push esi
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov edx, dword [esp + 0x1c0]
push edx
call fcn.004045dc
mov ecx, dword [esp + 0x1c4]
add esp, 4
push ebx
mov edi, eax
lea eax, [esp + 0x40]
push eax
push ecx
push edi
push esi
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x40195f
lea edx, [esp + 0x160]
push edx
lea esi, [esp + 0x48]
call fcn.00403170
mov byte [esp + 0x1030], 3
mov eax, dword [esp + 0x48]
mov ebp, 8
cmp dword [esp + 0x5c], ebp
jae 0x40177e
lea eax, [esp + 0x48]
push eax
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
cmp eax, 0xffffffff
je 0x401799
shr eax, 4
not eax
and eax, 1
mov esi, eax
jmp 0x40185d
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 2
je 0x40185b
cmp eax, 3
je 0x40185b
cmp eax, 0x7b
je 0x40185b
lea ecx, [esp + 0x44]
push ecx
lea esi, [esp + 0x18]
call fcn.00403170
mov eax, dword [esp + 0x18]
cmp dword [esp + 0x2c], ebp
jae 0x4017d6
lea eax, [esp + 0x18]
lea edx, [esp + 0x3cc]
push edx
push eax
call dword [sym.imp.KERNEL32.dll_FindFirstFileW]
cmp eax, 0xffffffff
je 0x401835
push eax
call dword [sym.imp.KERNEL32.dll_FindClose]
xor eax, eax
cmp dword [esp + 0x3cc], ebx
setne al
xor ecx, ecx
cmp eax, ebx
sete cl
mov esi, ecx
cmp dword [esp + 0x2c], ebp
jb 0x401819
mov edx, dword [esp + 0x18]
push edx
call fcn.004045f6
add esp, 4
xor eax, eax
mov dword [esp + 0x2c], 7
mov dword [esp + 0x28], ebx
mov word [esp + 0x18], ax
cmp esi, ebx
je 0x40185b
lea esi, [eax + 1]
jmp 0x40185d
cmp dword [esp + 0x2c], ebp
jb 0x401848
mov ecx, dword [esp + 0x18]
push ecx
call fcn.004045f6
add esp, 4
xor edx, edx
mov dword [esp + 0x2c], 7
mov dword [esp + 0x28], ebx
mov word [esp + 0x18], dx
xor esi, esi
mov byte [esp + 0x1030], bl
cmp dword [esp + 0x5c], ebp
jb 0x401877
mov eax, dword [esp + 0x48]
push eax
call fcn.004045f6
add esp, 4
cmp esi, ebx
je 0x401899
mov eax, dword [esp + 0x164]
cmp dword [esp + 0x178], ebp
jae 0x401892
lea eax, [esp + 0x164]
push eax
call dword [sym.imp.KERNEL32.dll_DeleteFileW]
mov eax, dword [esp + 0x164]
cmp dword [esp + 0x178], ebp
jae 0x4018b0
lea eax, [esp + 0x164]
push ebx
push 0x80
push 2
push ebx
push ebx
push 0xc0000000
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov esi, eax
cmp esi, 0xffffffff
je 0x40192b
mov edx, dword [esp + 0x1c0]
push ebx
lea ecx, [esp + 0x40]
push ecx
push edx
push edi
push esi
call dword [sym.imp.KERNEL32.dll_WriteFile]
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push ebx
sub esp, 0x1c
lea eax, [esp + 0x180]
mov esi, esp
mov dword [esp + 0x58], esp
push eax
call fcn.00403170
call section..text
add esp, 0x20
push 1
sub esp, 0x1c
lea ecx, [esp + 0x180]
mov esi, esp
mov dword [esp + 0x58], esp
push ecx
call fcn.00403170
call section..text
add esp, 0x20
jmp 0x40195f
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov ecx, dword [esp + 0x164]
cmp dword [esp + 0x178], ebp
jae 0x401948
lea ecx, [esp + 0x164]
push ecx
push eax
lea edx, [esp + 0x82c]
push str.CreateFile_error_:__d__s_
push edx
call fcn.00404a3b
add esp, 0x10
push edi
call fcn.00404ad3
add esp, 4
lea esi, [esp + 0x160]
call fcn.00403ed0
mov eax, dword [esp + 0x40]
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x4019b0
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov eax, dword [esp + 0x40]
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x4019b0
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
lea ecx, [esp + 0x828]
push str.CreateFile_error_:__d
push ecx
call fcn.00404a3b
add esp, 0xc
mov ecx, dword [esp + 0x1028]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebp
pop ebx
mov ecx, dword [esp + 0x1010]
xor ecx, esp
call fcn.004045e7
add esp, 0x1020
ret