Function at 0x40159d
Capabilities:
Delete registry key
Delete registry value
Get installed programs
Query or enumerate registry key
Query or enumerate registry value

Disassembly:
mov eax, 0x40652c
call fcn.00406070
sub esp, 0x320
push ebx
push esi
push edi
lea ecx, [ebp - 0x20]
call sub.MFC42.DLL_CString::CString
lea eax, [ebp - 0x228]
xor edi, edi
push eax
mov dword [ebp - 4], edi
mov dword [ebp - 0x228], 0x94
call dword [sym.imp.KERNEL32.dll_GetVersionExA]
mov esi, dword [sym.imp.ADVAPI32.dll_RegOpenKeyExA]
lea eax, [ebp - 0x14]
mov ebx, 0xf003f
push eax
push ebx
push edi
push str.Software
push 0x80000002
call esi
test eax, eax
je 0x40160a
lea eax, [ebp - 0x10]
push 0x408a00
push eax
mov dword [ebp - 0x10], 1
call sub.MSVCRT.dll__CxxThrowException
push str.WinWB
push dword [ebp - 0x14]
call dword [sym.imp.ADVAPI32.dll_RegDeleteKeyA]
test eax, eax
je 0x401631
lea eax, [ebp - 0x10]
push 0x408a00
push eax
mov dword [ebp - 0x10], 3
call sub.MSVCRT.dll__CxxThrowException
push dword [ebp - 0x14]
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
lea eax, [ebp - 0x14]
push eax
push 0x20019
push edi
push str.SystemCurrentControlSetControlKeyboard_Layouts
push 0x80000002
call esi
test eax, eax
je 0x401669
lea eax, [ebp - 0x10]
push 0x408a00
push eax
mov dword [ebp - 0x10], 1
call sub.MSVCRT.dll__CxxThrowException
lea eax, [ebp - 0x194]
push 0x104
push eax
mov dword [ebp - 0x18], edi
push edi
push dword [ebp - 0x14]
call dword [sym.imp.ADVAPI32.dll_RegEnumKeyA]
test eax, eax
jne 0x40173c
push str.SystemCurrentControlSetControlKeyboard_Layouts_
lea ecx, [ebp - 0x20]
call fcn.00405d34
call sub.MFC42.DLL_AfxGetEmptyString
mov eax, dword [eax]
lea ecx, [ebp - 0x10]
mov dword [ebp - 0x10], eax
lea eax, [ebp - 0x194]
push eax
call fcn.00405d34
lea eax, [ebp - 0x10]
lea ecx, [ebp - 0x20]
push eax
mov byte [ebp - 4], 1
call sub.MFC42.DLL_CString::operator
and byte [ebp - 4], 0
lea ecx, [ebp - 0x10]
call fcn.00405d22
lea eax, [ebp - 0x24]
push eax
push ebx
push edi
push dword [ebp - 0x20]
push 0x80000002
call esi
test eax, eax
jne 0x401751
lea eax, [ebp - 0x1c]
mov dword [ebp - 0x1c], 0xc8
push eax
lea eax, [ebp - 0x90]
push eax
lea eax, [ebp - 0x2c]
push eax
push edi
push str.Layout_Text
push dword [ebp - 0x24]
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExA]
push dword [ebp - 0x24]
inc dword [ebp - 0x18]
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
lea eax, [ebp - 0x90]
push 0x40b094
push eax
call sub.MSVCRT.dll_strcmp
pop ecx
test eax, eax
pop ecx
je 0x401766
lea eax, [ebp - 0x194]
push 0x104
push eax
push dword [ebp - 0x18]
jmp 0x401679
lea eax, [ebp - 0x10]
push 0x408a00
push eax
mov dword [ebp - 0x10], 2
call sub.MSVCRT.dll__CxxThrowException
lea eax, [ebp - 0x10]
push 0x408a00
push eax
mov dword [ebp - 0x10], 1
call sub.MSVCRT.dll__CxxThrowException
lea eax, [ebp - 0x194]
push eax
push dword [ebp - 0x14]
call dword [sym.imp.ADVAPI32.dll_RegDeleteKeyA]
test eax, eax
je 0x40178f
lea eax, [ebp - 0x10]
push 0x408a00
push eax
mov dword [ebp - 0x10], 3
call sub.MSVCRT.dll__CxxThrowException
push dword [ebp - 0x14]
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
lea eax, [ebp - 0x194]
push eax
lea eax, [ebp - 0x32c]
push eax
call sub.MSVCRT.dll_strcpy
cmp dword [ebp - 0x218], 2
pop ecx
pop ecx
lea eax, [ebp - 0x14]
push eax
push ebx
push edi
push str.Keyboard_LayoutPreload
push 0x80000001
jne 0x4018a0
call esi
test eax, eax
je 0x4017e5
lea eax, [ebp - 0x10]
push 0x408a00
push eax
mov dword [ebp - 0x10], 1
call sub.MSVCRT.dll__CxxThrowException
push 0x64
lea eax, [ebp - 0x1c]
pop ebx
mov dword [ebp - 0x18], edi
push eax
lea eax, [ebp - 0x194]
push eax
lea eax, [ebp - 0x2c]
push eax
lea eax, [ebp - 0x28]
push edi
push eax
lea eax, [ebp - 0x90]
mov dword [ebp - 0x1c], ebx
push eax
push edi
push dword [ebp - 0x14]
mov dword [ebp - 0x28], ebx
call dword [sym.imp.ADVAPI32.dll_RegEnumValueA]
mov edi, 0x103
cmp eax, edi
je 0x401a0b
lea eax, [ebp - 0x194]
push eax
lea eax, [ebp - 0x32c]
push eax
call dword [sym.imp.MSVCRT.dll__stricmp]
pop ecx
test eax, eax
pop ecx
jne 0x401859
lea eax, [ebp - 0x90]
push eax
push dword [ebp - 0x14]
call dword [sym.imp.ADVAPI32.dll_RegDeleteValueA]
test eax, eax
jne 0x40188c
mov dword [ebp - 0x1c], ebx
mov dword [ebp - 0x28], ebx
jmp 0x401862
inc dword [ebp - 0x18]
mov dword [ebp - 0x1c], ebx
mov dword [ebp - 0x28], ebx
lea eax, [ebp - 0x1c]
push eax
lea eax, [ebp - 0x194]
push eax
lea eax, [ebp - 0x2c]
push eax
lea eax, [ebp - 0x28]
push 0
push eax
lea eax, [ebp - 0x90]
push eax
push dword [ebp - 0x18]
push dword [ebp - 0x14]
call dword [sym.imp.ADVAPI32.dll_RegEnumValueA]
jmp 0x40181b
mov dword [ebp - 0x10], 3
push 0x408a00
lea eax, [ebp - 0x10]
jmp 0x401a05
call esi
test eax, eax
je 0x4018bb
lea eax, [ebp - 0x10]
push 0x408a00
push eax
mov dword [ebp - 0x10], 1
call sub.MSVCRT.dll__CxxThrowException
push 0x64
lea eax, [ebp - 0x194]
pop ebx
mov dword [ebp - 0x18], edi
push 0x104
push eax
push edi
mov dword [ebp - 0x1c], ebx
push dword [ebp - 0x14]
call dword [sym.imp.ADVAPI32.dll_RegEnumKeyA]
mov edi, 0x103
cmp eax, edi
je 0x401a0b
push str.Keyboard_LayoutPreLoad_
lea ecx, [ebp - 0x20]
call fcn.00405d34
call sub.MFC42.DLL_AfxGetEmptyString
mov eax, dword [eax]
lea ecx, [ebp - 0x10]
mov dword [ebp - 0x10], eax
lea eax, [ebp - 0x194]
push eax
call fcn.00405d34
lea eax, [ebp - 0x10]
lea ecx, [ebp - 0x20]
push eax
mov byte [ebp - 4], 2
call sub.MFC42.DLL_CString::operator
and byte [ebp - 4], 0
lea ecx, [ebp - 0x10]
call fcn.00405d22
lea eax, [ebp - 0x24]
push eax
push 0xf003f
push 0
push dword [ebp - 0x20]
push 0x80000001
call esi
test eax, eax
jne 0x4019cc
lea eax, [ebp - 0x1c]
mov dword [ebp - 0x1c], 0xc8
push eax
lea eax, [ebp - 0x90]
push eax
lea eax, [ebp - 0x2c]
push eax
push 0
push 0x40b7d0
push dword [ebp - 0x24]
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExA]
test eax, eax
jne 0x4019e1
push dword [ebp - 0x24]
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
lea eax, [ebp - 0x90]
push eax
lea eax, [ebp - 0x32c]
push eax
call dword [sym.imp.MSVCRT.dll__stricmp]
pop ecx
test eax, eax
pop ecx
jne 0x4019a9
lea eax, [ebp - 0x194]
push eax
push dword [ebp - 0x14]
call dword [sym.imp.ADVAPI32.dll_RegDeleteKeyA]
test eax, eax
jne 0x4019f6
jmp 0x4019ac
inc dword [ebp - 0x18]
lea eax, [ebp - 0x194]
push 0x104
push eax
mov dword [ebp - 0x1c], ebx
push dword [ebp - 0x18]
push dword [ebp - 0x14]
call dword [sym.imp.ADVAPI32.dll_RegEnumKeyA]
jmp 0x4018df
lea eax, [ebp - 0x10]
push 0x408a00
push eax
mov dword [ebp - 0x10], 1
call sub.MSVCRT.dll__CxxThrowException
lea eax, [ebp - 0x10]
push 0x408a00
push eax
mov dword [ebp - 0x10], 2
call sub.MSVCRT.dll__CxxThrowException
mov dword [ebp - 0x10], 3
push 0x408a00
lea eax, [ebp - 0x10]
push eax
call sub.MSVCRT.dll__CxxThrowException
push dword [ebp - 0x14]
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
lea eax, [ebp - 0x14]
push eax
push 0xf003f
push 0
push str.SoftwareMicrosoftWindowsCurrentVersionUninstall
push 0x80000002
call esi
test eax, eax
je 0x401a44
lea eax, [ebp - 0x10]
push 0x408a00
push eax
mov dword [ebp - 0x10], 1
call sub.MSVCRT.dll__CxxThrowException
push str.WinWB
push dword [ebp - 0x14]
call dword [sym.imp.ADVAPI32.dll_RegDeleteKeyA]
test eax, eax
je 0x401a6b
lea eax, [ebp - 0x10]
push 0x408a00
push eax
mov dword [ebp - 0x10], 2
call sub.MSVCRT.dll__CxxThrowException
push dword [ebp - 0x14]
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
or dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x20]
call fcn.00405d22
mov ecx, dword [ebp - 0xc]
push 1
pop eax
pop edi
pop esi
pop ebx
mov dword fs:[0], ecx
leave
ret