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

Disassembly:
mov eax, 0x101c
call fcn.0040f3f0
mov eax, dword [0x41b008]
xor eax, esp
mov dword [esp + 0x1014], eax
push ebx
push ebp
push esi
push edi
mov edi, dword [esp + 0x1030]
test edi, edi
jne 0x40ab30
push str.Log_file_name_is_not_specified.
push 3
push 0x41b030
call fcn.00401ad0
lea eax, [edi + 1]
jmp 0x40ad30
push str.Start_generating_log_file_tail.
push 3
push 0x41b030
call fcn.00401ad0
add esp, 0xc
mov ebx, 0x100000
xor esi, esi
mov edx, str..log
cmp dword [esp + 0x1034], ebx
mov ecx, 0x42006c
cmovbe ebx, dword [esp + 0x1034]
push 0x43b710
call fcn.0040a650
test eax, eax
je 0x40ad01
push esi
push 0x80
push 3
push esi
push 3
push 0x80000000
push edi
call dword [sym.imp.kernel32.dll_CreateFileW]
mov ebp, eax
cmp ebp, 0xffffffff
je 0x40ace3
push esi
push ebp
call dword [sym.imp.kernel32.dll_GetFileSize]
cmp eax, 0xffffffff
je 0x40acb8
cmp eax, ebx
jbe 0x40abc5
push 2
push esi
mov eax, ebx
neg eax
push eax
push ebp
call dword [sym.imp.kernel32.dll_SetFilePointer]
cmp eax, 0xffffffff
je 0x40acb8
push 0
push 0x80
push 2
push 0
push 0
push 0x40000000
push 0x43b710
call dword [sym.imp.kernel32.dll_CreateFileW]
mov dword [esp + 0x1c], eax
cmp eax, 0xffffffff
je 0x40aca5
xor edi, edi
mov esi, 1
test ebx, ebx
je 0x40ac93
mov ecx, 0x1000
cmp esi, 1
jne 0x40ac74
mov eax, ebx
mov dword [esp + 0x14], 0
sub eax, edi
cmp eax, 0x1000
push 0
cmova eax, ecx
lea ecx, [esp + 0x18]
push ecx
push eax
lea eax, [esp + 0x2c]
push eax
push ebp
call dword [sym.imp.kernel32.dll_ReadFile]
mov esi, eax
test esi, esi
je 0x40ac78
mov eax, dword [esp + 0x14]
test eax, eax
je 0x40ac74
push 0
lea ecx, [esp + 0x1c]
mov dword [esp + 0x1c], 0
push ecx
push eax
lea eax, [esp + 0x2c]
push eax
push dword [esp + 0x2c]
call dword [sym.imp.kernel32.dll_WriteFile]
mov esi, eax
mov eax, dword [esp + 0x14]
cmp dword [esp + 0x18], eax
jne 0x40aca1
add edi, eax
mov ecx, 0x1000
cmp ebx, edi
ja 0x40ac03
test esi, esi
jne 0x40ac93
call dword [sym.imp.kernel32.dll_GetLastError]
push eax
push str.FileCopy:_Unable_to_read_write_file__error__d
push 1
push 0x41b030
call fcn.00401ad0
add esp, 0x10
push dword [esp + 0x1c]
mov edi, dword [sym.imp.kernel32.dll_CloseHandle]
call edi
jmp 0x40acda
xor esi, esi
jmp 0x40ac78
call dword [sym.imp.kernel32.dll_GetLastError]
push eax
push 0x43b710
push str.Unable_to_open_file__s_for_write__error__d
jmp 0x40acc5
call dword [sym.imp.kernel32.dll_GetLastError]
push eax
push edi
push str.Unable_to_set_position_in_file__s__error__d
push 1
push 0x41b030
call fcn.00401ad0
mov edi, dword [sym.imp.kernel32.dll_CloseHandle]
add esp, 0x14
push ebp
call edi
test esi, esi
jne 0x40ad1d
jmp 0x40ad15
call dword [sym.imp.kernel32.dll_GetLastError]
push eax
push edi
push str.Unable_to_open_file__s__error__d
push 1
push 0x41b030
call fcn.00401ad0
add esp, 0x14
jmp 0x40ad15
push str.Unable_to_construct_name_for_temporary_log_file
push 1
push 0x41b030
call fcn.00401ad0
add esp, 0xc
xor eax, eax
mov word [0x43b710], ax
push str.Finished_generating_log_file_tail.
push 3
push 0x41b030
call fcn.00401ad0
mov eax, esi
mov ecx, dword [esp + 0x1030]
add esp, 0xc
pop edi
pop esi
pop ebp
pop ebx
xor ecx, esp
call fcn.0040e29f
add esp, 0x101c
ret 8