Function at 0x407a30
Capabilities:
Set socket configuration

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x54b085
mov eax, dword fs:[0]
push eax
sub esp, 0x398
mov eax, dword [0x5a5014]
xor eax, ebp
mov dword [ebp - 0x10], eax
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov dword [ebp - 0x340], ecx
mov dword [ebp - 0x354], 0
mov dword [ebp - 0x34c], 0
mov byte [ebp - 0x342], 0
mov eax, dword [ebp - 0x340]
mov ecx, dword [ebp + 8]
cmp ecx, dword [eax + 0x38]
jne 0x407aa5
mov edx, dword [ebp - 0x340]
mov eax, dword [edx + 0x3c]
mov dword [ebp - 0x348], eax
mov dword [ebp - 0x364], 2
jmp 0x407abe
mov ecx, dword [ebp - 0x340]
mov edx, dword [ecx + 0x44]
mov dword [ebp - 0x348], edx
mov dword [ebp - 0x364], 0x17
cmp dword [ebp + 0x14], 0
je 0x407b19
mov eax, dword [ebp + 0x14]
push eax
push str.TCPProxy::onAcceptComplete___failed__err_d
call fcn.004557e0
push eax
call fcn.00456d70
add esp, 0xc
mov ecx, dword [ebp - 0x348]
push ecx
call dword [sym.imp.WS2_32.dll_closesocket]
mov edx, dword [ebp - 0x364]
push edx
mov ecx, dword [ebp - 0x340]
call fcn.00406390
movzx eax, al
test eax, eax
jne 0x407b14
push str.TCPProxy::startAccept___failed
call fcn.004557e0
push eax
call fcn.00456d70
add esp, 8
jmp 0x4082d0
lea ecx, [ebp - 0x390]
push ecx
lea edx, [ebp - 0x34c]
push edx
lea eax, [ebp - 0x39c]
push eax
lea ecx, [ebp - 0x354]
push ecx
push 0x2c
push 0x2c
push 0
push 0
mov ecx, dword [ebp + 0x10]
add ecx, 0x34
call fcn.004203d0
mov edx, dword [eax + 4]
push edx
mov eax, dword [ebp - 0x340]
mov ecx, dword [eax + 0x34]
call ecx
mov dl, byte [0x57d9e0]
mov byte [ebp - 0x234], dl
push 0x103
push 0
lea eax, [ebp - 0x233]
push eax
call fcn.00505a60
add esp, 0xc
mov cl, byte [0x57d9e0]
mov byte [ebp - 0x130], cl
push 0x103
push 0
lea edx, [ebp - 0x12f]
push edx
call fcn.00505a60
add esp, 0xc
mov eax, dword [ebp - 0x354]
mov dword [ebp - 0x350], eax
mov dword [ebp - 0x360], 0x104
mov ecx, dword [ebp - 0x350]
movzx edx, word [ecx]
cmp edx, 0x17
jne 0x407bcb
mov dword [ebp - 0x368], 0x1c
jmp 0x407bd5
mov dword [ebp - 0x368], 0x10
lea eax, [ebp - 0x360]
push eax
lea ecx, [ebp - 0x234]
push ecx
push 0
mov edx, dword [ebp - 0x368]
push edx
mov eax, dword [ebp - 0x350]
push eax
call dword [sym.imp.WS2_32.dll_WSAAddressToStringA]
mov ecx, dword [ebp - 0x34c]
mov dword [ebp - 0x350], ecx
mov dword [ebp - 0x360], 0x104
mov edx, dword [ebp - 0x350]
movzx eax, word [edx]
cmp eax, 0x17
jne 0x407c29
mov dword [ebp - 0x36c], 0x1c
jmp 0x407c33
mov dword [ebp - 0x36c], 0x10
lea ecx, [ebp - 0x360]
push ecx
lea edx, [ebp - 0x130]
push edx
push 0
mov eax, dword [ebp - 0x36c]
push eax
mov ecx, dword [ebp - 0x350]
push ecx
call dword [sym.imp.WS2_32.dll_WSAAddressToStringA]
lea edx, [ebp - 0x130]
push edx
lea eax, [ebp - 0x234]
push eax
mov ecx, dword [ebp - 0x348]
push ecx
push str.TCPProxy::onAcceptComplete___accepted_socket__d___s_____s
call fcn.004557e0
push eax
call fcn.00456d70
add esp, 0x14
mov edx, dword [ebp - 0x348]
push edx
mov ecx, dword [ebp - 0x340]
add ecx, 8
call fcn.00402c00
push 4
mov eax, dword [ebp - 0x340]
add eax, 0x38
push eax
push 0x700b
push 0xffff
mov ecx, dword [ebp - 0x348]
push ecx
call dword [sym.imp.WS2_32.dll_setsockopt]
mov dword [ebp - 0x370], 1
push 4
lea edx, [ebp - 0x370]
push edx
push 1
push 6
mov eax, dword [ebp - 0x348]
push eax
call dword [sym.imp.WS2_32.dll_setsockopt]
push 4
lea ecx, [ebp - 0x370]
push ecx
push 8
push 0xffff
mov edx, dword [ebp - 0x348]
push edx
call dword [sym.imp.WS2_32.dll_setsockopt]
mov eax, dword [ebp - 0x348]
push eax
mov ecx, dword [ebp - 0x340]
call fcn.00407990
mov ecx, dword [ebp - 0x340]
add ecx, 0xe8
push ecx
lea ecx, [ebp - 0x3a4]
call fcn.00456640
mov dword [ebp - 4], 0
push 0xf8
call fcn.004a10a5
add esp, 4
mov dword [ebp - 0x374], eax
mov byte [ebp - 4], 1
cmp dword [ebp - 0x374], 0
je 0x407d5c
mov ecx, dword [ebp - 0x374]
call fcn.00405230
mov dword [ebp - 0x378], eax
jmp 0x407d66
mov dword [ebp - 0x378], 0
mov edx, dword [ebp - 0x378]
mov dword [ebp - 0x38c], edx
mov byte [ebp - 4], 0
mov eax, dword [ebp - 0x38c]
mov dword [ebp - 0x33c], eax
mov ecx, dword [ebp - 0x33c]
mov edx, dword [ebp - 0x348]
mov dword [ecx + 8], edx
mov eax, dword [ebp - 0x354]
movzx ecx, word [eax]
cmp ecx, 2
jne 0x407db2
mov edx, dword [ebp - 0x34c]
mov ax, word [edx + 2]
mov word [ebp - 0x35c], ax
jmp 0x407dc3
mov ecx, dword [ebp - 0x34c]
mov dx, word [ecx + 2]
mov word [ebp - 0x35c], dx
mov eax, dword [ebp - 0x340]
mov ecx, dword [eax + 0x48]
add ecx, 1
mov edx, dword [eax + 0x4c]
adc edx, 0
mov eax, dword [ebp - 0x340]
mov dword [eax + 0x48], ecx
mov dword [eax + 0x4c], edx
mov ecx, dword [ebp - 0x33c]
mov edx, dword [ebp - 0x340]
mov eax, dword [edx + 0x48]
mov edx, dword [edx + 0x4c]
mov dword [ecx], eax
mov dword [ecx + 4], edx
mov eax, dword [ebp - 0x33c]
push eax
mov ecx, dword [ebp - 0x340]
add ecx, 0x24
call fcn.0041d7f0
mov ecx, dword [ebp - 0x33c]
mov dword [eax], ecx
mov edx, dword [ebp - 0x33c]
mov eax, dword [ebp - 0x354]
mov cx, word [eax]
mov word [edx + 0x45], cx
mov edx, dword [ebp - 0x33c]
mov byte [edx + 0x44], 2
mov eax, dword [ebp - 0x390]
push eax
mov ecx, dword [ebp - 0x34c]
push ecx
mov edx, dword [ebp - 0x33c]
add edx, 0x47
push edx
call fcn.00505bc0
add esp, 0xc
mov byte [ebp - 0x341], 0
mov eax, dword [ebp - 0x33c]
add eax, 0x3c
push eax
mov ecx, dword [ebp - 0x34c]
push ecx
mov edx, dword [ebp - 0x340]
mov eax, dword [edx]
mov ecx, dword [ebp - 0x340]
mov edx, dword [eax + 0xc]
call edx
movzx eax, al
test eax, eax
je 0x4080a3
mov byte [ebp - 0x341], 1
mov ecx, dword [ebp - 0x340]
cmp dword [ecx + 0x54], 0
je 0x407f19
mov edx, dword [ebp - 0x33c]
mov eax, dword [edx + 0x3c]
or eax, 2
mov ecx, dword [ebp - 0x33c]
mov dword [ecx + 0x3c], eax
mov edx, dword [ebp - 0x33c]
add edx, 0x3c
push edx
mov eax, dword [ebp - 0x33c]
mov ecx, dword [eax + 4]
push ecx
mov edx, dword [eax]
push edx
mov eax, dword [ebp - 0x340]
mov ecx, dword [eax + 0x54]
mov edx, dword [ebp - 0x340]
mov eax, dword [ecx]
mov ecx, dword [edx + 0x54]
mov edx, dword [eax + 8]
call edx
mov eax, dword [ebp - 0x33c]
mov ecx, dword [eax + 0x3c]
and ecx, 1
je 0x407ef7
mov byte [ebp - 0x341], 0
jmp 0x407f19
mov edx, dword [ebp - 0x33c]
mov eax, dword [edx + 0x3c]
and eax, 8
je 0x407f19
mov ecx, dword [ebp - 0x33c]
mov byte [ecx + 0xd5], 1
mov byte [ebp - 0x342], 1
mov edx, dword [ebp - 0x340]
cmp dword [edx + 0x94], 0
je 0x407fba
mov eax, dword [ebp - 0x33c]
mov ecx, dword [ebp - 0x340]
mov edx, dword [ecx + 0x94]
mov dword [eax + 0x80], edx
push 0x1c
mov eax, dword [ebp - 0x340]
add eax, 0x98
push eax
mov ecx, dword [ebp - 0x33c]
add ecx, 0x84
push ecx
call fcn.00505bc0
add esp, 0xc
mov edx, dword [ebp - 0x33c]
mov eax, dword [ebp - 0x340]
mov ecx, dword [eax + 0xb4]
mov dword [edx + 0xa0], ecx
mov edx, dword [ebp - 0x340]
add edx, 0xb8
push edx
mov ecx, dword [ebp - 0x33c]
add ecx, 0xa4
call fcn.00455770
mov eax, dword [ebp - 0x340]
add eax, 0xd0
push eax
mov ecx, dword [ebp - 0x33c]
add ecx, 0xbc
call fcn.00455770
mov ecx, dword [ebp - 0x33c]
cmp dword [ecx + 0x80], 1
jne 0x408089
mov dl, byte [0x57d9e0]
mov byte [ebp - 0x338], dl
push 0x103
push 0
lea eax, [ebp - 0x337]
push eax
call fcn.00505a60
add esp, 0xc
mov ecx, dword [ebp - 0x33c]
add ecx, 0x84
mov dword [ebp - 0x380], ecx
mov dword [ebp - 0x394], 0x104
mov edx, dword [ebp - 0x380]
movzx eax, word [edx]
cmp eax, 0x17
jne 0x408025
mov dword [ebp - 0x37c], 0x1c
jmp 0x40802f
mov dword [ebp - 0x37c], 0x10
lea ecx, [ebp - 0x394]
push ecx
lea edx, [ebp - 0x338]
push edx
push 0
mov eax, dword [ebp - 0x37c]
push eax
mov ecx, dword [ebp - 0x380]
push ecx
call dword [sym.imp.WS2_32.dll_WSAAddressToStringA]
lea edx, [ebp - 0x338]
push edx
push str.TCPProxy::onAcceptComplete___redirect_to_SOCKS_proxy__s
call fcn.004557e0
push eax
call fcn.00456d70
add esp, 0xc
push 0x1c
mov eax, dword [ebp - 0x33c]
add eax, 0x84
push eax
lea ecx, [ebp - 0x2c]
push ecx
call fcn.00505bc0
add esp, 0xc
jmp 0x4080a1
push 0x1c
mov edx, dword [ebp - 0x33c]
add edx, 0x63
push edx
lea eax, [ebp - 0x2c]
push eax
call fcn.00505bc0
add esp, 0xc
jmp 0x4080b6
push str.TCPProxy::onAcceptComplete_real_remote_address_not_found
call fcn.004557e0
push eax
call fcn.00456d70
add esp, 8
movzx ecx, byte [ebp - 0x341]
test ecx, ecx
je 0x40823e
mov edx, dword [ebp - 0x33c]
movzx eax, byte [edx + 0xd5]
test eax, eax
je 0x40814f
mov ecx, dword [ebp - 0x33c]
mov dword [ecx + 0x38], 4
mov edx, dword [ebp - 0x33c]
mov byte [edx + 0x24], 1
mov eax, dword [ebp - 0x33c]
mov ecx, dword [eax + 4]
push ecx
mov edx, dword [eax]
push edx
push 1
mov eax, dword [ebp - 0x33c]
push eax
mov ecx, dword [ebp - 0x340]
call fcn.004067f0
mov ecx, dword [ebp - 0x340]
cmp dword [ecx + 0x54], 0
je 0x40814a
mov edx, dword [ebp - 0x33c]
add edx, 0x3c
push edx
mov eax, dword [ebp - 0x33c]
mov ecx, dword [eax + 4]
push ecx
mov edx, dword [eax]
push edx
mov eax, dword [ebp - 0x340]
mov ecx, dword [eax + 0x54]
mov edx, dword [ebp - 0x340]
mov eax, dword [ecx]
mov ecx, dword [edx + 0x54]
mov edx, dword [eax + 0xc]
call edx
jmp 0x40823e
push 1
push 0
push 0
push 6
push 1
movzx eax, word [ebp - 0x2c]
push eax
call dword [sym.imp.WS2_32.dll_WSASocketA]
mov dword [ebp - 0x358], eax
cmp dword [ebp - 0x358], 0xffffffff
jne 0x40818b
push str.TCPProxy::onAcceptComplete_WSASocket_failed
call fcn.004557e0
push eax
call fcn.00456d70
add esp, 8
jmp 0x40823e
mov ecx, dword [ebp - 0x33c]
mov edx, dword [ebp - 0x358]
mov dword [ecx + 0x20], edx
mov eax, dword [ebp - 0x358]
push eax
mov ecx, dword [ebp - 0x340]
add ecx, 8
call fcn.00402c00
movzx ecx, al
test ecx, ecx
jne 0x4081cb
push str.TCPProxy::onAcceptComplete_registerSocket_failed
call fcn.004557e0
push eax
call fcn.00456d70
add esp, 8
jmp 0x40823e
movzx edx, word [ebp - 0x2c]
cmp edx, 0x17
jne 0x4081e0
mov dword [ebp - 0x384], 0x1c
jmp 0x4081ea
mov dword [ebp - 0x384], 0x10
mov eax, dword [ebp - 0x33c]
mov ecx, dword [eax + 4]
push ecx
mov edx, dword [eax]
push edx
mov eax, dword [ebp - 0x384]
push eax
lea ecx, [ebp - 0x2c]
push ecx
mov edx, dword [ebp - 0x358]
push edx
mov ecx, dword [ebp - 0x340]
call fcn.00406480
movzx eax, al
test eax, eax
jne 0x408230
push str.TCPProxy::onAcceptComplete_startConnect_failed
call fcn.004557e0
push eax
call fcn.00456d70
add esp, 8
jmp 0x40823e
mov byte [ebp - 0x342], 1
jmp 0x40823e
movzx ecx, byte [ebp - 0x342]
test ecx, ecx
jne 0x408292
mov edx, dword [ebp - 0x33c]
push edx
mov ecx, dword [ebp - 0x340]
add ecx, 0x24
call fcn.00420350
mov eax, dword [ebp - 0x33c]
mov dword [ebp - 0x388], eax
cmp dword [ebp - 0x388], 0
je 0x408288
push 1
mov ecx, dword [ebp - 0x388]
call fcn.00408860
mov dword [ebp - 0x398], eax
jmp 0x408292
mov dword [ebp - 0x398], 0
mov dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x3a4]
call fcn.004566c0
mov ecx, dword [ebp - 0x364]
push ecx
mov ecx, dword [ebp - 0x340]
call fcn.00406390
movzx edx, al
test edx, edx
jne 0x4082d0
push str.TCPProxy::startAccept___failed
call fcn.004557e0
push eax
call fcn.00456d70
add esp, 8
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.004a1084
mov esp, ebp
pop ebp
ret 0x10