Function at 0x405670
Capabilities:
Create service
Get common file path
Persist via windows service
Start service

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x208
mov eax, dword [0x422040]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
push esi
push edi
push 0x200
lea eax, [ebp - 0x204]
push 0
push eax
call sub.VCRUNTIME140.dll_memset
add esp, 0xc
lea eax, [ebp - 0x204]
push 0x200
push eax
call dword [sym.imp.KERNEL32.dll_GetWindowsDirectoryA]
test eax, eax
je 0x40574e
lea ecx, [ebp - 0x204]
dec ecx
cmp dword [0x42541c], 0
je 0x405700
mov al, byte [ecx + 1]
lea ecx, [ecx + 1]
test al, al
jne 0x4056c6
mov eax, dword [str.SysWOW64Ext2Srv.EXE]
mov dword [ecx], eax
mov eax, dword [0x41b1c8]
mov dword [ecx + 4], eax
mov eax, dword [0x41b1cc]
mov dword [ecx + 8], eax
mov eax, dword [0x41b1d0]
mov dword [ecx + 0xc], eax
mov eax, dword [0x41b1d4]
mov dword [ecx + 0x10], eax
mov ax, word [0x41b1d8]
jmp 0x405737
mov al, byte [ecx + 1]
lea ecx, [ecx + 1]
test al, al
jne 0x405700
mov eax, dword [str.System32Ext2Srv.EXE]
mov dword [ecx], eax
mov eax, dword [0x41b1e0]
mov dword [ecx + 4], eax
mov eax, dword [0x41b1e4]
mov dword [ecx + 8], eax
mov eax, dword [0x41b1e8]
mov dword [ecx + 0xc], eax
mov eax, dword [0x41b1ec]
mov dword [ecx + 0x10], eax
mov ax, word [0x41b1f0]
lea edx, [ebp - 0x204]
mov word [ecx + 0x14], ax
call fcn.004055b0
test eax, eax
jne 0x405870
push 0x1fe
lea eax, [ebp - 0x204]
push eax
push 0
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameA]
lea esi, [ebp - 0x204]
lea ecx, [esi + 1]
nop dword [eax + eax]
mov al, byte [esi]
inc esi
test al, al
jne 0x405770
sub esi, ecx
add esi, 0xfffffffc
js 0x4057a6
mov ebx, dword [sym.imp.api_ms_win_crt_string_l1_1_0.dll__strnicmp]
push 4
lea edi, [ebp - 0x204]
add edi, esi
push str..EXE
push edi
call ebx
add esp, 0xc
test eax, eax
je 0x40584b
sub esi, 1
jns 0x405784
lea ecx, [ebp - 0x204]
dec ecx
nop dword [eax]
mov al, byte [ecx + 1]
lea ecx, [ecx + 1]
test al, al
jne 0x4057b0
mov eax, dword [str._Srv.EXE]
mov dword [ecx], eax
mov eax, dword [0x41b200]
mov dword [ecx + 4], eax
mov al, byte [0x41b204]
mov byte [ecx + 8], al
lea edx, [ebp - 0x204]
call fcn.004055b0
test eax, eax
jne 0x405870
lea eax, [ebp - 0x204]
push eax
push 0x32
call dword [sym.imp.KERNEL32.dll_GetTempPathA]
lea ecx, [ebp - 0x204]
dec ecx
nop word [eax + eax]
mov al, byte [ecx + 1]
lea ecx, [ecx + 1]
test al, al
jne 0x405800
mov eax, dword [str.Ext2Srv.EXE]
lea edx, [ebp - 0x204]
mov dword [ecx], eax
mov eax, dword [0x41b20c]
mov dword [ecx + 4], eax
mov eax, dword [0x41b210]
mov dword [ecx + 8], eax
mov al, byte [0x41b214]
mov byte [ecx + 0xc], al
call fcn.004055b0
test eax, eax
jne 0x405870
pop edi
pop esi
xor eax, eax
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00416a63
mov esp, ebp
pop ebp
ret
test edi, edi
je 0x4057a6
lea eax, [ebp - 0x201]
cmp edi, eax
jbe 0x4057a6
mov word [edi - 3], 0x7253
mov byte [edi - 1], 0x76
jmp 0x4057d1
mov ebx, dword [sym.imp.ADVAPI32.dll_OpenSCManagerA]
push 0xf003f
push 0
push 0
call ebx
mov esi, eax
test esi, esi
je 0x405838
push 0
push 0
push 0
push 0
push 0
lea eax, [ebp - 0x204]
push eax
push 1
push 2
push 0x110
push 0xf01ff
push 0x41b218
push 0x41b230
push esi
call dword [sym.imp.ADVAPI32.dll_CreateServiceA]
mov edi, dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
test eax, eax
jne 0x4058c9
call dword [sym.imp.KERNEL32.dll_GetLastError]
jmp 0x4058cc
push eax
call edi
push esi
call edi
push 0xf003f
xor esi, esi
push esi
push esi
call ebx
mov ebx, eax
test ebx, ebx
je 0x405915
push 0xf01ff
push 0x41b230
push ebx
call dword [sym.imp.ADVAPI32.dll_OpenServiceA]
mov dword [ebp - 0x208], eax
test eax, eax
je 0x405912
push esi
push esi
push eax
call dword [sym.imp.ADVAPI32.dll_StartServiceA]
neg eax
sbb esi, esi
neg esi
push dword [ebp - 0x208]
call edi
push ebx
call edi
mov ecx, dword [ebp - 4]
mov eax, esi
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.00416a63
mov esp, ebp
pop ebp
ret