zl程序教程

您现在的位置是:首页 >  其他

当前栏目

MFC编写DLL窗口功能代码

2023-03-14 23:00:24 时间

一、在上节课内容上,添加两个按钮,并修改相应的属性值


0a2653c851af460fa595bd959398a8f1.png


二、编写吃苹果的功能,双击按钮进入代码区


void DTCK::OnBnClickedButton1()
{
     
       int pg = 0xbf1366;
       _asm
       {
              push 111
              call pg
              add esp,4
     
       }
     
       // TODO: 在此添加控件通知处理程序代码
}


三、编写吃香蕉的功能,双击吃香蕉按钮进入代码区


void DTCK::OnBnClickedButton2()
{
       int xj = 0xbf110e;
       _asm
       {
              push 111
              push 222
              call xj
              add esp, 8
       }
       // TODO: 在此添加控件通知处理程序代码
}


四、编译生成dll文件,重新注入,成功注入

0eacb84100b54626af849e6b562bf92a.png