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

Disassembly:
sub esp, 0x1c
mov ecx, dword [esp + 0x28]
mov edx, dword [esp + 0x2c]
xor eax, eax
push ebx
mov ebx, dword [esp + 0x24]
mov dword [ecx], eax
push ebp
mov dword [esp + 0xc], eax
mov dword [esp + 0x14], eax
mov dword [esp + 0x10], eax
mov dword [esp + 0x1c], 0x64
mov dword [edx], eax
jmp 0x5408b0
mov eax, dword [ebx + 0x34c]
mov ebp, eax
test eax, eax
jne 0x5408c1
mov ebp, 0x4000
mov eax, dword [esi]
mov ecx, dword [esi + 4]
mov edx, eax
and edx, ecx
cmp edx, 0xffffffff
je 0x5408e9
cmp dword [esi + 0x48], 0
jne 0x5408e9
sub eax, dword [esi + 0x20]
sbb ecx, dword [esi + 0x24]
xor edx, edx
cmp ecx, edx
jg 0x5408e9
jl 0x5408e7
cmp eax, ebp
jae 0x5408e9
mov ebp, eax
test ebp, ebp
je 0x540921
mov ecx, dword [esi + 0x9c]
mov edx, dword [edi + 0x31c]
lea eax, [esp + 8]
push eax
push ebp
push ecx
push edx
push edi
call fcn.005226a0
add esp, 0x14
mov dword [esp + 0xc], eax
cmp eax, 0x51
je 0x540ff9
test eax, eax
jg 0x541046
jmp 0x540929
mov dword [esp + 8], 0
mov eax, dword [esi + 0x20]
or eax, dword [esi + 0x24]
jne 0x540961
mov ecx, dword [esi + 0x28]
or ecx, dword [esi + 0x2c]
jne 0x540961
mov ebx, dword [esp + 0x28]
push 7
push ebx
call fcn.0053eb50
add esp, 8
cmp dword [esi + 0x84], 0
jle 0x540965
call fcn.00522390
mov dword [esi + 0x7c], eax
mov dword [esi + 0x80], edx
jmp 0x540965
mov ebx, dword [esp + 0x28]
mov eax, dword [esp + 0x2c]
or dword [eax], 1
mov eax, dword [esp + 8]
test eax, eax
jne 0x540987
cmp dword [esi + 0x98], eax
jne 0x540987
mov ebp, 1
mov dword [esp + 0x18], ebp
jmp 0x540995
xor ebp, ebp
mov dword [esp + 0x18], ebp
test eax, eax
jle 0x540e60
mov edx, dword [esi + 0x9c]
mov byte [eax + edx], 0
mov eax, dword [esi + 0x9c]
mov dword [esi + 0x5c], eax
mov ecx, dword [edi + 0x310]
mov eax, dword [ecx + 0x34]
test eax, eax
je 0x5409dc
lea edx, [esp + 0x10]
push edx
lea ecx, [esp + 0xc]
push ecx
push edi
push ebx
call eax
add esp, 0x10
mov dword [esp + 0xc], eax
test eax, eax
jne 0x541046
cmp dword [esp + 0x10], eax
jne 0x540ffd
cmp dword [esi + 0x48], 0
je 0x540a5e
lea edx, [esp + 0x20]
push edx
lea eax, [esp + 0xc]
push eax
push edi
push ebx
mov dword [esp + 0x30], 0
call fcn.0053ae80
add esp, 0x10
mov dword [esp + 0xc], eax
test eax, eax
jne 0x541046
mov ecx, dword [edi + 0x310]
mov eax, dword [ecx + 0x34]
test eax, eax
je 0x540a53
cmp dword [esi + 0x14], 0
jg 0x540a53
jl 0x540a25
cmp dword [esi + 0x10], 0
ja 0x540a53
cmp dword [esp + 8], 0
jle 0x540a53
lea edx, [esp + 0x10]
push edx
lea ecx, [esp + 0xc]
push ecx
push edi
push ebx
call eax
add esp, 0x10
mov dword [esp + 0xc], eax
test eax, eax
jne 0x541046
cmp dword [esp + 0x10], eax
jne 0x540ffd
cmp dword [esp + 0x20], 0
jne 0x540e6c
cmp dword [esi + 0x5c], 0
je 0x540e0a
cmp dword [esi + 0x48], 0
jne 0x540e0a
cmp dword [esp + 8], 0
jg 0x540a81
test ebp, ebp
je 0x540e0a
cmp dword [ebx + 0x3b8], 0
jne 0x540ed4
cmp dword [esi + 0x98], 0
jne 0x540b3d
test ebp, ebp
jne 0x540b3d
mov edx, dword [edi + 0x310]
test dword [edx + 0x3c], 0x40003
je 0x540b3d
cmp dword [ebx + 0x10c], ebp
je 0x540ae2
cmp dword [edi + 0x26c], ebp
jne 0x540f1f
push str.Ignoring_the_response_body_n
push ebx
mov dword [esi + 0xb0], 1
call fcn.00522940
add esp, 8
mov eax, dword [ebx + 0x4820]
or eax, dword [ebx + 0x4824]
je 0x540b0c
cmp dword [esi + 0x6c], 0
jne 0x540b0c
cmp dword [ebx + 0x268], 1
jne 0x540b0c
cmp dword [esi + 0xb0], 0
je 0x540ef4
cmp dword [ebx + 0x25c], 0
je 0x540b3d
cmp dword [ebx + 0x4818], 0
jne 0x540b3d
mov ecx, dword [esi + 0x94]
mov edx, dword [esi + 0x90]
push ecx
push edx
push ebx
call fcn.00540800
add esp, 0xc
test eax, eax
je 0x540f51
inc dword [esi + 0x98]
cmp dword [ebx + 0x3c4], 0
je 0x540b8f
cmp dword [esi + 0x4c], 0
push edi
je 0x540b7b
mov eax, dword [esi + 0x58]
mov ecx, dword [ebx + 0x6d4]
push eax
push ecx
push 3
push ebx
call fcn.00522850
add esp, 0x14
cmp dword [esi + 0x4c], 1
jne 0x540b8f
mov edx, dword [esp + 8]
mov eax, dword [esi + 0x5c]
push edi
push edx
push eax
jmp 0x540b84
mov ecx, dword [esp + 0xc]
mov edx, dword [esi + 0x5c]
push ecx
push edx
push 3
push ebx
call fcn.00522850
add esp, 0x14
cmp dword [esi + 0xc8], 0
je 0x540c06
mov ecx, dword [esp + 8]
mov edx, dword [esi + 0x5c]
lea eax, [esp + 8]
push eax
push ecx
push edx
push edi
call fcn.005480d0
add esp, 0x10
test eax, eax
jg 0x540f83
cmp eax, 0xffffffff
jne 0x540c06
and dword [esi + 0xa8], 0xfffffffe
mov ebp, dword [edi + 0x30]
test ebp, ebp
je 0x540c06
mov eax, dword [edi]
push ebp
push str.Leftovers_after_chunking:__zu_bytes_n
push eax
call fcn.00522940
mov ecx, dword [edi]
mov edx, dword [ecx + 0x40]
push 1
push edx
call fcn.0051fe10
add esp, 0x14
test eax, eax
je 0x540c06
mov eax, dword [edi]
push ebp
push str.Rewinding__zu_bytes_n
push eax
call fcn.00522940
add esp, 0xc
mov ecx, ebp
mov eax, edi
call fcn.005407e0
cmp dword [esi + 0x4c], 0
je 0x540c1f
cmp dword [esi + 0xb0], 0
jne 0x540c1f
mov ecx, dword [esi + 0x58]
add dword [esi + 0x20], ecx
adc dword [esi + 0x24], 0
mov ebp, dword [esi + 0x10]
mov ecx, dword [esi + 0x14]
cmp ebp, 0xffffffff
jne 0x540c32
cmp ecx, ebp
je 0x540d00
mov eax, dword [esp + 8]
cdq
add eax, dword [esi + 0x20]
adc edx, dword [esi + 0x24]
cmp edx, ecx
jl 0x540d00
jg 0x540c4f
cmp eax, ebp
jb 0x540d00
mov ebp, dword [esi + 0x20]
sub ebp, dword [esi + 0x10]
add ebp, dword [esp + 8]
mov dword [esp + 0x14], ebp
je 0x540ce3
cmp dword [esi + 0xb0], 0
jne 0x540ce3
mov edx, dword [edi]
mov eax, dword [edx + 0x40]
push 1
push eax
call fcn.0051fe10
add esp, 8
test eax, eax
je 0x540cbd
mov ecx, dword [esp + 8]
mov edx, dword [esi + 0x24]
mov eax, dword [esi + 0x20]
push ecx
mov ecx, dword [esi + 0x14]
push edx
mov edx, dword [esi + 0x10]
push eax
mov eax, dword [esi + 4]
push ecx
mov ecx, dword [esi]
push edx
mov edx, dword [ebx + 0x4808]
push eax
push ecx
push edx
push ebp
push str.Rewinding_stream_by_:__zu_bytes_on_url__s__size___I64d__maxdownload___I64d__bytecount___I64d__nread___zd__n
push ebx
call fcn.00522940
add esp, 0x2c
mov ecx, ebp
mov eax, edi
call fcn.005407e0
jmp 0x540ce3
mov eax, dword [esi + 0x24]
mov ecx, dword [esi + 0x20]
mov edx, dword [esi + 0x14]
push eax
mov eax, dword [esi + 0x10]
push ecx
mov ecx, dword [esi + 4]
push edx
mov edx, dword [esi]
push eax
push ecx
push edx
push ebp
push str.Excess_found_in_a_non_pipelined_read:_excess___zu__size___I64d__maxdownload___I64d__bytecount___I64d_n
push ebx
call fcn.00522940
add esp, 0x24
mov eax, dword [esi + 0x10]
sub eax, dword [esi + 0x20]
mov dword [esp + 8], eax
jns 0x540cf7
mov dword [esp + 8], 0
and dword [esi + 0xa8], 0xfffffffe
jmp 0x540d04
mov ebp, dword [esp + 0x14]
mov eax, dword [esp + 8]
cdq
add dword [esi + 0x20], eax
mov ecx, dword [esi + 0x20]
adc dword [esi + 0x24], edx
mov eax, dword [esi + 0x24]
push eax
push ecx
push ebx
call fcn.0053ed90
add esp, 0xc
cmp dword [esi + 0xc8], 0
jne 0x540e0e
cmp dword [esp + 8], 0
jne 0x540d45
cmp dword [esi + 0x4c], 0
jne 0x540d4b
cmp dword [esp + 0x18], 0
je 0x540e0e
cmp dword [esi + 0x4c], 0
je 0x540dad
cmp dword [esi + 0xb0], 0
jne 0x540dad
mov edx, dword [esi + 0x10]
mov eax, dword [esi + 0x14]
mov ecx, edx
and ecx, eax
cmp ecx, 0xffffffff
je 0x540d8b
mov ebp, dword [esi + 0x58]
xor ecx, ecx
cmp ecx, eax
jl 0x540d8b
jg 0x540d72
cmp ebp, edx
jbe 0x540d8b
mov edx, dword [esi + 0x10]
mov eax, dword [ebx + 0x6d4]
push edx
push eax
push 1
push edi
call fcn.00522d90
mov dword [esp + 0x1c], eax
jmp 0x540da2
mov ecx, dword [esi + 0x58]
mov edx, dword [ebx + 0x6d4]
push ecx
push edx
push 1
push edi
call fcn.00522d90
mov dword [esp + 0x1c], eax
add esp, 0x10
test eax, eax
jne 0x541046
cmp dword [esi + 0x4c], 2
jge 0x540df7
cmp dword [esi + 0xb0], 0
jne 0x540df7
mov eax, dword [edi + 0x310]
test dword [eax + 0x3c], 0xc000
je 0x540ddf
mov ecx, dword [esp + 8]
mov edx, dword [esi + 0x5c]
push ecx
push edx
push edi
call fcn.0052cd80
add esp, 0xc
jmp 0x540df3
mov eax, dword [esp + 8]
mov ecx, dword [esi + 0x5c]
push eax
push ecx
push 1
push edi
call fcn.00522d90
add esp, 0x10
mov dword [esp + 0xc], eax
mov eax, dword [esp + 0xc]
mov dword [esi + 0x4c], 0
test eax, eax
jne 0x541046
mov ebp, dword [esp + 0x14]
mov edx, dword [edi + 0x310]
cmp dword [edx + 0x34], 0
je 0x540e2b
test ebp, ebp
jbe 0x540e2b
cmp dword [edi + 0x2cc], 0
je 0x540fc1
cmp dword [esp + 0x18], 0
je 0x540e39
and dword [esi + 0xa8], 0xfffffffe
mov eax, edi
call fcn.005407c0
test eax, eax
je 0x540ffd
mov eax, dword [esp + 0x1c]
mov ecx, eax
dec eax
mov dword [esp + 0x1c], eax
test ecx, ecx
jne 0x5408b0
jmp 0x540ffd
and dword [esi + 0xa8], 0xfffffffe
jmp 0x540ffd
cmp dword [esp + 8], 0
jle 0x540ffd
mov edx, dword [edi]
mov eax, dword [edx + 0x40]
push 1
push eax
call fcn.0051fe10
add esp, 8
test eax, eax
je 0x540eb5
mov ecx, dword [ebx + 0x4808]
mov edx, dword [esp + 8]
push ecx
push edx
push str.Rewinding_stream_by_:__zd_bytes_on_url__s__zero_length_body__n
push ebx
call fcn.00522940
mov ecx, dword [esp + 0x18]
add esp, 0x10
mov eax, edi
call fcn.005407e0
jmp 0x540ffd
mov eax, dword [ebx + 0x4808]
mov ecx, dword [esp + 8]
push eax
push ecx
push str.Excess_found_in_a_non_pipelined_read:_excess___zd_url___s__zero_length_body__n
push ebx
call fcn.00522940
add esp, 0x10
jmp 0x540ffd
push 2
push edi
call fcn.00525940
mov edx, dword [esp + 0x38]
add esp, 8
pop ebp
mov dword [edx], 1
mov eax, 8
pop ebx
add esp, 0x1c
ret
mov ecx, dword [esi]
cmp ecx, dword [ebx + 0x4820]
jne 0x540f38
mov edx, dword [esi + 4]
cmp edx, dword [ebx + 0x4824]
jne 0x540f38
push str.The_entire_document_is_already_downloaded
push ebx
call fcn.00522940
push 1
push edi
call fcn.00525940
add esp, 0x10
mov eax, dword [esp + 0x30]
and dword [esi + 0xa8], 0xfffffffe
pop ebp
mov dword [eax], 1
xor eax, eax
pop ebx
add esp, 0x1c
ret
push str.HTTP_server_doesnt_seem_to_support_byte_ranges._Cannot_resume.
push ebx
call fcn.005229d0
add esp, 8
pop ebp
mov eax, 0x21
pop ebx
add esp, 0x1c
ret
mov ecx, dword [esp + 0x30]
push str.Simulate_a_HTTP_304_response__n
mov dword [ecx], 1
push ebx
mov dword [ebx + 0x4888], 0x130
call fcn.00522940
push 1
push edi
call fcn.00525940
add esp, 0x10
pop ebp
xor eax, eax
pop ebx
add esp, 0x1c
ret
cmp eax, 4
jne 0x540fa1
push str.Failed_writing_data
push ebx
call fcn.005229d0
add esp, 8
pop ebp
mov eax, 0x17
pop ebx
add esp, 0x1c
ret
push eax
call fcn.00548520
push eax
push str._s_in_chunked_encoding
push ebx
call fcn.005229d0
add esp, 0x10
pop ebp
mov eax, 0x38
pop ebx
add esp, 0x1c
ret
mov edx, dword [esp + 8]
add dword [esi + 0x5c], edx
mov eax, dword [edi + 0x310]
lea ecx, [esp + 0x10]
push ecx
lea edx, [esp + 0xc]
push edx
mov dword [esp + 0x10], ebp
mov eax, dword [eax + 0x34]
push edi
push ebx
call eax
add esp, 0x10
test eax, eax
jne 0x541046
cmp dword [esp + 0x10], eax
je 0x540ffd
or dword [esi + 0xa8], 1
jmp 0x540ffd
mov ebx, dword [esp + 0x28]
cmp dword [esp + 0x1c], 0
jg 0x541018
mov ecx, dword [esp + 0x34]
mov dword [edi + 0x580], 1
mov dword [ecx], 1
mov edx, dword [esi + 0xa8]
and dl, 3
cmp dl, 2
jne 0x541044
cmp dword [edi + 0x26c], 0
je 0x541044
push str.we_are_done_reading_and_this_is_set_to_close__stop_send_n
push ebx
call fcn.00522940
add esp, 8
and dword [esi + 0xa8], 0xfffffffd
xor eax, eax
pop ebp
pop ebx
add esp, 0x1c
ret