Although .bat files are convenient to use, their security is too weak. Anyone can open them to view or even modify the content. Is there a way to keep the file as a .bat without converting it to .exe, .com, or other formats, while preventing others from viewing and modifying its content? Is there any self-encryption method available? Experts, please provide a solution思路.
───────────────── Moderator's Note ─────────────────
The currently discussed solutions are as follows:
1. Inserting Unicode feature strings into batch code (Floor 7, yuanyong630)
Related discussions can be found on Floors 24, 25, 45, 48, etc.
Download link for the code implementation (Floor 27, pengfei):
Click to download: BAT Encryption Tool.rar
Effective for programs that use the IsTextUnicode function to identify encoding types, such as Notepad.
Ineffective for programs that do not use the IsTextUnicode function, such as type/edit/EditPlus/UltraEdit.
2. Adding a Unicode Byte Order Mark (BOM) to the header of batch code (Floor 40, zxcv)
Related discussions can be found on Floors 41, 43, 69, etc.
Download link for the code implementation (Floor 71, zxcv):
EncryBat.rar (zxcv)
Effective for programs that support Unicode encoding, such as Notepad, Word, UltraEdit, and type.
Ineffective for programs that do not support Unicode encoding, such as edit and WinRAR internal viewer.
3. Replacing carriage return-line feed characters in batch code with carriage return characters (Floor 17, electronixtar)
Related discussions can be found on Floor 26.
Effective for editors that separately recognize carriage return-line feed characters, such as edit.
4. Dictionary-based conversion of batch code (Floor 11, 3742668)
Related discussions and code implementations can be found on Floors 11 and 15.
The code is dynamically generated during plaintext execution, so this solution is independent of the editor.
Points Reward:
yuanyong630, 3742668, pengfei, and zxcv will each receive 8 points.
electronixtar will receive 4 points.
───────────────── Moderator's Note ─────────────────
[ Last edited by willsort on 2006-8-6 at 04:02 ]
───────────────── Moderator's Note ─────────────────
The currently discussed solutions are as follows:
1. Inserting Unicode feature strings into batch code (Floor 7, yuanyong630)
Related discussions can be found on Floors 24, 25, 45, 48, etc.
Download link for the code implementation (Floor 27, pengfei):
Click to download: BAT Encryption Tool.rar
Effective for programs that use the IsTextUnicode function to identify encoding types, such as Notepad.
Ineffective for programs that do not use the IsTextUnicode function, such as type/edit/EditPlus/UltraEdit.
2. Adding a Unicode Byte Order Mark (BOM) to the header of batch code (Floor 40, zxcv)
Related discussions can be found on Floors 41, 43, 69, etc.
Download link for the code implementation (Floor 71, zxcv):
EncryBat.rar (zxcv)
Effective for programs that support Unicode encoding, such as Notepad, Word, UltraEdit, and type.
Ineffective for programs that do not support Unicode encoding, such as edit and WinRAR internal viewer.
3. Replacing carriage return-line feed characters in batch code with carriage return characters (Floor 17, electronixtar)
Related discussions can be found on Floor 26.
Effective for editors that separately recognize carriage return-line feed characters, such as edit.
4. Dictionary-based conversion of batch code (Floor 11, 3742668)
Related discussions and code implementations can be found on Floors 11 and 15.
The code is dynamically generated during plaintext execution, so this solution is independent of the editor.
Points Reward:
yuanyong630, 3742668, pengfei, and zxcv will each receive 8 points.
electronixtar will receive 4 points.
───────────────── Moderator's Note ─────────────────
[ Last edited by willsort on 2006-8-6 at 04:02 ]

DigestI