Function at 0x41e040
Capabilities:
Check for time delay via gettickcount
Check http status code

Disassembly:
sub esp, 0x34
push ebx
mov ebx, dword [esp + 0x3c]
push ebp
mov ebp, dword [ebx]
push esi
push edi
xor edi, edi
mov dword [esp + 0x38], edi
mov eax, dword [ebp + 0x170]
mov dword [esp + 0x2c], eax
cmp eax, edi
jne 0x41e069
mov dword [esp + 0x2c], 0x36ee80
mov eax, dword [esp + 0x4c]
mov ecx, dword [ebx + eax*4 + 0xd4]
mov dword [esp + 0x30], ecx
mov dword [esp + 0x3c], edi
mov dword [esp + 0x40], edi
mov byte [esp + 0x12], 0
mov byte [esp + 0x13], 0
mov dword [esp + 0x28], edi
mov byte [ebx + 0x15e], 0
jmp 0x41e0a0
cmp byte [ebx + 0x155], 0
jne 0x41e2a7
movzx esi, word [esp + 0x54]
mov edx, dword [esp + 0x50]
push esi
push edx
push str.Establish_HTTP_proxy_tunnel_to__s:_d_n
push ebp
call fcn.0040d790
mov eax, dword [ebp + 0xcc]
add esp, 0x10
cmp eax, edi
je 0x41e0e0
push eax
call dword [0x501098]
add esp, 4
mov dword [ebp + 0xcc], edi
call fcn.0041c290
mov edi, eax
mov dword [esp + 0x18], edi
test edi, edi
je 0x41e84f
mov eax, dword [esp + 0x50]
push esi
push eax
push str._s:_d
call fcn.004133f0
add esp, 0xc
mov dword [esp + 0x14], eax
test eax, eax
je 0x41e845
push 1
push eax
push str.CONNECT
mov eax, ebx
call fcn.0041bee0
mov esi, eax
add esp, 0xc
test esi, esi
jne 0x41e278
mov ecx, dword [esp + 0x48]
cmp dword [ecx + 0xbc], 1
mov esi, 0x4bf542
mov edi, esi
mov dword [esp + 0x24], esi
mov dword [esp + 0x20], 0x4c34b0
je 0x41e156
mov dword [esp + 0x20], 0x4c34b4
push ebp
mov ebx, str.Host:
call fcn.0041b9c0
add esp, 4
test eax, eax
jne 0x41e184
mov ebx, dword [esp + 0x14]
push ebx
push str.Host:__s_r_n
call fcn.004133f0
mov edi, eax
add esp, 8
test edi, edi
je 0x41e85c
push ebp
mov ebx, str.Proxy_Connection:
call fcn.0041b9c0
add esp, 4
test eax, eax
jne 0x41e19e
mov dword [esp + 0x24], str.Proxy_Connection:_Keep_Alive_r_n
push ebp
mov ebx, str.User_Agent:
call fcn.0041b9c0
add esp, 4
test eax, eax
jne 0x41e1c2
cmp dword [ebp + 0x304], eax
je 0x41e1c2
mov edx, dword [esp + 0x48]
mov esi, dword [edx + 0x170]
mov eax, dword [esp + 0x48]
mov eax, dword [eax + 0x16c]
test eax, eax
jne 0x41e1d5
mov eax, 0x4bf542
mov ecx, dword [esp + 0x24]
mov edx, dword [esp + 0x20]
push ecx
push esi
push eax
movzx eax, word [esp + 0x60]
push edi
push edx
push eax
mov eax, dword [esp + 0x68]
push eax
mov eax, dword [esp + 0x34]
push str.CONNECT__s:_d_HTTP__s_r_n_s_s_s_s
call fcn.0041c980
add esp, 0x20
mov esi, eax
test edi, edi
je 0x41e213
cmp byte [edi], 0
je 0x41e213
push edi
call dword [0x501098]
add esp, 4
test esi, esi
jne 0x41e25e
mov edi, dword [esp + 0x18]
mov ebx, dword [esp + 0x48]
push edi
call fcn.0041ca40
mov esi, eax
add esp, 4
test esi, esi
jne 0x41e25e
push 0x4bf974
mov eax, edi
call fcn.0041c980
mov esi, eax
add esp, 4
test esi, esi
jne 0x41e25e
push eax
lea ecx, [ebp + 0x8578]
push ecx
mov ecx, dword [esp + 0x54]
mov edx, edi
push edx
mov edi, ebx
call fcn.0041c2a0
add esp, 0xc
mov esi, eax
mov dword [esp + 0x18], 0
test esi, esi
je 0x41e278
push str.Failed_sending_CONNECT_to_proxy
push ebp
call fcn.0040d820
add esp, 8
mov eax, dword [esp + 0x14]
push eax
call dword [0x501098]
mov ecx, dword [esp + 0x1c]
push ecx
call fcn.00404af0
add esp, 8
test esi, esi
jne 0x41e87e
mov edx, dword [esp + 0x48]
mov byte [edx + 0x155], 1
mov ebx, edx
xor edi, edi
mov eax, dword [ebx + 0xc8]
mov ecx, dword [ebx + 0xc4]
push eax
push ecx
call fcn.0041fdb0
push edx
push eax
call fcn.0041fde0
mov edx, dword [esp + 0x3c]
sub edx, eax
add esp, 0x10
test edx, edx
jle 0x41e888
cmp dword [ebp + 0x448], 2
jne 0x41e2f3
mov eax, dword [esp + 0x30]
push edi
push 0xffffffffffffffff
push eax
call fcn.0041eb90
add esp, 0xc
test eax, eax
je 0x41e93f
mov ecx, dword [esp + 0x48]
lea eax, [ebp + 0x464]
mov ebx, eax
xor edi, edi
mov byte [ecx + 0x155], 0
mov dword [esp + 0x20], ebx
mov esi, ebx
mov dword [esp + 0x24], edi
mov dword [esp + 0x18], edi
mov dword [esp + 0x14], 1
mov edi, edi
cmp dword [esp + 0x14], 0
je 0x41e7de
cmp dword [esp + 0x28], 0
jne 0x41e896
mov eax, dword [esp + 0x48]
mov edx, dword [eax + 0xc8]
mov eax, dword [eax + 0xc4]
push edx
push eax
call fcn.0041fdb0
push edx
push eax
call fcn.0041fde0
mov ecx, dword [esp + 0x3c]
sub ecx, eax
add esp, 0x10
test ecx, ecx
jle 0x41e888
cmp ecx, 0x3e8
jl 0x41e372
mov ecx, 0x3e8
push ecx
mov ecx, dword [esp + 0x34]
push 0xffffffffffffffff
push ecx
call fcn.0041eb90
add esp, 0xc
cmp eax, 0xffffffff
je 0x41e7a3
test eax, eax
je 0x41e7b9
mov ecx, dword [esp + 0x30]
lea edx, [esp + 0x1c]
push edx
mov edx, dword [esp + 0x4c]
mov eax, 0x4000
sub eax, edi
push eax
push ebx
push ecx
push edx
call fcn.0040d4d0
add esp, 0x14
test eax, eax
jl 0x41e7d2
xor ecx, ecx
cmp eax, ecx
je 0x41e3ca
mov dword [esp + 0x14], ecx
jmp 0x41e7b9
mov eax, dword [esp + 0x1c]
cmp eax, ecx
jg 0x41e400
mov dword [esp + 0x14], ecx
cmp dword [ebp + 0x104], ecx
je 0x41e3f6
cmp dword [ebp + 0x84fc], ecx
je 0x41e3f6
mov eax, dword [esp + 0x48]
mov byte [eax + 0x15e], 1
jmp 0x41e7b9
push str.Proxy_CONNECT_aborted
jmp 0x41e7a8
add edi, eax
cmp dword [esp + 0x14], 1
mov dword [esp + 0x24], edi
jle 0x41e4a6
mov edi, dword [esp + 0x3c]
mov dword [esp + 0x24], ecx
lea ecx, [ebp + 0x464]
mov ebx, ecx
mov ecx, dword [esp + 0x40]
mov edx, edi
or edx, ecx
mov dword [esp + 0x20], ebx
je 0x41e45b
cdq
sub edi, eax
sbb ecx, edx
mov dword [esp + 0x3c], edi
mov dword [esp + 0x40], ecx
test ecx, ecx
jg 0x41e7b9
jl 0x41e44e
test edi, edi
ja 0x41e7b9
mov dword [esp + 0x14], 0
jmp 0x41e7b9
mov edx, dword [esp + 0x48]
lea ecx, [esp + 0x34]
push ecx
push eax
push ebx
xor edi, edi
push edx
mov dword [esp + 0x44], edi
call fcn.00422050
add esp, 0x10
cmp eax, 0xffffffff
jne 0x41e48e
push str.chunk_reading_DONE_n
push ebp
call fcn.0040d790
mov dword [esp + 0x1c], edi
jmp 0x41e7b6
mov eax, dword [esp + 0x34]
push eax
push str.Read__d_bytes_of_chunk__continue_n
push ebp
call fcn.0040d790
add esp, 0xc
jmp 0x41e7b9
xor edi, edi
mov dword [esp + 0x34], edi
test eax, eax
jle 0x41e7b9
jmp 0x41e4c0
inc dword [esp + 0x18]
cmp byte [ebx], 0xa
jne 0x41e682
cmp byte [ebp + 0x270], 0
je 0x41e4ec
mov ecx, dword [esp + 0x48]
mov edx, dword [esp + 0x18]
push ecx
push edx
push esi
push 1
push ebp
call fcn.0040d6a0
add esp, 0x14
cmp byte [ebp + 0x263], 0
mov eax, 2
je 0x41e4ff
mov eax, 3
mov ecx, dword [esp + 0x18]
mov edx, dword [esp + 0x48]
push ecx
push esi
push eax
push edx
call fcn.0040d9c0
add esp, 0x10
test eax, eax
jne 0x41e941
mov al, byte [esi]
cmp al, 0xd
je 0x41e699
cmp al, 0xa
je 0x41e699
mov eax, dword [esp + 0x18]
mov bl, byte [eax + esi]
push 0x11
push esi
push str.WWW_Authenticate:
mov byte [eax + esi], 0
call fcn.0040e6d0
add esp, 0xc
test eax, eax
je 0x41e559
mov eax, dword [ebp + 0x90]
cmp eax, 0x191
je 0x41e57a
push 0x13
push esi
push str.Proxy_authenticate:
call fcn.0040e6d0
add esp, 0xc
test eax, eax
je 0x41e596
mov eax, dword [ebp + 0x90]
cmp eax, 0x197
jne 0x41e596
push esi
push eax
mov eax, dword [esp + 0x50]
push eax
call fcn.0041bfe0
add esp, 0xc
test eax, eax
jne 0x41e941
jmp 0x41e660
push 0xf
push esi
push str.Content_Length:
call fcn.0040e6d0
add esp, 0xc
test eax, eax
je 0x41e5c7
push 0xa
lea ecx, [esi + 0xf]
push 0
push ecx
call fcn.004ab0da
add esp, 0xc
mov dword [esp + 0x3c], eax
mov dword [esp + 0x40], edx
jmp 0x41e660
push str.close
push str.Connection:
push esi
call fcn.0041c500
add esp, 0xc
test al, al
je 0x41e5e5
mov byte [esp + 0x12], 1
jmp 0x41e660
push str.chunked
push str.Transfer_Encoding:
push esi
call fcn.0041c500
add esp, 0xc
test al, al
je 0x41e61b
push str.CONNECT_responded_chunked_n
push ebp
call fcn.0040d790
mov edx, dword [esp + 0x50]
push edx
mov byte [esp + 0x1f], 1
call fcn.00422030
add esp, 0xc
jmp 0x41e660
push str.close
push str.Proxy_Connection:
push esi
call fcn.0041c500
add esp, 0xc
test al, al
je 0x41e639
mov byte [esp + 0x12], 1
jmp 0x41e660
lea edi, [ebp + 0x90]
push edi
lea eax, [esp + 0x3c]
push eax
push str.HTTP_1._d__d
push esi
call fcn.004aa76f
add esp, 0x10
cmp eax, 2
jne 0x41e660
mov ecx, dword [edi]
mov dword [ebp + 0x8564], ecx
mov edx, dword [esp + 0x18]
mov eax, dword [esp + 0x20]
mov edi, dword [esp + 0x34]
mov byte [edx + esi], bl
mov ebx, dword [esp + 0x20]
lea esi, [eax + 1]
mov eax, dword [esp + 0x1c]
mov dword [esp + 0x18], 0
inc edi
inc ebx
cmp edi, eax
mov dword [esp + 0x20], ebx
mov dword [esp + 0x34], edi
jl 0x41e4c0
jmp 0x41e7b9
lea eax, [ebp + 0x464]
xor ecx, ecx
cmp dword [ebp + 0x90], 0x197
mov ebx, eax
mov dword [esp + 0x24], ecx
mov dword [esp + 0x20], ebx
jne 0x41e3c1
cmp byte [ebp + 0x8504], cl
jne 0x41e3c1
mov edx, dword [esp + 0x3c]
or edx, dword [esp + 0x40]
mov dword [esp + 0x14], 2
je 0x41e728
mov eax, dword [esp + 0x40]
mov ecx, dword [esp + 0x3c]
push eax
push ecx
push str.Ignore__lld_bytes_of_response_body_n
push ebp
call fcn.0040d790
mov eax, dword [esp + 0x2c]
sub eax, edi
cdq
add esp, 0x10
sub dword [esp + 0x3c], eax
mov eax, dword [esp + 0x40]
sbb eax, edx
mov dword [esp + 0x40], eax
test eax, eax
jg 0x41e7b9
jl 0x41e71b
cmp dword [esp + 0x3c], 0
ja 0x41e7b9
mov dword [esp + 0x14], 0
jmp 0x41e7b9
cmp byte [esp + 0x13], 0
je 0x41e3c1
mov edx, dword [esp + 0x1c]
sub edx, edi
push edx
push str._d_bytes_of_chunk_left_n
push ebp
mov byte [ebp + 0xc5], 1
call fcn.0040d790
add esp, 0xc
cmp byte [esi + 1], 0xa
jne 0x41e757
inc esi
inc edi
mov ecx, dword [esp + 0x1c]
lea eax, [esp + 0x1c]
push eax
mov eax, dword [esp + 0x4c]
sub ecx, edi
push ecx
lea edx, [esi + 1]
push edx
push eax
call fcn.00422050
add esp, 0x10
cmp eax, 0xffffffff
jne 0x41e78e
push str.chunk_reading_DONE_n
push ebp
call fcn.0040d790
mov dword [esp + 0x1c], 0
jmp 0x41e7b6
mov ecx, dword [esp + 0x1c]
push ecx
push str.Read__d_bytes_of_chunk__continue_n
push ebp
call fcn.0040d790
add esp, 0xc
jmp 0x41e7b9
push str.Proxy_CONNECT_aborted_due_to_select_poll_error
push ebp
mov dword [esp + 0x30], 1
call fcn.0040d820
add esp, 8
mov edx, dword [esp + 0x48]
push edx
call fcn.00411b10
add esp, 4
test eax, eax
jne 0x41e8a3
mov edi, dword [esp + 0x24]
cmp edi, 0x4000
jb 0x41e320
cmp dword [esp + 0x28], 0
jne 0x41e896
cmp dword [ebp + 0x8564], 0xc8
mov esi, dword [esp + 0x48]
je 0x41e819
push esi
call fcn.0041c7d0
add esp, 4
test eax, eax
jne 0x41e941
cmp byte [esi + 0x148], al
je 0x41e819
mov byte [esp + 0x12], 1
jmp 0x41e820
cmp byte [esp + 0x12], 0
je 0x41e82d
cmp dword [ebp + 0xcc], 0
jne 0x41e8b0
cmp dword [ebp + 0xcc], 0
je 0x41e8cd
mov ebx, dword [esp + 0x48]
xor edi, edi
jmp 0x41e0a0
push edi
call dword [0x501098]
add esp, 4
pop edi
pop esi
pop ebp
mov eax, 0x1b
pop ebx
add esp, 0x34
ret
mov eax, dword [esp + 0x18]
push eax
call dword [0x501098]
push ebx
call dword [0x501098]
add esp, 8
pop edi
pop esi
pop ebp
mov eax, 0x1b
pop ebx
add esp, 0x34
ret
pop edi
mov eax, esi
pop esi
pop ebp
pop ebx
add esp, 0x34
ret
push str.Proxy_CONNECT_aborted_due_to_timeout
push ebp
call fcn.0040d820
add esp, 8
pop edi
pop esi
pop ebp
mov eax, 0x38
pop ebx
add esp, 0x34
ret
pop edi
pop esi
pop ebp
mov eax, 0x2a
pop ebx
add esp, 0x34
ret
mov edi, dword [esp + 0x4c]
mov ecx, dword [esi + edi*4 + 0xd4]
push ecx
call dword [sym.imp.WS2_32.dll_closesocket]
mov dword [esi + edi*4 + 0xd4], 0xffffffff
mov eax, dword [ebp + 0x90]
cmp eax, 0xc8
je 0x41e90d
push eax
push str.Received_HTTP_code__d_from_proxy_after_CONNECT
push ebp
call fcn.0040d820
add esp, 0xc
cmp byte [esp + 0x12], 0
je 0x41e900
cmp dword [ebp + 0xcc], 0
je 0x41e900
mov byte [esi + 0x15e], 1
pop edi
pop esi
pop ebp
mov eax, 0x38
pop ebx
add esp, 0x34
ret
mov edx, dword [esi + 0x16c]
push edx
call fcn.00404af0
push str.Proxy_replied_OK_to_CONNECT_request_n
mov dword [esi + 0x16c], 0
push ebp
mov byte [ebp + 0x8500], 1
call fcn.0040d790
add esp, 0xc
mov byte [ebp + 0xc5], 0
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x34
ret