Function at 0x427640
Capabilities:
Check http status code
Initialize winhttp library
Prepare http request
Read http header
Receive http response

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
push ebx
mov edi, dword fs:[0x18]
sub esp, 0x34c
mov dword [ebp - 0x338], ecx
mov dword [ebp - 0x330], edx
mov dword [ebp - 0x32c], eax
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0
mov dword [esp + 4], 1
mov dword [esp], str.winetest
call dword [sym.imp.winhttp.dll_WinHttpOpen]
sub esp, 0x14
mov esi, eax
mov dword [ebp - 0x328], eax
call fcn.00431c30
mov dword [eax], 0x438e8a
mov dword [eax + 4], 0xa48
mov eax, dword [edi + 0x34]
mov dword [esp + 4], str.failed_to_open_session__lu_n
mov dword [esp + 8], eax
xor eax, eax
test esi, esi
setne al
mov dword [esp], eax
call fcn.00410490
lea eax, [ebp - 0x30c]
mov dword [edi + 0x34], 0xdeadbeef
mov dword [esp], esi
mov esi, dword [sym.imp.winhttp.dll_WinHttpSetOption]
mov dword [esp + 0xc], 0x100
mov dword [esp + 8], eax
mov dword [esp + 4], 0
call esi
sub esp, 0x10
mov ebx, eax
call fcn.00431c30
mov dword [eax], 0x438e8a
mov dword [eax + 4], 0xa4c
xor eax, eax
mov ecx, dword [edi + 0x34]
test ebx, ebx
jne 0x427724
xor eax, eax
cmp ecx, 0x2ee9
sete al
mov dword [esp + 8], ecx
mov dword [esp], eax
mov dword [esp + 4], str.got__lu_n
mov ebx, dword fs:[0x18]
call fcn.00410490
lea eax, [ebp - 0x31c]
mov dword [ebx + 0x34], 0xdeadbeef
mov dword [esp + 0xc], eax
lea eax, [ebp - 0x30c]
mov dword [esp + 8], eax
mov dword [esp + 4], 0
mov eax, dword [ebp - 0x328]
mov dword [esp], eax
mov eax, dword [sym.imp.winhttp.dll_WinHttpQueryOption]
mov dword [ebp - 0x334], eax
call eax
sub esp, 0x10
mov edi, eax
call fcn.00431c30
mov dword [eax], 0x438e8a
mov dword [eax + 4], 0xa50
xor eax, eax
mov ecx, dword [ebx + 0x34]
test edi, edi
jne 0x4277a0
xor eax, eax
cmp ecx, 0x57
sete al
mov dword [esp + 8], ecx
mov dword [esp], eax
mov dword [esp + 4], str.got__lu_n
call fcn.00410490
mov dword [esp + 0xc], 0
movzx ebx, word [ebp - 0x32c]
mov dword [esp + 4], str.localhost
mov dword [esp + 8], ebx
mov eax, dword [ebp - 0x328]
mov ebx, dword fs:[0x18]
mov dword [esp], eax
call dword [sym.imp.winhttp.dll_WinHttpConnect]
sub esp, 0x10
mov edi, eax
mov dword [ebp - 0x32c], eax
call fcn.00431c30
mov dword [eax], 0x438e8a
mov dword [eax + 4], 0xa53
mov eax, dword [ebx + 0x34]
mov dword [esp + 4], str.failed_to_open_a_connection__lu_n
mov dword [esp + 8], eax
xor eax, eax
test edi, edi
setne al
mov dword [esp], eax
call fcn.00410490
lea eax, [ebp - 0x30c]
mov dword [ebx + 0x34], 0xdeadbeef
mov dword [esp], edi
mov dword [esp + 0xc], 0x100
mov dword [esp + 8], eax
mov dword [esp + 4], 0
call esi
mov ecx, dword [0x4720d0]
sub esp, 0x10
mov edi, eax
mov dword [ebp - 0x33c], ecx
call fcn.00431c30
mov ecx, dword [eax + 0x10]
mov dword [eax + 0x14], 1
lea edx, [ecx + ecx]
mov ecx, dword [ebp - 0x33c]
test ecx, ecx
setne cl
movzx ecx, cl
or edx, ecx
mov dword [eax + 0x10], edx
jmp 0x4278c2
call fcn.00431c30
mov dword [eax], 0x438e8a
mov dword [eax + 4], 0xa57
xor eax, eax
mov edx, dword [ebx + 0x34]
test edi, edi
jne 0x4278a6
xor eax, eax
cmp edx, 0x2ee9
sete al
mov dword [esp + 8], edx
mov dword [esp], eax
mov dword [esp + 4], str.got__lu_n
call fcn.00410490
call fcn.00431c30
shr dword [eax + 0x10], 1
call fcn.00431c30
mov edx, dword [eax + 0x14]
mov dword [eax + 0x14], 0
test edx, edx
jne 0x427880
lea eax, [ebp - 0x31c]
mov dword [ebp - 0x33c], edx
mov edi, dword fs:[0x18]
mov dword [edi + 0x34], 0xdeadbeef
mov dword [esp + 0xc], eax
lea eax, [ebp - 0x30c]
mov dword [esp + 8], eax
mov dword [esp + 4], 0
mov eax, dword [ebp - 0x32c]
mov dword [esp], eax
mov eax, dword [ebp - 0x334]
call eax
sub esp, 0x10
mov ebx, eax
call fcn.00431c30
mov edx, dword [ebp - 0x33c]
mov dword [eax], 0x438e8a
mov dword [eax + 4], 0xa5b
xor eax, eax
test ebx, ebx
mov ecx, dword [edi + 0x34]
jne 0x427944
xor eax, eax
cmp ecx, 0x57
sete al
mov dword [ebp - 0x33c], edx
mov dword [esp + 8], ecx
mov dword [esp], eax
mov dword [esp + 4], str.got__lu_n
mov edi, dword fs:[0x18]
call fcn.00410490
mov dword [esp + 0x18], 0
mov dword [esp + 0x14], 0
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], 0
mov eax, dword [ebp - 0x338]
mov dword [esp + 8], eax
mov eax, dword [ebp - 0x330]
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x32c]
mov dword [esp], eax
call dword [sym.imp.winhttp.dll_WinHttpOpenRequest]
sub esp, 0x1c
mov ebx, eax
call fcn.00431c30
mov dword [eax], 0x438e8a
mov dword [eax + 4], 0xa5e
mov eax, dword [edi + 0x34]
mov dword [esp + 4], str.failed_to_open_a_request__lu_n
mov dword [esp + 8], eax
xor eax, eax
test ebx, ebx
setne al
mov dword [esp], eax
call fcn.00410490
lea eax, [ebp - 0x30c]
mov dword [edi + 0x34], 0xdeadbeef
mov dword [esp + 0xc], 0x100
mov dword [esp + 8], eax
mov dword [esp + 4], 0
mov dword [esp], ebx
call esi
sub esp, 0x10
mov esi, eax
call fcn.00431c30
mov edx, dword [ebp - 0x33c]
mov dword [eax], 0x438e8a
mov dword [eax + 4], 0xa62
xor eax, eax
test esi, esi
mov ecx, dword [edi + 0x34]
jne 0x427a34
xor eax, eax
cmp ecx, 0x2ee9
sete al
mov dword [ebp - 0x338], edx
mov dword [esp + 8], ecx
mov dword [esp], eax
mov dword [esp + 4], str.got__lu_n
mov esi, dword fs:[0x18]
call fcn.00410490
lea eax, [ebp - 0x31c]
mov dword [esi + 0x34], 0xdeadbeef
mov dword [esp + 0xc], eax
lea eax, [ebp - 0x30c]
mov dword [esp + 8], eax
mov dword [esp + 4], 0
mov dword [esp], ebx
mov eax, dword [ebp - 0x334]
call eax
sub esp, 0x10
mov edi, eax
call fcn.00431c30
test edi, edi
mov edx, dword [ebp - 0x338]
mov dword [eax], 0x438e8a
mov dword [eax + 4], 0xa66
mov eax, dword [esi + 0x34]
jne 0x427aaf
xor edx, edx
cmp eax, 0x57
sete dl
mov dword [esp], edx
mov dword [esp + 8], eax
mov dword [esp + 4], str.got__lu_n
call fcn.00410490
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], ebx
call dword [sym.imp.winhttp.dll_WinHttpSendRequest]
sub esp, 0x1c
mov esi, eax
call fcn.00431c30
mov dword [eax], 0x438e8a
mov edx, dword fs:[0x18]
mov dword [eax + 4], 0xa69
mov eax, dword [edx + 0x34]
mov dword [ebp - 0x334], edx
mov dword [esp], esi
mov dword [esp + 8], eax
mov dword [esp + 4], str.failed_to_send_request__lu_n
call fcn.00410490
mov dword [esp + 4], 0
mov dword [esp], ebx
call dword [sym.imp.winhttp.dll_WinHttpReceiveResponse]
sub esp, 8
mov esi, eax
call fcn.00431c30
mov edx, dword [ebp - 0x334]
mov dword [eax], 0x438e8a
mov dword [eax + 4], 0xa6c
mov eax, dword [edx + 0x34]
mov dword [ebp - 0x338], edx
mov dword [esp + 8], eax
mov dword [esp], esi
mov dword [esp + 4], str.failed_to_receive_response__lu_n
call fcn.00410490
lea eax, [ebp - 0x31c]
mov dword [ebp - 0x320], 0xdeadbeef
mov dword [ebp - 0x31c], 4
mov dword [esp + 0x10], eax
lea eax, [ebp - 0x320]
mov dword [esp + 0xc], eax
mov eax, dword [sym.imp.winhttp.dll_WinHttpQueryHeaders]
mov dword [esp + 0x14], 0
mov dword [esp + 8], 0
mov dword [esp + 4], 0x20000013
mov dword [esp], ebx
mov dword [ebp - 0x334], eax
call eax
sub esp, 0x18
mov esi, eax
call fcn.00431c30
mov edx, dword [ebp - 0x338]
mov dword [eax], 0x438e8a
mov dword [eax + 4], 0xa71
mov eax, dword [edx + 0x34]
mov dword [esp], esi
mov dword [esp + 8], eax
mov dword [esp + 4], str.failed_to_query_status_code__lu_n
call fcn.00410490
call fcn.00431c30
mov dword [eax], 0x438e8a
mov dword [eax + 4], 0xa72
mov eax, dword [ebp - 0x320]
mov dword [esp + 4], str.request_failed_unexpectedly__lu_n
cmp eax, 0xc8
mov dword [esp + 8], eax
sete al
movzx eax, al
mov dword [esp], eax
call fcn.00410490
mov edx, dword [ebp - 0x338]
lea eax, [ebp - 0x310]
mov dword [ebp - 0x310], 0xdeadbeef
mov dword [ebp - 0x314], 0xdeadbeef
mov dword [edx + 0x34], 0xdeadbeef
mov dword [ebp - 0x318], 0xdeadbeef
mov dword [esp + 0xc], eax
lea eax, [ebp - 0x314]
mov dword [esp + 8], eax
lea eax, [ebp - 0x318]
mov dword [esp + 4], eax
mov dword [esp], ebx
call dword [sym.imp.winhttp.dll_WinHttpQueryAuthSchemes]
mov edx, dword [ebp - 0x338]
sub esp, 0x10
mov edi, eax
mov esi, dword [edx + 0x34]
call fcn.00431c30
mov dword [eax], 0x438e8a
mov dword [eax + 4], 0xa78
xor eax, eax
test edi, edi
sete al
mov dword [esp + 4], str.unexpected_success_n
mov dword [esp], eax
call fcn.00410490
call fcn.00431c30
mov dword [eax], 0x438e8a
mov dword [eax + 4], 0xa79
xor eax, eax
cmp esi, 0x10dd
sete al
mov dword [esp + 8], esi
lea esi, [ebp - 0x20c]
mov dword [esp], eax
mov edi, esi
mov dword [esp + 4], str.expected_ERROR_INVALID_OPERATION__got__lu_n
call fcn.00410490
call fcn.00431c30
mov dword [eax], 0x438e8a
mov dword [eax + 4], 0xa7a
mov eax, dword [ebp - 0x318]
mov dword [esp + 4], str.got__lu_n
cmp eax, 0xdeadbeef
mov dword [esp + 8], eax
sete al
movzx eax, al
mov dword [esp], eax
call fcn.00410490
call fcn.00431c30
mov dword [eax], 0x438e8a
mov dword [eax + 4], 0xa7b
mov eax, dword [ebp - 0x314]
mov dword [esp + 4], str.got__lu_n
cmp eax, 0xdeadbeef
mov dword [esp + 8], eax
sete al
movzx eax, al
mov dword [esp], eax
call fcn.00410490
call fcn.00431c30
mov dword [eax], 0x438e8a
mov dword [eax + 4], 0xa7c
mov eax, dword [ebp - 0x310]
mov dword [esp + 4], str.got__lu_n
cmp eax, 0xdeadbeef
mov dword [esp + 8], eax
sete al
movzx eax, al
mov dword [esp], eax
call fcn.00410490
xor eax, eax
mov ecx, pe_nt_image_headers32
mov dword [ebp - 0x31c], 0x200
rep stosd dword es:[edi], eax
lea ecx, [ebp - 0x31c]
mov dword [esp + 0xc], esi
mov dword [esp + 0x10], ecx
mov dword [esp + 0x14], 0
mov dword [esp + 8], 0
mov dword [esp + 4], 0x16
mov dword [esp], ebx
mov eax, dword [ebp - 0x334]
call eax
sub esp, 0x18
mov edi, eax
call fcn.00431c30
mov edx, dword [ebp - 0x338]
mov dword [eax], 0x438e8a
mov dword [eax + 4], 0xa81
mov eax, dword [edx + 0x34]
mov dword [esp + 4], str.failed_to_query_for_raw_headers:__lu_n
mov dword [esp + 8], eax
mov dword [esp], edi
call fcn.00410490
call fcn.00431c30
mov dword [eax], 0x438e8a
cmp word [ebp - 0x20c], 0
mov dword [eax + 4], 0xa82
je 0x428100
mov eax, esi
nop
add eax, 2
cmp word [eax], 0
jne 0x427e40
sub eax, esi
sub eax, 8
add eax, esi
cmp dword [eax], 0xa000d
je 0x4280e0
mov eax, 1
xor eax, 1
mov dword [esp + 4], str.WinHttpQueryHeaders_returned_invalid_end_of_header_string_n
mov edi, esi
mov dword [esp], eax
call fcn.00410490
xor edx, edx
mov ecx, pe_nt_image_headers32
mov dword [ebp - 0x31c], 0x200
mov eax, edx
rep stosd dword es:[edi], eax
lea eax, [ebp - 0x31c]
mov dword [esp + 0xc], esi
mov dword [esp + 0x14], 0
mov dword [esp + 0x10], eax
mov dword [esp + 8], 0
mov dword [esp + 4], 0x15
mov dword [esp], ebx
mov eax, dword [ebp - 0x334]
call eax
sub esp, 0x18
mov edi, eax
call fcn.00431c30
mov dword [eax], 0x438e8a
mov dword [eax + 4], 0xa88
mov esi, dword fs:[0x18]
mov eax, dword [esi + 0x34]
mov dword [esp], edi
lea edi, [ebp - 0x30c]
mov dword [esp + 4], str.failed_to_query_for_raw_headers:__lu_n
mov dword [esp + 8], eax
call fcn.00410490
call fcn.00431c30
mov dword [eax], 0x438e8a
mov dword [eax + 4], 0xa89
mov dword [esp + 4], str.WinHttpQueryHeaders_returned_invalid_end_of_header_string_n
mov eax, dword [ebp - 0x31c]
and eax, 0xfffffffe
cmp word [ebp + eax - 0x20e], 0
sete al
movzx eax, al
mov dword [esp], eax
call fcn.00410490
call fcn.00431c30
mov dword [eax], 0x438e8a
mov dword [eax + 4], 0xa8b
mov dword [esp + 4], str.returned_string_has_too_many_NULL_characters_n
mov eax, dword [ebp - 0x31c]
shr eax, 1
cmp word [ebp + eax*2 - 0x210], 0
setne al
movzx eax, al
mov dword [esp], eax
call fcn.00410490
xor eax, eax
mov ecx, 0x40
mov dword [ebp - 0x324], 0
rep stosd dword es:[edi], eax
lea eax, [ebp - 0x324]
mov dword [esp + 8], 0x100
mov dword [esp + 0xc], eax
lea eax, [ebp - 0x30c]
mov dword [esp + 4], eax
mov dword [esp], ebx
call dword [sym.imp.winhttp.dll_WinHttpReadData]
sub esp, 0x10
mov edi, eax
call fcn.00431c30
mov dword [eax], 0x438e8a
mov dword [eax + 4], 0xa90
mov eax, dword [esi + 0x34]
mov dword [esp + 4], str.failed_to_read_data__lu_n
mov dword [esp + 8], eax
mov dword [esp], edi
call fcn.00410490
mov eax, dword [ebp - 0x330]
test eax, eax
je 0x427ff3
mov dword [esp + 4], 0x43b916
mov dword [esp], eax
call dword [sym.imp.msvcrt.dll_wcscmp]
test eax, eax
je 0x4280a8
call fcn.00431c30
mov dword [eax], 0x438e8a
mov dword [eax + 4], 0xa97
mov eax, dword [ebp - 0x324]
mov dword [esp + 4], str.got_count__ld_n
cmp eax, 0x80
mov dword [esp + 8], eax
sete al
movzx eax, al
mov dword [esp], eax
call fcn.00410490
call fcn.00431c30
mov dword [eax], 0x438e8a
mov dword [eax + 4], 0xa98
lea eax, [ebp - 0x30c]
mov dword [esp + 8], 0x81
mov dword [esp + 4], str._HTML__r_n_HEAD__TITLE_winhttp_test_page__TITLE___HEAD__r_n_BODY_The_quick_brown_fox_jumped_over_the_lazy_dog_P___BODY__r_n__HTML__r_n_r_n
mov dword [esp], eax
call sub.msvcrt.dll_memcmp
mov dword [esp + 4], str.http_data_wrong_n
test eax, eax
sete al
movzx eax, al
mov dword [esp], eax
call fcn.00410490
mov dword [esp], ebx
mov ebx, dword [sym.imp.winhttp.dll_WinHttpCloseHandle]
call ebx
mov eax, dword [ebp - 0x32c]
sub esp, 4
mov dword [esp], eax
call ebx
mov eax, dword [ebp - 0x328]
sub esp, 4
mov dword [esp], eax
call ebx
sub esp, 4
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret
mov eax, 0xa93
call fcn.0040fbc0
mov eax, dword [ebp - 0x324]
mov dword [esp + 4], str.got_count__ld_n
test eax, eax
mov dword [esp + 8], eax
sete al
movzx eax, al
mov dword [esp], eax
call fcn.00410490
jmp 0x428072
cmp dword [eax + 4], 0xa000d
jne 0x427e5c
cmp word [eax + 8], 0
jne 0x427e5c
xor eax, eax
jmp 0x427e61
mov eax, 0xfffffff8
jmp 0x427e4e