flat assembler
Message board for the users of flat assembler.
Index
> Windows > Win64 Global Hook Problem |
Author |
|
revolution 18 Feb 2010, 05:35
Check out the fastcall standard and then compare that to the registers you have used. Now look at the invoke macro code and see what code is generated.
The fastcall macro works forward through the parameters so you can't put them in that order because the values are overwritten before they are used. It is a 'gotcha' in the macros. If you look at the generated code you should see this: Code: ; fastcall function,[value],rcx,rdx,r8 sub rsp,0x20 mov rcx,[value] mov rdx,rcx mov r8,rdx mov r9,r8 call [function] |
|||
18 Feb 2010, 05:35 |
|
revolution 18 Feb 2010, 05:47
NOTE: this particular problem can be solved by working backwards through the parameters. But it would still not be a general solution. Best would be if the macros gave an error when a register is used as source data after being overwritten.
|
|||
18 Feb 2010, 05:47 |
|
TimK 18 Feb 2010, 06:04
That is, temporary storage is required anyway, even without invoke... Thanks!
|
|||
18 Feb 2010, 06:04 |
|
revolution 18 Feb 2010, 06:11
TimK wrote: That is, temporary storage is required anyway, even without invoke... Code: ; fastcall function,[value],rcx,rdx,r8 sub rsp,0x20 mov r9,r8 mov r8,rdx mov rdx,rcx mov rcx,[value] call [function] |
|||
18 Feb 2010, 06:11 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.