Function at 0x51e970
Capabilities:
Check http status code
Resolve function by parsing pe exports
Write file on windows

Disassembly:
sub esp, 0x44
push ebx
mov ebx, dword [esp + 0x4c]
push ebp
mov ebp, ecx
mov ecx, dword [esp + 0x54]
mov eax, dword [ebp + 0x1b8]
push esi
mov esi, dword [ebp + 0x41c]
push edi
mov edi, dword [ebp]
mov dword [esp + 0x20], ebp
mov dword [esp + 0x28], ebx
mov dword [esp + 0x2c], ecx
mov dword [esp + 0x3c], 0
mov dword [esp + 0x38], eax
test esi, esi
je 0x51ede4
cmp dword [esi + 0x4018], 2
je 0x51ede4
and dword [ebp + 0x2a4], 0xffefffff
jmp 0x51e9d0
cmp dword [esi + 0x4018], 0
jne 0x51ec50
push ecx
push ebx
push str.Establish_HTTP_proxy_tunnel_to__s:_d_n
push edi
call fcn.0051a600
push dword [edi + 0x140]
call dword [0x593c28]
add esp, 0x14
mov dword [edi + 0x140], 0
push 0xc
push 1
call dword [0x593c24]
add esp, 8
mov dword [esp + 0x14], eax
mov dword [esp + 0x18], eax
test eax, eax
je 0x51f4a3
push dword [esp + 0x2c]
push ebx
push str._s:_d
call sym.update.exe_curl_maprintf
add esp, 0xc
mov dword [esp + 0x1c], eax
test eax, eax
je 0x51f49a
push 1
push ecx
mov ecx, ebp
call fcn.005284b0
push dword [esp + 0x24]
mov ebx, eax
call dword [0x593c28]
add esp, 0xc
test ebx, ebx
jne 0x51ec1b
cmp dword [ebp + 0xf0], 1
mov dword [esp + 0x1c], ebx
mov dword [esp + 0x34], 0x5411b4
mov dword [esp + 0x30], 0x5411b4
mov dword [esp + 0x24], 0x569d7c
je 0x51ea8c
mov dword [esp + 0x24], 0x569d80
mov eax, dword [ebp + 0x2a4]
mov edx, dword [esp + 0x28]
shr eax, 9
and eax, 1
cmp edx, dword [ebp + 0x9c]
je 0x51eab9
push 0x3a
push edx
call fcn.004ee600
mov edx, dword [esp + 0x30]
add esp, 8
neg eax
sbb eax, eax
neg eax
test eax, eax
je 0x51eac9
mov eax, 0x568894
mov ecx, str.___:
jmp 0x51ead0
mov eax, 0x5411b4
mov ecx, eax
push dword [esp + 0x2c]
push eax
push edx
push ecx
push str._s_s_s:_d
call sym.update.exe_curl_maprintf
add esp, 0x14
mov dword [esp + 0x14], eax
test eax, eax
je 0x51f49a
mov edx, str.Host
mov ecx, ebp
call fcn.00529040
test eax, eax
jne 0x51eb1f
push dword [esp + 0x14]
push str.Host:__s_r_n
call sym.update.exe_curl_maprintf
mov ebx, eax
add esp, 8
mov dword [esp + 0x1c], ebx
test ebx, ebx
je 0x51f48d
mov edx, str.Proxy_Connection
mov ecx, ebp
call fcn.00529040
test eax, eax
jne 0x51eb37
mov dword [esp + 0x34], str.Proxy_Connection:_Keep_Alive_r_n
mov edx, str.User_Agent
mov ecx, ebp
call fcn.00529040
test eax, eax
jne 0x51eb57
cmp dword [edi + 0x9b8], eax
je 0x51eb57
mov ecx, dword [ebp + 0x2f8]
jmp 0x51eb5b
mov ecx, dword [esp + 0x30]
mov eax, dword [ebp + 0x2f4]
test eax, eax
jne 0x51eb6a
mov eax, 0x5411b4
test ebx, ebx
jne 0x51eb73
mov ebx, 0x5411b4
push dword [esp + 0x34]
push ecx
push eax
push ebx
push dword [esp + 0x34]
lea eax, [esp + 0x2c]
push dword [esp + 0x28]
push str.CONNECT__s_HTTP__s_r_n_s_s_s_s
push eax
call fcn.00529140
mov ebx, eax
mov eax, dword [esp + 0x3c]
add esp, 0x20
test eax, eax
je 0x51eba8
push eax
call dword [0x593c28]
add esp, 4
push dword [esp + 0x14]
call dword [0x593c28]
add esp, 4
test ebx, ebx
jne 0x51ec01
push dword [esp + 0x18]
lea edx, [ebx + 1]
mov ecx, ebp
call fcn.005285b0
mov ebx, eax
add esp, 4
test ebx, ebx
jne 0x51ec01
lea eax, [esp + 0x18]
push 0x56983c
push eax
call fcn.00529140
mov ebx, eax
add esp, 8
test ebx, ebx
jne 0x51ec01
push ecx
push eax
lea eax, [edi + 0xfa8]
push eax
mov edx, ebp
lea ecx, [esp + 0x24]
call fcn.005291b0
add esp, 0xc
mov ebx, eax
xor eax, eax
mov dword [esp + 0x14], eax
test ebx, ebx
je 0x51ec2e
push str.Failed_sending_CONNECT_to_proxy
push edi
call fcn.0051a7e0
add esp, 8
jmp 0x51ec2a
mov eax, dword [esp + 0x14]
push dword [eax]
call dword [0x593c28]
add esp, 4
mov eax, dword [esp + 0x14]
push eax
call dword [0x593c28]
add esp, 4
test ebx, ebx
jne 0x51f4b0
mov dword [esi + 0x4018], 1
mov dword [esi + 0x4000], ebx
mov edx, dword [edi + 0x638]
xor eax, eax
mov ecx, 0x493e0
xor ebx, ebx
mov dword [esp + 0x18], ecx
test edx, edx
jle 0x51ec6a
lea eax, [ebx + 1]
mov ecx, dword [edi + 0x63c]
test ecx, ecx
jle 0x51ec77
or eax, 2
dec eax
je 0x51ec88
dec eax
je 0x51ec84
dec eax
jne 0x51ec91
cmp edx, ecx
jl 0x51ec88
mov eax, ecx
jmp 0x51ec8a
mov eax, edx
cdq
mov ebx, edx
mov dword [esp + 0x18], eax
lea eax, [esp + 0x40]
push eax
call fcn.0051f970
mov edx, eax
mov eax, dword [edi + 0xb30]
sub esp, 0xc
mov ecx, esp
sub esp, 0x10
mov dword [ecx], eax
mov eax, dword [edi + 0xb34]
mov dword [ecx + 4], eax
mov eax, dword [edi + 0xb38]
mov dword [ecx + 8], eax
mov eax, dword [edi + 0xb3c]
mov dword [ecx + 0xc], eax
mov eax, dword [edx]
mov ecx, esp
mov dword [ecx], eax
mov eax, dword [edx + 4]
mov dword [ecx + 4], eax
mov eax, dword [edx + 8]
mov dword [ecx + 8], eax
mov eax, dword [edx + 0xc]
mov dword [ecx + 0xc], eax
call fcn.0051fa10
mov ecx, dword [esp + 0x38]
add esp, 0x20
sub ecx, eax
sbb ebx, edx
mov eax, ecx
or eax, ebx
je 0x51f64f
test ebx, ebx
jl 0x51f64f
jg 0x51ed0c
test ecx, ecx
je 0x51f64f
mov eax, dword [0x593c34]
push 0
mov eax, dword [eax + 0x24]
push ebp
call eax
add esp, 8
test eax, eax
jne 0x51ed62
cmp dword [ebp + 0x1e0], eax
je 0x51ed3e
cmp dword [ebp + 0x1e4], eax
je 0x51ed3e
mov eax, dword [ebp + 0x1e8]
cmp eax, dword [ebp + 0x1ec]
ja 0x51ed62
mov ecx, dword [ebp + 0x1b8]
push 0
push 0
push 0xffffffffffffffff
call fcn.005176f0
add esp, 0xc
test eax, eax
jle 0x51ede4
test al, 1
je 0x51ede4
xor ebx, ebx
mov dword [esp + 0x14], ebx
cmp dword [esi + 0x4004], ebx
je 0x51f34f
lea ebx, [esi + 0x4000]
lea ebx, [ebx]
mov edx, dword [esi + 0x400c]
cmp edx, ebx
jae 0x51f4c7
mov ebx, dword [esp + 0x38]
mov eax, dword [ebp]
xor ecx, ecx
cmp ebx, dword [ebp + 0x1bc]
mov dword [esp + 0x1c], 0x38
mov eax, dword [eax + 0x8e4]
sete cl
xor ebp, ebp
mov dword [esp + 0x24], ebp
cmp eax, 1
jbe 0x51edbe
mov eax, 1
lea ebx, [esp + 0x1c]
push ebx
push eax
mov eax, dword [esp + 0x28]
push edx
push ecx
push eax
mov eax, dword [eax + ecx*4 + 0x1d0]
call eax
add esp, 0x14
test eax, eax
jns 0x51edee
mov ebx, dword [esp + 0x1c]
cmp ebx, 0x51
jne 0x51edf6
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x44
ret
mov ebp, eax
mov dword [esp + 0x24], ebp
xor ebx, ebx
mov ecx, dword [esp + 0x20]
call fcn.00524d80
test eax, eax
jne 0x51f4ba
test ebx, ebx
jne 0x51f33d
test ebp, ebp
jle 0x51f426
cmp dword [esi + 0x4004], 1
jle 0x51eec3
mov ecx, dword [esi + 0x4010]
mov edx, dword [esi + 0x4014]
mov eax, ecx
or eax, edx
mov dword [esi + 0x400c], esi
je 0x51ee7b
sub ecx, 1
sbb edx, ebx
mov dword [esi + 0x4010], ecx
mov dword [esi + 0x4014], edx
test edx, edx
jl 0x51f333
jg 0x51ee5f
test ecx, ecx
jbe 0x51f333
mov ebp, dword [esp + 0x20]
lea ebx, [esi + 0x4000]
cmp dword [esi + 0x4004], 0
jne 0x51ed80
jmp 0x51f34b
mov ebp, dword [esp + 0x20]
lea eax, [esp + 0x1c]
push eax
push 1
mov edx, esi
mov ecx, ebp
mov dword [esp + 0x24], 0
call fcn.00534b10
add esp, 8
cmp eax, 0xffffffff
jne 0x51ee63
push str.chunk_reading_DONE_n
push edi
call fcn.0051a600
add esp, 8
mov dword [esi + 0x4004], 0
mov dword [esi + 0x4018], 2
jmp 0x51ee63
mov eax, dword [esi + 0x400c]
inc dword [esi + 0x4000]
cmp byte [eax], 0xa
mov ebp, dword [esi + 0x4000]
lea ebx, [esi + 0x4000]
je 0x51eef0
mov ebp, dword [esp + 0x20]
inc eax
mov dword [esi + 0x400c], eax
jmp 0x51ee69
test dword [edi + 0xa80], 0x2000000
je 0x51ef8f
cmp dword [edi + 0x600], 0
mov ebx, dword [esi + 0x4008]
je 0x51ef63
mov eax, dword [edi + 0x7c]
test eax, eax
jne 0x51ef1d
mov eax, dword [edi + 0x78]
test eax, eax
je 0x51ef27
mov dword [eax + 0xe0], 1
push dword [edi + 0x594]
mov eax, dword [edi + 0x600]
push ebp
push ebx
push 1
push edi
call eax
mov eax, dword [edi + 0x7c]
add esp, 0x14
test eax, eax
je 0x51ef50
mov dword [eax + 0xe0], 0
jmp 0x51ef89
mov eax, dword [edi + 0x78]
test eax, eax
je 0x51ef89
mov dword [eax + 0xe0], 0
jmp 0x51ef89
push dword [edi + 0x590]
push 1
push 2
push 0x544ecb
call fcn.004ec47b
push dword [edi + 0x590]
push 1
push ebp
push ebx
call fcn.004ec47b
add esp, 0x20
lea ebx, [esi + 0x4000]
test dword [edi + 0xa84], 0x1000
jne 0x51f0cc
test dword [edi + 0xa80], 0x100000
mov ebx, 2
je 0x51efb5
mov ebx, 3
mov ecx, dword [esi + 0x4000]
mov edx, dword [esi + 0x4008]
test ecx, ecx
jne 0x51efd9
mov ecx, edx
lea ebp, [ecx + 1]
lea ebx, [ebx]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x51efd0
sub ecx, ebp
mov ebp, dword [esp + 0x20]
push ecx
push edx
mov edx, ebx
mov ecx, ebp
call fcn.00519f60
add esp, 8
test eax, eax
jne 0x51ede6
lea ebx, [esi + 0x4000]
mov eax, dword [ebx]
cdq
add dword [edi + 0xfa0], eax
adc dword [edi + 0xfa4], edx
mov eax, dword [ebx]
cdq
add dword [edi + 0xa8], eax
adc dword [edi + 0xac], edx
mov ecx, dword [esi + 0x4008]
mov al, byte [ecx]
cmp al, 0xd
je 0x51f252
cmp al, 0xa
je 0x51f252
mov eax, dword [ebx]
push 0x11
mov byte [ecx + eax], 0
mov ebx, dword [esi + 0x4008]
mov edx, ebx
mov ecx, str.WWW_Authenticate:
call fcn.0052ac90
add esp, 4
test eax, eax
je 0x51f05d
mov eax, dword [edi + 0x100]
cmp eax, 0x191
je 0x51f07f
push 0x13
mov edx, ebx
mov ecx, str.Proxy_authenticate:
call fcn.0052ac90
add esp, 4
test eax, eax
je 0x51f0d5
mov eax, dword [edi + 0x100]
cmp eax, 0x197
jne 0x51f0d5
xor ecx, ecx
cmp eax, 0x197
sete cl
mov dword [esp + 0x1c], ecx
mov ecx, ebx
call fcn.00528f60
mov ebx, eax
test ebx, ebx
je 0x51f4a3
mov edx, dword [esp + 0x1c]
push ebx
mov ecx, ebp
call fcn.00528a70
add esp, 4
mov dword [esp + 0x1c], eax
push ebx
call dword [0x593c28]
mov eax, dword [esp + 0x20]
add esp, 4
test eax, eax
jne 0x51ede6
jmp 0x51f235
mov ebp, dword [esp + 0x20]
jmp 0x51eff9
push 0xf
mov edx, ebx
mov ecx, str.Content_Length:
call fcn.0052ac90
add esp, 4
test eax, eax
je 0x51f135
mov ecx, dword [edi + 0x100]
mov eax, 0x51eb851f
imul ecx
sar edx, 5
mov eax, edx
shr eax, 0x1f
add eax, edx
cmp eax, 2
jne 0x51f11a
push ecx
push str.Ignoring_Content_Length_in_CONNECT__03d_response_n
push edi
call fcn.0051a600
add esp, 0xc
jmp 0x51f235
lea eax, [esi + 0x4010]
push eax
push 0xa
lea ecx, [ebx + 0xf]
xor edx, edx
call fcn.00534fc0
add esp, 8
jmp 0x51f235
push str.close
mov edx, str.Connection:
mov ecx, ebx
call fcn.00528c60
add esp, 4
test eax, eax
je 0x51f159
or dword [esi + 0x401c], 2
jmp 0x51f235
mov ebx, dword [esi + 0x4008]
push 0x12
mov edx, ebx
mov ecx, str.Transfer_Encoding:
call fcn.0052ac90
add esp, 4
test eax, eax
je 0x51f1e8
mov ecx, dword [edi + 0x100]
mov eax, 0x51eb851f
imul ecx
sar edx, 5
mov eax, edx
shr eax, 0x1f
add eax, edx
cmp eax, 2
jne 0x51f1a4
push ecx
push str.Ignoring_Transfer_Encoding_in_CONNECT__03d_response_n
push edi
call fcn.0051a600
add esp, 0xc
jmp 0x51f235
push str.chunked
mov edx, str.Transfer_Encoding:
mov ecx, ebx
call fcn.00528c60
add esp, 4
test eax, eax
je 0x51f235
push str.CONNECT_responded_chunked_n
push edi
call fcn.0051a600
add esp, 8
or dword [esi + 0x401c], 1
mov dword [ebp + 0x24], 0
mov dword [ebp + 0x38], 0
mov dword [ebp + 0x28], 0
jmp 0x51f235
push str.close
mov edx, str.Proxy_Connection:
mov ecx, ebx
call fcn.00528c60
add esp, 4
test eax, eax
je 0x51f209
or dword [esi + 0x401c], 2
jmp 0x51f235
lea ebx, [edi + 0x100]
push ebx
lea eax, [esp + 0x40]
push eax
push str.HTTP_1._d__d
push dword [esi + 0x4008]
call fcn.004ed487
add esp, 0x10
cmp eax, 2
jne 0x51f235
mov eax, dword [ebx]
mov dword [edi + 0xf8c], eax
lea ebx, [esi + 0x4000]
mov dword [esi + 0x400c], esi
mov dword [ebx], 0
mov dword [esi + 0x4008], esi
jmp 0x51ee69
mov dword [esi + 0x400c], esi
cmp dword [edi + 0x100], 0x197
jne 0x51f308
test byte [edi + 0xf84], 0x20
jne 0x51f308
mov edx, dword [esi + 0x4010]
mov ecx, dword [esi + 0x4014]
mov eax, edx
or eax, ecx
mov dword [esi + 0x4004], 2
je 0x51f2a3
push ecx
push edx
push str.Ignore__I64d_bytes_of_response_body_n
push edi
call fcn.0051a600
add esp, 0x10
jmp 0x51f312
test byte [esi + 0x401c], 1
je 0x51f308
push str.Ignore_chunked_response_body_n
push edi
call fcn.0051a600
or dword [edi + 0x588], 8
mov eax, dword [esi + 0x4008]
inc eax
add esp, 8
cmp byte [eax], 0xa
jne 0x51f2d3
mov dword [esi + 0x4008], eax
mov edx, dword [esi + 0x4008]
lea eax, [esp + 0x24]
push eax
push 1
inc edx
mov ecx, ebp
call fcn.00534b10
add esp, 8
cmp eax, 0xffffffff
jne 0x51f312
push str.chunk_reading_DONE_n
push edi
call fcn.0051a600
add esp, 8
mov dword [esi + 0x4018], 2
mov dword [esi + 0x4004], 0
mov eax, dword [esi + 0x4010]
or eax, dword [esi + 0x4014]
jne 0x51ee69
mov dword [esi + 0x4018], 2
jmp 0x51ee69
mov dword [esi + 0x4018], 2
mov ebp, dword [esp + 0x20]
mov dword [esi + 0x4004], 0
mov ebx, dword [esp + 0x14]
mov ecx, ebp
call fcn.00524d80
test eax, eax
jne 0x51f4ba
test ebx, ebx
jne 0x51f4d5
mov eax, 0x51eb851f
imul dword [edi + 0xf8c]
sar edx, 5
mov eax, edx
shr eax, 0x1f
add eax, edx
cmp eax, 2
je 0x51f39f
mov ecx, ebp
call fcn.00528d30
test eax, eax
jne 0x51ede6
test byte [ebp + 0x2a4], 1
je 0x51f39f
or dword [esi + 0x401c], 2
test byte [esi + 0x401c], 2
je 0x51f3b5
cmp dword [edi + 0x140], 0
jne 0x51f4e2
cmp dword [edi + 0x140], 0
je 0x51f4f9
cmp dword [esi + 0x4018], 2
jne 0x51f40c
mov eax, dword [ebp + 0x41c]
and dword [eax + 0x401c], 0xfffffffd
mov dword [eax + 0x4018], 0
mov dword [eax + 0x4004], 1
mov dword [eax + 0x4008], eax
mov dword [eax + 0x400c], eax
mov dword [eax + 0x4010], 0
mov dword [eax + 0x4014], 0
cmp dword [edi + 0x140], 0
je 0x51f4f9
mov ebx, dword [esp + 0x28]
mov ecx, dword [esp + 0x2c]
jmp 0x51e9d0
cmp dword [edi + 0x5b8], 0
je 0x51f467
cmp dword [edi + 0xd00], 0
je 0x51f467
mov ebp, dword [esp + 0x20]
push str.Proxy_CONNECT_connection_closed_n
or dword [ebp + 0x2a4], 0x100000
push edi
call fcn.0051a600
mov ebx, dword [esp + 0x1c]
add esp, 8
mov dword [esi + 0x4004], 0
jmp 0x51f34f
push str.Proxy_CONNECT_aborted
push edi
mov ebx, 1
call fcn.0051a7e0
mov ebp, dword [esp + 0x28]
add esp, 8
mov dword [esi + 0x4004], 0
jmp 0x51f34f
push dword [esp + 0x14]
call dword [0x593c28]
add esp, 4
lea ecx, [esp + 0x18]
call fcn.00529420
mov eax, 0x1b
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x44
ret
mov eax, ebx
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x44
ret
mov eax, 0x2a
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x44
ret
push str.CONNECT_response_too_large_
push edi
call fcn.0051a7e0
add esp, 8
mov eax, 0x38
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x44
ret
mov edx, dword [ebp + 0x1b8]
mov ecx, ebp
call fcn.00516300
mov dword [ebp + 0x1b8], 0xffffffff
mov eax, 0x51eb851f
imul dword [edi + 0xf8c]
sar edx, 5
mov eax, edx
shr eax, 0x1f
add eax, edx
cmp eax, 2
je 0x51f5eb
test byte [esi + 0x401c], 2
je 0x51f54a
cmp dword [edi + 0x140], 0
je 0x51f54a
or dword [ebp + 0x2a4], 0x100000
push str.Connect_me_again_please_n
push edi
call fcn.0051a600
add esp, 8
mov ecx, ebp
call fcn.0051f670
jmp 0x51f5b0
push dword [edi + 0x140]
call dword [0x593c28]
mov dword [edi + 0x140], 0
mov eax, dword [ebp + 0x2c8]
add esp, 4
mov eax, dword [eax + 0x44]
and eax, 0x200
mov ecx, 0
sete cl
test eax, eax
jne 0x51f599
mov edx, dword [ebp + 0x2a4]
mov eax, edx
and eax, 1
cmp ecx, eax
je 0x51f599
xor ecx, edx
and ecx, 1
xor ecx, edx
mov dword [ebp + 0x2a4], ecx
mov edx, dword [ebp + 0x1b8]
mov ecx, ebp
call fcn.00516300
mov dword [ebp + 0x1b8], 0xffffffff
mov dword [esi + 0x4018], 0
test dword [ebp + 0x2a4], 0x100000
jne 0x51ede4
push dword [edi + 0x100]
push str.Received_HTTP_code__d_from_proxy_after_CONNECT
push edi
call fcn.0051a7e0
add esp, 0xc
mov eax, 0x38
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x44
ret
mov dword [esi + 0x4018], 2
push dword [ebp + 0x2f4]
call dword [0x593c28]
add esp, 4
mov dword [ebp + 0x2f4], 0
mov eax, dword [edi + 0xd04]
push dword [edi + 0xf8c]
and eax, 0xfffffffd
or eax, 1
push str.Proxy_replied__d_to_CONNECT_request_n
push edi
mov dword [edi + 0xd04], eax
call fcn.0051a600
and dword [edi + 0x588], 0xfffffff7
and dword [ebp + 0x2a4], 0xfffeffff
add esp, 0xc
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x44
ret
push str.Proxy_CONNECT_aborted_due_to_timeout
push edi
call fcn.0051a7e0
add esp, 8
mov eax, 0x1c
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x44
ret