Function at 0x49ce60
Capabilities:
Check http status code
Initialize winhttp library
Prepare http request
Read http header
Receive http response
Write file on windows

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x56afe3
mov eax, dword fs:[0]
push eax
mov eax, 0x13330
call fcn.00528110
mov eax, dword [0x5c5ebc]
xor eax, ebp
mov dword [ebp - 0x14], eax
push esi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
push 0
push 0
push 0
push 0
push 0
call dword [sym.imp.WINHTTP.dll_WinHttpOpen]
mov dword [ebp - 0x130d0], eax
cmp dword [ebp - 0x130d0], 0
jne 0x49ceb8
xor eax, eax
xor edx, edx
jmp 0x49d6b7
xor eax, eax
mov word [ebp - 0x28cc], ax
push 0x208
push 0
lea ecx, [ebp - 0x28ca]
push ecx
call fcn.005281f0
add esp, 0xc
xor edx, edx
mov word [ebp - 0x26ac], dx
push 0x208
push 0
lea eax, [ebp - 0x26aa]
push eax
call fcn.005281f0
add esp, 0xc
xor ecx, ecx
mov word [ebp - 0x132ec], cx
push 0x208
push 0
lea edx, [ebp - 0x132ea]
push edx
call fcn.005281f0
add esp, 0xc
xor eax, eax
mov word [ebp - 0x2494], ax
push 0x208
push 0
lea ecx, [ebp - 0x2492]
push ecx
call fcn.005281f0
add esp, 0xc
xor edx, edx
mov word [ebp - 0x2234], dx
push 0x208
push 0
lea eax, [ebp - 0x2232]
push eax
call fcn.005281f0
add esp, 0xc
xor ecx, ecx
mov word [ebp - 0x201c], cx
push 0x2000
push 0
lea edx, [ebp - 0x201a]
push edx
call fcn.005281f0
add esp, 0xc
mov dword [ebp - 0x2278], 0x3c
lea eax, [ebp - 0x28cc]
mov dword [ebp - 0x2274], eax
lea ecx, [ebp - 0x26ac]
mov dword [ebp - 0x2268], ecx
lea edx, [ebp - 0x132ec]
mov dword [ebp - 0x225c], edx
lea eax, [ebp - 0x2494]
mov dword [ebp - 0x2254], eax
lea ecx, [ebp - 0x2234]
mov dword [ebp - 0x224c], ecx
lea edx, [ebp - 0x201c]
mov dword [ebp - 0x2244], edx
mov dword [ebp - 0x2270], 0x104
mov dword [ebp - 0x2264], 0x104
mov dword [ebp - 0x2258], 0x104
mov dword [ebp - 0x2250], 0x104
mov dword [ebp - 0x2248], 0x104
mov dword [ebp - 0x2240], 0x1000
lea eax, [ebp - 0x2278]
push eax
push 0
push 0
mov ecx, dword [ebp + 8]
push ecx
lea edx, [ebp - 0x13318]
push edx
call fcn.00499ef0
add esp, 8
mov dword [ebp - 0x13330], eax
mov ecx, dword [ebp - 0x13330]
call fcn.00415f60
push eax
call dword [sym.imp.WINHTTP.dll_WinHttpCrackUrl]
lea ecx, [ebp - 0x13318]
call fcn.00415e20
push 0
movzx eax, word [ebp - 0x2260]
push eax
mov ecx, dword [ebp - 0x2268]
push ecx
mov edx, dword [ebp - 0x130d0]
push edx
call dword [sym.imp.WINHTTP.dll_WinHttpConnect]
mov dword [ebp - 0x2238], eax
cmp dword [ebp - 0x2238], 0
jne 0x49d084
mov eax, dword [ebp - 0x130d0]
push eax
call dword [sym.imp.WINHTTP.dll_WinHttpCloseHandle]
xor eax, eax
xor edx, edx
jmp 0x49d6b7
mov dword [ebp - 0x26b8], 0x100
movzx ecx, word [ebp - 0x2260]
cmp ecx, 0x1bb
jne 0x49d0af
mov edx, dword [ebp - 0x26b8]
or edx, 0x800000
mov dword [ebp - 0x26b8], edx
mov eax, dword [ebp - 0x224c]
push eax
call fcn.00528324
add esp, 4
mov esi, eax
mov ecx, dword [ebp - 0x2244]
push ecx
call fcn.00528324
add esp, 4
lea eax, [esi + eax + 1]
xor ecx, ecx
mov edx, 2
mul edx
seto cl
neg ecx
or ecx, eax
push ecx
call fcn.004dea4c
add esp, 4
mov dword [ebp - 0x1331c], eax
mov eax, dword [ebp - 0x1331c]
mov dword [ebp - 0x130d8], eax
mov ecx, dword [ebp - 0x224c]
push ecx
mov edx, dword [ebp - 0x130d8]
push edx
call fcn.005282c4
add esp, 8
mov eax, dword [ebp - 0x2244]
push eax
mov ecx, dword [ebp - 0x130d8]
push ecx
call fcn.00528296
add esp, 8
mov edx, dword [ebp - 0x26b8]
push edx
push 0
push 0
push 0
mov eax, dword [ebp - 0x130d8]
push eax
push 0x58ab08
mov ecx, dword [ebp - 0x2238]
push ecx
call dword [sym.imp.WINHTTP.dll_WinHttpOpenRequest]
mov dword [ebp - 0x2020], eax
cmp dword [ebp - 0x2020], 0
jne 0x49d19d
mov edx, dword [ebp - 0x2238]
push edx
call dword [sym.imp.WINHTTP.dll_WinHttpCloseHandle]
mov eax, dword [ebp - 0x130d0]
push eax
call dword [sym.imp.WINHTTP.dll_WinHttpCloseHandle]
mov ecx, dword [ebp - 0x130d8]
mov dword [ebp - 0x13320], ecx
mov edx, dword [ebp - 0x13320]
push edx
call fcn.004dea57
add esp, 4
xor eax, eax
xor edx, edx
jmp 0x49d6b7
mov eax, dword [ebp - 0x130d8]
mov dword [ebp - 0x13324], eax
mov ecx, dword [ebp - 0x13324]
push ecx
call fcn.004dea57
add esp, 4
push 0
mov edx, dword [ebp + 0x18]
push edx
lea eax, [ebp - 0x13328]
push eax
call fcn.00499ef0
add esp, 8
mov dword [ebp - 0x13334], eax
mov ecx, dword [ebp - 0x13334]
mov dword [ebp - 0x13338], ecx
mov dword [ebp - 4], 0
mov ecx, dword [ebp - 0x13338]
call fcn.00415f60
push eax
mov edx, dword [ebp + 0x14]
push edx
lea eax, [ebp - 0x1332c]
push eax
call fcn.00499ef0
add esp, 8
mov dword [ebp - 0x1333c], eax
mov ecx, dword [ebp - 0x1333c]
call fcn.00415f60
push eax
push 1
push 0
mov ecx, dword [ebp - 0x2020]
push ecx
call dword [sym.imp.WINHTTP.dll_WinHttpSetCredentials]
lea ecx, [ebp - 0x1332c]
call fcn.00415e20
mov dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x13328]
call fcn.00415e20
push 0
push 0
push 0
push 0
push 0
push 0
mov edx, dword [ebp - 0x2020]
push edx
call dword [sym.imp.WINHTTP.dll_WinHttpSendRequest]
test eax, eax
jne 0x49d292
mov eax, dword [ebp - 0x2020]
push eax
call dword [sym.imp.WINHTTP.dll_WinHttpCloseHandle]
mov ecx, dword [ebp - 0x2238]
push ecx
call dword [sym.imp.WINHTTP.dll_WinHttpCloseHandle]
mov edx, dword [ebp - 0x130d0]
push edx
call dword [sym.imp.WINHTTP.dll_WinHttpCloseHandle]
xor eax, eax
xor edx, edx
jmp 0x49d6b7
push 0
mov eax, dword [ebp - 0x2020]
push eax
call dword [sym.imp.WINHTTP.dll_WinHttpReceiveResponse]
mov dword [ebp - 0x2498], 0
mov dword [ebp - 0x10], 4
push 0
lea ecx, [ebp - 0x10]
push ecx
lea edx, [ebp - 0x2498]
push edx
push 0
push 0x20000013
mov eax, dword [ebp - 0x2020]
push eax
call dword [sym.imp.WINHTTP.dll_WinHttpQueryHeaders]
cmp dword [ebp - 0x2498], 0xc8
je 0x49d33a
mov ecx, dword [ebp - 0x2020]
push ecx
call dword [sym.imp.WINHTTP.dll_WinHttpCloseHandle]
mov edx, dword [ebp - 0x2238]
push edx
call dword [sym.imp.WINHTTP.dll_WinHttpCloseHandle]
mov eax, dword [ebp - 0x130d0]
push eax
call dword [sym.imp.WINHTTP.dll_WinHttpCloseHandle]
cmp dword [ebp - 0x2498], 0x191
jne 0x49d31a
push 0x41
call dword [sym.imp.KERNEL32.dll_SetLastError]
cmp dword [ebp - 0x2498], 0x192
jne 0x49d331
push 0x701
call dword [sym.imp.KERNEL32.dll_SetLastError]
xor eax, eax
xor edx, edx
jmp 0x49d6b7
xor ecx, ecx
mov word [ebp - 0x130cc], cx
push 0x7fe
push 0
lea edx, [ebp - 0x130ca]
push edx
call fcn.005281f0
add esp, 0xc
mov dword [ebp - 0x130d4], 0x400
mov dword [ebp - 0x2284], 0
mov dword [ebp - 0x2280], 0
push 0
lea eax, [ebp - 0x130d4]
push eax
lea ecx, [ebp - 0x130cc]
push ecx
push 0
push 5
mov edx, dword [ebp - 0x2020]
push edx
call dword [sym.imp.WINHTTP.dll_WinHttpQueryHeaders]
test eax, eax
je 0x49d3b7
lea eax, [ebp - 0x130cc]
push eax
call fcn.00527fe6
add esp, 4
mov dword [ebp - 0x2284], eax
mov dword [ebp - 0x2280], edx
mov dword [ebp - 0x26b4], 0
mov dword [ebp - 0x26b0], 0
cmp dword [ebp + 0x10], 0
je 0x49d3e7
push 0x640000
push 0
push 0x401
mov ecx, dword [ebp + 0x10]
push ecx
call dword [sym.imp.USER32.dll_SendMessageW]
push 0
push 0x80
push 2
push 0
push 3
push 0x40000000
mov edx, dword [ebp + 0xc]
push edx
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov dword [ebp - 0x227c], eax
cmp dword [ebp - 0x227c], 0xffffffff
jne 0x49d442
mov eax, dword [ebp - 0x2020]
push eax
call dword [sym.imp.WINHTTP.dll_WinHttpCloseHandle]
mov ecx, dword [ebp - 0x2238]
push ecx
call dword [sym.imp.WINHTTP.dll_WinHttpCloseHandle]
mov edx, dword [ebp - 0x130d0]
push edx
call dword [sym.imp.WINHTTP.dll_WinHttpCloseHandle]
xor eax, eax
xor edx, edx
jmp 0x49d6b7
cmp dword [ebp + 0x1c], 0
je 0x49d48d
mov eax, dword [ebp + 0x1c]
cmp dword [eax], 0
jne 0x49d48d
mov ecx, dword [ebp - 0x227c]
push ecx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov edx, dword [ebp - 0x2020]
push edx
call dword [sym.imp.WINHTTP.dll_WinHttpCloseHandle]
mov eax, dword [ebp - 0x2238]
push eax
call dword [sym.imp.WINHTTP.dll_WinHttpCloseHandle]
mov ecx, dword [ebp - 0x130d0]
push ecx
call dword [sym.imp.WINHTTP.dll_WinHttpCloseHandle]
xor eax, eax
xor edx, edx
jmp 0x49d6b7
lea edx, [ebp - 0x223c]
push edx
push 0x10000
lea eax, [ebp - 0x128cc]
push eax
mov ecx, dword [ebp - 0x2020]
push ecx
call dword [sym.imp.WINHTTP.dll_WinHttpReadData]
mov dword [ebp - 0x132f8], eax
mov edx, dword [ebp - 0x223c]
mov dword [ebp - 0x132f4], edx
cmp dword [ebp - 0x132f8], 0
je 0x49d5f7
cmp dword [ebp - 0x223c], 0
jbe 0x49d5f7
mov eax, dword [ebp - 0x223c]
xor ecx, ecx
add eax, dword [ebp - 0x26b4]
mov edx, dword [ebp - 0x26b0]
adc edx, ecx
mov dword [ebp - 0x26b4], eax
mov dword [ebp - 0x26b0], edx
cmp dword [ebp + 0x10], 0
je 0x49d586
mov eax, dword [ebp - 0x2284]
or eax, dword [ebp - 0x2280]
je 0x49d551
push 0
push 0
push 0x64
mov ecx, dword [ebp - 0x26b0]
push ecx
mov edx, dword [ebp - 0x26b4]
push edx
call fcn.005282f0
mov ecx, dword [ebp - 0x2280]
push ecx
mov ecx, dword [ebp - 0x2284]
push ecx
push edx
push eax
call fcn.00528340
push eax
push 0x402
mov edx, dword [ebp + 0x10]
push edx
call dword [sym.imp.USER32.dll_SendMessageW]
push 1
push 0
push 0
push 0
lea eax, [ebp - 0x13314]
push eax
call dword [sym.imp.USER32.dll_PeekMessageW]
test eax, eax
je 0x49d586
lea ecx, [ebp - 0x13314]
push ecx
call dword [sym.imp.USER32.dll_TranslateMessage]
lea edx, [ebp - 0x13314]
push edx
call dword [sym.imp.USER32.dll_DispatchMessageW]
jmp 0x49d551
push 0
lea eax, [ebp - 0x132f0]
push eax
mov ecx, dword [ebp - 0x132f4]
push ecx
lea edx, [ebp - 0x128cc]
push edx
mov eax, dword [ebp - 0x227c]
push eax
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov ecx, dword [ebp - 0x132f4]
cmp ecx, dword [ebp - 0x132f0]
je 0x49d5f5
mov edx, dword [ebp - 0x227c]
push edx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [ebp - 0x2020]
push eax
call dword [sym.imp.WINHTTP.dll_WinHttpCloseHandle]
mov ecx, dword [ebp - 0x2238]
push ecx
call dword [sym.imp.WINHTTP.dll_WinHttpCloseHandle]
mov edx, dword [ebp - 0x130d0]
push edx
call dword [sym.imp.WINHTTP.dll_WinHttpCloseHandle]
xor eax, eax
xor edx, edx
jmp 0x49d6b7
jmp 0x49d63c
cmp dword [ebp - 0x132f8], 0
jne 0x49d63a
mov eax, dword [ebp - 0x2020]
push eax
call dword [sym.imp.WINHTTP.dll_WinHttpCloseHandle]
mov ecx, dword [ebp - 0x2238]
push ecx
call dword [sym.imp.WINHTTP.dll_WinHttpCloseHandle]
mov edx, dword [ebp - 0x130d0]
push edx
call dword [sym.imp.WINHTTP.dll_WinHttpCloseHandle]
mov eax, dword [ebp - 0x227c]
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
xor eax, eax
xor edx, edx
jmp 0x49d6b7
jmp 0x49d677
mov ecx, dword [ebp - 0x2284]
or ecx, dword [ebp - 0x2280]
je 0x49d66a
mov edx, dword [ebp - 0x26b0]
cmp edx, dword [ebp - 0x2280]
jb 0x49d66a
ja 0x49d668
mov eax, dword [ebp - 0x26b4]
cmp eax, dword [ebp - 0x2284]
jb 0x49d66a
jmp 0x49d677
mov ecx, 1
test ecx, ecx
jne 0x49d442
mov edx, dword [ebp - 0x227c]
push edx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [ebp - 0x2020]
push eax
call dword [sym.imp.WINHTTP.dll_WinHttpCloseHandle]
mov ecx, dword [ebp - 0x2238]
push ecx
call dword [sym.imp.WINHTTP.dll_WinHttpCloseHandle]
mov edx, dword [ebp - 0x130d0]
push edx
call dword [sym.imp.WINHTTP.dll_WinHttpCloseHandle]
mov eax, dword [ebp - 0x26b4]
mov edx, dword [ebp - 0x26b0]
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop esi
mov ecx, dword [ebp - 0x14]
xor ecx, ebp
call fcn.00527aad
mov esp, ebp
pop ebp
ret