Function at 0x47f870
Capabilities:
Log keystrokes via polling

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x4dd0c8
mov eax, dword fs:[0]
push eax
sub esp, 0x1b8
mov eax, dword [0x51cca4]
xor eax, ebp
mov dword [ebp - 0x10], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov edi, ecx
mov esi, dword [ebp + 8]
push str.winusb.dll
call dword [sym.imp.KERNEL32.dll_LoadLibraryA]
test eax, eax
jne 0x47f8ba
mov dword [edi + 0x9c], eax
jmp 0x47f8c1
push eax
call dword [sym.imp.KERNEL32.dll_FreeLibrary]
cmp dword [edi + 0x9c], 0
je 0x47faf8
push 0xa2
call dword [sym.imp.USER32.dll_GetKeyState]
cmp dword [edi + 0x6c], 0x10
lea eax, [edi + 0x58]
jb 0x47f8e4
mov eax, dword [eax]
push 0
push 0x40000080
push 3
push 0
push 3
push 0xc0000000
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov dword [edi + 0x94], eax
cmp eax, 0xffffffff
jne 0x47f965
mov edi, dword [sym.imp.KERNEL32.dll_GetLastError]
call edi
cmp eax, 5
jne 0x47f91c
push 0x4e6c28
jmp 0x47f93a
call edi
push eax
lea eax, [ebp - 0x110]
push str.WinUsb_Device_could_not_be_opened__err_d_n
push eax
call fcn.004646a0
add esp, 0xc
lea eax, [ebp - 0x110]
push eax
lea ecx, [ebp - 0x128]
call fcn.00460690
lea eax, [ebp - 0x128]
mov ecx, esi
push eax
call fcn.00460d30
lea ecx, [ebp - 0x128]
call fcn.00460af0
xor al, al
jmp 0x47fd99
lea ebx, [edi + 0x90]
push ebx
push eax
call sub.WINUSB.DLL_WinUsb_Initialize
test eax, eax
jne 0x47f999
push dword [edi + 0x94]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push esi
mov ecx, edi
mov dword [edi + 0x9c], 0
call fcn.0047f870
jmp 0x47fd99
lea eax, [ebp - 0x17c]
push eax
push 0
push dword [ebx]
call sub.WINUSB.DLL_WinUsb_QueryInterfaceSettings
test eax, eax
jne 0x47f9c6
lea eax, [ebp - 0x110]
push str.Fail_to_query_interface_n
push eax
call fcn.004646a0
add esp, 8
jmp 0x47f933
xor ebx, ebx
cmp byte [ebp - 0x178], bl
jbe 0x47fa16
lea eax, [ebp - 0x134]
push eax
push ebx
push 0
push dword [edi + 0x90]
call sub.WINUSB.DLL_WinUsb_QueryPipe
cmp dword [ebp - 0x134], 2
jne 0x47fa75
mov al, byte [ebp - 0x130]
test al, al
jns 0x47fa04
mov byte [edi + 0x98], al
jmp 0x47fa0a
mov byte [edi + 0x99], al
movzx eax, byte [ebp - 0x178]
inc ebx
cmp ebx, eax
jl 0x47f9d0
cmp byte [edi + 0x98], 0
je 0x47fa2c
cmp byte [edi + 0x99], 0
jne 0x47fd97
push str.No_WinUsb_pipes_found.
lea ecx, [ebp - 0x194]
call fcn.00460690
lea eax, [ebp - 0x194]
cmp esi, eax
je 0x47facf
mov eax, dword [esi + 0x14]
cmp eax, 0x10
jb 0x47fa5d
inc eax
mov ecx, esi
push eax
push dword [esi]
call fcn.00464490
mov dword [esi + 0x14], 0xf
cmp dword [esi + 0x14], 0x10
mov dword [esi + 0x10], 0
jb 0x47fabc
mov eax, dword [esi]
jmp 0x47fabe
push str.Wrong_WinUsb_pipes_found.
lea ecx, [ebp - 0x128]
call fcn.00460690
lea eax, [ebp - 0x128]
mov ecx, esi
push eax
call fcn.00460d30
mov eax, dword [ebp - 0x114]
cmp eax, 0x10
jb 0x47f95e
inc eax
lea ecx, [ebp - 0x128]
push eax
push dword [ebp - 0x128]
call fcn.00464490
xor al, al
jmp 0x47fd99
mov eax, esi
mov byte [eax], 0
mov ecx, esi
lea eax, [ebp - 0x194]
push eax
call fcn.00463e40
mov eax, dword [ebp - 0x180]
cmp eax, 0x10
jb 0x47f95e
inc eax
lea ecx, [ebp - 0x194]
push eax
push dword [ebp - 0x194]
call fcn.00464490
xor al, al
jmp 0x47fd99
push str.BulkRead
lea ebx, [edi + 0x58]
lea eax, [ebp - 0x140]
push ebx
push eax
call fcn.00470690
add esp, 0xc
push 0xffffffffffffffff
push 0
push eax
lea ecx, [ebp - 0x170]
mov dword [ebp - 4], 1
mov dword [ebp - 0x15c], 0xf
mov dword [ebp - 0x160], 0
mov byte [ebp - 0x170], 0
call fcn.004641c0
mov eax, dword [ebp - 0x12c]
mov byte [ebp - 4], 3
cmp eax, 0x10
jb 0x47fb64
inc eax
lea ecx, [ebp - 0x140]
push eax
push dword [ebp - 0x140]
call fcn.00464490
push str.BulkWrite
lea eax, [ebp - 0x128]
mov dword [ebp - 0x12c], 0xf
push ebx
push eax
mov dword [ebp - 0x130], 0
mov byte [ebp - 0x140], 0
call fcn.00470690
add esp, 0xc
push 0xffffffffffffffff
push 0
push eax
lea ecx, [ebp - 0x158]
mov byte [ebp - 4], 4
mov dword [ebp - 0x144], 0xf
mov dword [ebp - 0x148], 0
mov byte [ebp - 0x158], 0
call fcn.004641c0
mov eax, dword [ebp - 0x114]
mov byte [ebp - 4], 6
cmp eax, 0x10
jb 0x47fbe5
inc eax
lea ecx, [ebp - 0x128]
push eax
push dword [ebp - 0x128]
call fcn.00464490
cmp dword [ebp - 0x15c], 0x10
lea eax, [ebp - 0x170]
mov ebx, dword [sym.imp.KERNEL32.dll_CreateFileA]
cmovae eax, dword [ebp - 0x170]
push 0
push 0
push 3
push 0
push 1
push closesocket
push eax
mov dword [ebp - 0x114], 0xf
mov dword [ebp - 0x118], 0
mov byte [ebp - 0x128], 0
call ebx
mov dword [edi + 0x50], eax
cmp eax, 0xffffffff
jne 0x47fcec
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
lea eax, [ebp - 0x110]
push str.In_Pipe_could_not_be_opened__err_d_n
push eax
call fcn.004646a0
add esp, 0xc
lea eax, [ebp - 0x110]
lea ecx, [ebp - 0x1ac]
push eax
call fcn.00460690
lea eax, [ebp - 0x1ac]
cmp esi, eax
je 0x47fcad
mov eax, dword [esi + 0x14]
cmp eax, 0x10
jb 0x47fc82
inc eax
mov ecx, esi
push eax
push dword [esi]
call fcn.00464490
mov dword [esi + 0x14], 0xf
cmp dword [esi + 0x14], 0x10
mov dword [esi + 0x10], 0
jb 0x47fc9a
mov eax, dword [esi]
jmp 0x47fc9c
mov eax, esi
mov byte [eax], 0
mov ecx, esi
lea eax, [ebp - 0x1ac]
push eax
call fcn.00463e40
mov eax, dword [ebp - 0x198]
cmp eax, 0x10
jb 0x47fd67
inc eax
lea ecx, [ebp - 0x1ac]
push eax
push dword [ebp - 0x1ac]
call fcn.00464490
lea ecx, [ebp - 0x158]
call fcn.00460af0
lea ecx, [ebp - 0x170]
call fcn.00460af0
xor al, al
jmp 0x47fd99
cmp dword [ebp - 0x144], 0x10
lea eax, [ebp - 0x158]
push 0
cmovae eax, dword [ebp - 0x158]
push 0
push 3
push 0
push 2
push 0x40000000
push eax
call ebx
mov dword [edi + 0x54], eax
cmp eax, 0xffffffff
jne 0x47fd81
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
lea eax, [ebp - 0x110]
push str.Out_Pipe_could_not_be_opened__err_d_n
push eax
call fcn.004646a0
add esp, 0xc
lea eax, [ebp - 0x110]
lea ecx, [ebp - 0x1c4]
push eax
call fcn.00460690
lea eax, [ebp - 0x1c4]
mov ecx, esi
push eax
call fcn.00460d30
lea ecx, [ebp - 0x1c4]
call fcn.00460af0
mov ecx, edi
call fcn.0047e310
lea ecx, [ebp - 0x158]
call fcn.00460af0
lea ecx, [ebp - 0x170]
call fcn.00460af0
xor al, al
jmp 0x47fd99
lea ecx, [ebp - 0x158]
call fcn.00460af0
lea ecx, [ebp - 0x170]
call fcn.00460af0
mov al, 1
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.00489c7b
mov esp, ebp
pop ebp
ret 4