Function at 0x105004e
Capabilities:
Initialize winhttp library
Prepare http request
Receive http response
Write file on windows

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
sub esp, 0x268
mov eax, dword [0x10ed860]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
mov ebx, dword [ebp + 0x10]
push esi
mov esi, dword [ebp + 0xc]
mov dword [ebp - 0x22c], ebx
mov eax, dword [0x10ed030]
cmp eax, 0x10ed030
je 0x10500a2
test byte [eax + 0x1c], 1
je 0x10500a2
cmp byte [eax + 0x19], 5
jb 0x10500a2
push esi
push dword [ebp + 8]
push 0x1005038
push 0xf8
push dword [eax + 0x14]
push dword [eax + 0x10]
call fcn.0102c716
push edi
xor edi, edi
mov dword [ebp - 0x208], edi
mov dword [ebp - 0x220], edi
mov dword [ebp - 0x210], edi
mov dword [ebp - 0x218], edi
mov dword [ebp - 0x21c], edi
mov dword [ebp - 0x214], edi
mov dword [ebp - 0x20c], edi
cmp esi, edi
je 0x1050362
mov eax, esi
lea edx, [eax + 2]
mov cx, word [eax]
inc eax
inc eax
cmp cx, di
jne 0x10500dc
sub eax, edx
sar eax, 1
je 0x1050362
cmp ebx, 0xffffffff
je 0x1050362
cmp ebx, edi
je 0x1050362
push 0x3c
pop ebx
push ebx
lea eax, [ebp - 0x268]
push edi
push eax
call sub.msvcrt.dll_memset
or dword [ebp - 0x238], 0xffffffff
or dword [ebp - 0x260], 0xffffffff
add esp, 0xc
lea eax, [ebp - 0x204]
mov dword [ebp - 0x258], eax
lea eax, [ebp - 0x268]
push eax
push edi
push edi
push esi
mov dword [ebp - 0x268], ebx
mov dword [ebp - 0x254], 0x100
call dword [sym.imp.WINHTTP.dll_WinHttpCrackUrl]
test eax, eax
je 0x1050351
push edi
push edi
push edi
push 1
push 0x1005150
call dword [sym.imp.WINHTTP.dll_WinHttpOpen]
mov esi, eax
mov dword [ebp - 0x21c], esi
cmp esi, edi
je 0x1050351
mov eax, 0x3a98
push eax
push eax
push eax
push 0x2710
push esi
call dword [sym.imp.WINHTTP.dll_WinHttpSetTimeouts]
test eax, eax
je 0x1050351
push edi
push 0x4000
push 0x1050028
push esi
call dword [sym.imp.WINHTTP.dll_WinHttpSetStatusCallback]
cmp eax, 0xffffffff
je 0x1050351
push edi
push dword [ebp - 0x250]
lea eax, [ebp - 0x204]
push eax
push esi
call dword [sym.imp.WINHTTP.dll_WinHttpConnect]
mov dword [ebp - 0x214], eax
cmp eax, edi
je 0x1050351
cmp dword [ebp - 0x25c], 2
jne 0x10501e1
mov eax, 0x800000
jmp 0x10501e3
xor eax, eax
push eax
push edi
push edi
push edi
push dword [ebp - 0x23c]
push 0x1005144
push dword [ebp - 0x214]
call dword [sym.imp.WINHTTP.dll_WinHttpOpenRequest]
mov esi, eax
mov dword [ebp - 0x20c], esi
cmp esi, edi
je 0x1050351
push edi
push edi
push edi
push edi
push edi
push edi
push esi
call dword [sym.imp.WINHTTP.dll_WinHttpSendRequest]
test eax, eax
je 0x1050351
push edi
push esi
call dword [sym.imp.WINHTTP.dll_WinHttpReceiveResponse]
test eax, eax
je 0x1050351
mov dword [ebp - 0x224], edi
lea eax, [ebp - 0x208]
push eax
push dword [ebp - 0x20c]
mov dword [ebp - 0x208], edi
call dword [sym.imp.WINHTTP.dll_WinHttpQueryDataAvailable]
test eax, eax
je 0x1050351
mov eax, dword [ebp - 0x208]
cmp eax, edi
je 0x1050342
add dword [ebp - 0x224], eax
mov ecx, dword [ebp - 0x224]
cmp ecx, dword [ebp + 8]
ja 0x1050346
inc eax
cmp dword [ebp - 0x218], eax
jae 0x10502bf
push dword [ebp - 0x210]
call fcn.010a093d
mov eax, dword [ebp - 0x208]
inc eax
push eax
call fcn.010a094e
mov ebx, eax
pop ecx
pop ecx
mov dword [ebp - 0x210], ebx
cmp ebx, edi
je 0x105034d
mov eax, dword [ebp - 0x208]
inc eax
mov dword [ebp - 0x218], eax
jmp 0x10502c5
mov ebx, dword [ebp - 0x210]
push dword [ebp - 0x218]
push edi
push ebx
call sub.msvcrt.dll_memset
add esp, 0xc
lea eax, [ebp - 0x220]
push eax
push dword [ebp - 0x208]
push ebx
push dword [ebp - 0x20c]
call dword [sym.imp.WINHTTP.dll_WinHttpReadData]
test eax, eax
je 0x1050351
mov eax, dword [ebp - 0x220]
cmp eax, dword [ebp - 0x208]
ja 0x105035b
xor esi, esi
cmp eax, edi
jbe 0x1050336
push edi
lea ecx, [ebp - 0x228]
push ecx
sub eax, esi
push eax
lea eax, [esi + ebx]
push eax
push dword [ebp - 0x22c]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x1050351
add esi, dword [ebp - 0x228]
mov eax, dword [ebp - 0x220]
cmp esi, eax
jb 0x1050307
cmp dword [ebp - 0x208], edi
ja 0x1050239
xor ebx, ebx
jmp 0x1050365
mov ebx, 0x2070
jmp 0x1050365
push 0xe
jmp 0x1050364
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov ebx, eax
jmp 0x1050365
mov ebx, 0x570
jmp 0x1050365
push 0x57
pop ebx
push dword [ebp - 0x210]
call fcn.010a093d
mov esi, dword [sym.imp.WINHTTP.dll_WinHttpCloseHandle]
pop ecx
cmp dword [ebp - 0x20c], edi
je 0x1050387
push dword [ebp - 0x20c]
call esi
cmp dword [ebp - 0x214], edi
je 0x1050397
push dword [ebp - 0x214]
call esi
cmp dword [ebp - 0x21c], edi
pop edi
je 0x10503a8
push dword [ebp - 0x21c]
call esi
mov eax, dword [0x10ed030]
cmp eax, 0x10ed030
je 0x10503e4
test byte [eax + 0x1c], 1
je 0x10503e4
movzx ecx, byte [eax + 0x19]
mov edx, ebx
neg edx
sbb edx, edx
and edx, 0xfffffffd
add edx, 5
cmp ecx, edx
jl 0x10503e4
push ebx
push 0x1005038
push 0xf9
push dword [eax + 0x14]
push dword [eax + 0x10]
call fcn.01027ecb
mov ecx, dword [ebp - 4]
pop esi
mov eax, ebx
xor ecx, ebp
pop ebx
call fcn.010a0b37
leave
ret 0xc