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

Disassembly:
mov dl, byte [esp + 8]
mov ecx, dword [0x4abbd8]
sub esp, 0x174
push ebx
push ebp
mov ebp, dword [0x4ac350]
push esi
push edi
mov di, word [esp + 0x190]
cmp ebp, 1
jne 0x4069b4
cmp byte [0x4ac380], 0
jne 0x4069b4
movzx eax, dl
lea eax, [eax + eax*4]
cmp dword [ecx + eax*4], 0
jne 0x4069b4
xor bl, bl
mov byte [esp + 0x16], bl
jmp 0x4069bd
mov byte [esp + 0x16], 1
mov bl, byte [esp + 0x16]
cmp byte [esp + 0x194], 0
je 0x4069e7
movzx eax, dl
lea edx, [eax + eax*4]
cmp byte [ecx + edx*4 + 8], 0
mov al, 1
jne 0x40743c
mov al, bl
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x174
ret
cmp dword [0x4abc08], 0
je 0x406a03
cmp byte [esp + 0x198], 0
jne 0x406a03
mov byte [esp + 0x17], 1
test bl, bl
jne 0x406a08
mov byte [esp + 0x17], 0
mov bl, byte [0x4ab29d]
cmp ebp, 1
jne 0x406af8
cmp byte [0x4ac37e], 0
je 0x406a2e
cmp byte [esp + 0x198], 0
jne 0x406af8
mov byte [esp + 0x1d], 1
cmp dl, 0xe7
je 0x406ad9
mov ecx, dword [0x4ac354]
mov esi, dword [0x4ac358]
movzx eax, dl
mov al, byte [eax + ecx]
test al, al
jne 0x406a5c
movzx eax, di
mov al, byte [eax + esi]
test al, al
je 0x406ad9
mov cl, al
shr al, 2
shr cl, 1
and al, 1
and cl, 1
je 0x406aff
test al, al
jne 0x406a80
test bl, 0x30
jne 0x406a80
test al, al
je 0x406ad9
test bl, 0x30
jne 0x406ad9
movzx eax, di
mov ebp, 4
mov dword [0x4ac350], ebp
cmp byte [eax + esi], 0
mov byte [0x4ac360], dl
setne al
mov byte [0x4ac365], al
mov word [0x4ac362], di
mov byte [0x4ac364], 0
test cl, cl
je 0x406abe
mov byte [0x4ac366], 1
test bl, 0x30
jne 0x406ac5
mov byte [0x4ac366], 0
cmp byte [esp + 0x17], 0
jne 0x406ad9
cmp byte [0x4acb84], 0
je 0x406bc9
movzx eax, dl
mov dword [esp + 0x20], eax
add eax, 0xffffffdf
cmp eax, 0x84
ja case.0x406af1.41
movzx ecx, byte [eax + 0x407454]
jmp dword [ecx*4 + 0x407448]
mov byte [esp + 0x1d], 0
jmp 0x406ad9
test al, al
je 0x406a80
jmp 0x406a7b
mov al, 1
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x174
ret
cmp byte [esp + 0x17], 0
je case.0x406af1.41
mov ecx, dword [0x4aa044]
test ecx, ecx
je 0x406b41
xor ecx, ecx
mov byte [0x4aa048], 0
mov dword [0x4aa044], ecx
jmp 0x406b41
mov ecx, dword [0x4aa044]
test bl, bl
je 0x406b6c
cmp ebp, 1
jne 0x406b53
cmp byte [0x4ac37f], 0
jne 0x406b6c
cmp bl, 0x10
je 0x406b6c
cmp bl, 0x20
je 0x406b6c
cmp bl, 0x30
je 0x406b6c
test bl, 0xc
je 0x406bc9
test bl, 3
je 0x406bc9
cmp dl, 8
jne 0x406bd8
test bl, bl
jne 0x406bd8
cmp byte [esp + 0x1d], bl
je 0x406ba0
cmp ebp, 1
jne 0x406ba0
cmp byte [0x4ac37c], bl
je 0x406ba0
mov eax, dword [0x4ac388]
test eax, eax
je 0x406ba0
mov edx, dword [0x4ac384]
dec eax
mov dword [0x4ac388], eax
mov byte [edx + eax], bl
cmp byte [esp + 0x17], 0
je 0x406bb9
test ecx, ecx
je 0x406bb9
dec ecx
mov dword [0x4aa044], ecx
mov byte [ecx + 0x4aa048], 0
cmp byte [0x4acb84], 0
je 0x406bc9
mov byte [0x4acb84], 0
mov al, byte [esp + 0x16]
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x174
ret
call dword [sym.imp.USER32.dll_GetForegroundWindow]
mov ebx, eax
xor esi, esi
mov dword [esp + 0x24], ebx
test ebx, ebx
je 0x406c1d
mov edi, dword [sym.imp.USER32.dll_GetWindowThreadProcessId]
push esi
push ebx
call edi
mov esi, eax
lea eax, [esp + 0x50]
push eax
push esi
mov dword [esp + 0x58], 0x30
call dword [sym.imp.USER32.dll_GetGUIThreadInfo]
test eax, eax
je 0x406c1d
mov eax, dword [esp + 0x5c]
test eax, eax
je 0x406c1d
push 0
push eax
call edi
mov esi, eax
push esi
call dword [sym.imp.USER32.dll_GetKeyboardLayout]
mov ebp, eax
mov dword [esp + 0x30], ebp
cmp dword [0x4acb90], ebx
je 0x406c61
push 0x1c
lea ecx, [esp + 0x38]
push ecx
push ebx
mov dword [0x4acb90], ebx
call dword [sym.imp.USER32.dll_GetClassNameA]
lea edx, [esp + 0x34]
push str.ApplicationFrameWindow
push edx
call fcn.004857f1
add esp, 8
test eax, eax
sete byte [0x4acb8c]
mov bl, byte [0x4acb84]
mov ecx, 0x40
mov esi, 0x4ab2c0
lea edi, [esp + 0x80]
rep movsd dword es:[edi], dword [esi]
mov esi, dword [sym.imp.USER32.dll_ToAsciiEx]
test bl, bl
je 0x406d03
cmp byte [0x4acb8c], 0
je 0x406d03
cmp byte [esp + 0x18c], 0xe7
je 0x406d03
mov al, byte [0x4acb8a]
mov cl, byte [0x4acb8b]
neg al
sbb al, al
and al, 0x20
neg cl
sbb cl, cl
and cl, 9
or al, cl
lea ecx, [esp + 0x80]
call fcn.00411c70
push ebp
push 0
lea edx, [esp + 0x20]
push edx
mov eax, ecx
movzx ecx, word [0x4acb88]
push eax
movzx edx, bl
push ecx
push edx
call esi
test eax, eax
jle 0x406cfc
movzx edx, word [0x4acb88]
push ebp
push 0
lea eax, [esp + 0x20]
push eax
movzx eax, byte [0x4acb84]
lea ecx, [esp + 0x8c]
push ecx
push edx
push eax
call esi
mov byte [0x4acb84], 0
mov al, byte [0x4ab29d]
lea ecx, [esp + 0x80]
call fcn.00411c70
push 0x14
call dword [sym.imp.USER32.dll_GetKeyState]
test al, 1
je 0x406d2a
or byte [esp + 0x94], 1
jmp 0x406d32
and byte [esp + 0x94], 0xfe
cmp byte [esp + 0x18c], 0xe7
lea ecx, [esp + 0x18]
jne 0x406d60
push 0
push 0
push 3
push ecx
push 1
lea edx, [esp + 0x1a4]
push edx
push 0x400
push 0
call dword [sym.imp.KERNEL32.dll_WideCharToMultiByte]
jmp 0x406d88
xor eax, eax
cmp dword [0x4ab430], eax
push ebp
setne al
lea edx, [esp + 0x84]
push eax
mov eax, dword [esp + 0x190]
push ecx
mov ecx, dword [eax + 4]
push edx
mov edx, dword [esp + 0x30]
push ecx
push edx
call esi
mov dword [esp + 0x2c], eax
test eax, eax
je 0x406bc9
cmp byte [0x4acb84], 0
setne byte [esp + 0x28]
test eax, eax
jns 0x406e2e
mov bl, byte [esp + 0x16]
test bl, bl
je 0x40743a
mov al, byte [esp + 0x18c]
mov cx, word [esp + 0x190]
mov byte [0x4acb84], al
mov al, byte [0x4ab29d]
test al, 0x30
setne dl
mov word [0x4acb88], cx
mov byte [0x4acb8a], dl
test al, 3
je 0x406dee
mov byte [0x4acb8b], 1
test al, 0xc
jne 0x406df5
mov byte [0x4acb8b], 0
xor eax, eax
cmp dword [0x4ab430], eax
push ebp
setne al
lea ecx, [esp + 0x1c]
lea edx, [esp + 0x84]
push eax
mov eax, dword [esp + 0x190]
push ecx
mov ecx, dword [eax + 4]
push edx
mov edx, dword [esp + 0x30]
push ecx
push edx
call esi
mov al, bl
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x174
ret
test byte [0x4ab29d], 3
jne 0x406e4f
mov cl, 0xd
mov al, 0xa
cmp byte [esp + 0x18], cl
jne 0x406e45
mov byte [esp + 0x18], al
cmp byte [esp + 0x19], cl
jne 0x406e4f
mov byte [esp + 0x19], al
cmp byte [esp + 0x17], 0
mov byte [esp + 0x1e], 0
je 0x4071d9
mov eax, dword [esp + 0x24]
cmp eax, dword [0x4aa040]
je 0x406e7b
mov dword [0x4aa040], eax
mov byte [0x4aa048], 0
xor ecx, ecx
jmp 0x406ebd
mov ecx, dword [0x4aa044]
mov eax, 0x5a
sub eax, ecx
cmp eax, 3
jge 0x406ebd
mov eax, 0x4aa075
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x406e95
sub eax, edx
mov dword [0x4aa044], eax
inc eax
push eax
push 0x4aa075
push 0x4aa048
call fcn.004863d0
mov ecx, dword [0x4aa044]
add esp, 0xc
mov dl, byte [esp + 0x18]
mov byte [ecx + 0x4aa048], dl
inc ecx
cmp dword [esp + 0x2c], 1
mov dword [0x4aa044], ecx
jle 0x406ee6
mov al, byte [esp + 0x19]
mov byte [ecx + 0x4aa048], al
inc ecx
mov dword [0x4aa044], ecx
mov byte [ecx + 0x4aa048], 0
test ecx, ecx
je 0x4071d9
cmp dword [0x4abc0c], 0
mov dword [esp + 0x24], 0
jbe 0x4071d9
lea ebx, [ebx]
mov edx, dword [0x4abc08]
mov eax, dword [esp + 0x24]
mov ebp, dword [edx + eax*4]
cmp byte [ebp + 0x23], 0
jne 0x407009
cmp byte [ebp + 0x2a], 0
je 0x406f64
movzx edx, byte [ebp + 0x22]
cmp ecx, edx
jle 0x407009
movsx eax, byte [ecx + 0x4aa047]
push eax
push str._____:____.___n__t
call fcn.004867e1
add esp, 8
test eax, eax
je 0x407003
mov ecx, dword [0x4aa044]
lea edi, [ecx + 0x4aa046]
jmp 0x406f76
movzx eax, byte [ebp + 0x22]
cmp ecx, eax
jl 0x407009
lea edi, [ecx + 0x4aa047]
cmp byte [ebp + 0x26], 0
movzx edx, byte [ebp + 0x22]
mov eax, dword [ebp + 8]
lea esi, [edx + eax - 1]
je 0x406f9e
cmp esi, eax
jb 0x406fcd
jmp 0x406f90
mov dl, byte [edi]
cmp dl, byte [esi]
jne 0x406fcd
dec esi
dec edi
cmp esi, eax
jae 0x406f90
jmp 0x406fcd
cmp esi, eax
jb 0x406fcd
movzx eax, byte [esi]
mov ebx, dword [sym.imp.USER32.dll_CharLowerA]
push eax
call ebx
movzx ecx, byte [edi]
push ecx
mov dword [esp + 0x24], eax
call ebx
mov ecx, dword [esp + 0x20]
cmp al, cl
jne 0x406fc7
dec esi
dec edi
cmp esi, dword [ebp + 8]
jae 0x406fa2
mov ecx, dword [0x4aa044]
cmp esi, dword [ebp + 8]
jae 0x407009
cmp byte [ebp + 0x2b], 0
jne 0x406ff0
cmp edi, 0x4aa048
jb 0x406ff0
movzx edx, byte [edi]
push edx
call fcn.004074e0
add esp, 4
test al, al
jne 0x407003
mov eax, dword [ebp + 4]
mov esi, dword [ebp + 0x10]
push eax
call fcn.004095d0
add esp, 4
test eax, eax
jne 0x407023
mov ecx, dword [0x4aa044]
mov eax, dword [esp + 0x24]
inc eax
mov dword [esp + 0x24], eax
cmp eax, dword [0x4abc0c]
jb 0x406f10
jmp 0x4071d9
movzx edx, byte [ebp + 0x21]
mov ecx, dword [esp + 0x19c]
mov eax, dword [esp + 0x188]
mov eax, dword [eax + 0x10]
add ecx, 4
push edx
call fcn.0040a140
add esp, 4
test al, al
je 0x4071d9
cmp byte [ebp + 0x27], 0
jne 0x407059
xor edi, edi
jmp 0x40712c
cmp byte [ebp + 0x2a], 0
mov ebx, dword [0x4aa044]
lea ebx, [ebx + 0x4aa048]
je 0x40706c
dec ebx
movzx ecx, byte [ebp + 0x22]
mov esi, ebx
sub esi, ecx
mov dword [esp + 0x20], 0
mov byte [esp + 0x1f], 0
mov byte [esp + 0x17], 0
cmp esi, ebx
jae 0x4070d4
mov edi, dword [sym.imp.USER32.dll_IsCharUpperA]
movzx edx, byte [esi]
push edx
call dword [sym.imp.USER32.dll_IsCharLowerA]
test eax, eax
jne 0x4070a8
movzx eax, byte [esi]
push eax
call edi
test eax, eax
je 0x4070c7
cmp byte [esp + 0x1f], 0
jne 0x4070c3
movzx ecx, byte [esi]
push ecx
mov byte [esp + 0x23], 1
call edi
test eax, eax
je 0x4070c3
mov byte [esp + 0x17], 1
inc dword [esp + 0x20]
inc esi
cmp esi, ebx
jb 0x407090
mov eax, dword [esp + 0x20]
test eax, eax
jne 0x4070d8
xor edi, edi
jmp 0x40712c
cmp eax, 1
jne 0x4070eb
movzx edi, byte [esp + 0x17]
neg edi
sbb edi, edi
and edi, 2
jmp 0x40712c
cmp byte [esp + 0x17], 0
jne 0x4070f6
xor edi, edi
jmp 0x40712c
movzx edx, byte [ebp + 0x22]
mov esi, ebx
sub esi, edx
mov edi, 2
cmp esi, ebx
jae 0x407125
jmp 0x407110
movzx eax, byte [esi]
push eax
call dword [sym.imp.USER32.dll_IsCharLowerA]
test eax, eax
jne 0x407123
inc esi
cmp esi, ebx
jb 0x407110
cmp esi, ebx
jne 0x40712c
mov edi, 1
mov dl, byte [ebp + 0x28]
test dl, dl
jne 0x407138
cmp byte [ebp + 0x29], dl
je 0x407142
mov byte [esp + 0x16], 0
mov byte [esp + 0x1e], 1
mov eax, dword [esp + 0x24]
mov ecx, dword [esp + 0x1a0]
mov dword [ecx], eax
mov al, byte [ebp + 0x2a]
test al, al
je 0x407165
mov ecx, dword [0x4aa044]
movsx ecx, byte [ecx + 0x4aa047]
jmp 0x407167
xor ecx, ecx
movzx esi, di
movzx ecx, cx
shl esi, 0x10
or esi, ecx
mov ecx, dword [esp + 0x1a4]
mov dword [ecx], esi
xor ecx, ecx
cmp dword [ebp + 0xc], ecx
je 0x4071ab
test al, al
je 0x4071a3
mov edx, dword [0x4aa044]
mov al, byte [edx + 0x4aa047]
mov byte [0x4aa048], al
mov dword [0x4aa044], 1
jmp 0x4071c3
mov dword [0x4aa044], ecx
jmp 0x4071c3
test dl, dl
je 0x4071c3
movzx edx, byte [ebp + 0x22]
sub dword [0x4aa044], edx
test al, al
je 0x4071c3
dec dword [0x4aa044]
cmp byte [ebp + 0x2c], cl
je 0x4071ce
mov dword [0x4aa044], ecx
mov eax, dword [0x4aa044]
mov byte [eax + 0x4aa048], cl
cmp byte [esp + 0x28], 0
mov bl, byte [esp + 0x16]
je 0x407256
test bl, bl
je 0x407256
push 0x100
lea ecx, [esp + 0x84]
push 0
push ecx
call fcn.0048ecc0
mov al, byte [0x4acb8a]
mov dl, byte [0x4acb8b]
add esp, 0xc
neg al
sbb al, al
and al, 0x20
neg dl
sbb dl, dl
and dl, 9
or al, dl
lea ecx, [esp + 0x80]
call fcn.00411c70
mov eax, dword [esp + 0x30]
push eax
movzx eax, word [0x4acb88]
push 0
lea ecx, [esp + 0x30]
push ecx
movzx ecx, byte [0x4acb84]
lea edx, [esp + 0x8c]
push edx
push eax
push ecx
call dword [sym.imp.USER32.dll_ToAsciiEx]
mov byte [0x4acb84], 0
cmp byte [esp + 0x1d], 0
je 0x40743a
cmp dword [0x4ac350], 1
jne 0x40743a
cmp byte [esp + 0x1e], 0
jne 0x40743a
mov edi, dword [esp + 0x2c]
xor esi, esi
test edi, edi
jle 0x4072ee
cmp byte [0x4ac37d], 0
je 0x4072a3
movzx eax, byte [esp + esi + 0x18]
mov edx, dword [0x4ac35c]
push eax
push edx
call fcn.004867e1
add esp, 8
jmp 0x4072b2
mov al, byte [esp + esi + 0x18]
mov ecx, dword [0x4ac35c]
call fcn.00472ef0
test eax, eax
jne 0x40733c
mov eax, dword [0x4ac388]
cmp eax, dword [0x4ac38c]
je 0x4072ee
mov cl, byte [esp + esi + 0x18]
mov edx, dword [0x4ac384]
mov byte [edx + eax], cl
mov eax, dword [0x4ac388]
mov ecx, dword [0x4ac384]
inc eax
inc esi
mov dword [0x4ac388], eax
mov byte [ecx + eax], 0
cmp esi, edi
jl 0x407283
xor esi, esi
cmp byte [0x4ac381], 0
je 0x4073a9
cmp byte [0x4ac37d], 0
je 0x407374
cmp dword [0x4ac36c], esi
jbe 0x407423
mov eax, dword [0x4ac368]
mov eax, dword [eax + esi*4]
mov ecx, dword [0x4ac384]
push eax
push ecx
call fcn.00486922
add esp, 8
test eax, eax
jne 0x40735d
inc esi
cmp esi, dword [0x4ac36c]
jb 0x407312
jmp 0x407423
mov dl, byte [esp + esi + 0x18]
mov dword [0x4ac350], 4
mov byte [0x4ac364], dl
mov al, bl
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x174
ret
mov dword [0x4ac350], 3
mov al, bl
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x174
ret
cmp dword [0x4ac36c], esi
jbe 0x407423
mov edx, dword [0x4ac368]
mov eax, dword [edx + esi*4]
push eax
mov eax, dword [0x4ac384]
call fcn.00472f40
add esp, 4
test eax, eax
jne 0x40735d
inc esi
cmp esi, dword [0x4ac36c]
jb 0x407380
jmp 0x407423
cmp byte [0x4ac37d], 0
je 0x4073ec
cmp dword [0x4ac36c], esi
jbe 0x407423
lea ebx, [ebx]
mov ecx, dword [0x4ac368]
mov eax, dword [ecx + esi*4]
mov edx, dword [0x4ac384]
push eax
push edx
call fcn.00485941
add esp, 8
test eax, eax
je 0x40735d
inc esi
cmp esi, dword [0x4ac36c]
jb 0x4073c0
jmp 0x407423
cmp dword [0x4ac36c], esi
jbe 0x407423
mov edi, dword [sym.imp.KERNEL32.dll_lstrcmpiA]
lea ebx, [ebx]
mov eax, dword [0x4ac368]
mov ecx, dword [eax + esi*4]
mov edx, dword [0x4ac384]
push ecx
push edx
call edi
test eax, eax
je 0x40735d
inc esi
cmp esi, dword [0x4ac36c]
jb 0x407400
mov eax, dword [0x4ac38c]
cmp dword [0x4ac388], eax
jl 0x40743a
mov dword [0x4ac350], 5
mov al, bl
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x174
ret