Function at 0x40d8e0
Capabilities:
Check http status code
Initialize winhttp library
Prepare http request
Read http header
Receive http response

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x49584e
mov eax, dword fs:[0]
push eax
sub esp, 0x1b8
mov eax, dword [0x4c0760]
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 esi, edx
mov ebx, ecx
mov eax, dword [ebp + 0xc]
mov dword [ebp - 0x18c], eax
mov eax, dword [ebp + 0x18]
mov dword [ebp - 0x184], eax
mov eax, dword [ebp + 0x1c]
mov ecx, dword [ebp + 0x34]
mov dword [ebp - 0x178], eax
mov eax, dword [ebp + 0x20]
mov edi, dword [ebp + 8]
mov dword [ebp - 0x17c], eax
mov eax, dword [ebp + 0x24]
mov dword [ebp - 0x1a0], eax
mov eax, dword [ebp + 0x28]
mov dword [ebp - 0x170], eax
mov eax, dword [ebp + 0x2c]
mov dword [ebp - 0x19c], eax
mov eax, dword [ebp + 0x30]
mov dword [ebp - 0x168], eax
mov eax, dword [ebp + 0x38]
mov dword [ebp - 0x1a4], eax
mov eax, dword [ebp + 0x3c]
mov dword [ebp - 0x1a8], eax
mov eax, dword [ebp + 0x40]
mov dword [ebp - 0x198], eax
xor eax, eax
mov dword [ebp - 0x16c], eax
mov dword [ebp - 0x180], eax
lea eax, [ebp - 0x164]
push eax
mov dword [ebp - 0x188], ecx
mov dword [ebp - 0x174], 0
mov dword [ebp - 0x18], 0
mov dword [ebp - 0x40], 0
mov dword [ebp - 0x164], 0x11c
call dword [sym.imp.ntdll.dll_RtlGetVersion]
test eax, eax
jne 0x40d9d1
cmp dword [ebp - 0x158], 0x2580
setbe cl
jmp 0x40d9d3
xor cl, cl
xor eax, eax
mov edx, 4
test cl, cl
mov ecx, dword [ebp - 0x170]
cmovne eax, edx
mov dword [ecx], 0
cmp dword [esi + 0x14], 8
jb 0x40d9f3
mov esi, dword [esi]
push 0
push 0
push 0
push eax
push esi
call dword [sym.imp.WINHTTP.dll_WinHttpOpen]
mov esi, eax
mov dword [ebp - 0x194], esi
test esi, esi
je 0x40df4e
cmp dword [edi + 0x14], 8
jb 0x40da19
mov edi, dword [edi]
push 0
push dword [ebp + 0x10]
push edi
push esi
call dword [sym.imp.WINHTTP.dll_WinHttpConnect]
mov edx, eax
mov dword [ebp - 0x190], edx
test edx, edx
je 0x40df3e
xor eax, eax
mov ecx, 0x800000
cmp byte [ebp + 0x14], al
cmovne eax, ecx
mov ecx, dword [ebp - 0x18c]
cmp dword [ecx + 0x14], 8
jb 0x40da51
mov ecx, dword [ecx]
cmp dword [ebx + 0x14], 8
jb 0x40da59
mov ebx, dword [ebx]
or eax, 0x100
push eax
push 0
push 0
push 0
push ecx
push ebx
push edx
call dword [sym.imp.WINHTTP.dll_WinHttpOpenRequest]
mov ebx, dword [sym.imp.WINHTTP.dll_WinHttpCloseHandle]
mov edi, eax
test edi, edi
je 0x40df25
mov ebx, dword [ebp - 0x168]
mov esi, dword [ebp - 0x180]
test esi, esi
je 0x40dae0
mov eax, dword [ebp - 0x188]
push 0
push 0x4a906c
push dword [eax + 0x10]
push ecx
mov ecx, eax
call fcn.0040ea00
test eax, eax
je 0x40dae0
mov ecx, dword [ebp - 0x1a4]
push 0
call fcn.0040b600
mov ecx, dword [ebp - 0x188]
push eax
call fcn.0040b600
push eax
push esi
push 1
push edi
call dword [sym.imp.WINHTTP.dll_WinHttpSetCredentials]
test eax, eax
jne 0x40dae0
push 0x1c
push str.WinHttpSetCredentials_fails_
mov ecx, ebx
call fcn.0040e3a0
mov eax, dword [ebp - 0x184]
mov ecx, dword [ebp - 0x178]
push 0
mov esi, dword [eax + 0x10]
mov eax, dword [ecx + 0x10]
push eax
push eax
call fcn.0040e000
push eax
test esi, esi
jne 0x40db04
push esi
push esi
jmp 0x40db11
mov ecx, dword [ebp - 0x184]
push esi
call fcn.0040b600
push eax
push edi
call dword [sym.imp.WINHTTP.dll_WinHttpSendRequest]
mov dword [ebp - 0x168], eax
test eax, eax
jne 0x40db2b
push 0x19
push str.WinHttpSendRequest_fails_
jmp 0x40db45
push 0
push edi
call dword [sym.imp.WINHTTP.dll_WinHttpReceiveResponse]
mov dword [ebp - 0x168], eax
test eax, eax
jne 0x40db68
push 0x1d
push str.WinHttpReceiveResponse_fails_
mov ecx, ebx
call fcn.0040e3a0
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x2f00
je 0x40da84
mov esi, dword [ebp - 0x168]
jmp 0x40dc1c
push 0
lea eax, [ebp - 0x18]
mov dword [ebp - 0x18], 4
push eax
push dword [ebp - 0x170]
push 0
push 0x20000013
push edi
call dword [sym.imp.WINHTTP.dll_WinHttpQueryHeaders]
mov esi, eax
mov dword [ebp - 0x168], esi
test esi, esi
jne 0x40dba3
push 0x1a
push str.WinHttpQueryHeaders_fails_
mov ecx, ebx
call fcn.0040e3a0
push 0
lea eax, [ebp - 0x18]
push eax
push 0
push 0
push 0x16
push edi
call dword [sym.imp.WINHTTP.dll_WinHttpQueryHeaders]
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x7a
jne 0x40dc1c
mov esi, dword [ebp - 0x1a0]
mov eax, dword [ebp - 0x18]
inc eax
mov ecx, dword [esi + 0x10]
cmp eax, ecx
ja 0x40dbef
cmp dword [esi + 0x14], 8
mov dword [esi + 0x10], eax
jb 0x40dbe5
mov ecx, dword [esi]
xor edx, edx
mov word [ecx + eax*2], dx
jmp 0x40dbfb
mov ecx, esi
xor edx, edx
mov word [ecx + eax*2], dx
jmp 0x40dbfb
sub eax, ecx
mov ecx, esi
push 0
push eax
call fcn.0040e0f0
push 0
lea eax, [ebp - 0x18]
mov ecx, esi
push eax
call fcn.0040b600
push eax
push 0
push 0x16
push edi
call dword [sym.imp.WINHTTP.dll_WinHttpQueryHeaders]
mov esi, eax
mov dword [ebp - 0x168], esi
test esi, esi
je 0x40dee6
mov dword [ebp - 0x20], 0xf
mov dword [ebp - 0x24], 0
mov byte [ebp - 0x34], 0
mov ecx, dword [ebp - 0x17c]
push 0
push 0x4a6b7d
mov dword [ebp - 4], 0
call fcn.00407cc0
mov esi, dword [ebp - 0x19c]
lea eax, [ebp - 0x18]
mov dword [ebp - 0x18], 0
push eax
push edi
call dword [sym.imp.WINHTTP.dll_WinHttpQueryDataAvailable]
test eax, eax
jne 0x40dcb7
push 0x24
push str.Error_in_WinHttpQueryDataAvailable:
mov ecx, ebx
call fcn.0040e3a0
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, eax
lea ecx, [ebp - 0x1c0]
call fcn.0040d650
push 0xffffffffffffffff
push 0
push eax
mov ecx, ebx
mov byte [ebp - 4], 1
call fcn.0040e2d0
mov byte [ebp - 4], 0
cmp dword [ebp - 0x1ac], 8
jb 0x40dcb7
push dword [ebp - 0x1c0]
call fcn.0046080a
add esp, 4
mov eax, dword [ebp - 0x18]
add dword [esi], eax
test eax, eax
je 0x40dda0
push 0
push 0x4a6b7d
lea ecx, [ebp - 0x34]
call fcn.00407cc0
mov ecx, dword [ebp - 0x18]
mov eax, dword [ebp - 0x24]
cmp ecx, eax
ja 0x40dcf1
cmp dword [ebp - 0x20], 0x10
lea eax, [ebp - 0x34]
mov dword [ebp - 0x24], ecx
cmovae eax, dword [ebp - 0x34]
mov byte [eax + ecx], 0
jmp 0x40dcfe
sub ecx, eax
push 0
push ecx
lea ecx, [ebp - 0x34]
call fcn.0040c230
push dword [ebp - 0x18]
cmp dword [ebp - 0x20], 0x10
lea eax, [ebp - 0x34]
push 0
cmovae eax, dword [ebp - 0x34]
push eax
call fcn.00462c70
add esp, 0xc
lea ecx, [ebp - 0x40]
cmp dword [ebp - 0x20], 0x10
lea eax, [ebp - 0x34]
cmovae eax, dword [ebp - 0x34]
push ecx
push dword [ebp - 0x18]
push eax
push edi
call dword [sym.imp.WINHTTP.dll_WinHttpReadData]
test eax, eax
jne 0x40dd83
push 0x1a
push str.Error_in_WinHttpReadData:
mov ecx, ebx
call fcn.0040e3a0
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, eax
lea ecx, [ebp - 0x1c0]
call fcn.0040d650
push 0xffffffffffffffff
push 0
push eax
mov ecx, ebx
mov byte [ebp - 4], 2
call fcn.0040e2d0
mov byte [ebp - 4], 0
cmp dword [ebp - 0x1ac], 8
jb 0x40dd96
push dword [ebp - 0x1c0]
call fcn.0046080a
add esp, 4
jmp 0x40dd96
mov ecx, dword [ebp - 0x17c]
lea eax, [ebp - 0x34]
push 0xffffffffffffffff
push 0
push eax
call fcn.004067a0
cmp dword [ebp - 0x18], 0
ja 0x40dc55
mov eax, dword [ebp - 0x170]
mov esi, dword [ebp - 0x168]
mov eax, dword [eax]
sub eax, 0x191
je 0x40de1f
sub eax, 6
je 0x40ddc9
mov dword [ebp - 0x16c], 1
jmp 0x40debc
lea eax, [ebp - 0x38]
push eax
lea eax, [ebp - 0x3c]
push eax
lea eax, [ebp - 0x1c]
push eax
push edi
call dword [sym.imp.WINHTTP.dll_WinHttpQueryAuthSchemes]
mov esi, eax
test esi, esi
jne 0x40ddf2
push 0x2a
push str.WinHttpQueryAuthSchemes_in_case_407_fails_
mov ecx, ebx
call fcn.0040e3a0
jmp 0x40de00
mov ecx, dword [ebp - 0x1c]
call fcn.0040df80
mov dword [ebp - 0x180], eax
cmp dword [ebp - 0x174], 0x197
jne 0x40debc
mov dword [ebp - 0x16c], 1
jmp 0x40debc
lea eax, [ebp - 0x38]
push eax
lea eax, [ebp - 0x3c]
push eax
lea eax, [ebp - 0x1c]
push eax
push edi
call dword [sym.imp.WINHTTP.dll_WinHttpQueryAuthSchemes]
mov esi, eax
mov dword [ebp - 0x168], esi
test esi, esi
jne 0x40de4e
push 0x2a
push str.WinHttpQueryAuthSchemes_in_case_401_fails_
mov ecx, ebx
call fcn.0040e3a0
jmp 0x40de9e
mov ecx, dword [ebp - 0x1c]
call fcn.0040df80
mov esi, eax
test esi, esi
jne 0x40de67
lea eax, [esi + 1]
mov esi, dword [ebp - 0x168]
jmp 0x40dea4
mov ecx, dword [ebp - 0x198]
push 0
call fcn.0040b600
mov ecx, dword [ebp - 0x1a8]
push eax
call fcn.0040b600
push eax
push esi
push dword [ebp - 0x38]
push edi
call dword [sym.imp.WINHTTP.dll_WinHttpSetCredentials]
mov esi, eax
test esi, esi
jne 0x40de9e
push str.WinHttpSetCredentials_in_case_401_fails_
mov ecx, ebx
call fcn.0040e0a0
mov eax, dword [ebp - 0x16c]
cmp dword [ebp - 0x174], 0x191
mov ecx, 1
cmove eax, ecx
mov dword [ebp - 0x16c], eax
mov dword [ebp - 4], 0xffffffff
cmp dword [ebp - 0x20], 0x10
jb 0x40ded4
push dword [ebp - 0x34]
call fcn.0046080a
add esp, 4
mov dword [ebp - 0x20], 0xf
mov dword [ebp - 0x24], 0
mov byte [ebp - 0x34], 0
mov eax, dword [ebp - 0x170]
mov eax, dword [eax]
mov dword [ebp - 0x174], eax
test esi, esi
je 0x40df05
cmp dword [ebp - 0x16c], 0
je 0x40da84
mov ebx, dword [sym.imp.WINHTTP.dll_WinHttpCloseHandle]
push edi
call ebx
push dword [ebp - 0x190]
call ebx
push dword [ebp - 0x194]
call ebx
test esi, esi
setne al
jmp 0x40df62
push dword [ebp - 0x190]
xor esi, esi
call ebx
push dword [ebp - 0x194]
call ebx
test esi, esi
setne al
jmp 0x40df62
push esi
call dword [sym.imp.WINHTTP.dll_WinHttpCloseHandle]
push 0x15
push str.WinHttpConnect_fails_
jmp 0x40df55
push 0x12
push str.WinHttpOpen_fails_
mov ecx, dword [ebp - 0x168]
call fcn.0040e3a0
xor al, al
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.0045fbcc
mov esp, ebp
pop ebp
ret