Function at 0x477940
Capabilities:
Check http status code
Check internet connectivity via wininet
Initialize winhttp library
Prepare http request
Read http header
Receive http response

Disassembly:
push ebp
mov ebp, esp
push ecx
mov ecx, 0xb19
push 0
push 0
dec ecx
jne 0x477949
push ecx
xchg dword [ebp - 4], ecx
push ebx
push esi
push edi
mov dword [ebp - 0x2048], ecx
mov byte [ebp - 0x2041], dl
mov dword [ebp - 0x2040], eax
mov edi, dword [ebp + 8]
xor eax, eax
push ebp
push 0x47851c
push dword fs:[eax]
mov dword fs:[eax], esp
mov bl, 4
xor eax, eax
mov dword [ebp - 0x2074], eax
mov esi, dword [0x4df158]
mov eax, dword [ebp - 0x2048]
call fcn.004050b8
cmp byte [0x4dbb2c], 0
je 0x4779b4
push 0
lea eax, [ebp - 0x2064]
push eax
call sub.wininet.dll_InternetGetConnectedState
test eax, eax
je 0x4784a8
cmp dword [edi + 0xc], 0
je 0x4779ca
lea eax, [ebp - 0x207c]
mov edx, dword [edi + 0xc]
call fcn.00405150
jmp 0x4779db
lea eax, [ebp - 0x207c]
mov edx, dword [0x4dbb30]
call fcn.00405150
lea eax, [ebp - 0x1014]
mov edx, dword [edi + 0x18]
call fcn.00405150
cmp byte [edi + 0x10], 0
je 0x477a2c
mov edx, dword [ebp - 0x1014]
mov eax, 0x478538
call fcn.004056bc
test eax, eax
jne 0x477a2c
cmp dword [ebp - 0x1014], 0
je 0x477a1c
lea eax, [ebp - 0x1014]
mov edx, 0x478570
call fcn.00405380
lea eax, [ebp - 0x1014]
mov edx, 0x478538
call fcn.00405380
cmp byte [edi + 0x10], 0
je 0x477a42
lea eax, [ebp - 0x1018]
mov edx, dword [edi + 0x14]
call fcn.00405150
jmp 0x477a4d
lea eax, [ebp - 0x1018]
call fcn.004050b8
xor edx, edx
push ebp
push 0x478451
push dword fs:[edx]
mov dword fs:[edx], esp
xor eax, eax
mov dword [ebp - 0x204c], eax
xor eax, eax
mov dword [ebp - 0x2074], eax
xor eax, eax
mov dword [ebp - 0x1010], eax
test esi, esi
jne 0x477b36
lea eax, [ebp - 0x30a0]
push eax
call sub.winhttp.dll_WinHttpGetIEProxyConfigForCurrentUser
test eax, eax
je 0x477b2f
cmp byte [ebp - 0x30a0], 0
je 0x477ab4
cmp dword [ebp - 0x309c], 0
je 0x477aee
lea edx, [ebp - 0x208c]
mov eax, dword [ebp - 0x309c]
call fcn.00406128
jmp 0x477aee
mov esi, dword [ebp - 0x3098]
test esi, esi
je 0x477ae9
lea edx, [ebp - 0x2058]
mov eax, esi
call fcn.00406128
mov esi, dword [ebp - 0x3094]
test esi, esi
je 0x477ae2
lea edx, [ebp - 0x2088]
mov eax, esi
call fcn.00406128
mov esi, 2
jmp 0x477aee
mov esi, 1
cmp dword [ebp - 0x309c], 0
je 0x477b03
mov eax, dword [ebp - 0x309c]
push eax
call sub.kernel32.dll_GlobalFree
cmp dword [ebp - 0x3098], 0
je 0x477b18
mov eax, dword [ebp - 0x3098]
push eax
call sub.kernel32.dll_GlobalFree
cmp dword [ebp - 0x3094], 0
je 0x477b7c
mov eax, dword [ebp - 0x3094]
push eax
call sub.kernel32.dll_GlobalFree
jmp 0x477b7c
mov esi, 1
jmp 0x477b7c
cmp esi, 2
jne 0x477b7c
push dword [0x4df15c]
push 0x47857c
lea edx, [ebp - 0x58c8]
mov eax, dword [0x4df160]
call fcn.00409d50
push dword [ebp - 0x58c8]
lea eax, [ebp - 0x2058]
mov edx, 3
call fcn.00405438
lea edx, [ebp - 0x2088]
mov eax, dword [0x4df170]
mov ecx, dword [eax]
call dword [ecx + 0x1c]
mov eax, esi
sub eax, 2
jb 0x477b8a
je 0x477bb6
jmp 0x477c0c
push 0
push 0
push 0
push 1
lea edx, [ebp - 0x1002]
mov ecx, 0x400
mov eax, dword [ebp - 0x207c]
call fcn.00406144
push eax
call sub.winhttp.dll_WinHttpOpen
mov dword [ebp - 0x204c], eax
jmp 0x477c14
push 0
lea edx, [ebp - 0x308e]
mov ecx, 0x400
mov eax, dword [ebp - 0x2088]
call fcn.00406144
push eax
lea edx, [ebp - 0x201a]
mov ecx, 0x400
mov eax, dword [ebp - 0x2058]
call fcn.00406144
push eax
push 3
lea edx, [ebp - 0x1002]
mov ecx, 0x400
mov eax, dword [ebp - 0x207c]
call fcn.00406144
push eax
call sub.winhttp.dll_WinHttpOpen
mov dword [ebp - 0x204c], eax
jmp 0x477c14
xor eax, eax
mov dword [ebp - 0x204c], eax
cmp dword [ebp - 0x204c], 0
je 0x478447
mov bl, 2
cmp dword [edi], 0
jle 0x477c5b
push 4
push edi
push 3
mov eax, dword [ebp - 0x204c]
push eax
call sub.winhttp.dll_WinHttpSetOption
push 4
push edi
push 5
mov eax, dword [ebp - 0x204c]
push eax
call sub.winhttp.dll_WinHttpSetOption
push 4
push edi
push 6
mov eax, dword [ebp - 0x204c]
push eax
call sub.winhttp.dll_WinHttpSetOption
xor eax, eax
mov dword [ebp - 0x2054], eax
cmp byte [edi + 7], 0
je 0x477c73
or dword [ebp - 0x2054], 0x1000
cmp byte [edi + 8], 0
je 0x477c83
or dword [ebp - 0x2054], 0x2000
cmp byte [edi + 6], 0
je 0x477c93
or dword [ebp - 0x2054], 0x100
call fcn.0040c0bc
fstp qword [ebp - 0x2060]
wait
xor eax, eax
mov dword [ebp - 0x2084], eax
cmp byte [edi + 9], 0
jne 0x477cd1
lea edx, [ebp - 0x58cc]
mov eax, dword [ebp - 0x2040]
call fcn.0040984c
mov edx, dword [ebp - 0x58cc]
mov eax, 0x478588
call fcn.004056bc
dec eax
jne 0x477cdb
or dword [ebp - 0x2084], 0x800000
lea eax, [ebp - 0x2030]
push eax
lea eax, [ebp - 0x206c]
push eax
lea eax, [ebp - 0x2070]
push eax
lea ecx, [ebp - 0x202c]
lea edx, [ebp - 0x2068]
mov eax, dword [ebp - 0x2040]
call fcn.0046c1e8
cmp dword [edi + 0x20], 0
jne 0x477d13
cmp dword [edi + 0x24], 0
je 0x477d2f
lea eax, [ebp - 0x202c]
mov edx, dword [edi + 0x20]
call fcn.00405150
lea eax, [ebp - 0x2030]
mov edx, dword [edi + 0x24]
call fcn.00405150
cmp dword [ebp - 0x206c], 0
je 0x477d5e
mov eax, dword [ebp - 0x206c]
mov al, byte [eax]
sub al, 0x2f
je 0x477d5e
sub al, 0x2d
je 0x477d5e
lea eax, [ebp - 0x206c]
mov ecx, dword [ebp - 0x206c]
mov edx, 0x478598
call fcn.004053c4
test esi, esi
jne 0x477e54
mov eax, dword [ebp - 0x208c]
call fcn.00405378
test eax, eax
jle 0x477dab
mov dword [ebp - 0x30b8], 2
xor eax, eax
mov dword [ebp - 0x30b4], eax
lea edx, [ebp - 0x1002]
mov ecx, 0x400
mov eax, dword [ebp - 0x208c]
call fcn.00406144
lea eax, [ebp - 0x1002]
mov dword [ebp - 0x30b0], eax
jmp 0x477dc7
mov dword [ebp - 0x30b8], 1
mov dword [ebp - 0x30b4], 3
xor eax, eax
mov dword [ebp - 0x30b0], eax
xor eax, eax
mov dword [ebp - 0x30ac], eax
xor eax, eax
mov dword [ebp - 0x30a8], eax
mov byte [ebp - 0x30a4], 1
lea eax, [ebp - 0x30c4]
push eax
lea eax, [ebp - 0x30b8]
push eax
lea edx, [ebp - 0x201a]
mov ecx, 0x400
mov eax, dword [ebp - 0x2068]
call fcn.00406144
push eax
mov eax, dword [ebp - 0x204c]
push eax
call sub.winhttp.dll_WinHttpGetProxyForUrl
test eax, eax
je 0x477e54
cmp dword [ebp - 0x30c0], 0
je 0x477e3f
push 0xc
lea eax, [ebp - 0x30c4]
push eax
push 0x26
mov eax, dword [ebp - 0x204c]
push eax
call sub.winhttp.dll_WinHttpSetOption
mov eax, dword [ebp - 0x30c0]
push eax
call sub.kernel32.dll_GlobalFree
cmp dword [ebp - 0x30bc], 0
je 0x477e54
mov eax, dword [ebp - 0x30bc]
push eax
call sub.kernel32.dll_GlobalFree
push 0
mov ax, word [ebp - 0x2070]
push eax
lea edx, [ebp - 0x1002]
mov ecx, 0x400
mov eax, dword [ebp - 0x2068]
call fcn.00406144
push eax
mov eax, dword [ebp - 0x204c]
push eax
call sub.winhttp.dll_WinHttpConnect
mov dword [ebp - 0x2074], eax
cmp byte [edi + 0x10], 0
jne 0x477ecf
mov eax, dword [ebp - 0x2084]
add eax, 0x100
push eax
push 0
push 0
push 0
lea edx, [ebp - 0x1002]
mov ecx, 0x400
mov eax, dword [ebp - 0x206c]
call fcn.00406144
push eax
push 0x47859c
mov eax, dword [ebp - 0x2074]
push eax
call sub.winhttp.dll_WinHttpOpenRequest
mov dword [ebp - 0x1010], eax
jmp 0x477f0f
mov eax, dword [ebp - 0x2084]
add eax, 0x100
push eax
push 0
push 0
push 0
lea edx, [ebp - 0x1002]
mov ecx, 0x400
mov eax, dword [ebp - 0x206c]
call fcn.00406144
push eax
push 0x4785a4
mov eax, dword [ebp - 0x2074]
push eax
call sub.winhttp.dll_WinHttpOpenRequest
mov dword [ebp - 0x1010], eax
cmp dword [ebp - 0x1010], 0
je 0x478202
mov eax, dword [ebp - 0x202c]
call fcn.00405378
test eax, eax
jle 0x477f97
mov eax, dword [ebp - 0x202c]
call fcn.00405378
push eax
lea edx, [ebp - 0x1002]
mov ecx, 0x400
mov eax, dword [ebp - 0x202c]
call fcn.00406144
push eax
push 0x1000
mov eax, dword [ebp - 0x1010]
push eax
call sub.winhttp.dll_WinHttpSetOption
test eax, eax
je 0x477f97
mov eax, dword [ebp - 0x2030]
call fcn.00405378
push eax
lea edx, [ebp - 0x1002]
mov ecx, 0x400
mov eax, dword [ebp - 0x2030]
call fcn.00406144
push eax
push 0x1001
mov eax, dword [ebp - 0x1010]
push eax
call sub.winhttp.dll_WinHttpSetOption
cmp dword [ebp - 0x2054], 0
jbe 0x477fe1
cmp byte [edi + 9], 0
jne 0x477fca
lea edx, [ebp - 0x58d0]
mov eax, dword [ebp - 0x2040]
call fcn.0040984c
mov edx, dword [ebp - 0x58d0]
mov eax, 0x478588
call fcn.004056bc
dec eax
jne 0x477fe1
push 4
lea eax, [ebp - 0x2054]
push eax
push 0x1f
mov eax, dword [ebp - 0x1010]
push eax
call sub.winhttp.dll_WinHttpSetOption
push ebp
call fcn.0047771c
pop ecx
mov byte [ebp - 0x2075], al
cmp byte [ebp - 0x2075], 0
je 0x478141
dec esi
je 0x478141
xor eax, eax
mov dword [ebp - 0x2028], eax
mov dword [ebp - 0x2024], 4
lea eax, [ebp - 0x2028]
push eax
lea eax, [ebp - 0x2024]
push eax
lea eax, [ebp - 0x2020]
push eax
push 0
push 0x20000013
mov eax, dword [ebp - 0x1010]
push eax
call sub.winhttp.dll_WinHttpQueryHeaders
cmp dword [ebp - 0x2020], 0x197
jne 0x478141
mov dword [ebp - 0x203c], 1
lea eax, [ebp - 0x203c]
push eax
lea eax, [ebp - 0x2038]
push eax
lea eax, [ebp - 0x2034]
push eax
mov eax, dword [ebp - 0x1010]
push eax
call sub.winhttp.dll_WinHttpQueryAuthSchemes
test eax, eax
je 0x4780c0
push 0
lea edx, [ebp - 0x201a]
mov ecx, 0x400
mov eax, dword [0x4df16c]
call fcn.00406144
push eax
lea edx, [ebp - 0x1002]
mov ecx, 0x400
mov eax, dword [0x4df168]
call fcn.00406144
push eax
mov eax, dword [ebp - 0x2038]
push eax
push 1
mov eax, dword [ebp - 0x1010]
push eax
call sub.winhttp.dll_WinHttpSetCredentials
jmp 0x478128
mov eax, dword [0x4df168]
call fcn.00405378
push eax
lea edx, [ebp - 0x1002]
mov ecx, 0x400
mov eax, dword [0x4df168]
call fcn.00406144
push eax
push 0x1002
mov eax, dword [ebp - 0x1010]
push eax
call sub.winhttp.dll_WinHttpSetOption
test eax, eax
je 0x478128
mov eax, dword [0x4df16c]
call fcn.00405378
push eax
lea edx, [ebp - 0x1002]
mov ecx, 0x400
mov eax, dword [0x4df16c]
call fcn.00406144
push eax
push 0x1003
mov eax, dword [ebp - 0x1010]
push eax
call sub.winhttp.dll_WinHttpSetOption
call fcn.0040c0bc
fstp qword [ebp - 0x2060]
wait
push ebp
call fcn.0047771c
pop ecx
mov byte [ebp - 0x2075], al
cmp byte [ebp - 0x2075], 0
jne 0x4781e5
cmp dword [ebp - 0x100c], 0x2f0c
jne 0x4781e5
xor eax, eax
mov dword [ebp - 0x100c], eax
cmp dword [edi + 0x1c], 0
je 0x4781c6
mov al, byte [0x4dbb40]
push eax
lea ecx, [ebp - 0x100c]
mov edx, dword [edi + 0x1c]
mov eax, 0x4785b8
call fcn.00474210
mov dword [ebp - 0x2080], eax
cmp dword [ebp - 0x2080], 0
je 0x4781e5
push 0x14
mov eax, dword [ebp - 0x2080]
push eax
push 0x2f
mov eax, dword [ebp - 0x1010]
push eax
call sub.winhttp.dll_WinHttpSetOption
push ebp
call fcn.0047771c
pop ecx
mov byte [ebp - 0x2075], al
mov eax, dword [ebp - 0x2080]
push eax
call sub.crypt32.dll_CertFreeCertificateContext
jmp 0x4781e5
push 0
push 0
push 0x2f
mov eax, dword [ebp - 0x1010]
push eax
call sub.winhttp.dll_WinHttpSetOption
push ebp
call fcn.0047771c
pop ecx
mov byte [ebp - 0x2075], al
cmp byte [ebp - 0x2075], 0
jne 0x478202
mov eax, dword [ebp - 0x1010]
push eax
call sub.winhttp.dll_WinHttpCloseHandle
xor eax, eax
mov dword [ebp - 0x1010], eax
push dword [ebp - 0x205c]
push dword [ebp - 0x2060]
mov eax, dword [edi]
call fcn.004776d4
test al, al
je 0x478426
cmp dword [ebp - 0x1010], 0
je 0x478426
xor eax, eax
mov dword [ebp - 0x2028], eax
mov dword [ebp - 0x2024], 4
lea eax, [ebp - 0x2028]
push eax
lea eax, [ebp - 0x2024]
push eax
lea eax, [ebp - 0x2020]
push eax
push 0
push 0x20000013
mov eax, dword [ebp - 0x1010]
push eax
call sub.winhttp.dll_WinHttpQueryHeaders
cmp dword [ebp - 0x2020], 0x191
jne 0x478277
push ebp
call fcn.004778a0
pop ecx
cmp dword [ebp - 0x2020], 0xc8
je 0x478295
cmp byte [edi + 4], 0
je 0x478299
cmp dword [ebp - 0x2020], 0x12e
jne 0x478299
mov bl, 1
jmp 0x47829b
mov bl, 8
xor eax, eax
mov dword [ebp - 0x2028], eax
mov dword [ebp - 0x2024], 0x2800
lea eax, [ebp - 0x2028]
push eax
lea eax, [ebp - 0x2024]
push eax
lea eax, [ebp - 0x58c4]
push eax
push 0
push 0x16
mov eax, dword [ebp - 0x1010]
push eax
call sub.winhttp.dll_WinHttpQueryHeaders
mov edx, dword [ebp - 0x2048]
lea eax, [ebp - 0x58c4]
call fcn.00406128
cmp byte [ebp - 0x2041], 0
je 0x478412
cmp bl, 1
jne 0x478412
mov dword [ebp - 0x2024], 4
lea eax, [ebp - 0x2028]
push eax
lea eax, [ebp - 0x2024]
push eax
lea eax, [ebp - 0x2050]
push eax
push 0
push 0x20000005
mov eax, dword [ebp - 0x1010]
push eax
call sub.winhttp.dll_WinHttpQueryHeaders
test eax, eax
je 0x478373
mov eax, dword [ebp + 0xc]
mov edx, dword [ebp - 0x2050]
call fcn.00405704
lea eax, [ebp - 0x2024]
push eax
mov eax, dword [ebp - 0x2050]
push eax
mov eax, dword [ebp + 0xc]
call fcn.004055d0
push eax
mov eax, dword [ebp - 0x1010]
push eax
call sub.winhttp.dll_WinHttpReadData
mov eax, dword [ebp + 0xc]
mov edx, dword [ebp - 0x2024]
call fcn.00405704
jmp 0x478412
call sub.kernel32.dll_GetLastError_1
mov dword [ebp - 0x2024], 1
xor eax, eax
mov dword [ebp - 0x2050], eax
cmp dword [ebp - 0x2024], 0
je 0x478404
push dword [ebp - 0x205c]
push dword [ebp - 0x2060]
mov eax, dword [edi]
call fcn.004776d4
test al, al
je 0x478404
mov edx, dword [ebp - 0x2050]
add edx, 0x400
mov eax, dword [ebp + 0xc]
call fcn.00405704
lea eax, [ebp - 0x2024]
push eax
push 0x400
mov eax, dword [ebp + 0xc]
call fcn.004055d0
mov edx, dword [ebp - 0x2050]
add eax, edx
push eax
mov eax, dword [ebp - 0x1010]
push eax
call sub.winhttp.dll_WinHttpReadData
test eax, eax
jne 0x4783ef
mov bl, 8
jmp 0x478404
mov eax, dword [ebp - 0x2024]
add dword [ebp - 0x2050], eax
cmp dword [ebp - 0x2024], 0
jne 0x478393
mov eax, dword [ebp + 0xc]
mov edx, dword [ebp - 0x2050]
call fcn.00405704
mov eax, dword [ebp - 0x1010]
push eax
call sub.winhttp.dll_WinHttpCloseHandle
xor eax, eax
mov dword [ebp - 0x1010], eax
cmp dword [ebp - 0x2074], 0
je 0x47843b
mov eax, dword [ebp - 0x2074]
push eax
call sub.winhttp.dll_WinHttpCloseHandle
mov eax, dword [ebp - 0x204c]
push eax
call sub.winhttp.dll_WinHttpCloseHandle
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
jmp 0x478469
cmp dword [ebp - 0x1010], 0
je 0x47847e
mov eax, dword [ebp - 0x1010]
push eax
call sub.winhttp.dll_WinHttpCloseHandle
cmp dword [ebp - 0x2074], 0
je 0x478493
mov eax, dword [ebp - 0x2074]
push eax
call sub.winhttp.dll_WinHttpCloseHandle
cmp dword [ebp - 0x204c], 0
je 0x4784a8
mov eax, dword [ebp - 0x204c]
push eax
call sub.winhttp.dll_WinHttpCloseHandle
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
push 0x478523
lea eax, [ebp - 0x58d0]
mov edx, 3
call fcn.004050dc
lea eax, [ebp - 0x208c]
mov edx, 2
call fcn.004050dc
lea eax, [ebp - 0x207c]
call fcn.004050b8
lea eax, [ebp - 0x206c]
mov edx, 2
call fcn.004050dc
lea eax, [ebp - 0x2058]
call fcn.004050b8
lea eax, [ebp - 0x2030]
mov edx, 2
call fcn.004050dc
lea eax, [ebp - 0x1018]
mov edx, 2
call fcn.004050dc
ret