Function at 0x417840
Capabilities:
Get keyboard layout

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x46e03d
mov eax, dword fs:[0]
push eax
sub esp, 0x28
push ebx
push esi
push edi
mov eax, dword [0x495580]
xor eax, ebp
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov dword [ebp - 0x10], ecx
mov edi, dword [sym.imp.USER32.dll_GetKeyboardLayoutList]
push 0
push 0
call edi
mov esi, eax
mov dword [ebp - 0x30], 0
mov dword [ebp - 0x24], 0
mov dword [ebp - 0x28], 0
mov dword [ebp - 0x2c], 0
mov dword [ebp - 0x34], 0x479ae4
push ecx
push esi
lea ecx, [ebp - 0x34]
mov dword [ebp - 4], 0
call fcn.004065b0
mov eax, dword [ebp - 0x30]
push eax
push esi
mov dword [ebp - 0x14], eax
call edi
cmp eax, esi
je 0x4178c5
mov edi, dword [ebp - 0x14]
xor bl, bl
jmp 0x417aac
mov esi, dword [ebp - 0x10]
lea eax, [ebp - 0x34]
cmp esi, eax
je 0x417aa7
mov ebx, dword [ebp - 0x2c]
test ebx, ebx
js 0x417acd
mov ecx, dword [esi + 4]
jne 0x417905
test ecx, ecx
je 0x4178f7
push ecx
call fcn.00437038
add esp, 4
mov dword [esi + 4], 0
mov dword [esi + 0xc], 0
xor eax, eax
jmp 0x417a1f
test ecx, ecx
jne 0x41793b
mov edi, dword [esi + 0x10]
cmp ebx, edi
cmovg edi, ebx
lea esi, [edi*4]
push esi
call fcn.00437bff
mov ecx, dword [ebp - 0x10]
push esi
push 0
push eax
mov dword [ecx + 4], eax
call fcn.0044cff0
mov esi, dword [ebp - 0x10]
add esp, 0x10
mov dword [esi + 0xc], edi
jmp 0x417a1d
mov edi, dword [esi + 0xc]
cmp ebx, edi
jg 0x417968
mov edx, dword [esi + 8]
cmp ebx, edx
jle 0x417a1d
mov eax, ebx
sub eax, edx
shl eax, 2
push eax
lea eax, [ecx + edx*4]
push 0
push eax
call fcn.0044cff0
add esp, 0xc
jmp 0x417a1d
mov eax, dword [esi + 0x10]
test eax, eax
jne 0x417991
mov eax, dword [esi + 8]
cdq
and edx, 7
add eax, edx
sar eax, 3
cmp eax, 4
jge 0x417987
mov eax, 4
jmp 0x417991
mov ecx, 0x400
cmp eax, ecx
cmovg eax, ecx
add eax, edi
mov ecx, ebx
cmp ebx, eax
cmovl ecx, eax
mov dword [ebp - 0x20], ecx
cmp ecx, edi
jl 0x417acd
lea eax, [ecx*4]
push eax
mov dword [ebp - 0x10], eax
call fcn.00437bff
mov edi, dword [esi + 8]
add esp, 4
mov edx, dword [esi + 4]
mov ecx, eax
shl edi, 2
mov dword [ebp - 0x1c], ecx
mov dword [ebp - 0x18], edx
test edi, edi
jne 0x4179d1
xor eax, eax
jmp 0x4179ea
test ecx, ecx
jne 0x417a51
call fcn.004542cd
mov dword [eax], 0x16
call fcn.004541cf
mov eax, 0x16
push eax
call fcn.00403a40
mov ecx, dword [esi + 8]
mov eax, ebx
mov edi, dword [ebp - 0x1c]
sub eax, ecx
shl eax, 2
push eax
push 0
lea eax, [edi + ecx*4]
push eax
call fcn.0044cff0
push dword [esi + 4]
call fcn.00437038
mov eax, dword [ebp - 0x20]
add esp, 0x14
mov dword [esi + 4], edi
mov dword [esi + 0xc], eax
mov eax, ebx
mov dword [esi + 8], eax
mov edi, dword [ebp - 0x14]
mov ecx, edi
mov edx, dword [esi + 4]
test ebx, ebx
je 0x417aaa
test edx, edx
je 0x417acd
test ecx, ecx
je 0x417acd
nop
mov eax, dword [ecx]
lea ecx, [ecx + 4]
mov dword [edx], eax
lea edx, [edx + 4]
sub ebx, 1
jne 0x417a40
jmp 0x417aaa
mov eax, dword [ebp - 0x10]
test edx, edx
je 0x417a6e
cmp eax, edi
jb 0x417a6e
push edi
push edx
push ecx
call fcn.0044ca70
add esp, 0xc
xor eax, eax
jmp 0x4179ea
push eax
push 0
push ecx
call fcn.0044cff0
add esp, 0xc
cmp dword [ebp - 0x18], 0
je 0x4179d5
cmp dword [ebp - 0x10], edi
jae 0x4179e5
call fcn.004542cd
mov dword [eax], 0x22
call fcn.004541cf
mov eax, 0x22
jmp 0x4179ea
mov edi, dword [ebp - 0x14]
mov bl, 1
test edi, edi
je 0x417ab9
push edi
call fcn.00437038
add esp, 4
mov al, bl
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
call fcn.00436600
int3