Function at 0x42f510
Capabilities:
Check if file exists
Get common file path
Get program files directory
Persist via windows service
Query or enumerate registry value
Set registry value

Disassembly:
push 0xffffffffffffffff
push 0x452e3b
mov eax, dword fs:[0]
push eax
sub esp, 0x430
mov eax, dword [0x48e050]
xor eax, esp
mov dword [esp + 0x42c], eax
push ebp
push esi
push edi
mov eax, dword [0x48e050]
xor eax, esp
push eax
lea eax, [esp + 0x440]
mov dword fs:[0], eax
push str.BCOM_SAFERUN_SUPPORTER
mov ecx, 0x4ad0c0
call fcn.0043d0f0
test eax, eax
jne 0x42f5bf
push str.Failed_to_Activate_SafeRun_Server
call fcn.00404c20
add esp, 4
push 0
push 0
push 0
mov dword [0x4adbc8], 0
call dword [sym.imp.KERNEL32.dll_CreateMutexW]
mov dword [0x4adbc8], eax
test eax, eax
jne 0x42f5cf
push str.CCommunication_Init:_Could_not_create_notify_mutex
call fcn.00404c20
add esp, 4
xor al, al
mov ecx, dword [esp + 0x440]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebp
mov ecx, dword [esp + 0x42c]
xor ecx, esp
call fcn.0043e4c7
add esp, 0x43c
ret
call fcn.004300d0
test eax, eax
jne 0x42f56a
push str.CCommunication_Init:_Could_not_get_funct_address
jmp 0x42f58e
push str.kernel32
call dword [sym.imp.KERNEL32.dll_GetModuleHandleW]
mov esi, eax
test esi, esi
je 0x42f596
mov edi, dword [sym.imp.KERNEL32.dll_GetProcAddress]
push str.Wow64DisableWow64FsRedirection
push esi
call edi
push str.Wow64RevertWow64FsRedirection
push esi
mov dword [0x4adbb4], eax
call edi
cmp dword [0x4adbb4], 0
mov dword [0x4adbb8], eax
je 0x42f596
test eax, eax
je 0x42f596
call fcn.00431020
test eax, eax
je 0x42f6ed
lea eax, [esp + 0x18]
push eax
mov dword [esp + 0x1c], 0
call dword [0x4adbb4]
test eax, eax
je 0x42f596
push 0x103
lea ecx, [esp + 0x30]
push ecx
mov esi, 1
call dword [sym.imp.KERNEL32.dll_GetSystemDirectoryW]
test eax, eax
je 0x42f6d3
push str.drivers_
lea edx, [esp + 0x30]
push 0x104
push edx
call fcn.0043f083
add esp, 0xc
lea eax, [esp + 0x2c]
push eax
lea ecx, [esp + 0x238]
push 0x104
push ecx
call fcn.0043efc3
add esp, 0xc
push str.BkavSRCore.sys
lea edx, [esp + 0x30]
push 0x104
push edx
call fcn.0043f083
add esp, 0xc
push str.BkavSRCore.inf
lea eax, [esp + 0x238]
push 0x104
push eax
call fcn.0043f083
mov edi, dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
add esp, 0xc
lea ecx, [esp + 0x2c]
push ecx
call edi
test eax, eax
je 0x42f6d3
lea edx, [esp + 0x234]
push edx
call edi
test eax, eax
jne 0x42f6d5
xor esi, esi
mov eax, dword [esp + 0x18]
push eax
call dword [0x4adbb8]
test esi, esi
jne 0x42f78e
jmp 0x42f596
push 0x103
lea ecx, [esp + 0x30]
push ecx
call dword [sym.imp.KERNEL32.dll_GetSystemDirectoryW]
test eax, eax
je 0x42f596
push str.drivers_
lea edx, [esp + 0x30]
push 0x104
push edx
call fcn.0043f083
add esp, 0xc
lea eax, [esp + 0x2c]
push eax
lea ecx, [esp + 0x238]
push 0x104
push ecx
call fcn.0043efc3
add esp, 0xc
push str.BkavSRCore.sys
lea edx, [esp + 0x30]
push 0x104
push edx
call fcn.0043f083
add esp, 0xc
push str.BkavSRCore.inf
lea eax, [esp + 0x238]
push 0x104
push eax
call fcn.0043f083
mov esi, dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
add esp, 0xc
lea ecx, [esp + 0x2c]
push ecx
call esi
test eax, eax
je 0x42f596
lea edx, [esp + 0x234]
push edx
call esi
test eax, eax
je 0x42f596
lea eax, [esp + 0x14]
push eax
push 1
push 0
push str.SOFTWAREBkav
push reloc.OLEAUT32.dll_SysReAllocString
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExW]
test eax, eax
jne 0x42f596
lea ecx, [esp + 0x20]
push ecx
push 0x4ad30c
lea edx, [esp + 0x30]
push edx
push eax
mov eax, dword [esp + 0x24]
push str.szBkavDir
push eax
mov dword [esp + 0x38], 0x228
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExW]
test eax, eax
je 0x42f7eb
mov ecx, dword [esp + 0x14]
push ecx
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
jmp 0x42f596
mov edx, dword [esp + 0x14]
mov ebp, dword [sym.imp.ADVAPI32.dll_RegCloseKey]
push edx
call ebp
lea eax, [esp + 0x24]
push eax
lea ecx, [esp + 0x18]
push ecx
push 0
push 0xf003f
push 0
push 0
push 0
push str.SYSTEMCurrentControlSet_servicesBkavSRCoreParameters
push reloc.OLEAUT32.dll_SysReAllocString
call dword [sym.imp.ADVAPI32.dll_RegCreateKeyExW]
test eax, eax
jne 0x42f596
mov eax, 0x4ad30c
lea edx, [eax + 2]
nop
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x42f830
mov esi, dword [sym.imp.ADVAPI32.dll_RegSetValueExW]
sub eax, edx
sar eax, 1
lea edx, [eax + eax + 2]
mov eax, dword [esp + 0x14]
push edx
push 0x4ad30c
push 1
push 0
push str.szBkavDir
push eax
call esi
mov edi, dword [sym.imp.SHELL32.dll_SHGetSpecialFolderPathW]
push 0
push 0x24
push 0x4ad534
push 0
call edi
test eax, eax
je 0x42f8a9
mov eax, 0x4ad534
lea edx, [eax + 2]
mov edi, edi
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x42f880
sub eax, edx
mov edx, dword [esp + 0x14]
sar eax, 1
lea ecx, [eax + eax + 2]
push ecx
push 0x4ad534
push 1
push 0
push str.szWindowsPath
push edx
call esi
push 0
push 0x26
push 0x4ad75c
push 0
call edi
test eax, eax
je 0x42f909
push str._x86_
push 0x4ad75c
call dword [sym.imp.SHLWAPI.dll_StrStrIW]
test eax, eax
je 0x42f8d4
xor ecx, ecx
mov word [eax - 2], cx
mov eax, 0x4ad75c
lea edx, [eax + 2]
lea esp, [esp]
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x42f8e0
sub eax, edx
sar eax, 1
lea edx, [eax + eax + 2]
mov eax, dword [esp + 0x14]
push edx
push 0x4ad75c
push 1
push 0
push str.szProgramFilePath
push eax
call esi
push 0
push 0x2a
push 0x4ad984
push 0
call edi
test eax, eax
je 0x42f94b
mov eax, 0x4ad984
lea edx, [eax + 2]
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x42f922
sub eax, edx
mov edx, dword [esp + 0x14]
sar eax, 1
lea ecx, [eax + eax + 2]
push ecx
push 0x4ad984
push 1
push 0
push str.szProgramFilePathX86
push edx
call esi
mov eax, dword [esp + 0x14]
push eax
call ebp
lea ecx, [esp + 0x1c]
push ecx
mov ecx, str.BkavSRCorePort
call fcn.004013e0
mov edi, 0x4ad304
mov dword [esp + 0x448], 0
call fcn.0042e780
lea ecx, [esp + 0x1c]
call fcn.004014d0
mov al, 1
jmp 0x42f598