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

Disassembly:
push ecx
push ebx
mov ebx, dword [esp + 0xc]
push ebp
push edi
mov edi, dword [esp + 0x1c]
mov ebp, dword [ebx + 0xc]
mov dword [esp + 0xc], ebp
test edi, edi
je 0x10050ce8
mov eax, dword [edi + 0x88]
cmp eax, 4
jne 0x10050cd9
pop edi
pop ebp
xor eax, eax
pop ebx
pop ecx
ret
cmp eax, 5
jne 0x10050ce8
pop edi
pop ebp
mov eax, 0x38
pop ebx
pop ecx
ret
push esi
mov esi, dword [esp + 0x1c]
lea ecx, [ecx]
push 1
push 0
push esi
call fcn.10021c60
add esp, 0xc
test edx, edx
jl 0x1005103b
jg 0x10050d0f
test eax, eax
je 0x1005103b
mov eax, dword [edi + 0x88]
cmp eax, 3
ja case.default.0x10050d1e
jmp dword [eax*4 + 0x100510b8]
push str.CONNECT_start
push ebx
push esi
call fcn.100202f0
push edi
push esi
push ebx
call fcn.100518c0
mov ebp, eax
add esp, 0x18
test ebp, ebp
jne 0x1005104e
mov eax, dword [edi + 0x88]
cmp eax, 1
je case.0x10050d1e.1
dec eax
jne 0x10050d5a
mov byte [esi + 0x141], al
push str.new_tunnel_state_connect
push ebx
push esi
call fcn.100202f0
lea eax, [edi + 0x50]
mov dword [edi + 0x88], 1
push eax
mov dword [edi + 0x78], 1
call fcn.10014180
add esp, 0x10
push str.CONNECT_send
push ebx
push esi
call fcn.100202f0
lea eax, [esp + 0x24]
push eax
push edi
push esi
push ebx
call fcn.10051800
mov ebp, eax
add esp, 0x1c
test ebp, ebp
jne 0x1005104e
cmp byte [esp + 0x18], al
je 0x100510ad
mov eax, dword [edi + 0x88]
cmp eax, 2
je case.0x10050d1e.2
dec eax
jne 0x10050dc7
mov byte [esi + 0x141], al
push str.new_tunnel_state_receive
push ebx
push esi
call fcn.100202f0
add esp, 0xc
mov dword [edi + 0x88], 2
push str.CONNECT_receive
push ebx
push esi
call fcn.100202f0
lea eax, [esp + 0x24]
push eax
push edi
push esi
push ebx
call fcn.10051490
push esi
mov ebp, eax
call fcn.10031d10
add esp, 0x20
test eax, eax
jne 0x10050f58
test ebp, ebp
jne 0x1005104e
cmp byte [esp + 0x18], al
je 0x100510ad
mov eax, dword [edi + 0x88]
cmp eax, 3
je 0x10050e4b
dec eax
jne 0x10050e32
mov byte [esi + 0x141], al
push str.new_tunnel_state_response
push ebx
push esi
call fcn.100202f0
add esp, 0xc
mov dword [edi + 0x88], 3
mov ebp, dword [esp + 0x10]
push str.CONNECT_response
push ebx
push esi
call fcn.100202f0
add esp, 0xc
cmp dword [esi + 0x110], 0
je 0x10050e9b
cmp byte [edi + 0x8d], 0
jne 0x10050f62
cmp byte [ebp + 0x1e6], 0
jne 0x10050f62
push esi
push 0
push edi
push ebx
call fcn.100510d0
add esp, 0x10
cmp dword [esi + 0x110], 0
jne 0x10050cf0
mov eax, 0x51eb851f
imul dword [esi + 0xd7c]
sar edx, 5
mov eax, edx
shr eax, 0x1f
add eax, edx
cmp eax, 2
je 0x10050faa
push dword [esi + 0x110]
call dword [0x100b9038]
push 2
push ebp
mov dword [esi + 0x110], 0
call fcn.10021a70
mov eax, dword [edi + 0x88]
add esp, 0xc
cmp eax, 5
je 0x10050f39
dec eax
jne 0x10050eee
mov byte [esi + 0x141], al
push str.new_tunnel_state_failed
push ebx
push esi
call fcn.100202f0
lea eax, [edi + 0x50]
mov dword [edi + 0x88], 5
push eax
call fcn.10014180
lea eax, [edi + 0x60]
push eax
call fcn.10014180
push dword [esi + 0xd18]
mov dword [esi + 0xd78], 0
call dword [0x100b9038]
add esp, 0x18
mov dword [esi + 0xd18], 0
push dword [esi + 0xd8]
push str.CONNECT_tunnel_failed__response__d
push esi
call fcn.10020190
add esp, 0xc
mov eax, 0x38
pop esi
pop edi
pop ebp
pop ebx
pop ecx
ret
mov ebp, 0x2a
jmp 0x1005104e
push str.CONNECT_need_to_closeopen
push ebx
push esi
call fcn.100202f0
push str.Connect_me_again_please
push esi
call fcn.10020260
push esi
push ebx
call fcn.1001f3a0
push 0
push ebp
call fcn.10021a70
lea eax, [esp + 0x3c]
push eax
push 0
push esi
push dword [ebx + 4]
call fcn.1001f420
mov ebp, eax
add esp, 0x34
test ebp, ebp
je 0x100510ad
jmp 0x1005104e
mov eax, dword [edi + 0x88]
cmp eax, 4
je 0x1005101d
dec eax
jne 0x10050fbe
mov byte [esi + 0x141], al
push str.new_tunnel_state_established
push ebx
push esi
call fcn.100202f0
push str.CONNECT_phase_completed
push esi
call fcn.10020260
lea eax, [edi + 0x50]
mov word [esi + 0x98c], 1
push eax
mov dword [edi + 0x88], 4
call fcn.10014180
lea eax, [edi + 0x60]
push eax
call fcn.10014180
push dword [esi + 0xd18]
mov dword [esi + 0xd78], 0
call dword [0x100b9038]
add esp, 0x20
mov dword [esi + 0xd18], 0
push dword [esi + 0xd7c]
push str.CONNECT_tunnel_established__response__d
push esi
call fcn.10020260
add esp, 0xc
xor ebp, ebp
mov eax, ebp
pop esi
pop edi
pop ebp
pop ebx
pop ecx
ret
push str.Proxy_CONNECT_aborted_due_to_timeout
push esi
call fcn.10020190
add esp, 8
mov ebp, 0x1c
mov eax, dword [edi + 0x88]
cmp eax, 5
je 0x100510ad
dec eax
jne 0x10051062
mov byte [esi + 0x141], al
push str.new_tunnel_state_failed
push ebx
push esi
call fcn.100202f0
lea eax, [edi + 0x50]
mov dword [edi + 0x88], 5
push eax
call fcn.10014180
lea eax, [edi + 0x60]
push eax
call fcn.10014180
push dword [esi + 0xd18]
mov dword [esi + 0xd78], 0
call dword [0x100b9038]
add esp, 0x18
mov dword [esi + 0xd18], 0
pop esi
pop edi
mov eax, ebp
pop ebp
pop ebx
pop ecx
ret