我试图从另一个 dll 调用一个函数,知道她的确切地址和参数。
在 IDA 中:
int __userpurge sub_104CC1A0<eax>(int a1<ecx>, double a2<st0>, int a3)
我在 stackoverflow.com 上找到了类似的答案,但我得到了错误:
struct typechat
{
unsigned int a;
unsigned int b;
unsigned int type;
};
typechat * point;
DWORD callAddress = 0x4CC1A0 + baseaddr;
__declspec(naked) int SendMsg(char * text, double time, typechat * a3)
{
__asm{
push ebp
mov ebp, esp
push ebx
push a3
mov st0, time // error C2415: invalid operand type
mov ecx, text
call[callAddress]
pop ebx
leave
ret
}
}
错误 C2415:无效的操作数类型
switch ( *(_DWORD *)(a3 + 8) )//chat type ,[code from IDA]
{
}
更新:
_
//int __userpurge sub_104CC1A0<eax>(int a1<ecx>, double a2<st0>, int a3)
declspec(naked) int SendMsg(char * text, double nTime, typechat * nType)
{
__asm{
push ebp
mov ebp, esp
push nType
fld nTime
push ecx
mov ecx, text
move eax, [callAddress]
call eax
pop ecx
leave
ret
}
}
这个功能太不行了! : (不叫callAddress)
最佳答案
AFAIK,你不能MOV
一个值到ST0
寄存器,你必须使用FLD
,例如:
fld time
关于c++ - __userpurge 调用 (IDA),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20806865/