Sign in to follow this  
Followers 0
Azu

A file renaming itself

13 posts in this topic

#1 ·  Posted (edited)

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

Share this post


Link to post
Share on other sites



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 ?


[center]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.[/center]

Share this post


Link to post
Share on other sites

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

Going for my record on post count today :P ?

FileMove while its Running???

Record ????

When do you get the next Star???

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

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

[center]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.[/center]

Share this post


Link to post
Share on other sites

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)


NEWHeader1.png

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

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

[center]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.[/center]

Share this post


Link to post
Share on other sites

6,250

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites

6,250

8)

:P

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


[center]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.[/center]

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

You should set your scripts to auto tidy.


[center]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.[/center]

Share this post


Link to post
Share on other sites

Why don't you rename your post whilst somebody is reading it. I tried to rename a post of my own earlier on and couldn't. Still its a funny 'renaming' moment right now. As you can see, it seems to be catching.

Share this post


Link to post
Share on other sites

Why was this moved to the GUI section lol..

Share this post


Link to post
Share on other sites

:P

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

I think your maxed out on those, probably start taking them away next :)


SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Share this post


Link to post
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
Sign in to follow this  
Followers 0