Home
Top.Mail.Ru Yandeks.Metrika
Forum: "Main";
Current archive: 2002.01.08;
Download: [xml.tar.bz2];

Down

KillSelf Find similar branches


T2   (2001-12-14 03:22) [0]

How to make a program commit suicide? The current is not at reboot, but in real time!



KilkennyCat   (2001-12-14 04:12) [1]

Suicide - meaning removing from the screw?
She just has to live in the memory, from where she calmly erase herself from the screw, and then says to herself: close.



T2   (2001-12-14 04:32) [2]

Yes, removal from the screw. But he doesn’t want to delete herself — the grit file is locked (obviously, it’s not all in his memory, but it loads and keeps it open) :(



KilkennyCat   (2001-12-14 04:37) [3]

Well, of course! If not urgently, then I will write as (now busy), until I just remember the scraps of dosovsky options from the “battle in memory”.



T2   (2001-12-14 05:32) [4]

Ok, there will be time, throw at gu-gu-gu2@mtu-net.ru or write here.



Milz   (2001-12-14 09:31) [5]

I do not remember where I dug out, completes the program and removes it from the screw.
Tell me how it works, specifically I am interested in how api calls occur, software showed that it’s not just a transition to a function address, but some perversions in kernel32, and then api itself is called, and so on with each one. What is it and how are the parameters transmitted?

uses
windows;

procedure DeleteSelf;
var hModule: THandle;
szModuleName: array [0..MAX_PATH] of char;
hKrnl32: THandle;
pExitProcess, pDeleteFile, pFreeLibrary, pUnmapViewOfFile: pointer;
ExitCode: UINT;
begin
hModule: = GetModuleHandle (nil);
GetModuleFileName (hModule, szModuleName, sizeof (szModuleName));
hKrnl32: = GetModuleHandle ("kernel32");
pExitProcess: = GetProcAddress (hKrnl32, "ExitProcess");
pDeleteFile: = GetProcAddress (hKrnl32, "DeleteFileA");
pFreeLibrary: = GetProcAddress (hKrnl32, "FreeLibrary");
pUnmapViewOfFile: = GetProcAddress (hKrnl32, "UnmapViewOfFile");
ExitCode: = system.ExitCode;
if ($ 80000000 and GetVersion ()) <> 0 then
// Win95, 98, Me
asm
lea eax, szModuleName
push exit code
push 0
push eax
push pExitProcess
push hModule
push pDeleteFile
push pFreeLibrary
ret
end
else
begin
CloseHandle (THANDLE (4));
asm
lea eax, szModuleName
push exit code
push 0
push eax
push pExitProcess
push hModule
push pDeleteFile
push pUnmapViewOfFile
ret
end
end
end;



Andrey   (2001-12-14 10:34) [6]

Gentlemen, Why so many tricks, :) contact the FAQ at http://delphi.mastak.ru/cgi-bin/faq.pl?look=1&id=988621694&n=15



paul_shmakov   (2001-12-15 01:14) [7]

2 Andrey:
FAQ is not right. Milz gave the right decision. here in the WinApi forum, we have considered this decision in detail.



А вот   (2001-12-15 01:41) [8]

about the "correctness" - need to consult with Digitman. In my opinion, he became interested in this and dug deeper. If IMHO he wants to share. What I personally doubt, because the topic is "slippery".



paul_shmakov   (2001-12-16 02:13) [9]

2 And ​​here:
:) Well, if Digitman does not want to share, then I will share.

http://delphi.mastak.ru/cgi-bin/forum.pl?look=1&id=1004956210&n=5

see link, well, very detailed for winnt / 2k



Pages: 1 whole branch

Forum: "Main";
Current archive: 2002.01.08;
Download: [xml.tar.bz2];

Top









Memory: 0.58 MB
Time: 0.029 c
14-22362
MIFI
2001-11-04 02:34
2002.01.08
how to find a person


1-22235
DDDeN
2001-12-17 06:47
2002.01.08
Screensaver


1-22259
Rats
2001-12-12 17:55
2002.01.08
Curve finish (2 double)


3-21995
Dmitry D.
2001-12-07 08:00
2002.01.08
Error BDE got out ... I do not understand what could be the problem


7-22453
Juri
2001-09-21 18:26
2002.01.08
RS485





afrikaans albanian Arabic armenian azerbaijani basque belarusian bulgarian catalan Chinese (Simplified) Chinese (Traditional) croatian Czech danish Dutch English estonian filipino finnish French
galician georgian German greek haitian Creole hebrew Hindi hungarian icelandic indonesian Irish italian Japanese Korean latvian lithuanian macedonian malay maltese norwegian
persian polish portuguese Romanian russian serbian slovak Slovenian Español swahili Swedish thai turkish Ukrainian urdu vietnamese welsh yiddish bengali bosnian
cebuano Esperanto gujarati hausa hmong igbo javanese kannada khmer lao latin maori marathi mongolian nepali punjabi somali tamil telugu yoruba
zulu
English French German Italian Portuguese Russian Spanish