Function at 0x10051490
Capabilities:
Resolve function by parsing pe exports

Disassembly:
sub esp, 0x18
push ebx
push ebp
mov ebp, dword [esp + 0x24]
xor ebx, ebx
push edi
mov edi, dword [esp + 0x2c]
push edi
push ebp
call fcn.1001f510
mov dword [esp + 0x18], eax
mov eax, dword [esp + 0x3c]
mov dword [esp + 0x14], ebx
mov byte [eax], bl
push dword [ebp + 0x10]
push edi
call fcn.1001f6d0
add esp, 0x10
test al, al
jne 0x100514ce
pop edi
pop ebp
xor eax, eax
pop ebx
add esp, 0x18
ret
push esi
mov esi, dword [esp + 0x34]
cmp dword [esi + 0x78], ebx
je 0x10051569
lea esp, [esp]
lea eax, [esp + 0x18]
push eax
push 1
lea eax, [esp + 0x38]
push eax
push dword [esp + 0x20]
push edi
call fcn.10020d50
mov ebx, eax
add esp, 0x14
cmp ebx, 0x51
je 0x100517f1
push edi
call fcn.10031d10
add esp, 4
test eax, eax
jne 0x100517e4
test ebx, ebx
jne 0x10051562
cmp dword [esp + 0x18], ebx
jle 0x10051786
cmp dword [esi + 0x78], 2
jne 0x100515eb
mov ecx, dword [esi + 0x80]
mov eax, ecx
mov edx, dword [esi + 0x84]
or eax, edx
je 0x100515ad
sub ecx, 1
mov dword [esi + 0x80], ecx
sbb edx, ebx
mov dword [esi + 0x84], edx
test edx, edx
jl 0x10051562
jg 0x1005175c
test ecx, ecx
ja 0x1005175c
mov dword [esi + 0x78], 0
cmp dword [esi + 0x78], 0
mov ecx, dword [esp + 0x38]
sete al
mov byte [ecx], al
test ebx, ebx
jne 0x100515a3
test al, al
je 0x100515a3
mov eax, 0x51eb851f
imul dword [edi + 0xd7c]
sar edx, 5
mov eax, edx
shr eax, 0x1f
add eax, edx
cmp eax, 2
je 0x100515a3
push edi
call fcn.1002c280
add esp, 4
mov ebx, eax
mov eax, ebx
pop esi
pop edi
pop ebp
pop ebx
add esp, 0x18
ret
lea eax, [esp + 0x20]
mov dword [esp + 0x1c], 0
push eax
lea eax, [esp + 0x20]
push eax
push 1
lea eax, [esp + 0x3c]
push eax
push edi
call fcn.100576d0
add esp, 0x14
cmp eax, 0xffffffff
jne 0x1005175c
push str.chunk_reading_DONE
push edi
call fcn.10020260
add esp, 8
jmp 0x10051755
push 1
lea eax, [esp + 0x34]
push eax
lea ebp, [esi + 0x50]
push ebp
call fcn.10014100
add esp, 0xc
test eax, eax
jne 0x1005176b
cmp byte [esp + 0x30], 0xa
jne 0x1005175c
inc dword [esi + 0x74]
push ebp
call fcn.10014170
lea ecx, [esi + 0x50]
mov ebp, eax
push ecx
call fcn.10014160
mov ebx, eax
push ebx
push ebp
push 1
push edi
call fcn.10020100
xor ecx, ecx
mov eax, 8
cmp dword [esi + 0x74], 1
push ebx
cmove ecx, eax
or ecx, 0x14
push ebp
push ecx
push edi
call fcn.10020b30
add esp, 0x28
test eax, eax
jne 0x100515a5
push 1
push ebx
push edi
call fcn.1002bcf0
mov ebx, eax
add esp, 0xc
test ebx, ebx
jne 0x100515a3
mov al, byte [ebp]
cmp al, 0xd
je 0x100516a1
cmp al, 0xa
je 0x100516a1
push ebp
push esi
push edi
push dword [esp + 0x38]
call fcn.10051230
mov ebx, eax
add esp, 0x10
test ebx, ebx
jne 0x100515a3
lea eax, [esi + 0x50]
push eax
call fcn.10014180
add esp, 4
jmp 0x1005175c
cmp dword [edi + 0xd8], 0x197
jne 0x10051755
cmp byte [edi + 0xd59], 0
jne 0x10051755
mov edx, dword [esi + 0x80]
mov eax, edx
mov ecx, dword [esi + 0x84]
or eax, ecx
mov dword [esi + 0x78], 2
je 0x100516e9
push ecx
push edx
push str.Ignore__lld_bytes_of_response_body
push edi
call fcn.10020260
add esp, 0x10
jmp 0x1005175c
cmp byte [esi + 0x8c], 0
je 0x10051743
push str.Ignore_chunked_response_body
push edi
mov dword [esp + 0x24], 0
call fcn.10020260
lea eax, [ebp + 1]
mov byte [edi + 0x141], 1
cmp byte [eax], 0xa
cmove ebp, eax
lea eax, [esp + 0x2c]
push eax
lea eax, [esp + 0x28]
push eax
push 1
lea eax, [ebp + 1]
push eax
push edi
call fcn.100576d0
add esp, 0x1c
cmp eax, 0xffffffff
jne 0x1005175c
push str.chunk_reading_DONE
push edi
call fcn.10020260
add esp, 8
jmp 0x10051755
push str.CONNECT:_no_content_length_or_chunked
push dword [esp + 0x30]
push edi
call fcn.100202f0
add esp, 0xc
mov dword [esi + 0x78], 0
cmp dword [esi + 0x78], 0
jne 0x100514e0
jmp 0x10051569
push str.CONNECT_response_too_large
push edi
call fcn.10020190
add esp, 8
mov eax, 0x38
pop esi
pop edi
pop ebp
pop ebx
add esp, 0x18
ret
cmp dword [edi + 0x170], 0
je 0x100517b5
cmp dword [edi + 0x988], 0
je 0x100517b5
cmp dword [edi + 0xd18], 0
je 0x100517b5
push str.Proxy_CONNECT_connection_closed
push edi
mov byte [esi + 0x8d], 1
call fcn.10020260
jmp 0x100517c8
push str.Proxy_CONNECT_aborted
push edi
mov dword [esp + 0x18], 1
call fcn.10020190
add esp, 8
mov dword [esi + 0x78], 0
cmp dword [esp + 0x10], 0
mov eax, 0x38
cmovne ebx, eax
jmp 0x10051569
pop esi
pop edi
pop ebp
mov eax, 0x2a
pop ebx
add esp, 0x18
ret
pop esi
pop edi
pop ebp
xor eax, eax
pop ebx
add esp, 0x18
ret