On 15-05-2012 22:51, Gor Gyolchanyan wrote:
I think I had that one before. Try this one:
void foo()
{
     void* foopt = cast(void*)&foo;
     asm
     {
         naked;
         mov EAX fooptr;
     }
}

On Tue, May 15, 2012 at 11:33 PM, Mehrdad <[email protected]
<mailto:[email protected]>> wrote:

    How do get the address of a function in naked assembly code?

    void foo()
    {
            asm
            {
                    naked;
                    mov EAX, &foo;
            }
    }

    This doesn't work...




--
Bye,
Gor Gyolchanyan.

That's not naked inline asm, though.

Something like this might work:

void foo()
{
        asm
        {
                naked;
                mox EAX, dword ptr foo;
                /* whatever... */
        }
}

--
Alex Rønne Petersen
[email protected]
http://lycus.org

Reply via email to