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

Disassembly:
sub esp, 0x430
mov eax, dword [0x4b1598]
xor eax, esp
mov dword [esp + 0x42c], eax
mov eax, dword [esp + 0x438]
push ebx
push ebp
push esi
push edi
mov edi, dword [esp + 0x444]
mov dword [esp + 0x20], eax
mov eax, dword [edi]
test eax, eax
mov esi, ecx
mov dword [esp + 0x10], esi
mov dword [esp + 0x28], edi
je 0x40a3b7
push eax
call dword [sym.imp.KERNEL32.dll_LocalFree]
mov dword [edi], 0
mov ecx, esi
call fcn.0040a130
push eax
push 0x40
call dword [sym.imp.KERNEL32.dll_LocalAlloc]
mov dword [edi], eax
mov ebp, dword [esi + 0x1d0]
add esi, 0x1cc
xor edi, edi
cmp ebp, dword [esi + 8]
mov dword [esp + 0x24], 0
jbe 0x40a3e9
call fcn.004113d1
mov ebx, esi
jmp 0x40a3f0
mov eax, dword [esi + 8]
cmp dword [esi + 4], eax
mov dword [esp + 0x1c], eax
jbe 0x40a401
call fcn.004113d1
test ebx, ebx
je 0x40a409
cmp ebx, esi
je 0x40a40e
call fcn.004113d1
cmp ebp, dword [esp + 0x1c]
jae 0x40a726
xor esi, esi
test ebx, ebx
jne 0x40a423
call fcn.004113d1
cmp ebp, dword [ebx + 8]
jb 0x40a42d
call fcn.004113d1
mov eax, dword [ebp + 0x500]
sub eax, 1
je 0x40a68a
sub eax, 1
jne 0x40a6dd
xor edi, edi
cmp ebp, dword [ebx + 8]
mov dword [esp + 0x18], edi
jb 0x40a455
call fcn.004113d1
push 0
push 0x8000080
push 3
push 0
push 1
lea eax, [ebp + 0x100]
push connect
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov ebx, eax
xor esi, esi
cmp ebx, 0xffffffff
mov dword [esp + 0x14], esi
je 0x40a48f
push esi
push ebx
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov dword [esp + 0x14], eax
mov esi, eax
mov eax, dword [esp + 0x10]
mov dword [eax + 4], esi
add eax, 0x1cc
cmp ebp, dword [eax + 8]
mov dword [esp + 0x30], eax
jb 0x40a4ad
call fcn.004113d1
mov eax, dword [esp + 0x30]
cmp esi, dword [ebp + 0x508]
jb 0x40a500
cmp ebp, dword [eax + 8]
jb 0x40a4c3
call fcn.004113d1
mov eax, dword [esp + 0x30]
cmp dword [ebp + 0x508], 0
jbe 0x40a500
cmp ebp, dword [eax + 8]
jb 0x40a4d6
call fcn.004113d1
mov ecx, dword [ebp + 0x508]
push 0
push 0
push ecx
push ebx
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov edx, dword [esp + 0x30]
cmp ebp, dword [edx + 8]
jb 0x40a4f6
call fcn.004113d1
sub esi, dword [ebp + 0x508]
mov dword [esp + 0x14], esi
cmp esi, 0x96000
mov dword [esp + 0x2c], esi
jbe 0x40a518
mov dword [esp + 0x14], 0x96000
mov esi, dword [esp + 0x14]
add esi, 0x23b8
push esi
push 0x40
call dword [sym.imp.KERNEL32.dll_LocalAlloc]
push 0x400
mov esi, eax
lea eax, [esp + 0x3d]
push 0
push eax
mov byte [esp + 0x44], 0
call fcn.00410e00
mov eax, dword [esp + 0x1c]
add eax, 0x1cc
add esp, 0xc
cmp ebp, dword [eax + 8]
jb 0x40a555
call fcn.004113d1
mov eax, dword [esp + 0x10]
add eax, 0x1cc
cmp ebp, dword [eax + 8]
jb 0x40a568
call fcn.004113d1
mov eax, dword [esp + 0x10]
add eax, 0x1cc
cmp ebp, dword [eax + 8]
jb 0x40a57b
call fcn.004113d1
mov ecx, dword [esp + 0x10]
lea eax, [ebp + 0x100]
push eax
call fcn.00409a40
mov ecx, dword [esp + 0x20]
push eax
lea eax, [ebp + 0x100]
push eax
push ebp
push ecx
push str.___s_r_nContent_Disposition:_form_data__name__s___filename__s__r_nContent_Type:__s_r_n_r_n
push esi
call fcn.00411b16
mov eax, esi
add esp, 0x18
lea edx, [eax + 1]
lea esp, [esp]
mov cl, byte [eax]
add eax, 1
test cl, cl
jne 0x40a5b0
sub eax, edx
push 0
lea edx, [esp + 0x1c]
push edx
mov dword [esp + 0x24], eax
push 0x400
lea eax, [esp + 0x44]
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x40a636
jmp 0x40a5e0
mov eax, dword [esp + 0x18]
test eax, eax
jbe 0x40a636
cmp edi, dword [esp + 0x14]
ja 0x40a636
mov edx, dword [esp + 0x1c]
push eax
lea ecx, [esp + 0x3c]
add edx, edi
push ecx
add edx, esi
push edx
call fcn.00412200
push 0x401
lea eax, [esp + 0x48]
push 0
push eax
call fcn.00410e00
add edi, dword [esp + 0x30]
add esp, 0x18
push 0
lea ecx, [esp + 0x1c]
push ecx
push 0x400
lea edx, [esp + 0x44]
push edx
push ebx
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x40a5e0
mov eax, dword [esp + 0x10]
add eax, 0x1cc
cmp ebp, dword [eax + 8]
jb 0x40a649
call fcn.004113d1
mov ecx, dword [esp + 0x10]
lea eax, [ebp + 0x100]
push eax
call fcn.00409a40
mov ecx, dword [esp + 0x2c]
push eax
mov eax, dword [esp + 0x18]
push edi
push eax
push ecx
push str.file_chunk__d__for_sent__d._dwTotalBytes__d___s_
call fcn.0040d100
mov edx, dword [esp + 0x30]
add esp, 0x14
add edi, edx
push ebx
mov word [edi + esi], 0xa0d
call dword [sym.imp.KERNEL32.dll_CloseHandle]
add edi, 2
jmp 0x40a6dd
push 0x2000
push 0x40
call dword [sym.imp.KERNEL32.dll_LocalAlloc]
cmp ebp, dword [ebx + 8]
mov esi, eax
jb 0x40a6ad
call fcn.004113d1
cmp ebp, dword [ebx + 8]
jb 0x40a6ad
call fcn.004113d1
mov ecx, dword [esp + 0x20]
lea eax, [ebp + 0x100]
push eax
push ebp
push ecx
push str.___s_r_nContent_Disposition:_form_data__name__s__r_n_r_n_s_r_n
push esi
call fcn.00411b16
mov eax, esi
add esp, 0x14
lea edx, [eax + 1]
lea ecx, [ecx]
mov cl, byte [eax]
add eax, 1
test cl, cl
jne 0x40a6d0
sub eax, edx
mov edi, eax
mov edx, dword [esp + 0x28]
mov eax, dword [edx]
mov ebx, dword [esp + 0x24]
push edi
add eax, ebx
push esi
push eax
call fcn.00412200
add ebx, edi
add esp, 0xc
test esi, esi
mov dword [esp + 0x24], ebx
je 0x40a705
push esi
call dword [sym.imp.KERNEL32.dll_LocalFree]
mov esi, dword [esp + 0x10]
add esi, 0x1cc
mov ebx, esi
cmp ebp, dword [ebx + 8]
jb 0x40a71b
call fcn.004113d1
add ebp, 0x50c
jmp 0x40a3f0
mov ebx, dword [esp + 0x28]
mov esi, dword [esp + 0x20]
mov ecx, dword [ebx]
mov edi, dword [esp + 0x24]
mov eax, esi
mov word [edi + ecx], 0x2d2d
lea edx, [eax + 1]
nop
mov cl, byte [eax]
add eax, 1
test cl, cl
jne 0x40a740
sub eax, edx
mov edx, dword [ebx]
push eax
lea eax, [edi + edx + 2]
push esi
push eax
call fcn.00412200
mov eax, esi
add esp, 0xc
lea ebp, [eax + 1]
mov cl, byte [eax]
add eax, 1
test cl, cl
jne 0x40a761
mov ecx, dword [ebx]
mov dx, word [str.___r_n]
sub eax, ebp
add eax, edi
lea eax, [eax + ecx + 2]
mov word [eax], dx
mov cl, byte [0x48803a]
mov byte [eax + 2], cl
mov eax, esi
lea edx, [eax + 1]
lea esp, [esp]
mov cl, byte [eax]
add eax, 1
test cl, cl
jne 0x40a790
mov ecx, dword [esp + 0x43c]
sub eax, edx
lea eax, [eax + edi + 5]
pop edi
pop esi
pop ebp
pop ebx
xor ecx, esp
call fcn.004117a8
add esp, 0x430
ret 8