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

📄 dvdioctl.cod

📁 windows CE 的BSP开发包.包含众多的驱动程序和OAL层的开发代码
💻 COD
📖 第 1 页 / 共 4 页
字号:
; Function compile flags: /Ogsy

  00000			 AREA	 |.text| { |?DVDGetCopySystem@CPCIDiskAndCD@@QAAHPAE0@Z| }, CODE, ARM, SELECTION=1 ; comdat noduplicate

  00000		 |?DVDGetCopySystem@CPCIDiskAndCD@@QAAHPAE0@Z| PROC ; CPCIDiskAndCD::DVDGetCopySystem

; 505  : {

  00000		 |$L32510|
  00000	e92d47f0	 stmdb       sp!, {r4 - r10, lr}
  00004	e24dd02c	 sub         sp, sp, #0x2C
  00008		 |$M32508|
  00008	e1a06002	 mov         r6, r2
  0000c	e1a07001	 mov         r7, r1
  00010	e1a05000	 mov         r5, r0

; 506  :     BOOL                 fSuccess = FALSE;
; 507  :     ATAPI_COMMAND_PACKET CmdPkt;
; 508  :     PRDVDCDB             pCmd = (PRDVDCDB)&CmdPkt;
; 509  :     RDVDFMT_Copy         fmtCopy;
; 510  :     SGX_BUF              SgBuf;
; 511  :     DWORD                dwRet;
; 512  : 
; 513  :     DEBUGCHK(NULL != pbCopySystem);
; 514  :     DEBUGCHK(NULL != pbRegionManagement);
; 515  : 
; 516  :     *pbCopySystem = 0;

  00014	e3a03000	 mov         r3, #0
  00018	e5c73000	 strb        r3, [r7]

; 517  :     *pbRegionManagement = 0;
; 518  : 
; 519  :     memset(&CmdPkt, 0, sizeof(ATAPI_COMMAND_PACKET));

  0001c	e3a02014	 mov         r2, #0x14
  00020	e3a01000	 mov         r1, #0
  00024	e28d0018	 add         r0, sp, #0x18
  00028	e5c63000	 strb        r3, [r6]
  0002c	e3a04000	 mov         r4, #0
  00030	eb000000	 bl          memset

; 520  :     memset(&fmtCopy, 0, sizeof(RDVDFMT_Copy));

  00034	e3a02008	 mov         r2, #8
  00038	e3a01000	 mov         r1, #0
  0003c	e28d0010	 add         r0, sp, #0x10
  00040	eb000000	 bl          memset

; 521  : 
; 522  :     pCmd->OpCode = DVDOP_READ_DVD_STRUC;
; 523  :     pCmd->Format = DVDSTRUC_FMT_COPY;
; 524  :     pCmd->Len = sizeof (RDVDFMT_Copy) << 8; // endian swap length
; 525  :     // pCmd->Len = keyLength << 8;
; 526  :     SgBuf.sb_len = sizeof(RDVDFMT_Copy);
; 527  :     SgBuf.sb_buf = (PBYTE) &fmtCopy;
; 528  : 
; 529  :     m_dwDeviceFlags &= ~DFLAGS_MEDIA_ISDVD;

  00044	e5953690	 ldr         r3, [r5, #0x690]
  00048	e3a0a0ad	 mov         r10, #0xAD
  0004c	e3a02001	 mov         r2, #1
  00050	e3c33080	 bic         r3, r3, #0x80
  00054	e3a08b02	 mov         r8, #2, 22
  00058	e3a09008	 mov         r9, #8
  0005c	e28de010	 add         lr, sp, #0x10

; 530  : 
; 531  :     // attempt to detect if media is present
; 532  :     if (!AtapiIsUnitReady()) {

  00060	e3a01000	 mov         r1, #0
  00064	e1a00005	 mov         r0, r5
  00068	e5853690	 str         r3, [r5, #0x690]
  0006c	e5cda018	 strb        r10, [sp, #0x18]
  00070	e5cd201f	 strb        r2, [sp, #0x1F]
  00074	e1cd82b0	 strh        r8, [sp, #0x20]
  00078	e58d900c	 str         r9, [sp, #0xC]
  0007c	e58de008	 str         lr, [sp, #8]
  00080	eb000000	 bl          |?AtapiIsUnitReady@CPCIDiskAndCD@@QAAHPAU_IOREQ@@@Z|
  00084	e3500000	 cmp         r0, #0
  00088	0a000011	 beq         |$exit$32297|

; 533  :         DEBUGMSG(ZONE_ERROR|ZONE_CDROM, (_T(
; 534  :             "Atapi!CPCIDiskAndCD::DVDGetCopySystem> DVD not present\r\n"
; 535  :             )));
; 536  :        goto exit;
; 537  :     }
; 538  : 
; 539  :     // fmtCopy is a struct of two DWORDs; we need to return 4th and 5th bytes
; 540  :     if (AtapiSendCommand(&CmdPkt)) {

  0008c	e3a03000	 mov         r3, #0
  00090	e3a02000	 mov         r2, #0
  00094	e28d1018	 add         r1, sp, #0x18
  00098	e1a00005	 mov         r0, r5
  0009c	eb000000	 bl          |?AtapiSendCommand@CPCIDiskAndCD@@QAAHPAU_ATAPI_COMMAND_PACKET@@GH@Z|
  000a0	e3500000	 cmp         r0, #0
  000a4	0a00000a	 beq         |$exit$32297|

; 541  :         if (AtapiReceiveData(&SgBuf, 1, &dwRet)) {

  000a8	e28d3000	 add         r3, sp, #0
  000ac	e3a02001	 mov         r2, #1
  000b0	e28d1008	 add         r1, sp, #8
  000b4	e1a00005	 mov         r0, r5
  000b8	eb000000	 bl          |?AtapiReceiveData@CPCIDiskAndCD@@QAAHPAU_SGX_BUF@@KPAK@Z|
  000bc	e3500000	 cmp         r0, #0

; 542  :             *pbCopySystem = (BYTE)(fmtCopy.Data & 0xFF);              // 4th byte

  000c0	159d2014	 ldrne       r2, [sp, #0x14]

; 543  :             *pbRegionManagement = (BYTE)((fmtCopy.Data >> 8) & 0xFF); // 5th byte
; 544  :             *pbRegionManagement = *pbRegionManagement ^ 0xFF;         // supported regions are 1s
; 545  :             fSuccess = TRUE;

  000c4	13a04001	 movne       r4, #1
  000c8	11e03422	 mvnne       r3, r2, lsr #8
  000cc	15c72000	 strneb      r2, [r7]
  000d0	15c63000	 strneb      r3, [r6]
  000d4		 |$exit$32297|

; 546  :         }
; 547  :     }
; 548  : 
; 549  : exit:;
; 550  : 
; 551  :     return fSuccess;

  000d4	e1a00004	 mov         r0, r4

; 552  : }

  000d8	e28dd02c	 add         sp, sp, #0x2C
  000dc	e8bd47f0	 ldmia       sp!, {r4 - r10, lr}
  000e0	e12fff1e	 bx          lr
  000e4		 |$M32509|

			 ENDP  ; |?DVDGetCopySystem@CPCIDiskAndCD@@QAAHPAE0@Z|, CPCIDiskAndCD::DVDGetCopySystem

	EXPORT	|?DVDGetRegion@CPCIDiskAndCD@@QAAKPAU_IOREQ@@@Z| ; CPCIDiskAndCD::DVDGetRegion
	IMPORT	|MapCallerPtr|

  00000			 AREA	 |.text| { |?DVDGetRegion@CPCIDiskAndCD@@QAAKPAU_IOREQ@@@Z| }, CODE, ARM, SELECTION=1 ; comdat noduplicate

  00000			 AREA	 |.pdata$$?DVDGetRegion@CPCIDiskAndCD@@QAAKPAU_IOREQ@@@Z|, PDATA, SELECTION=5, ASSOC=|.text| { |?DVDGetRegion@CPCIDiskAndCD@@QAAKPAU_IOREQ@@@Z| } ; comdat associative
|$T32524| DCD	|$L32523|
	DCD	0x40004502
; Function compile flags: /Ogsy

  00000			 AREA	 |.text| { |?DVDGetRegion@CPCIDiskAndCD@@QAAKPAU_IOREQ@@@Z| }, CODE, ARM, SELECTION=1 ; comdat noduplicate

  00000		 |?DVDGetRegion@CPCIDiskAndCD@@QAAKPAU_IOREQ@@@Z| PROC ; CPCIDiskAndCD::DVDGetRegion

; 287  : {

  00000		 |$L32523|
  00000	e92d4070	 stmdb       sp!, {r4 - r6, lr}
  00004	e24dd02c	 sub         sp, sp, #0x2C
  00008		 |$M32521|
  00008	e1a04001	 mov         r4, r1
  0000c	e1a06000	 mov         r6, r0

; 288  :     DWORD                dwError = ERROR_SUCCESS;
; 289  :     DWORD                dwLength;
; 290  :     SGX_BUF              SgBuf;
; 291  :     DWORD                dwRet;
; 292  :     RKFMT_RPC            rpcData;
; 293  :     PDVD_REGIONCE        preg;
; 294  :     ATAPI_COMMAND_PACKET CmdPkt;
; 295  : 
; 296  :     memset(&CmdPkt, 0, sizeof(ATAPI_COMMAND_PACKET));

  00010	e3a02014	 mov         r2, #0x14
  00014	e3a01000	 mov         r1, #0
  00018	e28d0018	 add         r0, sp, #0x18
  0001c	e3a05000	 mov         r5, #0
  00020	eb000000	 bl          memset

; 297  : 
; 298  :     // map address and check for security violation
; 299  :     preg = (PDVD_REGIONCE)MapCallerPtr((LPVOID)pIOReq->pOutBuf, sizeof(BYTE));

  00024	e5940020	 ldr         r0, [r4, #0x20]
  00028	e3a01001	 mov         r1, #1
  0002c	eb000000	 bl          MapCallerPtr

; 300  :     if (pIOReq->pOutBuf != NULL && preg == NULL) {

  00030	e5943020	 ldr         r3, [r4, #0x20]
  00034	e1a04000	 mov         r4, r0
  00038	e3530000	 cmp         r3, #0
  0003c	0a000002	 beq         |$L32201|
  00040	e3540000	 cmp         r4, #0

; 301  :         // security violation
; 302  :         DEBUGMSG(ZONE_ERROR, (TEXT(
; 303  :             "Atapi!CPCIDiskAndCD::DVDGetRegion> Failed to map pointer to caller\r\n"
; 304  :             )));
; 305  :         return ERROR_INVALID_PARAMETER;

  00044	03a05057	 moveq       r5, #0x57
  00048	0a00002d	 beq         |$L32213|
  0004c		 |$L32201|

; 306  :     }
; 307  : 
; 308  :     // read disc copy system and region
; 309  :     DVDGetCopySystem(&(preg->CopySystem), &(preg->RegionData));

  0004c	e2842005	 add         r2, r4, #5
  00050	e2841004	 add         r1, r4, #4
  00054	e1a00006	 mov         r0, r6
  00058	eb000000	 bl          |?DVDGetCopySystem@CPCIDiskAndCD@@QAAHPAE0@Z|

; 310  : 
; 311  :     memset(&CmdPkt, 0, sizeof(ATAPI_COMMAND_PACKET));

  0005c	e3a02014	 mov         r2, #0x14
  00060	e3a01000	 mov         r1, #0
  00064	e28d0018	 add         r0, sp, #0x18
  00068	eb000000	 bl          memset

; 312  : 
; 313  :     // create command packet to read RPC setting (report key)
; 314  :     dwLength = DVDSetupReadTitleKey(&CmdPkt, DvdGetRPC, 0, 0);

  0006c	e3a03000	 mov         r3, #0
  00070	e3a02000	 mov         r2, #0
  00074	e3a01008	 mov         r1, #8
  00078	e28d0018	 add         r0, sp, #0x18
  0007c	eb000000	 bl          |?DVDSetupReadTitleKey@@YAKPAU_ATAPI_COMMAND_PACKET@@EEK@Z|

; 315  :     SgBuf.sb_len = sizeof(RKFMT_RPC);

  00080	e3a02008	 mov         r2, #8

; 316  :     SgBuf.sb_buf = (PBYTE) &rpcData;

  00084	e28d3008	 add         r3, sp, #8
  00088	e58d2014	 str         r2, [sp, #0x14]
  0008c	e58d3010	 str         r3, [sp, #0x10]

; 317  : 
; 318  :     // send command
; 319  :     if (AtapiSendCommand(&CmdPkt)) {

  00090	e3a03000	 mov         r3, #0
  00094	e3a02000	 mov         r2, #0
  00098	e28d1018	 add         r1, sp, #0x18
  0009c	e1a00006	 mov         r0, r6
  000a0	eb000000	 bl          |?AtapiSendCommand@CPCIDiskAndCD@@QAAHPAU_ATAPI_COMMAND_PACKET@@GH@Z|
  000a4	e3500000	 cmp         r0, #0
  000a8	0a000014	 beq         |$L32206|

; 320  :         // fetch result
; 321  :         if (AtapiReceiveData(&SgBuf, 1, &dwRet)) {

  000ac	e28d3000	 add         r3, sp, #0
  000b0	e3a02001	 mov         r2, #1
  000b4	e28d1010	 add         r1, sp, #0x10
  000b8	e1a00006	 mov         r0, r6
  000bc	eb000000	 bl          |?AtapiReceiveData@CPCIDiskAndCD@@QAAHPAU_SGX_BUF@@KPAK@Z|
  000c0	e3500000	 cmp         r0, #0
  000c4	0a00000d	 beq         |$L32206|

; 322  :             DUMP_REPORT_KEY(rpcData);
; 323  :             // is the drive in a non-NONE RPC state?
; 324  :             if (rpcData.ResetCounts & 0xc0) {

  000c8	e5dd300c	 ldrb        r3, [sp, #0xC]
  000cc	e31300c0	 tst         r3, #0xC0

; 325  :                 // the drive is in SET, LAST CHANCE or PERM, i.e., this drive
; 326  :                 // has had its region set already
; 327  :                 preg->SystemRegion = rpcData.SystemRegion ^ 0xFF;

  000d0	15dd300d	 ldrneb      r3, [sp, #0xD]
  000d4	11e03003	 mvnne       r3, r3
  000d8	15c43006	 strneb      r3, [r4, #6]

; 328  :                 preg->ResetCount = rpcData.ResetCounts & 0x07;

  000dc	15dd300c	 ldrneb      r3, [sp, #0xC]
  000e0	12033007	 andne       r3, r3, #7
  000e4	15c43007	 strneb      r3, [r4, #7]
  000e8	1a000005	 bne         |$L32213|

; 329  :             }
; 330  :             else {
; 331  :                 // the drive is in NONE, i.e., this drive is a virgin
; 332  :                 DEBUGMSG(ZONE_ERROR|ZONE_CDROM, (_T(
; 333  :                     "Atapi!CPCIDiskAndCD::DVDGetRegion> Region has never been set\r\n"
; 334  :                     )));
; 335  :                 preg->SystemRegion = 0xFF;

  000ec	e3a030ff	 mov         r3, #0xFF

; 336  :                 preg->ResetCount = 5;

  000f0	e3a02005	 mov         r2, #5
  000f4	e5c43006	 strb        r3, [r4, #6]
  000f8	e5c42007	 strb        r2, [r4, #7]

; 337  :             }
; 338  :         }
; 339  :         else {

  000fc	ea000000	 b           |$L32213|
  00100		 |$L32206|

; 340  :             DEBUGMSG(ZONE_ERROR|ZONE_CDROM, (TEXT(
; 341  :                 "Atapi!CPCIDiskAndCD::DVDGetRegion> Failed to receive REPORT KEY response\r\n"
; 342  :                 )));
; 343  :             dwError = ERROR_READ_FAULT;
; 344  :         }
; 345  :     }
; 346  :     else {
; 347  :         DEBUGMSG(ZONE_ERROR|ZONE_CDROM, (TEXT(
; 348  :             "Atapi!CPCIDiskAndCD::DVDGetRegion> Failed to send REPORT KEY command\r\n"
; 349  :             )));
; 350  :         dwError = ERROR_READ_FAULT;

  00100	e3a0501e	 mov         r5, #0x1E
  00104		 |$L32213|

; 301  :         // security violation
; 302  :         DEBUGMSG(ZONE_ERROR, (TEXT(
; 303  :             "Atapi!CPCIDiskAndCD::DVDGetRegion> Failed to map pointer to caller\r\n"
; 304  :             )));
; 305  :         return ERROR_INVALID_PARAMETER;

  00104	e1a00005	 mov         r0, r5

; 351  :     }
; 352  : 
; 353  :     return dwError;
; 354  : }

  00108	e28dd02c	 add         sp, sp, #0x2C
  0010c	e8bd4070	 ldmia       sp!, {r4 - r6, lr}
  00110	e12fff1e	 bx          lr
  00114		 |$M32522|

			 ENDP  ; |?DVDGetRegion@CPCIDiskAndCD@@QAAKPAU_IOREQ@@@Z|, CPCIDiskAndCD::DVDGetRegion

	END

⌨️ 快捷键说明

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