• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Getting current pos from client

Webtimize

Pro Grammer
Joined
Oct 3, 2011
Messages
491
Solutions
10
Reaction score
182
Location
Hell
Hey!

I was just wondering, is there anyway to get the current position from the client to another program running on the client machine? Or is there a way to intercept the positions while its being send to the server, and redirect it back to the program and server?

Thanks! :)
 
thats not what he wants he just want to make a progrm that gets the position you standing on. read is something what most people wont do on this forum
 
Quick example in C# MCVS 2013.
Addresses are for 9.83
Code:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

using System.Diagnostics;
using System.Runtime.InteropServices;

namespace WindowsFormsApplication1
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }
        const int PROCESS_WM_READ = 0x0010;

        [DllImport("kernel32.dll")]
        public static extern IntPtr OpenProcess(int dwDesiredAccess, bool bInheritHandle, int dwProcessId);

        [DllImport("kernel32.dll")]
        public static extern bool ReadProcessMemory(int hProcess,
          int lpBaseAddress, byte[] lpBuffer, int dwSize, ref int lpNumberOfBytesRead);

        private void timerUpdate_Tick(object sender, EventArgs e)
        {
            Process[] processes = Process.GetProcessesByName("tibia");
            if (processes.Length == 0) {
                labelOutput.Text = "Tibia.exe not found.";
                return;
            }

            Process process = processes[0];
            IntPtr processHandle = OpenProcess(PROCESS_WM_READ, false, process.Id);

            int bytesRead = 0;
            byte[] bufferX = new byte[4];
            byte[] bufferY = new byte[4];
            byte[] bufferZ = new byte[4];

            Int32 baseAddr = process.MainModule.BaseAddress.ToInt32();
            ReadProcessMemory((int)processHandle, baseAddr + 0x587EA8, bufferX, bufferX.Length, ref bytesRead);
            ReadProcessMemory((int)processHandle, baseAddr + 0x587EAC, bufferY, bufferY.Length, ref bytesRead);
            ReadProcessMemory((int)processHandle, baseAddr + 0x587EB0, bufferZ, bufferZ.Length, ref bytesRead);

            labelOutput.Text = BitConverter.ToInt32(bufferX, 0).ToString() + " " + BitConverter.ToInt32(bufferY, 0).ToString() + " " + BitConverter.ToInt32(bufferZ, 0).ToString();
        }
    }
}
 
Back
Top