Function at 0x10021b90
Capabilities:
Connect to http server
Download and write a file
Get file size
Query remote server for available data
Read data from internet
Receive and write data from server to client
Receive data
Send data
Send http request
Write file on windows

Disassembly:
sub esp, 0x244
push ebx
push ebp
push esi
push edi
mov ecx, 0x40
xor eax, eax
lea edi, [esp + 0x4d]
mov byte [esp + 0x4c], 0
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
mov ecx, 0x40
xor eax, eax
lea edi, [esp + 0x151]
mov byte [esp + 0x150], 0
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
xor ebx, ebx
xor ebp, ebp
push ebx
mov dword [esp + 0x34], ebx
mov dword [esp + 0x18], ebx
mov dword [esp + 0x24], ebx
mov dword [esp + 0x28], ebx
mov dword [esp + 0x2c], ebx
mov dword [esp + 0x20], ebx
mov dword [esp + 0x3c], 0x10048968
mov dword [esp + 0x40], 0x1004897c
mov dword [esp + 0x44], 0x1004898c
mov dword [esp + 0x14], 0x8048c100
mov dword [esp + 0x38], 0x104
stosb byte es:[edi], al
call dword [sym.imp.KERNEL32.dll_SetLastError]
lea esi, [esp + 0x38]
mov edx, dword [esi]
or ecx, 0xffffffff
mov edi, edx
xor eax, eax
repne scasb al, byte es:[edi]
mov eax, dword [esp + 0x25c]
not ecx
dec ecx
add eax, 0x428
push ecx
push edx
push eax
call dword [sym.imp.MSVCRT.dll__strnicmp]
add esp, 0xc
test eax, eax
je 0x10021c4c
inc ebx
add esi, 4
cmp ebx, 3
jb 0x10021c19
cmp ebx, 3
jne 0x10021c5e
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x244
ret
mov eax, ebx
sub eax, 0
je 0x10021c86
dec eax
je 0x10021c96
dec eax
jne 0x10021d92
mov eax, dword [0x100436bc]
test eax, eax
je 0x10021d92
mov edi, 0x8848c100
jmp 0x10021d96
mov dword [esp + 0x10], 0x80c8e100
mov dword [esp + 0x24], 0x1bb
mov ecx, dword [esp + 0x25c]
xor eax, eax
lea edi, [ecx + 0x428]
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
not ecx
push ecx
push 0x40
call dword [sym.imp.KERNEL32.dll_LocalAlloc]
test eax, eax
mov dword [esp + 0x1c], eax
jne 0x10021cc8
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x244
ret
mov edi, dword [esp + ebx*4 + 0x38]
or ecx, 0xffffffff
xor eax, eax
mov edx, dword [esp + 0x25c]
repne scasb al, byte es:[edi]
not ecx
dec ecx
mov ebp, dword [esp + 0x1c]
push 0x2f
push ebp
lea edi, [ecx + edx + 0x428]
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov eax, ecx
mov esi, edi
mov edi, ebp
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov esi, dword [sym.imp.MSVCRT.dll_strchr]
call esi
mov ecx, ebp
push 0x40
push ecx
mov byte [eax], 0
call esi
add esp, 0x10
test eax, eax
je 0x10021d38
mov edi, ebp
push 0x3a
push edi
call esi
add esp, 8
test eax, eax
je 0x10021d38
push 0x40
push edi
call esi
mov ebp, eax
add esp, 8
inc ebp
push 0x3a
push ebp
call esi
add esp, 8
test eax, eax
je 0x10021d6a
push 0x3a
push ebp
call esi
mov byte [eax], 0
mov edi, ebp
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
dec ecx
lea edx, [ecx + ebp + 1]
push edx
call dword [sym.imp.MSVCRT.dll_atoi]
add esp, 0xc
mov dword [esp + 0x24], eax
mov edi, dword [esp + ebx*4 + 0x38]
or ecx, 0xffffffff
xor eax, eax
push 0x2f
repne scasb al, byte es:[edi]
mov eax, dword [esp + 0x260]
not ecx
dec ecx
lea ecx, [ecx + eax + 0x428]
push ecx
call esi
add esp, 8
mov dword [esp + 0x28], eax
mov edi, dword [esp + 0x10]
mov edx, dword [esp + 0x25c]
push 0
push 0
push 4
push 0
push 3
add edx, 0x52c
push 0xc0000000
push edx
call dword [sym.imp.KERNEL32.dll_CreateFileA]
xor ecx, ecx
cmp eax, 0xffffffff
setne cl
mov esi, ecx
mov dword [esp + 0x10], eax
test esi, esi
je 0x10021df2
mov edx, eax
push 0
push edx
call dword [sym.imp.KERNEL32.dll_GetFileSize]
test eax, eax
mov dword [esp + 0x18], eax
je 0x10021df2
push eax
lea eax, [esp + 0x50]
push str.Range:_bytes_d_
push eax
call dword [sym.imp.MSVCRT.dll_sprintf]
add esp, 0xc
test ebx, ebx
jl 0x10021f6a
cmp ebx, 1
jle 0x10021e57
cmp ebx, 2
jne 0x10021f6a
test esi, esi
je 0x10021f6e
mov al, byte [esp + 0x4c]
lea edx, [esp + 0x4c]
mov cl, al
push 0
neg cl
sbb ecx, ecx
push edi
neg al
sbb eax, eax
push ecx
mov ecx, dword [esp + 0x264]
and eax, edx
push eax
mov eax, dword [esp + 0x26c]
add eax, 0x428
push eax
push ecx
call dword [sym.imp.WININET.dll_InternetOpenUrlA]
mov esi, eax
test esi, esi
mov dword [esp + 0x14], esi
jne 0x10021fcd
jmp 0x10021f6e
test esi, esi
je 0x10021eb6
mov edx, dword [esp + 0x264]
mov eax, dword [esp + 0x260]
mov ecx, dword [esp + 0x24]
push 0
push 0
push 3
push edx
mov edx, dword [esp + 0x268]
push eax
push ecx
push ebp
push edx
call dword [sym.imp.WININET.dll_InternetConnectA]
test eax, eax
mov dword [esp + 0x20], eax
je 0x10021eb6
mov ecx, dword [esp + 0x28]
push 0
push edi
push 0
push 0
push 0x100489a8
push ecx
push 0
push eax
call dword [sym.imp.WININET.dll_HttpOpenRequestA]
test eax, eax
mov dword [esp + 0x14], eax
je 0x10021eb6
mov esi, 1
jmp 0x10021eb8
xor esi, esi
mov al, byte [esp + 0x4c]
test al, al
je 0x10021ee8
test esi, esi
je 0x10021ee6
mov eax, dword [esp + 0x14]
push 0x20000000
lea edx, [esp + 0x50]
push 0xffffffffffffffff
push edx
push eax
call dword [sym.imp.WININET.dll_HttpAddRequestHeadersA]
test eax, eax
je 0x10021ee6
mov esi, 1
jmp 0x10021ee8
xor esi, esi
mov ebp, dword [sym.imp.WININET.dll_InternetErrorDlg]
mov ebx, dword [esp + 0x30]
mov edi, dword [esp + 0x14]
test esi, esi
je 0x10021f14
push 0
push 0
push 0
push 0
push edi
call dword [sym.imp.WININET.dll_HttpSendRequestA]
test eax, eax
je 0x10021f14
mov esi, 1
jmp 0x10021f2f
xor esi, esi
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov ebx, eax
push ebx
call fcn.10021610
add esp, 4
test eax, eax
je 0x10021f6e
mov edi, dword [esp + 0x14]
mov edx, dword [esp + 0x25c]
mov ecx, esi
neg ecx
mov eax, dword [edx]
push 0
sbb ecx, ecx
push 7
not ecx
and ecx, ebx
push ecx
push edi
push eax
call ebp
test esi, esi
mov ebx, eax
je 0x10021f5b
cmp ebx, 0x2f00
jne 0x10021f6a
jmp 0x10021ef6
xor ecx, ecx
cmp ebx, 0x4c7
setne cl
mov esi, ecx
jmp 0x10021ef6
test esi, esi
jne 0x10021fc9
mov eax, dword [esp + 0x10]
cmp eax, 0xffffffff
je 0x10021f80
mov edx, eax
push edx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [esp + 0x1c]
test eax, eax
je 0x10021f8f
push eax
call dword [sym.imp.KERNEL32.dll_LocalFree]
mov eax, dword [esp + 0x14]
mov esi, dword [sym.imp.WININET.dll_InternetCloseHandle]
test eax, eax
je 0x10021fa0
push eax
call esi
mov eax, dword [esp + 0x20]
test eax, eax
je 0x10021fab
push eax
call esi
mov ecx, dword [esp + 0x25c]
pop edi
pop esi
pop ebp
mov dword [ecx + 0x630], 0
xor eax, eax
pop ebx
add esp, 0x244
ret
mov esi, dword [esp + 0x14]
mov eax, dword [esp + 0x18]
xor edi, edi
cmp eax, edi
mov dword [esp + 0x44], edi
je 0x10022076
lea edx, [esp + 0x44]
lea eax, [esp + 0x34]
push edx
lea ecx, [esp + 0x154]
push eax
push ecx
push 0x35
push esi
call dword [sym.imp.WININET.dll_HttpQueryInfoA]
test eax, eax
je 0x10022076
push 6
lea edx, [esp + 0x154]
push str.bytes
push edx
call dword [sym.imp.MSVCRT.dll_strncmp]
add esp, 0xc
test eax, eax
jne 0x10022076
lea eax, [esp + 0x28]
lea ecx, [esp + 0x24]
push eax
lea edx, [esp + 0x34]
push ecx
push edx
lea eax, [esp + 0x162]
push str._d__d__d
push eax
call dword [sym.imp.MSVCRT.dll_sscanf]
mov eax, dword [esp + 0x44]
mov ecx, dword [esp + 0x2c]
mov ebp, dword [esp + 0x270]
add esp, 0x14
cmp eax, ecx
jne 0x10022069
push 2
push edi
push edi
mov edi, dword [esp + 0x1c]
push edi
mov dword [ebp + 0x630], eax
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
jmp 0x10022098
jae 0x1002207d
push edi
push edi
mov dword [ebp + 0x630], eax
push eax
jmp 0x10022086
mov ebp, dword [esp + 0x25c]
push edi
push edi
mov dword [ebp + 0x630], edi
push edi
mov edi, dword [esp + 0x1c]
push edi
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
push edi
call dword [sym.imp.KERNEL32.dll_SetEndOfFile]
push 0
lea ecx, [esp + 0x1c]
push 0
push ecx
push esi
call dword [sym.imp.WININET.dll_InternetQueryDataAvailable]
mov ebx, eax
test ebx, ebx
jne 0x100220bf
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x3e5
jne 0x1002220a
mov edx, dword [ebp + 4]
push 0
push edx
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
test eax, eax
je 0x10022245
test ebx, ebx
jne 0x10022114
xor esi, esi
mov eax, dword [ebp + 4]
push 0
push eax
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
test eax, eax
push 0
je 0x10022247
mov edx, dword [esp + 0x18]
lea ecx, [esp + 0x1c]
push 0
push ecx
push edx
call dword [sym.imp.WININET.dll_InternetQueryDataAvailable]
test eax, eax
jne 0x10022114
inc esi
cmp esi, 0x7d0
jae 0x1002220a
jmp 0x100220d9
mov eax, dword [esp + 0x18]
push eax
push 0x40
call dword [sym.imp.KERNEL32.dll_LocalAlloc]
mov edx, dword [esp + 0x18]
lea ecx, [esp + 0x2c]
mov esi, eax
mov eax, dword [esp + 0x14]
push ecx
push edx
push esi
push eax
call dword [sym.imp.WININET.dll_InternetReadFile]
mov ebx, eax
test ebx, ebx
jne 0x10022197
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x3e5
jne 0x100221ff
mov edi, dword [esp + 0x25c]
xor ebp, ebp
mov ecx, dword [edi + 4]
push 0
push ecx
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
test eax, eax
je 0x100221f5
mov eax, dword [esp + 0x18]
mov ecx, dword [esp + 0x14]
lea edx, [esp + 0x2c]
push edx
push eax
push esi
push ecx
call dword [sym.imp.WININET.dll_InternetReadFile]
test eax, eax
jne 0x10022192
inc ebp
cmp ebp, 0x7d0
jae 0x100221ff
jmp 0x10022159
mov ebx, 1
mov eax, dword [esp + 0x2c]
test eax, eax
je 0x100221ff
test ebx, ebx
je 0x100221c2
mov edi, dword [esp + 0x10]
lea edx, [esp + 0x48]
push 0
push edx
push eax
push esi
push edi
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x100221c6
mov ebx, 1
jmp 0x100221c8
mov edi, dword [esp + 0x10]
xor ebx, ebx
push esi
call dword [sym.imp.KERNEL32.dll_LocalFree]
test ebx, ebx
je 0x1002224d
mov eax, dword [esp + 0x2c]
mov ecx, dword [esp + 0x48]
cmp ecx, eax
jne 0x1002224d
mov ebp, dword [esp + 0x25c]
mov esi, dword [esp + 0x14]
add dword [ebp + 0x630], eax
jmp 0x10022098
push 0
call dword [sym.imp.KERNEL32.dll_SetLastError]
xor ebx, ebx
push esi
call dword [sym.imp.KERNEL32.dll_LocalFree]
mov edi, dword [esp + 0x10]
mov eax, dword [esp + 0x1c]
test eax, eax
je 0x10022219
push eax
call dword [sym.imp.KERNEL32.dll_LocalFree]
mov eax, dword [esp + 0x14]
mov esi, dword [sym.imp.WININET.dll_InternetCloseHandle]
push eax
call esi
mov eax, dword [esp + 0x20]
test eax, eax
je 0x10022231
push eax
call esi
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
pop edi
pop esi
mov eax, ebx
pop ebp
pop ebx
add esp, 0x244
ret
push 0
call dword [sym.imp.KERNEL32.dll_SetLastError]
xor ebx, ebx
jmp 0x1002220a