Want to learn how to encrypt batch file with ACII coding....

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
derek.hansen
Posts: 3
Joined: 21 Oct 2010 16:56

Want to learn how to encrypt batch file with ACII coding....

#1 Post by derek.hansen » 21 Oct 2010 18:22

ok so I just found out about ascii coding and I kind of get it but not really...this is from aGerman jsut copied and pasted it but don't really get exactly how it works at all.....



set /a n=0
:loop
set "hex=!encrypted:~%n%,2!"
if "%hex%"=="" goto exitLoop
set "hex=%hex:~-1%%hex:~,1%"
set /a dec=0x%hex%
cmd /c exit %dec%
set "string=%=exitcodeascii%%string%"
set /a n+=2
goto :loop

:exitLoop
echo\!string!
pause>nul

wondering if someone could explain it to me in lamence terms...

ghostmachine4
Posts: 319
Joined: 12 May 2006 01:13

Re: Want to learn how to encrypt batch file with ACII coding

#2 Post by ghostmachine4 » 21 Oct 2010 20:03

derek.hansen wrote:ok so I just found out about ascii coding and I kind of get it but not really...this is from aGerman jsut copied and pasted it but don't really get exactly how it works at all.....



set /a n=0
:loop
set "hex=!encrypted:~%n%,2!"
if "%hex%"=="" goto exitLoop
set "hex=%hex:~-1%%hex:~,1%"
set /a dec=0x%hex%
cmd /c exit %dec%
set "string=%=exitcodeascii%%string%"
set /a n+=2
goto :loop

:exitLoop
echo\!string!
pause>nul

wondering if someone could explain it to me in lamence terms...


don't fret yourself with ugly and unreadable batch code. If you can, download and use a programming language, such as Python/Perl etc.. If not, you can use native vbscript. To get a Hex number,

Code: Select all

MyHex = Hex(459)
Wscript.Echo MyHex

To get ascii character

Code: Select all

MyChar = Chr(65) 'returns A


To get Ascii code of a character

Code: Select all

MyNumber = Asc("A") 'returns 65


simple as that.

Post Reply