Function at 0x10004970
Capabilities:
Get file size
Read file on windows
Set file attributes
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x64
mov eax, dword [0x101f7210]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
mov ebx, dword [ebp + 8]
push esi
push edi
mov edi, dword [ebp + 0xc]
cmp dword [edi + 0x14], 8
jb 0x10004993
mov eax, dword [edi]
jmp 0x10004995
mov eax, edi
cmp dword [ebx + 0x14], 8
jb 0x1000499f
mov ecx, dword [ebx]
jmp 0x100049a1
mov ecx, ebx
push eax
push ecx
call fcn.1014cceb
add esp, 8
test eax, eax
je 0x100049fb
cmp dword [ebx + 0x14], 8
jb 0x100049b9
mov eax, dword [ebx]
jmp 0x100049bb
mov eax, ebx
push 0
push eax
call fcn.1014d6a3
add esp, 8
cmp eax, 0xffffffff
jne 0x10004a13
push str._tasp::library_src_file_not_exist._n
sub esp, 0xc
mov dword [ebp - 0x48], 0x101cce60
mov eax, esp
mov dword [ebp - 0x44], 0
movq xmm0, qword [ebp - 0x48]
movq qword [eax], xmm0
mov dword [eax + 8], 2
call fcn.10005540
add esp, 0x10
mov eax, 1
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.1014aad2
mov esp, ebp
pop ebp
ret 0x18
cmp dword [ebx + 0x14], 8
jb 0x10004a1d
mov eax, dword [ebx]
jmp 0x10004a1f
mov eax, ebx
mov esi, dword [sym.imp.KERNEL32.dll_CreateFileW]
push 0
push 0x8000020
push 3
push 0
push 3
push SysReAllocStringLen
push eax
call esi
mov dword [ebp - 0x38], eax
cmp eax, 0xffffffff
jne 0x10004a97
mov dword [ebp - 0x48], 0x101ccef8
mov dword [ebp - 0x44], 0
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push ecx
mov ecx, ebx
call fcn.10002930
movq xmm0, qword [ebp - 0x48]
push eax
push str._tasp::library_CreateFile__lpExistingFileName:_s__err_lu
sub esp, 0xc
mov eax, esp
movq qword [eax], xmm0
mov dword [eax + 8], 3
call fcn.10005540
add esp, 0x18
xor eax, eax
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.1014aad2
mov esp, ebp
pop ebp
ret 0x18
push edi
call fcn.10011a60
cmp dword [edi + 0x14], 8
mov dword [ebp - 0x5c], 0
jb 0x10004aae
mov eax, dword [edi]
jmp 0x10004ab0
mov eax, edi
lea ecx, [ebp - 0x34]
push ecx
push 0
push eax
call dword [sym.imp.KERNEL32.dll_GetFileAttributesExW]
test eax, eax
je 0x10004add
cmp dword [edi + 0x14], 8
mov dword [ebp - 0x5c], 1
jb 0x10004ad2
mov eax, dword [edi]
jmp 0x10004ad4
mov eax, edi
push 0x20
push eax
call dword [sym.imp.KERNEL32.dll_SetFileAttributesW]
cmp dword [edi + 0x14], 8
jb 0x10004ae7
mov eax, dword [edi]
jmp 0x10004ae9
mov eax, edi
push 0
push 0x8000020
push 2
push 0
push 3
push 0x40000000
push eax
call esi
mov dword [ebp - 0x54], eax
cmp eax, 0xffffffff
jne 0x10004b6d
mov dword [ebp - 0x48], 0x101ccfa0
mov dword [ebp - 0x44], 0
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push ecx
mov ecx, edi
call fcn.10002930
push eax
push ecx
mov ecx, ebx
call fcn.10002930
movq xmm0, qword [ebp - 0x48]
push eax
push str._tasp::library_CreateFile__lpExistingFileName:_s___lpNewFileName:_s__err_lu
sub esp, 0xc
mov eax, esp
movq qword [eax], xmm0
mov dword [eax + 8], 3
call fcn.10005540
add esp, 0x1c
push dword [ebp - 0x38]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
xor eax, eax
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.1014aad2
mov esp, ebp
pop ebp
ret 0x18
push 0x1000
call fcn.1002fb37
add esp, 4
mov dword [ebp - 0x4c], eax
lea eax, [ebp - 0x10]
push eax
push dword [ebp - 0x38]
call dword [sym.imp.KERNEL32.dll_GetFileSizeEx]
mov ecx, dword [ebp - 0x10]
mov eax, ecx
mov edx, dword [ebp - 0xc]
or eax, edx
mov dword [ebp - 0x58], ecx
mov dword [ebp - 0x60], edx
mov dword [ebp - 8], 0
mov dword [ebp - 0x50], 1
je 0x10004c66
mov edi, edi
test edx, edx
jne 0x10004bbe
mov esi, ecx
cmp ecx, 0x1000
jbe 0x10004bc3
mov esi, 0x1000
push 0
lea eax, [ebp - 8]
push eax
push esi
push dword [ebp - 0x4c]
push dword [ebp - 0x38]
call dword [sym.imp.KERNEL32.dll_ReadFile]
cmp dword [ebp - 8], esi
jne 0x10004c28
push 0
lea eax, [ebp - 8]
push eax
push esi
push dword [ebp - 0x4c]
push dword [ebp - 0x54]
call dword [sym.imp.KERNEL32.dll_WriteFile]
cmp dword [ebp - 8], esi
jne 0x10004c0c
mov ecx, dword [ebp - 0x58]
mov edx, dword [ebp - 0x60]
sub ecx, esi
mov eax, ecx
mov dword [ebp - 0x58], ecx
sbb edx, 0
or eax, edx
mov dword [ebp - 0x60], edx
jne 0x10004bb0
jmp 0x10004c66
mov dword [ebp - 0x48], 0x101cd0a0
mov dword [ebp - 0x44], 0
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str._tasp::library__WriteFile_err_lu.
jmp 0x10004c42
mov dword [ebp - 0x48], 0x101cd020
mov dword [ebp - 0x44], 0
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str._tasp::library__ReadFile_err_lu.
movq xmm0, qword [ebp - 0x48]
sub esp, 0xc
mov eax, esp
movq qword [eax], xmm0
mov dword [eax + 8], 3
call fcn.10005540
mov dword [ebp - 0x50], 0
add esp, 0x14
push dword [ebp - 0x38]
mov esi, dword [sym.imp.KERNEL32.dll_CloseHandle]
call esi
push dword [ebp - 0x54]
call dword [sym.imp.KERNEL32.dll_FlushFileBuffers]
push dword [ebp - 0x54]
call esi
cmp dword [ebp - 0x5c], 0
je 0x10004cab
cmp dword [edi + 0x14], 8
jb 0x10004c9b
push dword [ebp - 0x34]
mov eax, dword [edi]
mov esi, dword [sym.imp.KERNEL32.dll_SetFileAttributesW]
push eax
call esi
jmp 0x10004cb1
push dword [ebp - 0x34]
mov esi, dword [sym.imp.KERNEL32.dll_SetFileAttributesW]
mov eax, edi
push eax
call esi
jmp 0x10004cb1
mov esi, dword [sym.imp.KERNEL32.dll_SetFileAttributesW]
cmp dword [ebx + 0x14], 8
jb 0x10004cb9
mov ebx, dword [ebx]
lea eax, [ebp - 0x34]
push eax
push 0
push ebx
call dword [sym.imp.KERNEL32.dll_GetFileAttributesExW]
test eax, eax
je 0x10004cd8
cmp dword [edi + 0x14], 8
jb 0x10004cd2
mov edi, dword [edi]
push dword [ebp - 0x34]
push edi
call esi
mov eax, dword [ebp - 0x4c]
test eax, eax
je 0x10004ce8
push eax
call fcn.1002fb32
add esp, 4
mov ecx, dword [ebp - 4]
mov eax, dword [ebp - 0x50]
xor ecx, ebp
pop edi
pop esi
pop ebx
call fcn.1014aad2
mov esp, ebp
pop ebp
ret 0x18