Function at 0x401220
Capabilities:
Initialize winhttp library
Prepare http request
Receive http response
Reference http user-agent string

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x403ed8
mov eax, dword fs:[0]
push eax
sub esp, 0xdc
mov eax, dword [0x407040]
xor eax, ebp
mov dword [ebp - 0x10], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov esi, ecx
mov eax, dword [ebp + 0xc]
mov ebx, dword [ebp + 8]
push 0
push 0
push 0
push 1
push 0
mov dword [ebp - 0xe8], eax
mov dword [ebp - 0x14], 0
call dword [sym.imp.WINHTTP.dll_WinHttpOpen]
mov dword [ebp - 0xd8], eax
test eax, eax
je 0x40154b
cmp dword [esi + 0x14], 7
jbe 0x401289
mov esi, dword [esi]
push 0
push 0x22b1
push esi
push eax
call dword [sym.imp.WINHTTP.dll_WinHttpConnect]
mov edi, eax
test edi, edi
jne 0x4012af
push dword [ebp - 0xd8]
call dword [sym.imp.WINHTTP.dll_WinHttpCloseHandle]
jmp 0x40154b
cmp dword [ebx + 0x14], 7
jbe 0x4012b7
mov ebx, dword [ebx]
push 0x800000
push 0
push 0
push 0
push ebx
push 0
push edi
call dword [sym.imp.WINHTTP.dll_WinHttpOpenRequest]
mov ebx, eax
mov dword [ebp - 0xdc], ebx
test ebx, ebx
jne 0x4012e3
mov esi, dword [sym.imp.WINHTTP.dll_WinHttpCloseHandle]
jmp 0x401540
push 4
lea eax, [ebp - 0x24]
mov dword [ebp - 0x24], 0x3300
push eax
push 0x1f
push ebx
call dword [sym.imp.WINHTTP.dll_WinHttpSetOption]
push 0
push 0
push 0
push 0
push 0xffffffffffffffff
push str.Accept:___r_nAccept_Language:_en_US_en_q0.5_r_nConnection:_close_r_nUser_Agent:_Mozilla_5.0__Macintosh__Intel_Mac_OS_X_10_15_7__AppleWebKit_537.36__KHTML__like_Gecko__Chrome_92.0.4472.114_Safari_537.36_r_n
push ebx
call dword [sym.imp.WINHTTP.dll_WinHttpSendRequest]
test eax, eax
je 0x401537
push 0
push ebx
call dword [sym.imp.WINHTTP.dll_WinHttpReceiveResponse]
test eax, eax
je 0x401537
xorps xmm0, xmm0
mov dword [ebp - 0x18], 0
movq qword [ebp - 0x20], xmm0
push 0x1023
mov dword [ebp - 0x20], 0
mov dword [ebp - 0x1c], 0
mov dword [ebp - 0x18], 0
call fcn.0040301a
add esp, 4
test eax, eax
je 0x401531
lea ebx, [eax + 0x23]
and ebx, 0xffffffe0
push 0x1000
push 0
push ebx
lea esi, [ebx + 0x1000]
mov dword [ebx - 4], eax
mov dword [ebp - 0x20], ebx
mov dword [ebp - 0xe4], esi
mov dword [ebp - 0x18], esi
call sub.VCRUNTIME140.dll_memset
mov edi, esi
add esp, 0xc
mov dword [ebp - 0x1c], edi
lea eax, [ebp - 0x14]
mov dword [ebp - 4], 0
push eax
push 0x1000
push ebx
push dword [ebp - 0xdc]
mov dword [ebp - 0xe0], 0
call dword [sym.imp.WINHTTP.dll_WinHttpReadData]
test eax, eax
je 0x401445
cmp dword [ebp - 0x14], 0
je 0x40143f
mov eax, edi
sub eax, ebx
lea ecx, [eax + 0x1000]
cmp ecx, eax
jae 0x4013d9
lea edi, [ecx + ebx]
jmp 0x40140e
jbe 0x401411
mov eax, esi
sub eax, ebx
cmp ecx, eax
jbe 0x4013f8
push ecx
push ecx
lea ecx, [ebp - 0x20]
call fcn.00402850
mov esi, dword [ebp - 0x18]
mov edi, dword [ebp - 0x1c]
mov ebx, dword [ebp - 0x20]
jmp 0x401411
push 0x1000
push 0
push edi
call sub.VCRUNTIME140.dll_memset
add esp, 0xc
add edi, 0x1000
mov dword [ebp - 0x1c], edi
mov ecx, dword [ebp - 0xe0]
lea eax, [ebp - 0x14]
add ecx, dword [ebp - 0x14]
push eax
mov eax, edi
mov dword [ebp - 0xe0], ecx
sub eax, ebx
sub eax, ecx
push eax
lea eax, [ebx + ecx]
push eax
push dword [ebp - 0xdc]
call dword [sym.imp.WINHTTP.dll_WinHttpReadData]
test eax, eax
jne 0x4013c0
mov dword [ebp - 0xe4], esi
push dword [ebp - 0xdc]
mov esi, dword [sym.imp.WINHTTP.dll_WinHttpCloseHandle]
call esi
push dword [ebp - 0xd8]
call esi
push 0xb0
lea eax, [ebp - 0xd4]
push 0
push eax
call sub.VCRUNTIME140.dll_memset
mov eax, dword [ebp - 0xe8]
add esp, 0xc
cmp dword [eax + 0x14], 7
jbe 0x40147f
mov eax, dword [eax]
sub esp, 0xc
lea ecx, [ebp - 0xd4]
push eax
call fcn.00402400
mov eax, dword [ebp - 0xd4]
mov eax, dword [eax + 4]
mov dword [ebp + eax - 0xd4], vtable.std::basic_ofstream_char__struct_std::char_traits_char__.0
mov eax, dword [ebp - 0xd4]
mov ecx, dword [eax + 4]
lea eax, [ecx - 0x68]
mov dword [ebp + ecx - 0xd8], eax
push 0
sub edi, ebx
mov byte [ebp - 4], 1
push edi
push ebx
lea ecx, [ebp - 0xd4]
call dword [sym.imp.MSVCP140.dll_public:_class_std::basic_ostream_char__struct_std::char_traits_char______thiscall_std::basic_ostream_char__struct_std::char_traits_char__::write_char_const___long_long___int64__]
lea ecx, [ebp - 0xd0]
call fcn.00402370
test eax, eax
jne 0x4014f2
push eax
mov eax, dword [ebp - 0xd4]
lea ecx, [ebp - 0xd4]
push 2
add ecx, dword [eax + 4]
call dword [sym.imp.MSVCP140.dll_public:_void___thiscall_std::basic_ios_char__struct_std::char_traits_char__::setstate_int__bool_]
lea ecx, [ebp - 0xd4]
call fcn.00401570
test ebx, ebx
je 0x40152d
mov ecx, dword [ebp - 0xe4]
mov eax, ebx
sub ecx, ebx
cmp ecx, 0x1000
jb 0x401523
mov ebx, dword [eax - 4]
add ecx, 0x23
sub eax, ebx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x401531
push ecx
push ebx
call fcn.0040304a
add esp, 8
mov al, 1
jmp 0x40154d
call dword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__invalid_parameter_noinfo_noreturn]
mov esi, dword [sym.imp.WINHTTP.dll_WinHttpCloseHandle]
push ebx
call esi
push edi
call esi
push dword [ebp - 0xd8]
call esi
xor al, al
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.0040300c
mov esp, ebp
pop ebp
ret