Function at 0x405477
Capabilities:
Initialize winhttp library
Prepare http request
Read http header
Receive http response
Set http header

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x46d99a
mov eax, dword fs:[0]
push eax
mov eax, 0x1924
call fcn.00453650
mov eax, dword [0x486ba4]
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
xor ebx, ebx
cmp esi, ebx
jne 0x4054cd
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.0044bafb
leave
ret
xor eax, eax
push 0x3fe
mov word [ebp - 0x1848], ax
lea eax, [ebp - 0x1846]
push ebx
push eax
call fcn.00450fd0
add esp, 0xc
push 0x1400
lea eax, [ebp - 0x1448]
push ebx
push eax
call fcn.00450fd0
add esp, 0xc
push 0x38
lea eax, [ebp - 0x18b4]
push ebx
push eax
call fcn.00450fd0
lea eax, [ebp - 0x448]
mov dword [ebp - 0x1884], eax
lea eax, [ebp - 0x1448]
mov dword [ebp - 0x18a8], eax
lea eax, [ebp - 0xc48]
mov dword [ebp - 0x1894], eax
lea eax, [ebp - 0x1848]
mov dword [ebp - 0x18b4], eax
lea eax, [ebp - 0x848]
mov dword [ebp - 0x188c], eax
lea eax, [ebp - 0x1048]
mov dword [ebp - 0x189c], eax
mov eax, 0x200
add esp, 0xc
mov dword [ebp - 0x1898], eax
mov dword [ebp - 0x1888], eax
mov dword [ebp - 0x18b0], eax
mov dword [ebp - 0x1890], eax
mov dword [ebp - 0x18a4], eax
mov dword [ebp - 0x1880], eax
lea eax, [ebp - 0x18b8]
push eax
push connect
push ebx
push esi
mov dword [ebp - 0x18b8], 0x3c
call dword [sym.imp.WINHTTP.dll_WinHttpCrackUrl]
mov edi, 0x48a6e0
push edi
mov dword [ebp - 0x18ec], edi
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov dword [ebp - 4], ebx
push dword [ebp - 0x18a8]
lea esi, [ebp - 0x2c]
call fcn.004070e1
mov eax, esi
push eax
mov byte [ebp - 4], 1
call fcn.00407100
cmp dword [eax + 0x1c], ebx
push ebx
push 1
setne byte [ebp - 0x1849]
mov byte [ebp - 4], bl
call fcn.00401e7e
cmp byte [ebp - 0x1849], bl
je 0x4055fd
mov bl, 1
push edi
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov al, bl
jmp 0x4054b3
push dword [ebp - 0x18a8]
call fcn.0040537a
push dword [ebp - 0x18a8]
lea esi, [ebp - 0x2c]
call fcn.004070e1
mov eax, esi
push eax
mov byte [ebp - 4], 2
call fcn.00407100
mov ecx, dword [eax + 0x18]
mov ecx, dword [ecx]
mov eax, dword [eax]
push ebx
push 1
mov dword [ebp - 0x1868], ecx
mov dword [ebp - 0x186c], eax
mov byte [ebp - 4], bl
call fcn.00401e7e
lea eax, [ebp - 0x18e0]
push eax
call fcn.0040765f
mov byte [ebp - 4], 3
push dword [ebp - 0x18a8]
lea esi, [ebp - 0x2c]
call fcn.004070e1
mov eax, esi
push eax
mov byte [ebp - 4], 4
call fcn.00407100
mov ecx, dword [eax + 0x18]
mov eax, dword [eax]
lea edi, [ebp - 0x186c]
lea esi, [ebp - 0x1874]
mov dword [ebp - 0x1870], ecx
mov dword [ebp - 0x1874], eax
call fcn.00407fab
neg al
sbb al, al
push ebx
inc al
push 1
lea esi, [ebp - 0x2c]
mov byte [ebp - 0x1849], al
mov byte [ebp - 4], 3
call fcn.00401e7e
cmp byte [ebp - 0x1849], bl
je 0x4058d3
mov esi, edi
call fcn.00407d7d
mov eax, dword [eax]
push eax
call dword [sym.imp.WS2_32.dll_inet_ntoa]
push eax
lea ecx, [ebp - 0x1908]
call fcn.00401685
lea ecx, [ebp - 0x2c]
push ecx
mov ecx, eax
mov byte [ebp - 4], 5
call fcn.00416bad
pop ecx
push ebx
push 1
lea ecx, [ebp - 0x1908]
mov byte [ebp - 4], 7
call fcn.0040150f
push ebx
push ebx
push ebx
push 1
push ebx
call dword [sym.imp.WINHTTP.dll_WinHttpOpen]
mov esi, eax
mov dword [ebp - 0x1858], esi
cmp esi, ebx
je 0x4058b4
push 0xa
push 6
push 6
push 0xa
push esi
call dword [sym.imp.WINHTTP.dll_WinHttpSetTimeouts]
cmp dword [ebp - 0x14], 8
mov eax, dword [ebp - 0x28]
mov dword [ebp - 0x1878], 4
mov dword [ebp - 0x1850], ebx
mov dword [ebp - 0x1854], ebx
jae 0x40573e
lea eax, [ebp - 0x28]
push ebx
push dword [ebp - 0x18a0]
push eax
push esi
call dword [sym.imp.WINHTTP.dll_WinHttpConnect]
mov dword [ebp - 0x1860], eax
cmp eax, ebx
je 0x4058a8
push 0x100
push ebx
push ebx
push str.HTTP_1.1
push dword [ebp - 0x188c]
push str.HEAD
push eax
call dword [sym.imp.WINHTTP.dll_WinHttpOpenRequest]
mov edi, eax
cmp edi, ebx
je 0x40589c
push str.Host:
lea esi, [ebp - 0x48]
call fcn.004070e1
mov byte [ebp - 4], 8
push dword [ebp - 0x18a8]
mov eax, esi
push eax
lea eax, [ebp - 0x192c]
push eax
call fcn.0040454f
add esp, 0xc
push 0x478de0
push eax
lea eax, [ebp - 0x1908]
push eax
mov byte [ebp - 4], 9
call fcn.0040454f
add esp, 0xc
push 0xffffffffffffffff
mov ecx, esi
push ecx
xor ebx, ebx
mov byte [ebp - 4], 0xa
call fcn.00401df6
push ebx
push 1
lea esi, [ebp - 0x1908]
call fcn.00401e7e
push ebx
push 1
lea esi, [ebp - 0x192c]
mov byte [ebp - 4], 8
call fcn.00401e7e
cmp dword [ebp - 0x30], 8
mov eax, dword [ebp - 0x44]
jae 0x405801
lea eax, [ebp - 0x44]
push 0x20000000
push 0xffffffffffffffff
push eax
push edi
call dword [sym.imp.WINHTTP.dll_WinHttpAddRequestHeaders]
test eax, eax
je 0x405888
push ebx
push ebx
push ebx
push ebx
push ebx
push ebx
push edi
call dword [sym.imp.WINHTTP.dll_WinHttpSendRequest]
test eax, eax
je 0x405888
push ebx
push edi
call dword [sym.imp.WINHTTP.dll_WinHttpReceiveResponse]
test eax, eax
je 0x405888
lea eax, [ebp - 0x1854]
push eax
lea eax, [ebp - 0x1878]
push eax
lea eax, [ebp - 0x1850]
push eax
push ebx
push 0x20000005
push edi
call dword [sym.imp.WINHTTP.dll_WinHttpQueryHeaders]
test eax, eax
je 0x405888
cmp dword [ebp - 0x1850], ebx
jbe 0x405888
lea esi, [ebp - 0x186c]
call fcn.00407d7d
push eax
push ecx
lea eax, [ebp - 0x1850]
push eax
lea ebx, [ebp - 0x18e0]
call fcn.004076b0
add esp, 4
call fcn.004231dc
xor ebx, ebx
push edi
call dword [sym.imp.WINHTTP.dll_WinHttpCloseHandle]
push ebx
push 1
lea esi, [ebp - 0x48]
call fcn.00401e7e
xor ebx, ebx
push dword [ebp - 0x1860]
call dword [sym.imp.WINHTTP.dll_WinHttpCloseHandle]
push dword [ebp - 0x1858]
call dword [sym.imp.WINHTTP.dll_WinHttpCloseHandle]
push ebx
push 1
lea esi, [ebp - 0x2c]
mov byte [ebp - 4], 3
call fcn.00401e7e
lea esi, [ebp - 0x186c]
call fcn.0040e501
jmp 0x405650
mov eax, dword [ebp - 0x18c8]
mov eax, dword [eax]
mov dword [ebp - 0x1858], eax
mov eax, dword [ebp - 0x18e0]
mov dword [ebp - 0x1850], ebx
mov dword [ebp - 0x1854], ebx
mov dword [ebp - 0x185c], eax
mov eax, dword [ebp - 0x18c8]
mov dword [ebp - 0x1870], eax
mov eax, dword [ebp - 0x18e0]
lea edi, [ebp - 0x185c]
lea esi, [ebp - 0x1874]
mov dword [ebp - 0x1874], eax
call fcn.00407fab
test al, al
jne 0x405983
cmp dword [ebp - 0x1850], ebx
je 0x405949
mov esi, edi
call fcn.00407d7d
mov ecx, dword [eax + 0x14]
sub ecx, dword [eax + 0x10]
add eax, 4
sar ecx, 2
cmp dword [ebp - 0x1850], ecx
jae 0x405973
lea esi, [ebp - 0x185c]
call fcn.00407d7d
mov ecx, dword [eax + 0x14]
sub ecx, dword [eax + 0x10]
add eax, 4
sar ecx, 2
mov dword [ebp - 0x1850], ecx
call fcn.00407d7d
mov eax, dword [eax]
mov dword [ebp - 0x1854], eax
lea esi, [ebp - 0x185c]
call fcn.00407f5e
jmp 0x4058f9
cmp dword [ebp - 0x1854], ebx
jbe 0x405b73
push dword [ebp - 0x18a8]
lea esi, [ebp - 0x2c]
call fcn.004070e1
mov eax, esi
push eax
mov byte [ebp - 4], 0xb
call fcn.00407100
mov ecx, dword [eax + 0x18]
mov ecx, dword [ecx]
mov eax, dword [eax]
push ebx
push 1
mov dword [ebp - 0x1860], ecx
mov dword [ebp - 0x1864], eax
mov byte [ebp - 4], 3
call fcn.00401e7e
push dword [ebp - 0x18a8]
lea esi, [ebp - 0x2c]
call fcn.004070e1
mov eax, esi
push eax
mov byte [ebp - 4], 0xc
call fcn.00407100
mov ecx, dword [eax + 0x18]
mov eax, dword [eax]
lea edi, [ebp - 0x1864]
lea esi, [ebp - 0x1874]
mov dword [ebp - 0x1870], ecx
mov dword [ebp - 0x1874], eax
call fcn.00407fab
neg al
sbb al, al
push ebx
inc al
push 1
lea esi, [ebp - 0x2c]
mov byte [ebp - 0x1849], al
mov byte [ebp - 4], 3
call fcn.00401e7e
cmp byte [ebp - 0x1849], bl
je 0x405b73
mov esi, edi
call fcn.00407d7d
mov dword [ebp - 0x1858], eax
lea eax, [ebp - 0x1854]
push eax
lea ebx, [ebp - 0x18e0]
call fcn.004076b0
mov ebx, dword [eax + 0x10]
mov edi, eax
lea esi, [ebp - 0x18e8]
call fcn.004233b3
lea eax, [ebp - 0x1854]
push eax
lea ebx, [ebp - 0x18e0]
call fcn.004076b0
mov ebx, dword [eax + 0xc]
mov edi, eax
lea esi, [ebp - 0x186c]
call fcn.004233b3
mov eax, dword [ebp - 0x186c]
mov ecx, dword [ebp - 0x18e4]
mov dword [ebp - 0x187c], eax
mov eax, dword [ebp - 0x1868]
mov dword [ebp - 0x1878], eax
mov dword [ebp - 0x1850], eax
cmp eax, ecx
je 0x405ac5
mov eax, dword [ebp - 0x1858]
mov eax, dword [eax]
mov edx, dword [ebp - 0x1850]
cmp dword [edx], eax
je 0x405ac5
add dword [ebp - 0x1850], 4
cmp dword [ebp - 0x1850], ecx
jne 0x405aac
lea eax, [ebp - 0x1854]
push eax
lea ebx, [ebp - 0x18e0]
call fcn.004076b0
mov ebx, dword [eax + 0x10]
mov edi, eax
lea esi, [ebp - 0x18c0]
call fcn.004233b3
mov eax, dword [ebp - 0x187c]
test eax, eax
je 0x405af9
cmp eax, dword [ebp - 0x18c0]
je 0x405afe
call fcn.0044c072
mov eax, dword [ebp - 0x1850]
cmp eax, dword [ebp - 0x18bc]
jne 0x405b61
push dword [ebp - 0x18a8]
lea esi, [ebp - 0x2c]
call fcn.004070e1
mov byte [ebp - 4], 0xd
mov edi, dword [ebp - 0x1864]
mov ebx, dword [ebp - 0x1860]
lea esi, [ebp - 0x1864]
call fcn.0040e501
push ebx
push edi
lea eax, [ebp - 0x1910]
push eax
push ecx
lea eax, [ebp - 0x2c]
push eax
call fcn.00407100
pop ecx
push eax
call fcn.00407398
push 0
push 1
lea esi, [ebp - 0x2c]
mov byte [ebp - 4], 3
call fcn.00401e7e
jmp 0x405b6c
lea esi, [ebp - 0x1864]
call fcn.0040e501
xor ebx, ebx
jmp 0x4059c8
push dword [ebp - 0x18a8]
lea esi, [ebp - 0x2c]
call fcn.004070e1
mov eax, esi
push eax
mov byte [ebp - 4], 0xe
call fcn.00407100
cmp dword [eax + 0x1c], ebx
push ebx
push 1
setne byte [ebp - 0x1849]
call fcn.00401e7e
lea eax, [ebp - 0x18e0]
push eax
mov byte [ebp - 4], bl
call fcn.0040779b
mov bl, byte [ebp - 0x1849]
mov edi, 0x48a6e0
jmp 0x4055ef