Function at 0x411730
Capabilities:
Check for foreground window switch
Check for time delay via gettickcount
Get keyboard layout
Log keystrokes
Log keystrokes via polling

Disassembly:
push ebp
lea ebp, [esp - 0x70]
sub esp, 0xc8
push ebx
mov ebx, ecx
push esi
mov esi, edx
mov dword [ebp + 0x68], ebx
push edi
cmp word [ebx], 0
mov dword [ebp + 0x50], esi
je 0x412952
mov eax, dword [0x4e7024]
mov edi, dword [sym.imp.api_ms_win_crt_string_l1_1_0.dll__wcsnicmp]
mov dword [ebp + 0x48], eax
mov eax, dword [0x4ec4a0]
mov dword [ebp + 0xc], eax
mov eax, dword fs:[0x24]
mov dword [ebp + 0x24], eax
test esi, esi
jne 0x411795
push 7
push str.Blind
push ebx
call edi
add esp, 0xc
test eax, eax
jne 0x411795
add ebx, 0xe
mov byte [0x4ec73c], 1
mov dword [ebp + 0x68], ebx
jmp 0x4117a0
mov byte [0x4ec73c], 0
test esi, esi
jne 0x4117be
push 6
push str.Text
push ebx
call edi
add esp, 0xc
test eax, eax
jne 0x4117be
add ebx, 0xc
mov dword [ebp + 0x50], 2
mov dword [ebp + 0x68], ebx
mov ecx, dword [ebp + 0x48]
mov edi, dword [ebp + 0x78]
mov eax, dword [ecx + 0x5c]
mov dword [ebp + 8], eax
mov eax, dword [ecx + 0x64]
mov dword [ebp + 0x14], eax
cmp edi, 1
je 0x4117de
cmp edi, 3
jne 0x411898
mov eax, dword [0x4ec69c]
mov edi, dword [sym.imp.KERNEL32.dll_CloseHandle]
test eax, eax
je 0x4117f0
push eax
call edi
push str.AHK_Keybd
push 0
push 0
call dword [sym.imp.KERNEL32.dll_CreateMutexW]
mov esi, eax
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp dword [0x4ec69c], 0
mov ebx, eax
je 0x41181a
mov dword [0x4ec69c], esi
jmp 0x411821
test esi, esi
je 0x411821
push esi
call edi
cmp ebx, 0xb7
je 0x411862
cmp dword [ebp + 0x50], 0
jne 0x411855
call fcn.0040b980
mov ebx, dword [ebp + 0x68]
test al, al
je 0x411858
mov edx, str.Click
mov ecx, ebx
call fcn.004a1da0
test eax, eax
jne 0x411865
mov edi, 1
mov dword [ebp + 0x78], edi
jmp 0x411898
mov ebx, dword [ebp + 0x68]
mov edi, 1
mov dword [ebp + 0x78], edi
jmp 0x411898
mov ebx, dword [ebp + 0x68]
cmp dword [ebp + 0x78], 3
jne 0x411875
mov edi, 2
mov dword [ebp + 0x78], edi
jmp 0x411898
mov ecx, dword [ebp + 0x48]
xor edi, edi
mov dword [ebp + 0x78], edi
cmp dword [ecx + 0x5c], edi
jge 0x41188c
cmp dword [ecx + 0x64], edi
jge 0x41188c
or eax, 0xffffffff
jmp 0x41188e
xor eax, eax
mov dword [ecx + 0x64], eax
mov dword [ecx + 0x5c], 0xffffffff
mov eax, dword [ebp + 0x7c]
xor esi, esi
mov byte [ebp + 0x61], 0
test eax, eax
je 0x4118f2
push esi
push eax
call dword [sym.imp.USER32.dll_GetWindowThreadProcessId]
mov edi, eax
mov dword [ebp + 0x18], edi
test edi, edi
je 0x4119cd
cmp edi, dword [0x4eb104]
je 0x4119cd
mov ecx, dword [ebp + 0x7c]
call fcn.004a80a0
test al, al
jne 0x4119cd
push 1
push edi
push dword [0x4eb104]
call dword [sym.imp.USER32.dll_AttachThreadInput]
test eax, eax
mov esi, edi
setne byte [ebp + 0x61]
jmp 0x4119cd
test byte [0x4ec46e], 0xc0
je 0x41198b
call dword [sym.imp.KERNEL32.dll_GetTickCount]
sub eax, dword [0x4ec464]
cmp eax, 0x32
jae 0x41198b
cmp edi, 2
je 0x41198b
cmp byte [0x4ec73c], 0
jne 0x41198b
mov eax, dword [ebp + 0x50]
cmp eax, 2
je 0x41198b
cmp byte [0x4ec66b], 0
je 0x41198b
mov ecx, dword [ebp + 0x24]
cmp ecx, dword [0x4eb104]
jne 0x41198b
test eax, eax
je 0x411a1b
mov edi, ebx
test ebx, ebx
je 0x411981
movzx eax, word [ebx]
test ax, ax
je 0x411981
mov esi, eax
mov ecx, 0x4d5a00
mov edx, 0x4c
nop dword [eax]
cmp si, dx
je 0x411983
movzx eax, word [ecx + 2]
add ecx, 2
mov edx, eax
test ax, ax
jne 0x411960
movzx eax, word [edi + 2]
add edi, 2
mov esi, eax
test ax, ax
jne 0x411952
xor edi, edi
test edi, edi
jne 0x411acd
call dword [sym.imp.USER32.dll_GetForegroundWindow]
xor esi, esi
test eax, eax
je 0x4119c7
mov ebx, dword [sym.imp.USER32.dll_GetWindowThreadProcessId]
push esi
push eax
call ebx
mov esi, eax
mov dword [ebp - 0x58], 0x30
lea eax, [ebp - 0x58]
push eax
push esi
call dword [sym.imp.USER32.dll_GetGUIThreadInfo]
test eax, eax
je 0x4119c7
mov eax, dword [ebp - 0x4c]
test eax, eax
je 0x4119c7
push 0
push eax
call ebx
mov esi, eax
mov eax, dword [ebp + 0x14]
mov dword [ebp + 0x18], eax
push esi
call dword [sym.imp.USER32.dll_GetKeyboardLayout]
xor edx, edx
mov dword [0x4ec718], eax
mov ecx, eax
call fcn.00415df0
mov cl, 1
mov dword [0x4ec71c], eax
call fcn.004158b0
mov bl, al
and byte [0x4ec6c7], bl
cmp dword [0x4e9834], 0
je 0x411b12
mov al, byte [0x4e98d6]
mov cl, byte [0x4e98d2]
mov bh, al
not al
and bh, cl
and al, cl
jmp 0x411b36
mov esi, ebx
nop dword [eax]
test esi, esi
je 0x41198b
movzx eax, word [esi]
test ax, ax
je 0x41198b
mov edi, eax
nop word [eax + eax]
mov ecx, 0x4d5a00
mov edx, 0x4c
nop word [eax + eax]
cmp di, dx
je 0x411a76
movzx eax, word [ecx + 2]
add ecx, 2
mov edx, eax
test ax, ax
jne 0x411a50
movzx eax, word [esi + 2]
add esi, 2
mov edi, eax
test ax, ax
jne 0x411a40
jmp 0x41198b
add esi, 2
je 0x411acd
movzx eax, word [esi]
test ax, ax
je 0x411acd
mov edi, eax
nop word [eax + eax]
mov eax, 0x4d5a08
mov edx, 0x7b
nop word [eax + eax]
cmp di, dx
je 0x411ac3
movzx ecx, word [eax + 2]
add eax, 2
mov edx, ecx
test cx, cx
jne 0x411aa0
movzx eax, word [esi + 2]
add esi, 2
mov edi, eax
test ax, ax
jne 0x411a90
jmp 0x411acd
cmp word [esi], 0x7b
jne 0x411a20
mov esi, dword [sym.imp.USER32.dll_GetAsyncKeyState]
push 0x5b
call esi
bt ax, 0xf
jb 0x411aed
push 0x5c
call esi
bt ax, 0xf
jae 0x41198b
mov edx, 1
mov dword [0x4e701c], 0
mov ecx, 0x8000012f
call fcn.004016d0
mov dword [0x4e701c], 1
jmp 0x411ad3
call dword [sym.imp.KERNEL32.dll_GetTickCount]
sub eax, dword [0x4ec464]
cmp eax, dword [0x4e82b4]
jae 0x411b30
mov cl, byte [0x4ec46e]
and cl, bl
jmp 0x411b32
xor cl, cl
mov bh, cl
xor al, al
not bh
mov byte [ebp + 0x6d], cl
and bh, byte [0x4ec6c6]
and bh, bl
mov byte [ebp + 0x62], al
cmp byte [0x4ec73c], 0
mov byte [ebp + 0x6f], bh
mov byte [0x4ec6c6], bh
je 0x411b65
not bh
and bh, bl
mov al, bh
mov bh, bl
mov byte [ebp + 0x6f], bh
jmp 0x411b67
xor al, al
mov byte [ebp + 0x6c], al
mov eax, dword [ebp + 0x48]
mov byte [ebp + 0x58], bh
cmp byte [eax + 0xf3], 0
je 0x411b99
cmp byte [0x4ec73c], 0
jne 0x411b99
cmp dword [ebp + 0x50], 2
je 0x411b99
mov edx, 2
mov cl, 0x14
call fcn.00415070
mov dword [ebp + 0x1c], eax
jmp 0x411ba0
mov dword [ebp + 0x1c], 0
mov edx, dword [ebp + 0x78]
mov eax, 0x1f4
mov dword [0x4ec738], edx
mov ecx, 0x5dc
test edx, edx
je 0x411c19
cmp edx, 1
cmovne eax, ecx
mov ecx, 0x2ee0
mov dword [0x4ec724], eax
mov eax, 0x36b0
cmovne eax, ecx
call fcn.004bd9a0
mov eax, dword [0x4e8a2c]
mov ecx, esp
mov edx, dword [ebp + 0x78]
mov byte [0x4ec72c], bl
mov byte [0x4ec72d], 0
mov dword [eax], ecx
mov dword [0x4ec730], 0x80000000
mov dword [0x4ec734], 0x80000000
mov dword [0x4ec720], 0
mov byte [0x4ec72e], 0
mov byte [0x4ec72f], 1
mov al, byte [0x4e98a2]
mov byte [ebp + 0x4f], al
mov eax, dword [0x4e7034]
cmp eax, 8
je 0x411c30
cmp eax, 0xa
jne 0x411c50
mov esi, dword [ebp + 0x7c]
test edx, edx
jne 0x411c53
test esi, esi
jne 0x411c53
push 1
mov byte [ebp + 0x60], 1
call dword [sym.imp.USER32.dll_BlockInput]
mov byte [0x4e98a2], 1
jmp 0x411c57
mov esi, dword [ebp + 0x7c]
mov byte [ebp + 0x60], 0
mov edi, dword [ebp + 0x68]
xor bl, bl
mov byte [ebp + 0x64], bl
cmp word [edi], 0
je 0x4126da
jmp 0x411c73