I know I'm not supposed to post questions in this forum, but I figured that this is the place where the relevant people who might know what I'm talking about are likely to read... And are likely to have come accross the same problem. So, sorry about that :P
Just wondering if anyone knows a cleaner way to read deeply nested pointers in AutoIt? In C# I made a function which can have a variable number of arguments passed to it by using:
As one of the arguments....
So, basically, this is the whole function:
Which I can call like this:
I can have any amount of nested offsets in that list at the end. Looks much neater than this, don't you agree?
Does anybody have a more elegant solution that I could please "borrow"? :)
Thanks in advance
dumbfck
P.S., There's a clue in the C# example call code snippet above about something potentially quite exciting that I shall be posting within the next few days ;)
Just wondering if anyone knows a cleaner way to read deeply nested pointers in AutoIt? In C# I made a function which can have a variable number of arguments passed to it by using:
Code:
params uint[] p
So, basically, this is the whole function:
Code:
// Resolves a nested pointer, i.e., [[[[someAddress]+24]+28]+4]
// To return the data referenced by the pointer (uint only) use 0 as the last param.
public static uint resolveNestedPointer(IntPtr processHandle, uint firstAddr, params uint[] p)
{
uint val = MemReadUInt(processHandle, firstAddr);
for (int i = 0; i < p.Length - 1; i++)
{
val = MemReadUInt(processHandle, val + p[i]);
}
return (uint)(val + p[p.Length - 1]);
}
Code:
uint chatClassPtr = MemFunctions.resolveNestedPointer(pr_processHandle, baseCall, 0x1C, 0x18, 0x8, 0xC4, 0x20, 0);
Code:
$pointer = _MemoryRead(_MemoryRead(_MemoryRead(_MemoryRead(_MemoryRead(_MemoryRead(_MemoryRead(_MemoryRead($baseCall, $pHandle) + 0x1C, $pHandle) + 0x18, $pHandle) + 0x8, $pHandle) + 0xC4, $pHandle) + 0x20, $pHandle) + 0x0, $pHandle)
Thanks in advance
dumbfck
P.S., There's a clue in the C# example call code snippet above about something potentially quite exciting that I shall be posting within the next few days ;)