 <p>Why don't you just call shellcode right away? Instead of getting it's pointer and calling it through the pointer. </p> <p>If you want to do something similar in VB.NET it'll look like this.</p> <pre><code>Function Func() As Integer Return 1 End Function Delegate Function FuncDelegate() As Integer Sub Main() Dim ret As FuncDelegate ret = AddressOf Func Console.WriteLine(ret()) End Sub </code></pre>