Garbled (2)

zhaozj2021-02-08  276

2. xxencode

It is not possible that UUENCODE does not mention XXencode, XxEncode's encoding algorithm and uuencode basically, but uses different character sets. The characters used by Xxencode encoding are:

" 0123456789abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz" Compared with UUENCODE, its special characters are less. Many tools that support UUENCODE codec are simultaneously supporting XXencode.

This feature of this coding is that each line starts with the "H" flag. Here is an example of xxencode:

Begin 644 mogao.txt

H0EY760 U684QKH90UWJXHUWOWWFCPQB0UBLXXLTCAPJNQ3JCUMKPXH4IWou

HPXKYCUVONKLINLINLINLINLU9MWMA16IAH2M9X6K9X2NAXCMAUCDGWBIGO4X1EC760 U

H60 UL8ESRWXHJDUTDBTRMH8XIAVOR5 U9MXHPQRVPMTWNKTOOLJI9ATZR O8

H0EY7FKPVOKLOPNDHPQRVPO NBN2IPAJO1EC760 U8WCE8WCE8WCE8WCE8WCE

H8WCE8WCE8WCE8WCE8WCE8WCE8WCE8WCE8WCE8WCE60 U60 U60 U60 U60 U

H1EC760 U8W0NZQ59Jatgtaemkvgqj98vhdxlrucgggzr-mxtxj8d8ggcohfmm

Hiw5onw6e1ec760 u8Wce8Wce8Wce8Wce8Wce8Wce8Wce8Wce8Wce8Wce8Wce

A8WCE8WCE8WCE8WCE

end

You can separate it into a file: Mogao.xxe, then open with Winzip, decompress Mogao.txt.

The encoding algorithm of xxencode and UUENCODE are basically the same, and it is more simple to implement, it will not be detailed here.

The C language description for xxencode encoding and decoding is given below:

/ * Xxencode encoding * /

Void xxe (unsigned char chasc [3], unsigned char chxxe [4])

/ *

CHASC: Uncoded binary code

CHXXE: Coded XXE code

* /

{INT I;

Static char set [] =

" 0123456789abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz";

CHXXE [0] = CHASC [0] >> 2;

CHXXE [1] = (chasc [0] << 4) & 48 | (Chasc [1] >> 4) & 15;

CHXXE [2] = (ChaSC [1] << 2) & 60 | (Chasc [2] >> 6) & 3;

CHXXE [3] = Chasc [2] & 63;

For (i = 0; i <4; i ) chxxe [i] = set [chxxe [i]]; / * Chart * /

}

/ * Try to note, the first letter of each line in the text section of the xxencode file is: After the ASCII value of the number of characters actually read in the source file, it is obtained after the SET [] checksum. * /

/ * Xxencode decoding * /

Unsigned char set / * Chart Function * / {IF (CH == 43) CH = 0;

ELSE IF (CH == 45) CH = 1;

ELSE IF (CH> = 48 && Ch <= 57) CH- = 46;

ELSE IF (CH> = 65 && Ch <= 90) CH- = 53;

ELSE IF (CH> = 97 && Ch <= 122) CH- = 59;

Return ch;

}

Void unxxe (unsigned char chxxe [4], unsigned char chasc [3])

/ *

CHXXE: Unresolved XXE code

CHASC: Decoded binary code

* /

{INT K = 2, I;

UNSIGNED CHAR T;

T = NULL;

* chxxe = set (* chxxe);

For (i = 0; i <3; i )

{* (CHXXE 1) = set (* (chXXE i 1));

(ChHEX I) = * (CHXXE I) << k;

K = 2;

T = * (CHXXE I 1) >> 8-K;

* (ChHEX I) | = T;

}

}

转载请注明原文地址:https://www.9cbs.com/read-1243.html

New Post(0)