/* Initialization / Teardown */
 public ShadowRpc(Process process, Settings settings)
 {
     _settings  = settings;
     _dolphin   = new Memory.Access.Dolphin(process);
     _shadow    = new Shadow.Shadow(_dolphin);
     _rpcClient = new DiscordRpcClient("493507183749627907"); // It's not like you could just extract this using a decompiler. Obfuscation? Screw that!
     _rpcClient.Initialize();
     _timer = new System.Threading.Timer(Tick, null, new TimeSpan(0), new TimeSpan(0, 0, 0, 5));
 }
Example #2
0
        /*
         *  ------------
         *  Construction
         *  ------------
         */

        public Shadow(Memory.Access.Dolphin dolphin)
        {
            _dolphin = dolphin;
            var currentProcess = Reloaded.Memory.Sources.Memory.CurrentProcess;

            StageId            = new DolphinPointer <StageID>(0x805EF958, _dolphin, currentProcess);
            MenuState          = new DolphinPointer <MenuState>(0x80583ACC, _dolphin, currentProcess);
            CurrentMode        = new DolphinPointer <Modes>(0x805EC170, _dolphin, currentProcess);
            CurrentMission     = new DolphinPointer <CurrentMission>(0x80575F1F, _dolphin, currentProcess);
            IsWatchingCutscene = new DolphinPointer <byte>(0x8057FA85, _dolphin, currentProcess);
            IsGameplayFrozen   = new DolphinPointer <byte>(0x8057D768, _dolphin, currentProcess);
            StageTimer         = new DolphinPointer <float>(0x8057D734, _dolphin, currentProcess);
        }
        /*
         *  ------------
         *  Constructors
         *  ------------
         */

        /// <summary>
        /// Constructs a new instance of <see cref="Pointer{T}"/> given the address (pointer)
        /// in emulated memory at which the value of type <typeparamref name="TPrimitive"/> is stored.
        /// </summary>
        /// <param name="address">The address of the pointer pointing to generic type {T}</param>
        /// <param name="dolphin">Instance of Dolphin Memory Access library.</param>
        /// <param name="memorySource">Specifies the source from which the pointer should be read/written.</param>
        public DolphinPointer(ulong address, Memory.Access.Dolphin dolphin, IMemory memorySource = null)
        {
            Address  = (void *)address;
            _dolphin = dolphin;

            if (memorySource != null)
            {
                Source = memorySource;
            }
            else
            {
                Source = new Reloaded.Memory.Sources.Memory();
            }
        }