Function at 0x431500
Capabilities:
Get keyboard layout

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x46ee08
mov eax, dword fs:[0]
push eax
sub esp, 0x40
mov eax, dword [0x495574]
xor eax, ebp
mov dword [ebp - 0x10], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov edi, ecx
call fcn.00431330
test al, al
je 0x4316fd
call fcn.00437bed
mov ecx, eax
test ecx, ecx
je 0x43171b
mov eax, dword [ecx]
mov edx, dword [eax + 0xc]
cmp eax, 0x471758
jne 0x431725
lock inc dword [ecx + 0x14]
lea eax, [ecx + 8]
lea esi, [eax + 0x10]
mov dword [ebp - 0x28], esi
lea eax, [ebp - 0x24]
mov dword [ebp - 4], 0
push eax
call dword [sym.imp.USER32.dll_GetKeyboardLayoutNameW]
test eax, eax
je 0x4316bd
lea ecx, [ebp - 0x24]
lea edx, [ecx + 2]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x431585
sub ecx, edx
lea eax, [ebp - 0x24]
sar ecx, 1
push ecx
push eax
lea ecx, [ebp - 0x28]
call fcn.004041d0
mov esi, dword [ebp - 0x28]
lea edx, [ebp - 0x30]
mov ecx, esi
call fcn.0041b760
mov bl, al
mov dword [ebp - 4], 0xffffffff
add esi, 0xfffffff0
or ecx, 0xffffffff
lock xadd dword [esi + 0xc], ecx
dec ecx
test ecx, ecx
jg 0x4315f8
mov ecx, dword [esi]
push esi
mov eax, dword [ecx]
mov edx, dword [eax + 4]
cmp eax, 0x471758
jne 0x43172c
mov ecx, dword [ecx + 4]
mov eax, dword [ecx]
mov edx, dword [eax + 4]
cmp eax, vtable.ATL::CWin32Heap.0
jne 0x43172c
push 0
push dword [ecx + 4]
call dword [sym.imp.KERNEL32.dll_HeapFree]
test bl, bl
je 0x4316fd
lea ecx, [ebp - 0x4c]
call fcn.004145e0
mov dword [ebp - 4], 1
lea edx, [ebp - 0x4c]
push ecx
mov ecx, dword [ebp - 0x30]
call fcn.00416370
add esp, 4
test al, al
jne 0x431633
lea ecx, [ebp - 0x4c]
xor bl, bl
call fcn.004147f0
mov al, bl
jmp 0x4316ff
mov edx, edi
lea ecx, [ebp - 0x2c]
call fcn.0040df60
mov byte [ebp - 4], 2
mov eax, dword [ebp - 0x44]
test eax, eax
je 0x431733
push eax
push dword [ebp - 0x2c]
call fcn.004543bf
add esp, 8
mov byte [ebp - 4], 1
mov ecx, dword [ebp - 0x2c]
test eax, eax
sete bl
add ecx, 0xfffffff0
or eax, 0xffffffff
lock xadd dword [ecx + 0xc], eax
dec eax
test eax, eax
jg 0x4316b1
mov edx, dword [ecx]
push ecx
mov eax, dword [edx]
mov esi, dword [eax + 4]
cmp eax, 0x471758
jne 0x43173d
mov edx, dword [edx + 4]
mov eax, dword [edx]
mov esi, dword [eax + 4]
cmp eax, vtable.ATL::CWin32Heap.0
jne 0x43173d
push 0
push dword [edx + 4]
call dword [sym.imp.KERNEL32.dll_HeapFree]
lea ecx, [ebp - 0x4c]
call fcn.004147f0
mov al, bl
jmp 0x4316ff
lea ecx, [ebp - 0x4c]
call fcn.004147f0
mov al, bl
jmp 0x4316ff
mov dword [ebp - 4], 0xffffffff
add esi, 0xfffffff0
or eax, 0xffffffff
lock xadd dword [esi + 0xc], eax
dec eax
test eax, eax
jg 0x4316fd
mov ecx, dword [esi]
push esi
mov eax, dword [ecx]
mov edx, dword [eax + 4]
cmp eax, 0x471758
jne 0x431746
mov ecx, dword [ecx + 4]
mov eax, dword [ecx]
mov edx, dword [eax + 4]
cmp eax, vtable.ATL::CWin32Heap.0
jne 0x431746
push 0
push dword [ecx + 4]
call dword [sym.imp.KERNEL32.dll_HeapFree]
xor al, al
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.0044c2a6
mov esp, ebp
pop ebp
ret
push 0x80004005
call fcn.00404830
call edx
jmp 0x431560
call edx
jmp 0x4315f8
push 0x80004005
call fcn.00404830
mov ecx, edx
call esi
jmp 0x4316b1
call edx
jmp 0x4316fd