Assembly pass pointer to function

后端 未结 2 416
失恋的感觉
失恋的感觉 2021-01-21 12:57

I\'m trying to sent DWORD variable into function as pointer paramater

variable1 dd 1
...
push [variable1]  ; push variable adress
call _InitPoiner
...
_InitPoine         


        
2条回答
  •  佛祖请我去吃肉
    2021-01-21 13:27

    You are making sure that you pop your vars when done?

    Looking at your example, I see no way that the variable could ever be 11. It starts as 1 at the dd assignment, then if your math in the lea is correct, it would then be 10. If you were to step this through a debugger, you could check if your lea / mov combo is working right. Either way, I would expect 1 or 10, not 11.

    Maybe you meant to add instead of mov?

提交回复
热议问题