Function at 0x1002043a
Capabilities:
Set socket configuration

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x174
mov eax, dword [0x1013a420]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 0xc]
push ebx
push esi
push edi
mov edi, dword [ebp + 0x10]
mov ebx, edx
mov dword [ebp - 0x160], ecx
xor edx, edx
mov ecx, dword [ebp + 0x14]
mov dword [ebp - 0x168], ecx
mov esi, dword [edi]
mov ecx, esi
mov eax, dword [edi + eax*4 + 0x130]
push 1
mov dword [ebp - 0x170], ebx
mov dword [ebp - 0x16c], edi
mov dword [ebp - 0x164], eax
call fcn.10016750
pop ecx
test eax, eax
jns 0x100204a6
push str.Connection_time_out
push esi
call fcn.10018208
pop ecx
pop ecx
push 0x1c
jmp 0x10020899
and dword [ebp - 0x15c], 0
lea eax, [ebp - 0x15c]
push eax
push 0x8004667e
push dword [ebp - 0x164]
call dword [sym.imp.WS2_32.dll_ioctlsocket]
mov ecx, dword [ebp + 8]
mov eax, ecx
sar eax, 8
cmp dword [ebp - 0x168], 0
mov word [ebp - 0x118], 0x104
mov byte [ebp - 0x116], al
mov byte [ebp - 0x115], cl
jne 0x100205b8
lea eax, [ebp - 0x15c]
mov edx, ebx
push eax
push ecx
mov ecx, edi
call fcn.1001789a
pop ecx
pop ecx
cmp eax, 0xffffffff
jne 0x1002050e
push 5
jmp 0x10020899
cmp eax, 1
jne 0x10020520
lea edx, [ebp - 0x15c]
mov ecx, edi
call fcn.10017f1b
mov eax, dword [ebp - 0x15c]
test eax, eax
je 0x100205a2
mov edi, dword [eax]
test edi, edi
je 0x100205a2
push 0x40
lea edx, [ebp - 0x158]
mov ecx, edi
call fcn.10017659
pop ecx
lea eax, [ebp - 6]
push eax
lea eax, [ebp - 8]
push eax
lea eax, [ebp - 0xa]
push eax
lea eax, [ebp - 0xc]
push eax
lea eax, [ebp - 0x158]
push str._hu._hu._hu._hu
push eax
call fcn.1003b45c
add esp, 0x18
cmp eax, 4
jne 0x1002058f
mov al, byte [ebp - 0xc]
mov byte [ebp - 0x114], al
mov al, byte [ebp - 0xa]
mov byte [ebp - 0x113], al
mov al, byte [ebp - 8]
mov byte [ebp - 0x112], al
mov al, byte [ebp - 6]
mov byte [ebp - 0x111], al
jmp 0x10020591
xor edi, edi
mov edx, dword [ebp - 0x15c]
mov ecx, esi
call fcn.100179f9
test edi, edi
jne 0x100205b8
push ebx
push str.Failed_to_resolve___s__for_SOCKS4_connect.
push esi
call fcn.10018208
add esp, 0xc
push 6
jmp 0x10020899
mov eax, dword [ebp - 0x160]
mov byte [ebp - 0x110], 0
test eax, eax
je 0x100205d8
push ecx
mov edx, eax
lea ecx, [ebp - 0x110]
call fcn.10028f48
pop ecx
lea ecx, [ebp - 0x110]
xor edi, edi
lea edx, [ecx + 1]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x100205e3
sub ecx, edx
cmp dword [ebp - 0x168], edi
je 0x1002063a
mov edx, ebx
mov dword [ebp - 0x114], 0x1000000
lea edi, [edx + 1]
mov al, byte [edx]
inc edx
test al, al
jne 0x10020603
sub edx, edi
lea edi, [edx + 1]
lea eax, [edi + 9]
add eax, ecx
cmp eax, 0x106
jg 0x10020638
mov edx, ebx
lea ebx, [ebp + ecx - 0x10f]
sub ebx, edx
mov al, byte [edx]
mov byte [ebx + edx], al
inc edx
test al, al
jne 0x10020626
mov ebx, dword [ebp - 0x170]
jmp 0x1002063a
xor edi, edi
mov edx, dword [ebp - 0x164]
lea eax, [ecx + 9]
add eax, edi
lea ecx, [ebp - 0x15c]
push ecx
mov ecx, dword [ebp - 0x16c]
push eax
mov dword [ebp - 0x160], eax
lea eax, [ebp - 0x118]
push eax
call fcn.10018425
add esp, 0xc
test eax, eax
jne 0x1002088a
mov eax, dword [ebp - 0x160]
cmp dword [ebp - 0x15c], eax
jne 0x1002088a
cmp dword [ebp - 0x168], 0
je 0x100206d1
test edi, edi
jne 0x100206d1
mov ecx, ebx
lea edx, [ecx + 1]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x10020694
sub ecx, edx
lea eax, [ebp - 0x15c]
mov edx, dword [ebp - 0x164]
push eax
lea edi, [ecx + 1]
mov ecx, dword [ebp - 0x16c]
push edi
push ebx
call fcn.10018425
add esp, 0xc
test eax, eax
jne 0x1002088a
cmp dword [ebp - 0x15c], edi
jne 0x1002088a
mov edi, dword [ebp - 0x164]
lea eax, [ebp - 0x160]
mov ecx, dword [ebp - 0x16c]
mov edx, edi
push eax
lea eax, [ebp - 0x118]
push 8
push eax
call fcn.100203a0
add esp, 0xc
test eax, eax
jne 0x10020883
cmp dword [ebp - 0x160], 8
jne 0x10020883
cmp byte [ebp - 0x118], al
je 0x1002071e
push str.SOCKS4_reply_has_wrong_version__version_should_be_4.
jmp 0x1002088f
movzx ecx, byte [ebp - 0x117]
mov eax, ecx
sub eax, 0x5a
je 0x1002083f
dec eax
je 0x100207ff
dec eax
je 0x100207bf
dec eax
movzx eax, byte [ebp - 0x10f]
je 0x10020789
push ecx
movzx ecx, byte [ebp - 0x110]
shl ecx, 8
or ecx, eax
movzx eax, byte [ebp - 0x111]
push ecx
push eax
movzx eax, byte [ebp - 0x112]
push eax
movzx eax, byte [ebp - 0x113]
push eax
movzx eax, byte [ebp - 0x114]
push eax
push str.Cant_complete_SOCKS4_connection_to__d._d._d._d:_d.___d___Unknown.
push esi
call fcn.10018208
add esp, 0x20
jmp 0x10020897
movzx ecx, byte [ebp - 0x110]
push 0x5d
shl ecx, 8
or ecx, eax
movzx eax, byte [ebp - 0x111]
push ecx
push eax
movzx eax, byte [ebp - 0x112]
push eax
movzx eax, byte [ebp - 0x113]
push eax
movzx eax, byte [ebp - 0x114]
push eax
push str.Cant_complete_SOCKS4_connection_to__d._d._d._d:_d.___d___request_rejected_because_the_client_program_and_identd_report_different_user_ids.
jmp 0x1002077b
movzx ecx, byte [ebp - 0x110]
movzx eax, byte [ebp - 0x10f]
push 0x5c
shl ecx, 8
or ecx, eax
movzx eax, byte [ebp - 0x111]
push ecx
push eax
movzx eax, byte [ebp - 0x112]
push eax
movzx eax, byte [ebp - 0x113]
push eax
movzx eax, byte [ebp - 0x114]
push eax
push str.Cant_complete_SOCKS4_connection_to__d._d._d._d:_d.___d___request_rejected_because_SOCKS_server_cannot_connect_to_identd_on_the_client.
jmp 0x1002077b
movzx ecx, byte [ebp - 0x110]
movzx eax, byte [ebp - 0x10f]
push 0x5b
shl ecx, 8
or ecx, eax
movzx eax, byte [ebp - 0x111]
push ecx
push eax
movzx eax, byte [ebp - 0x112]
push eax
movzx eax, byte [ebp - 0x113]
push eax
movzx eax, byte [ebp - 0x114]
push eax
push str.Cant_complete_SOCKS4_connection_to__d._d._d._d:_d.___d___request_rejected_or_failed.
jmp 0x1002077b
cmp dword [ebp - 0x168], 0
mov ecx, 0x1012f673
mov eax, 0x10130f4c
cmove eax, ecx
push eax
push str.SOCKS4_s_request_granted._n
push esi
call fcn.10018194
add esp, 0xc
mov dword [ebp - 0x160], 1
lea eax, [ebp - 0x160]
push eax
push 0x8004667e
push edi
call dword [sym.imp.WS2_32.dll_ioctlsocket]
xor eax, eax
jmp 0x1002089a
push str.Failed_to_receive_SOCKS4_connect_request_ack.
jmp 0x1002088f
push str.Failed_to_send_SOCKS4_connect_request.
push esi
call fcn.10018208
pop ecx
pop ecx
push 7
pop eax
mov ecx, dword [ebp - 4]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.1003890f
mov esp, ebp
pop ebp
ret