⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 protocol.cod

📁 James Antognini和Tom Divine提供的PASSTHRU的编成实例。
💻 COD
📖 第 1 页 / 共 5 页
字号:
; Listing generated by Microsoft (R) Optimizing Compiler Version 13.00.9178 

	TITLE	.\protocol.c
	.386P
include listing.inc
if @Version gt 510
.model FLAT
else
_TEXT	SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT	ENDS
_DATA	SEGMENT DWORD USE32 PUBLIC 'DATA'
_DATA	ENDS
CONST	SEGMENT DWORD USE32 PUBLIC 'CONST'
CONST	ENDS
_BSS	SEGMENT DWORD USE32 PUBLIC 'BSS'
_BSS	ENDS
$$SYMBOLS	SEGMENT BYTE USE32 'DEBSYM'
$$SYMBOLS	ENDS
$$TYPES	SEGMENT BYTE USE32 'DEBTYP'
$$TYPES	ENDS
_TLS	SEGMENT DWORD USE32 PUBLIC 'TLS'
_TLS	ENDS
;	COMDAT _PtBindAdapter@20
_TEXT	SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT	ENDS
;	COMDAT _PtOpenAdapterComplete@12
_TEXT	SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT	ENDS
;	COMDAT _PtUnbindAdapter@12
_TEXT	SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT	ENDS
;	COMDAT _PtUnloadProtocol@0
_TEXT	SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT	ENDS
;	COMDAT _PtCloseAdapterComplete@8
_TEXT	SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT	ENDS
;	COMDAT _PtResetComplete@8
_TEXT	SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT	ENDS
;	COMDAT _PtRequestComplete@12
_TEXT	SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT	ENDS
;	COMDAT _PtStatus@16
_TEXT	SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT	ENDS
;	COMDAT _PtStatusComplete@4
_TEXT	SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT	ENDS
;	COMDAT _PtSendComplete@12
_TEXT	SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT	ENDS
;	COMDAT _PtTransferDataComplete@16
_TEXT	SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT	ENDS
;	COMDAT _PtReceive@28
_TEXT	SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT	ENDS
;	COMDAT _PtReceiveComplete@4
_TEXT	SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT	ENDS
;	COMDAT _PtReceivePacket@8
_TEXT	SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT	ENDS
;	COMDAT _PtPNPHandler@8
_TEXT	SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT	ENDS
;	COMDAT _PtPnPNetEventReconfigure@8
_TEXT	SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT	ENDS
;	COMDAT _PtPnPNetEventSetPower@8
_TEXT	SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT	ENDS
FLAT	GROUP _DATA, CONST, _BSS
	ASSUME	CS: FLAT, DS: FLAT, SS: FLAT
endif

INCLUDELIB LIBC
INCLUDELIB OLDNAMES

_DATA	SEGMENT
COMM	_DrvCompileInfo:BYTE:016H
_home3	DB	00H
	DB	0c0H
	DB	0a8H
	DB	082H
	DB	050H
	DB	07bH
	ORG $+2
_home2_2 DB	00H
	DB	020H
	DB	078H
	DB	00H
	DB	0e9H
	DB	0cdH
	ORG $+2
_home2_4 DB	00H
	DB	04H
	DB	05aH
	DB	07dH
	DB	04dH
	DB	00H
	ORG $+2
_home3IPAddr DD	0c0a80105H
_home2_2IPAddr DD 0c0a80102H
_home2_4IPAddr DD 0c0a80104H
?DateCompiledBase@?1??PtBindAdapter@@9@9 DB 'Dec  3 2003', 00H ; `PtBindAdapter'::`2'::DateCompiledBase
?TimeCompiledBase@?1??PtBindAdapter@@9@9 DB ' 17:42:27', 00H ; `PtBindAdapter'::`2'::TimeCompiledBase
_DATA	ENDS
PUBLIC	_PtBindAdapter@20
EXTRN	__imp__NdisAllocateSpinLock@4:NEAR
EXTRN	__imp__NdisOpenAdapter@44:NEAR
EXTRN	__imp__NdisCloseAdapter@8:NEAR
EXTRN	__imp__NdisOpenProtocolConfiguration@12:NEAR
EXTRN	__imp__NdisIMInitializeDeviceInstanceEx@12:NEAR
EXTRN	__imp__NdisReadConfiguration@20:NEAR
EXTRN	__imp__NdisCloseConfiguration@4:NEAR
EXTRN	_ProtHandle:DWORD
EXTRN	_DriverHandle:DWORD
EXTRN	_MediumArray:BYTE
EXTRN	__imp__NdisAllocatePacketPoolEx@20:NEAR
EXTRN	__imp__NdisFreePacketPool@4:NEAR
EXTRN	__imp__NdisAllocateMemoryWithTag@12:NEAR
EXTRN	__imp__NdisFreeMemory@12:NEAR
EXTRN	__imp__NdisInitializeEvent@4:NEAR
EXTRN	__imp__NdisResetEvent@4:NEAR
EXTRN	__imp__NdisWaitEvent@8:NEAR
EXTRN	_DbgPrint:NEAR
;	COMDAT _PtBindAdapter@20
; File g:\pcadev\ndisim\passthruex\part2\james\james\sys\protocol.c
_TEXT	SEGMENT
$SG16025 DB	'U', 00H, 'p', 00H, 'p', 00H, 'e', 00H, 'r', 00H, 'B', 00H
	DB	'i', 00H, 'n', 00H, 'd', 00H, 'i', 00H, 'n', 00H, 'g', 00H, 's'
	DB	00H, 00H, 00H
$SG16038 DB	'Passthru: ', 00H
	ORG $+1
$SG16039 DB	'JApassthru.protocol v1.01 (compiled %s)', 0aH, 00H
	ORG $+3
$SG16040 DB	'Passthru: ', 00H
	ORG $+1
$SG16041 DB	'==> Protocol BindAdapter', 0aH, 00H
	ORG $+2
$SG16078 DB	'Passthru: ', 00H
	ORG $+1
$SG16079 DB	'BindAdapter: Adapt %p, IMInitializeDeviceInstance error '
	DB	'%x', 0aH, 00H
$SG16101 DB	'Passthru: ', 00H
	ORG $+1
$SG16102 DB	'<== Protocol BindAdapter: pAdapt %p, Status %x', 0aH, 00H
; Function compile flags: /Odt
tv334 = -105
tv331 = -104
tv328 = -100
tv327 = -96
tv322 = -89
tv319 = -88
tv317 = -84
tv89 = -77
tv86 = -76
tv88 = -72
tv87 = -68
tv81 = -61
tv77 = -60
tv80 = -56
tv79 = -52
_LocalStatus$16089 = -48
_ConfigHandle$ = -44
_DeviceStr$ = -40
_TotalSize$ = -32
_Param$ = -28
_Sts$ = -24
_MediumIndex$ = -20
_pAdapt$ = -16
_DateCompiled$ = -12
_Status$ = 8
_BindContext$ = 12
_DeviceName$ = 16
_SystemSpecific1$ = 20
_SystemSpecific2$ = 24
_PtBindAdapter@20 PROC NEAR				; COMDAT

; 71   : {

  00100	55		 push	 ebp
  00101	8b ec		 mov	 ebp, esp
  00103	83 ec 6c	 sub	 esp, 108		; 0000006cH
  00106	56		 push	 esi
  00107	57		 push	 edi

; 72   :     NDIS_HANDLE                     ConfigHandle = NULL;

  00108	c7 45 d4 00 00
	00 00		 mov	 DWORD PTR _ConfigHandle$[ebp], 0

; 73   :     PNDIS_CONFIGURATION_PARAMETER   Param;
; 74   :     NDIS_STRING                     DeviceStr = NDIS_STRING_CONST("UpperBindings");

  0010f	66 c7 45 d8 1a
	00		 mov	 WORD PTR _DeviceStr$[ebp], 26 ; 0000001aH
  00115	66 c7 45 da 1c
	00		 mov	 WORD PTR _DeviceStr$[ebp+2], 28 ; 0000001cH
  0011b	c7 45 dc 00 00
	00 00		 mov	 DWORD PTR _DeviceStr$[ebp+4], OFFSET FLAT:$SG16025

; 75   :     PADAPT                          pAdapt = NULL;

  00122	c7 45 f0 00 00
	00 00		 mov	 DWORD PTR _pAdapt$[ebp], 0

; 76   :     NDIS_STATUS                     Sts;
; 77   :     UINT                            MediumIndex;
; 78   :     ULONG                           TotalSize;
; 79   : 
; 80   :     // Information output.  ja, 29.11.2003.                                                                                                      
; 81   : 
; 82   :     char                     static DateCompiledBase[] = __DATE__,
; 83   :                                     TimeCompiledBase[] = " "__TIME__;
; 84   :     char                            DateCompiled[] =  // Build date in preferred (dd mmm yyyy) format.
; 85   :                                       {DateCompiledBase[4], DateCompiledBase[5], DateCompiledBase[6],

  00129	a0 04 00 00 00	 mov	 al, BYTE PTR ?DateCompiledBase@?1??PtBindAdapter@@9@9+4
  0012e	88 45 f4	 mov	 BYTE PTR _DateCompiled$[ebp], al
  00131	8a 0d 05 00 00
	00		 mov	 cl, BYTE PTR ?DateCompiledBase@?1??PtBindAdapter@@9@9+5
  00137	88 4d f5	 mov	 BYTE PTR _DateCompiled$[ebp+1], cl
  0013a	8a 15 06 00 00
	00		 mov	 dl, BYTE PTR ?DateCompiledBase@?1??PtBindAdapter@@9@9+6
  00140	88 55 f6	 mov	 BYTE PTR _DateCompiled$[ebp+2], dl

; 86   :                                        DateCompiledBase[0], DateCompiledBase[1], DateCompiledBase[2], DateCompiledBase[3],

  00143	a0 00 00 00 00	 mov	 al, BYTE PTR ?DateCompiledBase@?1??PtBindAdapter@@9@9
  00148	88 45 f7	 mov	 BYTE PTR _DateCompiled$[ebp+3], al
  0014b	8a 0d 01 00 00
	00		 mov	 cl, BYTE PTR ?DateCompiledBase@?1??PtBindAdapter@@9@9+1
  00151	88 4d f8	 mov	 BYTE PTR _DateCompiled$[ebp+4], cl
  00154	8a 15 02 00 00
	00		 mov	 dl, BYTE PTR ?DateCompiledBase@?1??PtBindAdapter@@9@9+2
  0015a	88 55 f9	 mov	 BYTE PTR _DateCompiled$[ebp+5], dl
  0015d	a0 03 00 00 00	 mov	 al, BYTE PTR ?DateCompiledBase@?1??PtBindAdapter@@9@9+3
  00162	88 45 fa	 mov	 BYTE PTR _DateCompiled$[ebp+6], al

; 87   :                                        DateCompiledBase[7], DateCompiledBase[8], DateCompiledBase[9], DateCompiledBase[10],

  00165	8a 0d 07 00 00
	00		 mov	 cl, BYTE PTR ?DateCompiledBase@?1??PtBindAdapter@@9@9+7
  0016b	88 4d fb	 mov	 BYTE PTR _DateCompiled$[ebp+7], cl
  0016e	8a 15 08 00 00
	00		 mov	 dl, BYTE PTR ?DateCompiledBase@?1??PtBindAdapter@@9@9+8
  00174	88 55 fc	 mov	 BYTE PTR _DateCompiled$[ebp+8], dl
  00177	a0 09 00 00 00	 mov	 al, BYTE PTR ?DateCompiledBase@?1??PtBindAdapter@@9@9+9
  0017c	88 45 fd	 mov	 BYTE PTR _DateCompiled$[ebp+9], al
  0017f	8a 0d 0a 00 00
	00		 mov	 cl, BYTE PTR ?DateCompiledBase@?1??PtBindAdapter@@9@9+10
  00185	88 4d fe	 mov	 BYTE PTR _DateCompiled$[ebp+10], cl

; 88   :                                        0x0
; 89   :                                       };

  00188	c6 45 ff 00	 mov	 BYTE PTR _DateCompiled$[ebp+11], 0

; 90   : 
; 91   :     if (' '==DateCompiled[0])

  0018c	0f be 55 f4	 movsx	 edx, BYTE PTR _DateCompiled$[ebp]
  00190	83 fa 20	 cmp	 edx, 32			; 00000020H
  00193	75 3d		 jne	 SHORT $L16036

; 92   :       strcpy(DrvCompileInfo, DateCompiled+1);

  00195	8d 45 f5	 lea	 eax, DWORD PTR _DateCompiled$[ebp+1]
  00198	89 45 cc	 mov	 DWORD PTR tv79[ebp], eax
  0019b	c7 45 c8 00 00
	00 00		 mov	 DWORD PTR tv80[ebp], OFFSET FLAT:_DrvCompileInfo
  001a2	8b 4d c8	 mov	 ecx, DWORD PTR tv80[ebp]
  001a5	89 4d c4	 mov	 DWORD PTR tv77[ebp], ecx
$L16600:
  001a8	8b 55 cc	 mov	 edx, DWORD PTR tv79[ebp]
  001ab	8a 02		 mov	 al, BYTE PTR [edx]
  001ad	88 45 c3	 mov	 BYTE PTR tv81[ebp], al
  001b0	8b 4d c8	 mov	 ecx, DWORD PTR tv80[ebp]
  001b3	8a 55 c3	 mov	 dl, BYTE PTR tv81[ebp]
  001b6	88 11		 mov	 BYTE PTR [ecx], dl
  001b8	8b 45 cc	 mov	 eax, DWORD PTR tv79[ebp]
  001bb	83 c0 01	 add	 eax, 1
  001be	89 45 cc	 mov	 DWORD PTR tv79[ebp], eax
  001c1	8b 4d c8	 mov	 ecx, DWORD PTR tv80[ebp]
  001c4	83 c1 01	 add	 ecx, 1
  001c7	89 4d c8	 mov	 DWORD PTR tv80[ebp], ecx
  001ca	80 7d c3 00	 cmp	 BYTE PTR tv81[ebp], 0
  001ce	75 d8		 jne	 SHORT $L16600

; 93   :     else

  001d0	eb 3b		 jmp	 SHORT $L16037
$L16036:

; 94   :       strcpy(DrvCompileInfo, DateCompiled+0);

  001d2	8d 55 f4	 lea	 edx, DWORD PTR _DateCompiled$[ebp]
  001d5	89 55 bc	 mov	 DWORD PTR tv87[ebp], edx
  001d8	c7 45 b8 00 00
	00 00		 mov	 DWORD PTR tv88[ebp], OFFSET FLAT:_DrvCompileInfo
  001df	8b 45 b8	 mov	 eax, DWORD PTR tv88[ebp]
  001e2	89 45 b4	 mov	 DWORD PTR tv86[ebp], eax
$L16601:
  001e5	8b 4d bc	 mov	 ecx, DWORD PTR tv87[ebp]
  001e8	8a 11		 mov	 dl, BYTE PTR [ecx]
  001ea	88 55 b3	 mov	 BYTE PTR tv89[ebp], dl
  001ed	8b 45 b8	 mov	 eax, DWORD PTR tv88[ebp]
  001f0	8a 4d b3	 mov	 cl, BYTE PTR tv89[ebp]
  001f3	88 08		 mov	 BYTE PTR [eax], cl
  001f5	8b 55 bc	 mov	 edx, DWORD PTR tv87[ebp]
  001f8	83 c2 01	 add	 edx, 1
  001fb	89 55 bc	 mov	 DWORD PTR tv87[ebp], edx
  001fe	8b 45 b8	 mov	 eax, DWORD PTR tv88[ebp]
  00201	83 c0 01	 add	 eax, 1
  00204	89 45 b8	 mov	 DWORD PTR tv88[ebp], eax
  00207	80 7d b3 00	 cmp	 BYTE PTR tv89[ebp], 0
  0020b	75 d8		 jne	 SHORT $L16601
$L16037:

; 95   : 
; 96   :     strcat(DrvCompileInfo, TimeCompiledBase);

  0020d	c7 45 ac 00 00
	00 00		 mov	 DWORD PTR tv317[ebp], OFFSET FLAT:?TimeCompiledBase@?1??PtBindAdapter@@9@9
  00214	8b 4d ac	 mov	 ecx, DWORD PTR tv317[ebp]
  00217	89 4d a8	 mov	 DWORD PTR tv319[ebp], ecx
$L16602:
  0021a	8b 55 ac	 mov	 edx, DWORD PTR tv317[ebp]
  0021d	8a 02		 mov	 al, BYTE PTR [edx]
  0021f	88 45 a7	 mov	 BYTE PTR tv322[ebp], al
  00222	ff 45 ac	 inc	 DWORD PTR tv317[ebp]
  00225	80 7d a7 00	 cmp	 BYTE PTR tv322[ebp], 0
  00229	75 ef		 jne	 SHORT $L16602
  0022b	8b 4d ac	 mov	 ecx, DWORD PTR tv317[ebp]
  0022e	2b 4d a8	 sub	 ecx, DWORD PTR tv319[ebp]
  00231	8b 55 a8	 mov	 edx, DWORD PTR tv319[ebp]
  00234	89 55 a0	 mov	 DWORD PTR tv327[ebp], edx
  00237	89 4d 9c	 mov	 DWORD PTR tv328[ebp], ecx
  0023a	b8 00 00 00 00	 mov	 eax, OFFSET FLAT:_DrvCompileInfo
  0023f	83 c0 ff	 add	 eax, -1
  00242	89 45 98	 mov	 DWORD PTR tv331[ebp], eax
$L16603:
  00245	8b 4d 98	 mov	 ecx, DWORD PTR tv331[ebp]
  00248	8a 51 01	 mov	 dl, BYTE PTR [ecx+1]
  0024b	88 55 97	 mov	 BYTE PTR tv334[ebp], dl
  0024e	ff 45 98	 inc	 DWORD PTR tv331[ebp]
  00251	80 7d 97 00	 cmp	 BYTE PTR tv334[ebp], 0
  00255	75 ee		 jne	 SHORT $L16603
  00257	8b 7d 98	 mov	 edi, DWORD PTR tv331[ebp]
  0025a	8b 75 a0	 mov	 esi, DWORD PTR tv327[ebp]
  0025d	8b 45 9c	 mov	 eax, DWORD PTR tv328[ebp]
  00260	8b c8		 mov	 ecx, eax
  00262	c1 e9 02	 shr	 ecx, 2
  00265	f3 a5		 rep movsd
  00267	8b c8		 mov	 ecx, eax
  00269	83 e1 03	 and	 ecx, 3
  0026c	f3 a4		 rep movsb

; 97   : 
; 98   :     DBGPRINT((JADrvNm "." JADrvRtnName " v" JADrvRtnVer " (compiled %s)\n", DrvCompileInfo));

  0026e	68 00 00 00 00	 push	 OFFSET FLAT:$SG16038
  00273	e8 00 00 00 00	 call	 _DbgPrint
  00278	83 c4 04	 add	 esp, 4
  0027b	68 00 00 00 00	 push	 OFFSET FLAT:_DrvCompileInfo
  00280	68 00 00 00 00	 push	 OFFSET FLAT:$SG16039
  00285	e8 00 00 00 00	 call	 _DbgPrint
  0028a	83 c4 08	 add	 esp, 8

; 99   : 
; 100  :     // End information output.  ja, 29.11.2003.
; 101  :  
; 102  :     UNREFERENCED_PARAMETER(BindContext);
; 103  :     UNREFERENCED_PARAMETER(SystemSpecific2);
; 104  :     
; 105  :     DBGPRINT(("==> Protocol BindAdapter\n"));

  0028d	68 00 00 00 00	 push	 OFFSET FLAT:$SG16040
  00292	e8 00 00 00 00	 call	 _DbgPrint
  00297	83 c4 04	 add	 esp, 4
  0029a	68 00 00 00 00	 push	 OFFSET FLAT:$SG16041
  0029f	e8 00 00 00 00	 call	 _DbgPrint
  002a4	83 c4 04	 add	 esp, 4
$L16042:

; 106  : 
; 107  :     do
; 108  :     {
; 109  :         //
; 110  :         // Access the configuration section for our binding-specific
; 111  :         // parameters.
; 112  :         //
; 113  :         NdisOpenProtocolConfiguration(Status,
; 114  :                                        &ConfigHandle,
; 115  :                                        SystemSpecific1);

  002a7	8b 4d 14	 mov	 ecx, DWORD PTR _SystemSpecific1$[ebp]
  002aa	51		 push	 ecx
  002ab	8d 55 d4	 lea	 edx, DWORD PTR _ConfigHandle$[ebp]
  002ae	52		 push	 edx
  002af	8b 45 08	 mov	 eax, DWORD PTR _Status$[ebp]
  002b2	50		 push	 eax
  002b3	ff 15 00 00 00
	00		 call	 DWORD PTR __imp__NdisOpenProtocolConfiguration@12

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -