コード例 #1
0
        /// <summary>
        /// Initialises an instance capable of managing memory in a specified remote process
        /// </summary>
        public MemoryModule(string processName)
        {
            ValidationHandler.ValidateOperatingSystem();

            _memoryManager = new MemoryManager(processName);

            _patternScanner = new PatternScanner(_memoryManager);
        }
コード例 #2
0
        public ClientPatcher(string fileName)
        {
            Contract.Requires(!string.IsNullOrEmpty(fileName));

            _fileName = fileName;
            var data = File.ReadAllBytes(fileName);

            _scanner = new PatternScanner(data);
        }
コード例 #3
0
 public NativeFuncScanner(IProcess process,
                          CallingConventions convention)
 {
     Process    = process;
     Convention = convention;
     Scanner    = new PatternScanner(Process.ModuleFactory.MainModule);
     Factory    = new AssemblyFactory(process,
                                      new Fasm32Assembler());
 }
コード例 #4
0
ファイル: Form1.cs プロジェクト: ZoDDeL/LuaUnlocker
        private void btnInject_Click(object sender, EventArgs e)
        {
            try
            {
                var process = System.Diagnostics.Process.GetProcessesByName("WowB-64").FirstOrDefault();     // Wow 64 Beta

                if (process == null)
                {
                    process = System.Diagnostics.Process.GetProcessesByName("WowT-64").FirstOrDefault();     // Wow 64 PTR
                }
                if (process == null)
                {
                    process = System.Diagnostics.Process.GetProcessesByName("Wow-64").FirstOrDefault();      //  Wow 64 Live (private servers)
                }
                if (process == null)
                {
                    process = System.Diagnostics.Process.GetProcessesByName("freakz735-64").FirstOrDefault();      //  Wow 64 freakz 7.3.5 (private servers)
                }
                if (process == null)
                {
                    process = System.Diagnostics.Process.GetProcessesByName("WowB").FirstOrDefault();        //  Wow 64 Beta
                }
                if (process == null)
                {
                    process = System.Diagnostics.Process.GetProcessesByName("WowT").FirstOrDefault();        //  Wow 64 PTR
                }
                if (process == null)
                {
                    process = System.Diagnostics.Process.GetProcessesByName("Wow").FirstOrDefault();         // Wow 64 Live
                }
                if (process == null)
                {
                    process = System.Diagnostics.Process.GetProcessesByName("WowClassic").FirstOrDefault();  // Wow 64 Classic
                }
                if (process == null)
                {
                    throw new Exception("World of warcraft is not running, nothing to unlock");
                }

                ProcessSharp   = new ProcessSharp(process, Process.NET.Memory.MemoryType.Remote);
                PatternScanner = new PatternScanner(ProcessSharp[ProcessSharp.Native.MainModule.ModuleName]);

                var wHandle = OpenProcess((int)MemoryProtection.Proc_All_Access, false, ProcessSharp.Native.Id);

                InjectCode(ProcessSharp.Native.Id, wHandle);

                MessageBox.Show("Success", Text, MessageBoxButtons.OK, MessageBoxIcon.Information);
                Close();
            }
            catch (Exception ex)
            {
                MessageBox.Show($"Failure: {ex.Message}", Text, MessageBoxButtons.OK, MessageBoxIcon.Error);
                Application.Exit();
            }
        }
コード例 #5
0
        //
        // Native calls

        protected void SetupNativeMethods()
        {
            var scanner   = new PatternScanner(SMProcess.ModuleFactory.MainModule);
            var hintAddrs = SMInject.Instance.Callback.GetPatternsHintAddresses();

            foreach (var methodPattern in SMNatives.MethodsPatterns)
            {
                int hintAddr = 0;

                if (hintAddrs.ContainsKey(methodPattern.Value.PatternText))
                {
                    hintAddr = hintAddrs[methodPattern.Value.PatternText];
                }

                var scanRes = scanner.Find(methodPattern.Value,
                                           hintAddr);
                var procAddr = scanRes.BaseAddress.ToInt32();

                hintAddrs[methodPattern.Value.PatternText] = scanRes.Offset;
                CallTable[methodPattern.Key] = procAddr;
            }

            SMInject.Instance.Callback.SetPatternsHintAddresses(hintAddrs);
            //CallTable[NativeMethod.TSMMainSelectDefaultConcept] =
            //  scanner.Find(SMNatives.TSMMain.SelectDefaultConceptCallSig).BaseAddress.ToInt32();
            //CallTable[NativeMethod.TRegistryAddMember]        = scanner.Find(SMNatives.TRegistry.AddMember).BaseAddress.ToInt32();
            //CallTable[NativeMethod.TRegistryImportFile]       = scanner.Find(SMNatives.TRegistry.ImportFile).BaseAddress.ToInt32();
            //CallTable[NativeMethod.ElWdwGoToElement]          = scanner.Find(SMNatives.TElWind.GoToElementCallSig).BaseAddress.ToInt32();
            //CallTable[NativeMethod.ElWdwPasteElement]         = scanner.Find(SMNatives.TElWind.PasteElementCallSig).BaseAddress.ToInt32();
            //CallTable[NativeMethod.ElWdwAppendElement]        = scanner.Find(SMNatives.TElWind.AppendElementCallSig).BaseAddress.ToInt32();
            //CallTable[NativeMethod.ElWdwAddElementFromText]   = scanner.Find(SMNatives.TElWind.AddElementFromTextCallSig).BaseAddress.ToInt32();
            //CallTable[NativeMethod.ElWdwDeleteCurrentElement] = scanner.Find(SMNatives.TElWind.DeleteCurrentElementCallSig).BaseAddress.ToInt32();
            //CallTable[NativeMethod.ElWdwGetText]              = scanner.Find(SMNatives.TElWind.GetTextCallSig).BaseAddress.ToInt32();
            //CallTable[NativeMethod.ElWdwEnterUpdateLock]      = scanner.Find(SMNatives.TElWind.EnterUpdateLockCallSig).BaseAddress.ToInt32();
            //CallTable[NativeMethod.ElWdwQuitUpdateLock]       = scanner.Find(SMNatives.TElWind.QuitUpdateLockCallSig).BaseAddress.ToInt32();
            //CallTable[NativeMethod.ElWdwDone]                 = scanner.Find(SMNatives.TElWind.DoneSig).BaseAddress.ToInt32();
            //CallTable[NativeMethod.ElWdwPasteArticle]         = scanner.Find(SMNatives.TElWind.PasteArticleSig).BaseAddress.ToInt32();
            //CallTable[NativeMethod.ElWdwSetText]              = scanner.Find(SMNatives.TElWind.SetTextCallSig).BaseAddress.ToInt32();
            //CallTable[NativeMethod.TCompDataGetType] =
            //  scanner.Find(SMNatives.TElWind.TComponentData.GetTypeCallSig).BaseAddress.ToInt32();
            //CallTable[NativeMethod.TCompDataGetText] =
            //  scanner.Find(SMNatives.TElWind.TComponentData.GetTextCallSig).BaseAddress.ToInt32();
            //CallTable[NativeMethod.TCompDataSetText] =
            //  scanner.Find(SMNatives.TElWind.TComponentData.SetTextCallSig).BaseAddress.ToInt32();
            //CallTable[NativeMethod.TCompDataGetTextRegMember] =
            //  scanner.Find(SMNatives.TElWind.TComponentData.GetTextRegMemberCallSig).BaseAddress.ToInt32();
            //CallTable[NativeMethod.TCompDataSetTextRegMember] =
            //  scanner.Find(SMNatives.TElWind.TComponentData.SetTextRegMemberCallSig).BaseAddress.ToInt32();
            //CallTable[NativeMethod.TCompDataGetImageRegMember] =
            //  scanner.Find(SMNatives.TElWind.TComponentData.GetImageRegMemberCallSig).BaseAddress.ToInt32();
            //CallTable[NativeMethod.TCompDataSetImageRegMember] =
            //  scanner.Find(SMNatives.TElWind.TComponentData.SetImageRegMemberCallSig).BaseAddress.ToInt32();
        }
コード例 #6
0
ファイル: Utils.cs プロジェクト: zH4x/Unreal-Dumping-Agent
        private static bool IsValidGNamesAddress(IntPtr address, bool chunkCheck)
        {
            if (MemObj == null || !IsValidRemoteAddress(address))
            {
                return(false);
            }

            if (!chunkCheck && !IsValidRemotePointer(address, out _))
            {
                return(false);
            }

            if (!chunkCheck)
            {
                address = MemObj.ReadAddress(address);
            }

            int nullCount = 0;

            // Chunks array must have null pointers, if not then it's not valid
            for (int i = 0; i < 50 && nullCount <= 3; i++)
            {
                // Read Chunk Address
                var offset       = i * GamePointerSize();
                var chunkAddress = MemObj.ReadAddress(address + offset);
                if (chunkAddress == IntPtr.Zero)
                {
                    ++nullCount;
                }
            }

            if (nullCount <= 3)
            {
                return(false);
            }

            // Read First FName Address
            var noneFName = MemObj.ReadAddress(MemObj.ReadAddress(address));

            if (!IsValidRemoteAddress(noneFName))
            {
                return(false);
            }

            // Search for none FName
            var pattern = PatternScanner.Parse("NoneSig", 0, "4E 6F 6E 65 00");
            var result  = PatternScanner.FindPattern(MemObj, noneFName, noneFName + 0x50, new List <PatternScanner.Pattern> {
                pattern
            }, true).Result;

            return(result["NoneSig"].Count > 0);
        }
コード例 #7
0
        public void TestLocalDwordPattern()
        {
            var process = new ProcessSharp(System.Diagnostics.Process.GetCurrentProcess(), Memory.MemoryType.Local);
            var module  = process.ModuleFactory.MainModule;
            var scanner = new PatternScanner(module);

            Assert.NotNull(scanner, "Failed to instantiate PatternScanner object.");
            Assert.NotNull(scanner.Data, "Failed to read local memory in to Data object.");
            var pattern = new DwordPattern("E8 ? ? ? ? 83 C4"); //Most common x86 signature. CALL DWORD ADD ESP, X.
            var result  = scanner.Find(pattern);

            Assert.IsTrue(result.Found, "Failed to find signature in TestLocalDwordPattern.");
            Assert.IsNotNull(result.Offset, "Offset was null in TestLocalDwordPattern.");
        }
コード例 #8
0
        public void TestRemoteNaivePattern()
        {
            System.Diagnostics.Process[] processes = System.Diagnostics.Process.GetProcessesByName("notepad++");
            Assert.Greater(processes.Length, 0, "Failed to find a running instance of Notepad++.");
            var process = new ProcessSharp(processes[0], Process.NET.Memory.MemoryType.Remote);
            var module  = process.ModuleFactory.MainModule;
            var scanner = new PatternScanner(module);

            Assert.NotNull(scanner, "Failed to instantiate PatternScanner object.");
            Assert.NotNull(scanner.Data, "Failed to read MainModule from Notepad++ in to Data object.");
            var pattern = new DwordPattern("E8 ? ? ? ? 83 C4", PatternScannerAlgorithm.Naive); //Most common x86 signature. CALL DWORD ADD ESP, X.
            var result  = scanner.Find(pattern);

            Assert.IsTrue(result.Found, "Failed to find signature in TestRemoteDwordPattern.");
            Assert.That(result.Offset > -1, "TestRemoteNaivePattern offset was not greater than -1.");
        }
コード例 #9
0
        public void TestUnfindableNaivePattern()
        {
            System.Diagnostics.Process[] processes = System.Diagnostics.Process.GetProcessesByName("notepad++");
            Assert.Greater(processes.Length, 0, "Failed to find a running instance of Notepad++.");
            var process = new ProcessSharp(processes[0], Process.NET.Memory.MemoryType.Remote);
            var module  = process.ModuleFactory.MainModule;
            var scanner = new PatternScanner(module);

            Assert.NotNull(scanner, "Failed to instantiate PatternScanner object.");
            Assert.NotNull(scanner.Data, "Failed to read MainModule from Notepad++ in to Data object.");
            var pattern = new DwordPattern("69 42 06 66 11 22 33 44 55 66 77 88 99"); //Most common x86 signature. CALL DWORD ADD ESP, X.
            var result  = scanner.Find(pattern);

            Assert.IsFalse(result.Found, "TestUnfindableNaivePattern yielded an offset when it wasn't supposed to.");
            Assert.That(result.Offset == 0, "Offset was not special number 0");
        }
コード例 #10
0
        public void TestRemoteDwordDataBMHPattern()
        {
            System.Diagnostics.Process[] processes = System.Diagnostics.Process.GetProcessesByName("notepad++");
            Assert.Greater(processes.Length, 0, "Failed to find a running instance of Notepad++.");
            var process = new ProcessSharp(processes[0], Process.NET.Memory.MemoryType.Remote);
            var module  = process.ModuleFactory.MainModule;
            var scanner = new PatternScanner(module);

            Assert.NotNull(scanner, "Failed to instantiate PatternScanner object.");
            Assert.NotNull(scanner.Data, "Failed to read MainModule from Notepad++ in to Data object.");
            var pattern = new DwordPatternData("E8 ? ? ? ? 83 C4", 1, PatternScannerAlgorithm.BoyerMooreHorspool); //Most common x86 signature. CALL DWORD ADD ESP, X.
            var result  = scanner.Find(pattern);

            Assert.IsTrue(result.Found, "Failed to find signature in TestRemoteDwordDataPattern.");
            Assert.IsNotNull(result.Offset, "Offset was null in TestRemoteDwordDataPattern.");
            Assert.IsNotNull(result.ReadAddress, "Failed to read from retrieved pattern address in TestRemoteDwordDataBMHPattern.");
        }
コード例 #11
0
        private void btnInject_Click(object sender, EventArgs e)
        {
            try
            {
                // Ensure windows hosts file is not modified to point to fake address
                var hostPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Windows), @"system32\drivers\etc\hosts");
                var file     = File.ReadAllText(hostPath);

                if (file.ToLower().Contains("frozen"))
                {
                    throw new Exception("Tampering Exception");
                }

                var process = System.Diagnostics.Process.GetProcessesByName("Wow").FirstOrDefault();

                if (process == null)
                {
                    throw new Exception("Wow.exe is not running, nothing to unlock");
                }

                ProcessSharp   = new ProcessSharp(process, Process.NET.Memory.MemoryType.Remote);
                PatternScanner = new PatternScanner(ProcessSharp[ProcessSharp.Native.MainModule.ModuleName]);

                var wHandle = OpenProcess((int)MemoryProtection.Proc_All_Access, false, ProcessSharp.Native.Id);

                InjectCode(ProcessSharp.Native.Id, wHandle);

                MessageBox.Show("Success", Text, MessageBoxButtons.OK, MessageBoxIcon.Information);
                Close();
            }
            catch (Exception ex)
            {
                MessageBox.Show($"Failure: {ex.Message}", Text, MessageBoxButtons.OK, MessageBoxIcon.Error);
                Application.Exit();
            }
        }
コード例 #12
0
        protected void ScanSMMethods(NativeData nativeData)
        {
            var scanner   = new PatternScanner(_smProcess.ModuleFactory.MainModule);
            var hintAddrs = SMA.GetPatternsHintAddresses();

            foreach (var(method, pattern) in nativeData.GetAllMemoryPatterns())
            {
                int hintAddr = 0;

                if (hintAddrs.ContainsKey(pattern.PatternText))
                {
                    hintAddr = hintAddrs[pattern.PatternText];
                }

                var scanRes = scanner.Find(pattern,
                                           hintAddr);
                var procAddr = scanRes.BaseAddress.ToInt32();

                hintAddrs[pattern.PatternText] = scanRes.Offset;
                _callTable[method]             = procAddr;
            }

            SMA.SetPatternsHintAddresses(hintAddrs);
        }
コード例 #13
0
        protected void ScanSMMethods()
        {
            var scanner   = new PatternScanner(_smProcess.ModuleFactory.MainModule);
            var hintAddrs = SMA.GetPatternsHintAddresses();

            foreach (var methodPattern in SM17Natives.MethodsPatterns)
            {
                int hintAddr = 0;

                if (hintAddrs.ContainsKey(methodPattern.Value.PatternText))
                {
                    hintAddr = hintAddrs[methodPattern.Value.PatternText];
                }

                var scanRes = scanner.Find(methodPattern.Value,
                                           hintAddr);
                var procAddr = scanRes.BaseAddress.ToInt32();

                hintAddrs[methodPattern.Value.PatternText] = scanRes.Offset;
                _callTable[methodPattern.Key] = procAddr;
            }

            SMA.SetPatternsHintAddresses(hintAddrs);
        }
コード例 #14
0
        public static bool Initialize()
        {
            _overrideTypes           = new Dictionary <string, string>();
            _predefinedMembers       = new Dictionary <string, List <PredefinedMember> >();
            _predefinedStaticMembers = new Dictionary <string, List <PredefinedMember> >();
            _predefinedMethods       = new Dictionary <string, List <PredefinedMethod> >();
            _virtualFunctionPattern  = new Dictionary <string, VirtualFunctionPatterns>();

            // BadKeywords
            _badKeywords = new Dictionary <string, string>
            {
                { "return", "returnValue" },
                { "continue", "continueValue" },
                { "break", "breakValue" },
                { "int", "intValue" },
                { "bool", "boolValue" }
            };

            // BacChar
            _badChars = new Dictionary <string, string>
            {
                { ",", "" },
                { "!", "" },
                { "-", "" },
                { "`", "" }
            };

            // AlignasClasses
            _alignasClasses = new Dictionary <string, int>
            {
                { "ScriptStruct CoreUObject.Plane", 16 },
                { "ScriptStruct CoreUObject.Quat", 16 },
                { "ScriptStruct CoreUObject.Transform", 16 },
                { "ScriptStruct CoreUObject.Vector4", 16 },
                { "ScriptStruct Engine.RootMotionSourceGroup", 8 }
            };

            // VirtualFunctionPattern
            _virtualFunctionPattern["Class CoreUObject.Object"] = new VirtualFunctionPatterns
            {
                {
                    PatternScanner.Parse("ProcessEvent", 0, "4C 8B DC 57 48 81 EC"),
                    @"	inline void ProcessEvent(class UFunction* function, void* parms)
	{
		GetVFunction<void(*)(UObject*, class UFunction*, void*)>(this, %d)(this, function, parms);
	}"
                }
            };
            _virtualFunctionPattern["Class CoreUObject.Class"] = new VirtualFunctionPatterns
            {
                {
                    PatternScanner.Parse("CreateDefaultObject", 0, "4C 8B DC 57 48 81 EC"),
                    @"	inline UObject* CreateDefaultObject()
	{
		GetVFunction<UObject*(*)(UClass*)>(this, %d)(this);
	}"
                }
            };

            // PredefinedMembers
            _predefinedMembers["Class CoreUObject.Object"]   = GetJsonStructPreMembers("UObject");
            _predefinedMembers["Class CoreUObject.Field"]    = GetJsonStructPreMembers("UField");
            _predefinedMembers["Class CoreUObject.Struct"]   = GetJsonStructPreMembers("UStruct");
            _predefinedMembers["Class CoreUObject.Function"] = GetJsonStructPreMembers("UFunction");

            // PredefinedStaticMembers
            _predefinedStaticMembers["Class CoreUObject.Object"] = new List <PredefinedMember>
            {
                new PredefinedMember("FUObjectArray*", "GObjects")
            };

            // PredefinedMethods
            _predefinedMethods["ScriptStruct CoreUObject.Vector2D"] = new List <PredefinedMethod>
            {
                PredefinedMethod.Inline(@"	inline FVector2D()
		: X(0), Y(0)
	{ }"    ),
                PredefinedMethod.Inline(@"	inline FVector2D(float x, float y)
        : X(x), Y(y)
    { }")
            };
            _predefinedMethods["ScriptStruct CoreUObject.LinearColor"] = new List <PredefinedMethod>
            {
                PredefinedMethod.Inline(@"	inline FLinearColor()
		: R(0), G(0), B(0), A(0)
	{ }"    ),
                PredefinedMethod.Inline(@"	inline FLinearColor(float r, float g, float b, float a)
		: R(r),
		  G(g),
		  B(b),
		  A(a)
	{ }"    )
            };
            _predefinedMethods["Class CoreUObject.Object"] = new List <PredefinedMethod>
            {
                PredefinedMethod.Inline(@"	static inline TUObjectArray& GetGlobalObjects()
	{
		return GObjects->ObjObjects;
	}"    ),
                PredefinedMethod.Default("std::string GetName() const", @"std::string UObject::GetName() const
{
	std::string name(Name.GetName());
	if (Name.Number > 0)
	{
		name += '_' + std::to_string(Name.Number);
	}

	auto pos = name.rfind('/');
	if (pos == std::string::npos)
	{
		return name;
	}
	
	return name.substr(pos + 1);
}"),
                PredefinedMethod.Default("std::string GetFullName() const", @"std::string UObject::GetFullName() const
{
	std::string name;

	if (Class != nullptr)
	{
		std::string temp;
		for (auto p = Outer; p; p = p->Outer)
		{
			temp = p->GetName() + ""."" + temp;
		}

		name = Class->GetName();
		name += "" "";
		name += temp;
		name += GetName();
	}

	return name;
}"),
                PredefinedMethod.Inline(@"	template<typename T>
	static T* FindObject(const std::string& name)
	{
		for (int i = 0; i < GetGlobalObjects().Num(); ++i)
		{
			auto object = GetGlobalObjects().GetByIndex(i);
	
			if (object == nullptr)
			{
				continue;
			}
	
			if (object->GetFullName() == name)
			{
				return static_cast<T*>(object);
			}
		}
		return nullptr;
	}"    ),
                PredefinedMethod.Inline(@"	template<typename T>
	static T* FindObject()
	{
		auto v = T::StaticClass();
		for (int i = 0; i < SDK::UObject::GetGlobalObjects().Num(); ++i)
		{
			auto object = SDK::UObject::GetGlobalObjects().GetByIndex(i);

			if (object == nullptr)
			{
				continue;
			}

			if (object->IsA(v))
			{
				return static_cast<T*>(object);
			}
		}
		return nullptr;
	}"    ),
                PredefinedMethod.Inline(@"	template<typename T>
	static std::vector<T*> FindObjects(const std::string& name)
	{
		std::vector<T*> ret;
		for (int i = 0; i < GetGlobalObjects().Num(); ++i)
		{
			auto object = GetGlobalObjects().GetByIndex(i);

			if (object == nullptr)
			{
				continue;
			}

			if (object->GetFullName() == name)
			{
				ret.push_back(static_cast<T*>(object));
			}
		}
		return ret;
	}"    ),
                PredefinedMethod.Inline(@"	template<typename T>
	static std::vector<T*> FindObjects()
	{
		std::vector<T*> ret;
		auto v = T::StaticClass();
		for (int i = 0; i < SDK::UObject::GetGlobalObjects().Num(); ++i)
		{
			auto object = SDK::UObject::GetGlobalObjects().GetByIndex(i);

			if (object == nullptr)
			{
				continue;
			}

			if (object->IsA(v))
			{
				ret.push_back(static_cast<T*>(object));
			}
		}
		return ret;
	}"    ),
                PredefinedMethod.Inline(@"	static UClass* FindClass(const std::string& name)
	{
		return FindObject<UClass>(name);
	}"    ),
                PredefinedMethod.Inline(@"	template<typename T>
	static T* GetObjectCasted(std::size_t index)
	{
		return static_cast<T*>(GetGlobalObjects().GetByIndex(index));
	}"    ),
                PredefinedMethod.Default("bool IsA(UClass* cmp) const", @"bool UObject::IsA(UClass* cmp) const
{
	for (auto super = Class; super; super = static_cast<UClass*>(super->SuperField))
	{
		if (super == cmp)
		{
			return true;
		}
	}

	return false;
}"),
            };
            _predefinedMethods["Class CoreUObject.Class"] = new List <PredefinedMethod>
            {
                PredefinedMethod.Inline(@"template<typename T>
	inline T* CreateDefaultObject()
	{
		return static_cast<T*>(CreateDefaultObject());
	}"    )
            };

            /*
             * predefinedMethods["Class Engine.GameViewportClient"] =
             * {
             *  PredefinedMethod::Inline(R"(	inline void PostRender(UCanvas* Canvas)
             * {
             * return GetVFunction<void(*)(UGameViewportClient*, UCanvas*)>(this, %d)(this, Canvas);
             * })")
             * };
             */

            return(true);
        }
コード例 #15
0
        internal static PatternScanResult Find(string moduleName, IMemoryPattern pattern, ProcessSharp prcss)
        {
            var scanner = new PatternScanner(prcss[moduleName]);

            return(scanner.Find(pattern));
        }
コード例 #16
0
 public BasicProcess(System.Diagnostics.Process process)
 {
     _processSharp   = new ProcessSharp(process, Process.NET.Memory.MemoryType.Remote);
     _patternScanner = new PatternScanner(_processSharp[_processSharp.Native.MainModule.ModuleName]);
 }
コード例 #17
0
        public void Init()
        {
            var _firstclass = new IntPtr(PatternScanner.FindPattern(Globals._csgo.ProcessHandle, "A1 ? ? ? ? 8B 4F 0C 85 C0 74 18 0F 1F 00 39 48 14 74 09 8B 40 10 85 C0 75 F4 EB 07 8B 58 08 85 DB 75 0E 68 ? ? ? ? FF 15 ? ? ? ? 83 C4 04 8B 47 18", Globals._csgo.CSGOModules["client"], false, 0x1, true));

            _firstclass = MemoryAPI.ReadFromProcess <IntPtr>(Globals._csgo.ProcessHandle, _firstclass);

            do
            {
                var table = MemoryAPI.ReadFromProcess <IntPtr>(Globals._csgo.ProcessHandle, (_firstclass + 0xC));
                if (table != IntPtr.Zero)
                {
                    string table_name = MemoryAPI.ReadTextFromProcess(Globals._csgo.ProcessHandle, MemoryAPI.ReadFromProcess <IntPtr>(Globals._csgo.ProcessHandle, (table + 0xC)), 32);
                    ScanTable(table, 0, 0, table_name);
                }
                _firstclass = MemoryAPI.ReadFromProcess <IntPtr>(Globals._csgo.ProcessHandle, (_firstclass + 0x10));
            } while (_firstclass != IntPtr.Zero);

            m_vecOrigin = _tables["DT_BaseEntity"]["m_vecOrigin"];

            Console.WriteLine("- m_vecOrigin            => 0x" + m_vecOrigin.ToString("X"));

            m_iHealth = _tables["DT_CSPlayer"]["m_iHealth"];

            Console.WriteLine("- m_iHealth              => 0x" + m_iHealth.ToString("X"));

            m_iGlowIndex = _tables["DT_CSPlayer"]["m_flFlashDuration"] + 0x18;

            Console.WriteLine("- m_iGlowIndex           => 0x" + m_iGlowIndex.ToString("X"));

            m_iTeamNum = _tables["DT_BaseEntity"]["m_iTeamNum"];

            Console.WriteLine("- m_iTeamNum             => 0x" + m_iTeamNum.ToString("X"));

            m_vecViewOffset = _tables["DT_CSPlayer"]["m_vecViewOffset[0]"];

            Console.WriteLine("- m_vecViewOffset        => 0x" + m_vecViewOffset.ToString("X"));

            m_Model = 0x6C;

            Console.WriteLine("- m_Model                => 0x" + m_Model.ToString("X"));

            m_dwBoneMatrix = _tables["DT_BaseAnimating"]["m_nForceBone"] + 28;

            Console.WriteLine("- m_dwBoneMatrix         => 0x" + m_dwBoneMatrix.ToString("X"));

            m_iIndex = 0x64;

            Console.WriteLine("- m_iIndex               => 0x" + m_iIndex.ToString("X"));

            m_bSpottedByMask = _tables["DT_BaseEntity"]["m_bSpottedByMask"];

            Console.WriteLine("- m_bSpottedByMask       => 0x" + m_bSpottedByMask.ToString("X"));

            m_iItemDefinitionIndex = _tables["DT_BaseCombatWeapon"]["m_iItemDefinitionIndex"];

            Console.WriteLine("- m_iItemDefinitionIndex => 0x" + m_iItemDefinitionIndex.ToString("X"));

            m_iClip1 = _tables["DT_BaseCombatWeapon"]["m_iClip1"];

            Console.WriteLine("- m_iClip1               => 0x" + m_iClip1.ToString("X"));

            m_iFOV = _tables["DT_CSPlayer"]["m_iFOV"];

            Console.WriteLine("- m_iFOV                 => 0x" + m_iFOV.ToString("X"));

            m_iDefaultFOV = _tables["DT_CSPlayer"]["m_iDefaultFOV"];

            Console.WriteLine("- m_iDefaultFOV          => 0x" + m_iDefaultFOV.ToString("X"));

            m_iShotsFired = _tables["DT_CSPlayer"]["m_iShotsFired"];

            Console.WriteLine("- m_iShotsFired          => 0x" + m_iShotsFired.ToString("X"));

            m_aimPunchAngle = _tables["DT_BasePlayer"]["m_aimPunchAngle"];

            Console.WriteLine("- m_aimPunchAngle        => 0x" + m_aimPunchAngle.ToString("X"));

            m_nFlags = _tables["DT_CSPlayer"]["m_fFlags"];

            Console.WriteLine("- m_fFlags               => 0x" + m_nFlags.ToString("X"));

            m_hMyWearables = _tables["DT_BaseCombatCharacter"]["m_hMyWearables"];

            Console.WriteLine("- m_hMyWearables         => 0x" + m_hMyWearables.ToString("X"));

            m_iEntityLevel = _tables["DT_BaseAttributableItem"]["m_iEntityLevel"];

            Console.WriteLine("- m_iEntityLevel         => 0x" + m_iEntityLevel.ToString("X"));

            m_iItemIDHigh = _tables["DT_BaseAttributableItem"]["m_iItemIDHigh"];

            Console.WriteLine("- m_iItemIDHigh          => 0x" + m_iItemIDHigh.ToString("X"));

            m_iAccountID = _tables["DT_BaseAttributableItem"]["m_iAccountID"];

            Console.WriteLine("- m_iAccountID           => 0x" + m_iAccountID.ToString("X"));

            m_OriginalOwnerXuidLow = _tables["DT_BaseAttributableItem"]["m_OriginalOwnerXuidLow"];

            Console.WriteLine("- m_OriginalOwnerXuidLow => 0x" + m_OriginalOwnerXuidLow.ToString("X"));

            m_OriginalOwnerXuidHigh = _tables["DT_BaseAttributableItem"]["m_OriginalOwnerXuidHigh"];

            Console.WriteLine("- m_OriginalOwneruidHigh => 0x" + m_OriginalOwnerXuidHigh.ToString("X"));

            m_nFallbackPaintKit = _tables["DT_BaseAttributableItem"]["m_nFallbackPaintKit"];

            Console.WriteLine("- m_nFallbackPaintKit    => 0x" + m_nFallbackPaintKit.ToString("X"));

            m_nFallbackSeed = _tables["DT_BaseAttributableItem"]["m_nFallbackSeed"];

            Console.WriteLine("- m_nFallbackSeed        => 0x" + m_nFallbackSeed.ToString("X"));

            m_flFallbackWear = _tables["DT_BaseAttributableItem"]["m_flFallbackWear"];

            Console.WriteLine("- m_flFallbackWear       => 0x" + m_flFallbackWear.ToString("X"));

            m_nFallbackStatTrak = _tables["DT_BaseAttributableItem"]["m_nFallbackStatTrak"];

            Console.WriteLine("- m_nFallbackStatTrak    => 0x" + m_nFallbackStatTrak.ToString("X"));

            m_vecVelocity = _tables["DT_BasePlayer"]["m_vecVelocity[0]"];

            Console.WriteLine("- m_vecVelocity          => 0x" + m_vecVelocity.ToString("X"));

            m_hActiveWeapon = _tables["DT_CSPlayer"]["m_hActiveWeapon"];

            Console.WriteLine("- m_hActiveWeapon        => 0x" + m_hActiveWeapon.ToString("X"));

            m_hMyWeapons = _tables["DT_CSPlayer"]["m_hMyWeapons"];

            Console.WriteLine("- m_hMyWeapons           => 0x" + m_hMyWeapons.ToString("X"));

            m_bIsScoped = _tables["DT_CSPlayer"]["m_bIsScoped"];

            Console.WriteLine("- m_bIsScoped            => 0x" + m_bIsScoped.ToString("X"));

            m_iCrosshairId = _tables["DT_CSPlayer"]["m_bHasDefuser"] + 92;

            Console.WriteLine("- m_iCrosshairId         => 0x" + m_iCrosshairId.ToString("X"));

            m_bGunGameImmunity = _tables["DT_CSPlayer"]["m_bGunGameImmunity"];

            Console.WriteLine("- m_bGunGameImmunity     => 0x" + m_bGunGameImmunity.ToString("X"));

            m_bSpotted = _tables["DT_BaseEntity"]["m_bSpotted"];

            Console.WriteLine("- m_bSpotted             => 0x" + m_bSpotted.ToString("X"));

            m_clrRender = _tables["DT_BaseEntity"]["m_clrRender"];

            Console.WriteLine("- m_clrRender            => 0x" + m_clrRender.ToString("X"));
        }
コード例 #18
0
        /// <summary>
        /// Generates the class.
        /// </summary>
        /// <param name="classObj">The class object.</param>
        private async Task GenerateClass(GenericTypes.UEClass classObj)
        {
            var c = new Class
            {
                Name     = await classObj.GetName(),
                FullName = await classObj.GetFullName()
            };

            var logTask = Logger.Log($"Class:   {await GetName() + "." + c.Name,-85} - instance: 0x{classObj.GetAddress().ToInt64():X8}");

            c.NameCpp     = NameValidator.MakeValidName(await classObj.GetNameCpp());
            c.NameCppFull = $"class {c.NameCpp}";

            c.Size = await classObj.GetPropertySize();

            c.InheritedSize = 0;

            int offset = 0;

            var super = await classObj.GetSuper();

            if (super.IsValid() && super != classObj)
            {
                c.InheritedSize = offset = await super.GetPropertySize();

                c.NameCppFull += $" : public {NameValidator.MakeValidName(await super.GetNameCpp())}";
            }

            var predefinedStaticMembers = new List <PredefinedMember>();

            if (Generator.GetPredefinedClassStaticMembers(c.FullName, ref predefinedStaticMembers))
            {
                foreach (var prop in predefinedStaticMembers)
                {
                    var p = new Member
                    {
                        Offset   = 0,
                        Size     = 0,
                        Name     = prop.Name,
                        Type     = prop.Type,
                        IsStatic = true
                    };
                    c.Members.Add(p);
                }
            }

            var predefinedMembers = new List <PredefinedMember>();

            if (Generator.GetPredefinedClassMembers(c.FullName, ref predefinedMembers))
            {
                foreach (var prop in predefinedMembers)
                {
                    var p = new Member
                    {
                        Offset   = 0,
                        Size     = 0,
                        Name     = prop.Name,
                        Type     = prop.Type,
                        IsStatic = false,
                        Comment  = "NOT AUTO-GENERATED PROPERTY"
                    };
                    c.Members.Add(p);
                }
            }
            else
            {
                var properties = new List <GenericTypes.UEProperty>();
                for (var prop = (await classObj.GetChildren()).Cast <GenericTypes.UEProperty>(); prop.IsValid(); prop = (await prop.GetNext()).Cast <GenericTypes.UEProperty>())
                {
                    var elementSizeT   = prop.GetElementSize();
                    var isScriptStruct = prop.IsA <GenericTypes.UEScriptStruct>();
                    var isFunction     = prop.IsA <GenericTypes.UEFunction>();
                    var isEnum         = prop.IsA <GenericTypes.UEEnum>();
                    var isConst        = prop.IsA <GenericTypes.UEConst>();

                    if (await elementSizeT > 0 &&
                        !await isScriptStruct &&
                        !await isFunction &&
                        !await isEnum &&
                        !await isConst &&
                        (!super.IsValid() || (super != classObj && await prop.GetOffset() >= await super.GetPropertySize())))
                    {
                        properties.Add(prop);
                    }
                }

                // As C# sort not same as C++ version, that's not work
                // Anyway after some testes it's not needed !!
                // properties.Sort((x, y) => ComparePropertyLess(x, y).Result ? 0 : 1);

                c.Members = await GenerateMembers(classObj, offset, properties);
            }

            Generator.GetPredefinedClassMethods(c.FullName, ref c.PredefinedMethods);

            if (Generator.SdkType == SdkType.External)
            {
                // ToDO: Add external Read/Write here for external
            }
            else
            {
                if (Generator.ShouldUseStrings)
                {
                    string classStr = Generator.ShouldXorStrings ? $"_xor_(\"{c.FullName}\")" : $"\"{c.FullName}\"";
                    c.PredefinedMethods.Add(PredefinedMethod.Inline($@"	static UClass* StaticClass()
	{{
		static auto ptr = UObject::FindClass({classStr});
		return ptr;
	}}"    )
                                            );
                }
                else
                {
                    c.PredefinedMethods.Add(PredefinedMethod.Inline($@"	static UClass* StaticClass()
	{{
		static auto ptr = UObject::GetObjectCasted<UClass>({classObj.GetIndex()});
		return ptr;
	}}"    )
                                            );
                }

                c.Methods = await GenerateMethods(classObj);

                //search virtual functions
                var patterns = new VirtualFunctionPatterns();
                if (Generator.GetVirtualFunctionPatterns(c.FullName, ref patterns))
                {
                    int    ptrSize       = Utils.GamePointerSize();
                    IntPtr vTableAddress = classObj.Object.VfTable;
                    var    vTable        = new List <IntPtr>();

                    int methodCount = 0;
                    while (methodCount < 150)
                    {
                        // Dereference Pointer
                        IntPtr vAddress = Utils.MemObj.ReadAddress(vTableAddress + (methodCount * ptrSize));

                        // Check valid address
                        int res = Win32.VirtualQueryEx(Utils.MemObj.ProcessHandle, vAddress, out var info, (uint)Marshal.SizeOf <Win32.MemoryBasicInformation>());
                        if (res == 0 || info.Protect.HasFlag(Win32.MemoryProtection.PageNoAccess))
                        {
                            break;
                        }

                        vTable.Add(vAddress);
                        methodCount++;
                    }

                    foreach (var(pattern, funcStr) in patterns)
                    {
                        for (int i = 0; i < methodCount; i++)
                        {
                            if (vTable[i].IsNull())
                            {
                                continue;
                            }

                            var scanResult = await PatternScanner.FindPattern(Utils.MemObj, vTable[i], vTable[i] + 0x300, new List <PatternScanner.Pattern> {
                                pattern
                            }, true);

                            if (!scanResult.ContainsKey(pattern.Name) || scanResult[pattern.Name].Empty())
                            {
                                continue;
                            }

                            c.PredefinedMethods.Add(PredefinedMethod.Inline($@"{funcStr.Replace("%d", i.ToString())}"));
                            break;
                        }
                    }
                }
            }

            // Wait logger
            await logTask;

            Classes.Add(c);
        }
コード例 #19
0
        private void OnProcessAttached(RemoteProcess process)
        {
            process.UpdateProcessInformations();

            resolver = null;

            var processName = Path.GetFileName(process.UnderlayingProcess.Path).ToLower();

            var settings = Applications.FirstOrDefault(s => s.ProcessName == processName);

            if (settings != null)
            {
                var moduleName = string.IsNullOrEmpty(settings.PatternModule) ? settings.ProcessName : settings.PatternModule;

                var namesArrayPtr = PatternScanner.FindPattern(
                    BytePattern.Parse(settings.Pattern),
                    process,
                    process.GetModuleByName(moduleName)
                    );
                if (!namesArrayPtr.IsNull())
                {
                    switch (settings.PatternMethod)
                    {
                    case PatternMethod.Direct:
                        namesArrayPtr = process.ReadRemoteIntPtr(namesArrayPtr + settings.PatternOffset);
                        break;

                    case PatternMethod.Derefence:
                        var temp = process.ReadRemoteIntPtr(namesArrayPtr + settings.PatternOffset);
                        namesArrayPtr = process.ReadRemoteIntPtr(temp);
                        break;
                    }

                    if (namesArrayPtr.MayBeValid())
                    {
                        switch (settings.Version)
                        {
                        case UnrealEngineVersion.UE1:
                            resolver = new UnrealEngine1NameResolver(process, new UnrealEngine1Config(settings)
                            {
                                GlobalArrayPtr = namesArrayPtr
                            });
                            break;

                        case UnrealEngineVersion.UE2:
                            resolver = new UnrealEngine2NameResolver(process, new UnrealEngine2Config(settings)
                            {
                                GlobalArrayPtr = namesArrayPtr
                            });
                            break;

                        case UnrealEngineVersion.UE3:
                            resolver = new UnrealEngine3NameResolver(process, new UnrealEngine3Config(settings)
                            {
                                GlobalArrayPtr = namesArrayPtr
                            });
                            break;

                        case UnrealEngineVersion.UE4:
                            resolver = new UnrealEngine4NameResolver(process, new UnrealEngine4Config(settings)
                            {
                                GlobalArrayPtr = namesArrayPtr
                            });
                            break;

                        default:
                            throw new ArgumentOutOfRangeException();
                        }
                    }
                }
            }
        }
コード例 #20
0
        public PatternScanResult Find(string moduleName, string pattern)
        {
            var scanner = new PatternScanner(proc[moduleName]);

            return(scanner.Find(new DwordPattern(pattern)));
        }
コード例 #21
0
        /// <summary>
        /// Called when [process attached].
        /// </summary>
        /// <param name="sender">The process instance.</param>
        void OnProcessAttached(RemoteProcess sender)
        {
            sender.UpdateProcessInformations();

            var mainModule = sender.GetModuleByName(sender.UnderlayingProcess.Name);

            if (mainModule is null)
            {
                return;
            }

            dynamic gnames = null;

            switch (sender.UnderlayingProcess.Name)
            {
            case "RocketLeague.exe":
            {
                Game = GameType.RocketLeague;

                var namesPtr = PatternScanner.Search(sender, mainModule, "E8 [....] 48 83 CF FF 45 85 FF", (bytes, address) =>
                    {
                        address += BitConverter.ToInt32(bytes, address) + 0x4 + 0x2c;
                        address += BitConverter.ToInt32(bytes, address + 0x3) + 0x7;
                        return(address);
                    });
                if (namesPtr.IsNull())
                {
                    return;
                }

                gnames = sender.ReadRemoteObject <RocketLeague.GNames>(namesPtr);
                break;
            }

            case "KFGame.exe":
            {
                Game = GameType.KillingFloor2;

                var namesPtr = PatternScanner.Search(sender, mainModule, "E8 [....] 48 83 CB FF 45 85 F6", (bytes, address) =>
                    {
                        address += BitConverter.ToInt32(bytes, address) + 0x4 + 0x7a;
                        address += BitConverter.ToInt32(bytes, address + 0x3) + 0x7;
                        return(address);
                    });
                if (namesPtr.IsNull())
                {
                    return;
                }

                gnames = sender.ReadRemoteObject <KillingFloor2.GNames>(namesPtr);
                break;
            }

            default:
                Terminate();
                return;
            }

            if (gnames.Names.Num is 0)
            {
                return;
            }

            NameDump.Clear();

            for (var i = 0; i < gnames.Names.Num; i++)
            {
                var nameEntry = gnames.Names.Read(sender, i, true);
                if (nameEntry.Name is null)
                {
                    continue;
                }

                NameDump.Add(i, nameEntry.Name);
            }
        }
コード例 #22
0
 public bool Scan(PatternByte[] pattern, ulong baseAddress, ulong size, out ulong result) => PatternScanner.Scan(this, pattern, baseAddress, size, out result);
コード例 #23
0
        public void Init()
        {
            dw_LocalPlayer = PatternScanner.FindPattern(Globals._csgo.ProcessHandle, "A3 ? ? ? ? C7 05 ? ? ? ? ? ? ? ? E8 ? ? ? ? 59 C3 6A ?", Globals._csgo.CSGOModules["client"], true, 0x1, true, 0) + 16;

            Console.WriteLine("- dw_LocalPlayer         => 0x" + dw_LocalPlayer.ToString("X"));

            dw_traceline = PatternScanner.FindPattern(Globals._csgo.ProcessHandle, "55 8B EC 83 E4 F0 83 EC 7C 56 52", Globals._csgo.CSGOModules["client"], true);

            Console.WriteLine("- dw_traceline           => 0x" + dw_traceline.ToString("X"));
            dw_traceline += (int)Globals._csgo.CSGOModules["client"].BaseAddress;

            dw_lineThroughSmoke = PatternScanner.FindPattern(Globals._csgo.ProcessHandle, "55 8B EC 83 EC 08 8B 15 ? ? ? ? 0F 57 C0", Globals._csgo.CSGOModules["client"], true);

            Console.WriteLine("- dw_lineThroughSmoke    => 0x" + dw_lineThroughSmoke.ToString("X"));
            dw_lineThroughSmoke += (int)Globals._csgo.CSGOModules["client"].BaseAddress;

            dw_entitylist = PatternScanner.FindPattern(Globals._csgo.ProcessHandle, "BB ? ? ? ? 83 FF 01 0F 8C ? ? ? ? 3B F8", Globals._csgo.CSGOModules["client"], true, 0x1, true, 0);

            Console.WriteLine("- dw_entitylist          => 0x" + dw_entitylist.ToString("X"));

            dw_CLobbyScreen = PatternScanner.FindPattern(Globals._csgo.ProcessHandle, "A1 ? ? ? ? 85 C0 74 0F 6A 00", Globals._csgo.CSGOModules["client"], true, 0x1, true, 0);

            Console.WriteLine("- dw_CLobbyScreen        => 0x" + dw_CLobbyScreen.ToString("X"));

            dw_AcceptMatch = PatternScanner.FindPattern(Globals._csgo.ProcessHandle, "55 8B EC 83 E4 F8 83 EC 08 56 8B 35 ? ? ? ? 57 83 BE", Globals._csgo.CSGOModules["client"], true);

            Console.WriteLine("- dw_AcceptMatch         => 0x" + dw_AcceptMatch.ToString("X"));
            dw_AcceptMatch += (int)Globals._csgo.CSGOModules["client"].BaseAddress;

            dw_MatchAccepted = PatternScanner.FindPattern(Globals._csgo.ProcessHandle, "89 B7 ? ? ? ? 8B 4F 04 85 C9", Globals._csgo.CSGOModules["client"], false, 0x2, true);

            Console.WriteLine("- dw_MatchAccepted       => 0x" + dw_MatchAccepted.ToString("X"));

            dw_MatchFound = PatternScanner.FindPattern(Globals._csgo.ProcessHandle, "89 87 ? ? ? ? 8B 87 ? ? ? ? 3B F0", Globals._csgo.CSGOModules["client"], false, 0x2, true);

            Console.WriteLine("- dw_MatchFound          => 0x" + dw_MatchFound.ToString("X"));

            dw_ChangeClanTag = PatternScanner.FindPattern(Globals._csgo.ProcessHandle, "53 56 57 8B DA 8B F9 FF 15", Globals._csgo.CSGOModules["engine"], true);

            Console.WriteLine("- dw_ChangeClanTag       => 0x" + dw_ChangeClanTag.ToString("X"));
            dw_ChangeClanTag += (int)Globals._csgo.CSGOModules["engine"].BaseAddress;

            dw_RevealRankFn = PatternScanner.FindPattern(Globals._csgo.ProcessHandle, "55 8B EC 8B 0D ? ? ? ? 68", Globals._csgo.CSGOModules["client"], true);

            Console.WriteLine("- dw_RevealRankFn        => 0x" + dw_RevealRankFn.ToString("X"));
            dw_RevealRankFn += (int)Globals._csgo.CSGOModules["client"].BaseAddress;

            dw_pInput = PatternScanner.FindPattern(Globals._csgo.ProcessHandle, "B9 ? ? ? ? F3 0F 11 04 24 FF 50 10", Globals._csgo.CSGOModules["client"], true, 0x1, true);

            Console.WriteLine("- dw_pInput              => 0x" + dw_pInput.ToString("X"));

            dw_ClientState = PatternScanner.FindPattern(Globals._csgo.ProcessHandle, "A1 ? ? ? ? 33 D2 6A 00 6A 00 33 C9 89 B0", Globals._csgo.CSGOModules["engine"], true, 0x1, true);

            Console.WriteLine("- dw_ClientState         => 0x" + dw_ClientState.ToString("X"));

            dw_viewangles = PatternScanner.FindPattern(Globals._csgo.ProcessHandle, "F3 0F 11 80 ? ? ? ? D9 46 04", Globals._csgo.CSGOModules["engine"], false, 0x4, true);

            Console.WriteLine("- dw_viewangles          => 0x" + dw_viewangles.ToString("X"));

            dw_lastoutgoingcommand = PatternScanner.FindPattern(Globals._csgo.ProcessHandle, "C7 80 ? ? ? ? ? ? ? ? A1 ? ? ? ? F2 0F 10 05 ? ? ? ? F2 0F 11 80 ? ? ? ? FF 15", Globals._csgo.CSGOModules["engine"], false, 0x2, true);

            Console.WriteLine("- dw_lastoutgoingcommand => 0x" + dw_lastoutgoingcommand.ToString("X"));

            dw_bSendPackets = PatternScanner.FindPattern(Globals._csgo.ProcessHandle, "B3 01 8B 01 8B 40 10 FF D0 84 C0 74 0F 80 BF ? ? ? ? ? 0F 84", Globals._csgo.CSGOModules["engine"], true) + 0x1;

            Console.WriteLine("- dw_bSendPackets        => 0x" + dw_bSendPackets.ToString("X"));

            dw_GlobalVars = PatternScanner.FindPattern(Globals._csgo.ProcessHandle, "68 ? ? ? ? 68 ? ? ? ? FF 50 08 85 C0", Globals._csgo.CSGOModules["engine"], true, 0x1, true);

            Console.WriteLine("- dw_GlobalVars          => 0x" + dw_GlobalVars.ToString("X"));

            dw_bDormant = PatternScanner.FindPattern(Globals._csgo.ProcessHandle, "55 8B EC 53 8B 5D 08 56 8B F1 88 9E ? ? ? ? E8", Globals._csgo.CSGOModules["client"], false, 0xC, true);

            Console.WriteLine("- dw_bDormant            => 0x" + dw_bDormant.ToString("X"));

            m_pStudioHdr = PatternScanner.FindPattern(Globals._csgo.ProcessHandle, "8B B6 ? ? ? ? 85 F6 74 05 83 3E 00 75 02 33 F6 F3 0F 10 44 24", Globals._csgo.CSGOModules["client"], false, 0x2, true);

            Console.WriteLine("- dw_pStudioHdr          => 0x" + m_pStudioHdr.ToString("X"));

            dw_GlowObjectManager = PatternScanner.FindPattern(Globals._csgo.ProcessHandle, "A1 ? ? ? ? A8 01 75 4B", Globals._csgo.CSGOModules["client"], true, 0x1, true) + 4;

            Console.WriteLine("- dw_GlowObjectManager   => 0x" + dw_GlowObjectManager.ToString("X"));


            dw_forceattack = PatternScanner.FindPattern(Globals._csgo.ProcessHandle, "89 0D ? ? ? ? 8B 0D ? ? ? ? 8B F2 8B C1 83 CE 04", Globals._csgo.CSGOModules["client"], true, 0x2, true);

            Console.WriteLine("- dw_forceattack         => 0x" + dw_forceattack.ToString("X"));

            dw_isingame = PatternScanner.FindPattern(Globals._csgo.ProcessHandle, "83 B8 ? ? ? ? ? 0F 94 C0 C3", Globals._csgo.CSGOModules["engine"], false, 0x2, true);

            Console.WriteLine("- dw_isingame            => 0x" + dw_isingame.ToString("X"));

            m_dwMapDirectory = PatternScanner.FindPattern(Globals._csgo.ProcessHandle, "05 ? ? ? ? C3 CC CC CC CC CC CC CC 80 3D", Globals._csgo.CSGOModules["engine"], false, 0x1, true);

            Console.WriteLine("- dw_MapDirectory        => 0x" + m_dwMapDirectory.ToString("X"));

            dw_ModelPrecacheTable = PatternScanner.FindPattern(Globals._csgo.ProcessHandle, "8B 8E ? ? ? ? 8B D0 85 C9", Globals._csgo.CSGOModules["engine"], false, 0x2, true);

            Console.WriteLine("- dw_ModelPrecacheTable  => 0x" + dw_ModelPrecacheTable.ToString("X"));

            dw_UserInfoTable = PatternScanner.FindPattern(Globals._csgo.ProcessHandle, "8B 89 ? ? ? ? 85 C9 0F 84 ? ? ? ? 8B 01", Globals._csgo.CSGOModules["engine"], false, 0x2, true);

            Console.WriteLine("- dw_UserInfoTable       => 0x" + dw_UserInfoTable.ToString("X"));

            dw_Convarchartable = PatternScanner.FindPattern(Globals._csgo.ProcessHandle, "8B 3C 85", Globals._csgo.CSGOModules["vstdlib"], true, 0x3, true);

            Console.WriteLine("- dw_Convarchartable     => 0x" + dw_Convarchartable.ToString("X"));

            dw_enginecvar = PatternScanner.FindPattern(Globals._csgo.ProcessHandle, "8B 0D ? ? ? ? C7 05", Globals._csgo.CSGOModules["vstdlib"], true, 0x2, true);

            Console.WriteLine("- dw_enginecvar          => 0x" + dw_enginecvar.ToString("X"));

            dw_clientcmd = PatternScanner.FindPattern(Globals._csgo.ProcessHandle, "55 8B EC A1 ? ? ? ? 33 C9 8B 55 08", Globals._csgo.CSGOModules["engine"], true);

            Console.WriteLine("- dw_clientcmd           => 0x" + dw_clientcmd.ToString("X"));
            dw_clientcmd += (int)Globals._csgo.CSGOModules["engine"].BaseAddress;

            dw_WeaponTable = PatternScanner.FindPattern(Globals._csgo.ProcessHandle, "B9 ? ? ? ? 6A 00 FF 50 08 C3", Globals._csgo.CSGOModules["client"], true, 0x1, true);

            Console.WriteLine("- dw_WeaponTable         => 0x" + dw_WeaponTable.ToString("X"));

            dw_WeaponTableIndex = PatternScanner.FindPattern(Globals._csgo.ProcessHandle, "39 86 ? ? ? ? 74 06 89 86 ? ? ? ? 8B 86", Globals._csgo.CSGOModules["client"], false, 0x2, true);

            Console.WriteLine("- dw_WeaponTableIndex    => 0x" + dw_WeaponTableIndex.ToString("X"));

            dw_inputsystem = PatternScanner.FindPattern(Globals._csgo.ProcessHandle, "8B 0D ? ? ? ? FF 75 10", Globals._csgo.CSGOModules["inputsystem"], true, 0x2, true);

            Console.WriteLine("- dw_inputsystem         => 0x" + dw_inputsystem.ToString("X"));

            dw_inputenabled = MemoryAPI.ReadFromProcess <int>(Globals._csgo.ProcessHandle,
                                                              MemoryAPI.ReadFromProcess <IntPtr>(Globals._csgo.ProcessHandle,
                                                                                                 MemoryAPI.ReadFromProcess <IntPtr>(Globals._csgo.ProcessHandle,
                                                                                                                                    MemoryAPI.ReadFromProcess <IntPtr>(Globals._csgo.ProcessHandle, Globals._csgo.CSGOModules["inputsystem"].BaseAddress + dw_inputsystem))
                                                                                                 + 0x2C /*(11 * 4)*/) + 0x8);

            Console.WriteLine("- dw_inputenabled        => 0x" + dw_inputenabled.ToString("X"));
        }
コード例 #24
0
 public bool Scan(PatternByte[] pattern, bool?mapped, out ulong result) => PatternScanner.Scan(this, pattern, mapped, out result);