Function at 0x4208c0
Capabilities:
Check for time delay via gettickcount
Check http status code
Get socket status

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x36c
push ebx
push esi
push edi
mov edi, dword [ebp + 8]
mov eax, dword [edi]
xor esi, esi
mov dword [esp + 0x54], esi
mov dword [esp + 0x10], eax
mov eax, dword [eax + 0x174]
mov dword [esp + 0x4c], eax
cmp eax, esi
jne 0x4208f4
mov dword [esp + 0x4c], 0x36ee80
mov eax, dword [edi + 0xc8]
mov dword [esp + 0x44], eax
mov dword [esp + 0x38], esi
mov dword [esp + 0x3c], esi
mov byte [esp + 0xf], 0
mov byte [esp + 0x1b], 0
mov dword [esp + 0x48], esi
mov byte [edi + 0x132], 0
jmp 0x420920
cmp byte [edi + 0x129], 0
jne 0x420b41
movzx ebx, word [ebp + 0x10]
mov ecx, dword [ebp + 0xc]
push ebx
push ecx
mov ecx, dword [esp + 0x18]
push str.Establish_HTTP_proxy_tunnel_to__s:_hu_n
call fcn.00415780
mov edx, dword [esp + 0x1c]
mov eax, dword [edx + 0xcc]
add esp, 0xc
cmp eax, esi
je 0x420969
push eax
call dword [0x4511ac]
mov eax, dword [esp + 0x14]
add esp, 4
mov dword [eax + 0xcc], esi
push 0xc
push 1
call dword [0x4511b8]
mov esi, eax
add esp, 8
test esi, esi
je 0x4211f0
mov ecx, dword [ebp + 0xc]
push ebx
push ecx
push str._s:_hu
call fcn.0041b760
add esp, 0xc
mov dword [esp + 0x1c], eax
test eax, eax
je 0x4211e6
push 1
push eax
push str.CONNECT
mov eax, edi
call fcn.00420160
mov ebx, eax
add esp, 0xc
test ebx, ebx
jne 0x420b0f
mov edx, dword [ebp + 8]
cmp dword [edx + 0xac], 1
mov edi, 0x445452
mov dword [esp + 0x20], edi
mov dword [esp + 0x28], edi
mov dword [esp + 0x24], 0x449af0
je 0x4209e3
mov dword [esp + 0x24], 0x449af4
mov eax, dword [esp + 0x10]
push eax
mov ebx, str.Host:
call fcn.0041fad0
add esp, 4
test eax, eax
jne 0x420a15
mov ebx, dword [esp + 0x1c]
push ebx
push str.Host:__s_r_n
call fcn.0041b760
mov edi, eax
add esp, 8
test edi, edi
je 0x4211fc
mov ecx, dword [esp + 0x10]
push ecx
mov ebx, str.Proxy_Connection:
call fcn.0041fad0
add esp, 4
test eax, eax
jne 0x420a33
mov dword [esp + 0x20], str.Proxy_Connection:_Keep_Alive_r_n
mov edx, dword [esp + 0x10]
push edx
mov ebx, str.User_Agent:
call fcn.0041fad0
add esp, 4
test eax, eax
jne 0x420a63
mov eax, dword [esp + 0x10]
cmp dword [eax + 0x30c], 0
je 0x420a63
mov ecx, dword [ebp + 8]
mov edx, dword [ecx + 0x144]
mov dword [esp + 0x28], edx
mov eax, dword [ebp + 8]
mov eax, dword [eax + 0x140]
test eax, eax
jne 0x420a75
mov eax, 0x445452
mov ecx, dword [esp + 0x20]
mov edx, dword [esp + 0x28]
push ecx
mov ecx, dword [ebp + 0xc]
push edx
push eax
mov eax, dword [esp + 0x30]
push edi
push eax
movzx eax, word [ebp + 0x10]
push eax
push ecx
push str.CONNECT__s:_hu_HTTP__s_r_n_s_s_s_s
mov eax, esi
call fcn.004206b0
add esp, 0x20
mov ebx, eax
test edi, edi
je 0x420ab3
cmp byte [edi], 0
je 0x420ab3
push edi
call dword [0x4511ac]
add esp, 4
test ebx, ebx
jne 0x420af8
mov ebx, dword [ebp + 8]
push esi
call fcn.00421570
mov ebx, eax
add esp, 4
test ebx, ebx
jne 0x420af8
push 0x448450
mov eax, esi
call fcn.004206b0
mov ebx, eax
add esp, 4
test ebx, ebx
jne 0x420af8
mov edx, dword [esp + 0x10]
mov edi, dword [ebp + 8]
push eax
add edx, 0x85b0
push edx
push esi
call fcn.004204a0
add esp, 0xc
mov ebx, eax
xor esi, esi
test ebx, ebx
je 0x420b0f
mov eax, dword [esp + 0x10]
push str.Failed_sending_CONNECT_to_proxy
call fcn.00415840
add esp, 4
mov eax, dword [esp + 0x1c]
push eax
call dword [0x4511ac]
add esp, 4
test esi, esi
je 0x420b2b
push esi
call dword [0x4511ac]
add esp, 4
test ebx, ebx
jne 0x42121c
mov ecx, dword [ebp + 8]
mov byte [ecx + 0x129], 1
mov edi, ecx
xor esi, esi
call dword [sym.imp.KERNEL32.dll_GetTickCount]
mov ecx, eax
mov eax, 0x10624dd3
mul ecx
mov ebx, edx
shr ebx, 6
mov edx, ebx
imul edx, edx, 0x3e8
sub ecx, edx
imul ecx, ecx, 0x3e8
mov eax, ecx
sub eax, dword [edi + 0xbc]
mov ecx, dword [edi + 0xb8]
mov edx, eax
mov eax, 0x10624dd3
imul edx
sub ecx, ebx
imul ecx, ecx, 0x3e8
sar edx, 6
mov eax, edx
shr eax, 0x1f
add eax, edx
sub ecx, eax
add ecx, dword [esp + 0x4c]
test ecx, ecx
jle 0x421225
mov ecx, dword [esp + 0x10]
cmp dword [ecx + 0x470], 2
jne 0x420c66
mov ebx, dword [esp + 0x44]
cmp ebx, 0xffffffff
je 0x4212e0
mov eax, 1
mov dword [esp + 0x16c], ebx
mov dword [esp + 0x64], ebx
mov dword [esp + 0x168], eax
mov dword [esp + 0x60], eax
mov dword [esp + 0x270], esi
inc ebx
lea ecx, [ecx]
lea edx, [esp + 0x58]
push edx
lea eax, [esp + 0x64]
push eax
lea ecx, [esp + 0x278]
push ecx
lea edx, [esp + 0x174]
push edx
push ebx
mov dword [esp + 0x6c], esi
mov dword [esp + 0x70], esi
call dword [sym.imp.WS2_32.dll_select]
cmp eax, 0xffffffff
jne 0x420c21
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
cmp eax, esi
je 0x420be0
cmp eax, 0x2714
je 0x420be0
jmp 0x420c66
cmp eax, esi
jl 0x420c66
je 0x4212e0
mov ecx, dword [esp + 0x44]
lea eax, [esp + 0x168]
push eax
push ecx
xor ebx, ebx
call sub.WS2_32.dll___WSAFDIsSet
test eax, eax
je 0x420c48
mov ebx, 1
mov eax, dword [esp + 0x44]
lea edx, [esp + 0x60]
push edx
push eax
call sub.WS2_32.dll___WSAFDIsSet
test eax, eax
je 0x420c5e
or ebx, 4
cmp ebx, esi
je 0x4212e0
mov eax, dword [esp + 0x10]
add eax, 0x48c
mov byte [edi + 0x129], 0
mov dword [esp + 0x50], eax
mov dword [esp + 0x1c], eax
mov dword [esp + 0x24], eax
mov dword [esp + 0x28], esi
mov dword [esp + 0x2c], esi
mov dword [esp + 0x14], 1
cmp dword [esp + 0x14], 0
je 0x421185
cmp dword [esp + 0x48], 0
jne 0x421236
call dword [sym.imp.KERNEL32.dll_GetTickCount]
mov ecx, eax
mov eax, 0x10624dd3
mul ecx
mov esi, edx
mov edi, dword [ebp + 8]
shr esi, 6
mov edx, esi
imul edx, edx, 0x3e8
sub ecx, edx
imul ecx, ecx, 0x3e8
mov eax, ecx
sub eax, dword [edi + 0xbc]
mov ecx, dword [edi + 0xb8]
mov edx, eax
mov eax, 0x10624dd3
imul edx
sub ecx, esi
imul ecx, ecx, 0x3e8
sar edx, 6
mov eax, edx
shr eax, 0x1f
add eax, edx
sub ecx, eax
add ecx, dword [esp + 0x4c]
test ecx, ecx
jle 0x421225
cmp ecx, 0x3e8
jl 0x420d13
mov ecx, 0x3e8
mov ebx, dword [esp + 0x44]
push 0xffffffffffffffff
push ebx
mov eax, ecx
call fcn.0041db20
add esp, 8
cmp eax, 0xffffffff
je 0x42114a
test eax, eax
je 0x421163
mov eax, dword [esp + 0x1c]
lea ecx, [esp + 0x30]
push ecx
mov edx, 0x4000
sub edx, dword [esp + 0x2c]
push eax
mov esi, edi
call fcn.00415bd0
add esp, 8
test eax, eax
jl 0x421177
xor esi, esi
cmp eax, esi
je 0x420d69
mov dword [esp + 0x14], esi
jmp 0x421163
mov eax, dword [esp + 0x30]
cmp eax, esi
jg 0x420d9f
mov eax, dword [esp + 0x10]
mov dword [esp + 0x14], esi
cmp dword [eax + 0x108], esi
je 0x420d95
cmp dword [eax + 0x8524], esi
je 0x420d95
mov byte [edi + 0x132], 1
jmp 0x421163
push str.Proxy_CONNECT_aborted
jmp 0x421153
add dword [esp + 0x28], eax
cmp dword [esp + 0x14], 1
jle 0x420e3f
mov edi, dword [esp + 0x38]
mov ecx, dword [esp + 0x3c]
or edi, ecx
mov edx, dword [esp + 0x50]
mov dword [esp + 0x28], esi
mov dword [esp + 0x1c], edx
je 0x420dee
cdq
sub dword [esp + 0x38], eax
sbb ecx, edx
cmp ecx, esi
mov dword [esp + 0x3c], ecx
jg 0x421163
jl 0x420de5
cmp dword [esp + 0x38], esi
ja 0x421163
mov dword [esp + 0x14], esi
jmp 0x421163
mov eax, dword [esp + 0x30]
mov edi, dword [ebp + 8]
lea ecx, [esp + 0x20]
push ecx
push eax
push edx
mov dword [esp + 0x2c], esi
call fcn.00424bd0
add esp, 0xc
cmp eax, 0xffffffff
jne 0x420e24
mov ecx, dword [esp + 0x10]
push str.chunk_reading_DONE_n
call fcn.00415780
mov dword [esp + 0x18], esi
jmp 0x421160
mov ecx, dword [esp + 0x20]
push ecx
mov ecx, dword [esp + 0x14]
push str.Read__zd_bytes_of_chunk__continue_n
call fcn.00415780
add esp, 8
jmp 0x421163
cmp eax, esi
mov dword [esp + 0x20], esi
jle 0x421163
mov edi, dword [esp + 0x24]
nop
mov edx, dword [esp + 0x1c]
inc dword [esp + 0x2c]
cmp byte [edx], 0xa
jne 0x421025
mov esi, dword [esp + 0x10]
cmp byte [esi + 0x278], 0
je 0x420e85
mov eax, dword [ebp + 8]
mov ecx, dword [esp + 0x2c]
push eax
push ecx
push edi
mov ebx, 1
call fcn.00415d10
add esp, 0xc
cmp byte [esi + 0x26b], 0
mov edx, 2
je 0x420e98
mov edx, 3
mov ebx, dword [ebp + 8]
mov ecx, dword [esp + 0x2c]
push edi
mov eax, ebx
call fcn.00415a80
add esp, 4
test eax, eax
jne 0x4212e2
mov al, byte [edi]
cmp al, 0xd
je 0x421041
cmp al, 0xa
je 0x421041
mov eax, dword [esp + 0x2c]
mov dl, byte [eax + edi]
mov byte [eax + edi], 0
push 0x11
mov eax, edi
mov ecx, str.WWW_Authenticate:
mov byte [esp + 0x3b], dl
call fcn.0041edf0
add esp, 4
test eax, eax
je 0x420ef5
mov eax, dword [esi + 0x90]
cmp eax, 0x191
je 0x420f17
push 0x13
mov eax, edi
mov ecx, str.Proxy_authenticate:
call fcn.0041edf0
add esp, 4
test eax, eax
je 0x420f30
mov eax, dword [esi + 0x90]
cmp eax, 0x197
jne 0x420f30
push eax
push ebx
mov eax, edi
call fcn.00420250
add esp, 8
test eax, eax
jne 0x4212e2
jmp 0x421007
push 0xf
mov eax, edi
mov ecx, str.Content_Length:
call fcn.0041edf0
add esp, 4
test eax, eax
je 0x420f62
push 0xa
lea eax, [edi + 0xf]
push 0
push eax
call fcn.0042af14
add esp, 0xc
mov dword [esp + 0x38], eax
mov dword [esp + 0x3c], edx
jmp 0x421007
push str.close
mov eax, str.Connection:
mov ecx, edi
call fcn.004207f0
add esp, 4
test al, al
je 0x420f84
mov byte [esp + 0xf], 1
jmp 0x421007
push str.chunked
mov eax, str.Transfer_Encoding:
mov ecx, edi
call fcn.004207f0
add esp, 4
test al, al
je 0x420fc1
push str.CONNECT_responded_chunked_n
mov ecx, esi
call fcn.00415780
add esp, 4
xor eax, eax
mov byte [esp + 0x1b], 1
mov dword [ebx + 0x18], eax
mov dword [ebx + 0x24], eax
mov dword [ebx + 0x1c], 1
jmp 0x421007
push str.close
mov eax, str.Proxy_Connection:
mov ecx, edi
call fcn.004207f0
add esp, 4
test al, al
je 0x420fe0
mov byte [esp + 0xf], 1
jmp 0x421007
lea ebx, [esi + 0x90]
push ebx
lea ecx, [esp + 0x58]
push ecx
push str.HTTP_1._d__d
push edi
call fcn.0042980f
add esp, 0x10
cmp eax, 2
jne 0x421007
mov edx, dword [ebx]
mov dword [esi + 0x859c], edx
mov eax, dword [esp + 0x2c]
mov edx, dword [esp + 0x1c]
mov cl, byte [esp + 0x37]
inc edx
mov byte [eax + edi], cl
mov dword [esp + 0x2c], 0
mov dword [esp + 0x24], edx
mov edi, edx
mov eax, dword [esp + 0x20]
inc dword [esp + 0x1c]
inc eax
cmp eax, dword [esp + 0x30]
mov dword [esp + 0x20], eax
jl 0x420e50
jmp 0x421163
mov ecx, dword [esp + 0x50]
xor eax, eax
cmp dword [esi + 0x90], 0x197
mov dword [esp + 0x28], eax
mov dword [esp + 0x1c], ecx
jne 0x421144
cmp byte [esi + 0x852c], al
jne 0x421144
mov edi, dword [esp + 0x38]
mov ebx, dword [esp + 0x3c]
mov edx, edi
or edx, ebx
mov dword [esp + 0x14], 2
je 0x4210c6
push ebx
push edi
push str.Ignore__lld_bytes_of_response_body_n
mov ecx, esi
call fcn.00415780
mov eax, dword [esp + 0x3c]
sub eax, dword [esp + 0x2c]
add esp, 0xc
cdq
sub edi, eax
sbb ebx, edx
mov dword [esp + 0x38], edi
mov dword [esp + 0x3c], ebx
test ebx, ebx
jg 0x421163
jl 0x4210b9
test edi, edi
ja 0x421163
mov dword [esp + 0x14], 0
jmp 0x421163
cmp byte [esp + 0x1b], 0
je 0x4210b9
mov edi, dword [esp + 0x30]
mov ebx, dword [esp + 0x20]
mov eax, edi
sub eax, ebx
push eax
push str._zd_bytes_of_chunk_left_n
mov ecx, esi
mov byte [esi + 0xc5], 1
call fcn.00415780
mov eax, dword [esp + 0x2c]
add esp, 8
cmp byte [eax + 1], 0xa
jne 0x421100
inc eax
mov dword [esp + 0x24], eax
inc ebx
lea ecx, [esp + 0x30]
push ecx
sub edi, ebx
push edi
mov edi, dword [ebp + 8]
inc eax
push eax
call fcn.00424bd0
add esp, 0xc
mov ecx, esi
cmp eax, 0xffffffff
jne 0x421130
push str.chunk_reading_DONE_n
call fcn.00415780
mov dword [esp + 0x18], 0
jmp 0x421160
mov edx, dword [esp + 0x30]
push edx
push str.Read__zd_bytes_of_chunk__continue_n
call fcn.00415780
add esp, 8
jmp 0x421163
mov dword [esp + 0x14], eax
jmp 0x421163
mov eax, dword [esp + 0x10]
push str.Proxy_CONNECT_aborted_due_to_select_poll_error
mov dword [esp + 0x4c], 1
call fcn.00415840
add esp, 4
mov eax, dword [ebp + 8]
push eax
call fcn.0041bc40
add esp, 4
test eax, eax
jne 0x421242
cmp dword [esp + 0x28], 0x4000
jb 0x420c92
cmp dword [esp + 0x48], 0
jne 0x421236
mov esi, dword [esp + 0x10]
cmp dword [esi + 0x859c], 0xc8
mov edi, dword [ebp + 8]
je 0x4211bf
call fcn.0041fea0
test eax, eax
jne 0x4212e2
cmp byte [edi + 0x11c], al
je 0x4211bf
mov byte [esp + 0xf], 1
jmp 0x4211c6
cmp byte [esp + 0xf], 0
je 0x4211cf
cmp dword [esi + 0xcc], 0
jne 0x42124e
cmp dword [esi + 0xcc], 0
je 0x421265
mov edi, dword [ebp + 8]
xor esi, esi
jmp 0x420920
push esi
call dword [0x4511ac]
add esp, 4
mov eax, 0x1b
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
push esi
call dword [0x4511ac]
add esp, 4
push ebx
call dword [0x4511ac]
add esp, 4
mov eax, 0x1b
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov eax, ebx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov eax, dword [esp + 0x10]
push str.Proxy_CONNECT_aborted_due_to_timeout
call fcn.00415840
add esp, 4
mov eax, 0x38
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov eax, 0x2a
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov ecx, dword [edi + 0xc8]
push ecx
call dword [sym.imp.WS2_32.dll_closesocket]
mov dword [edi + 0xc8], 0xffffffff
mov eax, dword [esi + 0x90]
cmp eax, 0xc8
je 0x4212a5
push eax
push str.Received_HTTP_code__d_from_proxy_after_CONNECT
mov eax, esi
call fcn.00415840
add esp, 8
cmp byte [esp + 0xf], 0
je 0x421299
cmp dword [esi + 0xcc], 0
je 0x421299
mov byte [edi + 0x132], 1
mov eax, 0x38
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov eax, dword [edi + 0x140]
test eax, eax
je 0x4212b9
push eax
call dword [0x4511ac]
add esp, 4
mov dword [edi + 0x140], 0
push str.Proxy_replied_OK_to_CONNECT_request_n
mov ecx, esi
mov byte [esi + 0x8528], 1
call fcn.00415780
add esp, 4
mov byte [esi + 0xc5], 0
xor eax, eax
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret