I need to make after the game get close the file automaticlly be deleted
I tried to make the faction like it but nothing happen
Code:
BOOL WINAPI DllMain ( HMODULE hDll, DWORD dwReason, LPVOID lpReserved ){
if (dwReason == 1){
//Call for hack
} else if (dwReason == 0){
DeleteFile("Dllname.dll");
}
return TRUE;
}
thx
ROFL LOOOL.It won't delete because the file is still running.And are you trying to make your file protected?If so think of something like a HWID security system...
Write a bat file to the disk and call it when your hack is closing... The bat just has to verify when the game process stops, meaning the dll its not being used anymore, then it deletes both the Dll and itself. If you want a more advanced way look at this. http://www.codeprojec*****m/Articles/...ng-Executables It can be done with a Dll as well I think...
Like everyone said, you cant delete something that is in use.
Just do it the simple way, write the bat that will delete the .dll then delete himself (yes it can do that).
Nontheless. Point of this is? Why would you delete your own .dll? I think if you want to delete something, the injector should do it. Not the file itself.
Hook Ntdl!TerminateProcess() and write your bat from there.