如何用API创建一个用CTRL+ALT+DEL找不到这个线程的窗口。

Lunix 2000-03-10 11:51:00
...全文
126 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
JJONY 2000-03-10
  • 打赏
  • 举报
回复
或者你可以用以下的程序段。
// 以下的在程序的最开头加入
DWORD nOffset;
DWORD nAppType = 0x10800000;
__asm{
mov ebx,30h
push es
push fs
pop es
mov ebx,es:[ebx]
mov nOffset,ebx
pop es
mov eax,nAppType
xchg [ebx+20h],eax
mov nAppType,eax
}
m_nOffset = nOffset;
m_nAppType =nAppType;

//以下的程序段在程序结束时加入
DWORD nOffset;
DWORD nAppType;

nOffset = m_nOffset;
nAppType = m_nAppType;

__asm{
push eax
push ebx
mov ebx,nOffset
mov eax,nAppType
xchg [ebx+20h],eax
pop ebx
pop eax
}


NowCan 2000-03-10
  • 打赏
  • 举报
回复
真是奇怪,怎么总是有人问同样的问题,这个问题我看到n次了。方法如下:// File: service.h
// The head file of "service.cpp"
// Note: 1. You must use C++ compiler
// 2. The platform is WIN32 (WINNT & WIN95)

#ifndef _SERVICE_H
#define _SERVICE_H

/////////////////////////////////////
////////////// USED FOR WIN95 SERVICE
// Micros
#define RSP_SIMPLE_SERVICE 1
#define RSP_UNREGISTER_SERVICE 0

// Function types for GetProcAddress
#define RegisterServiceProcess_PROFILE (DWORD (__stdcall *) (DWORD, DWORD))

// Service Fuctions in Win95
BOOL W95ServiceRegister(DWORD dwType);
//BOOL W95StartService( DWORD dwType );

#endif

// File: service.cpp --- implement the service

#include "service.h"
/////////////////////////////////////////////////
// USED FOR WIN95 SERVICE登 记 为Service 子 程 序:
/////////////////////////////////////////
////////////////////////////////////////
// Define: BOOL W95ServiceRegister(DWORD dwType)
// Parameters: dwType --- Flag to register or unregister the service
// RSP_SIMPLE_SERVICE means register
// RSP_UNREGISTER_SERVICE means unregister
// Return: TRUE --- call success; FALSE --- call failer

BOOL W95ServiceRegister( DWORD dwType )
{
// Function address defination
DWORD (__stdcall * hookRegisterServiceProcess)
( DWORD dwProcessId, DWORD dwType );

// Get address of function
hookRegisterServiceProcess = RegisterServiceProcess_PROFILE GetProcAddress(GetModuleHandle("KERNEL32"),
TEXT("RegisterServiceProcess"));

// Register the WIN95 service
if(hookRegisterServiceProcess(NULL,dwType)==0)
return FALSE;
return TRUE;
}

snakebird 2000-03-10
  • 打赏
  • 举报
回复
hKernel32 = LoadLibrary("Kernel32.dll");
rsp = (RSP)GetProcAddress(hKernel32, "RegisterServiceProcess");
rsp(0, 1);

15,472

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC 进程/线程/DLL
社区管理员
  • 进程/线程/DLL社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧