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

Disassembly:
mov dl, byte [esp + 8]
mov ecx, dword [0x51b90c]
sub esp, 0x15c
push ebx
push ebp
mov ebp, dword [0x51c0b8]
push edi
mov di, word [esp + 0x174]
cmp ebp, 1
jne 0x4072c3
cmp byte [0x51c0e8], 0
jne 0x4072c3
movzx eax, dl
lea eax, [eax + eax*4]
cmp dword [ecx + eax*4], 0
jne 0x4072c3
xor bl, bl
mov byte [esp + 0xf], bl
jmp 0x4072cc
mov byte [esp + 0xf], 1
mov bl, byte [esp + 0xf]
cmp byte [esp + 0x178], 0
je 0x4072f5
movzx eax, dl
lea edx, [eax + eax*4]
cmp byte [ecx + edx*4 + 8], 0
mov al, 1
jne 0x407d59
pop edi
pop ebp
mov al, bl
pop ebx
add esp, 0x15c
ret
cmp dword [0x51b93c], 0
je 0x407311
cmp byte [esp + 0x17c], 0
jne 0x407311
mov byte [esp + 0x10], 1
test bl, bl
jne 0x407316
mov byte [esp + 0x10], 0
mov bl, byte [0x51aecd]
push esi
cmp ebp, 1
jne 0x407404
cmp byte [0x51c0e6], 0
je 0x40733d
cmp byte [esp + 0x180], 0
jne 0x407404
mov byte [esp + 0x15], 1
cmp dl, 0xe7
je 0x4073e5
mov ecx, dword [0x51c0bc]
mov esi, dword [0x51c0c0]
movzx eax, dl
mov al, byte [eax + ecx]
test al, al
jne 0x40736b
movzx eax, di
mov al, byte [eax + esi]
test al, al
je 0x4073e5
mov cl, al
shr al, 2
shr cl, 1
and al, 1
and cl, 1
je 0x40740b
test al, al
jne 0x40738f
test bl, 0x30
jne 0x40738f
test al, al
je 0x4073e5
test bl, 0x30
jne 0x4073e5
movzx eax, di
mov ebp, 4
mov dword [0x51c0b8], ebp
cmp byte [eax + esi], 0
mov byte [0x51c0c8], dl
setne al
mov byte [0x51c0ce], al
xor eax, eax
mov word [0x51c0ca], di
mov word [0x51c0cc], ax
test cl, cl
je 0x4073ce
mov byte [0x51c0cf], 1
test bl, 0x30
jne 0x4073d3
mov byte [0x51c0cf], al
cmp byte [esp + 0x14], al
jne 0x4073e5
cmp byte [0x51e740], al
je 0x407d6d
movzx eax, dl
mov dword [esp + 0x20], eax
add eax, 0xffffffdf
cmp eax, 0x84
ja case.0x4073fd.41
movzx ecx, byte [eax + 0x407dc4]
jmp dword [ecx*4 + 0x407db8]
mov byte [esp + 0x15], 0
jmp 0x4073e5
test al, al
je 0x40738f
jmp 0x40738a
pop esi
pop edi
pop ebp
mov al, 1
pop ebx
add esp, 0x15c
ret
cmp byte [esp + 0x14], 0
je case.0x4073fd.41
mov ecx, dword [0x519c04]
test ecx, ecx
je 0x40744a
xor eax, eax
xor ecx, ecx
mov word [0x519c08], ax
mov dword [0x519c04], ecx
jmp 0x40744a
mov ecx, dword [0x519c04]
test bl, bl
je 0x40747d
cmp ebp, 1
jne 0x40745c
cmp byte [0x51c0e7], 0
jne 0x40747d
cmp bl, 0x10
je 0x40747d
cmp bl, 0x20
je 0x40747d
cmp bl, 0x30
je 0x40747d
test bl, 0xc
je 0x407d6d
test bl, 3
je 0x407d6d
cmp dl, 8
jne 0x4074ef
test bl, bl
jne 0x4074ef
cmp byte [esp + 0x15], bl
je 0x4074b4
cmp ebp, 1
jne 0x4074b4
cmp byte [0x51c0e4], bl
je 0x4074b4
mov eax, dword [0x51c0f0]
test eax, eax
je 0x4074b4
mov esi, dword [0x51c0ec]
dec eax
xor edx, edx
mov dword [0x51c0f0], eax
mov word [esi + eax*2], dx
cmp byte [esp + 0x14], 0
je 0x4074d0
test ecx, ecx
je 0x4074d0
dec ecx
xor eax, eax
mov dword [0x519c04], ecx
mov word [ecx*2 + 0x519c08], ax
cmp byte [0x51e740], 0
je 0x4074e0
mov byte [0x51e740], 0
mov al, byte [esp + 0x13]
pop esi
pop edi
pop ebp
pop ebx
add esp, 0x15c
ret
call dword [sym.imp.USER32.dll_GetForegroundWindow]
mov esi, eax
mov ecx, esi
mov dword [esp + 0x28], esi
call fcn.00412dc0
push eax
call dword [sym.imp.USER32.dll_GetKeyboardLayout]
mov ebp, eax
mov dword [esp + 0x30], ebp
cmp dword [0x51e74c], esi
je 0x407552
push 0x1c
lea ecx, [esp + 0x138]
push ecx
push esi
mov dword [0x51e74c], esi
call dword [sym.imp.USER32.dll_GetClassNameW]
push 0x4eadf4
call fcn.004a4b10
push eax
lea edx, [esp + 0x13c]
push edx
call fcn.004c9bad
add esp, 0xc
test eax, eax
sete byte [0x51e748]
mov bl, byte [0x51e740]
mov ecx, 0x40
mov esi, 0x51aef0
lea edi, [esp + 0x34]
rep movsd dword es:[edi], dword [esi]
mov esi, dword [sym.imp.USER32.dll_ToUnicodeEx]
test bl, bl
je 0x4075ef
cmp byte [0x51e748], 0
je 0x4075ef
cmp byte [esp + 0x174], 0xe7
je 0x4075ef
mov al, byte [0x51e746]
mov cl, byte [0x51e747]
neg al
sbb al, al
and al, 0x20
neg cl
sbb cl, cl
and cl, 9
or al, cl
lea ecx, [esp + 0x34]
call fcn.004128e0
push ebp
push 0
push 2
lea edx, [esp + 0x24]
push edx
mov eax, ecx
movzx ecx, word [0x51e744]
push eax
movzx edx, bl
push ecx
push edx
call esi
test eax, eax
jle 0x4075e8
movzx edx, word [0x51e744]
push ebp
push 0
push 2
lea eax, [esp + 0x24]
push eax
movzx eax, byte [0x51e740]
lea ecx, [esp + 0x44]
push ecx
push edx
push eax
call esi
mov byte [0x51e740], 0
mov al, byte [0x51aecd]
lea ecx, [esp + 0x34]
call fcn.004128e0
push 0x14
call dword [sym.imp.USER32.dll_GetKeyState]
test al, 1
je 0x407610
or byte [esp + 0x48], 1
jmp 0x407615
and byte [esp + 0x48], 0xfe
cmp byte [esp + 0x174], 0xe7
jne 0x407637
mov cx, word [esp + 0x178]
mov eax, 1
mov dword [esp + 0x2c], eax
mov word [esp + 0x18], cx
jmp 0x40766e
xor edx, edx
cmp dword [0x51b060], edx
push ebp
setne dl
lea eax, [esp + 0x1c]
lea ecx, [esp + 0x38]
push edx
mov edx, dword [esp + 0x178]
push 2
push eax
mov eax, dword [edx + 4]
push ecx
mov ecx, dword [esp + 0x34]
push eax
push ecx
call esi
mov dword [esp + 0x2c], eax
test eax, eax
je 0x407d6d
cmp byte [0x51e740], 0
setne byte [esp + 0x27]
test eax, eax
jns 0x407707
mov bl, byte [esp + 0x13]
test bl, bl
je 0x407d56
mov ax, word [esp + 0x178]
mov dl, byte [esp + 0x174]
mov word [0x51e744], ax
mov al, byte [0x51aecd]
test al, 0x30
setne cl
mov byte [0x51e740], dl
mov byte [0x51e746], cl
test al, 3
je 0x4076c8
mov byte [0x51e747], 1
test al, 0xc
jne 0x4076cf
mov byte [0x51e747], 0
xor edx, edx
cmp dword [0x51b060], edx
push ebp
setne dl
lea eax, [esp + 0x1c]
lea ecx, [esp + 0x38]
push edx
mov edx, dword [esp + 0x178]
push 2
push eax
mov eax, dword [edx + 4]
push ecx
mov ecx, dword [esp + 0x34]
push eax
push ecx
call esi
pop esi
pop edi
pop ebp
mov al, bl
pop ebx
add esp, 0x15c
ret
test byte [0x51aecd], 3
jne 0x407737
mov eax, 0xd
cmp word [esp + 0x18], ax
jne 0x407726
mov edx, 0xa
mov word [esp + 0x18], dx
cmp word [esp + 0x1a], ax
jne 0x407737
mov eax, 0xa
mov word [esp + 0x1a], ax
cmp byte [esp + 0x14], 0
mov byte [esp + 0x17], 0
je 0x407b03
mov eax, dword [esp + 0x28]
cmp eax, dword [0x519c00]
je 0x407763
xor ecx, ecx
mov dword [0x519c00], eax
mov word [0x519c08], cx
jmp 0x4077b1
mov ecx, dword [0x519c04]
mov edx, 0x5a
sub edx, ecx
cmp edx, 3
jge 0x4077b1
mov eax, 0x519c62
lea edx, [eax + 2]
lea ecx, [ecx]
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x407780
sub eax, edx
sar eax, 1
mov dword [0x519c04], eax
lea eax, [eax + eax + 2]
push eax
push 0x519c62
push 0x519c08
call fcn.004ca630
mov ecx, dword [0x519c04]
add esp, 0xc
mov dx, word [esp + 0x18]
mov word [ecx*2 + 0x519c08], dx
inc ecx
cmp dword [esp + 0x2c], 1
mov dword [0x519c04], ecx
jle 0x4077e0
mov ax, word [esp + 0x1a]
mov word [ecx*2 + 0x519c08], ax
inc ecx
mov dword [0x519c04], ecx
xor edx, edx
mov word [ecx*2 + 0x519c08], dx
test ecx, ecx
je 0x407b03
mov dword [esp + 0x28], edx
cmp dword [0x51b940], edx
jbe 0x407b03
mov ebx, dword [sym.imp.USER32.dll_CharLowerW]
jmp 0x407810
mov eax, dword [0x51b93c]
mov edx, dword [esp + 0x28]
mov ebp, dword [eax + edx*4]
cmp byte [ebp + 0x23], 0
jne 0x407922
cmp byte [ebp + 0x2a], 0
je 0x407865
movzx eax, byte [ebp + 0x22]
cmp ecx, eax
jle 0x407922
movzx eax, word [ecx*2 + 0x519c06]
push eax
push str._____:____.___n__t
call fcn.004ca9cb
add esp, 8
test eax, eax
je 0x40791c
mov ecx, dword [0x519c04]
lea edi, [ecx*2 + 0x519c04]
jmp 0x407878
movzx edx, byte [ebp + 0x22]
cmp ecx, edx
jl 0x407922
lea edi, [ecx*2 + 0x519c06]
cmp byte [ebp + 0x26], 0
movzx edx, byte [ebp + 0x22]
mov eax, dword [ebp + 8]
lea esi, [eax + edx*2 - 2]
je 0x4078a4
cmp esi, eax
jb 0x4078e6
lea ecx, [ecx]
mov dx, word [edi]
cmp dx, word [esi]
jne 0x4078e6
sub esi, 2
sub edi, 2
cmp esi, eax
jae 0x407890
jmp 0x4078e6
cmp esi, eax
jb 0x4078e6
jmp 0x4078b6
mov ebx, dword [sym.imp.USER32.dll_CharLowerW]
movzx eax, word [esi]
push eax
call ebx
movzx ecx, word [edi]
push ecx
mov dword [esp + 0x24], eax
call ebx
mov ecx, dword [esp + 0x20]
cmp ax, cx
jne 0x4078da
sub esi, 2
sub edi, 2
cmp esi, dword [ebp + 8]
jae 0x4078b0
mov ecx, dword [0x519c04]
mov ebx, dword [sym.imp.USER32.dll_CharLowerW]
cmp esi, dword [ebp + 8]
jae 0x407922
cmp byte [ebp + 0x2b], 0
jne 0x407909
cmp edi, 0x519c08
jb 0x407909
movzx edx, word [edi]
push edx
call fcn.00407e50
add esp, 4
test al, al
jne 0x40791c
mov eax, dword [ebp + 4]
mov esi, dword [ebp + 0x10]
push eax
call fcn.0040a130
add esp, 4
test eax, eax
jne 0x40793c
mov ecx, dword [0x519c04]
mov eax, dword [esp + 0x28]
inc eax
mov dword [esp + 0x28], eax
cmp eax, dword [0x51b940]
jb 0x407810
jmp 0x407b03
movzx edx, byte [ebp + 0x21]
mov ecx, dword [esp + 0x184]
mov eax, dword [esp + 0x170]
mov eax, dword [eax + 0x10]
add ecx, 4
push edx
call fcn.0040ad00
add esp, 4
test al, al
je 0x407b03
cmp byte [ebp + 0x27], 0
jne 0x407972
xor edi, edi
jmp 0x407a4d
cmp byte [ebp + 0x2a], 0
mov ebx, dword [0x519c04]
lea ebx, [ebx*2 + 0x519c08]
je 0x407988
sub ebx, 2
movzx ecx, byte [ebp + 0x22]
add ecx, ecx
mov esi, ebx
sub esi, ecx
mov dword [esp + 0x20], 0
mov byte [esp + 0x16], 0
mov byte [esp + 0x14], 0
cmp esi, ebx
jae 0x4079f6
mov edi, dword [sym.imp.USER32.dll_IsCharUpperW]
mov edi, edi
movzx edx, word [esi]
push edx
call dword [sym.imp.USER32.dll_IsCharLowerW]
test eax, eax
jne 0x4079c8
movzx eax, word [esi]
push eax
call edi
test eax, eax
je 0x4079e7
cmp byte [esp + 0x16], 0
jne 0x4079e3
movzx ecx, word [esi]
push ecx
mov byte [esp + 0x1a], 1
call edi
test eax, eax
je 0x4079e3
mov byte [esp + 0x14], 1
inc dword [esp + 0x20]
add esi, 2
cmp esi, ebx
jb 0x4079b0
mov eax, dword [esp + 0x20]
test eax, eax
jne 0x4079fa
xor edi, edi
jmp 0x407a4d
cmp eax, 1
jne 0x407a0d
movzx edi, byte [esp + 0x14]
neg edi
sbb edi, edi
and edi, 2
jmp 0x407a4d
cmp byte [esp + 0x14], 0
jne 0x407a18
xor edi, edi
jmp 0x407a4d
movzx edx, byte [ebp + 0x22]
add edx, edx
mov esi, ebx
sub esi, edx
mov edi, 2
cmp esi, ebx
jae 0x407a46
jmp 0x407a30
movzx eax, word [esi]
push eax
call dword [sym.imp.USER32.dll_IsCharLowerW]
test eax, eax
jne 0x407a44
add esi, edi
cmp esi, ebx
jb 0x407a30
cmp esi, ebx
jne 0x407a4d
mov edi, 1
mov dl, byte [ebp + 0x28]
test dl, dl
jne 0x407a59
cmp byte [ebp + 0x29], dl
je 0x407a63
mov byte [esp + 0x13], 0
mov byte [esp + 0x17], 1
mov eax, dword [esp + 0x28]
mov ecx, dword [esp + 0x188]
mov dword [ecx], eax
mov al, byte [ebp + 0x2a]
test al, al
je 0x407a87
mov ecx, dword [0x519c04]
movzx ecx, word [ecx*2 + 0x519c06]
jmp 0x407a89
xor ecx, ecx
movzx esi, di
movzx ecx, cx
shl esi, 0x10
or esi, ecx
mov ecx, dword [esp + 0x18c]
mov dword [ecx], esi
xor ecx, ecx
cmp dword [ebp + 0xc], ecx
je 0x407ad0
test al, al
je 0x407ac8
mov edx, dword [0x519c04]
mov ax, word [edx*2 + 0x519c06]
mov word [0x519c08], ax
mov dword [0x519c04], 1
jmp 0x407ae8
mov dword [0x519c04], ecx
jmp 0x407ae8
test dl, dl
je 0x407ae8
movzx edx, byte [ebp + 0x22]
sub dword [0x519c04], edx
test al, al
je 0x407ae8
dec dword [0x519c04]
cmp byte [ebp + 0x2c], cl
je 0x407af3
mov dword [0x519c04], ecx
mov ecx, dword [0x519c04]
xor eax, eax
mov word [ecx*2 + 0x519c08], ax
cmp byte [esp + 0x27], 0
mov bl, byte [esp + 0x13]
je 0x407b75
test bl, bl
je 0x407b75
push 0x100
lea edx, [esp + 0x38]
push 0
push edx
call fcn.004d2f90
mov al, byte [0x51e746]
mov cl, byte [0x51e747]
add esp, 0xc
neg al
sbb al, al
and al, 0x20
neg cl
sbb cl, cl
and cl, 9
or al, cl
lea ecx, [esp + 0x34]
call fcn.004128e0
mov edx, dword [esp + 0x30]
push edx
movzx edx, word [0x51e744]
push 0
push 2
lea eax, [esp + 0x3c]
push eax
movzx eax, byte [0x51e740]
push ecx
push edx
push eax
call dword [sym.imp.USER32.dll_ToUnicodeEx]
mov byte [0x51e740], 0
cmp byte [esp + 0x15], 0
je 0x407d56
cmp dword [0x51c0b8], 1
jne 0x407d56
cmp byte [esp + 0x17], 0
jne 0x407d56
mov edi, dword [esp + 0x2c]
xor esi, esi
test edi, edi
jle 0x407c1a
jmp 0x407bb0
cmp byte [0x51c0e5], 0
mov ecx, dword [0x51c0c4]
je 0x407bd0
movzx eax, word [esp + esi*2 + 0x18]
push eax
push ecx
call fcn.004ca9cb
add esp, 8
jmp 0x407bda
mov ax, word [esp + esi*2 + 0x18]
call fcn.004ac690
test eax, eax
jne 0x407c6a
mov eax, dword [0x51c0f0]
cmp eax, dword [0x51c0f4]
je 0x407c1a
mov dx, word [esp + esi*2 + 0x18]
mov ecx, dword [0x51c0ec]
mov word [ecx + eax*2], dx
mov eax, dword [0x51c0f0]
mov ecx, dword [0x51c0ec]
inc eax
xor edx, edx
inc esi
mov dword [0x51c0f0], eax
mov word [ecx + eax*2], dx
cmp esi, edi
jl 0x407bb0
xor esi, esi
cmp byte [0x51c0e9], 0
je 0x407cd6
cmp byte [0x51c0e5], 0
je 0x407ca4
cmp dword [0x51c0d4], esi
jbe 0x407d3e
mov edi, edi
mov eax, dword [0x51c0d0]
mov eax, dword [eax + esi*4]
mov ecx, dword [0x51c0ec]
push eax
push ecx
call fcn.004ca9f2
add esp, 8
test eax, eax
jne 0x407c8d
inc esi
cmp esi, dword [0x51c0d4]
jb 0x407c40
jmp 0x407d3e
mov dx, word [esp + esi*2 + 0x18]
pop esi
pop edi
pop ebp
mov al, bl
mov dword [0x51c0b8], 4
mov word [0x51c0cc], dx
pop ebx
add esp, 0x15c
ret
pop esi
pop edi
pop ebp
mov al, bl
mov dword [0x51c0b8], 3
pop ebx
add esp, 0x15c
ret
cmp dword [0x51c0d4], esi
jbe 0x407d3e
mov edx, dword [0x51c0ec]
mov eax, dword [0x51c0d0]
mov eax, dword [eax + esi*4]
push edx
call fcn.004ac6e0
add esp, 4
test eax, eax
jne 0x407c8d
inc esi
cmp esi, dword [0x51c0d4]
jb 0x407cb0
jmp 0x407d3e
cmp byte [0x51c0e5], 0
je 0x407d7c
mov ebx, dword [0x51c0d4]
test ebx, ebx
je 0x407d3a
mov edi, dword [0x51c0ec]
mov ebp, dword [0x51c0d0]
lea esp, [esp]
mov ecx, dword [ebp + esi*4]
mov eax, edi
mov dx, word [eax]
cmp dx, word [ecx]
jne 0x407d2c
test dx, dx
je 0x407d28
mov dx, word [eax + 2]
cmp dx, word [ecx + 2]
jne 0x407d2c
add eax, 4
add ecx, 4
test dx, dx
jne 0x407d06
xor eax, eax
jmp 0x407d31
sbb eax, eax
sbb eax, 0xffffffff
test eax, eax
je 0x407d63
inc esi
cmp esi, ebx
jb 0x407d00
mov bl, byte [esp + 0x13]
mov ecx, dword [0x51c0f4]
cmp dword [0x51c0f0], ecx
jl 0x407d56
mov dword [0x51c0b8], 5
mov al, bl
pop esi
pop edi
pop ebp
pop ebx
add esp, 0x15c
ret
mov dword [0x51c0b8], 3
mov al, byte [esp + 0x13]
pop esi
pop edi
pop ebp
pop ebx
add esp, 0x15c
ret
cmp dword [0x51c0d4], esi
jbe 0x407d3e
mov edi, dword [sym.imp.KERNEL32.dll_lstrcmpiW]
lea ebx, [ebx]
mov ecx, dword [0x51c0d0]
mov edx, dword [ecx + esi*4]
mov eax, dword [0x51c0ec]
push edx
push eax
call edi
test eax, eax
je 0x407c8d
inc esi
cmp esi, dword [0x51c0d4]
jb 0x407d90
jmp 0x407d3e