在汇编中注册ClassEx
我正在尝试手动调用 RegisterClassEx Windows API,而不在 .data 部分使用 WNDCLASS 结构,我需要仅使用 push
指令创建此结构。
有人可以帮我吗?
多谢
I'm trying to manually call RegisterClassEx Windows API without using a WNDCLASS structure on .data section, I need to create this structure only using push
instruction.
Could someone help me on that please?
Thanks a lot
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
事实上,您可以轻松地做您想做的事。您只需要小心地正确计算结构中每个元素的地址即可。但这也是一个简单的任务...;)
请查看我所做的代码:
您只需要把它放在调用 CreateWindow 之前。
有任何疑问就喊吧。
PS.:记住 WndProc 是汇编程序的循环过程
In fact you can easily do what you want. You just need to be careful to correctly calculate the addresses of each element of the structure. But this is also an easy task... ;)
Please check out the code I did:
You just need to put this before the call to CreateWindow.
Any doubt just shout.
PS.: Remember that WndProc is the loop procedure of your Assembly program
您应该推送其偏移量,而不是结构本身
对于局部变量,推送其地址
You should push its offset, not structure itself
For local variable, push its address
反转push结构体入栈,push有效地址到第一项,调用RegisterClassEx,pop堆栈外的结构。
Reverse push the structure to the stack, push the effective address to the first item, call RegisterClassEx, pop the structure off the stack.