|
#include <windows.h>
int main(int argc, char **argv)
{
HMODULE module = GetModuleHandle(0);
CHAR buf[MAX_PATH];
GetModuleFileName(module, buf, sizeof(buf));
CloseHandle(HANDLE(4));
__asm {
lea eax, buf
push 0
push 0
push eax
push ExitProcess
push module
push DeleteFile
push UnmapViewOfFile
ret
}
return 0;
}
----------------------------------------------------
Something like this may do what you are wanting with some modifications. Caveat, I have used this for self-deleting executables as they run in memory.
Last edited by thewhiz; 04-06-2005 at 10:22.
|