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

Disassembly:
mov ecx, dword [0x4c7edc]
sub esp, 0x120
push ebx
mov bl, byte [esp + 0x12c]
push ebp
mov bp, word [esp + 0x134]
push edi
mov edi, dword [0x4c95f0]
cmp edi, 1
jne 0x406f96
cmp byte [0x4c9620], 0
jne 0x406f96
movzx eax, bl
lea eax, [eax + eax*8]
shl eax, 5
cmp dword [eax + ecx], 0
mov byte [esp + 0xe], 0
je 0x406f9b
mov byte [esp + 0xe], 1
cmp byte [esp + 0x13c], 0
je 0x406fc9
movzx eax, bl
lea edx, [eax + eax*8]
shl edx, 5
cmp byte [edx + ecx + 4], 0
mov al, 1
jne 0x4079b0
mov al, byte [esp + 0xe]
pop edi
pop ebp
pop ebx
add esp, 0x120
ret
cmp dword [0x4c8ea4], 0
je 0x406fe1
test dl, dl
jne 0x406fe1
mov byte [esp + 0xf], 1
cmp byte [esp + 0xe], dl
jne 0x406fe6
mov byte [esp + 0xf], 0
mov al, byte [0x4c74a5]
push esi
cmp edi, 1
jne 0x4070c8
cmp byte [0x4c961e], 0
je 0x407006
test dl, dl
jne 0x4070c8
mov byte [esp + 0x14], 1
cmp bl, 0xe7
je 0x4070a7
mov edx, dword [0x4c95f4]
mov esi, dword [0x4c95f8]
movzx ecx, bl
mov cl, byte [ecx + edx]
test cl, cl
jne 0x407034
movzx ecx, bp
mov cl, byte [ecx + esi]
test cl, cl
je 0x4070a7
mov dl, cl
shr cl, 2
shr dl, 1
and cl, 1
and dl, 1
je 0x4070cf
test cl, cl
jne 0x407057
test al, 0x30
jne 0x407057
test cl, cl
je 0x4070a7
test al, 0x30
jne 0x4070a7
movzx ecx, bp
mov edi, 4
mov dword [0x4c95f0], edi
cmp byte [ecx + esi], 0
mov byte [0x4c9600], bl
setne cl
mov byte [0x4c9606], cl
xor ecx, ecx
mov word [0x4c9602], bp
mov word [0x4c9604], cx
test dl, dl
je 0x407097
mov byte [0x4c9607], 1
test al, 0x30
jne 0x40709d
mov byte [0x4c9607], cl
cmp byte [esp + 0x13], cl
je 0x4079ab
movzx ebx, byte [esp + 0x138]
lea ecx, [ebx - 0x21]
cmp ecx, 0x84
ja case.0x4070c1.41
movzx edx, byte [ecx + 0x4079c8]
jmp dword [edx*4 + 0x4079bc]
mov byte [esp + 0x14], 0
jmp 0x4070a7
test cl, cl
je 0x407057
jmp 0x407053
pop esi
pop edi
pop ebp
mov al, 1
pop ebx
add esp, 0x120
ret
cmp byte [esp + 0x13], 0
je case.0x4070c1.41
mov ecx, dword [0x4c61f4]
test ecx, ecx
je 0x40710d
xor ecx, ecx
mov word [0x4c61f8], cx
mov dword [0x4c61f4], ecx
jmp 0x40710d
mov ecx, dword [0x4c61f4]
test al, al
je 0x407137
cmp edi, 1
jne 0x40711f
cmp byte [0x4c961f], 0
jne 0x407137
cmp al, 0x10
je 0x407137
cmp al, 0x20
je 0x407137
test al, 0xc
je 0x4079ab
test al, 3
je 0x4079ab
cmp byte [esp + 0x138], 8
jne 0x4071b2
test al, al
jne 0x4071b2
cmp byte [esp + 0x14], al
je 0x407173
cmp edi, 1
jne 0x407173
cmp byte [0x4c961c], al
je 0x407173
mov eax, dword [0x4c9628]
test eax, eax
je 0x407173
mov esi, dword [0x4c9624]
dec eax
xor edx, edx
mov dword [0x4c9628], eax
mov word [esi + eax*2], dx
cmp byte [esp + 0x13], 0
je 0x40718f
test ecx, ecx
je 0x40718f
dec ecx
xor eax, eax
mov dword [0x4c61f4], ecx
mov word [ecx*2 + 0x4c61f8], ax
cmp byte [0x4ca2e0], 0
je 0x4079ab
mov al, byte [esp + 0x12]
pop esi
pop edi
pop ebp
mov byte [0x4ca2e0], 0
pop ebx
add esp, 0x120
ret
mov ecx, 0x40
mov esi, 0x4c74c8
lea edi, [esp + 0x30]
rep movsd dword es:[edi], dword [esi]
lea ecx, [esp + 0x30]
call fcn.00411a90
push 0x14
call dword [sym.imp.USER32.dll_GetKeyState]
test al, 1
je 0x4071de
or byte [esp + 0x44], 1
jmp 0x4071e3
and byte [esp + 0x44], 0xfe
call dword [sym.imp.USER32.dll_GetForegroundWindow]
mov ebp, eax
test ebp, ebp
je 0x4071fa
push 0
push ebp
call dword [sym.imp.USER32.dll_GetWindowThreadProcessId]
jmp 0x4071fc
xor eax, eax
push eax
call dword [sym.imp.USER32.dll_GetKeyboardLayout]
cmp byte [esp + 0x138], 0xe7
mov edi, dword [sym.imp.USER32.dll_ToUnicodeEx]
mov esi, eax
mov dword [esp + 0x2c], esi
jne 0x407231
mov cx, word [esp + 0x13c]
mov eax, 1
mov dword [esp + 0x28], eax
mov word [esp + 0x18], cx
jmp 0x407264
xor edx, edx
cmp dword [0x4c7634], edx
push esi
setne dl
lea eax, [esp + 0x1c]
lea ecx, [esp + 0x34]
push edx
mov edx, dword [esp + 0x13c]
push 2
push eax
mov eax, dword [edx + 4]
push ecx
push eax
push ebx
call edi
mov dword [esp + 0x28], eax
test eax, eax
je 0x4079ab
cmp byte [0x4ca2e0], 0
mov cl, byte [esp + 0x138]
je 0x407283
cmp cl, 9
je 0x407283
mov byte [esp + 0x17], 1
cmp cl, 0x1b
jne 0x407288
mov byte [esp + 0x17], 0
test eax, eax
jns 0x407308
cmp byte [esp + 0x12], 0
je 0x4079ab
mov al, byte [0x4c74a5]
test al, 0x30
mov byte [0x4ca2e0], cl
mov cx, word [esp + 0x13c]
setne dl
mov word [0x4ca2e4], cx
mov byte [0x4ca2e6], dl
test al, 3
je 0x4072cb
mov byte [0x4ca2e7], 1
test al, 0xc
jne 0x4072d2
mov byte [0x4ca2e7], 0
xor eax, eax
cmp dword [0x4c7634], eax
push esi
setne al
lea ecx, [esp + 0x1c]
lea edx, [esp + 0x34]
push eax
mov eax, dword [esp + 0x13c]
push 2
push ecx
mov ecx, dword [eax + 4]
push edx
push ecx
push ebx
call edi
mov al, byte [esp + 0x12]
pop esi
pop edi
pop ebp
pop ebx
add esp, 0x120
ret
test byte [0x4c74a5], 3
jne 0x407338
mov eax, 0xd
cmp word [esp + 0x18], ax
jne 0x407327
mov edx, 0xa
mov word [esp + 0x18], dx
cmp word [esp + 0x1a], ax
jne 0x407338
mov eax, 0xa
mov word [esp + 0x1a], ax
cmp byte [esp + 0x13], 0
mov byte [esp + 0x15], 0
je 0x407716
cmp ebp, dword [0x4c61f0]
je 0x407361
xor ecx, ecx
mov dword [0x4c61f0], ebp
mov word [0x4c61f8], cx
jmp 0x4073b1
mov ecx, dword [0x4c61f4]
mov edx, 0x5a
sub edx, ecx
cmp edx, 3
jge 0x4073b1
mov eax, 0x4c6252
lea edx, [eax + 2]
jmp 0x407380
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x407380
sub eax, edx
sar eax, 1
mov dword [0x4c61f4], eax
lea eax, [eax + eax + 2]
push eax
push 0x4c6252
push 0x4c61f8
call fcn.0048dd80
mov ecx, dword [0x4c61f4]
add esp, 0xc
mov dx, word [esp + 0x18]
mov word [ecx*2 + 0x4c61f8], dx
inc ecx
cmp dword [esp + 0x28], 1
mov dword [0x4c61f4], ecx
jle 0x4073e0
mov ax, word [esp + 0x1a]
mov word [ecx*2 + 0x4c61f8], ax
inc ecx
mov dword [0x4c61f4], ecx
xor edx, edx
mov word [ecx*2 + 0x4c61f8], dx
test ecx, ecx
je 0x407716
mov dword [esp + 0x24], edx
cmp dword [0x4c8ea8], edx
jbe 0x407716
mov ebx, dword [sym.imp.USER32.dll_CharLowerW]
jmp 0x407410
mov eax, dword [0x4c8ea4]
mov edx, dword [esp + 0x24]
mov ebp, dword [eax + edx*4]
cmp byte [ebp + 0x1e], 0
jne 0x407530
cmp byte [ebp + 0x26], 0
je 0x407465
movzx eax, byte [ebp + 0x1d]
cmp ecx, eax
jle 0x407530
movzx eax, word [ecx*2 + 0x4c61f6]
push eax
push str._____:____.___n__t
call fcn.0048e0e1
add esp, 8
test eax, eax
je 0x40752a
mov ecx, dword [0x4c61f4]
lea edi, [ecx*2 + 0x4c61f4]
jmp 0x407478
movzx edx, byte [ebp + 0x1d]
cmp ecx, edx
jl 0x407530
lea edi, [ecx*2 + 0x4c61f6]
cmp byte [ebp + 0x21], 0
movzx edx, byte [ebp + 0x1d]
mov eax, dword [ebp + 4]
lea esi, [eax + edx*2 - 2]
je 0x4074a4
cmp esi, eax
jb 0x4074e6
lea ecx, [ecx]
mov dx, word [edi]
cmp dx, word [esi]
jne 0x4074e6
sub esi, 2
sub edi, 2
cmp esi, eax
jae 0x407490
jmp 0x4074e6
cmp esi, eax
jb 0x4074e6
jmp 0x4074b6
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 0x4074da
sub esi, 2
sub edi, 2
cmp esi, dword [ebp + 4]
jae 0x4074b0
mov ecx, dword [0x4c61f4]
mov ebx, dword [sym.imp.USER32.dll_CharLowerW]
cmp esi, dword [ebp + 4]
jae 0x407530
cmp byte [ebp + 0x27], 0
jne 0x407509
cmp edi, 0x4c61f8
jb 0x407509
movzx edx, word [edi]
push edx
call fcn.00407a50
add esp, 4
test al, al
jne 0x40752a
mov eax, dword [ebp]
test eax, eax
je 0x407515
mov eax, dword [eax + 4]
jmp 0x40751a
mov eax, 0x4a0850
mov esi, dword [ebp + 0xc]
push eax
call fcn.004099d0
add esp, 4
test eax, eax
jne 0x40754a
mov ecx, dword [0x4c61f4]
mov eax, dword [esp + 0x24]
inc eax
mov dword [esp + 0x24], eax
cmp eax, dword [0x4c8ea8]
jb 0x407410
jmp 0x407716
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.0040a570
add esp, 4
test al, al
je 0x407716
cmp byte [ebp + 0x22], 0
jne 0x407580
xor edi, edi
jmp 0x40765d
cmp byte [ebp + 0x26], 0
mov ebx, dword [0x4c61f4]
lea ebx, [ebx*2 + 0x4c61f8]
je 0x407596
sub ebx, 2
movzx eax, byte [ebp + 0x1d]
add eax, eax
mov esi, ebx
sub esi, eax
mov dword [esp + 0x20], 0
mov byte [esp + 0x16], 0
mov byte [esp + 0x13], 0
cmp esi, ebx
jae 0x407606
mov edi, dword [sym.imp.USER32.dll_IsCharUpperW]
lea esp, [esp]
movzx ecx, word [esi]
push ecx
call dword [sym.imp.USER32.dll_IsCharLowerW]
test eax, eax
jne 0x4075d8
movzx edx, word [esi]
push edx
call edi
test eax, eax
je 0x4075f7
cmp byte [esp + 0x16], 0
jne 0x4075f3
movzx eax, word [esi]
push eax
mov byte [esp + 0x1a], 1
call edi
test eax, eax
je 0x4075f3
mov byte [esp + 0x13], 1
inc dword [esp + 0x20]
add esi, 2
cmp esi, ebx
jb 0x4075c0
mov eax, dword [esp + 0x20]
test eax, eax
jne 0x40760a
xor edi, edi
jmp 0x40765d
cmp eax, 1
jne 0x40761d
movzx edi, byte [esp + 0x13]
neg edi
sbb edi, edi
and edi, 2
jmp 0x40765d
cmp byte [esp + 0x13], 0
jne 0x407628
xor edi, edi
jmp 0x40765d
movzx ecx, byte [ebp + 0x1d]
add ecx, ecx
mov esi, ebx
sub esi, ecx
mov edi, 2
cmp esi, ebx
jae 0x407656
jmp 0x407640
movzx edx, word [esi]
push edx
call dword [sym.imp.USER32.dll_IsCharLowerW]
test eax, eax
jne 0x407654
add esi, edi
cmp esi, ebx
jb 0x407640
cmp esi, ebx
jne 0x40765d
mov edi, 1
mov dl, byte [ebp + 0x23]
test dl, dl
jne 0x407669
cmp byte [ebp + 0x24], dl
je 0x407673
mov byte [esp + 0x12], 0
mov byte [esp + 0x15], 1
mov eax, dword [esp + 0x148]
mov ecx, dword [esp + 0x24]
mov dword [eax], ecx
mov al, byte [ebp + 0x26]
test al, al
je 0x407697
mov ecx, dword [0x4c61f4]
movzx ecx, word [ecx*2 + 0x4c61f6]
jmp 0x407699
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 esi, dword [ebp + 8]
xor ecx, ecx
cmp word [esi], cx
je 0x4076e3
test al, al
je 0x4076db
mov edx, dword [0x4c61f4]
mov ax, word [edx*2 + 0x4c61f6]
mov word [0x4c61f8], ax
mov dword [0x4c61f4], 1
jmp 0x4076fb
mov dword [0x4c61f4], ecx
jmp 0x4076fb
test dl, dl
je 0x4076fb
movzx edx, byte [ebp + 0x1d]
sub dword [0x4c61f4], edx
test al, al
je 0x4076fb
dec dword [0x4c61f4]
cmp byte [ebp + 0x28], cl
je 0x407706
mov dword [0x4c61f4], ecx
mov ecx, dword [0x4c61f4]
xor eax, eax
mov word [ecx*2 + 0x4c61f8], ax
cmp byte [esp + 0x17], 0
je 0x407789
cmp byte [esp + 0x12], 0
mov bl, byte [0x4ca2e0]
mov byte [0x4ca2e0], 0
je 0x407789
push 0x100
lea edx, [esp + 0x34]
push 0
push edx
call fcn.004961e0
mov al, byte [0x4ca2e6]
mov cl, byte [0x4ca2e7]
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.00411a90
mov edx, dword [esp + 0x2c]
push edx
movzx edx, word [0x4ca2e4]
push 0
push 2
lea eax, [esp + 0x38]
push eax
push ecx
movzx eax, bl
push edx
push eax
call dword [sym.imp.USER32.dll_ToUnicodeEx]
cmp byte [esp + 0x14], 0
je 0x4079ab
cmp dword [0x4c95f0], 1
jne 0x4079ab
cmp byte [esp + 0x15], 0
jne 0x4079ab
mov edi, dword [esp + 0x28]
xor esi, esi
test edi, edi
jle 0x40782a
jmp 0x4077c0
cmp byte [0x4c961d], 0
mov ecx, dword [0x4c95fc]
je 0x4077e0
movzx eax, word [esp + esi*2 + 0x18]
push eax
push ecx
call fcn.0048e0e1
add esp, 8
jmp 0x4077ea
mov ax, word [esp + esi*2 + 0x18]
call fcn.004744b0
test eax, eax
jne 0x40787a
mov eax, dword [0x4c9628]
cmp eax, dword [0x4c962c]
je 0x40782a
mov dx, word [esp + esi*2 + 0x18]
mov ecx, dword [0x4c9624]
mov word [ecx + eax*2], dx
mov eax, dword [0x4c9628]
mov ecx, dword [0x4c9624]
inc eax
xor edx, edx
inc esi
mov dword [0x4c9628], eax
mov word [ecx + eax*2], dx
cmp esi, edi
jl 0x4077c0
xor esi, esi
cmp byte [0x4c9621], 0
je 0x4078f9
cmp byte [0x4c961d], 0
je 0x4078b8
cmp dword [0x4c960c], esi
jbe 0x407993
mov edi, edi
mov eax, dword [0x4c9608]
mov eax, dword [eax + esi*4]
mov ecx, dword [0x4c9624]
push eax
push ecx
call fcn.0048e108
add esp, 8
test eax, eax
jne 0x40789f
inc esi
cmp esi, dword [0x4c960c]
jb 0x407850
jmp 0x407993
mov dx, word [esp + esi*2 + 0x18]
mov al, byte [esp + 0x12]
pop esi
pop edi
pop ebp
mov dword [0x4c95f0], 4
mov word [0x4c9604], dx
pop ebx
add esp, 0x120
ret
mov al, byte [esp + 0x12]
pop esi
pop edi
pop ebp
mov dword [0x4c95f0], 3
pop ebx
add esp, 0x120
ret
cmp dword [0x4c960c], esi
jbe 0x407993
jmp 0x4078d0
mov edx, dword [0x4c9624]
mov eax, dword [0x4c9608]
mov eax, dword [eax + esi*4]
push edx
call fcn.00474500
add esp, 4
test eax, eax
jne 0x40789f
inc esi
cmp esi, dword [0x4c960c]
jb 0x4078d0
jmp 0x407993
cmp byte [0x4c961d], 0
je 0x40795f
mov ebp, dword [0x4c960c]
test ebp, ebp
je 0x407993
mov edi, dword [0x4c9624]
mov ebx, dword [0x4c9608]
lea esp, [esp]
mov ecx, dword [ebx + esi*4]
mov eax, edi
mov dx, word [eax]
cmp dx, word [ecx]
jne 0x40794b
test dx, dx
je 0x407947
mov dx, word [eax + 2]
cmp dx, word [ecx + 2]
jne 0x40794b
add eax, 4
add ecx, 4
test dx, dx
jne 0x407925
xor eax, eax
jmp 0x407950
sbb eax, eax
sbb eax, 0xffffffff
test eax, eax
je 0x40789f
inc esi
cmp esi, ebp
jb 0x407920
jmp 0x407993
cmp dword [0x4c960c], esi
jbe 0x407993
mov edi, dword [sym.imp.KERNEL32.dll_lstrcmpiW]
lea ecx, [ecx]
mov ecx, dword [0x4c9608]
mov edx, dword [ecx + esi*4]
mov eax, dword [0x4c9624]
push edx
push eax
call edi
test eax, eax
je 0x40789f
inc esi
cmp esi, dword [0x4c960c]
jb 0x407970
mov ecx, dword [0x4c962c]
cmp dword [0x4c9628], ecx
jl 0x4079ab
mov dword [0x4c95f0], 5
mov al, byte [esp + 0x12]
pop esi
pop edi
pop ebp
pop ebx
add esp, 0x120
ret