public byte[] getPacketHeader(int length)
        {
            int iiv = (iv[3]) & 0xFF;

            iiv |= (iv[2] << 8) & 0xFF00;
            iiv ^= mapleVersion;
            int mlength = ((length << 8) & 0xFF00) | BitTools.MoveByte(length, 8);
            int xoredIv = iiv ^ mlength;

            byte[] ret = new byte[4];
            ret[0] = (byte)(BitTools.MoveByte(iiv, 8) & 0xFF);
            ret[1] = (byte)(iiv & 0xFF);
            ret[2] = (byte)(BitTools.MoveByte(xoredIv, 8) & 0xFF);
            ret[3] = (byte)(xoredIv & 0xFF);
            return(ret);
        }
        private static byte[] funnyShit(byte inputByte, byte[] newIn)
        {
            byte elina  = newIn[1];
            byte anna   = inputByte;
            byte moritz = funnyBytes[elina & 0xFF];

            moritz   -= inputByte;
            newIn[0] += moritz;
            moritz    = newIn[2];
            moritz   ^= funnyBytes[anna & 0xFF];
            elina    -= (byte)(moritz & 0xFF);
            newIn[1]  = elina;
            elina     = newIn[3];
            moritz    = elina;
            elina    -= (byte)(newIn[0] & 0xFF);
            moritz    = funnyBytes[moritz & 0xFF];
            moritz   += inputByte;
            moritz   ^= newIn[2];
            newIn[2]  = moritz;
            elina    += (byte)(funnyBytes[anna & 0xFF] & 0xFF);
            newIn[3]  = elina;

            long merry = (newIn[0]) & 0xFF;

            merry |= Convert.ToInt64((newIn[1] << 8) & 0xFF00);
            merry |= Convert.ToInt64((newIn[2] << 16) & 0xFF0000);
            merry |= (newIn[3] << 24) & 0xFF000000;
            long ret_value = merry;

            ret_value = BitTools.MoveByte(ret_value, 0x1D);
            merry     = merry << 3;
            ret_value = ret_value | merry;

            newIn[0] = (byte)(ret_value & 0xFF);
            newIn[1] = (byte)((ret_value >> 8) & 0xFF);
            newIn[2] = (byte)((ret_value >> 16) & 0xFF);
            newIn[3] = (byte)((ret_value >> 24) & 0xFF);
            return(newIn);
        }