Function at 0x40c5f0
Capabilities:
Prepare http request
Receive http response
Set http header

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x44bdb7
mov eax, dword fs:[0]
push eax
sub esp, 0x15c
mov eax, dword [0x461c88]
xor eax, ebp
mov dword [ebp - 0x10], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov eax, dword [ebp + 8]
mov ebx, dword [ebp + 0x30]
mov edi, dword [ebp + 0x34]
mov dword [ebp - 0xa8], eax
mov eax, dword [ebp + 0x24]
mov dword [ebp - 0x8c], eax
mov eax, dword [ebp + 0x2c]
mov dword [ebp - 0x9c], eax
mov eax, dword [ebp + 0x38]
mov dword [ebp - 0xa4], eax
mov eax, dword [ebp + 0x3c]
mov dword [ebp - 0xa0], eax
mov eax, dword [ebp + 0x44]
mov dword [ebp - 0x90], ebx
mov dword [ebp - 0x94], eax
xor eax, eax
mov dword [ebp - 4], 0
mov dword [ebp - 0x2c], 7
mov dword [ebp - 0x30], 0
mov word [ebp - 0x40], ax
push 0xffffffffffffffff
push eax
mov dword [ebp - 0x48], eax
mov word [ebp - 0x58], ax
lea eax, [ebp + 0xc]
push eax
lea ecx, [ebp - 0x58]
mov byte [ebp - 4], 1
mov dword [ebp - 0x44], 7
call fcn.00402590
cmp word [ebx], 0
mov byte [ebp - 4], 2
jne 0x40c6aa
xor ecx, ecx
jmp 0x40c6bf
mov ecx, ebx
lea edx, [ecx + 2]
nop
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x40c6b0
sub ecx, edx
sar ecx, 1
push ecx
push ebx
lea ecx, [ebp - 0x58]
call fcn.0040cd90
xor esi, esi
mov dword [ebp - 0x98], esi
push dword [ebp - 0x8c]
mov byte [ebp - 4], 3
push esi
push esi
push esi
push ebx
push edi
push dword [ebp - 0xa8]
call dword [sym.imp.WINHTTP.dll_WinHttpOpenRequest]
mov ebx, eax
mov dword [ebp - 0x8c], ebx
test ebx, ebx
jne 0x40c741
lea ecx, [ebp - 0x168]
call fcn.004066b0
mov edi, eax
mov eax, dword [sym.imp.KERNEL32.dll_GetLastError]
mov byte [ebp - 4], 4
call eax
push eax
push str.Could_not_open_request__last_error
mov ecx, edi
call fcn.00408060
push eax
call fcn.004038c0
add esp, 8
mov ecx, eax
call fcn.0040aec0
lea ecx, [ebp - 0x168]
mov byte [ebp - 4], 3
call fcn.00406a00
jmp 0x40ca59
mov eax, dword [ebp - 0xa4]
mov ecx, dword [eax + 0x10]
test ecx, ecx
je 0x40c7a3
cmp dword [eax + 0x14], 8
jb 0x40c756
mov eax, dword [eax]
push 0x1000000
push ecx
push eax
push ebx
call dword [sym.imp.WINHTTP.dll_WinHttpAddRequestHeaders]
test eax, eax
jne 0x40c7a3
push str.Could_not_set_headers
lea ecx, [ebp - 0x28]
call fcn.00401590
lea eax, [ebp - 0x28]
push eax
mov byte [ebp - 4], 5
call fcn.0040d190
add esp, 4
cmp dword [ebp - 0x14], 0x10
mov byte [ebp - 4], 3
jb 0x40ca59
push dword [ebp - 0x28]
call fcn.00419e3e
add esp, 4
jmp 0x40ca59
mov ecx, dword [ebp - 0xa0]
test ecx, ecx
jne 0x40c85f
mov eax, 0x44fc90
mov cx, word [edi]
cmp cx, word [eax]
jne 0x40c7dc
test cx, cx
je 0x40c7d8
mov cx, word [edi + 2]
cmp cx, word [eax + 2]
jne 0x40c7dc
add edi, 4
add eax, 4
test cx, cx
jne 0x40c7b6
xor eax, eax
jmp 0x40c7e1
sbb eax, eax
or eax, 1
test eax, eax
je 0x40c7ff
cmp dword [0x4615ec], 0x10
mov eax, dword [0x4615e8]
mov ecx, 0x4615d8
cmovae ecx, dword [0x4615d8]
jmp 0x40c862
push str.content_length:0_r_n
lea ecx, [ebp - 0x40]
call fcn.0040c060
cmp dword [ebp - 0x2c], 8
push 0x1000000
push dword [ebp - 0x30]
lea eax, [ebp - 0x40]
cmovae eax, dword [ebp - 0x40]
push eax
push ebx
call dword [sym.imp.WINHTTP.dll_WinHttpAddRequestHeaders]
test eax, eax
jne 0x40c859
push str.Could_not_set_content_length_headers
lea ecx, [ebp - 0x28]
call fcn.00401590
lea eax, [ebp - 0x28]
push eax
mov byte [ebp - 4], 6
call fcn.0040d190
add esp, 4
lea ecx, [ebp - 0x28]
mov byte [ebp - 4], 3
call fcn.004016f0
jmp 0x40ca59
mov ecx, dword [ebp - 0xa0]
mov eax, dword [ebp + 0x40]
push 0
push eax
push eax
push ecx
push 0
push 0
push ebx
call dword [sym.imp.WINHTTP.dll_WinHttpSendRequest]
test eax, eax
jne 0x40c882
mov eax, dword [sym.imp.KERNEL32.dll_GetLastError]
call eax
jmp 0x40ca59
push 0xdeadbeef
call dword [sym.imp.KERNEL32.dll_SetLastError]
push 0
push ebx
call dword [sym.imp.WINHTTP.dll_WinHttpReceiveResponse]
test eax, eax
jne 0x40c947
mov eax, dword [sym.imp.KERNEL32.dll_GetLastError]
call eax
cmp eax, 0x2ee2
je 0x40ca59
mov ecx, dword [ebp - 0x94]
test ecx, ecx
je 0x40c8c1
mov dword [ecx], eax
jmp 0x40ca59
push eax
push str.__last_error
sub esp, 0x18
mov ecx, esp
push dword [ebp - 0x90]
call fcn.00401690
lea eax, [ebp - 0x28]
push eax
call fcn.0040a340
add esp, 0x1c
mov edi, eax
lea ecx, [ebp - 0x168]
mov byte [ebp - 4], 7
call fcn.004066b0
push edi
push str.Failed_to_receive_response_for_URL
mov ecx, eax
mov byte [ebp - 4], 8
call fcn.00408030
push eax
call fcn.004038c0
add esp, 8
push eax
call fcn.004035d0
add esp, 8
push eax
call fcn.004038c0
add esp, 8
mov ecx, eax
call fcn.0040aec0
lea ecx, [ebp - 0x168]
mov byte [ebp - 4], 7
call fcn.00406a00
lea ecx, [ebp - 0x28]
mov byte [ebp - 4], 3
call fcn.004016f0
jmp 0x40ca59
mov ebx, dword [ebp - 0x9c]
lea eax, [ebp - 0x8c]
push ebx
push eax
call fcn.0040c180
add esp, 8
test al, al
jne 0x40c9f4
mov dword [ebp - 0x14], 0xf
mov dword [ebp - 0x18], 0
mov byte [ebp - 0x28], al
push dword [ebp - 0x90]
lea ecx, [ebp - 0x70]
mov byte [ebp - 4], 9
call fcn.00401690
cmp dword [ebp - 0x5c], 8
lea eax, [ebp - 0x94]
lea edi, [ebp - 0x70]
cmovae edi, dword [ebp - 0x70]
push eax
lea ecx, [ebp - 0x70]
mov byte [ebp - 4], 0xa
call fcn.00402970
push dword [eax]
lea ecx, [ebp - 0x28]
push edi
call fcn.00409ac0
lea eax, [ebp - 0x28]
push eax
lea eax, [ebp - 0x88]
push str.Failed_to_read_header
push eax
call fcn.0040be50
push eax
mov byte [ebp - 4], 0xb
call fcn.0040d190
add esp, 0x10
lea ecx, [ebp - 0x88]
call fcn.004016f0
lea ecx, [ebp - 0x70]
call fcn.00401720
lea ecx, [ebp - 0x28]
mov byte [ebp - 4], 3
call fcn.004016f0
jmp 0x40ca53
cmp byte [ebp + 0x28], 0
mov dword [ebp - 0x90], 0
je 0x40ca53
lea eax, [ebp - 0x90]
push eax
push ebx
lea eax, [ebp - 0x98]
push eax
lea eax, [ebp - 0x8c]
push eax
call fcn.0040c2f0
add esp, 0x10
test al, al
je 0x40ca4d
mov eax, dword [ebp - 0x90]
test eax, eax
je 0x40ca4d
push eax
mov eax, dword [ebp - 0x98]
push ecx
mov ecx, esp
xor esi, esi
mov dword [ecx], eax
mov ecx, ebx
mov dword [ebp - 0x98], esi
call fcn.0040d3e0
jmp 0x40ca53
mov esi, dword [ebp - 0x98]
mov ebx, dword [ebp - 0x8c]
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov ecx, dword [ebp - 0x9c]
mov dword [ecx + 0x28], eax
test eax, eax
je 0x40caa6
cmp eax, 0x2ef1
jne 0x40caa6
lea ecx, [ebp - 0x168]
call fcn.004066b0
push str.operation_got_cancelled_
mov ecx, eax
mov byte [ebp - 4], 0xc
call fcn.00408060
push eax
call fcn.004038c0
add esp, 8
lea ecx, [ebp - 0x168]
mov byte [ebp - 4], 3
call fcn.00406a00
test ebx, ebx
je 0x40cab1
push ebx
call dword [sym.imp.WINHTTP.dll_WinHttpCloseHandle]
push esi
call fcn.0041a5c4
add esp, 4
cmp dword [ebp - 0x44], 8
jb 0x40cacb
push dword [ebp - 0x58]
call fcn.00419e3e
add esp, 4
xor eax, eax
cmp dword [ebp - 0x2c], 8
mov dword [ebp - 0x44], 7
mov dword [ebp - 0x48], 0
mov word [ebp - 0x58], ax
jb 0x40caf0
push dword [ebp - 0x40]
call fcn.00419e3e
add esp, 4
xor eax, eax
cmp dword [ebp + 0x20], 8
mov dword [ebp - 0x2c], 7
mov dword [ebp - 0x30], 0
mov word [ebp - 0x40], ax
jb 0x40cb15
push dword [ebp + 0xc]
call fcn.00419e3e
add esp, 4
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.0041a5c9
mov esp, ebp
pop ebp
ret