is it possible to move an offset of a proc into a dword variable, and then call it somehow. Like

mov    pDword, offset SomeProc

call pDword
Posted on 2001-12-04 22:32:05 by ChimpFace9000
Sure it is... its how we built our OOP model... we filled structures with function offsets (and then called them "methods").

Should read thru our Objects.inc, you might find some usefull tricks (regardless if your interested in how to do OOP).

But at anyrate, here is a snippet from our DESTROY macro
mov eax, pName

push eax
call dword ptr [eax]


pName is a DWORD that basically points to the first "method" in any object structure. It first pushes itself (cause i need to pass this address into the method when called as a parameter (OOP stuff)), and then call the function itself.

Its quite simular to what you tried, but you need to qualify it with DWORD PTR []..

Hope this helps..

NaN
Posted on 2001-12-04 22:43:30 by NaN