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

Disassembly:
sub esp, 0x10
push ebx
mov ebx, dword [esp + 0x20]
push ebp
mov ebp, dword [esp + 0x1c]
push edi
mov edi, dword [esp + 0x24]
mov eax, dword [ebp + 0xc]
mov dword [esp + 0x18], eax
test ebx, ebx
je 0x4e9c18
cmp dword [ebx + 0x88], 4
jne 0x4e9bff
pop edi
pop ebp
xor eax, eax
pop ebx
add esp, 0x10
ret
test ebx, ebx
je 0x4e9c18
cmp dword [ebx + 0x88], 5
jne 0x4e9c18
pop edi
pop ebp
mov eax, 0x38
pop ebx
add esp, 0x10
ret
push esi
lea esi, [edi + 0x118]
nop
push 1
push 0
push edi
mov dword [esp + 0x24], esi
call fcn.004b0f80
add esp, 0xc
test edx, edx
jl 0x4ea0ea
jg 0x4e9c43
test eax, eax
je 0x4ea0ea
mov eax, dword [ebx + 0x88]
lea ebp, [ebx + 0x88]
mov ecx, ebp
mov dword [esp + 0x14], ecx
cmp eax, 3
ja case.default.0x4e9c66
mov esi, dword [esp + 0x18]
mov dword [esp + 0x14], ecx
jmp dword [eax*4 + 0x4ea170]
mov esi, dword [esp + 0x24]
push str.CONNECT_start
push esi
push edi
call fcn.004af8c0
mov eax, dword [esp + 0x24]
mov dword [esp + 0x20], 0
push dword [eax]
call dword [0x5bf144]
mov eax, dword [esp + 0x28]
push 1
push edi
push esi
mov dword [eax], 0
lea eax, [esp + 0x30]
push eax
call fcn.004e9690
mov esi, eax
add esp, 0x20
test esi, esi
jne 0x4e9d08
mov eax, dword [esp + 0x14]
push dword [eax + 0x10]
push str.Establish_HTTP_proxy_tunnel_to__s
push edi
call fcn.004af830
lea esi, [ebx + 0x60]
push esi
call fcn.004a17c0
mov eax, dword [esp + 0x34]
xor ecx, ecx
mov dword [ebx + 0x70], 0
mov dword [ebx + 0x74], 0
push esi
mov eax, dword [eax + 0xc]
cmp byte [eax + 0xa4], 1
setne cl
push ecx
push dword [esp + 0x2c]
call fcn.005091b0
add esp, 0x1c
mov esi, eax
test esi, esi
je 0x4e9d16
lea ebp, [ebx + 0x88]
push str.Failed_sending_CONNECT_to_proxy
push edi
call fcn.004af760
add esp, 8
mov eax, dword [esp + 0x14]
test eax, eax
je 0x4e9d27
push eax
call fcn.004c02c0
add esp, 4
test esi, esi
jne 0x4ea0ff
mov eax, dword [ebp]
cmp eax, 1
je case.0x4e9c66.1
sub eax, 1
jne 0x4e9d42
mov byte [edi + 0x145], al
push str.new_tunnel_state_connect
push dword [esp + 0x28]
push edi
call fcn.004af8c0
lea eax, [ebx + 0x50]
mov dword [ebp], 1
push eax
mov dword [ebx + 0x78], 1
call fcn.004a17c0
add esp, 0x10
mov ebp, dword [esp + 0x24]
push str.CONNECT_send
push ebp
push edi
call fcn.004af8c0
lea esi, [ebx + 0x60]
push esi
call fcn.004a17b0
push esi
mov dword [esp + 0x28], eax
call fcn.004a17a0
mov ecx, dword [ebx + 0x70]
xor esi, esi
add esp, 0x14
mov dword [esp + 0x18], eax
mov dword [esp + 0x10], esi
cmp eax, ecx
jbe 0x4e9e0c
mov esi, dword [esp + 0x14]
sub eax, dword [ebx + 0x70]
add esi, ecx
mov ecx, dword [ebp + 4]
lea ebp, [esp + 0x10]
push ebp
push eax
push esi
mov edx, dword [ecx]
push edi
push ecx
mov eax, dword [edx + 0x24]
call eax
mov ebp, dword [esp + 0x38]
add esp, 0x14
test eax, eax
jns 0x4e9dda
mov esi, dword [esp + 0x10]
cmp esi, 0x51
jne 0x4e9dee
xor esi, esi
mov dword [esp + 0x10], esi
jmp 0x4e9e08
add dword [ebx + 0x70], eax
push eax
push esi
push 2
push edi
call fcn.004af6c0
mov esi, dword [esp + 0x20]
add esp, 0x10
test esi, esi
je 0x4e9e08
push str.Failed_sending_CONNECT_to_proxy
push edi
call fcn.004af760
mov esi, dword [esp + 0x18]
add esp, 8
test esi, esi
jne 0x4e9e15
mov eax, dword [esp + 0x18]
cmp dword [ebx + 0x70], eax
jb 0x4e9e15
mov al, 1
jmp 0x4e9e17
xor al, al
mov byte [esp + 0x2c], al
test esi, esi
jne 0x4ea103
test al, al
je 0x4ea164
mov eax, dword [ebx + 0x88]
cmp eax, 2
je 0x4e9e60
sub eax, 1
jne 0x4e9e41
mov byte [edi + 0x145], al
push str.new_tunnel_state_receive
push ebp
push edi
call fcn.004af8c0
add esp, 0xc
mov dword [ebx + 0x88], 2
jmp 0x4e9e60
mov ebp, dword [esp + 0x24]
push str.CONNECT_receive
push ebp
push edi
call fcn.004af8c0
lea eax, [esp + 0x38]
push eax
push ebx
push edi
push ebp
call fcn.004ea530
push edi
mov esi, eax
call fcn.004c3790
add esp, 0x20
test eax, eax
jne 0x4ea004
test esi, esi
jne 0x4ea103
cmp byte [esp + 0x2c], al
je 0x4ea164
mov eax, dword [ebx + 0x88]
cmp eax, 3
je 0x4e9ed3
sub eax, 1
jne 0x4e9eb4
mov byte [edi + 0x145], al
push str.new_tunnel_state_response
push ebp
push edi
call fcn.004af8c0
add esp, 0xc
mov dword [ebx + 0x88], 3
jmp 0x4e9ed3
mov ebp, dword [esp + 0x24]
push str.CONNECT_response
push ebp
push edi
call fcn.004af8c0
lea esi, [edi + 0x118]
add esp, 0xc
cmp dword [esi], 0
je 0x4e9f3d
cmp byte [ebx + 0x8d], 0
jne 0x4ea00e
mov eax, dword [esp + 0x1c]
cmp byte [eax + 0x1ce], 0
jne 0x4ea00e
mov eax, dword [ebx + 0x88]
test eax, eax
je 0x4e9f3d
sub eax, 1
jne 0x4e9f20
mov byte [edi + 0x145], al
push str.new_tunnel_state_init
push ebp
push edi
call fcn.004af8c0
push ebx
push edi
push ebp
call fcn.004eabf0
add esp, 0x18
lea esi, [edi + 0x118]
lea ecx, [ebx + 0x88]
mov dword [esp + 0x14], ecx
jmp 0x4e9f4d
mov ebp, dword [esp + 0x24]
cmp dword [esi], 0
jne 0x4e9c20
mov eax, dword [edi + 0xdb4]
sub eax, 0xc8
cmp eax, 0x64
jb 0x4ea059
push 0
call dword [0x5bf144]
push 2
push dword [esp + 0x24]
mov dword [esi], 0
call fcn.004b0d90
mov esi, dword [esp + 0x20]
add esp, 0xc
mov eax, dword [esi]
cmp eax, 5
je 0x4e9fe3
sub eax, 1
jne 0x4e9f9c
mov byte [edi + 0x145], al
push str.new_tunnel_state_failed
push ebp
push edi
call fcn.004af8c0
lea eax, [ebx + 0x50]
mov dword [esi], 5
push eax
call fcn.004a17c0
lea eax, [ebx + 0x60]
push eax
call fcn.004a17c0
push dword [edi + 0xd54]
mov dword [edi + 0xdb0], 0
call dword [0x5bf144]
add esp, 0x18
mov dword [edi + 0xd54], 0
push dword [edi + 0xe0]
push str.CONNECT_tunnel_failed__response__d
push edi
call fcn.004af760
add esp, 0xc
mov eax, 0x38
pop esi
pop edi
pop ebp
pop ebx
add esp, 0x10
ret
mov esi, 0x2a
jmp 0x4ea103
push str.CONNECT_need_to_closeopen
push ebp
push edi
call fcn.004af8c0
push str.Connect_me_again_please
push edi
call fcn.004af830
push edi
push ebp
call fcn.004aeb60
push 0
push dword [esp + 0x3c]
call fcn.004b0d90
lea eax, [esp + 0x50]
push eax
push 0
push edi
push dword [ebp + 4]
call fcn.004aebe0
add esp, 0x34
mov esi, eax
test esi, esi
je 0x4ea164
jmp 0x4ea103
mov eax, dword [ecx]
cmp eax, 4
je 0x4ea0ca
sub eax, 1
jne 0x4ea06b
mov byte [edi + 0x145], al
push str.new_tunnel_state_established
push ebp
push edi
call fcn.004af8c0
push str.CONNECT_phase_completed
push edi
call fcn.004af830
mov esi, dword [esp + 0x28]
lea eax, [ebx + 0x50]
mov word [edi + 0x99c], 1
push eax
mov dword [esi], 4
call fcn.004a17c0
lea eax, [ebx + 0x60]
push eax
call fcn.004a17c0
push dword [edi + 0xd54]
mov dword [edi + 0xdb0], 0
call dword [0x5bf144]
add esp, 0x20
mov dword [edi + 0xd54], 0
push dword [edi + 0xdb4]
push str.CONNECT_tunnel_established__response__d
push edi
call fcn.004af830
add esp, 0xc
xor esi, esi
mov eax, esi
pop esi
pop edi
pop ebp
pop ebx
add esp, 0x10
ret
push str.Proxy_CONNECT_aborted_due_to_timeout
push edi
call fcn.004af760
add esp, 8
mov esi, 0x1c
jmp 0x4ea103
mov ebp, dword [esp + 0x24]
mov eax, dword [ebx + 0x88]
cmp eax, 5
je 0x4ea164
sub eax, 1
jne 0x4ea119
mov byte [edi + 0x145], al
push str.new_tunnel_state_failed
push ebp
push edi
call fcn.004af8c0
lea eax, [ebx + 0x50]
mov dword [ebx + 0x88], 5
push eax
call fcn.004a17c0
lea eax, [ebx + 0x60]
push eax
call fcn.004a17c0
push dword [edi + 0xd54]
mov dword [edi + 0xdb0], 0
call dword [0x5bf144]
add esp, 0x18
mov dword [edi + 0xd54], 0
mov eax, esi
pop esi
pop edi
pop ebp
pop ebx
add esp, 0x10
ret