txtsetup.sif文件SetupData节DisableAsr的值和setupldr!SlCheckASRKeypress函数的关系和检测F2键进入ASRSlCheckOemKeypress(OemKeypressTimeout);{PCSTR szOptionsToAdd NULL;CHAR szOptionsToRemove[sizeof(/noguiboot/nodebug)];szOptionsToRemove[0] 0;//// If F8 was pressed, add the debug options//if(EnableDebugger) {if(InfFile ! NULL) {szOptionsToAdd SlGetSectionKeyIndex(InfFile, SetupData, SetupDebugOptions, 0);}if(NULL szOptionsToAdd) {szOptionsToAdd /debug;}strcat(szOptionsToRemove, /nodebug);}kd x setupldr!EnableDebugger00348b08 setupldr!EnableDebugger 0x00 kd dv setupldr!IsUpgradesetupldr!IsUpgrade 0x00 if (IsUpgrade) {strcat(szOptionsToRemove, /noguiboot);}//// We need to check to see if the user pressed any keys to force loading,// an ASR pnp repair disk. Only do this if the user didnt select// anything in the SlCheckOemKeypress function.//if(!UseCommandConsole !WinPEBoot !IsUpgrade !BlBootingFromNet) {PCHAR pTmp;pTmp SlGetSectionKeyIndex(InfFile,SetupData,DisableAsr,0);if ((pTmp NULL) || (atoi(pTmp) 0)) {SlCheckASRKeypress();}}txtsetup.sif文件部分内容[SetupData]SetupSourcePath \MajorVersion 5MinorVersion 2DefaultPath\WINDOWSSetupDebugOptions /debugOsLoadOptions /fastdetect /noguiboot /nodebugForceScsi 1ForceDiskClass 1ForceCDRom 1Architecture i386DriverCabNamedriver.cabProductType 1LoadIdentifier %srv_id%BaseVideoLoadId %srv_id_vga%RequiredMemory 134217728Pagefile 120,250kd kc#00 setupldr!SlGetSectionKeyIndex01 setupldr!SlInit02 setupldr!BlStartup03 setupldr!NtProcessStartupWARNING: Frame IP not in any known module. Following frames may be wrong.04 0x005 0x006 0x0kd dvINFHandle 0x8007b0d8SectionName 0x003255d0 SetupDataKey 0x003255c4 DisableAsrValueIndex 0kd db 0x8007b0d88007b0d8 b0 a8 21 80 00 00 00 00-56 65 72 73 69 6f 6e 00 ..!.....Version.8007b0e8 73 69 67 6e 61 74 75 72-65 00 43 6c 61 73 73 47 signature.ClassG8007b0f8 55 49 44 00 7b 30 30 30-30 30 30 30 30 2d 30 30 UID.{00000000-008007b108 30 30 2d 30 30 30 30 2d-30 30 30 30 2d 30 30 30 00-0000-0000-0008007b118 30 30 30 30 30 30 30 30-30 7d 00 53 6f 75 72 63 000000000}.Sourc8007b128 65 44 69 73 6b 73 4e 61-6d 65 73 00 5f 78 00 25 eDisksNames._x.%8007b138 63 64 6e 61 6d 65 25 00-25 63 64 74 61 67 66 69 cdname%.%cdtagfi8007b148 6c 65 25 00 5f 31 00 25-63 64 6e 61 6d 65 25 00 le%._1.%cdname%.kd gueax00000000 ebx00000000 ecx003255c4 edx00000048 esi00000000 edi003482a3eip00327288 esp00060bc0 ebp00060df4 iopl0 nv up di pl zr na pe nccs0008 ss0010 ds0010 es0010 fs0030 gs0000 efl00000046setupldr!SlInit0x1242:00327288 3bc3 cmp eax,ebxkd kc 5#00 setupldr!SlCheckASRKeypress01 setupldr!SlInit02 setupldr!BlStartup03 setupldr!NtProcessStartupWARNING: Frame IP not in any known module. Following frames may be wrong.04 0x0kd dvFloppyId 0x60df4FirstTry 0x00 c 0x32397cFloppyName char [80] ???ASRPNPSifHandle 0x00000000FileName char [128] Done 0x00 PromptASR 0x00 if (FirstTry) {StatusText BlFindMessage(SL_MSG_PRESS_ASR);FirstTry FALSE;}else {StatusText BlFindMessage(SL_MSG_PREPARING_ASR);}if (FirstTry) {StatusText BlFindMessage(SL_MSG_PRESS_ASR);kd peax00384508 ebx00000000 ecx00382420 edx00384504 esi00000000 edi003482a3eip003239c2 esp00060acc ebp00060bb8 iopl0 nv up di pl zr na pe nccs0008 ss0010 ds0010 es0010 fs0030 gs0000 efl00000046setupldr!SlCheckASRKeypress0x46:003239c2 885dfd mov byte ptr [ebp-3],bl ss:0010:00060bb501kd db 0038450800384508 50 72 65 73 73 20 46 32-20 74 6f 20 72 75 6e 20 Press F2 to run00384518 41 75 74 6f 6d 61 74 65-64 20 53 79 73 74 65 6d Automated System00384528 20 52 65 63 6f 76 65 72-79 20 28 41 53 52 29 2e Recovery (ASR).00384538 2e 2e 0d 0a 00 00 00 00-b4 00 00 00 20 20 20 20 ............if( StatusText ! NULL ) {SlWriteStatusText(StatusText);}Press F2 to run Automated System Recovery (ASR)...do {if(ArcGetReadStatus(ARC_CONSOLE_INPUT) ESUCCESS) {//// There is a key pending, so see what it is.//c SlGetChar();switch(c) {case SL_KEY_F2: // Force ASR promptPromptASR TRUE;Done TRUE;break;case ASCI_ESC:PromptASR FALSE;Done TRUE;break;}}} while( !Done (EndTime ArcGetRelativeTime()) );kd gBreakpoint 9 hiteax00013665 ebx00000000 ecx000000b6 edx00000008 esi00013665 edi003482a3eip00329dfa esp00060ac4 ebp00060bb8 iopl0 nv up di pl zr na pe nccs0008 ss0010 ds0010 es0010 fs0030 gs0000 efl00000046setupldr!SlWriteStatusText:00329dfa 55 push ebpkd dvText 0x00323966 AttributeSave 0xfa Count 8kd dv PromptASRPromptASR 0x00 5秒钟的时间内检测到按键F2PromptASR TRUE没有检测到按键F2或检测到按键ESC则PromptASR FALSE。