Function at 0x404172
Capabilities:
Initialize winhttp library
Prepare http request
Receive http response
Reference http user-agent string
Write file on windows

Disassembly:
push 0x5c
mov eax, 0x57aad2
call fcn.0054d3c4
xor esi, esi
mov dword [ebp - 4], esi
mov eax, dword [ebp + 0x10]
lea ecx, [ebp - 0x2c]
mov dword [ebp - 0x10], esi
mov edi, esi
mov dword [ebp - 0x28], esi
mov dword [ebp - 0x24], esi
mov dword [eax], esi
call fcn.00401fc2
lea ecx, [ebp - 0x1c]
call fcn.00401fc2
lea ecx, [ebp - 0x18]
call fcn.00401fc2
push 0x3c
pop ebx
push ebx
lea eax, [ebp - 0x68]
mov byte [ebp - 4], 4
push esi
push eax
mov dword [ebp - 0x14], esi
call fcn.005525a0
add esp, 0xc
mov dword [ebp - 0x68], ebx
or eax, 0xffffffff
lea ecx, [ebp - 0x68]
mov dword [ebp - 0x60], eax
mov dword [ebp - 0x54], eax
mov dword [ebp - 0x38], eax
mov dword [ebp - 0x30], eax
mov eax, dword [ebp + 8]
push ecx
push esi
push dword [eax - 0xc]
push eax
call dword [sym.imp.WINHTTP.dll_WinHttpCrackUrl]
test eax, eax
je 0x404365
push dword [ebp - 0x54]
lea ecx, [ebp - 0x28]
push dword [ebp - 0x58]
call fcn.00401f34
push eax
lea ecx, [ebp - 0x1c]
mov byte [ebp - 4], 5
call fcn.004020eb
mov ecx, dword [ebp - 0x28]
mov byte [ebp - 4], 4
lea ecx, [ecx - 0x10]
call fcn.00406137
push dword [ebp - 0x3c]
lea ecx, [ebp - 0x28]
call fcn.00401ed2
push eax
lea ecx, [ebp - 0x18]
mov byte [ebp - 4], 6
call fcn.004020eb
mov ecx, dword [ebp - 0x28]
mov byte [ebp - 4], 4
lea ecx, [ecx - 0x10]
call fcn.00406137
push esi
push esi
push esi
push esi
push str.Mozilla_5.0__Windows_NT_10.0_
call dword [sym.imp.WINHTTP.dll_WinHttpOpen]
mov ebx, eax
mov dword [ebp - 0x28], ebx
test ebx, ebx
je 0x404365
push esi
push dword [ebp - 0x50]
push dword [ebp - 0x1c]
push ebx
call dword [sym.imp.WINHTTP.dll_WinHttpConnect]
mov ebx, eax
mov dword [ebp - 0x24], ebx
test ebx, ebx
je 0x404365
cmp dword [ebp - 0x5c], 2
mov ecx, 0x800000
mov eax, esi
cmove eax, ecx
push eax
push esi
push esi
push esi
push dword [ebp - 0x18]
push 0x58c354
push ebx
call dword [sym.imp.WINHTTP.dll_WinHttpOpenRequest]
mov edi, eax
test edi, edi
je 0x404365
push esi
push esi
push esi
push esi
push esi
push esi
push edi
call dword [sym.imp.WINHTTP.dll_WinHttpSendRequest]
mov ebx, eax
test ebx, ebx
je 0x4042bf
push esi
push edi
call dword [sym.imp.WINHTTP.dll_WinHttpReceiveResponse]
mov ebx, eax
mov eax, dword [ebp + 0xc]
cmp dword [eax - 4], 1
jle 0x4042d6
push dword [eax - 0xc]
lea ecx, [ebp + 0xc]
call fcn.00403c07
mov eax, dword [ebp + 0xc]
push 0x58c374
push eax
lea eax, [ebp - 0x14]
push eax
call fcn.00556137
add esp, 0xc
test eax, eax
jne 0x404365
test ebx, ebx
je 0x40436d
lea eax, [ebp - 0x10]
mov dword [ebp - 0x10], esi
push eax
push edi
call dword [sym.imp.WINHTTP.dll_WinHttpQueryDataAvailable]
test eax, eax
je 0x404365
mov eax, dword [ebp - 0x10]
inc eax
push eax
call fcn.0041a210
mov ebx, eax
pop ecx
test ebx, ebx
je 0x40435a
mov ecx, dword [ebp - 0x10]
inc ecx
push ecx
push esi
push ebx
call fcn.005525a0
add esp, 0xc
mov dword [ebp - 0x20], esi
lea eax, [ebp - 0x20]
push eax
push dword [ebp - 0x10]
push ebx
push edi
call dword [sym.imp.WINHTTP.dll_WinHttpReadData]
test eax, eax
je 0x404349
push dword [ebp - 0x14]
push 1
push dword [ebp - 0x20]
push ebx
call fcn.0055f471
add esp, 0x10
push ebx
call fcn.0041a219
mov eax, dword [ebp - 0x10]
pop ecx
mov ecx, dword [ebp + 0x10]
add dword [ecx], eax
jmp 0x40435f
mov eax, esi
mov dword [ebp - 0x10], eax
test eax, eax
jne 0x4042f0
jmp 0x40436d
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, eax
cmp dword [ebp - 0x14], 0
je 0x40437c
push dword [ebp - 0x14]
call fcn.0055f1ce
pop ecx
mov ebx, dword [sym.imp.WINHTTP.dll_WinHttpCloseHandle]
test edi, edi
je 0x404389
push edi
call ebx
mov eax, dword [ebp - 0x24]
test eax, eax
je 0x404393
push eax
call ebx
mov eax, dword [ebp - 0x28]
test eax, eax
je 0x40439d
push eax
call ebx
mov ecx, dword [ebp - 0x18]
lea ecx, [ecx - 0x10]
call fcn.00406137
mov ecx, dword [ebp - 0x1c]
lea ecx, [ecx - 0x10]
call fcn.00406137
mov ecx, dword [ebp - 0x2c]
lea ecx, [ecx - 0x10]
call fcn.00406137
mov ecx, dword [ebp + 8]
lea ecx, [ecx - 0x10]
call fcn.00406137
mov ecx, dword [ebp + 0xc]
lea ecx, [ecx - 0x10]
call fcn.00406137
mov eax, esi
call fcn.0054d392
ret