Function at 0x412950
Capabilities:
Check if file exists
Query or enumerate registry value

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x420af0
mov eax, dword fs:[0]
push eax
sub esp, 0x1c
push ebx
push esi
push edi
mov eax, dword [0x42b014]
xor eax, ebp
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
call fcn.00411c60
mov ecx, eax
test ecx, ecx
jne 0x41298d
push 0x80004005
call fcn.00412060
mov eax, dword [ecx]
call dword [eax + 0xc]
lea esi, [eax + 0x10]
mov dword [ebp - 0x10], esi
mov dword [ebp - 4], 0
mov ecx, 1
mov eax, dword [esi - 8]
sub ecx, dword [esi - 4]
sub eax, 0x105
or eax, ecx
jge 0x4129c3
push 0x105
lea ecx, [ebp - 0x10]
call fcn.00409cf0
mov esi, dword [ebp - 0x10]
cmp dword [esi - 8], 0x105
jge 0x4129d6
push 0x80070057
call fcn.00412060
push 0x104
xor eax, eax
mov dword [esi - 0xc], 0x105
push esi
push eax
mov word [esi + 0x20a], ax
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
push dword [esi - 8]
push esi
call dword [sym.imp.api_ms_win_crt_string_l1_1_0.dll_wcsnlen]
add esp, 8
test eax, eax
js 0x4129cc
cmp eax, dword [esi - 8]
jg 0x4129cc
xor ecx, ecx
mov dword [esi - 0xc], eax
push 0x5c
push esi
mov word [esi + eax*2], cx
call dword [sym.imp.VCRUNTIME140.dll_wcsrchr]
add esp, 8
test eax, eax
jne 0x412a27
or eax, 0xffffffff
jmp 0x412a2b
sub eax, esi
sar eax, 1
inc eax
lea ecx, [ebp - 0x10]
push eax
lea eax, [ebp - 0x18]
push eax
call fcn.00414420
mov byte [ebp - 4], 1
add esi, 0xfffffff0
mov ecx, dword [eax]
or edi, 0xffffffff
lea edx, [ecx - 0x10]
cmp edx, esi
je 0x412a91
cmp dword [esi + 0xc], 0
lea ebx, [esi + 0xc]
jl 0x412a85
mov eax, dword [edx]
cmp eax, dword [esi]
jne 0x412a85
push edx
call fcn.00414970
add esp, 4
mov dword [ebp - 0x14], eax
mov ecx, edi
lock xadd dword [ebx], ecx
dec ecx
test ecx, ecx
jg 0x412a7d
mov ecx, dword [esi]
push esi
mov edx, dword [ecx]
call dword [edx + 4]
mov eax, dword [ebp - 0x14]
add eax, 0x10
mov dword [ebp - 0x10], eax
jmp 0x412a91
push dword [ecx - 0xc]
push ecx
lea ecx, [ebp - 0x10]
call fcn.004096f0
mov byte [ebp - 4], 0
mov eax, edi
mov edx, dword [ebp - 0x18]
add edx, 0xfffffff0
lock xadd dword [edx + 0xc], eax
dec eax
test eax, eax
jg 0x412aaf
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
push 0xd
push str.TAVConfig.ini
lea ecx, [ebp - 0x10]
call fcn.00414cb0
mov esi, dword [ebp - 0x10]
push esi
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
je 0x412ad0
mov bl, 1
jmp 0x412b45
push 0x20019
push 0x423ccc
push 0x80000002
lea ecx, [ebp - 0x28]
mov dword [ebp - 0x10], 0xffffffff
mov dword [ebp - 0x28], 0
mov dword [ebp - 0x24], 0
mov dword [ebp - 0x20], 0
call fcn.00411ef0
mov ebx, dword [ebp - 0x28]
test eax, eax
jne 0x412b2b
lea eax, [ebp - 0x18]
mov dword [ebp - 0x18], 4
push eax
lea eax, [ebp - 0x10]
push eax
lea eax, [ebp - 0x1c]
push eax
push 0
push 0x423cb8
push ebx
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExW]
mov eax, dword [ebp - 0x10]
mov dword [ebp - 0x14], eax
test ebx, ebx
je 0x412b3f
push ebx
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
mov eax, dword [ebp - 0x14]
cmp eax, 0xffffffff
setne bl
mov dword [ebp - 4], 0xffffffff
add esi, 0xfffffff0
lock xadd dword [esi + 0xc], edi
dec edi
test edi, edi
jg 0x412b61
mov ecx, dword [esi]
push esi
mov edx, dword [ecx]
call dword [edx + 4]
mov al, bl
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret