Function at 0x402640
Capabilities:
Initialize winhttp library
Prepare http request
Read http header
Receive http response
Set http header

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x43acf3
mov eax, dword fs:[0]
push eax
mov eax, 0x6ed0
call fcn.00439c70
mov eax, dword [0x44f008]
xor eax, ebp
mov dword [ebp - 0x14], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov edi, ecx
mov dword [ebp - 0x6ecc], edi
mov ebx, dword [ebp + 8]
sub esp, 0x18
mov eax, dword [ebp + 0xc]
mov ecx, esp
mov esi, dword [ebp + 0x10]
mov dword [ebp - 4], 0
mov dword [ebp - 0x6edc], ebx
push eax
mov dword [ebp - 0x6ec8], ebx
mov dword [ebp - 0x6ed4], 0
call fcn.00406430
lea eax, [ebp - 0x6eb8]
push eax
call fcn.00402020
mov dword [ebp - 4], 1
xorps xmm0, xmm0
movq qword [ebx], xmm0
mov dword [ebx + 8], 0
mov dword [ebx], 0
mov dword [ebx + 4], 0
mov dword [ebx + 8], 0
push 0
push 0
push 0
push 1
push dword [edi]
mov dword [ebp - 0x6ed4], 1
call dword [sym.imp.WINHTTP.dll_WinHttpOpen]
mov ecx, eax
mov dword [ebp - 0x6ed0], ecx
test ecx, ecx
je 0x402d9b
cmp dword [ebp - 0x6ea4], 8
lea eax, [ebp - 0x6eb8]
push 0
push dword [ebp - 0x6e88]
cmovae eax, dword [ebp - 0x6eb8]
push eax
push ecx
call dword [sym.imp.WINHTTP.dll_WinHttpConnect]
mov edx, eax
mov dword [ebp - 0x6ed8], edx
test edx, edx
je 0x402d8f
cmp dword [ebp - 0x6e8c], 8
lea eax, [ebp - 0x6ea0]
mov ecx, esi
cmovae eax, dword [ebp - 0x6ea0]
cmp dword [esi + 0x14], 8
jb 0x40275c
mov ecx, dword [esi]
push dword [ebp - 0x6e84]
push 0
push 0
push 0
push eax
push ecx
push edx
call dword [sym.imp.WINHTTP.dll_WinHttpOpenRequest]
mov dword [ebp - 0x6ec4], eax
test eax, eax
je 0x402d81
mov eax, dword [esi + 0x18]
xor ecx, ecx
mov esi, dword [esi + 0x1c]
mov ebx, dword [edi + 0x44]
sub esi, eax
mov dword [ebp - 0x6ec0], esi
cmovne ecx, eax
cmp dword [edi + 0x48], 0x10
lea eax, [edi + 0x34]
mov dword [ebp - 0x6ebc], ecx
jb 0x4027aa
mov edi, dword [eax]
add ebx, edi
jmp 0x4027ae
add ebx, eax
mov edi, eax
xor eax, eax
mov dword [ebp - 0x6e50], eax
cmp edi, ebx
jne 0x4027d7
mov ecx, 7
mov dword [ebp - 0x6e40], eax
mov dword [ebp - 0x6e3c], ecx
mov word [ebp - 0x6e50], ax
jmp 0x4028fd
mov ecx, ebx
xor edx, edx
sub ecx, edi
mov dword [ebp - 0x6e40], edx
mov esi, 7
mov dword [ebp - 0x6e3c], esi
cmp ecx, 0x7ffffffe
ja 0x402dc6
cmp ecx, 8
jb 0x4028a0
mov esi, ecx
or esi, 7
cmp esi, 0x7ffffffe
jbe 0x402817
mov esi, 0x7ffffffe
jmp 0x402821
mov eax, 0xa
cmp esi, eax
cmovb esi, eax
xor ecx, ecx
mov eax, esi
add eax, 1
setb cl
neg ecx
or ecx, eax
cmp ecx, 0x7fffffff
ja 0x402dd0
add ecx, ecx
cmp ecx, 0x1000
jb 0x402874
lea eax, [ecx + 0x23]
cmp eax, ecx
jbe 0x402dd0
push eax
call fcn.004182a2
mov ecx, eax
add esp, 4
test ecx, ecx
je 0x402dda
lea eax, [ecx + 0x23]
and eax, 0xffffffe0
mov dword [eax - 4], ecx
mov edx, dword [ebp - 0x6e40]
jmp 0x40288b
test ecx, ecx
je 0x402889
push ecx
call fcn.004182a2
mov edx, dword [ebp - 0x6e40]
add esp, 4
jmp 0x40288b
xor eax, eax
mov dword [ebp - 0x6e50], eax
mov dword [ebp - 0x6e3c], esi
nop word [eax + eax]
cmp esi, 8
lea ecx, [ebp - 0x6e50]
cmovae ecx, eax
movsx ax, byte [edi]
inc edi
movzx eax, ax
mov word [ecx + edx*2], ax
mov edx, dword [ebp - 0x6e40]
inc edx
mov dword [ebp - 0x6e40], edx
cmp edi, ebx
je 0x4028d7
mov esi, dword [ebp - 0x6e3c]
mov eax, dword [ebp - 0x6e50]
jmp 0x4028a0
cmp dword [ebp - 0x6e3c], 8
lea eax, [ebp - 0x6e50]
mov esi, dword [ebp - 0x6ec0]
cmovae eax, dword [ebp - 0x6e50]
xor ecx, ecx
mov word [eax + edx*2], cx
mov ecx, dword [ebp - 0x6e3c]
mov edi, dword [ebp - 0x6ecc]
lea eax, [ebp - 0x6e50]
mov ebx, dword [ebp - 0x6ec4]
cmp ecx, 8
push 0x80000000
mov byte [ebp - 4], 2
push dword [edi + 0x4c]
cmovae eax, dword [ebp - 0x6e50]
push eax
push ebx
call dword [sym.imp.WINHTTP.dll_WinHttpAddRequestHeaders]
cmp dword [ebp - 0x6e3c], 8
lea eax, [ebp - 0x6e50]
push 0
cmovae eax, dword [ebp - 0x6e50]
push esi
push esi
push dword [ebp - 0x6ebc]
push dword [edi + 0x4c]
push eax
push ebx
call dword [sym.imp.WINHTTP.dll_WinHttpSendRequest]
test eax, eax
je 0x402d34
push 0
push ebx
call dword [sym.imp.WINHTTP.dll_WinHttpReceiveResponse]
test eax, eax
je 0x402d34
push 0x4e20
lea eax, [ebp - 0x6e34]
mov dword [ebp - 0x6e38], 0
push 0
push eax
call fcn.0041b750
mov esi, dword [sym.imp.WINHTTP.dll_WinHttpQueryHeaders]
lea eax, [ebp - 0x6e38]
add esp, 0xc
push 0
push eax
push 0
push 0
push 0x80000016
push ebx
call esi
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x7a
jne 0x402c9b
push 0
lea eax, [ebp - 0x6e38]
push eax
lea eax, [ebp - 0x6e34]
push eax
push 0
push 0x80000016
push ebx
call esi
push 0
push 0x448dac
lea ecx, [ebp - 0x6e80]
mov dword [ebp - 0x6e80], 0
mov dword [ebp - 0x6e70], 0
mov dword [ebp - 0x6e6c], 0
call fcn.00408d00
xor esi, esi
mov byte [ebp - 4], 3
cmp dword [ebp - 0x6e38], esi
jbe 0x402a73
mov ecx, dword [ebp - 0x6e70]
mov edi, dword [ebp - 0x6e6c]
movzx edx, word [ebp + esi*2 - 0x6e34]
cmp ecx, edi
jae 0x402a4f
lea eax, [ecx + 1]
cmp edi, 8
mov dword [ebp - 0x6e70], eax
lea eax, [ebp - 0x6e80]
cmovae eax, dword [ebp - 0x6e80]
mov word [eax + ecx*2], dx
xor edx, edx
mov word [eax + ecx*2 + 2], dx
jmp 0x402a6a
push edx
mov byte [ebp - 0x6ec0], 0
lea ecx, [ebp - 0x6e80]
push dword [ebp - 0x6ec0]
push 1
call fcn.00409150
inc esi
cmp esi, dword [ebp - 0x6e38]
jb 0x402a11
mov esi, dword [ebp - 0x6e6c]
lea edx, [ebp - 0x6e80]
mov eax, dword [ebp - 0x6e70]
lea edi, [ebp - 0x6e80]
cmp esi, 8
cmovae edx, dword [ebp - 0x6e80]
cmovae edi, dword [ebp - 0x6e80]
lea edx, [edx + eax*2]
xor eax, eax
mov dword [ebp - 0x6ec0], edx
mov dword [ebp - 0x6e68], eax
cmp edi, edx
jne 0x402acf
xor edx, edx
mov byte [ebp - 0x6e68], al
mov ecx, 0xf
mov dword [ebp - 0x6e58], edx
mov dword [ebp - 0x6e54], ecx
jmp 0x402be0
mov ecx, edx
xor ebx, ebx
sub ecx, edi
mov dword [ebp - 0x6e58], ebx
sar ecx, 1
mov esi, 0xf
mov dword [ebp - 0x6e54], esi
cmp ecx, 0x7fffffff
ja 0x402dcb
cmp ecx, 0x10
jb 0x402b83
mov esi, ecx
or esi, 0xf
cmp esi, 0x7fffffff
jbe 0x402b11
mov esi, 0x7fffffff
jmp 0x402b1b
mov eax, 0x16
cmp esi, eax
cmovb esi, eax
xor ecx, ecx
mov eax, esi
add eax, 1
setb cl
neg ecx
or ecx, eax
cmp ecx, 0x1000
jb 0x402b60
lea eax, [ecx + 0x23]
cmp eax, ecx
jbe 0x402dd0
push eax
call fcn.004182a2
mov ecx, eax
add esp, 4
test ecx, ecx
je 0x402dd5
mov edx, dword [ebp - 0x6ec0]
lea eax, [ecx + 0x23]
and eax, 0xffffffe0
mov dword [eax - 4], ecx
jmp 0x402b77
test ecx, ecx
je 0x402b75
push ecx
call fcn.004182a2
mov edx, dword [ebp - 0x6ec0]
add esp, 4
jmp 0x402b77
xor eax, eax
mov dword [ebp - 0x6e68], eax
mov dword [ebp - 0x6e54], esi
cmp esi, 0x10
lea ecx, [ebp - 0x6e68]
cmovae ecx, eax
mov al, byte [edi]
add edi, 2
mov byte [ebx + ecx], al
mov ebx, dword [ebp - 0x6e58]
inc ebx
mov dword [ebp - 0x6e58], ebx
cmp edi, edx
je 0x402bb6
mov esi, dword [ebp - 0x6e54]
mov eax, dword [ebp - 0x6e68]
jmp 0x402b83
cmp dword [ebp - 0x6e54], 0x10
lea eax, [ebp - 0x6e68]
cmovae eax, dword [ebp - 0x6e68]
mov byte [ebx + eax], 0
mov esi, dword [ebp - 0x6e6c]
mov ecx, dword [ebp - 0x6e54]
mov edx, dword [ebp - 0x6e58]
mov ebx, dword [ebp - 0x6ecc]
lea eax, [ebp - 0x6e68]
mov byte [ebp - 4], 4
lea edi, [ebx + 0x34]
cmp edi, eax
je 0x402c1c
cmp ecx, 0x10
mov ecx, edi
push edx
cmovae eax, dword [ebp - 0x6e68]
push eax
call fcn.004075d0
mov esi, dword [ebp - 0x6e6c]
mov ecx, dword [ebp - 0x6e54]
mov edx, dword [ebp - 0x6e58]
mov dword [ebx + 0x4c], edx
mov byte [ebp - 4], 3
cmp ecx, 0x10
jb 0x402c5d
mov edx, dword [ebp - 0x6e68]
inc ecx
mov eax, edx
cmp ecx, 0x1000
jb 0x402c4d
mov edx, dword [eax - 4]
add ecx, 0x23
sub eax, edx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x402dd5
push ecx
push edx
call fcn.00418523
mov esi, dword [ebp - 0x6e6c]
add esp, 8
mov byte [ebp - 4], 2
cmp esi, 8
jb 0x402c9b
mov ecx, dword [ebp - 0x6e80]
lea esi, [esi*2 + 2]
mov eax, ecx
cmp esi, 0x1000
jb 0x402c91
mov ecx, dword [eax - 4]
add esi, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x402dd5
push esi
push ecx
call fcn.00418523
add esp, 8
push 0x2000
lea eax, [ebp - 0x2014]
push 0
push eax
call fcn.0041b750
mov edi, dword [sym.imp.WINHTTP.dll_WinHttpReadData]
add esp, 0xc
mov ebx, dword [ebp - 0x6edc]
mov dword [ebp - 0x6ebc], 0
nop word [eax + eax]
lea eax, [ebp - 0x6ebc]
push eax
push 0x2000
lea eax, [ebp - 0x2014]
push eax
push dword [ebp - 0x6ec4]
call edi
test eax, eax
je 0x402d2e
mov eax, dword [ebp - 0x6ebc]
lea ecx, [ebp - 0x2014]
add eax, ecx
push ebx
push eax
mov eax, ecx
push eax
mov eax, dword [ebp - 0x6ec8]
mov ecx, eax
push dword [eax + 4]
call fcn.00409eb0
mov esi, dword [ebp - 0x6ebc]
lea eax, [ebp - 0x2014]
push esi
push 0
push eax
call fcn.0041b750
add esp, 0xc
test esi, esi
jne 0x402cd0
mov ebx, dword [ebp - 0x6ec4]
mov esi, dword [sym.imp.WINHTTP.dll_WinHttpCloseHandle]
push ebx
call esi
mov ecx, dword [ebp - 0x6e3c]
cmp ecx, 8
jb 0x402d79
mov edx, dword [ebp - 0x6e50]
lea ecx, [ecx*2 + 2]
mov eax, edx
cmp ecx, 0x1000
jb 0x402d6f
mov edx, dword [eax - 4]
add ecx, 0x23
sub eax, edx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x402dda
push ecx
push edx
call fcn.00418523
add esp, 8
mov ebx, dword [ebp - 0x6ec8]
jmp 0x402d87
mov esi, dword [sym.imp.WINHTTP.dll_WinHttpCloseHandle]
push dword [ebp - 0x6ed8]
call esi
push dword [ebp - 0x6ed0]
call dword [sym.imp.WINHTTP.dll_WinHttpCloseHandle]
lea ecx, [ebp - 0x6eb8]
call fcn.004034d0
mov eax, ebx
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x14]
xor ecx, ebp
call fcn.00418044
mov esp, ebp
pop ebp
ret 0xc
call fcn.00401320
call fcn.00401320
call fcn.00401280
call fcn.00421336
call fcn.00421336
int3