problem with @YENCODE

Aug 2, 2011
258
4
Berlin, Germany
I want to see what @yencode is doing, but it doesn't work for me.
What am I doing wrong?
Code:
F:\Temp >ver /r

TCC  14.00.30 x64   Windows 7 [Version 6.1.7601]
TCC Build 30   Windows 7 Build 7601  Service Pack 1
Registered to ...
 
F:\Temp >echo %@hexENcode[s,Password]
50617373776f7264

F:\Temp >echo %@hexDEcode[s,50617373776f7264]
Password

F:\Temp >echo %@yencode[s,50617373776f7264]
TCC: No closing quote
 

rconn

Administrator
Staff member
May 14, 2008
11,421
108
I want to see what @yencode is doing, but it doesn't work for me.
What am I doing wrong?
WAD -- what you're doing wrong is using ECHO to display the output.

@YENCODE is returning this result:

=ybegin line=128 size=16_Z`[a]a]aa`a\`^=yend size=16 crc32=aa2aedda

That is passed as an argument to ECHO, the parser sees that there is a mismatch on the number of backquotes in the line, and it displays the "no closing quote" error message.
 
Aug 2, 2011
258
4
Berlin, Germany
WAD -- what you're doing wrong is using ECHO to display the output.

@YENCODE is returning this result:

=ybegin line=128 size=16_Z`[a]a]aa`a\`^=yend size=16 crc32=aa2aedda

That is passed as an argument to ECHO, the parser sees that there is a mismatch on the number of backquotes in the line, and it displays the "no closing quote" error message.
Ok, that's evident.
But what can I do with this function at all, if the result string is so unhandily?
The only method I can imagine is a "here redirection".
 

rconn

Administrator
Staff member
May 14, 2008
11,421
108
Ok, that's evident.
But what can I do with this function at all, if the result string is so unhandily?
The only method I can imagine is a "here redirection".
I can't imagine why you would ever want to use @YENCODE to echo something to the display. Normally you would write the output to a file; if you need to put it in a string/environment variable you would normally assign it and then use that variable directly. If you feel compelled to write dubious output to the display, use the SAFECHARS plugin.
 
Aug 2, 2011
258
4
Berlin, Germany
I had the vision to obfuscate passwords with it (my colleague allways says "if you have visions, got to a doctor" :)) .
And I thought I can try back and forth like with @hex en/de code.
Never mind.
 
May 31, 2008
382
2
Example with the SAFECHARS plugin (below * stands for a safe-encoded character)
Code:
C:\temp>echo %@SAFEEXP[@yencode[s,50617373776f7264]]
=ybegin line=128 size=16
_Z**a*a*aa*a\**
=yend size=16 crc32=aa2aedda
 
C:\temp>SAFEECHO %@SAFEEXP[@yencode[s,50617373776f7264]] >uuu
 
C:\temp>type uuu
=ybegin line=128 size=16
_Z`[a]a]aa`a\`^
=yend size=16 crc32=aa2aedda