Function at 0x40f530
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
Send data
Send data on socket
Send http request
Send http request with host header
Write file on windows

Disassembly:
push rbp
sub rsp, 0xb00
mov rbp, rsp
mov qword [rbp + 0x60], 0
mov qword [rbp + 0x68], 0
mov qword [rbp + 0x70], 0
mov qword [rbp + 0x78], 0
mov qword [rbp + 0x80], 0
mov qword [rbp + 0x88], 0
mov qword [rbp + 0x948], 0
mov qword [rbp + 0x940], 0
mov qword [rbp + 0x938], 0
mov qword [rbp + 0x930], 0
mov qword [rbp + 0x928], 0
mov qword [rbp + 0xb10], rcx
mov qword [rbp + 0xb18], rdx
mov qword [rbp + 0xb20], r8
mov rcx, qword [rbp + 0xb18]
call fcn.00409310
mov rcx, qword [rbp + 0xb20]
call fcn.00409310
nop
mov byte [rbp + 0xaff], 0
lea rcx, [rbp + 0x940]
mov rdx, qword [rbp + 0xb18]
call fcn.00409710
lea rcx, [rbp + 0x88]
lea rdx, [0x0042be3e]
call fcn.0040a710
mov rcx, qword [rbp + 0x88]
mov rdx, qword [rbp + 0x940]
mov r8d, 1
call fcn.0040abf0
lea rcx, [rbp + 0x938]
mov rdx, qword [rbp + 0x940]
mov r8d, 1
mov r9d, eax
sub r9d, 1
call fcn.0040ab10
lea rcx, [rbp + 0x80]
lea rdx, [0x0042be3e]
call fcn.0040a710
mov rcx, qword [rbp + 0x80]
mov rdx, qword [rbp + 0x940]
mov r8d, 1
call fcn.0040abf0
mov dword [rbp + 0xa8], eax
mov dword [rbp + 0xac], 0
cmp qword [rbp + 0x940], 0
je 0x40f692
mov rax, qword [rbp + 0x940]
mov eax, dword [rax - 4]
mov dword [rbp + 0xac], eax
lea rcx, [rbp + 0x78]
lea rdx, [0x0042be3e]
call fcn.0040a710
mov rcx, qword [rbp + 0x78]
mov rdx, qword [rbp + 0x940]
mov r8d, 1
call fcn.0040abf0
lea rcx, [rbp + 0x930]
mov rdx, qword [rbp + 0x940]
mov r8d, dword [rbp + 0xa8]
mov r9d, dword [rbp + 0xac]
sub r9d, eax
add r9d, 1
call fcn.0040ab10
mov cx, 0x101
lea rdx, [rbp + 0x960]
call sub.wsock32.dll_WSAStartup
mov ecx, 2
mov edx, 1
mov r8d, 6
call sub.wsock32.dll_socket
mov rcx, qword [rbp + 0xb10]
mov qword [rcx + 0x38], rax
mov rcx, qword [rbp + 0x938]
call fcn.0040f2c0
test al, al
jne 0x40f745
lea rcx, [rbp + 0x70]
mov rdx, qword [rbp + 0x938]
xor r8, r8
call fcn.0040a350
lea rcx, [rbp + 0x948]
mov rdx, qword [rbp + 0x70]
call fcn.0040f3a0
jmp 0x40f758
lea rcx, [rbp + 0x948]
mov rdx, qword [rbp + 0x938]
call fcn.00409710
mov word [rbp + 0x950], 2
movzx rcx, word [0x00434236]
call sub.wsock32.dll_htons
mov word [rbp + 0x952], ax
lea rcx, [rbp + 0x68]
mov rdx, qword [rbp + 0x948]
xor r8, r8
call fcn.0040a350
mov rcx, qword [rbp + 0x68]
call fcn.0040a160
mov rcx, rax
call sub.wsock32.dll_inet_addr
mov dword [rbp + 0x954], eax
mov rax, qword [rbp + 0xb10]
mov rcx, qword [rax + 0x38]
lea rdx, [rbp + 0x950]
mov r8d, 0x10
call sub.wsock32.dll_connect
cmp eax, 0xffffffff
je 0x40fb13
lea rcx, [rbp + 0x60]
mov edx, 0xa
lea r8, [0x0040fbf4]
mov r9, qword [rbp + 0x930]
lea rax, [0x0040fc0c]
mov qword [rsp + 0x20], rax
mov rax, qword [0x00434210]
mov qword [rsp + 0x28], rax
lea rax, [0x0040fcac]
mov qword [rsp + 0x30], rax
mov rax, qword [rbp + 0x938]
mov qword [rsp + 0x38], rax
lea rax, [0x0040fccc]
mov qword [rsp + 0x40], rax
mov rax, qword [rbp + 0x938]
mov qword [rsp + 0x48], rax
mov rax, qword [rbp + 0x930]
mov qword [rsp + 0x50], rax
lea rax, [0x0040fd48]
mov qword [rsp + 0x58], rax
call fcn.0040aa20
lea rcx, [rbp + 0x928]
mov rdx, qword [rbp + 0x60]
xor r8, r8
call fcn.0040a350
lea rcx, [rbp + 0x112]
mov edx, 0x802
xor r8, r8
call fcn.00405c10
lea rcx, [rbp + 0x928]
call fcn.00409940
mov qword [rbp + 0x98], rax
mov dword [rbp + 0xa4], 0
cmp qword [rbp + 0x928], 0
je 0x40f89f
mov rax, qword [rbp + 0x928]
mov eax, dword [rax - 4]
mov dword [rbp + 0xa4], eax
mov rax, qword [rbp + 0xb10]
mov rcx, qword [rax + 0x38]
mov rdx, qword [rbp + 0x98]
mov r8d, dword [rbp + 0xa4]
xor r9, r9
call sub.wsock32.dll_send
cmp eax, 0xffffffff
je 0x40fb13
lea rcx, [rbp + 0x112]
mov edx, 0x802
xor r8, r8
call fcn.00405c10
mov rax, qword [rbp + 0xb10]
mov rcx, qword [rax + 0x38]
lea rdx, [rbp + 0x112]
mov r8d, 0x28
xor r9, r9
call sub.wsock32.dll_recv
mov dword [rbp + 0x920], eax
mov dword [rbp + 0x924], 1
mov rax, qword [rbp + 0xb10]
mov rcx, qword [rax + 0x38]
lea rdx, [rbp + 0xb3]
mov r8d, 1
xor r9, r9
call sub.wsock32.dll_recv
mov rax, qword [rbp + 0xb10]
mov rcx, qword [rax + 0x38]
lea rdx, [rbp + 0xb2]
mov r8d, 1
xor r9, r9
call sub.wsock32.dll_recv
mov rax, qword [rbp + 0xb10]
mov rcx, qword [rax + 0x38]
lea rdx, [rbp + 0xb1]
mov r8d, 1
xor r9, r9
call sub.wsock32.dll_recv
cmp byte [rbp + 0xb3], 0x50
jne 0x40f994
cmp byte [rbp + 0xb2], 0x4e
jne 0x40f994
cmp byte [rbp + 0xb1], 0x47
jne 0x40f994
mov dword [rbp + 0x918], 0
jmp 0x40f9f9
cmp byte [rbp + 0xb3], 0x4e
jne 0x40f9bb
cmp byte [rbp + 0xb2], 0x47
jne 0x40f9bb
cmp byte [rbp + 0xb1], 0xd
jne 0x40f9bb
mov dword [rbp + 0x918], 0xffffffff
jmp 0x40f9f9
cmp byte [rbp + 0xb3], 0x47
jne 0x40f9e2
cmp byte [rbp + 0xb2], 0xd
jne 0x40f9e2
cmp byte [rbp + 0xb1], 0xa
jne 0x40f9e2
mov dword [rbp + 0x918], 0xfffffffe
jmp 0x40f9f9
add dword [rbp + 0x924], 1
cmp dword [rbp + 0x924], 0x12d
jne 0x40f90d
nop
lea rcx, [rbp + 0xb4]
mov edx, 0x5e
xor r8, r8
call fcn.00405c10
mov rax, qword [rbp + 0xb10]
mov rcx, qword [rax + 0x38]
lea rdx, [rbp + 0xb4]
mov r8d, dword [rbp + 0x918]
add r8d, 0x5e
xor r9, r9
call sub.wsock32.dll_recv
mov dword [rbp + 0x920], eax
mov rcx, qword [rbp + 0xb20]
call fcn.0040a4d0
mov rcx, rax
mov edx, 0x40000000
mov r8d, 2
xor r9, r9
mov dword [rsp + 0x20], 2
mov dword [rsp + 0x28], 0
mov qword [rsp + 0x30], 0
call sub.kernel32.dll_CreateFileW
mov rcx, qword [rbp + 0xb10]
mov qword [rcx + 0x30], rax
mov rax, qword [rbp + 0xb10]
cmp qword [rax + 0x30], 0xffffffffffffffff
je 0x40fb13
lea rcx, [rbp + 0x112]
mov edx, 0x802
xor r8, r8
call fcn.00405c10
mov rax, qword [rbp + 0xb10]
mov rcx, qword [rax + 0x38]
lea rdx, [rbp + 0x112]
mov r8d, 0x802
xor r9, r9
call sub.wsock32.dll_recv
mov dword [rbp + 0x920], eax
mov rax, qword [rbp + 0xb10]
mov rcx, qword [rax + 0x30]
lea rdx, [rbp + 0x112]
mov r8d, dword [rbp + 0x920]
lea r9, [rbp + 0x914]
mov qword [rsp + 0x20], 0
call sub.kernel32.dll_WriteFile
cmp dword [rbp + 0x920], 0xffffffff
je 0x40fb0b
cmp dword [rbp + 0x920], 0
jne 0x40fa91
mov byte [rbp + 0xaff], 1
nop
lea rcx, [rbp + 0x60]
call fcn.00409180
lea rcx, [rbp + 0x68]
mov edx, 2
call fcn.00409290
lea rcx, [rbp + 0x78]
mov edx, 3
call fcn.00409260
lea rcx, [rbp + 0x928]
call fcn.004091d0
lea rcx, [rbp + 0x930]
mov edx, 4
call fcn.00409260
lea rcx, [rbp + 0xb18]
mov edx, 2
call fcn.00409260
movzx rax, byte [rbp + 0xaff]
lea rsp, [rbp + 0xb00]
pop rbp
ret