unit CustomBase85; // uses 85 ascii characters which are better to use in XML ( no &'<"\> chars and no space char = more efficient ) // // Base85ToBin doesn't support white spaces and line breaks (HexToBin doesn't support it too) // implementation by mgr.inz.Player http://forum.cheatengine.org/viewtopic.php?t=560886 and http://pastebin.com/EUfGFpZ9 {$mode delphi} interface uses Classes; procedure BinToBase85(BinValue, outputStringBase85: PChar; BinBufSize: integer); // // example: // getmem(outputstring, (BinarySize div 4) * 5 + 5 ); // BinToBase85(b,outputstring,BinarySize); // // it adds a 0 terminator to outputstring function Base85ToBin(inputStringBase85, BinValue: PChar): integer; // // example: // size:=length(inputstring); // if (size mod 5) > 1 then // BinarySize:= (size div 5) * 4 + (size mod 5) - 1 // else // BinarySize:= (size div 5) * 4; // getmem(b, BinarySize); // Base85ToBin(inputstring, b); // // Base85ToBin doesn't support: white space between the characters, line breaks. (HexToBin doesn't support it too) // Base85ToBin doesn't check for data corruption. implementation const customBase85='0123456789'+ 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'+ 'abcdefghijklmnopqrstuvwxyz'+ '!#$%()*+,-./:;=?@[]^_{}'; procedure BinToBase85(BinValue, outputStringBase85: PChar; BinBufSize: integer); var i : integer; a : dword; begin i:=0; while i