Function at 0x408730
Capabilities:
Initialize winhttp library
Prepare http request
Receive http response

Disassembly:
push ebp
push edi
push esi
push ebx
sub esp, 0x4c
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0
mov dword [esp + 4], 0
mov dword [esp], str.A_WinHTTP_Example_Program_1.0
call sym._WinHttpOpen_20
sub esp, 0x14
test eax, eax
je 0x408950
mov esi, eax
movzx eax, word [esp + 0x64]
mov dword [esp + 0xc], 0
mov dword [esp], esi
mov dword [esp + 8], eax
mov eax, dword [esp + 0x60]
mov dword [esp + 4], eax
call sym._WinHttpConnect_16
sub esp, 0x10
mov edi, eax
test eax, eax
je 0x408970
mov eax, dword [esp + 0x68]
mov dword [esp + 0x18], 0x800000
mov dword [esp + 0x14], 0
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], 0
mov dword [esp + 8], eax
mov dword [esp + 4], 0x43ee56
mov dword [esp], edi
call sym._WinHttpOpenRequest_28
sub esp, 0x1c
mov ebx, eax
test eax, eax
je 0x4089a0
mov dword [esp + 0x18], 0
mov dword [esp + 0x14], 0
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0
mov dword [esp + 4], 0
mov dword [esp], eax
call sym._WinHttpSendRequest_28
sub esp, 0x1c
test eax, eax
je 0x4088f8
mov dword [esp + 4], 0
mov dword [esp], ebx
call sym._WinHttpReceiveResponse_8
sub esp, 8
test eax, eax
je 0x408938
lea eax, [esp + 0x38]
mov dword [esp], ebx
mov dword [esp + 4], eax
mov dword [esp + 0x38], 0
mov dword [esp + 0x3c], 0
call sym._WinHttpQueryDataAvailable_8
sub esp, 8
test eax, eax
je 0x4089c0
mov edx, dword [esp + 0x38]
test edx, edx
je 0x4088f0
lea eax, [edx + 1]
mov dword [esp + 4], 1
mov dword [esp], eax
mov dword [esp + 0x2c], edx
call sym._calloc
mov edx, dword [esp + 0x2c]
test eax, eax
mov ebp, eax
je 0x408a03
lea eax, [esp + 0x3c]
mov dword [esp + 8], edx
mov dword [esp + 0xc], eax
mov dword [esp + 4], ebp
mov dword [esp], ebx
call sym._WinHttpReadData_16
sub esp, 0x10
test eax, eax
je 0x4089e0
mov eax, dword [esp + 0x38]
mov byte [ebp + eax], 0
mov dword [esp], ebx
call sym._WinHttpCloseHandle_4
sub esp, 4
mov dword [esp], edi
call sym._WinHttpCloseHandle_4
sub esp, 4
mov dword [esp], esi
call sym._WinHttpCloseHandle_4
sub esp, 4
add esp, 0x4c
mov eax, ebp
pop ebx
pop esi
pop edi
pop ebp
ret
xor ebp, ebp
jmp 0x4088c5
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [esp], str.WinHttpSendRequest_failed:__u_n
mov dword [esp + 4], eax
call sym._wprintf
mov dword [esp], ebx
call sym._WinHttpCloseHandle_4
sub esp, 4
mov dword [esp], edi
xor ebp, ebp
call sym._WinHttpCloseHandle_4
sub esp, 4
mov dword [esp], esi
call sym._WinHttpCloseHandle_4
sub esp, 4
jmp 0x4088e6
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [esp], str.WinHttpReceiveResponse_failed:__u_n
mov dword [esp + 4], eax
call sym._wprintf
jmp 0x40890e
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [esp], str.WinHttpOpen_failed:__u_n
xor ebp, ebp
mov dword [esp + 4], eax
call sym._wprintf
jmp 0x4088e6
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [esp], str.WinHttpConnect_failed:__u_n
xor ebp, ebp
mov dword [esp + 4], eax
call sym._wprintf
mov dword [esp], esi
call sym._WinHttpCloseHandle_4
sub esp, 4
jmp 0x4088e6
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [esp], str.WinHttpOpenRequest_failed:__u_n
mov dword [esp + 4], eax
call sym._wprintf
jmp 0x408919
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [esp], str.WinHttpQueryDataAvailable_failed:__u_n
mov dword [esp + 4], eax
call sym._wprintf
jmp 0x40890e
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [esp], str.WinHttpReadData_failed:__u_n
mov dword [esp + 4], eax
call sym._wprintf
mov dword [esp], ebp
call sym._free
jmp 0x40890e
mov dword [esp], str.Out_of_memory_n
call sym._wprintf
jmp 0x40890e