Function at 0x401470
Capabilities:
Copy file
Create directory
Enumerate files on windows
Get file size
Read file on windows
Write file on windows

Disassembly:
mov eax, dword fs:[0]
push 0xffffffffffffffff
push 0x4091a4
push eax
mov dword fs:[0], esp
sub esp, 0x1f8
or ecx, 0xffffffff
xor eax, eax
push ebx
push ebp
push esi
mov esi, dword [esp + 0x214]
push edi
mov edi, esi
repne scasb al, byte es:[edi]
not ecx
dec ecx
je 0x401647
mov al, byte [esp + 0x13]
xor ebx, ebx
push ebx
lea ecx, [esp + 0x28]
mov byte [esp + 0x28], al
call fcn.00401c60
lea ecx, [esp + 0x24]
mov dword [esp + 0x210], ebx
push ecx
push str.CommonDir
call fcn.004012e0
add esp, 8
test al, al
je 0x401631
lea edx, [esp + 0x24]
push 0x40c0f8
lea eax, [esp + 0x7c]
push edx
push eax
call fcn.00402070
push esi
lea ecx, [esp + 0x44]
push eax
push ecx
mov byte [esp + 0x228], 1
call fcn.00402070
add esp, 0x18
push 1
lea ecx, [esp + 0x7c]
mov byte [esp + 0x214], 3
call fcn.00401c60
mov eax, dword [esp + 0x38]
mov dword [esp + 0x6c], 0xc
cmp eax, ebx
mov dword [esp + 0x70], ebx
mov dword [esp + 0x74], 1
jne 0x40153c
mov eax, 0x40a138
lea edx, [esp + 0x6c]
push edx
push eax
call dword [sym.imp.KERNEL32.dll_CreateDirectoryA]
mov al, byte [esp + 0x13]
push ebx
lea ecx, [esp + 0x50]
mov byte [esp + 0x50], al
call fcn.00401c60
mov edi, str.Deck.ydc
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
dec ecx
push ecx
push str.Deck.ydc
lea ecx, [esp + 0x54]
call fcn.00401ec0
lea ecx, [esp + 0x34]
push str._trunk.ydt
lea edx, [esp + 0x60]
push ecx
push edx
mov byte [esp + 0x21c], 4
call fcn.00402070
lea eax, [esp + 0x30]
push str._system.dat
lea ecx, [esp + 0x98]
push eax
push ecx
mov byte [esp + 0x228], 5
call fcn.00402070
add esp, 0x18
mov eax, dword [esp + 0x60]
cmp eax, ebx
jne 0x4015c3
mov eax, 0x40a138
push ebx
push 0x80
push 2
push ebx
push ebx
mov ebx, dword [sym.imp.KERNEL32.dll_CreateFileA]
push 0x40000000
push eax
call ebx
mov ebp, eax
cmp ebp, 0xffffffff
jne 0x40164e
push 1
lea ecx, [esp + 0x8c]
mov byte [esp + 0x214], 5
call fcn.00401c60
push 1
lea ecx, [esp + 0x60]
mov byte [esp + 0x214], 4
call fcn.00401c60
push 1
lea ecx, [esp + 0x50]
mov byte [esp + 0x214], 3
call fcn.00401c60
push 1
lea ecx, [esp + 0x38]
mov byte [esp + 0x214], 0
call fcn.00401c60
push 1
lea ecx, [esp + 0x28]
mov dword [esp + 0x214], 0xffffffff
call fcn.00401c60
xor al, al
jmp 0x401a3c
mov dl, byte [esp + 0x13]
xor edi, edi
mov byte [esp + 0x14], dl
mov dword [esp + 0x18], edi
mov dword [esp + 0x1c], edi
mov dword [esp + 0x20], edi
mov eax, dword [esp + 0x8c]
mov byte [esp + 0x210], 7
cmp eax, edi
jne 0x40167c
mov eax, 0x40a138
push edi
push 0x80
push 3
push edi
push 1
push 0x80000000
push eax
call ebx
mov esi, eax
cmp esi, 0xffffffff
je 0x40172d
push edi
push esi
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov edx, dword [esp + 0x1c]
mov edi, eax
mov eax, dword [esp + 0x18]
mov byte [esp + 0x13], 0
test eax, eax
jne 0x4016b9
xor ecx, ecx
jmp 0x4016bd
mov ecx, edx
sub ecx, eax
cmp ecx, edi
jae 0x4016e3
test eax, eax
jne 0x4016c9
xor ecx, ecx
jmp 0x4016cd
mov ecx, edx
sub ecx, eax
lea eax, [esp + 0x13]
push eax
mov eax, edi
sub eax, ecx
lea ecx, [esp + 0x18]
push eax
push edx
call fcn.00401cb0
jmp 0x4016fc
test eax, eax
je 0x401700
mov ecx, edx
sub ecx, eax
cmp edi, ecx
jae 0x401700
add eax, edi
push edx
push eax
lea ecx, [esp + 0x1c]
call fcn.00401e80
mov eax, dword [esp + 0x18]
lea edx, [esp + 0x48]
push 0
push edx
push edi
push eax
push esi
call dword [sym.imp.KERNEL32.dll_ReadFile]
mov ecx, dword [esp + 0x18]
lea eax, [esp + 0x44]
push 0
push eax
push edi
push ecx
push ebp
call dword [sym.imp.KERNEL32.dll_WriteFile]
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
xor edi, edi
mov eax, dword [esp + 0x50]
cmp eax, edi
jne 0x40173a
mov eax, 0x40a138
push edi
push 0x80
push 3
push edi
push 1
push 0x80000000
push eax
call ebx
mov edi, eax
cmp edi, 0xffffffff
je 0x4017ea
xor ebx, ebx
push ebx
push edi
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov edx, dword [esp + 0x1c]
mov esi, eax
mov eax, dword [esp + 0x18]
mov byte [esp + 0x13], bl
cmp eax, ebx
jne 0x401778
xor ecx, ecx
jmp 0x40177c
mov ecx, edx
sub ecx, eax
cmp ecx, esi
jae 0x4017a2
cmp eax, ebx
jne 0x401788
xor ecx, ecx
jmp 0x40178c
mov ecx, edx
sub ecx, eax
lea eax, [esp + 0x13]
push eax
mov eax, esi
sub eax, ecx
lea ecx, [esp + 0x18]
push eax
push edx
call fcn.00401cb0
jmp 0x4017bb
cmp eax, ebx
je 0x4017bf
mov ecx, edx
sub ecx, eax
cmp esi, ecx
jae 0x4017bf
add eax, esi
push edx
push eax
lea ecx, [esp + 0x1c]
call fcn.00401e80
mov eax, dword [esp + 0x18]
lea edx, [esp + 0x48]
push ebx
push edx
push esi
push eax
push edi
call dword [sym.imp.KERNEL32.dll_ReadFile]
mov ecx, dword [esp + 0x18]
lea eax, [esp + 0x44]
push ebx
push eax
push esi
push ecx
push ebp
call dword [sym.imp.KERNEL32.dll_WriteFile]
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x4017ec
xor ebx, ebx
push ebp
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov edx, dword [esp + 0x1c]
mov eax, dword [esp + 0x18]
push edx
push eax
lea ecx, [esp + 0x1c]
mov byte [esp + 0x218], 6
call fcn.00401eb0
mov ecx, dword [esp + 0x18]
push ecx
call fcn.00402957
add esp, 4
lea ecx, [esp + 0x88]
mov dword [esp + 0x18], ebx
mov dword [esp + 0x1c], ebx
push 1
mov dword [esp + 0x24], ebx
mov byte [esp + 0x214], 5
call fcn.00401c60
push 1
lea ecx, [esp + 0x60]
mov byte [esp + 0x214], 4
call fcn.00401c60
push 1
lea ecx, [esp + 0x50]
mov byte [esp + 0x214], 3
call fcn.00401c60
lea edx, [esp + 0x24]
push str._.ydc
lea eax, [esp + 0xac]
push edx
push eax
call fcn.00402070
add esp, 0xc
mov eax, dword [esp + 0xac]
mov byte [esp + 0x210], 8
cmp eax, ebx
jne 0x401895
mov eax, 0x40a138
lea ecx, [esp + 0xc8]
push ecx
push eax
call dword [sym.imp.KERNEL32.dll_FindFirstFileA]
mov esi, dword [sym.imp.KERNEL32.dll_CopyFileA]
mov ebp, dword [sym.imp.KERNEL32.dll_FindNextFileA]
mov edi, eax
mov bl, 0xb
test byte [esp + 0xc8], 0x10
jne 0x4019a2
lea edx, [esp + 0x24]
push 0x40c0f8
lea eax, [esp + 0x60]
push edx
push eax
call fcn.00402070
lea ecx, [esp + 0x100]
lea edx, [esp + 0x84]
push ecx
push eax
push edx
mov byte [esp + 0x228], 9
call fcn.00402070
add esp, 0x18
push 1
lea ecx, [esp + 0x60]
mov byte [esp + 0x214], bl
call fcn.00401c60
lea eax, [esp + 0x34]
push 0x40c0f8
lea ecx, [esp + 0xbc]
push eax
push ecx
call fcn.00402070
lea edx, [esp + 0x100]
mov byte [esp + 0x21c], 0xc
push edx
push eax
lea eax, [esp + 0xac]
push eax
call fcn.00402070
add esp, 0x18
push 1
lea ecx, [esp + 0xbc]
mov byte [esp + 0x214], 0xe
call fcn.00401c60
mov eax, dword [esp + 0x9c]
test eax, eax
jne 0x401967
mov eax, 0x40a138
mov ecx, dword [esp + 0x7c]
test ecx, ecx
jne 0x401974
mov ecx, 0x40a138
push 0
push eax
push ecx
call esi
push 1
lea ecx, [esp + 0x9c]
mov byte [esp + 0x214], bl
call fcn.00401c60
push 1
lea ecx, [esp + 0x7c]
mov byte [esp + 0x214], 8
call fcn.00401c60
lea ecx, [esp + 0xc8]
push ecx
push edi
call ebp
cmp eax, 1
je 0x4018b4
push edi
call dword [sym.imp.KERNEL32.dll_FindClose]
mov ecx, dword [esp + 0xac]
xor esi, esi
cmp ecx, esi
je 0x4019e6
mov al, byte [ecx - 1]
test al, al
je 0x4019dc
cmp al, 0xff
je 0x4019dc
dec al
mov byte [ecx - 1], al
jmp 0x4019e6
dec ecx
push ecx
call fcn.00402957
add esp, 4
mov ecx, dword [esp + 0x38]
cmp ecx, esi
je 0x401a0a
mov al, byte [ecx - 1]
test al, al
je 0x401a00
cmp al, 0xff
je 0x401a00
dec al
mov byte [ecx - 1], al
jmp 0x401a0a
dec ecx
push ecx
call fcn.00402957
add esp, 4
mov ecx, dword [esp + 0x28]
mov dword [esp + 0x38], esi
cmp ecx, esi
mov dword [esp + 0x3c], esi
mov dword [esp + 0x40], esi
je 0x401a3a
mov al, byte [ecx - 1]
test al, al
je 0x401a30
cmp al, 0xff
je 0x401a30
dec al
mov byte [ecx - 1], al
jmp 0x401a3a
dec ecx
push ecx
call fcn.00402957
add esp, 4
mov al, 1
mov ecx, dword [esp + 0x208]
pop edi
pop esi
pop ebp
pop ebx
mov dword fs:[0], ecx
add esp, 0x204
ret