Created
October 24, 2021 22:38
-
-
Save cecio/f46da23fe9867e8c2a84780e57efa176 to your computer and use it in GitHub Desktop.
flareon8_Ch10_decrypt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
lookup = [ 90,132,6,69,174,203,232,243,87,254,166,61,94,65,8,208,51, | |
34,33,129,32,221,0,160,35,175,113,4,139,245,24,29,225,15, | |
101,9,206,66,120,62,195,55,202,143,100,50,224,172,222,145, | |
124,42,192,7,244,149,159,64,83,229,103,182,122,82,78,63,131, | |
75,201,130,114,46,118,28,241,30,204,183,215,199,138,16,121,26, | |
77,25,53,22,125,67,43,205,134,171,68,146,212,14,152,20,185, | |
155,167,36,27,60,226,58,211,240,253,79,119,209,163,12,72,128, | |
106,218,189,216,71,91,250,150,11,236,207,73,217,17,127,177,39, | |
231,197,178,99,230,40,54,179,93,251,220,168,112,37,246,176,156, | |
165,95,184,57,228,133,169,252,19,2,81,48,242,105,255,116,191,89, | |
181,70,23,194,88,97,153,235,164,158,137,238,108,239,162,144,115, | |
140,84,188,109,219,44,214,227,161,141,80,247,52,213,249,1,123,142, | |
190,104,107,85,157,45,237,47,147,21,31,196,136,170,248,13,92,234,86, | |
3,193,154,56,5,111,98,74,18,223,96,148,41,117,126,173,233,10,49,180, | |
187,186,135,59,38,210,110,102,200,76,151,198 ] | |
key = [ 0x61, 0xce, 0x31, 0xa0, 0x6d, 0xa6, 0x5f, 0x97, | |
0x6f, 0x92, 0x31, 0x9a, 0x73, 0xa0, 0x68, 0xcb, | |
0x74, 0xcc, 0x5f, 0x9d, 0x34, 0x8d, 0x64, 0x8c | |
] | |
infile = open('outfile.png','rb') | |
outfile = open('meme.png','wb') | |
i = 0 | |
while True: | |
ch = infile.read(1) | |
if not ch: | |
break | |
ch = int.from_bytes(ch,'little') | |
ch = ch ^ 0xFF | |
if ch > 127: | |
ch = ch ^ 0x42 | |
ch = lookup.index(ch) | |
ch = ch ^ key[i % 24] | |
ch = lookup.index(ch) | |
outfile.write(ch.to_bytes(1,'little')) | |
i = i + 1 | |
outfile.close() | |
infile.close() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment