c++ - __userpurge 调用 (IDA)

标签 c++ assembly

我试图从另一个 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/

相关文章:

assembly - DCPU-16 中的 I 和 J 寄存器是特殊的吗?

assembly - MIPS 汇编语言 - 临时寄存器与保存的寄存器

assembly - 打印有符号整数优化

c - 当我调用 jmp 时,我在 c 内联汇编中遇到了段错误

c++ - 为什么我不能在类中有一个非整数静态常量成员?

c++ - move : what does it take?

c++ - 像数组一样访问 c++ 队列元素

c++ - 如何在 C++ 中调用可变参数模板构造函数?

c++ - 为什么我的快速排序如此低效?

c++ - 如何检查编译后的代码是否使用了 SSE 和 AVX 指令?