C++内联汇编,微信崩溃,查看OD有些堆栈地址变为CCCCCCCC

#include "pch.h"
#include "framework.h"
#include <Windows.h>
#include<stdio.h>

struct wxStr {
	wchar_t * pStr;
	int strLen;
	int strLen2;
};

DWORD getWeChatWin() {
	return (DWORD)LoadLibrary(L"WeChatWin.dll");
}

VOID sendTextMsg(wchar_t * wxid,wchar_t * message) {
	DWORD sendTextCall = getWeChatWin() + 0x10A1CB;
	//DWORD sendEax = getWeChatWin() + 0x18A3AC8;
	wxStr pWxid = {0};
	pWxid.pStr = wxid;
	pWxid.strLen = wcslen(wxid);
	pWxid.strLen2 = wcslen(wxid) * 2;

	wxStr pMsg = { 0 };
	pMsg.pStr = message;
	pMsg.strLen = wcslen(message);
	pMsg.strLen2 = wcslen(message) * 2;


	/* push 0x1; 1																
	   push edi; 群@好友																
	   push ebx; 内容															
	   lea edx, dword ptr ss : [ebp - 0x88]; id									
	   lea ecx, dword ptr ss : [ebp - 0x5A8]; 缓冲区(装id和内容)				
	   call WeChatWi.5CBD0C20													
	   add esp, 0xC; 平栈														
	   */						 								
	char *asmWxid = (char *) &pWxid.pStr;	
	char *asmMessage = (char *) &pMsg.pStr;
	char *buff[0x5A8] = { 0 };
	MessageBox(NULL, L"在这之前微信是好的", L"运行到这里", 0);

	__asm {
		push 0x1
		mov edi ,0x0
		push edi	

		mov ebx, asmMessage
		push ebx

		mov edx, asmWxid
		push edx

		lea ecx, buff
		call sendTextCall

		add esp, 0xC
	}

}

 

 

不知道你这个问题是否已经解决, 如果还没有解决的话:

如果你已经解决了该问题, 非常希望你能够分享一下解决方案, 以帮助更多的人 ^-^