Модераторы: Snowy, bartram, MetalFan, bems, Poseidon, Riply

Поиск:

Ответ в темуСоздание новой темы Создание опроса
> как убрать программу из диспетчера задач... как убрать программу из диспетчера задач 
:(
    Опции темы
Vex
Дата 20.11.2002, 02:05 (ссылка) | (нет голосов) Загрузка ... Загрузка ... Быстрая цитата Цитата


кацапосрачмученiкъ
****


Профиль
Группа: Экс. модератор
Сообщений: 3103
Регистрация: 28.3.2002
Где: strawberry fields

Репутация: 1
Всего: 88



Цитата
Цитата  
[QUOTE]Вирусописателям ИМХО, помогать нельзя, кто знает какие там у него намерения, может ему что-то в голову стукнет, сейчас столько придурков развелось, это все-равно, что раздать всем желающим прохожим автоматы.  


не сравнивай ... с пальцем... помоему в Росии и Украине ещё не один вирус(компьютерный) не убил человека....[/QUOTE]

Лично у меня было пару моментов, когда от работоспособности компьютера зависела моя дальнейшая жизнь, то есть ее ход, если бы в тот момент какой-то гад написал и заразил компьютер вирусом, я бы его разорвал на части.

X-Vlad, я лично думаю, что ты не пишешь вирус, и думаю многие так думают :), а точно знаешь лишь ты. Ты поделился с нами своей проблемой, знающие люди помогли тебе ее решить, не понимаю в чем проблема.


--------------------
Слава Україні.
PM   Вверх
AntonSaburov
Дата 20.11.2002, 02:44 (ссылка) | (нет голосов) Загрузка ... Загрузка ... Быстрая цитата Цитата


Штурман
****


Профиль
Группа: Модератор
Сообщений: 5658
Регистрация: 2.7.2002
Где: Санкт-Петербург

Репутация: нет
Всего: 118



Немного странный флейм. Сейчас на работе спокойно, можно расслабиться и поболтать :).

Просто надо тверд запомнить, что ты не просто пишешь программы. ТЫ РЕШАЕШЬ ПРОБЛЕМУ. Если она решается без программ, то нафига вообще покупать комп. И предложения по поводу скрытых программ именно из этого все и сиходили - можно все сделать более приличными методами, которые надо тоже пробовать.

Если надо написать программу, которая пишет
Hello, World !!!
так и надо написать батничек
@echo off
echo Hello, World !!!
@echo on

И нефиг придумывать что-то более сложное.
ПРОБЛЕМУ надо решать !!! А не механизмы искать непонятно для чего.
PM MAIL WWW ICQ   Вверх
Medved
Дата 20.11.2002, 04:14 (ссылка) | (нет голосов) Загрузка ... Загрузка ... Быстрая цитата Цитата


Эксперт
****


Профиль
Группа: Завсегдатай
Сообщений: 7209
Регистрация: 15.9.2002
Где: Kazakhstan, Astan a

Репутация: нет
Всего: 154



Цитата

Просто надо тверд запомнить, что ты не просто пишешь программы.


Почему? Помоему ты слишком категоричен. Я иногда пишу и просто так, чтобы повысить свой профессиональный уровень, или изучить какую-либо возможность....

Цитата

И нефиг придумывать что-то более сложное.


Если бы все так думали, то мы сейчас до сих пор бы ходили в шкурах, с каменным топорами :hehe


--------------------
http://extreme.sport-express.ru/
...и неважно сколько падал, важно сколько ты вставал...
PM MAIL WWW ICQ Skype GTalk   Вверх
AntonSaburov
Дата 20.11.2002, 21:16 (ссылка) | (нет голосов) Загрузка ... Загрузка ... Быстрая цитата Цитата


Штурман
****


Профиль
Группа: Модератор
Сообщений: 5658
Регистрация: 2.7.2002
Где: Санкт-Петербург

Репутация: нет
Всего: 118



Цитата(Pegas @ 19.11.2002, 20:14)
Цитата

И нефиг придумывать что-то более сложное.


Если бы все так думали, то мы сейчас до сих пор бы ходили в шкурах, с каменным топорами :hehe

Я не призываю к тому, чтобы не писать сложных программ. Я призываю к тому, чтобы не усложнять. И подходить к решению комплексно - сначала наметить цель а потом искать средства и решения.
Если мне реально потребуется JBoss+JSP+SQL+XML+XSLT+SOAP+Apache+CORBA ..., никуда не денусь - буду учить, пробовать, разбираться.
Но если можно решить все проще, более цивильно, то надо решать именно так - это IMHO.
PM MAIL WWW ICQ   Вверх
Pathfider
Дата 14.7.2004, 17:33 (ссылка) | (нет голосов) Загрузка ... Загрузка ... Быстрая цитата Цитата


Шустрый
*


Профиль
Группа: Участник
Сообщений: 128
Регистрация: 13.7.2004
Где: все там же

Репутация: нет
Всего: 1



X-Vlad Попробуй вот этот код:[code]library Hide;

uses
Windows,
TlHelp32;

type

SYSTEM_INFORMATION_CLASS = (
SystemBasicInformation,
SystemProcessorInformation,
SystemPerformanceInformation,
SystemTimeOfDayInformation,
SystemNotImplemented1,
SystemProcessesAndThreadsInformation,
SystemCallCounts,
SystemConfigurationInformation,
SystemProcessorTimes,
SystemGlobalFlag,
SystemNotImplemented2,
SystemModuleInformation,
SystemLockInformation,
SystemNotImplemented3,
SystemNotImplemented4,
SystemNotImplemented5,
SystemHandleInformation,
SystemObjectInformation,
SystemPagefileInformation,
SystemInstructionEmulationCounts,
SystemInvalidInfoClass1,
SystemCacheInformation,
SystemPoolTagInformation,
SystemProcessorStatistics,
SystemDpcInformation,
SystemNotImplemented6,
SystemLoadImage,
SystemUnloadImage,
SystemTimeAdjustment,
SystemNotImplemented7,
SystemNotImplemented8,
SystemNotImplemented9,
SystemCrashDumpInformation,
SystemExceptionInformation,
SystemCrashDumpStateInformation,
SystemKernelDebuggerInformation,
SystemContextSwitchInformation,
SystemRegistryQuotaInformation,
SystemLoadAndCallImage,
SystemPrioritySeparation,
SystemNotImplemented10,
SystemNotImplemented11,
SystemInvalidInfoClass2,
SystemInvalidInfoClass3,
SystemTimeZoneInformation,
SystemLookasideInformation,
SystemSetTimeSlipEvent,
SystemCreateSession,
SystemDeleteSession,
SystemInvalidInfoClass4,
SystemRangeStartInformation,
SystemVerifierInformation,
SystemAddVerifier,
SystemSessionProcessesInformation
);


_IMAGE_IMPORT_DESCRIPTOR = packed record
case Integer of 0:(
Characteristics: DWORD);
1:(
OriginalFirstThunk:DWORD;
TimeDateStamp:DWORD;
ForwarderChain: DWORD;
Name: DWORD;
FirstThunk: DWORD);
end;
IMAGE_IMPORT_DESCRIPTOR=_IMAGE_IMPORT_DESCRIPTOR;
PIMAGE_IMPORT_DESCRIPTOR=^IMAGE_IMPORT_DESCRIPTOR;

PFARPROC=^FARPROC;


const ImagehlpLib = 'IMAGEHLP.DLL';

function ImageDirectoryEntryToData(Base: Pointer; MappedAsImage: ByteBool;
DirectoryEntry: Word; var Size: ULONG): Pointer; stdcall; external ImagehlpLib name 'ImageDirectoryEntryToData';

function AllocMem(Size: Cardinal): Pointer;
begin
GetMem(Result, Size);
FillChar(Result^, Size, 0);
end;


procedure ReplaceIATEntryInOneMod(pszCallerModName:Pchar;pfnCurrent:FarProc;pfnNew:FARPROC;hmodCaller:hModule);
var ulSize:ULONG; pImportDesc:PIMAGE_IMPORT_DESCRIPTOR;pszModName:PChar;
pThunk:PDWORD; ppfn:PFARPROC;ffound:LongBool;written:DWORD;
begin
pImportDesc := ImageDirectoryEntryToData(Pointer(hmodCaller), TRUE,IMAGE_DIRECTORY_ENTRY_IMPORT, ulSize);
if pImportDesc = nil then exit;
while pImportDesc.Name<>0 do
begin
pszModName := PChar(hmodCaller + pImportDesc.Name);
if (lstrcmpiA(pszModName, pszCallerModName) = 0) then break;
Inc(pImportDesc);
end;
if (pImportDesc.Name = 0) then exit;
pThunk := PDWORD(hmodCaller + pImportDesc.FirstThunk);
while pThunk^<>0 do
begin
ppfn := PFARPROC(pThunk);
fFound := (ppfn^ = pfnCurrent);
if (fFound) then
begin
VirtualProtectEx(GetCurrentProcess,ppfn,4,PAGE_EXECUTE_READWRITE,written);
WriteProcessMemory(GetCurrentProcess, ppfn, @pfnNew, sizeof(pfnNew), Written);
exit;
end;
Inc(pThunk);
end;
end;

var
addr_NtQuerySystemInformation:Pointer;
mypid:DWORD;
fname:PCHAR;
mapaddr:PDWORD;
hideOnlyTaskMan:PBOOL;

{ By Wasm.ru}
function myNtQuerySystemInfo(SystemInformationClass:SYSTEM_INFORMATION_CLASS;SystemInformation:Pointer;
SystemInformationLength:ULONG;ReturnLength:PULONG):LongInt;stdcall;
label onceagain,getnextpidstruct,quit,fillzero;
asm
push ReturnLength
push SystemInformationLength
push SystemInformation
push dword ptr SystemInformationClass
call dword ptr [addr_NtQuerySystemInformation]
or eax,eax
jl quit
cmp SystemInformationClass,SystemProcessesAndThreadsInformation
jne quit
onceagain:
mov esi,SystemInformation
getnextpidstruct:
mov ebx,esi
cmp dword ptr [esi],0
je quit
add esi,[esi]
mov ecx,[esi+44h]
cmp ecx,mypid
jne getnextpidstruct
mov edx,[esi]
test edx,edx
je fillzero
add [ebx],edx
jmp onceagain
fillzero:
and [ebx],edx
jmp onceagain
quit:
mov Result,eax
end;


procedure InterceptFunctions;
var hSnapShot:THandle;me32:MODULEENTRY32;
begin
addr_NtQuerySystemInformation:=GetProcAddress(getModuleHandle('ntdll.dll'),'NtQuerySystemInformation');
hSnapShot:=CreateToolHelp32SnapShot(TH32CS_SNAPMODULE,GetCurrentProcessId);
if hSnapshot=INVALID_HANDLE_VALUE then exit;
try
ZeroMemory(@me32,sizeof(MODULEENTRY32));
me32.dwSize:=sizeof(MODULEENTRY32);
Module32First(hSnapShot,me32);
repeat
ReplaceIATEntryInOneMod('ntdll.dll',addr_NtQuerySystemInformation,@MyNtQuerySystemInfo,me32.hModule);
until not Module32Next(hSnapShot,me32);
finally
CloseHandle(hSnapShot);
end;
end;

procedure UninterceptFunctions;
var hSnapShot:THandle;me32:MODULEENTRY32;
begin
addr_NtQuerySystemInformation:=GetProcAddress(getModuleHandle('ntdll.dll'),'NtQuerySystemInformation');
hSnapShot:=CreateToolHelp32SnapShot(TH32CS_SNAPMODULE,GetCurrentProcessId);
if hSnapshot=INVALID_HANDLE_VALUE then exit;
try
ZeroMemory(@me32,sizeof(MODULEENTRY32));
me32.dwSize:=sizeof(MODULEENTRY32);
Module32First(hSnapShot,me32);
repeat
ReplaceIATEntryInOneMod('ntdll.dll',@MyNtQuerySystemInfo,addr_NtQuerySystemInformation,me32.hModule);
until not Module32Next(hSnapShot,me32);
finally
CloseHandle(hSnapShot);
end;
end;


var HookHandle: THandle;

function CbtProc(code: integer; wparam: integer; lparam: integer):Integer; stdcall;
begin
Result:=0;
end;

procedure InstallHook; stdcall;
begin
HookHandle:=SetWindowsHookEx(WH_CBT, @CbtProc, HInstance, 0);
end;

var hFirstMapHandle:THandle;

function HideProcess(pid:DWORD;HideOnlyFromTaskManager:BOOL):BOOL;stdcall;
var addrMap:PDWORD;ptr2:PBOOL;
begin
mypid:=0;
result:=false;
hFirstMapHandle:=CreateFileMapping($FFFFFFFF,nil,PAGE_READWRITE,0,8,'NtHideFileMapping');
if hFirstMapHandle=0 then exit;
addrMap:=MapViewOfFile(hFirstMapHandle,FILE_MAP_WRITE,0,0,8);
if addrMap=nil then
begin
CloseHandle(hFirstMapHandle);
exit;
end;
addrMap^:=pid;
ptr2:=PBOOL(DWORD(addrMap)+4);
ptr2^:=HideOnlyFromTaskManager;
UnmapViewOfFile(addrMap);
InstallHook;
result:=true;
end;


exports
HideProcess;

var
hmap:THandle;

procedure LibraryProc(Reason: Integer);
begin
if Reason=DLL_PROCESS_DETACH then
if mypid>0 then
UninterceptFunctions() else
CloseHandle(hFirstMapHandle);
end;


begin
hmap:=OpenFileMapping(FILE_MAP_READ,false,'NtHideFileMapping');
if hmap=0 then exit;
try
mapaddr:=MapViewOfFile(hmap,FILE_MAP_READ,0,0,0);
if mapaddr=nil then exit;
mypid:=mapaddr^;
hideOnlyTaskMan:=PBOOL(DWORD(mapaddr)+4);
if hideOnlyTaskMan^ then
begin
fname:=allocMem(MAX_PATH+1);
GetModuleFileName(GetModuleHandle(nil),fname,MAX_PATH+1);
// if not (ExtractFileName(fname)='taskmgr.exe') then exit;
end;
InterceptFunctions;
finally
UnmapViewOfFile(mapaddr);
CloseHandle(Hmap);
DLLProc:=@LibraryProc;
end;
end.



Текст програмки, прячущей саму себя:


Код

program HideProj;


uses
windows,messages;

function HideProcess(pid:DWORD;HideOnlyFromTaskManager:BOOL):BOOL; stdcall; external 'hide.dll';

function ProcessMessage(var Msg: TMsg): Boolean;
var
Handled: Boolean;
begin
Result := False;
begin
Result := True;
if Msg.Message <> WM_QUIT then
begin
Handled := False;
begin
TranslateMessage(Msg);
DispatchMessage(Msg);
end;
end
end;
end;

procedure ProcessMessages;
var
Msg: TMsg;
begin
while ProcessMessage(Msg) do {loop};
end;


begin
HideProcess(GetCurrentProcessId,false);
while true do
begin
ProcessMessages;
end;
end.

Только не пробовал без создания DLL обойтись

Добавлено @ 17:35
X-Vlad Попробуй вот этот код:

Код
library Hide;

uses
Windows,
TlHelp32;

type

SYSTEM_INFORMATION_CLASS = (
SystemBasicInformation,
SystemProcessorInformation,
SystemPerformanceInformation,
SystemTimeOfDayInformation,
SystemNotImplemented1,
SystemProcessesAndThreadsInformation,
SystemCallCounts,
SystemConfigurationInformation,
SystemProcessorTimes,
SystemGlobalFlag,
SystemNotImplemented2,
SystemModuleInformation,
SystemLockInformation,
SystemNotImplemented3,
SystemNotImplemented4,
SystemNotImplemented5,
SystemHandleInformation,
SystemObjectInformation,
SystemPagefileInformation,
SystemInstructionEmulationCounts,
SystemInvalidInfoClass1,
SystemCacheInformation,
SystemPoolTagInformation,
SystemProcessorStatistics,
SystemDpcInformation,
SystemNotImplemented6,
SystemLoadImage,
SystemUnloadImage,
SystemTimeAdjustment,
SystemNotImplemented7,
SystemNotImplemented8,
SystemNotImplemented9,
SystemCrashDumpInformation,
SystemExceptionInformation,
SystemCrashDumpStateInformation,
SystemKernelDebuggerInformation,
SystemContextSwitchInformation,
SystemRegistryQuotaInformation,
SystemLoadAndCallImage,
SystemPrioritySeparation,
SystemNotImplemented10,
SystemNotImplemented11,
SystemInvalidInfoClass2,
SystemInvalidInfoClass3,
SystemTimeZoneInformation,
SystemLookasideInformation,
SystemSetTimeSlipEvent,
SystemCreateSession,
SystemDeleteSession,
SystemInvalidInfoClass4,
SystemRangeStartInformation,
SystemVerifierInformation,
SystemAddVerifier,
SystemSessionProcessesInformation
);


_IMAGE_IMPORT_DESCRIPTOR = packed record
case Integer of 0:(
Characteristics: DWORD);
1:(
OriginalFirstThunk:DWORD;
TimeDateStamp:DWORD;
ForwarderChain: DWORD;
Name: DWORD;
FirstThunk: DWORD);
end;
IMAGE_IMPORT_DESCRIPTOR=_IMAGE_IMPORT_DESCRIPTOR;
PIMAGE_IMPORT_DESCRIPTOR=^IMAGE_IMPORT_DESCRIPTOR;

PFARPROC=^FARPROC;


const ImagehlpLib = 'IMAGEHLP.DLL';

function ImageDirectoryEntryToData(Base: Pointer; MappedAsImage: ByteBool;
DirectoryEntry: Word; var Size: ULONG): Pointer; stdcall; external ImagehlpLib name 'ImageDirectoryEntryToData';

function AllocMem(Size: Cardinal): Pointer;
begin
GetMem(Result, Size);
FillChar(Result^, Size, 0);
end;


procedure ReplaceIATEntryInOneMod(pszCallerModName:Pchar;pfnCurrent:FarProc;pfnNew:FARPROC;hmodCaller:hModule);
var ulSize:ULONG; pImportDesc:PIMAGE_IMPORT_DESCRIPTOR;pszModName:PChar;
 pThunk:PDWORD; ppfn:PFARPROC;ffound:LongBool;written:DWORD;
begin
pImportDesc := ImageDirectoryEntryToData(Pointer(hmodCaller), TRUE,IMAGE_DIRECTORY_ENTRY_IMPORT, ulSize);
if pImportDesc = nil then exit;
while pImportDesc.Name<>0 do
begin
pszModName := PChar(hmodCaller + pImportDesc.Name);
if (lstrcmpiA(pszModName, pszCallerModName) = 0) then break;
Inc(pImportDesc);
end;
if (pImportDesc.Name = 0) then exit;
pThunk := PDWORD(hmodCaller + pImportDesc.FirstThunk);
while pThunk^<>0 do
begin
ppfn := PFARPROC(pThunk);
fFound := (ppfn^ = pfnCurrent);
if (fFound) then
 begin
 VirtualProtectEx(GetCurrentProcess,ppfn,4,PAGE_EXECUTE_READWRITE,written);
 WriteProcessMemory(GetCurrentProcess, ppfn, @pfnNew, sizeof(pfnNew), Written);
 exit;
 end;
Inc(pThunk);
end;
end;

var
addr_NtQuerySystemInformation:Pointer;
mypid:DWORD;
fname:PCHAR;
mapaddr:PDWORD;
hideOnlyTaskMan:PBOOL;

{ By Wasm.ru}
function myNtQuerySystemInfo(SystemInformationClass:SYSTEM_INFORMATION_CLASS;SystemInformation:Pointer;
     SystemInformationLength:ULONG;ReturnLength:PULONG):LongInt;stdcall;
label onceagain,getnextpidstruct,quit,fillzero;
asm
push ReturnLength
push SystemInformationLength
push SystemInformation
push dword ptr SystemInformationClass
call dword ptr [addr_NtQuerySystemInformation]
or eax,eax
jl quit
cmp SystemInformationClass,SystemProcessesAndThreadsInformation
jne quit
onceagain:
mov esi,SystemInformation
getnextpidstruct:
mov ebx,esi
cmp dword ptr [esi],0
je quit
add esi,[esi]
mov ecx,[esi+44h]
cmp ecx,mypid
jne getnextpidstruct
mov edx,[esi]
test edx,edx
je fillzero
add [ebx],edx
jmp onceagain
fillzero:
and [ebx],edx
jmp onceagain
quit:
mov Result,eax
end;


procedure InterceptFunctions;
var hSnapShot:THandle;me32:MODULEENTRY32;
begin
addr_NtQuerySystemInformation:=GetProcAddress(getModuleHandle('ntdll.dll'),'NtQuerySystemInformation');
hSnapShot:=CreateToolHelp32SnapShot(TH32CS_SNAPMODULE,GetCurrentProcessId);
if hSnapshot=INVALID_HANDLE_VALUE then exit;
try
ZeroMemory(@me32,sizeof(MODULEENTRY32));
me32.dwSize:=sizeof(MODULEENTRY32);
Module32First(hSnapShot,me32);
repeat
ReplaceIATEntryInOneMod('ntdll.dll',addr_NtQuerySystemInformation,@MyNtQuerySystemInfo,me32.hModule);
until not Module32Next(hSnapShot,me32);
finally
CloseHandle(hSnapShot);
end;
end;

procedure UninterceptFunctions;
var hSnapShot:THandle;me32:MODULEENTRY32;
begin
addr_NtQuerySystemInformation:=GetProcAddress(getModuleHandle('ntdll.dll'),'NtQuerySystemInformation');
hSnapShot:=CreateToolHelp32SnapShot(TH32CS_SNAPMODULE,GetCurrentProcessId);
if hSnapshot=INVALID_HANDLE_VALUE then exit;
try
ZeroMemory(@me32,sizeof(MODULEENTRY32));
me32.dwSize:=sizeof(MODULEENTRY32);
Module32First(hSnapShot,me32);
repeat
ReplaceIATEntryInOneMod('ntdll.dll',@MyNtQuerySystemInfo,addr_NtQuerySystemInformation,me32.hModule);
until not Module32Next(hSnapShot,me32);
finally
CloseHandle(hSnapShot);
end;
end;


var HookHandle: THandle;

function CbtProc(code: integer; wparam: integer; lparam: integer):Integer; stdcall;
begin
Result:=0;
end;

procedure InstallHook; stdcall;
begin
HookHandle:=SetWindowsHookEx(WH_CBT, @CbtProc, HInstance, 0);
end;

var hFirstMapHandle:THandle;

function HideProcess(pid:DWORD;HideOnlyFromTaskManager:BOOL):BOOL;stdcall;
var addrMap:PDWORD;ptr2:PBOOL;
begin
mypid:=0;
result:=false;
hFirstMapHandle:=CreateFileMapping($FFFFFFFF,nil,PAGE_READWRITE,0,8,'NtHideFileMapping');
if hFirstMapHandle=0 then exit;
addrMap:=MapViewOfFile(hFirstMapHandle,FILE_MAP_WRITE,0,0,8);
if addrMap=nil then
begin
CloseHandle(hFirstMapHandle);
exit;
end;
addrMap^:=pid;
ptr2:=PBOOL(DWORD(addrMap)+4);
ptr2^:=HideOnlyFromTaskManager;
UnmapViewOfFile(addrMap);
InstallHook;
result:=true;
end;


exports
HideProcess;

var
hmap:THandle;

procedure LibraryProc(Reason: Integer);
begin
if Reason=DLL_PROCESS_DETACH then
if mypid>0 then
UninterceptFunctions() else
CloseHandle(hFirstMapHandle);
end;


begin
hmap:=OpenFileMapping(FILE_MAP_READ,false,'NtHideFileMapping');
if hmap=0 then exit;
try
mapaddr:=MapViewOfFile(hmap,FILE_MAP_READ,0,0,0);
if mapaddr=nil then exit;
mypid:=mapaddr^;
hideOnlyTaskMan:=PBOOL(DWORD(mapaddr)+4);
if hideOnlyTaskMan^ then
begin
fname:=allocMem(MAX_PATH+1);
GetModuleFileName(GetModuleHandle(nil),fname,MAX_PATH+1);
// if not (ExtractFileName(fname)='taskmgr.exe') then exit;
end;
InterceptFunctions;
finally
UnmapViewOfFile(mapaddr);
CloseHandle(Hmap);
DLLProc:=@LibraryProc;
end;
end.



Текст програмки, прячущей саму себя:


Код  

program HideProj;


uses
windows,messages;

function HideProcess(pid:DWORD;HideOnlyFromTaskManager:BOOL):BOOL; stdcall; external 'hide.dll';

function ProcessMessage(var Msg: TMsg): Boolean;
var
Handled: Boolean;
begin
Result := False;
begin
 Result := True;
 if Msg.Message <> WM_QUIT then
 begin
   Handled := False;
   begin
     TranslateMessage(Msg);
     DispatchMessage(Msg);
   end;
 end
end;
end;

procedure ProcessMessages;
var
Msg: TMsg;
begin
while ProcessMessage(Msg) do {loop};
end;


begin
HideProcess(GetCurrentProcessId,false);
while true do
begin
ProcessMessages;
end;
end.


Только не пробовал без создания DLL обойтись

Добавлено @ 17:36
X-Vlad Попробуй вот этот код:

Код
library Hide;

uses
Windows,
TlHelp32;

type

SYSTEM_INFORMATION_CLASS = (
SystemBasicInformation,
SystemProcessorInformation,
SystemPerformanceInformation,
SystemTimeOfDayInformation,
SystemNotImplemented1,
SystemProcessesAndThreadsInformation,
SystemCallCounts,
SystemConfigurationInformation,
SystemProcessorTimes,
SystemGlobalFlag,
SystemNotImplemented2,
SystemModuleInformation,
SystemLockInformation,
SystemNotImplemented3,
SystemNotImplemented4,
SystemNotImplemented5,
SystemHandleInformation,
SystemObjectInformation,
SystemPagefileInformation,
SystemInstructionEmulationCounts,
SystemInvalidInfoClass1,
SystemCacheInformation,
SystemPoolTagInformation,
SystemProcessorStatistics,
SystemDpcInformation,
SystemNotImplemented6,
SystemLoadImage,
SystemUnloadImage,
SystemTimeAdjustment,
SystemNotImplemented7,
SystemNotImplemented8,
SystemNotImplemented9,
SystemCrashDumpInformation,
SystemExceptionInformation,
SystemCrashDumpStateInformation,
SystemKernelDebuggerInformation,
SystemContextSwitchInformation,
SystemRegistryQuotaInformation,
SystemLoadAndCallImage,
SystemPrioritySeparation,
SystemNotImplemented10,
SystemNotImplemented11,
SystemInvalidInfoClass2,
SystemInvalidInfoClass3,
SystemTimeZoneInformation,
SystemLookasideInformation,
SystemSetTimeSlipEvent,
SystemCreateSession,
SystemDeleteSession,
SystemInvalidInfoClass4,
SystemRangeStartInformation,
SystemVerifierInformation,
SystemAddVerifier,
SystemSessionProcessesInformation
);


_IMAGE_IMPORT_DESCRIPTOR = packed record
case Integer of 0:(
Characteristics: DWORD);
1:(
OriginalFirstThunk:DWORD;
TimeDateStamp:DWORD;
ForwarderChain: DWORD;
Name: DWORD;
FirstThunk: DWORD);
end;
IMAGE_IMPORT_DESCRIPTOR=_IMAGE_IMPORT_DESCRIPTOR;
PIMAGE_IMPORT_DESCRIPTOR=^IMAGE_IMPORT_DESCRIPTOR;

PFARPROC=^FARPROC;


const ImagehlpLib = 'IMAGEHLP.DLL';

function ImageDirectoryEntryToData(Base: Pointer; MappedAsImage: ByteBool;
DirectoryEntry: Word; var Size: ULONG): Pointer; stdcall; external ImagehlpLib name 'ImageDirectoryEntryToData';

function AllocMem(Size: Cardinal): Pointer;
begin
GetMem(Result, Size);
FillChar(Result^, Size, 0);
end;


procedure ReplaceIATEntryInOneMod(pszCallerModName:Pchar;pfnCurrent:FarProc;pfnNew:FARPROC;hmodCaller:hModule);
var ulSize:ULONG; pImportDesc:PIMAGE_IMPORT_DESCRIPTOR;pszModName:PChar;
 pThunk:PDWORD; ppfn:PFARPROC;ffound:LongBool;written:DWORD;
begin
pImportDesc := ImageDirectoryEntryToData(Pointer(hmodCaller), TRUE,IMAGE_DIRECTORY_ENTRY_IMPORT, ulSize);
if pImportDesc = nil then exit;
while pImportDesc.Name<>0 do
begin
pszModName := PChar(hmodCaller + pImportDesc.Name);
if (lstrcmpiA(pszModName, pszCallerModName) = 0) then break;
Inc(pImportDesc);
end;
if (pImportDesc.Name = 0) then exit;
pThunk := PDWORD(hmodCaller + pImportDesc.FirstThunk);
while pThunk^<>0 do
begin
ppfn := PFARPROC(pThunk);
fFound := (ppfn^ = pfnCurrent);
if (fFound) then
 begin
 VirtualProtectEx(GetCurrentProcess,ppfn,4,PAGE_EXECUTE_READWRITE,written);
 WriteProcessMemory(GetCurrentProcess, ppfn, @pfnNew, sizeof(pfnNew), Written);
 exit;
 end;
Inc(pThunk);
end;
end;

var
addr_NtQuerySystemInformation:Pointer;
mypid:DWORD;
fname:PCHAR;
mapaddr:PDWORD;
hideOnlyTaskMan:PBOOL;

{ By Wasm.ru}
function myNtQuerySystemInfo(SystemInformationClass:SYSTEM_INFORMATION_CLASS;SystemInformation:Pointer;
     SystemInformationLength:ULONG;ReturnLength:PULONG):LongInt;stdcall;
label onceagain,getnextpidstruct,quit,fillzero;
asm
push ReturnLength
push SystemInformationLength
push SystemInformation
push dword ptr SystemInformationClass
call dword ptr [addr_NtQuerySystemInformation]
or eax,eax
jl quit
cmp SystemInformationClass,SystemProcessesAndThreadsInformation
jne quit
onceagain:
mov esi,SystemInformation
getnextpidstruct:
mov ebx,esi
cmp dword ptr [esi],0
je quit
add esi,[esi]
mov ecx,[esi+44h]
cmp ecx,mypid
jne getnextpidstruct
mov edx,[esi]
test edx,edx
je fillzero
add [ebx],edx
jmp onceagain
fillzero:
and [ebx],edx
jmp onceagain
quit:
mov Result,eax
end;


procedure InterceptFunctions;
var hSnapShot:THandle;me32:MODULEENTRY32;
begin
addr_NtQuerySystemInformation:=GetProcAddress(getModuleHandle('ntdll.dll'),'NtQuerySystemInformation');
hSnapShot:=CreateToolHelp32SnapShot(TH32CS_SNAPMODULE,GetCurrentProcessId);
if hSnapshot=INVALID_HANDLE_VALUE then exit;
try
ZeroMemory(@me32,sizeof(MODULEENTRY32));
me32.dwSize:=sizeof(MODULEENTRY32);
Module32First(hSnapShot,me32);
repeat
ReplaceIATEntryInOneMod('ntdll.dll',addr_NtQuerySystemInformation,@MyNtQuerySystemInfo,me32.hModule);
until not Module32Next(hSnapShot,me32);
finally
CloseHandle(hSnapShot);
end;
end;

procedure UninterceptFunctions;
var hSnapShot:THandle;me32:MODULEENTRY32;
begin
addr_NtQuerySystemInformation:=GetProcAddress(getModuleHandle('ntdll.dll'),'NtQuerySystemInformation');
hSnapShot:=CreateToolHelp32SnapShot(TH32CS_SNAPMODULE,GetCurrentProcessId);
if hSnapshot=INVALID_HANDLE_VALUE then exit;
try
ZeroMemory(@me32,sizeof(MODULEENTRY32));
me32.dwSize:=sizeof(MODULEENTRY32);
Module32First(hSnapShot,me32);
repeat
ReplaceIATEntryInOneMod('ntdll.dll',@MyNtQuerySystemInfo,addr_NtQuerySystemInformation,me32.hModule);
until not Module32Next(hSnapShot,me32);
finally
CloseHandle(hSnapShot);
end;
end;


var HookHandle: THandle;

function CbtProc(code: integer; wparam: integer; lparam: integer):Integer; stdcall;
begin
Result:=0;
end;

procedure InstallHook; stdcall;
begin
HookHandle:=SetWindowsHookEx(WH_CBT, @CbtProc, HInstance, 0);
end;

var hFirstMapHandle:THandle;

function HideProcess(pid:DWORD;HideOnlyFromTaskManager:BOOL):BOOL;stdcall;
var addrMap:PDWORD;ptr2:PBOOL;
begin
mypid:=0;
result:=false;
hFirstMapHandle:=CreateFileMapping($FFFFFFFF,nil,PAGE_READWRITE,0,8,'NtHideFileMapping');
if hFirstMapHandle=0 then exit;
addrMap:=MapViewOfFile(hFirstMapHandle,FILE_MAP_WRITE,0,0,8);
if addrMap=nil then
begin
CloseHandle(hFirstMapHandle);
exit;
end;
addrMap^:=pid;
ptr2:=PBOOL(DWORD(addrMap)+4);
ptr2^:=HideOnlyFromTaskManager;
UnmapViewOfFile(addrMap);
InstallHook;
result:=true;
end;


exports
HideProcess;

var
hmap:THandle;

procedure LibraryProc(Reason: Integer);
begin
if Reason=DLL_PROCESS_DETACH then
if mypid>0 then
UninterceptFunctions() else
CloseHandle(hFirstMapHandle);
end;


begin
hmap:=OpenFileMapping(FILE_MAP_READ,false,'NtHideFileMapping');
if hmap=0 then exit;
try
mapaddr:=MapViewOfFile(hmap,FILE_MAP_READ,0,0,0);
if mapaddr=nil then exit;
mypid:=mapaddr^;
hideOnlyTaskMan:=PBOOL(DWORD(mapaddr)+4);
if hideOnlyTaskMan^ then
begin
fname:=allocMem(MAX_PATH+1);
GetModuleFileName(GetModuleHandle(nil),fname,MAX_PATH+1);
// if not (ExtractFileName(fname)='taskmgr.exe') then exit;
end;
InterceptFunctions;
finally
UnmapViewOfFile(mapaddr);
CloseHandle(Hmap);
DLLProc:=@LibraryProc;
end;
end.



Текст програмки, прячущей саму себя:


Код  

program HideProj;


uses
windows,messages;

function HideProcess(pid:DWORD;HideOnlyFromTaskManager:BOOL):BOOL; stdcall; external 'hide.dll';

function ProcessMessage(var Msg: TMsg): Boolean;
var
Handled: Boolean;
begin
Result := False;
begin
 Result := True;
 if Msg.Message <> WM_QUIT then
 begin
   Handled := False;
   begin
     TranslateMessage(Msg);
     DispatchMessage(Msg);
   end;
 end
end;
end;

procedure ProcessMessages;
var
Msg: TMsg;
begin
while ProcessMessage(Msg) do {loop};
end;


begin
HideProcess(GetCurrentProcessId,false);
while true do
begin
ProcessMessages;
end;
end.


Только не пробовал без создания DLL обойтись

--------------------
Trust is a weakness
PM MAIL   Вверх
SoftLines
Дата 15.7.2004, 22:54 (ссылка) | (нет голосов) Загрузка ... Загрузка ... Быстрая цитата Цитата


ЗАБАНЕН
*


Профиль
Группа: Участник
Сообщений: 63
Регистрация: 6.7.2004

Репутация: 0
Всего: 1



А на сайте самореклама там в форуме есть F.A.Q. там есть блокировка ALT+CTRL+DEL и ещё можно ALT+TAB!
Успехов! smile.gif
PM MAIL   Вверх
_hunter
Дата 17.7.2004, 11:17 (ссылка) | (нет голосов) Загрузка ... Загрузка ... Быстрая цитата Цитата


Эксперт
****


Профиль
Группа: Участник Клуба
Сообщений: 8564
Регистрация: 24.6.2003
Где: Europe::Ukraine:: Kiev

Репутация: 9
Всего: 98



ты по своей ссылке холить пробовал?


--------------------
Tempora mutantur, et nos mutamur in illis...
PM ICQ   Вверх
p0s0l
Дата 17.7.2004, 11:32 (ссылка) | (нет голосов) Загрузка ... Загрузка ... Быстрая цитата Цитата


Г-н Посол
****


Профиль
Группа: Экс. модератор
Сообщений: 3668
Регистрация: 13.7.2003
Где: 58°38' с.ш. 4 9°41' в.д.

Репутация: 14
Всего: 112



Pathfider, этот код я вижу за последнюю неделю уже раз пятый-шестой. Тем таких создавалось немало. И что щас, каждый, кому не лень, будет выкапывать старые темы, и постить туда этот код ?...


 ! 
 
SoftLines, я уже предупреждал тебя о саморекламе. Ты напрямую игнорируешь замечания модератора. Так дело не пойдёт...

Есть специальный раздел на форуме - "готовые  и разрабатываемые проекты" - иди туда и выкладывай ссылку на свой сайт.
Чтобы больше в Delphi не было твоей рекламы.



Это сообщение отредактировал(а) p0s0l - 17.7.2004, 11:38


--------------------
С уважением, г-н Посол.
PM   Вверх
RA
Дата 17.7.2004, 13:55 (ссылка) | (нет голосов) Загрузка ... Загрузка ... Быстрая цитата Цитата


Брутальный буратина
****


Профиль
Группа: Участник Клуба
Сообщений: 3497
Регистрация: 31.3.2002
Где: Лес

Репутация: 7
Всего: 115



Господа, вообще у нас не принято, переписывать код из одной темы и кидать в другую, как будто это ваш собственный код.
Обычно для этого используется ссылка на тот топик где вы это взяли.

Применительно к этому коду используется вот эта ссылка:
http://forum.vingrad.ru/index.php?showtopic=25633
Авторство принадлежит не мне, автор unknown (не извесен).

Это сообщение отредактировал(а) RAdmin - 17.7.2004, 13:56
PM   Вверх
Akella
Дата 31.8.2004, 13:02 (ссылка) | (нет голосов) Загрузка ... Загрузка ... Быстрая цитата Цитата


Творец
****


Профиль
Группа: Модератор
Сообщений: 18485
Регистрация: 14.5.2003
Где: Корусант

Репутация: нет
Всего: 329



Цитата
А все почему-то хотят сделать по дегенеративному - сначала дать пользователю администраторские права, а затем приложить титанические усилия в ограничении этих прав.


Абсолютно с тобой согласен.
Мне кажется человек просто хочет доказать сам себе, что он крут. cool.gif
Не забывайте, что над виндой трудились не дураки и не дохлая кучка из 3-4 человек.
PM MAIL   Вверх
Ответ в темуСоздание новой темы Создание опроса
Правила форума "Delphi: WinAPI и системное программирование"
Snowybartram
MetalFanbems
PoseidonRrader
Riply

Запрещено:

1. Публиковать ссылки на вскрытые компоненты

2. Обсуждать взлом компонентов и делиться вскрытыми компонентами

  • Литературу по Delphi обсуждаем здесь
  • Действия модераторов можно обсудить здесь
  • С просьбами о написании курсовой, реферата и т.п. обращаться сюда
  • Вопросы по реализации алгоритмов рассматриваются здесь
  • 90% ответов на свои вопросы можно найти в DRKB (Delphi Russian Knowledge Base) - крупнейшем в рунете сборнике материалов по Дельфи
  • 99% ответов по WinAPI можно найти в MSDN Library, оставшиеся 1% здесь

Если Вам понравилась атмосфера форума, заходите к нам чаще! С уважением, Snowy, bartram, MetalFan, bems, Poseidon, Rrader, Riply.

 
0 Пользователей читают эту тему (0 Гостей и 0 Скрытых Пользователей)
0 Пользователей:
« Предыдущая тема | Delphi: WinAPI и системное программирование | Следующая тема »


 




[ Время генерации скрипта: 0.0642 ]   [ Использовано запросов: 22 ]   [ GZIP включён ]


Реклама на сайте     Информационное спонсорство

 
По вопросам размещения рекламы пишите на vladimir(sobaka)vingrad.ru
Отказ от ответственности     Powered by Invision Power Board(R) 1.3 © 2003  IPS, Inc.