• <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>

            李帥的博客

            軟件開發愛好者

              C++博客 :: 首頁 :: 新隨筆 :: 聯系 :: 聚合  :: 管理 ::
              14 隨筆 :: 3 文章 :: 4 評論 :: 0 Trackbacks

            #

            9. Which of the following statements provide a valid reason NOT to use RTTI for distributed (i.e. networked between different platforms) applications in C++?
            A. RTTI is too slow.
            B. RTTI does not have standardized run-time behavior.
            C. RTTI uses too much memory.
            D. RTTI's performance is unpredictable/non-deterministic.
            E. RTTI frequently fails to function correctly at run-time

            11. A C++ developer wants to handle a static_cast <char*>() operation for the class String shown below. Which of the following options are valid declarations that will accomplish this task?
            class String {
            public:
              //...
              //declaration goes here
            };
            A. char* operator char*();
            B. operator char*();
            C. char* operator();
            D. String operator char*();
            E. char* operator String();


            16. When a Copy Constructor is not written for a class, the C++ compiler generates one. Which of the following statements correctly describe the actions of this compiler-generated Copy Constructor when invoked?
            A. The compiler-generated Copy Constructor makes the object being constructed, a reference to the object passed to it as an argument.
            B. The compiler-generated Copy Constructor does not do anything by default.
            C. The compiler-generated Copy Constructor performs a member-wise copy of the object passed to it as an argument, into the object being constructed.
            D. The compiler-generated Copy Constructor tags the object as having been Copy-Constructed by the compiler.
            E. The compiler-generated Copy Constructor invokes the assignment operator of the class.

            17. Which of the following must be ensured in order to implement a polymorphic function in C++?
            A.        There has to be a pointer of the derived class that has implemented the polymorphic function that holds the address of the derived class object.
            B.        The function must be declared as virtual in both the base class and in the derived class that overrides the function.
            C.        The function must be declared as pure virtual.
            D.        There has to be a base class pointer holding the address of a base or derived class object that has implemented the polymorphic function.
            E.        The function must be declared as virtual in the base class.

            18. Protected, or private, inheritance, as opposed to public inheritance, models which type of relationship in C++?
            A.        Can-only-have-one-of
            B.        Is-implemented-in-terms-of
            C.        Was-a
            D.        Has-a
            E.        Shares-a-relationship-with

            19. Which of the following statements describe correct methods of handling C++ exceptions?
            A.        Once an exception is thrown, the compiler unwinds the heap, freeing any memory dynamically allocated within the block from which the exception was thrown.
            B.        In a hierarchy of exception classes, the order of handling exceptions can be from the most specific class to the most general class.
            C.        Catching an exception by reference is preferable to catching it by value.
            D.        If an exception is caught by its address or pointer, it is the responsibility of the thrower to release the memory occupied by the exception.
            E.        To write an exception handler, it is essential to know the concrete class of exception to catch.

            20. Which of the following statements regarding functions' default arguments in C++ are correct?
            A.        Default arguments cannot be of a user-defined type.
            B.        Default arguments exist in the global heap and not on the function's stack.
            C.        Default arguments cannot be of pointer type.
            D.        Default arguments can never precede non-default arguments.
            E.        Default arguments are not considered for generating the function's signature.

            21. Which of the following classes must be instantiated so that the object can be used both for reading and writing to the same file in C++?
            A.        ofstream
            B.        stream
            C.        ifstream
            D.        fstream
            E.        iostream

            22.  Which of the following reasons describe why a destructor cannot throw an exception in C++?
            A.        Since the object is being destroyed, it is illogical to throw an exception then.
            B.        A destructor may be invoked as a result of stack unwinding while an exception is being handled.
            C.        It can invoke the terminate() handler.
            D.        The C++ language does not permit it; a throw statement in a destructor will be caught as an error by the compiler.
            E.        A destructor in C++ cannot implement a try...catch block

            24. Which of the following identify const-correctness failures in the C++ program below?
            template<typename T>
            class MyArray
            {
            public:
                MyArray();
                MyArray(MyArray& copy);
                MyArray& operator=(MyArray& copy);
                //...

            };

            class MyData
            {
            public:
                MyData(MyArray<int>& x, MyArray<int>& y);
                //...

                const MyArray<int>& x();
                const MyArray<int>& y();
            };

            MyArray<int> read_data(int*, char**);
            void make_changes(MyData* edit);

            int main(int argc, char* argv[])
            {
                const MyArray<int> read_x = read_data(&argc, argv);
                const MyArray<int> read_y = read_data(&argc, argv);
                 
                MyData user_data(read_x, read_y);
                MyData edit_buffer(user_data);
                make_changes(&edit_buffer);
            }

            A.        MyData(MyArray<int>& x, MyArray<int>& y); should be
            MyData(const MyArray<int>& x, const MyArray<int>& y);

            B.        MyArray(MyArray& copy); should be
            MyArray(const MyArray& copy);

            C.        MyArray& operator=(MyArray& copy); should be
            const MyArray& operator=(const MyArray& copy);

            D.        void make_changes(MyData* edit); should be
            void make_changes(const MyData* edit);

            E.        const MyArray& operator=(const MyArray& copy); should be
            const MyArray& operator=(const MyArray& copy) const;

            25. Which of the following operators must be overloaded by function objects in the Standard Template Library?
            A.        operator +()
            B.        operator ==()
            C.        operator ++()
            D.        operator ()()
            E.        operator []()

            ======================================================

            附上我的選擇和疑問,歡迎大家指正和討論:

            9. AD (not quite sure)
            11. A (What does this question mean?! Can anyone explain it? )
            16. AC  (Is A right?! Should it be 'a CONST reference to the object passed to it as an argument')
            17. E (not quite sure. Is A or D right too? )
            18. A or E. I have no idea at all!!!!
            19 C (Is B right too?)
            20. only D?
            21. DE
            22. BC ?
            24. only B ?
            25. D
            posted @ 2008-11-07 21:37 李帥 閱讀(1352) | 評論 (1)編輯 收藏

            softICE的安裝與配置

            ㈠、SOFTICE安裝 

            1、SOFTICE目前最新版本是4.05,如你的系統是win9x,就請下載for win9x版本的SOFTICE,建議下載SOFTICE的最新版本,這樣穩定性好些。運行setup.exe開始安裝,出現(圖一):

            2、然后點擊下一步,輸入安裝序列號(圖二)(序列號一般在安裝軟件的readme.txt或其它說明文件里)

            3、然后下面幾個畫面是要求選定路徑和安裝組件,不久你會來到顯卡配制對話框(圖三):

            在顯卡配制里兩種方法:

            ①這種配制使SOFTICE激活狀態時類似DOS全屏狀態一樣(也就是字符模式狀態),在顯卡列表選擇你的顯卡類型,Universal Vidoe DriverUse monochrome card/monitor這兩項不要選,然后點擊Test按鈕,在測試過程中你能看到各種顏色的字符,說明顯卡測試通過,就可點擊下一步了。

            ② 這種配制使SOFTICE在激活狀態下類似windows應用程序的一個窗口那樣,這樣在調試時可避免顯示器不停地在圖形和字符模式轉換,對提高顯示器壽命大有好處。配制時,顯卡列表一欄忽略,不用配制,只要把
            Universal Vidoe Driver這一項選上,然后test,如跳出如(圖四)對話框,測試通過。(本人強烈推薦這種方式)

            ㈡、SOFTICE配制

            1、Symbol Loader的使用

            你在開始SOFTICE的菜單里有一項ymbol Loader快捷方式,運行后,在其菜單EDITSOFTICE Initialization Settings選項,打開后如圖(圖八)。這里你就可配制SOFTICE了。

            General選項

            在Initialization string里,你可填上需要SOFTICE一啟動自動運行的命令。如:

            WD 2; WC 14; FAULTS OFF; IXHERE OFF; IYHERE OFF; set font 2;lines 40;x;(各行以分號分開)

            Exports選項

            在這里可添加相關的DLL文件,以便在SOFTICE下攔截這些DLL的函數。特別是破解VB程序時,定要將VB運行庫裝載進去。

            Keyboard Mappings選項

            這里配制各功能熱鍵。如:F5="^x;"用F5鍵代替命令X.

            Macro Definitions選項

            宏定義,你可定制各種命令宏,以方便平時的操作。
            如:s7878="S 30:0 L ffffffff '78787878' " 用命令s7878代替一串命令:S 30:0 L ffffffff '78787878'

            Remote Debugging

            利用網絡遠程調試配制。

            注:以上所有配制好后的參數,都保存在winice.dat文件里。

            2、winice.dat配制

            在Windows 9x下 SoftICE配制除了用上面的方法外,也可通過文件winice.dat來實現的。Soft-ICE 在啟動的時候通過它裝入一些 DLL/EXE 的信息。
            你可在SOFTICE安裝目錄下發現winice.dat,可用任何文本編輯軟件打開它(如記事本)。如我機子里的winice.dat:(你可參考我的來修改你的winice.dat)


            ;注意分號后是描述語言,不被執行。
            PENTIUM=ON;<=Pentium Op-Codes
            NMI=ON
            ECHOKEYS=OFF
            NOLEDS=OFF
            NOPAGE=OFF
            SIWVIDRANGE=ON
            THREADP=ON
            LOWERCASE=OFF
            WDMEXPORTS=OFF
            MONITOR=0

            PHYSMB=128;<=這個值是你的物理內存大小
            SYM=1024
            HST=256;<=歷史緩沖區為256K
            TRA=8
            MACROS=32;<=宏操作的最大個數,此處是32個
            DRAWSIZE=2048;<= 我的顯卡內存是2MB ,此處值是你顯卡內存大小

            INIT=" wd 2;wc 20;FAULTS OFF; IXHERE OFF; IYHERE OFF; set font 2;lines 40;code on;x;";<=初始化,此處默認的是800*600分分辨率
            ;如你是全屏請換上:lines 57

            F1="h;"
            F2="^wr;"
            F3="^src;"
            F4="^rs;"
            F5="^x;"
            F6="^ec;"
            F7="^here;"
            F8="^t;"
            F9="^bpx;"
            F10="^p;"
            F11="^G @SS:ESP;"
            F12="^p ret;"
            SF3="^format;"
            CF8="^XT;"
            CF9="TRACE OFF;"
            CF10="^XP;"
            CF11="SHOW B;"
            CF12="TRACE B;"
            AF1="^wr;"
            AF2="^wd;"
            AF3="^S 0 L FFFFFFFF 8B,CA,F3,A6,74,01,9F,92,8D,5E,08;";<=VB3特征字符串
            AF4="^s 0 l ffffffff 56,57,8B,7C,24,10,8B,74,24,0C,8B,4C,24,14,33,C0,F3,66,A7;" ;<=VB4特征字符串
            AF5="^s 0 l ffffffff FF,75,E0,E8,85,EF,FF,FF,DC,1D,28,10,40,00,DF,E0,9E,75,03;" ;<=VB5特征字符串
                                       
            AF8="^XT R;"
            AF11="^dd dataaddr->0;"
            AF12="^dd dataaddr->4;"
            CF1="altscr off; lines 60; wc 32; wd 8;"
            CF2="^wr;^wd;^wc;"

            ;<=以下是宏操作命令:
            MACRO s7878="S 30:0 L ffffffff '78787878' "
            MACRO sname="S 0 L FFFFFFFF 'toye' "
            MACRO swide="s 0 l FFFFFFFF '7','8,'7','8,'7','8,'7','8,'7','8,'7','8,'7','8','7','8' "
            MACRO reg="bpx regqueryvalueexa if *(esp->8)>='Soft' do "d(esp->14)" "
            MACRO bpxpe="bpx loadlibrarya do "dd esp->4" "
            MACRO bpxgeta="bpx GetDlgItemTextA; bpx getwindowtexta; bpx getdlgitemint; bpx getdlgitemtext;"

             

            ; ***** Examples of sym files that can be included if you have the SDK *****
            ; Change the path to the appropriate drive and directory
            ;LOAD=c:\windows\system\user.exe
            ;LOAD=c:\windows\system\gdi.exe
            ;LOAD=c:\windows\system\krnl386.exe
            ;LOAD=c:\windows\system\mmsystem.dll
            ;LOAD=c:\windows\system\win386.exe

            ; Exports - change the path to the appropriate drive and directory

            EXP=c:\windows\system\advapi32.dll ;<=這四行前不要加分號,否則不被裝載,SOFTICE可能什么也攔不到 :
            EXP=c:\windows\system\kernel32.dll
            EXP=c:\windows\system\user32.dll
            exp=c:\windows\system\gdi32.dll
            exp=c:\windows\system\comctl32.dll ;


            ; 如你要破解VB程序,下面的VB運行庫將要裝載,SOFTICE默認值是沒有這幾行,你需手動加上。

            ;EXP=c:\windows\system\msvbvm60.dll;<= Visual Basic 6 具體參考第十五課VB破解
            EXP=c:\windows\system\msvbvm50.dll ;<= Visual Basic 5 注意在這五個DLL中最好不要同時裝載2個以上
            ; EXP=c:\windows\system\vb40032.dll;<= Visual Basic 4(32bit)
            ; EXP=c:\windows\system\vb40016.dll;<=Visual Basic 4(16-bit)較少見
            ; EXP=c:\windows\system\vbrun300.dll;<=Visual Basic 3


            ;EXP=c:\windows\system\vga.drv;
            ;EXP=c:\windows\system\vga.3gr
            ;EXP=c:\windows\system\sound.drv
            ;EXP=c:\windows\system\mouse.drv
            ;EXP=c:\windows\system\netware.drv
            ;EXP=c:\windows\system\system.drv
            ;EXP=c:\windows\system\keyboard.drv
            ;EXP=c:\windows\system\toolhelp.dll
            ;EXP=c:\windows\system\shell.dll
            ;EXP=c:\windows\system\commdlg.dll
            ;EXP=c:\windows\system\olesvr.dll
            ;EXP=c:\windows\system\olecli.dll
            ;EXP=c:\windows\system\mmsystem.dll
            ;EXP=c:\windows\system\winoldap.mod
            ;EXP=c:\windows\progman.exe
            ;EXP=c:\windows\drwatson.exe
            ; ***** Examples of export symbols that can be included for Windows 95 *****
            ; Change the path to the appropriate drive and directory
            EXP=c:\windows\system\kernel32.dll
            EXP=c:\windows\system\user32.dll
            EXP=c:\windows\system\gdi32.dll
            EXP=c:\windows\system\comdlg32.dll
            EXP=c:\windows\system\shell32.dll
            EXP=c:\windows\system\advapi32.dll
            EXP=c:\windows\system\shell232.dll
            EXP=c:\windows\system\comctl32.dll
            ;EXP=c:\windows\system\crtdll.dll
            ;EXP=c:\windows\system\version.dll
            EXP=c:\windows\system\netlib32.dll
            ;EXP=c:\windows\system\msshrui.dll
            EXP=c:\windows\system\msnet32.dll
            EXP=c:\windows\system\mspwl32.dll
            ;EXP=c:\windows\system\mpr.dll

             啟動windows裝載SOFTICE后,咦!怎么沒反應,沒調試畫面!哈哈,別著急,按CTRL+D看看,再按一下回到windows下,或按F5也能回來。此時調試窗口象windows開的一窗口,如是象全屏DOS一樣窗口,那就是安裝顯卡時,參數沒選好,此時按上文修正即可。下面的命令是調整SOFTICE窗口狀態:

              set font n(n=1,2,3)設置字體;本人建議set font 2(在800*600條件下)
              set origin x,y(x,y)鎖定窗口;
              lines n n=(25-128)設置顯示行數;本人建議lines 40
              Ctrl+Alt+光標鍵 移動窗口;
              Ctrl+Alt+home 重設窗口位置原點(0,0);
              Ctrl+L 刷新。

            如你以默認winice.dat啟動SOFTICE,有可能需用WD打開數據窗口;用SET FONT 2 設置字體等重復工作。你可在winice.dat文件內設置自動執行命令操作,方法是在INIT這一行,各命令用分號分開,如:

            INIT=" WD 2; WC 14; FAULTS OFF; IXHERE OFF; IYHERE OFF; set font 2;lines 40;x;"這樣配制后界面類似TRW2000。(這些是在800*600條件下的情況,如你不是此分辯率可調整set font n;lines n)

            二、SOFTICE for Windows Millennium

             由于Windows Millennium沒有了DOS平臺,因此不能用常用的方法來安裝SOFTICE,在此平臺上可以運行SOFTICE for WIN9x版本和TRW2000版本。要實現SOFTICE在Windows Millennium平臺的安裝,需要工具Winice Loader,安裝過程如下:

            1 正常安裝Windows Millennium,如在C:\WIN98ME;
            2 正常安裝Softice 405 Build 334;
            3 復制WINICE.EXE、WINICE.DAT、SIWVID.386 三個文件到 C:\WIN98ME下;
            4 從Winice Loader內解壓 LOADER.EXE,復制這個文件到C:\WINME98\SYSTEM\VMM32\ 下.
            5 重新啟動系統。

            三、SOFTICE for NT/2K安裝與配制

            1、SOFTICE for NT/2k的安裝與for 9x版本差不多,所不同的是在第五步:裝載SOFTICE方式選擇,如圖(圖九):

            你可根據需要選擇不同的裝載方式,注:如你選擇了Manual方式,要裝載SOFTICE,需要來SOFTICE的菜單里運行選項:START SOFTICE快捷方式來裝載SOFTICE。

            2、在NT下,配制SOFTICE是用SOFTICE Loader(從你的開始菜單選),選擇Edit/SoftICE,一般的選項是初始化,這里你可參考手冊了解不同的開關選項的詳細描述。如:

            CODE ON; FAULTS OFF; I3HERE OFF; WD 3; WF; X;

            其它兩個重要的選項是Symbols & Exports。如果你擁有自己系統的SDK(軟件開發工具包),你可用SOFTICE裝載并調試它。那些沒有SDK應該用exports選項從%WINNT%/System32 目錄下增加下面的DLL文件。

            advapi32.dll, comctl32.dll, comdlg32.dll, gdi32.dll, kernel32.dll, msvbvm(50/60).dll (如果需要), msvcrt.dll (如果需要), ole32.dll, oleaut32.dll, shell32.dll, user32.dll, version.dll.

             

            4、再下一步是鼠標的配制(圖五):

            現在鼠標常見的一般是串行口或ps/2接口,你跟據自己的鼠標接口類型或位置選上合適的就可。如碰到鼠標在SOFTICE調試畫面不能用或一用死機,可能是沒選好正確的選項,你可在SOFTICE菜單里的,運行mosue setup這個菜單項重新配制鼠標。

            5、最后一步是詢問以何種方式裝載SOFTICE的主文件winice.exe(圖六):

            首先要了解SOFTICE for 9x版本是如何裝載的,在SOFTICE的安裝目錄下有winice.exe這個文件,windows啟動到純DOS環境下,運行winice.exe這個文件,將裝載SOFTICE。
            安裝時默認將C:\PROGRA~1\NUMEGA\SOFTIC~1\WINICE.EXE這一行放時進Autoexec.bat(自動批處理文件),這樣windows以后每次都運行Autoexec.bat這個文件,自動裝載SOFTICE。另外,你可根據自身需要配制啟動模式,具體參考第8步。

            6、然后安裝程序將復制文件到硬盤里,來到最后一個對話框(圖七):

            最后一項是電子注冊,注冊成功后,以后可在線升級SOFTICE版本,這里選最后一項Regiter later.

            7、至此安裝完成,重新啟動windows,微機先到DOS下,自動或手動運行相應批處理文件,運行其內的winice.exe文件,裝載windows。

            8、啟動菜單配制:

            通過配制啟動菜單,啟動時根據自己的需要選擇是否裝載SOFTICE。

            AUTOEXEC.BAT配制樣例

            @ECHO OFF

            goto %config%

            :SICE
            C:\PROGRA~1\NUMEGA\SOFTIC~1\WINICE.EXE
            goto common

            :NORM
            goto common

            :common

            CONFIG.SYS配制樣例:

            [MENU]
            MENUITEM NORM,Windows 9x
            MENUITEM SICE,Windows 9x with SoftICE
            MENUDEFAULT NORM,2


            [NORM]

            [SICE]

            [common]

            posted @ 2008-11-06 15:22 李帥 閱讀(1972) | 評論 (0)編輯 收藏

                 摘要:   閱讀全文
            posted @ 2008-09-23 08:20 李帥 閱讀(1915) | 評論 (1)編輯 收藏

            RtlInitUnicodeString ( &TcpipName, L"\\Driver\\Tcpip" );

            ObReferenceObjectByName( &TcpipName,
                                  OBJ_CASE_INSENSITIVE,
                                  NULL,
                                  0,
                                  *IoDriverObjectType,
                                  KernelMode,                                          
                                  NULL,
                                  &TcpipDrvObj);

            CurrentDevice = TcpipDrvObj->DeviceObject;

            while(CurrentDevice != NULL )
            {
            CurrentDevice->AttachedDevice=0;
            CurrentDevice = CurrentDevice->NextDevice;
            }

            posted @ 2008-09-20 10:34 李帥 閱讀(387) | 評論 (0)編輯 收藏

            僅列出標題
            共2頁: 1 2 
            久久亚洲天堂| 久久精品国产亚洲av麻豆蜜芽| 乱亲女H秽乱长久久久| 狠狠色噜噜色狠狠狠综合久久 | 久久久青草青青国产亚洲免观| 久久久久九九精品影院| 97精品依人久久久大香线蕉97| 久久精品亚洲精品国产色婷| 国产福利电影一区二区三区,免费久久久久久久精 | 久久国产成人精品麻豆| 亚洲性久久久影院| 精品久久久久久中文字幕| 欧美一级久久久久久久大| 久久久久人妻精品一区二区三区| 国产精品免费久久| 久久不见久久见免费视频7| 久久久久无码精品| 波多野结衣中文字幕久久| 怡红院日本一道日本久久| 99久久综合国产精品免费| 伊人久久大香线焦综合四虎| 中文字幕乱码人妻无码久久| 久久人人爽人人澡人人高潮AV| 国产69精品久久久久久人妻精品| 国产ww久久久久久久久久| 久久精品99久久香蕉国产色戒| 一级A毛片免费观看久久精品| 久久精品国内一区二区三区| 日韩久久久久久中文人妻| 久久成人小视频| 久久免费看黄a级毛片| 欧美日韩成人精品久久久免费看| 久久不射电影网| 日韩欧美亚洲综合久久影院d3| 久久久久亚洲av无码专区喷水| 久久久噜噜噜久久中文字幕色伊伊| 久久亚洲精品无码观看不卡| 久久国产精品偷99| 久久久久国产日韩精品网站| 久久中文字幕视频、最近更新| 亚洲国产成人久久精品99|