Function at 0x4097c4
Capabilities:
Get file size
Read file on windows
Write file on windows

Disassembly:
push 0x64
mov eax, 0x47bbc1
call fcn.0044ef46
mov eax, dword [ebp + 8]
lea esi, [eax + 8]
cmp dword [esi + 0x14], 8
mov dword [ebp - 0x54], eax
jb 0x4097e3
mov eax, dword [esi]
jmp 0x4097e5
mov eax, esi
xor ebx, ebx
push ebx
push 0x80
push 3
push ebx
push ebx
push 0xc0000000
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov edi, eax
mov dword [ebp - 0x30], edi
cmp edi, 0xffffffff
jne 0x409832
cmp dword [esi + 0x14], 8
jb 0x40980f
mov esi, dword [esi]
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push esi
push 0x490448
push 4
pop edx
push 2
pop esi
call fcn.0040b07c
add esp, 0xc
or eax, 0xffffffff
jmp 0x409b23
push ebx
push edi
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov dword [ebp - 0x34], eax
cmp eax, ebx
jne 0x40986a
cmp dword [esi + 0x14], 8
jb 0x409849
mov esi, dword [esi]
push esi
push 0x4904b8
push 4
pop edx
push 2
pop esi
call fcn.0040b07c
pop ecx
pop ecx
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
xor eax, eax
jmp 0x409b23
cmp dword [esi + 0x14], 8
jb 0x409872
mov esi, dword [esi]
push eax
push esi
push 0x490540
push 4
pop edx
push 2
pop esi
call fcn.0040b07c
add esp, 0xc
push ebx
push ebx
push ebx
push edi
mov edi, dword [sym.imp.KERNEL32.dll_SetFilePointer]
call edi
lea esi, [ebp - 0x70]
call fcn.0040a653
push ebx
mov dword [ebp - 4], ebx
call fcn.0043ea16
pop ecx
mov dword [ebp - 0x5c], eax
mov dword [ebp - 0x58], edx
mov dword [ebp - 0x50], ebx
mov dword [ebp - 0x4c], ebx
mov dword [ebp - 0x48], ebx
mov byte [ebp - 4], 1
mov dword [ebp - 0x3c], ebx
jmp 0x4099b0
mov eax, dword [ebp - 0x4c]
sub eax, dword [ebp - 0x50]
sar eax, 2
cmp eax, dword [ebp + 0xc]
jae 0x4099ba
push ebx
lea eax, [ebp - 0x3c]
push eax
push 0x10
lea eax, [ebp - 0x2c]
push eax
push dword [ebp - 0x30]
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x4099ba
cmp dword [ebp - 0x3c], 0x10
jne 0x4099ba
mov edx, dword [ebp - 0x20]
cmp edx, 0x5000
ja 0x4099ba
lea eax, [edx + 0x10]
cmp dword [ebp - 0x34], eax
jb 0x4099ba
mov ecx, dword [ebp - 0x2c]
mov eax, dword [ebp - 0x28]
add ecx, 0x15180
adc eax, ebx
cmp dword [ebp - 0x58], eax
jg 0x40999e
jl 0x40992d
cmp dword [ebp - 0x5c], ecx
ja 0x40999e
push ebx
lea eax, [ebp - 0x3c]
push eax
push edx
push dword [ebp - 0x70]
push dword [ebp - 0x30]
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x4099ba
mov eax, dword [ebp - 0x3c]
cmp eax, dword [ebp - 0x20]
jne 0x4099ba
push 0x20
call fcn.0043e996
mov esi, eax
pop ecx
cmp esi, ebx
je 0x409965
push 2
pop eax
call fcn.00409319
mov esi, eax
jmp 0x409967
xor esi, esi
mov eax, dword [ebp - 0x2c]
push dword [ebp - 0x70]
mov dword [esi], eax
mov eax, dword [ebp - 0x28]
mov dword [esi + 4], eax
mov eax, dword [ebp - 0x24]
mov dword [esi + 0x14], eax
mov eax, dword [ebp - 0x20]
mov dword [ebp - 0x40], esi
call fcn.0040933c
test al, al
je 0x409997
lea eax, [ebp - 0x40]
lea esi, [ebp - 0x50]
call fcn.0041f5cc
jmp 0x4099a7
call fcn.00408e15
jmp 0x4099a7
push 1
push ebx
push edx
push dword [ebp - 0x30]
call edi
push 0xfffffffffffffff0
pop eax
sub eax, dword [ebp - 0x20]
add dword [ebp - 0x34], eax
cmp dword [ebp - 0x34], 0x10
ja 0x4098c0
mov eax, dword [ebp - 0x4c]
sub eax, dword [ebp - 0x50]
sar eax, 2
cmp eax, dword [ebp + 0xc]
jne 0x409a99
cmp dword [ebp - 0x34], ebx
jbe 0x409a99
push dword [ebp - 0x34]
mov byte [ebp - 0x35], 1
mov byte [ebp - 4], 2
call fcn.0043ec7c
pop ecx
mov esi, eax
mov dword [ebp - 4], 1
jmp 0x409a0c
mov dword [ebp - 0x40], ebx
mov dword [ebp - 0x58], ebx
cmp byte [ebp - 0x35], bl
je 0x409a6f
push ebx
lea eax, [ebp - 0x40]
push eax
push dword [ebp - 0x34]
push esi
push dword [ebp - 0x30]
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x409a6f
mov eax, dword [ebp - 0x34]
cmp dword [ebp - 0x40], eax
jne 0x409a6f
push ebx
push ebx
push ebx
push dword [ebp - 0x30]
call edi
push ebx
lea eax, [ebp - 0x58]
push eax
push dword [ebp - 0x34]
push esi
push dword [ebp - 0x30]
call dword [sym.imp.KERNEL32.dll_WriteFile]
push dword [ebp - 0x30]
call dword [sym.imp.KERNEL32.dll_SetEndOfFile]
push dword [ebp - 0x34]
push 0x4905b8
push 2
push 4
pop edi
call fcn.0040b067
add esp, 0xc
jmp 0x409a91
push ebx
push ebx
push ebx
push dword [ebp - 0x30]
call edi
push dword [ebp - 0x30]
call dword [sym.imp.KERNEL32.dll_SetEndOfFile]
push 0x4905fc
push 2
push 4
pop edi
call fcn.0040b067
pop ecx
pop ecx
push esi
call fcn.0043ec87
jmp 0x409aba
push ebx
push ebx
push ebx
push dword [ebp - 0x30]
call edi
push dword [ebp - 0x30]
call dword [sym.imp.KERNEL32.dll_SetEndOfFile]
push 0x490638
push 2
push 4
pop edi
call fcn.0040b067
pop ecx
pop ecx
push dword [ebp - 0x30]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov edi, dword [ebp - 0x4c]
sub edi, dword [ebp - 0x50]
sar edi, 2
cmp edi, ebx
jle 0x409ae2
mov eax, dword [ebp - 0x54]
mov edx, dword [eax]
cmp edx, ebx
je 0x409ae2
lea ecx, [ebp - 0x50]
call fcn.00408ec8
mov eax, dword [ebp - 0x54]
add eax, 8
cmp dword [eax + 0x14], 8
jb 0x409af0
mov eax, dword [eax]
push edi
push eax
push 0x490660
push 4
pop edx
push 2
pop esi
call fcn.0040b07c
add esp, 0xc
cmp dword [ebp - 0x50], ebx
je 0x409b13
push dword [ebp - 0x50]
call fcn.0043e93a
pop ecx
cmp dword [ebp - 0x70], ebx
je 0x409b21
push dword [ebp - 0x70]
call fcn.0043e93a
pop ecx
mov eax, edi
call fcn.0044efa2
ret 8