-
A very efficient object enumeration method~
This method has a qualitative leap compared to traditional object traversal, even in languages like Python that are far less efficient than C, traversing 100 objects only takes about 0.002 seconds
Code:
import pymem
def enum_object():
obj_dict = {}
chain_entry = pm.read_longlong(pm.base_address + 0x31c5600) + 0x120
cur_chain_ptr = pm.read_longlong(chain_entry)
if cur_chain_ptr == chain_entry:
return obj_dict
while True:
object_entry = cur_chain_ptr - 0x68
object_type = pm.read_bytes(object_entry + 0x10, 1)[0]
guid = int.from_bytes(pm.read_bytes(object_entry + 0x18, 0x10), "little", signed=False)
obj_dict[guid] = (object_type, hex(object_entry))
cur_chain_ptr = pm.read_longlong(cur_chain_ptr)
if cur_chain_ptr == chain_entry or cur_chain_ptr == 0:
return obj_dict
pm = pymem.Pymem("WowClassic.exe")
object_dict = enum_object()
obj_list.png
Last edited by qop1832; 12-11-2023 at 06:25 AM.
Hello everyone, I'm a newbie~ Recently I'm trying to study how to execute API externally and get the return value of API, as well as the release of aoe spells, come on!
-
Post Thanks / Like - 1 Thanks
wesdjkl02 (1 members gave Thanks to qop1832 for this useful post)
-
Contributor
Isn't what you're doing there already the traditional way? I'm confused
-
Maybe I'm lagging behind,,, before this I saw that almost all (including myself) object traversal requires the use of Count, and then
(Array + 0x8 * i) to traverse, this often requires nested loops, and does not jump out until enough Count has been read. This occasionally causes some problems and is very time-consuming. However, this does not require Count, and the code looks more concise and More efficient.
Hello everyone, I'm a newbie~ Recently I'm trying to study how to execute API externally and get the return value of API, as well as the release of aoe spells, come on!
-
Post Thanks / Like - 1 Thanks
wesdjkl02 (1 members gave Thanks to qop1832 for this useful post)
-
Contributor
Avid Ailurophile
-
Does this method pass in the GUID to return the object pointer? Or am I understanding it wrong?~ If this is the case, is there any efficient way to get the GUID of all visible objects?
Hello everyone, I'm a newbie~ Recently I'm trying to study how to execute API externally and get the return value of API, as well as the release of aoe spells, come on!