-
Member
WoW 3.3.5a 12340 Memory Reading
Hello My Name is WoWBotGuyDude and this is my first thread,
i am currently developing a bot for WoW 3.3.5a 12340.
The projects purpose is only learning. I want to know more about how Programms work, how i should build a programm and especially machine learning.
I want to build certain combat rotations with machine learning (would be really cool for private server rading^^)
So far i got a programm to retrive certain information from WoWObjects by Memory reading.
For Example now i can monitor many things like: Players Cooldown Time by a given Spell ID, Any WoWUnits Buff Time and Stacks by a given GUID and Buff ID, Any WoWUnits Stats like Healt, Crit, Haste, etc.
So i am almost finished with gathering information about the game.
But i want one last thing, and that is to get the whole Combat Log. I searched google and the Forum but i only found few answers, mostly about getting the general chat.
With all the searching i have found two options so far:
1. More searching/asking the forum
2. To retrive the Combat Log with an ingame Addon and save the Combat Log to a varriable that i can easily find (for example a GUI element that only changes the Adress when the game reloads)
Now i want to know what should i do. Is it even possible to read the Combat Log directly from Memory or should i go with option 2 ?
Thanks for Reply,
WoWBotGuyDude
-
Try hooking the COMBAT_LOG_EVENT.
Just a guess based on 3.3.5a 12340 Offsets
Code:
00615020 SignalEvent
-
Post Thanks / Like - 1 Thanks
Miksu (1 members gave Thanks to DarkLinux for this useful post)
-
Member
At First Thanks for the reply.
But I think i should add further Information about The Project
I am a Mechanicle Engenering Student so Pragraming in General isn't my Main subject so i dont want to some complicated Things Like injecting or actually Reversing Things by my self Like the pros (looking at a wow object in Cheat engine and searching some values is okay)
The whole Code is written in phython and i am using Microsofts kernel32 functions Like ReadProcessMemory or OpenProcess and i would Like to Stay there. So basicly i am looking for some Offsets to a "CombatLogManager" If There is such a thing.
-
Contributor
Originally Posted by
WoWBotGuyDude
Hello My Name is WoWBotGuyDude and this is my first thread,
...
So far i got a programm to retrive certain information from WoWObjects by Memory reading.
...
I am a Mechanicle Engenering Student so Pragraming in General isn't my Main subject so i dont want to some complicated Things Like injecting or actually Reversing
...
The whole Code is written in phython and i am using Microsofts kernel32 functions Like ReadProcessMemory or OpenProcess and i would Like to Stay there.
...
WoWBotGuyDude
Cough...troll...WoWBotGuyDude.
-
Member
Originally Posted by
tutrakan
Cough...troll...WoWBotGuyDude.
Why do you think this is Trolling ?
-
Contributor
Originally Posted by
WoWBotGuyDude
Why do you think this is Trolling ?
I'm not 100% sure, but I've read so many "first threads" here, that at some point i become a bit paranoiac
Your nickname, style, all that you already achieved (for a beginner) and the python came too much for me
Sorry if I ever made a mistake about all this.
P.S. About the combat log - a simple string search in IDA and using the tomrus's .idb will reveal you many useful combat log functions and the enum itself.
At that point you will really need a minimum of reversing skills in order to hook and read the log.
Last edited by tutrakan; 04-27-2018 at 07:14 AM.
-
Post Thanks / Like - 1 Thanks
WoWBotGuyDude (1 members gave Thanks to tutrakan for this useful post)
-
Member
Okay.
I am Not realy a beginner, i started the Project about one year ago and Spend a vast amount of my Free time to it.
First i read a Lot of Ownedcore, WoWApi and similar stuff.
Then i build a small Proof of concept machine learning rotations Prototype. i got my Data from wow through a custom addon and writing a String to a GUI that has a Adresse that only Changes on reload, Then Reading from that Adresse with kernel32.ReadProcessMemory. It worked Kind of but it wasnt really possible to add functionality.
So i Made a Longer Break and started it again from the bottom. This was about 1 month ago and now i am Up with the Programm discribed in the First Post.
I never used Ida neither i wrote any assembly Code(only a little Bit of C). But i think it could be a usefull Thing for the project. However i am Not a Computer science Guy. I use Python for Things Like matplotlib or numpy. So i dont wont to Dive too deep Into Computer science.
Long Story Short: is it a Lot of Work to get Into Reversing that i can get stuff Like CombatLog or Cooldowns by my self ?
-
Contributor
Originally Posted by
WoWBotGuyDude
...
Long Story Short: is it a Lot of Work to get Into Reversing that i can get stuff Like CombatLog or Cooldowns by my self ?
You will have to find that for yourself (try to read the struct @0x00ADB97C). The function that logs is here @0x00750400:
Code:
int __cdecl AddCombatLogEntry(CombatLogMessage a1, SpellRec *a2)
And the enum messages are @0x00ADB758.
Take a look at this one too:
Code:
signed int __cdecl Lua_CombatLogGetNumEntries(int a1)
{
int v1; // eax
int v2; // ebx
signed int v3; // esi
int v4; // edi
v1 = FrameScript::GetParamValue(a1, 1, 0);
v2 = s_pendingCombatLogEntry;
v3 = 0;
v4 = v1;
if ( s_pendingCombatLogEntry & 1 || !s_pendingCombatLogEntry )
v2 = 0;
while ( !(v2 & 1) && v2 && !*(v2 + 0x10) )
{
if ( v4 || CombatLogEntry::MatchesFilter(v2) )
++v3;
v2 = *(v2 + 4);
}
lua_pushinteger(a1, v3);
return 1;
}
Last edited by tutrakan; 04-27-2018 at 12:02 PM.
-
Post Thanks / Like - 1 Thanks
WoWBotGuyDude (1 members gave Thanks to tutrakan for this useful post)
-
Member
okay thats a good advice^^
https://www.ownedcore.com/forums/wor...ple-stuff.html ([Guide] Finding not so simple stuff.)
i once found this guide, do you think this is a good starting point ?
-
Contributor
Originally Posted by
WoWBotGuyDude
I suppose that it has something useful, but i would suggest to you - to find your own way.
You can ask me for any questions you have via the skype i provided to my profile.
-
Member
okay.
Today i gave the the combat log part a second thought and i know that Evironment Spells like Death and Decay are stored as WoWObjects in the Object Manager.
I dont know about these "SpellObjects" and what that exactly reval about the World (of Warcraft^^) but i could imagine that also other spells like a Fireball are also stored in a similar way.
So i thought it could be possible to get the Data that i want by looking at these "SpellObjects" instead of looking at the CombatLog.
The Data that i want is basicly a spell History for the player and eventually other units which gives me for that Unit all used Heal and Damage Spells (including Autoatacks): Timestamp, TargetGUID, SpellDamage (and Healing), SpellCritted, SpellMissed.
Also i want in the futur know more about espicially Environment Spells and theier location (so i could make asuments about where to move(for raiding movment routines as example)), so i have to look at "SpellObjects" anyway.
Last edited by WoWBotGuyDude; 04-28-2018 at 12:01 PM.
-
Member
I think you'd save a lot of effort if you used Lua directly for example tracking combat log stuff.
local f = CreateFrame("Frame")
f:SetScript("OnEvent", function(self, event, ...)
local timestamp, subevent, and_so_on = ...
-- do stuff with data
end)
f:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED")
You could also register lua function from your program and make the frame forward all events to function in your program. It's fairly popular method for reading event data.
I'm not sure how to read AoE locations from memory but I know you can read them from SPELL_GO packet at least.
-
Member
I think Thats exactly what i am doing now.
I wrote a custom wow addon wich Posts all CombatLogEvents to a privat Chat Channel. Then i read the Chat Objects from the memory, subsequently filtering Them for my CombatLogEvent Posts. Now i can get DPS of Given time and Others statistics about used spells.
Now i ask my self If There is a elegant way of getting the Data Out of the addon ?
-
Member
You can register lua function from your application.
eg
/*
Your application
/*
int LuaCallback(int *L){
const char* data_from_addon = lua_tostring(L,1);
// Do stuff
return 0;
}
// call to Framescript_registerfunction("mycallback", LuaCallback)
// In the addon
f:SetScript("OnEvent", function(self, event, ...)
local timestamp, subevent, and_so_on = ...
-- do stuff with data
mycallback(somedata)
end)
EDIT: AddOn isn't necessary since you can also just run DoString with the script instead.
-
Member
i dont know how to register a function in my application ^^
do you have any other informations about this ?