I saw the code assumes it can move on the next parameter by adding the size of an integer to the pointer to the first parameter.
It works for the first param but crashes for the second.
OK, I looked at the stack, it seems the parameters on x64 Linux are 16 bits aligned and so are separated by 8 bytes.
In fact, if I change the line
to
Code: Select all
*args + SizeOf ( Integer ) * 2
Break
the code works again.
Is this actually how it is supposed to be ? On x64 Windows the params are on the stack simply one after another.
UPDATE:
Maybe I found it. Looks like it's the Purifier.
Yes, it really looks like it's that. With the Purifier enabled the offset becomes 16 bytes instead of 8, but ONLY under Linux x64, everywhere else does not have any effect (?).
This is a problem because I can't enable the Purifier if the source is using this code. Maybe it's possible to disable it around the procedure, but I'm not crazy about it.