Function at 0x406380
Capabilities:
Act as tcp client
Connect socket
Connect tcp socket
Create tcp socket
Get file size
Initialize winsock library
Read file on windows
Receive data
Receive data on socket
Resolve dns

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
push ebx
push eax
mov eax, 0x2050
call fcn.00407068
sub esp, eax
mov eax, dword [esp + eax]
mov dword [ebp - 0x2038], edx
test eax, eax
je 0x4063c0
mov dword [esp + 4], str.Cant_submit_to_an_alternative_URL
mov dword [esp], 7
call dbg.report
xor eax, eax
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret
mov dword [esp + 8], str.test.winehq.org
mov dword [esp + 4], str.Opening_HTTP_connection_to__s
mov dword [esp], 0
call dbg.report
lea eax, [sa.sin_zero]
mov dword [esp], 0x202
mov dword [esp + 4], eax
call dword [sym.imp.wsock32.dll_WSAStartup]
sub esp, 8
test eax, eax
jne 0x4065e6
mov edx, 2
mov word [ebp - 0x2020], dx
mov dword [esp], 0x50
call dword [sym.imp.wsock32.dll_htons]
sub esp, 4
mov word [ebp - 0x201e], ax
mov dword [esp], str.test.winehq.org
call dword [sym.imp.wsock32.dll_inet_addr]
mov dword [sa.sin_family], 0
mov dword [ebp - 0x201c], eax
sub esp, 4
mov dword [sa.sin_addr], 0
cmp eax, 0xffffffff
je 0x406630
mov dword [esp + 8], 6
mov dword [esp + 4], 1
mov dword [esp], 2
call dword [sym.imp.wsock32.dll_socket]
sub esp, 0xc
mov ebx, eax
cmp eax, 0xffffffff
je 0x406a52
lea eax, [ebp - 0x2020]
mov dword [esp + 8], 0x10
mov dword [esp + 4], eax
mov dword [esp], ebx
call dword [sym.imp.wsock32.dll_connect]
sub esp, 0xc
test eax, eax
jne 0x40691d
mov dword [esp + 0x18], 0
mov esi, dword [sym.imp.kernel32.dll_CreateFileA]
mov dword [esp + 0x14], 0
mov dword [esp + 0x10], 3
mov dword [esp + 0xc], 0
mov dword [esp + 8], 7
mov dword [esp + 4], 0x80000000
mov eax, dword [ebp - 0x2038]
mov dword [esp], eax
call esi
mov dword [ebp - 0x2034], eax
sub esp, 0x1c
cmp eax, 0xffffffff
je 0x4065f0
mov dword [esp + 4], str.Sending_header
mov dword [esp], 0
call dbg.report
mov dword [esp + 4], 0
mov eax, dword [ebp - 0x2034]
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_GetFileSize]
mov dword [ebp - 0x2030], eax
mov esi, eax
mov eax, dword [ebp - 0x2038]
sub esp, 8
mov dword [esp + 4], str.____8___cut_here__8____r_nContent_Disposition:_form_data__name_reportfile___filename__s__r_nContent_Type:_application_octet_stream_r_n_r_n
mov dword [esp + 8], eax
lea eax, [ebp - 0x2024]
mov dword [esp], eax
call dbg.strmake
mov dword [ebp - 0x203c], eax
mov eax, dword [ebp - 0x2024]
mov dword [esp + 4], global_head
lea eax, [esi + eax + 0x72]
mov dword [esp], ebx
mov dword [esp + 8], eax
call dbg.send_str
test eax, eax
je 0x406660
mov eax, dword [ebp - 0x203c]
mov dword [esp], eax
call dword [sym.imp.msvcrt.dll_free]
mov eax, dword [sym.imp.msvcrt.dll__errno]
mov dword [ebp - 0x2044], eax
call dword [sym.imp.wsock32.dll_WSAGetLastError]
mov esi, eax
mov eax, dword [ebp - 0x2044]
call eax
mov dword [esp + 0xc], esi
mov eax, dword [eax]
mov dword [esp + 4], str.Error_sending_header:__d___d
mov dword [esp], 7
mov dword [esp + 8], eax
call dbg.report
mov eax, dword [ebp - 0x2034]
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_CloseHandle]
sub esp, 4
mov dword [esp], ebx
call dword [sym.imp.wsock32.dll_closesocket]
sub esp, 4
call dword [sym.imp.wsock32.dll_WSACleanup]
mov eax, 1
jmp 0x4063b6
mov eax, dword fs:[0x18]
cmp dword [eax + 0x34], 0x57
je 0x406a75
mov eax, dword fs:[0x18]
mov eax, dword [eax + 0x34]
mov dword [esp + 0xc], eax
mov eax, dword [ebp - 0x2038]
mov dword [esp + 4], str.Cant_open_file__s:__u
mov dword [esp + 8], eax
mov dword [esp], 7
call dbg.report
jmp 0x4065d4
mov dword [esp], str.test.winehq.org
call dword [sym.imp.wsock32.dll_gethostbyname]
sub esp, 4
test eax, eax
je 0x406be8
mov eax, dword [eax + 0xc]
mov eax, dword [eax]
mov eax, dword [eax]
mov dword [ebp - 0x201c], eax
jmp 0x406454
mov edx, dword [ebp - 0x2024]
test edx, edx
je 0x4066c9
mov eax, dword [sym.imp.wsock32.dll_send]
mov esi, dword [ebp - 0x203c]
mov dword [ebp - 0x2040], ebx
mov edi, dword [sym.imp.msvcrt.dll__errno]
mov dword [ebp - 0x202c], eax
mov ebx, esi
mov esi, edx
lea esi, [esi]
nop
mov dword [esp + 0xc], 0
mov dword [esp + 8], esi
mov dword [esp + 4], ebx
mov eax, dword [ebp - 0x2040]
mov dword [esp], eax
mov eax, dword [ebp - 0x202c]
call eax
sub esp, 0x10
cmp eax, 0xffffffff
je 0x4069d0
add ebx, eax
sub esi, eax
jne 0x406690
mov ebx, dword [ebp - 0x2040]
mov eax, dword [ebp - 0x203c]
mov dword [esp], eax
mov eax, dword [sym.imp.msvcrt.dll_free]
mov dword [ebp - 0x203c], eax
call eax
mov esi, dword [ebp - 0x2030]
mov dword [esp + 4], str.Sending__u_bytes_of_data
mov dword [esp], 0
mov dword [esp + 8], esi
call dbg.report
mov dword [esp + 8], esi
mov dword [esp + 4], 2
mov dword [esp], 1
call dbg.report
mov dword [ebp - 0x2024], 0
test esi, esi
je 0x406823
mov dword [ebp - 0x202c], ebx
lea esi, [esi]
lea eax, [ebp - 0x2028]
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], eax
lea eax, [sa.sin_zero]
mov dword [esp + 8], 0x1000
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x2034]
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_ReadFile]
sub esp, 0x14
test eax, eax
je 0x40681d
mov eax, dword [0x40d040]
test eax, eax
jne 0x406a47
mov edi, dword [ebp - 0x2028]
test edi, edi
je 0x40681d
mov ecx, dword [ebp - 0x2024]
mov edx, dword [ebp - 0x2030]
lea eax, [edi + ecx]
mov dword [ebp - 0x2024], eax
cmp edx, eax
jae 0x4067ae
mov edi, edx
sub edi, ecx
mov dword [ebp - 0x2028], edi
je 0x4067f3
mov esi, dword [sym.imp.wsock32.dll_send]
lea ebx, [sa.sin_zero]
lea esi, [esi]
mov dword [esp + 0xc], 0
mov dword [esp + 8], edi
mov dword [esp + 4], ebx
mov eax, dword [ebp - 0x202c]
mov dword [esp], eax
call esi
sub esp, 0x10
cmp eax, 0xffffffff
je 0x406940
add ebx, eax
sub edi, eax
jne 0x4067c0
mov edi, dword [ebp - 0x2028]
mov dword [esp + 8], str.Network_transfer:_In_progress
mov dword [esp + 4], edi
mov dword [esp], 3
call dbg.report
mov eax, dword [ebp - 0x2030]
cmp dword [ebp - 0x2024], eax
jb 0x406730
mov ebx, dword [ebp - 0x202c]
mov eax, dword [ebp - 0x2034]
mov esi, str._r_n____8___cut_here__8____r_nContent_Disposition:_form_data__name_submit__r_n_r_nUpload_File_r_n____8___cut_here__8______r_n
mov edi, 0x72
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_CloseHandle]
mov eax, dword [sym.imp.wsock32.dll_send]
sub esp, 4
mov dword [ebp - 0x202c], eax
lea esi, [esi]
mov dword [esp + 0xc], 0
mov dword [esp + 8], edi
mov dword [esp + 4], esi
mov dword [esp], ebx
mov eax, dword [ebp - 0x202c]
call eax
sub esp, 0x10
cmp eax, 0xffffffff
je 0x406990
add esi, eax
sub edi, eax
jne 0x406850
mov dword [esp + 8], str.Network_transfer:_Done
mov esi, 0x2000
mov dword [esp + 4], 0
mov dword [esp], 3
call dbg.report
mov dword [ebp - 0x2024], 0
lea esi, [esi]
nop
mov eax, esi
mov dword [esp + 0xc], 0
sub eax, edi
mov dword [esp], ebx
mov dword [esp + 8], eax
lea eax, [sa.sin_zero]
add eax, edi
mov dword [esp + 4], eax
call dword [sym.imp.wsock32.dll_recv]
mov dword [ebp - 0x2028], eax
sub esp, 0x10
test eax, eax
je 0x406ad0
cmp eax, 0xffffffff
je 0x406a00
add eax, dword [ebp - 0x2024]
mov dword [ebp - 0x2024], eax
mov edi, eax
cmp eax, 0x2000
jne 0x4068b0
mov dword [esp + 4], str.Buffer_overflow
mov dword [esp], 7
call dbg.report
jmp 0x4065d4
call dword [sym.imp.wsock32.dll_WSAGetLastError]
mov dword [esp + 4], str.Cant_connect:__d
mov dword [esp + 8], eax
mov dword [esp], 8
call dbg.report
jmp 0x4065d4
call dword [sym.imp.msvcrt.dll__errno]
cmp dword [eax], 4
je 0x4067c0
mov ebx, dword [ebp - 0x202c]
call dword [sym.imp.wsock32.dll_WSAGetLastError]
mov esi, eax
call dword [sym.imp.msvcrt.dll__errno]
mov dword [esp + 0xc], esi
mov eax, dword [eax]
mov dword [esp + 4], str.Error_sending_body:__d___d
mov dword [esp], 7
mov dword [esp + 8], eax
call dbg.report
jmp 0x4065c2
call dword [sym.imp.msvcrt.dll__errno]
cmp dword [eax], 4
je 0x406850
call dword [sym.imp.wsock32.dll_WSAGetLastError]
mov esi, eax
call dword [sym.imp.msvcrt.dll__errno]
mov dword [esp + 0xc], esi
mov eax, dword [eax]
mov dword [esp + 4], str.Error_sending_trailer:__d___d
mov dword [esp], 7
mov dword [esp + 8], eax
call dbg.report
jmp 0x4065d4
mov dword [ebp - 0x2044], edi
call edi
cmp dword [eax], 4
je 0x406690
mov eax, dword [ebp - 0x203c]
mov ebx, dword [ebp - 0x2040]
mov dword [esp], eax
call dword [sym.imp.msvcrt.dll_free]
jmp 0x406594
call dword [sym.imp.msvcrt.dll__errno]
cmp dword [eax], 4
jne 0x406a16
mov edi, dword [ebp - 0x2024]
jmp 0x4068b0
call dword [sym.imp.wsock32.dll_WSAGetLastError]
mov esi, eax
call dword [sym.imp.msvcrt.dll__errno]
mov dword [esp + 0xc], esi
mov eax, dword [eax]
mov dword [esp + 4], str.Error_receiving_reply:__d___d
mov dword [esp], 7
mov dword [esp + 8], eax
call dbg.report
jmp 0x4065d4
mov ebx, dword [ebp - 0x202c]
jmp 0x4065c2
call dword [sym.imp.wsock32.dll_WSAGetLastError]
mov dword [esp + 4], str.Cant_open_network_socket:__d
mov dword [esp + 8], eax
mov dword [esp], 8
call dbg.report
jmp 0x4065e0
mov dword [esp + 0x18], 0
mov dword [esp + 0x14], 0
mov dword [esp + 0x10], 3
mov dword [esp + 0xc], 0
mov dword [esp + 8], 3
mov dword [esp + 4], 0x80000000
mov eax, dword [ebp - 0x2038]
mov dword [esp], eax
call esi
mov dword [ebp - 0x2034], eax
sub esp, 0x1c
cmp eax, 0xffffffff
jne 0x4064f8
jmp 0x406600
mov dword [esp], ebx
call dword [sym.imp.wsock32.dll_closesocket]
sub esp, 4
mov ebx, eax
call dword [sym.imp.wsock32.dll_WSACleanup]
or eax, ebx
je 0x406b19
call dword [sym.imp.wsock32.dll_WSAGetLastError]
mov ebx, eax
call dword [sym.imp.msvcrt.dll__errno]
mov dword [esp + 0xc], ebx
mov eax, dword [eax]
mov dword [esp + 4], str.Error_closing_connection:__d___d
mov dword [esp], 7
mov dword [esp + 8], eax
call dbg.report
jmp 0x4065e6
mov eax, dword [ebp - 0x2030]
mov dword [esp + 0xc], eax
mov eax, dword [ebp - 0x2038]
mov dword [esp + 4], str.Received__s___d_bytes_._n
mov dword [esp + 8], eax
lea eax, [ebp - 0x2020]
mov dword [esp], eax
call dbg.strmake
mov edx, dword [ebp - 0x2020]
mov ebx, eax
mov eax, dword [ebp - 0x2024]
cmp eax, edx
jb 0x406b83
sub eax, edx
lea ecx, [sa.sin_zero]
mov dword [esp + 8], edx
add eax, ecx
mov dword [esp], ebx
mov dword [esp + 4], eax
call sym._memcmp
test eax, eax
jne 0x406b83
mov dword [esp], ebx
mov eax, dword [ebp - 0x203c]
call eax
jmp 0x4063b4
mov dword [esp], ebx
mov eax, dword [ebp - 0x203c]
call eax
mov eax, dword [ebp - 0x2024]
mov byte [ebp + eax - 0x2010], 0
lea eax, [sa.sin_zero]
mov dword [esp + 4], str._r_n_r_n
mov dword [esp], eax
call dword [sym.imp.msvcrt.dll_strstr]
lea edx, [eax + 4]
test eax, eax
lea eax, [sa.sin_zero]
cmovne eax, edx
mov dword [esp + 0xc], eax
mov eax, dword [ebp - 0x2038]
mov dword [esp + 4], str.Cant_submit_logfile__s._Server_response:__s
mov dword [esp + 8], eax
mov dword [esp], 8
call dbg.report
jmp 0x4065e6
mov dword [esp + 8], str.test.winehq.org
mov dword [esp + 4], str.Hostname_lookup_failed_for__s
mov dword [esp], 8
call dbg.report
jmp 0x4065e0