Example #1
0
        ///////////////////////////////////////////////////////////////////////////////////////////
        /// <summary>Find the offset with in the Prime Time executable of the custom pic
        /// data.</summary>
        /// <param name="exePath">The full path to the Prime Time executable</param>
        /// <returns>The offset to the key or 0 on error</returns>
        ///////////////////////////////////////////////////////////////////////////////////////////
        public static PTCustomizeUtil.MacOffset FindMacCustomPicMsgOffset(string exePath)
        {
            PTCustomizeUtil.MacOffset retOffset = new PTCustomizeUtil.MacOffset();

            try
            {
                PTExeDiscovery.CharByteOrder = PTCustomizeUtil.CharacterByteOrder.LittleEndian;
                PTExeDiscovery.WcharSize     = 4;

                retOffset.PPC = FindMsgDataOffset(exePath, CUSTOM_PIC_MSG_PREFIX, 0);

                PTExeDiscovery.CharByteOrder = PTCustomizeUtil.CharacterByteOrder.BigEndian;
                retOffset.x86 = FindMsgDataOffset(exePath, CUSTOM_PIC_MSG_PREFIX, 0);

                retOffset.x64 = FindMsgDataOffset(exePath, CUSTOM_PIC_MSG_PREFIX, retOffset.x86 + 10);
            }
            finally
            {
                // Go back to PC values
                PTExeDiscovery.CharByteOrder = PTCustomizeUtil.CharacterByteOrder.BigEndian;
                PTExeDiscovery.WcharSize     = 2;
            }

            return(retOffset);
        }
Example #2
0
 ///////////////////////////////////////////////////////////////////////////////////////////
 /// <summary>Find the offset with in the Prime Time executable of the key value.</summary>
 /// <param name="exePath">The full path to the Prime Time executable</param>
 /// <returns>The offset to the key or 0 on error</returns>
 ///////////////////////////////////////////////////////////////////////////////////////////
 public static PTCustomizeUtil.FullKeyOffset FindMacPPCKeyOffset(string exePath)
 {
     try
     {
         PTExeDiscovery.CharByteOrder = PTCustomizeUtil.CharacterByteOrder.LittleEndian;
         return(FindKeyOffset(exePath, 0));
     }
     catch
     {
         throw;
     }
     finally
     {
         PTExeDiscovery.CharByteOrder = PTCustomizeUtil.CharacterByteOrder.BigEndian;
     }
 }
Example #3
0
        ///////////////////////////////////////////////////////////////////////////////////////////
        /// <summary>Find a the offset within the evaluation EXE file of the expiration date year.
        /// The year is 2 bytes, followed by the month, then day, all 2 bytes.</summary>
        /// <param name="exePath">The path of the Prime Time executable</param>
        /// <returns>The offset in bytes of the message data or 0 if the offset could not be
        /// found </returns>
        ///////////////////////////////////////////////////////////////////////////////////////////
        public static PTCustomizeUtil.MacOffset FindMacEvalExpirationDateOffset(string exePath)
        {
            PTCustomizeUtil.MacOffset retOffsets = new PTCustomizeUtil.MacOffset();

            try
            {
                PTExeDiscovery.CharByteOrder = PTCustomizeUtil.CharacterByteOrder.LittleEndian;

                retOffsets.PPC = FindMsgDataOffset(exePath, EVAL_EXPIRATION_DATE_PREFIX, 0);

                // If we found the offset, then step passed the data prefix
                if (retOffsets.PPC > 0)
                {
                    retOffsets.PPC += 4 * WcharSize;
                }

                PTExeDiscovery.CharByteOrder = PTCustomizeUtil.CharacterByteOrder.BigEndian;

                retOffsets.x86 = FindMsgDataOffset(exePath, EVAL_EXPIRATION_DATE_PREFIX, 0);
                if (retOffsets.x86 > 0)
                {
                    retOffsets.x86 += 4 * WcharSize;
                }

                retOffsets.x64 = FindMsgDataOffset(exePath, EVAL_EXPIRATION_DATE_PREFIX, retOffsets.x86 + 10);
                if (retOffsets.x64 > 0)
                {
                    retOffsets.x64 += 4 * WcharSize;
                }
            }
            finally
            {
                PTExeDiscovery.CharByteOrder = PTCustomizeUtil.CharacterByteOrder.BigEndian;
                PTExeDiscovery.WcharSize     = 2;
            }

            return(retOffsets);
        }