Function at 0x405494
Capabilities:
Act as tcp client
Connect socket
Connect tcp socket
Connect udp socket
Create tcp socket
Create udp socket
Download and write a file
Receive and write data from server to client
Receive data
Receive data on socket
Resolve dns
Send data
Send data on socket
Send http request
Send http request with host header
Write file on windows

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
push ebx
sub esp, 0x85c
mov eax, dword [ebp + 8]
mov edx, dword [0x415288]
mov dword [eax + 0x614], edx
inc edx
mov dword [0x415288], edx
mov dword [ebp - 0x82c], 0xffffffff
mov dword [esp + 4], 0
mov dword [esp], eax
call fcn.00405408
mov dword [esp + 8], 0
mov dword [esp + 4], 1
mov dword [esp], 2
call sub.WS2_32.dll_socket
sub esp, 0xc
mov dword [ebp - 0x82c], eax
mov eax, dword [ebp + 8]
add eax, 0x204
mov dword [esp], eax
call sub.WS2_32.dll_gethostbyname
push ecx
mov esi, eax
test eax, eax
je 0x405788
mov dword [esp + 8], 0x10
mov dword [esp + 4], 0
lea ebx, [ebp - 0x828]
mov dword [esp], ebx
call fcn.00409bfc
mov word [ebp - 0x828], 2
mov eax, dword [esi + 0xc]
mov eax, dword [eax]
mov eax, dword [eax]
mov dword [ebp - 0x824], eax
mov eax, dword [ebp + 8]
mov eax, dword [eax + 0x610]
and eax, 0xffff
mov dword [esp], eax
call sub.WS2_32.dll_htons
push edx
mov word [ebp - 0x826], ax
mov dword [esp + 8], 0x10
mov dword [esp + 4], ebx
mov eax, dword [ebp - 0x82c]
mov dword [esp], eax
call sub.WS2_32.dll_connect
sub esp, 0xc
test eax, eax
js 0x40578f
mov eax, dword [ebp + 8]
lea edx, [eax + 0x204]
mov dword [esp + 0x10], edx
mov dword [esp + 0xc], eax
mov dword [esp + 8], str.GET__s_HTTP_1.1_r_nHost:__s__r_nConnection:_close_r_n_r_n
mov dword [esp + 4], 0x800
lea ebx, [ebp - 0x818]
mov dword [esp], ebx
call fcn.004099d7
xor eax, eax
or ecx, 0xffffffff
mov edi, ebx
repne scasb al, byte es:[edi]
not ecx
dec ecx
mov dword [esp + 0xc], 0
mov dword [esp + 8], ecx
mov dword [esp + 4], ebx
mov eax, dword [ebp - 0x82c]
mov dword [esp], eax
call sub.WS2_32.dll_send
sub esp, 0x10
mov dword [esp + 4], 0x4109af
mov eax, dword [ebp + 8]
add eax, 0x408
mov dword [esp], eax
call sub.msvcrt.dll_fopen
mov edi, eax
test eax, eax
je 0x405796
mov dword [esp + 0xc], 0
mov dword [esp + 4], 0
mov dword [esp + 8], 0
mov dword [esp], eax
call fcn.004051f2
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0x800
mov dword [esp + 4], ebx
mov eax, dword [ebp - 0x82c]
mov dword [esp], eax
call sub.WS2_32.dll_recv
sub esp, 0x10
mov esi, eax
mov dword [esp + 8], ebx
mov dword [esp + 4], str._r_n_r_n
mov dword [esp], 0
call fcn.00409804
mov dword [ebp - 0x83c], eax
mov dword [esp + 8], ebx
mov dword [esp + 4], str.200_OK
mov dword [esp], 0
call fcn.00409804
inc eax
jne 0x4056a7
mov dword [esp], edi
call sub.msvcrt.dll_fclose
mov eax, dword [ebp + 8]
add eax, 0x408
mov dword [esp], eax
call fcn.00404831
mov eax, 5
jmp 0x40579b
mov eax, dword [ebp - 0x83c]
add eax, 4
mov dword [esp + 0xc], edi
sub esi, eax
mov dword [esp + 8], esi
mov dword [esp + 4], 1
add eax, ebx
mov dword [esp], eax
call sub.msvcrt.dll_fwrite
jmp 0x4056fc
mov dword [esp + 0xc], edi
mov dword [esp + 8], esi
mov dword [esp + 4], 1
mov dword [esp], ebx
call sub.msvcrt.dll_fwrite
cmp eax, esi
je 0x4056fc
mov dword [esp], edi
call sub.msvcrt.dll_fclose
mov eax, 4
jmp 0x40579b
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0x800
mov dword [esp + 4], ebx
mov eax, dword [ebp - 0x82c]
mov dword [esp], eax
call sub.WS2_32.dll_recv
sub esp, 0x10
mov esi, eax
test eax, eax
jne 0x4056ce
mov dword [esp], edi
call sub.msvcrt.dll_fclose
mov dword [esp + 4], 6
mov eax, dword [ebp + 8]
mov dword [esp], eax
call fcn.00405408
mov eax, dword [ebp + 8]
cmp byte [eax + 0x60c], 0
je 0x40576b
mov dword [esp + 8], 1
mov dword [esp + 4], 0x4109be
add eax, 0x408
mov dword [esp], eax
call fcn.004047f5
lea eax, [ebp + 8]
mov dword [esp], eax
call fcn.00405186
lea eax, [ebp - 0x82c]
mov dword [esp], eax
call fcn.00403c80
mov al, 1
jmp 0x4057c5
mov eax, 1
jmp 0x40579b
mov eax, 2
jmp 0x40579b
mov eax, 3
mov dword [esp + 4], eax
mov eax, dword [ebp + 8]
mov dword [esp], eax
call fcn.00405408
lea eax, [ebp + 8]
mov dword [esp], eax
call fcn.00405186
lea eax, [ebp - 0x82c]
mov dword [esp], eax
call fcn.00403c80
xor eax, eax
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret