Function at 0x401630
Capabilities:
Check os version
Set registry value

Disassembly:
sub esp, 0xd4
mov eax, dword [0x4250e0]
xor eax, esp
mov dword [esp + 0xd0], eax
cmp dword [0x4390ec], 4
jne 0x4018e1
mov eax, 3
cmp dword [0x43c848], eax
jl 0x4018e1
cmp dword [0x429d48], eax
jl 0x4018e1
cmp dword [0x439760], 5
jg 0x4018e1
push ebx
push esi
push edi
call dword [sym.imp.KERNEL32.dll_GetVersion]
mov esi, dword [0x429d48]
mov edi, dword [sym.imp.KERNEL32.dll_lstrcpyA]
mov dword [0x43ca0c], eax
lea eax, [esi + esi*4]
lea ebx, [eax*2 + 0x43c3b6]
push ebx
lea eax, [esp + 0x18]
push eax
call edi
cmp esi, 2
jle 0x4016bf
mov eax, ebx
lea ebx, [esi - 2]
lea esi, [eax - 0xa]
push esi
push eax
call edi
sub ebx, 1
mov eax, esi
jne 0x4016b1
push ebp
lea ecx, [esp + 0x18]
push ecx
push 0x43c3ca
call edi
test dword [0x43ca0c], 0x80000000
je 0x401791
mov ebp, dword [sym.imp.ADVAPI32.dll_RegOpenKeyExA]
lea edx, [esp + 0x10]
push edx
push 0x20019
push 0
push str.keyboard_layoutpreload
push 0x80000001
call ebp
test eax, eax
jne 0x4018dd
mov eax, 1
cmp dword [0x43c848], eax
jle 0x401781
mov ebx, dword [sym.imp.USER32.dll_wsprintfA]
mov edi, 0x43c3ca
lea ebx, [ebx]
lea esi, [eax + 1]
push esi
lea eax, [esp + 0x1c]
push 0x41c590
push eax
call ebx
mov eax, dword [esp + 0x1c]
add esp, 0xc
lea ecx, [esp + 0x14]
push ecx
push 0xf003f
push 0
lea edx, [esp + 0x24]
push edx
push eax
call ebp
test eax, eax
jne 0x401769
push edi
call dword [sym.imp.KERNEL32.dll_lstrlenA]
mov ecx, dword [esp + 0x14]
push eax
push edi
push 1
push 0
push 0
push ecx
call dword [sym.imp.ADVAPI32.dll_RegSetValueExA]
mov edx, dword [esp + 0x14]
push edx
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
mov eax, esi
add edi, 0xa
cmp eax, dword [0x43c848]
jl 0x401720
mov eax, dword [esp + 0x10]
push eax
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
jmp 0x4018dd
mov esi, dword [sym.imp.ADVAPI32.dll_RegOpenKeyExA]
lea ecx, [esp + 0x10]
push ecx
push 0x20019
push 0
push str.keyboard_layout
push 0x80000001
call esi
test eax, eax
jne 0x4018dd
lea edx, [esp + 0x14]
push edx
push 0xf003f
push eax
mov eax, dword [esp + 0x1c]
push str.preload
push eax
call esi
mov ebx, dword [sym.imp.USER32.dll_wsprintfA]
mov ebp, dword [sym.imp.ADVAPI32.dll_RegSetValueExA]
test eax, eax
jne 0x40182f
mov eax, 1
cmp dword [0x43c848], eax
jle 0x40182f
mov esi, 0x43c3ca
lea edi, [eax + 1]
push edi
lea ecx, [esp + 0x1c]
push 0x41c590
push ecx
call ebx
add esp, 0xc
push esi
call dword [sym.imp.KERNEL32.dll_lstrlenA]
push eax
mov eax, dword [esp + 0x18]
push esi
push 1
push 0
lea edx, [esp + 0x28]
push edx
push eax
call ebp
mov eax, edi
add esi, 0xa
cmp eax, dword [0x43c848]
jl 0x4017f0
mov esi, dword [sym.imp.ADVAPI32.dll_RegOpenKeyExA]
mov ecx, dword [esp + 0x14]
mov edi, dword [sym.imp.ADVAPI32.dll_RegCloseKey]
push ecx
call edi
mov edx, dword [esp + 0x10]
push edx
call edi
lea eax, [esp + 0x10]
push eax
push 0x20019
push 0
push str..DEFAULTkeyboard_layout
push 0x80000003
call esi
test eax, eax
jne 0x4018dd
mov edx, dword [esp + 0x10]
lea ecx, [esp + 0x14]
push ecx
push 0xf003f
push eax
push str.preload
push edx
call esi
test eax, eax
jne 0x4018cf
mov eax, 1
cmp dword [0x43c848], eax
jle 0x4018cf
mov esi, 0x43c3ca
lea esp, [esp]
lea edi, [eax + 1]
push edi
lea eax, [esp + 0x1c]
push 0x41c590
push eax
call ebx
add esp, 0xc
push esi
call dword [sym.imp.KERNEL32.dll_lstrlenA]
mov edx, dword [esp + 0x14]
push eax
push esi
push 1
push 0
lea ecx, [esp + 0x28]
push ecx
push edx
call ebp
mov eax, edi
add esi, 0xa
cmp eax, dword [0x43c848]
jl 0x401890
mov edi, dword [sym.imp.ADVAPI32.dll_RegCloseKey]
mov eax, dword [esp + 0x14]
push eax
call edi
mov ecx, dword [esp + 0x10]
push ecx
call edi
pop ebp
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0xd0]
xor ecx, esp
call fcn.0040a10d
add esp, 0xd4
ret