Caml Light Posted August 31, 2011 Share Posted August 31, 2011 Hi guys! If my batch file contains this::SorryECHO Sorry!:WelcomeECHO Welcome!Is it possible to jump to the ":Sorry" label if i open the cmd file and to jump to the ":Welcome" label if i open the same cmd file followed by an option (for example: batch.cmd /jump)?Thank you!! Link to comment Share on other sites More sharing options...
IcemanND Posted August 31, 2011 Share Posted August 31, 2011 goto %1:sorryEcho Sorry!Goto :end:welcomeecho welcomeGoto :end:end just use the label name for the switch Link to comment Share on other sites More sharing options...
Caml Light Posted August 31, 2011 Author Share Posted August 31, 2011 GREAT! Thank you very much! Link to comment Share on other sites More sharing options...
Caml Light Posted August 31, 2011 Author Share Posted August 31, 2011 (edited) a last question... if i convert my CMD batch to EXE, for a person that doesn't know the label i've given, is it possible to jump directly to the "Welcome" label, or anyway to find it's name? I'd to protect my batch file.. so do you think it's a secure solution? Thanks! Edited August 31, 2011 by Caml Light Link to comment Share on other sites More sharing options...
allen2 Posted August 31, 2011 Share Posted August 31, 2011 It just depends on how secure you want it to be: if you use a batch to exe converter, most of them will only unpack the batch in a temporary folder and run it from there and then the protection will be very light. Link to comment Share on other sites More sharing options...
Caml Light Posted August 31, 2011 Author Share Posted August 31, 2011 ..and what do you suggest me to protect better my cmd script? Thanks in advance! Link to comment Share on other sites More sharing options...
Kelsenellenelvian Posted August 31, 2011 Share Posted August 31, 2011 Make it into a autoit file and compile it with password... Link to comment Share on other sites More sharing options...
jaclaz Posted August 31, 2011 Share Posted August 31, 2011 (edited) Make it into a autoit file and compile it with password.......and make it longer than 12 characters and make sure you insert "strange" non alpha-numeric characters and not a-z/A-Z ones.Examples:h1_1_@m_@_|33t_p@§§vv0rdÿ00_vv0n*t_cr@ç#-m3 BTW, IcemanND's nice batch may be "bettered" (assuming you are on a 2K/XP or later NT based system):@ECHO OFFSETLOCAL ENABLEEXTENSIONSIF NOT "%1"=="" FOR /F %%A in ('type %~nx0 ^|FIND ":%1" ^| FIND /V "FIND"') DO GOTO :%1Echo A suffusion of yellow ...GOTO :EOF:sorryEcho Sorry!GOTO :EOF:welcomeecho welcomeOR (to follow your original post): @ECHO OFFSETLOCAL ENABLEEXTENSIONSIF NOT "%1"=="" FOR /F %%A in ('type %~nx0 ^|FIND ":%1" ^| FIND /V "FIND"') DO GOTO :%1Echo Sorry!GOTO :EOF:welcomeecho welcomeOR:@ECHO OFFSETLOCALIF /I "%1"=="welcome" GOTO :%1Echo Sorry!GOTO :EOF:welcomeecho welcomejaclaz Edited August 31, 2011 by jaclaz Link to comment Share on other sites More sharing options...
Kelsenellenelvian Posted August 31, 2011 Share Posted August 31, 2011 •h1_1_@m_@_|33t_p@§§vv0rd•ÿ00_vv0n*t_cr@ç#-m3OMG LOLZ Link to comment Share on other sites More sharing options...
allen2 Posted August 31, 2011 Share Posted August 31, 2011 (edited) You can use an obfuscator (some batch to exe do this but most of them aren't free) or use another language like autoit (which is a little more secure when using a password ).You could also change the code to make it so complex that just reading it would not help "the man in the middle" to understand it. Edited August 31, 2011 by allen2 Link to comment Share on other sites More sharing options...
Tripredacus Posted August 31, 2011 Share Posted August 31, 2011 IIRC, the password in AutoIT is only for their decompiler that is meant for AutoIT v2 executables. It was this entire purpose (they lock topics over there if you ask about it) that this function was removed in v3, although you can still put a password in it. But this password does nothing for other decompilers. Link to comment Share on other sites More sharing options...
Caml Light Posted August 31, 2011 Author Share Posted August 31, 2011 thank you for your reply guys! I want to specify that to protect my batch i can't use any password to type in.To convert to EXE my batch i've used "Bat To Exe Converter 1.5.1.0". Do you think it's enough secure? Better Offuscator?Now i've added the code by jaclaz:@ECHO OFFSETLOCALIF /I "%1"=="welcome" GOTO :%1Echo Sorry!GOTO :EOF:welcomeecho welcomeBut if an expert user will decrypt my batch, this method will be vain. Link to comment Share on other sites More sharing options...
Caml Light Posted August 31, 2011 Author Share Posted August 31, 2011 I've find Crypto Obfuscator, but is it only for .NET?? Link to comment Share on other sites More sharing options...
Kelsenellenelvian Posted August 31, 2011 Share Posted August 31, 2011 (edited) yes it looks like itI like the looks of this:http://www.bdargo.com/ Edited August 31, 2011 by Kelsenellenelvian Link to comment Share on other sites More sharing options...
jaclaz Posted August 31, 2011 Share Posted August 31, 2011 (edited) This seem to me "good enough":http://www.f2ko.de/programs.php?lang=en&pid=b2eBut we also have an IDE for batch files :http://sourceforge.net/projects/batchcompiler/And also a new thingy , Visualbatch :http://visualbatch.sourceforge.net/The good ol' way:http://www.ericphelps.com/batch/samples/obfuscating.txtjaclaz Edited August 31, 2011 by jaclaz Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now