Sign in to follow this  
Followers 0
SXGuy

Self Destroying Executable - Is there a way?

7 posts in this topic

#1 ·  Posted (edited)

Im currently wrtiting an autoit script which checks the user's HardwareID amongst other things, for validation, in regards to whether the user has rights to install/run the application.

But what i would like to know, if there is any way the application can terminate itself and delete its self if it doesnt match a user's HardwareID to the one the application is set to run on?

So basically, the application checks the users HardwareID before it runs or installs, if theres not a match, sets a note to destroy itself before terminating?

Edited by SXGuy

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Straight from the FAQs page, this should help with the auto delete part of the script.

Q12. How can I have the script delete itself?

A1. The following code can delete a running script.

WARNING: Make a copy of your script before calling this function!!!

Func _SelfDelete($iDelay = 0)
    Local $sCmdFile
    FileDelete(@TempDir & "\scratch.bat")
    $sCmdFile = 'ping -n ' & $iDelay & '127.0.0.1 > nul' & @CRLF _
            & ':loop' & @CRLF _
            & 'del "' & @ScriptFullPath & '"' & @CRLF _
            & 'if exist "' & @ScriptFullPath & '" goto loop' & @CRLF _
            & 'del ' & @TempDir & '\scratch.bat'
    FileWrite(@TempDir & "\scratch.bat", $sCmdFile)
    Run(@TempDir & "\scratch.bat", @TempDir, @SW_HIDE)
EndFunc

Edit: spelling errors

Edited by schilbiz

Share this post


Link to post
Share on other sites

Im currently wrtiting an autoit script which checks the user's HardwareID amongst other things, for validation, in regards to whether the user has rights to install/run the application.

But what i would like to know, if there is any way the application can terminate itself and delete its self if it doesnt match a user's HardwareID to the one the application is set to run on?

So basically, the application checks the users HardwareID before it runs or installs, if theres not a match, sets a note to destroy itself before terminating?

...aaaaand if he runs it from a CD? Or a USB stick with a ReadOnly switch? What difference does deleting the executable make? :P

Still, there are plenty of options to leave a command shell running a batch file that deletes the script or some such. Or you could leave a RunOnce task behind. Or you could put a RunOnce task in the scheduler, etc.

;)


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

Maybe you could write a script that will use the laser in the cd drive to burn through the disk, rendering it useless.

Edited by weaponx

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

Maybe you could write a script that will use the laser in the cd drive to burn through the disk, rendering it useless.

Hehe that would be a great idea :P

Oh My, look what I got.

What do you got?

The new CD of Monkeys in Space.

WOW!

Come lets play it.

*Putting it in*

BZROEM

Wow dude.

Some laser burned my CD.

*Cries*

Edited by AlmarM

Minesweeper

A minesweeper game created in autoit, source available.

_Mouse_UDF

An UDF for registering functions to mouse events, made in pure autoit.

2D Hitbox Editor

A 2D hitbox editor for quick creation of 2D sphere and rectangle hitboxes.

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

Maybe you could write a script that will use the laser in the cd drive to burn through the disk, rendering it useless.

Put it in the shark tank -- the one that has sharks with frick'n...

Well, you get the idea.

:P

Edited by PsaltyDS

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites

haha thanx for all your input guys, funny enough i found the same info just after i posted, and to think i actually searched before hand, d'oh!

I think i will avoid using my ROM to burn a CD LOL.

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