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

Disassembly:
sub esp, 0x17c
push ebx
push ebp
push esi
push edi
mov edi, dword [0x51eac8]
mov bh, dl
xor al, al
mov edx, ecx
mov dword [esp + 0x20], edx
mov dword [esp + 0x14], eax
test edi, edi
je 0x411837
mov ebp, dword [esp + 0x190]
nop dword [eax]
cmp dword [edi], 1
jne 0x41182c
mov bl, byte [edi + 0x3c]
test bl, bl
je 0x41179c
mov eax, dword [edx + 0x10]
dec bl
mov esi, 0xffc3d44d
mov ecx, 0x65
sub esi, eax
lea edx, [eax + 0x3c2c17]
movzx eax, bl
cmp edx, 0x66
cmovbe ecx, esi
cmp ecx, eax
mov eax, dword [esp + 0x14]
jle 0x411828
cmp byte [esp + 0x194], 0
je 0x411815
mov eax, dword [edi + 8]
test eax, eax
je 0x4117f0
cmp dword [eax + 0x368], 0
je 0x4117f0
movzx ecx, bp
movzx esi, bh
mov al, byte [ecx + edi + 0x154]
mov dl, byte [esi + edi + 0x54]
or al, dl
test al, 0x20
jne 0x4117d8
cmp byte [edi + 0x43], 0
je 0x4117f0
test dl, 0x40
jne 0x4117f0
shl ecx, 0x10
or ecx, esi
push ecx
push edi
push 0x41e
push dword [0x51ead8]
call dword [sym.imp.USER32.dll_PostMessageW]
movzx ecx, bp
mov al, byte [ecx + edi + 0x154]
test al, al
js 0x411909
movzx ecx, bh
mov al, byte [ecx + edi + 0x54]
test al, al
js 0x4118f6
mov eax, dword [esp + 0x14]
cmp byte [edi + 0x40], 0
mov ecx, 1
movzx eax, al
cmovne eax, ecx
mov dword [esp + 0x14], eax
mov edx, dword [esp + 0x20]
mov edi, dword [edi + 4]
test edi, edi
jne 0x411760
cmp byte [esp + 0x194], 0
jne 0x411c43
mov dl, byte [0x51f4ce]
mov bl, 1
test dl, 0xcf
je 0x41186a
test al, al
jne 0x41186a
test dl, 0xc
setne cl
test dl, 3
setne al
and cl, al
neg cl
sbb cl, cl
and bl, cl
call dword [sym.imp.USER32.dll_GetForegroundWindow]
mov ebp, eax
xor esi, esi
test ebp, ebp
je 0x4118ab
mov edi, dword [sym.imp.USER32.dll_GetWindowThreadProcessId]
push esi
push ebp
call edi
mov esi, eax
mov dword [esp + 0x24], 0x30
lea eax, [esp + 0x24]
push eax
push esi
call dword [sym.imp.USER32.dll_GetGUIThreadInfo]
test eax, eax
je 0x4118ab
mov eax, dword [esp + 0x30]
test eax, eax
je 0x4118ab
push 0
push eax
call edi
mov esi, eax
push esi
call dword [sym.imp.USER32.dll_GetKeyboardLayout]
mov dword [esp + 0x14], eax
cmp dword [0x522bdc], ebp
je 0x41191f
push 0x1c
lea eax, [esp + 0x158]
mov dword [0x522bdc], ebp
push eax
push ebp
call dword [sym.imp.USER32.dll_GetClassNameW]
lea eax, [esp + 0x154]
push str.ApplicationFrameWindow
push eax
call fcn.004ce516
add esp, 8
test eax, eax
sete al
mov byte [0x522bd9], al
jmp 0x411924
and al, 0x7f
mov byte [ecx + edi + 0x54], al
xor al, al
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x17c
ret
and al, 0x7f
mov byte [ecx + edi + 0x154], al
pop edi
pop esi
pop ebp
xor al, al
pop ebx
add esp, 0x17c
ret
mov al, byte [0x522bd9]
xor ecx, ecx
lea edi, [esp + 0x54]
cmp byte [0x522bd8], 0
mov esi, 0x51f4d0
mov dword [esp + 0x18], ecx
mov word [esp + 0x1c], cx
mov ecx, 0x40
rep movsd dword es:[edi], dword [esi]
mov esi, dword [sym.imp.USER32.dll_ToUnicodeEx]
je 0x4119d1
test al, al
je 0x4119d1
cmp bh, 0xe7
je 0x4119d1
mov dl, byte [0x522bd6]
lea ecx, [esp + 0x54]
mov al, byte [0x522bd7]
neg dl
sbb dl, dl
and dl, 0x20
neg al
sbb al, al
and al, 9
or dl, al
call fcn.0041dba0
mov edi, dword [esp + 0x14]
lea eax, [esp + 0x18]
push edi
push 0
push 2
push eax
lea eax, [esp + 0x64]
push eax
movzx eax, word [0x522bd4]
push eax
movzx eax, byte [0x522bd8]
push eax
call esi
test eax, eax
jle 0x4119c8
push edi
push 0
push 2
lea eax, [esp + 0x24]
push eax
lea eax, [esp + 0x64]
push eax
movzx eax, word [0x522bd4]
push eax
movzx eax, byte [0x522bd8]
push eax
call esi
mov byte [0x522bd8], 0
jmp 0x4119d5
mov edi, dword [esp + 0x14]
mov dl, byte [0x51f4ce]
lea ecx, [esp + 0x54]
call fcn.0041dba0
push 0x14
call dword [sym.imp.USER32.dll_GetKeyState]
test al, 1
je 0x4119f7
or byte [esp + 0x68], 1
jmp 0x4119fc
and byte [esp + 0x68], 0xfe
cmp bh, 0xe7
jne 0x411a15
mov eax, dword [esp + 0x20]
mov esi, 1
mov ax, word [eax + 4]
mov word [esp + 0x18], ax
jmp 0x411a8b
test bl, bl
je 0x411a6b
xor eax, eax
cmp dword [0x51eaa8], eax
push edi
setne al
push eax
push 2
lea eax, [esp + 0x24]
push eax
lea eax, [esp + 0x64]
push eax
mov eax, dword [esp + 0x34]
push dword [eax + 4]
movzx eax, bh
push eax
call esi
test byte [0x51f4ce], 3
mov esi, eax
jne 0x411a6d
cmp word [esp + 0x18], 0xd
mov eax, 0xa
jne 0x411a5c
mov word [esp + 0x18], ax
cmp word [esp + 0x1a], 0xd
jne 0x411a6d
mov word [esp + 0x1a], ax
jmp 0x411a6d
xor esi, esi
cmp bh, 8
jne 0x411a8b
test esi, esi
je 0x411a8b
cmp byte [0x522bd9], 0
je 0x411a8a
xor esi, esi
mov byte [0x522bd8], 0
jmp 0x411a8b
dec esi
push ecx
mov ecx, dword [esp + 0x24]
lea eax, [esp + 0x1c]
push esi
push eax
push dword [esp + 0x19c]
mov dl, bh
call fcn.00412070
add esp, 0x10
test al, al
je 0x411912
mov bl, byte [0x522bd8]
test bl, bl
je 0x411afa
test esi, esi
jle 0x411afa
mov byte [esp + 0x13], 1
cmp dword [0x51f644], 0
je 0x411bdc
cmp byte [esp + 0x198], 0
jne 0x411bdc
movzx eax, bh
add eax, 0xfffffff8
cmp eax, 0x20
ja case.0x411af3.9
movzx eax, byte [eax + 0x411c5c]
jmp dword [eax*4 + 0x411c50]
mov byte [esp + 0x13], 0
test esi, esi
jns 0x411ac2
mov eax, dword [esp + 0x190]
mov word [0x522bd4], ax
mov al, byte [0x51f4ce]
test al, 0x30
mov byte [0x522bd8], bh
push edi
setne byte [0x522bd6]
test al, 0xc
setne cl
test al, 3
setne al
and cl, al
xor eax, eax
cmp dword [0x51eaa8], eax
mov byte [0x522bd7], cl
setne al
push eax
push 2
lea eax, [esp + 0x24]
push eax
lea eax, [esp + 0x64]
push eax
mov eax, dword [esp + 0x34]
push dword [eax + 4]
movzx eax, bh
push eax
mov eax, dword [sym.imp.USER32.dll_ToUnicodeEx]
call eax
pop edi
pop esi
pop ebp
mov al, 1
pop ebx
add esp, 0x17c
ret
cmp dword [0x51ecb4], 0
je case.0x411af3.9
xor eax, eax
mov word [0x51ecb8], ax
jmp 0x411b9e
cmp byte [0x51f4ce], 0
jne case.0x411af3.9
mov eax, dword [0x51ecb4]
test eax, eax
je case.0x411af3.9
dec eax
xor ecx, ecx
mov word [eax*2 + 0x51ecb8], cx
mov dword [0x51ecb4], eax
test esi, esi
jle 0x411bdc
push dword [esp + 0x1a4]
mov ecx, dword [esp + 0x24]
lea edx, [esp + 0x1c]
push dword [esp + 0x1a4]
push dword [esp + 0x1a4]
push ebp
push esi
call fcn.00411c80
add esp, 0x14
test al, al
je 0x411912
mov bl, byte [0x522bd8]
cmp byte [esp + 0x13], 0
je 0x411c43
push 0x100
lea eax, [esp + 0x58]
push 0
push eax
call fcn.004cc590
mov dl, byte [0x522bd6]
lea ecx, [esp + 0x60]
mov al, byte [0x522bd7]
add esp, 0xc
neg dl
sbb dl, dl
and dl, 0x20
neg al
sbb al, al
and al, 9
or dl, al
call fcn.0041dba0
push edi
push 0
push 2
lea eax, [esp + 0x20]
push eax
lea eax, [esp + 0x64]
push eax
movzx eax, word [0x522bd4]
push eax
movzx eax, bl
push eax
mov eax, dword [sym.imp.USER32.dll_ToUnicodeEx]
call eax
mov byte [0x522bd8], 0
pop edi
pop esi
pop ebp
mov al, 1
pop ebx
add esp, 0x17c
ret