Как заставить DLL выгрузить саму себя? Для EXE - нашел следующий код lea eax, buf push 0 push 0 push eax push ExitProcess push module push DeleteFile push UnmapViewOfFile ret
Как не работает? вот полный код, правда на сях include <windows.h> int main(int argc, char *argv[]) { char buf[MAX_PATH]; HMODULE module; module = GetModuleHandle(0); GetModuleFileName(module, buf, MAX_PATH); CloseHandle((HANDLE)4); __asm { lea eax, buf push 0 push 0 push eax push ExitProcess push module push DeleteFile push UnmapViewOfFile ret } return 0; }
assorted А вот так. Не работает, и всё. В ХР секция не имеет предопределённого хэндла (4), как было в 2k.