
PaperTronics
Moderator: DosItHelp
PaperTronics wrote:@dbenham - I like your obfuscating batch file so much, that I may even use it on my new game! Do you mind if I post about it on my website?
"The strength of the team is each individual member. The strength of each member is the team." --Phil Jackson
Code: Select all
Hello World!
Parameterformat falsch - 708.
Code: Select all
echo @echo off^&(if defined @lo@ goto !hi:~0,1!)^&setlocal disableDelayedExpansion^&for /f "delims=: tokens=2" %%%%A in ('chcp') do set "@chcp@=chcp %%%%A>nul"^&chcp 708^>nul^&set ^^^^"@args@=%%*"
Code: Select all
echo @echo off^&(if defined @lo@ goto !hi:~0,1!)^&setlocal disableDelayedExpansion^&for /f "delims=:. tokens=2" %%%%A in ('chcp') do set "@chcp@=chcp %%%%A>nul"^&chcp 708^>nul^&set ^^^^"@args@=%%*"
penpen wrote:I've downloaded the example, executed "test.bat" to create "Hello_obfuscated.bat", which gives this output:Code: Select all
Hello World!
Parameterformat falsch - 708.
On a fast check i guess, that the error is in daves "ObfuscateBatch.bat" is located in line 123:Code: Select all
echo @echo off^&(if defined @lo@ goto !hi:~0,1!)^&setlocal disableDelayedExpansion^&for /f "delims=: tokens=2" %%%%A in ('chcp') do set "@chcp@=chcp %%%%A>nul"^&chcp 708^>nul^&set ^^^^"@args@=%%*"
I think the for/f-loop is missing the dot character ('.') as a delimiter, so correct line should be:Code: Select all
echo @echo off^&(if defined @lo@ goto !hi:~0,1!)^&setlocal disableDelayedExpansion^&for /f "delims=:. tokens=2" %%%%A in ('chcp') do set "@chcp@=chcp %%%%A>nul"^&chcp 708^>nul^&set ^^^^"@args@=%%*"
Code: Select all
C:\test>chcp
Active code page: 437
Putting the redirection in front certainly can't hurt, but it should not be necessary. CMD.EXE redirection only recognizes single digit file streams. The 8 would only be a problem if it were a complete token, but it is part of the larger 708 token. So CMD.EXE knows it does not represent a file stream.penpen wrote:Although it might be, that the resulting "chcp 708>nul" also may lead to an error, so i would prefer ">nul chcp 708".
dbenham wrote:Wow
So the format of CHCP output must not be consistent across all languages. I was aware that the words would change, but I thought the punctuation would be consistent.
Code: Select all
Aktive Codepage: 850.
Code: Select all
for /f "tokens=2 delims=:" %%i in ('chcp') do set /a "oemcp=%%~ni"
aGerman wrote:I don't want to speak for Dave. So the following is just my opinion.
You asked Dave if you can use/post his code on your website. You copied the code and uploaded it externally. This is the first point where you failed. Nobody but you can update this upload. Don't expect you get informed whenever Dave updates his code here at DosTips. So from my point of view it would have been much better to post a link to this thread instead. Also even that you told the people who developed the code you didn't tell them where to get help. Of course they will ask you if they get problems now. And of course, you have to answer. Are you really trying to force Dave being responsible to answer in any forum or on any website his code might be copied or linked?
Just my 2 cents ...
Steffen
dbenham wrote:I suspect he is using a machine configured for a multi-byte character set, which JREPL does not support (unfortunately). I'll leave it up to you to follow up with him. Ask him what active code page he is using (execute CHCP from the command line and report the result). Then look up that code value to determine if it is multi-byte.
Dave Benham
If you can't stop thinking about it, never stop working for it.