Function at 0x407def
Capabilities:
Get file size
Read file on windows

Disassembly:
sub esp, 0xb8
push ebx
push ebp
xor ebx, ebx
mov ebp, 0x186a0
push esi
push edi
mov edi, ecx
mov dword [esp + 0x18], ebp
mov dword [esp + 0x1c], ebx
cmp byte [esp + 0xcc], bl
je 0x407e62
mov edx, 0x465900
lea ecx, [esp + 0xe8]
call fcn.00406a26
test al, al
je 0x407e62
sub esp, 0x18
lea eax, [esp + 0xe8]
mov ecx, esp
push eax
call fcn.004082dc
lea ecx, [esp + 0xb0]
call fcn.0041a5c9
add esp, 0x18
lea ecx, [esp + 0xe8]
push eax
call fcn.00401e18
lea ecx, [esp + 0x98]
call fcn.00401e13
mov ecx, edi
call fcn.004041f1
push ecx
mov ecx, edi
call fcn.0040428c
sub esp, 0x18
lea edx, [esp + 0x100]
lea ecx, [esp + 0x68]
mov esi, esp
call fcn.0041aec8
push eax
mov ecx, 0x473ee8
lea eax, [esp + 0x11c]
push ecx
push eax
push ecx
lea edx, [esp + 0xf8]
lea ecx, [esp + 0xa8]
call fcn.0041aec8
mov edx, eax
lea ecx, [esp + 0x90]
call fcn.004027cb
pop ecx
mov edx, eax
lea ecx, [esp + 0xd4]
call fcn.004027cb
pop ecx
mov edx, eax
lea ecx, [esp + 0xb8]
call fcn.004027cb
pop ecx
mov edx, eax
mov ecx, esi
call fcn.0040275c
pop ecx
push 0xb6
mov ecx, edi
call fcn.00404468
lea ecx, [esp + 0x98]
mov esi, eax
call fcn.00401eea
lea ecx, [esp + 0xb0]
call fcn.00401eea
lea ecx, [esp + 0x68]
call fcn.00401eea
lea ecx, [esp + 0x80]
call fcn.00401eea
lea ecx, [esp + 0x50]
call fcn.00401eea
cmp esi, 0xffffffff
je 0x407f71
push ebx
push 0x80
push 3
xor eax, eax
lea ecx, [esp + 0xdc]
push ebx
inc eax
push eax
push connect
mov dword [esp + 0x5c], eax
call fcn.00401e07
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov ebx, eax
cmp ebx, 0xffffffff
jne 0x407fb2
sub esp, 0x18
mov ecx, esp
push 0x465554
call fcn.00401f66
push 0x53
mov ecx, edi
call fcn.00404468
mov ecx, edi
call fcn.004047eb
mov byte [esp + 0x44], 0
lea ecx, [esp + 0xd0]
call fcn.00401e13
lea ecx, [esp + 0xe8]
call fcn.00401e13
lea ecx, [esp + 0x100]
call fcn.00401eea
mov al, byte [esp + 0x44]
pop edi
pop esi
pop ebp
pop ebx
add esp, 0xb8
ret 0x4c
and dword [esp + 0x48], 0
lea eax, [esp + 0x48]
and dword [esp + 0x4c], 0
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_GetFileSizeEx]
mov ecx, dword [esp + 0x4c]
xor esi, esi
mov eax, dword [esp + 0x48]
inc esi
and dword [esp + 0x24], 0
push 0
push ebp
push ecx
push eax
mov dword [esp + 0x24], eax
mov dword [esp + 0x38], ecx
mov dword [esp + 0x30], esi
call fcn.00455fa0
add eax, esi
lea ecx, [esp + 0x68]
adc edx, 0
sub esp, 0x18
mov esi, esp
push edx
push eax
call fcn.0041ad7b
pop ecx
pop ecx
push eax
push 0x473ee8
push dword [esp + 0x48]
lea ecx, [esp + 0xa4]
push dword [esp + 0x38]
call fcn.0041ad7b
pop ecx
pop ecx
mov edx, eax
lea ecx, [esp + 0x70]
call fcn.004027cb
pop ecx
mov edx, eax
mov ecx, esi
call fcn.0040275c
pop ecx
push 0xb7
mov ecx, edi
call fcn.00404468
lea ecx, [esp + 0x50]
call fcn.00401eea
lea ecx, [esp + 0x80]
call fcn.00401eea
lea ecx, [esp + 0x68]
call fcn.00401eea
sub esp, 0x18
lea edx, [esp + 0xe8]
lea ecx, [esp + 0x68]
mov esi, esp
call fcn.0041ae68
push eax
mov edx, str.Uploading_file_to_Controller:
mov ecx, esi
call fcn.00404c9e
sub esp, 0x14
mov ecx, esp
push 0x465454
call fcn.00401f66
call fcn.0041a686
add esp, 0x30
lea ecx, [esp + 0x50]
call fcn.00401eea
mov ecx, dword [esp + 0x28]
xorps xmm0, xmm0
movlpd qword [esp + 0x38], xmm0
test ecx, ecx
jb 0x4081ff
mov eax, dword [esp + 0x14]
ja 0x4080c6
test eax, eax
je 0x4081ff
mov edx, dword [esp + 0x3c]
mov esi, dword [esp + 0x38]
mov dword [esp + 0x10], edx
mov edx, dword [esp + 0x1c]
mov dword [esp + 0x2c], eax
mov dword [esp + 0x34], ecx
mov dword [esp + 0x38], esi
cmp edx, ecx
jb 0x4080f6
ja 0x4080ec
cmp ebp, eax
jbe 0x4080f6
mov ebp, eax
mov dword [esp + 0x1c], ecx
mov dword [esp + 0x18], ebp
push ebp
call fcn.004338c8
pop ecx
mov ebp, eax
xor eax, eax
push eax
push eax
push dword [esp + 0x18]
mov dword [esp + 0x3c], eax
push esi
push ebx
call dword [sym.imp.KERNEL32.dll_SetFilePointerEx]
test eax, eax
je 0x408261
push 0
lea eax, [esp + 0x34]
push eax
push dword [esp + 0x20]
push ebp
push ebx
call dword [sym.imp.KERNEL32.dll_ReadFile]
sub esp, 0x18
test eax, eax
je 0x40822c
mov esi, esp
lea ecx, [esp + 0x80]
push dword [esp + 0x48]
push ebp
call fcn.00401f86
push eax
push 0x473ee8
push dword [esp + 0x44]
lea ecx, [esp + 0xa4]
push dword [esp + 0x44]
call fcn.0041ad7b
pop ecx
pop ecx
mov edx, eax
lea ecx, [esp + 0x70]
call fcn.004027cb
pop ecx
mov edx, eax
mov ecx, esi
call fcn.0040275c
pop ecx
push 0x52
mov ecx, edi
call fcn.00404468
lea ecx, [esp + 0x50]
mov esi, eax
call fcn.00401eea
lea ecx, [esp + 0x80]
call fcn.00401eea
lea ecx, [esp + 0x68]
call fcn.00401eea
cmp esi, 0xffffffff
je 0x408212
push ebp
call fcn.004338d1
mov ebp, dword [esp + 0x1c]
sub dword [esp + 0x30], ebp
mov edx, dword [esp + 0x20]
mov esi, dword [esp + 0x3c]
mov eax, dword [esp + 0x2c]
pop ecx
mov ecx, dword [esp + 0x34]
sbb ecx, edx
add dword [esp + 0x20], 1
mov dword [esp + 0x34], ecx
adc dword [esp + 0x24], 0
add esi, ebp
mov dword [esp + 0x38], esi
adc dword [esp + 0x10], edx
cmp dword [esp + 0x10], eax
mov eax, dword [esp + 0x2c]
jb 0x4080e2
ja 0x4081ff
cmp esi, dword [esp + 0x14]
jb 0x4080e2
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov ecx, edi
call fcn.004047eb
jmp 0x407f7d
mov ecx, edi
call fcn.004047eb
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push ebp
call fcn.004338d1
pop ecx
jmp 0x407f78
mov ecx, esp
push str.ReadFile_error
call fcn.00401f66
sub esp, 0x18
mov ecx, esp
push 0x4653b8
call fcn.00401f66
call fcn.0041a686
push ebp
call fcn.004338d1
add esp, 0x34
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x407f71
sub esp, 0x18
mov ecx, esp
push str.SetFilePointerEx_error
jmp 0x408233