diff --git a/Artemis/Artemis/App.config b/Artemis/Artemis/App.config index 7a342616a..62b94b3c1 100644 --- a/Artemis/Artemis/App.config +++ b/Artemis/Artemis/App.config @@ -1,67 +1,40 @@  - - -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
- + + + + True + + + Default + + Demo (Duplicate to keep changes) @@ -338,4 +311,4 @@ - \ No newline at end of file + diff --git a/Artemis/Artemis/Artemis.csproj b/Artemis/Artemis/Artemis.csproj index 96489d3c6..89b315bfd 100644 --- a/Artemis/Artemis/Artemis.csproj +++ b/Artemis/Artemis/Artemis.csproj @@ -9,7 +9,7 @@ Properties Artemis Artemis - v4.5.2 + v4.6.1 512 {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} 4 @@ -39,11 +39,12 @@ Artemis Artemis 1 - 1.2.0.1 + 1.2.1.1 false true true true + x64 @@ -199,6 +200,10 @@ ..\packages\NLog.4.3.4\lib\net45\NLog.dll True + + False + D:\Downloads\Chome Downloads\Process.NET-master\Process.NET-master\src\Process.NET\bin\Release\Process.NET.dll + ..\packages\SpotifyAPI-NET.2.9.0\lib\SpotifyAPI.dll True @@ -306,6 +311,16 @@ + + True + True + WoW.settings + + + + + + @@ -482,11 +497,11 @@ + + - - @@ -600,6 +615,10 @@ Code + + SettingsSingleFileGenerator + WoW.Designer.cs + diff --git a/Artemis/Artemis/Managers/LoopManager.cs b/Artemis/Artemis/Managers/LoopManager.cs index 56a357077..a8f91935a 100644 --- a/Artemis/Artemis/Managers/LoopManager.cs +++ b/Artemis/Artemis/Managers/LoopManager.cs @@ -168,9 +168,16 @@ namespace Artemis.Managers public RenderFrame(KeyboardProvider keyboard) { KeyboardBitmap = keyboard.KeyboardBitmap(4); + KeyboardBitmap.SetResolution(96, 96); + MouseBitmap = new Bitmap(40, 40); + MouseBitmap.SetResolution(96, 96); + HeadsetBitmap = new Bitmap(40, 40); + HeadsetBitmap.SetResolution(96, 96); + GenericBitmap = new Bitmap(40, 40); + GenericBitmap.SetResolution(96, 96); using (var g = Graphics.FromImage(KeyboardBitmap)) g.Clear(Color.Black); diff --git a/Artemis/Artemis/Managers/MainManager.cs b/Artemis/Artemis/Managers/MainManager.cs index 8b732b637..3cef01e70 100644 --- a/Artemis/Artemis/Managers/MainManager.cs +++ b/Artemis/Artemis/Managers/MainManager.cs @@ -116,7 +116,7 @@ namespace Artemis.Managers if (!ProgramEnabled) return; - var runningProcesses = Process.GetProcesses(); + var runningProcesses = System.Diagnostics.Process.GetProcesses(); // If the currently active effect is a disabled game, get rid of it. if (EffectManager.ActiveEffect != null) diff --git a/Artemis/Artemis/Modules/Effects/TypeWave/TypeWave.Designer.cs b/Artemis/Artemis/Modules/Effects/TypeWave/TypeWave.Designer.cs index a40e4b8cd..6fda6a5f0 100644 --- a/Artemis/Artemis/Modules/Effects/TypeWave/TypeWave.Designer.cs +++ b/Artemis/Artemis/Modules/Effects/TypeWave/TypeWave.Designer.cs @@ -8,7 +8,7 @@ // //------------------------------------------------------------------------------ -namespace Artemis.Settings { +namespace Artemis.Modules.Effects.TypeWave { [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] diff --git a/Artemis/Artemis/Modules/Effects/TypeWave/TypeWaveSettings.cs b/Artemis/Artemis/Modules/Effects/TypeWave/TypeWaveSettings.cs index 2f8876e4e..66f3820bc 100644 --- a/Artemis/Artemis/Modules/Effects/TypeWave/TypeWaveSettings.cs +++ b/Artemis/Artemis/Modules/Effects/TypeWave/TypeWaveSettings.cs @@ -19,24 +19,24 @@ namespace Artemis.Modules.Effects.TypeWave public sealed override void Load() { - IsRandomColors = Settings.TypeWave.Default.IsRandomColors; - WaveColor = Settings.TypeWave.Default.WaveColor; - IsShiftColors = Settings.TypeWave.Default.IsShiftColors; - ShiftColorSpeed = Settings.TypeWave.Default.ShiftColorSpeed; - TimeToLive = Settings.TypeWave.Default.TimeToLive; - SpreadSpeed = Settings.TypeWave.Default.SpreadSpeed; + IsRandomColors = TypeWave.Default.IsRandomColors; + WaveColor = TypeWave.Default.WaveColor; + IsShiftColors = TypeWave.Default.IsShiftColors; + ShiftColorSpeed = TypeWave.Default.ShiftColorSpeed; + TimeToLive = TypeWave.Default.TimeToLive; + SpreadSpeed = TypeWave.Default.SpreadSpeed; } public sealed override void Save() { - Settings.TypeWave.Default.IsRandomColors = IsRandomColors; - Settings.TypeWave.Default.WaveColor = WaveColor; - Settings.TypeWave.Default.IsShiftColors = IsShiftColors; - Settings.TypeWave.Default.ShiftColorSpeed = ShiftColorSpeed; - Settings.TypeWave.Default.TimeToLive = TimeToLive; - Settings.TypeWave.Default.SpreadSpeed = SpreadSpeed; + TypeWave.Default.IsRandomColors = IsRandomColors; + TypeWave.Default.WaveColor = WaveColor; + TypeWave.Default.IsShiftColors = IsShiftColors; + TypeWave.Default.ShiftColorSpeed = ShiftColorSpeed; + TypeWave.Default.TimeToLive = TimeToLive; + TypeWave.Default.SpreadSpeed = SpreadSpeed; - Settings.TypeWave.Default.Save(); + TypeWave.Default.Save(); } public sealed override void ToDefault() diff --git a/Artemis/Artemis/Modules/Games/RocketLeague/RocketLeagueModel.cs b/Artemis/Artemis/Modules/Games/RocketLeague/RocketLeagueModel.cs index 9b7ad7f25..6895b0a34 100644 --- a/Artemis/Artemis/Modules/Games/RocketLeague/RocketLeagueModel.cs +++ b/Artemis/Artemis/Modules/Games/RocketLeague/RocketLeagueModel.cs @@ -81,15 +81,6 @@ namespace Artemis.Modules.Games.RocketLeague boostInt = 0; ((RocketLeagueDataModel) DataModel).Boost = boostInt; - - if (DateTime.Now.AddSeconds(-2) <= LastTrace) - return; - - MainManager.Logger.Trace("Offsets as JSON: \r\n{0}", - JsonConvert.SerializeObject(_pointer.GameAddresses, Formatting.Indented)); - MainManager.Logger.Trace("RL specific offsets: {0}", offsets); - MainManager.Logger.Trace("Boost address: {0}", boostAddress); - MainManager.Logger.Trace("Boost int: {0}", boostInt); } public override List GetRenderLayers(bool keyboardOnly) diff --git a/Artemis/Artemis/Modules/Games/Witcher3/Witcher3ViewModel.cs b/Artemis/Artemis/Modules/Games/Witcher3/Witcher3ViewModel.cs index adee38e81..0b6ba18fd 100644 --- a/Artemis/Artemis/Modules/Games/Witcher3/Witcher3ViewModel.cs +++ b/Artemis/Artemis/Modules/Games/Witcher3/Witcher3ViewModel.cs @@ -80,7 +80,7 @@ namespace Artemis.Modules.Games.Witcher3 archive.ExtractToDirectory(folder + @"witcher3-mod", true); - Process.Start(new ProcessStartInfo("https://github.com/SpoinkyNL/Artemis/wiki/The-Witcher-3")); + System.Diagnostics.Process.Start(new ProcessStartInfo("https://github.com/SpoinkyNL/Artemis/wiki/The-Witcher-3")); return; } } diff --git a/Artemis/Artemis/Modules/Games/WorldofWarcraft/WoW.Designer.cs b/Artemis/Artemis/Modules/Games/WorldofWarcraft/WoW.Designer.cs new file mode 100644 index 000000000..42350d4e9 --- /dev/null +++ b/Artemis/Artemis/Modules/Games/WorldofWarcraft/WoW.Designer.cs @@ -0,0 +1,50 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Artemis.Modules.Games.WorldofWarcraft { + + + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "14.0.0.0")] + internal sealed partial class WoW : global::System.Configuration.ApplicationSettingsBase { + + private static WoW defaultInstance = ((WoW)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new WoW()))); + + public static WoW Default { + get { + return defaultInstance; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("True")] + public bool Enabled { + get { + return ((bool)(this["Enabled"])); + } + set { + this["Enabled"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("Default")] + public string LastProfile { + get { + return ((string)(this["LastProfile"])); + } + set { + this["LastProfile"] = value; + } + } + } +} diff --git a/Artemis/Artemis/Modules/Games/WorldofWarcraft/WoW.settings b/Artemis/Artemis/Modules/Games/WorldofWarcraft/WoW.settings new file mode 100644 index 000000000..c2d66228b --- /dev/null +++ b/Artemis/Artemis/Modules/Games/WorldofWarcraft/WoW.settings @@ -0,0 +1,12 @@ + + + + + + True + + + Default + + + \ No newline at end of file diff --git a/Artemis/Artemis/Modules/Games/WorldofWarcraft/WoWAddresses.cs b/Artemis/Artemis/Modules/Games/WorldofWarcraft/WoWAddresses.cs new file mode 100644 index 000000000..5d600759d --- /dev/null +++ b/Artemis/Artemis/Modules/Games/WorldofWarcraft/WoWAddresses.cs @@ -0,0 +1,256 @@ +namespace Artemis.Modules.Games.WorldofWarcraft +{ + public static class WoWAddresses + { + public enum ActivateSettings + { + Activate_Offset = 0x34, + AutoDismount_Activate_Pointer = 0xe56850, + AutoInteract_Activate_Pointer = 0xe56848, + AutoLoot_Activate_Pointer = 0xe56868, + AutoSelfCast_Activate_Pointer = 0xe56874 + } + + public enum Battleground + { + MaxBattlegroundId = 0xec3fdc, + PvpExitWindow = 0xec4198, + StatPvp = 0xc3c03c + } + + public enum Chat + { + chatBufferPos = 0xeb1bf0, + chatBufferStart = 0xe58190, + msgFormatedChat = 0x65, + NextMessage = 0x17e8 + } + + public enum ClickToMove + { + CTM = 0xddf8f0, + CTM_PUSH = 0xddf8ac, + CTM_X = 0xddf918, + CTM_Y = 0xddf91c, + CTM_Z = 0xddf920 + } + + public enum CorpsePlayer + { + X = 0xe57894, + Y = 0xe57898, + Z = 0xe5789c + } + + public enum DBC + { + FactionTemplate = 0, + ItemClass = 0xd173c0, + ItemSubClass = 0, + Lock = 0, + Map = 0xd291a0, + QuestPOIPoint = 0xd1e950, + ResearchSite = 0xd1d2d0, + SpellCategories = 0, + Unknown = 0xf35428 + } + + public enum EventsListener + { + BaseEvents = 0xcb2474, + EventOffsetCount = 0x48, + EventOffsetName = 0x18, + EventsCount = 0xcb2470 + } + + public enum Fishing + { + BobberHasMoved = 0xf8 + } + + public enum FunctionWow + { + CGUnit_C__InitializeTrackingState = 0x30623b, + CGUnit_C__Interact = 0x524ff, + CGWorldFrame__Intersect = 0x5e46ab, + ClntObjMgrGetActivePlayerObj = 0x816d7, + FrameScript__GetLocalizedText = 0x300b48, + FrameScript_ExecuteBuffer = 0xa6772, + IsOutdoors = 0, + Spell_C_HandleTerrainClick = 0x2b76ff, + strlen = 0x74fcb0, + UnitCanAttack = 0, + WowClientDB2__GetRowPointer = 0x20c775 + } + + public enum GameInfo + { + AreaId = 0xc32c2c, + buildWoWVersionString = 0xd002a8, + gameState = 0xe56a49, + GetTime = 0xcb2150, + isLoading = 0xca59b0, + LastHardwareAction = 0xd0e090, + MapTextureId = 0xc3bd28, + SubAreaId = 0xc32c24, + subZoneMap = 0xe56a68, + TextBoxActivated = 0xbbe9ac, + zoneMap = 0xe56a64 + } + + public enum GameObject + { + CachedCastBarCaption = 12, + CachedData0 = 20, + CachedIconName = 8, + CachedName = 180, + CachedQuestItem1 = 0x9c, + CachedSize = 0x98, + DBCacheRow = 620, + GAMEOBJECT_FIELD_X = 0x138, + GAMEOBJECT_FIELD_Y = 0x13c, + GAMEOBJECT_FIELD_Z = 320, + PackedRotationQuaternion = 0x150, + TransformationMatrice = 0x278 + } + + public enum Hooking + { + DX_DEVICE = 0xcc523c, + DX_DEVICE_IDX = 0x2508, + ENDSCENE_IDX = 0xa8 + } + + public enum Login + { + realmName = 0xf35e16 + } + + public enum MovementFlagsOffsets + { + Offset1 = 0x124, + Offset2 = 0x40 + } + + public enum ObjectManager + { + continentId = 0x108, + firstObject = 0xd8, + localGuid = 0xf8, + nextObject = 0x44, + objectGUID = 0x30, + objectTYPE = 0x10 + } + + public class ObjectManagerClass + { + public static uint clientConnection; + public static uint sCurMgr; + } + + public enum Party + { + NumOfPlayers = 200, + NumOfPlayersSuBGroup = 0xcc, + PartyOffset = 0xeb5458, + PlayerGuid = 0x10 + } + + public enum PetBattle + { + IsInBattle = 0xba8a10 + } + + public enum Player + { + LocalPlayerSpellsOnCooldown = 0xd372b8, + petGUID = 0xec7158, + playerName = 0xf35e20, + RetrieveCorpseWindow = 0xe576f4, + RuneStartCooldown = 0xf18aa8, + SkillMaxValue = 0x400, + SkillValue = 0x200 + } + + public enum PlayerNameStore + { + PlayerNameNextOffset = 20, + PlayerNameStorePtr = 0xd0b4e0, + PlayerNameStringOffset = 0x11 + } + + public enum PowerIndex + { + Multiplicator = 0x10, + PowerIndexArrays = 0xddf914 + } + + public enum Quests + { + QuestGiverStatus = 0xf4 + } + + public enum SpellBook + { + FirstTalentBookPtr = 0xeb52ec, + KnownAllSpells = 0xeb5130, + MountBookMountsPtr = 0xeb5194, + MountBookNumMounts = 0xeb5190, + NextTalentBookPtr = 0xeb52e4, + SpellBookNumSpells = 0xeb5134, + SpellBookSpellsPtr = 0xeb5138, + SpellDBCMaxIndex = 0x30d40, + TalentBookOverrideSpellId = 0x1c, + TalentBookSpellId = 20 + } + + public enum UnitBaseGetUnitAura + { + AuraSize = 0x58, + AuraStructCasterLevel = 0x3a, + AuraStructCount = 0x39, + AuraStructCreatorGuid = 0x20, + AuraStructDuration = 60, + AuraStructFlag = 0x34, + AuraStructMask = 0x35, + AuraStructSpellEndTime = 0x40, + AuraStructSpellId = 0x30, + AuraStructUnk1 = 0x3b, + AuraStructUnk2 = 0x44, + AuraTable1 = 0x1150, + AuraTable2 = 0x580 + } + + public enum UnitField + { + CachedIsBoss = 0x60, + CachedModelId1 = 0x6c, + CachedName = 0x80, + CachedQuestItem1 = 60, + CachedSubName = 0, + CachedTypeFlag = 0x24, + CachedUnitClassification = 0x2c, + CanInterrupt = 0xfc4, + CanInterruptOffset = 0xe02ea0, + CanInterruptOffset2 = 0xe02ea4, + CanInterruptOffset3 = 0xe02ea8, + CastingSpellEndTime = 0x108c, + CastingSpellID = 0x1064, + CastingSpellStartTime = 0x1088, + ChannelSpellEndTime = 0x1098, + ChannelSpellID = 0x1090, + ChannelSpellStartTime = 0x1094, + DBCacheRow = 0xc80, + TransportGUID = 0xae8, + UNIT_FIELD_R = 0xb08, + UNIT_FIELD_X = 0xaf8, + UNIT_FIELD_Y = 0xafc, + UNIT_FIELD_Z = 0xb00 + } + + public enum VMT + { + CGUnit_C__GetFacing = 0x35 + } + } +} \ No newline at end of file diff --git a/Artemis/Artemis/Modules/Games/WorldofWarcraft/WoWDataModel.cs b/Artemis/Artemis/Modules/Games/WorldofWarcraft/WoWDataModel.cs new file mode 100644 index 000000000..aeeb5421a --- /dev/null +++ b/Artemis/Artemis/Modules/Games/WorldofWarcraft/WoWDataModel.cs @@ -0,0 +1,17 @@ +using Artemis.Models.Interfaces; + +namespace Artemis.Modules.Games.WorldofWarcraft +{ + public class WoWDataModel : IDataModel + { + public Player Player { get; set; } = new Player(); + } + + + public class Player + { + public string Name { get; set; } + public int Health { get; set; } + public int MaxHealth { get; set; } + } +} \ No newline at end of file diff --git a/Artemis/Artemis/Modules/Games/WorldofWarcraft/WoWModel.cs b/Artemis/Artemis/Modules/Games/WorldofWarcraft/WoWModel.cs new file mode 100644 index 000000000..093e6bd43 --- /dev/null +++ b/Artemis/Artemis/Modules/Games/WorldofWarcraft/WoWModel.cs @@ -0,0 +1,57 @@ +using System.Collections.Generic; +using Artemis.Managers; +using Artemis.Models; +using Artemis.Profiles.Layers.Models; +using Artemis.Utilities; +using Artemis.Utilities.Memory; + +namespace Artemis.Modules.Games.WorldofWarcraft +{ + public class WoWModel : GameModel + { + private Memory _memory; + + public WoWModel(MainManager mainManager, WoWSettings settings) + : base(mainManager, settings, new WoWDataModel()) + { + Name = "WoW"; + ProcessName = "Wow-64"; + Scale = 4; + Enabled = Settings.Enabled; + Initialized = false; + } + + public int Scale { get; set; } + + public override void Dispose() + { + Initialized = false; + } + + public override void Enable() + { + var tempProcess = MemoryHelpers.GetProcessIfRunning(ProcessName); + if (tempProcess == null) + return; + + _memory = new Memory(tempProcess); + + Initialized = true; + } + + public override void Update() + { + if (Profile == null || DataModel == null || _memory == null) + return; + +// _memory.ReadMemory(); + } + + public override List GetRenderLayers(bool keyboardOnly) + { + return Profile.GetRenderLayers(DataModel, keyboardOnly); + } + + + } +} \ No newline at end of file diff --git a/Artemis/Artemis/Modules/Games/WorldofWarcraft/WoWSettings.cs b/Artemis/Artemis/Modules/Games/WorldofWarcraft/WoWSettings.cs new file mode 100644 index 000000000..7c04d9de0 --- /dev/null +++ b/Artemis/Artemis/Modules/Games/WorldofWarcraft/WoWSettings.cs @@ -0,0 +1,31 @@ +using Artemis.Models; + +namespace Artemis.Modules.Games.WorldofWarcraft +{ + public class WoWSettings : GameSettings + { + public WoWSettings() + { + Load(); + } + + public sealed override void Load() + { + Enabled = WoW.Default.Enabled; + LastProfile = WoW.Default.LastProfile; + } + + public sealed override void Save() + { + WoW.Default.Enabled = Enabled; + WoW.Default.LastProfile = LastProfile; + + WoW.Default.Save(); + } + + public sealed override void ToDefault() + { + Enabled = true; + } + } +} \ No newline at end of file diff --git a/Artemis/Artemis/Modules/Games/WorldofWarcraft/WoWViewModel.cs b/Artemis/Artemis/Modules/Games/WorldofWarcraft/WoWViewModel.cs new file mode 100644 index 000000000..db4103852 --- /dev/null +++ b/Artemis/Artemis/Modules/Games/WorldofWarcraft/WoWViewModel.cs @@ -0,0 +1,17 @@ +using Artemis.InjectionFactories; +using Artemis.Managers; +using Artemis.ViewModels.Abstract; +using Caliburn.Micro; + +namespace Artemis.Modules.Games.WorldofWarcraft +{ + public sealed class WoWViewModel : GameViewModel + { + public WoWViewModel(MainManager main, IEventAggregator events, IProfileEditorVmFactory pFactory) + : base(main, new WoWModel(main, new WoWSettings()), events, pFactory) + { + DisplayName = "World of Warcraft"; + MainManager.EffectManager.EffectModels.Add(GameModel); + } + } +} \ No newline at end of file diff --git a/Artemis/Artemis/Profiles/ProfileModel.cs b/Artemis/Artemis/Profiles/ProfileModel.cs index 4b0e03630..e81ca8deb 100644 --- a/Artemis/Artemis/Profiles/ProfileModel.cs +++ b/Artemis/Artemis/Profiles/ProfileModel.cs @@ -63,8 +63,8 @@ namespace Artemis.Profiles // Remove the clip c.Pop(); } - - using (var bmp = ImageUtilities.DrawinVisualToBitmap(visual, keyboardRect)) + + using (var bmp = ImageUtilities.DrawingVisualToBitmap(visual, keyboardRect)) keyboard.DrawImage(bmp, new PointF(0, 0)); } @@ -143,7 +143,7 @@ namespace Artemis.Profiles c.Pop(); } - using (var bmp = ImageUtilities.DrawinVisualToBitmap(visual, rect)) + using (var bmp = ImageUtilities.DrawingVisualToBitmap(visual, rect)) g.DrawImage(bmp, new PointF(0, 0)); } diff --git a/Artemis/Artemis/Utilities/GeneralHelpers.cs b/Artemis/Artemis/Utilities/GeneralHelpers.cs index 29cba4b2a..af9771b92 100644 --- a/Artemis/Artemis/Utilities/GeneralHelpers.cs +++ b/Artemis/Artemis/Utilities/GeneralHelpers.cs @@ -26,7 +26,7 @@ namespace Artemis.Utilities // Start the new process try { - Process.Start(processInfo); + System.Diagnostics.Process.Start(processInfo); } catch (Exception) { diff --git a/Artemis/Artemis/Utilities/ImageUtilities.cs b/Artemis/Artemis/Utilities/ImageUtilities.cs index c45875482..3326e3253 100644 --- a/Artemis/Artemis/Utilities/ImageUtilities.cs +++ b/Artemis/Artemis/Utilities/ImageUtilities.cs @@ -54,12 +54,12 @@ namespace Artemis.Utilities } } - public static Bitmap DrawinVisualToBitmap(DrawingVisual visual, Rect rect) + public static Bitmap DrawingVisualToBitmap(DrawingVisual visual, Rect rect) { var bmp = new RenderTargetBitmap((int) rect.Width, (int) rect.Height, 96, 96, PixelFormats.Pbgra32); bmp.Render(visual); - var encoder = new PngBitmapEncoder(); + var encoder = new BmpBitmapEncoder(); encoder.Frames.Add(BitmapFrame.Create(bmp)); Bitmap bitmap; @@ -68,6 +68,7 @@ namespace Artemis.Utilities encoder.Save(stream); bitmap = new Bitmap(stream); } + return bitmap; } diff --git a/Artemis/Artemis/Utilities/Memory/Memory.cs b/Artemis/Artemis/Utilities/Memory/Memory.cs index 63caeb2a8..b40af023c 100644 --- a/Artemis/Artemis/Utilities/Memory/Memory.cs +++ b/Artemis/Artemis/Utilities/Memory/Memory.cs @@ -17,7 +17,7 @@ namespace Artemis.Utilities.Memory /// Initializes a new instance of the Memory /// /// Remote process - public Memory(Process process) + public Memory(System.Diagnostics.Process process) { if (process == null) throw new ArgumentNullException("process"); @@ -35,7 +35,7 @@ namespace Artemis.Utilities.Memory /// /// Gets the process to which this memory is attached to /// - public Process Process { get; private set; } + public System.Diagnostics.Process Process { get; private set; } #endregion diff --git a/Artemis/Artemis/Utilities/Memory/MemoryHelpers.cs b/Artemis/Artemis/Utilities/Memory/MemoryHelpers.cs index 42fd85158..94a0d9493 100644 --- a/Artemis/Artemis/Utilities/Memory/MemoryHelpers.cs +++ b/Artemis/Artemis/Utilities/Memory/MemoryHelpers.cs @@ -1,6 +1,6 @@ using System; -using System.Diagnostics; using System.Runtime.InteropServices; +using Process.NET.Memory; namespace Artemis.Utilities.Memory { @@ -10,9 +10,9 @@ namespace Artemis.Utilities.Memory public static extern bool ReadProcessMemory(IntPtr hProcess, IntPtr lpBaseAddress, [Out] byte[] lpBuffer, int dwSize, ref int lpNumberOfBytesRead); - public static Process GetProcessIfRunning(string processName) + public static System.Diagnostics.Process GetProcessIfRunning(string processName) { - var processes = Process.GetProcessesByName(processName); + var processes = System.Diagnostics.Process.GetProcessesByName(processName); return processes.Length >= 1 ? processes[0] : null; } @@ -37,5 +37,14 @@ namespace Artemis.Utilities.Memory } return address; } + + public static T ReadMultilevelPointer(this IMemory memory, IntPtr address, params int[] offsets) where T : struct + { + for (var i = 0; i < offsets.Length - 1; i++) + { + address = memory.Read(address + offsets[i]); + } + return memory.Read(address + offsets[offsets.Length - 1]); + } } } \ No newline at end of file diff --git a/Artemis/Artemis/Utilities/Updater.cs b/Artemis/Artemis/Utilities/Updater.cs index da3bda3bb..36e227d87 100644 --- a/Artemis/Artemis/Utilities/Updater.cs +++ b/Artemis/Artemis/Utilities/Updater.cs @@ -39,7 +39,7 @@ namespace Artemis.Utilities "Note: You can disable update notifications in the settings menu"); if (viewUpdate.Value) - Process.Start(new ProcessStartInfo(newRelease["html_url"].Value())); + System.Diagnostics.Process.Start(new ProcessStartInfo(newRelease["html_url"].Value())); return null; } diff --git a/Artemis/Artemis/ViewModels/Flyouts/FlyoutSettingsViewModel.cs b/Artemis/Artemis/ViewModels/Flyouts/FlyoutSettingsViewModel.cs index 946cba921..8cbb254c8 100644 --- a/Artemis/Artemis/ViewModels/Flyouts/FlyoutSettingsViewModel.cs +++ b/Artemis/Artemis/ViewModels/Flyouts/FlyoutSettingsViewModel.cs @@ -208,7 +208,7 @@ namespace Artemis.ViewModels.Flyouts public void NavigateTo(string url) { - Process.Start(new ProcessStartInfo(url)); + System.Diagnostics.Process.Start(new ProcessStartInfo(url)); } protected override void HandleOpen() diff --git a/Artemis/Artemis/ViewModels/WelcomeViewModel.cs b/Artemis/Artemis/ViewModels/WelcomeViewModel.cs index 4d8f23524..c8735717b 100644 --- a/Artemis/Artemis/ViewModels/WelcomeViewModel.cs +++ b/Artemis/Artemis/ViewModels/WelcomeViewModel.cs @@ -12,7 +12,7 @@ namespace Artemis.ViewModels public void NavigateTo(string url) { - Process.Start(new ProcessStartInfo(url)); + System.Diagnostics.Process.Start(new ProcessStartInfo(url)); } } } \ No newline at end of file diff --git a/Artemis/Artemis/Views/WelcomeView.xaml.cs b/Artemis/Artemis/Views/WelcomeView.xaml.cs index 6aed8592c..bba7bfeba 100644 --- a/Artemis/Artemis/Views/WelcomeView.xaml.cs +++ b/Artemis/Artemis/Views/WelcomeView.xaml.cs @@ -16,7 +16,7 @@ namespace Artemis.Views private void Hyperlink_RequestNavigate(object sender, RequestNavigateEventArgs e) { - Process.Start("https://github.com/SpoinkyNL/Artemis/wiki/Frequently-Asked-Questions-(FAQ)"); + System.Diagnostics.Process.Start("https://github.com/SpoinkyNL/Artemis/wiki/Frequently-Asked-Questions-(FAQ)"); } } } \ No newline at end of file diff --git a/Artemis/Artemis/packages.config b/Artemis/Artemis/packages.config index 49c63d88c..9c566c400 100644 --- a/Artemis/Artemis/packages.config +++ b/Artemis/Artemis/packages.config @@ -1,5 +1,4 @@  -