Function at 0x406cf0
Capabilities:
Initialize winhttp library
Prepare http request
Read http header
Receive http response
Reference http user-agent string
Set http header

Disassembly:
push ebx
mov ebx, esp
sub esp, 8
and esp, 0xfffffff8
add esp, 4
push ebp
mov ebp, dword [ebx + 4]
mov dword [esp + 4], ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x4715f3
mov eax, dword fs:[0]
push eax
push ebx
sub esp, 0xd0
mov eax, dword [0x494054]
xor eax, ebp
mov dword [ebp - 0x14], eax
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov dword [ebp - 0x8c], ecx
xor eax, eax
mov dword [ebp - 4], 1
push eax
push eax
push eax
push 4
push str.Mozilla_5.0__Windows_NT_10.0__Win64__x64__AppleWebKit_537.36__KHTML__like_Gecko__Chrome_106.0.0.0_Safari_537.36
mov byte [ebp - 0x59], 0
mov dword [ebp - 0x54], 4
mov dword [ebp - 0x4c], 0
mov dword [ebp - 0x7c], 0
mov dword [ebp - 0x90], 0
mov dword [ebp - 0x80], eax
call dword [sym.imp.WINHTTP.dll_WinHttpOpen]
mov dword [ebp - 0x94], eax
test eax, eax
je 0x406dbf
push 0
push 0x50
push str.www.discordapp.com
push eax
call dword [sym.imp.WINHTTP.dll_WinHttpConnect]
mov ecx, eax
mov dword [ebp - 0x90], ecx
test ecx, ecx
je 0x406dbf
cmp dword [ebx + 0x34], 8
lea eax, [ebx + 0x20]
push 0
cmovae eax, dword [ebx + 0x20]
push 0
push 0
push 0
push eax
push 0x4889c0
push ecx
call dword [sym.imp.WINHTTP.dll_WinHttpOpenRequest]
mov dword [ebp - 0x80], eax
cmp dword [ebx + 0x1c], 0x10
lea edx, [ebx + 8]
mov eax, dword [ebx + 0x18]
lea edi, [ebx + 8]
cmovae edx, dword [ebx + 8]
add eax, edx
mov dword [ebp - 0x48], 0
cmp dword [ebx + 0x1c], 0x10
mov dword [ebp - 0x84], eax
cmovae edi, dword [ebx + 8]
xor ecx, ecx
sub eax, edi
mov word [ebp - 0x48], cx
push eax
lea ecx, [ebp - 0x48]
mov dword [ebp - 0x38], 0
mov dword [ebp - 0x34], 7
call fcn.004068e0
mov byte [ebp - 0x58], 0
lea ecx, [ebp - 0x48]
push dword [ebp - 0x58]
push dword [ebp - 0x84]
push edi
call fcn.00406a60
mov esi, dword [ebp - 0x80]
mov byte [ebp - 4], 2
test esi, esi
je 0x406f0b
mov ecx, dword [ebp - 0x38]
mov eax, 0x7ffffffe
sub eax, ecx
cmp eax, 0xf
jb 0x4075e6
cmp dword [ebp - 0x34], 8
lea eax, [ebp - 0x48]
push ecx
cmovae eax, dword [ebp - 0x48]
push eax
push 0xf
push str.Authorization:
push ecx
push dword [ebp - 0x94]
lea ecx, [ebp - 0x78]
call fcn.0040a280
cmp dword [ebp - 0x64], 8
lea eax, [ebp - 0x78]
push 0x20000000
cmovae eax, dword [ebp - 0x78]
push 0xffffffffffffffff
push eax
push esi
call dword [sym.imp.WINHTTP.dll_WinHttpAddRequestHeaders]
mov edx, dword [ebp - 0x64]
mov edi, eax
mov dword [ebp - 0x7c], edi
cmp edx, 8
jb 0x406eba
mov ecx, dword [ebp - 0x78]
lea edx, [edx*2 + 2]
mov eax, ecx
cmp edx, 0x1000
jb 0x406eb0
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x4075eb
push edx
push ecx
call fcn.0044c564
add esp, 8
test edi, edi
je 0x406f0d
push 0
push 0
push 0
push 0
push 0
push 0
push esi
call dword [sym.imp.WINHTTP.dll_WinHttpSendRequest]
mov edi, eax
mov dword [ebp - 0x7c], edi
test edi, edi
je 0x406f0d
push 0
push esi
call dword [sym.imp.WINHTTP.dll_WinHttpReceiveResponse]
mov edi, eax
mov dword [ebp - 0x7c], edi
test edi, edi
je 0x406f0d
push 0
lea eax, [ebp - 0x54]
push eax
lea eax, [ebp - 0x4c]
push eax
push 0
push 0x20000013
push esi
call dword [sym.imp.WINHTTP.dll_WinHttpQueryHeaders]
mov edi, eax
mov dword [ebp - 0x7c], edi
jmp 0x406f0d
xor edi, edi
mov dword [ebp - 0x50], 0
test edi, edi
je 0x407370
nop dword [eax]
lea eax, [ebp - 0x54]
mov dword [ebp - 0x54], 0
push eax
push esi
call dword [sym.imp.WINHTTP.dll_WinHttpQueryDataAvailable]
test eax, eax
jne 0x40704f
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov ecx, eax
lea esi, [ebp - 0x1b]
mov dword [ebp - 0x58], ecx
mov eax, 0xcccccccd
dec esi
mul ecx
shr edx, 3
mov al, dl
shl al, 2
lea ecx, [eax + edx]
mov eax, dword [ebp - 0x58]
add cl, cl
sub al, cl
mov ecx, edx
add al, 0x30
mov byte [esi], al
mov eax, edx
mov dword [ebp - 0x58], eax
test eax, eax
jne 0x406f48
lea eax, [ebp - 0x1b]
mov dword [ebp - 0x78], 0
mov dword [ebp - 0x68], 0
mov dword [ebp - 0x64], 0xf
mov byte [ebp - 0x78], 0
cmp esi, eax
je 0x406f9d
sub eax, esi
lea ecx, [ebp - 0x78]
push eax
push esi
call fcn.00401bb0
push 0x27
push str.Error__u_in_WinHttpQueryDataAvailable._n
push 0
lea ecx, [ebp - 0x78]
mov byte [ebp - 4], 3
call fcn.0040a520
movups xmm0, xmmword [eax]
movups xmmword [ebp - 0xc8], xmm0
movq xmm0, qword [eax + 0x10]
movq qword [ebp - 0xb8], xmm0
mov edx, dword [ebp - 0xb4]
mov dword [eax + 0x10], 0
mov dword [eax + 0x14], 0xf
mov byte [eax], 0
cmp edx, 0x10
jb 0x407014
mov ecx, dword [ebp - 0xc8]
inc edx
mov eax, ecx
cmp edx, 0x1000
jb 0x40700a
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x4075eb
push edx
push ecx
call fcn.0044c564
add esp, 8
mov byte [ebp - 4], 2
mov edx, dword [ebp - 0x64]
cmp edx, 0x10
jb 0x40704c
mov ecx, dword [ebp - 0x78]
inc edx
mov eax, ecx
cmp edx, 0x1000
jb 0x407042
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x4075eb
push edx
push ecx
call fcn.0044c564
add esp, 8
mov esi, dword [ebp - 0x80]
mov eax, dword [ebp - 0x54]
xor ecx, ecx
add eax, 1
setb cl
neg ecx
or ecx, eax
push ecx
call fcn.00451031
mov edi, eax
add esp, 4
test edi, edi
je 0x40730e
mov eax, dword [ebp - 0x54]
inc eax
push eax
push 0
push edi
call fcn.0044e510
add esp, 0xc
lea eax, [ebp - 0x50]
push eax
push dword [ebp - 0x54]
push edi
push esi
call dword [sym.imp.WINHTTP.dll_WinHttpReadData]
test eax, eax
jne 0x4071b3
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov ecx, eax
lea esi, [ebp - 0x1b]
mov dword [ebp - 0x58], ecx
mov eax, 0xcccccccd
dec esi
mul ecx
shr edx, 3
mov al, dl
shl al, 2
lea ecx, [eax + edx]
mov eax, dword [ebp - 0x58]
add cl, cl
sub al, cl
mov ecx, edx
add al, 0x30
mov byte [esi], al
mov eax, edx
mov dword [ebp - 0x58], eax
test eax, eax
jne 0x4070a6
lea eax, [ebp - 0x1b]
mov dword [ebp - 0x78], 0
mov dword [ebp - 0x68], 0
mov dword [ebp - 0x64], 0xf
mov byte [ebp - 0x78], 0
cmp esi, eax
je 0x4070fb
sub eax, esi
lea ecx, [ebp - 0x78]
push eax
push esi
call fcn.00401bb0
push 0x1d
push str.Error__u_in_WinHttpReadData._n
push 0
lea ecx, [ebp - 0x78]
mov byte [ebp - 4], 4
call fcn.0040a520
movups xmm0, xmmword [eax]
movups xmmword [ebp - 0xe0], xmm0
movq xmm0, qword [eax + 0x10]
movq qword [ebp - 0xd0], xmm0
mov edx, dword [ebp - 0xcc]
mov dword [eax + 0x10], 0
mov dword [eax + 0x14], 0xf
mov byte [eax], 0
cmp edx, 0x10
jb 0x407172
mov ecx, dword [ebp - 0xe0]
inc edx
mov eax, ecx
cmp edx, 0x1000
jb 0x407168
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x4075eb
push edx
push ecx
call fcn.0044c564
add esp, 8
mov byte [ebp - 4], 2
mov edx, dword [ebp - 0x64]
cmp edx, 0x10
jb 0x4072f7
mov ecx, dword [ebp - 0x78]
inc edx
mov eax, ecx
cmp edx, 0x1000
jb 0x4071a4
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x4075eb
push edx
push ecx
call fcn.0044c564
add esp, 8
jmp 0x4072f7
push dword [ebp - 0x54]
mov dword [ebp - 0x78], 0
lea ecx, [ebp - 0x78]
push edi
mov dword [ebp - 0x68], 0
mov dword [ebp - 0x64], 0xf
mov byte [ebp - 0x78], 0
call fcn.00401bb0
mov esi, dword [ebp - 0x8c]
mov eax, esi
mov byte [ebp - 4], 5
cmp dword [esi + 0x14], 0x10
jb 0x4071ec
mov eax, dword [esi]
push dword [esi + 0x10]
lea ecx, [ebp - 0x78]
push eax
push 0
call fcn.0040a520
movups xmm0, xmmword [eax]
movq xmm1, qword [eax + 0x10]
mov dword [eax + 0x10], 0
mov dword [eax + 0x14], 0xf
mov byte [eax], 0
lea eax, [ebp - 0xb0]
movq qword [ebp - 0x88], xmm1
movq qword [ebp - 0xa0], xmm1
movups xmmword [ebp - 0x30], xmm0
movups xmmword [ebp - 0xb0], xmm0
cmp esi, eax
je 0x407281
mov ecx, dword [esi + 0x14]
cmp ecx, 0x10
jb 0x407277
mov eax, dword [esi]
inc ecx
cmp ecx, 0x1000
jb 0x407261
mov edx, dword [eax - 4]
add ecx, 0x23
sub eax, edx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x4075eb
mov eax, edx
push ecx
push eax
call fcn.0044c564
movups xmm0, xmmword [ebp - 0x30]
add esp, 8
movq xmm1, qword [ebp - 0x88]
movups xmmword [esi], xmm0
movq qword [esi + 0x10], xmm1
jmp 0x4072bb
mov edx, dword [ebp - 0x9c]
cmp edx, 0x10
jb 0x4072bb
mov ecx, dword [ebp - 0xb0]
inc edx
mov eax, ecx
cmp edx, 0x1000
jb 0x4072b1
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x4075eb
push edx
push ecx
call fcn.0044c564
add esp, 8
mov byte [ebp - 4], 2
mov edx, dword [ebp - 0x64]
cmp edx, 0x10
jb 0x4072f3
mov ecx, dword [ebp - 0x78]
inc edx
mov eax, ecx
cmp edx, 0x1000
jb 0x4072e9
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x4075eb
push edx
push ecx
call fcn.0044c564
add esp, 8
mov byte [ebp - 0x59], 1
push edi
call fcn.0044c595
add esp, 4
cmp dword [ebp - 0x54], 0
jbe 0x40736d
mov esi, dword [ebp - 0x80]
jmp 0x406f20
push 0xe
push str.Out_of_memory_n
lea ecx, [ebp - 0x78]
mov dword [ebp - 0x78], 0
mov dword [ebp - 0x68], 0
mov dword [ebp - 0x64], 0xf
call fcn.00401bb0
mov edx, dword [ebp - 0x64]
cmp edx, 0x10
jb 0x407366
mov ecx, dword [ebp - 0x78]
inc edx
mov eax, ecx
cmp edx, 0x1000
jb 0x40735c
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x4075fa
push edx
push ecx
call fcn.0044c564
add esp, 8
mov dword [ebp - 0x54], 0
mov edi, dword [ebp - 0x7c]
push dword [ebp - 0x8c]
lea ecx, [ebp - 0xb0]
call fcn.00405f50
mov edx, dword [ebp - 0x9c]
cmp edx, 0x10
jb 0x4073bb
mov ecx, dword [ebp - 0xb0]
inc edx
mov eax, ecx
cmp edx, 0x1000
jb 0x4073b1
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x4075f0
push edx
push ecx
call fcn.0044c564
add esp, 8
test edi, edi
jne 0x4074d1
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov ecx, eax
lea esi, [ebp - 0x1b]
mov dword [ebp - 0x58], ecx
mov eax, 0xcccccccd
dec esi
mul ecx
shr edx, 3
mov al, dl
shl al, 2
lea ecx, [eax + edx]
mov eax, dword [ebp - 0x58]
add cl, cl
sub al, cl
mov ecx, edx
add al, 0x30
mov byte [esi], al
mov eax, edx
mov dword [ebp - 0x58], eax
test eax, eax
jne 0x4073d1
lea eax, [ebp - 0x1b]
mov dword [ebp - 0x78], 0
mov dword [ebp - 0x68], 0
mov dword [ebp - 0x64], 0xf
mov byte [ebp - 0x78], 0
cmp esi, eax
je 0x407426
sub eax, esi
lea ecx, [ebp - 0x78]
push eax
push esi
call fcn.00401bb0
push 0x17
push str.Error__d_has_occurred._n
push 0
lea ecx, [ebp - 0x78]
mov byte [ebp - 4], 6
call fcn.0040a520
movups xmm0, xmmword [eax]
movups xmmword [ebp - 0xb0], xmm0
movq xmm0, qword [eax + 0x10]
movq qword [ebp - 0xa0], xmm0
mov edx, dword [ebp - 0x9c]
mov dword [eax + 0x10], 0
mov dword [eax + 0x14], 0xf
mov byte [eax], 0
cmp edx, 0x10
jb 0x40749d
mov ecx, dword [ebp - 0xb0]
inc edx
mov eax, ecx
cmp edx, 0x1000
jb 0x407493
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x4075f5
push edx
push ecx
call fcn.0044c564
add esp, 8
mov edx, dword [ebp - 0x64]
cmp edx, 0x10
jb 0x4074d1
mov ecx, dword [ebp - 0x78]
inc edx
mov eax, ecx
cmp edx, 0x1000
jb 0x4074c7
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x4075f5
push edx
push ecx
call fcn.0044c564
add esp, 8
mov eax, dword [ebp - 0x80]
mov esi, dword [sym.imp.WINHTTP.dll_WinHttpCloseHandle]
test eax, eax
je 0x4074e1
push eax
call esi
mov eax, dword [ebp - 0x90]
test eax, eax
je 0x4074ee
push eax
call esi
mov eax, dword [ebp - 0x94]
test eax, eax
je 0x4074fb
push eax
call esi
mov edx, dword [ebp - 0x34]
cmp edx, 8
jb 0x407535
mov ecx, dword [ebp - 0x48]
lea edx, [edx*2 + 2]
mov eax, ecx
cmp edx, 0x1000
jb 0x40752b
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x4075fa
push edx
push ecx
call fcn.0044c564
add esp, 8
mov edx, dword [ebx + 0x1c]
xor eax, eax
mov dword [ebp - 0x38], 0
mov dword [ebp - 0x34], 7
mov word [ebp - 0x48], ax
cmp edx, 0x10
jb 0x40757d
mov ecx, dword [ebx + 8]
inc edx
mov eax, ecx
cmp edx, 0x1000
jb 0x407573
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x4075fa
push edx
push ecx
call fcn.0044c564
add esp, 8
mov edx, dword [ebx + 0x34]
mov dword [ebx + 0x18], 0
mov dword [ebx + 0x1c], 0xf
mov byte [ebx + 8], 0
cmp edx, 8
jb 0x4075c5
mov ecx, dword [ebx + 0x20]
lea edx, [edx*2 + 2]
mov eax, ecx
cmp edx, 0x1000
jb 0x4075bb
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x4075fa
push edx
push ecx
call fcn.0044c564
add esp, 8
mov al, byte [ebp - 0x59]
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
mov ecx, dword [ebp - 0x14]
xor ecx, ebp
call fcn.0044c0d8
mov esp, ebp
pop ebp
mov esp, ebx
pop ebx
ret
call fcn.00401760
call fcn.00450fe0
call fcn.00450fe0
call fcn.00450fe0
call fcn.00450fe0
int3