Function at 0x502014
Capabilities:
Check http status code

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x38
mov eax, dword [ebp + 0xc]
and dword [ebp - 0x20], 0
push ebx
push esi
mov esi, dword [ebp + 8]
push edi
mov ebx, dword [esi + 0xc]
push ebx
mov eax, dword [ebx + eax*4 + 0x158]
mov edi, dword [ebx + 0x4d8]
mov dword [ebp - 0x1c], eax
call fcn.0050289d
pop ecx
test al, al
jne 0x5027e0
mov byte [ebx + 0x254], al
cmp dword [edi + 0x20], 0
jne 0x5021fe
push dword [ebp + 0x14]
and dword [ebp - 0xc], 0
push dword [ebp + 0x10]
and dword [ebp - 8], 0
push str.Establish_HTTP_proxy_tunnel_to__s:_d_n
push esi
call fcn.004faf6d
push dword [esi + 0x130]
call dword [0x637f5c]
and dword [esi + 0x130], 0
lea eax, [ebp - 0x38]
push 0x20000
push eax
call fcn.004f714f
lea eax, [ebp - 8]
push eax
lea eax, [ebp - 0xc]
push eax
push dword [ebp + 0x14]
push dword [ebp + 0x10]
push ebx
push esi
call fcn.005027fd
add esp, 0x34
test eax, eax
jne 0x5027e2
push 1
push dword [ebp - 0xc]
push eax
push str.CONNECT
push ebx
push esi
call fcn.004ff514
add esp, 0x18
mov dword [ebp - 4], eax
test eax, eax
jne 0x5021ce
cmp dword [ebx + 0xc0], 1
mov ecx, 0x5fec60
push str.Proxy_Connection
mov eax, 0x5fec64
mov dword [ebp - 4], 0x59e6b8
cmovne eax, ecx
push ebx
push esi
mov dword [ebp - 0x18], eax
call fcn.004fe2b9
test eax, eax
mov ecx, str.Proxy_Connection:_Keep_Alive_r_n
push str.User_Agent
mov eax, 0x59e6b8
cmovne ecx, eax
push ebx
push esi
mov dword [ebp - 0x14], ecx
call fcn.004fe2b9
add esp, 0x18
test eax, eax
jne 0x502133
cmp dword [esi + 0x5b0], eax
je 0x502133
mov eax, dword [esi + 0xc90]
mov dword [ebp - 4], eax
push dword [ebp - 0x14]
mov eax, dword [esi + 0xc8c]
mov edx, 0x59e6b8
push dword [ebp - 4]
test eax, eax
mov ecx, edx
cmovne ecx, eax
cmp dword [ebp - 8], 0
push ecx
mov eax, edx
cmovne eax, dword [ebp - 8]
push eax
push dword [ebp - 0x18]
lea eax, [ebp - 0x38]
push dword [ebp - 0xc]
push str.CONNECT__s_HTTP__s_r_n_s_s_s_s
push eax
call fcn.004f7112
add esp, 0x20
mov dword [ebp - 4], eax
test eax, eax
jne 0x5021c1
lea eax, [ebp - 0x38]
push eax
push 1
push esi
call fcn.004fdcd1
add esp, 0xc
mov dword [ebp - 4], eax
test eax, eax
jne 0x5021c1
lea eax, [ebp - 0x38]
push 0x5a28bc
push eax
call fcn.004f70ef
mov dword [ebp - 4], eax
pop ecx
pop ecx
test eax, eax
jne 0x5021c1
push dword [ebp + 0xc]
push eax
lea eax, [esi + 0xce8]
push eax
lea eax, [ebp - 0x38]
push esi
push eax
call fcn.004fe0b2
add esp, 0x14
mov dword [ebp - 4], eax
test eax, eax
je 0x5021ce
push str.Failed_sending_CONNECT_to_proxy
push esi
call fcn.004faec1
pop ecx
pop ecx
push dword [ebp - 8]
call dword [0x637f5c]
push dword [ebp - 0xc]
call dword [0x637f5c]
lea eax, [ebp - 0x38]
push eax
call fcn.004f7132
mov eax, dword [ebp - 4]
add esp, 0xc
test eax, eax
jne 0x5027e2
mov dword [edi + 0x20], 1
push 1
push 0
push esi
call fcn.004fb71f
add esp, 0xc
test edx, edx
jl 0x5027eb
jg 0x50221d
test eax, eax
je 0x5027eb
push dword [ebp + 0xc]
push ebx
call fcn.004fb684
pop ecx
pop ecx
test al, al
je 0x5027e0
and dword [ebp - 8], 0
jmp 0x5025f3
lea eax, [ebp - 0x10]
push eax
push 1
lea eax, [ebp + 0xb]
push eax
push dword [ebp - 0x1c]
push esi
call fcn.004fb020
add esp, 0x14
mov dword [ebp - 0x18], eax
cmp eax, 0x51
je 0x5027e0
push esi
call fcn.00500dbf
pop ecx
test eax, eax
jne 0x5027e7
cmp dword [ebp - 0x18], eax
jne 0x502639
cmp dword [ebp - 0x10], eax
jle 0x5025ff
cmp dword [edi + 0x10], 2
jne 0x5022f0
mov ecx, dword [edi + 0x18]
mov eax, ecx
mov edx, dword [edi + 0x1c]
or eax, edx
je 0x5022b6
sub ecx, 1
mov dword [edi + 0x18], ecx
sbb edx, 0
mov dword [edi + 0x1c], edx
js 0x5022aa
jg 0x5025f3
test ecx, ecx
jne 0x5025f3
mov dword [edi + 0x20], 2
jmp 0x502639
and dword [ebp - 0x18], 0
lea eax, [ebp - 0x24]
push eax
lea eax, [ebp - 0x18]
push eax
push 1
lea eax, [ebp + 0xb]
push eax
push esi
call fcn.0050db88
add esp, 0x14
cmp eax, 0xffffffff
jne 0x5025f3
push str.chunk_reading_DONE_n
push esi
call fcn.004faf6d
and dword [edi + 0x10], 0
pop ecx
pop ecx
jmp 0x5025ec
push 1
lea eax, [ebp + 0xb]
push eax
push edi
call fcn.004f7129
add esp, 0xc
test eax, eax
jne 0x5026bc
cmp byte [ebp + 0xb], 0xa
jne 0x5025f3
push edi
call fcn.0045673f
push edi
mov dword [ebp - 4], eax
call fcn.0045f62f
push eax
push dword [ebp - 4]
mov dword [ebp - 0xc], eax
push 1
push esi
call fcn.004fae3d
add esp, 0x18
cmp byte [esi + 0x705], 0
jne 0x502361
push dword [ebp - 0xc]
xor eax, eax
cmp byte [esi + 0x6ec], al
push dword [ebp - 4]
setne al
add eax, 2
push eax
push esi
call fcn.004fae10
add esp, 0x10
test eax, eax
jne 0x5027e2
mov eax, dword [ebp - 0xc]
cdq
add dword [esi + 0xce0], eax
mov eax, dword [ebp - 4]
adc dword [esi + 0xce4], edx
mov cl, byte [eax]
cmp cl, 0xd
je 0x502544
cmp cl, 0xa
je 0x502544
push 0x11
push eax
push str.WWW_Authenticate:
call fcn.004fbfeb
add esp, 0xc
test eax, eax
je 0x5023ac
mov eax, dword [esi + 0xf8]
mov dword [ebp - 0xc], eax
cmp eax, 0x191
je 0x5023d2
push 0x13
push dword [ebp - 4]
push str.Proxy_authenticate:
call fcn.004fbfeb
add esp, 0xc
test eax, eax
je 0x50241a
mov eax, dword [esi + 0xf8]
mov dword [ebp - 0xc], eax
cmp eax, 0x197
jne 0x50241a
push dword [ebp - 4]
call fcn.004fe3c5
mov dword [ebp - 0x18], eax
pop ecx
test eax, eax
je 0x5026b5
cmp dword [ebp - 0xc], 0x197
push eax
sete cl
movzx ecx, cl
push ecx
push esi
call fcn.004ff253
push dword [ebp - 0x18]
mov dword [ebp - 0x14], eax
call dword [0x637f5c]
mov eax, dword [ebp - 0x14]
add esp, 0x10
test eax, eax
jne 0x5027e2
jmp 0x502538
push 0xf
push dword [ebp - 4]
push str.Content_Length:
call fcn.004fbfeb
add esp, 0xc
test eax, eax
je 0x50246e
mov ecx, dword [esi + 0xf8]
lea eax, [ecx - 0xc8]
cmp eax, 0x64
jae 0x502452
push ecx
push str.Ignoring_Content_Length_in_CONNECT__03d_response_n
push esi
call fcn.004faf6d
jmp 0x5024e8
lea eax, [edi + 0x18]
push eax
mov eax, dword [ebp - 4]
push 0xa
add eax, 0xf
push 0
push eax
call fcn.00504054
add esp, 0x10
jmp 0x502538
push str.close
push str.Connection:
push dword [ebp - 4]
call fcn.004fe323
add esp, 0xc
test al, al
jne 0x502534
push 0x12
push dword [ebp - 4]
push str.Transfer_Encoding:
call fcn.004fbfeb
add esp, 0xc
test eax, eax
je 0x5024ed
mov ecx, dword [esi + 0xf8]
lea eax, [ecx - 0xc8]
cmp eax, 0x64
jae 0x5024ba
push ecx
push str.Ignoring_Transfer_Encoding_in_CONNECT__03d_response_n
jmp 0x502447
push str.chunked
push str.Transfer_Encoding:
push dword [ebp - 4]
call fcn.004fe323
add esp, 0xc
test al, al
je 0x502538
push str.CONNECT_responded_chunked_n
push esi
call fcn.004faf6d
push esi
mov byte [edi + 0x24], 1
call fcn.0050db63
add esp, 0xc
jmp 0x502538
push str.close
push str.Proxy_Connection:
push dword [ebp - 4]
call fcn.004fe323
add esp, 0xc
test al, al
jne 0x502534
lea eax, [esi + 0xf8]
push eax
lea eax, [ebp - 0x20]
push eax
push str.HTTP_1._d__d
push dword [ebp - 4]
call fcn.00471a9e
add esp, 0x10
cmp eax, 2
jne 0x502538
mov eax, dword [esi + 0xf8]
mov dword [esi + 0xccc], eax
jmp 0x502538
mov byte [edi + 0x25], 1
push edi
call fcn.004f7167
pop ecx
jmp 0x5025f3
cmp dword [esi + 0xf8], 0x197
jne 0x5025d6
cmp byte [esi + 0xcb9], 0
jne 0x5025d6
mov eax, dword [edi + 0x18]
or eax, dword [edi + 0x1c]
mov dword [edi + 0x10], 2
je 0x502582
push dword [edi + 0x1c]
push dword [edi + 0x18]
push str.Ignore__I64d_bytes_of_response_body_n
push esi
call fcn.004faf6d
add esp, 0x10
jmp 0x5025da
cmp byte [edi + 0x24], 0
je 0x5025d6
push str.Ignore_chunked_response_body_n
push esi
call fcn.004faf6d
mov ecx, dword [ebp - 4]
mov byte [esi + 0x147], 1
lea eax, [ecx + 1]
cmp byte [eax], 0xa
cmove ecx, eax
lea eax, [ebp - 0x28]
push eax
lea eax, [ebp - 0x10]
push eax
push 1
lea eax, [ecx + 1]
push eax
push esi
call fcn.0050db88
add esp, 0x1c
cmp eax, 0xffffffff
jne 0x5025da
push str.chunk_reading_DONE_n
push esi
call fcn.004faf6d
pop ecx
pop ecx
mov dword [edi + 0x20], 2
and dword [edi + 0x10], 0
cmp dword [edi + 0x10], 0
jne 0x502239
mov eax, dword [edi + 0x18]
or eax, dword [edi + 0x1c]
jne 0x5025f3
mov dword [edi + 0x20], 2
cmp dword [edi + 0x10], 0
jne 0x502239
jmp 0x50263d
cmp dword [esi + 0x178], 0
je 0x502625
cmp dword [esi + 0x990], 0
je 0x502625
push str.Proxy_CONNECT_connection_closed_n
push esi
mov byte [ebx + 0x254], 1
call fcn.004faf6d
jmp 0x502637
push str.Proxy_CONNECT_aborted
push esi
mov dword [ebp - 8], 1
call fcn.004faec1
pop ecx
pop ecx
and dword [edi + 0x10], 0
push esi
call fcn.00500dbf
pop ecx
test eax, eax
jne 0x5027e7
cmp dword [ebp - 8], eax
jne 0x5026c9
mov eax, dword [esi + 0xccc]
sub eax, 0xc8
cmp eax, 0x64
jb 0x50267c
push esi
call fcn.004fe477
pop ecx
test eax, eax
jne 0x5027e2
cmp byte [ebx + 0x255], al
je 0x50267c
mov byte [edi + 0x25], 1
cmp byte [edi + 0x25], 0
je 0x50268b
cmp dword [esi + 0x130], 0
jne 0x5026d0
mov eax, dword [esi + 0x130]
test eax, eax
je 0x5026ef
cmp dword [edi + 0x20], 2
jne 0x5026ab
push 1
push esi
call fcn.00502ac4
mov eax, dword [esi + 0x130]
pop ecx
pop ecx
test eax, eax
jne 0x50204f
jmp 0x5026ef
push 0x1b
jmp 0x5027fa
push str.CONNECT_response_too_large_
push esi
call fcn.004faec1
pop ecx
pop ecx
push 0x38
jmp 0x5027fa
mov eax, dword [ebp + 0xc]
push dword [ebx + eax*4 + 0x158]
push ebx
push esi
call fcn.004fb612
mov eax, dword [ebp + 0xc]
add esp, 0xc
or dword [ebx + eax*4 + 0x158], 0xffffffff
mov eax, dword [esi + 0xccc]
sub eax, 0xc8
cmp eax, 0x64
jb 0x502795
cmp byte [edi + 0x25], 0
je 0x50272f
cmp dword [esi + 0x130], 0
je 0x50272f
push str.Connect_me_again_please_n
push esi
mov byte [ebx + 0x254], 1
call fcn.004faf6d
push esi
call fcn.00502a95
add esp, 0xc
jmp 0x502769
push dword [esi + 0x130]
call dword [0x637f5c]
and dword [esi + 0x130], 0
push 2
push ebx
call fcn.004fb6d6
mov eax, dword [ebp + 0xc]
push dword [ebx + eax*4 + 0x158]
push ebx
push esi
call fcn.004fb612
mov eax, dword [ebp + 0xc]
add esp, 0x18
or dword [ebx + eax*4 + 0x158], 0xffffffff
and dword [edi + 0x20], 0
cmp byte [ebx + 0x254], 0
jne 0x5027e0
push edi
call fcn.004f7132
push dword [esi + 0xf8]
push str.Received_HTTP_code__d_from_proxy_after_CONNECT
push esi
call fcn.004faec1
add esp, 0x10
jmp 0x5026c9
mov dword [edi + 0x20], 2
push dword [esi + 0xc8c]
call dword [0x637f5c]
push dword [esi + 0xccc]
and dword [esi + 0xc8c], 0
push str.Proxy_replied__d_to_CONNECT_request_n
push esi
mov word [esi + 0x994], 1
call fcn.004faf6d
mov byte [esi + 0x147], 0
push edi
mov byte [ebx + 0x262], 0
call fcn.004f7132
add esp, 0x14
xor eax, eax
pop edi
pop esi
pop ebx
leave
ret
push 0x2a
jmp 0x5027fa
push str.Proxy_CONNECT_aborted_due_to_timeout
push esi
call fcn.004faec1
pop ecx
pop ecx
push 0x1c
pop eax
jmp 0x5027e2