Function at 0x100510a8
Capabilities:
Check for time delay via gettickcount

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x44
push ebx
mov ebx, dword [ebp + 8]
push esi
xor esi, esi
push edi
mov edi, dword [ebx]
mov dword [ebp - 0x3c], esi
mov eax, dword [edi + 0x19c]
mov dword [ebp - 0x2c], eax
cmp eax, esi
jne 0x100510cf
mov dword [ebp - 0x2c], 0x36ee80
mov eax, dword [ebp + 0xc]
lea eax, [ebx + eax*4 + 0xc8]
mov dword [ebp - 0x38], eax
mov eax, dword [eax]
mov dword [ebp - 0x30], eax
mov dword [ebp - 0x44], esi
mov dword [ebp - 0x40], esi
mov dword [ebp - 0x28], esi
mov dword [ebp - 0x34], esi
mov dword [ebp - 0x24], esi
mov dword [ebx + 0x188], esi
cmp dword [ebx + 0x164], esi
jne 0x100512d1
movzx ebx, word [ebp + 0x14]
push ebx
push dword [ebp + 0x10]
push str.Establish_HTTP_proxy_tunnel_to__s:_hu_n
push edi
call fcn.1004c61d
lea esi, [edi + 0xd4]
mov eax, dword [esi]
add esp, 0x10
test eax, eax
je 0x1005112f
push eax
call dword [0x100b0004]
and dword [esi], 0
pop ecx
call fcn.1004e92f
mov dword [ebp - 0x14], eax
test eax, eax
je 0x100517c2
push ebx
push dword [ebp + 0x10]
push str._s:_hu
call fcn.10056f47
add esp, 0xc
mov dword [ebp - 0x20], eax
test eax, eax
je 0x100517ca
mov esi, dword [ebp + 8]
push 1
push eax
push str.CONNECT
call fcn.1004e5de
mov esi, eax
add esp, 0xc
test esi, esi
jne 0x100512a7
mov eax, dword [ebp + 8]
cmp dword [eax + 0xac], 1
mov esi, 0x1009de6a
mov ebx, esi
mov dword [ebp - 0x1c], esi
mov dword [ebp - 0x10], esi
mov dword [ebp - 0xc], 0x1009ee1c
je 0x1005119f
mov dword [ebp - 0xc], 0x10087c60
push str.Host:
push edi
call fcn.1004e1b8
pop ecx
pop ecx
test eax, eax
jne 0x100511c9
push dword [ebp - 0x20]
push str.Host:__s_r_n
call fcn.10056f47
mov ebx, eax
pop ecx
pop ecx
test ebx, ebx
je 0x100517d6
push str.Proxy_Connection:
push edi
call fcn.1004e1b8
pop ecx
pop ecx
test eax, eax
jne 0x100511e1
mov dword [ebp - 0x1c], str.Proxy_Connection:_Keep_Alive_r_n
push str.User_Agent:
push edi
call fcn.1004e1b8
pop ecx
pop ecx
test eax, eax
jne 0x10051206
cmp dword [edi + 0x394], eax
je 0x10051206
mov eax, dword [ebp + 8]
mov eax, dword [eax + 0x1a4]
mov dword [ebp - 0x10], eax
mov eax, dword [ebp + 8]
mov eax, dword [eax + 0x1a0]
test eax, eax
je 0x10051215
mov esi, eax
push dword [ebp - 0x1c]
movzx eax, word [ebp + 0x14]
push dword [ebp - 0x10]
push esi
push ebx
push dword [ebp - 0xc]
push eax
push dword [ebp + 0x10]
push str.CONNECT__s:_hu_HTTP__s_r_n_s_s_s_s
push dword [ebp - 0x14]
call fcn.1004f00c
add esp, 0x24
mov esi, eax
test ebx, ebx
je 0x1005124b
cmp byte [ebx], 0
je 0x1005124b
push ebx
call dword [0x100b0004]
pop ecx
test esi, esi
jne 0x10051292
push dword [ebp - 0x14]
push dword [ebp + 8]
call fcn.1004f0d1
mov esi, eax
pop ecx
pop ecx
test esi, esi
jne 0x10051292
push 0x100a0640
push dword [ebp - 0x14]
call fcn.1004f00c
mov esi, eax
pop ecx
pop ecx
test esi, esi
jne 0x10051292
push dword [ebp + 0xc]
push eax
lea eax, [edi + 0x8684]
push eax
push dword [ebp + 8]
push dword [ebp - 0x14]
call fcn.1004e93c
add esp, 0x14
mov esi, eax
and dword [ebp - 0x14], 0
test esi, esi
je 0x100512a7
push str.Failed_sending_CONNECT_to_proxy
push edi
call fcn.1004c687
pop ecx
pop ecx
push dword [ebp - 0x20]
call dword [0x100b0004]
push dword [ebp - 0x14]
call fcn.1004567c
pop ecx
pop ecx
test esi, esi
jne 0x100517eb
mov eax, dword [ebp + 8]
mov dword [eax + 0x164], 1
mov ebx, eax
push dword [ebx + 0xbc]
push dword [ebx + 0xb8]
call fcn.1004bdc2
push edx
push eax
call fcn.1004bdd8
mov ecx, dword [ebp - 0x2c]
sub ecx, eax
add esp, 0x10
test ecx, ecx
jle 0x100517f2
cmp dword [edi + 0x508], 2
jne 0x10051318
push esi
push 0xffffffffffffffff
push dword [ebp - 0x30]
call fcn.10055035
add esp, 0xc
test eax, eax
je 0x1005187d
lea eax, [edi + 0x524]
mov dword [ebx + 0x164], esi
mov dword [ebp - 0x10], eax
mov dword [ebp - 8], eax
mov dword [ebp - 0x20], esi
mov dword [ebp - 0x1c], esi
mov dword [ebp - 0xc], 1
cmp dword [ebp - 0xc], esi
je 0x10051774
cmp dword [ebp - 0x24], esi
jne 0x100517ff
push dword [ebx + 0xbc]
push dword [ebx + 0xb8]
call fcn.1004bdc2
push edx
push eax
call fcn.1004bdd8
mov ecx, dword [ebp - 0x2c]
sub ecx, eax
add esp, 0x10
cmp ecx, esi
jle 0x10051760
mov eax, 0x3e8
cmp ecx, eax
jl 0x1005137c
mov ecx, eax
push ecx
push 0xffffffffffffffff
push dword [ebp - 0x30]
call fcn.10055035
add esp, 0xc
cmp eax, 0xffffffff
je 0x1005172e
cmp eax, esi
je 0x10051742
lea eax, [ebp - 0x18]
push eax
mov eax, 0x4000
sub eax, dword [ebp - 0x20]
push eax
push dword [ebp - 0x10]
push dword [ebp - 0x30]
push ebx
call fcn.1004c3f0
add esp, 0x14
cmp eax, 0x51
je 0x10051751
cmp eax, esi
jne 0x10051431
mov ecx, dword [ebp - 0x18]
cmp ecx, esi
jg 0x100513f7
mov dword [ebp - 0xc], esi
cmp dword [edi + 0x120], esi
je 0x100513ed
cmp dword [edi + 0x85c4], esi
je 0x100513ed
mov dword [ebx + 0x188], 1
jmp 0x10051742
push str.Proxy_CONNECT_aborted
jmp 0x10051733
add dword [ebp - 0x20], ecx
cmp dword [ebp - 0xc], 1
jle 0x1005147b
lea eax, [edi + 0x524]
mov dword [ebp - 0x10], eax
mov eax, dword [ebp - 0x44]
or eax, dword [ebp - 0x40]
mov dword [ebp - 0x20], esi
je 0x10051439
mov eax, ecx
cdq
sub dword [ebp - 0x44], eax
sbb dword [ebp - 0x40], edx
cmp dword [ebp - 0x40], esi
jg 0x10051742
jl 0x10051431
cmp dword [ebp - 0x44], esi
ja 0x10051742
mov dword [ebp - 0xc], esi
jmp 0x10051742
lea eax, [ebp - 0x14]
push eax
push ecx
push dword [ebp - 0x10]
mov dword [ebp - 0x14], esi
push ebx
call fcn.10058099
add esp, 0x10
cmp eax, 0xffffffff
jne 0x10051465
push str.chunk_reading_DONE_n
push edi
call fcn.1004c61d
mov dword [ebp - 0xc], esi
jmp 0x10051740
push dword [ebp - 0x14]
push str.Read__zd_bytes_of_chunk__continue_n
push edi
call fcn.1004c61d
add esp, 0xc
jmp 0x10051742
cmp ecx, esi
mov dword [ebp - 0x14], esi
jle 0x10051742
mov eax, dword [ebp - 0x10]
inc dword [ebp - 0x1c]
cmp byte [eax], 0xa
jne 0x10051660
cmp dword [edi + 0x2d8], esi
je 0x100514af
push ebx
push dword [ebp - 0x1c]
push dword [ebp - 8]
push 1
push edi
call fcn.1004c565
add esp, 0x14
push 2
pop eax
cmp dword [edi + 0x2bc], esi
je 0x100514bd
push 3
pop eax
push dword [ebp - 0x1c]
push dword [ebp - 8]
push eax
push ebx
call fcn.1004c81a
add esp, 0x10
cmp eax, esi
jne 0x1005187f
mov eax, dword [ebp - 8]
mov al, byte [eax]
cmp al, 0xd
je 0x10051677
cmp al, 0xa
je 0x10051677
mov eax, dword [ebp - 8]
mov ecx, dword [ebp - 0x1c]
lea esi, [ecx + eax]
mov al, byte [esi]
push str.WWW_Authenticate:
mov byte [ebp - 1], al
mov byte [esi], 0
call fcn.100652c0
push eax
push dword [ebp - 8]
push str.WWW_Authenticate:
call fcn.10055e95
add esp, 0x10
test eax, eax
je 0x10051527
mov eax, dword [edi + 0x90]
cmp eax, 0x191
je 0x10051553
push str.Proxy_authenticate:
call fcn.100652c0
push eax
push dword [ebp - 8]
push str.Proxy_authenticate:
call fcn.10055e95
add esp, 0x10
test eax, eax
je 0x1005156d
mov eax, dword [edi + 0x90]
cmp eax, 0x197
jne 0x1005156d
push dword [ebp - 8]
push eax
push ebx
call fcn.1004e6d3
add esp, 0xc
test eax, eax
jne 0x1005187f
jmp 0x1005164b
push str.Content_Length:
call fcn.100652c0
push eax
push dword [ebp - 8]
push str.Content_Length:
call fcn.10055e95
add esp, 0x10
test eax, eax
je 0x100515b2
push 0xa
push 0
push str.Content_Length:
call fcn.100652c0
add eax, dword [ebp - 8]
pop ecx
push eax
call fcn.1006659f
add esp, 0xc
mov dword [ebp - 0x44], eax
mov dword [ebp - 0x40], edx
jmp 0x1005164b
push str.close
push str.Connection:
push dword [ebp - 8]
call fcn.1004eb79
add esp, 0xc
test eax, eax
jne 0x1005161a
push str.chunked
push str.Transfer_Encoding:
push dword [ebp - 8]
call fcn.1004eb79
add esp, 0xc
test eax, eax
je 0x10051601
push str.CONNECT_responded_chunked_n
push edi
call fcn.1004c61d
push ebx
mov dword [ebp - 0x34], 1
call fcn.10058082
add esp, 0xc
jmp 0x1005164b
push str.close
push str.Proxy_Connection:
push dword [ebp - 8]
call fcn.1004eb79
add esp, 0xc
test eax, eax
je 0x10051623
mov dword [ebp - 0x28], 1
jmp 0x1005164b
lea ebx, [edi + 0x90]
push ebx
lea eax, [ebp - 0x3c]
push eax
push str.HTTP_1._d__d
push dword [ebp - 8]
call fcn.100653b5
add esp, 0x10
cmp eax, 2
jne 0x1005164b
mov eax, dword [ebx]
mov dword [edi + 0x8670], eax
mov al, byte [ebp - 1]
and dword [ebp - 0x1c], 0
mov ebx, dword [ebp + 8]
mov byte [esi], al
mov eax, dword [ebp - 0x10]
inc eax
mov dword [ebp - 8], eax
xor esi, esi
inc dword [ebp - 0x10]
inc dword [ebp - 0x14]
mov eax, dword [ebp - 0x14]
cmp eax, dword [ebp - 0x18]
jl 0x10051486
jmp 0x10051742
cmp dword [edi + 0x90], 0x197
lea eax, [edi + 0x524]
mov dword [ebp - 0x20], esi
mov dword [ebp - 0x10], eax
jne 0x10051431
cmp dword [edi + 0x85d4], esi
jne 0x10051431
mov eax, dword [ebp - 0x44]
or eax, dword [ebp - 0x40]
mov dword [ebp - 0xc], 2
je 0x100516cd
push dword [ebp - 0x40]
push dword [ebp - 0x44]
push str.Ignore__lld_bytes_of_response_body_n
push edi
call fcn.1004c61d
mov eax, dword [ebp - 0x18]
add esp, 0x10
sub eax, dword [ebp - 0x14]
jmp 0x10051416
cmp dword [ebp - 0x34], esi
je 0x10051431
mov eax, dword [ebp - 0x18]
sub eax, dword [ebp - 0x14]
mov dword [edi + 0xc8], 1
push eax
push str._zd_bytes_of_chunk_left_n
push edi
call fcn.1004c61d
mov eax, dword [ebp - 8]
add esp, 0xc
inc eax
cmp byte [eax], 0xa
jne 0x10051704
inc dword [ebp - 0x14]
mov dword [ebp - 8], eax
lea eax, [ebp - 0x18]
push eax
mov eax, dword [ebp - 0x18]
sub eax, dword [ebp - 0x14]
push eax
mov eax, dword [ebp - 8]
inc eax
push eax
push ebx
call fcn.10058099
add esp, 0x10
cmp eax, 0xffffffff
je 0x10051452
push dword [ebp - 0x18]
jmp 0x10051468
push str.Proxy_CONNECT_aborted_due_to_select_poll_error
push edi
mov dword [ebp - 0x24], 1
call fcn.1004c687
pop ecx
pop ecx
push ebx
call fcn.1004cde3
pop ecx
test eax, eax
jne 0x10051803
cmp dword [ebp - 0x20], 0x4000
jb 0x10051337
jmp 0x10051774
push str.Proxy_CONNECT_aborted_due_to_timeout
push edi
call fcn.1004c687
pop ecx
pop ecx
mov dword [ebp - 0x24], 2
cmp dword [ebp - 0x24], esi
jne 0x100517ff
cmp dword [edi + 0x8670], 0xc8
je 0x100517a7
push ebx
call fcn.1004ee68
pop ecx
cmp eax, esi
jne 0x1005187f
cmp dword [ebx + 0x130], esi
je 0x100517a7
mov dword [ebp - 0x28], 1
cmp dword [ebp - 0x28], esi
je 0x100517b4
cmp dword [edi + 0xd4], esi
jne 0x10051807
cmp dword [edi + 0xd4], esi
jne 0x100510f6
jmp 0x10051818
push 0x1b
pop eax
jmp 0x1005187f
push dword [ebp - 0x14]
call dword [0x100b0004]
pop ecx
jmp 0x100517c2
push dword [ebp - 0x14]
call dword [0x100b0004]
push dword [ebp - 0x20]
call dword [0x100b0004]
pop ecx
jmp 0x100517d3
mov eax, esi
jmp 0x1005187f
push str.Proxy_CONNECT_aborted_due_to_timeout
push edi
call fcn.1004c687
pop ecx
pop ecx
push 0x38
jmp 0x100517c4
push 0x2a
jmp 0x100517c4
mov eax, dword [ebp - 0x38]
push dword [eax]
call dword [sym.imp.WS2_32.dll_closesocket]
mov eax, dword [ebp - 0x38]
or dword [eax], 0xffffffff
mov eax, dword [edi + 0x90]
cmp eax, 0xc8
je 0x1005184d
push eax
push str.Received_HTTP_code__d_from_proxy_after_CONNECT
push edi
call fcn.1004c687
add esp, 0xc
cmp dword [ebp - 0x28], esi
je 0x100517ff
cmp dword [edi + 0xd4], esi
je 0x100517ff
mov dword [ebx + 0x188], 1
jmp 0x100517ff
lea esi, [ebx + 0x1a0]
push dword [esi]
call fcn.1004567c
and dword [esi], 0
mov dword [esp], str.Proxy_replied_OK_to_CONNECT_request_n
push edi
mov dword [edi + 0x85c8], 1
call fcn.1004c61d
and dword [edi + 0xc8], 0
pop ecx
pop ecx
xor eax, eax
pop edi
pop esi
pop ebx
leave
ret