Function at 0x10040760
Capabilities:
Convert ip address from string

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x54
mov eax, dword [ebp + 8]
push ebx
push esi
mov esi, dword [ebp + 0xc]
mov eax, dword [eax + 0xc]
push edi
mov dword [ebp - 0x10], eax
mov edx, dword [esi + 0x264]
lea edi, [esi + 8]
cmp byte [eax + 0x64], 5
sete byte [ebp + 0xf]
lea ecx, [edx + 1]
lea esp, [esp]
mov al, byte [edx]
inc edx
test al, al
jne 0x10040790
mov ebx, dword [ebp + 0x10]
xor eax, eax
mov dword [ebp - 8], eax
sub edx, ecx
xor ecx, ecx
mov dword [ebp - 0xc], edx
mov dword [ebp - 4], ecx
mov al, byte [ebx + 0x48b]
mov byte [ebp + 0x13], al
mov eax, dword [esi]
dec eax
cmp eax, 0xf
ja case.0x100407c5.5
mov dword [ebp - 0x14], 2
jmp dword [eax*4 + 0x10040f74]
mov eax, dword [ebp - 0x10]
cmp byte [eax + 0x240], cl
je 0x100407f5
push dword [esi + 0x268]
mov eax, dword [esi + 0x264]
push eax
push str.SOCKS5:_connecting_to_HTTP_proxy__s_port__d
push ebx
call fcn.1000ff60
mov edx, dword [ebp - 0xc]
add esp, 0x10
cmp byte [ebp + 0xf], 0
jne 0x1004081d
cmp edx, 0xff
jbe 0x1004081d
push str.SOCKS5:_the_destination_hostname_is_too_long_to_be_resolved_remotely_by_the_proxy.
push ebx
call fcn.1000fec0
add esp, 8
mov eax, 9
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
movzx eax, byte [ebp + 0x13]
test eax, 0xfffffffa
je 0x10040837
push eax
push str.warning:_unsupported_value_passed_to_CURLOPT_SOCKS5_AUTH:__u
push ebx
call fcn.1000ff60
add esp, 0xc
test byte [ebp + 0x13], 1
jne 0x10040847
mov dword [esi + 0x26c], 0
mov byte [edi], 5
mov ecx, 3
mov byte [edi + 2], 0
cmp dword [esi + 0x26c], 0
je 0x10040865
mov byte [edi + 3], 2
mov ecx, 4
push str.initial_SOCKS5_request
push 0x1d
push ebx
lea eax, [ecx - 2]
push esi
push dword [ebp + 8]
mov byte [edi + 1], al
mov dword [esi + 0x260], edi
mov dword [esi + 4], ecx
call fcn.10041040
add esp, 0x14
test eax, eax
jne 0x10040f4e
cmp dword [esi + 4], eax
jne 0x10040f4c
cmp dword [esi], 4
je case.0x100407c5.3
mov dword [esi], 4
jmp case.0x100407c5.3
push str.initial_SOCKS5_request
push 0x1d
push ebx
push esi
push dword [ebp + 8]
call fcn.10041040
add esp, 0x14
test eax, eax
jne 0x10040f4e
cmp dword [esi + 4], eax
jne 0x10040f4c
mov dword [esi + 4], 2
mov dword [esi + 0x260], edi
push str.initial_SOCKS5_response
push 0xf
push ebx
push esi
push dword [ebp + 8]
call fcn.10040fc0
add esp, 0x14
test eax, eax
jne 0x10040f4e
cmp dword [esi + 4], eax
jne 0x10040f4c
cmp byte [edi], 5
je 0x1004091c
push str.Received_invalid_version_in_initial_SOCKS5_response.
push ebx
call fcn.1000fec0
add esp, 8
mov eax, 2
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov al, byte [edi + 1]
test al, al
je 0x10040b0c
cmp al, 2
jne 0x10040976
cmp dword [esi], 6
je case.0x100407c5.6
mov dword [esi], 6
mov edx, dword [esi + 0x26c]
test edx, edx
je 0x100409cc
mov ecx, dword [esi + 0x270]
test ecx, ecx
je 0x100409cc
lea eax, [edx + 1]
mov dword [ebp + 0x10], eax
mov al, byte [edx]
inc edx
test al, al
jne 0x10040954
sub edx, dword [ebp + 0x10]
lea eax, [ecx + 1]
mov dword [ebp - 8], edx
mov dword [ebp + 0x10], eax
mov al, byte [ecx]
inc ecx
test al, al
jne 0x10040967
sub ecx, dword [ebp + 0x10]
mov dword [ebp + 0x10], ecx
jmp 0x100409d4
cmp al, 1
jne 0x10040994
push str.SOCKS5_GSSAPI_per_message_authentication_is_not_supported.
push ebx
call fcn.1000fec0
add esp, 8
mov eax, 5
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
cmp al, 0xff
jne 0x100409b2
push str.No_authentication_method_was_acceptable.
push ebx
call fcn.1000fec0
add esp, 8
mov eax, 0xc
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
push str.Undocumented_SOCKS5_mode_attempted_to_be_used_by_server.
push ebx
call fcn.1000fec0
add esp, 8
mov eax, 0x20
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
xor edx, edx
mov dword [ebp - 8], edx
mov dword [ebp + 0x10], edx
mov byte [edi], 1
mov byte [edi + 1], dl
mov eax, dword [esi + 0x26c]
test eax, eax
je 0x10040a1b
test edx, edx
je 0x10040a1b
cmp edx, 0xff
jbe 0x10040a0a
push str.Excessive_user_name_length_for_proxy_auth
push ebx
call fcn.1000fec0
add esp, 8
mov eax, 0xb
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
push edx
push eax
lea eax, [edi + 2]
push eax
call fcn.10050b30
mov edx, dword [ebp - 8]
add esp, 0xc
mov eax, dword [ebp + 0x10]
lea ecx, [edx + 2]
mov byte [ecx + edi], al
inc ecx
mov edx, dword [esi + 0x270]
mov dword [ebp - 8], ecx
test edx, edx
je 0x10040a6b
test eax, eax
je 0x10040a6b
cmp eax, 0xff
jbe 0x10040a57
push str.Excessive_password_length_for_proxy_auth
push ebx
call fcn.1000fec0
add esp, 8
mov eax, 0xa
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
push eax
push edx
lea eax, [ecx + edi]
push eax
call fcn.10050b30
mov eax, dword [ebp + 0x10]
add esp, 0xc
mov ecx, dword [ebp - 8]
add ecx, eax
cmp dword [esi], 7
je 0x10040a78
mov dword [esi], 7
mov dword [esi + 4], ecx
mov dword [esi + 0x260], edi
push str.SOCKS5_sub_negotiation_request
push 0x1c
push ebx
push esi
push dword [ebp + 8]
call fcn.10041040
add esp, 0x14
test eax, eax
jne 0x10040f4e
cmp dword [esi + 4], eax
jne 0x10040f4c
cmp dword [esi], 8
mov dword [esi + 0x260], edi
mov dword [esi + 4], 2
je case.0x100407c5.8
mov dword [esi], 8
push str.SOCKS5_sub_negotiation_response
push 0xe
push ebx
push esi
push dword [ebp + 8]
call fcn.10040fc0
add esp, 0x14
test eax, eax
jne 0x10040f4e
cmp dword [esi + 4], eax
jne 0x10040f4c
mov al, byte [edi + 1]
test al, al
je 0x10040b0c
movzx eax, al
push eax
movzx eax, byte [edi]
push eax
push str.User_was_rejected_by_the_SOCKS5_server___d__d_.
push ebx
call fcn.1000fec0
add esp, 0x10
mov eax, 0x21
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
cmp dword [esi], 9
je case.0x100407c5.9
mov dword [esi], 9
cmp byte [ebp + 0xf], 0
je case.0x100407c5.12
lea eax, [ebp - 4]
push eax
push 1
push dword [esi + 0x268]
push dword [esi + 0x264]
push ebx
call fcn.1001dc70
add esp, 0x14
cmp eax, 0xffffffff
je 0x10040c38
cmp eax, 1
jne 0x10040b62
cmp dword [esi], 0xa
je 0x10040f4c
pop edi
mov dword [esi], 0xa
xor eax, eax
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
cmp dword [esi], 0xb
mov ecx, dword [ebp - 4]
je case.0x100407c5.11
mov dword [esi], 0xb
xor eax, eax
mov dword [ebp + 0xc], eax
test ecx, ecx
je 0x10040b7e
mov eax, dword [ecx]
mov dword [ebp + 0xc], eax
mov dl, byte [ebx + 0x4a8]
test dl, dl
je 0x10040c20
cmp dl, 1
mov ecx, 0x17
cmove ecx, dword [ebp - 0x14]
test eax, eax
je 0x10040c24
cmp dword [eax + 4], ecx
je 0x10040c20
mov eax, dword [eax + 0x1c]
mov dword [ebp + 0xc], eax
test eax, eax
jne 0x10040ba0
jmp 0x10040c24
push dword [esi + 0x268]
mov eax, dword [esi + 0x264]
push eax
push ebx
call fcn.1001d570
add esp, 0xc
mov dword [ebp - 4], eax
test eax, eax
je 0x10040bfa
mov dword [ebx + 0x920], eax
mov byte [ebx + 0x934], 1
push dword [esi + 0x264]
push str.SOCKS5:_hostname__s_found
push ebx
call fcn.1000ff60
mov ecx, dword [ebp - 4]
add esp, 0xc
test ecx, ecx
jne case.0x100407c5.11
lea eax, [ebp - 4]
push eax
push ebx
call fcn.1001df50
mov ecx, dword [ebp - 4]
add esp, 8
test ecx, ecx
jne case.0x100407c5.11
neg eax
pop edi
sbb eax, eax
pop esi
and eax, 0x1b
pop ebx
mov esp, ebp
pop ebp
ret
test eax, eax
jne 0x10040c44
push dword [esi + 0x264]
push str.Failed_to_resolve___s__for_SOCKS5_connect.
push ebx
call fcn.1000fec0
add esp, 0xc
pop edi
pop esi
mov eax, 0x1b
pop ebx
mov esp, ebp
pop ebp
ret
push 0x2e
lea ecx, [ebp - 0x54]
push ecx
push eax
call fcn.1001dc20
mov eax, dword [ebp + 0xc]
add esp, 0xc
mov word [edi], 0x105
mov byte [edi + 2], 0
mov dword [ebp - 8], 3
mov ecx, dword [eax + 4]
cmp ecx, 2
jne 0x10040cc1
mov byte [edi + 3], 1
mov ecx, dword [eax + 0x18]
mov dword [ebp - 8], 8
movzx eax, byte [ecx + 4]
mov byte [edi + 4], al
movzx eax, byte [ecx + 5]
mov byte [edi + 5], al
movzx eax, byte [ecx + 6]
mov byte [edi + 6], al
movzx eax, byte [ecx + 7]
mov byte [edi + 7], al
lea eax, [ebp - 0x54]
push dword [esi + 0x268]
push eax
push str.SOCKS5_connect_to__s:_d__locally_resolved_
push ebx
call fcn.1000ff60
add esp, 0x10
push dword [ebp - 4]
push ebx
call fcn.1001e000
add esp, 8
jmp case.0x100407c5.13
cmp ecx, 0x17
jne 0x10040d0d
mov byte [edi + 3], 4
xor ecx, ecx
mov edx, dword [eax + 0x18]
mov dword [ebp - 8], 0x14
mov al, byte [edx + ecx + 8]
mov byte [edi + ecx + 4], al
inc ecx
cmp ecx, 0x10
jl 0x10040cd6
push dword [esi + 0x268]
lea eax, [ebp - 0x54]
push eax
push str.SOCKS5_connect_to___s_:_d__locally_resolved_
push ebx
call fcn.1000ff60
add esp, 0x10
push dword [ebp - 4]
push ebx
call fcn.1001e000
add esp, 8
jmp case.0x100407c5.13
lea eax, [ebp - 0x54]
push eax
push str.SOCKS5_connection_to__s_not_supported
push ebx
call fcn.1000fec0
add esp, 0xc
push dword [ebp - 4]
push ebx
call fcn.1001e000
add esp, 8
jmp case.0x100407c5.13
cmp byte [ebp + 0xf], 0
mov word [edi], 0x105
mov byte [edi + 2], 0
mov dword [ebp - 8], 3
jne case.0x100407c5.13
mov eax, dword [ebp - 0x10]
cmp byte [eax + 0x24b], 0
je 0x10040d88
lea eax, [ebp - 0x24]
push eax
push dword [esi + 0x264]
push 0x17
call dword [sym.imp.WS2_32.dll_inet_pton]
cmp eax, 1
jne 0x10040f67
movdqu xmm0, xmmword [ebp - 0x24]
mov byte [edi + 3], 4
mov dword [ebp - 8], 0x14
movdqu xmmword [edi + 4], xmm0
jmp 0x10040dd7
lea eax, [ebp + 0xc]
push eax
push dword [esi + 0x264]
push 2
call dword [sym.imp.WS2_32.dll_inet_pton]
cmp eax, 1
jne 0x10040db1
mov byte [edi + 3], al
mov eax, dword [ebp + 0xc]
mov dword [edi + 4], eax
mov dword [ebp - 8], 8
jmp 0x10040dd7
mov eax, dword [ebp - 0xc]
push eax
mov byte [edi + 3], 3
mov byte [edi + 4], al
lea eax, [edi + 5]
push dword [esi + 0x264]
push eax
call fcn.10050b30
mov eax, dword [ebp - 0xc]
add esp, 0xc
add eax, 5
mov dword [ebp - 8], eax
push dword [esi + 0x268]
push dword [esi + 0x264]
push str.SOCKS5_connect_to__s:_d__remotely_resolved_
push ebx
call fcn.1000ff60
add esp, 0x10
mov ecx, dword [ebp - 8]
mov eax, dword [esi + 0x268]
sar eax, 8
mov byte [ecx + edi], al
mov al, byte [esi + 0x268]
mov byte [ecx + edi + 1], al
lea eax, [ecx + 2]
cmp dword [esi], 0xe
mov dword [esi + 0x260], edi
mov dword [esi + 4], eax
je case.0x100407c5.14
mov dword [esi], 0xe
push str.SOCKS5_connect_request
push 0x1e
push ebx
push esi
push dword [ebp + 8]
call fcn.10041040
add esp, 0x14
test eax, eax
jne 0x10040f4e
cmp dword [esi + 4], eax
jne 0x10040f4c
cmp dword [esi], 0xf
mov dword [esi + 4], 0xa
mov dword [esi + 0x260], edi
je case.0x100407c5.15
mov dword [esi], 0xf
push str.SOCKS5_connect_request_ack
push 0x10
push ebx
push esi
push dword [ebp + 8]
call fcn.10040fc0
add esp, 0x14
test eax, eax
jne 0x10040f4e
cmp dword [esi + 4], eax
jne 0x10040f4c
cmp byte [edi], 5
je 0x10040ea0
push str.SOCKS5_reply_has_wrong_version__version_should_be_5.
push ebx
call fcn.1000fec0
mov eax, dword [ebp - 0x14]
add esp, 8
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov al, byte [edi + 1]
test al, al
je 0x10040ede
movzx edi, al
push edi
push dword [esi + 0x264]
push str.Cant_complete_SOCKS5_connection_to__s.___d_
push ebx
call fcn.1000fec0
add esp, 0x10
cmp edi, 9
jge 0x10040ed2
mov eax, dword [edi*4 + 0x10070cf0]
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
pop edi
pop esi
mov eax, 0x19
pop ebx
mov esp, ebp
pop ebp
ret
mov al, byte [edi + 3]
cmp al, 3
jne 0x10040ef3
movzx eax, byte [edi + 4]
add eax, 7
cmp eax, 0xa
jbe 0x10040f33
jmp 0x10040efc
cmp al, 4
jne 0x10040f55
mov eax, 0x16
add eax, 0xfffffff6
cmp dword [esi], 0x10
mov dword [esi + 4], eax
lea eax, [edi + 0xa]
mov dword [esi + 0x260], eax
je case.0x100407c5.16
mov dword [esi], 0x10
push str.SOCKS5_connect_request_address
push 0xd
push ebx
push esi
push dword [ebp + 8]
call fcn.10040fc0
add esp, 0x14
test eax, eax
jne 0x10040f4e
cmp dword [esi + 4], eax
jne 0x10040f4c
cmp dword [esi], 0x11
je case.0x100407c5.5
mov dword [esi], 0x11
push str.SOCKS5_request_granted.
push ebx
call fcn.1000ff60
add esp, 8
xor eax, eax
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
cmp al, 1
je 0x10040f33
push str.SOCKS5_reply_has_wrong_address_type.
push ebx
call fcn.1000fec0
add esp, 8
pop edi
pop esi
mov eax, 1
pop ebx
mov esp, ebp
pop ebp
ret