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

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x4fd839
mov eax, dword fs:[0]
push eax
sub esp, 0x1b4
mov eax, dword [0x53806c]
xor eax, ebp
mov dword [ebp - 0x10], eax
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov dword [ebp - 0x118], ecx
push 0
sub esp, 0x18
mov ecx, esp
mov dword [ebp - 0x154], esp
mov eax, dword [ebp - 0x118]
add eax, 0x1c
push eax
call fcn.00405700
lea ecx, [ebp - 0x178]
push ecx
call fcn.0040d570
add esp, 0x1c
mov dword [ebp - 0x130], eax
mov edx, dword [ebp - 0x130]
mov dword [ebp - 0x14c], edx
mov dword [ebp - 4], 0
mov ecx, dword [ebp - 0x14c]
call fcn.004052c0
mov edx, eax
lea ecx, [ebp - 0x5c]
call fcn.004a413f
add esp, 4
mov dword [ebp - 0x158], eax
mov byte [ebp - 4], 2
lea ecx, [ebp - 0x178]
call fcn.004054e0
push 0
sub esp, 0x18
mov ecx, esp
mov dword [ebp - 0x15c], esp
mov eax, dword [ebp - 0x118]
add eax, 0x1c
push eax
call fcn.00405700
lea ecx, [ebp - 0x190]
push ecx
call fcn.0040d670
add esp, 0x1c
mov dword [ebp - 0x148], eax
mov edx, dword [ebp - 0x148]
mov dword [ebp - 0x144], edx
mov byte [ebp - 4], 3
mov ecx, dword [ebp - 0x144]
call fcn.004052c0
mov edx, eax
lea ecx, [ebp - 0x44]
call fcn.004a413f
add esp, 4
mov dword [ebp - 0x160], eax
mov byte [ebp - 4], 5
lea ecx, [ebp - 0x190]
call fcn.004054e0
push 0
push 0
push 0
push 0
push 0x51902c
call dword [sym.imp.WINHTTP.dll_WinHttpOpen]
mov ecx, dword [ebp - 0x118]
mov dword [ecx], eax
push 0
push 0x50
lea ecx, [ebp - 0x5c]
call fcn.0040e230
push eax
mov edx, dword [ebp - 0x118]
mov eax, dword [edx]
push eax
call dword [sym.imp.WINHTTP.dll_WinHttpConnect]
mov ecx, dword [ebp - 0x118]
mov dword [ecx + 4], eax
push 0
push 0
push 0
push 0
lea ecx, [ebp - 0x44]
call fcn.0040e230
push eax
push 0x519068
mov edx, dword [ebp - 0x118]
mov eax, dword [edx + 4]
push eax
call dword [sym.imp.WINHTTP.dll_WinHttpOpenRequest]
mov ecx, dword [ebp - 0x118]
mov dword [ecx + 8], eax
mov edx, dword [ebp - 0x118]
cmp dword [edx + 8], 0
jne 0x40da65
push 0x409df0
push str.WinHttpOpenRequest_error_
push 0x53d8f0
call fcn.004097a0
add esp, 8
mov ecx, eax
call fcn.00406550
mov eax, dword [ebp - 0x118]
mov ecx, dword [eax + 4]
push ecx
call dword [sym.imp.WINHTTP.dll_WinHttpCloseHandle]
mov edx, dword [ebp - 0x118]
mov eax, dword [edx]
push eax
call dword [sym.imp.WINHTTP.dll_WinHttpCloseHandle]
mov byte [ebp - 0x11c], 0
mov byte [ebp - 4], 2
lea ecx, [ebp - 0x44]
call fcn.0040e2f0
mov dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x5c]
call fcn.0040e2f0
mov al, byte [ebp - 0x11c]
jmp 0x40df26
mov dword [ebp - 0x14], 0x3300
push 4
lea ecx, [ebp - 0x14]
push ecx
push 0x1f
mov edx, dword [ebp - 0x118]
mov eax, dword [edx + 8]
push eax
call dword [sym.imp.WINHTTP.dll_WinHttpSetOption]
push 0
push 0
push 0
push 0
push 0
push 0
mov ecx, dword [ebp - 0x118]
mov edx, dword [ecx + 8]
push edx
call dword [sym.imp.WINHTTP.dll_WinHttpSendRequest]
mov eax, dword [ebp - 0x118]
cmp dword [eax + 8], 0
jne 0x40db16
push 0x409df0
push str.WinHttpSendRequest_error_
push 0x53d8f0
call fcn.004097a0
add esp, 8
mov ecx, eax
call fcn.00406550
mov ecx, dword [ebp - 0x118]
mov edx, dword [ecx + 4]
push edx
call dword [sym.imp.WINHTTP.dll_WinHttpCloseHandle]
mov eax, dword [ebp - 0x118]
mov ecx, dword [eax]
push ecx
call dword [sym.imp.WINHTTP.dll_WinHttpCloseHandle]
mov byte [ebp - 0x119], 0
mov byte [ebp - 4], 2
lea ecx, [ebp - 0x44]
call fcn.0040e2f0
mov dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x5c]
call fcn.0040e2f0
mov al, byte [ebp - 0x119]
jmp 0x40df26
push 0
mov edx, dword [ebp - 0x118]
mov eax, dword [edx + 8]
push eax
call dword [sym.imp.WINHTTP.dll_WinHttpReceiveResponse]
mov ecx, dword [ebp - 0x118]
cmp dword [ecx + 8], 0
jne 0x40dbae
push 0x409df0
push str.WinHttpReceiveResponse_error_
push 0x53d8f0
call fcn.004097a0
add esp, 8
mov ecx, eax
call fcn.00406550
mov edx, dword [ebp - 0x118]
mov eax, dword [edx + 8]
push eax
call dword [sym.imp.WINHTTP.dll_WinHttpCloseHandle]
mov ecx, dword [ebp - 0x118]
mov edx, dword [ecx + 4]
push edx
call dword [sym.imp.WINHTTP.dll_WinHttpCloseHandle]
mov eax, dword [ebp - 0x118]
mov ecx, dword [eax]
push ecx
call dword [sym.imp.WINHTTP.dll_WinHttpCloseHandle]
mov byte [ebp - 0x11a], 0
mov byte [ebp - 4], 2
lea ecx, [ebp - 0x44]
call fcn.0040e2f0
mov dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x5c]
call fcn.0040e2f0
mov al, byte [ebp - 0x11a]
jmp 0x40df26
mov dword [ebp - 0x114], 0
mov dword [ebp - 0x120], 0
mov dword [ebp - 0x128], 0
mov edx, dword [ebp - 0x118]
cmp dword [edx + 8], 0
je 0x40dd8d
push 0
lea eax, [ebp - 0x114]
push eax
push 0
push 0
push 0x16
mov ecx, dword [ebp - 0x118]
mov edx, dword [ecx + 8]
push edx
call dword [sym.imp.WINHTTP.dll_WinHttpQueryHeaders]
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x7a
jne 0x40dd8d
mov eax, dword [ebp - 0x114]
shr eax, 1
xor ecx, ecx
mov edx, 2
mul edx
seto cl
neg ecx
or ecx, eax
push ecx
call fcn.004ba4ef
add esp, 4
mov dword [ebp - 0x150], eax
mov eax, dword [ebp - 0x150]
mov dword [ebp - 0x120], eax
push 0
lea ecx, [ebp - 0x114]
push ecx
mov edx, dword [ebp - 0x120]
push edx
push 0
push 0x16
mov eax, dword [ebp - 0x118]
mov ecx, dword [eax + 8]
push ecx
call dword [sym.imp.WINHTTP.dll_WinHttpQueryHeaders]
mov dword [ebp - 0x128], eax
cmp dword [ebp - 0x128], 0
je 0x40dd8d
push 0x409df0
mov edx, dword [ebp - 0x120]
push edx
mov ecx, 0x53d9d8
call fcn.0040e7e0
mov ecx, eax
call fcn.00406550
mov eax, dword [ebp - 0x120]
push eax
lea ecx, [ebp - 0x2c]
call fcn.0040e3d0
mov byte [ebp - 4], 6
lea ecx, [ebp - 0x2c]
call fcn.004052a0
mov dword [ebp - 0x134], eax
push 0
push str.Content_Length:
lea ecx, [ebp - 0x2c]
call fcn.0040e1b0
mov dword [ebp - 0x124], eax
mov dword [ebp - 0x12c], 0x10
mov ecx, dword [ebp - 0x134]
sub ecx, dword [ebp - 0x12c]
push ecx
mov edx, dword [ebp - 0x124]
add edx, dword [ebp - 0x12c]
push edx
lea eax, [ebp - 0x1a8]
push eax
lea ecx, [ebp - 0x2c]
call fcn.0040e160
mov dword [ebp - 0x138], eax
mov ecx, dword [ebp - 0x138]
push ecx
lea ecx, [ebp - 0x2c]
call fcn.0040e340
lea ecx, [ebp - 0x1a8]
call fcn.0040e2f0
push 0
push 0x5190ec
lea ecx, [ebp - 0x2c]
call fcn.0040e1b0
mov dword [ebp - 0x124], eax
mov edx, dword [ebp - 0x124]
push edx
push 0
lea eax, [ebp - 0x1c0]
push eax
lea ecx, [ebp - 0x2c]
call fcn.0040e160
mov dword [ebp - 0x13c], eax
mov ecx, dword [ebp - 0x13c]
push ecx
lea ecx, [ebp - 0x2c]
call fcn.0040e340
lea ecx, [ebp - 0x1c0]
call fcn.0040e2f0
lea ecx, [ebp - 0x2c]
call fcn.0040e230
push eax
call fcn.004e34ab
add esp, 4
mov edx, dword [ebp - 0x118]
mov dword [edx + 0xc], eax
mov byte [ebp - 4], 5
lea ecx, [ebp - 0x2c]
call fcn.0040e2f0
lea eax, [ebp - 0x110]
push eax
mov ecx, dword [ebp - 0x118]
mov edx, dword [ecx + 8]
push edx
call dword [sym.imp.WINHTTP.dll_WinHttpQueryDataAvailable]
mov eax, dword [ebp - 0x110]
add eax, 1
push eax
call fcn.004ba4ef
add esp, 4
mov dword [ebp - 0x140], eax
mov ecx, dword [ebp - 0x118]
mov edx, dword [ebp - 0x140]
mov dword [ecx + 0x18], edx
mov eax, dword [ebp - 0x110]
add eax, 1
push eax
push 0
mov ecx, dword [ebp - 0x118]
mov edx, dword [ecx + 0x18]
push edx
call fcn.004d66a0
add esp, 0xc
push 0xb0
lea ecx, [ebp - 0x10c]
call fcn.00403160
push 1
push 0x40
push 0x20
mov eax, dword [ebp - 0x118]
add eax, 0x34
push eax
lea ecx, [ebp - 0x10c]
call fcn.0040e630
mov byte [ebp - 4], 7
mov ecx, dword [ebp - 0x118]
add ecx, 0x10
push ecx
mov edx, dword [ebp - 0x110]
push edx
mov eax, dword [ebp - 0x118]
mov ecx, dword [eax + 0x18]
push ecx
mov edx, dword [ebp - 0x118]
mov eax, dword [edx + 8]
push eax
call dword [sym.imp.WINHTTP.dll_WinHttpReadData]
test eax, eax
je 0x40ded2
mov ecx, dword [ebp - 0x118]
mov edx, dword [ecx + 0x14]
mov eax, dword [ebp - 0x118]
add edx, dword [eax + 0x10]
mov ecx, dword [ebp - 0x118]
mov dword [ecx + 0x14], edx
mov edx, dword [ebp - 0x118]
mov eax, dword [edx + 0x10]
xor ecx, ecx
push ecx
push eax
mov edx, dword [ebp - 0x118]
mov eax, dword [edx + 0x18]
push eax
lea ecx, [ebp - 0x10c]
call fcn.0040e690
mov ecx, dword [ebp - 0x118]
add ecx, 0x50
call fcn.0040e070
movzx ecx, al
test ecx, ecx
je 0x40debf
mov edx, dword [ebp - 0x118]
mov eax, dword [edx + 0x14]
push eax
mov ecx, dword [ebp - 0x118]
mov edx, dword [ecx + 0xc]
push edx
mov ecx, dword [ebp - 0x118]
add ecx, 0x50
call fcn.00410f80
mov eax, dword [ebp - 0x118]
cmp dword [eax + 0x10], 0
jne 0x40decd
jmp 0x40ded2
jmp 0x40de18
lea ecx, [ebp - 0x10c]
call fcn.0040e600
mov ecx, dword [ebp - 0x118]
mov edx, dword [ebp - 0x118]
mov eax, dword [edx + 0xc]
mov dword [ecx + 0x14], eax
mov byte [ebp - 0x11b], 1
mov byte [ebp - 4], 5
lea ecx, [ebp - 0x10c]
call fcn.00403a30
mov byte [ebp - 4], 2
lea ecx, [ebp - 0x44]
call fcn.0040e2f0
mov dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x5c]
call fcn.0040e2f0
mov al, byte [ebp - 0x11b]
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.004b9f48
mov esp, ebp
pop ebp
ret