View previous topic :: View next topic |
Author |
Message |
QuarryTen Newbie cheater Reputation: 0
Joined: 25 Aug 2019 Posts: 19
|
Posted: Tue Apr 18, 2023 4:04 am Post subject: Dyanmic array of pointers |
|
|
Is it possible to create a dynamic array of pointers with AutoAssembler? Does this require Lua, instead?
Essentially what I want to do is create a symbol and use it as an array, with each element being a pointer to the HP of every mob/NPC that a particular instruction accesses. Ideally, each mob will have a unique address.
By dynamic, I mean that this symbol will create a new pointer to each and every unique address that the instruction accesses.
|
|
Back to top |
|
|
++METHOS I post too much Reputation: 92
Joined: 29 Oct 2010 Posts: 4197
|
Posted: Tue Apr 18, 2023 5:01 am Post subject: |
|
|
It is possible in the way that I explained here (with a limited number of addresses that do not change), but if you are wanting to be able to auto-populate a list of addresses that get accessed by a particular instruction, then you will likely need more than a basic assembly script.
I think, this may not be practical at all. Even if you can capture all of the addresses that get accessed (and you do not mind that there may be hundreds of them), you will still need to be able to filter out old addresses that become unusable.
Last edited by ++METHOS on Tue Apr 18, 2023 5:08 am; edited 1 time in total |
|
Back to top |
|
|
Csimbi I post too much Reputation: 94
Joined: 14 Jul 2007 Posts: 3110
|
Posted: Tue Apr 18, 2023 5:07 am Post subject: |
|
|
Strictly speaking, you cannot do it with AA and you should use LUA.
There are two workarounds - the smart choice and the simple choice.
1. The smart choice is to create an ASM code in the AA script that you can call directly to access/manage the pointer array for you.
2. The simple choice is to allocate a large enough chunk of memory (that you will never exceed) just for the pointers and calculate the right pointer address every time you want to access it from the index. e.g. lea rsi,[rax*8].
Your third point defeats all options, however, because it sounds like you want an infinite log type of thing, which can eat all your memory in seconds in case it's a frequently accessed address. Plus, the requirement on being unique means an unordered search every time.
I would discourage you from recording every pointer and encourage you to think about what it is you want to achieve.
With that goal in mind, think about can you record only the few things that you really need, and maybe consider log into a file instead (in case of infrequent access).
|
|
Back to top |
|
|
QuarryTen Newbie cheater Reputation: 0
Joined: 25 Aug 2019 Posts: 19
|
Posted: Tue Apr 18, 2023 11:52 am Post subject: |
|
|
Yes, I have that thread open in another tab and while your explanation seems pretty simple and straightforward, I can't seem to come up with the code to execute it. The concept is there, but the code just isn't doing what I want it to. I can't think of anyway of creating up to filters for 15 addresses without creating 15 symbols, haha. Just try to further explore my options.
I was thinking this might be an resource hungry choice, haha.
Thanks for the advice, guys.
|
|
Back to top |
|
|
++METHOS I post too much Reputation: 92
Joined: 29 Oct 2010 Posts: 4197
|
Posted: Tue Apr 18, 2023 11:46 pm Post subject: |
|
|
Probably, we could provide better assistance if you could explain exactly what it is that you are trying to accomplish (and why).
Depending on that, and depending on the type of data and how it is being handled etc., may help us to determine which options (if any) may be available. Otherwise, we can only speculate.
|
|
Back to top |
|
|
|