Function at 0x41c480
Capabilities:
Set socket configuration

Disassembly:
sub esp, 0x170
mov eax, dword [0x4504f4]
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.00414900
mov dword [esp + 0x1c], eax
test eax, eax
jge 0x41c4eb
mov eax, dword [esp + 0x10]
push str.Connection_time_out
call fcn.00415840
mov eax, 0x1c
jmp 0x41c891
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 0x41c620
lea ecx, [esp + 0x14]
push ecx
push esi
push edi
push ebx
call fcn.004154e0
add esp, 0x10
cmp eax, 0xffffffff
jne 0x41c54b
mov eax, 5
jmp 0x41c894
cmp eax, 1
jne 0x41c55f
lea edx, [esp + 0x14]
push edx
mov esi, ebx
call fcn.00423d50
add esp, 4
mov esi, dword [esp + 0x14]
test esi, esi
je 0x41c600
mov ebp, dword [esi]
test ebp, ebp
je 0x41c600
mov eax, dword [ebp + 4]
sub eax, 2
jne 0x41c599
mov eax, dword [ebp + 0x18]
add eax, 4
push 0x40
push eax
lea esi, [esp + 0x140]
call fcn.00424190
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.0042980f
add esp, 0x18
cmp eax, 4
jne 0x41c5eb
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 0x41c5ed
xor ebp, ebp
mov edi, esi
mov esi, dword [esp + 0x10]
call fcn.004156a0
mov edi, dword [esp + 0x20]
test ebp, ebp
jne 0x41c61c
mov eax, dword [esp + 0x10]
push edi
push str.Failed_to_resolve___s__for_SOCKS4_connect.
call fcn.00415840
add esp, 8
mov eax, 6
jmp 0x41c894
mov ebp, dword [esp + 0x24]
mov byte [esp + 0x38], 0
test ebp, ebp
je 0x41c636
push ebp
lea edx, [esp + 0x3c]
call fcn.0041ddb0
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 0x41c640
sub eax, edx
lea esi, [eax + 9]
cmp byte [esp + 0x18c], cl
je 0x41c69e
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 0x41c670
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x41c670
sub eax, edx
lea ebp, [eax + 1]
lea eax, [esi + ebp]
cmp eax, 0x106
jg 0x41c69c
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 0x41c690
jmp 0x41c69e
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.004159b0
add esp, 8
test eax, eax
jne 0x41c87e
cmp dword [esp + 0x14], esi
jne 0x41c87e
cmp byte [esp + 0x18c], al
je 0x41c712
test ebp, ebp
jne 0x41c712
mov eax, edi
lea edx, [eax + 1]
lea esp, [esp]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x41c6e0
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.004159b0
add esp, 8
test eax, eax
jne 0x41c87e
cmp dword [esp + 0x14], esi
jne 0x41c87e
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.0041c330
add esp, 0x14
test eax, eax
jne 0x41c877
cmp dword [esp + 0x1c], 8
jne 0x41c877
cmp byte [esp + 0x30], al
je 0x41c755
push str.SOCKS4_reply_has_wrong_version__version_should_be_4.
jmp 0x41c883
movzx eax, byte [esp + 0x31]
lea ecx, [eax - 0x5a]
cmp ecx, 3
ja case.default.0x41c766
jmp dword [ecx*4 + 0x41c8b0]
cmp byte [esp + 0x18c], 0
mov ecx, dword [esp + 0x10]
je 0x41c782
push str.SOCKS4a_request_granted._n
jmp 0x41c787
push str.SOCKS4_request_granted._n
call fcn.00415780
mov edx, dword [esp + 0x1c]
add esp, 4
mov eax, 1
call fcn.00424170
xor eax, eax
jmp 0x41c894
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.00415840
add esp, 0x1c
mov eax, 7
jmp 0x41c894
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 0x41c7d1
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 0x41c7d1
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 0x41c7d1
push str.Failed_to_receive_SOCKS4_connect_request_ack.
jmp 0x41c883
push str.Failed_to_send_SOCKS4_connect_request.
mov eax, dword [esp + 0x14]
call fcn.00415840
mov eax, 7
add esp, 4
mov ecx, dword [esp + 0x17c]
pop edi
pop esi
pop ebp
pop ebx
xor ecx, esp
call fcn.00427d7d
add esp, 0x170
ret