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

Disassembly:
mov ecx, dword [0x4aab60]
sub esp, 0x120
push ebx
mov bl, byte [esp + 0x12c]
push ebp
mov ebp, dword [0x4ac250]
push esi
push edi
mov di, word [esp + 0x13c]
cmp ebp, 1
jne 0x406d57
cmp byte [0x4ac280], 0
jne 0x406d57
movzx eax, bl
lea eax, [eax + eax*8]
shl eax, 5
cmp dword [eax + ecx], 0
mov byte [esp + 0x12], 0
je 0x406d5c
mov byte [esp + 0x12], 1
cmp byte [esp + 0x140], 0
je 0x406d8b
movzx eax, bl
lea edx, [eax + eax*8]
shl edx, 5
cmp byte [edx + ecx + 4], 0
mov al, 1
jne 0x4076ff
mov al, byte [esp + 0x12]
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x120
ret
cmp dword [0x4abb28], 0
je 0x406da3
test dl, dl
jne 0x406da3
mov byte [esp + 0x13], 1
cmp byte [esp + 0x12], dl
jne 0x406da8
mov byte [esp + 0x13], 0
mov al, byte [0x4aa22d]
cmp ebp, 1
jne 0x406e89
cmp byte [0x4ac27e], 0
je 0x406dc7
test dl, dl
jne 0x406e89
mov byte [esp + 0x19], 1
cmp bl, 0xe7
je 0x406e68
mov edx, dword [0x4ac254]
mov esi, dword [0x4ac258]
movzx ecx, bl
mov cl, byte [ecx + edx]
test cl, cl
jne 0x406df5
movzx ecx, di
mov cl, byte [ecx + esi]
test cl, cl
je 0x406e68
mov dl, cl
shr cl, 2
shr dl, 1
and cl, 1
and dl, 1
je 0x406e90
test cl, cl
jne 0x406e18
test al, 0x30
jne 0x406e18
test cl, cl
je 0x406e68
test al, 0x30
jne 0x406e68
movzx ecx, di
mov ebp, 4
mov dword [0x4ac250], ebp
cmp byte [ecx + esi], 0
mov byte [0x4ac260], bl
setne cl
mov byte [0x4ac265], cl
mov word [0x4ac262], di
mov byte [0x4ac264], 0
test dl, dl
je 0x406e56
mov byte [0x4ac266], 1
test al, 0x30
jne 0x406e5d
mov byte [0x4ac266], 0
cmp byte [esp + 0x13], 0
je 0x4076fb
movzx ebx, byte [esp + 0x138]
lea ecx, [ebx - 0x21]
cmp ecx, 0x84
ja case.0x406e82.41
movzx edx, byte [ecx + 0x407718]
jmp dword [edx*4 + 0x40770c]
mov byte [esp + 0x19], 0
jmp 0x406e68
test cl, cl
je 0x406e18
jmp 0x406e14
mov al, 1
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x120
ret
cmp byte [esp + 0x13], 0
je case.0x406e82.41
mov ecx, dword [0x4a8fd4]
test ecx, ecx
je 0x406ece
xor ecx, ecx
mov byte [0x4a8fd8], 0
mov dword [0x4a8fd4], ecx
jmp 0x406ece
mov ecx, dword [0x4a8fd4]
test al, al
je 0x406ef8
cmp ebp, 1
jne 0x406ee0
cmp byte [0x4ac27f], 0
jne 0x406ef8
cmp al, 0x10
je 0x406ef8
cmp al, 0x20
je 0x406ef8
test al, 0xc
je 0x4076fb
test al, 3
je 0x4076fb
cmp byte [esp + 0x138], 8
jne 0x406f6e
test al, al
jne 0x406f6e
cmp byte [esp + 0x19], al
je 0x406f32
cmp ebp, 1
jne 0x406f32
cmp byte [0x4ac27c], al
je 0x406f32
mov eax, dword [0x4ac288]
test eax, eax
je 0x406f32
mov edx, dword [0x4ac284]
dec eax
mov dword [0x4ac288], eax
mov byte [edx + eax], 0
cmp byte [esp + 0x13], 0
je 0x406f4b
test ecx, ecx
je 0x406f4b
dec ecx
mov dword [0x4a8fd4], ecx
mov byte [ecx + 0x4a8fd8], 0
cmp byte [0x4aca88], 0
je 0x4076fb
mov byte [0x4aca88], 0
mov al, byte [esp + 0x12]
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x120
ret
mov ecx, 0x40
mov esi, 0x4aa250
lea edi, [esp + 0x30]
rep movsd dword es:[edi], dword [esi]
lea ecx, [esp + 0x30]
call fcn.004115a0
push 0x14
call dword [sym.imp.USER32.dll_GetKeyState]
test al, 1
je 0x406f9a
or byte [esp + 0x44], 1
jmp 0x406f9f
and byte [esp + 0x44], 0xfe
call dword [sym.imp.USER32.dll_GetForegroundWindow]
mov ebp, eax
test ebp, ebp
je 0x406fb6
push 0
push ebp
call dword [sym.imp.USER32.dll_GetWindowThreadProcessId]
jmp 0x406fb8
xor eax, eax
push eax
call dword [sym.imp.USER32.dll_GetKeyboardLayout]
cmp byte [esp + 0x138], 0xe7
mov edi, dword [sym.imp.USER32.dll_ToAsciiEx]
mov esi, eax
mov dword [esp + 0x2c], esi
lea eax, [esp + 0x14]
jne 0x406ff9
push 0
push 0
push 3
push eax
push 1
lea ecx, [esp + 0x150]
push ecx
push 0x400
push 0
call dword [sym.imp.KERNEL32.dll_WideCharToMultiByte]
jmp 0x40701a
xor edx, edx
cmp dword [0x4aa3bc], edx
push esi
setne dl
lea ecx, [esp + 0x34]
push edx
mov edx, dword [esp + 0x13c]
push eax
mov eax, dword [edx + 4]
push ecx
push eax
push ebx
call edi
mov dword [esp + 0x28], eax
test eax, eax
je 0x4076fb
cmp byte [0x4aca88], 0
mov cl, byte [esp + 0x138]
je 0x407045
cmp cl, 9
je 0x407045
mov byte [esp + 0x1c], 1
cmp cl, 0x1b
jne 0x40704a
mov byte [esp + 0x1c], 0
test eax, eax
jns 0x4070c8
cmp byte [esp + 0x12], 0
je 0x4076fb
mov al, byte [0x4aa22d]
test al, 0x30
mov byte [0x4aca88], cl
mov cx, word [esp + 0x13c]
setne dl
mov word [0x4aca8c], cx
mov byte [0x4aca8e], dl
test al, 3
je 0x40708d
mov byte [0x4aca8f], 1
test al, 0xc
jne 0x407094
mov byte [0x4aca8f], 0
xor eax, eax
cmp dword [0x4aa3bc], eax
push esi
setne al
lea ecx, [esp + 0x18]
lea edx, [esp + 0x34]
push eax
mov eax, dword [esp + 0x13c]
push ecx
mov ecx, dword [eax + 4]
push edx
push ecx
push ebx
call edi
mov al, byte [esp + 0x12]
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x120
ret
test byte [0x4aa22d], 3
jne 0x4070e9
mov cl, 0xd
mov al, 0xa
cmp byte [esp + 0x14], cl
jne 0x4070df
mov byte [esp + 0x14], al
cmp byte [esp + 0x15], cl
jne 0x4070e9
mov byte [esp + 0x15], al
cmp byte [esp + 0x13], 0
mov byte [esp + 0x1a], 0
je 0x407495
cmp ebp, dword [0x4a8fd0]
je 0x407112
mov dword [0x4a8fd0], ebp
mov byte [0x4a8fd8], 0
xor ecx, ecx
jmp 0x407158
mov ecx, dword [0x4a8fd4]
mov edx, 0x5a
sub edx, ecx
cmp edx, 3
jge 0x407158
mov eax, 0x4a9005
lea edx, [eax + 1]
lea esp, [esp]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x407130
sub eax, edx
mov dword [0x4a8fd4], eax
inc eax
push eax
push 0x4a9005
push 0x4a8fd8
call fcn.004859c0
mov ecx, dword [0x4a8fd4]
add esp, 0xc
mov al, byte [esp + 0x14]
mov byte [ecx + 0x4a8fd8], al
inc ecx
cmp dword [esp + 0x28], 1
mov dword [0x4a8fd4], ecx
jle 0x407181
mov dl, byte [esp + 0x15]
mov byte [ecx + 0x4a8fd8], dl
inc ecx
mov dword [0x4a8fd4], ecx
mov byte [ecx + 0x4a8fd8], 0
test ecx, ecx
je 0x407495
cmp dword [0x4abb2c], 0
mov dword [esp + 0x24], 0
jbe 0x407495
jmp 0x4071b0
mov eax, dword [0x4abb28]
mov edx, dword [esp + 0x24]
mov ebp, dword [eax + edx*4]
cmp byte [ebp + 0x1e], 0
jne 0x4072b7
cmp byte [ebp + 0x26], 0
je 0x407203
movzx eax, byte [ebp + 0x1d]
cmp ecx, eax
jle 0x4072b7
movsx eax, byte [ecx + 0x4a8fd7]
push eax
push str._____:____.___n__t
call fcn.00485dd1
add esp, 8
test eax, eax
je 0x4072b1
mov ecx, dword [0x4a8fd4]
lea edi, [ecx + 0x4a8fd6]
jmp 0x407215
movzx edx, byte [ebp + 0x1d]
cmp ecx, edx
jl 0x4072b7
lea edi, [ecx + 0x4a8fd7]
cmp byte [ebp + 0x21], 0
movzx edx, byte [ebp + 0x1d]
mov eax, dword [ebp + 4]
lea esi, [edx + eax - 1]
je 0x40723e
cmp esi, eax
jb 0x40726d
lea ebx, [ebx]
mov dl, byte [edi]
cmp dl, byte [esi]
jne 0x40726d
dec esi
dec edi
cmp esi, eax
jae 0x407230
jmp 0x40726d
cmp esi, eax
jb 0x40726d
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 0x407267
dec esi
dec edi
cmp esi, dword [ebp + 4]
jae 0x407242
mov ecx, dword [0x4a8fd4]
cmp esi, dword [ebp + 4]
jae 0x4072b7
cmp byte [ebp + 0x27], 0
jne 0x407290
cmp edi, 0x4a8fd8
jb 0x407290
movzx edx, byte [edi]
push edx
call fcn.004077a0
add esp, 4
test al, al
jne 0x4072b1
mov eax, dword [ebp]
test eax, eax
je 0x40729c
mov eax, dword [eax + 4]
jmp 0x4072a1
mov eax, 0x498861
mov esi, dword [ebp + 0xc]
push eax
call fcn.004096e0
add esp, 4
test eax, eax
jne 0x4072d1
mov ecx, dword [0x4a8fd4]
mov eax, dword [esp + 0x24]
inc eax
mov dword [esp + 0x24], eax
cmp eax, dword [0x4abb2c]
jb 0x4071b0
jmp 0x407495
movzx eax, byte [ebp + 0x1c]
mov edx, dword [esp + 0x134]
mov ecx, dword [esp + 0x144]
push eax
mov eax, dword [edx + 0x10]
add ecx, 4
call fcn.0040a1e0
add esp, 4
test al, al
je 0x407495
cmp byte [ebp + 0x22], 0
jne 0x407307
xor edi, edi
jmp 0x4073dc
cmp byte [ebp + 0x26], 0
mov ebx, dword [0x4a8fd4]
lea ebx, [ebx + 0x4a8fd8]
je 0x40731a
dec ebx
movzx eax, byte [ebp + 0x1d]
mov esi, ebx
sub esi, eax
mov dword [esp + 0x20], 0
mov byte [esp + 0x1b], 0
mov byte [esp + 0x13], 0
cmp esi, ebx
jae 0x407384
mov edi, dword [sym.imp.USER32.dll_IsCharUpperA]
mov edi, edi
movzx ecx, byte [esi]
push ecx
call dword [sym.imp.USER32.dll_IsCharLowerA]
test eax, eax
jne 0x407358
movzx edx, byte [esi]
push edx
call edi
test eax, eax
je 0x407377
cmp byte [esp + 0x1b], 0
jne 0x407373
movzx eax, byte [esi]
push eax
mov byte [esp + 0x1f], 1
call edi
test eax, eax
je 0x407373
mov byte [esp + 0x13], 1
inc dword [esp + 0x20]
inc esi
cmp esi, ebx
jb 0x407340
mov eax, dword [esp + 0x20]
test eax, eax
jne 0x407388
xor edi, edi
jmp 0x4073dc
cmp eax, 1
jne 0x40739b
movzx edi, byte [esp + 0x13]
neg edi
sbb edi, edi
and edi, 2
jmp 0x4073dc
cmp byte [esp + 0x13], 0
jne 0x4073a6
xor edi, edi
jmp 0x4073dc
movzx ecx, byte [ebp + 0x1d]
mov esi, ebx
sub esi, ecx
mov edi, 2
cmp esi, ebx
jae 0x4073d5
jmp 0x4073c0
movzx edx, byte [esi]
push edx
call dword [sym.imp.USER32.dll_IsCharLowerA]
test eax, eax
jne 0x4073d3
inc esi
cmp esi, ebx
jb 0x4073c0
cmp esi, ebx
jne 0x4073dc
mov edi, 1
mov dl, byte [ebp + 0x23]
test dl, dl
jne 0x4073e8
cmp byte [ebp + 0x24], dl
je 0x4073f2
mov byte [esp + 0x12], 0
mov byte [esp + 0x1a], 1
mov eax, dword [esp + 0x148]
mov ecx, dword [esp + 0x24]
mov dword [eax], ecx
mov al, byte [ebp + 0x26]
test al, al
je 0x407415
mov ecx, dword [0x4a8fd4]
movsx ecx, byte [ecx + 0x4a8fd7]
jmp 0x407417
xor ecx, ecx
movzx esi, di
movzx ecx, cx
shl esi, 0x10
or esi, ecx
mov ecx, dword [esp + 0x14c]
mov dword [ecx], esi
mov ecx, dword [ebp + 8]
cmp byte [ecx], 0
je 0x407460
test al, al
je 0x407454
mov edx, dword [0x4a8fd4]
mov al, byte [edx + 0x4a8fd7]
mov byte [0x4a8fd8], al
mov dword [0x4a8fd4], 1
jmp 0x407478
mov dword [0x4a8fd4], 0
jmp 0x407478
test dl, dl
je 0x407478
movzx ecx, byte [ebp + 0x1d]
sub dword [0x4a8fd4], ecx
test al, al
je 0x407478
dec dword [0x4a8fd4]
cmp byte [ebp + 0x28], 0
je 0x407488
mov dword [0x4a8fd4], 0
mov edx, dword [0x4a8fd4]
mov byte [edx + 0x4a8fd8], 0
cmp byte [esp + 0x1c], 0
je 0x407506
cmp byte [esp + 0x12], 0
mov bl, byte [0x4aca88]
mov byte [0x4aca88], 0
je 0x407506
push 0x100
lea eax, [esp + 0x34]
push 0
push eax
call fcn.0048e2b0
mov al, byte [0x4aca8e]
mov cl, byte [0x4aca8f]
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 + 0x30]
call fcn.004115a0
mov edx, dword [esp + 0x2c]
push edx
movzx edx, word [0x4aca8c]
push 0
lea eax, [esp + 0x24]
push eax
push ecx
movzx eax, bl
push edx
push eax
call dword [sym.imp.USER32.dll_ToAsciiEx]
cmp byte [esp + 0x19], 0
je 0x4076fb
cmp dword [0x4ac250], 1
jne 0x4076fb
cmp byte [esp + 0x1a], 0
jne 0x4076fb
mov edi, dword [esp + 0x28]
xor esi, esi
test edi, edi
jle 0x4075a5
jmp 0x407540
cmp byte [0x4ac27d], 0
mov ecx, dword [0x4ac25c]
je 0x407560
movzx eax, byte [esp + esi + 0x14]
push eax
push ecx
call fcn.00485dd1
add esp, 8
jmp 0x407569
mov al, byte [esp + esi + 0x14]
call fcn.004725a0
test eax, eax
jne 0x4075fb
mov eax, dword [0x4ac288]
cmp eax, dword [0x4ac28c]
je 0x4075a5
mov dl, byte [esp + esi + 0x14]
mov ecx, dword [0x4ac284]
mov byte [ecx + eax], dl
mov eax, dword [0x4ac288]
mov edx, dword [0x4ac284]
inc eax
inc esi
mov dword [0x4ac288], eax
mov byte [edx + eax], 0
cmp esi, edi
jl 0x407540
xor esi, esi
cmp byte [0x4ac281], 0
je 0x407668
cmp byte [0x4ac27d], 0
je 0x407637
cmp dword [0x4ac26c], esi
jbe 0x4076e3
lea esp, [esp]
mov ecx, dword [0x4ac268]
mov eax, dword [ecx + esi*4]
mov edx, dword [0x4ac284]
push eax
push edx
call fcn.00485f12
add esp, 8
test eax, eax
jne 0x40761e
inc esi
cmp esi, dword [0x4ac26c]
jb 0x4075d0
jmp 0x4076e3
movzx eax, byte [esp + esi + 0x14]
mov byte [0x4ac264], al
mov al, byte [esp + 0x12]
mov dword [0x4ac250], 4
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x120
ret
mov dword [0x4ac250], 3
mov al, byte [esp + 0x12]
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x120
ret
cmp dword [0x4ac26c], esi
jbe 0x4076e3
mov eax, dword [0x4ac268]
mov ecx, dword [eax + esi*4]
mov eax, dword [0x4ac284]
push ecx
call fcn.004725f0
add esp, 4
test eax, eax
jne 0x40761e
inc esi
cmp esi, dword [0x4ac26c]
jb 0x407643
jmp 0x4076e3
cmp byte [0x4ac27d], 0
je 0x4076a7
cmp dword [0x4ac26c], esi
jbe 0x4076e3
lea esp, [esp]
mov edx, dword [0x4ac268]
mov eax, dword [edx + esi*4]
push eax
mov eax, dword [0x4ac284]
push eax
call fcn.00484f31
add esp, 8
test eax, eax
je 0x40761e
inc esi
cmp esi, dword [0x4ac26c]
jb 0x407680
jmp 0x4076e3
cmp dword [0x4ac26c], esi
jbe 0x4076e3
mov edi, dword [sym.imp.KERNEL32.dll_lstrcmpiA]
jmp 0x4076c0
mov ecx, dword [0x4ac268]
mov edx, dword [ecx + esi*4]
mov eax, dword [0x4ac284]
push edx
push eax
call edi
test eax, eax
je 0x40761e
inc esi
cmp esi, dword [0x4ac26c]
jb 0x4076c0
mov ecx, dword [0x4ac28c]
cmp dword [0x4ac288], ecx
jl 0x4076fb
mov dword [0x4ac250], 5
mov al, byte [esp + 0x12]
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x120
ret