Function at 0x40af40
Capabilities:
Get keyboard layout

Disassembly:
push ebp
mov ebp, esp
and esp, 0xffffffc0
sub esp, 0x234
push ebx
mov ebx, dword [ebp + 0x10]
push esi
push edi
mov dword [esp + 0x30], 0
mov byte [esp + 0x2f], 0
test ebx, ebx
je 0x40af6c
lea eax, [ebx + 0x14]
mov dword [esp + 0x34], eax
jmp 0x40af74
lea ecx, [esp + 0x3b]
mov dword [esp + 0x34], ecx
cmp byte [ebp + 0xc], 0
mov esi, dword [ebp + 8]
jne 0x40afbb
mov edi, 0x4918e4
mov eax, esi
call fcn.00408bf0
mov edi, eax
test edi, edi
je 0x40afbb
mov ecx, edi
mov al, byte [ecx]
cmp al, 0x20
je 0x40af9b
cmp al, 9
jne 0x40af9e
inc ecx
jmp 0x40af91
push 0x4902c4
push ecx
call fcn.00476cb6
add esp, 8
test eax, eax
jne 0x40afbb
test ebx, ebx
je 0x40afb8
mov byte [ebx + 0x18], 1
mov byte [edi], 0
push 0
call dword [sym.imp.USER32.dll_GetKeyboardLayout]
mov dl, byte [esi]
test dl, dl
jne 0x40b02d
xor bl, bl
mov eax, esi
call fcn.00410e90
movzx eax, ax
mov dword [esp + 0x30], eax
test ax, ax
jne 0x40b220
mov esi, dword [ebp + 8]
push 1
lea ebx, [esp + 0x40]
mov eax, esi
call fcn.00445c20
movzx eax, ax
add esp, 4
mov dword [esp + 0x30], eax
test ax, ax
jne 0x40b204
cmp byte [ebp + 0x14], al
je 0x40b1cc
mov ecx, dword [0x4a13a4]
push 1
push 0
push 0xffffffffffffffff
push 0x491918
call fcn.004668b0
xor eax, eax
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
cmp byte [esi + 1], 0
jne 0x40b047
mov ecx, eax
lea esi, [esp + 0x2f]
mov al, dl
call fcn.00410ff0
mov esi, dword [ebp + 8]
mov bl, al
jmp 0x40b0b7
movzx edi, dl
test edi, 0xffffff80
jne 0x40b064
push 2
push edi
call fcn.0047814e
add esp, 8
test eax, eax
je 0x40b064
and edi, 0xffffffdf
mov eax, edi
cmp al, 0x56
jne 0x40b08a
mov al, byte [esi + 1]
call fcn.00408bc0
cmp al, 0x4b
jne 0x40b08a
push 0x10
lea edx, [esi + 2]
push 0
push edx
call fcn.00478594
add esp, 0xc
mov bl, al
jmp 0x40b0b7
xor edi, edi
lea esp, [esp]
mov eax, dword [edi*8 + 0x49e108]
push esi
push eax
call fcn.00476cb6
add esp, 8
test eax, eax
je 0x40b0b0
inc edi
cmp edi, 0x6d
jl 0x40b090
jmp 0x40afc9
mov bl, byte [edi*8 + 0x49e10c]
test bl, bl
je 0x40afcb
cmp byte [ebp + 0xc], 0
je 0x40b16c
lea eax, [ebx + 0x64]
cmp al, 3
ja 0x40b18d
cmp byte [ebp + 0x14], 0
je 0x40b0f9
mov ecx, dword [0x4a13a4]
push 1
push 0
push 0xffffffffffffffff
push 0x4918e8
call fcn.004668b0
xor eax, eax
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
push esi
push 0x4918ec
mov esi, 0x200
lea edi, [esp + 0x48]
call fcn.00463ff0
add esp, 8
cmp byte [0x4a30e4], 0
je 0x40b145
push 0x4918ac
mov eax, esi
mov ecx, edi
call fcn.00464030
add esp, 4
push 0x49588a
mov ecx, edi
push ecx
mov ecx, 0x4a2c18
call fcn.00429900
xor eax, eax
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
fldz
push 0
sub esp, 8
fstp qword [esp]
push 0
lea edx, [esp + 0x50]
push 0x10000
push edx
call fcn.00468330
add esp, 0x18
xor eax, eax
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov edi, dword [ebp + 0x10]
test edi, edi
je 0x40b190
push 2
push 0x491914
push esi
call fcn.00477695
add esp, 0xc
test eax, eax
sete al
mov byte [edi + 0x19], al
jmp 0x40b190
mov edi, dword [ebp + 0x10]
lea ecx, [ebx - 1]
cmp cl, 5
ja 0x40b19d
cmp bl, 3
jne 0x40b1a5
lea edx, [ebx + 0x66]
cmp dl, 5
ja 0x40b1a9
mov al, 1
jmp 0x40b1ab
xor al, al
mov dl, byte [esp + 0x2f]
test dl, 0x30
je 0x40b1bf
lea ecx, [ebx - 0x41]
cmp cl, 0x19
ja 0x40b1bf
and dl, 0xcf
test al, al
je 0x40b227
mov eax, dword [esp + 0x34]
mov byte [eax], 2
jmp 0x40b227
cmp dword [ebp + 0x10], 0
je 0x40b1fb
push esi
push 0x49191c
mov esi, 0x200
lea edi, [esp + 0x48]
call fcn.00463ff0
add esp, 8
push 0x49588a
mov edx, edi
push edx
mov ecx, 0x4a2c18
call fcn.00429900
xor eax, eax
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov ecx, dword [esp + 0x34]
mov ebx, dword [esp + 0x3c]
mov eax, 1
add dword [0x4a24a0], eax
mov byte [ecx], 4
mov byte [ebx + 0x4a2490], al
mov edi, dword [ebp + 0x10]
mov dl, byte [esp + 0x2f]
cmp byte [ebp + 0xc], 0
je 0x40b249
test edi, edi
je 0x40b286
mov cx, word [esp + 0x30]
mov byte [edi + 0x13], bl
mov word [edi + 0xa], cx
mov eax, 1
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
test edi, edi
je 0x40b286
mov ax, word [esp + 0x30]
mov word [edi + 8], ax
mov al, dl
and al, 0xd5
xor ecx, ecx
mov byte [edi + 0x12], bl
test al, 0xc0
je 0x40b268
mov ecx, 8
test al, 0xc
je 0x40b26f
or ecx, 1
test al, 0x30
je 0x40b276
or ecx, 4
test al, 3
je 0x40b27d
or ecx, 2
or dword [edi + 0xc], ecx
and dl, 0x2a
or byte [edi + 0x10], dl
pop edi
pop esi
mov eax, 1
pop ebx
mov esp, ebp
pop ebp
ret