Function at 0x4777a0
Capabilities:
Create tcp socket
Download and write a file
Receive and write data from server to client
Receive data
Receive data on socket
Set socket configuration
Write file on windows

Disassembly:
push ebp
mov ebp, esp
mov eax, 0x25b0
call fcn.00414680
mov eax, dword [0x494494]
xor eax, ebp
mov dword [ebp - 8], eax
mov dword [ebp - 4], 0
mov dword [ebp - 0x2594], 0
mov dword [ebp - 0x410], 0xffffffff
mov dword [ebp - 0x40c], 0
mov dword [ebp - 0x2570], 0
mov dword [ebp - 0x256c], 0
mov dword [ebp - 0x2590], 0
mov dword [ebp - 0x258c], 0
mov dword [ebp - 0x2584], 0
mov dword [ebp - 0x2580], 0xbb8
mov dword [ebp - 0x2574], 0
mov dword [ebp - 0x257c], 0xffffffff
mov dword [ebp - 0x245c], 0x4772b0
cmp dword [ebp + 0x10], 0
je 0x47784c
mov eax, dword [ebp + 0x10]
mov dword [eax], 0
mov dword [eax + 4], 0
push 0
push 6
push 4
push 0
push 0
push 0xc0000000
mov ecx, dword [ebp + 0xc]
push ecx
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov dword [ebp - 0x2578], eax
cmp dword [ebp - 0x2578], 0xffffffff
jne 0x47787d
xor eax, eax
xor edx, edx
jmp 0x478039
push 7
push 0x487a04
mov edx, dword [ebp + 8]
push edx
call fcn.00417efb
add esp, 0xc
test eax, eax
je 0x4778ac
push 0x487a0c
call dword [ebp - 0x245c]
add esp, 4
jmp 0x478001
lea eax, [ebp - 0x408]
push eax
lea ecx, [ebp - 0x450]
push ecx
lea edx, [ebp - 0x2560]
push edx
push 0
mov eax, dword [ebp + 8]
push eax
call fcn.004775f0
add esp, 0x14
push 6
push 1
push 2
call dword [sym.imp.WS2_32.dll_socket]
mov dword [ebp - 0x257c], eax
cmp dword [ebp - 0x257c], 0xffffffff
jne 0x477908
call fcn.00476f70
push eax
push str.Unable_to_initialize_socket._s_n
call dword [ebp - 0x245c]
add esp, 8
jmp 0x478001
push 4
lea ecx, [ebp - 0x2580]
push ecx
push 0x1006
push 0xffff
mov edx, dword [ebp - 0x257c]
push edx
call dword [sym.imp.WS2_32.dll_setsockopt]
mov eax, dword [ebp - 0x245c]
push eax
lea ecx, [ebp - 0x450]
push ecx
lea edx, [ebp - 0x2560]
push edx
mov eax, dword [ebp - 0x257c]
push eax
call fcn.00477410
add esp, 0x10
test eax, eax
jne 0x47795a
jmp 0x478001
mov ecx, dword [ebp - 0x245c]
push ecx
push 0
push 0
push 0
push 0
push 0
lea edx, [ebp - 0x408]
push edx
lea eax, [ebp - 0x450]
push eax
lea ecx, [ebp - 0x2560]
push ecx
mov edx, dword [ebp - 0x257c]
push edx
call fcn.004772c0
add esp, 0x28
test eax, eax
jne 0x47799d
jmp 0x478001
push 0x2001
push 0
lea eax, [ebp - 0x2458]
push eax
call fcn.004067d0
add esp, 0xc
push 0
push 0x2000
lea ecx, [ebp - 0x2458]
push ecx
mov edx, dword [ebp - 0x257c]
push edx
call dword [sym.imp.WS2_32.dll_recv]
mov dword [ebp - 0x2564], eax
cmp dword [ebp - 0x2564], 0xffffffff
jne 0x4779fb
call fcn.00476f70
push eax
push str.Failed_to_receive_data._s_n
call dword [ebp - 0x245c]
add esp, 8
jmp 0x478001
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
mov dword [ebp - 0x2598], eax
cmp dword [ebp - 0x2598], 0x2749
je 0x477a43
cmp dword [ebp - 0x2598], 0x274a
je 0x477a43
cmp dword [ebp - 0x2598], 0x2744
je 0x477a43
cmp dword [ebp - 0x2598], 0x2746
je 0x477a43
cmp dword [ebp - 0x2598], 0x2745
jne 0x477a5c
call fcn.00476f70
push eax
push str.The_network_has_been_disconnected._s_n
call dword [ebp - 0x245c]
add esp, 8
jmp 0x477fb3
cmp dword [ebp - 0x2598], 0x274c
jne 0x477a90
call fcn.00476f70
push eax
push str.Respond_timeout._s_n
call dword [ebp - 0x245c]
add esp, 8
mov eax, dword [ebp - 0x2584]
add eax, 1
mov dword [ebp - 0x2584], eax
jmp 0x477fb3
cmp dword [ebp - 0x2564], 0
jne 0x477ad4
mov ecx, dword [ebp - 0x2574]
add ecx, 1
mov dword [ebp - 0x2574], ecx
cmp dword [ebp - 0x2574], 3
jb 0x477acf
mov edx, dword [ebp - 0x2584]
add edx, 1
mov dword [ebp - 0x2584], edx
mov dword [ebp - 0x2574], 0
jmp 0x477fb3
jmp 0x477f8d
cmp dword [ebp - 4], 0
je 0x477b7b
mov dword [ebp - 0x259c], 0
mov eax, dword [ebp - 0x2564]
mov dword [ebp - 0x25a0], eax
mov ecx, dword [ebp - 0x25a0]
xor edx, edx
add ecx, dword [ebp - 0x2570]
mov eax, dword [ebp - 0x256c]
adc eax, edx
mov dword [ebp - 0x2570], ecx
mov dword [ebp - 0x256c], eax
push 0
lea ecx, [ebp - 0x259c]
push ecx
mov edx, dword [ebp - 0x25a0]
push edx
lea eax, [ebp - 0x2458]
push eax
mov ecx, dword [ebp - 0x2578]
push ecx
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov edx, dword [ebp - 0x259c]
cmp edx, dword [ebp - 0x25a0]
je 0x477b54
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 0x259c], eax
mov eax, dword [ebp - 0x25a0]
xor ecx, ecx
add eax, dword [ebp - 0x2590]
mov edx, dword [ebp - 0x258c]
adc edx, ecx
mov dword [ebp - 0x2590], eax
mov dword [ebp - 0x258c], edx
jmp 0x477f82
lea eax, [ebp - 0x2458]
mov dword [ebp - 0x25a4], eax
cmp dword [ebp - 0x25a4], 0
je 0x477f82
mov ecx, dword [ebp - 0x2564]
lea edx, [ebp + ecx - 0x2458]
cmp dword [ebp - 0x25a4], edx
jae 0x477f82
push 4
push str._r_n_r_n
mov eax, dword [ebp - 0x25a4]
push eax
call fcn.00406137
add esp, 0xc
test eax, eax
jne 0x477c8e
mov dword [ebp - 0x25ac], 0
mov ecx, dword [ebp - 0x25a4]
add ecx, 4
mov dword [ebp - 0x25a4], ecx
mov edx, dword [ebp - 0x25a4]
lea eax, [ebp - 0x2458]
sub edx, eax
mov ecx, dword [ebp - 0x2564]
sub ecx, edx
mov dword [ebp - 0x25b0], ecx
mov dword [ebp - 4], 1
mov edx, dword [ebp - 0x25b0]
xor eax, eax
add edx, dword [ebp - 0x2570]
mov ecx, dword [ebp - 0x256c]
adc ecx, eax
mov dword [ebp - 0x2570], edx
mov dword [ebp - 0x256c], ecx
push 0
lea edx, [ebp - 0x25ac]
push edx
mov eax, dword [ebp - 0x25b0]
push eax
mov ecx, dword [ebp - 0x25a4]
push ecx
mov edx, dword [ebp - 0x2578]
push edx
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov eax, dword [ebp - 0x25ac]
cmp eax, dword [ebp - 0x25b0]
je 0x477c67
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 0x25ac], eax
mov ecx, dword [ebp - 0x25b0]
xor edx, edx
add ecx, dword [ebp - 0x2590]
mov eax, dword [ebp - 0x258c]
adc eax, edx
mov dword [ebp - 0x2590], ecx
mov dword [ebp - 0x258c], eax
jmp 0x477f82
mov ecx, dword [ebp - 0x25a4]
movsx edx, byte [ecx]
cmp edx, 0x20
je 0x477cc6
mov eax, dword [ebp - 0x25a4]
movsx ecx, byte [eax]
cmp ecx, 9
je 0x477cc6
mov edx, dword [ebp - 0x25a4]
movsx eax, byte [edx]
cmp eax, 0xd
je 0x477cc6
mov ecx, dword [ebp - 0x25a4]
movsx edx, byte [ecx]
cmp edx, 0xa
jne 0x477cd7
mov eax, dword [ebp - 0x25a4]
add eax, 1
mov dword [ebp - 0x25a4], eax
jmp 0x477c8e
push 8
push str.HTTP_1.1
mov ecx, dword [ebp - 0x25a4]
push ecx
call fcn.00417efb
add esp, 0xc
test eax, eax
jne 0x477d77
mov edx, dword [ebp - 0x25a4]
add edx, 8
mov dword [ebp - 0x25a8], edx
mov eax, dword [ebp - 0x25a8]
movsx ecx, byte [eax]
cmp ecx, 0x20
je 0x477d20
mov edx, dword [ebp - 0x25a8]
movsx eax, byte [edx]
cmp eax, 9
jne 0x477d31
mov ecx, dword [ebp - 0x25a8]
add ecx, 1
mov dword [ebp - 0x25a8], ecx
jmp 0x477d04
mov edx, dword [ebp - 0x245c]
push edx
mov eax, dword [ebp - 0x25a8]
push eax
call fcn.00477510
add esp, 8
mov ecx, dword [ebp - 0x25a8]
push ecx
call fcn.00406116
add esp, 4
mov dword [ebp - 0x2594], eax
cmp dword [ebp - 0x2594], 0x190
jl 0x477d72
jmp 0x478001
jmp 0x477f63
push 0xe
push str.accept_ranges:
mov edx, dword [ebp - 0x25a4]
push edx
call fcn.00417efb
add esp, 0xc
test eax, eax
jne 0x477e00
mov eax, dword [ebp - 0x25a4]
add eax, 0xe
mov dword [ebp - 0x25a8], eax
mov ecx, dword [ebp - 0x25a8]
movsx edx, byte [ecx]
cmp edx, 0x20
je 0x477dbc
mov eax, dword [ebp - 0x25a8]
movsx ecx, byte [eax]
cmp ecx, 9
jne 0x477dcd
mov edx, dword [ebp - 0x25a8]
add edx, 1
mov dword [ebp - 0x25a8], edx
jmp 0x477da0
push 4
push str.none
mov eax, dword [ebp - 0x25a8]
push eax
call fcn.00417efb
add esp, 0xc
test eax, eax
jne 0x477dfb
mov dword [ebp - 0x2590], 0
mov dword [ebp - 0x258c], 0
jmp 0x477f63
push 0xf
push str.content_length:
mov ecx, dword [ebp - 0x25a4]
push ecx
call fcn.00417efb
add esp, 0xc
test eax, eax
jne 0x477e90
mov edx, dword [ebp - 0x25a4]
add edx, 0xf
mov dword [ebp - 0x25a8], edx
mov eax, dword [ebp - 0x25a8]
movsx ecx, byte [eax]
cmp ecx, 0x20
je 0x477e45
mov edx, dword [ebp - 0x25a8]
movsx eax, byte [edx]
cmp eax, 9
jne 0x477e56
mov ecx, dword [ebp - 0x25a8]
add ecx, 1
mov dword [ebp - 0x25a8], ecx
jmp 0x477e29
mov edx, dword [ebp - 0x25a8]
push edx
call fcn.00406121
add esp, 4
mov dword [ebp - 0x410], eax
mov dword [ebp - 0x40c], edx
cmp dword [ebp + 0x10], 0
je 0x477e8b
mov eax, dword [ebp + 0x10]
mov ecx, dword [ebp - 0x410]
mov dword [eax], ecx
mov edx, dword [ebp - 0x40c]
mov dword [eax + 4], edx
jmp 0x477f63
cmp dword [ebp - 0x2594], 0x12c
jl 0x477f63
push 9
push str.Location:
mov eax, dword [ebp - 0x25a4]
push eax
call fcn.00417efb
add esp, 0xc
test eax, eax
jne 0x477f63
mov ecx, dword [ebp - 0x25a4]
add ecx, 9
mov dword [ebp - 0x25a8], ecx
mov edx, dword [ebp - 0x25a8]
movsx eax, byte [edx]
cmp eax, 0x20
je 0x477ee9
mov ecx, dword [ebp - 0x25a8]
movsx edx, byte [ecx]
cmp edx, 9
jne 0x477efa
mov eax, dword [ebp - 0x25a8]
add eax, 1
mov dword [ebp - 0x25a8], eax
jmp 0x477ecd
push 7
push str.http:__
mov ecx, dword [ebp - 0x25a8]
push ecx
call fcn.00417efb
add esp, 0xc
test eax, eax
je 0x477f2c
push str.Protocol_must_be_HTTP._n
call dword [ebp - 0x245c]
add esp, 4
jmp 0x478001
lea edx, [ebp - 0x408]
push edx
lea eax, [ebp - 0x450]
push eax
lea ecx, [ebp - 0x2560]
push ecx
push 0
mov edx, dword [ebp - 0x25a8]
push edx
call fcn.004775f0
add esp, 0x14
mov eax, dword [ebp - 0x2584]
add eax, 1
mov dword [ebp - 0x2584], eax
jmp 0x477f82
push 0x487b04
mov ecx, dword [ebp - 0x25a4]
push ecx
call fcn.00401020
add esp, 8
mov dword [ebp - 0x25a4], eax
jmp 0x477b87
cmp dword [ebp - 0x2584], 0
je 0x477f8d
jmp 0x477fb3
mov edx, dword [ebp - 0x256c]
cmp edx, dword [ebp - 0x40c]
jb 0x47799d
ja 0x477fb3
mov eax, dword [ebp - 0x2570]
cmp eax, dword [ebp - 0x410]
jb 0x47799d
mov ecx, dword [ebp - 0x257c]
push ecx
call dword [sym.imp.WS2_32.dll_closesocket]
mov edx, dword [ebp - 0x2584]
mov eax, dword [ebp - 0x2584]
sub eax, 1
mov dword [ebp - 0x2584], eax
test edx, edx
jne 0x4778cf
cmp dword [ebp - 0x2578], 0xffffffff
je 0x477ff3
mov ecx, dword [ebp - 0x2578]
push ecx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [ebp - 0x2570]
mov edx, dword [ebp - 0x256c]
jmp 0x478039
cmp dword [ebp - 0x257c], 0xffffffff
je 0x478017
mov edx, dword [ebp - 0x257c]
push edx
call dword [sym.imp.WS2_32.dll_closesocket]
cmp dword [ebp - 0x2578], 0xffffffff
je 0x47802d
mov eax, dword [ebp - 0x2578]
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [ebp - 0x2570]
mov edx, dword [ebp - 0x256c]
mov ecx, dword [ebp - 8]
xor ecx, ebp
call fcn.00405ce8
mov esp, ebp
pop ebp
ret