监听USB协议捕捉程序点击事件

#求合作
#背景
#如捕捉第三方程序的按钮点击事件按钮点击事件 “保存” 获取这个点击事件, 我用程序调用你的代码,做相关业务处理。

捕捉第三方程序的按钮点击事件基本无法实现,要不你可以通过窗口句柄控制第三方程序,要不就是实现全局鼠标的抓获,如果第三方程序是自主点击一个按钮,也许你只能通过鼠标的位置来判断,这样的话就要求位置数固定的。对于全局鼠标抓取,一般就是WH_MOUSE、WH_MOUSE_LL这两种方式。

可以使用USBlyzer、Wireshark和USBPcap等USB协议分析器来监听USB协议捕捉程序点击事件

不知道你这个问题是否已经解决, 如果还没有解决的话:
  • 你可以参考下这个问题的回答, 看看是否对你有帮助, 链接: https://ask.csdn.net/questions/7656202
  • 除此之外, 这篇博客: 树莓派开发—“树莓派开发“ 可口的派应该如何登陆呢?中的 1. USB串口线方式登录树莓派 部分也许能够解决你的问题, 你可以仔细阅读以下内容或者直接跳转源博客中阅读:

    设备破解:

    默认情况,树莓派的串口和蓝牙连接
    想办法断开蓝牙连接,把串口用来数据通信

    首先准备 usb转串口模块,和杜邦线 , 树莓派 ,USB线

    连接USB转串口模块和树莓派,接入电脑,打开SecureCRT.exe 。
    在这里插入图片描述

    USB-TTL连接树莓派串口

    将对应针脚连接到树莓的TXD和RXD上(GPIO14和15),如图所示:
    在这里插入图片描述
    注意:USB转串口模块,接入RXD 和 TXD ,在连接 树莓派的时候,切记要 RXD 对应 usb模块的TXD ,TXD 对应 RXD。

    修改系统配置,启用串口登录树莓派
    在这里插入图片描述

    1.打开SD卡根目录的"config.txt"文件,将以下内容替换并且保存。

    # For more options and information see
    # http://rpf.io/configtxt
    # Some settings may impact device functionality. See link above for details
    
    # uncomment if you get no picture on HDMI for a default "safe" mode
    #hdmi_safe=1
    
    # uncomment this if your display has a black border of unused pixels visible
    # and your display can output without overscan
    #disable_overscan=1
    
    # uncomment the following to adjust overscan. Use positive numbers if console
    # goes off screen, and negative if there is too much border
    #overscan_left=16
    #overscan_right=16
    #overscan_top=16
    #overscan_bottom=16
    
    # uncomment to force a console size. By default it will be display's size minus
    # overscan.
    #framebuffer_width=1280
    #framebuffer_height=720
    
    # uncomment if hdmi display is not detected and composite is being output
    #hdmi_force_hotplug=1
    
    # uncomment to force a specific HDMI mode (this will force VGA)
    #hdmi_group=1
    #hdmi_mode=1
    
    # uncomment to force a HDMI mode rather than DVI. This can make audio work in
    # DMT (computer monitor) modes
    #hdmi_drive=2
    
    # uncomment to increase signal to HDMI, if you have interference, blanking, or
    # no display
    #config_hdmi_boost=4
    
    # uncomment for composite PAL
    #sdtv_mode=2
    
    #uncomment to overclock the arm. 700 MHz is the default.
    #arm_freq=800
    
    # Uncomment some or all of these to enable the optional hardware interfaces
    #dtparam=i2c_arm=on
    #dtparam=i2s=on
    #dtparam=spi=on
    
    # Uncomment this to enable infrared communication.
    #dtoverlay=gpio-ir,gpio_pin=17
    #dtoverlay=gpio-ir-tx,gpio_pin=18
    
    # Additional overlays and parameters are documented /boot/overlays/README
    
    # Enable audio (loads snd_bcm2835)
    dtparam=audio=on
    
    [pi4]
    # Enable DRM VC4 V3D driver on top of the dispmanx display stack
    dtoverlay=vc4-fkms-v3d
    max_framebuffers=2
    
    [all]
    #dtoverlay=vc4-fkms-v3d
    dtoverlay=pi3-disable-bt
    start_x=1
    gpu_mem=128
    

    这样就停止了蓝牙,解除了对串口的占用。

    2.然后再修改根目录的"cmdline.txt",将里面的内容全部替换成以下内容,以防万一,请先备份好这个文件的原内容。

    dwc_otg.lpm_enable=0 console=tty1 console=serial0,115200 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait
    

    配置修改完成。

    打开SecureCRT
    在这里插入图片描述
    打开连接,选择协议,和端口,点击连接。

    在这里插入图片描述
    改成Serial协议。安装好端口。然后一定要改好波特率:115200,因为上面改文件的时候写是115200
    在这里插入图片描述
    在这里插入图片描述
    点击连接后,再插入USB给树莓派供电。等待一会,就以串口的方式登录上了树莓派。

    在这里插入图片描述


如果你已经解决了该问题, 非常希望你能够分享一下解决方案, 写成博客, 将相关链接放在评论区, 以帮助更多的人 ^-^