Function at 0x5f1300
Capabilities:
Get keyboard layout

Disassembly:
push ebx
push esi
push edi
push ebp
add esp, 0xffffff60
mov ebx, eax
mov dword [ebx + 0x3dc], edx
mov eax, dword [ebx + 0x3dc]
test eax, eax
jl 0x5f1321
cmp eax, 5
jle 0x5f1329
xor eax, eax
mov dword [ebx + 0x3dc], eax
mov eax, dword [ebx + 0x3ec]
call fcn.00406e94
mov edi, eax
dec edi
test edi, edi
jl 0x5f1350
inc edi
xor esi, esi
mov eax, dword [ebx + 0x3ec]
mov eax, dword [eax + esi*4]
call fcn.00404748
inc esi
dec edi
jne 0x5f133e
push 0
lea eax, [ebx + 0x3ec]
mov ecx, 1
mov edx, dword [0x5f02f0]
call fcn.00407050
add esp, 4
mov eax, dword [ebx + 0x3dc]
cmp eax, 5
ja case.default.0x5f1376
jmp dword [eax*4 + 0x5f137d]
mov dl, 1
mov eax, dword [ebx + 0x374]
call fcn.00461d4c
jmp case.default.0x5f1376
mov dl, 1
mov eax, dword [ebx + 0x378]
call fcn.00461d4c
jmp case.default.0x5f1376
mov dl, 1
mov eax, dword [ebx + 0x37c]
call fcn.00461d4c
jmp case.default.0x5f1376
mov dl, 1
mov eax, dword [ebx + 0x3b8]
call fcn.00461d4c
jmp case.default.0x5f1376
mov dl, 1
mov eax, dword [ebx + 0x380]
call fcn.00461d4c
jmp case.default.0x5f1376
mov dl, 1
mov eax, dword [ebx + 0x3bc]
call fcn.00461d4c
mov eax, dword [ebx + 0x3dc]
mov edx, eax
sub edx, 1
je 0x5f13ff
sub edx, 3
jne 0x5f1408
mov dword [esp], 0x85
jmp 0x5f140f
mov dword [esp], 0x16
mov edx, eax
sub edx, 2
jae 0x5f1493
push 1
lea eax, [ebx + 0x3ec]
mov ecx, 1
mov edx, dword [0x5f02f0]
call fcn.00407050
add esp, 4
mov ecx, ebx
mov dl, 1
mov eax, dword [0x5f01d4]
call fcn.005f1df4
mov esi, eax
mov eax, dword [ebx + 0x3ec]
mov dword [eax], esi
mov dword [esi + 0x114], ebx
mov dword [esi + 0x110], 0x5f1a70
mov eax, dword [esp]
push eax
push 0x13
mov eax, dword [0x659f8c]
mov eax, dword [eax]
mov eax, dword [eax + 0x1bc]
push eax
mov eax, esi
xor ecx, ecx
xor edx, edx
call fcn.005f1ee0
mov edx, 0x13
mov eax, ebx
call fcn.0046ad74
mov edx, dword [esp]
mov eax, ebx
call fcn.0046ad40
jmp 0x5f1712
mov edx, eax
sub edx, 2
je 0x5f14a3
sub edx, 2
jne 0x5f15a2
lea eax, [esp + 0x28]
push eax
push 0x1e
call sub.user32.dll_GetKeyboardLayoutList
xor edx, edx
mov dword [esp + 8], eax
mov dword [esp + 0xc], edx
cmp dword [esp + 0xc], 0
jne 0x5f14c9
cmp dword [esp + 8], 0x63
jae 0x5f14dd
jmp 0x5f14cb
jge 0x5f14dd
mov eax, dword [esp + 8]
mov dword [esp + 0x10], eax
mov eax, dword [esp + 0xc]
mov dword [esp + 0x14], eax
jmp 0x5f14ed
mov dword [esp + 0x10], 0x63
mov dword [esp + 0x14], 0
mov eax, dword [esp + 0x10]
mov dword [esp + 4], eax
mov eax, dword [esp + 4]
push eax
lea eax, [ebx + 0x3ec]
mov ecx, 1
mov edx, dword [0x5f02f0]
call fcn.00407050
add esp, 4
mov edi, dword [esp + 4]
dec edi
test edi, edi
jl 0x5f1582
inc edi
xor esi, esi
lea ebp, [esp + 0x28]
mov ecx, ebx
mov dl, 1
mov eax, dword [0x5f01d4]
call fcn.005f1df4
mov edx, dword [ebx + 0x3ec]
mov dword [edx + esi*4], eax
mov eax, dword [ebx + 0x3ec]
mov eax, dword [eax + esi*4]
mov edx, dword [ebx + 0x3ec]
mov edx, dword [edx + esi*4]
mov dword [edx + 0x114], eax
mov dword [edx + 0x110], 0x5f2544
mov eax, dword [esp]
push eax
push 0x13
mov eax, dword [ebp]
push eax
imul ecx, esi, 0x13
sub ecx, esi
mov eax, dword [ebx + 0x3ec]
mov eax, dword [eax + esi*4]
xor edx, edx
call fcn.005f1ee0
inc esi
add ebp, 4
dec edi
jne 0x5f1523
imul edx, dword [esp + 4], 0x13
sub edx, dword [esp + 4]
inc edx
mov eax, ebx
call fcn.0046ad74
mov edx, dword [esp]
mov eax, ebx
call fcn.0046ad40
jmp 0x5f1712
cmp eax, 3
jne 0x5f16a9
lea eax, [esp + 0x28]
push eax
push 0x1e
call sub.user32.dll_GetKeyboardLayoutList
xor edx, edx
mov dword [esp + 0x18], eax
mov dword [esp + 0x1c], edx
cmp dword [esp + 0x1c], 0
jne 0x5f15d1
cmp dword [esp + 0x18], 0x63
jae 0x5f15e5
jmp 0x5f15d3
jge 0x5f15e5
mov eax, dword [esp + 0x18]
mov dword [esp + 0x20], eax
mov eax, dword [esp + 0x1c]
mov dword [esp + 0x24], eax
jmp 0x5f15f5
mov dword [esp + 0x20], 0x63
mov dword [esp + 0x24], 0
mov eax, dword [esp + 0x20]
mov dword [esp + 4], eax
mov eax, dword [esp + 4]
push eax
lea eax, [ebx + 0x3ec]
mov ecx, 1
mov edx, dword [0x5f02f0]
call fcn.00407050
add esp, 4
mov edi, dword [esp + 4]
dec edi
test edi, edi
jl 0x5f168a
inc edi
xor esi, esi
lea ebp, [esp + 0x28]
mov ecx, ebx
mov dl, 1
mov eax, dword [0x5f01d4]
call fcn.005f1df4
mov edx, dword [ebx + 0x3ec]
mov dword [edx + esi*4], eax
mov eax, dword [ebx + 0x3ec]
mov eax, dword [eax + esi*4]
mov edx, dword [ebx + 0x3ec]
mov edx, dword [edx + esi*4]
mov dword [edx + 0x114], eax
mov dword [edx + 0x110], 0x5f2544
mov eax, dword [esp]
push eax
push 0x13
mov eax, dword [ebp]
push eax
imul edx, esi, 0x16
sub edx, esi
mov eax, dword [ebx + 0x3ec]
mov eax, dword [eax + esi*4]
xor ecx, ecx
call fcn.005f1ee0
inc esi
add ebp, 4
dec edi
jne 0x5f162b
mov edx, 0x13
mov eax, ebx
call fcn.0046ad74
imul edx, dword [esp + 4], 0x16
sub edx, dword [esp + 4]
inc edx
mov eax, ebx
call fcn.0046ad40
jmp 0x5f1712
cmp eax, 5
jne 0x5f1712
push 1
lea eax, [ebx + 0x3ec]
mov ecx, 1
mov edx, dword [0x5f02f0]
call fcn.00407050
add esp, 4
mov ecx, ebx
mov dl, 1
mov eax, dword [0x5f01d4]
call fcn.005f1df4
mov esi, eax
mov eax, dword [ebx + 0x3ec]
mov dword [eax], esi
mov dword [esi + 0x114], ebx
mov dword [esi + 0x110], 0x5f1a70
mov eax, dword [ebx + 0x48]
push eax
mov eax, dword [ebx + 0x4c]
push eax
mov eax, dword [0x659f8c]
mov eax, dword [eax]
mov eax, dword [eax + 0x1bc]
push eax
mov eax, esi
xor ecx, ecx
xor edx, edx
call fcn.005f1ee0
mov eax, dword [0x659f8c]
mov eax, dword [eax]
mov edx, dword [eax + 0x1bc]
mov eax, ebx
call fcn.005f1210
add esp, 0xa0
pop ebp
pop edi
pop esi
pop ebx
ret