Function at 0x4c88c0
Capabilities:
Connect socket
Get socket status
Resolve dns

Disassembly:
push rbp
sub rsp, 0x4b0
lea rbp, [rsp + 0x80]
mov qword [rbp + 0x440], rcx
mov rax, qword [rbp + 0x440]
add rax, 0x2b8
mov r9d, 0xa44
lea r8, str.setup_stratum_socket
lea rdx, str..._.._cgminer_4.9.1_util.c
mov rcx, rax
call dbg._mutex_lock
mov rax, qword [rbp + 0x440]
mov byte [rax + 0x281], 0
mov rax, qword [rbp + 0x440]
mov rax, qword [rax + 0x228]
test rax, rax
je 0x4c893b
mov rax, qword [rbp + 0x440]
mov rax, qword [rax + 0x228]
mov rcx, rax
mov rax, qword [sym.imp.WSOCK32.dll_closesocket]
call rax
mov rax, qword [rbp + 0x440]
mov qword [rax + 0x228], 0
mov rax, qword [rbp + 0x440]
add rax, 0x2b8
mov r9d, 0xa49
lea r8, str.setup_stratum_socket
lea rdx, str..._.._cgminer_4.9.1_util.c
mov rcx, rax
call dbg._mutex_unlock
lea rax, [rbp + 0x3d0]
mov r8d, 0x30
mov edx, 0
mov rcx, rax
call sym.memset
mov dword [rbp + 0x3d4], 0
mov dword [rbp + 0x3d8], 1
mov rax, qword [rbp + 0x440]
mov rax, qword [rax + 0xe0]
test rax, rax
jne 0x4c8a24
mov rax, qword [0x00514bc0]
mov rax, qword [rax]
test rax, rax
je 0x4c8a24
mov rax, qword [0x00514bc0]
mov rdx, qword [rax]
mov rax, qword [rbp + 0x440]
mov qword [rax + 0xe0], rdx
mov rax, qword [rbp + 0x440]
lea rcx, [rax + 0x250]
mov rax, qword [rbp + 0x440]
lea rdx, [rax + 0x248]
mov rax, qword [rbp + 0x440]
mov rax, qword [rax + 0xe0]
mov r8, rcx
mov rcx, rax
call dbg.extract_sockaddr
mov rax, qword [rbp + 0x440]
mov dword [rax + 0xd8], 5
mov rax, qword [rbp + 0x440]
mov rax, qword [rax + 0xe0]
test rax, rax
je 0x4c8a63
mov rax, qword [rbp + 0x440]
mov rax, qword [rax + 0x248]
mov qword [rbp + 0x420], rax
mov rax, qword [rbp + 0x440]
mov rax, qword [rax + 0x250]
mov qword [rbp + 0x418], rax
jmp 0x4c8a8d
mov rax, qword [rbp + 0x440]
mov rax, qword [rax + 0x240]
mov qword [rbp + 0x420], rax
mov rax, qword [rbp + 0x440]
mov rax, qword [rax + 0x220]
mov qword [rbp + 0x418], rax
lea r8, [rbp + 0x400]
lea rcx, [rbp + 0x3d0]
mov rdx, qword [rbp + 0x418]
mov rax, qword [rbp + 0x420]
mov r9, r8
mov r8, rcx
mov rcx, rax
mov rax, qword [sym.imp.WS2_32.dll_getaddrinfo]
call rax
test eax, eax
je 0x4c8bd9
mov rax, qword [rbp + 0x440]
movzx eax, byte [rax + 0x63]
xor eax, 1
test al, al
je 0x4c8b5a
mov rax, qword [0x00514e80]
movzx eax, byte [rax]
test al, al
jne 0x4c8b02
mov rax, qword [0x00514ac0]
movzx eax, byte [rax]
test al, al
jne 0x4c8b02
mov rax, qword [0x00514ab0]
mov eax, dword [rax]
test eax, eax
jle 0x4c8b4d
mov rcx, qword [rbp + 0x420]
lea rax, [rbp + 0x1b0]
mov rdx, qword [rbp + 0x418]
mov qword [rsp + 0x20], rdx
mov r9, rcx
lea r8, str.Failed_to_resolve___wrong_URL___s:_s
mov edx, 0x200
mov rcx, rax
call dbg.snprintf
lea rax, [rbp + 0x1b0]
mov r8d, 0
mov rdx, rax
mov ecx, 1
call dbg._applog
mov rax, qword [rbp + 0x440]
mov byte [rax + 0x63], 1
jmp 0x4c8bcf
mov rax, qword [0x00514e80]
movzx eax, byte [rax]
test al, al
jne 0x4c8b84
mov rax, qword [0x00514ac0]
movzx eax, byte [rax]
test al, al
jne 0x4c8b84
mov rax, qword [0x00514ab0]
mov eax, dword [rax]
cmp eax, 2
jle 0x4c8bcf
mov rcx, qword [rbp + 0x420]
lea rax, [rbp + 0x1b0]
mov rdx, qword [rbp + 0x418]
mov qword [rsp + 0x20], rdx
mov r9, rcx
lea r8, str.Failed_to_getaddrinfo_for__s:_s
mov edx, 0x200
mov rcx, rax
call dbg.snprintf
lea rax, [rbp + 0x1b0]
mov r8d, 0
mov rdx, rax
mov ecx, 3
call dbg._applog
mov eax, 0
jmp 0x4c93fb
mov rax, qword [rbp + 0x400]
mov qword [rbp + 0x428], rax
jmp 0x4c9088
mov rax, qword [rbp + 0x428]
mov ecx, dword [rax + 0xc]
mov rax, qword [rbp + 0x428]
mov edx, dword [rax + 8]
mov rax, qword [rbp + 0x428]
mov eax, dword [rax + 4]
mov r8d, ecx
mov ecx, eax
mov rax, qword [sym.imp.WSOCK32.dll_socket]
call rax
mov dword [rbp + 0x414], eax
cmp dword [rbp + 0x414], 0xffffffff
jne 0x4c8ca1
mov rax, qword [0x005149e0]
movzx eax, byte [rax]
test al, al
je 0x4c906f
mov rax, qword [0x00514e80]
movzx eax, byte [rax]
test al, al
jne 0x4c8c67
mov rax, qword [0x00514ac0]
movzx eax, byte [rax]
test al, al
jne 0x4c8c67
mov rax, qword [0x00514ab0]
mov eax, dword [rax]
cmp eax, 3
jle 0x4c906f
lea rax, [rbp + 0x1b0]
lea r8, str.Failed_socket
mov edx, 0x200
mov rcx, rax
call dbg.snprintf
lea rax, [rbp + 0x1b0]
mov r8d, 0
mov rdx, rax
mov ecx, 4
call dbg._applog
jmp 0x4c906f
mov eax, dword [rbp + 0x414]
cdqe
mov rcx, rax
call dbg.noblock_socket
mov rax, qword [rbp + 0x428]
mov rax, qword [rax + 0x10]
mov ecx, eax
mov rax, qword [rbp + 0x428]
mov rdx, qword [rax + 0x20]
mov eax, dword [rbp + 0x414]
cdqe
mov r8d, ecx
mov rcx, rax
mov rax, qword [sym.imp.WSOCK32.dll_connect]
call rax
cmp eax, 0xffffffff
jne 0x4c8fff
mov dword [rbp + 0x3c8], 1
mov dword [rbp + 0x3cc], 0
call dbg.sock_connecting
xor eax, 1
test al, al
je 0x4c8d9b
mov eax, dword [rbp + 0x414]
cdqe
mov rcx, rax
mov rax, qword [sym.imp.WSOCK32.dll_closesocket]
call rax
mov rax, qword [0x005149e0]
movzx eax, byte [rax]
test al, al
je 0x4c9072
mov rax, qword [0x00514e80]
movzx eax, byte [rax]
test al, al
jne 0x4c8d61
mov rax, qword [0x00514ac0]
movzx eax, byte [rax]
test al, al
jne 0x4c8d61
mov rax, qword [0x00514ab0]
mov eax, dword [rax]
cmp eax, 3
jle 0x4c9072
lea rax, [rbp + 0x1b0]
lea r8, str.Failed_sock_connect
mov edx, 0x200
mov rcx, rax
call dbg.snprintf
lea rax, [rbp + 0x1b0]
mov r8d, 0
mov rdx, rax
mov ecx, 4
call dbg._applog
jmp 0x4c9072
nop
mov dword [rbp + 0x1b0], 0
mov dword [rbp + 0x410], 0
jmp 0x4c8dd4
mov eax, dword [rbp + 0x410]
mov rdx, qword [rbp + rax*8 + 0x1b8]
mov eax, dword [rbp + 0x414]
cdqe
cmp rdx, rax
je 0x4c8de4
add dword [rbp + 0x410], 1
mov eax, dword [rbp + 0x1b0]
cmp dword [rbp + 0x410], eax
jb 0x4c8db2
jmp 0x4c8de5
nop
mov eax, dword [rbp + 0x1b0]
cmp dword [rbp + 0x410], eax
jne 0x4c8e24
mov eax, dword [rbp + 0x1b0]
cmp eax, 0x3f
ja 0x4c8e24
mov eax, dword [rbp + 0x414]
movsxd rdx, eax
mov eax, dword [rbp + 0x410]
mov qword [rbp + rax*8 + 0x1b8], rdx
mov eax, dword [rbp + 0x1b0]
add eax, 1
mov dword [rbp + 0x1b0], eax
mov eax, dword [rbp + 0x414]
add eax, 1
lea rcx, [rbp + 0x1b0]
lea rdx, [rbp + 0x3c8]
mov qword [rsp + 0x20], rdx
mov r9d, 0
mov r8, rcx
mov edx, 0
mov ecx, eax
mov rax, qword [sym.imp.WSOCK32.dll_select]
call rax
mov dword [rbp + 0x40c], eax
cmp dword [rbp + 0x40c], 0
jle 0x4c8f63
mov eax, dword [rbp + 0x414]
cdqe
lea rdx, [rbp + 0x1b0]
mov rcx, rax
call sym.__WSAFDIsSet
test eax, eax
je 0x4c8f63
mov dword [rbp + 0x3c4], 4
mov eax, dword [rbp + 0x414]
cdqe
lea rcx, [rbp + 0x3c0]
lea rdx, [rbp + 0x3c4]
mov qword [rsp + 0x20], rdx
mov r9, rcx
mov r8d, 0x1007
mov edx, 0xffff
mov rcx, rax
mov rax, qword [sym.imp.WSOCK32.dll_getsockopt]
call rax
mov dword [rbp + 0x408], eax
cmp dword [rbp + 0x408], 0
jne 0x4c8f63
mov eax, dword [rbp + 0x3c0]
test eax, eax
jne 0x4c8f63
mov rax, qword [0x005149e0]
movzx eax, byte [rax]
test al, al
je 0x4c8f4e
mov rax, qword [0x00514e80]
movzx eax, byte [rax]
test al, al
jne 0x4c8f1f
mov rax, qword [0x00514ac0]
movzx eax, byte [rax]
test al, al
jne 0x4c8f1f
mov rax, qword [0x00514ab0]
mov eax, dword [rax]
cmp eax, 3
jle 0x4c8f4e
lea rax, [hints.ai_addrlen]
lea r8, str.Succeeded_delayed_connect
mov edx, 0x200
mov rcx, rax
call dbg.snprintf
lea rax, [hints.ai_addrlen]
mov r8d, 0
mov rdx, rax
mov ecx, 4
call dbg._applog
mov eax, dword [rbp + 0x414]
cdqe
mov rcx, rax
call dbg.block_socket
jmp 0x4c9096
cmp dword [rbp + 0x40c], 0
jns 0x4c8f7a
call dbg.interrupted
test al, al
je 0x4c8f7a
jmp 0x4c8d9c
mov eax, dword [rbp + 0x414]
cdqe
mov rcx, rax
mov rax, qword [sym.imp.WSOCK32.dll_closesocket]
call rax
mov rax, qword [0x005149e0]
movzx eax, byte [rax]
test al, al
je 0x4c9075
mov rax, qword [0x00514e80]
movzx eax, byte [rax]
test al, al
jne 0x4c8fce
mov rax, qword [0x00514ac0]
movzx eax, byte [rax]
test al, al
jne 0x4c8fce
mov rax, qword [0x00514ab0]
mov eax, dword [rax]
cmp eax, 3
jle 0x4c9075
lea rax, [hints.ai_addrlen]
lea r8, str.Select_timeout_failed_connect
mov edx, 0x200
mov rcx, rax
call dbg.snprintf
lea rax, [hints.ai_addrlen]
mov r8d, 0
mov rdx, rax
mov ecx, 4
call dbg._applog
jmp 0x4c9075
mov rax, qword [0x00514e80]
movzx eax, byte [rax]
test al, al
jne 0x4c9028
mov rax, qword [0x00514ac0]
movzx eax, byte [rax]
test al, al
jne 0x4c9028
mov rax, qword [0x00514ab0]
mov eax, dword [rax]
test eax, eax
jle 0x4c905d
lea rax, [rbp + 0x1b0]
lea r8, str.Succeeded_immediate_connect
mov edx, 0x200
mov rcx, rax
call dbg.snprintf
lea rax, [rbp + 0x1b0]
mov r8d, 0
mov rdx, rax
mov ecx, 1
call dbg._applog
mov eax, dword [rbp + 0x414]
cdqe
mov rcx, rax
call dbg.block_socket
jmp 0x4c9096
nop
jmp 0x4c9076
nop
jmp 0x4c9076
nop
mov rax, qword [rbp + 0x428]
mov rax, qword [rax + 0x28]
mov qword [rbp + 0x428], rax
cmp qword [rbp + 0x428], 0
jne 0x4c8bec
cmp qword [rbp + 0x428], 0
jne 0x4c9136
mov rax, qword [0x00514e80]
movzx eax, byte [rax]
test al, al
jne 0x4c90ce
mov rax, qword [0x00514ac0]
movzx eax, byte [rax]
test al, al
jne 0x4c90ce
mov rax, qword [0x00514ab0]
mov eax, dword [rax]
cmp eax, 2
jle 0x4c9119
mov rcx, qword [rbp + 0x420]
lea rax, [rbp + 0x1b0]
mov rdx, qword [rbp + 0x418]
mov qword [rsp + 0x20], rdx
mov r9, rcx
lea r8, str.Failed_to_connect_to_stratum_on__s:_s
mov edx, 0x200
mov rcx, rax
call dbg.snprintf
lea rax, [rbp + 0x1b0]
mov r8d, 0
mov rdx, rax
mov ecx, 3
call dbg._applog
mov rax, qword [rbp + 0x400]
mov rcx, rax
mov rax, qword [sym.imp.WS2_32.dll_freeaddrinfo]
call rax
mov eax, 0
jmp 0x4c93fb
mov rax, qword [rbp + 0x400]
mov rcx, rax
mov rax, qword [sym.imp.WS2_32.dll_freeaddrinfo]
call rax
mov rax, qword [rbp + 0x440]
mov rax, qword [rax + 0xe0]
test rax, rax
je 0x4c9309
mov rax, qword [rbp + 0x440]
mov eax, dword [rax + 0xd8]
cmp eax, 7
ja case.0x4c9196.2
mov eax, eax
lea rdx, [rax*4]
lea rax, [0x0050fcec]
mov eax, dword [rdx + rax]
cdqe
lea rdx, [0x0050fcec]
add rax, rdx
jmp rax
mov eax, dword [rbp + 0x414]
mov r8d, 1
mov edx, eax
mov rcx, qword [rbp + 0x440]
call dbg.http_negotiate
xor eax, 1
test al, al
je 0x4c930c
mov eax, 0
jmp 0x4c93fb
mov eax, dword [rbp + 0x414]
mov r8d, 0
mov edx, eax
mov rcx, qword [rbp + 0x440]
call dbg.http_negotiate
xor eax, 1
test al, al
je 0x4c930f
mov eax, 0
jmp 0x4c93fb
mov eax, dword [rbp + 0x414]
mov edx, eax
mov rcx, qword [rbp + 0x440]
call dbg.socks5_negotiate
xor eax, 1
test al, al
je 0x4c9312
mov eax, 0
jmp 0x4c93fb
mov eax, dword [rbp + 0x414]
mov r8d, 0
mov edx, eax
mov rcx, qword [rbp + 0x440]
call dbg.socks4_negotiate
xor eax, 1
test al, al
je 0x4c9315
mov eax, 0
jmp 0x4c93fb
mov eax, dword [rbp + 0x414]
mov r8d, 1
mov edx, eax
mov rcx, qword [rbp + 0x440]
call dbg.socks4_negotiate
xor eax, 1
test al, al
je 0x4c9318
mov eax, 0
jmp 0x4c93fb
mov rax, qword [0x00514e80]
movzx eax, byte [rax]
test al, al
jne 0x4c92a6
mov rax, qword [0x00514ac0]
movzx eax, byte [rax]
test al, al
jne 0x4c92a6
mov rax, qword [0x00514ab0]
mov eax, dword [rax]
test eax, eax
jle 0x4c92ff
mov rax, qword [rbp + 0x440]
mov rdx, qword [rax + 0x250]
mov rax, qword [rbp + 0x440]
mov rcx, qword [rax + 0x248]
lea rax, [rbp + 0x1b0]
mov qword [rsp + 0x20], rdx
mov r9, rcx
lea r8, str.Unsupported_proxy_type_for__s:_s
mov edx, 0x200
mov rcx, rax
call dbg.snprintf
lea rax, [rbp + 0x1b0]
mov r8d, 0
mov rdx, rax
mov ecx, 1
call dbg._applog
mov eax, 0
jmp 0x4c93fb
nop
jmp 0x4c9319
nop
jmp 0x4c9319
nop
jmp 0x4c9319
nop
jmp 0x4c9319
nop
jmp 0x4c9319
nop
mov rax, qword [rbp + 0x440]
mov rax, qword [rax + 0x230]
test rax, rax
jne 0x4c93cf
mov edx, 1
mov ecx, 0x2000
call sym.calloc
mov rdx, rax
mov rax, qword [rbp + 0x440]
mov qword [rax + 0x230], rdx
mov rax, qword [rbp + 0x440]
mov rax, qword [rax + 0x230]
test rax, rax
jne 0x4c93bd
lea rax, [rbp + 0x1b0]
mov dword [rsp + 0x28], 0xabf
lea rdx, str.setup_stratum_socket
mov qword [rsp + 0x20], rdx
lea r9, str..._.._cgminer_4.9.1_util.c
lea r8, str.Failed_to_calloc_pool_sockbuf_in__s__s__:_d
mov edx, 0x200
mov rcx, rax
call dbg.snprintf
lea rax, [rbp + 0x1b0]
mov r8d, 1
mov rdx, rax
mov ecx, 0
call dbg._applog
mov ecx, 1
call dbg._quit
mov rax, qword [rbp + 0x440]
mov qword [rax + 0x238], 0x2000
mov eax, dword [rbp + 0x414]
movsxd rdx, eax
mov rax, qword [rbp + 0x440]
mov qword [rax + 0x228], rdx
mov eax, dword [rbp + 0x414]
cdqe
mov rcx, rax
call dbg.keep_sockalive
mov eax, 1
add rsp, 0x4b0
pop rbp
ret