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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x48
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
mov dword [ebp - 0x10], eax
cmp dword [ebp - 0x10], 0
jne 0x4099d1
mov eax, dword [sym.imp.KERNEL32.dll_GetLastError]
call eax
mov dword [esp + 4], eax
mov dword [esp], str.WinHttpOpen_failed:__u_n
call sym._wprintf
mov eax, 0
jmp 0x409d59
mov eax, dword [ebp + 0xc]
movzx eax, ax
mov dword [esp + 0xc], 0
mov dword [esp + 8], eax
mov eax, dword [ebp + 8]
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x10]
mov dword [esp], eax
call sym._WinHttpConnect_16
sub esp, 0x10
mov dword [ebp - 0x14], eax
cmp dword [ebp - 0x14], 0
jne 0x409a30
mov eax, dword [sym.imp.KERNEL32.dll_GetLastError]
call eax
mov dword [esp + 4], eax
mov dword [esp], str.WinHttpConnect_failed:__u_n
call sym._wprintf
mov eax, dword [ebp - 0x10]
mov dword [esp], eax
call sym._WinHttpCloseHandle_4
sub esp, 4
mov eax, 0
jmp 0x409d59
mov dword [esp + 0x18], 0x800000
mov dword [esp + 0x14], 0
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], 0
mov eax, dword [ebp + 0x10]
mov dword [esp + 8], eax
mov dword [esp + 4], 0x4434fe
mov eax, dword [ebp - 0x14]
mov dword [esp], eax
call sym._WinHttpOpenRequest_28
sub esp, 0x1c
mov dword [ebp - 0x18], eax
cmp dword [ebp - 0x18], 0
jne 0x409ab3
mov eax, dword [sym.imp.KERNEL32.dll_GetLastError]
call eax
mov dword [esp + 4], eax
mov dword [esp], str.WinHttpOpenRequest_failed:__u_n
call sym._wprintf
mov eax, dword [ebp - 0x14]
mov dword [esp], eax
call sym._WinHttpCloseHandle_4
sub esp, 4
mov eax, dword [ebp - 0x10]
mov dword [esp], eax
call sym._WinHttpCloseHandle_4
sub esp, 4
mov eax, 0
jmp 0x409d59
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 eax, dword [ebp - 0x18]
mov dword [esp], eax
call sym._WinHttpSendRequest_28
sub esp, 0x1c
mov dword [ebp - 0x1c], eax
cmp dword [ebp - 0x1c], 0
jne 0x409b45
mov eax, dword [sym.imp.KERNEL32.dll_GetLastError]
call eax
mov dword [esp + 4], eax
mov dword [esp], str.WinHttpSendRequest_failed:__u_n
call sym._wprintf
mov eax, dword [ebp - 0x18]
mov dword [esp], eax
call sym._WinHttpCloseHandle_4
sub esp, 4
mov eax, dword [ebp - 0x14]
mov dword [esp], eax
call sym._WinHttpCloseHandle_4
sub esp, 4
mov eax, dword [ebp - 0x10]
mov dword [esp], eax
call sym._WinHttpCloseHandle_4
sub esp, 4
mov eax, 0
jmp 0x409d59
mov dword [esp + 4], 0
mov eax, dword [ebp - 0x18]
mov dword [esp], eax
call sym._WinHttpReceiveResponse_8
sub esp, 8
mov dword [ebp - 0x20], eax
cmp dword [ebp - 0x20], 0
jne 0x409baf
mov eax, dword [sym.imp.KERNEL32.dll_GetLastError]
call eax
mov dword [esp + 4], eax
mov dword [esp], str.WinHttpReceiveResponse_failed:__u_n
call sym._wprintf
mov eax, dword [ebp - 0x18]
mov dword [esp], eax
call sym._WinHttpCloseHandle_4
sub esp, 4
mov eax, dword [ebp - 0x14]
mov dword [esp], eax
call sym._WinHttpCloseHandle_4
sub esp, 4
mov eax, dword [ebp - 0x10]
mov dword [esp], eax
call sym._WinHttpCloseHandle_4
sub esp, 4
mov eax, 0
jmp 0x409d59
mov dword [ebp - 0x24], 0
mov dword [ebp - 0x28], 0
mov dword [ebp - 0xc], 0
lea eax, [ebp - 0x24]
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x18]
mov dword [esp], eax
call sym._WinHttpQueryDataAvailable_8
sub esp, 8
test eax, eax
jne 0x409c28
mov eax, dword [sym.imp.KERNEL32.dll_GetLastError]
call eax
mov dword [esp + 4], eax
mov dword [esp], str.WinHttpQueryDataAvailable_failed:__u_n
call sym._wprintf
mov eax, dword [ebp - 0x18]
mov dword [esp], eax
call sym._WinHttpCloseHandle_4
sub esp, 4
mov eax, dword [ebp - 0x14]
mov dword [esp], eax
call sym._WinHttpCloseHandle_4
sub esp, 4
mov eax, dword [ebp - 0x10]
mov dword [esp], eax
call sym._WinHttpCloseHandle_4
sub esp, 4
mov eax, 0
jmp 0x409d59
mov eax, dword [ebp - 0x24]
test eax, eax
je 0x409d2c
mov eax, dword [ebp - 0x24]
add eax, 1
mov dword [esp], eax
call sym._malloc
mov dword [ebp - 0xc], eax
cmp dword [ebp - 0xc], 0
jne 0x409c8a
mov dword [esp], str.Out_of_memory_n
call sym._wprintf
mov eax, dword [ebp - 0x18]
mov dword [esp], eax
call sym._WinHttpCloseHandle_4
sub esp, 4
mov eax, dword [ebp - 0x14]
mov dword [esp], eax
call sym._WinHttpCloseHandle_4
sub esp, 4
mov eax, dword [ebp - 0x10]
mov dword [esp], eax
call sym._WinHttpCloseHandle_4
sub esp, 4
mov eax, 0
jmp 0x409d59
mov eax, dword [ebp - 0x24]
add eax, 1
mov dword [esp + 8], eax
mov dword [esp + 4], 0
mov eax, dword [ebp - 0xc]
mov dword [esp], eax
call sym._memset
mov eax, dword [ebp - 0x24]
lea edx, [ebp - 0x28]
mov dword [esp + 0xc], edx
mov dword [esp + 8], eax
mov eax, dword [ebp - 0xc]
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x18]
mov dword [esp], eax
call sym._WinHttpReadData_16
sub esp, 0x10
test eax, eax
jne 0x409d21
mov eax, dword [sym.imp.KERNEL32.dll_GetLastError]
call eax
mov dword [esp + 4], eax
mov dword [esp], str.WinHttpReadData_failed:__u_n
call sym._wprintf
mov eax, dword [ebp - 0xc]
mov dword [esp], eax
call sym._free
mov eax, dword [ebp - 0x18]
mov dword [esp], eax
call sym._WinHttpCloseHandle_4
sub esp, 4
mov eax, dword [ebp - 0x14]
mov dword [esp], eax
call sym._WinHttpCloseHandle_4
sub esp, 4
mov eax, dword [ebp - 0x10]
mov dword [esp], eax
call sym._WinHttpCloseHandle_4
sub esp, 4
mov eax, 0
jmp 0x409d59
mov edx, dword [ebp - 0x24]
mov eax, dword [ebp - 0xc]
add eax, edx
mov byte [eax], 0
mov eax, dword [ebp - 0x18]
mov dword [esp], eax
call sym._WinHttpCloseHandle_4
sub esp, 4
mov eax, dword [ebp - 0x14]
mov dword [esp], eax
call sym._WinHttpCloseHandle_4
sub esp, 4
mov eax, dword [ebp - 0x10]
mov dword [esp], eax
call sym._WinHttpCloseHandle_4
sub esp, 4
mov eax, dword [ebp - 0xc]
leave
ret