Abyssmedia.com Forum Index Abyssmedia.com
Abyssmedia Support Forums
 
  FAQ    Search    Memberlist    Usergroups   Register 
  Profile    Log in to check your private messages    Log in 

calling a exe from a exe

 
Post new topic   Reply to topic    Abyssmedia.com Forum Index -> Quick Batch File Compiler
View previous topic :: View next topic  
Author Message
frenchrl



Joined: 22 Mar 2006
Posts: 4

PostPosted: Fri Aug 09, 2013 5:22 pm    Post subject: calling a exe from a exe Reply with quote

I have compiled the following batch file to test_pswd.exe:
@for /f %%a in (c:\work_folder\password_file.txt) do @isql -Smy_server -Usa -P%%a

This works perfectly in calling the password_file.txt and runs my sql.

Now I need to compile the password_file.txt to a exe in order to hide the password.

When I do this and then run my test_pswd.exe nothing happens or I simply get the actual code from test_pswd.exe echoed back.


I have hundreds of scripts like this that I need to periodically change the password on. This requires a recompile of all my executables. It would be much easier to change it one place than in hundreds.

Any ideas, suggestions??

Thanks
Back to top
support
Site Admin


Joined: 13 Feb 2004
Posts: 376

PostPosted: Mon Aug 12, 2013 6:02 am    Post subject: Reply with quote

I have only one idea:

1. change "password_file.txt" to "password_file.bat" and
replace your password with something like this:

if "%1"="secretkey" echo "your password"

Compile it.
Nobody can get your password without secret key.


2. In "test_pswd.exe"

set /p mypassword=< password_file.exe "secretkey"
@call isql -Smy_server -Usa -P%mypassword%
Back to top
frenchrl



Joined: 22 Mar 2006
Posts: 4

PostPosted: Mon Aug 12, 2013 1:24 pm    Post subject: Reply with quote

support wrote:
I have only one idea:

1. change "password_file.txt" to "password_file.bat" and
replace your password with something like this:

if "%1"="secretkey" echo "your password"

Compile it.
Nobody can get your password without secret key.


2. In "test_pswd.exe"

set /p mypassword=< password_file.exe "secretkey"
@call isql -Smy_server -Usa -P%mypassword%



Really appreciate the help, however the variable that gets passed here to the password is the entire if statement. Meaning that the %mypassword% is becoming: if "%1"="secretkey" echo "your password"

I am working with this though and trying to get it to work.

We are really in a bind here to make this work. All our batch jobs, roughly 300 of them, have to be re-compiled to do something like this soon.

Thanks for your help and time it is appreciated.
Back to top
Whale



Joined: 24 Sep 2009
Posts: 22

PostPosted: Fri Aug 16, 2013 6:15 pm    Post subject: Reply with quote

Hi,
The first solution would be this below:
Code:
http://www.abyssmedia.com/forum/what-makes-quick-batch-file-compiler-better-than-the-others-t458,start,15.html

But the project is put on hold for now as far as I know.

The next best thing is below:

Code:
http://www.softpedia.com/get/Security/Encrypting/Codeode-Command-Line-Encrypt.shtml

http://www.softpedia.com/get/Security/Encrypting/Command-Line-Crypter.shtml

http://www.softpedia.com/get/Security/Encrypting/Krypter-Command-Line.shtml

http://www.f2ko.de/downloads/cmdtools/rc4.zip

http://www.softpedia.com/get/Programming/Other-Programming-Files/Base64-De-Encoder.shtml

http://www.techrepublic.com/article/use-cipherexe-for-command-line-encryption/

http://hcrypto.sourceforge.net/

http://technet.microsoft.com/en-us/library/bb490878.aspx

http://www.softspecialists.com/download.aspx (MiCry and Xor)


What I mean is encrypt the file using commandline utilities such as the above tools, windows itself provide cipher as a commandline tool too.

If you dont want to use cipher, you can use commandline tools such as the above and embedded it into your Quick Batch File Compiler compiled exe.

The last option if you have ScriptCryptor, you could
put the password in it.

Eg.

Test.vbs contains:
Code:
Wscript.Echo "Password"


Compiled it into console test.exe using ScriptCryptor.

Then use something like this batch file below:

Getoutput.bat contains:
Code:
@echo off
FOR /F "tokens=*" %%i in ('%~dp0test.exe') do SET OUTPUT=%%i
Echo %OUTPUT%
pause
exit


Then run Getoutput.bat, it should call test.exe, then capture its output
into the variable OUTPUT.

The Getoutput.bat should echo the OUTPUT capture result.
Back to top
Whale



Joined: 24 Sep 2009
Posts: 22

PostPosted: Sun Aug 18, 2013 4:59 pm    Post subject: Reply with quote

In the end, can I know what method you use? Question
Back to top
Display posts from previous:   
Post new topic   Reply to topic    Abyssmedia.com Forum Index -> Quick Batch File Compiler All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001-2011 phpBB Group