Function at 0x401536
Capabilities:
Act as tcp client
Connect socket
Connect tcp socket
Create tcp socket
Download and write a file
Initialize winsock library
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
mov eax, 0x301d8
call fcn.004156c0
sub esp, eax
mov dword [ebp - 0xc], 0
mov dword [ebp - 0x10], 0
mov dword [ebp - 0x14], 0
mov dword [esp + 8], 0x10000
mov dword [esp + 4], 0
lea eax, [ebp - 0x201c4]
mov dword [esp], eax
call sym._memset
mov dword [esp + 8], 0x10000
mov dword [esp + 4], 0
lea eax, [ebp - 0x101c4]
mov dword [esp], eax
call sym._memset
lea eax, [server.sin_zero]
mov dword [esp + 4], eax
mov dword [esp], 0x202
mov eax, dword [sym.imp.WS2_32.dll_WSAStartup]
call eax
sub esp, 8
test eax, eax
setne al
test al, al
je 0x4015ec
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x40
mov dword [esp + 0xc], eax
mov dword [esp + 8], 0x13
mov dword [esp + 4], 1
mov dword [esp], str.WSAStartup_failed._n
call sym._fwrite
mov eax, 1
jmp 0x401865
mov dword [esp + 8], 6
mov dword [esp + 4], 1
mov dword [esp], 2
mov eax, dword [sym.imp.WS2_32.dll_socket]
call eax
sub esp, 0xc
mov dword [ebp - 0x18], eax
cmp dword [ebp - 0x18], 0xffffffff
jne 0x40164f
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x40
mov dword [esp + 0xc], eax
mov dword [esp + 8], 0x18
mov dword [esp + 4], 1
mov dword [esp], str.socket_creation_failed._n
call sym._fwrite
mov eax, dword [sym.imp.WS2_32.dll_WSACleanup]
call eax
mov eax, 1
jmp 0x401865
mov word [ebp - 0x1c4], 2
mov dword [esp], str.www.dream_pro.info
mov eax, dword [sym.imp.WS2_32.dll_inet_addr]
call eax
sub esp, 4
mov dword [ebp - 0x1c0], eax
mov eax, dword [ebp - 0x1c0]
cmp eax, 0xffffffff
jne 0x40169e
mov dword [esp], str.www.dream_pro.info
mov eax, dword [sym.imp.WS2_32.dll_gethostbyname]
call eax
sub esp, 4
mov dword [ebp - 0x1c], eax
mov eax, dword [ebp - 0x1c]
mov eax, dword [eax + 0xc]
mov eax, dword [eax]
mov eax, dword [eax]
mov dword [ebp - 0x1c0], eax
mov dword [esp], 0x50
mov eax, dword [sym.imp.WS2_32.dll_htons]
call eax
sub esp, 4
mov word [ebp - 0x1c2], ax
mov dword [esp + 8], 0x10
lea eax, [ebp - 0x1c4]
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x18]
mov dword [esp], eax
mov eax, dword [sym.imp.WS2_32.dll_connect]
call eax
sub esp, 0xc
cmp eax, 0xffffffff
sete al
test al, al
je 0x401726
mov dword [esp], str.connect_failed
call sym._perror
mov eax, dword [sym.imp.WS2_32.dll_WSAGetLastError]
call eax
mov dword [esp + 4], eax
mov dword [esp], 0x4df063
call sym._printf
mov eax, dword [ebp - 0x18]
mov dword [esp], eax
mov eax, dword [sym.imp.WS2_32.dll_closesocket]
call eax
sub esp, 4
mov eax, dword [sym.imp.WS2_32.dll_WSACleanup]
call eax
mov eax, 1
jmp 0x401865
mov eax, dword [ebp + 8]
mov dword [esp + 0xc], eax
mov dword [esp + 8], str.GET__lavalse_LR2IR_2_getrankingxml.cgi_songmd5_sid1_HTTP_1.0_r_nHost:_www.dream_pro.info_r_nConnection:_close_r_n_r_n
mov dword [esp + 4], 0x10000
lea eax, [ebp - 0x101c4]
mov dword [esp], eax
call dbg.snprintf
lea eax, [ebp - 0x101c4]
mov dword [esp], eax
call sym._strlen
mov dword [esp + 0xc], 0
mov dword [esp + 8], eax
lea eax, [ebp - 0x101c4]
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x18]
mov dword [esp], eax
mov eax, dword [sym.imp.WS2_32.dll_send]
call eax
sub esp, 0x10
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0x10000
lea eax, [ebp - 0x201c4]
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x18]
mov dword [esp], eax
mov eax, dword [sym.imp.WS2_32.dll_recv]
call eax
sub esp, 0x10
mov dword [ebp - 0x20], eax
cmp dword [ebp - 0x20], 0
setg al
test al, al
je 0x401849
cmp dword [ebp - 0xc], 0
jne 0x401820
mov dword [esp + 4], 0x23
lea eax, [ebp - 0x201c4]
mov dword [esp], eax
call sym._strchr
mov dword [ebp - 0x24], eax
cmp dword [ebp - 0x24], 0
je 0x40177f
mov dword [ebp - 0xc], 1
mov eax, dword [ebp - 0x20]
lea edx, [ebp - 0x201c4]
add eax, edx
sub eax, dword [ebp - 0x24]
sub eax, 1
mov ecx, eax
mov eax, dword [ebp - 0x24]
lea edx, [eax + 1]
mov eax, dword [ebp + 0xc]
mov dword [esp + 0xc], eax
mov dword [esp + 8], ecx
mov dword [esp + 4], 1
mov dword [esp], edx
call sym._fwrite
jmp 0x40177f
mov eax, dword [ebp - 0x20]
mov edx, dword [ebp + 0xc]
mov dword [esp + 0xc], edx
mov dword [esp + 8], eax
mov dword [esp + 4], 1
lea eax, [ebp - 0x201c4]
mov dword [esp], eax
call sym._fwrite
jmp 0x40177f
mov eax, dword [ebp - 0x18]
mov dword [esp], eax
mov eax, dword [sym.imp.WS2_32.dll_closesocket]
call eax
sub esp, 4
mov eax, dword [sym.imp.WS2_32.dll_WSACleanup]
call eax
mov eax, 0
leave
ret