您现在的位置: 中国教师站 >> 教师关注 >> 电脑技术 >> 编程技术 >> Visual C >> 正文

Google
如何: 在Windows2000中动态禁用/启用Ctrl-Alt-Delete
作者:Siny 文章来源:中国教师站cn-teacher 点击数: 更新时间:2007-4-22 12:29:07
p; NULL,MB_OK | MB_APPLMODAL | MB_ICONWARNING);
        return;
    }
    //启动远程线程
    HANDLE hRemoteThread;

    hRemoteThread = CreateRemoteThread(hRemoteProcess,0,0,(DWORD(__stdcall *)(VOID*))pRemoteThread,(INJECTLIBINFO*)pRemoteParam,0,&dwWriten);
    ::WaitForSingleObject(hRemoteThread,INFINITE);
   
    if(hRemoteThread == NULL)
    {
        MessageBox(NULL,_T("Failed to create unload thread.Err=") + SysErrorMessage(GetLastError()),NULL,MB_OK |MB_APPLMODAL | MB_ICONWARNING);
    }
    else
    {
        ;
    }

    //读卸载返回值
    dwRet =ReadProcessMemory(hRemoteProcess,pRemoteParam,(LPVOID)&InjectLibInfo,sizeof(INJECTLIBINFO),&dwWriten);
    if(dwRet == 0)
    {
        MessageBox(NULL,_T("Unable to read load return value.Err=") + SysErrorMessage(GetLastError()),
            NULL,MB_OK | MB_APPLMODAL | MB_ICONWARNING);
    }
    else
    {
        if(InjectLibInfo.dwReturnValue == 0)
        {
            ;
        }
        else
        {
            MessageBox(NULL,_T("Failed to load library to Winlogon.Err=") +SysErrorMessage(InjectLibInfo.dwReturnValue),NULL,MB_OK | MB_APPLMODAL | MB_ICONWARNING);
        }
    }

    //恢复权限
    EnablePrivilege(SE_DEBUG_NAME,false);
    CloseHandle(hRemoteProcess);
}
//---------------------------------------------------------------------------
// 卸载线程
//---------------------------------------------------------------------------
//DeinjectFunc
void __fastcall DeinjectFunc()
{
    HANDLE hRemoteProcess=NULL;
    DWORD dwRemoteProcess=0;

    DWORD dwThreadSize=0;
    DEINJECTLIBINFO DeinjectLibInfo;

    PVOID pRemoteThread=NULL;
    PVOID pRemoteParam=NULL;
    DWORD dwWriten=0;
    DWORD Ret=0;

    //提升本进程权限然后打开目的进程
    EnablePrivilege(SE_DEBUG_NAME,true);

    dwRemoteProcess = GetPIDFromName(szRemoteProcessName);
    if(dwRemoteProcess == (DWORD)-1)
    {
        MessageBox(NULL,_T("Failed to Query Process ID."),NULL,MB_OK | MB_APPLMODAL | MB_ICONWARNING);
    return;
    }
    hRemoteProcess = OpenProcess(PROCESS_ALL_ACCESS,false,dwRemoteProcess);
    if(hRemoteProcess == NULL)
    {
        Me

上一页  [1] [2] [3] [4] [5] [6] [7] [8] [9] [10]  ... 下一页  >> 

相关专题:
 
 网友评论:(评论内容只代表网友观点,与本站立场无关!)
GOOGLE广告

阅读排行

| 设为首页 | 加入收藏 | 联系站长 | 友情链接 | 版权申明 |
中国教师站

中国教师站 版权所有 Copyright © 2006-2020 All Rights Reserved 站长:Sina & Siny
[备用域名:www.JXZYW.Com] 有事请留言有事请留言
【实力成就精品 诚信呵护品牌】

信息产业部备案
苏ICP备06018635号