Function at 0x420300
Capabilities:
Set socket configuration

Disassembly:
sub esp, 0x170
mov eax, dword [0x4594d4]
xor eax, esp
mov dword [esp + 0x16c], eax
push ebx
mov ebx, dword [esp + 0x17c]
mov eax, dword [ebx + 0xc8]
push ebp
mov ebp, dword [esp + 0x17c]
push esi
mov esi, ecx
mov ecx, dword [ebx]
push edi
mov edi, edx
mov dword [esp + 0x18], eax
mov dword [esp + 0x10], ecx
xor eax, eax
mov ecx, ebx
mov dword [esp + 0x24], ebp
mov dword [esp + 0x20], edi
call fcn.00418050
mov dword [esp + 0x1c], eax
test eax, eax
jge 0x42036b
mov eax, dword [esp + 0x10]
push str.Connection_time_out
call fcn.00418ff0
mov eax, 0x1c
jmp 0x420711
mov eax, dword [esp + 0x18]
lea edx, [esp + 0x14]
push edx
push 0x8004667e
push eax
mov dword [esp + 0x20], 0
call dword [sym.imp.WS2_32.dll_ioctlsocket]
push esi
mov byte [esp + 0x34], 4
mov byte [esp + 0x35], 1
call dword [sym.imp.WS2_32.dll_htons]
cmp byte [esp + 0x18c], 0
mov word [esp + 0x32], ax
jne 0x4204a0
lea ecx, [esp + 0x14]
push ecx
push esi
push edi
push ebx
call fcn.00418c90
add esp, 0x10
cmp eax, 0xffffffff
jne 0x4203cb
mov eax, 5
jmp 0x420714
cmp eax, 1
jne 0x4203df
lea edx, [esp + 0x14]
push edx
mov esi, ebx
call fcn.00427bd0
add esp, 4
mov esi, dword [esp + 0x14]
test esi, esi
je 0x420480
mov ebp, dword [esi]
test ebp, ebp
je 0x420480
mov eax, dword [ebp + 4]
sub eax, 2
jne 0x420419
mov eax, dword [ebp + 0x18]
add eax, 4
push 0x40
push eax
lea esi, [esp + 0x140]
call fcn.00428010
mov esi, dword [esp + 0x1c]
add esp, 8
lea eax, [esp + 0x2e]
push eax
lea ecx, [esp + 0x30]
push ecx
lea edx, [esp + 0x32]
push edx
lea eax, [esp + 0x34]
push eax
lea ecx, [esp + 0x148]
push str._hu._hu._hu._hu
push ecx
call fcn.0042dd7b
add esp, 0x18
cmp eax, 4
jne 0x42046b
movzx edx, byte [esp + 0x28]
mov al, byte [esp + 0x2a]
mov cl, byte [esp + 0x2c]
mov byte [esp + 0x34], dl
movzx edx, byte [esp + 0x2e]
mov byte [esp + 0x35], al
mov byte [esp + 0x36], cl
mov byte [esp + 0x37], dl
jmp 0x42046d
xor ebp, ebp
mov edi, esi
mov esi, dword [esp + 0x10]
call fcn.00418e50
mov edi, dword [esp + 0x20]
test ebp, ebp
jne 0x42049c
mov eax, dword [esp + 0x10]
push edi
push str.Failed_to_resolve___s__for_SOCKS4_connect.
call fcn.00418ff0
add esp, 8
mov eax, 6
jmp 0x420714
mov ebp, dword [esp + 0x24]
mov byte [esp + 0x38], 0
test ebp, ebp
je 0x4204b6
push ebp
lea edx, [esp + 0x3c]
call fcn.00421c70
add esp, 4
lea eax, [esp + 0x38]
xor ebp, ebp
lea edx, [eax + 1]
nop
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x4204c0
sub eax, edx
lea esi, [eax + 9]
cmp byte [esp + 0x18c], cl
je 0x42051e
mov eax, edi
mov byte [esp + 0x34], cl
mov byte [esp + 0x35], cl
mov byte [esp + 0x36], cl
mov byte [esp + 0x37], 1
lea edx, [eax + 1]
jmp 0x4204f0
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x4204f0
sub eax, edx
lea ebp, [eax + 1]
lea eax, [esi + ebp]
cmp eax, 0x106
jg 0x42051c
mov ecx, esi
sub ecx, edi
mov eax, edi
lea edx, [esp + ecx + 0x30]
mov cl, byte [eax]
mov byte [edx + eax], cl
inc eax
test cl, cl
jne 0x420510
jmp 0x42051e
xor ebp, ebp
mov ecx, dword [esp + 0x18]
lea edx, [esp + 0x14]
push edx
lea eax, [esp + 0x34]
add esi, ebp
push eax
mov edx, esi
call fcn.00419160
add esp, 8
test eax, eax
jne 0x4206fe
cmp dword [esp + 0x14], esi
jne 0x4206fe
cmp byte [esp + 0x18c], al
je 0x420592
test ebp, ebp
jne 0x420592
mov eax, edi
lea edx, [eax + 1]
lea esp, [esp]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x420560
sub eax, edx
lea ecx, [esp + 0x14]
push ecx
mov ecx, dword [esp + 0x1c]
lea esi, [eax + 1]
push edi
mov edx, esi
call fcn.00419160
add esp, 8
test eax, eax
jne 0x4206fe
cmp dword [esp + 0x14], esi
jne 0x4206fe
mov edx, dword [esp + 0x1c]
push edx
mov edx, dword [esp + 0x1c]
lea eax, [esp + 0x20]
push eax
push 8
lea ecx, [esp + 0x3c]
push ecx
push edx
mov edi, ebx
call fcn.004201b0
add esp, 0x14
test eax, eax
jne 0x4206f7
cmp dword [esp + 0x1c], 8
jne 0x4206f7
cmp byte [esp + 0x30], al
je 0x4205d5
push str.SOCKS4_reply_has_wrong_version__version_should_be_4.
jmp 0x420703
movzx eax, byte [esp + 0x31]
lea ecx, [eax - 0x5a]
cmp ecx, 3
ja case.default.0x4205e6
jmp dword [ecx*4 + 0x420730]
cmp byte [esp + 0x18c], 0
mov ecx, dword [esp + 0x10]
je 0x420602
push str.SOCKS4a_request_granted._n
jmp 0x420607
push str.SOCKS4_request_granted._n
call fcn.00418f30
mov edx, dword [esp + 0x1c]
add esp, 4
mov eax, 1
call fcn.00427ff0
xor eax, eax
jmp 0x420714
push eax
mov eax, dword [esp + 0x3c]
push eax
call dword [sym.imp.WS2_32.dll_ntohs]
movzx edx, byte [esp + 0x3b]
movzx ecx, ax
movzx eax, byte [esp + 0x3a]
push ecx
movzx ecx, byte [esp + 0x3d]
push edx
movzx edx, byte [esp + 0x40]
push eax
push ecx
push edx
push str.Cant_complete_SOCKS4_connection_to__d._d._d._d:_d.___d___request_rejected_or_failed.
mov eax, dword [esp + 0x2c]
call fcn.00418ff0
add esp, 0x1c
mov eax, 7
jmp 0x420714
push eax
mov eax, dword [esp + 0x3c]
push eax
call dword [sym.imp.WS2_32.dll_ntohs]
movzx edx, byte [esp + 0x3b]
movzx ecx, ax
movzx eax, byte [esp + 0x3a]
push ecx
movzx ecx, byte [esp + 0x3d]
push edx
movzx edx, byte [esp + 0x40]
push eax
push ecx
push edx
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 0x420651
push eax
mov eax, dword [esp + 0x3c]
push eax
call dword [sym.imp.WS2_32.dll_ntohs]
movzx edx, byte [esp + 0x3b]
movzx ecx, ax
movzx eax, byte [esp + 0x3a]
push ecx
movzx ecx, byte [esp + 0x3d]
push edx
movzx edx, byte [esp + 0x40]
push eax
push ecx
push edx
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 0x420651
push eax
mov eax, dword [esp + 0x3c]
push eax
call dword [sym.imp.WS2_32.dll_ntohs]
movzx edx, byte [esp + 0x3b]
movzx ecx, ax
movzx eax, byte [esp + 0x3a]
push ecx
movzx ecx, byte [esp + 0x3d]
push edx
movzx edx, byte [esp + 0x40]
push eax
push ecx
push edx
push str.Cant_complete_SOCKS4_connection_to__d._d._d._d:_d.___d___Unknown.
jmp 0x420651
push str.Failed_to_receive_SOCKS4_connect_request_ack.
jmp 0x420703
push str.Failed_to_send_SOCKS4_connect_request.
mov eax, dword [esp + 0x14]
call fcn.00418ff0
mov eax, 7
add esp, 4
mov ecx, dword [esp + 0x17c]
pop edi
pop esi
pop ebp
pop ebx
xor ecx, esp
call fcn.0042bbc1
add esp, 0x170
ret