Yulo
Yulo

Reputation: 291

label as a parameter

void InitCallback(DWORD callback)
{
goto EndTramp;
Tramp:

 __asm
 {
  pushad
                call callback
                popad 
  ret 
 }
EndTramp:

 JmpPatch(0x6D8AC1, (DWORD)Tramp);
 return;
}

error C2065: 'Tramp' : undeclared identifier

How extract address from a label?

Upvotes: 0

Views: 127

Answers (1)

Jonathan Leffler
Jonathan Leffler

Reputation: 753695

There isn't a portable way to obtain the address of a label in C or its descendants.

I see you're on Windows with MSVC - it often helps to be explicit about platform (and, in this case, compiler) versions. There might be a specific trick, but there probably isn't.

Maybe you're reverse-engineering some assembler code and need to incorporate more of the code in assembler.

Upvotes: 2

Related Questions