BAT Encryption Tool encrybat non-compiled BAT batch processing encryption scheme and code _dos/bat

Source: Internet
Author: User
Tags rar ultraedit
BAT files are easy to use, but security is too fragile
Anyone can open the view or even modify the contents
Is there any way to convert. bat to. exe or. com, and so on, still. bat files
But others can't view and modify the contents of it???
Is there any kind of self encryption or something?
Master to a solution to the idea of it
The programmes currently under discussion are as follows:
1. A scheme for inserting a Unicode feature string in batch code
Valid for programs such as Notepad that use the Istextunicode function to recognize the encoding type
Not valid for Type/edit/editplus/ultraedit, etc. programs that do not use the Istextunicode function

2, to the batch code head to increase the Unicode byte order mark (BOM) scheme
Encrybat.rar (ZXCV)

Valid for programs that support Unicode encoding, such as Notepad, Word, UltraEdit, type, and so on
Invalid for non-Unicode encoded programs such as Edit/winrar internal viewer

3. Replace the return line of the batch code with the return character scheme

An editor that recognizes the return line feed character, such as edit, is valid

4. A dictionary conversion scheme for batch code
The code is dynamically generated when it is run, so the schema has nothing to do with the editor;
BAT file encryption (more than bat2com that software < because the software does not support Chinese >)
The method is:
Open Notepad to write the beginning of the file to the following statement
Copy Code code as follows:

for /l %%a in  (1,1,10)  do ren *.jpg %%a %%a %%a %%a  %%a %%a %%a %%a %%a %%a %%a %%a %%a %%a %%a %%a  %%a %%a %%a %%a %%a %%a %%a %%a %%a %%a %%a %%a  %%a %%a %%a %%a %%a %%a %%a %%a %%a %%a %%a %%a  %%a %%a %%a %%a %%a %%a %%a %%a %%a %%a %%a %%a  %%a %%a %%a %%a %%a %%a %%a %%a %%a %%a %%a %%a  %%a %%a %%a %%a %%a %%a %%a %%a %%a %%a %%a %%a  %%a %%a %%a %%a %%a %%a %%a %%a %%a %%a %%a %%a  %%a %%a %%a %%a %%a %%a %%a %%a %%a %%a %%a %%a  %%a %%a %%a&nbSp;%%a %%a %%a %%a %%a %%a %%a %%a %%a %%a %%a %%a  %%a %%a %%a %%a %%a %%a %%a %%a %%a %%a %%a %%a  %%a %%a %%a %%a %%a %%a %%a %%a %%a %%a %%a %%a  %%a %%a %%a %%a %%a %%a %%a %%a %%a %%a %%a %%a  %%a %%a %%a %%a %%a %%a %%a %%a %%a %%a %%a %%a  %%a %%a %%a %%a %%a %%a %%a %%a %%a %%a %%a %%a  %%a %%a %%a %%a %%a %%a %%a %%a %%a %%a %%a %%a  %%a %%a %%a %%a %%a %%a %%a %%a %%a %%a %%a %%a  %%a %%a %%a %%a %%a %%a %%a %%a %%a %%a %%a %%a  %%a %%a %%a %%a %%a %%a %%a %%a %%a %%a %%a %%a %%a %%a %%a  %%a %%a %%a %%a %%a %%a %%a %%a %%a %%a %%a %%a %% A %%a %%a %%a %%a %%a %%a %%a %%a %%a %%a %%a %%a  %%a %%a %%a %%a %%a %%a %%a %%a %%a %%a %%a %%a  %%a %%a %%a %%a %%a %%a %%a %%a %%a %%a %%a %%a  %%a %%a %%a %%a %%a %%a %%a %%a %%a %%a %%a %%a  %%a %%a %%a %%a %%a %%a %%a %%a %%a %%a %%a %%a  %%a %%a %%a %%a %%a %%a %%a %%a %%a %%a %%a %%a  %%a %%a 

When the Notepad program saves a new document, the default ANSI type is used if no encoding type is specified (for the Chinese version, the corresponding GB code).

When you open a document that you have created, it analyzes the encoding type of the document, which first determines whether there is a BOM in the header of the document (byte mark, byte order mark, 2~3 byte), and if so, the encoding type is judged by its contents, FF, Fe (Unicode), Fe, FF (Unicode big endian), EF, BB, BF (UTF-8) [1].

Because many non-ANSI-encoded documents are in fact "plain text" without any BOM, these documents cannot be easily judged to be ANSI-encoded. It is necessary to use a series of statistical algorithms to guess the document encoding based on the content of the document. Notepad uses the Istextunicode function to determine whether to encode unicode/unicode big endian, and to use IsTextUTF8 to determine if it is a UTF8 encoding.

But since it is a statistical algorithm, it is inevitable that there is a miscalculation, especially in the document content is too short, because the size of the sample is too small, the probability of this miscalculation will increase significantly. For example, the famous Microsoft and Unicom have a bad joke, is notepad in the open only "Unicom" of the ANSI code document, the ISTEXTUTF8 function will be mistaken for the UTF8 code [2]; the same miscalculation also takes place on the Istextunicode function, such as "this app Can break "This document with a 4335 structure is misjudged as Unicode encoding [3][4].

It should be explained that the possibility of this miscalculation is based on the short text and the premise that its byte bit feature is not disturbed. If you make a slight modification to the text above (even if you just add a carriage return), it is difficult to misjudge.

The special feature of the yuanyong630 scheme is that its byte string is not only Unicode, but also has a length of 1288 bytes, which means its Unicode features are strong, so it can resist some of the shorter interference without the Unicode feature string, This is determined by the law of Statistics. However, when the interference string is slightly longer, the characteristics of Unicode will be significantly disturbed until the Istextunicode function is identified as non-Unicode. Therefore, some friends are always unable to test success, should be associated with the additional batch code length and content. You can test the code in [5].

Because other editors (such as Word/wordpad/editplus/ultraedit) use the updated coding type judgment algorithm, the Unicode judgment has improved a lot, and UTF8 's judgment is still unsatisfactory. But because the algorithm does not exist theoretically exactly, we can only rely on avoiding non-ANSI documents without a BOM, or manually specifying the encoding type when opening the document.

In addition, if you use Notepad to save files that have misjudged the type of encoding, you will find it difficult to recover. If you use a misjudged encoding to save, the original document will be added with a BOM mark, and the original document can no longer be observed using another editor. If you save with ANSI encoding, the original document will be converted as a Unicode document, and the possibility of the restore is close to zero.

[1] Introduction to Unicode
http://my.opera.com/neutronstar/blog/index.dml/tag/Code

[2] Why Microsoft has a grudge against China Unicom
Http://blog.vckbase.com/localvar/archive/2005/07/12/9510.aspx

[3] Notepad bug? Encoding issue?
Http://weblogs.asp.net/cumpsd/archive/2004/02/27/81098.aspx

[4] Bush Hid the Facts
Http://www.shoutwire.com/comments/16341/Bush_Hid_The_Facts

[5] Cry.cmd
For a method that changes 0d 0a to 0a, change it to 0d. When you change the carriage return line to only enter the line, the text of the current line is overwritten by lines of text that do not wrap, overwriting the overlay repeatedly. If you add a comment text with a length greater than all of the rows on the last line of the batch, you will end up showing only such comments.

Such a method, which is valid for edit and type, was once popular in the DOS era. However, this scheme is similar to that of Brother Yuanyong630, but only specific text processing mechanisms for specific text processors are not applicable to all platform environments.

As for other encryption methods, there are also shortcomings, to meet the requirements of software engineering is more difficult.
BAT encryption tool. RAR Encrybat.rar

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.