Register for your free account! | Forgot your password?

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

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

Advertisement



object manager - wow c# "problem"

Discussion on object manager - wow c# "problem" within the .NET Languages forum part of the Coders Den category.

Reply
 
Old   #1
 
elite*gold: LOCKED
Join Date: Aug 2006
Posts: 3,292
Received Thanks: 866
object manager - wow c# "problem"

Hi,
Hab mich jetzt mal an den Object Manager gemacht und irgendwie will das nicht so klappen wie es soll.

Der SourceCode:
Code:
            uint curObj, nextObj, localObj = 0;
            UInt64 localGUID;

            /*Offsets used:
             * CurrMgr_Offs = 0x00BB43F0 + 0x2EB0
             * CurrMgr_Frs = 0xAC
             * CurrMgr_Nxt = 0x3C
             */

            while (true)
            {
                BlackMagic wow = new BlackMagic();
                wow.OpenProcessAndThread(SProcess.GetProcessFromWindowTitle("World of Warcraft"));
 
                uint playerbase = wow.ReadUInt(wow.ReadUInt(wow.ReadUInt(0xB366D0) + 0x34) + 0x24);
 
                localGUID = wow.ReadUInt64(0x00BB43F0 + 0x2EB0);
                Console.WriteLine("LocalGuid: 0x{0:X016}", localGUID);
 
                curObj = wow.ReadUInt(0x00BB43F0 + 0xAC);
                nextObj = curObj;
 
                localObj = curObj;
 
                float x = wow.ReadFloat(playerbase + 0x798);
                float y = wow.ReadFloat(playerbase + 0x79C);
                float z = wow.ReadFloat(playerbase + 0x7A0);
 
                Console.WriteLine("0x{0:X08} -- | {2} {3} {4}", curObj, x, y, z);
 
                nextObj = wow.ReadUInt(curObj + 0x3C);
                if (nextObj == curObj)
                    break;
                else
                    curObj = nextObj;
            }
 
            Console.ReadLine();
& einmal auf NoMorePasting:


Fehler in Zeile 40 bzw. 20 :
Der Index, basierend auf 0 (null), muss größer als oder gleich Null sein, und kleiner als die Größe der Argumentenliste.

Wo liegt der Fehler?

Danke für eure hilfe
scenebase is offline  
Old 05/20/2010, 00:52   #2
 
elite*gold: 20
Join Date: Sep 2006
Posts: 1,100
Received Thanks: 184
Ich kenne mich mit C# zwar nicht aus aber ich nehme einfach mal an das du
Code:
 Console.WriteLine("0x{0:X08} -- | {1} {2} {3}", curObj, x, y, z);
schreiben musst.

Übrigens ist es keine gute Idee in jedem Schleifendurchlauf ein neues BlackMagic Objekt zu erzeugen, zwar wird die Garbagecollection das aufräumen, jedoch kostet das verdammt viel Rechenzeit und solange die Garbagecollection noch nicht da war auch Speicher.
Du solltest in deinem Programm nur eine Instanz von BlackMagic erzeugen und diese über die Laufzeit deines Programms behalten, das spart dir eine Menge Rechenzeit.
Bot_interesierter is offline  
Old 05/24/2010, 14:36   #3
 
Bl@ze!'s Avatar
 
elite*gold: 240
Join Date: Dec 2006
Posts: 1,579
Received Thanks: 1,609
Aua, gib mir nen Moment.

Edit:

Das Problem liegt bei dir, dass du den Objektmanager nicht richtig verstanden hast und das du .toString() aufrufen musst wenn du ConsoleWrite bentuzt. (Die zweite Aussage ist nur eine Vermutung, da ich das nicht zu 100% sagen kann, ich arbeite sehr sehr sehr sehr sehr sehr sehr selten mit C#.)

So sollte es funktionieren...

Code:
	private uint firstObject()
	{
		//! First Object auslesen
	}

	private uint nextObject(uint aCurObject)
	{
		//! nextObject auslesen
	}
	
	private uint objectGUID(uint aCurObject)
	{
		// object Guid auslesen
	}	
	
	private float objectPositionX(uint aCurObject)
	{
		//! ... :)
	}

	private float objectPositionY(uint aCurObject)
	{
		//! ... :)
	}
	
	private float objectPositionZ(uint aCurObject)
	{
		//! ... :)
	}
	
	BlackMagic wow = new BlackMagic();
	wow.OpenProcessAndThread(
		SProcess.GetProcessFromWindowTitle("World of Warcraft"));
		
	uint playerBase = wow.ReadUInt(wow.ReadUInt(wow.ReadUInt(0xB366D0) + 0x34) + 0x24);
 
 
	//! Die ersten 500 Objekte

	uint curObject = firstObject();// firstObject() auslesen.
	
	for (int i = 0; i < 500; i++)
	{
		curObject = nextObject(curObject);
		
		if (curObject == 0)
			break;
			
		uint objectGUID 		= objectGuid(curObject);
		float objectPositionX	= objectPositionX(curObject);
		float objectPositionY	= objectPositionY(curObject);
		float objectPositionZ 	= objectPositionZ(curObject);
		
		// Console Write (mit .toString())			
		
		Console.ReadLine();
	}
Pastebin link:
Bl@ze! is offline  
Thanks
1 User
Old 05/24/2010, 14:52   #4
 
elite*gold: LOCKED
Join Date: Aug 2006
Posts: 3,292
Received Thanks: 866
Danke dir, ich werde es gleich mal probieren und dir bescheid geben
scenebase is offline  
Old 05/24/2010, 14:54   #5
 
elite*gold: 20
Join Date: Sep 2006
Posts: 1,100
Received Thanks: 184
@Unk0wn0x
ToString ist nicht erforderlich, lies die MSDN Seite über Console.WriteLine und Format Strings, der Fehler wird erzeugt weil sein Format String nicht den Regeln entspricht, er benutzt ein Format Array und übergibt Objekte als Argument, im Format Array hat er jedoch die Indexe falsch gezählt, deshalb auch der Vielsagende Compilerfehler.
Bot_interesierter is offline  
Old 05/24/2010, 16:32   #6
 
elite*gold: LOCKED
Join Date: Aug 2006
Posts: 3,292
Received Thanks: 866
Code:
                    float oX = wow.ReadFloat(wow.ReadUInt(curObj + 0x08) + 0x40);
                    float oY = wow.ReadFloat(wow.ReadUInt(curObj + 0x08) + 0x44);
                    float oZ = wow.ReadFloat(wow.ReadUInt(curObj + 0x08) + 0x48);
Sind die offsets richtig?

Output sieht so aus:


Jetzt brauch ich nur noch das Offset für Object Type.
scenebase is offline  
Old 05/25/2010, 17:09   #7
 
elite*gold: 20
Join Date: Sep 2006
Posts: 1,100
Received Thanks: 184
Wenn ich mich nicht ganz täusche dann sind die Offests wie folgt:
Code:
float oX = wow.ReadFloat(wow.ReadUInt(curObj + 0x08) + 0x28);
float oY = wow.ReadFloat(wow.ReadUInt(curObj + 0x08) + 0x2C);
float oZ = wow.ReadFloat(wow.ReadUInt(curObj + 0x08) + 0x30);
float oR = wow.ReadFloat(wow.ReadUInt(curObj + 0x08) + 0x34);

uint32 object_t = wow.ReadUInt(wow.ReadUInt(curObj + 0x08)+0x8);
Ich garantiere aber nicht dafür dass die Offsets stimmen
Bot_interesierter is offline  
Thanks
1 User
Old 05/25/2010, 22:53   #8
 
Endecs's Avatar
 
elite*gold: 0
Join Date: May 2009
Posts: 2,256
Received Thanks: 2,348
Machs so:

Code:
uint curObj = getFirstObj();
            while (true)
            {
                

                curObj=getNextObj(curObj);
                if (curObj == 0)
                {
                float XX = bm.ReadFloat(playerBase + 0x798);
                float YY = bm.ReadFloat(playerBase + 0x79C);
                float ZZ = bm.ReadFloat(playerBase + 0x7A0);
                
                Console.WriteLine("{0} {1} {2}", XX.ToString(), YY.ToString(), ZZ.ToString());;
                    Console.WriteLine("Round passed");
                    Console.ReadLine();
                    curObj = getFirstObj();
                }
                if (getType(curObj) == 5)
                {
                    Console.WriteLine("{0} found @ {1} {2} {3}", getObjName(curObj).ToString(), getOX(curObj).ToString(), getOY(curObj).ToString(), getOZ(curObj).ToString());
                    
                }
                
            }


 static uint getFirstObj()
        {
            try
            {
                uint s_curMgr = bm.ReadUInt(bm.ReadUInt(0x00BB43F0) + 0x2EB0);
                return bm.ReadUInt(s_curMgr + 0xAC); //Firstobject
            }
            catch { return 0; }
        }


static uint getNextObj(uint curObj)
        {
            try
            {
                return bm.ReadUInt(curObj + 0x3C);
            }
            catch { return 0; }
        }

etc.
Endecs is offline  
Thanks
1 User
Reply


Similar Threads Similar Threads
Deutsch übersetzter "object" Ordner
01/30/2010 - Metin2 Private Server - 2 Replies
Moin Comi. Hat vieleicht einer einen Deutsch übersetzten object Ordner ?? muss nicht ganz übersetz auf Deutsch sein aber möglichs viel. Könnte mir einer ein Link senden oder in den Thread schreiben damit jeder was davon hat ? wäre cool. MFG: Painsi^^



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


Powered by vBulletin®
Copyright ©2000 - 2025, 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 ©2025 elitepvpers All Rights Reserved.