Function at 0x406f30
Capabilities:
Persist via windows service
Set registry value

Disassembly:
push esi
push str.S:UltraVNCwinvncwinvnc_videodriver.cpp_:_vncVideodriver____n
push 0
push 0x46f3bc
mov esi, ecx
call fcn.00405970
mov eax, dword [esi + 0x1c]
add esp, 0xc
test eax, eax
mov dword [esi + 8], 0
je 0x406f5c
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov ecx, esi
call fcn.00407190
mov ecx, esi
call fcn.00406cd0
test eax, eax
je 0x406f76
mov ecx, esi
pop esi
jmp 0x4075d0
pop esi
ret
sub esp, 0x364
push ebx
push ebp
push esi
push edi
xor ebx, ebx
push str.S:UltraVNCwinvncwinvnc_videodriver.cpp_:_DesActivate_video_driver____n
push ebx
push 0x46f3bc
mov dword [esp + 0x2c], ecx
mov dword [ecx + 0x20], 1
call fcn.00405970
mov ecx, 0x27
xor eax, eax
lea edi, [esp + 0x38]
add esp, 0xc
rep stosd dword es:[edi], eax
lea eax, [esp + 0x2c]
mov word [esp + 0x50], 0x9c
push eax
push 0xffffffffffffffff
push ebx
mov word [esp + 0x5e], bx
call dword [sym.imp.USER32.dll_EnumDisplaySettingsA]
push str.USER32
mov dword [esp + 0x58], 0x1c0000
call dword [sym.imp.KERNEL32.dll_LoadLibraryA]
mov edi, dword [sym.imp.KERNEL32.dll_GetProcAddress]
mov esi, eax
push str.EnumDisplayDevicesA
push esi
mov dword [esp + 0x2c], esi
call edi
push str.ChangeDisplaySettingsExA
push esi
mov ebp, eax
call edi
cmp eax, ebx
mov dword [esp + 0x1c], eax
je 0x40783f
cmp ebp, ebx
je 0x40783f
mov ecx, 0x6a
xor eax, eax
lea edi, [esp + 0xc8]
push ebx
rep stosd dword es:[edi], eax
lea ecx, [esp + 0xcc]
mov dword [esp + 0xcc], 0x1a8
push ecx
push ebx
push ebx
mov byte [esp + 0x3c], al
call ebp
cmp eax, ebx
je 0x40783f
mov edi, str.Winvnc_video_hook_driver
lea esi, [esp + 0xec]
mov ecx, 0x19
xor edx, edx
repe cmpsb byte [esi], byte es:[edi]
je 0x4076ce
lea eax, [esp + 0xc8]
inc ebx
push edx
push eax
push ebx
push edx
call ebp
test eax, eax
jne 0x40769a
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x364
ret
xor ebx, ebx
cmp eax, ebx
je 0x40783f
xor eax, eax
mov cl, byte [eax + str.DEVICE0]
mov byte [esp + eax + 0x270], cl
inc eax
test cl, cl
jne 0x4076da
mov esi, dword [sym.imp.ADVAPI32.dll_RegCreateKeyA]
lea ecx, [esp + 0x14]
push ecx
push str.SYSTEMCurrentControlSetHardware_ProfilesCurrentSystemCurrentControlSetServices_vncdrv
push reloc.WSOCK32.dll_bind
mov dword [esp + 0x20], ebx
call esi
test eax, eax
jne 0x40783f
mov ecx, dword [esp + 0x14]
lea edx, [esp + 0x10]
lea eax, [esp + 0x270]
push edx
push eax
push ecx
mov dword [esp + 0x1c], ebx
call esi
test eax, eax
jne 0x40783f
mov eax, dword [esp + 0x10]
lea edx, [esp + 0x28]
push 4
push edx
push 4
push ebx
push str.Attach.ToDesktop
push eax
mov dword [esp + 0x40], ebx
call dword [sym.imp.ADVAPI32.dll_RegSetValueExA]
test eax, eax
jne 0x40783f
mov cl, byte [eax + str.vncdrv]
mov byte [esp + eax + 0x2c], cl
inc eax
test cl, cl
jne 0x407755
call dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
push eax
call dword [sym.imp.USER32.dll_GetThreadDesktop]
mov ebp, eax
cmp ebp, ebx
je 0x4077a5
push 0x2000000
push ebx
push ebx
call dword [sym.imp.USER32.dll_OpenInputDesktop]
mov esi, eax
cmp esi, ebx
je 0x407793
push esi
call dword [sym.imp.USER32.dll_SetThreadDesktop]
jmp 0x4077a9
push 0x1f4
push 0x3e8
call dword [sym.imp.KERNEL32.dll_Beep]
jmp 0x4077a9
mov esi, dword [esp + 0x18]
mov edi, dword [esp + 0x20]
mov eax, dword [edi + 0x24]
mov dword [edi + 0xc], 1
cmp eax, ebx
jne 0x4077e9
push ebx
push 1
lea ecx, [esp + 0x34]
push ebx
mov ebx, dword [esp + 0x28]
lea edx, [esp + 0xd8]
push ecx
push edx
call ebx
push 0
push 0
lea eax, [esp + 0x34]
push 0
lea ecx, [esp + 0xd8]
push eax
push ecx
call ebx
xor ebx, ebx
mov eax, dword [esp + 0x24]
mov dword [edi + 0xc], ebx
cmp eax, ebx
je 0x4077fb
push eax
call dword [sym.imp.KERNEL32.dll_FreeLibrary]
push ebp
call dword [sym.imp.USER32.dll_SetThreadDesktop]
push esi
call dword [sym.imp.USER32.dll_CloseDesktop]
mov eax, dword [esp + 0x10]
lea edx, [esp + 0x18]
push 4
push edx
push 4
push ebx
push str.Attach.ToDesktop
push eax
mov dword [esp + 0x30], ebx
call dword [sym.imp.ADVAPI32.dll_RegSetValueExA]
test eax, eax
jne 0x40783f
mov ecx, dword [esp + 0x14]
mov esi, dword [sym.imp.ADVAPI32.dll_RegCloseKey]
push ecx
call esi
mov edx, dword [esp + 0x10]
push edx
call esi
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x364
ret