Function at 0x4051c0
Capabilities:
Get keyboard layout

Disassembly:
mov eax, dword fs:[0]
push 0xffffffffffffffff
push 0x52fdf3
push eax
mov dword fs:[0], esp
sub esp, 0x138
push ebp
push esi
mov esi, ecx
xor ebp, ebp
mov eax, dword [esi + 0x5c]
cmp eax, ebp
je 0x4057ed
push eax
call dword [sym.imp.USER32.dll_IsWindow]
test eax, eax
je 0x4057ed
push edi
lea edi, [esi + 0x40]
lea eax, [esp + 0xc]
push eax
mov ecx, edi
call fcn.00402460
lea ecx, [esp + 0x14]
mov dword [esp + 0x14c], ebp
push ecx
mov ecx, edi
call fcn.00402390
lea edx, [esp + 0x1c]
mov ecx, edi
push edx
mov byte [esp + 0x150], 1
call fcn.004021d0
lea eax, [esp + 0x24]
mov ecx, edi
push eax
mov byte [esp + 0x150], 2
call fcn.00402120
mov ecx, dword [esi + 0x8c]
mov byte [esp + 0x14c], 3
mov eax, dword [ecx + 0x20]
mov ecx, edi
push eax
call fcn.00402060
mov edx, dword [esi + 0x8c]
mov ecx, edi
mov eax, dword [edx + 0x1c]
push eax
call fcn.004020a0
mov eax, dword [esi + 0x8c]
mov ecx, edi
mov eax, dword [eax + 0x18]
push eax
call fcn.00402080
lea ecx, [esp + 0x2c]
push ecx
mov ecx, dword [esi + 0x8c]
call fcn.0043c860
mov eax, dword [eax]
lea ecx, [esp + 0xc]
push eax
mov byte [esp + 0x150], 4
call fcn.004027d0
lea ecx, [esp + 0x2c]
mov byte [esp + 0x14c], 3
call fcn.00511eeb
mov edx, dword [esi + 0x8c]
lea ecx, [esp + 0xc]
mov eax, dword [edx + 0x12c]
push eax
call fcn.004027a0
mov eax, dword [esi + 0x8c]
mov ecx, dword [eax + 0x120]
cmp ecx, 6
ja case.default.0x4052e1
jmp dword [ecx*4 + 0x405804]
mov dword [eax + 0x124], 0x280
mov ecx, dword [esi + 0x8c]
mov dword [ecx + 0x128], 0x1e0
jmp case.default.0x4052e1
mov dword [eax + 0x124], 0x320
mov edx, dword [esi + 0x8c]
mov dword [edx + 0x128], 0x258
jmp case.default.0x4052e1
mov dword [eax + 0x124], 0x400
mov eax, dword [esi + 0x8c]
mov dword [eax + 0x128], 0x300
jmp case.default.0x4052e1
mov dword [eax + 0x124], 0x480
mov ecx, dword [esi + 0x8c]
mov dword [ecx + 0x128], 0x360
jmp case.default.0x4052e1
mov dword [eax + 0x124], 0x500
mov edx, dword [esi + 0x8c]
mov dword [edx + 0x128], 0x400
jmp case.default.0x4052e1
mov dword [eax + 0x124], 0x640
mov eax, dword [esi + 0x8c]
mov dword [eax + 0x128], 0x4b0
jmp case.default.0x4052e1
mov edx, dword [esi + 0x1c]
lea ecx, [esp + 0x30]
push ecx
push edx
call dword [sym.imp.USER32.dll_GetClientRect]
mov eax, dword [esp + 0x38]
mov edx, dword [esp + 0x30]
sub eax, edx
cmp eax, 0xc8
jle 0x40542a
mov ecx, dword [esp + 0x3c]
mov edx, dword [esp + 0x34]
sub ecx, edx
cmp ecx, 0xc8
jle 0x40542a
mov edx, dword [esi + 0x8c]
mov dword [edx + 0x124], eax
mov eax, dword [esp + 0x3c]
mov ecx, dword [esp + 0x34]
mov edx, 0x4b0
sub eax, ecx
mov ecx, dword [esi + 0x8c]
mov dword [ecx + 0x128], eax
mov eax, dword [esi + 0x8c]
mov ecx, 0x640
cmp dword [eax + 0x124], ecx
jg 0x405416
cmp dword [eax + 0x128], edx
jle case.default.0x4052e1
mov dword [eax + 0x124], ecx
mov eax, dword [esi + 0x8c]
mov dword [eax + 0x128], edx
jmp case.default.0x4052e1
mov ecx, dword [esi + 0x8c]
push ebp
mov dword [ecx + 0x12c], ebp
lea ecx, [esp + 0x10]
call fcn.004027a0
mov edx, dword [esi + 0x8c]
mov dword [edx + 0x124], 0x280
mov eax, dword [esi + 0x8c]
mov dword [eax + 0x128], 0x1e0
mov ecx, dword [esi + 0x8c]
mov edx, dword [ecx + 0x124]
mov ecx, edi
push edx
call fcn.004020e0
mov eax, dword [esi + 0x8c]
mov ecx, dword [eax + 0x128]
push ecx
mov ecx, edi
call fcn.00402100
mov dword [0x5a1ec4], ebp
mov dword [0x5a1ec8], ebp
mov edx, dword [esi + 0x8c]
mov eax, dword [edx + 0x124]
mov dword [0x5a1ecc], eax
mov ecx, dword [esi + 0x8c]
mov edx, dword [ecx + 0x128]
mov dword [0x5a1ed0], edx
mov eax, dword [esi + 0x8c]
cmp dword [eax + 0x12c], ebp
jne 0x4054e7
mov ecx, dword [0x5a1db4]
push ebp
push 0xffffffffffffffff
push 0x403
mov edx, dword [ecx + 0x1c]
push edx
call dword [sym.imp.USER32.dll_SendMessageA]
mov eax, dword [esi + 0x1c]
push eax
call dword [sym.imp.USER32.dll_UpdateWindow]
mov eax, dword [esi + 0x8c]
mov ecx, dword [eax + 0x130]
add ecx, 0xfffffff8
cmp ecx, 0x10
ja case.0x405503.8
xor edx, edx
mov dl, byte [ecx + 0x405834]
jmp dword [edx*4 + 0x405820]
mov dword [eax + 0x130], 0xf
jmp 0x405538
mov dword [eax + 0x130], 0x10
jmp 0x405538
mov dword [eax + 0x130], 0x18
jmp 0x405538
mov dword [eax + 0x130], 8
mov eax, dword [esi + 0x8c]
mov ecx, dword [eax + 0x130]
push ecx
mov ecx, edi
call fcn.004022c0
mov edx, dword [esi + 0x8c]
lea ecx, [esp + 0x14]
mov eax, dword [edx + 0x134]
push eax
call fcn.004029e0
mov ecx, dword [esi + 0x8c]
mov edx, dword [ecx + 0x138]
lea ecx, [esp + 0x14]
push edx
call fcn.004029c0
mov eax, dword [esi + 0x8c]
mov ecx, dword [eax + 0x13c]
push ecx
lea ecx, [esp + 0x10]
call fcn.00402800
mov edx, dword [esi + 0x8c]
lea ecx, [esp + 0xc]
mov eax, dword [edx + 0x140]
push eax
call fcn.00402830
mov ecx, dword [esi + 0x8c]
mov edx, dword [ecx + 0x144]
lea ecx, [esp + 0xc]
push edx
call fcn.00402860
mov eax, dword [esi + 0x8c]
mov ecx, dword [eax + 0x148]
push ecx
lea ecx, [esp + 0x10]
call fcn.00402890
mov eax, dword [esi + 0x8c]
pop edi
cmp dword [eax + 0x14c], ebp
je 0x405631
mov eax, dword [eax + 0x150]
lea ecx, [esp + 0x10]
push eax
call fcn.00402980
mov edx, dword [esi + 0x8c]
lea ecx, [esp + 0x10]
mov eax, dword [edx + 0x154]
push eax
call fcn.004029a0
mov eax, dword [esi + 0x8c]
lea ecx, [esp + 0x20]
mov eax, dword [eax + 0x150]
push eax
call fcn.00403580
mov ecx, dword [esi + 0x8c]
mov eax, dword [ecx + 0x154]
lea ecx, [esp + 0x20]
push eax
call fcn.004035a0
mov edx, dword [esi + 0x8c]
lea ecx, [esp + 8]
mov eax, dword [edx + 0x15c]
push eax
call fcn.004028c0
mov ecx, dword [esi + 0x8c]
mov edx, dword [ecx + 0x160]
lea ecx, [esp + 8]
push edx
call fcn.004025e0
mov eax, dword [esi + 0x8c]
mov ecx, dword [eax + 0x160]
push ecx
lea ecx, [esp + 0x1c]
call fcn.004034a0
mov edx, dword [esi + 0x8c]
lea ecx, [esp + 8]
mov eax, dword [edx + 0x164]
push eax
call fcn.004025c0
mov ecx, dword [esi + 0x8c]
mov edx, dword [ecx + 0x164]
lea ecx, [esp + 0x18]
push edx
call fcn.00403480
mov eax, dword [esi + 0x8c]
mov ecx, dword [eax + 0x16c]
push ecx
lea ecx, [esp + 0xc]
call fcn.00402740
mov edx, dword [esi + 0x8c]
lea ecx, [esp + 8]
mov eax, dword [edx + 0x168]
push eax
call fcn.00402660
mov ecx, dword [esi + 0x8c]
mov edx, dword [ecx + 0x188]
lea ecx, [esp + 8]
push edx
call fcn.004028f0
mov eax, dword [esi + 0x8c]
mov ecx, dword [eax + 0x18c]
push ecx
lea ecx, [esp + 0xc]
call fcn.00402920
mov edx, dword [esi + 0x8c]
lea ecx, [esp + 8]
mov eax, dword [edx + 0x170]
push eax
call fcn.00402680
mov ecx, dword [esi + 0x8c]
mov edx, dword [ecx + 0x174]
lea ecx, [esp + 8]
push edx
call fcn.00402770
mov eax, dword [esi + 0x8c]
mov ecx, dword [eax + 0x178]
push ecx
lea ecx, [esp + 0xc]
call fcn.004026e0
mov edx, dword [esi + 0x8c]
lea ecx, [esp + 8]
mov eax, dword [edx + 0x17c]
push eax
call fcn.00402710
mov ecx, dword [esi + 0x8c]
mov edx, dword [ecx + 0x180]
lea ecx, [esp + 8]
push edx
call fcn.004026b0
lea eax, [esp + 0x3c]
push eax
call dword [sym.imp.USER32.dll_GetKeyboardLayoutNameA]
test eax, eax
je 0x405790
lea ecx, [esp + 0x3c]
push ecx
lea ecx, [esp + 0xc]
call fcn.00402600
lea edx, [esp + 0x3c]
lea ecx, [esp + 0x18]
push edx
call fcn.004034c0
push 1
lea ecx, [esp + 0xc]
call fcn.00402630
push 1
lea ecx, [esp + 0x1c]
call fcn.004034f0
lea ecx, [esp + 0x20]
mov byte [esp + 0x148], 2
call fcn.0052a779
lea ecx, [esp + 0x18]
mov byte [esp + 0x148], 1
call fcn.0052a779
lea ecx, [esp + 0x10]
mov byte [esp + 0x148], 0
call fcn.0052a779
lea ecx, [esp + 8]
mov dword [esp + 0x148], 0xffffffff
call fcn.0052a779
mov ecx, dword [esp + 0x140]
pop esi
pop ebp
mov dword fs:[0], ecx
add esp, 0x144
ret