Function at 0x10081690
Capabilities:
Get keyboard layout
Log keystrokes via polling

Disassembly:
push ebp
mov ebp, esp
mov eax, dword [ecx + 0xb0]
sub esp, 0xe0
test eax, eax
je 0x10081a06
push edi
push 0
push eax
call dword [sym.imp.USER32.dll_GetWindowThreadProcessId]
mov edi, eax
mov dword [ebp - 0x10], 0
mov eax, dword [ebp + 8]
mov dword [ebp - 0x20], edi
cmp word [eax], 0
je 0x10081a05
push esi
mov esi, dword [sym.imp.USER32.dll_GetKeyboardLayout]
push ebx
cmp dword [ebp - 0x10], 0x800
jge 0x10081a03
push 0xa8
lea eax, [ebp - 0xe0]
push 0
push eax
call fcn.100a7070
xor eax, eax
mov dword [ebp - 0x24], 0
add esp, 0xc
mov byte [ebp - 5], 0
mov dword [ebp - 0x18], eax
xor ebx, ebx
mov word [ebp - 0x14], ax
mov dword [ebp - 0xc], eax
mov word [ebp - 0x34], ax
call dword [sym.imp.USER32.dll_GetMessageExtraInfo]
mov ecx, dword [ebp + 8]
mov dword [ebp - 0x1c], eax
mov eax, dword [ebp - 0x10]
lea eax, [ecx + eax*2]
lea ecx, [ebp - 5]
mov dword [ebp - 4], eax
push ecx
lea ecx, [ebp - 0x24]
push ecx
push eax
call fcn.10098d10
mov ecx, dword [ebp - 4]
add esp, 0xc
mov dword [ebp - 0x38], eax
movzx ecx, word [ecx]
push edi
cmp ecx, 1
jne 0x10081765
mov eax, 0xd
mov word [ebp - 0x34], ax
call esi
push eax
push ebx
push 0xd
call dword [sym.imp.USER32.dll_MapVirtualKeyExW]
mov word [ebp - 0x32], ax
jmp 0x100817f6
cmp ecx, 2
jne 0x10081786
mov eax, 8
mov word [ebp - 0x34], ax
call esi
push eax
push 0
push 8
call dword [sym.imp.USER32.dll_MapVirtualKeyExW]
mov word [ebp - 0x32], ax
jmp 0x100817f6
mov dword [ebp - 0xc], 8
call esi
push eax
mov eax, dword [ebp - 4]
movzx eax, word [eax]
push eax
call dword [sym.imp.USER32.dll_VkKeyScanExW]
movsx esi, ax
mov ebx, esi
shr ebx, 8
push edi
mov dword [ebp - 4], ebx
call dword [sym.imp.USER32.dll_GetKeyboardLayout]
push eax
push 0
movzx eax, si
push eax
call dword [sym.imp.USER32.dll_MapVirtualKeyExW]
mov cl, bl
mov word [ebp - 0x32], ax
and cl, 1
je 0x100817d0
mov edx, 0x10
mov word [ebp - 0x18], dx
movzx ebx, cl
mov ecx, dword [ebp - 4]
test cl, 2
je 0x100817e6
mov edx, 0x11
mov word [ebp + ebx*2 - 0x18], dx
inc ebx
test cl, 4
je 0x100817f6
mov ecx, 0x12
mov word [ebp + ebx*2 - 0x18], cx
inc ebx
mov ecx, 0xffff
cmp ax, cx
je 0x10081942
test ax, ax
je 0x10081942
xor eax, eax
mov dword [ebp - 4], eax
test ebx, ebx
je 0x1008186d
lea edi, [ebp - 0xdc]
lea esp, [esp]
mov ecx, dword [ebp - 0x34]
push dword [ebp - 0x20]
movzx esi, word [ebp + eax*2 - 0x18]
mov dword [edi], ecx
mov ecx, dword [ebp - 0xc]
mov dword [edi + 4], ecx
mov ecx, dword [ebp - 0x1c]
mov dword [edi + 8], 0
mov dword [edi - 4], 1
mov dword [edi + 0xc], ecx
call dword [sym.imp.USER32.dll_GetKeyboardLayout]
push eax
push 0
push esi
call dword [sym.imp.USER32.dll_MapVirtualKeyExW]
mov word [edi + 2], ax
lea edi, [edi + 0x1c]
mov eax, dword [ebp - 4]
inc eax
mov word [edi - 0x1c], si
mov dword [ebp - 4], eax
cmp eax, ebx
jl 0x10081820
mov ecx, dword [ebp - 0x34]
lea esi, [ebx*8]
mov edx, dword [ebp - 0xc]
sub esi, ebx
mov edi, dword [ebp - 0x1c]
xor eax, eax
mov dword [ebp - 4], eax
mov dword [ebp + esi*4 - 0xc0], ecx
mov dword [ebp + esi*4 - 0xbc], edx
mov dword [ebp + esi*4 - 0xdc], ecx
mov dword [ebp + esi*4 - 0xb8], eax
mov dword [ebp + esi*4 - 0xd8], edx
mov dword [ebp + esi*4 - 0xb4], edi
or dword [ebp + esi*4 - 0xbc], 2
mov dword [ebp + esi*4 - 0xd4], eax
mov dword [ebp + esi*4 - 0xe0], 1
mov dword [ebp + esi*4 - 0xd0], edi
mov dword [ebp + esi*4 - 0xc4], 1
test ebx, ebx
je 0x10081936
lea esi, [ebp + esi*4 - 0xa4]
push dword [ebp - 0x20]
mov dword [esi], ecx
mov dword [esi + 4], edx
mov dword [esi + 8], 0
mov dword [esi + 0xc], edi
movzx edi, word [ebp + eax*2 - 0x18]
mov dword [esi - 4], 1
call dword [sym.imp.USER32.dll_GetKeyboardLayout]
push eax
push 0
push edi
call dword [sym.imp.USER32.dll_MapVirtualKeyExW]
or dword [esi + 4], 2
lea esi, [esi + 0x1c]
mov ecx, dword [ebp - 0x34]
mov edx, dword [ebp - 0xc]
mov word [esi - 0x1a], ax
mov eax, dword [ebp - 4]
inc eax
mov word [esi - 0x1c], di
mov edi, dword [ebp - 0x1c]
mov dword [ebp - 4], eax
cmp eax, ebx
jl 0x100818e5
mov edi, dword [ebp - 0x20]
lea ebx, [ebx*2 + 2]
jmp 0x100819b0
mov ax, word [ebp - 0x24]
xor ecx, ecx
mov word [ebp - 0x32], ax
xor eax, eax
xor edx, edx
mov word [ebp - 0x34], ax
mov eax, dword [ebp - 0x34]
mov dword [ebp - 0xbc], 4
lea ebx, [ecx + 2]
mov dword [ebp - 0xe0], 1
mov dword [ebp - 0xdc], eax
mov dword [ebp - 0xd8], 4
mov dword [ebp - 0xd4], edx
mov dword [ebp - 0xd0], ecx
mov dword [ebp - 0xc4], 1
mov dword [ebp - 0xc0], eax
mov dword [ebp - 0xb8], edx
mov dword [ebp - 0xb4], ecx
mov dword [ebp - 0xbc], 6
mov esi, dword [ebp - 0x10]
lea eax, [ebp - 0xe0]
add esi, dword [ebp - 0x38]
push 0x1c
push eax
push ebx
mov dword [ebp - 0x10], esi
call dword [sym.imp.USER32.dll_SendInput]
cmp eax, ebx
je 0x100819da
push str.Couldnt_send_game_text_n
call fcn.10084630
add esp, 4
cmp esi, 0x800
jle 0x100819ef
push str.Long_game_text_n
call fcn.10084630
add esp, 4
mov eax, dword [ebp + 8]
cmp word [eax + esi*2], 0
mov esi, dword [sym.imp.USER32.dll_GetKeyboardLayout]
jne 0x100816d2
pop ebx
pop esi
pop edi
mov esp, ebp
pop ebp
ret 4