Sorry for the mess of chars in this questing. In my script I compress and XOR the data like this
buff2 = Deflate.deflate(buff)
buff3 = ''
buff2.each_char do |c|
buff3 << (c.chr.ord ^ 0xFF)
end
After decompressing the string it looks like this
x��=�0 @�=��<38�k7l�v�Х?H�!��rwZ����p ��8#��;�ZDS)}0�b��J�s�qz>����� ĿD��+"���]��I8dS2����ۿ�e_���~���
After XORing
câ4Âñ=Ïó¿ÂXwÃÌÇNÈw/ZÀ·sÞñhW¥YHCßöÇÜ{jÄ¥»¬àÖÏz} Áé@rùß;@»^+ÔåÝùrR¢V~¶Ç¬ÍD0 $@Y ^FâW
However when I try to reverse the XOR (in the same way) the string does look similar but it's missing the � that string looks like this
²xË=Â0 @á=§<38±k7lvèÐ¥?H!¨rwZ¦·¼ïp îþ8#;åZDS)}0 bÉJÆsqz>¿ëíæ Ä¿D¡Ô+"ú]©I8dS2»ä°ÏóÛ¿¦e_¡¹æ~àè¨
I tried to inflate it with zlib and it fails with incorrect header check (Zlib::DataError)
What am I doing to change the �s into actual strings?