I need someone who's better at deciphering ASM than I am. I've come as far as I can go, tonight, and am starting to get a headache with all of this reverse-engineering. Kynox, anyone, help me out!
Okay, so I've been working on how to determine how an enemy reacts to me (aggressive, neutral, friendly, etc.) and have started, but not finished, reverse-engineering the class method CUnit->GetUnitReaction(CUnit unit) (thanks to Kynox for the address, supplied in his InProcess Object Dumper). Here is what I've found:
CUnit->GetUnitReaction grabs the faction for unit1--faction is held at [[unit1+0x120]+0x74]--(the class object from which the method has been called) and the base address for unit2 (the unit against which unit1 is being compared) and passes them as arguments to a subroutine I've affectionately named GetFactionReaction(DWORD unit1faction, DWORD unit2).
GetFactionReaction then gleans unit2's faction using the same method as above and gets two addresses representing the two factions in a list (linked-list?) held in memory. It then passes these two addresses to another subroutine (hereafter known as CompareFactionHash, for lack of a better name) and THIS is the part that I have trouble following. CompareFactionHash is 0x005C8900.
Here's the relevant ASM for GetFactionReaction: [Only registered and activated users can see links. ]
And CompareFactionHash (WARNING: this is a long text-bomb, which is why I'm having such trouble with it). [Only registered and activated users can see links. ]
Thanks to whomever attempts to help. I'm really in the dark as to how it compares the two factions and gets how one reacts to the other.
Note: If you are debugging and you want to see what faction is what, convert your faction to decimal and go to http://www.thottbot.com/f#### where #### is the number of your faction. For instance, http://www.thottbot.com/f6 is the Tauren faction.
Site n00b.. (A leecher if I've been here for more than a month and can't earn 5 rep)
Rep Power: 1
Reputation: 3
Posts: 43
Join Date: May 2008
06-17-2008
i note in your code:
int factionIndex = Memory.ReadInt(hProcess, 0x93E80C);
int factionPointer = Memory.ReadInt(hProcess, 0x93E818);
int totalFactions = Memory.ReadInt(hProcess, 0x93E808);
(unit1 + 0x120)) + 0x74));
where do i get the address for unit1 and unit2 ? what is this value in terms of the objects in WOW? is this the base address of a WOW object?
does unit1/unit2 fit into this listing anywhere?
TWoWObject = record
DontCare1: Integer;//0x00
DontCare2: Integer;//0x04
DontCare3: Integer;//0x08 pointer to compl. struct i.e. eObjectFields
DontCare4: Integer;//0x0C end of compl. struct
DontCare5: Integer;//0x10
ObjectType: Integer; //0x14 == OBJECT TYPE LIST!
DontCare7: Integer;//0x18
DontCare8: Integer;//0x1C
DontCare9: Integer;//0x20
DontCare10: Integer;//0x24 ptr to item-struct?
PtrCheck: Integer;//0x28 PtrCheck == NextPtr while NextPtr --> WoWObject
DontCare12: Integer;//0x2C
GUID: Int64; //0x30 GUID
DontCare13: Integer;//0x38 end of each item-struct element (ptr to the next)?
NextPtr: Integer; //0x3C
end;
thanks for your sharing and for your thorough method of posting-
Site n00b.. (A leecher if I've been here for more than a month and can't earn 5 rep)
Rep Power: 1
Reputation: 3
Posts: 43
Join Date: May 2008
06-17-2008
thanks for the reply. i'll take a look at this in a bit.
my bot is fully working now. it kills/ skins/ loots/ mines, has custom combat scripts.
i need to work out how to ressurect, etc. next.
the reason i was asking about this is because my way of doing this is 98% perfect, but not always. so if i could work out the correct way to get the neutral/friendly/hostile thing my bot would not make some unintended errors in some places.
if you need any help about anything, pm me or ask for it in the forums. i have alot going on but i check here fairly regularly.