在线看毛片网站电影-亚洲国产欧美日韩精品一区二区三区,国产欧美乱夫不卡无乱码,国产精品欧美久久久天天影视,精品一区二区三区视频在线观看,亚洲国产精品人成乱码天天看,日韩久久久一区,91精品国产91免费

<abbr id="27omo"></abbr>

<menu id="27omo"><dl id="27omo"></dl></menu>
    • <label id="27omo"><tt id="27omo"></tt></label>

      新聞中心

      EEPW首頁(yè) > 嵌入式系統(tǒng) > 設(shè)計(jì)應(yīng)用 > 程序運(yùn)行之后把自己刪除的方法

      程序運(yùn)行之后把自己刪除的方法

      作者: 時(shí)間:2010-09-13 來(lái)源:網(wǎng)絡(luò) 收藏

        近日看到網(wǎng)友詢問(wèn)如何實(shí)現(xiàn),不知大家對(duì)木馬甚么的興趣實(shí)在太濃,還是想要這樣的效果:用戶只要一,可執(zhí)行文件就沒(méi)有了,可是還是在跑,膽小的只怕要喊鬼呀!,老婆,快出來(lái)看上帝甚么的

      本文引用地址:http://www.biyoush.com/article/151557.htm

        。其實(shí)最典型的用法是寫反安裝程序. 閑來(lái)無(wú)事,Bear掰到一種還算巧妙的“”的。

        大家都知道,一般的程序的時(shí)候,可執(zhí)行文件本身是被操作系統(tǒng)保護(hù)的,不能用改寫的方式訪問(wèn),更別提在本身還在運(yùn)行的時(shí)侯了。在Lu0的主頁(yè)上看到一種UNDOCUMENT的,通過(guò)改變系統(tǒng)底層的文件訪問(wèn)模式實(shí)現(xiàn)刪除自己,那是實(shí)在功夫。我看了很是佩服。但是有沒(méi)有一種用在MSDN上就能查到的函數(shù)實(shí)現(xiàn)呢?有!Jeffrey Richter給我們做了一個(gè)范例:

        DeleteMe.CPP

        Module name: DeleteMe.cpp

        Written by: Jeffrey Richter

        Description: Allows an EXEcutable file to delete itself

        **************************************************/

        #include

        #include

        #include

        /////////////////////////////////////////////////

        int WINAPI WinMain(HINSTANCE h, HINSTANCE b, LPSTR psz, int n) {

        // Is this the Original EXE or the clone EXE?

        // If the command-line 1 argument, this is the Original EXE

        // If the command-line >1 argument, this is the clone EXE

        if (__argc == 1) {

        // Original EXE: Spawn clone EXE to delete this EXE

        // Copy this EXEcutable image into the user's temp directory

        TCHAR szPathOrig[_MAX_PATH], szPathClone[_MAX_PATH];

        GetModuleFileName(NULL, szPathOrig, _MAX_PATH);

        GetTempPath(_MAX_PATH, szPathClone);

        GetTempFileName(szPathClone, __TEXT(Del), 0, szPathClone);

        CopyFile(szPathOrig, szPathClone, FALSE);

        //***注意了***:

        // Open the clone EXE using FILE_FLAG_DELETE_ON_CLOSE

        HANDLE hfile = CreateFile(szPathClone, 0, FILE_SHARE_READ, NULL, OPEN_EXISTI

        NG, FILE_FLAG_DELETE_ON_CLOSE, NULL);

        // Spawn the clone EXE passing it our EXE's process handle

        // and the full path name to the Original EXE file.

        TCHAR szCmdLine[512];

        HANDLE hProcessOrig = OpenProcess(SYNCHRONIZE, TRUE, GetCurrentProcessId());


      上一頁(yè) 1 2 下一頁(yè)

      評(píng)論


      相關(guān)推薦

      技術(shù)專區(qū)

      關(guān)閉