Function at 0x10021d8
Capabilities:
Get keyboard layout

Disassembly:
sub esp, 0x250
push ebx
mov ebx, dword [0x10010b0]
push ebp
push esi
push edi
xor edi, edi
push edi
push edi
mov dword [esp + 0x24], edi
call ebx
mov bp, word [esp + 0x268]
mov dword [esp + 0x10], eax
mov eax, dword [0x1005158]
cmp eax, edi
je 0x1002489
cmp dword [0x1005188], edi
je 0x1002489
cmp bp, 1
je 0x1002270
cmp bp, 3
je 0x10031c8
mov esi, dword [eax + 4]
cmp esi, edi
je 0x100247c
mov ecx, dword [eax]
cmp ecx, edi
jle 0x100225d
mov edi, ecx
push dword [esi]
call dword [0x1001048]
push 0
push dword [0x1005188]
call dword [0x10011dc]
add esi, 4
dec edi
jne 0x100223a
mov eax, dword [0x1005158]
xor edi, edi
push eax
call dword [0x10011b4]
push dword [0x1005188]
call dword [0x10011bc]
cmp bp, 3
je 0x100247c
push edi
call dword [0x10011c0]
cmp eax, edi
mov dword [0x1005158], eax
je 0x100247c
mov esi, dword [0x10010d4]
push edi
push edi
push 1
push 0x32
call esi
push eax
push 0x31
call esi
push eax
call dword [0x10011b8]
cmp eax, edi
mov dword [0x1005188], eax
je 0x10031fd
mov eax, dword [esp + 0x10]
mov ebp, dword [0x1001038]
shl eax, 2
push eax
push 0x40
call ebp
mov esi, eax
push esi
mov dword [esp + 0x1c], esi
push dword [esp + 0x14]
call ebx
cmp dword [esp + 0x10], edi
mov dword [esp + 0x14], edi
jbe 0x1002427
mov edi, esi
mov eax, dword [edi]
xor esi, esi
mov ecx, eax
shr ecx, 0x10
and cx, 0xf000
cmp cx, 0xe000
jne 0x1002303
push esi
push esi
push eax
call fcn.010024ae
mov esi, eax
mov ebx, 0x100
lea eax, [esp + 0x60]
push ebx
push eax
movzx eax, word [edi]
push 2
push eax
call dword [0x1001040]
test eax, eax
je 0x100321a
mov eax, dword [edi]
shr eax, 0x10
cmp ax, word [edi]
je 0x1002350
lea eax, [esp + 0x60]
push eax
call dword [section..text]
lea eax, [esp + eax*2 + 0x60]
lea edx, [esp + 0x60]
mov ecx, eax
sub ecx, edx
sar ecx, 1
sub ebx, ecx
push ebx
push eax
push dword [edi]
call fcn.010024b4
test esi, esi
je 0x1003236
lea ebx, [esi + esi + 2]
lea eax, [ebx + 0x18]
push eax
push 0x40
call ebp
mov esi, eax
test esi, esi
je 0x100329b
shr ebx, 1
lea eax, [esi + 0x14]
push ebx
push eax
push dword [edi]
call fcn.010024ae
mov eax, dword [edi]
mov dword [esi], eax
shr eax, 0x10
and ax, 0xf000
cmp ax, 0xe000
jne 0x1003280
mov ax, word [esi]
cmp ax, 0x404
je 0x10023a4
cmp ax, 0x411
jne 0x1003267
push 1
pop eax
or dword [esi + 8], eax
mov dword [esp + 0x1c], eax
lea eax, [esp + 0x20]
push 0x20
push eax
push dword [esi]
call fcn.01002542
test eax, eax
je 0x1003280
lea eax, [esp + 0x20]
push 0
push eax
push dword [0x1005188]
call fcn.01002548
mov ebx, eax
push ebx
push 0xffffffffffffffff
push dword [0x1005188]
call dword [0x10011c4]
push ebx
mov dword [esi + 4], eax
call dword [0x10010b4]
push esi
push 0x7fff
push dword [0x1005158]
call dword [0x10011c8]
cmp eax, 0xffffffff
je 0x100329b
inc dword [esp + 0x14]
add edi, 4
mov eax, dword [esp + 0x14]
cmp eax, dword [esp + 0x10]
jb 0x10022e4
mov esi, dword [esp + 0x18]
xor edi, edi
cmp dword [esp + 0x1c], edi
je 0x100243d
push 0x10051a0
push dword [0x10051c8]
call fcn.0100258a
cmp esi, edi
je 0x100245c
mov eax, dword [esi]
mov ecx, eax
shr ecx, 0x10
and cx, 0xf000
cmp cx, 0xe000
jne 0x100245c
cmp dword [0x10051c4], edi
je 0x1002494
push esi
call dword [0x1001048]
cmp dword [esp + 0x10], 2
jae 0x1003295
push 2
push dword [esp + 0x268]
call fcn.01002680
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x250
ret 8
cmp bp, 1
jne 0x100247c
jmp 0x1002217
push edi
push eax
push dword [esp + 0x26c]
call fcn.01001eca
mov dword [0x10051c4], 1
jmp 0x100245c
cmp dword [0x10051c4], edi
je 0x10031e5
push 2
push edi
push dword [esp + 0x26c]
call fcn.01001eca
mov dword [0x10051c4], edi
push 2
push dword [esp + 0x268]
call fcn.01002680
mov eax, dword [0x1005158]
jmp 0x1002227
push dword [0x1005158]
call dword [0x10011b4]
mov dword [0x1005158], edi
mov dword [0x1005188], edi
jmp 0x100247c
lea eax, [esp + 0x60]
push ebx
push eax
push 0xc8
push dword [0x1005018]
call dword [0x10010fc]
jmp 0x1002322
lea eax, [esp + 0x60]
push eax
call dword [section..text]
lea eax, [eax + eax + 2]
add eax, 0x18
push eax
push 0x40
call ebp
mov esi, eax
test esi, esi
je 0x100329b
lea eax, [esp + 0x60]
push eax
lea eax, [esi + 0x14]
push eax
call dword [0x1001018]
jmp 0x100237c
cmp ax, 0x412
je 0x10023a4
cmp ax, 0x804
jne 0x10023ae
jmp 0x10023a4
mov ax, word [edi]
push eax
push dword [esp + 0x268]
call fcn.01002ffa
jmp 0x10023d6
push edi
jmp 0x1002470
push dword [esp + 0x18]
mov ebx, dword [0x1001048]
call ebx
mov eax, dword [0x1005158]
xor ebp, ebp
mov esi, dword [eax + 4]
cmp esi, ebp
je 0x100247c
mov ecx, dword [eax]
dec ecx
cmp ecx, ebp
jle 0x10032de
mov edi, ecx
push dword [esi]
call ebx
push ebp
push dword [0x1005188]
call dword [0x10011dc]
add esi, 4
dec edi
jne 0x10032c2
mov eax, dword [0x1005158]
push eax
call dword [0x10011b4]
push dword [0x1005188]
call dword [0x10011bc]
mov dword [0x1005158], ebp
mov dword [0x1005188], ebp
jmp 0x100246e