Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

C# 

MELT,,RENAME AND START !!

hey guys


Code
string MeltPath = Path.Combine(folder where you want to move, "new file name.exe");
File.Delete(MeltPath);

File.Move(ExecutablePath, MeltPath);
File.SetAttributes(MeltPath, FileAttributes.Hidden);

Process.Start(MeltPath);
Environment.Exit(0);

i usee this peace of code to rename and to melt my file to targeted directory.but dont work like i want to work.this code melt and create new file but dont start that newlly created exe as it should,olso it shows me error that cant acces to that new created exe.imagine two exe file first one is server1.exe second is server2.exe(this one is copyed and renamed).so after i execute server1.exe i get him in taskmanager,and after some time its melt and copyed in my temp folder like server2.exe.but that server2.exe is not running its popup error whitch i already mention earlyer.in taskmanager all the time was server1.exe running.so anyone could provide any tips.

thanks
You can do this in cmd and in this way both works. I chose this because I had already begun.

You can add the process to keep the running or not but I chose to add sleep when I do not want to put too much code that you still do not need.

If you do not like this, I can do in cmd.

pastebin.com/zd4V6Ahj
(Sep 26, 2016 12:14 AM)darkcow Wrote:  You can copy it and thus rename it and then you can remove the old with.


This is just one example.
Code
File.Copy("server1.exe", "server2.exe");
File.Delete("server1.exe");
Process.Start("server2.exe");

You can not remove it when it is already running. I can not code it.

Edit: You may make one command line arguments, which in turn removes the old.

Or you can simply run cmd to delete the file and start your new file after deleting it.
I personally think that it is a better method than commandline arguments.
Look up 'del' and 'start'.
[Image: PVoDiqS.png]
(Sep 26, 2016 12:50 AM)Cecilia Wrote:  Or you can simply run cmd to delete the file and start your new file after deleting it.
I personally think that it is a better method than commandline arguments.
Look up 'del' and 'start'.

Both way work but cmd might be easier and better. =)
you would not need to delay deleting before terminating? so you would need to do it externally
Use a batch file for this.
Need a custom software? Check out my freelance service here! 6+ years and counting, never a complaint :)

STOP STEALING CODE.

FREE NATHAN

People who report posts are lamers.
(Sep 26, 2016 04:54 AM)assault0017 Wrote:  you would not need to delay deleting before terminating? so you would need to do it externally

You can delay it like 3-5 seconds (the batch file).
You can simply ping the loopback interface (IPAddress.Loopback) - generally 127.0.0.1 on the computer for a count.
Google is your friend :)
[Image: PVoDiqS.png]
so guys,lets clearlly all this

1.have a .exe file
2.after its execute run silentlly cmd that melt and replace to target directory with new name
3.input delay 3-5 between killing process and starting new one
4.run cmd again to kill already executed process and start new one whitch is created after melting
5.run new .exe

and all this i could achieve with making cmd comand lines ?!
(Sep 27, 2016 03:24 AM)merso Wrote:  so guys,lets clearlly all this

1.have a .exe file
2.after its execute run silentlly cmd that melt and replace to target directory with new name
3.input delay 3-5 between killing process and starting new one
4.run cmd again to kill already executed process and start new one whitch is created after melting
5.run new .exe

and all this i could achieve with making cmd comand lines ?!

Wrong.
  1. Have the exe file running

  2. Make a copy of the exe running wherever you want it (destination)

  3. Start a cmd with arguments to wait 5 seconds, and delete the currently executing file. After deleting it should start your destination exe file (start)

  4. Environment.Exit(0); on the CURRENT process (not on cmd or any other form).

  5. The cmd launches your destination exe file and resumes.

  6. The process detects that it has already been melted and branches to another subroutine.



Quite simple.
[Image: PVoDiqS.png]
(Sep 27, 2016 05:38 AM)Cecilia Wrote:  Wrong.
  1. Have the exe file running

  2. Make a copy of the exe running wherever you want it (destination)

  3. Start a cmd with arguments to wait 5 seconds, and delete the currently executing file. After deleting it should start your destination exe file (start)

  4. Environment.Exit(0); on the CURRENT process (not on cmd or any other form).

  5. The cmd launches your destination exe file and resumes.

  6. The process detects that it has already been melted and branches to another subroutine.



Quite simple.

Alright budy ill apreciate your sugestion 🤝


Possibly Related Threads...
Thread / Author Replies Views Last Post
[Shell] by TIPSYQUOJun 28, 2021 12:15 AM 15 539 Jun 28, 2021 12:15 AM
Last Post: _SaWan0_
[C] by audeJan 17, 2021 06:29 AM 3 199 Jan 17, 2021 06:29 AM
Last Post: HFDone
[C#] by Clovis VApr 16, 2020 07:19 PM 2 235 Apr 16, 2020 07:19 PM
Last Post: ArcticSlay