Function at 0x502220
Capabilities:
Resolve function by parsing pe exports

Disassembly:
sub esp, 0x2c8
mov eax, dword [0x6fe3a4]
xor eax, esp
mov dword [esp + 0x2c4], eax
mov eax, dword [esp + 0x2cc]
mov ecx, dword [esp + 0x2d4]
push ebx
push ebp
mov dword [esp + 0x24], eax
mov eax, dword [esp + 0x2d8]
lea edx, [ecx + 1]
push esi
mov dword [esp + 0x30], eax
mov eax, dword [esp + 0x2e8]
push edi
mov edi, dword [esp + 0x2f0]
mov dword [esp + 0x30], eax
mov dword [esp + 0x28], ecx
mov ebp, dword [edi + eax*4 + 0x1a8]
mov eax, dword [edi + 0xd0]
cmp eax, 5
mov esi, dword [edi]
mov dword [esp + 0x1c], ebp
sete byte [esp + 0x13]
mov dword [esp + 0x14], eax
nop dword [eax]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x502290
mov ebx, dword [esi + 0x184]
sub ecx, edx
mov dword [esp + 0x38], ecx
mov dword [esp + 0x20], ebx
cmp byte [edi + 0x27e], al
je 0x5022cc
push dword [esp + 0x2e8]
push dword [esp + 0x2c]
push str.SOCKS5:_connecting_to_HTTP_proxy__s_port__d_n
push esi
call fcn.004decd0
mov ecx, dword [esp + 0x48]
add esp, 0x10
cmp dword [esp + 0x14], 5
je 0x5022f0
cmp ecx, 0xff
jbe 0x5022f0
push ecx
push str.SOCKS5:_server_resolving_disabled_for_hostnames_of_length___255__actual_len_zu__n
push dword [edi]
call fcn.004decd0
add esp, 0xc
mov byte [esp + 0x13], 1
push 1
push 0
push esi
call fcn.004e0320
mov ecx, edx
mov dword [esp + 0x24], eax
add esp, 0xc
mov dword [esp + 0x14], ecx
test ecx, ecx
jg 0x502326
jl 0x502311
test eax, eax
jae 0x502326
push str.Connection_time_out
push esi
call fcn.004deb80
mov eax, 0x1c
jmp 0x502a72
push 1
push ebp
call fcn.00502e60
push dword [esp + 0x1c]
push dword [esp + 0x24]
push ebp
push 0xffffffffffffffff
push 0xffffffffffffffff
call fcn.004de650
add esp, 0x1c
cmp eax, 0xffffffff
jne 0x502354
push str.SOCKS5:_no_connection_here
push dword [edi]
jmp 0x502a68
test eax, eax
jne 0x50236e
push str.SOCKS5:_connection_timeout
push dword [edi]
call fcn.004deb80
mov eax, 0x1c
jmp 0x502a72
test al, 4
je 0x50237e
push str.SOCKS5:_error_occurred_during_connection
push dword [edi]
jmp 0x502a68
test ebx, 0xfffffffa
je 0x502396
push ebx
push str.warning:_unsupported_value_passed_to_CURLOPT_SOCKS5_AUTH:__lu_n
push dword [edi]
call fcn.004decd0
add esp, 0xc
test bl, 1
mov byte [esp + 0x3c], 5
mov ebx, 0
mov byte [esp + 0x3e], 0
cmovne ebx, dword [esp + 0x2c]
mov eax, 3
and dword [esp + 0x20], 4
mov dword [esp + 0x2c], ebx
je 0x5023c7
mov byte [esp + 0x3f], 1
mov eax, 4
test ebx, ebx
je 0x5023d1
mov byte [esp + eax + 0x3c], 2
inc eax
sub al, 2
push 0
push ebp
mov byte [esp + 0x45], al
call fcn.00502e60
push dword [esp + 0x2f0]
push dword [esp + 0x34]
push str.SOCKS5_communication_to__s:_d_n
push esi
call fcn.004decd0
lea eax, [esp + 0x3c]
push eax
movzx eax, byte [esp + 0x59]
add eax, 2
push eax
lea eax, [esp + 0x5c]
push eax
push ebp
push edi
call fcn.004df2c0
mov ebp, eax
add esp, 0x2c
test ebp, ebp
jne 0x502a62
movzx ecx, byte [esp + 0x3d]
add ecx, 2
cmp dword [esp + 0x24], ecx
jne 0x502a62
push 1
push dword [esp + 0x20]
call fcn.00502e60
push dword [esp + 0x1c]
push dword [esp + 0x24]
push 0xffffffffffffffff
push 0xffffffffffffffff
push dword [esp + 0x34]
call fcn.004de650
add esp, 0x1c
cmp eax, 0xffffffff
jne 0x502462
push str.SOCKS5_nothing_to_read
push dword [edi]
jmp 0x502a68
test eax, eax
jne 0x50247c
push str.SOCKS5_read_timeout
push dword [edi]
call fcn.004deb80
mov eax, 0x1c
jmp 0x502a72
test al, 4
je 0x502496
push str.SOCKS5_read_error_occurred
push dword [edi]
call fcn.004deb80
mov eax, 0x38
jmp 0x502a72
push 0
push dword [esp + 0x20]
call fcn.00502e60
lea eax, [esp + 0x20]
push eax
push 2
lea eax, [esp + 0x4c]
push eax
push dword [esp + 0x30]
push edi
call fcn.00502aa0
add esp, 0x1c
test eax, eax
jne 0x502a5b
cmp dword [esp + 0x18], 2
jne 0x502a5b
cmp byte [esp + 0x3c], 5
je 0x5024de
push str.Received_invalid_version_in_initial_SOCKS5_response.
jmp 0x502a67
mov al, byte [esp + 0x3d]
test al, al
je 0x50266b
mov ecx, dword [esp + 0x20]
test ecx, ecx
je 0x502517
cmp al, 1
jne 0x502517
push edi
push dword [esp + 0x34]
call fcn.00509590
mov ebp, eax
add esp, 8
test ebp, ebp
je 0x50266b
push str.Unable_to_negotiate_SOCKS5_GSS_API_context.
jmp 0x502a67
cmp al, 2
jne 0x50262a
test ebx, ebx
je 0x50254f
mov edx, dword [esp + 0x34]
test edx, edx
je 0x50254f
lea ecx, [ebx + 1]
nop
mov al, byte [ebx]
inc ebx
test al, al
jne 0x502530
sub ebx, ecx
mov ecx, edx
lea edx, [ecx + 1]
nop
mov al, byte [ecx]
inc ecx
test al, al
jne 0x502540
sub ecx, edx
mov dword [esp + 0x14], ecx
jmp 0x502555
xor ebx, ebx
mov dword [esp + 0x14], ebx
mov eax, dword [esp + 0x2c]
mov byte [esp + 0x3c], 1
mov byte [esp + 0x3d], bl
test eax, eax
je 0x502579
test ebx, ebx
je 0x502579
push ebx
push eax
lea eax, [esp + 0x46]
push eax
call fcn.006434e0
add esp, 0xc
mov eax, dword [esp + 0x34]
lea ebp, [ebx + 2]
mov ebx, dword [esp + 0x14]
mov byte [esp + ebp + 0x3c], bl
inc ebp
test eax, eax
je 0x5025a2
test ebx, ebx
je 0x5025a2
push ebx
push eax
lea eax, [esp + 0x44]
add eax, ebp
push eax
call fcn.006434e0
add esp, 0xc
lea eax, [esp + 0x24]
add ebp, ebx
mov ebx, dword [esp + 0x1c]
push eax
push ebp
lea eax, [esp + 0x44]
push eax
push ebx
push edi
call fcn.004df2c0
add esp, 0x14
mov dword [esp + 0x30], eax
test eax, eax
jne 0x502620
cmp ebp, dword [esp + 0x24]
jne 0x502620
lea eax, [esp + 0x18]
push eax
push 2
lea eax, [esp + 0x44]
push eax
push ebx
push edi
call fcn.00502aa0
add esp, 0x14
test eax, eax
jne 0x502616
cmp dword [esp + 0x18], 2
jne 0x502616
mov al, byte [esp + 0x3d]
test al, al
je 0x502667
movzx eax, al
push eax
movzx eax, byte [esp + 0x40]
push eax
push str.User_was_rejected_by_the_SOCKS5_server___d__d_.
push esi
call fcn.004deb80
add esp, 0x10
mov eax, 7
jmp 0x502a75
push str.Unable_to_receive_SOCKS5_sub_negotiation_response.
jmp 0x502a67
push str.Failed_to_send_SOCKS5_sub_negotiation_request.
jmp 0x502a67
test ecx, ecx
jne 0x50263c
cmp al, 1
jne 0x50263c
push str.SOCKS5_GSSAPI_per_message_authentication_is_not_supported.
jmp 0x502a67
cmp al, 0xff
jne 0x50265d
test ebx, ebx
je 0x502653
cmp byte [ebx], 0
je 0x502653
push str.No_authentication_method_was_acceptable.
jmp 0x502a67
push str.No_authentication_method_was_acceptable.__It_is_quite_likely_that_the_SOCKS5_server_wanted_a_username_password__since_none_was_supplied_to_the_server_on_this_connection._
jmp 0x502a67
push str.Undocumented_SOCKS5_mode_attempted_to_be_used_by_server.
jmp 0x502a67
mov ebp, dword [esp + 0x30]
cmp byte [esp + 0x13], 0
mov ebx, 3
mov word [esp + 0x3c], 0x105
mov byte [esp + 0x3e], 0
jne 0x5026a9
mov byte [esp + 0x3f], bl
lea eax, [esp + 0x41]
mov ebx, dword [esp + 0x38]
push ebx
push dword [esp + 0x2c]
mov byte [esp + 0x48], bl
push eax
call fcn.006434e0
add esp, 0xc
add ebx, 5
jmp 0x5027d8
lea eax, [esp + 0x20]
push eax
push dword [esp + 0x2ec]
push dword [esp + 0x30]
push edi
call fcn.004d4eb0
add esp, 0x10
cmp eax, 0xffffffff
je 0x502a54
cmp eax, 1
jne 0x5026e9
lea eax, [esp + 0x20]
push eax
push edi
call fcn.004d4360
mov ebp, eax
add esp, 8
test ebp, ebp
je 0x5026e9
jmp 0x502a75
mov eax, dword [esp + 0x20]
test eax, eax
je 0x502a42
mov eax, dword [eax]
mov dword [esp + 0x14], eax
test eax, eax
je 0x502a42
push 0x40
lea ecx, [esp + 0x298]
push ecx
push eax
call fcn.004d4e60
mov eax, dword [esp + 0x20]
add esp, 0xc
mov ecx, dword [eax + 4]
cmp ecx, 2
jne 0x502764
mov byte [esp + 0x3f], 1
mov ebx, 8
mov ecx, dword [eax + 0x18]
movzx eax, byte [ecx + 4]
mov byte [esp + 0x40], al
movzx eax, byte [ecx + 5]
mov byte [esp + 0x41], al
movzx eax, byte [ecx + 6]
mov byte [esp + 0x42], al
movzx eax, byte [ecx + 7]
mov byte [esp + 0x43], al
lea eax, [esp + 0x294]
push eax
push str.SOCKS5_connect_to_IPv4__s__locally_resolved__n
push esi
call fcn.004decd0
jmp 0x5027bd
cmp ecx, 0x17
jne 0x5027a2
xor ecx, ecx
mov byte [esp + 0x3f], 4
mov edx, dword [eax + 0x18]
add edx, 8
lea ebx, [ecx + 0x14]
nop dword [eax]
mov al, byte [ecx + edx]
mov byte [esp + ecx + 0x40], al
inc ecx
cmp ecx, 0x10
jl 0x502780
lea eax, [esp + 0x294]
push eax
push str.SOCKS5_connect_to_IPv6__s__locally_resolved__n
push esi
call fcn.004decd0
jmp 0x5027bd
lea eax, [esp + 0x294]
mov dword [esp + 0x14], 0
push eax
push str.SOCKS5_connection_to__s_not_supported_n
push esi
call fcn.004deb80
add esp, 0xc
push dword [esp + 0x20]
push esi
call fcn.004d5090
add esp, 8
cmp dword [esp + 0x14], 0
je 0x502a42
mov ecx, dword [esp + 0x2e8]
mov eax, ecx
sar eax, 8
mov byte [esp + ebx + 0x3c], al
mov byte [esp + ebx + 0x3d], cl
add ebx, 2
cmp dword [edi + 0x5b0], 0
je 0x502808
push str.SOCKS5_GSS_API_protection_not_yet_implemented.
push esi
call fcn.004deb80
add esp, 8
jmp 0x502822
lea eax, [esp + 0x24]
push eax
push ebx
lea eax, [esp + 0x44]
push eax
push dword [esp + 0x28]
push edi
call fcn.004df2c0
add esp, 0x14
mov ebp, eax
test ebp, ebp
jne 0x502a3b
cmp ebx, dword [esp + 0x24]
jne 0x502a3b
lea ebx, [ebp + 0xa]
cmp dword [edi + 0x5b0], ebp
je 0x502857
push str.SOCKS5_GSS_API_protection_not_yet_implemented.
push esi
call fcn.004deb80
add esp, 8
push str.Failed_to_receive_SOCKS5_connect_request_ack.
jmp 0x502a67
mov ebp, dword [esp + 0x1c]
lea eax, [esp + 0x18]
push eax
push 0xa
lea eax, [esp + 0x44]
push eax
push ebp
push edi
call fcn.00502aa0
add esp, 0x14
test eax, eax
jne 0x50284d
cmp dword [esp + 0x18], ebx
jne 0x50284d
cmp byte [esp + 0x3c], 5
je 0x50288c
push str.SOCKS5_reply_has_wrong_version__version_should_be_5.
jmp 0x502a67
mov al, byte [esp + 0x3f]
mov dl, byte [esp + 0x40]
cmp al, 3
jne 0x5028a0
movzx ebx, dl
add ebx, 7
jmp 0x5028aa
cmp al, 4
mov ecx, 0x16
cmove ebx, ecx
cmp dword [edi + 0x5b0], 0
jne 0x5028f1
cmp ebx, 0xa
jbe 0x5028f1
lea eax, [esp + 0x18]
push eax
lea ebp, [ebx - 0xa]
push ebp
lea eax, [esp + 0x4e]
push eax
push dword [esp + 0x28]
push edi
call fcn.00502aa0
add esp, 0x14
test eax, eax
jne 0x50284d
cmp ebp, dword [esp + 0x18]
jne 0x50284d
mov dl, byte [esp + 0x40]
mov al, byte [esp + 0x3f]
mov ebp, dword [esp + 0x1c]
mov cl, byte [esp + 0x3d]
test cl, cl
je 0x502a21
cmp al, 1
jne 0x502943
movzx eax, cl
movzx ecx, byte [esp + 0x44]
push eax
movzx eax, byte [esp + 0x49]
shl ecx, 8
or ecx, eax
movzx eax, byte [esp + 0x47]
push ecx
push eax
movzx eax, byte [esp + 0x4e]
push eax
movzx eax, byte [esp + 0x51]
push eax
movzx eax, dl
push eax
push str.Cant_complete_SOCKS5_connection_to__d._d._d._d:_d.___d_
push esi
call fcn.004deb80
add esp, 0x20
mov eax, 7
jmp 0x502a75
cmp al, 3
jne 0x50298f
mov dl, byte [esp + ebx + 0x3a]
lea eax, [ebx - 2]
cmp eax, 0x258
jae 0x502a8e
mov byte [esp + eax + 0x3c], 0
movzx eax, byte [esp + 0x3d]
movzx ecx, byte [esp + ebx + 0x3b]
push eax
movzx eax, dl
shl eax, 8
or ecx, eax
lea eax, [esp + 0x45]
push ecx
push eax
push str.Cant_complete_SOCKS5_connection_to__s:_d.___d_
push esi
call fcn.004deb80
add esp, 0x14
mov eax, 7
jmp 0x502a75
cmp al, 4
jne 0x502a1a
movzx eax, cl
push eax
movzx ecx, byte [esp + 0x54]
movzx eax, byte [esp + 0x55]
shl ecx, 8
or ecx, eax
movzx eax, byte [esp + 0x53]
push ecx
push eax
movzx eax, byte [esp + 0x5a]
push eax
movzx eax, byte [esp + 0x5d]
push eax
movzx eax, byte [esp + 0x60]
push eax
movzx eax, byte [esp + 0x63]
push eax
movzx eax, byte [esp + 0x66]
push eax
movzx eax, byte [esp + 0x69]
push eax
movzx eax, byte [esp + 0x6c]
push eax
movzx eax, byte [esp + 0x6f]
push eax
movzx eax, byte [esp + 0x72]
push eax
movzx eax, byte [esp + 0x75]
push eax
movzx eax, byte [esp + 0x78]
push eax
movzx eax, byte [esp + 0x7b]
push eax
movzx eax, byte [esp + 0x7e]
push eax
movzx eax, byte [esp + 0x81]
push eax
movzx eax, dl
push eax
push str.Cant_complete_SOCKS5_connection_to__02x_02x:_02x_02x:_02x_02x:_02x_02x:_02x_02x:_02x_02x:_02x_02x:_02x_02x:_d.___d_
push esi
call fcn.004deb80
add esp, 0x50
mov eax, 7
jmp 0x502a75
push str.SOCKS5_request_granted._n
push esi
call fcn.004decd0
push 1
push ebp
call fcn.00502e60
add esp, 0x10
xor eax, eax
jmp 0x502a75
push str.Failed_to_send_SOCKS5_connect_request.
jmp 0x502a67
push dword [esp + 0x28]
push str.Failed_to_resolve___s__for_SOCKS5_connect.
push esi
call fcn.004deb80
add esp, 0xc
mov eax, 6
jmp 0x502a75
push str.Unable_to_receive_initial_SOCKS5_response.
jmp 0x502a67
push str.Unable_to_send_initial_SOCKS5_request.
push esi
call fcn.004deb80
mov eax, 7
add esp, 8
mov ecx, dword [esp + 0x2d4]
pop edi
pop esi
pop ebp
pop ebx
xor ecx, esp
call fcn.00641b27
add esp, 0x2c8
ret
call fcn.00641a4b
int3