91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 6KB
    文件類(lèi)型: .rar
    金幣: 2
    下載: 1 次
    發(fā)布日期: 2021-10-05
  • 語(yǔ)言: 其他
  • 標(biāo)簽: stm32??usb??hid??idle??stall??

資源簡(jiǎn)介

使用STM32的庫(kù)進(jìn)行USB-HID開(kāi)發(fā)時(shí),會(huì)出現(xiàn)某些電腦枚舉不出設(shè)備的情況,通過(guò)bus hound 來(lái)抓包分析會(huì)出現(xiàn) PC 發(fā)送set idle命令下去后,從設(shè)備沒(méi)有響應(yīng),所以PC變?yōu)閟tall狀態(tài),之后枚舉失敗。通過(guò)分析源代碼和HID協(xié)議,找到問(wèn)題所在,修補(bǔ)漏洞之后可以在任何電腦上枚舉成功。

可以對(duì)比庫(kù)中的源代碼,可以找到修改的地方。

資源截圖

代碼片段和文件信息

/**
??******************************************************************************
??*?@file????usb_core.c
??*?@author??MCD?Application?Team
??*?@version?V4.0.0
??*?@date????28-August-2012
??*?@brief???Standard?protocol?processing?(USB?v2.0)
??******************************************************************************
??*?@attention
??*
??*?

©?COPYRIGHT?2012?STMicroelectronics


??*
??*?Licensed?under?MCD-ST?Liberty?SW?License?Agreement?V2?(the?“License“);
??*?You?may?not?use?this?file?except?in?compliance?with?the?License.
??*?You?may?obtain?a?copy?of?the?License?at:
??*
??*????????http://www.st.com/software_license_agreement_liberty_v2
??*
??*?Unless?required?by?applicable?law?or?agreed?to?in?writing?software?
??*?distributed?under?the?License?is?distributed?on?an?“AS?IS“?BASIS?
??*?WITHOUT?WARRANTIES?OR?CONDITIONS?OF?ANY?KIND?either?express?or?implied.
??*?See?the?License?for?the?specific?language?governing?permissions?and
??*?limitations?under?the?License.
??*
??******************************************************************************
??*/


/*?Includes?------------------------------------------------------------------*/
#include?“usb_lib.h“
#include?“string.h“
#include?“usb_prop.h“

/*?Private?typedef?-----------------------------------------------------------*/
/*?Private?define?------------------------------------------------------------*/
#define?ValBit(VARPlace)????(VAR?&?(1?<#define?SetBit(VARPlace)????(VAR?|=?(1?<#define?ClrBit(VARPlace)????(VAR?&=?((1?<#define?Send0LengthData()?{?_SetEPTxCount(ENDP0?0);?\
????vSetEPTxStatus(EP_TX_VALID);?\
??}

#define?vSetEPRxStatus(st)?(SaveRState?=?st)
#define?vSetEPTxStatus(st)?(SaveTState?=?st)

#define?USB_StatusIn()?Send0LengthData()
#define?USB_StatusOut()?vSetEPRxStatus(EP_RX_VALID)

#define?StatusInfo0?StatusInfo.bw.bb1?/*?Reverse?bb0?&?bb1?*/
#define?StatusInfo1?StatusInfo.bw.bb0

/*?Private?macro?-------------------------------------------------------------*/
/*?Private?variables?---------------------------------------------------------*/
uint16_t_uint8_t?StatusInfo;

bool?Data_Mul_MaxPacketSize?=?FALSE;
/*?Private?function?prototypes?-----------------------------------------------*/
static?void?DataStageOut(void);
static?void?DataStageIn(void);
static?void?NoData_Setup0(void);
static?void?Data_Setup0(void);
/*?Private?functions?---------------------------------------------------------*/

/*******************************************************************************
*?Function?Name??:?Standard_GetConfiguration.
*?Description????:?Return?the?current?configuration?variable?address.
*?Input??????????:?Length?-?How?many?bytes?are?needed.
*?Output?????????:?None.
*?Return?????????:?Return?1??if?the?request?is?invalid?when?“Length“?is?0.
*??????????????????Return?“Buffer“?if?the?“Length“?is?not?0.
*********************************************

?屬性????????????大小?????日期????時(shí)間???名稱(chēng)
-----------?---------??----------?-----??----

?????文件??????32753??2016-11-17?15:22??usb_core.c

-----------?---------??----------?-----??----

????????????????32753????????????????????1


評(píng)論

共有 條評(píng)論