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

Disassembly:
sub esp, 0xb4
mov eax, dword [0x6fe3a4]
xor eax, esp
mov dword [esp + 0xb0], eax
mov eax, dword [esp + 0xb8]
mov ecx, str.rcmd
push ebx
push ebp
push esi
push edi
mov edi, dword [esp + 0xcc]
mov dword [esp + 0x54], 0
mov ebx, dword [edi]
mov ebp, dword [edi + eax*4 + 0x1a8]
mov eax, dword [ebx + 0x5f8]
test eax, eax
cmovne ecx, eax
mov esi, ecx
mov dword [esp + 0x50], ecx
lea edx, [esi + 1]
mov al, byte [esi]
inc esi
test al, al
jne 0x5095e0
push 0x2f
push ecx
sub esi, edx
call fcn.00646850
add esp, 8
test eax, eax
je 0x509619
push dword [esp + 0x50]
call dword [0x6fd360]
mov esi, eax
add esp, 4
mov dword [esp + 0x20], esi
test esi, esi
jne 0x509679
mov eax, 0x1b
jmp 0x50a1c2
mov ecx, dword [edi + 0xc4]
lea edx, [ecx + 1]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x509622
sub ecx, edx
lea eax, [ecx + 2]
add eax, esi
push eax
call dword [0x6fd354]
add esp, 4
mov dword [esp + 0x20], eax
test eax, eax
je 0x50960f
mov edx, dword [edi + 0xc4]
mov ecx, edx
lea eax, [ecx + 1]
mov dword [esp + 0x58], eax
mov al, byte [ecx]
inc ecx
test al, al
jne 0x509651
sub ecx, dword [esp + 0x58]
lea eax, [esi + 2]
mov esi, dword [esp + 0x20]
add eax, ecx
push edx
push dword [esp + 0x54]
push str._s__s
push eax
push esi
call fcn.004eb450
add esp, 0x14
lea eax, [esp + 0x40]
mov dword [esp + 0x78], 1
mov dword [esp + 0x7c], eax
lea eax, [esp + 0x2c]
mov dword [esp + 0x70], eax
lea eax, [esp + 0x9c]
mov dword [esp + 0x64], eax
lea eax, [esp + 0x84]
push eax
lea eax, [esp + 0x3c]
mov dword [esp + 0x78], 0
push eax
mov eax, dword [0x703700]
push 0
push 0
push 0
push 0
push 2
push str.Kerberos
mov dword [esp + 0x64], 2
mov dword [esp + 0x60], 0
mov dword [esp + 0x68], 0
mov dword [esp + 0x8c], 1
mov dword [esp + 0x88], 0
mov dword [esp + 0x50], 2
mov dword [esp + 0x4c], 0
mov dword [esp + 0x54], 0
mov dword [esp + 0x80], 3
mov dword [esp + 0x7c], 0
mov dword [esp + 0x58], 0
mov dword [esp + 0x5c], 0
mov eax, dword [eax + 0xc]
push 0
call eax
test eax, eax
je 0x50978e
cmp eax, 0x90314
je 0x50978e
cmp eax, 0x90313
je 0x50978e
cmp eax, 0x90312
je 0x50978e
push eax
push edi
call fcn.004ed830
push eax
push str.AcquireCredentialsHandle
push 0x691d24
push dword [edi]
call fcn.004deb80
push str.Failed_to_acquire_credentials.
push ebx
call fcn.004deb80
push esi
call dword [0x6fd358]
add esp, 0x24
lea eax, [esp + 0x38]
push eax
mov eax, dword [0x703700]
mov eax, dword [eax + 0x10]
jmp 0x50a1bb
xor eax, eax
lea ecx, [esp + 0x84]
push ecx
lea ecx, [esp + 0x58]
push ecx
lea ecx, [esp + 0x70]
push ecx
lea ecx, [esp + 0x24]
push ecx
push 0
lea ecx, [esp + 0x88]
push ecx
push 0x10
push 0
push 0x116
push esi
push eax
lea eax, [esp + 0x64]
push eax
mov eax, dword [0x703700]
mov eax, dword [eax + 0x18]
call eax
mov ecx, dword [esp + 0x48]
mov esi, eax
test ecx, ecx
je 0x5097eb
push ecx
mov ecx, dword [0x703700]
mov ecx, dword [ecx + 0x40]
call ecx
xor ecx, ecx
mov dword [esp + 0x48], ecx
mov dword [esp + 0x40], ecx
test esi, esi
je 0x50980b
cmp esi, 0x90314
je 0x50980b
cmp esi, 0x90313
je 0x50980b
cmp esi, 0x90312
jne 0x509969
mov eax, dword [esp + 0x2c]
test eax, eax
je 0x509880
push eax
mov word [esp + 0x14], 0x101
call dword [sym.imp.WS2_32.dll_htons]
mov word [esp + 0x12], ax
lea eax, [esp + 0x24]
push eax
push 4
lea eax, [esp + 0x18]
push eax
push ebp
push edi
call fcn.004df2c0
add esp, 0x14
test eax, eax
jne 0x509a25
cmp dword [esp + 0x24], 4
jne 0x509a25
lea eax, [esp + 0x24]
push eax
push dword [esp + 0x30]
push dword [esp + 0x3c]
push ebp
push edi
call fcn.004df2c0
add esp, 0x14
test eax, eax
jne 0x5099d4
mov eax, dword [esp + 0x2c]
cmp eax, dword [esp + 0x24]
jne 0x5099d4
mov ecx, dword [esp + 0x48]
mov eax, dword [esp + 0x34]
test eax, eax
je 0x50989f
push eax
mov eax, dword [0x703700]
mov eax, dword [eax + 0x40]
call eax
mov ecx, dword [esp + 0x48]
mov dword [esp + 0x34], 0
mov dword [esp + 0x2c], 0
test ecx, ecx
je 0x5098be
mov eax, dword [0x703700]
push ecx
mov eax, dword [eax + 0x40]
call eax
mov dword [esp + 0x48], 0
mov dword [esp + 0x40], 0
cmp esi, 0x90312
jne 0x509aef
lea eax, [esp + 0x28]
push eax
push 4
lea eax, [esp + 0x18]
push eax
push ebp
push edi
call fcn.00502aa0
add esp, 0x14
test eax, eax
jne 0x509ac4
cmp dword [esp + 0x28], 4
jne 0x509ac4
mov al, byte [esp + 0x11]
cmp al, 0xff
je 0x509ab2
cmp al, 1
jne 0x509a7d
push dword [esp + 0x12]
call dword [sym.imp.WS2_32.dll_ntohs]
movzx esi, ax
push esi
mov dword [esp + 0x44], esi
call dword [0x6fd354]
add esp, 4
mov dword [esp + 0x48], eax
test eax, eax
je 0x509a47
lea ecx, [esp + 0x28]
push ecx
push dword [esp + 0x44]
push eax
push ebp
push edi
call fcn.00502aa0
add esp, 0x14
test eax, eax
jne 0x509a2c
cmp dword [esp + 0x28], esi
jne 0x509a2c
mov esi, dword [esp + 0x20]
lea eax, [esp + 0x18]
jmp 0x509790
push esi
push edi
call fcn.004ed830
push eax
push str.InitializeSecurityContext
push 0x691d24
push dword [edi]
call fcn.004deb80
mov eax, dword [esp + 0x38]
push eax
call dword [0x6fd358]
add esp, 0x1c
lea eax, [esp + 0x38]
push eax
mov eax, dword [0x703700]
mov eax, dword [eax + 0x10]
call eax
lea eax, [esp + 0x18]
push eax
mov eax, dword [0x703700]
mov eax, dword [eax + 0x24]
call eax
mov eax, dword [esp + 0x48]
test eax, eax
je 0x5099c1
push eax
mov eax, dword [0x703700]
mov eax, dword [eax + 0x40]
call eax
push str.Failed_to_initialise_security_context.
push ebx
call fcn.004deb80
add esp, 8
jmp 0x50a1bd
push str.Failed_to_send_SSPI_authentication_token.
push ebx
call fcn.004deb80
mov eax, dword [esp + 0x28]
push eax
call dword [0x6fd358]
mov eax, dword [esp + 0x40]
add esp, 0xc
test eax, eax
je 0x509a00
push eax
mov eax, dword [0x703700]
mov eax, dword [eax + 0x40]
call eax
mov eax, dword [esp + 0x48]
test eax, eax
je 0x509a13
push eax
mov eax, dword [0x703700]
mov eax, dword [eax + 0x40]
call eax
lea eax, [esp + 0x38]
push eax
mov eax, dword [0x703700]
mov eax, dword [eax + 0x10]
jmp 0x50a1ac
push str.Failed_to_send_SSPI_authentication_request.
jmp 0x5099d9
push str.Failed_to_receive_SSPI_authentication_token.
push ebx
call fcn.004deb80
mov eax, dword [esp + 0x28]
push eax
call dword [0x6fd358]
add esp, 0xc
jmp 0x509a00
mov eax, dword [esp + 0x20]
push eax
call dword [0x6fd358]
add esp, 4
lea eax, [esp + 0x38]
push eax
mov eax, dword [0x703700]
mov eax, dword [eax + 0x10]
call eax
lea eax, [esp + 0x18]
push eax
mov eax, dword [0x703700]
mov eax, dword [eax + 0x24]
call eax
mov eax, 0x1b
jmp 0x50a1c2
movzx eax, al
push eax
movzx eax, byte [esp + 0x14]
push eax
push str.Invalid_SSPI_authentication_response_type___u__u_.
push ebx
call fcn.004deb80
mov eax, dword [esp + 0x30]
push eax
call dword [0x6fd358]
add esp, 0x14
lea eax, [esp + 0x38]
push eax
mov eax, dword [0x703700]
mov eax, dword [eax + 0x10]
jmp 0x50a1ac
movzx eax, byte [esp + 0x10]
push 0xff
push eax
push str.User_was_rejected_by_the_SOCKS5_server___u__u_.
jmp 0x509a8c
push str.Failed_to_receive_SSPI_authentication_response.
push ebx
call fcn.004deb80
mov eax, dword [esp + 0x28]
push eax
call dword [0x6fd358]
add esp, 0xc
lea eax, [esp + 0x38]
push eax
mov eax, dword [0x703700]
mov eax, dword [eax + 0x10]
jmp 0x50a1ac
mov eax, dword [esp + 0x20]
push eax
call dword [0x6fd358]
add esp, 4
lea eax, [esp + 0x4c]
push eax
push 1
lea eax, [esp + 0x40]
push eax
mov eax, dword [0x703700]
mov eax, dword [eax + 8]
call eax
mov ecx, dword [0x703700]
mov esi, eax
lea eax, [esp + 0x38]
push eax
mov ecx, dword [ecx + 0x10]
call ecx
push str.QueryCredentialAttributes
push esi
push edi
call fcn.0050a1e0
add esp, 0xc
test eax, eax
je 0x509b68
lea eax, [esp + 0x18]
push eax
mov eax, dword [0x703700]
mov eax, dword [eax + 0x24]
call eax
mov eax, dword [0x703700]
push dword [esp + 0x4c]
mov eax, dword [eax + 0x40]
call eax
push str.Failed_to_determine_user_name.
push ebx
call fcn.004deb80
add esp, 8
jmp 0x50a1bd
push dword [esp + 0x4c]
push str.SOCKS5_server_authencticated_user__s_with_GSS_API._n
push ebx
call fcn.004decd0
mov eax, dword [0x703700]
add esp, 0xc
push dword [esp + 0x4c]
mov eax, dword [eax + 0x40]
call eax
mov eax, dword [esp + 0x54]
mov word [esp + 0x10], 0x201
test al, 0x10
je 0x509b9b
mov cl, 2
jmp 0x509ba4
test eax, 0x10000
je 0x509bb6
mov cl, 1
cmp cl, 1
mov eax, str.integrity
mov edx, str.confidentiality
cmovne eax, edx
jmp 0x509bbb
mov eax, 0x691f68
push eax
push str.SOCKS5_server_supports_GSS_API__s_data_protection._n
push ebx
call fcn.004decd0
add esp, 0xc
cmp byte [ebx + 0x624], 0
je 0x509bda
push 1
jmp 0x509e80
lea eax, [esp + 0x8c]
push eax
push 0
lea eax, [esp + 0x20]
push eax
mov eax, dword [0x703700]
mov eax, dword [eax + 0x2c]
call eax
push str.QueryContextAttributes
push eax
push edi
call fcn.0050a1e0
add esp, 0xc
test eax, eax
jne 0x509d28
mov eax, dword [esp + 0x98]
push eax
mov dword [esp + 0xa0], eax
mov dword [esp + 0xa4], 2
call dword [0x6fd354]
add esp, 4
mov dword [esp + 0xa4], eax
test eax, eax
je 0x509a64
push 1
mov dword [esp + 0xac], 1
call dword [0x6fd354]
add esp, 4
mov dword [esp + 0xb0], eax
test eax, eax
jne 0x509c71
mov eax, dword [0x703700]
push dword [esp + 0xa4]
mov eax, dword [eax + 0x40]
jmp 0x509a62
mov byte [eax], 0
mov eax, dword [esp + 0x94]
push eax
mov dword [esp + 0xbc], 9
mov dword [esp + 0xb8], eax
call dword [0x6fd354]
add esp, 4
mov dword [esp + 0xbc], eax
test eax, eax
jne 0x509cc7
mov eax, dword [0x703700]
push dword [esp + 0xa4]
mov eax, dword [eax + 0x40]
call eax
mov eax, dword [0x703700]
push dword [esp + 0xb0]
mov eax, dword [eax + 0x40]
jmp 0x509a62
push 0
lea eax, [esp + 0x60]
push eax
push reloc.WS2_32.dll_accept
lea eax, [esp + 0x24]
push eax
mov eax, dword [0x703700]
mov eax, dword [eax + 0x64]
call eax
push str.EncryptMessage
push eax
push edi
call fcn.0050a1e0
add esp, 0xc
test eax, eax
je 0x509d4a
mov eax, dword [0x703700]
push dword [esp + 0xa4]
mov eax, dword [eax + 0x40]
call eax
mov eax, dword [0x703700]
push dword [esp + 0xb0]
mov eax, dword [eax + 0x40]
call eax
push dword [esp + 0xbc]
mov eax, dword [0x703700]
mov eax, dword [eax + 0x40]
call eax
lea eax, [esp + 0x18]
push eax
mov eax, dword [0x703700]
mov eax, dword [eax + 0x24]
call eax
push str.Failed_to_query_security_context_attributes.
push ebx
call fcn.004deb80
add esp, 8
jmp 0x50a1bd
mov eax, dword [esp + 0xb4]
add eax, dword [esp + 0xa8]
add eax, dword [esp + 0x9c]
push eax
mov dword [esp + 0x30], eax
call dword [0x6fd354]
add esp, 4
mov dword [esp + 0x34], eax
test eax, eax
jne 0x509dab
mov eax, dword [0x703700]
push dword [esp + 0xa4]
mov eax, dword [eax + 0x40]
call eax
mov eax, dword [0x703700]
push dword [esp + 0xb0]
mov eax, dword [eax + 0x40]
call eax
mov eax, dword [0x703700]
push dword [esp + 0xbc]
mov eax, dword [eax + 0x40]
jmp 0x509a62
push dword [esp + 0x9c]
push dword [esp + 0xa8]
push eax
call fcn.006434e0
push dword [esp + 0xb4]
mov eax, dword [esp + 0xac]
push dword [esp + 0xc0]
add eax, dword [esp + 0x48]
push eax
call fcn.006434e0
push dword [esp + 0xcc]
mov eax, dword [esp + 0xc4]
add eax, dword [esp + 0xb8]
push dword [esp + 0xd8]
add eax, dword [esp + 0x54]
push eax
call fcn.006434e0
mov eax, dword [0x703700]
add esp, 0x24
push dword [esp + 0xa4]
mov eax, dword [eax + 0x40]
call eax
mov eax, dword [0x703700]
push dword [esp + 0xb0]
mov dword [esp + 0xa8], 0
mov dword [esp + 0xa0], 0
mov eax, dword [eax + 0x40]
call eax
mov eax, dword [0x703700]
push dword [esp + 0xbc]
mov dword [esp + 0xb4], 0
mov dword [esp + 0xac], 0
mov eax, dword [eax + 0x40]
call eax
push dword [esp + 0x2c]
mov dword [esp + 0xc0], 0
mov dword [esp + 0xb8], 0
call dword [sym.imp.WS2_32.dll_htons]
mov word [esp + 0x12], ax
lea eax, [esp + 0x24]
push eax
push 4
lea eax, [esp + 0x18]
push eax
push ebp
push edi
call fcn.004df2c0
add esp, 0x14
test eax, eax
jne 0x50a18d
cmp dword [esp + 0x24], 4
jne 0x50a18d
cmp byte [ebx + 0x624], 0
lea eax, [esp + 0x24]
push eax
je 0x509ef6
push 1
lea eax, [esp + 0x18]
mov byte [esp + 0x18], 0
push eax
push ebp
push edi
call fcn.004df2c0
add esp, 0x14
test eax, eax
jne 0x509ee3
cmp dword [esp + 0x24], 1
je 0x509f31
push str.Failed_to_send_SSPI_encryption_type.
push ebx
call fcn.004deb80
add esp, 8
jmp 0x50a1ae
push dword [esp + 0x30]
push dword [esp + 0x3c]
push ebp
push edi
call fcn.004df2c0
add esp, 0x14
test eax, eax
jne 0x50a186
mov eax, dword [esp + 0x2c]
cmp eax, dword [esp + 0x24]
jne 0x50a186
mov eax, dword [esp + 0x34]
test eax, eax
je 0x509f31
push eax
mov eax, dword [0x703700]
mov eax, dword [eax + 0x40]
call eax
lea eax, [esp + 0x28]
push eax
push 4
lea eax, [esp + 0x18]
push eax
push ebp
push edi
call fcn.00502aa0
add esp, 0x14
test eax, eax
jne 0x50a176
cmp dword [esp + 0x28], 4
jne 0x50a176
mov al, byte [esp + 0x11]
cmp al, 0xff
jne 0x509f80
movzx eax, byte [esp + 0x10]
push 0xff
push eax
push str.User_was_rejected_by_the_SOCKS5_server___u__u_.
push ebx
call fcn.004deb80
add esp, 0x10
jmp 0x50a1ae
cmp al, 2
je 0x509fa1
movzx eax, al
push eax
movzx eax, byte [esp + 0x14]
push eax
push str.Invalid_SSPI_encryption_response_type___u__u_.
push ebx
call fcn.004deb80
add esp, 0x10
jmp 0x50a1ae
push dword [esp + 0x12]
call dword [sym.imp.WS2_32.dll_ntohs]
movzx esi, ax
push esi
mov dword [esp + 0xa0], esi
call dword [0x6fd354]
add esp, 4
mov dword [esp + 0xa4], eax
test eax, eax
je 0x509a64
lea ecx, [esp + 0x28]
push ecx
push dword [esp + 0xa0]
push eax
push ebp
push edi
call fcn.00502aa0
add esp, 0x14
test eax, eax
jne 0x50a15f
cmp dword [esp + 0x28], esi
jne 0x50a15f
cmp byte [ebx + 0x624], al
jne 0x50a0ef
mov dword [esp + 0xa8], eax
mov dword [esp + 0xb0], eax
lea eax, [esp + 0x80]
push eax
push 0
lea eax, [esp + 0x64]
mov dword [esp + 0x68], 2
push eax
lea eax, [esp + 0x24]
mov dword [esp + 0xac], 0xa
push eax
mov eax, dword [0x703700]
mov dword [esp + 0xbc], 1
mov eax, dword [eax + 0x68]
call eax
push str.DecryptMessage
push eax
push edi
call fcn.0050a1e0
add esp, 0xc
test eax, eax
je 0x50a08b
mov eax, dword [esp + 0xa4]
test eax, eax
je 0x50a076
push eax
mov eax, dword [0x703700]
mov eax, dword [eax + 0x40]
call eax
mov eax, dword [esp + 0xb0]
test eax, eax
je 0x509d28
push eax
jmp 0x509d1e
mov eax, dword [esp + 0xa8]
cmp eax, 1
je 0x50a0c8
push eax
push str.Invalid_SSPI_encryption_response_length___lu_.
push ebx
call fcn.004deb80
mov eax, dword [esp + 0xb0]
add esp, 0xc
test eax, eax
je 0x50a0bc
push eax
mov eax, dword [0x703700]
mov eax, dword [eax + 0x40]
call eax
mov eax, dword [esp + 0xb0]
jmp 0x50a19f
mov eax, dword [esp + 0xb0]
push dword [esp + 0xa4]
mov al, byte [eax]
mov byte [esp + 0x14], al
mov eax, dword [0x703700]
mov eax, dword [eax + 0x40]
call eax
push dword [esp + 0xb0]
jmp 0x50a124
mov eax, dword [esp + 0x9c]
cmp eax, 1
je 0x50a116
push eax
push str.Invalid_SSPI_encryption_response_length___lu_.
push ebx
call fcn.004deb80
add esp, 0xc
push dword [esp + 0xa4]
jmp 0x50a1a4
mov ecx, dword [esp + 0xa4]
push ecx
mov al, byte [ecx]
mov byte [esp + 0x14], al
mov eax, dword [0x703700]
mov eax, dword [eax + 0x40]
call eax
mov al, byte [esp + 0x10]
test al, al
jne 0x50a13d
mov ecx, str.out_GSS_API_data
jmp 0x50a14c
cmp al, 1
mov ecx, str._GSS_API_integrity
mov edx, str._GSS_API_confidentiality
cmovne ecx, edx
push ecx
push str.SOCKS5_access_with_s_protection_granted._n
push ebx
call fcn.004decd0
add esp, 0xc
xor eax, eax
jmp 0x50a1c2
push str.Failed_to_receive_SSPI_encryption_type.
push ebx
call fcn.004deb80
add esp, 8
push dword [esp + 0xa4]
jmp 0x50a1a4
push str.Failed_to_receive_SSPI_encryption_response.
push ebx
call fcn.004deb80
add esp, 8
jmp 0x50a1ae
push str.Failed_to_send_SSPI_encryption_type.
jmp 0x50a192
push str.Failed_to_send_SSPI_encryption_request.
push ebx
call fcn.004deb80
mov eax, dword [esp + 0x3c]
add esp, 8
test eax, eax
je 0x50a1ae
push eax
mov eax, dword [0x703700]
mov eax, dword [eax + 0x40]
call eax
lea eax, [esp + 0x18]
push eax
mov eax, dword [0x703700]
mov eax, dword [eax + 0x24]
call eax
mov eax, 7
mov ecx, dword [esp + 0xc0]
pop edi
pop esi
pop ebp
pop ebx
xor ecx, esp
call fcn.00641b27
add esp, 0xb4
ret