Function at 0x40314e
Capabilities:
Check for foreground window switch
Check os version
Create process on windows
Link many functions at runtime
Persist via windows service
Set registry value

Disassembly:
push ebp
mov ebp, esp
sub esp, 0xf9c
push ebx
push esi
lea eax, [ebp - 0x384]
push edi
xor ebx, ebx
push eax
mov dword [ebp - 8], ebx
mov dword [ebp - 0x384], 0x114
call dword [sym.imp.KERNEL32.dll_GetVersionExW]
test eax, eax
je 0x40369b
cmp dword [ebp - 0x374], 2
jne 0x40369b
cmp dword [ebp - 0x380], 6
jb 0x40319b
mov dword [ebp - 8], 1
lea eax, [ebp - 0x10]
push ebx
push eax
mov edi, 0xf003f
push ebx
push edi
push ebx
push 0x41c4f4
push ebx
mov esi, 0x80000002
push str.SOFTWAREInternet_Download_Manager
push esi
call dword [sym.imp.ADVAPI32.dll_RegCreateKeyExW]
test eax, eax
jne 0x4031ec
cmp dword [ebp + 8], ebx
push 4
setne al
mov dword [ebp - 0x18], eax
lea eax, [ebp - 0x18]
push eax
push 4
push ebx
push str.AdvIntDriverEnabled2
push dword [ebp - 0x10]
call dword [sym.imp.ADVAPI32.dll_RegSetValueExW]
push dword [ebp - 0x10]
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
call fcn.00403110
neg eax
sbb eax, eax
mov ecx, str.SYSTEMCurrentControlSetServicesIDMWFP
and eax, 0x100
add eax, edi
cmp dword [ebp - 8], ebx
jne 0x40320b
mov ecx, str.SYSTEMCurrentControlSetServicesIDMTDI
lea edx, [ebp - 0x10]
push edx
push eax
push ebx
push ecx
push esi
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExW]
test eax, eax
jne 0x403255
cmp dword [ebp + 8], ebx
je 0x40322e
cmp dword [ebp - 8], ebx
setne al
inc eax
mov dword [ebp - 0xc], eax
jmp 0x403235
mov dword [ebp - 0xc], 3
lea eax, [ebp - 0xc]
push 4
push eax
push 4
push ebx
push str.Start
push dword [ebp - 0x10]
call dword [sym.imp.ADVAPI32.dll_RegSetValueExW]
push dword [ebp - 0x10]
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
push ebx
call dword [sym.imp.ole32.dll_CoInitialize]
cmp dword [ebp + 8], ebx
jne 0x40326d
cmp dword [0x41de50], ebx
je 0x403695
cmp dword [ebp - 8], ebx
mov dword [ebp - 0xc], ebx
mov dword [ebp - 4], ebx
mov ecx, str.IDMWFP
jne 0x403282
mov ecx, str.IDMTDI
cmp dword [ebp + 8], ebx
mov eax, str.start
jne 0x403291
mov eax, str.stop
mov edi, dword [sym.imp.USER32.dll_wsprintfW]
push ecx
push eax
lea eax, [ebp - 0x270]
push str._s__s
push eax
call edi
mov esi, dword [sym.imp.KERNEL32.dll_GetProcAddress]
add esp, 0x10
push 0x3c
lea eax, [ebp - 0x68]
push ebx
push eax
call sub.MSVCRT.dll_memset
add esp, 0xc
mov dword [ebp - 0x68], 0x3c
mov dword [ebp - 0x64], 0x40
mov dword [ebp - 0x5c], str.open
mov dword [ebp - 0x58], 0x416594
mov dword [ebp - 0x50], ebx
mov dword [ebp - 0x4c], ebx
mov dword [ebp - 0x48], ebx
call dword [sym.imp.USER32.dll_GetForegroundWindow]
mov dword [ebp - 0x60], eax
lea eax, [ebp - 0x270]
mov dword [ebp - 0x54], eax
lea eax, [ebp - 0x68]
push eax
call dword [sym.imp.SHELL32.dll_ShellExecuteExW]
test eax, eax
je 0x403476
push 0xffffffffffffffff
push dword [ebp - 0x30]
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
or dword [ebp - 0x14], 0xffffffff
lea eax, [ebp - 0x14]
push eax
push dword [ebp - 0x30]
call dword [sym.imp.KERNEL32.dll_GetExitCodeProcess]
test eax, eax
je 0x40346d
cmp dword [ebp - 0x14], ebx
jne 0x40333d
mov dword [ebp - 0xc], 1
jmp 0x40346d
cmp dword [ebp + 8], ebx
je 0x40346d
cmp dword [ebp - 4], ebx
jne 0x40346d
cmp dword [ebp - 8], ebx
je 0x40346d
cmp dword [ebp - 0x380], 0xa
jae 0x40346d
push str.Advapi32.dll
call dword [sym.imp.KERNEL32.dll_LoadLibraryW]
cmp eax, ebx
mov dword [ebp - 0x1c], eax
je 0x40346d
push str.OpenSCManagerW
push eax
call esi
push str.OpenServiceW
mov edi, eax
push dword [ebp - 0x1c]
call esi
push str.StartServiceW
mov dword [ebp - 0x2c], eax
push dword [ebp - 0x1c]
call esi
push str.CloseServiceHandle
mov dword [ebp - 0x18], eax
push dword [ebp - 0x1c]
call esi
cmp edi, ebx
mov dword [ebp - 0x28], eax
je 0x40345e
cmp dword [ebp - 0x2c], ebx
je 0x40345e
cmp dword [ebp - 0x18], ebx
je 0x40345e
cmp eax, ebx
je 0x40345e
push 1
push ebx
push ebx
call edi
mov edi, eax
cmp edi, ebx
je 0x40345e
push 0x10
push str.idmwfp
push edi
call dword [ebp - 0x2c]
cmp eax, ebx
je 0x40345a
push ebx
push ebx
push eax
call dword [ebp - 0x18]
test eax, eax
je 0x403400
mov dword [ebp - 0xc], 1
jmp 0x40345a
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 0x14], eax
lea eax, [ebp - 0x20]
push eax
push 0xf003f
push ebx
push str.SoftwareDownloadManager_
push 0x80000001
mov dword [ebp - 0x20], ebx
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExW]
test eax, eax
jne 0x40344a
lea eax, [ebp - 0x14]
push 4
push eax
push 4
push ebx
push str.nInstDrvRes0
push dword [ebp - 0x20]
call dword [sym.imp.ADVAPI32.dll_RegSetValueExW]
push dword [ebp - 0x20]
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
cmp dword [ebp - 0x14], 0x241
jne 0x40345a
mov dword [ebp - 4], 5
push edi
call dword [ebp - 0x28]
push dword [ebp - 0x1c]
call dword [sym.imp.KERNEL32.dll_FreeLibrary]
mov edi, dword [sym.imp.USER32.dll_wsprintfW]
push dword [ebp - 0x30]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
cmp dword [ebp + 8], ebx
je 0x403695
cmp dword [ebp - 0xc], ebx
jne 0x40349d
inc dword [ebp - 4]
cmp dword [ebp - 4], 5
jg 0x4034cc
push 0x1f4
call dword [sym.imp.KERNEL32.dll_Sleep]
jmp 0x4032b0
cmp dword [ebp - 8], ebx
push ebx
push ebx
push 3
push ebx
push 3
push 0xc0000000
je 0x4034b5
push str..IDMWFP
jmp 0x4034ba
push str..IDMTDI
call dword [sym.imp.KERNEL32.dll_CreateFileW]
cmp eax, 0xffffffff
je 0x403484
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
cmp dword [ebp + 8], ebx
je 0x403695
lea eax, [ebp - 0x78c]
push 0x104
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
test eax, eax
je 0x40369b
mov eax, dword [ebp + 0xc]
cmp eax, ebx
jne 0x4034fd
lea eax, [ebp - 0x78c]
lea ecx, [ebp - 0xd9c]
push ecx
lea ecx, [ebp - 0xf9c]
push ecx
lea ecx, [ebp - 0x584]
push ecx
lea ecx, [ebp - 0x28]
push ecx
push eax
call sub.MSVCRT.dll__wsplitpath
add esp, 0x14
call fcn.00403110
test eax, eax
je 0x403651
cmp dword [0x41de60], ebx
lea eax, [ebp - 0x584]
push eax
lea eax, [ebp - 0x28]
push eax
je 0x403546
push str._s___s_sIDMShellExtAA.dll_
jmp 0x40354b
push str._s___s_sIDMShellExt64.dll_
lea eax, [ebp - 0xb9c]
push eax
call edi
add esp, 0x10
cmp dword [0x41de60], ebx
mov byte [ebp + 0xb], bl
je 0x4035ed
push str.shell32
call dword [sym.imp.KERNEL32.dll_LoadLibraryW]
mov edi, eax
cmp edi, ebx
je 0x4035ed
push str.SHGetFolderPathW
push edi
call esi
mov esi, eax
cmp esi, ebx
je 0x4035e6
push ebx
call dword [sym.imp.ole32.dll_CoInitialize]
lea eax, [ebp - 0x270]
push eax
push ebx
push ebx
push 0x24
push ebx
call esi
test eax, eax
jne 0x4035e0
lea eax, [ebp - 0x270]
push eax
call sub.MSVCRT.dll_wcslen
cmp word [ebp + eax*2 - 0x272], 0x5c
pop ecx
je 0x4035c9
lea eax, [ebp - 0x270]
push 0x4150b8
push eax
call sub.MSVCRT.dll_wcscat
pop ecx
pop ecx
lea eax, [ebp - 0x270]
push str.Sysnative_regsvr32.exe
push eax
call sub.MSVCRT.dll_wcscat
pop ecx
mov byte [ebp + 0xb], 1
pop ecx
call dword [sym.imp.ole32.dll_CoUninitialize]
push edi
call dword [sym.imp.KERNEL32.dll_FreeLibrary]
push 0x3c
lea eax, [ebp - 0x68]
pop esi
push esi
push ebx
push eax
call sub.MSVCRT.dll_memset
add esp, 0xc
cmp byte [ebp + 0xb], bl
mov dword [ebp - 0x68], esi
mov dword [ebp - 0x64], 0x40
mov dword [ebp - 0x5c], str.open
je 0x40361f
lea eax, [ebp - 0x270]
mov dword [ebp - 0x58], eax
jmp 0x403626
mov dword [ebp - 0x58], str.regsvr32.exe
mov dword [ebp - 0x50], ebx
mov dword [ebp - 0x4c], 3
mov dword [ebp - 0x48], ebx
call dword [sym.imp.USER32.dll_GetForegroundWindow]
mov dword [ebp - 0x60], eax
lea eax, [ebp - 0xb9c]
mov dword [ebp - 0x54], eax
lea eax, [ebp - 0x68]
push eax
call dword [sym.imp.SHELL32.dll_ShellExecuteExW]
jmp 0x403695
lea eax, [ebp - 0x584]
push eax
lea eax, [ebp - 0x28]
push eax
lea eax, [ebp - 0x270]
push str._s_sIDMShellExt.dll
push eax
call edi
add esp, 0x10
lea eax, [ebp - 0x270]
push eax
call dword [sym.imp.KERNEL32.dll_LoadLibraryW]
mov edi, eax
cmp edi, ebx
je 0x403695
push str.DllRegisterServer
push edi
call esi
cmp eax, ebx
je 0x40368e
call eax
push edi
call dword [sym.imp.KERNEL32.dll_FreeLibrary]
call dword [sym.imp.ole32.dll_CoUninitialize]
pop edi
pop esi
pop ebx
leave
ret