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

Disassembly:
sub esp, 0x14c
push ebx
push ebp
push esi
mov esi, dword [0x4b0960]
mov bl, dl
mov edx, dword [0x4afae0]
mov dword [esp + 0x18], ecx
push edi
cmp esi, 1
jne 0x40812a
cmp byte [0x4b0990], 0
jne 0x40812a
movzx eax, bl
lea eax, [eax + eax*4]
cmp dword [edx + eax*4], 0
jne 0x40812a
xor cl, cl
jmp 0x40812c
mov cl, 1
cmp byte [esp + 0x164], 0
mov byte [esp + 0x13], cl
je 0x40815d
movzx eax, bl
mov esi, 1
movzx ecx, cl
lea eax, [eax + eax*4]
cmp byte [edx + eax*4 + 8], 0
cmovne ecx, esi
mov al, cl
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x14c
ret
cmp dword [0x4afafc], 0
mov al, byte [esp + 0x168]
je 0x408179
test al, al
jne 0x408179
test cl, cl
je 0x408179
mov bh, 1
jmp 0x40817b
xor bh, bh
mov dl, byte [0x4afac1]
cmp esi, 1
jne 0x40825a
cmp byte [0x4b098e], 0
je 0x40819b
test al, al
jne 0x40825a
mov dh, 1
mov byte [esp + 0x19], dh
cmp bl, 0xe7
je 0x408260
mov eax, dword [0x4b0964]
mov di, word [esp + 0x160]
mov ebp, dword [0x4b0968]
movzx ecx, bl
mov al, byte [ecx + eax]
test al, al
jne 0x4081d5
movzx eax, di
mov al, byte [eax + ebp]
test al, al
je 0x408260
mov cl, al
shr al, 2
shr cl, 1
and al, 1
and cl, 1
je 0x4081f2
test al, al
jne 0x4081fb
test dl, 0x30
jne 0x4081fb
test al, al
je 0x408260
jmp 0x4081f6
test al, al
je 0x4081fb
test dl, 0x30
jne 0x408260
movzx eax, di
mov esi, 4
mov dword [0x4b0960], esi
cmp byte [eax + ebp], 0
mov byte [0x4b0970], bl
setne byte [0x4b0975]
mov word [0x4b0972], di
mov byte [0x4b0974], 0
test cl, cl
je 0x408238
mov byte [0x4b0976], 1
test dl, 0x30
jne 0x40823f
mov byte [0x4b0976], 0
test bh, bh
jne 0x408260
cmp byte [0x4b1c3c], bh
jne 0x408260
mov al, byte [esp + 0x13]
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x14c
ret
xor dh, dh
mov byte [esp + 0x19], dh
movzx eax, bl
mov dword [esp + 0x28], eax
add eax, 0xffffffdf
cmp eax, 0x84
ja case.0x408278.41
movzx eax, byte [eax + 0x408b8c]
jmp dword [eax*4 + 0x408b80]
mov al, 1
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x14c
ret
test bh, bh
je case.0x408278.41
mov ecx, dword [0x4af204]
test ecx, ecx
je 0x4082b1
xor ecx, ecx
mov byte [0x4af210], 0
mov dword [0x4af204], ecx
jmp 0x4082b1
mov ecx, dword [0x4af204]
test dl, dl
je 0x4082e4
cmp esi, 1
jne 0x4082c3
cmp byte [0x4b098f], 0
jne 0x4082e4
cmp dl, 0x10
je 0x4082e4
cmp dl, 0x20
je 0x4082e4
cmp dl, 0x30
je 0x4082e4
test dl, 0xc
je 0x40824b
test dl, 3
je 0x40824b
cmp bl, 8
jne 0x408344
test dl, dl
jne 0x408344
test dh, dh
je 0x408318
cmp esi, 1
jne 0x408318
cmp byte [0x4b098c], dl
je 0x408318
mov edx, dword [0x4b0998]
test edx, edx
je 0x408318
mov eax, dword [0x4b0994]
dec edx
mov dword [0x4b0998], edx
mov byte [eax + edx], 0
test bh, bh
je 0x40832e
test ecx, ecx
je 0x40832e
dec ecx
mov dword [0x4af204], ecx
mov byte [ecx + 0x4af210], 0
mov byte [0x4b1c3c], 0
mov al, byte [esp + 0x13]
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x14c
ret
call dword [sym.imp.USER32.dll_GetForegroundWindow]
mov ebp, eax
mov edx, ebp
call fcn.00413090
push eax
call dword [sym.imp.USER32.dll_GetKeyboardLayout]
mov dword [esp + 0x20], eax
cmp dword [0x4b1c38], ebp
je 0x408398
push 0x1c
lea eax, [esp + 0x40]
mov dword [0x4b1c38], ebp
push eax
push ebp
call dword [sym.imp.USER32.dll_GetClassNameA]
lea eax, [esp + 0x3c]
push str.ApplicationFrameWindow
push eax
call fcn.004855c8
add esp, 8
test eax, eax
sete al
mov byte [0x4b1c34], al
jmp 0x40839d
mov al, byte [0x4b1c34]
cmp byte [0x4b1c3c], 0
lea edi, [esp + 0x58]
mov ecx, 0x40
mov esi, 0x4af9c0
rep movsd dword es:[edi], dword [esi]
mov esi, dword [sym.imp.USER32.dll_ToAsciiEx]
je 0x408437
test al, al
je 0x408437
cmp bl, 0xe7
je 0x408437
mov dl, byte [0x4b1c32]
lea ecx, [esp + 0x58]
mov al, byte [0x4b1c33]
neg dl
sbb dl, dl
and dl, 0x20
neg al
sbb al, al
and al, 9
or dl, al
call fcn.00412ca0
mov edi, dword [esp + 0x20]
lea eax, [esp + 0x14]
push edi
push 0
push eax
lea eax, [esp + 0x64]
push eax
movzx eax, word [0x4b1c30]
push eax
movzx eax, byte [0x4b1c3c]
push eax
call esi
test eax, eax
jle 0x40842e
push edi
push 0
lea eax, [esp + 0x1c]
push eax
lea eax, [esp + 0x64]
push eax
movzx eax, word [0x4b1c30]
push eax
movzx eax, byte [0x4b1c3c]
push eax
call esi
mov byte [0x4b1c3c], 0
jmp 0x40843b
mov edi, dword [esp + 0x20]
mov dl, byte [0x4afac1]
lea ecx, [esp + 0x58]
call fcn.00412ca0
push 0x14
call dword [sym.imp.USER32.dll_GetKeyState]
test al, 1
je 0x40845d
or byte [esp + 0x6c], 1
jmp 0x408462
and byte [esp + 0x6c], 0xfe
cmp bl, 0xe7
jne 0x408493
push 0
push 0
push 3
lea eax, [esp + 0x20]
push eax
push 1
lea eax, [esp + 0x174]
push eax
push 0x400
push 0
call dword [sym.imp.KERNEL32.dll_WideCharToMultiByte]
mov esi, dword [esp + 0x28]
mov edi, dword [esp + 0x1c]
jmp 0x4084bc
mov esi, dword [esp + 0x28]
xor eax, eax
cmp dword [0x4aee94], eax
push edi
mov edi, dword [esp + 0x20]
setne al
push eax
lea eax, [esp + 0x1c]
push eax
lea eax, [esp + 0x64]
push eax
push dword [edi + 4]
push esi
call dword [sym.imp.USER32.dll_ToAsciiEx]
mov dword [esp + 0x24], eax
test eax, eax
je 0x40824b
cmp byte [0x4b1c3c], 0
setne byte [esp + 0x2c]
test eax, eax
jns 0x408549
mov bh, byte [esp + 0x13]
test bh, bh
je 0x40853c
mov eax, dword [esp + 0x160]
mov word [0x4b1c30], ax
mov al, byte [0x4afac1]
test al, 0x30
mov byte [0x4b1c3c], bl
setne byte [0x4b1c32]
test al, 3
je 0x408510
mov byte [0x4b1c33], 1
test al, 0xc
jne 0x408517
mov byte [0x4b1c33], 0
mov eax, dword [esp + 0x20]
push eax
xor eax, eax
cmp dword [0x4aee94], eax
setne al
push eax
lea eax, [esp + 0x1c]
push eax
lea eax, [esp + 0x64]
push eax
push dword [edi + 4]
push esi
call dword [sym.imp.USER32.dll_ToAsciiEx]
mov al, bh
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x14c
ret
test byte [0x4afac1], 3
jne 0x408579
cmp byte [esp + 0x14], 0xd
mov edx, 0xa
movzx ecx, byte [esp + 0x14]
cmove ecx, edx
cmp byte [esp + 0x15], 0xd
mov byte [esp + 0x14], cl
movzx ecx, byte [esp + 0x15]
cmove ecx, edx
mov byte [esp + 0x15], cl
mov byte [esp + 0x1b], 0
test bh, bh
je 0x40890a
cmp ebp, dword [0x4af200]
je 0x40859f
mov dword [0x4af200], ebp
xor ecx, ecx
mov byte [0x4af210], 0
jmp 0x4085eb
mov ecx, dword [0x4af204]
mov eax, 0x5a
sub eax, ecx
cmp eax, 3
jge 0x4085eb
mov ecx, 0x4af23d
lea edx, [ecx + 1]
lea esp, [esp]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x4085c0
sub ecx, edx
mov dword [0x4af204], ecx
lea eax, [ecx + 1]
push eax
push 0x4af23d
push 0x4af210
call fcn.00486480
mov ecx, dword [0x4af204]
add esp, 0xc
mov al, byte [esp + 0x14]
mov ebp, dword [esp + 0x24]
mov byte [ecx + 0x4af210], al
inc ecx
mov dword [0x4af204], ecx
cmp ebp, 1
jle 0x408616
mov al, byte [esp + 0x15]
mov byte [ecx + 0x4af210], al
inc ecx
mov dword [0x4af204], ecx
mov byte [ecx + 0x4af210], 0
test ecx, ecx
je 0x40890e
xor ebx, ebx
mov dword [esp + 0x28], ebx
cmp dword [0x4afb10], ebx
jbe 0x40890e
jmp 0x408640
mov eax, dword [0x4afafc]
mov ebp, dword [eax + ebx*4]
mov dword [esp + 0x38], ebp
cmp byte [ebp + 0x23], 0
jne 0x40872e
cmp byte [ebp + 0x2a], 0
movzx eax, byte [ebp + 0x22]
je 0x408693
cmp ecx, eax
jle 0x40872e
movsx eax, byte [ecx + 0x4af20f]
push eax
push str._____:____.___n__t
call fcn.00486ac4
add esp, 8
test eax, eax
je 0x408728
mov ecx, dword [0x4af204]
lea edi, [ecx + 0x4af20e]
jmp 0x4086a1
cmp ecx, eax
jl 0x40872e
lea edi, [ecx + 0x4af20f]
mov edx, dword [ebp + 8]
movzx eax, byte [ebp + 0x22]
lea esi, [edx - 1]
add esi, eax
cmp byte [ebp + 0x26], 0
je 0x4086c5
cmp esi, edx
jb 0x4086fb
mov al, byte [edi]
cmp al, byte [esi]
jne 0x4086fb
dec esi
dec edi
cmp esi, edx
jae 0x4086b7
jmp 0x4086fb
cmp esi, edx
jb 0x4086fb
lea esp, [esp]
movzx eax, byte [esi]
push eax
call dword [sym.imp.USER32.dll_CharLowerA]
movzx ecx, byte [edi]
mov ebx, eax
push ecx
call dword [sym.imp.USER32.dll_CharLowerA]
cmp al, bl
jne 0x4086f1
dec esi
dec edi
cmp esi, dword [ebp + 8]
jae 0x4086d0
mov ecx, dword [0x4af204]
mov ebx, dword [esp + 0x28]
cmp esi, dword [ebp + 8]
jae 0x40872e
cmp byte [ebp + 0x2b], 0
jne 0x408719
cmp edi, 0x4af210
jb 0x408719
mov cl, byte [edi]
call fcn.00408c20
test al, al
jne 0x408728
mov edx, dword [ebp + 4]
mov ecx, dword [ebp + 0x10]
call fcn.0040ad30
test eax, eax
jne 0x408744
mov ecx, dword [0x4af204]
inc ebx
mov dword [esp + 0x28], ebx
cmp ebx, dword [0x4afb10]
jb 0x408640
jmp 0x40890a
mov eax, dword [esp + 0x16c]
mov edx, dword [esp + 0x1c]
add eax, 4
mov cl, byte [ebp + 0x21]
push eax
mov edx, dword [edx + 0x10]
call fcn.0040b9b0
add esp, 4
test al, al
je 0x40890a
cmp byte [ebp + 0x27], 0
mov edx, dword [0x4af204]
je 0x40887c
cmp byte [ebp + 0x2a], 0
lea ebx, [edx + 0x4af210]
mov dword [esp + 0x34], ebx
je 0x40878e
dec ebx
mov dword [esp + 0x34], ebx
xor eax, eax
mov esi, ebx
mov byte [esp + 0x1a], al
xor ecx, ecx
xor al, al
xor edi, edi
mov dword [esp + 0x1c], eax
movzx eax, byte [ebp + 0x22]
sub esi, eax
mov eax, ebx
sub eax, esi
cmp esi, ebx
cmova eax, ecx
mov dword [esp + 0x30], eax
test eax, eax
je 0x40887c
mov ebx, dword [esp + 0x1c]
xor ebp, ebp
movzx eax, byte [esi]
push eax
call dword [sym.imp.USER32.dll_IsCharLowerA]
test eax, eax
jne 0x4087dd
movzx eax, byte [esi]
push eax
call dword [sym.imp.USER32.dll_IsCharUpperA]
test eax, eax
je 0x408801
cmp byte [esp + 0x1a], 0
jne 0x408800
movzx eax, byte [esi]
push eax
mov byte [esp + 0x1e], 1
call dword [sym.imp.USER32.dll_IsCharUpperA]
test eax, eax
movzx ebx, bl
mov eax, 1
cmovne ebx, eax
inc ebp
inc edi
inc esi
cmp edi, dword [esp + 0x30]
jb 0x4087c1
mov dword [esp + 0x1c], ebx
test ebp, ebp
mov ebx, dword [esp + 0x34]
mov dword [esp + 0x30], ebp
mov ebp, dword [esp + 0x38]
je 0x408876
cmp dword [esp + 0x30], 1
mov eax, dword [esp + 0x1c]
jne 0x40883c
mov edx, dword [0x4af204]
xor edi, edi
test al, al
mov ecx, 2
cmovne edi, ecx
jmp 0x40887e
test al, al
je 0x408876
movzx eax, byte [ebp + 0x22]
mov esi, ebx
sub esi, eax
mov edi, 2
cmp esi, ebx
jae 0x408866
movzx eax, byte [esi]
push eax
call dword [sym.imp.USER32.dll_IsCharLowerA]
test eax, eax
jne 0x408864
inc esi
cmp esi, ebx
jb 0x408851
cmp esi, ebx
mov edx, dword [0x4af204]
mov eax, 1
cmove edi, eax
jmp 0x40887e
mov edx, dword [0x4af204]
xor edi, edi
mov bh, byte [ebp + 0x28]
test bh, bh
jne 0x40888a
cmp byte [ebp + 0x29], bh
je 0x408894
mov byte [esp + 0x13], 0
mov byte [esp + 0x1b], 1
mov eax, dword [esp + 0x170]
mov bl, byte [ebp + 0x2a]
mov ecx, dword [esp + 0x28]
mov dword [eax], ecx
test bl, bl
je 0x4088b1
movsx eax, byte [edx + 0x4af20f]
jmp 0x4088b3
xor eax, eax
movzx ecx, di
shl ecx, 0x10
movzx eax, ax
or ecx, eax
cmp dword [ebp + 0xc], 0
mov eax, dword [esp + 0x174]
mov dword [eax], ecx
je 0x4088e7
test bl, bl
je 0x4088e3
mov al, byte [edx + 0x4af20f]
mov edx, 1
mov byte [0x4af210], al
jmp 0x4088f6
xor edx, edx
jmp 0x4088f6
test bh, bh
je 0x4088f6
movzx eax, byte [ebp + 0x22]
sub edx, eax
test bl, bl
je 0x4088f6
dec edx
xor eax, eax
cmp byte [ebp + 0x2c], al
cmovne edx, eax
mov dword [0x4af204], edx
mov byte [edx + 0x4af210], al
mov ebp, dword [esp + 0x24]
cmp byte [esp + 0x2c], 0
mov bl, byte [esp + 0x13]
je 0x408982
test bl, bl
je 0x408982
push 0x100
lea eax, [esp + 0x5c]
push 0
push eax
call fcn.0048fd00
mov dl, byte [0x4b1c32]
lea ecx, [esp + 0x64]
mov al, byte [0x4b1c33]
add esp, 0xc
neg dl
sbb dl, dl
and dl, 0x20
neg al
sbb al, al
and al, 9
or dl, al
call fcn.00412ca0
mov eax, dword [esp + 0x20]
push eax
push 0
lea eax, [esp + 0x34]
push eax
lea eax, [esp + 0x64]
push eax
movzx eax, word [0x4b1c30]
push eax
movzx eax, byte [0x4b1c3c]
push eax
call dword [sym.imp.USER32.dll_ToAsciiEx]
mov byte [0x4b1c3c], 0
cmp byte [esp + 0x19], 0
je 0x408b70
cmp dword [0x4b0960], 1
jne 0x408b70
cmp byte [esp + 0x1b], 0
jne 0x408b70
xor esi, esi
test ebp, ebp
jle 0x408a1b
jmp 0x4089b0
lea edi, [esp + 0x14]
add edi, esi
cmp byte [0x4b098d], 0
je 0x4089d3
movzx eax, byte [edi]
push eax
push dword [0x4b096c]
call fcn.00486ac4
add esp, 8
jmp 0x4089e0
mov dl, byte [edi]
mov ecx, dword [0x4b096c]
call fcn.004730c0
test eax, eax
jne 0x408a68
mov edx, dword [0x4b0998]
cmp edx, dword [0x4b099c]
je 0x408a1b
mov eax, dword [0x4b0994]
inc esi
mov cl, byte [edi]
mov byte [eax + edx], cl
mov ecx, dword [0x4b0998]
mov eax, dword [0x4b0994]
inc ecx
mov dword [0x4b0998], ecx
mov byte [eax + ecx], 0
cmp esi, ebp
jl 0x4089b0
xor esi, esi
cmp byte [0x4b0991], 0
je 0x408ad6
cmp byte [0x4b098d], 0
je 0x408a9f
cmp dword [0x4b097c], esi
jbe 0x408b51
nop
mov eax, dword [0x4b0978]
push dword [eax + esi*4]
push dword [0x4b0994]
call fcn.00486b76
add esp, 8
test eax, eax
jne 0x408a88
inc esi
cmp esi, dword [0x4b097c]
jb 0x408a40
jmp 0x408b51
mov al, byte [esp + esi + 0x14]
mov byte [0x4b0974], al
mov al, bl
mov dword [0x4b0960], 4
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x14c
ret
mov dword [0x4b0960], 3
mov al, bl
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x14c
ret
cmp dword [0x4b097c], esi
jbe 0x408b51
jmp 0x408ab0
mov edx, dword [0x4b0978]
mov ecx, dword [0x4b0994]
mov edx, dword [edx + esi*4]
call fcn.00473110
test eax, eax
jne 0x408a88
inc esi
cmp esi, dword [0x4b097c]
jb 0x408ab0
jmp 0x408b51
cmp byte [0x4b098d], 0
je 0x408b19
cmp dword [0x4b097c], esi
jbe 0x408b51
jmp 0x408af0
mov eax, dword [0x4b0978]
push dword [eax + esi*4]
push dword [0x4b0994]
call fcn.004858ec
add esp, 8
test eax, eax
je 0x408a88
inc esi
cmp esi, dword [0x4b097c]
jb 0x408af0
jmp 0x408b51
cmp dword [0x4b097c], esi
jbe 0x408b51
mov edi, dword [sym.imp.KERNEL32.dll_lstrcmpiA]
jmp 0x408b30
mov eax, dword [0x4b0978]
push dword [eax + esi*4]
push dword [0x4b0994]
call edi
test eax, eax
je 0x408a88
inc esi
cmp esi, dword [0x4b097c]
jb 0x408b30
mov eax, dword [0x4b0998]
mov edx, 5
mov ecx, dword [0x4b0960]
cmp eax, dword [0x4b099c]
cmovge ecx, edx
mov dword [0x4b0960], ecx
pop edi
pop esi
pop ebp
mov al, bl
pop ebx
add esp, 0x14c
ret