Пример #1
0
        public byte[] Export(string[] Strings)
        {
            byte[] BaseScript;
            if (Edited)
            {
                BaseScript = GetRange(0, SignaturePos);
            }
            else
            {
                BaseScript = GetRange(0, (uint)Script.LongLength);
            }

            List <byte> AppendBuffer = new List <byte>(Signature);


            for (int i = 0; i < PushPos.Count; i++)
            {
                uint   PIndex = PushPos[i];
                uint   RPos   = RetPos[i];
                byte[] Losted = LostData[i];

                uint Len = RPos - PIndex;
                for (uint x = 0; x < Len; x++)
                {
                    BaseScript[x + PIndex] = 0x00;
                }

                uint ProxyPos = (uint)(BaseScript.Length + AppendBuffer.Count);

                byte[] ToProxyJmp = BuildJmp(ProxyPos);
                ToProxyJmp.CopyTo(BaseScript, PIndex);

                AppendBuffer.AddRange(BuildString(Strings[i]));
                AppendBuffer.AddRange(Losted);
                AppendBuffer.AddRange(BuildJmp(RPos));
            }

            return(BaseScript.Concat(AppendBuffer).ToArray());
        }