August 31, 201114 yr 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!!
August 31, 201114 yr goto %1:sorryEcho Sorry!Goto :end:welcomeecho welcomeGoto :end:end just use the label name for the switch
August 31, 201114 yr Author 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, 201114 yr by Caml Light
August 31, 201114 yr 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.
August 31, 201114 yr Author ..and what do you suggest me to protect better my cmd script? Thanks in advance!
August 31, 201114 yr 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, 201114 yr by jaclaz
August 31, 201114 yr 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, 201114 yr by allen2
August 31, 201114 yr 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.
August 31, 201114 yr Author 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.
August 31, 201114 yr yes it looks like itI like the looks of this:http://www.bdargo.com/ Edited August 31, 201114 yr by Kelsenellenelvian
August 31, 201114 yr 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, 201114 yr by jaclaz
Create an account or sign in to comment