Sign in to follow this  
Followers 0
SecuirtyZone

Delete line in a exe autoit

22 posts in this topic

#1 ·  Posted (edited)

hello everyone

I want after run my script ( exe ) ===)) delet line in The same script who runing

something like that in vbscript : 

for exemple for delet secuirty 

this is code : 

string = replace(Split(CreateObject("Scripting.FileSystemObject").OpenFile(wscript.scriptfullname).ReadAll, vbCrLf)(a),"secuirty","")

this code replaced secuirty to Vacuum

i want this code on autoit 

Edited by SecuirtyZone

Share this post


Link to post
Share on other sites



The executable is compiled, therefore what you want to do can't be done. I therefore suspect you don't have the original source code.

Oh, and please read the Forum Rules as you're new hear (link at the bottom of the page).


_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 04/09/2015

Share this post


Link to post
Share on other sites

ok my friend thank you , what about edit .au3 ? And delete some stuff when it runs !

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

Call me stupid, but if you have the source code, why not just edit the code before executing?

Edited by guinness

_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 04/09/2015

Share this post


Link to post
Share on other sites

I have source code but iwant for exemple when i run script.au3 ==)) delet some code in script.au3 when its runs 

thank you

Share this post


Link to post
Share on other sites

Have you searched the help file?


_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 04/09/2015

Share this post


Link to post
Share on other sites

Yes but i dont find somthing like this  :

I make it in vbscript when i run script.vbs file ==) automatically delet some codes in script.vbs

but i need it in autoit 

thank you for Reply 

Share this post


Link to post
Share on other sites

SecuirtyZone,

Can you please explain why you want to delete lines from an uncompiled script on execution? As the script can be read as plain text before execution, what is the point? :huh:

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites
Melba23

i have smart idea for protect my script with use this code 

Share this post


Link to post
Share on other sites

#10 ·  Posted (edited)

I do not think that's you have to do it while the script compiled. There are other methods that can serve this purpose when the script is compiled.

But when the script is not compiled, you can use this method:

#include <File.au3>

If Not @Compiled Then
    Local $tmp1, $nLines = _FileCountLines(@ScriptFullPath)
    For $a = 1 To Random(3,10,1)
        $tmp1 = Random(1, $nLines, 1)
        _FileWriteToLine(@ScriptFullPath, $tmp1, " ", 1)
    Next
EndIf

But I did not give you a complete example. It is almost useless if you do not know how to hide the 'If Not @Compiled Then' line and if you do not do some other stuff (distractions)

 

EDIT:

Better Example:

#include <File.au3>

If Not @Compiled Then
    Local $nLines = _FileCountLines(@ScriptFullPath)
    For $a = 1 To Random(3,10,1)
        _FileWriteToLine(@ScriptFullPath,Random(1,$nLines,1)," ",1)
    Next
EndIf
Edited by gil900

Share this post


Link to post
Share on other sites

 

I do not think that's you have to do it while the script compiled. There are other methods that can serve this purpose when the script is compiled.

But when the script is not compiled, you can use this method:

#include <File.au3>

If Not @Compiled Then
    Local $tmp1, $nLines = _FileCountLines(@ScriptFullPath)
    For $a = 1 To Random(3,10,1)
        $tmp1 = Random(1, $nLines, 1)
        _FileWriteToLine(@ScriptFullPath, $tmp1, " ", 1)
    Next
EndIf

But I did not give you a complete example. It is almost useless if you do not know how to hide the 'If Not @Compiled Then' line and if you do not do some other stuff (distractions)

 

EDIT:

Better Example:

#include <File.au3>

If Not @Compiled Then
    Local $nLines = _FileCountLines(@ScriptFullPath)
    For $a = 1 To Random(3,10,1)
        _FileWriteToLine(@ScriptFullPath,Random(1,$nLines,1)," ",1)
    Next
EndIf

Yeees thank you so much That what i want <3 can you make script delet just the first Character In the first line

And in the second line 

Share this post


Link to post
Share on other sites

Maybe you can share your idea on how to "protect" your script by making something un-runnable ever again?

Wouldn't it just be easier to remove the script/exe from the hard drive ( a _selfdelete() method )?


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.

Share this post


Link to post
Share on other sites

Maybe you can share your idea on how to "protect" your script by making something un-runnable ever again?

Wouldn't it just be easier to remove the script/exe from the hard drive ( a _selfdelete() method )?

its long idea When I implement this idea And worked successfully

maybe i shared it 

Share this post


Link to post
Share on other sites

 

its long idea When I implement this idea And worked successfully

maybe i shared it 

 

Well, You know you owe me

Share this post


Link to post
Share on other sites

Well, You know you owe me

thank your my friend for code , can you make it delet just first character in first line and second line ?

Share this post


Link to post
Share on other sites

LazyZone, it is too simple that i don't need to help you..

You should try to get this result alone. It is better to try things on your own even if it will take more time because this way you have a chance to go far

Share this post


Link to post
Share on other sites

#18 ·  Posted (edited)

LazyZone, it is too simple that i don't need to help you..

You should try to get this result alone. It is better to try things on your own even if it will take more time because this way you have a chance to go far

ok can you explain me this line in your code i don't understand it

For $a = 1 To Random(3,10,1)

and Random(1,$nLines,1)," ",1)

thank you

Edited by SecuirtyZone

Share this post


Link to post
Share on other sites

#19 ·  Posted (edited)

ok can you explain me this line in your code i don't understand it

For $a = 1 To Random(3,10,1)

and Random(1,$nLines,1)," ",1)

thank you

The purpose of the code is to delete random lines and this happens in Random times.. (

You probably did not understand the second part of the sentence. Sorry)
 
 
This:
For $a = 1 To Random(3,10,1)

                                               3/4/5/6/7/8/9/10

        $a                   1              Random(3,10,1)

For $var = [start number] to   [end number]

        What will happen

Next

 

Means that What will happen(delete lines) will occur several times.

the several times can be between 3 times to 10 times thanks to Random(3,10,1)

you can set that it will heppen more times by change the values to higher values.

 

About What will happen:

                              

Random(1,$nLines,1)

Means that the line number that will be deleted will be between 1 to the max line number in the script

Edited by gil900

Share this post


Link to post
Share on other sites

Once the TO value in a For...To... loop is set it cannot be changed per the Help file...

 If stepVal or stop is a variable, its value is only read the first time the loop executes.

 


Forum Rules         Procedure for posting code

"I like pigs.  Dogs look up to us.  Cats look down on us.  Pigs treat us as equals."

- Sir Winston Churchill

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