Function at 0x10509ee
Capabilities:
Check mutex on windows
Query environment variable
Query or enumerate registry value
Set registry value

Disassembly:
mov eax, 0x10ce920
call fcn.01077868
sub esp, 0x90
mov eax, dword [0x10de03c]
push ebx
push esi
push edi
mov edi, ecx
mov dword [ebp - 0x10], eax
mov dword [ebp - 0x84], edi
call fcn.0102150d
mov ebx, eax
mov eax, dword [ebp + 8]
xor esi, esi
sub eax, esi
mov dword [ebp - 0x64], ebx
je 0x1050a56
dec eax
jne 0x1050d66
call fcn.01021518
push eax
push edi
call dword [sym.imp.msvcrt.dll_wcscpy]
mov esi, dword [sym.imp.msvcrt.dll_wcscat]
push 0x100a58c
push edi
call esi
push 0x1005a94
push edi
call esi
add esp, 0x18
jmp 0x1050d66
cmp dword [ebx + 0xbec], esi
je 0x1050a86
push 0x104
push edi
push 0x100a54c
mov word [edi], si
call dword [sym.imp.KERNEL32.dll_ExpandEnvironmentStringsW]
push edi
call fcn.010508af
mov word [ebx + 0xac4], 4
jmp 0x1050d66
call fcn.010508a4
push eax
push edi
call dword [sym.imp.msvcrt.dll_wcscpy]
cmp word [edi], si
pop ecx
pop ecx
jne 0x1050d66
mov ebx, dword [sym.imp.ADVAPI32.dll_RegCreateKeyExW]
lea eax, [ebp - 0x88]
push eax
lea eax, [ebp - 0x68]
push eax
push esi
push 0x2000000
push esi
push esi
push esi
push 0x100a0f8
mov edi, 0x80000001
push edi
call ebx
push dword [ebp - 0x68]
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
lea eax, [ebp - 0x88]
push eax
lea eax, [ebp - 0x68]
push eax
push esi
push 0x2000000
push esi
push esi
push esi
push 0x100a500
push edi
call ebx
cmp eax, esi
jne 0x1050d66
push 0x100a4d0
push esi
push esi
mov dword [ebp - 0x94], 0x28
call dword [sym.imp.KERNEL32.dll_CreateMutexW]
cmp eax, esi
mov dword [ebp - 0x8c], eax
je 0x1050b1f
push 0x2710
push eax
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
lea eax, [ebp - 0x94]
push eax
lea eax, [ebp - 0x60]
push eax
lea eax, [ebp - 0x98]
push eax
push esi
push 0x100a4b0
push dword [ebp - 0x68]
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExW]
test eax, eax
mov edi, dword [sym.imp.ADVAPI32.dll_RegSetValueExW]
je 0x1050b66
push 4
lea eax, [ebp - 0x7c]
push eax
push 4
push esi
push 0x100a4b0
push dword [ebp - 0x68]
mov dword [ebp - 0x7c], 0xa
call edi
jmp 0x1050b6c
mov eax, dword [ebp - 0x60]
mov dword [ebp - 0x7c], eax
cmp dword [ebp - 0x7c], esi
mov dword [ebp - 0x80], esi
mov dword [ebp - 0x70], esi
jle 0x1050c2e
lea ecx, [ebp - 0x74]
call sub.MFC42u.DLL_CString::CString_4
mov eax, dword [ebp - 0x70]
inc eax
push eax
mov dword [ebp - 0x78], eax
lea eax, [ebp - 0x74]
push 0x100a4a0
push eax
mov dword [ebp - 4], esi
call sub.MFC42u.DLL_CString::Format_1
add esp, 0xc
lea eax, [ebp - 0x88]
push eax
lea eax, [ebp - 0x6c]
push eax
push esi
push 0x2000000
push esi
push esi
push esi
push dword [ebp - 0x74]
push dword [ebp - 0x68]
call ebx
test eax, eax
jne 0x1050c05
lea eax, [ebp - 0x90]
push eax
lea eax, [ebp - 0x38]
push eax
lea eax, [ebp - 0x9c]
push eax
push esi
push 0x100a480
push dword [ebp - 0x6c]
mov dword [ebp - 0x90], 0x28
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExW]
test eax, eax
jne 0x1050c22
mov eax, dword [ebp - 0x80]
cmp eax, dword [ebp - 0x38]
jg 0x1050c22
push dword [ebp - 0x6c]
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
mov eax, dword [ebp - 0x38]
mov dword [ebp - 0x80], eax
or dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x74]
call sub.MFC42u.DLL_CString::CString
mov eax, dword [ebp - 0x78]
cmp eax, dword [ebp - 0x7c]
mov dword [ebp - 0x70], eax
jl 0x1050b7b
jmp 0x1050c2e
or dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x74]
call sub.MFC42u.DLL_CString::CString
mov eax, dword [ebp - 0x7c]
cmp dword [ebp - 0x70], eax
jne 0x1050c57
lea eax, [ebp - 0x88]
push eax
lea eax, [ebp - 0x6c]
push eax
push esi
push 0x2000000
push esi
push esi
push esi
push 0x100a474
push dword [ebp - 0x68]
call ebx
mov dword [ebp - 0x70], esi
lea eax, [ebp - 0x80]
push eax
call dword [sym.imp.msvcrt.dll_time]
mov ebx, dword [ebp - 0x64]
cmp word [ebx + 0x8bc], 2
pop ecx
jne 0x1050d36
push 4
lea eax, [ebp - 0x80]
push eax
push 4
push esi
push 0x100a480
push dword [ebp - 0x6c]
call edi
add ebx, 0x8b8
push ebx
lea ecx, [ebp - 0x64]
call sub.MFC42u.DLL_CString::CString_3
mov eax, dword [ebp - 0x64]
xor ebx, ebx
inc ebx
cmp dword [eax - 8], esi
mov dword [ebp - 4], ebx
jne 0x1050cb0
push 0x2779
lea ecx, [ebp - 0x64]
call sub.MFC42u.DLL_CString::LoadStringW
mov eax, dword [ebp - 0x64]
mov eax, dword [eax - 8]
add eax, eax
push eax
push esi
lea ecx, [ebp - 0x64]
call sub.MFC42u.DLL_CString::GetBuffer
push eax
push ebx
push esi
push 0x100a460
push dword [ebp - 0x6c]
call edi
call fcn.01021518
push eax
push dword [ebp - 0x84]
call dword [sym.imp.msvcrt.dll_wcscpy]
pop ecx
pop ecx
lea ecx, [ebp - 0x78]
call sub.MFC42u.DLL_CString::CString_4
mov eax, dword [ebp - 0x70]
inc eax
push eax
lea eax, [ebp - 0x78]
push 0x100a440
push eax
mov byte [ebp - 4], 2
call sub.MFC42u.DLL_CString::Format_1
push dword [ebp - 0x78]
push dword [ebp - 0x84]
call dword [sym.imp.msvcrt.dll_wcscat]
add esp, 0x14
push dword [ebp - 0x84]
call fcn.010508af
lea ecx, [ebp - 0x78]
mov byte [ebp - 4], bl
call sub.MFC42u.DLL_CString::CString
or dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x64]
call sub.MFC42u.DLL_CString::CString
push dword [ebp - 0x6c]
mov edi, dword [sym.imp.ADVAPI32.dll_RegCloseKey]
call edi
push dword [ebp - 0x68]
call edi
cmp dword [ebp - 0x8c], esi
je 0x1050d66
push dword [ebp - 0x8c]
call dword [sym.imp.KERNEL32.dll_ReleaseMutex]
push dword [ebp - 0x8c]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov ecx, dword [ebp - 0xc]
pop edi
pop esi
mov dword fs:[0], ecx
mov ecx, dword [ebp - 0x10]
pop ebx
call fcn.01075bbb
leave
ret 4