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

Disassembly:
push ebp
xor eax, eax
mov ecx, 0xd
mov ebp, esp
push edi
push esi
lea edi, [ebp - 0x440]
push ebx
sub esp, 0x480
rep stosd dword es:[edi], eax
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0
mov dword [esp + 4], 0
mov dword [esp], 0
call dword [sym.imp.kernel32.dll_CreateEventW]
mov dword [ebp - 0x43c], eax
sub esp, 0x10
mov edi, dword fs:[0x18]
mov eax, dword [edi + 0x24]
mov dword [ebp - 0x420], eax
mov dword [esp + 0x10], 0x10000000
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0
mov dword [esp + 4], 0
mov dword [esp], 0x4361aa
call dword [sym.imp.winhttp.dll_WinHttpOpen]
sub esp, 0x14
mov esi, eax
mov dword [ebp - 0x46c], eax
call fcn.00431c30
mov dword [eax], 0x436036
mov dword [eax + 4], 0x7cc
mov eax, dword [edi + 0x34]
mov dword [esp + 4], str.failed_to_open_session__GetLastError____lu_n
mov dword [esp + 8], eax
xor eax, eax
test esi, esi
setne al
mov dword [esp], eax
call fcn.00401be0
mov eax, dword [sym.imp.winhttp.dll_WinHttpSetStatusCallback]
mov dword [esp], esi
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0xffffffff
mov dword [esp + 4], 0x4093e0
mov dword [ebp - 0x470], eax
call eax
sub esp, 0x10
mov dword [esp], esi
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0
mov dword [esp + 4], 0x436528
call dword [sym.imp.winhttp.dll_WinHttpConnect]
sub esp, 0x10
mov ebx, eax
mov dword [ebp - 0x454], eax
call fcn.00431c30
mov dword [eax], 0x436036
mov dword [eax + 4], 0x7d1
mov eax, dword [edi + 0x34]
mov dword [esp + 4], str.failed_to_open_a_connection__GetLastError____lu_n
mov dword [esp + 8], eax
xor eax, eax
test ebx, ebx
setne al
mov dword [esp], eax
call fcn.00401be0
mov eax, dword [sym.imp.winhttp.dll_WinHttpOpenRequest]
mov dword [esp], ebx
mov dword [esp + 0x18], 0
mov dword [esp + 0x14], 0
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], 0
mov dword [esp + 8], str._tests_hello.html
mov dword [esp + 4], 0
mov dword [ebp - 0x464], eax
call eax
sub esp, 0x1c
mov ebx, eax
call fcn.00431c30
mov dword [eax], 0x436036
mov dword [eax + 4], 0x7d4
mov eax, dword [edi + 0x34]
mov dword [esp + 4], str.failed_to_open_a_request__GetLastError____lu_n
mov dword [esp + 8], eax
xor eax, eax
test ebx, ebx
setne al
mov dword [esp], eax
call fcn.00401be0
mov dword [ebp - 0x440], ebx
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 dword [eax], 0x436036
mov dword [eax + 4], 0x7d9
mov eax, dword [edi + 0x34]
mov dword [esp], esi
lea esi, [ebp - 0x449]
mov dword [esp + 8], eax
mov dword [esp + 4], str.failed_to_receive_response__GetLastError____lu_n
call fcn.00401be0
lea eax, [ebp - 0x440]
mov dword [ebp - 0x424], 0x400000
mov dword [ebp - 0x414], 1
mov dword [ebp - 0x410], esi
mov byte [ebp - 0x449], 0
mov dword [esp + 0x18], eax
mov eax, dword [sym.imp.winhttp.dll_WinHttpSendRequest]
mov dword [esp + 0x14], 1
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0
mov dword [esp + 4], 0
mov dword [esp], ebx
mov dword [ebp - 0x460], eax
call eax
mov edx, eax
sub esp, 0x1c
mov eax, dword [edi + 0x34]
test edx, edx
jne 0x4042ad
cmp eax, 0x2efd
je 0x404798
cmp eax, 0x2ee2
je 0x404798
mov dword [ebp - 0x450], edx
call fcn.00431c30
mov dword [eax], 0x436036
mov dword [eax + 4], 0x7eb
mov edi, dword fs:[0x18]
mov eax, dword [edi + 0x34]
mov dword [esp + 4], str.failed_to_send_request__GetLastError____lu_n
mov dword [esp + 8], eax
mov edx, dword [ebp - 0x450]
mov dword [esp], edx
call fcn.00401be0
mov dword [esp + 4], 0xffffffff
mov eax, dword [ebp - 0x43c]
mov dword [esp], eax
mov eax, dword [sym.imp.kernel32.dll_WaitForSingleObject]
mov dword [ebp - 0x450], eax
call eax
lea eax, [ebp - 0x448]
mov dword [ebp - 0x414], 0
mov dword [ebp - 0x410], 0
sub esp, 8
mov dword [ebp - 0x448], 4
mov dword [esp + 0x10], eax
lea eax, [ebp - 0x444]
mov dword [esp + 0x14], 0
mov dword [esp + 0xc], eax
mov dword [esp + 8], 0
mov dword [esp + 4], 0x20000013
mov dword [esp], ebx
call dword [sym.imp.winhttp.dll_WinHttpQueryHeaders]
sub esp, 0x18
mov dword [ebp - 0x458], eax
call fcn.00431c30
mov dword [eax], 0x436036
mov dword [eax + 4], 0x7f4
mov eax, dword [edi + 0x34]
mov dword [esp + 4], str.request_failed__GetLastError____lu_n
mov dword [esp + 8], eax
mov edx, dword [ebp - 0x458]
mov dword [esp], edx
call fcn.00401be0
call fcn.00431c30
mov dword [eax], 0x436036
mov dword [eax + 4], 0x7f5
mov eax, dword [ebp - 0x444]
mov dword [esp + 4], str.request_failed_unexpectedly__status__lu_n
cmp eax, 0xc8
mov dword [esp + 8], eax
sete al
movzx eax, al
mov dword [esp], eax
call fcn.00401be0
mov dword [esp + 4], 0
mov dword [esp], ebx
call dword [sym.imp.winhttp.dll_WinHttpQueryDataAvailable]
sub esp, 8
mov dword [ebp - 0x458], eax
call fcn.00431c30
mov dword [eax], 0x436036
mov dword [eax + 4], 0x7f8
mov eax, dword [edi + 0x34]
mov dword [esp + 4], str.failed_to_query_data_available__GetLastError____lu_n
mov dword [esp + 8], eax
mov edx, dword [ebp - 0x458]
mov dword [esp], edx
call fcn.00401be0
mov dword [esp + 4], 0xffffffff
mov eax, dword [ebp - 0x43c]
mov dword [esp], eax
mov eax, dword [ebp - 0x450]
call eax
mov ecx, dword [sym.imp.winhttp.dll_WinHttpReadData]
sub esp, 8
mov dword [esp + 4], esi
mov dword [esp + 0xc], 0
mov dword [esp + 8], 1
mov dword [esp], ebx
mov dword [ebp - 0x468], ecx
call ecx
sub esp, 0x10
mov esi, eax
call fcn.00431c30
mov dword [eax], 0x436036
mov dword [eax + 4], 0x7fd
mov eax, dword [edi + 0x34]
mov dword [esp + 4], str.failed_to_read_data__GetLastError____lu_n
mov dword [esp + 8], eax
mov dword [esp], esi
call fcn.00401be0
mov dword [esp + 4], 0xffffffff
mov eax, dword [ebp - 0x43c]
mov dword [esp], eax
mov eax, dword [ebp - 0x450]
call eax
mov eax, dword [ebp - 0x428]
sub esp, 8
test eax, eax
jne 0x4046c0
call fcn.00431c30
mov dword [eax], 0x436036
mov dword [eax + 4], 0x805
mov dword [esp], str.no_sync_callbacks_n
call fcn.00401670
mov eax, dword [sym.imp.winhttp.dll_WinHttpCloseHandle]
mov dword [esp], ebx
xor esi, esi
mov edi, dword fs:[0x18]
mov dword [ebp - 0x458], eax
call eax
sub esp, 4
mov dword [esp + 4], esi
mov dword [esp], str.i__u
call fcn.004013a0
mov dword [esp + 0x18], 0
mov dword [esp + 0x14], 0
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], 0
mov dword [esp + 8], str._tests_hello.html
mov dword [esp + 4], 0
mov eax, dword [ebp - 0x454]
mov dword [esp], eax
mov eax, dword [ebp - 0x464]
call eax
sub esp, 0x1c
mov ebx, eax
call fcn.00431c30
mov dword [eax], 0x436036
mov dword [eax + 4], 0x80e
mov eax, dword [edi + 0x34]
mov dword [esp + 4], str.failed_to_open_a_request__GetLastError____lu_n
mov dword [esp + 8], eax
xor eax, eax
test ebx, ebx
setne al
mov dword [esp], eax
call fcn.00401be0
mov eax, dword [esi*4 + 0x436ca0]
mov dword [ebp - 0x440], ebx
mov dword [ebp - 0x418], 0
mov dword [ebp - 0x424], eax
lea eax, [ebp - 0x440]
mov dword [esp + 0x18], eax
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
mov eax, dword [ebp - 0x460]
call eax
mov edx, eax
sub esp, 0x1c
mov eax, dword [edi + 0x34]
test edx, edx
jne 0x4045ea
cmp eax, 0x2efd
je 0x404800
cmp eax, 0x2ee2
je 0x404800
mov dword [esp + 4], 0xffffffff
mov eax, dword [ebp - 0x43c]
mov dword [esp], eax
mov eax, dword [ebp - 0x450]
call eax
lea ecx, [ebp - 0x40c]
sub esp, 8
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0x400
mov dword [esp + 4], ecx
mov dword [esp], ebx
mov ecx, dword [ebp - 0x468]
call ecx
sub esp, 0x10
mov dword [ebp - 0x45c], eax
call fcn.00431c30
mov dword [eax], 0x436036
mov dword [eax + 4], 0x825
mov eax, dword fs:[0x18]
mov eax, dword [eax + 0x34]
mov dword [esp + 4], str.failed_to_read_data__GetLastError____lu_n
mov dword [esp + 8], eax
mov edx, dword [ebp - 0x45c]
mov dword [esp], edx
call fcn.00401be0
mov dword [esp + 4], 0xffffffff
mov eax, dword [ebp - 0x43c]
mov dword [esp], eax
mov eax, dword [ebp - 0x450]
call eax
sub esp, 8
mov dword [esp], ebx
mov eax, dword [ebp - 0x458]
call eax
sub esp, 4
call fcn.00431c30
mov edx, dword [eax + 0xbec]
test edx, edx
je 0x4046ab
sub edx, 1
mov dword [eax + 0xbec], edx
test esi, esi
jne 0x404730
mov esi, 1
jmp 0x4044e8
call fcn.00431c30
mov dword [eax], 0x436036
mov dword [eax + 4], 0x802
mov eax, dword [ebp - 0x434]
mov dword [esp + 4], 0x4366c3
cmp eax, 1
mov dword [esp + 8], eax
setg al
movzx eax, al
mov dword [esp], eax
call fcn.00401be0
call fcn.00431c30
mov dword [eax], 0x436036
mov dword [eax + 4], 0x803
mov eax, dword [ebp - 0x430]
mov dword [esp + 4], 0x4366c3
cmp eax, 1
mov dword [esp + 8], eax
setg al
movzx eax, al
mov dword [esp], eax
call fcn.00401be0
jmp 0x4044cc
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0xffffffff
mov dword [esp + 4], 0
mov edi, dword [ebp - 0x46c]
mov dword [esp], edi
mov eax, dword [ebp - 0x470]
call eax
mov eax, dword [ebp - 0x454]
sub esp, 0x10
mov dword [esp], eax
mov ebx, dword [ebp - 0x458]
call ebx
sub esp, 4
mov dword [esp], edi
call ebx
mov eax, dword [ebp - 0x43c]
sub esp, 4
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_CloseHandle]
sub esp, 4
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret
call fcn.00431c30
mov dword [eax], 0x436036
mov dword [eax + 4], 0x7e3
mov dword [esp], str.Connection_failed__skipping_n
call fcn.00401670
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0xffffffff
mov dword [esp + 4], 0
mov edi, dword [ebp - 0x46c]
mov dword [esp], edi
mov eax, dword [ebp - 0x470]
call eax
sub esp, 0x10
mov dword [esp], ebx
mov ebx, dword [sym.imp.winhttp.dll_WinHttpCloseHandle]
call ebx
mov eax, dword [ebp - 0x454]
sub esp, 4
mov dword [esp], eax
jmp 0x40476b
call fcn.00431c30
mov dword [eax], 0x436036
mov dword [eax + 4], 0x818
mov dword [esp], str.Connection_failed__skipping_n
call fcn.00401670
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0xffffffff
mov dword [esp + 4], 0
mov esi, dword [ebp - 0x46c]
mov dword [esp], esi
mov eax, dword [ebp - 0x470]
call eax
sub esp, 0x10
mov dword [esp], ebx
mov edi, dword [ebp - 0x458]
call edi
mov eax, dword [ebp - 0x454]
sub esp, 4
mov dword [esp], eax
call edi
sub esp, 4
mov dword [esp], esi
call edi
mov eax, dword [ebp - 0x43c]
sub esp, 4
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_CloseHandle]
sub esp, 4
call fcn.00431c30
mov edx, dword [eax + 0xbec]
test edx, edx
je 0x40478a
sub edx, 1
mov dword [eax + 0xbec], edx
jmp 0x40478a