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

Disassembly:
push 0x64
mov eax, 0x47e13b
call fcn.004514e6
mov eax, dword [ebp + 8]
lea esi, [eax + 8]
cmp dword [esi + 0x14], 8
mov dword [ebp - 0x54], eax
jb 0x40bca2
mov eax, dword [esi]
jmp 0x40bca4
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 0x40bcf1
cmp dword [esi + 0x14], 8
jb 0x40bcce
mov esi, dword [esi]
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push esi
push str.DataReport::LoadPacketData__Read__s_failed__error_u_
push 4
pop edx
push 2
pop esi
call fcn.0040d53c
add esp, 0xc
or eax, 0xffffffff
jmp 0x40bfe2
push ebx
push edi
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov dword [ebp - 0x34], eax
cmp eax, ebx
jne 0x40bd29
cmp dword [esi + 0x14], 8
jb 0x40bd08
mov esi, dword [esi]
push esi
push str.DataReport::LoadPacketData__Read__s_success__but_the_file_is_empty_
push 4
pop edx
push 2
pop esi
call fcn.0040d53c
pop ecx
pop ecx
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
xor eax, eax
jmp 0x40bfe2
cmp dword [esi + 0x14], 8
jb 0x40bd31
mov esi, dword [esi]
push eax
push esi
push str.DataReport::LoadPacketData__Read__s_success__filesize___u
push 4
pop edx
push 2
pop esi
call fcn.0040d53c
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.0040cb12
push ebx
mov dword [ebp - 4], ebx
call fcn.00440fb6
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 0x40be6f
mov eax, dword [ebp - 0x4c]
sub eax, dword [ebp - 0x50]
sar eax, 2
cmp eax, dword [ebp + 0xc]
jae 0x40be79
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 0x40be79
cmp dword [ebp - 0x3c], 0x10
jne 0x40be79
mov edx, dword [ebp - 0x20]
cmp edx, 0x5000
ja 0x40be79
lea eax, [edx + 0x10]
cmp dword [ebp - 0x34], eax
jb 0x40be79
mov ecx, dword [ebp - 0x2c]
mov eax, dword [ebp - 0x28]
add ecx, 0x15180
adc eax, ebx
cmp dword [ebp - 0x58], eax
jg 0x40be5d
jl 0x40bdec
cmp dword [ebp - 0x5c], ecx
ja 0x40be5d
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 0x40be79
mov eax, dword [ebp - 0x3c]
cmp eax, dword [ebp - 0x20]
jne 0x40be79
push 0x20
call fcn.00440f36
mov esi, eax
pop ecx
cmp esi, ebx
je 0x40be24
push 2
pop eax
call fcn.0040b7b9
mov esi, eax
jmp 0x40be26
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.0040b7dc
test al, al
je 0x40be56
lea eax, [ebp - 0x40]
lea esi, [ebp - 0x50]
call fcn.0040f13b
jmp 0x40be66
call fcn.0040b300
jmp 0x40be66
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 0x40bd7f
mov eax, dword [ebp - 0x4c]
sub eax, dword [ebp - 0x50]
sar eax, 2
cmp eax, dword [ebp + 0xc]
jne 0x40bf58
cmp dword [ebp - 0x34], ebx
jbe 0x40bf58
push dword [ebp - 0x34]
mov byte [ebp - 0x35], 1
mov byte [ebp - 4], 2
call fcn.0044121c
pop ecx
mov esi, eax
mov dword [ebp - 4], 1
jmp 0x40becb
mov dword [ebp - 0x40], ebx
mov dword [ebp - 0x58], ebx
cmp byte [ebp - 0x35], bl
je 0x40bf2e
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 0x40bf2e
mov eax, dword [ebp - 0x34]
cmp dword [ebp - 0x40], eax
jne 0x40bf2e
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 str.DataReport::LoadPacketData__Change_file_success__new_filesize___u
push 2
push 4
pop edi
call fcn.0040d527
add esp, 0xc
jmp 0x40bf50
push ebx
push ebx
push ebx
push dword [ebp - 0x30]
call edi
push dword [ebp - 0x30]
call dword [sym.imp.KERNEL32.dll_SetEndOfFile]
push str.DataReport::LoadPacketData__Change_file_failed__Clear_file
push 2
push 4
pop edi
call fcn.0040d527
pop ecx
pop ecx
push esi
call fcn.00441227
jmp 0x40bf79
push ebx
push ebx
push ebx
push dword [ebp - 0x30]
call edi
push dword [ebp - 0x30]
call dword [sym.imp.KERNEL32.dll_SetEndOfFile]
push str.DataReport::LoadPacketData__Clear_file
push 2
push 4
pop edi
call fcn.0040d527
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 0x40bfa1
mov eax, dword [ebp - 0x54]
mov edx, dword [eax]
cmp edx, ebx
je 0x40bfa1
lea ecx, [ebp - 0x50]
call fcn.0040b3b3
mov eax, dword [ebp - 0x54]
add eax, 8
cmp dword [eax + 0x14], 8
jb 0x40bfaf
mov eax, dword [eax]
push edi
push eax
push str.DataReport::LoadPacketData__Read__s_success__get__d_records_
push 4
pop edx
push 2
pop esi
call fcn.0040d53c
add esp, 0xc
cmp dword [ebp - 0x50], ebx
je 0x40bfd2
push dword [ebp - 0x50]
call fcn.00440eda
pop ecx
cmp dword [ebp - 0x70], ebx
je 0x40bfe0
push dword [ebp - 0x70]
call fcn.00440eda
pop ecx
mov eax, edi
call fcn.00451542
ret 8