Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ASM In c++ project ...How this little asm code will be in c++

Tags:

c++

assembly

Hellow I found an asm code ... which was integrated in c++ project

template <class T>
T returned; 

BYTE *tem = buffer;
__asm
{
    mov eax, tem
    call eax
    mov  returned, eax
}

So As I don´t know asm It is hard To understood what this code means ... Can anyone convert this ASM code in c++ entirely and post here :) Ttanks...

like image 963
Davit Tvildiani Avatar asked Dec 09 '22 08:12

Davit Tvildiani


1 Answers

It looks like it is executing code placed in a buffer and returning the contents of the EAX register. You might try this:

typedef T (*pfn)();

returned = ((pfn) buffer)();
like image 141
Ferruccio Avatar answered Dec 25 '22 23:12

Ferruccio