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

Disassembly:
push ebp
lea ebp, [esp - 0xbc0]
sub esp, 0xc40
mov eax, dword [0x4f2720]
xor eax, ebp
mov dword [ebp + 0xbbc], eax
push ebx
mov ebx, dword [sym.imp.ADVAPI32.dll_RegOpenKeyExW]
push esi
push edi
xor edi, edi
mov dword [ebp - 0x70], 0xe01f0804
mov dword [ebp - 0x6c], edi
mov esi, 0x100
add dword [ebp - 0x70], 0x10000
push dword [ebp - 0x70]
lea eax, [ebp + 0x99c]
push str.SystemCurrentControlSetControlKeyboard_Layouts_08X
push esi
push eax
call fcn.004609cc
add esp, 0x10
lea eax, [ebp - 0x68]
push eax
push 0x20019
push edi
lea eax, [ebp + 0x99c]
push eax
push reloc.OLEAUT32.dll_SysReAllocString
call ebx
test eax, eax
jne 0x40795e
lea eax, [ebp - 0x74]
push eax
lea eax, [ebp + 0x19c]
push eax
lea eax, [ebp - 0x7c]
push eax
push edi
push str.Ime_File
push dword [ebp - 0x68]
mov word [ebp + 0x19c], di
mov dword [ebp - 0x74], 0x200
mov dword [ebp - 0x7c], 1
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExW]
push dword [ebp - 0x68]
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
lea eax, [ebp + 0x19c]
push str.nmim.ime
push eax
call fcn.0046179d
test eax, eax
pop ecx
pop ecx
je 0x40796a
inc dword [ebp - 0x6c]
cmp dword [ebp - 0x6c], esi
jb 0x4078d0
lea eax, [ebp + 0x99c]
push eax
lea eax, [ebp - 0x64]
push esi
push eax
call fcn.00461622
add esp, 0xc
push dword [ebp - 0x70]
call dword [sym.imp.USER32.dll_UnloadKeyboardLayout]
push dword [ebp - 0x70]
lea eax, [ebp + 0x39c]
push str._08X
push esi
push eax
call fcn.004609cc
push str.Keyboard_LayoutPreload
lea eax, [ebp + 0x99c]
push esi
push eax
mov dword [ebp - 0x70], edi
call fcn.004609cc
add esp, 0x1c
lea eax, [ebp - 0x68]
push eax
push 0xf003f
push edi
lea eax, [ebp + 0x99c]
push eax
push reloc.WS2_32.dll_accept
call ebx
test eax, eax
jne 0x407b05
mov dword [ebp - 0x6c], edi
mov eax, dword [ebp - 0x6c]
inc eax
push eax
push 0x4c4cf4
mov dword [ebp - 0x78], eax
lea eax, [ebp + 0xb9c]
push 0x10
push eax
call fcn.004609cc
add esp, 0x10
lea eax, [ebp - 0x74]
push eax
lea eax, [ebp + 0x79c]
push eax
lea eax, [ebp - 0x7c]
push eax
push edi
lea eax, [ebp + 0xb9c]
push eax
push dword [ebp - 0x68]
mov word [ebp + 0x79c], di
mov dword [ebp - 0x74], 0x200
mov dword [ebp - 0x7c], 1
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExW]
test eax, eax
jne 0x407af6
lea eax, [ebp + 0x39c]
push eax
lea eax, [ebp + 0x79c]
push eax
call fcn.0046179d
test eax, eax
pop ecx
pop ecx
je 0x407ae3
lea eax, [ebp + 0x79c]
push eax
push str.SystemCurrentControlSetControlKeyboard_Layouts_s
lea eax, [ebp + 0x99c]
push esi
push eax
call fcn.004609cc
add esp, 0x10
lea eax, [ebp - 0x80]
push eax
push 0x20019
push edi
lea eax, [ebp + 0x99c]
push eax
push reloc.OLEAUT32.dll_SysReAllocString
call ebx
test eax, eax
jne 0x407ae3
push dword [ebp - 0x80]
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
cmp dword [ebp - 0x70], edi
je 0x407af6
lea eax, [ebp + 0xb9c]
push eax
push dword [ebp - 0x68]
call dword [sym.imp.ADVAPI32.dll_RegDeleteValueW]
mov eax, dword [ebp - 0x6c]
sub eax, dword [ebp - 0x70]
inc eax
push eax
push 0x4c4cf4
lea eax, [ebp + 0xb9c]
push 0x10
push eax
call fcn.004609cc
add esp, 0x10
push dword [ebp - 0x74]
lea eax, [ebp + 0x79c]
push eax
push dword [ebp - 0x7c]
lea eax, [ebp + 0xb9c]
push edi
push eax
push dword [ebp - 0x68]
call dword [sym.imp.ADVAPI32.dll_RegSetValueExW]
jmp 0x407af6
lea eax, [ebp + 0xb9c]
push eax
push dword [ebp - 0x68]
call dword [sym.imp.ADVAPI32.dll_RegDeleteValueW]
inc dword [ebp - 0x70]
mov eax, dword [ebp - 0x78]
cmp eax, 0x10
mov dword [ebp - 0x6c], eax
jb 0x4079d7
push str..DEFAULTKeyboard_LayoutPreload
lea eax, [ebp + 0x99c]
push esi
push eax
mov dword [ebp - 0x70], edi
call fcn.004609cc
add esp, 0xc
lea eax, [ebp - 0x68]
push eax
push 0xf003f
push edi
lea eax, [ebp + 0x99c]
push eax
push reloc.WS2_32.dll_closesocket
call ebx
test eax, eax
jne 0x407c6e
mov dword [ebp - 0x6c], edi
mov eax, dword [ebp - 0x6c]
inc eax
push eax
push 0x4c4cf4
mov dword [ebp - 0x78], eax
lea eax, [ebp + 0xb9c]
push 0x10
push eax
call fcn.004609cc
add esp, 0x10
lea eax, [ebp - 0x74]
push eax
lea eax, [ebp + 0x79c]
push eax
lea eax, [ebp - 0x7c]
push eax
push edi
lea eax, [ebp + 0xb9c]
push eax
push dword [ebp - 0x68]
mov word [ebp + 0x79c], di
mov dword [ebp - 0x74], 0x200
mov dword [ebp - 0x7c], 1
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExW]
test eax, eax
jne 0x407c5f
lea eax, [ebp + 0x39c]
push eax
lea eax, [ebp + 0x79c]
push eax
call fcn.0046179d
test eax, eax
pop ecx
pop ecx
je 0x407c4c
lea eax, [ebp + 0x79c]
push eax
push str.SystemCurrentControlSetControlKeyboard_Layouts_s
lea eax, [ebp + 0x99c]
push esi
push eax
call fcn.004609cc
add esp, 0x10
lea eax, [ebp - 0x80]
push eax
push 0x20019
push edi
lea eax, [ebp + 0x99c]
push eax
push reloc.OLEAUT32.dll_SysReAllocString
call ebx
test eax, eax
jne 0x407c4c
push dword [ebp - 0x80]
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
cmp dword [ebp - 0x70], edi
je 0x407c5f
lea eax, [ebp + 0xb9c]
push eax
push dword [ebp - 0x68]
call dword [sym.imp.ADVAPI32.dll_RegDeleteValueW]
mov eax, dword [ebp - 0x6c]
sub eax, dword [ebp - 0x70]
inc eax
push eax
push 0x4c4cf4
lea eax, [ebp + 0xb9c]
push 0x10
push eax
call fcn.004609cc
add esp, 0x10
push dword [ebp - 0x74]
lea eax, [ebp + 0x79c]
push eax
push dword [ebp - 0x7c]
lea eax, [ebp + 0xb9c]
push edi
push eax
push dword [ebp - 0x68]
call dword [sym.imp.ADVAPI32.dll_RegSetValueExW]
jmp 0x407c5f
lea eax, [ebp + 0xb9c]
push eax
push dword [ebp - 0x68]
call dword [sym.imp.ADVAPI32.dll_RegDeleteValueW]
inc dword [ebp - 0x70]
mov eax, dword [ebp - 0x78]
cmp eax, 0x10
mov dword [ebp - 0x6c], eax
jb 0x407b40
push str.Control_PanelInternationalUser_Profilezh_Hans_CN
lea eax, [ebp + 0x99c]
push esi
push eax
call fcn.004609cc
add esp, 0xc
lea eax, [ebp - 0x68]
push eax
push 0xf003f
push edi
lea eax, [ebp + 0x99c]
push eax
push reloc.WS2_32.dll_accept
call ebx
test eax, eax
jne 0x407d45
push edi
push edi
push edi
push edi
lea eax, [ebp - 0x74]
push eax
lea eax, [ebp + 0x59c]
push eax
mov dword [ebp - 0x6c], edi
push edi
jmp 0x407d2e
cmp eax, edi
jne 0x407d19
lea eax, [ebp + 0x59c]
push str.0804:
push eax
call fcn.00460605
cmp eax, edi
pop ecx
pop ecx
mov dword [ebp - 0x78], eax
je 0x407d19
lea ecx, [ebp + 0x59c]
sub eax, ecx
test eax, 0xfffffffe
jne 0x407d19
push str.0804:
call fcn.0045fe9a
mov ecx, dword [ebp - 0x78]
lea eax, [ecx + eax*2]
lea ecx, [ebp + 0x39c]
push ecx
push eax
call fcn.004615f0
add esp, 0xc
test eax, eax
jne 0x407d19
lea eax, [ebp + 0x59c]
push eax
push dword [ebp - 0x68]
call dword [sym.imp.ADVAPI32.dll_RegDeleteValueW]
inc dword [ebp - 0x6c]
push edi
push edi
push edi
push edi
lea eax, [ebp - 0x74]
push eax
lea eax, [ebp + 0x59c]
push eax
push dword [ebp - 0x6c]
push dword [ebp - 0x68]
mov dword [ebp - 0x74], esi
call dword [sym.imp.ADVAPI32.dll_RegEnumValueW]
cmp eax, 0x103
jne 0x407cb8
push str.Control_PanelInternationalUser_Profilezh_Hans
lea eax, [ebp + 0x99c]
push esi
push eax
call fcn.004609cc
add esp, 0xc
lea eax, [ebp - 0x68]
push eax
push 0xf003f
push edi
lea eax, [ebp + 0x99c]
push eax
push reloc.WS2_32.dll_accept
call ebx
test eax, eax
jne 0x407e1e
mov ebx, dword [sym.imp.ADVAPI32.dll_RegEnumValueW]
push edi
push edi
push edi
push edi
lea eax, [ebp - 0x74]
push eax
lea eax, [ebp + 0x59c]
push eax
mov dword [ebp - 0x6c], edi
push edi
jmp 0x407e0b
cmp eax, edi
jne 0x407df6
lea eax, [ebp + 0x59c]
push str.0804:
push eax
call fcn.00460605
cmp eax, edi
pop ecx
pop ecx
mov dword [ebp - 0x78], eax
je 0x407df6
lea ecx, [ebp + 0x59c]
sub eax, ecx
test eax, 0xfffffffe
jne 0x407df6
push str.0804:
call fcn.0045fe9a
mov ecx, dword [ebp - 0x78]
lea eax, [ecx + eax*2]
lea ecx, [ebp + 0x39c]
push ecx
push eax
call fcn.004615f0
add esp, 0xc
test eax, eax
jne 0x407df6
lea eax, [ebp + 0x59c]
push eax
push dword [ebp - 0x68]
call dword [sym.imp.ADVAPI32.dll_RegDeleteValueW]
inc dword [ebp - 0x6c]
push edi
push edi
push edi
push edi
lea eax, [ebp - 0x74]
push eax
lea eax, [ebp + 0x59c]
push eax
push dword [ebp - 0x6c]
push dword [ebp - 0x68]
mov dword [ebp - 0x74], esi
call ebx
cmp eax, 0x103
jne 0x407d95
push dword [ebp - 0x68]
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
lea eax, [ebp - 0x64]
push eax
push reloc.OLEAUT32.dll_SysReAllocString
call dword [sym.imp.ADVAPI32.dll_RegDeleteKeyW]
mov ecx, dword [ebp + 0xbbc]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.0045fa14
add ebp, 0xbc0
leave
ret