Function at 0x41d850
Capabilities:
Check if file exists
Copy file
Create service
Get common file path
Get file attributes
Move file
Query or enumerate registry value

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x21c
mov eax, dword [0x4d044c]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
push esi
push edi
push 0x104
lea eax, [ebp - 0x108]
mov dword [ebp - 0x21c], edx
push 0
push eax
mov ebx, ecx
mov dword [ebp - 0x218], 0
call fcn.004644e0
add esp, 0xc
mov dword [ebp - 0x210], 0
lea eax, [ebp - 0x108]
push 0x104
push eax
call dword [sym.imp.KERNEL32.dll_GetWindowsDirectoryA]
test eax, eax
je 0x41dcd1
lea edi, [ebp - 0x108]
dec edi
nop dword [eax]
mov al, byte [edi + 1]
inc edi
test al, al
jne 0x41d8c0
mov ecx, 7
mov esi, str.System32DriversK7Elam.sys
rep movsd dword es:[edi], dword [esi]
push str.IsWow64Process
push str.kernel32
movsb byte es:[edi], byte [esi]
call dword [sym.imp.KERNEL32.dll_GetModuleHandleA]
mov edi, dword [sym.imp.KERNEL32.dll_GetProcAddress]
push eax
call edi
mov esi, eax
mov dword [ebp - 0x214], 0
test esi, esi
je 0x41d955
lea eax, [ebp - 0x214]
push eax
call dword [sym.imp.KERNEL32.dll_GetCurrentProcess]
push eax
call esi
cmp dword [ebp - 0x214], 0
je 0x41d955
push str.Kernel32.dll
call dword [sym.imp.KERNEL32.dll_LoadLibraryA]
mov esi, eax
test esi, esi
je 0x41d955
push str.Wow64DisableWow64FsRedirection
push esi
call edi
push str.Wow64RevertWow64FsRedirection
push esi
mov edi, eax
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
mov esi, eax
test edi, edi
je 0x41d957
lea eax, [ebp - 0x210]
push eax
call edi
mov dword [ebp - 0x218], eax
jmp 0x41d957
xor esi, esi
lea eax, [ebp - 0x108]
push eax
call dword [sym.imp.KERNEL32.dll_GetFileAttributesA]
cmp eax, 0xffffffff
mov ecx, 1
mov edi, 0
cmovne edi, ecx
cmp dword [ebp - 0x218], 0
je 0x41d989
test esi, esi
je 0x41d989
push dword [ebp - 0x210]
call esi
test edi, edi
je 0x41dcd1
push 0x104
lea eax, [ebp - 0x108]
mov dword [ebp - 0x210], 0
push 0
push eax
call fcn.004644e0
add esp, 0xc
lea eax, [ebp - 0x108]
push 0x104
push eax
call dword [sym.imp.KERNEL32.dll_GetWindowsDirectoryA]
test eax, eax
je 0x41dcd1
lea edi, [ebp - 0x108]
dec edi
mov al, byte [edi + 1]
inc edi
test al, al
jne 0x41d9d2
mov ecx, 7
mov esi, str.System32DriversK7Elam.sys
rep movsd dword es:[edi], dword [esi]
push 0xf003f
push 0
push 0
movsb byte es:[edi], byte [esi]
call dword [sym.imp.ADVAPI32.dll_OpenSCManagerA]
mov edi, eax
test edi, edi
je 0x41dcd1
push 0
push 0
push 0
push 0
push str.Early_Launch
lea eax, [ebp - 0x108]
push eax
push 3
push 0
push 1
push 0xf01ff
push str.K7Elam
push str.K7Elam
push edi
call dword [sym.imp.ADVAPI32.dll_CreateServiceA]
mov esi, eax
test esi, esi
jne 0x41da43
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x431
jne 0x41da58
mov dword [ebp - 0x210], 1
test esi, esi
je 0x41da58
push esi
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
push edi
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
cmp dword [ebp - 0x210], 0
je 0x41dcd1
push 0x104
lea eax, [ebp - 0x108]
push 0
push eax
call fcn.004644e0
push 0x104
lea eax, [ebp - 0x20c]
push 0
push eax
call fcn.004644e0
add esp, 0x18
mov dword [ebp - 0x210], 0xfe
lea eax, [ebp - 0x214]
xor esi, esi
mov dword [ebp - 0x214], esi
push eax
push 1
push esi
push str.SystemCurrentControlSetControlEarlyLaunch
push reloc.OLEAUT32.dll_SysReAllocString
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExA]
test eax, eax
jne 0x41dcd1
lea eax, [ebp - 0x210]
push eax
lea eax, [ebp - 0x20c]
push eax
push esi
push esi
push str.BackupPath
push dword [ebp - 0x214]
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExA]
test eax, eax
jne 0x41db1b
lea ecx, [ebp - 0x20c]
dec ecx
mov al, byte [ecx + 1]
lea ecx, [ecx + 1]
test al, al
jne 0x41daf5
mov eax, dword [0x4c3708]
mov esi, 1
mov dword [ecx], eax
mov eax, dword [0x4c370c]
mov dword [ecx + 4], eax
mov eax, dword [0x4c3710]
mov dword [ecx + 8], eax
mov eax, dword [ebp - 0x214]
test eax, eax
je 0x41db2c
push eax
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
test esi, esi
je 0x41dcd1
mov edx, ebx
mov esi, ebx
mov al, byte [edx]
inc edx
test al, al
jne 0x41db38
lea edi, [ebp - 0x108]
sub edx, esi
dec edi
mov al, byte [edi + 1]
inc edi
test al, al
jne 0x41db48
mov ecx, edx
mov eax, str.32bitK7Elam.sys
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
mov edx, str.64BitK7Elam.sys
and ecx, 3
cmp dword [ebp - 0x21c], 0
rep movsb byte es:[edi], byte [esi]
cmove edx, eax
mov esi, edx
mov al, byte [edx]
inc edx
test al, al
jne 0x41db74
lea edi, [ebp - 0x108]
sub edx, esi
dec edi
mov al, byte [edi + 1]
inc edi
test al, al
jne 0x41db84
mov ecx, edx
lea eax, [ebp - 0x20c]
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
push 0
mov ecx, edx
push eax
and ecx, 3
lea eax, [ebp - 0x108]
rep movsb byte es:[edi], byte [esi]
push eax
call dword [sym.imp.KERNEL32.dll_CopyFileA]
test eax, eax
jne 0x41dbd2
push 3
lea eax, [ebp - 0x20c]
push eax
lea eax, [ebp - 0x108]
push eax
call dword [sym.imp.KERNEL32.dll_MoveFileExA]
test eax, eax
je 0x41dcd1
push 0x104
lea eax, [ebp - 0x108]
push 0
push eax
call fcn.004644e0
add esp, 0xc
mov esi, ebx
nop word [eax + eax]
mov al, byte [ebx]
inc ebx
test al, al
jne 0x41dbf0
lea edi, [ebp - 0x108]
sub ebx, esi
dec edi
mov al, byte [edi + 1]
inc edi
test al, al
jne 0x41dc00
mov ecx, ebx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, ebx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
lea ecx, [ebp - 0x108]
dec ecx
nop dword [eax]
mov al, byte [ecx + 1]
lea ecx, [ecx + 1]
test al, al
jne 0x41dc20
mov eax, dword [str.AVDefsK7Elam.dsm]
mov dword [ecx], eax
mov eax, dword [0x4c3868]
mov dword [ecx + 4], eax
mov eax, dword [0x4c386c]
mov dword [ecx + 8], eax
mov eax, dword [0x4c3870]
mov dword [ecx + 0xc], eax
mov ax, word [0x4c3874]
mov word [ecx + 0x10], ax
mov al, byte [0x4c3876]
mov byte [ecx + 0x12], al
lea eax, [ebp - 0x108]
push eax
call dword [sym.imp.KERNEL32.dll_GetFileAttributesA]
cmp eax, 0xffffffff
jne 0x41dc76
mov ebx, 1
mov edi, ebx
jmp 0x41dcba
push str.K7ElmSgn.dll
call dword [sym.imp.KERNEL32.dll_LoadLibraryA]
mov esi, eax
test esi, esi
je 0x41dcd1
push str.GenK7ElamSignatureBlob
push esi
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
test eax, eax
je 0x41dcae
lea ecx, [ebp - 0x108]
push ecx
call eax
xor ebx, ebx
mov edi, 1
test eax, eax
cmovne ebx, edi
jmp 0x41dcb3
xor ebx, ebx
lea edi, [ebx + 1]
push esi
call dword [sym.imp.KERNEL32.dll_FreeLibrary]
test ebx, ebx
je 0x41dcd1
mov eax, edi
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.004606ac
mov esp, ebp
pop ebp
ret
mov ecx, dword [ebp - 4]
xor eax, eax
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.004606ac
mov esp, ebp
pop ebp
ret