So I've been screwing around with the __asm block in VS2010 and I haven't been able to find a better way to get the pointer to the start of the assembly block.
The only way I know how to do this, is to declare a void function. One problem with this is that the void function will have its own assembly before and after my assembly block and I would have to compensate by getting the real address of the function and adding an offset.
Example:
c++
void myfunc(){
__asm{
nop
nop
nop
ret
}
}
Would result in assembly similar to this:
push ebp
mov ebp,esp
add esp,8
nop
nop
nop
retn
mov esp,ebp
pop ebp
retn
myfunc() would most likely error if executed.