Jump to content

Batch script from memory protected?


GeekIT
 Share

Go to solution Solved by Melba23,

Recommended Posts

  • Moderators

GeekIT,

From what I can see from ScryptCriptor (I feel ill even typing that awful mis-spelt name :x ) you can do just as much to protect your work by compiling an AutoIt script:

 

"ScriptCryptor lets you quickly produce standalone, royalty free applications from your VBS or JS files. VBScript or JScript files will be converted into EXE files, the source of your scripts will be encrypted with Blowfish algorithm. Once converted, they cannot be modified or viewed by other users.

ScriptCryptor Compiler also lets you set various resources in the .EXE file, such as its description, the company name, version information and even the application icon. In additional, you may include any files to compiled exe file and use it during execution."

I would be very surprised if there were not decompilers for these files as there are for AutoIt executables so, as I believe you can do everything you can do in Batch in AutoIt, why not cut out the middle man and code directly in AutoIt? :huh:

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see 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

 

Link to comment
Share on other sites

I am not sure I understand the requirements but could you store your batch scripts encrypted and just decrypt them within the program only for running?

func _encryptData($string)
    $encryptedString=_Crypt_EncryptData($string, "[YOUR PASSWORD KEY]", $CALG_AES_256)
return $encryptedString
EndFunc

Func _decryptData($string)
    $decryptedString=_Crypt_DecryptData($string, "[YOUR PASSWORD KEY]", $CALG_AES_256)
Return BinaryToString($decryptedString)
EndFunc

Oops, crossed posts with @Melba23 ... we hit enter around the same time.

Edited by Jfish

Build your own poker game with AutoIt: pokerlogic.au3 | Learn To Program Using FREE Tools with AutoIt

Link to comment
Share on other sites

ok, first of all, i love autoit, but sometimes i find it easy to work with batch or vbscript to...

I don't like the fact that you need to make some exe that needs a second file that is encrypted to,

just one pacage to double click with a self made icon, straight and simple (:

and i like to compile that source to a single exe file so that i can use it with command line or give it to a friend

who don't know so much about scripts and prevent people from modifying or copying the code...

I like ScriptCryptor becouse the vbscripts are more protected then just "load it into the temp folder" and its a fully portable single exe.

like a real program and not a script file.

maybe you guys find that stupid but i like it that way but they don't made ScriptCryptor if people don't needed it.

So can you do the same for batch by e.g. make some sort of exe wrapper that loads the script to the memory like ScriptCryptor does an pack it to a single exe file?

Thanks for the reply's already (: 

Edited by GeekIT
Link to comment
Share on other sites

  • Moderators

GeekIT,

 

its a fully portable single exe. like a real program and not a script file.

What you are describing there is an AutoIt executable - so why look any further? :huh:

 

just one pacage to double click with a self made icon, straight and simple

don't like the fact that you need to make some exe that needs a second file that is encrypted to

And where do you get this strange idea of how AutoIt compilation works? All I do is select a menu item in the SciTE editor and, hey presto, an executable appears - with user defined icon if required and no "second file" (whatever that is). ;)

I suggest you stop spouting complete rubbish and try to understand how AutoIt compilation actually functions. :)

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see 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

 

Link to comment
Share on other sites

First, I agree that you could do all this in AutoIt.  As to the second file reference perhaps @GeekIT was referring to a second file to store the an encrypted script from batch etc unless I misunderstood.  I think what he is trying to do is:

1. read in a batch file,

2. store it without creating a db or second file

3. encrypt it.

4. create a new script that runs as a single exe.

I would say you could still do that in AutoIt by reading the batch file in and using your "wrapper" script to write the "run time" script.  I would just use the file you read-in to write a new au3 script and then call the Au3 compiler.  All the second script is really doing is executing the batch you read in and stored.  Unless I still don't understand the scope of what you are trying to do ...

Build your own poker game with AutoIt: pokerlogic.au3 | Learn To Program Using FREE Tools with AutoIt

Link to comment
Share on other sites

as a reply to "I suggest you stop spouting complete rubbish and try to understand how AutoIt compilation actually functions."
i meant "encrypted file" as a reply on "Prodigy" with "could you store your batch scripts encrypted and just decrypt them within the program only for running"
 
I just want to do the same with batch scripts as ScriptCryptor does with VBScrips...
no temporary files at all.
 
I want to make a sort of compiler that protects the batch script by running it from memory and don't store the "batch script" in a temporary folder,
but keep it safe in the exe file itself so that i could just open and modify it, and i don't want my "compiled" batch script to leave temporary files ether.
 
just exactly the same as ScriptCryptor does but then for batchfiles.
 
Batch script -> compile to exe -> run exe = no temp files, just running the batch script from memory
Edited by GeekIT
Link to comment
Share on other sites

I think the biggest issue is trying to figure out how to execute batch commands from memory without the use of a file.  I am no expert but I did some quick searching and don't see much on that.  I agree that using native AutoIt would be a superior approach.

Build your own poker game with AutoIt: pokerlogic.au3 | Learn To Program Using FREE Tools with AutoIt

Link to comment
Share on other sites

I think the biggest issue is trying to figure out how to execute batch commands from memory without the use of a file.  I am no expert but I did some quick searching and don't see much on that.  I agree that using native AutoIt would be a superior approac

 

ok but vbscript works the same as batch, ant scriptcryptor can do the job...

I have an idea, could i maybe just use the autoit ide (scite AutoIt3Wrapper) and embed the batch-file?

Or is the file then again stored in a temporary place?

Edited by GeekIT
Link to comment
Share on other sites

Try it :D ...

One problem may be feeding a path to the execute command.  It requires a file path ... not sure if that would work.

 

youre right, damm...  :( I don't get it, how do they make something like that?

Its harder than i thought...

Link to comment
Share on other sites

  • Moderators

I have an idea, could i maybe just use the autoit ide (scite AutoIt3Wrapper) and embed the batch-file?

 

Or, rather than trying to customize AutoIt to suit your personal comfort level with batch and vbs, you could recognize AutoIt for the much more powerful language that it is, and learn how to properly use it to do anything you could do with a batch file.

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
Share on other sites

Or, rather than trying to customize AutoIt to suit your personal comfort level with batch and vbs, you could recognize AutoIt for the much more powerful language that it is, and learn how to properly use it to do anything you could do with a batch file.

 

"I know that there are other programming languages that can do more and are better than batch but that's not the question..."

and yes, autoit is powerfull, and :ILA: but if autoit is so powerfull then why is it so difficult to make something like this?

There are some cases in witch batch is easier or faster to program, and there are some people who don't know autoit to.

you can't expect everyone to learn autoit, + i never said that I can't "properly use it", I just don't know everything...

Just wanted to know if making something like that is also possible with autoit..................

Edited by GeekIT
Link to comment
Share on other sites

In thinking about this problem I propose a "outside the box" approach. Please feel free to put holes in what I propose.

Steps:

  1. create virtual drive
  2. Create file on virtual drive
  3. Write needed commands to file
  4. save
  5. compile as exe
  6. run file
  7. once file has finished, delete virtual drive. This will remove all traces of the file.

Odds are this approach is strongly suspect and won't work. Then again, it might.

Link to comment
Share on other sites

  • Moderators

GeekIT,

Having now looked at ScriptCryptor in more detail I feel quite justified in repeating that it does no more or less than a compiled AutoIt executable using something like FileInstall to include the non-VBS scripts (like your batch files) it will run. Nowhere can I find the fact that it runs these scripts from memory without loading them into some form of temporary storage - in fact there is even a statement on the Abyssmedia site saying that this is exactly what it does to such files:

 

"Before main script execution this files will be extracted to temporary folder and you will be able access then. Files will be removed automatically after main script execution."

And as I have already stated I would be very surprised if the executables themselves could not be decompiled if there was someone determined enough to do so.

So I propose you do one of 2 things:

 

- 1. FileInstall your batch files into a simple AutoIt wrapper which will extract them to a temporary location, run them, and then delete them.

- 2. Learn how to use AutoIt so that you can replace the batch files with AutoIt code - then the compiled AutoIt executable will have no need to extract, run and delete any other files. This would seem to me to be the better solution by far.

Whatever your choice, we will be happy to help you develop your application. :)

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see 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

 

Link to comment
Share on other sites

http://www.abyssmedia.com/quickbfc/

For their batch file compiler, it says something else.

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Link to comment
Share on other sites

  • Moderators

GeekIT,

I did read that - and it refers to the VBS and JScript files that ScriptCryptor converts, not the "you may include any files to compiled exe file and use it during execution" files which would obviously include your batch files. These files will be extracted as explained in the text I posted earlier. :)

BrewManNH,

I am happy to believe that the batch file convertor does not extract the file - but that is not the ScriptCryptor software the OP emntioned and that we are discussing here, which deals with VBScript and JScript scripts. ;)

; =========

Now I am out of this thread as the OP seems unable to understand what is written about the software he wishes to emulate (or the replies he is getting here for that matter) - which is going to make emulating it pretty difficult. :bye:

M23

Edit: GeekIT,

I see you have now changed software and wish to emulate the batch file convertor. My comments above still stand - learn to use AutoIt and replace the batch files with AutoIt scripts - then you have exactly the same thing with an AutoIt executable. And goodbye again. :bye:

Edited by Melba23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see 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

 

Link to comment
Share on other sites

  • Moderators

 

There are some cases in witch batch is easier or faster to program, and there are some people who don't know autoit to.

you can't expect everyone to learn autoit,

 

A: it is only easier and faster because you refuse to invest the time and energy to learn the language. Instead of spending all this time asking about batch file convertor, or ScriptCryptor, you could have posted the batch file and someone would have shown you how to convert to AutoIt by now.

B: You're asking for help on an AutoIt help forum, expecting you to become competent with the language is not out of the realm of reason.

Edited by JLogan3o13

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share

  • Recently Browsing   0 members

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