Function at 0x406930
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 [0x4ad2e8]
push esi
push edi
mov di, word [esp + 0x190]
cmp ebp, 1
jne 0x406974
cmp byte [0x4ad318], 0
jne 0x406974
movzx eax, dl
lea eax, [eax + eax*4]
cmp dword [ecx + eax*4], 0
jne 0x406974
xor bl, bl
mov byte [esp + 0x16], bl
jmp 0x40697d
mov byte [esp + 0x16], 1
mov bl, byte [esp + 0x16]
cmp byte [esp + 0x194], 0
je 0x4069a7
movzx eax, dl
lea edx, [eax + eax*4]
cmp byte [ecx + edx*4 + 8], 0
mov al, 1
jne 0x4073fc
mov al, bl
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x174
ret
cmp dword [0x4acba0], 0
je 0x4069c3
cmp byte [esp + 0x198], 0
jne 0x4069c3
mov byte [esp + 0x17], 1
test bl, bl
jne 0x4069c8
mov byte [esp + 0x17], 0
mov bl, byte [0x4ab29d]
cmp ebp, 1
jne 0x406ab8
cmp byte [0x4ad316], 0
je 0x4069ee
cmp byte [esp + 0x198], 0
jne 0x406ab8
mov byte [esp + 0x1d], 1
cmp dl, 0xe7
je 0x406a99
mov ecx, dword [0x4ad2ec]
mov esi, dword [0x4ad2f0]
movzx eax, dl
mov al, byte [eax + ecx]
test al, al
jne 0x406a1c
movzx eax, di
mov al, byte [eax + esi]
test al, al
je 0x406a99
mov cl, al
shr al, 2
shr cl, 1
and al, 1
and cl, 1
je 0x406abf
test al, al
jne 0x406a40
test bl, 0x30
jne 0x406a40
test al, al
je 0x406a99
test bl, 0x30
jne 0x406a99
movzx eax, di
mov ebp, 4
mov dword [0x4ad2e8], ebp
cmp byte [eax + esi], 0
mov byte [0x4ad2f8], dl
setne al
mov byte [0x4ad2fd], al
mov word [0x4ad2fa], di
mov byte [0x4ad2fc], 0
test cl, cl
je 0x406a7e
mov byte [0x4ad2fe], 1
test bl, 0x30
jne 0x406a85
mov byte [0x4ad2fe], 0
cmp byte [esp + 0x17], 0
jne 0x406a99
cmp byte [0x4adb1c], 0
je 0x406b89
movzx eax, dl
mov dword [esp + 0x20], eax
add eax, 0xffffffdf
cmp eax, 0x84
ja case.0x406ab1.41
movzx ecx, byte [eax + 0x407414]
jmp dword [ecx*4 + 0x407408]
mov byte [esp + 0x1d], 0
jmp 0x406a99
test al, al
je 0x406a40
jmp 0x406a3b
mov al, 1
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x174
ret
cmp byte [esp + 0x17], 0
je case.0x406ab1.41
mov ecx, dword [0x4aa044]
test ecx, ecx
je 0x406b01
xor ecx, ecx
mov byte [0x4aa048], 0
mov dword [0x4aa044], ecx
jmp 0x406b01
mov ecx, dword [0x4aa044]
test bl, bl
je 0x406b2c
cmp ebp, 1
jne 0x406b13
cmp byte [0x4ad317], 0
jne 0x406b2c
cmp bl, 0x10
je 0x406b2c
cmp bl, 0x20
je 0x406b2c
cmp bl, 0x30
je 0x406b2c
test bl, 0xc
je 0x406b89
test bl, 3
je 0x406b89
cmp dl, 8
jne 0x406b98
test bl, bl
jne 0x406b98
cmp byte [esp + 0x1d], bl
je 0x406b60
cmp ebp, 1
jne 0x406b60
cmp byte [0x4ad314], bl
je 0x406b60
mov eax, dword [0x4ad320]
test eax, eax
je 0x406b60
mov edx, dword [0x4ad31c]
dec eax
mov dword [0x4ad320], eax
mov byte [edx + eax], bl
cmp byte [esp + 0x17], 0
je 0x406b79
test ecx, ecx
je 0x406b79
dec ecx
mov dword [0x4aa044], ecx
mov byte [ecx + 0x4aa048], 0
cmp byte [0x4adb1c], 0
je 0x406b89
mov byte [0x4adb1c], 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 0x406bdd
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 0x406bdd
mov eax, dword [esp + 0x5c]
test eax, eax
je 0x406bdd
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 [0x4adb28], ebx
je 0x406c21
push 0x1c
lea ecx, [esp + 0x38]
push ecx
push ebx
mov dword [0x4adb28], ebx
call dword [sym.imp.USER32.dll_GetClassNameA]
lea edx, [esp + 0x34]
push str.ApplicationFrameWindow
push edx
call fcn.00485451
add esp, 8
test eax, eax
sete byte [0x4adb24]
mov bl, byte [0x4adb1c]
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 0x406cc3
cmp byte [0x4adb24], 0
je 0x406cc3
cmp byte [esp + 0x18c], 0xe7
je 0x406cc3
mov al, byte [0x4adb22]
mov cl, byte [0x4adb23]
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.00411b80
push ebp
push 0
lea edx, [esp + 0x20]
push edx
mov eax, ecx
movzx ecx, word [0x4adb20]
push eax
movzx edx, bl
push ecx
push edx
call esi
test eax, eax
jle 0x406cbc
movzx edx, word [0x4adb20]
push ebp
push 0
lea eax, [esp + 0x20]
push eax
movzx eax, byte [0x4adb1c]
lea ecx, [esp + 0x8c]
push ecx
push edx
push eax
call esi
mov byte [0x4adb1c], 0
mov al, byte [0x4ab29d]
lea ecx, [esp + 0x80]
call fcn.00411b80
push 0x14
call dword [sym.imp.USER32.dll_GetKeyState]
test al, 1
je 0x406cea
or byte [esp + 0x94], 1
jmp 0x406cf2
and byte [esp + 0x94], 0xfe
cmp byte [esp + 0x18c], 0xe7
lea ecx, [esp + 0x18]
jne 0x406d20
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 0x406d48
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 0x406b89
cmp byte [0x4adb1c], 0
setne byte [esp + 0x28]
test eax, eax
jns 0x406dee
mov bl, byte [esp + 0x16]
test bl, bl
je 0x4073fa
mov al, byte [esp + 0x18c]
mov cx, word [esp + 0x190]
mov byte [0x4adb1c], al
mov al, byte [0x4ab29d]
test al, 0x30
setne dl
mov word [0x4adb20], cx
mov byte [0x4adb22], dl
test al, 3
je 0x406dae
mov byte [0x4adb23], 1
test al, 0xc
jne 0x406db5
mov byte [0x4adb23], 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 0x406e0f
mov cl, 0xd
mov al, 0xa
cmp byte [esp + 0x18], cl
jne 0x406e05
mov byte [esp + 0x18], al
cmp byte [esp + 0x19], cl
jne 0x406e0f
mov byte [esp + 0x19], al
cmp byte [esp + 0x17], 0
mov byte [esp + 0x1e], 0
je 0x407199
mov eax, dword [esp + 0x24]
cmp eax, dword [0x4aa040]
je 0x406e3b
mov dword [0x4aa040], eax
mov byte [0x4aa048], 0
xor ecx, ecx
jmp 0x406e7d
mov ecx, dword [0x4aa044]
mov eax, 0x5a
sub eax, ecx
cmp eax, 3
jge 0x406e7d
mov eax, 0x4aa075
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x406e55
sub eax, edx
mov dword [0x4aa044], eax
inc eax
push eax
push 0x4aa075
push 0x4aa048
call fcn.00486030
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 0x406ea6
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 0x407199
cmp dword [0x4acba4], 0
mov dword [esp + 0x24], 0
jbe 0x407199
lea ebx, [ebx]
mov edx, dword [0x4acba0]
mov eax, dword [esp + 0x24]
mov ebp, dword [edx + eax*4]
cmp byte [ebp + 0x23], 0
jne 0x406fc9
cmp byte [ebp + 0x2a], 0
je 0x406f24
movzx edx, byte [ebp + 0x22]
cmp ecx, edx
jle 0x406fc9
movsx eax, byte [ecx + 0x4aa047]
push eax
push str._____:____.___n__t
call fcn.00486441
add esp, 8
test eax, eax
je 0x406fc3
mov ecx, dword [0x4aa044]
lea edi, [ecx + 0x4aa046]
jmp 0x406f36
movzx eax, byte [ebp + 0x22]
cmp ecx, eax
jl 0x406fc9
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 0x406f5e
cmp esi, eax
jb 0x406f8d
jmp 0x406f50
mov dl, byte [edi]
cmp dl, byte [esi]
jne 0x406f8d
dec esi
dec edi
cmp esi, eax
jae 0x406f50
jmp 0x406f8d
cmp esi, eax
jb 0x406f8d
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 0x406f87
dec esi
dec edi
cmp esi, dword [ebp + 8]
jae 0x406f62
mov ecx, dword [0x4aa044]
cmp esi, dword [ebp + 8]
jae 0x406fc9
cmp byte [ebp + 0x2b], 0
jne 0x406fb0
cmp edi, 0x4aa048
jb 0x406fb0
movzx edx, byte [edi]
push edx
call fcn.004074a0
add esp, 4
test al, al
jne 0x406fc3
mov eax, dword [ebp + 4]
mov esi, dword [ebp + 0x10]
push eax
call fcn.004094f0
add esp, 4
test eax, eax
jne 0x406fe3
mov ecx, dword [0x4aa044]
mov eax, dword [esp + 0x24]
inc eax
mov dword [esp + 0x24], eax
cmp eax, dword [0x4acba4]
jb 0x406ed0
jmp 0x407199
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.0040a080
add esp, 4
test al, al
je 0x407199
cmp byte [ebp + 0x27], 0
jne 0x407019
xor edi, edi
jmp 0x4070ec
cmp byte [ebp + 0x2a], 0
mov ebx, dword [0x4aa044]
lea ebx, [ebx + 0x4aa048]
je 0x40702c
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 0x407094
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 0x407068
movzx eax, byte [esi]
push eax
call edi
test eax, eax
je 0x407087
cmp byte [esp + 0x1f], 0
jne 0x407083
movzx ecx, byte [esi]
push ecx
mov byte [esp + 0x23], 1
call edi
test eax, eax
je 0x407083
mov byte [esp + 0x17], 1
inc dword [esp + 0x20]
inc esi
cmp esi, ebx
jb 0x407050
mov eax, dword [esp + 0x20]
test eax, eax
jne 0x407098
xor edi, edi
jmp 0x4070ec
cmp eax, 1
jne 0x4070ab
movzx edi, byte [esp + 0x17]
neg edi
sbb edi, edi
and edi, 2
jmp 0x4070ec
cmp byte [esp + 0x17], 0
jne 0x4070b6
xor edi, edi
jmp 0x4070ec
movzx edx, byte [ebp + 0x22]
mov esi, ebx
sub esi, edx
mov edi, 2
cmp esi, ebx
jae 0x4070e5
jmp 0x4070d0
movzx eax, byte [esi]
push eax
call dword [sym.imp.USER32.dll_IsCharLowerA]
test eax, eax
jne 0x4070e3
inc esi
cmp esi, ebx
jb 0x4070d0
cmp esi, ebx
jne 0x4070ec
mov edi, 1
mov dl, byte [ebp + 0x28]
test dl, dl
jne 0x4070f8
cmp byte [ebp + 0x29], dl
je 0x407102
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 0x407125
mov ecx, dword [0x4aa044]
movsx ecx, byte [ecx + 0x4aa047]
jmp 0x407127
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 0x40716b
test al, al
je 0x407163
mov edx, dword [0x4aa044]
mov al, byte [edx + 0x4aa047]
mov byte [0x4aa048], al
mov dword [0x4aa044], 1
jmp 0x407183
mov dword [0x4aa044], ecx
jmp 0x407183
test dl, dl
je 0x407183
movzx edx, byte [ebp + 0x22]
sub dword [0x4aa044], edx
test al, al
je 0x407183
dec dword [0x4aa044]
cmp byte [ebp + 0x2c], cl
je 0x40718e
mov dword [0x4aa044], ecx
mov eax, dword [0x4aa044]
mov byte [eax + 0x4aa048], cl
cmp byte [esp + 0x28], 0
mov bl, byte [esp + 0x16]
je 0x407216
test bl, bl
je 0x407216
push 0x100
lea ecx, [esp + 0x84]
push 0
push ecx
call fcn.0048e920
mov al, byte [0x4adb22]
mov dl, byte [0x4adb23]
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.00411b80
mov eax, dword [esp + 0x30]
push eax
movzx eax, word [0x4adb20]
push 0
lea ecx, [esp + 0x30]
push ecx
movzx ecx, byte [0x4adb1c]
lea edx, [esp + 0x8c]
push edx
push eax
push ecx
call dword [sym.imp.USER32.dll_ToAsciiEx]
mov byte [0x4adb1c], 0
cmp byte [esp + 0x1d], 0
je 0x4073fa
cmp dword [0x4ad2e8], 1
jne 0x4073fa
cmp byte [esp + 0x1e], 0
jne 0x4073fa
mov edi, dword [esp + 0x2c]
xor esi, esi
test edi, edi
jle 0x4072ae
cmp byte [0x4ad315], 0
je 0x407263
movzx eax, byte [esp + esi + 0x18]
mov edx, dword [0x4ad2f4]
push eax
push edx
call fcn.00486441
add esp, 8
jmp 0x407272
mov al, byte [esp + esi + 0x18]
mov ecx, dword [0x4ad2f4]
call fcn.00472b50
test eax, eax
jne 0x4072fc
mov eax, dword [0x4ad320]
cmp eax, dword [0x4ad324]
je 0x4072ae
mov cl, byte [esp + esi + 0x18]
mov edx, dword [0x4ad31c]
mov byte [edx + eax], cl
mov eax, dword [0x4ad320]
mov ecx, dword [0x4ad31c]
inc eax
inc esi
mov dword [0x4ad320], eax
mov byte [ecx + eax], 0
cmp esi, edi
jl 0x407243
xor esi, esi
cmp byte [0x4ad319], 0
je 0x407369
cmp byte [0x4ad315], 0
je 0x407334
cmp dword [0x4ad304], esi
jbe 0x4073e3
mov eax, dword [0x4ad300]
mov eax, dword [eax + esi*4]
mov ecx, dword [0x4ad31c]
push eax
push ecx
call fcn.00486582
add esp, 8
test eax, eax
jne 0x40731d
inc esi
cmp esi, dword [0x4ad304]
jb 0x4072d2
jmp 0x4073e3
mov dl, byte [esp + esi + 0x18]
mov dword [0x4ad2e8], 4
mov byte [0x4ad2fc], dl
mov al, bl
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x174
ret
mov dword [0x4ad2e8], 3
mov al, bl
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x174
ret
cmp dword [0x4ad304], esi
jbe 0x4073e3
mov edx, dword [0x4ad300]
mov eax, dword [edx + esi*4]
push eax
mov eax, dword [0x4ad31c]
call fcn.00472ba0
add esp, 4
test eax, eax
jne 0x40731d
inc esi
cmp esi, dword [0x4ad304]
jb 0x407340
jmp 0x4073e3
cmp byte [0x4ad315], 0
je 0x4073ac
cmp dword [0x4ad304], esi
jbe 0x4073e3
lea ebx, [ebx]
mov ecx, dword [0x4ad300]
mov eax, dword [ecx + esi*4]
mov edx, dword [0x4ad31c]
push eax
push edx
call fcn.004855a1
add esp, 8
test eax, eax
je 0x40731d
inc esi
cmp esi, dword [0x4ad304]
jb 0x407380
jmp 0x4073e3
cmp dword [0x4ad304], esi
jbe 0x4073e3
mov edi, dword [sym.imp.KERNEL32.dll_lstrcmpiA]
lea ebx, [ebx]
mov eax, dword [0x4ad300]
mov ecx, dword [eax + esi*4]
mov edx, dword [0x4ad31c]
push ecx
push edx
call edi
test eax, eax
je 0x40731d
inc esi
cmp esi, dword [0x4ad304]
jb 0x4073c0
mov eax, dword [0x4ad324]
cmp dword [0x4ad320], eax
jl 0x4073fa
mov dword [0x4ad2e8], 5
mov al, bl
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x174
ret