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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x434
push ebx
push esi
mov esi, ecx
push edi
mov edi, edx
test esi, esi
je 0x40bf79
cmp byte [esi], 0
je 0x40bf79
xor ebx, ebx
push ebx
push ebx
push ebx
push ebx
push 0x44fda8
mov dword [ebp - 0x20], ebx
mov dword [ebp - 0xc], ebx
call dword [sym.imp.WINHTTP.dll_WinHttpOpen]
mov dword [ebp - 0x34], eax
test eax, eax
je 0x40bf79
push 0x44fe04
lea ecx, [ebp - 0x24]
call fcn.004025b6
cmp dword [ebp + 8], ebx
je 0x40bbea
cmp dword [ebp + 0xc], ebx
jle 0x40bbea
push str.POST
lea ecx, [ebp - 0x24]
call fcn.0040bff3
call fcn.0040129e
push eax
lea ecx, [ebp - 8]
call fcn.004028e5
test edi, edi
je 0x40bc43
mov ecx, edi
lea edx, [ecx + 1]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x40bc01
sub ecx, edx
lea eax, [ecx + 1]
mov dword [ebp - 4], eax
cmp eax, 0x3fffffff
jle 0x40bc1b
mov edi, ebx
jmp 0x40bc32
add eax, eax
call fcn.0044c2f1
mov ecx, esp
mov edx, edi
push 3
push dword [ebp - 4]
call fcn.00409179
mov edi, eax
mov ecx, edi
call fcn.00401bae
push eax
push edi
lea ecx, [ebp - 8]
call fcn.00401b24
call fcn.0040129e
push eax
lea ecx, [ebp - 0x2c]
call fcn.004028e5
call fcn.0040129e
push eax
lea ecx, [ebp - 0x10]
call fcn.004028e5
call fcn.0040129e
push eax
lea ecx, [ebp - 0x28]
call fcn.004028e5
mov ecx, esi
lea edx, [ecx + 1]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x40bc72
sub ecx, edx
lea edi, [ecx + 1]
cmp edi, 0x3fffffff
jle 0x40bc8a
mov eax, ebx
jmp 0x40bc9e
lea eax, [edi + edi]
call fcn.0044c2f1
mov ecx, esp
mov edx, esi
push 3
push edi
call fcn.00409179
push ecx
lea ecx, [ebp - 0x28]
push ecx
lea ecx, [ebp - 4]
push ecx
lea ecx, [ebp - 0x10]
push ecx
lea edx, [ebp - 0x2c]
mov ecx, eax
call fcn.00405ad3
mov esi, dword [ebp - 8]
add esp, 0x10
mov edi, dword [ebp - 0x10]
test al, al
je 0x40bf18
push ebx
push dword [ebp - 4]
push edi
push dword [ebp - 0x34]
call dword [sym.imp.WINHTTP.dll_WinHttpConnect]
mov dword [ebp - 4], eax
test eax, eax
je 0x40bf18
push str.https
push 5
lea eax, [ebp - 8]
push eax
lea ecx, [ebp - 0x2c]
call fcn.0040af65
mov ecx, eax
call fcn.0040c04d
mov ecx, dword [ebp - 8]
neg eax
sbb ebx, ebx
and ebx, 0xff800000
lea ecx, [ecx - 0x10]
add ebx, 0x800000
call fcn.0040169b
push ebx
xor ebx, ebx
push ebx
push ebx
push ebx
push dword [ebp - 0x28]
push dword [ebp - 0x24]
push dword [ebp - 4]
call dword [sym.imp.WINHTTP.dll_WinHttpOpenRequest]
mov dword [ebp - 0x18], eax
test eax, eax
je 0x40bf07
push ebx
push dword [ebp + 0xc]
push dword [ebp + 0xc]
push dword [ebp + 8]
push dword [esi - 0xc]
push esi
push eax
call dword [sym.imp.WINHTTP.dll_WinHttpSendRequest]
test eax, eax
je 0x40bef6
push ebx
push dword [ebp - 0x18]
call dword [sym.imp.WINHTTP.dll_WinHttpReceiveResponse]
test eax, eax
je 0x40bef6
or eax, 0xffffffff
mov dword [ebp - 0x30], 0x200
push ebx
mov dword [ebp - 0x10], eax
lea eax, [ebp - 0x30]
push eax
lea eax, [ebp - 0x434]
push eax
push ebx
push 5
push dword [ebp - 0x18]
call dword [sym.imp.WINHTTP.dll_WinHttpQueryHeaders]
test eax, eax
je 0x40bdd8
lea ecx, [ebp - 0x434]
lea edx, [ecx + 2]
mov ax, word [ecx]
add ecx, 2
cmp ax, bx
jne 0x40bd95
sub ecx, edx
sar ecx, 1
inc ecx
cmp ecx, 0x3fffffff
jle 0x40bdb1
mov eax, ebx
jmp 0x40bdcd
lea ebx, [ecx + ecx]
mov eax, ebx
call fcn.0044c2f1
mov ecx, esp
lea edx, [ebp - 0x434]
push 3
push ebx
call fcn.0040aa41
xor ebx, ebx
push eax
call dword [sym.imp.msvcrt.dll_atol]
pop ecx
mov dword [ebp - 0x10], eax
push ebx
lea eax, [ebp - 0x30]
mov dword [ebp - 0x14], ebx
push eax
lea eax, [ebp - 0x434]
push eax
push ebx
push 0x13
push dword [ebp - 0x18]
call dword [sym.imp.WINHTTP.dll_WinHttpQueryHeaders]
test eax, eax
je 0x40be43
lea ecx, [ebp - 0x434]
lea edx, [ecx + 2]
mov ax, word [ecx]
add ecx, 2
cmp ax, bx
jne 0x40be00
sub ecx, edx
sar ecx, 1
inc ecx
cmp ecx, 0x3fffffff
jle 0x40be1c
mov eax, ebx
jmp 0x40be38
lea ebx, [ecx + ecx]
mov eax, ebx
call fcn.0044c2f1
mov ecx, esp
lea edx, [ebp - 0x434]
push 3
push ebx
call fcn.0040aa41
xor ebx, ebx
push eax
call dword [sym.imp.msvcrt.dll_atol]
pop ecx
mov dword [ebp - 0x14], eax
mov eax, dword [ebp - 0x10]
mov dword [ebp - 0x1c], eax
test eax, eax
jle 0x40be5c
push eax
call dword [sym.imp.msvcrt.dll_malloc]
pop ecx
mov ecx, eax
mov dword [ebp - 0xc], ecx
jmp 0x40be71
mov eax, 0x1000
push eax
mov dword [ebp - 0x1c], eax
call dword [sym.imp.msvcrt.dll_malloc]
pop ecx
mov ecx, eax
mov dword [ebp - 0xc], eax
mov edx, ebx
mov eax, dword [ebp - 0x10]
cmp eax, 0xffffffff
je 0x40be80
dec eax
cmp edx, eax
jge 0x40befc
lea eax, [ebp - 8]
mov dword [ebp - 8], ebx
push eax
mov eax, dword [ebp - 0x1c]
sub eax, edx
push eax
lea eax, [ecx + edx]
push eax
push dword [ebp - 0x18]
call dword [sym.imp.WINHTTP.dll_WinHttpReadData]
test eax, eax
je 0x40befc
mov edx, dword [ebp - 0x20]
add edx, dword [ebp - 8]
cmp dword [ebp - 8], 0
mov dword [ebp - 0x20], edx
je 0x40bee6
mov eax, dword [ebp - 0x1c]
mov ecx, dword [ebp - 0xc]
cmp edx, eax
jne 0x40be73
add eax, eax
push eax
call dword [sym.imp.msvcrt.dll_malloc]
push dword [ebp - 0x1c]
mov ebx, eax
push dword [ebp - 0xc]
push ebx
call sub.msvcrt.dll_memcpy
push dword [ebp - 0xc]
call dword [sym.imp.msvcrt.dll_free]
mov edx, dword [ebp - 0x20]
mov ecx, ebx
add esp, 0x14
mov dword [ebp - 0xc], ecx
xor ebx, ebx
jmp 0x40be73
mov eax, dword [ebp - 0x10]
cmp eax, edx
je 0x40bef2
cmp eax, 0xffffffff
jne 0x40befc
mov bl, 1
jmp 0x40befc
mov eax, dword [ebp - 4]
mov dword [ebp - 0x14], eax
push dword [ebp - 0x18]
call dword [sym.imp.WINHTTP.dll_WinHttpCloseHandle]
jmp 0x40bf0d
mov eax, dword [ebp - 4]
mov dword [ebp - 0x14], eax
push dword [ebp - 4]
call dword [sym.imp.WINHTTP.dll_WinHttpCloseHandle]
jmp 0x40bf1e
mov eax, dword [ebp - 4]
mov dword [ebp - 0x14], eax
push dword [ebp - 0x34]
call dword [sym.imp.WINHTTP.dll_WinHttpCloseHandle]
mov eax, dword [ebp + 0x10]
test bl, bl
push 0xffffffffffffffff
pop ecx
cmovne ecx, dword [ebp - 0x14]
mov dword [eax], ecx
mov eax, dword [ebp - 0xc]
test eax, eax
je 0x40bf44
push eax
call dword [sym.imp.msvcrt.dll_free]
pop ecx
mov ecx, dword [ebp - 0x28]
lea ecx, [ecx - 0x10]
call fcn.0040169b
lea ecx, [edi - 0x10]
call fcn.0040169b
mov ecx, dword [ebp - 0x2c]
add ecx, 0xfffffff0
call fcn.0040169b
lea ecx, [esi - 0x10]
call fcn.0040169b
mov ecx, dword [ebp - 0x24]
lea ecx, [ecx - 0x10]
call fcn.0040169b
mov al, bl
jmp 0x40bf7b
xor al, al
lea esp, [ebp - 0x440]
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret