Function at 0x405470
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 0x46e108
mov eax, dword fs:[0]
push eax
mov eax, 0x1924
call fcn.00453cf0
mov eax, dword [0x487ba4]
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 0x4054c6
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.0044c18b
leave
ret
xor eax, eax
push 0x3fe
mov word [ebp - 0x1848], ax
lea eax, [ebp - 0x1846]
push ebx
push eax
call fcn.00451670
add esp, 0xc
push 0x1400
lea eax, [ebp - 0x1448]
push ebx
push eax
call fcn.00451670
add esp, 0xc
push 0x38
lea eax, [ebp - 0x18b4]
push ebx
push eax
call fcn.00451670
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, 0x48b6e0
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.004070da
mov eax, esi
push eax
mov byte [ebp - 4], 1
call fcn.004070f9
cmp dword [eax + 0x1c], ebx
push ebx
push 1
setne byte [ebp - 0x1849]
mov byte [ebp - 4], bl
call fcn.00401e74
cmp byte [ebp - 0x1849], bl
je 0x4055f6
mov bl, 1
push edi
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov al, bl
jmp 0x4054ac
push dword [ebp - 0x18a8]
call fcn.00405373
push dword [ebp - 0x18a8]
lea esi, [ebp - 0x2c]
call fcn.004070da
mov eax, esi
push eax
mov byte [ebp - 4], 2
call fcn.004070f9
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.00401e74
lea eax, [ebp - 0x18e0]
push eax
call fcn.00407658
mov byte [ebp - 4], 3
push dword [ebp - 0x18a8]
lea esi, [ebp - 0x2c]
call fcn.004070da
mov eax, esi
push eax
mov byte [ebp - 4], 4
call fcn.004070f9
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.00407f61
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.00401e74
cmp byte [ebp - 0x1849], bl
je 0x4058cc
mov esi, edi
call fcn.00407d36
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.00416b93
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 0x4058ad
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 0x405737
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 0x4058a1
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 0x405895
push str.Host:
lea esi, [ebp - 0x48]
call fcn.004070da
mov byte [ebp - 4], 8
push dword [ebp - 0x18a8]
mov eax, esi
push eax
lea eax, [ebp - 0x192c]
push eax
call fcn.00404545
add esp, 0xc
push 0x479de0
push eax
lea eax, [ebp - 0x1908]
push eax
mov byte [ebp - 4], 9
call fcn.00404545
add esp, 0xc
push 0xffffffffffffffff
mov ecx, esi
push ecx
xor ebx, ebx
mov byte [ebp - 4], 0xa
call fcn.00401dec
push ebx
push 1
lea esi, [ebp - 0x1908]
call fcn.00401e74
push ebx
push 1
lea esi, [ebp - 0x192c]
mov byte [ebp - 4], 8
call fcn.00401e74
cmp dword [ebp - 0x30], 8
mov eax, dword [ebp - 0x44]
jae 0x4057fa
lea eax, [ebp - 0x44]
push 0x20000000
push 0xffffffffffffffff
push eax
push edi
call dword [sym.imp.WINHTTP.dll_WinHttpAddRequestHeaders]
test eax, eax
je 0x405881
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 0x405881
push ebx
push edi
call dword [sym.imp.WINHTTP.dll_WinHttpReceiveResponse]
test eax, eax
je 0x405881
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 0x405881
cmp dword [ebp - 0x1850], ebx
jbe 0x405881
lea esi, [ebp - 0x186c]
call fcn.00407d36
push eax
push ecx
lea eax, [ebp - 0x1850]
push eax
lea ebx, [ebp - 0x18e0]
call fcn.004076a9
add esp, 4
call fcn.00423878
xor ebx, ebx
push edi
call dword [sym.imp.WINHTTP.dll_WinHttpCloseHandle]
push ebx
push 1
lea esi, [ebp - 0x48]
call fcn.00401e74
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.00401e74
lea esi, [ebp - 0x186c]
call fcn.0040e4b8
jmp 0x405649
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.00407f61
test al, al
jne 0x40597c
cmp dword [ebp - 0x1850], ebx
je 0x405942
mov esi, edi
call fcn.00407d36
mov ecx, dword [eax + 0x14]
sub ecx, dword [eax + 0x10]
add eax, 4
sar ecx, 2
cmp dword [ebp - 0x1850], ecx
jae 0x40596c
lea esi, [ebp - 0x185c]
call fcn.00407d36
mov ecx, dword [eax + 0x14]
sub ecx, dword [eax + 0x10]
add eax, 4
sar ecx, 2
mov dword [ebp - 0x1850], ecx
call fcn.00407d36
mov eax, dword [eax]
mov dword [ebp - 0x1854], eax
lea esi, [ebp - 0x185c]
call fcn.00407f14
jmp 0x4058f2
cmp dword [ebp - 0x1854], ebx
jbe 0x405b6c
push dword [ebp - 0x18a8]
lea esi, [ebp - 0x2c]
call fcn.004070da
mov eax, esi
push eax
mov byte [ebp - 4], 0xb
call fcn.004070f9
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.00401e74
push dword [ebp - 0x18a8]
lea esi, [ebp - 0x2c]
call fcn.004070da
mov eax, esi
push eax
mov byte [ebp - 4], 0xc
call fcn.004070f9
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.00407f61
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.00401e74
cmp byte [ebp - 0x1849], bl
je 0x405b6c
mov esi, edi
call fcn.00407d36
mov dword [ebp - 0x1858], eax
lea eax, [ebp - 0x1854]
push eax
lea ebx, [ebp - 0x18e0]
call fcn.004076a9
mov ebx, dword [eax + 0x10]
mov edi, eax
lea esi, [ebp - 0x18e8]
call fcn.00423a26
lea eax, [ebp - 0x1854]
push eax
lea ebx, [ebp - 0x18e0]
call fcn.004076a9
mov ebx, dword [eax + 0xc]
mov edi, eax
lea esi, [ebp - 0x186c]
call fcn.00423a26
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 0x405abe
mov eax, dword [ebp - 0x1858]
mov eax, dword [eax]
mov edx, dword [ebp - 0x1850]
cmp dword [edx], eax
je 0x405abe
add dword [ebp - 0x1850], 4
cmp dword [ebp - 0x1850], ecx
jne 0x405aa5
lea eax, [ebp - 0x1854]
push eax
lea ebx, [ebp - 0x18e0]
call fcn.004076a9
mov ebx, dword [eax + 0x10]
mov edi, eax
lea esi, [ebp - 0x18c0]
call fcn.00423a26
mov eax, dword [ebp - 0x187c]
test eax, eax
je 0x405af2
cmp eax, dword [ebp - 0x18c0]
je 0x405af7
call fcn.0044c702
mov eax, dword [ebp - 0x1850]
cmp eax, dword [ebp - 0x18bc]
jne 0x405b5a
push dword [ebp - 0x18a8]
lea esi, [ebp - 0x2c]
call fcn.004070da
mov byte [ebp - 4], 0xd
mov edi, dword [ebp - 0x1864]
mov ebx, dword [ebp - 0x1860]
lea esi, [ebp - 0x1864]
call fcn.0040e4b8
push ebx
push edi
lea eax, [ebp - 0x1910]
push eax
push ecx
lea eax, [ebp - 0x2c]
push eax
call fcn.004070f9
pop ecx
push eax
call fcn.00407391
push 0
push 1
lea esi, [ebp - 0x2c]
mov byte [ebp - 4], 3
call fcn.00401e74
jmp 0x405b65
lea esi, [ebp - 0x1864]
call fcn.0040e4b8
xor ebx, ebx
jmp 0x4059c1
push dword [ebp - 0x18a8]
lea esi, [ebp - 0x2c]
call fcn.004070da
mov eax, esi
push eax
mov byte [ebp - 4], 0xe
call fcn.004070f9
cmp dword [eax + 0x1c], ebx
push ebx
push 1
setne byte [ebp - 0x1849]
call fcn.00401e74
lea eax, [ebp - 0x18e0]
push eax
mov byte [ebp - 4], bl
call fcn.00407794
mov bl, byte [ebp - 0x1849]
mov edi, 0x48b6e0
jmp 0x4055e8