Register for your free account! | Forgot your password?

Go Back   elitepvpers > Coders Den > .NET Languages
You last visited: Today at 06:38

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



KDMemory multiple clients

Discussion on KDMemory multiple clients within the .NET Languages forum part of the Coders Den category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Jan 2014
Posts: 43
Received Thanks: 1
KDMemory multiple clients

I am writing a small bot with reading memory and using here from epvpers.

What i need is when process is selected from combo box that it read memory only from that selected process.

Problem is when bot is connected and process is selected it activate window and it should clear previous process and set new, and it works only for second process not for first one.

At the moment only second process selected works when process is changed, but first one never.

I think problem with this is because when you set KDMemory to get values it accept process name in class, but since all processes have same name it takes only one.

Here is code
Code:
    public partial class Form1 : Form
    {
        Process[] process;

        static string processName = "Game.exe";
        static string moduleName = processName;

        static int mobHealth;

        public Form1()
        {
            InitializeComponent();
        }

        private void btnConnect_Click(object sender, EventArgs e)
        {
            Process[] proc = Process.GetProcessesByName("game");

            if (proc.Length != 0)
            {
                process = proc;

                comboProcessList.Items.Clear();
                for (int i = 0; i < proc.Length; i++)
                {
                    comboProcessList.Items.Add("Game: " + (i + 1).ToString()); // text is jsut for visual display
                }
                comboProcessList.SelectedIndex = 0;
            }
        }

        private void comboProcessList_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (comboProcessList.SelectedIndex != -1)
            {
                process = null;

                Process[] proc = Process.GetProcessesByName("game");

                if (proc.Length != 0)
                {
                    process = proc;

                    SetForegroundWindow(process[comboProcessList.SelectedIndex].MainWindowHandle);
                    ShowWindow(process[comboProcessList.SelectedIndex].MainWindowHandle, SW_RESTORE);
                } 
            }
        }

        private void ReadMobHealth()
        {
            try
            {
                var staticOffset = Entities.mobStaticOffset;
                var offsetsValue = Entities.mobHealthOffetsValues;

                var memoryDataValue = new KDMemory(processName, moduleName, staticOffset, offsetsValue, WINAPI.ProcessAccessRights.PROCESS_VM_READ);

                foreach (var integer in memoryDataValue.GetInt32())
                {
                    mobHealth = integer;
                }
            }
            catch
            {
                Console.WriteLine("Error accessing target health");
            }
        }
    }
LiveLong23 is offline  
Reply

Tags
c#, kdmemory


Similar Threads Similar Threads
KDMemory (C# 32 & 64 Bit)
08/15/2023 - Coding Releases - 4 Replies
Features: Full support for 32 and 64 bit applications. Access all existing processes with the same name (multi clients). Everything is documented (inline documentation). Offsets can be used by just adding an array containing all offsets to the constructor. Possibility to use module names with a static offset (e.g. '"Tutorial-x86_64.exe"+002C7710'). TODO:
KDMemory (AutoIt 32 & 64 Bit)
04/02/2017 - AutoIt - 52 Replies
Functions:
Need help with KDMemory reading
05/22/2014 - AutoIt - 2 Replies
Hi i have tried this au3 file and seems to me that it dont work or i didnt make script to work :(. Its first time for me to work with memory so i need a bit help i get "@error:15, @extended:1" error here is my script #AutoIt3Wrapper_UseX64=y ; 64 Bit application #RequireAdmin
KDMemory Problem
11/28/2013 - AutoIt - 5 Replies
Ich kann leider diesen Pointer nicht auslesen: http://i.epvpimg.com/ffKeg.png Mein Code: #RequireAdmin #include "KDMemory.au3" Global $pid = ProcessExists("javaw.exe") Global $handle = _KDMemory_OpenProcess($pid) $baseAddress = _KDMemory_GetModuleBaseAddress($handle, "jvm.dll") + 0x00007AB4 Dim $offsets =



All times are GMT +1. The time now is 06:40.


Powered by vBulletin®
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2026 elitepvpers All Rights Reserved.