Function at 0x406d80
Capabilities:
Delete registry key
Query or enumerate registry value
Set registry value

Disassembly:
sub esp, 0x764
mov eax, dword [0x545628]
xor eax, esp
mov dword [esp + 0x760], eax
mov eax, dword [esp + 0x768]
push esi
mov esi, dword [sym.imp.ADVAPI32.dll_RegOpenKeyExW]
push edi
lea ecx, [esp + 8]
push ecx
xor edi, edi
push 0xf003f
push edi
push str.Keyboard_Layout
push SysReAllocString
mov dword [esp + 0x34], eax
mov dword [esp + 0x24], edi
mov dword [esp + 0x1c], edi
mov dword [esp + 0x20], edi
call esi
test eax, eax
jne 0x406df6
mov eax, dword [esp + 8]
lea edx, [esp + 0xc]
push edx
push 0xf003f
push edi
push str.preload
push eax
call esi
test eax, eax
je 0x406e0f
mov ecx, dword [esp + 8]
push ecx
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
pop edi
xor al, al
pop esi
mov ecx, dword [esp + 0x760]
xor ecx, esp
call fcn.004d158d
add esp, 0x764
ret
lea eax, [esp + 0x60]
mov ecx, 0x64
xor edx, edx
mov word [eax], dx
add eax, 0x12
sub ecx, 1
jne 0x406e18
push ebx
push ebp
mov ebp, dword [sym.imp.ADVAPI32.dll_RegEnumValueW]
xor ebx, ebx
xor esi, esi
lea eax, [esp + 0x20]
push eax
lea ecx, [esp + 0x30]
push ecx
lea edx, [esp + 0x2c]
push edx
mov edx, dword [esp + 0x20]
push edi
lea eax, [esp + 0x2c]
push eax
lea ecx, [esp + 0x54]
push ecx
push esi
push edx
mov dword [esp + 0x44], edi
mov dword [esp + 0x3c], 0xa
mov dword [esp + 0x40], 0x12
call ebp
test eax, eax
jne 0x406ea1
push 0xa
lea eax, [esp + 0x44]
push edi
push eax
call fcn.004d30d6
lea ecx, [eax - 1]
add esp, 0xc
cmp ecx, 0x62
ja 0x406e9b
lea edx, [esp + 0x2c]
push edx
lea eax, [eax + eax*8]
lea ecx, [esp + eax*2 + 0x5a]
push 9
push ecx
call fcn.004d2c76
add esp, 0xc
inc ebx
inc esi
cmp esi, 0x64
jl 0x406e31
mov edx, dword [esp + 0x28]
push edx
lea eax, [esp + 0x30]
push str._08X
push eax
call fcn.0040b640
add esp, 0xc
xor esi, esi
cmp ebx, edi
jle 0x406edc
lea edi, [esp + 0x68]
lea ecx, [esp + 0x2c]
push ecx
push edi
call fcn.004d1734
add esp, 8
test eax, eax
je 0x406edc
inc esi
add edi, 0x12
cmp esi, ebx
jl 0x406ec2
cmp esi, ebx
jne 0x406ef8
lea edx, [esp + 0x2c]
push edx
lea eax, [ebx + ebx*8]
lea ecx, [esp + eax*2 + 0x6c]
push 9
push ecx
call fcn.004d2c76
add esp, 0xc
inc ebx
lea edi, [esp + 0x68]
mov ebp, 2
push 0x10
push 0
push edi
call fcn.004d30d6
add esp, 0xc
cmp eax, 0x10000
jge 0x406f19
inc dword [esp + 0x18]
add edi, 0x12
sub ebp, 1
jne 0x406f01
mov eax, dword [esp + 0x18]
cmp esi, eax
je 0x406f68
cmp eax, ebx
jge 0x406f68
lea edi, [eax + eax*8]
lea edi, [esp + edi*2 + 0x68]
push edi
lea edx, [esp + 0x58]
push 9
push edx
call fcn.004d2c76
lea eax, [esp + 0x38]
push eax
push 9
push edi
call fcn.004d2c76
lea ecx, [esp + 0x6c]
push ecx
lea edx, [esi + esi*8]
lea eax, [esp + edx*2 + 0x84]
push 9
push eax
call fcn.004d2c76
add esp, 0x24
mov ecx, dword [esp + 0x14]
mov edi, dword [sym.imp.ADVAPI32.dll_RegCloseKey]
push ecx
call edi
lea esi, [ebx - 1]
test esi, esi
jl 0x406fa3
mov ebp, dword [sym.imp.USER32.dll_LoadKeyboardLayoutW]
lea edi, [esi + esi*8]
lea edi, [esp + edi*2 + 0x68]
lea esp, [esp]
push 9
push edi
call ebp
dec esi
sub edi, 0x12
test esi, esi
jge 0x406f90
mov edi, dword [sym.imp.ADVAPI32.dll_RegCloseKey]
mov edx, dword [esp + 0x10]
push str.preload
push edx
call dword [sym.imp.ADVAPI32.dll_RegDeleteKeyW]
mov ecx, dword [esp + 0x10]
push 0
lea eax, [esp + 0x18]
push eax
push 0
push 0xf003f
push 0
push 0
push 0
push str.Preload
push ecx
call dword [sym.imp.ADVAPI32.dll_RegCreateKeyExW]
test eax, eax
je 0x406fe6
mov edx, dword [esp + 0x10]
push edx
call edi
xor al, al
jmp 0x40703d
xor eax, eax
test ebx, ebx
jle 0x40702d
mov ebp, dword [sym.imp.ADVAPI32.dll_RegSetValueExW]
lea edi, [esp + 0x68]
lea esi, [eax + 1]
push esi
push 0x51a920
lea edx, [esp + 0x48]
call fcn.0040b660
mov ecx, dword [esp + 0x1c]
add esp, 8
push 0x10
push edi
push 1
push 0
lea eax, [esp + 0x50]
push eax
push ecx
call ebp
mov eax, esi
add edi, 0x12
cmp eax, ebx
jl 0x406ff6
mov edi, dword [sym.imp.ADVAPI32.dll_RegCloseKey]
mov edx, dword [esp + 0x14]
push edx
call edi
mov eax, dword [esp + 0x10]
push eax
call edi
mov al, 1
mov ecx, dword [esp + 0x770]
pop ebp
pop ebx
pop edi
pop esi
xor ecx, esp
call fcn.004d158d
add esp, 0x764
ret