Function at 0x41f810
Capabilities:
Get keyboard layout

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x43719f
mov eax, dword fs:[0]
push eax
sub esp, 0x144
mov eax, dword [0x442308]
xor eax, ebp
mov dword [ebp - 0x64], eax
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov dword [ebp - 0x148], ecx
push 0x439058
lea ecx, [ebp - 0xf4]
call fcn.00401550
mov dword [ebp - 4], 0
lea eax, [ebp - 0xf4]
push eax
push reloc.OLEAUT32.dll_SysReAllocString
lea ecx, [ebp - 0x2c]
push ecx
call fcn.00404960
add esp, 0xc
mov byte [ebp - 4], 2
lea ecx, [ebp - 0xf4]
call fcn.00401080
lea edx, [ebp - 0x2c]
mov dword [ebp - 0x4c], edx
lea eax, [ebp - 0xfc]
push eax
mov ecx, dword [ebp - 0x4c]
call fcn.00401680
mov ecx, dword [eax]
mov edx, dword [eax + 4]
mov dword [ebp - 0x54], ecx
mov dword [ebp - 0x50], edx
lea eax, [ebp - 0x104]
push eax
mov ecx, dword [ebp - 0x4c]
call fcn.00401650
mov ecx, dword [eax]
mov edx, dword [eax + 4]
mov dword [ebp - 0x5c], ecx
mov dword [ebp - 0x58], edx
jmp 0x41f8c3
lea ecx, [ebp - 0x5c]
call fcn.00401ee0
lea eax, [ebp - 0x54]
push eax
lea ecx, [ebp - 0x5c]
call fcn.004016b0
movzx ecx, al
test ecx, ecx
je 0x41f9ae
lea ecx, [ebp - 0x5c]
call fcn.00401a10
mov dword [ebp - 0x60], eax
mov edx, dword [ebp - 0x60]
push edx
call fcn.004045d0
add esp, 4
mov dword [ebp - 0x84], eax
mov eax, dword [ebp - 0x60]
push eax
push 0x4390c0
lea ecx, [ebp - 0xa0]
push ecx
call fcn.00406730
add esp, 0xc
mov byte [ebp - 4], 3
push 0x4390bc
push str.Layout_Display_Name
lea ecx, [ebp - 0xa0]
call fcn.00401600
push eax
push reloc.OLEAUT32.dll_SysReAllocString
lea edx, [ebp - 0x80]
push edx
call fcn.00407340
mov byte [ebp - 4], 4
lea ecx, [ebp - 0x80]
call fcn.00403d20
movzx eax, al
test eax, eax
jne 0x41f98e
push 0x439150
lea ecx, [ebp - 0x80]
call fcn.00401600
push eax
call fcn.00407b30
test eax, eax
je 0x41f98e
mov ecx, dword [ebp - 0x84]
and ecx, 0xffff
movzx edx, cx
cmp edx, 0x804
je 0x41f98e
lea ecx, [ebp - 0xa0]
call fcn.00401600
push eax
push reloc.OLEAUT32.dll_SysReAllocString
call fcn.00407780
mov byte [ebp - 4], 3
lea ecx, [ebp - 0x80]
call fcn.00401080
mov byte [ebp - 4], 2
lea ecx, [ebp - 0xa0]
call fcn.00401080
jmp 0x41f8bb
mov byte [ebp - 0x45], 0
lea ecx, [ebp - 0x44]
call fcn.00410100
mov byte [ebp - 4], 5
push 0x804
push SysReAllocString
lea eax, [ebp - 0x11c]
push eax
call fcn.0040f0b0
add esp, 0xc
mov dword [ebp - 0x14c], eax
mov ecx, dword [ebp - 0x14c]
mov dword [ebp - 0x150], ecx
mov byte [ebp - 4], 6
mov edx, dword [ebp - 0x150]
push edx
lea ecx, [ebp - 0x44]
call fcn.004102d0
mov byte [ebp - 4], 5
lea ecx, [ebp - 0x11c]
call fcn.00410270
lea eax, [ebp - 0x14]
push eax
lea ecx, [ebp - 0x44]
call fcn.00421e90
lea ecx, [ebp - 0x124]
push ecx
lea ecx, [ebp - 0x44]
call fcn.00410490
push eax
lea ecx, [ebp - 0x14]
call fcn.00420eb0
movzx edx, al
test edx, edx
je 0x41faba
lea ecx, [ebp - 0x14]
call fcn.004203e0
cmp dword [eax], 0
je 0x41faa4
lea ecx, [ebp - 0x14]
call fcn.004203e0
mov eax, dword [eax]
and eax, 0xffff
movzx ecx, ax
cmp ecx, 0x804
je 0x41faa4
mov edx, dword [ebp - 0x14]
mov dword [ebp - 0x12c], edx
mov eax, dword [ebp - 0x10]
mov dword [ebp - 0x128], eax
mov ecx, dword [ebp - 0x128]
push ecx
mov edx, dword [ebp - 0x12c]
push edx
lea eax, [ebp - 0x134]
push eax
lea ecx, [ebp - 0x44]
call fcn.00410670
mov ecx, dword [eax]
mov edx, dword [eax + 4]
mov dword [ebp - 0x14], ecx
mov dword [ebp - 0x10], edx
mov byte [ebp - 0x45], 1
jmp 0x41fa17
push 0
lea eax, [ebp - 0x13c]
push eax
lea ecx, [ebp - 0x14]
call fcn.00412fb0
jmp 0x41fa17
movzx ecx, byte [ebp - 0x45]
test ecx, ecx
je 0x41fada
push 0x804
push 0x804
push 1
lea edx, [ebp - 0x44]
push edx
call fcn.0040cf10
add esp, 0x10
push 0
push 0
call dword [sym.imp.USER32.dll_GetKeyboardLayoutList]
mov dword [ebp - 0xa4], eax
cmp dword [ebp - 0xa4], 0
je 0x41fcde
push 0x443909
xor ecx, ecx
mov eax, dword [ebp - 0xa4]
mov edx, 4
mul edx
seto cl
neg ecx
or ecx, eax
push ecx
call fcn.004249de
add esp, 8
mov dword [ebp - 0x140], eax
mov eax, dword [ebp - 0x140]
mov dword [ebp - 0xb0], eax
mov ecx, dword [ebp - 0xb0]
push ecx
lea ecx, [ebp - 0xa8]
call fcn.004139a0
mov byte [ebp - 4], 7
mov edx, dword [ebp - 0xb0]
push edx
mov eax, dword [ebp - 0xa4]
push eax
call dword [sym.imp.USER32.dll_GetKeyboardLayoutList]
mov byte [ebp - 0xa9], 0
mov dword [ebp - 0xb4], 0
jmp 0x41fb79
mov ecx, dword [ebp - 0xb4]
add ecx, 1
mov dword [ebp - 0xb4], ecx
mov edx, dword [ebp - 0xb4]
cmp edx, dword [ebp - 0xa4]
jge 0x41fbb1
mov eax, dword [ebp - 0xb4]
mov ecx, dword [ebp - 0xb0]
mov edx, dword [ecx + eax*4]
and edx, 0xffff
movzx eax, dx
cmp eax, 0x409
jne 0x41fbaf
mov byte [ebp - 0xa9], 1
jmp 0x41fbb1
jmp 0x41fb6a
movzx ecx, byte [ebp - 0xa9]
test ecx, ecx
je 0x41fccf
mov byte [ebp - 0xcd], 0
push 0xffff
push SysReAllocString
lea edx, [ebp - 0xcc]
push edx
call fcn.0040f0b0
add esp, 0xc
mov byte [ebp - 4], 8
mov dword [ebp - 0xd4], 0
jmp 0x41fbff
mov eax, dword [ebp - 0xd4]
add eax, 1
mov dword [ebp - 0xd4], eax
lea ecx, [ebp - 0xcc]
call fcn.00410550
cmp dword [ebp - 0xd4], eax
jae 0x41fc51
mov ecx, dword [ebp - 0xd4]
push ecx
lea ecx, [ebp - 0xcc]
call fcn.00410590
cmp dword [eax], 0x4090409
je 0x41fc46
mov edx, dword [ebp - 0xd4]
push edx
lea ecx, [ebp - 0xcc]
call fcn.00410590
cmp dword [eax], 0x409
jne 0x41fc4f
mov byte [ebp - 0xcd], 1
jmp 0x41fc51
jmp 0x41fbf0
movzx eax, byte [ebp - 0xcd]
test eax, eax
jne 0x41fcc0
mov dword [ebp - 0xd8], 0
jmp 0x41fc77
mov ecx, dword [ebp - 0xd8]
add ecx, 1
mov dword [ebp - 0xd8], ecx
mov edx, dword [ebp - 0xd8]
cmp edx, dword [ebp - 0xa4]
jge 0x41fcc0
mov eax, dword [ebp - 0xd8]
mov ecx, dword [ebp - 0xb0]
cmp dword [ecx + eax*4], 0x4090409
je 0x41fcaf
mov edx, dword [ebp - 0xd8]
mov eax, dword [ebp - 0xb0]
cmp dword [eax + edx*4], 0x409
jne 0x41fcbe
mov ecx, dword [ebp - 0xb0]
mov edx, dword [ecx]
push edx
call dword [sym.imp.USER32.dll_UnloadKeyboardLayout]
jmp 0x41fc68
mov byte [ebp - 4], 7
lea ecx, [ebp - 0xcc]
call fcn.00410270
mov byte [ebp - 4], 5
lea ecx, [ebp - 0xa8]
call fcn.00413550
mov dword [ebp - 0x144], 0
mov byte [ebp - 4], 2
lea ecx, [ebp - 0x44]
call fcn.00410270
mov dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x2c]
call fcn.00405e70
mov eax, dword [ebp - 0x144]
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
mov ecx, dword [ebp - 0x64]
xor ecx, ebp
call fcn.0042364d
mov esp, ebp
pop ebp
ret