Jump to content

A file renaming itself


Azu
 Share

Recommended Posts

I know that some files have ways to randomly rename themselves every time you run them, in attempts to get around things such as gameguard or warden.

I am wandering how a file can do this? Whenever I try to rename a file that is running, it won't let me because it is in use.

How can a make an AutoIt script do something like this? Is it even possible? :P

Edit:

Sorry, I didn't see the section I was in until I posted here, and now I can't delete my post, can somebody please move it to the support section? x_x

Edited by Azu
Link to comment
Share on other sites

  • Moderators

The filepath in the process list doesn't change just because you've renamed a running program. Procexp.exe rather than task manager easily shows you that.

But to answer your question... FileMove() can do what your asking specifically.

Going for my record on post count today :P ?

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

  • Moderators

FileMove while its Running???

Record ????

When do you get the next Star???

8)

I hope your not being sarcastic :P

If you are... He asked how to rename an .exe while it is running.

If you want to test what I said:

1. Make a compiled autoit script on your desktop with a While / WEnd loop and name the .exe doodle.exe

2. Now run the .exe

3. It's running right?... Now use this:

FileMove(@DesktopDir & '\Doodle.exe', @DesktopDir & '\Doodle2.exe', 1)
in another script and you will see that now your Doodle.exe is named Doodle2.exe.

The above is only if you were being sarcastic... and as I said, even though it changes the executable name, it doens't change the original exectuable that is currently running.

Edited by SmOke_N

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

  • Moderators

Actually no...

I didn't know you could do that... thx

...........

What is "the" or "your" record?

When do you get your next star?

8)

I have no Idea on the actual number, I know there have been a few bored days in the upper 70's maybe 80's.

Edit:

I dont' know on the next star, if someone tells me... I'll make sure to stop posting 1 post before hand :P.

Edited by SmOke_N

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

  • Moderators

6,250

8)

:P

I told my wife you would say whatever post number was next for me :nuke:

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

  • 2 weeks later...

Hi, thanks, it works :)

I changed it a little bit to make it randomizing, and so it uses the au3 extension if it's not an exe..

$a=random(1,20,1)
$b=""
for $z=1 to $a
$c=random(1,2,1)
if $c=1 then
$d=random(0,9,1)
else
$c=random(1,2,1)
if $c=1 then
$d=chr(random(asc("a"), Asc("z"), 1))
else
$d=chr(random(asc("A"), Asc("Z"), 1))
endif
endif
$b=$b&$d
next
if @Compiled=1 then
$b=$b&".exe"
else
$b=$b&".au3"
endif
filemove(@ScriptFullPath,@ScriptDir&"\"&$b,1)

:P

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...